From 302f179c851d3a8c953400ca0d2789546c50491c Mon Sep 17 00:00:00 2001 From: liruncong Date: Tue, 9 Feb 2021 23:18:45 +0800 Subject: 修正rt_thread_delay_untilæ—¶é—´ä¸�准问题,å�Šé”™è¯¯ä½¿ç”¨æ— ç¬¦å�·æ¯”较问题 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/thread.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/thread.c b/src/thread.c index 0db9dd8e4d..627b7e898e 100644 --- a/src/thread.c +++ b/src/thread.c @@ -585,6 +585,7 @@ rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick) { register rt_base_t level; struct rt_thread *thread; + rt_tick_t cur_tick; RT_ASSERT(tick != RT_NULL); @@ -596,15 +597,19 @@ rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick) /* disable interrupt */ level = rt_hw_interrupt_disable(); - if (rt_tick_get() - *tick < inc_tick) + cur_tick = rt_tick_get(); + if ((rt_int32_t)(cur_tick - *tick) < (rt_int32_t)inc_tick) { - *tick = *tick + inc_tick - rt_tick_get(); + rt_tick_t left_tick; + + *tick += inc_tick; + left_tick = *tick - cur_tick; /* suspend thread */ rt_thread_suspend(thread); /* reset the timeout of thread timer and start it */ - rt_timer_control(&(thread->thread_timer), RT_TIMER_CTRL_SET_TIME, tick); + rt_timer_control(&(thread->thread_timer), RT_TIMER_CTRL_SET_TIME, &left_tick); rt_timer_start(&(thread->thread_timer)); /* enable interrupt */ @@ -620,12 +625,10 @@ rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick) } else { + *tick = cur_tick; rt_hw_interrupt_enable(level); } - /* get the wakeup tick */ - *tick = rt_tick_get(); - return RT_EOK; } RTM_EXPORT(rt_thread_delay_until); -- cgit v1.3.1 From 114f305f7725309101a4296410d3f95f567aeb1a Mon Sep 17 00:00:00 2001 From: WillianChan Date: Sat, 20 Feb 2021 15:27:37 +0800 Subject: [kernel][memheap]add memory heap track and memory heap check. Signed-off-by: WillianChan --- src/memheap.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 186 insertions(+), 13 deletions(-) diff --git a/src/memheap.c b/src/memheap.c index afa06fb9bf..ebd86b87d6 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -35,6 +35,45 @@ #define RT_MEMHEAP_SIZE RT_ALIGN(sizeof(struct rt_memheap_item), RT_ALIGN_SIZE) #define MEMITEM_SIZE(item) ((rt_ubase_t)item->next - (rt_ubase_t)item - RT_MEMHEAP_SIZE) +#define MEMITEM(ptr) (struct rt_memheap_item*)((rt_uint8_t*)ptr - RT_MEMHEAP_SIZE) + +#ifdef RT_USING_MEMTRACE +rt_inline void rt_memheap_setname(struct rt_memheap_item *item, const char *name) +{ + int index; + rt_uint8_t* ptr; + + ptr = (rt_uint8_t*)&(item->next_free); + for (index = 0; index < sizeof(void*); index ++) + { + if (name[index] == '\0') break; + ptr[index] = name[index]; + } + if (name[index] == '\0') ptr[index] = '\0'; + else + { + ptr = (rt_uint8_t*)&(item->prev_free); + for (index = 0; index < sizeof(void*) && (index + sizeof(void*))< RT_NAME_MAX; index ++) + { + if (name[sizeof(void*) + index] == '\0') break; + ptr[index] = name[sizeof(void*) + index]; + } + + if (name[sizeof(void*) + index] == '\0') ptr[index] = '\0'; + } +} + +void rt_mem_set_tag(void* ptr, const char* name) +{ + struct rt_memheap_item* item; + + if (ptr && name) + { + item = MEMITEM(ptr); + rt_memheap_setname(item, name); + } +} +#endif /* * The initialized memory pool will be: @@ -66,7 +105,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap, /* initialize the free list header */ item = &(memheap->free_header); - item->magic = RT_MEMHEAP_MAGIC; + item->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_FREED); item->pool_ptr = memheap; item->next = RT_NULL; item->prev = RT_NULL; @@ -78,7 +117,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap, /* initialize the first big memory block */ item = (struct rt_memheap_item *)start_addr; - item->magic = RT_MEMHEAP_MAGIC; + item->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_FREED); item->pool_ptr = memheap; item->next = RT_NULL; item->prev = RT_NULL; @@ -103,7 +142,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap, */ item = item->next; /* it's a used memory block */ - item->magic = RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED; + item->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED); item->pool_ptr = memheap; item->next = (struct rt_memheap_item *)start_addr; item->prev = (struct rt_memheap_item *)start_addr; @@ -201,7 +240,7 @@ void *rt_memheap_alloc(struct rt_memheap *heap, rt_size_t size) new_ptr)); /* mark the new block as a memory block and freed. */ - new_ptr->magic = RT_MEMHEAP_MAGIC; + new_ptr->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_FREED); /* put the pool pointer into the new block. */ new_ptr->pool_ptr = heap; @@ -255,7 +294,7 @@ void *rt_memheap_alloc(struct rt_memheap *heap, rt_size_t size) } /* Mark the allocated block as not available. */ - header_ptr->magic |= RT_MEMHEAP_USED; + header_ptr->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED); /* release lock */ rt_sem_release(&(heap->lock)); @@ -376,7 +415,7 @@ void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize) next_ptr->prev)); /* mark the new block as a memory block and freed. */ - next_ptr->magic = RT_MEMHEAP_MAGIC; + next_ptr->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_FREED); /* put the pool pointer into the new block. */ next_ptr->pool_ptr = heap; @@ -441,7 +480,7 @@ void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize) new_ptr)); /* mark the new block as a memory block and freed. */ - new_ptr->magic = RT_MEMHEAP_MAGIC; + new_ptr->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_FREED); /* put the pool pointer into the new block. */ new_ptr->pool_ptr = heap; @@ -512,8 +551,11 @@ void rt_memheap_free(void *ptr) ptr, header_ptr)); /* check magic */ - RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC); - RT_ASSERT(header_ptr->magic & RT_MEMHEAP_USED); + if (header_ptr->magic != (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED)) + { + RT_DEBUG_LOG("bad magic:0x%08x @ memheap\n", header_ptr->magic); + } + RT_ASSERT(header_ptr->magic == (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED)); /* check whether this block of memory has been over-written. */ RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC); @@ -533,9 +575,9 @@ void rt_memheap_free(void *ptr) } /* Mark the memory as available. */ - header_ptr->magic &= ~RT_MEMHEAP_USED; + header_ptr->magic = (RT_MEMHEAP_MAGIC | RT_MEMHEAP_FREED); /* Adjust the available number of bytes. */ - heap->available_size = heap->available_size + MEMITEM_SIZE(header_ptr); + heap->available_size += MEMITEM_SIZE(header_ptr); /* Determine if the block can be merged with the previous neighbor. */ if (!RT_MEMHEAP_IS_USED(header_ptr->prev)) @@ -544,7 +586,7 @@ void rt_memheap_free(void *ptr) header_ptr->prev)); /* adjust the available number of bytes. */ - heap->available_size = heap->available_size + RT_MEMHEAP_SIZE; + heap->available_size += RT_MEMHEAP_SIZE; /* yes, merge block with previous neighbor. */ (header_ptr->prev)->next = header_ptr->next; @@ -560,7 +602,7 @@ void rt_memheap_free(void *ptr) if (!RT_MEMHEAP_IS_USED(header_ptr->next)) { /* adjust the available number of bytes. */ - heap->available_size = heap->available_size + RT_MEMHEAP_SIZE; + heap->available_size += RT_MEMHEAP_SIZE; /* merge block with next neighbor. */ new_ptr = header_ptr->next; @@ -595,6 +637,91 @@ void rt_memheap_free(void *ptr) } RTM_EXPORT(rt_memheap_free); +#ifdef RT_USING_FINSH +static void _memheap_dump_tag(struct rt_memheap_item* item) +{ + rt_uint8_t name[2 * sizeof(void*)]; + rt_uint8_t* ptr; + + ptr = (rt_uint8_t*)&(item->next_free); + rt_memcpy(name, ptr, sizeof(void*)); + ptr = (rt_uint8_t*)&(item->prev_free); + rt_memcpy(&name[sizeof(void*)], ptr, sizeof(void*)); + + rt_kprintf("%.*s", 2 * sizeof(void*), name); +} + +int rt_memheap_dump(struct rt_memheap *heap) +{ + struct rt_memheap_item *item, *end; + + if (heap == RT_NULL) return 0; + RT_ASSERT(rt_object_get_type(&heap->parent) == RT_Object_Class_MemHeap); + + rt_kprintf("\n[%.*s] [0x%08x - 0x%08x]->\n", RT_NAME_MAX, heap->parent.name, + (rt_ubase_t)heap->start_addr, (rt_ubase_t)heap->start_addr + heap->pool_size); + rt_kprintf("------------------------------\n"); + + /* lock memheap */ + rt_sem_take(&(heap->lock), RT_WAITING_FOREVER); + item = heap->block_list; + + end = (struct rt_memheap_item *) ((rt_uint8_t *)heap->start_addr + heap->pool_size - RT_MEMHEAP_SIZE); + + /* for each memory block */ + while ((rt_ubase_t)item < ((rt_ubase_t)end)) + { + if (RT_MEMHEAP_IS_USED(item) && ((item->magic & RT_MEMHEAP_MASK) != RT_MEMHEAP_MAGIC)) + rt_kprintf("0x%08x", item + 1); + + if (item->magic == (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED)) + { + rt_kprintf("0x%08x: %-8d ", item + 1, MEMITEM_SIZE(item)); + _memheap_dump_tag(item); + rt_kprintf("\n"); + } + else + { + rt_kprintf("0x%08x: %-8d \n", item + 1, MEMITEM_SIZE(item)); + } + + item = item->next; + } + rt_sem_release(&(heap->lock)); + + return 0; +} + +int memtrace(void) +{ + int count = rt_object_get_length(RT_Object_Class_MemHeap); + struct rt_memheap **heaps; + + if (count > 0) + { + int index; + extern int list_memheap(void); + + heaps = (struct rt_memheap**)rt_malloc(sizeof(struct rt_memheap*) * count); + if (heaps == RT_NULL) return 0; + + list_memheap(); + + rt_kprintf("memheap header size: %d\n", RT_MEMHEAP_SIZE); + count = rt_object_get_pointers(RT_Object_Class_MemHeap, (rt_object_t*)heaps, count); + for (index = 0; index < count; index++) + { + rt_memheap_dump(heaps[index]); + } + + rt_free(heaps); + } + + return 0; +} +MSH_CMD_EXPORT(memtrace, dump memory trace information); +#endif + #ifdef RT_USING_MEMHEAP_AS_HEAP static struct rt_memheap _heap; @@ -643,6 +770,24 @@ void *rt_malloc(rt_size_t size) } } + +#ifdef RT_USING_MEMTRACE + if (ptr == RT_NULL) + { + RT_DEBUG_LOG("malloc[%d] => NULL", size); + } + else + { + struct rt_memheap_item *item = MEMITEM(ptr); + if (rt_thread_self()) + rt_memheap_setname(item, rt_thread_self()->name); + else + rt_memheap_setname(item, ""); + + RT_DEBUG_LOG("malloc => 0x%08x : %d", ptr, size); + } +#endif + return ptr; } RTM_EXPORT(rt_malloc); @@ -691,6 +836,23 @@ void *rt_realloc(void *rmem, rt_size_t newsize) } } +#ifdef RT_USING_MEMTRACE + if (new_ptr == RT_NULL) + { + RT_DEBUG_LOG("realloc[%d] => NULL", newsize); + } + else + { + struct rt_memheap_item *item = MEMITEM(new_ptr); + if (rt_thread_self()) + rt_memheap_setname(item, rt_thread_self()->name); + else + rt_memheap_setname(item, ""); + + RT_DEBUG_LOG("realloc => 0x%08x : %d", new_ptr, newsize); + } +#endif + return new_ptr; } RTM_EXPORT(rt_realloc); @@ -708,6 +870,17 @@ void *rt_calloc(rt_size_t count, rt_size_t size) rt_memset(ptr, 0, total_size); } +#ifdef RT_USING_MEMTRACE + if (ptr == RT_NULL) + { + RT_DEBUG_LOG("calloc[%d x %d] => NULL", count, size); + } + else + { + RT_DEBUG_LOG("calloc => 0x%08x : %d", ptr, count * size); + } +#endif + return ptr; } RTM_EXPORT(rt_calloc); -- cgit v1.3.1 From e94d90705655a1c73d041f685a07693f59b68822 Mon Sep 17 00:00:00 2001 From: WillianChan Date: Sat, 20 Feb 2021 15:51:49 +0800 Subject: [kernel][memheap]fix RT_DEBUG_LOG errors. Signed-off-by: WillianChan --- src/memheap.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/memheap.c b/src/memheap.c index ebd86b87d6..d9c03079ee 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -553,7 +553,8 @@ void rt_memheap_free(void *ptr) /* check magic */ if (header_ptr->magic != (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED)) { - RT_DEBUG_LOG("bad magic:0x%08x @ memheap\n", header_ptr->magic); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("bad magic:0x%08x @ memheap\n", + header_ptr->magic)); } RT_ASSERT(header_ptr->magic == (RT_MEMHEAP_MAGIC | RT_MEMHEAP_USED)); /* check whether this block of memory has been over-written. */ @@ -774,7 +775,7 @@ void *rt_malloc(rt_size_t size) #ifdef RT_USING_MEMTRACE if (ptr == RT_NULL) { - RT_DEBUG_LOG("malloc[%d] => NULL", size); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("malloc[%d] => NULL", size)); } else { @@ -784,7 +785,7 @@ void *rt_malloc(rt_size_t size) else rt_memheap_setname(item, ""); - RT_DEBUG_LOG("malloc => 0x%08x : %d", ptr, size); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("malloc => 0x%08x : %d", ptr, size)); } #endif @@ -839,7 +840,7 @@ void *rt_realloc(void *rmem, rt_size_t newsize) #ifdef RT_USING_MEMTRACE if (new_ptr == RT_NULL) { - RT_DEBUG_LOG("realloc[%d] => NULL", newsize); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("realloc[%d] => NULL", newsize)); } else { @@ -849,7 +850,8 @@ void *rt_realloc(void *rmem, rt_size_t newsize) else rt_memheap_setname(item, ""); - RT_DEBUG_LOG("realloc => 0x%08x : %d", new_ptr, newsize); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("realloc => 0x%08x : %d", + new_ptr, newsize)); } #endif @@ -873,11 +875,13 @@ void *rt_calloc(rt_size_t count, rt_size_t size) #ifdef RT_USING_MEMTRACE if (ptr == RT_NULL) { - RT_DEBUG_LOG("calloc[%d x %d] => NULL", count, size); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("calloc[%d x %d] => NULL", + count, size)); } else { - RT_DEBUG_LOG("calloc => 0x%08x : %d", ptr, count * size); + RT_DEBUG_LOG(RT_DEBUG_MEMHEAP, ("calloc => 0x%08x : %d", + ptr, count * size)); } #endif -- cgit v1.3.1 From 4b4ab15602ccb2897917c48c514d38085312ca85 Mon Sep 17 00:00:00 2001 From: WillianChan Date: Sat, 20 Feb 2021 16:18:29 +0800 Subject: [kernel][memheap]rename memtrace to memheaptrace Signed-off-by: WillianChan --- src/memheap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memheap.c b/src/memheap.c index d9c03079ee..abcba9a50b 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -693,7 +693,7 @@ int rt_memheap_dump(struct rt_memheap *heap) return 0; } -int memtrace(void) +int memheaptrace(void) { int count = rt_object_get_length(RT_Object_Class_MemHeap); struct rt_memheap **heaps; @@ -720,7 +720,7 @@ int memtrace(void) return 0; } -MSH_CMD_EXPORT(memtrace, dump memory trace information); +MSH_CMD_EXPORT(memheaptrace, dump memory trace information); #endif #ifdef RT_USING_MEMHEAP_AS_HEAP -- cgit v1.3.1 From 5ce889ea820e1c5bbadc41a0464b2dcdf3e607fc Mon Sep 17 00:00:00 2001 From: liruncong Date: Thu, 4 Mar 2021 19:33:28 +0800 Subject: 撤销有符å�·æ¯”较,ä»�应使用无符å�·æ¯”较 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread.c b/src/thread.c index 627b7e898e..c2a3e2e797 100644 --- a/src/thread.c +++ b/src/thread.c @@ -598,7 +598,7 @@ rt_err_t rt_thread_delay_until(rt_tick_t *tick, rt_tick_t inc_tick) level = rt_hw_interrupt_disable(); cur_tick = rt_tick_get(); - if ((rt_int32_t)(cur_tick - *tick) < (rt_int32_t)inc_tick) + if (cur_tick - *tick < inc_tick) { rt_tick_t left_tick; -- cgit v1.3.1 From 2892faccc8ebc6e1abcfe5bc02712344f9768bb6 Mon Sep 17 00:00:00 2001 From: yangfasheng Date: Tue, 2 Mar 2021 16:49:18 +0800 Subject: ã€�更新】调整图形设备驱动相关定义 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangfasheng --- include/rtdef.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/rtdef.h b/include/rtdef.h index 0256601949..1787b81eb8 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -1041,6 +1041,10 @@ struct rt_device_blk_sectors #define RTGRAPHIC_CTRL_GET_INFO 3 #define RTGRAPHIC_CTRL_SET_MODE 4 #define RTGRAPHIC_CTRL_GET_EXT 5 +#define RTGRAPHIC_CTRL_SET_BRIGHTNESS 6 +#define RTGRAPHIC_CTRL_GET_BRIGHTNESS 7 +#define RTGRAPHIC_CTRL_GET_MODE 8 +#define RTGRAPHIC_CTRL_GET_STATUS 9 /* graphic deice */ enum @@ -1057,9 +1061,7 @@ enum RTGRAPHIC_PIXEL_FORMAT_RGB888, RTGRAPHIC_PIXEL_FORMAT_ARGB888, RTGRAPHIC_PIXEL_FORMAT_ABGR888, - RTGRAPHIC_PIXEL_FORMAT_ARGB565, - RTGRAPHIC_PIXEL_FORMAT_ALPHA, - RTGRAPHIC_PIXEL_FORMAT_COLOR, + RTGRAPHIC_PIXEL_FORMAT_RESERVED, }; /** @@ -1074,7 +1076,7 @@ struct rt_device_graphic_info { rt_uint8_t pixel_format; /**< graphic format */ rt_uint8_t bits_per_pixel; /**< bits per pixel */ - rt_uint16_t reserved; /**< reserved field */ + rt_uint16_t pitch; /**< bytes per line */ rt_uint16_t width; /**< width of graphic device */ rt_uint16_t height; /**< height of graphic device */ -- cgit v1.3.1 From ffe4493982f2f47098f36682e4e6ca964048b903 Mon Sep 17 00:00:00 2001 From: WillianChan Date: Fri, 5 Mar 2021 16:15:51 +0800 Subject: [kernel][Konfig]modify Kconfig file Signed-off-by: WillianChan --- src/Kconfig | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/Kconfig b/src/Kconfig index 803c827e51..aa8e514e5c 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -284,21 +284,19 @@ menu "Memory Management" endchoice - if RT_USING_SMALL_MEM - config RT_USING_MEMTRACE - bool "Enable memory trace" - default n - help - When enable RT_USING_MEMTRACE with shell, developer can call cmd: - 1. memtrace - to dump memory block information. - 2. memcheck - to check memory block to avoid memory overwritten. - - And developer also can call memcheck() in each of scheduling - to check memory block to find which thread has wrongly modified - memory. - endif + config RT_USING_MEMTRACE + bool "Enable memory trace" + default n + help + When enable RT_USING_MEMTRACE with shell, developer can call cmd: + 1. memtrace + to dump memory block information. + 2. memcheck + to check memory block to avoid memory overwritten. + + And developer also can call memcheck() in each of scheduling + to check memory block to find which thread has wrongly modified + memory. config RT_USING_HEAP bool -- cgit v1.3.1 From 3c05a4e7193ee553bf502560e7de4be6489c7629 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 8 Mar 2021 18:19:04 +0800 Subject: [compoenets] auto & manual formatted --- components/cplusplus/Lock.h | 2 +- components/cplusplus/Mail.h | 2 +- components/cplusplus/Mutex.h | 2 +- components/cplusplus/Queue.h | 2 +- components/cplusplus/Semaphore.h | 2 +- components/cplusplus/Thread.h | 2 +- components/cplusplus/crt.h | 2 +- components/cplusplus/crt_init.c | 16 +- components/cplusplus/cxx_Mutex.cpp | 3 +- components/cplusplus/cxx_Semaphore.cpp | 3 +- components/cplusplus/cxx_Thread.cpp | 3 +- components/cplusplus/cxx_crt.cpp | 10 +- components/dfs/filesystems/devfs/devfs.c | 4 +- components/dfs/filesystems/devfs/devfs.h | 2 +- components/dfs/filesystems/elmfat/dfs_elm.c | 2 +- components/dfs/filesystems/elmfat/dfs_elm.h | 2 +- components/dfs/filesystems/elmfat/diskio.h | 58 +- components/dfs/filesystems/jffs2/dfs_jffs2.c | 2 +- components/dfs/filesystems/jffs2/dfs_jffs2.h | 4 +- components/dfs/filesystems/nfs/dfs_nfs.c | 2 +- components/dfs/filesystems/nfs/dfs_nfs.h | 2 +- components/dfs/filesystems/nfs/mount.h | 84 +- components/dfs/filesystems/nfs/mount_clnt.c | 62 +- components/dfs/filesystems/nfs/mount_xdr.c | 126 +- components/dfs/filesystems/nfs/nfs.h | 866 ++--- components/dfs/filesystems/nfs/nfs_auth.c | 2 +- components/dfs/filesystems/nfs/nfs_clnt.c | 222 +- components/dfs/filesystems/nfs/nfs_xdr.c | 1900 +++++----- components/dfs/filesystems/nfs/rpc/auth.h | 102 +- components/dfs/filesystems/nfs/rpc/auth_none.c | 98 +- components/dfs/filesystems/nfs/rpc/clnt.h | 240 +- components/dfs/filesystems/nfs/rpc/clnt_generic.c | 2 +- components/dfs/filesystems/nfs/rpc/clnt_udp.c | 544 +-- components/dfs/filesystems/nfs/rpc/pmap.c | 70 +- components/dfs/filesystems/nfs/rpc/pmap.h | 58 +- components/dfs/filesystems/nfs/rpc/rpc.h | 12 +- components/dfs/filesystems/nfs/rpc/rpc_msg.h | 152 +- components/dfs/filesystems/nfs/rpc/rpc_prot.c | 264 +- components/dfs/filesystems/nfs/rpc/types.h | 2 +- components/dfs/filesystems/nfs/rpc/xdr.c | 830 ++--- components/dfs/filesystems/nfs/rpc/xdr.h | 174 +- components/dfs/filesystems/nfs/rpc/xdr_mem.c | 68 +- components/dfs/filesystems/ramfs/dfs_ramfs.c | 2 +- components/dfs/filesystems/ramfs/dfs_ramfs.h | 2 +- components/dfs/filesystems/romfs/dfs_romfs.c | 2 +- components/dfs/filesystems/romfs/dfs_romfs.h | 2 +- components/dfs/filesystems/romfs/romfs.c | 2 +- components/dfs/filesystems/skeleton/skeleton.c | 2 +- components/dfs/filesystems/skeleton/skeleton.h | 2 +- components/dfs/filesystems/uffs/dfs_uffs.c | 2 +- components/dfs/filesystems/uffs/dfs_uffs.h | 2 +- components/dfs/filesystems/uffs/uffs_rtthread.c | 100 +- components/dfs/include/dfs.h | 2 +- components/dfs/include/dfs_file.h | 2 +- components/dfs/include/dfs_fs.h | 2 +- components/dfs/include/dfs_poll.h | 2 +- components/dfs/include/dfs_posix.h | 2 +- components/dfs/include/dfs_private.h | 2 +- components/dfs/include/dfs_select.h | 2 +- components/dfs/src/dfs.c | 2 +- components/dfs/src/dfs_file.c | 2 +- components/dfs/src/dfs_fs.c | 12 +- components/dfs/src/dfs_posix.c | 2 +- components/dfs/src/poll.c | 6 +- components/dfs/src/select.c | 4 +- components/drivers/audio/audio.c | 2 +- components/drivers/audio/audio_pipe.c | 2 +- components/drivers/audio/audio_pipe.h | 2 +- components/drivers/can/can.c | 2 +- components/drivers/cputime/cputime.c | 10 +- components/drivers/cputime/cputime_cortexm.c | 12 +- components/drivers/hwcrypto/hw_bignum.c | 36 +- components/drivers/hwcrypto/hw_bignum.h | 34 +- components/drivers/hwcrypto/hw_crc.c | 10 +- components/drivers/hwcrypto/hw_crc.h | 6 +- components/drivers/hwcrypto/hw_gcm.c | 2 +- components/drivers/hwcrypto/hw_gcm.h | 2 +- components/drivers/hwcrypto/hw_hash.c | 2 +- components/drivers/hwcrypto/hw_hash.h | 2 +- components/drivers/hwcrypto/hw_rng.c | 4 +- components/drivers/hwcrypto/hw_rng.h | 4 +- components/drivers/hwcrypto/hw_symmetric.c | 4 +- components/drivers/hwcrypto/hw_symmetric.h | 2 +- components/drivers/hwcrypto/hwcrypto.c | 2 +- components/drivers/hwcrypto/hwcrypto.h | 2 +- components/drivers/hwtimer/hwtimer.c | 4 +- components/drivers/i2c/i2c-bit-ops.c | 2 +- components/drivers/i2c/i2c_core.c | 2 +- components/drivers/i2c/i2c_dev.c | 6 +- components/drivers/include/drivers/adc.h | 2 +- components/drivers/include/drivers/alarm.h | 2 +- components/drivers/include/drivers/audio.h | 2 +- components/drivers/include/drivers/can.h | 2 +- components/drivers/include/drivers/cputime.h | 2 +- components/drivers/include/drivers/crypto.h | 2 +- components/drivers/include/drivers/dac.h | 2 +- components/drivers/include/drivers/hwtimer.h | 2 +- components/drivers/include/drivers/i2c-bit-ops.h | 2 +- components/drivers/include/drivers/i2c.h | 2 +- components/drivers/include/drivers/i2c_dev.h | 2 +- components/drivers/include/drivers/mmc.h | 258 +- components/drivers/include/drivers/mmcsd_card.h | 194 +- components/drivers/include/drivers/mmcsd_cmd.h | 12 +- components/drivers/include/drivers/mmcsd_core.h | 282 +- components/drivers/include/drivers/mmcsd_host.h | 156 +- components/drivers/include/drivers/mtd_nand.h | 2 +- components/drivers/include/drivers/mtd_nor.h | 44 +- components/drivers/include/drivers/phy.h | 2 +- components/drivers/include/drivers/phy_mdio.h | 2 +- components/drivers/include/drivers/pin.h | 2 +- components/drivers/include/drivers/pm.h | 2 +- components/drivers/include/drivers/pulse_encoder.h | 2 +- components/drivers/include/drivers/rt_drv_pwm.h | 2 +- .../drivers/include/drivers/rt_inputcapture.h | 2 +- components/drivers/include/drivers/rtc.h | 2 +- components/drivers/include/drivers/sd.h | 2 +- components/drivers/include/drivers/sdio.h | 14 +- components/drivers/include/drivers/sdio_func_ids.h | 4 +- components/drivers/include/drivers/serial.h | 6 +- components/drivers/include/drivers/spi.h | 4 +- components/drivers/include/drivers/usb_common.h | 18 +- components/drivers/include/drivers/usb_device.h | 16 +- components/drivers/include/drivers/usb_host.h | 38 +- components/drivers/include/drivers/watchdog.h | 2 +- components/drivers/include/drivers/wlan.h | 2 +- components/drivers/include/ipc/completion.h | 2 +- components/drivers/include/ipc/dataqueue.h | 2 +- components/drivers/include/ipc/pipe.h | 2 +- components/drivers/include/ipc/poll.h | 2 +- components/drivers/include/ipc/ringblk_buf.h | 2 +- components/drivers/include/ipc/ringbuffer.h | 2 +- components/drivers/include/ipc/waitqueue.h | 4 +- components/drivers/include/ipc/workqueue.h | 2 +- components/drivers/include/rtdevice.h | 2 +- components/drivers/misc/adc.c | 2 +- components/drivers/misc/dac.c | 4 +- components/drivers/misc/pin.c | 4 +- components/drivers/misc/pulse_encoder.c | 2 +- components/drivers/misc/rt_drv_pwm.c | 2 +- components/drivers/misc/rt_inputcapture.c | 2 +- components/drivers/mtd/mtd_nand.c | 2 +- components/drivers/mtd/mtd_nor.c | 6 +- components/drivers/phy/phy.c | 6 +- components/drivers/pm/pm.c | 4 +- components/drivers/rtc/alarm.c | 2 +- components/drivers/rtc/rtc.c | 4 +- components/drivers/rtc/soft_rtc.c | 4 +- components/drivers/sdio/block_dev.c | 72 +- components/drivers/sdio/mmc.c | 134 +- components/drivers/sdio/mmcsd_core.c | 92 +- components/drivers/sdio/sd.c | 60 +- components/drivers/sdio/sdio.c | 124 +- components/drivers/sensors/sensor.c | 2 +- components/drivers/sensors/sensor.h | 4 +- components/drivers/sensors/sensor_cmd.c | 6 +- components/drivers/serial/serial.c | 20 +- components/drivers/spi/enc28j60.c | 4 +- components/drivers/spi/enc28j60.h | 2 +- components/drivers/spi/qspi_core.c | 10 +- components/drivers/spi/sfud/inc/sfud_def.h | 4 +- components/drivers/spi/sfud/src/sfud_sfdp.c | 2 +- components/drivers/spi/spi_core.c | 2 +- components/drivers/spi/spi_dev.c | 10 +- components/drivers/spi/spi_flash.h | 10 +- components/drivers/spi/spi_flash_sfud.c | 2 +- components/drivers/spi/spi_flash_sfud.h | 2 +- components/drivers/spi/spi_msd.c | 6 +- components/drivers/spi/spi_msd.h | 14 +- components/drivers/spi/spi_wifi_rw009.c | 4 +- components/drivers/spi/spi_wifi_rw009.h | 4 +- components/drivers/src/completion.c | 2 +- components/drivers/src/dataqueue.c | 28 +- components/drivers/src/pipe.c | 10 +- components/drivers/src/ringblk_buf.c | 2 +- components/drivers/src/ringbuffer.c | 12 +- components/drivers/src/waitqueue.c | 4 +- components/drivers/src/workqueue.c | 2 +- components/drivers/touch/touch.c | 2 +- components/drivers/touch/touch.h | 2 +- components/drivers/usb/usbdevice/class/audio_mic.c | 2 +- .../drivers/usb/usbdevice/class/audio_speaker.c | 2 +- components/drivers/usb/usbdevice/class/cdc.h | 16 +- components/drivers/usb/usbdevice/class/cdc_vcom.c | 74 +- components/drivers/usb/usbdevice/class/ecm.c | 26 +- components/drivers/usb/usbdevice/class/hid.c | 20 +- components/drivers/usb/usbdevice/class/hid.h | 2 +- components/drivers/usb/usbdevice/class/mstorage.c | 248 +- components/drivers/usb/usbdevice/class/mstorage.h | 6 +- components/drivers/usb/usbdevice/class/ndis.h | 88 +- components/drivers/usb/usbdevice/class/rndis.c | 20 +- components/drivers/usb/usbdevice/class/rndis.h | 196 +- components/drivers/usb/usbdevice/class/winusb.c | 16 +- components/drivers/usb/usbdevice/class/winusb.h | 2 +- components/drivers/usb/usbdevice/core/usbdevice.c | 6 +- .../drivers/usb/usbdevice/core/usbdevice_core.c | 150 +- components/drivers/usb/usbhost/class/adk.c | 2 +- components/drivers/usb/usbhost/class/adk.h | 4 +- components/drivers/usb/usbhost/class/hid.c | 116 +- components/drivers/usb/usbhost/class/hid.h | 8 +- components/drivers/usb/usbhost/class/mass.c | 178 +- components/drivers/usb/usbhost/class/mass.h | 10 +- components/drivers/usb/usbhost/class/udisk.c | 2 +- components/drivers/usb/usbhost/class/ukbd.c | 20 +- components/drivers/usb/usbhost/class/umouse.c | 2 +- components/drivers/usb/usbhost/core/driver.c | 22 +- components/drivers/usb/usbhost/core/hub.c | 186 +- components/drivers/usb/usbhost/core/usbhost.c | 6 +- components/drivers/usb/usbhost/core/usbhost_core.c | 126 +- components/drivers/watchdog/watchdog.c | 6 +- components/drivers/wlan/wlan_cfg.c | 2 +- components/drivers/wlan/wlan_cfg.h | 2 +- components/drivers/wlan/wlan_cmd.c | 2 +- components/drivers/wlan/wlan_dev.c | 2 +- components/drivers/wlan/wlan_dev.h | 4 +- components/drivers/wlan/wlan_lwip.c | 2 +- components/drivers/wlan/wlan_mgnt.c | 2 +- components/drivers/wlan/wlan_mgnt.h | 2 +- components/drivers/wlan/wlan_prot.c | 2 +- components/drivers/wlan/wlan_prot.h | 2 +- components/drivers/wlan/wlan_workqueue.c | 2 +- components/drivers/wlan/wlan_workqueue.h | 2 +- components/finsh/cmd.c | 8 +- components/finsh/finsh.h | 2 +- components/finsh/finsh_api.h | 2 +- components/finsh/finsh_compiler.c | 2 +- components/finsh/finsh_error.c | 2 +- components/finsh/finsh_error.h | 2 +- components/finsh/finsh_heap.c | 2 +- components/finsh/finsh_heap.h | 2 +- components/finsh/finsh_init.c | 2 +- components/finsh/finsh_node.c | 2 +- components/finsh/finsh_node.h | 2 +- components/finsh/finsh_ops.c | 2 +- components/finsh/finsh_ops.h | 100 +- components/finsh/finsh_parser.c | 2 +- components/finsh/finsh_parser.h | 2 +- components/finsh/finsh_token.c | 2 +- components/finsh/finsh_token.h | 2 +- components/finsh/finsh_var.c | 2 +- components/finsh/finsh_var.h | 2 +- components/finsh/finsh_vm.c | 2 +- components/finsh/finsh_vm.h | 2 +- components/finsh/msh.c | 2 +- components/finsh/msh.h | 2 +- components/finsh/msh_file.c | 2 +- components/finsh/shell.c | 4 +- components/finsh/shell.h | 2 +- components/finsh/symbol.c | 4 +- components/libc/aio/posix_aio.c | 378 +- components/libc/aio/posix_aio.h | 2 +- components/libc/compilers/armlibc/dirent.h | 28 +- components/libc/compilers/armlibc/fcntl.h | 2 +- components/libc/compilers/armlibc/libc.c | 2 +- components/libc/compilers/armlibc/libc.h | 2 +- components/libc/compilers/armlibc/libc_syms.c | 2 +- components/libc/compilers/armlibc/mem_std.c | 2 +- components/libc/compilers/armlibc/stdio.c | 2 +- components/libc/compilers/armlibc/sys/errno.h | 2 +- components/libc/compilers/armlibc/sys/ioctl.h | 2 +- components/libc/compilers/armlibc/sys/mman.h | 2 +- components/libc/compilers/armlibc/sys/stat.h | 2 +- components/libc/compilers/armlibc/sys/types.h | 2 +- components/libc/compilers/armlibc/sys/unistd.h | 2 +- components/libc/compilers/armlibc/syscalls.c | 8 +- components/libc/compilers/armlibc/unistd.h | 2 +- components/libc/compilers/common/stdlib.c | 2 +- components/libc/compilers/common/sys/time.h | 2 +- components/libc/compilers/common/termios.h | 2 +- components/libc/compilers/common/time.c | 6 +- components/libc/compilers/common/unistd.c | 2 +- components/libc/compilers/dlib/dirent.h | 2 +- components/libc/compilers/dlib/environ.c | 2 +- components/libc/compilers/dlib/fcntl.h | 2 +- components/libc/compilers/dlib/libc.c | 2 +- components/libc/compilers/dlib/libc.h | 2 +- components/libc/compilers/dlib/rmtx.c | 4 +- components/libc/compilers/dlib/stdio.c | 2 +- components/libc/compilers/dlib/sys/errno.h | 2 +- components/libc/compilers/dlib/sys/mman.h | 2 +- components/libc/compilers/dlib/sys/signal.h | 2 +- components/libc/compilers/dlib/sys/stat.h | 2 +- components/libc/compilers/dlib/sys/types.h | 2 +- components/libc/compilers/dlib/sys/unistd.h | 34 +- components/libc/compilers/dlib/syscall_close.c | 2 +- components/libc/compilers/dlib/syscall_lseek.c | 2 +- components/libc/compilers/dlib/syscall_mem.c | 2 +- components/libc/compilers/dlib/syscall_open.c | 2 +- components/libc/compilers/dlib/syscall_read.c | 2 +- components/libc/compilers/dlib/syscall_remove.c | 2 +- components/libc/compilers/dlib/syscall_write.c | 2 +- components/libc/compilers/dlib/syscalls.c | 2 +- components/libc/compilers/dlib/unistd.h | 2 +- components/libc/compilers/newlib/libc.c | 4 +- components/libc/compilers/newlib/libc.h | 2 +- components/libc/compilers/newlib/libc_syms.c | 2 +- components/libc/compilers/newlib/machine/time.h | 2 +- components/libc/compilers/newlib/minilib.c | 2 +- components/libc/compilers/newlib/stdio.c | 6 +- components/libc/compilers/newlib/sys/dirent.h | 34 +- components/libc/compilers/newlib/sys/mman.h | 2 +- components/libc/compilers/newlib/sys/statfs.h | 8 +- components/libc/compilers/newlib/sys/termios.h | 2 +- components/libc/compilers/newlib/syscalls.c | 2 +- components/libc/getline/posix_getline.c | 4 +- components/libc/getline/posix_getline.h | 2 +- components/libc/libdl/arch/arm.c | 4 +- components/libc/libdl/arch/x86.c | 10 +- components/libc/libdl/dlclose.c | 2 +- components/libc/libdl/dlelf.c | 10 +- components/libc/libdl/dlelf.h | 4 +- components/libc/libdl/dlerror.c | 6 +- components/libc/libdl/dlfcn.h | 4 +- components/libc/libdl/dlmodule.c | 8 +- components/libc/libdl/dlmodule.h | 2 +- components/libc/libdl/dlopen.c | 6 +- components/libc/libdl/dlsym.c | 4 +- components/libc/mmap/posix_mmap.c | 2 +- components/libc/pthreads/mqueue.c | 2 +- components/libc/pthreads/mqueue.h | 2 +- components/libc/pthreads/posix_types.h | 4 +- components/libc/pthreads/pthread.c | 4 +- components/libc/pthreads/pthread.h | 4 +- components/libc/pthreads/pthread_attr.c | 4 +- components/libc/pthreads/pthread_barrier.c | 2 +- components/libc/pthreads/pthread_cond.c | 10 +- components/libc/pthreads/pthread_internal.h | 2 +- components/libc/pthreads/pthread_mutex.c | 4 +- components/libc/pthreads/pthread_rwlock.c | 10 +- components/libc/pthreads/pthread_spin.c | 2 +- components/libc/pthreads/pthread_tls.c | 2 +- components/libc/pthreads/sched.c | 2 +- components/libc/pthreads/sched.h | 2 +- components/libc/pthreads/semaphore.c | 2 +- components/libc/pthreads/semaphore.h | 2 +- components/libc/signal/posix_signal.c | 2 +- components/libc/signal/posix_signal.h | 2 +- components/libc/termios/posix_termios.c | 2 +- components/libc/termios/posix_termios.h | 2 +- components/lwp/lwp.c | 2 +- components/lwp/lwp.h | 2 +- components/lwp/lwp_mem.c | 6 +- components/lwp/lwp_mem.h | 2 +- components/lwp/lwp_memheap.c | 2 +- components/lwp/lwp_memheap.h | 2 +- components/lwp/lwp_syscall.c | 2 +- components/lwp/lwp_syscall.h | 12 +- components/net/at/at_socket/at_socket.c | 40 +- components/net/at/at_socket/at_socket.h | 2 +- components/net/at/include/at.h | 2 +- components/net/at/include/at_log.h | 2 +- components/net/at/src/at_base_cmd.c | 2 +- components/net/at/src/at_cli.c | 4 +- components/net/at/src/at_client.c | 4 +- components/net/at/src/at_server.c | 2 +- components/net/at/src/at_utils.c | 2 +- components/net/lwip-1.4.1/src/api/api_lib.c | 30 +- components/net/lwip-1.4.1/src/api/api_msg.c | 34 +- components/net/lwip-1.4.1/src/api/err.c | 28 +- components/net/lwip-1.4.1/src/api/netbuf.c | 32 +- components/net/lwip-1.4.1/src/api/netdb.c | 26 +- components/net/lwip-1.4.1/src/api/netifapi.c | 24 +- components/net/lwip-1.4.1/src/api/sockets.c | 32 +- components/net/lwip-1.4.1/src/api/tcpip.c | 8 +- .../net/lwip-1.4.1/src/arch/include/arch/cc.h | 16 +- .../net/lwip-1.4.1/src/arch/include/arch/perf.h | 52 +- .../lwip-1.4.1/src/arch/include/arch/sys_arch.h | 48 +- components/net/lwip-1.4.1/src/arch/sys_arch.c | 6 +- components/net/lwip-1.4.1/src/core/def.c | 2 +- components/net/lwip-1.4.1/src/core/dhcp.c | 14 +- components/net/lwip-1.4.1/src/core/dns.c | 14 +- components/net/lwip-1.4.1/src/core/init.c | 30 +- components/net/lwip-1.4.1/src/core/ipv4/autoip.c | 14 +- components/net/lwip-1.4.1/src/core/ipv4/icmp.c | 4 +- components/net/lwip-1.4.1/src/core/ipv4/igmp.c | 68 +- .../net/lwip-1.4.1/src/core/ipv4/inet_chksum.c | 14 +- components/net/lwip-1.4.1/src/core/ipv4/ip.c | 4 +- components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c | 32 +- components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c | 52 +- components/net/lwip-1.4.1/src/core/ipv6/inet6.c | 42 +- components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c | 30 +- components/net/lwip-1.4.1/src/core/mem.c | 2 +- components/net/lwip-1.4.1/src/core/memp.c | 48 +- components/net/lwip-1.4.1/src/core/netif.c | 20 +- components/net/lwip-1.4.1/src/core/pbuf.c | 22 +- components/net/lwip-1.4.1/src/core/raw.c | 10 +- components/net/lwip-1.4.1/src/core/stats.c | 100 +- components/net/lwip-1.4.1/src/core/tcp.c | 116 +- components/net/lwip-1.4.1/src/core/tcp_in.c | 54 +- components/net/lwip-1.4.1/src/core/tcp_out.c | 42 +- components/net/lwip-1.4.1/src/core/udp.c | 12 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h | 2 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h | 28 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h | 46 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/inet.h | 28 +- .../lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h | 28 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/ip.h | 30 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h | 28 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h | 28 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/inet.h | 28 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/ip.h | 30 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/api.h | 28 +- .../net/lwip-1.4.1/src/include/lwip/api_msg.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/arch.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/debug.h | 32 +- components/net/lwip-1.4.1/src/include/lwip/def.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/dhcp.h | 18 +- components/net/lwip-1.4.1/src/include/lwip/dns.h | 2 +- components/net/lwip-1.4.1/src/include/lwip/err.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/init.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/mem.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/memp.h | 28 +- .../net/lwip-1.4.1/src/include/lwip/memp_std.h | 2 +- .../net/lwip-1.4.1/src/include/lwip/netbuf.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/netdb.h | 24 +- components/net/lwip-1.4.1/src/include/lwip/netif.h | 30 +- .../net/lwip-1.4.1/src/include/lwip/netifapi.h | 26 +- components/net/lwip-1.4.1/src/include/lwip/opt.h | 56 +- components/net/lwip-1.4.1/src/include/lwip/pbuf.h | 32 +- components/net/lwip-1.4.1/src/include/lwip/sio.h | 48 +- components/net/lwip-1.4.1/src/include/lwip/snmp.h | 54 +- .../net/lwip-1.4.1/src/include/lwip/snmp_asn1.h | 2 +- .../net/lwip-1.4.1/src/include/lwip/snmp_structs.h | 8 +- .../net/lwip-1.4.1/src/include/lwip/sockets.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/stats.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/sys.h | 32 +- components/net/lwip-1.4.1/src/include/lwip/tcp.h | 38 +- .../net/lwip-1.4.1/src/include/lwip/tcp_impl.h | 34 +- components/net/lwip-1.4.1/src/include/lwip/tcpip.h | 28 +- .../net/lwip-1.4.1/src/include/lwip/timers.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/udp.h | 30 +- .../net/lwip-1.4.1/src/include/netif/etharp.h | 28 +- .../net/lwip-1.4.1/src/include/netif/ethernetif.h | 10 +- .../net/lwip-1.4.1/src/include/netif/ppp_oe.h | 4 +- .../net/lwip-1.4.1/src/include/netif/slipif.h | 52 +- .../net/lwip-1.4.1/src/include/posix/netdb.h | 22 +- .../net/lwip-1.4.1/src/include/posix/sys/socket.h | 22 +- components/net/lwip-1.4.1/src/netif/etharp.c | 40 +- components/net/lwip-1.4.1/src/netif/ethernetif.c | 48 +- components/net/lwip-1.4.1/src/netif/ppp/auth.c | 22 +- components/net/lwip-1.4.1/src/netif/ppp/auth.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/chap.c | 64 +- components/net/lwip-1.4.1/src/netif/ppp/chap.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/chpms.c | 10 +- components/net/lwip-1.4.1/src/netif/ppp/chpms.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/fsm.c | 78 +- components/net/lwip-1.4.1/src/netif/ppp/fsm.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/ipcp.c | 14 +- components/net/lwip-1.4.1/src/netif/ppp/ipcp.h | 6 +- components/net/lwip-1.4.1/src/netif/ppp/lcp.c | 62 +- components/net/lwip-1.4.1/src/netif/ppp/lcp.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/magic.c | 4 +- components/net/lwip-1.4.1/src/netif/ppp/magic.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/md5.c | 2 +- components/net/lwip-1.4.1/src/netif/ppp/pap.c | 8 +- components/net/lwip-1.4.1/src/netif/ppp/pap.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/ppp.c | 54 +- components/net/lwip-1.4.1/src/netif/ppp/ppp.h | 12 +- components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h | 6 +- components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c | 10 +- components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/randm.c | 6 +- components/net/lwip-1.4.1/src/netif/ppp/randm.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/vj.c | 40 +- components/net/lwip-1.4.1/src/netif/ppp/vj.h | 2 +- components/net/lwip-1.4.1/src/netif/slipif.c | 52 +- components/net/lwip-1.4.1/test/unit/lwipopts.h | 28 +- components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c | 2 +- components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c | 8 +- components/net/lwip-2.0.2/doc/doxygen/main_page.h | 21 +- components/net/lwip-2.0.2/src/api/api_lib.c | 14 +- components/net/lwip-2.0.2/src/api/api_msg.c | 4 +- components/net/lwip-2.0.2/src/api/netifapi.c | 12 +- components/net/lwip-2.0.2/src/api/sockets.c | 2 +- components/net/lwip-2.0.2/src/api/tcpip.c | 2 +- components/net/lwip-2.0.2/src/apps/httpd/fs.c | 28 +- components/net/lwip-2.0.2/src/apps/httpd/fsdata.h | 28 +- components/net/lwip-2.0.2/src/apps/httpd/httpd.c | 4 +- .../net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c | 2 +- components/net/lwip-2.0.2/src/apps/mdns/mdns.c | 4 +- components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c | 2 +- .../net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c | 6 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_core.c | 58 +- .../lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c | 2 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c | 22 +- components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c | 44 +- components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h | 2 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c | 10 +- components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c | 4 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c | 10 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_table.c | 6 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c | 8 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_traps.c | 4 +- .../net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c | 12 +- .../net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c | 18 +- .../net/lwip-2.0.2/src/apps/tftp/tftp_server.c | 30 +- .../net/lwip-2.0.2/src/arch/include/arch/cc.h | 12 +- .../net/lwip-2.0.2/src/arch/include/arch/perf.h | 52 +- .../lwip-2.0.2/src/arch/include/arch/sys_arch.h | 48 +- components/net/lwip-2.0.2/src/arch/sys_arch.c | 2 +- components/net/lwip-2.0.2/src/core/def.c | 2 +- components/net/lwip-2.0.2/src/core/dns.c | 6 +- components/net/lwip-2.0.2/src/core/inet_chksum.c | 2 +- components/net/lwip-2.0.2/src/core/init.c | 2 +- components/net/lwip-2.0.2/src/core/ip.c | 8 +- components/net/lwip-2.0.2/src/core/ipv4/autoip.c | 8 +- components/net/lwip-2.0.2/src/core/ipv4/igmp.c | 10 +- components/net/lwip-2.0.2/src/core/ipv6/nd6.c | 10 +- components/net/lwip-2.0.2/src/core/netif.c | 14 +- components/net/lwip-2.0.2/src/core/pbuf.c | 12 +- components/net/lwip-2.0.2/src/core/raw.c | 2 +- components/net/lwip-2.0.2/src/core/tcp.c | 4 +- components/net/lwip-2.0.2/src/core/udp.c | 2 +- components/net/lwip-2.0.2/src/include/lwip/api.h | 16 +- .../net/lwip-2.0.2/src/include/lwip/apps/fs.h | 28 +- .../net/lwip-2.0.2/src/include/lwip/apps/httpd.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/httpd_opts.h | 2 +- .../net/lwip-2.0.2/src/include/lwip/apps/mqtt.h | 4 +- .../lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/snmp_core.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/tftp_opts.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/tftp_server.h | 4 +- components/net/lwip-2.0.2/src/include/lwip/arch.h | 4 +- components/net/lwip-2.0.2/src/include/lwip/igmp.h | 2 +- .../net/lwip-2.0.2/src/include/lwip/ip_addr.h | 2 +- components/net/lwip-2.0.2/src/include/lwip/mld6.h | 2 +- components/net/lwip-2.0.2/src/include/lwip/opt.h | 4 +- .../lwip-2.0.2/src/include/lwip/prot/ethernet.h | 2 +- .../net/lwip-2.0.2/src/include/lwip/prot/ip6.h | 2 +- .../net/lwip-2.0.2/src/include/netif/ethernetif.h | 10 +- .../net/lwip-2.0.2/src/include/netif/ppp/ccp.h | 82 +- .../lwip-2.0.2/src/include/netif/ppp/chap-new.h | 90 +- .../net/lwip-2.0.2/src/include/netif/ppp/eap.h | 172 +- .../net/lwip-2.0.2/src/include/netif/ppp/ecp.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/eui64.h | 60 +- .../net/lwip-2.0.2/src/include/netif/ppp/fsm.h | 142 +- .../net/lwip-2.0.2/src/include/netif/ppp/ipcp.h | 36 +- .../net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h | 10 +- .../net/lwip-2.0.2/src/include/netif/ppp/lcp.h | 92 +- .../net/lwip-2.0.2/src/include/netif/ppp/magic.h | 2 +- .../net/lwip-2.0.2/src/include/netif/ppp/mppe.h | 154 +- .../src/include/netif/ppp/polarssl/arc4.h | 4 +- .../src/include/netif/ppp/polarssl/des.h | 4 +- .../src/include/netif/ppp/polarssl/md4.h | 4 +- .../src/include/netif/ppp/polarssl/md5.h | 4 +- .../src/include/netif/ppp/polarssl/sha1.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/ppp.h | 8 +- .../lwip-2.0.2/src/include/netif/ppp/ppp_impl.h | 254 +- .../lwip-2.0.2/src/include/netif/ppp/pppcrypt.h | 2 +- .../lwip-2.0.2/src/include/netif/ppp/pppdebug.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/pppoe.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/upap.h | 52 +- components/net/lwip-2.0.2/src/netif/ethernet.c | 4 +- components/net/lwip-2.0.2/src/netif/ethernetif.c | 36 +- components/net/lwip-2.0.2/src/netif/ppp/auth.c | 1494 ++++---- components/net/lwip-2.0.2/src/netif/ppp/ccp.c | 1610 ++++----- components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c | 116 +- components/net/lwip-2.0.2/src/netif/ppp/chap-new.c | 884 ++--- components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c | 786 ++-- components/net/lwip-2.0.2/src/netif/ppp/demand.c | 298 +- components/net/lwip-2.0.2/src/netif/ppp/eap.c | 3820 ++++++++++---------- components/net/lwip-2.0.2/src/netif/ppp/ecp.c | 12 +- components/net/lwip-2.0.2/src/netif/ppp/eui64.c | 4 +- components/net/lwip-2.0.2/src/netif/ppp/fsm.c | 610 ++-- components/net/lwip-2.0.2/src/netif/ppp/ipcp.c | 2026 +++++------ components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c | 1026 +++--- components/net/lwip-2.0.2/src/netif/ppp/lcp.c | 2370 ++++++------ components/net/lwip-2.0.2/src/netif/ppp/mppe.c | 588 +-- .../net/lwip-2.0.2/src/netif/ppp/multilink.c | 888 ++--- .../net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c | 4 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/des.c | 4 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c | 4 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c | 6 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c | 4 +- components/net/lwip-2.0.2/src/netif/ppp/ppp.c | 2 +- components/net/lwip-2.0.2/src/netif/ppp/pppapi.c | 22 +- components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c | 26 +- components/net/lwip-2.0.2/src/netif/ppp/pppoe.c | 8 +- components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c | 18 +- components/net/lwip-2.0.2/src/netif/ppp/upap.c | 260 +- components/net/lwip-2.0.2/src/netif/ppp/utils.c | 890 ++--- components/net/lwip-2.0.2/test/fuzz/fuzz.c | 28 +- components/net/lwip-2.0.2/test/fuzz/lwipopts.h | 28 +- .../net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c | 2 +- components/net/lwip-2.0.2/test/unit/lwipopts.h | 28 +- .../net/lwip-2.0.2/test/unit/tcp/tcp_helper.c | 4 +- components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c | 2 +- components/net/lwip-2.1.2/src/api/tcpip.c | 2 +- .../src/apps/altcp_tls/altcp_tls_mbedtls.c | 2 +- .../net/lwip-2.1.2/src/apps/http/http_client.c | 8 +- components/net/lwip-2.1.2/src/apps/http/httpd.c | 2 +- .../lwip-2.1.2/src/apps/http/makefsdata/tinydir.h | 824 ++--- components/net/lwip-2.1.2/src/apps/smtp/smtp.c | 12 +- .../net/lwip-2.1.2/src/arch/include/arch/cc.h | 16 +- .../net/lwip-2.1.2/src/arch/include/arch/perf.h | 52 +- components/net/lwip-2.1.2/src/arch/sys_arch.c | 2 +- components/net/lwip-2.1.2/src/core/altcp.c | 6 +- components/net/lwip-2.1.2/src/core/ipv4/dhcp.c | 2 +- components/net/lwip-2.1.2/src/core/ipv6/ip6.c | 2 +- components/net/lwip-2.1.2/src/core/ipv6/mld6.c | 2 +- components/net/lwip-2.1.2/src/core/ipv6/nd6.c | 6 +- components/net/lwip-2.1.2/src/core/sys.c | 12 +- components/net/lwip-2.1.2/src/core/tcp.c | 26 +- components/net/lwip-2.1.2/src/core/tcp_out.c | 2 +- components/net/lwip-2.1.2/src/core/timeouts.c | 4 +- components/net/lwip-2.1.2/src/core/udp.c | 8 +- .../lwip-2.1.2/src/include/compat/posix/net/if.h | 22 +- components/net/lwip-2.1.2/src/include/lwip/api.h | 16 +- .../net/lwip-2.1.2/src/include/lwip/apps/fs.h | 28 +- .../lwip-2.1.2/src/include/lwip/apps/http_client.h | 10 +- .../lwip-2.1.2/src/include/lwip/apps/httpd_opts.h | 2 +- .../net/lwip-2.1.2/src/include/lwip/apps/mqtt.h | 4 +- .../lwip-2.1.2/src/include/lwip/apps/smtp_opts.h | 6 +- .../lwip-2.1.2/src/include/lwip/apps/snmp_core.h | 2 +- .../lwip-2.1.2/src/include/lwip/apps/tftp_opts.h | 2 +- .../lwip-2.1.2/src/include/lwip/apps/tftp_server.h | 4 +- components/net/lwip-2.1.2/src/include/lwip/arch.h | 4 +- components/net/lwip-2.1.2/src/include/lwip/igmp.h | 2 +- .../net/lwip-2.1.2/src/include/lwip/ip_addr.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/mld6.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/netif.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/opt.h | 8 +- components/net/lwip-2.1.2/src/include/lwip/pbuf.h | 2 +- .../net/lwip-2.1.2/src/include/lwip/prot/ieee.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/sys.h | 26 +- .../net/lwip-2.1.2/src/include/netif/ethernetif.h | 10 +- .../net/lwip-2.1.2/src/include/netif/lowpan6_ble.h | 6 +- .../lwip-2.1.2/src/include/netif/lowpan6_opts.h | 2 +- .../net/lwip-2.1.2/src/include/netif/ppp/ccp.h | 82 +- .../lwip-2.1.2/src/include/netif/ppp/chap-new.h | 90 +- .../net/lwip-2.1.2/src/include/netif/ppp/eap.h | 172 +- .../net/lwip-2.1.2/src/include/netif/ppp/ecp.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/eui64.h | 60 +- .../net/lwip-2.1.2/src/include/netif/ppp/fsm.h | 142 +- .../net/lwip-2.1.2/src/include/netif/ppp/ipcp.h | 36 +- .../net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h | 10 +- .../net/lwip-2.1.2/src/include/netif/ppp/lcp.h | 92 +- .../net/lwip-2.1.2/src/include/netif/ppp/magic.h | 2 +- .../net/lwip-2.1.2/src/include/netif/ppp/mppe.h | 154 +- .../src/include/netif/ppp/polarssl/arc4.h | 4 +- .../src/include/netif/ppp/polarssl/des.h | 4 +- .../src/include/netif/ppp/polarssl/md4.h | 4 +- .../src/include/netif/ppp/polarssl/md5.h | 4 +- .../src/include/netif/ppp/polarssl/sha1.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/ppp.h | 8 +- .../lwip-2.1.2/src/include/netif/ppp/ppp_impl.h | 254 +- .../lwip-2.1.2/src/include/netif/ppp/pppcrypt.h | 2 +- .../lwip-2.1.2/src/include/netif/ppp/pppdebug.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/pppoe.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/upap.h | 52 +- components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c | 6 +- components/net/lwip-2.1.2/src/netif/ethernetif.c | 78 +- components/net/lwip-2.1.2/src/netif/lowpan6_ble.c | 32 +- .../net/lwip-2.1.2/src/netif/lowpan6_common.c | 2 +- components/net/lwip-2.1.2/src/netif/ppp/auth.c | 1494 ++++---- components/net/lwip-2.1.2/src/netif/ppp/ccp.c | 1610 ++++----- components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c | 116 +- components/net/lwip-2.1.2/src/netif/ppp/chap-new.c | 884 ++--- components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c | 786 ++-- components/net/lwip-2.1.2/src/netif/ppp/demand.c | 298 +- components/net/lwip-2.1.2/src/netif/ppp/eap.c | 3820 ++++++++++---------- components/net/lwip-2.1.2/src/netif/ppp/ecp.c | 12 +- components/net/lwip-2.1.2/src/netif/ppp/eui64.c | 4 +- components/net/lwip-2.1.2/src/netif/ppp/fsm.c | 610 ++-- components/net/lwip-2.1.2/src/netif/ppp/ipcp.c | 2026 +++++------ components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c | 1026 +++--- components/net/lwip-2.1.2/src/netif/ppp/lcp.c | 2370 ++++++------ components/net/lwip-2.1.2/src/netif/ppp/mppe.c | 588 +-- .../net/lwip-2.1.2/src/netif/ppp/multilink.c | 888 ++--- .../net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c | 4 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/des.c | 4 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c | 4 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c | 6 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c | 4 +- components/net/lwip-2.1.2/src/netif/ppp/ppp.c | 2 +- components/net/lwip-2.1.2/src/netif/ppp/pppapi.c | 22 +- components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c | 26 +- components/net/lwip-2.1.2/src/netif/ppp/pppoe.c | 8 +- components/net/lwip-2.1.2/src/netif/ppp/upap.c | 260 +- components/net/lwip-2.1.2/src/netif/ppp/utils.c | 890 ++--- components/net/lwip-2.1.2/test/fuzz/fuzz.c | 28 +- components/net/lwip-2.1.2/test/fuzz/lwipopts.h | 28 +- .../lwip-2.1.2/test/sockets/sockets_stresstest.c | 28 +- .../lwip-2.1.2/test/sockets/sockets_stresstest.h | 26 +- .../net/lwip-2.1.2/test/unit/api/test_sockets.c | 10 +- .../net/lwip-2.1.2/test/unit/arch/sys_arch.c | 28 +- .../net/lwip-2.1.2/test/unit/arch/sys_arch.h | 28 +- .../net/lwip-2.1.2/test/unit/core/test_timers.c | 6 +- components/net/lwip-2.1.2/test/unit/lwipopts.h | 28 +- .../net/lwip-2.1.2/test/unit/tcp/tcp_helper.c | 4 +- components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c | 10 +- components/net/lwip_dhcpd/dhcp_server_raw.c | 2 +- components/net/netdev/include/arpa/inet.h | 2 +- components/net/netdev/include/netdev.h | 10 +- components/net/netdev/include/netdev_ipaddr.h | 42 +- components/net/netdev/src/netdev.c | 2 +- components/net/netdev/src/netdev_ipaddr.c | 2 +- components/net/sal_socket/dfs_net/dfs_net.c | 6 +- components/net/sal_socket/impl/af_inet.h | 2 +- components/net/sal_socket/impl/af_inet_at.c | 4 +- components/net/sal_socket/impl/af_inet_lwip.c | 8 +- components/net/sal_socket/impl/proto_mbedtls.c | 22 +- .../net/sal_socket/include/dfs_net/dfs_net.h | 2 +- .../include/dfs_net/sys_select/sys/select.h | 2 +- components/net/sal_socket/include/sal.h | 2 +- components/net/sal_socket/include/sal_netdb.h | 2 +- components/net/sal_socket/include/sal_socket.h | 4 +- components/net/sal_socket/include/sal_tls.h | 2 +- components/net/sal_socket/include/socket/netdb.h | 2 +- .../net/sal_socket/include/socket/netinet/in.h | 2 +- .../net/sal_socket/include/socket/netinet/tcp.h | 2 +- .../net/sal_socket/include/socket/netinet/udp.h | 2 +- .../include/socket/sys_socket/sys/socket.h | 2 +- components/net/sal_socket/socket/net_netdb.c | 2 +- components/net/sal_socket/socket/net_sockets.c | 6 +- components/net/sal_socket/src/sal_socket.c | 2 +- components/utilities/ulog/backend/console_be.c | 2 +- components/utilities/ulog/syslog/syslog.c | 2 +- components/utilities/ulog/syslog/syslog.h | 2 +- components/utilities/ulog/ulog.c | 2 +- components/utilities/ulog/ulog.h | 2 +- components/utilities/ulog/ulog_def.h | 8 +- components/utilities/utest/utest.c | 2 +- components/utilities/utest/utest.h | 60 +- components/utilities/utest/utest_assert.h | 10 +- components/utilities/utest/utest_log.h | 2 +- components/utilities/ymodem/ymodem.c | 4 +- components/utilities/ymodem/ymodem.h | 2 +- components/utilities/zmodem/crc.h | 12 +- components/utilities/zmodem/rz.c | 572 +-- components/utilities/zmodem/sz.c | 446 +-- components/utilities/zmodem/zcore.c | 1410 ++++---- components/utilities/zmodem/zdef.h | 208 +- components/utilities/zmodem/zdevice.c | 106 +- components/utilities/zmodem/zstart.c | 36 +- components/vbus/prio_queue.c | 4 +- components/vbus/prio_queue.h | 4 +- components/vbus/share_hdr/vbus_api.h | 2 +- components/vbus/vbus.c | 14 +- components/vbus/vbus.h | 14 +- components/vbus/vbus_chnx.c | 4 +- components/vbus/watermark_queue.c | 4 +- components/vbus/watermark_queue.h | 4 +- components/vmm/vmm.c | 4 +- components/vmm/vmm.h | 4 +- components/vmm/vmm_context.c | 4 +- components/vmm/vmm_context.h | 4 +- components/vmm/vmm_iomap.c | 4 +- components/vmm/vmm_vector.c | 12 +- 749 files changed, 28493 insertions(+), 28489 deletions(-) diff --git a/components/cplusplus/Lock.h b/components/cplusplus/Lock.h index 08d57c4850..c3cc1d2dae 100644 --- a/components/cplusplus/Lock.h +++ b/components/cplusplus/Lock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/Mail.h b/components/cplusplus/Mail.h index a4c98e4007..ae3bfb5c41 100644 --- a/components/cplusplus/Mail.h +++ b/components/cplusplus/Mail.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/Mutex.h b/components/cplusplus/Mutex.h index 6fee315155..63efb4a6ea 100644 --- a/components/cplusplus/Mutex.h +++ b/components/cplusplus/Mutex.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/Queue.h b/components/cplusplus/Queue.h index 23a4638798..f6b91e1a21 100644 --- a/components/cplusplus/Queue.h +++ b/components/cplusplus/Queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/Semaphore.h b/components/cplusplus/Semaphore.h index cebaf91234..45c916e169 100644 --- a/components/cplusplus/Semaphore.h +++ b/components/cplusplus/Semaphore.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/Thread.h b/components/cplusplus/Thread.h index b578659489..0e681e5c2a 100644 --- a/components/cplusplus/Thread.h +++ b/components/cplusplus/Thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/crt.h b/components/cplusplus/crt.h index 84e5a4b820..903d4c86cd 100644 --- a/components/cplusplus/crt.h +++ b/components/cplusplus/crt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/cplusplus/crt_init.c b/components/cplusplus/crt_init.c index fe12932457..977dee6ee9 100644 --- a/components/cplusplus/crt_init.c +++ b/components/cplusplus/crt_init.c @@ -1,15 +1,15 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * -* Change Logs: -* Date Author Notes -* 2014-12-03 Bernard Add copyright header. -* 2014-12-29 Bernard Add cplusplus initialization for ARMCC. -* 2016-06-28 Bernard Add _init/_fini routines for GCC. -* 2016-10-02 Bernard Add WEAK for cplusplus_system_init routine. -*/ + * Change Logs: + * Date Author Notes + * 2014-12-03 Bernard Add copyright header. + * 2014-12-29 Bernard Add cplusplus initialization for ARMCC. + * 2016-06-28 Bernard Add _init/_fini routines for GCC. + * 2016-10-02 Bernard Add WEAK for cplusplus_system_init routine. + */ #include diff --git a/components/cplusplus/cxx_Mutex.cpp b/components/cplusplus/cxx_Mutex.cpp index 229e842446..ad20e805e9 100644 --- a/components/cplusplus/cxx_Mutex.cpp +++ b/components/cplusplus/cxx_Mutex.cpp @@ -1,11 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ + #include "Mutex.h" using namespace rtthread; diff --git a/components/cplusplus/cxx_Semaphore.cpp b/components/cplusplus/cxx_Semaphore.cpp index c977a27c1a..eda71f24a3 100644 --- a/components/cplusplus/cxx_Semaphore.cpp +++ b/components/cplusplus/cxx_Semaphore.cpp @@ -1,11 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ + #include "Semaphore.h" using namespace rtthread; diff --git a/components/cplusplus/cxx_Thread.cpp b/components/cplusplus/cxx_Thread.cpp index b21fbdce1f..9689f6691b 100644 --- a/components/cplusplus/cxx_Thread.cpp +++ b/components/cplusplus/cxx_Thread.cpp @@ -1,11 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ + #include "Thread.h" using namespace rtthread; diff --git a/components/cplusplus/cxx_crt.cpp b/components/cplusplus/cxx_crt.cpp index d4cb84f77c..750e01e0cb 100644 --- a/components/cplusplus/cxx_crt.cpp +++ b/components/cplusplus/cxx_crt.cpp @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * -* Change Logs: -* Date Author Notes -* 2015-03-07 Bernard Add copyright header. -*/ + * Change Logs: + * Date Author Notes + * 2015-03-07 Bernard Add copyright header. + */ #include #include "crt.h" diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c index e457f18727..2e2248d5cc 100644 --- a/components/dfs/filesystems/devfs/devfs.c +++ b/components/dfs/filesystems/devfs/devfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -271,7 +271,7 @@ int dfs_device_fs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t co if (count == 0) return -EINVAL; - for (index = 0; index < count && index + root_dirent->read_index < root_dirent->device_count; + for (index = 0; index < count && index + root_dirent->read_index < root_dirent->device_count; index ++) { object = (rt_object_t)root_dirent->devices[root_dirent->read_index + index]; diff --git a/components/dfs/filesystems/devfs/devfs.h b/components/dfs/filesystems/devfs/devfs.h index ab2134043c..30a9482a35 100644 --- a/components/dfs/filesystems/devfs/devfs.h +++ b/components/dfs/filesystems/devfs/devfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c index 7e5e00aaf6..07b8f62fed 100644 --- a/components/dfs/filesystems/elmfat/dfs_elm.c +++ b/components/dfs/filesystems/elmfat/dfs_elm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/elmfat/dfs_elm.h b/components/dfs/filesystems/elmfat/dfs_elm.h index 1e9f577062..36a49bf18e 100644 --- a/components/dfs/filesystems/elmfat/dfs_elm.h +++ b/components/dfs/filesystems/elmfat/dfs_elm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/elmfat/diskio.h b/components/dfs/filesystems/elmfat/diskio.h index e4ead78380..511269ce3d 100644 --- a/components/dfs/filesystems/elmfat/diskio.h +++ b/components/dfs/filesystems/elmfat/diskio.h @@ -10,15 +10,15 @@ extern "C" { #endif /* Status of Disk Functions */ -typedef BYTE DSTATUS; +typedef BYTE DSTATUS; /* Results of Disk Functions */ typedef enum { - RES_OK = 0, /* 0: Successful */ - RES_ERROR, /* 1: R/W Error */ - RES_WRPRT, /* 2: Write Protected */ - RES_NOTRDY, /* 3: Not Ready */ - RES_PARERR /* 4: Invalid Parameter */ + RES_OK = 0, /* 0: Successful */ + RES_ERROR, /* 1: R/W Error */ + RES_WRPRT, /* 2: Write Protected */ + RES_NOTRDY, /* 3: Not Ready */ + RES_PARERR /* 4: Invalid Parameter */ } DRESULT; @@ -35,40 +35,40 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff); /* Disk Status Bits (DSTATUS) */ -#define STA_NOINIT 0x01 /* Drive not initialized */ -#define STA_NODISK 0x02 /* No medium in the drive */ -#define STA_PROTECT 0x04 /* Write protected */ +#define STA_NOINIT 0x01 /* Drive not initialized */ +#define STA_NODISK 0x02 /* No medium in the drive */ +#define STA_PROTECT 0x04 /* Write protected */ /* Command code for disk_ioctrl fucntion */ /* Generic command (Used by FatFs) */ -#define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */ -#define GET_SECTOR_COUNT 1 /* Get media size (needed at FF_USE_MKFS == 1) */ -#define GET_SECTOR_SIZE 2 /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */ -#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */ +#define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */ +#define GET_SECTOR_COUNT 1 /* Get media size (needed at FF_USE_MKFS == 1) */ +#define GET_SECTOR_SIZE 2 /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */ +#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */ +#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */ /* Generic command (Not used by FatFs) */ -#define CTRL_POWER 5 /* Get/Set power status */ -#define CTRL_LOCK 6 /* Lock/Unlock media removal */ -#define CTRL_EJECT 7 /* Eject media */ -#define CTRL_FORMAT 8 /* Create physical format on the media */ +#define CTRL_POWER 5 /* Get/Set power status */ +#define CTRL_LOCK 6 /* Lock/Unlock media removal */ +#define CTRL_EJECT 7 /* Eject media */ +#define CTRL_FORMAT 8 /* Create physical format on the media */ /* MMC/SDC specific ioctl command */ -#define MMC_GET_TYPE 10 /* Get card type */ -#define MMC_GET_CSD 11 /* Get CSD */ -#define MMC_GET_CID 12 /* Get CID */ -#define MMC_GET_OCR 13 /* Get OCR */ -#define MMC_GET_SDSTAT 14 /* Get SD status */ -#define ISDIO_READ 55 /* Read data form SD iSDIO register */ -#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ -#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ +#define MMC_GET_TYPE 10 /* Get card type */ +#define MMC_GET_CSD 11 /* Get CSD */ +#define MMC_GET_CID 12 /* Get CID */ +#define MMC_GET_OCR 13 /* Get OCR */ +#define MMC_GET_SDSTAT 14 /* Get SD status */ +#define ISDIO_READ 55 /* Read data form SD iSDIO register */ +#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */ +#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */ /* ATA/CF specific ioctl command */ -#define ATA_GET_REV 20 /* Get F/W revision */ -#define ATA_GET_MODEL 21 /* Get model name */ -#define ATA_GET_SN 22 /* Get serial number */ +#define ATA_GET_REV 20 /* Get F/W revision */ +#define ATA_GET_MODEL 21 /* Get model name */ +#define ATA_GET_SN 22 /* Get serial number */ #ifdef __cplusplus } diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.c b/components/dfs/filesystems/jffs2/dfs_jffs2.c index c082c21d73..c9e032a413 100644 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.c +++ b/components/dfs/filesystems/jffs2/dfs_jffs2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.h b/components/dfs/filesystems/jffs2/dfs_jffs2.h index 1be403a19c..ccb8ad7993 100644 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.h +++ b/components/dfs/filesystems/jffs2/dfs_jffs2.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -#ifndef __DFS_JFFS2_H__ +#ifndef __DFS_JFFS2_H__ #define __DFS_JFFS2_H__ int dfs_jffs2_init(void); diff --git a/components/dfs/filesystems/nfs/dfs_nfs.c b/components/dfs/filesystems/nfs/dfs_nfs.c index e60f6f98c0..e7ad488f7d 100644 --- a/components/dfs/filesystems/nfs/dfs_nfs.c +++ b/components/dfs/filesystems/nfs/dfs_nfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/nfs/dfs_nfs.h b/components/dfs/filesystems/nfs/dfs_nfs.h index d607776ef1..460027410d 100644 --- a/components/dfs/filesystems/nfs/dfs_nfs.h +++ b/components/dfs/filesystems/nfs/dfs_nfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/nfs/mount.h b/components/dfs/filesystems/nfs/mount.h index aac0fd6bed..ff0cec76fb 100644 --- a/components/dfs/filesystems/nfs/mount.h +++ b/components/dfs/filesystems/nfs/mount.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -12,7 +12,7 @@ */ #ifndef _MOUNT_H_RPCGEN -#define _MOUNT_H_RPCGEN +#define _MOUNT_H_RPCGEN #include @@ -23,13 +23,13 @@ extern "C" { /* This file is copied from RFC1813 * Copyright 1995 Sun Micrososystems (I assume) */ -#define MNTPATHLEN 1024 -#define MNTNAMLEN 255 -#define FHSIZE3 64 +#define MNTPATHLEN 1024 +#define MNTNAMLEN 255 +#define FHSIZE3 64 typedef struct { - unsigned int fhandle3_len; - char *fhandle3_val; + unsigned int fhandle3_len; + char *fhandle3_val; } fhandle3; typedef char *dirpath; @@ -43,70 +43,70 @@ typedef struct groupnode *groups; typedef struct mountbody *mountlist; enum mountstat3 { - MNT3_OK = 0, - MNT3ERR_PERM = 1, - MNT3ERR_NOENT = 2, - MNT3ERR_IO = 5, - MNT3ERR_ACCES = 13, - MNT3ERR_NOTDIR = 20, - MNT3ERR_INVAL = 22, - MNT3ERR_NAMETOOLONG = 63, - MNT3ERR_NOTSUPP = 10004, - MNT3ERR_SERVERFAULT = 10006 + MNT3_OK = 0, + MNT3ERR_PERM = 1, + MNT3ERR_NOENT = 2, + MNT3ERR_IO = 5, + MNT3ERR_ACCES = 13, + MNT3ERR_NOTDIR = 20, + MNT3ERR_INVAL = 22, + MNT3ERR_NAMETOOLONG = 63, + MNT3ERR_NOTSUPP = 10004, + MNT3ERR_SERVERFAULT = 10006 }; typedef enum mountstat3 mountstat3; struct mountres3_ok { - fhandle3 fhandle; - struct { - unsigned int auth_flavors_len; - int *auth_flavors_val; - } auth_flavors; + fhandle3 fhandle; + struct { + unsigned int auth_flavors_len; + int *auth_flavors_val; + } auth_flavors; }; typedef struct mountres3_ok mountres3_ok; struct mountres3 { - mountstat3 fhs_status; - union { - mountres3_ok mountinfo; - } mountres3_u; + mountstat3 fhs_status; + union { + mountres3_ok mountinfo; + } mountres3_u; }; typedef struct mountres3 mountres3; struct mountbody { - name ml_hostname; - dirpath ml_directory; - mountlist ml_next; + name ml_hostname; + dirpath ml_directory; + mountlist ml_next; }; typedef struct mountbody mountbody; struct groupnode { - name gr_name; - groups gr_next; + name gr_name; + groups gr_next; }; typedef struct groupnode groupnode; struct exportnode { - dirpath ex_dir; - groups ex_groups; - exports ex_next; + dirpath ex_dir; + groups ex_groups; + exports ex_next; }; typedef struct exportnode exportnode; -#define MOUNT_PROGRAM 100005 -#define MOUNT_V3 3 +#define MOUNT_PROGRAM 100005 +#define MOUNT_V3 3 -#define MOUNTPROC3_NULL 0 +#define MOUNTPROC3_NULL 0 extern enum clnt_stat mountproc3_null_3(void *, CLIENT *); -#define MOUNTPROC3_MNT 1 +#define MOUNTPROC3_MNT 1 extern enum clnt_stat mountproc3_mnt_3(dirpath , mountres3 *, CLIENT *); -#define MOUNTPROC3_DUMP 2 +#define MOUNTPROC3_DUMP 2 extern enum clnt_stat mountproc3_dump_3(mountlist *, CLIENT *); -#define MOUNTPROC3_UMNT 3 +#define MOUNTPROC3_UMNT 3 extern enum clnt_stat mountproc3_umnt_3(dirpath , void *, CLIENT *); -#define MOUNTPROC3_UMNTALL 4 +#define MOUNTPROC3_UMNTALL 4 extern enum clnt_stat mountproc3_umntall_3(void *, CLIENT *); -#define MOUNTPROC3_EXPORT 5 +#define MOUNTPROC3_EXPORT 5 extern enum clnt_stat mountproc3_export_3(exports *, CLIENT *); /* the xdr functions */ diff --git a/components/dfs/filesystems/nfs/mount_clnt.c b/components/dfs/filesystems/nfs/mount_clnt.c index 5c65e75aa5..9e05f7ee61 100644 --- a/components/dfs/filesystems/nfs/mount_clnt.c +++ b/components/dfs/filesystems/nfs/mount_clnt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -23,56 +23,56 @@ typedef char* caddr_t; /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = { 25, 0 }; -enum clnt_stat +enum clnt_stat mountproc3_null_3(void *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, MOUNTPROC3_NULL, - (xdrproc_t) xdr_void, (caddr_t) NULL, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, MOUNTPROC3_NULL, + (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_void, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat mountproc3_mnt_3(dirpath arg1, mountres3 *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, MOUNTPROC3_MNT, - (xdrproc_t) xdr_dirpath, (caddr_t) &arg1, - (xdrproc_t) xdr_mountres3, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, MOUNTPROC3_MNT, + (xdrproc_t) xdr_dirpath, (caddr_t) &arg1, + (xdrproc_t) xdr_mountres3, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat mountproc3_dump_3(mountlist *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, MOUNTPROC3_DUMP, - (xdrproc_t) xdr_void, (caddr_t) NULL, - (xdrproc_t) xdr_mountlist, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, MOUNTPROC3_DUMP, + (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_mountlist, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat mountproc3_umnt_3(dirpath arg1, void *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, MOUNTPROC3_UMNT, - (xdrproc_t) xdr_dirpath, (caddr_t) &arg1, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, MOUNTPROC3_UMNT, + (xdrproc_t) xdr_dirpath, (caddr_t) &arg1, + (xdrproc_t) xdr_void, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat mountproc3_umntall_3(void *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, MOUNTPROC3_UMNTALL, - (xdrproc_t) xdr_void, (caddr_t) NULL, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, MOUNTPROC3_UMNTALL, + (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_void, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat mountproc3_export_3(exports *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, MOUNTPROC3_EXPORT, - (xdrproc_t) xdr_void, (caddr_t) NULL, - (xdrproc_t) xdr_exports, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, MOUNTPROC3_EXPORT, + (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_exports, (caddr_t) clnt_res, + TIMEOUT)); } diff --git a/components/dfs/filesystems/nfs/mount_xdr.c b/components/dfs/filesystems/nfs/mount_xdr.c index 04faa3bb7a..e1e797000f 100644 --- a/components/dfs/filesystems/nfs/mount_xdr.c +++ b/components/dfs/filesystems/nfs/mount_xdr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,124 +19,124 @@ bool_t xdr_fhandle3(register XDR *xdrs, fhandle3 *objp) { - if (!xdr_bytes(xdrs, (char **)&objp->fhandle3_val, (unsigned int *) &objp->fhandle3_len, FHSIZE3)) - return (FALSE); - return (TRUE); + if (!xdr_bytes(xdrs, (char **)&objp->fhandle3_val, (unsigned int *) &objp->fhandle3_len, FHSIZE3)) + return (FALSE); + return (TRUE); } bool_t xdr_dirpath(register XDR *xdrs, dirpath *objp) { - if (!xdr_string(xdrs, objp, MNTPATHLEN)) - return (FALSE); - return (TRUE); + if (!xdr_string(xdrs, objp, MNTPATHLEN)) + return (FALSE); + return (TRUE); } bool_t xdr_name(register XDR *xdrs, name *objp) { - if (!xdr_string(xdrs, objp, MNTNAMLEN)) - return (FALSE); - return (TRUE); + if (!xdr_string(xdrs, objp, MNTNAMLEN)) + return (FALSE); + return (TRUE); } bool_t xdr_exports(register XDR *xdrs, exports *objp) { - if (!xdr_pointer(xdrs, (char **)objp, sizeof (struct exportnode), (xdrproc_t) xdr_exportnode)) - return (FALSE); - return (TRUE); + if (!xdr_pointer(xdrs, (char **)objp, sizeof (struct exportnode), (xdrproc_t) xdr_exportnode)) + return (FALSE); + return (TRUE); } bool_t xdr_groups(register XDR *xdrs, groups *objp) { - if (!xdr_pointer(xdrs, (char **)objp, sizeof (struct groupnode), (xdrproc_t) xdr_groupnode)) - return (FALSE); - return (TRUE); + if (!xdr_pointer(xdrs, (char **)objp, sizeof (struct groupnode), (xdrproc_t) xdr_groupnode)) + return (FALSE); + return (TRUE); } bool_t xdr_mountlist(register XDR *xdrs, mountlist *objp) { - if (!xdr_pointer(xdrs, (char **)objp, sizeof (struct mountbody), (xdrproc_t) xdr_mountbody)) - return (FALSE); - return (TRUE); + if (!xdr_pointer(xdrs, (char **)objp, sizeof (struct mountbody), (xdrproc_t) xdr_mountbody)) + return (FALSE); + return (TRUE); } bool_t xdr_mountstat3(register XDR *xdrs, mountstat3 *objp) { - int enum_objp; + int enum_objp; - enum_objp = *objp; + enum_objp = *objp; - if (!xdr_enum(xdrs, (enum_t *)&enum_objp)) - { - *objp = (mountstat3)enum_objp; - return (FALSE); - } + if (!xdr_enum(xdrs, (enum_t *)&enum_objp)) + { + *objp = (mountstat3)enum_objp; + return (FALSE); + } - return (TRUE); + return (TRUE); } bool_t xdr_mountres3_ok(register XDR *xdrs, mountres3_ok *objp) { - if (!xdr_fhandle3(xdrs, &objp->fhandle)) - return (FALSE); - if (!xdr_array(xdrs, (char **)&objp->auth_flavors.auth_flavors_val, (unsigned int *) &objp->auth_flavors.auth_flavors_len, ~0, - sizeof (int), (xdrproc_t) xdr_int)) - return (FALSE); - return (TRUE); + if (!xdr_fhandle3(xdrs, &objp->fhandle)) + return (FALSE); + if (!xdr_array(xdrs, (char **)&objp->auth_flavors.auth_flavors_val, (unsigned int *) &objp->auth_flavors.auth_flavors_len, ~0, + sizeof (int), (xdrproc_t) xdr_int)) + return (FALSE); + return (TRUE); } bool_t xdr_mountres3(register XDR *xdrs, mountres3 *objp) { - if (!xdr_mountstat3(xdrs, &objp->fhs_status)) - return (FALSE); - switch (objp->fhs_status) { - case MNT3_OK: - if (!xdr_mountres3_ok(xdrs, &objp->mountres3_u.mountinfo)) - return (FALSE); - break; - default : - return (FALSE); - } - return (TRUE); + if (!xdr_mountstat3(xdrs, &objp->fhs_status)) + return (FALSE); + switch (objp->fhs_status) { + case MNT3_OK: + if (!xdr_mountres3_ok(xdrs, &objp->mountres3_u.mountinfo)) + return (FALSE); + break; + default : + return (FALSE); + } + return (TRUE); } bool_t xdr_mountbody(register XDR *xdrs, mountbody *objp) { - if (!xdr_name(xdrs, &objp->ml_hostname)) - return (FALSE); - if (!xdr_dirpath(xdrs, &objp->ml_directory)) - return (FALSE); - if (!xdr_mountlist(xdrs, &objp->ml_next)) - return (FALSE); - return (TRUE); + if (!xdr_name(xdrs, &objp->ml_hostname)) + return (FALSE); + if (!xdr_dirpath(xdrs, &objp->ml_directory)) + return (FALSE); + if (!xdr_mountlist(xdrs, &objp->ml_next)) + return (FALSE); + return (TRUE); } bool_t xdr_groupnode(register XDR *xdrs, groupnode *objp) { - if (!xdr_name(xdrs, &objp->gr_name)) - return (FALSE); - if (!xdr_groups(xdrs, &objp->gr_next)) - return (FALSE); - return (TRUE); + if (!xdr_name(xdrs, &objp->gr_name)) + return (FALSE); + if (!xdr_groups(xdrs, &objp->gr_next)) + return (FALSE); + return (TRUE); } bool_t xdr_exportnode(register XDR *xdrs, exportnode *objp) { - if (!xdr_dirpath(xdrs, &objp->ex_dir)) - return (FALSE); - if (!xdr_groups(xdrs, &objp->ex_groups)) - return (FALSE); - if (!xdr_exports(xdrs, &objp->ex_next)) - return (FALSE); - return (TRUE); + if (!xdr_dirpath(xdrs, &objp->ex_dir)) + return (FALSE); + if (!xdr_groups(xdrs, &objp->ex_groups)) + return (FALSE); + if (!xdr_exports(xdrs, &objp->ex_next)) + return (FALSE); + return (TRUE); } diff --git a/components/dfs/filesystems/nfs/nfs.h b/components/dfs/filesystems/nfs/nfs.h index 34054b0084..8c417ec7f4 100644 --- a/components/dfs/filesystems/nfs/nfs.h +++ b/components/dfs/filesystems/nfs/nfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -12,7 +12,7 @@ */ #ifndef _NFS_H_RPCGEN -#define _NFS_H_RPCGEN +#define _NFS_H_RPCGEN #include @@ -23,20 +23,20 @@ extern "C" { /* This file is copied from RFC1813 * Copyright 1995 Sun Micrososystems (I assume) */ -#define NFS3_FHSIZE 64 -#define NFS3_COOKIEVERFSIZE 8 -#define NFS3_CREATEVERFSIZE 8 -#define NFS3_WRITEVERFSIZE 8 -#define ACCESS3_READ 0x0001 -#define ACCESS3_LOOKUP 0x0002 -#define ACCESS3_MODIFY 0x0004 -#define ACCESS3_EXTEND 0x0008 -#define ACCESS3_DELETE 0x0010 -#define ACCESS3_EXECUTE 0x0020 -#define FSF3_LINK 0x0001 -#define FSF3_SYMLINK 0x0002 -#define FSF3_HOMOGENEOUS 0x0008 -#define FSF3_CANSETTIME 0x0010 +#define NFS3_FHSIZE 64 +#define NFS3_COOKIEVERFSIZE 8 +#define NFS3_CREATEVERFSIZE 8 +#define NFS3_WRITEVERFSIZE 8 +#define ACCESS3_READ 0x0001 +#define ACCESS3_LOOKUP 0x0002 +#define ACCESS3_MODIFY 0x0004 +#define ACCESS3_EXTEND 0x0008 +#define ACCESS3_DELETE 0x0010 +#define ACCESS3_EXECUTE 0x0020 +#define FSF3_LINK 0x0001 +#define FSF3_SYMLINK 0x0002 +#define FSF3_HOMOGENEOUS 0x0008 +#define FSF3_CANSETTIME 0x0010 typedef unsigned long long uint64; @@ -73,900 +73,900 @@ typedef uint32 mode3; typedef uint32 count3; enum nfsstat3 { - NFS3_OK = 0, - NFS3ERR_PERM = 1, - NFS3ERR_NOENT = 2, - NFS3ERR_IO = 5, - NFS3ERR_NXIO = 6, - NFS3ERR_ACCES = 13, - NFS3ERR_EXIST = 17, - NFS3ERR_XDEV = 18, - NFS3ERR_NODEV = 19, - NFS3ERR_NOTDIR = 20, - NFS3ERR_ISDIR = 21, - NFS3ERR_INVAL = 22, - NFS3ERR_FBIG = 27, - NFS3ERR_NOSPC = 28, - NFS3ERR_ROFS = 30, - NFS3ERR_MLINK = 31, - NFS3ERR_NAMETOOLONG = 63, - NFS3ERR_NOTEMPTY = 66, - NFS3ERR_DQUOT = 69, - NFS3ERR_STALE = 70, - NFS3ERR_REMOTE = 71, - NFS3ERR_BADHANDLE = 10001, - NFS3ERR_NOT_SYNC = 10002, - NFS3ERR_BAD_COOKIE = 10003, - NFS3ERR_NOTSUPP = 10004, - NFS3ERR_TOOSMALL = 10005, - NFS3ERR_SERVERFAULT = 10006, - NFS3ERR_BADTYPE = 10007, - NFS3ERR_JUKEBOX = 10008 + NFS3_OK = 0, + NFS3ERR_PERM = 1, + NFS3ERR_NOENT = 2, + NFS3ERR_IO = 5, + NFS3ERR_NXIO = 6, + NFS3ERR_ACCES = 13, + NFS3ERR_EXIST = 17, + NFS3ERR_XDEV = 18, + NFS3ERR_NODEV = 19, + NFS3ERR_NOTDIR = 20, + NFS3ERR_ISDIR = 21, + NFS3ERR_INVAL = 22, + NFS3ERR_FBIG = 27, + NFS3ERR_NOSPC = 28, + NFS3ERR_ROFS = 30, + NFS3ERR_MLINK = 31, + NFS3ERR_NAMETOOLONG = 63, + NFS3ERR_NOTEMPTY = 66, + NFS3ERR_DQUOT = 69, + NFS3ERR_STALE = 70, + NFS3ERR_REMOTE = 71, + NFS3ERR_BADHANDLE = 10001, + NFS3ERR_NOT_SYNC = 10002, + NFS3ERR_BAD_COOKIE = 10003, + NFS3ERR_NOTSUPP = 10004, + NFS3ERR_TOOSMALL = 10005, + NFS3ERR_SERVERFAULT = 10006, + NFS3ERR_BADTYPE = 10007, + NFS3ERR_JUKEBOX = 10008 }; typedef enum nfsstat3 nfsstat3; enum ftype3 { - NFS3REG = 1, - NFS3DIR = 2, - NFS3BLK = 3, - NFS3CHR = 4, - NFS3LNK = 5, - NFS3SOCK = 6, - NFS3FIFO = 7 + NFS3REG = 1, + NFS3DIR = 2, + NFS3BLK = 3, + NFS3CHR = 4, + NFS3LNK = 5, + NFS3SOCK = 6, + NFS3FIFO = 7 }; typedef enum ftype3 ftype3; enum stable_how { - UNSTABLE = 0, - DATA_SYNC = 1, - FILE_SYNC = 2 + UNSTABLE = 0, + DATA_SYNC = 1, + FILE_SYNC = 2 }; typedef enum stable_how stable_how; enum createmode3 { - UNCHECKED = 0, - GUARDED = 1, - EXCLUSIVE = 2 + UNCHECKED = 0, + GUARDED = 1, + EXCLUSIVE = 2 }; typedef enum createmode3 createmode3; struct specdata3 { - uint32 specdata1; - uint32 specdata2; + uint32 specdata1; + uint32 specdata2; }; typedef struct specdata3 specdata3; struct nfs_fh3 { - struct { - unsigned int data_len; - char *data_val; - } data; + struct { + unsigned int data_len; + char *data_val; + } data; }; typedef struct nfs_fh3 nfs_fh3; struct nfstime3 { - uint32 seconds; - uint32 nseconds; + uint32 seconds; + uint32 nseconds; }; typedef struct nfstime3 nfstime3; struct fattr3 { - ftype3 type; - mode3 mode; - uint32 nlink; - uid3 uid; - gid3 gid; - size3 size; - size3 used; - specdata3 rdev; - uint64 fsid; - fileid3 fileid; - nfstime3 atime; - nfstime3 mtime; - nfstime3 ctime; + ftype3 type; + mode3 mode; + uint32 nlink; + uid3 uid; + gid3 gid; + size3 size; + size3 used; + specdata3 rdev; + uint64 fsid; + fileid3 fileid; + nfstime3 atime; + nfstime3 mtime; + nfstime3 ctime; }; typedef struct fattr3 fattr3; struct post_op_attr { - bool_t attributes_follow; - union { - fattr3 attributes; - } post_op_attr_u; + bool_t attributes_follow; + union { + fattr3 attributes; + } post_op_attr_u; }; typedef struct post_op_attr post_op_attr; struct wcc_attr { - size3 size; - nfstime3 mtime; - nfstime3 ctime; + size3 size; + nfstime3 mtime; + nfstime3 ctime; }; typedef struct wcc_attr wcc_attr; struct pre_op_attr { - bool_t attributes_follow; - union { - wcc_attr attributes; - } pre_op_attr_u; + bool_t attributes_follow; + union { + wcc_attr attributes; + } pre_op_attr_u; }; typedef struct pre_op_attr pre_op_attr; struct wcc_data { - pre_op_attr before; - post_op_attr after; + pre_op_attr before; + post_op_attr after; }; typedef struct wcc_data wcc_data; struct post_op_fh3 { - bool_t handle_follows; - union { - nfs_fh3 handle; - } post_op_fh3_u; + bool_t handle_follows; + union { + nfs_fh3 handle; + } post_op_fh3_u; }; typedef struct post_op_fh3 post_op_fh3; enum time_how { - DONT_CHANGE = 0, - SET_TO_SERVER_TIME = 1, - SET_TO_CLIENT_TIME = 2 + DONT_CHANGE = 0, + SET_TO_SERVER_TIME = 1, + SET_TO_CLIENT_TIME = 2 }; typedef enum time_how time_how; struct set_mode3 { - bool_t set_it; - union { - mode3 mode; - } set_mode3_u; + bool_t set_it; + union { + mode3 mode; + } set_mode3_u; }; typedef struct set_mode3 set_mode3; struct set_uid3 { - bool_t set_it; - union { - uid3 uid; - } set_uid3_u; + bool_t set_it; + union { + uid3 uid; + } set_uid3_u; }; typedef struct set_uid3 set_uid3; struct set_gid3 { - bool_t set_it; - union { - gid3 gid; - } set_gid3_u; + bool_t set_it; + union { + gid3 gid; + } set_gid3_u; }; typedef struct set_gid3 set_gid3; struct set_size3 { - bool_t set_it; - union { - size3 size; - } set_size3_u; + bool_t set_it; + union { + size3 size; + } set_size3_u; }; typedef struct set_size3 set_size3; struct set_atime { - time_how set_it; - union { - nfstime3 atime; - } set_atime_u; + time_how set_it; + union { + nfstime3 atime; + } set_atime_u; }; typedef struct set_atime set_atime; struct set_mtime { - time_how set_it; - union { - nfstime3 mtime; - } set_mtime_u; + time_how set_it; + union { + nfstime3 mtime; + } set_mtime_u; }; typedef struct set_mtime set_mtime; struct sattr3 { - set_mode3 mode; - set_uid3 uid; - set_gid3 gid; - set_size3 size; - set_atime atime; - set_mtime mtime; + set_mode3 mode; + set_uid3 uid; + set_gid3 gid; + set_size3 size; + set_atime atime; + set_mtime mtime; }; typedef struct sattr3 sattr3; struct diropargs3 { - nfs_fh3 dir; - filename3 name; + nfs_fh3 dir; + filename3 name; }; typedef struct diropargs3 diropargs3; struct GETATTR3args { - nfs_fh3 object; + nfs_fh3 object; }; typedef struct GETATTR3args GETATTR3args; struct GETATTR3resok { - fattr3 obj_attributes; + fattr3 obj_attributes; }; typedef struct GETATTR3resok GETATTR3resok; struct GETATTR3res { - nfsstat3 status; - union { - GETATTR3resok resok; - } GETATTR3res_u; + nfsstat3 status; + union { + GETATTR3resok resok; + } GETATTR3res_u; }; typedef struct GETATTR3res GETATTR3res; struct sattrguard3 { - bool_t check; - union { - nfstime3 obj_ctime; - } sattrguard3_u; + bool_t check; + union { + nfstime3 obj_ctime; + } sattrguard3_u; }; typedef struct sattrguard3 sattrguard3; struct SETATTR3args { - nfs_fh3 object; - sattr3 new_attributes; - sattrguard3 guard; + nfs_fh3 object; + sattr3 new_attributes; + sattrguard3 guard; }; typedef struct SETATTR3args SETATTR3args; struct SETATTR3resok { - wcc_data obj_wcc; + wcc_data obj_wcc; }; typedef struct SETATTR3resok SETATTR3resok; struct SETATTR3resfail { - wcc_data obj_wcc; + wcc_data obj_wcc; }; typedef struct SETATTR3resfail SETATTR3resfail; struct SETATTR3res { - nfsstat3 status; - union { - SETATTR3resok resok; - SETATTR3resfail resfail; - } SETATTR3res_u; + nfsstat3 status; + union { + SETATTR3resok resok; + SETATTR3resfail resfail; + } SETATTR3res_u; }; typedef struct SETATTR3res SETATTR3res; struct LOOKUP3args { - diropargs3 what; + diropargs3 what; }; typedef struct LOOKUP3args LOOKUP3args; struct LOOKUP3resok { - nfs_fh3 object; - post_op_attr obj_attributes; - post_op_attr dir_attributes; + nfs_fh3 object; + post_op_attr obj_attributes; + post_op_attr dir_attributes; }; typedef struct LOOKUP3resok LOOKUP3resok; struct LOOKUP3resfail { - post_op_attr dir_attributes; + post_op_attr dir_attributes; }; typedef struct LOOKUP3resfail LOOKUP3resfail; struct LOOKUP3res { - nfsstat3 status; - union { - LOOKUP3resok resok; - LOOKUP3resfail resfail; - } LOOKUP3res_u; + nfsstat3 status; + union { + LOOKUP3resok resok; + LOOKUP3resfail resfail; + } LOOKUP3res_u; }; typedef struct LOOKUP3res LOOKUP3res; struct ACCESS3args { - nfs_fh3 object; - uint32 access; + nfs_fh3 object; + uint32 access; }; typedef struct ACCESS3args ACCESS3args; struct ACCESS3resok { - post_op_attr obj_attributes; - uint32 access; + post_op_attr obj_attributes; + uint32 access; }; typedef struct ACCESS3resok ACCESS3resok; struct ACCESS3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct ACCESS3resfail ACCESS3resfail; struct ACCESS3res { - nfsstat3 status; - union { - ACCESS3resok resok; - ACCESS3resfail resfail; - } ACCESS3res_u; + nfsstat3 status; + union { + ACCESS3resok resok; + ACCESS3resfail resfail; + } ACCESS3res_u; }; typedef struct ACCESS3res ACCESS3res; struct READLINK3args { - nfs_fh3 symlink; + nfs_fh3 symlink; }; typedef struct READLINK3args READLINK3args; struct READLINK3resok { - post_op_attr symlink_attributes; - nfspath3 data; + post_op_attr symlink_attributes; + nfspath3 data; }; typedef struct READLINK3resok READLINK3resok; struct READLINK3resfail { - post_op_attr symlink_attributes; + post_op_attr symlink_attributes; }; typedef struct READLINK3resfail READLINK3resfail; struct READLINK3res { - nfsstat3 status; - union { - READLINK3resok resok; - READLINK3resfail resfail; - } READLINK3res_u; + nfsstat3 status; + union { + READLINK3resok resok; + READLINK3resfail resfail; + } READLINK3res_u; }; typedef struct READLINK3res READLINK3res; struct READ3args { - nfs_fh3 file; - offset3 offset; - count3 count; + nfs_fh3 file; + offset3 offset; + count3 count; }; typedef struct READ3args READ3args; struct READ3resok { - post_op_attr file_attributes; - count3 count; - bool_t eof; - struct { - unsigned int data_len; - char *data_val; - } data; + post_op_attr file_attributes; + count3 count; + bool_t eof; + struct { + unsigned int data_len; + char *data_val; + } data; }; typedef struct READ3resok READ3resok; struct READ3resfail { - post_op_attr file_attributes; + post_op_attr file_attributes; }; typedef struct READ3resfail READ3resfail; struct READ3res { - nfsstat3 status; - union { - READ3resok resok; - READ3resfail resfail; - } READ3res_u; + nfsstat3 status; + union { + READ3resok resok; + READ3resfail resfail; + } READ3res_u; }; typedef struct READ3res READ3res; struct WRITE3args { - nfs_fh3 file; - offset3 offset; - count3 count; - stable_how stable; - struct { - unsigned int data_len; - char *data_val; - } data; + nfs_fh3 file; + offset3 offset; + count3 count; + stable_how stable; + struct { + unsigned int data_len; + char *data_val; + } data; }; typedef struct WRITE3args WRITE3args; struct WRITE3resok { - wcc_data file_wcc; - count3 count; - stable_how committed; - writeverf3 verf; + wcc_data file_wcc; + count3 count; + stable_how committed; + writeverf3 verf; }; typedef struct WRITE3resok WRITE3resok; struct WRITE3resfail { - wcc_data file_wcc; + wcc_data file_wcc; }; typedef struct WRITE3resfail WRITE3resfail; struct WRITE3res { - nfsstat3 status; - union { - WRITE3resok resok; - WRITE3resfail resfail; - } WRITE3res_u; + nfsstat3 status; + union { + WRITE3resok resok; + WRITE3resfail resfail; + } WRITE3res_u; }; typedef struct WRITE3res WRITE3res; struct createhow3 { - createmode3 mode; - union { - sattr3 obj_attributes; - createverf3 verf; - } createhow3_u; + createmode3 mode; + union { + sattr3 obj_attributes; + createverf3 verf; + } createhow3_u; }; typedef struct createhow3 createhow3; struct CREATE3args { - diropargs3 where; - createhow3 how; + diropargs3 where; + createhow3 how; }; typedef struct CREATE3args CREATE3args; struct CREATE3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct CREATE3resok CREATE3resok; struct CREATE3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct CREATE3resfail CREATE3resfail; struct CREATE3res { - nfsstat3 status; - union { - CREATE3resok resok; - CREATE3resfail resfail; - } CREATE3res_u; + nfsstat3 status; + union { + CREATE3resok resok; + CREATE3resfail resfail; + } CREATE3res_u; }; typedef struct CREATE3res CREATE3res; struct MKDIR3args { - diropargs3 where; - sattr3 attributes; + diropargs3 where; + sattr3 attributes; }; typedef struct MKDIR3args MKDIR3args; struct MKDIR3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct MKDIR3resok MKDIR3resok; struct MKDIR3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct MKDIR3resfail MKDIR3resfail; struct MKDIR3res { - nfsstat3 status; - union { - MKDIR3resok resok; - MKDIR3resfail resfail; - } MKDIR3res_u; + nfsstat3 status; + union { + MKDIR3resok resok; + MKDIR3resfail resfail; + } MKDIR3res_u; }; typedef struct MKDIR3res MKDIR3res; struct symlinkdata3 { - sattr3 symlink_attributes; - nfspath3 symlink_data; + sattr3 symlink_attributes; + nfspath3 symlink_data; }; typedef struct symlinkdata3 symlinkdata3; struct SYMLINK3args { - diropargs3 where; - symlinkdata3 symlink; + diropargs3 where; + symlinkdata3 symlink; }; typedef struct SYMLINK3args SYMLINK3args; struct SYMLINK3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct SYMLINK3resok SYMLINK3resok; struct SYMLINK3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct SYMLINK3resfail SYMLINK3resfail; struct SYMLINK3res { - nfsstat3 status; - union { - SYMLINK3resok resok; - SYMLINK3resfail resfail; - } SYMLINK3res_u; + nfsstat3 status; + union { + SYMLINK3resok resok; + SYMLINK3resfail resfail; + } SYMLINK3res_u; }; typedef struct SYMLINK3res SYMLINK3res; struct devicedata3 { - sattr3 dev_attributes; - specdata3 spec; + sattr3 dev_attributes; + specdata3 spec; }; typedef struct devicedata3 devicedata3; struct mknoddata3 { - ftype3 type; - union { - devicedata3 device; - sattr3 pipe_attributes; - } mknoddata3_u; + ftype3 type; + union { + devicedata3 device; + sattr3 pipe_attributes; + } mknoddata3_u; }; typedef struct mknoddata3 mknoddata3; struct MKNOD3args { - diropargs3 where; - mknoddata3 what; + diropargs3 where; + mknoddata3 what; }; typedef struct MKNOD3args MKNOD3args; struct MKNOD3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct MKNOD3resok MKNOD3resok; struct MKNOD3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct MKNOD3resfail MKNOD3resfail; struct MKNOD3res { - nfsstat3 status; - union { - MKNOD3resok resok; - MKNOD3resfail resfail; - } MKNOD3res_u; + nfsstat3 status; + union { + MKNOD3resok resok; + MKNOD3resfail resfail; + } MKNOD3res_u; }; typedef struct MKNOD3res MKNOD3res; struct REMOVE3args { - diropargs3 object; + diropargs3 object; }; typedef struct REMOVE3args REMOVE3args; struct REMOVE3resok { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct REMOVE3resok REMOVE3resok; struct REMOVE3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct REMOVE3resfail REMOVE3resfail; struct REMOVE3res { - nfsstat3 status; - union { - REMOVE3resok resok; - REMOVE3resfail resfail; - } REMOVE3res_u; + nfsstat3 status; + union { + REMOVE3resok resok; + REMOVE3resfail resfail; + } REMOVE3res_u; }; typedef struct REMOVE3res REMOVE3res; struct RMDIR3args { - diropargs3 object; + diropargs3 object; }; typedef struct RMDIR3args RMDIR3args; struct RMDIR3resok { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct RMDIR3resok RMDIR3resok; struct RMDIR3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct RMDIR3resfail RMDIR3resfail; struct RMDIR3res { - nfsstat3 status; - union { - RMDIR3resok resok; - RMDIR3resfail resfail; - } RMDIR3res_u; + nfsstat3 status; + union { + RMDIR3resok resok; + RMDIR3resfail resfail; + } RMDIR3res_u; }; typedef struct RMDIR3res RMDIR3res; struct RENAME3args { - diropargs3 from; - diropargs3 to; + diropargs3 from; + diropargs3 to; }; typedef struct RENAME3args RENAME3args; struct RENAME3resok { - wcc_data fromdir_wcc; - wcc_data todir_wcc; + wcc_data fromdir_wcc; + wcc_data todir_wcc; }; typedef struct RENAME3resok RENAME3resok; struct RENAME3resfail { - wcc_data fromdir_wcc; - wcc_data todir_wcc; + wcc_data fromdir_wcc; + wcc_data todir_wcc; }; typedef struct RENAME3resfail RENAME3resfail; struct RENAME3res { - nfsstat3 status; - union { - RENAME3resok resok; - RENAME3resfail resfail; - } RENAME3res_u; + nfsstat3 status; + union { + RENAME3resok resok; + RENAME3resfail resfail; + } RENAME3res_u; }; typedef struct RENAME3res RENAME3res; struct LINK3args { - nfs_fh3 file; - diropargs3 link; + nfs_fh3 file; + diropargs3 link; }; typedef struct LINK3args LINK3args; struct LINK3resok { - post_op_attr file_attributes; - wcc_data linkdir_wcc; + post_op_attr file_attributes; + wcc_data linkdir_wcc; }; typedef struct LINK3resok LINK3resok; struct LINK3resfail { - post_op_attr file_attributes; - wcc_data linkdir_wcc; + post_op_attr file_attributes; + wcc_data linkdir_wcc; }; typedef struct LINK3resfail LINK3resfail; struct LINK3res { - nfsstat3 status; - union { - LINK3resok resok; - LINK3resfail resfail; - } LINK3res_u; + nfsstat3 status; + union { + LINK3resok resok; + LINK3resfail resfail; + } LINK3res_u; }; typedef struct LINK3res LINK3res; struct READDIR3args { - nfs_fh3 dir; - cookie3 cookie; - cookieverf3 cookieverf; - count3 count; + nfs_fh3 dir; + cookie3 cookie; + cookieverf3 cookieverf; + count3 count; }; typedef struct READDIR3args READDIR3args; struct entry3 { - fileid3 fileid; - filename3 name; - cookie3 cookie; - struct entry3 *nextentry; + fileid3 fileid; + filename3 name; + cookie3 cookie; + struct entry3 *nextentry; }; typedef struct entry3 entry3; struct dirlist3 { - entry3 *entries; - bool_t eof; + entry3 *entries; + bool_t eof; }; typedef struct dirlist3 dirlist3; struct READDIR3resok { - post_op_attr dir_attributes; - cookieverf3 cookieverf; - dirlist3 reply; + post_op_attr dir_attributes; + cookieverf3 cookieverf; + dirlist3 reply; }; typedef struct READDIR3resok READDIR3resok; struct READDIR3resfail { - post_op_attr dir_attributes; + post_op_attr dir_attributes; }; typedef struct READDIR3resfail READDIR3resfail; struct READDIR3res { - nfsstat3 status; - union { - READDIR3resok resok; - READDIR3resfail resfail; - } READDIR3res_u; + nfsstat3 status; + union { + READDIR3resok resok; + READDIR3resfail resfail; + } READDIR3res_u; }; typedef struct READDIR3res READDIR3res; struct READDIRPLUS3args { - nfs_fh3 dir; - cookie3 cookie; - cookieverf3 cookieverf; - count3 dircount; - count3 maxcount; + nfs_fh3 dir; + cookie3 cookie; + cookieverf3 cookieverf; + count3 dircount; + count3 maxcount; }; typedef struct READDIRPLUS3args READDIRPLUS3args; struct entryplus3 { - fileid3 fileid; - filename3 name; - cookie3 cookie; - post_op_attr name_attributes; - post_op_fh3 name_handle; - struct entryplus3 *nextentry; + fileid3 fileid; + filename3 name; + cookie3 cookie; + post_op_attr name_attributes; + post_op_fh3 name_handle; + struct entryplus3 *nextentry; }; typedef struct entryplus3 entryplus3; struct dirlistplus3 { - entryplus3 *entries; - bool_t eof; + entryplus3 *entries; + bool_t eof; }; typedef struct dirlistplus3 dirlistplus3; struct READDIRPLUS3resok { - post_op_attr dir_attributes; - cookieverf3 cookieverf; - dirlistplus3 reply; + post_op_attr dir_attributes; + cookieverf3 cookieverf; + dirlistplus3 reply; }; typedef struct READDIRPLUS3resok READDIRPLUS3resok; struct READDIRPLUS3resfail { - post_op_attr dir_attributes; + post_op_attr dir_attributes; }; typedef struct READDIRPLUS3resfail READDIRPLUS3resfail; struct READDIRPLUS3res { - nfsstat3 status; - union { - READDIRPLUS3resok resok; - READDIRPLUS3resfail resfail; - } READDIRPLUS3res_u; + nfsstat3 status; + union { + READDIRPLUS3resok resok; + READDIRPLUS3resfail resfail; + } READDIRPLUS3res_u; }; typedef struct READDIRPLUS3res READDIRPLUS3res; struct FSSTAT3args { - nfs_fh3 fsroot; + nfs_fh3 fsroot; }; typedef struct FSSTAT3args FSSTAT3args; struct FSSTAT3resok { - post_op_attr obj_attributes; - size3 tbytes; - size3 fbytes; - size3 abytes; - size3 tfiles; - size3 ffiles; - size3 afiles; - uint32 invarsec; + post_op_attr obj_attributes; + size3 tbytes; + size3 fbytes; + size3 abytes; + size3 tfiles; + size3 ffiles; + size3 afiles; + uint32 invarsec; }; typedef struct FSSTAT3resok FSSTAT3resok; struct FSSTAT3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct FSSTAT3resfail FSSTAT3resfail; struct FSSTAT3res { - nfsstat3 status; - union { - FSSTAT3resok resok; - FSSTAT3resfail resfail; - } FSSTAT3res_u; + nfsstat3 status; + union { + FSSTAT3resok resok; + FSSTAT3resfail resfail; + } FSSTAT3res_u; }; typedef struct FSSTAT3res FSSTAT3res; struct FSINFO3args { - nfs_fh3 fsroot; + nfs_fh3 fsroot; }; typedef struct FSINFO3args FSINFO3args; struct FSINFO3resok { - post_op_attr obj_attributes; - uint32 rtmax; - uint32 rtpref; - uint32 rtmult; - uint32 wtmax; - uint32 wtpref; - uint32 wtmult; - uint32 dtpref; - size3 maxfilesize; - nfstime3 time_delta; - uint32 properties; + post_op_attr obj_attributes; + uint32 rtmax; + uint32 rtpref; + uint32 rtmult; + uint32 wtmax; + uint32 wtpref; + uint32 wtmult; + uint32 dtpref; + size3 maxfilesize; + nfstime3 time_delta; + uint32 properties; }; typedef struct FSINFO3resok FSINFO3resok; struct FSINFO3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct FSINFO3resfail FSINFO3resfail; struct FSINFO3res { - nfsstat3 status; - union { - FSINFO3resok resok; - FSINFO3resfail resfail; - } FSINFO3res_u; + nfsstat3 status; + union { + FSINFO3resok resok; + FSINFO3resfail resfail; + } FSINFO3res_u; }; typedef struct FSINFO3res FSINFO3res; struct PATHCONF3args { - nfs_fh3 object; + nfs_fh3 object; }; typedef struct PATHCONF3args PATHCONF3args; struct PATHCONF3resok { - post_op_attr obj_attributes; - uint32 linkmax; - uint32 name_max; - bool_t no_trunc; - bool_t chown_restricted; - bool_t case_insensitive; - bool_t case_preserving; + post_op_attr obj_attributes; + uint32 linkmax; + uint32 name_max; + bool_t no_trunc; + bool_t chown_restricted; + bool_t case_insensitive; + bool_t case_preserving; }; typedef struct PATHCONF3resok PATHCONF3resok; struct PATHCONF3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct PATHCONF3resfail PATHCONF3resfail; struct PATHCONF3res { - nfsstat3 status; - union { - PATHCONF3resok resok; - PATHCONF3resfail resfail; - } PATHCONF3res_u; + nfsstat3 status; + union { + PATHCONF3resok resok; + PATHCONF3resfail resfail; + } PATHCONF3res_u; }; typedef struct PATHCONF3res PATHCONF3res; struct COMMIT3args { - nfs_fh3 file; - offset3 offset; - count3 count; + nfs_fh3 file; + offset3 offset; + count3 count; }; typedef struct COMMIT3args COMMIT3args; struct COMMIT3resok { - wcc_data file_wcc; - writeverf3 verf; + wcc_data file_wcc; + writeverf3 verf; }; typedef struct COMMIT3resok COMMIT3resok; struct COMMIT3resfail { - wcc_data file_wcc; + wcc_data file_wcc; }; typedef struct COMMIT3resfail COMMIT3resfail; struct COMMIT3res { - nfsstat3 status; - union { - COMMIT3resok resok; - COMMIT3resfail resfail; - } COMMIT3res_u; + nfsstat3 status; + union { + COMMIT3resok resok; + COMMIT3resfail resfail; + } COMMIT3res_u; }; typedef struct COMMIT3res COMMIT3res; -#define NFS_PROGRAM 100003 -#define NFS_V3 3 +#define NFS_PROGRAM 100003 +#define NFS_V3 3 -#define NFSPROC3_NULL 0 +#define NFSPROC3_NULL 0 extern enum clnt_stat nfsproc3_null_3(void *, CLIENT *); -#define NFSPROC3_GETATTR 1 +#define NFSPROC3_GETATTR 1 extern enum clnt_stat nfsproc3_getattr_3(GETATTR3args , GETATTR3res *, CLIENT *); -#define NFSPROC3_SETATTR 2 +#define NFSPROC3_SETATTR 2 extern enum clnt_stat nfsproc3_setattr_3(SETATTR3args , SETATTR3res *, CLIENT *); -#define NFSPROC3_LOOKUP 3 +#define NFSPROC3_LOOKUP 3 extern enum clnt_stat nfsproc3_lookup_3(LOOKUP3args , LOOKUP3res *, CLIENT *); -#define NFSPROC3_ACCESS 4 +#define NFSPROC3_ACCESS 4 extern enum clnt_stat nfsproc3_access_3(ACCESS3args , ACCESS3res *, CLIENT *); -#define NFSPROC3_READLINK 5 +#define NFSPROC3_READLINK 5 extern enum clnt_stat nfsproc3_readlink_3(READLINK3args , READLINK3res *, CLIENT *); -#define NFSPROC3_READ 6 +#define NFSPROC3_READ 6 extern enum clnt_stat nfsproc3_read_3(READ3args , READ3res *, CLIENT *); -#define NFSPROC3_WRITE 7 +#define NFSPROC3_WRITE 7 extern enum clnt_stat nfsproc3_write_3(WRITE3args , WRITE3res *, CLIENT *); -#define NFSPROC3_CREATE 8 +#define NFSPROC3_CREATE 8 extern enum clnt_stat nfsproc3_create_3(CREATE3args , CREATE3res *, CLIENT *); -#define NFSPROC3_MKDIR 9 +#define NFSPROC3_MKDIR 9 extern enum clnt_stat nfsproc3_mkdir_3(MKDIR3args , MKDIR3res *, CLIENT *); -#define NFSPROC3_SYMLINK 10 +#define NFSPROC3_SYMLINK 10 extern enum clnt_stat nfsproc3_symlink_3(SYMLINK3args , SYMLINK3res *, CLIENT *); -#define NFSPROC3_MKNOD 11 +#define NFSPROC3_MKNOD 11 extern enum clnt_stat nfsproc3_mknod_3(MKNOD3args , MKNOD3res *, CLIENT *); -#define NFSPROC3_REMOVE 12 +#define NFSPROC3_REMOVE 12 extern enum clnt_stat nfsproc3_remove_3(REMOVE3args , REMOVE3res *, CLIENT *); -#define NFSPROC3_RMDIR 13 +#define NFSPROC3_RMDIR 13 extern enum clnt_stat nfsproc3_rmdir_3(RMDIR3args , RMDIR3res *, CLIENT *); -#define NFSPROC3_RENAME 14 +#define NFSPROC3_RENAME 14 extern enum clnt_stat nfsproc3_rename_3(RENAME3args , RENAME3res *, CLIENT *); -#define NFSPROC3_LINK 15 +#define NFSPROC3_LINK 15 extern enum clnt_stat nfsproc3_link_3(LINK3args , LINK3res *, CLIENT *); -#define NFSPROC3_READDIR 16 +#define NFSPROC3_READDIR 16 extern enum clnt_stat nfsproc3_readdir_3(READDIR3args , READDIR3res *, CLIENT *); -#define NFSPROC3_READDIRPLUS 17 +#define NFSPROC3_READDIRPLUS 17 extern enum clnt_stat nfsproc3_readdirplus_3(READDIRPLUS3args , READDIRPLUS3res *, CLIENT *); -#define NFSPROC3_FSSTAT 18 +#define NFSPROC3_FSSTAT 18 extern enum clnt_stat nfsproc3_fsstat_3(FSSTAT3args , FSSTAT3res *, CLIENT *); -#define NFSPROC3_FSINFO 19 +#define NFSPROC3_FSINFO 19 extern enum clnt_stat nfsproc3_fsinfo_3(FSINFO3args , FSINFO3res *, CLIENT *); -#define NFSPROC3_PATHCONF 20 +#define NFSPROC3_PATHCONF 20 extern enum clnt_stat nfsproc3_pathconf_3(PATHCONF3args , PATHCONF3res *, CLIENT *); -#define NFSPROC3_COMMIT 21 +#define NFSPROC3_COMMIT 21 extern enum clnt_stat nfsproc3_commit_3(COMMIT3args , COMMIT3res *, CLIENT *); /* the xdr functions */ diff --git a/components/dfs/filesystems/nfs/nfs_auth.c b/components/dfs/filesystems/nfs/nfs_auth.c index c65a1126a6..4b6be8d498 100644 --- a/components/dfs/filesystems/nfs/nfs_auth.c +++ b/components/dfs/filesystems/nfs/nfs_auth.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/nfs/nfs_clnt.c b/components/dfs/filesystems/nfs/nfs_clnt.c index c17fee9e80..b50cf7ff1d 100644 --- a/components/dfs/filesystems/nfs/nfs_clnt.c +++ b/components/dfs/filesystems/nfs/nfs_clnt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -23,200 +23,200 @@ typedef char* caddr_t; /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = { 25, 0 }; -enum clnt_stat +enum clnt_stat nfsproc3_null_3(void *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_NULL, - (xdrproc_t) xdr_void, (caddr_t) NULL, - (xdrproc_t) xdr_void, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_NULL, + (xdrproc_t) xdr_void, (caddr_t) NULL, + (xdrproc_t) xdr_void, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_getattr_3(GETATTR3args arg1, GETATTR3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_GETATTR, - (xdrproc_t) xdr_GETATTR3args, (caddr_t) &arg1, - (xdrproc_t) xdr_GETATTR3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_GETATTR, + (xdrproc_t) xdr_GETATTR3args, (caddr_t) &arg1, + (xdrproc_t) xdr_GETATTR3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_setattr_3(SETATTR3args arg1, SETATTR3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_SETATTR, - (xdrproc_t) xdr_SETATTR3args, (caddr_t) &arg1, - (xdrproc_t) xdr_SETATTR3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_SETATTR, + (xdrproc_t) xdr_SETATTR3args, (caddr_t) &arg1, + (xdrproc_t) xdr_SETATTR3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_lookup_3(LOOKUP3args arg1, LOOKUP3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_LOOKUP, - (xdrproc_t) xdr_LOOKUP3args, (caddr_t) &arg1, - (xdrproc_t) xdr_LOOKUP3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_LOOKUP, + (xdrproc_t) xdr_LOOKUP3args, (caddr_t) &arg1, + (xdrproc_t) xdr_LOOKUP3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_access_3(ACCESS3args arg1, ACCESS3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_ACCESS, - (xdrproc_t) xdr_ACCESS3args, (caddr_t) &arg1, - (xdrproc_t) xdr_ACCESS3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_ACCESS, + (xdrproc_t) xdr_ACCESS3args, (caddr_t) &arg1, + (xdrproc_t) xdr_ACCESS3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_readlink_3(READLINK3args arg1, READLINK3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_READLINK, - (xdrproc_t) xdr_READLINK3args, (caddr_t) &arg1, - (xdrproc_t) xdr_READLINK3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_READLINK, + (xdrproc_t) xdr_READLINK3args, (caddr_t) &arg1, + (xdrproc_t) xdr_READLINK3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_read_3(READ3args arg1, READ3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_READ, - (xdrproc_t) xdr_READ3args, (caddr_t) &arg1, - (xdrproc_t) xdr_READ3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_READ, + (xdrproc_t) xdr_READ3args, (caddr_t) &arg1, + (xdrproc_t) xdr_READ3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_write_3(WRITE3args arg1, WRITE3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_WRITE, - (xdrproc_t) xdr_WRITE3args, (caddr_t) &arg1, - (xdrproc_t) xdr_WRITE3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_WRITE, + (xdrproc_t) xdr_WRITE3args, (caddr_t) &arg1, + (xdrproc_t) xdr_WRITE3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_create_3(CREATE3args arg1, CREATE3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_CREATE, - (xdrproc_t) xdr_CREATE3args, (caddr_t) &arg1, - (xdrproc_t) xdr_CREATE3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_CREATE, + (xdrproc_t) xdr_CREATE3args, (caddr_t) &arg1, + (xdrproc_t) xdr_CREATE3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_mkdir_3(MKDIR3args arg1, MKDIR3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_MKDIR, - (xdrproc_t) xdr_MKDIR3args, (caddr_t) &arg1, - (xdrproc_t) xdr_MKDIR3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_MKDIR, + (xdrproc_t) xdr_MKDIR3args, (caddr_t) &arg1, + (xdrproc_t) xdr_MKDIR3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_symlink_3(SYMLINK3args arg1, SYMLINK3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_SYMLINK, - (xdrproc_t) xdr_SYMLINK3args, (caddr_t) &arg1, - (xdrproc_t) xdr_SYMLINK3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_SYMLINK, + (xdrproc_t) xdr_SYMLINK3args, (caddr_t) &arg1, + (xdrproc_t) xdr_SYMLINK3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_mknod_3(MKNOD3args arg1, MKNOD3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_MKNOD, - (xdrproc_t) xdr_MKNOD3args, (caddr_t) &arg1, - (xdrproc_t) xdr_MKNOD3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_MKNOD, + (xdrproc_t) xdr_MKNOD3args, (caddr_t) &arg1, + (xdrproc_t) xdr_MKNOD3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_remove_3(REMOVE3args arg1, REMOVE3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_REMOVE, - (xdrproc_t) xdr_REMOVE3args, (caddr_t) &arg1, - (xdrproc_t) xdr_REMOVE3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_REMOVE, + (xdrproc_t) xdr_REMOVE3args, (caddr_t) &arg1, + (xdrproc_t) xdr_REMOVE3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_rmdir_3(RMDIR3args arg1, RMDIR3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_RMDIR, - (xdrproc_t) xdr_RMDIR3args, (caddr_t) &arg1, - (xdrproc_t) xdr_RMDIR3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_RMDIR, + (xdrproc_t) xdr_RMDIR3args, (caddr_t) &arg1, + (xdrproc_t) xdr_RMDIR3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_rename_3(RENAME3args arg1, RENAME3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_RENAME, - (xdrproc_t) xdr_RENAME3args, (caddr_t) &arg1, - (xdrproc_t) xdr_RENAME3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_RENAME, + (xdrproc_t) xdr_RENAME3args, (caddr_t) &arg1, + (xdrproc_t) xdr_RENAME3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_link_3(LINK3args arg1, LINK3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_LINK, - (xdrproc_t) xdr_LINK3args, (caddr_t) &arg1, - (xdrproc_t) xdr_LINK3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_LINK, + (xdrproc_t) xdr_LINK3args, (caddr_t) &arg1, + (xdrproc_t) xdr_LINK3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_readdir_3(READDIR3args arg1, READDIR3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_READDIR, - (xdrproc_t) xdr_READDIR3args, (caddr_t) &arg1, - (xdrproc_t) xdr_READDIR3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_READDIR, + (xdrproc_t) xdr_READDIR3args, (caddr_t) &arg1, + (xdrproc_t) xdr_READDIR3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_readdirplus_3(READDIRPLUS3args arg1, READDIRPLUS3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_READDIRPLUS, - (xdrproc_t) xdr_READDIRPLUS3args, (caddr_t) &arg1, - (xdrproc_t) xdr_READDIRPLUS3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_READDIRPLUS, + (xdrproc_t) xdr_READDIRPLUS3args, (caddr_t) &arg1, + (xdrproc_t) xdr_READDIRPLUS3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_fsstat_3(FSSTAT3args arg1, FSSTAT3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_FSSTAT, - (xdrproc_t) xdr_FSSTAT3args, (caddr_t) &arg1, - (xdrproc_t) xdr_FSSTAT3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_FSSTAT, + (xdrproc_t) xdr_FSSTAT3args, (caddr_t) &arg1, + (xdrproc_t) xdr_FSSTAT3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_fsinfo_3(FSINFO3args arg1, FSINFO3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_FSINFO, - (xdrproc_t) xdr_FSINFO3args, (caddr_t) &arg1, - (xdrproc_t) xdr_FSINFO3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_FSINFO, + (xdrproc_t) xdr_FSINFO3args, (caddr_t) &arg1, + (xdrproc_t) xdr_FSINFO3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_pathconf_3(PATHCONF3args arg1, PATHCONF3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_PATHCONF, - (xdrproc_t) xdr_PATHCONF3args, (caddr_t) &arg1, - (xdrproc_t) xdr_PATHCONF3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_PATHCONF, + (xdrproc_t) xdr_PATHCONF3args, (caddr_t) &arg1, + (xdrproc_t) xdr_PATHCONF3res, (caddr_t) clnt_res, + TIMEOUT)); } -enum clnt_stat +enum clnt_stat nfsproc3_commit_3(COMMIT3args arg1, COMMIT3res *clnt_res, CLIENT *clnt) { - return (clnt_call(clnt, NFSPROC3_COMMIT, - (xdrproc_t) xdr_COMMIT3args, (caddr_t) &arg1, - (xdrproc_t) xdr_COMMIT3res, (caddr_t) clnt_res, - TIMEOUT)); + return (clnt_call(clnt, NFSPROC3_COMMIT, + (xdrproc_t) xdr_COMMIT3args, (caddr_t) &arg1, + (xdrproc_t) xdr_COMMIT3res, (caddr_t) clnt_res, + TIMEOUT)); } diff --git a/components/dfs/filesystems/nfs/nfs_xdr.c b/components/dfs/filesystems/nfs/nfs_xdr.c index 33563976c3..2662a17df6 100644 --- a/components/dfs/filesystems/nfs/nfs_xdr.c +++ b/components/dfs/filesystems/nfs/nfs_xdr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,1604 +19,1604 @@ bool_t xdr_uint64(register XDR *xdrs, uint64 *objp) { - if (!xdr_u_longlong_t(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_u_longlong_t(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_int64(register XDR *xdrs, int64 *objp) { - if (!xdr_longlong_t(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_longlong_t(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_uint32(register XDR *xdrs, uint32 *objp) { - if (!xdr_u_long(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_u_long(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_int32(register XDR *xdrs, int32 *objp) { - if (!xdr_long(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_long(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_filename3(register XDR *xdrs, filename3 *objp) { - if (!xdr_string(xdrs, objp, ~0)) - return (FALSE); - return (TRUE); + if (!xdr_string(xdrs, objp, ~0)) + return (FALSE); + return (TRUE); } bool_t xdr_nfspath3(register XDR *xdrs, nfspath3 *objp) { - if (!xdr_string(xdrs, objp, ~0)) - return (FALSE); - return (TRUE); + if (!xdr_string(xdrs, objp, ~0)) + return (FALSE); + return (TRUE); } bool_t xdr_fileid3(register XDR *xdrs, fileid3 *objp) { - if (!xdr_uint64(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint64(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_cookie3(register XDR *xdrs, cookie3 *objp) { - if (!xdr_uint64(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint64(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_cookieverf3(register XDR *xdrs, cookieverf3 objp) { - if (!xdr_opaque(xdrs, objp, NFS3_COOKIEVERFSIZE)) - return (FALSE); - return (TRUE); + if (!xdr_opaque(xdrs, objp, NFS3_COOKIEVERFSIZE)) + return (FALSE); + return (TRUE); } bool_t xdr_createverf3(register XDR *xdrs, createverf3 objp) { - if (!xdr_opaque(xdrs, objp, NFS3_CREATEVERFSIZE)) - return (FALSE); - return (TRUE); + if (!xdr_opaque(xdrs, objp, NFS3_CREATEVERFSIZE)) + return (FALSE); + return (TRUE); } bool_t xdr_writeverf3(register XDR *xdrs, writeverf3 objp) { - if (!xdr_opaque(xdrs, objp, NFS3_WRITEVERFSIZE)) - return (FALSE); - return (TRUE); + if (!xdr_opaque(xdrs, objp, NFS3_WRITEVERFSIZE)) + return (FALSE); + return (TRUE); } bool_t xdr_uid3(register XDR *xdrs, uid3 *objp) { - if (!xdr_uint32(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint32(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_gid3(register XDR *xdrs, gid3 *objp) { - if (!xdr_uint32(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint32(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_size3(register XDR *xdrs, size3 *objp) { - if (!xdr_uint64(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint64(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_offset3(register XDR *xdrs, offset3 *objp) { - if (!xdr_uint64(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint64(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_mode3(register XDR *xdrs, mode3 *objp) { - if (!xdr_uint32(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint32(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_count3(register XDR *xdrs, count3 *objp) { - if (!xdr_uint32(xdrs, objp)) - return (FALSE); - return (TRUE); + if (!xdr_uint32(xdrs, objp)) + return (FALSE); + return (TRUE); } bool_t xdr_nfsstat3(register XDR *xdrs, nfsstat3 *objp) { - int enum_objp; - enum_objp = *objp; - if (!xdr_enum(xdrs, (enum_t *)objp)) - { - *objp = (nfsstat3)enum_objp; - return (FALSE); - } + int enum_objp; + enum_objp = *objp; + if (!xdr_enum(xdrs, (enum_t *)objp)) + { + *objp = (nfsstat3)enum_objp; + return (FALSE); + } - return (TRUE); + return (TRUE); } bool_t xdr_ftype3(register XDR *xdrs, ftype3 *objp) { - int enum_objp; - enum_objp = *objp; - if (!xdr_enum(xdrs, (enum_t *)objp)) - { - *objp = (ftype3)enum_objp; - return (FALSE); - } - - return (TRUE); + int enum_objp; + enum_objp = *objp; + if (!xdr_enum(xdrs, (enum_t *)objp)) + { + *objp = (ftype3)enum_objp; + return (FALSE); + } + + return (TRUE); } bool_t xdr_stable_how(register XDR *xdrs, stable_how *objp) { - int enum_objp; - enum_objp = *objp; - if (!xdr_enum(xdrs, (enum_t *)objp)) - { - *objp = (stable_how)enum_objp; - return (FALSE); - } - - return (TRUE); + int enum_objp; + enum_objp = *objp; + if (!xdr_enum(xdrs, (enum_t *)objp)) + { + *objp = (stable_how)enum_objp; + return (FALSE); + } + + return (TRUE); } bool_t xdr_createmode3(register XDR *xdrs, createmode3 *objp) { - int enum_objp; - enum_objp = *objp; - if (!xdr_enum(xdrs, (enum_t *)objp)) - { - *objp = (createmode3)enum_objp; - return (FALSE); - } - - return (TRUE); + int enum_objp; + enum_objp = *objp; + if (!xdr_enum(xdrs, (enum_t *)objp)) + { + *objp = (createmode3)enum_objp; + return (FALSE); + } + + return (TRUE); } bool_t xdr_specdata3(register XDR *xdrs, specdata3 *objp) { - if (!xdr_uint32(xdrs, &objp->specdata1)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->specdata2)) - return (FALSE); - return (TRUE); + if (!xdr_uint32(xdrs, &objp->specdata1)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->specdata2)) + return (FALSE); + return (TRUE); } bool_t xdr_nfs_fh3(register XDR *xdrs, nfs_fh3 *objp) { - if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (unsigned int *) &objp->data.data_len, NFS3_FHSIZE)) - return (FALSE); - return (TRUE); + if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (unsigned int *) &objp->data.data_len, NFS3_FHSIZE)) + return (FALSE); + return (TRUE); } bool_t xdr_nfstime3(register XDR *xdrs, nfstime3 *objp) { - if (!xdr_uint32(xdrs, &objp->seconds)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->nseconds)) - return (FALSE); - return (TRUE); + if (!xdr_uint32(xdrs, &objp->seconds)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->nseconds)) + return (FALSE); + return (TRUE); } bool_t xdr_fattr3(register XDR *xdrs, fattr3 *objp) { - if (!xdr_ftype3(xdrs, &objp->type)) - return (FALSE); - if (!xdr_mode3(xdrs, &objp->mode)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->nlink)) - return (FALSE); - if (!xdr_uid3(xdrs, &objp->uid)) - return (FALSE); - if (!xdr_gid3(xdrs, &objp->gid)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->size)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->used)) - return (FALSE); - if (!xdr_specdata3(xdrs, &objp->rdev)) - return (FALSE); - if (!xdr_uint64(xdrs, &objp->fsid)) - return (FALSE); - if (!xdr_fileid3(xdrs, &objp->fileid)) - return (FALSE); - if (!xdr_nfstime3(xdrs, &objp->atime)) - return (FALSE); - if (!xdr_nfstime3(xdrs, &objp->mtime)) - return (FALSE); - if (!xdr_nfstime3(xdrs, &objp->ctime)) - return (FALSE); - return (TRUE); + if (!xdr_ftype3(xdrs, &objp->type)) + return (FALSE); + if (!xdr_mode3(xdrs, &objp->mode)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->nlink)) + return (FALSE); + if (!xdr_uid3(xdrs, &objp->uid)) + return (FALSE); + if (!xdr_gid3(xdrs, &objp->gid)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->size)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->used)) + return (FALSE); + if (!xdr_specdata3(xdrs, &objp->rdev)) + return (FALSE); + if (!xdr_uint64(xdrs, &objp->fsid)) + return (FALSE); + if (!xdr_fileid3(xdrs, &objp->fileid)) + return (FALSE); + if (!xdr_nfstime3(xdrs, &objp->atime)) + return (FALSE); + if (!xdr_nfstime3(xdrs, &objp->mtime)) + return (FALSE); + if (!xdr_nfstime3(xdrs, &objp->ctime)) + return (FALSE); + return (TRUE); } bool_t xdr_post_op_attr(register XDR *xdrs, post_op_attr *objp) { - if (!xdr_bool(xdrs, &objp->attributes_follow)) - return (FALSE); - switch (objp->attributes_follow) { - case TRUE: - if (!xdr_fattr3(xdrs, &objp->post_op_attr_u.attributes)) - return (FALSE); - break; - case FALSE: - break; - default: - return (FALSE); - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->attributes_follow)) + return (FALSE); + switch (objp->attributes_follow) { + case TRUE: + if (!xdr_fattr3(xdrs, &objp->post_op_attr_u.attributes)) + return (FALSE); + break; + case FALSE: + break; + default: + return (FALSE); + } + return (TRUE); } bool_t xdr_wcc_attr(register XDR *xdrs, wcc_attr *objp) { - if (!xdr_size3(xdrs, &objp->size)) - return (FALSE); - if (!xdr_nfstime3(xdrs, &objp->mtime)) - return (FALSE); - if (!xdr_nfstime3(xdrs, &objp->ctime)) - return (FALSE); - return (TRUE); + if (!xdr_size3(xdrs, &objp->size)) + return (FALSE); + if (!xdr_nfstime3(xdrs, &objp->mtime)) + return (FALSE); + if (!xdr_nfstime3(xdrs, &objp->ctime)) + return (FALSE); + return (TRUE); } bool_t xdr_pre_op_attr(register XDR *xdrs, pre_op_attr *objp) { - if (!xdr_bool(xdrs, &objp->attributes_follow)) - return (FALSE); - switch (objp->attributes_follow) { - case TRUE: - if (!xdr_wcc_attr(xdrs, &objp->pre_op_attr_u.attributes)) - return (FALSE); - break; - case FALSE: - break; - default: - return (FALSE); - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->attributes_follow)) + return (FALSE); + switch (objp->attributes_follow) { + case TRUE: + if (!xdr_wcc_attr(xdrs, &objp->pre_op_attr_u.attributes)) + return (FALSE); + break; + case FALSE: + break; + default: + return (FALSE); + } + return (TRUE); } bool_t xdr_wcc_data(register XDR *xdrs, wcc_data *objp) { - if (!xdr_pre_op_attr(xdrs, &objp->before)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->after)) - return (FALSE); - return (TRUE); + if (!xdr_pre_op_attr(xdrs, &objp->before)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->after)) + return (FALSE); + return (TRUE); } bool_t xdr_post_op_fh3(register XDR *xdrs, post_op_fh3 *objp) { - if (!xdr_bool(xdrs, &objp->handle_follows)) - return (FALSE); - switch (objp->handle_follows) { - case TRUE: - if (!xdr_nfs_fh3(xdrs, &objp->post_op_fh3_u.handle)) - return (FALSE); - break; - case FALSE: - break; - default: - return (FALSE); - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->handle_follows)) + return (FALSE); + switch (objp->handle_follows) { + case TRUE: + if (!xdr_nfs_fh3(xdrs, &objp->post_op_fh3_u.handle)) + return (FALSE); + break; + case FALSE: + break; + default: + return (FALSE); + } + return (TRUE); } bool_t xdr_time_how(register XDR *xdrs, time_how *objp) { - int enum_objp; - enum_objp = *objp; - if (!xdr_enum(xdrs, (enum_t *)objp)) - { - *objp = (time_how)enum_objp; - return (FALSE); - } - - return (TRUE); + int enum_objp; + enum_objp = *objp; + if (!xdr_enum(xdrs, (enum_t *)objp)) + { + *objp = (time_how)enum_objp; + return (FALSE); + } + + return (TRUE); } bool_t xdr_set_mode3(register XDR *xdrs, set_mode3 *objp) { - if (!xdr_bool(xdrs, &objp->set_it)) - return (FALSE); - switch (objp->set_it) { - case TRUE: - if (!xdr_mode3(xdrs, &objp->set_mode3_u.mode)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->set_it)) + return (FALSE); + switch (objp->set_it) { + case TRUE: + if (!xdr_mode3(xdrs, &objp->set_mode3_u.mode)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_set_uid3(register XDR *xdrs, set_uid3 *objp) { - if (!xdr_bool(xdrs, &objp->set_it)) - return (FALSE); - switch (objp->set_it) { - case TRUE: - if (!xdr_uid3(xdrs, &objp->set_uid3_u.uid)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->set_it)) + return (FALSE); + switch (objp->set_it) { + case TRUE: + if (!xdr_uid3(xdrs, &objp->set_uid3_u.uid)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_set_gid3(register XDR *xdrs, set_gid3 *objp) { - if (!xdr_bool(xdrs, &objp->set_it)) - return (FALSE); - switch (objp->set_it) { - case TRUE: - if (!xdr_gid3(xdrs, &objp->set_gid3_u.gid)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->set_it)) + return (FALSE); + switch (objp->set_it) { + case TRUE: + if (!xdr_gid3(xdrs, &objp->set_gid3_u.gid)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_set_size3(register XDR *xdrs, set_size3 *objp) { - if (!xdr_bool(xdrs, &objp->set_it)) - return (FALSE); - switch (objp->set_it) { - case TRUE: - if (!xdr_size3(xdrs, &objp->set_size3_u.size)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->set_it)) + return (FALSE); + switch (objp->set_it) { + case TRUE: + if (!xdr_size3(xdrs, &objp->set_size3_u.size)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_set_atime(register XDR *xdrs, set_atime *objp) { - if (!xdr_time_how(xdrs, &objp->set_it)) - return (FALSE); - switch (objp->set_it) { - case SET_TO_CLIENT_TIME: - if (!xdr_nfstime3(xdrs, &objp->set_atime_u.atime)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_time_how(xdrs, &objp->set_it)) + return (FALSE); + switch (objp->set_it) { + case SET_TO_CLIENT_TIME: + if (!xdr_nfstime3(xdrs, &objp->set_atime_u.atime)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_set_mtime(register XDR *xdrs, set_mtime *objp) { - if (!xdr_time_how(xdrs, &objp->set_it)) - return (FALSE); - switch (objp->set_it) { - case SET_TO_CLIENT_TIME: - if (!xdr_nfstime3(xdrs, &objp->set_mtime_u.mtime)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_time_how(xdrs, &objp->set_it)) + return (FALSE); + switch (objp->set_it) { + case SET_TO_CLIENT_TIME: + if (!xdr_nfstime3(xdrs, &objp->set_mtime_u.mtime)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_sattr3(register XDR *xdrs, sattr3 *objp) { - if (!xdr_set_mode3(xdrs, &objp->mode)) - return (FALSE); - if (!xdr_set_uid3(xdrs, &objp->uid)) - return (FALSE); - if (!xdr_set_gid3(xdrs, &objp->gid)) - return (FALSE); - if (!xdr_set_size3(xdrs, &objp->size)) - return (FALSE); - if (!xdr_set_atime(xdrs, &objp->atime)) - return (FALSE); - if (!xdr_set_mtime(xdrs, &objp->mtime)) - return (FALSE); - return (TRUE); + if (!xdr_set_mode3(xdrs, &objp->mode)) + return (FALSE); + if (!xdr_set_uid3(xdrs, &objp->uid)) + return (FALSE); + if (!xdr_set_gid3(xdrs, &objp->gid)) + return (FALSE); + if (!xdr_set_size3(xdrs, &objp->size)) + return (FALSE); + if (!xdr_set_atime(xdrs, &objp->atime)) + return (FALSE); + if (!xdr_set_mtime(xdrs, &objp->mtime)) + return (FALSE); + return (TRUE); } bool_t xdr_diropargs3(register XDR *xdrs, diropargs3 *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->dir)) - return (FALSE); - if (!xdr_filename3(xdrs, &objp->name)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->dir)) + return (FALSE); + if (!xdr_filename3(xdrs, &objp->name)) + return (FALSE); + return (TRUE); } bool_t xdr_GETATTR3args(register XDR *xdrs, GETATTR3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->object)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->object)) + return (FALSE); + return (TRUE); } bool_t xdr_GETATTR3resok(register XDR *xdrs, GETATTR3resok *objp) { - if (!xdr_fattr3(xdrs, &objp->obj_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_fattr3(xdrs, &objp->obj_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_GETATTR3res(register XDR *xdrs, GETATTR3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_GETATTR3resok(xdrs, &objp->GETATTR3res_u.resok)) - return (FALSE); - break; - default : - return (FALSE); - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_GETATTR3resok(xdrs, &objp->GETATTR3res_u.resok)) + return (FALSE); + break; + default : + return (FALSE); + } + return (TRUE); } bool_t xdr_sattrguard3(register XDR *xdrs, sattrguard3 *objp) { - if (!xdr_bool(xdrs, &objp->check)) - return (FALSE); - switch (objp->check) { - case TRUE: - if (!xdr_nfstime3(xdrs, &objp->sattrguard3_u.obj_ctime)) - return (FALSE); - break; - case FALSE: - break; - default: - return (FALSE); - } - return (TRUE); + if (!xdr_bool(xdrs, &objp->check)) + return (FALSE); + switch (objp->check) { + case TRUE: + if (!xdr_nfstime3(xdrs, &objp->sattrguard3_u.obj_ctime)) + return (FALSE); + break; + case FALSE: + break; + default: + return (FALSE); + } + return (TRUE); } bool_t xdr_SETATTR3args(register XDR *xdrs, SETATTR3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->object)) - return (FALSE); - if (!xdr_sattr3(xdrs, &objp->new_attributes)) - return (FALSE); - if (!xdr_sattrguard3(xdrs, &objp->guard)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->object)) + return (FALSE); + if (!xdr_sattr3(xdrs, &objp->new_attributes)) + return (FALSE); + if (!xdr_sattrguard3(xdrs, &objp->guard)) + return (FALSE); + return (TRUE); } bool_t xdr_SETATTR3resok(register XDR *xdrs, SETATTR3resok *objp) { - if (!xdr_wcc_data(xdrs, &objp->obj_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->obj_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_SETATTR3resfail(register XDR *xdrs, SETATTR3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->obj_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->obj_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_SETATTR3res(register XDR *xdrs, SETATTR3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_SETATTR3resok(xdrs, &objp->SETATTR3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_SETATTR3resfail(xdrs, &objp->SETATTR3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_SETATTR3resok(xdrs, &objp->SETATTR3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_SETATTR3resfail(xdrs, &objp->SETATTR3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_LOOKUP3args(register XDR *xdrs, LOOKUP3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->what)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->what)) + return (FALSE); + return (TRUE); } bool_t xdr_LOOKUP3resok(register XDR *xdrs, LOOKUP3resok *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->object)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->object)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_LOOKUP3resfail(register XDR *xdrs, LOOKUP3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_LOOKUP3res(register XDR *xdrs, LOOKUP3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_LOOKUP3resok(xdrs, &objp->LOOKUP3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_LOOKUP3resfail(xdrs, &objp->LOOKUP3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_LOOKUP3resok(xdrs, &objp->LOOKUP3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_LOOKUP3resfail(xdrs, &objp->LOOKUP3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_ACCESS3args(register XDR *xdrs, ACCESS3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->object)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->access)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->object)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->access)) + return (FALSE); + return (TRUE); } bool_t xdr_ACCESS3resok(register XDR *xdrs, ACCESS3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->access)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->access)) + return (FALSE); + return (TRUE); } bool_t xdr_ACCESS3resfail(register XDR *xdrs, ACCESS3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_ACCESS3res(register XDR *xdrs, ACCESS3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_ACCESS3resok(xdrs, &objp->ACCESS3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_ACCESS3resfail(xdrs, &objp->ACCESS3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_ACCESS3resok(xdrs, &objp->ACCESS3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_ACCESS3resfail(xdrs, &objp->ACCESS3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_READLINK3args(register XDR *xdrs, READLINK3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->symlink)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->symlink)) + return (FALSE); + return (TRUE); } bool_t xdr_READLINK3resok(register XDR *xdrs, READLINK3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->symlink_attributes)) - return (FALSE); - if (!xdr_nfspath3(xdrs, &objp->data)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->symlink_attributes)) + return (FALSE); + if (!xdr_nfspath3(xdrs, &objp->data)) + return (FALSE); + return (TRUE); } bool_t xdr_READLINK3resfail(register XDR *xdrs, READLINK3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->symlink_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->symlink_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_READLINK3res(register XDR *xdrs, READLINK3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_READLINK3resok(xdrs, &objp->READLINK3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_READLINK3resfail(xdrs, &objp->READLINK3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_READLINK3resok(xdrs, &objp->READLINK3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_READLINK3resfail(xdrs, &objp->READLINK3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_READ3args(register XDR *xdrs, READ3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->file)) - return (FALSE); - if (!xdr_offset3(xdrs, &objp->offset)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->count)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->file)) + return (FALSE); + if (!xdr_offset3(xdrs, &objp->offset)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->count)) + return (FALSE); + return (TRUE); } bool_t xdr_READ3resok(register XDR *xdrs, READ3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->count)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->eof)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (unsigned int *) &objp->data.data_len, ~0)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->count)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->eof)) + return (FALSE); + if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (unsigned int *) &objp->data.data_len, ~0)) + return (FALSE); + return (TRUE); } bool_t xdr_READ3resfail(register XDR *xdrs, READ3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_READ3res(register XDR *xdrs, READ3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_READ3resok(xdrs, &objp->READ3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_READ3resfail(xdrs, &objp->READ3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_READ3resok(xdrs, &objp->READ3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_READ3resfail(xdrs, &objp->READ3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_WRITE3args(register XDR *xdrs, WRITE3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->file)) - return (FALSE); - if (!xdr_offset3(xdrs, &objp->offset)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->count)) - return (FALSE); - if (!xdr_stable_how(xdrs, &objp->stable)) - return (FALSE); - if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (unsigned int *) &objp->data.data_len, ~0)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->file)) + return (FALSE); + if (!xdr_offset3(xdrs, &objp->offset)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->count)) + return (FALSE); + if (!xdr_stable_how(xdrs, &objp->stable)) + return (FALSE); + if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (unsigned int *) &objp->data.data_len, ~0)) + return (FALSE); + return (TRUE); } bool_t xdr_WRITE3resok(register XDR *xdrs, WRITE3resok *objp) { - if (!xdr_wcc_data(xdrs, &objp->file_wcc)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->count)) - return (FALSE); - if (!xdr_stable_how(xdrs, &objp->committed)) - return (FALSE); - if (!xdr_writeverf3(xdrs, objp->verf)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->file_wcc)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->count)) + return (FALSE); + if (!xdr_stable_how(xdrs, &objp->committed)) + return (FALSE); + if (!xdr_writeverf3(xdrs, objp->verf)) + return (FALSE); + return (TRUE); } bool_t xdr_WRITE3resfail(register XDR *xdrs, WRITE3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->file_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->file_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_WRITE3res(register XDR *xdrs, WRITE3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_WRITE3resok(xdrs, &objp->WRITE3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_WRITE3resfail(xdrs, &objp->WRITE3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_WRITE3resok(xdrs, &objp->WRITE3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_WRITE3resfail(xdrs, &objp->WRITE3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_createhow3(register XDR *xdrs, createhow3 *objp) { - if (!xdr_createmode3(xdrs, &objp->mode)) - return (FALSE); - switch (objp->mode) { - case UNCHECKED: - case GUARDED: - if (!xdr_sattr3(xdrs, &objp->createhow3_u.obj_attributes)) - return (FALSE); - break; - case EXCLUSIVE: - if (!xdr_createverf3(xdrs, objp->createhow3_u.verf)) - return (FALSE); - break; - default: - return (FALSE); - } - return (TRUE); + if (!xdr_createmode3(xdrs, &objp->mode)) + return (FALSE); + switch (objp->mode) { + case UNCHECKED: + case GUARDED: + if (!xdr_sattr3(xdrs, &objp->createhow3_u.obj_attributes)) + return (FALSE); + break; + case EXCLUSIVE: + if (!xdr_createverf3(xdrs, objp->createhow3_u.verf)) + return (FALSE); + break; + default: + return (FALSE); + } + return (TRUE); } bool_t xdr_CREATE3args(register XDR *xdrs, CREATE3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->where)) - return (FALSE); - if (!xdr_createhow3(xdrs, &objp->how)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->where)) + return (FALSE); + if (!xdr_createhow3(xdrs, &objp->how)) + return (FALSE); + return (TRUE); } bool_t xdr_CREATE3resok(register XDR *xdrs, CREATE3resok *objp) { - if (!xdr_post_op_fh3(xdrs, &objp->obj)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_fh3(xdrs, &objp->obj)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_CREATE3resfail(register XDR *xdrs, CREATE3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_CREATE3res(register XDR *xdrs, CREATE3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_CREATE3resok(xdrs, &objp->CREATE3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_CREATE3resfail(xdrs, &objp->CREATE3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_CREATE3resok(xdrs, &objp->CREATE3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_CREATE3resfail(xdrs, &objp->CREATE3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_MKDIR3args(register XDR *xdrs, MKDIR3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->where)) - return (FALSE); - if (!xdr_sattr3(xdrs, &objp->attributes)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->where)) + return (FALSE); + if (!xdr_sattr3(xdrs, &objp->attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_MKDIR3resok(register XDR *xdrs, MKDIR3resok *objp) { - if (!xdr_post_op_fh3(xdrs, &objp->obj)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_fh3(xdrs, &objp->obj)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_MKDIR3resfail(register XDR *xdrs, MKDIR3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_MKDIR3res(register XDR *xdrs, MKDIR3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_MKDIR3resok(xdrs, &objp->MKDIR3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_MKDIR3resfail(xdrs, &objp->MKDIR3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_MKDIR3resok(xdrs, &objp->MKDIR3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_MKDIR3resfail(xdrs, &objp->MKDIR3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_symlinkdata3(register XDR *xdrs, symlinkdata3 *objp) { - if (!xdr_sattr3(xdrs, &objp->symlink_attributes)) - return (FALSE); - if (!xdr_nfspath3(xdrs, &objp->symlink_data)) - return (FALSE); - return (TRUE); + if (!xdr_sattr3(xdrs, &objp->symlink_attributes)) + return (FALSE); + if (!xdr_nfspath3(xdrs, &objp->symlink_data)) + return (FALSE); + return (TRUE); } bool_t xdr_SYMLINK3args(register XDR *xdrs, SYMLINK3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->where)) - return (FALSE); - if (!xdr_symlinkdata3(xdrs, &objp->symlink)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->where)) + return (FALSE); + if (!xdr_symlinkdata3(xdrs, &objp->symlink)) + return (FALSE); + return (TRUE); } bool_t xdr_SYMLINK3resok(register XDR *xdrs, SYMLINK3resok *objp) { - if (!xdr_post_op_fh3(xdrs, &objp->obj)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_fh3(xdrs, &objp->obj)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_SYMLINK3resfail(register XDR *xdrs, SYMLINK3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_SYMLINK3res(register XDR *xdrs, SYMLINK3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_SYMLINK3resok(xdrs, &objp->SYMLINK3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_SYMLINK3resfail(xdrs, &objp->SYMLINK3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_SYMLINK3resok(xdrs, &objp->SYMLINK3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_SYMLINK3resfail(xdrs, &objp->SYMLINK3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_devicedata3(register XDR *xdrs, devicedata3 *objp) { - if (!xdr_sattr3(xdrs, &objp->dev_attributes)) - return (FALSE); - if (!xdr_specdata3(xdrs, &objp->spec)) - return (FALSE); - return (TRUE); + if (!xdr_sattr3(xdrs, &objp->dev_attributes)) + return (FALSE); + if (!xdr_specdata3(xdrs, &objp->spec)) + return (FALSE); + return (TRUE); } bool_t xdr_mknoddata3(register XDR *xdrs, mknoddata3 *objp) { - if (!xdr_ftype3(xdrs, &objp->type)) - return (FALSE); - switch (objp->type) { - case NFS3CHR: - case NFS3BLK: - if (!xdr_devicedata3(xdrs, &objp->mknoddata3_u.device)) - return (FALSE); - break; - case NFS3SOCK: - case NFS3FIFO: - if (!xdr_sattr3(xdrs, &objp->mknoddata3_u.pipe_attributes)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_ftype3(xdrs, &objp->type)) + return (FALSE); + switch (objp->type) { + case NFS3CHR: + case NFS3BLK: + if (!xdr_devicedata3(xdrs, &objp->mknoddata3_u.device)) + return (FALSE); + break; + case NFS3SOCK: + case NFS3FIFO: + if (!xdr_sattr3(xdrs, &objp->mknoddata3_u.pipe_attributes)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_MKNOD3args(register XDR *xdrs, MKNOD3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->where)) - return (FALSE); - if (!xdr_mknoddata3(xdrs, &objp->what)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->where)) + return (FALSE); + if (!xdr_mknoddata3(xdrs, &objp->what)) + return (FALSE); + return (TRUE); } bool_t xdr_MKNOD3resok(register XDR *xdrs, MKNOD3resok *objp) { - if (!xdr_post_op_fh3(xdrs, &objp->obj)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_fh3(xdrs, &objp->obj)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_MKNOD3resfail(register XDR *xdrs, MKNOD3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_MKNOD3res(register XDR *xdrs, MKNOD3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_MKNOD3resok(xdrs, &objp->MKNOD3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_MKNOD3resfail(xdrs, &objp->MKNOD3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_MKNOD3resok(xdrs, &objp->MKNOD3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_MKNOD3resfail(xdrs, &objp->MKNOD3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_REMOVE3args(register XDR *xdrs, REMOVE3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->object)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->object)) + return (FALSE); + return (TRUE); } bool_t xdr_REMOVE3resok(register XDR *xdrs, REMOVE3resok *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_REMOVE3resfail(register XDR *xdrs, REMOVE3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_REMOVE3res(register XDR *xdrs, REMOVE3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_REMOVE3resok(xdrs, &objp->REMOVE3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_REMOVE3resfail(xdrs, &objp->REMOVE3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_REMOVE3resok(xdrs, &objp->REMOVE3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_REMOVE3resfail(xdrs, &objp->REMOVE3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_RMDIR3args(register XDR *xdrs, RMDIR3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->object)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->object)) + return (FALSE); + return (TRUE); } bool_t xdr_RMDIR3resok(register XDR *xdrs, RMDIR3resok *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_RMDIR3resfail(register XDR *xdrs, RMDIR3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->dir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_RMDIR3res(register XDR *xdrs, RMDIR3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_RMDIR3resok(xdrs, &objp->RMDIR3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_RMDIR3resfail(xdrs, &objp->RMDIR3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_RMDIR3resok(xdrs, &objp->RMDIR3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_RMDIR3resfail(xdrs, &objp->RMDIR3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_RENAME3args(register XDR *xdrs, RENAME3args *objp) { - if (!xdr_diropargs3(xdrs, &objp->from)) - return (FALSE); - if (!xdr_diropargs3(xdrs, &objp->to)) - return (FALSE); - return (TRUE); + if (!xdr_diropargs3(xdrs, &objp->from)) + return (FALSE); + if (!xdr_diropargs3(xdrs, &objp->to)) + return (FALSE); + return (TRUE); } bool_t xdr_RENAME3resok(register XDR *xdrs, RENAME3resok *objp) { - if (!xdr_wcc_data(xdrs, &objp->fromdir_wcc)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->todir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->fromdir_wcc)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->todir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_RENAME3resfail(register XDR *xdrs, RENAME3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->fromdir_wcc)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->todir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->fromdir_wcc)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->todir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_RENAME3res(register XDR *xdrs, RENAME3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_RENAME3resok(xdrs, &objp->RENAME3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_RENAME3resfail(xdrs, &objp->RENAME3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_RENAME3resok(xdrs, &objp->RENAME3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_RENAME3resfail(xdrs, &objp->RENAME3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_LINK3args(register XDR *xdrs, LINK3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->file)) - return (FALSE); - if (!xdr_diropargs3(xdrs, &objp->link)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->file)) + return (FALSE); + if (!xdr_diropargs3(xdrs, &objp->link)) + return (FALSE); + return (TRUE); } bool_t xdr_LINK3resok(register XDR *xdrs, LINK3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->linkdir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->linkdir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_LINK3resfail(register XDR *xdrs, LINK3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) - return (FALSE); - if (!xdr_wcc_data(xdrs, &objp->linkdir_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->file_attributes)) + return (FALSE); + if (!xdr_wcc_data(xdrs, &objp->linkdir_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_LINK3res(register XDR *xdrs, LINK3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_LINK3resok(xdrs, &objp->LINK3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_LINK3resfail(xdrs, &objp->LINK3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_LINK3resok(xdrs, &objp->LINK3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_LINK3resfail(xdrs, &objp->LINK3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_READDIR3args(register XDR *xdrs, READDIR3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->dir)) - return (FALSE); - if (!xdr_cookie3(xdrs, &objp->cookie)) - return (FALSE); - if (!xdr_cookieverf3(xdrs, objp->cookieverf)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->count)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->dir)) + return (FALSE); + if (!xdr_cookie3(xdrs, &objp->cookie)) + return (FALSE); + if (!xdr_cookieverf3(xdrs, objp->cookieverf)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->count)) + return (FALSE); + return (TRUE); } bool_t xdr_entry3(register XDR *xdrs, entry3 *objp) { - if (!xdr_fileid3(xdrs, &objp->fileid)) - return (FALSE); - if (!xdr_filename3(xdrs, &objp->name)) - return (FALSE); - if (!xdr_cookie3(xdrs, &objp->cookie)) - return (FALSE); - if (!xdr_pointer(xdrs, (char **)&objp->nextentry, sizeof (entry3), (xdrproc_t) xdr_entry3)) - return (FALSE); - return (TRUE); + if (!xdr_fileid3(xdrs, &objp->fileid)) + return (FALSE); + if (!xdr_filename3(xdrs, &objp->name)) + return (FALSE); + if (!xdr_cookie3(xdrs, &objp->cookie)) + return (FALSE); + if (!xdr_pointer(xdrs, (char **)&objp->nextentry, sizeof (entry3), (xdrproc_t) xdr_entry3)) + return (FALSE); + return (TRUE); } bool_t xdr_dirlist3(register XDR *xdrs, dirlist3 *objp) { - if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (entry3), (xdrproc_t) xdr_entry3)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->eof)) - return (FALSE); - return (TRUE); + if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (entry3), (xdrproc_t) xdr_entry3)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->eof)) + return (FALSE); + return (TRUE); } bool_t xdr_READDIR3resok(register XDR *xdrs, READDIR3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) - return (FALSE); - if (!xdr_cookieverf3(xdrs, objp->cookieverf)) - return (FALSE); - if (!xdr_dirlist3(xdrs, &objp->reply)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) + return (FALSE); + if (!xdr_cookieverf3(xdrs, objp->cookieverf)) + return (FALSE); + if (!xdr_dirlist3(xdrs, &objp->reply)) + return (FALSE); + return (TRUE); } bool_t xdr_READDIR3resfail(register XDR *xdrs, READDIR3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_READDIR3res(register XDR *xdrs, READDIR3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_READDIR3resok(xdrs, &objp->READDIR3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_READDIR3resfail(xdrs, &objp->READDIR3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_READDIR3resok(xdrs, &objp->READDIR3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_READDIR3resfail(xdrs, &objp->READDIR3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_READDIRPLUS3args(register XDR *xdrs, READDIRPLUS3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->dir)) - return (FALSE); - if (!xdr_cookie3(xdrs, &objp->cookie)) - return (FALSE); - if (!xdr_cookieverf3(xdrs, objp->cookieverf)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->dircount)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->maxcount)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->dir)) + return (FALSE); + if (!xdr_cookie3(xdrs, &objp->cookie)) + return (FALSE); + if (!xdr_cookieverf3(xdrs, objp->cookieverf)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->dircount)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->maxcount)) + return (FALSE); + return (TRUE); } bool_t xdr_entryplus3(register XDR *xdrs, entryplus3 *objp) { - if (!xdr_fileid3(xdrs, &objp->fileid)) - return (FALSE); - if (!xdr_filename3(xdrs, &objp->name)) - return (FALSE); - if (!xdr_cookie3(xdrs, &objp->cookie)) - return (FALSE); - if (!xdr_post_op_attr(xdrs, &objp->name_attributes)) - return (FALSE); - if (!xdr_post_op_fh3(xdrs, &objp->name_handle)) - return (FALSE); - if (!xdr_pointer(xdrs, (char **)&objp->nextentry, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3)) - return (FALSE); - return (TRUE); + if (!xdr_fileid3(xdrs, &objp->fileid)) + return (FALSE); + if (!xdr_filename3(xdrs, &objp->name)) + return (FALSE); + if (!xdr_cookie3(xdrs, &objp->cookie)) + return (FALSE); + if (!xdr_post_op_attr(xdrs, &objp->name_attributes)) + return (FALSE); + if (!xdr_post_op_fh3(xdrs, &objp->name_handle)) + return (FALSE); + if (!xdr_pointer(xdrs, (char **)&objp->nextentry, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3)) + return (FALSE); + return (TRUE); } bool_t xdr_dirlistplus3(register XDR *xdrs, dirlistplus3 *objp) { - if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->eof)) - return (FALSE); - return (TRUE); + if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (entryplus3), (xdrproc_t) xdr_entryplus3)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->eof)) + return (FALSE); + return (TRUE); } bool_t xdr_READDIRPLUS3resok(register XDR *xdrs, READDIRPLUS3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) - return (FALSE); - if (!xdr_cookieverf3(xdrs, objp->cookieverf)) - return (FALSE); - if (!xdr_dirlistplus3(xdrs, &objp->reply)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) + return (FALSE); + if (!xdr_cookieverf3(xdrs, objp->cookieverf)) + return (FALSE); + if (!xdr_dirlistplus3(xdrs, &objp->reply)) + return (FALSE); + return (TRUE); } bool_t xdr_READDIRPLUS3resfail(register XDR *xdrs, READDIRPLUS3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->dir_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_READDIRPLUS3res(register XDR *xdrs, READDIRPLUS3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_READDIRPLUS3resok(xdrs, &objp->READDIRPLUS3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_READDIRPLUS3resfail(xdrs, &objp->READDIRPLUS3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_READDIRPLUS3resok(xdrs, &objp->READDIRPLUS3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_READDIRPLUS3resfail(xdrs, &objp->READDIRPLUS3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_FSSTAT3args(register XDR *xdrs, FSSTAT3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->fsroot)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->fsroot)) + return (FALSE); + return (TRUE); } bool_t xdr_FSSTAT3resok(register XDR *xdrs, FSSTAT3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->tbytes)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->fbytes)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->abytes)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->tfiles)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->ffiles)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->afiles)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->invarsec)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->tbytes)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->fbytes)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->abytes)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->tfiles)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->ffiles)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->afiles)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->invarsec)) + return (FALSE); + return (TRUE); } bool_t xdr_FSSTAT3resfail(register XDR *xdrs, FSSTAT3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_FSSTAT3res(register XDR *xdrs, FSSTAT3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_FSSTAT3resok(xdrs, &objp->FSSTAT3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_FSSTAT3resfail(xdrs, &objp->FSSTAT3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_FSSTAT3resok(xdrs, &objp->FSSTAT3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_FSSTAT3resfail(xdrs, &objp->FSSTAT3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_FSINFO3args(register XDR *xdrs, FSINFO3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->fsroot)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->fsroot)) + return (FALSE); + return (TRUE); } bool_t xdr_FSINFO3resok(register XDR *xdrs, FSINFO3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->rtmax)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->rtpref)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->rtmult)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->wtmax)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->wtpref)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->wtmult)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->dtpref)) - return (FALSE); - if (!xdr_size3(xdrs, &objp->maxfilesize)) - return (FALSE); - if (!xdr_nfstime3(xdrs, &objp->time_delta)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->properties)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->rtmax)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->rtpref)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->rtmult)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->wtmax)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->wtpref)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->wtmult)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->dtpref)) + return (FALSE); + if (!xdr_size3(xdrs, &objp->maxfilesize)) + return (FALSE); + if (!xdr_nfstime3(xdrs, &objp->time_delta)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->properties)) + return (FALSE); + return (TRUE); } bool_t xdr_FSINFO3resfail(register XDR *xdrs, FSINFO3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_FSINFO3res(register XDR *xdrs, FSINFO3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_FSINFO3resok(xdrs, &objp->FSINFO3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_FSINFO3resfail(xdrs, &objp->FSINFO3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_FSINFO3resok(xdrs, &objp->FSINFO3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_FSINFO3resfail(xdrs, &objp->FSINFO3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_PATHCONF3args(register XDR *xdrs, PATHCONF3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->object)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->object)) + return (FALSE); + return (TRUE); } bool_t xdr_PATHCONF3resok(register XDR *xdrs, PATHCONF3resok *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->linkmax)) - return (FALSE); - if (!xdr_uint32(xdrs, &objp->name_max)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->no_trunc)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->chown_restricted)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->case_insensitive)) - return (FALSE); - if (!xdr_bool(xdrs, &objp->case_preserving)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->linkmax)) + return (FALSE); + if (!xdr_uint32(xdrs, &objp->name_max)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->no_trunc)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->chown_restricted)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->case_insensitive)) + return (FALSE); + if (!xdr_bool(xdrs, &objp->case_preserving)) + return (FALSE); + return (TRUE); } bool_t xdr_PATHCONF3resfail(register XDR *xdrs, PATHCONF3resfail *objp) { - if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) - return (FALSE); - return (TRUE); + if (!xdr_post_op_attr(xdrs, &objp->obj_attributes)) + return (FALSE); + return (TRUE); } bool_t xdr_PATHCONF3res(register XDR *xdrs, PATHCONF3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_PATHCONF3resok(xdrs, &objp->PATHCONF3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_PATHCONF3resfail(xdrs, &objp->PATHCONF3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_PATHCONF3resok(xdrs, &objp->PATHCONF3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_PATHCONF3resfail(xdrs, &objp->PATHCONF3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } bool_t xdr_COMMIT3args(register XDR *xdrs, COMMIT3args *objp) { - if (!xdr_nfs_fh3(xdrs, &objp->file)) - return (FALSE); - if (!xdr_offset3(xdrs, &objp->offset)) - return (FALSE); - if (!xdr_count3(xdrs, &objp->count)) - return (FALSE); - return (TRUE); + if (!xdr_nfs_fh3(xdrs, &objp->file)) + return (FALSE); + if (!xdr_offset3(xdrs, &objp->offset)) + return (FALSE); + if (!xdr_count3(xdrs, &objp->count)) + return (FALSE); + return (TRUE); } bool_t xdr_COMMIT3resok(register XDR *xdrs, COMMIT3resok *objp) { - if (!xdr_wcc_data(xdrs, &objp->file_wcc)) - return (FALSE); - if (!xdr_writeverf3(xdrs, objp->verf)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->file_wcc)) + return (FALSE); + if (!xdr_writeverf3(xdrs, objp->verf)) + return (FALSE); + return (TRUE); } bool_t xdr_COMMIT3resfail(register XDR *xdrs, COMMIT3resfail *objp) { - if (!xdr_wcc_data(xdrs, &objp->file_wcc)) - return (FALSE); - return (TRUE); + if (!xdr_wcc_data(xdrs, &objp->file_wcc)) + return (FALSE); + return (TRUE); } bool_t xdr_COMMIT3res(register XDR *xdrs, COMMIT3res *objp) { - if (!xdr_nfsstat3(xdrs, &objp->status)) - return (FALSE); - switch (objp->status) { - case NFS3_OK: - if (!xdr_COMMIT3resok(xdrs, &objp->COMMIT3res_u.resok)) - return (FALSE); - break; - default: - if (!xdr_COMMIT3resfail(xdrs, &objp->COMMIT3res_u.resfail)) - return (FALSE); - break; - } - return (TRUE); + if (!xdr_nfsstat3(xdrs, &objp->status)) + return (FALSE); + switch (objp->status) { + case NFS3_OK: + if (!xdr_COMMIT3resok(xdrs, &objp->COMMIT3res_u.resok)) + return (FALSE); + break; + default: + if (!xdr_COMMIT3resfail(xdrs, &objp->COMMIT3res_u.resfail)) + return (FALSE); + break; + } + return (TRUE); } diff --git a/components/dfs/filesystems/nfs/rpc/auth.h b/components/dfs/filesystems/nfs/rpc/auth.h index f7dd76c237..0dc947a887 100644 --- a/components/dfs/filesystems/nfs/rpc/auth.h +++ b/components/dfs/filesystems/nfs/rpc/auth.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,28 +15,28 @@ * Status returned from authentication check */ enum auth_stat { - AUTH_OK=0, - /* - * failed at remote end - */ - AUTH_BADCRED=1, /* bogus credentials (seal broken) */ - AUTH_REJECTEDCRED=2, /* client should begin new session */ - AUTH_BADVERF=3, /* bogus verifier (seal broken) */ - AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ - AUTH_TOOWEAK=5, /* rejected due to security reasons */ - /* - * failed locally - */ - AUTH_INVALIDRESP=6, /* bogus response verifier */ - AUTH_FAILED=7 /* some unknown reason */ + AUTH_OK=0, + /* + * failed at remote end + */ + AUTH_BADCRED=1, /* bogus credentials (seal broken) */ + AUTH_REJECTEDCRED=2, /* client should begin new session */ + AUTH_BADVERF=3, /* bogus verifier (seal broken) */ + AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ + AUTH_TOOWEAK=5, /* rejected due to security reasons */ + /* + * failed locally + */ + AUTH_INVALIDRESP=6, /* bogus response verifier */ + AUTH_FAILED=7 /* some unknown reason */ }; union des_block { - struct { - uint32_t high; - uint32_t low; - } key; - char c[8]; + struct { + uint32_t high; + uint32_t low; + } key; + char c[8]; }; typedef union des_block des_block; @@ -44,9 +44,9 @@ typedef union des_block des_block; * Authentication info. Opaque to client. */ struct opaque_auth { - enum_t oa_flavor; /* flavor of auth */ - char* oa_base; /* address of more auth stuff */ - unsigned int oa_length; /* not to exceed MAX_AUTH_BYTES */ + enum_t oa_flavor; /* flavor of auth */ + char* oa_base; /* address of more auth stuff */ + unsigned int oa_length; /* not to exceed MAX_AUTH_BYTES */ }; /* @@ -59,11 +59,11 @@ struct AUTH { union des_block ah_key; struct auth_ops { void (*ah_nextverf) (AUTH *); - int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */ + int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */ int (*ah_validate) (AUTH *, struct opaque_auth *); - /* validate verifier */ - int (*ah_refresh) (AUTH *); /* refresh credentials */ - void (*ah_destroy) (AUTH *); /* destroy this structure */ + /* validate verifier */ + int (*ah_refresh) (AUTH *); /* refresh credentials */ + void (*ah_destroy) (AUTH *); /* destroy this structure */ } *ah_ops; char* ah_private; }; @@ -75,37 +75,37 @@ extern struct opaque_auth _null_auth; * Authentication ops. * The ops and the auth handle provide the interface to the authenticators. * - * AUTH *auth; - * XDR *xdrs; + * AUTH *auth; + * XDR *xdrs; * struct opaque_auth verf; */ -#define AUTH_NEXTVERF(auth) \ - ((*((auth)->ah_ops->ah_nextverf))(auth)) -#define auth_nextverf(auth) \ - ((*((auth)->ah_ops->ah_nextverf))(auth)) +#define AUTH_NEXTVERF(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) +#define auth_nextverf(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) -#define AUTH_MARSHALL(auth, xdrs) \ - ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) -#define auth_marshall(auth, xdrs) \ - ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) +#define AUTH_MARSHALL(auth, xdrs) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) +#define auth_marshall(auth, xdrs) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) -#define AUTH_VALIDATE(auth, verfp) \ - ((*((auth)->ah_ops->ah_validate))((auth), verfp)) -#define auth_validate(auth, verfp) \ - ((*((auth)->ah_ops->ah_validate))((auth), verfp)) +#define AUTH_VALIDATE(auth, verfp) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp)) +#define auth_validate(auth, verfp) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp)) -#define AUTH_REFRESH(auth) \ - ((*((auth)->ah_ops->ah_refresh))(auth)) -#define auth_refresh(auth) \ - ((*((auth)->ah_ops->ah_refresh))(auth)) +#define AUTH_REFRESH(auth) \ + ((*((auth)->ah_ops->ah_refresh))(auth)) +#define auth_refresh(auth) \ + ((*((auth)->ah_ops->ah_refresh))(auth)) -#define AUTH_DESTROY(auth) \ - ((*((auth)->ah_ops->ah_destroy))(auth)) -#define auth_destroy(auth) \ - ((*((auth)->ah_ops->ah_destroy))(auth)) +#define AUTH_DESTROY(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) +#define auth_destroy(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) -#define MAX_AUTH_BYTES 400 -#define MAXNETNAMELEN 255 /* maximum length of network user's name */ +#define MAX_AUTH_BYTES 400 +#define MAXNETNAMELEN 255 /* maximum length of network user's name */ AUTH *authnone_create(void); diff --git a/components/dfs/filesystems/nfs/rpc/auth_none.c b/components/dfs/filesystems/nfs/rpc/auth_none.c index 9f5ad05002..7e22e7d864 100644 --- a/components/dfs/filesystems/nfs/rpc/auth_none.c +++ b/components/dfs/filesystems/nfs/rpc/auth_none.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC */ +/* @(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -14,23 +14,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -38,15 +38,15 @@ #if !defined(lint) && defined(SCCSIDS) static char sccsid[] = - "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; + "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; #endif /* * auth_none.c - * Creates a client authentication handle for passing "null" - * credentials and verifiers to remote systems. - * - * Copyright (C) 1984, Sun Microsystems, Inc. + * Creates a client authentication handle for passing "null" + * credentials and verifiers to remote systems. + * + * Copyright (C) 1984, Sun Microsystems, Inc. */ #include @@ -63,55 +63,55 @@ static bool_t authnone_marshal(AUTH *client, XDR *xdrs); struct opaque_auth _null_auth; static struct auth_ops ops = { - authnone_verf, - authnone_marshal, - authnone_validate, - authnone_refresh, - authnone_destroy + authnone_verf, + authnone_marshal, + authnone_validate, + authnone_refresh, + authnone_destroy }; static struct authnone_private { - AUTH no_client; - char marshalled_client[MAX_MARSHEL_SIZE]; - unsigned int mcnt; + AUTH no_client; + char marshalled_client[MAX_MARSHEL_SIZE]; + unsigned int mcnt; } *authnone_private; AUTH *authnone_create() { - register struct authnone_private *ap = authnone_private; - XDR xdr_stream; - register XDR *xdrs; + register struct authnone_private *ap = authnone_private; + XDR xdr_stream; + register XDR *xdrs; extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap); - if (ap == 0) { - ap = (struct authnone_private *) rt_malloc (sizeof(*ap)); - if (ap == 0) return NULL; - memset(ap, 0, sizeof(*ap)); - authnone_private = ap; - } - if (!ap->mcnt) { - ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; - ap->no_client.ah_ops = &ops; - xdrs = &xdr_stream; - xdrmem_create(xdrs, ap->marshalled_client, - (unsigned int) MAX_MARSHEL_SIZE, XDR_ENCODE); - (void) xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); - (void) xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); - ap->mcnt = XDR_GETPOS(xdrs); - XDR_DESTROY(xdrs); - } - return (&ap->no_client); + if (ap == 0) { + ap = (struct authnone_private *) rt_malloc (sizeof(*ap)); + if (ap == 0) return NULL; + memset(ap, 0, sizeof(*ap)); + authnone_private = ap; + } + if (!ap->mcnt) { + ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; + ap->no_client.ah_ops = &ops; + xdrs = &xdr_stream; + xdrmem_create(xdrs, ap->marshalled_client, + (unsigned int) MAX_MARSHEL_SIZE, XDR_ENCODE); + (void) xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); + (void) xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); + ap->mcnt = XDR_GETPOS(xdrs); + XDR_DESTROY(xdrs); + } + return (&ap->no_client); } -/*ARGSUSED*/ +/*ARGSUSED*/ static bool_t authnone_marshal(AUTH *client, XDR *xdrs) { - register struct authnone_private *ap = authnone_private; + register struct authnone_private *ap = authnone_private; - if (ap == 0) - return (0); - return ((*xdrs->x_ops->x_putbytes) (xdrs, - ap->marshalled_client, ap->mcnt)); + if (ap == 0) + return (0); + return ((*xdrs->x_ops->x_putbytes) (xdrs, + ap->marshalled_client, ap->mcnt)); } static void authnone_verf(AUTH *x) @@ -121,13 +121,13 @@ static void authnone_verf(AUTH *x) static bool_t authnone_validate(AUTH *x, struct opaque_auth *x1) { - return (TRUE); + return (TRUE); } static bool_t authnone_refresh(AUTH *x) { - return (FALSE); + return (FALSE); } static void authnone_destroy(AUTH *x) diff --git a/components/dfs/filesystems/nfs/rpc/clnt.h b/components/dfs/filesystems/nfs/rpc/clnt.h index e86f8be789..1d27dee359 100644 --- a/components/dfs/filesystems/nfs/rpc/clnt.h +++ b/components/dfs/filesystems/nfs/rpc/clnt.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/ +/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -43,7 +43,7 @@ */ #ifndef _RPC_CLNT_H -#define _RPC_CLNT_H 1 +#define _RPC_CLNT_H 1 #include #include @@ -55,47 +55,47 @@ * independent) list of errors. */ enum clnt_stat { - RPC_SUCCESS=0, /* call succeeded */ - /* - * local errors - */ - RPC_CANTENCODEARGS=1, /* can't encode arguments */ - RPC_CANTDECODERES=2, /* can't decode results */ - RPC_CANTSEND=3, /* failure in sending call */ - RPC_CANTRECV=4, /* failure in receiving result */ - RPC_TIMEDOUT=5, /* call timed out */ - /* - * remote errors - */ - RPC_VERSMISMATCH=6, /* rpc versions not compatible */ - RPC_AUTHERROR=7, /* authentication error */ - RPC_PROGUNAVAIL=8, /* program not available */ - RPC_PROGVERSMISMATCH=9, /* program version mismatched */ - RPC_PROCUNAVAIL=10, /* procedure unavailable */ - RPC_CANTDECODEARGS=11, /* decode arguments error */ - RPC_SYSTEMERROR=12, /* generic "other problem" */ - RPC_NOBROADCAST = 21, /* Broadcasting not supported */ - /* - * callrpc & clnt_create errors - */ - RPC_UNKNOWNHOST=13, /* unknown host name */ - RPC_UNKNOWNPROTO=17, /* unknown protocol */ - RPC_UNKNOWNADDR = 19, /* Remote address unknown */ + RPC_SUCCESS=0, /* call succeeded */ + /* + * local errors + */ + RPC_CANTENCODEARGS=1, /* can't encode arguments */ + RPC_CANTDECODERES=2, /* can't decode results */ + RPC_CANTSEND=3, /* failure in sending call */ + RPC_CANTRECV=4, /* failure in receiving result */ + RPC_TIMEDOUT=5, /* call timed out */ + /* + * remote errors + */ + RPC_VERSMISMATCH=6, /* rpc versions not compatible */ + RPC_AUTHERROR=7, /* authentication error */ + RPC_PROGUNAVAIL=8, /* program not available */ + RPC_PROGVERSMISMATCH=9, /* program version mismatched */ + RPC_PROCUNAVAIL=10, /* procedure unavailable */ + RPC_CANTDECODEARGS=11, /* decode arguments error */ + RPC_SYSTEMERROR=12, /* generic "other problem" */ + RPC_NOBROADCAST = 21, /* Broadcasting not supported */ + /* + * callrpc & clnt_create errors + */ + RPC_UNKNOWNHOST=13, /* unknown host name */ + RPC_UNKNOWNPROTO=17, /* unknown protocol */ + RPC_UNKNOWNADDR = 19, /* Remote address unknown */ - /* - * rpcbind errors - */ - RPC_RPCBFAILURE=14, /* portmapper failed in its call */ + /* + * rpcbind errors + */ + RPC_RPCBFAILURE=14, /* portmapper failed in its call */ #define RPC_PMAPFAILURE RPC_RPCBFAILURE - RPC_PROGNOTREGISTERED=15, /* remote program is not registered */ - RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */ - /* - * unspecified error - */ - RPC_FAILED=16, - RPC_INTR=18, - RPC_TLIERROR=20, - RPC_UDERROR=23, + RPC_PROGNOTREGISTERED=15, /* remote program is not registered */ + RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */ + /* + * unspecified error + */ + RPC_FAILED=16, + RPC_INTR=18, + RPC_TLIERROR=20, + RPC_UDERROR=23, /* * asynchronous errors */ @@ -110,21 +110,21 @@ enum clnt_stat { struct rpc_err { int re_status; union { - int RE_errno; /* related system error */ - int RE_why; /* why the auth error occurred */ + int RE_errno; /* related system error */ + int RE_why; /* why the auth error occurred */ struct { - unsigned long low; /* lowest verion supported */ - unsigned long high; /* highest verion supported */ + unsigned long low; /* lowest verion supported */ + unsigned long high; /* highest verion supported */ } RE_vers; - struct { /* maybe meaningful if RPC_FAILED */ + struct { /* maybe meaningful if RPC_FAILED */ long s1; long s2; - } RE_lb; /* life boot & debugging only */ + } RE_lb; /* life boot & debugging only */ } ru; -#define re_errno ru.RE_errno -#define re_why ru.RE_why -#define re_vers ru.RE_vers -#define re_lb ru.RE_lb +#define re_errno ru.RE_errno +#define re_why ru.RE_why +#define re_vers ru.RE_vers +#define re_lb ru.RE_lb }; @@ -135,21 +135,21 @@ struct rpc_err { */ typedef struct CLIENT CLIENT; struct CLIENT { - AUTH *cl_auth; /* authenticator */ + AUTH *cl_auth; /* authenticator */ struct clnt_ops { enum clnt_stat (*cl_call) (CLIENT *, unsigned long, xdrproc_t, char*, xdrproc_t, - char*, struct timeval); - /* call remote procedure */ - void (*cl_abort) (void); /* abort a call */ + char*, struct timeval); + /* call remote procedure */ + void (*cl_abort) (void); /* abort a call */ void (*cl_geterr) (CLIENT *, struct rpc_err *); - /* get specific error code */ + /* get specific error code */ bool_t (*cl_freeres) (CLIENT *, xdrproc_t, char*); - /* frees results */ + /* frees results */ void (*cl_destroy) (CLIENT *); /* destroy this structure */ bool_t (*cl_control) (CLIENT *, int, char *); - /* the ioctl() of rpc */ + /* the ioctl() of rpc */ } *cl_ops; - char* cl_private; /* private stuff */ + char* cl_private; /* private stuff */ }; @@ -163,45 +163,45 @@ struct CLIENT { /* * enum clnt_stat * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) - * CLIENT *rh; - * unsigned long proc; - * xdrproc_t xargs; - * char* argsp; - * xdrproc_t xres; - * char* resp; - * struct timeval timeout; + * CLIENT *rh; + * unsigned long proc; + * xdrproc_t xargs; + * char* argsp; + * xdrproc_t xres; + * char* resp; + * struct timeval timeout; */ -#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) -#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) +#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) +#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ + ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) /* * void * CLNT_ABORT(rh); - * CLIENT *rh; + * CLIENT *rh; */ -#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) -#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) +#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) +#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) /* * struct rpc_err * CLNT_GETERR(rh); - * CLIENT *rh; + * CLIENT *rh; */ -#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) -#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) +#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) +#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) /* * bool_t * CLNT_FREERES(rh, xres, resp); - * CLIENT *rh; - * xdrproc_t xres; - * char* resp; + * CLIENT *rh; + * xdrproc_t xres; + * char* resp; */ -#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) -#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) +#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) +#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) /* * bool_t @@ -210,8 +210,8 @@ struct CLIENT { * unsigned int request; * char *info; */ -#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) -#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) +#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) +#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) /* * control operations that apply to all transports @@ -239,16 +239,16 @@ struct CLIENT { /* * Connectionless only control operations */ -#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ -#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ +#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ +#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ /* * void * CLNT_DESTROY(rh); - * CLIENT *rh; + * CLIENT *rh; */ -#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) -#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) +#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) +#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) /* @@ -257,10 +257,10 @@ struct CLIENT { * and network administration. */ -#define RPCTEST_PROGRAM ((unsigned long)1) -#define RPCTEST_VERSION ((unsigned long)1) -#define RPCTEST_NULL_PROC ((unsigned long)2) -#define RPCTEST_NULL_BATCH_PROC ((unsigned long)3) +#define RPCTEST_PROGRAM ((unsigned long)1) +#define RPCTEST_VERSION ((unsigned long)1) +#define RPCTEST_NULL_PROC ((unsigned long)2) +#define RPCTEST_NULL_BATCH_PROC ((unsigned long)3) /* * By convention, procedure 0 takes null arguments and returns them @@ -279,51 +279,51 @@ struct CLIENT { * "unix" * CLIENT * * clnt_create(host, prog, vers, prot) - * char *host; -- hostname - * unsigned long prog; -- program number - * u_ong vers; -- version number - * char *prot; -- protocol + * char *host; -- hostname + * unsigned long prog; -- program number + * u_ong vers; -- version number + * char *prot; -- protocol */ extern CLIENT *clnt_create (const char *__host, const unsigned long __prog, - const unsigned long __vers, const char *__prot) + const unsigned long __vers, const char *__prot) ; /* * UDP based rpc. * CLIENT * * clntudp_create(raddr, program, version, wait, sockp) - * struct sockaddr_in *raddr; - * unsigned long program; - * unsigned long version; - * struct timeval wait_resend; - * int *sockp; + * struct sockaddr_in *raddr; + * unsigned long program; + * unsigned long version; + * struct timeval wait_resend; + * int *sockp; * * Same as above, but you specify max packet sizes. * CLIENT * * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) - * struct sockaddr_in *raddr; - * unsigned long program; - * unsigned long version; - * struct timeval wait_resend; - * int *sockp; - * unsigned int sendsz; - * unsigned int recvsz; + * struct sockaddr_in *raddr; + * unsigned long program; + * unsigned long version; + * struct timeval wait_resend; + * int *sockp; + * unsigned int sendsz; + * unsigned int recvsz; */ extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, unsigned long __program, - unsigned long __version, struct timeval __wait_resend, - int *__sockp); + unsigned long __version, struct timeval __wait_resend, + int *__sockp); extern CLIENT *clntudp_bufcreate (struct sockaddr_in *__raddr, - unsigned long __program, unsigned long __version, - struct timeval __wait_resend, int *__sockp, - unsigned int __sendsz, unsigned int __recvsz); + unsigned long __program, unsigned long __version, + struct timeval __wait_resend, int *__sockp, + unsigned int __sendsz, unsigned int __recvsz); extern int callrpc (const char *__host, const unsigned long __prognum, - const unsigned long __versnum, const unsigned long __procnum, - const xdrproc_t __inproc, const char *__in, - const xdrproc_t __outproc, char *__out); + const unsigned long __versnum, const unsigned long __procnum, + const xdrproc_t __inproc, const char *__in, + const xdrproc_t __outproc, char *__out); -#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ -#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ +#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ +#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ void clnt_perror(CLIENT *rpch, const char *s); diff --git a/components/dfs/filesystems/nfs/rpc/clnt_generic.c b/components/dfs/filesystems/nfs/rpc/clnt_generic.c index bd241b5835..bbcd8011ef 100644 --- a/components/dfs/filesystems/nfs/rpc/clnt_generic.c +++ b/components/dfs/filesystems/nfs/rpc/clnt_generic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/nfs/rpc/clnt_udp.c b/components/dfs/filesystems/nfs/rpc/clnt_udp.c index 6b4f7bfb13..17933539da 100644 --- a/components/dfs/filesystems/nfs/rpc/clnt_udp.c +++ b/components/dfs/filesystems/nfs/rpc/clnt_udp.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)clnt_udp.c 2.2 88/08/01 4.0 RPCSRC */ +/* @(#)clnt_udp.c 2.2 88/08/01 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -53,12 +53,12 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro"; * UDP bases client side rpc operations */ static enum clnt_stat clntudp_call(register CLIENT *cl, /* client handle */ - unsigned long proc, /* procedure number */ - xdrproc_t xargs, /* xdr routine for args */ - char* argsp, /* pointer to args */ - xdrproc_t xresults, /* xdr routine for results */ - char* resultsp, /* pointer to results */ - struct timeval utimeout); + unsigned long proc, /* procedure number */ + xdrproc_t xargs, /* xdr routine for args */ + char* argsp, /* pointer to args */ + xdrproc_t xresults, /* xdr routine for results */ + char* resultsp, /* pointer to results */ + struct timeval utimeout); static void clntudp_abort(void); static void clntudp_geterr(CLIENT *, struct rpc_err *); @@ -68,12 +68,12 @@ static void clntudp_destroy(CLIENT *); static struct clnt_ops udp_ops = { - clntudp_call, - clntudp_abort, - clntudp_geterr, - clntudp_freeres, - clntudp_destroy, - clntudp_control + clntudp_call, + clntudp_abort, + clntudp_geterr, + clntudp_freeres, + clntudp_destroy, + clntudp_control }; /* @@ -81,19 +81,19 @@ static struct clnt_ops udp_ops = */ struct cu_data { - int cu_sock; - bool_t cu_closeit; - struct sockaddr_in cu_raddr; - int cu_rlen; - struct timeval cu_wait; - struct timeval cu_total; - struct rpc_err cu_error; - XDR cu_outxdrs; - unsigned int cu_xdrpos; - unsigned int cu_sendsz; - char *cu_outbuf; - unsigned int cu_recvsz; - char cu_inbuf[1]; + int cu_sock; + bool_t cu_closeit; + struct sockaddr_in cu_raddr; + int cu_rlen; + struct timeval cu_wait; + struct timeval cu_total; + struct rpc_err cu_error; + XDR cu_outxdrs; + unsigned int cu_xdrpos; + unsigned int cu_sendsz; + char *cu_outbuf; + unsigned int cu_recvsz; + char cu_inbuf[1]; }; /* @@ -112,241 +112,241 @@ struct cu_data * sendsz and recvsz are the maximum allowable packet sizes that can be * sent and received. */ -CLIENT *clntudp_bufcreate(struct sockaddr_in *raddr, - unsigned long program, - unsigned long version, - struct timeval wait, - int *sockp, - unsigned int sendsz, - unsigned int recvsz) +CLIENT *clntudp_bufcreate(struct sockaddr_in *raddr, + unsigned long program, + unsigned long version, + struct timeval wait, + int *sockp, + unsigned int sendsz, + unsigned int recvsz) { - CLIENT *cl; - register struct cu_data *cu = NULL; - struct rpc_msg call_msg; - static int xid_count = 0; - - cl = (CLIENT *) rt_malloc (sizeof(CLIENT)); - if (cl == NULL) - { - rt_kprintf("clntudp_create: out of memory\n"); - goto fooy; - } - sendsz = ((sendsz + 3) / 4) * 4; - recvsz = ((recvsz + 3) / 4) * 4; - cu = (struct cu_data *) rt_malloc (sizeof(*cu) + sendsz + recvsz); - if (cu == NULL) - { - rt_kprintf("clntudp_create: out of memory\n"); - goto fooy; - } - cu->cu_outbuf = &cu->cu_inbuf[recvsz]; - - if (raddr->sin_port == 0) { - unsigned short port; - extern unsigned short pmap_getport(struct sockaddr_in *address, - unsigned long program, - unsigned long version, - unsigned int protocol); - - if ((port = - pmap_getport(raddr, program, version, IPPROTO_UDP)) == 0) { - goto fooy; - } - raddr->sin_port = htons(port); - } - - cl->cl_ops = &udp_ops; - cl->cl_private = (char*) cu; - cu->cu_raddr = *raddr; - cu->cu_rlen = sizeof(cu->cu_raddr); - cu->cu_wait = wait; - cu->cu_total.tv_sec = -1; - cu->cu_total.tv_usec = -1; - cu->cu_sendsz = sendsz; - cu->cu_recvsz = recvsz; - call_msg.rm_xid = ((unsigned long)rt_thread_self()) ^ ((unsigned long)rt_tick_get()) ^ (xid_count++); - call_msg.rm_direction = CALL; - call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; - call_msg.rm_call.cb_prog = program; - call_msg.rm_call.cb_vers = version; - xdrmem_create(&(cu->cu_outxdrs), cu->cu_outbuf, sendsz, XDR_ENCODE); - if (!xdr_callhdr(&(cu->cu_outxdrs), &call_msg)) - { - goto fooy; - } - cu->cu_xdrpos = XDR_GETPOS(&(cu->cu_outxdrs)); - if (*sockp < 0) - { - *sockp = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (*sockp < 0) - { - rt_kprintf("create socket error\n"); - goto fooy; - } - cu->cu_closeit = TRUE; - } - else - { - cu->cu_closeit = FALSE; - } - cu->cu_sock = *sockp; - cl->cl_auth = authnone_create(); - return (cl); + CLIENT *cl; + register struct cu_data *cu = NULL; + struct rpc_msg call_msg; + static int xid_count = 0; + + cl = (CLIENT *) rt_malloc (sizeof(CLIENT)); + if (cl == NULL) + { + rt_kprintf("clntudp_create: out of memory\n"); + goto fooy; + } + sendsz = ((sendsz + 3) / 4) * 4; + recvsz = ((recvsz + 3) / 4) * 4; + cu = (struct cu_data *) rt_malloc (sizeof(*cu) + sendsz + recvsz); + if (cu == NULL) + { + rt_kprintf("clntudp_create: out of memory\n"); + goto fooy; + } + cu->cu_outbuf = &cu->cu_inbuf[recvsz]; + + if (raddr->sin_port == 0) { + unsigned short port; + extern unsigned short pmap_getport(struct sockaddr_in *address, + unsigned long program, + unsigned long version, + unsigned int protocol); + + if ((port = + pmap_getport(raddr, program, version, IPPROTO_UDP)) == 0) { + goto fooy; + } + raddr->sin_port = htons(port); + } + + cl->cl_ops = &udp_ops; + cl->cl_private = (char*) cu; + cu->cu_raddr = *raddr; + cu->cu_rlen = sizeof(cu->cu_raddr); + cu->cu_wait = wait; + cu->cu_total.tv_sec = -1; + cu->cu_total.tv_usec = -1; + cu->cu_sendsz = sendsz; + cu->cu_recvsz = recvsz; + call_msg.rm_xid = ((unsigned long)rt_thread_self()) ^ ((unsigned long)rt_tick_get()) ^ (xid_count++); + call_msg.rm_direction = CALL; + call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; + call_msg.rm_call.cb_prog = program; + call_msg.rm_call.cb_vers = version; + xdrmem_create(&(cu->cu_outxdrs), cu->cu_outbuf, sendsz, XDR_ENCODE); + if (!xdr_callhdr(&(cu->cu_outxdrs), &call_msg)) + { + goto fooy; + } + cu->cu_xdrpos = XDR_GETPOS(&(cu->cu_outxdrs)); + if (*sockp < 0) + { + *sockp = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (*sockp < 0) + { + rt_kprintf("create socket error\n"); + goto fooy; + } + cu->cu_closeit = TRUE; + } + else + { + cu->cu_closeit = FALSE; + } + cu->cu_sock = *sockp; + cl->cl_auth = authnone_create(); + return (cl); fooy: - if (cu) rt_free(cu); - if (cl) rt_free(cl); + if (cu) rt_free(cu); + if (cl) rt_free(cl); - return ((CLIENT *) NULL); + return ((CLIENT *) NULL); } -CLIENT *clntudp_create(struct sockaddr_in *raddr, - unsigned long program, - unsigned long version, - struct timeval wait, - int *sockp) +CLIENT *clntudp_create(struct sockaddr_in *raddr, + unsigned long program, + unsigned long version, + struct timeval wait, + int *sockp) { - return (clntudp_bufcreate(raddr, program, version, wait, sockp, - UDPMSGSIZE, UDPMSGSIZE)); + return (clntudp_bufcreate(raddr, program, version, wait, sockp, + UDPMSGSIZE, UDPMSGSIZE)); } -static enum clnt_stat clntudp_call(CLIENT *cl, unsigned long proc, - xdrproc_t xargs, char* argsp, - xdrproc_t xresults, char* resultsp, - struct timeval utimeout) +static enum clnt_stat clntudp_call(CLIENT *cl, unsigned long proc, + xdrproc_t xargs, char* argsp, + xdrproc_t xresults, char* resultsp, + struct timeval utimeout) { - register struct cu_data *cu = (struct cu_data *) cl->cl_private; - register XDR *xdrs; - register int outlen; - register int inlen; - socklen_t fromlen; - - struct sockaddr_in from; - struct rpc_msg reply_msg; - XDR reply_xdrs; - bool_t ok; - int nrefreshes = 2; /* number of times to refresh cred */ + register struct cu_data *cu = (struct cu_data *) cl->cl_private; + register XDR *xdrs; + register int outlen; + register int inlen; + socklen_t fromlen; + + struct sockaddr_in from; + struct rpc_msg reply_msg; + XDR reply_xdrs; + bool_t ok; + int nrefreshes = 2; /* number of times to refresh cred */ call_again: - xdrs = &(cu->cu_outxdrs); - xdrs->x_op = XDR_ENCODE; - XDR_SETPOS(xdrs, cu->cu_xdrpos); + xdrs = &(cu->cu_outxdrs); + xdrs->x_op = XDR_ENCODE; + XDR_SETPOS(xdrs, cu->cu_xdrpos); - /* - * the transaction is the first thing in the out buffer - */ - (*(unsigned long *) (cu->cu_outbuf))++; + /* + * the transaction is the first thing in the out buffer + */ + (*(unsigned long *) (cu->cu_outbuf))++; - if ((!XDR_PUTLONG(xdrs, (long *) &proc)) || - (!AUTH_MARSHALL(cl->cl_auth, xdrs)) || (!(*xargs) (xdrs, argsp))) + if ((!XDR_PUTLONG(xdrs, (long *) &proc)) || + (!AUTH_MARSHALL(cl->cl_auth, xdrs)) || (!(*xargs) (xdrs, argsp))) { cu->cu_error.re_status = RPC_CANTENCODEARGS; - return RPC_CANTENCODEARGS; + return RPC_CANTENCODEARGS; } - outlen = (int) XDR_GETPOS(xdrs); + outlen = (int) XDR_GETPOS(xdrs); send_again: - if (sendto(cu->cu_sock, cu->cu_outbuf, outlen, 0, - (struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen) - != outlen) - { - cu->cu_error.re_errno = errno; + if (sendto(cu->cu_sock, cu->cu_outbuf, outlen, 0, + (struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen) + != outlen) + { + cu->cu_error.re_errno = errno; cu->cu_error.re_status = RPC_CANTSEND; - - return RPC_CANTSEND; - } - - /* - * sub-optimal code appears here because we have - * some clock time to spare while the packets are in flight. - * (We assume that this is actually only executed once.) - */ - reply_msg.acpted_rply.ar_verf = _null_auth; - reply_msg.acpted_rply.ar_results.where = resultsp; - reply_msg.acpted_rply.ar_results.proc = xresults; - - /* do recv */ - do - { - fromlen = sizeof(struct sockaddr); - - inlen = recvfrom(cu->cu_sock, cu->cu_inbuf, - (int) cu->cu_recvsz, 0, - (struct sockaddr *) &from, &fromlen); - }while (inlen < 0 && errno == EINTR); - - if (inlen < 4) - { - rt_kprintf("recv error, len %d\n", inlen); - cu->cu_error.re_errno = errno; - cu->cu_error.re_status = RPC_CANTRECV; - - return RPC_CANTRECV; - } - - /* see if reply transaction id matches sent id */ - if (*((uint32_t *) (cu->cu_inbuf)) != *((uint32_t *) (cu->cu_outbuf))) - goto send_again; - - /* we now assume we have the proper reply */ - - /* - * now decode and validate the response - */ - xdrmem_create(&reply_xdrs, cu->cu_inbuf, (unsigned int) inlen, XDR_DECODE); - ok = xdr_replymsg(&reply_xdrs, &reply_msg); - /* XDR_DESTROY(&reply_xdrs); save a few cycles on noop destroy */ - if (ok) - { - _seterr_reply(&reply_msg, &(cu->cu_error)); - if (cu->cu_error.re_status == RPC_SUCCESS) - { - if (!AUTH_VALIDATE(cl->cl_auth, - &reply_msg.acpted_rply.ar_verf)) - { - cu->cu_error.re_status = RPC_AUTHERROR; - cu->cu_error.re_why = AUTH_INVALIDRESP; - } - if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) - { - extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap); - - xdrs->x_op = XDR_FREE; - (void) xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); - } - } /* end successful completion */ - else - { - /* maybe our credentials need to be refreshed ... */ - if (nrefreshes > 0 && AUTH_REFRESH(cl->cl_auth)) - { - nrefreshes--; - goto call_again; - } - } /* end of unsuccessful completion */ - } /* end of valid reply message */ - else - { - cu->cu_error.re_status = RPC_CANTDECODERES; - } - - return (enum clnt_stat)(cu->cu_error.re_status); + + return RPC_CANTSEND; + } + + /* + * sub-optimal code appears here because we have + * some clock time to spare while the packets are in flight. + * (We assume that this is actually only executed once.) + */ + reply_msg.acpted_rply.ar_verf = _null_auth; + reply_msg.acpted_rply.ar_results.where = resultsp; + reply_msg.acpted_rply.ar_results.proc = xresults; + + /* do recv */ + do + { + fromlen = sizeof(struct sockaddr); + + inlen = recvfrom(cu->cu_sock, cu->cu_inbuf, + (int) cu->cu_recvsz, 0, + (struct sockaddr *) &from, &fromlen); + }while (inlen < 0 && errno == EINTR); + + if (inlen < 4) + { + rt_kprintf("recv error, len %d\n", inlen); + cu->cu_error.re_errno = errno; + cu->cu_error.re_status = RPC_CANTRECV; + + return RPC_CANTRECV; + } + + /* see if reply transaction id matches sent id */ + if (*((uint32_t *) (cu->cu_inbuf)) != *((uint32_t *) (cu->cu_outbuf))) + goto send_again; + + /* we now assume we have the proper reply */ + + /* + * now decode and validate the response + */ + xdrmem_create(&reply_xdrs, cu->cu_inbuf, (unsigned int) inlen, XDR_DECODE); + ok = xdr_replymsg(&reply_xdrs, &reply_msg); + /* XDR_DESTROY(&reply_xdrs); save a few cycles on noop destroy */ + if (ok) + { + _seterr_reply(&reply_msg, &(cu->cu_error)); + if (cu->cu_error.re_status == RPC_SUCCESS) + { + if (!AUTH_VALIDATE(cl->cl_auth, + &reply_msg.acpted_rply.ar_verf)) + { + cu->cu_error.re_status = RPC_AUTHERROR; + cu->cu_error.re_why = AUTH_INVALIDRESP; + } + if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) + { + extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap); + + xdrs->x_op = XDR_FREE; + (void) xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf)); + } + } /* end successful completion */ + else + { + /* maybe our credentials need to be refreshed ... */ + if (nrefreshes > 0 && AUTH_REFRESH(cl->cl_auth)) + { + nrefreshes--; + goto call_again; + } + } /* end of unsuccessful completion */ + } /* end of valid reply message */ + else + { + cu->cu_error.re_status = RPC_CANTDECODERES; + } + + return (enum clnt_stat)(cu->cu_error.re_status); } static void clntudp_geterr(CLIENT *cl, struct rpc_err *errp) { - register struct cu_data *cu = (struct cu_data *) cl->cl_private; + register struct cu_data *cu = (struct cu_data *) cl->cl_private; - *errp = cu->cu_error; + *errp = cu->cu_error; } static bool_t clntudp_freeres(CLIENT *cl, xdrproc_t xdr_res, char* res_ptr) { - register struct cu_data *cu = (struct cu_data *) cl->cl_private; - register XDR *xdrs = &(cu->cu_outxdrs); + register struct cu_data *cu = (struct cu_data *) cl->cl_private; + register XDR *xdrs = &(cu->cu_outxdrs); - xdrs->x_op = XDR_FREE; - return ((*xdr_res) (xdrs, res_ptr)); + xdrs->x_op = XDR_FREE; + return ((*xdr_res) (xdrs, res_ptr)); } static void clntudp_abort() @@ -355,50 +355,50 @@ static void clntudp_abort() static bool_t clntudp_control(CLIENT *cl, int request, char *info) { - register struct cu_data *cu = (struct cu_data *) cl->cl_private; - - switch (request) - { - case CLSET_TIMEOUT: - { - int mtimeout; - - cu->cu_total = *(struct timeval *) info; - mtimeout = ((cu->cu_total.tv_sec * 1000) + ((cu->cu_total.tv_usec + 500)/1000)); - - /* set socket option, note: lwip only support msecond timeout */ - setsockopt(cu->cu_sock, SOL_SOCKET, SO_RCVTIMEO, - &mtimeout, sizeof(mtimeout)); - } - break; - case CLGET_TIMEOUT: - *(struct timeval *) info = cu->cu_total; - break; - case CLSET_RETRY_TIMEOUT: - cu->cu_wait = *(struct timeval *) info; - break; - case CLGET_RETRY_TIMEOUT: - *(struct timeval *) info = cu->cu_wait; - break; - case CLGET_SERVER_ADDR: - *(struct sockaddr_in *) info = cu->cu_raddr; - break; - default: - return (FALSE); - } - return (TRUE); + register struct cu_data *cu = (struct cu_data *) cl->cl_private; + + switch (request) + { + case CLSET_TIMEOUT: + { + int mtimeout; + + cu->cu_total = *(struct timeval *) info; + mtimeout = ((cu->cu_total.tv_sec * 1000) + ((cu->cu_total.tv_usec + 500)/1000)); + + /* set socket option, note: lwip only support msecond timeout */ + setsockopt(cu->cu_sock, SOL_SOCKET, SO_RCVTIMEO, + &mtimeout, sizeof(mtimeout)); + } + break; + case CLGET_TIMEOUT: + *(struct timeval *) info = cu->cu_total; + break; + case CLSET_RETRY_TIMEOUT: + cu->cu_wait = *(struct timeval *) info; + break; + case CLGET_RETRY_TIMEOUT: + *(struct timeval *) info = cu->cu_wait; + break; + case CLGET_SERVER_ADDR: + *(struct sockaddr_in *) info = cu->cu_raddr; + break; + default: + return (FALSE); + } + return (TRUE); } static void clntudp_destroy(CLIENT *cl) { - register struct cu_data *cu = (struct cu_data *) cl->cl_private; + register struct cu_data *cu = (struct cu_data *) cl->cl_private; - if (cu->cu_closeit) - { - lwip_close(cu->cu_sock); - } + if (cu->cu_closeit) + { + lwip_close(cu->cu_sock); + } - XDR_DESTROY(&(cu->cu_outxdrs)); - rt_free(cu); - rt_free(cl); + XDR_DESTROY(&(cu->cu_outxdrs)); + rt_free(cu); + rt_free(cl); } diff --git a/components/dfs/filesystems/nfs/rpc/pmap.c b/components/dfs/filesystems/nfs/rpc/pmap.c index dc5a2ccb8d..afa2583d09 100644 --- a/components/dfs/filesystems/nfs/rpc/pmap.c +++ b/components/dfs/filesystems/nfs/rpc/pmap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -16,11 +16,11 @@ static struct timeval tottimeout = { 60, 0 }; bool_t xdr_pmap(XDR *xdrs, struct pmap *regs) { - if (xdr_u_long(xdrs, ®s->pm_prog) && - xdr_u_long(xdrs, ®s->pm_vers) && - xdr_u_long(xdrs, ®s->pm_prot)) - return (xdr_u_long(xdrs, ®s->pm_port)); - return (FALSE); + if (xdr_u_long(xdrs, ®s->pm_prog) && + xdr_u_long(xdrs, ®s->pm_vers) && + xdr_u_long(xdrs, ®s->pm_prot)) + return (xdr_u_long(xdrs, ®s->pm_port)); + return (FALSE); } /* @@ -30,33 +30,33 @@ bool_t xdr_pmap(XDR *xdrs, struct pmap *regs) */ unsigned short pmap_getport(struct sockaddr_in *address, unsigned long program, unsigned long version, unsigned int protocol) { - unsigned short port = 0; - int socket = -1; - register CLIENT *client = RT_NULL; - struct pmap parms; - - address->sin_port = htons((unsigned short)PMAPPORT); - if (protocol == IPPROTO_UDP) - client = clntudp_bufcreate(address, PMAPPROG, PMAPVERS, timeout, - &socket, RPCSMALLMSGSIZE, - RPCSMALLMSGSIZE); - - if (client != (CLIENT *) NULL) - { - parms.pm_prog = program; - parms.pm_vers = version; - parms.pm_prot = protocol; - parms.pm_port = 0; /* not needed or used */ - if (CLNT_CALL(client, PMAPPROC_GETPORT, (xdrproc_t)xdr_pmap, (char*)&parms, - (xdrproc_t)xdr_u_short, (char*)&port, tottimeout) != RPC_SUCCESS) - { - rt_kprintf("pmap failure\n"); - } - CLNT_DESTROY(client); - } - - (void) lwip_close(socket); - address->sin_port = 0; - - return (port); + unsigned short port = 0; + int socket = -1; + register CLIENT *client = RT_NULL; + struct pmap parms; + + address->sin_port = htons((unsigned short)PMAPPORT); + if (protocol == IPPROTO_UDP) + client = clntudp_bufcreate(address, PMAPPROG, PMAPVERS, timeout, + &socket, RPCSMALLMSGSIZE, + RPCSMALLMSGSIZE); + + if (client != (CLIENT *) NULL) + { + parms.pm_prog = program; + parms.pm_vers = version; + parms.pm_prot = protocol; + parms.pm_port = 0; /* not needed or used */ + if (CLNT_CALL(client, PMAPPROC_GETPORT, (xdrproc_t)xdr_pmap, (char*)&parms, + (xdrproc_t)xdr_u_short, (char*)&port, tottimeout) != RPC_SUCCESS) + { + rt_kprintf("pmap failure\n"); + } + CLNT_DESTROY(client); + } + + (void) lwip_close(socket); + address->sin_port = 0; + + return (port); } diff --git a/components/dfs/filesystems/nfs/rpc/pmap.h b/components/dfs/filesystems/nfs/rpc/pmap.h index 8ae706c0aa..3a0305a6b8 100644 --- a/components/dfs/filesystems/nfs/rpc/pmap.h +++ b/components/dfs/filesystems/nfs/rpc/pmap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -14,51 +14,51 @@ /* The following procedures are supported by the protocol: * * PMAPPROC_NULL() returns () - * takes nothing, returns nothing + * takes nothing, returns nothing * * PMAPPROC_SET(struct pmap) returns (bool_t) - * TRUE is success, FALSE is failure. Registers the tuple - * [prog, vers, prot, port]. + * TRUE is success, FALSE is failure. Registers the tuple + * [prog, vers, prot, port]. * * PMAPPROC_UNSET(struct pmap) returns (bool_t) - * TRUE is success, FALSE is failure. Un-registers pair - * [prog, vers]. prot and port are ignored. + * TRUE is success, FALSE is failure. Un-registers pair + * [prog, vers]. prot and port are ignored. * * PMAPPROC_GETPORT(struct pmap) returns (long unsigned). - * 0 is failure. Otherwise returns the port number where the pair - * [prog, vers] is registered. It may lie! + * 0 is failure. Otherwise returns the port number where the pair + * [prog, vers] is registered. It may lie! * * PMAPPROC_DUMP() RETURNS (struct pmaplist *) * * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>) - * RETURNS (port, string<>); + * RETURNS (port, string<>); * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs); - * Calls the procedure on the local machine. If it is not registered, - * this procedure is quite; ie it does not return error information!!! - * This procedure only is supported on rpc/udp and calls via - * rpc/udp. This routine only passes null authentication parameters. - * This file has no interface to xdr routines for PMAPPROC_CALLIT. + * Calls the procedure on the local machine. If it is not registered, + * this procedure is quite; ie it does not return error information!!! + * This procedure only is supported on rpc/udp and calls via + * rpc/udp. This routine only passes null authentication parameters. + * This file has no interface to xdr routines for PMAPPROC_CALLIT. * * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. */ -#define PMAPPORT ((unsigned short)111) -#define PMAPPROG ((unsigned long)100000) -#define PMAPVERS ((unsigned long)2) -#define PMAPVERS_PROTO ((unsigned long)2) -#define PMAPVERS_ORIG ((unsigned long)1) -#define PMAPPROC_NULL ((unsigned long)0) -#define PMAPPROC_SET ((unsigned long)1) -#define PMAPPROC_UNSET ((unsigned long)2) -#define PMAPPROC_GETPORT ((unsigned long)3) -#define PMAPPROC_DUMP ((unsigned long)4) -#define PMAPPROC_CALLIT ((unsigned long)5) +#define PMAPPORT ((unsigned short)111) +#define PMAPPROG ((unsigned long)100000) +#define PMAPVERS ((unsigned long)2) +#define PMAPVERS_PROTO ((unsigned long)2) +#define PMAPVERS_ORIG ((unsigned long)1) +#define PMAPPROC_NULL ((unsigned long)0) +#define PMAPPROC_SET ((unsigned long)1) +#define PMAPPROC_UNSET ((unsigned long)2) +#define PMAPPROC_GETPORT ((unsigned long)3) +#define PMAPPROC_DUMP ((unsigned long)4) +#define PMAPPROC_CALLIT ((unsigned long)5) struct pmap { - long unsigned pm_prog; - long unsigned pm_vers; - long unsigned pm_prot; - long unsigned pm_port; + long unsigned pm_prog; + long unsigned pm_vers; + long unsigned pm_prot; + long unsigned pm_port; }; extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs); diff --git a/components/dfs/filesystems/nfs/rpc/rpc.h b/components/dfs/filesystems/nfs/rpc/rpc.h index 7256d336a1..12d2477ef6 100644 --- a/components/dfs/filesystems/nfs/rpc/rpc.h +++ b/components/dfs/filesystems/nfs/rpc/rpc.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */ +/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -46,17 +46,17 @@ #ifndef _RPC_RPC_H #define _RPC_RPC_H 1 -#include /* some typedefs */ +#include /* some typedefs */ /* external data representation interfaces */ -#include /* generic (de)serializer */ +#include /* generic (de)serializer */ #include /* Client side (mostly) remote procedure call */ -#include /* generic rpc stuff */ +#include /* generic rpc stuff */ /* semi-private protocol headers */ -#include /* protocol for rpc messages */ +#include /* protocol for rpc messages */ #endif diff --git a/components/dfs/filesystems/nfs/rpc/rpc_msg.h b/components/dfs/filesystems/nfs/rpc/rpc_msg.h index a21ca1ce7d..358c3f7903 100644 --- a/components/dfs/filesystems/nfs/rpc/rpc_msg.h +++ b/components/dfs/filesystems/nfs/rpc/rpc_msg.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */ +/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -50,8 +50,8 @@ * Copyright (C) 1984, Sun Microsystems, Inc. */ -#define RPC_MSG_VERSION ((unsigned long) 2) -#define RPC_SERVICE_PORT ((unsigned short) 2048) +#define RPC_MSG_VERSION ((unsigned long) 2) +#define RPC_SERVICE_PORT ((unsigned short) 2048) /* * Bottom up definition of an rpc message. @@ -60,27 +60,27 @@ */ enum msg_type { - CALL=0, - REPLY=1 + CALL=0, + REPLY=1 }; enum reply_stat { - MSG_ACCEPTED=0, - MSG_DENIED=1 + MSG_ACCEPTED=0, + MSG_DENIED=1 }; enum accept_stat { - SUCCESS=0, - PROG_UNAVAIL=1, - PROG_MISMATCH=2, - PROC_UNAVAIL=3, - GARBAGE_ARGS=4, - SYSTEM_ERR=5 + SUCCESS=0, + PROG_UNAVAIL=1, + PROG_MISMATCH=2, + PROC_UNAVAIL=3, + GARBAGE_ARGS=4, + SYSTEM_ERR=5 }; enum reject_stat { - RPC_MISMATCH=0, - AUTH_ERROR=1 + RPC_MISMATCH=0, + AUTH_ERROR=1 }; /* @@ -93,111 +93,111 @@ enum reject_stat { * accepted. */ struct accepted_reply { - struct opaque_auth ar_verf; - int ar_stat; - union { - struct { - unsigned long low; - unsigned long high; - } AR_versions; - struct { - char* where; - xdrproc_t proc; - } AR_results; - /* and many other null cases */ - } ru; -#define ar_results ru.AR_results -#define ar_vers ru.AR_versions + struct opaque_auth ar_verf; + int ar_stat; + union { + struct { + unsigned long low; + unsigned long high; + } AR_versions; + struct { + char* where; + xdrproc_t proc; + } AR_results; + /* and many other null cases */ + } ru; +#define ar_results ru.AR_results +#define ar_vers ru.AR_versions }; /* * Reply to an rpc request that was rejected by the server. */ struct rejected_reply { - int rj_stat; - union { - struct { - unsigned long low; - unsigned long high; - } RJ_versions; - int RJ_why; /* why authentication did not work */ - } ru; -#define rj_vers ru.RJ_versions -#define rj_why ru.RJ_why + int rj_stat; + union { + struct { + unsigned long low; + unsigned long high; + } RJ_versions; + int RJ_why; /* why authentication did not work */ + } ru; +#define rj_vers ru.RJ_versions +#define rj_why ru.RJ_why }; /* * Body of a reply to an rpc request. */ struct reply_body { - int rp_stat; - union { - struct accepted_reply RP_ar; - struct rejected_reply RP_dr; - } ru; -#define rp_acpt ru.RP_ar -#define rp_rjct ru.RP_dr + int rp_stat; + union { + struct accepted_reply RP_ar; + struct rejected_reply RP_dr; + } ru; +#define rp_acpt ru.RP_ar +#define rp_rjct ru.RP_dr }; /* * Body of an rpc request call. */ struct call_body { - unsigned long cb_rpcvers; /* must be equal to two */ - unsigned long cb_prog; - unsigned long cb_vers; - unsigned long cb_proc; - struct opaque_auth cb_cred; - struct opaque_auth cb_verf; /* protocol specific - provided by client */ + unsigned long cb_rpcvers; /* must be equal to two */ + unsigned long cb_prog; + unsigned long cb_vers; + unsigned long cb_proc; + struct opaque_auth cb_cred; + struct opaque_auth cb_verf; /* protocol specific - provided by client */ }; /* * The rpc message */ struct rpc_msg { - unsigned long rm_xid; - int rm_direction; - union { - struct call_body RM_cmb; - struct reply_body RM_rmb; - } ru; -#define rm_call ru.RM_cmb -#define rm_reply ru.RM_rmb + unsigned long rm_xid; + int rm_direction; + union { + struct call_body RM_cmb; + struct reply_body RM_rmb; + } ru; +#define rm_call ru.RM_cmb +#define rm_reply ru.RM_rmb }; -#define acpted_rply ru.RM_rmb.ru.RP_ar -#define rjcted_rply ru.RM_rmb.ru.RP_dr +#define acpted_rply ru.RM_rmb.ru.RP_ar +#define rjcted_rply ru.RM_rmb.ru.RP_dr /* * XDR routine to handle a rpc message. * xdr_callmsg(xdrs, cmsg) - * XDR *xdrs; - * struct rpc_msg *cmsg; + * XDR *xdrs; + * struct rpc_msg *cmsg; */ -extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg); +extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg); /* * XDR routine to pre-serialize the static part of a rpc message. * xdr_callhdr(xdrs, cmsg) - * XDR *xdrs; - * struct rpc_msg *cmsg; + * XDR *xdrs; + * struct rpc_msg *cmsg; */ -extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg); +extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg); /* * XDR routine to handle a rpc reply. * xdr_replymsg(xdrs, rmsg) - * XDR *xdrs; - * struct rpc_msg *rmsg; + * XDR *xdrs; + * struct rpc_msg *rmsg; */ -extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg); +extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg); /* * Fills in the error part of a reply message. * _seterr_reply(msg, error) - * struct rpc_msg *msg; - * struct rpc_err *error; + * struct rpc_msg *msg; + * struct rpc_err *error; */ -extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error); +extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error); #endif /* rpc/rpc_msg.h */ diff --git a/components/dfs/filesystems/nfs/rpc/rpc_prot.c b/components/dfs/filesystems/nfs/rpc/rpc_prot.c index 427d7a11e4..61cb6cbc85 100644 --- a/components/dfs/filesystems/nfs/rpc/rpc_prot.c +++ b/components/dfs/filesystems/nfs/rpc/rpc_prot.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC */ +/* @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -14,23 +14,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -63,10 +63,10 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro"; bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) { - if (xdr_enum(xdrs, &(ap->oa_flavor))) - return (xdr_bytes(xdrs, &ap->oa_base, - &ap->oa_length, MAX_AUTH_BYTES)); - return (FALSE); + if (xdr_enum(xdrs, &(ap->oa_flavor))) + return (xdr_bytes(xdrs, &ap->oa_base, + &ap->oa_length, MAX_AUTH_BYTES)); + return (FALSE); } /* @@ -74,7 +74,7 @@ bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) */ bool_t xdr_des_block(XDR *xdrs, des_block *blkp) { - return (xdr_opaque(xdrs, (char*) blkp, sizeof(des_block))); + return (xdr_opaque(xdrs, (char*) blkp, sizeof(des_block))); } /* * * * * * * * * * * * * * XDR RPC MESSAGE * * * * * * * * * * * * * * * */ @@ -85,22 +85,22 @@ bool_t xdr_des_block(XDR *xdrs, des_block *blkp) static bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) { - /* personalized union, rather than calling xdr_union */ - if (!xdr_opaque_auth(xdrs, &(ar->ar_verf))) - return (FALSE); - if (!xdr_enum(xdrs, (enum_t *) & (ar->ar_stat))) - return (FALSE); - switch (ar->ar_stat) { - - case SUCCESS: - return ((*(ar->ar_results.proc)) (xdrs, ar->ar_results.where)); - - case PROG_MISMATCH: - if (!xdr_u_long(xdrs, &(ar->ar_vers.low))) - return (FALSE); - return (xdr_u_long(xdrs, &(ar->ar_vers.high))); - } - return (TRUE); /* TRUE => open ended set of problems */ + /* personalized union, rather than calling xdr_union */ + if (!xdr_opaque_auth(xdrs, &(ar->ar_verf))) + return (FALSE); + if (!xdr_enum(xdrs, (enum_t *) & (ar->ar_stat))) + return (FALSE); + switch (ar->ar_stat) { + + case SUCCESS: + return ((*(ar->ar_results.proc)) (xdrs, ar->ar_results.where)); + + case PROG_MISMATCH: + if (!xdr_u_long(xdrs, &(ar->ar_vers.low))) + return (FALSE); + return (xdr_u_long(xdrs, &(ar->ar_vers.high))); + } + return (TRUE); /* TRUE => open ended set of problems */ } /* @@ -109,26 +109,26 @@ static bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) static bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) { - /* personalized union, rather than calling xdr_union */ - if (!xdr_enum(xdrs, (enum_t *) & (rr->rj_stat))) - return (FALSE); - switch (rr->rj_stat) { + /* personalized union, rather than calling xdr_union */ + if (!xdr_enum(xdrs, (enum_t *) & (rr->rj_stat))) + return (FALSE); + switch (rr->rj_stat) { - case RPC_MISMATCH: - if (!xdr_u_long(xdrs, &(rr->rj_vers.low))) - return (FALSE); - return (xdr_u_long(xdrs, &(rr->rj_vers.high))); + case RPC_MISMATCH: + if (!xdr_u_long(xdrs, &(rr->rj_vers.low))) + return (FALSE); + return (xdr_u_long(xdrs, &(rr->rj_vers.high))); - case AUTH_ERROR: - return (xdr_enum(xdrs, (enum_t *) & (rr->rj_why))); - } - return (FALSE); + case AUTH_ERROR: + return (xdr_enum(xdrs, (enum_t *) & (rr->rj_why))); + } + return (FALSE); } static struct xdr_discrim reply_dscrm[3] = { - {(int) MSG_ACCEPTED, (xdrproc_t)xdr_accepted_reply}, - {(int) MSG_DENIED, (xdrproc_t)xdr_rejected_reply}, - {__dontcare__, NULL_xdrproc_t} + {(int) MSG_ACCEPTED, (xdrproc_t)xdr_accepted_reply}, + {(int) MSG_DENIED, (xdrproc_t)xdr_rejected_reply}, + {__dontcare__, NULL_xdrproc_t} }; /* @@ -136,13 +136,13 @@ static struct xdr_discrim reply_dscrm[3] = { */ bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) { - if (xdr_u_long(xdrs, &(rmsg->rm_xid)) && - xdr_enum(xdrs, (enum_t *) & (rmsg->rm_direction)) && - (rmsg->rm_direction == REPLY)) - return (xdr_union(xdrs, (enum_t *) & (rmsg->rm_reply.rp_stat), - (char*) & (rmsg->rm_reply.ru), reply_dscrm, - NULL_xdrproc_t)); - return (FALSE); + if (xdr_u_long(xdrs, &(rmsg->rm_xid)) && + xdr_enum(xdrs, (enum_t *) & (rmsg->rm_direction)) && + (rmsg->rm_direction == REPLY)) + return (xdr_union(xdrs, (enum_t *) & (rmsg->rm_reply.rp_stat), + (char*) & (rmsg->rm_reply.ru), reply_dscrm, + NULL_xdrproc_t)); + return (FALSE); } @@ -154,16 +154,16 @@ bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) { - cmsg->rm_direction = CALL; - cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION; - if ( - (xdrs->x_op == XDR_ENCODE) && - xdr_u_long(xdrs, &(cmsg->rm_xid)) && - xdr_enum(xdrs, (enum_t *) & (cmsg->rm_direction)) && - xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) && - xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog))) - return (xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers))); - return (FALSE); + cmsg->rm_direction = CALL; + cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION; + if ( + (xdrs->x_op == XDR_ENCODE) && + xdr_u_long(xdrs, &(cmsg->rm_xid)) && + xdr_enum(xdrs, (enum_t *) & (cmsg->rm_direction)) && + xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog))) + return (xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers))); + return (FALSE); } /* ************************** Client utility routine ************* */ @@ -171,55 +171,55 @@ bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) static void accepted(enum accept_stat acpt_stat, struct rpc_err *error) { - switch (acpt_stat) { + switch (acpt_stat) { - case PROG_UNAVAIL: - error->re_status = RPC_PROGUNAVAIL; - return; + case PROG_UNAVAIL: + error->re_status = RPC_PROGUNAVAIL; + return; - case PROG_MISMATCH: - error->re_status = RPC_PROGVERSMISMATCH; - return; + case PROG_MISMATCH: + error->re_status = RPC_PROGVERSMISMATCH; + return; - case PROC_UNAVAIL: - error->re_status = RPC_PROCUNAVAIL; - return; + case PROC_UNAVAIL: + error->re_status = RPC_PROCUNAVAIL; + return; - case GARBAGE_ARGS: - error->re_status = RPC_CANTDECODEARGS; - return; + case GARBAGE_ARGS: + error->re_status = RPC_CANTDECODEARGS; + return; - case SYSTEM_ERR: - error->re_status = RPC_SYSTEMERROR; - return; + case SYSTEM_ERR: + error->re_status = RPC_SYSTEMERROR; + return; - case SUCCESS: - error->re_status = RPC_SUCCESS; - return; - } - /* something's wrong, but we don't know what ... */ - error->re_status = RPC_FAILED; - error->re_lb.s1 = (long) MSG_ACCEPTED; - error->re_lb.s2 = (long) acpt_stat; + case SUCCESS: + error->re_status = RPC_SUCCESS; + return; + } + /* something's wrong, but we don't know what ... */ + error->re_status = RPC_FAILED; + error->re_lb.s1 = (long) MSG_ACCEPTED; + error->re_lb.s2 = (long) acpt_stat; } static void rejected(enum reject_stat rjct_stat, struct rpc_err *error) { - switch (rjct_stat) { + switch (rjct_stat) { - case RPC_VERSMISMATCH: - error->re_status = RPC_VERSMISMATCH; - return; + case RPC_VERSMISMATCH: + error->re_status = RPC_VERSMISMATCH; + return; - case AUTH_ERROR: - error->re_status = RPC_AUTHERROR; - return; - } - /* something's wrong, but we don't know what ... */ - error->re_status = RPC_FAILED; - error->re_lb.s1 = (long) MSG_DENIED; - error->re_lb.s2 = (long) rjct_stat; + case AUTH_ERROR: + error->re_status = RPC_AUTHERROR; + return; + } + /* something's wrong, but we don't know what ... */ + error->re_status = RPC_FAILED; + error->re_lb.s1 = (long) MSG_DENIED; + error->re_lb.s2 = (long) rjct_stat; } /* @@ -228,40 +228,40 @@ static void rejected(enum reject_stat rjct_stat, struct rpc_err *error) void _seterr_reply(struct rpc_msg *msg, struct rpc_err *error) { - /* optimized for normal, SUCCESSful case */ - switch (msg->rm_reply.rp_stat) { - - case MSG_ACCEPTED: - if (msg->acpted_rply.ar_stat == SUCCESS) { - error->re_status = RPC_SUCCESS; - return; - }; - accepted((enum accept_stat)msg->acpted_rply.ar_stat, error); - break; - - case MSG_DENIED: - rejected((enum reject_stat)msg->rjcted_rply.rj_stat, error); - break; - - default: - error->re_status = RPC_FAILED; - error->re_lb.s1 = (long) (msg->rm_reply.rp_stat); - break; - } - switch (error->re_status) { - - case RPC_VERSMISMATCH: - error->re_vers.low = msg->rjcted_rply.rj_vers.low; - error->re_vers.high = msg->rjcted_rply.rj_vers.high; - break; - - case RPC_AUTHERROR: - error->re_why = msg->rjcted_rply.rj_why; - break; - - case RPC_PROGVERSMISMATCH: - error->re_vers.low = msg->acpted_rply.ar_vers.low; - error->re_vers.high = msg->acpted_rply.ar_vers.high; - break; - } + /* optimized for normal, SUCCESSful case */ + switch (msg->rm_reply.rp_stat) { + + case MSG_ACCEPTED: + if (msg->acpted_rply.ar_stat == SUCCESS) { + error->re_status = RPC_SUCCESS; + return; + }; + accepted((enum accept_stat)msg->acpted_rply.ar_stat, error); + break; + + case MSG_DENIED: + rejected((enum reject_stat)msg->rjcted_rply.rj_stat, error); + break; + + default: + error->re_status = RPC_FAILED; + error->re_lb.s1 = (long) (msg->rm_reply.rp_stat); + break; + } + switch (error->re_status) { + + case RPC_VERSMISMATCH: + error->re_vers.low = msg->rjcted_rply.rj_vers.low; + error->re_vers.high = msg->rjcted_rply.rj_vers.high; + break; + + case RPC_AUTHERROR: + error->re_why = msg->rjcted_rply.rj_why; + break; + + case RPC_PROGVERSMISMATCH: + error->re_vers.low = msg->acpted_rply.ar_vers.low; + error->re_vers.high = msg->acpted_rply.ar_vers.high; + break; + } } diff --git a/components/dfs/filesystems/nfs/rpc/types.h b/components/dfs/filesystems/nfs/rpc/types.h index d76d89146c..043bfab896 100644 --- a/components/dfs/filesystems/nfs/rpc/types.h +++ b/components/dfs/filesystems/nfs/rpc/types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/nfs/rpc/xdr.c b/components/dfs/filesystems/nfs/rpc/xdr.c index a6b1b67afb..fa3b12ef00 100644 --- a/components/dfs/filesystems/nfs/rpc/xdr.c +++ b/components/dfs/filesystems/nfs/rpc/xdr.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)xdr.c 2.1 88/07/29 4.0 RPCSRC */ +/* @(#)xdr.c 2.1 88/07/29 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -14,23 +14,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -58,9 +58,9 @@ static char sccsid[] = "@(#)xdr.c 1.35 87/08/12"; /* * constants specific to the xdr "protocol" */ -#define XDR_FALSE ((long) 0) -#define XDR_TRUE ((long) 1) -#define LASTUNSIGNED ((unsigned int) 0-1) +#define XDR_FALSE ((long) 0) +#define XDR_TRUE ((long) 1) +#define LASTUNSIGNED ((unsigned int) 0-1) /* * for unit alignment @@ -73,21 +73,21 @@ static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 }; */ void xdr_free(xdrproc_t proc, char* objp) { - XDR x; + XDR x; - x.x_op = XDR_FREE; - (*proc) (&x, objp); + x.x_op = XDR_FREE; + (*proc) (&x, objp); } /* * XDR nothing */ bool_t xdr_void( /* xdrs, addr */ ) - /* XDR *xdrs; */ - /* char* addr; */ + /* XDR *xdrs; */ + /* char* addr; */ { - return (TRUE); + return (TRUE); } /* @@ -95,25 +95,25 @@ bool_t xdr_void( /* xdrs, addr */ ) */ bool_t xdr_int(XDR* xdrs, int* ip) { - if (sizeof(int) == sizeof(long)) { - return (xdr_long(xdrs, (long *) ip)); - } else if (sizeof(int) < sizeof(long)) { - long l; - switch (xdrs->x_op) { - case XDR_ENCODE: - l = (long) *ip; - return XDR_PUTLONG(xdrs, &l); - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, &l)) - return FALSE; - *ip = (int) l; - case XDR_FREE: - return TRUE; - } - return FALSE; - } else { - return (xdr_short(xdrs, (short *) ip)); - } + if (sizeof(int) == sizeof(long)) { + return (xdr_long(xdrs, (long *) ip)); + } else if (sizeof(int) < sizeof(long)) { + long l; + switch (xdrs->x_op) { + case XDR_ENCODE: + l = (long) *ip; + return XDR_PUTLONG(xdrs, &l); + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, &l)) + return FALSE; + *ip = (int) l; + case XDR_FREE: + return TRUE; + } + return FALSE; + } else { + return (xdr_short(xdrs, (short *) ip)); + } } /* @@ -121,25 +121,25 @@ bool_t xdr_int(XDR* xdrs, int* ip) */ bool_t xdr_u_int(XDR* xdrs, unsigned int* up) { - if (sizeof(unsigned int) == sizeof(unsigned long)) { - return (xdr_u_long(xdrs, (unsigned long *) up)); - } else if (sizeof(unsigned int) < sizeof(unsigned long)) { - unsigned long l; - switch (xdrs->x_op) { - case XDR_ENCODE: - l = (unsigned long) *up; - return XDR_PUTLONG(xdrs, (long*)&l); - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, (long*)&l)) - return FALSE; - *up = (unsigned int) l; - case XDR_FREE: - return TRUE; - } - return FALSE; - } else { - return (xdr_short(xdrs, (short *) up)); - } + if (sizeof(unsigned int) == sizeof(unsigned long)) { + return (xdr_u_long(xdrs, (unsigned long *) up)); + } else if (sizeof(unsigned int) < sizeof(unsigned long)) { + unsigned long l; + switch (xdrs->x_op) { + case XDR_ENCODE: + l = (unsigned long) *up; + return XDR_PUTLONG(xdrs, (long*)&l); + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, (long*)&l)) + return FALSE; + *up = (unsigned int) l; + case XDR_FREE: + return TRUE; + } + return FALSE; + } else { + return (xdr_short(xdrs, (short *) up)); + } } /* @@ -149,18 +149,18 @@ bool_t xdr_u_int(XDR* xdrs, unsigned int* up) bool_t xdr_long(XDR* xdrs, long* lp) { - if (xdrs->x_op == XDR_ENCODE - && (sizeof(int32_t) == sizeof(long) - || (int32_t) *lp == *lp)) - return (XDR_PUTLONG(xdrs, lp)); + if (xdrs->x_op == XDR_ENCODE + && (sizeof(int32_t) == sizeof(long) + || (int32_t) *lp == *lp)) + return (XDR_PUTLONG(xdrs, lp)); - if (xdrs->x_op == XDR_DECODE) - return (XDR_GETLONG(xdrs, lp)); + if (xdrs->x_op == XDR_DECODE) + return (XDR_GETLONG(xdrs, lp)); - if (xdrs->x_op == XDR_FREE) - return (TRUE); + if (xdrs->x_op == XDR_FREE) + return (TRUE); - return (FALSE); + return (FALSE); } /* @@ -171,25 +171,25 @@ bool_t xdr_u_long(XDR* xdrs, unsigned long* ulp) { if (xdrs->x_op == XDR_DECODE) { - long l; - if (XDR_GETLONG(xdrs, &l) == FALSE) - return FALSE; - *ulp = (uint32_t) l; - return TRUE; + long l; + if (XDR_GETLONG(xdrs, &l) == FALSE) + return FALSE; + *ulp = (uint32_t) l; + return TRUE; } if (xdrs->x_op == XDR_ENCODE) { - if (sizeof(uint32_t) != sizeof(unsigned long) - && (uint32_t) *ulp != *ulp) - return FALSE; + if (sizeof(uint32_t) != sizeof(unsigned long) + && (uint32_t) *ulp != *ulp) + return FALSE; - return (XDR_PUTLONG(xdrs, (long *) ulp)); + return (XDR_PUTLONG(xdrs, (long *) ulp)); } - if (xdrs->x_op == XDR_FREE) - return (TRUE); + if (xdrs->x_op == XDR_FREE) + return (TRUE); - return (FALSE); + return (FALSE); } @@ -254,25 +254,25 @@ bool_t xdr_u_longlong_t (XDR * xdrs, unsigned long long* ullp) */ bool_t xdr_short(XDR* xdrs, short* sp) { - long l; + long l; - switch (xdrs->x_op) { + switch (xdrs->x_op) { - case XDR_ENCODE: - l = (long) *sp; - return (XDR_PUTLONG(xdrs, &l)); + case XDR_ENCODE: + l = (long) *sp; + return (XDR_PUTLONG(xdrs, &l)); - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, &l)) { - return (FALSE); - } - *sp = (short) l; - return (TRUE); + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, &l)) { + return (FALSE); + } + *sp = (short) l; + return (TRUE); - case XDR_FREE: - return (TRUE); - } - return (FALSE); + case XDR_FREE: + return (TRUE); + } + return (FALSE); } /* @@ -280,25 +280,25 @@ bool_t xdr_short(XDR* xdrs, short* sp) */ bool_t xdr_u_short(XDR* xdrs, unsigned short* usp) { - unsigned long l; + unsigned long l; - switch (xdrs->x_op) { + switch (xdrs->x_op) { - case XDR_ENCODE: - l = (unsigned long) * usp; - return (XDR_PUTLONG(xdrs, (long*)&l)); + case XDR_ENCODE: + l = (unsigned long) * usp; + return (XDR_PUTLONG(xdrs, (long*)&l)); - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, (long*)&l)) { - return (FALSE); - } - *usp = (unsigned short) l; - return (TRUE); + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, (long*)&l)) { + return (FALSE); + } + *usp = (unsigned short) l; + return (TRUE); - case XDR_FREE: - return (TRUE); - } - return (FALSE); + case XDR_FREE: + return (TRUE); + } + return (FALSE); } @@ -307,14 +307,14 @@ bool_t xdr_u_short(XDR* xdrs, unsigned short* usp) */ bool_t xdr_char(XDR* xdrs, char* cp) { - int i; - - i = (*cp); - if (!xdr_int(xdrs, &i)) { - return (FALSE); - } - *cp = i; - return (TRUE); + int i; + + i = (*cp); + if (!xdr_int(xdrs, &i)) { + return (FALSE); + } + *cp = i; + return (TRUE); } /* @@ -322,14 +322,14 @@ bool_t xdr_char(XDR* xdrs, char* cp) */ bool_t xdr_u_char(XDR* xdrs, unsigned char* cp) { - unsigned int u; - - u = (*cp); - if (!xdr_u_int(xdrs, &u)) { - return (FALSE); - } - *cp = u; - return (TRUE); + unsigned int u; + + u = (*cp); + if (!xdr_u_int(xdrs, &u)) { + return (FALSE); + } + *cp = u; + return (TRUE); } /* @@ -337,25 +337,25 @@ bool_t xdr_u_char(XDR* xdrs, unsigned char* cp) */ bool_t xdr_bool(XDR *xdrs, bool_t *bp) { - long lb; + long lb; - switch (xdrs->x_op) { + switch (xdrs->x_op) { - case XDR_ENCODE: - lb = *bp ? XDR_TRUE : XDR_FALSE; - return (XDR_PUTLONG(xdrs, &lb)); + case XDR_ENCODE: + lb = *bp ? XDR_TRUE : XDR_FALSE; + return (XDR_PUTLONG(xdrs, &lb)); - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, &lb)) { - return (FALSE); - } - *bp = (lb == XDR_FALSE) ? FALSE : TRUE; - return (TRUE); + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, &lb)) { + return (FALSE); + } + *bp = (lb == XDR_FALSE) ? FALSE : TRUE; + return (TRUE); - case XDR_FREE: - return (TRUE); - } - return (FALSE); + case XDR_FREE: + return (TRUE); + } + return (FALSE); } /* @@ -363,10 +363,10 @@ bool_t xdr_bool(XDR *xdrs, bool_t *bp) */ bool_t xdr_enum(XDR *xdrs, enum_t *ep) { - /* - * enums are treated as ints - */ - return (xdr_long(xdrs, (long *) ep)); + /* + * enums are treated as ints + */ + return (xdr_long(xdrs, (long *) ep)); } /* @@ -376,45 +376,45 @@ bool_t xdr_enum(XDR *xdrs, enum_t *ep) */ bool_t xdr_opaque(XDR *xdrs, char* cp, unsigned int cnt) { - register unsigned int rndup; - static char crud[BYTES_PER_XDR_UNIT]; - - /* - * if no data we are done - */ - if (cnt == 0) - return (TRUE); - - /* - * round byte count to full xdr units - */ - rndup = cnt % BYTES_PER_XDR_UNIT; - if (rndup > 0) - rndup = BYTES_PER_XDR_UNIT - rndup; - - if (xdrs->x_op == XDR_DECODE) { - if (!XDR_GETBYTES(xdrs, cp, cnt)) { - return (FALSE); - } - if (rndup == 0) - return (TRUE); - return (XDR_GETBYTES(xdrs, crud, rndup)); - } - - if (xdrs->x_op == XDR_ENCODE) { - if (!XDR_PUTBYTES(xdrs, cp, cnt)) { - return (FALSE); - } - if (rndup == 0) - return (TRUE); - return (XDR_PUTBYTES(xdrs, xdr_zero, rndup)); - } - - if (xdrs->x_op == XDR_FREE) { - return (TRUE); - } - - return (FALSE); + register unsigned int rndup; + static char crud[BYTES_PER_XDR_UNIT]; + + /* + * if no data we are done + */ + if (cnt == 0) + return (TRUE); + + /* + * round byte count to full xdr units + */ + rndup = cnt % BYTES_PER_XDR_UNIT; + if (rndup > 0) + rndup = BYTES_PER_XDR_UNIT - rndup; + + if (xdrs->x_op == XDR_DECODE) { + if (!XDR_GETBYTES(xdrs, cp, cnt)) { + return (FALSE); + } + if (rndup == 0) + return (TRUE); + return (XDR_GETBYTES(xdrs, crud, rndup)); + } + + if (xdrs->x_op == XDR_ENCODE) { + if (!XDR_PUTBYTES(xdrs, cp, cnt)) { + return (FALSE); + } + if (rndup == 0) + return (TRUE); + return (XDR_PUTBYTES(xdrs, xdr_zero, rndup)); + } + + if (xdrs->x_op == XDR_FREE) { + return (TRUE); + } + + return (FALSE); } /* @@ -424,49 +424,49 @@ bool_t xdr_opaque(XDR *xdrs, char* cp, unsigned int cnt) */ bool_t xdr_bytes(XDR *xdrs, char** cpp, unsigned int *sizep, unsigned int maxsize) { - register char *sp = *cpp; /* sp is the actual string pointer */ - register unsigned int nodesize; - - /* - * first deal with the length since xdr bytes are counted - */ - if (!xdr_u_int(xdrs, sizep)) { - return (FALSE); - } - nodesize = *sizep; - if ((nodesize > maxsize) && (xdrs->x_op != XDR_FREE)) { - return (FALSE); - } - - /* - * now deal with the actual bytes - */ - switch (xdrs->x_op) { - - case XDR_DECODE: - if (nodesize == 0) { - return (TRUE); - } - if (sp == NULL) { - *cpp = sp = (char *) rt_malloc(nodesize); - } - if (sp == NULL) { - rt_kprintf("xdr_bytes: out of memory\n"); - return (FALSE); - } - /* fall into ... */ - - case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, nodesize)); - - case XDR_FREE: - if (sp != NULL) { - rt_free(sp); - *cpp = NULL; - } - return (TRUE); - } - return (FALSE); + register char *sp = *cpp; /* sp is the actual string pointer */ + register unsigned int nodesize; + + /* + * first deal with the length since xdr bytes are counted + */ + if (!xdr_u_int(xdrs, sizep)) { + return (FALSE); + } + nodesize = *sizep; + if ((nodesize > maxsize) && (xdrs->x_op != XDR_FREE)) { + return (FALSE); + } + + /* + * now deal with the actual bytes + */ + switch (xdrs->x_op) { + + case XDR_DECODE: + if (nodesize == 0) { + return (TRUE); + } + if (sp == NULL) { + *cpp = sp = (char *) rt_malloc(nodesize); + } + if (sp == NULL) { + rt_kprintf("xdr_bytes: out of memory\n"); + return (FALSE); + } + /* fall into ... */ + + case XDR_ENCODE: + return (xdr_opaque(xdrs, sp, nodesize)); + + case XDR_FREE: + if (sp != NULL) { + rt_free(sp); + *cpp = NULL; + } + return (TRUE); + } + return (FALSE); } /* @@ -474,7 +474,7 @@ bool_t xdr_bytes(XDR *xdrs, char** cpp, unsigned int *sizep, unsigned int maxsiz */ bool_t xdr_netobj(XDR *xdrs, struct netobj *np) { - return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ)); + return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ)); } /* @@ -490,30 +490,30 @@ bool_t xdr_netobj(XDR *xdrs, struct netobj *np) */ bool_t xdr_union(XDR* xdrs, enum_t* dscmp, char* unp, const struct xdr_discrim* choices, xdrproc_t dfault) { - register enum_t dscm; - - /* - * we deal with the discriminator; it's an enum - */ - if (!xdr_enum(xdrs, dscmp)) { - return (FALSE); - } - dscm = *dscmp; - - /* - * search choices for a value that matches the discriminator. - * if we find one, execute the xdr routine for that value. - */ - for (; choices->proc != NULL_xdrproc_t; choices++) { - if (choices->value == dscm) - return ((*(choices->proc)) (xdrs, unp, LASTUNSIGNED)); - } - - /* - * no match - execute the default xdr routine if there is one - */ - return ((dfault == NULL_xdrproc_t) ? FALSE : - (*dfault) (xdrs, unp, LASTUNSIGNED)); + register enum_t dscm; + + /* + * we deal with the discriminator; it's an enum + */ + if (!xdr_enum(xdrs, dscmp)) { + return (FALSE); + } + dscm = *dscmp; + + /* + * search choices for a value that matches the discriminator. + * if we find one, execute the xdr routine for that value. + */ + for (; choices->proc != NULL_xdrproc_t; choices++) { + if (choices->value == dscm) + return ((*(choices->proc)) (xdrs, unp, LASTUNSIGNED)); + } + + /* + * no match - execute the default xdr routine if there is one + */ + return ((dfault == NULL_xdrproc_t) ? FALSE : + (*dfault) (xdrs, unp, LASTUNSIGNED)); } @@ -533,70 +533,70 @@ bool_t xdr_union(XDR* xdrs, enum_t* dscmp, char* unp, const struct xdr_discrim* */ bool_t xdr_string(XDR *xdrs, char **cpp, unsigned int maxsize) { - register char *sp = *cpp; /* sp is the actual string pointer */ - unsigned int size; - unsigned int nodesize; - - /* - * first deal with the length since xdr strings are counted-strings - */ - switch (xdrs->x_op) { - case XDR_FREE: - if (sp == NULL) { - return (TRUE); /* already free */ - } - /* fall through... */ - case XDR_ENCODE: - size = strlen(sp); - break; - } - if (!xdr_u_int(xdrs, &size)) { - return (FALSE); - } - if (size > maxsize) { - return (FALSE); - } - nodesize = size + 1; - - /* - * now deal with the actual bytes - */ - switch (xdrs->x_op) { - - case XDR_DECODE: - if (nodesize == 0) { - return (TRUE); - } - if (sp == NULL) - *cpp = sp = (char *) rt_malloc(nodesize); - if (sp == NULL) { - rt_kprintf("xdr_string: out of memory\n"); - return (FALSE); - } - sp[size] = 0; - /* fall into ... */ - - case XDR_ENCODE: - return (xdr_opaque(xdrs, sp, size)); - - case XDR_FREE: - rt_free(sp); - *cpp = NULL; - return (TRUE); - } - return (FALSE); + register char *sp = *cpp; /* sp is the actual string pointer */ + unsigned int size; + unsigned int nodesize; + + /* + * first deal with the length since xdr strings are counted-strings + */ + switch (xdrs->x_op) { + case XDR_FREE: + if (sp == NULL) { + return (TRUE); /* already free */ + } + /* fall through... */ + case XDR_ENCODE: + size = strlen(sp); + break; + } + if (!xdr_u_int(xdrs, &size)) { + return (FALSE); + } + if (size > maxsize) { + return (FALSE); + } + nodesize = size + 1; + + /* + * now deal with the actual bytes + */ + switch (xdrs->x_op) { + + case XDR_DECODE: + if (nodesize == 0) { + return (TRUE); + } + if (sp == NULL) + *cpp = sp = (char *) rt_malloc(nodesize); + if (sp == NULL) { + rt_kprintf("xdr_string: out of memory\n"); + return (FALSE); + } + sp[size] = 0; + /* fall into ... */ + + case XDR_ENCODE: + return (xdr_opaque(xdrs, sp, size)); + + case XDR_FREE: + rt_free(sp); + *cpp = NULL; + return (TRUE); + } + return (FALSE); } -/* - * Wrapper for xdr_string that can be called directly from +/* + * Wrapper for xdr_string that can be called directly from * routines like clnt_call */ bool_t xdr_wrapstring(XDR *xdrs, char **cpp) { - if (xdr_string(xdrs, cpp, LASTUNSIGNED)) { - return (TRUE); - } - return (FALSE); + if (xdr_string(xdrs, cpp, LASTUNSIGNED)) { + return (TRUE); + } + return (FALSE); } /* @@ -608,69 +608,69 @@ bool_t xdr_wrapstring(XDR *xdrs, char **cpp) */ bool_t xdr_array(XDR *xdrs, char **addrp, unsigned int *sizep, unsigned int maxsize, unsigned int elsize, xdrproc_t elproc) { - register unsigned int i; - register char* target = *addrp; - register unsigned int c; /* the actual element count */ - register bool_t stat = TRUE; - register unsigned int nodesize; - - /* like strings, arrays are really counted arrays */ - if (!xdr_u_int(xdrs, sizep)) { - return (FALSE); - } - c = *sizep; - if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) { - return (FALSE); - } - /* duh, look for integer overflow (fefe) */ - { - unsigned int i; - nodesize = 0; - for (i=c; i; --i) { - unsigned int tmp=nodesize+elsize; - if (tmpx_op) { - case XDR_DECODE: - if (c == 0) - return (TRUE); - *addrp = target = rt_malloc(nodesize); - if (target == NULL) { - rt_kprintf("xdr_array: out of memory\n"); - return (FALSE); - } - memset(target, 0, nodesize); - break; - - case XDR_FREE: - return (TRUE); - } - - /* - * now we xdr each element of array - */ - for (i = 0; (i < c) && stat; i++) { - stat = (*elproc) (xdrs, target, LASTUNSIGNED); - target += elsize; - } - - /* - * the array may need freeing - */ - if (xdrs->x_op == XDR_FREE) { - rt_free(*addrp); - *addrp = NULL; - } - return (stat); + register unsigned int i; + register char* target = *addrp; + register unsigned int c; /* the actual element count */ + register bool_t stat = TRUE; + register unsigned int nodesize; + + /* like strings, arrays are really counted arrays */ + if (!xdr_u_int(xdrs, sizep)) { + return (FALSE); + } + c = *sizep; + if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) { + return (FALSE); + } + /* duh, look for integer overflow (fefe) */ + { + unsigned int i; + nodesize = 0; + for (i=c; i; --i) { + unsigned int tmp=nodesize+elsize; + if (tmpx_op) { + case XDR_DECODE: + if (c == 0) + return (TRUE); + *addrp = target = rt_malloc(nodesize); + if (target == NULL) { + rt_kprintf("xdr_array: out of memory\n"); + return (FALSE); + } + memset(target, 0, nodesize); + break; + + case XDR_FREE: + return (TRUE); + } + + /* + * now we xdr each element of array + */ + for (i = 0; (i < c) && stat; i++) { + stat = (*elproc) (xdrs, target, LASTUNSIGNED); + target += elsize; + } + + /* + * the array may need freeing + */ + if (xdrs->x_op == XDR_FREE) { + rt_free(*addrp); + *addrp = NULL; + } + return (stat); } /* @@ -685,17 +685,17 @@ bool_t xdr_array(XDR *xdrs, char **addrp, unsigned int *sizep, unsigned int maxs */ bool_t xdr_vector(XDR *xdrs, char *basep, unsigned int nelem, unsigned int elemsize, xdrproc_t xdr_elem) { - register unsigned int i; - register char *elptr; - - elptr = basep; - for (i = 0; i < nelem; i++) { - if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED)) { - return (FALSE); - } - elptr += elemsize; - } - return (TRUE); + register unsigned int i; + register char *elptr; + + elptr = basep; + for (i = 0; i < nelem; i++) { + if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED)) { + return (FALSE); + } + elptr += elemsize; + } + return (TRUE); } @@ -710,31 +710,31 @@ bool_t xdr_vector(XDR *xdrs, char *basep, unsigned int nelem, unsigned int elems */ bool_t xdr_reference(XDR *xdrs, char **pp, unsigned int size, xdrproc_t proc) { - register char* loc = *pp; - register bool_t stat; - - if (loc == NULL) - switch (xdrs->x_op) { - case XDR_FREE: - return (TRUE); - - case XDR_DECODE: - *pp = loc = (char*) rt_malloc(size); - if (loc == NULL) { - rt_kprintf("xdr_reference: out of memory\n"); - return (FALSE); - } - memset(loc, 0, (int) size); - break; - } - - stat = (*proc) (xdrs, loc, LASTUNSIGNED); - - if (xdrs->x_op == XDR_FREE) { - rt_free(loc); - *pp = NULL; - } - return (stat); + register char* loc = *pp; + register bool_t stat; + + if (loc == NULL) + switch (xdrs->x_op) { + case XDR_FREE: + return (TRUE); + + case XDR_DECODE: + *pp = loc = (char*) rt_malloc(size); + if (loc == NULL) { + rt_kprintf("xdr_reference: out of memory\n"); + return (FALSE); + } + memset(loc, 0, (int) size); + break; + } + + stat = (*proc) (xdrs, loc, LASTUNSIGNED); + + if (xdrs->x_op == XDR_FREE) { + rt_free(loc); + *pp = NULL; + } + return (stat); } @@ -760,15 +760,15 @@ bool_t xdr_reference(XDR *xdrs, char **pp, unsigned int size, xdrproc_t proc) bool_t xdr_pointer(XDR *xdrs, char **objpp, unsigned int obj_size, xdrproc_t xdr_obj) { - bool_t more_data; - - more_data = (*objpp != NULL); - if (!xdr_bool(xdrs, &more_data)) { - return (FALSE); - } - if (!more_data) { - *objpp = NULL; - return (TRUE); - } - return (xdr_reference(xdrs, objpp, obj_size, xdr_obj)); + bool_t more_data; + + more_data = (*objpp != NULL); + if (!xdr_bool(xdrs, &more_data)) { + return (FALSE); + } + if (!more_data) { + *objpp = NULL; + return (TRUE); + } + return (xdr_reference(xdrs, objpp, obj_size, xdr_obj)); } diff --git a/components/dfs/filesystems/nfs/rpc/xdr.h b/components/dfs/filesystems/nfs/rpc/xdr.h index fe38c4d120..d938f0eaa8 100644 --- a/components/dfs/filesystems/nfs/rpc/xdr.h +++ b/components/dfs/filesystems/nfs/rpc/xdr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -93,7 +93,7 @@ enum xdr_op { /* * This is the number of bytes per unit of external data. */ -#define BYTES_PER_XDR_UNIT (4) +#define BYTES_PER_XDR_UNIT (4) /* * This only works if the above is a power of 2. But it's defined to be * 4 by the appropriate RFCs. So it will work. And it's normally quicker @@ -110,35 +110,35 @@ enum xdr_op { typedef struct XDR XDR; struct XDR { - enum xdr_op x_op; /* operation; fast additional param */ + enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { - bool_t (*x_getlong) (XDR *__xdrs, long *__lp); - /* get a long from underlying stream */ - bool_t (*x_putlong) (XDR *__xdrs, const long *__lp); - /* put a long to " */ - bool_t (*x_getbytes) (XDR *__xdrs, char* __addr, unsigned int __len); - /* get some bytes from " */ - bool_t (*x_putbytes) (XDR *__xdrs, const char *__addr, unsigned int __len); - /* put some bytes to " */ - unsigned int (*x_getpostn) (const XDR *__xdrs); - /* returns bytes off from beginning */ - bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos); - /* lets you reposition the stream */ - int32_t *(*x_inline) (XDR *__xdrs, unsigned int __len); - /* buf quick ptr to buffered data */ - void (*x_destroy) (XDR *__xdrs); - /* free privates of this xdr_stream */ - bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip); - /* get a int from underlying stream */ - bool_t (*x_putint32) (XDR *__xdrs, const int32_t *__ip); - /* put a int to " */ + bool_t (*x_getlong) (XDR *__xdrs, long *__lp); + /* get a long from underlying stream */ + bool_t (*x_putlong) (XDR *__xdrs, const long *__lp); + /* put a long to " */ + bool_t (*x_getbytes) (XDR *__xdrs, char* __addr, unsigned int __len); + /* get some bytes from " */ + bool_t (*x_putbytes) (XDR *__xdrs, const char *__addr, unsigned int __len); + /* put some bytes to " */ + unsigned int (*x_getpostn) (const XDR *__xdrs); + /* returns bytes off from beginning */ + bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos); + /* lets you reposition the stream */ + int32_t *(*x_inline) (XDR *__xdrs, unsigned int __len); + /* buf quick ptr to buffered data */ + void (*x_destroy) (XDR *__xdrs); + /* free privates of this xdr_stream */ + bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip); + /* get a int from underlying stream */ + bool_t (*x_putint32) (XDR *__xdrs, const int32_t *__ip); + /* put a int to " */ } *x_ops; - char* x_public; /* users' data */ - char* x_private; /* pointer to private data */ - char* x_base; /* private used for position info */ - unsigned int x_handy; /* extra private word */ + char* x_public; /* users' data */ + char* x_private; /* pointer to private data */ + char* x_base; /* private used for position info */ + unsigned int x_handy; /* extra private word */ }; /* @@ -173,51 +173,51 @@ typedef bool_t (*xdrproc_t) (XDR *, void *,...); #define xdr_putint32(xdrs, int32p) \ (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) -#define XDR_GETLONG(xdrs, longp) \ - (*(xdrs)->x_ops->x_getlong)(xdrs, longp) -#define xdr_getlong(xdrs, longp) \ - (*(xdrs)->x_ops->x_getlong)(xdrs, longp) - -#define XDR_PUTLONG(xdrs, longp) \ - (*(xdrs)->x_ops->x_putlong)(xdrs, longp) -#define xdr_putlong(xdrs, longp) \ - (*(xdrs)->x_ops->x_putlong)(xdrs, longp) - -#define XDR_GETBYTES(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) -#define xdr_getbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) - -#define XDR_PUTBYTES(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) -#define xdr_putbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) - -#define XDR_GETPOS(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) -#define xdr_getpos(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) - -#define XDR_SETPOS(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) -#define xdr_setpos(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) - -#define XDR_INLINE(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) -#define xdr_inline(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) - -#define XDR_DESTROY(xdrs) \ - do { \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs); \ - } while (0) -#define xdr_destroy(xdrs) \ - do { \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs); \ - } while (0) +#define XDR_GETLONG(xdrs, longp) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, longp) +#define xdr_getlong(xdrs, longp) \ + (*(xdrs)->x_ops->x_getlong)(xdrs, longp) + +#define XDR_PUTLONG(xdrs, longp) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, longp) +#define xdr_putlong(xdrs, longp) \ + (*(xdrs)->x_ops->x_putlong)(xdrs, longp) + +#define XDR_GETBYTES(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) +#define xdr_getbytes(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) + +#define XDR_PUTBYTES(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) +#define xdr_putbytes(xdrs, addr, len) \ + (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) + +#define XDR_GETPOS(xdrs) \ + (*(xdrs)->x_ops->x_getpostn)(xdrs) +#define xdr_getpos(xdrs) \ + (*(xdrs)->x_ops->x_getpostn)(xdrs) + +#define XDR_SETPOS(xdrs, pos) \ + (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) +#define xdr_setpos(xdrs, pos) \ + (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) + +#define XDR_INLINE(xdrs, len) \ + (*(xdrs)->x_ops->x_inline)(xdrs, len) +#define xdr_inline(xdrs, len) \ + (*(xdrs)->x_ops->x_inline)(xdrs, len) + +#define XDR_DESTROY(xdrs) \ + do { \ + if ((xdrs)->x_ops->x_destroy) \ + (*(xdrs)->x_ops->x_destroy)(xdrs); \ + } while (0) +#define xdr_destroy(xdrs) \ + do { \ + if ((xdrs)->x_ops->x_destroy) \ + (*(xdrs)->x_ops->x_destroy)(xdrs); \ + } while (0) /* * Support struct for discriminated unions. @@ -261,10 +261,10 @@ struct xdr_discrim * and shouldn't be used any longer. Code which use this defines or longs * in the RPC code will not work on 64bit Solaris platforms ! */ -#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf)) -#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v))) -#define IXDR_GET_U_LONG(buf) ((unsigned long)IXDR_GET_LONG(buf)) -#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v)) +#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf)) +#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v))) +#define IXDR_GET_U_LONG(buf) ((unsigned long)IXDR_GET_LONG(buf)) +#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v)) #define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) @@ -305,24 +305,24 @@ extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up); extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp); extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep); extern bool_t xdr_array (XDR * _xdrs, char* *__addrp, unsigned int *__sizep, - unsigned int __maxsize, unsigned int __elsize, xdrproc_t __elproc); + unsigned int __maxsize, unsigned int __elsize, xdrproc_t __elproc); extern bool_t xdr_bytes (XDR *xdrs, char **cpp, unsigned int *sizep, - unsigned int maxsize); + unsigned int maxsize); extern bool_t xdr_opaque (XDR *__xdrs, char* __cp, unsigned int __cnt); extern bool_t xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize); extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp, - const struct xdr_discrim *__choices, - xdrproc_t dfault); + const struct xdr_discrim *__choices, + xdrproc_t dfault); extern bool_t xdr_char (XDR *__xdrs, char *__cp); extern bool_t xdr_u_char (XDR *__xdrs, unsigned char *__cp); extern bool_t xdr_vector (XDR *__xdrs, char *__basep, unsigned int __nelem, - unsigned int __elemsize, xdrproc_t __xdr_elem); + unsigned int __elemsize, xdrproc_t __xdr_elem); extern bool_t xdr_float (XDR *__xdrs, float *__fp); extern bool_t xdr_double (XDR *__xdrs, double *__dp); extern bool_t xdr_reference (XDR *__xdrs, char* *__xpp, unsigned int __size, - xdrproc_t __proc); + xdrproc_t __proc); extern bool_t xdr_pointer (XDR *__xdrs, char **__objpp, - unsigned int __obj_size, xdrproc_t __xdr_obj); + unsigned int __obj_size, xdrproc_t __xdr_obj); extern bool_t xdr_wrapstring (XDR *__xdrs, char **cpp); extern unsigned long xdr_sizeof (xdrproc_t, void *); @@ -346,13 +346,13 @@ extern bool_t xdr_netobj (XDR *__xdrs, struct netobj *__np); /* XDR using memory buffers */ extern void xdrmem_create (XDR *__xdrs, const char* __addr, - unsigned int __size, enum xdr_op __xop); + unsigned int __size, enum xdr_op __xop); /* XDR pseudo records for tcp */ extern void xdrrec_create (XDR *__xdrs, unsigned int __sendsize, - unsigned int __recvsize, char* __tcp_handle, - int (*__readit) (char *, char *, int), - int (*__writeit) (char *, char *, int)); + unsigned int __recvsize, char* __tcp_handle, + int (*__readit) (char *, char *, int), + int (*__writeit) (char *, char *, int)); /* make end of xdr record */ extern bool_t xdrrec_endofrecord (XDR *__xdrs, bool_t __sendnow); diff --git a/components/dfs/filesystems/nfs/rpc/xdr_mem.c b/components/dfs/filesystems/nfs/rpc/xdr_mem.c index ca69ed3647..7bd4737e16 100644 --- a/components/dfs/filesystems/nfs/rpc/xdr_mem.c +++ b/components/dfs/filesystems/nfs/rpc/xdr_mem.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ -/* @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC */ +/* @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -14,23 +14,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -65,30 +65,30 @@ static int32_t *xdrmem_inline (XDR *, unsigned int); static void xdrmem_destroy (XDR *); static struct xdr_ops xdrmem_ops = { - xdrmem_getlong, - xdrmem_putlong, - xdrmem_getbytes, - xdrmem_putbytes, - xdrmem_getpos, - xdrmem_setpos, - xdrmem_inline, - xdrmem_destroy, - NULL, - NULL + xdrmem_getlong, + xdrmem_putlong, + xdrmem_getbytes, + xdrmem_putbytes, + xdrmem_getpos, + xdrmem_setpos, + xdrmem_inline, + xdrmem_destroy, + NULL, + NULL }; /* * The procedure xdrmem_create initializes a stream descriptor for a - * memory buffer. + * memory buffer. */ void xdrmem_create (XDR *xdrs, const char* addr, unsigned int size, enum xdr_op op) { - xdrs->x_op = op; - xdrs->x_ops = &xdrmem_ops; - xdrs->x_private = xdrs->x_base = (char*)addr; - xdrs->x_handy = size; + xdrs->x_op = op; + xdrs->x_ops = &xdrmem_ops; + xdrs->x_private = xdrs->x_base = (char*)addr; + xdrs->x_handy = size; } static void @@ -140,7 +140,7 @@ xdrmem_putbytes (XDR *xdrs, const char *addr, unsigned int len) static unsigned int xdrmem_getpos (const XDR *xdrs) { - return ((unsigned long) xdrs->x_private - (unsigned long) xdrs->x_base); + return ((unsigned long) xdrs->x_private - (unsigned long) xdrs->x_base); } static bool_t xdrmem_setpos(XDR *xdrs, unsigned int pos) @@ -149,9 +149,9 @@ static bool_t xdrmem_setpos(XDR *xdrs, unsigned int pos) register char* lastaddr = xdrs->x_private + xdrs->x_handy; if ((long) newaddr > (long) lastaddr - || (UINT_MAX < LONG_MAX - && (long) UINT_MAX < (long) lastaddr - (long) newaddr)) - return (FALSE); + || (UINT_MAX < LONG_MAX + && (long) UINT_MAX < (long) lastaddr - (long) newaddr)) + return (FALSE); xdrs->x_private = newaddr; xdrs->x_handy = (long) lastaddr - (long) newaddr; return (TRUE); @@ -160,13 +160,13 @@ static bool_t xdrmem_setpos(XDR *xdrs, unsigned int pos) static int32_t * xdrmem_inline (XDR *xdrs, unsigned int len) { - int32_t *buf = 0; - - if (xdrs->x_handy >= len) { - xdrs->x_handy -= len; - buf = (int32_t *) xdrs->x_private; - xdrs->x_private += len; - } - return (buf); + int32_t *buf = 0; + + if (xdrs->x_handy >= len) { + xdrs->x_handy -= len; + buf = (int32_t *) xdrs->x_private; + xdrs->x_private += len; + } + return (buf); } diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.c b/components/dfs/filesystems/ramfs/dfs_ramfs.c index aa85081e1e..cc58590de2 100644 --- a/components/dfs/filesystems/ramfs/dfs_ramfs.c +++ b/components/dfs/filesystems/ramfs/dfs_ramfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.h b/components/dfs/filesystems/ramfs/dfs_ramfs.h index 4975ecb332..87adde99a5 100644 --- a/components/dfs/filesystems/ramfs/dfs_ramfs.h +++ b/components/dfs/filesystems/ramfs/dfs_ramfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c index 17dbee52f5..1b2693fc3b 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/filesystems/romfs/dfs_romfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/romfs/dfs_romfs.h b/components/dfs/filesystems/romfs/dfs_romfs.h index ba6a3d7dfa..affa4bf993 100644 --- a/components/dfs/filesystems/romfs/dfs_romfs.h +++ b/components/dfs/filesystems/romfs/dfs_romfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/romfs/romfs.c b/components/dfs/filesystems/romfs/romfs.c index cfce09a095..847fcc6e27 100644 --- a/components/dfs/filesystems/romfs/romfs.c +++ b/components/dfs/filesystems/romfs/romfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/skeleton/skeleton.c b/components/dfs/filesystems/skeleton/skeleton.c index 0c20513e82..b8dc06e9b5 100644 --- a/components/dfs/filesystems/skeleton/skeleton.c +++ b/components/dfs/filesystems/skeleton/skeleton.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/skeleton/skeleton.h b/components/dfs/filesystems/skeleton/skeleton.h index 8a783eace5..30c721d14f 100644 --- a/components/dfs/filesystems/skeleton/skeleton.h +++ b/components/dfs/filesystems/skeleton/skeleton.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/uffs/dfs_uffs.c b/components/dfs/filesystems/uffs/dfs_uffs.c index fb8caf9dd7..1ccd715800 100644 --- a/components/dfs/filesystems/uffs/dfs_uffs.c +++ b/components/dfs/filesystems/uffs/dfs_uffs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/uffs/dfs_uffs.h b/components/dfs/filesystems/uffs/dfs_uffs.h index 72f0ee9240..8e08e069e1 100644 --- a/components/dfs/filesystems/uffs/dfs_uffs.h +++ b/components/dfs/filesystems/uffs/dfs_uffs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/filesystems/uffs/uffs_rtthread.c b/components/dfs/filesystems/uffs/uffs_rtthread.c index bad456f04c..406ad35b2f 100644 --- a/components/dfs/filesystems/uffs/uffs_rtthread.c +++ b/components/dfs/filesystems/uffs/uffs_rtthread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -8,11 +8,11 @@ */ /* This file is part of UFFS, the Ultra-low-cost Flash File System. - + Copyright (C) 2005-2009 Ricky Zheng UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software + the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -20,7 +20,7 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License or GNU Library General Public License, as applicable, for more details. - + You should have received a copy of the GNU General Public License and GNU Library General Public License along with UFFS; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, @@ -33,7 +33,7 @@ by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License v2. - + This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License. */ @@ -53,83 +53,83 @@ int uffs_SemCreate(OSSEM *sem) { - static int count = 0; - char name [RT_NAME_MAX+1]; - struct rt_mutex *mutex = RT_NULL; - - rt_snprintf(name, sizeof(name), "usem%d", count++); - mutex = rt_mutex_create(name, RT_IPC_FLAG_FIFO); - if (mutex != RT_NULL) - { - *sem = (OSSEM *)mutex; - return 0; - } - uffs_Perror(UFFS_MSG_SERIOUS, "can't get a semphore"); - return -1; + static int count = 0; + char name [RT_NAME_MAX+1]; + struct rt_mutex *mutex = RT_NULL; + + rt_snprintf(name, sizeof(name), "usem%d", count++); + mutex = rt_mutex_create(name, RT_IPC_FLAG_FIFO); + if (mutex != RT_NULL) + { + *sem = (OSSEM *)mutex; + return 0; + } + uffs_Perror(UFFS_MSG_SERIOUS, "can't get a semphore"); + return -1; } int uffs_SemWait(OSSEM sem) { - return rt_mutex_take((struct rt_mutex *)sem, RT_WAITING_FOREVER); + return rt_mutex_take((struct rt_mutex *)sem, RT_WAITING_FOREVER); } int uffs_SemSignal(OSSEM sem) { - return rt_mutex_release((struct rt_mutex *)sem); + return rt_mutex_release((struct rt_mutex *)sem); } int uffs_SemDelete(OSSEM *sem) { - int ret = -1; - - if (sem) { - ret = rt_mutex_delete((struct rt_mutex *)(*sem)); - if (ret == RT_EOK) { - *sem = 0; - } - } - return ret; + int ret = -1; + + if (sem) { + ret = rt_mutex_delete((struct rt_mutex *)(*sem)); + if (ret == RT_EOK) { + *sem = 0; + } + } + return ret; } int uffs_OSGetTaskId(void) { - //TODO: ... return current task ID ... - return 0; + //TODO: ... return current task ID ... + return 0; } unsigned int uffs_GetCurDateTime(void) { - // FIXME: return system time, please modify this for your platform ! - // or just return 0 if you don't care about file time. + // FIXME: return system time, please modify this for your platform ! + // or just return 0 if you don't care about file time. #if 0 - time_t tvalue; + time_t tvalue; + + tvalue = time(NULL); - tvalue = time(NULL); - - return (unsigned int)tvalue; + return (unsigned int)tvalue; #endif - return 0; + return 0; } #if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 static void * sys_malloc(struct uffs_DeviceSt *dev, unsigned int size) { - dev = dev; - uffs_Perror(UFFS_MSG_NORMAL, "system memory alloc %d bytes", size); - return rt_malloc(size); + dev = dev; + uffs_Perror(UFFS_MSG_NORMAL, "system memory alloc %d bytes", size); + return rt_malloc(size); } static URET sys_free(struct uffs_DeviceSt *dev, void *p) { - dev = dev; - rt_free(p); - return U_SUCC; + dev = dev; + rt_free(p); + return U_SUCC; } void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator) { - allocator->malloc = sys_malloc; - allocator->free = sys_free; + allocator->malloc = sys_malloc; + allocator->free = sys_free; } #endif @@ -137,18 +137,18 @@ void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator) /* debug message output throught 'printf' */ static void output_dbg_msg(const char *msg); static struct uffs_DebugMsgOutputSt m_dbg_ops = { - output_dbg_msg, - NULL, + output_dbg_msg, + NULL, }; static void output_dbg_msg(const char *msg) { - rt_kprintf("%s", msg); + rt_kprintf("%s", msg); } void uffs_SetupDebugOutput(void) { - uffs_InitDebugMessageOutput(&m_dbg_ops, UFFS_MSG_NOISY); + uffs_InitDebugMessageOutput(&m_dbg_ops, UFFS_MSG_NOISY); } #else diff --git a/components/dfs/include/dfs.h b/components/dfs/include/dfs.h index 1158df93cb..80dc433787 100644 --- a/components/dfs/include/dfs.h +++ b/components/dfs/include/dfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/include/dfs_file.h b/components/dfs/include/dfs_file.h index 2dfacd653e..df1013d69c 100644 --- a/components/dfs/include/dfs_file.h +++ b/components/dfs/include/dfs_file.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index a35a513044..8dc93f9599 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/include/dfs_poll.h b/components/dfs/include/dfs_poll.h index d9597a4364..096a5fe712 100644 --- a/components/dfs/include/dfs_poll.h +++ b/components/dfs/include/dfs_poll.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/include/dfs_posix.h b/components/dfs/include/dfs_posix.h index 87d5f0771e..0475460d95 100644 --- a/components/dfs/include/dfs_posix.h +++ b/components/dfs/include/dfs_posix.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/include/dfs_private.h b/components/dfs/include/dfs_private.h index fccd260ac0..e602c21730 100644 --- a/components/dfs/include/dfs_private.h +++ b/components/dfs/include/dfs_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/include/dfs_select.h b/components/dfs/include/dfs_select.h index 3ac5817874..458691df20 100644 --- a/components/dfs/include/dfs_select.h +++ b/components/dfs/include/dfs_select.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c index 7ace0bc160..8155b088f0 100644 --- a/components/dfs/src/dfs.c +++ b/components/dfs/src/dfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index fd205f2f3a..aa6494457a 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c index c21b914727..53e7e385a4 100644 --- a/components/dfs/src/dfs_fs.c +++ b/components/dfs/src/dfs_fs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -522,16 +522,16 @@ INIT_ENV_EXPORT(dfs_mount_table); int dfs_mount_device(rt_device_t dev) { int index = 0; - + if(dev == RT_NULL) { rt_kprintf("the device is NULL to be mounted.\n"); return -RT_ERROR; } - + while (1) { if (mount_table[index].path == NULL) break; - + if(strcmp(mount_table[index].device_name, dev->parent.name) == 0) { if (dfs_mount(mount_table[index].device_name, mount_table[index].path, @@ -548,10 +548,10 @@ int dfs_mount_device(rt_device_t dev) return RT_EOK; } } - + index ++; } - + rt_kprintf("can't find device:%s to be mounted.\n", dev->parent.name); return -RT_ERROR; } diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index fc603df437..a7c306366f 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/dfs/src/poll.c b/components/dfs/src/poll.c index fc48eca758..d1e0372494 100644 --- a/components/dfs/src/poll.c +++ b/components/dfs/src/poll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -140,7 +140,7 @@ static int do_pollfd(struct pollfd *pollfd, rt_pollreq_t *req) /* dealwith the device return error -1*/ if (mask < 0) - { + { fd_put(f); pollfd->revents = 0; return mask; @@ -232,4 +232,4 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) return num; } -#endif +#endif diff --git a/components/dfs/src/select.c b/components/dfs/src/select.c index 181855bc74..c9286ca97f 100644 --- a/components/dfs/src/select.c +++ b/components/dfs/src/select.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -180,4 +180,4 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struc return ret; } -#endif +#endif diff --git a/components/drivers/audio/audio.c b/components/drivers/audio/audio.c index c3f8723db6..f9d42aeb5c 100644 --- a/components/drivers/audio/audio.c +++ b/components/drivers/audio/audio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/audio/audio_pipe.c b/components/drivers/audio/audio_pipe.c index e9de1ffb74..4dd1138610 100644 --- a/components/drivers/audio/audio_pipe.c +++ b/components/drivers/audio/audio_pipe.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/audio/audio_pipe.h b/components/drivers/audio/audio_pipe.h index 3ae3bc8498..6c4719d56d 100644 --- a/components/drivers/audio/audio_pipe.h +++ b/components/drivers/audio/audio_pipe.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/can/can.c b/components/drivers/can/can.c index 9f4612355b..55444c3a0e 100644 --- a/components/drivers/can/can.c +++ b/components/drivers/can/can.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/cputime/cputime.c b/components/drivers/cputime/cputime.c index 3ec860d5c5..4a9eee3a71 100644 --- a/components/drivers/cputime/cputime.c +++ b/components/drivers/cputime/cputime.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -14,7 +14,7 @@ static const struct rt_clock_cputime_ops *_cputime_ops = RT_NULL; /** - * The clock_cpu_getres() function shall return the resolution of CPU time, the + * The clock_cpu_getres() function shall return the resolution of CPU time, the * number of nanosecond per tick. * * @return the number of nanosecond per tick @@ -43,7 +43,7 @@ uint32_t clock_cpu_gettime(void) } /** - * The clock_cpu_microsecond() fucntion shall return the microsecond according to + * The clock_cpu_microsecond() fucntion shall return the microsecond according to * cpu_tick parameter. * * @param cpu_tick the cpu tick @@ -58,7 +58,7 @@ uint32_t clock_cpu_microsecond(uint32_t cpu_tick) } /** - * The clock_cpu_microsecond() fucntion shall return the millisecond according to + * The clock_cpu_microsecond() fucntion shall return the millisecond according to * cpu_tick parameter. * * @param cpu_tick the cpu tick @@ -74,7 +74,7 @@ uint32_t clock_cpu_millisecond(uint32_t cpu_tick) /** * The clock_cpu_seops() function shall set the ops of cpu time. - * + * * @return always return 0. */ int clock_cpu_setops(const struct rt_clock_cputime_ops *ops) diff --git a/components/drivers/cputime/cputime_cortexm.c b/components/drivers/cputime/cputime_cortexm.c index 05ed6ed447..071acfe9bb 100644 --- a/components/drivers/cputime/cputime_cortexm.c +++ b/components/drivers/cputime/cputime_cortexm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,7 +19,7 @@ static float cortexm_cputime_getres(void) { float ret = 1000 * 1000 * 1000; - + ret = ret / SystemCoreClock; return ret; } @@ -29,7 +29,7 @@ static uint32_t cortexm_cputime_gettime(void) return DWT->CYCCNT; } -const static struct rt_clock_cputime_ops _cortexm_ops = +const static struct rt_clock_cputime_ops _cortexm_ops = { cortexm_cputime_getres, cortexm_cputime_gettime @@ -38,13 +38,13 @@ const static struct rt_clock_cputime_ops _cortexm_ops = int cortexm_cputime_init(void) { /* check support bit */ - if ((DWT->CTRL & (1UL << DWT_CTRL_NOCYCCNT_Pos)) == 0) + if ((DWT->CTRL & (1UL << DWT_CTRL_NOCYCCNT_Pos)) == 0) { /* enable trace*/ CoreDebug->DEMCR |= (1UL << CoreDebug_DEMCR_TRCENA_Pos); - + /* whether cycle counter not enabled */ - if ((DWT->CTRL & (1UL << DWT_CTRL_CYCCNTENA_Pos)) == 0) + if ((DWT->CTRL & (1UL << DWT_CTRL_CYCCNTENA_Pos)) == 0) { /* enable cycle counter */ DWT->CTRL |= (1UL << DWT_CTRL_CYCCNTENA_Pos); diff --git a/components/drivers/hwcrypto/hw_bignum.c b/components/drivers/hwcrypto/hw_bignum.c index 88813566b1..0488a16f08 100644 --- a/components/drivers/hwcrypto/hw_bignum.c +++ b/components/drivers/hwcrypto/hw_bignum.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -56,7 +56,7 @@ rt_err_t rt_hwcrypto_bignum_default(struct rt_hwcrypto_device *device) /** * @brief Init bignum obj - * + * * @param n bignum obj */ void rt_hwcrypto_bignum_init(struct hw_bignum_mpi *n) @@ -87,9 +87,9 @@ void rt_hwcrypto_bignum_free(struct hw_bignum_mpi *n) /** * @brief Get length of bignum as an unsigned binary buffer - * + * * @param n bignum obj - * + * * @return binary buffer length */ int rt_hwcrypto_bignum_get_len(const struct hw_bignum_mpi *n) @@ -112,11 +112,11 @@ int rt_hwcrypto_bignum_get_len(const struct hw_bignum_mpi *n) /** * @brief Export n into unsigned binary data, big endian - * + * * @param n bignum obj * @param buf Buffer for the binary number * @param len Length of the buffer - * + * * @return export bin length */ int rt_hwcrypto_bignum_export_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int len) @@ -139,11 +139,11 @@ int rt_hwcrypto_bignum_export_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int /** * @brief Import n from unsigned binary data, big endian - * + * * @param n bignum obj * @param buf Buffer for the binary number * @param len Length of the buffer - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_import_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int len) @@ -179,11 +179,11 @@ rt_err_t rt_hwcrypto_bignum_import_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, /** * @brief x = a + b - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_add(struct hw_bignum_mpi *x, @@ -206,11 +206,11 @@ rt_err_t rt_hwcrypto_bignum_add(struct hw_bignum_mpi *x, /** * @brief x = a - b - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_sub(struct hw_bignum_mpi *x, @@ -233,11 +233,11 @@ rt_err_t rt_hwcrypto_bignum_sub(struct hw_bignum_mpi *x, /** * @brief x = a * b - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_mul(struct hw_bignum_mpi *x, @@ -260,11 +260,11 @@ rt_err_t rt_hwcrypto_bignum_mul(struct hw_bignum_mpi *x, /** * @brief x = a * b (mod c) - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_mulmod(struct hw_bignum_mpi *x, @@ -288,11 +288,11 @@ rt_err_t rt_hwcrypto_bignum_mulmod(struct hw_bignum_mpi *x, /** * @brief x = a ^ b (mod c) - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_exptmod(struct hw_bignum_mpi *x, diff --git a/components/drivers/hwcrypto/hw_bignum.h b/components/drivers/hwcrypto/hw_bignum.h index a1f567e68f..442b28f558 100644 --- a/components/drivers/hwcrypto/hw_bignum.h +++ b/components/drivers/hwcrypto/hw_bignum.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -83,42 +83,42 @@ void rt_hwcrypto_bignum_free(struct hw_bignum_mpi *n); /** * @brief Get length of bignum as an unsigned binary buffer - * + * * @param n bignum obj - * + * * @return binary buffer Length */ int rt_hwcrypto_bignum_get_len(const struct hw_bignum_mpi *n); /** * @brief Export n into unsigned binary data, big endian - * + * * @param n bignum obj * @param buf Buffer for the binary number * @param len Length of the buffer - * + * * @return export bin length */ int rt_hwcrypto_bignum_export_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int len); /** * @brief Import n from unsigned binary data, big endian - * + * * @param n bignum obj * @param buf Buffer for the binary number * @param len Length of the buffer - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_import_bin(struct hw_bignum_mpi *n, rt_uint8_t *buf, int len); /** * @brief x = a + b - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_add(struct hw_bignum_mpi *x, @@ -127,11 +127,11 @@ rt_err_t rt_hwcrypto_bignum_add(struct hw_bignum_mpi *x, /** * @brief x = a - b - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_sub(struct hw_bignum_mpi *x, @@ -140,11 +140,11 @@ rt_err_t rt_hwcrypto_bignum_sub(struct hw_bignum_mpi *x, /** * @brief x = a * b - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_mul(struct hw_bignum_mpi *x, @@ -153,11 +153,11 @@ rt_err_t rt_hwcrypto_bignum_mul(struct hw_bignum_mpi *x, /** * @brief x = a * b (mod c) - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_mulmod(struct hw_bignum_mpi *x, @@ -167,11 +167,11 @@ rt_err_t rt_hwcrypto_bignum_mulmod(struct hw_bignum_mpi *x, /** * @brief x = a ^ b (mod c) - * + * * @param a bignum obj * @param b bignum obj * @param c bignum obj - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_bignum_exptmod(struct hw_bignum_mpi *x, diff --git a/components/drivers/hwcrypto/hw_crc.c b/components/drivers/hwcrypto/hw_crc.c index 20579711e2..a1d95793e2 100644 --- a/components/drivers/hwcrypto/hw_crc.c +++ b/components/drivers/hwcrypto/hw_crc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -20,7 +20,7 @@ * * @return CRC context */ -struct rt_hwcrypto_ctx *rt_hwcrypto_crc_create(struct rt_hwcrypto_device *device, +struct rt_hwcrypto_ctx *rt_hwcrypto_crc_create(struct rt_hwcrypto_device *device, hwcrypto_crc_mode mode) { struct hwcrypto_crc *crc_ctx; @@ -89,8 +89,8 @@ void rt_hwcrypto_crc_destroy(struct rt_hwcrypto_ctx *ctx) * * @return RT_EOK on success. */ -rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, - const rt_uint8_t *input, +rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, + const rt_uint8_t *input, rt_size_t length) { struct hwcrypto_crc *crc_ctx = (struct hwcrypto_crc *)ctx; @@ -107,7 +107,7 @@ rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, * @param ctx CRC context * @param cfg CRC config */ -void rt_hwcrypto_crc_cfg(struct rt_hwcrypto_ctx *ctx, +void rt_hwcrypto_crc_cfg(struct rt_hwcrypto_ctx *ctx, struct hwcrypto_crc_cfg *cfg) { if (cfg) diff --git a/components/drivers/hwcrypto/hw_crc.h b/components/drivers/hwcrypto/hw_crc.h index a6df92a2ef..8e0fcefccf 100644 --- a/components/drivers/hwcrypto/hw_crc.h +++ b/components/drivers/hwcrypto/hw_crc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -129,7 +129,7 @@ void rt_hwcrypto_crc_destroy(struct rt_hwcrypto_ctx *ctx); * * @return CRC value */ -rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, +rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, const rt_uint8_t *input, rt_size_t length); /** @@ -138,7 +138,7 @@ rt_uint32_t rt_hwcrypto_crc_update(struct rt_hwcrypto_ctx *ctx, * @param ctx CRC context * @param cfg CRC config */ -void rt_hwcrypto_crc_cfg(struct rt_hwcrypto_ctx *ctx, +void rt_hwcrypto_crc_cfg(struct rt_hwcrypto_ctx *ctx, struct hwcrypto_crc_cfg *cfg); #ifdef __cplusplus diff --git a/components/drivers/hwcrypto/hw_gcm.c b/components/drivers/hwcrypto/hw_gcm.c index 8d0f49149a..a8106694f9 100644 --- a/components/drivers/hwcrypto/hw_gcm.c +++ b/components/drivers/hwcrypto/hw_gcm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwcrypto/hw_gcm.h b/components/drivers/hwcrypto/hw_gcm.h index a73b2b0634..3a2f87bc30 100644 --- a/components/drivers/hwcrypto/hw_gcm.h +++ b/components/drivers/hwcrypto/hw_gcm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwcrypto/hw_hash.c b/components/drivers/hwcrypto/hw_hash.c index b20069ac0e..cf5ec8d70a 100644 --- a/components/drivers/hwcrypto/hw_hash.c +++ b/components/drivers/hwcrypto/hw_hash.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwcrypto/hw_hash.h b/components/drivers/hwcrypto/hw_hash.h index de0310e84c..41abd06c4c 100644 --- a/components/drivers/hwcrypto/hw_hash.h +++ b/components/drivers/hwcrypto/hw_hash.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwcrypto/hw_rng.c b/components/drivers/hwcrypto/hw_rng.c index 13a17cc6be..b6f62db347 100644 --- a/components/drivers/hwcrypto/hw_rng.c +++ b/components/drivers/hwcrypto/hw_rng.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -81,7 +81,7 @@ rt_err_t rt_hwcrypto_rng_default(struct rt_hwcrypto_device *device) * @brief Getting Random Numbers from RNG Context * * @param ctx RNG context - * + * * @return Random number */ rt_uint32_t rt_hwcrypto_rng_update_ctx(struct rt_hwcrypto_ctx *ctx) diff --git a/components/drivers/hwcrypto/hw_rng.h b/components/drivers/hwcrypto/hw_rng.h index fc28afdb1e..3c014f6bee 100644 --- a/components/drivers/hwcrypto/hw_rng.h +++ b/components/drivers/hwcrypto/hw_rng.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,7 @@ rt_err_t rt_hwcrypto_rng_default(struct rt_hwcrypto_device *device); * @brief Getting Random Numbers from RNG Context * * @param ctx RNG context - * + * * @return Random number */ rt_uint32_t rt_hwcrypto_rng_update_ctx(struct rt_hwcrypto_ctx *ctx); diff --git a/components/drivers/hwcrypto/hw_symmetric.c b/components/drivers/hwcrypto/hw_symmetric.c index 789c5c1a2c..9398298fed 100644 --- a/components/drivers/hwcrypto/hw_symmetric.c +++ b/components/drivers/hwcrypto/hw_symmetric.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -215,7 +215,7 @@ void rt_hwcrypto_symmetric_get_ivoff(struct rt_hwcrypto_ctx *ctx, rt_int32_t *iv * * @param des The destination symmetric crypto context * @param src The symmetric crypto context to be copy - * + * * @return RT_EOK on success. */ rt_err_t rt_hwcrypto_symmetric_cpy(struct rt_hwcrypto_ctx *des, const struct rt_hwcrypto_ctx *src) diff --git a/components/drivers/hwcrypto/hw_symmetric.h b/components/drivers/hwcrypto/hw_symmetric.h index 12f4dbec30..f3f78fb21c 100644 --- a/components/drivers/hwcrypto/hw_symmetric.h +++ b/components/drivers/hwcrypto/hw_symmetric.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwcrypto/hwcrypto.c b/components/drivers/hwcrypto/hwcrypto.c index bbe1ff63fb..473b52fb9a 100644 --- a/components/drivers/hwcrypto/hwcrypto.c +++ b/components/drivers/hwcrypto/hwcrypto.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwcrypto/hwcrypto.h b/components/drivers/hwcrypto/hwcrypto.h index a428f4437d..cdf057c49d 100644 --- a/components/drivers/hwcrypto/hwcrypto.h +++ b/components/drivers/hwcrypto/hwcrypto.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/hwtimer/hwtimer.c b/components/drivers/hwtimer/hwtimer.c index 976d8bbf32..49a57be9af 100644 --- a/components/drivers/hwtimer/hwtimer.c +++ b/components/drivers/hwtimer/hwtimer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -325,7 +325,7 @@ void rt_device_hwtimer_isr(rt_hwtimer_t *timer) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops hwtimer_ops = +const static struct rt_device_ops hwtimer_ops = { rt_hwtimer_init, rt_hwtimer_open, diff --git a/components/drivers/i2c/i2c-bit-ops.c b/components/drivers/i2c/i2c-bit-ops.c index 3a9b4efeb3..ae1f4db9c0 100644 --- a/components/drivers/i2c/i2c-bit-ops.c +++ b/components/drivers/i2c/i2c-bit-ops.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/i2c/i2c_core.c b/components/drivers/i2c/i2c_core.c index f358c2b758..87178e37d5 100644 --- a/components/drivers/i2c/i2c_core.c +++ b/components/drivers/i2c/i2c_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/i2c/i2c_dev.c b/components/drivers/i2c/i2c_dev.c index 59f728be09..4f567f8227 100644 --- a/components/drivers/i2c/i2c_dev.c +++ b/components/drivers/i2c/i2c_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -97,9 +97,9 @@ static rt_err_t i2c_bus_device_control(rt_device_t dev, } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops i2c_ops = +const static struct rt_device_ops i2c_ops = { - RT_NULL, + RT_NULL, RT_NULL, RT_NULL, i2c_bus_device_read, diff --git a/components/drivers/include/drivers/adc.h b/components/drivers/include/drivers/adc.h index 8e3498e791..e2ce087fb9 100644 --- a/components/drivers/include/drivers/adc.h +++ b/components/drivers/include/drivers/adc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/alarm.h b/components/drivers/include/drivers/alarm.h index e59c4142c7..11637df949 100644 --- a/components/drivers/include/drivers/alarm.h +++ b/components/drivers/include/drivers/alarm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/audio.h b/components/drivers/include/drivers/audio.h index 86057e7626..45c31be2f3 100644 --- a/components/drivers/include/drivers/audio.h +++ b/components/drivers/include/drivers/audio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/can.h b/components/drivers/include/drivers/can.h index d4fcc845b4..bb05317d4f 100644 --- a/components/drivers/include/drivers/can.h +++ b/components/drivers/include/drivers/can.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/cputime.h b/components/drivers/include/drivers/cputime.h index 78c22fc1da..0141f24805 100644 --- a/components/drivers/include/drivers/cputime.h +++ b/components/drivers/include/drivers/cputime.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/crypto.h b/components/drivers/include/drivers/crypto.h index 5341d9ee48..8270a78b09 100644 --- a/components/drivers/include/drivers/crypto.h +++ b/components/drivers/include/drivers/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/dac.h b/components/drivers/include/drivers/dac.h index b6043348dc..7d5ff3592a 100644 --- a/components/drivers/include/drivers/dac.h +++ b/components/drivers/include/drivers/dac.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/hwtimer.h b/components/drivers/include/drivers/hwtimer.h index d00dbd8a13..0bf4893790 100644 --- a/components/drivers/include/drivers/hwtimer.h +++ b/components/drivers/include/drivers/hwtimer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/i2c-bit-ops.h b/components/drivers/include/drivers/i2c-bit-ops.h index ddf9a36d73..0d94de114a 100644 --- a/components/drivers/include/drivers/i2c-bit-ops.h +++ b/components/drivers/include/drivers/i2c-bit-ops.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/i2c.h b/components/drivers/include/drivers/i2c.h index d93e82fc2b..50ce021d53 100644 --- a/components/drivers/include/drivers/i2c.h +++ b/components/drivers/include/drivers/i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/i2c_dev.h b/components/drivers/include/drivers/i2c_dev.h index 5ef9dd1a8c..94f110c055 100644 --- a/components/drivers/include/drivers/i2c_dev.h +++ b/components/drivers/include/drivers/i2c_dev.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/mmc.h b/components/drivers/include/drivers/mmc.h index 95dce7178a..d472bbbc5d 100644 --- a/components/drivers/include/drivers/mmc.h +++ b/components/drivers/include/drivers/mmc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -22,163 +22,163 @@ extern "C" { * EXT_CSD fields */ -#define EXT_CSD_FLUSH_CACHE 32 /* W */ -#define EXT_CSD_CACHE_CTRL 33 /* R/W */ -#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ -#define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */ -#define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */ -#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */ -#define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ -#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ -#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ -#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ -#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ -#define EXT_CSD_HPI_MGMT 161 /* R/W */ -#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ -#define EXT_CSD_BKOPS_EN 163 /* R/W */ -#define EXT_CSD_BKOPS_START 164 /* W */ -#define EXT_CSD_SANITIZE_START 165 /* W */ -#define EXT_CSD_WR_REL_PARAM 166 /* RO */ -#define EXT_CSD_RPMB_MULT 168 /* RO */ -#define EXT_CSD_BOOT_WP 173 /* R/W */ -#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ -#define EXT_CSD_PART_CONFIG 179 /* R/W */ -#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ -#define EXT_CSD_BUS_WIDTH 183 /* R/W */ -#define EXT_CSD_HS_TIMING 185 /* R/W */ -#define EXT_CSD_POWER_CLASS 187 /* R/W */ -#define EXT_CSD_REV 192 /* RO */ -#define EXT_CSD_STRUCTURE 194 /* RO */ -#define EXT_CSD_CARD_TYPE 196 /* RO */ -#define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */ +#define EXT_CSD_FLUSH_CACHE 32 /* W */ +#define EXT_CSD_CACHE_CTRL 33 /* R/W */ +#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ +#define EXT_CSD_PACKED_FAILURE_INDEX 35 /* RO */ +#define EXT_CSD_PACKED_CMD_STATUS 36 /* RO */ +#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO, 2 bytes */ +#define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ +#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ +#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ +#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ +#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ +#define EXT_CSD_HPI_MGMT 161 /* R/W */ +#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ +#define EXT_CSD_BKOPS_EN 163 /* R/W */ +#define EXT_CSD_BKOPS_START 164 /* W */ +#define EXT_CSD_SANITIZE_START 165 /* W */ +#define EXT_CSD_WR_REL_PARAM 166 /* RO */ +#define EXT_CSD_RPMB_MULT 168 /* RO */ +#define EXT_CSD_BOOT_WP 173 /* R/W */ +#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ +#define EXT_CSD_PART_CONFIG 179 /* R/W */ +#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ +#define EXT_CSD_BUS_WIDTH 183 /* R/W */ +#define EXT_CSD_HS_TIMING 185 /* R/W */ +#define EXT_CSD_POWER_CLASS 187 /* R/W */ +#define EXT_CSD_REV 192 /* RO */ +#define EXT_CSD_STRUCTURE 194 /* RO */ +#define EXT_CSD_CARD_TYPE 196 /* RO */ +#define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */ #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ -#define EXT_CSD_PWR_CL_52_195 200 /* RO */ -#define EXT_CSD_PWR_CL_26_195 201 /* RO */ -#define EXT_CSD_PWR_CL_52_360 202 /* RO */ -#define EXT_CSD_PWR_CL_26_360 203 /* RO */ -#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ -#define EXT_CSD_S_A_TIMEOUT 217 /* RO */ -#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ -#define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ -#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ -#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ -#define EXT_CSD_BOOT_MULT 226 /* RO */ -#define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ -#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ -#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ -#define EXT_CSD_TRIM_MULT 232 /* RO */ -#define EXT_CSD_PWR_CL_200_195 236 /* RO */ -#define EXT_CSD_PWR_CL_200_360 237 /* RO */ -#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ -#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ -#define EXT_CSD_BKOPS_STATUS 246 /* RO */ -#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ -#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ -#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ -#define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ -#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ -#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ -#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ -#define EXT_CSD_MAX_PACKED_READS 501 /* RO */ -#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ -#define EXT_CSD_HPI_FEATURES 503 /* RO */ +#define EXT_CSD_PWR_CL_52_195 200 /* RO */ +#define EXT_CSD_PWR_CL_26_195 201 /* RO */ +#define EXT_CSD_PWR_CL_52_360 202 /* RO */ +#define EXT_CSD_PWR_CL_26_360 203 /* RO */ +#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ +#define EXT_CSD_S_A_TIMEOUT 217 /* RO */ +#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ +#define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ +#define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ +#define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ +#define EXT_CSD_BOOT_MULT 226 /* RO */ +#define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ +#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ +#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ +#define EXT_CSD_TRIM_MULT 232 /* RO */ +#define EXT_CSD_PWR_CL_200_195 236 /* RO */ +#define EXT_CSD_PWR_CL_200_360 237 /* RO */ +#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ +#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ +#define EXT_CSD_BKOPS_STATUS 246 /* RO */ +#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ +#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ +#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ +#define EXT_CSD_PWR_CL_DDR_200_360 253 /* RO */ +#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ +#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ +#define EXT_CSD_MAX_PACKED_WRITES 500 /* RO */ +#define EXT_CSD_MAX_PACKED_READS 501 /* RO */ +#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */ +#define EXT_CSD_HPI_FEATURES 503 /* RO */ /* * EXT_CSD field definitions */ -#define EXT_CSD_WR_REL_PARAM_EN (1<<2) +#define EXT_CSD_WR_REL_PARAM_EN (1<<2) -#define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40) -#define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10) -#define EXT_CSD_BOOT_WP_B_PERM_WP_EN (0x04) -#define EXT_CSD_BOOT_WP_B_PWR_WP_EN (0x01) +#define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40) +#define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10) +#define EXT_CSD_BOOT_WP_B_PERM_WP_EN (0x04) +#define EXT_CSD_BOOT_WP_B_PWR_WP_EN (0x01) -#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) -#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) -#define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3) -#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) +#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) +#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) +#define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3) +#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) -#define EXT_CSD_PART_SUPPORT_PART_EN (0x1) +#define EXT_CSD_PART_SUPPORT_PART_EN (0x1) -#define EXT_CSD_CMD_SET_NORMAL (1<<0) -#define EXT_CSD_CMD_SET_SECURE (1<<1) -#define EXT_CSD_CMD_SET_CPSECURE (1<<2) +#define EXT_CSD_CMD_SET_NORMAL (1<<0) +#define EXT_CSD_CMD_SET_SECURE (1<<1) +#define EXT_CSD_CMD_SET_CPSECURE (1<<2) -#define EXT_CSD_CARD_TYPE_HS_26 (1<<0) /* Card can run at 26MHz */ -#define EXT_CSD_CARD_TYPE_HS_52 (1<<1) /* Card can run at 52MHz */ -#define EXT_CSD_CARD_TYPE_HS (EXT_CSD_CARD_TYPE_HS_26 | \ +#define EXT_CSD_CARD_TYPE_HS_26 (1<<0) /* Card can run at 26MHz */ +#define EXT_CSD_CARD_TYPE_HS_52 (1<<1) /* Card can run at 52MHz */ +#define EXT_CSD_CARD_TYPE_HS (EXT_CSD_CARD_TYPE_HS_26 | \ EXT_CSD_CARD_TYPE_HS_52) #define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */ /* DDR mode @1.8V or 3V I/O */ #define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */ - /* DDR mode @1.2V I/O */ + /* DDR mode @1.2V I/O */ #define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \ | EXT_CSD_CARD_TYPE_DDR_1_2V) -#define EXT_CSD_CARD_TYPE_HS200_1_8V (1<<4) /* Card can run at 200MHz */ -#define EXT_CSD_CARD_TYPE_HS200_1_2V (1<<5) /* Card can run at 200MHz */ - /* SDR mode @1.2V I/O */ -#define EXT_CSD_CARD_TYPE_HS200 (EXT_CSD_CARD_TYPE_HS200_1_8V | \ - EXT_CSD_CARD_TYPE_HS200_1_2V) -#define EXT_CSD_CARD_TYPE_HS400_1_8V (1<<6) /* Card can run at 200MHz DDR, 1.8V */ -#define EXT_CSD_CARD_TYPE_HS400_1_2V (1<<7) /* Card can run at 200MHz DDR, 1.2V */ -#define EXT_CSD_CARD_TYPE_HS400 (EXT_CSD_CARD_TYPE_HS400_1_8V | \ - EXT_CSD_CARD_TYPE_HS400_1_2V) - -#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ -#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ -#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ -#define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */ -#define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */ - -#define EXT_CSD_TIMING_BC 0 /* Backwards compatility */ -#define EXT_CSD_TIMING_HS 1 /* High speed */ -#define EXT_CSD_TIMING_HS200 2 /* HS200 */ -#define EXT_CSD_TIMING_HS400 3 /* HS400 */ - -#define EXT_CSD_SEC_ER_EN BIT(0) -#define EXT_CSD_SEC_BD_BLK_EN BIT(2) -#define EXT_CSD_SEC_GB_CL_EN BIT(4) -#define EXT_CSD_SEC_SANITIZE BIT(6) /* v4.5 only */ - -#define EXT_CSD_RST_N_EN_MASK 0x3 -#define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */ - -#define EXT_CSD_NO_POWER_NOTIFICATION 0 -#define EXT_CSD_POWER_ON 1 -#define EXT_CSD_POWER_OFF_SHORT 2 -#define EXT_CSD_POWER_OFF_LONG 3 - -#define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */ -#define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ -#define EXT_CSD_PWR_CL_8BIT_SHIFT 4 -#define EXT_CSD_PWR_CL_4BIT_SHIFT 0 - -#define EXT_CSD_PACKED_EVENT_EN BIT(3) +#define EXT_CSD_CARD_TYPE_HS200_1_8V (1<<4) /* Card can run at 200MHz */ +#define EXT_CSD_CARD_TYPE_HS200_1_2V (1<<5) /* Card can run at 200MHz */ + /* SDR mode @1.2V I/O */ +#define EXT_CSD_CARD_TYPE_HS200 (EXT_CSD_CARD_TYPE_HS200_1_8V | \ + EXT_CSD_CARD_TYPE_HS200_1_2V) +#define EXT_CSD_CARD_TYPE_HS400_1_8V (1<<6) /* Card can run at 200MHz DDR, 1.8V */ +#define EXT_CSD_CARD_TYPE_HS400_1_2V (1<<7) /* Card can run at 200MHz DDR, 1.2V */ +#define EXT_CSD_CARD_TYPE_HS400 (EXT_CSD_CARD_TYPE_HS400_1_8V | \ + EXT_CSD_CARD_TYPE_HS400_1_2V) + +#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ +#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ +#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ +#define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */ +#define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */ + +#define EXT_CSD_TIMING_BC 0 /* Backwards compatility */ +#define EXT_CSD_TIMING_HS 1 /* High speed */ +#define EXT_CSD_TIMING_HS200 2 /* HS200 */ +#define EXT_CSD_TIMING_HS400 3 /* HS400 */ + +#define EXT_CSD_SEC_ER_EN BIT(0) +#define EXT_CSD_SEC_BD_BLK_EN BIT(2) +#define EXT_CSD_SEC_GB_CL_EN BIT(4) +#define EXT_CSD_SEC_SANITIZE BIT(6) /* v4.5 only */ + +#define EXT_CSD_RST_N_EN_MASK 0x3 +#define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */ + +#define EXT_CSD_NO_POWER_NOTIFICATION 0 +#define EXT_CSD_POWER_ON 1 +#define EXT_CSD_POWER_OFF_SHORT 2 +#define EXT_CSD_POWER_OFF_LONG 3 + +#define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */ +#define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ +#define EXT_CSD_PWR_CL_8BIT_SHIFT 4 +#define EXT_CSD_PWR_CL_4BIT_SHIFT 0 + +#define EXT_CSD_PACKED_EVENT_EN BIT(3) /* * EXCEPTION_EVENT_STATUS field */ -#define EXT_CSD_URGENT_BKOPS BIT(0) -#define EXT_CSD_DYNCAP_NEEDED BIT(1) -#define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2) -#define EXT_CSD_PACKED_FAILURE BIT(3) +#define EXT_CSD_URGENT_BKOPS BIT(0) +#define EXT_CSD_DYNCAP_NEEDED BIT(1) +#define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2) +#define EXT_CSD_PACKED_FAILURE BIT(3) -#define EXT_CSD_PACKED_GENERIC_ERROR BIT(0) -#define EXT_CSD_PACKED_INDEXED_ERROR BIT(1) +#define EXT_CSD_PACKED_GENERIC_ERROR BIT(0) +#define EXT_CSD_PACKED_INDEXED_ERROR BIT(1) /* * BKOPS status level */ -#define EXT_CSD_BKOPS_LEVEL_2 0x2 +#define EXT_CSD_BKOPS_LEVEL_2 0x2 /* * MMC_SWITCH access modes */ -#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */ -#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */ -#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ -#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ - +#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */ +#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */ +#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ +#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ + /* * extern function */ diff --git a/components/drivers/include/drivers/mmcsd_card.h b/components/drivers/include/drivers/mmcsd_card.h index 3ee5a20465..511cc1167d 100644 --- a/components/drivers/include/drivers/mmcsd_card.h +++ b/components/drivers/include/drivers/mmcsd_card.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: - * Date Author Notes - * 2011-07-25 weety first version + * Date Author Notes + * 2011-07-25 weety first version */ #ifndef __MMCSD_CARD_H__ @@ -17,87 +17,87 @@ extern "C" { #endif -#define SD_SCR_BUS_WIDTH_1 (1 << 0) -#define SD_SCR_BUS_WIDTH_4 (1 << 2) +#define SD_SCR_BUS_WIDTH_1 (1 << 0) +#define SD_SCR_BUS_WIDTH_4 (1 << 2) struct rt_mmcsd_cid { - rt_uint8_t mid; /* ManufacturerID */ - rt_uint8_t prv; /* Product Revision */ - rt_uint16_t oid; /* OEM/Application ID */ - rt_uint32_t psn; /* Product Serial Number */ - rt_uint8_t pnm[5]; /* Product Name */ - rt_uint8_t reserved1;/* reserved */ - rt_uint16_t mdt; /* Manufacturing Date */ - rt_uint8_t crc; /* CID CRC */ - rt_uint8_t reserved2;/* not used, always 1 */ + rt_uint8_t mid; /* ManufacturerID */ + rt_uint8_t prv; /* Product Revision */ + rt_uint16_t oid; /* OEM/Application ID */ + rt_uint32_t psn; /* Product Serial Number */ + rt_uint8_t pnm[5]; /* Product Name */ + rt_uint8_t reserved1;/* reserved */ + rt_uint16_t mdt; /* Manufacturing Date */ + rt_uint8_t crc; /* CID CRC */ + rt_uint8_t reserved2;/* not used, always 1 */ }; struct rt_mmcsd_csd { - rt_uint8_t csd_structure; /* CSD register version */ - rt_uint8_t taac; - rt_uint8_t nsac; - rt_uint8_t tran_speed; /* max data transfer rate */ - rt_uint16_t card_cmd_class; /* card command classes */ - rt_uint8_t rd_blk_len; /* max read data block length */ - rt_uint8_t rd_blk_part; - rt_uint8_t wr_blk_misalign; - rt_uint8_t rd_blk_misalign; - rt_uint8_t dsr_imp; /* DSR implemented */ - rt_uint8_t c_size_mult; /* CSD 1.0 , device size multiplier */ - rt_uint32_t c_size; /* device size */ - rt_uint8_t r2w_factor; - rt_uint8_t wr_blk_len; /* max wtire data block length */ - rt_uint8_t wr_blk_partial; - rt_uint8_t csd_crc; - + rt_uint8_t csd_structure; /* CSD register version */ + rt_uint8_t taac; + rt_uint8_t nsac; + rt_uint8_t tran_speed; /* max data transfer rate */ + rt_uint16_t card_cmd_class; /* card command classes */ + rt_uint8_t rd_blk_len; /* max read data block length */ + rt_uint8_t rd_blk_part; + rt_uint8_t wr_blk_misalign; + rt_uint8_t rd_blk_misalign; + rt_uint8_t dsr_imp; /* DSR implemented */ + rt_uint8_t c_size_mult; /* CSD 1.0 , device size multiplier */ + rt_uint32_t c_size; /* device size */ + rt_uint8_t r2w_factor; + rt_uint8_t wr_blk_len; /* max wtire data block length */ + rt_uint8_t wr_blk_partial; + rt_uint8_t csd_crc; + }; struct rt_sd_scr { - rt_uint8_t sd_version; - rt_uint8_t sd_bus_widths; + rt_uint8_t sd_version; + rt_uint8_t sd_bus_widths; }; struct rt_sdio_cccr { - rt_uint8_t sdio_version; - rt_uint8_t sd_version; - rt_uint8_t direct_cmd:1, /* Card Supports Direct Commands during data transfer - only SD mode, not used for SPI mode */ - multi_block:1, /* Card Supports Multi-Block */ - read_wait:1, /* Card Supports Read Wait - only SD mode, not used for SPI mode */ - suspend_resume:1, /* Card supports Suspend/Resume - only SD mode, not used for SPI mode */ - s4mi:1, /* generate interrupts during a 4-bit - multi-block data transfer */ - e4mi:1, /* Enable the multi-block IRQ during - 4-bit transfer for the SDIO card */ - low_speed:1, /* Card is a Low-Speed card */ - low_speed_4:1; /* 4-bit support for Low-Speed cards */ - - rt_uint8_t bus_width:1, /* Support SDIO bus width, 1:4bit, 0:1bit */ - cd_disable:1, /* Connect[0]/Disconnect[1] the 10K-90K ohm pull-up - resistor on CD/DAT[3] (pin 1) of the card */ - power_ctrl:1, /* Support Master Power Control */ - high_speed:1; /* Support High-Speed */ - - + rt_uint8_t sdio_version; + rt_uint8_t sd_version; + rt_uint8_t direct_cmd:1, /* Card Supports Direct Commands during data transfer + only SD mode, not used for SPI mode */ + multi_block:1, /* Card Supports Multi-Block */ + read_wait:1, /* Card Supports Read Wait + only SD mode, not used for SPI mode */ + suspend_resume:1, /* Card supports Suspend/Resume + only SD mode, not used for SPI mode */ + s4mi:1, /* generate interrupts during a 4-bit + multi-block data transfer */ + e4mi:1, /* Enable the multi-block IRQ during + 4-bit transfer for the SDIO card */ + low_speed:1, /* Card is a Low-Speed card */ + low_speed_4:1; /* 4-bit support for Low-Speed cards */ + + rt_uint8_t bus_width:1, /* Support SDIO bus width, 1:4bit, 0:1bit */ + cd_disable:1, /* Connect[0]/Disconnect[1] the 10K-90K ohm pull-up + resistor on CD/DAT[3] (pin 1) of the card */ + power_ctrl:1, /* Support Master Power Control */ + high_speed:1; /* Support High-Speed */ + + }; struct rt_sdio_cis { - rt_uint16_t manufacturer; - rt_uint16_t product; - rt_uint16_t func0_blk_size; - rt_uint32_t max_tran_speed; + rt_uint16_t manufacturer; + rt_uint16_t product; + rt_uint16_t func0_blk_size; + rt_uint32_t max_tran_speed; }; /* * SDIO function CIS tuple (unknown to the core) */ struct rt_sdio_function_tuple { - struct rt_sdio_function_tuple *next; - rt_uint8_t code; - rt_uint8_t size; - rt_uint8_t *data; + struct rt_sdio_function_tuple *next; + rt_uint8_t code; + rt_uint8_t size; + rt_uint8_t *data; }; struct rt_sdio_function; @@ -107,60 +107,60 @@ typedef void (rt_sdio_irq_handler_t)(struct rt_sdio_function *); * SDIO function devices */ struct rt_sdio_function { - struct rt_mmcsd_card *card; /* the card this device belongs to */ - rt_sdio_irq_handler_t *irq_handler; /* IRQ callback */ - rt_uint8_t num; /* function number */ + struct rt_mmcsd_card *card; /* the card this device belongs to */ + rt_sdio_irq_handler_t *irq_handler; /* IRQ callback */ + rt_uint8_t num; /* function number */ + + rt_uint8_t func_code; /* Standard SDIO Function interface code */ + rt_uint16_t manufacturer; /* manufacturer id */ + rt_uint16_t product; /* product id */ - rt_uint8_t func_code; /* Standard SDIO Function interface code */ - rt_uint16_t manufacturer; /* manufacturer id */ - rt_uint16_t product; /* product id */ + rt_uint32_t max_blk_size; /* maximum block size */ + rt_uint32_t cur_blk_size; /* current block size */ - rt_uint32_t max_blk_size; /* maximum block size */ - rt_uint32_t cur_blk_size; /* current block size */ + rt_uint32_t enable_timeout_val; /* max enable timeout in msec */ - rt_uint32_t enable_timeout_val; /* max enable timeout in msec */ + struct rt_sdio_function_tuple *tuples; - struct rt_sdio_function_tuple *tuples; - void *priv; }; -#define SDIO_MAX_FUNCTIONS 7 +#define SDIO_MAX_FUNCTIONS 7 struct rt_mmcsd_card { - struct rt_mmcsd_host *host; - rt_uint32_t rca; /* card addr */ - rt_uint32_t resp_cid[4]; /* card CID register */ - rt_uint32_t resp_csd[4]; /* card CSD register */ - rt_uint32_t resp_scr[2]; /* card SCR register */ - - rt_uint16_t tacc_clks; /* data access time by ns */ - rt_uint32_t tacc_ns; /* data access time by clk cycles */ - rt_uint32_t max_data_rate; /* max data transfer rate */ - rt_uint32_t card_capacity; /* card capacity, unit:KB */ - rt_uint32_t card_blksize; /* card block size */ - rt_uint32_t erase_size; /* erase size in sectors */ - rt_uint16_t card_type; + struct rt_mmcsd_host *host; + rt_uint32_t rca; /* card addr */ + rt_uint32_t resp_cid[4]; /* card CID register */ + rt_uint32_t resp_csd[4]; /* card CSD register */ + rt_uint32_t resp_scr[2]; /* card SCR register */ + + rt_uint16_t tacc_clks; /* data access time by ns */ + rt_uint32_t tacc_ns; /* data access time by clk cycles */ + rt_uint32_t max_data_rate; /* max data transfer rate */ + rt_uint32_t card_capacity; /* card capacity, unit:KB */ + rt_uint32_t card_blksize; /* card block size */ + rt_uint32_t erase_size; /* erase size in sectors */ + rt_uint16_t card_type; #define CARD_TYPE_MMC 0 /* MMC card */ #define CARD_TYPE_SD 1 /* SD card */ #define CARD_TYPE_SDIO 2 /* SDIO card */ #define CARD_TYPE_SDIO_COMBO 3 /* SD combo (IO+mem) card */ - rt_uint16_t flags; + rt_uint16_t flags; #define CARD_FLAG_HIGHSPEED (1 << 0) /* SDIO bus speed 50MHz */ #define CARD_FLAG_SDHC (1 << 1) /* SDHC card */ #define CARD_FLAG_SDXC (1 << 2) /* SDXC card */ - struct rt_sd_scr scr; - struct rt_mmcsd_csd csd; - rt_uint32_t hs_max_data_rate; /* max data transfer rate in high speed mode */ + struct rt_sd_scr scr; + struct rt_mmcsd_csd csd; + rt_uint32_t hs_max_data_rate; /* max data transfer rate in high speed mode */ - rt_uint8_t sdio_function_num; /* totol number of SDIO functions */ - struct rt_sdio_cccr cccr; /* common card info */ - struct rt_sdio_cis cis; /* common tuple info */ - struct rt_sdio_function *sdio_function[SDIO_MAX_FUNCTIONS + 1]; /* SDIO functions (devices) */ + rt_uint8_t sdio_function_num; /* totol number of SDIO functions */ + struct rt_sdio_cccr cccr; /* common card info */ + struct rt_sdio_cis cis; /* common tuple info */ + struct rt_sdio_function *sdio_function[SDIO_MAX_FUNCTIONS + 1]; /* SDIO functions (devices) */ }; diff --git a/components/drivers/include/drivers/mmcsd_cmd.h b/components/drivers/include/drivers/mmcsd_cmd.h index 7c2f26e892..2993fe5406 100644 --- a/components/drivers/include/drivers/mmcsd_cmd.h +++ b/components/drivers/include/drivers/mmcsd_cmd.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: - * Date Author Notes - * 2011-07-25 weety first version + * Date Author Notes + * 2011-07-25 weety first version */ #ifndef __CMD_H__ @@ -85,9 +85,9 @@ extern "C" { #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ #define SD_APP_SEND_SCR 51 /* adtc R1 */ -#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ -#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ -#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ +#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ +#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ +#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ /* SDIO commands type argument response */ diff --git a/components/drivers/include/drivers/mmcsd_core.h b/components/drivers/include/drivers/mmcsd_core.h index 05a5af6d79..11b1386b23 100644 --- a/components/drivers/include/drivers/mmcsd_core.h +++ b/components/drivers/include/drivers/mmcsd_core.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: - * Date Author Notes - * 2011-07-25 weety first version + * Date Author Notes + * 2011-07-25 weety first version */ #ifndef __CORE_H__ @@ -27,139 +27,139 @@ extern "C" { #endif struct rt_mmcsd_data { - rt_uint32_t blksize; - rt_uint32_t blks; - rt_uint32_t *buf; - rt_int32_t err; - rt_uint32_t flags; -#define DATA_DIR_WRITE (1 << 0) -#define DATA_DIR_READ (1 << 1) -#define DATA_STREAM (1 << 2) - - unsigned int bytes_xfered; - - struct rt_mmcsd_cmd *stop; /* stop command */ - struct rt_mmcsd_req *mrq; /* associated request */ - - rt_uint32_t timeout_ns; - rt_uint32_t timeout_clks; + rt_uint32_t blksize; + rt_uint32_t blks; + rt_uint32_t *buf; + rt_int32_t err; + rt_uint32_t flags; +#define DATA_DIR_WRITE (1 << 0) +#define DATA_DIR_READ (1 << 1) +#define DATA_STREAM (1 << 2) + + unsigned int bytes_xfered; + + struct rt_mmcsd_cmd *stop; /* stop command */ + struct rt_mmcsd_req *mrq; /* associated request */ + + rt_uint32_t timeout_ns; + rt_uint32_t timeout_clks; }; struct rt_mmcsd_cmd { - rt_uint32_t cmd_code; - rt_uint32_t arg; - rt_uint32_t resp[4]; - rt_uint32_t flags; -/*rsponse types + rt_uint32_t cmd_code; + rt_uint32_t arg; + rt_uint32_t resp[4]; + rt_uint32_t flags; +/*rsponse types *bits:0~3 */ -#define RESP_MASK (0xF) -#define RESP_NONE (0) -#define RESP_R1 (1 << 0) -#define RESP_R1B (2 << 0) -#define RESP_R2 (3 << 0) -#define RESP_R3 (4 << 0) -#define RESP_R4 (5 << 0) -#define RESP_R6 (6 << 0) -#define RESP_R7 (7 << 0) -#define RESP_R5 (8 << 0) /*SDIO command response type*/ -/*command types +#define RESP_MASK (0xF) +#define RESP_NONE (0) +#define RESP_R1 (1 << 0) +#define RESP_R1B (2 << 0) +#define RESP_R2 (3 << 0) +#define RESP_R3 (4 << 0) +#define RESP_R4 (5 << 0) +#define RESP_R6 (6 << 0) +#define RESP_R7 (7 << 0) +#define RESP_R5 (8 << 0) /*SDIO command response type*/ +/*command types *bits:4~5 */ -#define CMD_MASK (3 << 4) /* command type */ -#define CMD_AC (0 << 4) -#define CMD_ADTC (1 << 4) -#define CMD_BC (2 << 4) -#define CMD_BCR (3 << 4) +#define CMD_MASK (3 << 4) /* command type */ +#define CMD_AC (0 << 4) +#define CMD_ADTC (1 << 4) +#define CMD_BC (2 << 4) +#define CMD_BCR (3 << 4) -#define resp_type(cmd) ((cmd)->flags & RESP_MASK) +#define resp_type(cmd) ((cmd)->flags & RESP_MASK) -/*spi rsponse types +/*spi rsponse types *bits:6~8 */ -#define RESP_SPI_MASK (0x7 << 6) -#define RESP_SPI_R1 (1 << 6) -#define RESP_SPI_R1B (2 << 6) -#define RESP_SPI_R2 (3 << 6) -#define RESP_SPI_R3 (4 << 6) -#define RESP_SPI_R4 (5 << 6) -#define RESP_SPI_R5 (6 << 6) -#define RESP_SPI_R7 (7 << 6) - -#define spi_resp_type(cmd) ((cmd)->flags & RESP_SPI_MASK) +#define RESP_SPI_MASK (0x7 << 6) +#define RESP_SPI_R1 (1 << 6) +#define RESP_SPI_R1B (2 << 6) +#define RESP_SPI_R2 (3 << 6) +#define RESP_SPI_R3 (4 << 6) +#define RESP_SPI_R4 (5 << 6) +#define RESP_SPI_R5 (6 << 6) +#define RESP_SPI_R7 (7 << 6) + +#define spi_resp_type(cmd) ((cmd)->flags & RESP_SPI_MASK) /* * These are the command types. */ -#define cmd_type(cmd) ((cmd)->flags & CMD_MASK) - - rt_int32_t retries; /* max number of retries */ - rt_int32_t err; +#define cmd_type(cmd) ((cmd)->flags & CMD_MASK) - struct rt_mmcsd_data *data; - struct rt_mmcsd_req *mrq; /* associated request */ + rt_int32_t retries; /* max number of retries */ + rt_int32_t err; + + struct rt_mmcsd_data *data; + struct rt_mmcsd_req *mrq; /* associated request */ }; struct rt_mmcsd_req { - struct rt_mmcsd_data *data; - struct rt_mmcsd_cmd *cmd; - struct rt_mmcsd_cmd *stop; + struct rt_mmcsd_data *data; + struct rt_mmcsd_cmd *cmd; + struct rt_mmcsd_cmd *stop; }; /*the following is response bit*/ -#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ -#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ -#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ -#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ -#define R1_ERASE_PARAM (1 << 27) /* ex, c */ -#define R1_WP_VIOLATION (1 << 26) /* erx, c */ -#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ -#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ -#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ -#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ -#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ -#define R1_CC_ERROR (1 << 20) /* erx, c */ -#define R1_ERROR (1 << 19) /* erx, c */ -#define R1_UNDERRUN (1 << 18) /* ex, c */ -#define R1_OVERRUN (1 << 17) /* ex, c */ -#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ -#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ -#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ -#define R1_ERASE_RESET (1 << 13) /* sr, c */ +#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ +#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ +#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ +#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ +#define R1_ERASE_PARAM (1 << 27) /* ex, c */ +#define R1_WP_VIOLATION (1 << 26) /* erx, c */ +#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ +#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ +#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ +#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ +#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ +#define R1_CC_ERROR (1 << 20) /* erx, c */ +#define R1_ERROR (1 << 19) /* erx, c */ +#define R1_UNDERRUN (1 << 18) /* ex, c */ +#define R1_OVERRUN (1 << 17) /* ex, c */ +#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ +#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ +#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ +#define R1_ERASE_RESET (1 << 13) /* sr, c */ #define R1_STATUS(x) (x & 0xFFFFE000) -#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ -#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ -#define R1_APP_CMD (1 << 5) /* sr, c */ - - -#define R1_SPI_IDLE (1 << 0) -#define R1_SPI_ERASE_RESET (1 << 1) -#define R1_SPI_ILLEGAL_COMMAND (1 << 2) -#define R1_SPI_COM_CRC (1 << 3) -#define R1_SPI_ERASE_SEQ (1 << 4) -#define R1_SPI_ADDRESS (1 << 5) -#define R1_SPI_PARAMETER (1 << 6) +#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ +#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ +#define R1_APP_CMD (1 << 5) /* sr, c */ + + +#define R1_SPI_IDLE (1 << 0) +#define R1_SPI_ERASE_RESET (1 << 1) +#define R1_SPI_ILLEGAL_COMMAND (1 << 2) +#define R1_SPI_COM_CRC (1 << 3) +#define R1_SPI_ERASE_SEQ (1 << 4) +#define R1_SPI_ADDRESS (1 << 5) +#define R1_SPI_PARAMETER (1 << 6) /* R1 bit 7 is always zero */ -#define R2_SPI_CARD_LOCKED (1 << 8) -#define R2_SPI_WP_ERASE_SKIP (1 << 9) /* or lock/unlock fail */ -#define R2_SPI_LOCK_UNLOCK_FAIL R2_SPI_WP_ERASE_SKIP -#define R2_SPI_ERROR (1 << 10) -#define R2_SPI_CC_ERROR (1 << 11) -#define R2_SPI_CARD_ECC_ERROR (1 << 12) -#define R2_SPI_WP_VIOLATION (1 << 13) -#define R2_SPI_ERASE_PARAM (1 << 14) -#define R2_SPI_OUT_OF_RANGE (1 << 15) /* or CSD overwrite */ -#define R2_SPI_CSD_OVERWRITE R2_SPI_OUT_OF_RANGE - -#define CARD_BUSY 0x80000000 /* Card Power up status bit */ +#define R2_SPI_CARD_LOCKED (1 << 8) +#define R2_SPI_WP_ERASE_SKIP (1 << 9) /* or lock/unlock fail */ +#define R2_SPI_LOCK_UNLOCK_FAIL R2_SPI_WP_ERASE_SKIP +#define R2_SPI_ERROR (1 << 10) +#define R2_SPI_CC_ERROR (1 << 11) +#define R2_SPI_CARD_ECC_ERROR (1 << 12) +#define R2_SPI_WP_VIOLATION (1 << 13) +#define R2_SPI_ERASE_PARAM (1 << 14) +#define R2_SPI_OUT_OF_RANGE (1 << 15) /* or CSD overwrite */ +#define R2_SPI_CSD_OVERWRITE R2_SPI_OUT_OF_RANGE + +#define CARD_BUSY 0x80000000 /* Card Power up status bit */ /* R5 response bits */ -#define R5_COM_CRC_ERROR (1 << 15) -#define R5_ILLEGAL_COMMAND (1 << 14) -#define R5_ERROR (1 << 11) -#define R5_FUNCTION_NUMBER (1 << 9) -#define R5_OUT_OF_RANGE (1 << 8) -#define R5_STATUS(x) (x & 0xCB00) -#define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12) +#define R5_COM_CRC_ERROR (1 << 15) +#define R5_ILLEGAL_COMMAND (1 << 14) +#define R5_ERROR (1 << 11) +#define R5_FUNCTION_NUMBER (1 << 9) +#define R5_OUT_OF_RANGE (1 << 8) +#define R5_STATUS(x) (x & 0xCB00) +#define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12) @@ -173,36 +173,36 @@ struct rt_mmcsd_req { rt_inline rt_uint32_t __rt_fls(rt_uint32_t val) { - rt_uint32_t bit = 32; - - if (!val) - return 0; - if (!(val & 0xffff0000u)) - { - val <<= 16; - bit -= 16; - } - if (!(val & 0xff000000u)) - { - val <<= 8; - bit -= 8; - } - if (!(val & 0xf0000000u)) - { - val <<= 4; - bit -= 4; - } - if (!(val & 0xc0000000u)) - { - val <<= 2; - bit -= 2; - } - if (!(val & 0x80000000u)) - { - bit -= 1; - } - - return bit; + rt_uint32_t bit = 32; + + if (!val) + return 0; + if (!(val & 0xffff0000u)) + { + val <<= 16; + bit -= 16; + } + if (!(val & 0xff000000u)) + { + val <<= 8; + bit -= 8; + } + if (!(val & 0xf0000000u)) + { + val <<= 4; + bit -= 4; + } + if (!(val & 0xc0000000u)) + { + val <<= 2; + bit -= 2; + } + if (!(val & 0x80000000u)) + { + bit -= 1; + } + + return bit; } #define MMCSD_HOST_PLUGED 0 diff --git a/components/drivers/include/drivers/mmcsd_host.h b/components/drivers/include/drivers/mmcsd_host.h index 1253062aef..c7f673aeb1 100644 --- a/components/drivers/include/drivers/mmcsd_host.h +++ b/components/drivers/include/drivers/mmcsd_host.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: - * Date Author Notes - * 2011-07-25 weety first version + * Date Author Notes + * 2011-07-25 weety first version */ #ifndef __HOST_H__ @@ -18,33 +18,33 @@ extern "C" { #endif struct rt_mmcsd_io_cfg { - rt_uint32_t clock; /* clock rate */ - rt_uint16_t vdd; + rt_uint32_t clock; /* clock rate */ + rt_uint16_t vdd; /* vdd stores the bit number of the selected voltage range from below. */ - rt_uint8_t bus_mode; /* command output mode */ + rt_uint8_t bus_mode; /* command output mode */ -#define MMCSD_BUSMODE_OPENDRAIN 1 -#define MMCSD_BUSMODE_PUSHPULL 2 +#define MMCSD_BUSMODE_OPENDRAIN 1 +#define MMCSD_BUSMODE_PUSHPULL 2 - rt_uint8_t chip_select; /* SPI chip select */ + rt_uint8_t chip_select; /* SPI chip select */ -#define MMCSD_CS_IGNORE 0 -#define MMCSD_CS_HIGH 1 -#define MMCSD_CS_LOW 2 +#define MMCSD_CS_IGNORE 0 +#define MMCSD_CS_HIGH 1 +#define MMCSD_CS_LOW 2 - rt_uint8_t power_mode; /* power supply mode */ + rt_uint8_t power_mode; /* power supply mode */ -#define MMCSD_POWER_OFF 0 -#define MMCSD_POWER_UP 1 -#define MMCSD_POWER_ON 2 +#define MMCSD_POWER_OFF 0 +#define MMCSD_POWER_UP 1 +#define MMCSD_POWER_ON 2 - rt_uint8_t bus_width; /* data bus width */ + rt_uint8_t bus_width; /* data bus width */ -#define MMCSD_BUS_WIDTH_1 0 -#define MMCSD_BUS_WIDTH_4 2 -#define MMCSD_BUS_WIDTH_8 3 +#define MMCSD_BUS_WIDTH_1 0 +#define MMCSD_BUS_WIDTH_4 2 +#define MMCSD_BUS_WIDTH_8 3 }; @@ -52,71 +52,71 @@ struct rt_mmcsd_host; struct rt_mmcsd_req; struct rt_mmcsd_host_ops { - void (*request)(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req); - void (*set_iocfg)(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cfg *io_cfg); - rt_int32_t (*get_card_status)(struct rt_mmcsd_host *host); - void (*enable_sdio_irq)(struct rt_mmcsd_host *host, rt_int32_t en); + void (*request)(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req); + void (*set_iocfg)(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cfg *io_cfg); + rt_int32_t (*get_card_status)(struct rt_mmcsd_host *host); + void (*enable_sdio_irq)(struct rt_mmcsd_host *host, rt_int32_t en); }; struct rt_mmcsd_host { - struct rt_mmcsd_card *card; - const struct rt_mmcsd_host_ops *ops; - rt_uint32_t freq_min; - rt_uint32_t freq_max; - struct rt_mmcsd_io_cfg io_cfg; - rt_uint32_t valid_ocr; /* current valid OCR */ -#define VDD_165_195 (1 << 7) /* VDD voltage 1.65 - 1.95 */ -#define VDD_20_21 (1 << 8) /* VDD voltage 2.0 ~ 2.1 */ -#define VDD_21_22 (1 << 9) /* VDD voltage 2.1 ~ 2.2 */ -#define VDD_22_23 (1 << 10) /* VDD voltage 2.2 ~ 2.3 */ -#define VDD_23_24 (1 << 11) /* VDD voltage 2.3 ~ 2.4 */ -#define VDD_24_25 (1 << 12) /* VDD voltage 2.4 ~ 2.5 */ -#define VDD_25_26 (1 << 13) /* VDD voltage 2.5 ~ 2.6 */ -#define VDD_26_27 (1 << 14) /* VDD voltage 2.6 ~ 2.7 */ -#define VDD_27_28 (1 << 15) /* VDD voltage 2.7 ~ 2.8 */ -#define VDD_28_29 (1 << 16) /* VDD voltage 2.8 ~ 2.9 */ -#define VDD_29_30 (1 << 17) /* VDD voltage 2.9 ~ 3.0 */ -#define VDD_30_31 (1 << 18) /* VDD voltage 3.0 ~ 3.1 */ -#define VDD_31_32 (1 << 19) /* VDD voltage 3.1 ~ 3.2 */ -#define VDD_32_33 (1 << 20) /* VDD voltage 3.2 ~ 3.3 */ -#define VDD_33_34 (1 << 21) /* VDD voltage 3.3 ~ 3.4 */ -#define VDD_34_35 (1 << 22) /* VDD voltage 3.4 ~ 3.5 */ -#define VDD_35_36 (1 << 23) /* VDD voltage 3.5 ~ 3.6 */ - rt_uint32_t flags; /* define device capabilities */ -#define MMCSD_BUSWIDTH_4 (1 << 0) -#define MMCSD_BUSWIDTH_8 (1 << 1) -#define MMCSD_MUTBLKWRITE (1 << 2) -#define MMCSD_HOST_IS_SPI (1 << 3) -#define controller_is_spi(host) (host->flags & MMCSD_HOST_IS_SPI) -#define MMCSD_SUP_SDIO_IRQ (1 << 4) /* support signal pending SDIO IRQs */ -#define MMCSD_SUP_HIGHSPEED (1 << 5) /* support high speed */ - - rt_uint32_t max_seg_size; /* maximum size of one dma segment */ - rt_uint32_t max_dma_segs; /* maximum number of dma segments in one request */ - rt_uint32_t max_blk_size; /* maximum block size */ - rt_uint32_t max_blk_count; /* maximum block count */ - - rt_uint32_t spi_use_crc; - struct rt_mutex bus_lock; - struct rt_semaphore sem_ack; - - rt_uint32_t sdio_irq_num; - struct rt_semaphore *sdio_irq_sem; - struct rt_thread *sdio_irq_thread; - - void *private_data; + struct rt_mmcsd_card *card; + const struct rt_mmcsd_host_ops *ops; + rt_uint32_t freq_min; + rt_uint32_t freq_max; + struct rt_mmcsd_io_cfg io_cfg; + rt_uint32_t valid_ocr; /* current valid OCR */ +#define VDD_165_195 (1 << 7) /* VDD voltage 1.65 - 1.95 */ +#define VDD_20_21 (1 << 8) /* VDD voltage 2.0 ~ 2.1 */ +#define VDD_21_22 (1 << 9) /* VDD voltage 2.1 ~ 2.2 */ +#define VDD_22_23 (1 << 10) /* VDD voltage 2.2 ~ 2.3 */ +#define VDD_23_24 (1 << 11) /* VDD voltage 2.3 ~ 2.4 */ +#define VDD_24_25 (1 << 12) /* VDD voltage 2.4 ~ 2.5 */ +#define VDD_25_26 (1 << 13) /* VDD voltage 2.5 ~ 2.6 */ +#define VDD_26_27 (1 << 14) /* VDD voltage 2.6 ~ 2.7 */ +#define VDD_27_28 (1 << 15) /* VDD voltage 2.7 ~ 2.8 */ +#define VDD_28_29 (1 << 16) /* VDD voltage 2.8 ~ 2.9 */ +#define VDD_29_30 (1 << 17) /* VDD voltage 2.9 ~ 3.0 */ +#define VDD_30_31 (1 << 18) /* VDD voltage 3.0 ~ 3.1 */ +#define VDD_31_32 (1 << 19) /* VDD voltage 3.1 ~ 3.2 */ +#define VDD_32_33 (1 << 20) /* VDD voltage 3.2 ~ 3.3 */ +#define VDD_33_34 (1 << 21) /* VDD voltage 3.3 ~ 3.4 */ +#define VDD_34_35 (1 << 22) /* VDD voltage 3.4 ~ 3.5 */ +#define VDD_35_36 (1 << 23) /* VDD voltage 3.5 ~ 3.6 */ + rt_uint32_t flags; /* define device capabilities */ +#define MMCSD_BUSWIDTH_4 (1 << 0) +#define MMCSD_BUSWIDTH_8 (1 << 1) +#define MMCSD_MUTBLKWRITE (1 << 2) +#define MMCSD_HOST_IS_SPI (1 << 3) +#define controller_is_spi(host) (host->flags & MMCSD_HOST_IS_SPI) +#define MMCSD_SUP_SDIO_IRQ (1 << 4) /* support signal pending SDIO IRQs */ +#define MMCSD_SUP_HIGHSPEED (1 << 5) /* support high speed */ + + rt_uint32_t max_seg_size; /* maximum size of one dma segment */ + rt_uint32_t max_dma_segs; /* maximum number of dma segments in one request */ + rt_uint32_t max_blk_size; /* maximum block size */ + rt_uint32_t max_blk_count; /* maximum block count */ + + rt_uint32_t spi_use_crc; + struct rt_mutex bus_lock; + struct rt_semaphore sem_ack; + + rt_uint32_t sdio_irq_num; + struct rt_semaphore *sdio_irq_sem; + struct rt_thread *sdio_irq_thread; + + void *private_data; }; rt_inline void mmcsd_delay_ms(rt_uint32_t ms) { - if (ms < 1000 / RT_TICK_PER_SECOND) - { - rt_thread_delay(1); - } - else - { - rt_thread_delay(ms/(1000 / RT_TICK_PER_SECOND)); - } + if (ms < 1000 / RT_TICK_PER_SECOND) + { + rt_thread_delay(1); + } + else + { + rt_thread_delay(ms/(1000 / RT_TICK_PER_SECOND)); + } } #ifdef __cplusplus diff --git a/components/drivers/include/drivers/mtd_nand.h b/components/drivers/include/drivers/mtd_nand.h index f7675aede6..a452da61dd 100644 --- a/components/drivers/include/drivers/mtd_nand.h +++ b/components/drivers/include/drivers/mtd_nand.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/mtd_nor.h b/components/drivers/include/drivers/mtd_nor.h index 32a952f374..5573c54920 100644 --- a/components/drivers/include/drivers/mtd_nor.h +++ b/components/drivers/include/drivers/mtd_nor.h @@ -1,11 +1,11 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2012-5-30 Bernard the first version + * 2012-5-30 Bernard the first version */ #ifndef __MTD_NOR_H__ @@ -14,54 +14,54 @@ #include struct rt_mtd_nor_driver_ops; -#define RT_MTD_NOR_DEVICE(device) ((struct rt_mtd_nor_device*)(device)) +#define RT_MTD_NOR_DEVICE(device) ((struct rt_mtd_nor_device*)(device)) struct rt_mtd_nor_device { - struct rt_device parent; + struct rt_device parent; - rt_uint32_t block_size; /* The Block size in the flash */ - rt_uint32_t block_start; /* The start of available block*/ - rt_uint32_t block_end; /* The end of available block */ + rt_uint32_t block_size; /* The Block size in the flash */ + rt_uint32_t block_start; /* The start of available block*/ + rt_uint32_t block_end; /* The end of available block */ - /* operations interface */ - const struct rt_mtd_nor_driver_ops* ops; + /* operations interface */ + const struct rt_mtd_nor_driver_ops* ops; }; struct rt_mtd_nor_driver_ops { - rt_err_t (*read_id) (struct rt_mtd_nor_device* device); + rt_err_t (*read_id) (struct rt_mtd_nor_device* device); - rt_size_t (*read) (struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_uint32_t length); - rt_size_t (*write) (struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length); + rt_size_t (*read) (struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_uint32_t length); + rt_size_t (*write) (struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length); - rt_err_t (*erase_block)(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint32_t length); + rt_err_t (*erase_block)(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint32_t length); }; rt_err_t rt_mtd_nor_register_device(const char* name, struct rt_mtd_nor_device* device); rt_inline rt_uint32_t rt_mtd_nor_read_id(struct rt_mtd_nor_device* device) { - return device->ops->read_id(device); + return device->ops->read_id(device); } rt_inline rt_size_t rt_mtd_nor_read( - struct rt_mtd_nor_device* device, - rt_off_t offset, rt_uint8_t* data, rt_uint32_t length) + struct rt_mtd_nor_device* device, + rt_off_t offset, rt_uint8_t* data, rt_uint32_t length) { - return device->ops->read(device, offset, data, length); + return device->ops->read(device, offset, data, length); } rt_inline rt_size_t rt_mtd_nor_write( - struct rt_mtd_nor_device* device, - rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length) + struct rt_mtd_nor_device* device, + rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length) { - return device->ops->write(device, offset, data, length); + return device->ops->write(device, offset, data, length); } rt_inline rt_err_t rt_mtd_nor_erase_block(struct rt_mtd_nor_device* device, rt_off_t offset, rt_size_t length) { - return device->ops->erase_block(device, offset, length); + return device->ops->erase_block(device, offset, length); } #endif diff --git a/components/drivers/include/drivers/phy.h b/components/drivers/include/drivers/phy.h index 2d1ad9f91f..e1783fe328 100644 --- a/components/drivers/include/drivers/phy.h +++ b/components/drivers/include/drivers/phy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/phy_mdio.h b/components/drivers/include/drivers/phy_mdio.h index d978ec2984..fdef455db2 100644 --- a/components/drivers/include/drivers/phy_mdio.h +++ b/components/drivers/include/drivers/phy_mdio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/pin.h b/components/drivers/include/drivers/pin.h index f5b2ded9f6..5ba1e6c8ea 100644 --- a/components/drivers/include/drivers/pin.h +++ b/components/drivers/include/drivers/pin.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/pm.h b/components/drivers/include/drivers/pm.h index f28283dcf8..51bff54ebb 100644 --- a/components/drivers/include/drivers/pm.h +++ b/components/drivers/include/drivers/pm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/pulse_encoder.h b/components/drivers/include/drivers/pulse_encoder.h index 0c7df04cd6..38ef7652b9 100644 --- a/components/drivers/include/drivers/pulse_encoder.h +++ b/components/drivers/include/drivers/pulse_encoder.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/rt_drv_pwm.h b/components/drivers/include/drivers/rt_drv_pwm.h index 7a8e17b916..72e34428e6 100644 --- a/components/drivers/include/drivers/rt_drv_pwm.h +++ b/components/drivers/include/drivers/rt_drv_pwm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/rt_inputcapture.h b/components/drivers/include/drivers/rt_inputcapture.h index 40cd55883d..813ed3157b 100644 --- a/components/drivers/include/drivers/rt_inputcapture.h +++ b/components/drivers/include/drivers/rt_inputcapture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/rtc.h b/components/drivers/include/drivers/rtc.h index 1cd88a7be3..4845937113 100644 --- a/components/drivers/include/drivers/rtc.h +++ b/components/drivers/include/drivers/rtc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/sd.h b/components/drivers/include/drivers/sd.h index e096df9372..450f23e65b 100644 --- a/components/drivers/include/drivers/sd.h +++ b/components/drivers/include/drivers/sd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/drivers/sdio.h b/components/drivers/include/drivers/sdio.h index e4bf4a048f..212d8cfb52 100644 --- a/components/drivers/include/drivers/sdio.h +++ b/components/drivers/include/drivers/sdio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -174,10 +174,10 @@ rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_int32_t op_code, rt_uint8_t *buf, rt_uint32_t len); -rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, +rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, rt_uint32_t reg, rt_int32_t *err); -rt_int32_t sdio_io_writeb(struct rt_sdio_function *func, +rt_int32_t sdio_io_writeb(struct rt_sdio_function *func, rt_uint32_t reg, rt_uint8_t data); rt_uint16_t sdio_io_readw(struct rt_sdio_function *func, @@ -192,19 +192,19 @@ rt_uint32_t sdio_io_readl(struct rt_sdio_function *func, rt_int32_t sdio_io_writel(struct rt_sdio_function *func, rt_uint32_t data, rt_uint32_t addr); -rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len); -rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len); -rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len); -rt_int32_t sdio_io_write_multi_incr_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_write_multi_incr_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len); diff --git a/components/drivers/include/drivers/sdio_func_ids.h b/components/drivers/include/drivers/sdio_func_ids.h index 79085a5933..76502ff6ea 100644 --- a/components/drivers/include/drivers/sdio_func_ids.h +++ b/components/drivers/include/drivers/sdio_func_ids.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -7,7 +7,7 @@ * Date Author Notes * 2012-02-26 weety first version */ - + #ifndef __SDIO_FUNC_IDS_H__ #define __SDIO_FUNC_IDS_H__ diff --git a/components/drivers/include/drivers/serial.h b/components/drivers/include/drivers/serial.h index 45095af63f..c2e951e9b1 100644 --- a/components/drivers/include/drivers/serial.h +++ b/components/drivers/include/drivers/serial.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -104,7 +104,7 @@ struct serial_configure }; /* - * Serial FIFO mode + * Serial FIFO mode */ struct rt_serial_rx_fifo { @@ -121,7 +121,7 @@ struct rt_serial_tx_fifo struct rt_completion completion; }; -/* +/* * Serial DMA mode */ struct rt_serial_rx_dma diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h index d92518cd94..018d12139b 100644 --- a/components/drivers/include/drivers/spi.h +++ b/components/drivers/include/drivers/spi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -151,7 +151,7 @@ struct rt_qspi_configuration }; struct rt_qspi_device -{ +{ struct rt_spi_device parent; struct rt_qspi_configuration config; diff --git a/components/drivers/include/drivers/usb_common.h b/components/drivers/include/drivers/usb_common.h index 4d85a85e35..9c29a0d0df 100644 --- a/components/drivers/include/drivers/usb_common.h +++ b/components/drivers/include/drivers/usb_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -427,14 +427,14 @@ struct usb_os_proerty }; typedef struct usb_os_proerty * usb_os_proerty_t; -// Value Description -// 1 A NULL-terminated Unicode String (REG_SZ) -// 2 A NULL-terminated Unicode String that includes environment variables (REG_EXPAND_SZ) -// 3 Free-form binary (REG_BINARY) -// 4 A little-endian 32-bit integer (REG_DWORD_LITTLE_ENDIAN) -// 5 A big-endian 32-bit integer (REG_DWORD_BIG_ENDIAN) -// 6 A NULL-terminated Unicode string that contains a symbolic link (REG_LINK) -// 7 Multiple NULL-terminated Unicode strings (REG_MULTI_SZ) +// Value Description +// 1 A NULL-terminated Unicode String (REG_SZ) +// 2 A NULL-terminated Unicode String that includes environment variables (REG_EXPAND_SZ) +// 3 Free-form binary (REG_BINARY) +// 4 A little-endian 32-bit integer (REG_DWORD_LITTLE_ENDIAN) +// 5 A big-endian 32-bit integer (REG_DWORD_BIG_ENDIAN) +// 6 A NULL-terminated Unicode string that contains a symbolic link (REG_LINK) +// 7 Multiple NULL-terminated Unicode strings (REG_MULTI_SZ) #define USB_OS_PROPERTY_TYPE_REG_SZ 0x01UL #define USB_OS_PROPERTY_TYPE_REG_EXPAND_SZ 0x02UL #define USB_OS_PROPERTY_TYPE_REG_BINARY 0x03UL diff --git a/components/drivers/include/drivers/usb_device.h b/components/drivers/include/drivers/usb_device.h index 26f0c4cf4a..1e76477dbc 100644 --- a/components/drivers/include/drivers/usb_device.h +++ b/components/drivers/include/drivers/usb_device.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -62,12 +62,12 @@ struct ufunction; struct udevice; struct uendpoint; -typedef enum +typedef enum { /* request to read full count */ UIO_REQUEST_READ_FULL, /* request to read any count */ - UIO_REQUEST_READ_BEST, + UIO_REQUEST_READ_BEST, /* request to write full count */ UIO_REQUEST_WRITE, }UIO_REQUEST_TYPE; @@ -85,7 +85,7 @@ struct udcd_ops rt_size_t (*ep_write)(rt_uint8_t address, void *buffer, rt_size_t size); rt_err_t (*ep0_send_status)(void); rt_err_t (*suspend)(void); - rt_err_t (*wakeup)(void); + rt_err_t (*wakeup)(void); }; struct ep_id @@ -215,10 +215,10 @@ enum udev_msg_type USB_MSG_SETUP_NOTIFY, USB_MSG_DATA_NOTIFY, USB_MSG_EP0_OUT, - USB_MSG_EP_CLEAR_FEATURE, + USB_MSG_EP_CLEAR_FEATURE, USB_MSG_SOF, USB_MSG_RESET, - USB_MSG_PLUG_IN, + USB_MSG_PLUG_IN, /* we don't need to add a "PLUG_IN" event because after the cable is * plugged in(before any SETUP) the classed have nothing to do. If the host * is ready, it will send RESET and we will have USB_MSG_RESET. So, a RESET @@ -279,7 +279,7 @@ uintf_t rt_usbd_find_interface(udevice_t device, rt_uint8_t value, ufunction_t * uep_t rt_usbd_find_endpoint(udevice_t device, ufunction_t* pfunc, rt_uint8_t ep_addr); rt_size_t rt_usbd_io_request(udevice_t device, uep_t ep, uio_request_t req); rt_size_t rt_usbd_ep0_write(udevice_t device, void *buffer, rt_size_t size); -rt_size_t rt_usbd_ep0_read(udevice_t device, void *buffer, rt_size_t size, +rt_size_t rt_usbd_ep0_read(udevice_t device, void *buffer, rt_size_t size, rt_err_t (*rx_ind)(udevice_t device, rt_size_t size)); int rt_usbd_vcom_class_register(void); @@ -396,7 +396,7 @@ rt_inline rt_err_t dcd_ep0_send_status(udcd_t dcd) } rt_inline rt_err_t dcd_ep_set_stall(udcd_t dcd, rt_uint8_t address) -{ +{ RT_ASSERT(dcd != RT_NULL); RT_ASSERT(dcd->ops != RT_NULL); RT_ASSERT(dcd->ops->ep_set_stall != RT_NULL); diff --git a/components/drivers/include/drivers/usb_host.h b/components/drivers/include/drivers/usb_host.h index 2a68f4edb5..2031e2cdc0 100644 --- a/components/drivers/include/drivers/usb_host.h +++ b/components/drivers/include/drivers/usb_host.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -44,10 +44,10 @@ struct uclass_driver rt_list_t list; int class_code; int subclass_code; - + rt_err_t (*enable)(void* arg); rt_err_t (*disable)(void* arg); - + void* user_data; }; typedef struct uclass_driver* ucd_t; @@ -56,9 +56,9 @@ struct uprotocal { rt_list_t list; int pro_id; - + rt_err_t (*init)(void* arg); - rt_err_t (*callback)(void* arg); + rt_err_t (*callback)(void* arg); }; typedef struct uprotocal* uprotocal_t; @@ -77,13 +77,13 @@ struct uinstance rt_uint8_t status; rt_uint8_t type; rt_uint8_t index; - rt_uint8_t address; + rt_uint8_t address; rt_uint8_t speed; - rt_uint8_t max_packet_size; + rt_uint8_t max_packet_size; rt_uint8_t port; struct uhub* parent_hub; - struct uhintf* intf[USB_MAX_INTERFACE]; + struct uhintf* intf[USB_MAX_INTERFACE]; }; typedef struct uinstance* uinst_t; @@ -113,14 +113,14 @@ struct uhub struct uhub_descriptor hub_desc; rt_uint8_t num_ports; rt_uint32_t port_status[USB_HUB_PORT_NUM]; - struct uinstance* child[USB_HUB_PORT_NUM]; + struct uinstance* child[USB_HUB_PORT_NUM]; rt_bool_t is_roothub; - rt_uint8_t buffer[8]; + rt_uint8_t buffer[8]; struct uinstance* self; struct uhcd *hcd; -}; +}; typedef struct uhub* uhub_t; struct uhcd_ops @@ -128,7 +128,7 @@ struct uhcd_ops rt_err_t (*reset_port) (rt_uint8_t port); int (*pipe_xfer) (upipe_t pipe, rt_uint8_t token, void* buffer, int nbytes, int timeout); rt_err_t (*open_pipe) (upipe_t pipe); - rt_err_t (*close_pipe) (upipe_t pipe); + rt_err_t (*close_pipe) (upipe_t pipe); }; typedef struct uhcd_ops* uhcd_ops_t; struct uhcd @@ -136,7 +136,7 @@ struct uhcd struct rt_device parent; uhcd_ops_t ops; rt_uint8_t num_ports; - uhub_t roothub; + uhub_t roothub; }; typedef struct uhcd* uhcd_t; @@ -149,11 +149,11 @@ typedef enum uhost_msg_type uhost_msg_type; struct uhost_msg { - uhost_msg_type type; + uhost_msg_type type; union { struct uhub* hub; - struct + struct { func_callback function; void *context; @@ -193,14 +193,14 @@ ucd_t rt_usbh_class_driver_storage(void); /* usb hub interface */ -rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer, +rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer, rt_size_t size); rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint32_t* buffer); -rt_err_t rt_usbh_hub_get_port_status(uhub_t uhub, rt_uint16_t port, +rt_err_t rt_usbh_hub_get_port_status(uhub_t uhub, rt_uint16_t port, rt_uint32_t* buffer); -rt_err_t rt_usbh_hub_clear_port_feature(uhub_t uhub, rt_uint16_t port, +rt_err_t rt_usbh_hub_clear_port_feature(uhub_t uhub, rt_uint16_t port, rt_uint16_t feature); -rt_err_t rt_usbh_hub_set_port_feature(uhub_t uhub, rt_uint16_t port, +rt_err_t rt_usbh_hub_set_port_feature(uhub_t uhub, rt_uint16_t port, rt_uint16_t feature); rt_err_t rt_usbh_hub_reset_port(uhub_t uhub, rt_uint16_t port); rt_err_t rt_usbh_event_signal(struct uhost_msg* msg); diff --git a/components/drivers/include/drivers/watchdog.h b/components/drivers/include/drivers/watchdog.h index f80ded58aa..1cf3dc741d 100644 --- a/components/drivers/include/drivers/watchdog.h +++ b/components/drivers/include/drivers/watchdog.h @@ -1,6 +1,6 @@ /* * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/drivers/include/drivers/wlan.h b/components/drivers/include/drivers/wlan.h index 724e61da78..b5b4f73586 100644 --- a/components/drivers/include/drivers/wlan.h +++ b/components/drivers/include/drivers/wlan.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/completion.h b/components/drivers/include/ipc/completion.h index acfcaa3995..087a9be813 100644 --- a/components/drivers/include/ipc/completion.h +++ b/components/drivers/include/ipc/completion.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/dataqueue.h b/components/drivers/include/ipc/dataqueue.h index 76203c404d..5dd94e55c0 100644 --- a/components/drivers/include/ipc/dataqueue.h +++ b/components/drivers/include/ipc/dataqueue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/pipe.h b/components/drivers/include/ipc/pipe.h index 93ba95cd2c..a45e8ae002 100644 --- a/components/drivers/include/ipc/pipe.h +++ b/components/drivers/include/ipc/pipe.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/poll.h b/components/drivers/include/ipc/poll.h index 8c68a96af8..1574215c77 100644 --- a/components/drivers/include/ipc/poll.h +++ b/components/drivers/include/ipc/poll.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/ringblk_buf.h b/components/drivers/include/ipc/ringblk_buf.h index 94fc2cfff3..5b2971b800 100644 --- a/components/drivers/include/ipc/ringblk_buf.h +++ b/components/drivers/include/ipc/ringblk_buf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/ringbuffer.h b/components/drivers/include/ipc/ringbuffer.h index 2afd2ca213..71c4801253 100644 --- a/components/drivers/include/ipc/ringbuffer.h +++ b/components/drivers/include/ipc/ringbuffer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/ipc/waitqueue.h b/components/drivers/include/ipc/waitqueue.h index e26ec1e896..fbf5f93142 100644 --- a/components/drivers/include/ipc/waitqueue.h +++ b/components/drivers/include/ipc/waitqueue.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon + * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon * to blocked thread. */ diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h index 11fee489bd..ccbc42b226 100644 --- a/components/drivers/include/ipc/workqueue.h +++ b/components/drivers/include/ipc/workqueue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/include/rtdevice.h b/components/drivers/include/rtdevice.h index f0fa2f5b4a..82868e5aef 100644 --- a/components/drivers/include/rtdevice.h +++ b/components/drivers/include/rtdevice.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/misc/adc.c b/components/drivers/misc/adc.c index 2d26beb243..d8f79e058b 100644 --- a/components/drivers/misc/adc.c +++ b/components/drivers/misc/adc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/misc/dac.c b/components/drivers/misc/dac.c index 336c78d018..784a503888 100644 --- a/components/drivers/misc/dac.c +++ b/components/drivers/misc/dac.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -148,7 +148,7 @@ static int dac(int argc, char **argv) int result = RT_EOK; static rt_dac_device_t dac_device = RT_NULL; char *result_str; - + if (argc > 1) { if (!strcmp(argv[1], "probe")) diff --git a/components/drivers/misc/pin.c b/components/drivers/misc/pin.c index 6f27fe516d..91bf7058dc 100644 --- a/components/drivers/misc/pin.c +++ b/components/drivers/misc/pin.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -157,7 +157,7 @@ rt_base_t rt_pin_get(const char *name) { RT_ASSERT(_hw_pin.ops != RT_NULL); RT_ASSERT(name[0] == 'P'); - + if(_hw_pin.ops->pin_get == RT_NULL) { return -RT_ENOSYS; diff --git a/components/drivers/misc/pulse_encoder.c b/components/drivers/misc/pulse_encoder.c index 3145c24675..5afb12664a 100644 --- a/components/drivers/misc/pulse_encoder.c +++ b/components/drivers/misc/pulse_encoder.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/misc/rt_drv_pwm.c b/components/drivers/misc/rt_drv_pwm.c index 572580c45c..f274f509e2 100644 --- a/components/drivers/misc/rt_drv_pwm.c +++ b/components/drivers/misc/rt_drv_pwm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/misc/rt_inputcapture.c b/components/drivers/misc/rt_inputcapture.c index d1886186d7..134bbcee96 100644 --- a/components/drivers/misc/rt_inputcapture.c +++ b/components/drivers/misc/rt_inputcapture.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/mtd/mtd_nand.c b/components/drivers/mtd/mtd_nand.c index ae5aa9c172..646625ade5 100644 --- a/components/drivers/mtd/mtd_nand.c +++ b/components/drivers/mtd/mtd_nand.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/mtd/mtd_nor.c b/components/drivers/mtd/mtd_nor.c index b941f9236d..fd5ceb0d9f 100644 --- a/components/drivers/mtd/mtd_nor.c +++ b/components/drivers/mtd/mtd_nor.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -52,7 +52,7 @@ static rt_err_t _mtd_control(rt_device_t dev, int cmd, void *args) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops mtd_nor_ops = +const static struct rt_device_ops mtd_nor_ops = { _mtd_init, _mtd_open, diff --git a/components/drivers/phy/phy.c b/components/drivers/phy/phy.c index 3ed4a1a265..6d408ce612 100644 --- a/components/drivers/phy/phy.c +++ b/components/drivers/phy/phy.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -34,9 +34,9 @@ static rt_size_t phy_device_write(rt_device_t dev, rt_off_t pos, const void *buf #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops phy_ops = +const static struct rt_device_ops phy_ops = { - RT_NULL, + RT_NULL, RT_NULL, RT_NULL, phy_device_read, diff --git a/components/drivers/pm/pm.c b/components/drivers/pm/pm.c index 743a184555..80ed101498 100644 --- a/components/drivers/pm/pm.c +++ b/components/drivers/pm/pm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -54,7 +54,7 @@ static int _pm_device_suspend(rt_uint8_t mode) { ret = _pm.device_pm[index].ops->suspend(_pm.device_pm[index].device, mode); if(ret != RT_EOK) - break; + break; } } diff --git a/components/drivers/rtc/alarm.c b/components/drivers/rtc/alarm.c index d8e4e468a7..cd0a976328 100644 --- a/components/drivers/rtc/alarm.c +++ b/components/drivers/rtc/alarm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/rtc/rtc.c b/components/drivers/rtc/rtc.c index ef688ac3cd..98b60f9f95 100644 --- a/components/drivers/rtc/rtc.c +++ b/components/drivers/rtc/rtc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -164,7 +164,7 @@ int rt_rtc_ntp_sync_init(void) } init_ok = RT_TRUE; - + return RT_EOK; } INIT_COMPONENT_EXPORT(rt_rtc_ntp_sync_init); diff --git a/components/drivers/rtc/soft_rtc.c b/components/drivers/rtc/soft_rtc.c index 240301f683..9e1b7c35fd 100644 --- a/components/drivers/rtc/soft_rtc.c +++ b/components/drivers/rtc/soft_rtc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -93,7 +93,7 @@ static rt_err_t soft_rtc_control(rt_device_t dev, int cmd, void *args) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops soft_rtc_ops = +const static struct rt_device_ops soft_rtc_ops = { RT_NULL, RT_NULL, diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index 602acb9aa7..f2ce09a83f 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -76,7 +76,7 @@ rt_int32_t mmcsd_num_wr_blocks(struct rt_mmcsd_card *card) timeout_us += data.timeout_clks * 1000 / (card->host->io_cfg.clock / 1000); - if (timeout_us > 100000) + if (timeout_us > 100000) { data.timeout_ns = 100000000; data.timeout_clks = 0; @@ -119,9 +119,9 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, rt_memset(&data, 0, sizeof(struct rt_mmcsd_data)); req.cmd = &cmd; req.data = &data; - + cmd.arg = sector; - if (!(card->flags & CARD_FLAG_SDHC)) + if (!(card->flags & CARD_FLAG_SDHC)) { cmd.arg <<= 9; } @@ -130,7 +130,7 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, data.blksize = SECTOR_SIZE; data.blks = blks; - if (blks > 1) + if (blks > 1) { if (!controller_is_spi(card->host) || !dir) { @@ -149,7 +149,7 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, w_cmd = WRITE_BLOCK; } - if (!dir) + if (!dir) { cmd.cmd_code = r_cmd; data.flags |= DATA_DIR_READ; @@ -164,9 +164,9 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, data.buf = buf; mmcsd_send_request(host, &req); - if (!controller_is_spi(card->host) && dir != 0) + if (!controller_is_spi(card->host) && dir != 0) { - do + do { rt_int32_t err; @@ -174,7 +174,7 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, cmd.arg = card->rca << 16; cmd.flags = RESP_R1 | CMD_AC; err = mmcsd_send_cmd(card->host, &cmd, 5); - if (err) + if (err) { LOG_E("error %d requesting status", err); break; @@ -190,7 +190,7 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, mmcsd_host_unlock(host); - if (cmd.err || data.err || stop.err) + if (cmd.err || data.err || stop.err) { LOG_E("mmcsd request blocks error"); LOG_E("%d,%d,%d, 0x%08x,0x%08x", @@ -264,7 +264,7 @@ static rt_size_t rt_mmcsd_read(rt_device_t dev, rt_sem_release(part->lock); /* the length of reading must align to SECTOR SIZE */ - if (err) + if (err) { rt_set_errno(-EIO); return 0; @@ -305,7 +305,7 @@ static rt_size_t rt_mmcsd_write(rt_device_t dev, rt_sem_release(part->lock); /* the length of reading must align to SECTOR SIZE */ - if (err) + if (err) { rt_set_errno(-EIO); @@ -330,7 +330,7 @@ static rt_int32_t mmcsd_set_blksize(struct rt_mmcsd_card *card) err = mmcsd_send_cmd(card->host, &cmd, 5); mmcsd_host_unlock(card->host); - if (err) + if (err) { LOG_E("MMCSD: unable to set block size to %d: %d", cmd.arg, err); @@ -341,7 +341,7 @@ static rt_int32_t mmcsd_set_blksize(struct rt_mmcsd_card *card) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops mmcsd_blk_ops = +const static struct rt_device_ops mmcsd_blk_ops = { rt_mmcsd_init, rt_mmcsd_open, @@ -362,7 +362,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) struct mmcsd_blk_device *blk_dev = RT_NULL; err = mmcsd_set_blksize(card); - if(err) + if(err) { return err; } @@ -384,15 +384,15 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) for (i = 0; i < RT_MMCSD_MAX_PARTITION; i++) { blk_dev = rt_calloc(1, sizeof(struct mmcsd_blk_device)); - if (!blk_dev) + if (!blk_dev) { LOG_E("mmcsd:malloc memory failed!"); break; } - blk_dev->max_req_size = BLK_MIN((card->host->max_dma_segs * - card->host->max_seg_size) >> 9, - (card->host->max_blk_count * + blk_dev->max_req_size = BLK_MIN((card->host->max_dma_segs * + card->host->max_seg_size) >> 9, + (card->host->max_blk_count * card->host->max_blk_size) >> 9); /* get the first partition */ @@ -402,7 +402,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) rt_snprintf(dname, 4, "sd%d", i); rt_snprintf(sname, 8, "sem_sd%d", i); blk_dev->part.lock = rt_sem_create(sname, 1, RT_IPC_FLAG_FIFO); - + /* register mmcsd device */ blk_dev->dev.type = RT_Device_Class_Block; #ifdef RT_USING_DEVICE_OPS @@ -418,11 +418,11 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) blk_dev->dev.user_data = blk_dev; blk_dev->card = card; - + blk_dev->geometry.bytes_per_sector = 1<<9; blk_dev->geometry.block_size = card->card_blksize; blk_dev->geometry.sector_count = blk_dev->part.size; - + rt_device_register(&blk_dev->dev, dname, RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_REMOVABLE | RT_DEVICE_FLAG_STANDALONE); rt_list_insert_after(&blk_devices, &blk_dev->list); @@ -435,7 +435,7 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) blk_dev->part.offset = 0; blk_dev->part.size = 0; blk_dev->part.lock = rt_sem_create("sem_sd0", 1, RT_IPC_FLAG_FIFO); - + /* register mmcsd device */ blk_dev->dev.type = RT_Device_Class_Block; #ifdef RT_USING_DEVICE_OPS @@ -454,9 +454,9 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) blk_dev->geometry.bytes_per_sector = 1<<9; blk_dev->geometry.block_size = card->card_blksize; - blk_dev->geometry.sector_count = + blk_dev->geometry.sector_count = card->card_capacity * (1024 / 512); - + rt_device_register(&blk_dev->dev, "sd0", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_REMOVABLE | RT_DEVICE_FLAG_STANDALONE); rt_list_insert_after(&blk_devices, &blk_dev->list); @@ -472,9 +472,9 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) #ifdef RT_USING_DFS_MNTTABLE if (blk_dev) { - LOG_I("try to mount file system!"); - /* try to mount file system on this block device */ - dfs_mount_device(&(blk_dev->dev)); + LOG_I("try to mount file system!"); + /* try to mount file system on this block device */ + dfs_mount_device(&(blk_dev->dev)); } #endif } @@ -484,10 +484,10 @@ rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card) LOG_E("read mmcsd first sector failed"); err = -RT_ERROR; } - + /* release sector buffer */ rt_free(sector); - + return err; } @@ -499,15 +499,15 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card) for (l = (&blk_devices)->next, n = l->next; l != &blk_devices; l = n) { blk_dev = (struct mmcsd_blk_device *)rt_list_entry(l, struct mmcsd_blk_device, list); - if (blk_dev->card == card) + if (blk_dev->card == card) { - /* unmount file system */ - const char * mounted_path = dfs_filesystem_get_mounted_path(&(blk_dev->dev)); - if (mounted_path) - { + /* unmount file system */ + const char * mounted_path = dfs_filesystem_get_mounted_path(&(blk_dev->dev)); + if (mounted_path) + { dfs_unmount(mounted_path); LOG_D("unmount file system %s for device %s.\r\n", mounted_path, blk_dev->dev.parent.name); - } + } rt_sem_delete(blk_dev->part.lock); rt_device_unregister(&blk_dev->dev); rt_list_remove(&blk_dev->list); diff --git a/components/drivers/sdio/mmc.c b/components/drivers/sdio/mmc.c index c1c56d37fd..5aba3dba7a 100644 --- a/components/drivers/sdio/mmc.c +++ b/components/drivers/sdio/mmc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -45,9 +45,9 @@ static const rt_uint8_t tacc_value[] = rt_inline rt_uint32_t GET_BITS(rt_uint32_t *resp, rt_uint32_t start, rt_uint32_t size) -{ +{ const rt_int32_t __size = size; - const rt_uint32_t __mask = (__size < 32 ? 1 << __size : 0) - 1; + const rt_uint32_t __mask = (__size < 32 ? 1 << __size : 0) - 1; const rt_int32_t __off = 3 - ((start) / 32); const rt_int32_t __shft = (start) & 31; rt_uint32_t __res; @@ -67,7 +67,7 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card) rt_uint32_t a, b; struct rt_mmcsd_csd *csd = &card->csd; rt_uint32_t *resp = card->resp_csd; - + /* * We only understand CSD structure v1.1 and v1.2. * v1.2 has extra information in bits 15, 11 and 10. @@ -76,10 +76,10 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card) csd->csd_structure = GET_BITS(resp, 126, 2); if (csd->csd_structure == 0) { LOG_E("unrecognised CSD structure version %d!", csd->csd_structure); - + return -RT_ERROR; } - + csd->taac = GET_BITS(resp, 112, 8); csd->nsac = GET_BITS(resp, 104, 8); csd->tran_speed = GET_BITS(resp, 96, 8); @@ -95,7 +95,7 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card) csd->wr_blk_len = GET_BITS(resp, 22, 4); csd->wr_blk_partial = GET_BITS(resp, 21, 1); csd->csd_crc = GET_BITS(resp, 1, 7); - + card->card_blksize = 1 << csd->rd_blk_len; card->tacc_clks = csd->nsac * 100; card->tacc_ns = (tacc_uint[csd->taac&0x07] * tacc_value[(csd->taac&0x78)>>3] + 9) / 10; @@ -106,7 +106,7 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card) card->erase_size = (a + 1) * (b + 1); card->erase_size <<= csd->wr_blk_len - 9; } - + return 0; } @@ -119,12 +119,12 @@ static int mmc_get_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t **new_ext_csd) struct rt_mmcsd_req req; struct rt_mmcsd_cmd cmd; struct rt_mmcsd_data data; - + *new_ext_csd = RT_NULL; - + if (GET_BITS(card->resp_cid, 122, 4) < 4) return 0; - + /* * As the ext_csd is so large and mostly unused, we don't store the * raw block in mmc_card. @@ -134,29 +134,29 @@ static int mmc_get_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t **new_ext_csd) LOG_E("alloc memory failed when get ext csd!"); return -RT_ENOMEM; } - + rt_memset(&req, 0, sizeof(struct rt_mmcsd_req)); rt_memset(&cmd, 0, sizeof(struct rt_mmcsd_cmd)); rt_memset(&data, 0, sizeof(struct rt_mmcsd_data)); - + req.cmd = &cmd; req.data = &data; - + cmd.cmd_code = SEND_EXT_CSD; cmd.arg = 0; - + /* NOTE HACK: the RESP_SPI_R1 is always correct here, but we * rely on callers to never use this with "native" calls for reading * CSD or CID. Native versions of those commands use the R2 type, * not R1 plus a data block. */ cmd.flags = RESP_SPI_R1 | RESP_R1 | CMD_ADTC; - + data.blksize = 512; data.blks = 1; data.flags = DATA_DIR_READ; data.buf = ext_csd; - + /* * Some cards require longer data read timeout than indicated in CSD. * Address this by setting the read timeout to a "reasonably high" @@ -165,14 +165,14 @@ static int mmc_get_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t **new_ext_csd) */ data.timeout_ns = 300000000; data.timeout_clks = 0; - + mmcsd_send_request(card->host, &req); - + if (cmd.err) return cmd.err; if (data.err) return data.err; - + *new_ext_csd = ext_csd; return 0; } @@ -192,13 +192,13 @@ static int mmc_parse_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) card->flags |= CARD_FLAG_HIGHSPEED; card->hs_max_data_rate = 52000000; - + card_capacity = *((rt_uint32_t *)&ext_csd[EXT_CSD_SEC_CNT]); card_capacity *= card->card_blksize; card_capacity >>= 10; /* unit:KB */ card->card_capacity = card_capacity; LOG_I("emmc card capacity %d KB.", card->card_capacity); - + return 0; } @@ -211,41 +211,41 @@ static int mmc_parse_ext_csd(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) * * Modifies the EXT_CSD register for selected card. */ -static int mmc_switch(struct rt_mmcsd_card *card, rt_uint8_t set, +static int mmc_switch(struct rt_mmcsd_card *card, rt_uint8_t set, rt_uint8_t index, rt_uint8_t value) { int err; struct rt_mmcsd_host *host = card->host; struct rt_mmcsd_cmd cmd = {0}; - + cmd.cmd_code = SWITCH; cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | (index << 16) | (value << 8) | set; cmd.flags = RESP_SPI_R1 | RESP_R1 | CMD_AC; - + err = mmcsd_send_cmd(host, &cmd, 3); if (err) return err; - + return 0; } -static int mmc_compare_ext_csds(struct rt_mmcsd_card *card, +static int mmc_compare_ext_csds(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd, rt_uint32_t bus_width) { rt_uint8_t *bw_ext_csd; int err; - + if (bus_width == MMCSD_BUS_WIDTH_1) return 0; - + err = mmc_get_ext_csd(card, &bw_ext_csd); - + if (err || bw_ext_csd == RT_NULL) { err = -RT_ERROR; goto out; } - + /* only compare read only fields */ err = !((ext_csd[EXT_CSD_PARTITION_SUPPORT] == bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) && (ext_csd[EXT_CSD_ERASED_MEM_CONT] == bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) && @@ -273,10 +273,10 @@ static int mmc_compare_ext_csds(struct rt_mmcsd_card *card, (ext_csd[EXT_CSD_PWR_CL_DDR_52_195] == bw_ext_csd[EXT_CSD_PWR_CL_DDR_52_195]) && (ext_csd[EXT_CSD_PWR_CL_DDR_52_360] == bw_ext_csd[EXT_CSD_PWR_CL_DDR_52_360]) && (ext_csd[EXT_CSD_PWR_CL_DDR_200_360] == bw_ext_csd[EXT_CSD_PWR_CL_DDR_200_360])); - + if (err) err = -RT_ERROR; - + out: rt_free(bw_ext_csd); return err; @@ -302,10 +302,10 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) struct rt_mmcsd_host *host = card->host; unsigned idx, bus_width = 0; int err = 0; - + if (GET_BITS(card->resp_cid, 122, 4) < 4) return 0; - + /* * Unlike SD, MMC cards dont have a configuration register to notify * supported bus width. So bus test command should be run to identify @@ -323,18 +323,18 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) * set by drivers. */ if ((!(host->flags & MMCSD_BUSWIDTH_8) && - ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8) || + ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8) || (!(host->flags & MMCSD_BUSWIDTH_4) && - (ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_4 || - ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8))) - continue; + (ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_4 || + ext_csd_bits[idx] == EXT_CSD_BUS_WIDTH_8))) + continue; err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, ext_csd_bits[idx]); if (err) continue; - + bus_width = bus_widths[idx]; mmcsd_set_bus_width(host, bus_width); mmcsd_delay_ms(20); //delay 10ms @@ -358,10 +358,10 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd) } } } - + return err; } -rt_err_t mmc_send_op_cond(struct rt_mmcsd_host *host, +rt_err_t mmc_send_op_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr, rt_uint32_t *rocr) { struct rt_mmcsd_cmd cmd; @@ -369,20 +369,20 @@ rt_err_t mmc_send_op_cond(struct rt_mmcsd_host *host, rt_err_t err = RT_EOK; rt_memset(&cmd, 0, sizeof(struct rt_mmcsd_cmd)); - + cmd.cmd_code = SEND_OP_COND; cmd.arg = controller_is_spi(host) ? 0 : ocr; cmd.flags = RESP_SPI_R1 | RESP_R3 | CMD_BCR; - + for (i = 100; i; i--) { err = mmcsd_send_cmd(host, &cmd, 3); if (err) break; - + /* if we're just probing, do a single pass */ if (ocr == 0) break; - + /* otherwise wait until reset completes */ if (controller_is_spi(host)) { if (!(cmd.resp[0] & R1_SPI_IDLE)) @@ -391,15 +391,15 @@ rt_err_t mmc_send_op_cond(struct rt_mmcsd_host *host, if (cmd.resp[0] & CARD_BUSY) break; } - + err = -RT_ETIMEOUT; - + mmcsd_delay_ms(10); //delay 10ms } - + if (rocr && !controller_is_spi(host)) *rocr = cmd.resp[0]; - + return err; } @@ -407,17 +407,17 @@ static rt_err_t mmc_set_card_addr(struct rt_mmcsd_host *host, rt_uint32_t rca) { rt_err_t err; struct rt_mmcsd_cmd cmd; - + rt_memset(&cmd, 0, sizeof(struct rt_mmcsd_cmd)); - + cmd.cmd_code = SET_RELATIVE_ADDR; cmd.arg = rca << 16; cmd.flags = RESP_R1 | CMD_AC; - + err = mmcsd_send_cmd(host, &cmd, 3); if (err) return err; - + return 0; } @@ -432,19 +432,19 @@ static rt_int32_t mmcsd_mmc_init_card(struct rt_mmcsd_host *host, struct rt_mmcsd_card *card = RT_NULL; mmcsd_go_idle(host); - + /* The extra bit indicates that we support high capacity */ err = mmc_send_op_cond(host, ocr | (1 << 30), &rocr); if (err) goto err; - - if (controller_is_spi(host)) + + if (controller_is_spi(host)) { err = mmcsd_spi_use_crc(host, 1); if (err) goto err1; } - + if (controller_is_spi(host)) err = mmcsd_get_cid(host, resp); else @@ -453,7 +453,7 @@ static rt_int32_t mmcsd_mmc_init_card(struct rt_mmcsd_host *host, goto err; card = rt_malloc(sizeof(struct rt_mmcsd_card)); - if (!card) + if (!card) { LOG_E("malloc card failed!"); err = -RT_ENOMEM; @@ -469,7 +469,7 @@ static rt_int32_t mmcsd_mmc_init_card(struct rt_mmcsd_host *host, /* * For native busses: get card RCA and quit open drain mode. */ - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { err = mmc_set_card_addr(host, card->rca); if (err) @@ -486,24 +486,24 @@ static rt_int32_t mmcsd_mmc_init_card(struct rt_mmcsd_host *host, if (err) goto err1; - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { err = mmcsd_select_card(card); if (err) goto err1; } - + /* * Fetch and process extended CSD. */ - + err = mmc_get_ext_csd(card, &ext_csd); if (err) goto err1; err = mmc_parse_ext_csd(card, ext_csd); if (err) goto err1; - + /* If doing byte addressing, check if required to do sector * addressing. Handle the case of <2GB cards needing sector * addressing. See section 8.1 JEDEC Standard JED84-A441; @@ -511,9 +511,9 @@ static rt_int32_t mmcsd_mmc_init_card(struct rt_mmcsd_host *host, */ if (!(card->flags & CARD_FLAG_SDHC) && (rocr & (1<<30))) card->flags |= CARD_FLAG_SDHC; - + /* set bus speed */ - if (card->flags & CARD_FLAG_HIGHSPEED) + if (card->flags & CARD_FLAG_HIGHSPEED) max_data_rate = card->hs_max_data_rate; else max_data_rate = card->max_data_rate; @@ -522,7 +522,7 @@ static rt_int32_t mmcsd_mmc_init_card(struct rt_mmcsd_host *host, /*switch bus width*/ mmc_select_bus_width(card, ext_csd); - + host->card = card; rt_free(ext_csd); diff --git a/components/drivers/sdio/mmcsd_core.c b/components/drivers/sdio/mmcsd_core.c index 99bc6ce744..e3bf97069c 100644 --- a/components/drivers/sdio/mmcsd_core.c +++ b/components/drivers/sdio/mmcsd_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -63,7 +63,7 @@ void mmcsd_send_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req) req->cmd->err = 0; req->cmd->mrq = req; if (req->data) - { + { req->cmd->data = req->data; req->data->err = 0; req->data->mrq = req; @@ -72,12 +72,12 @@ void mmcsd_send_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *req) req->data->stop = req->stop; req->stop->err = 0; req->stop->mrq = req; - } + } } host->ops->request(host, req); rt_sem_take(&host->sem_ack, RT_WAITING_FOREVER); - + } while(req->cmd->err && (req->cmd->retries > 0)); @@ -122,7 +122,7 @@ rt_int32_t mmcsd_go_idle(struct rt_mmcsd_host *host) mmcsd_delay_ms(1); - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { mmcsd_set_chip_select(host, MMCSD_CS_IGNORE); mmcsd_delay_ms(1); @@ -179,7 +179,7 @@ rt_int32_t mmcsd_get_cid(struct rt_mmcsd_host *host, rt_uint32_t *cid) struct rt_mmcsd_data data; rt_uint32_t *buf = RT_NULL; - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { if (!host->card) return -RT_ERROR; @@ -198,7 +198,7 @@ rt_int32_t mmcsd_get_cid(struct rt_mmcsd_host *host, rt_uint32_t *cid) } buf = (rt_uint32_t *)rt_malloc(16); - if (!buf) + if (!buf) { LOG_E("allocate memory failed!"); @@ -274,7 +274,7 @@ rt_int32_t mmcsd_get_csd(struct rt_mmcsd_card *card, rt_uint32_t *csd) } buf = (rt_uint32_t*)rt_malloc(16); - if (!buf) + if (!buf) { LOG_E("allocate memory failed!"); @@ -336,12 +336,12 @@ static rt_int32_t _mmcsd_select_card(struct rt_mmcsd_host *host, cmd.cmd_code = SELECT_CARD; - if (card) + if (card) { cmd.arg = card->rca << 16; cmd.flags = RESP_R1 | CMD_AC; - } - else + } + else { cmd.arg = 0; cmd.flags = RESP_NONE | CMD_AC; @@ -442,7 +442,7 @@ void mmcsd_set_data_timeout(struct rt_mmcsd_data *data, { rt_uint32_t mult; - if (card->card_type == CARD_TYPE_SDIO) + if (card->card_type == CARD_TYPE_SDIO) { data->timeout_ns = 1000000000; /* SDIO card 1s */ data->timeout_clks = 0; @@ -468,7 +468,7 @@ void mmcsd_set_data_timeout(struct rt_mmcsd_data *data, /* * SD cards also have an upper limit on the timeout. */ - if (card->card_type == CARD_TYPE_SD) + if (card->card_type == CARD_TYPE_SD) { rt_uint32_t timeout_us, limit_us; @@ -488,21 +488,21 @@ void mmcsd_set_data_timeout(struct rt_mmcsd_data *data, /* * SDHC cards always use these fixed values. */ - if (timeout_us > limit_us || card->flags & CARD_FLAG_SDHC) + if (timeout_us > limit_us || card->flags & CARD_FLAG_SDHC) { data->timeout_ns = limit_us * 1000; /* SDHC card fixed 250ms */ data->timeout_clks = 0; } } - if (controller_is_spi(card->host)) + if (controller_is_spi(card->host)) { - if (data->flags & DATA_DIR_WRITE) + if (data->flags & DATA_DIR_WRITE) { if (data->timeout_ns < 1000000000) data->timeout_ns = 1000000000; /* 1s */ - } - else + } + else { if (data->timeout_ns < 100000000) data->timeout_ns = 100000000; /* 100ms */ @@ -522,7 +522,7 @@ rt_uint32_t mmcsd_select_voltage(struct rt_mmcsd_host *host, rt_uint32_t ocr) ocr &= host->valid_ocr; bit = __rt_ffs(ocr); - if (bit) + if (bit) { bit -= 1; @@ -530,8 +530,8 @@ rt_uint32_t mmcsd_select_voltage(struct rt_mmcsd_host *host, rt_uint32_t ocr) host->io_cfg.vdd = bit; mmcsd_set_iocfg(host); - } - else + } + else { LOG_W("host doesn't support card's voltages!"); ocr = 0; @@ -549,7 +549,7 @@ static void mmcsd_power_up(struct rt_mmcsd_host *host) { host->io_cfg.chip_select = MMCSD_CS_HIGH; host->io_cfg.bus_mode = MMCSD_BUSMODE_PUSHPULL; - } + } else { host->io_cfg.chip_select = MMCSD_CS_IGNORE; @@ -580,7 +580,7 @@ static void mmcsd_power_off(struct rt_mmcsd_host *host) { host->io_cfg.clock = 0; host->io_cfg.vdd = 0; - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { host->io_cfg.bus_mode = MMCSD_BUSMODE_OPENDRAIN; host->io_cfg.chip_select = MMCSD_CS_IGNORE; @@ -619,7 +619,7 @@ void mmcsd_detect(void *param) rt_uint32_t ocr; rt_int32_t err; - while (1) + while (1) { if (rt_mb_recv(&mmcsd_detect_mb, (rt_ubase_t *)&host, RT_WAITING_FOREVER) == RT_EOK) { @@ -644,7 +644,7 @@ void mmcsd_detect(void *param) * detect SD card */ err = mmcsd_send_app_op_cond(host, 0, &ocr); - if (!err) + if (!err) { if (init_sd(host, ocr)) mmcsd_power_off(host); @@ -652,12 +652,12 @@ void mmcsd_detect(void *param) rt_mb_send(&mmcsd_hotpluge_mb, (rt_ubase_t)host); continue; } - + /* * detect mmc card */ err = mmc_send_op_cond(host, 0, &ocr); - if (!err) + if (!err) { if (init_mmc(host, ocr)) mmcsd_power_off(host); @@ -669,21 +669,21 @@ void mmcsd_detect(void *param) } else { - /* card removed */ - mmcsd_host_lock(host); - if (host->card->sdio_function_num != 0) - { - LOG_W("unsupport sdio card plug out!"); - } - else - { - rt_mmcsd_blk_remove(host->card); - rt_free(host->card); - - host->card = RT_NULL; - } - mmcsd_host_unlock(host); - rt_mb_send(&mmcsd_hotpluge_mb, (rt_ubase_t)host); + /* card removed */ + mmcsd_host_lock(host); + if (host->card->sdio_function_num != 0) + { + LOG_W("unsupport sdio card plug out!"); + } + else + { + rt_mmcsd_blk_remove(host->card); + rt_free(host->card); + + host->card = RT_NULL; + } + mmcsd_host_unlock(host); + rt_mb_send(&mmcsd_hotpluge_mb, (rt_ubase_t)host); } } } @@ -694,7 +694,7 @@ struct rt_mmcsd_host *mmcsd_alloc_host(void) struct rt_mmcsd_host *host; host = rt_malloc(sizeof(struct rt_mmcsd_host)); - if (!host) + if (!host) { LOG_E("alloc host failed"); @@ -736,16 +736,16 @@ int rt_mmcsd_core_init(void) &mmcsd_hotpluge_mb_pool[0], sizeof(mmcsd_hotpluge_mb_pool) / sizeof(mmcsd_hotpluge_mb_pool[0]), RT_IPC_FLAG_FIFO); RT_ASSERT(ret == RT_EOK); - ret = rt_thread_init(&mmcsd_detect_thread, "mmcsd_detect", mmcsd_detect, RT_NULL, + ret = rt_thread_init(&mmcsd_detect_thread, "mmcsd_detect", mmcsd_detect, RT_NULL, &mmcsd_stack[0], RT_MMCSD_STACK_SIZE, RT_MMCSD_THREAD_PREORITY, 20); - if (ret == RT_EOK) + if (ret == RT_EOK) { rt_thread_startup(&mmcsd_detect_thread); } rt_sdio_init(); - return 0; + return 0; } INIT_PREV_EXPORT(rt_mmcsd_core_init); diff --git a/components/drivers/sdio/sd.c b/components/drivers/sdio/sd.c index f7e4e46720..d739ee4eaf 100644 --- a/components/drivers/sdio/sd.c +++ b/components/drivers/sdio/sd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -45,9 +45,9 @@ static const rt_uint8_t tacc_value[] = rt_inline rt_uint32_t GET_BITS(rt_uint32_t *resp, rt_uint32_t start, rt_uint32_t size) -{ +{ const rt_int32_t __size = size; - const rt_uint32_t __mask = (__size < 32 ? 1 << __size : 0) - 1; + const rt_uint32_t __mask = (__size < 32 ? 1 << __size : 0) - 1; const rt_int32_t __off = 3 - ((start) / 32); const rt_int32_t __shft = (start) & 31; rt_uint32_t __res; @@ -97,7 +97,7 @@ static rt_int32_t mmcsd_parse_csd(struct rt_mmcsd_card *card) case 1: card->flags |= CARD_FLAG_SDHC; - /*This field is fixed to 0Eh, which indicates 1 ms. + /*This field is fixed to 0Eh, which indicates 1 ms. The host should not use TAAC, NSAC, and R2W_FACTOR to calculate timeout and should uses fixed timeout values for read and write operations*/ @@ -157,13 +157,13 @@ static rt_int32_t mmcsd_switch(struct rt_mmcsd_card *card) rt_uint8_t *buf; buf = (rt_uint8_t*)rt_malloc(64); - if (!buf) + if (!buf) { LOG_E("alloc memory failed!"); return -RT_ENOMEM; } - + if (card->card_type != CARD_TYPE_SD) goto err; if (card->scr.sd_version < SCR_SPEC_VER_1) @@ -191,7 +191,7 @@ static rt_int32_t mmcsd_switch(struct rt_mmcsd_card *card) mmcsd_send_request(host, &req); - if (cmd.err || data.err) + if (cmd.err || data.err) { goto err1; } @@ -221,12 +221,12 @@ static rt_int32_t mmcsd_switch(struct rt_mmcsd_card *card) mmcsd_send_request(host, &req); - if (cmd.err || data.err) + if (cmd.err || data.err) { goto err1; } - if ((buf[16] & 0xF) != 1) + if ((buf[16] & 0xF) != 1) { LOG_I("switching card to high speed failed!"); goto err; @@ -255,12 +255,12 @@ static rt_err_t mmcsd_app_cmd(struct rt_mmcsd_host *host, cmd.cmd_code = APP_CMD; - if (card) + if (card) { cmd.arg = card->rca << 16; cmd.flags = RESP_R1 | CMD_AC; - } - else + } + else { cmd.arg = 0; cmd.flags = RESP_R1 | CMD_BCR; @@ -285,7 +285,7 @@ rt_err_t mmcsd_send_app_cmd(struct rt_mmcsd_host *host, { struct rt_mmcsd_req req; - rt_uint32_t i; + rt_uint32_t i; rt_err_t err; err = -RT_ERROR; @@ -294,15 +294,15 @@ rt_err_t mmcsd_send_app_cmd(struct rt_mmcsd_host *host, * We have to resend MMC_APP_CMD for each attempt so * we cannot use the retries field in mmc_command. */ - for (i = 0;i <= retry;i++) + for (i = 0;i <= retry;i++) { rt_memset(&req, 0, sizeof(struct rt_mmcsd_req)); err = mmcsd_app_cmd(host, card); - if (err) + if (err) { /* no point in retrying; no APP commands allowed */ - if (controller_is_spi(host)) + if (controller_is_spi(host)) { if (cmd->resp[0] & R1_SPI_ILLEGAL_COMMAND) break; @@ -324,7 +324,7 @@ rt_err_t mmcsd_send_app_cmd(struct rt_mmcsd_host *host, break; /* no point in retrying illegal APP commands */ - if (controller_is_spi(host)) + if (controller_is_spi(host)) { if (cmd->resp[0] & R1_SPI_ILLEGAL_COMMAND) break; @@ -344,7 +344,7 @@ rt_err_t mmcsd_app_set_bus_width(struct rt_mmcsd_card *card, rt_int32_t width) cmd.cmd_code = SD_APP_SET_BUS_WIDTH; cmd.flags = RESP_R1 | CMD_AC; - switch (width) + switch (width) { case MMCSD_BUS_WIDTH_1: cmd.arg = MMCSD_BUS_WIDTH_1; @@ -380,7 +380,7 @@ rt_err_t mmcsd_send_app_op_cond(struct rt_mmcsd_host *host, cmd.arg = ocr; cmd.flags = RESP_SPI_R1 | RESP_R3 | CMD_BCR; - for (i = 100; i; i--) + for (i = 100; i; i--) { err = mmcsd_send_app_cmd(host, RT_NULL, &cmd, 3); if (err) @@ -391,12 +391,12 @@ rt_err_t mmcsd_send_app_op_cond(struct rt_mmcsd_host *host, break; /* otherwise wait until reset completes */ - if (controller_is_spi(host)) + if (controller_is_spi(host)) { if (!(cmd.resp[0] & R1_SPI_IDLE)) break; - } - else + } + else { if (cmd.resp[0] & CARD_BUSY) break; @@ -544,7 +544,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, goto err; card = rt_malloc(sizeof(struct rt_mmcsd_card)); - if (!card) + if (!card) { LOG_E("malloc card failed!"); err = -RT_ENOMEM; @@ -559,7 +559,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, /* * For native busses: get card RCA and quit open drain mode. */ - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { err = mmcsd_get_card_addr(host, &card->rca); if (err) @@ -576,7 +576,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, if (err) goto err1; - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { err = mmcsd_select_card(card); if (err) @@ -589,7 +589,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, mmcsd_parse_scr(card); - if (controller_is_spi(host)) + if (controller_is_spi(host)) { err = mmcsd_spi_use_crc(host, 1); if (err) @@ -606,12 +606,12 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, /* set bus speed */ max_data_rate = (unsigned int)-1; - if (card->flags & CARD_FLAG_HIGHSPEED) + if (card->flags & CARD_FLAG_HIGHSPEED) { if (max_data_rate > card->hs_max_data_rate) max_data_rate = card->hs_max_data_rate; - } - else if (max_data_rate > card->max_data_rate) + } + else if (max_data_rate > card->max_data_rate) { max_data_rate = card->max_data_rate; } @@ -620,7 +620,7 @@ static rt_int32_t mmcsd_sd_init_card(struct rt_mmcsd_host *host, /*switch bus width*/ if ((host->flags & MMCSD_BUSWIDTH_4) && - (card->scr.sd_bus_widths & SD_SCR_BUS_WIDTH_4)) + (card->scr.sd_bus_widths & SD_SCR_BUS_WIDTH_4)) { err = mmcsd_app_set_bus_width(card, MMCSD_BUS_WIDTH_4); if (err) diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c index f0d5863a06..1263f205b5 100644 --- a/components/drivers/sdio/sdio.c +++ b/components/drivers/sdio/sdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -73,7 +73,7 @@ rt_int32_t sdio_io_send_op_cond(struct rt_mmcsd_host *host, cmd.arg = ocr; cmd.flags = RESP_SPI_R4 | RESP_R4 | CMD_BCR; - for (i = 100; i; i--) + for (i = 100; i; i--) { err = mmcsd_send_cmd(host, &cmd, 0); if (err) @@ -84,7 +84,7 @@ rt_int32_t sdio_io_send_op_cond(struct rt_mmcsd_host *host, break; /* otherwise wait until reset completes */ - if (controller_is_spi(host)) + if (controller_is_spi(host)) { /* * Both R1_SPI_IDLE and MMC_CARD_BUSY indicate @@ -94,8 +94,8 @@ rt_int32_t sdio_io_send_op_cond(struct rt_mmcsd_host *host, */ if (cmd.resp[1] & CARD_BUSY) break; - } - else + } + else { if (cmd.resp[0] & CARD_BUSY) break; @@ -143,7 +143,7 @@ rt_int32_t sdio_io_rw_direct(struct rt_mmcsd_card *card, if (err) return err; - if (!controller_is_spi(card->host)) + if (!controller_is_spi(card->host)) { if (cmd.resp[0] & R5_ERROR) return -RT_EIO; @@ -153,7 +153,7 @@ rt_int32_t sdio_io_rw_direct(struct rt_mmcsd_card *card, return -RT_ERROR; } - if (!rw || raw) + if (!rw || raw) { if (controller_is_spi(card->host)) *pdata = (cmd.resp[0] >> 8) & 0xFF; @@ -218,7 +218,7 @@ rt_int32_t sdio_io_rw_extended(struct rt_mmcsd_card *card, if (data.err) return data.err; - if (!controller_is_spi(card->host)) + if (!controller_is_spi(card->host)) { if (cmd.resp[0] & R5_ERROR) return -RT_EIO; @@ -270,7 +270,7 @@ rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, blks = max_blks; len = blks * func->cur_blk_size; - ret = sdio_io_rw_extended(func->card, rw, func->num, + ret = sdio_io_rw_extended(func->card, rw, func->num, addr, op_code, buf, blks, func->cur_blk_size); if (ret) return ret; @@ -286,7 +286,7 @@ rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, { len = MIN(left_size, sdio_max_block_size(func)); - ret = sdio_io_rw_extended(func->card, rw, func->num, + ret = sdio_io_rw_extended(func->card, rw, func->num, addr, op_code, buf, 1, len); if (ret) return ret; @@ -300,7 +300,7 @@ rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, return 0; } -rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, +rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, rt_uint32_t reg, rt_int32_t *err) { @@ -317,7 +317,7 @@ rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, return data; } -rt_int32_t sdio_io_writeb(struct rt_sdio_function *func, +rt_int32_t sdio_io_writeb(struct rt_sdio_function *func, rt_uint32_t reg, rt_uint8_t data) { @@ -335,7 +335,7 @@ rt_uint16_t sdio_io_readw(struct rt_sdio_function *func, *err = 0; ret = sdio_io_rw_extended_block(func, 0, addr, 1, (rt_uint8_t *)&dmabuf, 2); - if (ret) + if (ret) { if (err) *err = ret; @@ -364,7 +364,7 @@ rt_uint32_t sdio_io_readl(struct rt_sdio_function *func, *err = 0; ret = sdio_io_rw_extended_block(func, 0, addr, 1, (rt_uint8_t *)&dmabuf, 4); - if (ret) + if (ret) { if (err) *err = ret; @@ -382,7 +382,7 @@ rt_int32_t sdio_io_writel(struct rt_sdio_function *func, return sdio_io_rw_extended_block(func, 1, addr, 1, (rt_uint8_t *)&dmabuf, 4); } -rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len) @@ -390,7 +390,7 @@ rt_int32_t sdio_io_read_multi_fifo_b(struct rt_sdio_function *func, return sdio_io_rw_extended_block(func, 0, addr, 0, buf, len); } -rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len) @@ -398,7 +398,7 @@ rt_int32_t sdio_io_write_multi_fifo_b(struct rt_sdio_function *func, return sdio_io_rw_extended_block(func, 1, addr, 0, buf, len); } -rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len) @@ -406,7 +406,7 @@ rt_int32_t sdio_io_read_multi_incr_b(struct rt_sdio_function *func, return sdio_io_rw_extended_block(func, 0, addr, 1, buf, len); } -rt_int32_t sdio_io_write_multi_incr_b(struct rt_sdio_function *func, +rt_int32_t sdio_io_write_multi_incr_b(struct rt_sdio_function *func, rt_uint32_t addr, rt_uint8_t *buf, rt_uint32_t len) @@ -428,7 +428,7 @@ static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card) cccr_version = data & 0x0f; - if (cccr_version > SDIO_CCCR_REV_3_00) + if (cccr_version > SDIO_CCCR_REV_3_00) { LOG_E("unrecognised CCCR structure version %d", cccr_version); @@ -450,7 +450,7 @@ static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card) if (data & SDIO_CCCR_CAP_4BLS) card->cccr.bus_width = 1; - if (cccr_version >= SDIO_CCCR_REV_1_10) + if (cccr_version >= SDIO_CCCR_REV_1_10) { data = sdio_io_readb(card->sdio_function[0], SDIO_REG_CCCR_POWER_CTRL, &ret); if (ret) @@ -460,7 +460,7 @@ static rt_int32_t sdio_read_cccr(struct rt_mmcsd_card *card) card->cccr.power_ctrl = 1; } - if (cccr_version >= SDIO_CCCR_REV_1_20) + if (cccr_version >= SDIO_CCCR_REV_1_20) { data = sdio_io_readb(card->sdio_function[0], SDIO_REG_CCCR_SPEED, &ret); if (ret) @@ -531,7 +531,7 @@ static rt_int32_t sdio_read_cis(struct rt_sdio_function *func) for (i = 0; i < 3; i++) { - data = sdio_io_readb(func0, + data = sdio_io_readb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_CIS + i, &ret); if (ret) return ret; @@ -560,13 +560,13 @@ static rt_int32_t sdio_read_cis(struct rt_sdio_function *func) return -RT_ENOMEM; curr->data = (rt_uint8_t *)curr + sizeof(struct rt_sdio_function_tuple); - for (i = 0; i < tpl_link; i++) + for (i = 0; i < tpl_link; i++) { curr->data[i] = sdio_io_readb(func0, cisptr + i, &ret); if (ret) break; } - if (ret) + if (ret) { rt_free(curr); break; @@ -618,7 +618,7 @@ static rt_int32_t sdio_read_cis(struct rt_sdio_function *func) LOG_D("CISTPL_VERS_1 too short"); } break; - default: + default: /* this tuple is unknown to the core */ curr->next = RT_NULL; curr->code = tpl_code; @@ -651,7 +651,7 @@ void sdio_free_cis(struct rt_sdio_function *func) tuple = func->tuples; - while (tuple && ((tuple != card->sdio_function[0]->tuples) || (!func->num))) + while (tuple && ((tuple != card->sdio_function[0]->tuples) || (!func->num))) { tmp = tuple; tuple = tuple->next; @@ -667,16 +667,16 @@ static rt_int32_t sdio_read_fbr(struct rt_sdio_function *func) rt_uint8_t data; struct rt_sdio_function *func0 = func->card->sdio_function[0]; - data = sdio_io_readb(func0, + data = sdio_io_readb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_STD_FUNC_IF, &ret); if (ret) goto err; data &= 0x0f; - if (data == 0x0f) + if (data == 0x0f) { - data = sdio_io_readb(func0, + data = sdio_io_readb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_STD_IF_EXT, &ret); if (ret) goto err; @@ -835,7 +835,7 @@ static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) if (err) goto err; - if (controller_is_spi(host)) + if (controller_is_spi(host)) { err = mmcsd_spi_use_crc(host, host->spi_use_crc); if (err) @@ -845,7 +845,7 @@ static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) function_num = (cmd5_resp & 0x70000000) >> 28; card = rt_malloc(sizeof(struct rt_mmcsd_card)); - if (!card) + if (!card) { LOG_E("malloc card failed"); err = -RT_ENOMEM; @@ -869,7 +869,7 @@ static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) card->sdio_function[0]->card = card; card->sdio_function[0]->num = 0; - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { err = mmcsd_get_card_addr(host, &card->rca); if (err) @@ -878,7 +878,7 @@ static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) mmcsd_set_bus_mode(host, MMCSD_BUSMODE_PUSHPULL); } - if (!controller_is_spi(host)) + if (!controller_is_spi(host)) { err = mmcsd_select_card(card); if (err) @@ -897,7 +897,7 @@ static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) if (err) goto err2; - if (card->flags & CARD_FLAG_HIGHSPEED) + if (card->flags & CARD_FLAG_HIGHSPEED) { mmcsd_set_clock(host, card->host->freq_max > 50000000 ? 50000000 : card->host->freq_max); } @@ -910,7 +910,7 @@ static rt_int32_t sdio_init_card(struct rt_mmcsd_host *host, rt_uint32_t ocr) if (err) goto err2; - for (i = 1; i < function_num + 1; i++) + for (i = 1; i < function_num + 1; i++) { err = sdio_initialize_function(card, i); if (err) @@ -954,7 +954,7 @@ err1: } err: LOG_E("error %d while initialising SDIO card", err); - + return err; } @@ -965,13 +965,13 @@ rt_int32_t init_sdio(struct rt_mmcsd_host *host, rt_uint32_t ocr) RT_ASSERT(host != RT_NULL); - if (ocr & 0x7F) + if (ocr & 0x7F) { LOG_W("Card ocr below the defined voltage rang."); ocr &= ~0x7F; } - if (ocr & VDD_165_195) + if (ocr & VDD_165_195) { LOG_W("Can't support the low voltage SDIO card."); ocr &= ~VDD_165_195; @@ -979,7 +979,7 @@ rt_int32_t init_sdio(struct rt_mmcsd_host *host, rt_uint32_t ocr) current_ocr = mmcsd_select_voltage(host, ocr); - if (!current_ocr) + if (!current_ocr) { err = -RT_ERROR; goto err; @@ -1011,35 +1011,35 @@ static void sdio_irq_thread(void *param) card = host->card; RT_ASSERT(card != RT_NULL); - while (1) + while (1) { if (rt_sem_take(host->sdio_irq_sem, RT_WAITING_FOREVER) == RT_EOK) { mmcsd_host_lock(host); - pending = sdio_io_readb(host->card->sdio_function[0], + pending = sdio_io_readb(host->card->sdio_function[0], SDIO_REG_CCCR_INT_PEND, &ret); - if (ret) + if (ret) { mmcsd_dbg("error %d reading SDIO_REG_CCCR_INT_PEND\n", ret); goto out; } - for (i = 1; i <= 7; i++) + for (i = 1; i <= 7; i++) { - if (pending & (1 << i)) + if (pending & (1 << i)) { struct rt_sdio_function *func = card->sdio_function[i]; - if (!func) + if (!func) { mmcsd_dbg("pending IRQ for " "non-existant function %d\n", func->num); goto out; - } - else if (func->irq_handler) + } + else if (func->irq_handler) { func->irq_handler(func); - } - else + } + else { mmcsd_dbg("pending IRQ with no register handler\n"); goto out; @@ -1067,9 +1067,9 @@ static rt_int32_t sdio_irq_thread_create(struct rt_mmcsd_card *card) host->sdio_irq_sem = rt_sem_create("sdio_irq", 0, RT_IPC_FLAG_FIFO); RT_ASSERT(host->sdio_irq_sem != RT_NULL); - host->sdio_irq_thread = rt_thread_create("sdio_irq", sdio_irq_thread, host, + host->sdio_irq_thread = rt_thread_create("sdio_irq", sdio_irq_thread, host, RT_SDIO_STACK_SIZE, RT_SDIO_THREAD_PRIORITY, 20); - if (host->sdio_irq_thread != RT_NULL) + if (host->sdio_irq_thread != RT_NULL) { rt_thread_startup(host->sdio_irq_thread); } @@ -1085,7 +1085,7 @@ static rt_int32_t sdio_irq_thread_delete(struct rt_mmcsd_card *card) RT_ASSERT(host->sdio_irq_num > 0); host->sdio_irq_num--; - if (!host->sdio_irq_num) + if (!host->sdio_irq_num) { if (host->flags & MMCSD_SUP_SDIO_IRQ) host->ops->enable_sdio_irq(host, 0); @@ -1112,7 +1112,7 @@ rt_int32_t sdio_attach_irq(struct rt_sdio_function *func, mmcsd_dbg("SDIO: enabling IRQ for function %d\n", func->num); - if (func->irq_handler) + if (func->irq_handler) { mmcsd_dbg("SDIO: IRQ for already in use.\n"); @@ -1153,7 +1153,7 @@ rt_int32_t sdio_detach_irq(struct rt_sdio_function *func) mmcsd_dbg("SDIO: disabling IRQ for function %d\n", func->num); - if (func->irq_handler) + if (func->irq_handler) { func->irq_handler = RT_NULL; sdio_irq_thread_delete(func->card); @@ -1210,7 +1210,7 @@ rt_int32_t sdio_enable_func(struct rt_sdio_function *func) timeout = rt_tick_get() + func->enable_timeout_val * RT_TICK_PER_SECOND / 1000; - while (1) + while (1) { reg = sdio_io_readb(func0, SDIO_REG_CCCR_IO_RDY, &ret); if (ret) @@ -1282,17 +1282,17 @@ rt_int32_t sdio_set_block_size(struct rt_sdio_function *func, if (blksize > func->card->host->max_blk_size) return -RT_ERROR; - if (blksize == 0) + if (blksize == 0) { blksize = MIN(func->max_blk_size, func->card->host->max_blk_size); blksize = MIN(blksize, 512u); } - ret = sdio_io_writeb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_BLKSIZE, + ret = sdio_io_writeb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_BLKSIZE, blksize & 0xff); if (ret) return ret; - ret = sdio_io_writeb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_BLKSIZE + 1, + ret = sdio_io_writeb(func0, SDIO_REG_FBR_BASE(func->num) + SDIO_REG_FBR_BLKSIZE + 1, (blksize >> 8) & 0xff); if (ret) return ret; @@ -1305,14 +1305,14 @@ rt_inline rt_int32_t sdio_match_card(struct rt_mmcsd_card *card, const struct rt_sdio_device_id *id) { rt_uint8_t num = 1; - - if ((id->manufacturer != SDIO_ANY_MAN_ID) && + + if ((id->manufacturer != SDIO_ANY_MAN_ID) && (id->manufacturer != card->cis.manufacturer)) return 0; - + while (num <= card->sdio_function_num) { - if ((id->product != SDIO_ANY_PROD_ID) && + if ((id->product != SDIO_ANY_PROD_ID) && (id->product == card->sdio_function[num]->product)) return 1; num++; diff --git a/components/drivers/sensors/sensor.c b/components/drivers/sensors/sensor.c index 660b86f85b..ccc1fca34e 100644 --- a/components/drivers/sensors/sensor.c +++ b/components/drivers/sensors/sensor.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h index b180e36a73..f54d4e8799 100755 --- a/components/drivers/sensors/sensor.h +++ b/components/drivers/sensors/sensor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -169,7 +169,7 @@ struct rt_sensor_device const struct rt_sensor_ops *ops; /* The sensor ops */ struct rt_sensor_module *module; /* The sensor module */ - + rt_err_t (*irq_handle)(rt_sensor_t sensor); /* Called when an interrupt is generated, registered by the driver */ }; diff --git a/components/drivers/sensors/sensor_cmd.c b/components/drivers/sensors/sensor_cmd.c index cbf7d233c6..5c2d22640c 100755 --- a/components/drivers/sensors/sensor_cmd.c +++ b/components/drivers/sensors/sensor_cmd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -92,7 +92,7 @@ static void sensor_fifo_rx_entry(void *parameter) struct rt_sensor_data *data = RT_NULL; struct rt_sensor_info info; rt_size_t res, i; - + rt_device_control(dev, RT_SENSOR_CTRL_GET_INFO, &info); data = (struct rt_sensor_data *)rt_malloc(sizeof(struct rt_sensor_data) * info.fifo_max); @@ -126,7 +126,7 @@ static void sensor_fifo(int argc, char **argv) return; } sensor = (rt_sensor_t)dev; - + if (rt_device_open(dev, RT_DEVICE_FLAG_FIFO_RX) != RT_EOK) { LOG_E("open device failed!"); diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 5743155e37..d555a0dd7e 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -460,7 +460,7 @@ static void rt_dma_recv_update_put_index(struct rt_serial_device *serial, rt_siz rx_fifo->is_full = RT_TRUE; } } - + if(rx_fifo->is_full == RT_TRUE) { _serial_check_buffer_size(); @@ -615,7 +615,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) /* initialize the Rx/Tx structure according to open flag */ if (serial->serial_rx == RT_NULL) - { + { if (oflag & RT_DEVICE_FLAG_INT_RX) { struct rt_serial_rx_fifo* rx_fifo; @@ -634,7 +634,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) /* configure low level device */ serial->ops->control(serial, RT_DEVICE_CTRL_SET_INT, (void *)RT_DEVICE_FLAG_INT_RX); } -#ifdef RT_SERIAL_USING_DMA +#ifdef RT_SERIAL_USING_DMA else if (oflag & RT_DEVICE_FLAG_DMA_RX) { if (serial->config.bufsz == 0) { @@ -675,7 +675,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) #ifdef RT_SERIAL_USING_DMA else if (oflag & RT_DEVICE_FLAG_DMA_RX) dev->open_flag |= RT_DEVICE_FLAG_DMA_RX; -#endif /* RT_SERIAL_USING_DMA */ +#endif /* RT_SERIAL_USING_DMA */ } if (serial->serial_tx == RT_NULL) @@ -723,7 +723,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) #ifdef RT_SERIAL_USING_DMA else if (oflag & RT_DEVICE_FLAG_DMA_TX) dev->open_flag |= RT_DEVICE_FLAG_DMA_TX; -#endif /* RT_SERIAL_USING_DMA */ +#endif /* RT_SERIAL_USING_DMA */ } /* set stream flag */ @@ -784,7 +784,7 @@ static rt_err_t rt_serial_close(struct rt_device *dev) serial->ops->control(serial, RT_DEVICE_CTRL_CLR_INT, (void *) RT_DEVICE_FLAG_DMA_RX); } #endif /* RT_SERIAL_USING_DMA */ - + if (dev->open_flag & RT_DEVICE_FLAG_INT_TX) { struct rt_serial_tx_fifo* tx_fifo; @@ -845,7 +845,7 @@ static rt_size_t rt_serial_read(struct rt_device *dev, { return _serial_dma_rx(serial, (rt_uint8_t *)buffer, size); } -#endif /* RT_SERIAL_USING_DMA */ +#endif /* RT_SERIAL_USING_DMA */ return _serial_poll_rx(serial, (rt_uint8_t *)buffer, size); } @@ -866,7 +866,7 @@ static rt_size_t rt_serial_write(struct rt_device *dev, { return _serial_int_tx(serial, (const rt_uint8_t *)buffer, size); } -#ifdef RT_SERIAL_USING_DMA +#ifdef RT_SERIAL_USING_DMA else if (dev->open_flag & RT_DEVICE_FLAG_DMA_TX) { return _serial_dma_tx(serial, (const rt_uint8_t *)buffer, size); @@ -1142,7 +1142,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev, } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops serial_ops = +const static struct rt_device_ops serial_ops = { rt_serial_init, rt_serial_open, diff --git a/components/drivers/spi/enc28j60.c b/components/drivers/spi/enc28j60.c index a8bfe3a159..f99719245b 100644 --- a/components/drivers/spi/enc28j60.c +++ b/components/drivers/spi/enc28j60.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -747,7 +747,7 @@ static struct pbuf *enc28j60_rx(rt_device_t dev) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops enc28j60_ops = +const static struct rt_device_ops enc28j60_ops = { enc28j60_init, enc28j60_open, diff --git a/components/drivers/spi/enc28j60.h b/components/drivers/spi/enc28j60.h index adff774748..471b71ec2d 100644 --- a/components/drivers/spi/enc28j60.h +++ b/components/drivers/spi/enc28j60.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/spi/qspi_core.c b/components/drivers/spi/qspi_core.c index c9ff6a9637..ca2cba0aba 100644 --- a/components/drivers/spi/qspi_core.c +++ b/components/drivers/spi/qspi_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -14,7 +14,7 @@ rt_err_t rt_qspi_configure(struct rt_qspi_device *device, struct rt_qspi_configu { RT_ASSERT(device != RT_NULL); RT_ASSERT(cfg != RT_NULL); - + struct rt_qspi_device *qspi_device = (struct rt_qspi_device *)device; rt_err_t result = RT_EOK; @@ -35,14 +35,14 @@ rt_err_t rt_qspi_configure(struct rt_qspi_device *device, struct rt_qspi_configu rt_err_t rt_qspi_bus_register(struct rt_spi_bus *bus, const char *name, const struct rt_spi_ops *ops) { rt_err_t result = RT_EOK; - + result = rt_spi_bus_register(bus, name, ops); if(result == RT_EOK) { /* set SPI bus to qspi modes */ bus->mode = RT_SPI_BUS_MODE_QSPI; } - + return result; } @@ -243,7 +243,7 @@ rt_err_t rt_qspi_send(struct rt_qspi_device *device, const void *send_buf, rt_si message.qspi_data_lines = 0; } - + /* set send buf and send size */ message.parent.send_buf = ptr + count; message.parent.recv_buf = RT_NULL; diff --git a/components/drivers/spi/sfud/inc/sfud_def.h b/components/drivers/spi/sfud/inc/sfud_def.h index fe7876618b..c06f9b1295 100644 --- a/components/drivers/spi/sfud/inc/sfud_def.h +++ b/components/drivers/spi/sfud/inc/sfud_def.h @@ -118,11 +118,11 @@ if (!(EXPR)) \ #define SFUD_CMD_READ_DATA 0x03 #endif -#ifndef SFUD_CMD_DUAL_OUTPUT_READ_DATA +#ifndef SFUD_CMD_DUAL_OUTPUT_READ_DATA #define SFUD_CMD_DUAL_OUTPUT_READ_DATA 0x3B #endif -#ifndef SFUD_CMD_DUAL_IO_READ_DATA +#ifndef SFUD_CMD_DUAL_IO_READ_DATA #define SFUD_CMD_DUAL_IO_READ_DATA 0xBB #endif diff --git a/components/drivers/spi/sfud/src/sfud_sfdp.c b/components/drivers/spi/sfud/src/sfud_sfdp.c index 0c81e073e6..5d95fa2b79 100644 --- a/components/drivers/spi/sfud/src/sfud_sfdp.c +++ b/components/drivers/spi/sfud/src/sfud_sfdp.c @@ -223,7 +223,7 @@ static bool read_basic_table(sfud_flash *flash, sfdp_para_header *basic_header) return false; } /* get write granularity */ - //TODO ĿǰΪ 1.0 ËùÌṩµÄ·½Ê½£¬ºóÆÚÖ§³Ö V1.5 ¼°ÒÔÉϵķ½Ê½¶ÁÈ¡ page size + //TODO ç›®å‰�为 1.0 所æ��供的方å¼�,å�ŽæœŸæ”¯æŒ� V1.5 å�Šä»¥ä¸Šçš„æ–¹å¼�读å�– page size switch ((table[0] & (0x01 << 2)) >> 2) { case 0: sfdp->write_gran = 1; diff --git a/components/drivers/spi/spi_core.c b/components/drivers/spi/spi_core.c index 64b0d2e496..7b6b7a0763 100644 --- a/components/drivers/spi/spi_core.c +++ b/components/drivers/spi/spi_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/spi/spi_dev.c b/components/drivers/spi/spi_dev.c index e334e7aeb5..264f5d1856 100644 --- a/components/drivers/spi/spi_dev.c +++ b/components/drivers/spi/spi_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -48,7 +48,7 @@ static rt_err_t _spi_bus_device_control(rt_device_t dev, { case 0: /* set device */ break; - case 1: + case 1: break; } @@ -56,7 +56,7 @@ static rt_err_t _spi_bus_device_control(rt_device_t dev, } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops spi_bus_ops = +const static struct rt_device_ops spi_bus_ops = { RT_NULL, RT_NULL, @@ -129,7 +129,7 @@ static rt_err_t _spidev_device_control(rt_device_t dev, { case 0: /* set device */ break; - case 1: + case 1: break; } @@ -137,7 +137,7 @@ static rt_err_t _spidev_device_control(rt_device_t dev, } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops spi_device_ops = +const static struct rt_device_ops spi_device_ops = { RT_NULL, RT_NULL, diff --git a/components/drivers/spi/spi_flash.h b/components/drivers/spi/spi_flash.h index 82b1ab2ecd..9083a40a1c 100644 --- a/components/drivers/spi/spi_flash.h +++ b/components/drivers/spi/spi_flash.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -28,10 +28,10 @@ typedef struct spi_flash_device *rt_spi_flash_device_t; #ifdef RT_USING_MTD_NOR struct spi_flash_mtd { - struct rt_mtd_nor_device mtd_device; - struct rt_spi_device * rt_spi_device; - struct rt_mutex lock; - void * user_data; + struct rt_mtd_nor_device mtd_device; + struct rt_spi_device * rt_spi_device; + struct rt_mutex lock; + void * user_data; }; #endif diff --git a/components/drivers/spi/spi_flash_sfud.c b/components/drivers/spi/spi_flash_sfud.c index 2333c9ccb3..ba673edf62 100644 --- a/components/drivers/spi/spi_flash_sfud.c +++ b/components/drivers/spi/spi_flash_sfud.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/spi/spi_flash_sfud.h b/components/drivers/spi/spi_flash_sfud.h index 932b7f879c..0d5a751d0c 100644 --- a/components/drivers/spi/spi_flash_sfud.h +++ b/components/drivers/spi/spi_flash_sfud.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/spi/spi_msd.c b/components/drivers/spi/spi_msd.c index 191933e421..875ae3c486 100644 --- a/components/drivers/spi/spi_msd.c +++ b/components/drivers/spi/spi_msd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -435,7 +435,7 @@ static rt_err_t _write_block(struct rt_spi_device *device, const void *buffer, u } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops msd_ops = +const static struct rt_device_ops msd_ops = { rt_msd_init, rt_msd_open, @@ -445,7 +445,7 @@ const static struct rt_device_ops msd_ops = rt_msd_control }; -const static struct rt_device_ops msd_sdhc_ops = +const static struct rt_device_ops msd_sdhc_ops = { rt_msd_init, rt_msd_open, diff --git a/components/drivers/spi/spi_msd.h b/components/drivers/spi/spi_msd.h index 6370170923..e9febca781 100644 --- a/components/drivers/spi/spi_msd.h +++ b/components/drivers/spi/spi_msd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -93,12 +93,12 @@ */ typedef enum { - MSD_CARD_TYPE_UNKNOWN = 0, /**< unknown */ - MSD_CARD_TYPE_MMC, /**< MultiMedia Card */ - MSD_CARD_TYPE_SD_V1_X, /**< Ver 1.X Standard Capacity SD Memory Card */ - MSD_CARD_TYPE_SD_V2_X, /**< Ver 2.00 or later Standard Capacity SD Memory Card */ - MSD_CARD_TYPE_SD_SDHC, /**< High Capacity SD Memory Card */ - MSD_CARD_TYPE_SD_SDXC, /**< later Extended Capacity SD Memory Card */ + MSD_CARD_TYPE_UNKNOWN = 0, /**< unknown */ + MSD_CARD_TYPE_MMC, /**< MultiMedia Card */ + MSD_CARD_TYPE_SD_V1_X, /**< Ver 1.X Standard Capacity SD Memory Card */ + MSD_CARD_TYPE_SD_V2_X, /**< Ver 2.00 or later Standard Capacity SD Memory Card */ + MSD_CARD_TYPE_SD_SDHC, /**< High Capacity SD Memory Card */ + MSD_CARD_TYPE_SD_SDXC, /**< later Extended Capacity SD Memory Card */ }msd_card_type; typedef enum diff --git a/components/drivers/spi/spi_wifi_rw009.c b/components/drivers/spi/spi_wifi_rw009.c index 4ddd18ca12..84da212077 100644 --- a/components/drivers/spi/spi_wifi_rw009.c +++ b/components/drivers/spi/spi_wifi_rw009.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/drivers/spi/spi_wifi_rw009.h b/components/drivers/spi/spi_wifi_rw009.h index 049b0a8486..a0d8ec437d 100644 --- a/components/drivers/spi/spi_wifi_rw009.h +++ b/components/drivers/spi/spi_wifi_rw009.h @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/drivers/src/completion.c b/components/drivers/src/completion.c index 9e461e49ce..b91ae3d6dc 100644 --- a/components/drivers/src/completion.c +++ b/components/drivers/src/completion.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c index 1651417bb9..f32efa1849 100644 --- a/components/drivers/src/dataqueue.c +++ b/components/drivers/src/dataqueue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -62,7 +62,7 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, rt_ubase_t level; rt_thread_t thread; rt_err_t result; - + RT_ASSERT(queue != RT_NULL); RT_ASSERT(queue->magic == DATAQUEUE_MAGIC); @@ -85,7 +85,7 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, /* reset thread error number */ thread->error = RT_EOK; - + /* suspend thread on the push list */ rt_thread_suspend(thread); rt_list_insert_before(&(queue->suspended_push_list), &(thread->tlist)); @@ -155,13 +155,13 @@ RTM_EXPORT(rt_data_queue_push); rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, const void** data_ptr, - rt_size_t *size, + rt_size_t *size, rt_int32_t timeout) { rt_ubase_t level; rt_thread_t thread; rt_err_t result; - + RT_ASSERT(queue != RT_NULL); RT_ASSERT(queue->magic == DATAQUEUE_MAGIC); RT_ASSERT(data_ptr != RT_NULL); @@ -185,7 +185,7 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, /* reset thread error number */ thread->error = RT_EOK; - + /* suspend thread on the pop list */ rt_thread_suspend(thread); rt_list_insert_before(&(queue->suspended_pop_list), &(thread->tlist)); @@ -269,11 +269,11 @@ rt_err_t rt_data_queue_peek(struct rt_data_queue *queue, rt_size_t *size) { rt_ubase_t level; - + RT_ASSERT(queue != RT_NULL); RT_ASSERT(queue->magic == DATAQUEUE_MAGIC); - if (queue->is_empty) + if (queue->is_empty) { return -RT_EEMPTY; } @@ -293,7 +293,7 @@ void rt_data_queue_reset(struct rt_data_queue *queue) { rt_ubase_t level; struct rt_thread *thread; - + RT_ASSERT(queue != RT_NULL); RT_ASSERT(queue->magic == DATAQUEUE_MAGIC); @@ -303,9 +303,9 @@ void rt_data_queue_reset(struct rt_data_queue *queue) queue->put_index = 0; queue->is_empty = 1; queue->is_full = 0; - + rt_hw_interrupt_enable(level); - + rt_enter_critical(); /* wakeup all suspend threads */ @@ -375,7 +375,7 @@ rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue) level = rt_hw_interrupt_disable(); queue->magic = 0; rt_hw_interrupt_enable(level); - + rt_free(queue->queue); return RT_EOK; @@ -386,7 +386,7 @@ rt_uint16_t rt_data_queue_len(struct rt_data_queue *queue) { rt_ubase_t level; rt_int16_t len; - + RT_ASSERT(queue != RT_NULL); RT_ASSERT(queue->magic == DATAQUEUE_MAGIC); @@ -405,7 +405,7 @@ rt_uint16_t rt_data_queue_len(struct rt_data_queue *queue) { len = queue->size + queue->put_index - queue->get_index; } - + rt_hw_interrupt_enable(level); return len; diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index bd392cba2b..10b880ff7a 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -330,7 +330,7 @@ rt_err_t rt_pipe_open (rt_device_t device, rt_uint16_t oflag) ret = -RT_EINVAL; goto __exit; } - + rt_mutex_take(&(pipe->lock), RT_WAITING_FOREVER); if (pipe->fifo == RT_NULL) @@ -428,7 +428,7 @@ rt_err_t rt_pipe_control(rt_device_t dev, int cmd, void *args) } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops pipe_ops = +const static struct rt_device_ops pipe_ops = { RT_NULL, rt_pipe_open, @@ -507,7 +507,7 @@ int rt_pipe_delete(const char *name) rt_device_unregister(device); /* close fifo ringbuffer */ - if (pipe->fifo) + if (pipe->fifo) { rt_ringbuffer_destroy(pipe->fifo); pipe->fifo = RT_NULL; @@ -564,7 +564,7 @@ int pipe(int fildes[2]) int mkfifo(const char *path, mode_t mode) { rt_pipe_t *pipe; - + pipe = rt_pipe_create(path, PIPE_BUFSZ); if (pipe == RT_NULL) { diff --git a/components/drivers/src/ringblk_buf.c b/components/drivers/src/ringblk_buf.c index 7d83149c5e..c9631b9d4a 100644 --- a/components/drivers/src/ringblk_buf.c +++ b/components/drivers/src/ringblk_buf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/src/ringbuffer.c b/components/drivers/src/ringbuffer.c index 88afd19506..29de20b087 100644 --- a/components/drivers/src/ringbuffer.c +++ b/components/drivers/src/ringbuffer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -320,8 +320,8 @@ rt_size_t rt_ringbuffer_getchar(struct rt_ringbuffer *rb, rt_uint8_t *ch) } RTM_EXPORT(rt_ringbuffer_getchar); -/** - * get the size of data in rb +/** + * get the size of data in rb */ rt_size_t rt_ringbuffer_data_len(struct rt_ringbuffer *rb) { @@ -341,8 +341,8 @@ rt_size_t rt_ringbuffer_data_len(struct rt_ringbuffer *rb) } RTM_EXPORT(rt_ringbuffer_data_len); -/** - * empty the rb +/** + * empty the rb */ void rt_ringbuffer_reset(struct rt_ringbuffer *rb) { @@ -362,7 +362,7 @@ struct rt_ringbuffer* rt_ringbuffer_create(rt_uint16_t size) struct rt_ringbuffer *rb; rt_uint8_t *pool; - RT_ASSERT(size > 0); + RT_ASSERT(size > 0); size = RT_ALIGN_DOWN(size, RT_ALIGN_SIZE); diff --git a/components/drivers/src/waitqueue.c b/components/drivers/src/waitqueue.c index 02240edbdf..f9a6d6e120 100644 --- a/components/drivers/src/waitqueue.c +++ b/components/drivers/src/waitqueue.c @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon + * 2018/06/26 Bernard Fix the wait queue issue when wakeup a soon * to blocked thread. */ diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c index 7aea647703..f195dad927 100644 --- a/components/drivers/src/workqueue.c +++ b/components/drivers/src/workqueue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/touch/touch.c b/components/drivers/touch/touch.c index e9595e9f8f..abe2c0fe24 100644 --- a/components/drivers/touch/touch.c +++ b/components/drivers/touch/touch.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/touch/touch.h b/components/drivers/touch/touch.h index be12c24206..3d2e885e13 100644 --- a/components/drivers/touch/touch.h +++ b/components/drivers/touch/touch.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbdevice/class/audio_mic.c b/components/drivers/usb/usbdevice/class/audio_mic.c index 23ade2d9b6..760c055d10 100644 --- a/components/drivers/usb/usbdevice/class/audio_mic.c +++ b/components/drivers/usb/usbdevice/class/audio_mic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbdevice/class/audio_speaker.c b/components/drivers/usb/usbdevice/class/audio_speaker.c index e9a3ffaf40..c8bbb9cb5e 100644 --- a/components/drivers/usb/usbdevice/class/audio_speaker.c +++ b/components/drivers/usb/usbdevice/class/audio_speaker.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbdevice/class/cdc.h b/components/drivers/usb/usbdevice/class/cdc.h index 4e07f16266..a4616a956b 100644 --- a/components/drivers/usb/usbdevice/class/cdc.h +++ b/components/drivers/usb/usbdevice/class/cdc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -8,7 +8,7 @@ * 2012-10-03 Yi Qiu first version * 2012-12-12 heyuanjie87 add CDC endpoints collection */ - + #ifndef __CDC_H__ #define __CDC_H__ @@ -96,7 +96,7 @@ struct ucdc_header_descriptor rt_uint8_t length; rt_uint8_t type; rt_uint8_t subtype; - rt_uint16_t bcd; + rt_uint16_t bcd; }; typedef struct ucdc_header_descriptor* ucdc_hdr_desc_t; @@ -114,7 +114,7 @@ struct ucdc_call_mgmt_descriptor rt_uint8_t length; rt_uint8_t type; rt_uint8_t subtype; - rt_uint8_t capabilties; + rt_uint8_t capabilties; rt_uint8_t data_interface; }; typedef struct ucdc_call_mgmt_descriptor* ucdc_call_mgmt_desc_t; @@ -136,9 +136,9 @@ struct ucdc_comm_descriptor #endif struct uinterface_descriptor intf_desc; struct ucdc_header_descriptor hdr_desc; - struct ucdc_call_mgmt_descriptor call_mgmt_desc; - struct ucdc_acm_descriptor acm_desc; - struct ucdc_union_descriptor union_desc; + struct ucdc_call_mgmt_descriptor call_mgmt_desc; + struct ucdc_acm_descriptor acm_desc; + struct ucdc_union_descriptor union_desc; struct uendpoint_descriptor ep_desc; }; typedef struct ucdc_comm_descriptor* ucdc_comm_desc_t; @@ -170,7 +170,7 @@ typedef struct ucdc_eth_descriptor* ucdc_eth_desc_t; struct ucdc_data_descriptor { struct uinterface_descriptor intf_desc; - struct uendpoint_descriptor ep_out_desc; + struct uendpoint_descriptor ep_out_desc; struct uendpoint_descriptor ep_in_desc; }; typedef struct ucdc_data_descriptor* ucdc_data_desc_t; diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index f9ea466bd5..996a12c308 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2012-10-02 Yi Qiu first version - * 2012-12-12 heyuanjie87 change endpoints and function handler + * 2012-12-12 heyuanjie87 change endpoints and function handler * 2013-06-25 heyuanjie87 remove SOF mechinism * 2013-07-20 Yi Qiu do more test * 2016-02-01 Urey Fix some error @@ -146,23 +146,23 @@ const static struct ucdc_comm_descriptor _comm_desc = USB_DESC_LENGTH_INTERFACE, USB_DESC_TYPE_INTERFACE, USB_DYNAMIC, - 0x00, + 0x00, 0x01, USB_CDC_CLASS_COMM, USB_CDC_SUBCLASS_ACM, USB_CDC_PROTOCOL_V25TER, 0x00, }, - /* Header Functional Descriptor */ + /* Header Functional Descriptor */ { - 0x05, + 0x05, USB_CDC_CS_INTERFACE, USB_CDC_SCS_HEADER, 0x0110, }, - /* Call Management Functional Descriptor */ + /* Call Management Functional Descriptor */ { - 0x05, + 0x05, USB_CDC_CS_INTERFACE, USB_CDC_SCS_CALL_MGMT, 0x00, @@ -175,7 +175,7 @@ const static struct ucdc_comm_descriptor _comm_desc = USB_CDC_SCS_ACM, 0x02, }, - /* Union Functional Descriptor */ + /* Union Functional Descriptor */ { 0x05, USB_CDC_CS_INTERFACE, @@ -183,7 +183,7 @@ const static struct ucdc_comm_descriptor _comm_desc = USB_DYNAMIC, USB_DYNAMIC, }, - /* Endpoint Descriptor */ + /* Endpoint Descriptor */ { USB_DESC_LENGTH_ENDPOINT, USB_DESC_TYPE_ENDPOINT, @@ -204,27 +204,27 @@ const static struct ucdc_data_descriptor _data_desc = USB_DESC_TYPE_INTERFACE, USB_DYNAMIC, 0x00, - 0x02, + 0x02, USB_CDC_CLASS_DATA, - 0x00, - 0x00, - 0x00, + 0x00, + 0x00, + 0x00, }, /* endpoint, bulk out */ { - USB_DESC_LENGTH_ENDPOINT, + USB_DESC_LENGTH_ENDPOINT, USB_DESC_TYPE_ENDPOINT, USB_DYNAMIC | USB_DIR_OUT, - USB_EP_ATTR_BULK, + USB_EP_ATTR_BULK, USB_CDC_BUFSIZE, - 0x00, + 0x00, }, /* endpoint, bulk in */ { USB_DESC_LENGTH_ENDPOINT, USB_DESC_TYPE_ENDPOINT, USB_DYNAMIC | USB_DIR_IN, - USB_EP_ATTR_BULK, + USB_EP_ATTR_BULK, USB_CDC_BUFSIZE, 0x00, }, @@ -253,11 +253,11 @@ static void _vcom_reset_state(ufunction_t func) { struct vcom* data; int lvl; - + RT_ASSERT(func != RT_NULL) data = (struct vcom*)func->user_data; - + lvl = rt_hw_interrupt_disable(); data->connected = RT_FALSE; data->in_sending = RT_FALSE; @@ -299,9 +299,9 @@ static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size) return RT_EOK; } - + rt_completion_done(&data->wait); - + return RT_EOK; } @@ -396,7 +396,7 @@ static rt_err_t _cdc_set_line_coding_callback(udevice_t device, rt_size_t size) RT_DEBUG_LOG(RT_DEBUG_USB, ("_cdc_set_line_coding_callback\n")); dcd_ep0_send_status(device->dcd); - + return RT_EOK; } @@ -438,7 +438,7 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup) RT_ASSERT(setup != RT_NULL); data = (struct vcom*)func->user_data; - + switch(setup->bRequest) { case CDC_SEND_ENCAPSULATED_COMMAND: @@ -488,17 +488,17 @@ static rt_err_t _function_enable(ufunction_t func) RT_DEBUG_LOG(RT_DEBUG_USB, ("cdc function enable\n")); _vcom_reset_state(func); - + data = (struct vcom*)func->user_data; data->ep_out->buffer = rt_malloc(CDC_RX_BUFSIZE); RT_ASSERT(data->ep_out->buffer != RT_NULL); data->ep_out->request.buffer = data->ep_out->buffer; data->ep_out->request.size = EP_MAXPACKET(data->ep_out); - + data->ep_out->request.req_type = UIO_REQUEST_READ_BEST; rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); - + return RT_EOK; } @@ -523,7 +523,7 @@ static rt_err_t _function_disable(ufunction_t func) if(data->ep_out->buffer != RT_NULL) { rt_free(data->ep_out->buffer); - data->ep_out->buffer = RT_NULL; + data->ep_out->buffer = RT_NULL; } return RT_EOK; @@ -544,7 +544,7 @@ static struct ufunction_ops ops = * * @return RT_EOK on successful. */ -static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, +static rt_err_t _cdc_descriptor_config(ucdc_comm_desc_t comm, rt_uint8_t cintf_nr, ucdc_data_desc_t data, rt_uint8_t dintf_nr) { comm->call_mgmt_desc.data_interface = dintf_nr; @@ -584,19 +584,19 @@ ufunction_t rt_usbd_function_cdc_create(udevice_t device) } /* set usb device string description */ rt_usbd_device_set_string(device, _ustring); - + /* create a cdc function */ func = rt_usbd_function_new(device, &dev_desc, &ops); - + /* support HS */ rt_usbd_device_set_qualifier(device, &dev_qualifier); - + /* allocate memory for cdc vcom data */ data = (struct vcom*)rt_malloc(sizeof(struct vcom)); RT_ASSERT(data != RT_NULL); rt_memset(data, 0, sizeof(struct vcom)); func->user_data = (void*)data; - + /* initilize vcom */ rt_usb_vcom_init(func); @@ -646,7 +646,7 @@ ufunction_t rt_usbd_function_cdc_create(udevice_t device) /* add the cdc data interface to cdc function */ rt_usbd_function_add_interface(func, intf_data); - + return func; } @@ -682,7 +682,7 @@ static int _vcom_getc(struct rt_serial_device *serial) rt_uint32_t level; struct ufunction *func; struct vcom *data; - + func = (struct ufunction*)serial->parent.user_data; data = (struct vcom*)func->user_data; @@ -918,7 +918,7 @@ static void rt_usb_vcom_init(struct ufunction *func) rt_err_t result = RT_EOK; struct serial_configure config; struct vcom *data = (struct vcom*)func->user_data; - + /* initialize ring buffer */ rt_ringbuffer_init(&data->rx_ringbuffer, data->rx_rbp, CDC_RX_BUFSIZE); rt_ringbuffer_init(&data->tx_ringbuffer, data->tx_rbp, CDC_TX_BUFSIZE); @@ -952,9 +952,9 @@ static void rt_usb_vcom_init(struct ufunction *func) vcom_thread_stack, VCOM_TASK_STK_SIZE, 16, 20); result = rt_thread_startup(&vcom_thread); - RT_ASSERT(result == RT_EOK); + RT_ASSERT(result == RT_EOK); } -struct udclass vcom_class = +struct udclass vcom_class = { .rt_usbd_function_create = rt_usbd_function_cdc_create }; diff --git a/components/drivers/usb/usbdevice/class/ecm.c b/components/drivers/usb/usbdevice/class/ecm.c index 36557dad74..1550f8e1e2 100644 --- a/components/drivers/usb/usbdevice/class/ecm.c +++ b/components/drivers/usb/usbdevice/class/ecm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -44,9 +44,9 @@ struct rt_ecm_eth ALIGN(4) char rx_buffer[USB_ETH_MTU]; char tx_buffer[USB_ETH_MTU]; - + struct rt_semaphore tx_buffer_free; - + }; typedef struct rt_ecm_eth * rt_ecm_eth_t; @@ -207,7 +207,7 @@ static rt_err_t _cdc_send_notifi(ufunction_t func,ucdc_notification_code_t notif _notifi.bNotificatinCode = notifi; _notifi.wValue = wValue; _notifi.wLength = wLength; - + eps->ep_cmd->request.buffer = (void *)&_notifi; eps->ep_cmd->request.size = 8; eps->ep_cmd->request.req_type = UIO_REQUEST_WRITE; @@ -220,7 +220,7 @@ static rt_err_t _ecm_set_eth_packet_filter(ufunction_t func, ureq_t setup) { rt_ecm_eth_t _ecm_eth = (rt_ecm_eth_t)func->user_data; dcd_ep0_send_status(func->device->dcd); - + /* send link up. */ eth_device_linkchange(&_ecm_eth->parent, RT_TRUE); _cdc_send_notifi(func, UCDC_NOTIFI_NETWORK_CONNECTION, 1, 0); @@ -292,7 +292,7 @@ static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size) ecm_device->rx_size = ecm_device->rx_offset; ecm_device->rx_offset = 0; eth_device_ready(&ecm_device->parent); - + }else { ecm_device->eps.ep_out->request.buffer = ecm_device->eps.ep_out->buffer; @@ -427,7 +427,7 @@ rt_err_t rt_ecm_eth_tx(rt_device_t dev, struct pbuf* p) rt_sem_release(&ecm_eth_dev->tx_buffer_free); return result; } - + pbuffer = (char *)&ecm_eth_dev->tx_buffer; for (q = p; q != NULL; q = q->next) { @@ -480,7 +480,7 @@ static rt_err_t _function_enable(ufunction_t func) /* reset eth rx tx */ ecm_device->rx_size = 0; ecm_device->rx_offset = 0; - + eps->ep_out->request.buffer = (void *)eps->ep_out->buffer; eps->ep_out->request.size = EP_MAXPACKET(eps->ep_out); eps->ep_out->request.req_type = UIO_REQUEST_READ_BEST; @@ -555,7 +555,7 @@ ufunction_t rt_usbd_function_ecm_create(udevice_t device) ualtsetting_t comm_setting, data_setting; ucdc_data_desc_t data_desc; ucdc_eth_desc_t comm_desc; - + /* parameter check */ RT_ASSERT(device != RT_NULL); @@ -600,7 +600,7 @@ ufunction_t rt_usbd_function_ecm_create(udevice_t device) rt_usbd_set_altsetting(intf_comm, 0); /* add the communication interface to the cdc class */ rt_usbd_function_add_interface(cdc, intf_comm); - + /* create a bulk in and a bulk out endpoint */ data_desc = (ucdc_data_desc_t)data_setting->desc; eps->ep_out = rt_usbd_endpoint_new(&data_desc->ep_out_desc, _ep_out_handler); @@ -648,14 +648,14 @@ ufunction_t rt_usbd_function_ecm_create(udevice_t device) _ecm_eth->parent.eth_tx = rt_ecm_eth_tx; /* register eth device */ eth_device_init(&_ecm_eth->parent, "u0"); - + /* send link up. */ eth_device_linkchange(&_ecm_eth->parent, RT_FALSE); - + return cdc; } -struct udclass ecm_class = +struct udclass ecm_class = { .rt_usbd_function_create = rt_usbd_function_ecm_create }; diff --git a/components/drivers/usb/usbdevice/class/hid.c b/components/drivers/usb/usbdevice/class/hid.c index 52e50296a4..5023be46eb 100644 --- a/components/drivers/usb/usbdevice/class/hid.c +++ b/components/drivers/usb/usbdevice/class/hid.c @@ -1,9 +1,9 @@ /* * File : hid.c - * COPYRIGHT (C) 2008 - 2018, RT-Thread Development Team + * COPYRIGHT (C) 2006 - 2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2017-03-13 Urey the first version @@ -621,12 +621,12 @@ static void hid_thread_entry(void* parameter) struct hid_report report; struct hid_s *hiddev; hiddev = (struct hid_s *)parameter; - while(1) - { - if(rt_mq_recv(&hiddev->hid_mq, &report, sizeof(report),RT_WAITING_FOREVER) != RT_EOK ) + while(1) + { + if(rt_mq_recv(&hiddev->hid_mq, &report, sizeof(report),RT_WAITING_FOREVER) != RT_EOK ) continue; - HID_Report_Received(&report); - } + HID_Report_Received(&report); + } } #ifdef RT_USING_DEVICE_OPS @@ -658,7 +658,7 @@ static void rt_usb_hid_init(struct ufunction *func) rt_device_register(&hiddev->parent, "hidd", RT_DEVICE_FLAG_RDWR); rt_mq_init(&hiddev->hid_mq, "hiddmq", hid_mq_pool, sizeof(struct hid_report), sizeof(hid_mq_pool), RT_IPC_FLAG_FIFO); - + rt_thread_init(&hid_thread, "hidd", hid_thread_entry, hiddev, hid_thread_stack, sizeof(hid_thread_stack), RT_USBD_THREAD_PRIO, 20); rt_thread_startup(&hid_thread); @@ -689,7 +689,7 @@ ufunction_t rt_usbd_function_hid_create(udevice_t device) /* create a cdc function */ func = rt_usbd_function_new(device, &_dev_desc, &ops); - + /* For high speed mode supporting */ rt_usbd_device_set_qualifier(device, &dev_qualifier); @@ -730,7 +730,7 @@ ufunction_t rt_usbd_function_hid_create(udevice_t device) rt_usb_hid_init(func); return func; } -struct udclass hid_class = +struct udclass hid_class = { .rt_usbd_function_create = rt_usbd_function_hid_create }; diff --git a/components/drivers/usb/usbdevice/class/hid.h b/components/drivers/usb/usbdevice/class/hid.h index 4d0f314a11..2b6a4ad90a 100644 --- a/components/drivers/usb/usbdevice/class/hid.h +++ b/components/drivers/usb/usbdevice/class/hid.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index 6991d97eae..f14f6b0c24 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -7,7 +7,7 @@ * Date Author Notes * 2012-10-01 Yi Qiu first version * 2012-11-25 Heyuanjie87 reduce the memory consumption - * 2012-12-09 Heyuanjie87 change function and endpoint handler + * 2012-12-09 Heyuanjie87 change function and endpoint handler * 2013-07-25 Yi Qiu update for USB CV test */ @@ -24,10 +24,10 @@ enum STAT { STAT_CBW, - STAT_CMD, + STAT_CMD, STAT_CSW, STAT_RECEIVE, - STAT_SEND, + STAT_SEND, }; typedef enum @@ -49,7 +49,7 @@ typedef rt_size_t (*cbw_handler)(ufunction_t func, ustorage_cbw_t cbw); struct scsi_cmd { rt_uint16_t cmd; - cbw_handler handler; + cbw_handler handler; rt_size_t cmd_len; CB_SIZE_TYPE type; rt_size_t data_size; @@ -57,10 +57,10 @@ struct scsi_cmd }; struct mstorage -{ +{ struct ustorage_csw csw_response; uep_t ep_in; - uep_t ep_out; + uep_t ep_out; int status; rt_uint32_t cb_data_size; rt_device_t disk; @@ -68,7 +68,7 @@ struct mstorage rt_int32_t count; rt_int32_t size; struct scsi_cmd* processing; - struct rt_device_blk_geometry geometry; + struct rt_device_blk_geometry geometry; }; ALIGN(4) @@ -183,9 +183,9 @@ static struct scsi_cmd cmd_data[] = {SCSI_REQUEST_SENSE, _request_sense, 6, COUNT, 0, DIR_IN}, {SCSI_INQUIRY_CMD, _inquiry_cmd, 6, COUNT, 0, DIR_IN}, {SCSI_ALLOW_REMOVAL, _allow_removal, 6, FIXED, 0, DIR_NONE}, - {SCSI_MODE_SENSE_6, _mode_sense_6, 6, COUNT, 0, DIR_IN}, - {SCSI_START_STOP, _start_stop, 6, FIXED, 0, DIR_NONE}, - {SCSI_READ_CAPACITIES, _read_capacities, 10, COUNT, 0, DIR_NONE}, + {SCSI_MODE_SENSE_6, _mode_sense_6, 6, COUNT, 0, DIR_IN}, + {SCSI_START_STOP, _start_stop, 6, FIXED, 0, DIR_NONE}, + {SCSI_READ_CAPACITIES, _read_capacities, 10, COUNT, 0, DIR_NONE}, {SCSI_READ_CAPACITY, _read_capacity, 10, FIXED, 8, DIR_IN}, {SCSI_READ_10, _read_10, 10, BLOCK_COUNT, 0, DIR_IN}, {SCSI_WRITE_10, _write_10, 10, BLOCK_COUNT, 0, DIR_OUT}, @@ -200,9 +200,9 @@ static void _send_status(ufunction_t func) RT_DEBUG_LOG(RT_DEBUG_USB, ("_send_status\n")); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; data->ep_in->request.buffer = (rt_uint8_t*)&data->csw_response; - data->ep_in->request.size = SIZEOF_CSW; + data->ep_in->request.size = SIZEOF_CSW; data->ep_in->request.req_type = UIO_REQUEST_WRITE; rt_usbd_io_request(func->device, data->ep_in, &data->ep_in->request); data->status = STAT_CSW; @@ -213,13 +213,13 @@ static rt_size_t _test_unit_ready(ufunction_t func, ustorage_cbw_t cbw) struct mstorage *data; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_test_unit_ready\n")); data = (struct mstorage*)func->user_data; data->csw_response.status = 0; - + return 0; } @@ -228,7 +228,7 @@ static rt_size_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw) struct mstorage *data; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_allow_removal\n")); @@ -241,7 +241,7 @@ static rt_size_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw) /** * This function will handle inquiry command request. * - * @param func the usb function object. + * @param func the usb function object. * @param cbw the command block wrapper. * * @return RT_EOK on successful. @@ -253,12 +253,12 @@ static rt_size_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw) rt_uint8_t *buf; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_inquiry_cmd\n")); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; buf = data->ep_in->buffer; *(rt_uint32_t*)&buf[0] = 0x0 | (0x80 << 8); @@ -281,7 +281,7 @@ static rt_size_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw) /** * This function will handle sense request. * - * @param func the usb function object. + * @param func the usb function object. * @param cbw the command block wrapper. * * @return RT_EOK on successful. @@ -292,12 +292,12 @@ static rt_size_t _request_sense(ufunction_t func, ustorage_cbw_t cbw) struct request_sense_data *buf; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_request_sense\n")); - - data = (struct mstorage*)func->user_data; + + data = (struct mstorage*)func->user_data; buf = (struct request_sense_data *)data->ep_in->buffer; buf->ErrorCode = 0x70; @@ -325,7 +325,7 @@ static rt_size_t _request_sense(ufunction_t func, ustorage_cbw_t cbw) * This function will handle mode_sense_6 request. * * @param func the usb function object. - * @param cbw the command block wrapper. + * @param cbw the command block wrapper. * * @return RT_EOK on successful. */ @@ -335,12 +335,12 @@ static rt_size_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw) rt_uint8_t *buf; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_mode_sense_6\n")); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; buf = data->ep_in->buffer; buf[0] = 3; buf[1] = 0; @@ -360,7 +360,7 @@ static rt_size_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw) /** * This function will handle read_capacities request. * - * @param func the usb function object. + * @param func the usb function object. * @param cbw the command block wrapper. * * @return RT_EOK on successful. @@ -372,12 +372,12 @@ static rt_size_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw) rt_uint32_t sector_count, sector_size; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_read_capacities\n")); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; buf = data->ep_in->buffer; sector_count = data->geometry.sector_count; sector_size = data->geometry.bytes_per_sector; @@ -405,7 +405,7 @@ static rt_size_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw) /** * This function will handle read_capacity request. * - * @param func the usb function object. + * @param func the usb function object. * @param cbw the command block wapper. * * @return RT_EOK on successful. @@ -418,13 +418,13 @@ static rt_size_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw) rt_uint32_t sector_count, sector_size; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_read_capacity\n")); - data = (struct mstorage*)func->user_data; - buf = data->ep_in->buffer; + data = (struct mstorage*)func->user_data; + buf = data->ep_in->buffer; sector_count = data->geometry.sector_count - 1; /* Last Logical Block Address */ sector_size = data->geometry.bytes_per_sector; @@ -459,19 +459,19 @@ static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; rt_size_t size; - + RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; data->block = cbw->cb[2]<<24 | cbw->cb[3]<<16 | cbw->cb[4]<<8 | cbw->cb[5]<<0; data->count = cbw->cb[7]<<8 | cbw->cb[8]<<0; RT_ASSERT(data->count < data->geometry.sector_count); - data->csw_response.data_reside = data->cb_data_size; + data->csw_response.data_reside = data->cb_data_size; size = rt_device_read(data->disk, data->block, data->ep_in->buffer, 1); if(size == 0) { @@ -479,11 +479,11 @@ static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw) } data->ep_in->request.buffer = data->ep_in->buffer; - data->ep_in->request.size = data->geometry.bytes_per_sector; - data->ep_in->request.req_type = UIO_REQUEST_WRITE; + data->ep_in->request.size = data->geometry.bytes_per_sector; + data->ep_in->request.req_type = UIO_REQUEST_WRITE; rt_usbd_io_request(func->device, data->ep_in, &data->ep_in->request); data->status = STAT_SEND; - + return data->geometry.bytes_per_sector; } @@ -503,7 +503,7 @@ static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw) RT_ASSERT(func->device != RT_NULL); RT_ASSERT(cbw != RT_NULL); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; data->block = cbw->cb[2]<<24 | cbw->cb[3]<<16 | cbw->cb[4]<<8 | cbw->cb[5]<<0; @@ -515,13 +515,13 @@ static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw) data->count, data->block, data->geometry.sector_count)); data->csw_response.data_reside = data->cb_data_size; - + data->ep_out->request.buffer = data->ep_out->buffer; - data->ep_out->request.size = data->geometry.bytes_per_sector; + data->ep_out->request.size = data->geometry.bytes_per_sector; data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); data->status = STAT_RECEIVE; - + return data->geometry.bytes_per_sector; } @@ -537,42 +537,42 @@ static rt_size_t _verify_10(ufunction_t func, ustorage_cbw_t cbw) struct mstorage *data; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_verify_10\n")); data = (struct mstorage*)func->user_data; data->csw_response.status = 0; - + return 0; } -static rt_size_t _start_stop(ufunction_t func, +static rt_size_t _start_stop(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_start_stop\n")); data = (struct mstorage*)func->user_data; data->csw_response.status = 0; - + return 0; } static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size) { struct mstorage *data; - + RT_ASSERT(func != RT_NULL); RT_ASSERT(func->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_ep_in_handler\n")); - - data = (struct mstorage*)func->user_data; + + data = (struct mstorage*)func->user_data; switch(data->status) { @@ -580,15 +580,15 @@ static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size) if(data->ep_in->request.size != SIZEOF_CSW) { rt_kprintf("Size of csw command error\n"); - rt_usbd_ep_set_stall(func->device, data->ep_in); + rt_usbd_ep_set_stall(func->device, data->ep_in); } else { RT_DEBUG_LOG(RT_DEBUG_USB, ("return to cbw status\n")); data->ep_out->request.buffer = data->ep_out->buffer; data->ep_out->request.size = SIZEOF_CBW; - data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; - rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); + data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; + rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); data->status = STAT_CBW; } break; @@ -601,47 +601,47 @@ static rt_err_t _ep_in_handler(ufunction_t func, rt_size_t size) { data->csw_response.data_reside -= data->ep_in->request.size; if(data->csw_response.data_reside != 0) - { - RT_DEBUG_LOG(RT_DEBUG_USB, ("data_reside %d, request %d\n", + { + RT_DEBUG_LOG(RT_DEBUG_USB, ("data_reside %d, request %d\n", data->csw_response.data_reside, data->ep_in->request.size)); if(data->processing->dir == DIR_OUT) { rt_usbd_ep_set_stall(func->device, data->ep_out); } else - { + { //rt_kprintf("warning:in stall path but not stall\n"); - + /* FIXME: Disable the operation or the disk cannot work. */ - //rt_usbd_ep_set_stall(func->device, data->ep_in); + //rt_usbd_ep_set_stall(func->device, data->ep_in); } data->csw_response.data_reside = 0; } } _send_status(func); break; - case STAT_SEND: + case STAT_SEND: data->csw_response.data_reside -= data->ep_in->request.size; - data->count--; - data->block++; + data->count--; + data->block++; if(data->count > 0 && data->csw_response.data_reside > 0) { if(rt_device_read(data->disk, data->block, data->ep_in->buffer, 1) == 0) { rt_kprintf("disk read error\n"); rt_usbd_ep_set_stall(func->device, data->ep_in); - return -RT_ERROR; + return -RT_ERROR; } data->ep_in->request.buffer = data->ep_in->buffer; - data->ep_in->request.size = data->geometry.bytes_per_sector; - data->ep_in->request.req_type = UIO_REQUEST_WRITE; - rt_usbd_io_request(func->device, data->ep_in, &data->ep_in->request); + data->ep_in->request.size = data->geometry.bytes_per_sector; + data->ep_in->request.req_type = UIO_REQUEST_WRITE; + rt_usbd_io_request(func->device, data->ep_in, &data->ep_in->request); } else { - _send_status(func); - } + _send_status(func); + } break; } @@ -671,7 +671,7 @@ static struct scsi_cmd* _find_cbw_command(rt_uint16_t cmd) { if(cmd_data[i].cmd == cmd) return &cmd_data[i]; - } + } return RT_NULL; } @@ -685,7 +685,7 @@ static void _cb_len_calc(ufunction_t func, struct scsi_cmd* cmd, RT_ASSERT(cmd != RT_NULL); RT_ASSERT(cbw != RT_NULL); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; if(cmd->cmd_len == 6) { switch(cmd->type) @@ -699,9 +699,9 @@ static void _cb_len_calc(ufunction_t func, struct scsi_cmd* cmd, case FIXED: data->cb_data_size = cmd->data_size; break; - default: + default: break; - } + } } else if(cmd->cmd_len == 10) { @@ -711,32 +711,32 @@ static void _cb_len_calc(ufunction_t func, struct scsi_cmd* cmd, data->cb_data_size = cbw->cb[7]<<8 | cbw->cb[8]; break; case BLOCK_COUNT: - data->cb_data_size = (cbw->cb[7]<<8 | cbw->cb[8]) * + data->cb_data_size = (cbw->cb[7]<<8 | cbw->cb[8]) * data->geometry.bytes_per_sector; break; case FIXED: data->cb_data_size = cmd->data_size; break; - default: + default: break; } } - + //workaround: for stability in full-speed mode else if(cmd->cmd_len == 12) { switch(cmd->type) { case COUNT: - data->cb_data_size = cbw->cb[4]; + data->cb_data_size = cbw->cb[4]; break; - default: + default: break; } } else { - rt_kprintf("cmd_len error %d\n", cmd->cmd_len); + rt_kprintf("cmd_len error %d\n", cmd->cmd_len); } } @@ -749,7 +749,7 @@ static rt_bool_t _cbw_verify(ufunction_t func, struct scsi_cmd* cmd, RT_ASSERT(cbw != RT_NULL); RT_ASSERT(func != RT_NULL); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; if(cmd->cmd_len != cbw->cb_len) { rt_kprintf("cb_len error\n"); @@ -780,7 +780,7 @@ static rt_bool_t _cbw_verify(ufunction_t func, struct scsi_cmd* cmd, rt_kprintf("xfer_len > data_size\n"); return RT_FALSE; } - + if(cbw->xfer_len < data->cb_data_size) { rt_kprintf("xfer_len < data_size\n"); @@ -788,18 +788,18 @@ static rt_bool_t _cbw_verify(ufunction_t func, struct scsi_cmd* cmd, data->csw_response.status = 1; } - return RT_TRUE; + return RT_TRUE; } static rt_size_t _cbw_handler(ufunction_t func, struct scsi_cmd* cmd, ustorage_cbw_t cbw) -{ +{ struct mstorage *data; RT_ASSERT(func != RT_NULL); RT_ASSERT(cbw != RT_NULL); RT_ASSERT(cmd->handler != RT_NULL); - + data = (struct mstorage*)func->user_data; data->processing = cmd; return cmd->handler(func, cbw); @@ -819,21 +819,21 @@ static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size) struct scsi_cmd* cmd; rt_size_t len; struct ustorage_cbw* cbw; - + RT_ASSERT(func != RT_NULL); RT_ASSERT(func->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_ep_out_handler %d\n", size)); - + data = (struct mstorage*)func->user_data; - cbw = (struct ustorage_cbw*)data->ep_out->buffer; + cbw = (struct ustorage_cbw*)data->ep_out->buffer; if(data->status == STAT_CBW) { /* dump cbw information */ if(cbw->signature != CBW_SIGNATURE || size != SIZEOF_CBW) { goto exit; - } + } data->csw_response.signature = CSW_SIGNATURE; data->csw_response.tag = cbw->tag; @@ -841,33 +841,33 @@ static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size) data->csw_response.status = 0; RT_DEBUG_LOG(RT_DEBUG_USB, ("ep_out reside %d\n", data->csw_response.data_reside)); - + cmd = _find_cbw_command(cbw->cb[0]); if(cmd == RT_NULL) { rt_kprintf("can't find cbw command\n"); goto exit; - } + } _cb_len_calc(func, cmd, cbw); if(!_cbw_verify(func, cmd, cbw)) { goto exit; } - + len = _cbw_handler(func, cmd, cbw); if(len == 0) { _send_status(func); - } - - return RT_EOK; + } + + return RT_EOK; } else if(data->status == STAT_RECEIVE) { RT_DEBUG_LOG(RT_DEBUG_USB, ("\nwrite size %d block 0x%x oount 0x%x\n", size, data->block, data->size)); - + data->size -= size; data->csw_response.data_reside -= size; @@ -876,10 +876,10 @@ static rt_err_t _ep_out_handler(ufunction_t func, rt_size_t size) if(data->csw_response.data_reside != 0) { data->ep_out->request.buffer = data->ep_out->buffer; - data->ep_out->request.size = data->geometry.bytes_per_sector; - data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; + data->ep_out->request.size = data->geometry.bytes_per_sector; + data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); - data->block ++; + data->block ++; } else { @@ -904,7 +904,7 @@ exit: } data->csw_response.status = 1; _send_status(func); - + return -RT_ERROR; } @@ -919,21 +919,21 @@ exit: static rt_err_t _interface_handler(ufunction_t func, ureq_t setup) { rt_uint8_t lun = 0; - + RT_ASSERT(func != RT_NULL); - RT_ASSERT(func->device != RT_NULL); + RT_ASSERT(func->device != RT_NULL); RT_ASSERT(setup != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("mstorage_interface_handler\n")); switch(setup->bRequest) { - case USBREQ_GET_MAX_LUN: - + case USBREQ_GET_MAX_LUN: + RT_DEBUG_LOG(RT_DEBUG_USB, ("USBREQ_GET_MAX_LUN\n")); - + if(setup->wValue || setup->wLength != 1) - { + { rt_usbd_ep0_set_stall(func->device); } else @@ -944,14 +944,14 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup) case USBREQ_MASS_STORAGE_RESET: RT_DEBUG_LOG(RT_DEBUG_USB, ("USBREQ_MASS_STORAGE_RESET\n")); - + if(setup->wValue || setup->wLength != 0) { rt_usbd_ep0_set_stall(func->device); } else - { - dcd_ep0_send_status(func->device->dcd); + { + dcd_ep0_send_status(func->device->dcd); } break; default: @@ -992,14 +992,14 @@ static rt_err_t _function_enable(ufunction_t func) rt_kprintf("disk open error\n"); return -RT_ERROR; } - - if(rt_device_control(data->disk, RT_DEVICE_CTRL_BLK_GETGEOME, + + if(rt_device_control(data->disk, RT_DEVICE_CTRL_BLK_GETGEOME, (void*)&data->geometry) != RT_EOK) { rt_kprintf("get disk info error\n"); return -RT_ERROR; } - + data->ep_in->buffer = (rt_uint8_t*)rt_malloc(data->geometry.bytes_per_sector); if(data->ep_in->buffer == RT_NULL) { @@ -1012,14 +1012,14 @@ static rt_err_t _function_enable(ufunction_t func) rt_free(data->ep_in->buffer); rt_kprintf("no memory\n"); return -RT_ENOMEM; - } - + } + /* prepare to read CBW request */ data->ep_out->request.buffer = data->ep_out->buffer; - data->ep_out->request.size = SIZEOF_CBW; - data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; + data->ep_out->request.size = SIZEOF_CBW; + data->ep_out->request.req_type = UIO_REQUEST_READ_FULL; rt_usbd_io_request(func->device, data->ep_out, &data->ep_out->request); - + return RT_EOK; } @@ -1037,11 +1037,11 @@ static rt_err_t _function_disable(ufunction_t func) RT_DEBUG_LOG(RT_DEBUG_USB, ("Mass storage function disabled\n")); - data = (struct mstorage*)func->user_data; + data = (struct mstorage*)func->user_data; if(data->ep_in->buffer != RT_NULL) { rt_free(data->ep_in->buffer); - data->ep_in->buffer = RT_NULL; + data->ep_in->buffer = RT_NULL; } if(data->ep_out->buffer != RT_NULL) @@ -1057,9 +1057,9 @@ static rt_err_t _function_disable(ufunction_t func) #endif data->disk = RT_NULL; } - + data->status = STAT_CBW; - + return RT_EOK; } @@ -1098,11 +1098,11 @@ ufunction_t rt_usbd_function_mstorage_create(udevice_t device) /* set usb device string description */ rt_usbd_device_set_string(device, _ustring); - + /* create a mass storage function */ func = rt_usbd_function_new(device, &dev_desc, &ops); device->dev_qualifier = &dev_qualifier; - + /* allocate memory for mass storage function data */ data = (struct mstorage*)rt_malloc(sizeof(struct mstorage)); rt_memset(data, 0, sizeof(struct mstorage)); @@ -1113,7 +1113,7 @@ ufunction_t rt_usbd_function_mstorage_create(udevice_t device) /* create an alternate setting object */ setting = rt_usbd_altsetting_new(sizeof(struct umass_descriptor)); - + /* config desc in alternate setting */ rt_usbd_altsetting_config_descriptor(setting, &_mass_desc, (rt_off_t)&((umass_desc_t)0)->intf_desc); @@ -1138,7 +1138,7 @@ ufunction_t rt_usbd_function_mstorage_create(udevice_t device) return func; } -struct udclass msc_class = +struct udclass msc_class = { .rt_usbd_function_create = rt_usbd_function_mstorage_create }; diff --git a/components/drivers/usb/usbdevice/class/mstorage.h b/components/drivers/usb/usbdevice/class/mstorage.h index 254038195b..6c81809ef2 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.h +++ b/components/drivers/usb/usbdevice/class/mstorage.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -8,7 +8,7 @@ * 2012-10-01 Yi Qiu first version * 2012-12-12 heyuanjie87 add MASS endpoints collection */ - + #ifndef __MSTORAGE_H__ #define __MSTORAGE_H__ @@ -23,7 +23,7 @@ struct umass_descriptor #endif struct uinterface_descriptor intf_desc; struct uendpoint_descriptor ep_out_desc; - struct uendpoint_descriptor ep_in_desc; + struct uendpoint_descriptor ep_in_desc; }; typedef struct umass_descriptor* umass_desc_t; diff --git a/components/drivers/usb/usbdevice/class/ndis.h b/components/drivers/usb/usbdevice/class/ndis.h index 6d6943366e..b83f3c78ec 100644 --- a/components/drivers/usb/usbdevice/class/ndis.h +++ b/components/drivers/usb/usbdevice/class/ndis.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -7,14 +7,14 @@ * Date Author Notes */ /* - * ndis.h - * + * ndis.h + * * Modified by Colin O'Flynn * ntddndis.h modified by Benedikt Spranger - * - * Thanks to the cygwin development team, + * + * Thanks to the cygwin development team, * espacially to Casper S. Hornstrup - * + * * THIS SOFTWARE IS NOT COPYRIGHTED * * This source code is offered for use in the public domain. You may @@ -30,7 +30,7 @@ #ifndef __NDIS_H__ #define __NDIS_H__ -#define NDIS_STATUS_MULTICAST_FULL 0xC0010009 +#define NDIS_STATUS_MULTICAST_FULL 0xC0010009 #define NDIS_STATUS_MULTICAST_EXISTS 0xC001000A #define NDIS_STATUS_MULTICAST_NOT_FOUND 0xC001000B @@ -42,21 +42,21 @@ #define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104 #define OID_PNP_ENABLE_WAKE_UP 0xFD010106 -enum NDIS_DEVICE_POWER_STATE +enum NDIS_DEVICE_POWER_STATE { - NdisDeviceStateUnspecified = 0, - NdisDeviceStateD0, - NdisDeviceStateD1, - NdisDeviceStateD2, - NdisDeviceStateD3, - NdisDeviceStateMaximum + NdisDeviceStateUnspecified = 0, + NdisDeviceStateD0, + NdisDeviceStateD1, + NdisDeviceStateD2, + NdisDeviceStateD3, + NdisDeviceStateMaximum }; struct NDIS_PM_WAKE_UP_CAPABILITIES { - enum NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp; - enum NDIS_DEVICE_POWER_STATE MinPatternWakeUp; - enum NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp; + enum NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp; + enum NDIS_DEVICE_POWER_STATE MinPatternWakeUp; + enum NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp; }; /* NDIS_PNP_CAPABILITIES.Flags constants */ @@ -194,36 +194,36 @@ struct NDIS_PM_WAKE_UP_CAPABILITIES #define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000 #define NDIS_MINIPORT_64BITS_DMA 0x01000000 -#define NDIS_MEDIUM_802_3 0x00000000 -#define NDIS_MEDIUM_802_5 0x00000001 -#define NDIS_MEDIUM_FDDI 0x00000002 -#define NDIS_MEDIUM_WAN 0x00000003 -#define NDIS_MEDIUM_LOCAL_TALK 0x00000004 -#define NDIS_MEDIUM_DIX 0x00000005 +#define NDIS_MEDIUM_802_3 0x00000000 +#define NDIS_MEDIUM_802_5 0x00000001 +#define NDIS_MEDIUM_FDDI 0x00000002 +#define NDIS_MEDIUM_WAN 0x00000003 +#define NDIS_MEDIUM_LOCAL_TALK 0x00000004 +#define NDIS_MEDIUM_DIX 0x00000005 #define NDIS_MEDIUM_ARCENT_RAW 0x00000006 #define NDIS_MEDIUM_ARCENT_878_2 0x00000007 -#define NDIS_MEDIUM_ATM 0x00000008 +#define NDIS_MEDIUM_ATM 0x00000008 #define NDIS_MEDIUM_WIRELESS_LAN 0x00000009 -#define NDIS_MEDIUM_IRDA 0x0000000A -#define NDIS_MEDIUM_BPC 0x0000000B -#define NDIS_MEDIUM_CO_WAN 0x0000000C -#define NDIS_MEDIUM_1394 0x0000000D - -#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 -#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 -#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 -#define NDIS_PACKET_TYPE_BROADCAST 0x00000008 -#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 -#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 -#define NDIS_PACKET_TYPE_SMT 0x00000040 -#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 -#define NDIS_PACKET_TYPE_GROUP 0x00000100 -#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200 -#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400 -#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800 - -#define NDIS_MEDIA_STATE_CONNECTED 0x00000000 -#define NDIS_MEDIA_STATE_DISCONNECTED 0x00000001 +#define NDIS_MEDIUM_IRDA 0x0000000A +#define NDIS_MEDIUM_BPC 0x0000000B +#define NDIS_MEDIUM_CO_WAN 0x0000000C +#define NDIS_MEDIUM_1394 0x0000000D + +#define NDIS_PACKET_TYPE_DIRECTED 0x00000001 +#define NDIS_PACKET_TYPE_MULTICAST 0x00000002 +#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 +#define NDIS_PACKET_TYPE_BROADCAST 0x00000008 +#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 +#define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 +#define NDIS_PACKET_TYPE_SMT 0x00000040 +#define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 +#define NDIS_PACKET_TYPE_GROUP 0x00000100 +#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00000200 +#define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400 +#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800 + +#define NDIS_MEDIA_STATE_CONNECTED 0x00000000 +#define NDIS_MEDIA_STATE_DISCONNECTED 0x00000001 #define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001 #define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002 diff --git a/components/drivers/usb/usbdevice/class/rndis.c b/components/drivers/usb/usbdevice/class/rndis.c index 93e0ba6ae2..391924dba0 100644 --- a/components/drivers/usb/usbdevice/class/rndis.c +++ b/components/drivers/usb/usbdevice/class/rndis.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -215,7 +215,7 @@ const static char* _ustring[] = }; ALIGN(4) -struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc = +struct usb_os_function_comp_id_descriptor rndis_func_comp_id_desc = { .bFirstInterfaceNumber = USB_DYNAMIC, .reserved1 = 0x01, @@ -347,7 +347,7 @@ static rt_err_t _rndis_init_response(ufunction_t func, rndis_init_msg_t msg) rt_list_insert_before(&((rt_rndis_eth_t)func->user_data)->response_list, &response->list); rt_hw_interrupt_enable(level); } - + return RT_EOK; } @@ -764,7 +764,7 @@ static rt_err_t send_encapsulated_command_done(udevice_t device, rt_size_t size) } //#error here have bug ep 0x82 send failed static rt_err_t _rndis_send_encapsulated_command(ufunction_t func, ureq_t setup) -{ +{ RT_ASSERT(setup->wLength <= sizeof(rndis_message_buffer)); function = func; rt_usbd_ep0_read(func->device,rndis_message_buffer,setup->wLength,send_encapsulated_command_done); @@ -808,7 +808,7 @@ static rt_err_t _rndis_get_encapsulated_response(ufunction_t func, ureq_t setup) data[1] = 0; ((rt_rndis_eth_t)func->user_data)->eps.ep_cmd->request.buffer = ((rt_rndis_eth_t)func->user_data)->eps.ep_cmd->buffer; ((rt_rndis_eth_t)func->user_data)->eps.ep_cmd->request.size = 8; - ((rt_rndis_eth_t)func->user_data)->eps.ep_cmd->request.req_type = UIO_REQUEST_WRITE; + ((rt_rndis_eth_t)func->user_data)->eps.ep_cmd->request.req_type = UIO_REQUEST_WRITE; rt_usbd_io_request(func->device, ((rt_rndis_eth_t)func->user_data)->eps.ep_cmd, &((rt_rndis_eth_t)func->user_data)->eps.ep_cmd->request); } else @@ -983,7 +983,7 @@ static rt_err_t _function_enable(ufunction_t func) ((rt_rndis_eth_t)func->user_data)->need_notify = RT_TRUE; rt_hw_interrupt_enable(level); } - + return RT_EOK; } @@ -1022,7 +1022,7 @@ static rt_err_t _function_disable(ufunction_t func) rt_hw_interrupt_enable(level); } - + /* link down. */ eth_device_linkchange(&((rt_rndis_eth_t)func->user_data)->parent, RT_FALSE); @@ -1323,7 +1323,7 @@ ufunction_t rt_usbd_function_rndis_create(udevice_t device) /* create a cdc class */ cdc = rt_usbd_function_new(device, &_dev_desc, &ops); rt_usbd_device_set_qualifier(device, &dev_qualifier); - _rndis= rt_malloc(sizeof(struct rt_rndis_eth)); + _rndis= rt_malloc(sizeof(struct rt_rndis_eth)); rt_memset(_rndis, 0, sizeof(struct rt_rndis_eth)); cdc->user_data = _rndis; @@ -1357,7 +1357,7 @@ ufunction_t rt_usbd_function_rndis_create(udevice_t device) rt_usbd_set_altsetting(intf_comm, 0); /* add the communication interface to the cdc class */ rt_usbd_function_add_interface(cdc, intf_comm); - + /* create a bulk in and a bulk out endpoint */ data_desc = (ucdc_data_desc_t)data_setting->desc; eps->ep_out = rt_usbd_endpoint_new(&data_desc->ep_out_desc, _ep_out_handler); @@ -1434,7 +1434,7 @@ ufunction_t rt_usbd_function_rndis_create(udevice_t device) return cdc; } -struct udclass rndis_class = +struct udclass rndis_class = { .rt_usbd_function_create = rt_usbd_function_rndis_create }; diff --git a/components/drivers/usb/usbdevice/class/rndis.h b/components/drivers/usb/usbdevice/class/rndis.h index fcdd249984..f25ae4931c 100644 --- a/components/drivers/usb/usbdevice/class/rndis.h +++ b/components/drivers/usb/usbdevice/class/rndis.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -13,43 +13,43 @@ #include -#define USB_ETH_MTU 1500+14 +#define USB_ETH_MTU 1500+14 #define RNDIS_MESSAGE_BUFFER_SIZE 128 #define RESPONSE_AVAILABLE 0x00000001 /* Remote NDIS version numbers */ -#define RNDIS_MAJOR_VERSION 1 +#define RNDIS_MAJOR_VERSION 1 #define RNDIS_MINOR_VERSION 0 /* common status values */ -#define RNDIS_STATUS_SUCCESS 0X00000000 -#define RNDIS_STATUS_FAILURE 0XC0000001 -#define RNDIS_STATUS_INVALID_DATA 0XC0010015 -#define RNDIS_STATUS_NOT_SUPPORTED 0XC00000BB -#define RNDIS_STATUS_MEDIA_CONNECT 0X4001000B -#define RNDIS_STATUS_MEDIA_DISCONNECT 0X4001000C +#define RNDIS_STATUS_SUCCESS 0X00000000 +#define RNDIS_STATUS_FAILURE 0XC0000001 +#define RNDIS_STATUS_INVALID_DATA 0XC0010015 +#define RNDIS_STATUS_NOT_SUPPORTED 0XC00000BB +#define RNDIS_STATUS_MEDIA_CONNECT 0X4001000B +#define RNDIS_STATUS_MEDIA_DISCONNECT 0X4001000C /* Remote NDIS message types */ -#define REMOTE_NDIS_PACKET_MSG 0x00000001 -#define REMOTE_NDIS_INITIALIZE_MSG 0X00000002 -#define REMOTE_NDIS_HALT_MSG 0X00000003 -#define REMOTE_NDIS_QUERY_MSG 0X00000004 -#define REMOTE_NDIS_SET_MSG 0X00000005 -#define REMOTE_NDIS_RESET_MSG 0X00000006 +#define REMOTE_NDIS_PACKET_MSG 0x00000001 +#define REMOTE_NDIS_INITIALIZE_MSG 0X00000002 +#define REMOTE_NDIS_HALT_MSG 0X00000003 +#define REMOTE_NDIS_QUERY_MSG 0X00000004 +#define REMOTE_NDIS_SET_MSG 0X00000005 +#define REMOTE_NDIS_RESET_MSG 0X00000006 #define REMOTE_NDIS_INDICATE_STATUS_MSG 0X00000007 -#define REMOTE_NDIS_KEEPALIVE_MSG 0X00000008 -#define REMOTE_NDIS_INITIALIZE_CMPLT 0X80000002 -#define REMOTE_NDIS_QUERY_CMPLT 0X80000004 -#define REMOTE_NDIS_SET_CMPLT 0X80000005 -#define REMOTE_NDIS_RESET_CMPLT 0X80000006 -#define REMOTE_NDIS_KEEPALIVE_CMPLT 0X80000008 +#define REMOTE_NDIS_KEEPALIVE_MSG 0X00000008 +#define REMOTE_NDIS_INITIALIZE_CMPLT 0X80000002 +#define REMOTE_NDIS_QUERY_CMPLT 0X80000004 +#define REMOTE_NDIS_SET_CMPLT 0X80000005 +#define REMOTE_NDIS_RESET_CMPLT 0X80000006 +#define REMOTE_NDIS_KEEPALIVE_CMPLT 0X80000008 /* device flags */ -#define RNDIS_DF_CONNECTIONLESS 0x00000001 -#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 +#define RNDIS_DF_CONNECTIONLESS 0x00000001 +#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002 /* mediums */ -#define RNDIS_MEDIUM_802_3 0x00000000 +#define RNDIS_MEDIUM_802_3 0x00000000 struct ucls_rndis { @@ -64,24 +64,24 @@ struct ucls_rndis /* Remote NDIS generic message type */ struct rndis_gen_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; }; typedef struct rndis_gen_msg* rndis_gen_msg_t; struct rndis_packet_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t DataOffset; - rt_uint32_t DataLength; - rt_uint32_t OOBDataOffset; - rt_uint32_t OOBDataLength; - rt_uint32_t NumOOBDataElements; - rt_uint32_t PerPacketInfoOffset; - rt_uint32_t PerPacketInfoLength; - rt_uint32_t VcHandle; - rt_uint32_t Reserved; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t DataOffset; + rt_uint32_t DataLength; + rt_uint32_t OOBDataOffset; + rt_uint32_t OOBDataLength; + rt_uint32_t NumOOBDataElements; + rt_uint32_t PerPacketInfoOffset; + rt_uint32_t PerPacketInfoLength; + rt_uint32_t VcHandle; + rt_uint32_t Reserved; }; typedef struct rndis_packet_msg* rndis_packet_msg_t; @@ -89,132 +89,132 @@ typedef struct rndis_packet_msg* rndis_packet_msg_t; struct rndis_init_msg { rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t MajorVersion; - rt_uint32_t MinorVersion; - rt_uint32_t MaxTransferSize; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t MajorVersion; + rt_uint32_t MinorVersion; + rt_uint32_t MaxTransferSize; }; typedef struct rndis_init_msg* rndis_init_msg_t; /* Response */ struct rndis_init_cmplt { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t Status; - rt_uint32_t MajorVersion; - rt_uint32_t MinorVersion; - rt_uint32_t DeviceFlags; - rt_uint32_t Medium; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t Status; + rt_uint32_t MajorVersion; + rt_uint32_t MinorVersion; + rt_uint32_t DeviceFlags; + rt_uint32_t Medium; rt_uint32_t MaxPacketsPerTransfer; - rt_uint32_t MaxTransferSize; + rt_uint32_t MaxTransferSize; rt_uint32_t PacketAlignmentFactor; - rt_uint32_t AfListOffset; - rt_uint32_t AfListSize; + rt_uint32_t AfListOffset; + rt_uint32_t AfListSize; }; typedef struct rndis_init_cmplt* rndis_init_cmplt_t; /* Remote NDIS Halt Message */ struct rndis_halt_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; }; /* Remote NDIS Query Message */ struct rndis_query_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t Oid; - rt_uint32_t InformationBufferLength; - rt_uint32_t InformationBufferOffset; - rt_uint32_t DeviceVcHandle; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t Oid; + rt_uint32_t InformationBufferLength; + rt_uint32_t InformationBufferOffset; + rt_uint32_t DeviceVcHandle; }; typedef struct rndis_query_msg* rndis_query_msg_t; /* Response */ struct rndis_query_cmplt { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t Status; - rt_uint32_t InformationBufferLength; - rt_uint32_t InformationBufferOffset; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t Status; + rt_uint32_t InformationBufferLength; + rt_uint32_t InformationBufferOffset; }; typedef struct rndis_query_cmplt* rndis_query_cmplt_t; /* Remote NDIS Set Message */ struct rndis_set_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t Oid; - rt_uint32_t InformationBufferLength; - rt_uint32_t InformationBufferOffset; - rt_uint32_t DeviceVcHandle; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t Oid; + rt_uint32_t InformationBufferLength; + rt_uint32_t InformationBufferOffset; + rt_uint32_t DeviceVcHandle; }; typedef struct rndis_set_msg* rndis_set_msg_t; /* Response */ struct rndis_set_cmplt { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t Status; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t Status; }; typedef struct rndis_set_cmplt* rndis_set_cmplt_t; /* Remote NDIS Soft Reset Message */ struct rndis_reset_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t Reserved; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t Reserved; }; /* Remote NDIS Soft Reset Response */ struct rndis_reset_cmplt { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t Status; - rt_uint32_t AddressingReset; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t Status; + rt_uint32_t AddressingReset; }; /* Remote NDIS Indicate Status Message */ struct rndis_indicate_status_msg { rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t Status; - rt_uint32_t StatusBufferLength; - rt_uint32_t StatusBufferOffset; + rt_uint32_t MessageLength; + rt_uint32_t Status; + rt_uint32_t StatusBufferLength; + rt_uint32_t StatusBufferOffset; }; typedef struct rndis_indicate_status_msg* rndis_indicate_status_msg_t; struct rndis_keepalive_msg { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestID; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestID; }; typedef struct rndis_keepalive_msg* rndis_keepalive_msg_t; /* Response: */ struct rndis_keepalive_cmplt { - rt_uint32_t MessageType; - rt_uint32_t MessageLength; - rt_uint32_t RequestId; - rt_uint32_t Status; + rt_uint32_t MessageType; + rt_uint32_t MessageLength; + rt_uint32_t RequestId; + rt_uint32_t Status; }; typedef struct rndis_keepalive_cmplt* rndis_keepalive_cmplt_t; diff --git a/components/drivers/usb/usbdevice/class/winusb.c b/components/drivers/usb/usbdevice/class/winusb.c index 4af6dba3cf..0db3de794a 100644 --- a/components/drivers/usb/usbdevice/class/winusb.c +++ b/components/drivers/usb/usbdevice/class/winusb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -57,7 +57,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; ALIGN(4) -struct winusb_descriptor _winusb_desc = +struct winusb_descriptor _winusb_desc = { #ifdef RT_USB_DEVICE_COMPOSITE /* Interface Association Descriptor */ @@ -117,13 +117,13 @@ const static char* _ustring[] = }; ALIGN(4) -struct usb_os_proerty winusb_proerty[] = +struct usb_os_proerty winusb_proerty[] = { USB_OS_PROPERTY_DESC(USB_OS_PROPERTY_TYPE_REG_SZ,"DeviceInterfaceGUID",RT_WINUSB_GUID), }; ALIGN(4) -struct usb_os_function_comp_id_descriptor winusb_func_comp_id_desc = +struct usb_os_function_comp_id_descriptor winusb_func_comp_id_desc = { .bFirstInterfaceNumber = USB_DYNAMIC, .reserved1 = 0x01, @@ -155,7 +155,7 @@ static ufunction_t cmd_func = RT_NULL; static rt_err_t _ep0_cmd_handler(udevice_t device, rt_size_t size) { winusb_device_t winusb_device; - + if(cmd_func != RT_NULL) { winusb_device = (winusb_device_t)cmd_func->user_data; @@ -191,7 +191,7 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup) _ep0_cmd_read(func, setup); break; } - + return RT_EOK; } static rt_err_t _function_enable(ufunction_t func) @@ -291,7 +291,7 @@ static rt_err_t rt_usb_winusb_init(ufunction_t func) winusb_device->parent.user_data = func; - + return rt_device_register(&winusb_device->parent, "winusb", RT_DEVICE_FLAG_RDWR); } @@ -352,7 +352,7 @@ ufunction_t rt_usbd_function_winusb_create(udevice_t device) return func; } -struct udclass winusb_class = +struct udclass winusb_class = { .rt_usbd_function_create = rt_usbd_function_winusb_create }; diff --git a/components/drivers/usb/usbdevice/class/winusb.h b/components/drivers/usb/usbdevice/class/winusb.h index b5f87b4e56..43fec34b6a 100644 --- a/components/drivers/usb/usbdevice/class/winusb.h +++ b/components/drivers/usb/usbdevice/class/winusb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbdevice/core/usbdevice.c b/components/drivers/usb/usbdevice/core/usbdevice.c index 2455bd8017..0891c0bd26 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice.c +++ b/components/drivers/usb/usbdevice/core/usbdevice.c @@ -1,9 +1,9 @@ /* * File : hid.c - * COPYRIGHT (C) 2008 - 2018, RT-Thread Development Team + * COPYRIGHT (C) 2006 - 2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2012-10-02 Yi Qiu first version @@ -62,7 +62,7 @@ static struct usb_qualifier_descriptor dev_qualifier = }; #endif -struct usb_os_comp_id_descriptor usb_comp_id_desc = +struct usb_os_comp_id_descriptor usb_comp_id_desc = { //head section { diff --git a/components/drivers/usb/usbdevice/core/usbdevice_core.c b/components/drivers/usb/usbdevice/core/usbdevice_core.c index ef569d7bf2..fd205ad37f 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice_core.c +++ b/components/drivers/usb/usbdevice/core/usbdevice_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -238,7 +238,7 @@ static rt_err_t _get_interface(struct udevice* device, ureq_t setup) rt_uint8_t value; uintf_t intf; ufunction_t func; - + /* parameter check */ RT_ASSERT(device != RT_NULL); RT_ASSERT(setup != RT_NULL); @@ -262,7 +262,7 @@ static rt_err_t _get_interface(struct udevice* device, ureq_t setup) { intf->handler(func, setup); } - + return RT_EOK; } @@ -293,7 +293,7 @@ static rt_err_t _set_interface(struct udevice* device, ureq_t setup) rt_usbd_ep0_set_stall(device); return -RT_ERROR; } - + /* find the specified interface */ intf = rt_usbd_find_interface(device, setup->wIndex & 0xFF, &func); @@ -309,12 +309,12 @@ static rt_err_t _set_interface(struct udevice* device, ureq_t setup) dcd_ep_enable(device->dcd, ep); } dcd_ep0_send_status(device->dcd); - + if (intf->handler) { intf->handler(func, setup); } - + return RT_EOK; } @@ -336,7 +336,7 @@ static rt_err_t _get_config(struct udevice* device, ureq_t setup) RT_ASSERT(device->curr_cfg != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("_get_config\n")); - + if (device->state == USB_STATE_CONFIGURED) { /* get current configuration */ @@ -443,7 +443,7 @@ static rt_err_t _set_address(struct udevice* device, ureq_t setup) dcd_ep0_send_status(device->dcd); RT_DEBUG_LOG(RT_DEBUG_USB, ("_set_address\n")); - + device->state = USB_STATE_ADDRESS; return RT_EOK; @@ -479,7 +479,7 @@ static rt_err_t _request_interface(struct udevice* device, ureq_t setup) { ret = -RT_ERROR; } - + return ret; } @@ -564,9 +564,9 @@ static rt_err_t _standard_request(struct udevice* device, ureq_t setup) case USB_REQ_GET_STATUS: { uep_t ep; - + ep = rt_usbd_find_endpoint(device, RT_NULL, setup->wIndex); - value = ep->stalled; + value = ep->stalled; rt_usbd_ep0_write(device, &value, 2); } break; @@ -581,13 +581,13 @@ static rt_err_t _standard_request(struct udevice* device, ureq_t setup) { rt_usbd_clear_feature(device, setup->wValue, setup->wIndex); dcd_ep0_send_status(dcd); - ep->stalled = RT_FALSE; + ep->stalled = RT_FALSE; for (node = ep->request_list.next; node != &ep->request_list; node = node->next) { - req = (uio_request_t)rt_list_entry(node, struct uio_request, list); + req = (uio_request_t)rt_list_entry(node, struct uio_request, list); rt_usbd_io_request(device, ep, req); - RT_DEBUG_LOG(RT_DEBUG_USB, ("fired a request\n")); + RT_DEBUG_LOG(RT_DEBUG_USB, ("fired a request\n")); } rt_list_init(&ep->request_list); @@ -601,10 +601,10 @@ static rt_err_t _standard_request(struct udevice* device, ureq_t setup) if(USB_EP_HALT == setup->wValue) { ep = rt_usbd_find_endpoint(device, RT_NULL, setup->wIndex); - ep->stalled = RT_TRUE; + ep->stalled = RT_TRUE; rt_usbd_set_feature(device, setup->wValue, setup->wIndex); dcd_ep0_send_status(dcd); - } + } } break; case USB_REQ_SYNCH_FRAME: @@ -698,7 +698,7 @@ static rt_err_t _vendor_request(udevice_t device, ureq_t setup) { rt_uint8_t * pusb_comp_id_desc; rt_list_t *p; - usb_comp_id_desc_size = sizeof(struct usb_os_header_comp_id_descriptor) + + usb_comp_id_desc_size = sizeof(struct usb_os_header_comp_id_descriptor) + (sizeof(struct usb_os_function_comp_id_descriptor)-sizeof(rt_list_t))*rt_list_len(&device->os_comp_id_desc->func_desc); usb_comp_id_desc = (rt_uint8_t *)rt_malloc(usb_comp_id_desc_size); @@ -707,7 +707,7 @@ static rt_err_t _vendor_request(udevice_t device, ureq_t setup) pusb_comp_id_desc = usb_comp_id_desc; rt_memcpy((void *)pusb_comp_id_desc,(void *)&device->os_comp_id_desc->head_desc,sizeof(struct usb_os_header_comp_id_descriptor)); pusb_comp_id_desc += sizeof(struct usb_os_header_comp_id_descriptor); - + for (p = device->os_comp_id_desc->func_desc.next; p != &device->os_comp_id_desc->func_desc; p = p->next) { func_comp_id_desc = rt_list_entry(p,struct usb_os_function_comp_id_descriptor,list); @@ -726,7 +726,7 @@ static rt_err_t _vendor_request(udevice_t device, ureq_t setup) } break; } - + break; } return RT_EOK; @@ -784,7 +784,7 @@ static rt_err_t _setup_request(udevice_t device, ureq_t setup) /** * This function will hanle data notify event. * - * @param device the usb device object. + * @param device the usb device object. * @param ep_msg the endpoint message. * * @return RT_EOK. @@ -794,18 +794,18 @@ static rt_err_t _data_notify(udevice_t device, struct ep_msg* ep_msg) uep_t ep; ufunction_t func; rt_size_t size = 0; - + RT_ASSERT(device != RT_NULL); RT_ASSERT(ep_msg != RT_NULL); - + if (device->state != USB_STATE_CONFIGURED) { return -RT_ERROR; } - + ep = rt_usbd_find_endpoint(device, &func, ep_msg->ep_addr); if(ep == RT_NULL) - { + { rt_kprintf("invalid endpoint\n"); return -RT_ERROR; } @@ -817,7 +817,7 @@ static rt_err_t _data_notify(udevice_t device, struct ep_msg* ep_msg) { dcd_ep_write(device->dcd, EP_ADDRESS(ep), ep->request.buffer, EP_MAXPACKET(ep)); ep->request.remain_size -= EP_MAXPACKET(ep); - ep->request.buffer += EP_MAXPACKET(ep); + ep->request.buffer += EP_MAXPACKET(ep); } else if(ep->request.remain_size > 0) { @@ -834,9 +834,9 @@ static rt_err_t _data_notify(udevice_t device, struct ep_msg* ep_msg) size = ep_msg->size; if(ep->request.remain_size == 0) { - return RT_EOK; + return RT_EOK; } - + if(size == 0) { size = dcd_ep_read(device->dcd, EP_ADDRESS(ep), ep->request.buffer); @@ -865,9 +865,9 @@ static rt_err_t _ep0_out_notify(udevice_t device, struct ep_msg* ep_msg) { uep_t ep0; rt_size_t size; - + RT_ASSERT(device != RT_NULL); - RT_ASSERT(ep_msg != RT_NULL); + RT_ASSERT(ep_msg != RT_NULL); RT_ASSERT(device->dcd != RT_NULL); ep0 = &device->dcd->ep0; @@ -875,18 +875,18 @@ static rt_err_t _ep0_out_notify(udevice_t device, struct ep_msg* ep_msg) if(ep0->request.remain_size == 0) { - return RT_EOK; - } + return RT_EOK; + } if(size == 0) { size = dcd_ep_read(device->dcd, EP0_OUT_ADDR, ep0->request.buffer); if(size == 0) { return RT_EOK; - } + } } - ep0->request.remain_size -= size; + ep0->request.remain_size -= size; ep0->request.buffer += size; if(ep0->request.remain_size == 0) { @@ -894,7 +894,7 @@ static rt_err_t _ep0_out_notify(udevice_t device, struct ep_msg* ep_msg) if(ep0->rx_indicate != RT_NULL) { ep0->rx_indicate(device, size); - } + } } else { @@ -959,10 +959,10 @@ static rt_err_t _stop_notify(udevice_t device) static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size) { rt_uint16_t maxpacket; - - RT_ASSERT(device != RT_NULL); + + RT_ASSERT(device != RT_NULL); RT_ASSERT(device->dcd != RT_NULL); - RT_ASSERT(ep != RT_NULL); + RT_ASSERT(ep != RT_NULL); rt_enter_critical(); maxpacket = EP_MAXPACKET(ep); @@ -970,11 +970,11 @@ static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_s { dcd_ep_write(device->dcd, EP_ADDRESS(ep), ep->request.buffer, maxpacket); ep->request.remain_size -= maxpacket; - ep->request.buffer += maxpacket; + ep->request.buffer += maxpacket; } else { - dcd_ep_write(device->dcd, EP_ADDRESS(ep), ep->request.buffer, + dcd_ep_write(device->dcd, EP_ADDRESS(ep), ep->request.buffer, ep->request.remain_size); ep->request.remain_size = 0; } @@ -984,9 +984,9 @@ static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_s static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size) { - RT_ASSERT(device != RT_NULL); + RT_ASSERT(device != RT_NULL); RT_ASSERT(device->dcd != RT_NULL); - RT_ASSERT(ep != RT_NULL); + RT_ASSERT(ep != RT_NULL); RT_ASSERT(buffer != RT_NULL); RT_ASSERT(ep->ep_desc != RT_NULL); @@ -1705,7 +1705,7 @@ rt_err_t rt_usbd_set_config(udevice_t device, rt_uint8_t value) device->curr_cfg = cfg; dcd_set_config(device->dcd, value); - + return RT_TRUE; } @@ -1713,7 +1713,7 @@ rt_err_t rt_usbd_set_config(udevice_t device, rt_uint8_t value) * This function will bRequest an IO transaction. * * @param device the usb device object. - * @param ep the endpoint object. + * @param ep the endpoint object. * @param req IO bRequest. * * @return RT_EOK. @@ -1721,7 +1721,7 @@ rt_err_t rt_usbd_set_config(udevice_t device, rt_uint8_t value) rt_size_t rt_usbd_io_request(udevice_t device, uep_t ep, uio_request_t req) { rt_size_t size = 0; - + RT_ASSERT(device != RT_NULL); RT_ASSERT(req != RT_NULL); @@ -1747,7 +1747,7 @@ rt_size_t rt_usbd_io_request(udevice_t device, uep_t ep, uio_request_t req) { rt_list_insert_before(&ep->request_list, &req->list); RT_DEBUG_LOG(RT_DEBUG_USB, ("suspend a request\n")); - } + } return size; } @@ -1770,10 +1770,10 @@ rt_err_t rt_usbd_set_feature(udevice_t device, rt_uint16_t value, rt_uint16_t in } else if (value == USB_FEATURE_ENDPOINT_HALT) { - RT_DEBUG_LOG(RT_DEBUG_USB, ("set feature stall\n")); + RT_DEBUG_LOG(RT_DEBUG_USB, ("set feature stall\n")); dcd_ep_set_stall(device->dcd, (rt_uint32_t)(index & 0xFF)); } - + return RT_EOK; } @@ -1798,38 +1798,38 @@ rt_err_t rt_usbd_clear_feature(udevice_t device, rt_uint16_t value, rt_uint16_t RT_DEBUG_LOG(RT_DEBUG_USB, ("clear feature stall\n")); dcd_ep_clear_stall(device->dcd, (rt_uint32_t)(index & 0xFF)); } - + return RT_EOK; } rt_err_t rt_usbd_ep0_set_stall(udevice_t device) { RT_ASSERT(device != RT_NULL); - + return dcd_ep_set_stall(device->dcd, 0); } rt_err_t rt_usbd_ep0_clear_stall(udevice_t device) { RT_ASSERT(device != RT_NULL); - + return dcd_ep_clear_stall(device->dcd, 0); } rt_err_t rt_usbd_ep_set_stall(udevice_t device, uep_t ep) { rt_err_t ret; - + RT_ASSERT(device != RT_NULL); RT_ASSERT(ep != RT_NULL); - RT_ASSERT(ep->ep_desc != RT_NULL); + RT_ASSERT(ep->ep_desc != RT_NULL); ret = dcd_ep_set_stall(device->dcd, EP_ADDRESS(ep)); if(ret == RT_EOK) { ep->stalled = RT_TRUE; } - + return ret; } @@ -1846,44 +1846,44 @@ rt_err_t rt_usbd_ep_clear_stall(udevice_t device, uep_t ep) { ep->stalled = RT_FALSE; } - + return ret; } static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep) { int i = 0; - + RT_ASSERT(device != RT_NULL); - RT_ASSERT(device->dcd != RT_NULL); - RT_ASSERT(device->dcd->ep_pool != RT_NULL); + RT_ASSERT(device->dcd != RT_NULL); + RT_ASSERT(device->dcd->ep_pool != RT_NULL); RT_ASSERT(ep != RT_NULL); RT_ASSERT(ep->ep_desc != RT_NULL); while(device->dcd->ep_pool[i].addr != 0xFF) { - if(device->dcd->ep_pool[i].status == ID_UNASSIGNED && + if(device->dcd->ep_pool[i].status == ID_UNASSIGNED && ep->ep_desc->bmAttributes == device->dcd->ep_pool[i].type && (EP_ADDRESS(ep) & 0x80) == device->dcd->ep_pool[i].dir) { EP_ADDRESS(ep) |= device->dcd->ep_pool[i].addr; ep->id = &device->dcd->ep_pool[i]; device->dcd->ep_pool[i].status = ID_ASSIGNED; - RT_DEBUG_LOG(RT_DEBUG_USB, ("assigned %d\n", device->dcd->ep_pool[i].addr)); + RT_DEBUG_LOG(RT_DEBUG_USB, ("assigned %d\n", device->dcd->ep_pool[i].addr)); return RT_EOK; } - + i++; } - + return -RT_ERROR; } rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep) { RT_ASSERT(device != RT_NULL); - RT_ASSERT(device->dcd != RT_NULL); - RT_ASSERT(device->dcd->ep_pool != RT_NULL); + RT_ASSERT(device->dcd != RT_NULL); + RT_ASSERT(device->dcd->ep_pool != RT_NULL); RT_ASSERT(ep != RT_NULL); RT_ASSERT(ep->ep_desc != RT_NULL); @@ -1911,8 +1911,8 @@ rt_err_t rt_usbd_ep0_setup_handler(udcd_t dcd, struct urequest* setup) else { rt_memcpy((void*)&msg.content.setup, (void*)setup, sizeof(struct urequest)); - } - + } + msg.type = USB_MSG_SETUP_NOTIFY; msg.dcd = dcd; rt_usbd_event_signal(&msg); @@ -2011,7 +2011,7 @@ rt_err_t rt_usbd_reset_handler(udcd_t dcd) struct udev_msg msg; RT_ASSERT(dcd != RT_NULL); - + msg.type = USB_MSG_RESET; msg.dcd = dcd; rt_usbd_event_signal(&msg); @@ -2024,7 +2024,7 @@ rt_err_t rt_usbd_connect_handler(udcd_t dcd) struct udev_msg msg; RT_ASSERT(dcd != RT_NULL); - + msg.type = USB_MSG_PLUG_IN; msg.dcd = dcd; rt_usbd_event_signal(&msg); @@ -2037,7 +2037,7 @@ rt_err_t rt_usbd_disconnect_handler(udcd_t dcd) struct udev_msg msg; RT_ASSERT(dcd != RT_NULL); - + msg.type = USB_MSG_PLUG_OUT; msg.dcd = dcd; rt_usbd_event_signal(&msg); @@ -2050,7 +2050,7 @@ rt_err_t rt_usbd_sof_handler(udcd_t dcd) struct udev_msg msg; RT_ASSERT(dcd != RT_NULL); - + msg.type = USB_MSG_SOF; msg.dcd = dcd; rt_usbd_event_signal(&msg); @@ -2063,7 +2063,7 @@ rt_size_t rt_usbd_ep0_write(udevice_t device, void *buffer, rt_size_t size) uep_t ep0; rt_size_t sent_size = 0; - RT_ASSERT(device != RT_NULL); + RT_ASSERT(device != RT_NULL); RT_ASSERT(device->dcd != RT_NULL); RT_ASSERT(buffer != RT_NULL); RT_ASSERT(size > 0); @@ -2085,7 +2085,7 @@ rt_size_t rt_usbd_ep0_write(udevice_t device, void *buffer, rt_size_t size) return dcd_ep_write(device->dcd, EP0_IN_ADDR, ep0->request.buffer, sent_size); } -rt_size_t rt_usbd_ep0_read(udevice_t device, void *buffer, rt_size_t size, +rt_size_t rt_usbd_ep0_read(udevice_t device, void *buffer, rt_size_t size, rt_err_t (*rx_ind)(udevice_t device, rt_size_t size)) { uep_t ep0; @@ -2096,7 +2096,7 @@ rt_size_t rt_usbd_ep0_read(udevice_t device, void *buffer, rt_size_t size, RT_ASSERT(buffer != RT_NULL); ep0 = &device->dcd->ep0; - ep0->request.buffer = (rt_uint8_t *)buffer; + ep0->request.buffer = (rt_uint8_t *)buffer; ep0->request.remain_size = size; ep0->rx_indicate = rx_ind; if(size >= ep0->id->maxpacket) @@ -2143,7 +2143,7 @@ static void rt_usbd_thread_entry(void* parameter) } RT_DEBUG_LOG(RT_DEBUG_USB, ("message type %d\n", msg.type)); - + switch (msg.type) { case USB_MSG_SOF: @@ -2160,7 +2160,7 @@ static void rt_usbd_thread_entry(void* parameter) case USB_MSG_EP0_OUT: _ep0_out_notify(device, &msg.content.ep_msg); break; - case USB_MSG_RESET: + case USB_MSG_RESET: RT_DEBUG_LOG(RT_DEBUG_USB, ("reset %d\n", device->state)); if (device->state == USB_STATE_ADDRESS || device->state == USB_STATE_CONFIGURED) _stop_notify(device); @@ -2170,7 +2170,7 @@ static void rt_usbd_thread_entry(void* parameter) device->state = USB_STATE_ATTACHED; break; case USB_MSG_PLUG_OUT: - device->state = USB_STATE_NOTATTACHED; + device->state = USB_STATE_NOTATTACHED; _stop_notify(device); break; default: diff --git a/components/drivers/usb/usbhost/class/adk.c b/components/drivers/usb/usbhost/class/adk.c index 2425de7bba..492a2f9bb7 100644 --- a/components/drivers/usb/usbhost/class/adk.c +++ b/components/drivers/usb/usbhost/class/adk.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbhost/class/adk.h b/components/drivers/usb/usbhost/class/adk.h index c582ad7f17..aebe7de705 100644 --- a/components/drivers/usb/usbhost/class/adk.h +++ b/components/drivers/usb/usbhost/class/adk.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,7 +19,7 @@ struct uadkinst upipe_t pipe_out; struct rt_device device; -}; +}; typedef struct uadkinst* uadk_t; #define USB_ACCESSORY_VENDOR_ID 0x18D1 diff --git a/components/drivers/usb/usbhost/class/hid.c b/components/drivers/usb/usbhost/class/hid.c index b097b01679..eaf413a2a6 100644 --- a/components/drivers/usb/usbhost/class/hid.c +++ b/components/drivers/usb/usbhost/class/hid.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -24,22 +24,22 @@ static rt_list_t _protocal_list; * @param intf the interface instance. * @duration the idle period of requesting data. * @report_id the report id - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hid_set_idle(struct uhintf* intf, int duration, int report_id) { struct urequest setup; - struct uinstance* device; + struct uinstance* device; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(intf != RT_NULL); RT_ASSERT(intf->device != RT_NULL); device = intf->device; - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE; setup.bRequest = USB_REQ_SET_IDLE; setup.wIndex = 0; @@ -49,7 +49,7 @@ rt_err_t rt_usbh_hid_set_idle(struct uhintf* intf, int duration, int report_id) if (rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) == 8) return RT_EOK; else - return -RT_FALSE; + return -RT_FALSE; } /** @@ -58,23 +58,23 @@ rt_err_t rt_usbh_hid_set_idle(struct uhintf* intf, int duration, int report_id) * @param intf the interface instance. * @buffer the data buffer to save usb report descriptor. * @param nbytes the size of buffer - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_hid_get_report(struct uhintf* intf, rt_uint8_t type, +rt_err_t rt_usbh_hid_get_report(struct uhintf* intf, rt_uint8_t type, rt_uint8_t id, rt_uint8_t *buffer, rt_size_t size) { struct urequest setup; struct uinstance* device; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(intf != RT_NULL); RT_ASSERT(intf->device != RT_NULL); device = intf->device; - setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE; setup.bRequest = USB_REQ_GET_REPORT; setup.wIndex = intf->intf_desc->bInterfaceNumber; @@ -93,7 +93,7 @@ rt_err_t rt_usbh_hid_get_report(struct uhintf* intf, rt_uint8_t type, } else return -RT_FALSE; - return -RT_FALSE; + return -RT_FALSE; } /** @@ -102,22 +102,22 @@ rt_err_t rt_usbh_hid_get_report(struct uhintf* intf, rt_uint8_t type, * @param intf the interface instance. * @buffer the data buffer to save usb report descriptor. * @param nbytes the size of buffer - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hid_set_report(struct uhintf* intf, rt_uint8_t *buffer, rt_size_t size) { struct urequest setup; - struct uinstance* device; + struct uinstance* device; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(intf != RT_NULL); RT_ASSERT(intf->device != RT_NULL); - + device = intf->device; - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE; setup.bRequest = USB_REQ_SET_REPORT; setup.wIndex = intf->intf_desc->bInterfaceNumber; @@ -127,7 +127,7 @@ rt_err_t rt_usbh_hid_set_report(struct uhintf* intf, rt_uint8_t *buffer, rt_size if (rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) == 8) return RT_EOK; else - return -RT_FALSE; + return -RT_FALSE; } /** @@ -135,7 +135,7 @@ rt_err_t rt_usbh_hid_set_report(struct uhintf* intf, rt_uint8_t *buffer, rt_size * * @param intf the interface instance. * @param protocol the protocol id. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hid_set_protocal(struct uhintf* intf, int protocol) @@ -143,14 +143,14 @@ rt_err_t rt_usbh_hid_set_protocal(struct uhintf* intf, int protocol) struct urequest setup; struct uinstance* device; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(intf != RT_NULL); RT_ASSERT(intf->device != RT_NULL); - + device = intf->device; - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE; setup.bRequest = USB_REQ_SET_PROTOCOL; setup.wIndex = 0; @@ -160,33 +160,33 @@ rt_err_t rt_usbh_hid_set_protocal(struct uhintf* intf, int protocol) if (rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) == 8) return RT_EOK; else - return -RT_FALSE; + return -RT_FALSE; } /** - * This function will do USB_REQ_GET_DESCRIPTOR request for the device instance + * This function will do USB_REQ_GET_DESCRIPTOR request for the device instance * to set feature of the hub port. * * @param intf the interface instance. * @buffer the data buffer to save usb report descriptor. * @param nbytes the size of buffer - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_hid_get_report_descriptor(struct uhintf* intf, +rt_err_t rt_usbh_hid_get_report_descriptor(struct uhintf* intf, rt_uint8_t *buffer, rt_size_t size) { struct urequest setup; - struct uinstance* device; + struct uinstance* device; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(intf != RT_NULL); RT_ASSERT(intf->device != RT_NULL); - + device = intf->device; - setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_STANDARD| + setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_STANDARD| USB_REQ_TYPE_INTERFACE; setup.bRequest = USB_REQ_GET_DESCRIPTOR; setup.wIndex = 0; @@ -212,7 +212,7 @@ rt_err_t rt_usbh_hid_get_report_descriptor(struct uhintf* intf, * This function will register specified hid protocal to protocal list * * @param protocal the specified protocal. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hid_protocal_register(uprotocal_t protocal) @@ -223,26 +223,26 @@ rt_err_t rt_usbh_hid_protocal_register(uprotocal_t protocal) /* insert class driver into driver list */ rt_list_insert_after(&_protocal_list, &(protocal->list)); - - return RT_EOK; + + return RT_EOK; } /** * This function is the callback function of hid's int endpoint, it is invoked when data comes. * * @param context the context of the callback function. - * + * * @return none. */ static void rt_usbh_hid_callback(void* context) { - upipe_t pipe; + upipe_t pipe; struct uhid* hid; int timeout = USB_TIMEOUT_LONG; /* parameter check */ RT_ASSERT(context != RT_NULL); - + pipe = (upipe_t)context; hid = (struct uhid*)((struct uhintf*)pipe->inst)->user_data; @@ -252,7 +252,7 @@ static void rt_usbh_hid_callback(void* context) /* parameter check */ RT_ASSERT(((struct uhintf*)pipe->inst)->device->hcd != RT_NULL); - rt_usb_hcd_pipe_xfer(((struct uhintf*)pipe->inst)->device->hcd, pipe, + rt_usb_hcd_pipe_xfer(((struct uhintf*)pipe->inst)->device->hcd, pipe, hid->buffer, pipe->ep.wMaxPacketSize, timeout); } @@ -260,7 +260,7 @@ static void rt_usbh_hid_callback(void* context) * This function will find specified hid protocal from protocal list * * @param pro_id the protocal id. - * + * * @return the found protocal or RT_NULL if there is no this protocal. */ static uprotocal_t rt_usbh_hid_protocal_find(int pro_id) @@ -270,7 +270,7 @@ static uprotocal_t rt_usbh_hid_protocal_find(int pro_id) /* try to find protocal object */ for (node = _protocal_list.next; node != &_protocal_list; node = node->next) { - uprotocal_t protocal = + uprotocal_t protocal = (uprotocal_t)rt_list_entry(node, struct uprotocal, list); if (protocal->pro_id == pro_id) return protocal; } @@ -284,16 +284,16 @@ static uprotocal_t rt_usbh_hid_protocal_find(int pro_id) * as a hid class device, it will continue the enumulate process. * * @param arg the argument. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t rt_usbh_hid_enable(void* arg) { int i = 0, pro_id; - uprotocal_t protocal; + uprotocal_t protocal; struct uhid* hid; struct uhintf* intf = (struct uhintf*)arg; - + /* parameter check */ if(intf == RT_NULL) { @@ -304,43 +304,43 @@ static rt_err_t rt_usbh_hid_enable(void* arg) pro_id = intf->intf_desc->bInterfaceProtocol; RT_DEBUG_LOG(RT_DEBUG_USB, - ("HID device enable, protocal id %d\n", pro_id)); + ("HID device enable, protocal id %d\n", pro_id)); - protocal = rt_usbh_hid_protocal_find(pro_id); + protocal = rt_usbh_hid_protocal_find(pro_id); if(protocal == RT_NULL) { rt_kprintf("can't find hid protocal %d\n", pro_id); - intf->user_data = RT_NULL; + intf->user_data = RT_NULL; return -RT_ERROR; } - + hid = rt_malloc(sizeof(struct uhid)); RT_ASSERT(hid != RT_NULL); - /* initilize the data structure */ + /* initilize the data structure */ rt_memset(hid, 0, sizeof(struct uhid)); intf->user_data = (void*)hid; hid->protocal = protocal; - + for(i=0; iintf_desc->bNumEndpoints; i++) - { + { rt_err_t ret; uep_desc_t ep_desc; - /* get endpoint descriptor */ + /* get endpoint descriptor */ rt_usbh_get_endpoint_descriptor(intf->intf_desc, i, &ep_desc); if(ep_desc == RT_NULL) { rt_kprintf("rt_usbh_get_endpoint_descriptor error\n"); return -RT_ERROR; } - - if(USB_EP_ATTR(ep_desc->bmAttributes) != USB_EP_ATTR_INT) + + if(USB_EP_ATTR(ep_desc->bmAttributes) != USB_EP_ATTR_INT) continue; - + if(!(ep_desc->bEndpointAddress & USB_DIR_IN)) continue; - ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &hid->pipe_in, + ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &hid->pipe_in, intf, ep_desc); if(ret != RT_EOK) return ret; } @@ -352,11 +352,11 @@ static rt_err_t rt_usbh_hid_enable(void* arg) } /** - * This function will be invoked when usb device plug out is detected and it would clean + * This function will be invoked when usb device plug out is detected and it would clean * and release all hub class related resources. * * @param arg the argument. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t rt_usbh_hid_disable(void* arg) @@ -377,7 +377,7 @@ static rt_err_t rt_usbh_hid_disable(void* arg) rt_usb_hcd_free_pipe(intf->device->hcd, hid->pipe_in); } - /* free the hid instance */ + /* free the hid instance */ rt_free(hid); } @@ -387,7 +387,7 @@ static rt_err_t rt_usbh_hid_disable(void* arg) /** * This function will register hid class driver to the usb class driver manager. * and it should be invoked in the usb system initialization. - * + * * @return the error code, RT_EOK on successfully. */ ucd_t rt_usbh_class_driver_hid(void) @@ -395,7 +395,7 @@ ucd_t rt_usbh_class_driver_hid(void) rt_list_init(&_protocal_list); hid_driver.class_code = USB_CLASS_HID; - + hid_driver.enable = rt_usbh_hid_enable; hid_driver.disable = rt_usbh_hid_disable; diff --git a/components/drivers/usb/usbhost/class/hid.h b/components/drivers/usb/usbhost/class/hid.h index dbef84abbe..19b2b09855 100644 --- a/components/drivers/usb/usbhost/class/hid.h +++ b/components/drivers/usb/usbhost/class/hid.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -18,7 +18,7 @@ struct uhid upipe_t pipe_in; rt_uint8_t buffer[8]; uprotocal_t protocal; -}; +}; typedef struct uhid uhid_t; #define USB_REQ_GET_REPORT 0x01 @@ -28,7 +28,7 @@ typedef struct uhid uhid_t; #define USB_REQ_SET_IDLE 0x0a #define USB_REQ_SET_PROTOCOL 0x0b -#define USB_HID_KEYBOARD 1 +#define USB_HID_KEYBOARD 1 #define USB_HID_MOUSE 2 rt_err_t rt_usbh_hid_set_idle(struct uhintf* intf, int duration, int report_id); @@ -38,4 +38,4 @@ rt_err_t rt_usbh_hid_set_protocal(struct uhintf* intf, int protocol); rt_err_t rt_usbh_hid_get_report_descriptor(struct uhintf* intf, rt_uint8_t *buffer, rt_size_t size); rt_err_t rt_usbh_hid_protocal_register(uprotocal_t protocal); -#endif \ No newline at end of file +#endif diff --git a/components/drivers/usb/usbhost/class/mass.c b/components/drivers/usb/usbhost/class/mass.c index 20048873f5..abd89a5efc 100644 --- a/components/drivers/usb/usbhost/class/mass.c +++ b/components/drivers/usb/usbhost/class/mass.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -24,29 +24,29 @@ static struct uclass_driver storage_driver; * * @param intf the interface instance. * @param max_lun the buffer to save max_lun. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t _pipe_check(struct uhintf* intf, upipe_t pipe) { - struct uinstance* device; + struct uinstance* device; rt_err_t ret; ustor_t stor; - int size = 0; + int size = 0; struct ustorage_csw csw; if(intf == RT_NULL || pipe == RT_NULL) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } + } - /* get usb device instance from the interface instance */ - device = intf->device; + /* get usb device instance from the interface instance */ + device = intf->device; - /* get storage instance from the interface instance */ + /* get storage instance from the interface instance */ stor = (ustor_t)intf->user_data; - + /* check pipe status */ if(pipe->status == UPIPE_STATUS_OK) return RT_EOK; @@ -58,11 +58,11 @@ static rt_err_t _pipe_check(struct uhintf* intf, upipe_t pipe) if(pipe->status == UPIPE_STATUS_STALL) { /* clear the pipe stall status */ - ret = rt_usbh_clear_feature(device, pipe->ep.bEndpointAddress, + ret = rt_usbh_clear_feature(device, pipe->ep.bEndpointAddress, USB_FEATURE_ENDPOINT_HALT); if(ret != RT_EOK) return ret; } - + rt_thread_delay(50); @@ -73,14 +73,14 @@ static rt_err_t _pipe_check(struct uhintf* intf, upipe_t pipe) RT_DEBUG_LOG(RT_DEBUG_USB, ("clean storage in pipe stall\n")); /* it should receive csw after clear the stall feature */ - size = rt_usb_hcd_pipe_xfer(stor->pipe_in->inst->hcd, + size = rt_usb_hcd_pipe_xfer(stor->pipe_in->inst->hcd, stor->pipe_in, &csw, SIZEOF_CSW, 100); - if(size != SIZEOF_CSW) + if(size != SIZEOF_CSW) { rt_kprintf("receive the csw after stall failed\n"); return -RT_EIO; } - + return -RT_ERROR; } @@ -89,35 +89,35 @@ static rt_err_t _pipe_check(struct uhintf* intf, upipe_t pipe) * * @param intf the interface instance. * @param max_lun the buffer to save max_lun. - * + * * @return the error code, RT_EOK on successfully. */ -static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, +static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, ustorage_cbw_t cmd, rt_uint8_t* buffer, int timeout) { rt_size_t size; - rt_err_t ret; + rt_err_t ret; upipe_t pipe; struct ustorage_csw csw; ustor_t stor; - RT_ASSERT(cmd != RT_NULL); + RT_ASSERT(cmd != RT_NULL); if(intf == RT_NULL) { rt_kprintf("the interface is not available\n"); return -RT_EIO; } - - /* get storage instance from the interface instance */ + + /* get storage instance from the interface instance */ stor = (ustor_t)intf->user_data; do { /* send the cbw */ - size = rt_usb_hcd_pipe_xfer(stor->pipe_out->inst->hcd, stor->pipe_out, + size = rt_usb_hcd_pipe_xfer(stor->pipe_out->inst->hcd, stor->pipe_out, cmd, SIZEOF_CBW, timeout); - if(size != SIZEOF_CBW) + if(size != SIZEOF_CBW) { rt_kprintf("CBW size error\n"); return -RT_EIO; @@ -126,20 +126,20 @@ static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, { pipe = (cmd->dflags == CBWFLAGS_DIR_IN) ? stor->pipe_in : stor->pipe_out; - size = rt_usb_hcd_pipe_xfer(pipe->inst->hcd, pipe, (void*)buffer, + size = rt_usb_hcd_pipe_xfer(pipe->inst->hcd, pipe, (void*)buffer, cmd->xfer_len, timeout); if(size != cmd->xfer_len) { - rt_kprintf("request size %d, transfer size %d\n", + rt_kprintf("request size %d, transfer size %d\n", cmd->xfer_len, size); break; - } + } } - + /* receive the csw */ - size = rt_usb_hcd_pipe_xfer(stor->pipe_in->inst->hcd, stor->pipe_in, + size = rt_usb_hcd_pipe_xfer(stor->pipe_in->inst->hcd, stor->pipe_in, &csw, SIZEOF_CSW, timeout); - if(size != SIZEOF_CSW) + if(size != SIZEOF_CSW) { rt_kprintf("csw size error\n"); return -RT_EIO; @@ -148,12 +148,12 @@ static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, /* check in pipes status */ ret = _pipe_check(intf, stor->pipe_in); - if(ret != RT_EOK) + if(ret != RT_EOK) { rt_kprintf("in pipe error\n"); return ret; } - + /* check out pipes status */ ret = _pipe_check(intf, stor->pipe_out); if(ret != RT_EOK) @@ -161,20 +161,20 @@ static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, rt_kprintf("out pipe error\n"); return ret; } - + /* check csw status */ if(csw.signature != CSW_SIGNATURE || csw.tag != CBW_TAG_VALUE) { rt_kprintf("csw signature error\n"); return -RT_EIO; } - + if(csw.status != 0) { //rt_kprintf("csw status error:%d\n",csw.status); return -RT_ERROR; } - + return RT_EOK; } @@ -183,12 +183,12 @@ static rt_err_t rt_usb_bulk_only_xfer(struct uhintf* intf, * * @param intf the interface instance. * @param max_lun the buffer to save max_lun. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun) { - struct uinstance* device; + struct uinstance* device; struct urequest setup; int timeout = USB_TIMEOUT_BASIC; @@ -196,17 +196,17 @@ rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } + } /* parameter check */ RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_get_max_lun\n")); - /* get usb device instance from the interface instance */ - device = intf->device; + /* get usb device instance from the interface instance */ + device = intf->device; /* construct the request */ - setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE; setup.bRequest = USBREQ_GET_MAX_LUN; setup.wValue = intf->intf_desc->bInterfaceNumber; @@ -233,13 +233,13 @@ rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun) * This function will do USBREQ_MASS_STORAGE_RESET request for the usb interface instance. * * @param intf the interface instance. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_storage_reset(struct uhintf* intf) { struct urequest setup; - struct uinstance* device; + struct uinstance* device; int timeout = USB_TIMEOUT_BASIC; /* parameter check */ @@ -247,16 +247,16 @@ rt_err_t rt_usbh_storage_reset(struct uhintf* intf) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } + } RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_reset\n")); - /* get usb device instance from the interface instance */ - device = intf->device; + /* get usb device instance from the interface instance */ + device = intf->device; /* construct the request */ - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE; setup.bRequest = USBREQ_MASS_STORAGE_RESET; setup.wIndex = intf->intf_desc->bInterfaceNumber; @@ -279,12 +279,12 @@ rt_err_t rt_usbh_storage_reset(struct uhintf* intf) * * @param intf the interface instance. * @param buffer the data buffer to save read data - * @param sector the start sector address to read. + * @param sector the start sector address to read. * @param sector the sector count to read. - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, +rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, rt_uint32_t sector, rt_size_t count, int timeout) { struct ustorage_cbw cmd; @@ -294,8 +294,8 @@ rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, { rt_kprintf("interface is not available\n"); return -RT_EIO; - } - + } + RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_read10\n")); @@ -325,12 +325,12 @@ rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, * * @param intf the interface instance. * @param buffer the data buffer to save write data - * @param sector the start sector address to write. + * @param sector the start sector address to write. * @param sector the sector count to write. - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, +rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, rt_uint32_t sector, rt_size_t count, int timeout) { struct ustorage_cbw cmd; @@ -340,8 +340,8 @@ rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } - + } + RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_write10\n")); @@ -371,7 +371,7 @@ rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, * * @param intf the interface instance. * @param buffer the data buffer to save sense data - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer) @@ -384,12 +384,12 @@ rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } - + } + RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_request_sense\n")); - /* construct the command block wrapper */ + /* construct the command block wrapper */ rt_memset(&cmd, 0, sizeof(struct ustorage_cbw)); cmd.signature = CBW_SIGNATURE; cmd.tag = CBW_TAG_VALUE; @@ -407,7 +407,7 @@ rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer) * This function will execute SCSI_TEST_UNIT_READY command to get unit ready status. * * @param intf the interface instance. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf) @@ -420,8 +420,8 @@ rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } - + } + RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_test_unit_ready\n")); @@ -434,7 +434,7 @@ rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf) cmd.lun = 0; cmd.cb_len = 12; cmd.cb[0] = SCSI_TEST_UNIT_READY; - + return rt_usb_bulk_only_xfer(intf, &cmd, RT_NULL, timeout); } @@ -443,21 +443,21 @@ rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf) * * @param intf the interface instance. * @param buffer the data buffer to save inquiry data - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_storage_inquiry(struct uhintf* intf, rt_uint8_t* buffer) { struct ustorage_cbw cmd; int timeout = USB_TIMEOUT_LONG; - + /* parameter check */ if(intf == RT_NULL) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } - + } + RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_inquiry\n")); @@ -480,7 +480,7 @@ rt_err_t rt_usbh_storage_inquiry(struct uhintf* intf, rt_uint8_t* buffer) * * @param intf the interface instance. * @param buffer the data buffer to save capacity data - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer) @@ -493,7 +493,7 @@ rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer) { rt_kprintf("the interface is not available\n"); return -RT_EIO; - } + } RT_ASSERT(intf->device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_get_capacity\n")); @@ -513,17 +513,17 @@ rt_err_t rt_usbh_storage_get_capacity(struct uhintf* intf, rt_uint8_t* buffer) /** * This function will run mass storage class driver when usb device is detected - * and identified as a mass storage class device, it will continue to do the enumulate + * and identified as a mass storage class device, it will continue to do the enumulate * process. * * @param arg the argument. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t rt_usbh_storage_enable(void* arg) { int i = 0; - rt_err_t ret; + rt_err_t ret; ustor_t stor; struct uhintf* intf = (struct uhintf*)arg; @@ -534,25 +534,25 @@ static rt_err_t rt_usbh_storage_enable(void* arg) return -RT_EIO; } - RT_DEBUG_LOG(RT_DEBUG_USB, ("subclass %d, protocal %d\n", + RT_DEBUG_LOG(RT_DEBUG_USB, ("subclass %d, protocal %d\n", intf->intf_desc->bInterfaceSubClass, intf->intf_desc->bInterfaceProtocol)); - + RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_storage_run\n")); /* only support SCSI subclass and bulk only protocal */ - + stor = rt_malloc(sizeof(struct ustor)); RT_ASSERT(stor != RT_NULL); /* initilize the data structure */ - rt_memset(stor, 0, sizeof(struct ustor)); + rt_memset(stor, 0, sizeof(struct ustor)); intf->user_data = (void*)stor; for(i=0; iintf_desc->bNumEndpoints; i++) - { + { uep_desc_t ep_desc; - + /* get endpoint descriptor from interface descriptor */ rt_usbh_get_endpoint_descriptor(intf->intf_desc, i, &ep_desc); if(ep_desc == RT_NULL) @@ -560,11 +560,11 @@ static rt_err_t rt_usbh_storage_enable(void* arg) rt_kprintf("rt_usb_get_endpoint_descriptor error\n"); return -RT_ERROR; } - - /* the endpoint type of mass storage class should be BULK */ + + /* the endpoint type of mass storage class should be BULK */ if((ep_desc->bmAttributes & USB_EP_ATTR_TYPE_MASK) != USB_EP_ATTR_BULK) continue; - + /* allocate pipes according to the endpoint type */ if(ep_desc->bEndpointAddress & USB_DIR_IN) { @@ -572,7 +572,7 @@ static rt_err_t rt_usbh_storage_enable(void* arg) stor->pipe_in = rt_usb_instance_find_pipe(intf->device,ep_desc->bEndpointAddress); } else - { + { /* alloc an output pipe for the storage instance */ stor->pipe_out = rt_usb_instance_find_pipe(intf->device,ep_desc->bEndpointAddress); } @@ -583,8 +583,8 @@ static rt_err_t rt_usbh_storage_enable(void* arg) { rt_kprintf("pipe error, unsupported device\n"); return -RT_ERROR; - } - + } + /* should implement as callback */ ret = rt_udisk_run(intf); if(ret != RT_EOK) return ret; @@ -593,11 +593,11 @@ static rt_err_t rt_usbh_storage_enable(void* arg) } /** - * This function will be invoked when usb device plug out is detected and it would clean + * This function will be invoked when usb device plug out is detected and it would clean * and release all mass storage class related resources. * * @param arg the argument. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t rt_usbh_storage_disable(void* arg) @@ -617,7 +617,7 @@ static rt_err_t rt_usbh_storage_disable(void* arg) rt_udisk_stop(intf); - + /* free storage instance */ if(stor != RT_NULL) rt_free(stor); return RT_EOK; @@ -626,13 +626,13 @@ static rt_err_t rt_usbh_storage_disable(void* arg) /** * This function will register mass storage class driver to the usb class driver manager. * and it should be invoked in the usb system initialization. - * + * * @return the error code, RT_EOK on successfully. */ ucd_t rt_usbh_class_driver_storage(void) { storage_driver.class_code = USB_CLASS_MASS_STORAGE; - + storage_driver.enable = rt_usbh_storage_enable; storage_driver.disable = rt_usbh_storage_disable; diff --git a/components/drivers/usb/usbhost/class/mass.h b/components/drivers/usb/usbhost/class/mass.h index 770e64a03f..2578fb54c7 100644 --- a/components/drivers/usb/usbhost/class/mass.h +++ b/components/drivers/usb/usbhost/class/mass.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -30,17 +30,17 @@ struct ustor upipe_t pipe_in; upipe_t pipe_out; rt_uint32_t capicity[2]; - + struct rt_device dev[MAX_PARTITION_COUNT]; rt_uint8_t dev_cnt; -}; +}; typedef struct ustor* ustor_t; rt_err_t rt_usbh_storage_get_max_lun(struct uhintf* intf, rt_uint8_t* max_lun); rt_err_t rt_usbh_storage_reset(struct uhintf* intf); -rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, +rt_err_t rt_usbh_storage_read10(struct uhintf* intf, rt_uint8_t *buffer, rt_uint32_t sector, rt_size_t count, int timeout); -rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, +rt_err_t rt_usbh_storage_write10(struct uhintf* intf, rt_uint8_t *buffer, rt_uint32_t sector, rt_size_t count, int timeout); rt_err_t rt_usbh_storage_request_sense(struct uhintf* intf, rt_uint8_t* buffer); rt_err_t rt_usbh_storage_test_unit_ready(struct uhintf* intf); diff --git a/components/drivers/usb/usbhost/class/udisk.c b/components/drivers/usb/usbhost/class/udisk.c index 6c8030b29a..8be311e657 100644 --- a/components/drivers/usb/usbhost/class/udisk.c +++ b/components/drivers/usb/usbhost/class/udisk.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbhost/class/ukbd.c b/components/drivers/usb/usbhost/class/ukbd.c index 7d608de259..c89d60cd36 100644 --- a/components/drivers/usb/usbhost/class/ukbd.c +++ b/components/drivers/usb/usbhost/class/ukbd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -14,13 +14,13 @@ #if defined(RT_USBH_HID) && defined(RT_USBH_HID_KEYBOARD) -static struct uprotocal kbd_protocal; +static struct uprotocal kbd_protocal; static rt_err_t rt_usbh_hid_kbd_callback(void* arg) { int int1, int2; - struct uhid* hid; - + struct uhid* hid; + hid = (struct uhid*)arg; int1 = *(rt_uint32_t*)hid->buffer; @@ -28,9 +28,9 @@ static rt_err_t rt_usbh_hid_kbd_callback(void* arg) if(int1 != 0 || int2 != 0) { - RT_DEBUG_LOG(RT_DEBUG_USB, ("key down 0x%x, 0x%x\n", int1, int2)); + RT_DEBUG_LOG(RT_DEBUG_USB, ("key down 0x%x, 0x%x\n", int1, int2)); } - + return RT_EOK; } @@ -38,20 +38,20 @@ static rt_err_t rt_usbh_hid_kbd_init(void* arg) { struct uintf* intf = (struct uintf*)arg; - RT_ASSERT(intf != RT_NULL); - + RT_ASSERT(intf != RT_NULL); + rt_usbh_hid_set_protocal(intf, 0); rt_usbh_hid_set_idle(intf, 10, 0); - //RT_DEBUG_LOG(RT_DEBUG_USB, ("start usb keyboard\n")); + //RT_DEBUG_LOG(RT_DEBUG_USB, ("start usb keyboard\n")); return RT_EOK; } /** * This function will define the hid keyboard protocal, it will be register to the protocal list. - * + * * @return the keyboard protocal structure. */ uprotocal_t rt_usbh_hid_protocal_kbd(void) diff --git a/components/drivers/usb/usbhost/class/umouse.c b/components/drivers/usb/usbhost/class/umouse.c index 7f50c0451f..ae14cba22c 100644 --- a/components/drivers/usb/usbhost/class/umouse.c +++ b/components/drivers/usb/usbhost/class/umouse.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/usb/usbhost/core/driver.c b/components/drivers/usb/usbhost/core/driver.c index 37327108c1..6dad1409a0 100644 --- a/components/drivers/usb/usbhost/core/driver.c +++ b/components/drivers/usb/usbhost/core/driver.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -17,21 +17,21 @@ static rt_list_t _driver_list; /** * This function will initilize the usb class driver related data structure, * and it should be invoked in the usb system initialization. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_class_driver_init(void) { rt_list_init(&_driver_list); - return RT_EOK; + return RT_EOK; } /** * This function will register an usb class driver to the class driver manager. * * @param drv the pointer of the usb class driver. - * + * * @return the error code, RT_EOK on successfully. */ @@ -41,15 +41,15 @@ rt_err_t rt_usbh_class_driver_register(ucd_t drv) /* insert class driver into driver list */ rt_list_insert_after(&_driver_list, &(drv->list)); - - return RT_EOK; + + return RT_EOK; } /** * This function will removes a previously registed usb class driver. * * @param drv the pointer of the usb class driver structure. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_class_driver_unregister(ucd_t drv) @@ -67,7 +67,7 @@ rt_err_t rt_usbh_class_driver_unregister(ucd_t drv) * * @param drv the pointer of usb class driver. * @param args the parameter of run function. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void* args) @@ -85,7 +85,7 @@ rt_err_t rt_usbh_class_driver_enable(ucd_t drv, void* args) * * @param drv the pointer of usb class driver structure. * @param args the argument of the stop function. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_class_driver_disable(ucd_t drv, void* args) @@ -102,7 +102,7 @@ rt_err_t rt_usbh_class_driver_disable(ucd_t drv, void* args) /** * This function finds a usb class driver by specified class code and subclass code. * - * @param class_code the usb class driver's class code. + * @param class_code the usb class driver's class code. * @param subclass_code the usb class driver's sub class code. * * @return the registered usb class driver on successful, or RT_NULL on failure. @@ -118,7 +118,7 @@ ucd_t rt_usbh_class_driver_find(int class_code, int subclass_code) /* try to find driver object */ for (node = _driver_list.next; node != &_driver_list; node = node->next) { - ucd_t drv = + ucd_t drv = (ucd_t)rt_list_entry(node, struct uclass_driver, list); if (drv->class_code == class_code) { diff --git a/components/drivers/usb/usbhost/core/hub.c b/components/drivers/usb/usbhost/core/hub.c index eefa571472..b6381ec300 100644 --- a/components/drivers/usb/usbhost/core/hub.c +++ b/components/drivers/usb/usbhost/core/hub.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -77,7 +77,7 @@ static rt_err_t root_hub_ctrl(struct uhcd *hcd, rt_uint16_t port, rt_uint8_t cmd return RT_ERROR; } return RT_EOK; -} +} void rt_usbh_root_hub_connect_handler(struct uhcd *hcd, rt_uint8_t port, rt_bool_t isHS) { struct uhost_msg msg; @@ -106,23 +106,23 @@ void rt_usbh_root_hub_disconnect_handler(struct uhcd *hcd, rt_uint8_t port) } /** - * This function will do USB_REQ_GET_DESCRIPTOR bRequest for the device instance + * This function will do USB_REQ_GET_DESCRIPTOR bRequest for the device instance * to get usb hub descriptor. * * @param intf the interface instance. * @buffer the data buffer to save usb hub descriptor. * @param nbytes the size of buffer - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer, rt_size_t nbytes) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(device != RT_NULL); - + setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE; setup.bRequest = USB_REQ_GET_DESCRIPTOR; setup.wIndex = 0; @@ -135,24 +135,24 @@ rt_err_t rt_usbh_hub_get_descriptor(struct uinstance* device, rt_uint8_t *buffer { return RT_EOK; } - } - return -RT_FALSE; + } + return -RT_FALSE; } /** - * This function will do USB_REQ_GET_STATUS bRequest for the device instance + * This function will do USB_REQ_GET_STATUS bRequest for the device instance * to get usb hub status. * * @param intf the interface instance. * @buffer the data buffer to save usb hub status. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint32_t* buffer) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(device != RT_NULL); @@ -168,31 +168,31 @@ rt_err_t rt_usbh_hub_get_status(struct uinstance* device, rt_uint32_t* buffer) return RT_EOK; } } - return -RT_FALSE; + return -RT_FALSE; } /** - * This function will do USB_REQ_GET_STATUS bRequest for the device instance + * This function will do USB_REQ_GET_STATUS bRequest for the device instance * to get hub port status. * * @param intf the interface instance. * @port the hub port to get status. * @buffer the data buffer to save usb hub status. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hub_get_port_status(uhub_t hub, rt_uint16_t port, rt_uint32_t* buffer) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(hub != RT_NULL); /* get roothub port status */ if(hub->is_roothub) { - root_hub_ctrl(hub->hcd, port, RH_GET_PORT_STATUS, + root_hub_ctrl(hub->hcd, port, RH_GET_PORT_STATUS, (void*)buffer); return RT_EOK; } @@ -210,36 +210,36 @@ rt_err_t rt_usbh_hub_get_port_status(uhub_t hub, rt_uint16_t port, rt_uint32_t* return RT_EOK; } } - return -RT_FALSE; + return -RT_FALSE; } /** - * This function will do USB_REQ_CLEAR_FEATURE bRequest for the device instance + * This function will do USB_REQ_CLEAR_FEATURE bRequest for the device instance * to clear feature of the hub port. * * @param intf the interface instance. * @port the hub port. * @feature feature to be cleared. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hub_clear_port_feature(uhub_t hub, rt_uint16_t port, rt_uint16_t feature) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(hub != RT_NULL); /* clear roothub feature */ if(hub->is_roothub) { - root_hub_ctrl(hub->hcd, port, RH_CLEAR_PORT_FEATURE, + root_hub_ctrl(hub->hcd, port, RH_CLEAR_PORT_FEATURE, (void*)(rt_uint32_t)feature); return RT_EOK; } - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_OTHER; setup.bRequest = USB_REQ_CLEAR_FEATURE; setup.wIndex = port; @@ -250,37 +250,37 @@ rt_err_t rt_usbh_hub_clear_port_feature(uhub_t hub, rt_uint16_t port, rt_uint16_ { return RT_EOK; } - return -RT_FALSE; + return -RT_FALSE; } /** - * This function will do USB_REQ_SET_FEATURE bRequest for the device instance + * This function will do USB_REQ_SET_FEATURE bRequest for the device instance * to set feature of the hub port. * * @param intf the interface instance. * @port the hub port. * @feature feature to be set. - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port, +rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port, rt_uint16_t feature) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + /* parameter check */ RT_ASSERT(hub != RT_NULL); /* clear roothub feature */ if(hub->is_roothub) { - root_hub_ctrl(hub->hcd, port, RH_SET_PORT_FEATURE, + root_hub_ctrl(hub->hcd, port, RH_SET_PORT_FEATURE, (void*)(rt_uint32_t)feature); return RT_EOK; } - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_OTHER; setup.bRequest = USB_REQ_SET_FEATURE; setup.wIndex = port; @@ -291,7 +291,7 @@ rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port, { return RT_EOK; } - else return -RT_FALSE; + else return -RT_FALSE; } /** @@ -299,17 +299,17 @@ rt_err_t rt_usbh_hub_set_port_feature(uhub_t hub, rt_uint16_t port, * * @param intf the interface instance. * @param port the hub port. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port) { rt_err_t ret; rt_uint32_t pstatus; - + /* parameter check */ RT_ASSERT(hub != RT_NULL); - + rt_thread_delay(50); /* reset hub port */ @@ -321,12 +321,12 @@ rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port) ret = rt_usbh_hub_get_port_status(hub, port, &pstatus); if(!(pstatus & PORT_PRS)) break; } - + /* clear port reset feature */ - ret = rt_usbh_hub_clear_port_feature(hub, port, PORT_FEAT_C_RESET); + ret = rt_usbh_hub_clear_port_feature(hub, port, PORT_FEAT_C_RESET); if(ret != RT_EOK) return ret; - rt_thread_delay(50); + rt_thread_delay(50); return RT_EOK; } @@ -336,7 +336,7 @@ rt_err_t rt_usbh_hub_reset_port(uhub_t hub, rt_uint16_t port) * * @param device the usb instance. * @param port the hub port. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_hub_port_debounce(uhub_t hub, rt_uint16_t port) @@ -356,15 +356,15 @@ rt_err_t rt_usbh_hub_port_debounce(uhub_t hub, rt_uint16_t port) { ret = rt_usbh_hub_get_port_status(hub, port, &pstatus); if(ret != RT_EOK) return ret; - - if(!(pstatus & PORT_CCS)) + + if(!(pstatus & PORT_CCS)) { connect = RT_FALSE; break; } - + rt_thread_delay(delayticks); - } + } if(connect) return RT_EOK; else return -RT_ERROR; @@ -375,7 +375,7 @@ rt_err_t rt_usbh_hub_port_debounce(uhub_t hub, rt_uint16_t port) * disconnect events. * * @param intf the interface instance. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t rt_usbh_hub_port_change(uhub_t hub) @@ -386,7 +386,7 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub) /* parameter check */ RT_ASSERT(hub != RT_NULL); - /* get usb device instance */ + /* get usb device instance */ for (i = 0; i < hub->num_ports; i++) { rt_err_t ret; @@ -394,7 +394,7 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub) rt_uint32_t pstatus = 0; reconnect = RT_FALSE; - + /* get hub port status */ ret = rt_usbh_hub_get_port_status(hub, i + 1, &pstatus); if(ret != RT_EOK) continue; @@ -402,8 +402,8 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub) RT_DEBUG_LOG(RT_DEBUG_USB, ("port %d status 0x%x\n", i + 1, pstatus)); /* check port status change */ - if (pstatus & PORT_CCSC) - { + if (pstatus & PORT_CCSC) + { /* clear port status change feature */ rt_usbh_hub_clear_port_feature(hub, i + 1, PORT_FEAT_C_CONNECTION); reconnect = RT_TRUE; @@ -411,39 +411,39 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub) if(pstatus & PORT_PESC) { - rt_usbh_hub_clear_port_feature(hub, i + 1, PORT_FEAT_C_ENABLE); + rt_usbh_hub_clear_port_feature(hub, i + 1, PORT_FEAT_C_ENABLE); reconnect = RT_TRUE; } - + if(reconnect) - { + { if(hub->child[i] != RT_NULL && hub->child[i]->status != DEV_STATUS_IDLE) - { + { rt_usbh_detach_instance(hub->child[i]); /* Child device have been detach. Set hub->child[i] to NULL. */ hub->child[i] = RT_NULL; } - + ret = rt_usbh_hub_port_debounce(hub, i + 1); if(ret != RT_EOK) continue; - + /* allocate an usb instance for new connected device */ device = rt_usbh_alloc_instance(hub->hcd); if(device == RT_NULL) break; - + /* set usb device speed */ device->speed = (pstatus & PORT_LSDA) ? 1 : 0; - device->parent_hub = hub; + device->parent_hub = hub; device->hcd = hub->hcd; device->port = i + 1; hub->child[i] = device; /* reset usb roothub port */ rt_usbh_hub_reset_port(hub, i + 1); - + /* attatch the usb instance to the hcd */ - rt_usbh_attatch_instance(device); + rt_usbh_attatch_instance(device); } } @@ -454,7 +454,7 @@ static rt_err_t rt_usbh_hub_port_change(uhub_t hub) * This function is the callback function of hub's int endpoint, it is invoked when data comes. * * @param context the context of the callback function. - * + * * @return none. */ static void rt_usbh_hub_irq(void* context) @@ -462,9 +462,9 @@ static void rt_usbh_hub_irq(void* context) upipe_t pipe; uhub_t hub; int timeout = USB_TIMEOUT_BASIC; - + RT_ASSERT(context != RT_NULL); - + pipe = (upipe_t)context; hub = (uhub_t)pipe->user_data; @@ -473,14 +473,14 @@ static void rt_usbh_hub_irq(void* context) RT_DEBUG_LOG(RT_DEBUG_USB,("hub irq error\n")); return; } - + rt_usbh_hub_port_change(hub); RT_DEBUG_LOG(RT_DEBUG_USB,("hub int xfer...\n")); /* parameter check */ RT_ASSERT(pipe->inst->hcd != RT_NULL); - + rt_usb_hcd_pipe_xfer(hub->self->hcd, pipe, hub->buffer, pipe->ep.wMaxPacketSize, timeout); } @@ -489,7 +489,7 @@ static void rt_usbh_hub_irq(void* context) * as a hub class device, it will continue to do the enumulate process. * * @param arg the argument. - * + * * @return the error code, RT_EOK on successfully. */ @@ -505,7 +505,7 @@ static rt_err_t rt_usbh_hub_enable(void *arg) int timeout = USB_TIMEOUT_LONG; /* paremeter check */ RT_ASSERT(intf != RT_NULL); - + RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usbh_hub_run\n")); /* get usb device instance */ @@ -515,7 +515,7 @@ static rt_err_t rt_usbh_hub_enable(void *arg) hub = rt_malloc(sizeof(struct uhub)); RT_ASSERT(hub != RT_NULL); rt_memset(hub, 0, sizeof(struct uhub)); - + /* make interface instance's user data point to hub instance */ intf->user_data = (void*)hub; @@ -524,17 +524,17 @@ static rt_err_t rt_usbh_hub_enable(void *arg) if(ret != RT_EOK) { rt_kprintf("get hub descriptor failed\n"); - return -RT_ERROR; + return -RT_ERROR; } /* get full hub descriptor */ - ret = rt_usbh_hub_get_descriptor(device, (rt_uint8_t*)&hub->hub_desc, + ret = rt_usbh_hub_get_descriptor(device, (rt_uint8_t*)&hub->hub_desc, hub->hub_desc.length); if(ret != RT_EOK) { rt_kprintf("get hub descriptor again failed\n"); - return -RT_ERROR; - } + return -RT_ERROR; + } /* get hub ports number */ /* If hub device supported ports over USB_HUB_PORT_NUM(Ex: 8 port hub). Set hub->num_ports to USB_HUB_PORT_NUM */ @@ -554,7 +554,7 @@ static rt_err_t rt_usbh_hub_enable(void *arg) * 2 * RT_TICK_PER_SECOND / 1000 ); } - if(intf->intf_desc->bNumEndpoints != 1) + if(intf->intf_desc->bNumEndpoints != 1) return -RT_ERROR; /* get endpoint descriptor from interface descriptor */ @@ -565,12 +565,12 @@ static rt_err_t rt_usbh_hub_enable(void *arg) return -RT_ERROR; } - /* the endpoint type of hub class should be interrupt */ + /* the endpoint type of hub class should be interrupt */ if( USB_EP_ATTR(ep_desc->bmAttributes) == USB_EP_ATTR_INT) { /* the endpoint direction of hub class should be in */ if(ep_desc->bEndpointAddress & USB_DIR_IN) - { + { /* allocate a pipe according to the endpoint type */ pipe_in = rt_usb_instance_find_pipe(device,ep_desc->bEndpointAddress); if(pipe_in == RT_NULL) @@ -585,17 +585,17 @@ static rt_err_t rt_usbh_hub_enable(void *arg) /* parameter check */ RT_ASSERT(device->hcd != RT_NULL); pipe_in->user_data = hub; - rt_usb_hcd_pipe_xfer(hub->hcd, pipe_in, hub->buffer, + rt_usb_hcd_pipe_xfer(hub->hcd, pipe_in, hub->buffer, pipe_in->ep.wMaxPacketSize, timeout); return RT_EOK; } /** - * This function will be invoked when usb hub plug out is detected and it would clean + * This function will be invoked when usb hub plug out is detected and it would clean * and release all hub class related resources. * * @param arg the argument. - * + * * @return the error code, RT_EOK on successfully. */ static rt_err_t rt_usbh_hub_disable(void* arg) @@ -615,7 +615,7 @@ static rt_err_t rt_usbh_hub_disable(void* arg) if(hub->child[i] != RT_NULL) rt_usbh_detach_instance(hub->child[i]); } - + if(hub != RT_NULL) rt_free(hub); return RT_EOK; @@ -624,13 +624,13 @@ static rt_err_t rt_usbh_hub_disable(void* arg) /** * This function will register hub class driver to the usb class driver manager. * and it should be invoked in the usb system initialization. - * + * * @return the error code, RT_EOK on successfully. */ ucd_t rt_usbh_class_driver_hub(void) -{ +{ hub_driver.class_code = USB_CLASS_HUB; - + hub_driver.enable = rt_usbh_hub_enable; hub_driver.disable = rt_usbh_hub_disable; @@ -638,27 +638,27 @@ ucd_t rt_usbh_class_driver_hub(void) } /** - * This function is the main entry of usb hub thread, it is in charge of - * processing all messages received from the usb message buffer. + * This function is the main entry of usb hub thread, it is in charge of + * processing all messages received from the usb message buffer. * * @param parameter the parameter of the usb host thread. - * + * * @return none. */ static void rt_usbh_hub_thread_entry(void* parameter) -{ +{ while(1) - { + { struct uhost_msg msg; - + /* receive message */ - if(rt_mq_recv(usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER) + if(rt_mq_recv(usb_mq, &msg, sizeof(struct uhost_msg), RT_WAITING_FOREVER) != RT_EOK ) continue; //RT_DEBUG_LOG(RT_DEBUG_USB, ("msg type %d\n", msg.type)); - + switch (msg.type) - { + { case USB_MSG_CONNECT_CHANGE: rt_usbh_hub_port_change(msg.content.hub); break; @@ -668,7 +668,7 @@ static void rt_usbh_hub_thread_entry(void* parameter) break; default: break; - } + } } } @@ -676,8 +676,8 @@ static void rt_usbh_hub_thread_entry(void* parameter) * This function will post an message to the usb message queue, * * @param msg the message to be posted - * - * @return the error code, RT_EOK on successfully. + * + * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_event_signal(struct uhost_msg* msg) { @@ -693,7 +693,7 @@ rt_err_t rt_usbh_event_signal(struct uhost_msg* msg) * This function will initialize usb hub thread. * * @return none. - * + * */ void rt_usbh_hub_init(uhcd_t hcd) { @@ -705,9 +705,9 @@ void rt_usbh_hub_init(uhcd_t hcd) root_hub.num_ports = hcd->num_ports; /* create usb message queue */ usb_mq = rt_mq_create("usbh", 32, 16, RT_IPC_FLAG_FIFO); - + /* create usb hub thread */ - thread = rt_thread_create("usbh", rt_usbh_hub_thread_entry, RT_NULL, + thread = rt_thread_create("usbh", rt_usbh_hub_thread_entry, RT_NULL, USB_THREAD_STACK_SIZE, 8, 20); if(thread != RT_NULL) { diff --git a/components/drivers/usb/usbhost/core/usbhost.c b/components/drivers/usb/usbhost/core/usbhost.c index f0294238c4..a76f6d4586 100644 --- a/components/drivers/usb/usbhost/core/usbhost.c +++ b/components/drivers/usb/usbhost/core/usbhost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,13 +19,13 @@ /** * This function will initialize the usb host stack, all the usb class driver and * host controller driver are also be initialized here. - * + * * @return none. */ rt_err_t rt_usb_host_init(void) { ucd_t drv; - rt_device_t uhc; + rt_device_t uhc; uhc = rt_device_find(USB_HOST_CONTROLLER_NAME); if(uhc == RT_NULL) diff --git a/components/drivers/usb/usbhost/core/usbhost_core.c b/components/drivers/usb/usbhost/core/usbhost_core.c index d72dca82f2..71fe3b8b3f 100644 --- a/components/drivers/usb/usbhost/core/usbhost_core.c +++ b/components/drivers/usb/usbhost/core/usbhost_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -27,28 +27,28 @@ uinst_t rt_usbh_alloc_instance(uhcd_t uhcd) /* lock scheduler */ rt_enter_critical(); - + for(i=0; idev_desc; - + /* alloc address 0 ep0 pipe*/ ep0_out_desc.wMaxPacketSize = 8; ep0_in_desc.wMaxPacketSize = 8; @@ -106,7 +106,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) rt_usb_hcd_alloc_pipe(device->hcd, &device->pipe_ep0_in, device, &ep0_in_desc); RT_DEBUG_LOG(RT_DEBUG_USB, ("start enumnation\n")); - + /* get device descriptor head */ ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_DEVICE, (void*)dev_desc, 8); if(ret != RT_EOK) @@ -114,7 +114,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) rt_kprintf("get device descriptor head failed\n"); return ret; } - + /* reset bus */ rt_usbh_hub_reset_port(device->parent_hub, device->port); rt_thread_delay(2); @@ -127,20 +127,20 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) return ret; } /* free address 0 ep0 pipe*/ - + rt_usb_hcd_free_pipe(device->hcd,device->pipe_ep0_out); rt_usb_hcd_free_pipe(device->hcd,device->pipe_ep0_in); - + /* set device max packet size */ ep0_out_desc.wMaxPacketSize = device->dev_desc.bMaxPacketSize0; ep0_in_desc.wMaxPacketSize = device->dev_desc.bMaxPacketSize0; - + /* alloc true address ep0 pipe*/ rt_usb_hcd_alloc_pipe(device->hcd, &device->pipe_ep0_out, device, &ep0_out_desc); rt_usb_hcd_alloc_pipe(device->hcd, &device->pipe_ep0_in, device, &ep0_in_desc); RT_DEBUG_LOG(RT_DEBUG_USB, ("get device descriptor length %d\n", dev_desc->bLength)); - + /* get full device descriptor again */ ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_DEVICE, (void*)dev_desc, dev_desc->bLength); if(ret != RT_EOK) @@ -169,7 +169,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) rt_memset(device->cfg_desc, 0, cfg_desc.wTotalLength); /* get full configuration descriptor */ - ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_CONFIGURATION, + ret = rt_usbh_get_descriptor(device, USB_DESC_TYPE_CONFIGURATION, device->cfg_desc, cfg_desc.wTotalLength); if(ret != RT_EOK) { @@ -179,12 +179,12 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) /* set configuration */ ret = rt_usbh_set_configure(device, 1); - if(ret != RT_EOK) + if(ret != RT_EOK) { return ret; } for(i=0; icfg_desc->bNumInterfaces; i++) - { + { /* get interface descriptor through configuration descriptor */ ret = rt_usbh_get_interface_descriptor(device->cfg_desc, i, &intf_desc); if(ret != RT_EOK) @@ -193,7 +193,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) return -RT_ERROR; } - RT_DEBUG_LOG(RT_DEBUG_USB, ("interface class 0x%x, subclass 0x%x\n", + RT_DEBUG_LOG(RT_DEBUG_USB, ("interface class 0x%x, subclass 0x%x\n", intf_desc->bInterfaceClass, intf_desc->bInterfaceSubClass)); /* alloc pipe*/ @@ -216,9 +216,9 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) } } /* find driver by class code found in interface descriptor */ - drv = rt_usbh_class_driver_find(intf_desc->bInterfaceClass, + drv = rt_usbh_class_driver_find(intf_desc->bInterfaceClass, intf_desc->bInterfaceSubClass); - + if(drv != RT_NULL) { /* allocate memory for interface device */ @@ -245,7 +245,7 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) continue; } } - + return RT_EOK; } @@ -254,19 +254,19 @@ rt_err_t rt_usbh_attatch_instance(uinst_t device) * and release all resource. * * @param device the usb device instance. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_detach_instance(uinst_t device) { int i = 0; rt_list_t * l; - if(device == RT_NULL) + if(device == RT_NULL) { rt_kprintf("no usb instance to detach\n"); return -RT_ERROR; } - + /* free configration descriptor */ if (device->cfg_desc) { for (i = 0; i < device->cfg_desc->bNumInterfaces; i++) @@ -282,10 +282,10 @@ rt_err_t rt_usbh_detach_instance(uinst_t device) } rt_free(device->cfg_desc); } - + rt_usb_hcd_free_pipe(device->hcd,device->pipe_ep0_out); rt_usb_hcd_free_pipe(device->hcd,device->pipe_ep0_in); - + while(device->pipe.next!= &device->pipe) { l = device->pipe.next; @@ -293,29 +293,29 @@ rt_err_t rt_usbh_detach_instance(uinst_t device) rt_usb_hcd_free_pipe(device->hcd,rt_list_entry(l,struct upipe,list)); } rt_memset(device, 0, sizeof(struct uinstance)); - + return RT_EOK; } /** * This function will do USB_REQ_GET_DESCRIPTO' bRequest for the usb device instance, * - * @param device the usb device instance. + * @param device the usb device instance. * @param type the type of descriptor bRequest. * @param buffer the data buffer to save requested data * @param nbytes the size of buffer - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer, +rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer, int nbytes) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + RT_ASSERT(device != RT_NULL); - setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_STANDARD | + setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE; setup.bRequest = USB_REQ_GET_DESCRIPTOR; setup.wIndex = 0; @@ -339,19 +339,19 @@ rt_err_t rt_usbh_get_descriptor(uinst_t device, rt_uint8_t type, void* buffer, * This function will set an address to the usb device. * * @param device the usb device instance. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_set_address(uinst_t device) { struct urequest setup; int timeout = USB_TIMEOUT_BASIC; - + RT_ASSERT(device != RT_NULL); RT_DEBUG_LOG(RT_DEBUG_USB, ("rt_usb_set_address\n")); - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE; setup.bRequest = USB_REQ_SET_ADDRESS; setup.wIndex = 0; @@ -375,7 +375,7 @@ rt_err_t rt_usbh_set_address(uinst_t device) * * @param device the usb device instance. * @param config the configuration number. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_set_configure(uinst_t device, int config) @@ -386,7 +386,7 @@ rt_err_t rt_usbh_set_configure(uinst_t device, int config) /* check parameter */ RT_ASSERT(device != RT_NULL); - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE; setup.bRequest = USB_REQ_SET_CONFIGURATION; setup.wIndex = 0; @@ -401,7 +401,7 @@ rt_err_t rt_usbh_set_configure(uinst_t device, int config) { return RT_ERROR; } - return RT_EOK; + return RT_EOK; } /** @@ -409,7 +409,7 @@ rt_err_t rt_usbh_set_configure(uinst_t device, int config) * * @param device the usb device instance. * @param intf the interface number. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_set_interface(uinst_t device, int intf) @@ -420,7 +420,7 @@ rt_err_t rt_usbh_set_interface(uinst_t device, int intf) /* check parameter */ RT_ASSERT(device != RT_NULL); - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE; setup.bRequest = USB_REQ_SET_INTERFACE; setup.wIndex = 0; @@ -431,8 +431,8 @@ rt_err_t rt_usbh_set_interface(uinst_t device, int intf) { return RT_ERROR; } - - return RT_EOK; + + return RT_EOK; } /** @@ -440,7 +440,7 @@ rt_err_t rt_usbh_set_interface(uinst_t device, int intf) * * @param device the usb device instance. * @param endpoint the endpoint number of the usb device. - * + * * @return the error code, RT_EOK on successfully. */ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature) @@ -451,7 +451,7 @@ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature) /* check parameter */ RT_ASSERT(device != RT_NULL); - setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | + setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT; setup.bRequest = USB_REQ_CLEAR_FEATURE; setup.wIndex = endpoint; @@ -462,8 +462,8 @@ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature) { return RT_ERROR; } - - return RT_EOK; + + return RT_EOK; } /** @@ -472,10 +472,10 @@ rt_err_t rt_usbh_clear_feature(uinst_t device, int endpoint, int feature) * @param cfg_desc the point of configuration descriptor structure. * @param num the number of interface descriptor. * @intf_desc the point of interface descriptor point. - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num, +rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num, uintf_desc_t* intf_desc) { rt_uint32_t ptr, depth = 0; @@ -487,9 +487,9 @@ rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num, ptr = (rt_uint32_t)cfg_desc + cfg_desc->bLength; while(ptr < (rt_uint32_t)cfg_desc + cfg_desc->wTotalLength) { - if(depth++ > 0x20) + if(depth++ > 0x20) { - *intf_desc = RT_NULL; + *intf_desc = RT_NULL; return -RT_EIO; } desc = (udesc_t)ptr; @@ -500,10 +500,10 @@ rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num, *intf_desc = (uintf_desc_t)desc; RT_DEBUG_LOG(RT_DEBUG_USB, - ("rt_usb_get_interface_descriptor: %d\n", num)); + ("rt_usb_get_interface_descriptor: %d\n", num)); return RT_EOK; } - } + } ptr = (rt_uint32_t)desc + desc->bLength; } @@ -517,14 +517,14 @@ rt_err_t rt_usbh_get_interface_descriptor(ucfg_desc_t cfg_desc, int num, * @param intf_desc the point of interface descriptor structure. * @param num the number of endpoint descriptor. * @param ep_desc the point of endpoint descriptor point. - * + * * @return the error code, RT_EOK on successfully. */ -rt_err_t rt_usbh_get_endpoint_descriptor(uintf_desc_t intf_desc, int num, +rt_err_t rt_usbh_get_endpoint_descriptor(uintf_desc_t intf_desc, int num, uep_desc_t* ep_desc) { int count = 0, depth = 0; - rt_uint32_t ptr; + rt_uint32_t ptr; udesc_t desc; /* check parameter */ @@ -535,15 +535,15 @@ rt_err_t rt_usbh_get_endpoint_descriptor(uintf_desc_t intf_desc, int num, ptr = (rt_uint32_t)intf_desc + intf_desc->bLength; while(count < intf_desc->bNumEndpoints) { - if(depth++ > 0x20) + if(depth++ > 0x20) { - *ep_desc = RT_NULL; + *ep_desc = RT_NULL; return -RT_EIO; } - desc = (udesc_t)ptr; + desc = (udesc_t)ptr; if(desc->type == USB_DESC_TYPE_ENDPOINT) { - if(num == count) + if(num == count) { *ep_desc = (uep_desc_t)desc; diff --git a/components/drivers/watchdog/watchdog.c b/components/drivers/watchdog/watchdog.c index 09a6bf4fad..9108d834c6 100644 --- a/components/drivers/watchdog/watchdog.c +++ b/components/drivers/watchdog/watchdog.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -65,7 +65,7 @@ static rt_err_t rt_watchdog_control(struct rt_device *dev, } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops wdt_ops = +const static struct rt_device_ops wdt_ops = { rt_watchdog_init, rt_watchdog_open, diff --git a/components/drivers/wlan/wlan_cfg.c b/components/drivers/wlan/wlan_cfg.c index 7fa9ecb2da..0befe6e7da 100644 --- a/components/drivers/wlan/wlan_cfg.c +++ b/components/drivers/wlan/wlan_cfg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_cfg.h b/components/drivers/wlan/wlan_cfg.h index 3fae3f3e98..4d0e73729d 100644 --- a/components/drivers/wlan/wlan_cfg.h +++ b/components/drivers/wlan/wlan_cfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_cmd.c b/components/drivers/wlan/wlan_cmd.c index fead6a8bf2..fde9065428 100644 --- a/components/drivers/wlan/wlan_cmd.c +++ b/components/drivers/wlan/wlan_cmd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_dev.c b/components/drivers/wlan/wlan_dev.c index 53b6138e99..4db8d5e43d 100644 --- a/components/drivers/wlan/wlan_dev.c +++ b/components/drivers/wlan/wlan_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_dev.h b/components/drivers/wlan/wlan_dev.h index 3019afb19d..9fce22b7c9 100644 --- a/components/drivers/wlan/wlan_dev.h +++ b/components/drivers/wlan/wlan_dev.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -589,7 +589,7 @@ rt_err_t rt_wlan_dev_report_data(struct rt_wlan_device *device, void *buff, int /* * wlan device register interface */ -rt_err_t rt_wlan_dev_register(struct rt_wlan_device *wlan, const char *name, +rt_err_t rt_wlan_dev_register(struct rt_wlan_device *wlan, const char *name, const struct rt_wlan_dev_ops *ops, rt_uint32_t flag, void *user_data); #ifdef __cplusplus diff --git a/components/drivers/wlan/wlan_lwip.c b/components/drivers/wlan/wlan_lwip.c index 3c4e4dd598..30205ac332 100644 --- a/components/drivers/wlan/wlan_lwip.c +++ b/components/drivers/wlan/wlan_lwip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_mgnt.c b/components/drivers/wlan/wlan_mgnt.c index fefe700acc..6abac5691c 100644 --- a/components/drivers/wlan/wlan_mgnt.c +++ b/components/drivers/wlan/wlan_mgnt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_mgnt.h b/components/drivers/wlan/wlan_mgnt.h index df0827bb7b..38d5c31da2 100644 --- a/components/drivers/wlan/wlan_mgnt.h +++ b/components/drivers/wlan/wlan_mgnt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_prot.c b/components/drivers/wlan/wlan_prot.c index b1a1b5de99..5c32a3fbda 100644 --- a/components/drivers/wlan/wlan_prot.c +++ b/components/drivers/wlan/wlan_prot.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_prot.h b/components/drivers/wlan/wlan_prot.h index 2df979270f..5f8930f452 100644 --- a/components/drivers/wlan/wlan_prot.h +++ b/components/drivers/wlan/wlan_prot.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_workqueue.c b/components/drivers/wlan/wlan_workqueue.c index 4cd98346d2..76b95e66b0 100644 --- a/components/drivers/wlan/wlan_workqueue.c +++ b/components/drivers/wlan/wlan_workqueue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/drivers/wlan/wlan_workqueue.h b/components/drivers/wlan/wlan_workqueue.h index 49bc4a5f9f..7a68a27e03 100644 --- a/components/drivers/wlan/wlan_workqueue.h +++ b/components/drivers/wlan/wlan_workqueue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index afbda59e90..8b51896cde 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -27,9 +27,9 @@ * 2012-10-22 Bernard add MS VC++ patch. * 2016-06-02 armink beautify the list_thread command * 2018-11-22 Jesven list_thread add smp support - * 2018-12-27 Jesven Fix the problem that disable interrupt too long in list_thread + * 2018-12-27 Jesven Fix the problem that disable interrupt too long in list_thread * Provide protection for the "first layer of objects" when list_* - * 2020-04-07 chenhui add clear + * 2020-04-07 chenhui add clear */ #include @@ -156,7 +156,7 @@ static rt_list_t *list_get_next(rt_list_t *current, list_get_next_t *arg) break; } } - + rt_hw_interrupt_enable(level); arg->nr_out = nr; return node; diff --git a/components/finsh/finsh.h b/components/finsh/finsh.h index 7276ea7ce1..dd5e27dea5 100644 --- a/components/finsh/finsh.h +++ b/components/finsh/finsh.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_api.h b/components/finsh/finsh_api.h index db2c175cb5..fd9e6a773e 100644 --- a/components/finsh/finsh_api.h +++ b/components/finsh/finsh_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_compiler.c b/components/finsh/finsh_compiler.c index f81409bf9a..1cb4ff00a5 100644 --- a/components/finsh/finsh_compiler.c +++ b/components/finsh/finsh_compiler.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_error.c b/components/finsh/finsh_error.c index bdd0108f98..a5cf2eb514 100644 --- a/components/finsh/finsh_error.c +++ b/components/finsh/finsh_error.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_error.h b/components/finsh/finsh_error.h index 614e02a350..8dfafd013c 100644 --- a/components/finsh/finsh_error.h +++ b/components/finsh/finsh_error.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_heap.c b/components/finsh/finsh_heap.c index 0d185db474..9f64d108dd 100644 --- a/components/finsh/finsh_heap.c +++ b/components/finsh/finsh_heap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_heap.h b/components/finsh/finsh_heap.h index 9c04e5c22f..f320c2771a 100644 --- a/components/finsh/finsh_heap.h +++ b/components/finsh/finsh_heap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_init.c b/components/finsh/finsh_init.c index 72f5aa5e9a..76302a0516 100644 --- a/components/finsh/finsh_init.c +++ b/components/finsh/finsh_init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_node.c b/components/finsh/finsh_node.c index 0de82c189d..82a4c03f1e 100644 --- a/components/finsh/finsh_node.c +++ b/components/finsh/finsh_node.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_node.h b/components/finsh/finsh_node.h index c7ce099636..ff4333df13 100644 --- a/components/finsh/finsh_node.h +++ b/components/finsh/finsh_node.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_ops.c b/components/finsh/finsh_ops.c index 2eafb50c69..ec8b8cb58a 100644 --- a/components/finsh/finsh_ops.c +++ b/components/finsh/finsh_ops.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_ops.h b/components/finsh/finsh_ops.h index 95a8b001fb..0cc945f078 100644 --- a/components/finsh/finsh_ops.h +++ b/components/finsh/finsh_ops.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -25,90 +25,90 @@ * OP [op1] */ -#define FINSH_OP_NOOP 0x00 +#define FINSH_OP_NOOP 0x00 /* add @ r1 = r2 + r3 */ -#define FINSH_OP_ADD_BYTE 0x01 -#define FINSH_OP_ADD_WORD 0x02 -#define FINSH_OP_ADD_DWORD 0x03 +#define FINSH_OP_ADD_BYTE 0x01 +#define FINSH_OP_ADD_WORD 0x02 +#define FINSH_OP_ADD_DWORD 0x03 /* sub @ r1 = r2 - r3 */ -#define FINSH_OP_SUB_BYTE 0x04 -#define FINSH_OP_SUB_WORD 0x05 -#define FINSH_OP_SUB_DWORD 0x06 +#define FINSH_OP_SUB_BYTE 0x04 +#define FINSH_OP_SUB_WORD 0x05 +#define FINSH_OP_SUB_DWORD 0x06 /* div @ r1 = r2 / r3 */ -#define FINSH_OP_DIV_BYTE 0x07 -#define FINSH_OP_DIV_WORD 0x08 -#define FINSH_OP_DIV_DWORD 0x09 +#define FINSH_OP_DIV_BYTE 0x07 +#define FINSH_OP_DIV_WORD 0x08 +#define FINSH_OP_DIV_DWORD 0x09 /* mod @ r1 = r2 % r3 */ -#define FINSH_OP_MOD_BYTE 0x0A -#define FINSH_OP_MOD_WORD 0x0B -#define FINSH_OP_MOD_DWORD 0x0C +#define FINSH_OP_MOD_BYTE 0x0A +#define FINSH_OP_MOD_WORD 0x0B +#define FINSH_OP_MOD_DWORD 0x0C /* mul @ r1 = r2 * r3 */ -#define FINSH_OP_MUL_BYTE 0x0D -#define FINSH_OP_MUL_WORD 0x0E -#define FINSH_OP_MUL_DWORD 0x0F +#define FINSH_OP_MUL_BYTE 0x0D +#define FINSH_OP_MUL_WORD 0x0E +#define FINSH_OP_MUL_DWORD 0x0F /* and @ r1 = r2 & r3 */ -#define FINSH_OP_AND_BYTE 0x10 -#define FINSH_OP_AND_WORD 0x11 -#define FINSH_OP_AND_DWORD 0x12 +#define FINSH_OP_AND_BYTE 0x10 +#define FINSH_OP_AND_WORD 0x11 +#define FINSH_OP_AND_DWORD 0x12 /* or @ r1 = r2 | r3 */ -#define FINSH_OP_OR_BYTE 0x13 -#define FINSH_OP_OR_WORD 0x14 -#define FINSH_OP_OR_DWORD 0x15 +#define FINSH_OP_OR_BYTE 0x13 +#define FINSH_OP_OR_WORD 0x14 +#define FINSH_OP_OR_DWORD 0x15 /* xor @ r1 = r2 ^ r3 */ -#define FINSH_OP_XOR_BYTE 0x16 -#define FINSH_OP_XOR_WORD 0x17 -#define FINSH_OP_XOR_DWORD 0x18 +#define FINSH_OP_XOR_BYTE 0x16 +#define FINSH_OP_XOR_WORD 0x17 +#define FINSH_OP_XOR_DWORD 0x18 /* bw @ r1 = ~r2 */ -#define FINSH_OP_BITWISE_BYTE 0x19 -#define FINSH_OP_BITWISE_WORD 0x1A -#define FINSH_OP_BITWISE_DWORD 0x1B +#define FINSH_OP_BITWISE_BYTE 0x19 +#define FINSH_OP_BITWISE_WORD 0x1A +#define FINSH_OP_BITWISE_DWORD 0x1B /* shl @ r1 = r2 << r3 */ -#define FINSH_OP_SHL_BYTE 0x1C -#define FINSH_OP_SHL_WORD 0x1D -#define FINSH_OP_SHL_DWORD 0x1E +#define FINSH_OP_SHL_BYTE 0x1C +#define FINSH_OP_SHL_WORD 0x1D +#define FINSH_OP_SHL_DWORD 0x1E /* shr @ r1 = r2 >> r3 */ -#define FINSH_OP_SHR_BYTE 0x1F -#define FINSH_OP_SHR_WORD 0x20 -#define FINSH_OP_SHR_DWORD 0x21 +#define FINSH_OP_SHR_BYTE 0x1F +#define FINSH_OP_SHR_WORD 0x20 +#define FINSH_OP_SHR_DWORD 0x21 /* ld @ r1 = [r2] */ -#define FINSH_OP_LD_BYTE 0x22 -#define FINSH_OP_LD_WORD 0x23 -#define FINSH_OP_LD_DWORD 0x24 +#define FINSH_OP_LD_BYTE 0x22 +#define FINSH_OP_LD_WORD 0x23 +#define FINSH_OP_LD_DWORD 0x24 -#define FINSH_OP_LD_VALUE_BYTE 0x25 -#define FINSH_OP_LD_VALUE_WORD 0x26 -#define FINSH_OP_LD_VALUE_DWORD 0x27 +#define FINSH_OP_LD_VALUE_BYTE 0x25 +#define FINSH_OP_LD_VALUE_WORD 0x26 +#define FINSH_OP_LD_VALUE_DWORD 0x27 /* st @ [r2] = r1 */ -#define FINSH_OP_ST_BYTE 0x28 -#define FINSH_OP_ST_WORD 0x29 -#define FINSH_OP_ST_DWORD 0x2A +#define FINSH_OP_ST_BYTE 0x28 +#define FINSH_OP_ST_WORD 0x29 +#define FINSH_OP_ST_DWORD 0x2A /* pop */ -#define FINSH_OP_POP 0x2B +#define FINSH_OP_POP 0x2B /* call r1 @ [r1](stack) */ -#define FINSH_OP_SYSCALL 0x2C +#define FINSH_OP_SYSCALL 0x2C /* load value from stack */ -#define FINSH_OP_LD_VALUE_BYTE_STACK 0x2D -#define FINSH_OP_LD_VALUE_WORD_STACK 0x2E -#define FINSH_OP_LD_VALUE_DWORD_STACK 0x2F +#define FINSH_OP_LD_VALUE_BYTE_STACK 0x2D +#define FINSH_OP_LD_VALUE_WORD_STACK 0x2E +#define FINSH_OP_LD_VALUE_DWORD_STACK 0x2F /* halt */ -#define FINSH_OP_HALT 0xFF +#define FINSH_OP_HALT 0xFF typedef void (*op_func)(); extern const op_func op_table[]; diff --git a/components/finsh/finsh_parser.c b/components/finsh/finsh_parser.c index 0e7617003c..4b8b4af7e4 100644 --- a/components/finsh/finsh_parser.c +++ b/components/finsh/finsh_parser.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_parser.h b/components/finsh/finsh_parser.h index 8e149a7e00..2d0148093a 100644 --- a/components/finsh/finsh_parser.h +++ b/components/finsh/finsh_parser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_token.c b/components/finsh/finsh_token.c index 5fb593d816..dfd613da5b 100644 --- a/components/finsh/finsh_token.c +++ b/components/finsh/finsh_token.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_token.h b/components/finsh/finsh_token.h index 0ce98c0f14..9845357b8e 100644 --- a/components/finsh/finsh_token.h +++ b/components/finsh/finsh_token.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_var.c b/components/finsh/finsh_var.c index 6a27bf1fab..2e3df30c6d 100644 --- a/components/finsh/finsh_var.c +++ b/components/finsh/finsh_var.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_var.h b/components/finsh/finsh_var.h index 8d7ee6a201..796f979441 100644 --- a/components/finsh/finsh_var.h +++ b/components/finsh/finsh_var.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_vm.c b/components/finsh/finsh_vm.c index 7c56407084..e56cedbdfb 100644 --- a/components/finsh/finsh_vm.c +++ b/components/finsh/finsh_vm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/finsh_vm.h b/components/finsh/finsh_vm.h index fc515418e4..15d5da1ef8 100644 --- a/components/finsh/finsh_vm.h +++ b/components/finsh/finsh_vm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/msh.c b/components/finsh/msh.c index 79f1e3c87f..73a5197dcd 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/msh.h b/components/finsh/msh.h index b7153107ea..17c7a39ef1 100644 --- a/components/finsh/msh.h +++ b/components/finsh/msh.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/msh_file.c b/components/finsh/msh_file.c index aa182ff9b3..459d77af4e 100644 --- a/components/finsh/msh_file.c +++ b/components/finsh/msh_file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 61f0b9562e..0d41625184 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -844,7 +844,7 @@ int finsh_system_init(void) finsh_system_var_init(&__vsymtab_start, &__vsymtab_end); #elif defined(_MSC_VER) unsigned int *ptr_begin, *ptr_end; - + if(shell) { rt_kprintf("finsh shell already init.\n"); diff --git a/components/finsh/shell.h b/components/finsh/shell.h index 8f94e23e8b..6a4dfff113 100644 --- a/components/finsh/shell.h +++ b/components/finsh/shell.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/finsh/symbol.c b/components/finsh/symbol.c index 78df9fac5c..c6623e2d82 100644 --- a/components/finsh/symbol.c +++ b/components/finsh/symbol.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -7,7 +7,7 @@ * Date Author Notes * 2010-03-22 Bernard first version */ - + #include #if defined(RT_USING_FINSH) && !defined(FINSH_USING_SYMTAB) diff --git a/components/libc/aio/posix_aio.c b/components/libc/aio/posix_aio.c index 3eb7634495..66f15e4c57 100644 --- a/components/libc/aio/posix_aio.c +++ b/components/libc/aio/posix_aio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -22,25 +22,25 @@ struct rt_workqueue* aio_queue = NULL; /** - * The aio_cancel() function shall attempt to cancel one or more asynchronous I/O - * requests currently outstanding against file descriptor fildes. The aiocbp - * argument points to the asynchronous I/O control block for a particular request - * to be canceled. If aiocbp is NULL, then all outstanding cancelable asynchronous + * The aio_cancel() function shall attempt to cancel one or more asynchronous I/O + * requests currently outstanding against file descriptor fildes. The aiocbp + * argument points to the asynchronous I/O control block for a particular request + * to be canceled. If aiocbp is NULL, then all outstanding cancelable asynchronous * I/O requests against fildes shall be canceled. - * - * Normal asynchronous notification shall occur for asynchronous I/O operations - * that are successfully canceled. If there are requests that cannot be canceled, - * then the normal asynchronous completion process shall take place for those + * + * Normal asynchronous notification shall occur for asynchronous I/O operations + * that are successfully canceled. If there are requests that cannot be canceled, + * then the normal asynchronous completion process shall take place for those * requests when they are completed. - * - * For requested operations that are successfully canceled, the associated error - * status shall be set to [ECANCELED] and the return status shall be -1. For - * requested operations that are not successfully canceled, the aiocbp shall not + * + * For requested operations that are successfully canceled, the associated error + * status shall be set to [ECANCELED] and the return status shall be -1. For + * requested operations that are not successfully canceled, the aiocbp shall not * be modified by aio_cancel(). - * - * If aiocbp is not NULL, then if fildes does not have the same value as the file + * + * If aiocbp is not NULL, then if fildes does not have the same value as the file * descriptor with which the asynchronous operation was initiated, unspecified results occur. - * + * * Which operations are cancelable is implementation-defined. */ int aio_cancel(int fd, struct aiocb *cb) @@ -61,9 +61,9 @@ int aio_cancel(int fd, struct aiocb *cb) } /** - * The aio_error() function shall return the error status associated with the - * aiocb structure referenced by the aiocbp argument. The error status for an - * asynchronous I/O operation is the errno value that would be set by the corresponding + * The aio_error() function shall return the error status associated with the + * aiocb structure referenced by the aiocbp argument. The error status for an + * asynchronous I/O operation is the errno value that would be set by the corresponding * read(), write(), */ int aio_error (const struct aiocb *cb) @@ -77,44 +77,44 @@ int aio_error (const struct aiocb *cb) } /** - * The aio_fsync() function shall asynchronously perform a file synchronization - * operation, as specified by the op argument, for I/O operations associated with - * the file indicated by the file descriptor aio_fildes member of the aiocb - * structure referenced by the aiocbp argument and queued at the time of the - * call to aio_fsync(). The function call shall return when the synchronization - * request has been initiated or queued to the file or device (even when the data + * The aio_fsync() function shall asynchronously perform a file synchronization + * operation, as specified by the op argument, for I/O operations associated with + * the file indicated by the file descriptor aio_fildes member of the aiocb + * structure referenced by the aiocbp argument and queued at the time of the + * call to aio_fsync(). The function call shall return when the synchronization + * request has been initiated or queued to the file or device (even when the data * cannot be synchronized immediately). - * - * option: If op is O_DSYNC, all currently queued I/O operations shall be completed - * as if by a call to fdatasync(); that is, as defined for synchronized I/O data + * + * option: If op is O_DSYNC, all currently queued I/O operations shall be completed + * as if by a call to fdatasync(); that is, as defined for synchronized I/O data * integrity completion. - * - * option: If op is O_SYNC, all currently queued I/O operations shall be completed - * as if by a call to fsync(); that is, as defined for synchronized I/O file integrity - * completion. If the aio_fsync() function fails, or if the operation queued by - * aio_fsync() fails, then outstanding I/O operations are not guaranteed to have + * + * option: If op is O_SYNC, all currently queued I/O operations shall be completed + * as if by a call to fsync(); that is, as defined for synchronized I/O file integrity + * completion. If the aio_fsync() function fails, or if the operation queued by + * aio_fsync() fails, then outstanding I/O operations are not guaranteed to have * been completed. - * - * If aio_fsync() succeeds, then it is only the I/O that was queued at the time - * of the call to aio_fsync() that is guaranteed to be forced to the relevant + * + * If aio_fsync() succeeds, then it is only the I/O that was queued at the time + * of the call to aio_fsync() that is guaranteed to be forced to the relevant * completion state. The completion of subsequent I/O on the file descriptor is * not guaranteed to be completed in a synchronized fashion. - * - * The aiocbp argument refers to an asynchronous I/O control block. The aiocbp - * value may be used as an argument to aio_error() and aio_return() in order to - * determine the error status and return status, respectively, of the asynchronous - * operation while it is proceeding. When the request is queued, the error status - * for the operation is [EINPROGRESS]. When all data has been successfully transferred, - * the error status shall be reset to reflect the success or failure of the operation. - * If the operation does not complete successfully, the error status for the - * operation shall be set to indicate the error. The aio_sigevent member determines - * the asynchronous notification to occur as specified in Signal Generation and - * Delivery when all operations have achieved synchronized I/O completion. All - * other members of the structure referenced by aiocbp are ignored. If the control - * block referenced by aiocbp becomes an illegal address prior to asynchronous + * + * The aiocbp argument refers to an asynchronous I/O control block. The aiocbp + * value may be used as an argument to aio_error() and aio_return() in order to + * determine the error status and return status, respectively, of the asynchronous + * operation while it is proceeding. When the request is queued, the error status + * for the operation is [EINPROGRESS]. When all data has been successfully transferred, + * the error status shall be reset to reflect the success or failure of the operation. + * If the operation does not complete successfully, the error status for the + * operation shall be set to indicate the error. The aio_sigevent member determines + * the asynchronous notification to occur as specified in Signal Generation and + * Delivery when all operations have achieved synchronized I/O completion. All + * other members of the structure referenced by aiocbp are ignored. If the control + * block referenced by aiocbp becomes an illegal address prior to asynchronous * I/O completion, then the behavior is undefined. - * - * If the aio_fsync() function fails or aiocbp indicates an error condition, + * + * If the aio_fsync() function fails or aiocbp indicates an error condition, * data is not guaranteed to have been successfully transferred. */ static void aio_fync_work(struct rt_work* work, void* work_data) @@ -169,7 +169,7 @@ static void aio_read_work(struct rt_work* work, void* work_data) level = rt_hw_interrupt_disable(); if (len <= 0) cb->aio_result = errno; - else + else cb->aio_result = len; rt_hw_interrupt_enable(level); @@ -177,51 +177,51 @@ static void aio_read_work(struct rt_work* work, void* work_data) } /** - * The aio_read() function shall read aiocbp->aio_nbytes from the file associated - * with aiocbp->aio_fildes into the buffer pointed to by aiocbp->aio_buf. The - * function call shall return when the read request has been initiated or queued + * The aio_read() function shall read aiocbp->aio_nbytes from the file associated + * with aiocbp->aio_fildes into the buffer pointed to by aiocbp->aio_buf. The + * function call shall return when the read request has been initiated or queued * to the file or device (even when the data cannot be delivered immediately). - * - * If prioritized I/O is supported for this file, then the asynchronous operation - * shall be submitted at a priority equal to a base scheduling priority minus - * aiocbp->aio_reqprio. If Thread Execution Scheduling is not supported, then + * + * If prioritized I/O is supported for this file, then the asynchronous operation + * shall be submitted at a priority equal to a base scheduling priority minus + * aiocbp->aio_reqprio. If Thread Execution Scheduling is not supported, then * the base scheduling priority is that of the calling process; - * - * otherwise, the base scheduling priority is that of the calling thread. - * - * The aiocbp value may be used as an argument to aio_error() and aio_return() - * in order to determine the error status and return status, respectively, of - * the asynchronous operation while it is proceeding. If an error condition is - * encountered during queuing, the function call shall return without having - * initiated or queued the request. The requested operation takes place at the - * absolute position in the file as given by aio_offset, as if lseek() were called - * immediately prior to the operation with an offset equal to aio_offset and a - * whence equal to SEEK_SET. After a successful call to enqueue an asynchronous + * + * otherwise, the base scheduling priority is that of the calling thread. + * + * The aiocbp value may be used as an argument to aio_error() and aio_return() + * in order to determine the error status and return status, respectively, of + * the asynchronous operation while it is proceeding. If an error condition is + * encountered during queuing, the function call shall return without having + * initiated or queued the request. The requested operation takes place at the + * absolute position in the file as given by aio_offset, as if lseek() were called + * immediately prior to the operation with an offset equal to aio_offset and a + * whence equal to SEEK_SET. After a successful call to enqueue an asynchronous * I/O operation, the value of the file offset for the file is unspecified. * - * The aio_sigevent member specifies the notification which occurs when the + * The aio_sigevent member specifies the notification which occurs when the * request is completed. * * The aiocbp->aio_lio_opcode field shall be ignored by aio_read(). - * - * The aiocbp argument points to an aiocb structure. If the buffer pointed to by - * aiocbp->aio_buf or the control block pointed to by aiocbp becomes an illegal + * + * The aiocbp argument points to an aiocb structure. If the buffer pointed to by + * aiocbp->aio_buf or the control block pointed to by aiocbp becomes an illegal * address prior to asynchronous I/O completion, then the behavior is undefined. - * - * Simultaneous asynchronous operations using the same aiocbp produce undefined + * + * Simultaneous asynchronous operations using the same aiocbp produce undefined * results. - * + * * If synchronized I/O is enabled on the file associated with aiocbp->aio_fildes, - * the behavior of this function shall be according to the definitions of synchronized - * I/O data integrity completion and synchronized I/O file integrity completion. - * - * For any system action that changes the process memory space while an asynchronous - * I/O is outstanding to the address range being changed, the result of that action + * the behavior of this function shall be according to the definitions of synchronized + * I/O data integrity completion and synchronized I/O file integrity completion. + * + * For any system action that changes the process memory space while an asynchronous + * I/O is outstanding to the address range being changed, the result of that action * is undefined. - * - * For regular files, no data transfer shall occur past the offset maximum + * + * For regular files, no data transfer shall occur past the offset maximum * established in the open file description associated with aiocbp->aio_fildes. - * + * */ int aio_read(struct aiocb *cb) { @@ -242,16 +242,16 @@ int aio_read(struct aiocb *cb) } /** - * The aio_return() function shall return the return status associated with the - * aiocb structure referenced by the aiocbp argument. The return status for an - * asynchronous I/O operation is the value that would be returned by the corresponding - * read(), write(), or fsync() function call. If the error status for the operation - * is equal to [EINPROGRESS], then the return status for the operation is undefined. - * The aio_return() function may be called exactly once to retrieve the return - * status of a given asynchronous operation; thereafter, if the same aiocb structure - * is used in a call to aio_return() or aio_error(), an error may be returned. - * When the aiocb structure referred to by aiocbp is used to submit another asynchronous - * operation, then aio_return() may be successfully used to retrieve the return + * The aio_return() function shall return the return status associated with the + * aiocb structure referenced by the aiocbp argument. The return status for an + * asynchronous I/O operation is the value that would be returned by the corresponding + * read(), write(), or fsync() function call. If the error status for the operation + * is equal to [EINPROGRESS], then the return status for the operation is undefined. + * The aio_return() function may be called exactly once to retrieve the return + * status of a given asynchronous operation; thereafter, if the same aiocb structure + * is used in a call to aio_return() or aio_error(), an error may be returned. + * When the aiocb structure referred to by aiocbp is used to submit another asynchronous + * operation, then aio_return() may be successfully used to retrieve the return * status of that operation. */ ssize_t aio_return(struct aiocb *cb) @@ -268,23 +268,23 @@ ssize_t aio_return(struct aiocb *cb) } /** - * The aio_suspend() function shall suspend the calling thread until at least - * one of the asynchronous I/O operations referenced by the list argument has - * completed, until a signal interrupts the function, or, if timeout is not NULL, - * until the time interval specified by timeout has passed. If any of the aiocb - * structures in the list correspond to completed asynchronous I/O operations - * (that is, the error status for the operation is not equal to [EINPROGRESS]) - * at the time of the call, the function shall return without suspending the - * calling thread. The list argument is an array of pointers to asynchronous I/O - * control blocks. The nent argument indicates the number of elements in the - * array. Each aiocb structure pointed to has been used in initiating an asynchronous - * I/O request via aio_read(), aio_write(), or lio_listio(). This array may - * contain null pointers, which are ignored. If this array contains pointers - * that refer to aiocb structures that have not been used in submitting asynchronous + * The aio_suspend() function shall suspend the calling thread until at least + * one of the asynchronous I/O operations referenced by the list argument has + * completed, until a signal interrupts the function, or, if timeout is not NULL, + * until the time interval specified by timeout has passed. If any of the aiocb + * structures in the list correspond to completed asynchronous I/O operations + * (that is, the error status for the operation is not equal to [EINPROGRESS]) + * at the time of the call, the function shall return without suspending the + * calling thread. The list argument is an array of pointers to asynchronous I/O + * control blocks. The nent argument indicates the number of elements in the + * array. Each aiocb structure pointed to has been used in initiating an asynchronous + * I/O request via aio_read(), aio_write(), or lio_listio(). This array may + * contain null pointers, which are ignored. If this array contains pointers + * that refer to aiocb structures that have not been used in submitting asynchronous * I/O, the effect is undefined. - * - * If the time interval indicated in the timespec structure pointed to by timeout - * passes before any of the I/O operations referenced by list are completed, then + * + * If the time interval indicated in the timespec structure pointed to by timeout + * passes before any of the I/O operations referenced by list are completed, then * aio_suspend() shall return with an error. */ int aio_suspend(const struct aiocb *const list[], int nent, @@ -315,7 +315,7 @@ static void aio_write_work(struct rt_work* work, void* work_data) level = rt_hw_interrupt_disable(); if (len <= 0) cb->aio_result = errno; - else + else cb->aio_result = len; rt_hw_interrupt_enable(level); @@ -323,42 +323,42 @@ static void aio_write_work(struct rt_work* work, void* work_data) } /** - * The aio_write() function shall write aiocbp->aio_nbytes to the file associated - * with aiocbp->aio_fildes from the buffer pointed to by aiocbp->aio_buf. The - * function shall return when the write request has been initiated or, at a minimum, + * The aio_write() function shall write aiocbp->aio_nbytes to the file associated + * with aiocbp->aio_fildes from the buffer pointed to by aiocbp->aio_buf. The + * function shall return when the write request has been initiated or, at a minimum, * queued to the file or device. - * - * The aiocbp argument may be used as an argument to aio_error() and aio_return() - * in order to determine the error status and return status, respectively, of the + * + * The aiocbp argument may be used as an argument to aio_error() and aio_return() + * in order to determine the error status and return status, respectively, of the * asynchronous operation while it is proceeding. - * - * The aiocbp argument points to an aiocb structure. If the buffer pointed to by - * aiocbp->aio_buf or the control block pointed to by aiocbp becomes an illegal + * + * The aiocbp argument points to an aiocb structure. If the buffer pointed to by + * aiocbp->aio_buf or the control block pointed to by aiocbp becomes an illegal * address prior to asynchronous I/O completion, then the behavior is undefined. - * - * If O_APPEND is not set for the file descriptor aio_fildes, then the requested - * operation shall take place at the absolute position in the file as given by - * aio_offset, as if lseek() were called immediately prior to the operation with - * an offset equal to aio_offset and a whence equal to SEEK_SET. If O_APPEND is - * set for the file descriptor, or if aio_fildes is associated with a device that - * is incapable of seeking, write operations append to the file in the same order - * as the calls were made, except under circumstances described in Asynchronous - * I/O. After a successful call to enqueue an asynchronous I/O operation, the value + * + * If O_APPEND is not set for the file descriptor aio_fildes, then the requested + * operation shall take place at the absolute position in the file as given by + * aio_offset, as if lseek() were called immediately prior to the operation with + * an offset equal to aio_offset and a whence equal to SEEK_SET. If O_APPEND is + * set for the file descriptor, or if aio_fildes is associated with a device that + * is incapable of seeking, write operations append to the file in the same order + * as the calls were made, except under circumstances described in Asynchronous + * I/O. After a successful call to enqueue an asynchronous I/O operation, the value * of the file offset for the file is unspecified. - * - * The aio_sigevent member specifies the notification which occurs when the request + * + * The aio_sigevent member specifies the notification which occurs when the request * is completed. - * + * * The aiocbp->aio_lio_opcode field shall be ignored by aio_write(). - * - * Simultaneous asynchronous operations using the same aiocbp produce undefined + * + * Simultaneous asynchronous operations using the same aiocbp produce undefined * results. - * - * If synchronized I/O is enabled on the file associated with aiocbp->aio_fildes, - * the behavior of this function shall be according to the definitions of synchronized + * + * If synchronized I/O is enabled on the file associated with aiocbp->aio_fildes, + * the behavior of this function shall be according to the definitions of synchronized * I/O data integrity completion, and synchronized I/O file integrity completion. - * - * For regular files, no data transfer shall occur past the offset maximum established + * + * For regular files, no data transfer shall occur past the offset maximum established * in the open file description associated with aiocbp->aio_fildes. */ int aio_write(struct aiocb *cb) @@ -385,69 +385,69 @@ int aio_write(struct aiocb *cb) } /** - * The lio_listio() function shall initiate a list of I/O requests with a single + * The lio_listio() function shall initiate a list of I/O requests with a single * function call. - * - * The mode argument takes one of the values LIO_WAIT or LIO_NOWAIT declared in - * and determines whether the function returns when the I/O operations - * have been completed, or as soon as the operations have been queued. If the - * mode argument is LIO_WAIT, the function shall wait until all I/O is complete + * + * The mode argument takes one of the values LIO_WAIT or LIO_NOWAIT declared in + * and determines whether the function returns when the I/O operations + * have been completed, or as soon as the operations have been queued. If the + * mode argument is LIO_WAIT, the function shall wait until all I/O is complete * and the sig argument shall be ignored. - * - * If the mode argument is LIO_NOWAIT, the function shall return immediately, and - * asynchronous notification shall occur, according to the sig argument, when all - * the I/O operations complete. If sig is NULL, then no asynchronous notification - * shall occur. If sig is not NULL, asynchronous notification occurs as specified + * + * If the mode argument is LIO_NOWAIT, the function shall return immediately, and + * asynchronous notification shall occur, according to the sig argument, when all + * the I/O operations complete. If sig is NULL, then no asynchronous notification + * shall occur. If sig is not NULL, asynchronous notification occurs as specified * in Signal Generation and Delivery when all the requests in list have completed. - * + * * The I/O requests enumerated by list are submitted in an unspecified order. - * - * The list argument is an array of pointers to aiocb structures. The array contains + * + * The list argument is an array of pointers to aiocb structures. The array contains * nent elements. The array may contain NULL elements, which shall be ignored. - * - * If the buffer pointed to by list or the aiocb structures pointed to by the - * elements of the array list become illegal addresses before all asynchronous I/O - * completed and, if necessary, the notification is sent, then the behavior is - * undefined. If the buffers pointed to by the aio_buf member of the aiocb structure - * pointed to by the elements of the array list become illegal addresses prior to - * the asynchronous I/O associated with that aiocb structure being completed, the + * + * If the buffer pointed to by list or the aiocb structures pointed to by the + * elements of the array list become illegal addresses before all asynchronous I/O + * completed and, if necessary, the notification is sent, then the behavior is + * undefined. If the buffers pointed to by the aio_buf member of the aiocb structure + * pointed to by the elements of the array list become illegal addresses prior to + * the asynchronous I/O associated with that aiocb structure being completed, the * behavior is undefined. - * - * The aio_lio_opcode field of each aiocb structure specifies the operation to be - * performed. The supported operations are LIO_READ, LIO_WRITE, and LIO_NOP; these - * symbols are defined in . The LIO_NOP operation causes the list entry to - * be ignored. If the aio_lio_opcode element is equal to LIO_READ, then an I/O operation - * is submitted as if by a call to aio_read() with the aiocbp equal to the address - * of the aiocb structure. If the aio_lio_opcode element is equal to LIO_WRITE, then - * an I/O operation is submitted as if by a call to aio_write() with the aiocbp equal + * + * The aio_lio_opcode field of each aiocb structure specifies the operation to be + * performed. The supported operations are LIO_READ, LIO_WRITE, and LIO_NOP; these + * symbols are defined in . The LIO_NOP operation causes the list entry to + * be ignored. If the aio_lio_opcode element is equal to LIO_READ, then an I/O operation + * is submitted as if by a call to aio_read() with the aiocbp equal to the address + * of the aiocb structure. If the aio_lio_opcode element is equal to LIO_WRITE, then + * an I/O operation is submitted as if by a call to aio_write() with the aiocbp equal * to the address of the aiocb structure. - * - * The aio_fildes member specifies the file descriptor on which the operation is to + * + * The aio_fildes member specifies the file descriptor on which the operation is to * be performed. - * - * The aio_buf member specifies the address of the buffer to or from which the data + * + * The aio_buf member specifies the address of the buffer to or from which the data * is transferred. - * + * * The aio_nbytes member specifies the number of bytes of data to be transferred. - * - * The members of the aiocb structure further describe the I/O operation to be - * performed, in a manner identical to that of the corresponding aiocb structure + * + * The members of the aiocb structure further describe the I/O operation to be + * performed, in a manner identical to that of the corresponding aiocb structure * when used by the aio_read() and aio_write() functions. - * - * The nent argument specifies how many elements are members of the list; that is, + * + * The nent argument specifies how many elements are members of the list; that is, * the length of the array. - * - * The behavior of this function is altered according to the definitions of synchronized - * I/O data integrity completion and synchronized I/O file integrity completion if + * + * The behavior of this function is altered according to the definitions of synchronized + * I/O data integrity completion and synchronized I/O file integrity completion if * synchronized I/O is enabled on the file associated with aio_fildes. - * - * For regular files, no data transfer shall occur past the offset maximum established + * + * For regular files, no data transfer shall occur past the offset maximum established * in the open file description associated with aiocbp->aio_fildes. - * - * If sig->sigev_notify is SIGEV_THREAD and sig->sigev_notify_attributes is a - * non-null pointer and the block pointed to by this pointer becomes an illegal - * address prior to all asynchronous I/O being completed, then the behavior is - * undefined. + * + * If sig->sigev_notify is SIGEV_THREAD and sig->sigev_notify_attributes is a + * non-null pointer and the block pointed to by this pointer becomes an illegal + * address prior to all asynchronous I/O being completed, then the behavior is + * undefined. */ int lio_listio(int mode, struct aiocb * const list[], int nent, struct sigevent *sig) diff --git a/components/libc/aio/posix_aio.h b/components/libc/aio/posix_aio.h index f20ed48cb3..de11738515 100644 --- a/components/libc/aio/posix_aio.h +++ b/components/libc/aio/posix_aio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/dirent.h b/components/libc/compilers/armlibc/dirent.h index d3bc58cbc5..2c0521d2e3 100644 --- a/components/libc/compilers/armlibc/dirent.h +++ b/components/libc/compilers/armlibc/dirent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -18,32 +18,32 @@ */ /* File types */ -#define FT_REGULAR 0 /* regular file */ -#define FT_SOCKET 1 /* socket file */ -#define FT_DIRECTORY 2 /* directory */ -#define FT_USER 3 /* user defined */ +#define FT_REGULAR 0 /* regular file */ +#define FT_SOCKET 1 /* socket file */ +#define FT_DIRECTORY 2 /* directory */ +#define FT_USER 3 /* user defined */ #ifdef __cplusplus extern "C" { #endif #ifndef HAVE_DIR_STRUCTURE -typedef struct +typedef struct { - int fd; /* directory file */ - char buf[512]; - int num; - int cur; + int fd; /* directory file */ + char buf[512]; + int num; + int cur; } DIR; #endif #ifndef HAVE_DIRENT_STRUCTURE struct dirent { - rt_uint8_t d_type; /* The type of the file */ - rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ - rt_uint16_t d_reclen; /* length of this record */ - char d_name[256]; /* The null-terminated file name */ + rt_uint8_t d_type; /* The type of the file */ + rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ + rt_uint16_t d_reclen; /* length of this record */ + char d_name[256]; /* The null-terminated file name */ }; #endif diff --git a/components/libc/compilers/armlibc/fcntl.h b/components/libc/compilers/armlibc/fcntl.h index 3e650a8471..f247b926e9 100644 --- a/components/libc/compilers/armlibc/fcntl.h +++ b/components/libc/compilers/armlibc/fcntl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/libc.c b/components/libc/compilers/armlibc/libc.c index fee390d4b4..971ddb8d49 100644 --- a/components/libc/compilers/armlibc/libc.c +++ b/components/libc/compilers/armlibc/libc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/libc.h b/components/libc/compilers/armlibc/libc.h index b9b1b6212d..aecf8cdc50 100644 --- a/components/libc/compilers/armlibc/libc.h +++ b/components/libc/compilers/armlibc/libc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/libc_syms.c b/components/libc/compilers/armlibc/libc_syms.c index a2e8af17f1..829d57b559 100644 --- a/components/libc/compilers/armlibc/libc_syms.c +++ b/components/libc/compilers/armlibc/libc_syms.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/mem_std.c b/components/libc/compilers/armlibc/mem_std.c index e160104a25..c350aa68fa 100644 --- a/components/libc/compilers/armlibc/mem_std.c +++ b/components/libc/compilers/armlibc/mem_std.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/stdio.c b/components/libc/compilers/armlibc/stdio.c index 5262a4dd92..c786c78aa5 100644 --- a/components/libc/compilers/armlibc/stdio.c +++ b/components/libc/compilers/armlibc/stdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/sys/errno.h b/components/libc/compilers/armlibc/sys/errno.h index 9c4307ebfb..74cc986f7c 100644 --- a/components/libc/compilers/armlibc/sys/errno.h +++ b/components/libc/compilers/armlibc/sys/errno.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/sys/ioctl.h b/components/libc/compilers/armlibc/sys/ioctl.h index 033a57014a..df17b19a61 100644 --- a/components/libc/compilers/armlibc/sys/ioctl.h +++ b/components/libc/compilers/armlibc/sys/ioctl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/sys/mman.h b/components/libc/compilers/armlibc/sys/mman.h index 8c61b32b7c..6a260ccd70 100644 --- a/components/libc/compilers/armlibc/sys/mman.h +++ b/components/libc/compilers/armlibc/sys/mman.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/sys/stat.h b/components/libc/compilers/armlibc/sys/stat.h index ce95230e88..c4b42083c4 100644 --- a/components/libc/compilers/armlibc/sys/stat.h +++ b/components/libc/compilers/armlibc/sys/stat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/sys/types.h b/components/libc/compilers/armlibc/sys/types.h index 491445d72b..a6b245b81c 100644 --- a/components/libc/compilers/armlibc/sys/types.h +++ b/components/libc/compilers/armlibc/sys/types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/sys/unistd.h b/components/libc/compilers/armlibc/sys/unistd.h index ee1e1c4db9..7752a1caf7 100644 --- a/components/libc/compilers/armlibc/sys/unistd.h +++ b/components/libc/compilers/armlibc/sys/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 8addb3e163..1efbfd37d5 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -9,7 +9,7 @@ * 2013-11-24 aozima fixed _sys_read()/_sys_write() issues. * 2014-08-03 bernard If using msh, use system() implementation * in msh. - * 2020-08-05 Meco Man fixed _sys_flen() compiling-warning when + * 2020-08-05 Meco Man fixed _sys_flen() compiling-warning when * RT_USING_DFS is not defined * 2020-02-13 Meco Man re-implement exit() and abort() * 2020-02-14 Meco Man implement _sys_tmpnam() @@ -346,7 +346,7 @@ int system(const char *string) #ifdef __MICROLIB #include -int fputc(int c, FILE *f) +int fputc(int c, FILE *f) { char ch[2] = {0}; @@ -355,7 +355,7 @@ int fputc(int c, FILE *f) return 1; } -int fgetc(FILE *f) +int fgetc(FILE *f) { #ifdef RT_USING_POSIX char ch; diff --git a/components/libc/compilers/armlibc/unistd.h b/components/libc/compilers/armlibc/unistd.h index 736fc219a8..cd77a12e3b 100644 --- a/components/libc/compilers/armlibc/unistd.h +++ b/components/libc/compilers/armlibc/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c index 48a86098cd..9d8952e99e 100644 --- a/components/libc/compilers/common/stdlib.c +++ b/components/libc/compilers/common/stdlib.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/common/sys/time.h b/components/libc/compilers/common/sys/time.h index e4d60d2d11..76e6636d13 100644 --- a/components/libc/compilers/common/sys/time.h +++ b/components/libc/compilers/common/sys/time.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/common/termios.h b/components/libc/compilers/common/termios.h index 414d0c0cb3..2960d52c58 100644 --- a/components/libc/compilers/common/termios.h +++ b/components/libc/compilers/common/termios.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index ed72cc1f3f..0bad6bdf8e 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -181,7 +181,7 @@ RTM_EXPORT(ctime); * * @param time_t * t the timestamp pointer, if not used, keep NULL. * - * @return The value ((time_t)-1) is returned if the calendar time is not available. + * @return The value ((time_t)-1) is returned if the calendar time is not available. * If timer is not a NULL pointer, the return value is also stored in timer. * */ @@ -366,7 +366,7 @@ int settimeofday(const struct timeval *tv, const struct timezone *tz) RTM_EXPORT(settimeofday); /* inherent in the toolchain */ -RTM_EXPORT(difftime); +RTM_EXPORT(difftime); RTM_EXPORT(strftime); #ifdef RT_USING_POSIX diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c index 0966242e55..20130cbb8a 100644 --- a/components/libc/compilers/common/unistd.c +++ b/components/libc/compilers/common/unistd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/dirent.h b/components/libc/compilers/dlib/dirent.h index 4c897cc550..2c0521d2e3 100644 --- a/components/libc/compilers/dlib/dirent.h +++ b/components/libc/compilers/dlib/dirent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/environ.c b/components/libc/compilers/dlib/environ.c index ac19758838..84b04fda55 100644 --- a/components/libc/compilers/dlib/environ.c +++ b/components/libc/compilers/dlib/environ.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/fcntl.h b/components/libc/compilers/dlib/fcntl.h index ce95230e88..c4b42083c4 100644 --- a/components/libc/compilers/dlib/fcntl.h +++ b/components/libc/compilers/dlib/fcntl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/libc.c b/components/libc/compilers/dlib/libc.c index 8b42411a6b..d0dca7c5f6 100644 --- a/components/libc/compilers/dlib/libc.c +++ b/components/libc/compilers/dlib/libc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/libc.h b/components/libc/compilers/dlib/libc.h index 5b46bee0c8..fc3cafca78 100644 --- a/components/libc/compilers/dlib/libc.h +++ b/components/libc/compilers/dlib/libc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/rmtx.c b/components/libc/compilers/dlib/rmtx.c index 69405c8f6a..66c3f9377d 100644 --- a/components/libc/compilers/dlib/rmtx.c +++ b/components/libc/compilers/dlib/rmtx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -22,7 +22,7 @@ void _Mtxinit(_Rmtx *m) rt_mutex_t mutex; RT_ASSERT(m != RT_NULL); - + mutex = (rt_mutex_t)m; rt_mutex_init(mutex, "iarMtx", RT_IPC_FLAG_FIFO); } diff --git a/components/libc/compilers/dlib/stdio.c b/components/libc/compilers/dlib/stdio.c index b35ade7a38..c11157d759 100644 --- a/components/libc/compilers/dlib/stdio.c +++ b/components/libc/compilers/dlib/stdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/sys/errno.h b/components/libc/compilers/dlib/sys/errno.h index 1ad4c8acc0..54a1d33cd0 100644 --- a/components/libc/compilers/dlib/sys/errno.h +++ b/components/libc/compilers/dlib/sys/errno.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/sys/mman.h b/components/libc/compilers/dlib/sys/mman.h index 8c61b32b7c..6a260ccd70 100644 --- a/components/libc/compilers/dlib/sys/mman.h +++ b/components/libc/compilers/dlib/sys/mman.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/sys/signal.h b/components/libc/compilers/dlib/sys/signal.h index 22adb1228b..a30235f2b2 100644 --- a/components/libc/compilers/dlib/sys/signal.h +++ b/components/libc/compilers/dlib/sys/signal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/sys/stat.h b/components/libc/compilers/dlib/sys/stat.h index ce95230e88..c4b42083c4 100644 --- a/components/libc/compilers/dlib/sys/stat.h +++ b/components/libc/compilers/dlib/sys/stat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/sys/types.h b/components/libc/compilers/dlib/sys/types.h index 7e14bbbee3..6e2d1ce839 100644 --- a/components/libc/compilers/dlib/sys/types.h +++ b/components/libc/compilers/dlib/sys/types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/sys/unistd.h b/components/libc/compilers/dlib/sys/unistd.h index 5b86822635..14966a2bad 100644 --- a/components/libc/compilers/dlib/sys/unistd.h +++ b/components/libc/compilers/dlib/sys/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -21,22 +21,22 @@ #include #else -#define _FREAD 0x0001 /* read enabled */ -#define _FWRITE 0x0002 /* write enabled */ -#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ -#define _FMARK 0x0010 /* internal; mark during gc() */ -#define _FDEFER 0x0020 /* internal; defer for next gc pass */ -#define _FASYNC 0x0040 /* signal pgrp when data ready */ -#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ -#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ -#define _FCREAT 0x0200 /* open with file create */ -#define _FTRUNC 0x0400 /* open with truncation */ -#define _FEXCL 0x0800 /* error on open if file exists */ -#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ -#define _FSYNC 0x2000 /* do all writes synchronously */ -#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ -#define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ -#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ +#define _FREAD 0x0001 /* read enabled */ +#define _FWRITE 0x0002 /* write enabled */ +#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ +#define _FMARK 0x0010 /* internal; mark during gc() */ +#define _FDEFER 0x0020 /* internal; defer for next gc pass */ +#define _FASYNC 0x0040 /* signal pgrp when data ready */ +#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ +#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ +#define _FCREAT 0x0200 /* open with file create */ +#define _FTRUNC 0x0400 /* open with truncation */ +#define _FEXCL 0x0800 /* error on open if file exists */ +#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ +#define _FSYNC 0x2000 /* do all writes synchronously */ +#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ +#define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ +#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ #endif diff --git a/components/libc/compilers/dlib/syscall_close.c b/components/libc/compilers/dlib/syscall_close.c index f46162deb7..7ed1cc2f2d 100644 --- a/components/libc/compilers/dlib/syscall_close.c +++ b/components/libc/compilers/dlib/syscall_close.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscall_lseek.c b/components/libc/compilers/dlib/syscall_lseek.c index b79cc410b7..47a069bf0a 100644 --- a/components/libc/compilers/dlib/syscall_lseek.c +++ b/components/libc/compilers/dlib/syscall_lseek.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscall_mem.c b/components/libc/compilers/dlib/syscall_mem.c index 236ef1c12d..9c6de64455 100644 --- a/components/libc/compilers/dlib/syscall_mem.c +++ b/components/libc/compilers/dlib/syscall_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscall_open.c b/components/libc/compilers/dlib/syscall_open.c index 96e02dc32a..37bfcecb47 100644 --- a/components/libc/compilers/dlib/syscall_open.c +++ b/components/libc/compilers/dlib/syscall_open.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscall_read.c b/components/libc/compilers/dlib/syscall_read.c index e248211486..afb661bd93 100644 --- a/components/libc/compilers/dlib/syscall_read.c +++ b/components/libc/compilers/dlib/syscall_read.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c index f7e64d1997..7d74236f4c 100644 --- a/components/libc/compilers/dlib/syscall_remove.c +++ b/components/libc/compilers/dlib/syscall_remove.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscall_write.c b/components/libc/compilers/dlib/syscall_write.c index 85c0da22c3..de464530b8 100644 --- a/components/libc/compilers/dlib/syscall_write.c +++ b/components/libc/compilers/dlib/syscall_write.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/syscalls.c b/components/libc/compilers/dlib/syscalls.c index 007ea76bd1..e1c9562b3a 100644 --- a/components/libc/compilers/dlib/syscalls.c +++ b/components/libc/compilers/dlib/syscalls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/dlib/unistd.h b/components/libc/compilers/dlib/unistd.h index a07d8409c2..72b9d538ec 100644 --- a/components/libc/compilers/dlib/unistd.h +++ b/components/libc/compilers/dlib/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/newlib/libc.c b/components/libc/compilers/newlib/libc.c index 2234c36f98..9834a9a015 100644 --- a/components/libc/compilers/newlib/libc.c +++ b/components/libc/compilers/newlib/libc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,7 +19,7 @@ #include #endif -int _EXFUN(putenv,(char *__string)); +int _EXFUN(putenv,(char *__string)); int libc_system_init(void) { diff --git a/components/libc/compilers/newlib/libc.h b/components/libc/compilers/newlib/libc.h index 9a76ffb79f..c1f76d7605 100644 --- a/components/libc/compilers/newlib/libc.h +++ b/components/libc/compilers/newlib/libc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/newlib/libc_syms.c b/components/libc/compilers/newlib/libc_syms.c index 4b0ee355f0..aaf6980d6b 100644 --- a/components/libc/compilers/newlib/libc_syms.c +++ b/components/libc/compilers/newlib/libc_syms.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/newlib/machine/time.h b/components/libc/compilers/newlib/machine/time.h index d46533eb39..ff754d2473 100644 --- a/components/libc/compilers/newlib/machine/time.h +++ b/components/libc/compilers/newlib/machine/time.h @@ -9,4 +9,4 @@ int nanosleep (const struct timespec *, struct timespec *); #endif -#endif /* _MACHTIME_H_ */ +#endif /* _MACHTIME_H_ */ diff --git a/components/libc/compilers/newlib/minilib.c b/components/libc/compilers/newlib/minilib.c index ca1bea0f91..f6df38f67b 100644 --- a/components/libc/compilers/newlib/minilib.c +++ b/components/libc/compilers/newlib/minilib.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/newlib/stdio.c b/components/libc/compilers/newlib/stdio.c index 233a447396..ce5bdb75cb 100644 --- a/components/libc/compilers/newlib/stdio.c +++ b/components/libc/compilers/newlib/stdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,7 +15,7 @@ #define STDIO_DEVICE_NAME_MAX 32 -int _EXFUN(fileno, (FILE *)); +int _EXFUN(fileno, (FILE *)); static FILE* std_console = NULL; @@ -48,7 +48,7 @@ int libc_stdio_set_console(const char* device_name, int mode) { _GLOBAL_REENT->_stdin = std_console; } - else + else { _GLOBAL_REENT->_stdin = NULL; } diff --git a/components/libc/compilers/newlib/sys/dirent.h b/components/libc/compilers/newlib/sys/dirent.h index db8c0655a1..bfba586093 100644 --- a/components/libc/compilers/newlib/sys/dirent.h +++ b/components/libc/compilers/newlib/sys/dirent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -17,36 +17,36 @@ */ /* File types */ -#define FT_REGULAR 0 /* regular file */ -#define FT_SOCKET 1 /* socket file */ -#define FT_DIRECTORY 2 /* directory */ -#define FT_USER 3 /* user defined */ +#define FT_REGULAR 0 /* regular file */ +#define FT_SOCKET 1 /* socket file */ +#define FT_DIRECTORY 2 /* directory */ +#define FT_USER 3 /* user defined */ -#define DT_UNKNOWN 0x00 -#define DT_REG 0x01 -#define DT_DIR 0x02 +#define DT_UNKNOWN 0x00 +#define DT_REG 0x01 +#define DT_DIR 0x02 #ifdef __cplusplus extern "C" { #endif #ifndef HAVE_DIR_STRUCTURE -typedef struct +typedef struct { - int fd; /* directory file */ - char buf[512]; - int num; - int cur; + int fd; /* directory file */ + char buf[512]; + int num; + int cur; } DIR; #endif #ifndef HAVE_DIRENT_STRUCTURE struct dirent { - rt_uint8_t d_type; /* The type of the file */ - rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ - rt_uint16_t d_reclen; /* length of this record */ - char d_name[256]; /* The null-terminated file name */ + rt_uint8_t d_type; /* The type of the file */ + rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */ + rt_uint16_t d_reclen; /* length of this record */ + char d_name[256]; /* The null-terminated file name */ }; #endif diff --git a/components/libc/compilers/newlib/sys/mman.h b/components/libc/compilers/newlib/sys/mman.h index 8c61b32b7c..6a260ccd70 100644 --- a/components/libc/compilers/newlib/sys/mman.h +++ b/components/libc/compilers/newlib/sys/mman.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/newlib/sys/statfs.h b/components/libc/compilers/newlib/sys/statfs.h index 3c923a21f9..0996af9a18 100644 --- a/components/libc/compilers/newlib/sys/statfs.h +++ b/components/libc/compilers/newlib/sys/statfs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -13,9 +13,9 @@ struct statfs { - rt_size_t f_bsize; /* block size */ - rt_size_t f_blocks; /* total data blocks in file system */ - rt_size_t f_bfree; /* free blocks in file system */ + rt_size_t f_bsize; /* block size */ + rt_size_t f_blocks; /* total data blocks in file system */ + rt_size_t f_bfree; /* free blocks in file system */ }; #endif diff --git a/components/libc/compilers/newlib/sys/termios.h b/components/libc/compilers/newlib/sys/termios.h index ce95230e88..c4b42083c4 100644 --- a/components/libc/compilers/newlib/sys/termios.h +++ b/components/libc/compilers/newlib/sys/termios.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index e54d7583cb..6cbc11fd6a 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/getline/posix_getline.c b/components/libc/getline/posix_getline.c index 99bcf5363e..794ac3a07d 100644 --- a/components/libc/getline/posix_getline.c +++ b/components/libc/getline/posix_getline.c @@ -1,11 +1,11 @@ /* posix_getline.c * RT-Thread POSIX * getdelim(), getline() - read a delimited record from stream, ersatz implementation - * This code is unlicensed -- free and released into the public domain. + * This code is unlicensed -- free and released into the public domain. * https://man7.org/linux/man-pages/man3/getline.3.html * Authors: * https://github.com/ivanrad/getline - * + * * Meco Man 2020-09-03 porting to RT-Thread */ diff --git a/components/libc/getline/posix_getline.h b/components/libc/getline/posix_getline.h index e9e0bf9c2b..13a4487d7f 100644 --- a/components/libc/getline/posix_getline.h +++ b/components/libc/getline/posix_getline.h @@ -1,7 +1,7 @@ /* posix_getline.h * RT-Thread POSIX * getdelim(), getline() - read a delimited record from stream, ersatz implementation - * This code is unlicensed -- free and released into the public domain. + * This code is unlicensed -- free and released into the public domain. * https://man7.org/linux/man-pages/man3/getline.3.html * Authors: * https://github.com/ivanrad/getline diff --git a/components/libc/libdl/arch/arm.c b/components/libc/libdl/arch/arm.c index a53c04f0bc..6a884bdb54 100644 --- a/components/libc/libdl/arch/arm.c +++ b/components/libc/libdl/arch/arm.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2018/08/29 Bernard first version diff --git a/components/libc/libdl/arch/x86.c b/components/libc/libdl/arch/x86.c index 16f2322fb4..e7ad714a03 100644 --- a/components/libc/libdl/arch/x86.c +++ b/components/libc/libdl/arch/x86.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2018/09/15 parai first version @@ -13,9 +13,9 @@ #ifdef __i386__ -#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ -#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ -#define R_X86_64_RELATIVE 8 /* Adjust by program base */ +#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ +#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ +#define R_X86_64_RELATIVE 8 /* Adjust by program base */ int dlmodule_relocate(struct rt_dlmodule *module, Elf32_Rel *rel, Elf32_Addr sym_val) { Elf32_Addr *where, tmp; diff --git a/components/libc/libdl/dlclose.c b/components/libc/libdl/dlclose.c index 1202e13f2c..876a1576c8 100644 --- a/components/libc/libdl/dlclose.c +++ b/components/libc/libdl/dlclose.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/libdl/dlelf.c b/components/libc/libdl/dlelf.c index 55ef0d8951..f573122a48 100644 --- a/components/libc/libdl/dlelf.c +++ b/components/libc/libdl/dlelf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -172,7 +172,7 @@ rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_pt rel ++; } - if (unsolved) + if (unsolved) return -RT_ERROR; } @@ -335,7 +335,7 @@ rt_err_t dlmodule_load_relocated_object(struct rt_dlmodule* module, void *module (rt_uint8_t *)elf_module + shdr[index].sh_offset, shdr[index].sh_size); rodata_addr = (rt_uint32_t)ptr; - LOG_D("load rodata 0x%x, size %d, rodata 0x%x", ptr, + LOG_D("load rodata 0x%x, size %d, rodata 0x%x", ptr, shdr[index].sh_size, *(rt_uint32_t *)data_addr); ptr += shdr[index].sh_size; } @@ -347,7 +347,7 @@ rt_err_t dlmodule_load_relocated_object(struct rt_dlmodule* module, void *module (rt_uint8_t *)elf_module + shdr[index].sh_offset, shdr[index].sh_size); data_addr = (rt_uint32_t)ptr; - LOG_D("load data 0x%x, size %d, data 0x%x", ptr, + LOG_D("load data 0x%x, size %d, data 0x%x", ptr, shdr[index].sh_size, *(rt_uint32_t *)data_addr); ptr += shdr[index].sh_size; } @@ -396,7 +396,7 @@ rt_err_t dlmodule_load_relocated_object(struct rt_dlmodule* module, void *module if (sym->st_shndx != STN_UNDEF) { Elf32_Addr addr = 0; - + if ((ELF_ST_TYPE(sym->st_info) == STT_SECTION) || (ELF_ST_TYPE(sym->st_info) == STT_OBJECT)) { diff --git a/components/libc/libdl/dlelf.h b/components/libc/libdl/dlelf.h index 014ebe85c8..ad9e2cdade 100644 --- a/components/libc/libdl/dlelf.h +++ b/components/libc/libdl/dlelf.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2018/08/29 Bernard first version diff --git a/components/libc/libdl/dlerror.c b/components/libc/libdl/dlerror.c index ad9b630e4c..de948eb16b 100644 --- a/components/libc/libdl/dlerror.c +++ b/components/libc/libdl/dlerror.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2010-11-17 yi.qiu first version @@ -13,6 +13,6 @@ const char *dlerror(void) { - return "TODO"; + return "TODO"; } RTM_EXPORT(dlerror) diff --git a/components/libc/libdl/dlfcn.h b/components/libc/libdl/dlfcn.h index 55273a41eb..f5c9063f2f 100644 --- a/components/libc/libdl/dlfcn.h +++ b/components/libc/libdl/dlfcn.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - * + * * Change Logs: * Date Author Notes * 2010-11-17 yi.qiu first version diff --git a/components/libc/libdl/dlmodule.c b/components/libc/libdl/dlmodule.c index 314cf52709..c4bbb26b37 100644 --- a/components/libc/libdl/dlmodule.c +++ b/components/libc/libdl/dlmodule.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -547,7 +547,7 @@ struct rt_dlmodule* dlmodule_exec(const char* pgname, const char* cmd, int cmd_s if (module->priority > RT_THREAD_PRIORITY_MAX) module->priority = RT_THREAD_PRIORITY_MAX - 1; if (module->stack_size < 2048 || module->stack_size > (1024 * 32)) module->stack_size = 2048; - tid = rt_thread_create(module->parent.name, _dlmodule_thread_entry, (void*)module, + tid = rt_thread_create(module->parent.name, _dlmodule_thread_entry, (void*)module, module->stack_size, module->priority, 10); if (tid) { @@ -724,7 +724,7 @@ struct rt_dlmodule* dlmodule_exec_custom(const char* pgname, const char* cmd, in if (module->priority > RT_THREAD_PRIORITY_MAX) module->priority = RT_THREAD_PRIORITY_MAX - 1; if (module->stack_size < 2048 || module->stack_size > (1024 * 32)) module->stack_size = 2048; - tid = rt_thread_create(module->parent.name, _dlmodule_thread_entry, (void*)module, + tid = rt_thread_create(module->parent.name, _dlmodule_thread_entry, (void*)module, module->stack_size, module->priority, 10); if (tid) { @@ -758,7 +758,7 @@ void dlmodule_exit(int ret_code) rt_enter_critical(); /* module is not running */ - if (module->stat != RT_DLMODULE_STAT_RUNNING) + if (module->stat != RT_DLMODULE_STAT_RUNNING) { /* restore scheduling */ rt_exit_critical(); diff --git a/components/libc/libdl/dlmodule.h b/components/libc/libdl/dlmodule.h index b366c7603e..183faca159 100644 --- a/components/libc/libdl/dlmodule.h +++ b/components/libc/libdl/dlmodule.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/libdl/dlopen.c b/components/libc/libdl/dlopen.c index a8202ec607..bcb57d78f0 100644 --- a/components/libc/libdl/dlopen.c +++ b/components/libc/libdl/dlopen.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -43,12 +43,12 @@ void* dlopen(const char *filename, int flags) /* find in module list */ module = dlmodule_find(fullpath); - if(module != RT_NULL) + if(module != RT_NULL) { rt_exit_critical(); module->nref++; } - else + else { rt_exit_critical(); module = dlmodule_load(fullpath); diff --git a/components/libc/libdl/dlsym.c b/components/libc/libdl/dlsym.c index ed0f183d83..f7c1c901fd 100644 --- a/components/libc/libdl/dlsym.c +++ b/components/libc/libdl/dlsym.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -17,7 +17,7 @@ void* dlsym(void *handle, const char* symbol) { int i; struct rt_dlmodule *module; - + RT_ASSERT(handle != RT_NULL); module = (struct rt_dlmodule *)handle; diff --git a/components/libc/mmap/posix_mmap.c b/components/libc/mmap/posix_mmap.c index a16ace8306..e68b82e640 100644 --- a/components/libc/mmap/posix_mmap.c +++ b/components/libc/mmap/posix_mmap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/mqueue.c b/components/libc/pthreads/mqueue.c index 003b49b9a0..1af0ab2919 100644 --- a/components/libc/pthreads/mqueue.c +++ b/components/libc/pthreads/mqueue.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/mqueue.h b/components/libc/pthreads/mqueue.h index 5cadde3ae8..5152bfad29 100644 --- a/components/libc/pthreads/mqueue.h +++ b/components/libc/pthreads/mqueue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/posix_types.h b/components/libc/pthreads/posix_types.h index ca20464bb5..f2d806cc9a 100644 --- a/components/libc/pthreads/posix_types.h +++ b/components/libc/pthreads/posix_types.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2013-12-23 Bernard Add the checking for ESHUTDOWN + * 2013-12-23 Bernard Add the checking for ESHUTDOWN */ #ifndef __POSIX_TYPES_H__ diff --git a/components/libc/pthreads/pthread.c b/components/libc/pthreads/pthread.c index 7430510bf2..8a728c4e99 100644 --- a/components/libc/pthreads/pthread.c +++ b/components/libc/pthreads/pthread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -201,7 +201,7 @@ int pthread_create(pthread_t *pid, /* allocate posix thread data */ pth_id = _pthread_data_create(); - if (pth_id == PTHREAD_NUM_MAX) + if (pth_id == PTHREAD_NUM_MAX) { ret = ENOMEM; goto __exit; diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h index 7bb72b726c..8639c1604b 100644 --- a/components/libc/pthreads/pthread.h +++ b/components/libc/pthreads/pthread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -161,7 +161,7 @@ int pthread_attr_getguardsize(pthread_attr_t const *attr, size_t *guard_size); int pthread_attr_setscope(pthread_attr_t *attr, int scope); int pthread_attr_getscope(pthread_attr_t const *attr); int pthread_system_init(void); -int pthread_create (pthread_t *tid, const pthread_attr_t *attr, +int pthread_create (pthread_t *tid, const pthread_attr_t *attr, void *(*start) (void *), void *arg); int pthread_detach (pthread_t thread); diff --git a/components/libc/pthreads/pthread_attr.c b/components/libc/pthreads/pthread_attr.c index 2294599bf3..4aedf5a90d 100644 --- a/components/libc/pthreads/pthread_attr.c +++ b/components/libc/pthreads/pthread_attr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -16,7 +16,7 @@ #define DEFAULT_STACK_SIZE 2048 #define DEFAULT_PRIORITY (RT_THREAD_PRIORITY_MAX/2 + RT_THREAD_PRIORITY_MAX/4) -const pthread_attr_t pthread_default_attr = +const pthread_attr_t pthread_default_attr = { 0, /* stack base */ DEFAULT_STACK_SIZE, /* stack size */ diff --git a/components/libc/pthreads/pthread_barrier.c b/components/libc/pthreads/pthread_barrier.c index d76fe7f13f..1a5b7fa3f9 100644 --- a/components/libc/pthreads/pthread_barrier.c +++ b/components/libc/pthreads/pthread_barrier.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/pthread_cond.c b/components/libc/pthreads/pthread_cond.c index 38dc697469..59c271bf6e 100644 --- a/components/libc/pthreads/pthread_cond.c +++ b/components/libc/pthreads/pthread_cond.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -84,10 +84,10 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) rt_snprintf(cond_name, sizeof(cond_name), "cond%02d", cond_num++); - if (attr == RT_NULL) /* use default value */ - cond->attr = PTHREAD_PROCESS_PRIVATE; - else - cond->attr = *attr; + if (attr == RT_NULL) /* use default value */ + cond->attr = PTHREAD_PROCESS_PRIVATE; + else + cond->attr = *attr; result = rt_sem_init(&cond->sem, cond_name, 0, RT_IPC_FLAG_FIFO); if (result != RT_EOK) diff --git a/components/libc/pthreads/pthread_internal.h b/components/libc/pthreads/pthread_internal.h index 240741e21a..1fce29f636 100644 --- a/components/libc/pthreads/pthread_internal.h +++ b/components/libc/pthreads/pthread_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/pthread_mutex.c b/components/libc/pthreads/pthread_mutex.c index 8f96531782..a681380b11 100644 --- a/components/libc/pthreads/pthread_mutex.c +++ b/components/libc/pthreads/pthread_mutex.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -211,7 +211,7 @@ int pthread_mutex_unlock(pthread_mutex_t *mutex) result = rt_mutex_release(&(mutex->lock)); if (result == RT_EOK) return 0; - + return EINVAL; } RTM_EXPORT(pthread_mutex_unlock); diff --git a/components/libc/pthreads/pthread_rwlock.c b/components/libc/pthreads/pthread_rwlock.c index 64a0e221b4..1c2fe19f5f 100644 --- a/components/libc/pthreads/pthread_rwlock.c +++ b/components/libc/pthreads/pthread_rwlock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -60,7 +60,7 @@ int pthread_rwlock_init(pthread_rwlock_t *rwlock, pthread_mutex_init(&(rwlock->rw_mutex), NULL); pthread_cond_init(&(rwlock->rw_condreaders), NULL); pthread_cond_init(&(rwlock->rw_condwriters), NULL); - + rwlock->rw_nwaitwriters = 0; rwlock->rw_nwaitreaders = 0; rwlock->rw_refcount = 0; @@ -117,7 +117,7 @@ int pthread_rwlock_destroy (pthread_rwlock_t *rwlock) pthread_mutex_unlock(&rwlock->rw_mutex); if (result == 0) pthread_mutex_destroy(&rwlock->rw_mutex); - + return result; } RTM_EXPORT(pthread_rwlock_destroy); @@ -234,7 +234,7 @@ int pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, result = pthread_cond_timedwait(&rwlock->rw_condwriters, &rwlock->rw_mutex, abstime); /* rw_mutex should have been taken again when returned from waiting */ rwlock->rw_nwaitwriters--; - + if (result != 0) break; } @@ -324,7 +324,7 @@ int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) result = pthread_cond_wait(&rwlock->rw_condwriters, &rwlock->rw_mutex); /* rw_mutex should have been taken again when returned from waiting */ rwlock->rw_nwaitwriters--; - + if (result != 0) break; } diff --git a/components/libc/pthreads/pthread_spin.c b/components/libc/pthreads/pthread_spin.c index b31f4f6393..3f3dc1593c 100644 --- a/components/libc/pthreads/pthread_spin.c +++ b/components/libc/pthreads/pthread_spin.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/pthread_tls.c b/components/libc/pthreads/pthread_tls.c index 4b97d796d9..d48df7f2dd 100644 --- a/components/libc/pthreads/pthread_tls.c +++ b/components/libc/pthreads/pthread_tls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/sched.c b/components/libc/pthreads/sched.c index a1bf50985e..5f2a53c01f 100644 --- a/components/libc/pthreads/sched.c +++ b/components/libc/pthreads/sched.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/sched.h b/components/libc/pthreads/sched.h index dbaf66edc2..07e2c0c6a8 100644 --- a/components/libc/pthreads/sched.h +++ b/components/libc/pthreads/sched.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/semaphore.c b/components/libc/pthreads/semaphore.c index 2ed93e99b6..398cdf1f49 100644 --- a/components/libc/pthreads/semaphore.c +++ b/components/libc/pthreads/semaphore.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/pthreads/semaphore.h b/components/libc/pthreads/semaphore.h index d135ae9261..872226e385 100644 --- a/components/libc/pthreads/semaphore.h +++ b/components/libc/pthreads/semaphore.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/signal/posix_signal.c b/components/libc/signal/posix_signal.c index c0dd90e637..b06fe12685 100644 --- a/components/libc/signal/posix_signal.c +++ b/components/libc/signal/posix_signal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/signal/posix_signal.h b/components/libc/signal/posix_signal.h index 896d6b6da4..fa8ad38fa6 100644 --- a/components/libc/signal/posix_signal.h +++ b/components/libc/signal/posix_signal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/termios/posix_termios.c b/components/libc/termios/posix_termios.c index 9c736c3184..01ba010c86 100644 --- a/components/libc/termios/posix_termios.c +++ b/components/libc/termios/posix_termios.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/libc/termios/posix_termios.h b/components/libc/termios/posix_termios.h index c61191b7dc..5bd1999b0a 100644 --- a/components/libc/termios/posix_termios.h +++ b/components/libc/termios/posix_termios.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index 7881fcc68f..9789595ee7 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp.h b/components/lwp/lwp.h index f013f36768..3607f89b17 100644 --- a/components/lwp/lwp.h +++ b/components/lwp/lwp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp_mem.c b/components/lwp/lwp_mem.c index 63fd5c89e1..2063fbb983 100644 --- a/components/lwp/lwp_mem.c +++ b/components/lwp/lwp_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -98,7 +98,7 @@ void rt_lwp_mem_init(struct rt_lwp *lwp) void rt_lwp_mem_deinit(struct rt_lwp *lwp) { struct rt_list_node *node; - + RT_ASSERT(lwp != RT_NULL); node = lwp->hlist.next; @@ -161,7 +161,7 @@ void rt_lwp_mem_free(void *addr) /* get memory item */ header_ptr = (struct rt_lwp_memheap_item *)((rt_uint8_t *)addr - RT_MEMHEAP_SIZE); RT_ASSERT(header_ptr); - + lwp_heap = header_ptr->pool_ptr; RT_ASSERT(lwp_heap); diff --git a/components/lwp/lwp_mem.h b/components/lwp/lwp_mem.h index 8d333cfe4f..7ef1c2293c 100644 --- a/components/lwp/lwp_mem.h +++ b/components/lwp/lwp_mem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp_memheap.c b/components/lwp/lwp_memheap.c index 7d512a503f..7516fa0a30 100644 --- a/components/lwp/lwp_memheap.c +++ b/components/lwp/lwp_memheap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp_memheap.h b/components/lwp/lwp_memheap.h index d0c09dfd01..845feb8594 100644 --- a/components/lwp/lwp_memheap.h +++ b/components/lwp/lwp_memheap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index be95c5fb89..02915ab1cc 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/lwp/lwp_syscall.h b/components/lwp/lwp_syscall.h index a2809059f0..ba1b34a648 100644 --- a/components/lwp/lwp_syscall.h +++ b/components/lwp/lwp_syscall.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -23,12 +23,12 @@ typedef uint32_t id_t; /* may contain pid, uid or gid */ /* * Process priority specifications to get/setpriority. */ -#define PRIO_MIN (-20) -#define PRIO_MAX 20 +#define PRIO_MIN (-20) +#define PRIO_MAX 20 -#define PRIO_PROCESS 0 /* only support lwp process */ -#define PRIO_PGRP 1 -#define PRIO_USER 2 +#define PRIO_PROCESS 0 /* only support lwp process */ +#define PRIO_PGRP 1 +#define PRIO_USER 2 #ifndef TIMEVAL_TO_TIMESPEC #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c index ce8559f129..6d4c040856 100644 --- a/components/net/at/at_socket/at_socket.c +++ b/components/net/at/at_socket/at_socket.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -70,8 +70,8 @@ struct at_socket *at_get_socket(int socket) return at_sock; } } - } - + } + rt_hw_interrupt_enable(level); return RT_NULL; @@ -289,7 +289,7 @@ static int alloc_empty_socket(rt_slist_t *l) rt_slist_for_each(node, &_socket_list) { at_sock = rt_slist_entry(node, struct at_socket, list); - if(at_sock->socket != idx) + if(at_sock->socket != idx) break; idx++; pre_node = node; @@ -337,7 +337,7 @@ static struct at_socket *alloc_socket_by_device(struct at_device *device, enum a { goto __err; } - + sock = &(device->sockets[idx]); /* the socket descriptor is the number of sockte lists */ sock->socket = alloc_empty_socket(&(sock->list)); @@ -508,7 +508,7 @@ int at_closesocket(int socket) /* deal with TCP server actively disconnect */ rt_thread_delay(rt_tick_from_millisecond(100)); - + sock = at_get_socket(socket); if (sock == RT_NULL) { @@ -529,7 +529,7 @@ int at_closesocket(int socket) } } - free_socket(sock); + free_socket(sock); return 0; } @@ -603,7 +603,7 @@ int at_bind(int socket, const struct sockaddr *name, socklen_t namelen) /* input ip address is different from device ip address */ if (ip_addr_cmp(&input_ipaddr, &local_ipaddr) == 0) - { + { struct at_socket *new_sock = RT_NULL; struct at_device *new_device = RT_NULL; enum at_socket_type type = sock->type; @@ -613,7 +613,7 @@ int at_bind(int socket, const struct sockaddr *name, socklen_t namelen) { return -1; } - + extern struct at_device *at_device_get_by_ipaddr(ip_addr_t *ip_addr); new_device = at_device_get_by_ipaddr(&input_ipaddr); if (new_device == RT_NULL) @@ -649,7 +649,7 @@ static void at_recv_notice_cb(struct at_socket *sock, at_socket_evt_t event, con { RT_ASSERT(buff); RT_ASSERT(event == AT_SOCKET_EVT_RECV); - + /* check the socket object status */ if (sock->magic != AT_SOCKET_MAGIC) { @@ -675,7 +675,7 @@ static void at_closed_notice_cb(struct at_socket *sock, at_socket_evt_t event, c { return; } - + at_do_event_changes(sock, AT_EVENT_RECV, RT_TRUE); at_do_event_changes(sock, AT_EVENT_ERROR, RT_TRUE); @@ -731,7 +731,7 @@ __exit: { at_do_event_changes(sock, AT_EVENT_SEND, RT_TRUE); } - + return result; } @@ -780,7 +780,7 @@ int at_recvfrom(int socket, void *mem, size_t len, int flags, struct sockaddr *f goto __exit; } rt_mutex_release(sock->recv_lock); - + /* socket passively closed, receive function return 0 */ if (sock->state == AT_SOCKET_CLOSED) { @@ -821,7 +821,7 @@ int at_recvfrom(int socket, void *mem, size_t len, int flags, struct sockaddr *f goto __exit; } else - { + { /* get receive buffer to receiver ring buffer */ rt_mutex_take(sock->recv_lock, RT_WAITING_FOREVER); @@ -945,7 +945,7 @@ __exit: { if (sock != RT_NULL) { - at_do_event_changes(sock, AT_EVENT_ERROR, RT_TRUE); + at_do_event_changes(sock, AT_EVENT_ERROR, RT_TRUE); } } else @@ -1138,13 +1138,13 @@ struct hostent *at_gethostbyname(const char *name) #if NETDEV_IPV4 && NETDEV_IPV6 addr.u_addr.ip4.addr = ipstr_to_u32(ipstr); - addr.type = IPADDR_TYPE_V4; + addr.type = IPADDR_TYPE_V4; #elif NETDEV_IPV4 addr.addr = ipstr_to_u32(ipstr); #elif NETDEV_IPV6 #error "not support IPV6." #endif /* NETDEV_IPV4 && NETDEV_IPV6 */ - + /* fill hostent structure */ s_hostent_addr = addr; s_phostent_addr[0] = &s_hostent_addr; @@ -1243,8 +1243,8 @@ int at_getaddrinfo(const char *nodename, const char *servname, { strncpy(ip_str, nodename, strlen(nodename)); } - - #if NETDEV_IPV4 && NETDEV_IPV6 + + #if NETDEV_IPV4 && NETDEV_IPV6 addr.type = IPADDR_TYPE_V4; if ((addr.u_addr.ip4.addr = ipstr_to_u32(ip_str)) == 0) { @@ -1254,7 +1254,7 @@ int at_getaddrinfo(const char *nodename, const char *servname, addr.addr = ipstr_to_u32(ip_str); #elif NETDEV_IPV6 #error "not support IPV6." - #endif /* NETDEV_IPV4 && NETDEV_IPV6 */ + #endif /* NETDEV_IPV4 && NETDEV_IPV6 */ } } else diff --git a/components/net/at/at_socket/at_socket.h b/components/net/at/at_socket/at_socket.h index 3317579f05..caac6d2d5d 100644 --- a/components/net/at/at_socket/at_socket.h +++ b/components/net/at/at_socket/at_socket.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/at/include/at.h b/components/net/at/include/at.h index 7be821c21d..c6d0e3a5ce 100644 --- a/components/net/at/include/at.h +++ b/components/net/at/include/at.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/at/include/at_log.h b/components/net/at/include/at_log.h index 9e133561f7..acb5b34ecc 100644 --- a/components/net/at/include/at_log.h +++ b/components/net/at/include/at_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/at/src/at_base_cmd.c b/components/net/at/src/at_base_cmd.c index b182477f9b..00720c87b2 100644 --- a/components/net/at/src/at_base_cmd.c +++ b/components/net/at/src/at_base_cmd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/at/src/at_cli.c b/components/net/at/src/at_cli.c index e39a913357..25fbb708f4 100644 --- a/components/net/at/src/at_cli.c +++ b/components/net/at/src/at_cli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -27,7 +27,7 @@ static rt_err_t (*odev_rx_ind)(rt_device_t dev, rt_size_t size) = RT_NULL; #ifdef AT_USING_CLIENT static struct rt_semaphore client_rx_notice; static struct rt_ringbuffer *client_rx_fifo = RT_NULL; -#endif +#endif static char console_getchar(void) { diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c index f46abd5cd4..5e077512ae 100644 --- a/components/net/at/src/at_client.c +++ b/components/net/at/src/at_client.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -577,7 +577,7 @@ int at_obj_set_urc_table(at_client_t client, const struct at_urc *urc_table, rt_ client->urc_table[client->urc_table_size].urc = urc_table; client->urc_table[client->urc_table_size].urc_size = table_sz; client->urc_table_size++; - + rt_free(old_urc_table); } diff --git a/components/net/at/src/at_server.c b/components/net/at/src/at_server.c index 81d00951f5..bfbbbae2d3 100644 --- a/components/net/at/src/at_server.c +++ b/components/net/at/src/at_server.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/at/src/at_utils.c b/components/net/at/src/at_utils.c index 7d26425f56..8d8887fe5e 100644 --- a/components/net/at/src/at_utils.c +++ b/components/net/at/src/at_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/lwip-1.4.1/src/api/api_lib.c b/components/net/lwip-1.4.1/src/api/api_lib.c index 4bdf08edfc..9cf93d4a19 100644 --- a/components/net/lwip-1.4.1/src/api/api_lib.c +++ b/components/net/lwip-1.4.1/src/api/api_lib.c @@ -3,12 +3,12 @@ * Sequential API External module * */ - + /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/api/api_msg.c b/components/net/lwip-1.4.1/src/api/api_msg.c index 7c58a77bde..5bb78cd698 100644 --- a/components/net/lwip-1.4.1/src/api/api_msg.c +++ b/components/net/lwip-1.4.1/src/api/api_msg.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -332,7 +332,7 @@ sent_tcp(void *arg, struct tcp_pcb *pcb, u16_t len) API_EVENT(conn, NETCONN_EVT_SENDPLUS, len); } } - + return ERR_OK; } @@ -1255,7 +1255,7 @@ do_writemore(struct netconn *conn) if (available < len) { /* don't try to write more than sendbuf */ len = available; - if (dontblock){ + if (dontblock){ if (!len) { err = ERR_WOULDBLOCK; goto err_mem; @@ -1491,7 +1491,7 @@ do_close(struct api_msg_msg *msg) */ void do_join_leave_group(struct api_msg_msg *msg) -{ +{ if (ERR_IS_FATAL(msg->conn->last_err)) { msg->err = msg->conn->last_err; } else { diff --git a/components/net/lwip-1.4.1/src/api/err.c b/components/net/lwip-1.4.1/src/api/err.c index 92fa8b7dba..78a576f354 100644 --- a/components/net/lwip-1.4.1/src/api/err.c +++ b/components/net/lwip-1.4.1/src/api/err.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/api/netbuf.c b/components/net/lwip-1.4.1/src/api/netbuf.c index 9390c9ee98..cea0fa3ba8 100644 --- a/components/net/lwip-1.4.1/src/api/netbuf.c +++ b/components/net/lwip-1.4.1/src/api/netbuf.c @@ -3,12 +3,12 @@ * Network buffer management * */ - + /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/api/netdb.c b/components/net/lwip-1.4.1/src/api/netdb.c index 6a4bac561c..3454004345 100644 --- a/components/net/lwip-1.4.1/src/api/netdb.c +++ b/components/net/lwip-1.4.1/src/api/netdb.c @@ -5,7 +5,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -14,21 +14,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ @@ -258,7 +258,7 @@ lwip_freeaddrinfo(struct addrinfo *ai) * * @param nodename descriptive name or address string of the host * (may be NULL -> local address) - * @param servname port number as string of NULL + * @param servname port number as string of NULL * @param hints structure containing input values that set socktype and protocol * @param res pointer to a pointer where to store the result (set to NULL on failure) * @return 0 on success, non-zero on failure diff --git a/components/net/lwip-1.4.1/src/api/netifapi.c b/components/net/lwip-1.4.1/src/api/netifapi.c index 43e47203a9..ba0e1eea81 100644 --- a/components/net/lwip-1.4.1/src/api/netifapi.c +++ b/components/net/lwip-1.4.1/src/api/netifapi.c @@ -5,7 +5,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -14,21 +14,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * */ #include "lwip/opt.h" diff --git a/components/net/lwip-1.4.1/src/api/sockets.c b/components/net/lwip-1.4.1/src/api/sockets.c index c5bcf8b4a2..a81d3fc34f 100644 --- a/components/net/lwip-1.4.1/src/api/sockets.c +++ b/components/net/lwip-1.4.1/src/api/sockets.c @@ -75,7 +75,7 @@ struct lwip_sock { tested by select */ u16_t sendevent; /** error happened for this socket, set by event_callback(), tested by select */ - u16_t errevent; + u16_t errevent; /** last error that occurred on this socket */ int err; /** counter of how many threads are waiting for this socket using select */ @@ -593,7 +593,7 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, buf = sock->lastdata; } else { /* If this is non-blocking call, then check first */ - if (((flags & MSG_DONTWAIT) || netconn_is_nonblocking(sock->conn)) && + if (((flags & MSG_DONTWAIT) || netconn_is_nonblocking(sock->conn)) && (sock->rcvevent <= 0)) { if (off > 0) { /* update receive window */ @@ -665,9 +665,9 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, if (netconn_type(sock->conn) == NETCONN_TCP) { LWIP_ASSERT("invalid copylen, len would underflow", len >= copylen); len -= copylen; - if ( (len <= 0) || - (p->flags & PBUF_FLAG_PUSH) || - (sock->rcvevent <= 0) || + if ( (len <= 0) || + (p->flags & PBUF_FLAG_PUSH) || + (sock->rcvevent <= 0) || ((flags & MSG_PEEK)!=0)) { done = 1; } @@ -898,7 +898,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags, #endif /* LWIP_UDP */ } UNLOCK_TCPIP_CORE(); - + pbuf_free(p); } else { err = ERR_MEM; @@ -1482,11 +1482,11 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) /* Do length and type checks for the various options first, to keep it readable. */ switch (level) { - + /* Level: SOL_SOCKET */ case SOL_SOCKET: switch (optname) { - + case SO_ACCEPTCONN: case SO_BROADCAST: /* UNIMPL case SO_DEBUG: */ @@ -1537,7 +1537,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = ENOPROTOOPT; } /* switch (optname) */ break; - + /* Level: IPPROTO_IP */ case IPPROTO_IP: switch (optname) { @@ -1577,7 +1577,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = ENOPROTOOPT; } /* switch (optname) */ break; - + #if LWIP_TCP /* Level: IPPROTO_TCP */ case IPPROTO_TCP: @@ -1585,7 +1585,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = EINVAL; break; } - + /* If this is no TCP socket, ignore any options. */ if (sock->conn->type != NETCONN_TCP) return 0; @@ -1599,7 +1599,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) case TCP_KEEPCNT: #endif /* LWIP_TCP_KEEPALIVE */ break; - + default: LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, UNIMPL: optname=0x%x, ..)\n", s, optname)); @@ -1614,7 +1614,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = EINVAL; break; } - + /* If this is no UDP lite socket, ignore any options. */ if (sock->conn->type != NETCONN_UDPLITE) { return 0; @@ -1624,7 +1624,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) case UDPLITE_SEND_CSCOV: case UDPLITE_RECV_CSCOV: break; - + default: LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_UDPLITE, UNIMPL: optname=0x%x, ..)\n", s, optname)); @@ -1639,7 +1639,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = ENOPROTOOPT; } /* switch */ - + if (err != ERR_OK) { sock_set_errno(sock, err); return -1; @@ -1734,7 +1734,7 @@ lwip_getsockopt_internal(void *arg) /* only overwrite ERR_OK or tempoary errors */ if ((sock->err == 0) || (sock->err == EINPROGRESS)) { sock_set_errno(sock, err_to_errno(sock->conn->last_err)); - } + } *(int *)optval = sock->err; sock->err = 0; LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_ERROR) = %d\n", diff --git a/components/net/lwip-1.4.1/src/api/tcpip.c b/components/net/lwip-1.4.1/src/api/tcpip.c index 18d5f679f4..4b73bb5986 100644 --- a/components/net/lwip-1.4.1/src/api/tcpip.c +++ b/components/net/lwip-1.4.1/src/api/tcpip.c @@ -310,7 +310,7 @@ tcpip_apimsg(struct api_msg *apimsg) /* catch functions that don't set err */ apimsg->msg.err = ERR_VAL; #endif - + if (sys_mbox_valid(&mbox)) { msg.type = TCPIP_MSG_API; msg.msg.apimsg = apimsg; @@ -360,14 +360,14 @@ err_t tcpip_netifapi(struct netifapi_msg* netifapimsg) { struct tcpip_msg msg; - + if (sys_mbox_valid(&mbox)) { err_t err = sys_sem_new(&netifapimsg->msg.sem, 0); if (err != ERR_OK) { netifapimsg->msg.err = err; return err; } - + msg.type = TCPIP_MSG_NETIFAPI; msg.msg.netifapimsg = netifapimsg; sys_mbox_post(&mbox, &msg); @@ -389,7 +389,7 @@ tcpip_netifapi(struct netifapi_msg* netifapimsg) err_t tcpip_netifapi_lock(struct netifapi_msg* netifapimsg) { - LOCK_TCPIP_CORE(); + LOCK_TCPIP_CORE(); netifapimsg->function(&(netifapimsg->msg)); UNLOCK_TCPIP_CORE(); return netifapimsg->msg.err; diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h index ecf22177ac..8dd59e8dee 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h @@ -60,17 +60,17 @@ typedef uintptr_t mem_ptr_t; /* some errno not defined in newlib */ #define ENSRNOTFOUND 163 /* Domain name not found */ /* WARNING: ESHUTDOWN also not defined in newlib. We chose - 180 here because the number "108" which is used - in arch.h has been assigned to another error code. */ + 180 here because the number "108" which is used + in arch.h has been assigned to another error code. */ #define ESHUTDOWN 180 #endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */ #endif #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #include -#define LWIP_TIMEVAL_PRIVATE 0 +#define LWIP_TIMEVAL_PRIVATE 0 #else -#define LWIP_TIMEVAL_PRIVATE 1 +#define LWIP_TIMEVAL_PRIVATE 1 #endif #if defined(__CC_ARM) /* ARMCC compiler */ @@ -102,14 +102,14 @@ typedef uintptr_t mem_ptr_t; #endif void sys_arch_assert(const char* file, int line); -#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) +#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) #define LWIP_PLATFORM_ASSERT(x) do {rt_kprintf(x); sys_arch_assert(__FILE__, __LINE__);}while(0) #include "string.h" -#define SYS_ARCH_DECL_PROTECT(level) -#define SYS_ARCH_PROTECT(level) rt_enter_critical() -#define SYS_ARCH_UNPROTECT(level) rt_exit_critical() +#define SYS_ARCH_DECL_PROTECT(level) +#define SYS_ARCH_PROTECT(level) rt_enter_critical() +#define SYS_ARCH_UNPROTECT(level) rt_exit_critical() #endif /* __ARCH_CC_H__ */ diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/perf.h b/components/net/lwip-1.4.1/src/arch/include/arch/perf.h index 675f1f65dc..4b7720ef40 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/perf.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/perf.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: perf.h,v 1.1.1.1 2004/12/16 14:17:13 bear Exp $ @@ -42,8 +42,8 @@ /* void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); + unsigned long c2l, unsigned long c2h, + char *key); void perf_print_times(struct tms *start, struct tms *end, char *key); diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h b/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h index 72814aa25c..9dbf3bf284 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: sys_arch.h,v 1.3 2005/03/13 16:03:23 bear Exp $ diff --git a/components/net/lwip-1.4.1/src/arch/sys_arch.c b/components/net/lwip-1.4.1/src/arch/sys_arch.c index 2f6dbb4143..0bdce1e075 100644 --- a/components/net/lwip-1.4.1/src/arch/sys_arch.c +++ b/components/net/lwip-1.4.1/src/arch/sys_arch.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (C) 2006-2018, RT-Thread Development Team + * COPYRIGHT (C) 2006-2021, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -195,9 +195,9 @@ int lwip_system_init(void) netifapi_netif_set_addr(netif_default, &ipaddr, &netmask, &gw); } #endif - rt_kprintf("lwIP-%d.%d.%d initialized!\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION); + rt_kprintf("lwIP-%d.%d.%d initialized!\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION); - return 0; + return 0; } INIT_PREV_EXPORT(lwip_system_init); diff --git a/components/net/lwip-1.4.1/src/core/def.c b/components/net/lwip-1.4.1/src/core/def.c index 352b55241a..bb4b8e01fc 100644 --- a/components/net/lwip-1.4.1/src/core/def.c +++ b/components/net/lwip-1.4.1/src/core/def.c @@ -44,7 +44,7 @@ * Again with the aim of being simple, correct and fully portable. * Byte swapping is the second thing you would want to optimize. You will * need to port it to your architecture and in your cc.h: - * + * * #define LWIP_PLATFORM_BYTESWAP 1 * #define LWIP_PLATFORM_HTONS(x) * #define LWIP_PLATFORM_HTONL(x) diff --git a/components/net/lwip-1.4.1/src/core/dhcp.c b/components/net/lwip-1.4.1/src/core/dhcp.c index eb12c55021..4f71b88897 100644 --- a/components/net/lwip-1.4.1/src/core/dhcp.c +++ b/components/net/lwip-1.4.1/src/core/dhcp.c @@ -197,14 +197,14 @@ static void dhcp_handle_nak(struct netif *netif) { struct dhcp *dhcp = netif->dhcp; - LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); /* Set the interface down since the address must no longer be used, as per RFC2131 */ netif_set_down(netif); /* remove IP address from interface */ netif_set_ipaddr(netif, IP_ADDR_ANY); netif_set_gw(netif, IP_ADDR_ANY); - netif_set_netmask(netif, IP_ADDR_ANY); + netif_set_netmask(netif, IP_ADDR_ANY); /* Change to a defined state */ dhcp_set_state(dhcp, DHCP_BACKING_OFF); /* We can immediately restart discovery */ @@ -373,7 +373,7 @@ dhcp_fine_tmr() while (netif != NULL) { /* only act on DHCP configured interfaces */ if (netif->dhcp != NULL) { - /* timer is active (non zero), and is about to trigger now */ + /* timer is active (non zero), and is about to trigger now */ if (netif->dhcp->request_timeout > 1) { netif->dhcp->request_timeout--; } @@ -564,7 +564,7 @@ dhcp_handle_ack(struct netif *netif) if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) { ip4_addr_set_u32(&dhcp->offered_gw_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER))); } - + #if LWIP_DNS /* DNS servers */ n = 0; @@ -670,7 +670,7 @@ dhcp_start(struct netif *netif) LWIP_ASSERT("pbuf p_out wasn't freed", dhcp->p_out == NULL); LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL ); } - + /* clear data structure */ memset(dhcp, 0, sizeof(struct dhcp)); /* dhcp_set_state(&dhcp, DHCP_OFF); */ @@ -1183,7 +1183,7 @@ dhcp_release(struct netif *netif) ip_addr_set_zero(&dhcp->offered_si_addr); #endif /* LWIP_DHCP_BOOTP_FILE */ dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0; - + /* create and initialize the DHCP message header */ result = dhcp_create_msg(netif, dhcp, DHCP_RELEASE); if (result == ERR_OK) { @@ -1207,7 +1207,7 @@ dhcp_release(struct netif *netif) netif_set_ipaddr(netif, IP_ADDR_ANY); netif_set_gw(netif, IP_ADDR_ANY); netif_set_netmask(netif, IP_ADDR_ANY); - + return result; } diff --git a/components/net/lwip-1.4.1/src/core/dns.c b/components/net/lwip-1.4.1/src/core/dns.c index 2e1356ca97..3aa5047043 100644 --- a/components/net/lwip-1.4.1/src/core/dns.c +++ b/components/net/lwip-1.4.1/src/core/dns.c @@ -49,13 +49,13 @@ * The lwIP version of the resolver also adds a non-blocking version of * gethostbyname() that will work with a raw API application. This function * checks for an IP address string first and converts it if it is valid. - * gethostbyname() then does a dns_lookup() to see if the name is - * already in the table. If so, the IP is returned. If not, a query is + * gethostbyname() then does a dns_lookup() to see if the name is + * already in the table. If so, the IP is returned. If not, a query is * issued and the function returns with a ERR_INPROGRESS status. The app * using the dns client must then go into a waiting state. * * Once a hostname has been resolved (or found to be non-existent), - * the resolver code calls a specified callback function (which + * the resolver code calls a specified callback function (which * must be implemented by the module that uses the resolver). */ @@ -236,7 +236,7 @@ dns_init() ip_addr_t dnsserver; dns_payload = (u8_t *)LWIP_MEM_ALIGN(dns_payload_buffer); - + /* initialize default DNS server address */ DNS_SERVER_ADDRESS(&dnsserver); @@ -277,7 +277,7 @@ dns_setserver(u8_t numdns, ip_addr_t *dnsserver) if ((numdns < DNS_MAX_SERVERS) && (dns_pcb != NULL) && (dnsserver != NULL) && !ip_addr_isany(dnsserver)) { dns_servers[numdns] = (*dnsserver); - + #ifdef RT_USING_NETDEV extern struct netif *netif_list; extern struct netdev *netdev_get_by_name(const char *name); @@ -662,7 +662,7 @@ dns_check_entry(u8_t i) pEntry->numdns = 0; pEntry->tmr = 1; pEntry->retries = 0; - + /* send DNS packet for this entry */ err = dns_send(pEntry->numdns, pEntry->name, i); if (err != ERR_OK) { @@ -772,7 +772,7 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t goto memerr; } - /* copy dns payload inside static buffer for processing */ + /* copy dns payload inside static buffer for processing */ if (pbuf_copy_partial(p, dns_payload, p->tot_len, 0) == p->tot_len) { /* The ID in the DNS header should be our entry into the name table. */ hdr = (struct dns_hdr*)dns_payload; diff --git a/components/net/lwip-1.4.1/src/core/init.c b/components/net/lwip-1.4.1/src/core/init.c index a7b15a776a..95bb706f76 100644 --- a/components/net/lwip-1.4.1/src/core/init.c +++ b/components/net/lwip-1.4.1/src/core/init.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -191,7 +191,7 @@ #if NETCONN_MORE != TCP_WRITE_FLAG_MORE #error "NETCONN_MORE != TCP_WRITE_FLAG_MORE" #endif -#endif /* LWIP_NETCONN && LWIP_TCP */ +#endif /* LWIP_NETCONN && LWIP_TCP */ #if LWIP_SOCKET /* Check that the SO_* socket options and SOF_* lwIP-internal flags match */ #if SO_ACCEPTCONN != SOF_ACCEPTCONN diff --git a/components/net/lwip-1.4.1/src/core/ipv4/autoip.c b/components/net/lwip-1.4.1/src/core/ipv4/autoip.c index b122da27e3..70684cf771 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/autoip.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/autoip.c @@ -43,9 +43,9 @@ /******************************************************************************* * USAGE: - * + * * define LWIP_AUTOIP 1 in your lwipopts.h - * + * * If you don't use tcpip.c (so, don't call, you don't call tcpip_init): * - First, call autoip_init(). * - call autoip_tmr() all AUTOIP_TMR_INTERVAL msces, @@ -55,7 +55,7 @@ * * Without DHCP: * - Call autoip_start() after netif_add(). - * + * * With DHCP: * - define LWIP_DHCP_AUTOIP_COOP 1 in your lwipopts.h. * - Configure your DHCP Client. @@ -202,7 +202,7 @@ autoip_create_addr(struct netif *netif, ip_addr_t *ipaddr) u32_t addr = ntohl(LWIP_AUTOIP_CREATE_SEED_ADDR(netif)); addr += netif->autoip->tried_llipaddr; addr = AUTOIP_NET | (addr & 0xffff); - /* Now, 169.254.0.0 <= addr <= 169.254.255.255 */ + /* Now, 169.254.0.0 <= addr <= 169.254.255.255 */ if (addr < AUTOIP_RANGE_START) { addr += AUTOIP_RANGE_END - AUTOIP_RANGE_START + 1; @@ -213,7 +213,7 @@ autoip_create_addr(struct netif *netif, ip_addr_t *ipaddr) LWIP_ASSERT("AUTOIP address not in range", (addr >= AUTOIP_RANGE_START) && (addr <= AUTOIP_RANGE_END)); ip4_addr_set_u32(ipaddr, htonl(addr)); - + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("autoip_create_addr(): tried_llipaddr=%"U16_F", %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", (u16_t)(netif->autoip->tried_llipaddr), ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), @@ -268,7 +268,7 @@ autoip_bind(struct netif *netif) netif_set_ipaddr(netif, &autoip->llipaddr); netif_set_netmask(netif, &sn_mask); - netif_set_gw(netif, &gw_addr); + netif_set_gw(netif, &gw_addr); /* bring the interface up */ netif_set_up(netif); @@ -493,7 +493,7 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr) */ IPADDR2_COPY(&sipaddr, &hdr->sipaddr); IPADDR2_COPY(&dipaddr, &hdr->dipaddr); - + if ((netif->autoip->state == AUTOIP_STATE_PROBING) || ((netif->autoip->state == AUTOIP_STATE_ANNOUNCING) && (netif->autoip->sent_num == 0))) { diff --git a/components/net/lwip-1.4.1/src/core/ipv4/icmp.c b/components/net/lwip-1.4.1/src/core/ipv4/icmp.c index 47ba857138..aaf39c357e 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/icmp.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/icmp.c @@ -103,7 +103,7 @@ icmp_input(struct pbuf *p, struct netif *inp) case ICMP_ER: /* This is OK, echo reply might have been parsed by a raw PCB (as obviously, an echo request has been sent, too). */ - break; + break; case ICMP_ECHO: #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING { @@ -227,7 +227,7 @@ icmp_input(struct pbuf *p, struct netif *inp) } break; default: - LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", (s16_t)type, (s16_t)code)); ICMP_STATS_INC(icmp.proterr); ICMP_STATS_INC(icmp.drop); diff --git a/components/net/lwip-1.4.1/src/core/ipv4/igmp.c b/components/net/lwip-1.4.1/src/core/ipv4/igmp.c index 45bb5d95c2..0382e5b04d 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/igmp.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/igmp.c @@ -8,29 +8,29 @@ * Copyright (c) 2002 CITEL Technologies Ltd. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is a contribution to the lwIP TCP/IP stack. * The Swedish Institute of Computer Science and Adam Dunkels @@ -70,7 +70,7 @@ Steve Reynolds * RFC 2236 - Internet Group Management Protocol, Version 2 - V2 <- this code is based on this RFC (it's the "de facto" standard) * RFC 3376 - Internet Group Management Protocol, Version 3 - V3 * RFC 4604 - Using Internet Group Management Protocol Version 3... - V3+ - * RFC 2113 - IP Router Alert Option - + * RFC 2113 - IP Router Alert Option - *----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------- @@ -95,7 +95,7 @@ Steve Reynolds #include "string.h" -/* +/* * IGMP constants */ #define IGMP_TTL 1 @@ -167,7 +167,7 @@ igmp_init(void) */ void igmp_dump_group_list() -{ +{ struct igmp_group *group = igmp_group_list; while (group != NULL) { @@ -316,7 +316,7 @@ struct igmp_group * igmp_lookup_group(struct netif *ifp, ip_addr_t *addr) { struct igmp_group *group = igmp_group_list; - + /* Search if the group already exists */ group = igmp_lookfor_group(ifp, addr); if (group != NULL) { @@ -334,7 +334,7 @@ igmp_lookup_group(struct netif *ifp, ip_addr_t *addr) group->last_reporter_flag = 0; group->use = 0; group->next = igmp_group_list; - + igmp_group_list = group; } @@ -395,7 +395,7 @@ igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest) IGMP_STATS_INC(igmp.recv); - /* Note that the length CAN be greater than 8 but only 8 are used - All are included in the checksum */ + /* Note that the length CAN be greater than 8 but only 8 are used - All are included in the checksum */ iphdr = (struct ip_hdr *)p->payload; if (pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4)) || (p->len < IGMP_MINLEN)) { pbuf_free(p); @@ -421,7 +421,7 @@ igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest) /* Packet is ok so find an existing group */ group = igmp_lookfor_group(inp, dest); /* use the destination IP address of incoming packet */ - + /* If group can be found or create... */ if (!group) { pbuf_free(p); @@ -614,7 +614,7 @@ igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr) IGMP_STATS_INC(igmp.tx_leave); igmp_send(group, IGMP_LEAVE_GROUP); } - + /* Disable the group at the MAC level */ if (netif->igmp_mac_filter != NULL) { LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup: igmp_mac_filter(DEL ")); @@ -622,11 +622,11 @@ igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr) LWIP_DEBUGF(IGMP_DEBUG, (") on if %p\n", netif)); netif->igmp_mac_filter(netif, groupaddr, IGMP_DEL_MAC_FILTER); } - + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup: remove group: ")); ip_addr_debug_print(IGMP_DEBUG, groupaddr); - LWIP_DEBUGF(IGMP_DEBUG, ("\n")); - + LWIP_DEBUGF(IGMP_DEBUG, ("\n")); + /* Free the group */ igmp_remove_group(group); } else { @@ -768,13 +768,13 @@ igmp_send(struct igmp_group *group, u8_t type) /* IP header + "router alert" option + IGMP header */ p = pbuf_alloc(PBUF_TRANSPORT, IGMP_MINLEN, PBUF_RAM); - + if (p) { igmp = (struct igmp_msg *)p->payload; LWIP_ASSERT("igmp_send: check that first pbuf can hold struct igmp_msg", (p->len >= sizeof(struct igmp_msg))); ip_addr_copy(src, group->netif->ip_addr); - + if (type == IGMP_V2_MEMB_REPORT) { dest = &(group->group_address); ip_addr_copy(igmp->igmp_group_address, group->group_address); diff --git a/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c b/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c index 960252f64f..014b891eed 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c @@ -48,8 +48,8 @@ * aim of being simple, correct and fully portable. Checksumming is the * first thing you would want to optimize for your platform. If you create * your own version, link it in and in your cc.h put: - * - * #define LWIP_CHKSUM + * + * #define LWIP_CHKSUM * * Or you can select from the implementations below by defining * LWIP_CHKSUM_ALGORITHM to 1, 2 or 3. @@ -72,7 +72,7 @@ * * @param dataptr points to start of data to be summed at any boundary * @param len length of data to be summed - * @return host order (!) lwip checksum (non-inverted Internet sum) + * @return host order (!) lwip checksum (non-inverted Internet sum) * * @note accumulator size limits summable length to 64k * @note host endianess is irrelevant (p3 RFC1071) @@ -128,7 +128,7 @@ lwip_standard_chksum(void *dataptr, u16_t len) * * @param dataptr points to start of data to be summed at any boundary * @param len length of data to be summed - * @return host order (!) lwip checksum (non-inverted Internet sum) + * @return host order (!) lwip checksum (non-inverted Internet sum) */ static u16_t @@ -178,12 +178,12 @@ lwip_standard_chksum(void *dataptr, int len) /** * An optimized checksum routine. Basically, it uses loop-unrolling on * the checksum loop, treating the head and tail bytes specially, whereas - * the inner loop acts on 8 bytes at a time. + * the inner loop acts on 8 bytes at a time. * * @arg start of buffer to be checksummed. May be an odd byte address. * @len number of bytes in the buffer to be checksummed. - * @return host order (!) lwip checksum (non-inverted Internet sum) - * + * @return host order (!) lwip checksum (non-inverted Internet sum) + * * by Curt McDowell, Broadcom Corp. December 8th, 2005 */ diff --git a/components/net/lwip-1.4.1/src/core/ipv4/ip.c b/components/net/lwip-1.4.1/src/core/ipv4/ip.c index 17bcd3929a..fff25f1fb3 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/ip.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/ip.c @@ -1,7 +1,7 @@ /** * @file * This is the IPv4 layer implementation for incoming and outgoing IP traffic. - * + * * @see ip_frag.c * */ @@ -295,7 +295,7 @@ return_noroute: * forwarded (using ip_forward). The IP checksum is always checked. * * Finally, the packet is sent to the upper layer protocol input function. - * + * * @param p the received IP packet (p->payload points to IP header) * @param inp the netif on which this packet was received * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't diff --git a/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c b/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c index 8f633ff231..bbd78534a5 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -45,8 +45,8 @@ const ip_addr_t ip_addr_any = { IPADDR_ANY }; const ip_addr_t ip_addr_broadcast = { IPADDR_BROADCAST }; /** - * Determine if an address is a broadcast address on a network interface - * + * Determine if an address is a broadcast address on a network interface + * * @param addr address to be checked * @param netif the network interface against which the address is checked * @return returns non-zero if the address is a broadcast address diff --git a/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c b/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c index 8d184345df..e1bda3f079 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,25 +17,25 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * - * Author: Jani Monoses + * + * Author: Jani Monoses * Simon Goldschmidt * original reassembly code by Adam Dunkels - * + * */ #include "lwip/opt.h" @@ -185,7 +185,7 @@ ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *p } #endif /* LWIP_ICMP */ - /* First, free all received pbufs. The individual pbufs need to be released + /* First, free all received pbufs. The individual pbufs need to be released separately as they have not yet been chained */ p = ipr->p; while (p != NULL) { @@ -303,7 +303,7 @@ ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen) static void ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev) { - + /* dequeue the reass struct */ if (reassdatagrams == ipr) { /* it was the first in the list */ @@ -337,7 +337,7 @@ ip_reass_chain_frag_into_datagram_and_validate(struct ip_reassdata *ipr, struct int valid = 1; /* Extract length and fragment offset from current fragment */ - fraghdr = (struct ip_hdr*)new_p->payload; + fraghdr = (struct ip_hdr*)new_p->payload; len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4; offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8; @@ -538,7 +538,7 @@ ip_reass(struct pbuf *p) goto nullreturn; } } else { - if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && + if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) { /* ipr->iphdr is not the header from the first fragment, but fraghdr is * -> copy fraghdr into ipr->iphdr since we want to have the header @@ -547,11 +547,11 @@ ip_reass(struct pbuf *p) SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); } } - /* Track the current number of pbufs current 'in-flight', in order to limit + /* Track the current number of pbufs current 'in-flight', in order to limit the number of fragments that may be enqueued at any one time */ ip_reass_pbufcount += clen; - /* At this point, we have either created a new entry or pointing + /* At this point, we have either created a new entry or pointing * to an existing one */ /* check for 'no more fragments', and update queue entry*/ @@ -663,7 +663,7 @@ ipfrag_free_pbuf_custom(struct pbuf *p) * * @return ERR_OK if sent successfully, err_t otherwise */ -err_t +err_t ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest) { struct pbuf *rambuf; @@ -818,8 +818,8 @@ ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest) pbuf_realloc(rambuf, left + IP_HLEN); } - /* This part is ugly: we alloc a RAM based pbuf for - * the link level header for each chunk and then + /* This part is ugly: we alloc a RAM based pbuf for + * the link level header for each chunk and then * free it.A PBUF_ROM style pbuf for which pbuf_header * worked would make things simpler. */ @@ -848,7 +848,7 @@ ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest) * will have already sent the packet, the free will really free, and * there will be zero memory penalty. */ - + pbuf_free(rambuf); #endif /* IP_FRAG_USES_STATIC_BUF */ left -= cop; diff --git a/components/net/lwip-1.4.1/src/core/ipv6/inet6.c b/components/net/lwip-1.4.1/src/core/ipv6/inet6.c index c3de85c093..fa38158320 100644 --- a/components/net/lwip-1.4.1/src/core/ipv6/inet6.c +++ b/components/net/lwip-1.4.1/src/core/ipv6/inet6.c @@ -7,9 +7,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -18,21 +18,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -56,8 +56,8 @@ chksum(void *dataptr, u16_t len) { u16_t *sdataptr = dataptr; u32_t acc; - - + + for(acc = 0; len > 1; len -= 2) { acc += *sdataptr++; } @@ -87,7 +87,7 @@ inet_chksum_pseudo(struct pbuf *p, acc = 0; swapped = 0; - for(q = p; q != NULL; q = q->next) { + for(q = p; q != NULL; q = q->next) { acc += chksum(q->payload, q->len); while (acc >> 16) { acc = (acc & 0xffff) + (acc >> 16); @@ -101,7 +101,7 @@ inet_chksum_pseudo(struct pbuf *p, if (swapped) { acc = ((acc & 0xff) << 8) | ((acc & 0xff00) >> 8); } - + for(i = 0; i < 8; i++) { acc += ((u16_t *)src->addr)[i] & 0xffff; acc += ((u16_t *)dest->addr)[i] & 0xffff; @@ -142,20 +142,20 @@ inet_chksum_pbuf(struct pbuf *p) u32_t acc; struct pbuf *q; u8_t swapped; - + acc = 0; swapped = 0; for(q = p; q != NULL; q = q->next) { acc += chksum(q->payload, q->len); while (acc >> 16) { acc = (acc & 0xffff) + (acc >> 16); - } + } if (q->len % 2 != 0) { swapped = 1 - swapped; acc = (acc & 0xff << 8) | (acc & 0xff00 >> 8); } } - + if (swapped) { acc = ((acc & 0xff) << 8) | ((acc & 0xff00) >> 8); } diff --git a/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c b/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c index 2da6cea427..a74bc31375 100644 --- a/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c +++ b/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -42,7 +42,7 @@ ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2, (addr1->addr[1] & mask->addr[1]) == (addr2->addr[1] & mask->addr[1]) && (addr1->addr[2] & mask->addr[2]) == (addr2->addr[2] & mask->addr[2]) && (addr1->addr[3] & mask->addr[3]) == (addr2->addr[3] & mask->addr[3])); - + } u8_t diff --git a/components/net/lwip-1.4.1/src/core/mem.c b/components/net/lwip-1.4.1/src/core/mem.c index 1659a2c7a4..66016917a1 100644 --- a/components/net/lwip-1.4.1/src/core/mem.c +++ b/components/net/lwip-1.4.1/src/core/mem.c @@ -471,7 +471,7 @@ mem_trim(void *rmem, mem_size_t newsize) /* else { next struct mem is used but size between mem and mem2 is not big enough to create another struct mem - -> don't do anyhting. + -> don't do anyhting. -> the remaining space stays unused since it is too small } */ #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT diff --git a/components/net/lwip-1.4.1/src/core/memp.c b/components/net/lwip-1.4.1/src/core/memp.c index 9f680e244f..8f31a07edd 100644 --- a/components/net/lwip-1.4.1/src/core/memp.c +++ b/components/net/lwip-1.4.1/src/core/memp.c @@ -8,9 +8,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -19,21 +19,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -155,19 +155,19 @@ static const char *memp_desc[MEMP_MAX] = { * extern u8_t __attribute__((section(".onchip_mem"))) memp_memory_UDP_PCB_base[]; */ #define LWIP_MEMPOOL(name,num,size,desc) u8_t memp_memory_ ## name ## _base \ - [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))]; + [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))]; #include "lwip/memp_std.h" /** This array holds the base of each memory pool. */ -static u8_t *const memp_bases[] = { -#define LWIP_MEMPOOL(name,num,size,desc) memp_memory_ ## name ## _base, +static u8_t *const memp_bases[] = { +#define LWIP_MEMPOOL(name,num,size,desc) memp_memory_ ## name ## _base, #include "lwip/memp_std.h" }; #else /* MEMP_SEPARATE_POOLS */ /** This is the actual memory used by the pools (all pools in one big block). */ -static u8_t memp_memory[MEM_ALIGNMENT - 1 +static u8_t memp_memory[MEM_ALIGNMENT - 1 #define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) ) #include "lwip/memp_std.h" ]; @@ -331,7 +331,7 @@ memp_overflow_init(void) /** * Initialize this module. - * + * * Carves out memp_memory into linked lists for each pool-type. */ void @@ -394,7 +394,7 @@ memp_malloc_fn(memp_t type, const char* file, const int line) { struct memp *memp; SYS_ARCH_DECL_PROTECT(old_level); - + LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;); SYS_ARCH_PROTECT(old_level); @@ -403,7 +403,7 @@ memp_malloc_fn(memp_t type, const char* file, const int line) #endif /* MEMP_OVERFLOW_CHECK >= 2 */ memp = memp_tab[type]; - + if (memp != NULL) { memp_tab[type] = memp->next; #if MEMP_OVERFLOW_CHECK @@ -455,9 +455,9 @@ memp_free(memp_t type, void *mem) #endif /* MEMP_OVERFLOW_CHECK >= 2 */ #endif /* MEMP_OVERFLOW_CHECK */ - MEMP_STATS_DEC(used, type); - - memp->next = memp_tab[type]; + MEMP_STATS_DEC(used, type); + + memp->next = memp_tab[type]; memp_tab[type] = memp; #if MEMP_SANITY_CHECK diff --git a/components/net/lwip-1.4.1/src/core/netif.c b/components/net/lwip-1.4.1/src/core/netif.c index 9c3e32b33f..416c118c82 100644 --- a/components/net/lwip-1.4.1/src/core/netif.c +++ b/components/net/lwip-1.4.1/src/core/netif.c @@ -71,13 +71,13 @@ #define NETIF_STATUS_CALLBACK(n) do{ if (n->status_callback) { (n->status_callback)(n); }}while(0) #else #define NETIF_STATUS_CALLBACK(n) -#endif /* LWIP_NETIF_STATUS_CALLBACK */ +#endif /* LWIP_NETIF_STATUS_CALLBACK */ #if LWIP_NETIF_LINK_CALLBACK #define NETIF_LINK_CALLBACK(n) do{ if (n->link_callback) { (n->link_callback)(n); }}while(0) #else #define NETIF_LINK_CALLBACK(n) -#endif /* LWIP_NETIF_LINK_CALLBACK */ +#endif /* LWIP_NETIF_LINK_CALLBACK */ struct netif *netif_list; struct netif *netif_default; @@ -466,17 +466,17 @@ netif_set_default(struct netif *netif) /** * Bring an interface up, available for processing * traffic. - * + * * @note: Enabling DHCP on a down interface will make it come * up once configured. - * + * * @see dhcp_start() - */ + */ void netif_set_up(struct netif *netif) { if (!(netif->flags & NETIF_FLAG_UP)) { netif->flags |= NETIF_FLAG_UP; - + #if LWIP_SNMP snmp_get_sysuptime(&netif->ts); #endif /* LWIP_SNMP */ @@ -485,7 +485,7 @@ void netif_set_up(struct netif *netif) if (netif->flags & NETIF_FLAG_LINK_UP) { #if LWIP_ARP - /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ + /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ if (netif->flags & (NETIF_FLAG_ETHARP)) { etharp_gratuitous(netif); } @@ -511,9 +511,9 @@ void netif_set_up(struct netif *netif) * * @note: Enabling DHCP on a down interface will make it come * up once configured. - * + * * @see dhcp_start() - */ + */ void netif_set_down(struct netif *netif) { if (netif->flags & NETIF_FLAG_UP) { @@ -583,7 +583,7 @@ void netif_set_link_up(struct netif *netif ) if (netif->flags & NETIF_FLAG_UP) { #if LWIP_ARP - /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ + /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ if (netif->flags & NETIF_FLAG_ETHARP) { etharp_gratuitous(netif); } diff --git a/components/net/lwip-1.4.1/src/core/pbuf.c b/components/net/lwip-1.4.1/src/core/pbuf.c index 1e5e53b12a..0c3e91f1f1 100644 --- a/components/net/lwip-1.4.1/src/core/pbuf.c +++ b/components/net/lwip-1.4.1/src/core/pbuf.c @@ -12,13 +12,13 @@ * * Multiple packets may be queued, also using this singly linked list. * This is called a "packet queue". - * + * * So, a packet queue consists of one or more pbuf chains, each of * which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE * NOT SUPPORTED!!! Use helper structs to queue multiple packets. - * + * * The differences between a pbuf chain and a packet queue are very - * precise but subtle. + * precise but subtle. * * The last pbuf of a packet has a ->tot_len field that equals the * ->len field. It can be found by traversing the list. If the last @@ -518,7 +518,7 @@ pbuf_header(struct pbuf *p, s16_t header_size_increment) if ((header_size_increment == 0) || (p == NULL)) { return 0; } - + if (header_size_increment < 0){ increment_magnitude = -header_size_increment; /* Check that we aren't going to move off the end of the pbuf */ @@ -529,7 +529,7 @@ pbuf_header(struct pbuf *p, s16_t header_size_increment) /* Can't assert these as some callers speculatively call pbuf_header() to see if it's OK. Will return 1 below instead. */ /* Check that we've got the correct type of pbuf to work with */ - LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL", + LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL", p->type == PBUF_RAM || p->type == PBUF_POOL); /* Check that we aren't going to move off the beginning of the pbuf */ LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF", @@ -606,7 +606,7 @@ pbuf_header(struct pbuf *p, s16_t header_size_increment) * * Assuming existing chains a->b->c with the following reference * counts, calling pbuf_free(a) results in: - * + * * 1->2->3 becomes ...1->3 * 3->3->3 becomes 2->3->3 * 1->1->2 becomes ......1 @@ -734,10 +734,10 @@ pbuf_ref(struct pbuf *p) /** * Concatenate two pbufs (each may be a pbuf chain) and take over * the caller's reference of the tail pbuf. - * + * * @note The caller MAY NOT reference the tail pbuf afterwards. * Use pbuf_chain() for that purpose. - * + * * @see pbuf_chain() */ @@ -768,10 +768,10 @@ pbuf_cat(struct pbuf *h, struct pbuf *t) /** * Chain two pbufs (or pbuf chains) together. - * + * * The caller MUST call pbuf_free(t) once it has stopped * using it. Use pbuf_cat() instead if you no longer use t. - * + * * @param h head pbuf (chain) * @param t tail pbuf (chain) * @note The pbufs MUST belong to the same packet. @@ -909,7 +909,7 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from) * * @param buf the pbuf from which to copy data * @param dataptr the application supplied buffer - * @param len length of data to copy (dataptr must be big enough). No more + * @param len length of data to copy (dataptr must be big enough). No more * than buf->tot_len will be copied, irrespective of len * @param offset offset into the packet buffer from where to begin copying len bytes * @return the number of bytes copied, or 0 on failure diff --git a/components/net/lwip-1.4.1/src/core/raw.c b/components/net/lwip-1.4.1/src/core/raw.c index 7160c0fbd9..e9dcda3237 100644 --- a/components/net/lwip-1.4.1/src/core/raw.c +++ b/components/net/lwip-1.4.1/src/core/raw.c @@ -168,14 +168,14 @@ raw_connect(struct raw_pcb *pcb, ip_addr_t *ipaddr) /** * Set the callback function for received packets that match the - * raw PCB's protocol and binding. - * + * raw PCB's protocol and binding. + * * The callback function MUST either * - eat the packet by calling pbuf_free() and returning non-zero. The * packet will not be passed to other raw PCBs or other protocol layers. * - not free the packet, and return zero. The packet will be matched * against further PCBs and/or forwarded to another protocol layers. - * + * * @return non-zero if the packet was free()d, zero if the packet remains * available for others. */ @@ -206,9 +206,9 @@ raw_sendto(struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr) struct netif *netif; ip_addr_t *src_ip; struct pbuf *q; /* q will be sent down the stack */ - + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_sendto\n")); - + /* not enough space to add an IP header to first pbuf in given p chain? */ if (pbuf_header(p, IP_HLEN)) { /* allocate header in new pbuf */ diff --git a/components/net/lwip-1.4.1/src/core/stats.c b/components/net/lwip-1.4.1/src/core/stats.c index 8ea8249767..6aa59e0930 100644 --- a/components/net/lwip-1.4.1/src/core/stats.c +++ b/components/net/lwip-1.4.1/src/core/stats.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -72,18 +72,18 @@ void stats_display_proto(struct stats_proto *proto, const char *name) { LWIP_PLATFORM_DIAG(("\n%s\n\t", name)); - LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); - LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); - LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); - LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); - LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); - LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); - LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); - LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); - LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); - LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); - LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); - LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); + LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); + LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); + LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); + LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); + LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); + LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); + LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); + LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); + LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); + LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); + LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); + LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); } #if IGMP_STATS @@ -91,20 +91,20 @@ void stats_display_igmp(struct stats_igmp *igmp) { LWIP_PLATFORM_DIAG(("\nIGMP\n\t")); - LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", igmp->xmit)); - LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", igmp->recv)); - LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", igmp->drop)); - LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); - LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); - LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", igmp->memerr)); - LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", igmp->proterr)); - LWIP_PLATFORM_DIAG(("rx_v1: %"STAT_COUNTER_F"\n\t", igmp->rx_v1)); + LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", igmp->xmit)); + LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", igmp->recv)); + LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", igmp->drop)); + LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); + LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); + LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", igmp->memerr)); + LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", igmp->proterr)); + LWIP_PLATFORM_DIAG(("rx_v1: %"STAT_COUNTER_F"\n\t", igmp->rx_v1)); LWIP_PLATFORM_DIAG(("rx_group: %"STAT_COUNTER_F"\n", igmp->rx_group)); LWIP_PLATFORM_DIAG(("rx_general: %"STAT_COUNTER_F"\n", igmp->rx_general)); - LWIP_PLATFORM_DIAG(("rx_report: %"STAT_COUNTER_F"\n\t", igmp->rx_report)); - LWIP_PLATFORM_DIAG(("tx_join: %"STAT_COUNTER_F"\n\t", igmp->tx_join)); - LWIP_PLATFORM_DIAG(("tx_leave: %"STAT_COUNTER_F"\n\t", igmp->tx_leave)); - LWIP_PLATFORM_DIAG(("tx_report: %"STAT_COUNTER_F"\n\t", igmp->tx_report)); + LWIP_PLATFORM_DIAG(("rx_report: %"STAT_COUNTER_F"\n\t", igmp->rx_report)); + LWIP_PLATFORM_DIAG(("tx_join: %"STAT_COUNTER_F"\n\t", igmp->tx_join)); + LWIP_PLATFORM_DIAG(("tx_leave: %"STAT_COUNTER_F"\n\t", igmp->tx_leave)); + LWIP_PLATFORM_DIAG(("tx_report: %"STAT_COUNTER_F"\n\t", igmp->tx_report)); } #endif /* IGMP_STATS */ @@ -113,9 +113,9 @@ void stats_display_mem(struct stats_mem *mem, const char *name) { LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name)); - LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); - LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); - LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); + LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); + LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); + LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); LWIP_PLATFORM_DIAG(("err: %"U32_F"\n", (u32_t)mem->err)); } @@ -139,15 +139,15 @@ void stats_display_sys(struct stats_sys *sys) { LWIP_PLATFORM_DIAG(("\nSYS\n\t")); - LWIP_PLATFORM_DIAG(("sem.used: %"U32_F"\n\t", (u32_t)sys->sem.used)); - LWIP_PLATFORM_DIAG(("sem.max: %"U32_F"\n\t", (u32_t)sys->sem.max)); - LWIP_PLATFORM_DIAG(("sem.err: %"U32_F"\n\t", (u32_t)sys->sem.err)); - LWIP_PLATFORM_DIAG(("mutex.used: %"U32_F"\n\t", (u32_t)sys->mutex.used)); - LWIP_PLATFORM_DIAG(("mutex.max: %"U32_F"\n\t", (u32_t)sys->mutex.max)); - LWIP_PLATFORM_DIAG(("mutex.err: %"U32_F"\n\t", (u32_t)sys->mutex.err)); - LWIP_PLATFORM_DIAG(("mbox.used: %"U32_F"\n\t", (u32_t)sys->mbox.used)); - LWIP_PLATFORM_DIAG(("mbox.max: %"U32_F"\n\t", (u32_t)sys->mbox.max)); - LWIP_PLATFORM_DIAG(("mbox.err: %"U32_F"\n\t", (u32_t)sys->mbox.err)); + LWIP_PLATFORM_DIAG(("sem.used: %"U32_F"\n\t", (u32_t)sys->sem.used)); + LWIP_PLATFORM_DIAG(("sem.max: %"U32_F"\n\t", (u32_t)sys->sem.max)); + LWIP_PLATFORM_DIAG(("sem.err: %"U32_F"\n\t", (u32_t)sys->sem.err)); + LWIP_PLATFORM_DIAG(("mutex.used: %"U32_F"\n\t", (u32_t)sys->mutex.used)); + LWIP_PLATFORM_DIAG(("mutex.max: %"U32_F"\n\t", (u32_t)sys->mutex.max)); + LWIP_PLATFORM_DIAG(("mutex.err: %"U32_F"\n\t", (u32_t)sys->mutex.err)); + LWIP_PLATFORM_DIAG(("mbox.used: %"U32_F"\n\t", (u32_t)sys->mbox.used)); + LWIP_PLATFORM_DIAG(("mbox.max: %"U32_F"\n\t", (u32_t)sys->mbox.max)); + LWIP_PLATFORM_DIAG(("mbox.err: %"U32_F"\n\t", (u32_t)sys->mbox.err)); } #endif /* SYS_STATS */ diff --git a/components/net/lwip-1.4.1/src/core/tcp.c b/components/net/lwip-1.4.1/src/core/tcp.c index b710d2e2a4..105b68e74c 100644 --- a/components/net/lwip-1.4.1/src/core/tcp.c +++ b/components/net/lwip-1.4.1/src/core/tcp.c @@ -10,9 +10,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -21,21 +21,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -72,17 +72,17 @@ #endif /* LWIP_TCP_KEEPALIVE */ const char * const tcp_state_str[] = { - "CLOSED", - "LISTEN", - "SYN_SENT", - "SYN_RCVD", - "ESTABLISHED", - "FIN_WAIT_1", - "FIN_WAIT_2", - "CLOSE_WAIT", - "CLOSING", - "LAST_ACK", - "TIME_WAIT" + "CLOSED", + "LISTEN", + "SYN_SENT", + "SYN_RCVD", + "ESTABLISHED", + "FIN_WAIT_1", + "FIN_WAIT_2", + "CLOSE_WAIT", + "CLOSING", + "LAST_ACK", + "TIME_WAIT" }; /* last local TCP port */ @@ -118,7 +118,7 @@ struct tcp_pcb *tcp_tmp_pcb; u8_t tcp_active_pcbs_changed; -/** Timer counter to handle calling slow-timer from tcp_tmr() */ +/** Timer counter to handle calling slow-timer from tcp_tmr() */ static u8_t tcp_timer; static u8_t tcp_timer_ctr; static u16_t tcp_new_port(void); @@ -202,7 +202,7 @@ tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data) * however, it is in this state once allocated and as yet unused * and the user needs some way to free it should the need arise. * Calling tcp_close() with a pcb that has already been closed, (i.e. twice) - * or for a pcb that has been used and then entered the CLOSED state + * or for a pcb that has been used and then entered the CLOSED state * is erroneous, but this should never happen as the pcb has in those cases * been freed, and so any remaining handles are bogus. */ err = ERR_OK; @@ -357,7 +357,7 @@ void tcp_abandon(struct tcp_pcb *pcb, int reset) { u32_t seqno, ackno; -#if LWIP_CALLBACK_API +#if LWIP_CALLBACK_API tcp_err_fn errf; #endif /* LWIP_CALLBACK_API */ void *errf_arg; @@ -385,7 +385,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset) if (pcb->unsent != NULL) { tcp_segs_free(pcb->unsent); } -#if TCP_QUEUE_OOSEQ +#if TCP_QUEUE_OOSEQ if (pcb->ooseq != NULL) { tcp_segs_free(pcb->ooseq); } @@ -570,7 +570,7 @@ tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog) return (struct tcp_pcb *)lpcb; } -/** +/** * Update the state that tracks the available window space to advertise. * * Returns how much extra window would be advertised if we sent an @@ -649,7 +649,7 @@ tcp_new_port(void) u8_t i; u16_t n = 0; struct tcp_pcb *pcb; - + again: if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) { tcp_port = TCP_LOCAL_PORT_RANGE_START; @@ -757,7 +757,7 @@ tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port, pcb->ssthresh = pcb->mss * 10; #if LWIP_CALLBACK_API pcb->connected = connected; -#else /* LWIP_CALLBACK_API */ +#else /* LWIP_CALLBACK_API */ LWIP_UNUSED_ARG(connected); #endif /* LWIP_CALLBACK_API */ @@ -870,7 +870,7 @@ tcp_slowtmr_start: LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: cwnd %"U16_F " ssthresh %"U16_F"\n", pcb->cwnd, pcb->ssthresh)); - + /* The following needs to be called AFTER cwnd is set to one mss - STJ */ tcp_rexmit_rto(pcb); @@ -901,11 +901,11 @@ tcp_slowtmr_start: LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to %"U16_F".%"U16_F".%"U16_F".%"U16_F".\n", ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); - + ++pcb_remove; ++pcb_reset; } - else if((u32_t)(tcp_ticks - pcb->tmr) > + else if((u32_t)(tcp_ticks - pcb->tmr) > (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb)) / TCP_SLOW_INTERVAL) { @@ -998,7 +998,7 @@ tcp_slowtmr_start: } } - + /* Steps through all of the TIME-WAIT PCBs. */ prev = NULL; pcb = tcp_tw_pcbs; @@ -1010,7 +1010,7 @@ tcp_slowtmr_start: if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { ++pcb_remove; } - + /* If the PCB should be removed, do it. */ @@ -1172,7 +1172,7 @@ tcp_setprio(struct tcp_pcb *pcb, u8_t prio) * * @param seg the old tcp_seg * @return a copy of seg - */ + */ struct tcp_seg * tcp_seg_copy(struct tcp_seg *seg) { @@ -1182,7 +1182,7 @@ tcp_seg_copy(struct tcp_seg *seg) if (cseg == NULL) { return NULL; } - SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); + SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); pbuf_ref(cseg->p); return cseg; } @@ -1222,7 +1222,7 @@ tcp_kill_prio(u8_t prio) mprio = TCP_PRIO_MAX; - + /* We kill the oldest active connection that has lower priority than prio. */ inactivity = 0; inactive = NULL; @@ -1279,7 +1279,7 @@ tcp_alloc(u8_t prio) { struct tcp_pcb *pcb; u32_t iss; - + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); if (pcb == NULL) { /* Try killing oldest connection in TIME-WAIT. */ @@ -1324,7 +1324,7 @@ tcp_alloc(u8_t prio) pcb->snd_wl2 = iss; pcb->snd_nxt = iss; pcb->lastack = iss; - pcb->snd_lbb = iss; + pcb->snd_lbb = iss; pcb->tmr = tcp_ticks; pcb->last_timer = tcp_timer_ctr; @@ -1332,11 +1332,11 @@ tcp_alloc(u8_t prio) #if LWIP_CALLBACK_API pcb->recv = tcp_recv_null; -#endif /* LWIP_CALLBACK_API */ - +#endif /* LWIP_CALLBACK_API */ + /* Init KEEPALIVE timer */ pcb->keep_idle = TCP_KEEPIDLE_DEFAULT; - + #if LWIP_TCP_KEEPALIVE pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT; pcb->keep_cnt = TCP_KEEPCNT_DEFAULT; @@ -1371,7 +1371,7 @@ tcp_new(void) * * @param pcb tcp_pcb to set the callback argument * @param arg void pointer argument to pass to callback functions - */ + */ void tcp_arg(struct tcp_pcb *pcb, void *arg) { @@ -1387,7 +1387,7 @@ tcp_arg(struct tcp_pcb *pcb, void *arg) * * @param pcb tcp_pcb to set the recv callback * @param recv callback function to call for this pcb when data is received - */ + */ void tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv) { @@ -1401,7 +1401,7 @@ tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv) * * @param pcb tcp_pcb to set the sent callback * @param sent callback function to call for this pcb when data is successfully sent - */ + */ void tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) { @@ -1416,7 +1416,7 @@ tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) * @param pcb tcp_pcb to set the err callback * @param err callback function to call for this pcb when a fatal error * has occured on the connection - */ + */ void tcp_err(struct tcp_pcb *pcb, tcp_err_fn err) { @@ -1431,7 +1431,7 @@ tcp_err(struct tcp_pcb *pcb, tcp_err_fn err) * @param pcb tcp_pcb to set the accept callback * @param accept callback function to call for this pcb when LISTENing * connection has been connected to another host - */ + */ void tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) { @@ -1447,16 +1447,16 @@ tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) * from TCP. The interval is specified in terms of the TCP coarse * timer interval, which is called twice a second. * - */ + */ void tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval) { LWIP_ASSERT("invalid socket state for poll", pcb->state != LISTEN); #if LWIP_CALLBACK_API pcb->poll = poll; -#else /* LWIP_CALLBACK_API */ +#else /* LWIP_CALLBACK_API */ LWIP_UNUSED_ARG(poll); -#endif /* LWIP_CALLBACK_API */ +#endif /* LWIP_CALLBACK_API */ pcb->pollinterval = interval; } @@ -1540,7 +1540,7 @@ tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb) TCP_RMV(pcblist, pcb); tcp_pcb_purge(pcb); - + /* if there is an outstanding delayed ACKs, send it */ if (pcb->state != TIME_WAIT && pcb->state != LISTEN && @@ -1571,7 +1571,7 @@ u32_t tcp_next_iss(void) { static u32_t iss = 6510; - + iss += tcp_ticks; /* XXX */ return iss; } @@ -1703,21 +1703,21 @@ tcp_debug_print_pcbs(void) pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); tcp_debug_print_state(pcb->state); - } + } LWIP_DEBUGF(TCP_DEBUG, ("Listen PCB states:\n")); for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) { LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F", foreign port %"U16_F" snd_nxt %"U32_F" rcv_nxt %"U32_F" ", pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); tcp_debug_print_state(pcb->state); - } + } LWIP_DEBUGF(TCP_DEBUG, ("TIME-WAIT PCB states:\n")); for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F", foreign port %"U16_F" snd_nxt %"U32_F" rcv_nxt %"U32_F" ", pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); tcp_debug_print_state(pcb->state); - } + } } /** diff --git a/components/net/lwip-1.4.1/src/core/tcp_in.c b/components/net/lwip-1.4.1/src/core/tcp_in.c index 4ec971ac0f..051869ff96 100644 --- a/components/net/lwip-1.4.1/src/core/tcp_in.c +++ b/components/net/lwip-1.4.1/src/core/tcp_in.c @@ -6,7 +6,7 @@ * * These functions are generally called in the order (ip_input() ->) * tcp_input() -> * tcp_process() -> tcp_receive() (-> application). - * + * */ /* @@ -166,7 +166,7 @@ tcp_input(struct pbuf *p, struct netif *inp) for an active connection. */ prev = NULL; - + for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED); LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT); @@ -253,7 +253,7 @@ tcp_input(struct pbuf *p, struct netif *inp) /* put this listening pcb at the head of the listening list */ tcp_listen_pcbs.listen_pcbs = lpcb; } - + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n")); tcp_listen_input(lpcb); pbuf_free(p); @@ -588,7 +588,7 @@ tcp_process(struct tcp_pcb *pcb) acceptable = 1; } } else { - if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt+pcb->rcv_wnd)) { acceptable = 1; } @@ -609,12 +609,12 @@ tcp_process(struct tcp_pcb *pcb) } } - if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) { + if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) { /* Cope with new connection attempt after remote end crashed */ tcp_ack_now(pcb); return ERR_OK; } - + if ((pcb->flags & TF_RXCLOSED) == 0) { /* Update the PCB (in)activity timer unless rx is closed (see tcp_shutdown) */ pcb->tmr = tcp_ticks; @@ -892,7 +892,7 @@ tcp_receive(struct tcp_pcb *pcb) #if TCP_WND_DEBUG } else { if (pcb->snd_wnd != tcphdr->wnd) { - LWIP_DEBUGF(TCP_WND_DEBUG, + LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: no window update lastack %"U32_F" ackno %" U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n", pcb->lastack, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2)); @@ -902,17 +902,17 @@ tcp_receive(struct tcp_pcb *pcb) /* (From Stevens TCP/IP Illustrated Vol II, p970.) Its only a * duplicate ack if: - * 1) It doesn't ACK new data - * 2) length of received packet is zero (i.e. no payload) - * 3) the advertised window hasn't changed + * 1) It doesn't ACK new data + * 2) length of received packet is zero (i.e. no payload) + * 3) the advertised window hasn't changed * 4) There is outstanding unacknowledged data (retransmission timer running) * 5) The ACK is == biggest ACK sequence number so far seen (snd_una) - * - * If it passes all five, should process as a dupack: - * a) dupacks < 3: do nothing - * b) dupacks == 3: fast retransmit - * c) dupacks > 3: increase cwnd - * + * + * If it passes all five, should process as a dupack: + * a) dupacks < 3: do nothing + * b) dupacks == 3: fast retransmit + * c) dupacks > 3: increase cwnd + * * If it only passes 1-3, should reset dupack counter (and add to * stats, which we don't do in lwIP) * @@ -1053,7 +1053,7 @@ tcp_receive(struct tcp_pcb *pcb) ->unsent list after a retransmission, so these segments may in fact have been sent once. */ while (pcb->unsent != NULL && - TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) + + TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) + TCP_TCPLEN(pcb->unsent), pcb->snd_nxt)) { LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unsent\n", ntohl(pcb->unsent->tcphdr->seqno), ntohl(pcb->unsent->tcphdr->seqno) + @@ -1065,7 +1065,7 @@ tcp_receive(struct tcp_pcb *pcb) if (pcb->unsent == NULL) { pcb->unsent_oversize = 0; } -#endif /* TCP_OVERSIZE */ +#endif /* TCP_OVERSIZE */ LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen)); LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p))); /* Prevent ACK for FIN to generate a sent event */ @@ -1211,7 +1211,7 @@ tcp_receive(struct tcp_pcb *pcb) /* The sequence number must be within the window (above rcv_nxt and below rcv_nxt + rcv_wnd) in order to be further processed. */ - if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd - 1)){ if (pcb->rcv_nxt == seqno) { /* The incoming segment is the next in sequence. We check if @@ -1220,12 +1220,12 @@ tcp_receive(struct tcp_pcb *pcb) tcplen = TCP_TCPLEN(&inseg); if (tcplen > pcb->rcv_wnd) { - LWIP_DEBUGF(TCP_INPUT_DEBUG, + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: other end overran receive window" "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { - /* Must remove the FIN from the header as we're trimming + /* Must remove the FIN from the header as we're trimming * that byte of sequence-space from the packet */ TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) &~ TCP_FIN); } @@ -1245,7 +1245,7 @@ tcp_receive(struct tcp_pcb *pcb) - inseq overlaps with ooseq */ if (pcb->ooseq != NULL) { if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { - LWIP_DEBUGF(TCP_INPUT_DEBUG, + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received in-order FIN, binning ooseq queue\n")); /* Received in-order FIN means anything that was received * out of order must now have been received in-order, so @@ -1352,7 +1352,7 @@ tcp_receive(struct tcp_pcb *pcb) recv_flags |= TF_GOT_FIN; if (pcb->state == ESTABLISHED) { /* force passive close or we can move to active close */ pcb->state = CLOSE_WAIT; - } + } } pcb->ooseq = cseg->next; @@ -1465,12 +1465,12 @@ tcp_receive(struct tcp_pcb *pcb) } /* check if the remote side overruns our receive window */ if ((u32_t)tcplen + seqno > pcb->rcv_nxt + (u32_t)pcb->rcv_wnd) { - LWIP_DEBUGF(TCP_INPUT_DEBUG, + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: other end overran receive window" "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); if (TCPH_FLAGS(next->next->tcphdr) & TCP_FIN) { - /* Must remove the FIN from the header as we're trimming + /* Must remove the FIN from the header as we're trimming * that byte of sequence-space from the packet */ TCPH_FLAGS_SET(next->next->tcphdr, TCPH_FLAGS(next->next->tcphdr) &~ TCP_FIN); } @@ -1531,7 +1531,7 @@ tcp_receive(struct tcp_pcb *pcb) } /** - * Parses the options contained in the incoming segment. + * Parses the options contained in the incoming segment. * * Called from tcp_listen_input() and tcp_process(). * Currently, only the MSS option is supported! @@ -1588,7 +1588,7 @@ tcp_parseopt(struct tcp_pcb *pcb) return; } /* TCP timestamp option with valid length */ - tsval = (opts[c+2]) | (opts[c+3] << 8) | + tsval = (opts[c+2]) | (opts[c+3] << 8) | (opts[c+4] << 16) | (opts[c+5] << 24); if (flags & TCP_SYN) { pcb->ts_recent = ntohl(tsval); diff --git a/components/net/lwip-1.4.1/src/core/tcp_out.c b/components/net/lwip-1.4.1/src/core/tcp_out.c index 1db3fae03f..da9d72d531 100644 --- a/components/net/lwip-1.4.1/src/core/tcp_out.c +++ b/components/net/lwip-1.4.1/src/core/tcp_out.c @@ -197,7 +197,7 @@ tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, /* wnd and chksum are set in tcp_output */ seg->tcphdr->urgp = 0; return seg; -} +} /** * Allocate a PBUF_RAM pbuf, perhaps with extra space at the end. @@ -212,7 +212,7 @@ tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, * @param pcb The TCP connection that willo enqueue the pbuf. * @param apiflags API flags given to tcp_write. * @param first_seg true when this pbuf will be used in the first enqueued segment. - * @param + * @param */ #if TCP_OVERSIZE static struct pbuf * @@ -379,7 +379,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags) LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n", (void *)pcb, arg, len, (u16_t)apiflags)); - LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)", + LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)", arg != NULL, return ERR_ARG;); err = tcp_write_checks(pcb, len); @@ -857,7 +857,7 @@ tcp_send_empty_ack(struct tcp_pcb *pcb) return ERR_BUF; } tcphdr = (struct tcp_hdr *)p->payload; - LWIP_DEBUGF(TCP_OUTPUT_DEBUG, + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt)); /* remove ACK flags from the PCB, as we send an empty ACK now */ pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW); @@ -869,7 +869,7 @@ tcp_send_empty_ack(struct tcp_pcb *pcb) if (pcb->flags & TF_TIMESTAMP) { tcp_build_timestamp_option(pcb, (u32_t *)(tcphdr + 1)); } -#endif +#endif #if CHECKSUM_GEN_TCP tcphdr->chksum = inet_chksum_pseudo(p, &(pcb->local_ip), &(pcb->remote_ip), @@ -950,7 +950,7 @@ tcp_output(struct tcp_pcb *pcb) ", seg == NULL, ack %"U32_F"\n", pcb->snd_wnd, pcb->cwnd, wnd, pcb->lastack)); } else { - LWIP_DEBUGF(TCP_CWND_DEBUG, + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_output: snd_wnd %"U16_F", cwnd %"U16_F", wnd %"U32_F ", effwnd %"U32_F", seq %"U32_F", ack %"U32_F"\n", pcb->snd_wnd, pcb->cwnd, wnd, @@ -961,7 +961,7 @@ tcp_output(struct tcp_pcb *pcb) /* data available and window allows it to be sent? */ while (seg != NULL && ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) { - LWIP_ASSERT("RST not expected here!", + LWIP_ASSERT("RST not expected here!", (TCPH_FLAGS(seg->tcphdr) & TCP_RST) == 0); /* Stop sending if the nagle algorithm would prevent it * Don't stop: @@ -1086,7 +1086,7 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb) } #endif - /* Set retransmission timer running if it is not currently enabled + /* Set retransmission timer running if it is not currently enabled This must be set before checking the route. */ if (pcb->rtime == -1) { pcb->rtime = 0; @@ -1251,7 +1251,7 @@ tcp_rexmit_rto(struct tcp_pcb *pcb) #if TCP_OVERSIZE && TCP_OVERSIZE_DBGCHECK /* if last unsent changed, we need to update unsent_oversize */ if (pcb->unsent == NULL) { - pcb->unsent_oversize = seg->oversize_left; + pcb->unsent_oversize = seg->oversize_left; } #endif /* TCP_OVERSIZE && TCP_OVERSIZE_DBGCHECK*/ /* unsent queue is the concatenated queue (of unacked, unsent) */ @@ -1323,12 +1323,12 @@ tcp_rexmit(struct tcp_pcb *pcb) * * @param pcb the tcp_pcb for which to retransmit the first unacked segment */ -void +void tcp_rexmit_fast(struct tcp_pcb *pcb) { if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) { /* This is fast retransmit. Retransmit the first unacked segment. */ - LWIP_DEBUGF(TCP_FR_DEBUG, + LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: dupacks %"U16_F" (%"U32_F "), fast retransmit %"U32_F"\n", (u16_t)pcb->dupacks, pcb->lastack, @@ -1342,19 +1342,19 @@ tcp_rexmit_fast(struct tcp_pcb *pcb) } else { pcb->ssthresh = pcb->cwnd / 2; } - + /* The minimum value for ssthresh should be 2 MSS */ if (pcb->ssthresh < 2*pcb->mss) { - LWIP_DEBUGF(TCP_FR_DEBUG, + LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: The minimum value for ssthresh %"U16_F " should be min 2 mss %"U16_F"...\n", pcb->ssthresh, 2*pcb->mss)); pcb->ssthresh = 2*pcb->mss; } - + pcb->cwnd = pcb->ssthresh + 3 * pcb->mss; pcb->flags |= TF_INFR; - } + } } @@ -1376,12 +1376,12 @@ tcp_keepalive(struct tcp_pcb *pcb) ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); - LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", tcp_ticks, pcb->tmr, pcb->keep_cnt_sent)); - + p = tcp_output_alloc_header(pcb, 0, 0, htonl(pcb->snd_nxt - 1)); if(p == NULL) { - LWIP_DEBUGF(TCP_DEBUG, + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: could not allocate memory for pbuf\n")); return; } @@ -1425,15 +1425,15 @@ tcp_zero_window_probe(struct tcp_pcb *pcb) u16_t len; u8_t is_fin; - LWIP_DEBUGF(TCP_DEBUG, + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: sending ZERO WINDOW probe to %" U16_F".%"U16_F".%"U16_F".%"U16_F"\n", ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); - LWIP_DEBUGF(TCP_DEBUG, + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: tcp_ticks %"U32_F - " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", tcp_ticks, pcb->tmr, pcb->keep_cnt_sent)); seg = pcb->unacked; diff --git a/components/net/lwip-1.4.1/src/core/udp.c b/components/net/lwip-1.4.1/src/core/udp.c index 32c7d38403..ae91c8622d 100644 --- a/components/net/lwip-1.4.1/src/core/udp.c +++ b/components/net/lwip-1.4.1/src/core/udp.c @@ -100,7 +100,7 @@ udp_new_port(void) { u16_t n = 0; struct udp_pcb *pcb; - + again: if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) { udp_port = UDP_LOCAL_PORT_RANGE_START; @@ -207,7 +207,7 @@ udp_input(struct pbuf *p, struct netif *inp) /* all packets for DHCP_CLIENT_PORT not coming from DHCP_SERVER_PORT are dropped! */ if (src == DHCP_SERVER_PORT) { if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) { - /* accept the packe if + /* accept the packe if (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY! - inp->dhcp->pcb->remote == ANY or iphdr->src */ if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) || @@ -253,9 +253,9 @@ udp_input(struct pbuf *p, struct netif *inp) (broadcast && (ip_addr_isany(&pcb->local_ip) || ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) { -#endif /* IP_SOF_BROADCAST_RECV */ +#endif /* IP_SOF_BROADCAST_RECV */ local_match = 1; - if ((uncon_pcb == NULL) && + if ((uncon_pcb == NULL) && ((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) { /* the first unconnected matching PCB */ uncon_pcb = pcb; @@ -482,7 +482,7 @@ udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, * * If the PCB already has a remote address association, it will * be restored after the data is sent. - * + * * @return lwIP error code (@see udp_send for possible error codes) * * @see udp_disconnect() udp_send() @@ -613,7 +613,7 @@ udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip, udphdr->src = htons(pcb->local_port); udphdr->dest = htons(dst_port); /* in UDP, 0 checksum means 'no checksum' */ - udphdr->chksum = 0x0000; + udphdr->chksum = 0x0000; /* Multicast Loop? */ #if LWIP_IGMP diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h index e62b72e8cd..d00aa2ef3e 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h @@ -40,7 +40,7 @@ * Please coordinate changes and requests with Dominik Spies * */ - + #ifndef __LWIP_AUTOIP_H__ #define __LWIP_AUTOIP_H__ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h index d47a7d8a2e..15641463ae 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h index 8aabac2481..57038f4fca 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h @@ -2,29 +2,29 @@ * Copyright (c) 2002 CITEL Technologies Ltd. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is a contribution to the lwIP TCP/IP stack. * The Swedish Institute of Computer Science and Adam Dunkels @@ -64,8 +64,8 @@ extern "C" { * these should really be linked from the interface, but * if we keep them separate we will not affect the lwip original code * too much - * - * There will be a group for the all systems group address but this + * + * There will be a group for the all systems group address but this * will not run the state machine as it is used to kick off reports * from all the other groups */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h index 7bff49b59e..213d47a6be 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h index 79a2d90f2f..7c5d17e309 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h index 00c83a0a12..d88ab8a107 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -136,7 +136,7 @@ struct ip_hdr { PACK_STRUCT_FIELD(u16_t _chksum); /* source and destination IP addresses */ PACK_STRUCT_FIELD(ip_addr_p_t src); - PACK_STRUCT_FIELD(ip_addr_p_t dest); + PACK_STRUCT_FIELD(ip_addr_p_t dest); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h index 77b5eb1eef..d6f1b77d37 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Jani Monoses * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h index 87e9ffd964..4397d2e87a 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h index de1a0b6361..32a5261bde 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h index a01cfc65b3..73a1c5cc9e 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -84,7 +84,7 @@ extern "C" { struct ip_hdr { #if BYTE_ORDER == LITTLE_ENDIAN u8_t tclass1:4, v:4; - u8_t flow1:4, tclass2:4; + u8_t flow1:4, tclass2:4; #else u8_t v:4, tclass1:4; u8_t tclass2:8, flow1:4; diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h index b2d8ae566d..f5b606a860 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/api.h b/components/net/lwip-1.4.1/src/include/lwip/api.h index 7a9fa9366c..63d99bf292 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/api.h +++ b/components/net/lwip-1.4.1/src/include/lwip/api.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/api_msg.h b/components/net/lwip-1.4.1/src/include/lwip/api_msg.h index f9e1c7d295..3f063e2a64 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/api_msg.h +++ b/components/net/lwip-1.4.1/src/include/lwip/api_msg.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/arch.h b/components/net/lwip-1.4.1/src/include/lwip/arch.h index 4d6df773fc..2c3eb47384 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/arch.h +++ b/components/net/lwip-1.4.1/src/include/lwip/arch.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -71,7 +71,7 @@ extern "C" { #ifndef LWIP_UNUSED_ARG #define LWIP_UNUSED_ARG(x) (void)x -#endif /* LWIP_UNUSED_ARG */ +#endif /* LWIP_UNUSED_ARG */ #ifdef LWIP_PROVIDE_ERRNO diff --git a/components/net/lwip-1.4.1/src/include/lwip/debug.h b/components/net/lwip-1.4.1/src/include/lwip/debug.h index 0fe041396f..aa96d1aebb 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/debug.h +++ b/components/net/lwip-1.4.1/src/include/lwip/debug.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -66,7 +66,7 @@ #define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \ LWIP_PLATFORM_ASSERT(message); } while(0) #else /* LWIP_NOASSERT */ -#define LWIP_ASSERT(message, assertion) +#define LWIP_ASSERT(message, assertion) #endif /* LWIP_NOASSERT */ /** if "expression" isn't true, then print "message" and execute "handler" expression */ @@ -92,7 +92,7 @@ } while(0) #else /* LWIP_DEBUG */ -#define LWIP_DEBUGF(debug, message) +#define LWIP_DEBUGF(debug, message) #endif /* LWIP_DEBUG */ #endif /* __LWIP_DEBUG_H__ */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/def.h b/components/net/lwip-1.4.1/src/include/lwip/def.h index 73a1b560b3..e695ed7ccd 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/def.h +++ b/components/net/lwip-1.4.1/src/include/lwip/def.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -52,7 +52,7 @@ extern "C" { #define LWIP_MAKE_U16(a, b) ((a << 8) | b) #else #define LWIP_MAKE_U16(a, b) ((b << 8) | a) -#endif +#endif #ifndef LWIP_PLATFORM_BYTESWAP #define LWIP_PLATFORM_BYTESWAP 0 diff --git a/components/net/lwip-1.4.1/src/include/lwip/dhcp.h b/components/net/lwip-1.4.1/src/include/lwip/dhcp.h index 32d93381d1..ca1c1de3db 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/dhcp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/dhcp.h @@ -16,11 +16,11 @@ extern "C" { #endif /** period (in seconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_SECS 60 +#define DHCP_COARSE_TIMER_SECS 60 /** period (in milliseconds) of the application calling dhcp_coarse_tmr() */ #define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) /** period (in milliseconds) of the application calling dhcp_fine_tmr() */ -#define DHCP_FINE_TIMER_MSECS 500 +#define DHCP_FINE_TIMER_MSECS 500 #define DHCP_CHADDR_LEN 16U #define DHCP_SNAME_LEN 64U @@ -28,9 +28,9 @@ extern "C" { struct dhcp { - /** transaction identifier of last sent request */ + /** transaction identifier of last sent request */ u32_t xid; - /** our connection to the DHCP server */ + /** our connection to the DHCP server */ struct udp_pcb *pcb; /** incoming msg */ struct dhcp_msg *msg_in; @@ -53,7 +53,7 @@ struct dhcp ip_addr_t offered_ip_addr; ip_addr_t offered_sn_mask; ip_addr_t offered_gw_addr; - + u32_t offered_t0_lease; /* lease period (in seconds) */ u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ u32_t offered_t2_rebind; /* recommended rebind time (usually 66% of lease period) */ @@ -131,7 +131,7 @@ void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr); void dhcp_coarse_tmr(void); /** to be called every half second */ void dhcp_fine_tmr(void); - + /** DHCP message item offsets and length */ #define DHCP_OP_OFS 0 #define DHCP_HTYPE_OFS 1 @@ -152,7 +152,7 @@ void dhcp_fine_tmr(void); #define DHCP_COOKIE_OFS DHCP_MSG_LEN #define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4) -#define DHCP_CLIENT_PORT 68 +#define DHCP_CLIENT_PORT 68 #define DHCP_SERVER_PORT 67 /** DHCP client states */ @@ -173,7 +173,7 @@ void dhcp_fine_tmr(void); /** AUTOIP cooperatation flags */ #define DHCP_AUTOIP_COOP_STATE_OFF 0 #define DHCP_AUTOIP_COOP_STATE_ON 1 - + #define DHCP_BOOTREQUEST 1 #define DHCP_BOOTREPLY 2 @@ -198,7 +198,7 @@ void dhcp_fine_tmr(void); #define DHCP_OPTION_PAD 0 #define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ #define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_DNS_SERVER 6 +#define DHCP_OPTION_DNS_SERVER 6 #define DHCP_OPTION_HOSTNAME 12 #define DHCP_OPTION_IP_TTL 23 #define DHCP_OPTION_MTU 26 diff --git a/components/net/lwip-1.4.1/src/include/lwip/dns.h b/components/net/lwip-1.4.1/src/include/lwip/dns.h index 6c7d9b0739..5d7945a739 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/dns.h +++ b/components/net/lwip-1.4.1/src/include/lwip/dns.h @@ -1,7 +1,7 @@ /** * lwip DNS resolver header file. - * Author: Jim Pettinato + * Author: Jim Pettinato * April 2007 * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. diff --git a/components/net/lwip-1.4.1/src/include/lwip/err.h b/components/net/lwip-1.4.1/src/include/lwip/err.h index ac907729fc..1a5af39463 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/err.h +++ b/components/net/lwip-1.4.1/src/include/lwip/err.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/init.h b/components/net/lwip-1.4.1/src/include/lwip/init.h index 3238534542..e5833e55c3 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/init.h +++ b/components/net/lwip-1.4.1/src/include/lwip/init.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/mem.h b/components/net/lwip-1.4.1/src/include/lwip/mem.h index 5bb906b63f..fec03bc8ab 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/mem.h +++ b/components/net/lwip-1.4.1/src/include/lwip/mem.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/memp.h b/components/net/lwip-1.4.1/src/include/lwip/memp.h index f0d0739943..efad238a93 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/memp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/memp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/memp_std.h b/components/net/lwip-1.4.1/src/include/lwip/memp_std.h index 461ed1acf8..7304e2c62e 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/memp_std.h +++ b/components/net/lwip-1.4.1/src/include/lwip/memp_std.h @@ -15,7 +15,7 @@ #define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size) #define LWIP_MALLOC_MEMPOOL_START #define LWIP_MALLOC_MEMPOOL_END -#endif /* LWIP_MALLOC_MEMPOOL */ +#endif /* LWIP_MALLOC_MEMPOOL */ #ifndef LWIP_PBUF_MEMPOOL /* This treats "pbuf pools" just like any other pool. diff --git a/components/net/lwip-1.4.1/src/include/lwip/netbuf.h b/components/net/lwip-1.4.1/src/include/lwip/netbuf.h index 7d247d71b6..ddee0273e0 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netbuf.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netbuf.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/netdb.h b/components/net/lwip-1.4.1/src/include/lwip/netdb.h index 7587e2f2d1..80040bbfcd 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netdb.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netdb.h @@ -1,5 +1,5 @@ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -8,21 +8,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/netif.h b/components/net/lwip-1.4.1/src/include/lwip/netif.h index f7e4937453..bd93112f8f 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netif.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netif.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -290,7 +290,7 @@ void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn rem void netif_set_link_up(struct netif *netif); void netif_set_link_down(struct netif *netif); -/** Ask if a link is up */ +/** Ask if a link is up */ #define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) #if LWIP_NETIF_LINK_CALLBACK diff --git a/components/net/lwip-1.4.1/src/include/lwip/netifapi.h b/components/net/lwip-1.4.1/src/include/lwip/netifapi.h index 33318efaf6..6ac16f3b5a 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netifapi.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netifapi.h @@ -1,5 +1,5 @@ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -8,23 +8,23 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * */ - + #ifndef __LWIP_NETIFAPI_H__ #define __LWIP_NETIFAPI_H__ diff --git a/components/net/lwip-1.4.1/src/include/lwip/opt.h b/components/net/lwip-1.4.1/src/include/lwip/opt.h index b8ebec86b1..76490a1d28 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/opt.h +++ b/components/net/lwip-1.4.1/src/include/lwip/opt.h @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -60,7 +60,7 @@ #define SYS_LIGHTWEIGHT_PROT 0 #endif -/** +/** * NO_SYS==1: Provides VERY minimal functionality. Otherwise, * use lwIP facilities. */ @@ -183,8 +183,8 @@ /** * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * inlude path somewhere. + * by lwIP. If you set this to 1, you must have lwippools.h in your + * inlude path somewhere. */ #ifndef MEMP_USE_CUSTOM_POOLS #define MEMP_USE_CUSTOM_POOLS 0 @@ -334,7 +334,7 @@ /** * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. + * for callback/timeout API communication. * (only needed if you use tcpip.c) */ #ifndef MEMP_NUM_TCPIP_MSG_API @@ -343,7 +343,7 @@ /** * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. + * for incoming packets. * (only needed if you use tcpip.c) */ #ifndef MEMP_NUM_TCPIP_MSG_INPKT @@ -408,7 +408,7 @@ #endif /** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. + * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #ifndef PBUF_POOL_SIZE #define PBUF_POOL_SIZE 16 @@ -751,7 +751,7 @@ #endif /** - * SNMP_PRIVATE_MIB: + * SNMP_PRIVATE_MIB: * When using a private MIB, you have to create a file 'private_mib.h' that contains * a 'struct mib_array_node mib_private' which contains your MIB. */ @@ -799,7 +799,7 @@ ---------------------------------- */ /** - * LWIP_IGMP==1: Turn on IGMP module. + * LWIP_IGMP==1: Turn on IGMP module. */ #ifndef LWIP_IGMP #define LWIP_IGMP 0 @@ -916,12 +916,12 @@ #endif /** - * TCP_WND: The size of a TCP window. This must be at least + * TCP_WND: The size of a TCP window. This must be at least * (2 * TCP_MSS) for things to work well */ #ifndef TCP_WND #define TCP_WND (4 * TCP_MSS) -#endif +#endif /** * TCP_MAXRTX: Maximum number of retransmissions of data segments. @@ -1790,14 +1790,14 @@ #ifndef CHECKSUM_GEN_IP #define CHECKSUM_GEN_IP 1 #endif - + /** * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. */ #ifndef CHECKSUM_GEN_UDP #define CHECKSUM_GEN_UDP 1 #endif - + /** * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. */ @@ -1811,14 +1811,14 @@ #ifndef CHECKSUM_GEN_ICMP #define CHECKSUM_GEN_ICMP 1 #endif - + /** * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. */ #ifndef CHECKSUM_CHECK_IP #define CHECKSUM_CHECK_IP 1 #endif - + /** * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/pbuf.h b/components/net/lwip-1.4.1/src/include/lwip/pbuf.h index 99d5443bf3..7602869740 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/pbuf.h +++ b/components/net/lwip-1.4.1/src/include/lwip/pbuf.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -149,11 +149,11 @@ struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p, void *payload_mem, u16_t payload_mem_len); #endif /* LWIP_SUPPORT_CUSTOM_PBUF */ -void pbuf_realloc(struct pbuf *p, u16_t size); +void pbuf_realloc(struct pbuf *p, u16_t size); u8_t pbuf_header(struct pbuf *p, s16_t header_size); void pbuf_ref(struct pbuf *p); u8_t pbuf_free(struct pbuf *p); -u8_t pbuf_clen(struct pbuf *p); +u8_t pbuf_clen(struct pbuf *p); void pbuf_cat(struct pbuf *head, struct pbuf *tail); void pbuf_chain(struct pbuf *head, struct pbuf *tail); struct pbuf *pbuf_dechain(struct pbuf *p); diff --git a/components/net/lwip-1.4.1/src/include/lwip/sio.h b/components/net/lwip-1.4.1/src/include/lwip/sio.h index 28ae2f225d..dca34794c6 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/sio.h +++ b/components/net/lwip-1.4.1/src/include/lwip/sio.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,17 +11,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. @@ -53,7 +53,7 @@ typedef void * sio_fd_t; #ifndef sio_open /** * Opens a serial device for communication. - * + * * @param devnum device number * @return handle to serial device if successful, NULL otherwise */ @@ -63,10 +63,10 @@ sio_fd_t sio_open(u8_t devnum); #ifndef sio_send /** * Sends a single character to the serial device. - * + * * @param c character to send * @param fd serial device handle - * + * * @note This function will block until the character can be sent. */ void sio_send(u8_t c, sio_fd_t fd); @@ -75,9 +75,9 @@ void sio_send(u8_t c, sio_fd_t fd); #ifndef sio_recv /** * Receives a single character from the serial device. - * + * * @param fd serial device handle - * + * * @note This function will block until a character is received. */ u8_t sio_recv(sio_fd_t fd); @@ -86,12 +86,12 @@ u8_t sio_recv(sio_fd_t fd); #ifndef sio_read /** * Reads from the serial device. - * + * * @param fd serial device handle * @param data pointer to data buffer for receiving * @param len maximum length (in bytes) of data to receive * @return number of bytes actually received - may be 0 if aborted by sio_read_abort - * + * * @note This function will block until data can be received. The blocking * can be cancelled by calling sio_read_abort(). */ @@ -102,7 +102,7 @@ u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len); /** * Tries to read from the serial device. Same as sio_read but returns * immediately if no data is available and never blocks. - * + * * @param fd serial device handle * @param data pointer to data buffer for receiving * @param len maximum length (in bytes) of data to receive @@ -114,12 +114,12 @@ u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len); #ifndef sio_write /** * Writes to the serial device. - * + * * @param fd serial device handle * @param data pointer to data to send * @param len length (in bytes) of data to send * @return number of bytes actually sent - * + * * @note This function will block until all data can be sent. */ u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); @@ -128,7 +128,7 @@ u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); #ifndef sio_read_abort /** * Aborts a blocking sio_read() call. - * + * * @param fd serial device handle */ void sio_read_abort(sio_fd_t fd); diff --git a/components/net/lwip-1.4.1/src/include/lwip/snmp.h b/components/net/lwip-1.4.1/src/include/lwip/snmp.h index 2ed043dd5f..fbd2c5a85b 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/snmp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/snmp.h @@ -2,8 +2,8 @@ * Copyright (c) 2001, 2002 Leon Woestenberg * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands. * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -12,21 +12,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Leon Woestenberg * */ @@ -109,7 +109,7 @@ void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen); void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen); /* network interface */ -void snmp_add_ifinoctets(struct netif *ni, u32_t value); +void snmp_add_ifinoctets(struct netif *ni, u32_t value); void snmp_inc_ifinucastpkts(struct netif *ni); void snmp_inc_ifinnucastpkts(struct netif *ni); void snmp_inc_ifindiscards(struct netif *ni); @@ -167,7 +167,7 @@ void snmp_inc_icmpoutdestunreachs(void); void snmp_inc_icmpouttimeexcds(void); void snmp_inc_icmpoutparmprobs(void); void snmp_inc_icmpoutsrcquenchs(void); -void snmp_inc_icmpoutredirects(void); +void snmp_inc_icmpoutredirects(void); void snmp_inc_icmpoutechos(void); void snmp_inc_icmpoutechoreps(void); void snmp_inc_icmpouttimestamps(void); @@ -242,7 +242,7 @@ void snmp_get_snmpenableauthentraps(u8_t *value); #define snmp_set_syslocation(ocstr, ocstrlen); /* network interface */ -#define snmp_add_ifinoctets(ni,value) +#define snmp_add_ifinoctets(ni,value) #define snmp_inc_ifinucastpkts(ni) #define snmp_inc_ifinnucastpkts(ni) #define snmp_inc_ifindiscards(ni) @@ -282,26 +282,26 @@ void snmp_get_snmpenableauthentraps(u8_t *value); /* ICMP */ #define snmp_inc_icmpinmsgs() -#define snmp_inc_icmpinerrors() -#define snmp_inc_icmpindestunreachs() +#define snmp_inc_icmpinerrors() +#define snmp_inc_icmpindestunreachs() #define snmp_inc_icmpintimeexcds() -#define snmp_inc_icmpinparmprobs() -#define snmp_inc_icmpinsrcquenchs() -#define snmp_inc_icmpinredirects() -#define snmp_inc_icmpinechos() +#define snmp_inc_icmpinparmprobs() +#define snmp_inc_icmpinsrcquenchs() +#define snmp_inc_icmpinredirects() +#define snmp_inc_icmpinechos() #define snmp_inc_icmpinechoreps() -#define snmp_inc_icmpintimestamps() +#define snmp_inc_icmpintimestamps() #define snmp_inc_icmpintimestampreps() #define snmp_inc_icmpinaddrmasks() #define snmp_inc_icmpinaddrmaskreps() #define snmp_inc_icmpoutmsgs() #define snmp_inc_icmpouterrors() -#define snmp_inc_icmpoutdestunreachs() -#define snmp_inc_icmpouttimeexcds() +#define snmp_inc_icmpoutdestunreachs() +#define snmp_inc_icmpouttimeexcds() #define snmp_inc_icmpoutparmprobs() #define snmp_inc_icmpoutsrcquenchs() -#define snmp_inc_icmpoutredirects() -#define snmp_inc_icmpoutechos() +#define snmp_inc_icmpoutredirects() +#define snmp_inc_icmpoutechos() #define snmp_inc_icmpoutechoreps() #define snmp_inc_icmpouttimestamps() #define snmp_inc_icmpouttimestampreps() diff --git a/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h b/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h index 605fa3f16c..a231d03288 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h +++ b/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h @@ -2,7 +2,7 @@ * @file * Abstract Syntax Notation One (ISO 8824, 8825) codec. */ - + /* * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. * All rights reserved. diff --git a/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h b/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h index 0d3b46a928..e9bd9d379f 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h +++ b/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h @@ -54,7 +54,7 @@ extern "C" { #endif /* MIB object instance */ -#define MIB_OBJECT_NONE 0 +#define MIB_OBJECT_NONE 0 #define MIB_OBJECT_SCALAR 1 #define MIB_OBJECT_TAB 2 @@ -113,7 +113,7 @@ struct mib_node /** tests length and/or range BEFORE setting */ u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); /** sets object value, only to be called when set_test() */ - void (*set_value)(struct obj_def *od, u16_t len, void *value); + void (*set_value)(struct obj_def *od, u16_t len, void *value); /** One out of MIB_NODE_AR, MIB_NODE_LR or MIB_NODE_EX */ u8_t node_type; /* array or max list length */ @@ -161,7 +161,7 @@ struct mib_ram_array_node struct mib_list_node { - struct mib_list_node *prev; + struct mib_list_node *prev; struct mib_list_node *next; s32_t objid; struct mib_node *nptr; @@ -223,7 +223,7 @@ struct mib_external_node void (*get_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); u8_t (*set_test_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); void (*set_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - /** async Panic Close (agent returns error reply, + /** async Panic Close (agent returns error reply, e.g. used for external transaction cleanup) */ void (*get_object_def_pc)(u8_t rid, u8_t ident_len, s32_t *ident); void (*get_value_pc)(u8_t rid, struct obj_def *od); diff --git a/components/net/lwip-1.4.1/src/include/lwip/sockets.h b/components/net/lwip-1.4.1/src/include/lwip/sockets.h index 3ea32f13fb..a1003b04f4 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/sockets.h +++ b/components/net/lwip-1.4.1/src/include/lwip/sockets.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -304,7 +304,7 @@ typedef struct ip_mreq { #endif /* FD_SET */ /** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided - * by your system, set this to 0 and include in cc.h */ + * by your system, set this to 0 and include in cc.h */ #ifndef LWIP_TIMEVAL_PRIVATE #define LWIP_TIMEVAL_PRIVATE 1 #endif diff --git a/components/net/lwip-1.4.1/src/include/lwip/stats.h b/components/net/lwip-1.4.1/src/include/lwip/stats.h index 1f5152a949..d828980a9b 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/stats.h +++ b/components/net/lwip-1.4.1/src/include/lwip/stats.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -53,7 +53,7 @@ extern "C" { #else #define STAT_COUNTER u16_t #define STAT_COUNTER_F U16_F -#endif +#endif struct stats_proto { STAT_COUNTER xmit; /* Transmitted packets. */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/sys.h b/components/net/lwip-1.4.1/src/include/lwip/sys.h index dc9351335a..b25b8c6e62 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/sys.h +++ b/components/net/lwip-1.4.1/src/include/lwip/sys.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -80,7 +80,7 @@ typedef u8_t sys_mbox_t; /** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. * For now we use the same magic value, but we allow this to change in future. */ -#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT +#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT #include "lwip/err.h" #include "arch/sys_arch.h" @@ -119,7 +119,7 @@ void sys_mutex_lock(sys_mutex_t *mutex); void sys_mutex_unlock(sys_mutex_t *mutex); /** Delete a semaphore * @param mutex the mutex to delete */ -void sys_mutex_free(sys_mutex_t *mutex); +void sys_mutex_free(sys_mutex_t *mutex); #ifndef sys_mutex_valid /** Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid */ int sys_mutex_valid(sys_mutex_t *mutex); diff --git a/components/net/lwip-1.4.1/src/include/lwip/tcp.h b/components/net/lwip-1.4.1/src/include/lwip/tcp.h index c6e61ad1f1..8d8995103a 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/tcp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/tcp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -173,7 +173,7 @@ struct tcp_pcb { /* ports are in host byte order */ u16_t remote_port; - + u8_t flags; #define TF_ACK_DELAY ((u8_t)0x01U) /* Delayed ACK. */ #define TF_ACK_NOW ((u8_t)0x02U) /* Immediate ACK. */ @@ -236,12 +236,12 @@ struct tcp_pcb { #if TCP_OVERSIZE /* Extra bytes available at the end of the last pbuf in unsent. */ u16_t unsent_oversize; -#endif /* TCP_OVERSIZE */ +#endif /* TCP_OVERSIZE */ /* These are ordered by sequence number: */ struct tcp_seg *unsent; /* Unsent (queued) segments. */ struct tcp_seg *unacked; /* Sent but unacknowledged segments. */ -#if TCP_QUEUE_OOSEQ +#if TCP_QUEUE_OOSEQ struct tcp_seg *ooseq; /* Received out of sequence segments. */ #endif /* TCP_QUEUE_OOSEQ */ @@ -271,7 +271,7 @@ struct tcp_pcb { u32_t keep_intvl; u32_t keep_cnt; #endif /* LWIP_TCP_KEEPALIVE */ - + /* Persist timer counter */ u8_t persist_cnt; /* Persist timer back-off */ @@ -281,7 +281,7 @@ struct tcp_pcb { u8_t keep_cnt_sent; }; -struct tcp_pcb_listen { +struct tcp_pcb_listen { /* Common members of all PCB types */ IP_PCB; /* Protocol specific PCB members */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h b/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h index 173de44e44..7c1655a24f 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h +++ b/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -282,7 +282,7 @@ struct tcp_seg { u16_t oversize_left; /* Extra bytes available at the end of the last pbuf in unsent (used for asserting vs. tcp_pcb.unsent_oversized only) */ -#endif /* TCP_OVERSIZE_DBGCHECK */ +#endif /* TCP_OVERSIZE_DBGCHECK */ #if TCP_CHECKSUM_ON_COPY u16_t chksum; u8_t chksum_swapped; @@ -309,7 +309,7 @@ extern u8_t tcp_active_pcbs_changed; /* The TCP PCB lists. */ union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */ - struct tcp_pcb_listen *listen_pcbs; + struct tcp_pcb_listen *listen_pcbs; struct tcp_pcb *pcbs; }; extern struct tcp_pcb *tcp_bound_pcbs; @@ -321,7 +321,7 @@ extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. * extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */ -/* Axioms about the above lists: +/* Axioms about the above lists: 1) Every TCP PCB that is not CLOSED is in one of the lists. 2) A PCB is only in one of the lists. 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state. diff --git a/components/net/lwip-1.4.1/src/include/lwip/tcpip.h b/components/net/lwip-1.4.1/src/include/lwip/tcpip.h index 637476e1a9..f98340aefd 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/tcpip.h +++ b/components/net/lwip-1.4.1/src/include/lwip/tcpip.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/timers.h b/components/net/lwip-1.4.1/src/include/lwip/timers.h index 04e78e0fea..bcf9369c5d 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/timers.h +++ b/components/net/lwip-1.4.1/src/include/lwip/timers.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * Simon Goldschmidt * diff --git a/components/net/lwip-1.4.1/src/include/lwip/udp.h b/components/net/lwip-1.4.1/src/include/lwip/udp.h index f1e6d3f1e4..5282b0640d 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/udp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/udp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -113,7 +113,7 @@ struct udp_pcb { /** receive callback function */ udp_recv_fn recv; /** user-supplied argument for the recv callback */ - void *recv_arg; + void *recv_arg; }; /* udp_pcbs export for exernal reference (e.g. SNMP agent) */ extern struct udp_pcb *udp_pcbs; diff --git a/components/net/lwip-1.4.1/src/include/netif/etharp.h b/components/net/lwip-1.4.1/src/include/netif/etharp.h index 872f48b10b..411284fed4 100644 --- a/components/net/lwip-1.4.1/src/include/netif/etharp.h +++ b/components/net/lwip-1.4.1/src/include/netif/etharp.h @@ -2,9 +2,9 @@ * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * Copyright (c) 2003-2004 Leon Woestenberg * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -13,21 +13,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/netif/ethernetif.h b/components/net/lwip-1.4.1/src/include/netif/ethernetif.h index 1c969e6e25..fb7d4b963c 100644 --- a/components/net/lwip-1.4.1/src/include/netif/ethernetif.h +++ b/components/net/lwip-1.4.1/src/include/netif/ethernetif.h @@ -4,16 +4,16 @@ #include "lwip/netif.h" #include -#define NIOCTL_GADDR 0x01 +#define NIOCTL_GADDR 0x01 #ifndef RT_LWIP_ETH_MTU -#define ETHERNET_MTU 1500 +#define ETHERNET_MTU 1500 #else -#define ETHERNET_MTU RT_LWIP_ETH_MTU +#define ETHERNET_MTU RT_LWIP_ETH_MTU #endif /* eth flag with auto_linkup or phy_linkup */ -#define ETHIF_LINK_AUTOUP 0x0000 -#define ETHIF_LINK_PHYUP 0x0100 +#define ETHIF_LINK_AUTOUP 0x0000 +#define ETHIF_LINK_PHYUP 0x0100 struct eth_device { diff --git a/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h b/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h index e1cdfa5199..e0897a35e5 100644 --- a/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h +++ b/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/include/netif/slipif.h b/components/net/lwip-1.4.1/src/include/netif/slipif.h index 7b6ce5e28f..cfd0933945 100644 --- a/components/net/lwip-1.4.1/src/include/netif/slipif.h +++ b/components/net/lwip-1.4.1/src/include/netif/slipif.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -76,6 +76,6 @@ void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); #ifdef __cplusplus } #endif - -#endif + +#endif diff --git a/components/net/lwip-1.4.1/src/include/posix/netdb.h b/components/net/lwip-1.4.1/src/include/posix/netdb.h index 7134032d2d..12d4c7f566 100644 --- a/components/net/lwip-1.4.1/src/include/posix/netdb.h +++ b/components/net/lwip-1.4.1/src/include/posix/netdb.h @@ -4,7 +4,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -13,17 +13,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. diff --git a/components/net/lwip-1.4.1/src/include/posix/sys/socket.h b/components/net/lwip-1.4.1/src/include/posix/sys/socket.h index f7c7066e6f..0ed9baf3d9 100644 --- a/components/net/lwip-1.4.1/src/include/posix/sys/socket.h +++ b/components/net/lwip-1.4.1/src/include/posix/sys/socket.h @@ -4,7 +4,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -13,17 +13,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. diff --git a/components/net/lwip-1.4.1/src/netif/etharp.c b/components/net/lwip-1.4.1/src/netif/etharp.c index 5e382d1d60..1228c4d00a 100644 --- a/components/net/lwip-1.4.1/src/netif/etharp.c +++ b/components/net/lwip-1.4.1/src/netif/etharp.c @@ -42,7 +42,7 @@ * This file is part of the lwIP TCP/IP stack. * */ - + #include "lwip/opt.h" #if LWIP_ARP || LWIP_ETHERNET @@ -84,7 +84,7 @@ const struct eth_addr ethzero = {{0,0,0,0,0,0}}; /** the time an ARP entry stays pending after first request, * for ARP_TMR_INTERVAL = 5000, this is * (2 * 5) seconds = 10 seconds. - * + * * @internal Keep this number at least 2, otherwise it might * run out instantly if the timeout occurs directly after a request. */ @@ -243,14 +243,14 @@ etharp_tmr(void) /** * Search the ARP table for a matching or new entry. - * + * * If an IP address is given, return a pending or stable ARP entry that matches * the address. If no match is found, create a new entry with this address set, * but in state ETHARP_EMPTY. The caller must check and possibly change the * state of the returned entry. - * + * * If ipaddr is NULL, return a initialized new entry in state ETHARP_EMPTY. - * + * * In all cases, attempt to create new entries from an empty entry. If no * empty entries are available and ETHARP_FLAG_TRY_HARD flag is set, recycle * old entries. Heuristic choose the least important entry for recycling. @@ -258,7 +258,7 @@ etharp_tmr(void) * @param ipaddr IP address to find in ARP cache, or to add if not found. * @param flags @see definition of ETHARP_FLAG_* * @param netif netif related to this address (used for NETIF_HWADDRHINT) - * + * * @return The ARP entry index that matched or is created, ERR_MEM if no * entry is found or could be recycled. */ @@ -337,7 +337,7 @@ etharp_find_entry(ip_addr_t *ipaddr, u8_t flags) } } /* { we have no match } => try to create a new entry */ - + /* don't create new entry, only search? */ if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) || /* or no empty entry found and not allowed to recycle? */ @@ -345,15 +345,15 @@ etharp_find_entry(ip_addr_t *ipaddr, u8_t flags) LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty entry found and not allowed to recycle\n")); return (s8_t)ERR_MEM; } - + /* b) choose the least destructive entry to recycle: * 1) empty entry * 2) oldest stable entry * 3) oldest pending entry without queued packets * 4) oldest pending entry with queued packets - * + * * { ETHARP_FLAG_TRY_HARD is set at this point } - */ + */ /* 1) empty entry available? */ if (empty < ARP_TABLE_SIZE) { @@ -431,7 +431,7 @@ etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct * * If a pending entry is resolved, any queued packets will be sent * at this point. - * + * * @param netif netif related to this entry (used for NETIF_ADDRHINT) * @param ipaddr IP address of the inserted ARP entry. * @param ethaddr Ethernet address of the inserted ARP entry. @@ -670,7 +670,7 @@ etharp_ip_input(struct netif *netif, struct pbuf *p) #endif /* ETHARP_TRUST_IP_MAC */ /** - * Responds to ARP requests to us. Upon ARP replies to us, add entry to cache + * Responds to ARP requests to us. Upon ARP replies to us, add entry to cache * send out queued IP packets. Updates cache with snooped address pairs. * * Should be called for incoming ARP packets. The pbuf in the argument @@ -846,13 +846,13 @@ etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx) /* if arp table entry is about to expire: re-request it, but only if its state is ETHARP_STATE_STABLE to prevent flooding the network with ARP requests if this address is used frequently. */ - if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) && + if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) && (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED)) { if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) { arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING; } } - + return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), &arp_table[arp_idx].ethaddr); } @@ -990,11 +990,11 @@ etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr) * is sent for the given address. The packet is queued on this entry. * * If the IP address was already stable in the cache, and a packet is - * given, it is directly sent and no ARP request is sent out. - * + * given, it is directly sent and no ARP request is sent out. + * * If the IP address was already stable in the cache, and no packet is * given, an ARP request is sent out. - * + * * @param netif The lwIP network interface on which ipaddr * must be queried for. * @param ipaddr The IP address to be resolved. @@ -1079,7 +1079,7 @@ etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q) struct pbuf *p; int copy_needed = 0; /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but - * to copy the whole queue into a new PBUF_RAM (see bug #11400) + * to copy the whole queue into a new PBUF_RAM (see bug #11400) * PBUF_ROMs can be left as they are, since ROM must not get changed. */ p = q; while (p) { @@ -1224,7 +1224,7 @@ etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr, #endif /* LWIP_AUTOIP */ ETHADDR16_COPY(ðhdr->src, ethsrc_addr); /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without - * structure packing. */ + * structure packing. */ IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr); IPADDR2_COPY(&hdr->dipaddr, ipdst_addr); @@ -1363,7 +1363,7 @@ ethernet_input(struct pbuf *p, struct netif *netif) ip_input(p, netif); } break; - + case PP_HTONS(ETHTYPE_ARP): if (!(netif->flags & NETIF_FLAG_ETHARP)) { goto free_and_return; diff --git a/components/net/lwip-1.4.1/src/netif/ethernetif.c b/components/net/lwip-1.4.1/src/netif/ethernetif.c index f2570f9e2b..5fb9c42464 100644 --- a/components/net/lwip-1.4.1/src/netif/ethernetif.c +++ b/components/net/lwip-1.4.1/src/netif/ethernetif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * COPYRIGHT (C) 2006-2010, RT-Thread Development Team + * COPYRIGHT (C) 2006-2021, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -59,9 +59,9 @@ #define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL) #ifndef RT_LWIP_ETHTHREAD_PRIORITY -#define RT_ETHERNETIF_THREAD_PREORITY 0x90 +#define RT_ETHERNETIF_THREAD_PREORITY 0x90 #else -#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY +#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY #endif #ifndef LWIP_NO_TX_THREAD @@ -70,8 +70,8 @@ */ struct eth_tx_msg { - struct netif *netif; - struct pbuf *buf; + struct netif *netif; + struct pbuf *buf; }; static struct rt_mailbox eth_tx_thread_mb; @@ -156,16 +156,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) { netdev_low_level_set_dhcp_status(netif, is_enabled); - + if(RT_TRUE == is_enabled) { dhcp_start((struct netif *)netif->user_data); } else { - dhcp_stop((struct netif *)netif->user_data); + dhcp_stop((struct netif *)netif->user_data); } - + return ERR_OK; } #endif /* RT_LWIP_DHCP */ @@ -368,7 +368,7 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p) struct eth_tx_msg msg; struct eth_device* enetif; - RT_ASSERT(netif != RT_NULL); + RT_ASSERT(netif != RT_NULL); enetif = (struct eth_device*)netif->state; /* send a message to eth tx thread */ @@ -382,13 +382,13 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p) #else struct eth_device* enetif; - RT_ASSERT(netif != RT_NULL); + RT_ASSERT(netif != RT_NULL); enetif = (struct eth_device*)netif->state; - if (enetif->eth_tx(&(enetif->parent), p) != RT_EOK) - { - return ERR_IF; - } + if (enetif->eth_tx(&(enetif->parent), p) != RT_EOK) + { + return ERR_IF; + } #endif return ERR_OK; } @@ -479,16 +479,16 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ netif->name[1] = name[1]; /* set hw address to 6 */ - netif->hwaddr_len = 6; + netif->hwaddr_len = 6; /* maximum transfer unit */ - netif->mtu = ETHERNET_MTU; + netif->mtu = ETHERNET_MTU; /* get hardware MAC address */ rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr); /* set output */ - netif->output = etharp_output; - netif->linkoutput = ethernetif_linkoutput; + netif->output = etharp_output; + netif->linkoutput = ethernetif_linkoutput; #if LWIP_NETIF_HOSTNAME /* Initialize interface hostname */ @@ -577,12 +577,12 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up) /* NOTE: please not use it in interrupt when no RxThread exist */ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up) { - if (up == RT_TRUE) - netifapi_netif_set_link_up(dev->netif); - else - netifapi_netif_set_link_down(dev->netif); + if (up == RT_TRUE) + netifapi_netif_set_link_up(dev->netif); + else + netifapi_netif_set_link_down(dev->netif); - return RT_EOK; + return RT_EOK; } #endif @@ -650,7 +650,7 @@ static void eth_rx_thread_entry(void* parameter) /* receive all of buffer */ while (1) { - if(device->eth_rx == RT_NULL) break; + if(device->eth_rx == RT_NULL) break; p = device->eth_rx(&(device->parent)); if (p != RT_NULL) diff --git a/components/net/lwip-1.4.1/src/netif/ppp/auth.c b/components/net/lwip-1.4.1/src/netif/ppp/auth.c index 0fd87a3796..f99763cd78 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/auth.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/auth.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -479,7 +479,7 @@ link_established(int unit) if (go->neg_chap) { ChapAuthPeer(unit, ppp_settings.our_name, go->chap_mdtype); auth |= CHAP_PEER; - } + } #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT && CHAP_SUPPORT else @@ -610,7 +610,7 @@ auth_peer_success(int unit, u16_t protocol, char *name, int namelen) } BCOPY(name, peer_authname, namelen); peer_authname[namelen] = 0; - + /* * If there is no more authentication still to be done, * proceed to the network (or callback) phase. @@ -749,7 +749,7 @@ check_idle(void *arg) { struct ppp_idle idle; u_short itime; - + LWIP_UNUSED_ARG(arg); if (!get_idle_time(0, &idle)) { return; @@ -802,7 +802,7 @@ auth_check_options(void) wo->neg_chap = 1; wo->neg_upap = 1; } - + /* * Check whether we have appropriate secrets to use * to authenticate the peer. @@ -876,7 +876,7 @@ check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, char passwd[256], user[256]; char secret[MAXWORDLEN]; static u_short attempts = 0; - + /* * Make copies of apasswd and auser, then null-terminate them. */ @@ -888,7 +888,7 @@ check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, /* XXX Validate user name and password. */ ret = UPAP_AUTHACK; /* XXX Assume all entries OK. */ - + if (ret == UPAP_AUTHNAK) { if (*msg == (char *) 0) { *msg = "Login incorrect"; @@ -963,7 +963,7 @@ plogin(char *user, char *passwd, char **msg, int *msglen) LWIP_UNUSED_ARG(msglen); - /* The new lines are here align the file when + /* The new lines are here align the file when * compared against the pppd 2.3.11 code */ @@ -1101,7 +1101,7 @@ get_secret(int unit, char *client, char *server, char *secret, int *secret_len, int ret = 0, len; struct wordlist *addrs; char secbuf[MAXWORDLEN]; - + addrs = NULL; secbuf[0] = 0; @@ -1152,7 +1152,7 @@ set_allowed_addrs(int unit, struct wordlist *addrs) struct ipcp_options *wo = &ipcp_wantoptions[unit]; u32_t a; struct hostent *hp; - + if (wo->hisaddr == 0 && *p != '!' && *p != '-' && strchr(p, '/') == NULL) { hp = gethostbyname(p); if (hp != NULL && hp->h_addrtype == AF_INET) { diff --git a/components/net/lwip-1.4.1/src/netif/ppp/auth.h b/components/net/lwip-1.4.1/src/netif/ppp/auth.h index a8069ec464..8af17ac5cf 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/auth.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/auth.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chap.c b/components/net/lwip-1.4.1/src/netif/ppp/chap.c index f10e27d2ea..892cefadf3 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chap.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/chap.c @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -190,7 +190,7 @@ ChapAuthWithPeer(int unit, char *our_name, u_char digest) /* * We get here as a result of LCP coming up. - * So even if CHAP was open before, we will + * So even if CHAP was open before, we will * have to re-authenticate ourselves. */ cstate->clientstate = CHAPCS_LISTEN; @@ -207,7 +207,7 @@ ChapAuthPeer(int unit, char *our_name, u_char digest) cstate->chal_name = our_name; cstate->chal_type = digest; - + if (cstate->serverstate == CHAPSS_INITIAL || cstate->serverstate == CHAPSS_PENDING) { /* lower layer isn't up - wait until later */ @@ -272,7 +272,7 @@ static void ChapRechallenge(void *arg) { chap_state *cstate = (chap_state *) arg; - + /* if we aren't sending a response, don't worry. */ if (cstate->serverstate != CHAPSS_OPEN) { return; @@ -343,7 +343,7 @@ static void ChapProtocolReject(int unit) { chap_state *cstate = &chap[unit]; - + if (cstate->serverstate != CHAPSS_INITIAL && cstate->serverstate != CHAPSS_CLOSED) { auth_peer_fail(unit, PPP_CHAP); @@ -366,7 +366,7 @@ ChapInput(int unit, u_char *inpacket, int packet_len) u_char *inp; u_char code, id; int len; - + /* * Parse header (code, id and length). * If packet too short, drop it. @@ -388,7 +388,7 @@ ChapInput(int unit, u_char *inpacket, int packet_len) return; } len -= CHAP_HEADERLEN; - + /* * Action depends on code (as in fact it usually does :-). */ @@ -396,19 +396,19 @@ ChapInput(int unit, u_char *inpacket, int packet_len) case CHAP_CHALLENGE: ChapReceiveChallenge(cstate, inp, id, len); break; - + case CHAP_RESPONSE: ChapReceiveResponse(cstate, inp, id, len); break; - + case CHAP_FAILURE: ChapReceiveFailure(cstate, inp, id, len); break; - + case CHAP_SUCCESS: ChapReceiveSuccess(cstate, inp, id, len); break; - + default: /* Need code reject? */ CHAPDEBUG(LOG_WARNING, ("Unknown CHAP code (%d) received.\n", code)); break; @@ -486,7 +486,7 @@ ChapReceiveChallenge(chap_state *cstate, u_char *inp, u_char id, int len) cstate->resp_transmits = 0; /* generate MD based on negotiated type */ - switch (cstate->resp_type) { + switch (cstate->resp_type) { case CHAP_DIGEST_MD5: MD5Init(&mdContext); @@ -497,7 +497,7 @@ ChapReceiveChallenge(chap_state *cstate, u_char *inp, u_char id, int len) BCOPY(hash, cstate->response, MD5_SIGNATURE_SIZE); cstate->resp_length = MD5_SIGNATURE_SIZE; break; - + #if MSCHAP_SUPPORT case CHAP_MICROSOFT: ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len); @@ -529,7 +529,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) u_char hash[MD5_SIGNATURE_SIZE]; CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: Rcvd id %d.\n", id)); - + if (cstate->serverstate == CHAPSS_CLOSED || cstate->serverstate == CHAPSS_PENDING) { CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: in state %d\n", @@ -554,7 +554,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) ChapSendStatus(cstate, CHAP_FAILURE); return; } - + if (len < 2) { CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: rcvd short packet.\n")); return; @@ -562,7 +562,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) GETCHAR(remmd_len, inp); /* get length of MD */ remmd = inp; /* get pointer to MD */ INCPTR(remmd_len, inp); - + len -= sizeof (u_char) + remmd_len; if (len < 0) { CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: rcvd short packet.\n")); @@ -570,7 +570,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) } UNTIMEOUT(ChapChallengeTimeout, cstate); - + if (len >= (int)sizeof(rhostname)) { len = sizeof(rhostname) - 1; } @@ -601,19 +601,19 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) MD5Update(&mdContext, &cstate->chal_id, 1); MD5Update(&mdContext, (u_char*)secret, secret_len); MD5Update(&mdContext, cstate->challenge, cstate->chal_len); - MD5Final(hash, &mdContext); - + MD5Final(hash, &mdContext); + /* compare local and remote MDs and send the appropriate status */ if (memcmp (hash, remmd, MD5_SIGNATURE_SIZE) == 0) { code = CHAP_SUCCESS; /* they are the same! */ } break; - + default: CHAPDEBUG(LOG_INFO, ("unknown digest type %d\n", cstate->chal_type)); } } - + BZERO(secret, sizeof(secret)); ChapSendStatus(cstate, code); @@ -655,9 +655,9 @@ ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len) cstate->clientstate)); return; } - + UNTIMEOUT(ChapResponseTimeout, cstate); - + /* * Print message. */ @@ -712,7 +712,7 @@ ChapSendChallenge(chap_state *cstate) u_char *outp; int chal_len, name_len; int outlen; - + chal_len = cstate->chal_len; name_len = (int)strlen(cstate->chal_name); outlen = CHAP_HEADERLEN + sizeof (u_char) + chal_len + name_len; @@ -729,11 +729,11 @@ ChapSendChallenge(chap_state *cstate) INCPTR(chal_len, outp); BCOPY(cstate->chal_name, outp, name_len); /* append hostname */ - + pppWrite(cstate->unit, outpacket_buf[cstate->unit], outlen + PPP_HDRLEN); CHAPDEBUG(LOG_INFO, ("ChapSendChallenge: Sent id %d.\n", cstate->chal_id)); - + TIMEOUT(ChapChallengeTimeout, cstate, cstate->timeouttime); ++cstate->chal_transmits; } @@ -760,7 +760,7 @@ ChapSendStatus(chap_state *cstate, int code) outp = outpacket_buf[cstate->unit]; MAKEHEADER(outp, PPP_CHAP); /* paste in a header */ - + PUTCHAR(code, outp); PUTCHAR(cstate->chal_id, outp); PUTSHORT(outlen, outp); @@ -785,8 +785,8 @@ ChapGenChallenge(chap_state *cstate) u_char *ptr = cstate->challenge; int i; - /* pick a random challenge length between MIN_CHALLENGE_LENGTH and - MAX_CHALLENGE_LENGTH */ + /* pick a random challenge length between MIN_CHALLENGE_LENGTH and + MAX_CHALLENGE_LENGTH */ chal_len = (unsigned) ((((magic() >> 16) * (MAX_CHALLENGE_LENGTH - MIN_CHALLENGE_LENGTH)) >> 16) @@ -819,11 +819,11 @@ ChapSendResponse(chap_state *cstate) outp = outpacket_buf[cstate->unit]; MAKEHEADER(outp, PPP_CHAP); - + PUTCHAR(CHAP_RESPONSE, outp); /* we are a response */ PUTCHAR(cstate->resp_id, outp); /* copy id from challenge packet */ PUTSHORT(outlen, outp); /* packet length */ - + PUTCHAR(md_len, outp); /* length of MD */ BCOPY(cstate->response, outp, md_len); /* copy MD to buffer */ INCPTR(md_len, outp); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chap.h b/components/net/lwip-1.4.1/src/netif/ppp/chap.h index fedcab8da1..517b774965 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chap.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/chap.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chpms.c b/components/net/lwip-1.4.1/src/netif/ppp/chpms.c index 81a887b83a..f177f828a1 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chpms.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/chpms.c @@ -11,13 +11,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -288,11 +288,11 @@ MakeKey( u_char *key, /* IN 56 bit DES key missing parity bits */ des_key[5] = Get7Bits(key, 35); des_key[6] = Get7Bits(key, 42); des_key[7] = Get7Bits(key, 49); - + #ifndef USE_CRYPT des_set_odd_parity((des_cblock *)des_key); #endif - + #if 0 CHAPDEBUG(LOG_INFO, ("MakeKey: 56-bit input : %02X%02X%02X%02X%02X%02X%02X\n", key[0], key[1], key[2], key[3], key[4], key[5], key[6])); @@ -350,7 +350,7 @@ ChapMS_LANMan( char *rchallenge, int i; u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ u_char PasswordHash[16]; - + /* LANMan password is case insensitive */ BZERO(UcasePassword, sizeof(UcasePassword)); for (i = 0; i < secret_len; i++) { diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chpms.h b/components/net/lwip-1.4.1/src/netif/ppp/chpms.h index df070fb356..d09e782c70 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chpms.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/chpms.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/fsm.c b/components/net/lwip-1.4.1/src/netif/ppp/fsm.c index e8a254ede5..2dc86e16d4 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/fsm.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/fsm.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -230,7 +230,7 @@ fsm_open(fsm *f) f->state = LS_REQSENT; } break; - + case LS_CLOSING: f->state = LS_STOPPING; /* fall through */ @@ -422,28 +422,28 @@ fsm_input(fsm *f, u_char *inpacket, int l) case CONFREQ: fsm_rconfreq(f, id, inp, len); break; - + case CONFACK: fsm_rconfack(f, id, inp, len); break; - + case CONFNAK: case CONFREJ: fsm_rconfnakrej(f, code, id, inp, len); break; - + case TERMREQ: fsm_rtermreq(f, id, inp, len); break; - + case TERMACK: fsm_rtermack(f); break; - + case CODEREJ: fsm_rcoderej(f, inp, len); break; - + default: FSMDEBUG(LOG_INFO, ("fsm_input(%s): default: \n", PROTO_NAME(f))); if( !f->callbacks->extcode || @@ -463,7 +463,7 @@ fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { int code, reject_if_disagree; - FSMDEBUG(LOG_INFO, ("fsm_rconfreq(%s): Rcvd id %d state=%d (%s)\n", + FSMDEBUG(LOG_INFO, ("fsm_rconfreq(%s): Rcvd id %d state=%d (%s)\n", PROTO_NAME(f), id, f->state, ppperr_strerr[f->state])); switch( f->state ) { case LS_CLOSED: @@ -488,7 +488,7 @@ fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) f->state = LS_REQSENT; break; } - + /* * Pass the requested configuration options * to protocol-specific code for checking. @@ -501,10 +501,10 @@ fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) } else { code = CONFACK; } - + /* send the Ack, Nak or Rej to the peer */ fsm_sdata(f, (u_char)code, id, inp, len); - + if (code == CONFACK) { if (f->state == LS_ACKRCVD) { UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ @@ -536,7 +536,7 @@ fsm_rconfack(fsm *f, int id, u_char *inp, int len) { FSMDEBUG(LOG_INFO, ("fsm_rconfack(%s): Rcvd id %d state=%d (%s)\n", PROTO_NAME(f), id, f->state, ppperr_strerr[f->state])); - + if (id != f->reqid || f->seen_ack) { /* Expected id? */ return; /* Nope, toss... */ } @@ -547,25 +547,25 @@ fsm_rconfack(fsm *f, int id, u_char *inp, int len) return; } f->seen_ack = 1; - + switch (f->state) { case LS_CLOSED: case LS_STOPPED: fsm_sdata(f, TERMACK, (u_char)id, NULL, 0); break; - + case LS_REQSENT: f->state = LS_ACKRCVD; f->retransmits = f->maxconfreqtransmits; break; - + case LS_ACKRCVD: /* Huh? an extra valid Ack? oh well... */ UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ fsm_sconfreq(f, 0); f->state = LS_REQSENT; break; - + case LS_ACKSENT: UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ f->state = LS_OPENED; @@ -574,7 +574,7 @@ fsm_rconfack(fsm *f, int id, u_char *inp, int len) (*f->callbacks->up)(f); /* Inform upper layers */ } break; - + case LS_OPENED: /* Go down and restart negotiation */ if (f->callbacks->down) { @@ -616,7 +616,7 @@ fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) case LS_STOPPED: fsm_sdata(f, TERMACK, (u_char)id, NULL, 0); break; - + case LS_REQSENT: case LS_ACKSENT: /* They didn't agree to what we wanted - try another request */ @@ -627,14 +627,14 @@ fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) fsm_sconfreq(f, 0); /* Send Configure-Request */ } break; - + case LS_ACKRCVD: /* Got a Nak/reject when we had already had an Ack?? oh well... */ UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ fsm_sconfreq(f, 0); f->state = LS_REQSENT; break; - + case LS_OPENED: /* Go down and restart negotiation */ if (f->callbacks->down) { @@ -689,9 +689,9 @@ fsm_rtermreq(fsm *f, int id, u_char *p, int len) static void fsm_rtermack(fsm *f) { - FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): state=%d (%s)\n", + FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): state=%d (%s)\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); - + switch (f->state) { case LS_CLOSING: UNTIMEOUT(fsm_timeout, f); @@ -708,11 +708,11 @@ fsm_rtermack(fsm *f) (*f->callbacks->finished)(f); } break; - + case LS_ACKRCVD: f->state = LS_REQSENT; break; - + case LS_OPENED: if (f->callbacks->down) { (*f->callbacks->down)(f); /* Inform upper layers */ @@ -720,7 +720,7 @@ fsm_rtermack(fsm *f) fsm_sconfreq(f, 0); break; default: - FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): UNHANDLED state=%d (%s)!!!\n", + FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): UNHANDLED state=%d (%s)!!!\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); } } @@ -733,10 +733,10 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; - - FSMDEBUG(LOG_INFO, ("fsm_rcoderej(%s): state=%d (%s)\n", + + FSMDEBUG(LOG_INFO, ("fsm_rcoderej(%s): state=%d (%s)\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); - + if (len < HEADERLEN) { FSMDEBUG(LOG_INFO, ("fsm_rcoderej: Rcvd short Code-Reject packet!\n")); return; @@ -745,7 +745,7 @@ fsm_rcoderej(fsm *f, u_char *inp, int len) GETCHAR(id, inp); FSMDEBUG(LOG_WARNING, ("%s: Rcvd Code-Reject for code %d, id %d\n", PROTO_NAME(f), code, id)); - + if( f->state == LS_ACKRCVD ) { f->state = LS_REQSENT; } @@ -783,7 +783,7 @@ fsm_protreject(fsm *f) (*f->callbacks->finished)(f); } break; - + case LS_OPENED: if( f->callbacks->down ) { (*f->callbacks->down)(f); @@ -797,7 +797,7 @@ fsm_protreject(fsm *f) f->state = LS_STOPPING; break; - + default: FSMDEBUG(LOG_INFO, ("%s: Protocol-reject event in state %d (%s)!\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); @@ -813,7 +813,7 @@ fsm_sconfreq(fsm *f, int retransmit) { u_char *outp; int cilen; - + if( f->state != LS_REQSENT && f->state != LS_ACKRCVD && f->state != LS_ACKSENT ) { /* Not currently negotiating - reset options */ if( f->callbacks->resetci ) { @@ -821,15 +821,15 @@ fsm_sconfreq(fsm *f, int retransmit) } f->nakloops = 0; } - + if( !retransmit ) { /* New request - reset retransmission counter, use new ID */ f->retransmits = f->maxconfreqtransmits; f->reqid = ++f->id; } - + f->seen_ack = 0; - + /* * Make up the request packet */ @@ -848,11 +848,11 @@ fsm_sconfreq(fsm *f, int retransmit) /* send the request to our peer */ fsm_sdata(f, CONFREQ, f->reqid, outp, cilen); - + /* start the retransmit timer */ --f->retransmits; TIMEOUT(fsm_timeout, f, f->timeouttime); - + FSMDEBUG(LOG_INFO, ("%s: sending Configure-Request, id %d\n", PROTO_NAME(f), f->reqid)); } diff --git a/components/net/lwip-1.4.1/src/netif/ppp/fsm.h b/components/net/lwip-1.4.1/src/netif/ppp/fsm.h index 8d41b5f511..0057cf3f51 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/fsm.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/fsm.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c index f0ab2e0e17..aef7fb0af2 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c @@ -9,13 +9,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -280,7 +280,7 @@ static void ipcp_resetci(fsm *f) { ipcp_options *wo = &ipcp_wantoptions[f->unit]; - + wo->req_addr = wo->neg_addr && ipcp_allowoptions[f->unit].neg_addr; if (wo->ouraddr == 0) { wo->accept_local = 1; @@ -462,7 +462,7 @@ ipcp_ackci(fsm *f, u_char *p, int len) } \ } \ } - + #define ACKCIADDR(opt, neg, old, val1, val2) \ if (neg) { \ int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \ @@ -591,7 +591,7 @@ ipcp_nakci(fsm *f, u_char *p, int len) no.neg = 1; \ code \ } - + #define NAKCIDNS(opt, neg, code) \ if (go->neg && \ ((cilen = p[1]) == CILEN_ADDR) && \ @@ -1091,7 +1091,7 @@ ipcp_reqci(fsm *f, u_char *inp/* Requested CIs */,int *len/* Length of requested ho->vj_protocol = cishort; if (cilen == CILEN_VJ) { GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { + if (maxslotindex > ao->maxslotindex) { IPCPDEBUG(LOG_INFO, ("ipcp_reqci: Naking VJ max slot %d\n", maxslotindex)); orc = CONFNAK; if (!reject_if_disagree) { @@ -1152,7 +1152,7 @@ endswitch: rc = CONFREJ; ucp = inp; /* Backup */ } - + /* Need to move CI? */ if (ucp != cip) { BCOPY(cip, ucp, cilen); /* Move it */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h index de03f460ec..bcfd25caa1 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -73,7 +73,7 @@ #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option */ #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option */ + /* compression option */ typedef struct ipcp_options { u_int neg_addr : 1; /* Negotiate IP Address? */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/lcp.c b/components/net/lwip-1.4.1/src/netif/ppp/lcp.c index 54f758aa64..06b426a3d4 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/lcp.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/lcp.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -49,7 +49,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ - + #include "lwip/opt.h" @@ -107,7 +107,7 @@ static u32_t lcp_echo_number = 0; /* ID number of next ech static u32_t lcp_echo_timer_running = 0; /* TRUE if a timer is running */ /* @todo: do we really need such a large buffer? The typical 1500 bytes seem too much. */ -static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ +static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ /* * Callbacks for fsm code. (CI = Configuration Information) @@ -278,7 +278,7 @@ lcp_init(int unit) ao->neg_lqr = 0; /* no LQR implementation yet */ ao->neg_cbcp = (CBCP_SUPPORT != 0); - /* + /* * Set transmit escape for the flag and escape characters plus anything * set for the allowable options. */ @@ -293,7 +293,7 @@ lcp_init(int unit) xmit_accm[unit][1], xmit_accm[unit][2], xmit_accm[unit][3])); - + lcp_phase[unit] = PHASE_INITIALIZE; } @@ -412,7 +412,7 @@ lcp_extcode(fsm *f, int code, u_char id, u_char *inp, int len) case PROTREJ: lcp_rprotrej(f, inp, len); break; - + case ECHOREQ: if (f->state != LS_OPENED) { break; @@ -892,7 +892,7 @@ lcp_nakci(fsm *f, u_char *p, int len) goto bad; } try.neg_chap = 0; - + } else if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { GETCHAR(cichar, p); if (go->neg_chap) { @@ -910,7 +910,7 @@ lcp_nakci(fsm *f, u_char *p, int len) */ try.neg_upap = 0; } - + } else { /* * We don't recognize what they're suggesting. @@ -1179,7 +1179,7 @@ lcp_rejci(fsm *f, u_char *p, int len) try.neg = 0; \ LCPDEBUG(LOG_INFO, ("lcp_rejci: Callback opt %d rejected\n", opt)); \ } - + REJCISHORT(CI_MRU, neg_mru, go->mru); REJCILONG(CI_ASYNCMAP, neg_asyncmap, go->asyncmap); REJCICHAP(CI_AUTHTYPE, neg_chap, PPP_CHAP, go->chap_mdtype); @@ -1191,7 +1191,7 @@ lcp_rejci(fsm *f, u_char *p, int len) REJCILONG(CI_MAGICNUMBER, neg_magicnumber, go->magicnumber); REJCIVOID(CI_PCOMPRESSION, neg_pcompression); REJCIVOID(CI_ACCOMPRESSION, neg_accompression); - + /* * If there are any remaining CIs, then this packet is bad. */ @@ -1205,7 +1205,7 @@ lcp_rejci(fsm *f, u_char *p, int len) *go = try; } return 1; - + bad: LCPDEBUG(LOG_WARNING, ("lcp_rejci: received bad Reject!\n")); return 0; @@ -1220,7 +1220,7 @@ bad: * CONFNAK; returns CONFREJ if it can't return CONFACK. */ static int -lcp_reqci(fsm *f, +lcp_reqci(fsm *f, u_char *inp, /* Requested CIs */ int *lenp, /* Length of requested CIs */ int reject_if_disagree) @@ -1318,13 +1318,13 @@ lcp_reqci(fsm *f, break; } GETLONG(cilong, p); - + /* * Asyncmap must have set at least the bits * which are set in lcp_allowoptions[unit].asyncmap. */ if ((ao->asyncmap & ~cilong) != 0) { - LCPDEBUG(LOG_INFO, ("lcp_reqci: Nak ASYNCMAP %lX missing %lX\n", + LCPDEBUG(LOG_INFO, ("lcp_reqci: Nak ASYNCMAP %lX missing %lX\n", cilong, ao->asyncmap)); orc = CONFNAK; PUTCHAR(CI_ASYNCMAP, nakp); @@ -1354,7 +1354,7 @@ lcp_reqci(fsm *f, break; } GETSHORT(cishort, p); - + /* * Authtype must be UPAP or CHAP. * @@ -1365,7 +1365,7 @@ lcp_reqci(fsm *f, * Whether we end up doing CHAP or UPAP depends then on * the ordering of the CIs in the peer's Configure-Request. */ - + if (cishort == PPP_PAP) { if (ho->neg_chap) { /* we've already accepted CHAP */ LCPDEBUG(LOG_WARNING, ("lcp_reqci: Reject AUTHTYPE PAP already accepted\n")); @@ -1432,7 +1432,7 @@ lcp_reqci(fsm *f, ho->neg_chap = 1; break; } - + /* * We don't recognize the protocol they're asking for. * Nak it with something we're willing to do. @@ -1451,7 +1451,7 @@ lcp_reqci(fsm *f, PUTSHORT(PPP_PAP, nakp); } break; - + case CI_QUALITY: GETSHORT(cishort, p); GETLONG(cilong, p); @@ -1465,7 +1465,7 @@ lcp_reqci(fsm *f, orc = CONFREJ; break; } - + /* * Check the protocol and the reporting period. * XXX When should we Nak this, and what with? @@ -1479,7 +1479,7 @@ lcp_reqci(fsm *f, break; } break; - + case CI_MAGICNUMBER: if (!(ao->neg_magicnumber || go->neg_magicnumber) || cilen != CILEN_LONG) { @@ -1507,8 +1507,8 @@ lcp_reqci(fsm *f, ho->neg_magicnumber = 1; ho->magicnumber = cilong; break; - - + + case CI_PCOMPRESSION: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " PCOMPRESSION"); @@ -1521,7 +1521,7 @@ lcp_reqci(fsm *f, } ho->neg_pcompression = 1; break; - + case CI_ACCOMPRESSION: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " ACCOMPRESSION"); @@ -1534,7 +1534,7 @@ lcp_reqci(fsm *f, } ho->neg_accompression = 1; break; - + case CI_MRRU: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " CI_MRRU"); @@ -1542,7 +1542,7 @@ lcp_reqci(fsm *f, #endif orc = CONFREJ; break; - + case CI_SSNHF: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " CI_SSNHF"); @@ -1550,7 +1550,7 @@ lcp_reqci(fsm *f, #endif orc = CONFREJ; break; - + case CI_EPDISC: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " CI_EPDISC"); @@ -1558,7 +1558,7 @@ lcp_reqci(fsm *f, #endif orc = CONFREJ; break; - + default: #if TRACELCP snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " unknown %d", citype); @@ -1730,7 +1730,7 @@ static void print_string( char *p, int len, void (*printer) (void *, char *, ...), void *arg) { int c; - + printer(arg, "\""); for (; len > 0; --len) { c = *p++; @@ -1897,7 +1897,7 @@ lcp_printpkt( u_char *p, int plen, void (*printer) (void *, char *, ...), void * printer(arg, ">"); } break; - + case TERMACK: case TERMREQ: if (len > 0 && *p >= ' ' && *p < 0x7f) { @@ -1907,7 +1907,7 @@ lcp_printpkt( u_char *p, int plen, void (*printer) (void *, char *, ...), void * len = 0; } break; - + case ECHOREQ: case ECHOREP: case DISCREQ: diff --git a/components/net/lwip-1.4.1/src/netif/ppp/lcp.h b/components/net/lwip-1.4.1/src/netif/ppp/lcp.h index b9201eeb50..92f45bb341 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/lcp.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/lcp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/magic.c b/components/net/lwip-1.4.1/src/netif/ppp/magic.c index 3732a42417..1a9d16dd44 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/magic.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/magic.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/magic.h b/components/net/lwip-1.4.1/src/netif/ppp/magic.h index eba70d20b0..183643947e 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/magic.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/magic.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/md5.c b/components/net/lwip-1.4.1/src/netif/ppp/md5.c index dc3cc751b7..be49f1fc12 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/md5.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/md5.c @@ -141,7 +141,7 @@ MD5Update(MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen) PPPDEBUG(LOG_INFO, ("MD5Update: %u:%.*H\n", inLen, LWIP_MIN(inLen, 20) * 2, inBuf)); PPPDEBUG(LOG_INFO, ("MD5Update: %u:%s\n", inLen, inBuf)); #endif - + /* compute number of bytes mod 64 */ mdi = (int)((mdContext->i[0] >> 3) & 0x3F); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/pap.c b/components/net/lwip-1.4.1/src/netif/ppp/pap.c index 5fb9f886c0..aa806dcac5 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/pap.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/pap.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -214,7 +214,7 @@ upap_timeout(void *arg) { upap_state *u = (upap_state *) arg; - UPAPDEBUG(LOG_INFO, ("upap_timeout: %d timeout %d expired s=%d\n", + UPAPDEBUG(LOG_INFO, ("upap_timeout: %d timeout %d expired s=%d\n", u->us_unit, u->us_timeouttime, u->us_clientstate)); if (u->us_clientstate != UPAPCS_AUTHREQ) { @@ -552,7 +552,7 @@ upap_sauthreq(upap_state *u) u_char *outp; int outlen; - outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + u->us_userlen + u->us_passwdlen; outp = outpacket_buf[u->us_unit]; diff --git a/components/net/lwip-1.4.1/src/netif/ppp/pap.h b/components/net/lwip-1.4.1/src/netif/ppp/pap.h index c99a204019..b48cbac347 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/pap.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/pap.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp.c b/components/net/lwip-1.4.1/src/netif/ppp/ppp.c index 8e8fae9f9f..affc2405d8 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -566,9 +566,9 @@ pppOverSerialOpen(sio_fd_t fd, pppLinkStatusCB_fn linkStatusCB, void *linkStatus vj_compress_init(&pc->vjComp); #endif /* VJ_SUPPORT */ - /* + /* * Default the in and out accm so that escape and flag characters - * are always escaped. + * are always escaped. */ pc->rx.inACCM[15] = 0x60; /* no need to protect since RX is not running */ pc->outACCM[15] = 0x60; @@ -655,7 +655,7 @@ int pppOverEthernetOpen(struct netif *ethif, const char *service_name, const cha #endif /* PPPOE_SUPPORT */ -/* Close a PPP connection and release the descriptor. +/* Close a PPP connection and release the descriptor. * Any outstanding packets in the queues are dropped. * Return 0 on success, an error code on failure. */ int @@ -723,7 +723,7 @@ nPut(PPPControl *pc, struct pbuf *nb) LINK_STATS_INC(link.xmit); } -/* +/* * pppAppend - append given character to end of given pbuf. If outACCM * is not NULL and the character needs to be escaped, do so. * If pbuf is full, append another. @@ -733,7 +733,7 @@ static struct pbuf * pppAppend(u_char c, struct pbuf *nb, ext_accm *outACCM) { struct pbuf *tb = nb; - + /* Make sure there is room for the character and an escape code. * Sure we don't quite fill the buffer if the character doesn't * get escaped but is one character worth complicating this? */ @@ -859,9 +859,9 @@ pppifOutput(struct netif *netif, struct pbuf *pb, ip_addr_t *ipaddr) } #if VJ_SUPPORT - /* + /* * Attempt Van Jacobson header compression if VJ is configured and - * this is an IP packet. + * this is an IP packet. */ if (protocol == PPP_IP && pc->vjEnabled) { switch (vj_compress_tcp(&pc->vjComp, pb)) { @@ -921,7 +921,7 @@ pppifOutput(struct netif *netif, struct pbuf *pb, ip_addr_t *ipaddr) /* Update FCS before checking for special characters. */ fcsOut = PPP_FCS(fcsOut, c); - + /* Copy to output buffer escaping special characters. */ tailMB = pppAppend(c, tailMB, &pc->outACCM); } @@ -937,7 +937,7 @@ pppifOutput(struct netif *netif, struct pbuf *pb, ip_addr_t *ipaddr) /* If we failed to complete the packet, throw it away. */ if (!tailMB) { PPPDEBUG(LOG_WARNING, - ("pppifOutput[%d]: Alloc err - dropping proto=%d\n", + ("pppifOutput[%d]: Alloc err - dropping proto=%d\n", pd, protocol)); pbuf_free(headMB); LINK_STATS_INC(link.memerr); @@ -1114,7 +1114,7 @@ pppWrite(int pd, const u_char *s, int n) /* Copy to output buffer escaping special characters. */ tailMB = pppAppend(c, tailMB, &pc->outACCM); } - + /* Add FCS and trailing flag. */ c = ~fcsOut & 0xFF; tailMB = pppAppend(c, tailMB, &pc->outACCM); @@ -1152,11 +1152,11 @@ ppp_send_config( int unit, u16_t mtu, u32_t asyncmap, int pcomp, int accomp) { PPPControl *pc = &pppControl[unit]; int i; - + pc->mtu = mtu; pc->pcomp = pcomp; pc->accomp = accomp; - + /* Load the ACCM bits for the 32 control codes. */ for (i = 0; i < 32/8; i++) { pc->outACCM[i] = (u_char)((asyncmap >> (8 * i)) & 0xFF); @@ -1277,13 +1277,13 @@ GetMask(u32_t addr) nmask = IP_CLASSA_NET; } else if (IP_CLASSB(addr)) { nmask = IP_CLASSB_NET; - } else { + } else { nmask = IP_CLASSC_NET; } /* class D nets are disallowed by bad_ip_adrs */ mask = subnetMask | htonl(nmask); - + /* XXX * Scan through the system's network interfaces. * Get each netmask and OR them into our mask. @@ -1300,7 +1300,7 @@ sifvjcomp(int pd, int vjcomp, u8_t cidcomp, u8_t maxcid) { #if PPPOS_SUPPORT && VJ_SUPPORT PPPControl *pc = &pppControl[pd]; - + pc->vjEnabled = vjcomp; pc->vjComp.compressSlot = cidcomp; pc->vjComp.maxSlotIndex = maxcid; @@ -1343,7 +1343,7 @@ sifup(int pd) { PPPControl *pc = &pppControl[pd]; int st = 1; - + if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); @@ -1388,7 +1388,7 @@ sifdown(int pd) { PPPControl *pc = &pppControl[pd]; int st = 1; - + if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG(LOG_WARNING, ("sifdown[%d]: bad parms\n", pd)); @@ -1419,7 +1419,7 @@ sifaddr( int pd, u32_t o, u32_t h, u32_t m, u32_t ns1, u32_t ns2) { PPPControl *pc = &pppControl[pd]; int st = 1; - + if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); @@ -1445,7 +1445,7 @@ cifaddr( int pd, u32_t o, u32_t h) { PPPControl *pc = &pppControl[pd]; int st = 1; - + LWIP_UNUSED_ARG(o); LWIP_UNUSED_ARG(h); if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { @@ -1608,7 +1608,7 @@ pppInput(void *arg) pd = ((struct pppInputHeader *)nb->payload)->unit; protocol = ((struct pppInputHeader *)nb->payload)->proto; - + if(pbuf_header(nb, -(int)sizeof(struct pppInputHeader))) { LWIP_ASSERT("pbuf_header failed\n", 0); goto drop; @@ -1667,7 +1667,7 @@ pppInput(void *arg) #else /* PPPOS_SUPPORT && VJ_SUPPORT */ /* No handler for this protocol so drop the packet. */ PPPDEBUG(LOG_INFO, - ("pppInput[%d]: drop VJ UnComp in %d:.*H\n", + ("pppInput[%d]: drop VJ UnComp in %d:.*H\n", pd, nb->len, LWIP_MIN(nb->len * 2, 40), nb->payload)); #endif /* PPPOS_SUPPORT && VJ_SUPPORT */ break; @@ -1809,14 +1809,14 @@ pppInProc(PPPControlRx *pcrx, u_char *s, int l) /* If we haven't received the packet header, drop what has come in. */ } else if (pcrx->inState < PDDATA) { PPPDEBUG(LOG_WARNING, - ("pppInProc[%d]: Dropping incomplete packet %d\n", + ("pppInProc[%d]: Dropping incomplete packet %d\n", pcrx->pd, pcrx->inState)); LINK_STATS_INC(link.lenerr); pppDrop(pcrx); /* If the fcs is invalid, drop the packet. */ } else if (pcrx->inFCS != PPP_GOODFCS) { PPPDEBUG(LOG_INFO, - ("pppInProc[%d]: Dropping bad fcs 0x%"X16_F" proto=0x%"X16_F"\n", + ("pppInProc[%d]: Dropping bad fcs 0x%"X16_F" proto=0x%"X16_F"\n", pcrx->pd, pcrx->inFCS, pcrx->inProtocol)); /* Note: If you get lots of these, check for UART frame errors or try different baud rate */ LINK_STATS_INC(link.chkerr); @@ -2023,7 +2023,7 @@ drop: void ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback) { - netif_set_status_callback(&pppControl[pd].netif, status_callback); + netif_set_status_callback(&pppControl[pd].netif, status_callback); } #endif /* LWIP_NETIF_STATUS_CALLBACK */ @@ -2038,7 +2038,7 @@ ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback) void ppp_set_netif_linkcallback(int pd, netif_status_callback_fn link_callback) { - netif_set_link_callback(&pppControl[pd].netif, link_callback); + netif_set_link_callback(&pppControl[pd].netif, link_callback); } #endif /* LWIP_NETIF_LINK_CALLBACK */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp.h b/components/net/lwip-1.4.1/src/netif/ppp/ppp.h index 08d6e62d87..7866478d9a 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -138,7 +138,7 @@ typedef void (*pppLinkStatusCB_fn)(void *ctx, int errCode, void *arg); * This initializes the PPP control block but does not * attempt to negotiate the LCP session. * Return a new PPP connection descriptor on success or - * an error code (negative) on failure. + * an error code (negative) on failure. */ int pppOverSerialOpen(sio_fd_t fd, pppLinkStatusCB_fn linkStatusCB, void *linkStatusCtx); #endif /* PPPOS_SUPPORT */ @@ -155,9 +155,9 @@ int pppOverEthernetOpen(struct netif *ethif, const char *service_name, const cha #define pppOpen(fd,cb,ls) pppOverSerialOpen(fd,cb,ls) /* - * Close a PPP connection and release the descriptor. + * Close a PPP connection and release the descriptor. * Any outstanding packets in the queues are dropped. - * Return 0 on success, an error code on failure. + * Return 0 on success, an error code on failure. */ int pppClose(int pd); @@ -168,7 +168,7 @@ void pppSigHUP(int pd); /* * Get and set parameters for the given connection. - * Return 0 on success, an error code on failure. + * Return 0 on success, an error code on failure. */ int pppIOCtl(int pd, int cmd, void *arg); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h b/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h index 89aea60be1..14bac5d811 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -356,7 +356,7 @@ int sifdefaultroute (int, u32_t, u32_t); int cifdefaultroute (int, u32_t, u32_t); /* Get appropriate netmask for address */ -u32_t GetMask (u32_t); +u32_t GetMask (u32_t); #endif /* PPP_SUPPORT */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c b/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c index 35d192e412..414e058fb3 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -575,7 +575,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } pb = pppSingleBuf (pb); @@ -615,7 +615,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header PPPOE_HEADERLEN failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, @@ -1071,7 +1071,7 @@ pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb) LINK_STATS_INC(link.lenerr); pbuf_free(pb); return ERR_BUF; - } + } p = (u8_t*)pb->payload + sizeof(struct eth_hdr); PPPOE_ADD_HEADER(p, 0, sc->sc_session, len); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h b/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h index 81349971db..15c113ec6d 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/randm.c b/components/net/lwip-1.4.1/src/netif/ppp/randm.c index b736091fc5..94dc49494d 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/randm.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/randm.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -233,7 +233,7 @@ avRandomize(void) * Return a new random number. * Here we use the Borland rand() function to supply a pseudo random * number which we make truely random by combining it with our own - * seed which is randomized by truely random events. + * seed which is randomized by truely random events. * Thus the numbers will be truely random unless there have been no * operator or network events in which case it will be pseudo random * seeded by the real time clock. diff --git a/components/net/lwip-1.4.1/src/netif/ppp/randm.h b/components/net/lwip-1.4.1/src/netif/ppp/randm.h index a0984b0202..468f001626 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/randm.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/randm.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/vj.c b/components/net/lwip-1.4.1/src/netif/ppp/vj.c index 40fdad13d0..eaa4617fda 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/vj.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/vj.c @@ -52,7 +52,7 @@ vj_compress_init(struct vjcompress *comp) { register u_char i; register struct cstate *tstate = comp->tstate; - + #if MAX_SLOTS == 0 memset((char *)comp, 0, sizeof(*comp)); #endif @@ -148,7 +148,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) u_char new_seq[16]; register u_char *cp = new_seq; - /* + /* * Check that the packet is IP proto TCP. */ if (IPH_PROTO(ip) != IP_PROTO_TCP) { @@ -158,7 +158,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) /* * Bail if this is an IP fragment or if the TCP packet isn't * `compressible' (i.e., ACK isn't set or some other control bit is - * set). + * set). */ if ((IPH_OFFSET(ip) & PP_HTONS(0x3fff)) || pb->tot_len < 40) { return (TYPE_IP); @@ -192,7 +192,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) */ register struct cstate *lcs; register struct cstate *lastcs = comp->last_cs; - + do { lcs = cs; cs = cs->cs_next; INCR(vjs_searches); @@ -255,11 +255,11 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) * different between the previous & current datagram, we send the * current datagram `uncompressed'. */ - if (((u_short *)ip)[0] != ((u_short *)&cs->cs_ip)[0] - || ((u_short *)ip)[3] != ((u_short *)&cs->cs_ip)[3] - || ((u_short *)ip)[4] != ((u_short *)&cs->cs_ip)[4] - || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth) - || (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) + if (((u_short *)ip)[0] != ((u_short *)&cs->cs_ip)[0] + || ((u_short *)ip)[3] != ((u_short *)&cs->cs_ip)[3] + || ((u_short *)ip)[4] != ((u_short *)&cs->cs_ip)[4] + || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth) + || (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || (TCPH_HDRLEN(th) > 5 && BCMP(th + 1, oth + 1, (TCPH_HDRLEN(th) - 5) << 2))) { goto uncompressed; } @@ -429,7 +429,7 @@ vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) register u_int hlen; register struct cstate *cs; register struct ip_hdr *ip; - + ip = (struct ip_hdr *)nb->payload; hlen = IPH_HL(ip) << 2; if (IPH_PROTO(ip) >= MAX_SLOTS @@ -437,7 +437,7 @@ vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) || (hlen += TCPH_HDRLEN(((struct tcp_hdr *)&((char *)ip)[hlen])) << 2) > nb->len || hlen > MAX_HDR) { - PPPDEBUG(LOG_INFO, ("vj_uncompress_uncomp: bad cid=%d, hlen=%d buflen=%d\n", + PPPDEBUG(LOG_INFO, ("vj_uncompress_uncomp: bad cid=%d, hlen=%d buflen=%d\n", IPH_PROTO(ip), hlen, nb->len)); comp->flags |= VJF_TOSS; INCR(vjs_errorin); @@ -456,7 +456,7 @@ vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) * Uncompress a packet of type TYPE_COMPRESSED_TCP. * The packet is composed of a buffer chain and the first buffer * must contain an accurate chain length. - * The first buffer must include the entire compressed TCP/IP header. + * The first buffer must include the entire compressed TCP/IP header. * This procedure replaces the compressed header with the uncompressed * header and returns the length of the VJ header. */ @@ -475,9 +475,9 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) cp = (u_char *)n0->payload; changes = *cp++; if (changes & NEW_C) { - /* + /* * Make sure the state index is in range, then grab the state. - * If we have a good state index, clear the 'discard' flag. + * If we have a good state index, clear the 'discard' flag. */ if (*cp >= MAX_SLOTS) { PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: bad cid=%d\n", *cp)); @@ -487,10 +487,10 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) comp->flags &=~ VJF_TOSS; comp->last_recv = *cp++; } else { - /* + /* * this packet has an implicit state index. If we've * had a line error since the last time we got an - * explicit state index, we have to toss the packet. + * explicit state index, we have to toss the packet. */ if (comp->flags & VJF_TOSS) { PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: tossing\n")); @@ -559,11 +559,11 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) */ vjlen = (u_short)(cp - (u_char*)n0->payload); if (n0->len < vjlen) { - /* + /* * We must have dropped some characters (crc should detect - * this but the old slip framing won't) + * this but the old slip framing won't) */ - PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: head buffer %d too short %d\n", + PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: head buffer %d too short %d\n", n0->len, vjlen)); goto bad; } @@ -584,7 +584,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) tmp = (tmp & 0xffff) + (tmp >> 16); tmp = (tmp & 0xffff) + (tmp >> 16); IPH_CHKSUM_SET(&cs->cs_ip, (u_short)(~tmp)); - + /* Remove the compressed header and prepend the uncompressed header. */ if(pbuf_header(n0, -((s16_t)(vjlen)))) { /* Can we cope with this failing? Just assert for now */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/vj.h b/components/net/lwip-1.4.1/src/netif/ppp/vj.h index fad1213646..139297d32e 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/vj.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/vj.h @@ -43,7 +43,7 @@ * sequence number changes, one change per bit set in the header * (there may be no changes and there are two special cases where * the receiver implicitly knows what changed -- see below). - * + * * There are 5 numbers which can change (they are always inserted * in the following order): TCP urgent pointer, window, * acknowlegement, sequence number and IP ID. (The urgent pointer diff --git a/components/net/lwip-1.4.1/src/netif/slipif.c b/components/net/lwip-1.4.1/src/netif/slipif.c index 2777630902..a7301430e1 100644 --- a/components/net/lwip-1.4.1/src/netif/slipif.c +++ b/components/net/lwip-1.4.1/src/netif/slipif.c @@ -6,35 +6,35 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is built upon the file: src/arch/rtxc/netif/sioslip.c * - * Author: Magnus Ivarsson + * Author: Magnus Ivarsson * Simon Goldschmidt * * Usage: This netif can be used in three ways: @@ -47,10 +47,10 @@ * packets and puts completed packets on a queue which is fed into * the stack from the main loop (needs SYS_LIGHTWEIGHT_PROT for * pbuf_alloc to work on ISR level!). - * + * */ -/* +/* * This is an arch independent SLIP netif. The specific serial hooks must be * provided by another file. They are sio_open, sio_read/sio_tryread and sio_send */ diff --git a/components/net/lwip-1.4.1/test/unit/lwipopts.h b/components/net/lwip-1.4.1/test/unit/lwipopts.h index 88e76d7a56..5d60cf0819 100644 --- a/components/net/lwip-1.4.1/test/unit/lwipopts.h +++ b/components/net/lwip-1.4.1/test/unit/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c b/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c index 6fd5be5068..51ef5a8f22 100644 --- a/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c +++ b/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c @@ -207,7 +207,7 @@ START_TEST(test_tcp_fast_retx_recover) EXPECT_RET(pcb->dupacks == 3); memset(&txcounters, 0, sizeof(txcounters)); /* TODO: check expected data?*/ - + /* send data5, not output yet */ err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); EXPECT_RET(err == ERR_OK); diff --git a/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c b/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c index f5c6c10b61..ff59788889 100644 --- a/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c +++ b/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c @@ -72,7 +72,7 @@ void main(void) netif_set_status_callback(&netif, netif_status_callback); netif_set_default(&netif); netif_set_up(&netif); - + /* Start DHCP and HTTPD */ dhcp_init(); httpd_init(); @@ -94,7 +94,7 @@ void main(void) if(p != NULL) { LINK_STATS_INC(link.recv); - + /* Update SNMP stats (only if you use SNMP) */ MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len); int unicast = ((p->payload[0] & 0x01) == 0); @@ -108,10 +108,10 @@ void main(void) pbuf_free(p); } } - + /* Cyclic lwIP timers check */ sys_check_timeouts(); - + /* your application goes here */ } } diff --git a/components/net/lwip-2.0.2/doc/doxygen/main_page.h b/components/net/lwip-2.0.2/doc/doxygen/main_page.h index d35d16e1c9..684a5111b1 100644 --- a/components/net/lwip-2.0.2/doc/doxygen/main_page.h +++ b/components/net/lwip-2.0.2/doc/doxygen/main_page.h @@ -1,4 +1,4 @@ -/** +/** * @defgroup lwip lwIP * * @defgroup infrastructure Infrastructure @@ -6,13 +6,13 @@ * @defgroup callbackstyle_api Callback-style APIs * Non thread-safe APIs, callback style for maximum performance and minimum * memory footprint. - * + * * @defgroup sequential_api Sequential-style APIs * Sequential-style APIs, blocking functions. More overhead, but can be called * from any thread except TCPIP thread. - * + * * @defgroup addons Addons - * + * * @defgroup apps Applications */ @@ -44,19 +44,19 @@ * * The most common source of lwIP problems is to have multiple execution contexts * inside the lwIP code. - * - * lwIP can be used in two basic modes: @ref lwip_nosys (no OS/RTOS + * + * lwIP can be used in two basic modes: @ref lwip_nosys (no OS/RTOS * running on target system) or @ref lwip_os (there is an OS running * on the target system). * * Mainloop Mode * ------------- * In mainloop mode, only @ref callbackstyle_api can be used. - * The user has two possibilities to ensure there is only one + * The user has two possibilities to ensure there is only one * exection context at a time in lwIP: * * 1) Deliver RX ethernet packets directly in interrupt context to lwIP - * by calling netif->input directly in interrupt. This implies all lwIP + * by calling netif->input directly in interrupt. This implies all lwIP * callback functions are called in IRQ context, which may cause further * problems in application code: IRQ is blocked for a long time, multiple * execution contexts in application code etc. When the application wants @@ -82,7 +82,7 @@ * implemented in tcpip_input().​​ * Again, ensure lwIP is _NEVER_ called from an interrupt, e.g. * some SPI IRQ wants to forward data to udp_send() or tcp_write()! - * + * * 1) tcpip_callback() can be used get called back from TCPIP thread, * it is safe to call any @ref callbackstyle_api from there. * @@ -108,7 +108,7 @@ * *not* *from* *interrupt* *context*. You can allocate a @ref pbuf in interrupt * context and put them into a queue which is processed from mainloop.\n * Call sys_check_timeouts() periodically in the mainloop.\n - * Porting: implement all functions in @ref sys_time, @ref sys_prot and + * Porting: implement all functions in @ref sys_time, @ref sys_prot and * @ref compiler_abstraction.\n * You can only use @ref callbackstyle_api in this mode.\n * Sample code:\n @@ -130,3 +130,4 @@ * @page raw_api lwIP API * @verbinclude "rawapi.txt" */ +/ diff --git a/components/net/lwip-2.0.2/src/api/api_lib.c b/components/net/lwip-2.0.2/src/api/api_lib.c index 7d9c12768d..85e62ea9fd 100644 --- a/components/net/lwip-2.0.2/src/api/api_lib.c +++ b/components/net/lwip-2.0.2/src/api/api_lib.c @@ -1,21 +1,21 @@ /** * @file * Sequential API External module - * + * * @defgroup netconn Netconn API * @ingroup sequential_api * Thread-safe, to be called from non-TCPIP threads only. * TX/RX handling based on @ref netbuf (containing @ref pbuf) * to avoid copying data around. - * + * * @defgroup netconn_common Common functions * @ingroup netconn * For use with TCP and UDP - * + * * @defgroup netconn_tcp TCP only * @ingroup netconn * TCP only functions - * + * * @defgroup netconn_udp UDP only * @ingroup netconn * UDP only functions @@ -241,7 +241,7 @@ netconn_getaddr(struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local) * Binding one netconn twice might not always be checked correctly! * * @param conn the netconn to bind - * @param addr the local IP address to bind the netconn to + * @param addr the local IP address to bind the netconn to * (use IP4_ADDR_ANY/IP6_ADDR_ANY to bind to all addresses) * @param port the local port to bind the netconn to (not used for RAW) * @return ERR_OK if bound, any other err_t on failure @@ -251,7 +251,7 @@ netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port) { API_MSG_VAR_DECLARE(msg); err_t err; - + LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;); #if LWIP_IPV4 @@ -260,7 +260,7 @@ netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port) addr = IP4_ADDR_ANY; } #endif /* LWIP_IPV4 */ - + #if LWIP_IPV4 && LWIP_IPV6 /* "Socket API like" dual-stack support: If IP to bind to is IP6_ADDR_ANY, * and NETCONN_FLAG_IPV6_V6ONLY is 0, use IP_ANY_TYPE to bind diff --git a/components/net/lwip-2.0.2/src/api/api_msg.c b/components/net/lwip-2.0.2/src/api/api_msg.c index dd99c1e01b..caef885f40 100644 --- a/components/net/lwip-2.0.2/src/api/api_msg.c +++ b/components/net/lwip-2.0.2/src/api/api_msg.c @@ -548,14 +548,14 @@ pcb_new(struct api_msg *msg) enum lwip_ip_addr_type iptype = IPADDR_TYPE_V4; LWIP_ASSERT("pcb_new: pcb already allocated", msg->conn->pcb.tcp == NULL); - + #if LWIP_IPV6 && LWIP_IPV4 /* IPv6: Dual-stack by default, unless netconn_set_ipv6only() is called */ if(NETCONNTYPE_ISIPV6(netconn_type(msg->conn))) { iptype = IPADDR_TYPE_ANY; } #endif - + /* Allocate a PCB for this connection */ switch(NETCONNTYPE_GROUP(msg->conn->type)) { #if LWIP_RAW diff --git a/components/net/lwip-2.0.2/src/api/netifapi.c b/components/net/lwip-2.0.2/src/api/netifapi.c index fef05a34dc..3215d4e9cd 100644 --- a/components/net/lwip-2.0.2/src/api/netifapi.c +++ b/components/net/lwip-2.0.2/src/api/netifapi.c @@ -5,10 +5,10 @@ * @defgroup netifapi NETIF API * @ingroup sequential_api * Thread-safe functions to be called from non-TCPIP threads - * + * * @defgroup netifapi_netif NETIF related * @ingroup netifapi - * To be called from non-TCPIP threads + * To be called from non-TCPIP threads */ /* @@ -57,10 +57,10 @@ static err_t netifapi_do_netif_add(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; - + if (!netif_add( msg->netif, #if LWIP_IPV4 API_EXPR_REF(msg->msg.add.ipaddr), @@ -83,7 +83,7 @@ netifapi_do_netif_add(struct tcpip_api_call_data *m) static err_t netifapi_do_netif_set_addr(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; @@ -102,7 +102,7 @@ netifapi_do_netif_set_addr(struct tcpip_api_call_data *m) static err_t netifapi_do_netif_common(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; diff --git a/components/net/lwip-2.0.2/src/api/sockets.c b/components/net/lwip-2.0.2/src/api/sockets.c index dc2477b611..e7c8413c9e 100644 --- a/components/net/lwip-2.0.2/src/api/sockets.c +++ b/components/net/lwip-2.0.2/src/api/sockets.c @@ -407,7 +407,7 @@ tryget_socket(int s) struct lwip_sock * lwip_tryget_socket(int s) { - return tryget_socket(s); + return tryget_socket(s); } /** diff --git a/components/net/lwip-2.0.2/src/api/tcpip.c b/components/net/lwip-2.0.2/src/api/tcpip.c index 07b2f98434..7d59f6f55f 100644 --- a/components/net/lwip-2.0.2/src/api/tcpip.c +++ b/components/net/lwip-2.0.2/src/api/tcpip.c @@ -354,7 +354,7 @@ tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem) /** * Synchronously calls function in TCPIP thread and waits for its completion. * It is recommended to use LWIP_TCPIP_CORE_LOCKING (preferred) or - * LWIP_NETCONN_SEM_PER_THREAD. + * LWIP_NETCONN_SEM_PER_THREAD. * If not, a semaphore is created and destroyed on every call which is usually * an expensive/slow operation. * @param fn Function to call diff --git a/components/net/lwip-2.0.2/src/apps/httpd/fs.c b/components/net/lwip-2.0.2/src/apps/httpd/fs.c index 35b5e31038..1afb5f61e2 100644 --- a/components/net/lwip-2.0.2/src/apps/httpd/fs.c +++ b/components/net/lwip-2.0.2/src/apps/httpd/fs.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h b/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h index ac4548c785..1bee2d00fa 100644 --- a/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h +++ b/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.0.2/src/apps/httpd/httpd.c b/components/net/lwip-2.0.2/src/apps/httpd/httpd.c index 43195d7c54..83ff1d2bc2 100644 --- a/components/net/lwip-2.0.2/src/apps/httpd/httpd.c +++ b/components/net/lwip-2.0.2/src/apps/httpd/httpd.c @@ -548,7 +548,7 @@ http_write(struct tcp_pcb *pcb, const void* ptr, u16_t *length, u8_t apiflags) } else { len /= 2; } - LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Send failed, trying less (%d bytes)\n", len)); } } while ((err == ERR_MEM) && (len > 1)); @@ -871,7 +871,7 @@ get_http_headers(struct http_state *hs, const char *uri) hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_OK]; } - /* Determine if the URI has any variables and, if so, temporarily remove + /* Determine if the URI has any variables and, if so, temporarily remove them. */ vars = strchr(uri, '?'); if(vars) { diff --git a/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c b/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c index efabe478e3..0256555154 100644 --- a/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c +++ b/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c @@ -566,7 +566,7 @@ lwiperf_tcp_accept(void *arg, struct tcp_pcb *newpcb, err_t err) return ERR_OK; } -/** +/** * @ingroup iperf * Start a TCP iperf server on the default TCP port (5001) and listen for * incoming connections from iperf clients. diff --git a/components/net/lwip-2.0.2/src/apps/mdns/mdns.c b/components/net/lwip-2.0.2/src/apps/mdns/mdns.c index 14334fc856..1fdf607236 100644 --- a/components/net/lwip-2.0.2/src/apps/mdns/mdns.c +++ b/components/net/lwip-2.0.2/src/apps/mdns/mdns.c @@ -7,9 +7,9 @@ * * RFC 6762 - Multicast DNS\n * RFC 6763 - DNS-Based Service Discovery\n - * + * * @verbinclude mdns.txt - * + * * Things left to implement: * ------------------------- * diff --git a/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c b/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c index a0e77b9719..61c83fe37d 100644 --- a/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c +++ b/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c @@ -142,7 +142,7 @@ static const char * const mqtt_message_type_str[15] = /** * Message type value to string * @param msg_type see enum mqtt_message_type - * + * * @return Control message type text string */ static const char * diff --git a/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c b/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c index 2dfbe65901..3aa9505e34 100644 --- a/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c +++ b/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c @@ -315,7 +315,7 @@ netbiosns_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t } /** - * @ingroup netbiosns + * @ingroup netbiosns * Init netbios responder */ void @@ -336,7 +336,7 @@ netbiosns_init(void) #ifndef NETBIOS_LWIP_NAME /** - * @ingroup netbiosns + * @ingroup netbiosns * Set netbios name. ATTENTION: the hostname must be less than 15 characters! */ void @@ -352,7 +352,7 @@ netbiosns_set_name(const char* hostname) #endif /** - * @ingroup netbiosns + * @ingroup netbiosns * Stop netbios responder */ void diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c index c041833617..3fe28490c3 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c @@ -48,7 +48,7 @@ * * 0 Agent Capabilities * ==================== - * + * * Features: * --------- * - SNMPv2c support. @@ -66,7 +66,7 @@ * - Simplified thread sync support for MIBs - useful when MIBs * need to access variables shared with other threads where no locking is * possible. Used in MIB2 to access lwIP stats from lwIP thread. - * + * * MIB compiler (code generator): * ------------------------------ * - Provided in lwIP contrib repository. @@ -78,92 +78,92 @@ * - MIB parser, C file generation framework and LWIP code generation are cleanly * separated, which means the code may be useful as a base for code generation * of other SNMP agents. - * + * * Notes: * ------ * - Stack and MIB compiler were used to implement a Profinet device. * Compiled/implemented MIBs: LLDP-MIB, LLDP-EXT-DOT3-MIB, LLDP-EXT-PNO-MIB. - * + * * SNMPv1 per RFC1157 and SNMPv2c per RFC 3416 * ------------------------------------------- * Note the S in SNMP stands for "Simple". Note that "Simple" is * relative. SNMP is simple compared to the complex ISO network * management protocols CMIP (Common Management Information Protocol) * and CMOT (CMip Over Tcp). - * + * * MIB II * ------ * The standard lwIP stack management information base. * This is a required MIB, so this is always enabled. * The groups EGP, CMOT and transmission are disabled by default. - * + * * Most mib-2 objects are not writable except: * sysName, sysLocation, sysContact, snmpEnableAuthenTraps. * Writing to or changing the ARP and IP address and route * tables is not possible. - * + * * Note lwIP has a very limited notion of IP routing. It currently * doen't have a route table and doesn't have a notion of the U,G,H flags. * Instead lwIP uses the interface list with only one default interface * acting as a single gateway interface (G) for the default route. - * + * * The agent returns a "virtual table" with the default route 0.0.0.0 * for the default interface and network routes (no H) for each * network interface in the netif_list. * All routes are considered to be up (U). - * + * * Loading additional MIBs * ----------------------- * MIBs can only be added in compile-time, not in run-time. - * - * + * + * * 1 Building the Agent * ==================== * First of all you'll need to add the following define * to your local lwipopts.h: * \#define LWIP_SNMP 1 - * + * * and add the source files your makefile. - * + * * Note you'll might need to adapt you network driver to update * the mib2 variables for your interface. - * + * * 2 Running the Agent * =================== * The following function calls must be made in your program to * actually get the SNMP agent running. - * + * * Before starting the agent you should supply pointers * for sysContact, sysLocation, and snmpEnableAuthenTraps. * You can do this by calling - * + * * - snmp_mib2_set_syscontact() * - snmp_mib2_set_syslocation() * - snmp_set_auth_traps_enabled() - * - * You can register a callback which is called on successful write access: + * + * You can register a callback which is called on successful write access: * snmp_set_write_callback(). - * + * * Additionally you may want to set - * + * * - snmp_mib2_set_sysdescr() * - snmp_set_device_enterprise_oid() * - snmp_mib2_set_sysname() - * + * * Also before starting the agent you need to setup * one or more trap destinations using these calls: - * + * * - snmp_trap_dst_enable() * - snmp_trap_dst_ip_set() - * + * * If you need more than MIB2, set the MIBs you want to use * by snmp_set_mibs(). - * + * * Finally, enable the agent by calling snmp_init() * * @defgroup snmp_core Core * @ingroup snmp - * + * * @defgroup snmp_traps Traps * @ingroup snmp */ @@ -232,7 +232,7 @@ snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs) * The 'device enterprise oid' shall point to an OID located under 'private-enterprises' branch (1.3.6.1.4.1.XXX). If a vendor * wants to provide a custom object there, he has to get its own enterprise oid from IANA (http://www.iana.org). It * is not allowed to use LWIP enterprise ID! - * In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own + * In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own * enterprise oid. * e.g. * device a > 1.3.6.1.4.1.XXX(ent-oid).1(devices).1(device a) @@ -250,7 +250,7 @@ void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_ /** * @ingroup snmp_core - * Get 'device enterprise oid' + * Get 'device enterprise oid' */ const struct snmp_obj_id* snmp_get_device_enterprise_oid(void) { @@ -521,7 +521,7 @@ snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port) /** * Assign an OID to struct snmp_obj_id - * @param target Assignment target + * @param target Assignment target * @param oid OID * @param oid_len OID length */ @@ -906,7 +906,7 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida /* we found a suitable next node, now we have to check if a inner MIB is located between the searched OID and the resulting OID. - this is possible because MIB's may be located anywhere in the global tree, that means also in + this is possible because MIB's may be located anywhere in the global tree, that means also in the subtree of another MIB (e.g. if searched OID is .2 and resulting OID is .4, then another MIB having .3 as root node may exist) */ diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c index 90e57805d2..157902033b 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c @@ -351,7 +351,7 @@ system_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void /* no need to check size of target buffer, this was already done in set_test method */ LWIP_ASSERT("", var_wr != NULL); MEMCPY(var_wr, value, len); - + if (var_wr_len == NULL) { /* add terminating 0 */ var_wr[len] = 0; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c index 6a983df20b..7db2204d6f 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c @@ -135,7 +135,7 @@ udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t if (row_oid[idx] != 0) { return SNMP_ERR_NOSUCHINSTANCE; } - + /* find udp_pcb with requested ip and port*/ pcb = udp_pcbs; while (pcb != NULL) { @@ -153,7 +153,7 @@ udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t return SNMP_ERR_NOSUCHINSTANCE; } -static snmp_err_t +static snmp_err_t udp_endpointTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) { struct udp_pcb *pcb; @@ -181,12 +181,12 @@ udp_endpointTable_get_next_cell_instance_and_value(const u32_t* column, struct s /* udpEndpointRemoteAddressType + udpEndpointRemoteAddress + udpEndpointRemotePort */ idx += snmp_ip_port_to_oid(&pcb->remote_ip, pcb->remote_port, &test_oid[idx]); - test_oid[idx] = 0; /* udpEndpointInstance */ + test_oid[idx] = 0; /* udpEndpointInstance */ idx++; - + /* check generated OID: is it a candidate for the next one? */ snmp_next_oid_check(&state, test_oid, idx, NULL); - + pcb = pcb->next; } @@ -214,7 +214,7 @@ static const struct snmp_oid_range udp_Table_oid_ranges[] = { { 1, 0xffff } /* Port */ }; -static snmp_err_t +static snmp_err_t udp_Table_get_cell_value_core(struct udp_pcb *pcb, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) { LWIP_UNUSED_ARG(value_len); @@ -235,7 +235,7 @@ udp_Table_get_cell_value_core(struct udp_pcb *pcb, const u32_t* column, union sn return SNMP_ERR_NOERROR; } -static snmp_err_t +static snmp_err_t udp_Table_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) { ip4_addr_t ip; @@ -267,7 +267,7 @@ udp_Table_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid return SNMP_ERR_NOSUCHINSTANCE; } -static snmp_err_t +static snmp_err_t udp_Table_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) { struct udp_pcb *pcb; @@ -289,7 +289,7 @@ udp_Table_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_ /* check generated OID: is it a candidate for the next one? */ snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(udp_Table_oid_ranges), pcb); } - + pcb = pcb->next; } @@ -322,13 +322,13 @@ static const struct snmp_table_simple_node udp_Table = SNMP_TABLE_CREATE_SIMPLE( #endif /* LWIP_IPV4 */ static const struct snmp_table_simple_col_def udp_endpointTable_columns[] = { - /* all items except udpEndpointProcess are declared as not-accessible */ + /* all items except udpEndpointProcess are declared as not-accessible */ { 8, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* udpEndpointProcess */ }; static const struct snmp_table_simple_node udp_endpointTable = SNMP_TABLE_CREATE_SIMPLE(7, udp_endpointTable_columns, udp_endpointTable_get_cell_value, udp_endpointTable_get_next_cell_instance_and_value); -/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ +/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ CREATE_LWIP_SYNC_NODE(1, udp_inDatagrams) CREATE_LWIP_SYNC_NODE(2, udp_noPorts) CREATE_LWIP_SYNC_NODE(3, udp_inErrors) diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c index 0cb7ca997c..1485d7069f 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c @@ -149,7 +149,7 @@ snmp_set_community_trap(const char * const community) * @ingroup snmp_core * Callback fired on every successful write access */ -void +void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg) { snmp_write_callback = write_callback; @@ -180,7 +180,7 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por { err_t err; struct snmp_request request; - + memset(&request, 0, sizeof(request)); request.handle = handle; request.source_ip = source_ip; @@ -209,12 +209,12 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por if (err == ERR_OK) { err = snmp_complete_outbound_frame(&request); - + if (err == ERR_OK) { err = snmp_sendto(request.handle, request.outbound_pbuf, request.source_ip, request.source_port); - if ((request.request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) - && (request.error_status == SNMP_ERR_NOERROR) + if ((request.request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) + && (request.error_status == SNMP_ERR_NOERROR) && (snmp_write_callback != NULL)) { /* raise write notification for all written objects */ snmp_execute_write_callbacks(&request); @@ -222,7 +222,7 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por } } } - + if (request.outbound_pbuf != NULL) { pbuf_free(request.outbound_pbuf); } @@ -244,7 +244,7 @@ snmp_msg_getnext_validate_node_inst(struct snmp_node_instance* node_instance, vo return SNMP_ERR_NOERROR; } -static void +static void snmp_process_varbind(struct snmp_request *request, struct snmp_varbind *vb, u8_t get_next) { err_t err; @@ -388,7 +388,7 @@ snmp_process_getnext_request(struct snmp_request *request) request->error_status = SNMP_ERR_GENERROR; } } - + return ERR_OK; } @@ -447,7 +447,7 @@ snmp_process_getbulk_request(struct snmp_request *request) while ((request->error_status == SNMP_ERR_NOERROR) && (repetitions > 0) && (request->outbound_pbuf_stream.offset != repetition_offset)) { u8_t all_endofmibview = 1; - + snmp_vb_enumerator_init(&repetition_varbind_enumerator, request->outbound_pbuf, repetition_offset, request->outbound_pbuf_stream.offset - repetition_offset); repetition_offset = request->outbound_pbuf_stream.offset; /* for next loop */ @@ -478,7 +478,7 @@ snmp_process_getbulk_request(struct snmp_request *request) /* stop when all varbinds in a loop return EndOfMibView */ break; } - + repetitions--; } @@ -510,7 +510,7 @@ snmp_process_set_request(struct snmp_request *request) if (err == SNMP_VB_ENUMERATOR_ERR_OK) { struct snmp_node_instance node_instance; memset(&node_instance, 0, sizeof(node_instance)); - + request->error_status = snmp_get_node_instance_from_oid(vb.oid.id, vb.oid.len, &node_instance); if (request->error_status == SNMP_ERR_NOERROR) { if (node_instance.asn1_type != vb.type) { @@ -617,7 +617,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) err_t err; IF_PARSE_EXEC(snmp_pbuf_stream_init(&pbuf_stream, request->inbound_pbuf, 0, request->inbound_pbuf->tot_len)); - + /* decode main container consisting of version, community and PDU */ IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); IF_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len == pbuf_stream.length)); @@ -628,7 +628,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); IF_PARSE_ASSERT(parent_tlv_value_len > 0); - + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); if ((s32_value != SNMP_VERSION_1) && (s32_value != SNMP_VERSION_2c) @@ -921,7 +921,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) snmp_authfail_trap(); return ERR_ARG; } - } else { + } else { if (strncmp(snmp_community, (const char*)request->community, SNMP_MAX_COMMUNITY_STR_LEN) != 0) { /* community name does not match */ snmp_stats.inbadcommunitynames++; @@ -929,13 +929,13 @@ snmp_parse_inbound_frame(struct snmp_request *request) return ERR_ARG; } } - + /* decode request ID */ IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); IF_PARSE_ASSERT(parent_tlv_value_len > 0); - + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->request_id)); /* decode error status / non-repeaters */ @@ -976,7 +976,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) /* decode varbind-list type (next container level) */ IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); IF_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len <= pbuf_stream.length)); - + request->inbound_varbind_offset = pbuf_stream.offset; request->inbound_varbind_len = pbuf_stream.length - request->inbound_padding_len; snmp_vb_enumerator_init(&(request->inbound_varbind_enumerator), request->inbound_pbuf, request->inbound_varbind_offset, request->inbound_varbind_len); @@ -1327,8 +1327,8 @@ snmp_complete_outbound_frame(struct snmp_request *request) if (request->error_status != SNMP_ERR_NOERROR) { /* map v2c error codes to v1 compliant error code (according to RFC 2089) */ switch (request->error_status) { - /* mapping of implementation specific "virtual" error codes - * (during processing of frame we already stored them in error_status field, + /* mapping of implementation specific "virtual" error codes + * (during processing of frame we already stored them in error_status field, * so no need to check all varbinds here for those exceptions as suggested by RFC) */ case SNMP_ERR_NOSUCHINSTANCE: case SNMP_ERR_NOSUCHOBJECT: @@ -1549,7 +1549,7 @@ snmp_complete_outbound_frame(struct snmp_request *request) return ERR_OK; } -static void +static void snmp_execute_write_callbacks(struct snmp_request *request) { struct snmp_varbind_enumerator inbound_varbind_enumerator; @@ -1584,7 +1584,7 @@ snmp_vb_enumerator_get_next(struct snmp_varbind_enumerator* enumerator, struct s struct snmp_asn1_tlv tlv; u16_t varbind_len; err_t err; - + if (enumerator->pbuf_stream.length == 0) { return SNMP_VB_ENUMERATOR_ERR_EOVB; @@ -1599,7 +1599,7 @@ snmp_vb_enumerator_get_next(struct snmp_varbind_enumerator* enumerator, struct s /* decode varbind name (object id) */ VB_PARSE_EXEC(snmp_asn1_dec_tlv(&(enumerator->pbuf_stream), &tlv)); VB_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_OBJECT_ID) && (SNMP_ASN1_TLV_LENGTH(tlv) < varbind_len) && (tlv.value_len < enumerator->pbuf_stream.length)); - + VB_PARSE_EXEC(snmp_asn1_dec_oid(&(enumerator->pbuf_stream), tlv.value_len, varbind->oid.id, &(varbind->oid.len), SNMP_MAX_OBJ_ID_LEN)); varbind_len -= SNMP_ASN1_TLV_LENGTH(tlv); diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h index 2d01ef36eb..0c27b45868 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h @@ -115,7 +115,7 @@ struct snmp_request s32_t non_repeaters; /* max-repetitions (getBulkRequest (SNMPv2c)) */ s32_t max_repetitions; - + #if LWIP_SNMP_V3 s32_t msg_id; s32_t msg_max_size; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c index 24c3e26531..1b406ef9d7 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c @@ -51,7 +51,7 @@ snmp_netconn_thread(void *arg) struct netbuf *buf; err_t err; LWIP_UNUSED_ARG(arg); - + /* Bind to SNMP port with default IP address */ #if LWIP_IPV6 conn = netconn_new(NETCONN_UDP_IPV6); @@ -61,7 +61,7 @@ snmp_netconn_thread(void *arg) netconn_bind(conn, IP4_ADDR_ANY, SNMP_IN_PORT); #endif /* LWIP_IPV6 */ LWIP_ERROR("snmp_netconn: invalid conn", (conn != NULL), return;); - + snmp_traps_handle = conn; do { @@ -77,16 +77,16 @@ snmp_netconn_thread(void *arg) } while(1); } -err_t +err_t snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port) { err_t result; struct netbuf buf; - + memset(&buf, 0, sizeof(buf)); buf.p = p; result = netconn_sendto((struct netconn*)handle, &buf, dst, port); - + return result; } diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c index 4a40864fc9..834a0496f6 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c @@ -52,7 +52,7 @@ snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, pbuf_free(p); } -err_t +err_t snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port) { return udp_sendto((struct udp_pcb*)handle, p, dst, port); @@ -86,7 +86,7 @@ void snmp_init(void) { err_t err; - + struct udp_pcb *snmp_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); LWIP_ERROR("snmp_raw: no PCB", (snmp_pcb != NULL), return;); diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c index 136c9eccd0..776e0a3224 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c @@ -46,7 +46,7 @@ static s16_t snmp_scalar_array_get_value(struct snmp_node_instance* instance, vo static snmp_err_t snmp_scalar_array_set_test(struct snmp_node_instance* instance, u16_t value_len, void* value); static snmp_err_t snmp_scalar_array_set_value(struct snmp_node_instance* instance, u16_t value_len, void* value); -snmp_err_t +snmp_err_t snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) { const struct snmp_scalar_node* scalar_node = (const struct snmp_scalar_node*)(const void*)instance->node; @@ -67,7 +67,7 @@ snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_n return SNMP_ERR_NOERROR; } -snmp_err_t +snmp_err_t snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) { /* because our only instance is .0 we can only return a next instance if no instance oid is passed */ @@ -130,7 +130,7 @@ snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, st if ((instance->instance_oid.len == 0) && (array_node->array_node_count > 0)) { /* return node with lowest OID */ u16_t i = 0; - + result = array_node_def; array_node_def++; @@ -142,7 +142,7 @@ snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, st } } else if (instance->instance_oid.len >= 1) { if (instance->instance_oid.len == 1) { - /* if we have the requested OID we return its instance, otherwise we search for the next available */ + /* if we have the requested OID we return its instance, otherwise we search for the next available */ u16_t i = 0; while (i < array_node->array_node_count) { if (array_node_def->oid == instance->instance_oid.id[0]) { @@ -179,7 +179,7 @@ snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, st instance->instance_oid.len = 2; instance->instance_oid.id[0] = result->oid; instance->instance_oid.id[1] = 0; - + instance->access = result->access; instance->asn1_type = result->asn1_type; instance->get_value = snmp_scalar_array_get_value; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c index 63ca595633..ef5612ca28 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c @@ -61,7 +61,7 @@ snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, str if (col_def->index == instance->instance_oid.id[1]) { break; } - + col_def++; i--; } @@ -212,13 +212,13 @@ snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_l default: LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type)); return SNMP_ERR_GENERROR; - } + } ret = SNMP_ERR_NOERROR; } else { ret = SNMP_ERR_NOSUCHINSTANCE; } - } + } } return ret; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c index 204f265dc8..b0ee89d3dc 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c @@ -40,7 +40,7 @@ #include "lwip/apps/snmp_core.h" #include "lwip/sys.h" #include - + static void call_synced_function(struct threadsync_data *call_data, snmp_threadsync_called_fn fn) { @@ -111,7 +111,7 @@ threadsync_set_value(struct snmp_node_instance* instance, u16_t len, void *value call_data->arg1.value = value; call_data->arg2.len = len; call_synced_function(call_data, threadsync_set_value_synced); - + return call_data->retval.err; } @@ -119,7 +119,7 @@ static void threadsync_release_instance_synced(void* ctx) { struct threadsync_data *call_data = (struct threadsync_data*)ctx; - + call_data->proxy_instance.release_instance(&call_data->proxy_instance); sys_sem_signal(&call_data->threadsync_node->instance->sem); @@ -129,7 +129,7 @@ static void threadsync_release_instance(struct snmp_node_instance *instance) { struct threadsync_data *call_data = (struct threadsync_data*)instance->reference.ptr; - + if (call_data->proxy_instance.release_instance != NULL) { call_synced_function(call_data, threadsync_release_instance_synced); } diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c index 0d2df64991..2135a6478a 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c @@ -228,7 +228,7 @@ snmp_send_trap(const struct snmp_obj_id* eoid, s32_t generic_trap, s32_t specifi * @ingroup snmp_traps * Send generic SNMP trap */ -err_t +err_t snmp_send_trap_generic(s32_t generic_trap) { static const struct snmp_obj_id oid = { 7, { 1, 3, 6, 1, 2, 1, 11 } }; @@ -257,7 +257,7 @@ snmp_coldstart_trap(void) /** * @ingroup snmp_traps - * Send authentication failure trap (used internally by agent) + * Send authentication failure trap (used internally by agent) */ void snmp_authfail_trap(void) diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c index bdfe844994..f2268f1d3c 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c @@ -52,17 +52,17 @@ snmpv3_get_user(const char* username, u8_t *auth_algo, u8_t *auth_key, u8_t *pri { const char* engine_id; u8_t engine_id_len; - + if(strlen(username) == 0) { return ERR_OK; } - + if(memcmp(username, "lwip", 4) != 0) { return ERR_VAL; } - + snmpv3_get_engine_id(&engine_id, &engine_id_len); - + if(auth_key != NULL) { snmpv3_password_to_key_sha((const u8_t*)"maplesyrup", 10, (const u8_t*)engine_id, engine_id_len, @@ -105,7 +105,7 @@ snmpv3_set_engine_id(const char *id, u8_t len) /** * Get engine boots from persistence. Must be increased on each boot. - * @return + * @return */ u32_t snmpv3_get_engine_boots(void) @@ -117,7 +117,7 @@ snmpv3_get_engine_boots(void) * Store engine boots in persistence * @param boots */ -void +void snmpv3_set_engine_boots(u32_t boots) { LWIP_UNUSED_ARG(boots); diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c index 0b1eefb87e..b48829bae8 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c @@ -73,7 +73,7 @@ snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, if(mbedtls_md_setup(&ctx, md_info, 1) != 0) { return ERR_ARG; } - + if (mbedtls_md_hmac_starts(&ctx, key, key_len) != 0) { goto free_md; } @@ -96,7 +96,7 @@ snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, mbedtls_md_free(&ctx); return ERR_OK; - + free_md: mbedtls_md_free(&ctx); return ERR_ARG; @@ -140,7 +140,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, goto error; } - /* Prepare IV */ + /* Prepare IV */ for (i = 0; i < LWIP_ARRAYSIZE(iv_local); i++) { iv_local[i] = priv_param[i] ^ key[i + 8]; } @@ -152,7 +152,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, size_t j; u8_t in_bytes[8]; out_len = LWIP_ARRAYSIZE(out_bytes) ; - + for (j = 0; j < LWIP_ARRAYSIZE(in_bytes); j++) { snmp_pbuf_stream_read(&read_stream, &in_bytes[j]); } @@ -163,7 +163,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, snmp_pbuf_stream_writebuf(&write_stream, out_bytes, out_len); } - + out_len = LWIP_ARRAYSIZE(out_bytes); if(mbedtls_cipher_finish(&ctx, out_bytes, &out_len) != 0) { goto error; @@ -201,7 +201,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, u8_t in_byte; u8_t out_byte; size_t out_len = sizeof(out_byte); - + snmp_pbuf_stream_read(&read_stream, &in_byte); if(mbedtls_cipher_update(&ctx, &in_byte, sizeof(in_byte), &out_byte, &out_len) != 0) { goto error; @@ -223,7 +223,7 @@ error: #endif /* LWIP_SNMP_V3_CRYPTO */ /* A.2.1. Password to Key Sample Code for MD5 */ -void +void snmpv3_password_to_key_md5( const u8_t *password, /* IN */ u8_t passwordlen, /* IN */ @@ -276,7 +276,7 @@ snmpv3_password_to_key_md5( } /* A.2.2. Password to Key Sample Code for SHA */ -void +void snmpv3_password_to_key_sha( const u8_t *password, /* IN */ u8_t passwordlen, /* IN */ @@ -323,7 +323,7 @@ snmpv3_password_to_key_sha( mbedtls_sha1_starts(&SH); mbedtls_sha1_update(&SH, password_buf, 40 + engineLength); mbedtls_sha1_finish(&SH, key); - + mbedtls_sha1_free(&SH); return; } diff --git a/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c b/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c index afaa3bb08d..a4c74f99e4 100644 --- a/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c +++ b/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c @@ -12,7 +12,7 @@ * ********************************************************************/ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * @@ -106,7 +106,7 @@ close_handle(void) } sys_untimeout(tftp_tmr, NULL); - + if (tftp_state.handle) { tftp_state.ctx->close(tftp_state.handle); tftp_state.handle = NULL; @@ -120,7 +120,7 @@ send_error(const ip_addr_t *addr, u16_t port, enum tftp_error code, const char * int str_length = strlen(str); struct pbuf* p; u16_t* payload; - + p = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(TFTP_HEADER_LENGTH + str_length + 1), PBUF_RAM); if(p == NULL) { return; @@ -140,13 +140,13 @@ send_ack(u16_t blknum) { struct pbuf* p; u16_t* payload; - + p = pbuf_alloc(PBUF_TRANSPORT, TFTP_HEADER_LENGTH, PBUF_RAM); if(p == NULL) { return; } payload = (u16_t*) p->payload; - + payload[0] = PP_HTONS(TFTP_ACK); payload[1] = lwip_htons(blknum); udp_sendto(tftp_state.upcb, p, &tftp_state.addr, tftp_state.port); @@ -165,7 +165,7 @@ resend_data(void) pbuf_free(p); return; } - + udp_sendto(tftp_state.upcb, p, &tftp_state.addr, tftp_state.port); pbuf_free(p); } @@ -179,7 +179,7 @@ send_data(void) if(tftp_state.last_data != NULL) { pbuf_free(tftp_state.last_data); } - + tftp_state.last_data = pbuf_alloc(PBUF_TRANSPORT, TFTP_HEADER_LENGTH + TFTP_MAX_PAYLOAD_SIZE, PBUF_RAM); if(tftp_state.last_data == NULL) { return; @@ -208,7 +208,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(upcb); - + if (((tftp_state.port != 0) && (port != tftp_state.port)) || (!ip_addr_isany_val(tftp_state.addr) && !ip_addr_cmp(&tftp_state.addr, addr))) { send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Only one connection at a time is supported"); @@ -235,7 +235,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Only one connection at a time is supported"); break; } - + sys_timeout(TFTP_TIMER_MSECS, tftp_tmr, NULL); /* find \0 in pbuf -> end of filename string */ @@ -253,7 +253,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 break; } pbuf_copy_partial(p, mode, mode_end_offset-filename_end_offset, filename_end_offset+1); - + tftp_state.handle = tftp_state.ctx->open(filename, mode, opcode == PP_HTONS(TFTP_WRQ)); tftp_state.blknum = 1; @@ -279,12 +279,12 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 break; } - + case PP_HTONS(TFTP_DATA): { int ret; u16_t blknum; - + if (tftp_state.handle == NULL) { send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "No connection"); break; @@ -348,7 +348,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 break; } - + default: send_error(addr, port, TFTP_ERROR_ILLEGAL_OPERATION, "Unknown operation"); break; @@ -361,7 +361,7 @@ static void tftp_tmr(void* arg) { LWIP_UNUSED_ARG(arg); - + tftp_state.timer++; if (tftp_state.handle == NULL) { @@ -386,7 +386,7 @@ tftp_tmr(void* arg) * Initialize TFTP server. * @param ctx TFTP callback struct */ -err_t +err_t tftp_init(const struct tftp_context *ctx) { err_t ret; diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h index 51b06f1a7f..e3014f552c 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h @@ -47,9 +47,9 @@ #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #include -#define LWIP_TIMEVAL_PRIVATE 0 +#define LWIP_TIMEVAL_PRIVATE 0 #else -#define LWIP_TIMEVAL_PRIVATE 1 +#define LWIP_TIMEVAL_PRIVATE 1 #endif #if defined(__CC_ARM) /* ARMCC compiler */ @@ -81,14 +81,14 @@ #endif void sys_arch_assert(const char* file, int line); -#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) +#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) #define LWIP_PLATFORM_ASSERT(x) do {rt_kprintf(x); sys_arch_assert(__FILE__, __LINE__);}while(0) #include "string.h" -#define SYS_ARCH_DECL_PROTECT(level) -#define SYS_ARCH_PROTECT(level) rt_enter_critical() -#define SYS_ARCH_UNPROTECT(level) rt_exit_critical() +#define SYS_ARCH_DECL_PROTECT(level) +#define SYS_ARCH_PROTECT(level) rt_enter_critical() +#define SYS_ARCH_UNPROTECT(level) rt_exit_critical() #endif /* __ARCH_CC_H__ */ diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/perf.h b/components/net/lwip-2.0.2/src/arch/include/arch/perf.h index 675f1f65dc..4b7720ef40 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/perf.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/perf.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: perf.h,v 1.1.1.1 2004/12/16 14:17:13 bear Exp $ @@ -42,8 +42,8 @@ /* void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); + unsigned long c2l, unsigned long c2h, + char *key); void perf_print_times(struct tms *start, struct tms *end, char *key); diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h b/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h index 8637cc9263..f83188407b 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: sys_arch.h,v 1.3 2005/03/13 16:03:23 bear Exp $ diff --git a/components/net/lwip-2.0.2/src/arch/sys_arch.c b/components/net/lwip-2.0.2/src/arch/sys_arch.c index fbf02cad0a..4d0c57eff9 100644 --- a/components/net/lwip-2.0.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.0.2/src/arch/sys_arch.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (C) 2006-2018, RT-Thread Development Team + * COPYRIGHT (C) 2006-2021, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/components/net/lwip-2.0.2/src/core/def.c b/components/net/lwip-2.0.2/src/core/def.c index 8125313f41..171c5c7d48 100644 --- a/components/net/lwip-2.0.2/src/core/def.c +++ b/components/net/lwip-2.0.2/src/core/def.c @@ -11,7 +11,7 @@ * \#define lwip_htonl(x) your_htonl * * Note lwip_ntohs() and lwip_ntohl() are merely references to the htonx counterparts. - * + * * If you \#define them to htons() and htonl(), you should * \#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS to prevent lwIP from * defining htonx/ntohx compatibility macros. diff --git a/components/net/lwip-2.0.2/src/core/dns.c b/components/net/lwip-2.0.2/src/core/dns.c index cd4de06229..6d5b7e6da3 100644 --- a/components/net/lwip-2.0.2/src/core/dns.c +++ b/components/net/lwip-2.0.2/src/core/dns.c @@ -23,14 +23,14 @@ * Once a hostname has been resolved (or found to be non-existent), * the resolver code calls a specified callback function (which * must be implemented by the module that uses the resolver). - * + * * Multicast DNS queries are supported for names ending on ".local". * However, only "One-Shot Multicast DNS Queries" are supported (RFC 6762 * chapter 5.1), this is not a fully compliant implementation of continuous * mDNS querying! * * All functions must be called from TCPIP thread. - * + * * @see @ref netconn_common for thread-safe access. */ @@ -368,7 +368,7 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver) if (numdns < DNS_MAX_SERVERS) { if (dnsserver != NULL) { dns_servers[numdns] = (*dnsserver); - + #ifdef RT_USING_NETDEV extern struct netif *netif_list; extern struct netdev *netdev_get_by_name(const char *name); diff --git a/components/net/lwip-2.0.2/src/core/inet_chksum.c b/components/net/lwip-2.0.2/src/core/inet_chksum.c index 917f3e4f1a..cc2db13a94 100644 --- a/components/net/lwip-2.0.2/src/core/inet_chksum.c +++ b/components/net/lwip-2.0.2/src/core/inet_chksum.c @@ -8,7 +8,7 @@ * your own version, link it in and in your cc.h put: * * \#define LWIP_CHKSUM your_checksum_routine - * + * * Or you can select from the implementations below by defining * LWIP_CHKSUM_ALGORITHM to 1, 2 or 3. */ diff --git a/components/net/lwip-2.0.2/src/core/init.c b/components/net/lwip-2.0.2/src/core/init.c index 313146133d..8c5a05f6ab 100644 --- a/components/net/lwip-2.0.2/src/core/init.c +++ b/components/net/lwip-2.0.2/src/core/init.c @@ -378,7 +378,7 @@ lwip_init(void) #if PPP_SUPPORT ppp_init(); #endif - + #if LWIP_TIMERS sys_timeouts_init(); #endif /* LWIP_TIMERS */ diff --git a/components/net/lwip-2.0.2/src/core/ip.c b/components/net/lwip-2.0.2/src/core/ip.c index 2e0240851f..804799470a 100644 --- a/components/net/lwip-2.0.2/src/core/ip.c +++ b/components/net/lwip-2.0.2/src/core/ip.c @@ -4,19 +4,19 @@ * * @defgroup ip IP * @ingroup callbackstyle_api - * + * * @defgroup ip4 IPv4 * @ingroup ip * * @defgroup ip6 IPv6 * @ingroup ip - * + * * @defgroup ipaddr IP address handling * @ingroup infrastructure - * + * * @defgroup ip4addr IPv4 only * @ingroup ipaddr - * + * * @defgroup ip6addr IPv6 only * @ingroup ipaddr */ diff --git a/components/net/lwip-2.0.2/src/core/ipv4/autoip.c b/components/net/lwip-2.0.2/src/core/ipv4/autoip.c index 10db8a3444..79d7615bba 100644 --- a/components/net/lwip-2.0.2/src/core/ipv4/autoip.c +++ b/components/net/lwip-2.0.2/src/core/ipv4/autoip.c @@ -22,7 +22,7 @@ * With DHCP: * - define @ref LWIP_DHCP_AUTOIP_COOP 1 in your lwipopts.h. * - Configure your DHCP Client. - * + * * @see netifapi_autoip */ @@ -95,7 +95,7 @@ static err_t autoip_arp_announce(struct netif *netif); static void autoip_start_probing(struct netif *netif); /** - * @ingroup autoip + * @ingroup autoip * Set a statically allocated struct autoip to work with. * Using this prevents autoip_start to allocate it using mem_malloc. * @@ -245,7 +245,7 @@ autoip_bind(struct netif *netif) } /** - * @ingroup autoip + * @ingroup autoip * Start AutoIP client * * @param netif network interface on which start the AutoIP client @@ -339,7 +339,7 @@ autoip_network_changed(struct netif *netif) } /** - * @ingroup autoip + * @ingroup autoip * Stop AutoIP client * * @param netif network interface on which stop the AutoIP client diff --git a/components/net/lwip-2.0.2/src/core/ipv4/igmp.c b/components/net/lwip-2.0.2/src/core/ipv4/igmp.c index 74a6c37731..57ddc75fbd 100644 --- a/components/net/lwip-2.0.2/src/core/ipv4/igmp.c +++ b/components/net/lwip-2.0.2/src/core/ipv4/igmp.c @@ -199,7 +199,7 @@ igmp_report_groups(struct netif *netif) if(group != NULL) { group = group->next; } - + while (group != NULL) { igmp_delaying_member(group, IGMP_JOIN_DELAYING_MEMBER_TMR); group = group->next; @@ -252,7 +252,7 @@ igmp_lookup_group(struct netif *ifp, const ip4_addr_t *addr) /* Group already exists. */ return group; } - + /* Group doesn't exist yet, create a new one */ group = (struct igmp_group *)memp_malloc(MEMP_IGMP_GROUP); if (group != NULL) { @@ -262,7 +262,7 @@ igmp_lookup_group(struct netif *ifp, const ip4_addr_t *addr) group->last_reporter_flag = 0; group->use = 0; - /* Ensure allsystems group is always first in list */ + /* Ensure allsystems group is always first in list */ if (list_head == NULL) { /* this is the first entry in linked list */ LWIP_ASSERT("igmp_lookup_group: first group must be allsystems", @@ -379,7 +379,7 @@ igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest) } groupref = netif_igmp_data(inp); - + /* Do not send messages on the all systems group address! */ /* Skip the first group in the list, it is always the allsystems group added in igmp_start() */ if(groupref != NULL) { @@ -674,7 +674,7 @@ igmp_timeout(struct netif *netif, struct igmp_group *group) LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", (void*)netif)); group->group_state = IGMP_GROUP_IDLE_MEMBER; - + IGMP_STATS_INC(igmp.tx_report); igmp_send(netif, group, IGMP_V2_MEMB_REPORT); } diff --git a/components/net/lwip-2.0.2/src/core/ipv6/nd6.c b/components/net/lwip-2.0.2/src/core/ipv6/nd6.c index 0b367181b2..22078ea776 100644 --- a/components/net/lwip-2.0.2/src/core/ipv6/nd6.c +++ b/components/net/lwip-2.0.2/src/core/ipv6/nd6.c @@ -159,7 +159,7 @@ nd6_input(struct pbuf *p, struct netif *inp) /* Unsolicited NA?*/ if (ip6_addr_ismulticast(ip6_current_dest_addr())) { ip6_addr_t target_address; - + /* This is an unsolicited NA. * link-layer changed? * part of DAD mechanism? */ @@ -335,7 +335,7 @@ nd6_input(struct pbuf *p, struct netif *inp) } } else { ip6_addr_t target_address; - + /* Sender is trying to resolve our address. */ /* Verify that they included their own link-layer address. */ if (lladdr_opt == NULL) { @@ -1517,9 +1517,9 @@ nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif) for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) { /* check if router already exists (this is a special case for 2 netifs on the same subnet - e.g. wifi and cable) */ - if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ - return router_index; - } + if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ + return router_index; + } if (default_router_list[router_index].neighbor_entry == NULL) { /* remember lowest free index to create a new entry */ free_router_index = router_index; diff --git a/components/net/lwip-2.0.2/src/core/netif.c b/components/net/lwip-2.0.2/src/core/netif.c index ee57bb9a9d..89c0a678b9 100644 --- a/components/net/lwip-2.0.2/src/core/netif.c +++ b/components/net/lwip-2.0.2/src/core/netif.c @@ -1,16 +1,16 @@ /** * @file * lwIP network interface abstraction - * + * * @defgroup netif Network interface (NETIF) * @ingroup callbackstyle_api - * + * * @defgroup netif_ip4 IPv4 address handling * @ingroup netif - * + * * @defgroup netif_ip6 IPv6 address handling * @ingroup netif - * + * * @defgroup netif_cd Client data handling * Store data (void*) on a netif for application usage. * @see @ref LWIP_NUM_NETIF_CLIENT_DATA @@ -203,7 +203,7 @@ netif_init(void) * ethernet_input() or ip_input() depending on netif flags. * Don't call directly, pass to netif_add() and call * netif->input(). - * Only works if the netif driver correctly sets + * Only works if the netif driver correctly sets * NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag! */ err_t @@ -236,12 +236,12 @@ netif_input(struct pbuf *p, struct netif *inp) * to decide whether to forward to ethernet_input() or ip_input(). * In other words, the functions only work when the netif * driver is implemented correctly!\n - * Most members of struct netif should be be initialized by the + * Most members of struct netif should be be initialized by the * netif init function = netif driver (init parameter of this function).\n * IPv6: Don't forget to call netif_create_ip6_linklocal_address() after * setting the MAC address in struct netif.hwaddr * (IPv6 requires a link-local address). - * + * * @return netif, or NULL if failed. */ struct netif * diff --git a/components/net/lwip-2.0.2/src/core/pbuf.c b/components/net/lwip-2.0.2/src/core/pbuf.c index 059f83a571..34b2939bf4 100644 --- a/components/net/lwip-2.0.2/src/core/pbuf.c +++ b/components/net/lwip-2.0.2/src/core/pbuf.c @@ -62,7 +62,7 @@ void eth_rx_irq() my_pbuf->dma_descriptor = dma_desc; invalidate_cpu_cache(dma_desc->rx_data, dma_desc->rx_length); - + struct pbuf* p = pbuf_alloced_custom(PBUF_RAW, dma_desc->rx_length, PBUF_REF, @@ -352,12 +352,12 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) case PBUF_RAM: { mem_size_t alloc_len = LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length); - + /* bug #50040: Check for integer overflow when calculating alloc_len */ if (alloc_len < LWIP_MEM_ALIGN_SIZE(length)) { return NULL; } - + /* If pbuf is to be allocated in RAM, allocate memory for it. */ p = (struct pbuf*)mem_malloc(alloc_len); } @@ -1364,18 +1364,18 @@ pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n) u16_t start = offset; const struct pbuf* q = p; u16_t i; - + /* pbuf long enough to perform check? */ if(p->tot_len < (offset + n)) { return 0xffff; } - + /* get the correct pbuf from chain. We know it succeeds because of p->tot_len check above. */ while ((q != NULL) && (q->len <= start)) { start -= q->len; q = q->next; } - + /* return requested data if pbuf is OK */ for (i = 0; i < n; i++) { /* We know pbuf_get_at() succeeds because of p->tot_len check above. */ diff --git a/components/net/lwip-2.0.2/src/core/raw.c b/components/net/lwip-2.0.2/src/core/raw.c index 80cf9ec64b..45b559db43 100644 --- a/components/net/lwip-2.0.2/src/core/raw.c +++ b/components/net/lwip-2.0.2/src/core/raw.c @@ -4,7 +4,7 @@ * different types of protocols besides (or overriding) those * already available in lwIP.\n * See also @ref raw_raw - * + * * @defgroup raw_raw RAW * @ingroup callbackstyle_api * Implementation of raw protocol PCBs for low-level handling of diff --git a/components/net/lwip-2.0.2/src/core/tcp.c b/components/net/lwip-2.0.2/src/core/tcp.c index ec2e1f92ce..a30dc23581 100644 --- a/components/net/lwip-2.0.2/src/core/tcp.c +++ b/components/net/lwip-2.0.2/src/core/tcp.c @@ -1,5 +1,5 @@ /** - * @file + * @file * Transmission Control Protocol for IP * See also @ref tcp_raw * @@ -1743,7 +1743,7 @@ tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) * has occurred on the connection. * * @note The corresponding pcb is already freed when this callback is called! - * + * * @param pcb tcp_pcb to set the err callback * @param err callback function to call for this pcb when a fatal error * has occurred on the connection diff --git a/components/net/lwip-2.0.2/src/core/udp.c b/components/net/lwip-2.0.2/src/core/udp.c index ce2e3d295f..0cbf25edaa 100644 --- a/components/net/lwip-2.0.2/src/core/udp.c +++ b/components/net/lwip-2.0.2/src/core/udp.c @@ -3,7 +3,7 @@ * User Datagram Protocol module\n * The code for the User Datagram Protocol UDP & UDPLite (RFC 3828).\n * See also @ref udp_raw - * + * * @defgroup udp_raw UDP * @ingroup callbackstyle_api * User Datagram Protocol module\n diff --git a/components/net/lwip-2.0.2/src/include/lwip/api.h b/components/net/lwip-2.0.2/src/include/lwip/api.h index 516bd163dd..5f37d2ec1f 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/api.h +++ b/components/net/lwip-2.0.2/src/include/lwip/api.h @@ -140,27 +140,27 @@ enum netconn_state { }; /** Used to inform the callback function about changes - * + * * Event explanation: - * + * * In the netconn implementation, there are three ways to block a client: - * + * * - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) * - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) * - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) - * + * * The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking * connections, you need to know in advance whether a call to a netconn function call would block or not, * and these events tell you about that. - * - * RCVPLUS events say: Safe to perform a potentially blocking call call once more. + * + * RCVPLUS events say: Safe to perform a potentially blocking call call once more. * They are counted in sockets - three RCVPLUS events for accept mbox means you are safe * to call netconn_accept 3 times without being blocked. * Same thing for receive mbox. - * + * * RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". * Socket implementation decrements the counter. - * + * * For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. * SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. * A SENDMINUS event occurs when the next call to a netconn_send() would be blocking. diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h b/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h index bb176fa010..a06d4c977c 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h index 40f1811e57..35a01e29d6 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h @@ -102,7 +102,7 @@ void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers); #if LWIP_HTTPD_CGI_SSI /** Define this generic CGI handler in your application. * It is called once for every URI with parameters. - * The parameters can be stored to + * The parameters can be stored to */ extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, char **pcValue #if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h index 340db15f66..cbe493c848 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h @@ -120,7 +120,7 @@ #define HTTPD_DEBUG LWIP_DBG_OFF #endif -/** Set this to 1 to use a memp pool for allocating +/** Set this to 1 to use a memp pool for allocating * struct http_state instead of the heap. */ #if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__ diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h index 34b230b888..3adeb0510b 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h @@ -110,7 +110,7 @@ enum { MQTT_DATA_FLAG_LAST = 1 }; -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish data callback function. Called when data * arrives to a subscribed topic @see mqtt_subscribe @@ -125,7 +125,7 @@ enum { typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags); -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish function. Called when an incoming publish * arrives to a subscribed topic @see mqtt_subscribe diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h index ffefacd259..90eef1555d 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h @@ -39,7 +39,7 @@ #include "lwip/opt.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h b/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h index e781c532b3..d20a988365 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h @@ -99,7 +99,7 @@ extern "C" { /** error codes predefined by SNMP prot. */ typedef enum { SNMP_ERR_NOERROR = 0, -/* +/* outdated v1 error codes. do not use anmore! #define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead #define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h index 6968a803b4..357eb2e63c 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h @@ -11,7 +11,7 @@ * ********************************************************************/ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h index 3fbe701e0a..387162da8e 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h @@ -11,7 +11,7 @@ * ********************************************************************/ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * @@ -67,7 +67,7 @@ struct tftp_context { */ void (*close)(void* handle); /** - * Read from file + * Read from file * @param handle File handle returned by open() * @param buf Target buffer to copy read data to * @param bytes Number of bytes to copy to buf diff --git a/components/net/lwip-2.0.2/src/include/lwip/arch.h b/components/net/lwip-2.0.2/src/include/lwip/arch.h index 42f47778ae..f468ce8b2b 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/arch.h +++ b/components/net/lwip-2.0.2/src/include/lwip/arch.h @@ -72,7 +72,7 @@ /** Platform specific diagnostic output.\n * Note the default implementation pulls in printf, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_DIAG @@ -83,7 +83,7 @@ /** Platform specific assertion handling.\n * Note the default implementation pulls in printf, fflush and abort, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_ASSERT diff --git a/components/net/lwip-2.0.2/src/include/lwip/igmp.h b/components/net/lwip-2.0.2/src/include/lwip/igmp.h index ffd80e680c..0a16db0397 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/igmp.h +++ b/components/net/lwip-2.0.2/src/include/lwip/igmp.h @@ -99,7 +99,7 @@ err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); void igmp_tmr(void); -/** @ingroup igmp +/** @ingroup igmp * Get list head of IGMP groups for netif. * Note: The allsystems group IP is contained in the list as first entry. * @see @ref netif_set_igmp_mac_filter() diff --git a/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h b/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h index 11f65d25bd..07571af12a 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h +++ b/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h @@ -373,7 +373,7 @@ extern const ip_addr_t ip_addr_broadcast; extern const ip_addr_t ip6_addr_any; -/** +/** * @ingroup ip6addr * IP6_ADDR_ANY can be used as a fixed ip_addr_t * for the IPv6 wildcard address diff --git a/components/net/lwip-2.0.2/src/include/lwip/mld6.h b/components/net/lwip-2.0.2/src/include/lwip/mld6.h index 7fa0797f27..2764fdd42d 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/mld6.h +++ b/components/net/lwip-2.0.2/src/include/lwip/mld6.h @@ -84,7 +84,7 @@ err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); /** @ingroup mld6 * Get list head of MLD6 groups for netif. - * Note: The allnodes group IP is NOT in the list, since it must always + * Note: The allnodes group IP is NOT in the list, since it must always * be received for correct IPv6 operation. * @see @ref netif_set_mld_mac_filter() */ diff --git a/components/net/lwip-2.0.2/src/include/lwip/opt.h b/components/net/lwip-2.0.2/src/include/lwip/opt.h index fd459af144..8c46408a3d 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/opt.h +++ b/components/net/lwip-2.0.2/src/include/lwip/opt.h @@ -2564,8 +2564,8 @@ * - src: source eth address * - dst: destination eth address * - eth_type: ethernet type to packet to be sent\n - * - * + * + * * Return values: * - <0: Packet shall not contain VLAN header. * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. diff --git a/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h b/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h index fae4570479..ea7188175d 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h +++ b/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h @@ -109,7 +109,7 @@ enum eth_type { /** Internet protocol v4 */ ETHTYPE_IP = 0x0800U, /** Address resolution protocol */ - ETHTYPE_ARP = 0x0806U, + ETHTYPE_ARP = 0x0806U, /** Wake on lan */ ETHTYPE_WOL = 0x0842U, /** RARP */ diff --git a/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h b/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h index 6e1e2632bf..6b5641d809 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h +++ b/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h @@ -43,7 +43,7 @@ #ifdef __cplusplus extern "C" { #endif - + /** This is the packed version of ip6_addr_t, used in network headers that are itself packed */ #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/components/net/lwip-2.0.2/src/include/netif/ethernetif.h b/components/net/lwip-2.0.2/src/include/netif/ethernetif.h index 244bafdd1b..09c6d9a56f 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ethernetif.h +++ b/components/net/lwip-2.0.2/src/include/netif/ethernetif.h @@ -4,16 +4,16 @@ #include "lwip/netif.h" #include -#define NIOCTL_GADDR 0x01 +#define NIOCTL_GADDR 0x01 #ifndef RT_LWIP_ETH_MTU -#define ETHERNET_MTU 1500 +#define ETHERNET_MTU 1500 #else -#define ETHERNET_MTU RT_LWIP_ETH_MTU +#define ETHERNET_MTU RT_LWIP_ETH_MTU #endif /* eth flag with auto_linkup or phy_linkup */ -#define ETHIF_LINK_AUTOUP 0x0000 -#define ETHIF_LINK_PHYUP 0x0100 +#define ETHIF_LINK_AUTOUP 0x0000 +#define ETHIF_LINK_PHYUP 0x0100 struct eth_device { diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h index 14dd65962c..1e4e602052 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h @@ -40,48 +40,48 @@ * CCP codes. */ -#define CCP_CONFREQ 1 -#define CCP_CONFACK 2 -#define CCP_TERMREQ 5 -#define CCP_TERMACK 6 -#define CCP_RESETREQ 14 -#define CCP_RESETACK 15 +#define CCP_CONFREQ 1 +#define CCP_CONFACK 2 +#define CCP_TERMREQ 5 +#define CCP_TERMACK 6 +#define CCP_RESETREQ 14 +#define CCP_RESETACK 15 /* * Max # bytes for a CCP option */ -#define CCP_MAX_OPTION_LENGTH 32 +#define CCP_MAX_OPTION_LENGTH 32 /* * Parts of a CCP packet. */ -#define CCP_CODE(dp) ((dp)[0]) -#define CCP_ID(dp) ((dp)[1]) -#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) -#define CCP_HDRLEN 4 +#define CCP_CODE(dp) ((dp)[0]) +#define CCP_ID(dp) ((dp)[1]) +#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) +#define CCP_HDRLEN 4 -#define CCP_OPT_CODE(dp) ((dp)[0]) -#define CCP_OPT_LENGTH(dp) ((dp)[1]) -#define CCP_OPT_MINLEN 2 +#define CCP_OPT_CODE(dp) ((dp)[0]) +#define CCP_OPT_LENGTH(dp) ((dp)[1]) +#define CCP_OPT_MINLEN 2 #if BSDCOMPRESS_SUPPORT /* * Definitions for BSD-Compress. */ -#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ -#define CILEN_BSD_COMPRESS 3 /* length of config. option */ +#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ +#define CILEN_BSD_COMPRESS 3 /* length of config. option */ /* Macros for handling the 3rd byte of the BSD-Compress config option. */ -#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ -#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ -#define BSD_CURRENT_VERSION 1 /* current version number */ -#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) +#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ +#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ +#define BSD_CURRENT_VERSION 1 /* current version number */ +#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) -#define BSD_MIN_BITS 9 /* smallest code size supported */ -#define BSD_MAX_BITS 15 /* largest code size supported */ +#define BSD_MIN_BITS 9 /* smallest code size supported */ +#define BSD_MAX_BITS 15 /* largest code size supported */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -89,17 +89,17 @@ * Definitions for Deflate. */ -#define CI_DEFLATE 26 /* config option for Deflate */ -#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ -#define CILEN_DEFLATE 4 /* length of its config option */ - -#define DEFLATE_MIN_SIZE 9 -#define DEFLATE_MAX_SIZE 15 -#define DEFLATE_METHOD_VAL 8 -#define DEFLATE_SIZE(x) (((x) >> 4) + 8) -#define DEFLATE_METHOD(x) ((x) & 0x0F) -#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) -#define DEFLATE_CHK_SEQUENCE 0 +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ +#define CILEN_DEFLATE 4 /* length of its config option */ + +#define DEFLATE_MIN_SIZE 9 +#define DEFLATE_MAX_SIZE 15 +#define DEFLATE_METHOD_VAL 8 +#define DEFLATE_SIZE(x) (((x) >> 4) + 8) +#define DEFLATE_METHOD(x) ((x) & 0x0F) +#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) +#define DEFLATE_CHK_SEQUENCE 0 #endif /* DEFLATE_SUPPORT */ #if MPPE_SUPPORT @@ -116,10 +116,10 @@ * Definitions for other, as yet unsupported, compression methods. */ -#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ -#define CILEN_PREDICTOR_1 2 /* length of its config option */ -#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ -#define CILEN_PREDICTOR_2 2 /* length of its config option */ +#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ +#define CILEN_PREDICTOR_1 2 /* length of its config option */ +#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ +#define CILEN_PREDICTOR_2 2 /* length of its config option */ #endif /* PREDICTOR_SUPPORT */ typedef struct ccp_options { @@ -137,15 +137,15 @@ typedef struct ccp_options { #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - u8_t mppe; /* MPPE bitfield */ + u8_t mppe; /* MPPE bitfield */ #endif /* MPPE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - u_short bsd_bits; /* # bits/code for BSD Compress */ + u_short bsd_bits; /* # bits/code for BSD Compress */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - u_short deflate_size; /* lg(window size) for Deflate */ + u_short deflate_size; /* lg(window size) for Deflate */ #endif /* DEFLATE_SUPPORT */ - u8_t method; /* code for chosen compression method */ + u8_t method; /* code for chosen compression method */ } ccp_options; extern const struct protent ccp_protent; diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h b/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h index 64eae32202..6a37c8e6ff 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h @@ -39,45 +39,45 @@ /* * CHAP packets begin with a standard header with code, id, len (2 bytes). */ -#define CHAP_HDRLEN 4 +#define CHAP_HDRLEN 4 /* * Values for the code field. */ -#define CHAP_CHALLENGE 1 -#define CHAP_RESPONSE 2 -#define CHAP_SUCCESS 3 -#define CHAP_FAILURE 4 +#define CHAP_CHALLENGE 1 +#define CHAP_RESPONSE 2 +#define CHAP_SUCCESS 3 +#define CHAP_FAILURE 4 /* * CHAP digest codes. */ -#define CHAP_MD5 5 +#define CHAP_MD5 5 #if MSCHAP_SUPPORT -#define CHAP_MICROSOFT 0x80 -#define CHAP_MICROSOFT_V2 0x81 +#define CHAP_MICROSOFT 0x80 +#define CHAP_MICROSOFT_V2 0x81 #endif /* MSCHAP_SUPPORT */ /* * Semi-arbitrary limits on challenge and response fields. */ -#define MAX_CHALLENGE_LEN 64 -#define MAX_RESPONSE_LEN 64 +#define MAX_CHALLENGE_LEN 64 +#define MAX_RESPONSE_LEN 64 /* * These limits apply to challenge and response packets we send. * The +4 is the +1 that we actually need rounded up. */ -#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) -#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) +#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) +#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) /* bitmask of supported algorithms */ #if MSCHAP_SUPPORT -#define MDTYPE_MICROSOFT_V2 0x1 -#define MDTYPE_MICROSOFT 0x2 +#define MDTYPE_MICROSOFT_V2 0x1 +#define MDTYPE_MICROSOFT 0x2 #endif /* MSCHAP_SUPPORT */ -#define MDTYPE_MD5 0x4 -#define MDTYPE_NONE 0 +#define MDTYPE_MD5 0x4 +#define MDTYPE_NONE 0 #if MSCHAP_SUPPORT /* Return the digest alg. ID for the most preferred digest type. */ @@ -125,24 +125,24 @@ * The code for each digest type has to supply one of these. */ struct chap_digest_type { - int code; + int code; #if PPP_SERVER - /* - * Note: challenge and response arguments below are formatted as - * a length byte followed by the actual challenge/response data. - */ - void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); - int (*verify_response)(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + /* + * Note: challenge and response arguments below are formatted as + * a length byte followed by the actual challenge/response data. + */ + void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); + int (*verify_response)(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ - void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *priv); - int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); - void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); + void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *priv); + int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); + void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); }; /* @@ -150,21 +150,21 @@ struct chap_digest_type { */ #if CHAP_SUPPORT typedef struct chap_client_state { - u8_t flags; - const char *name; - const struct chap_digest_type *digest; - unsigned char priv[64]; /* private area for digest's use */ + u8_t flags; + const char *name; + const struct chap_digest_type *digest; + unsigned char priv[64]; /* private area for digest's use */ } chap_client_state; #if PPP_SERVER typedef struct chap_server_state { - u8_t flags; - u8_t id; - const char *name; - const struct chap_digest_type *digest; - int challenge_xmits; - int challenge_pktlen; - unsigned char challenge[CHAL_MAX_PKTLEN]; + u8_t flags; + u8_t id; + const char *name; + const struct chap_digest_type *digest; + int challenge_xmits; + int challenge_pktlen; + unsigned char challenge[CHAL_MAX_PKTLEN]; } chap_server_state; #endif /* PPP_SERVER */ #endif /* CHAP_SUPPORT */ @@ -172,9 +172,9 @@ typedef struct chap_server_state { #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ extern int (*chap_verify_hook)(char *name, char *ourname, int id, - const struct chap_digest_type *digest, - unsigned char *challenge, unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + unsigned char *challenge, unsigned char *response, + char *message, int message_space); #endif /* UNUSED */ #if PPP_SERVER diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h b/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h index 3ee9aaf81a..491e52ab11 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h @@ -24,135 +24,135 @@ #if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef PPP_EAP_H -#define PPP_EAP_H +#define PPP_EAP_H #include "ppp.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif /* * Packet header = Code, id, length. */ -#define EAP_HEADERLEN 4 +#define EAP_HEADERLEN 4 /* EAP message codes. */ -#define EAP_REQUEST 1 -#define EAP_RESPONSE 2 -#define EAP_SUCCESS 3 -#define EAP_FAILURE 4 +#define EAP_REQUEST 1 +#define EAP_RESPONSE 2 +#define EAP_SUCCESS 3 +#define EAP_FAILURE 4 /* EAP types */ -#define EAPT_IDENTITY 1 -#define EAPT_NOTIFICATION 2 -#define EAPT_NAK 3 /* (response only) */ -#define EAPT_MD5CHAP 4 -#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ -#define EAPT_TOKEN 6 /* Generic Token Card */ +#define EAPT_IDENTITY 1 +#define EAPT_NOTIFICATION 2 +#define EAPT_NAK 3 /* (response only) */ +#define EAPT_MD5CHAP 4 +#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ +#define EAPT_TOKEN 6 /* Generic Token Card */ /* 7 and 8 are unassigned. */ -#define EAPT_RSA 9 /* RSA Public Key Authentication */ -#define EAPT_DSS 10 /* DSS Unilateral */ -#define EAPT_KEA 11 /* KEA */ -#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ -#define EAPT_TLS 13 /* EAP-TLS */ -#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ -#define EAPT_W2K 15 /* Windows 2000 EAP */ -#define EAPT_ARCOT 16 /* Arcot Systems */ -#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ -#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ -#define EAPT_SRP 19 /* Secure Remote Password */ +#define EAPT_RSA 9 /* RSA Public Key Authentication */ +#define EAPT_DSS 10 /* DSS Unilateral */ +#define EAPT_KEA 11 /* KEA */ +#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ +#define EAPT_TLS 13 /* EAP-TLS */ +#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ +#define EAPT_W2K 15 /* Windows 2000 EAP */ +#define EAPT_ARCOT 16 /* Arcot Systems */ +#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ +#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ +#define EAPT_SRP 19 /* Secure Remote Password */ /* 20 is deprecated */ /* EAP SRP-SHA1 Subtypes */ -#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ -#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ -#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ -#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ -#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ -#define EAPSRP_ACK 3 /* Response 3 - final ack */ -#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ - -#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ - -#define SRP_PSEUDO_ID "pseudo_" -#define SRP_PSEUDO_LEN 7 - -#define MD5_SIGNATURE_SIZE 16 -#define EAP_MIN_CHALLENGE_LENGTH 17 -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ +#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ +#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ +#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ +#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ +#define EAPSRP_ACK 3 /* Response 3 - final ack */ +#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ + +#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ + +#define SRP_PSEUDO_ID "pseudo_" +#define SRP_PSEUDO_LEN 7 + +#define MD5_SIGNATURE_SIZE 16 +#define EAP_MIN_CHALLENGE_LENGTH 17 +#define EAP_MAX_CHALLENGE_LENGTH 24 #define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH 3 /* 2^3-1 = 7, 17+7 = 24 */ -#define EAP_STATES \ - "Initial", "Pending", "Closed", "Listen", "Identify", \ - "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" +#define EAP_STATES \ + "Initial", "Pending", "Closed", "Listen", "Identify", \ + "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" -#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) +#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) #if PPP_SERVER -#define eap_server_active(pcb) \ - ((pcb)->eap.es_server.ea_state >= eapIdentify && \ - (pcb)->eap.es_server.ea_state <= eapMD5Chall) +#define eap_server_active(pcb) \ + ((pcb)->eap.es_server.ea_state >= eapIdentify && \ + (pcb)->eap.es_server.ea_state <= eapMD5Chall) #endif /* PPP_SERVER */ /* * Complete EAP state for one PPP session. */ enum eap_state_code { - eapInitial = 0, /* No EAP authentication yet requested */ - eapPending, /* Waiting for LCP (no timer) */ - eapClosed, /* Authentication not in use */ - eapListen, /* Client ready (and timer running) */ - eapIdentify, /* EAP Identify sent */ - eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ - eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ - eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ - eapMD5Chall, /* Sent MD5-Challenge */ - eapOpen, /* Completed authentication */ - eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ - eapBadAuth /* Failed authentication */ + eapInitial = 0, /* No EAP authentication yet requested */ + eapPending, /* Waiting for LCP (no timer) */ + eapClosed, /* Authentication not in use */ + eapListen, /* Client ready (and timer running) */ + eapIdentify, /* EAP Identify sent */ + eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ + eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ + eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ + eapMD5Chall, /* Sent MD5-Challenge */ + eapOpen, /* Completed authentication */ + eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ + eapBadAuth /* Failed authentication */ }; struct eap_auth { - const char *ea_name; /* Our name */ - char ea_peer[MAXNAMELEN +1]; /* Peer's name */ - void *ea_session; /* Authentication library linkage */ - u_char *ea_skey; /* Shared encryption key */ - u_short ea_namelen; /* Length of our name */ - u_short ea_peerlen; /* Length of peer's name */ - enum eap_state_code ea_state; - u_char ea_id; /* Current id */ - u_char ea_requests; /* Number of Requests sent/received */ - u_char ea_responses; /* Number of Responses */ - u_char ea_type; /* One of EAPT_* */ - u32_t ea_keyflags; /* SRP shared key usage flags */ + const char *ea_name; /* Our name */ + char ea_peer[MAXNAMELEN +1]; /* Peer's name */ + void *ea_session; /* Authentication library linkage */ + u_char *ea_skey; /* Shared encryption key */ + u_short ea_namelen; /* Length of our name */ + u_short ea_peerlen; /* Length of peer's name */ + enum eap_state_code ea_state; + u_char ea_id; /* Current id */ + u_char ea_requests; /* Number of Requests sent/received */ + u_char ea_responses; /* Number of Responses */ + u_char ea_type; /* One of EAPT_* */ + u32_t ea_keyflags; /* SRP shared key usage flags */ }; #ifndef EAP_MAX_CHALLENGE_LENGTH -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAP_MAX_CHALLENGE_LENGTH 24 #endif typedef struct eap_state { - struct eap_auth es_client; /* Client (authenticatee) data */ + struct eap_auth es_client; /* Client (authenticatee) data */ #if PPP_SERVER - struct eap_auth es_server; /* Server (authenticator) data */ + struct eap_auth es_server; /* Server (authenticator) data */ #endif /* PPP_SERVER */ - int es_savedtime; /* Saved timeout */ - int es_rechallenge; /* EAP rechallenge interval */ - int es_lwrechallenge; /* SRP lightweight rechallenge inter */ - u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ - int es_usedpseudo; /* Set if we already sent PN */ - int es_challen; /* Length of challenge string */ - u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; + int es_savedtime; /* Saved timeout */ + int es_rechallenge; /* EAP rechallenge interval */ + int es_lwrechallenge; /* SRP lightweight rechallenge inter */ + u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ + int es_usedpseudo; /* Set if we already sent PN */ + int es_challen; /* Length of challenge string */ + u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; } eap_state; /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ -#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ -#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ -#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ +#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ +#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ +#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ +#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ #endif /* moved to ppp_opts.h */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname); @@ -160,7 +160,7 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname); extern const struct protent eap_protent; -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h index 5cdce29d5b..d1d43dc683 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h @@ -35,8 +35,8 @@ #if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ typedef struct ecp_options { - bool required; /* Is ECP required? */ - unsigned enctype; /* Encryption type */ + bool required; /* Is ECP required? */ + unsigned enctype; /* Encryption type */ } ecp_options; extern fsm ecp_fsm[]; diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h b/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h index 20ac22eede..69b2b238c0 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h @@ -53,42 +53,42 @@ typedef union u32_t e32[2]; } eui64_t; -#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) -#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ - ((e).e32[1] == (o).e32[1])) -#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; +#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) +#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ + ((e).e32[1] == (o).e32[1])) +#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; -#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) +#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) -#define eui64_magic(e) do { \ - (e).e32[0] = magic(); \ - (e).e32[1] = magic(); \ - (e).e8[0] &= ~2; \ - } while (0) -#define eui64_magic_nz(x) do { \ - eui64_magic(x); \ - } while (eui64_iszero(x)) -#define eui64_magic_ne(x, y) do { \ - eui64_magic(x); \ - } while (eui64_equals(x, y)) +#define eui64_magic(e) do { \ + (e).e32[0] = magic(); \ + (e).e32[1] = magic(); \ + (e).e8[0] &= ~2; \ + } while (0) +#define eui64_magic_nz(x) do { \ + eui64_magic(x); \ + } while (eui64_iszero(x)) +#define eui64_magic_ne(x, y) do { \ + eui64_magic(x); \ + } while (eui64_equals(x, y)) -#define eui64_get(ll, cp) do { \ - eui64_copy((*cp), (ll)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_get(ll, cp) do { \ + eui64_copy((*cp), (ll)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_put(ll, cp) do { \ - eui64_copy((ll), (*cp)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_put(ll, cp) do { \ + eui64_copy((ll), (*cp)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_set32(e, l) do { \ - (e).e32[0] = 0; \ - (e).e32[1] = lwip_htonl(l); \ - } while (0) -#define eui64_setlo32(e, l) eui64_set32(e, l) +#define eui64_set32(e, l) do { \ + (e).e32[0] = 0; \ + (e).e32[1] = lwip_htonl(l); \ + } while (0) +#define eui64_setlo32(e, l) eui64_set32(e, l) -char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ +char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ #endif /* EUI64_H */ #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h b/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h index b6915d3b80..9f128beae5 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h @@ -46,115 +46,115 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef FSM_H -#define FSM_H +#define FSM_H #include "ppp.h" /* * Packet header = Code, id, length. */ -#define HEADERLEN 4 +#define HEADERLEN 4 /* * CP (LCP, IPCP, etc.) codes. */ -#define CONFREQ 1 /* Configuration Request */ -#define CONFACK 2 /* Configuration Ack */ -#define CONFNAK 3 /* Configuration Nak */ -#define CONFREJ 4 /* Configuration Reject */ -#define TERMREQ 5 /* Termination Request */ -#define TERMACK 6 /* Termination Ack */ -#define CODEREJ 7 /* Code Reject */ +#define CONFREQ 1 /* Configuration Request */ +#define CONFACK 2 /* Configuration Ack */ +#define CONFNAK 3 /* Configuration Nak */ +#define CONFREJ 4 /* Configuration Reject */ +#define TERMREQ 5 /* Termination Request */ +#define TERMACK 6 /* Termination Ack */ +#define CODEREJ 7 /* Code Reject */ /* * Each FSM is described by an fsm structure and fsm callbacks. */ typedef struct fsm { - ppp_pcb *pcb; /* PPP Interface */ - const struct fsm_callbacks *callbacks; /* Callback routines */ - const char *term_reason; /* Reason for closing protocol */ - u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ - /* -- This is our only flag, we might use u_int :1 if we have more flags */ - u16_t protocol; /* Data Link Layer Protocol field value */ - u8_t state; /* State */ - u8_t flags; /* Contains option bits */ - u8_t id; /* Current id */ - u8_t reqid; /* Current request id */ - u8_t retransmits; /* Number of retransmissions left */ - u8_t nakloops; /* Number of nak loops since last ack */ - u8_t rnakloops; /* Number of naks received */ - u8_t maxnakloops; /* Maximum number of nak loops tolerated - (necessary because IPCP require a custom large max nak loops value) */ - u8_t term_reason_len; /* Length of term_reason */ + ppp_pcb *pcb; /* PPP Interface */ + const struct fsm_callbacks *callbacks; /* Callback routines */ + const char *term_reason; /* Reason for closing protocol */ + u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + /* -- This is our only flag, we might use u_int :1 if we have more flags */ + u16_t protocol; /* Data Link Layer Protocol field value */ + u8_t state; /* State */ + u8_t flags; /* Contains option bits */ + u8_t id; /* Current id */ + u8_t reqid; /* Current request id */ + u8_t retransmits; /* Number of retransmissions left */ + u8_t nakloops; /* Number of nak loops since last ack */ + u8_t rnakloops; /* Number of naks received */ + u8_t maxnakloops; /* Maximum number of nak loops tolerated + (necessary because IPCP require a custom large max nak loops value) */ + u8_t term_reason_len; /* Length of term_reason */ } fsm; typedef struct fsm_callbacks { - void (*resetci) /* Reset our Configuration Information */ - (fsm *); - int (*cilen) /* Length of our Configuration Information */ - (fsm *); - void (*addci) /* Add our Configuration Information */ - (fsm *, u_char *, int *); - int (*ackci) /* ACK our Configuration Information */ - (fsm *, u_char *, int); - int (*nakci) /* NAK our Configuration Information */ - (fsm *, u_char *, int, int); - int (*rejci) /* Reject our Configuration Information */ - (fsm *, u_char *, int); - int (*reqci) /* Request peer's Configuration Information */ - (fsm *, u_char *, int *, int); - void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ - (fsm *); - void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ - (fsm *); - void (*starting) /* Called when we want the lower layer */ - (fsm *); - void (*finished) /* Called when we don't want the lower layer */ - (fsm *); - void (*protreject) /* Called when Protocol-Reject received */ - (int); - void (*retransmit) /* Retransmission is necessary */ - (fsm *); - int (*extcode) /* Called when unknown code received */ - (fsm *, int, int, u_char *, int); - const char *proto_name; /* String name for protocol (for messages) */ + void (*resetci) /* Reset our Configuration Information */ + (fsm *); + int (*cilen) /* Length of our Configuration Information */ + (fsm *); + void (*addci) /* Add our Configuration Information */ + (fsm *, u_char *, int *); + int (*ackci) /* ACK our Configuration Information */ + (fsm *, u_char *, int); + int (*nakci) /* NAK our Configuration Information */ + (fsm *, u_char *, int, int); + int (*rejci) /* Reject our Configuration Information */ + (fsm *, u_char *, int); + int (*reqci) /* Request peer's Configuration Information */ + (fsm *, u_char *, int *, int); + void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ + (fsm *); + void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ + (fsm *); + void (*starting) /* Called when we want the lower layer */ + (fsm *); + void (*finished) /* Called when we don't want the lower layer */ + (fsm *); + void (*protreject) /* Called when Protocol-Reject received */ + (int); + void (*retransmit) /* Retransmission is necessary */ + (fsm *); + int (*extcode) /* Called when unknown code received */ + (fsm *, int, int, u_char *, int); + const char *proto_name; /* String name for protocol (for messages) */ } fsm_callbacks; /* * Link states. */ -#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ -#define PPP_FSM_STARTING 1 /* Down, been opened */ -#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ -#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ -#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ -#define PPP_FSM_STOPPING 5 /* Terminating, but open */ -#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ -#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ -#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ -#define PPP_FSM_OPENED 9 /* Connection available */ +#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ +#define PPP_FSM_STARTING 1 /* Down, been opened */ +#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ +#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ +#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ +#define PPP_FSM_STOPPING 5 /* Terminating, but open */ +#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ +#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ +#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ +#define PPP_FSM_OPENED 9 /* Connection available */ /* * Flags - indicate options controlling FSM operation */ -#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ -#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ -#define OPT_SILENT 4 /* Wait for peer to speak first */ +#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ +#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ +#define OPT_SILENT 4 /* Wait for peer to speak first */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define DEFTIMEOUT 3 /* Timeout time in seconds */ -#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ +#define DEFTIMEOUT 3 /* Timeout time in seconds */ +#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ #endif /* moved to ppp_opts.h */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h index 45f46b31ff..38d1b6e18b 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h @@ -46,37 +46,37 @@ #if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPCP_H -#define IPCP_H +#define IPCP_H /* * Options. */ -#define CI_ADDRS 1 /* IP Addresses */ +#define CI_ADDRS 1 /* IP Addresses */ #if VJ_SUPPORT -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* VJ_SUPPORT */ -#define CI_ADDR 3 +#define CI_ADDR 3 #if LWIP_DNS -#define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_DNS1 129 /* Primary DNS value */ #define CI_MS_DNS2 131 /* Secondary DNS value */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define CI_MS_WINS1 130 /* Primary WINS value */ -#define CI_MS_WINS2 132 /* Secondary WINS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT -#define MAX_STATES 16 /* from slcompress.h */ +#define MAX_STATES 16 /* from slcompress.h */ -#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ -#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ -#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ +#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ +#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ +#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ /* maxslot and slot number compression) */ -#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ -#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option*/ +#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ +#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ + /* compression option*/ #endif /* VJ_SUPPORT */ typedef struct ipcp_options { @@ -102,17 +102,17 @@ typedef struct ipcp_options { unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ #endif /* LWIP_DNS */ - u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ + u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ #if LWIP_DNS - u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ + u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ + u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT - u16_t vj_protocol; /* protocol value to use in VJ option */ - u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ + u16_t vj_protocol; /* protocol value to use in VJ option */ + u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ #endif /* VJ_SUPPORT */ } ipcp_options; diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h index 07d1ae3186..e99c80a835 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -142,20 +142,20 @@ #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPV6CP_H -#define IPV6CP_H +#define IPV6CP_H #include "eui64.h" /* * Options. */ -#define CI_IFACEID 1 /* Interface Identifier */ +#define CI_IFACEID 1 /* Interface Identifier */ #ifdef IPV6CP_COMP -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* IPV6CP_COMP */ /* No compression types yet defined. - *#define IPV6CP_COMP 0x004f + *#define IPV6CP_COMP 0x004f */ typedef struct ipv6cp_options { unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h index 12e2a05fc9..e1e108d856 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h @@ -46,62 +46,62 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef LCP_H -#define LCP_H +#define LCP_H #include "ppp.h" /* * Options. */ -#define CI_VENDOR 0 /* Vendor Specific */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_FCSALTERN 9 /* FCS-Alternatives */ -#define CI_SDP 10 /* Self-Describing-Pad */ -#define CI_NUMBERED 11 /* Numbered-Mode */ -#define CI_CALLBACK 13 /* callback */ -#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ -#define CI_SSNHF 18 /* short sequence numbers for multilink */ -#define CI_EPDISC 19 /* endpoint discriminator */ -#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ -#define CI_LDISC 23 /* Link-Discriminator */ -#define CI_LCPAUTH 24 /* LCP Authentication */ -#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ -#define CI_PREFELIS 26 /* Prefix Elision */ -#define CI_MPHDRFMT 27 /* MP Header Format */ -#define CI_I18N 28 /* Internationalization */ -#define CI_SDL 29 /* Simple Data Link */ +#define CI_VENDOR 0 /* Vendor Specific */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCSALTERN 9 /* FCS-Alternatives */ +#define CI_SDP 10 /* Self-Describing-Pad */ +#define CI_NUMBERED 11 /* Numbered-Mode */ +#define CI_CALLBACK 13 /* callback */ +#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ +#define CI_SSNHF 18 /* short sequence numbers for multilink */ +#define CI_EPDISC 19 /* endpoint discriminator */ +#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ +#define CI_LDISC 23 /* Link-Discriminator */ +#define CI_LCPAUTH 24 /* LCP Authentication */ +#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ +#define CI_PREFELIS 26 /* Prefix Elision */ +#define CI_MPHDRFMT 27 /* MP Header Format */ +#define CI_I18N 28 /* Internationalization */ +#define CI_SDL 29 /* Simple Data Link */ /* * LCP-specific packet types (code numbers). */ -#define PROTREJ 8 /* Protocol Reject */ -#define ECHOREQ 9 /* Echo Request */ -#define ECHOREP 10 /* Echo Reply */ -#define DISCREQ 11 /* Discard Request */ -#define IDENTIF 12 /* Identification */ -#define TIMEREM 13 /* Time Remaining */ +#define PROTREJ 8 /* Protocol Reject */ +#define ECHOREQ 9 /* Echo Request */ +#define ECHOREP 10 /* Echo Reply */ +#define DISCREQ 11 /* Discard Request */ +#define IDENTIF 12 /* Identification */ +#define TIMEREM 13 /* Time Remaining */ /* Value used as data for CI_CALLBACK option */ -#define CBCP_OPT 6 /* Use callback control protocol */ +#define CBCP_OPT 6 /* Use callback control protocol */ #if 0 /* moved to ppp_opts.h */ -#define DEFMRU 1500 /* Try for this */ -#define MINMRU 128 /* No MRUs below this */ -#define MAXMRU 16384 /* Normally limit MRU to this */ +#define DEFMRU 1500 /* Try for this */ +#define MINMRU 128 /* No MRUs below this */ +#define MAXMRU 16384 /* Normally limit MRU to this */ #endif /* moved to ppp_opts.h */ /* An endpoint discriminator, used with multilink. */ -#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ struct epdisc { - unsigned char class_; /* -- The word "class" is reserved in C++. */ - unsigned char length; - unsigned char value[MAX_ENDP_LEN]; + unsigned char class_; /* -- The word "class" is reserved in C++. */ + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; }; /* @@ -137,20 +137,20 @@ typedef struct lcp_options { unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ - u16_t mru; /* Value of MRU */ + u16_t mru; /* Value of MRU */ #ifdef HAVE_MULTILINK - u16_t mrru; /* Value of MRRU, and multilink enable */ + u16_t mrru; /* Value of MRRU, and multilink enable */ #endif /* MULTILINK */ #if CHAP_SUPPORT - u8_t chap_mdtype; /* which MD types (hashing algorithm) */ + u8_t chap_mdtype; /* which MD types (hashing algorithm) */ #endif /* CHAP_SUPPORT */ - u32_t asyncmap; /* Value of async map */ + u32_t asyncmap; /* Value of async map */ u32_t magicnumber; - u8_t numloops; /* Number of loops during magic number neg. */ + u8_t numloops; /* Number of loops during magic number neg. */ #if LQR_SUPPORT - u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ + u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ #endif /* LQR_SUPPORT */ - struct epdisc endpoint; /* endpoint discriminator */ + struct epdisc endpoint; /* endpoint discriminator */ } lcp_options; void lcp_open(ppp_pcb *pcb); @@ -164,7 +164,7 @@ extern const struct protent lcp_protent; #if 0 /* moved to ppp_opts.h */ /* Default number of times we receive our magic number from the peer before deciding the link is looped-back. */ -#define DEFLOOPBACKFAIL 10 +#define DEFLOOPBACKFAIL 10 #endif /* moved to ppp_opts.h */ #endif /* LCP_H */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h b/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h index a2a9b530e5..cc581d405c 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h @@ -98,7 +98,7 @@ void magic_randomize(void); /* * Return a new random number. */ -u32_t magic(void); /* Returns the next magic number */ +u32_t magic(void); /* Returns the next magic number */ /* * Fill buffer with random bytes diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h b/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h index 1ae8a5d924..1a3aa01c37 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h @@ -41,19 +41,19 @@ #include "netif/ppp/pppcrypt.h" -#define MPPE_PAD 4 /* MPPE growth per frame */ -#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ +#define MPPE_PAD 4 /* MPPE growth per frame */ +#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ /* option bits for ccp_options.mppe */ -#define MPPE_OPT_40 0x01 /* 40 bit */ -#define MPPE_OPT_128 0x02 /* 128 bit */ -#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ +#define MPPE_OPT_40 0x01 /* 40 bit */ +#define MPPE_OPT_128 0x02 /* 128 bit */ +#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ /* unsupported opts */ -#define MPPE_OPT_56 0x08 /* 56 bit */ -#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ -#define MPPE_OPT_D 0x20 /* Unknown */ +#define MPPE_OPT_56 0x08 /* 56 bit */ +#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ +#define MPPE_OPT_D 0x20 /* Unknown */ #define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D) -#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ +#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ /* * This is not nice ... the alternative is a bitfield struct though. @@ -62,70 +62,70 @@ * but then we have to do a lwip_htonl() all the time and/or we still need * to know which octet is which. */ -#define MPPE_C_BIT 0x01 /* MPPC */ -#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ -#define MPPE_L_BIT 0x20 /* 40-bit */ -#define MPPE_S_BIT 0x40 /* 128-bit */ -#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ -#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ +#define MPPE_C_BIT 0x01 /* MPPC */ +#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ +#define MPPE_L_BIT 0x20 /* 40-bit */ +#define MPPE_S_BIT 0x40 /* 128-bit */ +#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ +#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ /* Does not include H bit; used for least significant octet only. */ #define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT) /* Build a CI from mppe opts (see RFC 3078) */ -#define MPPE_OPTS_TO_CI(opts, ci) \ - do { \ - u_char *ptr = ci; /* u_char[4] */ \ - \ - /* H bit */ \ - if (opts & MPPE_OPT_STATEFUL) \ - *ptr++ = 0x0; \ - else \ - *ptr++ = MPPE_H_BIT; \ - *ptr++ = 0; \ - *ptr++ = 0; \ - \ - /* S,L bits */ \ - *ptr = 0; \ - if (opts & MPPE_OPT_128) \ - *ptr |= MPPE_S_BIT; \ - if (opts & MPPE_OPT_40) \ - *ptr |= MPPE_L_BIT; \ - /* M,D,C bits not supported */ \ +#define MPPE_OPTS_TO_CI(opts, ci) \ + do { \ + u_char *ptr = ci; /* u_char[4] */ \ + \ + /* H bit */ \ + if (opts & MPPE_OPT_STATEFUL) \ + *ptr++ = 0x0; \ + else \ + *ptr++ = MPPE_H_BIT; \ + *ptr++ = 0; \ + *ptr++ = 0; \ + \ + /* S,L bits */ \ + *ptr = 0; \ + if (opts & MPPE_OPT_128) \ + *ptr |= MPPE_S_BIT; \ + if (opts & MPPE_OPT_40) \ + *ptr |= MPPE_L_BIT; \ + /* M,D,C bits not supported */ \ } while (/* CONSTCOND */ 0) /* The reverse of the above */ -#define MPPE_CI_TO_OPTS(ci, opts) \ - do { \ - const u_char *ptr = ci; /* u_char[4] */ \ - \ - opts = 0; \ - \ - /* H bit */ \ - if (!(ptr[0] & MPPE_H_BIT)) \ - opts |= MPPE_OPT_STATEFUL; \ - \ - /* S,L bits */ \ - if (ptr[3] & MPPE_S_BIT) \ - opts |= MPPE_OPT_128; \ - if (ptr[3] & MPPE_L_BIT) \ - opts |= MPPE_OPT_40; \ - \ - /* M,D,C bits */ \ - if (ptr[3] & MPPE_M_BIT) \ - opts |= MPPE_OPT_56; \ - if (ptr[3] & MPPE_D_BIT) \ - opts |= MPPE_OPT_D; \ - if (ptr[3] & MPPE_C_BIT) \ - opts |= MPPE_OPT_MPPC; \ - \ - /* Other bits */ \ - if (ptr[0] & ~MPPE_H_BIT) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[1] || ptr[2]) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[3] & ~MPPE_ALL_BITS) \ - opts |= MPPE_OPT_UNKNOWN; \ +#define MPPE_CI_TO_OPTS(ci, opts) \ + do { \ + const u_char *ptr = ci; /* u_char[4] */ \ + \ + opts = 0; \ + \ + /* H bit */ \ + if (!(ptr[0] & MPPE_H_BIT)) \ + opts |= MPPE_OPT_STATEFUL; \ + \ + /* S,L bits */ \ + if (ptr[3] & MPPE_S_BIT) \ + opts |= MPPE_OPT_128; \ + if (ptr[3] & MPPE_L_BIT) \ + opts |= MPPE_OPT_40; \ + \ + /* M,D,C bits */ \ + if (ptr[3] & MPPE_M_BIT) \ + opts |= MPPE_OPT_56; \ + if (ptr[3] & MPPE_D_BIT) \ + opts |= MPPE_OPT_D; \ + if (ptr[3] & MPPE_C_BIT) \ + opts |= MPPE_OPT_MPPC; \ + \ + /* Other bits */ \ + if (ptr[0] & ~MPPE_H_BIT) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[1] || ptr[2]) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[3] & ~MPPE_ALL_BITS) \ + opts |= MPPE_OPT_UNKNOWN; \ } while (/* CONSTCOND */ 0) /* Shared MPPE padding between MSCHAP and MPPE */ @@ -148,18 +148,18 @@ static const u8_t mppe_sha1_pad2[SHA1_PAD_SIZE] = { * State for an MPPE (de)compressor. */ typedef struct ppp_mppe_state { - lwip_arc4_context arc4; - u8_t master_key[MPPE_MAX_KEY_LEN]; - u8_t session_key[MPPE_MAX_KEY_LEN]; - u8_t keylen; /* key length in bytes */ - /* NB: 128-bit == 16, 40-bit == 8! - * If we want to support 56-bit, the unit has to change to bits - */ - u8_t bits; /* MPPE control bits */ - u16_t ccount; /* 12-bit coherency count (seqno) */ - u16_t sanity_errors; /* take down LCP if too many */ - unsigned int stateful :1; /* stateful mode flag */ - unsigned int discard :1; /* stateful mode packet loss flag */ + lwip_arc4_context arc4; + u8_t master_key[MPPE_MAX_KEY_LEN]; + u8_t session_key[MPPE_MAX_KEY_LEN]; + u8_t keylen; /* key length in bytes */ + /* NB: 128-bit == 16, 40-bit == 8! + * If we want to support 56-bit, the unit has to change to bits + */ + u8_t bits; /* MPPE control bits */ + u16_t ccount; /* 12-bit coherency count (seqno) */ + u16_t sanity_errors; /* take down LCP if too many */ + unsigned int stateful :1; /* stateful mode flag */ + unsigned int discard :1; /* stateful mode packet loss flag */ } ppp_mppe_state; void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key); diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h index 4af724cd90..91b08e6779 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h index e893890ed7..5e3a085165 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h index 570445687e..a4aa1dcc83 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h index 1244011890..4d7b04d8d0 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h index a4c53e07c5..d8f347c64e 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h index d9ea097efd..5c4c32357f 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -103,8 +103,8 @@ /* * The basic PPP frame. */ -#define PPP_HDRLEN 4 /* octets for standard ppp header */ -#define PPP_FCSLEN 2 /* octets for FCS */ +#define PPP_HDRLEN 4 /* octets for standard ppp header */ +#define PPP_FCSLEN 2 /* octets for FCS */ /* * Values for phase. diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h index 1d4c7742f3..e017af2ceb 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h @@ -70,66 +70,66 @@ /* * The basic PPP frame. */ -#define PPP_ADDRESS(p) (((u_char *)(p))[0]) -#define PPP_CONTROL(p) (((u_char *)(p))[1]) -#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) +#define PPP_ADDRESS(p) (((u_char *)(p))[0]) +#define PPP_CONTROL(p) (((u_char *)(p))[1]) +#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) /* * Significant octet values. */ -#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ -#define PPP_UI 0x03 /* Unnumbered Information */ -#define PPP_FLAG 0x7e /* Flag Sequence */ -#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ -#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ +#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ +#define PPP_UI 0x03 /* Unnumbered Information */ +#define PPP_FLAG 0x7e /* Flag Sequence */ +#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ +#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ /* * Protocol field values. */ -#define PPP_IP 0x21 /* Internet Protocol */ +#define PPP_IP 0x21 /* Internet Protocol */ #if 0 /* UNUSED */ -#define PPP_AT 0x29 /* AppleTalk Protocol */ -#define PPP_IPX 0x2b /* IPX protocol */ +#define PPP_AT 0x29 /* AppleTalk Protocol */ +#define PPP_IPX 0x2b /* IPX protocol */ #endif /* UNUSED */ #if VJ_SUPPORT -#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ -#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ +#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ +#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ #endif /* VJ_SUPPORT */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ +#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_COMP 0xfd /* compressed packet */ +#define PPP_COMP 0xfd /* compressed packet */ #endif /* CCP_SUPPORT */ -#define PPP_IPCP 0x8021 /* IP Control Protocol */ +#define PPP_IPCP 0x8021 /* IP Control Protocol */ #if 0 /* UNUSED */ -#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ -#define PPP_IPXCP 0x802b /* IPX Control Protocol */ +#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ +#define PPP_IPXCP 0x802b /* IPX Control Protocol */ #endif /* UNUSED */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ +#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_CCP 0x80fd /* Compression Control Protocol */ +#define PPP_CCP 0x80fd /* Compression Control Protocol */ #endif /* CCP_SUPPORT */ #if ECP_SUPPORT -#define PPP_ECP 0x8053 /* Encryption Control Protocol */ +#define PPP_ECP 0x8053 /* Encryption Control Protocol */ #endif /* ECP_SUPPORT */ -#define PPP_LCP 0xc021 /* Link Control Protocol */ +#define PPP_LCP 0xc021 /* Link Control Protocol */ #if PAP_SUPPORT -#define PPP_PAP 0xc023 /* Password Authentication Protocol */ +#define PPP_PAP 0xc023 /* Password Authentication Protocol */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT -#define PPP_LQR 0xc025 /* Link Quality Report protocol */ +#define PPP_LQR 0xc025 /* Link Quality Report protocol */ #endif /* LQR_SUPPORT */ #if CHAP_SUPPORT -#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ +#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ #endif /* CHAP_SUPPORT */ #if CBCP_SUPPORT -#define PPP_CBCP 0xc029 /* Callback Control Protocol */ +#define PPP_CBCP 0xc029 /* Callback Control Protocol */ #endif /* CBCP_SUPPORT */ #if EAP_SUPPORT -#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ +#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ #endif /* EAP_SUPPORT */ /* @@ -161,59 +161,59 @@ struct link_callbacks { * What to do with network protocol (NP) packets. */ enum NPmode { - NPMODE_PASS, /* pass the packet through */ - NPMODE_DROP, /* silently drop the packet */ - NPMODE_ERROR, /* return an error */ - NPMODE_QUEUE /* save it up for later. */ + NPMODE_PASS, /* pass the packet through */ + NPMODE_DROP, /* silently drop the packet */ + NPMODE_ERROR, /* return an error */ + NPMODE_QUEUE /* save it up for later. */ }; /* * Statistics. */ #if PPP_STATS_SUPPORT -struct pppstat { - unsigned int ppp_ibytes; /* bytes received */ - unsigned int ppp_ipackets; /* packets received */ - unsigned int ppp_ierrors; /* receive errors */ - unsigned int ppp_obytes; /* bytes sent */ - unsigned int ppp_opackets; /* packets sent */ - unsigned int ppp_oerrors; /* transmit errors */ +struct pppstat { + unsigned int ppp_ibytes; /* bytes received */ + unsigned int ppp_ipackets; /* packets received */ + unsigned int ppp_ierrors; /* receive errors */ + unsigned int ppp_obytes; /* bytes sent */ + unsigned int ppp_opackets; /* packets sent */ + unsigned int ppp_oerrors; /* transmit errors */ }; #if VJ_SUPPORT struct vjstat { - unsigned int vjs_packets; /* outbound packets */ + unsigned int vjs_packets; /* outbound packets */ unsigned int vjs_compressed; /* outbound compressed packets */ - unsigned int vjs_searches; /* searches for connection state */ - unsigned int vjs_misses; /* times couldn't find conn. state */ + unsigned int vjs_searches; /* searches for connection state */ + unsigned int vjs_misses; /* times couldn't find conn. state */ unsigned int vjs_uncompressedin; /* inbound uncompressed packets */ unsigned int vjs_compressedin; /* inbound compressed packets */ - unsigned int vjs_errorin; /* inbound unknown type packets */ - unsigned int vjs_tossed; /* inbound packets tossed because of error */ + unsigned int vjs_errorin; /* inbound unknown type packets */ + unsigned int vjs_tossed; /* inbound packets tossed because of error */ }; #endif /* VJ_SUPPORT */ struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ + struct pppstat p; /* basic PPP statistics */ #if VJ_SUPPORT - struct vjstat vj; /* VJ header compression statistics */ + struct vjstat vj; /* VJ header compression statistics */ #endif /* VJ_SUPPORT */ }; #if CCP_SUPPORT struct compstat { - unsigned int unc_bytes; /* total uncompressed bytes */ - unsigned int unc_packets; /* total uncompressed packets */ - unsigned int comp_bytes; /* compressed bytes */ - unsigned int comp_packets; /* compressed packets */ - unsigned int inc_bytes; /* incompressible bytes */ - unsigned int inc_packets; /* incompressible packets */ - unsigned int ratio; /* recent compression ratio << 8 */ + unsigned int unc_bytes; /* total uncompressed bytes */ + unsigned int unc_packets; /* total uncompressed packets */ + unsigned int comp_bytes; /* compressed bytes */ + unsigned int comp_packets; /* compressed packets */ + unsigned int inc_bytes; /* incompressible bytes */ + unsigned int inc_packets; /* incompressible packets */ + unsigned int ratio; /* recent compression ratio << 8 */ }; struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ + struct compstat c; /* packet compression statistics */ + struct compstat d; /* packet decompression statistics */ }; #endif /* CCP_SUPPORT */ @@ -225,37 +225,37 @@ struct ppp_comp_stats { * the last NP packet was sent or received. */ struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ + time_t xmit_idle; /* time since last NP packet sent */ + time_t recv_idle; /* time since last NP packet received */ }; #endif /* PPP_IDLETIMELIMIT */ /* values for epdisc.class */ -#define EPD_NULL 0 /* null discriminator, no data */ -#define EPD_LOCAL 1 -#define EPD_IP 2 -#define EPD_MAC 3 -#define EPD_MAGIC 4 -#define EPD_PHONENUM 5 +#define EPD_NULL 0 /* null discriminator, no data */ +#define EPD_LOCAL 1 +#define EPD_IP 2 +#define EPD_MAC 3 +#define EPD_MAGIC 4 +#define EPD_PHONENUM 5 /* * Global variables. */ #ifdef HAVE_MULTILINK -extern u8_t multilink; /* enable multilink operation */ -extern u8_t doing_multilink; -extern u8_t multilink_master; -extern u8_t bundle_eof; -extern u8_t bundle_terminating; +extern u8_t multilink; /* enable multilink operation */ +extern u8_t doing_multilink; +extern u8_t multilink_master; +extern u8_t bundle_eof; +extern u8_t bundle_terminating; #endif #ifdef MAXOCTETS -extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ extern int maxoctets_dir; /* Direction : - 0 - in+out (default) - 1 - in - 2 - out - 3 - max(in,out) */ + 0 - in+out (default) + 1 - in + 2 - out + 3 - max(in,out) */ extern int maxoctets_timeout; /* Timeout for check of octets limit */ #define PPP_OCTETS_DIRECTION_SUM 0 #define PPP_OCTETS_DIRECTION_IN 1 @@ -275,7 +275,7 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */ * for a particular protocol. */ struct protent { - u_short protocol; /* PPP protocol number */ + u_short protocol; /* PPP protocol number */ /* Initialization procedure */ void (*init) (ppp_pcb *pcb); /* Process a received packet */ @@ -293,19 +293,19 @@ struct protent { #if PRINTPKT_SUPPORT /* Print a packet in readable form */ int (*printpkt) (const u_char *pkt, int len, - void (*printer) (void *, const char *, ...), - void *arg); + void (*printer) (void *, const char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT /* Process a received data packet */ void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - const char *name; /* Text name of protocol */ - const char *data_name; /* Text name of corresponding data protocol */ + const char *name; /* Text name of protocol */ + const char *data_name; /* Text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - option_t *options; /* List of command-line options */ + option_t *options; /* List of command-line options */ /* Check requested options, assign defaults */ void (*check_options) (void); #endif /* PPP_OPTIONS */ @@ -323,28 +323,28 @@ extern const struct protent* const protocols[]; /* Values for auth_pending, auth_done */ #if PAP_SUPPORT -#define PAP_WITHPEER 0x1 -#define PAP_PEER 0x2 +#define PAP_WITHPEER 0x1 +#define PAP_PEER 0x2 #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT -#define CHAP_WITHPEER 0x4 -#define CHAP_PEER 0x8 +#define CHAP_WITHPEER 0x4 +#define CHAP_PEER 0x8 #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT -#define EAP_WITHPEER 0x10 -#define EAP_PEER 0x20 +#define EAP_WITHPEER 0x10 +#define EAP_PEER 0x20 #endif /* EAP_SUPPORT */ /* Values for auth_done only */ #if CHAP_SUPPORT -#define CHAP_MD5_WITHPEER 0x40 -#define CHAP_MD5_PEER 0x80 +#define CHAP_MD5_WITHPEER 0x40 +#define CHAP_MD5_PEER 0x80 #if MSCHAP_SUPPORT -#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ -#define CHAP_MS_WITHPEER 0x100 -#define CHAP_MS_PEER 0x200 -#define CHAP_MS2_WITHPEER 0x400 -#define CHAP_MS2_PEER 0x800 +#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ +#define CHAP_MS_WITHPEER 0x100 +#define CHAP_MS_PEER 0x200 +#define CHAP_MS2_WITHPEER 0x400 +#define CHAP_MS2_PEER 0x800 #endif /* MSCHAP_SUPPORT */ #endif /* CHAP_SUPPORT */ @@ -366,10 +366,10 @@ extern const struct protent* const protocols[]; * PPP statistics structure */ struct pppd_stats { - unsigned int bytes_in; - unsigned int bytes_out; - unsigned int pkts_in; - unsigned int pkts_out; + unsigned int bytes_in; + unsigned int bytes_out; + unsigned int pkts_in; + unsigned int pkts_out; }; #endif /* PPP_STATS_SUPPORT */ @@ -378,7 +378,7 @@ struct pppd_stats { * PPP private functions */ - + /* * Functions called from lwIP core. */ @@ -499,34 +499,34 @@ void update_link_stats(int u); /* Get stats at link termination */ * cp MUST be u_char *. */ #define GETCHAR(c, cp) { \ - (c) = *(cp)++; \ + (c) = *(cp)++; \ } #define PUTCHAR(c, cp) { \ - *(cp)++ = (u_char) (c); \ + *(cp)++ = (u_char) (c); \ } #define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ + (s) = *(cp)++ << 8; \ + (s) |= *(cp)++; \ } #define PUTSHORT(s, cp) { \ - *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ + *(cp)++ = (u_char) ((s) >> 8); \ + *(cp)++ = (u_char) (s); \ } #define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ + (l) = *(cp)++ << 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; \ } #define PUTLONG(l, cp) { \ - *(cp)++ = (u_char) ((l) >> 24); \ - *(cp)++ = (u_char) ((l) >> 16); \ - *(cp)++ = (u_char) ((l) >> 8); \ - *(cp)++ = (u_char) (l); \ + *(cp)++ = (u_char) ((l) >> 24); \ + *(cp)++ = (u_char) ((l) >> 16); \ + *(cp)++ = (u_char) ((l) >> 8); \ + *(cp)++ = (u_char) (l); \ } -#define INCPTR(n, cp) ((cp) += (n)) -#define DECPTR(n, cp) ((cp) -= (n)) +#define INCPTR(n, cp) ((cp) += (n)) +#define DECPTR(n, cp) ((cp) -= (n)) /* * System dependent definitions for user-level 4.3BSD UNIX implementation. @@ -535,10 +535,10 @@ void update_link_stats(int u); /* Get stats at link termination */ #define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0) #define UNTIMEOUT(f, a) sys_untimeout((f), (a)) -#define BZERO(s, n) memset(s, 0, n) -#define BCMP(s1, s2, l) memcmp(s1, s2, l) +#define BZERO(s, n) memset(s, 0, n) +#define BCMP(s1, s2, l) memcmp(s1, s2, l) -#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } +#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } /* * MAKEHEADER - Add Header fields to a packet. @@ -551,7 +551,7 @@ void update_link_stats(int u); /* Get stats at link termination */ /* Procedures exported from auth.c */ void link_required(ppp_pcb *pcb); /* we are starting to use the link */ void link_terminated(ppp_pcb *pcb); /* we are finished with the link */ -void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ +void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ void upper_layers_down(ppp_pcb *pcb); /* take all NCPs down */ void link_established(ppp_pcb *pcb); /* the link is up; authenticate now */ void start_networks(ppp_pcb *pcb); /* start all the network control protos */ @@ -561,21 +561,21 @@ void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen); /* check the user name and passwd against configuration */ void auth_peer_fail(ppp_pcb *pcb, int protocol); - /* peer failed to authenticate itself */ + /* peer failed to authenticate itself */ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen); - /* peer successfully authenticated itself */ + /* peer successfully authenticated itself */ #endif /* PPP_SERVER */ void auth_withpeer_fail(ppp_pcb *pcb, int protocol); - /* we failed to authenticate ourselves */ + /* we failed to authenticate ourselves */ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor); - /* we successfully authenticated ourselves */ + /* we successfully authenticated ourselves */ #endif /* PPP_AUTH_SUPPORT */ void np_up(ppp_pcb *pcb, int proto); /* a network protocol has come up */ void np_down(ppp_pcb *pcb, int proto); /* a network protocol has gone down */ void np_finished(ppp_pcb *pcb, int proto); /* a network protocol no longer needs link */ #if PPP_AUTH_SUPPORT int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server); - /* get "secret" for chap */ + /* get "secret" for chap */ #endif /* PPP_AUTH_SUPPORT */ /* Procedures exported from ipcp.c */ @@ -583,8 +583,8 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre /* Procedures exported from demand.c */ #if DEMAND_SUPPORT -void demand_conf (void); /* config interface(s) for demand-dial */ -void demand_block (void); /* set all NPs to queue up packets */ +void demand_conf (void); /* config interface(s) for demand-dial */ +void demand_block (void); /* set all NPs to queue up packets */ void demand_unblock (void); /* set all NPs to pass packets */ void demand_discard (void); /* set all NPs to discard packets */ void demand_rexmit (int, u32_t); /* retransmit saved frames for an NP*/ @@ -601,10 +601,10 @@ void mp_bundle_terminated (void); char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ #else -#define mp_bundle_terminated() /* nothing */ -#define mp_exit_bundle() /* nothing */ -#define doing_multilink 0 -#define multilink_master 0 +#define mp_bundle_terminated() /* nothing */ +#define mp_exit_bundle() /* nothing */ +#define doing_multilink 0 +#define multilink_master 0 #endif /* Procedures exported from utils.c. */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h b/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h index a7b2099f25..e1823a2e06 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h @@ -36,7 +36,7 @@ /* This header file is included in all PPP modules needing hashes and/or ciphers */ #ifndef PPPCRYPT_H -#define PPPCRYPT_H +#define PPPCRYPT_H /* * If included PolarSSL copy is not used, user is expected to include diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h b/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h index 7ead045910..1cd6e292c9 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h b/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h index 9f8f2892b4..de4ef62455 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h b/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h index 7da792ecc7..7131e8679d 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h @@ -53,44 +53,44 @@ /* * Packet header = Code, id, length. */ -#define UPAP_HEADERLEN 4 +#define UPAP_HEADERLEN 4 /* * UPAP codes. */ -#define UPAP_AUTHREQ 1 /* Authenticate-Request */ -#define UPAP_AUTHACK 2 /* Authenticate-Ack */ -#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ +#define UPAP_AUTHREQ 1 /* Authenticate-Request */ +#define UPAP_AUTHACK 2 /* Authenticate-Ack */ +#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ /* * Client states. */ -#define UPAPCS_INITIAL 0 /* Connection down */ -#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ -#define UPAPCS_OPEN 4 /* We've received an Ack */ -#define UPAPCS_BADAUTH 5 /* We've received a Nak */ +#define UPAPCS_INITIAL 0 /* Connection down */ +#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ +#define UPAPCS_OPEN 4 /* We've received an Ack */ +#define UPAPCS_BADAUTH 5 /* We've received a Nak */ /* * Server states. */ -#define UPAPSS_INITIAL 0 /* Connection down */ -#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ -#define UPAPSS_OPEN 4 /* We've sent an Ack */ -#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ +#define UPAPSS_INITIAL 0 /* Connection down */ +#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ +#define UPAPSS_OPEN 4 /* We've sent an Ack */ +#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ +#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ +#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ #endif /* moved to ppp_opts.h */ /* @@ -98,16 +98,16 @@ */ #if PAP_SUPPORT typedef struct upap_state { - const char *us_user; /* User */ - u8_t us_userlen; /* User length */ - const char *us_passwd; /* Password */ - u8_t us_passwdlen; /* Password length */ - u8_t us_clientstate; /* Client state */ + const char *us_user; /* User */ + u8_t us_userlen; /* User length */ + const char *us_passwd; /* Password */ + u8_t us_passwdlen; /* Password length */ + u8_t us_clientstate; /* Client state */ #if PPP_SERVER - u8_t us_serverstate; /* Server state */ + u8_t us_serverstate; /* Server state */ #endif /* PPP_SERVER */ - u8_t us_id; /* Current id */ - u8_t us_transmits; /* Number of auth-reqs sent */ + u8_t us_id; /* Current id */ + u8_t us_transmits; /* Number of auth-reqs sent */ } upap_state; #endif /* PAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ethernet.c b/components/net/lwip-2.0.2/src/netif/ethernet.c index 52ea4236d5..988b997040 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernet.c +++ b/components/net/lwip-2.0.2/src/netif/ethernet.c @@ -1,7 +1,7 @@ /** * @file * Ethernet common functions - * + * * @defgroup ethernet Ethernet * @ingroup callbackstyle_api */ @@ -72,7 +72,7 @@ const struct eth_addr ethzero = {{0,0,0,0,0,0}}; * * @param p the received packet, p->payload pointing to the ethernet header * @param netif the network interface on which the packet was received - * + * * @see LWIP_HOOK_UNKNOWN_ETH_PROTOCOL * @see ETHARP_SUPPORT_VLAN * @see LWIP_HOOK_VLAN_CHECK diff --git a/components/net/lwip-2.0.2/src/netif/ethernetif.c b/components/net/lwip-2.0.2/src/netif/ethernetif.c index b93acb1fcf..ee339c2dd7 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.2/src/netif/ethernetif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * COPYRIGHT (C) 2006-2018, RT-Thread Development Team + * COPYRIGHT (C) 2006-2021, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -173,7 +173,7 @@ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) } else { - dhcp_stop((struct netif *)netif->user_data); + dhcp_stop((struct netif *)netif->user_data); } return ERR_OK; } @@ -868,27 +868,27 @@ void list_if(void) rt_kprintf("gw address: %s\n", ipaddr_ntoa(&(netif->gw))); rt_kprintf("net mask : %s\n", ipaddr_ntoa(&(netif->netmask))); #if LWIP_IPV6 - { - ip6_addr_t *addr; - int addr_state; - int i; + { + ip6_addr_t *addr; + int addr_state; + int i; - addr = (ip6_addr_t *)&netif->ip6_addr[0]; - addr_state = netif->ip6_addr_state[0]; + addr = (ip6_addr_t *)&netif->ip6_addr[0]; + addr_state = netif->ip6_addr_state[0]; - rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - for(i=1; iip6_addr[i]; - addr_state = netif->ip6_addr_state[i]; + for(i=1; iip6_addr[i]; + addr_state = netif->ip6_addr_state[i]; - rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - } + rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + } - } + } rt_kprintf("\r\n"); #endif /* LWIP_IPV6 */ netif = netif->next; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/auth.c b/components/net/lwip-2.0.2/src/netif/ppp/auth.c index c8673ad0fb..480a653ddd 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/auth.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/auth.c @@ -133,10 +133,10 @@ #if 0 /* UNUSED */ /* Bits in scan_authfile return value */ -#define NONWILD_SERVER 1 -#define NONWILD_CLIENT 2 +#define NONWILD_SERVER 1 +#define NONWILD_CLIENT 2 -#define ISWILD(word) (word[0] == '*' && word[1] == 0) +#define ISWILD(word) (word[0] == '*' && word[1] == 0) #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -169,8 +169,8 @@ int (*pap_check_hook) (void) = NULL; /* Hook for a plugin to check the PAP user and password */ int (*pap_auth_hook) (char *user, char *passwd, char **msgp, - struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **paddrs, + struct wordlist **popts) = NULL; /* Hook for a plugin to know about the PAP user logout */ void (*pap_logout_hook) (void) = NULL; @@ -187,7 +187,7 @@ int (*chap_passwd_hook) (char *user, char *passwd) = NULL; /* Hook for a plugin to say whether it is OK if the peer refuses to authenticate. */ int (*null_auth_hook) (struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **popts) = NULL; int (*allowed_address_hook) (u32_t addr) = NULL; #endif /* UNUSED */ @@ -210,27 +210,27 @@ struct notifier *link_down_notifier = NULL; * Option variables. */ #if 0 /* MOVED TO ppp_settings */ -bool uselogin = 0; /* Use /etc/passwd for checking PAP */ -bool session_mgmt = 0; /* Do session management (login records) */ -bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ -bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ -bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ -bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ +bool uselogin = 0; /* Use /etc/passwd for checking PAP */ +bool session_mgmt = 0; /* Do session management (login records) */ +bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ +bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ +bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ +bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ #if MSCHAP_SUPPORT -bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #else /* MSCHAP_SUPPORT */ -bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #endif /* MSCHAP_SUPPORT */ -bool usehostname = 0; /* Use hostname for our_name */ -bool auth_required = 0; /* Always require authentication from peer */ -bool allow_any_ip = 0; /* Allow peer to use any IP address */ -bool explicit_remote = 0; /* User specified explicit remote name */ -bool explicit_user = 0; /* Set if "user" option supplied */ -bool explicit_passwd = 0; /* Set if "password" option supplied */ -char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -static char *uafname; /* name of most recent +ua file */ +bool usehostname = 0; /* Use hostname for our_name */ +bool auth_required = 0; /* Always require authentication from peer */ +bool allow_any_ip = 0; /* Allow peer to use any IP address */ +bool explicit_remote = 0; /* User specified explicit remote name */ +bool explicit_user = 0; /* Set if "user" option supplied */ +bool explicit_passwd = 0; /* Set if "password" option supplied */ +char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ +static char *uafname; /* name of most recent +ua file */ extern char *crypt (const char *, const char *); #endif /* UNUSED */ @@ -252,8 +252,8 @@ static int have_srp_secret (char *client, char *server, int need_ip, int *lacks_ipp); static int ip_addr_check (u32_t, struct permitted_ip *); static int scan_authfile (FILE *, char *, char *, char *, - struct wordlist **, struct wordlist **, - char *, int); + struct wordlist **, struct wordlist **, + char *, int); static void free_wordlist (struct wordlist *); static void set_allowed_addrs (int, struct wordlist *, struct wordlist *); static int some_ip_ok (struct wordlist *); @@ -427,46 +427,46 @@ setupapfile(argv) /* open user info file */ fname = strdup(*argv); if (fname == NULL) - novm("+ua file name"); + novm("+ua file name"); euid = geteuid(); if (seteuid(getuid()) == -1) { - option_error("unable to reset uid before opening %s: %m", fname); - return 0; + option_error("unable to reset uid before opening %s: %m", fname); + return 0; } ufile = fopen(fname, "r"); if (seteuid(euid) == -1) - fatal("unable to regain privileges: %m"); + fatal("unable to regain privileges: %m"); if (ufile == NULL) { - option_error("unable to open user login data file %s", fname); - return 0; + option_error("unable to open user login data file %s", fname); + return 0; } check_access(ufile, fname); uafname = fname; /* get username */ if (fgets(u, MAXNAMELEN - 1, ufile) == NULL - || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { - fclose(ufile); - option_error("unable to read user login data file %s", fname); - return 0; + || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { + fclose(ufile); + option_error("unable to read user login data file %s", fname); + return 0; } fclose(ufile); /* get rid of newlines */ l = strlen(u); if (l > 0 && u[l-1] == '\n') - u[l-1] = 0; + u[l-1] = 0; l = strlen(p); if (l > 0 && p[l-1] == '\n') - p[l-1] = 0; + p[l-1] = 0; if (override_value("user", option_priority, fname)) { - strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); - explicit_user = 1; + strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); + explicit_user = 1; } if (override_value("passwd", option_priority, fname)) { - strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); - explicit_passwd = 1; + strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); + explicit_passwd = 1; } return (1); @@ -484,14 +484,14 @@ privgroup(argv) g = getgrnam(*argv); if (g == 0) { - option_error("group %s is unknown", *argv); - return 0; + option_error("group %s is unknown", *argv); + return 0; } for (i = 0; i < ngroups; ++i) { - if (groups[i] == g->gr_gid) { - privileged = 1; - break; - } + if (groups[i] == g->gr_gid) { + privileged = 1; + break; + } } return 1; } @@ -511,7 +511,7 @@ set_noauth_addr(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-ip argument"); + novm("allow-ip argument"); wp->word = (char *) (wp + 1); wp->next = noauth_addrs; MEMCPY(wp->word, addr, l); @@ -533,7 +533,7 @@ set_permitted_number(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-number argument"); + novm("allow-number argument"); wp->word = (char *) (wp + 1); wp->next = permitted_numbers; MEMCPY(wp->word, number, l); @@ -566,7 +566,7 @@ void start_link(unit) devfd = the_channel->connect(); msg = "Connect script failed"; if (devfd < 0) - goto fail; + goto fail; /* set up the serial device as a ppp interface */ /* @@ -579,21 +579,21 @@ void start_link(unit) fd_ppp = the_channel->establish_ppp(devfd); msg = "ppp establishment failed"; if (fd_ppp < 0) { - status = EXIT_FATAL_ERROR; - goto disconnect; + status = EXIT_FATAL_ERROR; + goto disconnect; } if (!demand && ifunit >= 0) - set_ifunit(1); + set_ifunit(1); /* * Start opening the connection and wait for * incoming events (reply, timeout, etc.). */ if (ifunit >= 0) - ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); + ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); else - ppp_notice("Starting negotiation on %s", ppp_devnam); + ppp_notice("Starting negotiation on %s", ppp_devnam); add_fd(fd_ppp); new_phase(pcb, PPP_PHASE_ESTABLISH); @@ -604,12 +604,12 @@ void start_link(unit) disconnect: new_phase(pcb, PPP_PHASE_DISCONNECT); if (the_channel->disconnect) - the_channel->disconnect(); + the_channel->disconnect(); fail: new_phase(pcb, PPP_PHASE_DEAD); if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); } #endif @@ -623,23 +623,23 @@ void link_terminated(ppp_pcb *pcb) { || pcb->phase == PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - return; + return; new_phase(pcb, PPP_PHASE_DISCONNECT); #if 0 /* UNUSED */ if (pap_logout_hook) { - pap_logout_hook(); + pap_logout_hook(); } session_end(devnam); #endif /* UNUSED */ if (!doing_multilink) { - ppp_notice("Connection terminated."); + ppp_notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ } else - ppp_notice("Link terminated."); + ppp_notice("Link terminated."); lcp_lowerdown(pcb); @@ -651,7 +651,7 @@ void link_terminated(ppp_pcb *pcb) { * we delete its pid file. */ if (!doing_multilink && !demand) - remove_pidfiles(); + remove_pidfiles(); /* * If we may want to bring the link up again, transfer @@ -659,36 +659,36 @@ void link_terminated(ppp_pcb *pcb) { * real serial device back to its normal mode of operation. */ if (fd_ppp >= 0) { - remove_fd(fd_ppp); - clean_check(); - the_channel->disestablish_ppp(devfd); - if (doing_multilink) - mp_exit_bundle(); - fd_ppp = -1; + remove_fd(fd_ppp); + clean_check(); + the_channel->disestablish_ppp(devfd); + if (doing_multilink) + mp_exit_bundle(); + fd_ppp = -1; } if (!hungup) - lcp_lowerdown(pcb); + lcp_lowerdown(pcb); if (!doing_multilink && !demand) - script_unsetenv("IFNAME"); + script_unsetenv("IFNAME"); /* * Run disconnector script, if requested. * XXX we may not be able to do this if the line has hung up! */ if (devfd >= 0 && the_channel->disconnect) { - the_channel->disconnect(); - devfd = -1; + the_channel->disconnect(); + devfd = -1; } if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); if (doing_multilink && multilink_master) { - if (!bundle_terminating) - new_phase(pcb, PPP_PHASE_MASTER); - else - mp_bundle_terminated(); + if (!bundle_terminating) + new_phase(pcb, PPP_PHASE_MASTER); + else + mp_bundle_terminated(); } else - new_phase(pcb, PPP_PHASE_DEAD); + new_phase(pcb, PPP_PHASE_DEAD); #endif } @@ -701,13 +701,13 @@ void link_down(ppp_pcb *pcb) { #endif /* PPP_NOTIFY */ if (!doing_multilink) { - upper_layers_down(pcb); - if (pcb->phase != PPP_PHASE_DEAD + upper_layers_down(pcb); + if (pcb->phase != PPP_PHASE_DEAD #ifdef HAVE_MULTILINK - && pcb->phase != PPP_PHASE_MASTER + && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ - ) - new_phase(pcb, PPP_PHASE_ESTABLISH); + ) + new_phase(pcb, PPP_PHASE_ESTABLISH); } /* XXX if doing_multilink, should do something to stop network-layer traffic on the link */ @@ -719,9 +719,9 @@ void upper_layers_down(ppp_pcb *pcb) { for (i = 0; (protp = protocols[i]) != NULL; ++i) { if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) - (*protp->lowerdown)(pcb); + (*protp->lowerdown)(pcb); if (protp->protocol < 0xC000 && protp->close != NULL) - (*protp->close)(pcb, "LCP down"); + (*protp->close)(pcb, "LCP down"); } pcb->num_np_open = 0; pcb->num_np_up = 0; @@ -749,56 +749,56 @@ void link_established(ppp_pcb *pcb) { * Tell higher-level protocols that LCP is up. */ if (!doing_multilink) { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol != PPP_LCP - && protp->lowerup != NULL) - (*protp->lowerup)(pcb); + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol != PPP_LCP + && protp->lowerup != NULL) + (*protp->lowerup)(pcb); } #if PPP_AUTH_SUPPORT #if PPP_SERVER #if PPP_ALLOWED_ADDRS if (!auth_required && noauth_addrs != NULL) - set_allowed_addrs(unit, NULL, NULL); + set_allowed_addrs(unit, NULL, NULL); #endif /* PPP_ALLOWED_ADDRS */ if (pcb->settings.auth_required && !(0 #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if PPP_ALLOWED_ADDRS - /* - * We wanted the peer to authenticate itself, and it refused: - * if we have some address(es) it can use without auth, fine, - * otherwise treat it as though it authenticated with PAP using - * a username of "" and a password of "". If that's not OK, - * boot it out. - */ - if (noauth_addrs != NULL) { - set_allowed_addrs(unit, NULL, NULL); - } else + /* + * We wanted the peer to authenticate itself, and it refused: + * if we have some address(es) it can use without auth, fine, + * otherwise treat it as though it authenticated with PAP using + * a username of "" and a password of "". If that's not OK, + * boot it out. + */ + if (noauth_addrs != NULL) { + set_allowed_addrs(unit, NULL, NULL); + } else #endif /* PPP_ALLOWED_ADDRS */ - if (!pcb->settings.null_login + if (!pcb->settings.null_login #if PAP_SUPPORT - || !wo->neg_upap + || !wo->neg_upap #endif /* PAP_SUPPORT */ - ) { - ppp_warn("peer refused to authenticate: terminating link"); + ) { + ppp_warn("peer refused to authenticate: terminating link"); #if 0 /* UNUSED */ - status = EXIT_PEER_AUTH_FAILED; + status = EXIT_PEER_AUTH_FAILED; #endif /* UNUSED */ - pcb->err_code = PPPERR_AUTHFAIL; - lcp_close(pcb, "peer refused to authenticate"); - return; - } + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "peer refused to authenticate"); + return; + } } #endif /* PPP_SERVER */ @@ -807,20 +807,20 @@ void link_established(ppp_pcb *pcb) { #if PPP_SERVER #if EAP_SUPPORT if (go->neg_eap) { - eap_authpeer(pcb, PPP_OUR_NAME); - auth |= EAP_PEER; + eap_authpeer(pcb, PPP_OUR_NAME); + auth |= EAP_PEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (go->neg_chap) { - chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); - auth |= CHAP_PEER; + chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); + auth |= CHAP_PEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (go->neg_upap) { - upap_authpeer(pcb); - auth |= PAP_PEER; + upap_authpeer(pcb); + auth |= PAP_PEER; } else #endif /* PAP_SUPPORT */ {} @@ -828,20 +828,20 @@ void link_established(ppp_pcb *pcb) { #if EAP_SUPPORT if (ho->neg_eap) { - eap_authwithpeer(pcb, pcb->settings.user); - auth |= EAP_WITHPEER; + eap_authwithpeer(pcb, pcb->settings.user); + auth |= EAP_WITHPEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (ho->neg_chap) { - chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); - auth |= CHAP_WITHPEER; + chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); + auth |= CHAP_WITHPEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (ho->neg_upap) { - upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); - auth |= PAP_WITHPEER; + upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); + auth |= PAP_WITHPEER; } else #endif /* PAP_SUPPORT */ {} @@ -851,7 +851,7 @@ void link_established(ppp_pcb *pcb) { if (!auth) #endif /* PPP_AUTH_SUPPORT */ - network_phase(pcb); + network_phase(pcb); } /* @@ -868,7 +868,7 @@ static void network_phase(ppp_pcb *pcb) { #if 0 /* UNUSED */ /* Log calling number. */ if (*remote_number) - ppp_notice("peer from calling number %q authorized", remote_number); + ppp_notice("peer from calling number %q authorized", remote_number); #endif /* UNUSED */ #if PPP_NOTIFY @@ -877,16 +877,16 @@ static void network_phase(ppp_pcb *pcb) { */ if (0 #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - ) { - notify(auth_up_notifier, 0); + ) { + notify(auth_up_notifier, 0); } #endif /* PPP_NOTIFY */ @@ -895,9 +895,9 @@ static void network_phase(ppp_pcb *pcb) { * If we negotiated callback, do it now. */ if (go->neg_cbcp) { - new_phase(pcb, PPP_PHASE_CALLBACK); - (*cbcp_protent.open)(pcb); - return; + new_phase(pcb, PPP_PHASE_CALLBACK); + (*cbcp_protent.open)(pcb); + return; } #endif @@ -906,9 +906,9 @@ static void network_phase(ppp_pcb *pcb) { * Process extra options from the secrets file */ if (extra_options) { - options_from_list(extra_options, 1); - free_wordlist(extra_options); - extra_options = 0; + options_from_list(extra_options, 1); + free_wordlist(extra_options); + extra_options = 0; } #endif /* PPP_OPTIONS */ start_networks(pcb); @@ -924,34 +924,34 @@ void start_networks(ppp_pcb *pcb) { #ifdef HAVE_MULTILINK if (multilink) { - if (mp_join_bundle()) { - if (multilink_join_hook) - (*multilink_join_hook)(); - if (updetach && !nodetach) - detach(); - return; - } + if (mp_join_bundle()) { + if (multilink_join_hook) + (*multilink_join_hook)(); + if (updetach && !nodetach) + detach(); + return; + } } #endif /* HAVE_MULTILINK */ #ifdef PPP_FILTER if (!demand) - set_filters(&pass_filter, &active_filter); + set_filters(&pass_filter, &active_filter); #endif #if CCP_SUPPORT || ECP_SUPPORT /* Start CCP and ECP */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if ( - (0 + if ( + (0 #if ECP_SUPPORT - || protp->protocol == PPP_ECP + || protp->protocol == PPP_ECP #endif /* ECP_SUPPORT */ #if CCP_SUPPORT - || protp->protocol == PPP_CCP + || protp->protocol == PPP_CCP #endif /* CCP_SUPPORT */ - ) - && protp->open != NULL) - (*protp->open)(pcb); + ) + && protp->open != NULL) + (*protp->open)(pcb); #endif /* CCP_SUPPORT || ECP_SUPPORT */ /* @@ -965,7 +965,7 @@ void start_networks(ppp_pcb *pcb) { && !pcb->ccp_gotoptions.mppe #endif /* MPPE_SUPPORT */ ) - continue_networks(pcb); + continue_networks(pcb); } void continue_networks(ppp_pcb *pcb) { @@ -976,21 +976,21 @@ void continue_networks(ppp_pcb *pcb) { * Start the "real" network protocols. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol < 0xC000 + if (protp->protocol < 0xC000 #if CCP_SUPPORT - && protp->protocol != PPP_CCP + && protp->protocol != PPP_CCP #endif /* CCP_SUPPORT */ #if ECP_SUPPORT - && protp->protocol != PPP_ECP + && protp->protocol != PPP_ECP #endif /* ECP_SUPPORT */ - && protp->open != NULL) { - (*protp->open)(pcb); - ++pcb->num_np_open; - } + && protp->open != NULL) { + (*protp->open)(pcb); + ++pcb->num_np_open; + } if (pcb->num_np_open == 0) - /* nothing to do */ - lcp_close(pcb, "No network protocols running"); + /* nothing to do */ + lcp_close(pcb, "No network protocols running"); } #if PPP_AUTH_SUPPORT @@ -1053,37 +1053,37 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_PEER; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_PEER; - break; + bit = CHAP_PEER; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_PEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_PEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_PEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_PEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_PEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_PEER; - break; + bit = PAP_PEER; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_PEER; - break; + bit = EAP_PEER; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_peer_success: unknown protocol %x", protocol); - return; + ppp_warn("auth_peer_success: unknown protocol %x", protocol); + return; } #ifdef HAVE_MULTILINK @@ -1091,7 +1091,7 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * * Save the authenticated name of the peer for later. */ if (namelen > (int)sizeof(pcb->peer_authname) - 1) - namelen = (int)sizeof(pcb->peer_authname) - 1; + namelen = (int)sizeof(pcb->peer_authname) - 1; MEMCPY(pcb->peer_authname, name, namelen); pcb->peer_authname[namelen] = 0; #endif /* HAVE_MULTILINK */ @@ -1140,41 +1140,41 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_WITHPEER; - prot = "CHAP"; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_WITHPEER; - break; + bit = CHAP_WITHPEER; + prot = "CHAP"; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_WITHPEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_WITHPEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_WITHPEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_WITHPEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_WITHPEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_WITHPEER; - prot = "PAP"; - break; + bit = PAP_WITHPEER; + prot = "PAP"; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_WITHPEER; - prot = "EAP"; - break; + bit = EAP_WITHPEER; + prot = "EAP"; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); - bit = 0; - /* no break */ + ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); + bit = 0; + /* no break */ } ppp_notice("%s authentication succeeded", prot); @@ -1187,7 +1187,7 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { * proceed to the network (or callback) phase. */ if ((pcb->auth_pending &= ~bit) == 0) - network_phase(pcb); + network_phase(pcb); } #endif /* PPP_AUTH_SUPPORT */ @@ -1202,42 +1202,42 @@ void np_up(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (pcb->num_np_up == 0) { - /* - * At this point we consider that the link has come up successfully. - */ - new_phase(pcb, PPP_PHASE_RUNNING); + /* + * At this point we consider that the link has come up successfully. + */ + new_phase(pcb, PPP_PHASE_RUNNING); #if PPP_IDLETIMELIMIT #if 0 /* UNUSED */ - if (idle_time_hook != 0) - tlim = (*idle_time_hook)(NULL); - else + if (idle_time_hook != 0) + tlim = (*idle_time_hook)(NULL); + else #endif /* UNUSED */ - tlim = pcb->settings.idle_time_limit; - if (tlim > 0) - TIMEOUT(check_idle, (void*)pcb, tlim); + tlim = pcb->settings.idle_time_limit; + if (tlim > 0) + TIMEOUT(check_idle, (void*)pcb, tlim); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - /* - * Set a timeout to close the connection once the maximum - * connect time has expired. - */ - if (pcb->settings.maxconnect > 0) - TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); + /* + * Set a timeout to close the connection once the maximum + * connect time has expired. + */ + if (pcb->settings.maxconnect > 0) + TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - if (maxoctets > 0) - TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); + if (maxoctets > 0) + TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); #endif #if 0 /* Unused */ - /* - * Detach now, if the updetach option was given. - */ - if (updetach && !nodetach) - detach(); + /* + * Detach now, if the updetach option was given. + */ + if (updetach && !nodetach) + detach(); #endif /* Unused */ } ++pcb->num_np_up; @@ -1250,15 +1250,15 @@ void np_down(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_up == 0) { #if PPP_IDLETIMELIMIT - UNTIMEOUT(check_idle, (void*)pcb); + UNTIMEOUT(check_idle, (void*)pcb); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - UNTIMEOUT(connect_time_expired, NULL); + UNTIMEOUT(connect_time_expired, NULL); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - UNTIMEOUT(check_maxoctets, NULL); + UNTIMEOUT(check_maxoctets, NULL); #endif - new_phase(pcb, PPP_PHASE_NETWORK); + new_phase(pcb, PPP_PHASE_NETWORK); } } @@ -1268,8 +1268,8 @@ void np_down(ppp_pcb *pcb, int proto) { void np_finished(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_open <= 0) { - /* no further use for the link: shut up shop. */ - lcp_close(pcb, "No network protocols running"); + /* no further use for the link: shut up shop. */ + lcp_close(pcb, "No network protocols running"); } } @@ -1285,26 +1285,26 @@ check_maxoctets(arg) link_stats_valid=0; switch(maxoctets_dir) { - case PPP_OCTETS_DIRECTION_IN: - used = link_stats.bytes_in; - break; - case PPP_OCTETS_DIRECTION_OUT: - used = link_stats.bytes_out; - break; - case PPP_OCTETS_DIRECTION_MAXOVERAL: - case PPP_OCTETS_DIRECTION_MAXSESSION: - used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; - break; - default: - used = link_stats.bytes_in+link_stats.bytes_out; - break; + case PPP_OCTETS_DIRECTION_IN: + used = link_stats.bytes_in; + break; + case PPP_OCTETS_DIRECTION_OUT: + used = link_stats.bytes_out; + break; + case PPP_OCTETS_DIRECTION_MAXOVERAL: + case PPP_OCTETS_DIRECTION_MAXSESSION: + used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; + break; + default: + used = link_stats.bytes_in+link_stats.bytes_out; + break; } if (used > maxoctets) { - ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); - status = EXIT_TRAFFIC_LIMIT; - lcp_close(pcb, "Traffic limit"); + ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); + status = EXIT_TRAFFIC_LIMIT; + lcp_close(pcb, "Traffic limit"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); @@ -1325,27 +1325,27 @@ static void check_idle(void *arg) { int tlim; if (!get_idle_time(pcb, &idle)) - return; + return; #if 0 /* UNUSED */ if (idle_time_hook != 0) { - tlim = idle_time_hook(&idle); + tlim = idle_time_hook(&idle); } else { #endif /* UNUSED */ - itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); - tlim = pcb->settings.idle_time_limit - itime; + itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); + tlim = pcb->settings.idle_time_limit - itime; #if 0 /* UNUSED */ } #endif /* UNUSED */ if (tlim <= 0) { - /* link is idle: shut it down. */ - ppp_notice("Terminating connection due to lack of activity."); - pcb->err_code = PPPERR_IDLETIMEOUT; - lcp_close(pcb, "Link inactive"); + /* link is idle: shut it down. */ + ppp_notice("Terminating connection due to lack of activity."); + pcb->err_code = PPPERR_IDLETIMEOUT; + lcp_close(pcb, "Link inactive"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { - TIMEOUT(check_idle, (void*)pcb, tlim); + TIMEOUT(check_idle, (void*)pcb, tlim); } } #endif /* PPP_IDLETIMELIMIT */ @@ -1358,7 +1358,7 @@ static void connect_time_expired(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; ppp_info("Connect time expired"); pcb->err_code = PPPERR_CONNECTTIME; - lcp_close(pcb, "Connect time expired"); /* Close connection */ + lcp_close(pcb, "Connect time expired"); /* Close connection */ } #endif /* PPP_MAXCONNECT */ @@ -1375,62 +1375,62 @@ auth_check_options() /* Default our_name to hostname, and user to our_name */ if (our_name[0] == 0 || usehostname) - strlcpy(our_name, hostname, sizeof(our_name)); + strlcpy(our_name, hostname, sizeof(our_name)); /* If a blank username was explicitly given as an option, trust the user and don't use our_name */ if (ppp_settings.user[0] == 0 && !explicit_user) - strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); + strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); /* * If we have a default route, require the peer to authenticate * unless the noauth option was given or the real user is root. */ if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { - auth_required = 1; - default_auth = 1; + auth_required = 1; + default_auth = 1; } #if CHAP_SUPPORT /* If we selected any CHAP flavors, we should probably negotiate it. :-) */ if (wo->chap_mdtype) - wo->neg_chap = 1; + wo->neg_chap = 1; #endif /* CHAP_SUPPORT */ /* If authentication is required, ask peer for CHAP, PAP, or EAP. */ if (auth_required) { - allow_any_ip = 0; - if (1 + allow_any_ip = 0; + if (1 #if CHAP_SUPPORT - && !wo->neg_chap + && !wo->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - && !wo->neg_upap + && !wo->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - && !wo->neg_eap + && !wo->neg_eap #endif /* EAP_SUPPORT */ - ) { + ) { #if CHAP_SUPPORT - wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; - wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; + wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; + wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 1; + wo->neg_upap = 1; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 1; + wo->neg_eap = 1; #endif /* EAP_SUPPORT */ - } + } } else { #if CHAP_SUPPORT - wo->neg_chap = 0; - wo->chap_mdtype = MDTYPE_NONE; + wo->neg_chap = 0; + wo->chap_mdtype = MDTYPE_NONE; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 0; + wo->neg_upap = 0; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 0; + wo->neg_eap = 0; #endif /* EAP_SUPPORT */ } @@ -1447,56 +1447,56 @@ auth_check_options() #endif /* PAP_SUPPORT */ if (!can_auth && (0 #if CHAP_SUPPORT - || wo->neg_chap + || wo->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || wo->neg_eap + || wo->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if CHAP_SUPPORT - can_auth = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + can_auth = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); #else - can_auth = 0; + can_auth = 0; #endif } if (!can_auth #if EAP_SUPPORT - && wo->neg_eap + && wo->neg_eap #endif /* EAP_SUPPORT */ - ) { - can_auth = have_srp_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + ) { + can_auth = have_srp_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); } if (auth_required && !can_auth && noauth_addrs == NULL) { - if (default_auth) { - option_error( + if (default_auth) { + option_error( "By default the remote system is required to authenticate itself"); - option_error( + option_error( "(because this system has a default route to the internet)"); - } else if (explicit_remote) - option_error( + } else if (explicit_remote) + option_error( "The remote system (%s) is required to authenticate itself", - remote_name); - else - option_error( + remote_name); + else + option_error( "The remote system is required to authenticate itself"); - option_error( + option_error( "but I couldn't find any suitable secret (password) for it to use to do so."); - if (lacks_ip) - option_error( + if (lacks_ip) + option_error( "(None of the available passwords would let it use an IP address.)"); - exit(1); + exit(1); } /* * Early check for remote number authorization. */ if (!auth_number()) { - ppp_warn("calling number %q is not authorized", remote_number); - exit(EXIT_CNID_AUTH_FAILED); + ppp_warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); } } #endif /* PPP_OPTIONS */ @@ -1518,30 +1518,30 @@ auth_reset(unit) hadchap = -1; ao->neg_upap = !refuse_pap && (passwd[0] != 0 || get_pap_passwd(NULL)); ao->neg_chap = (!refuse_chap || !refuse_mschap || !refuse_mschap_v2) - && (passwd[0] != 0 || - (hadchap = have_chap_secret(user, (explicit_remote? remote_name: - NULL), 0, NULL))); + && (passwd[0] != 0 || + (hadchap = have_chap_secret(user, (explicit_remote? remote_name: + NULL), 0, NULL))); ao->neg_eap = !refuse_eap && ( - passwd[0] != 0 || - (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, - (explicit_remote? remote_name: NULL), 0, NULL))) || - have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); + passwd[0] != 0 || + (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, + (explicit_remote? remote_name: NULL), 0, NULL))) || + have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); hadchap = -1; if (go->neg_upap && !uselogin && !have_pap_secret(NULL)) - go->neg_upap = 0; + go->neg_upap = 0; if (go->neg_chap) { - if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, NULL))) - go->neg_chap = 0; + if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, NULL))) + go->neg_chap = 0; } if (go->neg_eap && - (hadchap == 0 || (hadchap == -1 && - !have_chap_secret((explicit_remote? remote_name: NULL), our_name, - 1, NULL))) && - !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, - NULL)) - go->neg_eap = 0; + (hadchap == 0 || (hadchap == -1 && + !have_chap_secret((explicit_remote? remote_name: NULL), our_name, + 1, NULL))) && + !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, + NULL)) + go->neg_eap = 0; } /* @@ -1550,8 +1550,8 @@ auth_reset(unit) * and login the user if OK. * * returns: - * UPAP_AUTHNAK: Authentication failed. - * UPAP_AUTHACK: Authentication succeeded. + * UPAP_AUTHNAK: Authentication failed. + * UPAP_AUTHACK: Authentication succeeded. * In either case, msg points to an appropriate message. */ int @@ -1585,19 +1585,19 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) * Check if a plugin wants to handle this. */ if (pap_auth_hook) { - ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); - if (ret >= 0) { - /* note: set_allowed_addrs() saves opts (but not addrs): - don't free it! */ - if (ret) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); - BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); - return ret? UPAP_AUTHACK: UPAP_AUTHNAK; - } + ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); + if (ret >= 0) { + /* note: set_allowed_addrs() saves opts (but not addrs): + don't free it! */ + if (ret) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); + return ret? UPAP_AUTHACK: UPAP_AUTHNAK; + } } /* @@ -1609,67 +1609,67 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) ret = UPAP_AUTHNAK; f = fopen(filename, "r"); if (f == NULL) { - ppp_error("Can't open PAP password file %s: %m", filename); + ppp_error("Can't open PAP password file %s: %m", filename); } else { - check_access(f, filename); - if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { - ppp_warn("no PAP secret found for %s", user); - } else { - /* - * If the secret is "@login", it means to check - * the password against the login database. - */ - int login_secret = strcmp(secret, "@login") == 0; - ret = UPAP_AUTHACK; - if (uselogin || login_secret) { - /* login option or secret is @login */ - if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { - ret = UPAP_AUTHNAK; - } - } else if (session_mgmt) { - if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { - ppp_warn("Peer %q failed PAP Session verification", user); - ret = UPAP_AUTHNAK; - } - } - if (secret[0] != 0 && !login_secret) { - /* password given in pap-secrets - must match */ - if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) - && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) - ret = UPAP_AUTHNAK; - } - } - fclose(f); + check_access(f, filename); + if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { + ppp_warn("no PAP secret found for %s", user); + } else { + /* + * If the secret is "@login", it means to check + * the password against the login database. + */ + int login_secret = strcmp(secret, "@login") == 0; + ret = UPAP_AUTHACK; + if (uselogin || login_secret) { + /* login option or secret is @login */ + if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { + ret = UPAP_AUTHNAK; + } + } else if (session_mgmt) { + if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { + ppp_warn("Peer %q failed PAP Session verification", user); + ret = UPAP_AUTHNAK; + } + } + if (secret[0] != 0 && !login_secret) { + /* password given in pap-secrets - must match */ + if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) + && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) + ret = UPAP_AUTHNAK; + } + } + fclose(f); } if (ret == UPAP_AUTHNAK) { if (**msg == 0) - *msg = "Login incorrect"; - /* - * XXX can we ever get here more than once?? - * Frustrate passwd stealer programs. - * Allow 10 tries, but start backing off after 3 (stolen from login). - * On 10'th, drop the connection. - */ - if (attempts++ >= 10) { - ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); - lcp_close(pcb, "login failed"); - } - if (attempts > 3) - sleep((u_int) (attempts - 3) * 5); - if (opts != NULL) - free_wordlist(opts); + *msg = "Login incorrect"; + /* + * XXX can we ever get here more than once?? + * Frustrate passwd stealer programs. + * Allow 10 tries, but start backing off after 3 (stolen from login). + * On 10'th, drop the connection. + */ + if (attempts++ >= 10) { + ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); + lcp_close(pcb, "login failed"); + } + if (attempts > 3) + sleep((u_int) (attempts - 3) * 5); + if (opts != NULL) + free_wordlist(opts); } else { - attempts = 0; /* Reset count */ - if (**msg == 0) - *msg = "Login ok"; - set_allowed_addrs(unit, addrs, opts); + attempts = 0; /* Reset count */ + if (**msg == 0) + *msg = "Login ok"; + set_allowed_addrs(unit, addrs, opts); } if (addrs != NULL) - free_wordlist(addrs); + free_wordlist(addrs); BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); BZERO(secret, sizeof(secret)); @@ -1696,31 +1696,31 @@ null_login(unit) */ ret = -1; if (null_auth_hook) - ret = (*null_auth_hook)(&addrs, &opts); + ret = (*null_auth_hook)(&addrs, &opts); /* * Open the file of pap secrets and scan for a suitable secret. */ if (ret <= 0) { - filename = _PATH_UPAPFILE; - addrs = NULL; - f = fopen(filename, "r"); - if (f == NULL) - return 0; - check_access(f, filename); + filename = _PATH_UPAPFILE; + addrs = NULL; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + check_access(f, filename); - i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); - ret = i >= 0 && secret[0] == 0; - BZERO(secret, sizeof(secret)); - fclose(f); + i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); + ret = i >= 0 && secret[0] == 0; + BZERO(secret, sizeof(secret)); + fclose(f); } if (ret) - set_allowed_addrs(unit, addrs, opts); + set_allowed_addrs(unit, addrs, opts); else if (opts != 0) - free_wordlist(opts); + free_wordlist(opts); if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret; } @@ -1744,24 +1744,24 @@ get_pap_passwd(passwd) * Check whether a plugin wants to supply this. */ if (pap_passwd_hook) { - ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); - if (ret >= 0) - return ret; + ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; check_access(f, filename); ret = scan_authfile(f, user, - (remote_name[0]? remote_name: NULL), - secret, NULL, NULL, filename, 0); + (remote_name[0]? remote_name: NULL), + secret, NULL, NULL, filename, 0); fclose(f); if (ret < 0) - return 0; + return 0; if (passwd != NULL) - strlcpy(passwd, secret, MAXSECRETLEN); + strlcpy(passwd, secret, MAXSECRETLEN); BZERO(secret, sizeof(secret)); return 1; } @@ -1781,26 +1781,26 @@ have_pap_secret(lacks_ipp) /* let the plugin decide, if there is one */ if (pap_check_hook) { - ret = (*pap_check_hook)(); - if (ret >= 0) - return ret; + ret = (*pap_check_hook)(); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; ret = scan_authfile(f, (explicit_remote? remote_name: NULL), our_name, - NULL, &addrs, NULL, filename, 0); + NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1824,31 +1824,31 @@ have_chap_secret(client, server, need_ip, lacks_ipp) struct wordlist *addrs; if (chap_check_hook) { - ret = (*chap_check_hook)(); - if (ret >= 0) { - return ret; - } + ret = (*chap_check_hook)(); + if (ret >= 0) { + return ret; + } } filename = _PATH_CHAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1874,22 +1874,22 @@ have_srp_secret(client, server, need_ip, lacks_ipp) filename = _PATH_SRPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1930,42 +1930,42 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre addrs = NULL; if (!am_server && ppp_settings.passwd[0] != 0) { - strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); + strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); } else if (!am_server && chap_passwd_hook) { - if ( (*chap_passwd_hook)(client, secbuf) < 0) { - ppp_error("Unable to obtain CHAP password for %s on %s from plugin", - client, server); - return 0; - } + if ( (*chap_passwd_hook)(client, secbuf) < 0) { + ppp_error("Unable to obtain CHAP password for %s on %s from plugin", + client, server); + return 0; + } } else { - filename = _PATH_CHAPFILE; - addrs = NULL; - secbuf[0] = 0; - - f = fopen(filename, "r"); - if (f == NULL) { - ppp_error("Can't open chap secret file %s: %m", filename); - return 0; - } - check_access(f, filename); - - ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); - fclose(f); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); + filename = _PATH_CHAPFILE; + addrs = NULL; + secbuf[0] = 0; + + f = fopen(filename, "r"); + if (f == NULL) { + ppp_error("Can't open chap secret file %s: %m", filename); + return 0; + } + check_access(f, filename); + + ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); + fclose(f); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); } len = strlen(secbuf); if (len > MAXSECRETLEN) { - ppp_error("Secret for %s on %s is too long", client, server); - len = MAXSECRETLEN; + ppp_error("Secret for %s on %s is too long", client, server); + len = MAXSECRETLEN; } MEMCPY(secret, secbuf, len); BZERO(secbuf, sizeof(secbuf)); @@ -1997,31 +1997,31 @@ get_srp_secret(unit, client, server, secret, am_server) struct wordlist *addrs, *opts; if (!am_server && ppp_settings.passwd[0] != '\0') { - strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); + strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); } else { - filename = _PATH_SRPFILE; - addrs = NULL; - - fp = fopen(filename, "r"); - if (fp == NULL) { - ppp_error("Can't open srp secret file %s: %m", filename); - return 0; - } - check_access(fp, filename); - - secret[0] = '\0'; - ret = scan_authfile(fp, client, server, secret, &addrs, &opts, - filename, am_server); - fclose(fp); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != NULL) - free_wordlist(opts); - if (addrs != NULL) - free_wordlist(addrs); + filename = _PATH_SRPFILE; + addrs = NULL; + + fp = fopen(filename, "r"); + if (fp == NULL) { + ppp_error("Can't open srp secret file %s: %m", filename); + return 0; + } + check_access(fp, filename); + + secret[0] = '\0'; + ret = scan_authfile(fp, client, server, secret, &addrs, &opts, + filename, am_server); + fclose(fp); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != NULL) + free_wordlist(opts); + if (addrs != NULL) + free_wordlist(addrs); } return 1; @@ -2049,10 +2049,10 @@ set_allowed_addrs(unit, addrs, opts) u32_t suggested_ip = 0; if (addresses[unit] != NULL) - free(addresses[unit]); + free(addresses[unit]); addresses[unit] = NULL; if (extra_options != NULL) - free_wordlist(extra_options); + free_wordlist(extra_options); extra_options = opts; /* @@ -2060,109 +2060,109 @@ set_allowed_addrs(unit, addrs, opts) */ n = wordlist_count(addrs) + wordlist_count(noauth_addrs); if (n == 0) - return; + return; ip = (struct permitted_ip *) malloc((n + 1) * sizeof(struct permitted_ip)); if (ip == 0) - return; + return; /* temporarily append the noauth_addrs list to addrs */ for (plink = &addrs; *plink != NULL; plink = &(*plink)->next) - ; + ; *plink = noauth_addrs; n = 0; for (ap = addrs; ap != NULL; ap = ap->next) { - /* "-" means no addresses authorized, "*" means any address allowed */ - ptr_word = ap->word; - if (strcmp(ptr_word, "-") == 0) - break; - if (strcmp(ptr_word, "*") == 0) { - ip[n].permit = 1; - ip[n].base = ip[n].mask = 0; - ++n; - break; - } - - ip[n].permit = 1; - if (*ptr_word == '!') { - ip[n].permit = 0; - ++ptr_word; - } - - mask = ~ (u32_t) 0; - offset = 0; - ptr_mask = strchr (ptr_word, '/'); - if (ptr_mask != NULL) { - int bit_count; - char *endp; - - bit_count = (int) strtol (ptr_mask+1, &endp, 10); - if (bit_count <= 0 || bit_count > 32) { - ppp_warn("invalid address length %v in auth. address list", - ptr_mask+1); - continue; - } - bit_count = 32 - bit_count; /* # bits in host part */ - if (*endp == '+') { - offset = ifunit + 1; - ++endp; - } - if (*endp != 0) { - ppp_warn("invalid address length syntax: %v", ptr_mask+1); - continue; - } - *ptr_mask = '\0'; - mask <<= bit_count; - } - - hp = gethostbyname(ptr_word); - if (hp != NULL && hp->h_addrtype == AF_INET) { - a = *(u32_t *)hp->h_addr; - } else { - np = getnetbyname (ptr_word); - if (np != NULL && np->n_addrtype == AF_INET) { - a = lwip_htonl ((u32_t)np->n_net); - if (ptr_mask == NULL) { - /* calculate appropriate mask for net */ - ah = lwip_ntohl(a); - if (IN_CLASSA(ah)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(ah)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(ah)) - mask = IN_CLASSC_NET; - } - } else { - a = inet_addr (ptr_word); - } - } - - if (ptr_mask != NULL) - *ptr_mask = '/'; - - if (a == (u32_t)-1L) { - ppp_warn("unknown host %s in auth. address list", ap->word); - continue; - } - if (offset != 0) { - if (offset >= ~mask) { - ppp_warn("interface unit %d too large for subnet %v", - ifunit, ptr_word); - continue; - } - a = lwip_htonl((lwip_ntohl(a) & mask) + offset); - mask = ~(u32_t)0; - } - ip[n].mask = lwip_htonl(mask); - ip[n].base = a & ip[n].mask; - ++n; - if (~mask == 0 && suggested_ip == 0) - suggested_ip = a; + /* "-" means no addresses authorized, "*" means any address allowed */ + ptr_word = ap->word; + if (strcmp(ptr_word, "-") == 0) + break; + if (strcmp(ptr_word, "*") == 0) { + ip[n].permit = 1; + ip[n].base = ip[n].mask = 0; + ++n; + break; + } + + ip[n].permit = 1; + if (*ptr_word == '!') { + ip[n].permit = 0; + ++ptr_word; + } + + mask = ~ (u32_t) 0; + offset = 0; + ptr_mask = strchr (ptr_word, '/'); + if (ptr_mask != NULL) { + int bit_count; + char *endp; + + bit_count = (int) strtol (ptr_mask+1, &endp, 10); + if (bit_count <= 0 || bit_count > 32) { + ppp_warn("invalid address length %v in auth. address list", + ptr_mask+1); + continue; + } + bit_count = 32 - bit_count; /* # bits in host part */ + if (*endp == '+') { + offset = ifunit + 1; + ++endp; + } + if (*endp != 0) { + ppp_warn("invalid address length syntax: %v", ptr_mask+1); + continue; + } + *ptr_mask = '\0'; + mask <<= bit_count; + } + + hp = gethostbyname(ptr_word); + if (hp != NULL && hp->h_addrtype == AF_INET) { + a = *(u32_t *)hp->h_addr; + } else { + np = getnetbyname (ptr_word); + if (np != NULL && np->n_addrtype == AF_INET) { + a = lwip_htonl ((u32_t)np->n_net); + if (ptr_mask == NULL) { + /* calculate appropriate mask for net */ + ah = lwip_ntohl(a); + if (IN_CLASSA(ah)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(ah)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(ah)) + mask = IN_CLASSC_NET; + } + } else { + a = inet_addr (ptr_word); + } + } + + if (ptr_mask != NULL) + *ptr_mask = '/'; + + if (a == (u32_t)-1L) { + ppp_warn("unknown host %s in auth. address list", ap->word); + continue; + } + if (offset != 0) { + if (offset >= ~mask) { + ppp_warn("interface unit %d too large for subnet %v", + ifunit, ptr_word); + continue; + } + a = lwip_htonl((lwip_ntohl(a) & mask) + offset); + mask = ~(u32_t)0; + } + ip[n].mask = lwip_htonl(mask); + ip[n].base = a & ip[n].mask; + ++n; + if (~mask == 0 && suggested_ip == 0) + suggested_ip = a; } *plink = NULL; - ip[n].permit = 0; /* make the last entry forbid all addresses */ - ip[n].base = 0; /* to terminate the list */ + ip[n].permit = 0; /* make the last entry forbid all addresses */ + ip[n].base = 0; /* to terminate the list */ ip[n].mask = 0; addresses[unit] = ip; @@ -2173,14 +2173,14 @@ set_allowed_addrs(unit, addrs, opts) * which is a single host, then use that if we find one. */ if (suggested_ip != 0 - && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { - wo->hisaddr = suggested_ip; - /* - * Do we insist on this address? No, if there are other - * addresses authorized than the suggested one. - */ - if (n > 1) - wo->accept_remote = 1; + && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { + wo->hisaddr = suggested_ip; + /* + * Do we insist on this address? No, if there are other + * addresses authorized than the suggested one. + */ + if (n > 1) + wo->accept_remote = 1; } } @@ -2197,21 +2197,21 @@ auth_ip_addr(unit, addr) /* don't allow loopback or multicast address */ if (bad_ip_adrs(addr)) - return 0; + return 0; if (allowed_address_hook) { - ok = allowed_address_hook(addr); - if (ok >= 0) return ok; + ok = allowed_address_hook(addr); + if (ok >= 0) return ok; } if (addresses[unit] != NULL) { - ok = ip_addr_check(addr, addresses[unit]); - if (ok >= 0) - return ok; + ok = ip_addr_check(addr, addresses[unit]); + if (ok >= 0) + return ok; } if (auth_required) - return 0; /* no addresses authorized */ + return 0; /* no addresses authorized */ return allow_any_ip || privileged || !have_route_to(addr); } @@ -2221,8 +2221,8 @@ ip_addr_check(addr, addrs) struct permitted_ip *addrs; { for (; ; ++addrs) - if ((addr & addrs->mask) == addrs->base) - return addrs->permit; + if ((addr & addrs->mask) == addrs->base) + return addrs->permit; } /* @@ -2236,7 +2236,7 @@ bad_ip_adrs(addr) { addr = lwip_ntohl(addr); return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET - || IN_MULTICAST(addr) || IN_BADCLASS(addr); + || IN_MULTICAST(addr) || IN_BADCLASS(addr); } /* @@ -2248,10 +2248,10 @@ some_ip_ok(addrs) struct wordlist *addrs; { for (; addrs != 0; addrs = addrs->next) { - if (addrs->word[0] == '-') - break; - if (addrs->word[0] != '!') - return 1; /* some IP address is allowed */ + if (addrs->word[0] == '-') + break; + if (addrs->word[0] != '!') + return 1; /* some IP address is allowed */ } return 0; } @@ -2268,17 +2268,17 @@ auth_number() /* Allow all if no authorization list. */ if (!wp) - return 1; + return 1; /* Allow if we have a match in the authorization list. */ while (wp) { - /* trailing '*' wildcard */ - l = strlen(wp->word); - if ((wp->word)[l - 1] == '*') - l--; - if (!strncasecmp(wp->word, remote_number, l)) - return 1; - wp = wp->next; + /* trailing '*' wildcard */ + l = strlen(wp->word); + if ((wp->word)[l - 1] == '*') + l--; + if (!strncasecmp(wp->word, remote_number, l)) + return 1; + wp = wp->next; } return 0; @@ -2295,10 +2295,10 @@ check_access(f, filename) struct stat sbuf; if (fstat(fileno(f), &sbuf) < 0) { - ppp_warn("cannot stat secret file %s: %m", filename); + ppp_warn("cannot stat secret file %s: %m", filename); } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { - ppp_warn("Warning - secret file %s has world and/or group access", - filename); + ppp_warn("Warning - secret file %s has world and/or group access", + filename); } } @@ -2337,141 +2337,141 @@ scan_authfile(f, client, server, secret, addrs, opts, filename, flags) char *cp; if (addrs != NULL) - *addrs = NULL; + *addrs = NULL; if (opts != NULL) - *opts = NULL; + *opts = NULL; addr_list = NULL; if (!getword(f, word, &newline, filename)) - return -1; /* file is empty??? */ + return -1; /* file is empty??? */ newline = 1; best_flag = -1; for (;;) { - /* - * Skip until we find a word at the start of a line. - */ - while (!newline && getword(f, word, &newline, filename)) - ; - if (!newline) - break; /* got to end of file */ - - /* - * Got a client - check if it's a match or a wildcard. - */ - got_flag = 0; - if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { - newline = 0; - continue; - } - if (!ISWILD(word)) - got_flag = NONWILD_CLIENT; - - /* - * Now get a server and check if it matches. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - if (!ISWILD(word)) { - if (server != NULL && strcmp(word, server) != 0) - continue; - got_flag |= NONWILD_SERVER; - } - - /* - * Got some sort of a match - see if it's better than what - * we have already. - */ - if (got_flag <= best_flag) - continue; - - /* - * Get the secret. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - - /* - * SRP-SHA1 authenticator should never be reading secrets from - * a file. (Authenticatee may, though.) - */ - if (flags && ((cp = strchr(word, ':')) == NULL || - strchr(cp + 1, ':') == NULL)) - continue; - - if (secret != NULL) { - /* - * Special syntax: @/pathname means read secret from file. - */ - if (word[0] == '@' && word[1] == '/') { - strlcpy(atfile, word+1, sizeof(atfile)); - if ((sf = fopen(atfile, "r")) == NULL) { - ppp_warn("can't open indirect secret file %s", atfile); - continue; - } - check_access(sf, atfile); - if (!getword(sf, word, &xxx, atfile)) { - ppp_warn("no secret in indirect secret file %s", atfile); - fclose(sf); - continue; - } - fclose(sf); - } - strlcpy(lsecret, word, sizeof(lsecret)); - } - - /* - * Now read address authorization info and make a wordlist. - */ - app = &alist; - for (;;) { - if (!getword(f, word, &newline, filename) || newline) - break; - ap = (struct wordlist *) - malloc(sizeof(struct wordlist) + strlen(word) + 1); - if (ap == NULL) - novm("authorized addresses"); - ap->word = (char *) (ap + 1); - strcpy(ap->word, word); - *app = ap; - app = &ap->next; - } - *app = NULL; - - /* - * This is the best so far; remember it. - */ - best_flag = got_flag; - if (addr_list) - free_wordlist(addr_list); - addr_list = alist; - if (secret != NULL) - strlcpy(secret, lsecret, MAXWORDLEN); - - if (!newline) - break; + /* + * Skip until we find a word at the start of a line. + */ + while (!newline && getword(f, word, &newline, filename)) + ; + if (!newline) + break; /* got to end of file */ + + /* + * Got a client - check if it's a match or a wildcard. + */ + got_flag = 0; + if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { + newline = 0; + continue; + } + if (!ISWILD(word)) + got_flag = NONWILD_CLIENT; + + /* + * Now get a server and check if it matches. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + if (!ISWILD(word)) { + if (server != NULL && strcmp(word, server) != 0) + continue; + got_flag |= NONWILD_SERVER; + } + + /* + * Got some sort of a match - see if it's better than what + * we have already. + */ + if (got_flag <= best_flag) + continue; + + /* + * Get the secret. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + + /* + * SRP-SHA1 authenticator should never be reading secrets from + * a file. (Authenticatee may, though.) + */ + if (flags && ((cp = strchr(word, ':')) == NULL || + strchr(cp + 1, ':') == NULL)) + continue; + + if (secret != NULL) { + /* + * Special syntax: @/pathname means read secret from file. + */ + if (word[0] == '@' && word[1] == '/') { + strlcpy(atfile, word+1, sizeof(atfile)); + if ((sf = fopen(atfile, "r")) == NULL) { + ppp_warn("can't open indirect secret file %s", atfile); + continue; + } + check_access(sf, atfile); + if (!getword(sf, word, &xxx, atfile)) { + ppp_warn("no secret in indirect secret file %s", atfile); + fclose(sf); + continue; + } + fclose(sf); + } + strlcpy(lsecret, word, sizeof(lsecret)); + } + + /* + * Now read address authorization info and make a wordlist. + */ + app = &alist; + for (;;) { + if (!getword(f, word, &newline, filename) || newline) + break; + ap = (struct wordlist *) + malloc(sizeof(struct wordlist) + strlen(word) + 1); + if (ap == NULL) + novm("authorized addresses"); + ap->word = (char *) (ap + 1); + strcpy(ap->word, word); + *app = ap; + app = &ap->next; + } + *app = NULL; + + /* + * This is the best so far; remember it. + */ + best_flag = got_flag; + if (addr_list) + free_wordlist(addr_list); + addr_list = alist; + if (secret != NULL) + strlcpy(secret, lsecret, MAXWORDLEN); + + if (!newline) + break; } /* scan for a -- word indicating the start of options */ for (app = &addr_list; (ap = *app) != NULL; app = &ap->next) - if (strcmp(ap->word, "--") == 0) - break; + if (strcmp(ap->word, "--") == 0) + break; /* ap = start of options */ if (ap != NULL) { - ap = ap->next; /* first option */ - free(*app); /* free the "--" word */ - *app = NULL; /* terminate addr list */ + ap = ap->next; /* first option */ + free(*app); /* free the "--" word */ + *app = NULL; /* terminate addr list */ } if (opts != NULL) - *opts = ap; + *opts = ap; else if (ap != NULL) - free_wordlist(ap); + free_wordlist(ap); if (addrs != NULL) - *addrs = addr_list; + *addrs = addr_list; else if (addr_list != NULL) - free_wordlist(addr_list); + free_wordlist(addr_list); return best_flag; } @@ -2486,7 +2486,7 @@ wordlist_count(wp) int n; for (n = 0; wp != NULL; wp = wp->next) - ++n; + ++n; return n; } @@ -2500,9 +2500,9 @@ free_wordlist(wp) struct wordlist *next; while (wp != NULL) { - next = wp->next; - free(wp); - wp = next; + next = wp->next; + free(wp); + wp = next; } } #endif /* UNUSED */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ccp.c b/components/net/lwip-2.0.2/src/netif/ppp/ccp.c index f8519ebece..5e5b75c361 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ccp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ccp.c @@ -40,8 +40,8 @@ #include "netif/ppp/ccp.h" #if MPPE_SUPPORT -#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ -#include "netif/ppp/mppe.h" /* mppe_init() */ +#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ +#include "netif/ppp/mppe.h" /* mppe_init() */ #endif /* MPPE_SUPPORT */ /* @@ -51,7 +51,7 @@ * Until this is fixed we only accept sizes in the range 9 .. 15. * Thanks to James Carlson for pointing this out. */ -#define DEFLATE_MIN_WORKS 9 +#define DEFLATE_MIN_WORKS 9 /* * Command-line options. @@ -66,7 +66,7 @@ static char deflate_value[8]; * Option variables. */ #if MPPE_SUPPORT -bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ +bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ #endif /* MPPE_SUPPORT */ static option_t ccp_option_list[] = { @@ -248,27 +248,27 @@ static const fsm_callbacks ccp_callbacks = { static int ccp_anycompress(ccp_options *opt) { return (0 #if DEFLATE_SUPPORT - || (opt)->deflate + || (opt)->deflate #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - || (opt)->bsd_compress + || (opt)->bsd_compress #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - || (opt)->predictor_1 || (opt)->predictor_2 + || (opt)->predictor_1 || (opt)->predictor_2 #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - || (opt)->mppe + || (opt)->mppe #endif /* MPPE_SUPPORT */ - ); + ); } /* * Local state (mainly for handling reset-reqs and reset-acks). */ -#define RACK_PENDING 1 /* waiting for reset-ack */ -#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ +#define RACK_PENDING 1 /* waiting for reset-ack */ +#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ -#define RACKTIMEOUT 1 /* second */ +#define RACKTIMEOUT 1 /* second */ #if PPP_OPTIONS /* @@ -284,31 +284,31 @@ setbsdcomp(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for bsdcomp option", *argv); - return 0; + option_error("invalid parameter '%s' for bsdcomp option", *argv); + return 0; } if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS)) - || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { - option_error("bsdcomp option values must be 0 or %d .. %d", - BSD_MIN_BITS, BSD_MAX_BITS); - return 0; + || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { + option_error("bsdcomp option values must be 0 or %d .. %d", + BSD_MIN_BITS, BSD_MAX_BITS); + return 0; } if (rbits > 0) { - ccp_wantoptions[0].bsd_compress = 1; - ccp_wantoptions[0].bsd_bits = rbits; + ccp_wantoptions[0].bsd_compress = 1; + ccp_wantoptions[0].bsd_bits = rbits; } else - ccp_wantoptions[0].bsd_compress = 0; + ccp_wantoptions[0].bsd_compress = 0; if (abits > 0) { - ccp_allowoptions[0].bsd_compress = 1; - ccp_allowoptions[0].bsd_bits = abits; + ccp_allowoptions[0].bsd_compress = 1; + ccp_allowoptions[0].bsd_bits = abits; } else - ccp_allowoptions[0].bsd_compress = 0; + ccp_allowoptions[0].bsd_compress = 0; ppp_slprintf(bsd_value, sizeof(bsd_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -323,40 +323,40 @@ setdeflate(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for deflate option", *argv); - return 0; + option_error("invalid parameter '%s' for deflate option", *argv); + return 0; } if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE)) - || (abits != 0 && (abits < DEFLATE_MIN_SIZE - || abits > DEFLATE_MAX_SIZE))) { - option_error("deflate option values must be 0 or %d .. %d", - DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); - return 0; + || (abits != 0 && (abits < DEFLATE_MIN_SIZE + || abits > DEFLATE_MAX_SIZE))) { + option_error("deflate option values must be 0 or %d .. %d", + DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); + return 0; } if (rbits == DEFLATE_MIN_SIZE || abits == DEFLATE_MIN_SIZE) { - if (rbits == DEFLATE_MIN_SIZE) - rbits = DEFLATE_MIN_WORKS; - if (abits == DEFLATE_MIN_SIZE) - abits = DEFLATE_MIN_WORKS; - warn("deflate option value of %d changed to %d to avoid zlib bug", - DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); + if (rbits == DEFLATE_MIN_SIZE) + rbits = DEFLATE_MIN_WORKS; + if (abits == DEFLATE_MIN_SIZE) + abits = DEFLATE_MIN_WORKS; + warn("deflate option value of %d changed to %d to avoid zlib bug", + DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); } if (rbits > 0) { - ccp_wantoptions[0].deflate = 1; - ccp_wantoptions[0].deflate_size = rbits; + ccp_wantoptions[0].deflate = 1; + ccp_wantoptions[0].deflate_size = rbits; } else - ccp_wantoptions[0].deflate = 0; + ccp_wantoptions[0].deflate = 0; if (abits > 0) { - ccp_allowoptions[0].deflate = 1; - ccp_allowoptions[0].deflate_size = abits; + ccp_allowoptions[0].deflate = 1; + ccp_allowoptions[0].deflate_size = abits; } else - ccp_allowoptions[0].deflate = 0; + ccp_allowoptions[0].deflate = 0; ppp_slprintf(deflate_value, sizeof(deflate_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -411,7 +411,7 @@ static void ccp_open(ppp_pcb *pcb) { ccp_options *go = &pcb->ccp_gotoptions; if (f->state != PPP_FSM_OPENED) - ccp_set(pcb, 1, 0, 0, 0); + ccp_set(pcb, 1, 0, 0, 0); /* * Find out which compressors the kernel supports before @@ -419,7 +419,7 @@ static void ccp_open(ppp_pcb *pcb) { */ ccp_resetci(f); if (!ccp_anycompress(go)) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -463,12 +463,12 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { oldstate = f->state; fsm_input(f, p, len); if (oldstate == PPP_FSM_OPENED && p[0] == TERMREQ && f->state != PPP_FSM_OPENED) { - ppp_notice("Compression disabled by peer."); + ppp_notice("Compression disabled by peer."); #if MPPE_SUPPORT - if (go->mppe) { - ppp_error("MPPE disabled, closing LCP"); - lcp_close(pcb, "MPPE disabled by peer"); - } + if (go->mppe) { + ppp_error("MPPE disabled, closing LCP"); + lcp_close(pcb, "MPPE disabled by peer"); + } #endif /* MPPE_SUPPORT */ } @@ -477,8 +477,8 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { * close CCP. */ if (oldstate == PPP_FSM_REQSENT && p[0] == TERMACK - && !ccp_anycompress(go)) - ccp_close(pcb, "No compression negotiated"); + && !ccp_anycompress(go)) + ccp_close(pcb, "No compression negotiated"); } /* @@ -491,24 +491,24 @@ static int ccp_extcode(fsm *f, int code, int id, u_char *p, int len) { switch (code) { case CCP_RESETREQ: - if (f->state != PPP_FSM_OPENED) - break; - ccp_reset_comp(pcb); - /* send a reset-ack, which the transmitter will see and - reset its compression state. */ - fsm_sdata(f, CCP_RESETACK, id, NULL, 0); - break; + if (f->state != PPP_FSM_OPENED) + break; + ccp_reset_comp(pcb); + /* send a reset-ack, which the transmitter will see and + reset its compression state. */ + fsm_sdata(f, CCP_RESETACK, id, NULL, 0); + break; case CCP_RESETACK: - if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { - pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); - UNTIMEOUT(ccp_rack_timeout, f); - ccp_reset_decomp(pcb); - } - break; + if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { + pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); + UNTIMEOUT(ccp_rack_timeout, f); + ccp_reset_decomp(pcb); + } + break; default: - return 0; + return 0; } return 1; @@ -528,8 +528,8 @@ static void ccp_protrej(ppp_pcb *pcb) { #if MPPE_SUPPORT if (go->mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ @@ -554,9 +554,9 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (pcb->settings.require_mppe) { - wo->mppe = ao->mppe = - (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) - | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); + wo->mppe = ao->mppe = + (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) + | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); } #endif /* MPPE_SUPPORT */ @@ -565,78 +565,78 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (go->mppe) { - int auth_mschap_bits = pcb->auth_done; - int numbits; - - /* - * Start with a basic sanity check: mschap[v2] auth must be in - * exactly one direction. RFC 3079 says that the keys are - * 'derived from the credentials of the peer that initiated the call', - * however the PPP protocol doesn't have such a concept, and pppd - * cannot get this info externally. Instead we do the best we can. - * NB: If MPPE is required, all other compression opts are invalid. - * So, we return right away if we can't do it. - */ - - /* Leave only the mschap auth bits set */ - auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | - CHAP_MS2_WITHPEER | CHAP_MS2_PEER); - /* Count the mschap auths */ - auth_mschap_bits >>= CHAP_MS_SHIFT; - numbits = 0; - do { - numbits += auth_mschap_bits & 1; - auth_mschap_bits >>= 1; - } while (auth_mschap_bits); - if (numbits > 1) { - ppp_error("MPPE required, but auth done in both directions."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - if (!numbits) { - ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* A plugin (eg radius) may not have obtained key material. */ - if (!pcb->mppe_keys_set) { - ppp_error("MPPE required, but keys are not available. " - "Possible plugin problem?"); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* LM auth not supported for MPPE */ - if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { - /* This might be noise */ - if (go->mppe & MPPE_OPT_40) { - ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); - go->mppe &= ~MPPE_OPT_40; - wo->mppe &= ~MPPE_OPT_40; - } - } - - /* Last check: can we actually negotiate something? */ - if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { - /* Could be misconfig, could be 40-bit disabled above. */ - ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* sync options */ - ao->mppe = go->mppe; - /* MPPE is not compatible with other compression types */ + int auth_mschap_bits = pcb->auth_done; + int numbits; + + /* + * Start with a basic sanity check: mschap[v2] auth must be in + * exactly one direction. RFC 3079 says that the keys are + * 'derived from the credentials of the peer that initiated the call', + * however the PPP protocol doesn't have such a concept, and pppd + * cannot get this info externally. Instead we do the best we can. + * NB: If MPPE is required, all other compression opts are invalid. + * So, we return right away if we can't do it. + */ + + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | + CHAP_MS2_WITHPEER | CHAP_MS2_PEER); + /* Count the mschap auths */ + auth_mschap_bits >>= CHAP_MS_SHIFT; + numbits = 0; + do { + numbits += auth_mschap_bits & 1; + auth_mschap_bits >>= 1; + } while (auth_mschap_bits); + if (numbits > 1) { + ppp_error("MPPE required, but auth done in both directions."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + if (!numbits) { + ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* A plugin (eg radius) may not have obtained key material. */ + if (!pcb->mppe_keys_set) { + ppp_error("MPPE required, but keys are not available. " + "Possible plugin problem?"); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* LM auth not supported for MPPE */ + if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { + /* This might be noise */ + if (go->mppe & MPPE_OPT_40) { + ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); + go->mppe &= ~MPPE_OPT_40; + wo->mppe &= ~MPPE_OPT_40; + } + } + + /* Last check: can we actually negotiate something? */ + if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { + /* Could be misconfig, could be 40-bit disabled above. */ + ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* sync options */ + ao->mppe = go->mppe; + /* MPPE is not compatible with other compression types */ #if BSDCOMPRESS_SUPPORT - ao->bsd_compress = go->bsd_compress = 0; + ao->bsd_compress = go->bsd_compress = 0; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - ao->predictor_1 = go->predictor_1 = 0; - ao->predictor_2 = go->predictor_2 = 0; + ao->predictor_1 = go->predictor_1 = 0; + ao->predictor_2 = go->predictor_2 = 0; #endif /* PREDICTOR_SUPPORT */ #if DEFLATE_SUPPORT - ao->deflate = go->deflate = 0; + ao->deflate = go->deflate = 0; #endif /* DEFLATE_SUPPORT */ } #endif /* MPPE_SUPPORT */ @@ -650,23 +650,23 @@ static void ccp_resetci(fsm *f) { * if BSDCOMPRESS_SUPPORT is set, it is. */ if (go->bsd_compress) { - opt_buf[0] = CI_BSD_COMPRESS; - opt_buf[1] = CILEN_BSD_COMPRESS; - for (;;) { - if (go->bsd_bits < BSD_MIN_BITS) { - go->bsd_compress = 0; - break; - } - opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->bsd_compress = 0; - break; - } - go->bsd_bits--; - } + opt_buf[0] = CI_BSD_COMPRESS; + opt_buf[1] = CILEN_BSD_COMPRESS; + for (;;) { + if (go->bsd_bits < BSD_MIN_BITS) { + go->bsd_compress = 0; + break; + } + opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->bsd_compress = 0; + break; + } + go->bsd_bits--; + } } #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -674,48 +674,48 @@ static void ccp_resetci(fsm *f) { * if DEFLATE_SUPPORT is set, it is. */ if (go->deflate) { - if (go->deflate_correct) { - opt_buf[0] = CI_DEFLATE; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_correct = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_correct = 0; - break; - } - go->deflate_size--; - } - } - if (go->deflate_draft) { - opt_buf[0] = CI_DEFLATE_DRAFT; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_draft = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_draft = 0; - break; - } - go->deflate_size--; - } - } - if (!go->deflate_correct && !go->deflate_draft) - go->deflate = 0; + if (go->deflate_correct) { + opt_buf[0] = CI_DEFLATE; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_correct = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_correct = 0; + break; + } + go->deflate_size--; + } + } + if (go->deflate_draft) { + opt_buf[0] = CI_DEFLATE_DRAFT; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_draft = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_draft = 0; + break; + } + go->deflate_size--; + } + } + if (!go->deflate_correct && !go->deflate_draft) + go->deflate = 0; } #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT @@ -723,16 +723,16 @@ static void ccp_resetci(fsm *f) { * if PREDICTOR_SUPPORT is set, it is. */ if (go->predictor_1) { - opt_buf[0] = CI_PREDICTOR_1; - opt_buf[1] = CILEN_PREDICTOR_1; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) - go->predictor_1 = 0; + opt_buf[0] = CI_PREDICTOR_1; + opt_buf[1] = CILEN_PREDICTOR_1; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) + go->predictor_1 = 0; } if (go->predictor_2) { - opt_buf[0] = CI_PREDICTOR_2; - opt_buf[1] = CILEN_PREDICTOR_2; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) - go->predictor_2 = 0; + opt_buf[0] = CI_PREDICTOR_2; + opt_buf[1] = CILEN_PREDICTOR_2; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) + go->predictor_2 = 0; } #endif /* PREDICTOR_SUPPORT */ } @@ -746,20 +746,20 @@ static int ccp_cilen(fsm *f) { return 0 #if BSDCOMPRESS_SUPPORT - + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) + + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) - + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT - + (go->predictor_1? CILEN_PREDICTOR_1: 0) - + (go->predictor_2? CILEN_PREDICTOR_2: 0) + + (go->predictor_1? CILEN_PREDICTOR_1: 0) + + (go->predictor_2? CILEN_PREDICTOR_2: 0) #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - + (go->mppe? CILEN_MPPE: 0) + + (go->mppe? CILEN_MPPE: 0) #endif /* MPPE_SUPPORT */ - ; + ; } /* @@ -776,50 +776,50 @@ static void ccp_addci(fsm *f, u_char *p, int *lenp) { */ #if MPPE_SUPPORT if (go->mppe) { - p[0] = CI_MPPE; - p[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &p[2]); - mppe_init(pcb, &pcb->mppe_decomp, go->mppe); - p += CILEN_MPPE; + p[0] = CI_MPPE; + p[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &p[2]); + mppe_init(pcb, &pcb->mppe_decomp, go->mppe); + p += CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (go->deflate_correct) { - p[0] = CI_DEFLATE; - p[1] = CILEN_DEFLATE; - p[2] = DEFLATE_MAKE_OPT(go->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } - if (go->deflate_draft) { - p[0] = CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; - p[2] = p[2 - CILEN_DEFLATE]; - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } + if (go->deflate_correct) { + p[0] = CI_DEFLATE; + p[1] = CILEN_DEFLATE; + p[2] = DEFLATE_MAKE_OPT(go->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } + if (go->deflate_draft) { + p[0] = CI_DEFLATE_DRAFT; + p[1] = CILEN_DEFLATE; + p[2] = p[2 - CILEN_DEFLATE]; + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - p[0] = CI_BSD_COMPRESS; - p[1] = CILEN_BSD_COMPRESS; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - p += CILEN_BSD_COMPRESS; + p[0] = CI_BSD_COMPRESS; + p[1] = CILEN_BSD_COMPRESS; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + p += CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT /* XXX Should Predictor 2 be preferable to Predictor 1? */ if (go->predictor_1) { - p[0] = CI_PREDICTOR_1; - p[1] = CILEN_PREDICTOR_1; - p += CILEN_PREDICTOR_1; + p[0] = CI_PREDICTOR_1; + p[1] = CILEN_PREDICTOR_1; + p += CILEN_PREDICTOR_1; } if (go->predictor_2) { - p[0] = CI_PREDICTOR_2; - p[1] = CILEN_PREDICTOR_2; - p += CILEN_PREDICTOR_2; + p[0] = CI_PREDICTOR_2; + p[1] = CILEN_PREDICTOR_2; + p += CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ @@ -841,83 +841,83 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { #if MPPE_SUPPORT if (go->mppe) { - u_char opt_buf[CILEN_MPPE]; - - opt_buf[0] = CI_MPPE; - opt_buf[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); - if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) - return 0; - p += CILEN_MPPE; - len -= CILEN_MPPE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; + u_char opt_buf[CILEN_MPPE]; + + opt_buf[0] = CI_MPPE; + opt_buf[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); + if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) + return 0; + p += CILEN_MPPE; + len -= CILEN_MPPE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (len < CILEN_DEFLATE - || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; - if (go->deflate_correct && go->deflate_draft) { - if (len < CILEN_DEFLATE - || p[0] != CI_DEFLATE_DRAFT - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + if (len < CILEN_DEFLATE + || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; + if (go->deflate_correct && go->deflate_draft) { + if (len < CILEN_DEFLATE + || p[0] != CI_DEFLATE_DRAFT + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - if (len < CILEN_BSD_COMPRESS - || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS - || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_BSD_COMPRESS + || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS + || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1) { - if (len < CILEN_PREDICTOR_1 - || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) - return 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_1 + || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) + return 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } if (go->predictor_2) { - if (len < CILEN_PREDICTOR_2 - || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) - return 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_2 + || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) + return 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; return 1; } @@ -928,8 +928,8 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options no; /* options we've seen already */ - ccp_options try_; /* options to ask for next time */ + ccp_options no; /* options we've seen already */ + ccp_options try_; /* options to ask for next time */ LWIP_UNUSED_ARG(treat_as_reject); #if !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT LWIP_UNUSED_ARG(p); @@ -941,66 +941,66 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - no.mppe = 1; - /* - * Peer wants us to use a different strength or other setting. - * Fail if we aren't willing to use his suggestion. - */ - MPPE_CI_TO_OPTS(&p[2], try_.mppe); - if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - try_.mppe = 0; - } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { - /* Peer must have set options we didn't request (suggest) */ - try_.mppe = 0; - } - - if (!try_.mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - } + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + no.mppe = 1; + /* + * Peer wants us to use a different strength or other setting. + * Fail if we aren't willing to use his suggestion. + */ + MPPE_CI_TO_OPTS(&p[2], try_.mppe); + if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + try_.mppe = 0; + } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { + /* Peer must have set options we didn't request (suggest) */ + try_.mppe = 0; + } + + if (!try_.mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { - no.deflate = 1; - /* - * Peer wants us to use a different code size or something. - * Stop asking for Deflate if we don't understand his suggestion. - */ - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS - || p[3] != DEFLATE_CHK_SEQUENCE) - try_.deflate = 0; - else if (DEFLATE_SIZE(p[2]) < go->deflate_size) - try_.deflate_size = DEFLATE_SIZE(p[2]); - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - if (go->deflate_correct && go->deflate_draft - && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT - && p[1] == CILEN_DEFLATE) { - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + && p[1] == CILEN_DEFLATE) { + no.deflate = 1; + /* + * Peer wants us to use a different code size or something. + * Stop asking for Deflate if we don't understand his suggestion. + */ + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS + || p[3] != DEFLATE_CHK_SEQUENCE) + try_.deflate = 0; + else if (DEFLATE_SIZE(p[2]) < go->deflate_size) + try_.deflate_size = DEFLATE_SIZE(p[2]); + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + if (go->deflate_correct && go->deflate_draft + && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT + && p[1] == CILEN_DEFLATE) { + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - no.bsd_compress = 1; - /* - * Peer wants us to use a different number of bits - * or a different version. - */ - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) - try_.bsd_compress = 0; - else if (BSD_NBITS(p[2]) < go->bsd_bits) - try_.bsd_bits = BSD_NBITS(p[2]); - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + no.bsd_compress = 1; + /* + * Peer wants us to use a different number of bits + * or a different version. + */ + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) + try_.bsd_compress = 0; + else if (BSD_NBITS(p[2]) < go->bsd_bits) + try_.bsd_bits = BSD_NBITS(p[2]); + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ @@ -1011,7 +1011,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1021,7 +1021,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { static int ccp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options try_; /* options to request next time */ + ccp_options try_; /* options to request next time */ try_ = *go; @@ -1030,69 +1030,69 @@ static int ccp_rejci(fsm *f, u_char *p, int len) { * configure-requests. */ if (len == 0 && pcb->ccp_all_rejected) - return -1; + return -1; #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - ppp_error("MPPE required but peer refused"); - lcp_close(pcb, "MPPE required but peer refused"); - p += CILEN_MPPE; - len -= CILEN_MPPE; + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + ppp_error("MPPE required but peer refused"); + lcp_close(pcb, "MPPE required but peer refused"); + p += CILEN_MPPE; + len -= CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate_correct && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_correct = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_correct = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (go->deflate_draft && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_draft = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_draft = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (!try_.deflate_correct && !try_.deflate_draft) - try_.deflate = 0; + try_.deflate = 0; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - try_.bsd_compress = 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + try_.bsd_compress = 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1 && len >= CILEN_PREDICTOR_1 - && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { - try_.predictor_1 = 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; + && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { + try_.predictor_1 = 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; } if (go->predictor_2 && len >= CILEN_PREDICTOR_2 - && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { - try_.predictor_2 = 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; + && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { + try_.predictor_2 = 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1114,8 +1114,8 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { u_char *p0, *retp; int len, clen, type; #if MPPE_SUPPORT - u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ - /* CI_MPPE, or due to other options? */ + u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ + /* CI_MPPE, or due to other options? */ #endif /* MPPE_SUPPORT */ ret = CONFACK; @@ -1126,257 +1126,257 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { ho->method = (len > 0)? p[0]: 0; while (len > 0) { - newret = CONFACK; - if (len < 2 || p[1] < 2 || p[1] > len) { - /* length is bad */ - clen = len; - newret = CONFREJ; + newret = CONFACK; + if (len < 2 || p[1] < 2 || p[1] > len) { + /* length is bad */ + clen = len; + newret = CONFREJ; - } else { - type = p[0]; - clen = p[1]; + } else { + type = p[0]; + clen = p[1]; - switch (type) { + switch (type) { #if MPPE_SUPPORT - case CI_MPPE: - if (!ao->mppe || clen != CILEN_MPPE) { - newret = CONFREJ; - break; - } - MPPE_CI_TO_OPTS(&p[2], ho->mppe); - - /* Nak if anything unsupported or unknown are set. */ - if (ho->mppe & MPPE_OPT_UNSUPPORTED) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNSUPPORTED; - } - if (ho->mppe & MPPE_OPT_UNKNOWN) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNKNOWN; - } - - /* Check state opt */ - if (ho->mppe & MPPE_OPT_STATEFUL) { - /* - * We can Nak and request stateless, but it's a - * lot easier to just assume the peer will request - * it if he can do it; stateful mode is bad over - * the Internet -- which is where we expect MPPE. - */ - if (pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - newret = CONFREJ; - break; - } - } - - /* Find out which of {S,L} are set. */ - if ((ho->mppe & MPPE_OPT_128) - && (ho->mppe & MPPE_OPT_40)) { - /* Both are set, negotiate the strongest. */ - newret = CONFNAK; - if (ao->mppe & MPPE_OPT_128) - ho->mppe &= ~MPPE_OPT_40; - else if (ao->mppe & MPPE_OPT_40) - ho->mppe &= ~MPPE_OPT_128; - else { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_128) { - if (!(ao->mppe & MPPE_OPT_128)) { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_40) { - if (!(ao->mppe & MPPE_OPT_40)) { - newret = CONFREJ; - break; - } - } else { - /* Neither are set. */ - /* We cannot accept this. */ - newret = CONFNAK; - /* Give the peer our idea of what can be used, - so it can choose and confirm */ - ho->mppe = ao->mppe; - } - - /* rebuild the opts */ - MPPE_OPTS_TO_CI(ho->mppe, &p[2]); - if (newret == CONFACK) { - int mtu; - - mppe_init(pcb, &pcb->mppe_comp, ho->mppe); - /* - * We need to decrease the interface MTU by MPPE_PAD - * because MPPE frames **grow**. The kernel [must] - * allocate MPPE_PAD extra bytes in xmit buffers. - */ - mtu = netif_get_mtu(pcb); - if (mtu) - netif_set_mtu(pcb, mtu - MPPE_PAD); - else - newret = CONFREJ; - } - - /* - * We have accepted MPPE or are willing to negotiate - * MPPE parameters. A CONFREJ is due to subsequent - * (non-MPPE) processing. - */ - rej_for_ci_mppe = 0; - break; + case CI_MPPE: + if (!ao->mppe || clen != CILEN_MPPE) { + newret = CONFREJ; + break; + } + MPPE_CI_TO_OPTS(&p[2], ho->mppe); + + /* Nak if anything unsupported or unknown are set. */ + if (ho->mppe & MPPE_OPT_UNSUPPORTED) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNSUPPORTED; + } + if (ho->mppe & MPPE_OPT_UNKNOWN) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNKNOWN; + } + + /* Check state opt */ + if (ho->mppe & MPPE_OPT_STATEFUL) { + /* + * We can Nak and request stateless, but it's a + * lot easier to just assume the peer will request + * it if he can do it; stateful mode is bad over + * the Internet -- which is where we expect MPPE. + */ + if (pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + newret = CONFREJ; + break; + } + } + + /* Find out which of {S,L} are set. */ + if ((ho->mppe & MPPE_OPT_128) + && (ho->mppe & MPPE_OPT_40)) { + /* Both are set, negotiate the strongest. */ + newret = CONFNAK; + if (ao->mppe & MPPE_OPT_128) + ho->mppe &= ~MPPE_OPT_40; + else if (ao->mppe & MPPE_OPT_40) + ho->mppe &= ~MPPE_OPT_128; + else { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_128) { + if (!(ao->mppe & MPPE_OPT_128)) { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_40) { + if (!(ao->mppe & MPPE_OPT_40)) { + newret = CONFREJ; + break; + } + } else { + /* Neither are set. */ + /* We cannot accept this. */ + newret = CONFNAK; + /* Give the peer our idea of what can be used, + so it can choose and confirm */ + ho->mppe = ao->mppe; + } + + /* rebuild the opts */ + MPPE_OPTS_TO_CI(ho->mppe, &p[2]); + if (newret == CONFACK) { + int mtu; + + mppe_init(pcb, &pcb->mppe_comp, ho->mppe); + /* + * We need to decrease the interface MTU by MPPE_PAD + * because MPPE frames **grow**. The kernel [must] + * allocate MPPE_PAD extra bytes in xmit buffers. + */ + mtu = netif_get_mtu(pcb); + if (mtu) + netif_set_mtu(pcb, mtu - MPPE_PAD); + else + newret = CONFREJ; + } + + /* + * We have accepted MPPE or are willing to negotiate + * MPPE parameters. A CONFREJ is due to subsequent + * (non-MPPE) processing. + */ + rej_for_ci_mppe = 0; + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (!ao->deflate || clen != CILEN_DEFLATE - || (!ao->deflate_correct && type == CI_DEFLATE) - || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { - newret = CONFREJ; - break; - } - - ho->deflate = 1; - ho->deflate_size = nb = DEFLATE_SIZE(p[2]); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || p[3] != DEFLATE_CHK_SEQUENCE - || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do Deflate with the window - * size they want. If the window is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_DEFLATE, 1); - if (res > 0) - break; /* it's OK now */ - if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { - newret = CONFREJ; - p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); - break; - } - newret = CONFNAK; - --nb; - p[2] = DEFLATE_MAKE_OPT(nb); - } - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (!ao->deflate || clen != CILEN_DEFLATE + || (!ao->deflate_correct && type == CI_DEFLATE) + || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { + newret = CONFREJ; + break; + } + + ho->deflate = 1; + ho->deflate_size = nb = DEFLATE_SIZE(p[2]); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || p[3] != DEFLATE_CHK_SEQUENCE + || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do Deflate with the window + * size they want. If the window is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_DEFLATE, 1); + if (res > 0) + break; /* it's OK now */ + if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { + newret = CONFREJ; + p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); + break; + } + newret = CONFNAK; + --nb; + p[2] = DEFLATE_MAKE_OPT(nb); + } + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { - newret = CONFREJ; - break; - } - - ho->bsd_compress = 1; - ho->bsd_bits = nb = BSD_NBITS(p[2]); - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION - || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do BSD-Compress with the code - * size they want. If the code size is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); - if (res > 0) - break; - if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { - newret = CONFREJ; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, - ho->bsd_bits); - break; - } - newret = CONFNAK; - --nb; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); - } - } - break; + case CI_BSD_COMPRESS: + if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { + newret = CONFREJ; + break; + } + + ho->bsd_compress = 1; + ho->bsd_bits = nb = BSD_NBITS(p[2]); + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION + || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do BSD-Compress with the code + * size they want. If the code size is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); + if (res > 0) + break; + if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { + newret = CONFREJ; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, + ho->bsd_bits); + break; + } + newret = CONFNAK; + --nb; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); + } + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { - newret = CONFREJ; - break; - } - - ho->predictor_1 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { - newret = CONFREJ; - } - break; - - case CI_PREDICTOR_2: - if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { - newret = CONFREJ; - break; - } - - ho->predictor_2 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { - newret = CONFREJ; - } - break; + case CI_PREDICTOR_1: + if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { + newret = CONFREJ; + break; + } + + ho->predictor_1 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { + newret = CONFREJ; + } + break; + + case CI_PREDICTOR_2: + if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { + newret = CONFREJ; + break; + } + + ho->predictor_2 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { + newret = CONFREJ; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: - newret = CONFREJ; - } - } + default: + newret = CONFREJ; + } + } - if (newret == CONFNAK && dont_nak) - newret = CONFREJ; - if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { - /* we're returning this option */ - if (newret == CONFREJ && ret == CONFNAK) - retp = p0; - ret = newret; - if (p != retp) - MEMCPY(retp, p, clen); - retp += clen; - } + if (newret == CONFNAK && dont_nak) + newret = CONFREJ; + if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { + /* we're returning this option */ + if (newret == CONFREJ && ret == CONFNAK) + retp = p0; + ret = newret; + if (p != retp) + MEMCPY(retp, p, clen); + retp += clen; + } - p += clen; - len -= clen; + p += clen; + len -= clen; } if (ret != CONFACK) { - if (ret == CONFREJ && *lenp == retp - p0) - pcb->ccp_all_rejected = 1; - else - *lenp = retp - p0; + if (ret == CONFREJ && *lenp == retp - p0) + pcb->ccp_all_rejected = 1; + else + *lenp = retp - p0; } #if MPPE_SUPPORT if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ return ret; @@ -1392,63 +1392,63 @@ static const char *method_name(ccp_options *opt, ccp_options *opt2) { #endif /* !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT */ if (!ccp_anycompress(opt)) - return "(none)"; + return "(none)"; switch (opt->method) { #if MPPE_SUPPORT case CI_MPPE: { - char *p = result; - char *q = result + sizeof(result); /* 1 past result */ - - ppp_slprintf(p, q - p, "MPPE "); - p += 5; - if (opt->mppe & MPPE_OPT_128) { - ppp_slprintf(p, q - p, "128-bit "); - p += 8; - } - if (opt->mppe & MPPE_OPT_40) { - ppp_slprintf(p, q - p, "40-bit "); - p += 7; - } - if (opt->mppe & MPPE_OPT_STATEFUL) - ppp_slprintf(p, q - p, "stateful"); - else - ppp_slprintf(p, q - p, "stateless"); - - break; + char *p = result; + char *q = result + sizeof(result); /* 1 past result */ + + ppp_slprintf(p, q - p, "MPPE "); + p += 5; + if (opt->mppe & MPPE_OPT_128) { + ppp_slprintf(p, q - p, "128-bit "); + p += 8; + } + if (opt->mppe & MPPE_OPT_40) { + ppp_slprintf(p, q - p, "40-bit "); + p += 7; + } + if (opt->mppe & MPPE_OPT_STATEFUL) + ppp_slprintf(p, q - p, "stateful"); + else + ppp_slprintf(p, q - p, "stateless"); + + break; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT case CI_DEFLATE: case CI_DEFLATE_DRAFT: - if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) - ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size, opt2->deflate_size); - else - ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size); - break; + if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) + ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size, opt2->deflate_size); + else + ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size); + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT case CI_BSD_COMPRESS: - if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", - opt->bsd_bits, opt2->bsd_bits); - else - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", - opt->bsd_bits); - break; + if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", + opt->bsd_bits, opt2->bsd_bits); + else + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", + opt->bsd_bits); + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT case CI_PREDICTOR_1: - return "Predictor 1"; + return "Predictor 1"; case CI_PREDICTOR_2: - return "Predictor 2"; + return "Predictor 2"; #endif /* PREDICTOR_SUPPORT */ default: - ppp_slprintf(result, sizeof(result), "Method %d", opt->method); + ppp_slprintf(result, sizeof(result), "Method %d", opt->method); } return result; } @@ -1464,21 +1464,21 @@ static void ccp_up(fsm *f) { ccp_set(pcb, 1, 1, go->method, ho->method); if (ccp_anycompress(go)) { - if (ccp_anycompress(ho)) { - if (go->method == ho->method) { - ppp_notice("%s compression enabled", method_name(go, ho)); - } else { - ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); - ppp_notice("%s / %s compression enabled", - method1, method_name(ho, NULL)); - } - } else - ppp_notice("%s receive compression enabled", method_name(go, NULL)); + if (ccp_anycompress(ho)) { + if (go->method == ho->method) { + ppp_notice("%s compression enabled", method_name(go, ho)); + } else { + ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); + ppp_notice("%s / %s compression enabled", + method1, method_name(ho, NULL)); + } + } else + ppp_notice("%s receive compression enabled", method_name(go, NULL)); } else if (ccp_anycompress(ho)) - ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); + ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); #if MPPE_SUPPORT if (go->mppe) { - continue_networks(pcb); /* Bring up IP et al */ + continue_networks(pcb); /* Bring up IP et al */ } #endif /* MPPE_SUPPORT */ } @@ -1493,17 +1493,17 @@ static void ccp_down(fsm *f) { #endif /* MPPE_SUPPORT */ if (pcb->ccp_localstate & RACK_PENDING) - UNTIMEOUT(ccp_rack_timeout, f); + UNTIMEOUT(ccp_rack_timeout, f); pcb->ccp_localstate = 0; ccp_set(pcb, 1, 0, 0, 0); #if MPPE_SUPPORT if (go->mppe) { - go->mppe = 0; - if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { - /* If LCP is not already going down, make sure it does. */ - ppp_error("MPPE disabled"); - lcp_close(pcb, "MPPE disabled"); - } + go->mppe = 0; + if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { + /* If LCP is not already going down, make sure it does. */ + ppp_error("MPPE disabled"); + lcp_close(pcb, "MPPE disabled"); + } } #endif /* MPPE_SUPPORT */ } @@ -1526,17 +1526,17 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons p0 = p; if (plen < HEADERLEN) - return 0; + return 0; code = p[0]; id = p[1]; len = (p[2] << 8) + p[3]; if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ccp_codenames) && ccp_codenames[code-1] != NULL) - printer(arg, " %s", ccp_codenames[code-1]); + printer(arg, " %s", ccp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; p += HEADERLEN; @@ -1546,99 +1546,99 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons case CONFACK: case CONFNAK: case CONFREJ: - /* print list of possible compression methods */ - while (len >= 2) { - code = p[0]; - optlen = p[1]; - if (optlen < 2 || optlen > len) - break; - printer(arg, " <"); - len -= optlen; - optend = p + optlen; - switch (code) { + /* print list of possible compression methods */ + while (len >= 2) { + code = p[0]; + optlen = p[1]; + if (optlen < 2 || optlen > len) + break; + printer(arg, " <"); + len -= optlen; + optend = p + optlen; + switch (code) { #if MPPE_SUPPORT - case CI_MPPE: - if (optlen >= CILEN_MPPE) { - u_char mppe_opts; - - MPPE_CI_TO_OPTS(&p[2], mppe_opts); - printer(arg, "mppe %s %s %s %s %s %s%s", - (p[2] & MPPE_H_BIT)? "+H": "-H", - (p[5] & MPPE_M_BIT)? "+M": "-M", - (p[5] & MPPE_S_BIT)? "+S": "-S", - (p[5] & MPPE_L_BIT)? "+L": "-L", - (p[5] & MPPE_D_BIT)? "+D": "-D", - (p[5] & MPPE_C_BIT)? "+C": "-C", - (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); - if (mppe_opts & MPPE_OPT_UNKNOWN) - printer(arg, " (%.2x %.2x %.2x %.2x)", - p[2], p[3], p[4], p[5]); - p += CILEN_MPPE; - } - break; + case CI_MPPE: + if (optlen >= CILEN_MPPE) { + u_char mppe_opts; + + MPPE_CI_TO_OPTS(&p[2], mppe_opts); + printer(arg, "mppe %s %s %s %s %s %s%s", + (p[2] & MPPE_H_BIT)? "+H": "-H", + (p[5] & MPPE_M_BIT)? "+M": "-M", + (p[5] & MPPE_S_BIT)? "+S": "-S", + (p[5] & MPPE_L_BIT)? "+L": "-L", + (p[5] & MPPE_D_BIT)? "+D": "-D", + (p[5] & MPPE_C_BIT)? "+C": "-C", + (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); + if (mppe_opts & MPPE_OPT_UNKNOWN) + printer(arg, " (%.2x %.2x %.2x %.2x)", + p[2], p[3], p[4], p[5]); + p += CILEN_MPPE; + } + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (optlen >= CILEN_DEFLATE) { - printer(arg, "deflate%s %d", - (code == CI_DEFLATE_DRAFT? "(old#)": ""), - DEFLATE_SIZE(p[2])); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) - printer(arg, " method %d", DEFLATE_METHOD(p[2])); - if (p[3] != DEFLATE_CHK_SEQUENCE) - printer(arg, " check %d", p[3]); - p += CILEN_DEFLATE; - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (optlen >= CILEN_DEFLATE) { + printer(arg, "deflate%s %d", + (code == CI_DEFLATE_DRAFT? "(old#)": ""), + DEFLATE_SIZE(p[2])); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) + printer(arg, " method %d", DEFLATE_METHOD(p[2])); + if (p[3] != DEFLATE_CHK_SEQUENCE) + printer(arg, " check %d", p[3]); + p += CILEN_DEFLATE; + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (optlen >= CILEN_BSD_COMPRESS) { - printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), - BSD_NBITS(p[2])); - p += CILEN_BSD_COMPRESS; - } - break; + case CI_BSD_COMPRESS: + if (optlen >= CILEN_BSD_COMPRESS) { + printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), + BSD_NBITS(p[2])); + p += CILEN_BSD_COMPRESS; + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (optlen >= CILEN_PREDICTOR_1) { - printer(arg, "predictor 1"); - p += CILEN_PREDICTOR_1; - } - break; - case CI_PREDICTOR_2: - if (optlen >= CILEN_PREDICTOR_2) { - printer(arg, "predictor 2"); - p += CILEN_PREDICTOR_2; - } - break; + case CI_PREDICTOR_1: + if (optlen >= CILEN_PREDICTOR_1) { + printer(arg, "predictor 1"); + p += CILEN_PREDICTOR_1; + } + break; + case CI_PREDICTOR_2: + if (optlen >= CILEN_PREDICTOR_2) { + printer(arg, "predictor 2"); + p += CILEN_PREDICTOR_2; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: + default: break; - } - while (p < optend) - printer(arg, " %.2x", *p++); - printer(arg, ">"); - } - break; + } + while (p < optend) + printer(arg, " %.2x", *p++); + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: break; } /* dump out the rest of the packet in hex */ while (--len >= 0) - printer(arg, " %.2x", *p++); + printer(arg, " %.2x", *p++); return p - p0; } @@ -1667,34 +1667,34 @@ static void ccp_datainput(ppp_pcb *pcb, u_char *pkt, int len) { f = &pcb->ccp_fsm; if (f->state == PPP_FSM_OPENED) { - if (ccp_fatal_error(pcb)) { - /* - * Disable compression by taking CCP down. - */ - ppp_error("Lost compression sync: disabling compression"); - ccp_close(pcb, "Lost compression sync"); + if (ccp_fatal_error(pcb)) { + /* + * Disable compression by taking CCP down. + */ + ppp_error("Lost compression sync: disabling compression"); + ccp_close(pcb, "Lost compression sync"); #if MPPE_SUPPORT - /* - * If we were doing MPPE, we must also take the link down. - */ - if (go->mppe) { - ppp_error("Too many MPPE errors, closing LCP"); - lcp_close(pcb, "Too many MPPE errors"); - } + /* + * If we were doing MPPE, we must also take the link down. + */ + if (go->mppe) { + ppp_error("Too many MPPE errors, closing LCP"); + lcp_close(pcb, "Too many MPPE errors"); + } #endif /* MPPE_SUPPORT */ - } else { - /* - * Send a reset-request to reset the peer's compressor. - * We don't do that if we are still waiting for an - * acknowledgement to a previous reset-request. - */ - if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; - } else - pcb->ccp_localstate |= RREQ_REPEAT; - } + } else { + /* + * Send a reset-request to reset the peer's compressor. + * We don't do that if we are still waiting for an + * acknowledgement to a previous reset-request. + */ + if (!(pcb->ccp_localstate & RACK_PENDING)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; + } else + pcb->ccp_localstate |= RREQ_REPEAT; + } } } #endif /* PPP_DATAINPUT */ @@ -1707,7 +1707,7 @@ void ccp_resetrequest(ppp_pcb *pcb) { fsm *f = &pcb->ccp_fsm; if (f->state != PPP_FSM_OPENED) - return; + return; /* * Send a reset-request to reset the peer's compressor. @@ -1715,11 +1715,11 @@ void ccp_resetrequest(ppp_pcb *pcb) { * acknowledgement to a previous reset-request. */ if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; } else - pcb->ccp_localstate |= RREQ_REPEAT; + pcb->ccp_localstate |= RREQ_REPEAT; } /* @@ -1730,11 +1730,11 @@ static void ccp_rack_timeout(void *arg) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED && (pcb->ccp_localstate & RREQ_REPEAT)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate &= ~RREQ_REPEAT; + fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate &= ~RREQ_REPEAT; } else - pcb->ccp_localstate &= ~RACK_PENDING; + pcb->ccp_localstate &= ~RACK_PENDING; } #endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c b/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c index 88f069f032..2b7c9b36a8 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c @@ -43,84 +43,84 @@ #include "netif/ppp/magic.h" #include "netif/ppp/pppcrypt.h" -#define MD5_HASH_SIZE 16 -#define MD5_MIN_CHALLENGE 17 -#define MD5_MAX_CHALLENGE 24 +#define MD5_HASH_SIZE 16 +#define MD5_MIN_CHALLENGE 17 +#define MD5_MAX_CHALLENGE 24 #define MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE 3 /* 2^3-1 = 7, 17+7 = 24 */ #if PPP_SERVER static void chap_md5_generate_challenge(ppp_pcb *pcb, unsigned char *cp) { - int clen; - LWIP_UNUSED_ARG(pcb); + int clen; + LWIP_UNUSED_ARG(pcb); - clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); - *cp++ = clen; - magic_random_bytes(cp, clen); + clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); + *cp++ = clen; + magic_random_bytes(cp, clen); } static int chap_md5_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - lwip_md5_context ctx; - unsigned char idbyte = id; - unsigned char hash[MD5_HASH_SIZE]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(name); - LWIP_UNUSED_ARG(pcb); + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + lwip_md5_context ctx; + unsigned char idbyte = id; + unsigned char hash[MD5_HASH_SIZE]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(pcb); - challenge_len = *challenge++; - response_len = *response++; - if (response_len == MD5_HASH_SIZE) { - /* Generate hash of ID, secret, challenge */ - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, hash); - lwip_md5_free(&ctx); + challenge_len = *challenge++; + response_len = *response++; + if (response_len == MD5_HASH_SIZE) { + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, hash); + lwip_md5_free(&ctx); - /* Test if our hash matches the peer's response */ - if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } - } - ppp_slprintf(message, message_space, "Access denied"); - return 0; + /* Test if our hash matches the peer's response */ + if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } + } + ppp_slprintf(message, message_space, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chap_md5_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - lwip_md5_context ctx; - unsigned char idbyte = id; - int challenge_len = *challenge++; - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - LWIP_UNUSED_ARG(pcb); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + lwip_md5_context ctx; + unsigned char idbyte = id; + int challenge_len = *challenge++; + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + LWIP_UNUSED_ARG(pcb); - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, (const u_char *)secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, &response[1]); - lwip_md5_free(&ctx); - response[0] = MD5_HASH_SIZE; + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, (const u_char *)secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, &response[1]); + lwip_md5_free(&ctx); + response[0] = MD5_HASH_SIZE; } const struct chap_digest_type md5_digest = { - CHAP_MD5, /* code */ + CHAP_MD5, /* code */ #if PPP_SERVER - chap_md5_generate_challenge, - chap_md5_verify_response, + chap_md5_generate_challenge, + chap_md5_verify_response, #endif /* PPP_SERVER */ - chap_md5_make_response, - NULL, /* check_success */ - NULL, /* handle_failure */ + chap_md5_make_response, + NULL, /* check_success */ + NULL, /* handle_failure */ }; #endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c b/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c index 485122d272..e599f3eb76 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c @@ -52,9 +52,9 @@ #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ int (*chap_verify_hook)(const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) = NULL; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) = NULL; #endif /* UNUSED */ #if PPP_OPTIONS @@ -62,24 +62,24 @@ int (*chap_verify_hook)(const char *name, const char *ourname, int id, * Command-line options. */ static option_t chap_option_list[] = { - { "chap-restart", o_int, &chap_timeout_time, - "Set timeout for CHAP", OPT_PRIO }, - { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, - "Set max #xmits for challenge", OPT_PRIO }, - { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, - "Set interval for rechallenge", OPT_PRIO }, - { NULL } + { "chap-restart", o_int, &chap_timeout_time, + "Set timeout for CHAP", OPT_PRIO }, + { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, + "Set max #xmits for challenge", OPT_PRIO }, + { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, + "Set interval for rechallenge", OPT_PRIO }, + { NULL } }; #endif /* PPP_OPTIONS */ /* Values for flags in chap_client_state and chap_server_state */ -#define LOWERUP 1 -#define AUTH_STARTED 2 -#define AUTH_DONE 4 -#define AUTH_FAILED 8 -#define TIMEOUT_PENDING 0x10 -#define CHALLENGE_VALID 0x20 +#define LOWERUP 1 +#define AUTH_STARTED 2 +#define AUTH_DONE 4 +#define AUTH_FAILED 8 +#define TIMEOUT_PENDING 0x10 +#define CHALLENGE_VALID 0x20 /* * Prototypes. @@ -91,21 +91,21 @@ static void chap_lowerdown(ppp_pcb *pcb); static void chap_timeout(void *arg); static void chap_generate_challenge(ppp_pcb *pcb); static void chap_handle_response(ppp_pcb *pcb, int code, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_protrej(ppp_pcb *pcb); static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen); #if PRINTPKT_SUPPORT static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ /* List of digest types that we know about */ @@ -122,12 +122,12 @@ static const struct chap_digest_type* const chap_digests[] = { * chap_init - reset to initial state. */ static void chap_init(ppp_pcb *pcb) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); #if 0 /* Not necessary, everything is cleared in ppp_new() */ - memset(&pcb->chap_client, 0, sizeof(chap_client_state)); + memset(&pcb->chap_client, 0, sizeof(chap_client_state)); #if PPP_SERVER - memset(&pcb->chap_server, 0, sizeof(chap_server_state)); + memset(&pcb->chap_server, 0, sizeof(chap_server_state)); #endif /* PPP_SERVER */ #endif /* 0 */ } @@ -137,21 +137,21 @@ static void chap_init(ppp_pcb *pcb) { */ static void chap_lowerup(ppp_pcb *pcb) { - pcb->chap_client.flags |= LOWERUP; + pcb->chap_client.flags |= LOWERUP; #if PPP_SERVER - pcb->chap_server.flags |= LOWERUP; - if (pcb->chap_server.flags & AUTH_STARTED) - chap_timeout(pcb); + pcb->chap_server.flags |= LOWERUP; + if (pcb->chap_server.flags & AUTH_STARTED) + chap_timeout(pcb); #endif /* PPP_SERVER */ } static void chap_lowerdown(ppp_pcb *pcb) { - pcb->chap_client.flags = 0; + pcb->chap_client.flags = 0; #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) - UNTIMEOUT(chap_timeout, pcb); - pcb->chap_server.flags = 0; + if (pcb->chap_server.flags & TIMEOUT_PENDING) + UNTIMEOUT(chap_timeout, pcb); + pcb->chap_server.flags = 0; #endif /* PPP_SERVER */ } @@ -162,27 +162,27 @@ static void chap_lowerdown(ppp_pcb *pcb) { * otherwise we wait for the lower layer to come up. */ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if (pcb->chap_server.flags & AUTH_STARTED) { - ppp_error("CHAP: peer authentication already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_server.digest = dp; - pcb->chap_server.name = our_name; - /* Start with a random ID value */ - pcb->chap_server.id = magic(); - pcb->chap_server.flags |= AUTH_STARTED; - if (pcb->chap_server.flags & LOWERUP) - chap_timeout(pcb); + const struct chap_digest_type *dp; + int i; + + if (pcb->chap_server.flags & AUTH_STARTED) { + ppp_error("CHAP: peer authentication already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_server.digest = dp; + pcb->chap_server.name = our_name; + /* Start with a random ID value */ + pcb->chap_server.id = magic(); + pcb->chap_server.flags |= AUTH_STARTED; + if (pcb->chap_server.flags & LOWERUP) + chap_timeout(pcb); } #endif /* PPP_SERVER */ @@ -191,27 +191,27 @@ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * There isn't much to do until we receive a challenge. */ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if(NULL == our_name) - return; - - if (pcb->chap_client.flags & AUTH_STARTED) { - ppp_error("CHAP: authentication with peer already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_client.digest = dp; - pcb->chap_client.name = our_name; - pcb->chap_client.flags |= AUTH_STARTED; + const struct chap_digest_type *dp; + int i; + + if(NULL == our_name) + return; + + if (pcb->chap_client.flags & AUTH_STARTED) { + ppp_error("CHAP: authentication with peer already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_client.digest = dp; + pcb->chap_client.name = our_name; + pcb->chap_client.flags |= AUTH_STARTED; } #if PPP_SERVER @@ -221,33 +221,33 @@ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * or a new challenge to start re-authentication. */ static void chap_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; - struct pbuf *p; - - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { - pcb->chap_server.challenge_xmits = 0; - chap_generate_challenge(pcb); - pcb->chap_server.flags |= CHALLENGE_VALID; - } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; - auth_peer_fail(pcb, PPP_CHAP); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); - ppp_write(pcb, p); - ++pcb->chap_server.challenge_xmits; - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); + ppp_pcb *pcb = (ppp_pcb*)arg; + struct pbuf *p; + + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { + pcb->chap_server.challenge_xmits = 0; + chap_generate_challenge(pcb); + pcb->chap_server.flags |= CHALLENGE_VALID; + } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; + auth_peer_fail(pcb, PPP_CHAP); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); + ppp_write(pcb, p); + ++pcb->chap_server.challenge_xmits; + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); } /* @@ -255,152 +255,152 @@ static void chap_timeout(void *arg) { * the challenge packet in pcb->chap_server.challenge_pkt. */ static void chap_generate_challenge(ppp_pcb *pcb) { - int clen = 1, nlen, len; - unsigned char *p; - - p = pcb->chap_server.challenge; - MAKEHEADER(p, PPP_CHAP); - p += CHAP_HDRLEN; - pcb->chap_server.digest->generate_challenge(pcb, p); - clen = *p; - nlen = strlen(pcb->chap_server.name); - memcpy(p + 1 + clen, pcb->chap_server.name, nlen); - - len = CHAP_HDRLEN + 1 + clen + nlen; - pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; - - p = pcb->chap_server.challenge + PPP_HDRLEN; - p[0] = CHAP_CHALLENGE; - p[1] = ++pcb->chap_server.id; - p[2] = len >> 8; - p[3] = len; + int clen = 1, nlen, len; + unsigned char *p; + + p = pcb->chap_server.challenge; + MAKEHEADER(p, PPP_CHAP); + p += CHAP_HDRLEN; + pcb->chap_server.digest->generate_challenge(pcb, p); + clen = *p; + nlen = strlen(pcb->chap_server.name); + memcpy(p + 1 + clen, pcb->chap_server.name, nlen); + + len = CHAP_HDRLEN + 1 + clen + nlen; + pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; + + p = pcb->chap_server.challenge + PPP_HDRLEN; + p[0] = CHAP_CHALLENGE; + p[1] = ++pcb->chap_server.id; + p[2] = len >> 8; + p[3] = len; } /* * chap_handle_response - check the response to our challenge. */ static void chap_handle_response(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int response_len, ok, mlen; - const unsigned char *response; - unsigned char *outp; - struct pbuf *p; - const char *name = NULL; /* initialized to shut gcc up */ + unsigned char *pkt, int len) { + int response_len, ok, mlen; + const unsigned char *response; + unsigned char *outp; + struct pbuf *p; + const char *name = NULL; /* initialized to shut gcc up */ #if 0 /* UNUSED */ - int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, - const unsigned char *, const unsigned char *, char *, int); + int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, + const unsigned char *, const unsigned char *, char *, int); #endif /* UNUSED */ - char rname[MAXNAMELEN+1]; - char message[256]; - - if ((pcb->chap_server.flags & LOWERUP) == 0) - return; - if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) - return; - if (pcb->chap_server.flags & CHALLENGE_VALID) { - response = pkt; - GETCHAR(response_len, pkt); - len -= response_len + 1; /* length of name */ - name = (char *)pkt + response_len; - if (len < 0) - return; - - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } + char rname[MAXNAMELEN+1]; + char message[256]; + + if ((pcb->chap_server.flags & LOWERUP) == 0) + return; + if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) + return; + if (pcb->chap_server.flags & CHALLENGE_VALID) { + response = pkt; + GETCHAR(response_len, pkt); + len -= response_len + 1; /* length of name */ + name = (char *)pkt + response_len; + if (len < 0) + return; + + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } #if PPP_REMOTENAME - if (pcb->settings.explicit_remote) { - name = pcb->remote_name; - } else + if (pcb->settings.explicit_remote) { + name = pcb->remote_name; + } else #endif /* PPP_REMOTENAME */ - { - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); - name = rname; - } + { + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); + name = rname; + } #if 0 /* UNUSED */ - if (chap_verify_hook) - verifier = chap_verify_hook; - else - verifier = chap_verify_response; - ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, - pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, - response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); + if (chap_verify_hook) + verifier = chap_verify_hook; + else + verifier = chap_verify_response; + ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, + pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, + response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); #endif /* UNUSED */ - ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, + ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, response, message, sizeof(message)); #if 0 /* UNUSED */ - if (!ok || !auth_number()) { + if (!ok || !auth_number()) { #endif /* UNUSED */ - if (!ok) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP authentication", name); - } - } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) - return; - - /* send the response */ - mlen = strlen(message); - len = CHAP_HDRLEN + mlen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (unsigned char *)p->payload; - MAKEHEADER(outp, PPP_CHAP); - - outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - if (mlen > 0) - memcpy(outp + CHAP_HDRLEN, message, mlen); - ppp_write(pcb, p); - - if (pcb->chap_server.flags & CHALLENGE_VALID) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { + if (!ok) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP authentication", name); + } + } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) + return; + + /* send the response */ + mlen = strlen(message); + len = CHAP_HDRLEN + mlen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (unsigned char *)p->payload; + MAKEHEADER(outp, PPP_CHAP); + + outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + if (mlen > 0) + memcpy(outp + CHAP_HDRLEN, message, mlen); + ppp_write(pcb, p); + + if (pcb->chap_server.flags & CHALLENGE_VALID) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { #if 0 /* UNUSED */ - /* - * Auth is OK, so now we need to check session restrictions - * to ensure everything is OK, but only if we used a - * plugin, and only if we're configured to check. This - * allows us to do PAM checks on PPP servers that - * authenticate against ActiveDirectory, and use AD for - * account info (like when using Winbind integrated with - * PAM). - */ - if (session_mgmt && - session_check(name, NULL, devnam, NULL) == 0) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP Session verification", name); - } + /* + * Auth is OK, so now we need to check session restrictions + * to ensure everything is OK, but only if we used a + * plugin, and only if we're configured to check. This + * allows us to do PAM checks on PPP servers that + * authenticate against ActiveDirectory, and use AD for + * account info (like when using Winbind integrated with + * PAM). + */ + if (session_mgmt && + session_check(name, NULL, devnam, NULL) == 0) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP Session verification", name); + } #endif /* UNUSED */ - } - if (pcb->chap_server.flags & AUTH_FAILED) { - auth_peer_fail(pcb, PPP_CHAP); - } else { - if ((pcb->chap_server.flags & AUTH_DONE) == 0) - auth_peer_success(pcb, PPP_CHAP, - pcb->chap_server.digest->code, - name, strlen(name)); - if (pcb->settings.chap_rechallenge_time) { - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, pcb, - pcb->settings.chap_rechallenge_time); - } - } - pcb->chap_server.flags |= AUTH_DONE; - } + } + if (pcb->chap_server.flags & AUTH_FAILED) { + auth_peer_fail(pcb, PPP_CHAP); + } else { + if ((pcb->chap_server.flags & AUTH_DONE) == 0) + auth_peer_success(pcb, PPP_CHAP, + pcb->chap_server.digest->code, + name, strlen(name)); + if (pcb->settings.chap_rechallenge_time) { + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, pcb, + pcb->settings.chap_rechallenge_time); + } + } + pcb->chap_server.flags |= AUTH_DONE; + } } /* @@ -409,23 +409,23 @@ static void chap_handle_response(ppp_pcb *pcb, int id, * succeeded), or 0 if it doesn't. */ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - int ok; - unsigned char secret[MAXSECRETLEN]; - int secret_len; - - /* Get the secret that the peer is supposed to know */ - if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { - ppp_error("No CHAP secret found for authenticating %q", name); - return 0; - } - ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, - response, message, message_space); - memset(secret, 0, sizeof(secret)); - - return ok; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + int ok; + unsigned char secret[MAXSECRETLEN]; + int secret_len; + + /* Get the secret that the peer is supposed to know */ + if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { + ppp_error("No CHAP secret found for authenticating %q", name); + return 0; + } + ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, + response, message, message_space); + memset(secret, 0, sizeof(secret)); + + return ok; } #endif /* PPP_SERVER */ @@ -433,153 +433,153 @@ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourn * chap_respond - Generate and send a response to a challenge. */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int clen, nlen; - int secret_len; - struct pbuf *p; - u_char *outp; - char rname[MAXNAMELEN+1]; - char secret[MAXSECRETLEN+1]; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) - return; /* not ready */ - if (len < 2 || len < pkt[0] + 1) - return; /* too short */ - clen = pkt[0]; - nlen = len - (clen + 1); - - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); + unsigned char *pkt, int len) { + int clen, nlen; + int secret_len; + struct pbuf *p; + u_char *outp; + char rname[MAXNAMELEN+1]; + char secret[MAXSECRETLEN+1]; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) + return; /* not ready */ + if (len < 2 || len < pkt[0] + 1) + return; /* too short */ + clen = pkt[0]; + nlen = len - (clen + 1); + + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); #if PPP_REMOTENAME - /* Microsoft doesn't send their name back in the PPP packet */ - if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) - strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); + /* Microsoft doesn't send their name back in the PPP packet */ + if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) + strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); #endif /* PPP_REMOTENAME */ - /* get secret for authenticating ourselves with the specified host */ - if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { - secret_len = 0; /* assume null secret if can't find one */ - ppp_warn("No CHAP secret found for authenticating us to %q", rname); - } - - outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_CHAP); - outp += CHAP_HDRLEN; - - pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, - secret, secret_len, pcb->chap_client.priv); - memset(secret, 0, secret_len); - - clen = *outp; - nlen = strlen(pcb->chap_client.name); - memcpy(outp + clen + 1, pcb->chap_client.name, nlen); - - outp = (u_char*)p->payload + PPP_HDRLEN; - len = CHAP_HDRLEN + clen + 1 + nlen; - outp[0] = CHAP_RESPONSE; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - - pbuf_realloc(p, PPP_HDRLEN + len); - ppp_write(pcb, p); + /* get secret for authenticating ourselves with the specified host */ + if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { + secret_len = 0; /* assume null secret if can't find one */ + ppp_warn("No CHAP secret found for authenticating us to %q", rname); + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_CHAP); + outp += CHAP_HDRLEN; + + pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, + secret, secret_len, pcb->chap_client.priv); + memset(secret, 0, secret_len); + + clen = *outp; + nlen = strlen(pcb->chap_client.name); + memcpy(outp + clen + 1, pcb->chap_client.name, nlen); + + outp = (u_char*)p->payload + PPP_HDRLEN; + len = CHAP_HDRLEN + clen + 1 + nlen; + outp[0] = CHAP_RESPONSE; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + + pbuf_realloc(p, PPP_HDRLEN + len); + ppp_write(pcb, p); } static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len) { - const char *msg = NULL; - LWIP_UNUSED_ARG(id); - - if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) - != (AUTH_STARTED|LOWERUP)) - return; - pcb->chap_client.flags |= AUTH_DONE; - - if (code == CHAP_SUCCESS) { - /* used for MS-CHAP v2 mutual auth, yuck */ - if (pcb->chap_client.digest->check_success != NULL) { - if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) - code = CHAP_FAILURE; - } else - msg = "CHAP authentication succeeded"; - } else { - if (pcb->chap_client.digest->handle_failure != NULL) - (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); - else - msg = "CHAP authentication failed"; - } - if (msg) { - if (len > 0) - ppp_info("%s: %.*v", msg, len, pkt); - else - ppp_info("%s", msg); - } - if (code == CHAP_SUCCESS) - auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); - else { - pcb->chap_client.flags |= AUTH_FAILED; - ppp_error("CHAP authentication failed"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + unsigned char *pkt, int len) { + const char *msg = NULL; + LWIP_UNUSED_ARG(id); + + if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) + != (AUTH_STARTED|LOWERUP)) + return; + pcb->chap_client.flags |= AUTH_DONE; + + if (code == CHAP_SUCCESS) { + /* used for MS-CHAP v2 mutual auth, yuck */ + if (pcb->chap_client.digest->check_success != NULL) { + if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) + code = CHAP_FAILURE; + } else + msg = "CHAP authentication succeeded"; + } else { + if (pcb->chap_client.digest->handle_failure != NULL) + (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); + else + msg = "CHAP authentication failed"; + } + if (msg) { + if (len > 0) + ppp_info("%s: %.*v", msg, len, pkt); + else + ppp_info("%s", msg); + } + if (code == CHAP_SUCCESS) + auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); + else { + pcb->chap_client.flags |= AUTH_FAILED; + ppp_error("CHAP authentication failed"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen) { - unsigned char code, id; - int len; - - if (pktlen < CHAP_HDRLEN) - return; - GETCHAR(code, pkt); - GETCHAR(id, pkt); - GETSHORT(len, pkt); - if (len < CHAP_HDRLEN || len > pktlen) - return; - len -= CHAP_HDRLEN; - - switch (code) { - case CHAP_CHALLENGE: - chap_respond(pcb, id, pkt, len); - break; + unsigned char code, id; + int len; + + if (pktlen < CHAP_HDRLEN) + return; + GETCHAR(code, pkt); + GETCHAR(id, pkt); + GETSHORT(len, pkt); + if (len < CHAP_HDRLEN || len > pktlen) + return; + len -= CHAP_HDRLEN; + + switch (code) { + case CHAP_CHALLENGE: + chap_respond(pcb, id, pkt, len); + break; #if PPP_SERVER - case CHAP_RESPONSE: - chap_handle_response(pcb, id, pkt, len); - break; + case CHAP_RESPONSE: + chap_handle_response(pcb, id, pkt, len); + break; #endif /* PPP_SERVER */ - case CHAP_FAILURE: - case CHAP_SUCCESS: - chap_handle_status(pcb, code, id, pkt, len); - break; - default: - break; - } + case CHAP_FAILURE: + case CHAP_SUCCESS: + chap_handle_status(pcb, code, id, pkt, len); + break; + default: + break; + } } static void chap_protrej(ppp_pcb *pcb) { #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } - if (pcb->chap_server.flags & AUTH_STARTED) { - pcb->chap_server.flags = 0; - auth_peer_fail(pcb, PPP_CHAP); - } + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } + if (pcb->chap_server.flags & AUTH_STARTED) { + pcb->chap_server.flags = 0; + auth_peer_fail(pcb, PPP_CHAP); + } #endif /* PPP_SERVER */ - if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { - pcb->chap_client.flags &= ~AUTH_STARTED; - ppp_error("CHAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { + pcb->chap_client.flags &= ~AUTH_STARTED; + ppp_error("CHAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } #if PRINTPKT_SUPPORT @@ -587,90 +587,90 @@ static void chap_protrej(ppp_pcb *pcb) { * chap_print_pkt - print the contents of a CHAP packet. */ static const char* const chap_code_names[] = { - "Challenge", "Response", "Success", "Failure" + "Challenge", "Response", "Success", "Failure" }; static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len; - int clen, nlen; - unsigned char x; - - if (plen < CHAP_HDRLEN) - return 0; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < CHAP_HDRLEN || len > plen) - return 0; - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) - printer(arg, " %s", chap_code_names[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= CHAP_HDRLEN; - switch (code) { - case CHAP_CHALLENGE: - case CHAP_RESPONSE: - if (len < 1) - break; - clen = p[0]; - if (len < clen + 1) - break; - ++p; - nlen = len - clen - 1; - printer(arg, " <"); - for (; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, "%.2x", x); - } - printer(arg, ">, name = "); - ppp_print_string(p, nlen, printer, arg); - break; - case CHAP_FAILURE: - case CHAP_SUCCESS: - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - break; - default: - for (clen = len; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, " %.2x", x); - } - /* no break */ - } - - return len + CHAP_HDRLEN; + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len; + int clen, nlen; + unsigned char x; + + if (plen < CHAP_HDRLEN) + return 0; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < CHAP_HDRLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) + printer(arg, " %s", chap_code_names[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= CHAP_HDRLEN; + switch (code) { + case CHAP_CHALLENGE: + case CHAP_RESPONSE: + if (len < 1) + break; + clen = p[0]; + if (len < clen + 1) + break; + ++p; + nlen = len - clen - 1; + printer(arg, " <"); + for (; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, "%.2x", x); + } + printer(arg, ">, name = "); + ppp_print_string(p, nlen, printer, arg); + break; + case CHAP_FAILURE: + case CHAP_SUCCESS: + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + break; + default: + for (clen = len; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, " %.2x", x); + } + /* no break */ + } + + return len + CHAP_HDRLEN; } #endif /* PRINTPKT_SUPPORT */ const struct protent chap_protent = { - PPP_CHAP, - chap_init, - chap_input, - chap_protrej, - chap_lowerup, - chap_lowerdown, - NULL, /* open */ - NULL, /* close */ + PPP_CHAP, + chap_init, + chap_input, + chap_protrej, + chap_lowerup, + chap_lowerdown, + NULL, /* open */ + NULL, /* close */ #if PRINTPKT_SUPPORT - chap_print_pkt, + chap_print_pkt, #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* datainput */ + NULL, /* datainput */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "CHAP", /* name */ - NULL, /* data_name */ + "CHAP", /* name */ + NULL, /* data_name */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - chap_option_list, - NULL, /* check_options */ + chap_option_list, + NULL, /* check_options */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, - NULL + NULL, + NULL #endif /* DEMAND_SUPPORT */ }; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c b/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c index 5a989c9b7e..b050aa1cd1 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c @@ -97,41 +97,41 @@ #include "netif/ppp/mppe.h" /* For mppe_sha1_pad*, mppe_set_key() */ #endif /* MPPE_SUPPORT */ -#define SHA1_SIGNATURE_SIZE 20 -#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ -#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ +#define SHA1_SIGNATURE_SIZE 20 +#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ +#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ -#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ -#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ -#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ - /* as ASCII */ +#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ +#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ +#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ + /* as ASCII */ /* Error codes for MS-CHAP failure messages. */ -#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 -#define MS_CHAP_ERROR_ACCT_DISABLED 647 -#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 -#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 -#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 -#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 +#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 +#define MS_CHAP_ERROR_ACCT_DISABLED 647 +#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 +#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 +#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 +#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 /* * Offsets within the response field for MS-CHAP */ -#define MS_CHAP_LANMANRESP 0 -#define MS_CHAP_LANMANRESP_LEN 24 -#define MS_CHAP_NTRESP 24 -#define MS_CHAP_NTRESP_LEN 24 -#define MS_CHAP_USENT 48 +#define MS_CHAP_LANMANRESP 0 +#define MS_CHAP_LANMANRESP_LEN 24 +#define MS_CHAP_NTRESP 24 +#define MS_CHAP_NTRESP_LEN 24 +#define MS_CHAP_USENT 48 /* * Offsets within the response field for MS-CHAP2 */ -#define MS_CHAP2_PEER_CHALLENGE 0 -#define MS_CHAP2_PEER_CHAL_LEN 16 -#define MS_CHAP2_RESERVED_LEN 8 -#define MS_CHAP2_NTRESP 24 -#define MS_CHAP2_NTRESP_LEN 24 -#define MS_CHAP2_FLAGS 48 +#define MS_CHAP2_PEER_CHALLENGE 0 +#define MS_CHAP2_PEER_CHAL_LEN 16 +#define MS_CHAP2_RESERVED_LEN 8 +#define MS_CHAP2_NTRESP 24 +#define MS_CHAP2_NTRESP_LEN 24 +#define MS_CHAP2_FLAGS 48 #if MPPE_SUPPORT #if 0 /* UNUSED */ @@ -150,37 +150,37 @@ extern void set_mppe_enc_types(int, int); #define MS_CHAP2_AUTHENTICATEE 0 #define MS_CHAP2_AUTHENTICATOR 1 -static void ascii2unicode (const char[], int, u_char[]); -static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); -static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); -static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); -static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); -static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, - u_char[24]); -static void GenerateAuthenticatorResponsePlain - (const char*, int, u_char[24], const u_char[16], const u_char *, - const char *, u_char[41]); +static void ascii2unicode (const char[], int, u_char[]); +static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); +static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); +static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); +static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); +static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, + u_char[24]); +static void GenerateAuthenticatorResponsePlain + (const char*, int, u_char[24], const u_char[16], const u_char *, + const char *, u_char[41]); #ifdef MSLANMAN -static void ChapMS_LANMan (u_char *, char *, int, u_char *); +static void ChapMS_LANMan (u_char *, char *, int, u_char *); #endif static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); #if MPPE_SUPPORT -static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); -static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); +static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); +static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); #endif /* MPPE_SUPPORT */ static void ChapMS (ppp_pcb *pcb, const u_char *, const char *, int, u_char *); static void ChapMS2 (ppp_pcb *pcb, const u_char *, const u_char *, const char *, const char *, int, - u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); + u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); #ifdef MSLANMAN -bool ms_lanman = 0; /* Use LanMan password instead of NT */ - /* Has meaning only with MS-CHAP challenges */ +bool ms_lanman = 0; /* Use LanMan password instead of NT */ + /* Has meaning only with MS-CHAP challenges */ #endif #if MPPE_SUPPORT @@ -192,7 +192,7 @@ static char *mschap_challenge = NULL; static char *mschap2_peer_challenge = NULL; #endif -#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ +#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ #include "netif/ppp/ccp.h" #endif /* MPPE_SUPPORT */ @@ -202,16 +202,16 @@ static char *mschap2_peer_challenge = NULL; */ static option_t chapms_option_list[] = { #ifdef MSLANMAN - { "ms-lanman", o_bool, &ms_lanman, - "Use LanMan passwd when using MS-CHAP", 1 }, + { "ms-lanman", o_bool, &ms_lanman, + "Use LanMan passwd when using MS-CHAP", 1 }, #endif #ifdef DEBUGMPPEKEY - { "mschap-challenge", o_string, &mschap_challenge, - "specify CHAP challenge" }, - { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, - "specify CHAP peer challenge" }, + { "mschap-challenge", o_string, &mschap_challenge, + "specify CHAP challenge" }, + { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, + "specify CHAP peer challenge" }, #endif - { NULL } + { NULL } }; #endif /* PPP_OPTIONS */ @@ -223,279 +223,279 @@ static option_t chapms_option_list[] = { * at challenge[1]. */ static void chapms_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 8; + *challenge++ = 8; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 8) - memcpy(challenge, mschap_challenge, 8); - else + if (mschap_challenge && strlen(mschap_challenge) == 8) + memcpy(challenge, mschap_challenge, 8); + else #endif - magic_random_bytes(challenge, 8); + magic_random_bytes(challenge, 8); } static void chapms2_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 16; + *challenge++ = 16; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 16) - memcpy(challenge, mschap_challenge, 16); - else + if (mschap_challenge && strlen(mschap_challenge) == 16) + memcpy(challenge, mschap_challenge, 16); + else #endif - magic_random_bytes(challenge, 16); + magic_random_bytes(challenge, 16); } static int chapms_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP_RESPONSE_LEN]; - int diff; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(name); - - challenge_len = *challenge++; /* skip length, is 8 */ - response_len = *response++; - if (response_len != MS_CHAP_RESPONSE_LEN) - goto bad; + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP_RESPONSE_LEN]; + int diff; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(name); + + challenge_len = *challenge++; /* skip length, is 8 */ + response_len = *response++; + if (response_len != MS_CHAP_RESPONSE_LEN) + goto bad; #ifndef MSLANMAN - if (!response[MS_CHAP_USENT]) { - /* Should really propagate this into the error packet. */ - ppp_notice("Peer request for LANMAN auth not supported"); - goto bad; - } + if (!response[MS_CHAP_USENT]) { + /* Should really propagate this into the error packet. */ + ppp_notice("Peer request for LANMAN auth not supported"); + goto bad; + } #endif - /* Generate the expected response. */ - ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); + /* Generate the expected response. */ + ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); #ifdef MSLANMAN - /* Determine which part of response to verify against */ - if (!response[MS_CHAP_USENT]) - diff = memcmp(&response[MS_CHAP_LANMANRESP], - &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); - else + /* Determine which part of response to verify against */ + if (!response[MS_CHAP_USENT]) + diff = memcmp(&response[MS_CHAP_LANMANRESP], + &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); + else #endif - diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], - MS_CHAP_NTRESP_LEN); + diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], + MS_CHAP_NTRESP_LEN); - if (diff == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } + if (diff == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } bad: - /* See comments below for MS-CHAP V2 */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", - challenge_len, challenge); - return 0; + /* See comments below for MS-CHAP V2 */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", + challenge_len, challenge); + return 0; } static int chapms2_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP2_RESPONSE_LEN]; - char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - - challenge_len = *challenge++; /* skip length, is 16 */ - response_len = *response++; - if (response_len != MS_CHAP2_RESPONSE_LEN) - goto bad; /* not even the right length */ - - /* Generate the expected response and our mutual auth. */ - ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, - (const char *)secret, secret_len, md, - (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); - - /* compare MDs and send the appropriate status */ - /* - * Per RFC 2759, success message must be formatted as - * "S= M=" - * where - * is the Authenticator Response (mutual auth) - * is a text message - * - * However, some versions of Windows (win98 tested) do not know - * about the M= part (required per RFC 2759) and flag - * it as an error (reported incorrectly as an encryption error - * to the user). Since the RFC requires it, and it can be - * useful information, we supply it if the peer is a conforming - * system. Luckily (?), win98 sets the Flags field to 0x04 - * (contrary to RFC requirements) so we can use that to - * distinguish between conforming and non-conforming systems. - * - * Special thanks to Alex Swiridov for - * help debugging this. - */ - if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], - MS_CHAP2_NTRESP_LEN) == 0) { - if (response[MS_CHAP2_FLAGS]) - ppp_slprintf(message, message_space, "S=%s", saresponse); - else - ppp_slprintf(message, message_space, "S=%s M=%s", - saresponse, "Access granted"); - return 1; - } + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP2_RESPONSE_LEN]; + char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + + challenge_len = *challenge++; /* skip length, is 16 */ + response_len = *response++; + if (response_len != MS_CHAP2_RESPONSE_LEN) + goto bad; /* not even the right length */ + + /* Generate the expected response and our mutual auth. */ + ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, + (const char *)secret, secret_len, md, + (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); + + /* compare MDs and send the appropriate status */ + /* + * Per RFC 2759, success message must be formatted as + * "S= M=" + * where + * is the Authenticator Response (mutual auth) + * is a text message + * + * However, some versions of Windows (win98 tested) do not know + * about the M= part (required per RFC 2759) and flag + * it as an error (reported incorrectly as an encryption error + * to the user). Since the RFC requires it, and it can be + * useful information, we supply it if the peer is a conforming + * system. Luckily (?), win98 sets the Flags field to 0x04 + * (contrary to RFC requirements) so we can use that to + * distinguish between conforming and non-conforming systems. + * + * Special thanks to Alex Swiridov for + * help debugging this. + */ + if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], + MS_CHAP2_NTRESP_LEN) == 0) { + if (response[MS_CHAP2_FLAGS]) + ppp_slprintf(message, message_space, "S=%s", saresponse); + else + ppp_slprintf(message, message_space, "S=%s M=%s", + saresponse, "Access granted"); + return 1; + } bad: - /* - * Failure message must be formatted as - * "E=e R=r C=c V=v M=m" - * where - * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) - * r = retry (we use 1, ok to retry) - * c = challenge to use for next response, we reuse previous - * v = Change Password version supported, we use 0 - * m = text message - * - * The M=m part is only for MS-CHAPv2. Neither win2k nor - * win98 (others untested) display the message to the user anyway. - * They also both ignore the E=e code. - * - * Note that it's safe to reuse the same challenge as we don't - * actually accept another response based on the error message - * (and no clients try to resend a response anyway). - * - * Basically, this whole bit is useless code, even the small - * implementation here is only because of overspecification. - */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", - challenge_len, challenge, "Access denied"); - return 0; + /* + * Failure message must be formatted as + * "E=e R=r C=c V=v M=m" + * where + * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) + * r = retry (we use 1, ok to retry) + * c = challenge to use for next response, we reuse previous + * v = Change Password version supported, we use 0 + * m = text message + * + * The M=m part is only for MS-CHAPv2. Neither win2k nor + * win98 (others untested) display the message to the user anyway. + * They also both ignore the E=e code. + * + * Note that it's safe to reuse the same challenge as we don't + * actually accept another response based on the error message + * (and no clients try to resend a response anyway). + * + * Basically, this whole bit is useless code, even the small + * implementation here is only because of overspecification. + */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", + challenge_len, challenge, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chapms_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - challenge++; /* skip length, should be 8 */ - *response++ = MS_CHAP_RESPONSE_LEN; - ChapMS(pcb, challenge, secret, secret_len, response); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + challenge++; /* skip length, should be 8 */ + *response++ = MS_CHAP_RESPONSE_LEN; + ChapMS(pcb, challenge, secret, secret_len, response); } static void chapms2_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - challenge++; /* skip length, should be 16 */ - *response++ = MS_CHAP2_RESPONSE_LEN; - ChapMS2(pcb, challenge, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + challenge++; /* skip length, should be 16 */ + *response++ = MS_CHAP2_RESPONSE_LEN; + ChapMS2(pcb, challenge, #ifdef DEBUGMPPEKEY - mschap2_peer_challenge, + mschap2_peer_challenge, #else - NULL, + NULL, #endif - our_name, secret, secret_len, response, private_, - MS_CHAP2_AUTHENTICATEE); + our_name, secret, secret_len, response, private_, + MS_CHAP2_AUTHENTICATEE); } static int chapms2_check_success(ppp_pcb *pcb, unsigned char *msg, int len, unsigned char *private_) { - LWIP_UNUSED_ARG(pcb); - - if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || - strncmp((char *)msg, "S=", 2) != 0) { - /* Packet does not start with "S=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - msg += 2; - len -= 2; - if (len < MS_AUTH_RESPONSE_LENGTH - || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { - /* Authenticator Response did not match expected. */ - ppp_error("MS-CHAPv2 mutual authentication failed."); - return 0; - } - /* Authenticator Response matches. */ - msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ - len -= MS_AUTH_RESPONSE_LENGTH; - if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { - msg += 3; /* Eat the delimiter */ - } else if (len) { - /* Packet has extra text which does not begin " M=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - return 1; + LWIP_UNUSED_ARG(pcb); + + if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || + strncmp((char *)msg, "S=", 2) != 0) { + /* Packet does not start with "S=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + msg += 2; + len -= 2; + if (len < MS_AUTH_RESPONSE_LENGTH + || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { + /* Authenticator Response did not match expected. */ + ppp_error("MS-CHAPv2 mutual authentication failed."); + return 0; + } + /* Authenticator Response matches. */ + msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ + len -= MS_AUTH_RESPONSE_LENGTH; + if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { + msg += 3; /* Eat the delimiter */ + } else if (len) { + /* Packet has extra text which does not begin " M=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + return 1; } static void chapms_handle_failure(ppp_pcb *pcb, unsigned char *inp, int len) { - int err; - const char *p; - char msg[64]; - LWIP_UNUSED_ARG(pcb); - - /* We want a null-terminated string for strxxx(). */ - len = LWIP_MIN(len, 63); - MEMCPY(msg, inp, len); - msg[len] = 0; - p = msg; - - /* - * Deal with MS-CHAP formatted failure messages; just print the - * M= part (if any). For MS-CHAP we're not really supposed - * to use M=, but it shouldn't hurt. See - * chapms[2]_verify_response. - */ - if (!strncmp(p, "E=", 2)) - err = strtol(p+2, NULL, 10); /* Remember the error code. */ - else - goto print_msg; /* Message is badly formatted. */ - - if (len && ((p = strstr(p, " M=")) != NULL)) { - /* M= field found. */ - p += 3; - } else { - /* No M=; use the error code. */ - switch (err) { - case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: - p = "E=646 Restricted logon hours"; - break; - - case MS_CHAP_ERROR_ACCT_DISABLED: - p = "E=647 Account disabled"; - break; - - case MS_CHAP_ERROR_PASSWD_EXPIRED: - p = "E=648 Password expired"; - break; - - case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: - p = "E=649 No dialin permission"; - break; - - case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: - p = "E=691 Authentication failure"; - break; - - case MS_CHAP_ERROR_CHANGING_PASSWORD: - /* Should never see this, we don't support Change Password. */ - p = "E=709 Error changing password"; - break; - - default: - ppp_error("Unknown MS-CHAP authentication failure: %.*v", - len, inp); - return; - } - } + int err; + const char *p; + char msg[64]; + LWIP_UNUSED_ARG(pcb); + + /* We want a null-terminated string for strxxx(). */ + len = LWIP_MIN(len, 63); + MEMCPY(msg, inp, len); + msg[len] = 0; + p = msg; + + /* + * Deal with MS-CHAP formatted failure messages; just print the + * M= part (if any). For MS-CHAP we're not really supposed + * to use M=, but it shouldn't hurt. See + * chapms[2]_verify_response. + */ + if (!strncmp(p, "E=", 2)) + err = strtol(p+2, NULL, 10); /* Remember the error code. */ + else + goto print_msg; /* Message is badly formatted. */ + + if (len && ((p = strstr(p, " M=")) != NULL)) { + /* M= field found. */ + p += 3; + } else { + /* No M=; use the error code. */ + switch (err) { + case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: + p = "E=646 Restricted logon hours"; + break; + + case MS_CHAP_ERROR_ACCT_DISABLED: + p = "E=647 Account disabled"; + break; + + case MS_CHAP_ERROR_PASSWD_EXPIRED: + p = "E=648 Password expired"; + break; + + case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: + p = "E=649 No dialin permission"; + break; + + case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: + p = "E=691 Authentication failure"; + break; + + case MS_CHAP_ERROR_CHANGING_PASSWORD: + /* Should never see this, we don't support Change Password. */ + p = "E=709 Error changing password"; + break; + + default: + ppp_error("Unknown MS-CHAP authentication failure: %.*v", + len, inp); + return; + } + } print_msg: - if (p != NULL) - ppp_error("MS-CHAP authentication failed: %v", p); + if (p != NULL) + ppp_error("MS-CHAP authentication failed: %v", p); } static void ChallengeResponse(const u_char *challenge, - const u_char PasswordHash[MD4_SIGNATURE_SIZE], - u_char response[24]) { + const u_char PasswordHash[MD4_SIGNATURE_SIZE], + u_char response[24]) { u_char ZPasswordHash[21]; lwip_des_context des; u_char des_key[8]; @@ -505,7 +505,7 @@ static void ChallengeResponse(const u_char *challenge, #if 0 dbglog("ChallengeResponse - ZPasswordHash %.*B", - sizeof(ZPasswordHash), ZPasswordHash); + sizeof(ZPasswordHash), ZPasswordHash); #endif pppcrypt_56_to_64_bit_key(ZPasswordHash + 0, des_key); @@ -532,16 +532,16 @@ static void ChallengeResponse(const u_char *challenge, } static void ChallengeHash(const u_char PeerChallenge[16], const u_char *rchallenge, - const char *username, u_char Challenge[8]) { - lwip_sha1_context sha1Context; - u_char sha1Hash[SHA1_SIGNATURE_SIZE]; - const char *user; + const char *username, u_char Challenge[8]) { + lwip_sha1_context sha1Context; + u_char sha1Hash[SHA1_SIGNATURE_SIZE]; + const char *user; /* remove domain from "domain\username" */ if ((user = strrchr(username, '\\')) != NULL) - ++user; + ++user; else - user = username; + user = username; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -566,11 +566,11 @@ static void ascii2unicode(const char ascii[], int ascii_len, u_char unicode[]) { BZERO(unicode, ascii_len * 2); for (i = 0; i < ascii_len; i++) - unicode[i * 2] = (u_char) ascii[i]; + unicode[i * 2] = (u_char) ascii[i]; } static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE]) { - lwip_md4_context md4Context; + lwip_md4_context md4Context; lwip_md4_init(&md4Context); lwip_md4_starts(&md4Context); @@ -580,9 +580,9 @@ static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNA } static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_len, - u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; /* Hash the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -592,10 +592,10 @@ static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_l } static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], const char *username, - const char *secret, int secret_len, u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char Challenge[8]; + const char *secret, int secret_len, u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char Challenge[8]; ChallengeHash(PeerChallenge, rchallenge, username, Challenge); @@ -610,10 +610,10 @@ static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, - unsigned char *response) { - int i; - u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + unsigned char *response) { + int i; + u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ + u_char PasswordHash[MD4_SIGNATURE_SIZE]; lwip_des_context des; u_char des_key[8]; @@ -640,28 +640,28 @@ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { /* * "Magic" constants used in response generation, from RFC 2759. */ static const u_char Magic1[39] = /* "Magic server to client signing constant" */ - { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, - 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, - 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; + { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, + 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, + 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; static const u_char Magic2[41] = /* "Pad to make it do more than one iteration" */ - { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, - 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, - 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, - 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, - 0x6E }; + { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, + 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, + 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, + 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, + 0x6E }; - int i; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; - u_char Challenge[8]; + int i; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; + u_char Challenge[8]; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -683,27 +683,27 @@ static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGN /* Convert to ASCII hex string. */ for (i = 0; i < LWIP_MAX((MS_AUTH_RESPONSE_LENGTH / 2), (int)sizeof(Digest)); i++) - sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); + sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); } static void GenerateAuthenticatorResponsePlain( - const char *secret, int secret_len, - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + const char *secret, int secret_len, + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); NTPasswordHash(PasswordHash, sizeof(PasswordHash), - PasswordHashHash); + PasswordHashHash); GenerateAuthenticatorResponse(PasswordHashHash, NTResponse, PeerChallenge, - rchallenge, username, authResponse); + rchallenge, username, authResponse); } @@ -712,11 +712,11 @@ static void GenerateAuthenticatorResponsePlain( * Set mppe_xxxx_key from MS-CHAP credentials. (see RFC 3079) */ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, int secret_len) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -742,43 +742,43 @@ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *se * Set mppe_xxxx_key from MS-CHAPv2 credentials. (see RFC 3079) */ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_char NTResponse[24], int IsServer) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ const u_char *s; /* "This is the MPPE Master Key" */ static const u_char Magic1[27] = - { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; + { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; /* "On the client side, this is the send key; " "on the server side, it is the receive key." */ static const u_char Magic2[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, - 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, - 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, + 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, + 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* "On the client side, this is the receive key; " "on the server side, it is the send key." */ static const u_char Magic3[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, - 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, + 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -797,9 +797,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate send key */ if (IsServer) - s = Magic3; + s = Magic3; else - s = Magic2; + s = Magic2; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -815,9 +815,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate recv key */ if (IsServer) - s = Magic2; + s = Magic2; else - s = Magic3; + s = Magic3; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -846,7 +846,7 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i #ifdef MSLANMAN ChapMS_LANMan(rchallenge, secret, secret_len, - &response[MS_CHAP_LANMANRESP]); + &response[MS_CHAP_LANMANRESP]); /* preferred method is set by option */ response[MS_CHAP_USENT] = !ms_lanman; @@ -871,8 +871,8 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i * Authenticator Response. */ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerChallenge, - const char *user, const char *secret, int secret_len, unsigned char *response, - u_char authResponse[], int authenticator) { + const char *user, const char *secret, int secret_len, unsigned char *response, + u_char authResponse[], int authenticator) { /* ARGSUSED */ LWIP_UNUSED_ARG(authenticator); #if !MPPE_SUPPORT @@ -883,24 +883,24 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh /* Generate the Peer-Challenge if requested, or copy it if supplied. */ if (!PeerChallenge) - magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); + magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); else - MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, - MS_CHAP2_PEER_CHAL_LEN); + MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, + MS_CHAP2_PEER_CHAL_LEN); /* Generate the NT-Response */ ChapMS2_NT(rchallenge, &response[MS_CHAP2_PEER_CHALLENGE], user, - secret, secret_len, &response[MS_CHAP2_NTRESP]); + secret, secret_len, &response[MS_CHAP2_NTRESP]); /* Generate the Authenticator Response. */ GenerateAuthenticatorResponsePlain(secret, secret_len, - &response[MS_CHAP2_NTRESP], - &response[MS_CHAP2_PEER_CHALLENGE], - rchallenge, user, authResponse); + &response[MS_CHAP2_NTRESP], + &response[MS_CHAP2_PEER_CHALLENGE], + rchallenge, user, authResponse); #if MPPE_SUPPORT SetMasterKeys(pcb, secret, secret_len, - &response[MS_CHAP2_NTRESP], authenticator); + &response[MS_CHAP2_NTRESP], authenticator); #endif /* MPPE_SUPPORT */ } @@ -912,51 +912,51 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh void set_mppe_enc_types(int policy, int types) { /* Early exit for unknown policies. */ if (policy != MPPE_ENC_POL_ENC_ALLOWED || - policy != MPPE_ENC_POL_ENC_REQUIRED) - return; + policy != MPPE_ENC_POL_ENC_REQUIRED) + return; /* Don't modify MPPE if it's optional and wasn't already configured. */ if (policy == MPPE_ENC_POL_ENC_ALLOWED && !ccp_wantoptions[0].mppe) - return; + return; /* * Disable undesirable encryption types. Note that we don't ENABLE * any encryption types, to avoid overriding manual configuration. */ switch(types) { - case MPPE_ENC_TYPES_RC4_40: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ - break; - case MPPE_ENC_TYPES_RC4_128: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ - break; - default: - break; + case MPPE_ENC_TYPES_RC4_40: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ + break; + case MPPE_ENC_TYPES_RC4_128: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ + break; + default: + break; } } #endif /* MPPE_SUPPORT */ #endif /* UNUSED */ const struct chap_digest_type chapms_digest = { - CHAP_MICROSOFT, /* code */ + CHAP_MICROSOFT, /* code */ #if PPP_SERVER - chapms_generate_challenge, - chapms_verify_response, + chapms_generate_challenge, + chapms_verify_response, #endif /* PPP_SERVER */ - chapms_make_response, - NULL, /* check_success */ - chapms_handle_failure, + chapms_make_response, + NULL, /* check_success */ + chapms_handle_failure, }; const struct chap_digest_type chapms2_digest = { - CHAP_MICROSOFT_V2, /* code */ + CHAP_MICROSOFT_V2, /* code */ #if PPP_SERVER - chapms2_generate_challenge, - chapms2_verify_response, + chapms2_generate_challenge, + chapms2_verify_response, #endif /* PPP_SERVER */ - chapms2_make_response, - chapms2_check_success, - chapms_handle_failure, + chapms2_make_response, + chapms2_check_success, + chapms_handle_failure, }; #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/demand.c b/components/net/lwip-2.0.2/src/netif/ppp/demand.c index 26c6c30db1..f3774e087c 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/demand.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/demand.c @@ -87,11 +87,11 @@ demand_conf() /* framemax = lcp_allowoptions[0].mru; if (framemax < PPP_MRU) */ - framemax = PPP_MRU; + framemax = PPP_MRU; framemax += PPP_HDRLEN + PPP_FCSLEN; frame = malloc(framemax); if (frame == NULL) - novm("demand frame"); + novm("demand frame"); framelen = 0; pend_q = NULL; escape_flag = 0; @@ -100,8 +100,8 @@ demand_conf() netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) - fatal("Couldn't set up demand-dialled PPP interface: %m"); + || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) + fatal("Couldn't set up demand-dialled PPP interface: %m"); #ifdef PPP_FILTER set_filters(&pass_filter, &active_filter); @@ -111,12 +111,12 @@ demand_conf() * Call the demand_conf procedure for each protocol that's got one. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - ((*protp->demand_conf)(pcb)); + if (protp->demand_conf != NULL) + ((*protp->demand_conf)(pcb)); /* FIXME: find a way to die() here */ #if 0 - if (!((*protp->demand_conf)(pcb))) - die(1); + if (!((*protp->demand_conf)(pcb))) + die(1); #endif } @@ -131,8 +131,8 @@ demand_block() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); get_loop_output(); } @@ -148,14 +148,14 @@ demand_discard() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); get_loop_output(); /* discard all saved packets */ for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - free(pkt); + nextpkt = pkt->next; + free(pkt); } pend_q = NULL; framelen = 0; @@ -174,46 +174,46 @@ demand_unblock() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); } /* * FCS lookup table as calculated by genfcstab. */ static u_short fcstab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /* @@ -238,35 +238,35 @@ loop_chars(p, n) } for (; n > 0; --n) { - c = *p++; - if (c == PPP_FLAG) { - if (!escape_flag && !flush_flag - && framelen > 2 && fcs == PPP_GOODFCS) { - framelen -= 2; - if (loop_frame((unsigned char *)frame, framelen)) - rv = 1; - } - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; - continue; - } - if (flush_flag) - continue; - if (escape_flag) { - c ^= PPP_TRANS; - escape_flag = 0; - } else if (c == PPP_ESCAPE) { - escape_flag = 1; - continue; - } - if (framelen >= framemax) { - flush_flag = 1; - continue; - } - frame[framelen++] = c; - fcs = PPP_FCS(fcs, c); + c = *p++; + if (c == PPP_FLAG) { + if (!escape_flag && !flush_flag + && framelen > 2 && fcs == PPP_GOODFCS) { + framelen -= 2; + if (loop_frame((unsigned char *)frame, framelen)) + rv = 1; + } + framelen = 0; + flush_flag = 0; + escape_flag = 0; + fcs = PPP_INITFCS; + continue; + } + if (flush_flag) + continue; + if (escape_flag) { + c ^= PPP_TRANS; + escape_flag = 0; + } else if (c == PPP_ESCAPE) { + escape_flag = 1; + continue; + } + if (framelen >= framemax) { + flush_flag = 1; + continue; + } + frame[framelen++] = c; + fcs = PPP_FCS(fcs, c); } return rv; } @@ -290,22 +290,22 @@ loop_frame(frame, len) /* dbglog("from loop: %P", frame, len); */ if (len < PPP_HDRLEN) - return 0; + return 0; if ((PPP_PROTOCOL(frame) & 0x8000) != 0) - return 0; /* shouldn't get any of these anyway */ + return 0; /* shouldn't get any of these anyway */ if (!active_packet(frame, len)) - return 0; + return 0; pkt = (struct packet *) malloc(sizeof(struct packet) + len); if (pkt != NULL) { - pkt->length = len; - pkt->next = NULL; - memcpy(pkt->data, frame, len); - if (pend_q == NULL) - pend_q = pkt; - else - pend_qtail->next = pkt; - pend_qtail = pkt; + pkt->length = len; + pkt->next = NULL; + memcpy(pkt->data, frame, len); + if (pend_q == NULL) + pend_q = pkt; + else + pend_qtail->next = pkt; + pend_qtail = pkt; } return 1; } @@ -332,23 +332,23 @@ demand_rexmit(proto, newip) pend_q = NULL; tv.tv_sec = 1; tv.tv_usec = 0; - select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ + select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ for (; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - if (PPP_PROTOCOL(pkt->data) == proto) { + nextpkt = pkt->next; + if (PPP_PROTOCOL(pkt->data) == proto) { if ( (proto == PPP_IP) && newip ) { - /* Get old checksum */ + /* Get old checksum */ - iphdr = (pkt->data[4] & 15) << 2; - checksum = *((unsigned short *) (pkt->data+14)); + iphdr = (pkt->data[4] & 15) << 2; + checksum = *((unsigned short *) (pkt->data+14)); if (checksum == 0xFFFF) { checksum = 0; } - + if (pkt->data[13] == 17) { pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr)); - if (pkt_checksum) { + if (pkt_checksum) { cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; @@ -359,71 +359,71 @@ demand_rexmit(proto, newip) } } - if (pkt->data[13] == 6) { - pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); - cv = 1; + if (pkt->data[13] == 6) { + pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); + cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; } - } + } - /* Delete old Source-IP-Address */ + /* Delete old Source-IP-Address */ checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Change Source-IP-Address */ + /* Change Source-IP-Address */ * ((u32_t *) (pkt->data + 16)) = newip; - /* Add new Source-IP-Address */ + /* Add new Source-IP-Address */ checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Write new checksum */ + /* Write new checksum */ if (!checksum) { checksum = 0xFFFF; } *((unsigned short *) (pkt->data+14)) = checksum; - if (pkt->data[13] == 6) { - *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; - } - if (cv && (pkt->data[13] == 17) ) { - *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; - } - - /* Log Packet */ - strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); - if (pkt->data[13] == 1) { - syslog(LOG_INFO,"Open ICMP %s -> %s\n", - ipstr, - inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); - } else { - syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", - pkt->data[13] == 6 ? "TCP" : "UDP", - ipstr, - ntohs(*( (short *) (pkt->data+iphdr+4))), - inet_ntoa(*( (struct in_addr *) (pkt->data+20))), - ntohs(*( (short *) (pkt->data+iphdr+6)))); + if (pkt->data[13] == 6) { + *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; + } + if (cv && (pkt->data[13] == 17) ) { + *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; + } + + /* Log Packet */ + strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); + if (pkt->data[13] == 1) { + syslog(LOG_INFO,"Open ICMP %s -> %s\n", + ipstr, + inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); + } else { + syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", + pkt->data[13] == 6 ? "TCP" : "UDP", + ipstr, + ntohs(*( (short *) (pkt->data+iphdr+4))), + inet_ntoa(*( (struct in_addr *) (pkt->data+20))), + ntohs(*( (short *) (pkt->data+iphdr+6)))); } } - output(pcb, pkt->data, pkt->length); - free(pkt); - } else { - if (prev == NULL) - pend_q = pkt; - else - prev->next = pkt; - prev = pkt; - } + output(pcb, pkt->data, pkt->length); + free(pkt); + } else { + if (prev == NULL) + pend_q = pkt; + else + prev->next = pkt; + prev = pkt; + } } pend_qtail = prev; if (prev != NULL) - prev->next = NULL; + prev->next = NULL; } /* @@ -439,27 +439,27 @@ active_packet(p, len) const struct protent *protp; if (len < PPP_HDRLEN) - return 0; + return 0; proto = PPP_PROTOCOL(p); #ifdef PPP_FILTER - p[0] = 1; /* outbound packet indicator */ + p[0] = 1; /* outbound packet indicator */ if ((pass_filter.bf_len != 0 - && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) - || (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { - p[0] = 0xff; - return 0; + && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) + || (active_filter.bf_len != 0 + && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { + p[0] = 0xff; + return 0; } p[0] = 0xff; #endif for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (protp->active_pkt == NULL) - return 1; - return (*protp->active_pkt)(p, len); - } + if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { + if (protp->active_pkt == NULL) + return 1; + return (*protp->active_pkt)(p, len); + } } - return 0; /* not a supported protocol !!?? */ + return 0; /* not a supported protocol !!?? */ } #endif /* PPP_SUPPORT && DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/eap.c b/components/net/lwip-2.0.2/src/netif/ppp/eap.c index 8fb56368e7..8ca53d2a0d 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/eap.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/eap.c @@ -58,11 +58,11 @@ #endif /* USE_SRP */ #ifndef SHA_DIGESTSIZE -#define SHA_DIGESTSIZE 20 +#define SHA_DIGESTSIZE 20 #endif #ifdef USE_SRP -static char *pn_secret = NULL; /* Pseudonym generating secret */ +static char *pn_secret = NULL; /* Pseudonym generating secret */ #endif #if PPP_OPTIONS @@ -106,31 +106,31 @@ static int eap_printpkt(const u_char *inp, int inlen, #endif /* PRINTPKT_SUPPORT */ const struct protent eap_protent = { - PPP_EAP, /* protocol number */ - eap_init, /* initialization procedure */ - eap_input, /* process a received packet */ - eap_protrej, /* process a received protocol-reject */ - eap_lowerup, /* lower layer has gone up */ - eap_lowerdown, /* lower layer has gone down */ - NULL, /* open the protocol */ - NULL, /* close the protocol */ + PPP_EAP, /* protocol number */ + eap_init, /* initialization procedure */ + eap_input, /* process a received packet */ + eap_protrej, /* process a received protocol-reject */ + eap_lowerup, /* lower layer has gone up */ + eap_lowerdown, /* lower layer has gone down */ + NULL, /* open the protocol */ + NULL, /* close the protocol */ #if PRINTPKT_SUPPORT - eap_printpkt, /* print a packet in readable form */ + eap_printpkt, /* print a packet in readable form */ #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* process a received data packet */ + NULL, /* process a received data packet */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "EAP", /* text name of protocol */ - NULL, /* text name of corresponding data protocol */ + "EAP", /* text name of protocol */ + NULL, /* text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - eap_option_list, /* list of command-line options */ - NULL, /* check requested options; assign defaults */ + eap_option_list, /* list of command-line options */ + NULL, /* check requested options; assign defaults */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, /* configure interface for demand-dial */ - NULL /* say whether to bring up link for this pkt */ + NULL, /* configure interface for demand-dial */ + NULL /* say whether to bring up link for this pkt */ #endif /* DEMAND_SUPPORT */ }; @@ -139,38 +139,38 @@ const struct protent eap_protent = { * A well-known 2048 bit modulus. */ static const u_char wkmodulus[] = { - 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, - 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, - 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, - 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, - 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, - 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, - 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, - 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, - 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, - 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, - 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, - 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, - 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, - 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, - 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, - 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, - 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, - 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, - 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, - 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, - 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, - 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, - 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, - 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, - 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, - 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, - 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, - 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, - 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, - 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, - 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, - 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 + 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, + 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, + 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, + 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, + 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, + 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, + 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, + 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, + 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, + 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, + 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, + 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, + 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, + 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, + 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, + 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, + 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, + 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, + 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, + 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, + 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, + 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, + 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, + 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, + 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, + 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, + 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, + 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, + 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, + 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, + 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, + 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 }; #endif @@ -184,9 +184,9 @@ static void eap_server_timeout(void *arg); */ static const char * eap_state_name(enum eap_state_code esc) { - static const char *state_names[] = { EAP_STATES }; + static const char *state_names[] = { EAP_STATES }; - return (state_names[(int)esc]); + return (state_names[(int)esc]); } /* @@ -195,9 +195,9 @@ static const char * eap_state_name(enum eap_state_code esc) */ static void eap_init(ppp_pcb *pcb) { - BZERO(&pcb->eap, sizeof(eap_state)); + BZERO(&pcb->eap, sizeof(eap_state)); #if PPP_SERVER - pcb->eap.es_server.ea_id = magic(); + pcb->eap.es_server.ea_id = magic(); #endif /* PPP_SERVER */ } @@ -206,14 +206,14 @@ static void eap_init(ppp_pcb *pcb) { * Request messages. */ static void eap_client_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_client_active(pcb)) - return; + if (!eap_client_active(pcb)) + return; - ppp_error("EAP: timeout waiting for Request from peer"); - auth_withpeer_fail(pcb, PPP_EAP); - pcb->eap.es_client.ea_state = eapBadAuth; + ppp_error("EAP: timeout waiting for Request from peer"); + auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; } /* @@ -224,22 +224,22 @@ static void eap_client_timeout(void *arg) { */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { - if(NULL == localname) - return; + if(NULL == localname) + return; - /* Save the peer name we're given */ - pcb->eap.es_client.ea_name = localname; - pcb->eap.es_client.ea_namelen = strlen(localname); + /* Save the peer name we're given */ + pcb->eap.es_client.ea_name = localname; + pcb->eap.es_client.ea_namelen = strlen(localname); - pcb->eap.es_client.ea_state = eapListen; + pcb->eap.es_client.ea_state = eapListen; - /* - * Start a timer so that if the other end just goes - * silent, we don't sit here waiting forever. - */ - if (pcb->settings.eap_req_time > 0) - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); + /* + * Start a timer so that if the other end just goes + * silent, we don't sit here waiting forever. + */ + if (pcb->settings.eap_req_time > 0) + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); } #if PPP_SERVER @@ -248,30 +248,30 @@ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { * (Server operation) */ static void eap_send_failure(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; + struct pbuf *p; + u_char *outp; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } - outp = (u_char*)p->payload; + outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_EAP); + MAKEHEADER(outp, PPP_EAP); - PUTCHAR(EAP_FAILURE, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); + PUTCHAR(EAP_FAILURE, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); - ppp_write(pcb, p); + ppp_write(pcb, p); - pcb->eap.es_server.ea_state = eapBadAuth; - auth_peer_fail(pcb, PPP_EAP); + pcb->eap.es_server.ea_state = eapBadAuth; + auth_peer_fail(pcb, PPP_EAP); } /* @@ -279,30 +279,30 @@ static void eap_send_failure(ppp_pcb *pcb) { * (Server operation) */ static void eap_send_success(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_SUCCESS, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); - - ppp_write(pcb, p); - - auth_peer_success(pcb, PPP_EAP, 0, - pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); + struct pbuf *p; + u_char *outp; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_SUCCESS, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); + + ppp_write(pcb, p); + + auth_peer_success(pcb, PPP_EAP, 0, + pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); } #endif /* PPP_SERVER */ @@ -314,31 +314,31 @@ static void eap_send_success(ppp_pcb *pcb) { static bool pncrypt_setkey(int timeoffs) { - struct tm *tp; - char tbuf[9]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - time_t reftime; - - if (pn_secret == NULL) - return (0); - reftime = time(NULL) + timeoffs; - tp = localtime(&reftime); - SHA1Init(&ctxt); - SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); - strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); - SHA1Update(&ctxt, tbuf, strlen(tbuf)); - SHA1Final(dig, &ctxt); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - return (DesSetkey(dig)); + struct tm *tp; + char tbuf[9]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + time_t reftime; + + if (pn_secret == NULL) + return (0); + reftime = time(NULL) + timeoffs; + tp = localtime(&reftime); + SHA1Init(&ctxt); + SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); + strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); + SHA1Update(&ctxt, tbuf, strlen(tbuf)); + SHA1Final(dig, &ctxt); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + return (DesSetkey(dig)); } static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; struct b64state { - u32_t bs_bits; - int bs_offs; + u32_t bs_bits; + int bs_offs; }; static int @@ -348,23 +348,23 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - - while (inlen > 0) { - bs->bs_bits = (bs->bs_bits << 8) | *inp++; - inlen--; - bs->bs_offs += 8; - if (bs->bs_offs >= 24) { - *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; - *outp++ = base64[bs->bs_bits & 0x3F]; - outlen += 4; - bs->bs_offs = 0; - bs->bs_bits = 0; - } - } - return (outlen); + int outlen = 0; + + while (inlen > 0) { + bs->bs_bits = (bs->bs_bits << 8) | *inp++; + inlen--; + bs->bs_offs += 8; + if (bs->bs_offs >= 24) { + *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; + *outp++ = base64[bs->bs_bits & 0x3F]; + outlen += 4; + bs->bs_offs = 0; + bs->bs_bits = 0; + } + } + return (outlen); } static int @@ -372,21 +372,21 @@ b64flush(bs, outp) struct b64state *bs; u_char *outp; { - int outlen = 0; - - if (bs->bs_offs == 8) { - *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; - outlen = 2; - } else if (bs->bs_offs == 16) { - *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; - outlen = 3; - } - bs->bs_offs = 0; - bs->bs_bits = 0; - return (outlen); + int outlen = 0; + + if (bs->bs_offs == 8) { + *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; + outlen = 2; + } else if (bs->bs_offs == 16) { + *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; + outlen = 3; + } + bs->bs_offs = 0; + bs->bs_bits = 0; + return (outlen); } static int @@ -396,22 +396,22 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - char *cp; - - while (inlen > 0) { - if ((cp = strchr(base64, *inp++)) == NULL) - break; - bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); - inlen--; - bs->bs_offs += 6; - if (bs->bs_offs >= 8) { - *outp++ = bs->bs_bits >> (bs->bs_offs - 8); - outlen++; - bs->bs_offs -= 8; - } - } - return (outlen); + int outlen = 0; + char *cp; + + while (inlen > 0) { + if ((cp = strchr(base64, *inp++)) == NULL) + break; + bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); + inlen--; + bs->bs_offs += 6; + if (bs->bs_offs >= 8) { + *outp++ = bs->bs_bits >> (bs->bs_offs - 8); + outlen++; + bs->bs_offs -= 8; + } + } + return (outlen); } #endif /* USE_SRP */ @@ -424,211 +424,211 @@ u_char *outp; */ static void eap_figure_next_state(ppp_pcb *pcb, int status) { #ifdef USE_SRP - unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; - struct t_pw tpw; - struct t_confent *tce, mytce; - char *cp, *cp2; - struct t_server *ts; - int id, i, plen, toffs; - u_char vals[2]; - struct b64state bs; + unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; + struct t_pw tpw; + struct t_confent *tce, mytce; + char *cp, *cp2; + struct t_server *ts; + int id, i, plen, toffs; + u_char vals[2]; + struct b64state bs; #endif /* USE_SRP */ - pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; - switch (pcb->eap.es_server.ea_state) { - case eapBadAuth: - return; + pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; + switch (pcb->eap.es_server.ea_state) { + case eapBadAuth: + return; - case eapIdentify: + case eapIdentify: #ifdef USE_SRP - /* Discard any previous session. */ - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + /* Discard any previous session. */ + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } #ifdef USE_SRP - /* If we've got a pseudonym, try to decode to real name. */ - if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && - strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, - SRP_PSEUDO_LEN) == 0 && - (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < - sizeof (secbuf)) { - BZERO(&bs, sizeof (bs)); - plen = b64dec(&bs, - pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, - pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, - secbuf); - toffs = 0; - for (i = 0; i < 5; i++) { - pncrypt_setkey(toffs); - toffs -= 86400; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesDecrypt(secbuf, clear)) { - ppp_dbglog("no DES here; cannot decode " - "pseudonym"); - return; - } - id = *(unsigned char *)clear; - if (id + 1 <= plen && id + 9 > plen) - break; - } - if (plen % 8 == 0 && i < 5) { - /* - * Note that this is always shorter than the - * original stored string, so there's no need - * to realloc. - */ - if ((i = plen = *(unsigned char *)clear) > 7) - i = 7; - pcb->eap.es_server.ea_peerlen = plen; - dp = (unsigned char *)pcb->eap.es_server.ea_peer; - MEMCPY(dp, clear + 1, i); - plen -= i; - dp += i; - sp = secbuf + 8; - while (plen > 0) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesDecrypt(sp, dp); - sp += 8; - dp += 8; - plen -= 8; - } - pcb->eap.es_server.ea_peer[ - pcb->eap.es_server.ea_peerlen] = '\0'; - ppp_dbglog("decoded pseudonym to \"%.*q\"", - pcb->eap.es_server.ea_peerlen, - pcb->eap.es_server.ea_peer); - } else { - ppp_dbglog("failed to decode real name"); - /* Stay in eapIdentfy state; requery */ - break; - } - } - /* Look up user in secrets database. */ - if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { - /* Set up default in case SRP entry is bad */ - pcb->eap.es_server.ea_state = eapMD5Chall; - /* Get t_confent based on index in srp-secrets */ - id = strtol((char *)secbuf, &cp, 10); - if (*cp++ != ':' || id < 0) - break; - if (id == 0) { - mytce.index = 0; - mytce.modulus.data = (u_char *)wkmodulus; - mytce.modulus.len = sizeof (wkmodulus); - mytce.generator.data = (u_char *)"\002"; - mytce.generator.len = 1; - tce = &mytce; - } else if ((tce = gettcid(id)) != NULL) { - /* - * Client will have to verify this modulus/ - * generator combination, and that will take - * a while. Lengthen the timeout here. - */ - if (pcb->settings.eap_timeout_time > 0 && - pcb->settings.eap_timeout_time < 30) - pcb->settings.eap_timeout_time = 30; - } else { - break; - } - if ((cp2 = strchr(cp, ':')) == NULL) - break; - *cp2++ = '\0'; - tpw.pebuf.name = pcb->eap.es_server.ea_peer; - tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, - cp); - tpw.pebuf.password.data = tpw.pwbuf; - tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, - cp2); - tpw.pebuf.salt.data = tpw.saltbuf; - if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) - break; - pcb->eap.es_server.ea_session = (void *)ts; - pcb->eap.es_server.ea_state = eapSRP1; - vals[0] = pcb->eap.es_server.ea_id + 1; - vals[1] = EAPT_SRP; - t_serveraddexdata(ts, vals, 2); - /* Generate B; must call before t_servergetkey() */ - t_servergenexp(ts); - break; - } + /* If we've got a pseudonym, try to decode to real name. */ + if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && + strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, + SRP_PSEUDO_LEN) == 0 && + (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < + sizeof (secbuf)) { + BZERO(&bs, sizeof (bs)); + plen = b64dec(&bs, + pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, + pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, + secbuf); + toffs = 0; + for (i = 0; i < 5; i++) { + pncrypt_setkey(toffs); + toffs -= 86400; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesDecrypt(secbuf, clear)) { + ppp_dbglog("no DES here; cannot decode " + "pseudonym"); + return; + } + id = *(unsigned char *)clear; + if (id + 1 <= plen && id + 9 > plen) + break; + } + if (plen % 8 == 0 && i < 5) { + /* + * Note that this is always shorter than the + * original stored string, so there's no need + * to realloc. + */ + if ((i = plen = *(unsigned char *)clear) > 7) + i = 7; + pcb->eap.es_server.ea_peerlen = plen; + dp = (unsigned char *)pcb->eap.es_server.ea_peer; + MEMCPY(dp, clear + 1, i); + plen -= i; + dp += i; + sp = secbuf + 8; + while (plen > 0) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesDecrypt(sp, dp); + sp += 8; + dp += 8; + plen -= 8; + } + pcb->eap.es_server.ea_peer[ + pcb->eap.es_server.ea_peerlen] = '\0'; + ppp_dbglog("decoded pseudonym to \"%.*q\"", + pcb->eap.es_server.ea_peerlen, + pcb->eap.es_server.ea_peer); + } else { + ppp_dbglog("failed to decode real name"); + /* Stay in eapIdentfy state; requery */ + break; + } + } + /* Look up user in secrets database. */ + if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { + /* Set up default in case SRP entry is bad */ + pcb->eap.es_server.ea_state = eapMD5Chall; + /* Get t_confent based on index in srp-secrets */ + id = strtol((char *)secbuf, &cp, 10); + if (*cp++ != ':' || id < 0) + break; + if (id == 0) { + mytce.index = 0; + mytce.modulus.data = (u_char *)wkmodulus; + mytce.modulus.len = sizeof (wkmodulus); + mytce.generator.data = (u_char *)"\002"; + mytce.generator.len = 1; + tce = &mytce; + } else if ((tce = gettcid(id)) != NULL) { + /* + * Client will have to verify this modulus/ + * generator combination, and that will take + * a while. Lengthen the timeout here. + */ + if (pcb->settings.eap_timeout_time > 0 && + pcb->settings.eap_timeout_time < 30) + pcb->settings.eap_timeout_time = 30; + } else { + break; + } + if ((cp2 = strchr(cp, ':')) == NULL) + break; + *cp2++ = '\0'; + tpw.pebuf.name = pcb->eap.es_server.ea_peer; + tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, + cp); + tpw.pebuf.password.data = tpw.pwbuf; + tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, + cp2); + tpw.pebuf.salt.data = tpw.saltbuf; + if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) + break; + pcb->eap.es_server.ea_session = (void *)ts; + pcb->eap.es_server.ea_state = eapSRP1; + vals[0] = pcb->eap.es_server.ea_id + 1; + vals[1] = EAPT_SRP; + t_serveraddexdata(ts, vals, 2); + /* Generate B; must call before t_servergetkey() */ + t_servergenexp(ts); + break; + } #endif /* USE_SRP */ - pcb->eap.es_server.ea_state = eapMD5Chall; - break; + pcb->eap.es_server.ea_state = eapMD5Chall; + break; - case eapSRP1: + case eapSRP1: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status == 1) { - pcb->eap.es_server.ea_state = eapMD5Chall; - } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP2; - } - break; - - case eapSRP2: + if (status == 1) { + pcb->eap.es_server.ea_state = eapMD5Chall; + } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP2; + } + break; + + case eapSRP2: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP3; - } - break; - - case eapSRP3: - case eapSRP4: + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP3; + } + break; + + case eapSRP3: + case eapSRP4: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - case eapMD5Chall: - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - default: - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } - if (pcb->eap.es_server.ea_state == eapBadAuth) - eap_send_failure(pcb); + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + case eapMD5Chall: + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + default: + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } + if (pcb->eap.es_server.ea_state == eapBadAuth) + eap_send_failure(pcb); } /* @@ -636,235 +636,235 @@ static void eap_figure_next_state(ppp_pcb *pcb, int status) { * type depends on current state. (Server operation) */ static void eap_send_request(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - u_char *lenloc; - int outlen; - int len; - const char *str; + struct pbuf *p; + u_char *outp; + u_char *lenloc; + int outlen; + int len; + const char *str; #ifdef USE_SRP - struct t_server *ts; - u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; - int i, j; - struct b64state b64; - SHA1_CTX ctxt; + struct t_server *ts; + u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; + int i, j; + struct b64state b64; + SHA1_CTX ctxt; #endif /* USE_SRP */ - /* Handle both initial auth and restart */ - if (pcb->eap.es_server.ea_state < eapIdentify && - pcb->eap.es_server.ea_state != eapInitial) { - pcb->eap.es_server.ea_state = eapIdentify; + /* Handle both initial auth and restart */ + if (pcb->eap.es_server.ea_state < eapIdentify && + pcb->eap.es_server.ea_state != eapInitial) { + pcb->eap.es_server.ea_state = eapIdentify; #if PPP_REMOTENAME - if (pcb->settings.explicit_remote && pcb->remote_name) { - /* - * If we already know the peer's - * unauthenticated name, then there's no - * reason to ask. Go to next state instead. - */ - int len = (int)strlen(pcb->remote_name); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - } + if (pcb->settings.explicit_remote && pcb->remote_name) { + /* + * If we already know the peer's + * unauthenticated name, then there's no + * reason to ask. Go to next state instead. + */ + int len = (int)strlen(pcb->remote_name); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + } #endif /* PPP_REMOTENAME */ - } - - if (pcb->settings.eap_max_transmits > 0 && - pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { - if (pcb->eap.es_server.ea_responses > 0) - ppp_error("EAP: too many Requests sent"); - else - ppp_error("EAP: no response to Requests"); - eap_send_failure(pcb); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_REQUEST, outp); - PUTCHAR(pcb->eap.es_server.ea_id, outp); - lenloc = outp; - INCPTR(2, outp); - - switch (pcb->eap.es_server.ea_state) { - case eapIdentify: - PUTCHAR(EAPT_IDENTITY, outp); - str = "Name"; - len = strlen(str); - MEMCPY(outp, str, len); - INCPTR(len, outp); - break; - - case eapMD5Chall: - PUTCHAR(EAPT_MD5CHAP, outp); - /* - * pick a random challenge length between - * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH - */ - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - PUTCHAR(pcb->eap.es_challen, outp); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - break; + } + + if (pcb->settings.eap_max_transmits > 0 && + pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { + if (pcb->eap.es_server.ea_responses > 0) + ppp_error("EAP: too many Requests sent"); + else + ppp_error("EAP: no response to Requests"); + eap_send_failure(pcb); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_REQUEST, outp); + PUTCHAR(pcb->eap.es_server.ea_id, outp); + lenloc = outp; + INCPTR(2, outp); + + switch (pcb->eap.es_server.ea_state) { + case eapIdentify: + PUTCHAR(EAPT_IDENTITY, outp); + str = "Name"; + len = strlen(str); + MEMCPY(outp, str, len); + INCPTR(len, outp); + break; + + case eapMD5Chall: + PUTCHAR(EAPT_MD5CHAP, outp); + /* + * pick a random challenge length between + * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH + */ + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + PUTCHAR(pcb->eap.es_challen, outp); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + break; #ifdef USE_SRP - case eapSRP1: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CHALLENGE, outp); - - PUTCHAR(pcb->eap.es_server.ea_namelen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - PUTCHAR(ts->s.len, outp); - MEMCPY(outp, ts->s.data, ts->s.len); - INCPTR(ts->s.len, outp); - - if (ts->g.len == 1 && ts->g.data[0] == 2) { - PUTCHAR(0, outp); - } else { - PUTCHAR(ts->g.len, outp); - MEMCPY(outp, ts->g.data, ts->g.len); - INCPTR(ts->g.len, outp); - } - - if (ts->n.len != sizeof (wkmodulus) || - BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { - MEMCPY(outp, ts->n.data, ts->n.len); - INCPTR(ts->n.len, outp); - } - break; - - case eapSRP2: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SKEY, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, ts->B.data, ts->B.len); - INCPTR(ts->B.len, outp); - break; - - case eapSRP3: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SVALIDATOR, outp); - PUTLONG(SRPVAL_EBIT, outp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); - INCPTR(SHA_DIGESTSIZE, outp); - - if (pncrypt_setkey(0)) { - /* Generate pseudonym */ - optr = outp; - cp = (unsigned char *)pcb->eap.es_server.ea_peer; - if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) - j = 7; - clear[0] = i; - MEMCPY(clear + 1, cp, j); - i -= j; - cp += j; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesEncrypt(clear, cipher)) { - ppp_dbglog("no DES here; not generating pseudonym"); - break; - } - BZERO(&b64, sizeof (b64)); - outp++; /* space for pseudonym length */ - outp += b64enc(&b64, cipher, 8, outp); - while (i >= 8) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(cp, cipher); - outp += b64enc(&b64, cipher, 8, outp); - cp += 8; - i -= 8; - } - if (i > 0) { - MEMCPY(clear, cp, i); - cp += i; - magic_random_bytes(cp, 8-i); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(clear, cipher); - outp += b64enc(&b64, cipher, 8, outp); - } - outp += b64flush(&b64, outp); - - /* Set length and pad out to next 20 octet boundary */ - i = outp - optr - 1; - *optr = i; - i %= SHA_DIGESTSIZE; - if (i != 0) { - magic_random_bytes(outp, SHA_DIGESTSIZE-i); - INCPTR(SHA_DIGESTSIZE-i, outp); - } - - /* Obscure the pseudonym with SHA1 hash */ - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - while (optr < outp) { - SHA1Final(dig, &ctxt); - cp = dig; - while (cp < dig + SHA_DIGESTSIZE) - *optr++ ^= *cp++; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, - SHA_DIGESTSIZE); - } - } - break; - - case eapSRP4: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_LWRECHALLENGE, outp); - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - break; + case eapSRP1: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CHALLENGE, outp); + + PUTCHAR(pcb->eap.es_server.ea_namelen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + PUTCHAR(ts->s.len, outp); + MEMCPY(outp, ts->s.data, ts->s.len); + INCPTR(ts->s.len, outp); + + if (ts->g.len == 1 && ts->g.data[0] == 2) { + PUTCHAR(0, outp); + } else { + PUTCHAR(ts->g.len, outp); + MEMCPY(outp, ts->g.data, ts->g.len); + INCPTR(ts->g.len, outp); + } + + if (ts->n.len != sizeof (wkmodulus) || + BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { + MEMCPY(outp, ts->n.data, ts->n.len); + INCPTR(ts->n.len, outp); + } + break; + + case eapSRP2: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SKEY, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, ts->B.data, ts->B.len); + INCPTR(ts->B.len, outp); + break; + + case eapSRP3: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SVALIDATOR, outp); + PUTLONG(SRPVAL_EBIT, outp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); + INCPTR(SHA_DIGESTSIZE, outp); + + if (pncrypt_setkey(0)) { + /* Generate pseudonym */ + optr = outp; + cp = (unsigned char *)pcb->eap.es_server.ea_peer; + if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) + j = 7; + clear[0] = i; + MEMCPY(clear + 1, cp, j); + i -= j; + cp += j; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesEncrypt(clear, cipher)) { + ppp_dbglog("no DES here; not generating pseudonym"); + break; + } + BZERO(&b64, sizeof (b64)); + outp++; /* space for pseudonym length */ + outp += b64enc(&b64, cipher, 8, outp); + while (i >= 8) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(cp, cipher); + outp += b64enc(&b64, cipher, 8, outp); + cp += 8; + i -= 8; + } + if (i > 0) { + MEMCPY(clear, cp, i); + cp += i; + magic_random_bytes(cp, 8-i); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(clear, cipher); + outp += b64enc(&b64, cipher, 8, outp); + } + outp += b64flush(&b64, outp); + + /* Set length and pad out to next 20 octet boundary */ + i = outp - optr - 1; + *optr = i; + i %= SHA_DIGESTSIZE; + if (i != 0) { + magic_random_bytes(outp, SHA_DIGESTSIZE-i); + INCPTR(SHA_DIGESTSIZE-i, outp); + } + + /* Obscure the pseudonym with SHA1 hash */ + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + while (optr < outp) { + SHA1Final(dig, &ctxt); + cp = dig; + while (cp < dig + SHA_DIGESTSIZE) + *optr++ ^= *cp++; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, + SHA_DIGESTSIZE); + } + } + break; + + case eapSRP4: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_LWRECHALLENGE, outp); + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + break; #endif /* USE_SRP */ - default: - return; - } + default: + return; + } - outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; - PUTSHORT(outlen, lenloc); + outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; + PUTSHORT(outlen, lenloc); - pbuf_realloc(p, outlen + PPP_HDRLEN); - ppp_write(pcb, p); + pbuf_realloc(p, outlen + PPP_HDRLEN); + ppp_write(pcb, p); - pcb->eap.es_server.ea_requests++; + pcb->eap.es_server.ea_requests++; - if (pcb->settings.eap_timeout_time > 0) - TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); + if (pcb->settings.eap_timeout_time > 0) + TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); } /* @@ -875,23 +875,23 @@ static void eap_send_request(ppp_pcb *pcb) { */ void eap_authpeer(ppp_pcb *pcb, const char *localname) { - /* Save the name we're given. */ - pcb->eap.es_server.ea_name = localname; - pcb->eap.es_server.ea_namelen = strlen(localname); + /* Save the name we're given. */ + pcb->eap.es_server.ea_name = localname; + pcb->eap.es_server.ea_namelen = strlen(localname); - pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; + pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; - /* Lower layer up yet? */ - if (pcb->eap.es_server.ea_state == eapInitial || - pcb->eap.es_server.ea_state == eapPending) { - pcb->eap.es_server.ea_state = eapPending; - return; - } + /* Lower layer up yet? */ + if (pcb->eap.es_server.ea_state == eapInitial || + pcb->eap.es_server.ea_state == eapPending) { + pcb->eap.es_server.ea_state = eapPending; + return; + } - pcb->eap.es_server.ea_state = eapPending; + pcb->eap.es_server.ea_state = eapPending; - /* ID number not updated here intentionally; hashed into M1 */ - eap_send_request(pcb); + /* ID number not updated here intentionally; hashed into M1 */ + eap_send_request(pcb); } /* @@ -899,13 +899,13 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname) { * expired. */ static void eap_server_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_server_active(pcb)) - return; + if (!eap_server_active(pcb)) + return; - /* EAP ID number must not change on timeout. */ - eap_send_request(pcb); + /* EAP ID number must not change on timeout. */ + eap_send_request(pcb); } /* @@ -914,30 +914,30 @@ static void eap_server_timeout(void *arg) { * will restart the timer. If it fails, then the link is dropped. */ static void eap_rechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen && - pcb->eap.es_server.ea_state != eapSRP4) - return; + if (pcb->eap.es_server.ea_state != eapOpen && + pcb->eap.es_server.ea_state != eapSRP4) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } static void srp_lwrechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen || - pcb->eap.es_server.ea_type != EAPT_SRP) - return; + if (pcb->eap.es_server.ea_state != eapOpen || + pcb->eap.es_server.ea_type != EAPT_SRP) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapSRP4; - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapSRP4; + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } #endif /* PPP_SERVER */ @@ -950,9 +950,9 @@ static void srp_lwrechallenge(void *arg) { * thing. */ static void eap_lowerup(ppp_pcb *pcb) { - pcb->eap.es_client.ea_state = eapClosed; + pcb->eap.es_client.ea_state = eapClosed; #if PPP_SERVER - pcb->eap.es_server.ea_state = eapClosed; + pcb->eap.es_server.ea_state = eapClosed; #endif /* PPP_SERVER */ } @@ -963,28 +963,28 @@ static void eap_lowerup(ppp_pcb *pcb) { */ static void eap_lowerdown(ppp_pcb *pcb) { - if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - } else { - if ((pcb->eap.es_server.ea_state == eapOpen || - pcb->eap.es_server.ea_state == eapSRP4) && - pcb->eap.es_rechallenge > 0) { - UNTIMEOUT(eap_rechallenge, (void *)pcb); - } - if (pcb->eap.es_server.ea_state == eapOpen && - pcb->eap.es_lwrechallenge > 0) { - UNTIMEOUT(srp_lwrechallenge, (void *)pcb); - } - } - - pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; - pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; + if (eap_server_active(pcb)) { + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + } else { + if ((pcb->eap.es_server.ea_state == eapOpen || + pcb->eap.es_server.ea_state == eapSRP4) && + pcb->eap.es_rechallenge > 0) { + UNTIMEOUT(eap_rechallenge, (void *)pcb); + } + if (pcb->eap.es_server.ea_state == eapOpen && + pcb->eap.es_lwrechallenge > 0) { + UNTIMEOUT(srp_lwrechallenge, (void *)pcb); + } + } + + pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; + pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; #endif /* PPP_SERVER */ } @@ -996,87 +996,87 @@ static void eap_lowerdown(ppp_pcb *pcb) { */ static void eap_protrej(ppp_pcb *pcb) { - if (eap_client_active(pcb)) { - ppp_error("EAP authentication failed due to Protocol-Reject"); - auth_withpeer_fail(pcb, PPP_EAP); - } + if (eap_client_active(pcb)) { + ppp_error("EAP authentication failed due to Protocol-Reject"); + auth_withpeer_fail(pcb, PPP_EAP); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - ppp_error("EAP authentication of peer failed on Protocol-Reject"); - auth_peer_fail(pcb, PPP_EAP); - } + if (eap_server_active(pcb)) { + ppp_error("EAP authentication of peer failed on Protocol-Reject"); + auth_peer_fail(pcb, PPP_EAP); + } #endif /* PPP_SERVER */ - eap_lowerdown(pcb); + eap_lowerdown(pcb); } /* * Format and send a regular EAP Response message. */ static void eap_send_response(ppp_pcb *pcb, u_char id, u_char typenum, const u_char *str, int lenstr) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(typenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(typenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* * Format and send an MD5-Challenge EAP Response message. */ static void eap_chap_response(ppp_pcb *pcb, u_char id, u_char *hash, const char *name, int namelen) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + - namelen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_MD5CHAP, outp); - PUTCHAR(MD5_SIGNATURE_SIZE, outp); - MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); - INCPTR(MD5_SIGNATURE_SIZE, outp); - if (namelen > 0) { - MEMCPY(outp, name, namelen); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + + namelen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_MD5CHAP, outp); + PUTCHAR(MD5_SIGNATURE_SIZE, outp); + MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); + INCPTR(MD5_SIGNATURE_SIZE, outp); + if (namelen > 0) { + MEMCPY(outp, name, namelen); + } + + ppp_write(pcb, p); } #ifdef USE_SRP @@ -1091,35 +1091,35 @@ u_char subtypenum; u_char *str; int lenstr; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(subtypenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(subtypenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* @@ -1132,118 +1132,118 @@ u_char id; u32_t flags; u_char *str; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + - SHA_DIGESTSIZE; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CVALIDATOR, outp); - PUTLONG(flags, outp); - MEMCPY(outp, str, SHA_DIGESTSIZE); - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + + SHA_DIGESTSIZE; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CVALIDATOR, outp); + PUTLONG(flags, outp); + MEMCPY(outp, str, SHA_DIGESTSIZE); + + ppp_write(pcb, p); } #endif /* USE_SRP */ static void eap_send_nak(ppp_pcb *pcb, u_char id, u_char type) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char); - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_NAK, outp); - PUTCHAR(type, outp); - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char); + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_NAK, outp); + PUTCHAR(type, outp); + + ppp_write(pcb, p); } #ifdef USE_SRP static char * name_of_pn_file() { - char *user, *path, *file; - struct passwd *pw; - size_t pl; - static bool pnlogged = 0; - - pw = getpwuid(getuid()); - if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { - errno = EINVAL; - return (NULL); - } - file = _PATH_PSEUDONYM; - pl = strlen(user) + strlen(file) + 2; - path = malloc(pl); - if (path == NULL) - return (NULL); - (void) slprintf(path, pl, "%s/%s", user, file); - if (!pnlogged) { - ppp_dbglog("pseudonym file: %s", path); - pnlogged = 1; - } - return (path); + char *user, *path, *file; + struct passwd *pw; + size_t pl; + static bool pnlogged = 0; + + pw = getpwuid(getuid()); + if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { + errno = EINVAL; + return (NULL); + } + file = _PATH_PSEUDONYM; + pl = strlen(user) + strlen(file) + 2; + path = malloc(pl); + if (path == NULL) + return (NULL); + (void) slprintf(path, pl, "%s/%s", user, file); + if (!pnlogged) { + ppp_dbglog("pseudonym file: %s", path); + pnlogged = 1; + } + return (path); } static int open_pn_file(modebits) mode_t modebits; { - char *path; - int fd, err; - - if ((path = name_of_pn_file()) == NULL) - return (-1); - fd = open(path, modebits, S_IRUSR | S_IWUSR); - err = errno; - free(path); - errno = err; - return (fd); + char *path; + int fd, err; + + if ((path = name_of_pn_file()) == NULL) + return (-1); + fd = open(path, modebits, S_IRUSR | S_IWUSR); + err = errno; + free(path); + errno = err; + return (fd); } static void remove_pn_file() { - char *path; + char *path; - if ((path = name_of_pn_file()) != NULL) { - (void) unlink(path); - (void) free(path); - } + if ((path = name_of_pn_file()) != NULL) { + (void) unlink(path); + (void) free(path); + } } static void @@ -1252,56 +1252,56 @@ eap_state *esp; u_char *inp; int len, id; { - u_char val; - u_char *datp, *digp; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int dsize, fd, olen = len; - - /* - * Do the decoding by working backwards. This eliminates the need - * to save the decoded output in a separate buffer. - */ - val = id; - while (len > 0) { - if ((dsize = len % SHA_DIGESTSIZE) == 0) - dsize = SHA_DIGESTSIZE; - len -= dsize; - datp = inp + len; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &val, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); - if (len > 0) { - SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); - } else { - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - } - SHA1Final(dig, &ctxt); - for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) - *datp++ ^= *digp; - } - - /* Now check that the result is sane */ - if (olen <= 0 || *inp + 1 > olen) { - ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); - return; - } - - /* Save it away */ - fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); - if (fd < 0) { - ppp_dbglog("EAP: error saving pseudonym: %m"); - return; - } - len = write(fd, inp + 1, *inp); - if (close(fd) != -1 && len == *inp) { - ppp_dbglog("EAP: saved pseudonym"); - pcb->eap.es_usedpseudo = 0; - } else { - ppp_dbglog("EAP: failed to save pseudonym"); - remove_pn_file(); - } + u_char val; + u_char *datp, *digp; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int dsize, fd, olen = len; + + /* + * Do the decoding by working backwards. This eliminates the need + * to save the decoded output in a separate buffer. + */ + val = id; + while (len > 0) { + if ((dsize = len % SHA_DIGESTSIZE) == 0) + dsize = SHA_DIGESTSIZE; + len -= dsize; + datp = inp + len; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &val, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); + if (len > 0) { + SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); + } else { + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + } + SHA1Final(dig, &ctxt); + for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) + *datp++ ^= *digp; + } + + /* Now check that the result is sane */ + if (olen <= 0 || *inp + 1 > olen) { + ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); + return; + } + + /* Save it away */ + fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); + if (fd < 0) { + ppp_dbglog("EAP: error saving pseudonym: %m"); + return; + } + len = write(fd, inp + 1, *inp); + if (close(fd) != -1 && len == *inp) { + ppp_dbglog("EAP: saved pseudonym"); + pcb->eap.es_usedpseudo = 0; + } else { + ppp_dbglog("EAP: failed to save pseudonym"); + remove_pn_file(); + } } #endif /* USE_SRP */ @@ -1309,412 +1309,412 @@ int len, id; * eap_request - Receive EAP Request message (client mode). */ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_client *tc; - struct t_num sval, gval, Nval, *Ap, Bval; - u_char vals[2]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int fd; + struct t_client *tc; + struct t_num sval, gval, Nval, *Ap, Bval; + u_char vals[2]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int fd; #endif /* USE_SRP */ - /* - * Note: we update es_client.ea_id *only if* a Response - * message is being generated. Otherwise, we leave it the - * same for duplicate detection purposes. - */ - - pcb->eap.es_client.ea_requests++; - if (pcb->settings.eap_allow_req != 0 && - pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { - ppp_info("EAP: received too many Request messages"); - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - auth_withpeer_fail(pcb, PPP_EAP); - return; - } - - if (len <= 0) { - ppp_error("EAP: empty Request message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (len > 0) - ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); + /* + * Note: we update es_client.ea_id *only if* a Response + * message is being generated. Otherwise, we leave it the + * same for duplicate detection purposes. + */ + + pcb->eap.es_client.ea_requests++; + if (pcb->settings.eap_allow_req != 0 && + pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { + ppp_info("EAP: received too many Request messages"); + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + auth_withpeer_fail(pcb, PPP_EAP); + return; + } + + if (len <= 0) { + ppp_error("EAP: empty Request message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (len > 0) + ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); #ifdef USE_SRP - if (pcb->eap.es_usepseudo && - (pcb->eap.es_usedpseudo == 0 || - (pcb->eap.es_usedpseudo == 1 && - id == pcb->eap.es_client.ea_id))) { - pcb->eap.es_usedpseudo = 1; - /* Try to get a pseudonym */ - if ((fd = open_pn_file(O_RDONLY)) >= 0) { - strcpy(rhostname, SRP_PSEUDO_ID); - len = read(fd, rhostname + SRP_PSEUDO_LEN, - sizeof (rhostname) - SRP_PSEUDO_LEN); - /* XXX NAI unsupported */ - if (len > 0) { - eap_send_response(pcb, id, typenum, - rhostname, len + SRP_PSEUDO_LEN); - } - (void) close(fd); - if (len > 0) - break; - } - } - /* Stop using pseudonym now. */ - if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { - remove_pn_file(); - pcb->eap.es_usedpseudo = 2; - } + if (pcb->eap.es_usepseudo && + (pcb->eap.es_usedpseudo == 0 || + (pcb->eap.es_usedpseudo == 1 && + id == pcb->eap.es_client.ea_id))) { + pcb->eap.es_usedpseudo = 1; + /* Try to get a pseudonym */ + if ((fd = open_pn_file(O_RDONLY)) >= 0) { + strcpy(rhostname, SRP_PSEUDO_ID); + len = read(fd, rhostname + SRP_PSEUDO_LEN, + sizeof (rhostname) - SRP_PSEUDO_LEN); + /* XXX NAI unsupported */ + if (len > 0) { + eap_send_response(pcb, id, typenum, + rhostname, len + SRP_PSEUDO_LEN); + } + (void) close(fd); + if (len > 0) + break; + } + } + /* Stop using pseudonym now. */ + if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { + remove_pn_file(); + pcb->eap.es_usedpseudo = 2; + } #endif /* USE_SRP */ - eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; - - case EAPT_NOTIFICATION: - if (len > 0) - ppp_info("EAP: Notification \"%.*q\"", len, inp); - eap_send_response(pcb, id, typenum, NULL, 0); - break; - - case EAPT_NAK: - /* - * Avoid the temptation to send Response Nak in reply - * to Request Nak here. It can only lead to trouble. - */ - ppp_warn("EAP: unexpected Nak in Request; ignored"); - /* Return because we're waiting for something real. */ - return; - - case EAPT_MD5CHAP: - if (len < 1) { - ppp_error("EAP: received MD5-Challenge with no data"); - /* Bogus request; wait for something real. */ - return; - } - GETCHAR(vallen, inp); - len--; - if (vallen < 8 || vallen > len) { - ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", - vallen, len); - /* Try something better. */ - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; + + case EAPT_NOTIFICATION: + if (len > 0) + ppp_info("EAP: Notification \"%.*q\"", len, inp); + eap_send_response(pcb, id, typenum, NULL, 0); + break; + + case EAPT_NAK: + /* + * Avoid the temptation to send Response Nak in reply + * to Request Nak here. It can only lead to trouble. + */ + ppp_warn("EAP: unexpected Nak in Request; ignored"); + /* Return because we're waiting for something real. */ + return; + + case EAPT_MD5CHAP: + if (len < 1) { + ppp_error("EAP: received MD5-Challenge with no data"); + /* Bogus request; wait for something real. */ + return; + } + GETCHAR(vallen, inp); + len--; + if (vallen < 8 || vallen > len) { + ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", + vallen, len); + /* Try something better. */ + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (pcb->settings.explicit_remote || - (pcb->settings.remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (pcb->settings.explicit_remote || + (pcb->settings.remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating ourselves with - * the specified host. - */ - if (!get_secret(pcb, pcb->eap.es_client.ea_name, - rhostname, secret, &secret_len, 0)) { - ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - typenum = id; - lwip_md5_update(&mdContext, &typenum, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, inp, vallen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; + /* + * Get the secret for authenticating ourselves with + * the specified host. + */ + if (!get_secret(pcb, pcb->eap.es_client.ea_name, + rhostname, secret, &secret_len, 0)) { + ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + typenum = id; + lwip_md5_update(&mdContext, &typenum, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, inp, vallen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: received empty SRP Request"); - /* Bogus request; wait for something real. */ - return; - } - - /* Get subtype */ - GETCHAR(vallen, inp); - len--; - switch (vallen) { - case EAPSRP_CHALLENGE: - tc = NULL; - if (pcb->eap.es_client.ea_session != NULL) { - tc = (struct t_client *)pcb->eap.es_client. - ea_session; - /* - * If this is a new challenge, then start - * over with a new client session context. - * Otherwise, just resend last response. - */ - if (id != pcb->eap.es_client.ea_id) { - t_clientclose(tc); - pcb->eap.es_client.ea_session = NULL; - tc = NULL; - } - } - /* No session key just yet */ - pcb->eap.es_client.ea_skey = NULL; - if (tc == NULL) { - int rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (name)"); - /* Ignore badly-formed messages */ - return; - } - MEMCPY(rhostname, inp, vallen); - rhostname[vallen] = '\0'; - INCPTR(vallen, inp); - len -= vallen; - - /* - * In case the remote doesn't give us his name, - * use configured name. - */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == 0)) { - strlcpy(rhostname, remote_name, - sizeof (rhostname)); - } - - rhostnamelen = (int)strlen(rhostname); - if (rhostnamelen > MAXNAMELEN) { - rhostnamelen = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); - pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; - pcb->eap.es_client.ea_peerlen = rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (s)"); - /* Ignore badly-formed messages */ - return; - } - sval.data = inp; - sval.len = vallen; - INCPTR(vallen, inp); - len -= vallen; - - GETCHAR(vallen, inp); - len--; - if (vallen > len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (g)"); - /* Ignore badly-formed messages */ - return; - } - /* If no generator present, then use value 2 */ - if (vallen == 0) { - gval.data = (u_char *)"\002"; - gval.len = 1; - } else { - gval.data = inp; - gval.len = vallen; - } - INCPTR(vallen, inp); - len -= vallen; - - /* - * If no modulus present, then use well-known - * value. - */ - if (len == 0) { - Nval.data = (u_char *)wkmodulus; - Nval.len = sizeof (wkmodulus); - } else { - Nval.data = inp; - Nval.len = len; - } - tc = t_clientopen(pcb->eap.es_client.ea_name, - &Nval, &gval, &sval); - if (tc == NULL) { - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - pcb->eap.es_client.ea_session = (void *)tc; - - /* Add Challenge ID & type to verifier */ - vals[0] = id; - vals[1] = EAPT_SRP; - t_clientaddexdata(tc, vals, 2); - } - Ap = t_clientgenexp(tc); - eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, - Ap->len); - break; - - case EAPSRP_SKEY: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL) { - ppp_warn("EAP: peer sent Subtype 2 without 1"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - if (pcb->eap.es_client.ea_skey != NULL) { - /* - * ID number should not change here. Warn - * if it does (but otherwise ignore). - */ - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 2 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - if (get_srp_secret(pcb->eap.es_unit, - pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_peer, secret, 0) == 0) { - /* - * Can't work with this peer because - * the secret is missing. Just give - * up. - */ - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - Bval.data = inp; - Bval.len = len; - t_clientpasswd(tc, secret); - BZERO(secret, sizeof (secret)); - pcb->eap.es_client.ea_skey = - t_clientgetkey(tc, &Bval); - if (pcb->eap.es_client.ea_skey == NULL) { - /* Server is rogue; stop now */ - ppp_error("EAP: SRP server is rogue"); - goto client_failure; - } - } - eap_srpval_response(esp, id, SRPVAL_EBIT, - t_clientresponse(tc)); - break; - - case EAPSRP_SVALIDATOR: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { - ppp_warn("EAP: peer sent Subtype 3 without 1/2"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - /* - * If we're already open, then this ought to be a - * duplicate. Otherwise, check that the server is - * who we think it is. - */ - if (pcb->eap.es_client.ea_state == eapOpen) { - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 3 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - len -= sizeof (u32_t) + SHA_DIGESTSIZE; - if (len < 0 || t_clientverify(tc, inp + - sizeof (u32_t)) != 0) { - ppp_error("EAP: SRP server verification " - "failed"); - goto client_failure; - } - GETLONG(pcb->eap.es_client.ea_keyflags, inp); - /* Save pseudonym if user wants it. */ - if (len > 0 && pcb->eap.es_usepseudo) { - INCPTR(SHA_DIGESTSIZE, inp); - write_pseudonym(esp, inp, len, id); - } - } - /* - * We've verified our peer. We're now mostly done, - * except for waiting on the regular EAP Success - * message. - */ - eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); - break; - - case EAPSRP_LWRECHALLENGE: - if (len < 4) { - ppp_warn("EAP: malformed Lightweight rechallenge"); - return; - } - SHA1Init(&ctxt); - vals[0] = id; - SHA1Update(&ctxt, vals, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, inp, len); - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - SHA1Final(dig, &ctxt); - eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, - SHA_DIGESTSIZE); - break; - - default: - ppp_error("EAP: unknown SRP Subtype %d", vallen); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: received empty SRP Request"); + /* Bogus request; wait for something real. */ + return; + } + + /* Get subtype */ + GETCHAR(vallen, inp); + len--; + switch (vallen) { + case EAPSRP_CHALLENGE: + tc = NULL; + if (pcb->eap.es_client.ea_session != NULL) { + tc = (struct t_client *)pcb->eap.es_client. + ea_session; + /* + * If this is a new challenge, then start + * over with a new client session context. + * Otherwise, just resend last response. + */ + if (id != pcb->eap.es_client.ea_id) { + t_clientclose(tc); + pcb->eap.es_client.ea_session = NULL; + tc = NULL; + } + } + /* No session key just yet */ + pcb->eap.es_client.ea_skey = NULL; + if (tc == NULL) { + int rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (name)"); + /* Ignore badly-formed messages */ + return; + } + MEMCPY(rhostname, inp, vallen); + rhostname[vallen] = '\0'; + INCPTR(vallen, inp); + len -= vallen; + + /* + * In case the remote doesn't give us his name, + * use configured name. + */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == 0)) { + strlcpy(rhostname, remote_name, + sizeof (rhostname)); + } + + rhostnamelen = (int)strlen(rhostname); + if (rhostnamelen > MAXNAMELEN) { + rhostnamelen = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); + pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; + pcb->eap.es_client.ea_peerlen = rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (s)"); + /* Ignore badly-formed messages */ + return; + } + sval.data = inp; + sval.len = vallen; + INCPTR(vallen, inp); + len -= vallen; + + GETCHAR(vallen, inp); + len--; + if (vallen > len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (g)"); + /* Ignore badly-formed messages */ + return; + } + /* If no generator present, then use value 2 */ + if (vallen == 0) { + gval.data = (u_char *)"\002"; + gval.len = 1; + } else { + gval.data = inp; + gval.len = vallen; + } + INCPTR(vallen, inp); + len -= vallen; + + /* + * If no modulus present, then use well-known + * value. + */ + if (len == 0) { + Nval.data = (u_char *)wkmodulus; + Nval.len = sizeof (wkmodulus); + } else { + Nval.data = inp; + Nval.len = len; + } + tc = t_clientopen(pcb->eap.es_client.ea_name, + &Nval, &gval, &sval); + if (tc == NULL) { + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + pcb->eap.es_client.ea_session = (void *)tc; + + /* Add Challenge ID & type to verifier */ + vals[0] = id; + vals[1] = EAPT_SRP; + t_clientaddexdata(tc, vals, 2); + } + Ap = t_clientgenexp(tc); + eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, + Ap->len); + break; + + case EAPSRP_SKEY: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL) { + ppp_warn("EAP: peer sent Subtype 2 without 1"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + if (pcb->eap.es_client.ea_skey != NULL) { + /* + * ID number should not change here. Warn + * if it does (but otherwise ignore). + */ + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 2 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + if (get_srp_secret(pcb->eap.es_unit, + pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_peer, secret, 0) == 0) { + /* + * Can't work with this peer because + * the secret is missing. Just give + * up. + */ + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + Bval.data = inp; + Bval.len = len; + t_clientpasswd(tc, secret); + BZERO(secret, sizeof (secret)); + pcb->eap.es_client.ea_skey = + t_clientgetkey(tc, &Bval); + if (pcb->eap.es_client.ea_skey == NULL) { + /* Server is rogue; stop now */ + ppp_error("EAP: SRP server is rogue"); + goto client_failure; + } + } + eap_srpval_response(esp, id, SRPVAL_EBIT, + t_clientresponse(tc)); + break; + + case EAPSRP_SVALIDATOR: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { + ppp_warn("EAP: peer sent Subtype 3 without 1/2"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + /* + * If we're already open, then this ought to be a + * duplicate. Otherwise, check that the server is + * who we think it is. + */ + if (pcb->eap.es_client.ea_state == eapOpen) { + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 3 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + len -= sizeof (u32_t) + SHA_DIGESTSIZE; + if (len < 0 || t_clientverify(tc, inp + + sizeof (u32_t)) != 0) { + ppp_error("EAP: SRP server verification " + "failed"); + goto client_failure; + } + GETLONG(pcb->eap.es_client.ea_keyflags, inp); + /* Save pseudonym if user wants it. */ + if (len > 0 && pcb->eap.es_usepseudo) { + INCPTR(SHA_DIGESTSIZE, inp); + write_pseudonym(esp, inp, len, id); + } + } + /* + * We've verified our peer. We're now mostly done, + * except for waiting on the regular EAP Success + * message. + */ + eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); + break; + + case EAPSRP_LWRECHALLENGE: + if (len < 4) { + ppp_warn("EAP: malformed Lightweight rechallenge"); + return; + } + SHA1Init(&ctxt); + vals[0] = id; + SHA1Update(&ctxt, vals, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, inp, len); + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + SHA1Final(dig, &ctxt); + eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, + SHA_DIGESTSIZE); + break; + + default: + ppp_error("EAP: unknown SRP Subtype %d", vallen); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + break; #endif /* USE_SRP */ - default: - ppp_info("EAP: unknown authentication type %d; Naking", typenum); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } + default: + ppp_info("EAP: unknown authentication type %d; Naking", typenum); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); - } - return; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); + } + return; #ifdef USE_SRP client_failure: - pcb->eap.es_client.ea_state = eapBadAuth; - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, (void *)esp); - } - pcb->eap.es_client.ea_session = NULL; - t_clientclose(tc); - auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, (void *)esp); + } + pcb->eap.es_client.ea_session = NULL; + t_clientclose(tc); + auth_withpeer_fail(pcb, PPP_EAP); #endif /* USE_SRP */ } @@ -1723,291 +1723,291 @@ client_failure: * eap_response - Receive EAP Response message (server mode). */ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_server *ts; - struct t_num A; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; + struct t_server *ts; + struct t_num A; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; #endif /* USE_SRP */ - if (pcb->eap.es_server.ea_id != id) { - ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, - pcb->eap.es_server.ea_id); - return; - } - - pcb->eap.es_server.ea_responses++; - - if (len <= 0) { - ppp_error("EAP: empty Response message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (pcb->eap.es_server.ea_state != eapIdentify) { - ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, - inp); - break; - } - ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, inp, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_NOTIFICATION: - ppp_dbglog("EAP unexpected Notification; response discarded"); - break; - - case EAPT_NAK: - if (len < 1) { - ppp_info("EAP: Nak Response with no suggested protocol"); - eap_figure_next_state(pcb, 1); - break; - } - - GETCHAR(vallen, inp); - len--; - - if ( + if (pcb->eap.es_server.ea_id != id) { + ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, + pcb->eap.es_server.ea_id); + return; + } + + pcb->eap.es_server.ea_responses++; + + if (len <= 0) { + ppp_error("EAP: empty Response message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (pcb->eap.es_server.ea_state != eapIdentify) { + ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, + inp); + break; + } + ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, inp, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_NOTIFICATION: + ppp_dbglog("EAP unexpected Notification; response discarded"); + break; + + case EAPT_NAK: + if (len < 1) { + ppp_info("EAP: Nak Response with no suggested protocol"); + eap_figure_next_state(pcb, 1); + break; + } + + GETCHAR(vallen, inp); + len--; + + if ( #if PPP_REMOTENAME - !pcb->explicit_remote && + !pcb->explicit_remote && #endif /* PPP_REMOTENAME */ - pcb->eap.es_server.ea_state == eapIdentify){ - /* Peer cannot Nak Identify Request */ - eap_figure_next_state(pcb, 1); - break; - } - - switch (vallen) { - case EAPT_SRP: - /* Run through SRP validator selection again. */ - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_MD5CHAP: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - - default: - ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); - switch (pcb->eap.es_server.ea_state) { - case eapSRP1: - case eapSRP2: - case eapSRP3: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - case eapMD5Chall: - case eapSRP4: - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - default: - break; - } - break; - } - break; - - case EAPT_MD5CHAP: - if (pcb->eap.es_server.ea_state != eapMD5Chall) { - ppp_error("EAP: unexpected MD5-Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < 1) { - ppp_error("EAP: received MD5-Response with no data"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen != 16 || vallen > len) { - ppp_error("EAP: MD5-Response with bad length %d", vallen); - eap_figure_next_state(pcb, 1); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + pcb->eap.es_server.ea_state == eapIdentify){ + /* Peer cannot Nak Identify Request */ + eap_figure_next_state(pcb, 1); + break; + } + + switch (vallen) { + case EAPT_SRP: + /* Run through SRP validator selection again. */ + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_MD5CHAP: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + + default: + ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); + switch (pcb->eap.es_server.ea_state) { + case eapSRP1: + case eapSRP2: + case eapSRP3: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + case eapMD5Chall: + case eapSRP4: + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + default: + break; + } + break; + } + break; + + case EAPT_MD5CHAP: + if (pcb->eap.es_server.ea_state != eapMD5Chall) { + ppp_error("EAP: unexpected MD5-Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < 1) { + ppp_error("EAP: received MD5-Response with no data"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen != 16 || vallen > len) { + ppp_error("EAP: MD5-Response with bad length %d", vallen); + eap_figure_next_state(pcb, 1); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating the specified - * host. - */ - if (!get_secret(pcb, rhostname, - pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { - ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); - eap_send_failure(pcb); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_type = EAPT_MD5CHAP; - eap_send_success(pcb); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); - break; + /* + * Get the secret for authenticating the specified + * host. + */ + if (!get_secret(pcb, rhostname, + pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { + ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); + eap_send_failure(pcb); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_type = EAPT_MD5CHAP; + eap_send_success(pcb); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: empty SRP Response"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(typenum, inp); - len--; - switch (typenum) { - case EAPSRP_CKEY: - if (pcb->eap.es_server.ea_state != eapSRP1) { - ppp_error("EAP: unexpected SRP Subtype 1 Response"); - eap_figure_next_state(pcb, 1); - break; - } - A.data = inp; - A.len = len; - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); - if (pcb->eap.es_server.ea_skey == NULL) { - /* Client's A value is bogus; terminate now */ - ppp_error("EAP: bogus A value from client"); - eap_send_failure(pcb); - } else { - eap_figure_next_state(pcb, 0); - } - break; - - case EAPSRP_CVALIDATOR: - if (pcb->eap.es_server.ea_state != eapSRP2) { - ppp_error("EAP: unexpected SRP Subtype 2 Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { - ppp_error("EAP: M1 length %d < %d", len, - sizeof (u32_t) + SHA_DIGESTSIZE); - eap_figure_next_state(pcb, 1); - break; - } - GETLONG(pcb->eap.es_server.ea_keyflags, inp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - if (t_serververify(ts, inp)) { - ppp_info("EAP: unable to validate client identity"); - eap_send_failure(pcb); - break; - } - eap_figure_next_state(pcb, 0); - break; - - case EAPSRP_ACK: - if (pcb->eap.es_server.ea_state != eapSRP3) { - ppp_error("EAP: unexpected SRP Subtype 3 Response"); - eap_send_failure(esp); - break; - } - pcb->eap.es_server.ea_type = EAPT_SRP; - eap_send_success(pcb, esp); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, - pcb->eap.es_rechallenge); - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, pcb, - pcb->eap.es_lwrechallenge); - break; - - case EAPSRP_LWRECHALLENGE: - if (pcb->eap.es_server.ea_state != eapSRP4) { - ppp_info("EAP: unexpected SRP Subtype 4 Response"); - return; - } - if (len != SHA_DIGESTSIZE) { - ppp_error("EAP: bad Lightweight rechallenge " - "response"); - return; - } - SHA1Init(&ctxt); - vallen = id; - SHA1Update(&ctxt, &vallen, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - SHA1Final(dig, &ctxt); - if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { - ppp_error("EAP: failed Lightweight rechallenge"); - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_state = eapOpen; - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, esp, - pcb->eap.es_lwrechallenge); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: empty SRP Response"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(typenum, inp); + len--; + switch (typenum) { + case EAPSRP_CKEY: + if (pcb->eap.es_server.ea_state != eapSRP1) { + ppp_error("EAP: unexpected SRP Subtype 1 Response"); + eap_figure_next_state(pcb, 1); + break; + } + A.data = inp; + A.len = len; + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); + if (pcb->eap.es_server.ea_skey == NULL) { + /* Client's A value is bogus; terminate now */ + ppp_error("EAP: bogus A value from client"); + eap_send_failure(pcb); + } else { + eap_figure_next_state(pcb, 0); + } + break; + + case EAPSRP_CVALIDATOR: + if (pcb->eap.es_server.ea_state != eapSRP2) { + ppp_error("EAP: unexpected SRP Subtype 2 Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { + ppp_error("EAP: M1 length %d < %d", len, + sizeof (u32_t) + SHA_DIGESTSIZE); + eap_figure_next_state(pcb, 1); + break; + } + GETLONG(pcb->eap.es_server.ea_keyflags, inp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + if (t_serververify(ts, inp)) { + ppp_info("EAP: unable to validate client identity"); + eap_send_failure(pcb); + break; + } + eap_figure_next_state(pcb, 0); + break; + + case EAPSRP_ACK: + if (pcb->eap.es_server.ea_state != eapSRP3) { + ppp_error("EAP: unexpected SRP Subtype 3 Response"); + eap_send_failure(esp); + break; + } + pcb->eap.es_server.ea_type = EAPT_SRP; + eap_send_success(pcb, esp); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, + pcb->eap.es_rechallenge); + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, pcb, + pcb->eap.es_lwrechallenge); + break; + + case EAPSRP_LWRECHALLENGE: + if (pcb->eap.es_server.ea_state != eapSRP4) { + ppp_info("EAP: unexpected SRP Subtype 4 Response"); + return; + } + if (len != SHA_DIGESTSIZE) { + ppp_error("EAP: bad Lightweight rechallenge " + "response"); + return; + } + SHA1Init(&ctxt); + vallen = id; + SHA1Update(&ctxt, &vallen, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + SHA1Final(dig, &ctxt); + if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { + ppp_error("EAP: failed Lightweight rechallenge"); + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_state = eapOpen; + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, esp, + pcb->eap.es_lwrechallenge); + break; + } + break; #endif /* USE_SRP */ - default: - /* This can't happen. */ - ppp_error("EAP: unknown Response type %d; ignored", typenum); - return; - } - - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - - if (pcb->eap.es_server.ea_state != eapBadAuth && - pcb->eap.es_server.ea_state != eapOpen) { - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); - } + default: + /* This can't happen. */ + ppp_error("EAP: unknown Response type %d; ignored", typenum); + return; + } + + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + + if (pcb->eap.es_server.ea_state != eapBadAuth && + pcb->eap.es_server.ea_state != eapOpen) { + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); + } } #endif /* PPP_SERVER */ @@ -2015,105 +2015,105 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { * eap_success - Receive EAP Success message (client mode). */ static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); - - if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected success message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - return; - } - - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } - - pcb->eap.es_client.ea_state = eapOpen; - auth_withpeer_success(pcb, PPP_EAP, 0); + LWIP_UNUSED_ARG(id); + + if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected success message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + return; + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } + + pcb->eap.es_client.ea_state = eapOpen; + auth_withpeer_success(pcb, PPP_EAP, 0); } /* * eap_failure - Receive EAP Failure message (client mode). */ static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(id); - if (!eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected failure message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - } + if (!eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected failure message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } - pcb->eap.es_client.ea_state = eapBadAuth; + pcb->eap.es_client.ea_state = eapBadAuth; - ppp_error("EAP: peer reports authentication failure"); - auth_withpeer_fail(pcb, PPP_EAP); + ppp_error("EAP: peer reports authentication failure"); + auth_withpeer_fail(pcb, PPP_EAP); } /* * eap_input - Handle received EAP message. */ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { - u_char code, id; - int len; - - /* - * Parse header (code, id and length). If packet too short, - * drop it. - */ - if (inlen < EAP_HEADERLEN) { - ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) { - ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, - EAP_HEADERLEN, inlen); - return; - } - len -= EAP_HEADERLEN; - - /* Dispatch based on message code */ - switch (code) { - case EAP_REQUEST: - eap_request(pcb, inp, id, len); - break; + u_char code, id; + int len; + + /* + * Parse header (code, id and length). If packet too short, + * drop it. + */ + if (inlen < EAP_HEADERLEN) { + ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) { + ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, + EAP_HEADERLEN, inlen); + return; + } + len -= EAP_HEADERLEN; + + /* Dispatch based on message code */ + switch (code) { + case EAP_REQUEST: + eap_request(pcb, inp, id, len); + break; #if PPP_SERVER - case EAP_RESPONSE: - eap_response(pcb, inp, id, len); - break; + case EAP_RESPONSE: + eap_response(pcb, inp, id, len); + break; #endif /* PPP_SERVER */ - case EAP_SUCCESS: - eap_success(pcb, inp, id, len); - break; + case EAP_SUCCESS: + eap_success(pcb, inp, id, len); + break; - case EAP_FAILURE: - eap_failure(pcb, inp, id, len); - break; + case EAP_FAILURE: + eap_failure(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - /* Note: it's not legal to send EAP Nak here. */ - ppp_warn("EAP: unknown code %d received", code); - break; - } + default: /* XXX Need code reject */ + /* Note: it's not legal to send EAP Nak here. */ + ppp_warn("EAP: unknown code %d received", code); + break; + } } #if PRINTPKT_SUPPORT @@ -2121,302 +2121,302 @@ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { * eap_printpkt - print the contents of an EAP packet. */ static const char* const eap_codenames[] = { - "Request", "Response", "Success", "Failure" + "Request", "Response", "Success", "Failure" }; static const char* const eap_typenames[] = { - "Identity", "Notification", "Nak", "MD5-Challenge", - "OTP", "Generic-Token", NULL, NULL, - "RSA", "DSS", "KEA", "KEA-Validate", - "TLS", "Defender", "Windows 2000", "Arcot", - "Cisco", "Nokia", "SRP" + "Identity", "Notification", "Nak", "MD5-Challenge", + "OTP", "Generic-Token", NULL, NULL, + "RSA", "DSS", "KEA", "KEA-Validate", + "TLS", "Defender", "Windows 2000", "Arcot", + "Cisco", "Nokia", "SRP" }; static int eap_printpkt(const u_char *inp, int inlen, void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len, rtype, vallen; - const u_char *pstart; - u32_t uval; - - if (inlen < EAP_HEADERLEN) - return (0); - pstart = inp; - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) - return (0); - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) - printer(arg, " %s", eap_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= EAP_HEADERLEN; - switch (code) { - case EAP_REQUEST: - if (len < 1) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - case EAPT_NOTIFICATION: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_MD5CHAP: - if (len <= 0) - break; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 3) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CHALLENGE: - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - if (vallen > 0) { - printer(arg, " "); - } else { - printer(arg, " "); - } - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - if (vallen == 0) { - printer(arg, " "); - } else { - printer(arg, " ", vallen, inp); - } - INCPTR(vallen, inp); - len -= vallen; - if (len == 0) { - printer(arg, " "); - } else { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_SKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_SVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - printer(arg, " ", len, inp, - len < SHA_DIGESTSIZE ? "?" : ""); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_RESPONSE: - if (len < 1) - break; - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPT_NAK: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " (%s)", eap_typenames[rtype-1]); - printer(arg, ">"); - break; - - case EAPT_MD5CHAP: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 1) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_CVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_ACK: - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - INCPTR(vallen, inp); - len -= vallen; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_SUCCESS: /* No payload expected for these! */ - case EAP_FAILURE: - default: - break; - - truncated: - printer(arg, " "); - break; - } - - if (len > 8) - printer(arg, "%8B...", inp); - else if (len > 0) - printer(arg, "%.*B", len, inp); - INCPTR(len, inp); - - return (inp - pstart); + int code, id, len, rtype, vallen; + const u_char *pstart; + u32_t uval; + + if (inlen < EAP_HEADERLEN) + return (0); + pstart = inp; + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) + return (0); + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) + printer(arg, " %s", eap_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= EAP_HEADERLEN; + switch (code) { + case EAP_REQUEST: + if (len < 1) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + case EAPT_NOTIFICATION: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_MD5CHAP: + if (len <= 0) + break; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 3) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CHALLENGE: + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + if (vallen > 0) { + printer(arg, " "); + } else { + printer(arg, " "); + } + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + if (vallen == 0) { + printer(arg, " "); + } else { + printer(arg, " ", vallen, inp); + } + INCPTR(vallen, inp); + len -= vallen; + if (len == 0) { + printer(arg, " "); + } else { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_SKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_SVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + printer(arg, " ", len, inp, + len < SHA_DIGESTSIZE ? "?" : ""); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_RESPONSE: + if (len < 1) + break; + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPT_NAK: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " (%s)", eap_typenames[rtype-1]); + printer(arg, ">"); + break; + + case EAPT_MD5CHAP: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 1) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_CVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_ACK: + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + INCPTR(vallen, inp); + len -= vallen; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_SUCCESS: /* No payload expected for these! */ + case EAP_FAILURE: + default: + break; + + truncated: + printer(arg, " "); + break; + } + + if (len > 8) + printer(arg, "%8B...", inp); + else if (len > 0) + printer(arg, "%.*B", len, inp); + INCPTR(len, inp); + + return (inp - pstart); } #endif /* PRINTPKT_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ecp.c b/components/net/lwip-2.0.2/src/netif/ppp/ecp.c index 4d84f60931..5b3b331560 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ecp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ecp.c @@ -92,8 +92,8 @@ static void ecp_protrej (int unit); */ #if PRINTPKT_SUPPORT static int ecp_printpkt (const u_char *pkt, int len, - void (*printer) (void *, char *, ...), - void *arg); + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ /* static void ecp_datainput (int unit, u_char *pkt, int len); @@ -129,10 +129,10 @@ const struct protent ecp_protent = { }; fsm ecp_fsm[NUM_PPP]; -ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ -ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ -ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ -ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ +ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ +ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ +ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ +ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ static const fsm_callbacks ecp_callbacks = { NULL, /* ecp_resetci, */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/eui64.c b/components/net/lwip-2.0.2/src/netif/ppp/eui64.c index 01493bc1f8..9e25fc4c2f 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/eui64.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/eui64.c @@ -48,8 +48,8 @@ char *eui64_ntoa(eui64_t e) { static char buf[20]; sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", - e.e8[0], e.e8[1], e.e8[2], e.e8[3], - e.e8[4], e.e8[5], e.e8[6], e.e8[7]); + e.e8[0], e.e8[1], e.e8[2], e.e8[3], + e.e8[4], e.e8[5], e.e8[6], e.e8[7]); return buf; } diff --git a/components/net/lwip-2.0.2/src/netif/ppp/fsm.c b/components/net/lwip-2.0.2/src/netif/ppp/fsm.c index 81eba11602..0f6cafa5b1 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/fsm.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/fsm.c @@ -68,7 +68,7 @@ static void fsm_rtermack(fsm *f); static void fsm_rcoderej(fsm *f, u_char *inp, int len); static void fsm_sconfreq(fsm *f, int retransmit); -#define PROTO_NAME(f) ((f)->callbacks->proto_name) +#define PROTO_NAME(f) ((f)->callbacks->proto_name) /* * fsm_init - Initialize fsm. @@ -79,7 +79,7 @@ void fsm_init(fsm *f) { ppp_pcb *pcb = f->pcb; f->state = PPP_FSM_INITIAL; f->flags = 0; - f->id = 0; /* XXX Start with random id? */ + f->id = 0; /* XXX Start with random id? */ f->maxnakloops = pcb->settings.fsm_max_nak_loops; f->term_reason_len = 0; } @@ -91,22 +91,22 @@ void fsm_init(fsm *f) { void fsm_lowerup(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STARTING: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -119,37 +119,37 @@ void fsm_lowerup(fsm *f) { void fsm_lowerdown(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSED: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_INITIAL; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_INITIAL; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_STARTING; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_STARTING; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_OPENED: - if( f->callbacks->down ) - (*f->callbacks->down)(f); - f->state = PPP_FSM_STARTING; - break; + if( f->callbacks->down ) + (*f->callbacks->down)(f); + f->state = PPP_FSM_STARTING; + break; default: - FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -160,34 +160,34 @@ void fsm_lowerdown(fsm *f) { void fsm_open(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSED: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_STOPPING; - /* fall through */ - /* no break */ + f->state = PPP_FSM_STOPPING; + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: case PPP_FSM_OPENED: - if( f->flags & OPT_RESTART ){ - fsm_lowerdown(f); - fsm_lowerup(f); - } - break; + if( f->flags & OPT_RESTART ){ + fsm_lowerdown(f); + fsm_lowerup(f); + } + break; default: - break; + break; } } @@ -201,25 +201,25 @@ static void terminate_layer(fsm *f, int nextstate) { ppp_pcb *pcb = f->pcb; if( f->state != PPP_FSM_OPENED ) - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ else if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers we're down */ + (*f->callbacks->down)(f); /* Inform upper layers we're down */ /* Init restart counter and send Terminate-Request */ f->retransmits = pcb->settings.fsm_max_term_transmits; fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); + (const u_char *) f->term_reason, f->term_reason_len); if (f->retransmits == 0) { - /* - * User asked for no terminate requests at all; just close it. - * We've already fired off one Terminate-Request just to be nice - * to the peer, but we're not going to wait for a reply. - */ - f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - return; + /* + * User asked for no terminate requests at all; just close it. + * We've already fired off one Terminate-Request just to be nice + * to the peer, but we're not going to wait for a reply. + */ + f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + return; } TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); @@ -239,23 +239,23 @@ void fsm_close(fsm *f, const char *reason) { f->term_reason_len = (reason == NULL? 0: LWIP_MIN(strlen(reason), 0xFF) ); switch( f->state ){ case PPP_FSM_STARTING: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STOPPING: - f->state = PPP_FSM_CLOSING; - break; + f->state = PPP_FSM_CLOSING; + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_CLOSING); - break; + terminate_layer(f, PPP_FSM_CLOSING); + break; default: - break; + break; } } @@ -270,44 +270,44 @@ static void fsm_timeout(void *arg) { switch (f->state) { case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - if( f->retransmits <= 0 ){ - /* - * We've waited for an ack long enough. Peer probably heard us. - */ - f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - } else { - /* Send Terminate-Request */ - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - --f->retransmits; - } - break; + if( f->retransmits <= 0 ){ + /* + * We've waited for an ack long enough. Peer probably heard us. + */ + f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + } else { + /* Send Terminate-Request */ + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (const u_char *) f->term_reason, f->term_reason_len); + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + --f->retransmits; + } + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - if (f->retransmits <= 0) { - ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); - f->state = PPP_FSM_STOPPED; - if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) - (*f->callbacks->finished)(f); - - } else { - /* Retransmit the configure-request */ - if (f->callbacks->retransmit) - (*f->callbacks->retransmit)(f); - fsm_sconfreq(f, 1); /* Re-send Configure-Request */ - if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; - } - break; + if (f->retransmits <= 0) { + ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); + f->state = PPP_FSM_STOPPED; + if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) + (*f->callbacks->finished)(f); + + } else { + /* Retransmit the configure-request */ + if (f->callbacks->retransmit) + (*f->callbacks->retransmit)(f); + fsm_sconfreq(f, 1); /* Re-send Configure-Request */ + if( f->state == PPP_FSM_ACKRCVD ) + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -326,26 +326,26 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ inp = inpacket; if (l < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); + return; } if (len > l) { - FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); + return; } - len -= HEADERLEN; /* subtract header length */ + len -= HEADERLEN; /* subtract header length */ if( f->state == PPP_FSM_INITIAL || f->state == PPP_FSM_STARTING ){ - FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", - f->protocol, f->state)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", + f->protocol, f->state)); + return; } /* @@ -353,35 +353,35 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ switch (code) { case CONFREQ: - fsm_rconfreq(f, id, inp, len); - break; - + fsm_rconfreq(f, id, inp, len); + break; + case CONFACK: - fsm_rconfack(f, id, inp, len); - break; - + fsm_rconfack(f, id, inp, len); + break; + case CONFNAK: case CONFREJ: - fsm_rconfnakrej(f, code, id, inp, len); - break; - + fsm_rconfnakrej(f, code, id, inp, len); + break; + case TERMREQ: - fsm_rtermreq(f, id, inp, len); - break; - + fsm_rtermreq(f, id, inp, len); + break; + case TERMACK: - fsm_rtermack(f); - break; - + fsm_rtermack(f); + break; + case CODEREJ: - fsm_rcoderej(f, inp, len); - break; - + fsm_rcoderej(f, inp, len); + break; + default: - if( !f->callbacks->extcode - || !(*f->callbacks->extcode)(f, code, id, inp, len) ) - fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); - break; + if( !f->callbacks->extcode + || !(*f->callbacks->extcode)(f, code, id, inp, len) ) + fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); + break; } } @@ -394,61 +394,61 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { switch( f->state ){ case PPP_FSM_CLOSED: - /* Go away, we're closed */ - fsm_sdata(f, TERMACK, id, NULL, 0); - return; + /* Go away, we're closed */ + fsm_sdata(f, TERMACK, id, NULL, 0); + return; case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - return; + return; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if( f->callbacks->down ) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_STOPPED: - /* Negotiation started by our peer */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Negotiation started by our peer */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } /* * Pass the requested configuration options * to protocol-specific code for checking. */ - if (f->callbacks->reqci){ /* Check CI */ - reject_if_disagree = (f->nakloops >= f->maxnakloops); - code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); + if (f->callbacks->reqci){ /* Check CI */ + reject_if_disagree = (f->nakloops >= f->maxnakloops); + code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); } else if (len) - code = CONFREJ; /* Reject all CI */ + code = CONFREJ; /* Reject all CI */ else - code = CONFACK; + code = CONFACK; /* send the Ack, Nak or Rej to the peer */ fsm_sdata(f, code, id, inp, len); if (code == CONFACK) { - if (f->state == PPP_FSM_ACKRCVD) { - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - } else - f->state = PPP_FSM_ACKSENT; - f->nakloops = 0; + if (f->state == PPP_FSM_ACKRCVD) { + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + } else + f->state = PPP_FSM_ACKSENT; + f->nakloops = 0; } else { - /* we sent CONFACK or CONFREJ */ - if (f->state != PPP_FSM_ACKRCVD) - f->state = PPP_FSM_REQSENT; - if( code == CONFNAK ) - ++f->nakloops; + /* we sent CONFACK or CONFREJ */ + if (f->state != PPP_FSM_ACKRCVD) + f->state = PPP_FSM_REQSENT; + if( code == CONFNAK ) + ++f->nakloops; } } @@ -459,13 +459,13 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { ppp_pcb *pcb = f->pcb; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if( !(f->callbacks->ackci? (*f->callbacks->ackci)(f, inp, len): - (len == 0)) ){ - /* Ack is bad - ignore it */ - ppp_error("Received bad configure-ack: %P", inp, len); - return; + (len == 0)) ){ + /* Ack is bad - ignore it */ + ppp_error("Received bad configure-ack: %P", inp, len); + return; } f->seen_ack = 1; f->rnakloops = 0; @@ -473,38 +473,38 @@ static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: - f->state = PPP_FSM_ACKRCVD; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - break; + f->state = PPP_FSM_ACKRCVD; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + break; case PPP_FSM_ACKRCVD: - /* Huh? an extra valid Ack? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Huh? an extra valid Ack? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - break; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -516,24 +516,24 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { int ret; int treat_as_reject; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if (code == CONFNAK) { - ++f->rnakloops; - treat_as_reject = (f->rnakloops >= f->maxnakloops); - if (f->callbacks->nakci == NULL - || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { - ppp_error("Received bad configure-nak: %P", inp, len); - return; - } + ++f->rnakloops; + treat_as_reject = (f->rnakloops >= f->maxnakloops); + if (f->callbacks->nakci == NULL + || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { + ppp_error("Received bad configure-nak: %P", inp, len); + return; + } } else { - f->rnakloops = 0; - if (f->callbacks->rejci == NULL - || !(ret = f->callbacks->rejci(f, inp, len))) { - ppp_error("Received bad configure-rej: %P", inp, len); - return; - } + f->rnakloops = 0; + if (f->callbacks->rejci == NULL + || !(ret = f->callbacks->rejci(f, inp, len))) { + ppp_error("Received bad configure-rej: %P", inp, len); + return; + } } f->seen_ack = 1; @@ -541,35 +541,35 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKSENT: - /* They didn't agree to what we wanted - try another request */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - if (ret < 0) - f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ - else - fsm_sconfreq(f, 0); /* Send Configure-Request */ - break; + /* They didn't agree to what we wanted - try another request */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + if (ret < 0) + f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ + else + fsm_sconfreq(f, 0); /* Send Configure-Request */ + break; case PPP_FSM_ACKRCVD: - /* Got a Nak/reject when we had already had an Ack?? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Got a Nak/reject when we had already had an Ack?? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -583,22 +583,22 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { switch (f->state) { case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ - break; + f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ + break; case PPP_FSM_OPENED: - if (len > 0) { - ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); - } else - ppp_info("%s terminated by peer", PROTO_NAME(f)); - f->retransmits = 0; - f->state = PPP_FSM_STOPPING; - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - break; + if (len > 0) { + ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); + } else + ppp_info("%s terminated by peer", PROTO_NAME(f)); + f->retransmits = 0; + f->state = PPP_FSM_STOPPING; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + break; default: - break; + break; } fsm_sdata(f, TERMACK, id, NULL, 0); @@ -611,30 +611,30 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { static void fsm_rtermack(fsm *f) { switch (f->state) { case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_ACKRCVD: - f->state = PPP_FSM_REQSENT; - break; + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -646,15 +646,15 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; if (len < HEADERLEN) { - FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); - return; + FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); ppp_warn("%s: Rcvd Code-Reject for code %d, id %d", PROTO_NAME(f), code, id); if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; + f->state = PPP_FSM_REQSENT; } @@ -666,36 +666,36 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { void fsm_protreject(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_CLOSED: - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_STOPPING); - break; + terminate_layer(f, PPP_FSM_STOPPING); + break; default: - FSMDEBUG(("%s: Protocol-reject event in state %d!", - PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Protocol-reject event in state %d!", + PROTO_NAME(f), f->state)); + /* no break */ } } @@ -710,17 +710,17 @@ static void fsm_sconfreq(fsm *f, int retransmit) { int cilen; if( f->state != PPP_FSM_REQSENT && f->state != PPP_FSM_ACKRCVD && f->state != PPP_FSM_ACKSENT ){ - /* Not currently negotiating - reset options */ - if( f->callbacks->resetci ) - (*f->callbacks->resetci)(f); - f->nakloops = 0; - f->rnakloops = 0; + /* Not currently negotiating - reset options */ + if( f->callbacks->resetci ) + (*f->callbacks->resetci)(f); + f->nakloops = 0; + f->rnakloops = 0; } if( !retransmit ){ - /* New request - reset retransmission counter, use new ID */ - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - f->reqid = ++f->id; + /* New request - reset retransmission counter, use new ID */ + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + f->reqid = ++f->id; } f->seen_ack = 0; @@ -729,11 +729,11 @@ static void fsm_sconfreq(fsm *f, int retransmit) { * Make up the request packet */ if( f->callbacks->cilen && f->callbacks->addci ){ - cilen = (*f->callbacks->cilen)(f); - if( cilen > pcb->peer_mru - HEADERLEN ) - cilen = pcb->peer_mru - HEADERLEN; + cilen = (*f->callbacks->cilen)(f); + if( cilen > pcb->peer_mru - HEADERLEN ) + cilen = pcb->peer_mru - HEADERLEN; } else - cilen = 0; + cilen = 0; p = pbuf_alloc(PBUF_RAW, (u16_t)(cilen + HEADERLEN + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); if(NULL == p) @@ -750,8 +750,8 @@ static void fsm_sconfreq(fsm *f, int retransmit) { PUTCHAR(f->reqid, outp); PUTSHORT(cilen + HEADERLEN, outp); if (cilen != 0) { - (*f->callbacks->addci)(f, outp, &cilen); - LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); + (*f->callbacks->addci)(f, outp, &cilen); + LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); } ppp_write(pcb, p); @@ -775,7 +775,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) /* Adjust length to be smaller than MTU */ if (datalen > pcb->peer_mru - HEADERLEN) - datalen = pcb->peer_mru - HEADERLEN; + datalen = pcb->peer_mru - HEADERLEN; outlen = datalen + HEADERLEN; p = pbuf_alloc(PBUF_RAW, (u16_t)(outlen + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); @@ -788,7 +788,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) outp = (u_char*)p->payload; if (datalen) /* && data != outp + PPP_HDRLEN + HEADERLEN) -- was only for fsm_sconfreq() */ - MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); + MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); MAKEHEADER(outp, f->protocol); PUTCHAR(code, outp); PUTCHAR(id, outp); diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c b/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c index b7c766eb0b..feb1f4becc 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c @@ -66,15 +66,15 @@ #if 0 /* UNUSED */ /* global vars */ -u32_t netmask = 0; /* IP netmask to set on interface */ +u32_t netmask = 0; /* IP netmask to set on interface */ #endif /* UNUSED */ #if 0 /* UNUSED */ -bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ +bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ #endif /* UNUSED */ #if 0 /* moved to ppp_settings */ -bool noremoteip = 0; /* Let him have no IP address */ +bool noremoteip = 0; /* Let him have no IP address */ #endif /* moved to ppp_setting */ #if 0 /* UNUSED */ @@ -96,47 +96,47 @@ struct notifier *ip_down_notifier = NULL; /* local vars */ #if 0 /* moved to ppp_pcb */ -static int default_route_set[NUM_PPP]; /* Have set up a default route */ -static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ -static int ipcp_is_up; /* have called np_up() */ -static int ipcp_is_open; /* haven't called np_finished() */ -static bool ask_for_local; /* request our address from peer */ +static int default_route_set[NUM_PPP]; /* Have set up a default route */ +static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ +static int ipcp_is_up; /* have called np_up() */ +static int ipcp_is_open; /* haven't called np_finished() */ +static bool ask_for_local; /* request our address from peer */ #endif /* moved to ppp_pcb */ #if 0 /* UNUSED */ -static char vj_value[8]; /* string form of vj option value */ -static char netmask_str[20]; /* string form of netmask value */ +static char vj_value[8]; /* string form of vj option value */ +static char netmask_str[20]; /* string form of netmask value */ #endif /* UNUSED */ /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void ipcp_resetci(fsm *f); /* Reset our CI */ -static int ipcp_cilen(fsm *f); /* Return length of our CI */ +static void ipcp_resetci(fsm *f); /* Reset our CI */ +static int ipcp_cilen(fsm *f); /* Return length of our CI */ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI */ -static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject);/* Peer nak'd our CI */ -static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree); /* Rcv CI */ -static void ipcp_up(fsm *f); /* We're UP */ -static void ipcp_down(fsm *f); /* We're DOWN */ -static void ipcp_finished(fsm *f); /* Don't need lower layer */ +static void ipcp_up(fsm *f); /* We're UP */ +static void ipcp_down(fsm *f); /* We're DOWN */ +static void ipcp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ - ipcp_resetci, /* Reset our Configuration Information */ - ipcp_cilen, /* Length of our Configuration Information */ - ipcp_addci, /* Add our Configuration Information */ - ipcp_ackci, /* ACK our Configuration Information */ - ipcp_nakci, /* NAK our Configuration Information */ - ipcp_rejci, /* Reject our Configuration Information */ - ipcp_reqci, /* Request peer's Configuration Information */ - ipcp_up, /* Called when fsm reaches OPENED state */ - ipcp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPCP" /* String name of protocol */ + ipcp_resetci, /* Reset our Configuration Information */ + ipcp_cilen, /* Length of our Configuration Information */ + ipcp_addci, /* Add our Configuration Information */ + ipcp_ackci, /* ACK our Configuration Information */ + ipcp_nakci, /* NAK our Configuration Information */ + ipcp_rejci, /* Reject our Configuration Information */ + ipcp_reqci, /* Request peer's Configuration Information */ + ipcp_up, /* Called when fsm reaches OPENED state */ + ipcp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPCP" /* String name of protocol */ }; /* @@ -209,13 +209,13 @@ static option_t ipcp_option_list[] = { &ipcp_wantoptions[0].default_route }, { "replacedefaultroute", o_bool, - &ipcp_wantoptions[0].replace_default_route, + &ipcp_wantoptions[0].replace_default_route, "Replace default route", 1 }, { "noreplacedefaultroute", o_bool, - &ipcp_allowoptions[0].replace_default_route, + &ipcp_allowoptions[0].replace_default_route, "Never replace default route", OPT_A2COPY, - &ipcp_wantoptions[0].replace_default_route }, + &ipcp_wantoptions[0].replace_default_route }, { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, @@ -265,7 +265,7 @@ static void ipcp_input(ppp_pcb *pcb, u_char *p, int len); static void ipcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS static void ip_check_options (void); @@ -312,15 +312,15 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ -#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ -#define CILEN_ADDR 6 /* new-style single address option */ -#define CILEN_ADDRS 10 /* old-style dual address option */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ +#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ +#define CILEN_ADDR 6 /* new-style single address option */ +#define CILEN_ADDRS 10 /* old-style dual address option */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED, already defined by lwIP */ /* @@ -351,11 +351,11 @@ setvjslots(argv) int value; if (!int_option(*argv, &value)) - return 0; + return 0; if (value < 2 || value > 16) { - option_error("vj-max-slots value must be between 2 and 16"); - return 0; + option_error("vj-max-slots value must be between 2 and 16"); + return 0; } ipcp_wantoptions [0].maxslotindex = ipcp_allowoptions[0].maxslotindex = value - 1; @@ -375,21 +375,21 @@ setdnsaddr(argv) dns = inet_addr(*argv); if (dns == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-dns option", - *argv); - return 0; - } - dns = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-dns option", + *argv); + return 0; + } + dns = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].dnsaddr[1] == 0) - ipcp_allowoptions[0].dnsaddr[0] = dns; + ipcp_allowoptions[0].dnsaddr[0] = dns; else - ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; + ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].dnsaddr[1] = dns; @@ -411,21 +411,21 @@ setwinsaddr(argv) wins = inet_addr(*argv); if (wins == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-wins option", - *argv); - return 0; - } - wins = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-wins option", + *argv); + return 0; + } + wins = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].winsaddr[1] == 0) - ipcp_allowoptions[0].winsaddr[0] = wins; + ipcp_allowoptions[0].winsaddr[0] = wins; else - ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; + ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].winsaddr[1] = wins; @@ -455,52 +455,52 @@ setipaddr(arg, argv, doit) * IP address pair separated by ":". */ if ((colon = strchr(arg, ':')) == NULL) - return 0; + return 0; if (!doit) - return 1; - + return 1; + /* * If colon first character, then no local addr. */ if (colon != arg && option_priority >= prio_local) { - *colon = '\0'; - if ((local = inet_addr(arg)) == (u32_t) -1) { - if ((hp = gethostbyname(arg)) == NULL) { - option_error("unknown host: %s", arg); - return 0; - } - local = *(u32_t *)hp->h_addr; - } - if (bad_ip_adrs(local)) { - option_error("bad local IP address %s", ip_ntoa(local)); - return 0; - } - if (local != 0) - wo->ouraddr = local; - *colon = ':'; - prio_local = option_priority; - } - + *colon = '\0'; + if ((local = inet_addr(arg)) == (u32_t) -1) { + if ((hp = gethostbyname(arg)) == NULL) { + option_error("unknown host: %s", arg); + return 0; + } + local = *(u32_t *)hp->h_addr; + } + if (bad_ip_adrs(local)) { + option_error("bad local IP address %s", ip_ntoa(local)); + return 0; + } + if (local != 0) + wo->ouraddr = local; + *colon = ':'; + prio_local = option_priority; + } + /* * If colon last character, then no remote addr. */ if (*++colon != '\0' && option_priority >= prio_remote) { - if ((remote = inet_addr(colon)) == (u32_t) -1) { - if ((hp = gethostbyname(colon)) == NULL) { - option_error("unknown host: %s", colon); - return 0; - } - remote = *(u32_t *)hp->h_addr; - if (remote_name[0] == 0) - strlcpy(remote_name, colon, sizeof(remote_name)); - } - if (bad_ip_adrs(remote)) { - option_error("bad remote IP address %s", ip_ntoa(remote)); - return 0; - } - if (remote != 0) - wo->hisaddr = remote; - prio_remote = option_priority; + if ((remote = inet_addr(colon)) == (u32_t) -1) { + if ((hp = gethostbyname(colon)) == NULL) { + option_error("unknown host: %s", colon); + return 0; + } + remote = *(u32_t *)hp->h_addr; + if (remote_name[0] == 0) + strlcpy(remote_name, colon, sizeof(remote_name)); + } + if (bad_ip_adrs(remote)) { + option_error("bad remote IP address %s", ip_ntoa(remote)); + return 0; + } + if (remote != 0) + wo->hisaddr = remote; + prio_remote = option_priority; } return 1; @@ -512,13 +512,13 @@ printipaddr(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - ipcp_options *wo = &ipcp_wantoptions[0]; + ipcp_options *wo = &ipcp_wantoptions[0]; - if (wo->ouraddr != 0) - printer(arg, "%I", wo->ouraddr); - printer(arg, ":"); - if (wo->hisaddr != 0) - printer(arg, "%I", wo->hisaddr); + if (wo->ouraddr != 0) + printer(arg, "%I", wo->ouraddr); + printer(arg, ":"); + if (wo->hisaddr != 0) + printer(arg, "%I", wo->hisaddr); } /* @@ -542,8 +542,8 @@ setnetmask(argv) mask = lwip_htonl(mask); if (n == 0 || p[n] != 0 || (netmask & ~mask) != 0) { - option_error("invalid netmask value '%s'", *argv); - return 0; + option_error("invalid netmask value '%s'", *argv); + return 0; } netmask = mask; @@ -563,23 +563,23 @@ parse_dotted_ip(p, vp) v = 0; for (n = 3;; --n) { - b = strtoul(p, &endp, 0); - if (endp == p) - return 0; - if (b > 255) { - if (n < 3) - return 0; - /* accept e.g. 0xffffff00 */ - *vp = b; - return endp - p0; - } - v |= b << (n * 8); - p = endp; - if (n == 0) - break; - if (*p != '.') - return 0; - ++p; + b = strtoul(p, &endp, 0); + if (endp == p) + return 0; + if (b > 255) { + if (n < 3) + return 0; + /* accept e.g. 0xffffff00 */ + *vp = b; + return endp - p0; + } + v |= b << (n * 8); + p = endp; + if (n == 0) + break; + if (*p != '.') + return 0; + ++p; } *vp = v; return p - p0; @@ -716,23 +716,23 @@ static void ipcp_resetci(fsm *f) { ipcp_options *ao = &pcb->ipcp_allowoptions; wo->req_addr = (wo->neg_addr || wo->old_addrs) && - (ao->neg_addr || ao->old_addrs); + (ao->neg_addr || ao->old_addrs); if (wo->ouraddr == 0) - wo->accept_local = 1; + wo->accept_local = 1; if (wo->hisaddr == 0) - wo->accept_remote = 1; + wo->accept_remote = 1; #if LWIP_DNS - wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ + wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ #endif /* LWIP_DNS */ *go = *wo; if (!pcb->ask_for_local) - go->ouraddr = 0; + go->ouraddr = 0; #if 0 /* UNUSED */ if (ip_choose_hook) { - ip_choose_hook(&wo->hisaddr); - if (wo->hisaddr) { - wo->accept_remote = 0; - } + ip_choose_hook(&wo->hisaddr); + if (wo->hisaddr) { + wo->accept_remote = 0; + } } #endif /* UNUSED */ BZERO(&pcb->ipcp_hisoptions, sizeof(ipcp_options)); @@ -751,16 +751,16 @@ static int ipcp_cilen(fsm *f) { #endif /* VJ_SUPPORT */ ipcp_options *ho = &pcb->ipcp_hisoptions; -#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) +#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) #if VJ_SUPPORT -#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) +#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) #endif /* VJ_SUPPORT */ -#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) +#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) #if LWIP_DNS -#define LENCIDNS(neg) LENCIADDR(neg) +#define LENCIDNS(neg) LENCIADDR(neg) #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ -#define LENCIWINS(neg) LENCIADDR(neg) +#define LENCIWINS(neg) LENCIADDR(neg) #endif /* UNUSED - WINS */ /* @@ -768,34 +768,34 @@ static int ipcp_cilen(fsm *f) { * forms because we have received old forms from the peer. */ if (go->neg_addr && go->old_addrs && !ho->neg_addr && ho->old_addrs) - go->neg_addr = 0; + go->neg_addr = 0; #if VJ_SUPPORT if (wo->neg_vj && !go->neg_vj && !go->old_vj) { - /* try an older style of VJ negotiation */ - /* use the old style only if the peer did */ - if (ho->neg_vj && ho->old_vj) { - go->neg_vj = 1; - go->old_vj = 1; - go->vj_protocol = ho->vj_protocol; - } + /* try an older style of VJ negotiation */ + /* use the old style only if the peer did */ + if (ho->neg_vj && ho->old_vj) { + go->neg_vj = 1; + go->old_vj = 1; + go->vj_protocol = ho->vj_protocol; + } } #endif /* VJ_SUPPORT */ return (LENCIADDRS(!go->neg_addr && go->old_addrs) + #if VJ_SUPPORT - LENCIVJ(go->neg_vj, go->old_vj) + + LENCIVJ(go->neg_vj, go->old_vj) + #endif /* VJ_SUPPORT */ - LENCIADDR(go->neg_addr) + + LENCIADDR(go->neg_addr) + #if LWIP_DNS - LENCIDNS(go->req_dns1) + - LENCIDNS(go->req_dns2) + + LENCIDNS(go->req_dns1) + + LENCIDNS(go->req_dns2) + #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - LENCIWINS(go->winsaddr[0]) + - LENCIWINS(go->winsaddr[1]) + + LENCIWINS(go->winsaddr[0]) + + LENCIWINS(go->winsaddr[1]) + #endif /* UNUSED - WINS */ - 0); + 0); } @@ -810,86 +810,86 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - if (len >= CILEN_ADDRS) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDRS, ucp); \ - l = lwip_ntohl(val1); \ - PUTLONG(l, ucp); \ - l = lwip_ntohl(val2); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDRS; \ - } else \ - go->old_addrs = 0; \ + if (len >= CILEN_ADDRS) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDRS, ucp); \ + l = lwip_ntohl(val1); \ + PUTLONG(l, ucp); \ + l = lwip_ntohl(val2); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDRS; \ + } else \ + go->old_addrs = 0; \ } #if VJ_SUPPORT #define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - if (!old) { \ - PUTCHAR(maxslotindex, ucp); \ - PUTCHAR(cflag, ucp); \ - } \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + if (!old) { \ + PUTCHAR(maxslotindex, ucp); \ + PUTCHAR(cflag, ucp); \ + } \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* VJ_SUPPORT */ #define ADDCIADDR(opt, neg, val) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(val); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(val); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #if LWIP_DNS #define ADDCIDNS(opt, neg, addr) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ADDCIWINS(opt, addr) \ if (addr) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - addr = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + addr = 0; \ } #endif /* UNUSED - WINS */ ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ADDCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -905,7 +905,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); #endif /* UNUSED - WINS */ - + *lenp -= len; } @@ -915,8 +915,8 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { * Called by fsm_rconfack, Receive Configure ACK. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -936,105 +936,105 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { #define ACKCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDRS) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDRS || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val1 != cilong) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val2 != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDRS) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDRS || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val1 != cilong) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val2 != cilong) \ + goto bad; \ } #if VJ_SUPPORT #define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslotindex) \ - goto bad; \ - GETCHAR(cicflag, p); \ - if (cicflag != cflag) \ - goto bad; \ - } \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslotindex) \ + goto bad; \ + GETCHAR(cicflag, p); \ + if (cicflag != cflag) \ + goto bad; \ + } \ } #endif /* VJ_SUPPORT */ #define ACKCIADDR(opt, neg, val) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val != cilong) \ + goto bad; \ } #if LWIP_DNS #define ACKCIDNS(opt, neg, addr) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ACKCIWINS(opt, addr) \ if (addr) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* UNUSED - WINS */ ACKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ACKCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -1055,7 +1055,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -1070,8 +1070,8 @@ bad: * Calback from fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1085,8 +1085,8 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if LWIP_DNS u32_t cidnsaddr; #endif /* LWIP_DNS */ - ipcp_options no; /* options we've seen Naks for */ - ipcp_options try_; /* options to request next time */ + ipcp_options no; /* options we've seen Naks for */ + ipcp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -1098,58 +1098,58 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIADDRS(opt, neg, code) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - GETLONG(l, p); \ - ciaddr2 = lwip_htonl(l); \ - no.old_addrs = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + GETLONG(l, p); \ + ciaddr2 = lwip_htonl(l); \ + no.old_addrs = 1; \ + code \ } #if VJ_SUPPORT #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* VJ_SUPPORT */ #define NAKCIADDR(opt, neg, code) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - no.neg = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #if LWIP_DNS #define NAKCIDNS(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cidnsaddr = lwip_htonl(l); \ - no.neg = 1; \ - code \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cidnsaddr = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #endif /* LWIP_DNS */ @@ -1158,19 +1158,19 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - if (treat_as_reject) { - try_.old_addrs = 0; - } else { - if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - if (go->accept_remote && ciaddr2) { - /* take his idea of his address */ - try_.hisaddr = ciaddr2; - } - } - ); + if (treat_as_reject) { + try_.old_addrs = 0; + } else { + if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + if (go->accept_remote && ciaddr2) { + /* take his idea of his address */ + try_.hisaddr = ciaddr2; + } + } + ); #if VJ_SUPPORT /* @@ -1180,57 +1180,57 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the peer wants. */ NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - if (treat_as_reject) { - try_.neg_vj = 0; - } else if (cilen == CILEN_VJ) { - GETCHAR(cimaxslotindex, p); - GETCHAR(cicflag, p); - if (cishort == IPCP_VJ_COMP) { - try_.old_vj = 0; - if (cimaxslotindex < go->maxslotindex) - try_.maxslotindex = cimaxslotindex; - if (!cicflag) - try_.cflag = 0; - } else { - try_.neg_vj = 0; - } - } else { - if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { - try_.old_vj = 1; - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + if (treat_as_reject) { + try_.neg_vj = 0; + } else if (cilen == CILEN_VJ) { + GETCHAR(cimaxslotindex, p); + GETCHAR(cicflag, p); + if (cishort == IPCP_VJ_COMP) { + try_.old_vj = 0; + if (cimaxslotindex < go->maxslotindex) + try_.maxslotindex = cimaxslotindex; + if (!cicflag) + try_.cflag = 0; + } else { + try_.neg_vj = 0; + } + } else { + if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { + try_.old_vj = 1; + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* VJ_SUPPORT */ NAKCIADDR(CI_ADDR, neg_addr, - if (treat_as_reject) { - try_.neg_addr = 0; - try_.old_addrs = 0; - } else if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - ); + if (treat_as_reject) { + try_.neg_addr = 0; + try_.old_addrs = 0; + } else if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + ); #if LWIP_DNS NAKCIDNS(CI_MS_DNS1, req_dns1, - if (treat_as_reject) { - try_.req_dns1 = 0; - } else { - try_.dnsaddr[0] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns1 = 0; + } else { + try_.dnsaddr[0] = cidnsaddr; + } + ); NAKCIDNS(CI_MS_DNS2, req_dns2, - if (treat_as_reject) { - try_.req_dns2 = 0; - } else { - try_.dnsaddr[1] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns2 = 0; + } else { + try_.dnsaddr[1] = cidnsaddr; + } + ); #endif /* #if LWIP_DNS */ /* @@ -1242,81 +1242,81 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * peers get huffy if we don't. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* VJ_SUPPORT */ - case CI_ADDRS: - if ((!go->neg_addr && go->old_addrs) || no.old_addrs - || cilen != CILEN_ADDRS) - goto bad; - try_.neg_addr = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - GETLONG(l, p); - ciaddr2 = lwip_htonl(l); - if (ciaddr2 && go->accept_remote) - try_.hisaddr = ciaddr2; - no.old_addrs = 1; - break; - case CI_ADDR: - if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) - goto bad; - try_.old_addrs = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - if (try_.ouraddr != 0) - try_.neg_addr = 1; - no.neg_addr = 1; - break; + case CI_ADDRS: + if ((!go->neg_addr && go->old_addrs) || no.old_addrs + || cilen != CILEN_ADDRS) + goto bad; + try_.neg_addr = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + GETLONG(l, p); + ciaddr2 = lwip_htonl(l); + if (ciaddr2 && go->accept_remote) + try_.hisaddr = ciaddr2; + no.old_addrs = 1; + break; + case CI_ADDR: + if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) + goto bad; + try_.old_addrs = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + if (try_.ouraddr != 0) + try_.neg_addr = 1; + no.neg_addr = 1; + break; #if LWIP_DNS - case CI_MS_DNS1: - if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[0] = lwip_htonl(l); - try_.req_dns1 = 1; - no.req_dns1 = 1; - break; - case CI_MS_DNS2: - if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[1] = lwip_htonl(l); - try_.req_dns2 = 1; - no.req_dns2 = 1; - break; + case CI_MS_DNS1: + if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[0] = lwip_htonl(l); + try_.req_dns1 = 1; + no.req_dns1 = 1; + break; + case CI_MS_DNS2: + if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[1] = lwip_htonl(l); + try_.req_dns2 = 1; + no.req_dns2 = 1; + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - if (cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1) - try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + if (cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1) + try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; + break; #endif /* UNUSED - WINS */ - default: - break; - } - p = next; + default: + break; + } + p = next; } /* @@ -1324,7 +1324,7 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any remaining options, we ignore them. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -1347,7 +1347,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* VJ_SUPPORT */ u32_t cilong; - ipcp_options try_; /* options to request next time */ + ipcp_options try_; /* options to request next time */ try_ = *go; /* @@ -1357,107 +1357,107 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIADDRS(opt, neg, val1, val2) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val1) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val2) \ - goto bad; \ - try_.old_addrs = 0; \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val1) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val2) \ + goto bad; \ + try_.old_addrs = 0; \ } #if VJ_SUPPORT #define REJCIVJ(opt, neg, val, old, maxslot, cflag) \ if (go->neg && \ - p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslot) \ - goto bad; \ - GETCHAR(ciflag, p); \ - if (ciflag != cflag) \ - goto bad; \ + p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslot) \ + goto bad; \ + GETCHAR(ciflag, p); \ + if (ciflag != cflag) \ + goto bad; \ } \ - try_.neg = 0; \ + try_.neg = 0; \ } #endif /* VJ_SUPPORT */ #define REJCIADDR(opt, neg, val) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LWIP_DNS #define REJCIDNS(opt, neg, dnsaddr) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != dnsaddr) \ - goto bad; \ - try_.neg = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != dnsaddr) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define REJCIWINS(opt, addr) \ if (addr && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != addr) \ - goto bad; \ - try_.winsaddr[opt == CI_MS_WINS2] = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != addr) \ + goto bad; \ + try_.winsaddr[opt == CI_MS_WINS2] = 0; \ } #endif /* UNUSED - WINS */ REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - go->ouraddr, go->hisaddr); + go->ouraddr, go->hisaddr); #if VJ_SUPPORT REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ REJCIADDR(CI_ADDR, neg_addr, go->ouraddr); @@ -1478,12 +1478,12 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1508,17 +1508,17 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipcp_options *wo = &pcb->ipcp_wantoptions; ipcp_options *ho = &pcb->ipcp_hisoptions; ipcp_options *ao = &pcb->ipcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #if VJ_SUPPORT - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* VJ_SUPPORT */ u32_t tl, ciaddr1, ciaddr2;/* Parsed address values */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ #if VJ_SUPPORT u_char maxslotindex, cflag; #endif /* VJ_SUPPORT */ @@ -1530,243 +1530,243 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPCPDEBUG(("ipcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_ADDRS: - if (!ao->old_addrs || ho->neg_addr || - cilen != CILEN_ADDRS) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * If neither we nor he knows his address, reject the option. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - /* - * If he doesn't know our address, or if we both have our address - * but disagree about it, then NAK it with our idea. - */ - GETLONG(tl, p); /* Parse desination address (ours) */ - ciaddr2 = lwip_htonl(tl); - if (ciaddr2 != wo->ouraddr) { - if (ciaddr2 == 0 || !wo->accept_local) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->ouraddr); - PUTLONG(tl, p); - } - } else { - wo->ouraddr = ciaddr2; /* accept peer's idea */ - } - } - - ho->old_addrs = 1; - ho->hisaddr = ciaddr1; - ho->ouraddr = ciaddr2; - break; - - case CI_ADDR: - if (!ao->neg_addr || ho->old_addrs || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * Don't ACK an address of 0.0.0.0 - reject it instead. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - ho->neg_addr = 1; - ho->hisaddr = ciaddr1; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPCPDEBUG(("ipcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_ADDRS: + if (!ao->old_addrs || ho->neg_addr || + cilen != CILEN_ADDRS) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * If neither we nor he knows his address, reject the option. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + /* + * If he doesn't know our address, or if we both have our address + * but disagree about it, then NAK it with our idea. + */ + GETLONG(tl, p); /* Parse desination address (ours) */ + ciaddr2 = lwip_htonl(tl); + if (ciaddr2 != wo->ouraddr) { + if (ciaddr2 == 0 || !wo->accept_local) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->ouraddr); + PUTLONG(tl, p); + } + } else { + wo->ouraddr = ciaddr2; /* accept peer's idea */ + } + } + + ho->old_addrs = 1; + ho->hisaddr = ciaddr1; + ho->ouraddr = ciaddr2; + break; + + case CI_ADDR: + if (!ao->neg_addr || ho->old_addrs || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * Don't ACK an address of 0.0.0.0 - reject it instead. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + ho->neg_addr = 1; + ho->hisaddr = ciaddr1; + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - /* Microsoft primary or secondary DNS request */ - d = citype == CI_MS_DNS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->dnsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->dnsaddr[d]) { + case CI_MS_DNS1: + case CI_MS_DNS2: + /* Microsoft primary or secondary DNS request */ + d = citype == CI_MS_DNS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->dnsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->dnsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->dnsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->dnsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - /* Microsoft primary or secondary WINS request */ - d = citype == CI_MS_WINS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->winsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->winsaddr[d]) { + case CI_MS_WINS1: + case CI_MS_WINS2: + /* Microsoft primary or secondary WINS request */ + d = citype == CI_MS_WINS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->winsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->winsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->winsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->winsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* UNUSED - WINS */ #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (!ao->neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - if (!(cishort == IPCP_VJ_COMP || - (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - if (cilen == CILEN_VJ) { - GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(ao->maxslotindex, p); - } - } - GETCHAR(cflag, p); - if (cflag && !ao->cflag) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(wo->cflag, p); - } - } - ho->maxslotindex = maxslotindex; - ho->cflag = cflag; - } else { - ho->old_vj = 1; - ho->maxslotindex = MAX_STATES - 1; - ho->cflag = 1; - } - break; + case CI_COMPRESSTYPE: + if (!ao->neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + if (!(cishort == IPCP_VJ_COMP || + (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + if (cilen == CILEN_VJ) { + GETCHAR(maxslotindex, p); + if (maxslotindex > ao->maxslotindex) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(ao->maxslotindex, p); + } + } + GETCHAR(cflag, p); + if (cflag && !ao->cflag) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(wo->cflag, p); + } + } + ho->maxslotindex = maxslotindex; + ho->cflag = cflag; + } else { + ho->old_vj = 1; + ho->maxslotindex = MAX_STATES - 1; + ho->cflag = 1; + } + break; #endif /* VJ_SUPPORT */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1777,21 +1777,21 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs && - wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_addr = 0; /* don't ask again */ - } - PUTCHAR(CI_ADDR, ucp); - PUTCHAR(CILEN_ADDR, ucp); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, ucp); - } - - *len = ucp - inp; /* Compute output length */ + wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_addr = 0; /* don't ask again */ + } + PUTCHAR(CI_ADDR, ucp); + PUTCHAR(CILEN_ADDR, ucp); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, ucp); + } + + *len = ucp - inp; /* Compute output length */ IPCPDEBUG(("ipcp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -1812,17 +1812,17 @@ ip_check_options() * If local IP address already given, don't bother. */ if (wo->ouraddr == 0 && !disable_defaultip) { - /* - * Look up our hostname (possibly with domain name appended) - * and take the first IP address as our local IP address. - * If there isn't an IP address for our hostname, too bad. - */ - wo->accept_local = 1; /* don't insist on this default value */ - if ((hp = gethostbyname(hostname)) != NULL) { - local = *(u32_t *)hp->h_addr; - if (local != 0 && !bad_ip_adrs(local)) - wo->ouraddr = local; - } + /* + * Look up our hostname (possibly with domain name appended) + * and take the first IP address as our local IP address. + * If there isn't an IP address for our hostname, too bad. + */ + wo->accept_local = 1; /* don't insist on this default value */ + if ((hp = gethostbyname(hostname)) != NULL) { + local = *(u32_t *)hp->h_addr; + if (local != 0 && !bad_ip_adrs(local)) + wo->ouraddr = local; + } } ask_for_local = wo->ouraddr != 0 || !disable_defaultip; } @@ -1841,37 +1841,37 @@ ip_demand_conf(u) ipcp_options *wo = &ipcp_wantoptions[u]; if (wo->hisaddr == 0 && !pcb->settings.noremoteip) { - /* make up an arbitrary address for the peer */ - wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); - wo->accept_remote = 1; + /* make up an arbitrary address for the peer */ + wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); + wo->accept_remote = 1; } if (wo->ouraddr == 0) { - /* make up an arbitrary address for us */ - wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); - wo->accept_local = 1; - ask_for_local = 0; /* don't tell the peer this address */ + /* make up an arbitrary address for us */ + wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); + wo->accept_local = 1; + ask_for_local = 0; /* don't tell the peer this address */ } if (!sifaddr(pcb, wo->ouraddr, wo->hisaddr, get_mask(wo->ouraddr))) - return 0; + return 0; if (!sifup(pcb)) - return 0; + return 0; if (!sifnpmode(pcb, PPP_IP, NPMODE_QUEUE)) - return 0; + return 0; #if 0 /* UNUSED */ if (wo->default_route) - if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, - wo->replace_default_route)) - default_route_set[u] = 1; + if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, + wo->replace_default_route)) + default_route_set[u] = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ if (wo->proxy_arp) - if (sifproxyarp(pcb, wo->hisaddr)) - proxy_arp_set[u] = 1; + if (sifproxyarp(pcb, wo->hisaddr)) + proxy_arp_set[u] = 1; #endif /* UNUSED - PROXY ARP */ ppp_notice("local IP address %I", wo->ouraddr); if (wo->hisaddr) - ppp_notice("remote IP address %I", wo->hisaddr); + ppp_notice("remote IP address %I", wo->hisaddr); return 1; } @@ -1895,46 +1895,46 @@ static void ipcp_up(fsm *f) { * We must have a non-zero IP address for both ends of the link. */ if (!ho->neg_addr && !ho->old_addrs) - ho->hisaddr = wo->hisaddr; + ho->hisaddr = wo->hisaddr; if (!(go->neg_addr || go->old_addrs) && (wo->neg_addr || wo->old_addrs) - && wo->ouraddr != 0) { - ppp_error("Peer refused to agree to our IP address"); - ipcp_close(f->pcb, "Refused our IP address"); - return; + && wo->ouraddr != 0) { + ppp_error("Peer refused to agree to our IP address"); + ipcp_close(f->pcb, "Refused our IP address"); + return; } if (go->ouraddr == 0) { - ppp_error("Could not determine local IP address"); - ipcp_close(f->pcb, "Could not determine local IP address"); - return; + ppp_error("Could not determine local IP address"); + ipcp_close(f->pcb, "Could not determine local IP address"); + return; } if (ho->hisaddr == 0 && !pcb->settings.noremoteip) { - ho->hisaddr = lwip_htonl(0x0a404040); - ppp_warn("Could not determine remote IP address: defaulting to %I", - ho->hisaddr); + ho->hisaddr = lwip_htonl(0x0a404040); + ppp_warn("Could not determine remote IP address: defaulting to %I", + ho->hisaddr); } #if 0 /* UNUSED */ script_setenv("IPLOCAL", ip_ntoa(go->ouraddr), 0); if (ho->hisaddr != 0) - script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); + script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); #endif /* UNUSED */ #if LWIP_DNS if (!go->req_dns1) - go->dnsaddr[0] = 0; + go->dnsaddr[0] = 0; if (!go->req_dns2) - go->dnsaddr[1] = 0; + go->dnsaddr[1] = 0; #if 0 /* UNUSED */ if (go->dnsaddr[0]) - script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); + script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); if (go->dnsaddr[1]) - script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); + script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); #endif /* UNUSED */ if (pcb->settings.usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { - sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #if 0 /* UNUSED */ - script_setenv("USEPEERDNS", "1", 0); - create_resolv(go->dnsaddr[0], go->dnsaddr[1]); + script_setenv("USEPEERDNS", "1", 0); + create_resolv(go->dnsaddr[0], go->dnsaddr[1]); #endif /* UNUSED */ } #endif /* LWIP_DNS */ @@ -1943,29 +1943,29 @@ static void ipcp_up(fsm *f) { * Check that the peer is allowed to use the IP address it wants. */ if (ho->hisaddr != 0) { - u32_t addr = lwip_ntohl(ho->hisaddr); - if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET - || IP_MULTICAST(addr) || IP_BADCLASS(addr) - /* - * For now, consider that PPP in server mode with peer required - * to authenticate must provide the peer IP address, reject any - * IP address wanted by peer different than the one we wanted. - */ + u32_t addr = lwip_ntohl(ho->hisaddr); + if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET + || IP_MULTICAST(addr) || IP_BADCLASS(addr) + /* + * For now, consider that PPP in server mode with peer required + * to authenticate must provide the peer IP address, reject any + * IP address wanted by peer different than the one we wanted. + */ #if PPP_SERVER && PPP_AUTH_SUPPORT - || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) + || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) #endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ - ) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(pcb, "Unauthorized remote IP address"); - return; - } + ) { + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(pcb, "Unauthorized remote IP address"); + return; + } } #if 0 /* Unused */ /* Upstream checking code */ if (ho->hisaddr != 0 && !auth_ip_addr(f->unit, ho->hisaddr)) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(f->unit, "Unauthorized remote IP address"); - return; + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(f->unit, "Unauthorized remote IP address"); + return; } #endif /* Unused */ @@ -1981,114 +1981,114 @@ static void ipcp_up(fsm *f) { * interface to pass IP packets. */ if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { - ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, - wo->replace_default_route); - if (go->ouraddr != wo->ouraddr) { - ppp_warn("Local IP address changed to %I", go->ouraddr); - script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); - wo->ouraddr = go->ouraddr; - } else - script_unsetenv("OLDIPLOCAL"); - if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { - ppp_warn("Remote IP address changed to %I", ho->hisaddr); - script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); - wo->hisaddr = ho->hisaddr; - } else - script_unsetenv("OLDIPREMOTE"); - - /* Set the interface to the new addresses */ - mask = get_mask(go->ouraddr); - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { + ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, + wo->replace_default_route); + if (go->ouraddr != wo->ouraddr) { + ppp_warn("Local IP address changed to %I", go->ouraddr); + script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); + wo->ouraddr = go->ouraddr; + } else + script_unsetenv("OLDIPLOCAL"); + if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { + ppp_warn("Remote IP address changed to %I", ho->hisaddr); + script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); + wo->hisaddr = ho->hisaddr; + } else + script_unsetenv("OLDIPREMOTE"); + + /* Set the interface to the new addresses */ + mask = get_mask(go->ouraddr); + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - default_route_set[f->unit] = 1; + /* assign a default route through the interface if required */ + if (ipcp_wantoptions[f->unit].default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + default_route_set[f->unit] = 1; #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - proxy_arp_set[f->unit] = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + proxy_arp_set[f->unit] = 1; #endif /* UNUSED - PROXY ARP */ - } - demand_rexmit(PPP_IP,go->ouraddr); - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + } + demand_rexmit(PPP_IP,go->ouraddr); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set IP addresses and (if specified) netmask. - */ - mask = get_mask(go->ouraddr); + /* + * Set IP addresses and (if specified) netmask. + */ + mask = get_mask(go->ouraddr); #if !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #endif - /* bring the interface up for IP */ - if (!sifup(pcb)) { + /* bring the interface up for IP */ + if (!sifup(pcb)) { #if PPP_DEBUG - ppp_warn("Interface failed to come up"); + ppp_warn("Interface failed to come up"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #if (defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } #endif #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ #if 0 /* UNUSED */ - /* assign a default route through the interface if required */ - if (wo->default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - pcb->default_route_set = 1; + /* assign a default route through the interface if required */ + if (wo->default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + pcb->default_route_set = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && wo->proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - pcb->proxy_arp_set = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && wo->proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + pcb->proxy_arp_set = 1; #endif /* UNUSED - PROXY ARP */ - wo->ouraddr = go->ouraddr; + wo->ouraddr = go->ouraddr; - ppp_notice("local IP address %I", go->ouraddr); - if (ho->hisaddr != 0) - ppp_notice("remote IP address %I", ho->hisaddr); + ppp_notice("local IP address %I", go->ouraddr); + if (ho->hisaddr != 0) + ppp_notice("remote IP address %I", ho->hisaddr); #if LWIP_DNS - if (go->dnsaddr[0]) - ppp_notice("primary DNS address %I", go->dnsaddr[0]); - if (go->dnsaddr[1]) - ppp_notice("secondary DNS address %I", go->dnsaddr[1]); + if (go->dnsaddr[0]) + ppp_notice("primary DNS address %I", go->dnsaddr[0]); + if (go->dnsaddr[1]) + ppp_notice("secondary DNS address %I", go->dnsaddr[1]); #endif /* LWIP_DNS */ } @@ -2104,7 +2104,7 @@ static void ipcp_up(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_up_hook) - ip_up_hook(); + ip_up_hook(); #endif /* UNUSED */ } @@ -2133,11 +2133,11 @@ static void ipcp_down(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_down_hook) - ip_down_hook(); + ip_down_hook(); #endif /* UNUSED */ if (pcb->ipcp_is_up) { - pcb->ipcp_is_up = 0; - np_down(pcb, PPP_IP); + pcb->ipcp_is_up = 0; + np_down(pcb, PPP_IP); } #if VJ_SUPPORT sifvjcomp(pcb, 0, 0, 0); @@ -2145,8 +2145,8 @@ static void ipcp_down(fsm *f) { #if PPP_STATS_SUPPORT print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), - * because print_link_stats() sets link_stats_valid - * to 0 (zero) */ + * because print_link_stats() sets link_stats_valid + * to 0 (zero) */ #endif /* PPP_STATS_SUPPORT */ #if DEMAND_SUPPORT @@ -2155,18 +2155,18 @@ static void ipcp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); + sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_DROP); + sifnpmode(pcb, PPP_IP, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - sifdown(pcb); - ipcp_clear_addrs(pcb, go->ouraddr, - ho->hisaddr, 0); + sifdown(pcb); + ipcp_clear_addrs(pcb, go->ouraddr, + ho->hisaddr, 0); #if LWIP_DNS - cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #endif /* LWIP_DNS */ } } @@ -2181,8 +2181,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re #if 0 /* UNUSED - PROXY ARP */ if (pcb->proxy_arp_set) { - cifproxyarp(pcb, hisaddr); - pcb->proxy_arp_set = 0; + cifproxyarp(pcb, hisaddr); + pcb->proxy_arp_set = 0; } #endif /* UNUSED - PROXY ARP */ #if 0 /* UNUSED */ @@ -2195,8 +2195,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * is one saved by an sifdefaultroute with replacedefaultroute. */ if (!replacedefaultroute && pcb->default_route_set) { - cifdefaultroute(pcb, ouraddr, hisaddr); - pcb->default_route_set = 0; + cifdefaultroute(pcb, ouraddr, hisaddr); + pcb->default_route_set = 0; } #endif /* UNUSED */ cifaddr(pcb, ouraddr, hisaddr); @@ -2207,11 +2207,11 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * ipcp_finished - possibly shut down the lower layers. */ static void ipcp_finished(fsm *f) { - ppp_pcb *pcb = f->pcb; - if (pcb->ipcp_is_open) { - pcb->ipcp_is_open = 0; - np_finished(pcb, PPP_IP); - } + ppp_pcb *pcb = f->pcb; + if (pcb->ipcp_is_open) { + pcb->ipcp_is_open = 0; + np_finished(pcb, PPP_IP); + } } @@ -2237,7 +2237,7 @@ static const char* const ipcp_codenames[] = { }; static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #if VJ_SUPPORT @@ -2246,18 +2246,18 @@ static int ipcp_printpkt(const u_char *p, int plen, u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipcp_codenames)) - printer(arg, " %s", ipcp_codenames[code-1]); + printer(arg, " %s", ipcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2265,98 +2265,98 @@ static int ipcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_ADDRS: - if (olen == CILEN_ADDRS) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addrs %I", lwip_htonl(cilong)); - GETLONG(cilong, p); - printer(arg, " %I", lwip_htonl(cilong)); - } - break; + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_ADDRS: + if (olen == CILEN_ADDRS) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addrs %I", lwip_htonl(cilong)); + GETLONG(cilong, p); + printer(arg, " %I", lwip_htonl(cilong)); + } + break; #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - switch (cishort) { - case IPCP_VJ_COMP: - printer(arg, "VJ"); - break; - case IPCP_VJ_COMP_OLD: - printer(arg, "old-VJ"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + switch (cishort) { + case IPCP_VJ_COMP: + printer(arg, "VJ"); + break; + case IPCP_VJ_COMP_OLD: + printer(arg, "old-VJ"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* VJ_SUPPORT */ - case CI_ADDR: - if (olen == CILEN_ADDR) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addr %I", lwip_htonl(cilong)); - } - break; + case CI_ADDR: + if (olen == CILEN_ADDR) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addr %I", lwip_htonl(cilong)); + } + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), - htonl(cilong)); - break; + case CI_MS_DNS1: + case CI_MS_DNS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), + htonl(cilong)); + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-wins %I", lwip_htonl(cilong)); - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-wins %I", lwip_htonl(cilong)); + break; #endif /* UNUSED - WINS */ - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -2369,25 +2369,25 @@ static int ipcp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP_HDRLEN 20 /* bytes */ -#define IP_OFFMASK 0x1fff +#define IP_HDRLEN 20 /* bytes */ +#define IP_OFFMASK 0x1fff #ifndef IPPROTO_TCP -#define IPPROTO_TCP 6 +#define IPPROTO_TCP 6 #endif -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define net_short(x) (((x)[0] << 8) + (x)[1]) -#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) -#define get_ipoff(x) net_short((unsigned char *)(x) + 6) -#define get_ipproto(x) (((unsigned char *)(x))[9]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define net_short(x) (((x)[0] << 8) + (x)[1]) +#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) +#define get_ipoff(x) net_short((unsigned char *)(x) + 6) +#define get_ipproto(x) (((unsigned char *)(x))[9]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ip_active_pkt(pkt, len) @@ -2400,17 +2400,17 @@ ip_active_pkt(pkt, len) len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP_HDRLEN) - return 0; + return 0; if ((get_ipoff(pkt) & IP_OFFMASK) != 0) - return 0; + return 0; if (get_ipproto(pkt) != IPPROTO_TCP) - return 1; + return 1; hlen = get_iphl(pkt) * 4; if (len < hlen + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + hlen; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c b/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c index 11c18df743..47521eeb02 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -135,11 +135,11 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ + * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ */ /* - * @todo: + * @todo: * * Proxy Neighbour Discovery. * @@ -188,21 +188,21 @@ static void ipv6cp_down(fsm *f); /* We're DOWN */ static void ipv6cp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ - ipv6cp_resetci, /* Reset our Configuration Information */ - ipv6cp_cilen, /* Length of our Configuration Information */ - ipv6cp_addci, /* Add our Configuration Information */ - ipv6cp_ackci, /* ACK our Configuration Information */ - ipv6cp_nakci, /* NAK our Configuration Information */ - ipv6cp_rejci, /* Reject our Configuration Information */ - ipv6cp_reqci, /* Request peer's Configuration Information */ - ipv6cp_up, /* Called when fsm reaches OPENED state */ - ipv6cp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipv6cp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPV6CP" /* String name of protocol */ + ipv6cp_resetci, /* Reset our Configuration Information */ + ipv6cp_cilen, /* Length of our Configuration Information */ + ipv6cp_addci, /* Add our Configuration Information */ + ipv6cp_ackci, /* ACK our Configuration Information */ + ipv6cp_nakci, /* NAK our Configuration Information */ + ipv6cp_rejci, /* Reject our Configuration Information */ + ipv6cp_reqci, /* Request peer's Configuration Information */ + ipv6cp_up, /* Called when fsm reaches OPENED state */ + ipv6cp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipv6cp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPV6CP" /* String name of protocol */ }; #if PPP_OPTIONS @@ -211,7 +211,7 @@ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ */ static int setifaceid(char **arg)); static void printifaceid(option_t *, - void (*)(void *, char *, ...), void *)); + void (*)(void *, char *, ...), void *)); static option_t ipv6cp_option_list[] = { { "ipv6", o_special, (void *)setifaceid, @@ -265,7 +265,7 @@ static int ipv6_demand_conf(int u); #endif /* DEMAND_SUPPORT */ #if PRINTPKT_SUPPORT static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg); + void (*printer)(void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if DEMAND_SUPPORT static int ipv6_active_pkt(u_char *pkt, int len); @@ -309,12 +309,12 @@ static void ipv6cp_script_done(void *)); /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ -#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ +#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED */ /* @@ -344,49 +344,49 @@ setifaceid(argv) static int prio_local, prio_remote; #define VALIDID(a) ( (((a).s6_addr32[0] == 0) && ((a).s6_addr32[1] == 0)) && \ - (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) - + (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) + arg = *argv; if ((comma = strchr(arg, ',')) == NULL) - comma = arg + strlen(arg); - - /* + comma = arg + strlen(arg); + + /* * If comma first character, then no local identifier */ if (comma != arg) { - c = *comma; - *comma = '\0'; - - if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (local): %s", arg); - return 0; - } - - if (option_priority >= prio_local) { - eui64_copy(addr.s6_addr32[2], wo->ourid); - wo->opt_local = 1; - prio_local = option_priority; - } - *comma = c; + c = *comma; + *comma = '\0'; + + if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (local): %s", arg); + return 0; + } + + if (option_priority >= prio_local) { + eui64_copy(addr.s6_addr32[2], wo->ourid); + wo->opt_local = 1; + prio_local = option_priority; + } + *comma = c; } - + /* * If comma last character, the no remote identifier */ if (*comma != 0 && *++comma != '\0') { - if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (remote): %s", comma); - return 0; - } - if (option_priority >= prio_remote) { - eui64_copy(addr.s6_addr32[2], wo->hisid); - wo->opt_remote = 1; - prio_remote = option_priority; - } + if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (remote): %s", comma); + return 0; + } + if (option_priority >= prio_remote) { + eui64_copy(addr.s6_addr32[2], wo->hisid); + wo->opt_remote = 1; + prio_remote = option_priority; + } } if (override_value("+ipv6", option_priority, option_source)) - ipv6cp_protent.enabled_flag = 1; + ipv6cp_protent.enabled_flag = 1; return 1; } @@ -396,13 +396,13 @@ printifaceid(opt, printer, arg) void (*printer)(void *, char *, ...)); void *arg; { - ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; - if (wo->opt_local) - printer(arg, "%s", llv6_ntoa(wo->ourid)); - printer(arg, ","); - if (wo->opt_remote) - printer(arg, "%s", llv6_ntoa(wo->hisid)); + if (wo->opt_local) + printer(arg, "%s", llv6_ntoa(wo->ourid)); + printer(arg, ","); + if (wo->opt_remote) + printer(arg, "%s", llv6_ntoa(wo->hisid)); } #endif /* PPP_OPTIONS */ @@ -513,13 +513,13 @@ static void ipv6cp_resetci(fsm *f) { ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; wo->req_ifaceid = wo->neg_ifaceid && ao->neg_ifaceid; - + if (!wo->opt_local) { - eui64_magic_nz(wo->ourid); + eui64_magic_nz(wo->ourid); } - + *go = *wo; - eui64_zero(go->hisid); /* last proposed interface identifier */ + eui64_zero(go->hisid); /* last proposed interface identifier */ } @@ -531,15 +531,15 @@ static int ipv6cp_cilen(fsm *f) { ipv6cp_options *go = &pcb->ipv6cp_gotoptions; #ifdef IPV6CP_COMP -#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) +#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) #endif /* IPV6CP_COMP */ -#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) +#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) return (LENCIIFACEID(go->neg_ifaceid) + #ifdef IPV6CP_COMP - LENCIVJ(go->neg_vj) + + LENCIVJ(go->neg_vj) + #endif /* IPV6CP_COMP */ - 0); + 0); } @@ -554,27 +554,27 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { #ifdef IPV6CP_COMP #define ADDCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = CILEN_COMPRESS; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* IPV6CP_COMP */ #define ADDCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if (len >= idlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(idlen, ucp); \ - eui64_put(val1, ucp); \ - len -= idlen; \ - } else \ - neg = 0; \ + int idlen = CILEN_IFACEID; \ + if (len >= idlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(idlen, ucp); \ + eui64_put(val1, ucp); \ + len -= idlen; \ + } else \ + neg = 0; \ } ADDCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -591,8 +591,8 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { * ipv6cp_ackci - Ack our CIs. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -612,33 +612,33 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { #ifdef IPV6CP_COMP #define ACKCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + int vjlen = CILEN_COMPRESS; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #endif /* IPV6CP_COMP */ #define ACKCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if ((len -= idlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != idlen || \ - citype != opt) \ - goto bad; \ - eui64_get(ifaceid, p); \ - if (! eui64_equals(val1, ifaceid)) \ - goto bad; \ + int idlen = CILEN_IFACEID; \ + if ((len -= idlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != idlen || \ + citype != opt) \ + goto bad; \ + eui64_get(ifaceid, p); \ + if (! eui64_equals(val1, ifaceid)) \ + goto bad; \ } ACKCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -651,7 +651,7 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -665,8 +665,8 @@ bad: * or if IPV6CP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -676,8 +676,8 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options no; /* options we've seen Naks for */ - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options no; /* options we've seen Naks for */ + ipv6cp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -689,26 +689,26 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIIFACEID(opt, neg, code) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - no.neg = 1; \ - code \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + no.neg = 1; \ + code \ } #ifdef IPV6CP_COMP #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* IPV6CP_COMP */ @@ -718,27 +718,27 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIIFACEID(CI_IFACEID, neg_ifaceid, - if (treat_as_reject) { - try_.neg_ifaceid = 0; - } else if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); - } - ); + if (treat_as_reject) { + try_.neg_ifaceid = 0; + } else if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); + } + ); #ifdef IPV6CP_COMP NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - { - if (cishort == IPV6CP_COMP && !treat_as_reject) { - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + { + if (cishort == IPV6CP_COMP && !treat_as_reject) { + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* IPV6CP_COMP */ /* @@ -748,49 +748,49 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they want us to ask for compression, we refuse. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) - goto bad; - try_.neg_ifaceid = 1; - eui64_get(ifaceid, p); - if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - } - no.neg_ifaceid = 1; - break; - default: - break; - } - p = next; + case CI_IFACEID: + if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) + goto bad; + try_.neg_ifaceid = 1; + eui64_get(ifaceid, p); + if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + } + no.neg_ifaceid = 1; + break; + default: + break; + } + p = next; } /* If there is still anything left, this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * OK, the Nak is good. Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -811,7 +811,7 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options try_; /* options to request next time */ try_ = *go; /* @@ -821,31 +821,31 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIIFACEID(opt, neg, val1) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - /* Check rejected value. */ \ - if (! eui64_equals(ifaceid, val1)) \ - goto bad; \ - try_.neg = 0; \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + /* Check rejected value. */ \ + if (! eui64_equals(ifaceid, val1)) \ + goto bad; \ + try_.neg = 0; \ } #ifdef IPV6CP_COMP #define REJCIVJ(opt, neg, val) \ if (go->neg && \ - p[1] == CILEN_COMPRESS && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + p[1] == CILEN_COMPRESS && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* IPV6CP_COMP */ @@ -859,12 +859,12 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -890,150 +890,150 @@ static int ipv6cp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; ipv6cp_options *go = &pcb->ipv6cp_gotoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #ifdef IPV6CP_COMP - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* IPV6CP_COMP */ - eui64_t ifaceid; /* Parsed interface identifier */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + eui64_t ifaceid; /* Parsed interface identifier */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ /* * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_IFACEID: - IPV6CPDEBUG(("ipv6cp: received interface identifier ")); - - if (!ao->neg_ifaceid || - cilen != CILEN_IFACEID) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no interface identifier, or if we both have same - * identifier then NAK it with new idea. - * In particular, if we don't know his identifier, but he does, - * then accept it. - */ - eui64_get(ifaceid, p); - IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); - if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { - orc = CONFREJ; /* Reject CI */ - break; - } - if (!eui64_iszero(wo->hisid) && - !eui64_equals(ifaceid, wo->hisid) && - eui64_iszero(go->hisid)) { - - orc = CONFNAK; - ifaceid = wo->hisid; - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } else - if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { - orc = CONFNAK; - if (eui64_iszero(go->hisid)) /* first time, try option */ - ifaceid = wo->hisid; - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->ourid)) /* bad luck */ - eui64_magic(ifaceid); - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } - - ho->neg_ifaceid = 1; - ho->hisid = ifaceid; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_IFACEID: + IPV6CPDEBUG(("ipv6cp: received interface identifier ")); + + if (!ao->neg_ifaceid || + cilen != CILEN_IFACEID) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no interface identifier, or if we both have same + * identifier then NAK it with new idea. + * In particular, if we don't know his identifier, but he does, + * then accept it. + */ + eui64_get(ifaceid, p); + IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); + if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { + orc = CONFREJ; /* Reject CI */ + break; + } + if (!eui64_iszero(wo->hisid) && + !eui64_equals(ifaceid, wo->hisid) && + eui64_iszero(go->hisid)) { + + orc = CONFNAK; + ifaceid = wo->hisid; + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } else + if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { + orc = CONFNAK; + if (eui64_iszero(go->hisid)) /* first time, try option */ + ifaceid = wo->hisid; + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->ourid)) /* bad luck */ + eui64_magic(ifaceid); + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } + + ho->neg_ifaceid = 1; + ho->hisid = ifaceid; + break; #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); - if (!ao->neg_vj || - (cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - IPV6CPDEBUG(("(%d)", cishort)); - - if (!(cishort == IPV6CP_COMP)) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - break; + case CI_COMPRESSTYPE: + IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); + if (!ao->neg_vj || + (cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + IPV6CPDEBUG(("(%d)", cishort)); + + if (!(cishort == IPV6CP_COMP)) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + break; #endif /* IPV6CP_COMP */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); - - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); + + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1044,20 +1044,20 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_ifaceid && - wo->req_ifaceid && !reject_if_disagree) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_ifaceid = 0; /* don't ask again */ - } - PUTCHAR(CI_IFACEID, ucp); - PUTCHAR(CILEN_IFACEID, ucp); - eui64_put(wo->hisid, ucp); + wo->req_ifaceid && !reject_if_disagree) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_ifaceid = 0; /* don't ask again */ + } + PUTCHAR(CI_IFACEID, ucp); + PUTCHAR(CILEN_IFACEID, ucp); + eui64_put(wo->hisid, ucp); } - *len = ucp - inp; /* Compute output length */ + *len = ucp - inp; /* Compute output length */ IPV6CPDEBUG(("ipv6cp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } #if PPP_OPTIONS @@ -1069,7 +1069,7 @@ static void ipv6_check_options() { ipv6cp_options *wo = &ipv6cp_wantoptions[0]; if (!ipv6cp_protent.enabled_flag) - return; + return; /* * Persistent link-local id is only used when user has not explicitly @@ -1077,42 +1077,42 @@ static void ipv6_check_options() { */ if ((wo->use_persistent) && (!wo->opt_local) && (!wo->opt_remote)) { - /* - * On systems where there are no Ethernet interfaces used, there - * may be other ways to obtain a persistent id. Right now, it - * will fall back to using magic [see eui64_magic] below when - * an EUI-48 from MAC address can't be obtained. Other possibilities - * include obtaining EEPROM serial numbers, or some other unique - * yet persistent number. On Sparc platforms, this is possible, - * but too bad there's no standards yet for x86 machines. - */ - if (ether_to_eui64(&wo->ourid)) { - wo->opt_local = 1; - } + /* + * On systems where there are no Ethernet interfaces used, there + * may be other ways to obtain a persistent id. Right now, it + * will fall back to using magic [see eui64_magic] below when + * an EUI-48 from MAC address can't be obtained. Other possibilities + * include obtaining EEPROM serial numbers, or some other unique + * yet persistent number. On Sparc platforms, this is possible, + * but too bad there's no standards yet for x86 machines. + */ + if (ether_to_eui64(&wo->ourid)) { + wo->opt_local = 1; + } + } + + if (!wo->opt_local) { /* init interface identifier */ + if (wo->use_ip && eui64_iszero(wo->ourid)) { + eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); + if (!eui64_iszero(wo->ourid)) + wo->opt_local = 1; } - if (!wo->opt_local) { /* init interface identifier */ - if (wo->use_ip && eui64_iszero(wo->ourid)) { - eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); - if (!eui64_iszero(wo->ourid)) - wo->opt_local = 1; - } - - while (eui64_iszero(wo->ourid)) - eui64_magic(wo->ourid); + while (eui64_iszero(wo->ourid)) + eui64_magic(wo->ourid); } if (!wo->opt_remote) { - if (wo->use_ip && eui64_iszero(wo->hisid)) { - eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); - if (!eui64_iszero(wo->hisid)) - wo->opt_remote = 1; - } + if (wo->use_ip && eui64_iszero(wo->hisid)) { + eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); + if (!eui64_iszero(wo->hisid)) + wo->opt_remote = 1; + } } if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) { - option_error("local/remote LL address required for demand-dialling\n"); - exit(1); + option_error("local/remote LL address required for demand-dialling\n"); + exit(1); } } #endif /* PPP_OPTIONS */ @@ -1126,13 +1126,13 @@ static int ipv6_demand_conf(int u) { ipv6cp_options *wo = &ipv6cp_wantoptions[u]; if (!sif6up(u)) - return 0; + return 0; if (!sif6addr(u, wo->ourid, wo->hisid)) - return 0; + return 0; if (!sifnpmode(u, PPP_IPV6, NPMODE_QUEUE)) - return 0; + return 0; ppp_notice("ipv6_demand_conf"); ppp_notice("local LL address %s", llv6_ntoa(wo->ourid)); @@ -1160,26 +1160,26 @@ static void ipv6cp_up(fsm *f) { * We must have a non-zero LL address for both ends of the link. */ if (!ho->neg_ifaceid) - ho->hisid = wo->hisid; + ho->hisid = wo->hisid; #if 0 /* UNUSED */ if(!no_ifaceid_neg) { #endif /* UNUSED */ - if (eui64_iszero(ho->hisid)) { - ppp_error("Could not determine remote LL address"); - ipv6cp_close(f->pcb, "Could not determine remote LL address"); - return; - } - if (eui64_iszero(go->ourid)) { - ppp_error("Could not determine local LL address"); - ipv6cp_close(f->pcb, "Could not determine local LL address"); - return; - } - if (eui64_equals(go->ourid, ho->hisid)) { - ppp_error("local and remote LL addresses are equal"); - ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); - return; - } + if (eui64_iszero(ho->hisid)) { + ppp_error("Could not determine remote LL address"); + ipv6cp_close(f->pcb, "Could not determine remote LL address"); + return; + } + if (eui64_iszero(go->ourid)) { + ppp_error("Could not determine local LL address"); + ipv6cp_close(f->pcb, "Could not determine local LL address"); + return; + } + if (eui64_equals(go->ourid, ho->hisid)) { + ppp_error("local and remote LL addresses are equal"); + ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); + return; + } #if 0 /* UNUSED */ } #endif /* UNUSED */ @@ -1200,52 +1200,52 @@ static void ipv6cp_up(fsm *f) { * interface to pass IPv6 packets. */ if (demand) { - if (! eui64_equals(go->ourid, wo->ourid) || - ! eui64_equals(ho->hisid, wo->hisid)) { - if (! eui64_equals(go->ourid, wo->ourid)) - warn("Local LL address changed to %s", - llv6_ntoa(go->ourid)); - if (! eui64_equals(ho->hisid, wo->hisid)) - warn("Remote LL address changed to %s", - llv6_ntoa(ho->hisid)); - ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); - - /* Set the interface to the new addresses */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - if (debug) - warn("sif6addr failed"); - ipv6cp_close(f->unit, "Interface configuration failed"); - return; - } - - } - demand_rexmit(PPP_IPV6); - sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); + if (! eui64_equals(go->ourid, wo->ourid) || + ! eui64_equals(ho->hisid, wo->hisid)) { + if (! eui64_equals(go->ourid, wo->ourid)) + warn("Local LL address changed to %s", + llv6_ntoa(go->ourid)); + if (! eui64_equals(ho->hisid, wo->hisid)) + warn("Remote LL address changed to %s", + llv6_ntoa(ho->hisid)); + ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); + + /* Set the interface to the new addresses */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + if (debug) + warn("sif6addr failed"); + ipv6cp_close(f->unit, "Interface configuration failed"); + return; + } + + } + demand_rexmit(PPP_IPV6); + sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set LL addresses - */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } - - /* bring the interface up for IPv6 */ - if (!sif6up(f->pcb)) { - PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } + /* + * Set LL addresses + */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } + + /* bring the interface up for IPv6 */ + if (!sif6up(f->pcb)) { + PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ - ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); - ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); + ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); + ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); } np_up(f->pcb, PPP_IPV6); @@ -1254,11 +1254,11 @@ static void ipv6cp_up(fsm *f) { #if 0 /* UNUSED */ /* * Execute the ipv6-up script, like this: - * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL + * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL */ if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); } #endif /* UNUSED */ } @@ -1280,8 +1280,8 @@ static void ipv6cp_down(fsm *f) { update_link_stats(f->unit); #endif /* PPP_STATS_SUPPORT */ if (pcb->ipv6cp_is_up) { - pcb->ipv6cp_is_up = 0; - np_down(f->pcb, PPP_IPV6); + pcb->ipv6cp_is_up = 0; + np_down(f->pcb, PPP_IPV6); } #ifdef IPV6CP_COMP sif6comp(f->unit, 0); @@ -1293,24 +1293,24 @@ static void ipv6cp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - ipv6cp_clear_addrs(f->pcb, - go->ourid, - ho->hisid); - sif6down(f->pcb); + ipv6cp_clear_addrs(f->pcb, + go->ourid, + ho->hisid); + sif6down(f->pcb); } #if 0 /* UNUSED */ /* Execute the ipv6-down script */ if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); } #endif /* UNUSED */ } @@ -1345,17 +1345,17 @@ ipv6cp_script_done(arg) ipv6cp_script_pid = 0; switch (ipv6cp_script_state) { case s_up: - if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); - } - break; + if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); + } + break; case s_down: - if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); - } - break; + if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); + } + break; } } @@ -1385,7 +1385,7 @@ ipv6cp_script(script) argv[7] = NULL; ipv6cp_script_pid = run_program(script, argv, 0, ipv6cp_script_done, - NULL, 0); + NULL, 0); } #endif /* UNUSED */ @@ -1399,7 +1399,7 @@ static const char* const ipv6cp_codenames[] = { }; static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg) { + void (*printer)(void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #ifdef IPV6CP_COMP @@ -1408,18 +1408,18 @@ static int ipv6cp_printpkt(const u_char *p, int plen, eui64_t ifaceid; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipv6cp_codenames)) - printer(arg, " %s", ipv6cp_codenames[code-1]); + printer(arg, " %s", ipv6cp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -1427,63 +1427,63 @@ static int ipv6cp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - printer(arg, "0x%x", cishort); - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + printer(arg, "0x%x", cishort); + } + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (olen == CILEN_IFACEID) { - p += 2; - eui64_get(ifaceid, p); - printer(arg, "addr %s", llv6_ntoa(ifaceid)); - } - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + case CI_IFACEID: + if (olen == CILEN_IFACEID) { + p += 2; + eui64_get(ifaceid, p); + printer(arg, "addr %s", llv6_ntoa(ifaceid)); + } + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -1496,19 +1496,19 @@ static int ipv6cp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP6_HDRLEN 40 /* bytes */ -#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define IP6_HDRLEN 40 /* bytes */ +#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define get_ip6nh(x) (((unsigned char *)(x))[6]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define get_ip6nh(x) (((unsigned char *)(x))[6]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ipv6_active_pkt(u_char *pkt, int len) { u_char *tcp; @@ -1516,16 +1516,16 @@ static int ipv6_active_pkt(u_char *pkt, int len) { len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP6_HDRLEN) - return 0; + return 0; if (get_ip6nh(pkt) == IP6_NHDR_FRAG) - return 0; + return 0; if (get_ip6nh(pkt) != IPPROTO_TCP) - return 1; + return 1; if (len < IP6_HDRLEN + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + IP6_HDRLEN; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == IP6_HDRLEN + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/lcp.c b/components/net/lwip-2.0.2/src/netif/ppp/lcp.c index 90ed183b75..040135637c 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/lcp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/lcp.c @@ -68,7 +68,7 @@ * configure-requests. We do this by delaying the fsm_lowerup call. */ /* steal a bit in fsm flags word */ -#define DELAYED_UP 0x80 +#define DELAYED_UP 0x80 static void lcp_delayed_up(void *arg); @@ -76,8 +76,8 @@ static void lcp_delayed_up(void *arg); * LCP-related command-line options. */ #if 0 /* UNUSED */ -int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ -int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ +int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ +int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -88,10 +88,10 @@ static u_int lcp_echo_fails = LCP_MAXECHOFAILS; /* Tolerance to unanswer #if 0 /* UNUSED */ #if PPP_LCP_ADAPTIVE -bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ +bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ #endif -bool lax_recv = 0; /* accept control chars in asyncmap */ -bool noendpoint = 0; /* don't send/accept endpoint discriminator */ +bool lax_recv = 0; /* accept control chars in asyncmap */ +bool noendpoint = 0; /* don't send/accept endpoint discriminator */ #endif /* UNUSED */ #if PPP_OPTIONS @@ -101,7 +101,7 @@ static int noopt (char **); #ifdef HAVE_MULTILINK static int setendpoint (char **); static void printendpoint (option_t *, void (*)(void *, char *, ...), - void *); + void *); #endif /* HAVE_MULTILINK */ #if PPP_OPTIONS @@ -215,17 +215,17 @@ static option_t lcp_option_list[] = { /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void lcp_resetci(fsm *f); /* Reset our CI */ -static int lcp_cilen(fsm *f); /* Return length of our CI */ +static void lcp_resetci(fsm *f); /* Reset our CI */ +static int lcp_cilen(fsm *f); /* Return length of our CI */ static void lcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI to pkt */ static int lcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject); /* Peer nak'd our CI */ static int lcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree); /* Rcv peer CI */ -static void lcp_up(fsm *f); /* We're UP */ -static void lcp_down(fsm *f); /* We're DOWN */ -static void lcp_starting (fsm *); /* We need lower layer up */ -static void lcp_finished (fsm *); /* We need lower layer down */ +static void lcp_up(fsm *f); /* We're UP */ +static void lcp_down(fsm *f); /* We're DOWN */ +static void lcp_starting (fsm *); /* We need lower layer up */ +static void lcp_finished (fsm *); /* We need lower layer down */ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len); static void lcp_rprotrej(fsm *f, u_char *inp, int len); @@ -241,22 +241,22 @@ static void LcpSendEchoRequest(fsm *f); static void LcpLinkFailure(fsm *f); static void LcpEchoCheck(fsm *f); -static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ - lcp_resetci, /* Reset our Configuration Information */ - lcp_cilen, /* Length of our Configuration Information */ - lcp_addci, /* Add our Configuration Information */ - lcp_ackci, /* ACK our Configuration Information */ - lcp_nakci, /* NAK our Configuration Information */ - lcp_rejci, /* Reject our Configuration Information */ - lcp_reqci, /* Request peer's Configuration Information */ - lcp_up, /* Called when fsm reaches OPENED state */ - lcp_down, /* Called when fsm leaves OPENED state */ - lcp_starting, /* Called when we want the lower layer up */ - lcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - lcp_extcode, /* Called to handle LCP-specific codes */ - "LCP" /* String name of protocol */ +static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ + lcp_resetci, /* Reset our Configuration Information */ + lcp_cilen, /* Length of our Configuration Information */ + lcp_addci, /* Add our Configuration Information */ + lcp_ackci, /* ACK our Configuration Information */ + lcp_nakci, /* NAK our Configuration Information */ + lcp_rejci, /* Reject our Configuration Information */ + lcp_reqci, /* Request peer's Configuration Information */ + lcp_up, /* Called when fsm reaches OPENED state */ + lcp_down, /* Called when fsm leaves OPENED state */ + lcp_starting, /* Called when we want the lower layer up */ + lcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + lcp_extcode, /* Called to handle LCP-specific codes */ + "LCP" /* String name of protocol */ }; /* @@ -269,7 +269,7 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len); static void lcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ const struct protent lcp_protent = { @@ -304,20 +304,20 @@ const struct protent lcp_protent = { /* * Length of each type of configuration option (in octets) */ -#define CILEN_VOID 2 -#define CILEN_CHAR 3 -#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ +#define CILEN_VOID 2 +#define CILEN_CHAR 3 +#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ #if CHAP_SUPPORT -#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ +#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ #endif /* CHAP_SUPPORT */ -#define CILEN_LONG 6 /* CILEN_VOID + 4 */ +#define CILEN_LONG 6 /* CILEN_VOID + 4 */ #if LQR_SUPPORT -#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ +#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ #endif /* LQR_SUPPORT */ -#define CILEN_CBCP 3 +#define CILEN_CBCP 3 -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if PPP_OPTIONS /* @@ -340,8 +340,8 @@ setendpoint(argv) char **argv; { if (str_to_epdisc(&lcp_wantoptions[0].endpoint, *argv)) { - lcp_wantoptions[0].neg_endpoint = 1; - return 1; + lcp_wantoptions[0].neg_endpoint = 1; + return 1; } option_error("Can't parse '%s' as an endpoint discriminator", *argv); return 0; @@ -353,7 +353,7 @@ printendpoint(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); + printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); } #endif /* HAVE_MULTILINK */ @@ -409,9 +409,9 @@ void lcp_open(ppp_pcb *pcb) { f->flags &= ~(OPT_PASSIVE | OPT_SILENT); if (wo->passive) - f->flags |= OPT_PASSIVE; + f->flags |= OPT_PASSIVE; if (wo->silent) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -428,25 +428,25 @@ void lcp_close(ppp_pcb *pcb, const char *reason) { && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - new_phase(pcb, PPP_PHASE_TERMINATE); + new_phase(pcb, PPP_PHASE_TERMINATE); if (f->flags & DELAYED_UP) { - UNTIMEOUT(lcp_delayed_up, f); - f->state = PPP_FSM_STOPPED; + UNTIMEOUT(lcp_delayed_up, f); + f->state = PPP_FSM_STOPPED; } oldstate = f->state; fsm_close(f, reason); if (oldstate == PPP_FSM_STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP))) { - /* - * This action is not strictly according to the FSM in RFC1548, - * but it does mean that the program terminates if you do a - * lcp_close() when a connection hasn't been established - * because we are in passive/silent mode or because we have - * delayed the fsm_lowerup() call and it hasn't happened yet. - */ - f->flags &= ~DELAYED_UP; - lcp_finished(f); + /* + * This action is not strictly according to the FSM in RFC1548, + * but it does mean that the program terminates if you do a + * lcp_close() when a connection hasn't been established + * because we are in passive/silent mode or because we have + * delayed the fsm_lowerup() call and it hasn't happened yet. + */ + f->flags &= ~DELAYED_UP; + lcp_finished(f); } } @@ -463,16 +463,16 @@ void lcp_lowerup(ppp_pcb *pcb) { * if we are going to ask for A/C and protocol compression. */ if (ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), - wo->neg_pcompression, wo->neg_accompression) < 0) - return; + || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), + wo->neg_pcompression, wo->neg_accompression) < 0) + return; pcb->peer_mru = PPP_MRU; if (pcb->settings.listen_time != 0) { - f->flags |= DELAYED_UP; - TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); + f->flags |= DELAYED_UP; + TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); } else - fsm_lowerup(f); + fsm_lowerup(f); } @@ -483,10 +483,10 @@ void lcp_lowerdown(ppp_pcb *pcb) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); } else - fsm_lowerdown(f); + fsm_lowerdown(f); } @@ -497,8 +497,8 @@ static void lcp_delayed_up(void *arg) { fsm *f = (fsm*)arg; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + fsm_lowerup(f); } } @@ -510,9 +510,9 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); + fsm_lowerup(f); } fsm_input(f, p, len); } @@ -527,33 +527,33 @@ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len) { switch( code ){ case PROTREJ: - lcp_rprotrej(f, inp, len); - break; - + lcp_rprotrej(f, inp, len); + break; + case ECHOREQ: - if (f->state != PPP_FSM_OPENED) - break; - magp = inp; - PUTLONG(go->magicnumber, magp); - fsm_sdata(f, ECHOREP, id, inp, len); - break; - + if (f->state != PPP_FSM_OPENED) + break; + magp = inp; + PUTLONG(go->magicnumber, magp); + fsm_sdata(f, ECHOREP, id, inp, len); + break; + case ECHOREP: - lcp_received_echo_reply(f, id, inp, len); - break; + lcp_received_echo_reply(f, id, inp, len); + break; case DISCREQ: case IDENTIF: case TIMEREM: - break; + break; default: - return 0; + return 0; } return 1; } - + /* * lcp_rprotrej - Receive an Protocol-Reject. * @@ -568,8 +568,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { #endif /* PPP_PROTOCOLNAME */ if (len < 2) { - LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); - return; + LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); + return; } GETSHORT(prot, inp); @@ -579,8 +579,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * OPENED state SHOULD be silently discarded. */ if( f->state != PPP_FSM_OPENED ){ - LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); - return; + LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); + return; } #if PPP_PROTOCOLNAME @@ -591,25 +591,25 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * Upcall the proper Protocol-Reject routine. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol == prot) { + if (protp->protocol == prot) { #if PPP_PROTOCOLNAME - if (pname != NULL) - ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, - prot); - else + if (pname != NULL) + ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, + prot); + else #endif /* PPP_PROTOCOLNAME */ - ppp_dbglog("Protocol-Reject for 0x%x received", prot); - (*protp->protrej)(f->pcb); - return; - } + ppp_dbglog("Protocol-Reject for 0x%x received", prot); + (*protp->protrej)(f->pcb); + return; + } #if PPP_PROTOCOLNAME if (pname != NULL) - ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, - prot); + ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, + prot); else #endif /* #if PPP_PROTOCOLNAME */ - ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); + ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); } @@ -641,7 +641,7 @@ void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len) { #endif fsm_sdata(f, PROTREJ, ++f->id, - p, len); + p, len); } @@ -748,15 +748,15 @@ static void lcp_resetci(fsm *f) { *go = *wo; #ifdef HAVE_MULTILINK if (!multilink) { - go->neg_mrru = 0; + go->neg_mrru = 0; #endif /* HAVE_MULTILINK */ - go->neg_ssnhf = 0; - go->neg_endpoint = 0; + go->neg_ssnhf = 0; + go->neg_endpoint = 0; #ifdef HAVE_MULTILINK } #endif /* HAVE_MULTILINK */ if (pcb->settings.noendpoint) - ao->neg_endpoint = 0; + ao->neg_endpoint = 0; pcb->peer_mru = PPP_MRU; #if 0 /* UNUSED */ auth_reset(pcb); @@ -771,60 +771,60 @@ static int lcp_cilen(fsm *f) { ppp_pcb *pcb = f->pcb; lcp_options *go = &pcb->lcp_gotoptions; -#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) +#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) #if CHAP_SUPPORT -#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) +#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) #endif /* CHAP_SUPPORT */ -#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) -#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) +#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) +#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) #if LQR_SUPPORT -#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) +#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) #endif /* LQR_SUPPORT */ -#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) +#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) /* * NB: we only ask for one of CHAP, UPAP, or EAP, even if we will * accept more than one. We prefer EAP first, then CHAP, then * PAP. */ return (LENCISHORT(go->neg_mru && go->mru != PPP_DEFMRU) + - LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + + LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + #if EAP_SUPPORT - LENCISHORT(go->neg_eap) + + LENCISHORT(go->neg_eap) + #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT - LENCICHAP(!go->neg_eap && go->neg_chap) + + LENCICHAP(!go->neg_eap && go->neg_chap) + #endif /* EAP_SUPPORT */ #if !EAP_SUPPORT - LENCICHAP(go->neg_chap) + + LENCICHAP(go->neg_chap) + #endif /* !EAP_SUPPORT */ #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + #endif /* EAP_SUPPORT && CHAP_SUPPORT */ #if EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(!go->neg_eap && go->neg_upap) + + LENCISHORT(!go->neg_eap && go->neg_upap) + #endif /* EAP_SUPPORT && !CHAP_SUPPORT */ #if !EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_chap && go->neg_upap) + #endif /* !EAP_SUPPORT && CHAP_SUPPORT */ #if !EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(go->neg_upap) + + LENCISHORT(go->neg_upap) + #endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT - LENCILQR(go->neg_lqr) + + LENCILQR(go->neg_lqr) + #endif /* LQR_SUPPORT */ - LENCICBCP(go->neg_cbcp) + - LENCILONG(go->neg_magicnumber) + - LENCIVOID(go->neg_pcompression) + - LENCIVOID(go->neg_accompression) + + LENCICBCP(go->neg_cbcp) + + LENCILONG(go->neg_magicnumber) + + LENCIVOID(go->neg_pcompression) + + LENCIVOID(go->neg_accompression) + #ifdef HAVE_MULTILINK - LENCISHORT(go->neg_mrru) + + LENCISHORT(go->neg_mrru) + #endif /* HAVE_MULTILINK */ - LENCIVOID(go->neg_ssnhf) + - (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); + LENCIVOID(go->neg_ssnhf) + + (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); } @@ -838,58 +838,58 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIVOID(opt, neg) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_VOID, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_VOID, ucp); \ } #define ADDCISHORT(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_SHORT, ucp); \ - PUTSHORT(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_SHORT, ucp); \ + PUTSHORT(val, ucp); \ } #if CHAP_SUPPORT #define ADDCICHAP(opt, neg, val) \ if (neg) { \ - PUTCHAR((opt), ucp); \ - PUTCHAR(CILEN_CHAP, ucp); \ - PUTSHORT(PPP_CHAP, ucp); \ - PUTCHAR((CHAP_DIGEST(val)), ucp); \ + PUTCHAR((opt), ucp); \ + PUTCHAR(CILEN_CHAP, ucp); \ + PUTSHORT(PPP_CHAP, ucp); \ + PUTCHAR((CHAP_DIGEST(val)), ucp); \ } #endif /* CHAP_SUPPORT */ #define ADDCILONG(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LONG, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LONG, ucp); \ + PUTLONG(val, ucp); \ } #if LQR_SUPPORT #define ADDCILQR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LQR, ucp); \ - PUTSHORT(PPP_LQR, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LQR, ucp); \ + PUTSHORT(PPP_LQR, ucp); \ + PUTLONG(val, ucp); \ } #endif /* LQR_SUPPORT */ #define ADDCICHAR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR, ucp); \ - PUTCHAR(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR, ucp); \ + PUTCHAR(val, ucp); \ } #define ADDCIENDP(opt, neg, class, val, len) \ if (neg) { \ - int i; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR + len, ucp); \ - PUTCHAR(class, ucp); \ - for (i = 0; i < len; ++i) \ - PUTCHAR(val[i], ucp); \ + int i; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR + len, ucp); \ + PUTCHAR(class, ucp); \ + for (i = 0; i < len; ++i) \ + PUTCHAR(val[i], ucp); \ } ADDCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ADDCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -927,11 +927,11 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #endif ADDCIVOID(CI_SSNHF, go->neg_ssnhf); ADDCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); if (ucp - start_ucp != *lenp) { - /* this should never happen, because peer_mtu should be 1500 */ - ppp_error("Bug in lcp_addci: wrong length"); + /* this should never happen, because peer_mtu should be 1500 */ + ppp_error("Bug in lcp_addci: wrong length"); } } @@ -941,8 +941,8 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { * This should not modify any state if the Ack is bad. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int lcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -958,112 +958,112 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { */ #define ACKCIVOID(opt, neg) \ if (neg) { \ - if ((len -= CILEN_VOID) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || \ - citype != opt) \ - goto bad; \ + if ((len -= CILEN_VOID) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_VOID || \ + citype != opt) \ + goto bad; \ } #define ACKCISHORT(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_SHORT) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_SHORT || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + if ((len -= CILEN_SHORT) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_SHORT || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #define ACKCICHAR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != val) \ - goto bad; \ + if ((len -= CILEN_CHAR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != val) \ + goto bad; \ } #if CHAP_SUPPORT #define ACKCICHAP(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAP) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAP || \ - citype != (opt)) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_CHAP) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != (CHAP_DIGEST(val))) \ - goto bad; \ + if ((len -= CILEN_CHAP) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAP || \ + citype != (opt)) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_CHAP) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != (CHAP_DIGEST(val))) \ + goto bad; \ } #endif /* CHAP_SUPPORT */ #define ACKCILONG(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LONG) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LONG || \ - citype != opt) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LONG) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LONG || \ + citype != opt) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #if LQR_SUPPORT #define ACKCILQR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LQR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LQR || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_LQR) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LQR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LQR || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_LQR) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #endif /* LQR_SUPPORT */ #define ACKCIENDP(opt, neg, class, val, vlen) \ if (neg) { \ - int i; \ - if ((len -= CILEN_CHAR + vlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR + vlen || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ + int i; \ + if ((len -= CILEN_CHAR + vlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR + vlen || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ } ACKCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ACKCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -1101,13 +1101,13 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ ACKCIVOID(CI_SSNHF, go->neg_ssnhf); ACKCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: LCPDEBUG(("lcp_acki: received bad Ack!")); @@ -1121,8 +1121,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1131,8 +1131,8 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_char citype, cichar, *next; u_short cishort; u32_t cilong; - lcp_options no; /* options we've seen Naks for */ - lcp_options try_; /* options to request next time */ + lcp_options no; /* options we've seen Naks for */ + lcp_options try_; /* options to request next time */ int looped_back = 0; int cilen; @@ -1146,85 +1146,85 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + no.neg = 1; \ + try_.neg = 0; \ } #if CHAP_SUPPORT #define NAKCICHAP(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #endif /* CHAP_SUPPORT */ #define NAKCICHAR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[1] == CILEN_CHAR && \ - p[0] == opt) { \ - len -= CILEN_CHAR; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAR && \ + p[1] == CILEN_CHAR && \ + p[0] == opt) { \ + len -= CILEN_CHAR; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #define NAKCISHORT(opt, neg, code) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ - code \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ } #define NAKCILONG(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #if LQR_SUPPORT #define NAKCILQR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #endif /* LQR_SUPPORT */ #define NAKCIENDP(opt, neg) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[0] == opt && \ - p[1] >= CILEN_CHAR && \ - p[1] <= len) { \ - len -= p[1]; \ - INCPTR(p[1], p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_CHAR && \ + p[0] == opt && \ + p[1] >= CILEN_CHAR && \ + p[1] <= len) { \ + len -= p[1]; \ + INCPTR(p[1], p); \ + no.neg = 1; \ + try_.neg = 0; \ } /* @@ -1239,19 +1239,19 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the limit of the default MRU we'd get if we didn't negotiate. */ if (go->neg_mru && go->mru != PPP_DEFMRU) { - NAKCISHORT(CI_MRU, neg_mru, - if (cishort <= wo->mru || cishort <= PPP_DEFMRU) - try_.mru = cishort; - ); + NAKCISHORT(CI_MRU, neg_mru, + if (cishort <= wo->mru || cishort <= PPP_DEFMRU) + try_.mru = cishort; + ); } /* * Add any characters they want to our (receive-side) asyncmap. */ if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) { - NAKCILONG(CI_ASYNCMAP, neg_asyncmap, - try_.asyncmap = go->asyncmap | cilong; - ); + NAKCILONG(CI_ASYNCMAP, neg_asyncmap, + try_.asyncmap = go->asyncmap | cilong; + ); } /* @@ -1270,125 +1270,125 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_eap #endif /* EAP_SUPPORT */ ) - && len >= CILEN_SHORT - && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { - cilen = p[1]; - len -= cilen; + && len >= CILEN_SHORT + && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { + cilen = p[1]; + len -= cilen; #if CHAP_SUPPORT - no.neg_chap = go->neg_chap; + no.neg_chap = go->neg_chap; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - no.neg_upap = go->neg_upap; + no.neg_upap = go->neg_upap; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - no.neg_eap = go->neg_eap; + no.neg_eap = go->neg_eap; #endif /* EAP_SUPPORT */ - INCPTR(2, p); - GETSHORT(cishort, p); + INCPTR(2, p); + GETSHORT(cishort, p); #if PAP_SUPPORT - if (cishort == PPP_PAP && cilen == CILEN_SHORT) { + if (cishort == PPP_PAP && cilen == CILEN_SHORT) { #if EAP_SUPPORT - /* If we were asking for EAP, then we need to stop that. */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* If we were asking for EAP, then we need to stop that. */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - /* If we were asking for CHAP, then we need to stop that. */ - if (go->neg_chap) - try_.neg_chap = 0; - else + /* If we were asking for CHAP, then we need to stop that. */ + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ - /* - * If we weren't asking for CHAP or EAP, then we were asking for - * PAP, in which case this Nak is bad. - */ - goto bad; - } else + /* + * If we weren't asking for CHAP or EAP, then we were asking for + * PAP, in which case this Nak is bad. + */ + goto bad; + } else #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { - GETCHAR(cichar, p); + if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { + GETCHAR(cichar, p); #if EAP_SUPPORT - /* Stop asking for EAP, if we were. */ - if (go->neg_eap) { - try_.neg_eap = 0; - /* Try to set up to use their suggestion, if possible */ - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else + /* Stop asking for EAP, if we were. */ + if (go->neg_eap) { + try_.neg_eap = 0; + /* Try to set up to use their suggestion, if possible */ + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else #endif /* EAP_SUPPORT */ - if (go->neg_chap) { - /* - * We were asking for our preferred algorithm, they must - * want something different. - */ - if (cichar != CHAP_DIGEST(go->chap_mdtype)) { - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { - /* Use their suggestion if we support it ... */ - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else { - /* ... otherwise, try our next-preferred algorithm. */ - try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); - if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ - try_.neg_chap = 0; - } - } else { - /* - * Whoops, they Nak'd our algorithm of choice - * but then suggested it back to us. - */ - goto bad; - } - } else { - /* - * Stop asking for PAP if we were asking for it. - */ + if (go->neg_chap) { + /* + * We were asking for our preferred algorithm, they must + * want something different. + */ + if (cichar != CHAP_DIGEST(go->chap_mdtype)) { + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { + /* Use their suggestion if we support it ... */ + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else { + /* ... otherwise, try our next-preferred algorithm. */ + try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); + if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ + try_.neg_chap = 0; + } + } else { + /* + * Whoops, they Nak'd our algorithm of choice + * but then suggested it back to us. + */ + goto bad; + } + } else { + /* + * Stop asking for PAP if we were asking for it. + */ #if PAP_SUPPORT - try_.neg_upap = 0; + try_.neg_upap = 0; #endif /* PAP_SUPPORT */ - } + } - } else + } else #endif /* CHAP_SUPPORT */ - { + { #if EAP_SUPPORT - /* - * If we were asking for EAP, and they're Conf-Naking EAP, - * well, that's just strange. Nobody should do that. - */ - if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) - ppp_dbglog("Unexpected Conf-Nak for EAP"); - - /* - * We don't recognize what they're suggesting. - * Stop asking for what we were asking for. - */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* + * If we were asking for EAP, and they're Conf-Naking EAP, + * well, that's just strange. Nobody should do that. + */ + if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) + ppp_dbglog("Unexpected Conf-Nak for EAP"); + + /* + * We don't recognize what they're suggesting. + * Stop asking for what we were asking for. + */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (go->neg_chap) - try_.neg_chap = 0; - else + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) - try_.neg_upap = 0; - else + if(1) + try_.neg_upap = 0; + else #endif /* PAP_SUPPORT */ - {} + {} - p += cilen - CILEN_SHORT; - } + p += cilen - CILEN_SHORT; + } } #if LQR_SUPPORT @@ -1398,11 +1398,11 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they Nak the reporting period, take their value XXX ? */ NAKCILQR(CI_QUALITY, neg_lqr, - if (cishort != PPP_LQR) - try_.neg_lqr = 0; - else - try_.lqr_period = cilong; - ); + if (cishort != PPP_LQR) + try_.neg_lqr = 0; + else + try_.lqr_period = cilong; + ); #endif /* LQR_SUPPORT */ /* @@ -1417,9 +1417,9 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * Check for a looped-back line. */ NAKCILONG(CI_MAGICNUMBER, neg_magicnumber, - try_.magicnumber = magic(); - looped_back = 1; - ); + try_.magicnumber = magic(); + looped_back = 1; + ); /* * Peer shouldn't send Nak for protocol compression or @@ -1435,12 +1435,12 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * than the one we want. */ if (go->neg_mrru) { - NAKCISHORT(CI_MRRU, neg_mrru, - if (treat_as_reject) - try_.neg_mrru = 0; - else if (cishort <= wo->mrru) - try_.mrru = cishort; - ); + NAKCISHORT(CI_MRRU, neg_mrru, + if (treat_as_reject) + try_.neg_mrru = 0; + else if (cishort <= wo->mrru) + try_.mrru = cishort; + ); } #else /* HAVE_MULTILINK */ LWIP_UNUSED_ARG(treat_as_reject); @@ -1475,30 +1475,30 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * negotiate some option we don't support, so ignore it. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if (cilen < CILEN_VOID || (len -= cilen) < 0) - goto bad; - next = p + cilen - 2; - - switch (citype) { - case CI_MRU: - if ((go->neg_mru && go->mru != PPP_DEFMRU) - || no.neg_mru || cilen != CILEN_SHORT) - goto bad; - GETSHORT(cishort, p); - if (cishort < PPP_DEFMRU) { - try_.neg_mru = 1; - try_.mru = cishort; - } - break; - case CI_ASYNCMAP: - if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) - || no.neg_asyncmap || cilen != CILEN_LONG) - goto bad; - break; - case CI_AUTHTYPE: - if (0 + GETCHAR(citype, p); + GETCHAR(cilen, p); + if (cilen < CILEN_VOID || (len -= cilen) < 0) + goto bad; + next = p + cilen - 2; + + switch (citype) { + case CI_MRU: + if ((go->neg_mru && go->mru != PPP_DEFMRU) + || no.neg_mru || cilen != CILEN_SHORT) + goto bad; + GETSHORT(cishort, p); + if (cishort < PPP_DEFMRU) { + try_.neg_mru = 1; + try_.mru = cishort; + } + break; + case CI_ASYNCMAP: + if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + || no.neg_asyncmap || cilen != CILEN_LONG) + goto bad; + break; + case CI_AUTHTYPE: + if (0 #if CHAP_SUPPORT || go->neg_chap || no.neg_chap #endif /* CHAP_SUPPORT */ @@ -1506,51 +1506,51 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_upap || no.neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap || no.neg_eap + || go->neg_eap || no.neg_eap #endif /* EAP_SUPPORT */ - ) - goto bad; - break; - case CI_MAGICNUMBER: - if (go->neg_magicnumber || no.neg_magicnumber || - cilen != CILEN_LONG) - goto bad; - break; - case CI_PCOMPRESSION: - if (go->neg_pcompression || no.neg_pcompression - || cilen != CILEN_VOID) - goto bad; - break; - case CI_ACCOMPRESSION: - if (go->neg_accompression || no.neg_accompression - || cilen != CILEN_VOID) - goto bad; - break; + ) + goto bad; + break; + case CI_MAGICNUMBER: + if (go->neg_magicnumber || no.neg_magicnumber || + cilen != CILEN_LONG) + goto bad; + break; + case CI_PCOMPRESSION: + if (go->neg_pcompression || no.neg_pcompression + || cilen != CILEN_VOID) + goto bad; + break; + case CI_ACCOMPRESSION: + if (go->neg_accompression || no.neg_accompression + || cilen != CILEN_VOID) + goto bad; + break; #if LQR_SUPPORT - case CI_QUALITY: - if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) - goto bad; - break; + case CI_QUALITY: + if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) + goto bad; + break; #endif /* LQR_SUPPORT */ #ifdef HAVE_MULTILINK - case CI_MRRU: - if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) - goto bad; - break; + case CI_MRRU: + if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) + goto bad; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) - goto bad; - try_.neg_ssnhf = 1; - break; - case CI_EPDISC: - if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) - goto bad; - break; - default: - break; - } - p = next; + case CI_SSNHF: + if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) + goto bad; + try_.neg_ssnhf = 1; + break; + case CI_EPDISC: + if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) + goto bad; + break; + default: + break; + } + p = next; } /* @@ -1558,15 +1558,15 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any options left we ignore them. */ if (f->state != PPP_FSM_OPENED) { - if (looped_back) { - if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { - ppp_notice("Serial line is looped back."); - pcb->err_code = PPPERR_LOOPBACK; - lcp_close(f->pcb, "Loopback detected"); - } - } else - try_.numloops = 0; - *go = try_; + if (looped_back) { + if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { + ppp_notice("Serial line is looped back."); + pcb->err_code = PPPERR_LOOPBACK; + lcp_close(f->pcb, "Loopback detected"); + } + } else + try_.numloops = 0; + *go = try_; } return 1; @@ -1583,8 +1583,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Reject was bad. - * 1 - Reject was good. + * 0 - Reject was bad. + * 1 - Reject was good. */ static int lcp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -1592,7 +1592,7 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { u_char cichar; u_short cishort; u32_t cilong; - lcp_options try_; /* options to request next time */ + lcp_options try_; /* options to request next time */ try_ = *go; @@ -1603,157 +1603,157 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + try_.neg = 0; \ } #define REJCISHORT(opt, neg, val) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #if CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT */ #define REJCILONG(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LQR_SUPPORT #define REJCILQR(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cishort != PPP_LQR || cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cishort != PPP_LQR || cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LQR_SUPPORT */ #define REJCICBCP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CBCP && \ - p[1] == CILEN_CBCP && \ - p[0] == opt) { \ - len -= CILEN_CBCP; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if (cichar != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CBCP && \ + p[1] == CILEN_CBCP && \ + p[0] == opt) { \ + len -= CILEN_CBCP; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if (cichar != val) \ + goto bad; \ + try_.neg = 0; \ } #define REJCIENDP(opt, neg, class, val, vlen) \ if (go->neg && \ - len >= CILEN_CHAR + vlen && \ - p[0] == opt && \ - p[1] == CILEN_CHAR + vlen) { \ - int i; \ - len -= CILEN_CHAR + vlen; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ - try_.neg = 0; \ + len >= CILEN_CHAR + vlen && \ + p[0] == opt && \ + p[1] == CILEN_CHAR + vlen) { \ + int i; \ + len -= CILEN_CHAR + vlen; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ + try_.neg = 0; \ } REJCISHORT(CI_MRU, neg_mru, go->mru); @@ -1763,14 +1763,14 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { if (!go->neg_eap) { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); - if (!go->neg_chap) { + REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); + if (!go->neg_chap) { #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); + REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - } + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT } @@ -1787,18 +1787,18 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ REJCIVOID(CI_SSNHF, neg_ssnhf); REJCIENDP(CI_EPDISC, neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1822,17 +1822,17 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { lcp_options *go = &pcb->lcp_gotoptions; lcp_options *ho = &pcb->lcp_hisoptions; lcp_options *ao = &pcb->lcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - int cilen, citype, cichar; /* Parsed len, type, char value */ - u_short cishort; /* Parsed short value */ - u32_t cilong; /* Parse long value */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *rejp; /* Pointer to next char in reject frame */ + u_char *cip, *next; /* Pointer to current and next CIs */ + int cilen, citype, cichar; /* Parsed len, type, char value */ + u_short cishort; /* Parsed short value */ + u32_t cilong; /* Parse long value */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *rejp; /* Pointer to next char in reject frame */ struct pbuf *nakp; /* Nak buffer */ - u_char *nakoutp; /* Pointer to next char in Nak frame */ - int l = *lenp; /* Length left */ + u_char *nakoutp; /* Pointer to next char in Nak frame */ + int l = *lenp; /* Length left */ /* * Reset all his options. @@ -1854,403 +1854,403 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { nakoutp = (u_char*)nakp->payload; rejp = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - LCPDEBUG(("lcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - citype = 0; - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_MRU: - if (!ao->neg_mru || /* Allow option? */ - cilen != CILEN_SHORT) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETSHORT(cishort, p); /* Parse MRU */ - - /* - * He must be able to receive at least our minimum. - * No need to check a maximum. If he sends a large number, - * we'll just ignore it. - */ - if (cishort < PPP_MINMRU) { - orc = CONFNAK; /* Nak CI */ - PUTCHAR(CI_MRU, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ - break; - } - ho->neg_mru = 1; /* Remember he sent MRU */ - ho->mru = cishort; /* And remember value */ - break; - - case CI_ASYNCMAP: - if (!ao->neg_asyncmap || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * Asyncmap must have set at least the bits - * which are set in lcp_allowoptions[unit].asyncmap. - */ - if ((ao->asyncmap & ~cilong) != 0) { - orc = CONFNAK; - PUTCHAR(CI_ASYNCMAP, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(ao->asyncmap | cilong, nakoutp); - break; - } - ho->neg_asyncmap = 1; - ho->asyncmap = cilong; - break; - - case CI_AUTHTYPE: - if (cilen < CILEN_SHORT || - !(0 + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + LCPDEBUG(("lcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + citype = 0; + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_MRU: + if (!ao->neg_mru || /* Allow option? */ + cilen != CILEN_SHORT) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETSHORT(cishort, p); /* Parse MRU */ + + /* + * He must be able to receive at least our minimum. + * No need to check a maximum. If he sends a large number, + * we'll just ignore it. + */ + if (cishort < PPP_MINMRU) { + orc = CONFNAK; /* Nak CI */ + PUTCHAR(CI_MRU, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ + break; + } + ho->neg_mru = 1; /* Remember he sent MRU */ + ho->mru = cishort; /* And remember value */ + break; + + case CI_ASYNCMAP: + if (!ao->neg_asyncmap || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * Asyncmap must have set at least the bits + * which are set in lcp_allowoptions[unit].asyncmap. + */ + if ((ao->asyncmap & ~cilong) != 0) { + orc = CONFNAK; + PUTCHAR(CI_ASYNCMAP, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(ao->asyncmap | cilong, nakoutp); + break; + } + ho->neg_asyncmap = 1; + ho->asyncmap = cilong; + break; + + case CI_AUTHTYPE: + if (cilen < CILEN_SHORT || + !(0 #if PAP_SUPPORT - || ao->neg_upap + || ao->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || ao->neg_chap + || ao->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ao->neg_eap + || ao->neg_eap #endif /* EAP_SUPPORT */ - )) { - /* - * Reject the option if we're not willing to authenticate. - */ - ppp_dbglog("No auth is possible"); - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - /* - * Authtype must be PAP, CHAP, or EAP. - * - * Note: if more than one of ao->neg_upap, ao->neg_chap, and - * ao->neg_eap are set, and the peer sends a Configure-Request - * with two or more authenticate-protocol requests, then we will - * reject the second request. - * Whether we end up doing CHAP, UPAP, or EAP depends then on - * the ordering of the CIs in the peer's Configure-Request. + )) { + /* + * Reject the option if we're not willing to authenticate. + */ + ppp_dbglog("No auth is possible"); + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + /* + * Authtype must be PAP, CHAP, or EAP. + * + * Note: if more than one of ao->neg_upap, ao->neg_chap, and + * ao->neg_eap are set, and the peer sends a Configure-Request + * with two or more authenticate-protocol requests, then we will + * reject the second request. + * Whether we end up doing CHAP, UPAP, or EAP depends then on + * the ordering of the CIs in the peer's Configure-Request. */ #if PAP_SUPPORT - if (cishort == PPP_PAP) { - /* we've already accepted CHAP or EAP */ - if (0 + if (cishort == PPP_PAP) { + /* we've already accepted CHAP or EAP */ + if (0 #if CHAP_SUPPORT - || ho->neg_chap + || ho->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ho->neg_eap + || ho->neg_eap #endif /* EAP_SUPPORT */ - || cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_upap) { /* we don't want to do PAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + || cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_upap) { /* we don't want to do PAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else { + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - } + } #endif /* EAP_SUPPORT */ - break; - } - ho->neg_upap = 1; - break; - } + break; + } + ho->neg_upap = 1; + break; + } #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP) { - /* we've already accepted PAP or EAP */ - if ( + if (cishort == PPP_CHAP) { + /* we've already accepted PAP or EAP */ + if ( #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - ho->neg_eap || + ho->neg_eap || #endif /* EAP_SUPPORT */ - cilen != CILEN_CHAP) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_chap) { /* we don't want to do CHAP */ - orc = CONFNAK; /* NAK it and suggest EAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); + cilen != CILEN_CHAP) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_chap) { /* we don't want to do CHAP */ + orc = CONFNAK; /* NAK it and suggest EAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTSHORT(PPP_PAP, nakoutp); - } - else + if(1) { + PUTSHORT(PPP_PAP, nakoutp); + } + else #endif /* PAP_SUPPORT */ - {} - break; - } - GETCHAR(cichar, p); /* get digest type */ - if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { - /* - * We can't/won't do the requested type, - * suggest something else. - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - break; - } - ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ - ho->neg_chap = 1; - break; - } + {} + break; + } + GETCHAR(cichar, p); /* get digest type */ + if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { + /* + * We can't/won't do the requested type, + * suggest something else. + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + break; + } + ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ + ho->neg_chap = 1; + break; + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - if (cishort == PPP_EAP) { - /* we've already accepted CHAP or PAP */ - if ( + if (cishort == PPP_EAP) { + /* we've already accepted CHAP or PAP */ + if ( #if CHAP_SUPPORT - ho->neg_chap || + ho->neg_chap || #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ - cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_eap) { /* we don't want to do EAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_eap) { /* we don't want to do EAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; - } - ho->neg_eap = 1; - break; - } + {} + break; + } + ho->neg_eap = 1; + break; + } #endif /* EAP_SUPPORT */ - /* - * We don't recognize the protocol they're asking for. - * Nak it with something we're willing to do. - * (At this point we know ao->neg_upap || ao->neg_chap || - * ao->neg_eap.) - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); + /* + * We don't recognize the protocol they're asking for. + * Nak it with something we're willing to do. + * (At this point we know ao->neg_upap || ao->neg_chap || + * ao->neg_eap.) + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; + {} + break; #if LQR_SUPPORT - case CI_QUALITY: - if (!ao->neg_lqr || - cilen != CILEN_LQR) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - GETLONG(cilong, p); - - /* - * Check the protocol and the reporting period. - * XXX When should we Nak this, and what with? - */ - if (cishort != PPP_LQR) { - orc = CONFNAK; - PUTCHAR(CI_QUALITY, nakoutp); - PUTCHAR(CILEN_LQR, nakoutp); - PUTSHORT(PPP_LQR, nakoutp); - PUTLONG(ao->lqr_period, nakoutp); - break; - } - break; + case CI_QUALITY: + if (!ao->neg_lqr || + cilen != CILEN_LQR) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + GETLONG(cilong, p); + + /* + * Check the protocol and the reporting period. + * XXX When should we Nak this, and what with? + */ + if (cishort != PPP_LQR) { + orc = CONFNAK; + PUTCHAR(CI_QUALITY, nakoutp); + PUTCHAR(CILEN_LQR, nakoutp); + PUTSHORT(PPP_LQR, nakoutp); + PUTLONG(ao->lqr_period, nakoutp); + break; + } + break; #endif /* LQR_SUPPORT */ - case CI_MAGICNUMBER: - if (!(ao->neg_magicnumber || go->neg_magicnumber) || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * He must have a different magic number. - */ - if (go->neg_magicnumber && - cilong == go->magicnumber) { - cilong = magic(); /* Don't put magic() inside macro! */ - orc = CONFNAK; - PUTCHAR(CI_MAGICNUMBER, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(cilong, nakoutp); - break; - } - ho->neg_magicnumber = 1; - ho->magicnumber = cilong; - break; - - - case CI_PCOMPRESSION: - if (!ao->neg_pcompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_pcompression = 1; - break; - - case CI_ACCOMPRESSION: - if (!ao->neg_accompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_accompression = 1; - break; + case CI_MAGICNUMBER: + if (!(ao->neg_magicnumber || go->neg_magicnumber) || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * He must have a different magic number. + */ + if (go->neg_magicnumber && + cilong == go->magicnumber) { + cilong = magic(); /* Don't put magic() inside macro! */ + orc = CONFNAK; + PUTCHAR(CI_MAGICNUMBER, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(cilong, nakoutp); + break; + } + ho->neg_magicnumber = 1; + ho->magicnumber = cilong; + break; + + + case CI_PCOMPRESSION: + if (!ao->neg_pcompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_pcompression = 1; + break; + + case CI_ACCOMPRESSION: + if (!ao->neg_accompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_accompression = 1; + break; #ifdef HAVE_MULTILINK - case CI_MRRU: - if (!ao->neg_mrru - || !multilink - || cilen != CILEN_SHORT) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - /* possibly should insist on a minimum/maximum MRRU here */ - ho->neg_mrru = 1; - ho->mrru = cishort; - break; + case CI_MRRU: + if (!ao->neg_mrru + || !multilink + || cilen != CILEN_SHORT) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + /* possibly should insist on a minimum/maximum MRRU here */ + ho->neg_mrru = 1; + ho->mrru = cishort; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (!ao->neg_ssnhf + case CI_SSNHF: + if (!ao->neg_ssnhf #ifdef HAVE_MULTILINK - || !multilink + || !multilink #endif /* HAVE_MULTILINK */ - || cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_ssnhf = 1; - break; - - case CI_EPDISC: - if (!ao->neg_endpoint || - cilen < CILEN_CHAR || - cilen > CILEN_CHAR + MAX_ENDP_LEN) { - orc = CONFREJ; - break; - } - GETCHAR(cichar, p); - cilen -= CILEN_CHAR; - ho->neg_endpoint = 1; - ho->endpoint.class_ = cichar; - ho->endpoint.length = cilen; - MEMCPY(ho->endpoint.value, p, cilen); - INCPTR(cilen, p); - break; - - default: - LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); - orc = CONFREJ; - break; - } + || cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_ssnhf = 1; + break; + + case CI_EPDISC: + if (!ao->neg_endpoint || + cilen < CILEN_CHAR || + cilen > CILEN_CHAR + MAX_ENDP_LEN) { + orc = CONFREJ; + break; + } + GETCHAR(cichar, p); + cilen -= CILEN_CHAR; + ho->neg_endpoint = 1; + ho->endpoint.class_ = cichar; + ho->endpoint.length = cilen; + MEMCPY(ho->endpoint.value, p, cilen); + INCPTR(cilen, p); + break; + + default: + LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree /* Getting fed up with sending NAKs? */ - && citype != CI_MAGICNUMBER) { - orc = CONFREJ; /* Get tough if so */ - } else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - rc = CONFNAK; - } - } - if (orc == CONFREJ) { /* Reject this CI */ - rc = CONFREJ; - if (cip != rejp) /* Need to move rejected CI? */ - MEMCPY(rejp, cip, cilen); /* Move it */ - INCPTR(cilen, rejp); /* Update output pointer */ - } + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree /* Getting fed up with sending NAKs? */ + && citype != CI_MAGICNUMBER) { + orc = CONFREJ; /* Get tough if so */ + } else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + rc = CONFNAK; + } + } + if (orc == CONFREJ) { /* Reject this CI */ + rc = CONFREJ; + if (cip != rejp) /* Need to move rejected CI? */ + MEMCPY(rejp, cip, cilen); /* Move it */ + INCPTR(cilen, rejp); /* Update output pointer */ + } } /* @@ -2262,25 +2262,25 @@ endswitch: switch (rc) { case CONFACK: - *lenp = next - inp; - break; + *lenp = next - inp; + break; case CONFNAK: - /* - * Copy the Nak'd options from the nak buffer to the caller's buffer. - */ - *lenp = nakoutp - (u_char*)nakp->payload; - MEMCPY(inp, nakp->payload, *lenp); - break; + /* + * Copy the Nak'd options from the nak buffer to the caller's buffer. + */ + *lenp = nakoutp - (u_char*)nakp->payload; + MEMCPY(inp, nakp->payload, *lenp); + break; case CONFREJ: - *lenp = rejp - inp; - break; + *lenp = rejp - inp; + break; default: - break; + break; } pbuf_free(nakp); LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -2296,9 +2296,9 @@ static void lcp_up(fsm *f) { int mtu, mru; if (!go->neg_magicnumber) - go->magicnumber = 0; + go->magicnumber = 0; if (!ho->neg_magicnumber) - ho->magicnumber = 0; + ho->magicnumber = 0; /* * Set our MTU to the smaller of the MTU we wanted and @@ -2314,16 +2314,16 @@ static void lcp_up(fsm *f) { #ifdef HAVE_MULTILINK if (!(multilink && go->neg_mrru && ho->neg_mrru)) #endif /* HAVE_MULTILINK */ - netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); + netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); ppp_send_config(pcb, mtu, - (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), - ho->neg_pcompression, ho->neg_accompression); + (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), + ho->neg_pcompression, ho->neg_accompression); ppp_recv_config(pcb, mru, - (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); if (ho->neg_mru) - pcb->peer_mru = ho->mru; + pcb->peer_mru = ho->mru; lcp_echo_lowerup(f->pcb); /* Enable echo messages */ @@ -2346,8 +2346,8 @@ static void lcp_down(fsm *f) { ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0); ppp_recv_config(pcb, PPP_MRU, - (go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); pcb->peer_mru = PPP_MRU; } @@ -2382,25 +2382,25 @@ static const char* const lcp_codenames[] = { }; static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen, i; const u_char *pstart, *optend; u_short cishort; u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(lcp_codenames)) - printer(arg, " %s", lcp_codenames[code-1]); + printer(arg, " %s", lcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2408,224 +2408,224 @@ static int lcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_MRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mru %d", cishort); - } - break; - case CI_ASYNCMAP: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "asyncmap 0x%x", cilong); - } - break; - case CI_AUTHTYPE: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "auth "); - GETSHORT(cishort, p); - switch (cishort) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_MRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mru %d", cishort); + } + break; + case CI_ASYNCMAP: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "asyncmap 0x%x", cilong); + } + break; + case CI_AUTHTYPE: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "auth "); + GETSHORT(cishort, p); + switch (cishort) { #if PAP_SUPPORT - case PPP_PAP: - printer(arg, "pap"); - break; + case PPP_PAP: + printer(arg, "pap"); + break; #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - case PPP_CHAP: - printer(arg, "chap"); - if (p < optend) { - switch (*p) { - case CHAP_MD5: - printer(arg, " MD5"); - ++p; - break; + case PPP_CHAP: + printer(arg, "chap"); + if (p < optend) { + switch (*p) { + case CHAP_MD5: + printer(arg, " MD5"); + ++p; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - printer(arg, " MS"); - ++p; - break; - - case CHAP_MICROSOFT_V2: - printer(arg, " MS-v2"); - ++p; - break; + case CHAP_MICROSOFT: + printer(arg, " MS"); + ++p; + break; + + case CHAP_MICROSOFT_V2: + printer(arg, " MS-v2"); + ++p; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - } - break; + default: + break; + } + } + break; #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - case PPP_EAP: - printer(arg, "eap"); - break; + case PPP_EAP: + printer(arg, "eap"); + break; #endif /* EAP_SUPPORT */ - default: - printer(arg, "0x%x", cishort); - } - } - break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #if LQR_SUPPORT - case CI_QUALITY: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "quality "); - GETSHORT(cishort, p); - switch (cishort) { - case PPP_LQR: - printer(arg, "lqr"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_QUALITY: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "quality "); + GETSHORT(cishort, p); + switch (cishort) { + case PPP_LQR: + printer(arg, "lqr"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* LQR_SUPPORT */ - case CI_CALLBACK: - if (olen >= CILEN_CHAR) { - p += 2; - printer(arg, "callback "); - GETCHAR(cishort, p); - switch (cishort) { - case CBCP_OPT: - printer(arg, "CBCP"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_MAGICNUMBER: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "magic 0x%x", cilong); - } - break; - case CI_PCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "pcomp"); - } - break; - case CI_ACCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "accomp"); - } - break; - case CI_MRRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mrru %d", cishort); - } - break; - case CI_SSNHF: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "ssnhf"); - } - break; - case CI_EPDISC: + case CI_CALLBACK: + if (olen >= CILEN_CHAR) { + p += 2; + printer(arg, "callback "); + GETCHAR(cishort, p); + switch (cishort) { + case CBCP_OPT: + printer(arg, "CBCP"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; + case CI_MAGICNUMBER: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "magic 0x%x", cilong); + } + break; + case CI_PCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "pcomp"); + } + break; + case CI_ACCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "accomp"); + } + break; + case CI_MRRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mrru %d", cishort); + } + break; + case CI_SSNHF: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "ssnhf"); + } + break; + case CI_EPDISC: #ifdef HAVE_MULTILINK - if (olen >= CILEN_CHAR) { - struct epdisc epd; - p += 2; - GETCHAR(epd.class, p); - epd.length = olen - CILEN_CHAR; - if (epd.length > MAX_ENDP_LEN) - epd.length = MAX_ENDP_LEN; - if (epd.length > 0) { - MEMCPY(epd.value, p, epd.length); - p += epd.length; - } - printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); - } + if (olen >= CILEN_CHAR) { + struct epdisc epd; + p += 2; + GETCHAR(epd.class, p); + epd.length = olen - CILEN_CHAR; + if (epd.length > MAX_ENDP_LEN) + epd.length = MAX_ENDP_LEN; + if (epd.length > 0) { + MEMCPY(epd.value, p, epd.length); + p += epd.length; + } + printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); + } #else - printer(arg, "endpoint"); + printer(arg, "endpoint"); #endif - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; case ECHOREQ: case ECHOREP: case DISCREQ: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + break; case IDENTIF: case TIMEREM: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - if (code == TIMEREM) { - if (len < 4) - break; - GETLONG(cilong, p); - printer(arg, " seconds=%u", cilong); - len -= 4; - } - if (len > 0) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + if (code == TIMEREM) { + if (len < 4) + break; + GETLONG(cilong, p); + printer(arg, " seconds=%u", cilong); + len -= 4; + } + if (len > 0) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (i = 0; i < len && i < 32; ++i) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } if (i < len) { - printer(arg, " ..."); - p += len - i; + printer(arg, " ..."); + p += len - i; } return p - pstart; @@ -2639,10 +2639,10 @@ static int lcp_printpkt(const u_char *p, int plen, static void LcpLinkFailure(fsm *f) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED) { - ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); + ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); ppp_notice("Serial link appears to be disconnected."); - pcb->err_code = PPPERR_PEERDEAD; - lcp_close(pcb, "Peer not responding"); + pcb->err_code = PPPERR_PEERDEAD; + lcp_close(pcb, "Peer not responding"); } } @@ -2655,13 +2655,13 @@ static void LcpEchoCheck(fsm *f) { LcpSendEchoRequest (f); if (f->state != PPP_FSM_OPENED) - return; + return; /* * Start the timer for the next interval. */ if (pcb->lcp_echo_timer_running) - ppp_warn("assertion lcp_echo_timer_running==0 failed"); + ppp_warn("assertion lcp_echo_timer_running==0 failed"); TIMEOUT (LcpEchoTimeout, f, pcb->settings.lcp_echo_interval); pcb->lcp_echo_timer_running = 1; } @@ -2691,14 +2691,14 @@ static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) { /* Check the magic number - don't count replies from ourselves. */ if (len < 4) { - ppp_dbglog("lcp: received short Echo-Reply, length %d", len); - return; + ppp_dbglog("lcp: received short Echo-Reply, length %d", len); + return; } GETLONG(magic_val, inp); if (go->neg_magicnumber - && magic_val == go->magicnumber) { - ppp_warn("appear to have received our own echo-reply!"); - return; + && magic_val == go->magicnumber) { + ppp_warn("appear to have received our own echo-reply!"); + return; } /* Reset the number of outstanding echo frames */ @@ -2722,7 +2722,7 @@ static void LcpSendEchoRequest(fsm *f) { if (pcb->lcp_echos_pending >= pcb->settings.lcp_echo_fails) { LcpLinkFailure(f); pcb->lcp_echos_pending = 0; - } + } } #if PPP_LCP_ADAPTIVE @@ -2731,17 +2731,17 @@ static void LcpSendEchoRequest(fsm *f) { * no traffic was received since the last one. */ if (pcb->settings.lcp_echo_adaptive) { - static unsigned int last_pkts_in = 0; + static unsigned int last_pkts_in = 0; #if PPP_STATS_SUPPORT - update_link_stats(f->unit); - link_stats_valid = 0; + update_link_stats(f->unit); + link_stats_valid = 0; #endif /* PPP_STATS_SUPPORT */ - if (link_stats.pkts_in != last_pkts_in) { - last_pkts_in = link_stats.pkts_in; - return; - } + if (link_stats.pkts_in != last_pkts_in) { + last_pkts_in = link_stats.pkts_in; + return; + } } #endif @@ -2750,10 +2750,10 @@ static void LcpSendEchoRequest(fsm *f) { */ if (f->state == PPP_FSM_OPENED) { lcp_magic = go->magicnumber; - pktp = pkt; - PUTLONG(lcp_magic, pktp); + pktp = pkt; + PUTLONG(lcp_magic, pktp); fsm_sdata(f, ECHOREQ, pcb->lcp_echo_number++, pkt, pktp - pkt); - ++pcb->lcp_echos_pending; + ++pcb->lcp_echos_pending; } } @@ -2768,7 +2768,7 @@ static void lcp_echo_lowerup(ppp_pcb *pcb) { pcb->lcp_echos_pending = 0; pcb->lcp_echo_number = 0; pcb->lcp_echo_timer_running = 0; - + /* If a timeout interval is specified then start the timer */ if (pcb->settings.lcp_echo_interval != 0) LcpEchoCheck (f); diff --git a/components/net/lwip-2.0.2/src/netif/ppp/mppe.c b/components/net/lwip-2.0.2/src/netif/ppp/mppe.c index 331039f8ed..5cab8a407e 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/mppe.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/mppe.c @@ -39,20 +39,20 @@ #define SHA1_SIGNATURE_SIZE 20 /* ppp_mppe_state.bits definitions */ -#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ -#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ -#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ -#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ +#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ +#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ +#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ +#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ -#define MPPE_BIT_FLUSHED MPPE_BIT_A -#define MPPE_BIT_ENCRYPTED MPPE_BIT_D +#define MPPE_BIT_FLUSHED MPPE_BIT_A +#define MPPE_BIT_ENCRYPTED MPPE_BIT_D #define MPPE_BITS(p) ((p)[0] & 0xf0) #define MPPE_CCOUNT(p) ((((p)[0] & 0x0f) << 8) + (p)[1]) -#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ +#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ -#define MPPE_OVHD 2 /* MPPE overhead/packet */ -#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ +#define MPPE_OVHD 2 /* MPPE overhead/packet */ +#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ /* * Perform the MPPE rekey algorithm, from RFC 3078, sec. 7.3. @@ -60,37 +60,37 @@ */ static void mppe_rekey(ppp_mppe_state * state, int initial_key) { - lwip_sha1_context sha1_ctx; - u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; - - /* - * Key Derivation, from RFC 3078, RFC 3079. - * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. - */ - lwip_sha1_init(&sha1_ctx); - lwip_sha1_starts(&sha1_ctx); - lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); - lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); - lwip_sha1_finish(&sha1_ctx, sha1_digest); - lwip_sha1_free(&sha1_ctx); - MEMCPY(state->session_key, sha1_digest, state->keylen); - - if (!initial_key) { - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); - lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); - lwip_arc4_free(&state->arc4); - } - if (state->keylen == 8) { - /* See RFC 3078 */ - state->session_key[0] = 0xd1; - state->session_key[1] = 0x26; - state->session_key[2] = 0x9e; - } - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); + lwip_sha1_context sha1_ctx; + u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; + + /* + * Key Derivation, from RFC 3078, RFC 3079. + * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. + */ + lwip_sha1_init(&sha1_ctx); + lwip_sha1_starts(&sha1_ctx); + lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1_ctx, sha1_digest); + lwip_sha1_free(&sha1_ctx); + MEMCPY(state->session_key, sha1_digest, state->keylen); + + if (!initial_key) { + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); + lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); + lwip_arc4_free(&state->arc4); + } + if (state->keylen == 8) { + /* See RFC 3078 */ + state->session_key[0] = 0xd1; + state->session_key[1] = 0x26; + state->session_key[2] = 0x9e; + } + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); } /* @@ -98,8 +98,8 @@ static void mppe_rekey(ppp_mppe_state * state, int initial_key) * don't have to keep multiple copies of keys. */ void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key) { - LWIP_UNUSED_ARG(pcb); - MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); + LWIP_UNUSED_ARG(pcb); + MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); } /* @@ -109,64 +109,64 @@ void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) { #if PPP_DEBUG - const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; - if (&pcb->mppe_decomp == state) { - debugstr = (const u8_t*)"mppe_decomp_init"; - } + const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; + if (&pcb->mppe_decomp == state) { + debugstr = (const u8_t*)"mppe_decomp_init"; + } #endif /* PPP_DEBUG */ - /* Save keys. */ - MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); - - if (options & MPPE_OPT_128) - state->keylen = 16; - else if (options & MPPE_OPT_40) - state->keylen = 8; - else { - PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, - pcb->netif->num)); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - return; - } - if (options & MPPE_OPT_STATEFUL) - state->stateful = 1; - - /* Generate the initial session key. */ - mppe_rekey(state, 1); + /* Save keys. */ + MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); + + if (options & MPPE_OPT_128) + state->keylen = 16; + else if (options & MPPE_OPT_40) + state->keylen = 8; + else { + PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, + pcb->netif->num)); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + return; + } + if (options & MPPE_OPT_STATEFUL) + state->stateful = 1; + + /* Generate the initial session key. */ + mppe_rekey(state, 1); #if PPP_DEBUG - { - int i; - char mkey[sizeof(state->master_key) * 2 + 1]; - char skey[sizeof(state->session_key) * 2 + 1]; - - PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", - debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, - (state->stateful) ? "stateful" : "stateless")); - - for (i = 0; i < (int)sizeof(state->master_key); i++) - sprintf(mkey + i * 2, "%02x", state->master_key[i]); - for (i = 0; i < (int)sizeof(state->session_key); i++) - sprintf(skey + i * 2, "%02x", state->session_key[i]); - PPPDEBUG(LOG_DEBUG, - ("%s[%d]: keys: master: %s initial session: %s\n", - debugstr, pcb->netif->num, mkey, skey)); - } + { + int i; + char mkey[sizeof(state->master_key) * 2 + 1]; + char skey[sizeof(state->session_key) * 2 + 1]; + + PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", + debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, + (state->stateful) ? "stateful" : "stateless")); + + for (i = 0; i < (int)sizeof(state->master_key); i++) + sprintf(mkey + i * 2, "%02x", state->master_key[i]); + for (i = 0; i < (int)sizeof(state->session_key); i++) + sprintf(skey + i * 2, "%02x", state->session_key[i]); + PPPDEBUG(LOG_DEBUG, + ("%s[%d]: keys: master: %s initial session: %s\n", + debugstr, pcb->netif->num, mkey, skey)); + } #endif /* PPP_DEBUG */ - /* - * Initialize the coherency count. The initial value is not specified - * in RFC 3078, but we can make a reasonable assumption that it will - * start at 0. Setting it to the max here makes the comp/decomp code - * do the right thing (determined through experiment). - */ - state->ccount = MPPE_CCOUNT_SPACE - 1; - - /* - * Note that even though we have initialized the key table, we don't - * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. - */ - state->bits = MPPE_BIT_ENCRYPTED; + /* + * Initialize the coherency count. The initial value is not specified + * in RFC 3078, but we can make a reasonable assumption that it will + * start at 0. Setting it to the max here makes the comp/decomp code + * do the right thing (determined through experiment). + */ + state->ccount = MPPE_CCOUNT_SPACE - 1; + + /* + * Note that even though we have initialized the key table, we don't + * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. + */ + state->bits = MPPE_BIT_ENCRYPTED; } /* @@ -180,8 +180,8 @@ mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) */ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - state->bits |= MPPE_BIT_FLUSHED; + LWIP_UNUSED_ARG(pcb); + state->bits |= MPPE_BIT_FLUSHED; } /* @@ -192,74 +192,74 @@ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol) { - struct pbuf *n, *np; - u8_t *pl; - err_t err; - - LWIP_UNUSED_ARG(pcb); - - /* TCP stack requires that we don't change the packet payload, therefore we copy - * the whole packet before encryption. - */ - np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_POOL); - if (!np) { - return ERR_MEM; - } - - /* Hide MPPE header + protocol */ - pbuf_header(np, -(s16_t)(MPPE_OVHD + sizeof(protocol))); - - if ((err = pbuf_copy(np, *pb)) != ERR_OK) { - pbuf_free(np); - return err; - } - - /* Reveal MPPE header + protocol */ - pbuf_header(np, (s16_t)(MPPE_OVHD + sizeof(protocol))); - - *pb = np; - pl = (u8_t*)np->payload; - - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); - /* FIXME: use PUT* macros */ - pl[0] = state->ccount>>8; - pl[1] = state->ccount; - - if (!state->stateful || /* stateless mode */ - ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ - (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ - /* We must rekey */ - if (state->stateful) { - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); - } - mppe_rekey(state, 0); - state->bits |= MPPE_BIT_FLUSHED; - } - pl[0] |= state->bits; - state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ - pl += MPPE_OVHD; - - /* Add protocol */ - /* FIXME: add PFC support */ - pl[0] = protocol >> 8; - pl[1] = protocol; - - /* Hide MPPE header */ - pbuf_header(np, -(s16_t)MPPE_OVHD); - - /* Encrypt packet */ - for (n = np; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* Reveal MPPE header */ - pbuf_header(np, (s16_t)MPPE_OVHD); - - return ERR_OK; + struct pbuf *n, *np; + u8_t *pl; + err_t err; + + LWIP_UNUSED_ARG(pcb); + + /* TCP stack requires that we don't change the packet payload, therefore we copy + * the whole packet before encryption. + */ + np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_POOL); + if (!np) { + return ERR_MEM; + } + + /* Hide MPPE header + protocol */ + pbuf_header(np, -(s16_t)(MPPE_OVHD + sizeof(protocol))); + + if ((err = pbuf_copy(np, *pb)) != ERR_OK) { + pbuf_free(np); + return err; + } + + /* Reveal MPPE header + protocol */ + pbuf_header(np, (s16_t)(MPPE_OVHD + sizeof(protocol))); + + *pb = np; + pl = (u8_t*)np->payload; + + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); + /* FIXME: use PUT* macros */ + pl[0] = state->ccount>>8; + pl[1] = state->ccount; + + if (!state->stateful || /* stateless mode */ + ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ + (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ + /* We must rekey */ + if (state->stateful) { + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); + } + mppe_rekey(state, 0); + state->bits |= MPPE_BIT_FLUSHED; + } + pl[0] |= state->bits; + state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ + pl += MPPE_OVHD; + + /* Add protocol */ + /* FIXME: add PFC support */ + pl[0] = protocol >> 8; + pl[1] = protocol; + + /* Hide MPPE header */ + pbuf_header(np, -(s16_t)MPPE_OVHD); + + /* Encrypt packet */ + for (n = np; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* Reveal MPPE header */ + pbuf_header(np, (s16_t)MPPE_OVHD); + + return ERR_OK; } /* @@ -267,9 +267,9 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto */ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - LWIP_UNUSED_ARG(state); - return; + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(state); + return; } /* @@ -278,135 +278,135 @@ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb) { - struct pbuf *n0 = *pb, *n; - u8_t *pl; - u16_t ccount; - u8_t flushed; - - /* MPPE Header */ - if (n0->len < MPPE_OVHD) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: short pkt (%d)\n", - pcb->netif->num, n0->len)); - state->sanity_errors += 100; - goto sanity_error; - } - - pl = (u8_t*)n0->payload; - flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; - ccount = MPPE_CCOUNT(pl); - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", - pcb->netif->num, ccount)); - - /* sanity checks -- terminate with extreme prejudice */ - if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", - pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (!state->stateful && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " - "stateless mode!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " - "flag packet!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - - /* - * Check the coherency count. - */ - - if (!state->stateful) { - /* Discard late packet */ - if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { - state->sanity_errors++; - goto sanity_error; - } - - /* RFC 3078, sec 8.1. Rekey for every packet. */ - while (state->ccount != ccount) { - mppe_rekey(state, 0); - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - } - } else { - /* RFC 3078, sec 8.2. */ - if (!state->discard) { - /* normal state */ - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - if (ccount != state->ccount) { - /* - * (ccount > state->ccount) - * Packet loss detected, enter the discard state. - * Signal the peer to rekey (by sending a CCP Reset-Request). - */ - state->discard = 1; - ccp_resetrequest(pcb); - return ERR_BUF; - } - } else { - /* discard state */ - if (!flushed) { - /* ccp.c will be silent (no additional CCP Reset-Requests). */ - return ERR_BUF; - } else { - /* Rekey for every missed "flag" packet. */ - while ((ccount & ~0xff) != - (state->ccount & ~0xff)) { - mppe_rekey(state, 0); - state->ccount = - (state->ccount + - 256) % MPPE_CCOUNT_SPACE; - } - - /* reset */ - state->discard = 0; - state->ccount = ccount; - /* - * Another problem with RFC 3078 here. It implies that the - * peer need not send a Reset-Ack packet. But RFC 1962 - * requires it. Hopefully, M$ does send a Reset-Ack; even - * though it isn't required for MPPE synchronization, it is - * required to reset CCP state. - */ - } - } - if (flushed) - mppe_rekey(state, 0); - } - - /* Hide MPPE header */ - pbuf_header(n0, -(s16_t)(MPPE_OVHD)); - - /* Decrypt the packet. */ - for (n = n0; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* good packet credit */ - state->sanity_errors >>= 1; - - return ERR_OK; + struct pbuf *n0 = *pb, *n; + u8_t *pl; + u16_t ccount; + u8_t flushed; + + /* MPPE Header */ + if (n0->len < MPPE_OVHD) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: short pkt (%d)\n", + pcb->netif->num, n0->len)); + state->sanity_errors += 100; + goto sanity_error; + } + + pl = (u8_t*)n0->payload; + flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; + ccount = MPPE_CCOUNT(pl); + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", + pcb->netif->num, ccount)); + + /* sanity checks -- terminate with extreme prejudice */ + if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", + pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (!state->stateful && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " + "stateless mode!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " + "flag packet!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + + /* + * Check the coherency count. + */ + + if (!state->stateful) { + /* Discard late packet */ + if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { + state->sanity_errors++; + goto sanity_error; + } + + /* RFC 3078, sec 8.1. Rekey for every packet. */ + while (state->ccount != ccount) { + mppe_rekey(state, 0); + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + } + } else { + /* RFC 3078, sec 8.2. */ + if (!state->discard) { + /* normal state */ + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + if (ccount != state->ccount) { + /* + * (ccount > state->ccount) + * Packet loss detected, enter the discard state. + * Signal the peer to rekey (by sending a CCP Reset-Request). + */ + state->discard = 1; + ccp_resetrequest(pcb); + return ERR_BUF; + } + } else { + /* discard state */ + if (!flushed) { + /* ccp.c will be silent (no additional CCP Reset-Requests). */ + return ERR_BUF; + } else { + /* Rekey for every missed "flag" packet. */ + while ((ccount & ~0xff) != + (state->ccount & ~0xff)) { + mppe_rekey(state, 0); + state->ccount = + (state->ccount + + 256) % MPPE_CCOUNT_SPACE; + } + + /* reset */ + state->discard = 0; + state->ccount = ccount; + /* + * Another problem with RFC 3078 here. It implies that the + * peer need not send a Reset-Ack packet. But RFC 1962 + * requires it. Hopefully, M$ does send a Reset-Ack; even + * though it isn't required for MPPE synchronization, it is + * required to reset CCP state. + */ + } + } + if (flushed) + mppe_rekey(state, 0); + } + + /* Hide MPPE header */ + pbuf_header(n0, -(s16_t)(MPPE_OVHD)); + + /* Decrypt the packet. */ + for (n = n0; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* good packet credit */ + state->sanity_errors >>= 1; + + return ERR_OK; sanity_error: - if (state->sanity_errors >= SANITY_MAX) { - /* - * Take LCP down if the peer is sending too many bogons. - * We don't want to do this for a single or just a few - * instances since it could just be due to packet corruption. - */ - lcp_close(pcb, "Too many MPPE errors"); - } - return ERR_BUF; + if (state->sanity_errors >= SANITY_MAX) { + /* + * Take LCP down if the peer is sending too many bogons. + * We don't want to do this for a single or just a few + * instances since it could just be due to packet corruption. + */ + lcp_close(pcb, "Too many MPPE errors"); + } + return ERR_BUF; } #endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/multilink.c b/components/net/lwip-2.0.2/src/netif/ppp/multilink.c index 62014e8c87..08e8130d48 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/multilink.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/multilink.c @@ -55,11 +55,11 @@ #include "netif/ppp/lcp.h" #include "netif/ppp/tdb.h" -bool endpoint_specified; /* user gave explicit endpoint discriminator */ -char *bundle_id; /* identifier for our bundle */ -char *blinks_id; /* key for the list of links */ -bool doing_multilink; /* multilink was enabled and agreed to */ -bool multilink_master; /* we own the multilink bundle */ +bool endpoint_specified; /* user gave explicit endpoint discriminator */ +char *bundle_id; /* identifier for our bundle */ +char *blinks_id; /* key for the list of links */ +bool doing_multilink; /* multilink was enabled and agreed to */ +bool multilink_master; /* we own the multilink bundle */ extern TDB_CONTEXT *pppdb; extern char db_key[]; @@ -72,43 +72,43 @@ static int get_default_epdisc (struct epdisc *); static int parse_num (char *str, const char *key, int *valp); static int owns_unit (TDB_DATA pid, int unit); -#define set_ip_epdisc(ep, addr) do { \ - ep->length = 4; \ - ep->value[0] = addr >> 24; \ - ep->value[1] = addr >> 16; \ - ep->value[2] = addr >> 8; \ - ep->value[3] = addr; \ +#define set_ip_epdisc(ep, addr) do { \ + ep->length = 4; \ + ep->value[0] = addr >> 24; \ + ep->value[1] = addr >> 16; \ + ep->value[2] = addr >> 8; \ + ep->value[3] = addr; \ } while (0) -#define LOCAL_IP_ADDR(addr) \ - (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ - || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ - || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ +#define LOCAL_IP_ADDR(addr) \ + (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ + || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ + || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ -#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) +#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) void mp_check_options() { - lcp_options *wo = &lcp_wantoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - - doing_multilink = 0; - if (!multilink) - return; - /* if we're doing multilink, we have to negotiate MRRU */ - if (!wo->neg_mrru) { - /* mrru not specified, default to mru */ - wo->mrru = wo->mru; - wo->neg_mrru = 1; - } - ao->mrru = ao->mru; - ao->neg_mrru = 1; - - if (!wo->neg_endpoint && !noendpoint) { - /* get a default endpoint value */ - wo->neg_endpoint = get_default_epdisc(&wo->endpoint); - } + lcp_options *wo = &lcp_wantoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + + doing_multilink = 0; + if (!multilink) + return; + /* if we're doing multilink, we have to negotiate MRRU */ + if (!wo->neg_mrru) { + /* mrru not specified, default to mru */ + wo->mrru = wo->mru; + wo->neg_mrru = 1; + } + ao->mrru = ao->mru; + ao->neg_mrru = 1; + + if (!wo->neg_endpoint && !noendpoint) { + /* get a default endpoint value */ + wo->neg_endpoint = get_default_epdisc(&wo->endpoint); + } } /* @@ -118,289 +118,289 @@ mp_check_options() int mp_join_bundle() { - lcp_options *go = &lcp_gotoptions[0]; - lcp_options *ho = &lcp_hisoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - int unit, pppd_pid; - int l, mtu; - char *p; - TDB_DATA key, pid, rec; - - if (doing_multilink) { - /* have previously joined a bundle */ - if (!go->neg_mrru || !ho->neg_mrru) { - notice("oops, didn't get multilink on renegotiation"); - lcp_close(pcb, "multilink required"); - return 0; - } - /* XXX should check the peer_authname and ho->endpoint - are the same as previously */ - return 0; - } - - if (!go->neg_mrru || !ho->neg_mrru) { - /* not doing multilink */ - if (go->neg_mrru) - notice("oops, multilink negotiated only for receive"); - mtu = ho->neg_mru? ho->mru: PPP_MRU; - if (mtu > ao->mru) - mtu = ao->mru; - if (demand) { - /* already have a bundle */ - cfg_bundle(0, 0, 0, 0); - netif_set_mtu(pcb, mtu); - return 0; - } - make_new_bundle(0, 0, 0, 0); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - return 0; - } - - doing_multilink = 1; - - /* - * Find the appropriate bundle or join a new one. - * First we make up a name for the bundle. - * The length estimate is worst-case assuming every - * character has to be quoted. - */ - l = 4 * strlen(peer_authname) + 10; - if (ho->neg_endpoint) - l += 3 * ho->endpoint.length + 8; - if (bundle_name) - l += 3 * strlen(bundle_name) + 2; - bundle_id = malloc(l); - if (bundle_id == 0) - novm("bundle identifier"); - - p = bundle_id; - p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); - if (ho->neg_endpoint || bundle_name) - *p++ = '/'; - if (ho->neg_endpoint) - p += slprintf(p, bundle_id+l-p, "%s", - epdisc_to_str(&ho->endpoint)); - if (bundle_name) - p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); - - /* Make the key for the list of links belonging to the bundle */ - l = p - bundle_id; - blinks_id = malloc(l + 7); - if (blinks_id == NULL) - novm("bundle links key"); - slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); - - /* - * For demand mode, we only need to configure the bundle - * and attach the link. - */ - mtu = LWIP_MIN(ho->mrru, ao->mru); - if (demand) { - cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - return 0; - } - - /* - * Check if the bundle ID is already in the database. - */ - unit = -1; - lock_db(); - key.dptr = bundle_id; - key.dsize = p - bundle_id; - pid = tdb_fetch(pppdb, key); - if (pid.dptr != NULL) { - /* bundle ID exists, see if the pppd record exists */ - rec = tdb_fetch(pppdb, pid); - if (rec.dptr != NULL && rec.dsize > 0) { - /* make sure the string is null-terminated */ - rec.dptr[rec.dsize-1] = 0; - /* parse the interface number */ - parse_num(rec.dptr, "IFNAME=ppp", &unit); - /* check the pid value */ - if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) - || !process_exists(pppd_pid) - || !owns_unit(pid, unit)) - unit = -1; - free(rec.dptr); - } - free(pid.dptr); - } - - if (unit >= 0) { - /* attach to existing unit */ - if (bundle_attach(unit)) { - set_ifunit(0); - script_setenv("BUNDLE", bundle_id + 7, 0); - make_bundle_links(1); - unlock_db(); - info("Link attached to %s", ifname); - return 1; - } - /* attach failed because bundle doesn't exist */ - } - - /* we have to make a new bundle */ - make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - make_bundle_links(pcb); - unlock_db(); - info("New bundle %s created", ifname); - multilink_master = 1; - return 0; + lcp_options *go = &lcp_gotoptions[0]; + lcp_options *ho = &lcp_hisoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + int unit, pppd_pid; + int l, mtu; + char *p; + TDB_DATA key, pid, rec; + + if (doing_multilink) { + /* have previously joined a bundle */ + if (!go->neg_mrru || !ho->neg_mrru) { + notice("oops, didn't get multilink on renegotiation"); + lcp_close(pcb, "multilink required"); + return 0; + } + /* XXX should check the peer_authname and ho->endpoint + are the same as previously */ + return 0; + } + + if (!go->neg_mrru || !ho->neg_mrru) { + /* not doing multilink */ + if (go->neg_mrru) + notice("oops, multilink negotiated only for receive"); + mtu = ho->neg_mru? ho->mru: PPP_MRU; + if (mtu > ao->mru) + mtu = ao->mru; + if (demand) { + /* already have a bundle */ + cfg_bundle(0, 0, 0, 0); + netif_set_mtu(pcb, mtu); + return 0; + } + make_new_bundle(0, 0, 0, 0); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + return 0; + } + + doing_multilink = 1; + + /* + * Find the appropriate bundle or join a new one. + * First we make up a name for the bundle. + * The length estimate is worst-case assuming every + * character has to be quoted. + */ + l = 4 * strlen(peer_authname) + 10; + if (ho->neg_endpoint) + l += 3 * ho->endpoint.length + 8; + if (bundle_name) + l += 3 * strlen(bundle_name) + 2; + bundle_id = malloc(l); + if (bundle_id == 0) + novm("bundle identifier"); + + p = bundle_id; + p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); + if (ho->neg_endpoint || bundle_name) + *p++ = '/'; + if (ho->neg_endpoint) + p += slprintf(p, bundle_id+l-p, "%s", + epdisc_to_str(&ho->endpoint)); + if (bundle_name) + p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); + + /* Make the key for the list of links belonging to the bundle */ + l = p - bundle_id; + blinks_id = malloc(l + 7); + if (blinks_id == NULL) + novm("bundle links key"); + slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); + + /* + * For demand mode, we only need to configure the bundle + * and attach the link. + */ + mtu = LWIP_MIN(ho->mrru, ao->mru); + if (demand) { + cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + return 0; + } + + /* + * Check if the bundle ID is already in the database. + */ + unit = -1; + lock_db(); + key.dptr = bundle_id; + key.dsize = p - bundle_id; + pid = tdb_fetch(pppdb, key); + if (pid.dptr != NULL) { + /* bundle ID exists, see if the pppd record exists */ + rec = tdb_fetch(pppdb, pid); + if (rec.dptr != NULL && rec.dsize > 0) { + /* make sure the string is null-terminated */ + rec.dptr[rec.dsize-1] = 0; + /* parse the interface number */ + parse_num(rec.dptr, "IFNAME=ppp", &unit); + /* check the pid value */ + if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) + || !process_exists(pppd_pid) + || !owns_unit(pid, unit)) + unit = -1; + free(rec.dptr); + } + free(pid.dptr); + } + + if (unit >= 0) { + /* attach to existing unit */ + if (bundle_attach(unit)) { + set_ifunit(0); + script_setenv("BUNDLE", bundle_id + 7, 0); + make_bundle_links(1); + unlock_db(); + info("Link attached to %s", ifname); + return 1; + } + /* attach failed because bundle doesn't exist */ + } + + /* we have to make a new bundle */ + make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + make_bundle_links(pcb); + unlock_db(); + info("New bundle %s created", ifname); + multilink_master = 1; + return 0; } void mp_exit_bundle() { - lock_db(); - remove_bundle_link(); - unlock_db(); + lock_db(); + remove_bundle_link(); + unlock_db(); } static void sendhup(char *str) { - int pid; + int pid; - if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { - if (debug) - dbglog("sending SIGHUP to process %d", pid); - kill(pid, SIGHUP); - } + if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { + if (debug) + dbglog("sending SIGHUP to process %d", pid); + kill(pid, SIGHUP); + } } void mp_bundle_terminated() { - TDB_DATA key; + TDB_DATA key; - bundle_terminating = 1; - upper_layers_down(pcb); - notice("Connection terminated."); + bundle_terminating = 1; + upper_layers_down(pcb); + notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ - if (!demand) { - remove_pidfiles(); - script_unsetenv("IFNAME"); - } - - lock_db(); - destroy_bundle(); - iterate_bundle_links(sendhup); - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - tdb_delete(pppdb, key); - unlock_db(); - - new_phase(PPP_PHASE_DEAD); - - doing_multilink = 0; - multilink_master = 0; + if (!demand) { + remove_pidfiles(); + script_unsetenv("IFNAME"); + } + + lock_db(); + destroy_bundle(); + iterate_bundle_links(sendhup); + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + tdb_delete(pppdb, key); + unlock_db(); + + new_phase(PPP_PHASE_DEAD); + + doing_multilink = 0; + multilink_master = 0; } static void make_bundle_links(int append) { - TDB_DATA key, rec; - char *p; - char entry[32]; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - p = entry; - if (append) { - rec = tdb_fetch(pppdb, key); - if (rec.dptr != NULL && rec.dsize > 0) { - rec.dptr[rec.dsize-1] = 0; - if (strstr(rec.dptr, db_key) != NULL) { - /* already in there? strange */ - warn("link entry already exists in tdb"); - return; - } - l = rec.dsize + strlen(entry); - p = malloc(l); - if (p == NULL) - novm("bundle link list"); - slprintf(p, l, "%s%s", rec.dptr, entry); - } else { - warn("bundle link list not found"); - } - if (rec.dptr != NULL) - free(rec.dptr); - } - rec.dptr = p; - rec.dsize = strlen(p) + 1; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't %s bundle link list", - append? "update": "create"); - if (p != entry) - free(p); + TDB_DATA key, rec; + char *p; + char entry[32]; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + p = entry; + if (append) { + rec = tdb_fetch(pppdb, key); + if (rec.dptr != NULL && rec.dsize > 0) { + rec.dptr[rec.dsize-1] = 0; + if (strstr(rec.dptr, db_key) != NULL) { + /* already in there? strange */ + warn("link entry already exists in tdb"); + return; + } + l = rec.dsize + strlen(entry); + p = malloc(l); + if (p == NULL) + novm("bundle link list"); + slprintf(p, l, "%s%s", rec.dptr, entry); + } else { + warn("bundle link list not found"); + } + if (rec.dptr != NULL) + free(rec.dptr); + } + rec.dptr = p; + rec.dsize = strlen(p) + 1; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't %s bundle link list", + append? "update": "create"); + if (p != entry) + free(p); } static void remove_bundle_link() { - TDB_DATA key, rec; - char entry[32]; - char *p, *q; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - rec.dptr[rec.dsize-1] = 0; - p = strstr(rec.dptr, entry); - if (p != NULL) { - q = p + strlen(entry); - l = strlen(q) + 1; - memmove(p, q, l); - rec.dsize = p - rec.dptr + l; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't update bundle link list (removal)"); - } - free(rec.dptr); + TDB_DATA key, rec; + char entry[32]; + char *p, *q; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + rec.dptr[rec.dsize-1] = 0; + p = strstr(rec.dptr, entry); + if (p != NULL) { + q = p + strlen(entry); + l = strlen(q) + 1; + memmove(p, q, l); + rec.dsize = p - rec.dptr + l; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't update bundle link list (removal)"); + } + free(rec.dptr); } static void iterate_bundle_links(void (*func)(char *)) { - TDB_DATA key, rec, pp; - char *p, *q; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - error("bundle link list not found (iterating list)"); - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - p = rec.dptr; - p[rec.dsize-1] = 0; - while ((q = strchr(p, ';')) != NULL) { - *q = 0; - key.dptr = p; - key.dsize = q - p; - pp = tdb_fetch(pppdb, key); - if (pp.dptr != NULL && pp.dsize > 0) { - pp.dptr[pp.dsize-1] = 0; - func(pp.dptr); - } - if (pp.dptr != NULL) - free(pp.dptr); - p = q + 1; - } - free(rec.dptr); + TDB_DATA key, rec, pp; + char *p, *q; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + error("bundle link list not found (iterating list)"); + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + p = rec.dptr; + p[rec.dsize-1] = 0; + while ((q = strchr(p, ';')) != NULL) { + *q = 0; + key.dptr = p; + key.dsize = q - p; + pp = tdb_fetch(pppdb, key); + if (pp.dptr != NULL && pp.dsize > 0) { + pp.dptr[pp.dsize-1] = 0; + func(pp.dptr); + } + if (pp.dptr != NULL) + free(pp.dptr); + p = q + 1; + } + free(rec.dptr); } static int @@ -409,19 +409,19 @@ parse_num(str, key, valp) const char *key; int *valp; { - char *p, *endp; - int i; - - p = strstr(str, key); - if (p != 0) { - p += strlen(key); - i = strtol(p, &endp, 10); - if (endp != p && (*endp == 0 || *endp == ';')) { - *valp = i; - return 1; - } - } - return 0; + char *p, *endp; + int i; + + p = strstr(str, key); + if (p != 0) { + p += strlen(key); + i = strtol(p, &endp, 10); + if (endp != p && (*endp == 0 || *endp == ';')) { + *valp = i; + return 1; + } + } + return 0; } /* @@ -432,53 +432,53 @@ owns_unit(key, unit) TDB_DATA key; int unit; { - char ifkey[32]; - TDB_DATA kd, vd; - int ret = 0; - - slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); - kd.dptr = ifkey; - kd.dsize = strlen(ifkey); - vd = tdb_fetch(pppdb, kd); - if (vd.dptr != NULL) { - ret = vd.dsize == key.dsize - && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; - free(vd.dptr); - } - return ret; + char ifkey[32]; + TDB_DATA kd, vd; + int ret = 0; + + slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); + kd.dptr = ifkey; + kd.dsize = strlen(ifkey); + vd = tdb_fetch(pppdb, kd); + if (vd.dptr != NULL) { + ret = vd.dsize == key.dsize + && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; + free(vd.dptr); + } + return ret; } static int get_default_epdisc(ep) struct epdisc *ep; { - char *p; - struct hostent *hp; - u32_t addr; - - /* First try for an ethernet MAC address */ - p = get_first_ethernet(); - if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { - ep->class = EPD_MAC; - ep->length = 6; - return 1; - } - - /* see if our hostname corresponds to a reasonable IP address */ - hp = gethostbyname(hostname); - if (hp != NULL) { - addr = *(u32_t *)hp->h_addr; - if (!bad_ip_adrs(addr)) { - addr = lwip_ntohl(addr); - if (!LOCAL_IP_ADDR(addr)) { - ep->class = EPD_IP; - set_ip_epdisc(ep, addr); - return 1; - } - } - } - - return 0; + char *p; + struct hostent *hp; + u32_t addr; + + /* First try for an ethernet MAC address */ + p = get_first_ethernet(); + if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { + ep->class = EPD_MAC; + ep->length = 6; + return 1; + } + + /* see if our hostname corresponds to a reasonable IP address */ + hp = gethostbyname(hostname); + if (hp != NULL) { + addr = *(u32_t *)hp->h_addr; + if (!bad_ip_adrs(addr)) { + addr = lwip_ntohl(addr); + if (!LOCAL_IP_ADDR(addr)) { + ep->class = EPD_IP; + set_ip_epdisc(ep, addr); + return 1; + } + } + } + + return 0; } /* @@ -493,51 +493,51 @@ char * epdisc_to_str(ep) struct epdisc *ep; { - static char str[MAX_ENDP_LEN*3+8]; - u_char *p = ep->value; - int i, mask = 0; - char *q, c, c2; - - if (ep->class == EPD_NULL && ep->length == 0) - return "null"; - if (ep->class == EPD_IP && ep->length == 4) { - u32_t addr; - - GETLONG(addr, p); - slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); - return str; - } - - c = ':'; - c2 = '.'; - if (ep->class == EPD_MAC && ep->length == 6) - c2 = ':'; - else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) - mask = 3; - q = str; - if (ep->class <= EPD_PHONENUM) - q += slprintf(q, sizeof(str)-1, "%s", - endp_class_names[ep->class]); - else - q += slprintf(q, sizeof(str)-1, "%d", ep->class); - c = ':'; - for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { - if ((i & mask) == 0) { - *q++ = c; - c = c2; - } - q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); - } - return str; + static char str[MAX_ENDP_LEN*3+8]; + u_char *p = ep->value; + int i, mask = 0; + char *q, c, c2; + + if (ep->class == EPD_NULL && ep->length == 0) + return "null"; + if (ep->class == EPD_IP && ep->length == 4) { + u32_t addr; + + GETLONG(addr, p); + slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); + return str; + } + + c = ':'; + c2 = '.'; + if (ep->class == EPD_MAC && ep->length == 6) + c2 = ':'; + else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) + mask = 3; + q = str; + if (ep->class <= EPD_PHONENUM) + q += slprintf(q, sizeof(str)-1, "%s", + endp_class_names[ep->class]); + else + q += slprintf(q, sizeof(str)-1, "%d", ep->class); + c = ':'; + for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { + if ((i & mask) == 0) { + *q++ = c; + c = c2; + } + q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); + } + return str; } static int hexc_val(int c) { - if (c >= 'a') - return c - 'a' + 10; - if (c >= 'A') - return c - 'A' + 10; - return c - '0'; + if (c >= 'a') + return c - 'a' + 10; + if (c >= 'A') + return c - 'A' + 10; + return c - '0'; } int @@ -545,65 +545,65 @@ str_to_epdisc(ep, str) struct epdisc *ep; char *str; { - int i, l; - char *p, *endp; - - for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { - int sl = strlen(endp_class_names[i]); - if (strncasecmp(str, endp_class_names[i], sl) == 0) { - str += sl; - break; - } - } - if (i > EPD_PHONENUM) { - /* not a class name, try a decimal class number */ - i = strtol(str, &endp, 10); - if (endp == str) - return 0; /* can't parse class number */ - str = endp; - } - ep->class = i; - if (*str == 0) { - ep->length = 0; - return 1; - } - if (*str != ':' && *str != '.') - return 0; - ++str; - - if (i == EPD_IP) { - u32_t addr; - i = parse_dotted_ip(str, &addr); - if (i == 0 || str[i] != 0) - return 0; - set_ip_epdisc(ep, addr); - return 1; - } - if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { - ep->length = 6; - return 1; - } - - p = str; - for (l = 0; l < MAX_ENDP_LEN; ++l) { - if (*str == 0) - break; - if (p <= str) - for (p = str; isxdigit(*p); ++p) - ; - i = p - str; - if (i == 0) - return 0; - ep->value[l] = hexc_val(*str++); - if ((i & 1) == 0) - ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); - if (*str == ':' || *str == '.') - ++str; - } - if (*str != 0 || (ep->class == EPD_MAC && l != 6)) - return 0; - ep->length = l; - return 1; + int i, l; + char *p, *endp; + + for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { + int sl = strlen(endp_class_names[i]); + if (strncasecmp(str, endp_class_names[i], sl) == 0) { + str += sl; + break; + } + } + if (i > EPD_PHONENUM) { + /* not a class name, try a decimal class number */ + i = strtol(str, &endp, 10); + if (endp == str) + return 0; /* can't parse class number */ + str = endp; + } + ep->class = i; + if (*str == 0) { + ep->length = 0; + return 1; + } + if (*str != ':' && *str != '.') + return 0; + ++str; + + if (i == EPD_IP) { + u32_t addr; + i = parse_dotted_ip(str, &addr); + if (i == 0 || str[i] != 0) + return 0; + set_ip_epdisc(ep, addr); + return 1; + } + if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { + ep->length = 6; + return 1; + } + + p = str; + for (l = 0; l < MAX_ENDP_LEN; ++l) { + if (*str == 0) + break; + if (p <= str) + for (p = str; isxdigit(*p); ++p) + ; + i = p - str; + if (i == 0) + return 0; + ep->value[l] = hexc_val(*str++); + if ((i & 1) == 0) + ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); + if (*str == ':' || *str == '.') + ++str; + } + if (*str != 0 || (ep->class == EPD_MAC && l != 6)) + return 0; + ep->length = l; + return 1; } #endif /* PPP_SUPPORT && HAVE_MULTILINK */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c index 6e17ec421b..cb31b8761e 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c index 9a89d007bd..b01e07fa5c 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c index b1701a07b9..34e5b10cd4 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c index 1ec4d81a69..fa6365848f 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -156,7 +156,7 @@ static void md5_process( md5_context *ctx, const unsigned char data[64] ) P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F - + #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c index c2192eac54..6079af3ba2 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ppp.c b/components/net/lwip-2.0.2/src/netif/ppp/ppp.c index 8b77765e5a..66a1156ff8 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ppp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ppp.c @@ -629,7 +629,7 @@ int ppp_init(void) return 0; } - + /* * Create a new PPP control block. * diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c b/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c index 947f7ba8c1..0ad8e986b4 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c @@ -57,10 +57,10 @@ LWIP_MEMPOOL_DECLARE(PPPAPI_MSG, MEMP_NUM_PPP_API_MSG, sizeof(struct pppapi_msg) static err_t pppapi_do_ppp_set_default(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; - + ppp_set_default(msg->msg.ppp); return ERR_OK; } @@ -90,7 +90,7 @@ pppapi_set_default(ppp_pcb *pcb) static err_t pppapi_do_ppp_set_notify_phase_callback(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -125,7 +125,7 @@ pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_pha static err_t pppapi_do_pppos_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -166,7 +166,7 @@ pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, static err_t pppapi_do_pppoe_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -211,7 +211,7 @@ pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *servic static err_t pppapi_do_pppol2tp_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -270,7 +270,7 @@ pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipad static err_t pppapi_do_ppp_connect(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -303,7 +303,7 @@ pppapi_connect(ppp_pcb *pcb, u16_t holdoff) static err_t pppapi_do_ppp_listen(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -335,7 +335,7 @@ pppapi_listen(ppp_pcb *pcb) static err_t pppapi_do_ppp_close(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -367,7 +367,7 @@ pppapi_close(ppp_pcb *pcb, u8_t nocarrier) static err_t pppapi_do_ppp_free(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -398,7 +398,7 @@ pppapi_free(ppp_pcb *pcb) static err_t pppapi_do_ppp_ioctl(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c b/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c index 82d78c13ac..81e4008d3d 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c @@ -39,28 +39,28 @@ static u_char pppcrypt_get_7bits(u_char *input, int startBit) { - unsigned int word; + unsigned int word; - word = (unsigned)input[startBit / 8] << 8; - word |= (unsigned)input[startBit / 8 + 1]; + word = (unsigned)input[startBit / 8] << 8; + word |= (unsigned)input[startBit / 8 + 1]; - word >>= 15 - (startBit % 8 + 7); + word >>= 15 - (startBit % 8 + 7); - return word & 0xFE; + return word & 0xFE; } /* IN 56 bit DES key missing parity bits * OUT 64 bit DES key with parity bits added */ void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { - des_key[0] = pppcrypt_get_7bits(key, 0); - des_key[1] = pppcrypt_get_7bits(key, 7); - des_key[2] = pppcrypt_get_7bits(key, 14); - des_key[3] = pppcrypt_get_7bits(key, 21); - des_key[4] = pppcrypt_get_7bits(key, 28); - des_key[5] = pppcrypt_get_7bits(key, 35); - des_key[6] = pppcrypt_get_7bits(key, 42); - des_key[7] = pppcrypt_get_7bits(key, 49); + des_key[0] = pppcrypt_get_7bits(key, 0); + des_key[1] = pppcrypt_get_7bits(key, 7); + des_key[2] = pppcrypt_get_7bits(key, 14); + des_key[3] = pppcrypt_get_7bits(key, 21); + des_key[4] = pppcrypt_get_7bits(key, 28); + des_key[5] = pppcrypt_get_7bits(key, 35); + des_key[6] = pppcrypt_get_7bits(key, 42); + des_key[7] = pppcrypt_get_7bits(key, 49); } #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c b/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c index eabfa4d041..48260be832 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -664,7 +664,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } if (pb->len < sizeof(*ph)) { PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: could not get PPPoE header\n")); @@ -697,7 +697,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header PPPOE_HEADERLEN failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c b/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c index d44471e25f..9033fb3a34 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c @@ -740,15 +740,15 @@ static void pppol2tp_timeout(void *arg) { PPPDEBUG(LOG_DEBUG, ("pppol2tp: icrq_retried=%d\n", l2tp->icrq_retried)); if (l2tp->peer_nr <= l2tp->our_ns -1) { /* the SCCCN was not acknowledged */ if ((err = pppol2tp_send_scccn(l2tp, l2tp->our_ns -1)) != 0) { - l2tp->icrq_retried--; - PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCCN, error=%d\n", err)); - sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); - break; - } + l2tp->icrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCCN, error=%d\n", err)); + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + } } if ((err = pppol2tp_send_icrq(l2tp, l2tp->our_ns)) != 0) { - l2tp->icrq_retried--; - PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICRQ, error=%d\n", err)); + l2tp->icrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICRQ, error=%d\n", err)); } sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); break; @@ -761,8 +761,8 @@ static void pppol2tp_timeout(void *arg) { } PPPDEBUG(LOG_DEBUG, ("pppol2tp: iccn_retried=%d\n", l2tp->iccn_retried)); if ((err = pppol2tp_send_iccn(l2tp, l2tp->our_ns)) != 0) { - l2tp->iccn_retried--; - PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICCN, error=%d\n", err)); + l2tp->iccn_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICCN, error=%d\n", err)); } sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); break; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/upap.c b/components/net/lwip-2.0.2/src/netif/ppp/upap.c index d00c2d76e5..f00f2ac46e 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/upap.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/upap.c @@ -166,12 +166,12 @@ void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password) { /* Lower layer up yet? */ if (pcb->upap.us_clientstate == UPAPCS_INITIAL || - pcb->upap.us_clientstate == UPAPCS_PENDING) { - pcb->upap.us_clientstate = UPAPCS_PENDING; - return; + pcb->upap.us_clientstate == UPAPCS_PENDING) { + pcb->upap.us_clientstate = UPAPCS_PENDING; + return; } - upap_sauthreq(pcb); /* Start protocol */ + upap_sauthreq(pcb); /* Start protocol */ } #if PPP_SERVER @@ -184,14 +184,14 @@ void upap_authpeer(ppp_pcb *pcb) { /* Lower layer up yet? */ if (pcb->upap.us_serverstate == UPAPSS_INITIAL || - pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_PENDING; - return; + pcb->upap.us_serverstate == UPAPSS_PENDING) { + pcb->upap.us_serverstate = UPAPSS_PENDING; + return; } pcb->upap.us_serverstate = UPAPSS_LISTEN; if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ @@ -202,17 +202,17 @@ static void upap_timeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) - return; + return; if (pcb->upap.us_transmits >= pcb->settings.pap_max_transmits) { - /* give up in disgust */ - ppp_error("No response to PAP authenticate-requests"); - pcb->upap.us_clientstate = UPAPCS_BADAUTH; - auth_withpeer_fail(pcb, PPP_PAP); - return; + /* give up in disgust */ + ppp_error("No response to PAP authenticate-requests"); + pcb->upap.us_clientstate = UPAPCS_BADAUTH; + auth_withpeer_fail(pcb, PPP_PAP); + return; } - upap_sauthreq(pcb); /* Send Authenticate-Request */ + upap_sauthreq(pcb); /* Send Authenticate-Request */ } @@ -224,7 +224,7 @@ static void upap_reqtimeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_serverstate != UPAPSS_LISTEN) - return; /* huh?? */ + return; /* huh?? */ auth_peer_fail(pcb, PPP_PAP); pcb->upap.us_serverstate = UPAPSS_BADAUTH; @@ -240,18 +240,18 @@ static void upap_reqtimeout(void *arg) { static void upap_lowerup(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_INITIAL) - pcb->upap.us_clientstate = UPAPCS_CLOSED; + pcb->upap.us_clientstate = UPAPCS_CLOSED; else if (pcb->upap.us_clientstate == UPAPCS_PENDING) { - upap_sauthreq(pcb); /* send an auth-request */ + upap_sauthreq(pcb); /* send an auth-request */ } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_INITIAL) - pcb->upap.us_serverstate = UPAPSS_CLOSED; + pcb->upap.us_serverstate = UPAPSS_CLOSED; else if (pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_LISTEN; - if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + pcb->upap.us_serverstate = UPAPSS_LISTEN; + if (pcb->settings.pap_req_timeout > 0) + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ } @@ -264,11 +264,11 @@ static void upap_lowerup(ppp_pcb *pcb) { */ static void upap_lowerdown(ppp_pcb *pcb) { - if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ - UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ + if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ + UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN && pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); #endif /* PPP_SERVER */ pcb->upap.us_clientstate = UPAPCS_INITIAL; @@ -286,13 +286,13 @@ static void upap_lowerdown(ppp_pcb *pcb) { static void upap_protrej(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) { - ppp_error("PAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_PAP); } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN) { - ppp_error("PAP authentication of peer failed (protocol-reject)"); - auth_peer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication of peer failed (protocol-reject)"); + auth_peer_fail(pcb, PPP_PAP); } #endif /* PPP_SERVER */ upap_lowerdown(pcb); @@ -313,19 +313,19 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { */ inp = inpacket; if (l < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd short header.")); - return; + UPAPDEBUG(("pap_input: rcvd short header.")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd illegal length.")); - return; + UPAPDEBUG(("pap_input: rcvd illegal length.")); + return; } if (len > l) { - UPAPDEBUG(("pap_input: rcvd short packet.")); - return; + UPAPDEBUG(("pap_input: rcvd short packet.")); + return; } len -= UPAP_HEADERLEN; @@ -335,20 +335,20 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { switch (code) { case UPAP_AUTHREQ: #if PPP_SERVER - upap_rauthreq(pcb, inp, id, len); + upap_rauthreq(pcb, inp, id, len); #endif /* PPP_SERVER */ - break; + break; case UPAP_AUTHACK: - upap_rauthack(pcb, inp, id, len); - break; + upap_rauthack(pcb, inp, id, len); + break; case UPAP_AUTHNAK: - upap_rauthnak(pcb, inp, id, len); - break; + upap_rauthnak(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - break; + default: /* XXX Need code reject */ + break; } } @@ -366,40 +366,40 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { int msglen; if (pcb->upap.us_serverstate < UPAPSS_LISTEN) - return; + return; /* * If we receive a duplicate authenticate-request, we are * supposed to return the same status as for the first request. */ if (pcb->upap.us_serverstate == UPAPSS_OPEN) { - upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ - return; + upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ + return; } if (pcb->upap.us_serverstate == UPAPSS_BADAUTH) { - upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ - return; + upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ + return; } /* * Parse user/passwd. */ if (len < 1) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } GETCHAR(ruserlen, inp); len -= sizeof (u_char) + ruserlen + sizeof (u_char); if (len < 0) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } ruser = (char *) inp; INCPTR(ruserlen, inp); GETCHAR(rpasswdlen, inp); if (len < rpasswdlen) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } rpasswd = (char *) inp; @@ -420,16 +420,16 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { * return an authenticate failure, is leaving it for us to verify. */ if (retcode == UPAP_AUTHACK) { - if (!auth_number()) { - /* We do not want to leak info about the pap result. */ - retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ - warn("calling number %q is not authorized", remote_number); - } + if (!auth_number()) { + /* We do not want to leak info about the pap result. */ + retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ + warn("calling number %q is not authorized", remote_number); + } } msglen = strlen(msg); if (msglen > 255) - msglen = 255; + msglen = 255; #endif /* UNUSED */ upap_sresp(pcb, retcode, id, msg, msglen); @@ -438,17 +438,17 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { ppp_slprintf(rhostname, sizeof(rhostname), "%.*v", ruserlen, ruser); if (retcode == UPAP_AUTHACK) { - pcb->upap.us_serverstate = UPAPSS_OPEN; - ppp_notice("PAP peer authentication succeeded for %q", rhostname); - auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); + pcb->upap.us_serverstate = UPAPSS_OPEN; + ppp_notice("PAP peer authentication succeeded for %q", rhostname); + auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); } else { - pcb->upap.us_serverstate = UPAPSS_BADAUTH; - ppp_warn("PAP peer authentication failed for %q", rhostname); - auth_peer_fail(pcb, PPP_PAP); + pcb->upap.us_serverstate = UPAPSS_BADAUTH; + ppp_warn("PAP peer authentication failed for %q", rhostname); + auth_peer_fail(pcb, PPP_PAP); } if (pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); } #endif /* PPP_SERVER */ @@ -461,24 +461,24 @@ static void upap_rauthack(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthack: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthack: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_OPEN; @@ -496,24 +496,24 @@ static void upap_rauthnak(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_BADAUTH; @@ -532,7 +532,7 @@ static void upap_sauthreq(ppp_pcb *pcb) { int outlen; outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + - pcb->upap.us_userlen + pcb->upap.us_passwdlen; + pcb->upap.us_userlen + pcb->upap.us_passwdlen; p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE); if(NULL == p) return; @@ -606,68 +606,68 @@ static int upap_printpkt(const u_char *p, int plen, void (*printer) (void *, con const u_char *pstart; if (plen < UPAP_HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < UPAP_HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(upap_codenames)) - printer(arg, " %s", upap_codenames[code-1]); + printer(arg, " %s", upap_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= UPAP_HEADERLEN; switch (code) { case UPAP_AUTHREQ: - if (len < 1) - break; - ulen = p[0]; - if (len < ulen + 2) - break; - wlen = p[ulen + 1]; - if (len < ulen + wlen + 2) - break; - user = (const u_char *) (p + 1); - pwd = (const u_char *) (p + ulen + 2); - p += ulen + wlen + 2; - len -= ulen + wlen + 2; - printer(arg, " user="); - ppp_print_string(user, ulen, printer, arg); - printer(arg, " password="); + if (len < 1) + break; + ulen = p[0]; + if (len < ulen + 2) + break; + wlen = p[ulen + 1]; + if (len < ulen + wlen + 2) + break; + user = (const u_char *) (p + 1); + pwd = (const u_char *) (p + ulen + 2); + p += ulen + wlen + 2; + len -= ulen + wlen + 2; + printer(arg, " user="); + ppp_print_string(user, ulen, printer, arg); + printer(arg, " password="); /* FIXME: require ppp_pcb struct as printpkt() argument */ #if 0 - if (!pcb->settings.hide_password) + if (!pcb->settings.hide_password) #endif - ppp_print_string(pwd, wlen, printer, arg); + ppp_print_string(pwd, wlen, printer, arg); #if 0 - else - printer(arg, ""); + else + printer(arg, ""); #endif - break; + break; case UPAP_AUTHACK: case UPAP_AUTHNAK: - if (len < 1) - break; - mlen = p[0]; - if (len < mlen + 1) - break; - msg = (const u_char *) (p + 1); - p += mlen + 1; - len -= mlen + 1; - printer(arg, " "); - ppp_print_string(msg, mlen, printer, arg); - break; + if (len < 1) + break; + mlen = p[0]; + if (len < mlen + 1) + break; + msg = (const u_char *) (p + 1); + p += mlen + 1; + len -= mlen + 1; + printer(arg, " "); + ppp_print_string(msg, mlen, printer, arg); + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/utils.c b/components/net/lwip-2.0.2/src/netif/ppp/utils.c index 008c63375a..dd8e0f3b7c 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/utils.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/utils.c @@ -74,7 +74,7 @@ static void ppp_log_write(int level, char *buf); #if PRINTPKT_SUPPORT static void ppp_vslp_printer(void *arg, const char *fmt, ...); static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); struct buffer_info { char *ptr; @@ -90,12 +90,12 @@ size_t ppp_strlcpy(char *dest, const char *src, size_t len) { size_t ret = strlen(src); if (len != 0) { - if (ret < len) - strcpy(dest, src); - else { - strncpy(dest, src, len - 1); - dest[len-1] = 0; - } + if (ret < len) + strcpy(dest, src); + else { + strncpy(dest, src, len - 1); + dest[len-1] = 0; + } } return ret; } @@ -132,7 +132,7 @@ int ppp_slprintf(char *buf, int buflen, const char *fmt, ...) { /* * ppp_vslprintf - like ppp_slprintf, takes a va_list instead of a list of args. */ -#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) +#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { int c, i, n; @@ -155,249 +155,249 @@ int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { buf0 = buf; --buflen; while (buflen > 0) { - for (f = fmt; *f != '%' && *f != 0; ++f) - ; - if (f > fmt) { - len = f - fmt; - if (len > buflen) - len = buflen; - memcpy(buf, fmt, len); - buf += len; - buflen -= len; - fmt = f; - } - if (*fmt == 0) - break; - c = *++fmt; - width = 0; - prec = -1; - fillch = ' '; - if (c == '0') { - fillch = '0'; - c = *++fmt; - } - if (c == '*') { - width = va_arg(args, int); - c = *++fmt; - } else { - while (isdigit(c)) { - width = width * 10 + c - '0'; - c = *++fmt; - } - } - if (c == '.') { - c = *++fmt; - if (c == '*') { - prec = va_arg(args, int); - c = *++fmt; - } else { - prec = 0; - while (isdigit(c)) { - prec = prec * 10 + c - '0'; - c = *++fmt; - } - } - } - str = 0; - base = 0; - neg = 0; - ++fmt; - switch (c) { - case 'l': - c = *fmt++; - switch (c) { - case 'd': - val = va_arg(args, long); - if ((long)val < 0) { - neg = 1; - val = (unsigned long)-(long)val; - } - base = 10; - break; - case 'u': - val = va_arg(args, unsigned long); - base = 10; - break; - default: - OUTCHAR('%'); - OUTCHAR('l'); - --fmt; /* so %lz outputs %lz etc. */ - continue; - } - break; - case 'd': - i = va_arg(args, int); - if (i < 0) { - neg = 1; - val = -i; - } else - val = i; - base = 10; - break; - case 'u': - val = va_arg(args, unsigned int); - base = 10; - break; - case 'o': - val = va_arg(args, unsigned int); - base = 8; - break; - case 'x': - case 'X': - val = va_arg(args, unsigned int); - base = 16; - break; + for (f = fmt; *f != '%' && *f != 0; ++f) + ; + if (f > fmt) { + len = f - fmt; + if (len > buflen) + len = buflen; + memcpy(buf, fmt, len); + buf += len; + buflen -= len; + fmt = f; + } + if (*fmt == 0) + break; + c = *++fmt; + width = 0; + prec = -1; + fillch = ' '; + if (c == '0') { + fillch = '0'; + c = *++fmt; + } + if (c == '*') { + width = va_arg(args, int); + c = *++fmt; + } else { + while (isdigit(c)) { + width = width * 10 + c - '0'; + c = *++fmt; + } + } + if (c == '.') { + c = *++fmt; + if (c == '*') { + prec = va_arg(args, int); + c = *++fmt; + } else { + prec = 0; + while (isdigit(c)) { + prec = prec * 10 + c - '0'; + c = *++fmt; + } + } + } + str = 0; + base = 0; + neg = 0; + ++fmt; + switch (c) { + case 'l': + c = *fmt++; + switch (c) { + case 'd': + val = va_arg(args, long); + if ((long)val < 0) { + neg = 1; + val = (unsigned long)-(long)val; + } + base = 10; + break; + case 'u': + val = va_arg(args, unsigned long); + base = 10; + break; + default: + OUTCHAR('%'); + OUTCHAR('l'); + --fmt; /* so %lz outputs %lz etc. */ + continue; + } + break; + case 'd': + i = va_arg(args, int); + if (i < 0) { + neg = 1; + val = -i; + } else + val = i; + base = 10; + break; + case 'u': + val = va_arg(args, unsigned int); + base = 10; + break; + case 'o': + val = va_arg(args, unsigned int); + base = 8; + break; + case 'x': + case 'X': + val = va_arg(args, unsigned int); + base = 16; + break; #if 0 /* unused (and wrong on LLP64 systems) */ - case 'p': - val = (unsigned long) va_arg(args, void *); - base = 16; - neg = 2; - break; + case 'p': + val = (unsigned long) va_arg(args, void *); + base = 16; + neg = 2; + break; #endif /* unused (and wrong on LLP64 systems) */ - case 's': - str = va_arg(args, char *); - break; - case 'c': - num[0] = va_arg(args, int); - num[1] = 0; - str = num; - break; + case 's': + str = va_arg(args, char *); + break; + case 'c': + num[0] = va_arg(args, int); + num[1] = 0; + str = num; + break; #if 0 /* do we always have strerror() in embedded ? */ - case 'm': - str = strerror(errno); - break; + case 'm': + str = strerror(errno); + break; #endif /* do we always have strerror() in embedded ? */ - case 'I': - ip = va_arg(args, u32_t); - ip = lwip_ntohl(ip); - ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, - (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); - str = num; - break; + case 'I': + ip = va_arg(args, u32_t); + ip = lwip_ntohl(ip); + ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, + (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); + str = num; + break; #if 0 /* need port */ - case 't': - time(&t); - str = ctime(&t); - str += 4; /* chop off the day name */ - str[15] = 0; /* chop off year and newline */ - break; + case 't': + time(&t); + str = ctime(&t); + str += 4; /* chop off the day name */ + str[15] = 0; /* chop off year and newline */ + break; #endif /* need port */ - case 'v': /* "visible" string */ - case 'q': /* quoted string */ - quoted = c == 'q'; - p = va_arg(args, unsigned char *); - if (p == NULL) - p = (const unsigned char *)""; - if (fillch == '0' && prec >= 0) { - n = prec; - } else { - n = strlen((const char *)p); - if (prec >= 0 && n > prec) - n = prec; - } - while (n > 0 && buflen > 0) { - c = *p++; - --n; - if (!quoted && c >= 0x80) { - OUTCHAR('M'); - OUTCHAR('-'); - c -= 0x80; - } - if (quoted && (c == '"' || c == '\\')) - OUTCHAR('\\'); - if (c < 0x20 || (0x7f <= c && c < 0xa0)) { - if (quoted) { - OUTCHAR('\\'); - switch (c) { - case '\t': OUTCHAR('t'); break; - case '\n': OUTCHAR('n'); break; - case '\b': OUTCHAR('b'); break; - case '\f': OUTCHAR('f'); break; - default: - OUTCHAR('x'); - OUTCHAR(hexchars[c >> 4]); - OUTCHAR(hexchars[c & 0xf]); - } - } else { - if (c == '\t') - OUTCHAR(c); - else { - OUTCHAR('^'); - OUTCHAR(c ^ 0x40); - } - } - } else - OUTCHAR(c); - } - continue; + case 'v': /* "visible" string */ + case 'q': /* quoted string */ + quoted = c == 'q'; + p = va_arg(args, unsigned char *); + if (p == NULL) + p = (const unsigned char *)""; + if (fillch == '0' && prec >= 0) { + n = prec; + } else { + n = strlen((const char *)p); + if (prec >= 0 && n > prec) + n = prec; + } + while (n > 0 && buflen > 0) { + c = *p++; + --n; + if (!quoted && c >= 0x80) { + OUTCHAR('M'); + OUTCHAR('-'); + c -= 0x80; + } + if (quoted && (c == '"' || c == '\\')) + OUTCHAR('\\'); + if (c < 0x20 || (0x7f <= c && c < 0xa0)) { + if (quoted) { + OUTCHAR('\\'); + switch (c) { + case '\t': OUTCHAR('t'); break; + case '\n': OUTCHAR('n'); break; + case '\b': OUTCHAR('b'); break; + case '\f': OUTCHAR('f'); break; + default: + OUTCHAR('x'); + OUTCHAR(hexchars[c >> 4]); + OUTCHAR(hexchars[c & 0xf]); + } + } else { + if (c == '\t') + OUTCHAR(c); + else { + OUTCHAR('^'); + OUTCHAR(c ^ 0x40); + } + } + } else + OUTCHAR(c); + } + continue; #if PRINTPKT_SUPPORT - case 'P': /* print PPP packet */ - bufinfo.ptr = buf; - bufinfo.len = buflen + 1; - p = va_arg(args, unsigned char *); - n = va_arg(args, int); - ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); - buf = bufinfo.ptr; - buflen = bufinfo.len - 1; - continue; + case 'P': /* print PPP packet */ + bufinfo.ptr = buf; + bufinfo.len = buflen + 1; + p = va_arg(args, unsigned char *); + n = va_arg(args, int); + ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); + buf = bufinfo.ptr; + buflen = bufinfo.len - 1; + continue; #endif /* PRINTPKT_SUPPORT */ - case 'B': - p = va_arg(args, unsigned char *); - for (n = prec; n > 0; --n) { - c = *p++; - if (fillch == ' ') - OUTCHAR(' '); - OUTCHAR(hexchars[(c >> 4) & 0xf]); - OUTCHAR(hexchars[c & 0xf]); - } - continue; - default: - *buf++ = '%'; - if (c != '%') - --fmt; /* so %z outputs %z etc. */ - --buflen; - continue; - } - if (base != 0) { - str = num + sizeof(num); - *--str = 0; - while (str > num + neg) { - *--str = hexchars[val % base]; - val = val / base; - if (--prec <= 0 && val == 0) - break; - } - switch (neg) { - case 1: - *--str = '-'; - break; - case 2: - *--str = 'x'; - *--str = '0'; - break; - default: - break; - } - len = num + sizeof(num) - 1 - str; - } else { - len = strlen(str); - if (prec >= 0 && len > prec) - len = prec; - } - if (width > 0) { - if (width > buflen) - width = buflen; - if ((n = width - len) > 0) { - buflen -= n; - for (; n > 0; --n) - *buf++ = fillch; - } - } - if (len > buflen) - len = buflen; - memcpy(buf, str, len); - buf += len; - buflen -= len; + case 'B': + p = va_arg(args, unsigned char *); + for (n = prec; n > 0; --n) { + c = *p++; + if (fillch == ' ') + OUTCHAR(' '); + OUTCHAR(hexchars[(c >> 4) & 0xf]); + OUTCHAR(hexchars[c & 0xf]); + } + continue; + default: + *buf++ = '%'; + if (c != '%') + --fmt; /* so %z outputs %z etc. */ + --buflen; + continue; + } + if (base != 0) { + str = num + sizeof(num); + *--str = 0; + while (str > num + neg) { + *--str = hexchars[val % base]; + val = val / base; + if (--prec <= 0 && val == 0) + break; + } + switch (neg) { + case 1: + *--str = '-'; + break; + case 2: + *--str = 'x'; + *--str = '0'; + break; + default: + break; + } + len = num + sizeof(num) - 1 - str; + } else { + len = strlen(str); + if (prec >= 0 && len > prec) + len = prec; + } + if (width > 0) { + if (width > buflen) + width = buflen; + if ((n = width - len) > 0) { + buflen -= n; + for (; n > 0; --n) + *buf++ = fillch; + } + } + if (len > buflen) + len = buflen; + memcpy(buf, str, len); + buf += len; + buflen -= len; } *buf = 0; return buf - buf0; @@ -434,9 +434,9 @@ log_packet(p, len, prefix, level) char *prefix; int level; { - init_pr_log(prefix, level); - ppp_format_packet(p, len, pr_log, &level); - end_pr_log(); + init_pr_log(prefix, level); + ppp_format_packet(p, len, pr_log, &level); + end_pr_log(); } #endif /* UNUSED */ @@ -446,43 +446,43 @@ log_packet(p, len, prefix, level) * calling `printer(arg, format, ...)' to output it. */ static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int i, n; u_short proto; const struct protent *protp; if (len >= 2) { - GETSHORT(proto, p); - len -= 2; - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == protp->protocol) - break; - if (protp != NULL) { - printer(arg, "[%s", protp->name); - n = (*protp->printpkt)(p, len, printer, arg); - printer(arg, "]"); - p += n; - len -= n; - } else { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == (protp->protocol & ~0x8000)) - break; - if (protp != 0 && protp->data_name != 0) { - printer(arg, "[%s data]", protp->data_name); - if (len > 8) - printer(arg, "%.8B ...", p); - else - printer(arg, "%.*B", len, p); - len = 0; - } else - printer(arg, "[proto=0x%x]", proto); - } + GETSHORT(proto, p); + len -= 2; + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == protp->protocol) + break; + if (protp != NULL) { + printer(arg, "[%s", protp->name); + n = (*protp->printpkt)(p, len, printer, arg); + printer(arg, "]"); + p += n; + len -= n; + } else { + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == (protp->protocol & ~0x8000)) + break; + if (protp != 0 && protp->data_name != 0) { + printer(arg, "[%s data]", protp->data_name); + if (len > 8) + printer(arg, "%.8B ...", p); + else + printer(arg, "%.*B", len, p); + len = 0; + } else + printer(arg, "[proto=0x%x]", proto); + } } if (len > 32) - printer(arg, "%.32B ...", p); + printer(arg, "%.32B ...", p); else - printer(arg, "%.*B", len, p); + printer(arg, "%.*B", len, p); } #endif /* PRINTPKT_SUPPORT */ @@ -491,30 +491,30 @@ static void ppp_format_packet(const u_char *p, int len, * init_pr_log, end_pr_log - initialize and finish use of pr_log. */ -static char line[256]; /* line to be logged accumulated here */ -static char *linep; /* current pointer within line */ -static int llevel; /* level for logging */ +static char line[256]; /* line to be logged accumulated here */ +static char *linep; /* current pointer within line */ +static int llevel; /* level for logging */ void init_pr_log(prefix, level) const char *prefix; int level; { - linep = line; - if (prefix != NULL) { - ppp_strlcpy(line, prefix, sizeof(line)); - linep = line + strlen(line); - } - llevel = level; + linep = line; + if (prefix != NULL) { + ppp_strlcpy(line, prefix, sizeof(line)); + linep = line + strlen(line); + } + llevel = level; } void end_pr_log() { - if (linep != line) { - *linep = 0; - ppp_log_write(llevel, line); - } + if (linep != line) { + *linep = 0; + ppp_log_write(llevel, line); + } } /* @@ -523,47 +523,47 @@ end_pr_log() void pr_log (void *arg, const char *fmt, ...) { - int l, n; - va_list pvar; - char *p, *eol; - char buf[256]; - - va_start(pvar, fmt); - n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); - va_end(pvar); - - p = buf; - eol = strchr(buf, '\n'); - if (linep != line) { - l = (eol == NULL)? n: eol - buf; - if (linep + l < line + sizeof(line)) { - if (l > 0) { - memcpy(linep, buf, l); - linep += l; - } - if (eol == NULL) - return; - p = eol + 1; - eol = strchr(p, '\n'); - } - *linep = 0; - ppp_log_write(llevel, line); - linep = line; - } - - while (eol != NULL) { - *eol = 0; - ppp_log_write(llevel, p); - p = eol + 1; - eol = strchr(p, '\n'); - } - - /* assumes sizeof(buf) <= sizeof(line) */ - l = buf + n - p; - if (l > 0) { - memcpy(line, p, n); - linep = line + l; - } + int l, n; + va_list pvar; + char *p, *eol; + char buf[256]; + + va_start(pvar, fmt); + n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); + va_end(pvar); + + p = buf; + eol = strchr(buf, '\n'); + if (linep != line) { + l = (eol == NULL)? n: eol - buf; + if (linep + l < line + sizeof(line)) { + if (l > 0) { + memcpy(linep, buf, l); + linep += l; + } + if (eol == NULL) + return; + p = eol + 1; + eol = strchr(p, '\n'); + } + *linep = 0; + ppp_log_write(llevel, line); + linep = line; + } + + while (eol != NULL) { + *eol = 0; + ppp_log_write(llevel, p); + p = eol + 1; + eol = strchr(p, '\n'); + } + + /* assumes sizeof(buf) <= sizeof(line) */ + l = buf + n - p; + if (l > 0) { + memcpy(line, p, n); + linep = line + l; + } } #endif /* UNUSED */ @@ -576,27 +576,27 @@ void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const c printer(arg, "\""); for (; len > 0; --len) { - c = *p++; - if (' ' <= c && c <= '~') { - if (c == '\\' || c == '"') - printer(arg, "\\"); - printer(arg, "%c", c); - } else { - switch (c) { - case '\n': - printer(arg, "\\n"); - break; - case '\r': - printer(arg, "\\r"); - break; - case '\t': - printer(arg, "\\t"); - break; - default: - printer(arg, "\\%.3o", (u8_t)c); - /* no break */ - } - } + c = *p++; + if (' ' <= c && c <= '~') { + if (c == '\\' || c == '"') + printer(arg, "\\"); + printer(arg, "%c", c); + } else { + switch (c) { + case '\n': + printer(arg, "\\n"); + break; + case '\r': + printer(arg, "\\r"); + break; + case '\t': + printer(arg, "\\t"); + break; + default: + printer(arg, "\\%.3o", (u8_t)c); + /* no break */ + } + } } printer(arg, "\""); } @@ -617,13 +617,13 @@ static void ppp_log_write(int level, char *buf) { PPPDEBUG(level, ("%s\n", buf) ); #if 0 if (log_to_fd >= 0 && (level != LOG_DEBUG || debug)) { - int n = strlen(buf); + int n = strlen(buf); - if (n > 0 && buf[n-1] == '\n') - --n; - if (write(log_to_fd, buf, n) != n - || write(log_to_fd, "\n", 1) != 1) - log_to_fd = -1; + if (n > 0 && buf[n-1] == '\n') + --n; + if (write(log_to_fd, buf, n) != n + || write(log_to_fd, "\n", 1) != 1) + log_to_fd = -1; } #endif } @@ -712,18 +712,18 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { */ proto = (p[0] << 8) + p[1]; if (proto < 0xC000 && (proto & ~0x8000) == proto) - return; + return; /* * don't print valid LCP echo request/reply packets if the link is up. */ if (proto == PPP_LCP && pcb->phase == PPP_PHASE_RUNNING && len >= 2 + HEADERLEN) { - unsigned char *lcp = p + 2; - int l = (lcp[2] << 8) + lcp[3]; + unsigned char *lcp = p + 2; + int l = (lcp[2] << 8) + lcp[3]; - if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) - && l >= HEADERLEN && l <= len - 2) - return; + if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) + && l >= HEADERLEN && l <= len - 2) + return; } ppp_dbglog("%s %P", tag, p, len); @@ -739,34 +739,34 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { ssize_t complete_read(int fd, void *buf, size_t count) { - size_t done; - ssize_t nb; - char *ptr = buf; - - for (done = 0; done < count; ) { - nb = read(fd, ptr, count - done); - if (nb < 0) { - if (errno == EINTR) - continue; - return -1; - } - if (nb == 0) - break; - done += nb; - ptr += nb; - } - return done; + size_t done; + ssize_t nb; + char *ptr = buf; + + for (done = 0; done < count; ) { + nb = read(fd, ptr, count - done); + if (nb < 0) { + if (errno == EINTR) + continue; + return -1; + } + if (nb == 0) + break; + done += nb; + ptr += nb; + } + return done; } /* Procedures for locking the serial device using a lock file. */ #ifndef LOCK_DIR #ifdef __linux__ -#define LOCK_DIR "/var/lock" +#define LOCK_DIR "/var/lock" #else #ifdef SVR4 -#define LOCK_DIR "/var/spool/locks" +#define LOCK_DIR "/var/spool/locks" #else -#define LOCK_DIR "/var/spool/lock" +#define LOCK_DIR "/var/spool/lock" #endif #endif #endif /* LOCK_DIR */ @@ -785,14 +785,14 @@ lock(dev) result = mklock (dev, (void *) 0); if (result == 0) { - ppp_strlcpy(lock_file, dev, sizeof(lock_file)); - return 0; + ppp_strlcpy(lock_file, dev, sizeof(lock_file)); + return 0; } if (result > 0) ppp_notice("Device %s is locked by pid %d", dev, result); else - ppp_error("Can't create lock file %s", lock_file); + ppp_error("Can't create lock file %s", lock_file); return -1; #else /* LOCKLIB */ @@ -804,83 +804,83 @@ lock(dev) struct stat sbuf; if (stat(dev, &sbuf) < 0) { - ppp_error("Can't get device number for %s: %m", dev); - return -1; + ppp_error("Can't get device number for %s: %m", dev); + return -1; } if ((sbuf.st_mode & S_IFMT) != S_IFCHR) { - ppp_error("Can't lock %s: not a character device", dev); - return -1; + ppp_error("Can't lock %s: not a character device", dev); + return -1; } ppp_slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d", - LOCK_DIR, major(sbuf.st_dev), - major(sbuf.st_rdev), minor(sbuf.st_rdev)); + LOCK_DIR, major(sbuf.st_dev), + major(sbuf.st_rdev), minor(sbuf.st_rdev)); #else char *p; char lockdev[MAXPATHLEN]; if ((p = strstr(dev, "dev/")) != NULL) { - dev = p + 4; - strncpy(lockdev, dev, MAXPATHLEN-1); - lockdev[MAXPATHLEN-1] = 0; - while ((p = strrchr(lockdev, '/')) != NULL) { - *p = '_'; - } - dev = lockdev; + dev = p + 4; + strncpy(lockdev, dev, MAXPATHLEN-1); + lockdev[MAXPATHLEN-1] = 0; + while ((p = strrchr(lockdev, '/')) != NULL) { + *p = '_'; + } + dev = lockdev; } else - if ((p = strrchr(dev, '/')) != NULL) - dev = p + 1; + if ((p = strrchr(dev, '/')) != NULL) + dev = p + 1; ppp_slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); #endif while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) { - if (errno != EEXIST) { - ppp_error("Can't create lock file %s: %m", lock_file); - break; - } - - /* Read the lock file to find out who has the device locked. */ - fd = open(lock_file, O_RDONLY, 0); - if (fd < 0) { - if (errno == ENOENT) /* This is just a timing problem. */ - continue; - ppp_error("Can't open existing lock file %s: %m", lock_file); - break; - } + if (errno != EEXIST) { + ppp_error("Can't create lock file %s: %m", lock_file); + break; + } + + /* Read the lock file to find out who has the device locked. */ + fd = open(lock_file, O_RDONLY, 0); + if (fd < 0) { + if (errno == ENOENT) /* This is just a timing problem. */ + continue; + ppp_error("Can't open existing lock file %s: %m", lock_file); + break; + } #ifndef LOCK_BINARY - n = read(fd, lock_buffer, 11); + n = read(fd, lock_buffer, 11); #else - n = read(fd, &pid, sizeof(pid)); + n = read(fd, &pid, sizeof(pid)); #endif /* LOCK_BINARY */ - close(fd); - fd = -1; - if (n <= 0) { - ppp_error("Can't read pid from lock file %s", lock_file); - break; - } - - /* See if the process still exists. */ + close(fd); + fd = -1; + if (n <= 0) { + ppp_error("Can't read pid from lock file %s", lock_file); + break; + } + + /* See if the process still exists. */ #ifndef LOCK_BINARY - lock_buffer[n] = 0; - pid = atoi(lock_buffer); + lock_buffer[n] = 0; + pid = atoi(lock_buffer); #endif /* LOCK_BINARY */ - if (pid == getpid()) - return 1; /* somebody else locked it for us */ - if (pid == 0 - || (kill(pid, 0) == -1 && errno == ESRCH)) { - if (unlink (lock_file) == 0) { - ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); - continue; - } - ppp_warn("Couldn't remove stale lock on %s", dev); - } else - ppp_notice("Device %s is locked by pid %d", dev, pid); - break; + if (pid == getpid()) + return 1; /* somebody else locked it for us */ + if (pid == 0 + || (kill(pid, 0) == -1 && errno == ESRCH)) { + if (unlink (lock_file) == 0) { + ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); + continue; + } + ppp_warn("Couldn't remove stale lock on %s", dev); + } else + ppp_notice("Device %s is locked by pid %d", dev, pid); + break; } if (fd < 0) { - lock_file[0] = 0; - return -1; + lock_file[0] = 0; + return -1; } pid = getpid(); @@ -918,12 +918,12 @@ relock(pid) char lock_buffer[12]; if (lock_file[0] == 0) - return -1; + return -1; fd = open(lock_file, O_WRONLY, 0); if (fd < 0) { - ppp_error("Couldn't reopen lock file %s: %m", lock_file); - lock_file[0] = 0; - return -1; + ppp_error("Couldn't reopen lock file %s: %m", lock_file); + lock_file[0] = 0; + return -1; } #ifndef LOCK_BINARY @@ -946,11 +946,11 @@ unlock() { if (lock_file[0]) { #ifdef LOCKLIB - (void) rmlock(lock_file, (void *) 0); + (void) rmlock(lock_file, (void *) 0); #else - unlink(lock_file); + unlink(lock_file); #endif - lock_file[0] = 0; + lock_file[0] = 0; } } diff --git a/components/net/lwip-2.0.2/test/fuzz/fuzz.c b/components/net/lwip-2.0.2/test/fuzz/fuzz.c index a9157f1385..ecf81d7e21 100644 --- a/components/net/lwip-2.0.2/test/fuzz/fuzz.c +++ b/components/net/lwip-2.0.2/test/fuzz/fuzz.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Erik Ekman * */ diff --git a/components/net/lwip-2.0.2/test/fuzz/lwipopts.h b/components/net/lwip-2.0.2/test/fuzz/lwipopts.h index 4aff09bad6..1e355599e5 100644 --- a/components/net/lwip-2.0.2/test/fuzz/lwipopts.h +++ b/components/net/lwip-2.0.2/test/fuzz/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c b/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c index 47aaa08420..a9a2507937 100644 --- a/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c +++ b/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c @@ -888,7 +888,7 @@ START_TEST(test_dhcp_nak_no_endmarker) xid = htonl(netif_dhcp_data(&net_test)->xid); memcpy(&dhcp_offer[46], &xid, 4); /* insert correct transaction id */ send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); - + fail_unless(netif_dhcp_data(&net_test)->state == DHCP_STATE_REQUESTING); fail_unless(txpacket == 2); /* No more sent */ diff --git a/components/net/lwip-2.0.2/test/unit/lwipopts.h b/components/net/lwip-2.0.2/test/unit/lwipopts.h index 25252b426c..ea0ff2e0b5 100644 --- a/components/net/lwip-2.0.2/test/unit/lwipopts.h +++ b/components/net/lwip-2.0.2/test/unit/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c b/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c index 64121ca8f3..1512b03cd1 100644 --- a/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c +++ b/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c @@ -146,13 +146,13 @@ tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, /* @todo: are these all states? */ /* @todo: remove from previous list */ pcb->state = state; - + iss = tcp_next_iss(pcb); pcb->snd_wl2 = iss; pcb->snd_nxt = iss; pcb->lastack = iss; pcb->snd_lbb = iss; - + if (state == ESTABLISHED) { TCP_REG(&tcp_active_pcbs, pcb); ip_addr_copy(pcb->local_ip, *local_ip); diff --git a/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c b/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c index d99b807d96..86dd6cc95c 100644 --- a/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c +++ b/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c @@ -281,7 +281,7 @@ START_TEST(test_tcp_fast_retx_recover) EXPECT_RET(pcb->dupacks == 3); memset(&txcounters, 0, sizeof(txcounters)); /* @todo: check expected data?*/ - + /* send data5, not output yet */ err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); EXPECT_RET(err == ERR_OK); diff --git a/components/net/lwip-2.1.2/src/api/tcpip.c b/components/net/lwip-2.1.2/src/api/tcpip.c index 743553a587..b0382e83c4 100644 --- a/components/net/lwip-2.1.2/src/api/tcpip.c +++ b/components/net/lwip-2.1.2/src/api/tcpip.c @@ -519,7 +519,7 @@ tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call) * e.g. the message is allocated once and posted several times from an IRQ * using tcpip_callbackmsg_trycallback(). * Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context. - * + * * @param function the function to call * @param ctx parameter passed to function * @return a struct pointer to pass to tcpip_callbackmsg_trycallback(). diff --git a/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c b/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c index d642decb54..d5ff3fe4f0 100644 --- a/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c +++ b/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c @@ -886,7 +886,7 @@ altcp_tls_free_config(struct altcp_tls_config *conf) } if (conf->ca) { mbedtls_x509_crt_free(conf->ca); - } + } altcp_mbedtls_free_config(conf); } diff --git a/components/net/lwip-2.1.2/src/apps/http/http_client.c b/components/net/lwip-2.1.2/src/apps/http/http_client.c index 82da60d73a..6fbb691510 100644 --- a/components/net/lwip-2.1.2/src/apps/http/http_client.c +++ b/components/net/lwip-2.1.2/src/apps/http/http_client.c @@ -615,7 +615,7 @@ httpc_init_connection_addr(httpc_state_t **connection, const httpc_connection_t } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file by passing server IP address * * @param server_addr IP address of the server to connect @@ -660,7 +660,7 @@ httpc_get_file(const ip_addr_t* server_addr, u16_t port, const char* uri, const } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file by passing server name as string (DNS name or IP address string) * * @param server_name server name as string (DNS name or IP address string) @@ -802,7 +802,7 @@ httpc_fs_tcp_recv(void *arg, struct altcp_pcb *pcb, struct pbuf *p, err_t err) } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file to disk by passing server IP address * * @param server_addr IP address of the server to connect @@ -854,7 +854,7 @@ httpc_get_file_to_disk(const ip_addr_t* server_addr, u16_t port, const char* uri } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file to disk by passing server name as string (DNS name or IP address string) * * @param server_name server name as string (DNS name or IP address string) diff --git a/components/net/lwip-2.1.2/src/apps/http/httpd.c b/components/net/lwip-2.1.2/src/apps/http/httpd.c index ccc9ba7284..6e53b48412 100644 --- a/components/net/lwip-2.1.2/src/apps/http/httpd.c +++ b/components/net/lwip-2.1.2/src/apps/http/httpd.c @@ -233,7 +233,7 @@ struct http_ssi_state { struct http_ssi_tag_description { const char *lead_in; - const char *lead_out; + const char *lead_out; }; #endif /* LWIP_HTTPD_SSI */ diff --git a/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h b/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h index 32ae5e84a9..88043e8e93 100644 --- a/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h +++ b/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h @@ -121,7 +121,7 @@ extern "C" { /* readdir_r is a POSIX-only function, and may not be available under various * environments/settings, e.g. MinGW. Use readdir fallback */ #if _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE ||\ - _POSIX_SOURCE + _POSIX_SOURCE # define _TINYDIR_HAS_READDIR_R #endif #if _POSIX_C_SOURCE >= 200112L @@ -129,16 +129,16 @@ extern "C" { # include #endif #if _BSD_SOURCE || _SVID_SOURCE || \ - (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) + (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) # define _TINYDIR_HAS_DIRFD # include #endif #if defined _TINYDIR_HAS_FPATHCONF && defined _TINYDIR_HAS_DIRFD &&\ - defined _PC_NAME_MAX + defined _PC_NAME_MAX # define _TINYDIR_USE_FPATHCONF #endif #if defined __MINGW32__ || !defined _TINYDIR_HAS_READDIR_R ||\ - !(defined _TINYDIR_USE_FPATHCONF || defined NAME_MAX) + !(defined _TINYDIR_USE_FPATHCONF || defined NAME_MAX) # define _TINYDIR_USE_READDIR #endif @@ -172,42 +172,42 @@ extern "C" { #endif #if !defined(_TINYDIR_MALLOC) - #define _TINYDIR_MALLOC(_size) malloc(_size) - #define _TINYDIR_FREE(_ptr) free(_ptr) + #define _TINYDIR_MALLOC(_size) malloc(_size) + #define _TINYDIR_FREE(_ptr) free(_ptr) #endif /* !defined(_TINYDIR_MALLOC) */ typedef struct tinydir_file { - _tinydir_char_t path[_TINYDIR_PATH_MAX]; - _tinydir_char_t name[_TINYDIR_FILENAME_MAX]; - _tinydir_char_t *extension; - int is_dir; - int is_reg; + _tinydir_char_t path[_TINYDIR_PATH_MAX]; + _tinydir_char_t name[_TINYDIR_FILENAME_MAX]; + _tinydir_char_t *extension; + int is_dir; + int is_reg; #ifndef _MSC_VER #ifdef __MINGW32__ - struct _stat _s; + struct _stat _s; #else - struct stat _s; + struct stat _s; #endif #endif } tinydir_file; typedef struct tinydir_dir { - _tinydir_char_t path[_TINYDIR_PATH_MAX]; - int has_next; - size_t n_files; + _tinydir_char_t path[_TINYDIR_PATH_MAX]; + int has_next; + size_t n_files; - tinydir_file *_files; + tinydir_file *_files; #ifdef _MSC_VER - HANDLE _h; - WIN32_FIND_DATA _f; + HANDLE _h; + WIN32_FIND_DATA _f; #else - _TINYDIR_DIR *_d; - struct _tinydir_dirent *_e; + _TINYDIR_DIR *_d; + struct _tinydir_dirent *_e; #ifndef _TINYDIR_USE_READDIR - struct _tinydir_dirent *_ep; + struct _tinydir_dirent *_ep; #endif #endif } tinydir_dir; @@ -252,184 +252,184 @@ int tinydir_open(tinydir_dir *dir, const _tinydir_char_t *path) { #ifndef _MSC_VER #ifndef _TINYDIR_USE_READDIR - int error; - int size; /* using int size */ + int error; + int size; /* using int size */ #endif #else - _tinydir_char_t path_buf[_TINYDIR_PATH_MAX]; -#endif - _tinydir_char_t *pathp; - - if (dir == NULL || path == NULL || _tinydir_strlen(path) == 0) - { - errno = EINVAL; - return -1; - } - if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) - { - errno = ENAMETOOLONG; - return -1; - } - - /* initialise dir */ - dir->_files = NULL; + _tinydir_char_t path_buf[_TINYDIR_PATH_MAX]; +#endif + _tinydir_char_t *pathp; + + if (dir == NULL || path == NULL || _tinydir_strlen(path) == 0) + { + errno = EINVAL; + return -1; + } + if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) + { + errno = ENAMETOOLONG; + return -1; + } + + /* initialise dir */ + dir->_files = NULL; #ifdef _MSC_VER - dir->_h = INVALID_HANDLE_VALUE; + dir->_h = INVALID_HANDLE_VALUE; #else - dir->_d = NULL; + dir->_d = NULL; #ifndef _TINYDIR_USE_READDIR - dir->_ep = NULL; + dir->_ep = NULL; #endif #endif - tinydir_close(dir); + tinydir_close(dir); - _tinydir_strcpy(dir->path, path); - /* Remove trailing slashes */ - pathp = &dir->path[_tinydir_strlen(dir->path) - 1]; - while (pathp != dir->path && (*pathp == TINYDIR_STRING('\\') || *pathp == TINYDIR_STRING('/'))) - { - *pathp = TINYDIR_STRING('\0'); - pathp++; - } + _tinydir_strcpy(dir->path, path); + /* Remove trailing slashes */ + pathp = &dir->path[_tinydir_strlen(dir->path) - 1]; + while (pathp != dir->path && (*pathp == TINYDIR_STRING('\\') || *pathp == TINYDIR_STRING('/'))) + { + *pathp = TINYDIR_STRING('\0'); + pathp++; + } #ifdef _MSC_VER - _tinydir_strcpy(path_buf, dir->path); - _tinydir_strcat(path_buf, TINYDIR_STRING("\\*")); + _tinydir_strcpy(path_buf, dir->path); + _tinydir_strcat(path_buf, TINYDIR_STRING("\\*")); #if (defined WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) - dir->_h = FindFirstFileEx(path_buf, FindExInfoStandard, &dir->_f, FindExSearchNameMatch, NULL, 0); + dir->_h = FindFirstFileEx(path_buf, FindExInfoStandard, &dir->_f, FindExSearchNameMatch, NULL, 0); #else - dir->_h = FindFirstFile(path_buf, &dir->_f); + dir->_h = FindFirstFile(path_buf, &dir->_f); #endif - if (dir->_h == INVALID_HANDLE_VALUE) - { - errno = ENOENT; + if (dir->_h == INVALID_HANDLE_VALUE) + { + errno = ENOENT; #else - dir->_d = _tinydir_opendir(path); - if (dir->_d == NULL) - { + dir->_d = _tinydir_opendir(path); + if (dir->_d == NULL) + { #endif - goto bail; - } + goto bail; + } - /* read first file */ - dir->has_next = 1; + /* read first file */ + dir->has_next = 1; #ifndef _MSC_VER #ifdef _TINYDIR_USE_READDIR - dir->_e = _tinydir_readdir(dir->_d); + dir->_e = _tinydir_readdir(dir->_d); #else - /* allocate dirent buffer for readdir_r */ - size = _tinydir_dirent_buf_size(dir->_d); /* conversion to int */ - if (size == -1) return -1; - dir->_ep = (struct _tinydir_dirent*)_TINYDIR_MALLOC(size); - if (dir->_ep == NULL) return -1; + /* allocate dirent buffer for readdir_r */ + size = _tinydir_dirent_buf_size(dir->_d); /* conversion to int */ + if (size == -1) return -1; + dir->_ep = (struct _tinydir_dirent*)_TINYDIR_MALLOC(size); + if (dir->_ep == NULL) return -1; - error = readdir_r(dir->_d, dir->_ep, &dir->_e); - if (error != 0) return -1; + error = readdir_r(dir->_d, dir->_ep, &dir->_e); + if (error != 0) return -1; #endif - if (dir->_e == NULL) - { - dir->has_next = 0; - } + if (dir->_e == NULL) + { + dir->has_next = 0; + } #endif - return 0; + return 0; bail: - tinydir_close(dir); - return -1; + tinydir_close(dir); + return -1; } _TINYDIR_FUNC int tinydir_open_sorted(tinydir_dir *dir, const _tinydir_char_t *path) { - /* Count the number of files first, to pre-allocate the files array */ - size_t n_files = 0; - if (tinydir_open(dir, path) == -1) - { - return -1; - } - while (dir->has_next) - { - n_files++; - if (tinydir_next(dir) == -1) - { - goto bail; - } - } - tinydir_close(dir); - - if (tinydir_open(dir, path) == -1) - { - return -1; - } - - dir->n_files = 0; - dir->_files = (tinydir_file *)_TINYDIR_MALLOC(sizeof *dir->_files * n_files); - if (dir->_files == NULL) - { - goto bail; - } - while (dir->has_next) - { - tinydir_file *p_file; - dir->n_files++; - - p_file = &dir->_files[dir->n_files - 1]; - if (tinydir_readfile(dir, p_file) == -1) - { - goto bail; - } - - if (tinydir_next(dir) == -1) - { - goto bail; - } - - /* Just in case the number of files has changed between the first and - second reads, terminate without writing into unallocated memory */ - if (dir->n_files == n_files) - { - break; - } - } - - qsort(dir->_files, dir->n_files, sizeof(tinydir_file), _tinydir_file_cmp); - - return 0; + /* Count the number of files first, to pre-allocate the files array */ + size_t n_files = 0; + if (tinydir_open(dir, path) == -1) + { + return -1; + } + while (dir->has_next) + { + n_files++; + if (tinydir_next(dir) == -1) + { + goto bail; + } + } + tinydir_close(dir); + + if (tinydir_open(dir, path) == -1) + { + return -1; + } + + dir->n_files = 0; + dir->_files = (tinydir_file *)_TINYDIR_MALLOC(sizeof *dir->_files * n_files); + if (dir->_files == NULL) + { + goto bail; + } + while (dir->has_next) + { + tinydir_file *p_file; + dir->n_files++; + + p_file = &dir->_files[dir->n_files - 1]; + if (tinydir_readfile(dir, p_file) == -1) + { + goto bail; + } + + if (tinydir_next(dir) == -1) + { + goto bail; + } + + /* Just in case the number of files has changed between the first and + second reads, terminate without writing into unallocated memory */ + if (dir->n_files == n_files) + { + break; + } + } + + qsort(dir->_files, dir->n_files, sizeof(tinydir_file), _tinydir_file_cmp); + + return 0; bail: - tinydir_close(dir); - return -1; + tinydir_close(dir); + return -1; } _TINYDIR_FUNC void tinydir_close(tinydir_dir *dir) { - if (dir == NULL) - { - return; - } - - memset(dir->path, 0, sizeof(dir->path)); - dir->has_next = 0; - dir->n_files = 0; - _TINYDIR_FREE(dir->_files); - dir->_files = NULL; + if (dir == NULL) + { + return; + } + + memset(dir->path, 0, sizeof(dir->path)); + dir->has_next = 0; + dir->n_files = 0; + _TINYDIR_FREE(dir->_files); + dir->_files = NULL; #ifdef _MSC_VER - if (dir->_h != INVALID_HANDLE_VALUE) - { - FindClose(dir->_h); - } - dir->_h = INVALID_HANDLE_VALUE; + if (dir->_h != INVALID_HANDLE_VALUE) + { + FindClose(dir->_h); + } + dir->_h = INVALID_HANDLE_VALUE; #else - if (dir->_d) - { - _tinydir_closedir(dir->_d); - } - dir->_d = NULL; - dir->_e = NULL; + if (dir->_d) + { + _tinydir_closedir(dir->_d); + } + dir->_d = NULL; + dir->_e = NULL; #ifndef _TINYDIR_USE_READDIR - _TINYDIR_FREE(dir->_ep); - dir->_ep = NULL; + _TINYDIR_FREE(dir->_ep); + dir->_ep = NULL; #endif #endif } @@ -437,323 +437,323 @@ void tinydir_close(tinydir_dir *dir) _TINYDIR_FUNC int tinydir_next(tinydir_dir *dir) { - if (dir == NULL) - { - errno = EINVAL; - return -1; - } - if (!dir->has_next) - { - errno = ENOENT; - return -1; - } + if (dir == NULL) + { + errno = EINVAL; + return -1; + } + if (!dir->has_next) + { + errno = ENOENT; + return -1; + } #ifdef _MSC_VER - if (FindNextFile(dir->_h, &dir->_f) == 0) + if (FindNextFile(dir->_h, &dir->_f) == 0) #else #ifdef _TINYDIR_USE_READDIR - dir->_e = _tinydir_readdir(dir->_d); + dir->_e = _tinydir_readdir(dir->_d); #else - if (dir->_ep == NULL) - { - return -1; - } - if (readdir_r(dir->_d, dir->_ep, &dir->_e) != 0) - { - return -1; - } -#endif - if (dir->_e == NULL) -#endif - { - dir->has_next = 0; + if (dir->_ep == NULL) + { + return -1; + } + if (readdir_r(dir->_d, dir->_ep, &dir->_e) != 0) + { + return -1; + } +#endif + if (dir->_e == NULL) +#endif + { + dir->has_next = 0; #ifdef _MSC_VER - if (GetLastError() != ERROR_SUCCESS && - GetLastError() != ERROR_NO_MORE_FILES) - { - tinydir_close(dir); - errno = EIO; - return -1; - } + if (GetLastError() != ERROR_SUCCESS && + GetLastError() != ERROR_NO_MORE_FILES) + { + tinydir_close(dir); + errno = EIO; + return -1; + } #endif - } + } - return 0; + return 0; } _TINYDIR_FUNC int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file) { - if (dir == NULL || file == NULL) - { - errno = EINVAL; - return -1; - } + if (dir == NULL || file == NULL) + { + errno = EINVAL; + return -1; + } #ifdef _MSC_VER - if (dir->_h == INVALID_HANDLE_VALUE) + if (dir->_h == INVALID_HANDLE_VALUE) #else - if (dir->_e == NULL) -#endif - { - errno = ENOENT; - return -1; - } - if (_tinydir_strlen(dir->path) + - _tinydir_strlen( + if (dir->_e == NULL) +#endif + { + errno = ENOENT; + return -1; + } + if (_tinydir_strlen(dir->path) + + _tinydir_strlen( #ifdef _MSC_VER - dir->_f.cFileName + dir->_f.cFileName #else - dir->_e->d_name -#endif - ) + 1 + _TINYDIR_PATH_EXTRA >= - _TINYDIR_PATH_MAX) - { - /* the path for the file will be too long */ - errno = ENAMETOOLONG; - return -1; - } - if (_tinydir_strlen( + dir->_e->d_name +#endif + ) + 1 + _TINYDIR_PATH_EXTRA >= + _TINYDIR_PATH_MAX) + { + /* the path for the file will be too long */ + errno = ENAMETOOLONG; + return -1; + } + if (_tinydir_strlen( #ifdef _MSC_VER - dir->_f.cFileName + dir->_f.cFileName #else - dir->_e->d_name + dir->_e->d_name #endif - ) >= _TINYDIR_FILENAME_MAX) - { - errno = ENAMETOOLONG; - return -1; - } + ) >= _TINYDIR_FILENAME_MAX) + { + errno = ENAMETOOLONG; + return -1; + } - _tinydir_strcpy(file->path, dir->path); - _tinydir_strcat(file->path, TINYDIR_STRING("/")); - _tinydir_strcpy(file->name, + _tinydir_strcpy(file->path, dir->path); + _tinydir_strcat(file->path, TINYDIR_STRING("/")); + _tinydir_strcpy(file->name, #ifdef _MSC_VER - dir->_f.cFileName + dir->_f.cFileName #else - dir->_e->d_name + dir->_e->d_name #endif - ); - _tinydir_strcat(file->path, file->name); + ); + _tinydir_strcat(file->path, file->name); #ifndef _MSC_VER #ifdef __MINGW32__ - if (_tstat( + if (_tstat( #else - if (stat( + if (stat( #endif - file->path, &file->_s) == -1) - { - return -1; - } + file->path, &file->_s) == -1) + { + return -1; + } #endif - _tinydir_get_ext(file); + _tinydir_get_ext(file); - file->is_dir = + file->is_dir = #ifdef _MSC_VER - !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); #else - S_ISDIR(file->_s.st_mode); + S_ISDIR(file->_s.st_mode); #endif - file->is_reg = + file->is_reg = #ifdef _MSC_VER - !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) || - ( - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) && - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) && + !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) || + ( + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) && #ifdef FILE_ATTRIBUTE_INTEGRITY_STREAM - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) && #endif #ifdef FILE_ATTRIBUTE_NO_SCRUB_DATA - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) && #endif - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) && - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY)); + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY)); #else - S_ISREG(file->_s.st_mode); + S_ISREG(file->_s.st_mode); #endif - return 0; + return 0; } _TINYDIR_FUNC int tinydir_readfile_n(const tinydir_dir *dir, tinydir_file *file, size_t i) { - if (dir == NULL || file == NULL) - { - errno = EINVAL; - return -1; - } - if (i >= dir->n_files) - { - errno = ENOENT; - return -1; - } - - memcpy(file, &dir->_files[i], sizeof(tinydir_file)); - _tinydir_get_ext(file); - - return 0; + if (dir == NULL || file == NULL) + { + errno = EINVAL; + return -1; + } + if (i >= dir->n_files) + { + errno = ENOENT; + return -1; + } + + memcpy(file, &dir->_files[i], sizeof(tinydir_file)); + _tinydir_get_ext(file); + + return 0; } _TINYDIR_FUNC int tinydir_open_subdir_n(tinydir_dir *dir, size_t i) { - _tinydir_char_t path[_TINYDIR_PATH_MAX]; - if (dir == NULL) - { - errno = EINVAL; - return -1; - } - if (i >= dir->n_files || !dir->_files[i].is_dir) - { - errno = ENOENT; - return -1; - } - - _tinydir_strcpy(path, dir->_files[i].path); - tinydir_close(dir); - if (tinydir_open_sorted(dir, path) == -1) - { - return -1; - } - - return 0; + _tinydir_char_t path[_TINYDIR_PATH_MAX]; + if (dir == NULL) + { + errno = EINVAL; + return -1; + } + if (i >= dir->n_files || !dir->_files[i].is_dir) + { + errno = ENOENT; + return -1; + } + + _tinydir_strcpy(path, dir->_files[i].path); + tinydir_close(dir); + if (tinydir_open_sorted(dir, path) == -1) + { + return -1; + } + + return 0; } /* Open a single file given its path */ _TINYDIR_FUNC int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path) { - tinydir_dir dir; - int result = 0; - int found = 0; - _tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX]; - _tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX]; - _tinydir_char_t *dir_name; - _tinydir_char_t *base_name; + tinydir_dir dir; + int result = 0; + int found = 0; + _tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX]; + _tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX]; + _tinydir_char_t *dir_name; + _tinydir_char_t *base_name; #if (defined _MSC_VER || defined __MINGW32__) - _tinydir_char_t drive_buf[_TINYDIR_PATH_MAX]; - _tinydir_char_t ext_buf[_TINYDIR_FILENAME_MAX]; -#endif - - if (file == NULL || path == NULL || _tinydir_strlen(path) == 0) - { - errno = EINVAL; - return -1; - } - if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) - { - errno = ENAMETOOLONG; - return -1; - } - - /* Get the parent path */ + _tinydir_char_t drive_buf[_TINYDIR_PATH_MAX]; + _tinydir_char_t ext_buf[_TINYDIR_FILENAME_MAX]; +#endif + + if (file == NULL || path == NULL || _tinydir_strlen(path) == 0) + { + errno = EINVAL; + return -1; + } + if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) + { + errno = ENAMETOOLONG; + return -1; + } + + /* Get the parent path */ #if (defined _MSC_VER || defined __MINGW32__) #if ((defined _MSC_VER) && (_MSC_VER >= 1400)) - _tsplitpath_s( - path, - drive_buf, _TINYDIR_DRIVE_MAX, - dir_name_buf, _TINYDIR_FILENAME_MAX, - file_name_buf, _TINYDIR_FILENAME_MAX, - ext_buf, _TINYDIR_FILENAME_MAX); + _tsplitpath_s( + path, + drive_buf, _TINYDIR_DRIVE_MAX, + dir_name_buf, _TINYDIR_FILENAME_MAX, + file_name_buf, _TINYDIR_FILENAME_MAX, + ext_buf, _TINYDIR_FILENAME_MAX); #else - _tsplitpath( - path, - drive_buf, - dir_name_buf, - file_name_buf, - ext_buf); + _tsplitpath( + path, + drive_buf, + dir_name_buf, + file_name_buf, + ext_buf); #endif /* _splitpath_s not work fine with only filename and widechar support */ #ifdef _UNICODE - if (drive_buf[0] == L'\xFEFE') - drive_buf[0] = '\0'; - if (dir_name_buf[0] == L'\xFEFE') - dir_name_buf[0] = '\0'; -#endif - - if (errno) - { - errno = EINVAL; - return -1; - } - /* Emulate the behavior of dirname by returning "." for dir name if it's - empty */ - if (drive_buf[0] == '\0' && dir_name_buf[0] == '\0') - { - _tinydir_strcpy(dir_name_buf, TINYDIR_STRING(".")); - } - /* Concatenate the drive letter and dir name to form full dir name */ - _tinydir_strcat(drive_buf, dir_name_buf); - dir_name = drive_buf; - /* Concatenate the file name and extension to form base name */ - _tinydir_strcat(file_name_buf, ext_buf); - base_name = file_name_buf; + if (drive_buf[0] == L'\xFEFE') + drive_buf[0] = '\0'; + if (dir_name_buf[0] == L'\xFEFE') + dir_name_buf[0] = '\0'; +#endif + + if (errno) + { + errno = EINVAL; + return -1; + } + /* Emulate the behavior of dirname by returning "." for dir name if it's + empty */ + if (drive_buf[0] == '\0' && dir_name_buf[0] == '\0') + { + _tinydir_strcpy(dir_name_buf, TINYDIR_STRING(".")); + } + /* Concatenate the drive letter and dir name to form full dir name */ + _tinydir_strcat(drive_buf, dir_name_buf); + dir_name = drive_buf; + /* Concatenate the file name and extension to form base name */ + _tinydir_strcat(file_name_buf, ext_buf); + base_name = file_name_buf; #else - _tinydir_strcpy(dir_name_buf, path); - dir_name = dirname(dir_name_buf); - _tinydir_strcpy(file_name_buf, path); - base_name =basename(file_name_buf); -#endif - - /* Open the parent directory */ - if (tinydir_open(&dir, dir_name) == -1) - { - return -1; - } - - /* Read through the parent directory and look for the file */ - while (dir.has_next) - { - if (tinydir_readfile(&dir, file) == -1) - { - result = -1; - goto bail; - } - if (_tinydir_strcmp(file->name, base_name) == 0) - { - /* File found */ - found = 1; - break; - } - tinydir_next(&dir); - } - if (!found) - { - result = -1; - errno = ENOENT; - } + _tinydir_strcpy(dir_name_buf, path); + dir_name = dirname(dir_name_buf); + _tinydir_strcpy(file_name_buf, path); + base_name =basename(file_name_buf); +#endif + + /* Open the parent directory */ + if (tinydir_open(&dir, dir_name) == -1) + { + return -1; + } + + /* Read through the parent directory and look for the file */ + while (dir.has_next) + { + if (tinydir_readfile(&dir, file) == -1) + { + result = -1; + goto bail; + } + if (_tinydir_strcmp(file->name, base_name) == 0) + { + /* File found */ + found = 1; + break; + } + tinydir_next(&dir); + } + if (!found) + { + result = -1; + errno = ENOENT; + } bail: - tinydir_close(&dir); - return result; + tinydir_close(&dir); + return result; } _TINYDIR_FUNC void _tinydir_get_ext(tinydir_file *file) { - _tinydir_char_t *period = _tinydir_strrchr(file->name, TINYDIR_STRING('.')); - if (period == NULL) - { - file->extension = &(file->name[_tinydir_strlen(file->name)]); - } - else - { - file->extension = period + 1; - } + _tinydir_char_t *period = _tinydir_strrchr(file->name, TINYDIR_STRING('.')); + if (period == NULL) + { + file->extension = &(file->name[_tinydir_strlen(file->name)]); + } + else + { + file->extension = period + 1; + } } _TINYDIR_FUNC int _tinydir_file_cmp(const void *a, const void *b) { - const tinydir_file *fa = (const tinydir_file *)a; - const tinydir_file *fb = (const tinydir_file *)b; - if (fa->is_dir != fb->is_dir) - { - return -(fa->is_dir - fb->is_dir); - } - return _tinydir_strncmp(fa->name, fb->name, _TINYDIR_FILENAME_MAX); + const tinydir_file *fa = (const tinydir_file *)a; + const tinydir_file *fb = (const tinydir_file *)b; + if (fa->is_dir != fb->is_dir) + { + return -(fa->is_dir - fb->is_dir); + } + return _tinydir_strncmp(fa->name, fb->name, _TINYDIR_FILENAME_MAX); } #ifndef _MSC_VER @@ -772,27 +772,27 @@ from https://womble.decadent.org.uk/readdir_r-advisory.html _TINYDIR_FUNC size_t _tinydir_dirent_buf_size(_TINYDIR_DIR *dirp) { - long name_max; - size_t name_end; - /* parameter may be unused */ - (void)dirp; + long name_max; + size_t name_end; + /* parameter may be unused */ + (void)dirp; #if defined _TINYDIR_USE_FPATHCONF - name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX); - if (name_max == -1) + name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX); + if (name_max == -1) #if defined(NAME_MAX) - name_max = (NAME_MAX > 255) ? NAME_MAX : 255; + name_max = (NAME_MAX > 255) ? NAME_MAX : 255; #else - return (size_t)(-1); + return (size_t)(-1); #endif #elif defined(NAME_MAX) - name_max = (NAME_MAX > 255) ? NAME_MAX : 255; + name_max = (NAME_MAX > 255) ? NAME_MAX : 255; #else #error "buffer size for readdir_r cannot be determined" #endif - name_end = (size_t)offsetof(struct _tinydir_dirent, d_name) + name_max + 1; - return (name_end > sizeof(struct _tinydir_dirent) ? - name_end : sizeof(struct _tinydir_dirent)); + name_end = (size_t)offsetof(struct _tinydir_dirent, d_name) + name_max + 1; + return (name_end > sizeof(struct _tinydir_dirent) ? + name_end : sizeof(struct _tinydir_dirent)); } #endif #endif diff --git a/components/net/lwip-2.1.2/src/apps/smtp/smtp.c b/components/net/lwip-2.1.2/src/apps/smtp/smtp.c index 55303c35d4..2aa21ce045 100644 --- a/components/net/lwip-2.1.2/src/apps/smtp/smtp.c +++ b/components/net/lwip-2.1.2/src/apps/smtp/smtp.c @@ -1,12 +1,12 @@ /** * @file * SMTP client module - * + * * Author: Simon Goldschmidt * * @defgroup smtp SMTP client * @ingroup apps - * + * * This is simple SMTP client for raw API. * It is a minimal implementation of SMTP as specified in RFC 5321. * @@ -29,7 +29,7 @@ * When using from any other thread than the tcpip_thread (for NO_SYS==0), use * smtp_send_mail_int()! - * + * * SMTP_BODYDH usage: @code{.c} int my_smtp_bodydh_fn(void *arg, struct smtp_bodydh *bdh) @@ -42,11 +42,11 @@ ++bdh->state; return BDH_WORKING; } - - smtp_send_mail_bodycback("sender", "recipient", "subject", + + smtp_send_mail_bodycback("sender", "recipient", "subject", my_smtp_bodydh_fn, my_smtp_result_fn, some_argument); @endcode - * + * * @todo: * - attachments (the main difficulty here is streaming base64-encoding to * prevent having to allocate a buffer for the whole encoded file at once) diff --git a/components/net/lwip-2.1.2/src/arch/include/arch/cc.h b/components/net/lwip-2.1.2/src/arch/include/arch/cc.h index 2c22d3a873..320beb53e0 100644 --- a/components/net/lwip-2.1.2/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.1.2/src/arch/include/arch/cc.h @@ -53,17 +53,17 @@ /* some errno not defined in newlib */ #define ENSRNOTFOUND 163 /* Domain name not found */ /* WARNING: ESHUTDOWN also not defined in newlib. We chose - 180 here because the number "108" which is used - in arch.h has been assigned to another error code. */ + 180 here because the number "108" which is used + in arch.h has been assigned to another error code. */ #define ESHUTDOWN 180 #endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */ #endif /* RT_USING_LIBC */ #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #include -#define LWIP_TIMEVAL_PRIVATE 0 +#define LWIP_TIMEVAL_PRIVATE 0 #else -#define LWIP_TIMEVAL_PRIVATE 1 +#define LWIP_TIMEVAL_PRIVATE 1 #endif #if defined(__CC_ARM) /* ARMCC compiler */ @@ -95,14 +95,14 @@ #endif void sys_arch_assert(const char* file, int line); -#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) +#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) #define LWIP_PLATFORM_ASSERT(x) do {rt_kprintf(x); sys_arch_assert(__FILE__, __LINE__);}while(0) #include "string.h" -#define SYS_ARCH_DECL_PROTECT(level) -#define SYS_ARCH_PROTECT(level) rt_enter_critical() -#define SYS_ARCH_UNPROTECT(level) rt_exit_critical() +#define SYS_ARCH_DECL_PROTECT(level) +#define SYS_ARCH_PROTECT(level) rt_enter_critical() +#define SYS_ARCH_UNPROTECT(level) rt_exit_critical() #endif /* __ARCH_CC_H__ */ diff --git a/components/net/lwip-2.1.2/src/arch/include/arch/perf.h b/components/net/lwip-2.1.2/src/arch/include/arch/perf.h index 675f1f65dc..4b7720ef40 100644 --- a/components/net/lwip-2.1.2/src/arch/include/arch/perf.h +++ b/components/net/lwip-2.1.2/src/arch/include/arch/perf.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: perf.h,v 1.1.1.1 2004/12/16 14:17:13 bear Exp $ @@ -42,8 +42,8 @@ /* void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); + unsigned long c2l, unsigned long c2h, + char *key); void perf_print_times(struct tms *start, struct tms *end, char *key); diff --git a/components/net/lwip-2.1.2/src/arch/sys_arch.c b/components/net/lwip-2.1.2/src/arch/sys_arch.c index a0eeed1073..c97609a4ea 100644 --- a/components/net/lwip-2.1.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/src/arch/sys_arch.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (C) 2006-2018, RT-Thread Development Team + * COPYRIGHT (C) 2006-2021, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/components/net/lwip-2.1.2/src/core/altcp.c b/components/net/lwip-2.1.2/src/core/altcp.c index d46d6cdb1d..1156307aca 100644 --- a/components/net/lwip-2.1.2/src/core/altcp.c +++ b/components/net/lwip-2.1.2/src/core/altcp.c @@ -158,7 +158,7 @@ altcp_free(struct altcp_pcb *conn) /** * @ingroup altcp - * altcp_new_ip6: @ref altcp_new for IPv6 + * altcp_new_ip6: @ref altcp_new for IPv6 */ struct altcp_pcb * altcp_new_ip6(altcp_allocator_t *allocator) @@ -166,9 +166,9 @@ altcp_new_ip6(altcp_allocator_t *allocator) return altcp_new_ip_type(allocator, IPADDR_TYPE_V6); } -/** +/** * @ingroup altcp - * altcp_new: @ref altcp_new for IPv4 + * altcp_new: @ref altcp_new for IPv4 */ struct altcp_pcb * altcp_new(altcp_allocator_t *allocator) diff --git a/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c b/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c index 534574feac..1427900ebd 100644 --- a/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c +++ b/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c @@ -1743,7 +1743,7 @@ decode_next: /* make sure the string is really NULL-terminated */ dhcp->boot_file_name[DHCP_FILE_LEN-1] = 0; } -#endif /* LWIP_DHCP_BOOTP_FILE */ +#endif /* LWIP_DHCP_BOOTP_FILE */ return ERR_OK; } diff --git a/components/net/lwip-2.1.2/src/core/ipv6/ip6.c b/components/net/lwip-2.1.2/src/core/ipv6/ip6.c index eda11dc882..afa69f1be9 100644 --- a/components/net/lwip-2.1.2/src/core/ipv6/ip6.c +++ b/components/net/lwip-2.1.2/src/core/ipv6/ip6.c @@ -1047,7 +1047,7 @@ options_done: LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len)); ip_data.current_ip_header_tot_len = hlen_tot; - + #if LWIP_RAW /* p points to IPv6 header again for raw_input. */ pbuf_add_header_force(p, hlen_tot); diff --git a/components/net/lwip-2.1.2/src/core/ipv6/mld6.c b/components/net/lwip-2.1.2/src/core/ipv6/mld6.c index 6387d468cc..fb4e9ef49a 100644 --- a/components/net/lwip-2.1.2/src/core/ipv6/mld6.c +++ b/components/net/lwip-2.1.2/src/core/ipv6/mld6.c @@ -6,7 +6,7 @@ * @ingroup ip6 * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. * No support for MLDv2.\n - * Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your + * Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your * netif since it must always be received for correct IPv6 operation (e.g. SLAAC). * Ensure the netif filters are configured accordingly!\n * The netif flags also need NETIF_FLAG_MLD6 flag set to enable MLD6 on a diff --git a/components/net/lwip-2.1.2/src/core/ipv6/nd6.c b/components/net/lwip-2.1.2/src/core/ipv6/nd6.c index db0c132e48..75899c65f4 100644 --- a/components/net/lwip-2.1.2/src/core/ipv6/nd6.c +++ b/components/net/lwip-2.1.2/src/core/ipv6/nd6.c @@ -1835,9 +1835,9 @@ nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif) for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) { /* check if router already exists (this is a special case for 2 netifs on the same subnet - e.g. wifi and cable) */ - if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ - return router_index; - } + if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ + return router_index; + } if (default_router_list[router_index].neighbor_entry == NULL) { /* remember lowest free index to create a new entry */ free_router_index = router_index; diff --git a/components/net/lwip-2.1.2/src/core/sys.c b/components/net/lwip-2.1.2/src/core/sys.c index 5f08352bfb..69d7197a1f 100644 --- a/components/net/lwip-2.1.2/src/core/sys.c +++ b/components/net/lwip-2.1.2/src/core/sys.c @@ -45,30 +45,30 @@ * No need to implement functions in this section in NO_SYS mode. * The OS-specific code should be implemented in arch/sys_arch.h * and sys_arch.c of your port. - * + * * The operating system emulation layer provides a common interface * between the lwIP code and the underlying operating system kernel. The * general idea is that porting lwIP to new architectures requires only * small changes to a few header files and a new sys_arch * implementation. It is also possible to do a sys_arch implementation * that does not rely on any underlying operating system. - * + * * The sys_arch provides semaphores, mailboxes and mutexes to lwIP. For the full * lwIP functionality, multiple threads support can be implemented in the * sys_arch, but this is not required for the basic lwIP * functionality. Timer scheduling is implemented in lwIP, but can be implemented * by the sys_arch port (LWIP_TIMERS_CUSTOM==1). - * + * * In addition to the source file providing the functionality of sys_arch, * the OS emulation layer must provide several header files defining * macros used throughout lwip. The files required and the macros they * must define are listed below the sys_arch description. - * + * * Since lwIP 1.4.0, semaphore, mutexes and mailbox functions are prototyped in a way that * allows both using pointers or actual OS structures to be used. This way, memory * required for such types can be either allocated in place (globally or on the * stack) or on the heap (allocated internally in the "*_new()" functions). - * + * * Note: * ----- * Be careful with using mem_malloc() in sys_arch. When malloc() refers to @@ -96,7 +96,7 @@ * Mailboxes should be implemented as a queue which allows multiple messages * to be posted (implementing as a rendez-vous point where only one message can be * posted at a time can have a highly negative impact on performance). A message - * in a mailbox is just a pointer, nothing more. + * in a mailbox is just a pointer, nothing more. * * @defgroup sys_time Time * @ingroup sys_layer diff --git a/components/net/lwip-2.1.2/src/core/tcp.c b/components/net/lwip-2.1.2/src/core/tcp.c index bd7d64ec39..10aaf21968 100644 --- a/components/net/lwip-2.1.2/src/core/tcp.c +++ b/components/net/lwip-2.1.2/src/core/tcp.c @@ -11,7 +11,7 @@ * Common functions for the TCP implementation, such as functions * for manipulating the data structures and the TCP timer functions. TCP functions * related to input and output is found in tcp_in.c and tcp_out.c respectively.\n - * + * * TCP connection setup * -------------------- * The functions used for setting up connections is similar to that of @@ -24,7 +24,7 @@ * - tcp_listen() and tcp_listen_with_backlog() * - tcp_accept() * - tcp_connect() - * + * * Sending TCP data * ---------------- * TCP data is sent by enqueueing the data with a call to tcp_write() and @@ -34,7 +34,7 @@ * - tcp_write() * - tcp_output() * - tcp_sent() - * + * * Receiving TCP data * ------------------ * TCP data reception is callback based - an application specified @@ -44,7 +44,7 @@ * window. * - tcp_recv() * - tcp_recved() - * + * * Application polling * ------------------- * When a connection is idle (i.e., no data is either transmitted or @@ -62,7 +62,7 @@ * - tcp_close() * - tcp_abort() * - tcp_err() - * + * */ /* @@ -469,7 +469,7 @@ tcp_close_shutdown_fin(struct tcp_pcb *pcb) * a closing state), the connection is closed, and put in a closing state. * The pcb is then automatically freed in tcp_slowtmr(). It is therefore * unsafe to reference it (unless an error is returned). - * + * * The function may return ERR_MEM if no memory * was available for closing the connection. If so, the application * should wait and try again either by using the acknowledgment @@ -797,7 +797,7 @@ tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) * When an incoming connection is accepted, the function specified with * the tcp_accept() function will be called. The pcb has to be bound * to a local port with the tcp_bind() function. - * + * * The tcp_listen() function returns a new connection identifier, and * the one passed as an argument to the function will be * deallocated. The reason for this behavior is that less memory is @@ -812,7 +812,7 @@ tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) * The backlog limits the number of outstanding connections * in the listen queue to the value specified by the backlog argument. * To use it, your need to set TCP_LISTEN_BACKLOG=1 in your lwipopts.h. - * + * * @param pcb the original tcp_pcb * @param backlog the incoming connections queue limit * @return tcp_pcb used for listening, consumes less memory. @@ -1039,7 +1039,7 @@ again: * Connects to another host. The function given as the "connected" * argument will be called when the connection has been established. * Sets up the pcb to connect to the remote host and sends the - * initial SYN segment which opens the connection. + * initial SYN segment which opens the connection. * * The tcp_connect() function returns immediately; it does not wait for * the connection to be properly setup. Instead, it will call the @@ -1711,14 +1711,14 @@ tcp_kill_prio(u8_t prio) mprio = LWIP_MIN(TCP_PRIO_MAX, prio); - /* We want to kill connections with a lower prio, so bail out if + /* We want to kill connections with a lower prio, so bail out if * supplied prio is 0 - there can never be a lower prio */ if (mprio == 0) { return; } - /* We only want kill connections with a lower prio, so decrement prio by one + /* We only want kill connections with a lower prio, so decrement prio by one * and start searching for oldest connection with same or lower priority than mprio. * We want to find the connections with the lowest possible prio, and among * these the one with the longest inactivity time. @@ -2041,7 +2041,7 @@ tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) * @ingroup tcp_raw * Used to specify the function that should be called when a fatal error * has occurred on the connection. - * + * * If a connection is aborted because of an error, the application is * alerted of this event by the err callback. Errors that might abort a * connection are when there is a shortage of memory. The callback @@ -2091,7 +2091,7 @@ tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) * number of TCP coarse grained timer shots, which typically occurs * twice a second. An interval of 10 means that the application would * be polled every 5 seconds. - * + * * When a connection is idle (i.e., no data is either transmitted or * received), lwIP will repeatedly poll the application by calling a * specified callback function. This can be used either as a watchdog diff --git a/components/net/lwip-2.1.2/src/core/tcp_out.c b/components/net/lwip-2.1.2/src/core/tcp_out.c index 724df1097c..a00ce23f66 100644 --- a/components/net/lwip-2.1.2/src/core/tcp_out.c +++ b/components/net/lwip-2.1.2/src/core/tcp_out.c @@ -355,7 +355,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len) * it can send them more efficiently by combining them together). * To prompt the system to send data now, call tcp_output() after * calling tcp_write(). - * + * * This function enqueues the data pointed to by the argument dataptr. The length of * the data is passed as the len parameter. The apiflags can be one or more of: * - TCP_WRITE_FLAG_COPY: indicates whether the new memory should be allocated diff --git a/components/net/lwip-2.1.2/src/core/timeouts.c b/components/net/lwip-2.1.2/src/core/timeouts.c index f37acfec99..8c8d497271 100644 --- a/components/net/lwip-2.1.2/src/core/timeouts.c +++ b/components/net/lwip-2.1.2/src/core/timeouts.c @@ -241,7 +241,7 @@ lwip_cyclic_timer(void *arg) cyclic->handler(); now = sys_now(); - next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */ + next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */ if (TIME_LESS_THAN(next_timeout_time, now)) { /* timer would immediately expire again -> "overload" -> restart without any correction */ #if LWIP_DEBUG_TIMERNAMES @@ -296,7 +296,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) LWIP_ASSERT("Timeout time too long, max is LWIP_UINT32_MAX/4 msecs", msecs <= (LWIP_UINT32_MAX / 4)); - next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */ + next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */ #if LWIP_DEBUG_TIMERNAMES sys_timeout_abs(next_timeout_time, handler, arg, handler_name); diff --git a/components/net/lwip-2.1.2/src/core/udp.c b/components/net/lwip-2.1.2/src/core/udp.c index 9d2cb4af7f..7c25912e67 100644 --- a/components/net/lwip-2.1.2/src/core/udp.c +++ b/components/net/lwip-2.1.2/src/core/udp.c @@ -911,7 +911,7 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d /** * @ingroup udp_raw * Bind an UDP PCB. - * + * * @param pcb UDP PCB to be bound with a local address ipaddr and port. * @param ipaddr local IP address to bind with. Use IP_ANY_TYPE to * bind to all local interfaces. @@ -1168,8 +1168,8 @@ udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg) /** * @ingroup udp_raw - * Removes and deallocates the pcb. - * + * Removes and deallocates the pcb. + * * @param pcb UDP PCB to be removed. The PCB is removed from the list of * UDP PCB's and the data structure is freed from memory. * @@ -1242,7 +1242,7 @@ udp_new(void) * Create a UDP PCB for specific IP type. * The pcb is not active until it has either been bound to a local address * or connected to a remote address. - * + * * @param type IP address type, see @ref lwip_ip_addr_type definitions. * If you want to listen to IPv4 and IPv6 (dual-stack) packets, * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. diff --git a/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h b/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h index 6b8e63a527..8b8e48198d 100644 --- a/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h +++ b/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h @@ -7,7 +7,7 @@ * Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -16,17 +16,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. diff --git a/components/net/lwip-2.1.2/src/include/lwip/api.h b/components/net/lwip-2.1.2/src/include/lwip/api.h index c2afaf26d3..739f8be5bc 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/api.h +++ b/components/net/lwip-2.1.2/src/include/lwip/api.h @@ -153,27 +153,27 @@ enum netconn_state { }; /** Used to inform the callback function about changes - * + * * Event explanation: - * + * * In the netconn implementation, there are three ways to block a client: - * + * * - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) * - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) * - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) - * + * * The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking * connections, you need to know in advance whether a call to a netconn function call would block or not, * and these events tell you about that. - * - * RCVPLUS events say: Safe to perform a potentially blocking call call once more. + * + * RCVPLUS events say: Safe to perform a potentially blocking call call once more. * They are counted in sockets - three RCVPLUS events for accept mbox means you are safe * to call netconn_accept 3 times without being blocked. * Same thing for receive mbox. - * + * * RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". * Socket implementation decrements the counter. - * + * * For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. * SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. * A SENDMINUS event occurs when the next call to a netconn_send() would be blocking. diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h b/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h index 67b9a60a9c..5be77c1b9d 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h b/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h index 8a0630833f..d39e1bf829 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h @@ -52,7 +52,7 @@ extern "C" { #endif /** - * @ingroup httpc + * @ingroup httpc * HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly * to disk via fopen/fwrite. * These functions are example implementations of the interface only. @@ -62,13 +62,13 @@ extern "C" { #endif /** - * @ingroup httpc + * @ingroup httpc * The default TCP port used for HTTP */ #define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP /** - * @ingroup httpc + * @ingroup httpc * HTTP client result codes */ typedef enum ehttpc_result { @@ -97,7 +97,7 @@ typedef enum ehttpc_result { typedef struct _httpc_state httpc_state_t; /** - * @ingroup httpc + * @ingroup httpc * Prototype of a http client callback function * * @param arg argument specified when initiating the request @@ -110,7 +110,7 @@ typedef struct _httpc_state httpc_state_t; typedef void (*httpc_result_fn)(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err); /** - * @ingroup httpc + * @ingroup httpc * Prototype of http client callback: called when the headers are received * * @param connection http client connection diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h b/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h index 8723961fd4..dd0c075de9 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h @@ -175,7 +175,7 @@ #define HTTPD_DEBUG LWIP_DBG_OFF #endif -/** Set this to 1 to use a memp pool for allocating +/** Set this to 1 to use a memp pool for allocating * struct http_state instead of the heap. * If enabled, you'll need to define MEMP_NUM_PARALLEL_HTTPD_CONNS * (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h b/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h index c2bb2288f4..f099812d2e 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h @@ -134,7 +134,7 @@ enum { MQTT_DATA_FLAG_LAST = 1 }; -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish data callback function. Called when data * arrives to a subscribed topic @see mqtt_subscribe @@ -149,7 +149,7 @@ enum { typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags); -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish function. Called when an incoming publish * arrives to a subscribed topic @see mqtt_subscribe diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h b/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h index bc743f679e..4ce2d5122b 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h @@ -6,14 +6,14 @@ #ifdef __cplusplus extern "C" { #endif - + /** * @defgroup smtp_opts Options * @ingroup smtp - * + * * @{ */ - + /** Set this to 1 to enable data handler callback on BODY */ #ifndef SMTP_BODYDH #define SMTP_BODYDH 0 diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h b/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h index 6021c72220..5a8a49f8d2 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h @@ -101,7 +101,7 @@ extern "C" { /** error codes predefined by SNMP prot. */ typedef enum { SNMP_ERR_NOERROR = 0, -/* +/* outdated v1 error codes. do not use anmore! #define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead #define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h index 198f632b68..ec0b6316aa 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h @@ -11,7 +11,7 @@ * */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h index 0a7fbee02a..efd50a057b 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h @@ -11,7 +11,7 @@ * */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * @@ -67,7 +67,7 @@ struct tftp_context { */ void (*close)(void* handle); /** - * Read from file + * Read from file * @param handle File handle returned by open() * @param buf Target buffer to copy read data to * @param bytes Number of bytes to copy to buf diff --git a/components/net/lwip-2.1.2/src/include/lwip/arch.h b/components/net/lwip-2.1.2/src/include/lwip/arch.h index 1606d4faab..fd73dec5fc 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/arch.h +++ b/components/net/lwip-2.1.2/src/include/lwip/arch.h @@ -74,7 +74,7 @@ /** Platform specific diagnostic output.\n * Note the default implementation pulls in printf, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_DIAG @@ -85,7 +85,7 @@ /** Platform specific assertion handling.\n * Note the default implementation pulls in printf, fflush and abort, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_ASSERT diff --git a/components/net/lwip-2.1.2/src/include/lwip/igmp.h b/components/net/lwip-2.1.2/src/include/lwip/igmp.h index ffd80e680c..0a16db0397 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/igmp.h +++ b/components/net/lwip-2.1.2/src/include/lwip/igmp.h @@ -99,7 +99,7 @@ err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); void igmp_tmr(void); -/** @ingroup igmp +/** @ingroup igmp * Get list head of IGMP groups for netif. * Note: The allsystems group IP is contained in the list as first entry. * @see @ref netif_set_igmp_mac_filter() diff --git a/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h b/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h index 2f977709d1..ee7a0c9da2 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h +++ b/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h @@ -404,7 +404,7 @@ extern const ip_addr_t ip_addr_broadcast; extern const ip_addr_t ip6_addr_any; -/** +/** * @ingroup ip6addr * IP6_ADDR_ANY can be used as a fixed ip_addr_t * for the IPv6 wildcard address diff --git a/components/net/lwip-2.1.2/src/include/lwip/mld6.h b/components/net/lwip-2.1.2/src/include/lwip/mld6.h index 7fa0797f27..2764fdd42d 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/mld6.h +++ b/components/net/lwip-2.1.2/src/include/lwip/mld6.h @@ -84,7 +84,7 @@ err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); /** @ingroup mld6 * Get list head of MLD6 groups for netif. - * Note: The allnodes group IP is NOT in the list, since it must always + * Note: The allnodes group IP is NOT in the list, since it must always * be received for correct IPv6 operation. * @see @ref netif_set_mld_mac_filter() */ diff --git a/components/net/lwip-2.1.2/src/include/lwip/netif.h b/components/net/lwip-2.1.2/src/include/lwip/netif.h index 911196ab3d..03b48a0ea4 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/netif.h +++ b/components/net/lwip-2.1.2/src/include/lwip/netif.h @@ -345,7 +345,7 @@ struct netif { u8_t flags; /** descriptive abbreviation */ char name[2]; - /** number of this interface. Used for @ref if_api and @ref netifapi_netif, + /** number of this interface. Used for @ref if_api and @ref netifapi_netif, * as well as for IPv6 zones */ u8_t num; #if LWIP_IPV6_AUTOCONFIG diff --git a/components/net/lwip-2.1.2/src/include/lwip/opt.h b/components/net/lwip-2.1.2/src/include/lwip/opt.h index 82c420c167..1e8eb6a35a 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/opt.h +++ b/components/net/lwip-2.1.2/src/include/lwip/opt.h @@ -1601,7 +1601,7 @@ #endif /** - * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function + * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function * for several netif related event that supports multiple subscribers. * @see netif_ext_status_callback */ @@ -2389,7 +2389,7 @@ * All addresses that have a scope according to the default policy (link-local * unicast addresses, interface-local and link-local multicast addresses) should * now have a zone set on them before being passed to the core API, although - * lwIP will currently attempt to select a zone on the caller's behalf when + * lwIP will currently attempt to select a zone on the caller's behalf when * necessary. Applications that directly assign IPv6 addresses to interfaces * (which is NOT recommended) must now ensure that link-local addresses carry * the netif's zone. See the new ip6_zone.h header file for more information and @@ -3027,8 +3027,8 @@ * - src: source eth address * - dst: destination eth address * - eth_type: ethernet type to packet to be sent\n - * - * + * + * * Return values: * - <0: Packet shall not contain VLAN header. * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. diff --git a/components/net/lwip-2.1.2/src/include/lwip/pbuf.h b/components/net/lwip-2.1.2/src/include/lwip/pbuf.h index 82902a4e98..2ddd913af1 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/pbuf.h +++ b/components/net/lwip-2.1.2/src/include/lwip/pbuf.h @@ -55,7 +55,7 @@ extern "C" { #define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)) #endif -/** @ingroup pbuf +/** @ingroup pbuf * PBUF_NEEDS_COPY(p): return a boolean value indicating whether the given * pbuf needs to be copied in order to be kept around beyond the current call * stack without risking being corrupted. The default setting provides safety: diff --git a/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h b/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h index db865635be..dce8bebce1 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h +++ b/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h @@ -53,7 +53,7 @@ enum lwip_ieee_eth_type { /** Internet protocol v4 */ ETHTYPE_IP = 0x0800U, /** Address resolution protocol */ - ETHTYPE_ARP = 0x0806U, + ETHTYPE_ARP = 0x0806U, /** Wake on lan */ ETHTYPE_WOL = 0x0842U, /** RARP */ diff --git a/components/net/lwip-2.1.2/src/include/lwip/sys.h b/components/net/lwip-2.1.2/src/include/lwip/sys.h index 168e465baa..cf13e1dcc4 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/sys.h +++ b/components/net/lwip-2.1.2/src/include/lwip/sys.h @@ -130,7 +130,7 @@ typedef void (*lwip_thread_fn)(void *arg); * If the mutex has been created, ERR_OK should be returned. Returning any * other error will provide a hint what went wrong, but except for assertions, * no real error handling is implemented. - * + * * @param mutex pointer to the mutex to create * @return ERR_OK if successful, another err_t otherwise */ @@ -205,13 +205,13 @@ void sys_sem_signal(sys_sem_t *sem); * "timeout" argument is non-zero, the thread should only be blocked for the * specified time (measured in milliseconds). If the "timeout" argument is zero, * the thread should be blocked until the semaphore is signalled. - * + * * The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within * the specified time or any other value if it was signaled (with or without * waiting). * Notice that lwIP implements a function with a similar name, * sys_sem_wait(), that uses the sys_arch_sem_wait() function. - * + * * @param sem the semaphore to wait for * @param timeout timeout in milliseconds to wait (0 = wait forever) * @return SYS_ARCH_TIMEOUT on timeout, any other value on success @@ -277,7 +277,7 @@ void sys_msleep(u32_t ms); /* only has a (close to) 1 ms resolution. */ * If the mailbox has been created, ERR_OK should be returned. Returning any * other error will provide a hint what went wrong, but except for assertions, * no real error handling is implemented. - * + * * @param mbox pointer to the mbox to create * @param size (minimum) number of messages in this mbox * @return ERR_OK if successful, another err_t otherwise @@ -287,7 +287,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size); * @ingroup sys_mbox * Post a message to an mbox - may not fail * -> blocks if full, only to be used from tasks NOT from ISR! - * + * * @param mbox mbox to posts the message * @param msg message to post (ATTENTION: can be NULL) */ @@ -297,7 +297,7 @@ void sys_mbox_post(sys_mbox_t *mbox, void *msg); * Try to post a message to an mbox - may fail if full. * Can be used from ISR (if the sys arch layer allows this). * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted. - * + * * @param mbox mbox to posts the message * @param msg message to post (ATTENTION: can be NULL) */ @@ -307,7 +307,7 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg); * Try to post a message to an mbox - may fail if full. * To be be used from ISR. * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted. - * + * * @param mbox mbox to posts the message * @param msg message to post (ATTENTION: can be NULL) */ @@ -324,10 +324,10 @@ err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg); * The return values are the same as for the sys_arch_sem_wait() function: * SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages * is received. - * + * * Note that a function with a similar name, sys_mbox_fetch(), is - * implemented by lwIP. - * + * implemented by lwIP. + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever) @@ -346,7 +346,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout); * example, a naive implementation could be: * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) * although this would introduce unnecessary delays. - * + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored * @return 0 (milliseconds) if a message has been received @@ -363,7 +363,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg); * Deallocates a mailbox. If there are messages still present in the * mailbox when the mailbox is deallocated, it is an indication of a * programming error in lwIP and the developer should be notified. - * + * * @param mbox mbox to delete */ void sys_mbox_free(sys_mbox_t *mbox); @@ -411,7 +411,7 @@ void sys_mbox_set_invalid(sys_mbox_t *mbox); * the "stacksize" parameter. The id of the new thread is returned. Both the id * and the priority are system dependent. * ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!) - * + * * @param name human-readable name for the thread (used for debugging purposes) * @param thread thread-function * @param arg parameter passed to 'thread' diff --git a/components/net/lwip-2.1.2/src/include/netif/ethernetif.h b/components/net/lwip-2.1.2/src/include/netif/ethernetif.h index 244bafdd1b..09c6d9a56f 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ethernetif.h +++ b/components/net/lwip-2.1.2/src/include/netif/ethernetif.h @@ -4,16 +4,16 @@ #include "lwip/netif.h" #include -#define NIOCTL_GADDR 0x01 +#define NIOCTL_GADDR 0x01 #ifndef RT_LWIP_ETH_MTU -#define ETHERNET_MTU 1500 +#define ETHERNET_MTU 1500 #else -#define ETHERNET_MTU RT_LWIP_ETH_MTU +#define ETHERNET_MTU RT_LWIP_ETH_MTU #endif /* eth flag with auto_linkup or phy_linkup */ -#define ETHIF_LINK_AUTOUP 0x0000 -#define ETHIF_LINK_PHYUP 0x0100 +#define ETHIF_LINK_AUTOUP 0x0000 +#define ETHIF_LINK_PHYUP 0x0100 struct eth_device { diff --git a/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h b/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h index 01896a7ff6..5190e7bc29 100644 --- a/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h +++ b/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h @@ -6,7 +6,7 @@ /* * Copyright (c) 2017 Benjamin Aigner * Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer - * + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -32,10 +32,10 @@ * OF SUCH DAMAGE. * * Author: Benjamin Aigner - * + * * Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c) */ - + #ifndef LWIP_HDR_LOWPAN6_BLE_H #define LWIP_HDR_LOWPAN6_BLE_H diff --git a/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h b/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h index 17d46cdcc5..32e5c5ee14 100644 --- a/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h +++ b/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h @@ -109,7 +109,7 @@ #define LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG LWIP_DBG_OFF #endif -/** LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS: +/** LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS: * Currently, the linux kernel driver for 6lowpan sets/clears a bit in * the address, depending on the BD address (either public or not). * Might not be RFC7668 conform, so you may select to do that (=1) or diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h index b2285228b8..830dc3137f 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h @@ -44,48 +44,48 @@ extern "C" { * CCP codes. */ -#define CCP_CONFREQ 1 -#define CCP_CONFACK 2 -#define CCP_TERMREQ 5 -#define CCP_TERMACK 6 -#define CCP_RESETREQ 14 -#define CCP_RESETACK 15 +#define CCP_CONFREQ 1 +#define CCP_CONFACK 2 +#define CCP_TERMREQ 5 +#define CCP_TERMACK 6 +#define CCP_RESETREQ 14 +#define CCP_RESETACK 15 /* * Max # bytes for a CCP option */ -#define CCP_MAX_OPTION_LENGTH 32 +#define CCP_MAX_OPTION_LENGTH 32 /* * Parts of a CCP packet. */ -#define CCP_CODE(dp) ((dp)[0]) -#define CCP_ID(dp) ((dp)[1]) -#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) -#define CCP_HDRLEN 4 +#define CCP_CODE(dp) ((dp)[0]) +#define CCP_ID(dp) ((dp)[1]) +#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) +#define CCP_HDRLEN 4 -#define CCP_OPT_CODE(dp) ((dp)[0]) -#define CCP_OPT_LENGTH(dp) ((dp)[1]) -#define CCP_OPT_MINLEN 2 +#define CCP_OPT_CODE(dp) ((dp)[0]) +#define CCP_OPT_LENGTH(dp) ((dp)[1]) +#define CCP_OPT_MINLEN 2 #if BSDCOMPRESS_SUPPORT /* * Definitions for BSD-Compress. */ -#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ -#define CILEN_BSD_COMPRESS 3 /* length of config. option */ +#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ +#define CILEN_BSD_COMPRESS 3 /* length of config. option */ /* Macros for handling the 3rd byte of the BSD-Compress config option. */ -#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ -#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ -#define BSD_CURRENT_VERSION 1 /* current version number */ -#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) +#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ +#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ +#define BSD_CURRENT_VERSION 1 /* current version number */ +#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) -#define BSD_MIN_BITS 9 /* smallest code size supported */ -#define BSD_MAX_BITS 15 /* largest code size supported */ +#define BSD_MIN_BITS 9 /* smallest code size supported */ +#define BSD_MAX_BITS 15 /* largest code size supported */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -93,17 +93,17 @@ extern "C" { * Definitions for Deflate. */ -#define CI_DEFLATE 26 /* config option for Deflate */ -#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ -#define CILEN_DEFLATE 4 /* length of its config option */ - -#define DEFLATE_MIN_SIZE 9 -#define DEFLATE_MAX_SIZE 15 -#define DEFLATE_METHOD_VAL 8 -#define DEFLATE_SIZE(x) (((x) >> 4) + 8) -#define DEFLATE_METHOD(x) ((x) & 0x0F) -#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) -#define DEFLATE_CHK_SEQUENCE 0 +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ +#define CILEN_DEFLATE 4 /* length of its config option */ + +#define DEFLATE_MIN_SIZE 9 +#define DEFLATE_MAX_SIZE 15 +#define DEFLATE_METHOD_VAL 8 +#define DEFLATE_SIZE(x) (((x) >> 4) + 8) +#define DEFLATE_METHOD(x) ((x) & 0x0F) +#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) +#define DEFLATE_CHK_SEQUENCE 0 #endif /* DEFLATE_SUPPORT */ #if MPPE_SUPPORT @@ -120,10 +120,10 @@ extern "C" { * Definitions for other, as yet unsupported, compression methods. */ -#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ -#define CILEN_PREDICTOR_1 2 /* length of its config option */ -#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ -#define CILEN_PREDICTOR_2 2 /* length of its config option */ +#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ +#define CILEN_PREDICTOR_1 2 /* length of its config option */ +#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ +#define CILEN_PREDICTOR_2 2 /* length of its config option */ #endif /* PREDICTOR_SUPPORT */ typedef struct ccp_options { @@ -141,15 +141,15 @@ typedef struct ccp_options { #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - u8_t mppe; /* MPPE bitfield */ + u8_t mppe; /* MPPE bitfield */ #endif /* MPPE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - u_short bsd_bits; /* # bits/code for BSD Compress */ + u_short bsd_bits; /* # bits/code for BSD Compress */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - u_short deflate_size; /* lg(window size) for Deflate */ + u_short deflate_size; /* lg(window size) for Deflate */ #endif /* DEFLATE_SUPPORT */ - u8_t method; /* code for chosen compression method */ + u8_t method; /* code for chosen compression method */ } ccp_options; extern const struct protent ccp_protent; diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h b/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h index 2d8cd9ca99..3d26413664 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h @@ -43,45 +43,45 @@ extern "C" { /* * CHAP packets begin with a standard header with code, id, len (2 bytes). */ -#define CHAP_HDRLEN 4 +#define CHAP_HDRLEN 4 /* * Values for the code field. */ -#define CHAP_CHALLENGE 1 -#define CHAP_RESPONSE 2 -#define CHAP_SUCCESS 3 -#define CHAP_FAILURE 4 +#define CHAP_CHALLENGE 1 +#define CHAP_RESPONSE 2 +#define CHAP_SUCCESS 3 +#define CHAP_FAILURE 4 /* * CHAP digest codes. */ -#define CHAP_MD5 5 +#define CHAP_MD5 5 #if MSCHAP_SUPPORT -#define CHAP_MICROSOFT 0x80 -#define CHAP_MICROSOFT_V2 0x81 +#define CHAP_MICROSOFT 0x80 +#define CHAP_MICROSOFT_V2 0x81 #endif /* MSCHAP_SUPPORT */ /* * Semi-arbitrary limits on challenge and response fields. */ -#define MAX_CHALLENGE_LEN 64 -#define MAX_RESPONSE_LEN 64 +#define MAX_CHALLENGE_LEN 64 +#define MAX_RESPONSE_LEN 64 /* * These limits apply to challenge and response packets we send. * The +4 is the +1 that we actually need rounded up. */ -#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) -#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) +#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) +#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) /* bitmask of supported algorithms */ #if MSCHAP_SUPPORT -#define MDTYPE_MICROSOFT_V2 0x1 -#define MDTYPE_MICROSOFT 0x2 +#define MDTYPE_MICROSOFT_V2 0x1 +#define MDTYPE_MICROSOFT 0x2 #endif /* MSCHAP_SUPPORT */ -#define MDTYPE_MD5 0x4 -#define MDTYPE_NONE 0 +#define MDTYPE_MD5 0x4 +#define MDTYPE_NONE 0 #if MSCHAP_SUPPORT /* Return the digest alg. ID for the most preferred digest type. */ @@ -129,24 +129,24 @@ extern "C" { * The code for each digest type has to supply one of these. */ struct chap_digest_type { - int code; + int code; #if PPP_SERVER - /* - * Note: challenge and response arguments below are formatted as - * a length byte followed by the actual challenge/response data. - */ - void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); - int (*verify_response)(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + /* + * Note: challenge and response arguments below are formatted as + * a length byte followed by the actual challenge/response data. + */ + void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); + int (*verify_response)(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ - void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *priv); - int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); - void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); + void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *priv); + int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); + void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); }; /* @@ -154,21 +154,21 @@ struct chap_digest_type { */ #if CHAP_SUPPORT typedef struct chap_client_state { - u8_t flags; - const char *name; - const struct chap_digest_type *digest; - unsigned char priv[64]; /* private area for digest's use */ + u8_t flags; + const char *name; + const struct chap_digest_type *digest; + unsigned char priv[64]; /* private area for digest's use */ } chap_client_state; #if PPP_SERVER typedef struct chap_server_state { - u8_t flags; - u8_t id; - const char *name; - const struct chap_digest_type *digest; - int challenge_xmits; - int challenge_pktlen; - unsigned char challenge[CHAL_MAX_PKTLEN]; + u8_t flags; + u8_t id; + const char *name; + const struct chap_digest_type *digest; + int challenge_xmits; + int challenge_pktlen; + unsigned char challenge[CHAL_MAX_PKTLEN]; } chap_server_state; #endif /* PPP_SERVER */ #endif /* CHAP_SUPPORT */ @@ -176,9 +176,9 @@ typedef struct chap_server_state { #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ extern int (*chap_verify_hook)(char *name, char *ourname, int id, - const struct chap_digest_type *digest, - unsigned char *challenge, unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + unsigned char *challenge, unsigned char *response, + char *message, int message_space); #endif /* UNUSED */ #if PPP_SERVER diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h b/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h index 3ee9aaf81a..491e52ab11 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h @@ -24,135 +24,135 @@ #if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef PPP_EAP_H -#define PPP_EAP_H +#define PPP_EAP_H #include "ppp.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif /* * Packet header = Code, id, length. */ -#define EAP_HEADERLEN 4 +#define EAP_HEADERLEN 4 /* EAP message codes. */ -#define EAP_REQUEST 1 -#define EAP_RESPONSE 2 -#define EAP_SUCCESS 3 -#define EAP_FAILURE 4 +#define EAP_REQUEST 1 +#define EAP_RESPONSE 2 +#define EAP_SUCCESS 3 +#define EAP_FAILURE 4 /* EAP types */ -#define EAPT_IDENTITY 1 -#define EAPT_NOTIFICATION 2 -#define EAPT_NAK 3 /* (response only) */ -#define EAPT_MD5CHAP 4 -#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ -#define EAPT_TOKEN 6 /* Generic Token Card */ +#define EAPT_IDENTITY 1 +#define EAPT_NOTIFICATION 2 +#define EAPT_NAK 3 /* (response only) */ +#define EAPT_MD5CHAP 4 +#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ +#define EAPT_TOKEN 6 /* Generic Token Card */ /* 7 and 8 are unassigned. */ -#define EAPT_RSA 9 /* RSA Public Key Authentication */ -#define EAPT_DSS 10 /* DSS Unilateral */ -#define EAPT_KEA 11 /* KEA */ -#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ -#define EAPT_TLS 13 /* EAP-TLS */ -#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ -#define EAPT_W2K 15 /* Windows 2000 EAP */ -#define EAPT_ARCOT 16 /* Arcot Systems */ -#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ -#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ -#define EAPT_SRP 19 /* Secure Remote Password */ +#define EAPT_RSA 9 /* RSA Public Key Authentication */ +#define EAPT_DSS 10 /* DSS Unilateral */ +#define EAPT_KEA 11 /* KEA */ +#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ +#define EAPT_TLS 13 /* EAP-TLS */ +#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ +#define EAPT_W2K 15 /* Windows 2000 EAP */ +#define EAPT_ARCOT 16 /* Arcot Systems */ +#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ +#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ +#define EAPT_SRP 19 /* Secure Remote Password */ /* 20 is deprecated */ /* EAP SRP-SHA1 Subtypes */ -#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ -#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ -#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ -#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ -#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ -#define EAPSRP_ACK 3 /* Response 3 - final ack */ -#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ - -#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ - -#define SRP_PSEUDO_ID "pseudo_" -#define SRP_PSEUDO_LEN 7 - -#define MD5_SIGNATURE_SIZE 16 -#define EAP_MIN_CHALLENGE_LENGTH 17 -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ +#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ +#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ +#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ +#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ +#define EAPSRP_ACK 3 /* Response 3 - final ack */ +#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ + +#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ + +#define SRP_PSEUDO_ID "pseudo_" +#define SRP_PSEUDO_LEN 7 + +#define MD5_SIGNATURE_SIZE 16 +#define EAP_MIN_CHALLENGE_LENGTH 17 +#define EAP_MAX_CHALLENGE_LENGTH 24 #define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH 3 /* 2^3-1 = 7, 17+7 = 24 */ -#define EAP_STATES \ - "Initial", "Pending", "Closed", "Listen", "Identify", \ - "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" +#define EAP_STATES \ + "Initial", "Pending", "Closed", "Listen", "Identify", \ + "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" -#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) +#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) #if PPP_SERVER -#define eap_server_active(pcb) \ - ((pcb)->eap.es_server.ea_state >= eapIdentify && \ - (pcb)->eap.es_server.ea_state <= eapMD5Chall) +#define eap_server_active(pcb) \ + ((pcb)->eap.es_server.ea_state >= eapIdentify && \ + (pcb)->eap.es_server.ea_state <= eapMD5Chall) #endif /* PPP_SERVER */ /* * Complete EAP state for one PPP session. */ enum eap_state_code { - eapInitial = 0, /* No EAP authentication yet requested */ - eapPending, /* Waiting for LCP (no timer) */ - eapClosed, /* Authentication not in use */ - eapListen, /* Client ready (and timer running) */ - eapIdentify, /* EAP Identify sent */ - eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ - eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ - eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ - eapMD5Chall, /* Sent MD5-Challenge */ - eapOpen, /* Completed authentication */ - eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ - eapBadAuth /* Failed authentication */ + eapInitial = 0, /* No EAP authentication yet requested */ + eapPending, /* Waiting for LCP (no timer) */ + eapClosed, /* Authentication not in use */ + eapListen, /* Client ready (and timer running) */ + eapIdentify, /* EAP Identify sent */ + eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ + eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ + eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ + eapMD5Chall, /* Sent MD5-Challenge */ + eapOpen, /* Completed authentication */ + eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ + eapBadAuth /* Failed authentication */ }; struct eap_auth { - const char *ea_name; /* Our name */ - char ea_peer[MAXNAMELEN +1]; /* Peer's name */ - void *ea_session; /* Authentication library linkage */ - u_char *ea_skey; /* Shared encryption key */ - u_short ea_namelen; /* Length of our name */ - u_short ea_peerlen; /* Length of peer's name */ - enum eap_state_code ea_state; - u_char ea_id; /* Current id */ - u_char ea_requests; /* Number of Requests sent/received */ - u_char ea_responses; /* Number of Responses */ - u_char ea_type; /* One of EAPT_* */ - u32_t ea_keyflags; /* SRP shared key usage flags */ + const char *ea_name; /* Our name */ + char ea_peer[MAXNAMELEN +1]; /* Peer's name */ + void *ea_session; /* Authentication library linkage */ + u_char *ea_skey; /* Shared encryption key */ + u_short ea_namelen; /* Length of our name */ + u_short ea_peerlen; /* Length of peer's name */ + enum eap_state_code ea_state; + u_char ea_id; /* Current id */ + u_char ea_requests; /* Number of Requests sent/received */ + u_char ea_responses; /* Number of Responses */ + u_char ea_type; /* One of EAPT_* */ + u32_t ea_keyflags; /* SRP shared key usage flags */ }; #ifndef EAP_MAX_CHALLENGE_LENGTH -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAP_MAX_CHALLENGE_LENGTH 24 #endif typedef struct eap_state { - struct eap_auth es_client; /* Client (authenticatee) data */ + struct eap_auth es_client; /* Client (authenticatee) data */ #if PPP_SERVER - struct eap_auth es_server; /* Server (authenticator) data */ + struct eap_auth es_server; /* Server (authenticator) data */ #endif /* PPP_SERVER */ - int es_savedtime; /* Saved timeout */ - int es_rechallenge; /* EAP rechallenge interval */ - int es_lwrechallenge; /* SRP lightweight rechallenge inter */ - u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ - int es_usedpseudo; /* Set if we already sent PN */ - int es_challen; /* Length of challenge string */ - u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; + int es_savedtime; /* Saved timeout */ + int es_rechallenge; /* EAP rechallenge interval */ + int es_lwrechallenge; /* SRP lightweight rechallenge inter */ + u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ + int es_usedpseudo; /* Set if we already sent PN */ + int es_challen; /* Length of challenge string */ + u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; } eap_state; /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ -#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ -#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ -#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ +#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ +#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ +#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ +#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ #endif /* moved to ppp_opts.h */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname); @@ -160,7 +160,7 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname); extern const struct protent eap_protent; -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h index d8808c3ab2..fa373fe76f 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h @@ -42,8 +42,8 @@ extern "C" { #endif typedef struct ecp_options { - bool required; /* Is ECP required? */ - unsigned enctype; /* Encryption type */ + bool required; /* Is ECP required? */ + unsigned enctype; /* Encryption type */ } ecp_options; extern fsm ecp_fsm[]; diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h b/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h index 5adeb482a8..3a20081f81 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h @@ -57,42 +57,42 @@ typedef union u32_t e32[2]; } eui64_t; -#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) -#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ - ((e).e32[1] == (o).e32[1])) -#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; +#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) +#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ + ((e).e32[1] == (o).e32[1])) +#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; -#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) +#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) -#define eui64_magic(e) do { \ - (e).e32[0] = magic(); \ - (e).e32[1] = magic(); \ - (e).e8[0] &= ~2; \ - } while (0) -#define eui64_magic_nz(x) do { \ - eui64_magic(x); \ - } while (eui64_iszero(x)) -#define eui64_magic_ne(x, y) do { \ - eui64_magic(x); \ - } while (eui64_equals(x, y)) +#define eui64_magic(e) do { \ + (e).e32[0] = magic(); \ + (e).e32[1] = magic(); \ + (e).e8[0] &= ~2; \ + } while (0) +#define eui64_magic_nz(x) do { \ + eui64_magic(x); \ + } while (eui64_iszero(x)) +#define eui64_magic_ne(x, y) do { \ + eui64_magic(x); \ + } while (eui64_equals(x, y)) -#define eui64_get(ll, cp) do { \ - eui64_copy((*cp), (ll)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_get(ll, cp) do { \ + eui64_copy((*cp), (ll)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_put(ll, cp) do { \ - eui64_copy((ll), (*cp)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_put(ll, cp) do { \ + eui64_copy((ll), (*cp)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_set32(e, l) do { \ - (e).e32[0] = 0; \ - (e).e32[1] = lwip_htonl(l); \ - } while (0) -#define eui64_setlo32(e, l) eui64_set32(e, l) +#define eui64_set32(e, l) do { \ + (e).e32[0] = 0; \ + (e).e32[1] = lwip_htonl(l); \ + } while (0) +#define eui64_setlo32(e, l) eui64_set32(e, l) -char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ +char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ #ifdef __cplusplus } diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h b/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h index 8dec700e07..69d965a581 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h @@ -46,7 +46,7 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef FSM_H -#define FSM_H +#define FSM_H #include "ppp.h" @@ -57,108 +57,108 @@ extern "C" { /* * Packet header = Code, id, length. */ -#define HEADERLEN 4 +#define HEADERLEN 4 /* * CP (LCP, IPCP, etc.) codes. */ -#define CONFREQ 1 /* Configuration Request */ -#define CONFACK 2 /* Configuration Ack */ -#define CONFNAK 3 /* Configuration Nak */ -#define CONFREJ 4 /* Configuration Reject */ -#define TERMREQ 5 /* Termination Request */ -#define TERMACK 6 /* Termination Ack */ -#define CODEREJ 7 /* Code Reject */ +#define CONFREQ 1 /* Configuration Request */ +#define CONFACK 2 /* Configuration Ack */ +#define CONFNAK 3 /* Configuration Nak */ +#define CONFREJ 4 /* Configuration Reject */ +#define TERMREQ 5 /* Termination Request */ +#define TERMACK 6 /* Termination Ack */ +#define CODEREJ 7 /* Code Reject */ /* * Each FSM is described by an fsm structure and fsm callbacks. */ typedef struct fsm { - ppp_pcb *pcb; /* PPP Interface */ - const struct fsm_callbacks *callbacks; /* Callback routines */ - const char *term_reason; /* Reason for closing protocol */ - u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ - /* -- This is our only flag, we might use u_int :1 if we have more flags */ - u16_t protocol; /* Data Link Layer Protocol field value */ - u8_t state; /* State */ - u8_t flags; /* Contains option bits */ - u8_t id; /* Current id */ - u8_t reqid; /* Current request id */ - u8_t retransmits; /* Number of retransmissions left */ - u8_t nakloops; /* Number of nak loops since last ack */ - u8_t rnakloops; /* Number of naks received */ - u8_t maxnakloops; /* Maximum number of nak loops tolerated - (necessary because IPCP require a custom large max nak loops value) */ - u8_t term_reason_len; /* Length of term_reason */ + ppp_pcb *pcb; /* PPP Interface */ + const struct fsm_callbacks *callbacks; /* Callback routines */ + const char *term_reason; /* Reason for closing protocol */ + u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + /* -- This is our only flag, we might use u_int :1 if we have more flags */ + u16_t protocol; /* Data Link Layer Protocol field value */ + u8_t state; /* State */ + u8_t flags; /* Contains option bits */ + u8_t id; /* Current id */ + u8_t reqid; /* Current request id */ + u8_t retransmits; /* Number of retransmissions left */ + u8_t nakloops; /* Number of nak loops since last ack */ + u8_t rnakloops; /* Number of naks received */ + u8_t maxnakloops; /* Maximum number of nak loops tolerated + (necessary because IPCP require a custom large max nak loops value) */ + u8_t term_reason_len; /* Length of term_reason */ } fsm; typedef struct fsm_callbacks { - void (*resetci) /* Reset our Configuration Information */ - (fsm *); - int (*cilen) /* Length of our Configuration Information */ - (fsm *); - void (*addci) /* Add our Configuration Information */ - (fsm *, u_char *, int *); - int (*ackci) /* ACK our Configuration Information */ - (fsm *, u_char *, int); - int (*nakci) /* NAK our Configuration Information */ - (fsm *, u_char *, int, int); - int (*rejci) /* Reject our Configuration Information */ - (fsm *, u_char *, int); - int (*reqci) /* Request peer's Configuration Information */ - (fsm *, u_char *, int *, int); - void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ - (fsm *); - void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ - (fsm *); - void (*starting) /* Called when we want the lower layer */ - (fsm *); - void (*finished) /* Called when we don't want the lower layer */ - (fsm *); - void (*protreject) /* Called when Protocol-Reject received */ - (int); - void (*retransmit) /* Retransmission is necessary */ - (fsm *); - int (*extcode) /* Called when unknown code received */ - (fsm *, int, int, u_char *, int); - const char *proto_name; /* String name for protocol (for messages) */ + void (*resetci) /* Reset our Configuration Information */ + (fsm *); + int (*cilen) /* Length of our Configuration Information */ + (fsm *); + void (*addci) /* Add our Configuration Information */ + (fsm *, u_char *, int *); + int (*ackci) /* ACK our Configuration Information */ + (fsm *, u_char *, int); + int (*nakci) /* NAK our Configuration Information */ + (fsm *, u_char *, int, int); + int (*rejci) /* Reject our Configuration Information */ + (fsm *, u_char *, int); + int (*reqci) /* Request peer's Configuration Information */ + (fsm *, u_char *, int *, int); + void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ + (fsm *); + void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ + (fsm *); + void (*starting) /* Called when we want the lower layer */ + (fsm *); + void (*finished) /* Called when we don't want the lower layer */ + (fsm *); + void (*protreject) /* Called when Protocol-Reject received */ + (int); + void (*retransmit) /* Retransmission is necessary */ + (fsm *); + int (*extcode) /* Called when unknown code received */ + (fsm *, int, int, u_char *, int); + const char *proto_name; /* String name for protocol (for messages) */ } fsm_callbacks; /* * Link states. */ -#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ -#define PPP_FSM_STARTING 1 /* Down, been opened */ -#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ -#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ -#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ -#define PPP_FSM_STOPPING 5 /* Terminating, but open */ -#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ -#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ -#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ -#define PPP_FSM_OPENED 9 /* Connection available */ +#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ +#define PPP_FSM_STARTING 1 /* Down, been opened */ +#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ +#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ +#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ +#define PPP_FSM_STOPPING 5 /* Terminating, but open */ +#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ +#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ +#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ +#define PPP_FSM_OPENED 9 /* Connection available */ /* * Flags - indicate options controlling FSM operation */ -#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ -#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ -#define OPT_SILENT 4 /* Wait for peer to speak first */ +#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ +#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ +#define OPT_SILENT 4 /* Wait for peer to speak first */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define DEFTIMEOUT 3 /* Timeout time in seconds */ -#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ +#define DEFTIMEOUT 3 /* Timeout time in seconds */ +#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ #endif /* moved to ppp_opts.h */ diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h index 32fdd1c641..6d822fef0c 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h @@ -46,7 +46,7 @@ #if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPCP_H -#define IPCP_H +#define IPCP_H #ifdef __cplusplus extern "C" { @@ -55,32 +55,32 @@ extern "C" { /* * Options. */ -#define CI_ADDRS 1 /* IP Addresses */ +#define CI_ADDRS 1 /* IP Addresses */ #if VJ_SUPPORT -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* VJ_SUPPORT */ -#define CI_ADDR 3 +#define CI_ADDR 3 #if LWIP_DNS -#define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_DNS1 129 /* Primary DNS value */ #define CI_MS_DNS2 131 /* Secondary DNS value */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define CI_MS_WINS1 130 /* Primary WINS value */ -#define CI_MS_WINS2 132 /* Secondary WINS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT -#define MAX_STATES 16 /* from slcompress.h */ +#define MAX_STATES 16 /* from slcompress.h */ -#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ -#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ -#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ +#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ +#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ +#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ /* maxslot and slot number compression) */ -#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ -#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option*/ +#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ +#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ + /* compression option*/ #endif /* VJ_SUPPORT */ typedef struct ipcp_options { @@ -106,17 +106,17 @@ typedef struct ipcp_options { unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ #endif /* LWIP_DNS */ - u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ + u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ #if LWIP_DNS - u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ + u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ + u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT - u16_t vj_protocol; /* protocol value to use in VJ option */ - u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ + u16_t vj_protocol; /* protocol value to use in VJ option */ + u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ #endif /* VJ_SUPPORT */ } ipcp_options; diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h index 9099973869..756b3ecd4c 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -142,7 +142,7 @@ #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPV6CP_H -#define IPV6CP_H +#define IPV6CP_H #include "eui64.h" @@ -153,13 +153,13 @@ extern "C" { /* * Options. */ -#define CI_IFACEID 1 /* Interface Identifier */ +#define CI_IFACEID 1 /* Interface Identifier */ #ifdef IPV6CP_COMP -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* IPV6CP_COMP */ /* No compression types yet defined. - *#define IPV6CP_COMP 0x004f + *#define IPV6CP_COMP 0x004f */ typedef struct ipv6cp_options { unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */ diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h index 18ad1cb23b..2b49bf7ede 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h @@ -46,7 +46,7 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef LCP_H -#define LCP_H +#define LCP_H #include "ppp.h" @@ -57,55 +57,55 @@ extern "C" { /* * Options. */ -#define CI_VENDOR 0 /* Vendor Specific */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_FCSALTERN 9 /* FCS-Alternatives */ -#define CI_SDP 10 /* Self-Describing-Pad */ -#define CI_NUMBERED 11 /* Numbered-Mode */ -#define CI_CALLBACK 13 /* callback */ -#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ -#define CI_SSNHF 18 /* short sequence numbers for multilink */ -#define CI_EPDISC 19 /* endpoint discriminator */ -#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ -#define CI_LDISC 23 /* Link-Discriminator */ -#define CI_LCPAUTH 24 /* LCP Authentication */ -#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ -#define CI_PREFELIS 26 /* Prefix Elision */ -#define CI_MPHDRFMT 27 /* MP Header Format */ -#define CI_I18N 28 /* Internationalization */ -#define CI_SDL 29 /* Simple Data Link */ +#define CI_VENDOR 0 /* Vendor Specific */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCSALTERN 9 /* FCS-Alternatives */ +#define CI_SDP 10 /* Self-Describing-Pad */ +#define CI_NUMBERED 11 /* Numbered-Mode */ +#define CI_CALLBACK 13 /* callback */ +#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ +#define CI_SSNHF 18 /* short sequence numbers for multilink */ +#define CI_EPDISC 19 /* endpoint discriminator */ +#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ +#define CI_LDISC 23 /* Link-Discriminator */ +#define CI_LCPAUTH 24 /* LCP Authentication */ +#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ +#define CI_PREFELIS 26 /* Prefix Elision */ +#define CI_MPHDRFMT 27 /* MP Header Format */ +#define CI_I18N 28 /* Internationalization */ +#define CI_SDL 29 /* Simple Data Link */ /* * LCP-specific packet types (code numbers). */ -#define PROTREJ 8 /* Protocol Reject */ -#define ECHOREQ 9 /* Echo Request */ -#define ECHOREP 10 /* Echo Reply */ -#define DISCREQ 11 /* Discard Request */ -#define IDENTIF 12 /* Identification */ -#define TIMEREM 13 /* Time Remaining */ +#define PROTREJ 8 /* Protocol Reject */ +#define ECHOREQ 9 /* Echo Request */ +#define ECHOREP 10 /* Echo Reply */ +#define DISCREQ 11 /* Discard Request */ +#define IDENTIF 12 /* Identification */ +#define TIMEREM 13 /* Time Remaining */ /* Value used as data for CI_CALLBACK option */ -#define CBCP_OPT 6 /* Use callback control protocol */ +#define CBCP_OPT 6 /* Use callback control protocol */ #if 0 /* moved to ppp_opts.h */ -#define DEFMRU 1500 /* Try for this */ -#define MINMRU 128 /* No MRUs below this */ -#define MAXMRU 16384 /* Normally limit MRU to this */ +#define DEFMRU 1500 /* Try for this */ +#define MINMRU 128 /* No MRUs below this */ +#define MAXMRU 16384 /* Normally limit MRU to this */ #endif /* moved to ppp_opts.h */ /* An endpoint discriminator, used with multilink. */ -#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ struct epdisc { - unsigned char class_; /* -- The word "class" is reserved in C++. */ - unsigned char length; - unsigned char value[MAX_ENDP_LEN]; + unsigned char class_; /* -- The word "class" is reserved in C++. */ + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; }; /* @@ -141,20 +141,20 @@ typedef struct lcp_options { unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ - u16_t mru; /* Value of MRU */ + u16_t mru; /* Value of MRU */ #ifdef HAVE_MULTILINK - u16_t mrru; /* Value of MRRU, and multilink enable */ + u16_t mrru; /* Value of MRRU, and multilink enable */ #endif /* MULTILINK */ #if CHAP_SUPPORT - u8_t chap_mdtype; /* which MD types (hashing algorithm) */ + u8_t chap_mdtype; /* which MD types (hashing algorithm) */ #endif /* CHAP_SUPPORT */ - u32_t asyncmap; /* Value of async map */ + u32_t asyncmap; /* Value of async map */ u32_t magicnumber; - u8_t numloops; /* Number of loops during magic number neg. */ + u8_t numloops; /* Number of loops during magic number neg. */ #if LQR_SUPPORT - u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ + u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ #endif /* LQR_SUPPORT */ - struct epdisc endpoint; /* endpoint discriminator */ + struct epdisc endpoint; /* endpoint discriminator */ } lcp_options; void lcp_open(ppp_pcb *pcb); @@ -168,7 +168,7 @@ extern const struct protent lcp_protent; #if 0 /* moved to ppp_opts.h */ /* Default number of times we receive our magic number from the peer before deciding the link is looped-back. */ -#define DEFLOOPBACKFAIL 10 +#define DEFLOOPBACKFAIL 10 #endif /* moved to ppp_opts.h */ #ifdef __cplusplus diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h b/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h index a165e18fa6..b937ec6d88 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h @@ -102,7 +102,7 @@ void magic_randomize(void); /* * Return a new random number. */ -u32_t magic(void); /* Returns the next magic number */ +u32_t magic(void); /* Returns the next magic number */ /* * Fill buffer with random bytes diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h b/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h index 5de1128479..55f0487b93 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h @@ -45,19 +45,19 @@ extern "C" { #endif -#define MPPE_PAD 4 /* MPPE growth per frame */ -#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ +#define MPPE_PAD 4 /* MPPE growth per frame */ +#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ /* option bits for ccp_options.mppe */ -#define MPPE_OPT_40 0x01 /* 40 bit */ -#define MPPE_OPT_128 0x02 /* 128 bit */ -#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ +#define MPPE_OPT_40 0x01 /* 40 bit */ +#define MPPE_OPT_128 0x02 /* 128 bit */ +#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ /* unsupported opts */ -#define MPPE_OPT_56 0x08 /* 56 bit */ -#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ -#define MPPE_OPT_D 0x20 /* Unknown */ +#define MPPE_OPT_56 0x08 /* 56 bit */ +#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ +#define MPPE_OPT_D 0x20 /* Unknown */ #define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D) -#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ +#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ /* * This is not nice ... the alternative is a bitfield struct though. @@ -66,70 +66,70 @@ extern "C" { * but then we have to do a lwip_htonl() all the time and/or we still need * to know which octet is which. */ -#define MPPE_C_BIT 0x01 /* MPPC */ -#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ -#define MPPE_L_BIT 0x20 /* 40-bit */ -#define MPPE_S_BIT 0x40 /* 128-bit */ -#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ -#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ +#define MPPE_C_BIT 0x01 /* MPPC */ +#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ +#define MPPE_L_BIT 0x20 /* 40-bit */ +#define MPPE_S_BIT 0x40 /* 128-bit */ +#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ +#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ /* Does not include H bit; used for least significant octet only. */ #define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT) /* Build a CI from mppe opts (see RFC 3078) */ -#define MPPE_OPTS_TO_CI(opts, ci) \ - do { \ - u_char *ptr = ci; /* u_char[4] */ \ - \ - /* H bit */ \ - if (opts & MPPE_OPT_STATEFUL) \ - *ptr++ = 0x0; \ - else \ - *ptr++ = MPPE_H_BIT; \ - *ptr++ = 0; \ - *ptr++ = 0; \ - \ - /* S,L bits */ \ - *ptr = 0; \ - if (opts & MPPE_OPT_128) \ - *ptr |= MPPE_S_BIT; \ - if (opts & MPPE_OPT_40) \ - *ptr |= MPPE_L_BIT; \ - /* M,D,C bits not supported */ \ +#define MPPE_OPTS_TO_CI(opts, ci) \ + do { \ + u_char *ptr = ci; /* u_char[4] */ \ + \ + /* H bit */ \ + if (opts & MPPE_OPT_STATEFUL) \ + *ptr++ = 0x0; \ + else \ + *ptr++ = MPPE_H_BIT; \ + *ptr++ = 0; \ + *ptr++ = 0; \ + \ + /* S,L bits */ \ + *ptr = 0; \ + if (opts & MPPE_OPT_128) \ + *ptr |= MPPE_S_BIT; \ + if (opts & MPPE_OPT_40) \ + *ptr |= MPPE_L_BIT; \ + /* M,D,C bits not supported */ \ } while (/* CONSTCOND */ 0) /* The reverse of the above */ -#define MPPE_CI_TO_OPTS(ci, opts) \ - do { \ - const u_char *ptr = ci; /* u_char[4] */ \ - \ - opts = 0; \ - \ - /* H bit */ \ - if (!(ptr[0] & MPPE_H_BIT)) \ - opts |= MPPE_OPT_STATEFUL; \ - \ - /* S,L bits */ \ - if (ptr[3] & MPPE_S_BIT) \ - opts |= MPPE_OPT_128; \ - if (ptr[3] & MPPE_L_BIT) \ - opts |= MPPE_OPT_40; \ - \ - /* M,D,C bits */ \ - if (ptr[3] & MPPE_M_BIT) \ - opts |= MPPE_OPT_56; \ - if (ptr[3] & MPPE_D_BIT) \ - opts |= MPPE_OPT_D; \ - if (ptr[3] & MPPE_C_BIT) \ - opts |= MPPE_OPT_MPPC; \ - \ - /* Other bits */ \ - if (ptr[0] & ~MPPE_H_BIT) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[1] || ptr[2]) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[3] & ~MPPE_ALL_BITS) \ - opts |= MPPE_OPT_UNKNOWN; \ +#define MPPE_CI_TO_OPTS(ci, opts) \ + do { \ + const u_char *ptr = ci; /* u_char[4] */ \ + \ + opts = 0; \ + \ + /* H bit */ \ + if (!(ptr[0] & MPPE_H_BIT)) \ + opts |= MPPE_OPT_STATEFUL; \ + \ + /* S,L bits */ \ + if (ptr[3] & MPPE_S_BIT) \ + opts |= MPPE_OPT_128; \ + if (ptr[3] & MPPE_L_BIT) \ + opts |= MPPE_OPT_40; \ + \ + /* M,D,C bits */ \ + if (ptr[3] & MPPE_M_BIT) \ + opts |= MPPE_OPT_56; \ + if (ptr[3] & MPPE_D_BIT) \ + opts |= MPPE_OPT_D; \ + if (ptr[3] & MPPE_C_BIT) \ + opts |= MPPE_OPT_MPPC; \ + \ + /* Other bits */ \ + if (ptr[0] & ~MPPE_H_BIT) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[1] || ptr[2]) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[3] & ~MPPE_ALL_BITS) \ + opts |= MPPE_OPT_UNKNOWN; \ } while (/* CONSTCOND */ 0) /* Shared MPPE padding between MSCHAP and MPPE */ @@ -152,18 +152,18 @@ static const u8_t mppe_sha1_pad2[SHA1_PAD_SIZE] = { * State for an MPPE (de)compressor. */ typedef struct ppp_mppe_state { - lwip_arc4_context arc4; - u8_t master_key[MPPE_MAX_KEY_LEN]; - u8_t session_key[MPPE_MAX_KEY_LEN]; - u8_t keylen; /* key length in bytes */ - /* NB: 128-bit == 16, 40-bit == 8! - * If we want to support 56-bit, the unit has to change to bits - */ - u8_t bits; /* MPPE control bits */ - u16_t ccount; /* 12-bit coherency count (seqno) */ - u16_t sanity_errors; /* take down LCP if too many */ - unsigned int stateful :1; /* stateful mode flag */ - unsigned int discard :1; /* stateful mode packet loss flag */ + lwip_arc4_context arc4; + u8_t master_key[MPPE_MAX_KEY_LEN]; + u8_t session_key[MPPE_MAX_KEY_LEN]; + u8_t keylen; /* key length in bytes */ + /* NB: 128-bit == 16, 40-bit == 8! + * If we want to support 56-bit, the unit has to change to bits + */ + u8_t bits; /* MPPE control bits */ + u16_t ccount; /* 12-bit coherency count (seqno) */ + u16_t sanity_errors; /* take down LCP if too many */ + unsigned int stateful :1; /* stateful mode flag */ + unsigned int discard :1; /* stateful mode packet loss flag */ } ppp_mppe_state; void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key); diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h index 4af724cd90..91b08e6779 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h index e893890ed7..5e3a085165 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h index 570445687e..a4aa1dcc83 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h index 1244011890..4d7b04d8d0 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h index a4c53e07c5..d8f347c64e 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h index 3d73c36570..eea52f8cd8 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -107,8 +107,8 @@ extern "C" { /* * The basic PPP frame. */ -#define PPP_HDRLEN 4 /* octets for standard ppp header */ -#define PPP_FCSLEN 2 /* octets for FCS */ +#define PPP_HDRLEN 4 /* octets for standard ppp header */ +#define PPP_FCSLEN 2 /* octets for FCS */ /* * Values for phase. diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h index 40843d5a0a..29a85c6827 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h @@ -74,66 +74,66 @@ extern "C" { /* * The basic PPP frame. */ -#define PPP_ADDRESS(p) (((u_char *)(p))[0]) -#define PPP_CONTROL(p) (((u_char *)(p))[1]) -#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) +#define PPP_ADDRESS(p) (((u_char *)(p))[0]) +#define PPP_CONTROL(p) (((u_char *)(p))[1]) +#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) /* * Significant octet values. */ -#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ -#define PPP_UI 0x03 /* Unnumbered Information */ -#define PPP_FLAG 0x7e /* Flag Sequence */ -#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ -#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ +#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ +#define PPP_UI 0x03 /* Unnumbered Information */ +#define PPP_FLAG 0x7e /* Flag Sequence */ +#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ +#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ /* * Protocol field values. */ -#define PPP_IP 0x21 /* Internet Protocol */ +#define PPP_IP 0x21 /* Internet Protocol */ #if 0 /* UNUSED */ -#define PPP_AT 0x29 /* AppleTalk Protocol */ -#define PPP_IPX 0x2b /* IPX protocol */ +#define PPP_AT 0x29 /* AppleTalk Protocol */ +#define PPP_IPX 0x2b /* IPX protocol */ #endif /* UNUSED */ #if VJ_SUPPORT -#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ -#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ +#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ +#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ #endif /* VJ_SUPPORT */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ +#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_COMP 0xfd /* compressed packet */ +#define PPP_COMP 0xfd /* compressed packet */ #endif /* CCP_SUPPORT */ -#define PPP_IPCP 0x8021 /* IP Control Protocol */ +#define PPP_IPCP 0x8021 /* IP Control Protocol */ #if 0 /* UNUSED */ -#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ -#define PPP_IPXCP 0x802b /* IPX Control Protocol */ +#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ +#define PPP_IPXCP 0x802b /* IPX Control Protocol */ #endif /* UNUSED */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ +#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_CCP 0x80fd /* Compression Control Protocol */ +#define PPP_CCP 0x80fd /* Compression Control Protocol */ #endif /* CCP_SUPPORT */ #if ECP_SUPPORT -#define PPP_ECP 0x8053 /* Encryption Control Protocol */ +#define PPP_ECP 0x8053 /* Encryption Control Protocol */ #endif /* ECP_SUPPORT */ -#define PPP_LCP 0xc021 /* Link Control Protocol */ +#define PPP_LCP 0xc021 /* Link Control Protocol */ #if PAP_SUPPORT -#define PPP_PAP 0xc023 /* Password Authentication Protocol */ +#define PPP_PAP 0xc023 /* Password Authentication Protocol */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT -#define PPP_LQR 0xc025 /* Link Quality Report protocol */ +#define PPP_LQR 0xc025 /* Link Quality Report protocol */ #endif /* LQR_SUPPORT */ #if CHAP_SUPPORT -#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ +#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ #endif /* CHAP_SUPPORT */ #if CBCP_SUPPORT -#define PPP_CBCP 0xc029 /* Callback Control Protocol */ +#define PPP_CBCP 0xc029 /* Callback Control Protocol */ #endif /* CBCP_SUPPORT */ #if EAP_SUPPORT -#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ +#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ #endif /* EAP_SUPPORT */ /* @@ -165,59 +165,59 @@ struct link_callbacks { * What to do with network protocol (NP) packets. */ enum NPmode { - NPMODE_PASS, /* pass the packet through */ - NPMODE_DROP, /* silently drop the packet */ - NPMODE_ERROR, /* return an error */ - NPMODE_QUEUE /* save it up for later. */ + NPMODE_PASS, /* pass the packet through */ + NPMODE_DROP, /* silently drop the packet */ + NPMODE_ERROR, /* return an error */ + NPMODE_QUEUE /* save it up for later. */ }; /* * Statistics. */ #if PPP_STATS_SUPPORT -struct pppstat { - unsigned int ppp_ibytes; /* bytes received */ - unsigned int ppp_ipackets; /* packets received */ - unsigned int ppp_ierrors; /* receive errors */ - unsigned int ppp_obytes; /* bytes sent */ - unsigned int ppp_opackets; /* packets sent */ - unsigned int ppp_oerrors; /* transmit errors */ +struct pppstat { + unsigned int ppp_ibytes; /* bytes received */ + unsigned int ppp_ipackets; /* packets received */ + unsigned int ppp_ierrors; /* receive errors */ + unsigned int ppp_obytes; /* bytes sent */ + unsigned int ppp_opackets; /* packets sent */ + unsigned int ppp_oerrors; /* transmit errors */ }; #if VJ_SUPPORT struct vjstat { - unsigned int vjs_packets; /* outbound packets */ + unsigned int vjs_packets; /* outbound packets */ unsigned int vjs_compressed; /* outbound compressed packets */ - unsigned int vjs_searches; /* searches for connection state */ - unsigned int vjs_misses; /* times couldn't find conn. state */ + unsigned int vjs_searches; /* searches for connection state */ + unsigned int vjs_misses; /* times couldn't find conn. state */ unsigned int vjs_uncompressedin; /* inbound uncompressed packets */ unsigned int vjs_compressedin; /* inbound compressed packets */ - unsigned int vjs_errorin; /* inbound unknown type packets */ - unsigned int vjs_tossed; /* inbound packets tossed because of error */ + unsigned int vjs_errorin; /* inbound unknown type packets */ + unsigned int vjs_tossed; /* inbound packets tossed because of error */ }; #endif /* VJ_SUPPORT */ struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ + struct pppstat p; /* basic PPP statistics */ #if VJ_SUPPORT - struct vjstat vj; /* VJ header compression statistics */ + struct vjstat vj; /* VJ header compression statistics */ #endif /* VJ_SUPPORT */ }; #if CCP_SUPPORT struct compstat { - unsigned int unc_bytes; /* total uncompressed bytes */ - unsigned int unc_packets; /* total uncompressed packets */ - unsigned int comp_bytes; /* compressed bytes */ - unsigned int comp_packets; /* compressed packets */ - unsigned int inc_bytes; /* incompressible bytes */ - unsigned int inc_packets; /* incompressible packets */ - unsigned int ratio; /* recent compression ratio << 8 */ + unsigned int unc_bytes; /* total uncompressed bytes */ + unsigned int unc_packets; /* total uncompressed packets */ + unsigned int comp_bytes; /* compressed bytes */ + unsigned int comp_packets; /* compressed packets */ + unsigned int inc_bytes; /* incompressible bytes */ + unsigned int inc_packets; /* incompressible packets */ + unsigned int ratio; /* recent compression ratio << 8 */ }; struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ + struct compstat c; /* packet compression statistics */ + struct compstat d; /* packet decompression statistics */ }; #endif /* CCP_SUPPORT */ @@ -229,37 +229,37 @@ struct ppp_comp_stats { * the last NP packet was sent or received. */ struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ + time_t xmit_idle; /* time since last NP packet sent */ + time_t recv_idle; /* time since last NP packet received */ }; #endif /* PPP_IDLETIMELIMIT */ /* values for epdisc.class */ -#define EPD_NULL 0 /* null discriminator, no data */ -#define EPD_LOCAL 1 -#define EPD_IP 2 -#define EPD_MAC 3 -#define EPD_MAGIC 4 -#define EPD_PHONENUM 5 +#define EPD_NULL 0 /* null discriminator, no data */ +#define EPD_LOCAL 1 +#define EPD_IP 2 +#define EPD_MAC 3 +#define EPD_MAGIC 4 +#define EPD_PHONENUM 5 /* * Global variables. */ #ifdef HAVE_MULTILINK -extern u8_t multilink; /* enable multilink operation */ -extern u8_t doing_multilink; -extern u8_t multilink_master; -extern u8_t bundle_eof; -extern u8_t bundle_terminating; +extern u8_t multilink; /* enable multilink operation */ +extern u8_t doing_multilink; +extern u8_t multilink_master; +extern u8_t bundle_eof; +extern u8_t bundle_terminating; #endif #ifdef MAXOCTETS -extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ extern int maxoctets_dir; /* Direction : - 0 - in+out (default) - 1 - in - 2 - out - 3 - max(in,out) */ + 0 - in+out (default) + 1 - in + 2 - out + 3 - max(in,out) */ extern int maxoctets_timeout; /* Timeout for check of octets limit */ #define PPP_OCTETS_DIRECTION_SUM 0 #define PPP_OCTETS_DIRECTION_IN 1 @@ -279,7 +279,7 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */ * for a particular protocol. */ struct protent { - u_short protocol; /* PPP protocol number */ + u_short protocol; /* PPP protocol number */ /* Initialization procedure */ void (*init) (ppp_pcb *pcb); /* Process a received packet */ @@ -297,19 +297,19 @@ struct protent { #if PRINTPKT_SUPPORT /* Print a packet in readable form */ int (*printpkt) (const u_char *pkt, int len, - void (*printer) (void *, const char *, ...), - void *arg); + void (*printer) (void *, const char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT /* Process a received data packet */ void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - const char *name; /* Text name of protocol */ - const char *data_name; /* Text name of corresponding data protocol */ + const char *name; /* Text name of protocol */ + const char *data_name; /* Text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - option_t *options; /* List of command-line options */ + option_t *options; /* List of command-line options */ /* Check requested options, assign defaults */ void (*check_options) (void); #endif /* PPP_OPTIONS */ @@ -327,28 +327,28 @@ extern const struct protent* const protocols[]; /* Values for auth_pending, auth_done */ #if PAP_SUPPORT -#define PAP_WITHPEER 0x1 -#define PAP_PEER 0x2 +#define PAP_WITHPEER 0x1 +#define PAP_PEER 0x2 #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT -#define CHAP_WITHPEER 0x4 -#define CHAP_PEER 0x8 +#define CHAP_WITHPEER 0x4 +#define CHAP_PEER 0x8 #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT -#define EAP_WITHPEER 0x10 -#define EAP_PEER 0x20 +#define EAP_WITHPEER 0x10 +#define EAP_PEER 0x20 #endif /* EAP_SUPPORT */ /* Values for auth_done only */ #if CHAP_SUPPORT -#define CHAP_MD5_WITHPEER 0x40 -#define CHAP_MD5_PEER 0x80 +#define CHAP_MD5_WITHPEER 0x40 +#define CHAP_MD5_PEER 0x80 #if MSCHAP_SUPPORT -#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ -#define CHAP_MS_WITHPEER 0x100 -#define CHAP_MS_PEER 0x200 -#define CHAP_MS2_WITHPEER 0x400 -#define CHAP_MS2_PEER 0x800 +#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ +#define CHAP_MS_WITHPEER 0x100 +#define CHAP_MS_PEER 0x200 +#define CHAP_MS2_WITHPEER 0x400 +#define CHAP_MS2_PEER 0x800 #endif /* MSCHAP_SUPPORT */ #endif /* CHAP_SUPPORT */ @@ -370,10 +370,10 @@ extern const struct protent* const protocols[]; * PPP statistics structure */ struct pppd_stats { - unsigned int bytes_in; - unsigned int bytes_out; - unsigned int pkts_in; - unsigned int pkts_out; + unsigned int bytes_in; + unsigned int bytes_out; + unsigned int pkts_in; + unsigned int pkts_out; }; #endif /* PPP_STATS_SUPPORT */ @@ -382,7 +382,7 @@ struct pppd_stats { * PPP private functions */ - + /* * Functions called from lwIP core. */ @@ -500,34 +500,34 @@ void update_link_stats(int u); /* Get stats at link termination */ * cp MUST be u_char *. */ #define GETCHAR(c, cp) { \ - (c) = *(cp)++; \ + (c) = *(cp)++; \ } #define PUTCHAR(c, cp) { \ - *(cp)++ = (u_char) (c); \ + *(cp)++ = (u_char) (c); \ } #define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ + (s) = *(cp)++ << 8; \ + (s) |= *(cp)++; \ } #define PUTSHORT(s, cp) { \ - *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ + *(cp)++ = (u_char) ((s) >> 8); \ + *(cp)++ = (u_char) (s); \ } #define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ + (l) = *(cp)++ << 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; \ } #define PUTLONG(l, cp) { \ - *(cp)++ = (u_char) ((l) >> 24); \ - *(cp)++ = (u_char) ((l) >> 16); \ - *(cp)++ = (u_char) ((l) >> 8); \ - *(cp)++ = (u_char) (l); \ + *(cp)++ = (u_char) ((l) >> 24); \ + *(cp)++ = (u_char) ((l) >> 16); \ + *(cp)++ = (u_char) ((l) >> 8); \ + *(cp)++ = (u_char) (l); \ } -#define INCPTR(n, cp) ((cp) += (n)) -#define DECPTR(n, cp) ((cp) -= (n)) +#define INCPTR(n, cp) ((cp) += (n)) +#define DECPTR(n, cp) ((cp) -= (n)) /* * System dependent definitions for user-level 4.3BSD UNIX implementation. @@ -536,10 +536,10 @@ void update_link_stats(int u); /* Get stats at link termination */ #define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0) #define UNTIMEOUT(f, a) sys_untimeout((f), (a)) -#define BZERO(s, n) memset(s, 0, n) -#define BCMP(s1, s2, l) memcmp(s1, s2, l) +#define BZERO(s, n) memset(s, 0, n) +#define BCMP(s1, s2, l) memcmp(s1, s2, l) -#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } +#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } /* * MAKEHEADER - Add Header fields to a packet. @@ -552,7 +552,7 @@ void update_link_stats(int u); /* Get stats at link termination */ /* Procedures exported from auth.c */ void link_required(ppp_pcb *pcb); /* we are starting to use the link */ void link_terminated(ppp_pcb *pcb); /* we are finished with the link */ -void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ +void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ void upper_layers_down(ppp_pcb *pcb); /* take all NCPs down */ void link_established(ppp_pcb *pcb); /* the link is up; authenticate now */ void start_networks(ppp_pcb *pcb); /* start all the network control protos */ @@ -562,21 +562,21 @@ void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen); /* check the user name and passwd against configuration */ void auth_peer_fail(ppp_pcb *pcb, int protocol); - /* peer failed to authenticate itself */ + /* peer failed to authenticate itself */ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen); - /* peer successfully authenticated itself */ + /* peer successfully authenticated itself */ #endif /* PPP_SERVER */ void auth_withpeer_fail(ppp_pcb *pcb, int protocol); - /* we failed to authenticate ourselves */ + /* we failed to authenticate ourselves */ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor); - /* we successfully authenticated ourselves */ + /* we successfully authenticated ourselves */ #endif /* PPP_AUTH_SUPPORT */ void np_up(ppp_pcb *pcb, int proto); /* a network protocol has come up */ void np_down(ppp_pcb *pcb, int proto); /* a network protocol has gone down */ void np_finished(ppp_pcb *pcb, int proto); /* a network protocol no longer needs link */ #if PPP_AUTH_SUPPORT int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server); - /* get "secret" for chap */ + /* get "secret" for chap */ #endif /* PPP_AUTH_SUPPORT */ /* Procedures exported from ipcp.c */ @@ -584,8 +584,8 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre /* Procedures exported from demand.c */ #if DEMAND_SUPPORT -void demand_conf (void); /* config interface(s) for demand-dial */ -void demand_block (void); /* set all NPs to queue up packets */ +void demand_conf (void); /* config interface(s) for demand-dial */ +void demand_block (void); /* set all NPs to queue up packets */ void demand_unblock (void); /* set all NPs to pass packets */ void demand_discard (void); /* set all NPs to discard packets */ void demand_rexmit (int, u32_t); /* retransmit saved frames for an NP*/ @@ -602,10 +602,10 @@ void mp_bundle_terminated (void); char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ #else -#define mp_bundle_terminated() /* nothing */ -#define mp_exit_bundle() /* nothing */ -#define doing_multilink 0 -#define multilink_master 0 +#define mp_bundle_terminated() /* nothing */ +#define mp_exit_bundle() /* nothing */ +#define doing_multilink 0 +#define multilink_master 0 #endif /* Procedures exported from utils.c. */ diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h b/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h index c0230bbcb7..2531ee0a99 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h @@ -36,7 +36,7 @@ /* This header file is included in all PPP modules needing hashes and/or ciphers */ #ifndef PPPCRYPT_H -#define PPPCRYPT_H +#define PPPCRYPT_H /* * If included PolarSSL copy is not used, user is expected to include diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h b/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h index 36ee4f9bf9..5e6741bf01 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h b/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h index 08ab7ab54e..c96eb784dd 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h b/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h index 540d981492..caf81939d8 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h @@ -57,44 +57,44 @@ extern "C" { /* * Packet header = Code, id, length. */ -#define UPAP_HEADERLEN 4 +#define UPAP_HEADERLEN 4 /* * UPAP codes. */ -#define UPAP_AUTHREQ 1 /* Authenticate-Request */ -#define UPAP_AUTHACK 2 /* Authenticate-Ack */ -#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ +#define UPAP_AUTHREQ 1 /* Authenticate-Request */ +#define UPAP_AUTHACK 2 /* Authenticate-Ack */ +#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ /* * Client states. */ -#define UPAPCS_INITIAL 0 /* Connection down */ -#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ -#define UPAPCS_OPEN 4 /* We've received an Ack */ -#define UPAPCS_BADAUTH 5 /* We've received a Nak */ +#define UPAPCS_INITIAL 0 /* Connection down */ +#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ +#define UPAPCS_OPEN 4 /* We've received an Ack */ +#define UPAPCS_BADAUTH 5 /* We've received a Nak */ /* * Server states. */ -#define UPAPSS_INITIAL 0 /* Connection down */ -#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ -#define UPAPSS_OPEN 4 /* We've sent an Ack */ -#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ +#define UPAPSS_INITIAL 0 /* Connection down */ +#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ +#define UPAPSS_OPEN 4 /* We've sent an Ack */ +#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ +#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ +#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ #endif /* moved to ppp_opts.h */ /* @@ -102,16 +102,16 @@ extern "C" { */ #if PAP_SUPPORT typedef struct upap_state { - const char *us_user; /* User */ - u8_t us_userlen; /* User length */ - const char *us_passwd; /* Password */ - u8_t us_passwdlen; /* Password length */ - u8_t us_clientstate; /* Client state */ + const char *us_user; /* User */ + u8_t us_userlen; /* User length */ + const char *us_passwd; /* Password */ + u8_t us_passwdlen; /* Password length */ + u8_t us_clientstate; /* Client state */ #if PPP_SERVER - u8_t us_serverstate; /* Server state */ + u8_t us_serverstate; /* Server state */ #endif /* PPP_SERVER */ - u8_t us_id; /* Current id */ - u8_t us_transmits; /* Number of auth-reqs sent */ + u8_t us_id; /* Current id */ + u8_t us_transmits; /* Number of auth-reqs sent */ } upap_state; #endif /* PAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c b/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c index 6739fc247c..2f052ec093 100644 --- a/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c +++ b/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c @@ -69,7 +69,7 @@ typedef struct bridgeif_dfdb_s { * remembers known src mac addresses to know which port to send frames destined for that * mac address. * - * ATTENTION: This is meant as an example only, in real-world use, you should + * ATTENTION: This is meant as an example only, in real-world use, you should * provide a better implementation :-) */ void @@ -120,9 +120,9 @@ bridgeif_fdb_update_src(void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx) /* not found, no free entry -> flood */ } -/** +/** * @ingroup bridgeif_fdb - * Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown + * Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown */ bridgeif_portmask_t bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr) diff --git a/components/net/lwip-2.1.2/src/netif/ethernetif.c b/components/net/lwip-2.1.2/src/netif/ethernetif.c index 52bd0fb7b6..829978c139 100644 --- a/components/net/lwip-2.1.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.1.2/src/netif/ethernetif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * COPYRIGHT (C) 2006-2018, RT-Thread Development Team + * COPYRIGHT (C) 2006-2021, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -163,16 +163,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) { netdev_low_level_set_dhcp_status(netif, is_enabled); - + if(RT_TRUE == is_enabled) { dhcp_start((struct netif *)netif->user_data); } else { - dhcp_stop((struct netif *)netif->user_data); + dhcp_stop((struct netif *)netif->user_data); } - + return ERR_OK; } #endif /* RT_LWIP_DHCP */ @@ -182,7 +182,7 @@ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) extern int lwip_ping_recv(int s, int *ttl); extern err_t lwip_ping_send(int s, ip_addr_t *addr, int size); -int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, +int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp) { int s, ttl, recv_len, result = 0; @@ -197,7 +197,7 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, struct addrinfo hint, *res = RT_NULL; struct sockaddr_in *h = RT_NULL; struct in_addr ina; - + RT_ASSERT(netif); RT_ASSERT(host); RT_ASSERT(ping_resp); @@ -216,7 +216,7 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, return -RT_ERROR; } rt_memcpy(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); - + /* new a socket */ if ((s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP)) < 0) { @@ -284,7 +284,7 @@ const struct netdev_ops lwip_netdev_ops = lwip_netdev_set_addr_info, #ifdef RT_LWIP_DNS lwip_netdev_set_dns_server, -#else +#else NULL, #endif /* RT_LWIP_DNS */ @@ -323,7 +323,7 @@ static int netdev_add(struct netif *lwip_netif) { return -ERR_IF; } - + #ifdef SAL_USING_LWIP extern int sal_lwip_netdev_set_pf_info(struct netdev *netdev); /* set the lwIP network interface device protocol family information */ @@ -332,7 +332,7 @@ static int netdev_add(struct netif *lwip_netif) rt_strncpy(name, lwip_netif->name, LWIP_NETIF_NAME_LEN); result = netdev_register(netdev, name, (void *)lwip_netif); - + /* Update netdev info after registered */ netdev->flags = lwip_netif->flags; netdev->mtu = lwip_netif->mtu; @@ -375,7 +375,7 @@ static int netdev_flags_sync(struct netif *lwip_netif) { return -ERR_IF; } - + netdev->mtu = lwip_netif->mtu; netdev->flags |= lwip_netif->flags; @@ -438,7 +438,7 @@ static err_t eth_netif_device_init(struct netif *netif) /* copy device flags to netif flags */ netif->flags = (ethif->flags & 0xff); netif->mtu = ETHERNET_MTU; - + /* set output */ netif->output = etharp_output; @@ -530,7 +530,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ /* set linkoutput */ netif->linkoutput = ethernetif_linkoutput; - + /* get hardware MAC address */ rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr); @@ -550,7 +550,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ ipaddr.addr = inet_addr(RT_LWIP_IPADDR); gw.addr = inet_addr(RT_LWIP_GWADDR); netmask.addr = inet_addr(RT_LWIP_MSKADDR); -#else +#else IP4_ADDR(&ipaddr, 0, 0, 0, 0); IP4_ADDR(&gw, 0, 0, 0, 0); IP4_ADDR(&netmask, 0, 0, 0, 0); @@ -702,7 +702,7 @@ static void eth_rx_thread_entry(void* parameter) while (1) { if(device->eth_rx == RT_NULL) break; - + p = device->eth_rx(&(device->parent)); if (p != RT_NULL) { @@ -725,9 +725,9 @@ static void eth_rx_thread_entry(void* parameter) } #endif -/* this function does not need, - * use eth_system_device_init_private() - * call by lwip_system_init(). +/* this function does not need, + * use eth_system_device_init_private() + * call by lwip_system_init(). */ int eth_system_device_init(void) { @@ -870,27 +870,27 @@ void list_if(void) rt_kprintf("gw address: %s\n", ipaddr_ntoa(&(netif->gw))); rt_kprintf("net mask : %s\n", ipaddr_ntoa(&(netif->netmask))); #if LWIP_IPV6 - { - ip6_addr_t *addr; - int addr_state; - int i; - - addr = (ip6_addr_t *)&netif->ip6_addr[0]; - addr_state = netif->ip6_addr_state[0]; - - rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - - for(i=1; iip6_addr[i]; - addr_state = netif->ip6_addr_state[i]; - - rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - } - - } + { + ip6_addr_t *addr; + int addr_state; + int i; + + addr = (ip6_addr_t *)&netif->ip6_addr[0]; + addr_state = netif->ip6_addr_state[0]; + + rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + + for(i=1; iip6_addr[i]; + addr_state = netif->ip6_addr_state[i]; + + rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + } + + } rt_kprintf("\r\n"); #endif /* LWIP_IPV6 */ netif = netif->next; diff --git a/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c b/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c index d89816d3b0..d59b432f53 100644 --- a/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c +++ b/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c @@ -6,7 +6,7 @@ /* * Copyright (c) 2017 Benjamin Aigner * Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer - * + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -32,7 +32,7 @@ * OF SUCH DAMAGE. * * Author: Benjamin Aigner - * + * * Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c) */ @@ -95,15 +95,15 @@ static struct lowpan6_link_addr rfc7668_peer_addr; /** * @ingroup rfc7668if * convert BT address to EUI64 addr - * + * * This method converts a Bluetooth MAC address to an EUI64 address, * which is used within IPv6 communication - * + * * @param dst IPv6 destination space * @param src BLE MAC address source * @param public_addr If the LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS * option is set, bit 0x02 will be set if param=0 (no public addr); cleared otherwise - * + * * @see LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS */ void @@ -128,12 +128,12 @@ ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr) /** * @ingroup rfc7668if * convert EUI64 address to Bluetooth MAC addr - * + * * This method converts an EUI64 address to a Bluetooth MAC address, - * + * * @param dst BLE MAC address destination * @param src IPv6 source - * + * */ void eui64_to_ble_addr(uint8_t *dst, const uint8_t *src) @@ -214,16 +214,16 @@ rfc7668_set_peer_addr_mac48(struct netif *netif, const u8_t *peer_addr, size_t p } /** Encapsulate IPv6 frames for BLE transmission - * + * * This method implements the IPv6 header compression: * *) According to RFC6282 * *) See Figure 2, contains base format of bit positions * *) Fragmentation not necessary (done at L2CAP layer of BLE) * @note Currently the pbuf allocation uses 256 bytes. If longer packets are used (possible due to MTU=1480Bytes), increase it here! - * + * * @param p Pbuf struct, containing the payload data * @param netif Output network interface. Should be of RFC7668 type - * + * * @return Same as netif->output. */ static err_t @@ -340,7 +340,7 @@ rfc7668_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) * @param p the received packet, p->payload pointing to the * IPv6 header (maybe compressed) * @param netif the network interface on which the packet was received - * + * * @return ERR_OK if everything was fine */ err_t @@ -352,7 +352,7 @@ rfc7668_input(struct pbuf * p, struct netif *netif) /* Load first header byte */ puc = (u8_t*)p->payload; - + /* no IP header compression */ if (*puc == 0x41) { LWIP_DEBUGF(LWIP_LOWPAN6_DECOMPRESSION_DEBUG, ("Completed packet, removing dispatch: 0x%2x \n", *puc)); @@ -398,12 +398,12 @@ rfc7668_input(struct pbuf * p, struct netif *netif) /** * @ingroup rfc7668if * Initialize the netif - * + * * No flags are used (broadcast not possible, not ethernet, ...) * The shortname for this netif is "BT" * * @param netif the network interface to be initialized as RFC7668 netif - * + * * @return ERR_OK if everything went fine */ err_t @@ -433,7 +433,7 @@ rfc7668_if_init(struct netif *netif) * @param p the received packet, p->payload pointing to the * IEEE 802.15.4 header. * @param inp the network interface on which the packet was received - * + * * @return see @ref tcpip_inpkt, same return values */ err_t diff --git a/components/net/lwip-2.1.2/src/netif/lowpan6_common.c b/components/net/lwip-2.1.2/src/netif/lowpan6_common.c index baea206a71..89758d94d9 100644 --- a/components/net/lwip-2.1.2/src/netif/lowpan6_common.c +++ b/components/net/lwip-2.1.2/src/netif/lowpan6_common.c @@ -430,7 +430,7 @@ lowpan6_decompress_hdr(u8_t *lowpan6_buffer, size_t lowpan6_bufsize, /* offset for inline IP headers (RFC 6282 ch3)*/ lowpan6_offset = 2; - /* if CID is set (context identifier), the context byte + /* if CID is set (context identifier), the context byte * follows immediately after the header, so other IPHC fields are @+3 */ if (lowpan6_buffer[1] & 0x80) { lowpan6_offset++; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/auth.c b/components/net/lwip-2.1.2/src/netif/ppp/auth.c index c8673ad0fb..480a653ddd 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/auth.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/auth.c @@ -133,10 +133,10 @@ #if 0 /* UNUSED */ /* Bits in scan_authfile return value */ -#define NONWILD_SERVER 1 -#define NONWILD_CLIENT 2 +#define NONWILD_SERVER 1 +#define NONWILD_CLIENT 2 -#define ISWILD(word) (word[0] == '*' && word[1] == 0) +#define ISWILD(word) (word[0] == '*' && word[1] == 0) #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -169,8 +169,8 @@ int (*pap_check_hook) (void) = NULL; /* Hook for a plugin to check the PAP user and password */ int (*pap_auth_hook) (char *user, char *passwd, char **msgp, - struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **paddrs, + struct wordlist **popts) = NULL; /* Hook for a plugin to know about the PAP user logout */ void (*pap_logout_hook) (void) = NULL; @@ -187,7 +187,7 @@ int (*chap_passwd_hook) (char *user, char *passwd) = NULL; /* Hook for a plugin to say whether it is OK if the peer refuses to authenticate. */ int (*null_auth_hook) (struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **popts) = NULL; int (*allowed_address_hook) (u32_t addr) = NULL; #endif /* UNUSED */ @@ -210,27 +210,27 @@ struct notifier *link_down_notifier = NULL; * Option variables. */ #if 0 /* MOVED TO ppp_settings */ -bool uselogin = 0; /* Use /etc/passwd for checking PAP */ -bool session_mgmt = 0; /* Do session management (login records) */ -bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ -bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ -bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ -bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ +bool uselogin = 0; /* Use /etc/passwd for checking PAP */ +bool session_mgmt = 0; /* Do session management (login records) */ +bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ +bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ +bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ +bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ #if MSCHAP_SUPPORT -bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #else /* MSCHAP_SUPPORT */ -bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #endif /* MSCHAP_SUPPORT */ -bool usehostname = 0; /* Use hostname for our_name */ -bool auth_required = 0; /* Always require authentication from peer */ -bool allow_any_ip = 0; /* Allow peer to use any IP address */ -bool explicit_remote = 0; /* User specified explicit remote name */ -bool explicit_user = 0; /* Set if "user" option supplied */ -bool explicit_passwd = 0; /* Set if "password" option supplied */ -char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -static char *uafname; /* name of most recent +ua file */ +bool usehostname = 0; /* Use hostname for our_name */ +bool auth_required = 0; /* Always require authentication from peer */ +bool allow_any_ip = 0; /* Allow peer to use any IP address */ +bool explicit_remote = 0; /* User specified explicit remote name */ +bool explicit_user = 0; /* Set if "user" option supplied */ +bool explicit_passwd = 0; /* Set if "password" option supplied */ +char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ +static char *uafname; /* name of most recent +ua file */ extern char *crypt (const char *, const char *); #endif /* UNUSED */ @@ -252,8 +252,8 @@ static int have_srp_secret (char *client, char *server, int need_ip, int *lacks_ipp); static int ip_addr_check (u32_t, struct permitted_ip *); static int scan_authfile (FILE *, char *, char *, char *, - struct wordlist **, struct wordlist **, - char *, int); + struct wordlist **, struct wordlist **, + char *, int); static void free_wordlist (struct wordlist *); static void set_allowed_addrs (int, struct wordlist *, struct wordlist *); static int some_ip_ok (struct wordlist *); @@ -427,46 +427,46 @@ setupapfile(argv) /* open user info file */ fname = strdup(*argv); if (fname == NULL) - novm("+ua file name"); + novm("+ua file name"); euid = geteuid(); if (seteuid(getuid()) == -1) { - option_error("unable to reset uid before opening %s: %m", fname); - return 0; + option_error("unable to reset uid before opening %s: %m", fname); + return 0; } ufile = fopen(fname, "r"); if (seteuid(euid) == -1) - fatal("unable to regain privileges: %m"); + fatal("unable to regain privileges: %m"); if (ufile == NULL) { - option_error("unable to open user login data file %s", fname); - return 0; + option_error("unable to open user login data file %s", fname); + return 0; } check_access(ufile, fname); uafname = fname; /* get username */ if (fgets(u, MAXNAMELEN - 1, ufile) == NULL - || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { - fclose(ufile); - option_error("unable to read user login data file %s", fname); - return 0; + || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { + fclose(ufile); + option_error("unable to read user login data file %s", fname); + return 0; } fclose(ufile); /* get rid of newlines */ l = strlen(u); if (l > 0 && u[l-1] == '\n') - u[l-1] = 0; + u[l-1] = 0; l = strlen(p); if (l > 0 && p[l-1] == '\n') - p[l-1] = 0; + p[l-1] = 0; if (override_value("user", option_priority, fname)) { - strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); - explicit_user = 1; + strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); + explicit_user = 1; } if (override_value("passwd", option_priority, fname)) { - strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); - explicit_passwd = 1; + strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); + explicit_passwd = 1; } return (1); @@ -484,14 +484,14 @@ privgroup(argv) g = getgrnam(*argv); if (g == 0) { - option_error("group %s is unknown", *argv); - return 0; + option_error("group %s is unknown", *argv); + return 0; } for (i = 0; i < ngroups; ++i) { - if (groups[i] == g->gr_gid) { - privileged = 1; - break; - } + if (groups[i] == g->gr_gid) { + privileged = 1; + break; + } } return 1; } @@ -511,7 +511,7 @@ set_noauth_addr(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-ip argument"); + novm("allow-ip argument"); wp->word = (char *) (wp + 1); wp->next = noauth_addrs; MEMCPY(wp->word, addr, l); @@ -533,7 +533,7 @@ set_permitted_number(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-number argument"); + novm("allow-number argument"); wp->word = (char *) (wp + 1); wp->next = permitted_numbers; MEMCPY(wp->word, number, l); @@ -566,7 +566,7 @@ void start_link(unit) devfd = the_channel->connect(); msg = "Connect script failed"; if (devfd < 0) - goto fail; + goto fail; /* set up the serial device as a ppp interface */ /* @@ -579,21 +579,21 @@ void start_link(unit) fd_ppp = the_channel->establish_ppp(devfd); msg = "ppp establishment failed"; if (fd_ppp < 0) { - status = EXIT_FATAL_ERROR; - goto disconnect; + status = EXIT_FATAL_ERROR; + goto disconnect; } if (!demand && ifunit >= 0) - set_ifunit(1); + set_ifunit(1); /* * Start opening the connection and wait for * incoming events (reply, timeout, etc.). */ if (ifunit >= 0) - ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); + ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); else - ppp_notice("Starting negotiation on %s", ppp_devnam); + ppp_notice("Starting negotiation on %s", ppp_devnam); add_fd(fd_ppp); new_phase(pcb, PPP_PHASE_ESTABLISH); @@ -604,12 +604,12 @@ void start_link(unit) disconnect: new_phase(pcb, PPP_PHASE_DISCONNECT); if (the_channel->disconnect) - the_channel->disconnect(); + the_channel->disconnect(); fail: new_phase(pcb, PPP_PHASE_DEAD); if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); } #endif @@ -623,23 +623,23 @@ void link_terminated(ppp_pcb *pcb) { || pcb->phase == PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - return; + return; new_phase(pcb, PPP_PHASE_DISCONNECT); #if 0 /* UNUSED */ if (pap_logout_hook) { - pap_logout_hook(); + pap_logout_hook(); } session_end(devnam); #endif /* UNUSED */ if (!doing_multilink) { - ppp_notice("Connection terminated."); + ppp_notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ } else - ppp_notice("Link terminated."); + ppp_notice("Link terminated."); lcp_lowerdown(pcb); @@ -651,7 +651,7 @@ void link_terminated(ppp_pcb *pcb) { * we delete its pid file. */ if (!doing_multilink && !demand) - remove_pidfiles(); + remove_pidfiles(); /* * If we may want to bring the link up again, transfer @@ -659,36 +659,36 @@ void link_terminated(ppp_pcb *pcb) { * real serial device back to its normal mode of operation. */ if (fd_ppp >= 0) { - remove_fd(fd_ppp); - clean_check(); - the_channel->disestablish_ppp(devfd); - if (doing_multilink) - mp_exit_bundle(); - fd_ppp = -1; + remove_fd(fd_ppp); + clean_check(); + the_channel->disestablish_ppp(devfd); + if (doing_multilink) + mp_exit_bundle(); + fd_ppp = -1; } if (!hungup) - lcp_lowerdown(pcb); + lcp_lowerdown(pcb); if (!doing_multilink && !demand) - script_unsetenv("IFNAME"); + script_unsetenv("IFNAME"); /* * Run disconnector script, if requested. * XXX we may not be able to do this if the line has hung up! */ if (devfd >= 0 && the_channel->disconnect) { - the_channel->disconnect(); - devfd = -1; + the_channel->disconnect(); + devfd = -1; } if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); if (doing_multilink && multilink_master) { - if (!bundle_terminating) - new_phase(pcb, PPP_PHASE_MASTER); - else - mp_bundle_terminated(); + if (!bundle_terminating) + new_phase(pcb, PPP_PHASE_MASTER); + else + mp_bundle_terminated(); } else - new_phase(pcb, PPP_PHASE_DEAD); + new_phase(pcb, PPP_PHASE_DEAD); #endif } @@ -701,13 +701,13 @@ void link_down(ppp_pcb *pcb) { #endif /* PPP_NOTIFY */ if (!doing_multilink) { - upper_layers_down(pcb); - if (pcb->phase != PPP_PHASE_DEAD + upper_layers_down(pcb); + if (pcb->phase != PPP_PHASE_DEAD #ifdef HAVE_MULTILINK - && pcb->phase != PPP_PHASE_MASTER + && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ - ) - new_phase(pcb, PPP_PHASE_ESTABLISH); + ) + new_phase(pcb, PPP_PHASE_ESTABLISH); } /* XXX if doing_multilink, should do something to stop network-layer traffic on the link */ @@ -719,9 +719,9 @@ void upper_layers_down(ppp_pcb *pcb) { for (i = 0; (protp = protocols[i]) != NULL; ++i) { if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) - (*protp->lowerdown)(pcb); + (*protp->lowerdown)(pcb); if (protp->protocol < 0xC000 && protp->close != NULL) - (*protp->close)(pcb, "LCP down"); + (*protp->close)(pcb, "LCP down"); } pcb->num_np_open = 0; pcb->num_np_up = 0; @@ -749,56 +749,56 @@ void link_established(ppp_pcb *pcb) { * Tell higher-level protocols that LCP is up. */ if (!doing_multilink) { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol != PPP_LCP - && protp->lowerup != NULL) - (*protp->lowerup)(pcb); + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol != PPP_LCP + && protp->lowerup != NULL) + (*protp->lowerup)(pcb); } #if PPP_AUTH_SUPPORT #if PPP_SERVER #if PPP_ALLOWED_ADDRS if (!auth_required && noauth_addrs != NULL) - set_allowed_addrs(unit, NULL, NULL); + set_allowed_addrs(unit, NULL, NULL); #endif /* PPP_ALLOWED_ADDRS */ if (pcb->settings.auth_required && !(0 #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if PPP_ALLOWED_ADDRS - /* - * We wanted the peer to authenticate itself, and it refused: - * if we have some address(es) it can use without auth, fine, - * otherwise treat it as though it authenticated with PAP using - * a username of "" and a password of "". If that's not OK, - * boot it out. - */ - if (noauth_addrs != NULL) { - set_allowed_addrs(unit, NULL, NULL); - } else + /* + * We wanted the peer to authenticate itself, and it refused: + * if we have some address(es) it can use without auth, fine, + * otherwise treat it as though it authenticated with PAP using + * a username of "" and a password of "". If that's not OK, + * boot it out. + */ + if (noauth_addrs != NULL) { + set_allowed_addrs(unit, NULL, NULL); + } else #endif /* PPP_ALLOWED_ADDRS */ - if (!pcb->settings.null_login + if (!pcb->settings.null_login #if PAP_SUPPORT - || !wo->neg_upap + || !wo->neg_upap #endif /* PAP_SUPPORT */ - ) { - ppp_warn("peer refused to authenticate: terminating link"); + ) { + ppp_warn("peer refused to authenticate: terminating link"); #if 0 /* UNUSED */ - status = EXIT_PEER_AUTH_FAILED; + status = EXIT_PEER_AUTH_FAILED; #endif /* UNUSED */ - pcb->err_code = PPPERR_AUTHFAIL; - lcp_close(pcb, "peer refused to authenticate"); - return; - } + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "peer refused to authenticate"); + return; + } } #endif /* PPP_SERVER */ @@ -807,20 +807,20 @@ void link_established(ppp_pcb *pcb) { #if PPP_SERVER #if EAP_SUPPORT if (go->neg_eap) { - eap_authpeer(pcb, PPP_OUR_NAME); - auth |= EAP_PEER; + eap_authpeer(pcb, PPP_OUR_NAME); + auth |= EAP_PEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (go->neg_chap) { - chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); - auth |= CHAP_PEER; + chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); + auth |= CHAP_PEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (go->neg_upap) { - upap_authpeer(pcb); - auth |= PAP_PEER; + upap_authpeer(pcb); + auth |= PAP_PEER; } else #endif /* PAP_SUPPORT */ {} @@ -828,20 +828,20 @@ void link_established(ppp_pcb *pcb) { #if EAP_SUPPORT if (ho->neg_eap) { - eap_authwithpeer(pcb, pcb->settings.user); - auth |= EAP_WITHPEER; + eap_authwithpeer(pcb, pcb->settings.user); + auth |= EAP_WITHPEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (ho->neg_chap) { - chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); - auth |= CHAP_WITHPEER; + chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); + auth |= CHAP_WITHPEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (ho->neg_upap) { - upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); - auth |= PAP_WITHPEER; + upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); + auth |= PAP_WITHPEER; } else #endif /* PAP_SUPPORT */ {} @@ -851,7 +851,7 @@ void link_established(ppp_pcb *pcb) { if (!auth) #endif /* PPP_AUTH_SUPPORT */ - network_phase(pcb); + network_phase(pcb); } /* @@ -868,7 +868,7 @@ static void network_phase(ppp_pcb *pcb) { #if 0 /* UNUSED */ /* Log calling number. */ if (*remote_number) - ppp_notice("peer from calling number %q authorized", remote_number); + ppp_notice("peer from calling number %q authorized", remote_number); #endif /* UNUSED */ #if PPP_NOTIFY @@ -877,16 +877,16 @@ static void network_phase(ppp_pcb *pcb) { */ if (0 #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - ) { - notify(auth_up_notifier, 0); + ) { + notify(auth_up_notifier, 0); } #endif /* PPP_NOTIFY */ @@ -895,9 +895,9 @@ static void network_phase(ppp_pcb *pcb) { * If we negotiated callback, do it now. */ if (go->neg_cbcp) { - new_phase(pcb, PPP_PHASE_CALLBACK); - (*cbcp_protent.open)(pcb); - return; + new_phase(pcb, PPP_PHASE_CALLBACK); + (*cbcp_protent.open)(pcb); + return; } #endif @@ -906,9 +906,9 @@ static void network_phase(ppp_pcb *pcb) { * Process extra options from the secrets file */ if (extra_options) { - options_from_list(extra_options, 1); - free_wordlist(extra_options); - extra_options = 0; + options_from_list(extra_options, 1); + free_wordlist(extra_options); + extra_options = 0; } #endif /* PPP_OPTIONS */ start_networks(pcb); @@ -924,34 +924,34 @@ void start_networks(ppp_pcb *pcb) { #ifdef HAVE_MULTILINK if (multilink) { - if (mp_join_bundle()) { - if (multilink_join_hook) - (*multilink_join_hook)(); - if (updetach && !nodetach) - detach(); - return; - } + if (mp_join_bundle()) { + if (multilink_join_hook) + (*multilink_join_hook)(); + if (updetach && !nodetach) + detach(); + return; + } } #endif /* HAVE_MULTILINK */ #ifdef PPP_FILTER if (!demand) - set_filters(&pass_filter, &active_filter); + set_filters(&pass_filter, &active_filter); #endif #if CCP_SUPPORT || ECP_SUPPORT /* Start CCP and ECP */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if ( - (0 + if ( + (0 #if ECP_SUPPORT - || protp->protocol == PPP_ECP + || protp->protocol == PPP_ECP #endif /* ECP_SUPPORT */ #if CCP_SUPPORT - || protp->protocol == PPP_CCP + || protp->protocol == PPP_CCP #endif /* CCP_SUPPORT */ - ) - && protp->open != NULL) - (*protp->open)(pcb); + ) + && protp->open != NULL) + (*protp->open)(pcb); #endif /* CCP_SUPPORT || ECP_SUPPORT */ /* @@ -965,7 +965,7 @@ void start_networks(ppp_pcb *pcb) { && !pcb->ccp_gotoptions.mppe #endif /* MPPE_SUPPORT */ ) - continue_networks(pcb); + continue_networks(pcb); } void continue_networks(ppp_pcb *pcb) { @@ -976,21 +976,21 @@ void continue_networks(ppp_pcb *pcb) { * Start the "real" network protocols. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol < 0xC000 + if (protp->protocol < 0xC000 #if CCP_SUPPORT - && protp->protocol != PPP_CCP + && protp->protocol != PPP_CCP #endif /* CCP_SUPPORT */ #if ECP_SUPPORT - && protp->protocol != PPP_ECP + && protp->protocol != PPP_ECP #endif /* ECP_SUPPORT */ - && protp->open != NULL) { - (*protp->open)(pcb); - ++pcb->num_np_open; - } + && protp->open != NULL) { + (*protp->open)(pcb); + ++pcb->num_np_open; + } if (pcb->num_np_open == 0) - /* nothing to do */ - lcp_close(pcb, "No network protocols running"); + /* nothing to do */ + lcp_close(pcb, "No network protocols running"); } #if PPP_AUTH_SUPPORT @@ -1053,37 +1053,37 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_PEER; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_PEER; - break; + bit = CHAP_PEER; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_PEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_PEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_PEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_PEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_PEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_PEER; - break; + bit = PAP_PEER; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_PEER; - break; + bit = EAP_PEER; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_peer_success: unknown protocol %x", protocol); - return; + ppp_warn("auth_peer_success: unknown protocol %x", protocol); + return; } #ifdef HAVE_MULTILINK @@ -1091,7 +1091,7 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * * Save the authenticated name of the peer for later. */ if (namelen > (int)sizeof(pcb->peer_authname) - 1) - namelen = (int)sizeof(pcb->peer_authname) - 1; + namelen = (int)sizeof(pcb->peer_authname) - 1; MEMCPY(pcb->peer_authname, name, namelen); pcb->peer_authname[namelen] = 0; #endif /* HAVE_MULTILINK */ @@ -1140,41 +1140,41 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_WITHPEER; - prot = "CHAP"; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_WITHPEER; - break; + bit = CHAP_WITHPEER; + prot = "CHAP"; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_WITHPEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_WITHPEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_WITHPEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_WITHPEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_WITHPEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_WITHPEER; - prot = "PAP"; - break; + bit = PAP_WITHPEER; + prot = "PAP"; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_WITHPEER; - prot = "EAP"; - break; + bit = EAP_WITHPEER; + prot = "EAP"; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); - bit = 0; - /* no break */ + ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); + bit = 0; + /* no break */ } ppp_notice("%s authentication succeeded", prot); @@ -1187,7 +1187,7 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { * proceed to the network (or callback) phase. */ if ((pcb->auth_pending &= ~bit) == 0) - network_phase(pcb); + network_phase(pcb); } #endif /* PPP_AUTH_SUPPORT */ @@ -1202,42 +1202,42 @@ void np_up(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (pcb->num_np_up == 0) { - /* - * At this point we consider that the link has come up successfully. - */ - new_phase(pcb, PPP_PHASE_RUNNING); + /* + * At this point we consider that the link has come up successfully. + */ + new_phase(pcb, PPP_PHASE_RUNNING); #if PPP_IDLETIMELIMIT #if 0 /* UNUSED */ - if (idle_time_hook != 0) - tlim = (*idle_time_hook)(NULL); - else + if (idle_time_hook != 0) + tlim = (*idle_time_hook)(NULL); + else #endif /* UNUSED */ - tlim = pcb->settings.idle_time_limit; - if (tlim > 0) - TIMEOUT(check_idle, (void*)pcb, tlim); + tlim = pcb->settings.idle_time_limit; + if (tlim > 0) + TIMEOUT(check_idle, (void*)pcb, tlim); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - /* - * Set a timeout to close the connection once the maximum - * connect time has expired. - */ - if (pcb->settings.maxconnect > 0) - TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); + /* + * Set a timeout to close the connection once the maximum + * connect time has expired. + */ + if (pcb->settings.maxconnect > 0) + TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - if (maxoctets > 0) - TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); + if (maxoctets > 0) + TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); #endif #if 0 /* Unused */ - /* - * Detach now, if the updetach option was given. - */ - if (updetach && !nodetach) - detach(); + /* + * Detach now, if the updetach option was given. + */ + if (updetach && !nodetach) + detach(); #endif /* Unused */ } ++pcb->num_np_up; @@ -1250,15 +1250,15 @@ void np_down(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_up == 0) { #if PPP_IDLETIMELIMIT - UNTIMEOUT(check_idle, (void*)pcb); + UNTIMEOUT(check_idle, (void*)pcb); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - UNTIMEOUT(connect_time_expired, NULL); + UNTIMEOUT(connect_time_expired, NULL); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - UNTIMEOUT(check_maxoctets, NULL); + UNTIMEOUT(check_maxoctets, NULL); #endif - new_phase(pcb, PPP_PHASE_NETWORK); + new_phase(pcb, PPP_PHASE_NETWORK); } } @@ -1268,8 +1268,8 @@ void np_down(ppp_pcb *pcb, int proto) { void np_finished(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_open <= 0) { - /* no further use for the link: shut up shop. */ - lcp_close(pcb, "No network protocols running"); + /* no further use for the link: shut up shop. */ + lcp_close(pcb, "No network protocols running"); } } @@ -1285,26 +1285,26 @@ check_maxoctets(arg) link_stats_valid=0; switch(maxoctets_dir) { - case PPP_OCTETS_DIRECTION_IN: - used = link_stats.bytes_in; - break; - case PPP_OCTETS_DIRECTION_OUT: - used = link_stats.bytes_out; - break; - case PPP_OCTETS_DIRECTION_MAXOVERAL: - case PPP_OCTETS_DIRECTION_MAXSESSION: - used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; - break; - default: - used = link_stats.bytes_in+link_stats.bytes_out; - break; + case PPP_OCTETS_DIRECTION_IN: + used = link_stats.bytes_in; + break; + case PPP_OCTETS_DIRECTION_OUT: + used = link_stats.bytes_out; + break; + case PPP_OCTETS_DIRECTION_MAXOVERAL: + case PPP_OCTETS_DIRECTION_MAXSESSION: + used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; + break; + default: + used = link_stats.bytes_in+link_stats.bytes_out; + break; } if (used > maxoctets) { - ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); - status = EXIT_TRAFFIC_LIMIT; - lcp_close(pcb, "Traffic limit"); + ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); + status = EXIT_TRAFFIC_LIMIT; + lcp_close(pcb, "Traffic limit"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); @@ -1325,27 +1325,27 @@ static void check_idle(void *arg) { int tlim; if (!get_idle_time(pcb, &idle)) - return; + return; #if 0 /* UNUSED */ if (idle_time_hook != 0) { - tlim = idle_time_hook(&idle); + tlim = idle_time_hook(&idle); } else { #endif /* UNUSED */ - itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); - tlim = pcb->settings.idle_time_limit - itime; + itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); + tlim = pcb->settings.idle_time_limit - itime; #if 0 /* UNUSED */ } #endif /* UNUSED */ if (tlim <= 0) { - /* link is idle: shut it down. */ - ppp_notice("Terminating connection due to lack of activity."); - pcb->err_code = PPPERR_IDLETIMEOUT; - lcp_close(pcb, "Link inactive"); + /* link is idle: shut it down. */ + ppp_notice("Terminating connection due to lack of activity."); + pcb->err_code = PPPERR_IDLETIMEOUT; + lcp_close(pcb, "Link inactive"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { - TIMEOUT(check_idle, (void*)pcb, tlim); + TIMEOUT(check_idle, (void*)pcb, tlim); } } #endif /* PPP_IDLETIMELIMIT */ @@ -1358,7 +1358,7 @@ static void connect_time_expired(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; ppp_info("Connect time expired"); pcb->err_code = PPPERR_CONNECTTIME; - lcp_close(pcb, "Connect time expired"); /* Close connection */ + lcp_close(pcb, "Connect time expired"); /* Close connection */ } #endif /* PPP_MAXCONNECT */ @@ -1375,62 +1375,62 @@ auth_check_options() /* Default our_name to hostname, and user to our_name */ if (our_name[0] == 0 || usehostname) - strlcpy(our_name, hostname, sizeof(our_name)); + strlcpy(our_name, hostname, sizeof(our_name)); /* If a blank username was explicitly given as an option, trust the user and don't use our_name */ if (ppp_settings.user[0] == 0 && !explicit_user) - strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); + strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); /* * If we have a default route, require the peer to authenticate * unless the noauth option was given or the real user is root. */ if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { - auth_required = 1; - default_auth = 1; + auth_required = 1; + default_auth = 1; } #if CHAP_SUPPORT /* If we selected any CHAP flavors, we should probably negotiate it. :-) */ if (wo->chap_mdtype) - wo->neg_chap = 1; + wo->neg_chap = 1; #endif /* CHAP_SUPPORT */ /* If authentication is required, ask peer for CHAP, PAP, or EAP. */ if (auth_required) { - allow_any_ip = 0; - if (1 + allow_any_ip = 0; + if (1 #if CHAP_SUPPORT - && !wo->neg_chap + && !wo->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - && !wo->neg_upap + && !wo->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - && !wo->neg_eap + && !wo->neg_eap #endif /* EAP_SUPPORT */ - ) { + ) { #if CHAP_SUPPORT - wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; - wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; + wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; + wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 1; + wo->neg_upap = 1; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 1; + wo->neg_eap = 1; #endif /* EAP_SUPPORT */ - } + } } else { #if CHAP_SUPPORT - wo->neg_chap = 0; - wo->chap_mdtype = MDTYPE_NONE; + wo->neg_chap = 0; + wo->chap_mdtype = MDTYPE_NONE; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 0; + wo->neg_upap = 0; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 0; + wo->neg_eap = 0; #endif /* EAP_SUPPORT */ } @@ -1447,56 +1447,56 @@ auth_check_options() #endif /* PAP_SUPPORT */ if (!can_auth && (0 #if CHAP_SUPPORT - || wo->neg_chap + || wo->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || wo->neg_eap + || wo->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if CHAP_SUPPORT - can_auth = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + can_auth = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); #else - can_auth = 0; + can_auth = 0; #endif } if (!can_auth #if EAP_SUPPORT - && wo->neg_eap + && wo->neg_eap #endif /* EAP_SUPPORT */ - ) { - can_auth = have_srp_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + ) { + can_auth = have_srp_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); } if (auth_required && !can_auth && noauth_addrs == NULL) { - if (default_auth) { - option_error( + if (default_auth) { + option_error( "By default the remote system is required to authenticate itself"); - option_error( + option_error( "(because this system has a default route to the internet)"); - } else if (explicit_remote) - option_error( + } else if (explicit_remote) + option_error( "The remote system (%s) is required to authenticate itself", - remote_name); - else - option_error( + remote_name); + else + option_error( "The remote system is required to authenticate itself"); - option_error( + option_error( "but I couldn't find any suitable secret (password) for it to use to do so."); - if (lacks_ip) - option_error( + if (lacks_ip) + option_error( "(None of the available passwords would let it use an IP address.)"); - exit(1); + exit(1); } /* * Early check for remote number authorization. */ if (!auth_number()) { - ppp_warn("calling number %q is not authorized", remote_number); - exit(EXIT_CNID_AUTH_FAILED); + ppp_warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); } } #endif /* PPP_OPTIONS */ @@ -1518,30 +1518,30 @@ auth_reset(unit) hadchap = -1; ao->neg_upap = !refuse_pap && (passwd[0] != 0 || get_pap_passwd(NULL)); ao->neg_chap = (!refuse_chap || !refuse_mschap || !refuse_mschap_v2) - && (passwd[0] != 0 || - (hadchap = have_chap_secret(user, (explicit_remote? remote_name: - NULL), 0, NULL))); + && (passwd[0] != 0 || + (hadchap = have_chap_secret(user, (explicit_remote? remote_name: + NULL), 0, NULL))); ao->neg_eap = !refuse_eap && ( - passwd[0] != 0 || - (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, - (explicit_remote? remote_name: NULL), 0, NULL))) || - have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); + passwd[0] != 0 || + (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, + (explicit_remote? remote_name: NULL), 0, NULL))) || + have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); hadchap = -1; if (go->neg_upap && !uselogin && !have_pap_secret(NULL)) - go->neg_upap = 0; + go->neg_upap = 0; if (go->neg_chap) { - if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, NULL))) - go->neg_chap = 0; + if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, NULL))) + go->neg_chap = 0; } if (go->neg_eap && - (hadchap == 0 || (hadchap == -1 && - !have_chap_secret((explicit_remote? remote_name: NULL), our_name, - 1, NULL))) && - !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, - NULL)) - go->neg_eap = 0; + (hadchap == 0 || (hadchap == -1 && + !have_chap_secret((explicit_remote? remote_name: NULL), our_name, + 1, NULL))) && + !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, + NULL)) + go->neg_eap = 0; } /* @@ -1550,8 +1550,8 @@ auth_reset(unit) * and login the user if OK. * * returns: - * UPAP_AUTHNAK: Authentication failed. - * UPAP_AUTHACK: Authentication succeeded. + * UPAP_AUTHNAK: Authentication failed. + * UPAP_AUTHACK: Authentication succeeded. * In either case, msg points to an appropriate message. */ int @@ -1585,19 +1585,19 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) * Check if a plugin wants to handle this. */ if (pap_auth_hook) { - ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); - if (ret >= 0) { - /* note: set_allowed_addrs() saves opts (but not addrs): - don't free it! */ - if (ret) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); - BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); - return ret? UPAP_AUTHACK: UPAP_AUTHNAK; - } + ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); + if (ret >= 0) { + /* note: set_allowed_addrs() saves opts (but not addrs): + don't free it! */ + if (ret) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); + return ret? UPAP_AUTHACK: UPAP_AUTHNAK; + } } /* @@ -1609,67 +1609,67 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) ret = UPAP_AUTHNAK; f = fopen(filename, "r"); if (f == NULL) { - ppp_error("Can't open PAP password file %s: %m", filename); + ppp_error("Can't open PAP password file %s: %m", filename); } else { - check_access(f, filename); - if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { - ppp_warn("no PAP secret found for %s", user); - } else { - /* - * If the secret is "@login", it means to check - * the password against the login database. - */ - int login_secret = strcmp(secret, "@login") == 0; - ret = UPAP_AUTHACK; - if (uselogin || login_secret) { - /* login option or secret is @login */ - if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { - ret = UPAP_AUTHNAK; - } - } else if (session_mgmt) { - if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { - ppp_warn("Peer %q failed PAP Session verification", user); - ret = UPAP_AUTHNAK; - } - } - if (secret[0] != 0 && !login_secret) { - /* password given in pap-secrets - must match */ - if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) - && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) - ret = UPAP_AUTHNAK; - } - } - fclose(f); + check_access(f, filename); + if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { + ppp_warn("no PAP secret found for %s", user); + } else { + /* + * If the secret is "@login", it means to check + * the password against the login database. + */ + int login_secret = strcmp(secret, "@login") == 0; + ret = UPAP_AUTHACK; + if (uselogin || login_secret) { + /* login option or secret is @login */ + if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { + ret = UPAP_AUTHNAK; + } + } else if (session_mgmt) { + if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { + ppp_warn("Peer %q failed PAP Session verification", user); + ret = UPAP_AUTHNAK; + } + } + if (secret[0] != 0 && !login_secret) { + /* password given in pap-secrets - must match */ + if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) + && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) + ret = UPAP_AUTHNAK; + } + } + fclose(f); } if (ret == UPAP_AUTHNAK) { if (**msg == 0) - *msg = "Login incorrect"; - /* - * XXX can we ever get here more than once?? - * Frustrate passwd stealer programs. - * Allow 10 tries, but start backing off after 3 (stolen from login). - * On 10'th, drop the connection. - */ - if (attempts++ >= 10) { - ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); - lcp_close(pcb, "login failed"); - } - if (attempts > 3) - sleep((u_int) (attempts - 3) * 5); - if (opts != NULL) - free_wordlist(opts); + *msg = "Login incorrect"; + /* + * XXX can we ever get here more than once?? + * Frustrate passwd stealer programs. + * Allow 10 tries, but start backing off after 3 (stolen from login). + * On 10'th, drop the connection. + */ + if (attempts++ >= 10) { + ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); + lcp_close(pcb, "login failed"); + } + if (attempts > 3) + sleep((u_int) (attempts - 3) * 5); + if (opts != NULL) + free_wordlist(opts); } else { - attempts = 0; /* Reset count */ - if (**msg == 0) - *msg = "Login ok"; - set_allowed_addrs(unit, addrs, opts); + attempts = 0; /* Reset count */ + if (**msg == 0) + *msg = "Login ok"; + set_allowed_addrs(unit, addrs, opts); } if (addrs != NULL) - free_wordlist(addrs); + free_wordlist(addrs); BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); BZERO(secret, sizeof(secret)); @@ -1696,31 +1696,31 @@ null_login(unit) */ ret = -1; if (null_auth_hook) - ret = (*null_auth_hook)(&addrs, &opts); + ret = (*null_auth_hook)(&addrs, &opts); /* * Open the file of pap secrets and scan for a suitable secret. */ if (ret <= 0) { - filename = _PATH_UPAPFILE; - addrs = NULL; - f = fopen(filename, "r"); - if (f == NULL) - return 0; - check_access(f, filename); + filename = _PATH_UPAPFILE; + addrs = NULL; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + check_access(f, filename); - i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); - ret = i >= 0 && secret[0] == 0; - BZERO(secret, sizeof(secret)); - fclose(f); + i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); + ret = i >= 0 && secret[0] == 0; + BZERO(secret, sizeof(secret)); + fclose(f); } if (ret) - set_allowed_addrs(unit, addrs, opts); + set_allowed_addrs(unit, addrs, opts); else if (opts != 0) - free_wordlist(opts); + free_wordlist(opts); if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret; } @@ -1744,24 +1744,24 @@ get_pap_passwd(passwd) * Check whether a plugin wants to supply this. */ if (pap_passwd_hook) { - ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); - if (ret >= 0) - return ret; + ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; check_access(f, filename); ret = scan_authfile(f, user, - (remote_name[0]? remote_name: NULL), - secret, NULL, NULL, filename, 0); + (remote_name[0]? remote_name: NULL), + secret, NULL, NULL, filename, 0); fclose(f); if (ret < 0) - return 0; + return 0; if (passwd != NULL) - strlcpy(passwd, secret, MAXSECRETLEN); + strlcpy(passwd, secret, MAXSECRETLEN); BZERO(secret, sizeof(secret)); return 1; } @@ -1781,26 +1781,26 @@ have_pap_secret(lacks_ipp) /* let the plugin decide, if there is one */ if (pap_check_hook) { - ret = (*pap_check_hook)(); - if (ret >= 0) - return ret; + ret = (*pap_check_hook)(); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; ret = scan_authfile(f, (explicit_remote? remote_name: NULL), our_name, - NULL, &addrs, NULL, filename, 0); + NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1824,31 +1824,31 @@ have_chap_secret(client, server, need_ip, lacks_ipp) struct wordlist *addrs; if (chap_check_hook) { - ret = (*chap_check_hook)(); - if (ret >= 0) { - return ret; - } + ret = (*chap_check_hook)(); + if (ret >= 0) { + return ret; + } } filename = _PATH_CHAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1874,22 +1874,22 @@ have_srp_secret(client, server, need_ip, lacks_ipp) filename = _PATH_SRPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1930,42 +1930,42 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre addrs = NULL; if (!am_server && ppp_settings.passwd[0] != 0) { - strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); + strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); } else if (!am_server && chap_passwd_hook) { - if ( (*chap_passwd_hook)(client, secbuf) < 0) { - ppp_error("Unable to obtain CHAP password for %s on %s from plugin", - client, server); - return 0; - } + if ( (*chap_passwd_hook)(client, secbuf) < 0) { + ppp_error("Unable to obtain CHAP password for %s on %s from plugin", + client, server); + return 0; + } } else { - filename = _PATH_CHAPFILE; - addrs = NULL; - secbuf[0] = 0; - - f = fopen(filename, "r"); - if (f == NULL) { - ppp_error("Can't open chap secret file %s: %m", filename); - return 0; - } - check_access(f, filename); - - ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); - fclose(f); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); + filename = _PATH_CHAPFILE; + addrs = NULL; + secbuf[0] = 0; + + f = fopen(filename, "r"); + if (f == NULL) { + ppp_error("Can't open chap secret file %s: %m", filename); + return 0; + } + check_access(f, filename); + + ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); + fclose(f); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); } len = strlen(secbuf); if (len > MAXSECRETLEN) { - ppp_error("Secret for %s on %s is too long", client, server); - len = MAXSECRETLEN; + ppp_error("Secret for %s on %s is too long", client, server); + len = MAXSECRETLEN; } MEMCPY(secret, secbuf, len); BZERO(secbuf, sizeof(secbuf)); @@ -1997,31 +1997,31 @@ get_srp_secret(unit, client, server, secret, am_server) struct wordlist *addrs, *opts; if (!am_server && ppp_settings.passwd[0] != '\0') { - strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); + strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); } else { - filename = _PATH_SRPFILE; - addrs = NULL; - - fp = fopen(filename, "r"); - if (fp == NULL) { - ppp_error("Can't open srp secret file %s: %m", filename); - return 0; - } - check_access(fp, filename); - - secret[0] = '\0'; - ret = scan_authfile(fp, client, server, secret, &addrs, &opts, - filename, am_server); - fclose(fp); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != NULL) - free_wordlist(opts); - if (addrs != NULL) - free_wordlist(addrs); + filename = _PATH_SRPFILE; + addrs = NULL; + + fp = fopen(filename, "r"); + if (fp == NULL) { + ppp_error("Can't open srp secret file %s: %m", filename); + return 0; + } + check_access(fp, filename); + + secret[0] = '\0'; + ret = scan_authfile(fp, client, server, secret, &addrs, &opts, + filename, am_server); + fclose(fp); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != NULL) + free_wordlist(opts); + if (addrs != NULL) + free_wordlist(addrs); } return 1; @@ -2049,10 +2049,10 @@ set_allowed_addrs(unit, addrs, opts) u32_t suggested_ip = 0; if (addresses[unit] != NULL) - free(addresses[unit]); + free(addresses[unit]); addresses[unit] = NULL; if (extra_options != NULL) - free_wordlist(extra_options); + free_wordlist(extra_options); extra_options = opts; /* @@ -2060,109 +2060,109 @@ set_allowed_addrs(unit, addrs, opts) */ n = wordlist_count(addrs) + wordlist_count(noauth_addrs); if (n == 0) - return; + return; ip = (struct permitted_ip *) malloc((n + 1) * sizeof(struct permitted_ip)); if (ip == 0) - return; + return; /* temporarily append the noauth_addrs list to addrs */ for (plink = &addrs; *plink != NULL; plink = &(*plink)->next) - ; + ; *plink = noauth_addrs; n = 0; for (ap = addrs; ap != NULL; ap = ap->next) { - /* "-" means no addresses authorized, "*" means any address allowed */ - ptr_word = ap->word; - if (strcmp(ptr_word, "-") == 0) - break; - if (strcmp(ptr_word, "*") == 0) { - ip[n].permit = 1; - ip[n].base = ip[n].mask = 0; - ++n; - break; - } - - ip[n].permit = 1; - if (*ptr_word == '!') { - ip[n].permit = 0; - ++ptr_word; - } - - mask = ~ (u32_t) 0; - offset = 0; - ptr_mask = strchr (ptr_word, '/'); - if (ptr_mask != NULL) { - int bit_count; - char *endp; - - bit_count = (int) strtol (ptr_mask+1, &endp, 10); - if (bit_count <= 0 || bit_count > 32) { - ppp_warn("invalid address length %v in auth. address list", - ptr_mask+1); - continue; - } - bit_count = 32 - bit_count; /* # bits in host part */ - if (*endp == '+') { - offset = ifunit + 1; - ++endp; - } - if (*endp != 0) { - ppp_warn("invalid address length syntax: %v", ptr_mask+1); - continue; - } - *ptr_mask = '\0'; - mask <<= bit_count; - } - - hp = gethostbyname(ptr_word); - if (hp != NULL && hp->h_addrtype == AF_INET) { - a = *(u32_t *)hp->h_addr; - } else { - np = getnetbyname (ptr_word); - if (np != NULL && np->n_addrtype == AF_INET) { - a = lwip_htonl ((u32_t)np->n_net); - if (ptr_mask == NULL) { - /* calculate appropriate mask for net */ - ah = lwip_ntohl(a); - if (IN_CLASSA(ah)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(ah)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(ah)) - mask = IN_CLASSC_NET; - } - } else { - a = inet_addr (ptr_word); - } - } - - if (ptr_mask != NULL) - *ptr_mask = '/'; - - if (a == (u32_t)-1L) { - ppp_warn("unknown host %s in auth. address list", ap->word); - continue; - } - if (offset != 0) { - if (offset >= ~mask) { - ppp_warn("interface unit %d too large for subnet %v", - ifunit, ptr_word); - continue; - } - a = lwip_htonl((lwip_ntohl(a) & mask) + offset); - mask = ~(u32_t)0; - } - ip[n].mask = lwip_htonl(mask); - ip[n].base = a & ip[n].mask; - ++n; - if (~mask == 0 && suggested_ip == 0) - suggested_ip = a; + /* "-" means no addresses authorized, "*" means any address allowed */ + ptr_word = ap->word; + if (strcmp(ptr_word, "-") == 0) + break; + if (strcmp(ptr_word, "*") == 0) { + ip[n].permit = 1; + ip[n].base = ip[n].mask = 0; + ++n; + break; + } + + ip[n].permit = 1; + if (*ptr_word == '!') { + ip[n].permit = 0; + ++ptr_word; + } + + mask = ~ (u32_t) 0; + offset = 0; + ptr_mask = strchr (ptr_word, '/'); + if (ptr_mask != NULL) { + int bit_count; + char *endp; + + bit_count = (int) strtol (ptr_mask+1, &endp, 10); + if (bit_count <= 0 || bit_count > 32) { + ppp_warn("invalid address length %v in auth. address list", + ptr_mask+1); + continue; + } + bit_count = 32 - bit_count; /* # bits in host part */ + if (*endp == '+') { + offset = ifunit + 1; + ++endp; + } + if (*endp != 0) { + ppp_warn("invalid address length syntax: %v", ptr_mask+1); + continue; + } + *ptr_mask = '\0'; + mask <<= bit_count; + } + + hp = gethostbyname(ptr_word); + if (hp != NULL && hp->h_addrtype == AF_INET) { + a = *(u32_t *)hp->h_addr; + } else { + np = getnetbyname (ptr_word); + if (np != NULL && np->n_addrtype == AF_INET) { + a = lwip_htonl ((u32_t)np->n_net); + if (ptr_mask == NULL) { + /* calculate appropriate mask for net */ + ah = lwip_ntohl(a); + if (IN_CLASSA(ah)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(ah)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(ah)) + mask = IN_CLASSC_NET; + } + } else { + a = inet_addr (ptr_word); + } + } + + if (ptr_mask != NULL) + *ptr_mask = '/'; + + if (a == (u32_t)-1L) { + ppp_warn("unknown host %s in auth. address list", ap->word); + continue; + } + if (offset != 0) { + if (offset >= ~mask) { + ppp_warn("interface unit %d too large for subnet %v", + ifunit, ptr_word); + continue; + } + a = lwip_htonl((lwip_ntohl(a) & mask) + offset); + mask = ~(u32_t)0; + } + ip[n].mask = lwip_htonl(mask); + ip[n].base = a & ip[n].mask; + ++n; + if (~mask == 0 && suggested_ip == 0) + suggested_ip = a; } *plink = NULL; - ip[n].permit = 0; /* make the last entry forbid all addresses */ - ip[n].base = 0; /* to terminate the list */ + ip[n].permit = 0; /* make the last entry forbid all addresses */ + ip[n].base = 0; /* to terminate the list */ ip[n].mask = 0; addresses[unit] = ip; @@ -2173,14 +2173,14 @@ set_allowed_addrs(unit, addrs, opts) * which is a single host, then use that if we find one. */ if (suggested_ip != 0 - && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { - wo->hisaddr = suggested_ip; - /* - * Do we insist on this address? No, if there are other - * addresses authorized than the suggested one. - */ - if (n > 1) - wo->accept_remote = 1; + && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { + wo->hisaddr = suggested_ip; + /* + * Do we insist on this address? No, if there are other + * addresses authorized than the suggested one. + */ + if (n > 1) + wo->accept_remote = 1; } } @@ -2197,21 +2197,21 @@ auth_ip_addr(unit, addr) /* don't allow loopback or multicast address */ if (bad_ip_adrs(addr)) - return 0; + return 0; if (allowed_address_hook) { - ok = allowed_address_hook(addr); - if (ok >= 0) return ok; + ok = allowed_address_hook(addr); + if (ok >= 0) return ok; } if (addresses[unit] != NULL) { - ok = ip_addr_check(addr, addresses[unit]); - if (ok >= 0) - return ok; + ok = ip_addr_check(addr, addresses[unit]); + if (ok >= 0) + return ok; } if (auth_required) - return 0; /* no addresses authorized */ + return 0; /* no addresses authorized */ return allow_any_ip || privileged || !have_route_to(addr); } @@ -2221,8 +2221,8 @@ ip_addr_check(addr, addrs) struct permitted_ip *addrs; { for (; ; ++addrs) - if ((addr & addrs->mask) == addrs->base) - return addrs->permit; + if ((addr & addrs->mask) == addrs->base) + return addrs->permit; } /* @@ -2236,7 +2236,7 @@ bad_ip_adrs(addr) { addr = lwip_ntohl(addr); return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET - || IN_MULTICAST(addr) || IN_BADCLASS(addr); + || IN_MULTICAST(addr) || IN_BADCLASS(addr); } /* @@ -2248,10 +2248,10 @@ some_ip_ok(addrs) struct wordlist *addrs; { for (; addrs != 0; addrs = addrs->next) { - if (addrs->word[0] == '-') - break; - if (addrs->word[0] != '!') - return 1; /* some IP address is allowed */ + if (addrs->word[0] == '-') + break; + if (addrs->word[0] != '!') + return 1; /* some IP address is allowed */ } return 0; } @@ -2268,17 +2268,17 @@ auth_number() /* Allow all if no authorization list. */ if (!wp) - return 1; + return 1; /* Allow if we have a match in the authorization list. */ while (wp) { - /* trailing '*' wildcard */ - l = strlen(wp->word); - if ((wp->word)[l - 1] == '*') - l--; - if (!strncasecmp(wp->word, remote_number, l)) - return 1; - wp = wp->next; + /* trailing '*' wildcard */ + l = strlen(wp->word); + if ((wp->word)[l - 1] == '*') + l--; + if (!strncasecmp(wp->word, remote_number, l)) + return 1; + wp = wp->next; } return 0; @@ -2295,10 +2295,10 @@ check_access(f, filename) struct stat sbuf; if (fstat(fileno(f), &sbuf) < 0) { - ppp_warn("cannot stat secret file %s: %m", filename); + ppp_warn("cannot stat secret file %s: %m", filename); } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { - ppp_warn("Warning - secret file %s has world and/or group access", - filename); + ppp_warn("Warning - secret file %s has world and/or group access", + filename); } } @@ -2337,141 +2337,141 @@ scan_authfile(f, client, server, secret, addrs, opts, filename, flags) char *cp; if (addrs != NULL) - *addrs = NULL; + *addrs = NULL; if (opts != NULL) - *opts = NULL; + *opts = NULL; addr_list = NULL; if (!getword(f, word, &newline, filename)) - return -1; /* file is empty??? */ + return -1; /* file is empty??? */ newline = 1; best_flag = -1; for (;;) { - /* - * Skip until we find a word at the start of a line. - */ - while (!newline && getword(f, word, &newline, filename)) - ; - if (!newline) - break; /* got to end of file */ - - /* - * Got a client - check if it's a match or a wildcard. - */ - got_flag = 0; - if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { - newline = 0; - continue; - } - if (!ISWILD(word)) - got_flag = NONWILD_CLIENT; - - /* - * Now get a server and check if it matches. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - if (!ISWILD(word)) { - if (server != NULL && strcmp(word, server) != 0) - continue; - got_flag |= NONWILD_SERVER; - } - - /* - * Got some sort of a match - see if it's better than what - * we have already. - */ - if (got_flag <= best_flag) - continue; - - /* - * Get the secret. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - - /* - * SRP-SHA1 authenticator should never be reading secrets from - * a file. (Authenticatee may, though.) - */ - if (flags && ((cp = strchr(word, ':')) == NULL || - strchr(cp + 1, ':') == NULL)) - continue; - - if (secret != NULL) { - /* - * Special syntax: @/pathname means read secret from file. - */ - if (word[0] == '@' && word[1] == '/') { - strlcpy(atfile, word+1, sizeof(atfile)); - if ((sf = fopen(atfile, "r")) == NULL) { - ppp_warn("can't open indirect secret file %s", atfile); - continue; - } - check_access(sf, atfile); - if (!getword(sf, word, &xxx, atfile)) { - ppp_warn("no secret in indirect secret file %s", atfile); - fclose(sf); - continue; - } - fclose(sf); - } - strlcpy(lsecret, word, sizeof(lsecret)); - } - - /* - * Now read address authorization info and make a wordlist. - */ - app = &alist; - for (;;) { - if (!getword(f, word, &newline, filename) || newline) - break; - ap = (struct wordlist *) - malloc(sizeof(struct wordlist) + strlen(word) + 1); - if (ap == NULL) - novm("authorized addresses"); - ap->word = (char *) (ap + 1); - strcpy(ap->word, word); - *app = ap; - app = &ap->next; - } - *app = NULL; - - /* - * This is the best so far; remember it. - */ - best_flag = got_flag; - if (addr_list) - free_wordlist(addr_list); - addr_list = alist; - if (secret != NULL) - strlcpy(secret, lsecret, MAXWORDLEN); - - if (!newline) - break; + /* + * Skip until we find a word at the start of a line. + */ + while (!newline && getword(f, word, &newline, filename)) + ; + if (!newline) + break; /* got to end of file */ + + /* + * Got a client - check if it's a match or a wildcard. + */ + got_flag = 0; + if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { + newline = 0; + continue; + } + if (!ISWILD(word)) + got_flag = NONWILD_CLIENT; + + /* + * Now get a server and check if it matches. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + if (!ISWILD(word)) { + if (server != NULL && strcmp(word, server) != 0) + continue; + got_flag |= NONWILD_SERVER; + } + + /* + * Got some sort of a match - see if it's better than what + * we have already. + */ + if (got_flag <= best_flag) + continue; + + /* + * Get the secret. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + + /* + * SRP-SHA1 authenticator should never be reading secrets from + * a file. (Authenticatee may, though.) + */ + if (flags && ((cp = strchr(word, ':')) == NULL || + strchr(cp + 1, ':') == NULL)) + continue; + + if (secret != NULL) { + /* + * Special syntax: @/pathname means read secret from file. + */ + if (word[0] == '@' && word[1] == '/') { + strlcpy(atfile, word+1, sizeof(atfile)); + if ((sf = fopen(atfile, "r")) == NULL) { + ppp_warn("can't open indirect secret file %s", atfile); + continue; + } + check_access(sf, atfile); + if (!getword(sf, word, &xxx, atfile)) { + ppp_warn("no secret in indirect secret file %s", atfile); + fclose(sf); + continue; + } + fclose(sf); + } + strlcpy(lsecret, word, sizeof(lsecret)); + } + + /* + * Now read address authorization info and make a wordlist. + */ + app = &alist; + for (;;) { + if (!getword(f, word, &newline, filename) || newline) + break; + ap = (struct wordlist *) + malloc(sizeof(struct wordlist) + strlen(word) + 1); + if (ap == NULL) + novm("authorized addresses"); + ap->word = (char *) (ap + 1); + strcpy(ap->word, word); + *app = ap; + app = &ap->next; + } + *app = NULL; + + /* + * This is the best so far; remember it. + */ + best_flag = got_flag; + if (addr_list) + free_wordlist(addr_list); + addr_list = alist; + if (secret != NULL) + strlcpy(secret, lsecret, MAXWORDLEN); + + if (!newline) + break; } /* scan for a -- word indicating the start of options */ for (app = &addr_list; (ap = *app) != NULL; app = &ap->next) - if (strcmp(ap->word, "--") == 0) - break; + if (strcmp(ap->word, "--") == 0) + break; /* ap = start of options */ if (ap != NULL) { - ap = ap->next; /* first option */ - free(*app); /* free the "--" word */ - *app = NULL; /* terminate addr list */ + ap = ap->next; /* first option */ + free(*app); /* free the "--" word */ + *app = NULL; /* terminate addr list */ } if (opts != NULL) - *opts = ap; + *opts = ap; else if (ap != NULL) - free_wordlist(ap); + free_wordlist(ap); if (addrs != NULL) - *addrs = addr_list; + *addrs = addr_list; else if (addr_list != NULL) - free_wordlist(addr_list); + free_wordlist(addr_list); return best_flag; } @@ -2486,7 +2486,7 @@ wordlist_count(wp) int n; for (n = 0; wp != NULL; wp = wp->next) - ++n; + ++n; return n; } @@ -2500,9 +2500,9 @@ free_wordlist(wp) struct wordlist *next; while (wp != NULL) { - next = wp->next; - free(wp); - wp = next; + next = wp->next; + free(wp); + wp = next; } } #endif /* UNUSED */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ccp.c b/components/net/lwip-2.1.2/src/netif/ppp/ccp.c index f8519ebece..5e5b75c361 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ccp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ccp.c @@ -40,8 +40,8 @@ #include "netif/ppp/ccp.h" #if MPPE_SUPPORT -#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ -#include "netif/ppp/mppe.h" /* mppe_init() */ +#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ +#include "netif/ppp/mppe.h" /* mppe_init() */ #endif /* MPPE_SUPPORT */ /* @@ -51,7 +51,7 @@ * Until this is fixed we only accept sizes in the range 9 .. 15. * Thanks to James Carlson for pointing this out. */ -#define DEFLATE_MIN_WORKS 9 +#define DEFLATE_MIN_WORKS 9 /* * Command-line options. @@ -66,7 +66,7 @@ static char deflate_value[8]; * Option variables. */ #if MPPE_SUPPORT -bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ +bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ #endif /* MPPE_SUPPORT */ static option_t ccp_option_list[] = { @@ -248,27 +248,27 @@ static const fsm_callbacks ccp_callbacks = { static int ccp_anycompress(ccp_options *opt) { return (0 #if DEFLATE_SUPPORT - || (opt)->deflate + || (opt)->deflate #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - || (opt)->bsd_compress + || (opt)->bsd_compress #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - || (opt)->predictor_1 || (opt)->predictor_2 + || (opt)->predictor_1 || (opt)->predictor_2 #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - || (opt)->mppe + || (opt)->mppe #endif /* MPPE_SUPPORT */ - ); + ); } /* * Local state (mainly for handling reset-reqs and reset-acks). */ -#define RACK_PENDING 1 /* waiting for reset-ack */ -#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ +#define RACK_PENDING 1 /* waiting for reset-ack */ +#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ -#define RACKTIMEOUT 1 /* second */ +#define RACKTIMEOUT 1 /* second */ #if PPP_OPTIONS /* @@ -284,31 +284,31 @@ setbsdcomp(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for bsdcomp option", *argv); - return 0; + option_error("invalid parameter '%s' for bsdcomp option", *argv); + return 0; } if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS)) - || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { - option_error("bsdcomp option values must be 0 or %d .. %d", - BSD_MIN_BITS, BSD_MAX_BITS); - return 0; + || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { + option_error("bsdcomp option values must be 0 or %d .. %d", + BSD_MIN_BITS, BSD_MAX_BITS); + return 0; } if (rbits > 0) { - ccp_wantoptions[0].bsd_compress = 1; - ccp_wantoptions[0].bsd_bits = rbits; + ccp_wantoptions[0].bsd_compress = 1; + ccp_wantoptions[0].bsd_bits = rbits; } else - ccp_wantoptions[0].bsd_compress = 0; + ccp_wantoptions[0].bsd_compress = 0; if (abits > 0) { - ccp_allowoptions[0].bsd_compress = 1; - ccp_allowoptions[0].bsd_bits = abits; + ccp_allowoptions[0].bsd_compress = 1; + ccp_allowoptions[0].bsd_bits = abits; } else - ccp_allowoptions[0].bsd_compress = 0; + ccp_allowoptions[0].bsd_compress = 0; ppp_slprintf(bsd_value, sizeof(bsd_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -323,40 +323,40 @@ setdeflate(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for deflate option", *argv); - return 0; + option_error("invalid parameter '%s' for deflate option", *argv); + return 0; } if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE)) - || (abits != 0 && (abits < DEFLATE_MIN_SIZE - || abits > DEFLATE_MAX_SIZE))) { - option_error("deflate option values must be 0 or %d .. %d", - DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); - return 0; + || (abits != 0 && (abits < DEFLATE_MIN_SIZE + || abits > DEFLATE_MAX_SIZE))) { + option_error("deflate option values must be 0 or %d .. %d", + DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); + return 0; } if (rbits == DEFLATE_MIN_SIZE || abits == DEFLATE_MIN_SIZE) { - if (rbits == DEFLATE_MIN_SIZE) - rbits = DEFLATE_MIN_WORKS; - if (abits == DEFLATE_MIN_SIZE) - abits = DEFLATE_MIN_WORKS; - warn("deflate option value of %d changed to %d to avoid zlib bug", - DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); + if (rbits == DEFLATE_MIN_SIZE) + rbits = DEFLATE_MIN_WORKS; + if (abits == DEFLATE_MIN_SIZE) + abits = DEFLATE_MIN_WORKS; + warn("deflate option value of %d changed to %d to avoid zlib bug", + DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); } if (rbits > 0) { - ccp_wantoptions[0].deflate = 1; - ccp_wantoptions[0].deflate_size = rbits; + ccp_wantoptions[0].deflate = 1; + ccp_wantoptions[0].deflate_size = rbits; } else - ccp_wantoptions[0].deflate = 0; + ccp_wantoptions[0].deflate = 0; if (abits > 0) { - ccp_allowoptions[0].deflate = 1; - ccp_allowoptions[0].deflate_size = abits; + ccp_allowoptions[0].deflate = 1; + ccp_allowoptions[0].deflate_size = abits; } else - ccp_allowoptions[0].deflate = 0; + ccp_allowoptions[0].deflate = 0; ppp_slprintf(deflate_value, sizeof(deflate_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -411,7 +411,7 @@ static void ccp_open(ppp_pcb *pcb) { ccp_options *go = &pcb->ccp_gotoptions; if (f->state != PPP_FSM_OPENED) - ccp_set(pcb, 1, 0, 0, 0); + ccp_set(pcb, 1, 0, 0, 0); /* * Find out which compressors the kernel supports before @@ -419,7 +419,7 @@ static void ccp_open(ppp_pcb *pcb) { */ ccp_resetci(f); if (!ccp_anycompress(go)) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -463,12 +463,12 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { oldstate = f->state; fsm_input(f, p, len); if (oldstate == PPP_FSM_OPENED && p[0] == TERMREQ && f->state != PPP_FSM_OPENED) { - ppp_notice("Compression disabled by peer."); + ppp_notice("Compression disabled by peer."); #if MPPE_SUPPORT - if (go->mppe) { - ppp_error("MPPE disabled, closing LCP"); - lcp_close(pcb, "MPPE disabled by peer"); - } + if (go->mppe) { + ppp_error("MPPE disabled, closing LCP"); + lcp_close(pcb, "MPPE disabled by peer"); + } #endif /* MPPE_SUPPORT */ } @@ -477,8 +477,8 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { * close CCP. */ if (oldstate == PPP_FSM_REQSENT && p[0] == TERMACK - && !ccp_anycompress(go)) - ccp_close(pcb, "No compression negotiated"); + && !ccp_anycompress(go)) + ccp_close(pcb, "No compression negotiated"); } /* @@ -491,24 +491,24 @@ static int ccp_extcode(fsm *f, int code, int id, u_char *p, int len) { switch (code) { case CCP_RESETREQ: - if (f->state != PPP_FSM_OPENED) - break; - ccp_reset_comp(pcb); - /* send a reset-ack, which the transmitter will see and - reset its compression state. */ - fsm_sdata(f, CCP_RESETACK, id, NULL, 0); - break; + if (f->state != PPP_FSM_OPENED) + break; + ccp_reset_comp(pcb); + /* send a reset-ack, which the transmitter will see and + reset its compression state. */ + fsm_sdata(f, CCP_RESETACK, id, NULL, 0); + break; case CCP_RESETACK: - if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { - pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); - UNTIMEOUT(ccp_rack_timeout, f); - ccp_reset_decomp(pcb); - } - break; + if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { + pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); + UNTIMEOUT(ccp_rack_timeout, f); + ccp_reset_decomp(pcb); + } + break; default: - return 0; + return 0; } return 1; @@ -528,8 +528,8 @@ static void ccp_protrej(ppp_pcb *pcb) { #if MPPE_SUPPORT if (go->mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ @@ -554,9 +554,9 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (pcb->settings.require_mppe) { - wo->mppe = ao->mppe = - (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) - | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); + wo->mppe = ao->mppe = + (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) + | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); } #endif /* MPPE_SUPPORT */ @@ -565,78 +565,78 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (go->mppe) { - int auth_mschap_bits = pcb->auth_done; - int numbits; - - /* - * Start with a basic sanity check: mschap[v2] auth must be in - * exactly one direction. RFC 3079 says that the keys are - * 'derived from the credentials of the peer that initiated the call', - * however the PPP protocol doesn't have such a concept, and pppd - * cannot get this info externally. Instead we do the best we can. - * NB: If MPPE is required, all other compression opts are invalid. - * So, we return right away if we can't do it. - */ - - /* Leave only the mschap auth bits set */ - auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | - CHAP_MS2_WITHPEER | CHAP_MS2_PEER); - /* Count the mschap auths */ - auth_mschap_bits >>= CHAP_MS_SHIFT; - numbits = 0; - do { - numbits += auth_mschap_bits & 1; - auth_mschap_bits >>= 1; - } while (auth_mschap_bits); - if (numbits > 1) { - ppp_error("MPPE required, but auth done in both directions."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - if (!numbits) { - ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* A plugin (eg radius) may not have obtained key material. */ - if (!pcb->mppe_keys_set) { - ppp_error("MPPE required, but keys are not available. " - "Possible plugin problem?"); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* LM auth not supported for MPPE */ - if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { - /* This might be noise */ - if (go->mppe & MPPE_OPT_40) { - ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); - go->mppe &= ~MPPE_OPT_40; - wo->mppe &= ~MPPE_OPT_40; - } - } - - /* Last check: can we actually negotiate something? */ - if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { - /* Could be misconfig, could be 40-bit disabled above. */ - ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* sync options */ - ao->mppe = go->mppe; - /* MPPE is not compatible with other compression types */ + int auth_mschap_bits = pcb->auth_done; + int numbits; + + /* + * Start with a basic sanity check: mschap[v2] auth must be in + * exactly one direction. RFC 3079 says that the keys are + * 'derived from the credentials of the peer that initiated the call', + * however the PPP protocol doesn't have such a concept, and pppd + * cannot get this info externally. Instead we do the best we can. + * NB: If MPPE is required, all other compression opts are invalid. + * So, we return right away if we can't do it. + */ + + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | + CHAP_MS2_WITHPEER | CHAP_MS2_PEER); + /* Count the mschap auths */ + auth_mschap_bits >>= CHAP_MS_SHIFT; + numbits = 0; + do { + numbits += auth_mschap_bits & 1; + auth_mschap_bits >>= 1; + } while (auth_mschap_bits); + if (numbits > 1) { + ppp_error("MPPE required, but auth done in both directions."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + if (!numbits) { + ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* A plugin (eg radius) may not have obtained key material. */ + if (!pcb->mppe_keys_set) { + ppp_error("MPPE required, but keys are not available. " + "Possible plugin problem?"); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* LM auth not supported for MPPE */ + if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { + /* This might be noise */ + if (go->mppe & MPPE_OPT_40) { + ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); + go->mppe &= ~MPPE_OPT_40; + wo->mppe &= ~MPPE_OPT_40; + } + } + + /* Last check: can we actually negotiate something? */ + if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { + /* Could be misconfig, could be 40-bit disabled above. */ + ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* sync options */ + ao->mppe = go->mppe; + /* MPPE is not compatible with other compression types */ #if BSDCOMPRESS_SUPPORT - ao->bsd_compress = go->bsd_compress = 0; + ao->bsd_compress = go->bsd_compress = 0; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - ao->predictor_1 = go->predictor_1 = 0; - ao->predictor_2 = go->predictor_2 = 0; + ao->predictor_1 = go->predictor_1 = 0; + ao->predictor_2 = go->predictor_2 = 0; #endif /* PREDICTOR_SUPPORT */ #if DEFLATE_SUPPORT - ao->deflate = go->deflate = 0; + ao->deflate = go->deflate = 0; #endif /* DEFLATE_SUPPORT */ } #endif /* MPPE_SUPPORT */ @@ -650,23 +650,23 @@ static void ccp_resetci(fsm *f) { * if BSDCOMPRESS_SUPPORT is set, it is. */ if (go->bsd_compress) { - opt_buf[0] = CI_BSD_COMPRESS; - opt_buf[1] = CILEN_BSD_COMPRESS; - for (;;) { - if (go->bsd_bits < BSD_MIN_BITS) { - go->bsd_compress = 0; - break; - } - opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->bsd_compress = 0; - break; - } - go->bsd_bits--; - } + opt_buf[0] = CI_BSD_COMPRESS; + opt_buf[1] = CILEN_BSD_COMPRESS; + for (;;) { + if (go->bsd_bits < BSD_MIN_BITS) { + go->bsd_compress = 0; + break; + } + opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->bsd_compress = 0; + break; + } + go->bsd_bits--; + } } #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -674,48 +674,48 @@ static void ccp_resetci(fsm *f) { * if DEFLATE_SUPPORT is set, it is. */ if (go->deflate) { - if (go->deflate_correct) { - opt_buf[0] = CI_DEFLATE; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_correct = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_correct = 0; - break; - } - go->deflate_size--; - } - } - if (go->deflate_draft) { - opt_buf[0] = CI_DEFLATE_DRAFT; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_draft = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_draft = 0; - break; - } - go->deflate_size--; - } - } - if (!go->deflate_correct && !go->deflate_draft) - go->deflate = 0; + if (go->deflate_correct) { + opt_buf[0] = CI_DEFLATE; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_correct = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_correct = 0; + break; + } + go->deflate_size--; + } + } + if (go->deflate_draft) { + opt_buf[0] = CI_DEFLATE_DRAFT; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_draft = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_draft = 0; + break; + } + go->deflate_size--; + } + } + if (!go->deflate_correct && !go->deflate_draft) + go->deflate = 0; } #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT @@ -723,16 +723,16 @@ static void ccp_resetci(fsm *f) { * if PREDICTOR_SUPPORT is set, it is. */ if (go->predictor_1) { - opt_buf[0] = CI_PREDICTOR_1; - opt_buf[1] = CILEN_PREDICTOR_1; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) - go->predictor_1 = 0; + opt_buf[0] = CI_PREDICTOR_1; + opt_buf[1] = CILEN_PREDICTOR_1; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) + go->predictor_1 = 0; } if (go->predictor_2) { - opt_buf[0] = CI_PREDICTOR_2; - opt_buf[1] = CILEN_PREDICTOR_2; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) - go->predictor_2 = 0; + opt_buf[0] = CI_PREDICTOR_2; + opt_buf[1] = CILEN_PREDICTOR_2; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) + go->predictor_2 = 0; } #endif /* PREDICTOR_SUPPORT */ } @@ -746,20 +746,20 @@ static int ccp_cilen(fsm *f) { return 0 #if BSDCOMPRESS_SUPPORT - + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) + + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) - + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT - + (go->predictor_1? CILEN_PREDICTOR_1: 0) - + (go->predictor_2? CILEN_PREDICTOR_2: 0) + + (go->predictor_1? CILEN_PREDICTOR_1: 0) + + (go->predictor_2? CILEN_PREDICTOR_2: 0) #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - + (go->mppe? CILEN_MPPE: 0) + + (go->mppe? CILEN_MPPE: 0) #endif /* MPPE_SUPPORT */ - ; + ; } /* @@ -776,50 +776,50 @@ static void ccp_addci(fsm *f, u_char *p, int *lenp) { */ #if MPPE_SUPPORT if (go->mppe) { - p[0] = CI_MPPE; - p[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &p[2]); - mppe_init(pcb, &pcb->mppe_decomp, go->mppe); - p += CILEN_MPPE; + p[0] = CI_MPPE; + p[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &p[2]); + mppe_init(pcb, &pcb->mppe_decomp, go->mppe); + p += CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (go->deflate_correct) { - p[0] = CI_DEFLATE; - p[1] = CILEN_DEFLATE; - p[2] = DEFLATE_MAKE_OPT(go->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } - if (go->deflate_draft) { - p[0] = CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; - p[2] = p[2 - CILEN_DEFLATE]; - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } + if (go->deflate_correct) { + p[0] = CI_DEFLATE; + p[1] = CILEN_DEFLATE; + p[2] = DEFLATE_MAKE_OPT(go->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } + if (go->deflate_draft) { + p[0] = CI_DEFLATE_DRAFT; + p[1] = CILEN_DEFLATE; + p[2] = p[2 - CILEN_DEFLATE]; + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - p[0] = CI_BSD_COMPRESS; - p[1] = CILEN_BSD_COMPRESS; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - p += CILEN_BSD_COMPRESS; + p[0] = CI_BSD_COMPRESS; + p[1] = CILEN_BSD_COMPRESS; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + p += CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT /* XXX Should Predictor 2 be preferable to Predictor 1? */ if (go->predictor_1) { - p[0] = CI_PREDICTOR_1; - p[1] = CILEN_PREDICTOR_1; - p += CILEN_PREDICTOR_1; + p[0] = CI_PREDICTOR_1; + p[1] = CILEN_PREDICTOR_1; + p += CILEN_PREDICTOR_1; } if (go->predictor_2) { - p[0] = CI_PREDICTOR_2; - p[1] = CILEN_PREDICTOR_2; - p += CILEN_PREDICTOR_2; + p[0] = CI_PREDICTOR_2; + p[1] = CILEN_PREDICTOR_2; + p += CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ @@ -841,83 +841,83 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { #if MPPE_SUPPORT if (go->mppe) { - u_char opt_buf[CILEN_MPPE]; - - opt_buf[0] = CI_MPPE; - opt_buf[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); - if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) - return 0; - p += CILEN_MPPE; - len -= CILEN_MPPE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; + u_char opt_buf[CILEN_MPPE]; + + opt_buf[0] = CI_MPPE; + opt_buf[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); + if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) + return 0; + p += CILEN_MPPE; + len -= CILEN_MPPE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (len < CILEN_DEFLATE - || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; - if (go->deflate_correct && go->deflate_draft) { - if (len < CILEN_DEFLATE - || p[0] != CI_DEFLATE_DRAFT - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + if (len < CILEN_DEFLATE + || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; + if (go->deflate_correct && go->deflate_draft) { + if (len < CILEN_DEFLATE + || p[0] != CI_DEFLATE_DRAFT + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - if (len < CILEN_BSD_COMPRESS - || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS - || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_BSD_COMPRESS + || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS + || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1) { - if (len < CILEN_PREDICTOR_1 - || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) - return 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_1 + || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) + return 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } if (go->predictor_2) { - if (len < CILEN_PREDICTOR_2 - || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) - return 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_2 + || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) + return 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; return 1; } @@ -928,8 +928,8 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options no; /* options we've seen already */ - ccp_options try_; /* options to ask for next time */ + ccp_options no; /* options we've seen already */ + ccp_options try_; /* options to ask for next time */ LWIP_UNUSED_ARG(treat_as_reject); #if !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT LWIP_UNUSED_ARG(p); @@ -941,66 +941,66 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - no.mppe = 1; - /* - * Peer wants us to use a different strength or other setting. - * Fail if we aren't willing to use his suggestion. - */ - MPPE_CI_TO_OPTS(&p[2], try_.mppe); - if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - try_.mppe = 0; - } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { - /* Peer must have set options we didn't request (suggest) */ - try_.mppe = 0; - } - - if (!try_.mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - } + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + no.mppe = 1; + /* + * Peer wants us to use a different strength or other setting. + * Fail if we aren't willing to use his suggestion. + */ + MPPE_CI_TO_OPTS(&p[2], try_.mppe); + if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + try_.mppe = 0; + } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { + /* Peer must have set options we didn't request (suggest) */ + try_.mppe = 0; + } + + if (!try_.mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { - no.deflate = 1; - /* - * Peer wants us to use a different code size or something. - * Stop asking for Deflate if we don't understand his suggestion. - */ - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS - || p[3] != DEFLATE_CHK_SEQUENCE) - try_.deflate = 0; - else if (DEFLATE_SIZE(p[2]) < go->deflate_size) - try_.deflate_size = DEFLATE_SIZE(p[2]); - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - if (go->deflate_correct && go->deflate_draft - && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT - && p[1] == CILEN_DEFLATE) { - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + && p[1] == CILEN_DEFLATE) { + no.deflate = 1; + /* + * Peer wants us to use a different code size or something. + * Stop asking for Deflate if we don't understand his suggestion. + */ + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS + || p[3] != DEFLATE_CHK_SEQUENCE) + try_.deflate = 0; + else if (DEFLATE_SIZE(p[2]) < go->deflate_size) + try_.deflate_size = DEFLATE_SIZE(p[2]); + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + if (go->deflate_correct && go->deflate_draft + && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT + && p[1] == CILEN_DEFLATE) { + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - no.bsd_compress = 1; - /* - * Peer wants us to use a different number of bits - * or a different version. - */ - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) - try_.bsd_compress = 0; - else if (BSD_NBITS(p[2]) < go->bsd_bits) - try_.bsd_bits = BSD_NBITS(p[2]); - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + no.bsd_compress = 1; + /* + * Peer wants us to use a different number of bits + * or a different version. + */ + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) + try_.bsd_compress = 0; + else if (BSD_NBITS(p[2]) < go->bsd_bits) + try_.bsd_bits = BSD_NBITS(p[2]); + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ @@ -1011,7 +1011,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1021,7 +1021,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { static int ccp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options try_; /* options to request next time */ + ccp_options try_; /* options to request next time */ try_ = *go; @@ -1030,69 +1030,69 @@ static int ccp_rejci(fsm *f, u_char *p, int len) { * configure-requests. */ if (len == 0 && pcb->ccp_all_rejected) - return -1; + return -1; #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - ppp_error("MPPE required but peer refused"); - lcp_close(pcb, "MPPE required but peer refused"); - p += CILEN_MPPE; - len -= CILEN_MPPE; + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + ppp_error("MPPE required but peer refused"); + lcp_close(pcb, "MPPE required but peer refused"); + p += CILEN_MPPE; + len -= CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate_correct && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_correct = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_correct = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (go->deflate_draft && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_draft = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_draft = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (!try_.deflate_correct && !try_.deflate_draft) - try_.deflate = 0; + try_.deflate = 0; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - try_.bsd_compress = 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + try_.bsd_compress = 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1 && len >= CILEN_PREDICTOR_1 - && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { - try_.predictor_1 = 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; + && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { + try_.predictor_1 = 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; } if (go->predictor_2 && len >= CILEN_PREDICTOR_2 - && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { - try_.predictor_2 = 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; + && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { + try_.predictor_2 = 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1114,8 +1114,8 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { u_char *p0, *retp; int len, clen, type; #if MPPE_SUPPORT - u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ - /* CI_MPPE, or due to other options? */ + u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ + /* CI_MPPE, or due to other options? */ #endif /* MPPE_SUPPORT */ ret = CONFACK; @@ -1126,257 +1126,257 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { ho->method = (len > 0)? p[0]: 0; while (len > 0) { - newret = CONFACK; - if (len < 2 || p[1] < 2 || p[1] > len) { - /* length is bad */ - clen = len; - newret = CONFREJ; + newret = CONFACK; + if (len < 2 || p[1] < 2 || p[1] > len) { + /* length is bad */ + clen = len; + newret = CONFREJ; - } else { - type = p[0]; - clen = p[1]; + } else { + type = p[0]; + clen = p[1]; - switch (type) { + switch (type) { #if MPPE_SUPPORT - case CI_MPPE: - if (!ao->mppe || clen != CILEN_MPPE) { - newret = CONFREJ; - break; - } - MPPE_CI_TO_OPTS(&p[2], ho->mppe); - - /* Nak if anything unsupported or unknown are set. */ - if (ho->mppe & MPPE_OPT_UNSUPPORTED) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNSUPPORTED; - } - if (ho->mppe & MPPE_OPT_UNKNOWN) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNKNOWN; - } - - /* Check state opt */ - if (ho->mppe & MPPE_OPT_STATEFUL) { - /* - * We can Nak and request stateless, but it's a - * lot easier to just assume the peer will request - * it if he can do it; stateful mode is bad over - * the Internet -- which is where we expect MPPE. - */ - if (pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - newret = CONFREJ; - break; - } - } - - /* Find out which of {S,L} are set. */ - if ((ho->mppe & MPPE_OPT_128) - && (ho->mppe & MPPE_OPT_40)) { - /* Both are set, negotiate the strongest. */ - newret = CONFNAK; - if (ao->mppe & MPPE_OPT_128) - ho->mppe &= ~MPPE_OPT_40; - else if (ao->mppe & MPPE_OPT_40) - ho->mppe &= ~MPPE_OPT_128; - else { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_128) { - if (!(ao->mppe & MPPE_OPT_128)) { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_40) { - if (!(ao->mppe & MPPE_OPT_40)) { - newret = CONFREJ; - break; - } - } else { - /* Neither are set. */ - /* We cannot accept this. */ - newret = CONFNAK; - /* Give the peer our idea of what can be used, - so it can choose and confirm */ - ho->mppe = ao->mppe; - } - - /* rebuild the opts */ - MPPE_OPTS_TO_CI(ho->mppe, &p[2]); - if (newret == CONFACK) { - int mtu; - - mppe_init(pcb, &pcb->mppe_comp, ho->mppe); - /* - * We need to decrease the interface MTU by MPPE_PAD - * because MPPE frames **grow**. The kernel [must] - * allocate MPPE_PAD extra bytes in xmit buffers. - */ - mtu = netif_get_mtu(pcb); - if (mtu) - netif_set_mtu(pcb, mtu - MPPE_PAD); - else - newret = CONFREJ; - } - - /* - * We have accepted MPPE or are willing to negotiate - * MPPE parameters. A CONFREJ is due to subsequent - * (non-MPPE) processing. - */ - rej_for_ci_mppe = 0; - break; + case CI_MPPE: + if (!ao->mppe || clen != CILEN_MPPE) { + newret = CONFREJ; + break; + } + MPPE_CI_TO_OPTS(&p[2], ho->mppe); + + /* Nak if anything unsupported or unknown are set. */ + if (ho->mppe & MPPE_OPT_UNSUPPORTED) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNSUPPORTED; + } + if (ho->mppe & MPPE_OPT_UNKNOWN) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNKNOWN; + } + + /* Check state opt */ + if (ho->mppe & MPPE_OPT_STATEFUL) { + /* + * We can Nak and request stateless, but it's a + * lot easier to just assume the peer will request + * it if he can do it; stateful mode is bad over + * the Internet -- which is where we expect MPPE. + */ + if (pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + newret = CONFREJ; + break; + } + } + + /* Find out which of {S,L} are set. */ + if ((ho->mppe & MPPE_OPT_128) + && (ho->mppe & MPPE_OPT_40)) { + /* Both are set, negotiate the strongest. */ + newret = CONFNAK; + if (ao->mppe & MPPE_OPT_128) + ho->mppe &= ~MPPE_OPT_40; + else if (ao->mppe & MPPE_OPT_40) + ho->mppe &= ~MPPE_OPT_128; + else { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_128) { + if (!(ao->mppe & MPPE_OPT_128)) { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_40) { + if (!(ao->mppe & MPPE_OPT_40)) { + newret = CONFREJ; + break; + } + } else { + /* Neither are set. */ + /* We cannot accept this. */ + newret = CONFNAK; + /* Give the peer our idea of what can be used, + so it can choose and confirm */ + ho->mppe = ao->mppe; + } + + /* rebuild the opts */ + MPPE_OPTS_TO_CI(ho->mppe, &p[2]); + if (newret == CONFACK) { + int mtu; + + mppe_init(pcb, &pcb->mppe_comp, ho->mppe); + /* + * We need to decrease the interface MTU by MPPE_PAD + * because MPPE frames **grow**. The kernel [must] + * allocate MPPE_PAD extra bytes in xmit buffers. + */ + mtu = netif_get_mtu(pcb); + if (mtu) + netif_set_mtu(pcb, mtu - MPPE_PAD); + else + newret = CONFREJ; + } + + /* + * We have accepted MPPE or are willing to negotiate + * MPPE parameters. A CONFREJ is due to subsequent + * (non-MPPE) processing. + */ + rej_for_ci_mppe = 0; + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (!ao->deflate || clen != CILEN_DEFLATE - || (!ao->deflate_correct && type == CI_DEFLATE) - || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { - newret = CONFREJ; - break; - } - - ho->deflate = 1; - ho->deflate_size = nb = DEFLATE_SIZE(p[2]); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || p[3] != DEFLATE_CHK_SEQUENCE - || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do Deflate with the window - * size they want. If the window is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_DEFLATE, 1); - if (res > 0) - break; /* it's OK now */ - if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { - newret = CONFREJ; - p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); - break; - } - newret = CONFNAK; - --nb; - p[2] = DEFLATE_MAKE_OPT(nb); - } - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (!ao->deflate || clen != CILEN_DEFLATE + || (!ao->deflate_correct && type == CI_DEFLATE) + || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { + newret = CONFREJ; + break; + } + + ho->deflate = 1; + ho->deflate_size = nb = DEFLATE_SIZE(p[2]); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || p[3] != DEFLATE_CHK_SEQUENCE + || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do Deflate with the window + * size they want. If the window is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_DEFLATE, 1); + if (res > 0) + break; /* it's OK now */ + if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { + newret = CONFREJ; + p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); + break; + } + newret = CONFNAK; + --nb; + p[2] = DEFLATE_MAKE_OPT(nb); + } + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { - newret = CONFREJ; - break; - } - - ho->bsd_compress = 1; - ho->bsd_bits = nb = BSD_NBITS(p[2]); - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION - || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do BSD-Compress with the code - * size they want. If the code size is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); - if (res > 0) - break; - if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { - newret = CONFREJ; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, - ho->bsd_bits); - break; - } - newret = CONFNAK; - --nb; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); - } - } - break; + case CI_BSD_COMPRESS: + if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { + newret = CONFREJ; + break; + } + + ho->bsd_compress = 1; + ho->bsd_bits = nb = BSD_NBITS(p[2]); + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION + || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do BSD-Compress with the code + * size they want. If the code size is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); + if (res > 0) + break; + if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { + newret = CONFREJ; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, + ho->bsd_bits); + break; + } + newret = CONFNAK; + --nb; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); + } + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { - newret = CONFREJ; - break; - } - - ho->predictor_1 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { - newret = CONFREJ; - } - break; - - case CI_PREDICTOR_2: - if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { - newret = CONFREJ; - break; - } - - ho->predictor_2 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { - newret = CONFREJ; - } - break; + case CI_PREDICTOR_1: + if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { + newret = CONFREJ; + break; + } + + ho->predictor_1 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { + newret = CONFREJ; + } + break; + + case CI_PREDICTOR_2: + if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { + newret = CONFREJ; + break; + } + + ho->predictor_2 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { + newret = CONFREJ; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: - newret = CONFREJ; - } - } + default: + newret = CONFREJ; + } + } - if (newret == CONFNAK && dont_nak) - newret = CONFREJ; - if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { - /* we're returning this option */ - if (newret == CONFREJ && ret == CONFNAK) - retp = p0; - ret = newret; - if (p != retp) - MEMCPY(retp, p, clen); - retp += clen; - } + if (newret == CONFNAK && dont_nak) + newret = CONFREJ; + if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { + /* we're returning this option */ + if (newret == CONFREJ && ret == CONFNAK) + retp = p0; + ret = newret; + if (p != retp) + MEMCPY(retp, p, clen); + retp += clen; + } - p += clen; - len -= clen; + p += clen; + len -= clen; } if (ret != CONFACK) { - if (ret == CONFREJ && *lenp == retp - p0) - pcb->ccp_all_rejected = 1; - else - *lenp = retp - p0; + if (ret == CONFREJ && *lenp == retp - p0) + pcb->ccp_all_rejected = 1; + else + *lenp = retp - p0; } #if MPPE_SUPPORT if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ return ret; @@ -1392,63 +1392,63 @@ static const char *method_name(ccp_options *opt, ccp_options *opt2) { #endif /* !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT */ if (!ccp_anycompress(opt)) - return "(none)"; + return "(none)"; switch (opt->method) { #if MPPE_SUPPORT case CI_MPPE: { - char *p = result; - char *q = result + sizeof(result); /* 1 past result */ - - ppp_slprintf(p, q - p, "MPPE "); - p += 5; - if (opt->mppe & MPPE_OPT_128) { - ppp_slprintf(p, q - p, "128-bit "); - p += 8; - } - if (opt->mppe & MPPE_OPT_40) { - ppp_slprintf(p, q - p, "40-bit "); - p += 7; - } - if (opt->mppe & MPPE_OPT_STATEFUL) - ppp_slprintf(p, q - p, "stateful"); - else - ppp_slprintf(p, q - p, "stateless"); - - break; + char *p = result; + char *q = result + sizeof(result); /* 1 past result */ + + ppp_slprintf(p, q - p, "MPPE "); + p += 5; + if (opt->mppe & MPPE_OPT_128) { + ppp_slprintf(p, q - p, "128-bit "); + p += 8; + } + if (opt->mppe & MPPE_OPT_40) { + ppp_slprintf(p, q - p, "40-bit "); + p += 7; + } + if (opt->mppe & MPPE_OPT_STATEFUL) + ppp_slprintf(p, q - p, "stateful"); + else + ppp_slprintf(p, q - p, "stateless"); + + break; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT case CI_DEFLATE: case CI_DEFLATE_DRAFT: - if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) - ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size, opt2->deflate_size); - else - ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size); - break; + if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) + ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size, opt2->deflate_size); + else + ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size); + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT case CI_BSD_COMPRESS: - if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", - opt->bsd_bits, opt2->bsd_bits); - else - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", - opt->bsd_bits); - break; + if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", + opt->bsd_bits, opt2->bsd_bits); + else + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", + opt->bsd_bits); + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT case CI_PREDICTOR_1: - return "Predictor 1"; + return "Predictor 1"; case CI_PREDICTOR_2: - return "Predictor 2"; + return "Predictor 2"; #endif /* PREDICTOR_SUPPORT */ default: - ppp_slprintf(result, sizeof(result), "Method %d", opt->method); + ppp_slprintf(result, sizeof(result), "Method %d", opt->method); } return result; } @@ -1464,21 +1464,21 @@ static void ccp_up(fsm *f) { ccp_set(pcb, 1, 1, go->method, ho->method); if (ccp_anycompress(go)) { - if (ccp_anycompress(ho)) { - if (go->method == ho->method) { - ppp_notice("%s compression enabled", method_name(go, ho)); - } else { - ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); - ppp_notice("%s / %s compression enabled", - method1, method_name(ho, NULL)); - } - } else - ppp_notice("%s receive compression enabled", method_name(go, NULL)); + if (ccp_anycompress(ho)) { + if (go->method == ho->method) { + ppp_notice("%s compression enabled", method_name(go, ho)); + } else { + ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); + ppp_notice("%s / %s compression enabled", + method1, method_name(ho, NULL)); + } + } else + ppp_notice("%s receive compression enabled", method_name(go, NULL)); } else if (ccp_anycompress(ho)) - ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); + ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); #if MPPE_SUPPORT if (go->mppe) { - continue_networks(pcb); /* Bring up IP et al */ + continue_networks(pcb); /* Bring up IP et al */ } #endif /* MPPE_SUPPORT */ } @@ -1493,17 +1493,17 @@ static void ccp_down(fsm *f) { #endif /* MPPE_SUPPORT */ if (pcb->ccp_localstate & RACK_PENDING) - UNTIMEOUT(ccp_rack_timeout, f); + UNTIMEOUT(ccp_rack_timeout, f); pcb->ccp_localstate = 0; ccp_set(pcb, 1, 0, 0, 0); #if MPPE_SUPPORT if (go->mppe) { - go->mppe = 0; - if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { - /* If LCP is not already going down, make sure it does. */ - ppp_error("MPPE disabled"); - lcp_close(pcb, "MPPE disabled"); - } + go->mppe = 0; + if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { + /* If LCP is not already going down, make sure it does. */ + ppp_error("MPPE disabled"); + lcp_close(pcb, "MPPE disabled"); + } } #endif /* MPPE_SUPPORT */ } @@ -1526,17 +1526,17 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons p0 = p; if (plen < HEADERLEN) - return 0; + return 0; code = p[0]; id = p[1]; len = (p[2] << 8) + p[3]; if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ccp_codenames) && ccp_codenames[code-1] != NULL) - printer(arg, " %s", ccp_codenames[code-1]); + printer(arg, " %s", ccp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; p += HEADERLEN; @@ -1546,99 +1546,99 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons case CONFACK: case CONFNAK: case CONFREJ: - /* print list of possible compression methods */ - while (len >= 2) { - code = p[0]; - optlen = p[1]; - if (optlen < 2 || optlen > len) - break; - printer(arg, " <"); - len -= optlen; - optend = p + optlen; - switch (code) { + /* print list of possible compression methods */ + while (len >= 2) { + code = p[0]; + optlen = p[1]; + if (optlen < 2 || optlen > len) + break; + printer(arg, " <"); + len -= optlen; + optend = p + optlen; + switch (code) { #if MPPE_SUPPORT - case CI_MPPE: - if (optlen >= CILEN_MPPE) { - u_char mppe_opts; - - MPPE_CI_TO_OPTS(&p[2], mppe_opts); - printer(arg, "mppe %s %s %s %s %s %s%s", - (p[2] & MPPE_H_BIT)? "+H": "-H", - (p[5] & MPPE_M_BIT)? "+M": "-M", - (p[5] & MPPE_S_BIT)? "+S": "-S", - (p[5] & MPPE_L_BIT)? "+L": "-L", - (p[5] & MPPE_D_BIT)? "+D": "-D", - (p[5] & MPPE_C_BIT)? "+C": "-C", - (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); - if (mppe_opts & MPPE_OPT_UNKNOWN) - printer(arg, " (%.2x %.2x %.2x %.2x)", - p[2], p[3], p[4], p[5]); - p += CILEN_MPPE; - } - break; + case CI_MPPE: + if (optlen >= CILEN_MPPE) { + u_char mppe_opts; + + MPPE_CI_TO_OPTS(&p[2], mppe_opts); + printer(arg, "mppe %s %s %s %s %s %s%s", + (p[2] & MPPE_H_BIT)? "+H": "-H", + (p[5] & MPPE_M_BIT)? "+M": "-M", + (p[5] & MPPE_S_BIT)? "+S": "-S", + (p[5] & MPPE_L_BIT)? "+L": "-L", + (p[5] & MPPE_D_BIT)? "+D": "-D", + (p[5] & MPPE_C_BIT)? "+C": "-C", + (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); + if (mppe_opts & MPPE_OPT_UNKNOWN) + printer(arg, " (%.2x %.2x %.2x %.2x)", + p[2], p[3], p[4], p[5]); + p += CILEN_MPPE; + } + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (optlen >= CILEN_DEFLATE) { - printer(arg, "deflate%s %d", - (code == CI_DEFLATE_DRAFT? "(old#)": ""), - DEFLATE_SIZE(p[2])); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) - printer(arg, " method %d", DEFLATE_METHOD(p[2])); - if (p[3] != DEFLATE_CHK_SEQUENCE) - printer(arg, " check %d", p[3]); - p += CILEN_DEFLATE; - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (optlen >= CILEN_DEFLATE) { + printer(arg, "deflate%s %d", + (code == CI_DEFLATE_DRAFT? "(old#)": ""), + DEFLATE_SIZE(p[2])); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) + printer(arg, " method %d", DEFLATE_METHOD(p[2])); + if (p[3] != DEFLATE_CHK_SEQUENCE) + printer(arg, " check %d", p[3]); + p += CILEN_DEFLATE; + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (optlen >= CILEN_BSD_COMPRESS) { - printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), - BSD_NBITS(p[2])); - p += CILEN_BSD_COMPRESS; - } - break; + case CI_BSD_COMPRESS: + if (optlen >= CILEN_BSD_COMPRESS) { + printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), + BSD_NBITS(p[2])); + p += CILEN_BSD_COMPRESS; + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (optlen >= CILEN_PREDICTOR_1) { - printer(arg, "predictor 1"); - p += CILEN_PREDICTOR_1; - } - break; - case CI_PREDICTOR_2: - if (optlen >= CILEN_PREDICTOR_2) { - printer(arg, "predictor 2"); - p += CILEN_PREDICTOR_2; - } - break; + case CI_PREDICTOR_1: + if (optlen >= CILEN_PREDICTOR_1) { + printer(arg, "predictor 1"); + p += CILEN_PREDICTOR_1; + } + break; + case CI_PREDICTOR_2: + if (optlen >= CILEN_PREDICTOR_2) { + printer(arg, "predictor 2"); + p += CILEN_PREDICTOR_2; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: + default: break; - } - while (p < optend) - printer(arg, " %.2x", *p++); - printer(arg, ">"); - } - break; + } + while (p < optend) + printer(arg, " %.2x", *p++); + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: break; } /* dump out the rest of the packet in hex */ while (--len >= 0) - printer(arg, " %.2x", *p++); + printer(arg, " %.2x", *p++); return p - p0; } @@ -1667,34 +1667,34 @@ static void ccp_datainput(ppp_pcb *pcb, u_char *pkt, int len) { f = &pcb->ccp_fsm; if (f->state == PPP_FSM_OPENED) { - if (ccp_fatal_error(pcb)) { - /* - * Disable compression by taking CCP down. - */ - ppp_error("Lost compression sync: disabling compression"); - ccp_close(pcb, "Lost compression sync"); + if (ccp_fatal_error(pcb)) { + /* + * Disable compression by taking CCP down. + */ + ppp_error("Lost compression sync: disabling compression"); + ccp_close(pcb, "Lost compression sync"); #if MPPE_SUPPORT - /* - * If we were doing MPPE, we must also take the link down. - */ - if (go->mppe) { - ppp_error("Too many MPPE errors, closing LCP"); - lcp_close(pcb, "Too many MPPE errors"); - } + /* + * If we were doing MPPE, we must also take the link down. + */ + if (go->mppe) { + ppp_error("Too many MPPE errors, closing LCP"); + lcp_close(pcb, "Too many MPPE errors"); + } #endif /* MPPE_SUPPORT */ - } else { - /* - * Send a reset-request to reset the peer's compressor. - * We don't do that if we are still waiting for an - * acknowledgement to a previous reset-request. - */ - if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; - } else - pcb->ccp_localstate |= RREQ_REPEAT; - } + } else { + /* + * Send a reset-request to reset the peer's compressor. + * We don't do that if we are still waiting for an + * acknowledgement to a previous reset-request. + */ + if (!(pcb->ccp_localstate & RACK_PENDING)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; + } else + pcb->ccp_localstate |= RREQ_REPEAT; + } } } #endif /* PPP_DATAINPUT */ @@ -1707,7 +1707,7 @@ void ccp_resetrequest(ppp_pcb *pcb) { fsm *f = &pcb->ccp_fsm; if (f->state != PPP_FSM_OPENED) - return; + return; /* * Send a reset-request to reset the peer's compressor. @@ -1715,11 +1715,11 @@ void ccp_resetrequest(ppp_pcb *pcb) { * acknowledgement to a previous reset-request. */ if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; } else - pcb->ccp_localstate |= RREQ_REPEAT; + pcb->ccp_localstate |= RREQ_REPEAT; } /* @@ -1730,11 +1730,11 @@ static void ccp_rack_timeout(void *arg) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED && (pcb->ccp_localstate & RREQ_REPEAT)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate &= ~RREQ_REPEAT; + fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate &= ~RREQ_REPEAT; } else - pcb->ccp_localstate &= ~RACK_PENDING; + pcb->ccp_localstate &= ~RACK_PENDING; } #endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c b/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c index 88f069f032..2b7c9b36a8 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c @@ -43,84 +43,84 @@ #include "netif/ppp/magic.h" #include "netif/ppp/pppcrypt.h" -#define MD5_HASH_SIZE 16 -#define MD5_MIN_CHALLENGE 17 -#define MD5_MAX_CHALLENGE 24 +#define MD5_HASH_SIZE 16 +#define MD5_MIN_CHALLENGE 17 +#define MD5_MAX_CHALLENGE 24 #define MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE 3 /* 2^3-1 = 7, 17+7 = 24 */ #if PPP_SERVER static void chap_md5_generate_challenge(ppp_pcb *pcb, unsigned char *cp) { - int clen; - LWIP_UNUSED_ARG(pcb); + int clen; + LWIP_UNUSED_ARG(pcb); - clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); - *cp++ = clen; - magic_random_bytes(cp, clen); + clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); + *cp++ = clen; + magic_random_bytes(cp, clen); } static int chap_md5_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - lwip_md5_context ctx; - unsigned char idbyte = id; - unsigned char hash[MD5_HASH_SIZE]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(name); - LWIP_UNUSED_ARG(pcb); + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + lwip_md5_context ctx; + unsigned char idbyte = id; + unsigned char hash[MD5_HASH_SIZE]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(pcb); - challenge_len = *challenge++; - response_len = *response++; - if (response_len == MD5_HASH_SIZE) { - /* Generate hash of ID, secret, challenge */ - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, hash); - lwip_md5_free(&ctx); + challenge_len = *challenge++; + response_len = *response++; + if (response_len == MD5_HASH_SIZE) { + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, hash); + lwip_md5_free(&ctx); - /* Test if our hash matches the peer's response */ - if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } - } - ppp_slprintf(message, message_space, "Access denied"); - return 0; + /* Test if our hash matches the peer's response */ + if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } + } + ppp_slprintf(message, message_space, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chap_md5_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - lwip_md5_context ctx; - unsigned char idbyte = id; - int challenge_len = *challenge++; - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - LWIP_UNUSED_ARG(pcb); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + lwip_md5_context ctx; + unsigned char idbyte = id; + int challenge_len = *challenge++; + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + LWIP_UNUSED_ARG(pcb); - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, (const u_char *)secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, &response[1]); - lwip_md5_free(&ctx); - response[0] = MD5_HASH_SIZE; + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, (const u_char *)secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, &response[1]); + lwip_md5_free(&ctx); + response[0] = MD5_HASH_SIZE; } const struct chap_digest_type md5_digest = { - CHAP_MD5, /* code */ + CHAP_MD5, /* code */ #if PPP_SERVER - chap_md5_generate_challenge, - chap_md5_verify_response, + chap_md5_generate_challenge, + chap_md5_verify_response, #endif /* PPP_SERVER */ - chap_md5_make_response, - NULL, /* check_success */ - NULL, /* handle_failure */ + chap_md5_make_response, + NULL, /* check_success */ + NULL, /* handle_failure */ }; #endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c b/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c index 485122d272..e599f3eb76 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c @@ -52,9 +52,9 @@ #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ int (*chap_verify_hook)(const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) = NULL; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) = NULL; #endif /* UNUSED */ #if PPP_OPTIONS @@ -62,24 +62,24 @@ int (*chap_verify_hook)(const char *name, const char *ourname, int id, * Command-line options. */ static option_t chap_option_list[] = { - { "chap-restart", o_int, &chap_timeout_time, - "Set timeout for CHAP", OPT_PRIO }, - { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, - "Set max #xmits for challenge", OPT_PRIO }, - { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, - "Set interval for rechallenge", OPT_PRIO }, - { NULL } + { "chap-restart", o_int, &chap_timeout_time, + "Set timeout for CHAP", OPT_PRIO }, + { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, + "Set max #xmits for challenge", OPT_PRIO }, + { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, + "Set interval for rechallenge", OPT_PRIO }, + { NULL } }; #endif /* PPP_OPTIONS */ /* Values for flags in chap_client_state and chap_server_state */ -#define LOWERUP 1 -#define AUTH_STARTED 2 -#define AUTH_DONE 4 -#define AUTH_FAILED 8 -#define TIMEOUT_PENDING 0x10 -#define CHALLENGE_VALID 0x20 +#define LOWERUP 1 +#define AUTH_STARTED 2 +#define AUTH_DONE 4 +#define AUTH_FAILED 8 +#define TIMEOUT_PENDING 0x10 +#define CHALLENGE_VALID 0x20 /* * Prototypes. @@ -91,21 +91,21 @@ static void chap_lowerdown(ppp_pcb *pcb); static void chap_timeout(void *arg); static void chap_generate_challenge(ppp_pcb *pcb); static void chap_handle_response(ppp_pcb *pcb, int code, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_protrej(ppp_pcb *pcb); static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen); #if PRINTPKT_SUPPORT static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ /* List of digest types that we know about */ @@ -122,12 +122,12 @@ static const struct chap_digest_type* const chap_digests[] = { * chap_init - reset to initial state. */ static void chap_init(ppp_pcb *pcb) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); #if 0 /* Not necessary, everything is cleared in ppp_new() */ - memset(&pcb->chap_client, 0, sizeof(chap_client_state)); + memset(&pcb->chap_client, 0, sizeof(chap_client_state)); #if PPP_SERVER - memset(&pcb->chap_server, 0, sizeof(chap_server_state)); + memset(&pcb->chap_server, 0, sizeof(chap_server_state)); #endif /* PPP_SERVER */ #endif /* 0 */ } @@ -137,21 +137,21 @@ static void chap_init(ppp_pcb *pcb) { */ static void chap_lowerup(ppp_pcb *pcb) { - pcb->chap_client.flags |= LOWERUP; + pcb->chap_client.flags |= LOWERUP; #if PPP_SERVER - pcb->chap_server.flags |= LOWERUP; - if (pcb->chap_server.flags & AUTH_STARTED) - chap_timeout(pcb); + pcb->chap_server.flags |= LOWERUP; + if (pcb->chap_server.flags & AUTH_STARTED) + chap_timeout(pcb); #endif /* PPP_SERVER */ } static void chap_lowerdown(ppp_pcb *pcb) { - pcb->chap_client.flags = 0; + pcb->chap_client.flags = 0; #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) - UNTIMEOUT(chap_timeout, pcb); - pcb->chap_server.flags = 0; + if (pcb->chap_server.flags & TIMEOUT_PENDING) + UNTIMEOUT(chap_timeout, pcb); + pcb->chap_server.flags = 0; #endif /* PPP_SERVER */ } @@ -162,27 +162,27 @@ static void chap_lowerdown(ppp_pcb *pcb) { * otherwise we wait for the lower layer to come up. */ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if (pcb->chap_server.flags & AUTH_STARTED) { - ppp_error("CHAP: peer authentication already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_server.digest = dp; - pcb->chap_server.name = our_name; - /* Start with a random ID value */ - pcb->chap_server.id = magic(); - pcb->chap_server.flags |= AUTH_STARTED; - if (pcb->chap_server.flags & LOWERUP) - chap_timeout(pcb); + const struct chap_digest_type *dp; + int i; + + if (pcb->chap_server.flags & AUTH_STARTED) { + ppp_error("CHAP: peer authentication already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_server.digest = dp; + pcb->chap_server.name = our_name; + /* Start with a random ID value */ + pcb->chap_server.id = magic(); + pcb->chap_server.flags |= AUTH_STARTED; + if (pcb->chap_server.flags & LOWERUP) + chap_timeout(pcb); } #endif /* PPP_SERVER */ @@ -191,27 +191,27 @@ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * There isn't much to do until we receive a challenge. */ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if(NULL == our_name) - return; - - if (pcb->chap_client.flags & AUTH_STARTED) { - ppp_error("CHAP: authentication with peer already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_client.digest = dp; - pcb->chap_client.name = our_name; - pcb->chap_client.flags |= AUTH_STARTED; + const struct chap_digest_type *dp; + int i; + + if(NULL == our_name) + return; + + if (pcb->chap_client.flags & AUTH_STARTED) { + ppp_error("CHAP: authentication with peer already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_client.digest = dp; + pcb->chap_client.name = our_name; + pcb->chap_client.flags |= AUTH_STARTED; } #if PPP_SERVER @@ -221,33 +221,33 @@ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * or a new challenge to start re-authentication. */ static void chap_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; - struct pbuf *p; - - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { - pcb->chap_server.challenge_xmits = 0; - chap_generate_challenge(pcb); - pcb->chap_server.flags |= CHALLENGE_VALID; - } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; - auth_peer_fail(pcb, PPP_CHAP); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); - ppp_write(pcb, p); - ++pcb->chap_server.challenge_xmits; - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); + ppp_pcb *pcb = (ppp_pcb*)arg; + struct pbuf *p; + + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { + pcb->chap_server.challenge_xmits = 0; + chap_generate_challenge(pcb); + pcb->chap_server.flags |= CHALLENGE_VALID; + } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; + auth_peer_fail(pcb, PPP_CHAP); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); + ppp_write(pcb, p); + ++pcb->chap_server.challenge_xmits; + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); } /* @@ -255,152 +255,152 @@ static void chap_timeout(void *arg) { * the challenge packet in pcb->chap_server.challenge_pkt. */ static void chap_generate_challenge(ppp_pcb *pcb) { - int clen = 1, nlen, len; - unsigned char *p; - - p = pcb->chap_server.challenge; - MAKEHEADER(p, PPP_CHAP); - p += CHAP_HDRLEN; - pcb->chap_server.digest->generate_challenge(pcb, p); - clen = *p; - nlen = strlen(pcb->chap_server.name); - memcpy(p + 1 + clen, pcb->chap_server.name, nlen); - - len = CHAP_HDRLEN + 1 + clen + nlen; - pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; - - p = pcb->chap_server.challenge + PPP_HDRLEN; - p[0] = CHAP_CHALLENGE; - p[1] = ++pcb->chap_server.id; - p[2] = len >> 8; - p[3] = len; + int clen = 1, nlen, len; + unsigned char *p; + + p = pcb->chap_server.challenge; + MAKEHEADER(p, PPP_CHAP); + p += CHAP_HDRLEN; + pcb->chap_server.digest->generate_challenge(pcb, p); + clen = *p; + nlen = strlen(pcb->chap_server.name); + memcpy(p + 1 + clen, pcb->chap_server.name, nlen); + + len = CHAP_HDRLEN + 1 + clen + nlen; + pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; + + p = pcb->chap_server.challenge + PPP_HDRLEN; + p[0] = CHAP_CHALLENGE; + p[1] = ++pcb->chap_server.id; + p[2] = len >> 8; + p[3] = len; } /* * chap_handle_response - check the response to our challenge. */ static void chap_handle_response(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int response_len, ok, mlen; - const unsigned char *response; - unsigned char *outp; - struct pbuf *p; - const char *name = NULL; /* initialized to shut gcc up */ + unsigned char *pkt, int len) { + int response_len, ok, mlen; + const unsigned char *response; + unsigned char *outp; + struct pbuf *p; + const char *name = NULL; /* initialized to shut gcc up */ #if 0 /* UNUSED */ - int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, - const unsigned char *, const unsigned char *, char *, int); + int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, + const unsigned char *, const unsigned char *, char *, int); #endif /* UNUSED */ - char rname[MAXNAMELEN+1]; - char message[256]; - - if ((pcb->chap_server.flags & LOWERUP) == 0) - return; - if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) - return; - if (pcb->chap_server.flags & CHALLENGE_VALID) { - response = pkt; - GETCHAR(response_len, pkt); - len -= response_len + 1; /* length of name */ - name = (char *)pkt + response_len; - if (len < 0) - return; - - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } + char rname[MAXNAMELEN+1]; + char message[256]; + + if ((pcb->chap_server.flags & LOWERUP) == 0) + return; + if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) + return; + if (pcb->chap_server.flags & CHALLENGE_VALID) { + response = pkt; + GETCHAR(response_len, pkt); + len -= response_len + 1; /* length of name */ + name = (char *)pkt + response_len; + if (len < 0) + return; + + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } #if PPP_REMOTENAME - if (pcb->settings.explicit_remote) { - name = pcb->remote_name; - } else + if (pcb->settings.explicit_remote) { + name = pcb->remote_name; + } else #endif /* PPP_REMOTENAME */ - { - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); - name = rname; - } + { + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); + name = rname; + } #if 0 /* UNUSED */ - if (chap_verify_hook) - verifier = chap_verify_hook; - else - verifier = chap_verify_response; - ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, - pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, - response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); + if (chap_verify_hook) + verifier = chap_verify_hook; + else + verifier = chap_verify_response; + ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, + pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, + response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); #endif /* UNUSED */ - ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, + ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, response, message, sizeof(message)); #if 0 /* UNUSED */ - if (!ok || !auth_number()) { + if (!ok || !auth_number()) { #endif /* UNUSED */ - if (!ok) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP authentication", name); - } - } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) - return; - - /* send the response */ - mlen = strlen(message); - len = CHAP_HDRLEN + mlen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (unsigned char *)p->payload; - MAKEHEADER(outp, PPP_CHAP); - - outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - if (mlen > 0) - memcpy(outp + CHAP_HDRLEN, message, mlen); - ppp_write(pcb, p); - - if (pcb->chap_server.flags & CHALLENGE_VALID) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { + if (!ok) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP authentication", name); + } + } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) + return; + + /* send the response */ + mlen = strlen(message); + len = CHAP_HDRLEN + mlen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (unsigned char *)p->payload; + MAKEHEADER(outp, PPP_CHAP); + + outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + if (mlen > 0) + memcpy(outp + CHAP_HDRLEN, message, mlen); + ppp_write(pcb, p); + + if (pcb->chap_server.flags & CHALLENGE_VALID) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { #if 0 /* UNUSED */ - /* - * Auth is OK, so now we need to check session restrictions - * to ensure everything is OK, but only if we used a - * plugin, and only if we're configured to check. This - * allows us to do PAM checks on PPP servers that - * authenticate against ActiveDirectory, and use AD for - * account info (like when using Winbind integrated with - * PAM). - */ - if (session_mgmt && - session_check(name, NULL, devnam, NULL) == 0) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP Session verification", name); - } + /* + * Auth is OK, so now we need to check session restrictions + * to ensure everything is OK, but only if we used a + * plugin, and only if we're configured to check. This + * allows us to do PAM checks on PPP servers that + * authenticate against ActiveDirectory, and use AD for + * account info (like when using Winbind integrated with + * PAM). + */ + if (session_mgmt && + session_check(name, NULL, devnam, NULL) == 0) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP Session verification", name); + } #endif /* UNUSED */ - } - if (pcb->chap_server.flags & AUTH_FAILED) { - auth_peer_fail(pcb, PPP_CHAP); - } else { - if ((pcb->chap_server.flags & AUTH_DONE) == 0) - auth_peer_success(pcb, PPP_CHAP, - pcb->chap_server.digest->code, - name, strlen(name)); - if (pcb->settings.chap_rechallenge_time) { - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, pcb, - pcb->settings.chap_rechallenge_time); - } - } - pcb->chap_server.flags |= AUTH_DONE; - } + } + if (pcb->chap_server.flags & AUTH_FAILED) { + auth_peer_fail(pcb, PPP_CHAP); + } else { + if ((pcb->chap_server.flags & AUTH_DONE) == 0) + auth_peer_success(pcb, PPP_CHAP, + pcb->chap_server.digest->code, + name, strlen(name)); + if (pcb->settings.chap_rechallenge_time) { + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, pcb, + pcb->settings.chap_rechallenge_time); + } + } + pcb->chap_server.flags |= AUTH_DONE; + } } /* @@ -409,23 +409,23 @@ static void chap_handle_response(ppp_pcb *pcb, int id, * succeeded), or 0 if it doesn't. */ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - int ok; - unsigned char secret[MAXSECRETLEN]; - int secret_len; - - /* Get the secret that the peer is supposed to know */ - if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { - ppp_error("No CHAP secret found for authenticating %q", name); - return 0; - } - ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, - response, message, message_space); - memset(secret, 0, sizeof(secret)); - - return ok; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + int ok; + unsigned char secret[MAXSECRETLEN]; + int secret_len; + + /* Get the secret that the peer is supposed to know */ + if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { + ppp_error("No CHAP secret found for authenticating %q", name); + return 0; + } + ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, + response, message, message_space); + memset(secret, 0, sizeof(secret)); + + return ok; } #endif /* PPP_SERVER */ @@ -433,153 +433,153 @@ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourn * chap_respond - Generate and send a response to a challenge. */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int clen, nlen; - int secret_len; - struct pbuf *p; - u_char *outp; - char rname[MAXNAMELEN+1]; - char secret[MAXSECRETLEN+1]; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) - return; /* not ready */ - if (len < 2 || len < pkt[0] + 1) - return; /* too short */ - clen = pkt[0]; - nlen = len - (clen + 1); - - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); + unsigned char *pkt, int len) { + int clen, nlen; + int secret_len; + struct pbuf *p; + u_char *outp; + char rname[MAXNAMELEN+1]; + char secret[MAXSECRETLEN+1]; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) + return; /* not ready */ + if (len < 2 || len < pkt[0] + 1) + return; /* too short */ + clen = pkt[0]; + nlen = len - (clen + 1); + + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); #if PPP_REMOTENAME - /* Microsoft doesn't send their name back in the PPP packet */ - if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) - strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); + /* Microsoft doesn't send their name back in the PPP packet */ + if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) + strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); #endif /* PPP_REMOTENAME */ - /* get secret for authenticating ourselves with the specified host */ - if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { - secret_len = 0; /* assume null secret if can't find one */ - ppp_warn("No CHAP secret found for authenticating us to %q", rname); - } - - outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_CHAP); - outp += CHAP_HDRLEN; - - pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, - secret, secret_len, pcb->chap_client.priv); - memset(secret, 0, secret_len); - - clen = *outp; - nlen = strlen(pcb->chap_client.name); - memcpy(outp + clen + 1, pcb->chap_client.name, nlen); - - outp = (u_char*)p->payload + PPP_HDRLEN; - len = CHAP_HDRLEN + clen + 1 + nlen; - outp[0] = CHAP_RESPONSE; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - - pbuf_realloc(p, PPP_HDRLEN + len); - ppp_write(pcb, p); + /* get secret for authenticating ourselves with the specified host */ + if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { + secret_len = 0; /* assume null secret if can't find one */ + ppp_warn("No CHAP secret found for authenticating us to %q", rname); + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_CHAP); + outp += CHAP_HDRLEN; + + pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, + secret, secret_len, pcb->chap_client.priv); + memset(secret, 0, secret_len); + + clen = *outp; + nlen = strlen(pcb->chap_client.name); + memcpy(outp + clen + 1, pcb->chap_client.name, nlen); + + outp = (u_char*)p->payload + PPP_HDRLEN; + len = CHAP_HDRLEN + clen + 1 + nlen; + outp[0] = CHAP_RESPONSE; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + + pbuf_realloc(p, PPP_HDRLEN + len); + ppp_write(pcb, p); } static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len) { - const char *msg = NULL; - LWIP_UNUSED_ARG(id); - - if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) - != (AUTH_STARTED|LOWERUP)) - return; - pcb->chap_client.flags |= AUTH_DONE; - - if (code == CHAP_SUCCESS) { - /* used for MS-CHAP v2 mutual auth, yuck */ - if (pcb->chap_client.digest->check_success != NULL) { - if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) - code = CHAP_FAILURE; - } else - msg = "CHAP authentication succeeded"; - } else { - if (pcb->chap_client.digest->handle_failure != NULL) - (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); - else - msg = "CHAP authentication failed"; - } - if (msg) { - if (len > 0) - ppp_info("%s: %.*v", msg, len, pkt); - else - ppp_info("%s", msg); - } - if (code == CHAP_SUCCESS) - auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); - else { - pcb->chap_client.flags |= AUTH_FAILED; - ppp_error("CHAP authentication failed"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + unsigned char *pkt, int len) { + const char *msg = NULL; + LWIP_UNUSED_ARG(id); + + if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) + != (AUTH_STARTED|LOWERUP)) + return; + pcb->chap_client.flags |= AUTH_DONE; + + if (code == CHAP_SUCCESS) { + /* used for MS-CHAP v2 mutual auth, yuck */ + if (pcb->chap_client.digest->check_success != NULL) { + if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) + code = CHAP_FAILURE; + } else + msg = "CHAP authentication succeeded"; + } else { + if (pcb->chap_client.digest->handle_failure != NULL) + (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); + else + msg = "CHAP authentication failed"; + } + if (msg) { + if (len > 0) + ppp_info("%s: %.*v", msg, len, pkt); + else + ppp_info("%s", msg); + } + if (code == CHAP_SUCCESS) + auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); + else { + pcb->chap_client.flags |= AUTH_FAILED; + ppp_error("CHAP authentication failed"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen) { - unsigned char code, id; - int len; - - if (pktlen < CHAP_HDRLEN) - return; - GETCHAR(code, pkt); - GETCHAR(id, pkt); - GETSHORT(len, pkt); - if (len < CHAP_HDRLEN || len > pktlen) - return; - len -= CHAP_HDRLEN; - - switch (code) { - case CHAP_CHALLENGE: - chap_respond(pcb, id, pkt, len); - break; + unsigned char code, id; + int len; + + if (pktlen < CHAP_HDRLEN) + return; + GETCHAR(code, pkt); + GETCHAR(id, pkt); + GETSHORT(len, pkt); + if (len < CHAP_HDRLEN || len > pktlen) + return; + len -= CHAP_HDRLEN; + + switch (code) { + case CHAP_CHALLENGE: + chap_respond(pcb, id, pkt, len); + break; #if PPP_SERVER - case CHAP_RESPONSE: - chap_handle_response(pcb, id, pkt, len); - break; + case CHAP_RESPONSE: + chap_handle_response(pcb, id, pkt, len); + break; #endif /* PPP_SERVER */ - case CHAP_FAILURE: - case CHAP_SUCCESS: - chap_handle_status(pcb, code, id, pkt, len); - break; - default: - break; - } + case CHAP_FAILURE: + case CHAP_SUCCESS: + chap_handle_status(pcb, code, id, pkt, len); + break; + default: + break; + } } static void chap_protrej(ppp_pcb *pcb) { #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } - if (pcb->chap_server.flags & AUTH_STARTED) { - pcb->chap_server.flags = 0; - auth_peer_fail(pcb, PPP_CHAP); - } + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } + if (pcb->chap_server.flags & AUTH_STARTED) { + pcb->chap_server.flags = 0; + auth_peer_fail(pcb, PPP_CHAP); + } #endif /* PPP_SERVER */ - if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { - pcb->chap_client.flags &= ~AUTH_STARTED; - ppp_error("CHAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { + pcb->chap_client.flags &= ~AUTH_STARTED; + ppp_error("CHAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } #if PRINTPKT_SUPPORT @@ -587,90 +587,90 @@ static void chap_protrej(ppp_pcb *pcb) { * chap_print_pkt - print the contents of a CHAP packet. */ static const char* const chap_code_names[] = { - "Challenge", "Response", "Success", "Failure" + "Challenge", "Response", "Success", "Failure" }; static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len; - int clen, nlen; - unsigned char x; - - if (plen < CHAP_HDRLEN) - return 0; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < CHAP_HDRLEN || len > plen) - return 0; - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) - printer(arg, " %s", chap_code_names[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= CHAP_HDRLEN; - switch (code) { - case CHAP_CHALLENGE: - case CHAP_RESPONSE: - if (len < 1) - break; - clen = p[0]; - if (len < clen + 1) - break; - ++p; - nlen = len - clen - 1; - printer(arg, " <"); - for (; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, "%.2x", x); - } - printer(arg, ">, name = "); - ppp_print_string(p, nlen, printer, arg); - break; - case CHAP_FAILURE: - case CHAP_SUCCESS: - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - break; - default: - for (clen = len; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, " %.2x", x); - } - /* no break */ - } - - return len + CHAP_HDRLEN; + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len; + int clen, nlen; + unsigned char x; + + if (plen < CHAP_HDRLEN) + return 0; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < CHAP_HDRLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) + printer(arg, " %s", chap_code_names[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= CHAP_HDRLEN; + switch (code) { + case CHAP_CHALLENGE: + case CHAP_RESPONSE: + if (len < 1) + break; + clen = p[0]; + if (len < clen + 1) + break; + ++p; + nlen = len - clen - 1; + printer(arg, " <"); + for (; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, "%.2x", x); + } + printer(arg, ">, name = "); + ppp_print_string(p, nlen, printer, arg); + break; + case CHAP_FAILURE: + case CHAP_SUCCESS: + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + break; + default: + for (clen = len; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, " %.2x", x); + } + /* no break */ + } + + return len + CHAP_HDRLEN; } #endif /* PRINTPKT_SUPPORT */ const struct protent chap_protent = { - PPP_CHAP, - chap_init, - chap_input, - chap_protrej, - chap_lowerup, - chap_lowerdown, - NULL, /* open */ - NULL, /* close */ + PPP_CHAP, + chap_init, + chap_input, + chap_protrej, + chap_lowerup, + chap_lowerdown, + NULL, /* open */ + NULL, /* close */ #if PRINTPKT_SUPPORT - chap_print_pkt, + chap_print_pkt, #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* datainput */ + NULL, /* datainput */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "CHAP", /* name */ - NULL, /* data_name */ + "CHAP", /* name */ + NULL, /* data_name */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - chap_option_list, - NULL, /* check_options */ + chap_option_list, + NULL, /* check_options */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, - NULL + NULL, + NULL #endif /* DEMAND_SUPPORT */ }; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c b/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c index 5a989c9b7e..b050aa1cd1 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c @@ -97,41 +97,41 @@ #include "netif/ppp/mppe.h" /* For mppe_sha1_pad*, mppe_set_key() */ #endif /* MPPE_SUPPORT */ -#define SHA1_SIGNATURE_SIZE 20 -#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ -#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ +#define SHA1_SIGNATURE_SIZE 20 +#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ +#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ -#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ -#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ -#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ - /* as ASCII */ +#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ +#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ +#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ + /* as ASCII */ /* Error codes for MS-CHAP failure messages. */ -#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 -#define MS_CHAP_ERROR_ACCT_DISABLED 647 -#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 -#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 -#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 -#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 +#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 +#define MS_CHAP_ERROR_ACCT_DISABLED 647 +#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 +#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 +#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 +#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 /* * Offsets within the response field for MS-CHAP */ -#define MS_CHAP_LANMANRESP 0 -#define MS_CHAP_LANMANRESP_LEN 24 -#define MS_CHAP_NTRESP 24 -#define MS_CHAP_NTRESP_LEN 24 -#define MS_CHAP_USENT 48 +#define MS_CHAP_LANMANRESP 0 +#define MS_CHAP_LANMANRESP_LEN 24 +#define MS_CHAP_NTRESP 24 +#define MS_CHAP_NTRESP_LEN 24 +#define MS_CHAP_USENT 48 /* * Offsets within the response field for MS-CHAP2 */ -#define MS_CHAP2_PEER_CHALLENGE 0 -#define MS_CHAP2_PEER_CHAL_LEN 16 -#define MS_CHAP2_RESERVED_LEN 8 -#define MS_CHAP2_NTRESP 24 -#define MS_CHAP2_NTRESP_LEN 24 -#define MS_CHAP2_FLAGS 48 +#define MS_CHAP2_PEER_CHALLENGE 0 +#define MS_CHAP2_PEER_CHAL_LEN 16 +#define MS_CHAP2_RESERVED_LEN 8 +#define MS_CHAP2_NTRESP 24 +#define MS_CHAP2_NTRESP_LEN 24 +#define MS_CHAP2_FLAGS 48 #if MPPE_SUPPORT #if 0 /* UNUSED */ @@ -150,37 +150,37 @@ extern void set_mppe_enc_types(int, int); #define MS_CHAP2_AUTHENTICATEE 0 #define MS_CHAP2_AUTHENTICATOR 1 -static void ascii2unicode (const char[], int, u_char[]); -static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); -static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); -static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); -static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); -static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, - u_char[24]); -static void GenerateAuthenticatorResponsePlain - (const char*, int, u_char[24], const u_char[16], const u_char *, - const char *, u_char[41]); +static void ascii2unicode (const char[], int, u_char[]); +static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); +static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); +static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); +static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); +static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, + u_char[24]); +static void GenerateAuthenticatorResponsePlain + (const char*, int, u_char[24], const u_char[16], const u_char *, + const char *, u_char[41]); #ifdef MSLANMAN -static void ChapMS_LANMan (u_char *, char *, int, u_char *); +static void ChapMS_LANMan (u_char *, char *, int, u_char *); #endif static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); #if MPPE_SUPPORT -static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); -static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); +static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); +static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); #endif /* MPPE_SUPPORT */ static void ChapMS (ppp_pcb *pcb, const u_char *, const char *, int, u_char *); static void ChapMS2 (ppp_pcb *pcb, const u_char *, const u_char *, const char *, const char *, int, - u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); + u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); #ifdef MSLANMAN -bool ms_lanman = 0; /* Use LanMan password instead of NT */ - /* Has meaning only with MS-CHAP challenges */ +bool ms_lanman = 0; /* Use LanMan password instead of NT */ + /* Has meaning only with MS-CHAP challenges */ #endif #if MPPE_SUPPORT @@ -192,7 +192,7 @@ static char *mschap_challenge = NULL; static char *mschap2_peer_challenge = NULL; #endif -#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ +#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ #include "netif/ppp/ccp.h" #endif /* MPPE_SUPPORT */ @@ -202,16 +202,16 @@ static char *mschap2_peer_challenge = NULL; */ static option_t chapms_option_list[] = { #ifdef MSLANMAN - { "ms-lanman", o_bool, &ms_lanman, - "Use LanMan passwd when using MS-CHAP", 1 }, + { "ms-lanman", o_bool, &ms_lanman, + "Use LanMan passwd when using MS-CHAP", 1 }, #endif #ifdef DEBUGMPPEKEY - { "mschap-challenge", o_string, &mschap_challenge, - "specify CHAP challenge" }, - { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, - "specify CHAP peer challenge" }, + { "mschap-challenge", o_string, &mschap_challenge, + "specify CHAP challenge" }, + { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, + "specify CHAP peer challenge" }, #endif - { NULL } + { NULL } }; #endif /* PPP_OPTIONS */ @@ -223,279 +223,279 @@ static option_t chapms_option_list[] = { * at challenge[1]. */ static void chapms_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 8; + *challenge++ = 8; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 8) - memcpy(challenge, mschap_challenge, 8); - else + if (mschap_challenge && strlen(mschap_challenge) == 8) + memcpy(challenge, mschap_challenge, 8); + else #endif - magic_random_bytes(challenge, 8); + magic_random_bytes(challenge, 8); } static void chapms2_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 16; + *challenge++ = 16; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 16) - memcpy(challenge, mschap_challenge, 16); - else + if (mschap_challenge && strlen(mschap_challenge) == 16) + memcpy(challenge, mschap_challenge, 16); + else #endif - magic_random_bytes(challenge, 16); + magic_random_bytes(challenge, 16); } static int chapms_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP_RESPONSE_LEN]; - int diff; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(name); - - challenge_len = *challenge++; /* skip length, is 8 */ - response_len = *response++; - if (response_len != MS_CHAP_RESPONSE_LEN) - goto bad; + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP_RESPONSE_LEN]; + int diff; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(name); + + challenge_len = *challenge++; /* skip length, is 8 */ + response_len = *response++; + if (response_len != MS_CHAP_RESPONSE_LEN) + goto bad; #ifndef MSLANMAN - if (!response[MS_CHAP_USENT]) { - /* Should really propagate this into the error packet. */ - ppp_notice("Peer request for LANMAN auth not supported"); - goto bad; - } + if (!response[MS_CHAP_USENT]) { + /* Should really propagate this into the error packet. */ + ppp_notice("Peer request for LANMAN auth not supported"); + goto bad; + } #endif - /* Generate the expected response. */ - ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); + /* Generate the expected response. */ + ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); #ifdef MSLANMAN - /* Determine which part of response to verify against */ - if (!response[MS_CHAP_USENT]) - diff = memcmp(&response[MS_CHAP_LANMANRESP], - &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); - else + /* Determine which part of response to verify against */ + if (!response[MS_CHAP_USENT]) + diff = memcmp(&response[MS_CHAP_LANMANRESP], + &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); + else #endif - diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], - MS_CHAP_NTRESP_LEN); + diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], + MS_CHAP_NTRESP_LEN); - if (diff == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } + if (diff == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } bad: - /* See comments below for MS-CHAP V2 */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", - challenge_len, challenge); - return 0; + /* See comments below for MS-CHAP V2 */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", + challenge_len, challenge); + return 0; } static int chapms2_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP2_RESPONSE_LEN]; - char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - - challenge_len = *challenge++; /* skip length, is 16 */ - response_len = *response++; - if (response_len != MS_CHAP2_RESPONSE_LEN) - goto bad; /* not even the right length */ - - /* Generate the expected response and our mutual auth. */ - ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, - (const char *)secret, secret_len, md, - (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); - - /* compare MDs and send the appropriate status */ - /* - * Per RFC 2759, success message must be formatted as - * "S= M=" - * where - * is the Authenticator Response (mutual auth) - * is a text message - * - * However, some versions of Windows (win98 tested) do not know - * about the M= part (required per RFC 2759) and flag - * it as an error (reported incorrectly as an encryption error - * to the user). Since the RFC requires it, and it can be - * useful information, we supply it if the peer is a conforming - * system. Luckily (?), win98 sets the Flags field to 0x04 - * (contrary to RFC requirements) so we can use that to - * distinguish between conforming and non-conforming systems. - * - * Special thanks to Alex Swiridov for - * help debugging this. - */ - if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], - MS_CHAP2_NTRESP_LEN) == 0) { - if (response[MS_CHAP2_FLAGS]) - ppp_slprintf(message, message_space, "S=%s", saresponse); - else - ppp_slprintf(message, message_space, "S=%s M=%s", - saresponse, "Access granted"); - return 1; - } + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP2_RESPONSE_LEN]; + char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + + challenge_len = *challenge++; /* skip length, is 16 */ + response_len = *response++; + if (response_len != MS_CHAP2_RESPONSE_LEN) + goto bad; /* not even the right length */ + + /* Generate the expected response and our mutual auth. */ + ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, + (const char *)secret, secret_len, md, + (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); + + /* compare MDs and send the appropriate status */ + /* + * Per RFC 2759, success message must be formatted as + * "S= M=" + * where + * is the Authenticator Response (mutual auth) + * is a text message + * + * However, some versions of Windows (win98 tested) do not know + * about the M= part (required per RFC 2759) and flag + * it as an error (reported incorrectly as an encryption error + * to the user). Since the RFC requires it, and it can be + * useful information, we supply it if the peer is a conforming + * system. Luckily (?), win98 sets the Flags field to 0x04 + * (contrary to RFC requirements) so we can use that to + * distinguish between conforming and non-conforming systems. + * + * Special thanks to Alex Swiridov for + * help debugging this. + */ + if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], + MS_CHAP2_NTRESP_LEN) == 0) { + if (response[MS_CHAP2_FLAGS]) + ppp_slprintf(message, message_space, "S=%s", saresponse); + else + ppp_slprintf(message, message_space, "S=%s M=%s", + saresponse, "Access granted"); + return 1; + } bad: - /* - * Failure message must be formatted as - * "E=e R=r C=c V=v M=m" - * where - * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) - * r = retry (we use 1, ok to retry) - * c = challenge to use for next response, we reuse previous - * v = Change Password version supported, we use 0 - * m = text message - * - * The M=m part is only for MS-CHAPv2. Neither win2k nor - * win98 (others untested) display the message to the user anyway. - * They also both ignore the E=e code. - * - * Note that it's safe to reuse the same challenge as we don't - * actually accept another response based on the error message - * (and no clients try to resend a response anyway). - * - * Basically, this whole bit is useless code, even the small - * implementation here is only because of overspecification. - */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", - challenge_len, challenge, "Access denied"); - return 0; + /* + * Failure message must be formatted as + * "E=e R=r C=c V=v M=m" + * where + * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) + * r = retry (we use 1, ok to retry) + * c = challenge to use for next response, we reuse previous + * v = Change Password version supported, we use 0 + * m = text message + * + * The M=m part is only for MS-CHAPv2. Neither win2k nor + * win98 (others untested) display the message to the user anyway. + * They also both ignore the E=e code. + * + * Note that it's safe to reuse the same challenge as we don't + * actually accept another response based on the error message + * (and no clients try to resend a response anyway). + * + * Basically, this whole bit is useless code, even the small + * implementation here is only because of overspecification. + */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", + challenge_len, challenge, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chapms_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - challenge++; /* skip length, should be 8 */ - *response++ = MS_CHAP_RESPONSE_LEN; - ChapMS(pcb, challenge, secret, secret_len, response); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + challenge++; /* skip length, should be 8 */ + *response++ = MS_CHAP_RESPONSE_LEN; + ChapMS(pcb, challenge, secret, secret_len, response); } static void chapms2_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - challenge++; /* skip length, should be 16 */ - *response++ = MS_CHAP2_RESPONSE_LEN; - ChapMS2(pcb, challenge, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + challenge++; /* skip length, should be 16 */ + *response++ = MS_CHAP2_RESPONSE_LEN; + ChapMS2(pcb, challenge, #ifdef DEBUGMPPEKEY - mschap2_peer_challenge, + mschap2_peer_challenge, #else - NULL, + NULL, #endif - our_name, secret, secret_len, response, private_, - MS_CHAP2_AUTHENTICATEE); + our_name, secret, secret_len, response, private_, + MS_CHAP2_AUTHENTICATEE); } static int chapms2_check_success(ppp_pcb *pcb, unsigned char *msg, int len, unsigned char *private_) { - LWIP_UNUSED_ARG(pcb); - - if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || - strncmp((char *)msg, "S=", 2) != 0) { - /* Packet does not start with "S=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - msg += 2; - len -= 2; - if (len < MS_AUTH_RESPONSE_LENGTH - || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { - /* Authenticator Response did not match expected. */ - ppp_error("MS-CHAPv2 mutual authentication failed."); - return 0; - } - /* Authenticator Response matches. */ - msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ - len -= MS_AUTH_RESPONSE_LENGTH; - if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { - msg += 3; /* Eat the delimiter */ - } else if (len) { - /* Packet has extra text which does not begin " M=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - return 1; + LWIP_UNUSED_ARG(pcb); + + if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || + strncmp((char *)msg, "S=", 2) != 0) { + /* Packet does not start with "S=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + msg += 2; + len -= 2; + if (len < MS_AUTH_RESPONSE_LENGTH + || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { + /* Authenticator Response did not match expected. */ + ppp_error("MS-CHAPv2 mutual authentication failed."); + return 0; + } + /* Authenticator Response matches. */ + msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ + len -= MS_AUTH_RESPONSE_LENGTH; + if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { + msg += 3; /* Eat the delimiter */ + } else if (len) { + /* Packet has extra text which does not begin " M=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + return 1; } static void chapms_handle_failure(ppp_pcb *pcb, unsigned char *inp, int len) { - int err; - const char *p; - char msg[64]; - LWIP_UNUSED_ARG(pcb); - - /* We want a null-terminated string for strxxx(). */ - len = LWIP_MIN(len, 63); - MEMCPY(msg, inp, len); - msg[len] = 0; - p = msg; - - /* - * Deal with MS-CHAP formatted failure messages; just print the - * M= part (if any). For MS-CHAP we're not really supposed - * to use M=, but it shouldn't hurt. See - * chapms[2]_verify_response. - */ - if (!strncmp(p, "E=", 2)) - err = strtol(p+2, NULL, 10); /* Remember the error code. */ - else - goto print_msg; /* Message is badly formatted. */ - - if (len && ((p = strstr(p, " M=")) != NULL)) { - /* M= field found. */ - p += 3; - } else { - /* No M=; use the error code. */ - switch (err) { - case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: - p = "E=646 Restricted logon hours"; - break; - - case MS_CHAP_ERROR_ACCT_DISABLED: - p = "E=647 Account disabled"; - break; - - case MS_CHAP_ERROR_PASSWD_EXPIRED: - p = "E=648 Password expired"; - break; - - case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: - p = "E=649 No dialin permission"; - break; - - case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: - p = "E=691 Authentication failure"; - break; - - case MS_CHAP_ERROR_CHANGING_PASSWORD: - /* Should never see this, we don't support Change Password. */ - p = "E=709 Error changing password"; - break; - - default: - ppp_error("Unknown MS-CHAP authentication failure: %.*v", - len, inp); - return; - } - } + int err; + const char *p; + char msg[64]; + LWIP_UNUSED_ARG(pcb); + + /* We want a null-terminated string for strxxx(). */ + len = LWIP_MIN(len, 63); + MEMCPY(msg, inp, len); + msg[len] = 0; + p = msg; + + /* + * Deal with MS-CHAP formatted failure messages; just print the + * M= part (if any). For MS-CHAP we're not really supposed + * to use M=, but it shouldn't hurt. See + * chapms[2]_verify_response. + */ + if (!strncmp(p, "E=", 2)) + err = strtol(p+2, NULL, 10); /* Remember the error code. */ + else + goto print_msg; /* Message is badly formatted. */ + + if (len && ((p = strstr(p, " M=")) != NULL)) { + /* M= field found. */ + p += 3; + } else { + /* No M=; use the error code. */ + switch (err) { + case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: + p = "E=646 Restricted logon hours"; + break; + + case MS_CHAP_ERROR_ACCT_DISABLED: + p = "E=647 Account disabled"; + break; + + case MS_CHAP_ERROR_PASSWD_EXPIRED: + p = "E=648 Password expired"; + break; + + case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: + p = "E=649 No dialin permission"; + break; + + case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: + p = "E=691 Authentication failure"; + break; + + case MS_CHAP_ERROR_CHANGING_PASSWORD: + /* Should never see this, we don't support Change Password. */ + p = "E=709 Error changing password"; + break; + + default: + ppp_error("Unknown MS-CHAP authentication failure: %.*v", + len, inp); + return; + } + } print_msg: - if (p != NULL) - ppp_error("MS-CHAP authentication failed: %v", p); + if (p != NULL) + ppp_error("MS-CHAP authentication failed: %v", p); } static void ChallengeResponse(const u_char *challenge, - const u_char PasswordHash[MD4_SIGNATURE_SIZE], - u_char response[24]) { + const u_char PasswordHash[MD4_SIGNATURE_SIZE], + u_char response[24]) { u_char ZPasswordHash[21]; lwip_des_context des; u_char des_key[8]; @@ -505,7 +505,7 @@ static void ChallengeResponse(const u_char *challenge, #if 0 dbglog("ChallengeResponse - ZPasswordHash %.*B", - sizeof(ZPasswordHash), ZPasswordHash); + sizeof(ZPasswordHash), ZPasswordHash); #endif pppcrypt_56_to_64_bit_key(ZPasswordHash + 0, des_key); @@ -532,16 +532,16 @@ static void ChallengeResponse(const u_char *challenge, } static void ChallengeHash(const u_char PeerChallenge[16], const u_char *rchallenge, - const char *username, u_char Challenge[8]) { - lwip_sha1_context sha1Context; - u_char sha1Hash[SHA1_SIGNATURE_SIZE]; - const char *user; + const char *username, u_char Challenge[8]) { + lwip_sha1_context sha1Context; + u_char sha1Hash[SHA1_SIGNATURE_SIZE]; + const char *user; /* remove domain from "domain\username" */ if ((user = strrchr(username, '\\')) != NULL) - ++user; + ++user; else - user = username; + user = username; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -566,11 +566,11 @@ static void ascii2unicode(const char ascii[], int ascii_len, u_char unicode[]) { BZERO(unicode, ascii_len * 2); for (i = 0; i < ascii_len; i++) - unicode[i * 2] = (u_char) ascii[i]; + unicode[i * 2] = (u_char) ascii[i]; } static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE]) { - lwip_md4_context md4Context; + lwip_md4_context md4Context; lwip_md4_init(&md4Context); lwip_md4_starts(&md4Context); @@ -580,9 +580,9 @@ static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNA } static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_len, - u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; /* Hash the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -592,10 +592,10 @@ static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_l } static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], const char *username, - const char *secret, int secret_len, u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char Challenge[8]; + const char *secret, int secret_len, u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char Challenge[8]; ChallengeHash(PeerChallenge, rchallenge, username, Challenge); @@ -610,10 +610,10 @@ static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, - unsigned char *response) { - int i; - u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + unsigned char *response) { + int i; + u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ + u_char PasswordHash[MD4_SIGNATURE_SIZE]; lwip_des_context des; u_char des_key[8]; @@ -640,28 +640,28 @@ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { /* * "Magic" constants used in response generation, from RFC 2759. */ static const u_char Magic1[39] = /* "Magic server to client signing constant" */ - { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, - 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, - 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; + { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, + 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, + 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; static const u_char Magic2[41] = /* "Pad to make it do more than one iteration" */ - { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, - 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, - 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, - 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, - 0x6E }; + { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, + 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, + 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, + 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, + 0x6E }; - int i; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; - u_char Challenge[8]; + int i; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; + u_char Challenge[8]; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -683,27 +683,27 @@ static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGN /* Convert to ASCII hex string. */ for (i = 0; i < LWIP_MAX((MS_AUTH_RESPONSE_LENGTH / 2), (int)sizeof(Digest)); i++) - sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); + sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); } static void GenerateAuthenticatorResponsePlain( - const char *secret, int secret_len, - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + const char *secret, int secret_len, + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); NTPasswordHash(PasswordHash, sizeof(PasswordHash), - PasswordHashHash); + PasswordHashHash); GenerateAuthenticatorResponse(PasswordHashHash, NTResponse, PeerChallenge, - rchallenge, username, authResponse); + rchallenge, username, authResponse); } @@ -712,11 +712,11 @@ static void GenerateAuthenticatorResponsePlain( * Set mppe_xxxx_key from MS-CHAP credentials. (see RFC 3079) */ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, int secret_len) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -742,43 +742,43 @@ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *se * Set mppe_xxxx_key from MS-CHAPv2 credentials. (see RFC 3079) */ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_char NTResponse[24], int IsServer) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ const u_char *s; /* "This is the MPPE Master Key" */ static const u_char Magic1[27] = - { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; + { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; /* "On the client side, this is the send key; " "on the server side, it is the receive key." */ static const u_char Magic2[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, - 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, - 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, + 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, + 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* "On the client side, this is the receive key; " "on the server side, it is the send key." */ static const u_char Magic3[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, - 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, + 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -797,9 +797,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate send key */ if (IsServer) - s = Magic3; + s = Magic3; else - s = Magic2; + s = Magic2; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -815,9 +815,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate recv key */ if (IsServer) - s = Magic2; + s = Magic2; else - s = Magic3; + s = Magic3; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -846,7 +846,7 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i #ifdef MSLANMAN ChapMS_LANMan(rchallenge, secret, secret_len, - &response[MS_CHAP_LANMANRESP]); + &response[MS_CHAP_LANMANRESP]); /* preferred method is set by option */ response[MS_CHAP_USENT] = !ms_lanman; @@ -871,8 +871,8 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i * Authenticator Response. */ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerChallenge, - const char *user, const char *secret, int secret_len, unsigned char *response, - u_char authResponse[], int authenticator) { + const char *user, const char *secret, int secret_len, unsigned char *response, + u_char authResponse[], int authenticator) { /* ARGSUSED */ LWIP_UNUSED_ARG(authenticator); #if !MPPE_SUPPORT @@ -883,24 +883,24 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh /* Generate the Peer-Challenge if requested, or copy it if supplied. */ if (!PeerChallenge) - magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); + magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); else - MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, - MS_CHAP2_PEER_CHAL_LEN); + MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, + MS_CHAP2_PEER_CHAL_LEN); /* Generate the NT-Response */ ChapMS2_NT(rchallenge, &response[MS_CHAP2_PEER_CHALLENGE], user, - secret, secret_len, &response[MS_CHAP2_NTRESP]); + secret, secret_len, &response[MS_CHAP2_NTRESP]); /* Generate the Authenticator Response. */ GenerateAuthenticatorResponsePlain(secret, secret_len, - &response[MS_CHAP2_NTRESP], - &response[MS_CHAP2_PEER_CHALLENGE], - rchallenge, user, authResponse); + &response[MS_CHAP2_NTRESP], + &response[MS_CHAP2_PEER_CHALLENGE], + rchallenge, user, authResponse); #if MPPE_SUPPORT SetMasterKeys(pcb, secret, secret_len, - &response[MS_CHAP2_NTRESP], authenticator); + &response[MS_CHAP2_NTRESP], authenticator); #endif /* MPPE_SUPPORT */ } @@ -912,51 +912,51 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh void set_mppe_enc_types(int policy, int types) { /* Early exit for unknown policies. */ if (policy != MPPE_ENC_POL_ENC_ALLOWED || - policy != MPPE_ENC_POL_ENC_REQUIRED) - return; + policy != MPPE_ENC_POL_ENC_REQUIRED) + return; /* Don't modify MPPE if it's optional and wasn't already configured. */ if (policy == MPPE_ENC_POL_ENC_ALLOWED && !ccp_wantoptions[0].mppe) - return; + return; /* * Disable undesirable encryption types. Note that we don't ENABLE * any encryption types, to avoid overriding manual configuration. */ switch(types) { - case MPPE_ENC_TYPES_RC4_40: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ - break; - case MPPE_ENC_TYPES_RC4_128: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ - break; - default: - break; + case MPPE_ENC_TYPES_RC4_40: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ + break; + case MPPE_ENC_TYPES_RC4_128: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ + break; + default: + break; } } #endif /* MPPE_SUPPORT */ #endif /* UNUSED */ const struct chap_digest_type chapms_digest = { - CHAP_MICROSOFT, /* code */ + CHAP_MICROSOFT, /* code */ #if PPP_SERVER - chapms_generate_challenge, - chapms_verify_response, + chapms_generate_challenge, + chapms_verify_response, #endif /* PPP_SERVER */ - chapms_make_response, - NULL, /* check_success */ - chapms_handle_failure, + chapms_make_response, + NULL, /* check_success */ + chapms_handle_failure, }; const struct chap_digest_type chapms2_digest = { - CHAP_MICROSOFT_V2, /* code */ + CHAP_MICROSOFT_V2, /* code */ #if PPP_SERVER - chapms2_generate_challenge, - chapms2_verify_response, + chapms2_generate_challenge, + chapms2_verify_response, #endif /* PPP_SERVER */ - chapms2_make_response, - chapms2_check_success, - chapms_handle_failure, + chapms2_make_response, + chapms2_check_success, + chapms_handle_failure, }; #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/demand.c b/components/net/lwip-2.1.2/src/netif/ppp/demand.c index 26c6c30db1..f3774e087c 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/demand.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/demand.c @@ -87,11 +87,11 @@ demand_conf() /* framemax = lcp_allowoptions[0].mru; if (framemax < PPP_MRU) */ - framemax = PPP_MRU; + framemax = PPP_MRU; framemax += PPP_HDRLEN + PPP_FCSLEN; frame = malloc(framemax); if (frame == NULL) - novm("demand frame"); + novm("demand frame"); framelen = 0; pend_q = NULL; escape_flag = 0; @@ -100,8 +100,8 @@ demand_conf() netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) - fatal("Couldn't set up demand-dialled PPP interface: %m"); + || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) + fatal("Couldn't set up demand-dialled PPP interface: %m"); #ifdef PPP_FILTER set_filters(&pass_filter, &active_filter); @@ -111,12 +111,12 @@ demand_conf() * Call the demand_conf procedure for each protocol that's got one. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - ((*protp->demand_conf)(pcb)); + if (protp->demand_conf != NULL) + ((*protp->demand_conf)(pcb)); /* FIXME: find a way to die() here */ #if 0 - if (!((*protp->demand_conf)(pcb))) - die(1); + if (!((*protp->demand_conf)(pcb))) + die(1); #endif } @@ -131,8 +131,8 @@ demand_block() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); get_loop_output(); } @@ -148,14 +148,14 @@ demand_discard() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); get_loop_output(); /* discard all saved packets */ for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - free(pkt); + nextpkt = pkt->next; + free(pkt); } pend_q = NULL; framelen = 0; @@ -174,46 +174,46 @@ demand_unblock() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); } /* * FCS lookup table as calculated by genfcstab. */ static u_short fcstab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /* @@ -238,35 +238,35 @@ loop_chars(p, n) } for (; n > 0; --n) { - c = *p++; - if (c == PPP_FLAG) { - if (!escape_flag && !flush_flag - && framelen > 2 && fcs == PPP_GOODFCS) { - framelen -= 2; - if (loop_frame((unsigned char *)frame, framelen)) - rv = 1; - } - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; - continue; - } - if (flush_flag) - continue; - if (escape_flag) { - c ^= PPP_TRANS; - escape_flag = 0; - } else if (c == PPP_ESCAPE) { - escape_flag = 1; - continue; - } - if (framelen >= framemax) { - flush_flag = 1; - continue; - } - frame[framelen++] = c; - fcs = PPP_FCS(fcs, c); + c = *p++; + if (c == PPP_FLAG) { + if (!escape_flag && !flush_flag + && framelen > 2 && fcs == PPP_GOODFCS) { + framelen -= 2; + if (loop_frame((unsigned char *)frame, framelen)) + rv = 1; + } + framelen = 0; + flush_flag = 0; + escape_flag = 0; + fcs = PPP_INITFCS; + continue; + } + if (flush_flag) + continue; + if (escape_flag) { + c ^= PPP_TRANS; + escape_flag = 0; + } else if (c == PPP_ESCAPE) { + escape_flag = 1; + continue; + } + if (framelen >= framemax) { + flush_flag = 1; + continue; + } + frame[framelen++] = c; + fcs = PPP_FCS(fcs, c); } return rv; } @@ -290,22 +290,22 @@ loop_frame(frame, len) /* dbglog("from loop: %P", frame, len); */ if (len < PPP_HDRLEN) - return 0; + return 0; if ((PPP_PROTOCOL(frame) & 0x8000) != 0) - return 0; /* shouldn't get any of these anyway */ + return 0; /* shouldn't get any of these anyway */ if (!active_packet(frame, len)) - return 0; + return 0; pkt = (struct packet *) malloc(sizeof(struct packet) + len); if (pkt != NULL) { - pkt->length = len; - pkt->next = NULL; - memcpy(pkt->data, frame, len); - if (pend_q == NULL) - pend_q = pkt; - else - pend_qtail->next = pkt; - pend_qtail = pkt; + pkt->length = len; + pkt->next = NULL; + memcpy(pkt->data, frame, len); + if (pend_q == NULL) + pend_q = pkt; + else + pend_qtail->next = pkt; + pend_qtail = pkt; } return 1; } @@ -332,23 +332,23 @@ demand_rexmit(proto, newip) pend_q = NULL; tv.tv_sec = 1; tv.tv_usec = 0; - select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ + select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ for (; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - if (PPP_PROTOCOL(pkt->data) == proto) { + nextpkt = pkt->next; + if (PPP_PROTOCOL(pkt->data) == proto) { if ( (proto == PPP_IP) && newip ) { - /* Get old checksum */ + /* Get old checksum */ - iphdr = (pkt->data[4] & 15) << 2; - checksum = *((unsigned short *) (pkt->data+14)); + iphdr = (pkt->data[4] & 15) << 2; + checksum = *((unsigned short *) (pkt->data+14)); if (checksum == 0xFFFF) { checksum = 0; } - + if (pkt->data[13] == 17) { pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr)); - if (pkt_checksum) { + if (pkt_checksum) { cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; @@ -359,71 +359,71 @@ demand_rexmit(proto, newip) } } - if (pkt->data[13] == 6) { - pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); - cv = 1; + if (pkt->data[13] == 6) { + pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); + cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; } - } + } - /* Delete old Source-IP-Address */ + /* Delete old Source-IP-Address */ checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Change Source-IP-Address */ + /* Change Source-IP-Address */ * ((u32_t *) (pkt->data + 16)) = newip; - /* Add new Source-IP-Address */ + /* Add new Source-IP-Address */ checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Write new checksum */ + /* Write new checksum */ if (!checksum) { checksum = 0xFFFF; } *((unsigned short *) (pkt->data+14)) = checksum; - if (pkt->data[13] == 6) { - *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; - } - if (cv && (pkt->data[13] == 17) ) { - *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; - } - - /* Log Packet */ - strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); - if (pkt->data[13] == 1) { - syslog(LOG_INFO,"Open ICMP %s -> %s\n", - ipstr, - inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); - } else { - syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", - pkt->data[13] == 6 ? "TCP" : "UDP", - ipstr, - ntohs(*( (short *) (pkt->data+iphdr+4))), - inet_ntoa(*( (struct in_addr *) (pkt->data+20))), - ntohs(*( (short *) (pkt->data+iphdr+6)))); + if (pkt->data[13] == 6) { + *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; + } + if (cv && (pkt->data[13] == 17) ) { + *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; + } + + /* Log Packet */ + strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); + if (pkt->data[13] == 1) { + syslog(LOG_INFO,"Open ICMP %s -> %s\n", + ipstr, + inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); + } else { + syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", + pkt->data[13] == 6 ? "TCP" : "UDP", + ipstr, + ntohs(*( (short *) (pkt->data+iphdr+4))), + inet_ntoa(*( (struct in_addr *) (pkt->data+20))), + ntohs(*( (short *) (pkt->data+iphdr+6)))); } } - output(pcb, pkt->data, pkt->length); - free(pkt); - } else { - if (prev == NULL) - pend_q = pkt; - else - prev->next = pkt; - prev = pkt; - } + output(pcb, pkt->data, pkt->length); + free(pkt); + } else { + if (prev == NULL) + pend_q = pkt; + else + prev->next = pkt; + prev = pkt; + } } pend_qtail = prev; if (prev != NULL) - prev->next = NULL; + prev->next = NULL; } /* @@ -439,27 +439,27 @@ active_packet(p, len) const struct protent *protp; if (len < PPP_HDRLEN) - return 0; + return 0; proto = PPP_PROTOCOL(p); #ifdef PPP_FILTER - p[0] = 1; /* outbound packet indicator */ + p[0] = 1; /* outbound packet indicator */ if ((pass_filter.bf_len != 0 - && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) - || (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { - p[0] = 0xff; - return 0; + && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) + || (active_filter.bf_len != 0 + && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { + p[0] = 0xff; + return 0; } p[0] = 0xff; #endif for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (protp->active_pkt == NULL) - return 1; - return (*protp->active_pkt)(p, len); - } + if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { + if (protp->active_pkt == NULL) + return 1; + return (*protp->active_pkt)(p, len); + } } - return 0; /* not a supported protocol !!?? */ + return 0; /* not a supported protocol !!?? */ } #endif /* PPP_SUPPORT && DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/eap.c b/components/net/lwip-2.1.2/src/netif/ppp/eap.c index 8fb56368e7..8ca53d2a0d 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/eap.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/eap.c @@ -58,11 +58,11 @@ #endif /* USE_SRP */ #ifndef SHA_DIGESTSIZE -#define SHA_DIGESTSIZE 20 +#define SHA_DIGESTSIZE 20 #endif #ifdef USE_SRP -static char *pn_secret = NULL; /* Pseudonym generating secret */ +static char *pn_secret = NULL; /* Pseudonym generating secret */ #endif #if PPP_OPTIONS @@ -106,31 +106,31 @@ static int eap_printpkt(const u_char *inp, int inlen, #endif /* PRINTPKT_SUPPORT */ const struct protent eap_protent = { - PPP_EAP, /* protocol number */ - eap_init, /* initialization procedure */ - eap_input, /* process a received packet */ - eap_protrej, /* process a received protocol-reject */ - eap_lowerup, /* lower layer has gone up */ - eap_lowerdown, /* lower layer has gone down */ - NULL, /* open the protocol */ - NULL, /* close the protocol */ + PPP_EAP, /* protocol number */ + eap_init, /* initialization procedure */ + eap_input, /* process a received packet */ + eap_protrej, /* process a received protocol-reject */ + eap_lowerup, /* lower layer has gone up */ + eap_lowerdown, /* lower layer has gone down */ + NULL, /* open the protocol */ + NULL, /* close the protocol */ #if PRINTPKT_SUPPORT - eap_printpkt, /* print a packet in readable form */ + eap_printpkt, /* print a packet in readable form */ #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* process a received data packet */ + NULL, /* process a received data packet */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "EAP", /* text name of protocol */ - NULL, /* text name of corresponding data protocol */ + "EAP", /* text name of protocol */ + NULL, /* text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - eap_option_list, /* list of command-line options */ - NULL, /* check requested options; assign defaults */ + eap_option_list, /* list of command-line options */ + NULL, /* check requested options; assign defaults */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, /* configure interface for demand-dial */ - NULL /* say whether to bring up link for this pkt */ + NULL, /* configure interface for demand-dial */ + NULL /* say whether to bring up link for this pkt */ #endif /* DEMAND_SUPPORT */ }; @@ -139,38 +139,38 @@ const struct protent eap_protent = { * A well-known 2048 bit modulus. */ static const u_char wkmodulus[] = { - 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, - 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, - 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, - 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, - 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, - 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, - 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, - 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, - 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, - 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, - 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, - 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, - 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, - 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, - 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, - 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, - 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, - 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, - 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, - 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, - 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, - 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, - 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, - 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, - 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, - 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, - 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, - 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, - 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, - 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, - 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, - 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 + 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, + 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, + 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, + 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, + 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, + 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, + 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, + 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, + 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, + 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, + 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, + 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, + 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, + 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, + 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, + 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, + 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, + 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, + 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, + 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, + 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, + 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, + 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, + 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, + 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, + 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, + 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, + 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, + 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, + 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, + 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, + 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 }; #endif @@ -184,9 +184,9 @@ static void eap_server_timeout(void *arg); */ static const char * eap_state_name(enum eap_state_code esc) { - static const char *state_names[] = { EAP_STATES }; + static const char *state_names[] = { EAP_STATES }; - return (state_names[(int)esc]); + return (state_names[(int)esc]); } /* @@ -195,9 +195,9 @@ static const char * eap_state_name(enum eap_state_code esc) */ static void eap_init(ppp_pcb *pcb) { - BZERO(&pcb->eap, sizeof(eap_state)); + BZERO(&pcb->eap, sizeof(eap_state)); #if PPP_SERVER - pcb->eap.es_server.ea_id = magic(); + pcb->eap.es_server.ea_id = magic(); #endif /* PPP_SERVER */ } @@ -206,14 +206,14 @@ static void eap_init(ppp_pcb *pcb) { * Request messages. */ static void eap_client_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_client_active(pcb)) - return; + if (!eap_client_active(pcb)) + return; - ppp_error("EAP: timeout waiting for Request from peer"); - auth_withpeer_fail(pcb, PPP_EAP); - pcb->eap.es_client.ea_state = eapBadAuth; + ppp_error("EAP: timeout waiting for Request from peer"); + auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; } /* @@ -224,22 +224,22 @@ static void eap_client_timeout(void *arg) { */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { - if(NULL == localname) - return; + if(NULL == localname) + return; - /* Save the peer name we're given */ - pcb->eap.es_client.ea_name = localname; - pcb->eap.es_client.ea_namelen = strlen(localname); + /* Save the peer name we're given */ + pcb->eap.es_client.ea_name = localname; + pcb->eap.es_client.ea_namelen = strlen(localname); - pcb->eap.es_client.ea_state = eapListen; + pcb->eap.es_client.ea_state = eapListen; - /* - * Start a timer so that if the other end just goes - * silent, we don't sit here waiting forever. - */ - if (pcb->settings.eap_req_time > 0) - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); + /* + * Start a timer so that if the other end just goes + * silent, we don't sit here waiting forever. + */ + if (pcb->settings.eap_req_time > 0) + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); } #if PPP_SERVER @@ -248,30 +248,30 @@ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { * (Server operation) */ static void eap_send_failure(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; + struct pbuf *p; + u_char *outp; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } - outp = (u_char*)p->payload; + outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_EAP); + MAKEHEADER(outp, PPP_EAP); - PUTCHAR(EAP_FAILURE, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); + PUTCHAR(EAP_FAILURE, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); - ppp_write(pcb, p); + ppp_write(pcb, p); - pcb->eap.es_server.ea_state = eapBadAuth; - auth_peer_fail(pcb, PPP_EAP); + pcb->eap.es_server.ea_state = eapBadAuth; + auth_peer_fail(pcb, PPP_EAP); } /* @@ -279,30 +279,30 @@ static void eap_send_failure(ppp_pcb *pcb) { * (Server operation) */ static void eap_send_success(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_SUCCESS, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); - - ppp_write(pcb, p); - - auth_peer_success(pcb, PPP_EAP, 0, - pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); + struct pbuf *p; + u_char *outp; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_SUCCESS, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); + + ppp_write(pcb, p); + + auth_peer_success(pcb, PPP_EAP, 0, + pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); } #endif /* PPP_SERVER */ @@ -314,31 +314,31 @@ static void eap_send_success(ppp_pcb *pcb) { static bool pncrypt_setkey(int timeoffs) { - struct tm *tp; - char tbuf[9]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - time_t reftime; - - if (pn_secret == NULL) - return (0); - reftime = time(NULL) + timeoffs; - tp = localtime(&reftime); - SHA1Init(&ctxt); - SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); - strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); - SHA1Update(&ctxt, tbuf, strlen(tbuf)); - SHA1Final(dig, &ctxt); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - return (DesSetkey(dig)); + struct tm *tp; + char tbuf[9]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + time_t reftime; + + if (pn_secret == NULL) + return (0); + reftime = time(NULL) + timeoffs; + tp = localtime(&reftime); + SHA1Init(&ctxt); + SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); + strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); + SHA1Update(&ctxt, tbuf, strlen(tbuf)); + SHA1Final(dig, &ctxt); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + return (DesSetkey(dig)); } static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; struct b64state { - u32_t bs_bits; - int bs_offs; + u32_t bs_bits; + int bs_offs; }; static int @@ -348,23 +348,23 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - - while (inlen > 0) { - bs->bs_bits = (bs->bs_bits << 8) | *inp++; - inlen--; - bs->bs_offs += 8; - if (bs->bs_offs >= 24) { - *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; - *outp++ = base64[bs->bs_bits & 0x3F]; - outlen += 4; - bs->bs_offs = 0; - bs->bs_bits = 0; - } - } - return (outlen); + int outlen = 0; + + while (inlen > 0) { + bs->bs_bits = (bs->bs_bits << 8) | *inp++; + inlen--; + bs->bs_offs += 8; + if (bs->bs_offs >= 24) { + *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; + *outp++ = base64[bs->bs_bits & 0x3F]; + outlen += 4; + bs->bs_offs = 0; + bs->bs_bits = 0; + } + } + return (outlen); } static int @@ -372,21 +372,21 @@ b64flush(bs, outp) struct b64state *bs; u_char *outp; { - int outlen = 0; - - if (bs->bs_offs == 8) { - *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; - outlen = 2; - } else if (bs->bs_offs == 16) { - *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; - outlen = 3; - } - bs->bs_offs = 0; - bs->bs_bits = 0; - return (outlen); + int outlen = 0; + + if (bs->bs_offs == 8) { + *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; + outlen = 2; + } else if (bs->bs_offs == 16) { + *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; + outlen = 3; + } + bs->bs_offs = 0; + bs->bs_bits = 0; + return (outlen); } static int @@ -396,22 +396,22 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - char *cp; - - while (inlen > 0) { - if ((cp = strchr(base64, *inp++)) == NULL) - break; - bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); - inlen--; - bs->bs_offs += 6; - if (bs->bs_offs >= 8) { - *outp++ = bs->bs_bits >> (bs->bs_offs - 8); - outlen++; - bs->bs_offs -= 8; - } - } - return (outlen); + int outlen = 0; + char *cp; + + while (inlen > 0) { + if ((cp = strchr(base64, *inp++)) == NULL) + break; + bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); + inlen--; + bs->bs_offs += 6; + if (bs->bs_offs >= 8) { + *outp++ = bs->bs_bits >> (bs->bs_offs - 8); + outlen++; + bs->bs_offs -= 8; + } + } + return (outlen); } #endif /* USE_SRP */ @@ -424,211 +424,211 @@ u_char *outp; */ static void eap_figure_next_state(ppp_pcb *pcb, int status) { #ifdef USE_SRP - unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; - struct t_pw tpw; - struct t_confent *tce, mytce; - char *cp, *cp2; - struct t_server *ts; - int id, i, plen, toffs; - u_char vals[2]; - struct b64state bs; + unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; + struct t_pw tpw; + struct t_confent *tce, mytce; + char *cp, *cp2; + struct t_server *ts; + int id, i, plen, toffs; + u_char vals[2]; + struct b64state bs; #endif /* USE_SRP */ - pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; - switch (pcb->eap.es_server.ea_state) { - case eapBadAuth: - return; + pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; + switch (pcb->eap.es_server.ea_state) { + case eapBadAuth: + return; - case eapIdentify: + case eapIdentify: #ifdef USE_SRP - /* Discard any previous session. */ - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + /* Discard any previous session. */ + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } #ifdef USE_SRP - /* If we've got a pseudonym, try to decode to real name. */ - if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && - strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, - SRP_PSEUDO_LEN) == 0 && - (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < - sizeof (secbuf)) { - BZERO(&bs, sizeof (bs)); - plen = b64dec(&bs, - pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, - pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, - secbuf); - toffs = 0; - for (i = 0; i < 5; i++) { - pncrypt_setkey(toffs); - toffs -= 86400; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesDecrypt(secbuf, clear)) { - ppp_dbglog("no DES here; cannot decode " - "pseudonym"); - return; - } - id = *(unsigned char *)clear; - if (id + 1 <= plen && id + 9 > plen) - break; - } - if (plen % 8 == 0 && i < 5) { - /* - * Note that this is always shorter than the - * original stored string, so there's no need - * to realloc. - */ - if ((i = plen = *(unsigned char *)clear) > 7) - i = 7; - pcb->eap.es_server.ea_peerlen = plen; - dp = (unsigned char *)pcb->eap.es_server.ea_peer; - MEMCPY(dp, clear + 1, i); - plen -= i; - dp += i; - sp = secbuf + 8; - while (plen > 0) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesDecrypt(sp, dp); - sp += 8; - dp += 8; - plen -= 8; - } - pcb->eap.es_server.ea_peer[ - pcb->eap.es_server.ea_peerlen] = '\0'; - ppp_dbglog("decoded pseudonym to \"%.*q\"", - pcb->eap.es_server.ea_peerlen, - pcb->eap.es_server.ea_peer); - } else { - ppp_dbglog("failed to decode real name"); - /* Stay in eapIdentfy state; requery */ - break; - } - } - /* Look up user in secrets database. */ - if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { - /* Set up default in case SRP entry is bad */ - pcb->eap.es_server.ea_state = eapMD5Chall; - /* Get t_confent based on index in srp-secrets */ - id = strtol((char *)secbuf, &cp, 10); - if (*cp++ != ':' || id < 0) - break; - if (id == 0) { - mytce.index = 0; - mytce.modulus.data = (u_char *)wkmodulus; - mytce.modulus.len = sizeof (wkmodulus); - mytce.generator.data = (u_char *)"\002"; - mytce.generator.len = 1; - tce = &mytce; - } else if ((tce = gettcid(id)) != NULL) { - /* - * Client will have to verify this modulus/ - * generator combination, and that will take - * a while. Lengthen the timeout here. - */ - if (pcb->settings.eap_timeout_time > 0 && - pcb->settings.eap_timeout_time < 30) - pcb->settings.eap_timeout_time = 30; - } else { - break; - } - if ((cp2 = strchr(cp, ':')) == NULL) - break; - *cp2++ = '\0'; - tpw.pebuf.name = pcb->eap.es_server.ea_peer; - tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, - cp); - tpw.pebuf.password.data = tpw.pwbuf; - tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, - cp2); - tpw.pebuf.salt.data = tpw.saltbuf; - if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) - break; - pcb->eap.es_server.ea_session = (void *)ts; - pcb->eap.es_server.ea_state = eapSRP1; - vals[0] = pcb->eap.es_server.ea_id + 1; - vals[1] = EAPT_SRP; - t_serveraddexdata(ts, vals, 2); - /* Generate B; must call before t_servergetkey() */ - t_servergenexp(ts); - break; - } + /* If we've got a pseudonym, try to decode to real name. */ + if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && + strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, + SRP_PSEUDO_LEN) == 0 && + (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < + sizeof (secbuf)) { + BZERO(&bs, sizeof (bs)); + plen = b64dec(&bs, + pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, + pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, + secbuf); + toffs = 0; + for (i = 0; i < 5; i++) { + pncrypt_setkey(toffs); + toffs -= 86400; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesDecrypt(secbuf, clear)) { + ppp_dbglog("no DES here; cannot decode " + "pseudonym"); + return; + } + id = *(unsigned char *)clear; + if (id + 1 <= plen && id + 9 > plen) + break; + } + if (plen % 8 == 0 && i < 5) { + /* + * Note that this is always shorter than the + * original stored string, so there's no need + * to realloc. + */ + if ((i = plen = *(unsigned char *)clear) > 7) + i = 7; + pcb->eap.es_server.ea_peerlen = plen; + dp = (unsigned char *)pcb->eap.es_server.ea_peer; + MEMCPY(dp, clear + 1, i); + plen -= i; + dp += i; + sp = secbuf + 8; + while (plen > 0) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesDecrypt(sp, dp); + sp += 8; + dp += 8; + plen -= 8; + } + pcb->eap.es_server.ea_peer[ + pcb->eap.es_server.ea_peerlen] = '\0'; + ppp_dbglog("decoded pseudonym to \"%.*q\"", + pcb->eap.es_server.ea_peerlen, + pcb->eap.es_server.ea_peer); + } else { + ppp_dbglog("failed to decode real name"); + /* Stay in eapIdentfy state; requery */ + break; + } + } + /* Look up user in secrets database. */ + if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { + /* Set up default in case SRP entry is bad */ + pcb->eap.es_server.ea_state = eapMD5Chall; + /* Get t_confent based on index in srp-secrets */ + id = strtol((char *)secbuf, &cp, 10); + if (*cp++ != ':' || id < 0) + break; + if (id == 0) { + mytce.index = 0; + mytce.modulus.data = (u_char *)wkmodulus; + mytce.modulus.len = sizeof (wkmodulus); + mytce.generator.data = (u_char *)"\002"; + mytce.generator.len = 1; + tce = &mytce; + } else if ((tce = gettcid(id)) != NULL) { + /* + * Client will have to verify this modulus/ + * generator combination, and that will take + * a while. Lengthen the timeout here. + */ + if (pcb->settings.eap_timeout_time > 0 && + pcb->settings.eap_timeout_time < 30) + pcb->settings.eap_timeout_time = 30; + } else { + break; + } + if ((cp2 = strchr(cp, ':')) == NULL) + break; + *cp2++ = '\0'; + tpw.pebuf.name = pcb->eap.es_server.ea_peer; + tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, + cp); + tpw.pebuf.password.data = tpw.pwbuf; + tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, + cp2); + tpw.pebuf.salt.data = tpw.saltbuf; + if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) + break; + pcb->eap.es_server.ea_session = (void *)ts; + pcb->eap.es_server.ea_state = eapSRP1; + vals[0] = pcb->eap.es_server.ea_id + 1; + vals[1] = EAPT_SRP; + t_serveraddexdata(ts, vals, 2); + /* Generate B; must call before t_servergetkey() */ + t_servergenexp(ts); + break; + } #endif /* USE_SRP */ - pcb->eap.es_server.ea_state = eapMD5Chall; - break; + pcb->eap.es_server.ea_state = eapMD5Chall; + break; - case eapSRP1: + case eapSRP1: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status == 1) { - pcb->eap.es_server.ea_state = eapMD5Chall; - } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP2; - } - break; - - case eapSRP2: + if (status == 1) { + pcb->eap.es_server.ea_state = eapMD5Chall; + } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP2; + } + break; + + case eapSRP2: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP3; - } - break; - - case eapSRP3: - case eapSRP4: + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP3; + } + break; + + case eapSRP3: + case eapSRP4: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - case eapMD5Chall: - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - default: - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } - if (pcb->eap.es_server.ea_state == eapBadAuth) - eap_send_failure(pcb); + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + case eapMD5Chall: + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + default: + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } + if (pcb->eap.es_server.ea_state == eapBadAuth) + eap_send_failure(pcb); } /* @@ -636,235 +636,235 @@ static void eap_figure_next_state(ppp_pcb *pcb, int status) { * type depends on current state. (Server operation) */ static void eap_send_request(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - u_char *lenloc; - int outlen; - int len; - const char *str; + struct pbuf *p; + u_char *outp; + u_char *lenloc; + int outlen; + int len; + const char *str; #ifdef USE_SRP - struct t_server *ts; - u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; - int i, j; - struct b64state b64; - SHA1_CTX ctxt; + struct t_server *ts; + u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; + int i, j; + struct b64state b64; + SHA1_CTX ctxt; #endif /* USE_SRP */ - /* Handle both initial auth and restart */ - if (pcb->eap.es_server.ea_state < eapIdentify && - pcb->eap.es_server.ea_state != eapInitial) { - pcb->eap.es_server.ea_state = eapIdentify; + /* Handle both initial auth and restart */ + if (pcb->eap.es_server.ea_state < eapIdentify && + pcb->eap.es_server.ea_state != eapInitial) { + pcb->eap.es_server.ea_state = eapIdentify; #if PPP_REMOTENAME - if (pcb->settings.explicit_remote && pcb->remote_name) { - /* - * If we already know the peer's - * unauthenticated name, then there's no - * reason to ask. Go to next state instead. - */ - int len = (int)strlen(pcb->remote_name); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - } + if (pcb->settings.explicit_remote && pcb->remote_name) { + /* + * If we already know the peer's + * unauthenticated name, then there's no + * reason to ask. Go to next state instead. + */ + int len = (int)strlen(pcb->remote_name); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + } #endif /* PPP_REMOTENAME */ - } - - if (pcb->settings.eap_max_transmits > 0 && - pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { - if (pcb->eap.es_server.ea_responses > 0) - ppp_error("EAP: too many Requests sent"); - else - ppp_error("EAP: no response to Requests"); - eap_send_failure(pcb); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_REQUEST, outp); - PUTCHAR(pcb->eap.es_server.ea_id, outp); - lenloc = outp; - INCPTR(2, outp); - - switch (pcb->eap.es_server.ea_state) { - case eapIdentify: - PUTCHAR(EAPT_IDENTITY, outp); - str = "Name"; - len = strlen(str); - MEMCPY(outp, str, len); - INCPTR(len, outp); - break; - - case eapMD5Chall: - PUTCHAR(EAPT_MD5CHAP, outp); - /* - * pick a random challenge length between - * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH - */ - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - PUTCHAR(pcb->eap.es_challen, outp); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - break; + } + + if (pcb->settings.eap_max_transmits > 0 && + pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { + if (pcb->eap.es_server.ea_responses > 0) + ppp_error("EAP: too many Requests sent"); + else + ppp_error("EAP: no response to Requests"); + eap_send_failure(pcb); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_REQUEST, outp); + PUTCHAR(pcb->eap.es_server.ea_id, outp); + lenloc = outp; + INCPTR(2, outp); + + switch (pcb->eap.es_server.ea_state) { + case eapIdentify: + PUTCHAR(EAPT_IDENTITY, outp); + str = "Name"; + len = strlen(str); + MEMCPY(outp, str, len); + INCPTR(len, outp); + break; + + case eapMD5Chall: + PUTCHAR(EAPT_MD5CHAP, outp); + /* + * pick a random challenge length between + * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH + */ + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + PUTCHAR(pcb->eap.es_challen, outp); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + break; #ifdef USE_SRP - case eapSRP1: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CHALLENGE, outp); - - PUTCHAR(pcb->eap.es_server.ea_namelen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - PUTCHAR(ts->s.len, outp); - MEMCPY(outp, ts->s.data, ts->s.len); - INCPTR(ts->s.len, outp); - - if (ts->g.len == 1 && ts->g.data[0] == 2) { - PUTCHAR(0, outp); - } else { - PUTCHAR(ts->g.len, outp); - MEMCPY(outp, ts->g.data, ts->g.len); - INCPTR(ts->g.len, outp); - } - - if (ts->n.len != sizeof (wkmodulus) || - BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { - MEMCPY(outp, ts->n.data, ts->n.len); - INCPTR(ts->n.len, outp); - } - break; - - case eapSRP2: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SKEY, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, ts->B.data, ts->B.len); - INCPTR(ts->B.len, outp); - break; - - case eapSRP3: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SVALIDATOR, outp); - PUTLONG(SRPVAL_EBIT, outp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); - INCPTR(SHA_DIGESTSIZE, outp); - - if (pncrypt_setkey(0)) { - /* Generate pseudonym */ - optr = outp; - cp = (unsigned char *)pcb->eap.es_server.ea_peer; - if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) - j = 7; - clear[0] = i; - MEMCPY(clear + 1, cp, j); - i -= j; - cp += j; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesEncrypt(clear, cipher)) { - ppp_dbglog("no DES here; not generating pseudonym"); - break; - } - BZERO(&b64, sizeof (b64)); - outp++; /* space for pseudonym length */ - outp += b64enc(&b64, cipher, 8, outp); - while (i >= 8) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(cp, cipher); - outp += b64enc(&b64, cipher, 8, outp); - cp += 8; - i -= 8; - } - if (i > 0) { - MEMCPY(clear, cp, i); - cp += i; - magic_random_bytes(cp, 8-i); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(clear, cipher); - outp += b64enc(&b64, cipher, 8, outp); - } - outp += b64flush(&b64, outp); - - /* Set length and pad out to next 20 octet boundary */ - i = outp - optr - 1; - *optr = i; - i %= SHA_DIGESTSIZE; - if (i != 0) { - magic_random_bytes(outp, SHA_DIGESTSIZE-i); - INCPTR(SHA_DIGESTSIZE-i, outp); - } - - /* Obscure the pseudonym with SHA1 hash */ - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - while (optr < outp) { - SHA1Final(dig, &ctxt); - cp = dig; - while (cp < dig + SHA_DIGESTSIZE) - *optr++ ^= *cp++; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, - SHA_DIGESTSIZE); - } - } - break; - - case eapSRP4: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_LWRECHALLENGE, outp); - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - break; + case eapSRP1: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CHALLENGE, outp); + + PUTCHAR(pcb->eap.es_server.ea_namelen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + PUTCHAR(ts->s.len, outp); + MEMCPY(outp, ts->s.data, ts->s.len); + INCPTR(ts->s.len, outp); + + if (ts->g.len == 1 && ts->g.data[0] == 2) { + PUTCHAR(0, outp); + } else { + PUTCHAR(ts->g.len, outp); + MEMCPY(outp, ts->g.data, ts->g.len); + INCPTR(ts->g.len, outp); + } + + if (ts->n.len != sizeof (wkmodulus) || + BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { + MEMCPY(outp, ts->n.data, ts->n.len); + INCPTR(ts->n.len, outp); + } + break; + + case eapSRP2: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SKEY, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, ts->B.data, ts->B.len); + INCPTR(ts->B.len, outp); + break; + + case eapSRP3: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SVALIDATOR, outp); + PUTLONG(SRPVAL_EBIT, outp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); + INCPTR(SHA_DIGESTSIZE, outp); + + if (pncrypt_setkey(0)) { + /* Generate pseudonym */ + optr = outp; + cp = (unsigned char *)pcb->eap.es_server.ea_peer; + if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) + j = 7; + clear[0] = i; + MEMCPY(clear + 1, cp, j); + i -= j; + cp += j; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesEncrypt(clear, cipher)) { + ppp_dbglog("no DES here; not generating pseudonym"); + break; + } + BZERO(&b64, sizeof (b64)); + outp++; /* space for pseudonym length */ + outp += b64enc(&b64, cipher, 8, outp); + while (i >= 8) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(cp, cipher); + outp += b64enc(&b64, cipher, 8, outp); + cp += 8; + i -= 8; + } + if (i > 0) { + MEMCPY(clear, cp, i); + cp += i; + magic_random_bytes(cp, 8-i); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(clear, cipher); + outp += b64enc(&b64, cipher, 8, outp); + } + outp += b64flush(&b64, outp); + + /* Set length and pad out to next 20 octet boundary */ + i = outp - optr - 1; + *optr = i; + i %= SHA_DIGESTSIZE; + if (i != 0) { + magic_random_bytes(outp, SHA_DIGESTSIZE-i); + INCPTR(SHA_DIGESTSIZE-i, outp); + } + + /* Obscure the pseudonym with SHA1 hash */ + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + while (optr < outp) { + SHA1Final(dig, &ctxt); + cp = dig; + while (cp < dig + SHA_DIGESTSIZE) + *optr++ ^= *cp++; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, + SHA_DIGESTSIZE); + } + } + break; + + case eapSRP4: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_LWRECHALLENGE, outp); + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + break; #endif /* USE_SRP */ - default: - return; - } + default: + return; + } - outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; - PUTSHORT(outlen, lenloc); + outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; + PUTSHORT(outlen, lenloc); - pbuf_realloc(p, outlen + PPP_HDRLEN); - ppp_write(pcb, p); + pbuf_realloc(p, outlen + PPP_HDRLEN); + ppp_write(pcb, p); - pcb->eap.es_server.ea_requests++; + pcb->eap.es_server.ea_requests++; - if (pcb->settings.eap_timeout_time > 0) - TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); + if (pcb->settings.eap_timeout_time > 0) + TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); } /* @@ -875,23 +875,23 @@ static void eap_send_request(ppp_pcb *pcb) { */ void eap_authpeer(ppp_pcb *pcb, const char *localname) { - /* Save the name we're given. */ - pcb->eap.es_server.ea_name = localname; - pcb->eap.es_server.ea_namelen = strlen(localname); + /* Save the name we're given. */ + pcb->eap.es_server.ea_name = localname; + pcb->eap.es_server.ea_namelen = strlen(localname); - pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; + pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; - /* Lower layer up yet? */ - if (pcb->eap.es_server.ea_state == eapInitial || - pcb->eap.es_server.ea_state == eapPending) { - pcb->eap.es_server.ea_state = eapPending; - return; - } + /* Lower layer up yet? */ + if (pcb->eap.es_server.ea_state == eapInitial || + pcb->eap.es_server.ea_state == eapPending) { + pcb->eap.es_server.ea_state = eapPending; + return; + } - pcb->eap.es_server.ea_state = eapPending; + pcb->eap.es_server.ea_state = eapPending; - /* ID number not updated here intentionally; hashed into M1 */ - eap_send_request(pcb); + /* ID number not updated here intentionally; hashed into M1 */ + eap_send_request(pcb); } /* @@ -899,13 +899,13 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname) { * expired. */ static void eap_server_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_server_active(pcb)) - return; + if (!eap_server_active(pcb)) + return; - /* EAP ID number must not change on timeout. */ - eap_send_request(pcb); + /* EAP ID number must not change on timeout. */ + eap_send_request(pcb); } /* @@ -914,30 +914,30 @@ static void eap_server_timeout(void *arg) { * will restart the timer. If it fails, then the link is dropped. */ static void eap_rechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen && - pcb->eap.es_server.ea_state != eapSRP4) - return; + if (pcb->eap.es_server.ea_state != eapOpen && + pcb->eap.es_server.ea_state != eapSRP4) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } static void srp_lwrechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen || - pcb->eap.es_server.ea_type != EAPT_SRP) - return; + if (pcb->eap.es_server.ea_state != eapOpen || + pcb->eap.es_server.ea_type != EAPT_SRP) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapSRP4; - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapSRP4; + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } #endif /* PPP_SERVER */ @@ -950,9 +950,9 @@ static void srp_lwrechallenge(void *arg) { * thing. */ static void eap_lowerup(ppp_pcb *pcb) { - pcb->eap.es_client.ea_state = eapClosed; + pcb->eap.es_client.ea_state = eapClosed; #if PPP_SERVER - pcb->eap.es_server.ea_state = eapClosed; + pcb->eap.es_server.ea_state = eapClosed; #endif /* PPP_SERVER */ } @@ -963,28 +963,28 @@ static void eap_lowerup(ppp_pcb *pcb) { */ static void eap_lowerdown(ppp_pcb *pcb) { - if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - } else { - if ((pcb->eap.es_server.ea_state == eapOpen || - pcb->eap.es_server.ea_state == eapSRP4) && - pcb->eap.es_rechallenge > 0) { - UNTIMEOUT(eap_rechallenge, (void *)pcb); - } - if (pcb->eap.es_server.ea_state == eapOpen && - pcb->eap.es_lwrechallenge > 0) { - UNTIMEOUT(srp_lwrechallenge, (void *)pcb); - } - } - - pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; - pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; + if (eap_server_active(pcb)) { + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + } else { + if ((pcb->eap.es_server.ea_state == eapOpen || + pcb->eap.es_server.ea_state == eapSRP4) && + pcb->eap.es_rechallenge > 0) { + UNTIMEOUT(eap_rechallenge, (void *)pcb); + } + if (pcb->eap.es_server.ea_state == eapOpen && + pcb->eap.es_lwrechallenge > 0) { + UNTIMEOUT(srp_lwrechallenge, (void *)pcb); + } + } + + pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; + pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; #endif /* PPP_SERVER */ } @@ -996,87 +996,87 @@ static void eap_lowerdown(ppp_pcb *pcb) { */ static void eap_protrej(ppp_pcb *pcb) { - if (eap_client_active(pcb)) { - ppp_error("EAP authentication failed due to Protocol-Reject"); - auth_withpeer_fail(pcb, PPP_EAP); - } + if (eap_client_active(pcb)) { + ppp_error("EAP authentication failed due to Protocol-Reject"); + auth_withpeer_fail(pcb, PPP_EAP); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - ppp_error("EAP authentication of peer failed on Protocol-Reject"); - auth_peer_fail(pcb, PPP_EAP); - } + if (eap_server_active(pcb)) { + ppp_error("EAP authentication of peer failed on Protocol-Reject"); + auth_peer_fail(pcb, PPP_EAP); + } #endif /* PPP_SERVER */ - eap_lowerdown(pcb); + eap_lowerdown(pcb); } /* * Format and send a regular EAP Response message. */ static void eap_send_response(ppp_pcb *pcb, u_char id, u_char typenum, const u_char *str, int lenstr) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(typenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(typenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* * Format and send an MD5-Challenge EAP Response message. */ static void eap_chap_response(ppp_pcb *pcb, u_char id, u_char *hash, const char *name, int namelen) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + - namelen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_MD5CHAP, outp); - PUTCHAR(MD5_SIGNATURE_SIZE, outp); - MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); - INCPTR(MD5_SIGNATURE_SIZE, outp); - if (namelen > 0) { - MEMCPY(outp, name, namelen); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + + namelen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_MD5CHAP, outp); + PUTCHAR(MD5_SIGNATURE_SIZE, outp); + MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); + INCPTR(MD5_SIGNATURE_SIZE, outp); + if (namelen > 0) { + MEMCPY(outp, name, namelen); + } + + ppp_write(pcb, p); } #ifdef USE_SRP @@ -1091,35 +1091,35 @@ u_char subtypenum; u_char *str; int lenstr; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(subtypenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(subtypenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* @@ -1132,118 +1132,118 @@ u_char id; u32_t flags; u_char *str; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + - SHA_DIGESTSIZE; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CVALIDATOR, outp); - PUTLONG(flags, outp); - MEMCPY(outp, str, SHA_DIGESTSIZE); - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + + SHA_DIGESTSIZE; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CVALIDATOR, outp); + PUTLONG(flags, outp); + MEMCPY(outp, str, SHA_DIGESTSIZE); + + ppp_write(pcb, p); } #endif /* USE_SRP */ static void eap_send_nak(ppp_pcb *pcb, u_char id, u_char type) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char); - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_NAK, outp); - PUTCHAR(type, outp); - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char); + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_NAK, outp); + PUTCHAR(type, outp); + + ppp_write(pcb, p); } #ifdef USE_SRP static char * name_of_pn_file() { - char *user, *path, *file; - struct passwd *pw; - size_t pl; - static bool pnlogged = 0; - - pw = getpwuid(getuid()); - if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { - errno = EINVAL; - return (NULL); - } - file = _PATH_PSEUDONYM; - pl = strlen(user) + strlen(file) + 2; - path = malloc(pl); - if (path == NULL) - return (NULL); - (void) slprintf(path, pl, "%s/%s", user, file); - if (!pnlogged) { - ppp_dbglog("pseudonym file: %s", path); - pnlogged = 1; - } - return (path); + char *user, *path, *file; + struct passwd *pw; + size_t pl; + static bool pnlogged = 0; + + pw = getpwuid(getuid()); + if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { + errno = EINVAL; + return (NULL); + } + file = _PATH_PSEUDONYM; + pl = strlen(user) + strlen(file) + 2; + path = malloc(pl); + if (path == NULL) + return (NULL); + (void) slprintf(path, pl, "%s/%s", user, file); + if (!pnlogged) { + ppp_dbglog("pseudonym file: %s", path); + pnlogged = 1; + } + return (path); } static int open_pn_file(modebits) mode_t modebits; { - char *path; - int fd, err; - - if ((path = name_of_pn_file()) == NULL) - return (-1); - fd = open(path, modebits, S_IRUSR | S_IWUSR); - err = errno; - free(path); - errno = err; - return (fd); + char *path; + int fd, err; + + if ((path = name_of_pn_file()) == NULL) + return (-1); + fd = open(path, modebits, S_IRUSR | S_IWUSR); + err = errno; + free(path); + errno = err; + return (fd); } static void remove_pn_file() { - char *path; + char *path; - if ((path = name_of_pn_file()) != NULL) { - (void) unlink(path); - (void) free(path); - } + if ((path = name_of_pn_file()) != NULL) { + (void) unlink(path); + (void) free(path); + } } static void @@ -1252,56 +1252,56 @@ eap_state *esp; u_char *inp; int len, id; { - u_char val; - u_char *datp, *digp; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int dsize, fd, olen = len; - - /* - * Do the decoding by working backwards. This eliminates the need - * to save the decoded output in a separate buffer. - */ - val = id; - while (len > 0) { - if ((dsize = len % SHA_DIGESTSIZE) == 0) - dsize = SHA_DIGESTSIZE; - len -= dsize; - datp = inp + len; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &val, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); - if (len > 0) { - SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); - } else { - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - } - SHA1Final(dig, &ctxt); - for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) - *datp++ ^= *digp; - } - - /* Now check that the result is sane */ - if (olen <= 0 || *inp + 1 > olen) { - ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); - return; - } - - /* Save it away */ - fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); - if (fd < 0) { - ppp_dbglog("EAP: error saving pseudonym: %m"); - return; - } - len = write(fd, inp + 1, *inp); - if (close(fd) != -1 && len == *inp) { - ppp_dbglog("EAP: saved pseudonym"); - pcb->eap.es_usedpseudo = 0; - } else { - ppp_dbglog("EAP: failed to save pseudonym"); - remove_pn_file(); - } + u_char val; + u_char *datp, *digp; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int dsize, fd, olen = len; + + /* + * Do the decoding by working backwards. This eliminates the need + * to save the decoded output in a separate buffer. + */ + val = id; + while (len > 0) { + if ((dsize = len % SHA_DIGESTSIZE) == 0) + dsize = SHA_DIGESTSIZE; + len -= dsize; + datp = inp + len; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &val, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); + if (len > 0) { + SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); + } else { + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + } + SHA1Final(dig, &ctxt); + for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) + *datp++ ^= *digp; + } + + /* Now check that the result is sane */ + if (olen <= 0 || *inp + 1 > olen) { + ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); + return; + } + + /* Save it away */ + fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); + if (fd < 0) { + ppp_dbglog("EAP: error saving pseudonym: %m"); + return; + } + len = write(fd, inp + 1, *inp); + if (close(fd) != -1 && len == *inp) { + ppp_dbglog("EAP: saved pseudonym"); + pcb->eap.es_usedpseudo = 0; + } else { + ppp_dbglog("EAP: failed to save pseudonym"); + remove_pn_file(); + } } #endif /* USE_SRP */ @@ -1309,412 +1309,412 @@ int len, id; * eap_request - Receive EAP Request message (client mode). */ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_client *tc; - struct t_num sval, gval, Nval, *Ap, Bval; - u_char vals[2]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int fd; + struct t_client *tc; + struct t_num sval, gval, Nval, *Ap, Bval; + u_char vals[2]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int fd; #endif /* USE_SRP */ - /* - * Note: we update es_client.ea_id *only if* a Response - * message is being generated. Otherwise, we leave it the - * same for duplicate detection purposes. - */ - - pcb->eap.es_client.ea_requests++; - if (pcb->settings.eap_allow_req != 0 && - pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { - ppp_info("EAP: received too many Request messages"); - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - auth_withpeer_fail(pcb, PPP_EAP); - return; - } - - if (len <= 0) { - ppp_error("EAP: empty Request message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (len > 0) - ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); + /* + * Note: we update es_client.ea_id *only if* a Response + * message is being generated. Otherwise, we leave it the + * same for duplicate detection purposes. + */ + + pcb->eap.es_client.ea_requests++; + if (pcb->settings.eap_allow_req != 0 && + pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { + ppp_info("EAP: received too many Request messages"); + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + auth_withpeer_fail(pcb, PPP_EAP); + return; + } + + if (len <= 0) { + ppp_error("EAP: empty Request message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (len > 0) + ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); #ifdef USE_SRP - if (pcb->eap.es_usepseudo && - (pcb->eap.es_usedpseudo == 0 || - (pcb->eap.es_usedpseudo == 1 && - id == pcb->eap.es_client.ea_id))) { - pcb->eap.es_usedpseudo = 1; - /* Try to get a pseudonym */ - if ((fd = open_pn_file(O_RDONLY)) >= 0) { - strcpy(rhostname, SRP_PSEUDO_ID); - len = read(fd, rhostname + SRP_PSEUDO_LEN, - sizeof (rhostname) - SRP_PSEUDO_LEN); - /* XXX NAI unsupported */ - if (len > 0) { - eap_send_response(pcb, id, typenum, - rhostname, len + SRP_PSEUDO_LEN); - } - (void) close(fd); - if (len > 0) - break; - } - } - /* Stop using pseudonym now. */ - if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { - remove_pn_file(); - pcb->eap.es_usedpseudo = 2; - } + if (pcb->eap.es_usepseudo && + (pcb->eap.es_usedpseudo == 0 || + (pcb->eap.es_usedpseudo == 1 && + id == pcb->eap.es_client.ea_id))) { + pcb->eap.es_usedpseudo = 1; + /* Try to get a pseudonym */ + if ((fd = open_pn_file(O_RDONLY)) >= 0) { + strcpy(rhostname, SRP_PSEUDO_ID); + len = read(fd, rhostname + SRP_PSEUDO_LEN, + sizeof (rhostname) - SRP_PSEUDO_LEN); + /* XXX NAI unsupported */ + if (len > 0) { + eap_send_response(pcb, id, typenum, + rhostname, len + SRP_PSEUDO_LEN); + } + (void) close(fd); + if (len > 0) + break; + } + } + /* Stop using pseudonym now. */ + if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { + remove_pn_file(); + pcb->eap.es_usedpseudo = 2; + } #endif /* USE_SRP */ - eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; - - case EAPT_NOTIFICATION: - if (len > 0) - ppp_info("EAP: Notification \"%.*q\"", len, inp); - eap_send_response(pcb, id, typenum, NULL, 0); - break; - - case EAPT_NAK: - /* - * Avoid the temptation to send Response Nak in reply - * to Request Nak here. It can only lead to trouble. - */ - ppp_warn("EAP: unexpected Nak in Request; ignored"); - /* Return because we're waiting for something real. */ - return; - - case EAPT_MD5CHAP: - if (len < 1) { - ppp_error("EAP: received MD5-Challenge with no data"); - /* Bogus request; wait for something real. */ - return; - } - GETCHAR(vallen, inp); - len--; - if (vallen < 8 || vallen > len) { - ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", - vallen, len); - /* Try something better. */ - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; + + case EAPT_NOTIFICATION: + if (len > 0) + ppp_info("EAP: Notification \"%.*q\"", len, inp); + eap_send_response(pcb, id, typenum, NULL, 0); + break; + + case EAPT_NAK: + /* + * Avoid the temptation to send Response Nak in reply + * to Request Nak here. It can only lead to trouble. + */ + ppp_warn("EAP: unexpected Nak in Request; ignored"); + /* Return because we're waiting for something real. */ + return; + + case EAPT_MD5CHAP: + if (len < 1) { + ppp_error("EAP: received MD5-Challenge with no data"); + /* Bogus request; wait for something real. */ + return; + } + GETCHAR(vallen, inp); + len--; + if (vallen < 8 || vallen > len) { + ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", + vallen, len); + /* Try something better. */ + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (pcb->settings.explicit_remote || - (pcb->settings.remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (pcb->settings.explicit_remote || + (pcb->settings.remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating ourselves with - * the specified host. - */ - if (!get_secret(pcb, pcb->eap.es_client.ea_name, - rhostname, secret, &secret_len, 0)) { - ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - typenum = id; - lwip_md5_update(&mdContext, &typenum, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, inp, vallen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; + /* + * Get the secret for authenticating ourselves with + * the specified host. + */ + if (!get_secret(pcb, pcb->eap.es_client.ea_name, + rhostname, secret, &secret_len, 0)) { + ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + typenum = id; + lwip_md5_update(&mdContext, &typenum, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, inp, vallen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: received empty SRP Request"); - /* Bogus request; wait for something real. */ - return; - } - - /* Get subtype */ - GETCHAR(vallen, inp); - len--; - switch (vallen) { - case EAPSRP_CHALLENGE: - tc = NULL; - if (pcb->eap.es_client.ea_session != NULL) { - tc = (struct t_client *)pcb->eap.es_client. - ea_session; - /* - * If this is a new challenge, then start - * over with a new client session context. - * Otherwise, just resend last response. - */ - if (id != pcb->eap.es_client.ea_id) { - t_clientclose(tc); - pcb->eap.es_client.ea_session = NULL; - tc = NULL; - } - } - /* No session key just yet */ - pcb->eap.es_client.ea_skey = NULL; - if (tc == NULL) { - int rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (name)"); - /* Ignore badly-formed messages */ - return; - } - MEMCPY(rhostname, inp, vallen); - rhostname[vallen] = '\0'; - INCPTR(vallen, inp); - len -= vallen; - - /* - * In case the remote doesn't give us his name, - * use configured name. - */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == 0)) { - strlcpy(rhostname, remote_name, - sizeof (rhostname)); - } - - rhostnamelen = (int)strlen(rhostname); - if (rhostnamelen > MAXNAMELEN) { - rhostnamelen = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); - pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; - pcb->eap.es_client.ea_peerlen = rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (s)"); - /* Ignore badly-formed messages */ - return; - } - sval.data = inp; - sval.len = vallen; - INCPTR(vallen, inp); - len -= vallen; - - GETCHAR(vallen, inp); - len--; - if (vallen > len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (g)"); - /* Ignore badly-formed messages */ - return; - } - /* If no generator present, then use value 2 */ - if (vallen == 0) { - gval.data = (u_char *)"\002"; - gval.len = 1; - } else { - gval.data = inp; - gval.len = vallen; - } - INCPTR(vallen, inp); - len -= vallen; - - /* - * If no modulus present, then use well-known - * value. - */ - if (len == 0) { - Nval.data = (u_char *)wkmodulus; - Nval.len = sizeof (wkmodulus); - } else { - Nval.data = inp; - Nval.len = len; - } - tc = t_clientopen(pcb->eap.es_client.ea_name, - &Nval, &gval, &sval); - if (tc == NULL) { - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - pcb->eap.es_client.ea_session = (void *)tc; - - /* Add Challenge ID & type to verifier */ - vals[0] = id; - vals[1] = EAPT_SRP; - t_clientaddexdata(tc, vals, 2); - } - Ap = t_clientgenexp(tc); - eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, - Ap->len); - break; - - case EAPSRP_SKEY: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL) { - ppp_warn("EAP: peer sent Subtype 2 without 1"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - if (pcb->eap.es_client.ea_skey != NULL) { - /* - * ID number should not change here. Warn - * if it does (but otherwise ignore). - */ - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 2 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - if (get_srp_secret(pcb->eap.es_unit, - pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_peer, secret, 0) == 0) { - /* - * Can't work with this peer because - * the secret is missing. Just give - * up. - */ - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - Bval.data = inp; - Bval.len = len; - t_clientpasswd(tc, secret); - BZERO(secret, sizeof (secret)); - pcb->eap.es_client.ea_skey = - t_clientgetkey(tc, &Bval); - if (pcb->eap.es_client.ea_skey == NULL) { - /* Server is rogue; stop now */ - ppp_error("EAP: SRP server is rogue"); - goto client_failure; - } - } - eap_srpval_response(esp, id, SRPVAL_EBIT, - t_clientresponse(tc)); - break; - - case EAPSRP_SVALIDATOR: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { - ppp_warn("EAP: peer sent Subtype 3 without 1/2"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - /* - * If we're already open, then this ought to be a - * duplicate. Otherwise, check that the server is - * who we think it is. - */ - if (pcb->eap.es_client.ea_state == eapOpen) { - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 3 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - len -= sizeof (u32_t) + SHA_DIGESTSIZE; - if (len < 0 || t_clientverify(tc, inp + - sizeof (u32_t)) != 0) { - ppp_error("EAP: SRP server verification " - "failed"); - goto client_failure; - } - GETLONG(pcb->eap.es_client.ea_keyflags, inp); - /* Save pseudonym if user wants it. */ - if (len > 0 && pcb->eap.es_usepseudo) { - INCPTR(SHA_DIGESTSIZE, inp); - write_pseudonym(esp, inp, len, id); - } - } - /* - * We've verified our peer. We're now mostly done, - * except for waiting on the regular EAP Success - * message. - */ - eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); - break; - - case EAPSRP_LWRECHALLENGE: - if (len < 4) { - ppp_warn("EAP: malformed Lightweight rechallenge"); - return; - } - SHA1Init(&ctxt); - vals[0] = id; - SHA1Update(&ctxt, vals, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, inp, len); - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - SHA1Final(dig, &ctxt); - eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, - SHA_DIGESTSIZE); - break; - - default: - ppp_error("EAP: unknown SRP Subtype %d", vallen); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: received empty SRP Request"); + /* Bogus request; wait for something real. */ + return; + } + + /* Get subtype */ + GETCHAR(vallen, inp); + len--; + switch (vallen) { + case EAPSRP_CHALLENGE: + tc = NULL; + if (pcb->eap.es_client.ea_session != NULL) { + tc = (struct t_client *)pcb->eap.es_client. + ea_session; + /* + * If this is a new challenge, then start + * over with a new client session context. + * Otherwise, just resend last response. + */ + if (id != pcb->eap.es_client.ea_id) { + t_clientclose(tc); + pcb->eap.es_client.ea_session = NULL; + tc = NULL; + } + } + /* No session key just yet */ + pcb->eap.es_client.ea_skey = NULL; + if (tc == NULL) { + int rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (name)"); + /* Ignore badly-formed messages */ + return; + } + MEMCPY(rhostname, inp, vallen); + rhostname[vallen] = '\0'; + INCPTR(vallen, inp); + len -= vallen; + + /* + * In case the remote doesn't give us his name, + * use configured name. + */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == 0)) { + strlcpy(rhostname, remote_name, + sizeof (rhostname)); + } + + rhostnamelen = (int)strlen(rhostname); + if (rhostnamelen > MAXNAMELEN) { + rhostnamelen = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); + pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; + pcb->eap.es_client.ea_peerlen = rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (s)"); + /* Ignore badly-formed messages */ + return; + } + sval.data = inp; + sval.len = vallen; + INCPTR(vallen, inp); + len -= vallen; + + GETCHAR(vallen, inp); + len--; + if (vallen > len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (g)"); + /* Ignore badly-formed messages */ + return; + } + /* If no generator present, then use value 2 */ + if (vallen == 0) { + gval.data = (u_char *)"\002"; + gval.len = 1; + } else { + gval.data = inp; + gval.len = vallen; + } + INCPTR(vallen, inp); + len -= vallen; + + /* + * If no modulus present, then use well-known + * value. + */ + if (len == 0) { + Nval.data = (u_char *)wkmodulus; + Nval.len = sizeof (wkmodulus); + } else { + Nval.data = inp; + Nval.len = len; + } + tc = t_clientopen(pcb->eap.es_client.ea_name, + &Nval, &gval, &sval); + if (tc == NULL) { + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + pcb->eap.es_client.ea_session = (void *)tc; + + /* Add Challenge ID & type to verifier */ + vals[0] = id; + vals[1] = EAPT_SRP; + t_clientaddexdata(tc, vals, 2); + } + Ap = t_clientgenexp(tc); + eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, + Ap->len); + break; + + case EAPSRP_SKEY: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL) { + ppp_warn("EAP: peer sent Subtype 2 without 1"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + if (pcb->eap.es_client.ea_skey != NULL) { + /* + * ID number should not change here. Warn + * if it does (but otherwise ignore). + */ + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 2 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + if (get_srp_secret(pcb->eap.es_unit, + pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_peer, secret, 0) == 0) { + /* + * Can't work with this peer because + * the secret is missing. Just give + * up. + */ + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + Bval.data = inp; + Bval.len = len; + t_clientpasswd(tc, secret); + BZERO(secret, sizeof (secret)); + pcb->eap.es_client.ea_skey = + t_clientgetkey(tc, &Bval); + if (pcb->eap.es_client.ea_skey == NULL) { + /* Server is rogue; stop now */ + ppp_error("EAP: SRP server is rogue"); + goto client_failure; + } + } + eap_srpval_response(esp, id, SRPVAL_EBIT, + t_clientresponse(tc)); + break; + + case EAPSRP_SVALIDATOR: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { + ppp_warn("EAP: peer sent Subtype 3 without 1/2"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + /* + * If we're already open, then this ought to be a + * duplicate. Otherwise, check that the server is + * who we think it is. + */ + if (pcb->eap.es_client.ea_state == eapOpen) { + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 3 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + len -= sizeof (u32_t) + SHA_DIGESTSIZE; + if (len < 0 || t_clientverify(tc, inp + + sizeof (u32_t)) != 0) { + ppp_error("EAP: SRP server verification " + "failed"); + goto client_failure; + } + GETLONG(pcb->eap.es_client.ea_keyflags, inp); + /* Save pseudonym if user wants it. */ + if (len > 0 && pcb->eap.es_usepseudo) { + INCPTR(SHA_DIGESTSIZE, inp); + write_pseudonym(esp, inp, len, id); + } + } + /* + * We've verified our peer. We're now mostly done, + * except for waiting on the regular EAP Success + * message. + */ + eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); + break; + + case EAPSRP_LWRECHALLENGE: + if (len < 4) { + ppp_warn("EAP: malformed Lightweight rechallenge"); + return; + } + SHA1Init(&ctxt); + vals[0] = id; + SHA1Update(&ctxt, vals, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, inp, len); + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + SHA1Final(dig, &ctxt); + eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, + SHA_DIGESTSIZE); + break; + + default: + ppp_error("EAP: unknown SRP Subtype %d", vallen); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + break; #endif /* USE_SRP */ - default: - ppp_info("EAP: unknown authentication type %d; Naking", typenum); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } + default: + ppp_info("EAP: unknown authentication type %d; Naking", typenum); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); - } - return; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); + } + return; #ifdef USE_SRP client_failure: - pcb->eap.es_client.ea_state = eapBadAuth; - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, (void *)esp); - } - pcb->eap.es_client.ea_session = NULL; - t_clientclose(tc); - auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, (void *)esp); + } + pcb->eap.es_client.ea_session = NULL; + t_clientclose(tc); + auth_withpeer_fail(pcb, PPP_EAP); #endif /* USE_SRP */ } @@ -1723,291 +1723,291 @@ client_failure: * eap_response - Receive EAP Response message (server mode). */ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_server *ts; - struct t_num A; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; + struct t_server *ts; + struct t_num A; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; #endif /* USE_SRP */ - if (pcb->eap.es_server.ea_id != id) { - ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, - pcb->eap.es_server.ea_id); - return; - } - - pcb->eap.es_server.ea_responses++; - - if (len <= 0) { - ppp_error("EAP: empty Response message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (pcb->eap.es_server.ea_state != eapIdentify) { - ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, - inp); - break; - } - ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, inp, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_NOTIFICATION: - ppp_dbglog("EAP unexpected Notification; response discarded"); - break; - - case EAPT_NAK: - if (len < 1) { - ppp_info("EAP: Nak Response with no suggested protocol"); - eap_figure_next_state(pcb, 1); - break; - } - - GETCHAR(vallen, inp); - len--; - - if ( + if (pcb->eap.es_server.ea_id != id) { + ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, + pcb->eap.es_server.ea_id); + return; + } + + pcb->eap.es_server.ea_responses++; + + if (len <= 0) { + ppp_error("EAP: empty Response message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (pcb->eap.es_server.ea_state != eapIdentify) { + ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, + inp); + break; + } + ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, inp, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_NOTIFICATION: + ppp_dbglog("EAP unexpected Notification; response discarded"); + break; + + case EAPT_NAK: + if (len < 1) { + ppp_info("EAP: Nak Response with no suggested protocol"); + eap_figure_next_state(pcb, 1); + break; + } + + GETCHAR(vallen, inp); + len--; + + if ( #if PPP_REMOTENAME - !pcb->explicit_remote && + !pcb->explicit_remote && #endif /* PPP_REMOTENAME */ - pcb->eap.es_server.ea_state == eapIdentify){ - /* Peer cannot Nak Identify Request */ - eap_figure_next_state(pcb, 1); - break; - } - - switch (vallen) { - case EAPT_SRP: - /* Run through SRP validator selection again. */ - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_MD5CHAP: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - - default: - ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); - switch (pcb->eap.es_server.ea_state) { - case eapSRP1: - case eapSRP2: - case eapSRP3: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - case eapMD5Chall: - case eapSRP4: - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - default: - break; - } - break; - } - break; - - case EAPT_MD5CHAP: - if (pcb->eap.es_server.ea_state != eapMD5Chall) { - ppp_error("EAP: unexpected MD5-Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < 1) { - ppp_error("EAP: received MD5-Response with no data"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen != 16 || vallen > len) { - ppp_error("EAP: MD5-Response with bad length %d", vallen); - eap_figure_next_state(pcb, 1); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + pcb->eap.es_server.ea_state == eapIdentify){ + /* Peer cannot Nak Identify Request */ + eap_figure_next_state(pcb, 1); + break; + } + + switch (vallen) { + case EAPT_SRP: + /* Run through SRP validator selection again. */ + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_MD5CHAP: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + + default: + ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); + switch (pcb->eap.es_server.ea_state) { + case eapSRP1: + case eapSRP2: + case eapSRP3: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + case eapMD5Chall: + case eapSRP4: + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + default: + break; + } + break; + } + break; + + case EAPT_MD5CHAP: + if (pcb->eap.es_server.ea_state != eapMD5Chall) { + ppp_error("EAP: unexpected MD5-Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < 1) { + ppp_error("EAP: received MD5-Response with no data"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen != 16 || vallen > len) { + ppp_error("EAP: MD5-Response with bad length %d", vallen); + eap_figure_next_state(pcb, 1); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating the specified - * host. - */ - if (!get_secret(pcb, rhostname, - pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { - ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); - eap_send_failure(pcb); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_type = EAPT_MD5CHAP; - eap_send_success(pcb); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); - break; + /* + * Get the secret for authenticating the specified + * host. + */ + if (!get_secret(pcb, rhostname, + pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { + ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); + eap_send_failure(pcb); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_type = EAPT_MD5CHAP; + eap_send_success(pcb); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: empty SRP Response"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(typenum, inp); - len--; - switch (typenum) { - case EAPSRP_CKEY: - if (pcb->eap.es_server.ea_state != eapSRP1) { - ppp_error("EAP: unexpected SRP Subtype 1 Response"); - eap_figure_next_state(pcb, 1); - break; - } - A.data = inp; - A.len = len; - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); - if (pcb->eap.es_server.ea_skey == NULL) { - /* Client's A value is bogus; terminate now */ - ppp_error("EAP: bogus A value from client"); - eap_send_failure(pcb); - } else { - eap_figure_next_state(pcb, 0); - } - break; - - case EAPSRP_CVALIDATOR: - if (pcb->eap.es_server.ea_state != eapSRP2) { - ppp_error("EAP: unexpected SRP Subtype 2 Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { - ppp_error("EAP: M1 length %d < %d", len, - sizeof (u32_t) + SHA_DIGESTSIZE); - eap_figure_next_state(pcb, 1); - break; - } - GETLONG(pcb->eap.es_server.ea_keyflags, inp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - if (t_serververify(ts, inp)) { - ppp_info("EAP: unable to validate client identity"); - eap_send_failure(pcb); - break; - } - eap_figure_next_state(pcb, 0); - break; - - case EAPSRP_ACK: - if (pcb->eap.es_server.ea_state != eapSRP3) { - ppp_error("EAP: unexpected SRP Subtype 3 Response"); - eap_send_failure(esp); - break; - } - pcb->eap.es_server.ea_type = EAPT_SRP; - eap_send_success(pcb, esp); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, - pcb->eap.es_rechallenge); - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, pcb, - pcb->eap.es_lwrechallenge); - break; - - case EAPSRP_LWRECHALLENGE: - if (pcb->eap.es_server.ea_state != eapSRP4) { - ppp_info("EAP: unexpected SRP Subtype 4 Response"); - return; - } - if (len != SHA_DIGESTSIZE) { - ppp_error("EAP: bad Lightweight rechallenge " - "response"); - return; - } - SHA1Init(&ctxt); - vallen = id; - SHA1Update(&ctxt, &vallen, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - SHA1Final(dig, &ctxt); - if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { - ppp_error("EAP: failed Lightweight rechallenge"); - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_state = eapOpen; - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, esp, - pcb->eap.es_lwrechallenge); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: empty SRP Response"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(typenum, inp); + len--; + switch (typenum) { + case EAPSRP_CKEY: + if (pcb->eap.es_server.ea_state != eapSRP1) { + ppp_error("EAP: unexpected SRP Subtype 1 Response"); + eap_figure_next_state(pcb, 1); + break; + } + A.data = inp; + A.len = len; + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); + if (pcb->eap.es_server.ea_skey == NULL) { + /* Client's A value is bogus; terminate now */ + ppp_error("EAP: bogus A value from client"); + eap_send_failure(pcb); + } else { + eap_figure_next_state(pcb, 0); + } + break; + + case EAPSRP_CVALIDATOR: + if (pcb->eap.es_server.ea_state != eapSRP2) { + ppp_error("EAP: unexpected SRP Subtype 2 Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { + ppp_error("EAP: M1 length %d < %d", len, + sizeof (u32_t) + SHA_DIGESTSIZE); + eap_figure_next_state(pcb, 1); + break; + } + GETLONG(pcb->eap.es_server.ea_keyflags, inp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + if (t_serververify(ts, inp)) { + ppp_info("EAP: unable to validate client identity"); + eap_send_failure(pcb); + break; + } + eap_figure_next_state(pcb, 0); + break; + + case EAPSRP_ACK: + if (pcb->eap.es_server.ea_state != eapSRP3) { + ppp_error("EAP: unexpected SRP Subtype 3 Response"); + eap_send_failure(esp); + break; + } + pcb->eap.es_server.ea_type = EAPT_SRP; + eap_send_success(pcb, esp); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, + pcb->eap.es_rechallenge); + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, pcb, + pcb->eap.es_lwrechallenge); + break; + + case EAPSRP_LWRECHALLENGE: + if (pcb->eap.es_server.ea_state != eapSRP4) { + ppp_info("EAP: unexpected SRP Subtype 4 Response"); + return; + } + if (len != SHA_DIGESTSIZE) { + ppp_error("EAP: bad Lightweight rechallenge " + "response"); + return; + } + SHA1Init(&ctxt); + vallen = id; + SHA1Update(&ctxt, &vallen, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + SHA1Final(dig, &ctxt); + if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { + ppp_error("EAP: failed Lightweight rechallenge"); + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_state = eapOpen; + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, esp, + pcb->eap.es_lwrechallenge); + break; + } + break; #endif /* USE_SRP */ - default: - /* This can't happen. */ - ppp_error("EAP: unknown Response type %d; ignored", typenum); - return; - } - - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - - if (pcb->eap.es_server.ea_state != eapBadAuth && - pcb->eap.es_server.ea_state != eapOpen) { - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); - } + default: + /* This can't happen. */ + ppp_error("EAP: unknown Response type %d; ignored", typenum); + return; + } + + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + + if (pcb->eap.es_server.ea_state != eapBadAuth && + pcb->eap.es_server.ea_state != eapOpen) { + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); + } } #endif /* PPP_SERVER */ @@ -2015,105 +2015,105 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { * eap_success - Receive EAP Success message (client mode). */ static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); - - if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected success message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - return; - } - - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } - - pcb->eap.es_client.ea_state = eapOpen; - auth_withpeer_success(pcb, PPP_EAP, 0); + LWIP_UNUSED_ARG(id); + + if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected success message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + return; + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } + + pcb->eap.es_client.ea_state = eapOpen; + auth_withpeer_success(pcb, PPP_EAP, 0); } /* * eap_failure - Receive EAP Failure message (client mode). */ static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(id); - if (!eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected failure message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - } + if (!eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected failure message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } - pcb->eap.es_client.ea_state = eapBadAuth; + pcb->eap.es_client.ea_state = eapBadAuth; - ppp_error("EAP: peer reports authentication failure"); - auth_withpeer_fail(pcb, PPP_EAP); + ppp_error("EAP: peer reports authentication failure"); + auth_withpeer_fail(pcb, PPP_EAP); } /* * eap_input - Handle received EAP message. */ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { - u_char code, id; - int len; - - /* - * Parse header (code, id and length). If packet too short, - * drop it. - */ - if (inlen < EAP_HEADERLEN) { - ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) { - ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, - EAP_HEADERLEN, inlen); - return; - } - len -= EAP_HEADERLEN; - - /* Dispatch based on message code */ - switch (code) { - case EAP_REQUEST: - eap_request(pcb, inp, id, len); - break; + u_char code, id; + int len; + + /* + * Parse header (code, id and length). If packet too short, + * drop it. + */ + if (inlen < EAP_HEADERLEN) { + ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) { + ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, + EAP_HEADERLEN, inlen); + return; + } + len -= EAP_HEADERLEN; + + /* Dispatch based on message code */ + switch (code) { + case EAP_REQUEST: + eap_request(pcb, inp, id, len); + break; #if PPP_SERVER - case EAP_RESPONSE: - eap_response(pcb, inp, id, len); - break; + case EAP_RESPONSE: + eap_response(pcb, inp, id, len); + break; #endif /* PPP_SERVER */ - case EAP_SUCCESS: - eap_success(pcb, inp, id, len); - break; + case EAP_SUCCESS: + eap_success(pcb, inp, id, len); + break; - case EAP_FAILURE: - eap_failure(pcb, inp, id, len); - break; + case EAP_FAILURE: + eap_failure(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - /* Note: it's not legal to send EAP Nak here. */ - ppp_warn("EAP: unknown code %d received", code); - break; - } + default: /* XXX Need code reject */ + /* Note: it's not legal to send EAP Nak here. */ + ppp_warn("EAP: unknown code %d received", code); + break; + } } #if PRINTPKT_SUPPORT @@ -2121,302 +2121,302 @@ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { * eap_printpkt - print the contents of an EAP packet. */ static const char* const eap_codenames[] = { - "Request", "Response", "Success", "Failure" + "Request", "Response", "Success", "Failure" }; static const char* const eap_typenames[] = { - "Identity", "Notification", "Nak", "MD5-Challenge", - "OTP", "Generic-Token", NULL, NULL, - "RSA", "DSS", "KEA", "KEA-Validate", - "TLS", "Defender", "Windows 2000", "Arcot", - "Cisco", "Nokia", "SRP" + "Identity", "Notification", "Nak", "MD5-Challenge", + "OTP", "Generic-Token", NULL, NULL, + "RSA", "DSS", "KEA", "KEA-Validate", + "TLS", "Defender", "Windows 2000", "Arcot", + "Cisco", "Nokia", "SRP" }; static int eap_printpkt(const u_char *inp, int inlen, void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len, rtype, vallen; - const u_char *pstart; - u32_t uval; - - if (inlen < EAP_HEADERLEN) - return (0); - pstart = inp; - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) - return (0); - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) - printer(arg, " %s", eap_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= EAP_HEADERLEN; - switch (code) { - case EAP_REQUEST: - if (len < 1) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - case EAPT_NOTIFICATION: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_MD5CHAP: - if (len <= 0) - break; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 3) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CHALLENGE: - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - if (vallen > 0) { - printer(arg, " "); - } else { - printer(arg, " "); - } - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - if (vallen == 0) { - printer(arg, " "); - } else { - printer(arg, " ", vallen, inp); - } - INCPTR(vallen, inp); - len -= vallen; - if (len == 0) { - printer(arg, " "); - } else { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_SKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_SVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - printer(arg, " ", len, inp, - len < SHA_DIGESTSIZE ? "?" : ""); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_RESPONSE: - if (len < 1) - break; - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPT_NAK: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " (%s)", eap_typenames[rtype-1]); - printer(arg, ">"); - break; - - case EAPT_MD5CHAP: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 1) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_CVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_ACK: - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - INCPTR(vallen, inp); - len -= vallen; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_SUCCESS: /* No payload expected for these! */ - case EAP_FAILURE: - default: - break; - - truncated: - printer(arg, " "); - break; - } - - if (len > 8) - printer(arg, "%8B...", inp); - else if (len > 0) - printer(arg, "%.*B", len, inp); - INCPTR(len, inp); - - return (inp - pstart); + int code, id, len, rtype, vallen; + const u_char *pstart; + u32_t uval; + + if (inlen < EAP_HEADERLEN) + return (0); + pstart = inp; + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) + return (0); + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) + printer(arg, " %s", eap_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= EAP_HEADERLEN; + switch (code) { + case EAP_REQUEST: + if (len < 1) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + case EAPT_NOTIFICATION: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_MD5CHAP: + if (len <= 0) + break; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 3) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CHALLENGE: + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + if (vallen > 0) { + printer(arg, " "); + } else { + printer(arg, " "); + } + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + if (vallen == 0) { + printer(arg, " "); + } else { + printer(arg, " ", vallen, inp); + } + INCPTR(vallen, inp); + len -= vallen; + if (len == 0) { + printer(arg, " "); + } else { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_SKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_SVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + printer(arg, " ", len, inp, + len < SHA_DIGESTSIZE ? "?" : ""); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_RESPONSE: + if (len < 1) + break; + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPT_NAK: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " (%s)", eap_typenames[rtype-1]); + printer(arg, ">"); + break; + + case EAPT_MD5CHAP: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 1) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_CVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_ACK: + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + INCPTR(vallen, inp); + len -= vallen; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_SUCCESS: /* No payload expected for these! */ + case EAP_FAILURE: + default: + break; + + truncated: + printer(arg, " "); + break; + } + + if (len > 8) + printer(arg, "%8B...", inp); + else if (len > 0) + printer(arg, "%.*B", len, inp); + INCPTR(len, inp); + + return (inp - pstart); } #endif /* PRINTPKT_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ecp.c b/components/net/lwip-2.1.2/src/netif/ppp/ecp.c index 4d84f60931..5b3b331560 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ecp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ecp.c @@ -92,8 +92,8 @@ static void ecp_protrej (int unit); */ #if PRINTPKT_SUPPORT static int ecp_printpkt (const u_char *pkt, int len, - void (*printer) (void *, char *, ...), - void *arg); + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ /* static void ecp_datainput (int unit, u_char *pkt, int len); @@ -129,10 +129,10 @@ const struct protent ecp_protent = { }; fsm ecp_fsm[NUM_PPP]; -ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ -ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ -ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ -ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ +ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ +ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ +ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ +ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ static const fsm_callbacks ecp_callbacks = { NULL, /* ecp_resetci, */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/eui64.c b/components/net/lwip-2.1.2/src/netif/ppp/eui64.c index 01493bc1f8..9e25fc4c2f 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/eui64.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/eui64.c @@ -48,8 +48,8 @@ char *eui64_ntoa(eui64_t e) { static char buf[20]; sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", - e.e8[0], e.e8[1], e.e8[2], e.e8[3], - e.e8[4], e.e8[5], e.e8[6], e.e8[7]); + e.e8[0], e.e8[1], e.e8[2], e.e8[3], + e.e8[4], e.e8[5], e.e8[6], e.e8[7]); return buf; } diff --git a/components/net/lwip-2.1.2/src/netif/ppp/fsm.c b/components/net/lwip-2.1.2/src/netif/ppp/fsm.c index b1f08affff..9df98b1ef7 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/fsm.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/fsm.c @@ -68,7 +68,7 @@ static void fsm_rtermack(fsm *f); static void fsm_rcoderej(fsm *f, u_char *inp, int len); static void fsm_sconfreq(fsm *f, int retransmit); -#define PROTO_NAME(f) ((f)->callbacks->proto_name) +#define PROTO_NAME(f) ((f)->callbacks->proto_name) /* * fsm_init - Initialize fsm. @@ -79,7 +79,7 @@ void fsm_init(fsm *f) { ppp_pcb *pcb = f->pcb; f->state = PPP_FSM_INITIAL; f->flags = 0; - f->id = 0; /* XXX Start with random id? */ + f->id = 0; /* XXX Start with random id? */ f->maxnakloops = pcb->settings.fsm_max_nak_loops; f->term_reason_len = 0; } @@ -91,22 +91,22 @@ void fsm_init(fsm *f) { void fsm_lowerup(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STARTING: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -119,37 +119,37 @@ void fsm_lowerup(fsm *f) { void fsm_lowerdown(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSED: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_INITIAL; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_INITIAL; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_STARTING; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_STARTING; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_OPENED: - if( f->callbacks->down ) - (*f->callbacks->down)(f); - f->state = PPP_FSM_STARTING; - break; + if( f->callbacks->down ) + (*f->callbacks->down)(f); + f->state = PPP_FSM_STARTING; + break; default: - FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -160,34 +160,34 @@ void fsm_lowerdown(fsm *f) { void fsm_open(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSED: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_STOPPING; - /* fall through */ - /* no break */ + f->state = PPP_FSM_STOPPING; + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: case PPP_FSM_OPENED: - if( f->flags & OPT_RESTART ){ - fsm_lowerdown(f); - fsm_lowerup(f); - } - break; + if( f->flags & OPT_RESTART ){ + fsm_lowerdown(f); + fsm_lowerup(f); + } + break; default: - break; + break; } } @@ -201,25 +201,25 @@ static void terminate_layer(fsm *f, int nextstate) { ppp_pcb *pcb = f->pcb; if( f->state != PPP_FSM_OPENED ) - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ else if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers we're down */ + (*f->callbacks->down)(f); /* Inform upper layers we're down */ /* Init restart counter and send Terminate-Request */ f->retransmits = pcb->settings.fsm_max_term_transmits; fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); + (const u_char *) f->term_reason, f->term_reason_len); if (f->retransmits == 0) { - /* - * User asked for no terminate requests at all; just close it. - * We've already fired off one Terminate-Request just to be nice - * to the peer, but we're not going to wait for a reply. - */ - f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - return; + /* + * User asked for no terminate requests at all; just close it. + * We've already fired off one Terminate-Request just to be nice + * to the peer, but we're not going to wait for a reply. + */ + f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + return; } TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); @@ -239,23 +239,23 @@ void fsm_close(fsm *f, const char *reason) { f->term_reason_len = (reason == NULL? 0: (u8_t)LWIP_MIN(strlen(reason), 0xFF) ); switch( f->state ){ case PPP_FSM_STARTING: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STOPPING: - f->state = PPP_FSM_CLOSING; - break; + f->state = PPP_FSM_CLOSING; + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_CLOSING); - break; + terminate_layer(f, PPP_FSM_CLOSING); + break; default: - break; + break; } } @@ -270,44 +270,44 @@ static void fsm_timeout(void *arg) { switch (f->state) { case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - if( f->retransmits <= 0 ){ - /* - * We've waited for an ack long enough. Peer probably heard us. - */ - f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - } else { - /* Send Terminate-Request */ - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - --f->retransmits; - } - break; + if( f->retransmits <= 0 ){ + /* + * We've waited for an ack long enough. Peer probably heard us. + */ + f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + } else { + /* Send Terminate-Request */ + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (const u_char *) f->term_reason, f->term_reason_len); + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + --f->retransmits; + } + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - if (f->retransmits <= 0) { - ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); - f->state = PPP_FSM_STOPPED; - if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) - (*f->callbacks->finished)(f); - - } else { - /* Retransmit the configure-request */ - if (f->callbacks->retransmit) - (*f->callbacks->retransmit)(f); - fsm_sconfreq(f, 1); /* Re-send Configure-Request */ - if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; - } - break; + if (f->retransmits <= 0) { + ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); + f->state = PPP_FSM_STOPPED; + if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) + (*f->callbacks->finished)(f); + + } else { + /* Retransmit the configure-request */ + if (f->callbacks->retransmit) + (*f->callbacks->retransmit)(f); + fsm_sconfreq(f, 1); /* Re-send Configure-Request */ + if( f->state == PPP_FSM_ACKRCVD ) + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -326,26 +326,26 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ inp = inpacket; if (l < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); + return; } if (len > l) { - FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); + return; } - len -= HEADERLEN; /* subtract header length */ + len -= HEADERLEN; /* subtract header length */ if( f->state == PPP_FSM_INITIAL || f->state == PPP_FSM_STARTING ){ - FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", - f->protocol, f->state)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", + f->protocol, f->state)); + return; } /* @@ -353,35 +353,35 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ switch (code) { case CONFREQ: - fsm_rconfreq(f, id, inp, len); - break; - + fsm_rconfreq(f, id, inp, len); + break; + case CONFACK: - fsm_rconfack(f, id, inp, len); - break; - + fsm_rconfack(f, id, inp, len); + break; + case CONFNAK: case CONFREJ: - fsm_rconfnakrej(f, code, id, inp, len); - break; - + fsm_rconfnakrej(f, code, id, inp, len); + break; + case TERMREQ: - fsm_rtermreq(f, id, inp, len); - break; - + fsm_rtermreq(f, id, inp, len); + break; + case TERMACK: - fsm_rtermack(f); - break; - + fsm_rtermack(f); + break; + case CODEREJ: - fsm_rcoderej(f, inp, len); - break; - + fsm_rcoderej(f, inp, len); + break; + default: - if( !f->callbacks->extcode - || !(*f->callbacks->extcode)(f, code, id, inp, len) ) - fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); - break; + if( !f->callbacks->extcode + || !(*f->callbacks->extcode)(f, code, id, inp, len) ) + fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); + break; } } @@ -394,61 +394,61 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { switch( f->state ){ case PPP_FSM_CLOSED: - /* Go away, we're closed */ - fsm_sdata(f, TERMACK, id, NULL, 0); - return; + /* Go away, we're closed */ + fsm_sdata(f, TERMACK, id, NULL, 0); + return; case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - return; + return; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if( f->callbacks->down ) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_STOPPED: - /* Negotiation started by our peer */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Negotiation started by our peer */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } /* * Pass the requested configuration options * to protocol-specific code for checking. */ - if (f->callbacks->reqci){ /* Check CI */ - reject_if_disagree = (f->nakloops >= f->maxnakloops); - code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); + if (f->callbacks->reqci){ /* Check CI */ + reject_if_disagree = (f->nakloops >= f->maxnakloops); + code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); } else if (len) - code = CONFREJ; /* Reject all CI */ + code = CONFREJ; /* Reject all CI */ else - code = CONFACK; + code = CONFACK; /* send the Ack, Nak or Rej to the peer */ fsm_sdata(f, code, id, inp, len); if (code == CONFACK) { - if (f->state == PPP_FSM_ACKRCVD) { - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - } else - f->state = PPP_FSM_ACKSENT; - f->nakloops = 0; + if (f->state == PPP_FSM_ACKRCVD) { + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + } else + f->state = PPP_FSM_ACKSENT; + f->nakloops = 0; } else { - /* we sent CONFACK or CONFREJ */ - if (f->state != PPP_FSM_ACKRCVD) - f->state = PPP_FSM_REQSENT; - if( code == CONFNAK ) - ++f->nakloops; + /* we sent CONFACK or CONFREJ */ + if (f->state != PPP_FSM_ACKRCVD) + f->state = PPP_FSM_REQSENT; + if( code == CONFNAK ) + ++f->nakloops; } } @@ -459,13 +459,13 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { ppp_pcb *pcb = f->pcb; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if( !(f->callbacks->ackci? (*f->callbacks->ackci)(f, inp, len): - (len == 0)) ){ - /* Ack is bad - ignore it */ - ppp_error("Received bad configure-ack: %P", inp, len); - return; + (len == 0)) ){ + /* Ack is bad - ignore it */ + ppp_error("Received bad configure-ack: %P", inp, len); + return; } f->seen_ack = 1; f->rnakloops = 0; @@ -473,38 +473,38 @@ static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: - f->state = PPP_FSM_ACKRCVD; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - break; + f->state = PPP_FSM_ACKRCVD; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + break; case PPP_FSM_ACKRCVD: - /* Huh? an extra valid Ack? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Huh? an extra valid Ack? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - break; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -516,24 +516,24 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { int ret; int treat_as_reject; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if (code == CONFNAK) { - ++f->rnakloops; - treat_as_reject = (f->rnakloops >= f->maxnakloops); - if (f->callbacks->nakci == NULL - || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { - ppp_error("Received bad configure-nak: %P", inp, len); - return; - } + ++f->rnakloops; + treat_as_reject = (f->rnakloops >= f->maxnakloops); + if (f->callbacks->nakci == NULL + || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { + ppp_error("Received bad configure-nak: %P", inp, len); + return; + } } else { - f->rnakloops = 0; - if (f->callbacks->rejci == NULL - || !(ret = f->callbacks->rejci(f, inp, len))) { - ppp_error("Received bad configure-rej: %P", inp, len); - return; - } + f->rnakloops = 0; + if (f->callbacks->rejci == NULL + || !(ret = f->callbacks->rejci(f, inp, len))) { + ppp_error("Received bad configure-rej: %P", inp, len); + return; + } } f->seen_ack = 1; @@ -541,35 +541,35 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKSENT: - /* They didn't agree to what we wanted - try another request */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - if (ret < 0) - f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ - else - fsm_sconfreq(f, 0); /* Send Configure-Request */ - break; + /* They didn't agree to what we wanted - try another request */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + if (ret < 0) + f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ + else + fsm_sconfreq(f, 0); /* Send Configure-Request */ + break; case PPP_FSM_ACKRCVD: - /* Got a Nak/reject when we had already had an Ack?? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Got a Nak/reject when we had already had an Ack?? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -583,22 +583,22 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { switch (f->state) { case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ - break; + f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ + break; case PPP_FSM_OPENED: - if (len > 0) { - ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); - } else - ppp_info("%s terminated by peer", PROTO_NAME(f)); - f->retransmits = 0; - f->state = PPP_FSM_STOPPING; - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - break; + if (len > 0) { + ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); + } else + ppp_info("%s terminated by peer", PROTO_NAME(f)); + f->retransmits = 0; + f->state = PPP_FSM_STOPPING; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + break; default: - break; + break; } fsm_sdata(f, TERMACK, id, NULL, 0); @@ -611,30 +611,30 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { static void fsm_rtermack(fsm *f) { switch (f->state) { case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_ACKRCVD: - f->state = PPP_FSM_REQSENT; - break; + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -646,15 +646,15 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; if (len < HEADERLEN) { - FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); - return; + FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); ppp_warn("%s: Rcvd Code-Reject for code %d, id %d", PROTO_NAME(f), code, id); if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; + f->state = PPP_FSM_REQSENT; } @@ -666,36 +666,36 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { void fsm_protreject(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_CLOSED: - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_STOPPING); - break; + terminate_layer(f, PPP_FSM_STOPPING); + break; default: - FSMDEBUG(("%s: Protocol-reject event in state %d!", - PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Protocol-reject event in state %d!", + PROTO_NAME(f), f->state)); + /* no break */ } } @@ -710,17 +710,17 @@ static void fsm_sconfreq(fsm *f, int retransmit) { int cilen; if( f->state != PPP_FSM_REQSENT && f->state != PPP_FSM_ACKRCVD && f->state != PPP_FSM_ACKSENT ){ - /* Not currently negotiating - reset options */ - if( f->callbacks->resetci ) - (*f->callbacks->resetci)(f); - f->nakloops = 0; - f->rnakloops = 0; + /* Not currently negotiating - reset options */ + if( f->callbacks->resetci ) + (*f->callbacks->resetci)(f); + f->nakloops = 0; + f->rnakloops = 0; } if( !retransmit ){ - /* New request - reset retransmission counter, use new ID */ - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - f->reqid = ++f->id; + /* New request - reset retransmission counter, use new ID */ + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + f->reqid = ++f->id; } f->seen_ack = 0; @@ -729,11 +729,11 @@ static void fsm_sconfreq(fsm *f, int retransmit) { * Make up the request packet */ if( f->callbacks->cilen && f->callbacks->addci ){ - cilen = (*f->callbacks->cilen)(f); - if( cilen > pcb->peer_mru - HEADERLEN ) - cilen = pcb->peer_mru - HEADERLEN; + cilen = (*f->callbacks->cilen)(f); + if( cilen > pcb->peer_mru - HEADERLEN ) + cilen = pcb->peer_mru - HEADERLEN; } else - cilen = 0; + cilen = 0; p = pbuf_alloc(PBUF_RAW, (u16_t)(cilen + HEADERLEN + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); if(NULL == p) @@ -750,8 +750,8 @@ static void fsm_sconfreq(fsm *f, int retransmit) { PUTCHAR(f->reqid, outp); PUTSHORT(cilen + HEADERLEN, outp); if (cilen != 0) { - (*f->callbacks->addci)(f, outp, &cilen); - LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); + (*f->callbacks->addci)(f, outp, &cilen); + LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); } ppp_write(pcb, p); @@ -775,7 +775,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) /* Adjust length to be smaller than MTU */ if (datalen > pcb->peer_mru - HEADERLEN) - datalen = pcb->peer_mru - HEADERLEN; + datalen = pcb->peer_mru - HEADERLEN; outlen = datalen + HEADERLEN; p = pbuf_alloc(PBUF_RAW, (u16_t)(outlen + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); @@ -788,7 +788,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) outp = (u_char*)p->payload; if (datalen) /* && data != outp + PPP_HDRLEN + HEADERLEN) -- was only for fsm_sconfreq() */ - MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); + MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); MAKEHEADER(outp, f->protocol); PUTCHAR(code, outp); PUTCHAR(id, outp); diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c b/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c index b7c766eb0b..feb1f4becc 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c @@ -66,15 +66,15 @@ #if 0 /* UNUSED */ /* global vars */ -u32_t netmask = 0; /* IP netmask to set on interface */ +u32_t netmask = 0; /* IP netmask to set on interface */ #endif /* UNUSED */ #if 0 /* UNUSED */ -bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ +bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ #endif /* UNUSED */ #if 0 /* moved to ppp_settings */ -bool noremoteip = 0; /* Let him have no IP address */ +bool noremoteip = 0; /* Let him have no IP address */ #endif /* moved to ppp_setting */ #if 0 /* UNUSED */ @@ -96,47 +96,47 @@ struct notifier *ip_down_notifier = NULL; /* local vars */ #if 0 /* moved to ppp_pcb */ -static int default_route_set[NUM_PPP]; /* Have set up a default route */ -static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ -static int ipcp_is_up; /* have called np_up() */ -static int ipcp_is_open; /* haven't called np_finished() */ -static bool ask_for_local; /* request our address from peer */ +static int default_route_set[NUM_PPP]; /* Have set up a default route */ +static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ +static int ipcp_is_up; /* have called np_up() */ +static int ipcp_is_open; /* haven't called np_finished() */ +static bool ask_for_local; /* request our address from peer */ #endif /* moved to ppp_pcb */ #if 0 /* UNUSED */ -static char vj_value[8]; /* string form of vj option value */ -static char netmask_str[20]; /* string form of netmask value */ +static char vj_value[8]; /* string form of vj option value */ +static char netmask_str[20]; /* string form of netmask value */ #endif /* UNUSED */ /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void ipcp_resetci(fsm *f); /* Reset our CI */ -static int ipcp_cilen(fsm *f); /* Return length of our CI */ +static void ipcp_resetci(fsm *f); /* Reset our CI */ +static int ipcp_cilen(fsm *f); /* Return length of our CI */ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI */ -static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject);/* Peer nak'd our CI */ -static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree); /* Rcv CI */ -static void ipcp_up(fsm *f); /* We're UP */ -static void ipcp_down(fsm *f); /* We're DOWN */ -static void ipcp_finished(fsm *f); /* Don't need lower layer */ +static void ipcp_up(fsm *f); /* We're UP */ +static void ipcp_down(fsm *f); /* We're DOWN */ +static void ipcp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ - ipcp_resetci, /* Reset our Configuration Information */ - ipcp_cilen, /* Length of our Configuration Information */ - ipcp_addci, /* Add our Configuration Information */ - ipcp_ackci, /* ACK our Configuration Information */ - ipcp_nakci, /* NAK our Configuration Information */ - ipcp_rejci, /* Reject our Configuration Information */ - ipcp_reqci, /* Request peer's Configuration Information */ - ipcp_up, /* Called when fsm reaches OPENED state */ - ipcp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPCP" /* String name of protocol */ + ipcp_resetci, /* Reset our Configuration Information */ + ipcp_cilen, /* Length of our Configuration Information */ + ipcp_addci, /* Add our Configuration Information */ + ipcp_ackci, /* ACK our Configuration Information */ + ipcp_nakci, /* NAK our Configuration Information */ + ipcp_rejci, /* Reject our Configuration Information */ + ipcp_reqci, /* Request peer's Configuration Information */ + ipcp_up, /* Called when fsm reaches OPENED state */ + ipcp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPCP" /* String name of protocol */ }; /* @@ -209,13 +209,13 @@ static option_t ipcp_option_list[] = { &ipcp_wantoptions[0].default_route }, { "replacedefaultroute", o_bool, - &ipcp_wantoptions[0].replace_default_route, + &ipcp_wantoptions[0].replace_default_route, "Replace default route", 1 }, { "noreplacedefaultroute", o_bool, - &ipcp_allowoptions[0].replace_default_route, + &ipcp_allowoptions[0].replace_default_route, "Never replace default route", OPT_A2COPY, - &ipcp_wantoptions[0].replace_default_route }, + &ipcp_wantoptions[0].replace_default_route }, { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, @@ -265,7 +265,7 @@ static void ipcp_input(ppp_pcb *pcb, u_char *p, int len); static void ipcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS static void ip_check_options (void); @@ -312,15 +312,15 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ -#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ -#define CILEN_ADDR 6 /* new-style single address option */ -#define CILEN_ADDRS 10 /* old-style dual address option */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ +#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ +#define CILEN_ADDR 6 /* new-style single address option */ +#define CILEN_ADDRS 10 /* old-style dual address option */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED, already defined by lwIP */ /* @@ -351,11 +351,11 @@ setvjslots(argv) int value; if (!int_option(*argv, &value)) - return 0; + return 0; if (value < 2 || value > 16) { - option_error("vj-max-slots value must be between 2 and 16"); - return 0; + option_error("vj-max-slots value must be between 2 and 16"); + return 0; } ipcp_wantoptions [0].maxslotindex = ipcp_allowoptions[0].maxslotindex = value - 1; @@ -375,21 +375,21 @@ setdnsaddr(argv) dns = inet_addr(*argv); if (dns == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-dns option", - *argv); - return 0; - } - dns = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-dns option", + *argv); + return 0; + } + dns = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].dnsaddr[1] == 0) - ipcp_allowoptions[0].dnsaddr[0] = dns; + ipcp_allowoptions[0].dnsaddr[0] = dns; else - ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; + ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].dnsaddr[1] = dns; @@ -411,21 +411,21 @@ setwinsaddr(argv) wins = inet_addr(*argv); if (wins == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-wins option", - *argv); - return 0; - } - wins = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-wins option", + *argv); + return 0; + } + wins = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].winsaddr[1] == 0) - ipcp_allowoptions[0].winsaddr[0] = wins; + ipcp_allowoptions[0].winsaddr[0] = wins; else - ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; + ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].winsaddr[1] = wins; @@ -455,52 +455,52 @@ setipaddr(arg, argv, doit) * IP address pair separated by ":". */ if ((colon = strchr(arg, ':')) == NULL) - return 0; + return 0; if (!doit) - return 1; - + return 1; + /* * If colon first character, then no local addr. */ if (colon != arg && option_priority >= prio_local) { - *colon = '\0'; - if ((local = inet_addr(arg)) == (u32_t) -1) { - if ((hp = gethostbyname(arg)) == NULL) { - option_error("unknown host: %s", arg); - return 0; - } - local = *(u32_t *)hp->h_addr; - } - if (bad_ip_adrs(local)) { - option_error("bad local IP address %s", ip_ntoa(local)); - return 0; - } - if (local != 0) - wo->ouraddr = local; - *colon = ':'; - prio_local = option_priority; - } - + *colon = '\0'; + if ((local = inet_addr(arg)) == (u32_t) -1) { + if ((hp = gethostbyname(arg)) == NULL) { + option_error("unknown host: %s", arg); + return 0; + } + local = *(u32_t *)hp->h_addr; + } + if (bad_ip_adrs(local)) { + option_error("bad local IP address %s", ip_ntoa(local)); + return 0; + } + if (local != 0) + wo->ouraddr = local; + *colon = ':'; + prio_local = option_priority; + } + /* * If colon last character, then no remote addr. */ if (*++colon != '\0' && option_priority >= prio_remote) { - if ((remote = inet_addr(colon)) == (u32_t) -1) { - if ((hp = gethostbyname(colon)) == NULL) { - option_error("unknown host: %s", colon); - return 0; - } - remote = *(u32_t *)hp->h_addr; - if (remote_name[0] == 0) - strlcpy(remote_name, colon, sizeof(remote_name)); - } - if (bad_ip_adrs(remote)) { - option_error("bad remote IP address %s", ip_ntoa(remote)); - return 0; - } - if (remote != 0) - wo->hisaddr = remote; - prio_remote = option_priority; + if ((remote = inet_addr(colon)) == (u32_t) -1) { + if ((hp = gethostbyname(colon)) == NULL) { + option_error("unknown host: %s", colon); + return 0; + } + remote = *(u32_t *)hp->h_addr; + if (remote_name[0] == 0) + strlcpy(remote_name, colon, sizeof(remote_name)); + } + if (bad_ip_adrs(remote)) { + option_error("bad remote IP address %s", ip_ntoa(remote)); + return 0; + } + if (remote != 0) + wo->hisaddr = remote; + prio_remote = option_priority; } return 1; @@ -512,13 +512,13 @@ printipaddr(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - ipcp_options *wo = &ipcp_wantoptions[0]; + ipcp_options *wo = &ipcp_wantoptions[0]; - if (wo->ouraddr != 0) - printer(arg, "%I", wo->ouraddr); - printer(arg, ":"); - if (wo->hisaddr != 0) - printer(arg, "%I", wo->hisaddr); + if (wo->ouraddr != 0) + printer(arg, "%I", wo->ouraddr); + printer(arg, ":"); + if (wo->hisaddr != 0) + printer(arg, "%I", wo->hisaddr); } /* @@ -542,8 +542,8 @@ setnetmask(argv) mask = lwip_htonl(mask); if (n == 0 || p[n] != 0 || (netmask & ~mask) != 0) { - option_error("invalid netmask value '%s'", *argv); - return 0; + option_error("invalid netmask value '%s'", *argv); + return 0; } netmask = mask; @@ -563,23 +563,23 @@ parse_dotted_ip(p, vp) v = 0; for (n = 3;; --n) { - b = strtoul(p, &endp, 0); - if (endp == p) - return 0; - if (b > 255) { - if (n < 3) - return 0; - /* accept e.g. 0xffffff00 */ - *vp = b; - return endp - p0; - } - v |= b << (n * 8); - p = endp; - if (n == 0) - break; - if (*p != '.') - return 0; - ++p; + b = strtoul(p, &endp, 0); + if (endp == p) + return 0; + if (b > 255) { + if (n < 3) + return 0; + /* accept e.g. 0xffffff00 */ + *vp = b; + return endp - p0; + } + v |= b << (n * 8); + p = endp; + if (n == 0) + break; + if (*p != '.') + return 0; + ++p; } *vp = v; return p - p0; @@ -716,23 +716,23 @@ static void ipcp_resetci(fsm *f) { ipcp_options *ao = &pcb->ipcp_allowoptions; wo->req_addr = (wo->neg_addr || wo->old_addrs) && - (ao->neg_addr || ao->old_addrs); + (ao->neg_addr || ao->old_addrs); if (wo->ouraddr == 0) - wo->accept_local = 1; + wo->accept_local = 1; if (wo->hisaddr == 0) - wo->accept_remote = 1; + wo->accept_remote = 1; #if LWIP_DNS - wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ + wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ #endif /* LWIP_DNS */ *go = *wo; if (!pcb->ask_for_local) - go->ouraddr = 0; + go->ouraddr = 0; #if 0 /* UNUSED */ if (ip_choose_hook) { - ip_choose_hook(&wo->hisaddr); - if (wo->hisaddr) { - wo->accept_remote = 0; - } + ip_choose_hook(&wo->hisaddr); + if (wo->hisaddr) { + wo->accept_remote = 0; + } } #endif /* UNUSED */ BZERO(&pcb->ipcp_hisoptions, sizeof(ipcp_options)); @@ -751,16 +751,16 @@ static int ipcp_cilen(fsm *f) { #endif /* VJ_SUPPORT */ ipcp_options *ho = &pcb->ipcp_hisoptions; -#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) +#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) #if VJ_SUPPORT -#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) +#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) #endif /* VJ_SUPPORT */ -#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) +#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) #if LWIP_DNS -#define LENCIDNS(neg) LENCIADDR(neg) +#define LENCIDNS(neg) LENCIADDR(neg) #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ -#define LENCIWINS(neg) LENCIADDR(neg) +#define LENCIWINS(neg) LENCIADDR(neg) #endif /* UNUSED - WINS */ /* @@ -768,34 +768,34 @@ static int ipcp_cilen(fsm *f) { * forms because we have received old forms from the peer. */ if (go->neg_addr && go->old_addrs && !ho->neg_addr && ho->old_addrs) - go->neg_addr = 0; + go->neg_addr = 0; #if VJ_SUPPORT if (wo->neg_vj && !go->neg_vj && !go->old_vj) { - /* try an older style of VJ negotiation */ - /* use the old style only if the peer did */ - if (ho->neg_vj && ho->old_vj) { - go->neg_vj = 1; - go->old_vj = 1; - go->vj_protocol = ho->vj_protocol; - } + /* try an older style of VJ negotiation */ + /* use the old style only if the peer did */ + if (ho->neg_vj && ho->old_vj) { + go->neg_vj = 1; + go->old_vj = 1; + go->vj_protocol = ho->vj_protocol; + } } #endif /* VJ_SUPPORT */ return (LENCIADDRS(!go->neg_addr && go->old_addrs) + #if VJ_SUPPORT - LENCIVJ(go->neg_vj, go->old_vj) + + LENCIVJ(go->neg_vj, go->old_vj) + #endif /* VJ_SUPPORT */ - LENCIADDR(go->neg_addr) + + LENCIADDR(go->neg_addr) + #if LWIP_DNS - LENCIDNS(go->req_dns1) + - LENCIDNS(go->req_dns2) + + LENCIDNS(go->req_dns1) + + LENCIDNS(go->req_dns2) + #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - LENCIWINS(go->winsaddr[0]) + - LENCIWINS(go->winsaddr[1]) + + LENCIWINS(go->winsaddr[0]) + + LENCIWINS(go->winsaddr[1]) + #endif /* UNUSED - WINS */ - 0); + 0); } @@ -810,86 +810,86 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - if (len >= CILEN_ADDRS) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDRS, ucp); \ - l = lwip_ntohl(val1); \ - PUTLONG(l, ucp); \ - l = lwip_ntohl(val2); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDRS; \ - } else \ - go->old_addrs = 0; \ + if (len >= CILEN_ADDRS) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDRS, ucp); \ + l = lwip_ntohl(val1); \ + PUTLONG(l, ucp); \ + l = lwip_ntohl(val2); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDRS; \ + } else \ + go->old_addrs = 0; \ } #if VJ_SUPPORT #define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - if (!old) { \ - PUTCHAR(maxslotindex, ucp); \ - PUTCHAR(cflag, ucp); \ - } \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + if (!old) { \ + PUTCHAR(maxslotindex, ucp); \ + PUTCHAR(cflag, ucp); \ + } \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* VJ_SUPPORT */ #define ADDCIADDR(opt, neg, val) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(val); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(val); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #if LWIP_DNS #define ADDCIDNS(opt, neg, addr) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ADDCIWINS(opt, addr) \ if (addr) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - addr = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + addr = 0; \ } #endif /* UNUSED - WINS */ ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ADDCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -905,7 +905,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); #endif /* UNUSED - WINS */ - + *lenp -= len; } @@ -915,8 +915,8 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { * Called by fsm_rconfack, Receive Configure ACK. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -936,105 +936,105 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { #define ACKCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDRS) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDRS || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val1 != cilong) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val2 != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDRS) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDRS || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val1 != cilong) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val2 != cilong) \ + goto bad; \ } #if VJ_SUPPORT #define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslotindex) \ - goto bad; \ - GETCHAR(cicflag, p); \ - if (cicflag != cflag) \ - goto bad; \ - } \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslotindex) \ + goto bad; \ + GETCHAR(cicflag, p); \ + if (cicflag != cflag) \ + goto bad; \ + } \ } #endif /* VJ_SUPPORT */ #define ACKCIADDR(opt, neg, val) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val != cilong) \ + goto bad; \ } #if LWIP_DNS #define ACKCIDNS(opt, neg, addr) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ACKCIWINS(opt, addr) \ if (addr) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* UNUSED - WINS */ ACKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ACKCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -1055,7 +1055,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -1070,8 +1070,8 @@ bad: * Calback from fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1085,8 +1085,8 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if LWIP_DNS u32_t cidnsaddr; #endif /* LWIP_DNS */ - ipcp_options no; /* options we've seen Naks for */ - ipcp_options try_; /* options to request next time */ + ipcp_options no; /* options we've seen Naks for */ + ipcp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -1098,58 +1098,58 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIADDRS(opt, neg, code) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - GETLONG(l, p); \ - ciaddr2 = lwip_htonl(l); \ - no.old_addrs = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + GETLONG(l, p); \ + ciaddr2 = lwip_htonl(l); \ + no.old_addrs = 1; \ + code \ } #if VJ_SUPPORT #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* VJ_SUPPORT */ #define NAKCIADDR(opt, neg, code) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - no.neg = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #if LWIP_DNS #define NAKCIDNS(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cidnsaddr = lwip_htonl(l); \ - no.neg = 1; \ - code \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cidnsaddr = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #endif /* LWIP_DNS */ @@ -1158,19 +1158,19 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - if (treat_as_reject) { - try_.old_addrs = 0; - } else { - if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - if (go->accept_remote && ciaddr2) { - /* take his idea of his address */ - try_.hisaddr = ciaddr2; - } - } - ); + if (treat_as_reject) { + try_.old_addrs = 0; + } else { + if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + if (go->accept_remote && ciaddr2) { + /* take his idea of his address */ + try_.hisaddr = ciaddr2; + } + } + ); #if VJ_SUPPORT /* @@ -1180,57 +1180,57 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the peer wants. */ NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - if (treat_as_reject) { - try_.neg_vj = 0; - } else if (cilen == CILEN_VJ) { - GETCHAR(cimaxslotindex, p); - GETCHAR(cicflag, p); - if (cishort == IPCP_VJ_COMP) { - try_.old_vj = 0; - if (cimaxslotindex < go->maxslotindex) - try_.maxslotindex = cimaxslotindex; - if (!cicflag) - try_.cflag = 0; - } else { - try_.neg_vj = 0; - } - } else { - if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { - try_.old_vj = 1; - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + if (treat_as_reject) { + try_.neg_vj = 0; + } else if (cilen == CILEN_VJ) { + GETCHAR(cimaxslotindex, p); + GETCHAR(cicflag, p); + if (cishort == IPCP_VJ_COMP) { + try_.old_vj = 0; + if (cimaxslotindex < go->maxslotindex) + try_.maxslotindex = cimaxslotindex; + if (!cicflag) + try_.cflag = 0; + } else { + try_.neg_vj = 0; + } + } else { + if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { + try_.old_vj = 1; + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* VJ_SUPPORT */ NAKCIADDR(CI_ADDR, neg_addr, - if (treat_as_reject) { - try_.neg_addr = 0; - try_.old_addrs = 0; - } else if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - ); + if (treat_as_reject) { + try_.neg_addr = 0; + try_.old_addrs = 0; + } else if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + ); #if LWIP_DNS NAKCIDNS(CI_MS_DNS1, req_dns1, - if (treat_as_reject) { - try_.req_dns1 = 0; - } else { - try_.dnsaddr[0] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns1 = 0; + } else { + try_.dnsaddr[0] = cidnsaddr; + } + ); NAKCIDNS(CI_MS_DNS2, req_dns2, - if (treat_as_reject) { - try_.req_dns2 = 0; - } else { - try_.dnsaddr[1] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns2 = 0; + } else { + try_.dnsaddr[1] = cidnsaddr; + } + ); #endif /* #if LWIP_DNS */ /* @@ -1242,81 +1242,81 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * peers get huffy if we don't. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* VJ_SUPPORT */ - case CI_ADDRS: - if ((!go->neg_addr && go->old_addrs) || no.old_addrs - || cilen != CILEN_ADDRS) - goto bad; - try_.neg_addr = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - GETLONG(l, p); - ciaddr2 = lwip_htonl(l); - if (ciaddr2 && go->accept_remote) - try_.hisaddr = ciaddr2; - no.old_addrs = 1; - break; - case CI_ADDR: - if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) - goto bad; - try_.old_addrs = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - if (try_.ouraddr != 0) - try_.neg_addr = 1; - no.neg_addr = 1; - break; + case CI_ADDRS: + if ((!go->neg_addr && go->old_addrs) || no.old_addrs + || cilen != CILEN_ADDRS) + goto bad; + try_.neg_addr = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + GETLONG(l, p); + ciaddr2 = lwip_htonl(l); + if (ciaddr2 && go->accept_remote) + try_.hisaddr = ciaddr2; + no.old_addrs = 1; + break; + case CI_ADDR: + if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) + goto bad; + try_.old_addrs = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + if (try_.ouraddr != 0) + try_.neg_addr = 1; + no.neg_addr = 1; + break; #if LWIP_DNS - case CI_MS_DNS1: - if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[0] = lwip_htonl(l); - try_.req_dns1 = 1; - no.req_dns1 = 1; - break; - case CI_MS_DNS2: - if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[1] = lwip_htonl(l); - try_.req_dns2 = 1; - no.req_dns2 = 1; - break; + case CI_MS_DNS1: + if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[0] = lwip_htonl(l); + try_.req_dns1 = 1; + no.req_dns1 = 1; + break; + case CI_MS_DNS2: + if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[1] = lwip_htonl(l); + try_.req_dns2 = 1; + no.req_dns2 = 1; + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - if (cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1) - try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + if (cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1) + try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; + break; #endif /* UNUSED - WINS */ - default: - break; - } - p = next; + default: + break; + } + p = next; } /* @@ -1324,7 +1324,7 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any remaining options, we ignore them. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -1347,7 +1347,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* VJ_SUPPORT */ u32_t cilong; - ipcp_options try_; /* options to request next time */ + ipcp_options try_; /* options to request next time */ try_ = *go; /* @@ -1357,107 +1357,107 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIADDRS(opt, neg, val1, val2) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val1) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val2) \ - goto bad; \ - try_.old_addrs = 0; \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val1) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val2) \ + goto bad; \ + try_.old_addrs = 0; \ } #if VJ_SUPPORT #define REJCIVJ(opt, neg, val, old, maxslot, cflag) \ if (go->neg && \ - p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslot) \ - goto bad; \ - GETCHAR(ciflag, p); \ - if (ciflag != cflag) \ - goto bad; \ + p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslot) \ + goto bad; \ + GETCHAR(ciflag, p); \ + if (ciflag != cflag) \ + goto bad; \ } \ - try_.neg = 0; \ + try_.neg = 0; \ } #endif /* VJ_SUPPORT */ #define REJCIADDR(opt, neg, val) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LWIP_DNS #define REJCIDNS(opt, neg, dnsaddr) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != dnsaddr) \ - goto bad; \ - try_.neg = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != dnsaddr) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define REJCIWINS(opt, addr) \ if (addr && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != addr) \ - goto bad; \ - try_.winsaddr[opt == CI_MS_WINS2] = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != addr) \ + goto bad; \ + try_.winsaddr[opt == CI_MS_WINS2] = 0; \ } #endif /* UNUSED - WINS */ REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - go->ouraddr, go->hisaddr); + go->ouraddr, go->hisaddr); #if VJ_SUPPORT REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ REJCIADDR(CI_ADDR, neg_addr, go->ouraddr); @@ -1478,12 +1478,12 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1508,17 +1508,17 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipcp_options *wo = &pcb->ipcp_wantoptions; ipcp_options *ho = &pcb->ipcp_hisoptions; ipcp_options *ao = &pcb->ipcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #if VJ_SUPPORT - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* VJ_SUPPORT */ u32_t tl, ciaddr1, ciaddr2;/* Parsed address values */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ #if VJ_SUPPORT u_char maxslotindex, cflag; #endif /* VJ_SUPPORT */ @@ -1530,243 +1530,243 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPCPDEBUG(("ipcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_ADDRS: - if (!ao->old_addrs || ho->neg_addr || - cilen != CILEN_ADDRS) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * If neither we nor he knows his address, reject the option. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - /* - * If he doesn't know our address, or if we both have our address - * but disagree about it, then NAK it with our idea. - */ - GETLONG(tl, p); /* Parse desination address (ours) */ - ciaddr2 = lwip_htonl(tl); - if (ciaddr2 != wo->ouraddr) { - if (ciaddr2 == 0 || !wo->accept_local) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->ouraddr); - PUTLONG(tl, p); - } - } else { - wo->ouraddr = ciaddr2; /* accept peer's idea */ - } - } - - ho->old_addrs = 1; - ho->hisaddr = ciaddr1; - ho->ouraddr = ciaddr2; - break; - - case CI_ADDR: - if (!ao->neg_addr || ho->old_addrs || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * Don't ACK an address of 0.0.0.0 - reject it instead. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - ho->neg_addr = 1; - ho->hisaddr = ciaddr1; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPCPDEBUG(("ipcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_ADDRS: + if (!ao->old_addrs || ho->neg_addr || + cilen != CILEN_ADDRS) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * If neither we nor he knows his address, reject the option. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + /* + * If he doesn't know our address, or if we both have our address + * but disagree about it, then NAK it with our idea. + */ + GETLONG(tl, p); /* Parse desination address (ours) */ + ciaddr2 = lwip_htonl(tl); + if (ciaddr2 != wo->ouraddr) { + if (ciaddr2 == 0 || !wo->accept_local) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->ouraddr); + PUTLONG(tl, p); + } + } else { + wo->ouraddr = ciaddr2; /* accept peer's idea */ + } + } + + ho->old_addrs = 1; + ho->hisaddr = ciaddr1; + ho->ouraddr = ciaddr2; + break; + + case CI_ADDR: + if (!ao->neg_addr || ho->old_addrs || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * Don't ACK an address of 0.0.0.0 - reject it instead. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + ho->neg_addr = 1; + ho->hisaddr = ciaddr1; + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - /* Microsoft primary or secondary DNS request */ - d = citype == CI_MS_DNS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->dnsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->dnsaddr[d]) { + case CI_MS_DNS1: + case CI_MS_DNS2: + /* Microsoft primary or secondary DNS request */ + d = citype == CI_MS_DNS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->dnsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->dnsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->dnsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->dnsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - /* Microsoft primary or secondary WINS request */ - d = citype == CI_MS_WINS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->winsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->winsaddr[d]) { + case CI_MS_WINS1: + case CI_MS_WINS2: + /* Microsoft primary or secondary WINS request */ + d = citype == CI_MS_WINS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->winsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->winsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->winsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->winsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* UNUSED - WINS */ #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (!ao->neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - if (!(cishort == IPCP_VJ_COMP || - (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - if (cilen == CILEN_VJ) { - GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(ao->maxslotindex, p); - } - } - GETCHAR(cflag, p); - if (cflag && !ao->cflag) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(wo->cflag, p); - } - } - ho->maxslotindex = maxslotindex; - ho->cflag = cflag; - } else { - ho->old_vj = 1; - ho->maxslotindex = MAX_STATES - 1; - ho->cflag = 1; - } - break; + case CI_COMPRESSTYPE: + if (!ao->neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + if (!(cishort == IPCP_VJ_COMP || + (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + if (cilen == CILEN_VJ) { + GETCHAR(maxslotindex, p); + if (maxslotindex > ao->maxslotindex) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(ao->maxslotindex, p); + } + } + GETCHAR(cflag, p); + if (cflag && !ao->cflag) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(wo->cflag, p); + } + } + ho->maxslotindex = maxslotindex; + ho->cflag = cflag; + } else { + ho->old_vj = 1; + ho->maxslotindex = MAX_STATES - 1; + ho->cflag = 1; + } + break; #endif /* VJ_SUPPORT */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1777,21 +1777,21 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs && - wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_addr = 0; /* don't ask again */ - } - PUTCHAR(CI_ADDR, ucp); - PUTCHAR(CILEN_ADDR, ucp); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, ucp); - } - - *len = ucp - inp; /* Compute output length */ + wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_addr = 0; /* don't ask again */ + } + PUTCHAR(CI_ADDR, ucp); + PUTCHAR(CILEN_ADDR, ucp); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, ucp); + } + + *len = ucp - inp; /* Compute output length */ IPCPDEBUG(("ipcp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -1812,17 +1812,17 @@ ip_check_options() * If local IP address already given, don't bother. */ if (wo->ouraddr == 0 && !disable_defaultip) { - /* - * Look up our hostname (possibly with domain name appended) - * and take the first IP address as our local IP address. - * If there isn't an IP address for our hostname, too bad. - */ - wo->accept_local = 1; /* don't insist on this default value */ - if ((hp = gethostbyname(hostname)) != NULL) { - local = *(u32_t *)hp->h_addr; - if (local != 0 && !bad_ip_adrs(local)) - wo->ouraddr = local; - } + /* + * Look up our hostname (possibly with domain name appended) + * and take the first IP address as our local IP address. + * If there isn't an IP address for our hostname, too bad. + */ + wo->accept_local = 1; /* don't insist on this default value */ + if ((hp = gethostbyname(hostname)) != NULL) { + local = *(u32_t *)hp->h_addr; + if (local != 0 && !bad_ip_adrs(local)) + wo->ouraddr = local; + } } ask_for_local = wo->ouraddr != 0 || !disable_defaultip; } @@ -1841,37 +1841,37 @@ ip_demand_conf(u) ipcp_options *wo = &ipcp_wantoptions[u]; if (wo->hisaddr == 0 && !pcb->settings.noremoteip) { - /* make up an arbitrary address for the peer */ - wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); - wo->accept_remote = 1; + /* make up an arbitrary address for the peer */ + wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); + wo->accept_remote = 1; } if (wo->ouraddr == 0) { - /* make up an arbitrary address for us */ - wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); - wo->accept_local = 1; - ask_for_local = 0; /* don't tell the peer this address */ + /* make up an arbitrary address for us */ + wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); + wo->accept_local = 1; + ask_for_local = 0; /* don't tell the peer this address */ } if (!sifaddr(pcb, wo->ouraddr, wo->hisaddr, get_mask(wo->ouraddr))) - return 0; + return 0; if (!sifup(pcb)) - return 0; + return 0; if (!sifnpmode(pcb, PPP_IP, NPMODE_QUEUE)) - return 0; + return 0; #if 0 /* UNUSED */ if (wo->default_route) - if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, - wo->replace_default_route)) - default_route_set[u] = 1; + if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, + wo->replace_default_route)) + default_route_set[u] = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ if (wo->proxy_arp) - if (sifproxyarp(pcb, wo->hisaddr)) - proxy_arp_set[u] = 1; + if (sifproxyarp(pcb, wo->hisaddr)) + proxy_arp_set[u] = 1; #endif /* UNUSED - PROXY ARP */ ppp_notice("local IP address %I", wo->ouraddr); if (wo->hisaddr) - ppp_notice("remote IP address %I", wo->hisaddr); + ppp_notice("remote IP address %I", wo->hisaddr); return 1; } @@ -1895,46 +1895,46 @@ static void ipcp_up(fsm *f) { * We must have a non-zero IP address for both ends of the link. */ if (!ho->neg_addr && !ho->old_addrs) - ho->hisaddr = wo->hisaddr; + ho->hisaddr = wo->hisaddr; if (!(go->neg_addr || go->old_addrs) && (wo->neg_addr || wo->old_addrs) - && wo->ouraddr != 0) { - ppp_error("Peer refused to agree to our IP address"); - ipcp_close(f->pcb, "Refused our IP address"); - return; + && wo->ouraddr != 0) { + ppp_error("Peer refused to agree to our IP address"); + ipcp_close(f->pcb, "Refused our IP address"); + return; } if (go->ouraddr == 0) { - ppp_error("Could not determine local IP address"); - ipcp_close(f->pcb, "Could not determine local IP address"); - return; + ppp_error("Could not determine local IP address"); + ipcp_close(f->pcb, "Could not determine local IP address"); + return; } if (ho->hisaddr == 0 && !pcb->settings.noremoteip) { - ho->hisaddr = lwip_htonl(0x0a404040); - ppp_warn("Could not determine remote IP address: defaulting to %I", - ho->hisaddr); + ho->hisaddr = lwip_htonl(0x0a404040); + ppp_warn("Could not determine remote IP address: defaulting to %I", + ho->hisaddr); } #if 0 /* UNUSED */ script_setenv("IPLOCAL", ip_ntoa(go->ouraddr), 0); if (ho->hisaddr != 0) - script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); + script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); #endif /* UNUSED */ #if LWIP_DNS if (!go->req_dns1) - go->dnsaddr[0] = 0; + go->dnsaddr[0] = 0; if (!go->req_dns2) - go->dnsaddr[1] = 0; + go->dnsaddr[1] = 0; #if 0 /* UNUSED */ if (go->dnsaddr[0]) - script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); + script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); if (go->dnsaddr[1]) - script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); + script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); #endif /* UNUSED */ if (pcb->settings.usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { - sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #if 0 /* UNUSED */ - script_setenv("USEPEERDNS", "1", 0); - create_resolv(go->dnsaddr[0], go->dnsaddr[1]); + script_setenv("USEPEERDNS", "1", 0); + create_resolv(go->dnsaddr[0], go->dnsaddr[1]); #endif /* UNUSED */ } #endif /* LWIP_DNS */ @@ -1943,29 +1943,29 @@ static void ipcp_up(fsm *f) { * Check that the peer is allowed to use the IP address it wants. */ if (ho->hisaddr != 0) { - u32_t addr = lwip_ntohl(ho->hisaddr); - if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET - || IP_MULTICAST(addr) || IP_BADCLASS(addr) - /* - * For now, consider that PPP in server mode with peer required - * to authenticate must provide the peer IP address, reject any - * IP address wanted by peer different than the one we wanted. - */ + u32_t addr = lwip_ntohl(ho->hisaddr); + if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET + || IP_MULTICAST(addr) || IP_BADCLASS(addr) + /* + * For now, consider that PPP in server mode with peer required + * to authenticate must provide the peer IP address, reject any + * IP address wanted by peer different than the one we wanted. + */ #if PPP_SERVER && PPP_AUTH_SUPPORT - || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) + || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) #endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ - ) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(pcb, "Unauthorized remote IP address"); - return; - } + ) { + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(pcb, "Unauthorized remote IP address"); + return; + } } #if 0 /* Unused */ /* Upstream checking code */ if (ho->hisaddr != 0 && !auth_ip_addr(f->unit, ho->hisaddr)) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(f->unit, "Unauthorized remote IP address"); - return; + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(f->unit, "Unauthorized remote IP address"); + return; } #endif /* Unused */ @@ -1981,114 +1981,114 @@ static void ipcp_up(fsm *f) { * interface to pass IP packets. */ if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { - ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, - wo->replace_default_route); - if (go->ouraddr != wo->ouraddr) { - ppp_warn("Local IP address changed to %I", go->ouraddr); - script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); - wo->ouraddr = go->ouraddr; - } else - script_unsetenv("OLDIPLOCAL"); - if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { - ppp_warn("Remote IP address changed to %I", ho->hisaddr); - script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); - wo->hisaddr = ho->hisaddr; - } else - script_unsetenv("OLDIPREMOTE"); - - /* Set the interface to the new addresses */ - mask = get_mask(go->ouraddr); - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { + ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, + wo->replace_default_route); + if (go->ouraddr != wo->ouraddr) { + ppp_warn("Local IP address changed to %I", go->ouraddr); + script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); + wo->ouraddr = go->ouraddr; + } else + script_unsetenv("OLDIPLOCAL"); + if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { + ppp_warn("Remote IP address changed to %I", ho->hisaddr); + script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); + wo->hisaddr = ho->hisaddr; + } else + script_unsetenv("OLDIPREMOTE"); + + /* Set the interface to the new addresses */ + mask = get_mask(go->ouraddr); + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - default_route_set[f->unit] = 1; + /* assign a default route through the interface if required */ + if (ipcp_wantoptions[f->unit].default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + default_route_set[f->unit] = 1; #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - proxy_arp_set[f->unit] = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + proxy_arp_set[f->unit] = 1; #endif /* UNUSED - PROXY ARP */ - } - demand_rexmit(PPP_IP,go->ouraddr); - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + } + demand_rexmit(PPP_IP,go->ouraddr); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set IP addresses and (if specified) netmask. - */ - mask = get_mask(go->ouraddr); + /* + * Set IP addresses and (if specified) netmask. + */ + mask = get_mask(go->ouraddr); #if !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #endif - /* bring the interface up for IP */ - if (!sifup(pcb)) { + /* bring the interface up for IP */ + if (!sifup(pcb)) { #if PPP_DEBUG - ppp_warn("Interface failed to come up"); + ppp_warn("Interface failed to come up"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #if (defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } #endif #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ #if 0 /* UNUSED */ - /* assign a default route through the interface if required */ - if (wo->default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - pcb->default_route_set = 1; + /* assign a default route through the interface if required */ + if (wo->default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + pcb->default_route_set = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && wo->proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - pcb->proxy_arp_set = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && wo->proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + pcb->proxy_arp_set = 1; #endif /* UNUSED - PROXY ARP */ - wo->ouraddr = go->ouraddr; + wo->ouraddr = go->ouraddr; - ppp_notice("local IP address %I", go->ouraddr); - if (ho->hisaddr != 0) - ppp_notice("remote IP address %I", ho->hisaddr); + ppp_notice("local IP address %I", go->ouraddr); + if (ho->hisaddr != 0) + ppp_notice("remote IP address %I", ho->hisaddr); #if LWIP_DNS - if (go->dnsaddr[0]) - ppp_notice("primary DNS address %I", go->dnsaddr[0]); - if (go->dnsaddr[1]) - ppp_notice("secondary DNS address %I", go->dnsaddr[1]); + if (go->dnsaddr[0]) + ppp_notice("primary DNS address %I", go->dnsaddr[0]); + if (go->dnsaddr[1]) + ppp_notice("secondary DNS address %I", go->dnsaddr[1]); #endif /* LWIP_DNS */ } @@ -2104,7 +2104,7 @@ static void ipcp_up(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_up_hook) - ip_up_hook(); + ip_up_hook(); #endif /* UNUSED */ } @@ -2133,11 +2133,11 @@ static void ipcp_down(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_down_hook) - ip_down_hook(); + ip_down_hook(); #endif /* UNUSED */ if (pcb->ipcp_is_up) { - pcb->ipcp_is_up = 0; - np_down(pcb, PPP_IP); + pcb->ipcp_is_up = 0; + np_down(pcb, PPP_IP); } #if VJ_SUPPORT sifvjcomp(pcb, 0, 0, 0); @@ -2145,8 +2145,8 @@ static void ipcp_down(fsm *f) { #if PPP_STATS_SUPPORT print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), - * because print_link_stats() sets link_stats_valid - * to 0 (zero) */ + * because print_link_stats() sets link_stats_valid + * to 0 (zero) */ #endif /* PPP_STATS_SUPPORT */ #if DEMAND_SUPPORT @@ -2155,18 +2155,18 @@ static void ipcp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); + sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_DROP); + sifnpmode(pcb, PPP_IP, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - sifdown(pcb); - ipcp_clear_addrs(pcb, go->ouraddr, - ho->hisaddr, 0); + sifdown(pcb); + ipcp_clear_addrs(pcb, go->ouraddr, + ho->hisaddr, 0); #if LWIP_DNS - cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #endif /* LWIP_DNS */ } } @@ -2181,8 +2181,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re #if 0 /* UNUSED - PROXY ARP */ if (pcb->proxy_arp_set) { - cifproxyarp(pcb, hisaddr); - pcb->proxy_arp_set = 0; + cifproxyarp(pcb, hisaddr); + pcb->proxy_arp_set = 0; } #endif /* UNUSED - PROXY ARP */ #if 0 /* UNUSED */ @@ -2195,8 +2195,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * is one saved by an sifdefaultroute with replacedefaultroute. */ if (!replacedefaultroute && pcb->default_route_set) { - cifdefaultroute(pcb, ouraddr, hisaddr); - pcb->default_route_set = 0; + cifdefaultroute(pcb, ouraddr, hisaddr); + pcb->default_route_set = 0; } #endif /* UNUSED */ cifaddr(pcb, ouraddr, hisaddr); @@ -2207,11 +2207,11 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * ipcp_finished - possibly shut down the lower layers. */ static void ipcp_finished(fsm *f) { - ppp_pcb *pcb = f->pcb; - if (pcb->ipcp_is_open) { - pcb->ipcp_is_open = 0; - np_finished(pcb, PPP_IP); - } + ppp_pcb *pcb = f->pcb; + if (pcb->ipcp_is_open) { + pcb->ipcp_is_open = 0; + np_finished(pcb, PPP_IP); + } } @@ -2237,7 +2237,7 @@ static const char* const ipcp_codenames[] = { }; static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #if VJ_SUPPORT @@ -2246,18 +2246,18 @@ static int ipcp_printpkt(const u_char *p, int plen, u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipcp_codenames)) - printer(arg, " %s", ipcp_codenames[code-1]); + printer(arg, " %s", ipcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2265,98 +2265,98 @@ static int ipcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_ADDRS: - if (olen == CILEN_ADDRS) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addrs %I", lwip_htonl(cilong)); - GETLONG(cilong, p); - printer(arg, " %I", lwip_htonl(cilong)); - } - break; + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_ADDRS: + if (olen == CILEN_ADDRS) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addrs %I", lwip_htonl(cilong)); + GETLONG(cilong, p); + printer(arg, " %I", lwip_htonl(cilong)); + } + break; #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - switch (cishort) { - case IPCP_VJ_COMP: - printer(arg, "VJ"); - break; - case IPCP_VJ_COMP_OLD: - printer(arg, "old-VJ"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + switch (cishort) { + case IPCP_VJ_COMP: + printer(arg, "VJ"); + break; + case IPCP_VJ_COMP_OLD: + printer(arg, "old-VJ"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* VJ_SUPPORT */ - case CI_ADDR: - if (olen == CILEN_ADDR) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addr %I", lwip_htonl(cilong)); - } - break; + case CI_ADDR: + if (olen == CILEN_ADDR) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addr %I", lwip_htonl(cilong)); + } + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), - htonl(cilong)); - break; + case CI_MS_DNS1: + case CI_MS_DNS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), + htonl(cilong)); + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-wins %I", lwip_htonl(cilong)); - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-wins %I", lwip_htonl(cilong)); + break; #endif /* UNUSED - WINS */ - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -2369,25 +2369,25 @@ static int ipcp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP_HDRLEN 20 /* bytes */ -#define IP_OFFMASK 0x1fff +#define IP_HDRLEN 20 /* bytes */ +#define IP_OFFMASK 0x1fff #ifndef IPPROTO_TCP -#define IPPROTO_TCP 6 +#define IPPROTO_TCP 6 #endif -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define net_short(x) (((x)[0] << 8) + (x)[1]) -#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) -#define get_ipoff(x) net_short((unsigned char *)(x) + 6) -#define get_ipproto(x) (((unsigned char *)(x))[9]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define net_short(x) (((x)[0] << 8) + (x)[1]) +#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) +#define get_ipoff(x) net_short((unsigned char *)(x) + 6) +#define get_ipproto(x) (((unsigned char *)(x))[9]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ip_active_pkt(pkt, len) @@ -2400,17 +2400,17 @@ ip_active_pkt(pkt, len) len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP_HDRLEN) - return 0; + return 0; if ((get_ipoff(pkt) & IP_OFFMASK) != 0) - return 0; + return 0; if (get_ipproto(pkt) != IPPROTO_TCP) - return 1; + return 1; hlen = get_iphl(pkt) * 4; if (len < hlen + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + hlen; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c b/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c index 11c18df743..47521eeb02 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -135,11 +135,11 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ + * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ */ /* - * @todo: + * @todo: * * Proxy Neighbour Discovery. * @@ -188,21 +188,21 @@ static void ipv6cp_down(fsm *f); /* We're DOWN */ static void ipv6cp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ - ipv6cp_resetci, /* Reset our Configuration Information */ - ipv6cp_cilen, /* Length of our Configuration Information */ - ipv6cp_addci, /* Add our Configuration Information */ - ipv6cp_ackci, /* ACK our Configuration Information */ - ipv6cp_nakci, /* NAK our Configuration Information */ - ipv6cp_rejci, /* Reject our Configuration Information */ - ipv6cp_reqci, /* Request peer's Configuration Information */ - ipv6cp_up, /* Called when fsm reaches OPENED state */ - ipv6cp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipv6cp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPV6CP" /* String name of protocol */ + ipv6cp_resetci, /* Reset our Configuration Information */ + ipv6cp_cilen, /* Length of our Configuration Information */ + ipv6cp_addci, /* Add our Configuration Information */ + ipv6cp_ackci, /* ACK our Configuration Information */ + ipv6cp_nakci, /* NAK our Configuration Information */ + ipv6cp_rejci, /* Reject our Configuration Information */ + ipv6cp_reqci, /* Request peer's Configuration Information */ + ipv6cp_up, /* Called when fsm reaches OPENED state */ + ipv6cp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipv6cp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPV6CP" /* String name of protocol */ }; #if PPP_OPTIONS @@ -211,7 +211,7 @@ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ */ static int setifaceid(char **arg)); static void printifaceid(option_t *, - void (*)(void *, char *, ...), void *)); + void (*)(void *, char *, ...), void *)); static option_t ipv6cp_option_list[] = { { "ipv6", o_special, (void *)setifaceid, @@ -265,7 +265,7 @@ static int ipv6_demand_conf(int u); #endif /* DEMAND_SUPPORT */ #if PRINTPKT_SUPPORT static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg); + void (*printer)(void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if DEMAND_SUPPORT static int ipv6_active_pkt(u_char *pkt, int len); @@ -309,12 +309,12 @@ static void ipv6cp_script_done(void *)); /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ -#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ +#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED */ /* @@ -344,49 +344,49 @@ setifaceid(argv) static int prio_local, prio_remote; #define VALIDID(a) ( (((a).s6_addr32[0] == 0) && ((a).s6_addr32[1] == 0)) && \ - (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) - + (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) + arg = *argv; if ((comma = strchr(arg, ',')) == NULL) - comma = arg + strlen(arg); - - /* + comma = arg + strlen(arg); + + /* * If comma first character, then no local identifier */ if (comma != arg) { - c = *comma; - *comma = '\0'; - - if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (local): %s", arg); - return 0; - } - - if (option_priority >= prio_local) { - eui64_copy(addr.s6_addr32[2], wo->ourid); - wo->opt_local = 1; - prio_local = option_priority; - } - *comma = c; + c = *comma; + *comma = '\0'; + + if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (local): %s", arg); + return 0; + } + + if (option_priority >= prio_local) { + eui64_copy(addr.s6_addr32[2], wo->ourid); + wo->opt_local = 1; + prio_local = option_priority; + } + *comma = c; } - + /* * If comma last character, the no remote identifier */ if (*comma != 0 && *++comma != '\0') { - if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (remote): %s", comma); - return 0; - } - if (option_priority >= prio_remote) { - eui64_copy(addr.s6_addr32[2], wo->hisid); - wo->opt_remote = 1; - prio_remote = option_priority; - } + if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (remote): %s", comma); + return 0; + } + if (option_priority >= prio_remote) { + eui64_copy(addr.s6_addr32[2], wo->hisid); + wo->opt_remote = 1; + prio_remote = option_priority; + } } if (override_value("+ipv6", option_priority, option_source)) - ipv6cp_protent.enabled_flag = 1; + ipv6cp_protent.enabled_flag = 1; return 1; } @@ -396,13 +396,13 @@ printifaceid(opt, printer, arg) void (*printer)(void *, char *, ...)); void *arg; { - ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; - if (wo->opt_local) - printer(arg, "%s", llv6_ntoa(wo->ourid)); - printer(arg, ","); - if (wo->opt_remote) - printer(arg, "%s", llv6_ntoa(wo->hisid)); + if (wo->opt_local) + printer(arg, "%s", llv6_ntoa(wo->ourid)); + printer(arg, ","); + if (wo->opt_remote) + printer(arg, "%s", llv6_ntoa(wo->hisid)); } #endif /* PPP_OPTIONS */ @@ -513,13 +513,13 @@ static void ipv6cp_resetci(fsm *f) { ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; wo->req_ifaceid = wo->neg_ifaceid && ao->neg_ifaceid; - + if (!wo->opt_local) { - eui64_magic_nz(wo->ourid); + eui64_magic_nz(wo->ourid); } - + *go = *wo; - eui64_zero(go->hisid); /* last proposed interface identifier */ + eui64_zero(go->hisid); /* last proposed interface identifier */ } @@ -531,15 +531,15 @@ static int ipv6cp_cilen(fsm *f) { ipv6cp_options *go = &pcb->ipv6cp_gotoptions; #ifdef IPV6CP_COMP -#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) +#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) #endif /* IPV6CP_COMP */ -#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) +#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) return (LENCIIFACEID(go->neg_ifaceid) + #ifdef IPV6CP_COMP - LENCIVJ(go->neg_vj) + + LENCIVJ(go->neg_vj) + #endif /* IPV6CP_COMP */ - 0); + 0); } @@ -554,27 +554,27 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { #ifdef IPV6CP_COMP #define ADDCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = CILEN_COMPRESS; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* IPV6CP_COMP */ #define ADDCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if (len >= idlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(idlen, ucp); \ - eui64_put(val1, ucp); \ - len -= idlen; \ - } else \ - neg = 0; \ + int idlen = CILEN_IFACEID; \ + if (len >= idlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(idlen, ucp); \ + eui64_put(val1, ucp); \ + len -= idlen; \ + } else \ + neg = 0; \ } ADDCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -591,8 +591,8 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { * ipv6cp_ackci - Ack our CIs. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -612,33 +612,33 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { #ifdef IPV6CP_COMP #define ACKCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + int vjlen = CILEN_COMPRESS; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #endif /* IPV6CP_COMP */ #define ACKCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if ((len -= idlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != idlen || \ - citype != opt) \ - goto bad; \ - eui64_get(ifaceid, p); \ - if (! eui64_equals(val1, ifaceid)) \ - goto bad; \ + int idlen = CILEN_IFACEID; \ + if ((len -= idlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != idlen || \ + citype != opt) \ + goto bad; \ + eui64_get(ifaceid, p); \ + if (! eui64_equals(val1, ifaceid)) \ + goto bad; \ } ACKCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -651,7 +651,7 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -665,8 +665,8 @@ bad: * or if IPV6CP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -676,8 +676,8 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options no; /* options we've seen Naks for */ - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options no; /* options we've seen Naks for */ + ipv6cp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -689,26 +689,26 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIIFACEID(opt, neg, code) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - no.neg = 1; \ - code \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + no.neg = 1; \ + code \ } #ifdef IPV6CP_COMP #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* IPV6CP_COMP */ @@ -718,27 +718,27 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIIFACEID(CI_IFACEID, neg_ifaceid, - if (treat_as_reject) { - try_.neg_ifaceid = 0; - } else if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); - } - ); + if (treat_as_reject) { + try_.neg_ifaceid = 0; + } else if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); + } + ); #ifdef IPV6CP_COMP NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - { - if (cishort == IPV6CP_COMP && !treat_as_reject) { - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + { + if (cishort == IPV6CP_COMP && !treat_as_reject) { + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* IPV6CP_COMP */ /* @@ -748,49 +748,49 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they want us to ask for compression, we refuse. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) - goto bad; - try_.neg_ifaceid = 1; - eui64_get(ifaceid, p); - if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - } - no.neg_ifaceid = 1; - break; - default: - break; - } - p = next; + case CI_IFACEID: + if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) + goto bad; + try_.neg_ifaceid = 1; + eui64_get(ifaceid, p); + if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + } + no.neg_ifaceid = 1; + break; + default: + break; + } + p = next; } /* If there is still anything left, this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * OK, the Nak is good. Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -811,7 +811,7 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options try_; /* options to request next time */ try_ = *go; /* @@ -821,31 +821,31 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIIFACEID(opt, neg, val1) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - /* Check rejected value. */ \ - if (! eui64_equals(ifaceid, val1)) \ - goto bad; \ - try_.neg = 0; \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + /* Check rejected value. */ \ + if (! eui64_equals(ifaceid, val1)) \ + goto bad; \ + try_.neg = 0; \ } #ifdef IPV6CP_COMP #define REJCIVJ(opt, neg, val) \ if (go->neg && \ - p[1] == CILEN_COMPRESS && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + p[1] == CILEN_COMPRESS && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* IPV6CP_COMP */ @@ -859,12 +859,12 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -890,150 +890,150 @@ static int ipv6cp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; ipv6cp_options *go = &pcb->ipv6cp_gotoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #ifdef IPV6CP_COMP - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* IPV6CP_COMP */ - eui64_t ifaceid; /* Parsed interface identifier */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + eui64_t ifaceid; /* Parsed interface identifier */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ /* * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_IFACEID: - IPV6CPDEBUG(("ipv6cp: received interface identifier ")); - - if (!ao->neg_ifaceid || - cilen != CILEN_IFACEID) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no interface identifier, or if we both have same - * identifier then NAK it with new idea. - * In particular, if we don't know his identifier, but he does, - * then accept it. - */ - eui64_get(ifaceid, p); - IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); - if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { - orc = CONFREJ; /* Reject CI */ - break; - } - if (!eui64_iszero(wo->hisid) && - !eui64_equals(ifaceid, wo->hisid) && - eui64_iszero(go->hisid)) { - - orc = CONFNAK; - ifaceid = wo->hisid; - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } else - if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { - orc = CONFNAK; - if (eui64_iszero(go->hisid)) /* first time, try option */ - ifaceid = wo->hisid; - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->ourid)) /* bad luck */ - eui64_magic(ifaceid); - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } - - ho->neg_ifaceid = 1; - ho->hisid = ifaceid; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_IFACEID: + IPV6CPDEBUG(("ipv6cp: received interface identifier ")); + + if (!ao->neg_ifaceid || + cilen != CILEN_IFACEID) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no interface identifier, or if we both have same + * identifier then NAK it with new idea. + * In particular, if we don't know his identifier, but he does, + * then accept it. + */ + eui64_get(ifaceid, p); + IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); + if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { + orc = CONFREJ; /* Reject CI */ + break; + } + if (!eui64_iszero(wo->hisid) && + !eui64_equals(ifaceid, wo->hisid) && + eui64_iszero(go->hisid)) { + + orc = CONFNAK; + ifaceid = wo->hisid; + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } else + if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { + orc = CONFNAK; + if (eui64_iszero(go->hisid)) /* first time, try option */ + ifaceid = wo->hisid; + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->ourid)) /* bad luck */ + eui64_magic(ifaceid); + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } + + ho->neg_ifaceid = 1; + ho->hisid = ifaceid; + break; #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); - if (!ao->neg_vj || - (cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - IPV6CPDEBUG(("(%d)", cishort)); - - if (!(cishort == IPV6CP_COMP)) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - break; + case CI_COMPRESSTYPE: + IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); + if (!ao->neg_vj || + (cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + IPV6CPDEBUG(("(%d)", cishort)); + + if (!(cishort == IPV6CP_COMP)) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + break; #endif /* IPV6CP_COMP */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); - - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); + + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1044,20 +1044,20 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_ifaceid && - wo->req_ifaceid && !reject_if_disagree) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_ifaceid = 0; /* don't ask again */ - } - PUTCHAR(CI_IFACEID, ucp); - PUTCHAR(CILEN_IFACEID, ucp); - eui64_put(wo->hisid, ucp); + wo->req_ifaceid && !reject_if_disagree) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_ifaceid = 0; /* don't ask again */ + } + PUTCHAR(CI_IFACEID, ucp); + PUTCHAR(CILEN_IFACEID, ucp); + eui64_put(wo->hisid, ucp); } - *len = ucp - inp; /* Compute output length */ + *len = ucp - inp; /* Compute output length */ IPV6CPDEBUG(("ipv6cp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } #if PPP_OPTIONS @@ -1069,7 +1069,7 @@ static void ipv6_check_options() { ipv6cp_options *wo = &ipv6cp_wantoptions[0]; if (!ipv6cp_protent.enabled_flag) - return; + return; /* * Persistent link-local id is only used when user has not explicitly @@ -1077,42 +1077,42 @@ static void ipv6_check_options() { */ if ((wo->use_persistent) && (!wo->opt_local) && (!wo->opt_remote)) { - /* - * On systems where there are no Ethernet interfaces used, there - * may be other ways to obtain a persistent id. Right now, it - * will fall back to using magic [see eui64_magic] below when - * an EUI-48 from MAC address can't be obtained. Other possibilities - * include obtaining EEPROM serial numbers, or some other unique - * yet persistent number. On Sparc platforms, this is possible, - * but too bad there's no standards yet for x86 machines. - */ - if (ether_to_eui64(&wo->ourid)) { - wo->opt_local = 1; - } + /* + * On systems where there are no Ethernet interfaces used, there + * may be other ways to obtain a persistent id. Right now, it + * will fall back to using magic [see eui64_magic] below when + * an EUI-48 from MAC address can't be obtained. Other possibilities + * include obtaining EEPROM serial numbers, or some other unique + * yet persistent number. On Sparc platforms, this is possible, + * but too bad there's no standards yet for x86 machines. + */ + if (ether_to_eui64(&wo->ourid)) { + wo->opt_local = 1; + } + } + + if (!wo->opt_local) { /* init interface identifier */ + if (wo->use_ip && eui64_iszero(wo->ourid)) { + eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); + if (!eui64_iszero(wo->ourid)) + wo->opt_local = 1; } - if (!wo->opt_local) { /* init interface identifier */ - if (wo->use_ip && eui64_iszero(wo->ourid)) { - eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); - if (!eui64_iszero(wo->ourid)) - wo->opt_local = 1; - } - - while (eui64_iszero(wo->ourid)) - eui64_magic(wo->ourid); + while (eui64_iszero(wo->ourid)) + eui64_magic(wo->ourid); } if (!wo->opt_remote) { - if (wo->use_ip && eui64_iszero(wo->hisid)) { - eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); - if (!eui64_iszero(wo->hisid)) - wo->opt_remote = 1; - } + if (wo->use_ip && eui64_iszero(wo->hisid)) { + eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); + if (!eui64_iszero(wo->hisid)) + wo->opt_remote = 1; + } } if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) { - option_error("local/remote LL address required for demand-dialling\n"); - exit(1); + option_error("local/remote LL address required for demand-dialling\n"); + exit(1); } } #endif /* PPP_OPTIONS */ @@ -1126,13 +1126,13 @@ static int ipv6_demand_conf(int u) { ipv6cp_options *wo = &ipv6cp_wantoptions[u]; if (!sif6up(u)) - return 0; + return 0; if (!sif6addr(u, wo->ourid, wo->hisid)) - return 0; + return 0; if (!sifnpmode(u, PPP_IPV6, NPMODE_QUEUE)) - return 0; + return 0; ppp_notice("ipv6_demand_conf"); ppp_notice("local LL address %s", llv6_ntoa(wo->ourid)); @@ -1160,26 +1160,26 @@ static void ipv6cp_up(fsm *f) { * We must have a non-zero LL address for both ends of the link. */ if (!ho->neg_ifaceid) - ho->hisid = wo->hisid; + ho->hisid = wo->hisid; #if 0 /* UNUSED */ if(!no_ifaceid_neg) { #endif /* UNUSED */ - if (eui64_iszero(ho->hisid)) { - ppp_error("Could not determine remote LL address"); - ipv6cp_close(f->pcb, "Could not determine remote LL address"); - return; - } - if (eui64_iszero(go->ourid)) { - ppp_error("Could not determine local LL address"); - ipv6cp_close(f->pcb, "Could not determine local LL address"); - return; - } - if (eui64_equals(go->ourid, ho->hisid)) { - ppp_error("local and remote LL addresses are equal"); - ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); - return; - } + if (eui64_iszero(ho->hisid)) { + ppp_error("Could not determine remote LL address"); + ipv6cp_close(f->pcb, "Could not determine remote LL address"); + return; + } + if (eui64_iszero(go->ourid)) { + ppp_error("Could not determine local LL address"); + ipv6cp_close(f->pcb, "Could not determine local LL address"); + return; + } + if (eui64_equals(go->ourid, ho->hisid)) { + ppp_error("local and remote LL addresses are equal"); + ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); + return; + } #if 0 /* UNUSED */ } #endif /* UNUSED */ @@ -1200,52 +1200,52 @@ static void ipv6cp_up(fsm *f) { * interface to pass IPv6 packets. */ if (demand) { - if (! eui64_equals(go->ourid, wo->ourid) || - ! eui64_equals(ho->hisid, wo->hisid)) { - if (! eui64_equals(go->ourid, wo->ourid)) - warn("Local LL address changed to %s", - llv6_ntoa(go->ourid)); - if (! eui64_equals(ho->hisid, wo->hisid)) - warn("Remote LL address changed to %s", - llv6_ntoa(ho->hisid)); - ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); - - /* Set the interface to the new addresses */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - if (debug) - warn("sif6addr failed"); - ipv6cp_close(f->unit, "Interface configuration failed"); - return; - } - - } - demand_rexmit(PPP_IPV6); - sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); + if (! eui64_equals(go->ourid, wo->ourid) || + ! eui64_equals(ho->hisid, wo->hisid)) { + if (! eui64_equals(go->ourid, wo->ourid)) + warn("Local LL address changed to %s", + llv6_ntoa(go->ourid)); + if (! eui64_equals(ho->hisid, wo->hisid)) + warn("Remote LL address changed to %s", + llv6_ntoa(ho->hisid)); + ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); + + /* Set the interface to the new addresses */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + if (debug) + warn("sif6addr failed"); + ipv6cp_close(f->unit, "Interface configuration failed"); + return; + } + + } + demand_rexmit(PPP_IPV6); + sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set LL addresses - */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } - - /* bring the interface up for IPv6 */ - if (!sif6up(f->pcb)) { - PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } + /* + * Set LL addresses + */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } + + /* bring the interface up for IPv6 */ + if (!sif6up(f->pcb)) { + PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ - ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); - ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); + ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); + ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); } np_up(f->pcb, PPP_IPV6); @@ -1254,11 +1254,11 @@ static void ipv6cp_up(fsm *f) { #if 0 /* UNUSED */ /* * Execute the ipv6-up script, like this: - * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL + * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL */ if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); } #endif /* UNUSED */ } @@ -1280,8 +1280,8 @@ static void ipv6cp_down(fsm *f) { update_link_stats(f->unit); #endif /* PPP_STATS_SUPPORT */ if (pcb->ipv6cp_is_up) { - pcb->ipv6cp_is_up = 0; - np_down(f->pcb, PPP_IPV6); + pcb->ipv6cp_is_up = 0; + np_down(f->pcb, PPP_IPV6); } #ifdef IPV6CP_COMP sif6comp(f->unit, 0); @@ -1293,24 +1293,24 @@ static void ipv6cp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - ipv6cp_clear_addrs(f->pcb, - go->ourid, - ho->hisid); - sif6down(f->pcb); + ipv6cp_clear_addrs(f->pcb, + go->ourid, + ho->hisid); + sif6down(f->pcb); } #if 0 /* UNUSED */ /* Execute the ipv6-down script */ if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); } #endif /* UNUSED */ } @@ -1345,17 +1345,17 @@ ipv6cp_script_done(arg) ipv6cp_script_pid = 0; switch (ipv6cp_script_state) { case s_up: - if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); - } - break; + if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); + } + break; case s_down: - if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); - } - break; + if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); + } + break; } } @@ -1385,7 +1385,7 @@ ipv6cp_script(script) argv[7] = NULL; ipv6cp_script_pid = run_program(script, argv, 0, ipv6cp_script_done, - NULL, 0); + NULL, 0); } #endif /* UNUSED */ @@ -1399,7 +1399,7 @@ static const char* const ipv6cp_codenames[] = { }; static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg) { + void (*printer)(void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #ifdef IPV6CP_COMP @@ -1408,18 +1408,18 @@ static int ipv6cp_printpkt(const u_char *p, int plen, eui64_t ifaceid; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipv6cp_codenames)) - printer(arg, " %s", ipv6cp_codenames[code-1]); + printer(arg, " %s", ipv6cp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -1427,63 +1427,63 @@ static int ipv6cp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - printer(arg, "0x%x", cishort); - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + printer(arg, "0x%x", cishort); + } + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (olen == CILEN_IFACEID) { - p += 2; - eui64_get(ifaceid, p); - printer(arg, "addr %s", llv6_ntoa(ifaceid)); - } - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + case CI_IFACEID: + if (olen == CILEN_IFACEID) { + p += 2; + eui64_get(ifaceid, p); + printer(arg, "addr %s", llv6_ntoa(ifaceid)); + } + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -1496,19 +1496,19 @@ static int ipv6cp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP6_HDRLEN 40 /* bytes */ -#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define IP6_HDRLEN 40 /* bytes */ +#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define get_ip6nh(x) (((unsigned char *)(x))[6]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define get_ip6nh(x) (((unsigned char *)(x))[6]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ipv6_active_pkt(u_char *pkt, int len) { u_char *tcp; @@ -1516,16 +1516,16 @@ static int ipv6_active_pkt(u_char *pkt, int len) { len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP6_HDRLEN) - return 0; + return 0; if (get_ip6nh(pkt) == IP6_NHDR_FRAG) - return 0; + return 0; if (get_ip6nh(pkt) != IPPROTO_TCP) - return 1; + return 1; if (len < IP6_HDRLEN + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + IP6_HDRLEN; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == IP6_HDRLEN + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/lcp.c b/components/net/lwip-2.1.2/src/netif/ppp/lcp.c index 90ed183b75..040135637c 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/lcp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/lcp.c @@ -68,7 +68,7 @@ * configure-requests. We do this by delaying the fsm_lowerup call. */ /* steal a bit in fsm flags word */ -#define DELAYED_UP 0x80 +#define DELAYED_UP 0x80 static void lcp_delayed_up(void *arg); @@ -76,8 +76,8 @@ static void lcp_delayed_up(void *arg); * LCP-related command-line options. */ #if 0 /* UNUSED */ -int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ -int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ +int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ +int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -88,10 +88,10 @@ static u_int lcp_echo_fails = LCP_MAXECHOFAILS; /* Tolerance to unanswer #if 0 /* UNUSED */ #if PPP_LCP_ADAPTIVE -bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ +bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ #endif -bool lax_recv = 0; /* accept control chars in asyncmap */ -bool noendpoint = 0; /* don't send/accept endpoint discriminator */ +bool lax_recv = 0; /* accept control chars in asyncmap */ +bool noendpoint = 0; /* don't send/accept endpoint discriminator */ #endif /* UNUSED */ #if PPP_OPTIONS @@ -101,7 +101,7 @@ static int noopt (char **); #ifdef HAVE_MULTILINK static int setendpoint (char **); static void printendpoint (option_t *, void (*)(void *, char *, ...), - void *); + void *); #endif /* HAVE_MULTILINK */ #if PPP_OPTIONS @@ -215,17 +215,17 @@ static option_t lcp_option_list[] = { /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void lcp_resetci(fsm *f); /* Reset our CI */ -static int lcp_cilen(fsm *f); /* Return length of our CI */ +static void lcp_resetci(fsm *f); /* Reset our CI */ +static int lcp_cilen(fsm *f); /* Return length of our CI */ static void lcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI to pkt */ static int lcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject); /* Peer nak'd our CI */ static int lcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree); /* Rcv peer CI */ -static void lcp_up(fsm *f); /* We're UP */ -static void lcp_down(fsm *f); /* We're DOWN */ -static void lcp_starting (fsm *); /* We need lower layer up */ -static void lcp_finished (fsm *); /* We need lower layer down */ +static void lcp_up(fsm *f); /* We're UP */ +static void lcp_down(fsm *f); /* We're DOWN */ +static void lcp_starting (fsm *); /* We need lower layer up */ +static void lcp_finished (fsm *); /* We need lower layer down */ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len); static void lcp_rprotrej(fsm *f, u_char *inp, int len); @@ -241,22 +241,22 @@ static void LcpSendEchoRequest(fsm *f); static void LcpLinkFailure(fsm *f); static void LcpEchoCheck(fsm *f); -static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ - lcp_resetci, /* Reset our Configuration Information */ - lcp_cilen, /* Length of our Configuration Information */ - lcp_addci, /* Add our Configuration Information */ - lcp_ackci, /* ACK our Configuration Information */ - lcp_nakci, /* NAK our Configuration Information */ - lcp_rejci, /* Reject our Configuration Information */ - lcp_reqci, /* Request peer's Configuration Information */ - lcp_up, /* Called when fsm reaches OPENED state */ - lcp_down, /* Called when fsm leaves OPENED state */ - lcp_starting, /* Called when we want the lower layer up */ - lcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - lcp_extcode, /* Called to handle LCP-specific codes */ - "LCP" /* String name of protocol */ +static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ + lcp_resetci, /* Reset our Configuration Information */ + lcp_cilen, /* Length of our Configuration Information */ + lcp_addci, /* Add our Configuration Information */ + lcp_ackci, /* ACK our Configuration Information */ + lcp_nakci, /* NAK our Configuration Information */ + lcp_rejci, /* Reject our Configuration Information */ + lcp_reqci, /* Request peer's Configuration Information */ + lcp_up, /* Called when fsm reaches OPENED state */ + lcp_down, /* Called when fsm leaves OPENED state */ + lcp_starting, /* Called when we want the lower layer up */ + lcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + lcp_extcode, /* Called to handle LCP-specific codes */ + "LCP" /* String name of protocol */ }; /* @@ -269,7 +269,7 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len); static void lcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ const struct protent lcp_protent = { @@ -304,20 +304,20 @@ const struct protent lcp_protent = { /* * Length of each type of configuration option (in octets) */ -#define CILEN_VOID 2 -#define CILEN_CHAR 3 -#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ +#define CILEN_VOID 2 +#define CILEN_CHAR 3 +#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ #if CHAP_SUPPORT -#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ +#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ #endif /* CHAP_SUPPORT */ -#define CILEN_LONG 6 /* CILEN_VOID + 4 */ +#define CILEN_LONG 6 /* CILEN_VOID + 4 */ #if LQR_SUPPORT -#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ +#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ #endif /* LQR_SUPPORT */ -#define CILEN_CBCP 3 +#define CILEN_CBCP 3 -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if PPP_OPTIONS /* @@ -340,8 +340,8 @@ setendpoint(argv) char **argv; { if (str_to_epdisc(&lcp_wantoptions[0].endpoint, *argv)) { - lcp_wantoptions[0].neg_endpoint = 1; - return 1; + lcp_wantoptions[0].neg_endpoint = 1; + return 1; } option_error("Can't parse '%s' as an endpoint discriminator", *argv); return 0; @@ -353,7 +353,7 @@ printendpoint(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); + printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); } #endif /* HAVE_MULTILINK */ @@ -409,9 +409,9 @@ void lcp_open(ppp_pcb *pcb) { f->flags &= ~(OPT_PASSIVE | OPT_SILENT); if (wo->passive) - f->flags |= OPT_PASSIVE; + f->flags |= OPT_PASSIVE; if (wo->silent) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -428,25 +428,25 @@ void lcp_close(ppp_pcb *pcb, const char *reason) { && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - new_phase(pcb, PPP_PHASE_TERMINATE); + new_phase(pcb, PPP_PHASE_TERMINATE); if (f->flags & DELAYED_UP) { - UNTIMEOUT(lcp_delayed_up, f); - f->state = PPP_FSM_STOPPED; + UNTIMEOUT(lcp_delayed_up, f); + f->state = PPP_FSM_STOPPED; } oldstate = f->state; fsm_close(f, reason); if (oldstate == PPP_FSM_STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP))) { - /* - * This action is not strictly according to the FSM in RFC1548, - * but it does mean that the program terminates if you do a - * lcp_close() when a connection hasn't been established - * because we are in passive/silent mode or because we have - * delayed the fsm_lowerup() call and it hasn't happened yet. - */ - f->flags &= ~DELAYED_UP; - lcp_finished(f); + /* + * This action is not strictly according to the FSM in RFC1548, + * but it does mean that the program terminates if you do a + * lcp_close() when a connection hasn't been established + * because we are in passive/silent mode or because we have + * delayed the fsm_lowerup() call and it hasn't happened yet. + */ + f->flags &= ~DELAYED_UP; + lcp_finished(f); } } @@ -463,16 +463,16 @@ void lcp_lowerup(ppp_pcb *pcb) { * if we are going to ask for A/C and protocol compression. */ if (ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), - wo->neg_pcompression, wo->neg_accompression) < 0) - return; + || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), + wo->neg_pcompression, wo->neg_accompression) < 0) + return; pcb->peer_mru = PPP_MRU; if (pcb->settings.listen_time != 0) { - f->flags |= DELAYED_UP; - TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); + f->flags |= DELAYED_UP; + TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); } else - fsm_lowerup(f); + fsm_lowerup(f); } @@ -483,10 +483,10 @@ void lcp_lowerdown(ppp_pcb *pcb) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); } else - fsm_lowerdown(f); + fsm_lowerdown(f); } @@ -497,8 +497,8 @@ static void lcp_delayed_up(void *arg) { fsm *f = (fsm*)arg; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + fsm_lowerup(f); } } @@ -510,9 +510,9 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); + fsm_lowerup(f); } fsm_input(f, p, len); } @@ -527,33 +527,33 @@ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len) { switch( code ){ case PROTREJ: - lcp_rprotrej(f, inp, len); - break; - + lcp_rprotrej(f, inp, len); + break; + case ECHOREQ: - if (f->state != PPP_FSM_OPENED) - break; - magp = inp; - PUTLONG(go->magicnumber, magp); - fsm_sdata(f, ECHOREP, id, inp, len); - break; - + if (f->state != PPP_FSM_OPENED) + break; + magp = inp; + PUTLONG(go->magicnumber, magp); + fsm_sdata(f, ECHOREP, id, inp, len); + break; + case ECHOREP: - lcp_received_echo_reply(f, id, inp, len); - break; + lcp_received_echo_reply(f, id, inp, len); + break; case DISCREQ: case IDENTIF: case TIMEREM: - break; + break; default: - return 0; + return 0; } return 1; } - + /* * lcp_rprotrej - Receive an Protocol-Reject. * @@ -568,8 +568,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { #endif /* PPP_PROTOCOLNAME */ if (len < 2) { - LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); - return; + LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); + return; } GETSHORT(prot, inp); @@ -579,8 +579,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * OPENED state SHOULD be silently discarded. */ if( f->state != PPP_FSM_OPENED ){ - LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); - return; + LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); + return; } #if PPP_PROTOCOLNAME @@ -591,25 +591,25 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * Upcall the proper Protocol-Reject routine. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol == prot) { + if (protp->protocol == prot) { #if PPP_PROTOCOLNAME - if (pname != NULL) - ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, - prot); - else + if (pname != NULL) + ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, + prot); + else #endif /* PPP_PROTOCOLNAME */ - ppp_dbglog("Protocol-Reject for 0x%x received", prot); - (*protp->protrej)(f->pcb); - return; - } + ppp_dbglog("Protocol-Reject for 0x%x received", prot); + (*protp->protrej)(f->pcb); + return; + } #if PPP_PROTOCOLNAME if (pname != NULL) - ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, - prot); + ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, + prot); else #endif /* #if PPP_PROTOCOLNAME */ - ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); + ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); } @@ -641,7 +641,7 @@ void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len) { #endif fsm_sdata(f, PROTREJ, ++f->id, - p, len); + p, len); } @@ -748,15 +748,15 @@ static void lcp_resetci(fsm *f) { *go = *wo; #ifdef HAVE_MULTILINK if (!multilink) { - go->neg_mrru = 0; + go->neg_mrru = 0; #endif /* HAVE_MULTILINK */ - go->neg_ssnhf = 0; - go->neg_endpoint = 0; + go->neg_ssnhf = 0; + go->neg_endpoint = 0; #ifdef HAVE_MULTILINK } #endif /* HAVE_MULTILINK */ if (pcb->settings.noendpoint) - ao->neg_endpoint = 0; + ao->neg_endpoint = 0; pcb->peer_mru = PPP_MRU; #if 0 /* UNUSED */ auth_reset(pcb); @@ -771,60 +771,60 @@ static int lcp_cilen(fsm *f) { ppp_pcb *pcb = f->pcb; lcp_options *go = &pcb->lcp_gotoptions; -#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) +#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) #if CHAP_SUPPORT -#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) +#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) #endif /* CHAP_SUPPORT */ -#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) -#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) +#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) +#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) #if LQR_SUPPORT -#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) +#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) #endif /* LQR_SUPPORT */ -#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) +#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) /* * NB: we only ask for one of CHAP, UPAP, or EAP, even if we will * accept more than one. We prefer EAP first, then CHAP, then * PAP. */ return (LENCISHORT(go->neg_mru && go->mru != PPP_DEFMRU) + - LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + + LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + #if EAP_SUPPORT - LENCISHORT(go->neg_eap) + + LENCISHORT(go->neg_eap) + #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT - LENCICHAP(!go->neg_eap && go->neg_chap) + + LENCICHAP(!go->neg_eap && go->neg_chap) + #endif /* EAP_SUPPORT */ #if !EAP_SUPPORT - LENCICHAP(go->neg_chap) + + LENCICHAP(go->neg_chap) + #endif /* !EAP_SUPPORT */ #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + #endif /* EAP_SUPPORT && CHAP_SUPPORT */ #if EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(!go->neg_eap && go->neg_upap) + + LENCISHORT(!go->neg_eap && go->neg_upap) + #endif /* EAP_SUPPORT && !CHAP_SUPPORT */ #if !EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_chap && go->neg_upap) + #endif /* !EAP_SUPPORT && CHAP_SUPPORT */ #if !EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(go->neg_upap) + + LENCISHORT(go->neg_upap) + #endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT - LENCILQR(go->neg_lqr) + + LENCILQR(go->neg_lqr) + #endif /* LQR_SUPPORT */ - LENCICBCP(go->neg_cbcp) + - LENCILONG(go->neg_magicnumber) + - LENCIVOID(go->neg_pcompression) + - LENCIVOID(go->neg_accompression) + + LENCICBCP(go->neg_cbcp) + + LENCILONG(go->neg_magicnumber) + + LENCIVOID(go->neg_pcompression) + + LENCIVOID(go->neg_accompression) + #ifdef HAVE_MULTILINK - LENCISHORT(go->neg_mrru) + + LENCISHORT(go->neg_mrru) + #endif /* HAVE_MULTILINK */ - LENCIVOID(go->neg_ssnhf) + - (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); + LENCIVOID(go->neg_ssnhf) + + (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); } @@ -838,58 +838,58 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIVOID(opt, neg) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_VOID, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_VOID, ucp); \ } #define ADDCISHORT(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_SHORT, ucp); \ - PUTSHORT(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_SHORT, ucp); \ + PUTSHORT(val, ucp); \ } #if CHAP_SUPPORT #define ADDCICHAP(opt, neg, val) \ if (neg) { \ - PUTCHAR((opt), ucp); \ - PUTCHAR(CILEN_CHAP, ucp); \ - PUTSHORT(PPP_CHAP, ucp); \ - PUTCHAR((CHAP_DIGEST(val)), ucp); \ + PUTCHAR((opt), ucp); \ + PUTCHAR(CILEN_CHAP, ucp); \ + PUTSHORT(PPP_CHAP, ucp); \ + PUTCHAR((CHAP_DIGEST(val)), ucp); \ } #endif /* CHAP_SUPPORT */ #define ADDCILONG(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LONG, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LONG, ucp); \ + PUTLONG(val, ucp); \ } #if LQR_SUPPORT #define ADDCILQR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LQR, ucp); \ - PUTSHORT(PPP_LQR, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LQR, ucp); \ + PUTSHORT(PPP_LQR, ucp); \ + PUTLONG(val, ucp); \ } #endif /* LQR_SUPPORT */ #define ADDCICHAR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR, ucp); \ - PUTCHAR(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR, ucp); \ + PUTCHAR(val, ucp); \ } #define ADDCIENDP(opt, neg, class, val, len) \ if (neg) { \ - int i; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR + len, ucp); \ - PUTCHAR(class, ucp); \ - for (i = 0; i < len; ++i) \ - PUTCHAR(val[i], ucp); \ + int i; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR + len, ucp); \ + PUTCHAR(class, ucp); \ + for (i = 0; i < len; ++i) \ + PUTCHAR(val[i], ucp); \ } ADDCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ADDCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -927,11 +927,11 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #endif ADDCIVOID(CI_SSNHF, go->neg_ssnhf); ADDCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); if (ucp - start_ucp != *lenp) { - /* this should never happen, because peer_mtu should be 1500 */ - ppp_error("Bug in lcp_addci: wrong length"); + /* this should never happen, because peer_mtu should be 1500 */ + ppp_error("Bug in lcp_addci: wrong length"); } } @@ -941,8 +941,8 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { * This should not modify any state if the Ack is bad. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int lcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -958,112 +958,112 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { */ #define ACKCIVOID(opt, neg) \ if (neg) { \ - if ((len -= CILEN_VOID) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || \ - citype != opt) \ - goto bad; \ + if ((len -= CILEN_VOID) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_VOID || \ + citype != opt) \ + goto bad; \ } #define ACKCISHORT(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_SHORT) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_SHORT || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + if ((len -= CILEN_SHORT) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_SHORT || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #define ACKCICHAR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != val) \ - goto bad; \ + if ((len -= CILEN_CHAR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != val) \ + goto bad; \ } #if CHAP_SUPPORT #define ACKCICHAP(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAP) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAP || \ - citype != (opt)) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_CHAP) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != (CHAP_DIGEST(val))) \ - goto bad; \ + if ((len -= CILEN_CHAP) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAP || \ + citype != (opt)) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_CHAP) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != (CHAP_DIGEST(val))) \ + goto bad; \ } #endif /* CHAP_SUPPORT */ #define ACKCILONG(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LONG) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LONG || \ - citype != opt) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LONG) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LONG || \ + citype != opt) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #if LQR_SUPPORT #define ACKCILQR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LQR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LQR || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_LQR) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LQR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LQR || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_LQR) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #endif /* LQR_SUPPORT */ #define ACKCIENDP(opt, neg, class, val, vlen) \ if (neg) { \ - int i; \ - if ((len -= CILEN_CHAR + vlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR + vlen || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ + int i; \ + if ((len -= CILEN_CHAR + vlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR + vlen || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ } ACKCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ACKCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -1101,13 +1101,13 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ ACKCIVOID(CI_SSNHF, go->neg_ssnhf); ACKCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: LCPDEBUG(("lcp_acki: received bad Ack!")); @@ -1121,8 +1121,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1131,8 +1131,8 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_char citype, cichar, *next; u_short cishort; u32_t cilong; - lcp_options no; /* options we've seen Naks for */ - lcp_options try_; /* options to request next time */ + lcp_options no; /* options we've seen Naks for */ + lcp_options try_; /* options to request next time */ int looped_back = 0; int cilen; @@ -1146,85 +1146,85 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + no.neg = 1; \ + try_.neg = 0; \ } #if CHAP_SUPPORT #define NAKCICHAP(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #endif /* CHAP_SUPPORT */ #define NAKCICHAR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[1] == CILEN_CHAR && \ - p[0] == opt) { \ - len -= CILEN_CHAR; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAR && \ + p[1] == CILEN_CHAR && \ + p[0] == opt) { \ + len -= CILEN_CHAR; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #define NAKCISHORT(opt, neg, code) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ - code \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ } #define NAKCILONG(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #if LQR_SUPPORT #define NAKCILQR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #endif /* LQR_SUPPORT */ #define NAKCIENDP(opt, neg) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[0] == opt && \ - p[1] >= CILEN_CHAR && \ - p[1] <= len) { \ - len -= p[1]; \ - INCPTR(p[1], p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_CHAR && \ + p[0] == opt && \ + p[1] >= CILEN_CHAR && \ + p[1] <= len) { \ + len -= p[1]; \ + INCPTR(p[1], p); \ + no.neg = 1; \ + try_.neg = 0; \ } /* @@ -1239,19 +1239,19 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the limit of the default MRU we'd get if we didn't negotiate. */ if (go->neg_mru && go->mru != PPP_DEFMRU) { - NAKCISHORT(CI_MRU, neg_mru, - if (cishort <= wo->mru || cishort <= PPP_DEFMRU) - try_.mru = cishort; - ); + NAKCISHORT(CI_MRU, neg_mru, + if (cishort <= wo->mru || cishort <= PPP_DEFMRU) + try_.mru = cishort; + ); } /* * Add any characters they want to our (receive-side) asyncmap. */ if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) { - NAKCILONG(CI_ASYNCMAP, neg_asyncmap, - try_.asyncmap = go->asyncmap | cilong; - ); + NAKCILONG(CI_ASYNCMAP, neg_asyncmap, + try_.asyncmap = go->asyncmap | cilong; + ); } /* @@ -1270,125 +1270,125 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_eap #endif /* EAP_SUPPORT */ ) - && len >= CILEN_SHORT - && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { - cilen = p[1]; - len -= cilen; + && len >= CILEN_SHORT + && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { + cilen = p[1]; + len -= cilen; #if CHAP_SUPPORT - no.neg_chap = go->neg_chap; + no.neg_chap = go->neg_chap; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - no.neg_upap = go->neg_upap; + no.neg_upap = go->neg_upap; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - no.neg_eap = go->neg_eap; + no.neg_eap = go->neg_eap; #endif /* EAP_SUPPORT */ - INCPTR(2, p); - GETSHORT(cishort, p); + INCPTR(2, p); + GETSHORT(cishort, p); #if PAP_SUPPORT - if (cishort == PPP_PAP && cilen == CILEN_SHORT) { + if (cishort == PPP_PAP && cilen == CILEN_SHORT) { #if EAP_SUPPORT - /* If we were asking for EAP, then we need to stop that. */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* If we were asking for EAP, then we need to stop that. */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - /* If we were asking for CHAP, then we need to stop that. */ - if (go->neg_chap) - try_.neg_chap = 0; - else + /* If we were asking for CHAP, then we need to stop that. */ + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ - /* - * If we weren't asking for CHAP or EAP, then we were asking for - * PAP, in which case this Nak is bad. - */ - goto bad; - } else + /* + * If we weren't asking for CHAP or EAP, then we were asking for + * PAP, in which case this Nak is bad. + */ + goto bad; + } else #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { - GETCHAR(cichar, p); + if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { + GETCHAR(cichar, p); #if EAP_SUPPORT - /* Stop asking for EAP, if we were. */ - if (go->neg_eap) { - try_.neg_eap = 0; - /* Try to set up to use their suggestion, if possible */ - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else + /* Stop asking for EAP, if we were. */ + if (go->neg_eap) { + try_.neg_eap = 0; + /* Try to set up to use their suggestion, if possible */ + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else #endif /* EAP_SUPPORT */ - if (go->neg_chap) { - /* - * We were asking for our preferred algorithm, they must - * want something different. - */ - if (cichar != CHAP_DIGEST(go->chap_mdtype)) { - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { - /* Use their suggestion if we support it ... */ - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else { - /* ... otherwise, try our next-preferred algorithm. */ - try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); - if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ - try_.neg_chap = 0; - } - } else { - /* - * Whoops, they Nak'd our algorithm of choice - * but then suggested it back to us. - */ - goto bad; - } - } else { - /* - * Stop asking for PAP if we were asking for it. - */ + if (go->neg_chap) { + /* + * We were asking for our preferred algorithm, they must + * want something different. + */ + if (cichar != CHAP_DIGEST(go->chap_mdtype)) { + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { + /* Use their suggestion if we support it ... */ + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else { + /* ... otherwise, try our next-preferred algorithm. */ + try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); + if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ + try_.neg_chap = 0; + } + } else { + /* + * Whoops, they Nak'd our algorithm of choice + * but then suggested it back to us. + */ + goto bad; + } + } else { + /* + * Stop asking for PAP if we were asking for it. + */ #if PAP_SUPPORT - try_.neg_upap = 0; + try_.neg_upap = 0; #endif /* PAP_SUPPORT */ - } + } - } else + } else #endif /* CHAP_SUPPORT */ - { + { #if EAP_SUPPORT - /* - * If we were asking for EAP, and they're Conf-Naking EAP, - * well, that's just strange. Nobody should do that. - */ - if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) - ppp_dbglog("Unexpected Conf-Nak for EAP"); - - /* - * We don't recognize what they're suggesting. - * Stop asking for what we were asking for. - */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* + * If we were asking for EAP, and they're Conf-Naking EAP, + * well, that's just strange. Nobody should do that. + */ + if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) + ppp_dbglog("Unexpected Conf-Nak for EAP"); + + /* + * We don't recognize what they're suggesting. + * Stop asking for what we were asking for. + */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (go->neg_chap) - try_.neg_chap = 0; - else + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) - try_.neg_upap = 0; - else + if(1) + try_.neg_upap = 0; + else #endif /* PAP_SUPPORT */ - {} + {} - p += cilen - CILEN_SHORT; - } + p += cilen - CILEN_SHORT; + } } #if LQR_SUPPORT @@ -1398,11 +1398,11 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they Nak the reporting period, take their value XXX ? */ NAKCILQR(CI_QUALITY, neg_lqr, - if (cishort != PPP_LQR) - try_.neg_lqr = 0; - else - try_.lqr_period = cilong; - ); + if (cishort != PPP_LQR) + try_.neg_lqr = 0; + else + try_.lqr_period = cilong; + ); #endif /* LQR_SUPPORT */ /* @@ -1417,9 +1417,9 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * Check for a looped-back line. */ NAKCILONG(CI_MAGICNUMBER, neg_magicnumber, - try_.magicnumber = magic(); - looped_back = 1; - ); + try_.magicnumber = magic(); + looped_back = 1; + ); /* * Peer shouldn't send Nak for protocol compression or @@ -1435,12 +1435,12 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * than the one we want. */ if (go->neg_mrru) { - NAKCISHORT(CI_MRRU, neg_mrru, - if (treat_as_reject) - try_.neg_mrru = 0; - else if (cishort <= wo->mrru) - try_.mrru = cishort; - ); + NAKCISHORT(CI_MRRU, neg_mrru, + if (treat_as_reject) + try_.neg_mrru = 0; + else if (cishort <= wo->mrru) + try_.mrru = cishort; + ); } #else /* HAVE_MULTILINK */ LWIP_UNUSED_ARG(treat_as_reject); @@ -1475,30 +1475,30 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * negotiate some option we don't support, so ignore it. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if (cilen < CILEN_VOID || (len -= cilen) < 0) - goto bad; - next = p + cilen - 2; - - switch (citype) { - case CI_MRU: - if ((go->neg_mru && go->mru != PPP_DEFMRU) - || no.neg_mru || cilen != CILEN_SHORT) - goto bad; - GETSHORT(cishort, p); - if (cishort < PPP_DEFMRU) { - try_.neg_mru = 1; - try_.mru = cishort; - } - break; - case CI_ASYNCMAP: - if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) - || no.neg_asyncmap || cilen != CILEN_LONG) - goto bad; - break; - case CI_AUTHTYPE: - if (0 + GETCHAR(citype, p); + GETCHAR(cilen, p); + if (cilen < CILEN_VOID || (len -= cilen) < 0) + goto bad; + next = p + cilen - 2; + + switch (citype) { + case CI_MRU: + if ((go->neg_mru && go->mru != PPP_DEFMRU) + || no.neg_mru || cilen != CILEN_SHORT) + goto bad; + GETSHORT(cishort, p); + if (cishort < PPP_DEFMRU) { + try_.neg_mru = 1; + try_.mru = cishort; + } + break; + case CI_ASYNCMAP: + if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + || no.neg_asyncmap || cilen != CILEN_LONG) + goto bad; + break; + case CI_AUTHTYPE: + if (0 #if CHAP_SUPPORT || go->neg_chap || no.neg_chap #endif /* CHAP_SUPPORT */ @@ -1506,51 +1506,51 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_upap || no.neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap || no.neg_eap + || go->neg_eap || no.neg_eap #endif /* EAP_SUPPORT */ - ) - goto bad; - break; - case CI_MAGICNUMBER: - if (go->neg_magicnumber || no.neg_magicnumber || - cilen != CILEN_LONG) - goto bad; - break; - case CI_PCOMPRESSION: - if (go->neg_pcompression || no.neg_pcompression - || cilen != CILEN_VOID) - goto bad; - break; - case CI_ACCOMPRESSION: - if (go->neg_accompression || no.neg_accompression - || cilen != CILEN_VOID) - goto bad; - break; + ) + goto bad; + break; + case CI_MAGICNUMBER: + if (go->neg_magicnumber || no.neg_magicnumber || + cilen != CILEN_LONG) + goto bad; + break; + case CI_PCOMPRESSION: + if (go->neg_pcompression || no.neg_pcompression + || cilen != CILEN_VOID) + goto bad; + break; + case CI_ACCOMPRESSION: + if (go->neg_accompression || no.neg_accompression + || cilen != CILEN_VOID) + goto bad; + break; #if LQR_SUPPORT - case CI_QUALITY: - if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) - goto bad; - break; + case CI_QUALITY: + if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) + goto bad; + break; #endif /* LQR_SUPPORT */ #ifdef HAVE_MULTILINK - case CI_MRRU: - if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) - goto bad; - break; + case CI_MRRU: + if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) + goto bad; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) - goto bad; - try_.neg_ssnhf = 1; - break; - case CI_EPDISC: - if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) - goto bad; - break; - default: - break; - } - p = next; + case CI_SSNHF: + if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) + goto bad; + try_.neg_ssnhf = 1; + break; + case CI_EPDISC: + if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) + goto bad; + break; + default: + break; + } + p = next; } /* @@ -1558,15 +1558,15 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any options left we ignore them. */ if (f->state != PPP_FSM_OPENED) { - if (looped_back) { - if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { - ppp_notice("Serial line is looped back."); - pcb->err_code = PPPERR_LOOPBACK; - lcp_close(f->pcb, "Loopback detected"); - } - } else - try_.numloops = 0; - *go = try_; + if (looped_back) { + if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { + ppp_notice("Serial line is looped back."); + pcb->err_code = PPPERR_LOOPBACK; + lcp_close(f->pcb, "Loopback detected"); + } + } else + try_.numloops = 0; + *go = try_; } return 1; @@ -1583,8 +1583,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Reject was bad. - * 1 - Reject was good. + * 0 - Reject was bad. + * 1 - Reject was good. */ static int lcp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -1592,7 +1592,7 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { u_char cichar; u_short cishort; u32_t cilong; - lcp_options try_; /* options to request next time */ + lcp_options try_; /* options to request next time */ try_ = *go; @@ -1603,157 +1603,157 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + try_.neg = 0; \ } #define REJCISHORT(opt, neg, val) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #if CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT */ #define REJCILONG(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LQR_SUPPORT #define REJCILQR(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cishort != PPP_LQR || cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cishort != PPP_LQR || cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LQR_SUPPORT */ #define REJCICBCP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CBCP && \ - p[1] == CILEN_CBCP && \ - p[0] == opt) { \ - len -= CILEN_CBCP; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if (cichar != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CBCP && \ + p[1] == CILEN_CBCP && \ + p[0] == opt) { \ + len -= CILEN_CBCP; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if (cichar != val) \ + goto bad; \ + try_.neg = 0; \ } #define REJCIENDP(opt, neg, class, val, vlen) \ if (go->neg && \ - len >= CILEN_CHAR + vlen && \ - p[0] == opt && \ - p[1] == CILEN_CHAR + vlen) { \ - int i; \ - len -= CILEN_CHAR + vlen; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ - try_.neg = 0; \ + len >= CILEN_CHAR + vlen && \ + p[0] == opt && \ + p[1] == CILEN_CHAR + vlen) { \ + int i; \ + len -= CILEN_CHAR + vlen; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ + try_.neg = 0; \ } REJCISHORT(CI_MRU, neg_mru, go->mru); @@ -1763,14 +1763,14 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { if (!go->neg_eap) { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); - if (!go->neg_chap) { + REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); + if (!go->neg_chap) { #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); + REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - } + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT } @@ -1787,18 +1787,18 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ REJCIVOID(CI_SSNHF, neg_ssnhf); REJCIENDP(CI_EPDISC, neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1822,17 +1822,17 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { lcp_options *go = &pcb->lcp_gotoptions; lcp_options *ho = &pcb->lcp_hisoptions; lcp_options *ao = &pcb->lcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - int cilen, citype, cichar; /* Parsed len, type, char value */ - u_short cishort; /* Parsed short value */ - u32_t cilong; /* Parse long value */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *rejp; /* Pointer to next char in reject frame */ + u_char *cip, *next; /* Pointer to current and next CIs */ + int cilen, citype, cichar; /* Parsed len, type, char value */ + u_short cishort; /* Parsed short value */ + u32_t cilong; /* Parse long value */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *rejp; /* Pointer to next char in reject frame */ struct pbuf *nakp; /* Nak buffer */ - u_char *nakoutp; /* Pointer to next char in Nak frame */ - int l = *lenp; /* Length left */ + u_char *nakoutp; /* Pointer to next char in Nak frame */ + int l = *lenp; /* Length left */ /* * Reset all his options. @@ -1854,403 +1854,403 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { nakoutp = (u_char*)nakp->payload; rejp = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - LCPDEBUG(("lcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - citype = 0; - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_MRU: - if (!ao->neg_mru || /* Allow option? */ - cilen != CILEN_SHORT) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETSHORT(cishort, p); /* Parse MRU */ - - /* - * He must be able to receive at least our minimum. - * No need to check a maximum. If he sends a large number, - * we'll just ignore it. - */ - if (cishort < PPP_MINMRU) { - orc = CONFNAK; /* Nak CI */ - PUTCHAR(CI_MRU, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ - break; - } - ho->neg_mru = 1; /* Remember he sent MRU */ - ho->mru = cishort; /* And remember value */ - break; - - case CI_ASYNCMAP: - if (!ao->neg_asyncmap || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * Asyncmap must have set at least the bits - * which are set in lcp_allowoptions[unit].asyncmap. - */ - if ((ao->asyncmap & ~cilong) != 0) { - orc = CONFNAK; - PUTCHAR(CI_ASYNCMAP, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(ao->asyncmap | cilong, nakoutp); - break; - } - ho->neg_asyncmap = 1; - ho->asyncmap = cilong; - break; - - case CI_AUTHTYPE: - if (cilen < CILEN_SHORT || - !(0 + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + LCPDEBUG(("lcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + citype = 0; + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_MRU: + if (!ao->neg_mru || /* Allow option? */ + cilen != CILEN_SHORT) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETSHORT(cishort, p); /* Parse MRU */ + + /* + * He must be able to receive at least our minimum. + * No need to check a maximum. If he sends a large number, + * we'll just ignore it. + */ + if (cishort < PPP_MINMRU) { + orc = CONFNAK; /* Nak CI */ + PUTCHAR(CI_MRU, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ + break; + } + ho->neg_mru = 1; /* Remember he sent MRU */ + ho->mru = cishort; /* And remember value */ + break; + + case CI_ASYNCMAP: + if (!ao->neg_asyncmap || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * Asyncmap must have set at least the bits + * which are set in lcp_allowoptions[unit].asyncmap. + */ + if ((ao->asyncmap & ~cilong) != 0) { + orc = CONFNAK; + PUTCHAR(CI_ASYNCMAP, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(ao->asyncmap | cilong, nakoutp); + break; + } + ho->neg_asyncmap = 1; + ho->asyncmap = cilong; + break; + + case CI_AUTHTYPE: + if (cilen < CILEN_SHORT || + !(0 #if PAP_SUPPORT - || ao->neg_upap + || ao->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || ao->neg_chap + || ao->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ao->neg_eap + || ao->neg_eap #endif /* EAP_SUPPORT */ - )) { - /* - * Reject the option if we're not willing to authenticate. - */ - ppp_dbglog("No auth is possible"); - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - /* - * Authtype must be PAP, CHAP, or EAP. - * - * Note: if more than one of ao->neg_upap, ao->neg_chap, and - * ao->neg_eap are set, and the peer sends a Configure-Request - * with two or more authenticate-protocol requests, then we will - * reject the second request. - * Whether we end up doing CHAP, UPAP, or EAP depends then on - * the ordering of the CIs in the peer's Configure-Request. + )) { + /* + * Reject the option if we're not willing to authenticate. + */ + ppp_dbglog("No auth is possible"); + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + /* + * Authtype must be PAP, CHAP, or EAP. + * + * Note: if more than one of ao->neg_upap, ao->neg_chap, and + * ao->neg_eap are set, and the peer sends a Configure-Request + * with two or more authenticate-protocol requests, then we will + * reject the second request. + * Whether we end up doing CHAP, UPAP, or EAP depends then on + * the ordering of the CIs in the peer's Configure-Request. */ #if PAP_SUPPORT - if (cishort == PPP_PAP) { - /* we've already accepted CHAP or EAP */ - if (0 + if (cishort == PPP_PAP) { + /* we've already accepted CHAP or EAP */ + if (0 #if CHAP_SUPPORT - || ho->neg_chap + || ho->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ho->neg_eap + || ho->neg_eap #endif /* EAP_SUPPORT */ - || cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_upap) { /* we don't want to do PAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + || cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_upap) { /* we don't want to do PAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else { + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - } + } #endif /* EAP_SUPPORT */ - break; - } - ho->neg_upap = 1; - break; - } + break; + } + ho->neg_upap = 1; + break; + } #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP) { - /* we've already accepted PAP or EAP */ - if ( + if (cishort == PPP_CHAP) { + /* we've already accepted PAP or EAP */ + if ( #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - ho->neg_eap || + ho->neg_eap || #endif /* EAP_SUPPORT */ - cilen != CILEN_CHAP) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_chap) { /* we don't want to do CHAP */ - orc = CONFNAK; /* NAK it and suggest EAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); + cilen != CILEN_CHAP) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_chap) { /* we don't want to do CHAP */ + orc = CONFNAK; /* NAK it and suggest EAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTSHORT(PPP_PAP, nakoutp); - } - else + if(1) { + PUTSHORT(PPP_PAP, nakoutp); + } + else #endif /* PAP_SUPPORT */ - {} - break; - } - GETCHAR(cichar, p); /* get digest type */ - if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { - /* - * We can't/won't do the requested type, - * suggest something else. - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - break; - } - ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ - ho->neg_chap = 1; - break; - } + {} + break; + } + GETCHAR(cichar, p); /* get digest type */ + if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { + /* + * We can't/won't do the requested type, + * suggest something else. + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + break; + } + ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ + ho->neg_chap = 1; + break; + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - if (cishort == PPP_EAP) { - /* we've already accepted CHAP or PAP */ - if ( + if (cishort == PPP_EAP) { + /* we've already accepted CHAP or PAP */ + if ( #if CHAP_SUPPORT - ho->neg_chap || + ho->neg_chap || #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ - cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_eap) { /* we don't want to do EAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_eap) { /* we don't want to do EAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; - } - ho->neg_eap = 1; - break; - } + {} + break; + } + ho->neg_eap = 1; + break; + } #endif /* EAP_SUPPORT */ - /* - * We don't recognize the protocol they're asking for. - * Nak it with something we're willing to do. - * (At this point we know ao->neg_upap || ao->neg_chap || - * ao->neg_eap.) - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); + /* + * We don't recognize the protocol they're asking for. + * Nak it with something we're willing to do. + * (At this point we know ao->neg_upap || ao->neg_chap || + * ao->neg_eap.) + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; + {} + break; #if LQR_SUPPORT - case CI_QUALITY: - if (!ao->neg_lqr || - cilen != CILEN_LQR) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - GETLONG(cilong, p); - - /* - * Check the protocol and the reporting period. - * XXX When should we Nak this, and what with? - */ - if (cishort != PPP_LQR) { - orc = CONFNAK; - PUTCHAR(CI_QUALITY, nakoutp); - PUTCHAR(CILEN_LQR, nakoutp); - PUTSHORT(PPP_LQR, nakoutp); - PUTLONG(ao->lqr_period, nakoutp); - break; - } - break; + case CI_QUALITY: + if (!ao->neg_lqr || + cilen != CILEN_LQR) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + GETLONG(cilong, p); + + /* + * Check the protocol and the reporting period. + * XXX When should we Nak this, and what with? + */ + if (cishort != PPP_LQR) { + orc = CONFNAK; + PUTCHAR(CI_QUALITY, nakoutp); + PUTCHAR(CILEN_LQR, nakoutp); + PUTSHORT(PPP_LQR, nakoutp); + PUTLONG(ao->lqr_period, nakoutp); + break; + } + break; #endif /* LQR_SUPPORT */ - case CI_MAGICNUMBER: - if (!(ao->neg_magicnumber || go->neg_magicnumber) || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * He must have a different magic number. - */ - if (go->neg_magicnumber && - cilong == go->magicnumber) { - cilong = magic(); /* Don't put magic() inside macro! */ - orc = CONFNAK; - PUTCHAR(CI_MAGICNUMBER, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(cilong, nakoutp); - break; - } - ho->neg_magicnumber = 1; - ho->magicnumber = cilong; - break; - - - case CI_PCOMPRESSION: - if (!ao->neg_pcompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_pcompression = 1; - break; - - case CI_ACCOMPRESSION: - if (!ao->neg_accompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_accompression = 1; - break; + case CI_MAGICNUMBER: + if (!(ao->neg_magicnumber || go->neg_magicnumber) || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * He must have a different magic number. + */ + if (go->neg_magicnumber && + cilong == go->magicnumber) { + cilong = magic(); /* Don't put magic() inside macro! */ + orc = CONFNAK; + PUTCHAR(CI_MAGICNUMBER, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(cilong, nakoutp); + break; + } + ho->neg_magicnumber = 1; + ho->magicnumber = cilong; + break; + + + case CI_PCOMPRESSION: + if (!ao->neg_pcompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_pcompression = 1; + break; + + case CI_ACCOMPRESSION: + if (!ao->neg_accompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_accompression = 1; + break; #ifdef HAVE_MULTILINK - case CI_MRRU: - if (!ao->neg_mrru - || !multilink - || cilen != CILEN_SHORT) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - /* possibly should insist on a minimum/maximum MRRU here */ - ho->neg_mrru = 1; - ho->mrru = cishort; - break; + case CI_MRRU: + if (!ao->neg_mrru + || !multilink + || cilen != CILEN_SHORT) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + /* possibly should insist on a minimum/maximum MRRU here */ + ho->neg_mrru = 1; + ho->mrru = cishort; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (!ao->neg_ssnhf + case CI_SSNHF: + if (!ao->neg_ssnhf #ifdef HAVE_MULTILINK - || !multilink + || !multilink #endif /* HAVE_MULTILINK */ - || cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_ssnhf = 1; - break; - - case CI_EPDISC: - if (!ao->neg_endpoint || - cilen < CILEN_CHAR || - cilen > CILEN_CHAR + MAX_ENDP_LEN) { - orc = CONFREJ; - break; - } - GETCHAR(cichar, p); - cilen -= CILEN_CHAR; - ho->neg_endpoint = 1; - ho->endpoint.class_ = cichar; - ho->endpoint.length = cilen; - MEMCPY(ho->endpoint.value, p, cilen); - INCPTR(cilen, p); - break; - - default: - LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); - orc = CONFREJ; - break; - } + || cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_ssnhf = 1; + break; + + case CI_EPDISC: + if (!ao->neg_endpoint || + cilen < CILEN_CHAR || + cilen > CILEN_CHAR + MAX_ENDP_LEN) { + orc = CONFREJ; + break; + } + GETCHAR(cichar, p); + cilen -= CILEN_CHAR; + ho->neg_endpoint = 1; + ho->endpoint.class_ = cichar; + ho->endpoint.length = cilen; + MEMCPY(ho->endpoint.value, p, cilen); + INCPTR(cilen, p); + break; + + default: + LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree /* Getting fed up with sending NAKs? */ - && citype != CI_MAGICNUMBER) { - orc = CONFREJ; /* Get tough if so */ - } else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - rc = CONFNAK; - } - } - if (orc == CONFREJ) { /* Reject this CI */ - rc = CONFREJ; - if (cip != rejp) /* Need to move rejected CI? */ - MEMCPY(rejp, cip, cilen); /* Move it */ - INCPTR(cilen, rejp); /* Update output pointer */ - } + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree /* Getting fed up with sending NAKs? */ + && citype != CI_MAGICNUMBER) { + orc = CONFREJ; /* Get tough if so */ + } else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + rc = CONFNAK; + } + } + if (orc == CONFREJ) { /* Reject this CI */ + rc = CONFREJ; + if (cip != rejp) /* Need to move rejected CI? */ + MEMCPY(rejp, cip, cilen); /* Move it */ + INCPTR(cilen, rejp); /* Update output pointer */ + } } /* @@ -2262,25 +2262,25 @@ endswitch: switch (rc) { case CONFACK: - *lenp = next - inp; - break; + *lenp = next - inp; + break; case CONFNAK: - /* - * Copy the Nak'd options from the nak buffer to the caller's buffer. - */ - *lenp = nakoutp - (u_char*)nakp->payload; - MEMCPY(inp, nakp->payload, *lenp); - break; + /* + * Copy the Nak'd options from the nak buffer to the caller's buffer. + */ + *lenp = nakoutp - (u_char*)nakp->payload; + MEMCPY(inp, nakp->payload, *lenp); + break; case CONFREJ: - *lenp = rejp - inp; - break; + *lenp = rejp - inp; + break; default: - break; + break; } pbuf_free(nakp); LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -2296,9 +2296,9 @@ static void lcp_up(fsm *f) { int mtu, mru; if (!go->neg_magicnumber) - go->magicnumber = 0; + go->magicnumber = 0; if (!ho->neg_magicnumber) - ho->magicnumber = 0; + ho->magicnumber = 0; /* * Set our MTU to the smaller of the MTU we wanted and @@ -2314,16 +2314,16 @@ static void lcp_up(fsm *f) { #ifdef HAVE_MULTILINK if (!(multilink && go->neg_mrru && ho->neg_mrru)) #endif /* HAVE_MULTILINK */ - netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); + netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); ppp_send_config(pcb, mtu, - (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), - ho->neg_pcompression, ho->neg_accompression); + (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), + ho->neg_pcompression, ho->neg_accompression); ppp_recv_config(pcb, mru, - (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); if (ho->neg_mru) - pcb->peer_mru = ho->mru; + pcb->peer_mru = ho->mru; lcp_echo_lowerup(f->pcb); /* Enable echo messages */ @@ -2346,8 +2346,8 @@ static void lcp_down(fsm *f) { ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0); ppp_recv_config(pcb, PPP_MRU, - (go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); pcb->peer_mru = PPP_MRU; } @@ -2382,25 +2382,25 @@ static const char* const lcp_codenames[] = { }; static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen, i; const u_char *pstart, *optend; u_short cishort; u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(lcp_codenames)) - printer(arg, " %s", lcp_codenames[code-1]); + printer(arg, " %s", lcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2408,224 +2408,224 @@ static int lcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_MRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mru %d", cishort); - } - break; - case CI_ASYNCMAP: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "asyncmap 0x%x", cilong); - } - break; - case CI_AUTHTYPE: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "auth "); - GETSHORT(cishort, p); - switch (cishort) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_MRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mru %d", cishort); + } + break; + case CI_ASYNCMAP: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "asyncmap 0x%x", cilong); + } + break; + case CI_AUTHTYPE: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "auth "); + GETSHORT(cishort, p); + switch (cishort) { #if PAP_SUPPORT - case PPP_PAP: - printer(arg, "pap"); - break; + case PPP_PAP: + printer(arg, "pap"); + break; #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - case PPP_CHAP: - printer(arg, "chap"); - if (p < optend) { - switch (*p) { - case CHAP_MD5: - printer(arg, " MD5"); - ++p; - break; + case PPP_CHAP: + printer(arg, "chap"); + if (p < optend) { + switch (*p) { + case CHAP_MD5: + printer(arg, " MD5"); + ++p; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - printer(arg, " MS"); - ++p; - break; - - case CHAP_MICROSOFT_V2: - printer(arg, " MS-v2"); - ++p; - break; + case CHAP_MICROSOFT: + printer(arg, " MS"); + ++p; + break; + + case CHAP_MICROSOFT_V2: + printer(arg, " MS-v2"); + ++p; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - } - break; + default: + break; + } + } + break; #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - case PPP_EAP: - printer(arg, "eap"); - break; + case PPP_EAP: + printer(arg, "eap"); + break; #endif /* EAP_SUPPORT */ - default: - printer(arg, "0x%x", cishort); - } - } - break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #if LQR_SUPPORT - case CI_QUALITY: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "quality "); - GETSHORT(cishort, p); - switch (cishort) { - case PPP_LQR: - printer(arg, "lqr"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_QUALITY: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "quality "); + GETSHORT(cishort, p); + switch (cishort) { + case PPP_LQR: + printer(arg, "lqr"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* LQR_SUPPORT */ - case CI_CALLBACK: - if (olen >= CILEN_CHAR) { - p += 2; - printer(arg, "callback "); - GETCHAR(cishort, p); - switch (cishort) { - case CBCP_OPT: - printer(arg, "CBCP"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_MAGICNUMBER: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "magic 0x%x", cilong); - } - break; - case CI_PCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "pcomp"); - } - break; - case CI_ACCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "accomp"); - } - break; - case CI_MRRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mrru %d", cishort); - } - break; - case CI_SSNHF: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "ssnhf"); - } - break; - case CI_EPDISC: + case CI_CALLBACK: + if (olen >= CILEN_CHAR) { + p += 2; + printer(arg, "callback "); + GETCHAR(cishort, p); + switch (cishort) { + case CBCP_OPT: + printer(arg, "CBCP"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; + case CI_MAGICNUMBER: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "magic 0x%x", cilong); + } + break; + case CI_PCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "pcomp"); + } + break; + case CI_ACCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "accomp"); + } + break; + case CI_MRRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mrru %d", cishort); + } + break; + case CI_SSNHF: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "ssnhf"); + } + break; + case CI_EPDISC: #ifdef HAVE_MULTILINK - if (olen >= CILEN_CHAR) { - struct epdisc epd; - p += 2; - GETCHAR(epd.class, p); - epd.length = olen - CILEN_CHAR; - if (epd.length > MAX_ENDP_LEN) - epd.length = MAX_ENDP_LEN; - if (epd.length > 0) { - MEMCPY(epd.value, p, epd.length); - p += epd.length; - } - printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); - } + if (olen >= CILEN_CHAR) { + struct epdisc epd; + p += 2; + GETCHAR(epd.class, p); + epd.length = olen - CILEN_CHAR; + if (epd.length > MAX_ENDP_LEN) + epd.length = MAX_ENDP_LEN; + if (epd.length > 0) { + MEMCPY(epd.value, p, epd.length); + p += epd.length; + } + printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); + } #else - printer(arg, "endpoint"); + printer(arg, "endpoint"); #endif - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; case ECHOREQ: case ECHOREP: case DISCREQ: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + break; case IDENTIF: case TIMEREM: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - if (code == TIMEREM) { - if (len < 4) - break; - GETLONG(cilong, p); - printer(arg, " seconds=%u", cilong); - len -= 4; - } - if (len > 0) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + if (code == TIMEREM) { + if (len < 4) + break; + GETLONG(cilong, p); + printer(arg, " seconds=%u", cilong); + len -= 4; + } + if (len > 0) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (i = 0; i < len && i < 32; ++i) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } if (i < len) { - printer(arg, " ..."); - p += len - i; + printer(arg, " ..."); + p += len - i; } return p - pstart; @@ -2639,10 +2639,10 @@ static int lcp_printpkt(const u_char *p, int plen, static void LcpLinkFailure(fsm *f) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED) { - ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); + ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); ppp_notice("Serial link appears to be disconnected."); - pcb->err_code = PPPERR_PEERDEAD; - lcp_close(pcb, "Peer not responding"); + pcb->err_code = PPPERR_PEERDEAD; + lcp_close(pcb, "Peer not responding"); } } @@ -2655,13 +2655,13 @@ static void LcpEchoCheck(fsm *f) { LcpSendEchoRequest (f); if (f->state != PPP_FSM_OPENED) - return; + return; /* * Start the timer for the next interval. */ if (pcb->lcp_echo_timer_running) - ppp_warn("assertion lcp_echo_timer_running==0 failed"); + ppp_warn("assertion lcp_echo_timer_running==0 failed"); TIMEOUT (LcpEchoTimeout, f, pcb->settings.lcp_echo_interval); pcb->lcp_echo_timer_running = 1; } @@ -2691,14 +2691,14 @@ static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) { /* Check the magic number - don't count replies from ourselves. */ if (len < 4) { - ppp_dbglog("lcp: received short Echo-Reply, length %d", len); - return; + ppp_dbglog("lcp: received short Echo-Reply, length %d", len); + return; } GETLONG(magic_val, inp); if (go->neg_magicnumber - && magic_val == go->magicnumber) { - ppp_warn("appear to have received our own echo-reply!"); - return; + && magic_val == go->magicnumber) { + ppp_warn("appear to have received our own echo-reply!"); + return; } /* Reset the number of outstanding echo frames */ @@ -2722,7 +2722,7 @@ static void LcpSendEchoRequest(fsm *f) { if (pcb->lcp_echos_pending >= pcb->settings.lcp_echo_fails) { LcpLinkFailure(f); pcb->lcp_echos_pending = 0; - } + } } #if PPP_LCP_ADAPTIVE @@ -2731,17 +2731,17 @@ static void LcpSendEchoRequest(fsm *f) { * no traffic was received since the last one. */ if (pcb->settings.lcp_echo_adaptive) { - static unsigned int last_pkts_in = 0; + static unsigned int last_pkts_in = 0; #if PPP_STATS_SUPPORT - update_link_stats(f->unit); - link_stats_valid = 0; + update_link_stats(f->unit); + link_stats_valid = 0; #endif /* PPP_STATS_SUPPORT */ - if (link_stats.pkts_in != last_pkts_in) { - last_pkts_in = link_stats.pkts_in; - return; - } + if (link_stats.pkts_in != last_pkts_in) { + last_pkts_in = link_stats.pkts_in; + return; + } } #endif @@ -2750,10 +2750,10 @@ static void LcpSendEchoRequest(fsm *f) { */ if (f->state == PPP_FSM_OPENED) { lcp_magic = go->magicnumber; - pktp = pkt; - PUTLONG(lcp_magic, pktp); + pktp = pkt; + PUTLONG(lcp_magic, pktp); fsm_sdata(f, ECHOREQ, pcb->lcp_echo_number++, pkt, pktp - pkt); - ++pcb->lcp_echos_pending; + ++pcb->lcp_echos_pending; } } @@ -2768,7 +2768,7 @@ static void lcp_echo_lowerup(ppp_pcb *pcb) { pcb->lcp_echos_pending = 0; pcb->lcp_echo_number = 0; pcb->lcp_echo_timer_running = 0; - + /* If a timeout interval is specified then start the timer */ if (pcb->settings.lcp_echo_interval != 0) LcpEchoCheck (f); diff --git a/components/net/lwip-2.1.2/src/netif/ppp/mppe.c b/components/net/lwip-2.1.2/src/netif/ppp/mppe.c index 4cca89dec1..6e9ffe674e 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/mppe.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/mppe.c @@ -39,20 +39,20 @@ #define SHA1_SIGNATURE_SIZE 20 /* ppp_mppe_state.bits definitions */ -#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ -#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ -#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ -#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ +#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ +#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ +#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ +#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ -#define MPPE_BIT_FLUSHED MPPE_BIT_A -#define MPPE_BIT_ENCRYPTED MPPE_BIT_D +#define MPPE_BIT_FLUSHED MPPE_BIT_A +#define MPPE_BIT_ENCRYPTED MPPE_BIT_D #define MPPE_BITS(p) ((p)[0] & 0xf0) #define MPPE_CCOUNT(p) ((((p)[0] & 0x0f) << 8) + (p)[1]) -#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ +#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ -#define MPPE_OVHD 2 /* MPPE overhead/packet */ -#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ +#define MPPE_OVHD 2 /* MPPE overhead/packet */ +#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ /* * Perform the MPPE rekey algorithm, from RFC 3078, sec. 7.3. @@ -60,37 +60,37 @@ */ static void mppe_rekey(ppp_mppe_state * state, int initial_key) { - lwip_sha1_context sha1_ctx; - u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; - - /* - * Key Derivation, from RFC 3078, RFC 3079. - * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. - */ - lwip_sha1_init(&sha1_ctx); - lwip_sha1_starts(&sha1_ctx); - lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); - lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); - lwip_sha1_finish(&sha1_ctx, sha1_digest); - lwip_sha1_free(&sha1_ctx); - MEMCPY(state->session_key, sha1_digest, state->keylen); - - if (!initial_key) { - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); - lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); - lwip_arc4_free(&state->arc4); - } - if (state->keylen == 8) { - /* See RFC 3078 */ - state->session_key[0] = 0xd1; - state->session_key[1] = 0x26; - state->session_key[2] = 0x9e; - } - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); + lwip_sha1_context sha1_ctx; + u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; + + /* + * Key Derivation, from RFC 3078, RFC 3079. + * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. + */ + lwip_sha1_init(&sha1_ctx); + lwip_sha1_starts(&sha1_ctx); + lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1_ctx, sha1_digest); + lwip_sha1_free(&sha1_ctx); + MEMCPY(state->session_key, sha1_digest, state->keylen); + + if (!initial_key) { + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); + lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); + lwip_arc4_free(&state->arc4); + } + if (state->keylen == 8) { + /* See RFC 3078 */ + state->session_key[0] = 0xd1; + state->session_key[1] = 0x26; + state->session_key[2] = 0x9e; + } + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); } /* @@ -98,8 +98,8 @@ static void mppe_rekey(ppp_mppe_state * state, int initial_key) * don't have to keep multiple copies of keys. */ void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key) { - LWIP_UNUSED_ARG(pcb); - MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); + LWIP_UNUSED_ARG(pcb); + MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); } /* @@ -109,64 +109,64 @@ void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) { #if PPP_DEBUG - const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; - if (&pcb->mppe_decomp == state) { - debugstr = (const u8_t*)"mppe_decomp_init"; - } + const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; + if (&pcb->mppe_decomp == state) { + debugstr = (const u8_t*)"mppe_decomp_init"; + } #endif /* PPP_DEBUG */ - /* Save keys. */ - MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); - - if (options & MPPE_OPT_128) - state->keylen = 16; - else if (options & MPPE_OPT_40) - state->keylen = 8; - else { - PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, - pcb->netif->num)); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - return; - } - if (options & MPPE_OPT_STATEFUL) - state->stateful = 1; - - /* Generate the initial session key. */ - mppe_rekey(state, 1); + /* Save keys. */ + MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); + + if (options & MPPE_OPT_128) + state->keylen = 16; + else if (options & MPPE_OPT_40) + state->keylen = 8; + else { + PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, + pcb->netif->num)); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + return; + } + if (options & MPPE_OPT_STATEFUL) + state->stateful = 1; + + /* Generate the initial session key. */ + mppe_rekey(state, 1); #if PPP_DEBUG - { - int i; - char mkey[sizeof(state->master_key) * 2 + 1]; - char skey[sizeof(state->session_key) * 2 + 1]; - - PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", - debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, - (state->stateful) ? "stateful" : "stateless")); - - for (i = 0; i < (int)sizeof(state->master_key); i++) - sprintf(mkey + i * 2, "%02x", state->master_key[i]); - for (i = 0; i < (int)sizeof(state->session_key); i++) - sprintf(skey + i * 2, "%02x", state->session_key[i]); - PPPDEBUG(LOG_DEBUG, - ("%s[%d]: keys: master: %s initial session: %s\n", - debugstr, pcb->netif->num, mkey, skey)); - } + { + int i; + char mkey[sizeof(state->master_key) * 2 + 1]; + char skey[sizeof(state->session_key) * 2 + 1]; + + PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", + debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, + (state->stateful) ? "stateful" : "stateless")); + + for (i = 0; i < (int)sizeof(state->master_key); i++) + sprintf(mkey + i * 2, "%02x", state->master_key[i]); + for (i = 0; i < (int)sizeof(state->session_key); i++) + sprintf(skey + i * 2, "%02x", state->session_key[i]); + PPPDEBUG(LOG_DEBUG, + ("%s[%d]: keys: master: %s initial session: %s\n", + debugstr, pcb->netif->num, mkey, skey)); + } #endif /* PPP_DEBUG */ - /* - * Initialize the coherency count. The initial value is not specified - * in RFC 3078, but we can make a reasonable assumption that it will - * start at 0. Setting it to the max here makes the comp/decomp code - * do the right thing (determined through experiment). - */ - state->ccount = MPPE_CCOUNT_SPACE - 1; - - /* - * Note that even though we have initialized the key table, we don't - * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. - */ - state->bits = MPPE_BIT_ENCRYPTED; + /* + * Initialize the coherency count. The initial value is not specified + * in RFC 3078, but we can make a reasonable assumption that it will + * start at 0. Setting it to the max here makes the comp/decomp code + * do the right thing (determined through experiment). + */ + state->ccount = MPPE_CCOUNT_SPACE - 1; + + /* + * Note that even though we have initialized the key table, we don't + * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. + */ + state->bits = MPPE_BIT_ENCRYPTED; } /* @@ -180,8 +180,8 @@ mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) */ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - state->bits |= MPPE_BIT_FLUSHED; + LWIP_UNUSED_ARG(pcb); + state->bits |= MPPE_BIT_FLUSHED; } /* @@ -192,74 +192,74 @@ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol) { - struct pbuf *n, *np; - u8_t *pl; - err_t err; - - LWIP_UNUSED_ARG(pcb); - - /* TCP stack requires that we don't change the packet payload, therefore we copy - * the whole packet before encryption. - */ - np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_RAM); - if (!np) { - return ERR_MEM; - } - - /* Hide MPPE header + protocol */ - pbuf_remove_header(np, MPPE_OVHD + sizeof(protocol)); - - if ((err = pbuf_copy(np, *pb)) != ERR_OK) { - pbuf_free(np); - return err; - } - - /* Reveal MPPE header + protocol */ - pbuf_add_header(np, MPPE_OVHD + sizeof(protocol)); - - *pb = np; - pl = (u8_t*)np->payload; - - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); - /* FIXME: use PUT* macros */ - pl[0] = state->ccount>>8; - pl[1] = state->ccount; - - if (!state->stateful || /* stateless mode */ - ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ - (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ - /* We must rekey */ - if (state->stateful) { - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); - } - mppe_rekey(state, 0); - state->bits |= MPPE_BIT_FLUSHED; - } - pl[0] |= state->bits; - state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ - pl += MPPE_OVHD; - - /* Add protocol */ - /* FIXME: add PFC support */ - pl[0] = protocol >> 8; - pl[1] = protocol; - - /* Hide MPPE header */ - pbuf_remove_header(np, MPPE_OVHD); - - /* Encrypt packet */ - for (n = np; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* Reveal MPPE header */ - pbuf_add_header(np, MPPE_OVHD); - - return ERR_OK; + struct pbuf *n, *np; + u8_t *pl; + err_t err; + + LWIP_UNUSED_ARG(pcb); + + /* TCP stack requires that we don't change the packet payload, therefore we copy + * the whole packet before encryption. + */ + np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_RAM); + if (!np) { + return ERR_MEM; + } + + /* Hide MPPE header + protocol */ + pbuf_remove_header(np, MPPE_OVHD + sizeof(protocol)); + + if ((err = pbuf_copy(np, *pb)) != ERR_OK) { + pbuf_free(np); + return err; + } + + /* Reveal MPPE header + protocol */ + pbuf_add_header(np, MPPE_OVHD + sizeof(protocol)); + + *pb = np; + pl = (u8_t*)np->payload; + + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); + /* FIXME: use PUT* macros */ + pl[0] = state->ccount>>8; + pl[1] = state->ccount; + + if (!state->stateful || /* stateless mode */ + ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ + (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ + /* We must rekey */ + if (state->stateful) { + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); + } + mppe_rekey(state, 0); + state->bits |= MPPE_BIT_FLUSHED; + } + pl[0] |= state->bits; + state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ + pl += MPPE_OVHD; + + /* Add protocol */ + /* FIXME: add PFC support */ + pl[0] = protocol >> 8; + pl[1] = protocol; + + /* Hide MPPE header */ + pbuf_remove_header(np, MPPE_OVHD); + + /* Encrypt packet */ + for (n = np; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* Reveal MPPE header */ + pbuf_add_header(np, MPPE_OVHD); + + return ERR_OK; } /* @@ -267,9 +267,9 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto */ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - LWIP_UNUSED_ARG(state); - return; + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(state); + return; } /* @@ -278,135 +278,135 @@ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb) { - struct pbuf *n0 = *pb, *n; - u8_t *pl; - u16_t ccount; - u8_t flushed; - - /* MPPE Header */ - if (n0->len < MPPE_OVHD) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: short pkt (%d)\n", - pcb->netif->num, n0->len)); - state->sanity_errors += 100; - goto sanity_error; - } - - pl = (u8_t*)n0->payload; - flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; - ccount = MPPE_CCOUNT(pl); - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", - pcb->netif->num, ccount)); - - /* sanity checks -- terminate with extreme prejudice */ - if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", - pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (!state->stateful && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " - "stateless mode!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " - "flag packet!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - - /* - * Check the coherency count. - */ - - if (!state->stateful) { - /* Discard late packet */ - if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { - state->sanity_errors++; - goto sanity_error; - } - - /* RFC 3078, sec 8.1. Rekey for every packet. */ - while (state->ccount != ccount) { - mppe_rekey(state, 0); - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - } - } else { - /* RFC 3078, sec 8.2. */ - if (!state->discard) { - /* normal state */ - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - if (ccount != state->ccount) { - /* - * (ccount > state->ccount) - * Packet loss detected, enter the discard state. - * Signal the peer to rekey (by sending a CCP Reset-Request). - */ - state->discard = 1; - ccp_resetrequest(pcb); - return ERR_BUF; - } - } else { - /* discard state */ - if (!flushed) { - /* ccp.c will be silent (no additional CCP Reset-Requests). */ - return ERR_BUF; - } else { - /* Rekey for every missed "flag" packet. */ - while ((ccount & ~0xff) != - (state->ccount & ~0xff)) { - mppe_rekey(state, 0); - state->ccount = - (state->ccount + - 256) % MPPE_CCOUNT_SPACE; - } - - /* reset */ - state->discard = 0; - state->ccount = ccount; - /* - * Another problem with RFC 3078 here. It implies that the - * peer need not send a Reset-Ack packet. But RFC 1962 - * requires it. Hopefully, M$ does send a Reset-Ack; even - * though it isn't required for MPPE synchronization, it is - * required to reset CCP state. - */ - } - } - if (flushed) - mppe_rekey(state, 0); - } - - /* Hide MPPE header */ - pbuf_remove_header(n0, MPPE_OVHD); - - /* Decrypt the packet. */ - for (n = n0; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* good packet credit */ - state->sanity_errors >>= 1; - - return ERR_OK; + struct pbuf *n0 = *pb, *n; + u8_t *pl; + u16_t ccount; + u8_t flushed; + + /* MPPE Header */ + if (n0->len < MPPE_OVHD) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: short pkt (%d)\n", + pcb->netif->num, n0->len)); + state->sanity_errors += 100; + goto sanity_error; + } + + pl = (u8_t*)n0->payload; + flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; + ccount = MPPE_CCOUNT(pl); + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", + pcb->netif->num, ccount)); + + /* sanity checks -- terminate with extreme prejudice */ + if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", + pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (!state->stateful && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " + "stateless mode!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " + "flag packet!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + + /* + * Check the coherency count. + */ + + if (!state->stateful) { + /* Discard late packet */ + if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { + state->sanity_errors++; + goto sanity_error; + } + + /* RFC 3078, sec 8.1. Rekey for every packet. */ + while (state->ccount != ccount) { + mppe_rekey(state, 0); + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + } + } else { + /* RFC 3078, sec 8.2. */ + if (!state->discard) { + /* normal state */ + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + if (ccount != state->ccount) { + /* + * (ccount > state->ccount) + * Packet loss detected, enter the discard state. + * Signal the peer to rekey (by sending a CCP Reset-Request). + */ + state->discard = 1; + ccp_resetrequest(pcb); + return ERR_BUF; + } + } else { + /* discard state */ + if (!flushed) { + /* ccp.c will be silent (no additional CCP Reset-Requests). */ + return ERR_BUF; + } else { + /* Rekey for every missed "flag" packet. */ + while ((ccount & ~0xff) != + (state->ccount & ~0xff)) { + mppe_rekey(state, 0); + state->ccount = + (state->ccount + + 256) % MPPE_CCOUNT_SPACE; + } + + /* reset */ + state->discard = 0; + state->ccount = ccount; + /* + * Another problem with RFC 3078 here. It implies that the + * peer need not send a Reset-Ack packet. But RFC 1962 + * requires it. Hopefully, M$ does send a Reset-Ack; even + * though it isn't required for MPPE synchronization, it is + * required to reset CCP state. + */ + } + } + if (flushed) + mppe_rekey(state, 0); + } + + /* Hide MPPE header */ + pbuf_remove_header(n0, MPPE_OVHD); + + /* Decrypt the packet. */ + for (n = n0; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* good packet credit */ + state->sanity_errors >>= 1; + + return ERR_OK; sanity_error: - if (state->sanity_errors >= SANITY_MAX) { - /* - * Take LCP down if the peer is sending too many bogons. - * We don't want to do this for a single or just a few - * instances since it could just be due to packet corruption. - */ - lcp_close(pcb, "Too many MPPE errors"); - } - return ERR_BUF; + if (state->sanity_errors >= SANITY_MAX) { + /* + * Take LCP down if the peer is sending too many bogons. + * We don't want to do this for a single or just a few + * instances since it could just be due to packet corruption. + */ + lcp_close(pcb, "Too many MPPE errors"); + } + return ERR_BUF; } #endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/multilink.c b/components/net/lwip-2.1.2/src/netif/ppp/multilink.c index 62014e8c87..08e8130d48 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/multilink.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/multilink.c @@ -55,11 +55,11 @@ #include "netif/ppp/lcp.h" #include "netif/ppp/tdb.h" -bool endpoint_specified; /* user gave explicit endpoint discriminator */ -char *bundle_id; /* identifier for our bundle */ -char *blinks_id; /* key for the list of links */ -bool doing_multilink; /* multilink was enabled and agreed to */ -bool multilink_master; /* we own the multilink bundle */ +bool endpoint_specified; /* user gave explicit endpoint discriminator */ +char *bundle_id; /* identifier for our bundle */ +char *blinks_id; /* key for the list of links */ +bool doing_multilink; /* multilink was enabled and agreed to */ +bool multilink_master; /* we own the multilink bundle */ extern TDB_CONTEXT *pppdb; extern char db_key[]; @@ -72,43 +72,43 @@ static int get_default_epdisc (struct epdisc *); static int parse_num (char *str, const char *key, int *valp); static int owns_unit (TDB_DATA pid, int unit); -#define set_ip_epdisc(ep, addr) do { \ - ep->length = 4; \ - ep->value[0] = addr >> 24; \ - ep->value[1] = addr >> 16; \ - ep->value[2] = addr >> 8; \ - ep->value[3] = addr; \ +#define set_ip_epdisc(ep, addr) do { \ + ep->length = 4; \ + ep->value[0] = addr >> 24; \ + ep->value[1] = addr >> 16; \ + ep->value[2] = addr >> 8; \ + ep->value[3] = addr; \ } while (0) -#define LOCAL_IP_ADDR(addr) \ - (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ - || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ - || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ +#define LOCAL_IP_ADDR(addr) \ + (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ + || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ + || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ -#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) +#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) void mp_check_options() { - lcp_options *wo = &lcp_wantoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - - doing_multilink = 0; - if (!multilink) - return; - /* if we're doing multilink, we have to negotiate MRRU */ - if (!wo->neg_mrru) { - /* mrru not specified, default to mru */ - wo->mrru = wo->mru; - wo->neg_mrru = 1; - } - ao->mrru = ao->mru; - ao->neg_mrru = 1; - - if (!wo->neg_endpoint && !noendpoint) { - /* get a default endpoint value */ - wo->neg_endpoint = get_default_epdisc(&wo->endpoint); - } + lcp_options *wo = &lcp_wantoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + + doing_multilink = 0; + if (!multilink) + return; + /* if we're doing multilink, we have to negotiate MRRU */ + if (!wo->neg_mrru) { + /* mrru not specified, default to mru */ + wo->mrru = wo->mru; + wo->neg_mrru = 1; + } + ao->mrru = ao->mru; + ao->neg_mrru = 1; + + if (!wo->neg_endpoint && !noendpoint) { + /* get a default endpoint value */ + wo->neg_endpoint = get_default_epdisc(&wo->endpoint); + } } /* @@ -118,289 +118,289 @@ mp_check_options() int mp_join_bundle() { - lcp_options *go = &lcp_gotoptions[0]; - lcp_options *ho = &lcp_hisoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - int unit, pppd_pid; - int l, mtu; - char *p; - TDB_DATA key, pid, rec; - - if (doing_multilink) { - /* have previously joined a bundle */ - if (!go->neg_mrru || !ho->neg_mrru) { - notice("oops, didn't get multilink on renegotiation"); - lcp_close(pcb, "multilink required"); - return 0; - } - /* XXX should check the peer_authname and ho->endpoint - are the same as previously */ - return 0; - } - - if (!go->neg_mrru || !ho->neg_mrru) { - /* not doing multilink */ - if (go->neg_mrru) - notice("oops, multilink negotiated only for receive"); - mtu = ho->neg_mru? ho->mru: PPP_MRU; - if (mtu > ao->mru) - mtu = ao->mru; - if (demand) { - /* already have a bundle */ - cfg_bundle(0, 0, 0, 0); - netif_set_mtu(pcb, mtu); - return 0; - } - make_new_bundle(0, 0, 0, 0); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - return 0; - } - - doing_multilink = 1; - - /* - * Find the appropriate bundle or join a new one. - * First we make up a name for the bundle. - * The length estimate is worst-case assuming every - * character has to be quoted. - */ - l = 4 * strlen(peer_authname) + 10; - if (ho->neg_endpoint) - l += 3 * ho->endpoint.length + 8; - if (bundle_name) - l += 3 * strlen(bundle_name) + 2; - bundle_id = malloc(l); - if (bundle_id == 0) - novm("bundle identifier"); - - p = bundle_id; - p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); - if (ho->neg_endpoint || bundle_name) - *p++ = '/'; - if (ho->neg_endpoint) - p += slprintf(p, bundle_id+l-p, "%s", - epdisc_to_str(&ho->endpoint)); - if (bundle_name) - p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); - - /* Make the key for the list of links belonging to the bundle */ - l = p - bundle_id; - blinks_id = malloc(l + 7); - if (blinks_id == NULL) - novm("bundle links key"); - slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); - - /* - * For demand mode, we only need to configure the bundle - * and attach the link. - */ - mtu = LWIP_MIN(ho->mrru, ao->mru); - if (demand) { - cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - return 0; - } - - /* - * Check if the bundle ID is already in the database. - */ - unit = -1; - lock_db(); - key.dptr = bundle_id; - key.dsize = p - bundle_id; - pid = tdb_fetch(pppdb, key); - if (pid.dptr != NULL) { - /* bundle ID exists, see if the pppd record exists */ - rec = tdb_fetch(pppdb, pid); - if (rec.dptr != NULL && rec.dsize > 0) { - /* make sure the string is null-terminated */ - rec.dptr[rec.dsize-1] = 0; - /* parse the interface number */ - parse_num(rec.dptr, "IFNAME=ppp", &unit); - /* check the pid value */ - if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) - || !process_exists(pppd_pid) - || !owns_unit(pid, unit)) - unit = -1; - free(rec.dptr); - } - free(pid.dptr); - } - - if (unit >= 0) { - /* attach to existing unit */ - if (bundle_attach(unit)) { - set_ifunit(0); - script_setenv("BUNDLE", bundle_id + 7, 0); - make_bundle_links(1); - unlock_db(); - info("Link attached to %s", ifname); - return 1; - } - /* attach failed because bundle doesn't exist */ - } - - /* we have to make a new bundle */ - make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - make_bundle_links(pcb); - unlock_db(); - info("New bundle %s created", ifname); - multilink_master = 1; - return 0; + lcp_options *go = &lcp_gotoptions[0]; + lcp_options *ho = &lcp_hisoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + int unit, pppd_pid; + int l, mtu; + char *p; + TDB_DATA key, pid, rec; + + if (doing_multilink) { + /* have previously joined a bundle */ + if (!go->neg_mrru || !ho->neg_mrru) { + notice("oops, didn't get multilink on renegotiation"); + lcp_close(pcb, "multilink required"); + return 0; + } + /* XXX should check the peer_authname and ho->endpoint + are the same as previously */ + return 0; + } + + if (!go->neg_mrru || !ho->neg_mrru) { + /* not doing multilink */ + if (go->neg_mrru) + notice("oops, multilink negotiated only for receive"); + mtu = ho->neg_mru? ho->mru: PPP_MRU; + if (mtu > ao->mru) + mtu = ao->mru; + if (demand) { + /* already have a bundle */ + cfg_bundle(0, 0, 0, 0); + netif_set_mtu(pcb, mtu); + return 0; + } + make_new_bundle(0, 0, 0, 0); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + return 0; + } + + doing_multilink = 1; + + /* + * Find the appropriate bundle or join a new one. + * First we make up a name for the bundle. + * The length estimate is worst-case assuming every + * character has to be quoted. + */ + l = 4 * strlen(peer_authname) + 10; + if (ho->neg_endpoint) + l += 3 * ho->endpoint.length + 8; + if (bundle_name) + l += 3 * strlen(bundle_name) + 2; + bundle_id = malloc(l); + if (bundle_id == 0) + novm("bundle identifier"); + + p = bundle_id; + p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); + if (ho->neg_endpoint || bundle_name) + *p++ = '/'; + if (ho->neg_endpoint) + p += slprintf(p, bundle_id+l-p, "%s", + epdisc_to_str(&ho->endpoint)); + if (bundle_name) + p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); + + /* Make the key for the list of links belonging to the bundle */ + l = p - bundle_id; + blinks_id = malloc(l + 7); + if (blinks_id == NULL) + novm("bundle links key"); + slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); + + /* + * For demand mode, we only need to configure the bundle + * and attach the link. + */ + mtu = LWIP_MIN(ho->mrru, ao->mru); + if (demand) { + cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + return 0; + } + + /* + * Check if the bundle ID is already in the database. + */ + unit = -1; + lock_db(); + key.dptr = bundle_id; + key.dsize = p - bundle_id; + pid = tdb_fetch(pppdb, key); + if (pid.dptr != NULL) { + /* bundle ID exists, see if the pppd record exists */ + rec = tdb_fetch(pppdb, pid); + if (rec.dptr != NULL && rec.dsize > 0) { + /* make sure the string is null-terminated */ + rec.dptr[rec.dsize-1] = 0; + /* parse the interface number */ + parse_num(rec.dptr, "IFNAME=ppp", &unit); + /* check the pid value */ + if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) + || !process_exists(pppd_pid) + || !owns_unit(pid, unit)) + unit = -1; + free(rec.dptr); + } + free(pid.dptr); + } + + if (unit >= 0) { + /* attach to existing unit */ + if (bundle_attach(unit)) { + set_ifunit(0); + script_setenv("BUNDLE", bundle_id + 7, 0); + make_bundle_links(1); + unlock_db(); + info("Link attached to %s", ifname); + return 1; + } + /* attach failed because bundle doesn't exist */ + } + + /* we have to make a new bundle */ + make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + make_bundle_links(pcb); + unlock_db(); + info("New bundle %s created", ifname); + multilink_master = 1; + return 0; } void mp_exit_bundle() { - lock_db(); - remove_bundle_link(); - unlock_db(); + lock_db(); + remove_bundle_link(); + unlock_db(); } static void sendhup(char *str) { - int pid; + int pid; - if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { - if (debug) - dbglog("sending SIGHUP to process %d", pid); - kill(pid, SIGHUP); - } + if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { + if (debug) + dbglog("sending SIGHUP to process %d", pid); + kill(pid, SIGHUP); + } } void mp_bundle_terminated() { - TDB_DATA key; + TDB_DATA key; - bundle_terminating = 1; - upper_layers_down(pcb); - notice("Connection terminated."); + bundle_terminating = 1; + upper_layers_down(pcb); + notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ - if (!demand) { - remove_pidfiles(); - script_unsetenv("IFNAME"); - } - - lock_db(); - destroy_bundle(); - iterate_bundle_links(sendhup); - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - tdb_delete(pppdb, key); - unlock_db(); - - new_phase(PPP_PHASE_DEAD); - - doing_multilink = 0; - multilink_master = 0; + if (!demand) { + remove_pidfiles(); + script_unsetenv("IFNAME"); + } + + lock_db(); + destroy_bundle(); + iterate_bundle_links(sendhup); + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + tdb_delete(pppdb, key); + unlock_db(); + + new_phase(PPP_PHASE_DEAD); + + doing_multilink = 0; + multilink_master = 0; } static void make_bundle_links(int append) { - TDB_DATA key, rec; - char *p; - char entry[32]; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - p = entry; - if (append) { - rec = tdb_fetch(pppdb, key); - if (rec.dptr != NULL && rec.dsize > 0) { - rec.dptr[rec.dsize-1] = 0; - if (strstr(rec.dptr, db_key) != NULL) { - /* already in there? strange */ - warn("link entry already exists in tdb"); - return; - } - l = rec.dsize + strlen(entry); - p = malloc(l); - if (p == NULL) - novm("bundle link list"); - slprintf(p, l, "%s%s", rec.dptr, entry); - } else { - warn("bundle link list not found"); - } - if (rec.dptr != NULL) - free(rec.dptr); - } - rec.dptr = p; - rec.dsize = strlen(p) + 1; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't %s bundle link list", - append? "update": "create"); - if (p != entry) - free(p); + TDB_DATA key, rec; + char *p; + char entry[32]; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + p = entry; + if (append) { + rec = tdb_fetch(pppdb, key); + if (rec.dptr != NULL && rec.dsize > 0) { + rec.dptr[rec.dsize-1] = 0; + if (strstr(rec.dptr, db_key) != NULL) { + /* already in there? strange */ + warn("link entry already exists in tdb"); + return; + } + l = rec.dsize + strlen(entry); + p = malloc(l); + if (p == NULL) + novm("bundle link list"); + slprintf(p, l, "%s%s", rec.dptr, entry); + } else { + warn("bundle link list not found"); + } + if (rec.dptr != NULL) + free(rec.dptr); + } + rec.dptr = p; + rec.dsize = strlen(p) + 1; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't %s bundle link list", + append? "update": "create"); + if (p != entry) + free(p); } static void remove_bundle_link() { - TDB_DATA key, rec; - char entry[32]; - char *p, *q; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - rec.dptr[rec.dsize-1] = 0; - p = strstr(rec.dptr, entry); - if (p != NULL) { - q = p + strlen(entry); - l = strlen(q) + 1; - memmove(p, q, l); - rec.dsize = p - rec.dptr + l; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't update bundle link list (removal)"); - } - free(rec.dptr); + TDB_DATA key, rec; + char entry[32]; + char *p, *q; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + rec.dptr[rec.dsize-1] = 0; + p = strstr(rec.dptr, entry); + if (p != NULL) { + q = p + strlen(entry); + l = strlen(q) + 1; + memmove(p, q, l); + rec.dsize = p - rec.dptr + l; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't update bundle link list (removal)"); + } + free(rec.dptr); } static void iterate_bundle_links(void (*func)(char *)) { - TDB_DATA key, rec, pp; - char *p, *q; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - error("bundle link list not found (iterating list)"); - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - p = rec.dptr; - p[rec.dsize-1] = 0; - while ((q = strchr(p, ';')) != NULL) { - *q = 0; - key.dptr = p; - key.dsize = q - p; - pp = tdb_fetch(pppdb, key); - if (pp.dptr != NULL && pp.dsize > 0) { - pp.dptr[pp.dsize-1] = 0; - func(pp.dptr); - } - if (pp.dptr != NULL) - free(pp.dptr); - p = q + 1; - } - free(rec.dptr); + TDB_DATA key, rec, pp; + char *p, *q; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + error("bundle link list not found (iterating list)"); + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + p = rec.dptr; + p[rec.dsize-1] = 0; + while ((q = strchr(p, ';')) != NULL) { + *q = 0; + key.dptr = p; + key.dsize = q - p; + pp = tdb_fetch(pppdb, key); + if (pp.dptr != NULL && pp.dsize > 0) { + pp.dptr[pp.dsize-1] = 0; + func(pp.dptr); + } + if (pp.dptr != NULL) + free(pp.dptr); + p = q + 1; + } + free(rec.dptr); } static int @@ -409,19 +409,19 @@ parse_num(str, key, valp) const char *key; int *valp; { - char *p, *endp; - int i; - - p = strstr(str, key); - if (p != 0) { - p += strlen(key); - i = strtol(p, &endp, 10); - if (endp != p && (*endp == 0 || *endp == ';')) { - *valp = i; - return 1; - } - } - return 0; + char *p, *endp; + int i; + + p = strstr(str, key); + if (p != 0) { + p += strlen(key); + i = strtol(p, &endp, 10); + if (endp != p && (*endp == 0 || *endp == ';')) { + *valp = i; + return 1; + } + } + return 0; } /* @@ -432,53 +432,53 @@ owns_unit(key, unit) TDB_DATA key; int unit; { - char ifkey[32]; - TDB_DATA kd, vd; - int ret = 0; - - slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); - kd.dptr = ifkey; - kd.dsize = strlen(ifkey); - vd = tdb_fetch(pppdb, kd); - if (vd.dptr != NULL) { - ret = vd.dsize == key.dsize - && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; - free(vd.dptr); - } - return ret; + char ifkey[32]; + TDB_DATA kd, vd; + int ret = 0; + + slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); + kd.dptr = ifkey; + kd.dsize = strlen(ifkey); + vd = tdb_fetch(pppdb, kd); + if (vd.dptr != NULL) { + ret = vd.dsize == key.dsize + && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; + free(vd.dptr); + } + return ret; } static int get_default_epdisc(ep) struct epdisc *ep; { - char *p; - struct hostent *hp; - u32_t addr; - - /* First try for an ethernet MAC address */ - p = get_first_ethernet(); - if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { - ep->class = EPD_MAC; - ep->length = 6; - return 1; - } - - /* see if our hostname corresponds to a reasonable IP address */ - hp = gethostbyname(hostname); - if (hp != NULL) { - addr = *(u32_t *)hp->h_addr; - if (!bad_ip_adrs(addr)) { - addr = lwip_ntohl(addr); - if (!LOCAL_IP_ADDR(addr)) { - ep->class = EPD_IP; - set_ip_epdisc(ep, addr); - return 1; - } - } - } - - return 0; + char *p; + struct hostent *hp; + u32_t addr; + + /* First try for an ethernet MAC address */ + p = get_first_ethernet(); + if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { + ep->class = EPD_MAC; + ep->length = 6; + return 1; + } + + /* see if our hostname corresponds to a reasonable IP address */ + hp = gethostbyname(hostname); + if (hp != NULL) { + addr = *(u32_t *)hp->h_addr; + if (!bad_ip_adrs(addr)) { + addr = lwip_ntohl(addr); + if (!LOCAL_IP_ADDR(addr)) { + ep->class = EPD_IP; + set_ip_epdisc(ep, addr); + return 1; + } + } + } + + return 0; } /* @@ -493,51 +493,51 @@ char * epdisc_to_str(ep) struct epdisc *ep; { - static char str[MAX_ENDP_LEN*3+8]; - u_char *p = ep->value; - int i, mask = 0; - char *q, c, c2; - - if (ep->class == EPD_NULL && ep->length == 0) - return "null"; - if (ep->class == EPD_IP && ep->length == 4) { - u32_t addr; - - GETLONG(addr, p); - slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); - return str; - } - - c = ':'; - c2 = '.'; - if (ep->class == EPD_MAC && ep->length == 6) - c2 = ':'; - else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) - mask = 3; - q = str; - if (ep->class <= EPD_PHONENUM) - q += slprintf(q, sizeof(str)-1, "%s", - endp_class_names[ep->class]); - else - q += slprintf(q, sizeof(str)-1, "%d", ep->class); - c = ':'; - for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { - if ((i & mask) == 0) { - *q++ = c; - c = c2; - } - q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); - } - return str; + static char str[MAX_ENDP_LEN*3+8]; + u_char *p = ep->value; + int i, mask = 0; + char *q, c, c2; + + if (ep->class == EPD_NULL && ep->length == 0) + return "null"; + if (ep->class == EPD_IP && ep->length == 4) { + u32_t addr; + + GETLONG(addr, p); + slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); + return str; + } + + c = ':'; + c2 = '.'; + if (ep->class == EPD_MAC && ep->length == 6) + c2 = ':'; + else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) + mask = 3; + q = str; + if (ep->class <= EPD_PHONENUM) + q += slprintf(q, sizeof(str)-1, "%s", + endp_class_names[ep->class]); + else + q += slprintf(q, sizeof(str)-1, "%d", ep->class); + c = ':'; + for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { + if ((i & mask) == 0) { + *q++ = c; + c = c2; + } + q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); + } + return str; } static int hexc_val(int c) { - if (c >= 'a') - return c - 'a' + 10; - if (c >= 'A') - return c - 'A' + 10; - return c - '0'; + if (c >= 'a') + return c - 'a' + 10; + if (c >= 'A') + return c - 'A' + 10; + return c - '0'; } int @@ -545,65 +545,65 @@ str_to_epdisc(ep, str) struct epdisc *ep; char *str; { - int i, l; - char *p, *endp; - - for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { - int sl = strlen(endp_class_names[i]); - if (strncasecmp(str, endp_class_names[i], sl) == 0) { - str += sl; - break; - } - } - if (i > EPD_PHONENUM) { - /* not a class name, try a decimal class number */ - i = strtol(str, &endp, 10); - if (endp == str) - return 0; /* can't parse class number */ - str = endp; - } - ep->class = i; - if (*str == 0) { - ep->length = 0; - return 1; - } - if (*str != ':' && *str != '.') - return 0; - ++str; - - if (i == EPD_IP) { - u32_t addr; - i = parse_dotted_ip(str, &addr); - if (i == 0 || str[i] != 0) - return 0; - set_ip_epdisc(ep, addr); - return 1; - } - if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { - ep->length = 6; - return 1; - } - - p = str; - for (l = 0; l < MAX_ENDP_LEN; ++l) { - if (*str == 0) - break; - if (p <= str) - for (p = str; isxdigit(*p); ++p) - ; - i = p - str; - if (i == 0) - return 0; - ep->value[l] = hexc_val(*str++); - if ((i & 1) == 0) - ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); - if (*str == ':' || *str == '.') - ++str; - } - if (*str != 0 || (ep->class == EPD_MAC && l != 6)) - return 0; - ep->length = l; - return 1; + int i, l; + char *p, *endp; + + for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { + int sl = strlen(endp_class_names[i]); + if (strncasecmp(str, endp_class_names[i], sl) == 0) { + str += sl; + break; + } + } + if (i > EPD_PHONENUM) { + /* not a class name, try a decimal class number */ + i = strtol(str, &endp, 10); + if (endp == str) + return 0; /* can't parse class number */ + str = endp; + } + ep->class = i; + if (*str == 0) { + ep->length = 0; + return 1; + } + if (*str != ':' && *str != '.') + return 0; + ++str; + + if (i == EPD_IP) { + u32_t addr; + i = parse_dotted_ip(str, &addr); + if (i == 0 || str[i] != 0) + return 0; + set_ip_epdisc(ep, addr); + return 1; + } + if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { + ep->length = 6; + return 1; + } + + p = str; + for (l = 0; l < MAX_ENDP_LEN; ++l) { + if (*str == 0) + break; + if (p <= str) + for (p = str; isxdigit(*p); ++p) + ; + i = p - str; + if (i == 0) + return 0; + ep->value[l] = hexc_val(*str++); + if ((i & 1) == 0) + ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); + if (*str == ':' || *str == '.') + ++str; + } + if (*str != 0 || (ep->class == EPD_MAC && l != 6)) + return 0; + ep->length = l; + return 1; } #endif /* PPP_SUPPORT && HAVE_MULTILINK */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c index 6e17ec421b..cb31b8761e 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c index 9a89d007bd..b01e07fa5c 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c index b1701a07b9..34e5b10cd4 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c index 1ec4d81a69..fa6365848f 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -156,7 +156,7 @@ static void md5_process( md5_context *ctx, const unsigned char data[64] ) P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F - + #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c index c2192eac54..6079af3ba2 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ppp.c b/components/net/lwip-2.1.2/src/netif/ppp/ppp.c index a9c18e304f..d2eaf5594e 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ppp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ppp.c @@ -633,7 +633,7 @@ int ppp_init(void) return 0; } - + /* * Create a new PPP control block. * diff --git a/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c b/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c index 947f7ba8c1..0ad8e986b4 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c @@ -57,10 +57,10 @@ LWIP_MEMPOOL_DECLARE(PPPAPI_MSG, MEMP_NUM_PPP_API_MSG, sizeof(struct pppapi_msg) static err_t pppapi_do_ppp_set_default(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; - + ppp_set_default(msg->msg.ppp); return ERR_OK; } @@ -90,7 +90,7 @@ pppapi_set_default(ppp_pcb *pcb) static err_t pppapi_do_ppp_set_notify_phase_callback(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -125,7 +125,7 @@ pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_pha static err_t pppapi_do_pppos_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -166,7 +166,7 @@ pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, static err_t pppapi_do_pppoe_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -211,7 +211,7 @@ pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *servic static err_t pppapi_do_pppol2tp_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -270,7 +270,7 @@ pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipad static err_t pppapi_do_ppp_connect(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -303,7 +303,7 @@ pppapi_connect(ppp_pcb *pcb, u16_t holdoff) static err_t pppapi_do_ppp_listen(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -335,7 +335,7 @@ pppapi_listen(ppp_pcb *pcb) static err_t pppapi_do_ppp_close(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -367,7 +367,7 @@ pppapi_close(ppp_pcb *pcb, u8_t nocarrier) static err_t pppapi_do_ppp_free(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -398,7 +398,7 @@ pppapi_free(ppp_pcb *pcb) static err_t pppapi_do_ppp_ioctl(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c b/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c index 82d78c13ac..81e4008d3d 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c @@ -39,28 +39,28 @@ static u_char pppcrypt_get_7bits(u_char *input, int startBit) { - unsigned int word; + unsigned int word; - word = (unsigned)input[startBit / 8] << 8; - word |= (unsigned)input[startBit / 8 + 1]; + word = (unsigned)input[startBit / 8] << 8; + word |= (unsigned)input[startBit / 8 + 1]; - word >>= 15 - (startBit % 8 + 7); + word >>= 15 - (startBit % 8 + 7); - return word & 0xFE; + return word & 0xFE; } /* IN 56 bit DES key missing parity bits * OUT 64 bit DES key with parity bits added */ void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { - des_key[0] = pppcrypt_get_7bits(key, 0); - des_key[1] = pppcrypt_get_7bits(key, 7); - des_key[2] = pppcrypt_get_7bits(key, 14); - des_key[3] = pppcrypt_get_7bits(key, 21); - des_key[4] = pppcrypt_get_7bits(key, 28); - des_key[5] = pppcrypt_get_7bits(key, 35); - des_key[6] = pppcrypt_get_7bits(key, 42); - des_key[7] = pppcrypt_get_7bits(key, 49); + des_key[0] = pppcrypt_get_7bits(key, 0); + des_key[1] = pppcrypt_get_7bits(key, 7); + des_key[2] = pppcrypt_get_7bits(key, 14); + des_key[3] = pppcrypt_get_7bits(key, 21); + des_key[4] = pppcrypt_get_7bits(key, 28); + des_key[5] = pppcrypt_get_7bits(key, 35); + des_key[6] = pppcrypt_get_7bits(key, 42); + des_key[7] = pppcrypt_get_7bits(key, 49); } #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c b/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c index 8ed2d638fd..461e8bce56 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -666,7 +666,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_remove_header failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } if (pb->len < sizeof(*ph)) { PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: could not get PPPoE header\n")); @@ -699,7 +699,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_remove_header PPPOE_HEADERLEN failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, diff --git a/components/net/lwip-2.1.2/src/netif/ppp/upap.c b/components/net/lwip-2.1.2/src/netif/ppp/upap.c index 3b2399dc23..23891284e5 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/upap.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/upap.c @@ -166,12 +166,12 @@ void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password) { /* Lower layer up yet? */ if (pcb->upap.us_clientstate == UPAPCS_INITIAL || - pcb->upap.us_clientstate == UPAPCS_PENDING) { - pcb->upap.us_clientstate = UPAPCS_PENDING; - return; + pcb->upap.us_clientstate == UPAPCS_PENDING) { + pcb->upap.us_clientstate = UPAPCS_PENDING; + return; } - upap_sauthreq(pcb); /* Start protocol */ + upap_sauthreq(pcb); /* Start protocol */ } #if PPP_SERVER @@ -184,14 +184,14 @@ void upap_authpeer(ppp_pcb *pcb) { /* Lower layer up yet? */ if (pcb->upap.us_serverstate == UPAPSS_INITIAL || - pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_PENDING; - return; + pcb->upap.us_serverstate == UPAPSS_PENDING) { + pcb->upap.us_serverstate = UPAPSS_PENDING; + return; } pcb->upap.us_serverstate = UPAPSS_LISTEN; if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ @@ -202,17 +202,17 @@ static void upap_timeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) - return; + return; if (pcb->upap.us_transmits >= pcb->settings.pap_max_transmits) { - /* give up in disgust */ - ppp_error("No response to PAP authenticate-requests"); - pcb->upap.us_clientstate = UPAPCS_BADAUTH; - auth_withpeer_fail(pcb, PPP_PAP); - return; + /* give up in disgust */ + ppp_error("No response to PAP authenticate-requests"); + pcb->upap.us_clientstate = UPAPCS_BADAUTH; + auth_withpeer_fail(pcb, PPP_PAP); + return; } - upap_sauthreq(pcb); /* Send Authenticate-Request */ + upap_sauthreq(pcb); /* Send Authenticate-Request */ } @@ -224,7 +224,7 @@ static void upap_reqtimeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_serverstate != UPAPSS_LISTEN) - return; /* huh?? */ + return; /* huh?? */ auth_peer_fail(pcb, PPP_PAP); pcb->upap.us_serverstate = UPAPSS_BADAUTH; @@ -240,18 +240,18 @@ static void upap_reqtimeout(void *arg) { static void upap_lowerup(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_INITIAL) - pcb->upap.us_clientstate = UPAPCS_CLOSED; + pcb->upap.us_clientstate = UPAPCS_CLOSED; else if (pcb->upap.us_clientstate == UPAPCS_PENDING) { - upap_sauthreq(pcb); /* send an auth-request */ + upap_sauthreq(pcb); /* send an auth-request */ } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_INITIAL) - pcb->upap.us_serverstate = UPAPSS_CLOSED; + pcb->upap.us_serverstate = UPAPSS_CLOSED; else if (pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_LISTEN; - if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + pcb->upap.us_serverstate = UPAPSS_LISTEN; + if (pcb->settings.pap_req_timeout > 0) + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ } @@ -264,11 +264,11 @@ static void upap_lowerup(ppp_pcb *pcb) { */ static void upap_lowerdown(ppp_pcb *pcb) { - if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ - UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ + if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ + UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN && pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); #endif /* PPP_SERVER */ pcb->upap.us_clientstate = UPAPCS_INITIAL; @@ -286,13 +286,13 @@ static void upap_lowerdown(ppp_pcb *pcb) { static void upap_protrej(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) { - ppp_error("PAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_PAP); } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN) { - ppp_error("PAP authentication of peer failed (protocol-reject)"); - auth_peer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication of peer failed (protocol-reject)"); + auth_peer_fail(pcb, PPP_PAP); } #endif /* PPP_SERVER */ upap_lowerdown(pcb); @@ -313,19 +313,19 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { */ inp = inpacket; if (l < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd short header.")); - return; + UPAPDEBUG(("pap_input: rcvd short header.")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd illegal length.")); - return; + UPAPDEBUG(("pap_input: rcvd illegal length.")); + return; } if (len > l) { - UPAPDEBUG(("pap_input: rcvd short packet.")); - return; + UPAPDEBUG(("pap_input: rcvd short packet.")); + return; } len -= UPAP_HEADERLEN; @@ -335,20 +335,20 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { switch (code) { case UPAP_AUTHREQ: #if PPP_SERVER - upap_rauthreq(pcb, inp, id, len); + upap_rauthreq(pcb, inp, id, len); #endif /* PPP_SERVER */ - break; + break; case UPAP_AUTHACK: - upap_rauthack(pcb, inp, id, len); - break; + upap_rauthack(pcb, inp, id, len); + break; case UPAP_AUTHNAK: - upap_rauthnak(pcb, inp, id, len); - break; + upap_rauthnak(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - break; + default: /* XXX Need code reject */ + break; } } @@ -366,40 +366,40 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { int msglen; if (pcb->upap.us_serverstate < UPAPSS_LISTEN) - return; + return; /* * If we receive a duplicate authenticate-request, we are * supposed to return the same status as for the first request. */ if (pcb->upap.us_serverstate == UPAPSS_OPEN) { - upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ - return; + upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ + return; } if (pcb->upap.us_serverstate == UPAPSS_BADAUTH) { - upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ - return; + upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ + return; } /* * Parse user/passwd. */ if (len < 1) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } GETCHAR(ruserlen, inp); len -= sizeof (u_char) + ruserlen + sizeof (u_char); if (len < 0) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } ruser = (char *) inp; INCPTR(ruserlen, inp); GETCHAR(rpasswdlen, inp); if (len < rpasswdlen) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } rpasswd = (char *) inp; @@ -420,16 +420,16 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { * return an authenticate failure, is leaving it for us to verify. */ if (retcode == UPAP_AUTHACK) { - if (!auth_number()) { - /* We do not want to leak info about the pap result. */ - retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ - warn("calling number %q is not authorized", remote_number); - } + if (!auth_number()) { + /* We do not want to leak info about the pap result. */ + retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ + warn("calling number %q is not authorized", remote_number); + } } msglen = strlen(msg); if (msglen > 255) - msglen = 255; + msglen = 255; #endif /* UNUSED */ upap_sresp(pcb, retcode, id, msg, msglen); @@ -438,17 +438,17 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { ppp_slprintf(rhostname, sizeof(rhostname), "%.*v", ruserlen, ruser); if (retcode == UPAP_AUTHACK) { - pcb->upap.us_serverstate = UPAPSS_OPEN; - ppp_notice("PAP peer authentication succeeded for %q", rhostname); - auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); + pcb->upap.us_serverstate = UPAPSS_OPEN; + ppp_notice("PAP peer authentication succeeded for %q", rhostname); + auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); } else { - pcb->upap.us_serverstate = UPAPSS_BADAUTH; - ppp_warn("PAP peer authentication failed for %q", rhostname); - auth_peer_fail(pcb, PPP_PAP); + pcb->upap.us_serverstate = UPAPSS_BADAUTH; + ppp_warn("PAP peer authentication failed for %q", rhostname); + auth_peer_fail(pcb, PPP_PAP); } if (pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); } #endif /* PPP_SERVER */ @@ -461,24 +461,24 @@ static void upap_rauthack(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthack: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthack: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_OPEN; @@ -496,24 +496,24 @@ static void upap_rauthnak(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_BADAUTH; @@ -532,7 +532,7 @@ static void upap_sauthreq(ppp_pcb *pcb) { int outlen; outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + - pcb->upap.us_userlen + pcb->upap.us_passwdlen; + pcb->upap.us_userlen + pcb->upap.us_passwdlen; p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE); if(NULL == p) return; @@ -606,68 +606,68 @@ static int upap_printpkt(const u_char *p, int plen, void (*printer) (void *, con const u_char *pstart; if (plen < UPAP_HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < UPAP_HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(upap_codenames)) - printer(arg, " %s", upap_codenames[code-1]); + printer(arg, " %s", upap_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= UPAP_HEADERLEN; switch (code) { case UPAP_AUTHREQ: - if (len < 1) - break; - ulen = p[0]; - if (len < ulen + 2) - break; - wlen = p[ulen + 1]; - if (len < ulen + wlen + 2) - break; - user = (const u_char *) (p + 1); - pwd = (const u_char *) (p + ulen + 2); - p += ulen + wlen + 2; - len -= ulen + wlen + 2; - printer(arg, " user="); - ppp_print_string(user, ulen, printer, arg); - printer(arg, " password="); + if (len < 1) + break; + ulen = p[0]; + if (len < ulen + 2) + break; + wlen = p[ulen + 1]; + if (len < ulen + wlen + 2) + break; + user = (const u_char *) (p + 1); + pwd = (const u_char *) (p + ulen + 2); + p += ulen + wlen + 2; + len -= ulen + wlen + 2; + printer(arg, " user="); + ppp_print_string(user, ulen, printer, arg); + printer(arg, " password="); /* FIXME: require ppp_pcb struct as printpkt() argument */ #if 0 - if (!pcb->settings.hide_password) + if (!pcb->settings.hide_password) #endif - ppp_print_string(pwd, wlen, printer, arg); + ppp_print_string(pwd, wlen, printer, arg); #if 0 - else - printer(arg, ""); + else + printer(arg, ""); #endif - break; + break; case UPAP_AUTHACK: case UPAP_AUTHNAK: - if (len < 1) - break; - mlen = p[0]; - if (len < mlen + 1) - break; - msg = (const u_char *) (p + 1); - p += mlen + 1; - len -= mlen + 1; - printer(arg, " "); - ppp_print_string(msg, mlen, printer, arg); - break; + if (len < 1) + break; + mlen = p[0]; + if (len < mlen + 1) + break; + msg = (const u_char *) (p + 1); + p += mlen + 1; + len -= mlen + 1; + printer(arg, " "); + ppp_print_string(msg, mlen, printer, arg); + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/utils.c b/components/net/lwip-2.1.2/src/netif/ppp/utils.c index f1366dae45..e9c8ba1cc4 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/utils.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/utils.c @@ -72,7 +72,7 @@ static void ppp_log_write(int level, char *buf); #if PRINTPKT_SUPPORT static void ppp_vslp_printer(void *arg, const char *fmt, ...); static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); struct buffer_info { char *ptr; @@ -88,12 +88,12 @@ size_t ppp_strlcpy(char *dest, const char *src, size_t len) { size_t ret = strlen(src); if (len != 0) { - if (ret < len) - strcpy(dest, src); - else { - strncpy(dest, src, len - 1); - dest[len-1] = 0; - } + if (ret < len) + strcpy(dest, src); + else { + strncpy(dest, src, len - 1); + dest[len-1] = 0; + } } return ret; } @@ -130,7 +130,7 @@ int ppp_slprintf(char *buf, int buflen, const char *fmt, ...) { /* * ppp_vslprintf - like ppp_slprintf, takes a va_list instead of a list of args. */ -#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) +#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { int c, i, n; @@ -153,249 +153,249 @@ int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { buf0 = buf; --buflen; while (buflen > 0) { - for (f = fmt; *f != '%' && *f != 0; ++f) - ; - if (f > fmt) { - len = f - fmt; - if (len > buflen) - len = buflen; - memcpy(buf, fmt, len); - buf += len; - buflen -= len; - fmt = f; - } - if (*fmt == 0) - break; - c = *++fmt; - width = 0; - prec = -1; - fillch = ' '; - if (c == '0') { - fillch = '0'; - c = *++fmt; - } - if (c == '*') { - width = va_arg(args, int); - c = *++fmt; - } else { - while (lwip_isdigit(c)) { - width = width * 10 + c - '0'; - c = *++fmt; - } - } - if (c == '.') { - c = *++fmt; - if (c == '*') { - prec = va_arg(args, int); - c = *++fmt; - } else { - prec = 0; - while (lwip_isdigit(c)) { - prec = prec * 10 + c - '0'; - c = *++fmt; - } - } - } - str = 0; - base = 0; - neg = 0; - ++fmt; - switch (c) { - case 'l': - c = *fmt++; - switch (c) { - case 'd': - val = va_arg(args, long); - if ((long)val < 0) { - neg = 1; - val = (unsigned long)-(long)val; - } - base = 10; - break; - case 'u': - val = va_arg(args, unsigned long); - base = 10; - break; - default: - OUTCHAR('%'); - OUTCHAR('l'); - --fmt; /* so %lz outputs %lz etc. */ - continue; - } - break; - case 'd': - i = va_arg(args, int); - if (i < 0) { - neg = 1; - val = -i; - } else - val = i; - base = 10; - break; - case 'u': - val = va_arg(args, unsigned int); - base = 10; - break; - case 'o': - val = va_arg(args, unsigned int); - base = 8; - break; - case 'x': - case 'X': - val = va_arg(args, unsigned int); - base = 16; - break; + for (f = fmt; *f != '%' && *f != 0; ++f) + ; + if (f > fmt) { + len = f - fmt; + if (len > buflen) + len = buflen; + memcpy(buf, fmt, len); + buf += len; + buflen -= len; + fmt = f; + } + if (*fmt == 0) + break; + c = *++fmt; + width = 0; + prec = -1; + fillch = ' '; + if (c == '0') { + fillch = '0'; + c = *++fmt; + } + if (c == '*') { + width = va_arg(args, int); + c = *++fmt; + } else { + while (lwip_isdigit(c)) { + width = width * 10 + c - '0'; + c = *++fmt; + } + } + if (c == '.') { + c = *++fmt; + if (c == '*') { + prec = va_arg(args, int); + c = *++fmt; + } else { + prec = 0; + while (lwip_isdigit(c)) { + prec = prec * 10 + c - '0'; + c = *++fmt; + } + } + } + str = 0; + base = 0; + neg = 0; + ++fmt; + switch (c) { + case 'l': + c = *fmt++; + switch (c) { + case 'd': + val = va_arg(args, long); + if ((long)val < 0) { + neg = 1; + val = (unsigned long)-(long)val; + } + base = 10; + break; + case 'u': + val = va_arg(args, unsigned long); + base = 10; + break; + default: + OUTCHAR('%'); + OUTCHAR('l'); + --fmt; /* so %lz outputs %lz etc. */ + continue; + } + break; + case 'd': + i = va_arg(args, int); + if (i < 0) { + neg = 1; + val = -i; + } else + val = i; + base = 10; + break; + case 'u': + val = va_arg(args, unsigned int); + base = 10; + break; + case 'o': + val = va_arg(args, unsigned int); + base = 8; + break; + case 'x': + case 'X': + val = va_arg(args, unsigned int); + base = 16; + break; #if 0 /* unused (and wrong on LLP64 systems) */ - case 'p': - val = (unsigned long) va_arg(args, void *); - base = 16; - neg = 2; - break; + case 'p': + val = (unsigned long) va_arg(args, void *); + base = 16; + neg = 2; + break; #endif /* unused (and wrong on LLP64 systems) */ - case 's': - str = va_arg(args, char *); - break; - case 'c': - num[0] = va_arg(args, int); - num[1] = 0; - str = num; - break; + case 's': + str = va_arg(args, char *); + break; + case 'c': + num[0] = va_arg(args, int); + num[1] = 0; + str = num; + break; #if 0 /* do we always have strerror() in embedded ? */ - case 'm': - str = strerror(errno); - break; + case 'm': + str = strerror(errno); + break; #endif /* do we always have strerror() in embedded ? */ - case 'I': - ip = va_arg(args, u32_t); - ip = lwip_ntohl(ip); - ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, - (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); - str = num; - break; + case 'I': + ip = va_arg(args, u32_t); + ip = lwip_ntohl(ip); + ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, + (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); + str = num; + break; #if 0 /* need port */ - case 't': - time(&t); - str = ctime(&t); - str += 4; /* chop off the day name */ - str[15] = 0; /* chop off year and newline */ - break; + case 't': + time(&t); + str = ctime(&t); + str += 4; /* chop off the day name */ + str[15] = 0; /* chop off year and newline */ + break; #endif /* need port */ - case 'v': /* "visible" string */ - case 'q': /* quoted string */ - quoted = c == 'q'; - p = va_arg(args, unsigned char *); - if (p == NULL) - p = (const unsigned char *)""; - if (fillch == '0' && prec >= 0) { - n = prec; - } else { - n = strlen((const char *)p); - if (prec >= 0 && n > prec) - n = prec; - } - while (n > 0 && buflen > 0) { - c = *p++; - --n; - if (!quoted && c >= 0x80) { - OUTCHAR('M'); - OUTCHAR('-'); - c -= 0x80; - } - if (quoted && (c == '"' || c == '\\')) - OUTCHAR('\\'); - if (c < 0x20 || (0x7f <= c && c < 0xa0)) { - if (quoted) { - OUTCHAR('\\'); - switch (c) { - case '\t': OUTCHAR('t'); break; - case '\n': OUTCHAR('n'); break; - case '\b': OUTCHAR('b'); break; - case '\f': OUTCHAR('f'); break; - default: - OUTCHAR('x'); - OUTCHAR(hexchars[c >> 4]); - OUTCHAR(hexchars[c & 0xf]); - } - } else { - if (c == '\t') - OUTCHAR(c); - else { - OUTCHAR('^'); - OUTCHAR(c ^ 0x40); - } - } - } else - OUTCHAR(c); - } - continue; + case 'v': /* "visible" string */ + case 'q': /* quoted string */ + quoted = c == 'q'; + p = va_arg(args, unsigned char *); + if (p == NULL) + p = (const unsigned char *)""; + if (fillch == '0' && prec >= 0) { + n = prec; + } else { + n = strlen((const char *)p); + if (prec >= 0 && n > prec) + n = prec; + } + while (n > 0 && buflen > 0) { + c = *p++; + --n; + if (!quoted && c >= 0x80) { + OUTCHAR('M'); + OUTCHAR('-'); + c -= 0x80; + } + if (quoted && (c == '"' || c == '\\')) + OUTCHAR('\\'); + if (c < 0x20 || (0x7f <= c && c < 0xa0)) { + if (quoted) { + OUTCHAR('\\'); + switch (c) { + case '\t': OUTCHAR('t'); break; + case '\n': OUTCHAR('n'); break; + case '\b': OUTCHAR('b'); break; + case '\f': OUTCHAR('f'); break; + default: + OUTCHAR('x'); + OUTCHAR(hexchars[c >> 4]); + OUTCHAR(hexchars[c & 0xf]); + } + } else { + if (c == '\t') + OUTCHAR(c); + else { + OUTCHAR('^'); + OUTCHAR(c ^ 0x40); + } + } + } else + OUTCHAR(c); + } + continue; #if PRINTPKT_SUPPORT - case 'P': /* print PPP packet */ - bufinfo.ptr = buf; - bufinfo.len = buflen + 1; - p = va_arg(args, unsigned char *); - n = va_arg(args, int); - ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); - buf = bufinfo.ptr; - buflen = bufinfo.len - 1; - continue; + case 'P': /* print PPP packet */ + bufinfo.ptr = buf; + bufinfo.len = buflen + 1; + p = va_arg(args, unsigned char *); + n = va_arg(args, int); + ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); + buf = bufinfo.ptr; + buflen = bufinfo.len - 1; + continue; #endif /* PRINTPKT_SUPPORT */ - case 'B': - p = va_arg(args, unsigned char *); - for (n = prec; n > 0; --n) { - c = *p++; - if (fillch == ' ') - OUTCHAR(' '); - OUTCHAR(hexchars[(c >> 4) & 0xf]); - OUTCHAR(hexchars[c & 0xf]); - } - continue; - default: - *buf++ = '%'; - if (c != '%') - --fmt; /* so %z outputs %z etc. */ - --buflen; - continue; - } - if (base != 0) { - str = num + sizeof(num); - *--str = 0; - while (str > num + neg) { - *--str = hexchars[val % base]; - val = val / base; - if (--prec <= 0 && val == 0) - break; - } - switch (neg) { - case 1: - *--str = '-'; - break; - case 2: - *--str = 'x'; - *--str = '0'; - break; - default: - break; - } - len = num + sizeof(num) - 1 - str; - } else { - len = strlen(str); - if (prec >= 0 && len > prec) - len = prec; - } - if (width > 0) { - if (width > buflen) - width = buflen; - if ((n = width - len) > 0) { - buflen -= n; - for (; n > 0; --n) - *buf++ = fillch; - } - } - if (len > buflen) - len = buflen; - memcpy(buf, str, len); - buf += len; - buflen -= len; + case 'B': + p = va_arg(args, unsigned char *); + for (n = prec; n > 0; --n) { + c = *p++; + if (fillch == ' ') + OUTCHAR(' '); + OUTCHAR(hexchars[(c >> 4) & 0xf]); + OUTCHAR(hexchars[c & 0xf]); + } + continue; + default: + *buf++ = '%'; + if (c != '%') + --fmt; /* so %z outputs %z etc. */ + --buflen; + continue; + } + if (base != 0) { + str = num + sizeof(num); + *--str = 0; + while (str > num + neg) { + *--str = hexchars[val % base]; + val = val / base; + if (--prec <= 0 && val == 0) + break; + } + switch (neg) { + case 1: + *--str = '-'; + break; + case 2: + *--str = 'x'; + *--str = '0'; + break; + default: + break; + } + len = num + sizeof(num) - 1 - str; + } else { + len = strlen(str); + if (prec >= 0 && len > prec) + len = prec; + } + if (width > 0) { + if (width > buflen) + width = buflen; + if ((n = width - len) > 0) { + buflen -= n; + for (; n > 0; --n) + *buf++ = fillch; + } + } + if (len > buflen) + len = buflen; + memcpy(buf, str, len); + buf += len; + buflen -= len; } *buf = 0; return buf - buf0; @@ -432,9 +432,9 @@ log_packet(p, len, prefix, level) char *prefix; int level; { - init_pr_log(prefix, level); - ppp_format_packet(p, len, pr_log, &level); - end_pr_log(); + init_pr_log(prefix, level); + ppp_format_packet(p, len, pr_log, &level); + end_pr_log(); } #endif /* UNUSED */ @@ -444,43 +444,43 @@ log_packet(p, len, prefix, level) * calling `printer(arg, format, ...)' to output it. */ static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int i, n; u_short proto; const struct protent *protp; if (len >= 2) { - GETSHORT(proto, p); - len -= 2; - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == protp->protocol) - break; - if (protp != NULL) { - printer(arg, "[%s", protp->name); - n = (*protp->printpkt)(p, len, printer, arg); - printer(arg, "]"); - p += n; - len -= n; - } else { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == (protp->protocol & ~0x8000)) - break; - if (protp != 0 && protp->data_name != 0) { - printer(arg, "[%s data]", protp->data_name); - if (len > 8) - printer(arg, "%.8B ...", p); - else - printer(arg, "%.*B", len, p); - len = 0; - } else - printer(arg, "[proto=0x%x]", proto); - } + GETSHORT(proto, p); + len -= 2; + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == protp->protocol) + break; + if (protp != NULL) { + printer(arg, "[%s", protp->name); + n = (*protp->printpkt)(p, len, printer, arg); + printer(arg, "]"); + p += n; + len -= n; + } else { + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == (protp->protocol & ~0x8000)) + break; + if (protp != 0 && protp->data_name != 0) { + printer(arg, "[%s data]", protp->data_name); + if (len > 8) + printer(arg, "%.8B ...", p); + else + printer(arg, "%.*B", len, p); + len = 0; + } else + printer(arg, "[proto=0x%x]", proto); + } } if (len > 32) - printer(arg, "%.32B ...", p); + printer(arg, "%.32B ...", p); else - printer(arg, "%.*B", len, p); + printer(arg, "%.*B", len, p); } #endif /* PRINTPKT_SUPPORT */ @@ -489,30 +489,30 @@ static void ppp_format_packet(const u_char *p, int len, * init_pr_log, end_pr_log - initialize and finish use of pr_log. */ -static char line[256]; /* line to be logged accumulated here */ -static char *linep; /* current pointer within line */ -static int llevel; /* level for logging */ +static char line[256]; /* line to be logged accumulated here */ +static char *linep; /* current pointer within line */ +static int llevel; /* level for logging */ void init_pr_log(prefix, level) const char *prefix; int level; { - linep = line; - if (prefix != NULL) { - ppp_strlcpy(line, prefix, sizeof(line)); - linep = line + strlen(line); - } - llevel = level; + linep = line; + if (prefix != NULL) { + ppp_strlcpy(line, prefix, sizeof(line)); + linep = line + strlen(line); + } + llevel = level; } void end_pr_log() { - if (linep != line) { - *linep = 0; - ppp_log_write(llevel, line); - } + if (linep != line) { + *linep = 0; + ppp_log_write(llevel, line); + } } /* @@ -521,47 +521,47 @@ end_pr_log() void pr_log (void *arg, const char *fmt, ...) { - int l, n; - va_list pvar; - char *p, *eol; - char buf[256]; - - va_start(pvar, fmt); - n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); - va_end(pvar); - - p = buf; - eol = strchr(buf, '\n'); - if (linep != line) { - l = (eol == NULL)? n: eol - buf; - if (linep + l < line + sizeof(line)) { - if (l > 0) { - memcpy(linep, buf, l); - linep += l; - } - if (eol == NULL) - return; - p = eol + 1; - eol = strchr(p, '\n'); - } - *linep = 0; - ppp_log_write(llevel, line); - linep = line; - } - - while (eol != NULL) { - *eol = 0; - ppp_log_write(llevel, p); - p = eol + 1; - eol = strchr(p, '\n'); - } - - /* assumes sizeof(buf) <= sizeof(line) */ - l = buf + n - p; - if (l > 0) { - memcpy(line, p, n); - linep = line + l; - } + int l, n; + va_list pvar; + char *p, *eol; + char buf[256]; + + va_start(pvar, fmt); + n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); + va_end(pvar); + + p = buf; + eol = strchr(buf, '\n'); + if (linep != line) { + l = (eol == NULL)? n: eol - buf; + if (linep + l < line + sizeof(line)) { + if (l > 0) { + memcpy(linep, buf, l); + linep += l; + } + if (eol == NULL) + return; + p = eol + 1; + eol = strchr(p, '\n'); + } + *linep = 0; + ppp_log_write(llevel, line); + linep = line; + } + + while (eol != NULL) { + *eol = 0; + ppp_log_write(llevel, p); + p = eol + 1; + eol = strchr(p, '\n'); + } + + /* assumes sizeof(buf) <= sizeof(line) */ + l = buf + n - p; + if (l > 0) { + memcpy(line, p, n); + linep = line + l; + } } #endif /* UNUSED */ @@ -574,27 +574,27 @@ void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const c printer(arg, "\""); for (; len > 0; --len) { - c = *p++; - if (' ' <= c && c <= '~') { - if (c == '\\' || c == '"') - printer(arg, "\\"); - printer(arg, "%c", c); - } else { - switch (c) { - case '\n': - printer(arg, "\\n"); - break; - case '\r': - printer(arg, "\\r"); - break; - case '\t': - printer(arg, "\\t"); - break; - default: - printer(arg, "\\%.3o", (u8_t)c); - /* no break */ - } - } + c = *p++; + if (' ' <= c && c <= '~') { + if (c == '\\' || c == '"') + printer(arg, "\\"); + printer(arg, "%c", c); + } else { + switch (c) { + case '\n': + printer(arg, "\\n"); + break; + case '\r': + printer(arg, "\\r"); + break; + case '\t': + printer(arg, "\\t"); + break; + default: + printer(arg, "\\%.3o", (u8_t)c); + /* no break */ + } + } } printer(arg, "\""); } @@ -615,13 +615,13 @@ static void ppp_log_write(int level, char *buf) { PPPDEBUG(level, ("%s\n", buf) ); #if 0 if (log_to_fd >= 0 && (level != LOG_DEBUG || debug)) { - int n = strlen(buf); + int n = strlen(buf); - if (n > 0 && buf[n-1] == '\n') - --n; - if (write(log_to_fd, buf, n) != n - || write(log_to_fd, "\n", 1) != 1) - log_to_fd = -1; + if (n > 0 && buf[n-1] == '\n') + --n; + if (write(log_to_fd, buf, n) != n + || write(log_to_fd, "\n", 1) != 1) + log_to_fd = -1; } #endif } @@ -710,18 +710,18 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { */ proto = (p[0] << 8) + p[1]; if (proto < 0xC000 && (proto & ~0x8000) == proto) - return; + return; /* * don't print valid LCP echo request/reply packets if the link is up. */ if (proto == PPP_LCP && pcb->phase == PPP_PHASE_RUNNING && len >= 2 + HEADERLEN) { - unsigned char *lcp = p + 2; - int l = (lcp[2] << 8) + lcp[3]; + unsigned char *lcp = p + 2; + int l = (lcp[2] << 8) + lcp[3]; - if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) - && l >= HEADERLEN && l <= len - 2) - return; + if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) + && l >= HEADERLEN && l <= len - 2) + return; } ppp_dbglog("%s %P", tag, p, len); @@ -737,34 +737,34 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { ssize_t complete_read(int fd, void *buf, size_t count) { - size_t done; - ssize_t nb; - char *ptr = buf; - - for (done = 0; done < count; ) { - nb = read(fd, ptr, count - done); - if (nb < 0) { - if (errno == EINTR) - continue; - return -1; - } - if (nb == 0) - break; - done += nb; - ptr += nb; - } - return done; + size_t done; + ssize_t nb; + char *ptr = buf; + + for (done = 0; done < count; ) { + nb = read(fd, ptr, count - done); + if (nb < 0) { + if (errno == EINTR) + continue; + return -1; + } + if (nb == 0) + break; + done += nb; + ptr += nb; + } + return done; } /* Procedures for locking the serial device using a lock file. */ #ifndef LOCK_DIR #ifdef __linux__ -#define LOCK_DIR "/var/lock" +#define LOCK_DIR "/var/lock" #else #ifdef SVR4 -#define LOCK_DIR "/var/spool/locks" +#define LOCK_DIR "/var/spool/locks" #else -#define LOCK_DIR "/var/spool/lock" +#define LOCK_DIR "/var/spool/lock" #endif #endif #endif /* LOCK_DIR */ @@ -783,14 +783,14 @@ lock(dev) result = mklock (dev, (void *) 0); if (result == 0) { - ppp_strlcpy(lock_file, dev, sizeof(lock_file)); - return 0; + ppp_strlcpy(lock_file, dev, sizeof(lock_file)); + return 0; } if (result > 0) ppp_notice("Device %s is locked by pid %d", dev, result); else - ppp_error("Can't create lock file %s", lock_file); + ppp_error("Can't create lock file %s", lock_file); return -1; #else /* LOCKLIB */ @@ -802,83 +802,83 @@ lock(dev) struct stat sbuf; if (stat(dev, &sbuf) < 0) { - ppp_error("Can't get device number for %s: %m", dev); - return -1; + ppp_error("Can't get device number for %s: %m", dev); + return -1; } if ((sbuf.st_mode & S_IFMT) != S_IFCHR) { - ppp_error("Can't lock %s: not a character device", dev); - return -1; + ppp_error("Can't lock %s: not a character device", dev); + return -1; } ppp_slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d", - LOCK_DIR, major(sbuf.st_dev), - major(sbuf.st_rdev), minor(sbuf.st_rdev)); + LOCK_DIR, major(sbuf.st_dev), + major(sbuf.st_rdev), minor(sbuf.st_rdev)); #else char *p; char lockdev[MAXPATHLEN]; if ((p = strstr(dev, "dev/")) != NULL) { - dev = p + 4; - strncpy(lockdev, dev, MAXPATHLEN-1); - lockdev[MAXPATHLEN-1] = 0; - while ((p = strrchr(lockdev, '/')) != NULL) { - *p = '_'; - } - dev = lockdev; + dev = p + 4; + strncpy(lockdev, dev, MAXPATHLEN-1); + lockdev[MAXPATHLEN-1] = 0; + while ((p = strrchr(lockdev, '/')) != NULL) { + *p = '_'; + } + dev = lockdev; } else - if ((p = strrchr(dev, '/')) != NULL) - dev = p + 1; + if ((p = strrchr(dev, '/')) != NULL) + dev = p + 1; ppp_slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); #endif while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) { - if (errno != EEXIST) { - ppp_error("Can't create lock file %s: %m", lock_file); - break; - } - - /* Read the lock file to find out who has the device locked. */ - fd = open(lock_file, O_RDONLY, 0); - if (fd < 0) { - if (errno == ENOENT) /* This is just a timing problem. */ - continue; - ppp_error("Can't open existing lock file %s: %m", lock_file); - break; - } + if (errno != EEXIST) { + ppp_error("Can't create lock file %s: %m", lock_file); + break; + } + + /* Read the lock file to find out who has the device locked. */ + fd = open(lock_file, O_RDONLY, 0); + if (fd < 0) { + if (errno == ENOENT) /* This is just a timing problem. */ + continue; + ppp_error("Can't open existing lock file %s: %m", lock_file); + break; + } #ifndef LOCK_BINARY - n = read(fd, lock_buffer, 11); + n = read(fd, lock_buffer, 11); #else - n = read(fd, &pid, sizeof(pid)); + n = read(fd, &pid, sizeof(pid)); #endif /* LOCK_BINARY */ - close(fd); - fd = -1; - if (n <= 0) { - ppp_error("Can't read pid from lock file %s", lock_file); - break; - } - - /* See if the process still exists. */ + close(fd); + fd = -1; + if (n <= 0) { + ppp_error("Can't read pid from lock file %s", lock_file); + break; + } + + /* See if the process still exists. */ #ifndef LOCK_BINARY - lock_buffer[n] = 0; - pid = atoi(lock_buffer); + lock_buffer[n] = 0; + pid = atoi(lock_buffer); #endif /* LOCK_BINARY */ - if (pid == getpid()) - return 1; /* somebody else locked it for us */ - if (pid == 0 - || (kill(pid, 0) == -1 && errno == ESRCH)) { - if (unlink (lock_file) == 0) { - ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); - continue; - } - ppp_warn("Couldn't remove stale lock on %s", dev); - } else - ppp_notice("Device %s is locked by pid %d", dev, pid); - break; + if (pid == getpid()) + return 1; /* somebody else locked it for us */ + if (pid == 0 + || (kill(pid, 0) == -1 && errno == ESRCH)) { + if (unlink (lock_file) == 0) { + ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); + continue; + } + ppp_warn("Couldn't remove stale lock on %s", dev); + } else + ppp_notice("Device %s is locked by pid %d", dev, pid); + break; } if (fd < 0) { - lock_file[0] = 0; - return -1; + lock_file[0] = 0; + return -1; } pid = getpid(); @@ -916,12 +916,12 @@ relock(pid) char lock_buffer[12]; if (lock_file[0] == 0) - return -1; + return -1; fd = open(lock_file, O_WRONLY, 0); if (fd < 0) { - ppp_error("Couldn't reopen lock file %s: %m", lock_file); - lock_file[0] = 0; - return -1; + ppp_error("Couldn't reopen lock file %s: %m", lock_file); + lock_file[0] = 0; + return -1; } #ifndef LOCK_BINARY @@ -944,11 +944,11 @@ unlock() { if (lock_file[0]) { #ifdef LOCKLIB - (void) rmlock(lock_file, (void *) 0); + (void) rmlock(lock_file, (void *) 0); #else - unlink(lock_file); + unlink(lock_file); #endif - lock_file[0] = 0; + lock_file[0] = 0; } } diff --git a/components/net/lwip-2.1.2/test/fuzz/fuzz.c b/components/net/lwip-2.1.2/test/fuzz/fuzz.c index 8aa07ecc26..ecebc57052 100644 --- a/components/net/lwip-2.1.2/test/fuzz/fuzz.c +++ b/components/net/lwip-2.1.2/test/fuzz/fuzz.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Erik Ekman * */ diff --git a/components/net/lwip-2.1.2/test/fuzz/lwipopts.h b/components/net/lwip-2.1.2/test/fuzz/lwipopts.h index 4ab26f289b..50e60806b1 100644 --- a/components/net/lwip-2.1.2/test/fuzz/lwipopts.h +++ b/components/net/lwip-2.1.2/test/fuzz/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c index 3ac553b151..e73cfe3bb1 100644 --- a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c +++ b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c @@ -16,12 +16,12 @@ * - full duplex * - add asserts about internal socket/netconn/pcb state? */ - + /* * Copyright (c) 2017 Simon Goldschmidt * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -30,21 +30,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h index 178e604ae6..256ea000fc 100644 --- a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h +++ b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2017 Simon Goldschmidt * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/api/test_sockets.c b/components/net/lwip-2.1.2/test/unit/api/test_sockets.c index 472fa48950..ed2b811275 100644 --- a/components/net/lwip-2.1.2/test/unit/api/test_sockets.c +++ b/components/net/lwip-2.1.2/test/unit/api/test_sockets.c @@ -255,7 +255,7 @@ static void test_sockets_msgapi_update_iovs(struct msghdr *msg, size_t bytes) /* note: this modifies the underyling iov_base and iov_len for a partial read for an individual vector. This updates the msg->msg_iov pointer to skip fully consumed vecotrs */ - + /* process fully consumed vectors */ for (i = 0; i < msg->msg_iovlen; i++) { if (msg->msg_iov[i].iov_len <= bytes) { @@ -395,7 +395,7 @@ static void test_sockets_msgapi_tcp(int domain) /* note: since we always receive after sending, there will be open space in the send buffer */ fail_unless(ret > 0); - + bytes_written += ret; if (bytes_written < TOTAL_DATA_SZ) { test_sockets_msgapi_update_iovs(&smsg, (size_t)ret); @@ -432,7 +432,7 @@ static void test_sockets_msgapi_tcp(int domain) } } while(ret > 0); } - + ret = lwip_close(s1); fail_unless(ret == 0); ret = lwip_close(s2); @@ -588,13 +588,13 @@ static void test_sockets_msgapi_cmsg(int domain) memset(rcv_buf, 0, sizeof(rcv_buf)); ret = lwip_sendto(s, snd_buf, sizeof(snd_buf), 0, (struct sockaddr*)&addr_storage, addr_size); fail_unless(ret == sizeof(snd_buf)); - + tcpip_thread_poll_one(); ret = lwip_recvmsg(s, &msg, 0); fail_unless(ret == sizeof(rcv_buf)); fail_unless(!memcmp(rcv_buf, snd_buf, sizeof(rcv_buf))); - + /* Verify message header */ cmsg = CMSG_FIRSTHDR(&msg); fail_unless(cmsg != NULL); diff --git a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c index cf826ebfe3..a84e3784e9 100644 --- a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2017 Simon Goldschmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h index 331c2f2f15..ef829decb9 100644 --- a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h +++ b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2017 Simon Goldschmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/core/test_timers.c b/components/net/lwip-2.1.2/test/unit/core/test_timers.c index 820b718924..30f6ac4cd8 100644 --- a/components/net/lwip-2.1.2/test/unit/core/test_timers.c +++ b/components/net/lwip-2.1.2/test/unit/core/test_timers.c @@ -61,7 +61,7 @@ do_test_cyclic_timers(u32_t offset) fail_unless(cyclic_fired == 1); fail_unless((*list_head)->time == (u32_t)(lwip_sys_now + test_cyclic.interval_ms - HANDLER_EXECUTION_TIME)); - + sys_untimeout(lwip_cyclic_timer, &test_cyclic); @@ -128,7 +128,7 @@ static void do_test_timers(u32_t offset) { struct sys_timeo** list_head = sys_timeouts_get_next_timeout(); - + lwip_sys_now = offset + 0; sys_timeout(10, dummy_handler, LWIP_PTR_NUMERIC_CAST(void*, 0)); @@ -142,7 +142,7 @@ do_test_timers(u32_t offset) fail_unless((*list_head)->time == (u32_t)(lwip_sys_now + 5)); fail_unless((*list_head)->next->time == (u32_t)(lwip_sys_now + 10)); fail_unless((*list_head)->next->next->time == (u32_t)(lwip_sys_now + 20)); - + /* check timers expire in correct order */ memset(&fired, 0, sizeof(fired)); diff --git a/components/net/lwip-2.1.2/test/unit/lwipopts.h b/components/net/lwip-2.1.2/test/unit/lwipopts.h index c00ace1561..7f077d21db 100644 --- a/components/net/lwip-2.1.2/test/unit/lwipopts.h +++ b/components/net/lwip-2.1.2/test/unit/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c b/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c index 8689b71ac8..feaa3e5df1 100644 --- a/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c +++ b/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c @@ -151,13 +151,13 @@ tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, const ip_addr_t* local_ /* @todo: are these all states? */ /* @todo: remove from previous list */ pcb->state = state; - + iss = tcp_next_iss(pcb); pcb->snd_wl2 = iss; pcb->snd_nxt = iss; pcb->lastack = iss; pcb->snd_lbb = iss; - + if (state == ESTABLISHED) { TCP_REG(&tcp_active_pcbs, pcb); ip_addr_copy(pcb->local_ip, *local_ip); diff --git a/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c b/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c index c7f85f6a16..941e4f42d9 100644 --- a/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c +++ b/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c @@ -524,7 +524,7 @@ START_TEST(test_tcp_fast_retx_recover) EXPECT_RET(pcb->dupacks == 3); memset(&txcounters, 0, sizeof(txcounters)); /* @todo: check expected data?*/ - + /* send data5, not output yet */ err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); EXPECT_RET(err == ERR_OK); @@ -1263,7 +1263,7 @@ static void test_tcp_rto_timeout_impl(int link_down) /* check our pcb is no longer active */ for (cur = tcp_active_pcbs; cur != NULL; cur = cur->next) { EXPECT(cur != pcb); - } + } EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); } @@ -1359,7 +1359,7 @@ static void test_tcp_rto_timeout_syn_sent_impl(int link_down) /* check our pcb is no longer active */ for (cur = tcp_active_pcbs; cur != NULL; cur = cur->next) { EXPECT(cur != pcb); - } + } EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); } @@ -1409,7 +1409,7 @@ static void test_tcp_zwp_timeout_impl(int link_down) EXPECT(err == ERR_OK); err = tcp_output(pcb); EXPECT(err == ERR_OK); - + /* verify segment is in-flight */ EXPECT(pcb->unsent == NULL); check_seqnos(pcb->unacked, 1, seqnos); @@ -1488,7 +1488,7 @@ static void test_tcp_zwp_timeout_impl(int link_down) /* check our pcb is no longer active */ for (cur = tcp_active_pcbs; cur != NULL; cur = cur->next) { EXPECT(cur != pcb); - } + } EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); } diff --git a/components/net/lwip_dhcpd/dhcp_server_raw.c b/components/net/lwip_dhcpd/dhcp_server_raw.c index 6c786301be..92fd11671c 100644 --- a/components/net/lwip_dhcpd/dhcp_server_raw.c +++ b/components/net/lwip_dhcpd/dhcp_server_raw.c @@ -26,7 +26,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. - * + * * Change Logs: * Date Author Notes * 2014-04-01 Ren.Haibo the first version diff --git a/components/net/netdev/include/arpa/inet.h b/components/net/netdev/include/arpa/inet.h index 085e15dcbc..9072dffb79 100644 --- a/components/net/netdev/include/arpa/inet.h +++ b/components/net/netdev/include/arpa/inet.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/netdev/include/netdev.h b/components/net/netdev/include/netdev.h index e11a8929b0..16da0e502c 100644 --- a/components/net/netdev/include/netdev.h +++ b/components/net/netdev/include/netdev.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -79,8 +79,8 @@ struct netdev_ops; /* network interface device object */ struct netdev { - rt_slist_t list; - + rt_slist_t list; + char name[RT_NAME_MAX]; /* network interface device name */ ip_addr_t ip_addr; /* IP address */ ip_addr_t netmask; /* subnet mask */ @@ -91,11 +91,11 @@ struct netdev ip_addr_t dns_servers[NETDEV_DNS_SERVERS_NUM]; /* DNS server */ uint8_t hwaddr_len; /* hardware address length */ uint8_t hwaddr[NETDEV_HWADDR_MAX_LEN]; /* hardware address */ - + uint16_t flags; /* network interface device status flag */ uint16_t mtu; /* maximum transfer unit (in bytes) */ const struct netdev_ops *ops; /* network interface device operations */ - + netdev_callback_fn status_callback; /* network interface device flags change callback */ netdev_callback_fn addr_callback; /* network interface device address information change callback */ diff --git a/components/net/netdev/include/netdev_ipaddr.h b/components/net/netdev/include/netdev_ipaddr.h index 65970ec5b7..08ea50ed9d 100644 --- a/components/net/netdev/include/netdev_ipaddr.h +++ b/components/net/netdev/include/netdev_ipaddr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -23,30 +23,30 @@ extern "C" { * On subnets, the decomposition of addresses to host and net parts * is done according to subnet mask, not the masks here. */ -#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) -#define IN_CLASSA_NET 0xff000000 -#define IN_CLASSA_NSHIFT 24 -#define IN_CLASSA_HOST 0x00ffffff -#define IN_CLASSA_MAX 128 +#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA_NSHIFT 24 +#define IN_CLASSA_HOST 0x00ffffff +#define IN_CLASSA_MAX 128 -#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) -#define IN_CLASSB_NET 0xffff0000 -#define IN_CLASSB_NSHIFT 16 -#define IN_CLASSB_HOST 0x0000ffff -#define IN_CLASSB_MAX 65536 +#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB_NSHIFT 16 +#define IN_CLASSB_HOST 0x0000ffff +#define IN_CLASSB_MAX 65536 -#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000) -#define IN_CLASSC_NET 0xffffff00 -#define IN_CLASSC_NSHIFT 8 -#define IN_CLASSC_HOST 0x000000ff +#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC_NSHIFT 8 +#define IN_CLASSC_HOST 0x000000ff -#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) -#define IN_MULTICAST(i) IN_CLASSD(i) +#define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) +#define IN_MULTICAST(i) IN_CLASSD(i) -#define IN_EXPERIMENTAL(i) (((long)(i) & 0xe0000000) == 0xe0000000) -#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000) +#define IN_EXPERIMENTAL(i) (((long)(i) & 0xe0000000) == 0xe0000000) +#define IN_BADCLASS(i) (((long)(i) & 0xf0000000) == 0xf0000000) -#define IN_LOOPBACKNET 127 /* official! */ +#define IN_LOOPBACKNET 127 /* official! */ /* IP address types for use in ip_addr_t.type member */ enum netdev_ip_addr_type { @@ -307,7 +307,7 @@ const char *netdev_inet_ntop(int af, const void *src, char *dst, int32_t size); int netdev_inet_pton(int af, const char *src, void *dst); #define inet_ntop(af, src, dst, size) netdev_inet_ntop(af, src, dst, size) -#define inet_pton(af, src, dst) netdev_inet_pton(af, src, dst) +#define inet_pton(af, src, dst) netdev_inet_pton(af, src, dst) #ifdef __cplusplus } diff --git a/components/net/netdev/src/netdev.c b/components/net/netdev/src/netdev.c index cef11847f9..3f7aa401c1 100644 --- a/components/net/netdev/src/netdev.c +++ b/components/net/netdev/src/netdev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/netdev/src/netdev_ipaddr.c b/components/net/netdev/src/netdev_ipaddr.c index a70a90bb75..9abb41bd14 100644 --- a/components/net/netdev/src/netdev_ipaddr.c +++ b/components/net/netdev/src/netdev_ipaddr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/dfs_net/dfs_net.c b/components/net/sal_socket/dfs_net/dfs_net.c index f1a3d777a1..67b652c320 100644 --- a/components/net/sal_socket/dfs_net/dfs_net.c +++ b/components/net/sal_socket/dfs_net/dfs_net.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -21,7 +21,7 @@ int dfs_net_getsocket(int fd) { int socket; - struct dfs_fd *_dfs_fd; + struct dfs_fd *_dfs_fd; _dfs_fd = fd_get(fd); if (_dfs_fd == NULL) return -1; @@ -68,7 +68,7 @@ static int dfs_net_poll(struct dfs_fd *file, struct rt_pollreq *req) return sal_poll(file, req); } -const struct dfs_file_ops _net_fops = +const struct dfs_file_ops _net_fops = { NULL, /* open */ dfs_net_close, diff --git a/components/net/sal_socket/impl/af_inet.h b/components/net/sal_socket/impl/af_inet.h index caffbe1400..421d15bfae 100644 --- a/components/net/sal_socket/impl/af_inet.h +++ b/components/net/sal_socket/impl/af_inet.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/impl/af_inet_at.c b/components/net/sal_socket/impl/af_inet_at.c index 135e4183c4..c85dfe9f06 100644 --- a/components/net/sal_socket/impl/af_inet_at.c +++ b/components/net/sal_socket/impl/af_inet_at.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -85,7 +85,7 @@ static const struct sal_socket_ops at_socket_ops = #endif /* SAL_USING_POSIX */ }; -static const struct sal_netdb_ops at_netdb_ops = +static const struct sal_netdb_ops at_netdb_ops = { at_gethostbyname, NULL, diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c index 56df735ab9..2e19275b5d 100644 --- a/components/net/sal_socket/impl/af_inet_lwip.c +++ b/components/net/sal_socket/impl/af_inet_lwip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -229,7 +229,7 @@ int inet_ioctlsocket(int socket, long cmd, void *arg) { case F_GETFL: case F_SETFL: - return lwip_fcntl(socket, cmd, (int) arg); + return lwip_fcntl(socket, cmd, (int) arg); default: return lwip_ioctl(socket, cmd, arg); @@ -320,7 +320,7 @@ static const struct sal_proto_family lwip_inet_family = AF_INET6, #else AF_INET, -#endif +#endif &lwip_socket_ops, &lwip_netdb_ops, }; @@ -329,7 +329,7 @@ static const struct sal_proto_family lwip_inet_family = int sal_lwip_netdev_set_pf_info(struct netdev *netdev) { RT_ASSERT(netdev); - + netdev->sal_user_data = (void *) &lwip_inet_family; return 0; } diff --git a/components/net/sal_socket/impl/proto_mbedtls.c b/components/net/sal_socket/impl/proto_mbedtls.c index 3472bbeaf5..79fbdcc5d4 100644 --- a/components/net/sal_socket/impl/proto_mbedtls.c +++ b/components/net/sal_socket/impl/proto_mbedtls.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -59,7 +59,7 @@ static void *mebdtls_socket(int socket) { tls_free(session); session = RT_NULL; - + return RT_NULL; } @@ -68,7 +68,7 @@ static void *mebdtls_socket(int socket) { mbedtls_client_close(session); return RT_NULL; - } + } session->server_fd.fd = socket; return (void *)session; @@ -89,7 +89,7 @@ int mbedtls_net_send_cb(void *ctx, const unsigned char *buf, size_t len) { return -1; } - + pf = (struct sal_proto_family *)sock->netdev->sal_user_data; /* Register scoket sendto option to TLS send data callback */ @@ -128,7 +128,7 @@ int mbedtls_net_recv_cb( void *ctx, unsigned char *buf, size_t len) } pf = (struct sal_proto_family *)sock->netdev->sal_user_data; - + /* Register scoket recvfrom option to TLS recv data callback */ ret = pf->skt_ops->recvfrom((int) sock->user_data, (void *)buf, len, 0, RT_NULL, RT_NULL); if (ret < 0) @@ -183,7 +183,7 @@ static int mbedtls_connect(void *sock) mbedtls_x509_crt_verify_info((char *)session->buffer, session->buffer_len, " ! ", ret); goto __exit; } - + return ret; __exit: @@ -199,27 +199,27 @@ static int mbedtls_closesocket(void *sock) { struct sal_socket *ssock; int socket; - + if (sock == RT_NULL) { return 0; } - + socket = ((MbedTLSSession *) sock)->server_fd.fd; ssock = sal_get_socket(socket); if (ssock == RT_NULL) { return -1; } - + /* Close TLS client session, and clean user-data in SAL socket */ mbedtls_client_close((MbedTLSSession *) sock); ssock->user_data_tls = RT_NULL; - + return 0; } -static const struct sal_proto_tls_ops mbedtls_proto_ops= +static const struct sal_proto_tls_ops mbedtls_proto_ops= { RT_NULL, mebdtls_socket, diff --git a/components/net/sal_socket/include/dfs_net/dfs_net.h b/components/net/sal_socket/include/dfs_net/dfs_net.h index ad28b8ec2a..82b7526603 100644 --- a/components/net/sal_socket/include/dfs_net/dfs_net.h +++ b/components/net/sal_socket/include/dfs_net/dfs_net.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h b/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h index 8899daee96..f174bc6504 100644 --- a/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h +++ b/components/net/sal_socket/include/dfs_net/sys_select/sys/select.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/sal.h b/components/net/sal_socket/include/sal.h index 6ffaa90356..dd250e37b6 100644 --- a/components/net/sal_socket/include/sal.h +++ b/components/net/sal_socket/include/sal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/sal_netdb.h b/components/net/sal_socket/include/sal_netdb.h index d5ce9b1d7e..50064ce343 100644 --- a/components/net/sal_socket/include/sal_netdb.h +++ b/components/net/sal_socket/include/sal_netdb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/sal_socket.h b/components/net/sal_socket/include/sal_socket.h index b620bbe23c..497be47e41 100644 --- a/components/net/sal_socket/include/sal_socket.h +++ b/components/net/sal_socket/include/sal_socket.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -171,7 +171,7 @@ struct sockaddr_in #endif /* NETDEV_IPV4 */ #if NETDEV_IPV6 -struct sockaddr_in6 +struct sockaddr_in6 { uint8_t sin6_len; /* length of this structure */ sa_family_t sin6_family; /* AF_INET6 */ diff --git a/components/net/sal_socket/include/sal_tls.h b/components/net/sal_socket/include/sal_tls.h index 7681b313bd..f211a3c1f8 100644 --- a/components/net/sal_socket/include/sal_tls.h +++ b/components/net/sal_socket/include/sal_tls.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netdb.h b/components/net/sal_socket/include/socket/netdb.h index 17f83efe00..4783405022 100644 --- a/components/net/sal_socket/include/socket/netdb.h +++ b/components/net/sal_socket/include/socket/netdb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netinet/in.h b/components/net/sal_socket/include/socket/netinet/in.h index 57c417d7b6..37240547b4 100644 --- a/components/net/sal_socket/include/socket/netinet/in.h +++ b/components/net/sal_socket/include/socket/netinet/in.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netinet/tcp.h b/components/net/sal_socket/include/socket/netinet/tcp.h index 2ac4d6f40d..a3b530186a 100644 --- a/components/net/sal_socket/include/socket/netinet/tcp.h +++ b/components/net/sal_socket/include/socket/netinet/tcp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/netinet/udp.h b/components/net/sal_socket/include/socket/netinet/udp.h index 485d7d142c..21f50d55e5 100644 --- a/components/net/sal_socket/include/socket/netinet/udp.h +++ b/components/net/sal_socket/include/socket/netinet/udp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/include/socket/sys_socket/sys/socket.h b/components/net/sal_socket/include/socket/sys_socket/sys/socket.h index 04470aa84a..a86240e2ff 100644 --- a/components/net/sal_socket/include/socket/sys_socket/sys/socket.h +++ b/components/net/sal_socket/include/socket/sys_socket/sys/socket.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/socket/net_netdb.c b/components/net/sal_socket/socket/net_netdb.c index bc76a48965..03b995c68d 100644 --- a/components/net/sal_socket/socket/net_netdb.c +++ b/components/net/sal_socket/socket/net_netdb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/sal_socket/socket/net_sockets.c b/components/net/sal_socket/socket/net_sockets.c index a53b2f1f9c..3637635d50 100644 --- a/components/net/sal_socket/socket/net_sockets.c +++ b/components/net/sal_socket/socket/net_sockets.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -95,7 +95,7 @@ int shutdown(int s, int how) rt_set_errno(-EBADF); return -1; } - + if (sal_shutdown(socket, how) == 0) { error = 0; @@ -105,7 +105,7 @@ int shutdown(int s, int how) rt_set_errno(-ENOTSOCK); error = -1; } - + fd_put(d); return error; diff --git a/components/net/sal_socket/src/sal_socket.c b/components/net/sal_socket/src/sal_socket.c index 27dea260fb..e7142fae94 100644 --- a/components/net/sal_socket/src/sal_socket.c +++ b/components/net/sal_socket/src/sal_socket.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ulog/backend/console_be.c b/components/utilities/ulog/backend/console_be.c index 95dd547426..b84cd95d09 100644 --- a/components/utilities/ulog/backend/console_be.c +++ b/components/utilities/ulog/backend/console_be.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ulog/syslog/syslog.c b/components/utilities/ulog/syslog/syslog.c index 4c290bed52..a081db6eb6 100644 --- a/components/utilities/ulog/syslog/syslog.c +++ b/components/utilities/ulog/syslog/syslog.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ulog/syslog/syslog.h b/components/utilities/ulog/syslog/syslog.h index 43eec7125f..8e4d5ba15f 100644 --- a/components/utilities/ulog/syslog/syslog.h +++ b/components/utilities/ulog/syslog/syslog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c index b4571f4920..e903a707b2 100644 --- a/components/utilities/ulog/ulog.c +++ b/components/utilities/ulog/ulog.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ulog/ulog.h b/components/utilities/ulog/ulog.h index 670644bb30..3754828e56 100644 --- a/components/utilities/ulog/ulog.h +++ b/components/utilities/ulog/ulog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ulog/ulog_def.h b/components/utilities/ulog/ulog_def.h index 771e76a601..d51c6f0d84 100644 --- a/components/utilities/ulog/ulog_def.h +++ b/components/utilities/ulog/ulog_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -102,8 +102,8 @@ extern "C" { #define ulog_hex(TAG, width, buf, size) ulog_hexdump(TAG, width, buf, size) #else #define ulog_hex(TAG, width, buf, size) -#endif /* (LOG_LVL >= LOG_LVL_DBG) && (ULOG_OUTPUT_LVL >= LOG_LVL_DBG) */ - +#endif /* (LOG_LVL >= LOG_LVL_DBG) && (ULOG_OUTPUT_LVL >= LOG_LVL_DBG) */ + /* assert for developer. */ #ifdef ULOG_ASSERT_ENABLE #define ULOG_ASSERT(EXPR) \ @@ -142,7 +142,7 @@ extern "C" { #define log_d LOG_D #define log_v LOG_D #define log_raw LOG_RAW -#define log_hex LOG_HEX +#define log_hex LOG_HEX #define ELOG_LVL_ASSERT LOG_LVL_ASSERT #define ELOG_LVL_ERROR LOG_LVL_ERROR #define ELOG_LVL_WARN LOG_LVL_WARNING diff --git a/components/utilities/utest/utest.c b/components/utilities/utest/utest.c index 6500ae2fbe..325823de8a 100644 --- a/components/utilities/utest/utest.c +++ b/components/utilities/utest/utest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/utest/utest.h b/components/utilities/utest/utest.h index e2d72a931d..33d50efddb 100644 --- a/components/utilities/utest/utest.h +++ b/components/utilities/utest/utest.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -22,13 +22,13 @@ extern "C" { /** * utest_error - * + * * @brief Test result. - * + * * @member UTEST_PASSED Test success. * @member UTEST_FAILED Test failed. * @member UTEST_PASSED Test skipped. - * + * */ enum utest_error { @@ -40,13 +40,13 @@ typedef enum utest_error utest_err_e; /** * utest - * + * * @brief utest data structure. - * + * * @member error Error number from enum `utest_error`. * @member passed_num Total number of tests passed. * @member failed_num Total number of tests failed. - * + * */ struct utest { @@ -58,16 +58,16 @@ typedef struct utest *utest_t; /** * utest_tc_export - * + * * @brief utest testcase data structure. * Will export the data to `UtestTcTab` section in flash. - * + * * @member name Testcase name. * @member run_timeout Testcase maximum test time (Time unit: seconds). * @member init Necessary initialization before executing the test case function. * @member tc Total number of tests failed. * @member cleanup Total number of tests failed. - * + * */ struct utest_tc_export { const char *name; @@ -80,61 +80,61 @@ typedef struct utest_tc_export *utest_tc_export_t; /** * test_unit_func - * + * * @brief Unit test handler function pointer. - * + * */ typedef void (*test_unit_func)(void); /** * utest_unit_run - * + * * @brief Unit test function executor. * No need for the user to call this function directly - * + * * @param func Unit test function. * @param unit_func_name Unit test function name. - * + * * @return void - * + * */ void utest_unit_run(test_unit_func func, const char *unit_func_name); /** * utest_handle_get - * + * * @brief Get the utest data structure handle. * No need for the user to call this function directly - * + * * @param void - * + * * @return utest_t type. (struct utest *) - * + * */ utest_t utest_handle_get(void); /** * UTEST_NAME_MAX_LEN - * + * * @brief Testcase name maximum length. - * + * */ #define UTEST_NAME_MAX_LEN (128u) /** * UTEST_TC_EXPORT - * + * * @brief Export testcase function to `UtestTcTab` section in flash. * Used in application layer. - * + * * @param testcase The testcase function. * @param name The testcase name. * @param init The initialization function of the test case. * @param cleanup The cleanup function of the test case. * @param timeout Testcase maximum test time (Time unit: seconds). - * + * * @return None - * + * */ #define UTEST_TC_EXPORT(testcase, name, init, cleanup, timeout) \ RT_USED static const struct utest_tc_export _utest_testcase \ @@ -149,14 +149,14 @@ utest_t utest_handle_get(void); /** * UTEST_UNIT_RUN - * + * * @brief Unit test function executor. * Used in `testcase` function in application. - * + * * @param test_unit_func Unit test function - * + * * @return None - * + * */ #define UTEST_UNIT_RUN(test_unit_func) \ utest_unit_run(test_unit_func, #test_unit_func); \ diff --git a/components/utilities/utest/utest_assert.h b/components/utilities/utest/utest_assert.h index d83279272e..2e2007e773 100644 --- a/components/utilities/utest/utest_assert.h +++ b/components/utilities/utest/utest_assert.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -30,10 +30,10 @@ void utest_assert_buf(const char *a, const char *b, rt_size_t sz, rt_bool_t equa /** * uassert_x macros - * + * * @brief Get the utest data structure handle. * No need for the user to call this function directly. - * + * * @macro uassert_true if @value is true, not assert, means passing. * @macro uassert_false if @value is false, not assert, means passing. * @macro uassert_null if @value is null, not assert, means passing. @@ -46,7 +46,7 @@ void utest_assert_buf(const char *a, const char *b, rt_size_t sz, rt_bool_t equa * @macro uassert_buf_not_equal if @a not equal to @b, not assert, means passing. buf type test. * @macro uassert_in_range if @value is in range of min and max, not assert, means passing. * @macro uassert_not_in_range if @value is not in range of min and max, not assert, means passing. - * + * */ #define uassert_true(value) __utest_assert(value, "(" #value ") is false") #define uassert_false(value) __utest_assert(!(value), "(" #value ") is true") @@ -62,7 +62,7 @@ void utest_assert_buf(const char *a, const char *b, rt_size_t sz, rt_bool_t equa #define uassert_buf_equal(a, b, sz) utest_assert_buf((const char*)(a), (const char*)(b), (sz), RT_TRUE, __FILE__, __LINE__, __func__, "buf not equal") #define uassert_buf_not_equal(a, b, sz) utest_assert_buf((const char*)(a), (const char*)(b), (sz), RT_FALSE, __FILE__, __LINE__, __func__, "buf equal") -#define uassert_in_range(value, min, max) __utest_assert(((value >= min) && (value <= max)), "(" #value ") not in range("#min","#max")") +#define uassert_in_range(value, min, max) __utest_assert(((value >= min) && (value <= max)), "(" #value ") not in range("#min","#max")") #define uassert_not_in_range(value, min, max) __utest_assert(!((value >= min) && (value <= max)), "(" #value ") in range("#min","#max")") #ifdef __cplusplus diff --git a/components/utilities/utest/utest_log.h b/components/utilities/utest/utest_log.h index 0403268351..6aa54386a8 100644 --- a/components/utilities/utest/utest_log.h +++ b/components/utilities/utest/utest_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/utilities/ymodem/ymodem.c b/components/utilities/ymodem/ymodem.c index 07055db615..a74237689d 100644 --- a/components/utilities/ymodem/ymodem.c +++ b/components/utilities/ymodem/ymodem.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (C) 2012, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved * * SPDX-License-Identifier: Apache-2.0 @@ -13,7 +13,7 @@ #include #include "ymodem.h" -#ifdef YMODEM_USING_CRC_TABLE +#ifdef YMODEM_USING_CRC_TABLE static const rt_uint16_t ccitt_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, diff --git a/components/utilities/ymodem/ymodem.h b/components/utilities/ymodem/ymodem.h index 8419290e13..7006cf268d 100644 --- a/components/utilities/ymodem/ymodem.h +++ b/components/utilities/ymodem/ymodem.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (C) 2012, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved * * SPDX-License-Identifier: Apache-2.0 diff --git a/components/utilities/zmodem/crc.h b/components/utilities/zmodem/crc.h index fd11c1960a..c5251a7aa1 100644 --- a/components/utilities/zmodem/crc.h +++ b/components/utilities/zmodem/crc.h @@ -39,14 +39,14 @@ static unsigned short crctab[256] = { }; /* - * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. + * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. * NOTE: First srgument must be in range 0 to 255. * Second argument is referenced twice. - * - * Programmers may incorporate any or all code into their programs, - * giving proper credit within the source. Publication of the - * source routines is permitted so long as proper credit is given - * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, + * + * Programmers may incorporate any or all code into their programs, + * giving proper credit within the source. Publication of the + * source routines is permitted so long as proper credit is given + * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, * Omen Technology. */ diff --git a/components/utilities/zmodem/rz.c b/components/utilities/zmodem/rz.c index 1324b5994b..1845fd24c2 100644 --- a/components/utilities/zmodem/rz.c +++ b/components/utilities/zmodem/rz.c @@ -1,11 +1,11 @@ /* * File : rz.c - * the implemention of receiving files from the remote computers + * the implemention of receiving files from the remote computers * through the zmodem protocol. * Change Logs: * Date Author Notes - * 2011-03-29 itspy - * 2011-12-12 aozima fixed syntax error. + * 2011-03-29 itspy + * 2011-12-12 aozima fixed syntax error. */ #include @@ -35,293 +35,293 @@ void zr_start(char *path) { struct zfile *zf; rt_uint8_t n; - char ch,*p,*q; - rt_err_t res = -RT_ERROR; + char ch,*p,*q; + rt_err_t res = -RT_ERROR; - zf = rt_malloc(sizeof(struct zfile)); - if (zf == RT_NULL) - { - rt_kprintf("zf: out of memory\r\n"); - return; - } - memset(zf, 0, sizeof(struct zfile)); + zf = rt_malloc(sizeof(struct zfile)); + if (zf == RT_NULL) + { + rt_kprintf("zf: out of memory\r\n"); + return; + } + memset(zf, 0, sizeof(struct zfile)); zf->fname = path; - zf->fd = -1; - res = zrec_files(zf); - p = zf->fname; - for (;;) - { - q = strstr(p,"/"); - if (q == RT_NULL) break; - p = q+1; - } + zf->fd = -1; + res = zrec_files(zf); + p = zf->fname; + for (;;) + { + q = strstr(p,"/"); + if (q == RT_NULL) break; + p = q+1; + } if (res == RT_EOK) - { + { rt_kprintf("\b\b\bfile: %s \r\n",p); - rt_kprintf("size: %ld bytes\r\n",zf->bytes_received); - rt_kprintf("receive completed.\r\n"); - close(zf->fd); - rt_free(zf->fname); + rt_kprintf("size: %ld bytes\r\n",zf->bytes_received); + rt_kprintf("receive completed.\r\n"); + close(zf->fd); + rt_free(zf->fname); } else { rt_kprintf("\b\b\bfile: %s \r\n",p); - rt_kprintf("size: 0 bytes\r\n"); - rt_kprintf("receive failed.\r\n"); - if (zf->fd >= 0) - { - close(zf->fd); - unlink(zf->fname); /* remove this file */ - rt_free(zf->fname); - } + rt_kprintf("size: 0 bytes\r\n"); + rt_kprintf("receive failed.\r\n"); + if (zf->fd >= 0) + { + close(zf->fd); + unlink(zf->fname); /* remove this file */ + rt_free(zf->fname); + } + } + rt_free(zf); + /* waiting,clear console buffer */ + rt_thread_delay(RT_TICK_PER_SECOND/2); + while(1) + { + n=rt_device_read(shell->device, 0, &ch, 1); + if (n == 0) break; } - rt_free(zf); - /* waiting,clear console buffer */ - rt_thread_delay(RT_TICK_PER_SECOND/2); - while(1) - { - n=rt_device_read(shell->device, 0, &ch, 1); - if (n == 0) break; - } - return ; + return ; } /* receiver init, wait for ack */ static rt_err_t zrec_init(rt_uint8_t *rxbuf, struct zfile *zf) { rt_uint8_t err_cnt = 0; - rt_err_t res = -RT_ERROR; + rt_err_t res = -RT_ERROR; - for (;;) - { - zput_pos(0L); - tx_header[ZF0] = ZF0_CMD; - tx_header[ZF1] = ZF1_CMD; - tx_header[ZF2] = ZF2_CMD; - zsend_hex_header(ZRINIT, tx_header); + for (;;) + { + zput_pos(0L); + tx_header[ZF0] = ZF0_CMD; + tx_header[ZF1] = ZF1_CMD; + tx_header[ZF2] = ZF2_CMD; + zsend_hex_header(ZRINIT, tx_header); again: res = zget_header(rx_header); - switch(res) - { - case ZFILE: - ZF0_CMD = rx_header[ZF0]; - ZF1_CMD = rx_header[ZF1]; - ZF2_CMD = rx_header[ZF2]; - ZF3_CMD = rx_header[ZF3]; - res = zget_data(rxbuf, RX_BUFFER_SIZE); - if (res == GOTCRCW) - { - if ((res =zget_file_info((char*)rxbuf,zf))!= RT_EOK) - { - zsend_hex_header(ZSKIP, tx_header); - return (res); - } - return RT_EOK;; - } - zsend_hex_header(ZNAK, tx_header); - goto again; - case ZSINIT: - if (zget_data((rt_uint8_t*)Attn, ZATTNLEN) == GOTCRCW) /* send zack */ - { - zsend_hex_header(ZACK, tx_header); - goto again; - } - zsend_hex_header(ZNAK, tx_header); /* send znak */ - goto again; - case ZRQINIT: - continue; - case ZEOF: - continue; - case ZCOMPL: - goto again; - case ZFIN: /* end file session */ - zrec_ack_bibi(); - return res; - default: - if (++err_cnt >1000) return -RT_ERROR; - continue; - } - } + switch(res) + { + case ZFILE: + ZF0_CMD = rx_header[ZF0]; + ZF1_CMD = rx_header[ZF1]; + ZF2_CMD = rx_header[ZF2]; + ZF3_CMD = rx_header[ZF3]; + res = zget_data(rxbuf, RX_BUFFER_SIZE); + if (res == GOTCRCW) + { + if ((res =zget_file_info((char*)rxbuf,zf))!= RT_EOK) + { + zsend_hex_header(ZSKIP, tx_header); + return (res); + } + return RT_EOK;; + } + zsend_hex_header(ZNAK, tx_header); + goto again; + case ZSINIT: + if (zget_data((rt_uint8_t*)Attn, ZATTNLEN) == GOTCRCW) /* send zack */ + { + zsend_hex_header(ZACK, tx_header); + goto again; + } + zsend_hex_header(ZNAK, tx_header); /* send znak */ + goto again; + case ZRQINIT: + continue; + case ZEOF: + continue; + case ZCOMPL: + goto again; + case ZFIN: /* end file session */ + zrec_ack_bibi(); + return res; + default: + if (++err_cnt >1000) return -RT_ERROR; + continue; + } + } } /* receive files */ static rt_err_t zrec_files(struct zfile *zf) { - rt_uint8_t *rxbuf; - rt_err_t res = -RT_ERROR; + rt_uint8_t *rxbuf; + rt_err_t res = -RT_ERROR; - zinit_parameter(); - rxbuf = rt_malloc(RX_BUFFER_SIZE*sizeof(rt_uint8_t)); - if (rxbuf == RT_NULL) - { - rt_kprintf("rxbuf: out of memory\r\n"); - return -RT_ERROR; - } - rt_kprintf("\r\nrz: ready...\r\n"); /* here ready to receive things */ - if ((res = zrec_init(rxbuf,zf))!= RT_EOK) - { - rt_kprintf("\b\b\breceive init failed\r\n"); - rt_free(rxbuf); - return -RT_ERROR; - } - res = zrec_file(rxbuf,zf); - if (res == ZFIN) - { - rt_free(rxbuf); - return RT_EOK; /* if finish session */ - } - else if (res == ZCAN) - { + zinit_parameter(); + rxbuf = rt_malloc(RX_BUFFER_SIZE*sizeof(rt_uint8_t)); + if (rxbuf == RT_NULL) + { + rt_kprintf("rxbuf: out of memory\r\n"); + return -RT_ERROR; + } + rt_kprintf("\r\nrz: ready...\r\n"); /* here ready to receive things */ + if ((res = zrec_init(rxbuf,zf))!= RT_EOK) + { + rt_kprintf("\b\b\breceive init failed\r\n"); + rt_free(rxbuf); + return -RT_ERROR; + } + res = zrec_file(rxbuf,zf); + if (res == ZFIN) + { rt_free(rxbuf); - return ZCAN; /* cancel by sender */ - } - else - { - zsend_can(); - rt_free(rxbuf); - return res; - } + return RT_EOK; /* if finish session */ + } + else if (res == ZCAN) + { + rt_free(rxbuf); + return ZCAN; /* cancel by sender */ + } + else + { + zsend_can(); + rt_free(rxbuf); + return res; + } } /* receive file */ static rt_err_t zrec_file(rt_uint8_t *rxbuf, struct zfile *zf) { - rt_err_t res = - RT_ERROR; - rt_uint16_t err_cnt = 0; + rt_err_t res = - RT_ERROR; + rt_uint16_t err_cnt = 0; - do - { - zput_pos(zf->bytes_received); - zsend_hex_header(ZRPOS, tx_header); + do + { + zput_pos(zf->bytes_received); + zsend_hex_header(ZRPOS, tx_header); again: res = zget_header(rx_header); - switch (res) - { - case ZDATA: - zget_pos(Rxpos); - if (Rxpos != zf->bytes_received) - { - zsend_break(Attn); - continue; - } - err_cnt = 0; - res = zrec_file_data(rxbuf,zf); - if (res == -RT_ERROR) - { - zsend_break(Attn); - continue; - } - else if (res == GOTCAN) return res; - else goto again; - case ZRPOS: - zget_pos(Rxpos); - continue; - case ZEOF: - err_cnt = 0; - zget_pos(Rxpos); - if (Rxpos != zf->bytes_received || Rxpos != zf->bytes_total) - { - continue; - } - return (zrec_init(rxbuf,zf)); /* resend ZRINIT packet,ready to receive next file */ + switch (res) + { + case ZDATA: + zget_pos(Rxpos); + if (Rxpos != zf->bytes_received) + { + zsend_break(Attn); + continue; + } + err_cnt = 0; + res = zrec_file_data(rxbuf,zf); + if (res == -RT_ERROR) + { + zsend_break(Attn); + continue; + } + else if (res == GOTCAN) return res; + else goto again; + case ZRPOS: + zget_pos(Rxpos); + continue; + case ZEOF: + err_cnt = 0; + zget_pos(Rxpos); + if (Rxpos != zf->bytes_received || Rxpos != zf->bytes_total) + { + continue; + } + return (zrec_init(rxbuf,zf)); /* resend ZRINIT packet,ready to receive next file */ case ZFIN: - zrec_ack_bibi(); - return ZCOMPL; - case ZCAN: + zrec_ack_bibi(); + return ZCOMPL; + case ZCAN: #ifdef ZDEBUG rt_kprintf("error code: sender cancelled \r\n"); #endif - zf->bytes_received = 0L; /* throw the received data */ - return res; - case ZSKIP: - return res; - case -RT_ERROR: - zsend_break(Attn); - continue; - case ZNAK: - case TIMEOUT: - default: - continue; - } - } while(++err_cnt < 100); + zf->bytes_received = 0L; /* throw the received data */ + return res; + case ZSKIP: + return res; + case -RT_ERROR: + zsend_break(Attn); + continue; + case ZNAK: + case TIMEOUT: + default: + continue; + } + } while(++err_cnt < 100); - return res; + return res; } /* proccess file infomation */ static rt_err_t zget_file_info(char *name, struct zfile *zf) { - char *p; - char *full_path,*ptr; - rt_uint16_t i,len; - rt_err_t res = -RT_ERROR; - struct statfs buf; - struct stat finfo; + char *p; + char *full_path,*ptr; + rt_uint16_t i,len; + rt_err_t res = -RT_ERROR; + struct statfs buf; + struct stat finfo; - if (zf->fname == RT_NULL) /* extract file path */ + if (zf->fname == RT_NULL) /* extract file path */ { - len = strlen(name)+2; - } - else - len = strlen(zf->fname)+strlen(name)+2; + len = strlen(name)+2; + } + else + len = strlen(zf->fname)+strlen(name)+2; full_path = rt_malloc(len); - if (full_path == RT_NULL) - { - zsend_can(); - rt_kprintf("\b\b\bfull_path: out of memory\n"); - rt_free(full_path); - return -RT_ERROR; - } - memset(full_path,0,len); + if (full_path == RT_NULL) + { + zsend_can(); + rt_kprintf("\b\b\bfull_path: out of memory\n"); + rt_free(full_path); + return -RT_ERROR; + } + memset(full_path,0,len); for (i=0,ptr=zf->fname;ifd=open(full_path, DFS_O_DIRECTORY,0)) < 0) - { - zsend_can(); - rt_kprintf("\b\b\bcan not open file:%s\r\n",zf->fname+1); - close(zf->fd); - zf->fd = -1; - rt_free(full_path); - return res; - } - fstat(zf->fd, &finfo); - if ((finfo.st_mode&S_IFDIR) != S_IFDIR) - { - close(zf->fd); - zf->fd = -1; - return res; - } - close(zf->fd); - /* get fullpath && file attributes */ + /* check if is a directory */ + if ((zf->fd=open(full_path, DFS_O_DIRECTORY,0)) < 0) + { + zsend_can(); + rt_kprintf("\b\b\bcan not open file:%s\r\n",zf->fname+1); + close(zf->fd); + zf->fd = -1; + rt_free(full_path); + return res; + } + fstat(zf->fd, &finfo); + if ((finfo.st_mode&S_IFDIR) != S_IFDIR) + { + close(zf->fd); + zf->fd = -1; + return res; + } + close(zf->fd); + /* get fullpath && file attributes */ strcat(full_path,name); zf->fname = full_path; - p = strlen(name)+name+1; - sscanf((const char *)p, "%ld%lo%o", &zf->bytes_total,&zf->ctime,&zf->mode); + p = strlen(name)+name+1; + sscanf((const char *)p, "%ld%lo%o", &zf->bytes_total,&zf->ctime,&zf->mode); #if defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR) - dfs_statfs(working_directory,&buf); - if (zf->bytes_total > (buf.f_blocks * buf.f_bfree)) - { - zsend_can(); - rt_kprintf("\b\b\bnot enough disk space\r\n"); - zf->fd = -1; - rt_free(full_path); - return -RT_ERROR; - } + dfs_statfs(working_directory,&buf); + if (zf->bytes_total > (buf.f_blocks * buf.f_bfree)) + { + zsend_can(); + rt_kprintf("\b\b\bnot enough disk space\r\n"); + zf->fd = -1; + rt_free(full_path); + return -RT_ERROR; + } #else buf = buf; #endif - zf->bytes_received = 0L; - if ((zf->fd = open(zf->fname,DFS_O_CREAT|DFS_O_WRONLY,0)) < 0) /* create or replace exist file */ - { - zsend_can(); - rt_kprintf("\b\b\bcan not create file:%s \r\n",zf->fname); - return -RT_ERROR; - } + zf->bytes_received = 0L; + if ((zf->fd = open(zf->fname,DFS_O_CREAT|DFS_O_WRONLY,0)) < 0) /* create or replace exist file */ + { + zsend_can(); + rt_kprintf("\b\b\bcan not create file:%s \r\n",zf->fname); + return -RT_ERROR; + } - return RT_EOK; + return RT_EOK; } /* receive file data,continously, no ack */ @@ -330,72 +330,72 @@ static rt_err_t zrec_file_data(rt_uint8_t *buf, struct zfile *zf) rt_err_t res = -RT_ERROR; more_data: - res = zget_data(buf,RX_BUFFER_SIZE); - switch(res) - { - case GOTCRCW: /* zack received */ - zwrite_file(buf,Rxcount,zf); - zf->bytes_received += Rxcount; - zput_pos(zf->bytes_received); - zsend_line(XON); - zsend_hex_header(ZACK, tx_header); - return RT_EOK; - case GOTCRCQ: - zwrite_file(buf,Rxcount,zf); - zf->bytes_received += Rxcount; - zput_pos(zf->bytes_received); - zsend_hex_header(ZACK, tx_header); - goto more_data; - case GOTCRCG: - zwrite_file(buf,Rxcount,zf); - zf->bytes_received += Rxcount; - goto more_data; - case GOTCRCE: - zwrite_file(buf,Rxcount,zf); - zf->bytes_received += Rxcount; - return RT_EOK; - case GOTCAN: + res = zget_data(buf,RX_BUFFER_SIZE); + switch(res) + { + case GOTCRCW: /* zack received */ + zwrite_file(buf,Rxcount,zf); + zf->bytes_received += Rxcount; + zput_pos(zf->bytes_received); + zsend_line(XON); + zsend_hex_header(ZACK, tx_header); + return RT_EOK; + case GOTCRCQ: + zwrite_file(buf,Rxcount,zf); + zf->bytes_received += Rxcount; + zput_pos(zf->bytes_received); + zsend_hex_header(ZACK, tx_header); + goto more_data; + case GOTCRCG: + zwrite_file(buf,Rxcount,zf); + zf->bytes_received += Rxcount; + goto more_data; + case GOTCRCE: + zwrite_file(buf,Rxcount,zf); + zf->bytes_received += Rxcount; + return RT_EOK; + case GOTCAN: #ifdef ZDEBUG - rt_kprintf("error code : ZCAN \r\n"); + rt_kprintf("error code : ZCAN \r\n"); #endif - return res; - case TIMEOUT: - return res; + return res; + case TIMEOUT: + return res; case -RT_ERROR: - zsend_break(Attn); - return res; - default: - return res; - } + zsend_break(Attn); + return res; + default: + return res; + } } /* write file */ static rt_err_t zwrite_file(rt_uint8_t *buf,rt_uint16_t size, struct zfile *zf) { - return (write(zf->fd,buf,size)); + return (write(zf->fd,buf,size)); } /* ack bibi */ static void zrec_ack_bibi(void) { - rt_uint8_t i; + rt_uint8_t i; - zput_pos(0L); - for (i=0;i<3;i++) - { - zsend_hex_header(ZFIN, tx_header); - switch (zread_line(100)) - { - case 'O': - zread_line(1); - return; - case RCDO: - return; - case TIMEOUT: - default: - break; - } - } + zput_pos(0L); + for (i=0;i<3;i++) + { + zsend_hex_header(ZFIN, tx_header); + switch (zread_line(100)) + { + case 'O': + zread_line(1); + return; + case RCDO: + return; + case TIMEOUT: + default: + break; + } + } } /* end of rz.c */ diff --git a/components/utilities/zmodem/sz.c b/components/utilities/zmodem/sz.c index 0fde4165f6..0b0b5515f0 100644 --- a/components/utilities/zmodem/sz.c +++ b/components/utilities/zmodem/sz.c @@ -1,10 +1,10 @@ /* * File : sz.c - * the implemention of sending files to the remote computers + * the implemention of sending files to the remote computers * through the zmodem protocol. * Change Logs: * Date Author Notes - * 2011-03-29 itspy + * 2011-03-29 itspy */ #include @@ -17,10 +17,10 @@ #include "zdef.h" -static rt_uint8_t TX_BUFFER[TX_BUFFER_SIZE]; /* sender buffer */ -static rt_uint8_t file_cnt = 0; /* count of number of files opened */ -static rt_uint8_t Rxflags = 0; /* rx parameter flags */ -static rt_uint8_t ZF2_OP; /* file transfer option */ +static rt_uint8_t TX_BUFFER[TX_BUFFER_SIZE]; /* sender buffer */ +static rt_uint8_t file_cnt = 0; /* count of number of files opened */ +static rt_uint8_t Rxflags = 0; /* rx parameter flags */ +static rt_uint8_t ZF2_OP; /* file transfer option */ void zs_start(char *path); static void zsend_init(void); @@ -38,233 +38,233 @@ static void zsay_bibi(void); void zs_start(char *path) { struct zfile *zf; - rt_err_t res = RT_ERROR; + rt_err_t res = RT_ERROR; char *p,*q; - zf = rt_malloc(sizeof(struct zfile)); - if (zf == RT_NULL) - { - rt_kprintf("zf: out of memory\r\n"); - return; - } - rt_kprintf("\r\nsz: ready...\r\n"); /* here ready to send things */ - memset(zf, 0, sizeof(struct zfile)); + zf = rt_malloc(sizeof(struct zfile)); + if (zf == RT_NULL) + { + rt_kprintf("zf: out of memory\r\n"); + return; + } + rt_kprintf("\r\nsz: ready...\r\n"); /* here ready to send things */ + memset(zf, 0, sizeof(struct zfile)); zf->fname = path; - zf->fd = -1; - res = zsend_files(zf); - p = zf->fname; - for (;;) - { - q = strstr(p,"/"); - if (q == RT_NULL) break; - p = q+1; - } + zf->fd = -1; + res = zsend_files(zf); + p = zf->fname; + for (;;) + { + q = strstr(p,"/"); + if (q == RT_NULL) break; + p = q+1; + } if (res == RT_EOK) { rt_kprintf("\r\nfile: %s \r\nsize: %ld bytes\r\nsend completed.\r\n", - p,zf->bytes_received); + p,zf->bytes_received); } else { rt_kprintf("\r\nfile: %s \r\nsize: 0 bytes\r\nsend failed.\r\n",p); } - rt_free(zf); + rt_free(zf); - return; + return; } /* init the parameters */ static void zsend_init(void) { - rt_err_t res = -RT_ERROR; + rt_err_t res = -RT_ERROR; - zinit_parameter(); - for(;;) /* wait ZPAD */ - { - res = zread_line(800); - if (res == ZPAD) break; - } - for (;;) - { - res = zget_header(rx_header); - if (res == ZRINIT) break; - } - if ((rx_header[ZF1] & ZRQNVH)) - { - zput_pos(0x80L); /* Show we can var header */ - zsend_hex_header(ZRQINIT, tx_header); - } - Rxflags = rx_header[ZF0] & 0377; - if (Rxflags & CANFC32) Txfcs32 = 1; /* used 32bits CRC check */ + zinit_parameter(); + for(;;) /* wait ZPAD */ + { + res = zread_line(800); + if (res == ZPAD) break; + } + for (;;) + { + res = zget_header(rx_header); + if (res == ZRINIT) break; + } + if ((rx_header[ZF1] & ZRQNVH)) + { + zput_pos(0x80L); /* Show we can var header */ + zsend_hex_header(ZRQINIT, tx_header); + } + Rxflags = rx_header[ZF0] & 0377; + if (Rxflags & CANFC32) Txfcs32 = 1; /* used 32bits CRC check */ - if (ZF2_OP == ZTRLE && (Rxflags & CANRLE)) /* for RLE packet */ - Txfcs32 = 2; - else - ZF2_OP = 0; + if (ZF2_OP == ZTRLE && (Rxflags & CANRLE)) /* for RLE packet */ + Txfcs32 = 2; + else + ZF2_OP = 0; /* send SINIT cmd */ - return; + return; } /* send files */ static rt_err_t zsend_files(struct zfile *zf) { - char *p,*q; - char *str = "/"; - struct stat finfo; - rt_err_t res = -RT_ERROR; + char *p,*q; + char *str = "/"; + struct stat finfo; + rt_err_t res = -RT_ERROR; - if (zf->fname == RT_NULL) - { - rt_kprintf("\r\nerror: no file to be send.\r\n"); - return res; - } - if ((zf->fd=open(zf->fname, DFS_O_RDONLY,0)) <0) - { - rt_kprintf("\r\ncan not open file:%s\r\n",zf->fname+1); - return res; - } + if (zf->fname == RT_NULL) + { + rt_kprintf("\r\nerror: no file to be send.\r\n"); + return res; + } + if ((zf->fd=open(zf->fname, DFS_O_RDONLY,0)) <0) + { + rt_kprintf("\r\ncan not open file:%s\r\n",zf->fname+1); + return res; + } - zf->file_end = 0; - ++file_cnt; - /* extract file name */ - p = zf->fname; - for (;;) - { - q = strstr(p,str); - if (q == RT_NULL) break; - p = q+1; - } - q = (char*)TX_BUFFER; - for (;;) - { - *q++ = *p++; - if (*p == 0) break; - } - *q++ = 0; - p=q; - while (q < (char*)(TX_BUFFER + 1024)) - *q++ = 0; - /* get file attributes */ - fstat(zf->fd,&finfo); - Left_sizes += finfo.st_size; - rt_sprintf(p, "%lu %lo %o 3 %d %ld", (long)finfo.st_size, finfo.st_mtime, - finfo.st_mode, file_cnt, Left_sizes); - Left_sizes -= finfo.st_size; - TX_BUFFER[127] = (finfo.st_size + 127) >>7; - TX_BUFFER[126] = (finfo.st_size + 127) >>15; + zf->file_end = 0; + ++file_cnt; + /* extract file name */ + p = zf->fname; + for (;;) + { + q = strstr(p,str); + if (q == RT_NULL) break; + p = q+1; + } + q = (char*)TX_BUFFER; + for (;;) + { + *q++ = *p++; + if (*p == 0) break; + } + *q++ = 0; + p=q; + while (q < (char*)(TX_BUFFER + 1024)) + *q++ = 0; + /* get file attributes */ + fstat(zf->fd,&finfo); + Left_sizes += finfo.st_size; + rt_sprintf(p, "%lu %lo %o 3 %d %ld", (long)finfo.st_size, finfo.st_mtime, + finfo.st_mode, file_cnt, Left_sizes); + Left_sizes -= finfo.st_size; + TX_BUFFER[127] = (finfo.st_size + 127) >>7; + TX_BUFFER[126] = (finfo.st_size + 127) >>15; - zsend_init(); - /* start sending files */ - res = zsend_file(zf,TX_BUFFER, (p-(char*)TX_BUFFER)+strlen(p)+1); - zsay_bibi(); - close(zf->fd); - - return res; + zsend_init(); + /* start sending files */ + res = zsend_file(zf,TX_BUFFER, (p-(char*)TX_BUFFER)+strlen(p)+1); + zsay_bibi(); + close(zf->fd); + + return res; } /* send file name and related info */ static rt_err_t zsend_file(struct zfile *zf, rt_uint8_t *buf, rt_uint16_t len) { - rt_uint8_t cnt; - rt_err_t res = -RT_ERROR; + rt_uint8_t cnt; + rt_err_t res = -RT_ERROR; - for (cnt=0;cnt<5;cnt++) - { - tx_header[ZF0] = ZF0_CMD; /* file conversion option */ - tx_header[ZF1] = ZF1_CMD; /* file management option */ - tx_header[ZF2] = (ZF3_CMD|ZF2_OP); /* file transfer option */ - tx_header[ZF3] = ZF3_CMD; - zsend_bin_header(ZFILE, tx_header); - zsend_bin_data(buf, len, ZCRCW); + for (cnt=0;cnt<5;cnt++) + { + tx_header[ZF0] = ZF0_CMD; /* file conversion option */ + tx_header[ZF1] = ZF1_CMD; /* file management option */ + tx_header[ZF2] = (ZF3_CMD|ZF2_OP); /* file transfer option */ + tx_header[ZF3] = ZF3_CMD; + zsend_bin_header(ZFILE, tx_header); + zsend_bin_data(buf, len, ZCRCW); loop: - res = zget_header(rx_header); - switch (res) - { - case ZRINIT: - while ((res = zread_line(50)) > 0) - { - if (res == ZPAD) - { - goto loop; - } - } - break; - case ZCAN: - case TIMEOUT: - case ZABORT: - case ZFIN: + res = zget_header(rx_header); + switch (res) + { + case ZRINIT: + while ((res = zread_line(50)) > 0) + { + if (res == ZPAD) + { + goto loop; + } + } + break; + case ZCAN: + case TIMEOUT: + case ZABORT: + case ZFIN: + break; + case -RT_ERROR: + case ZNAK: + break; + case ZCRC: /* no CRC request */ + goto loop; + case ZFERR: + case ZSKIP: break; - case -RT_ERROR: - case ZNAK: - break; - case ZCRC: /* no CRC request */ - goto loop; - case ZFERR: - case ZSKIP: - break; - case ZRPOS: /* here we want */ - zget_pos(Rxpos); - Txpos = Rxpos; - return(zsend_file_data(zf)); - default: - break; - } - } + case ZRPOS: /* here we want */ + zget_pos(Rxpos); + Txpos = Rxpos; + return(zsend_file_data(zf)); + default: + break; + } + } - return res; + return res; } /* send the file data */ static rt_err_t zsend_file_data(struct zfile *zf) { - rt_int16_t cnt; - rt_uint8_t cmd; - rt_err_t res = -RT_ERROR; - /* send ZDATA packet, start to send data */ + rt_int16_t cnt; + rt_uint8_t cmd; + rt_err_t res = -RT_ERROR; + /* send ZDATA packet, start to send data */ start_send: - zput_pos(Txpos); - zsend_bin_header(ZDATA, tx_header); - do - { - cnt = zfill_buffer(zf,TX_BUFFER,RX_BUFFER_SIZE); - if (cnt < RX_BUFFER_SIZE ) - cmd = ZCRCE; - else - cmd = ZCRCG; - zsend_bin_data(TX_BUFFER, cnt, cmd); - zf->bytes_received= Txpos += cnt; - if (cmd == ZCRCW) - goto get_syn1; - } while (cnt == RX_BUFFER_SIZE); - for (;;) /* get ack and check if send finish */ - { - zput_pos(Txpos); - zsend_bin_header(ZEOF, tx_header); + zput_pos(Txpos); + zsend_bin_header(ZDATA, tx_header); + do + { + cnt = zfill_buffer(zf,TX_BUFFER,RX_BUFFER_SIZE); + if (cnt < RX_BUFFER_SIZE ) + cmd = ZCRCE; + else + cmd = ZCRCG; + zsend_bin_data(TX_BUFFER, cnt, cmd); + zf->bytes_received= Txpos += cnt; + if (cmd == ZCRCW) + goto get_syn1; + } while (cnt == RX_BUFFER_SIZE); + for (;;) /* get ack and check if send finish */ + { + zput_pos(Txpos); + zsend_bin_header(ZEOF, tx_header); get_syn1: res = zget_sync(); - switch (res) - { - case ZACK: - goto get_syn1; - case ZNAK: - continue; - case ZRPOS: /* resend here */ - lseek(zf->fd,Txpos,0); - goto start_send; - case ZRINIT: /* send finish,then begin to send next file */ - return RT_EOK; - case ZSKIP: - case -RT_ERROR: - return res; - default: + switch (res) + { + case ZACK: + goto get_syn1; + case ZNAK: + continue; + case ZRPOS: /* resend here */ + lseek(zf->fd,Txpos,0); + goto start_send; + case ZRINIT: /* send finish,then begin to send next file */ + return RT_EOK; + case ZSKIP: + case -RT_ERROR: return res; - } - } + default: + return res; + } + } } /* fill file data to buffer*/ static rt_uint16_t zfill_buffer(struct zfile *zf, rt_uint8_t *buf, rt_uint16_t size) { - return (read(zf->fd,buf,size)); + return (read(zf->fd,buf,size)); } /* wait sync(ack) from the receiver */ @@ -272,50 +272,50 @@ static rt_err_t zget_sync(void) { rt_err_t res = -RT_ERROR; - for (;;) - { - res = zget_header(rx_header); - switch (res) - { - case ZCAN: - case ZABORT: - case ZFIN: - case TIMEOUT: - return -RT_ERROR; - case ZRPOS: /* get pos, need to resend */ - zget_pos(Rxpos); - Txpos = Rxpos; - return res; - case ZACK: - return res; - case ZRINIT: /* get ZRINIT indicate that the prev file send completed */ - return res; - case ZSKIP: - return res; - case -RT_ERROR: - default: - zsend_bin_header(ZNAK, tx_header); - continue; - } - } + for (;;) + { + res = zget_header(rx_header); + switch (res) + { + case ZCAN: + case ZABORT: + case ZFIN: + case TIMEOUT: + return -RT_ERROR; + case ZRPOS: /* get pos, need to resend */ + zget_pos(Rxpos); + Txpos = Rxpos; + return res; + case ZACK: + return res; + case ZRINIT: /* get ZRINIT indicate that the prev file send completed */ + return res; + case ZSKIP: + return res; + case -RT_ERROR: + default: + zsend_bin_header(ZNAK, tx_header); + continue; + } + } } /* say "bibi" to the receiver */ static void zsay_bibi(void) { - for (;;) - { - zput_pos(0L); /* reninit position of next file*/ - zsend_hex_header(ZFIN, tx_header); /* send finished session cmd */ - switch (zget_header(rx_header)) - { - case ZFIN: - zsend_line('O'); - zsend_line('O'); - case ZCAN: - case TIMEOUT: - return; - } - } + for (;;) + { + zput_pos(0L); /* reninit position of next file*/ + zsend_hex_header(ZFIN, tx_header); /* send finished session cmd */ + switch (zget_header(rx_header)) + { + case ZFIN: + zsend_line('O'); + zsend_line('O'); + case ZCAN: + case TIMEOUT: + return; + } + } } /* end of sz.c */ diff --git a/components/utilities/zmodem/zcore.c b/components/utilities/zmodem/zcore.c index 02ffbba830..75d9647348 100644 --- a/components/utilities/zmodem/zcore.c +++ b/components/utilities/zmodem/zcore.c @@ -3,7 +3,7 @@ * the core functions of implementing zmodem protocol * Change Logs: * Date Author Notes - * 2011-03-29 itspy + * 2011-03-29 itspy */ #include @@ -16,22 +16,22 @@ #include #include "zdef.h" -char ZF0_CMD; /* file conversion request */ -char ZF1_CMD; /* file management request */ -char ZF2_CMD; /* file transport request */ -char ZF3_CMD; -rt_uint8_t Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */ -rt_uint16_t Rxcount; /* received count*/ -char header_type; /* header type */ -rt_uint8_t rx_header[4]; /* received header */ -rt_uint8_t tx_header[4]; /* transmitted header */ -rt_uint32_t Rxpos; /* received file position */ -rt_uint32_t Txpos; /* transmitted file position */ -rt_uint8_t Txfcs32; /* TURE means send binary frames with 32 bit FCS */ -rt_uint8_t TxCRC; /* controls 32 bit CRC being sent */ -rt_uint8_t RxCRC; /* indicates/controls 32 bit CRC being received */ +char ZF0_CMD; /* file conversion request */ +char ZF1_CMD; /* file management request */ +char ZF2_CMD; /* file transport request */ +char ZF3_CMD; +rt_uint8_t Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */ +rt_uint16_t Rxcount; /* received count*/ +char header_type; /* header type */ +rt_uint8_t rx_header[4]; /* received header */ +rt_uint8_t tx_header[4]; /* transmitted header */ +rt_uint32_t Rxpos; /* received file position */ +rt_uint32_t Txpos; /* transmitted file position */ +rt_uint8_t Txfcs32; /* TURE means send binary frames with 32 bit FCS */ +rt_uint8_t TxCRC; /* controls 32 bit CRC being sent */ +rt_uint8_t RxCRC; /* indicates/controls 32 bit CRC being received */ /* 0 == CRC16, 1 == CRC32, 2 == CRC32 + RLE */ -char Attn[ZATTNLEN+1]; /* attention string rx sends to tx on err */ +char Attn[ZATTNLEN+1]; /* attention string rx sends to tx on err */ void zinit_parameter(void); void zsend_bin_header(rt_uint8_t type, rt_uint8_t *hdr); @@ -52,670 +52,670 @@ rt_int16_t zread_byte(void); rt_int16_t zxor_read(void); void zput_pos(rt_uint32_t pos); void zget_pos(rt_uint32_t pos); - - + + void zinit_parameter(void) { rt_uint8_t i; - ZF0_CMD = CANFC32|CANFDX|CANOVIO; /* not chose CANFC32,CANRLE,although it have been supported */ - ZF1_CMD = 0; /* fix header length,not support CANVHDR */ - ZF2_CMD = 0; - ZF3_CMD = 0; - Rxframeind =0; - header_type = 0; - Rxcount = 0; - for (i=0;i<4;i++) rx_header[i] = tx_header[i] = 0; - Rxpos = Txpos = 0; - RxCRC = 0; - Txfcs32 = 0; - - return ; + ZF0_CMD = CANFC32|CANFDX|CANOVIO; /* not chose CANFC32,CANRLE,although it have been supported */ + ZF1_CMD = 0; /* fix header length,not support CANVHDR */ + ZF2_CMD = 0; + ZF3_CMD = 0; + Rxframeind =0; + header_type = 0; + Rxcount = 0; + for (i=0;i<4;i++) rx_header[i] = tx_header[i] = 0; + Rxpos = Txpos = 0; + RxCRC = 0; + Txfcs32 = 0; + + return ; } /* send binary header */ void zsend_bin_header(rt_uint8_t type, rt_uint8_t *hdr) { - rt_uint8_t i; - rt_uint32_t crc; - - zsend_byte(ZPAD); - zsend_byte(ZDLE); - TxCRC = Txfcs32; - if (TxCRC == 0) - { - zsend_byte(ZBIN); - zsend_zdle_char(type); - /* add 16bits crc */ - crc = 0L; - crc = updcrc16(type, 0); - for (i=0;i<4;i++) - { - zsend_zdle_char(*hdr); - crc = updcrc16((0377 & *hdr++),crc); - } - crc = updcrc16(0,updcrc16(0,crc)); - zsend_zdle_char(((int)(crc>>8))); - zsend_zdle_char(crc); - } - else if(TxCRC == 1) - { + rt_uint8_t i; + rt_uint32_t crc; + + zsend_byte(ZPAD); + zsend_byte(ZDLE); + TxCRC = Txfcs32; + if (TxCRC == 0) + { + zsend_byte(ZBIN); + zsend_zdle_char(type); + /* add 16bits crc */ + crc = 0L; + crc = updcrc16(type, 0); + for (i=0;i<4;i++) + { + zsend_zdle_char(*hdr); + crc = updcrc16((0377 & *hdr++),crc); + } + crc = updcrc16(0,updcrc16(0,crc)); + zsend_zdle_char(((int)(crc>>8))); + zsend_zdle_char(crc); + } + else if(TxCRC == 1) + { zsend_byte(ZBIN32); - zsend_zdle_char(type); - /* add 32bits crc */ - crc = 0xffffffffL; - crc = updcrc32(type, crc); + zsend_zdle_char(type); + /* add 32bits crc */ + crc = 0xffffffffL; + crc = updcrc32(type, crc); for (i=0;i<4;i++) - { - zsend_zdle_char(*hdr); - crc = updcrc32((0377 & *hdr++), crc); - } - crc = ~crc; - for (i=0; i<4;i++) - { - zsend_zdle_char(crc); - crc >>= 8; - } - } - else if (TxCRC == 2) - { - zsend_byte(ZBINR32); - zsend_zdle_char(type); - /* add 32bits crc */ - crc = 0xffffffffL; - crc = updcrc32(type, crc); + { + zsend_zdle_char(*hdr); + crc = updcrc32((0377 & *hdr++), crc); + } + crc = ~crc; + for (i=0; i<4;i++) + { + zsend_zdle_char(crc); + crc >>= 8; + } + } + else if (TxCRC == 2) + { + zsend_byte(ZBINR32); + zsend_zdle_char(type); + /* add 32bits crc */ + crc = 0xffffffffL; + crc = updcrc32(type, crc); for (i=0;i<4;i++) - { - zsend_zdle_char(*hdr); - crc = updcrc32((0377 & *hdr++), crc); - } - crc = ~crc; - for (i=0; i<4;i++) - { - zsend_zdle_char(crc); - crc >>= 8; - } - } - - return; + { + zsend_zdle_char(*hdr); + crc = updcrc32((0377 & *hdr++), crc); + } + crc = ~crc; + for (i=0; i<4;i++) + { + zsend_zdle_char(crc); + crc >>= 8; + } + } + + return; } /* send hex header */ void zsend_hex_header(rt_uint8_t type, rt_uint8_t *hdr) { - rt_uint8_t i; - rt_uint16_t crc; - - zsend_line(ZPAD); zsend_line(ZPAD); zsend_line(ZDLE); - zsend_line(ZHEX); - zsend_ascii(type); - crc = updcrc16(type, 0); - for (i=0; i<4; i++) - { - zsend_ascii(*hdr); - crc = updcrc16((0377 & *hdr++), crc); - } - crc = updcrc16(0,updcrc16(0,crc)); - zsend_ascii(crc>>8); - zsend_ascii(crc); - /* send display control cmd */ - zsend_line(015); zsend_line(0212); - if (type != ZFIN && type != ZACK) - zsend_line(021); - TxCRC = 0; /* clear tx crc type */ - - return; + rt_uint8_t i; + rt_uint16_t crc; + + zsend_line(ZPAD); zsend_line(ZPAD); zsend_line(ZDLE); + zsend_line(ZHEX); + zsend_ascii(type); + crc = updcrc16(type, 0); + for (i=0; i<4; i++) + { + zsend_ascii(*hdr); + crc = updcrc16((0377 & *hdr++), crc); + } + crc = updcrc16(0,updcrc16(0,crc)); + zsend_ascii(crc>>8); + zsend_ascii(crc); + /* send display control cmd */ + zsend_line(015); zsend_line(0212); + if (type != ZFIN && type != ZACK) + zsend_line(021); + TxCRC = 0; /* clear tx crc type */ + + return; } /* send binary data,with frameend */ void zsend_bin_data(rt_uint8_t *buf, rt_int16_t len, rt_uint8_t frameend) { rt_int16_t i,c,tmp; - rt_uint32_t crc; + rt_uint32_t crc; if (TxCRC == 0) /* send binary data with 16bits crc check */ - { - crc = 0x0L; - for (i=0;i>8); - zsend_zdle_char(crc); - } - else if (TxCRC == 1) /* send binary data with 32 bits crc check */ - { - crc = 0xffffffffL; - for (i=0;i>= 8; - } - } - else if (TxCRC == 2) /* send binary data with 32bits crc check,RLE encode */ - { - crc = 0xffffffffL; + { + crc = 0x0L; + for (i=0;i>8); + zsend_zdle_char(crc); + } + else if (TxCRC == 1) /* send binary data with 32 bits crc check */ + { + crc = 0xffffffffL; + for (i=0;i>= 8; + } + } + else if (TxCRC == 2) /* send binary data with 32bits crc check,RLE encode */ + { + crc = 0xffffffffL; tmp = *buf++ & 0377; - for (i = 0; --len >= 0; ++buf) - { - if ((c = *buf & 0377) == tmp && i < 126 && len>0) - { - ++i; continue; - } - if (i==0) - { - zsend_zdle_char(tmp); - crc = updcrc32(tmp, crc); - if (tmp == ZRESC) - { - zsend_zdle_char(0100); crc = updcrc32(0100, crc); - } - tmp = c; - } - else if (i == 1) - { - if (tmp != ZRESC) - { - zsend_zdle_char(tmp); zsend_zdle_char(tmp); - crc = updcrc32(tmp, crc); - crc = updcrc32(tmp, crc); - i = 0; tmp = c; - } - - } - else - { - zsend_zdle_char(ZRESC); crc = updcrc32(ZRESC, crc); - if (tmp == 040 && i < 34) - { - i += 036; - zsend_zdle_char(i); - crc = updcrc32(i, crc); - } - else - { - i += 0101; - zsend_zdle_char(i); crc = updcrc32(i, crc); - zsend_zdle_char(tmp); crc = updcrc32(tmp, crc); - } - i = 0; tmp = c; - } - } - zsend_byte(ZDLE); zsend_byte(frameend); - crc = updcrc32(frameend, crc); - crc = ~crc; - for (i=0;i<4;i++) - { - zsend_zdle_char(crc); - crc >>= 8; - } - } - if (frameend == ZCRCW) - zsend_byte(XON); - - return; + for (i = 0; --len >= 0; ++buf) + { + if ((c = *buf & 0377) == tmp && i < 126 && len>0) + { + ++i; continue; + } + if (i==0) + { + zsend_zdle_char(tmp); + crc = updcrc32(tmp, crc); + if (tmp == ZRESC) + { + zsend_zdle_char(0100); crc = updcrc32(0100, crc); + } + tmp = c; + } + else if (i == 1) + { + if (tmp != ZRESC) + { + zsend_zdle_char(tmp); zsend_zdle_char(tmp); + crc = updcrc32(tmp, crc); + crc = updcrc32(tmp, crc); + i = 0; tmp = c; + } + + } + else + { + zsend_zdle_char(ZRESC); crc = updcrc32(ZRESC, crc); + if (tmp == 040 && i < 34) + { + i += 036; + zsend_zdle_char(i); + crc = updcrc32(i, crc); + } + else + { + i += 0101; + zsend_zdle_char(i); crc = updcrc32(i, crc); + zsend_zdle_char(tmp); crc = updcrc32(tmp, crc); + } + i = 0; tmp = c; + } + } + zsend_byte(ZDLE); zsend_byte(frameend); + crc = updcrc32(frameend, crc); + crc = ~crc; + for (i=0;i<4;i++) + { + zsend_zdle_char(crc); + crc >>= 8; + } + } + if (frameend == ZCRCW) + zsend_byte(XON); + + return; } /* receive data,with 16bits CRC check */ static rt_int16_t zrec_data16(rt_uint8_t *buf, rt_uint16_t len) { - rt_int16_t c,crc_cnt; - rt_uint16_t crc; - rt_err_t res = -RT_ERROR; - rt_uint8_t *p,flag = 0; - - p = buf; - crc_cnt = 0; crc = 0L; - Rxcount = 0; - while(buf <= p+len) - { - if ((res = zread_byte()) & ~0377) - { - if (res == GOTCRCE || res == GOTCRCG || - res == GOTCRCQ || res == GOTCRCW) - { - c = res; - c = res; - crc = updcrc16(res&0377, crc); - flag = 1; - continue; - } - else if (res == GOTCAN) return ZCAN; - else if (res == TIMEOUT) return TIMEOUT; - else return res; - - } - else - { - if (flag) - { - crc = updcrc16(res, crc); - crc_cnt++; - if (crc_cnt < 2) continue; - if ((crc & 0xffff)) - { + rt_int16_t c,crc_cnt; + rt_uint16_t crc; + rt_err_t res = -RT_ERROR; + rt_uint8_t *p,flag = 0; + + p = buf; + crc_cnt = 0; crc = 0L; + Rxcount = 0; + while(buf <= p+len) + { + if ((res = zread_byte()) & ~0377) + { + if (res == GOTCRCE || res == GOTCRCG || + res == GOTCRCQ || res == GOTCRCW) + { + c = res; + c = res; + crc = updcrc16(res&0377, crc); + flag = 1; + continue; + } + else if (res == GOTCAN) return ZCAN; + else if (res == TIMEOUT) return TIMEOUT; + else return res; + + } + else + { + if (flag) + { + crc = updcrc16(res, crc); + crc_cnt++; + if (crc_cnt < 2) continue; + if ((crc & 0xffff)) + { #ifdef ZDEBUG - rt_kprintf("error code: CRC16 error \r\n"); + rt_kprintf("error code: CRC16 error \r\n"); #endif - return -RT_ERROR; - } + return -RT_ERROR; + } return c; - } - else - { - *buf++ = res; - Rxcount++; - crc = updcrc16(res, crc); - } - } - } - - return -RT_ERROR; + } + else + { + *buf++ = res; + Rxcount++; + crc = updcrc16(res, crc); + } + } + } + + return -RT_ERROR; } /* receive data,with 32bits CRC check */ static rt_int16_t zrec_data32(rt_uint8_t *buf, rt_int16_t len) { - rt_int16_t c,crc_cnt; - rt_uint32_t crc; - rt_err_t res = -RT_ERROR; - rt_uint8_t *p,flag = 0; - - crc_cnt = 0; crc = 0xffffffffL; - Rxcount = 0; - while (buf <= p+len) - { - if ((res = zread_byte()) & ~0377) - { - if (res == GOTCRCE || res == GOTCRCG || - res == GOTCRCQ || res == GOTCRCW) - { - c = res; - crc = updcrc32(res&0377, crc); - flag = 1; - continue; - } - else if (res == GOTCAN) return ZCAN; - else if (res == TIMEOUT) return TIMEOUT; - else return res; - - } - else - { - if (flag) - { - crc = updcrc32(res, crc); - crc_cnt++; - if (crc_cnt < 4) continue; - if ((crc & 0xDEBB20E3)) - { + rt_int16_t c,crc_cnt; + rt_uint32_t crc; + rt_err_t res = -RT_ERROR; + rt_uint8_t *p,flag = 0; + + crc_cnt = 0; crc = 0xffffffffL; + Rxcount = 0; + while (buf <= p+len) + { + if ((res = zread_byte()) & ~0377) + { + if (res == GOTCRCE || res == GOTCRCG || + res == GOTCRCQ || res == GOTCRCW) + { + c = res; + crc = updcrc32(res&0377, crc); + flag = 1; + continue; + } + else if (res == GOTCAN) return ZCAN; + else if (res == TIMEOUT) return TIMEOUT; + else return res; + + } + else + { + if (flag) + { + crc = updcrc32(res, crc); + crc_cnt++; + if (crc_cnt < 4) continue; + if ((crc & 0xDEBB20E3)) + { #ifdef ZDEBUG - rt_kprintf("error code: CRC32 error \r\n"); + rt_kprintf("error code: CRC32 error \r\n"); #endif - return -RT_ERROR; - } + return -RT_ERROR; + } return c; - } - else - { - *buf++ = res; - Rxcount++; - crc = updcrc32(res, crc); - } - } - } - - return -RT_ERROR; + } + else + { + *buf++ = res; + Rxcount++; + crc = updcrc32(res, crc); + } + } + } + + return -RT_ERROR; } /* receive data,with RLE encoded,32bits CRC check */ static rt_int16_t zrec_data32r(rt_uint8_t *buf, rt_int16_t len) { - rt_int16_t c,crc_cnt; - rt_uint32_t crc; - rt_err_t res = -RT_ERROR; - rt_uint8_t *p,flag = 0; - - crc_cnt = 0; crc = 0xffffffffL; - Rxcount = 0; - p = buf; - while (buf <= p+len) - { - if ((res = zread_byte()) & ~0377) - { - if (res == GOTCRCE || res == GOTCRCG || - res == GOTCRCQ || res == GOTCRCW) - { - c = res; - crc = updcrc32(res&0377, crc); - flag = 1; - continue; - } - else if (res == GOTCAN) return ZCAN; - else if (res == TIMEOUT) return TIMEOUT; - else return res; - - } - else - { - if (flag) - { - crc = updcrc32(res, crc); - crc_cnt++; - if (crc_cnt < 4) continue; - if ((crc & 0xDEBB20E3)) - { + rt_int16_t c,crc_cnt; + rt_uint32_t crc; + rt_err_t res = -RT_ERROR; + rt_uint8_t *p,flag = 0; + + crc_cnt = 0; crc = 0xffffffffL; + Rxcount = 0; + p = buf; + while (buf <= p+len) + { + if ((res = zread_byte()) & ~0377) + { + if (res == GOTCRCE || res == GOTCRCG || + res == GOTCRCQ || res == GOTCRCW) + { + c = res; + crc = updcrc32(res&0377, crc); + flag = 1; + continue; + } + else if (res == GOTCAN) return ZCAN; + else if (res == TIMEOUT) return TIMEOUT; + else return res; + + } + else + { + if (flag) + { + crc = updcrc32(res, crc); + crc_cnt++; + if (crc_cnt < 4) continue; + if ((crc & 0xDEBB20E3)) + { #ifdef ZDEBUG - rt_kprintf("error code: CRC32 error \r\n"); + rt_kprintf("error code: CRC32 error \r\n"); #endif - return -RT_ERROR; - } + return -RT_ERROR; + } return c; - } - else - { - crc = updcrc32(res, crc); - switch (c) - { - case 0: - if (res == ZRESC) - { - c = -1; continue; - } - *buf++ = res; - Rxcount++; - continue; - case -1: - if (res >= 040 && res < 0100) - { - c = res - 035; res = 040; - goto spaces; - } - if (res == 0100) - { - c = 0; - *buf++ = ZRESC; - Rxcount++; - continue; - } - c = res; continue; - default: - c -= 0100; - if (c < 1) - goto end; + } + else + { + crc = updcrc32(res, crc); + switch (c) + { + case 0: + if (res == ZRESC) + { + c = -1; continue; + } + *buf++ = res; + Rxcount++; + continue; + case -1: + if (res >= 040 && res < 0100) + { + c = res - 035; res = 040; + goto spaces; + } + if (res == 0100) + { + c = 0; + *buf++ = ZRESC; + Rxcount++; + continue; + } + c = res; continue; + default: + c -= 0100; + if (c < 1) + goto end; spaces: - if ((buf + c) > p+len) - goto end; - while ( --res >= 0) - { - *buf++ = res; - Rxcount++; - } - c = 0; continue; - } - } - } // if -else - - } + if ((buf + c) > p+len) + goto end; + while ( --res >= 0) + { + *buf++ = res; + Rxcount++; + } + c = 0; continue; + } + } + } // if -else + + } end: - return -RT_ERROR; + return -RT_ERROR; } rt_int16_t zget_data(rt_uint8_t *buf, rt_uint16_t len) { - rt_int16_t res = -RT_ERROR; - - if (RxCRC == 0) - { - res = zrec_data16(buf,len); - } - else if (RxCRC == 1) - { - res = zrec_data32(buf, len); - } - else if (RxCRC == 2) - { - res = zrec_data32r(buf, len); - } - - return res; + rt_int16_t res = -RT_ERROR; + + if (RxCRC == 0) + { + res = zrec_data16(buf,len); + } + else if (RxCRC == 1) + { + res = zrec_data32(buf, len); + } + else if (RxCRC == 2) + { + res = zrec_data32r(buf, len); + } + + return res; } /* get type and cmd of header, fix lenght */ rt_int16_t zget_header(rt_uint8_t *hdr) { - rt_int16_t c,prev_char; - rt_uint32_t bit; - rt_uint16_t get_can,step_out; + rt_int16_t c,prev_char; + rt_uint32_t bit; + rt_uint16_t get_can,step_out; - bit = get_device_baud(); /* get console baud rate */ - Rxframeind = header_type = 0; + bit = get_device_baud(); /* get console baud rate */ + Rxframeind = header_type = 0; step_out = 0; - prev_char = 0xff; - for (;;) - { - c = zread_line(100); - switch(c) - { - case 021: - case 0221: - if (prev_char == CAN) break; - if (prev_char == ZCRCW) goto start_again; - break; - case RCDO: - goto end; - case TIMEOUT: - if (prev_char == CAN) break; - if (prev_char == ZCRCW) - { - c = -RT_ERROR; goto end; - } - goto end; - case ZCRCW: - if (prev_char == CAN) goto start_again; - break; - case CAN: + prev_char = 0xff; + for (;;) + { + c = zread_line(100); + switch(c) + { + case 021: + case 0221: + if (prev_char == CAN) break; + if (prev_char == ZCRCW) goto start_again; + break; + case RCDO: + goto end; + case TIMEOUT: + if (prev_char == CAN) break; + if (prev_char == ZCRCW) + { + c = -RT_ERROR; goto end; + } + goto end; + case ZCRCW: + if (prev_char == CAN) goto start_again; + break; + case CAN: get_can: - if (++get_can > 5) - { - c = ZCAN; goto end; + if (++get_can > 5) + { + c = ZCAN; goto end; } - break; - case ZPAD: - if (prev_char == CAN) break; - if (prev_char == ZCRCW) goto start_again; - step_out = 1; - break; - default: - if (prev_char == CAN) break; - if (prev_char == ZCRCW) goto start_again; + break; + case ZPAD: + if (prev_char == CAN) break; + if (prev_char == ZCRCW) goto start_again; + step_out = 1; + break; + default: + if (prev_char == CAN) break; + if (prev_char == ZCRCW) goto start_again; start_again: - if (--bit == 0) - { - c = GCOUNT; goto end; - } - get_can = 0; - break; - } - prev_char = c; - if (step_out) break; /* exit loop */ - } - step_out = get_can = 0; - for (;;) - { - c = zxor_read(); - switch(c) - { - case ZPAD: - break; - case RCDO: - case TIMEOUT: - goto end; - case ZDLE: - step_out = 1; - break; - default: - goto start_again; - } - if (step_out) break; - } - - Rxframeind = c = zxor_read(); - switch (c) - { - case ZBIN32: - RxCRC = 1; c = zget_bin_fcs(hdr); break; - case ZBINR32: - RxCRC = 2; c = zget_bin_fcs(hdr); break; - case ZBIN: - RxCRC = 0; c = zget_bin_header(hdr); break; - case ZHEX: - RxCRC = 0; c = zget_hex_header(hdr); break; - case CAN: - goto get_can; - case RCDO: - case TIMEOUT: - goto end; - default: - goto start_again; - } + if (--bit == 0) + { + c = GCOUNT; goto end; + } + get_can = 0; + break; + } + prev_char = c; + if (step_out) break; /* exit loop */ + } + step_out = get_can = 0; + for (;;) + { + c = zxor_read(); + switch(c) + { + case ZPAD: + break; + case RCDO: + case TIMEOUT: + goto end; + case ZDLE: + step_out = 1; + break; + default: + goto start_again; + } + if (step_out) break; + } + + Rxframeind = c = zxor_read(); + switch (c) + { + case ZBIN32: + RxCRC = 1; c = zget_bin_fcs(hdr); break; + case ZBINR32: + RxCRC = 2; c = zget_bin_fcs(hdr); break; + case ZBIN: + RxCRC = 0; c = zget_bin_header(hdr); break; + case ZHEX: + RxCRC = 0; c = zget_hex_header(hdr); break; + case CAN: + goto get_can; + case RCDO: + case TIMEOUT: + goto end; + default: + goto start_again; + } end: - return c; + return c; } /* receive a binary header */ static rt_int16_t zget_bin_header(rt_uint8_t *hdr) { - rt_int16_t res, i; - rt_uint16_t crc; - - if ((res = zread_byte()) & ~0377) - return res; - header_type = res; - crc = updcrc16(res, 0); - - for (i=0;i<4;i++) - { - if ((res = zread_byte()) & ~0377) - return res; - crc = updcrc16(res, crc); - *hdr++ = res; - } - if ((res = zread_byte()) & ~0377) - return res; - crc = updcrc16(res, crc); - if ((res = zread_byte()) & ~0377) - return res; - crc = updcrc16(res, crc); - if (crc & 0xFFFF) - { - rt_kprintf("CRC error\n"); - return -RT_ERROR; - } - - return header_type; + rt_int16_t res, i; + rt_uint16_t crc; + + if ((res = zread_byte()) & ~0377) + return res; + header_type = res; + crc = updcrc16(res, 0); + + for (i=0;i<4;i++) + { + if ((res = zread_byte()) & ~0377) + return res; + crc = updcrc16(res, crc); + *hdr++ = res; + } + if ((res = zread_byte()) & ~0377) + return res; + crc = updcrc16(res, crc); + if ((res = zread_byte()) & ~0377) + return res; + crc = updcrc16(res, crc); + if (crc & 0xFFFF) + { + rt_kprintf("CRC error\n"); + return -RT_ERROR; + } + + return header_type; } /* receive a binary header,with 32bits FCS */ static rt_int16_t zget_bin_fcs(rt_uint8_t *hdr) { - rt_int16_t res, i; - rt_uint32_t crc; - - if ((res = zread_byte()) & ~0377) - return res; - header_type = res; - crc = 0xFFFFFFFFL; - crc = updcrc32(res, crc); - - for (i=0;i<4;i++) /* 4headers */ - { - if ((res = zread_byte()) & ~0377) - return res; - crc = updcrc32(res, crc); - *hdr++ = res; - - } - for (i=0;i<4;i++) /* 4bytes crc */ - { - if ((res = zread_byte()) & ~0377) - return res; - crc = updcrc32(res, crc); - - } - if (crc != 0xDEBB20E3) - { + rt_int16_t res, i; + rt_uint32_t crc; + + if ((res = zread_byte()) & ~0377) + return res; + header_type = res; + crc = 0xFFFFFFFFL; + crc = updcrc32(res, crc); + + for (i=0;i<4;i++) /* 4headers */ + { + if ((res = zread_byte()) & ~0377) + return res; + crc = updcrc32(res, crc); + *hdr++ = res; + + } + for (i=0;i<4;i++) /* 4bytes crc */ + { + if ((res = zread_byte()) & ~0377) + return res; + crc = updcrc32(res, crc); + + } + if (crc != 0xDEBB20E3) + { #ifdef ZDEBUG - rt_kprintf("CRC error\n"); + rt_kprintf("CRC error\n"); #endif - return -RT_ERROR; - } + return -RT_ERROR; + } - return header_type; + return header_type; } /* receive a hex style header (type and position) */ rt_int16_t zget_hex_header(rt_uint8_t *hdr) { - rt_int16_t res,i; - rt_uint16_t crc; - - if ((res = zget_hex()) < 0) - return res; - header_type = res; - crc = updcrc16(res, 0); - - for (i=0;i<4;i++) - { - if ((res = zget_hex()) < 0) - return res; - crc = updcrc16(res, crc); - *hdr++ = res; - } - if ((res = zget_hex()) < 0) - return res; - crc = updcrc16(res, crc); - if ((res = zget_hex()) < 0) - return res; - crc = updcrc16(res, crc); - if (crc & 0xFFFF) - { + rt_int16_t res,i; + rt_uint16_t crc; + + if ((res = zget_hex()) < 0) + return res; + header_type = res; + crc = updcrc16(res, 0); + + for (i=0;i<4;i++) + { + if ((res = zget_hex()) < 0) + return res; + crc = updcrc16(res, crc); + *hdr++ = res; + } + if ((res = zget_hex()) < 0) + return res; + crc = updcrc16(res, crc); + if ((res = zget_hex()) < 0) + return res; + crc = updcrc16(res, crc); + if (crc & 0xFFFF) + { #ifdef ZDEBUG - rt_kprintf("error code : CRC error\r\n"); + rt_kprintf("error code : CRC error\r\n"); #endif - return -RT_ERROR; - } - res = zread_line(100); - if (res < 0) - return res; - res = zread_line(100); - if (res < 0) - return res; - - return header_type; + return -RT_ERROR; + } + res = zread_line(100); + if (res < 0) + return res; + res = zread_line(100); + if (res < 0) + return res; + + return header_type; } /* convert to ascii */ static void zsend_ascii(rt_uint8_t c) { - const char hex[] = "0123456789abcdef"; + const char hex[] = "0123456789abcdef"; - zsend_line(hex[(c&0xF0)>>4]); - zsend_line(hex[(c)&0xF]); + zsend_line(hex[(c&0xF0)>>4]); + zsend_line(hex[(c)&0xF]); - return; + return; } /* @@ -723,54 +723,54 @@ static void zsend_ascii(rt_uint8_t c) */ void zsend_zdle_char(rt_uint16_t ch) { - rt_uint16_t res; - - res = ch & 0377; - switch (res) - { - case 0377: - zsend_byte(res); - break; - case ZDLE: - zsend_byte(ZDLE); - res ^= 0100; - zsend_byte(res); - break; - case 021: - case 023: - case 0221: - case 0223: - zsend_byte(ZDLE); - res ^= 0100; - zsend_byte(res); - break; - default: - zsend_byte(res); - } + rt_uint16_t res; + + res = ch & 0377; + switch (res) + { + case 0377: + zsend_byte(res); + break; + case ZDLE: + zsend_byte(ZDLE); + res ^= 0100; + zsend_byte(res); + break; + case 021: + case 023: + case 0221: + case 0223: + zsend_byte(ZDLE); + res ^= 0100; + zsend_byte(res); + break; + default: + zsend_byte(res); + } } /* decode two lower case hex digits into an 8 bit byte value */ static rt_int16_t zget_hex(void) { - rt_int16_t res,n; - - if ((res = zxor_read()) < 0) - return res; - n = res - '0'; - if (n > 9) - n -= ('a' - ':'); - if (n & ~0x0f) - return -RT_ERROR; - if ((res = zxor_read()) < 0) - return res; - res -= '0'; - if (res > 9) - res -= ('a' - ':'); - if (res & ~0x0f) - return -RT_ERROR; - res += (n<<4); - - return res; + rt_int16_t res,n; + + if ((res = zxor_read()) < 0) + return res; + n = res - '0'; + if (n > 9) + n -= ('a' - ':'); + if (n & ~0x0f) + return -RT_ERROR; + if ((res = zxor_read()) < 0) + return res; + res -= '0'; + if (res > 9) + res -= ('a' - ':'); + if (res & ~0x0f) + return -RT_ERROR; + res += (n<<4); + + return res; } @@ -780,58 +780,58 @@ static rt_int16_t zget_hex(void) */ rt_int16_t zread_byte(void) { - register int res; + register int res; again: - /* Quick check for non control characters */ - if ((res = zread_line(100)) & 0140) - return res; - switch (res) - { - case ZDLE: - break; - case 023: - case 0223: - case 021: - case 0221: - goto again; - default: - return res; - } + /* Quick check for non control characters */ + if ((res = zread_line(100)) & 0140) + return res; + switch (res) + { + case ZDLE: + break; + case 023: + case 0223: + case 021: + case 0221: + goto again; + default: + return res; + } again2: - if ((res = zread_line(100)) < 0) - return res; - if (res == CAN && (res = zread_line(100)) < 0) - return res; - if (res == CAN && (res = zread_line(100)) < 0) - return res; - if (res == CAN && (res = zread_line(100)) < 0) - return res; - switch (res) - { - case CAN: - return GOTCAN; - case ZCRCE: - case ZCRCG: - case ZCRCQ: - case ZCRCW: - return (res | GOTOR); - case ZRUB0: - return 0177; - case ZRUB1: - return 0377; - case 023: - case 0223: - case 021: - case 0221: - goto again2; - default: - if ((res & 0140) == 0100) - return (res ^ 0100); - break; - } - - return -RT_ERROR; + if ((res = zread_line(100)) < 0) + return res; + if (res == CAN && (res = zread_line(100)) < 0) + return res; + if (res == CAN && (res = zread_line(100)) < 0) + return res; + if (res == CAN && (res = zread_line(100)) < 0) + return res; + switch (res) + { + case CAN: + return GOTCAN; + case ZCRCE: + case ZCRCG: + case ZCRCQ: + case ZCRCW: + return (res | GOTOR); + case ZRUB0: + return 0177; + case ZRUB1: + return 0377; + case 023: + case 0223: + case 021: + case 0221: + goto again2; + default: + if ((res & 0140) == 0100) + return (res ^ 0100); + break; + } + + return -RT_ERROR; } /* @@ -840,46 +840,46 @@ again2: */ rt_int16_t zxor_read(void) { - rt_int16_t res; - - for (;;) - { - if ((res = zread_line(100)) < 0) - return res; - switch (res &= 0177) { - case XON: - case XOFF: - continue; - case '\r': - case '\n': - case ZDLE: - default: - return res; - } - } + rt_int16_t res; + + for (;;) + { + if ((res = zread_line(100)) < 0) + return res; + switch (res &= 0177) { + case XON: + case XOFF: + continue; + case '\r': + case '\n': + case ZDLE: + default: + return res; + } + } } /* put file posistion into the header*/ void zput_pos(rt_uint32_t pos) { - tx_header[ZP0] = pos; - tx_header[ZP1] = pos>>8; - tx_header[ZP2] = pos>>16; - tx_header[ZP3] = pos>>24; + tx_header[ZP0] = pos; + tx_header[ZP1] = pos>>8; + tx_header[ZP2] = pos>>16; + tx_header[ZP3] = pos>>24; - return; + return; } /* Recover a long integer from a header */ void zget_pos(rt_uint32_t pos) { - Rxpos = (rx_header[ZP3] & 0377); - Rxpos = (Rxpos << 8) | (rx_header[ZP2] & 0377); - Rxpos = (Rxpos << 8) | (rx_header[ZP1] & 0377); - Rxpos = (Rxpos << 8) | (rx_header[ZP0] & 0377); + Rxpos = (rx_header[ZP3] & 0377); + Rxpos = (Rxpos << 8) | (rx_header[ZP2] & 0377); + Rxpos = (Rxpos << 8) | (rx_header[ZP1] & 0377); + Rxpos = (Rxpos << 8) | (rx_header[ZP0] & 0377); - return; + return; } /* end of zcore.c */ diff --git a/components/utilities/zmodem/zdef.h b/components/utilities/zmodem/zdef.h index 3568bdfd96..cfb9784f30 100644 --- a/components/utilities/zmodem/zdef.h +++ b/components/utilities/zmodem/zdef.h @@ -3,133 +3,133 @@ #include #include "crc.h" -#define ZPAD '*' /* 052 padding character begins frames */ -#define ZDLE 030 /* ctrl-X ZMODEM escape - `ala BISYNC DLE */ -#define ZDLEE (ZDLE^0100) /* escaped ZDLE as transmitted */ -#define ZBIN 'A' /* binary frame indicator (CRC-16) */ -#define ZHEX 'B' /* hex frame indicator */ -#define ZBIN32 'C' /* binary frame with 32 bit FCS */ -#define ZBINR32 'D' /* RLE packed Binary frame with 32 bit FCS */ -#define ZVBIN 'a' /* binary frame indicator (CRC-16) */ -#define ZVHEX 'b' /* hex frame indicator */ -#define ZVBIN32 'c' /* binary frame with 32 bit FCS */ -#define ZVBINR32 'd' /* RLE packed Binary frame with 32 bit FCS */ -#define ZRESC 0176 /* RLE flag/escape character */ +#define ZPAD '*' /* 052 padding character begins frames */ +#define ZDLE 030 /* ctrl-X ZMODEM escape - `ala BISYNC DLE */ +#define ZDLEE (ZDLE^0100) /* escaped ZDLE as transmitted */ +#define ZBIN 'A' /* binary frame indicator (CRC-16) */ +#define ZHEX 'B' /* hex frame indicator */ +#define ZBIN32 'C' /* binary frame with 32 bit FCS */ +#define ZBINR32 'D' /* RLE packed Binary frame with 32 bit FCS */ +#define ZVBIN 'a' /* binary frame indicator (CRC-16) */ +#define ZVHEX 'b' /* hex frame indicator */ +#define ZVBIN32 'c' /* binary frame with 32 bit FCS */ +#define ZVBINR32 'd' /* RLE packed Binary frame with 32 bit FCS */ +#define ZRESC 0176 /* RLE flag/escape character */ /* Frame types */ -#define ZRQINIT 0 /* request receive init */ +#define ZRQINIT 0 /* request receive init */ #define ZRINIT 1 /* receive init */ -#define ZSINIT 2 /* send init sequence (optional) */ -#define ZACK 3 /* ACK to above */ -#define ZFILE 4 /* file name from sender */ -#define ZSKIP 5 /* ro sender: skip this file */ -#define ZNAK 6 /* last packet was garbled */ -#define ZABORT 7 /* abort batch transfers */ -#define ZFIN 8 /* finish session */ -#define ZRPOS 9 /* resume data trans at this position */ +#define ZSINIT 2 /* send init sequence (optional) */ +#define ZACK 3 /* ACK to above */ +#define ZFILE 4 /* file name from sender */ +#define ZSKIP 5 /* ro sender: skip this file */ +#define ZNAK 6 /* last packet was garbled */ +#define ZABORT 7 /* abort batch transfers */ +#define ZFIN 8 /* finish session */ +#define ZRPOS 9 /* resume data trans at this position */ #define ZDATA 10 /* data packet(s) follow */ #define ZEOF 11 /* end of file */ #define ZFERR 12 /* fatal Read or Write error Detected */ #define ZCRC 13 /* request for file CRC and response */ #define ZCHALLENGE 14 /* receiver's Challenge */ -#define ZCOMPL 15 /* request is complete */ -#define ZCAN 16 /* other end canned session with CAN*5 */ -#define ZFREECNT 17 /* request for free bytes on filesystem */ -#define ZCOMMAND 18 /* command from sending program */ +#define ZCOMPL 15 /* request is complete */ +#define ZCAN 16 /* other end canned session with CAN*5 */ +#define ZFREECNT 17 /* request for free bytes on filesystem */ +#define ZCOMMAND 18 /* command from sending program */ /* ZDLE sequfences */ -#define ZCRCE 'h' /* CRC next, frame ends, header packet follows */ -#define ZCRCG 'i' /* CRC next, frame continues nonstop */ -#define ZCRCQ 'j' /* CRC next, frame continues, ZACK expected */ -#define ZCRCW 'k' /* CRC next, ZACK expected, end of frame */ -#define ZRUB0 'l' /* translate to rubout 0177 */ -#define ZRUB1 'm' /* translate to rubout 0377 */ +#define ZCRCE 'h' /* CRC next, frame ends, header packet follows */ +#define ZCRCG 'i' /* CRC next, frame continues nonstop */ +#define ZCRCQ 'j' /* CRC next, frame continues, ZACK expected */ +#define ZCRCW 'k' /* CRC next, ZACK expected, end of frame */ +#define ZRUB0 'l' /* translate to rubout 0177 */ +#define ZRUB1 'm' /* translate to rubout 0377 */ /* zdlread return values (internal) */ /* -1 is general error, -2 is timeout */ #define GOTOR 0400 -#define GOTCRCE (ZCRCE|GOTOR) /* ZDLE-ZCRCE received */ -#define GOTCRCG (ZCRCG|GOTOR) /* ZDLE-ZCRCG received */ -#define GOTCRCQ (ZCRCQ|GOTOR) /* ZDLE-ZCRCQ received */ -#define GOTCRCW (ZCRCW|GOTOR) /* ZDLE-ZCRCW received */ -#define GOTCAN (GOTOR|030) /* CAN*5 seen */ +#define GOTCRCE (ZCRCE|GOTOR) /* ZDLE-ZCRCE received */ +#define GOTCRCG (ZCRCG|GOTOR) /* ZDLE-ZCRCG received */ +#define GOTCRCQ (ZCRCQ|GOTOR) /* ZDLE-ZCRCQ received */ +#define GOTCRCW (ZCRCW|GOTOR) /* ZDLE-ZCRCW received */ +#define GOTCAN (GOTOR|030) /* CAN*5 seen */ /* Byte positions within header array */ -#define ZF0 3 /* first flags byte */ -#define ZF1 2 -#define ZF2 1 -#define ZF3 0 -#define ZP0 0 /* low order 8 bits of position */ -#define ZP1 1 -#define ZP2 2 -#define ZP3 3 /* high order 8 bits of file position */ +#define ZF0 3 /* first flags byte */ +#define ZF1 2 +#define ZF2 1 +#define ZF3 0 +#define ZP0 0 /* low order 8 bits of position */ +#define ZP1 1 +#define ZP2 2 +#define ZP3 3 /* high order 8 bits of file position */ /* parameters for ZRINIT header */ -#define ZRPXWN 8 /* 9th byte in header contains window size/256 */ -#define ZRPXQQ 9 /* 10th to 14th bytes contain quote mask */ +#define ZRPXWN 8 /* 9th byte in header contains window size/256 */ +#define ZRPXQQ 9 /* 10th to 14th bytes contain quote mask */ /* bit Masks for ZRINIT flags byte ZF0 */ -#define CANFDX 0x01 /* rx can send and receive true FDX */ -#define CANOVIO 0x02 /* rx can receive data during disk I/O */ -#define CANBRK 0x04 /* rx can send a break signal */ -#define CANRLE 0x10 /* receiver can decode RLE */ -#define CANLZW 0x20 /* receiver can uncompress */ -#define CANFC32 0x28 /* receiver can use 32 bit Frame Check */ -#define ESCCTL 0x64 /* receiver expects ctl chars to be escaped */ -#define ESC8 0xc8 /* receiver expects 8th bit to be escaped */ +#define CANFDX 0x01 /* rx can send and receive true FDX */ +#define CANOVIO 0x02 /* rx can receive data during disk I/O */ +#define CANBRK 0x04 /* rx can send a break signal */ +#define CANRLE 0x10 /* receiver can decode RLE */ +#define CANLZW 0x20 /* receiver can uncompress */ +#define CANFC32 0x28 /* receiver can use 32 bit Frame Check */ +#define ESCCTL 0x64 /* receiver expects ctl chars to be escaped */ +#define ESC8 0xc8 /* receiver expects 8th bit to be escaped */ /* bit Masks for ZRINIT flags byte ZF1 */ -#define CANVHDR 01 /* variable headers OK */ -#define ZRRQWN 8 /* receiver specified window size in ZRPXWN */ -#define ZRRQQQ 16 /* additional control chars to quote in ZRPXQQ */ -#define ZRQNVH (ZRRQWN|ZRRQQQ) /* variable len hdr reqd to access info */ +#define CANVHDR 01 /* variable headers OK */ +#define ZRRQWN 8 /* receiver specified window size in ZRPXWN */ +#define ZRRQQQ 16 /* additional control chars to quote in ZRPXQQ */ +#define ZRQNVH (ZRRQWN|ZRRQQQ) /* variable len hdr reqd to access info */ /* Parameters for ZSINIT frame */ -#define ZATTNLEN 32 /* max length of attention string */ -#define ALTCOFF ZF1 /* offset to alternate canit string, 0 if not used */ +#define ZATTNLEN 32 /* max length of attention string */ +#define ALTCOFF ZF1 /* offset to alternate canit string, 0 if not used */ /* Parameters for ZFILE frame */ /* Conversion options one of these in ZF0 */ -#define ZCBIN 1 /* binary transfer - inhibit conversion */ -#define ZCNL 2 /* convert NL to local end of line convention */ -#define ZCRESUM 3 /* resume interrupted file transfer */ +#define ZCBIN 1 /* binary transfer - inhibit conversion */ +#define ZCNL 2 /* convert NL to local end of line convention */ +#define ZCRESUM 3 /* resume interrupted file transfer */ /* management include options, one of these ored in ZF1 */ #define ZMSKNOLOC 0200 /* skip file if not present at rx */ /* management options, one of these ored in ZF1 */ -#define ZMMASK 037 /* mask for the choices below */ -#define ZMNEWL 1 /* transfer if source newer or longer */ -#define ZMCRC 2 /* transfer if different file CRC or length */ -#define ZMAPND 3 /* append contents to existing file (if any) */ -#define ZMCLOB 4 /* replace existing file */ -#define ZMNEW 5 /* transfer if source newer */ +#define ZMMASK 037 /* mask for the choices below */ +#define ZMNEWL 1 /* transfer if source newer or longer */ +#define ZMCRC 2 /* transfer if different file CRC or length */ +#define ZMAPND 3 /* append contents to existing file (if any) */ +#define ZMCLOB 4 /* replace existing file */ +#define ZMNEW 5 /* transfer if source newer */ /* number 5 is alive ... */ -#define ZMDIFF 6 /* transfer if dates or lengths different */ -#define ZMPROT 7 /* protect destination file */ -#define ZMCHNG 8 /* change filename if destination exists */ +#define ZMDIFF 6 /* transfer if dates or lengths different */ +#define ZMPROT 7 /* protect destination file */ +#define ZMCHNG 8 /* change filename if destination exists */ /* transport options, one of these in ZF2 */ -#define ZTLZW 1 /* lempel-Ziv compression */ -#define ZTRLE 3 /* run Length encoding */ +#define ZTLZW 1 /* lempel-Ziv compression */ +#define ZTRLE 3 /* run Length encoding */ /* extended options for ZF3, bit encoded */ -#define ZXSPARS 64 /* encoding for sparse file operations */ +#define ZXSPARS 64 /* encoding for sparse file operations */ #define ZCANVHDR 01 /* variable headers OK */ /* receiver window size override */ -#define ZRWOVR 4 /* byte position for receive window override/256 */ +#define ZRWOVR 4 /* byte position for receive window override/256 */ /* parameters for ZCOMMAND frame ZF0 (otherwise 0) */ -#define ZCACK1 1 /* acknowledge, then do command */ -extern char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */ +#define ZCACK1 1 /* acknowledge, then do command */ +extern char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */ /* globals used by ZMODEM functions */ extern rt_uint8_t Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */ -extern char header_type; /* type of header received */ +extern char header_type; /* type of header received */ extern rt_uint8_t rx_header[4]; /* received header */ extern rt_uint8_t tx_header[4]; /* transmitted header */ -extern rt_uint8_t Txfcs32; /* TRUE means send binary frames with 32 bit FCS */ -extern rt_uint16_t Rxcount; /* count of data bytes received */ +extern rt_uint8_t Txfcs32; /* TRUE means send binary frames with 32 bit FCS */ +extern rt_uint16_t Rxcount; /* count of data bytes received */ extern rt_uint16_t Rxtimeout; /* tenths of seconds to wait for something */ -extern rt_uint32_t Rxpos; /* received file position */ -extern rt_uint32_t Txpos; /* transmitted file position */ -extern rt_uint8_t Txfcs32; /* TURE means send binary frames with 32 bit FCS */ +extern rt_uint32_t Rxpos; /* received file position */ +extern rt_uint32_t Txpos; /* transmitted file position */ +extern rt_uint8_t Txfcs32; /* TURE means send binary frames with 32 bit FCS */ /* ward Christensen / CP/M parameters - Don't change these! */ #define ENQ 005 @@ -141,34 +141,34 @@ extern rt_uint8_t Txfcs32; /* TURE means send binary frames with 32 bit #define ETX 3 #define SYN 026 #define ESC 033 -#define WANTG 0107 /* send G not NAK to get nonstop batch xmsn */ +#define WANTG 0107 /* send G not NAK to get nonstop batch xmsn */ #define EOT 4 #define ACK 6 #define NAK 025 #define CPMEOF 032 -#define WANTCRC 0103 /* send C not NAK to get crc not checksum */ +#define WANTCRC 0103 /* send C not NAK to get crc not checksum */ #define TIMEOUT (-2) #define RCDO (-3) #define GCOUNT (-4) #define ERRORMAX 5 #define RETRYMAX 5 #define WCEOT (-10) - - + + #define BITRATE 115200 #define TX_BUFFER_SIZE 1024 -#define RX_BUFFER_SIZE 1024 /* sender or receiver's max buffer size */ -extern char ZF0_CMD; /* local ZMODEM file conversion request */ -extern char ZF1_CMD; /* local ZMODEM file management request */ -extern char ZF2_CMD; /* local ZMODEM file management request */ -extern char ZF3_CMD; /* local ZMODEM file management request */ +#define RX_BUFFER_SIZE 1024 /* sender or receiver's max buffer size */ +extern char ZF0_CMD; /* local ZMODEM file conversion request */ +extern char ZF1_CMD; /* local ZMODEM file management request */ +extern char ZF2_CMD; /* local ZMODEM file management request */ +extern char ZF3_CMD; /* local ZMODEM file management request */ extern rt_uint32_t Baudrate ; extern rt_uint32_t Left_bytes; extern rt_uint32_t Left_sizes; - + struct zmodemf { @@ -179,18 +179,18 @@ extern struct zmodemf zmodem; struct zfile { - char *fname; - rt_int32_t fd; - rt_uint32_t ctime; + char *fname; + rt_int32_t fd; + rt_uint32_t ctime; rt_uint32_t mode; - rt_uint32_t bytes_total; - rt_uint32_t bytes_sent; - rt_uint32_t bytes_received; - rt_uint32_t file_end; - + rt_uint32_t bytes_total; + rt_uint32_t bytes_sent; + rt_uint32_t bytes_received; + rt_uint32_t file_end; + }; extern struct finsh_shell* shell; - + #define ZDEBUG 0 /* sz.c */ extern void zs_start(char *path); @@ -213,5 +213,5 @@ extern void zsend_line(rt_uint16_t c); extern rt_int16_t zread_line(rt_uint16_t timeout); extern void zsend_break(char *cmd); extern void zsend_can(void); - + #endif /* __ZDEF_H__ */ diff --git a/components/utilities/zmodem/zdevice.c b/components/utilities/zmodem/zdevice.c index 1562cc5f5c..3a144e79de 100644 --- a/components/utilities/zmodem/zdevice.c +++ b/components/utilities/zmodem/zdevice.c @@ -3,7 +3,7 @@ * the implemention of zmodem protocol. * Change Logs: * Date Author Notes - * 2011-03-29 itspy + * 2011-03-29 itspy */ #include @@ -15,11 +15,11 @@ #include #include "zdef.h" - -rt_uint32_t Line_left = 0; /* left number of data in the read line buffer*/ -rt_uint32_t Left_sizes = 0; /* left file sizes */ -rt_uint32_t Baudrate = BITRATE; /* console baudrate */ - + +rt_uint32_t Line_left = 0; /* left number of data in the read line buffer*/ +rt_uint32_t Left_sizes = 0; /* left file sizes */ +rt_uint32_t Baudrate = BITRATE; /* console baudrate */ + rt_uint32_t get_device_baud(void) @@ -34,7 +34,7 @@ rt_uint32_t get_sys_time(void) void zsend_byte(rt_uint16_t ch) { - rt_device_write(zmodem.device, 0, &ch,1); + rt_device_write(zmodem.device, 0, &ch,1); return; } @@ -43,38 +43,38 @@ void zsend_line(rt_uint16_t c) { rt_uint16_t ch; - ch = (c & 0377); - rt_device_write(zmodem.device, 0, &ch, 1); + ch = (c & 0377); + rt_device_write(zmodem.device, 0, &ch, 1); return; } rt_int16_t zread_line(rt_uint16_t timeout) { - char *str; - static char buf[10]; - - if (Line_left > 0) - { - Line_left -= 1; - return (*str++ & 0377); - } - Line_left = 0; - timeout/=5; - while (1) - { - Line_left = rt_device_read(shell->device, 0, buf, 1); - if (Line_left) - { - Line_left = Line_left; - str = buf; - break; - } - } - if (Line_left < 1) return TIMEOUT; - Line_left -=1; - - return (*str++ & 0377); + char *str; + static char buf[10]; + + if (Line_left > 0) + { + Line_left -= 1; + return (*str++ & 0377); + } + Line_left = 0; + timeout/=5; + while (1) + { + Line_left = rt_device_read(shell->device, 0, buf, 1); + if (Line_left) + { + Line_left = Line_left; + str = buf; + break; + } + } + if (Line_left < 1) return TIMEOUT; + Line_left -=1; + + return (*str++ & 0377); } /* @@ -83,32 +83,32 @@ rt_int16_t zread_line(rt_uint16_t timeout) */ void zsend_break(char *cmd) { - - while (*cmd++) - { - switch (*cmd) - { - case '\336': - continue; - case '\335': - rt_thread_delay(RT_TICK_PER_SECOND); - continue; - default: - zsend_line(*cmd); - break; - } - } + + while (*cmd++) + { + switch (*cmd) + { + case '\336': + continue; + case '\335': + rt_thread_delay(RT_TICK_PER_SECOND); + continue; + default: + zsend_line(*cmd); + break; + } + } } /* send cancel string to get the other end to shut up */ void zsend_can(void) { - static char cmd[] = {24,24,24,24,24,24,24,24,24,24,0}; + static char cmd[] = {24,24,24,24,24,24,24,24,24,24,0}; - zsend_break(cmd); - rt_kprintf("\x0d"); - Line_left=0; /* clear Line_left */ + zsend_break(cmd); + rt_kprintf("\x0d"); + Line_left=0; /* clear Line_left */ - return; + return; } /* end of zdevice.c */ diff --git a/components/utilities/zmodem/zstart.c b/components/utilities/zmodem/zstart.c index e5a36ca7ab..5c44ee86a7 100644 --- a/components/utilities/zmodem/zstart.c +++ b/components/utilities/zmodem/zstart.c @@ -3,7 +3,7 @@ * the implemention of zmodem protocol. * Change Logs: * Date Author Notes - * 2011-03-29 itspy + * 2011-03-29 itspy */ #include @@ -27,43 +27,43 @@ rt_err_t zmodem_rx_ind(rt_device_t dev, rt_size_t size) void finsh_rz(void *parameter) { - char *path; + char *path; rt_err_t (*rx_indicate)(rt_device_t dev, rt_size_t size); - rt_uint8_t flag; + rt_uint8_t flag; - flag = RT_DEVICE_FLAG_STREAM; + flag = RT_DEVICE_FLAG_STREAM; zmodem.device->flag &=(~flag); rt_sem_init(&(zmodem.zsem), "zsem", 0, 0); - path = rt_thread_self()->parameter; - /* save old rx_indicate */ + path = rt_thread_self()->parameter; + /* save old rx_indicate */ rx_indicate = zmodem.device->rx_indicate; /* set new rx_indicate */ rt_device_set_rx_indicate(zmodem.device, RT_NULL); - /* start receive remote files */ + /* start receive remote files */ zr_start(path); - zmodem.device->flag |=flag; - /* recovery old rx_indicate */ + zmodem.device->flag |=flag; + /* recovery old rx_indicate */ rt_device_set_rx_indicate(zmodem.device, rx_indicate); /* finsh>> */ rt_kprintf(FINSH_PROMPT); } void finsh_sz(void *parameter) { - char *path; + char *path; rt_err_t (*rx_indicate)(rt_device_t dev, rt_size_t size); - rt_uint8_t flag; + rt_uint8_t flag; - flag = RT_DEVICE_FLAG_STREAM; + flag = RT_DEVICE_FLAG_STREAM; zmodem.device->flag &=(~flag); rt_sem_init(&(zmodem.zsem), "zsem", 0, 0); - path = rt_thread_self()->parameter; - /* save old rx_indicate */ + path = rt_thread_self()->parameter; + /* save old rx_indicate */ rx_indicate = zmodem.device->rx_indicate; - /* set new rx_indicate */ + /* set new rx_indicate */ rt_device_set_rx_indicate(zmodem.device, zmodem_rx_ind); - zs_start(path); - zmodem.device->flag |=flag; - /* recovery old rx_indicate */ + zs_start(path); + zmodem.device->flag |=flag; + /* recovery old rx_indicate */ rt_device_set_rx_indicate(zmodem.device, rx_indicate); /* finsh>> */ rt_kprintf(FINSH_PROMPT); diff --git a/components/vbus/prio_queue.c b/components/vbus/prio_queue.c index bca3cdcd9a..8c3c648e73 100644 --- a/components/vbus/prio_queue.c +++ b/components/vbus/prio_queue.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vbus/prio_queue.h b/components/vbus/prio_queue.h index 7358ffdb23..0af36d0ea9 100644 --- a/components/vbus/prio_queue.h +++ b/components/vbus/prio_queue.h @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vbus/share_hdr/vbus_api.h b/components/vbus/share_hdr/vbus_api.h index db6cb7b72c..a643822a9c 100644 --- a/components/vbus/share_hdr/vbus_api.h +++ b/components/vbus/share_hdr/vbus_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/vbus/vbus.c b/components/vbus/vbus.c index 8add15d9db..2adaad9449 100644 --- a/components/vbus/vbus.c +++ b/components/vbus/vbus.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -899,8 +899,8 @@ int rt_vbus_request_chn(struct rt_vbus_request *req, int timeout) { int i, chnr, err; - size_t plen = rt_strlen(req->name) + 2; - unsigned char *pbuf; + size_t plen = rt_strlen(req->name) + 2; + unsigned char *pbuf; rt_ubase_t lvl; lvl = rt_hw_interrupt_disable(); @@ -930,8 +930,8 @@ int rt_vbus_request_chn(struct rt_vbus_request *req, goto _waitforcmp; } - pbuf = rt_malloc(plen); - if (!pbuf) + pbuf = rt_malloc(plen); + if (!pbuf) { rt_hw_interrupt_enable(lvl); return -RT_ENOMEM; @@ -944,7 +944,7 @@ int rt_vbus_request_chn(struct rt_vbus_request *req, rt_memcpy(pbuf+1, req->name, plen-1); vbus_verbose("%s --> remote\n", dump_cmd_pkt(pbuf, plen)); - err = _chn0_post(pbuf, plen, RT_WAITING_FOREVER); + err = _chn0_post(pbuf, plen, RT_WAITING_FOREVER); rt_free(pbuf); _waitforcmp: diff --git a/components/vbus/vbus.h b/components/vbus/vbus.h index ea271d8e79..661e310e6d 100644 --- a/components/vbus/vbus.h +++ b/components/vbus/vbus.h @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -51,14 +51,14 @@ struct rt_vbus_data { }; struct rt_vbus_wm_cfg { - unsigned int low, high; + unsigned int low, high; }; struct rt_vbus_request { - unsigned char prio; - const char *name; - int is_server; - struct rt_vbus_wm_cfg recv_wm, post_wm; + unsigned char prio; + const char *name; + int is_server; + struct rt_vbus_wm_cfg recv_wm, post_wm; }; /** Request a channel. diff --git a/components/vbus/vbus_chnx.c b/components/vbus/vbus_chnx.c index d064d6f1f2..1014369cc2 100644 --- a/components/vbus/vbus_chnx.c +++ b/components/vbus/vbus_chnx.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vbus/watermark_queue.c b/components/vbus/watermark_queue.c index e56790d286..15c42d8080 100644 --- a/components/vbus/watermark_queue.c +++ b/components/vbus/watermark_queue.c @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vbus/watermark_queue.h b/components/vbus/watermark_queue.h index 0ecc52d8ff..484d981ed1 100644 --- a/components/vbus/watermark_queue.h +++ b/components/vbus/watermark_queue.h @@ -1,6 +1,6 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd - * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vmm/vmm.c b/components/vmm/vmm.c index 2bca67376c..26aee1e3cd 100644 --- a/components/vmm/vmm.c +++ b/components/vmm/vmm.c @@ -1,9 +1,9 @@ /* * VMM startup file. * - * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vmm/vmm.h b/components/vmm/vmm.h index 17bba8439b..ef7d9a1667 100644 --- a/components/vmm/vmm.h +++ b/components/vmm/vmm.h @@ -1,9 +1,9 @@ /* * VMM startup file. * - * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vmm/vmm_context.c b/components/vmm/vmm_context.c index 2e3b95f825..bf8f2a058e 100644 --- a/components/vmm/vmm_context.c +++ b/components/vmm/vmm_context.c @@ -1,7 +1,7 @@ /* - * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vmm/vmm_context.h b/components/vmm/vmm_context.h index 019b681459..88cd27b8f1 100644 --- a/components/vmm/vmm_context.h +++ b/components/vmm/vmm_context.h @@ -1,7 +1,7 @@ /* - * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vmm/vmm_iomap.c b/components/vmm/vmm_iomap.c index 55bd1ac36e..582dcb6945 100644 --- a/components/vmm/vmm_iomap.c +++ b/components/vmm/vmm_iomap.c @@ -1,9 +1,9 @@ /* * VMM IO map table * - * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/components/vmm/vmm_vector.c b/components/vmm/vmm_vector.c index d7909607ce..1620d66c7d 100644 --- a/components/vmm/vmm_vector.c +++ b/components/vmm/vmm_vector.c @@ -1,9 +1,9 @@ /* * VMM vector handle - * - * COPYRIGHT (C) 2013-2014, Real-Thread Information Technology Ltd + * + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * All rights reserved - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -23,9 +23,9 @@ void vmm_guest_isr(int irqno, void* parameter) void vmm_vector_init(void) { - rt_hw_interrupt_install(RT_VMM_VIRQ_TRIGGER, vmm_guest_isr, RT_NULL, "virq"); - rt_hw_interrupt_umask(RT_VMM_VIRQ_TRIGGER); + rt_hw_interrupt_install(RT_VMM_VIRQ_TRIGGER, vmm_guest_isr, RT_NULL, "virq"); + rt_hw_interrupt_umask(RT_VMM_VIRQ_TRIGGER); - return; + return; } -- cgit v1.3.1 From ab04030f8f9dbfac279152d77816a379eeba813c Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 8 Mar 2021 21:53:02 +0800 Subject: revert --- components/drivers/include/drivers/watchdog.h | 2 +- components/net/lwip-1.4.1/src/api/api_lib.c | 30 +- components/net/lwip-1.4.1/src/api/api_msg.c | 34 +- components/net/lwip-1.4.1/src/api/err.c | 28 +- components/net/lwip-1.4.1/src/api/netbuf.c | 32 +- components/net/lwip-1.4.1/src/api/netdb.c | 26 +- components/net/lwip-1.4.1/src/api/netifapi.c | 24 +- components/net/lwip-1.4.1/src/api/sockets.c | 32 +- components/net/lwip-1.4.1/src/api/tcpip.c | 8 +- .../net/lwip-1.4.1/src/arch/include/arch/perf.h | 52 +- .../lwip-1.4.1/src/arch/include/arch/sys_arch.h | 48 +- components/net/lwip-1.4.1/src/core/def.c | 2 +- components/net/lwip-1.4.1/src/core/dhcp.c | 14 +- components/net/lwip-1.4.1/src/core/dns.c | 14 +- components/net/lwip-1.4.1/src/core/init.c | 30 +- components/net/lwip-1.4.1/src/core/ipv4/autoip.c | 14 +- components/net/lwip-1.4.1/src/core/ipv4/icmp.c | 4 +- components/net/lwip-1.4.1/src/core/ipv4/igmp.c | 68 +- .../net/lwip-1.4.1/src/core/ipv4/inet_chksum.c | 14 +- components/net/lwip-1.4.1/src/core/ipv4/ip.c | 4 +- components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c | 32 +- components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c | 52 +- components/net/lwip-1.4.1/src/core/ipv6/inet6.c | 42 +- components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c | 30 +- components/net/lwip-1.4.1/src/core/mem.c | 2 +- components/net/lwip-1.4.1/src/core/memp.c | 48 +- components/net/lwip-1.4.1/src/core/netif.c | 20 +- components/net/lwip-1.4.1/src/core/pbuf.c | 22 +- components/net/lwip-1.4.1/src/core/raw.c | 10 +- components/net/lwip-1.4.1/src/core/stats.c | 100 +- components/net/lwip-1.4.1/src/core/tcp.c | 116 +- components/net/lwip-1.4.1/src/core/tcp_in.c | 54 +- components/net/lwip-1.4.1/src/core/tcp_out.c | 42 +- components/net/lwip-1.4.1/src/core/udp.c | 12 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h | 2 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h | 28 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h | 46 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/inet.h | 28 +- .../lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h | 28 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/ip.h | 30 +- .../net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h | 28 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h | 28 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/inet.h | 28 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/ip.h | 30 +- .../net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/api.h | 28 +- .../net/lwip-1.4.1/src/include/lwip/api_msg.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/arch.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/debug.h | 32 +- components/net/lwip-1.4.1/src/include/lwip/def.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/dhcp.h | 18 +- components/net/lwip-1.4.1/src/include/lwip/dns.h | 2 +- components/net/lwip-1.4.1/src/include/lwip/err.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/init.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/mem.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/memp.h | 28 +- .../net/lwip-1.4.1/src/include/lwip/memp_std.h | 2 +- .../net/lwip-1.4.1/src/include/lwip/netbuf.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/netdb.h | 24 +- components/net/lwip-1.4.1/src/include/lwip/netif.h | 30 +- .../net/lwip-1.4.1/src/include/lwip/netifapi.h | 26 +- components/net/lwip-1.4.1/src/include/lwip/opt.h | 56 +- components/net/lwip-1.4.1/src/include/lwip/pbuf.h | 32 +- components/net/lwip-1.4.1/src/include/lwip/sio.h | 48 +- components/net/lwip-1.4.1/src/include/lwip/snmp.h | 54 +- .../net/lwip-1.4.1/src/include/lwip/snmp_asn1.h | 2 +- .../net/lwip-1.4.1/src/include/lwip/snmp_structs.h | 8 +- .../net/lwip-1.4.1/src/include/lwip/sockets.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/stats.h | 30 +- components/net/lwip-1.4.1/src/include/lwip/sys.h | 32 +- components/net/lwip-1.4.1/src/include/lwip/tcp.h | 38 +- .../net/lwip-1.4.1/src/include/lwip/tcp_impl.h | 34 +- components/net/lwip-1.4.1/src/include/lwip/tcpip.h | 28 +- .../net/lwip-1.4.1/src/include/lwip/timers.h | 28 +- components/net/lwip-1.4.1/src/include/lwip/udp.h | 30 +- .../net/lwip-1.4.1/src/include/netif/etharp.h | 28 +- .../net/lwip-1.4.1/src/include/netif/ethernetif.h | 10 +- .../net/lwip-1.4.1/src/include/netif/ppp_oe.h | 4 +- .../net/lwip-1.4.1/src/include/netif/slipif.h | 52 +- .../net/lwip-1.4.1/src/include/posix/netdb.h | 22 +- .../net/lwip-1.4.1/src/include/posix/sys/socket.h | 22 +- components/net/lwip-1.4.1/src/netif/etharp.c | 40 +- components/net/lwip-1.4.1/src/netif/ethernetif.c | 48 +- components/net/lwip-1.4.1/src/netif/ppp/auth.c | 22 +- components/net/lwip-1.4.1/src/netif/ppp/auth.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/chap.c | 64 +- components/net/lwip-1.4.1/src/netif/ppp/chap.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/chpms.c | 10 +- components/net/lwip-1.4.1/src/netif/ppp/chpms.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/fsm.c | 78 +- components/net/lwip-1.4.1/src/netif/ppp/fsm.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/ipcp.c | 14 +- components/net/lwip-1.4.1/src/netif/ppp/ipcp.h | 6 +- components/net/lwip-1.4.1/src/netif/ppp/lcp.c | 62 +- components/net/lwip-1.4.1/src/netif/ppp/lcp.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/magic.c | 4 +- components/net/lwip-1.4.1/src/netif/ppp/magic.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/md5.c | 2 +- components/net/lwip-1.4.1/src/netif/ppp/pap.c | 8 +- components/net/lwip-1.4.1/src/netif/ppp/pap.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/ppp.c | 54 +- components/net/lwip-1.4.1/src/netif/ppp/ppp.h | 12 +- components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h | 6 +- components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c | 10 +- components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/randm.c | 6 +- components/net/lwip-1.4.1/src/netif/ppp/randm.h | 4 +- components/net/lwip-1.4.1/src/netif/ppp/vj.c | 40 +- components/net/lwip-1.4.1/src/netif/ppp/vj.h | 2 +- components/net/lwip-1.4.1/src/netif/slipif.c | 52 +- components/net/lwip-1.4.1/test/unit/lwipopts.h | 28 +- components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c | 2 +- components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c | 8 +- components/net/lwip-2.0.2/doc/doxygen/main_page.h | 21 +- components/net/lwip-2.0.2/src/api/api_lib.c | 14 +- components/net/lwip-2.0.2/src/api/api_msg.c | 4 +- components/net/lwip-2.0.2/src/api/netifapi.c | 12 +- components/net/lwip-2.0.2/src/api/sockets.c | 2 +- components/net/lwip-2.0.2/src/api/tcpip.c | 2 +- components/net/lwip-2.0.2/src/apps/httpd/fs.c | 28 +- components/net/lwip-2.0.2/src/apps/httpd/fsdata.h | 28 +- components/net/lwip-2.0.2/src/apps/httpd/httpd.c | 4 +- .../net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c | 2 +- components/net/lwip-2.0.2/src/apps/mdns/mdns.c | 4 +- components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c | 2 +- .../net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c | 6 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_core.c | 58 +- .../lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c | 2 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c | 22 +- components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c | 44 +- components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h | 2 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c | 10 +- components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c | 4 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c | 10 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_table.c | 6 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c | 8 +- .../net/lwip-2.0.2/src/apps/snmp/snmp_traps.c | 4 +- .../net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c | 12 +- .../net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c | 18 +- .../net/lwip-2.0.2/src/apps/tftp/tftp_server.c | 30 +- .../net/lwip-2.0.2/src/arch/include/arch/perf.h | 52 +- .../lwip-2.0.2/src/arch/include/arch/sys_arch.h | 48 +- components/net/lwip-2.0.2/src/core/def.c | 2 +- components/net/lwip-2.0.2/src/core/dns.c | 6 +- components/net/lwip-2.0.2/src/core/inet_chksum.c | 2 +- components/net/lwip-2.0.2/src/core/init.c | 2 +- components/net/lwip-2.0.2/src/core/ip.c | 8 +- components/net/lwip-2.0.2/src/core/ipv4/autoip.c | 8 +- components/net/lwip-2.0.2/src/core/ipv4/igmp.c | 10 +- components/net/lwip-2.0.2/src/core/ipv6/nd6.c | 10 +- components/net/lwip-2.0.2/src/core/netif.c | 14 +- components/net/lwip-2.0.2/src/core/pbuf.c | 12 +- components/net/lwip-2.0.2/src/core/raw.c | 2 +- components/net/lwip-2.0.2/src/core/tcp.c | 4 +- components/net/lwip-2.0.2/src/core/udp.c | 2 +- components/net/lwip-2.0.2/src/include/lwip/api.h | 16 +- .../net/lwip-2.0.2/src/include/lwip/apps/fs.h | 28 +- .../net/lwip-2.0.2/src/include/lwip/apps/httpd.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/httpd_opts.h | 2 +- .../net/lwip-2.0.2/src/include/lwip/apps/mqtt.h | 4 +- .../lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/snmp_core.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/tftp_opts.h | 2 +- .../lwip-2.0.2/src/include/lwip/apps/tftp_server.h | 4 +- components/net/lwip-2.0.2/src/include/lwip/arch.h | 4 +- components/net/lwip-2.0.2/src/include/lwip/igmp.h | 2 +- .../net/lwip-2.0.2/src/include/lwip/ip_addr.h | 2 +- components/net/lwip-2.0.2/src/include/lwip/mld6.h | 2 +- components/net/lwip-2.0.2/src/include/lwip/opt.h | 4 +- .../lwip-2.0.2/src/include/lwip/prot/ethernet.h | 2 +- .../net/lwip-2.0.2/src/include/lwip/prot/ip6.h | 2 +- .../net/lwip-2.0.2/src/include/netif/ethernetif.h | 10 +- .../net/lwip-2.0.2/src/include/netif/ppp/ccp.h | 82 +- .../lwip-2.0.2/src/include/netif/ppp/chap-new.h | 90 +- .../net/lwip-2.0.2/src/include/netif/ppp/eap.h | 172 +- .../net/lwip-2.0.2/src/include/netif/ppp/ecp.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/eui64.h | 60 +- .../net/lwip-2.0.2/src/include/netif/ppp/fsm.h | 142 +- .../net/lwip-2.0.2/src/include/netif/ppp/ipcp.h | 36 +- .../net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h | 10 +- .../net/lwip-2.0.2/src/include/netif/ppp/lcp.h | 92 +- .../net/lwip-2.0.2/src/include/netif/ppp/magic.h | 2 +- .../net/lwip-2.0.2/src/include/netif/ppp/mppe.h | 154 +- .../src/include/netif/ppp/polarssl/arc4.h | 4 +- .../src/include/netif/ppp/polarssl/des.h | 4 +- .../src/include/netif/ppp/polarssl/md4.h | 4 +- .../src/include/netif/ppp/polarssl/md5.h | 4 +- .../src/include/netif/ppp/polarssl/sha1.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/ppp.h | 8 +- .../lwip-2.0.2/src/include/netif/ppp/ppp_impl.h | 254 +- .../lwip-2.0.2/src/include/netif/ppp/pppcrypt.h | 2 +- .../lwip-2.0.2/src/include/netif/ppp/pppdebug.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/pppoe.h | 4 +- .../net/lwip-2.0.2/src/include/netif/ppp/upap.h | 52 +- components/net/lwip-2.0.2/src/netif/ethernet.c | 4 +- components/net/lwip-2.0.2/src/netif/ethernetif.c | 36 +- components/net/lwip-2.0.2/src/netif/ppp/auth.c | 1494 ++++---- components/net/lwip-2.0.2/src/netif/ppp/ccp.c | 1610 ++++----- components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c | 116 +- components/net/lwip-2.0.2/src/netif/ppp/chap-new.c | 884 ++--- components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c | 786 ++-- components/net/lwip-2.0.2/src/netif/ppp/demand.c | 298 +- components/net/lwip-2.0.2/src/netif/ppp/eap.c | 3820 ++++++++++---------- components/net/lwip-2.0.2/src/netif/ppp/ecp.c | 12 +- components/net/lwip-2.0.2/src/netif/ppp/eui64.c | 4 +- components/net/lwip-2.0.2/src/netif/ppp/fsm.c | 610 ++-- components/net/lwip-2.0.2/src/netif/ppp/ipcp.c | 2026 +++++------ components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c | 1026 +++--- components/net/lwip-2.0.2/src/netif/ppp/lcp.c | 2370 ++++++------ components/net/lwip-2.0.2/src/netif/ppp/mppe.c | 588 +-- .../net/lwip-2.0.2/src/netif/ppp/multilink.c | 888 ++--- .../net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c | 4 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/des.c | 4 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c | 4 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c | 6 +- .../net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c | 4 +- components/net/lwip-2.0.2/src/netif/ppp/ppp.c | 2 +- components/net/lwip-2.0.2/src/netif/ppp/pppapi.c | 22 +- components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c | 26 +- components/net/lwip-2.0.2/src/netif/ppp/pppoe.c | 8 +- components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c | 18 +- components/net/lwip-2.0.2/src/netif/ppp/upap.c | 260 +- components/net/lwip-2.0.2/src/netif/ppp/utils.c | 890 ++--- components/net/lwip-2.0.2/test/fuzz/fuzz.c | 28 +- components/net/lwip-2.0.2/test/fuzz/lwipopts.h | 28 +- .../net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c | 2 +- components/net/lwip-2.0.2/test/unit/lwipopts.h | 28 +- .../net/lwip-2.0.2/test/unit/tcp/tcp_helper.c | 4 +- components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c | 2 +- components/net/lwip-2.1.2/src/api/tcpip.c | 2 +- .../src/apps/altcp_tls/altcp_tls_mbedtls.c | 2 +- .../net/lwip-2.1.2/src/apps/http/http_client.c | 8 +- components/net/lwip-2.1.2/src/apps/http/httpd.c | 2 +- .../lwip-2.1.2/src/apps/http/makefsdata/tinydir.h | 824 ++--- components/net/lwip-2.1.2/src/apps/smtp/smtp.c | 12 +- .../net/lwip-2.1.2/src/arch/include/arch/perf.h | 52 +- components/net/lwip-2.1.2/src/core/altcp.c | 6 +- components/net/lwip-2.1.2/src/core/ipv4/dhcp.c | 2 +- components/net/lwip-2.1.2/src/core/ipv6/ip6.c | 2 +- components/net/lwip-2.1.2/src/core/ipv6/mld6.c | 2 +- components/net/lwip-2.1.2/src/core/ipv6/nd6.c | 6 +- components/net/lwip-2.1.2/src/core/sys.c | 12 +- components/net/lwip-2.1.2/src/core/tcp.c | 26 +- components/net/lwip-2.1.2/src/core/tcp_out.c | 2 +- components/net/lwip-2.1.2/src/core/timeouts.c | 4 +- components/net/lwip-2.1.2/src/core/udp.c | 8 +- .../lwip-2.1.2/src/include/compat/posix/net/if.h | 22 +- components/net/lwip-2.1.2/src/include/lwip/api.h | 16 +- .../net/lwip-2.1.2/src/include/lwip/apps/fs.h | 28 +- .../lwip-2.1.2/src/include/lwip/apps/http_client.h | 10 +- .../lwip-2.1.2/src/include/lwip/apps/httpd_opts.h | 2 +- .../net/lwip-2.1.2/src/include/lwip/apps/mqtt.h | 4 +- .../lwip-2.1.2/src/include/lwip/apps/smtp_opts.h | 6 +- .../lwip-2.1.2/src/include/lwip/apps/snmp_core.h | 2 +- .../lwip-2.1.2/src/include/lwip/apps/tftp_opts.h | 2 +- .../lwip-2.1.2/src/include/lwip/apps/tftp_server.h | 4 +- components/net/lwip-2.1.2/src/include/lwip/arch.h | 4 +- components/net/lwip-2.1.2/src/include/lwip/igmp.h | 2 +- .../net/lwip-2.1.2/src/include/lwip/ip_addr.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/mld6.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/netif.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/opt.h | 8 +- components/net/lwip-2.1.2/src/include/lwip/pbuf.h | 2 +- .../net/lwip-2.1.2/src/include/lwip/prot/ieee.h | 2 +- components/net/lwip-2.1.2/src/include/lwip/sys.h | 26 +- .../net/lwip-2.1.2/src/include/netif/ethernetif.h | 10 +- .../net/lwip-2.1.2/src/include/netif/lowpan6_ble.h | 6 +- .../lwip-2.1.2/src/include/netif/lowpan6_opts.h | 2 +- .../net/lwip-2.1.2/src/include/netif/ppp/ccp.h | 82 +- .../lwip-2.1.2/src/include/netif/ppp/chap-new.h | 90 +- .../net/lwip-2.1.2/src/include/netif/ppp/eap.h | 172 +- .../net/lwip-2.1.2/src/include/netif/ppp/ecp.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/eui64.h | 60 +- .../net/lwip-2.1.2/src/include/netif/ppp/fsm.h | 142 +- .../net/lwip-2.1.2/src/include/netif/ppp/ipcp.h | 36 +- .../net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h | 10 +- .../net/lwip-2.1.2/src/include/netif/ppp/lcp.h | 92 +- .../net/lwip-2.1.2/src/include/netif/ppp/magic.h | 2 +- .../net/lwip-2.1.2/src/include/netif/ppp/mppe.h | 154 +- .../src/include/netif/ppp/polarssl/arc4.h | 4 +- .../src/include/netif/ppp/polarssl/des.h | 4 +- .../src/include/netif/ppp/polarssl/md4.h | 4 +- .../src/include/netif/ppp/polarssl/md5.h | 4 +- .../src/include/netif/ppp/polarssl/sha1.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/ppp.h | 8 +- .../lwip-2.1.2/src/include/netif/ppp/ppp_impl.h | 254 +- .../lwip-2.1.2/src/include/netif/ppp/pppcrypt.h | 2 +- .../lwip-2.1.2/src/include/netif/ppp/pppdebug.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/pppoe.h | 4 +- .../net/lwip-2.1.2/src/include/netif/ppp/upap.h | 52 +- components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c | 6 +- components/net/lwip-2.1.2/src/netif/ethernetif.c | 78 +- components/net/lwip-2.1.2/src/netif/lowpan6_ble.c | 32 +- .../net/lwip-2.1.2/src/netif/lowpan6_common.c | 2 +- components/net/lwip-2.1.2/src/netif/ppp/auth.c | 1494 ++++---- components/net/lwip-2.1.2/src/netif/ppp/ccp.c | 1610 ++++----- components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c | 116 +- components/net/lwip-2.1.2/src/netif/ppp/chap-new.c | 884 ++--- components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c | 786 ++-- components/net/lwip-2.1.2/src/netif/ppp/demand.c | 298 +- components/net/lwip-2.1.2/src/netif/ppp/eap.c | 3820 ++++++++++---------- components/net/lwip-2.1.2/src/netif/ppp/ecp.c | 12 +- components/net/lwip-2.1.2/src/netif/ppp/eui64.c | 4 +- components/net/lwip-2.1.2/src/netif/ppp/fsm.c | 610 ++-- components/net/lwip-2.1.2/src/netif/ppp/ipcp.c | 2026 +++++------ components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c | 1026 +++--- components/net/lwip-2.1.2/src/netif/ppp/lcp.c | 2370 ++++++------ components/net/lwip-2.1.2/src/netif/ppp/mppe.c | 588 +-- .../net/lwip-2.1.2/src/netif/ppp/multilink.c | 888 ++--- .../net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c | 4 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/des.c | 4 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c | 4 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c | 6 +- .../net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c | 4 +- components/net/lwip-2.1.2/src/netif/ppp/ppp.c | 2 +- components/net/lwip-2.1.2/src/netif/ppp/pppapi.c | 22 +- components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c | 26 +- components/net/lwip-2.1.2/src/netif/ppp/pppoe.c | 8 +- components/net/lwip-2.1.2/src/netif/ppp/upap.c | 260 +- components/net/lwip-2.1.2/src/netif/ppp/utils.c | 890 ++--- components/net/lwip-2.1.2/test/fuzz/fuzz.c | 28 +- components/net/lwip-2.1.2/test/fuzz/lwipopts.h | 28 +- .../lwip-2.1.2/test/sockets/sockets_stresstest.c | 28 +- .../lwip-2.1.2/test/sockets/sockets_stresstest.h | 26 +- .../net/lwip-2.1.2/test/unit/api/test_sockets.c | 10 +- .../net/lwip-2.1.2/test/unit/arch/sys_arch.c | 28 +- .../net/lwip-2.1.2/test/unit/arch/sys_arch.h | 28 +- .../net/lwip-2.1.2/test/unit/core/test_timers.c | 6 +- components/net/lwip-2.1.2/test/unit/lwipopts.h | 28 +- .../net/lwip-2.1.2/test/unit/tcp/tcp_helper.c | 4 +- components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c | 10 +- 331 files changed, 21558 insertions(+), 21559 deletions(-) diff --git a/components/drivers/include/drivers/watchdog.h b/components/drivers/include/drivers/watchdog.h index 1cf3dc741d..9489ac2810 100644 --- a/components/drivers/include/drivers/watchdog.h +++ b/components/drivers/include/drivers/watchdog.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (C) 2018, Real-Thread Information Technology Ltd + * COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd * * SPDX-License-Identifier: Apache-2.0 * diff --git a/components/net/lwip-1.4.1/src/api/api_lib.c b/components/net/lwip-1.4.1/src/api/api_lib.c index 9cf93d4a19..4bdf08edfc 100644 --- a/components/net/lwip-1.4.1/src/api/api_lib.c +++ b/components/net/lwip-1.4.1/src/api/api_lib.c @@ -3,12 +3,12 @@ * Sequential API External module * */ - + /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/api/api_msg.c b/components/net/lwip-1.4.1/src/api/api_msg.c index 5bb78cd698..7c58a77bde 100644 --- a/components/net/lwip-1.4.1/src/api/api_msg.c +++ b/components/net/lwip-1.4.1/src/api/api_msg.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -332,7 +332,7 @@ sent_tcp(void *arg, struct tcp_pcb *pcb, u16_t len) API_EVENT(conn, NETCONN_EVT_SENDPLUS, len); } } - + return ERR_OK; } @@ -1255,7 +1255,7 @@ do_writemore(struct netconn *conn) if (available < len) { /* don't try to write more than sendbuf */ len = available; - if (dontblock){ + if (dontblock){ if (!len) { err = ERR_WOULDBLOCK; goto err_mem; @@ -1491,7 +1491,7 @@ do_close(struct api_msg_msg *msg) */ void do_join_leave_group(struct api_msg_msg *msg) -{ +{ if (ERR_IS_FATAL(msg->conn->last_err)) { msg->err = msg->conn->last_err; } else { diff --git a/components/net/lwip-1.4.1/src/api/err.c b/components/net/lwip-1.4.1/src/api/err.c index 78a576f354..92fa8b7dba 100644 --- a/components/net/lwip-1.4.1/src/api/err.c +++ b/components/net/lwip-1.4.1/src/api/err.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/api/netbuf.c b/components/net/lwip-1.4.1/src/api/netbuf.c index cea0fa3ba8..9390c9ee98 100644 --- a/components/net/lwip-1.4.1/src/api/netbuf.c +++ b/components/net/lwip-1.4.1/src/api/netbuf.c @@ -3,12 +3,12 @@ * Network buffer management * */ - + /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/api/netdb.c b/components/net/lwip-1.4.1/src/api/netdb.c index 3454004345..6a4bac561c 100644 --- a/components/net/lwip-1.4.1/src/api/netdb.c +++ b/components/net/lwip-1.4.1/src/api/netdb.c @@ -5,7 +5,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -14,21 +14,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ @@ -258,7 +258,7 @@ lwip_freeaddrinfo(struct addrinfo *ai) * * @param nodename descriptive name or address string of the host * (may be NULL -> local address) - * @param servname port number as string of NULL + * @param servname port number as string of NULL * @param hints structure containing input values that set socktype and protocol * @param res pointer to a pointer where to store the result (set to NULL on failure) * @return 0 on success, non-zero on failure diff --git a/components/net/lwip-1.4.1/src/api/netifapi.c b/components/net/lwip-1.4.1/src/api/netifapi.c index ba0e1eea81..43e47203a9 100644 --- a/components/net/lwip-1.4.1/src/api/netifapi.c +++ b/components/net/lwip-1.4.1/src/api/netifapi.c @@ -5,7 +5,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -14,21 +14,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * */ #include "lwip/opt.h" diff --git a/components/net/lwip-1.4.1/src/api/sockets.c b/components/net/lwip-1.4.1/src/api/sockets.c index a81d3fc34f..c5bcf8b4a2 100644 --- a/components/net/lwip-1.4.1/src/api/sockets.c +++ b/components/net/lwip-1.4.1/src/api/sockets.c @@ -75,7 +75,7 @@ struct lwip_sock { tested by select */ u16_t sendevent; /** error happened for this socket, set by event_callback(), tested by select */ - u16_t errevent; + u16_t errevent; /** last error that occurred on this socket */ int err; /** counter of how many threads are waiting for this socket using select */ @@ -593,7 +593,7 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, buf = sock->lastdata; } else { /* If this is non-blocking call, then check first */ - if (((flags & MSG_DONTWAIT) || netconn_is_nonblocking(sock->conn)) && + if (((flags & MSG_DONTWAIT) || netconn_is_nonblocking(sock->conn)) && (sock->rcvevent <= 0)) { if (off > 0) { /* update receive window */ @@ -665,9 +665,9 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, if (netconn_type(sock->conn) == NETCONN_TCP) { LWIP_ASSERT("invalid copylen, len would underflow", len >= copylen); len -= copylen; - if ( (len <= 0) || - (p->flags & PBUF_FLAG_PUSH) || - (sock->rcvevent <= 0) || + if ( (len <= 0) || + (p->flags & PBUF_FLAG_PUSH) || + (sock->rcvevent <= 0) || ((flags & MSG_PEEK)!=0)) { done = 1; } @@ -898,7 +898,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags, #endif /* LWIP_UDP */ } UNLOCK_TCPIP_CORE(); - + pbuf_free(p); } else { err = ERR_MEM; @@ -1482,11 +1482,11 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) /* Do length and type checks for the various options first, to keep it readable. */ switch (level) { - + /* Level: SOL_SOCKET */ case SOL_SOCKET: switch (optname) { - + case SO_ACCEPTCONN: case SO_BROADCAST: /* UNIMPL case SO_DEBUG: */ @@ -1537,7 +1537,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = ENOPROTOOPT; } /* switch (optname) */ break; - + /* Level: IPPROTO_IP */ case IPPROTO_IP: switch (optname) { @@ -1577,7 +1577,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = ENOPROTOOPT; } /* switch (optname) */ break; - + #if LWIP_TCP /* Level: IPPROTO_TCP */ case IPPROTO_TCP: @@ -1585,7 +1585,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = EINVAL; break; } - + /* If this is no TCP socket, ignore any options. */ if (sock->conn->type != NETCONN_TCP) return 0; @@ -1599,7 +1599,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) case TCP_KEEPCNT: #endif /* LWIP_TCP_KEEPALIVE */ break; - + default: LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_TCP, UNIMPL: optname=0x%x, ..)\n", s, optname)); @@ -1614,7 +1614,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = EINVAL; break; } - + /* If this is no UDP lite socket, ignore any options. */ if (sock->conn->type != NETCONN_UDPLITE) { return 0; @@ -1624,7 +1624,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) case UDPLITE_SEND_CSCOV: case UDPLITE_RECV_CSCOV: break; - + default: LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_UDPLITE, UNIMPL: optname=0x%x, ..)\n", s, optname)); @@ -1639,7 +1639,7 @@ lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) err = ENOPROTOOPT; } /* switch */ - + if (err != ERR_OK) { sock_set_errno(sock, err); return -1; @@ -1734,7 +1734,7 @@ lwip_getsockopt_internal(void *arg) /* only overwrite ERR_OK or tempoary errors */ if ((sock->err == 0) || (sock->err == EINPROGRESS)) { sock_set_errno(sock, err_to_errno(sock->conn->last_err)); - } + } *(int *)optval = sock->err; sock->err = 0; LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, SOL_SOCKET, SO_ERROR) = %d\n", diff --git a/components/net/lwip-1.4.1/src/api/tcpip.c b/components/net/lwip-1.4.1/src/api/tcpip.c index 4b73bb5986..18d5f679f4 100644 --- a/components/net/lwip-1.4.1/src/api/tcpip.c +++ b/components/net/lwip-1.4.1/src/api/tcpip.c @@ -310,7 +310,7 @@ tcpip_apimsg(struct api_msg *apimsg) /* catch functions that don't set err */ apimsg->msg.err = ERR_VAL; #endif - + if (sys_mbox_valid(&mbox)) { msg.type = TCPIP_MSG_API; msg.msg.apimsg = apimsg; @@ -360,14 +360,14 @@ err_t tcpip_netifapi(struct netifapi_msg* netifapimsg) { struct tcpip_msg msg; - + if (sys_mbox_valid(&mbox)) { err_t err = sys_sem_new(&netifapimsg->msg.sem, 0); if (err != ERR_OK) { netifapimsg->msg.err = err; return err; } - + msg.type = TCPIP_MSG_NETIFAPI; msg.msg.netifapimsg = netifapimsg; sys_mbox_post(&mbox, &msg); @@ -389,7 +389,7 @@ tcpip_netifapi(struct netifapi_msg* netifapimsg) err_t tcpip_netifapi_lock(struct netifapi_msg* netifapimsg) { - LOCK_TCPIP_CORE(); + LOCK_TCPIP_CORE(); netifapimsg->function(&(netifapimsg->msg)); UNLOCK_TCPIP_CORE(); return netifapimsg->msg.err; diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/perf.h b/components/net/lwip-1.4.1/src/arch/include/arch/perf.h index 4b7720ef40..675f1f65dc 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/perf.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/perf.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: perf.h,v 1.1.1.1 2004/12/16 14:17:13 bear Exp $ @@ -42,8 +42,8 @@ /* void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); + unsigned long c2l, unsigned long c2h, + char *key); void perf_print_times(struct tms *start, struct tms *end, char *key); diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h b/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h index 9dbf3bf284..72814aa25c 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: sys_arch.h,v 1.3 2005/03/13 16:03:23 bear Exp $ diff --git a/components/net/lwip-1.4.1/src/core/def.c b/components/net/lwip-1.4.1/src/core/def.c index bb4b8e01fc..352b55241a 100644 --- a/components/net/lwip-1.4.1/src/core/def.c +++ b/components/net/lwip-1.4.1/src/core/def.c @@ -44,7 +44,7 @@ * Again with the aim of being simple, correct and fully portable. * Byte swapping is the second thing you would want to optimize. You will * need to port it to your architecture and in your cc.h: - * + * * #define LWIP_PLATFORM_BYTESWAP 1 * #define LWIP_PLATFORM_HTONS(x) * #define LWIP_PLATFORM_HTONL(x) diff --git a/components/net/lwip-1.4.1/src/core/dhcp.c b/components/net/lwip-1.4.1/src/core/dhcp.c index 4f71b88897..eb12c55021 100644 --- a/components/net/lwip-1.4.1/src/core/dhcp.c +++ b/components/net/lwip-1.4.1/src/core/dhcp.c @@ -197,14 +197,14 @@ static void dhcp_handle_nak(struct netif *netif) { struct dhcp *dhcp = netif->dhcp; - LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num)); /* Set the interface down since the address must no longer be used, as per RFC2131 */ netif_set_down(netif); /* remove IP address from interface */ netif_set_ipaddr(netif, IP_ADDR_ANY); netif_set_gw(netif, IP_ADDR_ANY); - netif_set_netmask(netif, IP_ADDR_ANY); + netif_set_netmask(netif, IP_ADDR_ANY); /* Change to a defined state */ dhcp_set_state(dhcp, DHCP_BACKING_OFF); /* We can immediately restart discovery */ @@ -373,7 +373,7 @@ dhcp_fine_tmr() while (netif != NULL) { /* only act on DHCP configured interfaces */ if (netif->dhcp != NULL) { - /* timer is active (non zero), and is about to trigger now */ + /* timer is active (non zero), and is about to trigger now */ if (netif->dhcp->request_timeout > 1) { netif->dhcp->request_timeout--; } @@ -564,7 +564,7 @@ dhcp_handle_ack(struct netif *netif) if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) { ip4_addr_set_u32(&dhcp->offered_gw_addr, htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER))); } - + #if LWIP_DNS /* DNS servers */ n = 0; @@ -670,7 +670,7 @@ dhcp_start(struct netif *netif) LWIP_ASSERT("pbuf p_out wasn't freed", dhcp->p_out == NULL); LWIP_ASSERT("reply wasn't freed", dhcp->msg_in == NULL ); } - + /* clear data structure */ memset(dhcp, 0, sizeof(struct dhcp)); /* dhcp_set_state(&dhcp, DHCP_OFF); */ @@ -1183,7 +1183,7 @@ dhcp_release(struct netif *netif) ip_addr_set_zero(&dhcp->offered_si_addr); #endif /* LWIP_DHCP_BOOTP_FILE */ dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0; - + /* create and initialize the DHCP message header */ result = dhcp_create_msg(netif, dhcp, DHCP_RELEASE); if (result == ERR_OK) { @@ -1207,7 +1207,7 @@ dhcp_release(struct netif *netif) netif_set_ipaddr(netif, IP_ADDR_ANY); netif_set_gw(netif, IP_ADDR_ANY); netif_set_netmask(netif, IP_ADDR_ANY); - + return result; } diff --git a/components/net/lwip-1.4.1/src/core/dns.c b/components/net/lwip-1.4.1/src/core/dns.c index 3aa5047043..2e1356ca97 100644 --- a/components/net/lwip-1.4.1/src/core/dns.c +++ b/components/net/lwip-1.4.1/src/core/dns.c @@ -49,13 +49,13 @@ * The lwIP version of the resolver also adds a non-blocking version of * gethostbyname() that will work with a raw API application. This function * checks for an IP address string first and converts it if it is valid. - * gethostbyname() then does a dns_lookup() to see if the name is - * already in the table. If so, the IP is returned. If not, a query is + * gethostbyname() then does a dns_lookup() to see if the name is + * already in the table. If so, the IP is returned. If not, a query is * issued and the function returns with a ERR_INPROGRESS status. The app * using the dns client must then go into a waiting state. * * Once a hostname has been resolved (or found to be non-existent), - * the resolver code calls a specified callback function (which + * the resolver code calls a specified callback function (which * must be implemented by the module that uses the resolver). */ @@ -236,7 +236,7 @@ dns_init() ip_addr_t dnsserver; dns_payload = (u8_t *)LWIP_MEM_ALIGN(dns_payload_buffer); - + /* initialize default DNS server address */ DNS_SERVER_ADDRESS(&dnsserver); @@ -277,7 +277,7 @@ dns_setserver(u8_t numdns, ip_addr_t *dnsserver) if ((numdns < DNS_MAX_SERVERS) && (dns_pcb != NULL) && (dnsserver != NULL) && !ip_addr_isany(dnsserver)) { dns_servers[numdns] = (*dnsserver); - + #ifdef RT_USING_NETDEV extern struct netif *netif_list; extern struct netdev *netdev_get_by_name(const char *name); @@ -662,7 +662,7 @@ dns_check_entry(u8_t i) pEntry->numdns = 0; pEntry->tmr = 1; pEntry->retries = 0; - + /* send DNS packet for this entry */ err = dns_send(pEntry->numdns, pEntry->name, i); if (err != ERR_OK) { @@ -772,7 +772,7 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t goto memerr; } - /* copy dns payload inside static buffer for processing */ + /* copy dns payload inside static buffer for processing */ if (pbuf_copy_partial(p, dns_payload, p->tot_len, 0) == p->tot_len) { /* The ID in the DNS header should be our entry into the name table. */ hdr = (struct dns_hdr*)dns_payload; diff --git a/components/net/lwip-1.4.1/src/core/init.c b/components/net/lwip-1.4.1/src/core/init.c index 95bb706f76..a7b15a776a 100644 --- a/components/net/lwip-1.4.1/src/core/init.c +++ b/components/net/lwip-1.4.1/src/core/init.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -191,7 +191,7 @@ #if NETCONN_MORE != TCP_WRITE_FLAG_MORE #error "NETCONN_MORE != TCP_WRITE_FLAG_MORE" #endif -#endif /* LWIP_NETCONN && LWIP_TCP */ +#endif /* LWIP_NETCONN && LWIP_TCP */ #if LWIP_SOCKET /* Check that the SO_* socket options and SOF_* lwIP-internal flags match */ #if SO_ACCEPTCONN != SOF_ACCEPTCONN diff --git a/components/net/lwip-1.4.1/src/core/ipv4/autoip.c b/components/net/lwip-1.4.1/src/core/ipv4/autoip.c index 70684cf771..b122da27e3 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/autoip.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/autoip.c @@ -43,9 +43,9 @@ /******************************************************************************* * USAGE: - * + * * define LWIP_AUTOIP 1 in your lwipopts.h - * + * * If you don't use tcpip.c (so, don't call, you don't call tcpip_init): * - First, call autoip_init(). * - call autoip_tmr() all AUTOIP_TMR_INTERVAL msces, @@ -55,7 +55,7 @@ * * Without DHCP: * - Call autoip_start() after netif_add(). - * + * * With DHCP: * - define LWIP_DHCP_AUTOIP_COOP 1 in your lwipopts.h. * - Configure your DHCP Client. @@ -202,7 +202,7 @@ autoip_create_addr(struct netif *netif, ip_addr_t *ipaddr) u32_t addr = ntohl(LWIP_AUTOIP_CREATE_SEED_ADDR(netif)); addr += netif->autoip->tried_llipaddr; addr = AUTOIP_NET | (addr & 0xffff); - /* Now, 169.254.0.0 <= addr <= 169.254.255.255 */ + /* Now, 169.254.0.0 <= addr <= 169.254.255.255 */ if (addr < AUTOIP_RANGE_START) { addr += AUTOIP_RANGE_END - AUTOIP_RANGE_START + 1; @@ -213,7 +213,7 @@ autoip_create_addr(struct netif *netif, ip_addr_t *ipaddr) LWIP_ASSERT("AUTOIP address not in range", (addr >= AUTOIP_RANGE_START) && (addr <= AUTOIP_RANGE_END)); ip4_addr_set_u32(ipaddr, htonl(addr)); - + LWIP_DEBUGF(AUTOIP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("autoip_create_addr(): tried_llipaddr=%"U16_F", %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n", (u16_t)(netif->autoip->tried_llipaddr), ip4_addr1_16(ipaddr), ip4_addr2_16(ipaddr), @@ -268,7 +268,7 @@ autoip_bind(struct netif *netif) netif_set_ipaddr(netif, &autoip->llipaddr); netif_set_netmask(netif, &sn_mask); - netif_set_gw(netif, &gw_addr); + netif_set_gw(netif, &gw_addr); /* bring the interface up */ netif_set_up(netif); @@ -493,7 +493,7 @@ autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr) */ IPADDR2_COPY(&sipaddr, &hdr->sipaddr); IPADDR2_COPY(&dipaddr, &hdr->dipaddr); - + if ((netif->autoip->state == AUTOIP_STATE_PROBING) || ((netif->autoip->state == AUTOIP_STATE_ANNOUNCING) && (netif->autoip->sent_num == 0))) { diff --git a/components/net/lwip-1.4.1/src/core/ipv4/icmp.c b/components/net/lwip-1.4.1/src/core/ipv4/icmp.c index aaf39c357e..47ba857138 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/icmp.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/icmp.c @@ -103,7 +103,7 @@ icmp_input(struct pbuf *p, struct netif *inp) case ICMP_ER: /* This is OK, echo reply might have been parsed by a raw PCB (as obviously, an echo request has been sent, too). */ - break; + break; case ICMP_ECHO: #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING { @@ -227,7 +227,7 @@ icmp_input(struct pbuf *p, struct netif *inp) } break; default: - LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", + LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", (s16_t)type, (s16_t)code)); ICMP_STATS_INC(icmp.proterr); ICMP_STATS_INC(icmp.drop); diff --git a/components/net/lwip-1.4.1/src/core/ipv4/igmp.c b/components/net/lwip-1.4.1/src/core/ipv4/igmp.c index 0382e5b04d..45bb5d95c2 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/igmp.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/igmp.c @@ -8,29 +8,29 @@ * Copyright (c) 2002 CITEL Technologies Ltd. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is a contribution to the lwIP TCP/IP stack. * The Swedish Institute of Computer Science and Adam Dunkels @@ -70,7 +70,7 @@ Steve Reynolds * RFC 2236 - Internet Group Management Protocol, Version 2 - V2 <- this code is based on this RFC (it's the "de facto" standard) * RFC 3376 - Internet Group Management Protocol, Version 3 - V3 * RFC 4604 - Using Internet Group Management Protocol Version 3... - V3+ - * RFC 2113 - IP Router Alert Option - + * RFC 2113 - IP Router Alert Option - *----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------- @@ -95,7 +95,7 @@ Steve Reynolds #include "string.h" -/* +/* * IGMP constants */ #define IGMP_TTL 1 @@ -167,7 +167,7 @@ igmp_init(void) */ void igmp_dump_group_list() -{ +{ struct igmp_group *group = igmp_group_list; while (group != NULL) { @@ -316,7 +316,7 @@ struct igmp_group * igmp_lookup_group(struct netif *ifp, ip_addr_t *addr) { struct igmp_group *group = igmp_group_list; - + /* Search if the group already exists */ group = igmp_lookfor_group(ifp, addr); if (group != NULL) { @@ -334,7 +334,7 @@ igmp_lookup_group(struct netif *ifp, ip_addr_t *addr) group->last_reporter_flag = 0; group->use = 0; group->next = igmp_group_list; - + igmp_group_list = group; } @@ -395,7 +395,7 @@ igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest) IGMP_STATS_INC(igmp.recv); - /* Note that the length CAN be greater than 8 but only 8 are used - All are included in the checksum */ + /* Note that the length CAN be greater than 8 but only 8 are used - All are included in the checksum */ iphdr = (struct ip_hdr *)p->payload; if (pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4)) || (p->len < IGMP_MINLEN)) { pbuf_free(p); @@ -421,7 +421,7 @@ igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest) /* Packet is ok so find an existing group */ group = igmp_lookfor_group(inp, dest); /* use the destination IP address of incoming packet */ - + /* If group can be found or create... */ if (!group) { pbuf_free(p); @@ -614,7 +614,7 @@ igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr) IGMP_STATS_INC(igmp.tx_leave); igmp_send(group, IGMP_LEAVE_GROUP); } - + /* Disable the group at the MAC level */ if (netif->igmp_mac_filter != NULL) { LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup: igmp_mac_filter(DEL ")); @@ -622,11 +622,11 @@ igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr) LWIP_DEBUGF(IGMP_DEBUG, (") on if %p\n", netif)); netif->igmp_mac_filter(netif, groupaddr, IGMP_DEL_MAC_FILTER); } - + LWIP_DEBUGF(IGMP_DEBUG, ("igmp_leavegroup: remove group: ")); ip_addr_debug_print(IGMP_DEBUG, groupaddr); - LWIP_DEBUGF(IGMP_DEBUG, ("\n")); - + LWIP_DEBUGF(IGMP_DEBUG, ("\n")); + /* Free the group */ igmp_remove_group(group); } else { @@ -768,13 +768,13 @@ igmp_send(struct igmp_group *group, u8_t type) /* IP header + "router alert" option + IGMP header */ p = pbuf_alloc(PBUF_TRANSPORT, IGMP_MINLEN, PBUF_RAM); - + if (p) { igmp = (struct igmp_msg *)p->payload; LWIP_ASSERT("igmp_send: check that first pbuf can hold struct igmp_msg", (p->len >= sizeof(struct igmp_msg))); ip_addr_copy(src, group->netif->ip_addr); - + if (type == IGMP_V2_MEMB_REPORT) { dest = &(group->group_address); ip_addr_copy(igmp->igmp_group_address, group->group_address); diff --git a/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c b/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c index 014b891eed..960252f64f 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/inet_chksum.c @@ -48,8 +48,8 @@ * aim of being simple, correct and fully portable. Checksumming is the * first thing you would want to optimize for your platform. If you create * your own version, link it in and in your cc.h put: - * - * #define LWIP_CHKSUM + * + * #define LWIP_CHKSUM * * Or you can select from the implementations below by defining * LWIP_CHKSUM_ALGORITHM to 1, 2 or 3. @@ -72,7 +72,7 @@ * * @param dataptr points to start of data to be summed at any boundary * @param len length of data to be summed - * @return host order (!) lwip checksum (non-inverted Internet sum) + * @return host order (!) lwip checksum (non-inverted Internet sum) * * @note accumulator size limits summable length to 64k * @note host endianess is irrelevant (p3 RFC1071) @@ -128,7 +128,7 @@ lwip_standard_chksum(void *dataptr, u16_t len) * * @param dataptr points to start of data to be summed at any boundary * @param len length of data to be summed - * @return host order (!) lwip checksum (non-inverted Internet sum) + * @return host order (!) lwip checksum (non-inverted Internet sum) */ static u16_t @@ -178,12 +178,12 @@ lwip_standard_chksum(void *dataptr, int len) /** * An optimized checksum routine. Basically, it uses loop-unrolling on * the checksum loop, treating the head and tail bytes specially, whereas - * the inner loop acts on 8 bytes at a time. + * the inner loop acts on 8 bytes at a time. * * @arg start of buffer to be checksummed. May be an odd byte address. * @len number of bytes in the buffer to be checksummed. - * @return host order (!) lwip checksum (non-inverted Internet sum) - * + * @return host order (!) lwip checksum (non-inverted Internet sum) + * * by Curt McDowell, Broadcom Corp. December 8th, 2005 */ diff --git a/components/net/lwip-1.4.1/src/core/ipv4/ip.c b/components/net/lwip-1.4.1/src/core/ipv4/ip.c index fff25f1fb3..17bcd3929a 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/ip.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/ip.c @@ -1,7 +1,7 @@ /** * @file * This is the IPv4 layer implementation for incoming and outgoing IP traffic. - * + * * @see ip_frag.c * */ @@ -295,7 +295,7 @@ return_noroute: * forwarded (using ip_forward). The IP checksum is always checked. * * Finally, the packet is sent to the upper layer protocol input function. - * + * * @param p the received IP packet (p->payload points to IP header) * @param inp the netif on which this packet was received * @return ERR_OK if the packet was processed (could return ERR_* if it wasn't diff --git a/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c b/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c index bbd78534a5..8f633ff231 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/ip_addr.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -45,8 +45,8 @@ const ip_addr_t ip_addr_any = { IPADDR_ANY }; const ip_addr_t ip_addr_broadcast = { IPADDR_BROADCAST }; /** - * Determine if an address is a broadcast address on a network interface - * + * Determine if an address is a broadcast address on a network interface + * * @param addr address to be checked * @param netif the network interface against which the address is checked * @return returns non-zero if the address is a broadcast address diff --git a/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c b/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c index e1bda3f079..8d184345df 100644 --- a/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c +++ b/components/net/lwip-1.4.1/src/core/ipv4/ip_frag.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,25 +17,25 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * - * Author: Jani Monoses + * + * Author: Jani Monoses * Simon Goldschmidt * original reassembly code by Adam Dunkels - * + * */ #include "lwip/opt.h" @@ -185,7 +185,7 @@ ip_reass_free_complete_datagram(struct ip_reassdata *ipr, struct ip_reassdata *p } #endif /* LWIP_ICMP */ - /* First, free all received pbufs. The individual pbufs need to be released + /* First, free all received pbufs. The individual pbufs need to be released separately as they have not yet been chained */ p = ipr->p; while (p != NULL) { @@ -303,7 +303,7 @@ ip_reass_enqueue_new_datagram(struct ip_hdr *fraghdr, int clen) static void ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev) { - + /* dequeue the reass struct */ if (reassdatagrams == ipr) { /* it was the first in the list */ @@ -337,7 +337,7 @@ ip_reass_chain_frag_into_datagram_and_validate(struct ip_reassdata *ipr, struct int valid = 1; /* Extract length and fragment offset from current fragment */ - fraghdr = (struct ip_hdr*)new_p->payload; + fraghdr = (struct ip_hdr*)new_p->payload; len = ntohs(IPH_LEN(fraghdr)) - IPH_HL(fraghdr) * 4; offset = (ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) * 8; @@ -538,7 +538,7 @@ ip_reass(struct pbuf *p) goto nullreturn; } } else { - if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && + if (((ntohs(IPH_OFFSET(fraghdr)) & IP_OFFMASK) == 0) && ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) { /* ipr->iphdr is not the header from the first fragment, but fraghdr is * -> copy fraghdr into ipr->iphdr since we want to have the header @@ -547,11 +547,11 @@ ip_reass(struct pbuf *p) SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); } } - /* Track the current number of pbufs current 'in-flight', in order to limit + /* Track the current number of pbufs current 'in-flight', in order to limit the number of fragments that may be enqueued at any one time */ ip_reass_pbufcount += clen; - /* At this point, we have either created a new entry or pointing + /* At this point, we have either created a new entry or pointing * to an existing one */ /* check for 'no more fragments', and update queue entry*/ @@ -663,7 +663,7 @@ ipfrag_free_pbuf_custom(struct pbuf *p) * * @return ERR_OK if sent successfully, err_t otherwise */ -err_t +err_t ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest) { struct pbuf *rambuf; @@ -818,8 +818,8 @@ ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest) pbuf_realloc(rambuf, left + IP_HLEN); } - /* This part is ugly: we alloc a RAM based pbuf for - * the link level header for each chunk and then + /* This part is ugly: we alloc a RAM based pbuf for + * the link level header for each chunk and then * free it.A PBUF_ROM style pbuf for which pbuf_header * worked would make things simpler. */ @@ -848,7 +848,7 @@ ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest) * will have already sent the packet, the free will really free, and * there will be zero memory penalty. */ - + pbuf_free(rambuf); #endif /* IP_FRAG_USES_STATIC_BUF */ left -= cop; diff --git a/components/net/lwip-1.4.1/src/core/ipv6/inet6.c b/components/net/lwip-1.4.1/src/core/ipv6/inet6.c index fa38158320..c3de85c093 100644 --- a/components/net/lwip-1.4.1/src/core/ipv6/inet6.c +++ b/components/net/lwip-1.4.1/src/core/ipv6/inet6.c @@ -7,9 +7,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -18,21 +18,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -56,8 +56,8 @@ chksum(void *dataptr, u16_t len) { u16_t *sdataptr = dataptr; u32_t acc; - - + + for(acc = 0; len > 1; len -= 2) { acc += *sdataptr++; } @@ -87,7 +87,7 @@ inet_chksum_pseudo(struct pbuf *p, acc = 0; swapped = 0; - for(q = p; q != NULL; q = q->next) { + for(q = p; q != NULL; q = q->next) { acc += chksum(q->payload, q->len); while (acc >> 16) { acc = (acc & 0xffff) + (acc >> 16); @@ -101,7 +101,7 @@ inet_chksum_pseudo(struct pbuf *p, if (swapped) { acc = ((acc & 0xff) << 8) | ((acc & 0xff00) >> 8); } - + for(i = 0; i < 8; i++) { acc += ((u16_t *)src->addr)[i] & 0xffff; acc += ((u16_t *)dest->addr)[i] & 0xffff; @@ -142,20 +142,20 @@ inet_chksum_pbuf(struct pbuf *p) u32_t acc; struct pbuf *q; u8_t swapped; - + acc = 0; swapped = 0; for(q = p; q != NULL; q = q->next) { acc += chksum(q->payload, q->len); while (acc >> 16) { acc = (acc & 0xffff) + (acc >> 16); - } + } if (q->len % 2 != 0) { swapped = 1 - swapped; acc = (acc & 0xff << 8) | (acc & 0xff00 >> 8); } } - + if (swapped) { acc = ((acc & 0xff) << 8) | ((acc & 0xff00) >> 8); } diff --git a/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c b/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c index a74bc31375..2da6cea427 100644 --- a/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c +++ b/components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -42,7 +42,7 @@ ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2, (addr1->addr[1] & mask->addr[1]) == (addr2->addr[1] & mask->addr[1]) && (addr1->addr[2] & mask->addr[2]) == (addr2->addr[2] & mask->addr[2]) && (addr1->addr[3] & mask->addr[3]) == (addr2->addr[3] & mask->addr[3])); - + } u8_t diff --git a/components/net/lwip-1.4.1/src/core/mem.c b/components/net/lwip-1.4.1/src/core/mem.c index 66016917a1..1659a2c7a4 100644 --- a/components/net/lwip-1.4.1/src/core/mem.c +++ b/components/net/lwip-1.4.1/src/core/mem.c @@ -471,7 +471,7 @@ mem_trim(void *rmem, mem_size_t newsize) /* else { next struct mem is used but size between mem and mem2 is not big enough to create another struct mem - -> don't do anyhting. + -> don't do anyhting. -> the remaining space stays unused since it is too small } */ #if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT diff --git a/components/net/lwip-1.4.1/src/core/memp.c b/components/net/lwip-1.4.1/src/core/memp.c index 8f31a07edd..9f680e244f 100644 --- a/components/net/lwip-1.4.1/src/core/memp.c +++ b/components/net/lwip-1.4.1/src/core/memp.c @@ -8,9 +8,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -19,21 +19,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -155,19 +155,19 @@ static const char *memp_desc[MEMP_MAX] = { * extern u8_t __attribute__((section(".onchip_mem"))) memp_memory_UDP_PCB_base[]; */ #define LWIP_MEMPOOL(name,num,size,desc) u8_t memp_memory_ ## name ## _base \ - [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))]; + [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))]; #include "lwip/memp_std.h" /** This array holds the base of each memory pool. */ -static u8_t *const memp_bases[] = { -#define LWIP_MEMPOOL(name,num,size,desc) memp_memory_ ## name ## _base, +static u8_t *const memp_bases[] = { +#define LWIP_MEMPOOL(name,num,size,desc) memp_memory_ ## name ## _base, #include "lwip/memp_std.h" }; #else /* MEMP_SEPARATE_POOLS */ /** This is the actual memory used by the pools (all pools in one big block). */ -static u8_t memp_memory[MEM_ALIGNMENT - 1 +static u8_t memp_memory[MEM_ALIGNMENT - 1 #define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) ) #include "lwip/memp_std.h" ]; @@ -331,7 +331,7 @@ memp_overflow_init(void) /** * Initialize this module. - * + * * Carves out memp_memory into linked lists for each pool-type. */ void @@ -394,7 +394,7 @@ memp_malloc_fn(memp_t type, const char* file, const int line) { struct memp *memp; SYS_ARCH_DECL_PROTECT(old_level); - + LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;); SYS_ARCH_PROTECT(old_level); @@ -403,7 +403,7 @@ memp_malloc_fn(memp_t type, const char* file, const int line) #endif /* MEMP_OVERFLOW_CHECK >= 2 */ memp = memp_tab[type]; - + if (memp != NULL) { memp_tab[type] = memp->next; #if MEMP_OVERFLOW_CHECK @@ -455,9 +455,9 @@ memp_free(memp_t type, void *mem) #endif /* MEMP_OVERFLOW_CHECK >= 2 */ #endif /* MEMP_OVERFLOW_CHECK */ - MEMP_STATS_DEC(used, type); - - memp->next = memp_tab[type]; + MEMP_STATS_DEC(used, type); + + memp->next = memp_tab[type]; memp_tab[type] = memp; #if MEMP_SANITY_CHECK diff --git a/components/net/lwip-1.4.1/src/core/netif.c b/components/net/lwip-1.4.1/src/core/netif.c index 416c118c82..9c3e32b33f 100644 --- a/components/net/lwip-1.4.1/src/core/netif.c +++ b/components/net/lwip-1.4.1/src/core/netif.c @@ -71,13 +71,13 @@ #define NETIF_STATUS_CALLBACK(n) do{ if (n->status_callback) { (n->status_callback)(n); }}while(0) #else #define NETIF_STATUS_CALLBACK(n) -#endif /* LWIP_NETIF_STATUS_CALLBACK */ +#endif /* LWIP_NETIF_STATUS_CALLBACK */ #if LWIP_NETIF_LINK_CALLBACK #define NETIF_LINK_CALLBACK(n) do{ if (n->link_callback) { (n->link_callback)(n); }}while(0) #else #define NETIF_LINK_CALLBACK(n) -#endif /* LWIP_NETIF_LINK_CALLBACK */ +#endif /* LWIP_NETIF_LINK_CALLBACK */ struct netif *netif_list; struct netif *netif_default; @@ -466,17 +466,17 @@ netif_set_default(struct netif *netif) /** * Bring an interface up, available for processing * traffic. - * + * * @note: Enabling DHCP on a down interface will make it come * up once configured. - * + * * @see dhcp_start() - */ + */ void netif_set_up(struct netif *netif) { if (!(netif->flags & NETIF_FLAG_UP)) { netif->flags |= NETIF_FLAG_UP; - + #if LWIP_SNMP snmp_get_sysuptime(&netif->ts); #endif /* LWIP_SNMP */ @@ -485,7 +485,7 @@ void netif_set_up(struct netif *netif) if (netif->flags & NETIF_FLAG_LINK_UP) { #if LWIP_ARP - /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ + /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ if (netif->flags & (NETIF_FLAG_ETHARP)) { etharp_gratuitous(netif); } @@ -511,9 +511,9 @@ void netif_set_up(struct netif *netif) * * @note: Enabling DHCP on a down interface will make it come * up once configured. - * + * * @see dhcp_start() - */ + */ void netif_set_down(struct netif *netif) { if (netif->flags & NETIF_FLAG_UP) { @@ -583,7 +583,7 @@ void netif_set_link_up(struct netif *netif ) if (netif->flags & NETIF_FLAG_UP) { #if LWIP_ARP - /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ + /* For Ethernet network interfaces, we would like to send a "gratuitous ARP" */ if (netif->flags & NETIF_FLAG_ETHARP) { etharp_gratuitous(netif); } diff --git a/components/net/lwip-1.4.1/src/core/pbuf.c b/components/net/lwip-1.4.1/src/core/pbuf.c index 0c3e91f1f1..1e5e53b12a 100644 --- a/components/net/lwip-1.4.1/src/core/pbuf.c +++ b/components/net/lwip-1.4.1/src/core/pbuf.c @@ -12,13 +12,13 @@ * * Multiple packets may be queued, also using this singly linked list. * This is called a "packet queue". - * + * * So, a packet queue consists of one or more pbuf chains, each of * which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE * NOT SUPPORTED!!! Use helper structs to queue multiple packets. - * + * * The differences between a pbuf chain and a packet queue are very - * precise but subtle. + * precise but subtle. * * The last pbuf of a packet has a ->tot_len field that equals the * ->len field. It can be found by traversing the list. If the last @@ -518,7 +518,7 @@ pbuf_header(struct pbuf *p, s16_t header_size_increment) if ((header_size_increment == 0) || (p == NULL)) { return 0; } - + if (header_size_increment < 0){ increment_magnitude = -header_size_increment; /* Check that we aren't going to move off the end of the pbuf */ @@ -529,7 +529,7 @@ pbuf_header(struct pbuf *p, s16_t header_size_increment) /* Can't assert these as some callers speculatively call pbuf_header() to see if it's OK. Will return 1 below instead. */ /* Check that we've got the correct type of pbuf to work with */ - LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL", + LWIP_ASSERT("p->type == PBUF_RAM || p->type == PBUF_POOL", p->type == PBUF_RAM || p->type == PBUF_POOL); /* Check that we aren't going to move off the beginning of the pbuf */ LWIP_ASSERT("p->payload - increment_magnitude >= p + SIZEOF_STRUCT_PBUF", @@ -606,7 +606,7 @@ pbuf_header(struct pbuf *p, s16_t header_size_increment) * * Assuming existing chains a->b->c with the following reference * counts, calling pbuf_free(a) results in: - * + * * 1->2->3 becomes ...1->3 * 3->3->3 becomes 2->3->3 * 1->1->2 becomes ......1 @@ -734,10 +734,10 @@ pbuf_ref(struct pbuf *p) /** * Concatenate two pbufs (each may be a pbuf chain) and take over * the caller's reference of the tail pbuf. - * + * * @note The caller MAY NOT reference the tail pbuf afterwards. * Use pbuf_chain() for that purpose. - * + * * @see pbuf_chain() */ @@ -768,10 +768,10 @@ pbuf_cat(struct pbuf *h, struct pbuf *t) /** * Chain two pbufs (or pbuf chains) together. - * + * * The caller MUST call pbuf_free(t) once it has stopped * using it. Use pbuf_cat() instead if you no longer use t. - * + * * @param h head pbuf (chain) * @param t tail pbuf (chain) * @note The pbufs MUST belong to the same packet. @@ -909,7 +909,7 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from) * * @param buf the pbuf from which to copy data * @param dataptr the application supplied buffer - * @param len length of data to copy (dataptr must be big enough). No more + * @param len length of data to copy (dataptr must be big enough). No more * than buf->tot_len will be copied, irrespective of len * @param offset offset into the packet buffer from where to begin copying len bytes * @return the number of bytes copied, or 0 on failure diff --git a/components/net/lwip-1.4.1/src/core/raw.c b/components/net/lwip-1.4.1/src/core/raw.c index e9dcda3237..7160c0fbd9 100644 --- a/components/net/lwip-1.4.1/src/core/raw.c +++ b/components/net/lwip-1.4.1/src/core/raw.c @@ -168,14 +168,14 @@ raw_connect(struct raw_pcb *pcb, ip_addr_t *ipaddr) /** * Set the callback function for received packets that match the - * raw PCB's protocol and binding. - * + * raw PCB's protocol and binding. + * * The callback function MUST either * - eat the packet by calling pbuf_free() and returning non-zero. The * packet will not be passed to other raw PCBs or other protocol layers. * - not free the packet, and return zero. The packet will be matched * against further PCBs and/or forwarded to another protocol layers. - * + * * @return non-zero if the packet was free()d, zero if the packet remains * available for others. */ @@ -206,9 +206,9 @@ raw_sendto(struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr) struct netif *netif; ip_addr_t *src_ip; struct pbuf *q; /* q will be sent down the stack */ - + LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_sendto\n")); - + /* not enough space to add an IP header to first pbuf in given p chain? */ if (pbuf_header(p, IP_HLEN)) { /* allocate header in new pbuf */ diff --git a/components/net/lwip-1.4.1/src/core/stats.c b/components/net/lwip-1.4.1/src/core/stats.c index 6aa59e0930..8ea8249767 100644 --- a/components/net/lwip-1.4.1/src/core/stats.c +++ b/components/net/lwip-1.4.1/src/core/stats.c @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -72,18 +72,18 @@ void stats_display_proto(struct stats_proto *proto, const char *name) { LWIP_PLATFORM_DIAG(("\n%s\n\t", name)); - LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); - LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); - LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); - LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); - LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); - LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); - LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); - LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); - LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); - LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); - LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); - LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); + LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", proto->xmit)); + LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", proto->recv)); + LWIP_PLATFORM_DIAG(("fw: %"STAT_COUNTER_F"\n\t", proto->fw)); + LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", proto->drop)); + LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", proto->chkerr)); + LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", proto->lenerr)); + LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", proto->memerr)); + LWIP_PLATFORM_DIAG(("rterr: %"STAT_COUNTER_F"\n\t", proto->rterr)); + LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", proto->proterr)); + LWIP_PLATFORM_DIAG(("opterr: %"STAT_COUNTER_F"\n\t", proto->opterr)); + LWIP_PLATFORM_DIAG(("err: %"STAT_COUNTER_F"\n\t", proto->err)); + LWIP_PLATFORM_DIAG(("cachehit: %"STAT_COUNTER_F"\n", proto->cachehit)); } #if IGMP_STATS @@ -91,20 +91,20 @@ void stats_display_igmp(struct stats_igmp *igmp) { LWIP_PLATFORM_DIAG(("\nIGMP\n\t")); - LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", igmp->xmit)); - LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", igmp->recv)); - LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", igmp->drop)); - LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); - LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); - LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", igmp->memerr)); - LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", igmp->proterr)); - LWIP_PLATFORM_DIAG(("rx_v1: %"STAT_COUNTER_F"\n\t", igmp->rx_v1)); + LWIP_PLATFORM_DIAG(("xmit: %"STAT_COUNTER_F"\n\t", igmp->xmit)); + LWIP_PLATFORM_DIAG(("recv: %"STAT_COUNTER_F"\n\t", igmp->recv)); + LWIP_PLATFORM_DIAG(("drop: %"STAT_COUNTER_F"\n\t", igmp->drop)); + LWIP_PLATFORM_DIAG(("chkerr: %"STAT_COUNTER_F"\n\t", igmp->chkerr)); + LWIP_PLATFORM_DIAG(("lenerr: %"STAT_COUNTER_F"\n\t", igmp->lenerr)); + LWIP_PLATFORM_DIAG(("memerr: %"STAT_COUNTER_F"\n\t", igmp->memerr)); + LWIP_PLATFORM_DIAG(("proterr: %"STAT_COUNTER_F"\n\t", igmp->proterr)); + LWIP_PLATFORM_DIAG(("rx_v1: %"STAT_COUNTER_F"\n\t", igmp->rx_v1)); LWIP_PLATFORM_DIAG(("rx_group: %"STAT_COUNTER_F"\n", igmp->rx_group)); LWIP_PLATFORM_DIAG(("rx_general: %"STAT_COUNTER_F"\n", igmp->rx_general)); - LWIP_PLATFORM_DIAG(("rx_report: %"STAT_COUNTER_F"\n\t", igmp->rx_report)); - LWIP_PLATFORM_DIAG(("tx_join: %"STAT_COUNTER_F"\n\t", igmp->tx_join)); - LWIP_PLATFORM_DIAG(("tx_leave: %"STAT_COUNTER_F"\n\t", igmp->tx_leave)); - LWIP_PLATFORM_DIAG(("tx_report: %"STAT_COUNTER_F"\n\t", igmp->tx_report)); + LWIP_PLATFORM_DIAG(("rx_report: %"STAT_COUNTER_F"\n\t", igmp->rx_report)); + LWIP_PLATFORM_DIAG(("tx_join: %"STAT_COUNTER_F"\n\t", igmp->tx_join)); + LWIP_PLATFORM_DIAG(("tx_leave: %"STAT_COUNTER_F"\n\t", igmp->tx_leave)); + LWIP_PLATFORM_DIAG(("tx_report: %"STAT_COUNTER_F"\n\t", igmp->tx_report)); } #endif /* IGMP_STATS */ @@ -113,9 +113,9 @@ void stats_display_mem(struct stats_mem *mem, const char *name) { LWIP_PLATFORM_DIAG(("\nMEM %s\n\t", name)); - LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); - LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); - LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); + LWIP_PLATFORM_DIAG(("avail: %"U32_F"\n\t", (u32_t)mem->avail)); + LWIP_PLATFORM_DIAG(("used: %"U32_F"\n\t", (u32_t)mem->used)); + LWIP_PLATFORM_DIAG(("max: %"U32_F"\n\t", (u32_t)mem->max)); LWIP_PLATFORM_DIAG(("err: %"U32_F"\n", (u32_t)mem->err)); } @@ -139,15 +139,15 @@ void stats_display_sys(struct stats_sys *sys) { LWIP_PLATFORM_DIAG(("\nSYS\n\t")); - LWIP_PLATFORM_DIAG(("sem.used: %"U32_F"\n\t", (u32_t)sys->sem.used)); - LWIP_PLATFORM_DIAG(("sem.max: %"U32_F"\n\t", (u32_t)sys->sem.max)); - LWIP_PLATFORM_DIAG(("sem.err: %"U32_F"\n\t", (u32_t)sys->sem.err)); - LWIP_PLATFORM_DIAG(("mutex.used: %"U32_F"\n\t", (u32_t)sys->mutex.used)); - LWIP_PLATFORM_DIAG(("mutex.max: %"U32_F"\n\t", (u32_t)sys->mutex.max)); - LWIP_PLATFORM_DIAG(("mutex.err: %"U32_F"\n\t", (u32_t)sys->mutex.err)); - LWIP_PLATFORM_DIAG(("mbox.used: %"U32_F"\n\t", (u32_t)sys->mbox.used)); - LWIP_PLATFORM_DIAG(("mbox.max: %"U32_F"\n\t", (u32_t)sys->mbox.max)); - LWIP_PLATFORM_DIAG(("mbox.err: %"U32_F"\n\t", (u32_t)sys->mbox.err)); + LWIP_PLATFORM_DIAG(("sem.used: %"U32_F"\n\t", (u32_t)sys->sem.used)); + LWIP_PLATFORM_DIAG(("sem.max: %"U32_F"\n\t", (u32_t)sys->sem.max)); + LWIP_PLATFORM_DIAG(("sem.err: %"U32_F"\n\t", (u32_t)sys->sem.err)); + LWIP_PLATFORM_DIAG(("mutex.used: %"U32_F"\n\t", (u32_t)sys->mutex.used)); + LWIP_PLATFORM_DIAG(("mutex.max: %"U32_F"\n\t", (u32_t)sys->mutex.max)); + LWIP_PLATFORM_DIAG(("mutex.err: %"U32_F"\n\t", (u32_t)sys->mutex.err)); + LWIP_PLATFORM_DIAG(("mbox.used: %"U32_F"\n\t", (u32_t)sys->mbox.used)); + LWIP_PLATFORM_DIAG(("mbox.max: %"U32_F"\n\t", (u32_t)sys->mbox.max)); + LWIP_PLATFORM_DIAG(("mbox.err: %"U32_F"\n\t", (u32_t)sys->mbox.err)); } #endif /* SYS_STATS */ diff --git a/components/net/lwip-1.4.1/src/core/tcp.c b/components/net/lwip-1.4.1/src/core/tcp.c index 105b68e74c..b710d2e2a4 100644 --- a/components/net/lwip-1.4.1/src/core/tcp.c +++ b/components/net/lwip-1.4.1/src/core/tcp.c @@ -10,9 +10,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -21,21 +21,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -72,17 +72,17 @@ #endif /* LWIP_TCP_KEEPALIVE */ const char * const tcp_state_str[] = { - "CLOSED", - "LISTEN", - "SYN_SENT", - "SYN_RCVD", - "ESTABLISHED", - "FIN_WAIT_1", - "FIN_WAIT_2", - "CLOSE_WAIT", - "CLOSING", - "LAST_ACK", - "TIME_WAIT" + "CLOSED", + "LISTEN", + "SYN_SENT", + "SYN_RCVD", + "ESTABLISHED", + "FIN_WAIT_1", + "FIN_WAIT_2", + "CLOSE_WAIT", + "CLOSING", + "LAST_ACK", + "TIME_WAIT" }; /* last local TCP port */ @@ -118,7 +118,7 @@ struct tcp_pcb *tcp_tmp_pcb; u8_t tcp_active_pcbs_changed; -/** Timer counter to handle calling slow-timer from tcp_tmr() */ +/** Timer counter to handle calling slow-timer from tcp_tmr() */ static u8_t tcp_timer; static u8_t tcp_timer_ctr; static u16_t tcp_new_port(void); @@ -202,7 +202,7 @@ tcp_close_shutdown(struct tcp_pcb *pcb, u8_t rst_on_unacked_data) * however, it is in this state once allocated and as yet unused * and the user needs some way to free it should the need arise. * Calling tcp_close() with a pcb that has already been closed, (i.e. twice) - * or for a pcb that has been used and then entered the CLOSED state + * or for a pcb that has been used and then entered the CLOSED state * is erroneous, but this should never happen as the pcb has in those cases * been freed, and so any remaining handles are bogus. */ err = ERR_OK; @@ -357,7 +357,7 @@ void tcp_abandon(struct tcp_pcb *pcb, int reset) { u32_t seqno, ackno; -#if LWIP_CALLBACK_API +#if LWIP_CALLBACK_API tcp_err_fn errf; #endif /* LWIP_CALLBACK_API */ void *errf_arg; @@ -385,7 +385,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset) if (pcb->unsent != NULL) { tcp_segs_free(pcb->unsent); } -#if TCP_QUEUE_OOSEQ +#if TCP_QUEUE_OOSEQ if (pcb->ooseq != NULL) { tcp_segs_free(pcb->ooseq); } @@ -570,7 +570,7 @@ tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog) return (struct tcp_pcb *)lpcb; } -/** +/** * Update the state that tracks the available window space to advertise. * * Returns how much extra window would be advertised if we sent an @@ -649,7 +649,7 @@ tcp_new_port(void) u8_t i; u16_t n = 0; struct tcp_pcb *pcb; - + again: if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) { tcp_port = TCP_LOCAL_PORT_RANGE_START; @@ -757,7 +757,7 @@ tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port, pcb->ssthresh = pcb->mss * 10; #if LWIP_CALLBACK_API pcb->connected = connected; -#else /* LWIP_CALLBACK_API */ +#else /* LWIP_CALLBACK_API */ LWIP_UNUSED_ARG(connected); #endif /* LWIP_CALLBACK_API */ @@ -870,7 +870,7 @@ tcp_slowtmr_start: LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_slowtmr: cwnd %"U16_F " ssthresh %"U16_F"\n", pcb->cwnd, pcb->ssthresh)); - + /* The following needs to be called AFTER cwnd is set to one mss - STJ */ tcp_rexmit_rto(pcb); @@ -901,11 +901,11 @@ tcp_slowtmr_start: LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: KEEPALIVE timeout. Aborting connection to %"U16_F".%"U16_F".%"U16_F".%"U16_F".\n", ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); - + ++pcb_remove; ++pcb_reset; } - else if((u32_t)(tcp_ticks - pcb->tmr) > + else if((u32_t)(tcp_ticks - pcb->tmr) > (pcb->keep_idle + pcb->keep_cnt_sent * TCP_KEEP_INTVL(pcb)) / TCP_SLOW_INTERVAL) { @@ -998,7 +998,7 @@ tcp_slowtmr_start: } } - + /* Steps through all of the TIME-WAIT PCBs. */ prev = NULL; pcb = tcp_tw_pcbs; @@ -1010,7 +1010,7 @@ tcp_slowtmr_start: if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL / TCP_SLOW_INTERVAL) { ++pcb_remove; } - + /* If the PCB should be removed, do it. */ @@ -1172,7 +1172,7 @@ tcp_setprio(struct tcp_pcb *pcb, u8_t prio) * * @param seg the old tcp_seg * @return a copy of seg - */ + */ struct tcp_seg * tcp_seg_copy(struct tcp_seg *seg) { @@ -1182,7 +1182,7 @@ tcp_seg_copy(struct tcp_seg *seg) if (cseg == NULL) { return NULL; } - SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); + SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg)); pbuf_ref(cseg->p); return cseg; } @@ -1222,7 +1222,7 @@ tcp_kill_prio(u8_t prio) mprio = TCP_PRIO_MAX; - + /* We kill the oldest active connection that has lower priority than prio. */ inactivity = 0; inactive = NULL; @@ -1279,7 +1279,7 @@ tcp_alloc(u8_t prio) { struct tcp_pcb *pcb; u32_t iss; - + pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); if (pcb == NULL) { /* Try killing oldest connection in TIME-WAIT. */ @@ -1324,7 +1324,7 @@ tcp_alloc(u8_t prio) pcb->snd_wl2 = iss; pcb->snd_nxt = iss; pcb->lastack = iss; - pcb->snd_lbb = iss; + pcb->snd_lbb = iss; pcb->tmr = tcp_ticks; pcb->last_timer = tcp_timer_ctr; @@ -1332,11 +1332,11 @@ tcp_alloc(u8_t prio) #if LWIP_CALLBACK_API pcb->recv = tcp_recv_null; -#endif /* LWIP_CALLBACK_API */ - +#endif /* LWIP_CALLBACK_API */ + /* Init KEEPALIVE timer */ pcb->keep_idle = TCP_KEEPIDLE_DEFAULT; - + #if LWIP_TCP_KEEPALIVE pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT; pcb->keep_cnt = TCP_KEEPCNT_DEFAULT; @@ -1371,7 +1371,7 @@ tcp_new(void) * * @param pcb tcp_pcb to set the callback argument * @param arg void pointer argument to pass to callback functions - */ + */ void tcp_arg(struct tcp_pcb *pcb, void *arg) { @@ -1387,7 +1387,7 @@ tcp_arg(struct tcp_pcb *pcb, void *arg) * * @param pcb tcp_pcb to set the recv callback * @param recv callback function to call for this pcb when data is received - */ + */ void tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv) { @@ -1401,7 +1401,7 @@ tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv) * * @param pcb tcp_pcb to set the sent callback * @param sent callback function to call for this pcb when data is successfully sent - */ + */ void tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) { @@ -1416,7 +1416,7 @@ tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) * @param pcb tcp_pcb to set the err callback * @param err callback function to call for this pcb when a fatal error * has occured on the connection - */ + */ void tcp_err(struct tcp_pcb *pcb, tcp_err_fn err) { @@ -1431,7 +1431,7 @@ tcp_err(struct tcp_pcb *pcb, tcp_err_fn err) * @param pcb tcp_pcb to set the accept callback * @param accept callback function to call for this pcb when LISTENing * connection has been connected to another host - */ + */ void tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) { @@ -1447,16 +1447,16 @@ tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) * from TCP. The interval is specified in terms of the TCP coarse * timer interval, which is called twice a second. * - */ + */ void tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval) { LWIP_ASSERT("invalid socket state for poll", pcb->state != LISTEN); #if LWIP_CALLBACK_API pcb->poll = poll; -#else /* LWIP_CALLBACK_API */ +#else /* LWIP_CALLBACK_API */ LWIP_UNUSED_ARG(poll); -#endif /* LWIP_CALLBACK_API */ +#endif /* LWIP_CALLBACK_API */ pcb->pollinterval = interval; } @@ -1540,7 +1540,7 @@ tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb) TCP_RMV(pcblist, pcb); tcp_pcb_purge(pcb); - + /* if there is an outstanding delayed ACKs, send it */ if (pcb->state != TIME_WAIT && pcb->state != LISTEN && @@ -1571,7 +1571,7 @@ u32_t tcp_next_iss(void) { static u32_t iss = 6510; - + iss += tcp_ticks; /* XXX */ return iss; } @@ -1703,21 +1703,21 @@ tcp_debug_print_pcbs(void) pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); tcp_debug_print_state(pcb->state); - } + } LWIP_DEBUGF(TCP_DEBUG, ("Listen PCB states:\n")); for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) { LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F", foreign port %"U16_F" snd_nxt %"U32_F" rcv_nxt %"U32_F" ", pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); tcp_debug_print_state(pcb->state); - } + } LWIP_DEBUGF(TCP_DEBUG, ("TIME-WAIT PCB states:\n")); for(pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) { LWIP_DEBUGF(TCP_DEBUG, ("Local port %"U16_F", foreign port %"U16_F" snd_nxt %"U32_F" rcv_nxt %"U32_F" ", pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); tcp_debug_print_state(pcb->state); - } + } } /** diff --git a/components/net/lwip-1.4.1/src/core/tcp_in.c b/components/net/lwip-1.4.1/src/core/tcp_in.c index 051869ff96..4ec971ac0f 100644 --- a/components/net/lwip-1.4.1/src/core/tcp_in.c +++ b/components/net/lwip-1.4.1/src/core/tcp_in.c @@ -6,7 +6,7 @@ * * These functions are generally called in the order (ip_input() ->) * tcp_input() -> * tcp_process() -> tcp_receive() (-> application). - * + * */ /* @@ -166,7 +166,7 @@ tcp_input(struct pbuf *p, struct netif *inp) for an active connection. */ prev = NULL; - + for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) { LWIP_ASSERT("tcp_input: active pcb->state != CLOSED", pcb->state != CLOSED); LWIP_ASSERT("tcp_input: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT); @@ -253,7 +253,7 @@ tcp_input(struct pbuf *p, struct netif *inp) /* put this listening pcb at the head of the listening list */ tcp_listen_pcbs.listen_pcbs = lpcb; } - + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n")); tcp_listen_input(lpcb); pbuf_free(p); @@ -588,7 +588,7 @@ tcp_process(struct tcp_pcb *pcb) acceptable = 1; } } else { - if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt+pcb->rcv_wnd)) { acceptable = 1; } @@ -609,12 +609,12 @@ tcp_process(struct tcp_pcb *pcb) } } - if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) { + if ((flags & TCP_SYN) && (pcb->state != SYN_SENT && pcb->state != SYN_RCVD)) { /* Cope with new connection attempt after remote end crashed */ tcp_ack_now(pcb); return ERR_OK; } - + if ((pcb->flags & TF_RXCLOSED) == 0) { /* Update the PCB (in)activity timer unless rx is closed (see tcp_shutdown) */ pcb->tmr = tcp_ticks; @@ -892,7 +892,7 @@ tcp_receive(struct tcp_pcb *pcb) #if TCP_WND_DEBUG } else { if (pcb->snd_wnd != tcphdr->wnd) { - LWIP_DEBUGF(TCP_WND_DEBUG, + LWIP_DEBUGF(TCP_WND_DEBUG, ("tcp_receive: no window update lastack %"U32_F" ackno %" U32_F" wl1 %"U32_F" seqno %"U32_F" wl2 %"U32_F"\n", pcb->lastack, ackno, pcb->snd_wl1, seqno, pcb->snd_wl2)); @@ -902,17 +902,17 @@ tcp_receive(struct tcp_pcb *pcb) /* (From Stevens TCP/IP Illustrated Vol II, p970.) Its only a * duplicate ack if: - * 1) It doesn't ACK new data - * 2) length of received packet is zero (i.e. no payload) - * 3) the advertised window hasn't changed + * 1) It doesn't ACK new data + * 2) length of received packet is zero (i.e. no payload) + * 3) the advertised window hasn't changed * 4) There is outstanding unacknowledged data (retransmission timer running) * 5) The ACK is == biggest ACK sequence number so far seen (snd_una) - * - * If it passes all five, should process as a dupack: - * a) dupacks < 3: do nothing - * b) dupacks == 3: fast retransmit - * c) dupacks > 3: increase cwnd - * + * + * If it passes all five, should process as a dupack: + * a) dupacks < 3: do nothing + * b) dupacks == 3: fast retransmit + * c) dupacks > 3: increase cwnd + * * If it only passes 1-3, should reset dupack counter (and add to * stats, which we don't do in lwIP) * @@ -1053,7 +1053,7 @@ tcp_receive(struct tcp_pcb *pcb) ->unsent list after a retransmission, so these segments may in fact have been sent once. */ while (pcb->unsent != NULL && - TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) + + TCP_SEQ_BETWEEN(ackno, ntohl(pcb->unsent->tcphdr->seqno) + TCP_TCPLEN(pcb->unsent), pcb->snd_nxt)) { LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->unsent\n", ntohl(pcb->unsent->tcphdr->seqno), ntohl(pcb->unsent->tcphdr->seqno) + @@ -1065,7 +1065,7 @@ tcp_receive(struct tcp_pcb *pcb) if (pcb->unsent == NULL) { pcb->unsent_oversize = 0; } -#endif /* TCP_OVERSIZE */ +#endif /* TCP_OVERSIZE */ LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"U16_F" ... ", (u16_t)pcb->snd_queuelen)); LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= pbuf_clen(next->p))); /* Prevent ACK for FIN to generate a sent event */ @@ -1211,7 +1211,7 @@ tcp_receive(struct tcp_pcb *pcb) /* The sequence number must be within the window (above rcv_nxt and below rcv_nxt + rcv_wnd) in order to be further processed. */ - if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, + if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt + pcb->rcv_wnd - 1)){ if (pcb->rcv_nxt == seqno) { /* The incoming segment is the next in sequence. We check if @@ -1220,12 +1220,12 @@ tcp_receive(struct tcp_pcb *pcb) tcplen = TCP_TCPLEN(&inseg); if (tcplen > pcb->rcv_wnd) { - LWIP_DEBUGF(TCP_INPUT_DEBUG, + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: other end overran receive window" "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { - /* Must remove the FIN from the header as we're trimming + /* Must remove the FIN from the header as we're trimming * that byte of sequence-space from the packet */ TCPH_FLAGS_SET(inseg.tcphdr, TCPH_FLAGS(inseg.tcphdr) &~ TCP_FIN); } @@ -1245,7 +1245,7 @@ tcp_receive(struct tcp_pcb *pcb) - inseq overlaps with ooseq */ if (pcb->ooseq != NULL) { if (TCPH_FLAGS(inseg.tcphdr) & TCP_FIN) { - LWIP_DEBUGF(TCP_INPUT_DEBUG, + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: received in-order FIN, binning ooseq queue\n")); /* Received in-order FIN means anything that was received * out of order must now have been received in-order, so @@ -1352,7 +1352,7 @@ tcp_receive(struct tcp_pcb *pcb) recv_flags |= TF_GOT_FIN; if (pcb->state == ESTABLISHED) { /* force passive close or we can move to active close */ pcb->state = CLOSE_WAIT; - } + } } pcb->ooseq = cseg->next; @@ -1465,12 +1465,12 @@ tcp_receive(struct tcp_pcb *pcb) } /* check if the remote side overruns our receive window */ if ((u32_t)tcplen + seqno > pcb->rcv_nxt + (u32_t)pcb->rcv_wnd) { - LWIP_DEBUGF(TCP_INPUT_DEBUG, + LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: other end overran receive window" "seqno %"U32_F" len %"U16_F" right edge %"U32_F"\n", seqno, tcplen, pcb->rcv_nxt + pcb->rcv_wnd)); if (TCPH_FLAGS(next->next->tcphdr) & TCP_FIN) { - /* Must remove the FIN from the header as we're trimming + /* Must remove the FIN from the header as we're trimming * that byte of sequence-space from the packet */ TCPH_FLAGS_SET(next->next->tcphdr, TCPH_FLAGS(next->next->tcphdr) &~ TCP_FIN); } @@ -1531,7 +1531,7 @@ tcp_receive(struct tcp_pcb *pcb) } /** - * Parses the options contained in the incoming segment. + * Parses the options contained in the incoming segment. * * Called from tcp_listen_input() and tcp_process(). * Currently, only the MSS option is supported! @@ -1588,7 +1588,7 @@ tcp_parseopt(struct tcp_pcb *pcb) return; } /* TCP timestamp option with valid length */ - tsval = (opts[c+2]) | (opts[c+3] << 8) | + tsval = (opts[c+2]) | (opts[c+3] << 8) | (opts[c+4] << 16) | (opts[c+5] << 24); if (flags & TCP_SYN) { pcb->ts_recent = ntohl(tsval); diff --git a/components/net/lwip-1.4.1/src/core/tcp_out.c b/components/net/lwip-1.4.1/src/core/tcp_out.c index da9d72d531..1db3fae03f 100644 --- a/components/net/lwip-1.4.1/src/core/tcp_out.c +++ b/components/net/lwip-1.4.1/src/core/tcp_out.c @@ -197,7 +197,7 @@ tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, /* wnd and chksum are set in tcp_output */ seg->tcphdr->urgp = 0; return seg; -} +} /** * Allocate a PBUF_RAM pbuf, perhaps with extra space at the end. @@ -212,7 +212,7 @@ tcp_create_segment(struct tcp_pcb *pcb, struct pbuf *p, u8_t flags, u32_t seqno, * @param pcb The TCP connection that willo enqueue the pbuf. * @param apiflags API flags given to tcp_write. * @param first_seg true when this pbuf will be used in the first enqueued segment. - * @param + * @param */ #if TCP_OVERSIZE static struct pbuf * @@ -379,7 +379,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags) LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_write(pcb=%p, data=%p, len=%"U16_F", apiflags=%"U16_F")\n", (void *)pcb, arg, len, (u16_t)apiflags)); - LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)", + LWIP_ERROR("tcp_write: arg == NULL (programmer violates API)", arg != NULL, return ERR_ARG;); err = tcp_write_checks(pcb, len); @@ -857,7 +857,7 @@ tcp_send_empty_ack(struct tcp_pcb *pcb) return ERR_BUF; } tcphdr = (struct tcp_hdr *)p->payload; - LWIP_DEBUGF(TCP_OUTPUT_DEBUG, + LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt)); /* remove ACK flags from the PCB, as we send an empty ACK now */ pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW); @@ -869,7 +869,7 @@ tcp_send_empty_ack(struct tcp_pcb *pcb) if (pcb->flags & TF_TIMESTAMP) { tcp_build_timestamp_option(pcb, (u32_t *)(tcphdr + 1)); } -#endif +#endif #if CHECKSUM_GEN_TCP tcphdr->chksum = inet_chksum_pseudo(p, &(pcb->local_ip), &(pcb->remote_ip), @@ -950,7 +950,7 @@ tcp_output(struct tcp_pcb *pcb) ", seg == NULL, ack %"U32_F"\n", pcb->snd_wnd, pcb->cwnd, wnd, pcb->lastack)); } else { - LWIP_DEBUGF(TCP_CWND_DEBUG, + LWIP_DEBUGF(TCP_CWND_DEBUG, ("tcp_output: snd_wnd %"U16_F", cwnd %"U16_F", wnd %"U32_F ", effwnd %"U32_F", seq %"U32_F", ack %"U32_F"\n", pcb->snd_wnd, pcb->cwnd, wnd, @@ -961,7 +961,7 @@ tcp_output(struct tcp_pcb *pcb) /* data available and window allows it to be sent? */ while (seg != NULL && ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) { - LWIP_ASSERT("RST not expected here!", + LWIP_ASSERT("RST not expected here!", (TCPH_FLAGS(seg->tcphdr) & TCP_RST) == 0); /* Stop sending if the nagle algorithm would prevent it * Don't stop: @@ -1086,7 +1086,7 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb) } #endif - /* Set retransmission timer running if it is not currently enabled + /* Set retransmission timer running if it is not currently enabled This must be set before checking the route. */ if (pcb->rtime == -1) { pcb->rtime = 0; @@ -1251,7 +1251,7 @@ tcp_rexmit_rto(struct tcp_pcb *pcb) #if TCP_OVERSIZE && TCP_OVERSIZE_DBGCHECK /* if last unsent changed, we need to update unsent_oversize */ if (pcb->unsent == NULL) { - pcb->unsent_oversize = seg->oversize_left; + pcb->unsent_oversize = seg->oversize_left; } #endif /* TCP_OVERSIZE && TCP_OVERSIZE_DBGCHECK*/ /* unsent queue is the concatenated queue (of unacked, unsent) */ @@ -1323,12 +1323,12 @@ tcp_rexmit(struct tcp_pcb *pcb) * * @param pcb the tcp_pcb for which to retransmit the first unacked segment */ -void +void tcp_rexmit_fast(struct tcp_pcb *pcb) { if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) { /* This is fast retransmit. Retransmit the first unacked segment. */ - LWIP_DEBUGF(TCP_FR_DEBUG, + LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: dupacks %"U16_F" (%"U32_F "), fast retransmit %"U32_F"\n", (u16_t)pcb->dupacks, pcb->lastack, @@ -1342,19 +1342,19 @@ tcp_rexmit_fast(struct tcp_pcb *pcb) } else { pcb->ssthresh = pcb->cwnd / 2; } - + /* The minimum value for ssthresh should be 2 MSS */ if (pcb->ssthresh < 2*pcb->mss) { - LWIP_DEBUGF(TCP_FR_DEBUG, + LWIP_DEBUGF(TCP_FR_DEBUG, ("tcp_receive: The minimum value for ssthresh %"U16_F " should be min 2 mss %"U16_F"...\n", pcb->ssthresh, 2*pcb->mss)); pcb->ssthresh = 2*pcb->mss; } - + pcb->cwnd = pcb->ssthresh + 3 * pcb->mss; pcb->flags |= TF_INFR; - } + } } @@ -1376,12 +1376,12 @@ tcp_keepalive(struct tcp_pcb *pcb) ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); - LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F" pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", tcp_ticks, pcb->tmr, pcb->keep_cnt_sent)); - + p = tcp_output_alloc_header(pcb, 0, 0, htonl(pcb->snd_nxt - 1)); if(p == NULL) { - LWIP_DEBUGF(TCP_DEBUG, + LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: could not allocate memory for pbuf\n")); return; } @@ -1425,15 +1425,15 @@ tcp_zero_window_probe(struct tcp_pcb *pcb) u16_t len; u8_t is_fin; - LWIP_DEBUGF(TCP_DEBUG, + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: sending ZERO WINDOW probe to %" U16_F".%"U16_F".%"U16_F".%"U16_F"\n", ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip), ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip))); - LWIP_DEBUGF(TCP_DEBUG, + LWIP_DEBUGF(TCP_DEBUG, ("tcp_zero_window_probe: tcp_ticks %"U32_F - " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", + " pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n", tcp_ticks, pcb->tmr, pcb->keep_cnt_sent)); seg = pcb->unacked; diff --git a/components/net/lwip-1.4.1/src/core/udp.c b/components/net/lwip-1.4.1/src/core/udp.c index ae91c8622d..32c7d38403 100644 --- a/components/net/lwip-1.4.1/src/core/udp.c +++ b/components/net/lwip-1.4.1/src/core/udp.c @@ -100,7 +100,7 @@ udp_new_port(void) { u16_t n = 0; struct udp_pcb *pcb; - + again: if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) { udp_port = UDP_LOCAL_PORT_RANGE_START; @@ -207,7 +207,7 @@ udp_input(struct pbuf *p, struct netif *inp) /* all packets for DHCP_CLIENT_PORT not coming from DHCP_SERVER_PORT are dropped! */ if (src == DHCP_SERVER_PORT) { if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) { - /* accept the packe if + /* accept the packe if (- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY! - inp->dhcp->pcb->remote == ANY or iphdr->src */ if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) || @@ -253,9 +253,9 @@ udp_input(struct pbuf *p, struct netif *inp) (broadcast && (ip_addr_isany(&pcb->local_ip) || ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) { -#endif /* IP_SOF_BROADCAST_RECV */ +#endif /* IP_SOF_BROADCAST_RECV */ local_match = 1; - if ((uncon_pcb == NULL) && + if ((uncon_pcb == NULL) && ((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) { /* the first unconnected matching PCB */ uncon_pcb = pcb; @@ -482,7 +482,7 @@ udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, * * If the PCB already has a remote address association, it will * be restored after the data is sent. - * + * * @return lwIP error code (@see udp_send for possible error codes) * * @see udp_disconnect() udp_send() @@ -613,7 +613,7 @@ udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip, udphdr->src = htons(pcb->local_port); udphdr->dest = htons(dst_port); /* in UDP, 0 checksum means 'no checksum' */ - udphdr->chksum = 0x0000; + udphdr->chksum = 0x0000; /* Multicast Loop? */ #if LWIP_IGMP diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h index d00aa2ef3e..e62b72e8cd 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/autoip.h @@ -40,7 +40,7 @@ * Please coordinate changes and requests with Dominik Spies * */ - + #ifndef __LWIP_AUTOIP_H__ #define __LWIP_AUTOIP_H__ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h index 15641463ae..d47a7d8a2e 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/icmp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h index 57038f4fca..8aabac2481 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/igmp.h @@ -2,29 +2,29 @@ * Copyright (c) 2002 CITEL Technologies Ltd. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is a contribution to the lwIP TCP/IP stack. * The Swedish Institute of Computer Science and Adam Dunkels @@ -64,8 +64,8 @@ extern "C" { * these should really be linked from the interface, but * if we keep them separate we will not affect the lwip original code * too much - * - * There will be a group for the all systems group address but this + * + * There will be a group for the all systems group address but this * will not run the state machine as it is used to kick off reports * from all the other groups */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h index 213d47a6be..7bff49b59e 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h index 7c5d17e309..79a2d90f2f 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h index d88ab8a107..00c83a0a12 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -136,7 +136,7 @@ struct ip_hdr { PACK_STRUCT_FIELD(u16_t _chksum); /* source and destination IP addresses */ PACK_STRUCT_FIELD(ip_addr_p_t src); - PACK_STRUCT_FIELD(ip_addr_p_t dest); + PACK_STRUCT_FIELD(ip_addr_p_t dest); } PACK_STRUCT_STRUCT; PACK_STRUCT_END #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h index d6f1b77d37..77b5eb1eef 100644 --- a/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h +++ b/components/net/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Jani Monoses * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h index 4397d2e87a..87e9ffd964 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/icmp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h index 32a5261bde..de1a0b6361 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h index 73a1c5cc9e..a01cfc65b3 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -84,7 +84,7 @@ extern "C" { struct ip_hdr { #if BYTE_ORDER == LITTLE_ENDIAN u8_t tclass1:4, v:4; - u8_t flow1:4, tclass2:4; + u8_t flow1:4, tclass2:4; #else u8_t v:4, tclass1:4; u8_t tclass2:8, flow1:4; diff --git a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h index f5b606a860..b2d8ae566d 100644 --- a/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h +++ b/components/net/lwip-1.4.1/src/include/ipv6/lwip/ip_addr.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/api.h b/components/net/lwip-1.4.1/src/include/lwip/api.h index 63d99bf292..7a9fa9366c 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/api.h +++ b/components/net/lwip-1.4.1/src/include/lwip/api.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/api_msg.h b/components/net/lwip-1.4.1/src/include/lwip/api_msg.h index 3f063e2a64..f9e1c7d295 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/api_msg.h +++ b/components/net/lwip-1.4.1/src/include/lwip/api_msg.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/arch.h b/components/net/lwip-1.4.1/src/include/lwip/arch.h index 2c3eb47384..4d6df773fc 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/arch.h +++ b/components/net/lwip-1.4.1/src/include/lwip/arch.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -71,7 +71,7 @@ extern "C" { #ifndef LWIP_UNUSED_ARG #define LWIP_UNUSED_ARG(x) (void)x -#endif /* LWIP_UNUSED_ARG */ +#endif /* LWIP_UNUSED_ARG */ #ifdef LWIP_PROVIDE_ERRNO diff --git a/components/net/lwip-1.4.1/src/include/lwip/debug.h b/components/net/lwip-1.4.1/src/include/lwip/debug.h index aa96d1aebb..0fe041396f 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/debug.h +++ b/components/net/lwip-1.4.1/src/include/lwip/debug.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -66,7 +66,7 @@ #define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \ LWIP_PLATFORM_ASSERT(message); } while(0) #else /* LWIP_NOASSERT */ -#define LWIP_ASSERT(message, assertion) +#define LWIP_ASSERT(message, assertion) #endif /* LWIP_NOASSERT */ /** if "expression" isn't true, then print "message" and execute "handler" expression */ @@ -92,7 +92,7 @@ } while(0) #else /* LWIP_DEBUG */ -#define LWIP_DEBUGF(debug, message) +#define LWIP_DEBUGF(debug, message) #endif /* LWIP_DEBUG */ #endif /* __LWIP_DEBUG_H__ */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/def.h b/components/net/lwip-1.4.1/src/include/lwip/def.h index e695ed7ccd..73a1b560b3 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/def.h +++ b/components/net/lwip-1.4.1/src/include/lwip/def.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -52,7 +52,7 @@ extern "C" { #define LWIP_MAKE_U16(a, b) ((a << 8) | b) #else #define LWIP_MAKE_U16(a, b) ((b << 8) | a) -#endif +#endif #ifndef LWIP_PLATFORM_BYTESWAP #define LWIP_PLATFORM_BYTESWAP 0 diff --git a/components/net/lwip-1.4.1/src/include/lwip/dhcp.h b/components/net/lwip-1.4.1/src/include/lwip/dhcp.h index ca1c1de3db..32d93381d1 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/dhcp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/dhcp.h @@ -16,11 +16,11 @@ extern "C" { #endif /** period (in seconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_SECS 60 +#define DHCP_COARSE_TIMER_SECS 60 /** period (in milliseconds) of the application calling dhcp_coarse_tmr() */ #define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) /** period (in milliseconds) of the application calling dhcp_fine_tmr() */ -#define DHCP_FINE_TIMER_MSECS 500 +#define DHCP_FINE_TIMER_MSECS 500 #define DHCP_CHADDR_LEN 16U #define DHCP_SNAME_LEN 64U @@ -28,9 +28,9 @@ extern "C" { struct dhcp { - /** transaction identifier of last sent request */ + /** transaction identifier of last sent request */ u32_t xid; - /** our connection to the DHCP server */ + /** our connection to the DHCP server */ struct udp_pcb *pcb; /** incoming msg */ struct dhcp_msg *msg_in; @@ -53,7 +53,7 @@ struct dhcp ip_addr_t offered_ip_addr; ip_addr_t offered_sn_mask; ip_addr_t offered_gw_addr; - + u32_t offered_t0_lease; /* lease period (in seconds) */ u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ u32_t offered_t2_rebind; /* recommended rebind time (usually 66% of lease period) */ @@ -131,7 +131,7 @@ void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr); void dhcp_coarse_tmr(void); /** to be called every half second */ void dhcp_fine_tmr(void); - + /** DHCP message item offsets and length */ #define DHCP_OP_OFS 0 #define DHCP_HTYPE_OFS 1 @@ -152,7 +152,7 @@ void dhcp_fine_tmr(void); #define DHCP_COOKIE_OFS DHCP_MSG_LEN #define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4) -#define DHCP_CLIENT_PORT 68 +#define DHCP_CLIENT_PORT 68 #define DHCP_SERVER_PORT 67 /** DHCP client states */ @@ -173,7 +173,7 @@ void dhcp_fine_tmr(void); /** AUTOIP cooperatation flags */ #define DHCP_AUTOIP_COOP_STATE_OFF 0 #define DHCP_AUTOIP_COOP_STATE_ON 1 - + #define DHCP_BOOTREQUEST 1 #define DHCP_BOOTREPLY 2 @@ -198,7 +198,7 @@ void dhcp_fine_tmr(void); #define DHCP_OPTION_PAD 0 #define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ #define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_DNS_SERVER 6 +#define DHCP_OPTION_DNS_SERVER 6 #define DHCP_OPTION_HOSTNAME 12 #define DHCP_OPTION_IP_TTL 23 #define DHCP_OPTION_MTU 26 diff --git a/components/net/lwip-1.4.1/src/include/lwip/dns.h b/components/net/lwip-1.4.1/src/include/lwip/dns.h index 5d7945a739..6c7d9b0739 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/dns.h +++ b/components/net/lwip-1.4.1/src/include/lwip/dns.h @@ -1,7 +1,7 @@ /** * lwip DNS resolver header file. - * Author: Jim Pettinato + * Author: Jim Pettinato * April 2007 * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. diff --git a/components/net/lwip-1.4.1/src/include/lwip/err.h b/components/net/lwip-1.4.1/src/include/lwip/err.h index 1a5af39463..ac907729fc 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/err.h +++ b/components/net/lwip-1.4.1/src/include/lwip/err.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/init.h b/components/net/lwip-1.4.1/src/include/lwip/init.h index e5833e55c3..3238534542 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/init.h +++ b/components/net/lwip-1.4.1/src/include/lwip/init.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/mem.h b/components/net/lwip-1.4.1/src/include/lwip/mem.h index fec03bc8ab..5bb906b63f 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/mem.h +++ b/components/net/lwip-1.4.1/src/include/lwip/mem.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/memp.h b/components/net/lwip-1.4.1/src/include/lwip/memp.h index efad238a93..f0d0739943 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/memp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/memp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/memp_std.h b/components/net/lwip-1.4.1/src/include/lwip/memp_std.h index 7304e2c62e..461ed1acf8 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/memp_std.h +++ b/components/net/lwip-1.4.1/src/include/lwip/memp_std.h @@ -15,7 +15,7 @@ #define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size) #define LWIP_MALLOC_MEMPOOL_START #define LWIP_MALLOC_MEMPOOL_END -#endif /* LWIP_MALLOC_MEMPOOL */ +#endif /* LWIP_MALLOC_MEMPOOL */ #ifndef LWIP_PBUF_MEMPOOL /* This treats "pbuf pools" just like any other pool. diff --git a/components/net/lwip-1.4.1/src/include/lwip/netbuf.h b/components/net/lwip-1.4.1/src/include/lwip/netbuf.h index ddee0273e0..7d247d71b6 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netbuf.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netbuf.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/netdb.h b/components/net/lwip-1.4.1/src/include/lwip/netdb.h index 80040bbfcd..7587e2f2d1 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netdb.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netdb.h @@ -1,5 +1,5 @@ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -8,21 +8,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/netif.h b/components/net/lwip-1.4.1/src/include/lwip/netif.h index bd93112f8f..f7e4937453 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netif.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netif.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -290,7 +290,7 @@ void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn rem void netif_set_link_up(struct netif *netif); void netif_set_link_down(struct netif *netif); -/** Ask if a link is up */ +/** Ask if a link is up */ #define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) #if LWIP_NETIF_LINK_CALLBACK diff --git a/components/net/lwip-1.4.1/src/include/lwip/netifapi.h b/components/net/lwip-1.4.1/src/include/lwip/netifapi.h index 6ac16f3b5a..33318efaf6 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/netifapi.h +++ b/components/net/lwip-1.4.1/src/include/lwip/netifapi.h @@ -1,5 +1,5 @@ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -8,23 +8,23 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * */ - + #ifndef __LWIP_NETIFAPI_H__ #define __LWIP_NETIFAPI_H__ diff --git a/components/net/lwip-1.4.1/src/include/lwip/opt.h b/components/net/lwip-1.4.1/src/include/lwip/opt.h index 76490a1d28..b8ebec86b1 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/opt.h +++ b/components/net/lwip-1.4.1/src/include/lwip/opt.h @@ -6,9 +6,9 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -17,21 +17,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -60,7 +60,7 @@ #define SYS_LIGHTWEIGHT_PROT 0 #endif -/** +/** * NO_SYS==1: Provides VERY minimal functionality. Otherwise, * use lwIP facilities. */ @@ -183,8 +183,8 @@ /** * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * inlude path somewhere. + * by lwIP. If you set this to 1, you must have lwippools.h in your + * inlude path somewhere. */ #ifndef MEMP_USE_CUSTOM_POOLS #define MEMP_USE_CUSTOM_POOLS 0 @@ -334,7 +334,7 @@ /** * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. + * for callback/timeout API communication. * (only needed if you use tcpip.c) */ #ifndef MEMP_NUM_TCPIP_MSG_API @@ -343,7 +343,7 @@ /** * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. + * for incoming packets. * (only needed if you use tcpip.c) */ #ifndef MEMP_NUM_TCPIP_MSG_INPKT @@ -408,7 +408,7 @@ #endif /** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. + * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #ifndef PBUF_POOL_SIZE #define PBUF_POOL_SIZE 16 @@ -751,7 +751,7 @@ #endif /** - * SNMP_PRIVATE_MIB: + * SNMP_PRIVATE_MIB: * When using a private MIB, you have to create a file 'private_mib.h' that contains * a 'struct mib_array_node mib_private' which contains your MIB. */ @@ -799,7 +799,7 @@ ---------------------------------- */ /** - * LWIP_IGMP==1: Turn on IGMP module. + * LWIP_IGMP==1: Turn on IGMP module. */ #ifndef LWIP_IGMP #define LWIP_IGMP 0 @@ -916,12 +916,12 @@ #endif /** - * TCP_WND: The size of a TCP window. This must be at least + * TCP_WND: The size of a TCP window. This must be at least * (2 * TCP_MSS) for things to work well */ #ifndef TCP_WND #define TCP_WND (4 * TCP_MSS) -#endif +#endif /** * TCP_MAXRTX: Maximum number of retransmissions of data segments. @@ -1790,14 +1790,14 @@ #ifndef CHECKSUM_GEN_IP #define CHECKSUM_GEN_IP 1 #endif - + /** * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. */ #ifndef CHECKSUM_GEN_UDP #define CHECKSUM_GEN_UDP 1 #endif - + /** * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. */ @@ -1811,14 +1811,14 @@ #ifndef CHECKSUM_GEN_ICMP #define CHECKSUM_GEN_ICMP 1 #endif - + /** * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. */ #ifndef CHECKSUM_CHECK_IP #define CHECKSUM_CHECK_IP 1 #endif - + /** * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/pbuf.h b/components/net/lwip-1.4.1/src/include/lwip/pbuf.h index 7602869740..99d5443bf3 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/pbuf.h +++ b/components/net/lwip-1.4.1/src/include/lwip/pbuf.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -149,11 +149,11 @@ struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_custom *p, void *payload_mem, u16_t payload_mem_len); #endif /* LWIP_SUPPORT_CUSTOM_PBUF */ -void pbuf_realloc(struct pbuf *p, u16_t size); +void pbuf_realloc(struct pbuf *p, u16_t size); u8_t pbuf_header(struct pbuf *p, s16_t header_size); void pbuf_ref(struct pbuf *p); u8_t pbuf_free(struct pbuf *p); -u8_t pbuf_clen(struct pbuf *p); +u8_t pbuf_clen(struct pbuf *p); void pbuf_cat(struct pbuf *head, struct pbuf *tail); void pbuf_chain(struct pbuf *head, struct pbuf *tail); struct pbuf *pbuf_dechain(struct pbuf *p); diff --git a/components/net/lwip-1.4.1/src/include/lwip/sio.h b/components/net/lwip-1.4.1/src/include/lwip/sio.h index dca34794c6..28ae2f225d 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/sio.h +++ b/components/net/lwip-1.4.1/src/include/lwip/sio.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,17 +11,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. @@ -53,7 +53,7 @@ typedef void * sio_fd_t; #ifndef sio_open /** * Opens a serial device for communication. - * + * * @param devnum device number * @return handle to serial device if successful, NULL otherwise */ @@ -63,10 +63,10 @@ sio_fd_t sio_open(u8_t devnum); #ifndef sio_send /** * Sends a single character to the serial device. - * + * * @param c character to send * @param fd serial device handle - * + * * @note This function will block until the character can be sent. */ void sio_send(u8_t c, sio_fd_t fd); @@ -75,9 +75,9 @@ void sio_send(u8_t c, sio_fd_t fd); #ifndef sio_recv /** * Receives a single character from the serial device. - * + * * @param fd serial device handle - * + * * @note This function will block until a character is received. */ u8_t sio_recv(sio_fd_t fd); @@ -86,12 +86,12 @@ u8_t sio_recv(sio_fd_t fd); #ifndef sio_read /** * Reads from the serial device. - * + * * @param fd serial device handle * @param data pointer to data buffer for receiving * @param len maximum length (in bytes) of data to receive * @return number of bytes actually received - may be 0 if aborted by sio_read_abort - * + * * @note This function will block until data can be received. The blocking * can be cancelled by calling sio_read_abort(). */ @@ -102,7 +102,7 @@ u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len); /** * Tries to read from the serial device. Same as sio_read but returns * immediately if no data is available and never blocks. - * + * * @param fd serial device handle * @param data pointer to data buffer for receiving * @param len maximum length (in bytes) of data to receive @@ -114,12 +114,12 @@ u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len); #ifndef sio_write /** * Writes to the serial device. - * + * * @param fd serial device handle * @param data pointer to data to send * @param len length (in bytes) of data to send * @return number of bytes actually sent - * + * * @note This function will block until all data can be sent. */ u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); @@ -128,7 +128,7 @@ u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); #ifndef sio_read_abort /** * Aborts a blocking sio_read() call. - * + * * @param fd serial device handle */ void sio_read_abort(sio_fd_t fd); diff --git a/components/net/lwip-1.4.1/src/include/lwip/snmp.h b/components/net/lwip-1.4.1/src/include/lwip/snmp.h index fbd2c5a85b..2ed043dd5f 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/snmp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/snmp.h @@ -2,8 +2,8 @@ * Copyright (c) 2001, 2002 Leon Woestenberg * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands. * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -12,21 +12,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Leon Woestenberg * */ @@ -109,7 +109,7 @@ void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen); void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen); /* network interface */ -void snmp_add_ifinoctets(struct netif *ni, u32_t value); +void snmp_add_ifinoctets(struct netif *ni, u32_t value); void snmp_inc_ifinucastpkts(struct netif *ni); void snmp_inc_ifinnucastpkts(struct netif *ni); void snmp_inc_ifindiscards(struct netif *ni); @@ -167,7 +167,7 @@ void snmp_inc_icmpoutdestunreachs(void); void snmp_inc_icmpouttimeexcds(void); void snmp_inc_icmpoutparmprobs(void); void snmp_inc_icmpoutsrcquenchs(void); -void snmp_inc_icmpoutredirects(void); +void snmp_inc_icmpoutredirects(void); void snmp_inc_icmpoutechos(void); void snmp_inc_icmpoutechoreps(void); void snmp_inc_icmpouttimestamps(void); @@ -242,7 +242,7 @@ void snmp_get_snmpenableauthentraps(u8_t *value); #define snmp_set_syslocation(ocstr, ocstrlen); /* network interface */ -#define snmp_add_ifinoctets(ni,value) +#define snmp_add_ifinoctets(ni,value) #define snmp_inc_ifinucastpkts(ni) #define snmp_inc_ifinnucastpkts(ni) #define snmp_inc_ifindiscards(ni) @@ -282,26 +282,26 @@ void snmp_get_snmpenableauthentraps(u8_t *value); /* ICMP */ #define snmp_inc_icmpinmsgs() -#define snmp_inc_icmpinerrors() -#define snmp_inc_icmpindestunreachs() +#define snmp_inc_icmpinerrors() +#define snmp_inc_icmpindestunreachs() #define snmp_inc_icmpintimeexcds() -#define snmp_inc_icmpinparmprobs() -#define snmp_inc_icmpinsrcquenchs() -#define snmp_inc_icmpinredirects() -#define snmp_inc_icmpinechos() +#define snmp_inc_icmpinparmprobs() +#define snmp_inc_icmpinsrcquenchs() +#define snmp_inc_icmpinredirects() +#define snmp_inc_icmpinechos() #define snmp_inc_icmpinechoreps() -#define snmp_inc_icmpintimestamps() +#define snmp_inc_icmpintimestamps() #define snmp_inc_icmpintimestampreps() #define snmp_inc_icmpinaddrmasks() #define snmp_inc_icmpinaddrmaskreps() #define snmp_inc_icmpoutmsgs() #define snmp_inc_icmpouterrors() -#define snmp_inc_icmpoutdestunreachs() -#define snmp_inc_icmpouttimeexcds() +#define snmp_inc_icmpoutdestunreachs() +#define snmp_inc_icmpouttimeexcds() #define snmp_inc_icmpoutparmprobs() #define snmp_inc_icmpoutsrcquenchs() -#define snmp_inc_icmpoutredirects() -#define snmp_inc_icmpoutechos() +#define snmp_inc_icmpoutredirects() +#define snmp_inc_icmpoutechos() #define snmp_inc_icmpoutechoreps() #define snmp_inc_icmpouttimestamps() #define snmp_inc_icmpouttimestampreps() diff --git a/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h b/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h index a231d03288..605fa3f16c 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h +++ b/components/net/lwip-1.4.1/src/include/lwip/snmp_asn1.h @@ -2,7 +2,7 @@ * @file * Abstract Syntax Notation One (ISO 8824, 8825) codec. */ - + /* * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. * All rights reserved. diff --git a/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h b/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h index e9bd9d379f..0d3b46a928 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h +++ b/components/net/lwip-1.4.1/src/include/lwip/snmp_structs.h @@ -54,7 +54,7 @@ extern "C" { #endif /* MIB object instance */ -#define MIB_OBJECT_NONE 0 +#define MIB_OBJECT_NONE 0 #define MIB_OBJECT_SCALAR 1 #define MIB_OBJECT_TAB 2 @@ -113,7 +113,7 @@ struct mib_node /** tests length and/or range BEFORE setting */ u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); /** sets object value, only to be called when set_test() */ - void (*set_value)(struct obj_def *od, u16_t len, void *value); + void (*set_value)(struct obj_def *od, u16_t len, void *value); /** One out of MIB_NODE_AR, MIB_NODE_LR or MIB_NODE_EX */ u8_t node_type; /* array or max list length */ @@ -161,7 +161,7 @@ struct mib_ram_array_node struct mib_list_node { - struct mib_list_node *prev; + struct mib_list_node *prev; struct mib_list_node *next; s32_t objid; struct mib_node *nptr; @@ -223,7 +223,7 @@ struct mib_external_node void (*get_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); u8_t (*set_test_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); void (*set_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - /** async Panic Close (agent returns error reply, + /** async Panic Close (agent returns error reply, e.g. used for external transaction cleanup) */ void (*get_object_def_pc)(u8_t rid, u8_t ident_len, s32_t *ident); void (*get_value_pc)(u8_t rid, struct obj_def *od); diff --git a/components/net/lwip-1.4.1/src/include/lwip/sockets.h b/components/net/lwip-1.4.1/src/include/lwip/sockets.h index a1003b04f4..3ea32f13fb 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/sockets.h +++ b/components/net/lwip-1.4.1/src/include/lwip/sockets.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -304,7 +304,7 @@ typedef struct ip_mreq { #endif /* FD_SET */ /** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided - * by your system, set this to 0 and include in cc.h */ + * by your system, set this to 0 and include in cc.h */ #ifndef LWIP_TIMEVAL_PRIVATE #define LWIP_TIMEVAL_PRIVATE 1 #endif diff --git a/components/net/lwip-1.4.1/src/include/lwip/stats.h b/components/net/lwip-1.4.1/src/include/lwip/stats.h index d828980a9b..1f5152a949 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/stats.h +++ b/components/net/lwip-1.4.1/src/include/lwip/stats.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -53,7 +53,7 @@ extern "C" { #else #define STAT_COUNTER u16_t #define STAT_COUNTER_F U16_F -#endif +#endif struct stats_proto { STAT_COUNTER xmit; /* Transmitted packets. */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/sys.h b/components/net/lwip-1.4.1/src/include/lwip/sys.h index b25b8c6e62..dc9351335a 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/sys.h +++ b/components/net/lwip-1.4.1/src/include/lwip/sys.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -80,7 +80,7 @@ typedef u8_t sys_mbox_t; /** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. * For now we use the same magic value, but we allow this to change in future. */ -#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT +#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT #include "lwip/err.h" #include "arch/sys_arch.h" @@ -119,7 +119,7 @@ void sys_mutex_lock(sys_mutex_t *mutex); void sys_mutex_unlock(sys_mutex_t *mutex); /** Delete a semaphore * @param mutex the mutex to delete */ -void sys_mutex_free(sys_mutex_t *mutex); +void sys_mutex_free(sys_mutex_t *mutex); #ifndef sys_mutex_valid /** Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid */ int sys_mutex_valid(sys_mutex_t *mutex); diff --git a/components/net/lwip-1.4.1/src/include/lwip/tcp.h b/components/net/lwip-1.4.1/src/include/lwip/tcp.h index 8d8995103a..c6e61ad1f1 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/tcp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/tcp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -173,7 +173,7 @@ struct tcp_pcb { /* ports are in host byte order */ u16_t remote_port; - + u8_t flags; #define TF_ACK_DELAY ((u8_t)0x01U) /* Delayed ACK. */ #define TF_ACK_NOW ((u8_t)0x02U) /* Immediate ACK. */ @@ -236,12 +236,12 @@ struct tcp_pcb { #if TCP_OVERSIZE /* Extra bytes available at the end of the last pbuf in unsent. */ u16_t unsent_oversize; -#endif /* TCP_OVERSIZE */ +#endif /* TCP_OVERSIZE */ /* These are ordered by sequence number: */ struct tcp_seg *unsent; /* Unsent (queued) segments. */ struct tcp_seg *unacked; /* Sent but unacknowledged segments. */ -#if TCP_QUEUE_OOSEQ +#if TCP_QUEUE_OOSEQ struct tcp_seg *ooseq; /* Received out of sequence segments. */ #endif /* TCP_QUEUE_OOSEQ */ @@ -271,7 +271,7 @@ struct tcp_pcb { u32_t keep_intvl; u32_t keep_cnt; #endif /* LWIP_TCP_KEEPALIVE */ - + /* Persist timer counter */ u8_t persist_cnt; /* Persist timer back-off */ @@ -281,7 +281,7 @@ struct tcp_pcb { u8_t keep_cnt_sent; }; -struct tcp_pcb_listen { +struct tcp_pcb_listen { /* Common members of all PCB types */ IP_PCB; /* Protocol specific PCB members */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h b/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h index 7c1655a24f..173de44e44 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h +++ b/components/net/lwip-1.4.1/src/include/lwip/tcp_impl.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -282,7 +282,7 @@ struct tcp_seg { u16_t oversize_left; /* Extra bytes available at the end of the last pbuf in unsent (used for asserting vs. tcp_pcb.unsent_oversized only) */ -#endif /* TCP_OVERSIZE_DBGCHECK */ +#endif /* TCP_OVERSIZE_DBGCHECK */ #if TCP_CHECKSUM_ON_COPY u16_t chksum; u8_t chksum_swapped; @@ -309,7 +309,7 @@ extern u8_t tcp_active_pcbs_changed; /* The TCP PCB lists. */ union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */ - struct tcp_pcb_listen *listen_pcbs; + struct tcp_pcb_listen *listen_pcbs; struct tcp_pcb *pcbs; }; extern struct tcp_pcb *tcp_bound_pcbs; @@ -321,7 +321,7 @@ extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. * extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */ -/* Axioms about the above lists: +/* Axioms about the above lists: 1) Every TCP PCB that is not CLOSED is in one of the lists. 2) A PCB is only in one of the lists. 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state. diff --git a/components/net/lwip-1.4.1/src/include/lwip/tcpip.h b/components/net/lwip-1.4.1/src/include/lwip/tcpip.h index f98340aefd..637476e1a9 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/tcpip.h +++ b/components/net/lwip-1.4.1/src/include/lwip/tcpip.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/lwip/timers.h b/components/net/lwip-1.4.1/src/include/lwip/timers.h index bcf9369c5d..04e78e0fea 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/timers.h +++ b/components/net/lwip-1.4.1/src/include/lwip/timers.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * Simon Goldschmidt * diff --git a/components/net/lwip-1.4.1/src/include/lwip/udp.h b/components/net/lwip-1.4.1/src/include/lwip/udp.h index 5282b0640d..f1e6d3f1e4 100644 --- a/components/net/lwip-1.4.1/src/include/lwip/udp.h +++ b/components/net/lwip-1.4.1/src/include/lwip/udp.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -113,7 +113,7 @@ struct udp_pcb { /** receive callback function */ udp_recv_fn recv; /** user-supplied argument for the recv callback */ - void *recv_arg; + void *recv_arg; }; /* udp_pcbs export for exernal reference (e.g. SNMP agent) */ extern struct udp_pcb *udp_pcbs; diff --git a/components/net/lwip-1.4.1/src/include/netif/etharp.h b/components/net/lwip-1.4.1/src/include/netif/etharp.h index 411284fed4..872f48b10b 100644 --- a/components/net/lwip-1.4.1/src/include/netif/etharp.h +++ b/components/net/lwip-1.4.1/src/include/netif/etharp.h @@ -2,9 +2,9 @@ * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * Copyright (c) 2003-2004 Leon Woestenberg * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -13,21 +13,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-1.4.1/src/include/netif/ethernetif.h b/components/net/lwip-1.4.1/src/include/netif/ethernetif.h index fb7d4b963c..1c969e6e25 100644 --- a/components/net/lwip-1.4.1/src/include/netif/ethernetif.h +++ b/components/net/lwip-1.4.1/src/include/netif/ethernetif.h @@ -4,16 +4,16 @@ #include "lwip/netif.h" #include -#define NIOCTL_GADDR 0x01 +#define NIOCTL_GADDR 0x01 #ifndef RT_LWIP_ETH_MTU -#define ETHERNET_MTU 1500 +#define ETHERNET_MTU 1500 #else -#define ETHERNET_MTU RT_LWIP_ETH_MTU +#define ETHERNET_MTU RT_LWIP_ETH_MTU #endif /* eth flag with auto_linkup or phy_linkup */ -#define ETHIF_LINK_AUTOUP 0x0000 -#define ETHIF_LINK_PHYUP 0x0100 +#define ETHIF_LINK_AUTOUP 0x0000 +#define ETHIF_LINK_PHYUP 0x0100 struct eth_device { diff --git a/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h b/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h index e0897a35e5..e1cdfa5199 100644 --- a/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h +++ b/components/net/lwip-1.4.1/src/include/netif/ppp_oe.h @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/include/netif/slipif.h b/components/net/lwip-1.4.1/src/include/netif/slipif.h index cfd0933945..7b6ce5e28f 100644 --- a/components/net/lwip-1.4.1/src/include/netif/slipif.h +++ b/components/net/lwip-1.4.1/src/include/netif/slipif.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ @@ -76,6 +76,6 @@ void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); #ifdef __cplusplus } #endif - -#endif + +#endif diff --git a/components/net/lwip-1.4.1/src/include/posix/netdb.h b/components/net/lwip-1.4.1/src/include/posix/netdb.h index 12d4c7f566..7134032d2d 100644 --- a/components/net/lwip-1.4.1/src/include/posix/netdb.h +++ b/components/net/lwip-1.4.1/src/include/posix/netdb.h @@ -4,7 +4,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -13,17 +13,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. diff --git a/components/net/lwip-1.4.1/src/include/posix/sys/socket.h b/components/net/lwip-1.4.1/src/include/posix/sys/socket.h index 0ed9baf3d9..f7c7066e6f 100644 --- a/components/net/lwip-1.4.1/src/include/posix/sys/socket.h +++ b/components/net/lwip-1.4.1/src/include/posix/sys/socket.h @@ -4,7 +4,7 @@ */ /* - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -13,17 +13,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. diff --git a/components/net/lwip-1.4.1/src/netif/etharp.c b/components/net/lwip-1.4.1/src/netif/etharp.c index 1228c4d00a..5e382d1d60 100644 --- a/components/net/lwip-1.4.1/src/netif/etharp.c +++ b/components/net/lwip-1.4.1/src/netif/etharp.c @@ -42,7 +42,7 @@ * This file is part of the lwIP TCP/IP stack. * */ - + #include "lwip/opt.h" #if LWIP_ARP || LWIP_ETHERNET @@ -84,7 +84,7 @@ const struct eth_addr ethzero = {{0,0,0,0,0,0}}; /** the time an ARP entry stays pending after first request, * for ARP_TMR_INTERVAL = 5000, this is * (2 * 5) seconds = 10 seconds. - * + * * @internal Keep this number at least 2, otherwise it might * run out instantly if the timeout occurs directly after a request. */ @@ -243,14 +243,14 @@ etharp_tmr(void) /** * Search the ARP table for a matching or new entry. - * + * * If an IP address is given, return a pending or stable ARP entry that matches * the address. If no match is found, create a new entry with this address set, * but in state ETHARP_EMPTY. The caller must check and possibly change the * state of the returned entry. - * + * * If ipaddr is NULL, return a initialized new entry in state ETHARP_EMPTY. - * + * * In all cases, attempt to create new entries from an empty entry. If no * empty entries are available and ETHARP_FLAG_TRY_HARD flag is set, recycle * old entries. Heuristic choose the least important entry for recycling. @@ -258,7 +258,7 @@ etharp_tmr(void) * @param ipaddr IP address to find in ARP cache, or to add if not found. * @param flags @see definition of ETHARP_FLAG_* * @param netif netif related to this address (used for NETIF_HWADDRHINT) - * + * * @return The ARP entry index that matched or is created, ERR_MEM if no * entry is found or could be recycled. */ @@ -337,7 +337,7 @@ etharp_find_entry(ip_addr_t *ipaddr, u8_t flags) } } /* { we have no match } => try to create a new entry */ - + /* don't create new entry, only search? */ if (((flags & ETHARP_FLAG_FIND_ONLY) != 0) || /* or no empty entry found and not allowed to recycle? */ @@ -345,15 +345,15 @@ etharp_find_entry(ip_addr_t *ipaddr, u8_t flags) LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_find_entry: no empty entry found and not allowed to recycle\n")); return (s8_t)ERR_MEM; } - + /* b) choose the least destructive entry to recycle: * 1) empty entry * 2) oldest stable entry * 3) oldest pending entry without queued packets * 4) oldest pending entry with queued packets - * + * * { ETHARP_FLAG_TRY_HARD is set at this point } - */ + */ /* 1) empty entry available? */ if (empty < ARP_TABLE_SIZE) { @@ -431,7 +431,7 @@ etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct * * If a pending entry is resolved, any queued packets will be sent * at this point. - * + * * @param netif netif related to this entry (used for NETIF_ADDRHINT) * @param ipaddr IP address of the inserted ARP entry. * @param ethaddr Ethernet address of the inserted ARP entry. @@ -670,7 +670,7 @@ etharp_ip_input(struct netif *netif, struct pbuf *p) #endif /* ETHARP_TRUST_IP_MAC */ /** - * Responds to ARP requests to us. Upon ARP replies to us, add entry to cache + * Responds to ARP requests to us. Upon ARP replies to us, add entry to cache * send out queued IP packets. Updates cache with snooped address pairs. * * Should be called for incoming ARP packets. The pbuf in the argument @@ -846,13 +846,13 @@ etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx) /* if arp table entry is about to expire: re-request it, but only if its state is ETHARP_STATE_STABLE to prevent flooding the network with ARP requests if this address is used frequently. */ - if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) && + if ((arp_table[arp_idx].state == ETHARP_STATE_STABLE) && (arp_table[arp_idx].ctime >= ARP_AGE_REREQUEST_USED)) { if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) { arp_table[arp_idx].state = ETHARP_STATE_STABLE_REREQUESTING; } } - + return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), &arp_table[arp_idx].ethaddr); } @@ -990,11 +990,11 @@ etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr) * is sent for the given address. The packet is queued on this entry. * * If the IP address was already stable in the cache, and a packet is - * given, it is directly sent and no ARP request is sent out. - * + * given, it is directly sent and no ARP request is sent out. + * * If the IP address was already stable in the cache, and no packet is * given, an ARP request is sent out. - * + * * @param netif The lwIP network interface on which ipaddr * must be queried for. * @param ipaddr The IP address to be resolved. @@ -1079,7 +1079,7 @@ etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q) struct pbuf *p; int copy_needed = 0; /* IF q includes a PBUF_REF, PBUF_POOL or PBUF_RAM, we have no choice but - * to copy the whole queue into a new PBUF_RAM (see bug #11400) + * to copy the whole queue into a new PBUF_RAM (see bug #11400) * PBUF_ROMs can be left as they are, since ROM must not get changed. */ p = q; while (p) { @@ -1224,7 +1224,7 @@ etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr, #endif /* LWIP_AUTOIP */ ETHADDR16_COPY(ðhdr->src, ethsrc_addr); /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without - * structure packing. */ + * structure packing. */ IPADDR2_COPY(&hdr->sipaddr, ipsrc_addr); IPADDR2_COPY(&hdr->dipaddr, ipdst_addr); @@ -1363,7 +1363,7 @@ ethernet_input(struct pbuf *p, struct netif *netif) ip_input(p, netif); } break; - + case PP_HTONS(ETHTYPE_ARP): if (!(netif->flags & NETIF_FLAG_ETHARP)) { goto free_and_return; diff --git a/components/net/lwip-1.4.1/src/netif/ethernetif.c b/components/net/lwip-1.4.1/src/netif/ethernetif.c index 5fb9c42464..f2570f9e2b 100644 --- a/components/net/lwip-1.4.1/src/netif/ethernetif.c +++ b/components/net/lwip-1.4.1/src/netif/ethernetif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * COPYRIGHT (C) 2006-2021, RT-Thread Development Team + * COPYRIGHT (C) 2006-2010, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -59,9 +59,9 @@ #define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL) #ifndef RT_LWIP_ETHTHREAD_PRIORITY -#define RT_ETHERNETIF_THREAD_PREORITY 0x90 +#define RT_ETHERNETIF_THREAD_PREORITY 0x90 #else -#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY +#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY #endif #ifndef LWIP_NO_TX_THREAD @@ -70,8 +70,8 @@ */ struct eth_tx_msg { - struct netif *netif; - struct pbuf *buf; + struct netif *netif; + struct pbuf *buf; }; static struct rt_mailbox eth_tx_thread_mb; @@ -156,16 +156,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) { netdev_low_level_set_dhcp_status(netif, is_enabled); - + if(RT_TRUE == is_enabled) { dhcp_start((struct netif *)netif->user_data); } else { - dhcp_stop((struct netif *)netif->user_data); + dhcp_stop((struct netif *)netif->user_data); } - + return ERR_OK; } #endif /* RT_LWIP_DHCP */ @@ -368,7 +368,7 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p) struct eth_tx_msg msg; struct eth_device* enetif; - RT_ASSERT(netif != RT_NULL); + RT_ASSERT(netif != RT_NULL); enetif = (struct eth_device*)netif->state; /* send a message to eth tx thread */ @@ -382,13 +382,13 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p) #else struct eth_device* enetif; - RT_ASSERT(netif != RT_NULL); + RT_ASSERT(netif != RT_NULL); enetif = (struct eth_device*)netif->state; - if (enetif->eth_tx(&(enetif->parent), p) != RT_EOK) - { - return ERR_IF; - } + if (enetif->eth_tx(&(enetif->parent), p) != RT_EOK) + { + return ERR_IF; + } #endif return ERR_OK; } @@ -479,16 +479,16 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ netif->name[1] = name[1]; /* set hw address to 6 */ - netif->hwaddr_len = 6; + netif->hwaddr_len = 6; /* maximum transfer unit */ - netif->mtu = ETHERNET_MTU; + netif->mtu = ETHERNET_MTU; /* get hardware MAC address */ rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr); /* set output */ - netif->output = etharp_output; - netif->linkoutput = ethernetif_linkoutput; + netif->output = etharp_output; + netif->linkoutput = ethernetif_linkoutput; #if LWIP_NETIF_HOSTNAME /* Initialize interface hostname */ @@ -577,12 +577,12 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up) /* NOTE: please not use it in interrupt when no RxThread exist */ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up) { - if (up == RT_TRUE) - netifapi_netif_set_link_up(dev->netif); - else - netifapi_netif_set_link_down(dev->netif); + if (up == RT_TRUE) + netifapi_netif_set_link_up(dev->netif); + else + netifapi_netif_set_link_down(dev->netif); - return RT_EOK; + return RT_EOK; } #endif @@ -650,7 +650,7 @@ static void eth_rx_thread_entry(void* parameter) /* receive all of buffer */ while (1) { - if(device->eth_rx == RT_NULL) break; + if(device->eth_rx == RT_NULL) break; p = device->eth_rx(&(device->parent)); if (p != RT_NULL) diff --git a/components/net/lwip-1.4.1/src/netif/ppp/auth.c b/components/net/lwip-1.4.1/src/netif/ppp/auth.c index f99763cd78..0fd87a3796 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/auth.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/auth.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -479,7 +479,7 @@ link_established(int unit) if (go->neg_chap) { ChapAuthPeer(unit, ppp_settings.our_name, go->chap_mdtype); auth |= CHAP_PEER; - } + } #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT && CHAP_SUPPORT else @@ -610,7 +610,7 @@ auth_peer_success(int unit, u16_t protocol, char *name, int namelen) } BCOPY(name, peer_authname, namelen); peer_authname[namelen] = 0; - + /* * If there is no more authentication still to be done, * proceed to the network (or callback) phase. @@ -749,7 +749,7 @@ check_idle(void *arg) { struct ppp_idle idle; u_short itime; - + LWIP_UNUSED_ARG(arg); if (!get_idle_time(0, &idle)) { return; @@ -802,7 +802,7 @@ auth_check_options(void) wo->neg_chap = 1; wo->neg_upap = 1; } - + /* * Check whether we have appropriate secrets to use * to authenticate the peer. @@ -876,7 +876,7 @@ check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, char passwd[256], user[256]; char secret[MAXWORDLEN]; static u_short attempts = 0; - + /* * Make copies of apasswd and auser, then null-terminate them. */ @@ -888,7 +888,7 @@ check_passwd( int unit, char *auser, int userlen, char *apasswd, int passwdlen, /* XXX Validate user name and password. */ ret = UPAP_AUTHACK; /* XXX Assume all entries OK. */ - + if (ret == UPAP_AUTHNAK) { if (*msg == (char *) 0) { *msg = "Login incorrect"; @@ -963,7 +963,7 @@ plogin(char *user, char *passwd, char **msg, int *msglen) LWIP_UNUSED_ARG(msglen); - /* The new lines are here align the file when + /* The new lines are here align the file when * compared against the pppd 2.3.11 code */ @@ -1101,7 +1101,7 @@ get_secret(int unit, char *client, char *server, char *secret, int *secret_len, int ret = 0, len; struct wordlist *addrs; char secbuf[MAXWORDLEN]; - + addrs = NULL; secbuf[0] = 0; @@ -1152,7 +1152,7 @@ set_allowed_addrs(int unit, struct wordlist *addrs) struct ipcp_options *wo = &ipcp_wantoptions[unit]; u32_t a; struct hostent *hp; - + if (wo->hisaddr == 0 && *p != '!' && *p != '-' && strchr(p, '/') == NULL) { hp = gethostbyname(p); if (hp != NULL && hp->h_addrtype == AF_INET) { diff --git a/components/net/lwip-1.4.1/src/netif/ppp/auth.h b/components/net/lwip-1.4.1/src/netif/ppp/auth.h index 8af17ac5cf..a8069ec464 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/auth.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/auth.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chap.c b/components/net/lwip-1.4.1/src/netif/ppp/chap.c index 892cefadf3..f10e27d2ea 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chap.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/chap.c @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -190,7 +190,7 @@ ChapAuthWithPeer(int unit, char *our_name, u_char digest) /* * We get here as a result of LCP coming up. - * So even if CHAP was open before, we will + * So even if CHAP was open before, we will * have to re-authenticate ourselves. */ cstate->clientstate = CHAPCS_LISTEN; @@ -207,7 +207,7 @@ ChapAuthPeer(int unit, char *our_name, u_char digest) cstate->chal_name = our_name; cstate->chal_type = digest; - + if (cstate->serverstate == CHAPSS_INITIAL || cstate->serverstate == CHAPSS_PENDING) { /* lower layer isn't up - wait until later */ @@ -272,7 +272,7 @@ static void ChapRechallenge(void *arg) { chap_state *cstate = (chap_state *) arg; - + /* if we aren't sending a response, don't worry. */ if (cstate->serverstate != CHAPSS_OPEN) { return; @@ -343,7 +343,7 @@ static void ChapProtocolReject(int unit) { chap_state *cstate = &chap[unit]; - + if (cstate->serverstate != CHAPSS_INITIAL && cstate->serverstate != CHAPSS_CLOSED) { auth_peer_fail(unit, PPP_CHAP); @@ -366,7 +366,7 @@ ChapInput(int unit, u_char *inpacket, int packet_len) u_char *inp; u_char code, id; int len; - + /* * Parse header (code, id and length). * If packet too short, drop it. @@ -388,7 +388,7 @@ ChapInput(int unit, u_char *inpacket, int packet_len) return; } len -= CHAP_HEADERLEN; - + /* * Action depends on code (as in fact it usually does :-). */ @@ -396,19 +396,19 @@ ChapInput(int unit, u_char *inpacket, int packet_len) case CHAP_CHALLENGE: ChapReceiveChallenge(cstate, inp, id, len); break; - + case CHAP_RESPONSE: ChapReceiveResponse(cstate, inp, id, len); break; - + case CHAP_FAILURE: ChapReceiveFailure(cstate, inp, id, len); break; - + case CHAP_SUCCESS: ChapReceiveSuccess(cstate, inp, id, len); break; - + default: /* Need code reject? */ CHAPDEBUG(LOG_WARNING, ("Unknown CHAP code (%d) received.\n", code)); break; @@ -486,7 +486,7 @@ ChapReceiveChallenge(chap_state *cstate, u_char *inp, u_char id, int len) cstate->resp_transmits = 0; /* generate MD based on negotiated type */ - switch (cstate->resp_type) { + switch (cstate->resp_type) { case CHAP_DIGEST_MD5: MD5Init(&mdContext); @@ -497,7 +497,7 @@ ChapReceiveChallenge(chap_state *cstate, u_char *inp, u_char id, int len) BCOPY(hash, cstate->response, MD5_SIGNATURE_SIZE); cstate->resp_length = MD5_SIGNATURE_SIZE; break; - + #if MSCHAP_SUPPORT case CHAP_MICROSOFT: ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len); @@ -529,7 +529,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) u_char hash[MD5_SIGNATURE_SIZE]; CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: Rcvd id %d.\n", id)); - + if (cstate->serverstate == CHAPSS_CLOSED || cstate->serverstate == CHAPSS_PENDING) { CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: in state %d\n", @@ -554,7 +554,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) ChapSendStatus(cstate, CHAP_FAILURE); return; } - + if (len < 2) { CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: rcvd short packet.\n")); return; @@ -562,7 +562,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) GETCHAR(remmd_len, inp); /* get length of MD */ remmd = inp; /* get pointer to MD */ INCPTR(remmd_len, inp); - + len -= sizeof (u_char) + remmd_len; if (len < 0) { CHAPDEBUG(LOG_INFO, ("ChapReceiveResponse: rcvd short packet.\n")); @@ -570,7 +570,7 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) } UNTIMEOUT(ChapChallengeTimeout, cstate); - + if (len >= (int)sizeof(rhostname)) { len = sizeof(rhostname) - 1; } @@ -601,19 +601,19 @@ ChapReceiveResponse(chap_state *cstate, u_char *inp, int id, int len) MD5Update(&mdContext, &cstate->chal_id, 1); MD5Update(&mdContext, (u_char*)secret, secret_len); MD5Update(&mdContext, cstate->challenge, cstate->chal_len); - MD5Final(hash, &mdContext); - + MD5Final(hash, &mdContext); + /* compare local and remote MDs and send the appropriate status */ if (memcmp (hash, remmd, MD5_SIGNATURE_SIZE) == 0) { code = CHAP_SUCCESS; /* they are the same! */ } break; - + default: CHAPDEBUG(LOG_INFO, ("unknown digest type %d\n", cstate->chal_type)); } } - + BZERO(secret, sizeof(secret)); ChapSendStatus(cstate, code); @@ -655,9 +655,9 @@ ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len) cstate->clientstate)); return; } - + UNTIMEOUT(ChapResponseTimeout, cstate); - + /* * Print message. */ @@ -712,7 +712,7 @@ ChapSendChallenge(chap_state *cstate) u_char *outp; int chal_len, name_len; int outlen; - + chal_len = cstate->chal_len; name_len = (int)strlen(cstate->chal_name); outlen = CHAP_HEADERLEN + sizeof (u_char) + chal_len + name_len; @@ -729,11 +729,11 @@ ChapSendChallenge(chap_state *cstate) INCPTR(chal_len, outp); BCOPY(cstate->chal_name, outp, name_len); /* append hostname */ - + pppWrite(cstate->unit, outpacket_buf[cstate->unit], outlen + PPP_HDRLEN); CHAPDEBUG(LOG_INFO, ("ChapSendChallenge: Sent id %d.\n", cstate->chal_id)); - + TIMEOUT(ChapChallengeTimeout, cstate, cstate->timeouttime); ++cstate->chal_transmits; } @@ -760,7 +760,7 @@ ChapSendStatus(chap_state *cstate, int code) outp = outpacket_buf[cstate->unit]; MAKEHEADER(outp, PPP_CHAP); /* paste in a header */ - + PUTCHAR(code, outp); PUTCHAR(cstate->chal_id, outp); PUTSHORT(outlen, outp); @@ -785,8 +785,8 @@ ChapGenChallenge(chap_state *cstate) u_char *ptr = cstate->challenge; int i; - /* pick a random challenge length between MIN_CHALLENGE_LENGTH and - MAX_CHALLENGE_LENGTH */ + /* pick a random challenge length between MIN_CHALLENGE_LENGTH and + MAX_CHALLENGE_LENGTH */ chal_len = (unsigned) ((((magic() >> 16) * (MAX_CHALLENGE_LENGTH - MIN_CHALLENGE_LENGTH)) >> 16) @@ -819,11 +819,11 @@ ChapSendResponse(chap_state *cstate) outp = outpacket_buf[cstate->unit]; MAKEHEADER(outp, PPP_CHAP); - + PUTCHAR(CHAP_RESPONSE, outp); /* we are a response */ PUTCHAR(cstate->resp_id, outp); /* copy id from challenge packet */ PUTSHORT(outlen, outp); /* packet length */ - + PUTCHAR(md_len, outp); /* length of MD */ BCOPY(cstate->response, outp, md_len); /* copy MD to buffer */ INCPTR(md_len, outp); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chap.h b/components/net/lwip-1.4.1/src/netif/ppp/chap.h index 517b774965..fedcab8da1 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chap.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/chap.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chpms.c b/components/net/lwip-1.4.1/src/netif/ppp/chpms.c index f177f828a1..81a887b83a 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chpms.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/chpms.c @@ -11,13 +11,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -288,11 +288,11 @@ MakeKey( u_char *key, /* IN 56 bit DES key missing parity bits */ des_key[5] = Get7Bits(key, 35); des_key[6] = Get7Bits(key, 42); des_key[7] = Get7Bits(key, 49); - + #ifndef USE_CRYPT des_set_odd_parity((des_cblock *)des_key); #endif - + #if 0 CHAPDEBUG(LOG_INFO, ("MakeKey: 56-bit input : %02X%02X%02X%02X%02X%02X%02X\n", key[0], key[1], key[2], key[3], key[4], key[5], key[6])); @@ -350,7 +350,7 @@ ChapMS_LANMan( char *rchallenge, int i; u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ u_char PasswordHash[16]; - + /* LANMan password is case insensitive */ BZERO(UcasePassword, sizeof(UcasePassword)); for (i = 0; i < secret_len; i++) { diff --git a/components/net/lwip-1.4.1/src/netif/ppp/chpms.h b/components/net/lwip-1.4.1/src/netif/ppp/chpms.h index d09e782c70..df070fb356 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/chpms.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/chpms.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/fsm.c b/components/net/lwip-1.4.1/src/netif/ppp/fsm.c index 2dc86e16d4..e8a254ede5 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/fsm.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/fsm.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -230,7 +230,7 @@ fsm_open(fsm *f) f->state = LS_REQSENT; } break; - + case LS_CLOSING: f->state = LS_STOPPING; /* fall through */ @@ -422,28 +422,28 @@ fsm_input(fsm *f, u_char *inpacket, int l) case CONFREQ: fsm_rconfreq(f, id, inp, len); break; - + case CONFACK: fsm_rconfack(f, id, inp, len); break; - + case CONFNAK: case CONFREJ: fsm_rconfnakrej(f, code, id, inp, len); break; - + case TERMREQ: fsm_rtermreq(f, id, inp, len); break; - + case TERMACK: fsm_rtermack(f); break; - + case CODEREJ: fsm_rcoderej(f, inp, len); break; - + default: FSMDEBUG(LOG_INFO, ("fsm_input(%s): default: \n", PROTO_NAME(f))); if( !f->callbacks->extcode || @@ -463,7 +463,7 @@ fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { int code, reject_if_disagree; - FSMDEBUG(LOG_INFO, ("fsm_rconfreq(%s): Rcvd id %d state=%d (%s)\n", + FSMDEBUG(LOG_INFO, ("fsm_rconfreq(%s): Rcvd id %d state=%d (%s)\n", PROTO_NAME(f), id, f->state, ppperr_strerr[f->state])); switch( f->state ) { case LS_CLOSED: @@ -488,7 +488,7 @@ fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) f->state = LS_REQSENT; break; } - + /* * Pass the requested configuration options * to protocol-specific code for checking. @@ -501,10 +501,10 @@ fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) } else { code = CONFACK; } - + /* send the Ack, Nak or Rej to the peer */ fsm_sdata(f, (u_char)code, id, inp, len); - + if (code == CONFACK) { if (f->state == LS_ACKRCVD) { UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ @@ -536,7 +536,7 @@ fsm_rconfack(fsm *f, int id, u_char *inp, int len) { FSMDEBUG(LOG_INFO, ("fsm_rconfack(%s): Rcvd id %d state=%d (%s)\n", PROTO_NAME(f), id, f->state, ppperr_strerr[f->state])); - + if (id != f->reqid || f->seen_ack) { /* Expected id? */ return; /* Nope, toss... */ } @@ -547,25 +547,25 @@ fsm_rconfack(fsm *f, int id, u_char *inp, int len) return; } f->seen_ack = 1; - + switch (f->state) { case LS_CLOSED: case LS_STOPPED: fsm_sdata(f, TERMACK, (u_char)id, NULL, 0); break; - + case LS_REQSENT: f->state = LS_ACKRCVD; f->retransmits = f->maxconfreqtransmits; break; - + case LS_ACKRCVD: /* Huh? an extra valid Ack? oh well... */ UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ fsm_sconfreq(f, 0); f->state = LS_REQSENT; break; - + case LS_ACKSENT: UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ f->state = LS_OPENED; @@ -574,7 +574,7 @@ fsm_rconfack(fsm *f, int id, u_char *inp, int len) (*f->callbacks->up)(f); /* Inform upper layers */ } break; - + case LS_OPENED: /* Go down and restart negotiation */ if (f->callbacks->down) { @@ -616,7 +616,7 @@ fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) case LS_STOPPED: fsm_sdata(f, TERMACK, (u_char)id, NULL, 0); break; - + case LS_REQSENT: case LS_ACKSENT: /* They didn't agree to what we wanted - try another request */ @@ -627,14 +627,14 @@ fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) fsm_sconfreq(f, 0); /* Send Configure-Request */ } break; - + case LS_ACKRCVD: /* Got a Nak/reject when we had already had an Ack?? oh well... */ UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ fsm_sconfreq(f, 0); f->state = LS_REQSENT; break; - + case LS_OPENED: /* Go down and restart negotiation */ if (f->callbacks->down) { @@ -689,9 +689,9 @@ fsm_rtermreq(fsm *f, int id, u_char *p, int len) static void fsm_rtermack(fsm *f) { - FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): state=%d (%s)\n", + FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): state=%d (%s)\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); - + switch (f->state) { case LS_CLOSING: UNTIMEOUT(fsm_timeout, f); @@ -708,11 +708,11 @@ fsm_rtermack(fsm *f) (*f->callbacks->finished)(f); } break; - + case LS_ACKRCVD: f->state = LS_REQSENT; break; - + case LS_OPENED: if (f->callbacks->down) { (*f->callbacks->down)(f); /* Inform upper layers */ @@ -720,7 +720,7 @@ fsm_rtermack(fsm *f) fsm_sconfreq(f, 0); break; default: - FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): UNHANDLED state=%d (%s)!!!\n", + FSMDEBUG(LOG_INFO, ("fsm_rtermack(%s): UNHANDLED state=%d (%s)!!!\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); } } @@ -733,10 +733,10 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; - - FSMDEBUG(LOG_INFO, ("fsm_rcoderej(%s): state=%d (%s)\n", + + FSMDEBUG(LOG_INFO, ("fsm_rcoderej(%s): state=%d (%s)\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); - + if (len < HEADERLEN) { FSMDEBUG(LOG_INFO, ("fsm_rcoderej: Rcvd short Code-Reject packet!\n")); return; @@ -745,7 +745,7 @@ fsm_rcoderej(fsm *f, u_char *inp, int len) GETCHAR(id, inp); FSMDEBUG(LOG_WARNING, ("%s: Rcvd Code-Reject for code %d, id %d\n", PROTO_NAME(f), code, id)); - + if( f->state == LS_ACKRCVD ) { f->state = LS_REQSENT; } @@ -783,7 +783,7 @@ fsm_protreject(fsm *f) (*f->callbacks->finished)(f); } break; - + case LS_OPENED: if( f->callbacks->down ) { (*f->callbacks->down)(f); @@ -797,7 +797,7 @@ fsm_protreject(fsm *f) f->state = LS_STOPPING; break; - + default: FSMDEBUG(LOG_INFO, ("%s: Protocol-reject event in state %d (%s)!\n", PROTO_NAME(f), f->state, ppperr_strerr[f->state])); @@ -813,7 +813,7 @@ fsm_sconfreq(fsm *f, int retransmit) { u_char *outp; int cilen; - + if( f->state != LS_REQSENT && f->state != LS_ACKRCVD && f->state != LS_ACKSENT ) { /* Not currently negotiating - reset options */ if( f->callbacks->resetci ) { @@ -821,15 +821,15 @@ fsm_sconfreq(fsm *f, int retransmit) } f->nakloops = 0; } - + if( !retransmit ) { /* New request - reset retransmission counter, use new ID */ f->retransmits = f->maxconfreqtransmits; f->reqid = ++f->id; } - + f->seen_ack = 0; - + /* * Make up the request packet */ @@ -848,11 +848,11 @@ fsm_sconfreq(fsm *f, int retransmit) /* send the request to our peer */ fsm_sdata(f, CONFREQ, f->reqid, outp, cilen); - + /* start the retransmit timer */ --f->retransmits; TIMEOUT(fsm_timeout, f, f->timeouttime); - + FSMDEBUG(LOG_INFO, ("%s: sending Configure-Request, id %d\n", PROTO_NAME(f), f->reqid)); } diff --git a/components/net/lwip-1.4.1/src/netif/ppp/fsm.h b/components/net/lwip-1.4.1/src/netif/ppp/fsm.h index 0057cf3f51..8d41b5f511 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/fsm.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/fsm.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c index aef7fb0af2..f0ab2e0e17 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.c @@ -9,13 +9,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -280,7 +280,7 @@ static void ipcp_resetci(fsm *f) { ipcp_options *wo = &ipcp_wantoptions[f->unit]; - + wo->req_addr = wo->neg_addr && ipcp_allowoptions[f->unit].neg_addr; if (wo->ouraddr == 0) { wo->accept_local = 1; @@ -462,7 +462,7 @@ ipcp_ackci(fsm *f, u_char *p, int len) } \ } \ } - + #define ACKCIADDR(opt, neg, old, val1, val2) \ if (neg) { \ int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \ @@ -591,7 +591,7 @@ ipcp_nakci(fsm *f, u_char *p, int len) no.neg = 1; \ code \ } - + #define NAKCIDNS(opt, neg, code) \ if (go->neg && \ ((cilen = p[1]) == CILEN_ADDR) && \ @@ -1091,7 +1091,7 @@ ipcp_reqci(fsm *f, u_char *inp/* Requested CIs */,int *len/* Length of requested ho->vj_protocol = cishort; if (cilen == CILEN_VJ) { GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { + if (maxslotindex > ao->maxslotindex) { IPCPDEBUG(LOG_INFO, ("ipcp_reqci: Naking VJ max slot %d\n", maxslotindex)); orc = CONFNAK; if (!reject_if_disagree) { @@ -1152,7 +1152,7 @@ endswitch: rc = CONFREJ; ucp = inp; /* Backup */ } - + /* Need to move CI? */ if (ucp != cip) { BCOPY(cip, ucp, cilen); /* Move it */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h index bcfd25caa1..de03f460ec 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/ipcp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -73,7 +73,7 @@ #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option */ #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option */ + /* compression option */ typedef struct ipcp_options { u_int neg_addr : 1; /* Negotiate IP Address? */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/lcp.c b/components/net/lwip-1.4.1/src/netif/ppp/lcp.c index 06b426a3d4..54f758aa64 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/lcp.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/lcp.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -49,7 +49,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ - + #include "lwip/opt.h" @@ -107,7 +107,7 @@ static u32_t lcp_echo_number = 0; /* ID number of next ech static u32_t lcp_echo_timer_running = 0; /* TRUE if a timer is running */ /* @todo: do we really need such a large buffer? The typical 1500 bytes seem too much. */ -static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ +static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ /* * Callbacks for fsm code. (CI = Configuration Information) @@ -278,7 +278,7 @@ lcp_init(int unit) ao->neg_lqr = 0; /* no LQR implementation yet */ ao->neg_cbcp = (CBCP_SUPPORT != 0); - /* + /* * Set transmit escape for the flag and escape characters plus anything * set for the allowable options. */ @@ -293,7 +293,7 @@ lcp_init(int unit) xmit_accm[unit][1], xmit_accm[unit][2], xmit_accm[unit][3])); - + lcp_phase[unit] = PHASE_INITIALIZE; } @@ -412,7 +412,7 @@ lcp_extcode(fsm *f, int code, u_char id, u_char *inp, int len) case PROTREJ: lcp_rprotrej(f, inp, len); break; - + case ECHOREQ: if (f->state != LS_OPENED) { break; @@ -892,7 +892,7 @@ lcp_nakci(fsm *f, u_char *p, int len) goto bad; } try.neg_chap = 0; - + } else if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { GETCHAR(cichar, p); if (go->neg_chap) { @@ -910,7 +910,7 @@ lcp_nakci(fsm *f, u_char *p, int len) */ try.neg_upap = 0; } - + } else { /* * We don't recognize what they're suggesting. @@ -1179,7 +1179,7 @@ lcp_rejci(fsm *f, u_char *p, int len) try.neg = 0; \ LCPDEBUG(LOG_INFO, ("lcp_rejci: Callback opt %d rejected\n", opt)); \ } - + REJCISHORT(CI_MRU, neg_mru, go->mru); REJCILONG(CI_ASYNCMAP, neg_asyncmap, go->asyncmap); REJCICHAP(CI_AUTHTYPE, neg_chap, PPP_CHAP, go->chap_mdtype); @@ -1191,7 +1191,7 @@ lcp_rejci(fsm *f, u_char *p, int len) REJCILONG(CI_MAGICNUMBER, neg_magicnumber, go->magicnumber); REJCIVOID(CI_PCOMPRESSION, neg_pcompression); REJCIVOID(CI_ACCOMPRESSION, neg_accompression); - + /* * If there are any remaining CIs, then this packet is bad. */ @@ -1205,7 +1205,7 @@ lcp_rejci(fsm *f, u_char *p, int len) *go = try; } return 1; - + bad: LCPDEBUG(LOG_WARNING, ("lcp_rejci: received bad Reject!\n")); return 0; @@ -1220,7 +1220,7 @@ bad: * CONFNAK; returns CONFREJ if it can't return CONFACK. */ static int -lcp_reqci(fsm *f, +lcp_reqci(fsm *f, u_char *inp, /* Requested CIs */ int *lenp, /* Length of requested CIs */ int reject_if_disagree) @@ -1318,13 +1318,13 @@ lcp_reqci(fsm *f, break; } GETLONG(cilong, p); - + /* * Asyncmap must have set at least the bits * which are set in lcp_allowoptions[unit].asyncmap. */ if ((ao->asyncmap & ~cilong) != 0) { - LCPDEBUG(LOG_INFO, ("lcp_reqci: Nak ASYNCMAP %lX missing %lX\n", + LCPDEBUG(LOG_INFO, ("lcp_reqci: Nak ASYNCMAP %lX missing %lX\n", cilong, ao->asyncmap)); orc = CONFNAK; PUTCHAR(CI_ASYNCMAP, nakp); @@ -1354,7 +1354,7 @@ lcp_reqci(fsm *f, break; } GETSHORT(cishort, p); - + /* * Authtype must be UPAP or CHAP. * @@ -1365,7 +1365,7 @@ lcp_reqci(fsm *f, * Whether we end up doing CHAP or UPAP depends then on * the ordering of the CIs in the peer's Configure-Request. */ - + if (cishort == PPP_PAP) { if (ho->neg_chap) { /* we've already accepted CHAP */ LCPDEBUG(LOG_WARNING, ("lcp_reqci: Reject AUTHTYPE PAP already accepted\n")); @@ -1432,7 +1432,7 @@ lcp_reqci(fsm *f, ho->neg_chap = 1; break; } - + /* * We don't recognize the protocol they're asking for. * Nak it with something we're willing to do. @@ -1451,7 +1451,7 @@ lcp_reqci(fsm *f, PUTSHORT(PPP_PAP, nakp); } break; - + case CI_QUALITY: GETSHORT(cishort, p); GETLONG(cilong, p); @@ -1465,7 +1465,7 @@ lcp_reqci(fsm *f, orc = CONFREJ; break; } - + /* * Check the protocol and the reporting period. * XXX When should we Nak this, and what with? @@ -1479,7 +1479,7 @@ lcp_reqci(fsm *f, break; } break; - + case CI_MAGICNUMBER: if (!(ao->neg_magicnumber || go->neg_magicnumber) || cilen != CILEN_LONG) { @@ -1507,8 +1507,8 @@ lcp_reqci(fsm *f, ho->neg_magicnumber = 1; ho->magicnumber = cilong; break; - - + + case CI_PCOMPRESSION: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " PCOMPRESSION"); @@ -1521,7 +1521,7 @@ lcp_reqci(fsm *f, } ho->neg_pcompression = 1; break; - + case CI_ACCOMPRESSION: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " ACCOMPRESSION"); @@ -1534,7 +1534,7 @@ lcp_reqci(fsm *f, } ho->neg_accompression = 1; break; - + case CI_MRRU: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " CI_MRRU"); @@ -1542,7 +1542,7 @@ lcp_reqci(fsm *f, #endif orc = CONFREJ; break; - + case CI_SSNHF: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " CI_SSNHF"); @@ -1550,7 +1550,7 @@ lcp_reqci(fsm *f, #endif orc = CONFREJ; break; - + case CI_EPDISC: #if TRACELCP > 0 snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " CI_EPDISC"); @@ -1558,7 +1558,7 @@ lcp_reqci(fsm *f, #endif orc = CONFREJ; break; - + default: #if TRACELCP snprintf(&traceBuf[traceNdx], sizeof(traceBuf), " unknown %d", citype); @@ -1730,7 +1730,7 @@ static void print_string( char *p, int len, void (*printer) (void *, char *, ...), void *arg) { int c; - + printer(arg, "\""); for (; len > 0; --len) { c = *p++; @@ -1897,7 +1897,7 @@ lcp_printpkt( u_char *p, int plen, void (*printer) (void *, char *, ...), void * printer(arg, ">"); } break; - + case TERMACK: case TERMREQ: if (len > 0 && *p >= ' ' && *p < 0x7f) { @@ -1907,7 +1907,7 @@ lcp_printpkt( u_char *p, int plen, void (*printer) (void *, char *, ...), void * len = 0; } break; - + case ECHOREQ: case ECHOREP: case DISCREQ: diff --git a/components/net/lwip-1.4.1/src/netif/ppp/lcp.h b/components/net/lwip-1.4.1/src/netif/ppp/lcp.h index 92f45bb341..b9201eeb50 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/lcp.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/lcp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/magic.c b/components/net/lwip-1.4.1/src/netif/ppp/magic.c index 1a9d16dd44..3732a42417 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/magic.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/magic.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/magic.h b/components/net/lwip-1.4.1/src/netif/ppp/magic.h index 183643947e..eba70d20b0 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/magic.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/magic.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/md5.c b/components/net/lwip-1.4.1/src/netif/ppp/md5.c index be49f1fc12..dc3cc751b7 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/md5.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/md5.c @@ -141,7 +141,7 @@ MD5Update(MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen) PPPDEBUG(LOG_INFO, ("MD5Update: %u:%.*H\n", inLen, LWIP_MIN(inLen, 20) * 2, inBuf)); PPPDEBUG(LOG_INFO, ("MD5Update: %u:%s\n", inLen, inBuf)); #endif - + /* compute number of bytes mod 64 */ mdi = (int)((mdContext->i[0] >> 3) & 0x3F); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/pap.c b/components/net/lwip-1.4.1/src/netif/ppp/pap.c index aa806dcac5..5fb9f886c0 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/pap.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/pap.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -214,7 +214,7 @@ upap_timeout(void *arg) { upap_state *u = (upap_state *) arg; - UPAPDEBUG(LOG_INFO, ("upap_timeout: %d timeout %d expired s=%d\n", + UPAPDEBUG(LOG_INFO, ("upap_timeout: %d timeout %d expired s=%d\n", u->us_unit, u->us_timeouttime, u->us_clientstate)); if (u->us_clientstate != UPAPCS_AUTHREQ) { @@ -552,7 +552,7 @@ upap_sauthreq(upap_state *u) u_char *outp; int outlen; - outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + u->us_userlen + u->us_passwdlen; outp = outpacket_buf[u->us_unit]; diff --git a/components/net/lwip-1.4.1/src/netif/ppp/pap.h b/components/net/lwip-1.4.1/src/netif/ppp/pap.h index b48cbac347..c99a204019 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/pap.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/pap.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp.c b/components/net/lwip-1.4.1/src/netif/ppp/ppp.c index affc2405d8..8e8fae9f9f 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -566,9 +566,9 @@ pppOverSerialOpen(sio_fd_t fd, pppLinkStatusCB_fn linkStatusCB, void *linkStatus vj_compress_init(&pc->vjComp); #endif /* VJ_SUPPORT */ - /* + /* * Default the in and out accm so that escape and flag characters - * are always escaped. + * are always escaped. */ pc->rx.inACCM[15] = 0x60; /* no need to protect since RX is not running */ pc->outACCM[15] = 0x60; @@ -655,7 +655,7 @@ int pppOverEthernetOpen(struct netif *ethif, const char *service_name, const cha #endif /* PPPOE_SUPPORT */ -/* Close a PPP connection and release the descriptor. +/* Close a PPP connection and release the descriptor. * Any outstanding packets in the queues are dropped. * Return 0 on success, an error code on failure. */ int @@ -723,7 +723,7 @@ nPut(PPPControl *pc, struct pbuf *nb) LINK_STATS_INC(link.xmit); } -/* +/* * pppAppend - append given character to end of given pbuf. If outACCM * is not NULL and the character needs to be escaped, do so. * If pbuf is full, append another. @@ -733,7 +733,7 @@ static struct pbuf * pppAppend(u_char c, struct pbuf *nb, ext_accm *outACCM) { struct pbuf *tb = nb; - + /* Make sure there is room for the character and an escape code. * Sure we don't quite fill the buffer if the character doesn't * get escaped but is one character worth complicating this? */ @@ -859,9 +859,9 @@ pppifOutput(struct netif *netif, struct pbuf *pb, ip_addr_t *ipaddr) } #if VJ_SUPPORT - /* + /* * Attempt Van Jacobson header compression if VJ is configured and - * this is an IP packet. + * this is an IP packet. */ if (protocol == PPP_IP && pc->vjEnabled) { switch (vj_compress_tcp(&pc->vjComp, pb)) { @@ -921,7 +921,7 @@ pppifOutput(struct netif *netif, struct pbuf *pb, ip_addr_t *ipaddr) /* Update FCS before checking for special characters. */ fcsOut = PPP_FCS(fcsOut, c); - + /* Copy to output buffer escaping special characters. */ tailMB = pppAppend(c, tailMB, &pc->outACCM); } @@ -937,7 +937,7 @@ pppifOutput(struct netif *netif, struct pbuf *pb, ip_addr_t *ipaddr) /* If we failed to complete the packet, throw it away. */ if (!tailMB) { PPPDEBUG(LOG_WARNING, - ("pppifOutput[%d]: Alloc err - dropping proto=%d\n", + ("pppifOutput[%d]: Alloc err - dropping proto=%d\n", pd, protocol)); pbuf_free(headMB); LINK_STATS_INC(link.memerr); @@ -1114,7 +1114,7 @@ pppWrite(int pd, const u_char *s, int n) /* Copy to output buffer escaping special characters. */ tailMB = pppAppend(c, tailMB, &pc->outACCM); } - + /* Add FCS and trailing flag. */ c = ~fcsOut & 0xFF; tailMB = pppAppend(c, tailMB, &pc->outACCM); @@ -1152,11 +1152,11 @@ ppp_send_config( int unit, u16_t mtu, u32_t asyncmap, int pcomp, int accomp) { PPPControl *pc = &pppControl[unit]; int i; - + pc->mtu = mtu; pc->pcomp = pcomp; pc->accomp = accomp; - + /* Load the ACCM bits for the 32 control codes. */ for (i = 0; i < 32/8; i++) { pc->outACCM[i] = (u_char)((asyncmap >> (8 * i)) & 0xFF); @@ -1277,13 +1277,13 @@ GetMask(u32_t addr) nmask = IP_CLASSA_NET; } else if (IP_CLASSB(addr)) { nmask = IP_CLASSB_NET; - } else { + } else { nmask = IP_CLASSC_NET; } /* class D nets are disallowed by bad_ip_adrs */ mask = subnetMask | htonl(nmask); - + /* XXX * Scan through the system's network interfaces. * Get each netmask and OR them into our mask. @@ -1300,7 +1300,7 @@ sifvjcomp(int pd, int vjcomp, u8_t cidcomp, u8_t maxcid) { #if PPPOS_SUPPORT && VJ_SUPPORT PPPControl *pc = &pppControl[pd]; - + pc->vjEnabled = vjcomp; pc->vjComp.compressSlot = cidcomp; pc->vjComp.maxSlotIndex = maxcid; @@ -1343,7 +1343,7 @@ sifup(int pd) { PPPControl *pc = &pppControl[pd]; int st = 1; - + if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); @@ -1388,7 +1388,7 @@ sifdown(int pd) { PPPControl *pc = &pppControl[pd]; int st = 1; - + if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG(LOG_WARNING, ("sifdown[%d]: bad parms\n", pd)); @@ -1419,7 +1419,7 @@ sifaddr( int pd, u32_t o, u32_t h, u32_t m, u32_t ns1, u32_t ns2) { PPPControl *pc = &pppControl[pd]; int st = 1; - + if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { st = 0; PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd)); @@ -1445,7 +1445,7 @@ cifaddr( int pd, u32_t o, u32_t h) { PPPControl *pc = &pppControl[pd]; int st = 1; - + LWIP_UNUSED_ARG(o); LWIP_UNUSED_ARG(h); if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) { @@ -1608,7 +1608,7 @@ pppInput(void *arg) pd = ((struct pppInputHeader *)nb->payload)->unit; protocol = ((struct pppInputHeader *)nb->payload)->proto; - + if(pbuf_header(nb, -(int)sizeof(struct pppInputHeader))) { LWIP_ASSERT("pbuf_header failed\n", 0); goto drop; @@ -1667,7 +1667,7 @@ pppInput(void *arg) #else /* PPPOS_SUPPORT && VJ_SUPPORT */ /* No handler for this protocol so drop the packet. */ PPPDEBUG(LOG_INFO, - ("pppInput[%d]: drop VJ UnComp in %d:.*H\n", + ("pppInput[%d]: drop VJ UnComp in %d:.*H\n", pd, nb->len, LWIP_MIN(nb->len * 2, 40), nb->payload)); #endif /* PPPOS_SUPPORT && VJ_SUPPORT */ break; @@ -1809,14 +1809,14 @@ pppInProc(PPPControlRx *pcrx, u_char *s, int l) /* If we haven't received the packet header, drop what has come in. */ } else if (pcrx->inState < PDDATA) { PPPDEBUG(LOG_WARNING, - ("pppInProc[%d]: Dropping incomplete packet %d\n", + ("pppInProc[%d]: Dropping incomplete packet %d\n", pcrx->pd, pcrx->inState)); LINK_STATS_INC(link.lenerr); pppDrop(pcrx); /* If the fcs is invalid, drop the packet. */ } else if (pcrx->inFCS != PPP_GOODFCS) { PPPDEBUG(LOG_INFO, - ("pppInProc[%d]: Dropping bad fcs 0x%"X16_F" proto=0x%"X16_F"\n", + ("pppInProc[%d]: Dropping bad fcs 0x%"X16_F" proto=0x%"X16_F"\n", pcrx->pd, pcrx->inFCS, pcrx->inProtocol)); /* Note: If you get lots of these, check for UART frame errors or try different baud rate */ LINK_STATS_INC(link.chkerr); @@ -2023,7 +2023,7 @@ drop: void ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback) { - netif_set_status_callback(&pppControl[pd].netif, status_callback); + netif_set_status_callback(&pppControl[pd].netif, status_callback); } #endif /* LWIP_NETIF_STATUS_CALLBACK */ @@ -2038,7 +2038,7 @@ ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback) void ppp_set_netif_linkcallback(int pd, netif_status_callback_fn link_callback) { - netif_set_link_callback(&pppControl[pd].netif, link_callback); + netif_set_link_callback(&pppControl[pd].netif, link_callback); } #endif /* LWIP_NETIF_LINK_CALLBACK */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp.h b/components/net/lwip-1.4.1/src/netif/ppp/ppp.h index 7866478d9a..08d6e62d87 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -138,7 +138,7 @@ typedef void (*pppLinkStatusCB_fn)(void *ctx, int errCode, void *arg); * This initializes the PPP control block but does not * attempt to negotiate the LCP session. * Return a new PPP connection descriptor on success or - * an error code (negative) on failure. + * an error code (negative) on failure. */ int pppOverSerialOpen(sio_fd_t fd, pppLinkStatusCB_fn linkStatusCB, void *linkStatusCtx); #endif /* PPPOS_SUPPORT */ @@ -155,9 +155,9 @@ int pppOverEthernetOpen(struct netif *ethif, const char *service_name, const cha #define pppOpen(fd,cb,ls) pppOverSerialOpen(fd,cb,ls) /* - * Close a PPP connection and release the descriptor. + * Close a PPP connection and release the descriptor. * Any outstanding packets in the queues are dropped. - * Return 0 on success, an error code on failure. + * Return 0 on success, an error code on failure. */ int pppClose(int pd); @@ -168,7 +168,7 @@ void pppSigHUP(int pd); /* * Get and set parameters for the given connection. - * Return 0 on success, an error code on failure. + * Return 0 on success, an error code on failure. */ int pppIOCtl(int pd, int cmd, void *arg); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h b/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h index 14bac5d811..89aea60be1 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp_impl.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -356,7 +356,7 @@ int sifdefaultroute (int, u32_t, u32_t); int cifdefaultroute (int, u32_t, u32_t); /* Get appropriate netmask for address */ -u32_t GetMask (u32_t); +u32_t GetMask (u32_t); #endif /* PPP_SUPPORT */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c b/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c index 414e058fb3..35d192e412 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/ppp_oe.c @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -575,7 +575,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } pb = pppSingleBuf (pb); @@ -615,7 +615,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header PPPOE_HEADERLEN failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, @@ -1071,7 +1071,7 @@ pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb) LINK_STATS_INC(link.lenerr); pbuf_free(pb); return ERR_BUF; - } + } p = (u8_t*)pb->payload + sizeof(struct eth_hdr); PPPOE_ADD_HEADER(p, 0, sc->sc_session, len); diff --git a/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h b/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h index 15c113ec6d..81349971db 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/randm.c b/components/net/lwip-1.4.1/src/netif/ppp/randm.c index 94dc49494d..b736091fc5 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/randm.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/randm.c @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -233,7 +233,7 @@ avRandomize(void) * Return a new random number. * Here we use the Borland rand() function to supply a pseudo random * number which we make truely random by combining it with our own - * seed which is randomized by truely random events. + * seed which is randomized by truely random events. * Thus the numbers will be truely random unless there have been no * operator or network events in which case it will be pseudo random * seeded by the real time clock. diff --git a/components/net/lwip-1.4.1/src/netif/ppp/randm.h b/components/net/lwip-1.4.1/src/netif/ppp/randm.h index 468f001626..a0984b0202 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/randm.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/randm.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-1.4.1/src/netif/ppp/vj.c b/components/net/lwip-1.4.1/src/netif/ppp/vj.c index eaa4617fda..40fdad13d0 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/vj.c +++ b/components/net/lwip-1.4.1/src/netif/ppp/vj.c @@ -52,7 +52,7 @@ vj_compress_init(struct vjcompress *comp) { register u_char i; register struct cstate *tstate = comp->tstate; - + #if MAX_SLOTS == 0 memset((char *)comp, 0, sizeof(*comp)); #endif @@ -148,7 +148,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) u_char new_seq[16]; register u_char *cp = new_seq; - /* + /* * Check that the packet is IP proto TCP. */ if (IPH_PROTO(ip) != IP_PROTO_TCP) { @@ -158,7 +158,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) /* * Bail if this is an IP fragment or if the TCP packet isn't * `compressible' (i.e., ACK isn't set or some other control bit is - * set). + * set). */ if ((IPH_OFFSET(ip) & PP_HTONS(0x3fff)) || pb->tot_len < 40) { return (TYPE_IP); @@ -192,7 +192,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) */ register struct cstate *lcs; register struct cstate *lastcs = comp->last_cs; - + do { lcs = cs; cs = cs->cs_next; INCR(vjs_searches); @@ -255,11 +255,11 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) * different between the previous & current datagram, we send the * current datagram `uncompressed'. */ - if (((u_short *)ip)[0] != ((u_short *)&cs->cs_ip)[0] - || ((u_short *)ip)[3] != ((u_short *)&cs->cs_ip)[3] - || ((u_short *)ip)[4] != ((u_short *)&cs->cs_ip)[4] - || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth) - || (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) + if (((u_short *)ip)[0] != ((u_short *)&cs->cs_ip)[0] + || ((u_short *)ip)[3] != ((u_short *)&cs->cs_ip)[3] + || ((u_short *)ip)[4] != ((u_short *)&cs->cs_ip)[4] + || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth) + || (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || (TCPH_HDRLEN(th) > 5 && BCMP(th + 1, oth + 1, (TCPH_HDRLEN(th) - 5) << 2))) { goto uncompressed; } @@ -429,7 +429,7 @@ vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) register u_int hlen; register struct cstate *cs; register struct ip_hdr *ip; - + ip = (struct ip_hdr *)nb->payload; hlen = IPH_HL(ip) << 2; if (IPH_PROTO(ip) >= MAX_SLOTS @@ -437,7 +437,7 @@ vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) || (hlen += TCPH_HDRLEN(((struct tcp_hdr *)&((char *)ip)[hlen])) << 2) > nb->len || hlen > MAX_HDR) { - PPPDEBUG(LOG_INFO, ("vj_uncompress_uncomp: bad cid=%d, hlen=%d buflen=%d\n", + PPPDEBUG(LOG_INFO, ("vj_uncompress_uncomp: bad cid=%d, hlen=%d buflen=%d\n", IPH_PROTO(ip), hlen, nb->len)); comp->flags |= VJF_TOSS; INCR(vjs_errorin); @@ -456,7 +456,7 @@ vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp) * Uncompress a packet of type TYPE_COMPRESSED_TCP. * The packet is composed of a buffer chain and the first buffer * must contain an accurate chain length. - * The first buffer must include the entire compressed TCP/IP header. + * The first buffer must include the entire compressed TCP/IP header. * This procedure replaces the compressed header with the uncompressed * header and returns the length of the VJ header. */ @@ -475,9 +475,9 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) cp = (u_char *)n0->payload; changes = *cp++; if (changes & NEW_C) { - /* + /* * Make sure the state index is in range, then grab the state. - * If we have a good state index, clear the 'discard' flag. + * If we have a good state index, clear the 'discard' flag. */ if (*cp >= MAX_SLOTS) { PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: bad cid=%d\n", *cp)); @@ -487,10 +487,10 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) comp->flags &=~ VJF_TOSS; comp->last_recv = *cp++; } else { - /* + /* * this packet has an implicit state index. If we've * had a line error since the last time we got an - * explicit state index, we have to toss the packet. + * explicit state index, we have to toss the packet. */ if (comp->flags & VJF_TOSS) { PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: tossing\n")); @@ -559,11 +559,11 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) */ vjlen = (u_short)(cp - (u_char*)n0->payload); if (n0->len < vjlen) { - /* + /* * We must have dropped some characters (crc should detect - * this but the old slip framing won't) + * this but the old slip framing won't) */ - PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: head buffer %d too short %d\n", + PPPDEBUG(LOG_INFO, ("vj_uncompress_tcp: head buffer %d too short %d\n", n0->len, vjlen)); goto bad; } @@ -584,7 +584,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) tmp = (tmp & 0xffff) + (tmp >> 16); tmp = (tmp & 0xffff) + (tmp >> 16); IPH_CHKSUM_SET(&cs->cs_ip, (u_short)(~tmp)); - + /* Remove the compressed header and prepend the uncompressed header. */ if(pbuf_header(n0, -((s16_t)(vjlen)))) { /* Can we cope with this failing? Just assert for now */ diff --git a/components/net/lwip-1.4.1/src/netif/ppp/vj.h b/components/net/lwip-1.4.1/src/netif/ppp/vj.h index 139297d32e..fad1213646 100644 --- a/components/net/lwip-1.4.1/src/netif/ppp/vj.h +++ b/components/net/lwip-1.4.1/src/netif/ppp/vj.h @@ -43,7 +43,7 @@ * sequence number changes, one change per bit set in the header * (there may be no changes and there are two special cases where * the receiver implicitly knows what changed -- see below). - * + * * There are 5 numbers which can change (they are always inserted * in the following order): TCP urgent pointer, window, * acknowlegement, sequence number and IP ID. (The urgent pointer diff --git a/components/net/lwip-1.4.1/src/netif/slipif.c b/components/net/lwip-1.4.1/src/netif/slipif.c index a7301430e1..2777630902 100644 --- a/components/net/lwip-1.4.1/src/netif/slipif.c +++ b/components/net/lwip-1.4.1/src/netif/slipif.c @@ -6,35 +6,35 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is built upon the file: src/arch/rtxc/netif/sioslip.c * - * Author: Magnus Ivarsson + * Author: Magnus Ivarsson * Simon Goldschmidt * * Usage: This netif can be used in three ways: @@ -47,10 +47,10 @@ * packets and puts completed packets on a queue which is fed into * the stack from the main loop (needs SYS_LIGHTWEIGHT_PROT for * pbuf_alloc to work on ISR level!). - * + * */ -/* +/* * This is an arch independent SLIP netif. The specific serial hooks must be * provided by another file. They are sio_open, sio_read/sio_tryread and sio_send */ diff --git a/components/net/lwip-1.4.1/test/unit/lwipopts.h b/components/net/lwip-1.4.1/test/unit/lwipopts.h index 5d60cf0819..88e76d7a56 100644 --- a/components/net/lwip-1.4.1/test/unit/lwipopts.h +++ b/components/net/lwip-1.4.1/test/unit/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c b/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c index 51ef5a8f22..6fd5be5068 100644 --- a/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c +++ b/components/net/lwip-1.4.1/test/unit/tcp/test_tcp.c @@ -207,7 +207,7 @@ START_TEST(test_tcp_fast_retx_recover) EXPECT_RET(pcb->dupacks == 3); memset(&txcounters, 0, sizeof(txcounters)); /* TODO: check expected data?*/ - + /* send data5, not output yet */ err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); EXPECT_RET(err == ERR_OK); diff --git a/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c b/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c index ff59788889..f5c6c10b61 100644 --- a/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c +++ b/components/net/lwip-2.0.2/doc/NO_SYS_SampleCode.c @@ -72,7 +72,7 @@ void main(void) netif_set_status_callback(&netif, netif_status_callback); netif_set_default(&netif); netif_set_up(&netif); - + /* Start DHCP and HTTPD */ dhcp_init(); httpd_init(); @@ -94,7 +94,7 @@ void main(void) if(p != NULL) { LINK_STATS_INC(link.recv); - + /* Update SNMP stats (only if you use SNMP) */ MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->tot_len); int unicast = ((p->payload[0] & 0x01) == 0); @@ -108,10 +108,10 @@ void main(void) pbuf_free(p); } } - + /* Cyclic lwIP timers check */ sys_check_timeouts(); - + /* your application goes here */ } } diff --git a/components/net/lwip-2.0.2/doc/doxygen/main_page.h b/components/net/lwip-2.0.2/doc/doxygen/main_page.h index 684a5111b1..d35d16e1c9 100644 --- a/components/net/lwip-2.0.2/doc/doxygen/main_page.h +++ b/components/net/lwip-2.0.2/doc/doxygen/main_page.h @@ -1,4 +1,4 @@ -/** +/** * @defgroup lwip lwIP * * @defgroup infrastructure Infrastructure @@ -6,13 +6,13 @@ * @defgroup callbackstyle_api Callback-style APIs * Non thread-safe APIs, callback style for maximum performance and minimum * memory footprint. - * + * * @defgroup sequential_api Sequential-style APIs * Sequential-style APIs, blocking functions. More overhead, but can be called * from any thread except TCPIP thread. - * + * * @defgroup addons Addons - * + * * @defgroup apps Applications */ @@ -44,19 +44,19 @@ * * The most common source of lwIP problems is to have multiple execution contexts * inside the lwIP code. - * - * lwIP can be used in two basic modes: @ref lwip_nosys (no OS/RTOS + * + * lwIP can be used in two basic modes: @ref lwip_nosys (no OS/RTOS * running on target system) or @ref lwip_os (there is an OS running * on the target system). * * Mainloop Mode * ------------- * In mainloop mode, only @ref callbackstyle_api can be used. - * The user has two possibilities to ensure there is only one + * The user has two possibilities to ensure there is only one * exection context at a time in lwIP: * * 1) Deliver RX ethernet packets directly in interrupt context to lwIP - * by calling netif->input directly in interrupt. This implies all lwIP + * by calling netif->input directly in interrupt. This implies all lwIP * callback functions are called in IRQ context, which may cause further * problems in application code: IRQ is blocked for a long time, multiple * execution contexts in application code etc. When the application wants @@ -82,7 +82,7 @@ * implemented in tcpip_input().​​ * Again, ensure lwIP is _NEVER_ called from an interrupt, e.g. * some SPI IRQ wants to forward data to udp_send() or tcp_write()! - * + * * 1) tcpip_callback() can be used get called back from TCPIP thread, * it is safe to call any @ref callbackstyle_api from there. * @@ -108,7 +108,7 @@ * *not* *from* *interrupt* *context*. You can allocate a @ref pbuf in interrupt * context and put them into a queue which is processed from mainloop.\n * Call sys_check_timeouts() periodically in the mainloop.\n - * Porting: implement all functions in @ref sys_time, @ref sys_prot and + * Porting: implement all functions in @ref sys_time, @ref sys_prot and * @ref compiler_abstraction.\n * You can only use @ref callbackstyle_api in this mode.\n * Sample code:\n @@ -130,4 +130,3 @@ * @page raw_api lwIP API * @verbinclude "rawapi.txt" */ -/ diff --git a/components/net/lwip-2.0.2/src/api/api_lib.c b/components/net/lwip-2.0.2/src/api/api_lib.c index 85e62ea9fd..7d9c12768d 100644 --- a/components/net/lwip-2.0.2/src/api/api_lib.c +++ b/components/net/lwip-2.0.2/src/api/api_lib.c @@ -1,21 +1,21 @@ /** * @file * Sequential API External module - * + * * @defgroup netconn Netconn API * @ingroup sequential_api * Thread-safe, to be called from non-TCPIP threads only. * TX/RX handling based on @ref netbuf (containing @ref pbuf) * to avoid copying data around. - * + * * @defgroup netconn_common Common functions * @ingroup netconn * For use with TCP and UDP - * + * * @defgroup netconn_tcp TCP only * @ingroup netconn * TCP only functions - * + * * @defgroup netconn_udp UDP only * @ingroup netconn * UDP only functions @@ -241,7 +241,7 @@ netconn_getaddr(struct netconn *conn, ip_addr_t *addr, u16_t *port, u8_t local) * Binding one netconn twice might not always be checked correctly! * * @param conn the netconn to bind - * @param addr the local IP address to bind the netconn to + * @param addr the local IP address to bind the netconn to * (use IP4_ADDR_ANY/IP6_ADDR_ANY to bind to all addresses) * @param port the local port to bind the netconn to (not used for RAW) * @return ERR_OK if bound, any other err_t on failure @@ -251,7 +251,7 @@ netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port) { API_MSG_VAR_DECLARE(msg); err_t err; - + LWIP_ERROR("netconn_bind: invalid conn", (conn != NULL), return ERR_ARG;); #if LWIP_IPV4 @@ -260,7 +260,7 @@ netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port) addr = IP4_ADDR_ANY; } #endif /* LWIP_IPV4 */ - + #if LWIP_IPV4 && LWIP_IPV6 /* "Socket API like" dual-stack support: If IP to bind to is IP6_ADDR_ANY, * and NETCONN_FLAG_IPV6_V6ONLY is 0, use IP_ANY_TYPE to bind diff --git a/components/net/lwip-2.0.2/src/api/api_msg.c b/components/net/lwip-2.0.2/src/api/api_msg.c index caef885f40..dd99c1e01b 100644 --- a/components/net/lwip-2.0.2/src/api/api_msg.c +++ b/components/net/lwip-2.0.2/src/api/api_msg.c @@ -548,14 +548,14 @@ pcb_new(struct api_msg *msg) enum lwip_ip_addr_type iptype = IPADDR_TYPE_V4; LWIP_ASSERT("pcb_new: pcb already allocated", msg->conn->pcb.tcp == NULL); - + #if LWIP_IPV6 && LWIP_IPV4 /* IPv6: Dual-stack by default, unless netconn_set_ipv6only() is called */ if(NETCONNTYPE_ISIPV6(netconn_type(msg->conn))) { iptype = IPADDR_TYPE_ANY; } #endif - + /* Allocate a PCB for this connection */ switch(NETCONNTYPE_GROUP(msg->conn->type)) { #if LWIP_RAW diff --git a/components/net/lwip-2.0.2/src/api/netifapi.c b/components/net/lwip-2.0.2/src/api/netifapi.c index 3215d4e9cd..fef05a34dc 100644 --- a/components/net/lwip-2.0.2/src/api/netifapi.c +++ b/components/net/lwip-2.0.2/src/api/netifapi.c @@ -5,10 +5,10 @@ * @defgroup netifapi NETIF API * @ingroup sequential_api * Thread-safe functions to be called from non-TCPIP threads - * + * * @defgroup netifapi_netif NETIF related * @ingroup netifapi - * To be called from non-TCPIP threads + * To be called from non-TCPIP threads */ /* @@ -57,10 +57,10 @@ static err_t netifapi_do_netif_add(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; - + if (!netif_add( msg->netif, #if LWIP_IPV4 API_EXPR_REF(msg->msg.add.ipaddr), @@ -83,7 +83,7 @@ netifapi_do_netif_add(struct tcpip_api_call_data *m) static err_t netifapi_do_netif_set_addr(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; @@ -102,7 +102,7 @@ netifapi_do_netif_set_addr(struct tcpip_api_call_data *m) static err_t netifapi_do_netif_common(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg*)(void*)m; diff --git a/components/net/lwip-2.0.2/src/api/sockets.c b/components/net/lwip-2.0.2/src/api/sockets.c index e7c8413c9e..dc2477b611 100644 --- a/components/net/lwip-2.0.2/src/api/sockets.c +++ b/components/net/lwip-2.0.2/src/api/sockets.c @@ -407,7 +407,7 @@ tryget_socket(int s) struct lwip_sock * lwip_tryget_socket(int s) { - return tryget_socket(s); + return tryget_socket(s); } /** diff --git a/components/net/lwip-2.0.2/src/api/tcpip.c b/components/net/lwip-2.0.2/src/api/tcpip.c index 7d59f6f55f..07b2f98434 100644 --- a/components/net/lwip-2.0.2/src/api/tcpip.c +++ b/components/net/lwip-2.0.2/src/api/tcpip.c @@ -354,7 +354,7 @@ tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem) /** * Synchronously calls function in TCPIP thread and waits for its completion. * It is recommended to use LWIP_TCPIP_CORE_LOCKING (preferred) or - * LWIP_NETCONN_SEM_PER_THREAD. + * LWIP_NETCONN_SEM_PER_THREAD. * If not, a semaphore is created and destroyed on every call which is usually * an expensive/slow operation. * @param fn Function to call diff --git a/components/net/lwip-2.0.2/src/apps/httpd/fs.c b/components/net/lwip-2.0.2/src/apps/httpd/fs.c index 1afb5f61e2..35b5e31038 100644 --- a/components/net/lwip-2.0.2/src/apps/httpd/fs.c +++ b/components/net/lwip-2.0.2/src/apps/httpd/fs.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h b/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h index 1bee2d00fa..ac4548c785 100644 --- a/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h +++ b/components/net/lwip-2.0.2/src/apps/httpd/fsdata.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.0.2/src/apps/httpd/httpd.c b/components/net/lwip-2.0.2/src/apps/httpd/httpd.c index 83ff1d2bc2..43195d7c54 100644 --- a/components/net/lwip-2.0.2/src/apps/httpd/httpd.c +++ b/components/net/lwip-2.0.2/src/apps/httpd/httpd.c @@ -548,7 +548,7 @@ http_write(struct tcp_pcb *pcb, const void* ptr, u16_t *length, u8_t apiflags) } else { len /= 2; } - LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, + LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Send failed, trying less (%d bytes)\n", len)); } } while ((err == ERR_MEM) && (len > 1)); @@ -871,7 +871,7 @@ get_http_headers(struct http_state *hs, const char *uri) hs->hdrs[HDR_STRINGS_IDX_HTTP_STATUS] = g_psHTTPHeaderStrings[HTTP_HDR_OK]; } - /* Determine if the URI has any variables and, if so, temporarily remove + /* Determine if the URI has any variables and, if so, temporarily remove them. */ vars = strchr(uri, '?'); if(vars) { diff --git a/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c b/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c index 0256555154..efabe478e3 100644 --- a/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c +++ b/components/net/lwip-2.0.2/src/apps/lwiperf/lwiperf.c @@ -566,7 +566,7 @@ lwiperf_tcp_accept(void *arg, struct tcp_pcb *newpcb, err_t err) return ERR_OK; } -/** +/** * @ingroup iperf * Start a TCP iperf server on the default TCP port (5001) and listen for * incoming connections from iperf clients. diff --git a/components/net/lwip-2.0.2/src/apps/mdns/mdns.c b/components/net/lwip-2.0.2/src/apps/mdns/mdns.c index 1fdf607236..14334fc856 100644 --- a/components/net/lwip-2.0.2/src/apps/mdns/mdns.c +++ b/components/net/lwip-2.0.2/src/apps/mdns/mdns.c @@ -7,9 +7,9 @@ * * RFC 6762 - Multicast DNS\n * RFC 6763 - DNS-Based Service Discovery\n - * + * * @verbinclude mdns.txt - * + * * Things left to implement: * ------------------------- * diff --git a/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c b/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c index 61c83fe37d..a0e77b9719 100644 --- a/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c +++ b/components/net/lwip-2.0.2/src/apps/mqtt/mqtt.c @@ -142,7 +142,7 @@ static const char * const mqtt_message_type_str[15] = /** * Message type value to string * @param msg_type see enum mqtt_message_type - * + * * @return Control message type text string */ static const char * diff --git a/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c b/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c index 3aa9505e34..2dfbe65901 100644 --- a/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c +++ b/components/net/lwip-2.0.2/src/apps/netbiosns/netbiosns.c @@ -315,7 +315,7 @@ netbiosns_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t } /** - * @ingroup netbiosns + * @ingroup netbiosns * Init netbios responder */ void @@ -336,7 +336,7 @@ netbiosns_init(void) #ifndef NETBIOS_LWIP_NAME /** - * @ingroup netbiosns + * @ingroup netbiosns * Set netbios name. ATTENTION: the hostname must be less than 15 characters! */ void @@ -352,7 +352,7 @@ netbiosns_set_name(const char* hostname) #endif /** - * @ingroup netbiosns + * @ingroup netbiosns * Stop netbios responder */ void diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c index 3fe28490c3..c041833617 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_core.c @@ -48,7 +48,7 @@ * * 0 Agent Capabilities * ==================== - * + * * Features: * --------- * - SNMPv2c support. @@ -66,7 +66,7 @@ * - Simplified thread sync support for MIBs - useful when MIBs * need to access variables shared with other threads where no locking is * possible. Used in MIB2 to access lwIP stats from lwIP thread. - * + * * MIB compiler (code generator): * ------------------------------ * - Provided in lwIP contrib repository. @@ -78,92 +78,92 @@ * - MIB parser, C file generation framework and LWIP code generation are cleanly * separated, which means the code may be useful as a base for code generation * of other SNMP agents. - * + * * Notes: * ------ * - Stack and MIB compiler were used to implement a Profinet device. * Compiled/implemented MIBs: LLDP-MIB, LLDP-EXT-DOT3-MIB, LLDP-EXT-PNO-MIB. - * + * * SNMPv1 per RFC1157 and SNMPv2c per RFC 3416 * ------------------------------------------- * Note the S in SNMP stands for "Simple". Note that "Simple" is * relative. SNMP is simple compared to the complex ISO network * management protocols CMIP (Common Management Information Protocol) * and CMOT (CMip Over Tcp). - * + * * MIB II * ------ * The standard lwIP stack management information base. * This is a required MIB, so this is always enabled. * The groups EGP, CMOT and transmission are disabled by default. - * + * * Most mib-2 objects are not writable except: * sysName, sysLocation, sysContact, snmpEnableAuthenTraps. * Writing to or changing the ARP and IP address and route * tables is not possible. - * + * * Note lwIP has a very limited notion of IP routing. It currently * doen't have a route table and doesn't have a notion of the U,G,H flags. * Instead lwIP uses the interface list with only one default interface * acting as a single gateway interface (G) for the default route. - * + * * The agent returns a "virtual table" with the default route 0.0.0.0 * for the default interface and network routes (no H) for each * network interface in the netif_list. * All routes are considered to be up (U). - * + * * Loading additional MIBs * ----------------------- * MIBs can only be added in compile-time, not in run-time. - * - * + * + * * 1 Building the Agent * ==================== * First of all you'll need to add the following define * to your local lwipopts.h: * \#define LWIP_SNMP 1 - * + * * and add the source files your makefile. - * + * * Note you'll might need to adapt you network driver to update * the mib2 variables for your interface. - * + * * 2 Running the Agent * =================== * The following function calls must be made in your program to * actually get the SNMP agent running. - * + * * Before starting the agent you should supply pointers * for sysContact, sysLocation, and snmpEnableAuthenTraps. * You can do this by calling - * + * * - snmp_mib2_set_syscontact() * - snmp_mib2_set_syslocation() * - snmp_set_auth_traps_enabled() - * - * You can register a callback which is called on successful write access: + * + * You can register a callback which is called on successful write access: * snmp_set_write_callback(). - * + * * Additionally you may want to set - * + * * - snmp_mib2_set_sysdescr() * - snmp_set_device_enterprise_oid() * - snmp_mib2_set_sysname() - * + * * Also before starting the agent you need to setup * one or more trap destinations using these calls: - * + * * - snmp_trap_dst_enable() * - snmp_trap_dst_ip_set() - * + * * If you need more than MIB2, set the MIBs you want to use * by snmp_set_mibs(). - * + * * Finally, enable the agent by calling snmp_init() * * @defgroup snmp_core Core * @ingroup snmp - * + * * @defgroup snmp_traps Traps * @ingroup snmp */ @@ -232,7 +232,7 @@ snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs) * The 'device enterprise oid' shall point to an OID located under 'private-enterprises' branch (1.3.6.1.4.1.XXX). If a vendor * wants to provide a custom object there, he has to get its own enterprise oid from IANA (http://www.iana.org). It * is not allowed to use LWIP enterprise ID! - * In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own + * In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own * enterprise oid. * e.g. * device a > 1.3.6.1.4.1.XXX(ent-oid).1(devices).1(device a) @@ -250,7 +250,7 @@ void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_ /** * @ingroup snmp_core - * Get 'device enterprise oid' + * Get 'device enterprise oid' */ const struct snmp_obj_id* snmp_get_device_enterprise_oid(void) { @@ -521,7 +521,7 @@ snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port) /** * Assign an OID to struct snmp_obj_id - * @param target Assignment target + * @param target Assignment target * @param oid OID * @param oid_len OID length */ @@ -906,7 +906,7 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida /* we found a suitable next node, now we have to check if a inner MIB is located between the searched OID and the resulting OID. - this is possible because MIB's may be located anywhere in the global tree, that means also in + this is possible because MIB's may be located anywhere in the global tree, that means also in the subtree of another MIB (e.g. if searched OID is .2 and resulting OID is .4, then another MIB having .3 as root node may exist) */ diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c index 157902033b..90e57805d2 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_system.c @@ -351,7 +351,7 @@ system_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void /* no need to check size of target buffer, this was already done in set_test method */ LWIP_ASSERT("", var_wr != NULL); MEMCPY(var_wr, value, len); - + if (var_wr_len == NULL) { /* add terminating 0 */ var_wr[len] = 0; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c index 7db2204d6f..6a983df20b 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_mib2_udp.c @@ -135,7 +135,7 @@ udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t if (row_oid[idx] != 0) { return SNMP_ERR_NOSUCHINSTANCE; } - + /* find udp_pcb with requested ip and port*/ pcb = udp_pcbs; while (pcb != NULL) { @@ -153,7 +153,7 @@ udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t return SNMP_ERR_NOSUCHINSTANCE; } -static snmp_err_t +static snmp_err_t udp_endpointTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) { struct udp_pcb *pcb; @@ -181,12 +181,12 @@ udp_endpointTable_get_next_cell_instance_and_value(const u32_t* column, struct s /* udpEndpointRemoteAddressType + udpEndpointRemoteAddress + udpEndpointRemotePort */ idx += snmp_ip_port_to_oid(&pcb->remote_ip, pcb->remote_port, &test_oid[idx]); - test_oid[idx] = 0; /* udpEndpointInstance */ + test_oid[idx] = 0; /* udpEndpointInstance */ idx++; - + /* check generated OID: is it a candidate for the next one? */ snmp_next_oid_check(&state, test_oid, idx, NULL); - + pcb = pcb->next; } @@ -214,7 +214,7 @@ static const struct snmp_oid_range udp_Table_oid_ranges[] = { { 1, 0xffff } /* Port */ }; -static snmp_err_t +static snmp_err_t udp_Table_get_cell_value_core(struct udp_pcb *pcb, const u32_t* column, union snmp_variant_value* value, u32_t* value_len) { LWIP_UNUSED_ARG(value_len); @@ -235,7 +235,7 @@ udp_Table_get_cell_value_core(struct udp_pcb *pcb, const u32_t* column, union sn return SNMP_ERR_NOERROR; } -static snmp_err_t +static snmp_err_t udp_Table_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len) { ip4_addr_t ip; @@ -267,7 +267,7 @@ udp_Table_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid return SNMP_ERR_NOSUCHINSTANCE; } -static snmp_err_t +static snmp_err_t udp_Table_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_id* row_oid, union snmp_variant_value* value, u32_t* value_len) { struct udp_pcb *pcb; @@ -289,7 +289,7 @@ udp_Table_get_next_cell_instance_and_value(const u32_t* column, struct snmp_obj_ /* check generated OID: is it a candidate for the next one? */ snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(udp_Table_oid_ranges), pcb); } - + pcb = pcb->next; } @@ -322,13 +322,13 @@ static const struct snmp_table_simple_node udp_Table = SNMP_TABLE_CREATE_SIMPLE( #endif /* LWIP_IPV4 */ static const struct snmp_table_simple_col_def udp_endpointTable_columns[] = { - /* all items except udpEndpointProcess are declared as not-accessible */ + /* all items except udpEndpointProcess are declared as not-accessible */ { 8, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* udpEndpointProcess */ }; static const struct snmp_table_simple_node udp_endpointTable = SNMP_TABLE_CREATE_SIMPLE(7, udp_endpointTable_columns, udp_endpointTable_get_cell_value, udp_endpointTable_get_next_cell_instance_and_value); -/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ +/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */ CREATE_LWIP_SYNC_NODE(1, udp_inDatagrams) CREATE_LWIP_SYNC_NODE(2, udp_noPorts) CREATE_LWIP_SYNC_NODE(3, udp_inErrors) diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c index 1485d7069f..0cb7ca997c 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.c @@ -149,7 +149,7 @@ snmp_set_community_trap(const char * const community) * @ingroup snmp_core * Callback fired on every successful write access */ -void +void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg) { snmp_write_callback = write_callback; @@ -180,7 +180,7 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por { err_t err; struct snmp_request request; - + memset(&request, 0, sizeof(request)); request.handle = handle; request.source_ip = source_ip; @@ -209,12 +209,12 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por if (err == ERR_OK) { err = snmp_complete_outbound_frame(&request); - + if (err == ERR_OK) { err = snmp_sendto(request.handle, request.outbound_pbuf, request.source_ip, request.source_port); - if ((request.request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) - && (request.error_status == SNMP_ERR_NOERROR) + if ((request.request_type == SNMP_ASN1_CONTEXT_PDU_SET_REQ) + && (request.error_status == SNMP_ERR_NOERROR) && (snmp_write_callback != NULL)) { /* raise write notification for all written objects */ snmp_execute_write_callbacks(&request); @@ -222,7 +222,7 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por } } } - + if (request.outbound_pbuf != NULL) { pbuf_free(request.outbound_pbuf); } @@ -244,7 +244,7 @@ snmp_msg_getnext_validate_node_inst(struct snmp_node_instance* node_instance, vo return SNMP_ERR_NOERROR; } -static void +static void snmp_process_varbind(struct snmp_request *request, struct snmp_varbind *vb, u8_t get_next) { err_t err; @@ -388,7 +388,7 @@ snmp_process_getnext_request(struct snmp_request *request) request->error_status = SNMP_ERR_GENERROR; } } - + return ERR_OK; } @@ -447,7 +447,7 @@ snmp_process_getbulk_request(struct snmp_request *request) while ((request->error_status == SNMP_ERR_NOERROR) && (repetitions > 0) && (request->outbound_pbuf_stream.offset != repetition_offset)) { u8_t all_endofmibview = 1; - + snmp_vb_enumerator_init(&repetition_varbind_enumerator, request->outbound_pbuf, repetition_offset, request->outbound_pbuf_stream.offset - repetition_offset); repetition_offset = request->outbound_pbuf_stream.offset; /* for next loop */ @@ -478,7 +478,7 @@ snmp_process_getbulk_request(struct snmp_request *request) /* stop when all varbinds in a loop return EndOfMibView */ break; } - + repetitions--; } @@ -510,7 +510,7 @@ snmp_process_set_request(struct snmp_request *request) if (err == SNMP_VB_ENUMERATOR_ERR_OK) { struct snmp_node_instance node_instance; memset(&node_instance, 0, sizeof(node_instance)); - + request->error_status = snmp_get_node_instance_from_oid(vb.oid.id, vb.oid.len, &node_instance); if (request->error_status == SNMP_ERR_NOERROR) { if (node_instance.asn1_type != vb.type) { @@ -617,7 +617,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) err_t err; IF_PARSE_EXEC(snmp_pbuf_stream_init(&pbuf_stream, request->inbound_pbuf, 0, request->inbound_pbuf->tot_len)); - + /* decode main container consisting of version, community and PDU */ IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); IF_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len == pbuf_stream.length)); @@ -628,7 +628,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); IF_PARSE_ASSERT(parent_tlv_value_len > 0); - + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &s32_value)); if ((s32_value != SNMP_VERSION_1) && (s32_value != SNMP_VERSION_2c) @@ -921,7 +921,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) snmp_authfail_trap(); return ERR_ARG; } - } else { + } else { if (strncmp(snmp_community, (const char*)request->community, SNMP_MAX_COMMUNITY_STR_LEN) != 0) { /* community name does not match */ snmp_stats.inbadcommunitynames++; @@ -929,13 +929,13 @@ snmp_parse_inbound_frame(struct snmp_request *request) return ERR_ARG; } } - + /* decode request ID */ IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); IF_PARSE_ASSERT(tlv.type == SNMP_ASN1_TYPE_INTEGER); parent_tlv_value_len -= SNMP_ASN1_TLV_LENGTH(tlv); IF_PARSE_ASSERT(parent_tlv_value_len > 0); - + IF_PARSE_EXEC(snmp_asn1_dec_s32t(&pbuf_stream, tlv.value_len, &request->request_id)); /* decode error status / non-repeaters */ @@ -976,7 +976,7 @@ snmp_parse_inbound_frame(struct snmp_request *request) /* decode varbind-list type (next container level) */ IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv)); IF_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_SEQUENCE) && (tlv.value_len <= pbuf_stream.length)); - + request->inbound_varbind_offset = pbuf_stream.offset; request->inbound_varbind_len = pbuf_stream.length - request->inbound_padding_len; snmp_vb_enumerator_init(&(request->inbound_varbind_enumerator), request->inbound_pbuf, request->inbound_varbind_offset, request->inbound_varbind_len); @@ -1327,8 +1327,8 @@ snmp_complete_outbound_frame(struct snmp_request *request) if (request->error_status != SNMP_ERR_NOERROR) { /* map v2c error codes to v1 compliant error code (according to RFC 2089) */ switch (request->error_status) { - /* mapping of implementation specific "virtual" error codes - * (during processing of frame we already stored them in error_status field, + /* mapping of implementation specific "virtual" error codes + * (during processing of frame we already stored them in error_status field, * so no need to check all varbinds here for those exceptions as suggested by RFC) */ case SNMP_ERR_NOSUCHINSTANCE: case SNMP_ERR_NOSUCHOBJECT: @@ -1549,7 +1549,7 @@ snmp_complete_outbound_frame(struct snmp_request *request) return ERR_OK; } -static void +static void snmp_execute_write_callbacks(struct snmp_request *request) { struct snmp_varbind_enumerator inbound_varbind_enumerator; @@ -1584,7 +1584,7 @@ snmp_vb_enumerator_get_next(struct snmp_varbind_enumerator* enumerator, struct s struct snmp_asn1_tlv tlv; u16_t varbind_len; err_t err; - + if (enumerator->pbuf_stream.length == 0) { return SNMP_VB_ENUMERATOR_ERR_EOVB; @@ -1599,7 +1599,7 @@ snmp_vb_enumerator_get_next(struct snmp_varbind_enumerator* enumerator, struct s /* decode varbind name (object id) */ VB_PARSE_EXEC(snmp_asn1_dec_tlv(&(enumerator->pbuf_stream), &tlv)); VB_PARSE_ASSERT((tlv.type == SNMP_ASN1_TYPE_OBJECT_ID) && (SNMP_ASN1_TLV_LENGTH(tlv) < varbind_len) && (tlv.value_len < enumerator->pbuf_stream.length)); - + VB_PARSE_EXEC(snmp_asn1_dec_oid(&(enumerator->pbuf_stream), tlv.value_len, varbind->oid.id, &(varbind->oid.len), SNMP_MAX_OBJ_ID_LEN)); varbind_len -= SNMP_ASN1_TLV_LENGTH(tlv); diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h index 0c27b45868..2d01ef36eb 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_msg.h @@ -115,7 +115,7 @@ struct snmp_request s32_t non_repeaters; /* max-repetitions (getBulkRequest (SNMPv2c)) */ s32_t max_repetitions; - + #if LWIP_SNMP_V3 s32_t msg_id; s32_t msg_max_size; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c index 1b406ef9d7..24c3e26531 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_netconn.c @@ -51,7 +51,7 @@ snmp_netconn_thread(void *arg) struct netbuf *buf; err_t err; LWIP_UNUSED_ARG(arg); - + /* Bind to SNMP port with default IP address */ #if LWIP_IPV6 conn = netconn_new(NETCONN_UDP_IPV6); @@ -61,7 +61,7 @@ snmp_netconn_thread(void *arg) netconn_bind(conn, IP4_ADDR_ANY, SNMP_IN_PORT); #endif /* LWIP_IPV6 */ LWIP_ERROR("snmp_netconn: invalid conn", (conn != NULL), return;); - + snmp_traps_handle = conn; do { @@ -77,16 +77,16 @@ snmp_netconn_thread(void *arg) } while(1); } -err_t +err_t snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port) { err_t result; struct netbuf buf; - + memset(&buf, 0, sizeof(buf)); buf.p = p; result = netconn_sendto((struct netconn*)handle, &buf, dst, port); - + return result; } diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c index 834a0496f6..4a40864fc9 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_raw.c @@ -52,7 +52,7 @@ snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, pbuf_free(p); } -err_t +err_t snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port) { return udp_sendto((struct udp_pcb*)handle, p, dst, port); @@ -86,7 +86,7 @@ void snmp_init(void) { err_t err; - + struct udp_pcb *snmp_pcb = udp_new_ip_type(IPADDR_TYPE_ANY); LWIP_ERROR("snmp_raw: no PCB", (snmp_pcb != NULL), return;); diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c index 776e0a3224..136c9eccd0 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_scalar.c @@ -46,7 +46,7 @@ static s16_t snmp_scalar_array_get_value(struct snmp_node_instance* instance, vo static snmp_err_t snmp_scalar_array_set_test(struct snmp_node_instance* instance, u16_t value_len, void* value); static snmp_err_t snmp_scalar_array_set_value(struct snmp_node_instance* instance, u16_t value_len, void* value); -snmp_err_t +snmp_err_t snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) { const struct snmp_scalar_node* scalar_node = (const struct snmp_scalar_node*)(const void*)instance->node; @@ -67,7 +67,7 @@ snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_n return SNMP_ERR_NOERROR; } -snmp_err_t +snmp_err_t snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance) { /* because our only instance is .0 we can only return a next instance if no instance oid is passed */ @@ -130,7 +130,7 @@ snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, st if ((instance->instance_oid.len == 0) && (array_node->array_node_count > 0)) { /* return node with lowest OID */ u16_t i = 0; - + result = array_node_def; array_node_def++; @@ -142,7 +142,7 @@ snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, st } } else if (instance->instance_oid.len >= 1) { if (instance->instance_oid.len == 1) { - /* if we have the requested OID we return its instance, otherwise we search for the next available */ + /* if we have the requested OID we return its instance, otherwise we search for the next available */ u16_t i = 0; while (i < array_node->array_node_count) { if (array_node_def->oid == instance->instance_oid.id[0]) { @@ -179,7 +179,7 @@ snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, st instance->instance_oid.len = 2; instance->instance_oid.id[0] = result->oid; instance->instance_oid.id[1] = 0; - + instance->access = result->access; instance->asn1_type = result->asn1_type; instance->get_value = snmp_scalar_array_get_value; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c index ef5612ca28..63ca595633 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_table.c @@ -61,7 +61,7 @@ snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, str if (col_def->index == instance->instance_oid.id[1]) { break; } - + col_def++; i--; } @@ -212,13 +212,13 @@ snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_l default: LWIP_DEBUGF(SNMP_DEBUG, ("snmp_table_simple_get_instance(): unknown column data_type: %d\n", col_def->data_type)); return SNMP_ERR_GENERROR; - } + } ret = SNMP_ERR_NOERROR; } else { ret = SNMP_ERR_NOSUCHINSTANCE; } - } + } } return ret; diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c index b0ee89d3dc..204f265dc8 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_threadsync.c @@ -40,7 +40,7 @@ #include "lwip/apps/snmp_core.h" #include "lwip/sys.h" #include - + static void call_synced_function(struct threadsync_data *call_data, snmp_threadsync_called_fn fn) { @@ -111,7 +111,7 @@ threadsync_set_value(struct snmp_node_instance* instance, u16_t len, void *value call_data->arg1.value = value; call_data->arg2.len = len; call_synced_function(call_data, threadsync_set_value_synced); - + return call_data->retval.err; } @@ -119,7 +119,7 @@ static void threadsync_release_instance_synced(void* ctx) { struct threadsync_data *call_data = (struct threadsync_data*)ctx; - + call_data->proxy_instance.release_instance(&call_data->proxy_instance); sys_sem_signal(&call_data->threadsync_node->instance->sem); @@ -129,7 +129,7 @@ static void threadsync_release_instance(struct snmp_node_instance *instance) { struct threadsync_data *call_data = (struct threadsync_data*)instance->reference.ptr; - + if (call_data->proxy_instance.release_instance != NULL) { call_synced_function(call_data, threadsync_release_instance_synced); } diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c b/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c index 2135a6478a..0d2df64991 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmp_traps.c @@ -228,7 +228,7 @@ snmp_send_trap(const struct snmp_obj_id* eoid, s32_t generic_trap, s32_t specifi * @ingroup snmp_traps * Send generic SNMP trap */ -err_t +err_t snmp_send_trap_generic(s32_t generic_trap) { static const struct snmp_obj_id oid = { 7, { 1, 3, 6, 1, 2, 1, 11 } }; @@ -257,7 +257,7 @@ snmp_coldstart_trap(void) /** * @ingroup snmp_traps - * Send authentication failure trap (used internally by agent) + * Send authentication failure trap (used internally by agent) */ void snmp_authfail_trap(void) diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c index f2268f1d3c..bdfe844994 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_dummy.c @@ -52,17 +52,17 @@ snmpv3_get_user(const char* username, u8_t *auth_algo, u8_t *auth_key, u8_t *pri { const char* engine_id; u8_t engine_id_len; - + if(strlen(username) == 0) { return ERR_OK; } - + if(memcmp(username, "lwip", 4) != 0) { return ERR_VAL; } - + snmpv3_get_engine_id(&engine_id, &engine_id_len); - + if(auth_key != NULL) { snmpv3_password_to_key_sha((const u8_t*)"maplesyrup", 10, (const u8_t*)engine_id, engine_id_len, @@ -105,7 +105,7 @@ snmpv3_set_engine_id(const char *id, u8_t len) /** * Get engine boots from persistence. Must be increased on each boot. - * @return + * @return */ u32_t snmpv3_get_engine_boots(void) @@ -117,7 +117,7 @@ snmpv3_get_engine_boots(void) * Store engine boots in persistence * @param boots */ -void +void snmpv3_set_engine_boots(u32_t boots) { LWIP_UNUSED_ARG(boots); diff --git a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c index b48829bae8..0b1eefb87e 100644 --- a/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c +++ b/components/net/lwip-2.0.2/src/apps/snmp/snmpv3_mbedtls.c @@ -73,7 +73,7 @@ snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, if(mbedtls_md_setup(&ctx, md_info, 1) != 0) { return ERR_ARG; } - + if (mbedtls_md_hmac_starts(&ctx, key, key_len) != 0) { goto free_md; } @@ -96,7 +96,7 @@ snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, mbedtls_md_free(&ctx); return ERR_OK; - + free_md: mbedtls_md_free(&ctx); return ERR_ARG; @@ -140,7 +140,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, goto error; } - /* Prepare IV */ + /* Prepare IV */ for (i = 0; i < LWIP_ARRAYSIZE(iv_local); i++) { iv_local[i] = priv_param[i] ^ key[i + 8]; } @@ -152,7 +152,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, size_t j; u8_t in_bytes[8]; out_len = LWIP_ARRAYSIZE(out_bytes) ; - + for (j = 0; j < LWIP_ARRAYSIZE(in_bytes); j++) { snmp_pbuf_stream_read(&read_stream, &in_bytes[j]); } @@ -163,7 +163,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, snmp_pbuf_stream_writebuf(&write_stream, out_bytes, out_len); } - + out_len = LWIP_ARRAYSIZE(out_bytes); if(mbedtls_cipher_finish(&ctx, out_bytes, &out_len) != 0) { goto error; @@ -201,7 +201,7 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, u8_t in_byte; u8_t out_byte; size_t out_len = sizeof(out_byte); - + snmp_pbuf_stream_read(&read_stream, &in_byte); if(mbedtls_cipher_update(&ctx, &in_byte, sizeof(in_byte), &out_byte, &out_len) != 0) { goto error; @@ -223,7 +223,7 @@ error: #endif /* LWIP_SNMP_V3_CRYPTO */ /* A.2.1. Password to Key Sample Code for MD5 */ -void +void snmpv3_password_to_key_md5( const u8_t *password, /* IN */ u8_t passwordlen, /* IN */ @@ -276,7 +276,7 @@ snmpv3_password_to_key_md5( } /* A.2.2. Password to Key Sample Code for SHA */ -void +void snmpv3_password_to_key_sha( const u8_t *password, /* IN */ u8_t passwordlen, /* IN */ @@ -323,7 +323,7 @@ snmpv3_password_to_key_sha( mbedtls_sha1_starts(&SH); mbedtls_sha1_update(&SH, password_buf, 40 + engineLength); mbedtls_sha1_finish(&SH, key); - + mbedtls_sha1_free(&SH); return; } diff --git a/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c b/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c index a4c74f99e4..afaa3bb08d 100644 --- a/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c +++ b/components/net/lwip-2.0.2/src/apps/tftp/tftp_server.c @@ -12,7 +12,7 @@ * ********************************************************************/ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * @@ -106,7 +106,7 @@ close_handle(void) } sys_untimeout(tftp_tmr, NULL); - + if (tftp_state.handle) { tftp_state.ctx->close(tftp_state.handle); tftp_state.handle = NULL; @@ -120,7 +120,7 @@ send_error(const ip_addr_t *addr, u16_t port, enum tftp_error code, const char * int str_length = strlen(str); struct pbuf* p; u16_t* payload; - + p = pbuf_alloc(PBUF_TRANSPORT, (u16_t)(TFTP_HEADER_LENGTH + str_length + 1), PBUF_RAM); if(p == NULL) { return; @@ -140,13 +140,13 @@ send_ack(u16_t blknum) { struct pbuf* p; u16_t* payload; - + p = pbuf_alloc(PBUF_TRANSPORT, TFTP_HEADER_LENGTH, PBUF_RAM); if(p == NULL) { return; } payload = (u16_t*) p->payload; - + payload[0] = PP_HTONS(TFTP_ACK); payload[1] = lwip_htons(blknum); udp_sendto(tftp_state.upcb, p, &tftp_state.addr, tftp_state.port); @@ -165,7 +165,7 @@ resend_data(void) pbuf_free(p); return; } - + udp_sendto(tftp_state.upcb, p, &tftp_state.addr, tftp_state.port); pbuf_free(p); } @@ -179,7 +179,7 @@ send_data(void) if(tftp_state.last_data != NULL) { pbuf_free(tftp_state.last_data); } - + tftp_state.last_data = pbuf_alloc(PBUF_TRANSPORT, TFTP_HEADER_LENGTH + TFTP_MAX_PAYLOAD_SIZE, PBUF_RAM); if(tftp_state.last_data == NULL) { return; @@ -208,7 +208,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 LWIP_UNUSED_ARG(arg); LWIP_UNUSED_ARG(upcb); - + if (((tftp_state.port != 0) && (port != tftp_state.port)) || (!ip_addr_isany_val(tftp_state.addr) && !ip_addr_cmp(&tftp_state.addr, addr))) { send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Only one connection at a time is supported"); @@ -235,7 +235,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "Only one connection at a time is supported"); break; } - + sys_timeout(TFTP_TIMER_MSECS, tftp_tmr, NULL); /* find \0 in pbuf -> end of filename string */ @@ -253,7 +253,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 break; } pbuf_copy_partial(p, mode, mode_end_offset-filename_end_offset, filename_end_offset+1); - + tftp_state.handle = tftp_state.ctx->open(filename, mode, opcode == PP_HTONS(TFTP_WRQ)); tftp_state.blknum = 1; @@ -279,12 +279,12 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 break; } - + case PP_HTONS(TFTP_DATA): { int ret; u16_t blknum; - + if (tftp_state.handle == NULL) { send_error(addr, port, TFTP_ERROR_ACCESS_VIOLATION, "No connection"); break; @@ -348,7 +348,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16 break; } - + default: send_error(addr, port, TFTP_ERROR_ILLEGAL_OPERATION, "Unknown operation"); break; @@ -361,7 +361,7 @@ static void tftp_tmr(void* arg) { LWIP_UNUSED_ARG(arg); - + tftp_state.timer++; if (tftp_state.handle == NULL) { @@ -386,7 +386,7 @@ tftp_tmr(void* arg) * Initialize TFTP server. * @param ctx TFTP callback struct */ -err_t +err_t tftp_init(const struct tftp_context *ctx) { err_t ret; diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/perf.h b/components/net/lwip-2.0.2/src/arch/include/arch/perf.h index 4b7720ef40..675f1f65dc 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/perf.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/perf.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: perf.h,v 1.1.1.1 2004/12/16 14:17:13 bear Exp $ @@ -42,8 +42,8 @@ /* void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); + unsigned long c2l, unsigned long c2h, + char *key); void perf_print_times(struct tms *start, struct tms *end, char *key); diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h b/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h index f83188407b..8637cc9263 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: sys_arch.h,v 1.3 2005/03/13 16:03:23 bear Exp $ diff --git a/components/net/lwip-2.0.2/src/core/def.c b/components/net/lwip-2.0.2/src/core/def.c index 171c5c7d48..8125313f41 100644 --- a/components/net/lwip-2.0.2/src/core/def.c +++ b/components/net/lwip-2.0.2/src/core/def.c @@ -11,7 +11,7 @@ * \#define lwip_htonl(x) your_htonl * * Note lwip_ntohs() and lwip_ntohl() are merely references to the htonx counterparts. - * + * * If you \#define them to htons() and htonl(), you should * \#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS to prevent lwIP from * defining htonx/ntohx compatibility macros. diff --git a/components/net/lwip-2.0.2/src/core/dns.c b/components/net/lwip-2.0.2/src/core/dns.c index 6d5b7e6da3..cd4de06229 100644 --- a/components/net/lwip-2.0.2/src/core/dns.c +++ b/components/net/lwip-2.0.2/src/core/dns.c @@ -23,14 +23,14 @@ * Once a hostname has been resolved (or found to be non-existent), * the resolver code calls a specified callback function (which * must be implemented by the module that uses the resolver). - * + * * Multicast DNS queries are supported for names ending on ".local". * However, only "One-Shot Multicast DNS Queries" are supported (RFC 6762 * chapter 5.1), this is not a fully compliant implementation of continuous * mDNS querying! * * All functions must be called from TCPIP thread. - * + * * @see @ref netconn_common for thread-safe access. */ @@ -368,7 +368,7 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver) if (numdns < DNS_MAX_SERVERS) { if (dnsserver != NULL) { dns_servers[numdns] = (*dnsserver); - + #ifdef RT_USING_NETDEV extern struct netif *netif_list; extern struct netdev *netdev_get_by_name(const char *name); diff --git a/components/net/lwip-2.0.2/src/core/inet_chksum.c b/components/net/lwip-2.0.2/src/core/inet_chksum.c index cc2db13a94..917f3e4f1a 100644 --- a/components/net/lwip-2.0.2/src/core/inet_chksum.c +++ b/components/net/lwip-2.0.2/src/core/inet_chksum.c @@ -8,7 +8,7 @@ * your own version, link it in and in your cc.h put: * * \#define LWIP_CHKSUM your_checksum_routine - * + * * Or you can select from the implementations below by defining * LWIP_CHKSUM_ALGORITHM to 1, 2 or 3. */ diff --git a/components/net/lwip-2.0.2/src/core/init.c b/components/net/lwip-2.0.2/src/core/init.c index 8c5a05f6ab..313146133d 100644 --- a/components/net/lwip-2.0.2/src/core/init.c +++ b/components/net/lwip-2.0.2/src/core/init.c @@ -378,7 +378,7 @@ lwip_init(void) #if PPP_SUPPORT ppp_init(); #endif - + #if LWIP_TIMERS sys_timeouts_init(); #endif /* LWIP_TIMERS */ diff --git a/components/net/lwip-2.0.2/src/core/ip.c b/components/net/lwip-2.0.2/src/core/ip.c index 804799470a..2e0240851f 100644 --- a/components/net/lwip-2.0.2/src/core/ip.c +++ b/components/net/lwip-2.0.2/src/core/ip.c @@ -4,19 +4,19 @@ * * @defgroup ip IP * @ingroup callbackstyle_api - * + * * @defgroup ip4 IPv4 * @ingroup ip * * @defgroup ip6 IPv6 * @ingroup ip - * + * * @defgroup ipaddr IP address handling * @ingroup infrastructure - * + * * @defgroup ip4addr IPv4 only * @ingroup ipaddr - * + * * @defgroup ip6addr IPv6 only * @ingroup ipaddr */ diff --git a/components/net/lwip-2.0.2/src/core/ipv4/autoip.c b/components/net/lwip-2.0.2/src/core/ipv4/autoip.c index 79d7615bba..10db8a3444 100644 --- a/components/net/lwip-2.0.2/src/core/ipv4/autoip.c +++ b/components/net/lwip-2.0.2/src/core/ipv4/autoip.c @@ -22,7 +22,7 @@ * With DHCP: * - define @ref LWIP_DHCP_AUTOIP_COOP 1 in your lwipopts.h. * - Configure your DHCP Client. - * + * * @see netifapi_autoip */ @@ -95,7 +95,7 @@ static err_t autoip_arp_announce(struct netif *netif); static void autoip_start_probing(struct netif *netif); /** - * @ingroup autoip + * @ingroup autoip * Set a statically allocated struct autoip to work with. * Using this prevents autoip_start to allocate it using mem_malloc. * @@ -245,7 +245,7 @@ autoip_bind(struct netif *netif) } /** - * @ingroup autoip + * @ingroup autoip * Start AutoIP client * * @param netif network interface on which start the AutoIP client @@ -339,7 +339,7 @@ autoip_network_changed(struct netif *netif) } /** - * @ingroup autoip + * @ingroup autoip * Stop AutoIP client * * @param netif network interface on which stop the AutoIP client diff --git a/components/net/lwip-2.0.2/src/core/ipv4/igmp.c b/components/net/lwip-2.0.2/src/core/ipv4/igmp.c index 57ddc75fbd..74a6c37731 100644 --- a/components/net/lwip-2.0.2/src/core/ipv4/igmp.c +++ b/components/net/lwip-2.0.2/src/core/ipv4/igmp.c @@ -199,7 +199,7 @@ igmp_report_groups(struct netif *netif) if(group != NULL) { group = group->next; } - + while (group != NULL) { igmp_delaying_member(group, IGMP_JOIN_DELAYING_MEMBER_TMR); group = group->next; @@ -252,7 +252,7 @@ igmp_lookup_group(struct netif *ifp, const ip4_addr_t *addr) /* Group already exists. */ return group; } - + /* Group doesn't exist yet, create a new one */ group = (struct igmp_group *)memp_malloc(MEMP_IGMP_GROUP); if (group != NULL) { @@ -262,7 +262,7 @@ igmp_lookup_group(struct netif *ifp, const ip4_addr_t *addr) group->last_reporter_flag = 0; group->use = 0; - /* Ensure allsystems group is always first in list */ + /* Ensure allsystems group is always first in list */ if (list_head == NULL) { /* this is the first entry in linked list */ LWIP_ASSERT("igmp_lookup_group: first group must be allsystems", @@ -379,7 +379,7 @@ igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest) } groupref = netif_igmp_data(inp); - + /* Do not send messages on the all systems group address! */ /* Skip the first group in the list, it is always the allsystems group added in igmp_start() */ if(groupref != NULL) { @@ -674,7 +674,7 @@ igmp_timeout(struct netif *netif, struct igmp_group *group) LWIP_DEBUGF(IGMP_DEBUG, (" on if %p\n", (void*)netif)); group->group_state = IGMP_GROUP_IDLE_MEMBER; - + IGMP_STATS_INC(igmp.tx_report); igmp_send(netif, group, IGMP_V2_MEMB_REPORT); } diff --git a/components/net/lwip-2.0.2/src/core/ipv6/nd6.c b/components/net/lwip-2.0.2/src/core/ipv6/nd6.c index 22078ea776..0b367181b2 100644 --- a/components/net/lwip-2.0.2/src/core/ipv6/nd6.c +++ b/components/net/lwip-2.0.2/src/core/ipv6/nd6.c @@ -159,7 +159,7 @@ nd6_input(struct pbuf *p, struct netif *inp) /* Unsolicited NA?*/ if (ip6_addr_ismulticast(ip6_current_dest_addr())) { ip6_addr_t target_address; - + /* This is an unsolicited NA. * link-layer changed? * part of DAD mechanism? */ @@ -335,7 +335,7 @@ nd6_input(struct pbuf *p, struct netif *inp) } } else { ip6_addr_t target_address; - + /* Sender is trying to resolve our address. */ /* Verify that they included their own link-layer address. */ if (lladdr_opt == NULL) { @@ -1517,9 +1517,9 @@ nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif) for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) { /* check if router already exists (this is a special case for 2 netifs on the same subnet - e.g. wifi and cable) */ - if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ - return router_index; - } + if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ + return router_index; + } if (default_router_list[router_index].neighbor_entry == NULL) { /* remember lowest free index to create a new entry */ free_router_index = router_index; diff --git a/components/net/lwip-2.0.2/src/core/netif.c b/components/net/lwip-2.0.2/src/core/netif.c index 89c0a678b9..ee57bb9a9d 100644 --- a/components/net/lwip-2.0.2/src/core/netif.c +++ b/components/net/lwip-2.0.2/src/core/netif.c @@ -1,16 +1,16 @@ /** * @file * lwIP network interface abstraction - * + * * @defgroup netif Network interface (NETIF) * @ingroup callbackstyle_api - * + * * @defgroup netif_ip4 IPv4 address handling * @ingroup netif - * + * * @defgroup netif_ip6 IPv6 address handling * @ingroup netif - * + * * @defgroup netif_cd Client data handling * Store data (void*) on a netif for application usage. * @see @ref LWIP_NUM_NETIF_CLIENT_DATA @@ -203,7 +203,7 @@ netif_init(void) * ethernet_input() or ip_input() depending on netif flags. * Don't call directly, pass to netif_add() and call * netif->input(). - * Only works if the netif driver correctly sets + * Only works if the netif driver correctly sets * NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag! */ err_t @@ -236,12 +236,12 @@ netif_input(struct pbuf *p, struct netif *inp) * to decide whether to forward to ethernet_input() or ip_input(). * In other words, the functions only work when the netif * driver is implemented correctly!\n - * Most members of struct netif should be be initialized by the + * Most members of struct netif should be be initialized by the * netif init function = netif driver (init parameter of this function).\n * IPv6: Don't forget to call netif_create_ip6_linklocal_address() after * setting the MAC address in struct netif.hwaddr * (IPv6 requires a link-local address). - * + * * @return netif, or NULL if failed. */ struct netif * diff --git a/components/net/lwip-2.0.2/src/core/pbuf.c b/components/net/lwip-2.0.2/src/core/pbuf.c index 34b2939bf4..059f83a571 100644 --- a/components/net/lwip-2.0.2/src/core/pbuf.c +++ b/components/net/lwip-2.0.2/src/core/pbuf.c @@ -62,7 +62,7 @@ void eth_rx_irq() my_pbuf->dma_descriptor = dma_desc; invalidate_cpu_cache(dma_desc->rx_data, dma_desc->rx_length); - + struct pbuf* p = pbuf_alloced_custom(PBUF_RAW, dma_desc->rx_length, PBUF_REF, @@ -352,12 +352,12 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) case PBUF_RAM: { mem_size_t alloc_len = LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length); - + /* bug #50040: Check for integer overflow when calculating alloc_len */ if (alloc_len < LWIP_MEM_ALIGN_SIZE(length)) { return NULL; } - + /* If pbuf is to be allocated in RAM, allocate memory for it. */ p = (struct pbuf*)mem_malloc(alloc_len); } @@ -1364,18 +1364,18 @@ pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n) u16_t start = offset; const struct pbuf* q = p; u16_t i; - + /* pbuf long enough to perform check? */ if(p->tot_len < (offset + n)) { return 0xffff; } - + /* get the correct pbuf from chain. We know it succeeds because of p->tot_len check above. */ while ((q != NULL) && (q->len <= start)) { start -= q->len; q = q->next; } - + /* return requested data if pbuf is OK */ for (i = 0; i < n; i++) { /* We know pbuf_get_at() succeeds because of p->tot_len check above. */ diff --git a/components/net/lwip-2.0.2/src/core/raw.c b/components/net/lwip-2.0.2/src/core/raw.c index 45b559db43..80cf9ec64b 100644 --- a/components/net/lwip-2.0.2/src/core/raw.c +++ b/components/net/lwip-2.0.2/src/core/raw.c @@ -4,7 +4,7 @@ * different types of protocols besides (or overriding) those * already available in lwIP.\n * See also @ref raw_raw - * + * * @defgroup raw_raw RAW * @ingroup callbackstyle_api * Implementation of raw protocol PCBs for low-level handling of diff --git a/components/net/lwip-2.0.2/src/core/tcp.c b/components/net/lwip-2.0.2/src/core/tcp.c index a30dc23581..ec2e1f92ce 100644 --- a/components/net/lwip-2.0.2/src/core/tcp.c +++ b/components/net/lwip-2.0.2/src/core/tcp.c @@ -1,5 +1,5 @@ /** - * @file + * @file * Transmission Control Protocol for IP * See also @ref tcp_raw * @@ -1743,7 +1743,7 @@ tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) * has occurred on the connection. * * @note The corresponding pcb is already freed when this callback is called! - * + * * @param pcb tcp_pcb to set the err callback * @param err callback function to call for this pcb when a fatal error * has occurred on the connection diff --git a/components/net/lwip-2.0.2/src/core/udp.c b/components/net/lwip-2.0.2/src/core/udp.c index 0cbf25edaa..ce2e3d295f 100644 --- a/components/net/lwip-2.0.2/src/core/udp.c +++ b/components/net/lwip-2.0.2/src/core/udp.c @@ -3,7 +3,7 @@ * User Datagram Protocol module\n * The code for the User Datagram Protocol UDP & UDPLite (RFC 3828).\n * See also @ref udp_raw - * + * * @defgroup udp_raw UDP * @ingroup callbackstyle_api * User Datagram Protocol module\n diff --git a/components/net/lwip-2.0.2/src/include/lwip/api.h b/components/net/lwip-2.0.2/src/include/lwip/api.h index 5f37d2ec1f..516bd163dd 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/api.h +++ b/components/net/lwip-2.0.2/src/include/lwip/api.h @@ -140,27 +140,27 @@ enum netconn_state { }; /** Used to inform the callback function about changes - * + * * Event explanation: - * + * * In the netconn implementation, there are three ways to block a client: - * + * * - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) * - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) * - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) - * + * * The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking * connections, you need to know in advance whether a call to a netconn function call would block or not, * and these events tell you about that. - * - * RCVPLUS events say: Safe to perform a potentially blocking call call once more. + * + * RCVPLUS events say: Safe to perform a potentially blocking call call once more. * They are counted in sockets - three RCVPLUS events for accept mbox means you are safe * to call netconn_accept 3 times without being blocked. * Same thing for receive mbox. - * + * * RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". * Socket implementation decrements the counter. - * + * * For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. * SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. * A SENDMINUS event occurs when the next call to a netconn_send() would be blocking. diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h b/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h index a06d4c977c..bb176fa010 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/fs.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h index 35a01e29d6..40f1811e57 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd.h @@ -102,7 +102,7 @@ void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers); #if LWIP_HTTPD_CGI_SSI /** Define this generic CGI handler in your application. * It is called once for every URI with parameters. - * The parameters can be stored to + * The parameters can be stored to */ extern void httpd_cgi_handler(const char* uri, int iNumParams, char **pcParam, char **pcValue #if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h index cbe493c848..340db15f66 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/httpd_opts.h @@ -120,7 +120,7 @@ #define HTTPD_DEBUG LWIP_DBG_OFF #endif -/** Set this to 1 to use a memp pool for allocating +/** Set this to 1 to use a memp pool for allocating * struct http_state instead of the heap. */ #if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__ diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h index 3adeb0510b..34b230b888 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt.h @@ -110,7 +110,7 @@ enum { MQTT_DATA_FLAG_LAST = 1 }; -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish data callback function. Called when data * arrives to a subscribed topic @see mqtt_subscribe @@ -125,7 +125,7 @@ enum { typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags); -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish function. Called when an incoming publish * arrives to a subscribed topic @see mqtt_subscribe diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h index 90eef1555d..ffefacd259 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/mqtt_opts.h @@ -39,7 +39,7 @@ #include "lwip/opt.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h b/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h index d20a988365..e781c532b3 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/snmp_core.h @@ -99,7 +99,7 @@ extern "C" { /** error codes predefined by SNMP prot. */ typedef enum { SNMP_ERR_NOERROR = 0, -/* +/* outdated v1 error codes. do not use anmore! #define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead #define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h index 357eb2e63c..6968a803b4 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_opts.h @@ -11,7 +11,7 @@ * ********************************************************************/ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * diff --git a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h index 387162da8e..3fbe701e0a 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h +++ b/components/net/lwip-2.0.2/src/include/lwip/apps/tftp_server.h @@ -11,7 +11,7 @@ * ********************************************************************/ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * @@ -67,7 +67,7 @@ struct tftp_context { */ void (*close)(void* handle); /** - * Read from file + * Read from file * @param handle File handle returned by open() * @param buf Target buffer to copy read data to * @param bytes Number of bytes to copy to buf diff --git a/components/net/lwip-2.0.2/src/include/lwip/arch.h b/components/net/lwip-2.0.2/src/include/lwip/arch.h index f468ce8b2b..42f47778ae 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/arch.h +++ b/components/net/lwip-2.0.2/src/include/lwip/arch.h @@ -72,7 +72,7 @@ /** Platform specific diagnostic output.\n * Note the default implementation pulls in printf, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_DIAG @@ -83,7 +83,7 @@ /** Platform specific assertion handling.\n * Note the default implementation pulls in printf, fflush and abort, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_ASSERT diff --git a/components/net/lwip-2.0.2/src/include/lwip/igmp.h b/components/net/lwip-2.0.2/src/include/lwip/igmp.h index 0a16db0397..ffd80e680c 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/igmp.h +++ b/components/net/lwip-2.0.2/src/include/lwip/igmp.h @@ -99,7 +99,7 @@ err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); void igmp_tmr(void); -/** @ingroup igmp +/** @ingroup igmp * Get list head of IGMP groups for netif. * Note: The allsystems group IP is contained in the list as first entry. * @see @ref netif_set_igmp_mac_filter() diff --git a/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h b/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h index 07571af12a..11f65d25bd 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h +++ b/components/net/lwip-2.0.2/src/include/lwip/ip_addr.h @@ -373,7 +373,7 @@ extern const ip_addr_t ip_addr_broadcast; extern const ip_addr_t ip6_addr_any; -/** +/** * @ingroup ip6addr * IP6_ADDR_ANY can be used as a fixed ip_addr_t * for the IPv6 wildcard address diff --git a/components/net/lwip-2.0.2/src/include/lwip/mld6.h b/components/net/lwip-2.0.2/src/include/lwip/mld6.h index 2764fdd42d..7fa0797f27 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/mld6.h +++ b/components/net/lwip-2.0.2/src/include/lwip/mld6.h @@ -84,7 +84,7 @@ err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); /** @ingroup mld6 * Get list head of MLD6 groups for netif. - * Note: The allnodes group IP is NOT in the list, since it must always + * Note: The allnodes group IP is NOT in the list, since it must always * be received for correct IPv6 operation. * @see @ref netif_set_mld_mac_filter() */ diff --git a/components/net/lwip-2.0.2/src/include/lwip/opt.h b/components/net/lwip-2.0.2/src/include/lwip/opt.h index 8c46408a3d..fd459af144 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/opt.h +++ b/components/net/lwip-2.0.2/src/include/lwip/opt.h @@ -2564,8 +2564,8 @@ * - src: source eth address * - dst: destination eth address * - eth_type: ethernet type to packet to be sent\n - * - * + * + * * Return values: * - <0: Packet shall not contain VLAN header. * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. diff --git a/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h b/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h index ea7188175d..fae4570479 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h +++ b/components/net/lwip-2.0.2/src/include/lwip/prot/ethernet.h @@ -109,7 +109,7 @@ enum eth_type { /** Internet protocol v4 */ ETHTYPE_IP = 0x0800U, /** Address resolution protocol */ - ETHTYPE_ARP = 0x0806U, + ETHTYPE_ARP = 0x0806U, /** Wake on lan */ ETHTYPE_WOL = 0x0842U, /** RARP */ diff --git a/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h b/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h index 6b5641d809..6e1e2632bf 100644 --- a/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h +++ b/components/net/lwip-2.0.2/src/include/lwip/prot/ip6.h @@ -43,7 +43,7 @@ #ifdef __cplusplus extern "C" { #endif - + /** This is the packed version of ip6_addr_t, used in network headers that are itself packed */ #ifdef PACK_STRUCT_USE_INCLUDES diff --git a/components/net/lwip-2.0.2/src/include/netif/ethernetif.h b/components/net/lwip-2.0.2/src/include/netif/ethernetif.h index 09c6d9a56f..244bafdd1b 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ethernetif.h +++ b/components/net/lwip-2.0.2/src/include/netif/ethernetif.h @@ -4,16 +4,16 @@ #include "lwip/netif.h" #include -#define NIOCTL_GADDR 0x01 +#define NIOCTL_GADDR 0x01 #ifndef RT_LWIP_ETH_MTU -#define ETHERNET_MTU 1500 +#define ETHERNET_MTU 1500 #else -#define ETHERNET_MTU RT_LWIP_ETH_MTU +#define ETHERNET_MTU RT_LWIP_ETH_MTU #endif /* eth flag with auto_linkup or phy_linkup */ -#define ETHIF_LINK_AUTOUP 0x0000 -#define ETHIF_LINK_PHYUP 0x0100 +#define ETHIF_LINK_AUTOUP 0x0000 +#define ETHIF_LINK_PHYUP 0x0100 struct eth_device { diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h index 1e4e602052..14dd65962c 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ccp.h @@ -40,48 +40,48 @@ * CCP codes. */ -#define CCP_CONFREQ 1 -#define CCP_CONFACK 2 -#define CCP_TERMREQ 5 -#define CCP_TERMACK 6 -#define CCP_RESETREQ 14 -#define CCP_RESETACK 15 +#define CCP_CONFREQ 1 +#define CCP_CONFACK 2 +#define CCP_TERMREQ 5 +#define CCP_TERMACK 6 +#define CCP_RESETREQ 14 +#define CCP_RESETACK 15 /* * Max # bytes for a CCP option */ -#define CCP_MAX_OPTION_LENGTH 32 +#define CCP_MAX_OPTION_LENGTH 32 /* * Parts of a CCP packet. */ -#define CCP_CODE(dp) ((dp)[0]) -#define CCP_ID(dp) ((dp)[1]) -#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) -#define CCP_HDRLEN 4 +#define CCP_CODE(dp) ((dp)[0]) +#define CCP_ID(dp) ((dp)[1]) +#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) +#define CCP_HDRLEN 4 -#define CCP_OPT_CODE(dp) ((dp)[0]) -#define CCP_OPT_LENGTH(dp) ((dp)[1]) -#define CCP_OPT_MINLEN 2 +#define CCP_OPT_CODE(dp) ((dp)[0]) +#define CCP_OPT_LENGTH(dp) ((dp)[1]) +#define CCP_OPT_MINLEN 2 #if BSDCOMPRESS_SUPPORT /* * Definitions for BSD-Compress. */ -#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ -#define CILEN_BSD_COMPRESS 3 /* length of config. option */ +#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ +#define CILEN_BSD_COMPRESS 3 /* length of config. option */ /* Macros for handling the 3rd byte of the BSD-Compress config option. */ -#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ -#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ -#define BSD_CURRENT_VERSION 1 /* current version number */ -#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) +#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ +#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ +#define BSD_CURRENT_VERSION 1 /* current version number */ +#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) -#define BSD_MIN_BITS 9 /* smallest code size supported */ -#define BSD_MAX_BITS 15 /* largest code size supported */ +#define BSD_MIN_BITS 9 /* smallest code size supported */ +#define BSD_MAX_BITS 15 /* largest code size supported */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -89,17 +89,17 @@ * Definitions for Deflate. */ -#define CI_DEFLATE 26 /* config option for Deflate */ -#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ -#define CILEN_DEFLATE 4 /* length of its config option */ - -#define DEFLATE_MIN_SIZE 9 -#define DEFLATE_MAX_SIZE 15 -#define DEFLATE_METHOD_VAL 8 -#define DEFLATE_SIZE(x) (((x) >> 4) + 8) -#define DEFLATE_METHOD(x) ((x) & 0x0F) -#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) -#define DEFLATE_CHK_SEQUENCE 0 +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ +#define CILEN_DEFLATE 4 /* length of its config option */ + +#define DEFLATE_MIN_SIZE 9 +#define DEFLATE_MAX_SIZE 15 +#define DEFLATE_METHOD_VAL 8 +#define DEFLATE_SIZE(x) (((x) >> 4) + 8) +#define DEFLATE_METHOD(x) ((x) & 0x0F) +#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) +#define DEFLATE_CHK_SEQUENCE 0 #endif /* DEFLATE_SUPPORT */ #if MPPE_SUPPORT @@ -116,10 +116,10 @@ * Definitions for other, as yet unsupported, compression methods. */ -#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ -#define CILEN_PREDICTOR_1 2 /* length of its config option */ -#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ -#define CILEN_PREDICTOR_2 2 /* length of its config option */ +#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ +#define CILEN_PREDICTOR_1 2 /* length of its config option */ +#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ +#define CILEN_PREDICTOR_2 2 /* length of its config option */ #endif /* PREDICTOR_SUPPORT */ typedef struct ccp_options { @@ -137,15 +137,15 @@ typedef struct ccp_options { #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - u8_t mppe; /* MPPE bitfield */ + u8_t mppe; /* MPPE bitfield */ #endif /* MPPE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - u_short bsd_bits; /* # bits/code for BSD Compress */ + u_short bsd_bits; /* # bits/code for BSD Compress */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - u_short deflate_size; /* lg(window size) for Deflate */ + u_short deflate_size; /* lg(window size) for Deflate */ #endif /* DEFLATE_SUPPORT */ - u8_t method; /* code for chosen compression method */ + u8_t method; /* code for chosen compression method */ } ccp_options; extern const struct protent ccp_protent; diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h b/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h index 6a37c8e6ff..64eae32202 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/chap-new.h @@ -39,45 +39,45 @@ /* * CHAP packets begin with a standard header with code, id, len (2 bytes). */ -#define CHAP_HDRLEN 4 +#define CHAP_HDRLEN 4 /* * Values for the code field. */ -#define CHAP_CHALLENGE 1 -#define CHAP_RESPONSE 2 -#define CHAP_SUCCESS 3 -#define CHAP_FAILURE 4 +#define CHAP_CHALLENGE 1 +#define CHAP_RESPONSE 2 +#define CHAP_SUCCESS 3 +#define CHAP_FAILURE 4 /* * CHAP digest codes. */ -#define CHAP_MD5 5 +#define CHAP_MD5 5 #if MSCHAP_SUPPORT -#define CHAP_MICROSOFT 0x80 -#define CHAP_MICROSOFT_V2 0x81 +#define CHAP_MICROSOFT 0x80 +#define CHAP_MICROSOFT_V2 0x81 #endif /* MSCHAP_SUPPORT */ /* * Semi-arbitrary limits on challenge and response fields. */ -#define MAX_CHALLENGE_LEN 64 -#define MAX_RESPONSE_LEN 64 +#define MAX_CHALLENGE_LEN 64 +#define MAX_RESPONSE_LEN 64 /* * These limits apply to challenge and response packets we send. * The +4 is the +1 that we actually need rounded up. */ -#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) -#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) +#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) +#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) /* bitmask of supported algorithms */ #if MSCHAP_SUPPORT -#define MDTYPE_MICROSOFT_V2 0x1 -#define MDTYPE_MICROSOFT 0x2 +#define MDTYPE_MICROSOFT_V2 0x1 +#define MDTYPE_MICROSOFT 0x2 #endif /* MSCHAP_SUPPORT */ -#define MDTYPE_MD5 0x4 -#define MDTYPE_NONE 0 +#define MDTYPE_MD5 0x4 +#define MDTYPE_NONE 0 #if MSCHAP_SUPPORT /* Return the digest alg. ID for the most preferred digest type. */ @@ -125,24 +125,24 @@ * The code for each digest type has to supply one of these. */ struct chap_digest_type { - int code; + int code; #if PPP_SERVER - /* - * Note: challenge and response arguments below are formatted as - * a length byte followed by the actual challenge/response data. - */ - void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); - int (*verify_response)(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + /* + * Note: challenge and response arguments below are formatted as + * a length byte followed by the actual challenge/response data. + */ + void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); + int (*verify_response)(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ - void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *priv); - int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); - void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); + void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *priv); + int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); + void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); }; /* @@ -150,21 +150,21 @@ struct chap_digest_type { */ #if CHAP_SUPPORT typedef struct chap_client_state { - u8_t flags; - const char *name; - const struct chap_digest_type *digest; - unsigned char priv[64]; /* private area for digest's use */ + u8_t flags; + const char *name; + const struct chap_digest_type *digest; + unsigned char priv[64]; /* private area for digest's use */ } chap_client_state; #if PPP_SERVER typedef struct chap_server_state { - u8_t flags; - u8_t id; - const char *name; - const struct chap_digest_type *digest; - int challenge_xmits; - int challenge_pktlen; - unsigned char challenge[CHAL_MAX_PKTLEN]; + u8_t flags; + u8_t id; + const char *name; + const struct chap_digest_type *digest; + int challenge_xmits; + int challenge_pktlen; + unsigned char challenge[CHAL_MAX_PKTLEN]; } chap_server_state; #endif /* PPP_SERVER */ #endif /* CHAP_SUPPORT */ @@ -172,9 +172,9 @@ typedef struct chap_server_state { #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ extern int (*chap_verify_hook)(char *name, char *ourname, int id, - const struct chap_digest_type *digest, - unsigned char *challenge, unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + unsigned char *challenge, unsigned char *response, + char *message, int message_space); #endif /* UNUSED */ #if PPP_SERVER diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h b/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h index 491e52ab11..3ee9aaf81a 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/eap.h @@ -24,135 +24,135 @@ #if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef PPP_EAP_H -#define PPP_EAP_H +#define PPP_EAP_H #include "ppp.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif /* * Packet header = Code, id, length. */ -#define EAP_HEADERLEN 4 +#define EAP_HEADERLEN 4 /* EAP message codes. */ -#define EAP_REQUEST 1 -#define EAP_RESPONSE 2 -#define EAP_SUCCESS 3 -#define EAP_FAILURE 4 +#define EAP_REQUEST 1 +#define EAP_RESPONSE 2 +#define EAP_SUCCESS 3 +#define EAP_FAILURE 4 /* EAP types */ -#define EAPT_IDENTITY 1 -#define EAPT_NOTIFICATION 2 -#define EAPT_NAK 3 /* (response only) */ -#define EAPT_MD5CHAP 4 -#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ -#define EAPT_TOKEN 6 /* Generic Token Card */ +#define EAPT_IDENTITY 1 +#define EAPT_NOTIFICATION 2 +#define EAPT_NAK 3 /* (response only) */ +#define EAPT_MD5CHAP 4 +#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ +#define EAPT_TOKEN 6 /* Generic Token Card */ /* 7 and 8 are unassigned. */ -#define EAPT_RSA 9 /* RSA Public Key Authentication */ -#define EAPT_DSS 10 /* DSS Unilateral */ -#define EAPT_KEA 11 /* KEA */ -#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ -#define EAPT_TLS 13 /* EAP-TLS */ -#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ -#define EAPT_W2K 15 /* Windows 2000 EAP */ -#define EAPT_ARCOT 16 /* Arcot Systems */ -#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ -#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ -#define EAPT_SRP 19 /* Secure Remote Password */ +#define EAPT_RSA 9 /* RSA Public Key Authentication */ +#define EAPT_DSS 10 /* DSS Unilateral */ +#define EAPT_KEA 11 /* KEA */ +#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ +#define EAPT_TLS 13 /* EAP-TLS */ +#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ +#define EAPT_W2K 15 /* Windows 2000 EAP */ +#define EAPT_ARCOT 16 /* Arcot Systems */ +#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ +#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ +#define EAPT_SRP 19 /* Secure Remote Password */ /* 20 is deprecated */ /* EAP SRP-SHA1 Subtypes */ -#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ -#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ -#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ -#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ -#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ -#define EAPSRP_ACK 3 /* Response 3 - final ack */ -#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ - -#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ - -#define SRP_PSEUDO_ID "pseudo_" -#define SRP_PSEUDO_LEN 7 - -#define MD5_SIGNATURE_SIZE 16 -#define EAP_MIN_CHALLENGE_LENGTH 17 -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ +#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ +#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ +#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ +#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ +#define EAPSRP_ACK 3 /* Response 3 - final ack */ +#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ + +#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ + +#define SRP_PSEUDO_ID "pseudo_" +#define SRP_PSEUDO_LEN 7 + +#define MD5_SIGNATURE_SIZE 16 +#define EAP_MIN_CHALLENGE_LENGTH 17 +#define EAP_MAX_CHALLENGE_LENGTH 24 #define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH 3 /* 2^3-1 = 7, 17+7 = 24 */ -#define EAP_STATES \ - "Initial", "Pending", "Closed", "Listen", "Identify", \ - "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" +#define EAP_STATES \ + "Initial", "Pending", "Closed", "Listen", "Identify", \ + "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" -#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) +#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) #if PPP_SERVER -#define eap_server_active(pcb) \ - ((pcb)->eap.es_server.ea_state >= eapIdentify && \ - (pcb)->eap.es_server.ea_state <= eapMD5Chall) +#define eap_server_active(pcb) \ + ((pcb)->eap.es_server.ea_state >= eapIdentify && \ + (pcb)->eap.es_server.ea_state <= eapMD5Chall) #endif /* PPP_SERVER */ /* * Complete EAP state for one PPP session. */ enum eap_state_code { - eapInitial = 0, /* No EAP authentication yet requested */ - eapPending, /* Waiting for LCP (no timer) */ - eapClosed, /* Authentication not in use */ - eapListen, /* Client ready (and timer running) */ - eapIdentify, /* EAP Identify sent */ - eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ - eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ - eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ - eapMD5Chall, /* Sent MD5-Challenge */ - eapOpen, /* Completed authentication */ - eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ - eapBadAuth /* Failed authentication */ + eapInitial = 0, /* No EAP authentication yet requested */ + eapPending, /* Waiting for LCP (no timer) */ + eapClosed, /* Authentication not in use */ + eapListen, /* Client ready (and timer running) */ + eapIdentify, /* EAP Identify sent */ + eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ + eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ + eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ + eapMD5Chall, /* Sent MD5-Challenge */ + eapOpen, /* Completed authentication */ + eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ + eapBadAuth /* Failed authentication */ }; struct eap_auth { - const char *ea_name; /* Our name */ - char ea_peer[MAXNAMELEN +1]; /* Peer's name */ - void *ea_session; /* Authentication library linkage */ - u_char *ea_skey; /* Shared encryption key */ - u_short ea_namelen; /* Length of our name */ - u_short ea_peerlen; /* Length of peer's name */ - enum eap_state_code ea_state; - u_char ea_id; /* Current id */ - u_char ea_requests; /* Number of Requests sent/received */ - u_char ea_responses; /* Number of Responses */ - u_char ea_type; /* One of EAPT_* */ - u32_t ea_keyflags; /* SRP shared key usage flags */ + const char *ea_name; /* Our name */ + char ea_peer[MAXNAMELEN +1]; /* Peer's name */ + void *ea_session; /* Authentication library linkage */ + u_char *ea_skey; /* Shared encryption key */ + u_short ea_namelen; /* Length of our name */ + u_short ea_peerlen; /* Length of peer's name */ + enum eap_state_code ea_state; + u_char ea_id; /* Current id */ + u_char ea_requests; /* Number of Requests sent/received */ + u_char ea_responses; /* Number of Responses */ + u_char ea_type; /* One of EAPT_* */ + u32_t ea_keyflags; /* SRP shared key usage flags */ }; #ifndef EAP_MAX_CHALLENGE_LENGTH -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAP_MAX_CHALLENGE_LENGTH 24 #endif typedef struct eap_state { - struct eap_auth es_client; /* Client (authenticatee) data */ + struct eap_auth es_client; /* Client (authenticatee) data */ #if PPP_SERVER - struct eap_auth es_server; /* Server (authenticator) data */ + struct eap_auth es_server; /* Server (authenticator) data */ #endif /* PPP_SERVER */ - int es_savedtime; /* Saved timeout */ - int es_rechallenge; /* EAP rechallenge interval */ - int es_lwrechallenge; /* SRP lightweight rechallenge inter */ - u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ - int es_usedpseudo; /* Set if we already sent PN */ - int es_challen; /* Length of challenge string */ - u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; + int es_savedtime; /* Saved timeout */ + int es_rechallenge; /* EAP rechallenge interval */ + int es_lwrechallenge; /* SRP lightweight rechallenge inter */ + u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ + int es_usedpseudo; /* Set if we already sent PN */ + int es_challen; /* Length of challenge string */ + u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; } eap_state; /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ -#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ -#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ -#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ +#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ +#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ +#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ +#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ #endif /* moved to ppp_opts.h */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname); @@ -160,7 +160,7 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname); extern const struct protent eap_protent; -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h index d1d43dc683..5cdce29d5b 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ecp.h @@ -35,8 +35,8 @@ #if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ typedef struct ecp_options { - bool required; /* Is ECP required? */ - unsigned enctype; /* Encryption type */ + bool required; /* Is ECP required? */ + unsigned enctype; /* Encryption type */ } ecp_options; extern fsm ecp_fsm[]; diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h b/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h index 69b2b238c0..20ac22eede 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/eui64.h @@ -53,42 +53,42 @@ typedef union u32_t e32[2]; } eui64_t; -#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) -#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ - ((e).e32[1] == (o).e32[1])) -#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; +#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) +#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ + ((e).e32[1] == (o).e32[1])) +#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; -#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) +#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) -#define eui64_magic(e) do { \ - (e).e32[0] = magic(); \ - (e).e32[1] = magic(); \ - (e).e8[0] &= ~2; \ - } while (0) -#define eui64_magic_nz(x) do { \ - eui64_magic(x); \ - } while (eui64_iszero(x)) -#define eui64_magic_ne(x, y) do { \ - eui64_magic(x); \ - } while (eui64_equals(x, y)) +#define eui64_magic(e) do { \ + (e).e32[0] = magic(); \ + (e).e32[1] = magic(); \ + (e).e8[0] &= ~2; \ + } while (0) +#define eui64_magic_nz(x) do { \ + eui64_magic(x); \ + } while (eui64_iszero(x)) +#define eui64_magic_ne(x, y) do { \ + eui64_magic(x); \ + } while (eui64_equals(x, y)) -#define eui64_get(ll, cp) do { \ - eui64_copy((*cp), (ll)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_get(ll, cp) do { \ + eui64_copy((*cp), (ll)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_put(ll, cp) do { \ - eui64_copy((ll), (*cp)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_put(ll, cp) do { \ + eui64_copy((ll), (*cp)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_set32(e, l) do { \ - (e).e32[0] = 0; \ - (e).e32[1] = lwip_htonl(l); \ - } while (0) -#define eui64_setlo32(e, l) eui64_set32(e, l) +#define eui64_set32(e, l) do { \ + (e).e32[0] = 0; \ + (e).e32[1] = lwip_htonl(l); \ + } while (0) +#define eui64_setlo32(e, l) eui64_set32(e, l) -char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ +char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ #endif /* EUI64_H */ #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h b/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h index 9f128beae5..b6915d3b80 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/fsm.h @@ -46,115 +46,115 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef FSM_H -#define FSM_H +#define FSM_H #include "ppp.h" /* * Packet header = Code, id, length. */ -#define HEADERLEN 4 +#define HEADERLEN 4 /* * CP (LCP, IPCP, etc.) codes. */ -#define CONFREQ 1 /* Configuration Request */ -#define CONFACK 2 /* Configuration Ack */ -#define CONFNAK 3 /* Configuration Nak */ -#define CONFREJ 4 /* Configuration Reject */ -#define TERMREQ 5 /* Termination Request */ -#define TERMACK 6 /* Termination Ack */ -#define CODEREJ 7 /* Code Reject */ +#define CONFREQ 1 /* Configuration Request */ +#define CONFACK 2 /* Configuration Ack */ +#define CONFNAK 3 /* Configuration Nak */ +#define CONFREJ 4 /* Configuration Reject */ +#define TERMREQ 5 /* Termination Request */ +#define TERMACK 6 /* Termination Ack */ +#define CODEREJ 7 /* Code Reject */ /* * Each FSM is described by an fsm structure and fsm callbacks. */ typedef struct fsm { - ppp_pcb *pcb; /* PPP Interface */ - const struct fsm_callbacks *callbacks; /* Callback routines */ - const char *term_reason; /* Reason for closing protocol */ - u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ - /* -- This is our only flag, we might use u_int :1 if we have more flags */ - u16_t protocol; /* Data Link Layer Protocol field value */ - u8_t state; /* State */ - u8_t flags; /* Contains option bits */ - u8_t id; /* Current id */ - u8_t reqid; /* Current request id */ - u8_t retransmits; /* Number of retransmissions left */ - u8_t nakloops; /* Number of nak loops since last ack */ - u8_t rnakloops; /* Number of naks received */ - u8_t maxnakloops; /* Maximum number of nak loops tolerated - (necessary because IPCP require a custom large max nak loops value) */ - u8_t term_reason_len; /* Length of term_reason */ + ppp_pcb *pcb; /* PPP Interface */ + const struct fsm_callbacks *callbacks; /* Callback routines */ + const char *term_reason; /* Reason for closing protocol */ + u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + /* -- This is our only flag, we might use u_int :1 if we have more flags */ + u16_t protocol; /* Data Link Layer Protocol field value */ + u8_t state; /* State */ + u8_t flags; /* Contains option bits */ + u8_t id; /* Current id */ + u8_t reqid; /* Current request id */ + u8_t retransmits; /* Number of retransmissions left */ + u8_t nakloops; /* Number of nak loops since last ack */ + u8_t rnakloops; /* Number of naks received */ + u8_t maxnakloops; /* Maximum number of nak loops tolerated + (necessary because IPCP require a custom large max nak loops value) */ + u8_t term_reason_len; /* Length of term_reason */ } fsm; typedef struct fsm_callbacks { - void (*resetci) /* Reset our Configuration Information */ - (fsm *); - int (*cilen) /* Length of our Configuration Information */ - (fsm *); - void (*addci) /* Add our Configuration Information */ - (fsm *, u_char *, int *); - int (*ackci) /* ACK our Configuration Information */ - (fsm *, u_char *, int); - int (*nakci) /* NAK our Configuration Information */ - (fsm *, u_char *, int, int); - int (*rejci) /* Reject our Configuration Information */ - (fsm *, u_char *, int); - int (*reqci) /* Request peer's Configuration Information */ - (fsm *, u_char *, int *, int); - void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ - (fsm *); - void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ - (fsm *); - void (*starting) /* Called when we want the lower layer */ - (fsm *); - void (*finished) /* Called when we don't want the lower layer */ - (fsm *); - void (*protreject) /* Called when Protocol-Reject received */ - (int); - void (*retransmit) /* Retransmission is necessary */ - (fsm *); - int (*extcode) /* Called when unknown code received */ - (fsm *, int, int, u_char *, int); - const char *proto_name; /* String name for protocol (for messages) */ + void (*resetci) /* Reset our Configuration Information */ + (fsm *); + int (*cilen) /* Length of our Configuration Information */ + (fsm *); + void (*addci) /* Add our Configuration Information */ + (fsm *, u_char *, int *); + int (*ackci) /* ACK our Configuration Information */ + (fsm *, u_char *, int); + int (*nakci) /* NAK our Configuration Information */ + (fsm *, u_char *, int, int); + int (*rejci) /* Reject our Configuration Information */ + (fsm *, u_char *, int); + int (*reqci) /* Request peer's Configuration Information */ + (fsm *, u_char *, int *, int); + void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ + (fsm *); + void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ + (fsm *); + void (*starting) /* Called when we want the lower layer */ + (fsm *); + void (*finished) /* Called when we don't want the lower layer */ + (fsm *); + void (*protreject) /* Called when Protocol-Reject received */ + (int); + void (*retransmit) /* Retransmission is necessary */ + (fsm *); + int (*extcode) /* Called when unknown code received */ + (fsm *, int, int, u_char *, int); + const char *proto_name; /* String name for protocol (for messages) */ } fsm_callbacks; /* * Link states. */ -#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ -#define PPP_FSM_STARTING 1 /* Down, been opened */ -#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ -#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ -#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ -#define PPP_FSM_STOPPING 5 /* Terminating, but open */ -#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ -#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ -#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ -#define PPP_FSM_OPENED 9 /* Connection available */ +#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ +#define PPP_FSM_STARTING 1 /* Down, been opened */ +#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ +#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ +#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ +#define PPP_FSM_STOPPING 5 /* Terminating, but open */ +#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ +#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ +#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ +#define PPP_FSM_OPENED 9 /* Connection available */ /* * Flags - indicate options controlling FSM operation */ -#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ -#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ -#define OPT_SILENT 4 /* Wait for peer to speak first */ +#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ +#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ +#define OPT_SILENT 4 /* Wait for peer to speak first */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define DEFTIMEOUT 3 /* Timeout time in seconds */ -#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ +#define DEFTIMEOUT 3 /* Timeout time in seconds */ +#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ #endif /* moved to ppp_opts.h */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h index 38d1b6e18b..45f46b31ff 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ipcp.h @@ -46,37 +46,37 @@ #if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPCP_H -#define IPCP_H +#define IPCP_H /* * Options. */ -#define CI_ADDRS 1 /* IP Addresses */ +#define CI_ADDRS 1 /* IP Addresses */ #if VJ_SUPPORT -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* VJ_SUPPORT */ -#define CI_ADDR 3 +#define CI_ADDR 3 #if LWIP_DNS -#define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_DNS1 129 /* Primary DNS value */ #define CI_MS_DNS2 131 /* Secondary DNS value */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define CI_MS_WINS1 130 /* Primary WINS value */ -#define CI_MS_WINS2 132 /* Secondary WINS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT -#define MAX_STATES 16 /* from slcompress.h */ +#define MAX_STATES 16 /* from slcompress.h */ -#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ -#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ -#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ +#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ +#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ +#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ /* maxslot and slot number compression) */ -#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ -#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option*/ +#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ +#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ + /* compression option*/ #endif /* VJ_SUPPORT */ typedef struct ipcp_options { @@ -102,17 +102,17 @@ typedef struct ipcp_options { unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ #endif /* LWIP_DNS */ - u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ + u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ #if LWIP_DNS - u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ + u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ + u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT - u16_t vj_protocol; /* protocol value to use in VJ option */ - u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ + u16_t vj_protocol; /* protocol value to use in VJ option */ + u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ #endif /* VJ_SUPPORT */ } ipcp_options; diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h index e99c80a835..07d1ae3186 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ipv6cp.h @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -142,20 +142,20 @@ #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPV6CP_H -#define IPV6CP_H +#define IPV6CP_H #include "eui64.h" /* * Options. */ -#define CI_IFACEID 1 /* Interface Identifier */ +#define CI_IFACEID 1 /* Interface Identifier */ #ifdef IPV6CP_COMP -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* IPV6CP_COMP */ /* No compression types yet defined. - *#define IPV6CP_COMP 0x004f + *#define IPV6CP_COMP 0x004f */ typedef struct ipv6cp_options { unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h index e1e108d856..12e2a05fc9 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/lcp.h @@ -46,62 +46,62 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef LCP_H -#define LCP_H +#define LCP_H #include "ppp.h" /* * Options. */ -#define CI_VENDOR 0 /* Vendor Specific */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_FCSALTERN 9 /* FCS-Alternatives */ -#define CI_SDP 10 /* Self-Describing-Pad */ -#define CI_NUMBERED 11 /* Numbered-Mode */ -#define CI_CALLBACK 13 /* callback */ -#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ -#define CI_SSNHF 18 /* short sequence numbers for multilink */ -#define CI_EPDISC 19 /* endpoint discriminator */ -#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ -#define CI_LDISC 23 /* Link-Discriminator */ -#define CI_LCPAUTH 24 /* LCP Authentication */ -#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ -#define CI_PREFELIS 26 /* Prefix Elision */ -#define CI_MPHDRFMT 27 /* MP Header Format */ -#define CI_I18N 28 /* Internationalization */ -#define CI_SDL 29 /* Simple Data Link */ +#define CI_VENDOR 0 /* Vendor Specific */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCSALTERN 9 /* FCS-Alternatives */ +#define CI_SDP 10 /* Self-Describing-Pad */ +#define CI_NUMBERED 11 /* Numbered-Mode */ +#define CI_CALLBACK 13 /* callback */ +#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ +#define CI_SSNHF 18 /* short sequence numbers for multilink */ +#define CI_EPDISC 19 /* endpoint discriminator */ +#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ +#define CI_LDISC 23 /* Link-Discriminator */ +#define CI_LCPAUTH 24 /* LCP Authentication */ +#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ +#define CI_PREFELIS 26 /* Prefix Elision */ +#define CI_MPHDRFMT 27 /* MP Header Format */ +#define CI_I18N 28 /* Internationalization */ +#define CI_SDL 29 /* Simple Data Link */ /* * LCP-specific packet types (code numbers). */ -#define PROTREJ 8 /* Protocol Reject */ -#define ECHOREQ 9 /* Echo Request */ -#define ECHOREP 10 /* Echo Reply */ -#define DISCREQ 11 /* Discard Request */ -#define IDENTIF 12 /* Identification */ -#define TIMEREM 13 /* Time Remaining */ +#define PROTREJ 8 /* Protocol Reject */ +#define ECHOREQ 9 /* Echo Request */ +#define ECHOREP 10 /* Echo Reply */ +#define DISCREQ 11 /* Discard Request */ +#define IDENTIF 12 /* Identification */ +#define TIMEREM 13 /* Time Remaining */ /* Value used as data for CI_CALLBACK option */ -#define CBCP_OPT 6 /* Use callback control protocol */ +#define CBCP_OPT 6 /* Use callback control protocol */ #if 0 /* moved to ppp_opts.h */ -#define DEFMRU 1500 /* Try for this */ -#define MINMRU 128 /* No MRUs below this */ -#define MAXMRU 16384 /* Normally limit MRU to this */ +#define DEFMRU 1500 /* Try for this */ +#define MINMRU 128 /* No MRUs below this */ +#define MAXMRU 16384 /* Normally limit MRU to this */ #endif /* moved to ppp_opts.h */ /* An endpoint discriminator, used with multilink. */ -#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ struct epdisc { - unsigned char class_; /* -- The word "class" is reserved in C++. */ - unsigned char length; - unsigned char value[MAX_ENDP_LEN]; + unsigned char class_; /* -- The word "class" is reserved in C++. */ + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; }; /* @@ -137,20 +137,20 @@ typedef struct lcp_options { unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ - u16_t mru; /* Value of MRU */ + u16_t mru; /* Value of MRU */ #ifdef HAVE_MULTILINK - u16_t mrru; /* Value of MRRU, and multilink enable */ + u16_t mrru; /* Value of MRRU, and multilink enable */ #endif /* MULTILINK */ #if CHAP_SUPPORT - u8_t chap_mdtype; /* which MD types (hashing algorithm) */ + u8_t chap_mdtype; /* which MD types (hashing algorithm) */ #endif /* CHAP_SUPPORT */ - u32_t asyncmap; /* Value of async map */ + u32_t asyncmap; /* Value of async map */ u32_t magicnumber; - u8_t numloops; /* Number of loops during magic number neg. */ + u8_t numloops; /* Number of loops during magic number neg. */ #if LQR_SUPPORT - u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ + u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ #endif /* LQR_SUPPORT */ - struct epdisc endpoint; /* endpoint discriminator */ + struct epdisc endpoint; /* endpoint discriminator */ } lcp_options; void lcp_open(ppp_pcb *pcb); @@ -164,7 +164,7 @@ extern const struct protent lcp_protent; #if 0 /* moved to ppp_opts.h */ /* Default number of times we receive our magic number from the peer before deciding the link is looped-back. */ -#define DEFLOOPBACKFAIL 10 +#define DEFLOOPBACKFAIL 10 #endif /* moved to ppp_opts.h */ #endif /* LCP_H */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h b/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h index cc581d405c..a2a9b530e5 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/magic.h @@ -98,7 +98,7 @@ void magic_randomize(void); /* * Return a new random number. */ -u32_t magic(void); /* Returns the next magic number */ +u32_t magic(void); /* Returns the next magic number */ /* * Fill buffer with random bytes diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h b/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h index 1a3aa01c37..1ae8a5d924 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/mppe.h @@ -41,19 +41,19 @@ #include "netif/ppp/pppcrypt.h" -#define MPPE_PAD 4 /* MPPE growth per frame */ -#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ +#define MPPE_PAD 4 /* MPPE growth per frame */ +#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ /* option bits for ccp_options.mppe */ -#define MPPE_OPT_40 0x01 /* 40 bit */ -#define MPPE_OPT_128 0x02 /* 128 bit */ -#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ +#define MPPE_OPT_40 0x01 /* 40 bit */ +#define MPPE_OPT_128 0x02 /* 128 bit */ +#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ /* unsupported opts */ -#define MPPE_OPT_56 0x08 /* 56 bit */ -#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ -#define MPPE_OPT_D 0x20 /* Unknown */ +#define MPPE_OPT_56 0x08 /* 56 bit */ +#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ +#define MPPE_OPT_D 0x20 /* Unknown */ #define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D) -#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ +#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ /* * This is not nice ... the alternative is a bitfield struct though. @@ -62,70 +62,70 @@ * but then we have to do a lwip_htonl() all the time and/or we still need * to know which octet is which. */ -#define MPPE_C_BIT 0x01 /* MPPC */ -#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ -#define MPPE_L_BIT 0x20 /* 40-bit */ -#define MPPE_S_BIT 0x40 /* 128-bit */ -#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ -#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ +#define MPPE_C_BIT 0x01 /* MPPC */ +#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ +#define MPPE_L_BIT 0x20 /* 40-bit */ +#define MPPE_S_BIT 0x40 /* 128-bit */ +#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ +#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ /* Does not include H bit; used for least significant octet only. */ #define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT) /* Build a CI from mppe opts (see RFC 3078) */ -#define MPPE_OPTS_TO_CI(opts, ci) \ - do { \ - u_char *ptr = ci; /* u_char[4] */ \ - \ - /* H bit */ \ - if (opts & MPPE_OPT_STATEFUL) \ - *ptr++ = 0x0; \ - else \ - *ptr++ = MPPE_H_BIT; \ - *ptr++ = 0; \ - *ptr++ = 0; \ - \ - /* S,L bits */ \ - *ptr = 0; \ - if (opts & MPPE_OPT_128) \ - *ptr |= MPPE_S_BIT; \ - if (opts & MPPE_OPT_40) \ - *ptr |= MPPE_L_BIT; \ - /* M,D,C bits not supported */ \ +#define MPPE_OPTS_TO_CI(opts, ci) \ + do { \ + u_char *ptr = ci; /* u_char[4] */ \ + \ + /* H bit */ \ + if (opts & MPPE_OPT_STATEFUL) \ + *ptr++ = 0x0; \ + else \ + *ptr++ = MPPE_H_BIT; \ + *ptr++ = 0; \ + *ptr++ = 0; \ + \ + /* S,L bits */ \ + *ptr = 0; \ + if (opts & MPPE_OPT_128) \ + *ptr |= MPPE_S_BIT; \ + if (opts & MPPE_OPT_40) \ + *ptr |= MPPE_L_BIT; \ + /* M,D,C bits not supported */ \ } while (/* CONSTCOND */ 0) /* The reverse of the above */ -#define MPPE_CI_TO_OPTS(ci, opts) \ - do { \ - const u_char *ptr = ci; /* u_char[4] */ \ - \ - opts = 0; \ - \ - /* H bit */ \ - if (!(ptr[0] & MPPE_H_BIT)) \ - opts |= MPPE_OPT_STATEFUL; \ - \ - /* S,L bits */ \ - if (ptr[3] & MPPE_S_BIT) \ - opts |= MPPE_OPT_128; \ - if (ptr[3] & MPPE_L_BIT) \ - opts |= MPPE_OPT_40; \ - \ - /* M,D,C bits */ \ - if (ptr[3] & MPPE_M_BIT) \ - opts |= MPPE_OPT_56; \ - if (ptr[3] & MPPE_D_BIT) \ - opts |= MPPE_OPT_D; \ - if (ptr[3] & MPPE_C_BIT) \ - opts |= MPPE_OPT_MPPC; \ - \ - /* Other bits */ \ - if (ptr[0] & ~MPPE_H_BIT) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[1] || ptr[2]) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[3] & ~MPPE_ALL_BITS) \ - opts |= MPPE_OPT_UNKNOWN; \ +#define MPPE_CI_TO_OPTS(ci, opts) \ + do { \ + const u_char *ptr = ci; /* u_char[4] */ \ + \ + opts = 0; \ + \ + /* H bit */ \ + if (!(ptr[0] & MPPE_H_BIT)) \ + opts |= MPPE_OPT_STATEFUL; \ + \ + /* S,L bits */ \ + if (ptr[3] & MPPE_S_BIT) \ + opts |= MPPE_OPT_128; \ + if (ptr[3] & MPPE_L_BIT) \ + opts |= MPPE_OPT_40; \ + \ + /* M,D,C bits */ \ + if (ptr[3] & MPPE_M_BIT) \ + opts |= MPPE_OPT_56; \ + if (ptr[3] & MPPE_D_BIT) \ + opts |= MPPE_OPT_D; \ + if (ptr[3] & MPPE_C_BIT) \ + opts |= MPPE_OPT_MPPC; \ + \ + /* Other bits */ \ + if (ptr[0] & ~MPPE_H_BIT) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[1] || ptr[2]) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[3] & ~MPPE_ALL_BITS) \ + opts |= MPPE_OPT_UNKNOWN; \ } while (/* CONSTCOND */ 0) /* Shared MPPE padding between MSCHAP and MPPE */ @@ -148,18 +148,18 @@ static const u8_t mppe_sha1_pad2[SHA1_PAD_SIZE] = { * State for an MPPE (de)compressor. */ typedef struct ppp_mppe_state { - lwip_arc4_context arc4; - u8_t master_key[MPPE_MAX_KEY_LEN]; - u8_t session_key[MPPE_MAX_KEY_LEN]; - u8_t keylen; /* key length in bytes */ - /* NB: 128-bit == 16, 40-bit == 8! - * If we want to support 56-bit, the unit has to change to bits - */ - u8_t bits; /* MPPE control bits */ - u16_t ccount; /* 12-bit coherency count (seqno) */ - u16_t sanity_errors; /* take down LCP if too many */ - unsigned int stateful :1; /* stateful mode flag */ - unsigned int discard :1; /* stateful mode packet loss flag */ + lwip_arc4_context arc4; + u8_t master_key[MPPE_MAX_KEY_LEN]; + u8_t session_key[MPPE_MAX_KEY_LEN]; + u8_t keylen; /* key length in bytes */ + /* NB: 128-bit == 16, 40-bit == 8! + * If we want to support 56-bit, the unit has to change to bits + */ + u8_t bits; /* MPPE control bits */ + u16_t ccount; /* 12-bit coherency count (seqno) */ + u16_t sanity_errors; /* take down LCP if too many */ + unsigned int stateful :1; /* stateful mode flag */ + unsigned int discard :1; /* stateful mode packet loss flag */ } ppp_mppe_state; void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key); diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h index 91b08e6779..4af724cd90 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/arc4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h index 5e3a085165..e893890ed7 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/des.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h index a4aa1dcc83..570445687e 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h index 4d7b04d8d0..1244011890 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/md5.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h index d8f347c64e..a4c53e07c5 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/polarssl/sha1.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h index 5c4c32357f..d9ea097efd 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -103,8 +103,8 @@ /* * The basic PPP frame. */ -#define PPP_HDRLEN 4 /* octets for standard ppp header */ -#define PPP_FCSLEN 2 /* octets for FCS */ +#define PPP_HDRLEN 4 /* octets for standard ppp header */ +#define PPP_FCSLEN 2 /* octets for FCS */ /* * Values for phase. diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h index e017af2ceb..1d4c7742f3 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/ppp_impl.h @@ -70,66 +70,66 @@ /* * The basic PPP frame. */ -#define PPP_ADDRESS(p) (((u_char *)(p))[0]) -#define PPP_CONTROL(p) (((u_char *)(p))[1]) -#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) +#define PPP_ADDRESS(p) (((u_char *)(p))[0]) +#define PPP_CONTROL(p) (((u_char *)(p))[1]) +#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) /* * Significant octet values. */ -#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ -#define PPP_UI 0x03 /* Unnumbered Information */ -#define PPP_FLAG 0x7e /* Flag Sequence */ -#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ -#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ +#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ +#define PPP_UI 0x03 /* Unnumbered Information */ +#define PPP_FLAG 0x7e /* Flag Sequence */ +#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ +#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ /* * Protocol field values. */ -#define PPP_IP 0x21 /* Internet Protocol */ +#define PPP_IP 0x21 /* Internet Protocol */ #if 0 /* UNUSED */ -#define PPP_AT 0x29 /* AppleTalk Protocol */ -#define PPP_IPX 0x2b /* IPX protocol */ +#define PPP_AT 0x29 /* AppleTalk Protocol */ +#define PPP_IPX 0x2b /* IPX protocol */ #endif /* UNUSED */ #if VJ_SUPPORT -#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ -#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ +#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ +#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ #endif /* VJ_SUPPORT */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ +#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_COMP 0xfd /* compressed packet */ +#define PPP_COMP 0xfd /* compressed packet */ #endif /* CCP_SUPPORT */ -#define PPP_IPCP 0x8021 /* IP Control Protocol */ +#define PPP_IPCP 0x8021 /* IP Control Protocol */ #if 0 /* UNUSED */ -#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ -#define PPP_IPXCP 0x802b /* IPX Control Protocol */ +#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ +#define PPP_IPXCP 0x802b /* IPX Control Protocol */ #endif /* UNUSED */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ +#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_CCP 0x80fd /* Compression Control Protocol */ +#define PPP_CCP 0x80fd /* Compression Control Protocol */ #endif /* CCP_SUPPORT */ #if ECP_SUPPORT -#define PPP_ECP 0x8053 /* Encryption Control Protocol */ +#define PPP_ECP 0x8053 /* Encryption Control Protocol */ #endif /* ECP_SUPPORT */ -#define PPP_LCP 0xc021 /* Link Control Protocol */ +#define PPP_LCP 0xc021 /* Link Control Protocol */ #if PAP_SUPPORT -#define PPP_PAP 0xc023 /* Password Authentication Protocol */ +#define PPP_PAP 0xc023 /* Password Authentication Protocol */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT -#define PPP_LQR 0xc025 /* Link Quality Report protocol */ +#define PPP_LQR 0xc025 /* Link Quality Report protocol */ #endif /* LQR_SUPPORT */ #if CHAP_SUPPORT -#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ +#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ #endif /* CHAP_SUPPORT */ #if CBCP_SUPPORT -#define PPP_CBCP 0xc029 /* Callback Control Protocol */ +#define PPP_CBCP 0xc029 /* Callback Control Protocol */ #endif /* CBCP_SUPPORT */ #if EAP_SUPPORT -#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ +#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ #endif /* EAP_SUPPORT */ /* @@ -161,59 +161,59 @@ struct link_callbacks { * What to do with network protocol (NP) packets. */ enum NPmode { - NPMODE_PASS, /* pass the packet through */ - NPMODE_DROP, /* silently drop the packet */ - NPMODE_ERROR, /* return an error */ - NPMODE_QUEUE /* save it up for later. */ + NPMODE_PASS, /* pass the packet through */ + NPMODE_DROP, /* silently drop the packet */ + NPMODE_ERROR, /* return an error */ + NPMODE_QUEUE /* save it up for later. */ }; /* * Statistics. */ #if PPP_STATS_SUPPORT -struct pppstat { - unsigned int ppp_ibytes; /* bytes received */ - unsigned int ppp_ipackets; /* packets received */ - unsigned int ppp_ierrors; /* receive errors */ - unsigned int ppp_obytes; /* bytes sent */ - unsigned int ppp_opackets; /* packets sent */ - unsigned int ppp_oerrors; /* transmit errors */ +struct pppstat { + unsigned int ppp_ibytes; /* bytes received */ + unsigned int ppp_ipackets; /* packets received */ + unsigned int ppp_ierrors; /* receive errors */ + unsigned int ppp_obytes; /* bytes sent */ + unsigned int ppp_opackets; /* packets sent */ + unsigned int ppp_oerrors; /* transmit errors */ }; #if VJ_SUPPORT struct vjstat { - unsigned int vjs_packets; /* outbound packets */ + unsigned int vjs_packets; /* outbound packets */ unsigned int vjs_compressed; /* outbound compressed packets */ - unsigned int vjs_searches; /* searches for connection state */ - unsigned int vjs_misses; /* times couldn't find conn. state */ + unsigned int vjs_searches; /* searches for connection state */ + unsigned int vjs_misses; /* times couldn't find conn. state */ unsigned int vjs_uncompressedin; /* inbound uncompressed packets */ unsigned int vjs_compressedin; /* inbound compressed packets */ - unsigned int vjs_errorin; /* inbound unknown type packets */ - unsigned int vjs_tossed; /* inbound packets tossed because of error */ + unsigned int vjs_errorin; /* inbound unknown type packets */ + unsigned int vjs_tossed; /* inbound packets tossed because of error */ }; #endif /* VJ_SUPPORT */ struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ + struct pppstat p; /* basic PPP statistics */ #if VJ_SUPPORT - struct vjstat vj; /* VJ header compression statistics */ + struct vjstat vj; /* VJ header compression statistics */ #endif /* VJ_SUPPORT */ }; #if CCP_SUPPORT struct compstat { - unsigned int unc_bytes; /* total uncompressed bytes */ - unsigned int unc_packets; /* total uncompressed packets */ - unsigned int comp_bytes; /* compressed bytes */ - unsigned int comp_packets; /* compressed packets */ - unsigned int inc_bytes; /* incompressible bytes */ - unsigned int inc_packets; /* incompressible packets */ - unsigned int ratio; /* recent compression ratio << 8 */ + unsigned int unc_bytes; /* total uncompressed bytes */ + unsigned int unc_packets; /* total uncompressed packets */ + unsigned int comp_bytes; /* compressed bytes */ + unsigned int comp_packets; /* compressed packets */ + unsigned int inc_bytes; /* incompressible bytes */ + unsigned int inc_packets; /* incompressible packets */ + unsigned int ratio; /* recent compression ratio << 8 */ }; struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ + struct compstat c; /* packet compression statistics */ + struct compstat d; /* packet decompression statistics */ }; #endif /* CCP_SUPPORT */ @@ -225,37 +225,37 @@ struct ppp_comp_stats { * the last NP packet was sent or received. */ struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ + time_t xmit_idle; /* time since last NP packet sent */ + time_t recv_idle; /* time since last NP packet received */ }; #endif /* PPP_IDLETIMELIMIT */ /* values for epdisc.class */ -#define EPD_NULL 0 /* null discriminator, no data */ -#define EPD_LOCAL 1 -#define EPD_IP 2 -#define EPD_MAC 3 -#define EPD_MAGIC 4 -#define EPD_PHONENUM 5 +#define EPD_NULL 0 /* null discriminator, no data */ +#define EPD_LOCAL 1 +#define EPD_IP 2 +#define EPD_MAC 3 +#define EPD_MAGIC 4 +#define EPD_PHONENUM 5 /* * Global variables. */ #ifdef HAVE_MULTILINK -extern u8_t multilink; /* enable multilink operation */ -extern u8_t doing_multilink; -extern u8_t multilink_master; -extern u8_t bundle_eof; -extern u8_t bundle_terminating; +extern u8_t multilink; /* enable multilink operation */ +extern u8_t doing_multilink; +extern u8_t multilink_master; +extern u8_t bundle_eof; +extern u8_t bundle_terminating; #endif #ifdef MAXOCTETS -extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ extern int maxoctets_dir; /* Direction : - 0 - in+out (default) - 1 - in - 2 - out - 3 - max(in,out) */ + 0 - in+out (default) + 1 - in + 2 - out + 3 - max(in,out) */ extern int maxoctets_timeout; /* Timeout for check of octets limit */ #define PPP_OCTETS_DIRECTION_SUM 0 #define PPP_OCTETS_DIRECTION_IN 1 @@ -275,7 +275,7 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */ * for a particular protocol. */ struct protent { - u_short protocol; /* PPP protocol number */ + u_short protocol; /* PPP protocol number */ /* Initialization procedure */ void (*init) (ppp_pcb *pcb); /* Process a received packet */ @@ -293,19 +293,19 @@ struct protent { #if PRINTPKT_SUPPORT /* Print a packet in readable form */ int (*printpkt) (const u_char *pkt, int len, - void (*printer) (void *, const char *, ...), - void *arg); + void (*printer) (void *, const char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT /* Process a received data packet */ void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - const char *name; /* Text name of protocol */ - const char *data_name; /* Text name of corresponding data protocol */ + const char *name; /* Text name of protocol */ + const char *data_name; /* Text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - option_t *options; /* List of command-line options */ + option_t *options; /* List of command-line options */ /* Check requested options, assign defaults */ void (*check_options) (void); #endif /* PPP_OPTIONS */ @@ -323,28 +323,28 @@ extern const struct protent* const protocols[]; /* Values for auth_pending, auth_done */ #if PAP_SUPPORT -#define PAP_WITHPEER 0x1 -#define PAP_PEER 0x2 +#define PAP_WITHPEER 0x1 +#define PAP_PEER 0x2 #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT -#define CHAP_WITHPEER 0x4 -#define CHAP_PEER 0x8 +#define CHAP_WITHPEER 0x4 +#define CHAP_PEER 0x8 #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT -#define EAP_WITHPEER 0x10 -#define EAP_PEER 0x20 +#define EAP_WITHPEER 0x10 +#define EAP_PEER 0x20 #endif /* EAP_SUPPORT */ /* Values for auth_done only */ #if CHAP_SUPPORT -#define CHAP_MD5_WITHPEER 0x40 -#define CHAP_MD5_PEER 0x80 +#define CHAP_MD5_WITHPEER 0x40 +#define CHAP_MD5_PEER 0x80 #if MSCHAP_SUPPORT -#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ -#define CHAP_MS_WITHPEER 0x100 -#define CHAP_MS_PEER 0x200 -#define CHAP_MS2_WITHPEER 0x400 -#define CHAP_MS2_PEER 0x800 +#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ +#define CHAP_MS_WITHPEER 0x100 +#define CHAP_MS_PEER 0x200 +#define CHAP_MS2_WITHPEER 0x400 +#define CHAP_MS2_PEER 0x800 #endif /* MSCHAP_SUPPORT */ #endif /* CHAP_SUPPORT */ @@ -366,10 +366,10 @@ extern const struct protent* const protocols[]; * PPP statistics structure */ struct pppd_stats { - unsigned int bytes_in; - unsigned int bytes_out; - unsigned int pkts_in; - unsigned int pkts_out; + unsigned int bytes_in; + unsigned int bytes_out; + unsigned int pkts_in; + unsigned int pkts_out; }; #endif /* PPP_STATS_SUPPORT */ @@ -378,7 +378,7 @@ struct pppd_stats { * PPP private functions */ - + /* * Functions called from lwIP core. */ @@ -499,34 +499,34 @@ void update_link_stats(int u); /* Get stats at link termination */ * cp MUST be u_char *. */ #define GETCHAR(c, cp) { \ - (c) = *(cp)++; \ + (c) = *(cp)++; \ } #define PUTCHAR(c, cp) { \ - *(cp)++ = (u_char) (c); \ + *(cp)++ = (u_char) (c); \ } #define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ + (s) = *(cp)++ << 8; \ + (s) |= *(cp)++; \ } #define PUTSHORT(s, cp) { \ - *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ + *(cp)++ = (u_char) ((s) >> 8); \ + *(cp)++ = (u_char) (s); \ } #define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ + (l) = *(cp)++ << 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; \ } #define PUTLONG(l, cp) { \ - *(cp)++ = (u_char) ((l) >> 24); \ - *(cp)++ = (u_char) ((l) >> 16); \ - *(cp)++ = (u_char) ((l) >> 8); \ - *(cp)++ = (u_char) (l); \ + *(cp)++ = (u_char) ((l) >> 24); \ + *(cp)++ = (u_char) ((l) >> 16); \ + *(cp)++ = (u_char) ((l) >> 8); \ + *(cp)++ = (u_char) (l); \ } -#define INCPTR(n, cp) ((cp) += (n)) -#define DECPTR(n, cp) ((cp) -= (n)) +#define INCPTR(n, cp) ((cp) += (n)) +#define DECPTR(n, cp) ((cp) -= (n)) /* * System dependent definitions for user-level 4.3BSD UNIX implementation. @@ -535,10 +535,10 @@ void update_link_stats(int u); /* Get stats at link termination */ #define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0) #define UNTIMEOUT(f, a) sys_untimeout((f), (a)) -#define BZERO(s, n) memset(s, 0, n) -#define BCMP(s1, s2, l) memcmp(s1, s2, l) +#define BZERO(s, n) memset(s, 0, n) +#define BCMP(s1, s2, l) memcmp(s1, s2, l) -#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } +#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } /* * MAKEHEADER - Add Header fields to a packet. @@ -551,7 +551,7 @@ void update_link_stats(int u); /* Get stats at link termination */ /* Procedures exported from auth.c */ void link_required(ppp_pcb *pcb); /* we are starting to use the link */ void link_terminated(ppp_pcb *pcb); /* we are finished with the link */ -void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ +void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ void upper_layers_down(ppp_pcb *pcb); /* take all NCPs down */ void link_established(ppp_pcb *pcb); /* the link is up; authenticate now */ void start_networks(ppp_pcb *pcb); /* start all the network control protos */ @@ -561,21 +561,21 @@ void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen); /* check the user name and passwd against configuration */ void auth_peer_fail(ppp_pcb *pcb, int protocol); - /* peer failed to authenticate itself */ + /* peer failed to authenticate itself */ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen); - /* peer successfully authenticated itself */ + /* peer successfully authenticated itself */ #endif /* PPP_SERVER */ void auth_withpeer_fail(ppp_pcb *pcb, int protocol); - /* we failed to authenticate ourselves */ + /* we failed to authenticate ourselves */ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor); - /* we successfully authenticated ourselves */ + /* we successfully authenticated ourselves */ #endif /* PPP_AUTH_SUPPORT */ void np_up(ppp_pcb *pcb, int proto); /* a network protocol has come up */ void np_down(ppp_pcb *pcb, int proto); /* a network protocol has gone down */ void np_finished(ppp_pcb *pcb, int proto); /* a network protocol no longer needs link */ #if PPP_AUTH_SUPPORT int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server); - /* get "secret" for chap */ + /* get "secret" for chap */ #endif /* PPP_AUTH_SUPPORT */ /* Procedures exported from ipcp.c */ @@ -583,8 +583,8 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre /* Procedures exported from demand.c */ #if DEMAND_SUPPORT -void demand_conf (void); /* config interface(s) for demand-dial */ -void demand_block (void); /* set all NPs to queue up packets */ +void demand_conf (void); /* config interface(s) for demand-dial */ +void demand_block (void); /* set all NPs to queue up packets */ void demand_unblock (void); /* set all NPs to pass packets */ void demand_discard (void); /* set all NPs to discard packets */ void demand_rexmit (int, u32_t); /* retransmit saved frames for an NP*/ @@ -601,10 +601,10 @@ void mp_bundle_terminated (void); char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ #else -#define mp_bundle_terminated() /* nothing */ -#define mp_exit_bundle() /* nothing */ -#define doing_multilink 0 -#define multilink_master 0 +#define mp_bundle_terminated() /* nothing */ +#define mp_exit_bundle() /* nothing */ +#define doing_multilink 0 +#define multilink_master 0 #endif /* Procedures exported from utils.c. */ diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h b/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h index e1823a2e06..a7b2099f25 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/pppcrypt.h @@ -36,7 +36,7 @@ /* This header file is included in all PPP modules needing hashes and/or ciphers */ #ifndef PPPCRYPT_H -#define PPPCRYPT_H +#define PPPCRYPT_H /* * If included PolarSSL copy is not used, user is expected to include diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h b/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h index 1cd6e292c9..7ead045910 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/pppdebug.h @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h b/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h index de4ef62455..9f8f2892b4 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/pppoe.h @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h b/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h index 7131e8679d..7da792ecc7 100644 --- a/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h +++ b/components/net/lwip-2.0.2/src/include/netif/ppp/upap.h @@ -53,44 +53,44 @@ /* * Packet header = Code, id, length. */ -#define UPAP_HEADERLEN 4 +#define UPAP_HEADERLEN 4 /* * UPAP codes. */ -#define UPAP_AUTHREQ 1 /* Authenticate-Request */ -#define UPAP_AUTHACK 2 /* Authenticate-Ack */ -#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ +#define UPAP_AUTHREQ 1 /* Authenticate-Request */ +#define UPAP_AUTHACK 2 /* Authenticate-Ack */ +#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ /* * Client states. */ -#define UPAPCS_INITIAL 0 /* Connection down */ -#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ -#define UPAPCS_OPEN 4 /* We've received an Ack */ -#define UPAPCS_BADAUTH 5 /* We've received a Nak */ +#define UPAPCS_INITIAL 0 /* Connection down */ +#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ +#define UPAPCS_OPEN 4 /* We've received an Ack */ +#define UPAPCS_BADAUTH 5 /* We've received a Nak */ /* * Server states. */ -#define UPAPSS_INITIAL 0 /* Connection down */ -#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ -#define UPAPSS_OPEN 4 /* We've sent an Ack */ -#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ +#define UPAPSS_INITIAL 0 /* Connection down */ +#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ +#define UPAPSS_OPEN 4 /* We've sent an Ack */ +#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ +#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ +#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ #endif /* moved to ppp_opts.h */ /* @@ -98,16 +98,16 @@ */ #if PAP_SUPPORT typedef struct upap_state { - const char *us_user; /* User */ - u8_t us_userlen; /* User length */ - const char *us_passwd; /* Password */ - u8_t us_passwdlen; /* Password length */ - u8_t us_clientstate; /* Client state */ + const char *us_user; /* User */ + u8_t us_userlen; /* User length */ + const char *us_passwd; /* Password */ + u8_t us_passwdlen; /* Password length */ + u8_t us_clientstate; /* Client state */ #if PPP_SERVER - u8_t us_serverstate; /* Server state */ + u8_t us_serverstate; /* Server state */ #endif /* PPP_SERVER */ - u8_t us_id; /* Current id */ - u8_t us_transmits; /* Number of auth-reqs sent */ + u8_t us_id; /* Current id */ + u8_t us_transmits; /* Number of auth-reqs sent */ } upap_state; #endif /* PAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ethernet.c b/components/net/lwip-2.0.2/src/netif/ethernet.c index 988b997040..52ea4236d5 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernet.c +++ b/components/net/lwip-2.0.2/src/netif/ethernet.c @@ -1,7 +1,7 @@ /** * @file * Ethernet common functions - * + * * @defgroup ethernet Ethernet * @ingroup callbackstyle_api */ @@ -72,7 +72,7 @@ const struct eth_addr ethzero = {{0,0,0,0,0,0}}; * * @param p the received packet, p->payload pointing to the ethernet header * @param netif the network interface on which the packet was received - * + * * @see LWIP_HOOK_UNKNOWN_ETH_PROTOCOL * @see ETHARP_SUPPORT_VLAN * @see LWIP_HOOK_VLAN_CHECK diff --git a/components/net/lwip-2.0.2/src/netif/ethernetif.c b/components/net/lwip-2.0.2/src/netif/ethernetif.c index ee339c2dd7..b93acb1fcf 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.2/src/netif/ethernetif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * COPYRIGHT (C) 2006-2021, RT-Thread Development Team + * COPYRIGHT (C) 2006-2018, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -173,7 +173,7 @@ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) } else { - dhcp_stop((struct netif *)netif->user_data); + dhcp_stop((struct netif *)netif->user_data); } return ERR_OK; } @@ -868,27 +868,27 @@ void list_if(void) rt_kprintf("gw address: %s\n", ipaddr_ntoa(&(netif->gw))); rt_kprintf("net mask : %s\n", ipaddr_ntoa(&(netif->netmask))); #if LWIP_IPV6 - { - ip6_addr_t *addr; - int addr_state; - int i; + { + ip6_addr_t *addr; + int addr_state; + int i; - addr = (ip6_addr_t *)&netif->ip6_addr[0]; - addr_state = netif->ip6_addr_state[0]; + addr = (ip6_addr_t *)&netif->ip6_addr[0]; + addr_state = netif->ip6_addr_state[0]; - rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - for(i=1; iip6_addr[i]; - addr_state = netif->ip6_addr_state[i]; + for(i=1; iip6_addr[i]; + addr_state = netif->ip6_addr_state[i]; - rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - } + rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + } - } + } rt_kprintf("\r\n"); #endif /* LWIP_IPV6 */ netif = netif->next; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/auth.c b/components/net/lwip-2.0.2/src/netif/ppp/auth.c index 480a653ddd..c8673ad0fb 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/auth.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/auth.c @@ -133,10 +133,10 @@ #if 0 /* UNUSED */ /* Bits in scan_authfile return value */ -#define NONWILD_SERVER 1 -#define NONWILD_CLIENT 2 +#define NONWILD_SERVER 1 +#define NONWILD_CLIENT 2 -#define ISWILD(word) (word[0] == '*' && word[1] == 0) +#define ISWILD(word) (word[0] == '*' && word[1] == 0) #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -169,8 +169,8 @@ int (*pap_check_hook) (void) = NULL; /* Hook for a plugin to check the PAP user and password */ int (*pap_auth_hook) (char *user, char *passwd, char **msgp, - struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **paddrs, + struct wordlist **popts) = NULL; /* Hook for a plugin to know about the PAP user logout */ void (*pap_logout_hook) (void) = NULL; @@ -187,7 +187,7 @@ int (*chap_passwd_hook) (char *user, char *passwd) = NULL; /* Hook for a plugin to say whether it is OK if the peer refuses to authenticate. */ int (*null_auth_hook) (struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **popts) = NULL; int (*allowed_address_hook) (u32_t addr) = NULL; #endif /* UNUSED */ @@ -210,27 +210,27 @@ struct notifier *link_down_notifier = NULL; * Option variables. */ #if 0 /* MOVED TO ppp_settings */ -bool uselogin = 0; /* Use /etc/passwd for checking PAP */ -bool session_mgmt = 0; /* Do session management (login records) */ -bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ -bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ -bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ -bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ +bool uselogin = 0; /* Use /etc/passwd for checking PAP */ +bool session_mgmt = 0; /* Do session management (login records) */ +bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ +bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ +bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ +bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ #if MSCHAP_SUPPORT -bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #else /* MSCHAP_SUPPORT */ -bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #endif /* MSCHAP_SUPPORT */ -bool usehostname = 0; /* Use hostname for our_name */ -bool auth_required = 0; /* Always require authentication from peer */ -bool allow_any_ip = 0; /* Allow peer to use any IP address */ -bool explicit_remote = 0; /* User specified explicit remote name */ -bool explicit_user = 0; /* Set if "user" option supplied */ -bool explicit_passwd = 0; /* Set if "password" option supplied */ -char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -static char *uafname; /* name of most recent +ua file */ +bool usehostname = 0; /* Use hostname for our_name */ +bool auth_required = 0; /* Always require authentication from peer */ +bool allow_any_ip = 0; /* Allow peer to use any IP address */ +bool explicit_remote = 0; /* User specified explicit remote name */ +bool explicit_user = 0; /* Set if "user" option supplied */ +bool explicit_passwd = 0; /* Set if "password" option supplied */ +char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ +static char *uafname; /* name of most recent +ua file */ extern char *crypt (const char *, const char *); #endif /* UNUSED */ @@ -252,8 +252,8 @@ static int have_srp_secret (char *client, char *server, int need_ip, int *lacks_ipp); static int ip_addr_check (u32_t, struct permitted_ip *); static int scan_authfile (FILE *, char *, char *, char *, - struct wordlist **, struct wordlist **, - char *, int); + struct wordlist **, struct wordlist **, + char *, int); static void free_wordlist (struct wordlist *); static void set_allowed_addrs (int, struct wordlist *, struct wordlist *); static int some_ip_ok (struct wordlist *); @@ -427,46 +427,46 @@ setupapfile(argv) /* open user info file */ fname = strdup(*argv); if (fname == NULL) - novm("+ua file name"); + novm("+ua file name"); euid = geteuid(); if (seteuid(getuid()) == -1) { - option_error("unable to reset uid before opening %s: %m", fname); - return 0; + option_error("unable to reset uid before opening %s: %m", fname); + return 0; } ufile = fopen(fname, "r"); if (seteuid(euid) == -1) - fatal("unable to regain privileges: %m"); + fatal("unable to regain privileges: %m"); if (ufile == NULL) { - option_error("unable to open user login data file %s", fname); - return 0; + option_error("unable to open user login data file %s", fname); + return 0; } check_access(ufile, fname); uafname = fname; /* get username */ if (fgets(u, MAXNAMELEN - 1, ufile) == NULL - || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { - fclose(ufile); - option_error("unable to read user login data file %s", fname); - return 0; + || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { + fclose(ufile); + option_error("unable to read user login data file %s", fname); + return 0; } fclose(ufile); /* get rid of newlines */ l = strlen(u); if (l > 0 && u[l-1] == '\n') - u[l-1] = 0; + u[l-1] = 0; l = strlen(p); if (l > 0 && p[l-1] == '\n') - p[l-1] = 0; + p[l-1] = 0; if (override_value("user", option_priority, fname)) { - strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); - explicit_user = 1; + strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); + explicit_user = 1; } if (override_value("passwd", option_priority, fname)) { - strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); - explicit_passwd = 1; + strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); + explicit_passwd = 1; } return (1); @@ -484,14 +484,14 @@ privgroup(argv) g = getgrnam(*argv); if (g == 0) { - option_error("group %s is unknown", *argv); - return 0; + option_error("group %s is unknown", *argv); + return 0; } for (i = 0; i < ngroups; ++i) { - if (groups[i] == g->gr_gid) { - privileged = 1; - break; - } + if (groups[i] == g->gr_gid) { + privileged = 1; + break; + } } return 1; } @@ -511,7 +511,7 @@ set_noauth_addr(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-ip argument"); + novm("allow-ip argument"); wp->word = (char *) (wp + 1); wp->next = noauth_addrs; MEMCPY(wp->word, addr, l); @@ -533,7 +533,7 @@ set_permitted_number(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-number argument"); + novm("allow-number argument"); wp->word = (char *) (wp + 1); wp->next = permitted_numbers; MEMCPY(wp->word, number, l); @@ -566,7 +566,7 @@ void start_link(unit) devfd = the_channel->connect(); msg = "Connect script failed"; if (devfd < 0) - goto fail; + goto fail; /* set up the serial device as a ppp interface */ /* @@ -579,21 +579,21 @@ void start_link(unit) fd_ppp = the_channel->establish_ppp(devfd); msg = "ppp establishment failed"; if (fd_ppp < 0) { - status = EXIT_FATAL_ERROR; - goto disconnect; + status = EXIT_FATAL_ERROR; + goto disconnect; } if (!demand && ifunit >= 0) - set_ifunit(1); + set_ifunit(1); /* * Start opening the connection and wait for * incoming events (reply, timeout, etc.). */ if (ifunit >= 0) - ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); + ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); else - ppp_notice("Starting negotiation on %s", ppp_devnam); + ppp_notice("Starting negotiation on %s", ppp_devnam); add_fd(fd_ppp); new_phase(pcb, PPP_PHASE_ESTABLISH); @@ -604,12 +604,12 @@ void start_link(unit) disconnect: new_phase(pcb, PPP_PHASE_DISCONNECT); if (the_channel->disconnect) - the_channel->disconnect(); + the_channel->disconnect(); fail: new_phase(pcb, PPP_PHASE_DEAD); if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); } #endif @@ -623,23 +623,23 @@ void link_terminated(ppp_pcb *pcb) { || pcb->phase == PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - return; + return; new_phase(pcb, PPP_PHASE_DISCONNECT); #if 0 /* UNUSED */ if (pap_logout_hook) { - pap_logout_hook(); + pap_logout_hook(); } session_end(devnam); #endif /* UNUSED */ if (!doing_multilink) { - ppp_notice("Connection terminated."); + ppp_notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ } else - ppp_notice("Link terminated."); + ppp_notice("Link terminated."); lcp_lowerdown(pcb); @@ -651,7 +651,7 @@ void link_terminated(ppp_pcb *pcb) { * we delete its pid file. */ if (!doing_multilink && !demand) - remove_pidfiles(); + remove_pidfiles(); /* * If we may want to bring the link up again, transfer @@ -659,36 +659,36 @@ void link_terminated(ppp_pcb *pcb) { * real serial device back to its normal mode of operation. */ if (fd_ppp >= 0) { - remove_fd(fd_ppp); - clean_check(); - the_channel->disestablish_ppp(devfd); - if (doing_multilink) - mp_exit_bundle(); - fd_ppp = -1; + remove_fd(fd_ppp); + clean_check(); + the_channel->disestablish_ppp(devfd); + if (doing_multilink) + mp_exit_bundle(); + fd_ppp = -1; } if (!hungup) - lcp_lowerdown(pcb); + lcp_lowerdown(pcb); if (!doing_multilink && !demand) - script_unsetenv("IFNAME"); + script_unsetenv("IFNAME"); /* * Run disconnector script, if requested. * XXX we may not be able to do this if the line has hung up! */ if (devfd >= 0 && the_channel->disconnect) { - the_channel->disconnect(); - devfd = -1; + the_channel->disconnect(); + devfd = -1; } if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); if (doing_multilink && multilink_master) { - if (!bundle_terminating) - new_phase(pcb, PPP_PHASE_MASTER); - else - mp_bundle_terminated(); + if (!bundle_terminating) + new_phase(pcb, PPP_PHASE_MASTER); + else + mp_bundle_terminated(); } else - new_phase(pcb, PPP_PHASE_DEAD); + new_phase(pcb, PPP_PHASE_DEAD); #endif } @@ -701,13 +701,13 @@ void link_down(ppp_pcb *pcb) { #endif /* PPP_NOTIFY */ if (!doing_multilink) { - upper_layers_down(pcb); - if (pcb->phase != PPP_PHASE_DEAD + upper_layers_down(pcb); + if (pcb->phase != PPP_PHASE_DEAD #ifdef HAVE_MULTILINK - && pcb->phase != PPP_PHASE_MASTER + && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ - ) - new_phase(pcb, PPP_PHASE_ESTABLISH); + ) + new_phase(pcb, PPP_PHASE_ESTABLISH); } /* XXX if doing_multilink, should do something to stop network-layer traffic on the link */ @@ -719,9 +719,9 @@ void upper_layers_down(ppp_pcb *pcb) { for (i = 0; (protp = protocols[i]) != NULL; ++i) { if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) - (*protp->lowerdown)(pcb); + (*protp->lowerdown)(pcb); if (protp->protocol < 0xC000 && protp->close != NULL) - (*protp->close)(pcb, "LCP down"); + (*protp->close)(pcb, "LCP down"); } pcb->num_np_open = 0; pcb->num_np_up = 0; @@ -749,56 +749,56 @@ void link_established(ppp_pcb *pcb) { * Tell higher-level protocols that LCP is up. */ if (!doing_multilink) { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol != PPP_LCP - && protp->lowerup != NULL) - (*protp->lowerup)(pcb); + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol != PPP_LCP + && protp->lowerup != NULL) + (*protp->lowerup)(pcb); } #if PPP_AUTH_SUPPORT #if PPP_SERVER #if PPP_ALLOWED_ADDRS if (!auth_required && noauth_addrs != NULL) - set_allowed_addrs(unit, NULL, NULL); + set_allowed_addrs(unit, NULL, NULL); #endif /* PPP_ALLOWED_ADDRS */ if (pcb->settings.auth_required && !(0 #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if PPP_ALLOWED_ADDRS - /* - * We wanted the peer to authenticate itself, and it refused: - * if we have some address(es) it can use without auth, fine, - * otherwise treat it as though it authenticated with PAP using - * a username of "" and a password of "". If that's not OK, - * boot it out. - */ - if (noauth_addrs != NULL) { - set_allowed_addrs(unit, NULL, NULL); - } else + /* + * We wanted the peer to authenticate itself, and it refused: + * if we have some address(es) it can use without auth, fine, + * otherwise treat it as though it authenticated with PAP using + * a username of "" and a password of "". If that's not OK, + * boot it out. + */ + if (noauth_addrs != NULL) { + set_allowed_addrs(unit, NULL, NULL); + } else #endif /* PPP_ALLOWED_ADDRS */ - if (!pcb->settings.null_login + if (!pcb->settings.null_login #if PAP_SUPPORT - || !wo->neg_upap + || !wo->neg_upap #endif /* PAP_SUPPORT */ - ) { - ppp_warn("peer refused to authenticate: terminating link"); + ) { + ppp_warn("peer refused to authenticate: terminating link"); #if 0 /* UNUSED */ - status = EXIT_PEER_AUTH_FAILED; + status = EXIT_PEER_AUTH_FAILED; #endif /* UNUSED */ - pcb->err_code = PPPERR_AUTHFAIL; - lcp_close(pcb, "peer refused to authenticate"); - return; - } + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "peer refused to authenticate"); + return; + } } #endif /* PPP_SERVER */ @@ -807,20 +807,20 @@ void link_established(ppp_pcb *pcb) { #if PPP_SERVER #if EAP_SUPPORT if (go->neg_eap) { - eap_authpeer(pcb, PPP_OUR_NAME); - auth |= EAP_PEER; + eap_authpeer(pcb, PPP_OUR_NAME); + auth |= EAP_PEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (go->neg_chap) { - chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); - auth |= CHAP_PEER; + chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); + auth |= CHAP_PEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (go->neg_upap) { - upap_authpeer(pcb); - auth |= PAP_PEER; + upap_authpeer(pcb); + auth |= PAP_PEER; } else #endif /* PAP_SUPPORT */ {} @@ -828,20 +828,20 @@ void link_established(ppp_pcb *pcb) { #if EAP_SUPPORT if (ho->neg_eap) { - eap_authwithpeer(pcb, pcb->settings.user); - auth |= EAP_WITHPEER; + eap_authwithpeer(pcb, pcb->settings.user); + auth |= EAP_WITHPEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (ho->neg_chap) { - chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); - auth |= CHAP_WITHPEER; + chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); + auth |= CHAP_WITHPEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (ho->neg_upap) { - upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); - auth |= PAP_WITHPEER; + upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); + auth |= PAP_WITHPEER; } else #endif /* PAP_SUPPORT */ {} @@ -851,7 +851,7 @@ void link_established(ppp_pcb *pcb) { if (!auth) #endif /* PPP_AUTH_SUPPORT */ - network_phase(pcb); + network_phase(pcb); } /* @@ -868,7 +868,7 @@ static void network_phase(ppp_pcb *pcb) { #if 0 /* UNUSED */ /* Log calling number. */ if (*remote_number) - ppp_notice("peer from calling number %q authorized", remote_number); + ppp_notice("peer from calling number %q authorized", remote_number); #endif /* UNUSED */ #if PPP_NOTIFY @@ -877,16 +877,16 @@ static void network_phase(ppp_pcb *pcb) { */ if (0 #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - ) { - notify(auth_up_notifier, 0); + ) { + notify(auth_up_notifier, 0); } #endif /* PPP_NOTIFY */ @@ -895,9 +895,9 @@ static void network_phase(ppp_pcb *pcb) { * If we negotiated callback, do it now. */ if (go->neg_cbcp) { - new_phase(pcb, PPP_PHASE_CALLBACK); - (*cbcp_protent.open)(pcb); - return; + new_phase(pcb, PPP_PHASE_CALLBACK); + (*cbcp_protent.open)(pcb); + return; } #endif @@ -906,9 +906,9 @@ static void network_phase(ppp_pcb *pcb) { * Process extra options from the secrets file */ if (extra_options) { - options_from_list(extra_options, 1); - free_wordlist(extra_options); - extra_options = 0; + options_from_list(extra_options, 1); + free_wordlist(extra_options); + extra_options = 0; } #endif /* PPP_OPTIONS */ start_networks(pcb); @@ -924,34 +924,34 @@ void start_networks(ppp_pcb *pcb) { #ifdef HAVE_MULTILINK if (multilink) { - if (mp_join_bundle()) { - if (multilink_join_hook) - (*multilink_join_hook)(); - if (updetach && !nodetach) - detach(); - return; - } + if (mp_join_bundle()) { + if (multilink_join_hook) + (*multilink_join_hook)(); + if (updetach && !nodetach) + detach(); + return; + } } #endif /* HAVE_MULTILINK */ #ifdef PPP_FILTER if (!demand) - set_filters(&pass_filter, &active_filter); + set_filters(&pass_filter, &active_filter); #endif #if CCP_SUPPORT || ECP_SUPPORT /* Start CCP and ECP */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if ( - (0 + if ( + (0 #if ECP_SUPPORT - || protp->protocol == PPP_ECP + || protp->protocol == PPP_ECP #endif /* ECP_SUPPORT */ #if CCP_SUPPORT - || protp->protocol == PPP_CCP + || protp->protocol == PPP_CCP #endif /* CCP_SUPPORT */ - ) - && protp->open != NULL) - (*protp->open)(pcb); + ) + && protp->open != NULL) + (*protp->open)(pcb); #endif /* CCP_SUPPORT || ECP_SUPPORT */ /* @@ -965,7 +965,7 @@ void start_networks(ppp_pcb *pcb) { && !pcb->ccp_gotoptions.mppe #endif /* MPPE_SUPPORT */ ) - continue_networks(pcb); + continue_networks(pcb); } void continue_networks(ppp_pcb *pcb) { @@ -976,21 +976,21 @@ void continue_networks(ppp_pcb *pcb) { * Start the "real" network protocols. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol < 0xC000 + if (protp->protocol < 0xC000 #if CCP_SUPPORT - && protp->protocol != PPP_CCP + && protp->protocol != PPP_CCP #endif /* CCP_SUPPORT */ #if ECP_SUPPORT - && protp->protocol != PPP_ECP + && protp->protocol != PPP_ECP #endif /* ECP_SUPPORT */ - && protp->open != NULL) { - (*protp->open)(pcb); - ++pcb->num_np_open; - } + && protp->open != NULL) { + (*protp->open)(pcb); + ++pcb->num_np_open; + } if (pcb->num_np_open == 0) - /* nothing to do */ - lcp_close(pcb, "No network protocols running"); + /* nothing to do */ + lcp_close(pcb, "No network protocols running"); } #if PPP_AUTH_SUPPORT @@ -1053,37 +1053,37 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_PEER; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_PEER; - break; + bit = CHAP_PEER; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_PEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_PEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_PEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_PEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_PEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_PEER; - break; + bit = PAP_PEER; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_PEER; - break; + bit = EAP_PEER; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_peer_success: unknown protocol %x", protocol); - return; + ppp_warn("auth_peer_success: unknown protocol %x", protocol); + return; } #ifdef HAVE_MULTILINK @@ -1091,7 +1091,7 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * * Save the authenticated name of the peer for later. */ if (namelen > (int)sizeof(pcb->peer_authname) - 1) - namelen = (int)sizeof(pcb->peer_authname) - 1; + namelen = (int)sizeof(pcb->peer_authname) - 1; MEMCPY(pcb->peer_authname, name, namelen); pcb->peer_authname[namelen] = 0; #endif /* HAVE_MULTILINK */ @@ -1140,41 +1140,41 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_WITHPEER; - prot = "CHAP"; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_WITHPEER; - break; + bit = CHAP_WITHPEER; + prot = "CHAP"; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_WITHPEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_WITHPEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_WITHPEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_WITHPEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_WITHPEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_WITHPEER; - prot = "PAP"; - break; + bit = PAP_WITHPEER; + prot = "PAP"; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_WITHPEER; - prot = "EAP"; - break; + bit = EAP_WITHPEER; + prot = "EAP"; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); - bit = 0; - /* no break */ + ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); + bit = 0; + /* no break */ } ppp_notice("%s authentication succeeded", prot); @@ -1187,7 +1187,7 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { * proceed to the network (or callback) phase. */ if ((pcb->auth_pending &= ~bit) == 0) - network_phase(pcb); + network_phase(pcb); } #endif /* PPP_AUTH_SUPPORT */ @@ -1202,42 +1202,42 @@ void np_up(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (pcb->num_np_up == 0) { - /* - * At this point we consider that the link has come up successfully. - */ - new_phase(pcb, PPP_PHASE_RUNNING); + /* + * At this point we consider that the link has come up successfully. + */ + new_phase(pcb, PPP_PHASE_RUNNING); #if PPP_IDLETIMELIMIT #if 0 /* UNUSED */ - if (idle_time_hook != 0) - tlim = (*idle_time_hook)(NULL); - else + if (idle_time_hook != 0) + tlim = (*idle_time_hook)(NULL); + else #endif /* UNUSED */ - tlim = pcb->settings.idle_time_limit; - if (tlim > 0) - TIMEOUT(check_idle, (void*)pcb, tlim); + tlim = pcb->settings.idle_time_limit; + if (tlim > 0) + TIMEOUT(check_idle, (void*)pcb, tlim); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - /* - * Set a timeout to close the connection once the maximum - * connect time has expired. - */ - if (pcb->settings.maxconnect > 0) - TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); + /* + * Set a timeout to close the connection once the maximum + * connect time has expired. + */ + if (pcb->settings.maxconnect > 0) + TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - if (maxoctets > 0) - TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); + if (maxoctets > 0) + TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); #endif #if 0 /* Unused */ - /* - * Detach now, if the updetach option was given. - */ - if (updetach && !nodetach) - detach(); + /* + * Detach now, if the updetach option was given. + */ + if (updetach && !nodetach) + detach(); #endif /* Unused */ } ++pcb->num_np_up; @@ -1250,15 +1250,15 @@ void np_down(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_up == 0) { #if PPP_IDLETIMELIMIT - UNTIMEOUT(check_idle, (void*)pcb); + UNTIMEOUT(check_idle, (void*)pcb); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - UNTIMEOUT(connect_time_expired, NULL); + UNTIMEOUT(connect_time_expired, NULL); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - UNTIMEOUT(check_maxoctets, NULL); + UNTIMEOUT(check_maxoctets, NULL); #endif - new_phase(pcb, PPP_PHASE_NETWORK); + new_phase(pcb, PPP_PHASE_NETWORK); } } @@ -1268,8 +1268,8 @@ void np_down(ppp_pcb *pcb, int proto) { void np_finished(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_open <= 0) { - /* no further use for the link: shut up shop. */ - lcp_close(pcb, "No network protocols running"); + /* no further use for the link: shut up shop. */ + lcp_close(pcb, "No network protocols running"); } } @@ -1285,26 +1285,26 @@ check_maxoctets(arg) link_stats_valid=0; switch(maxoctets_dir) { - case PPP_OCTETS_DIRECTION_IN: - used = link_stats.bytes_in; - break; - case PPP_OCTETS_DIRECTION_OUT: - used = link_stats.bytes_out; - break; - case PPP_OCTETS_DIRECTION_MAXOVERAL: - case PPP_OCTETS_DIRECTION_MAXSESSION: - used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; - break; - default: - used = link_stats.bytes_in+link_stats.bytes_out; - break; + case PPP_OCTETS_DIRECTION_IN: + used = link_stats.bytes_in; + break; + case PPP_OCTETS_DIRECTION_OUT: + used = link_stats.bytes_out; + break; + case PPP_OCTETS_DIRECTION_MAXOVERAL: + case PPP_OCTETS_DIRECTION_MAXSESSION: + used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; + break; + default: + used = link_stats.bytes_in+link_stats.bytes_out; + break; } if (used > maxoctets) { - ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); - status = EXIT_TRAFFIC_LIMIT; - lcp_close(pcb, "Traffic limit"); + ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); + status = EXIT_TRAFFIC_LIMIT; + lcp_close(pcb, "Traffic limit"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); @@ -1325,27 +1325,27 @@ static void check_idle(void *arg) { int tlim; if (!get_idle_time(pcb, &idle)) - return; + return; #if 0 /* UNUSED */ if (idle_time_hook != 0) { - tlim = idle_time_hook(&idle); + tlim = idle_time_hook(&idle); } else { #endif /* UNUSED */ - itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); - tlim = pcb->settings.idle_time_limit - itime; + itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); + tlim = pcb->settings.idle_time_limit - itime; #if 0 /* UNUSED */ } #endif /* UNUSED */ if (tlim <= 0) { - /* link is idle: shut it down. */ - ppp_notice("Terminating connection due to lack of activity."); - pcb->err_code = PPPERR_IDLETIMEOUT; - lcp_close(pcb, "Link inactive"); + /* link is idle: shut it down. */ + ppp_notice("Terminating connection due to lack of activity."); + pcb->err_code = PPPERR_IDLETIMEOUT; + lcp_close(pcb, "Link inactive"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { - TIMEOUT(check_idle, (void*)pcb, tlim); + TIMEOUT(check_idle, (void*)pcb, tlim); } } #endif /* PPP_IDLETIMELIMIT */ @@ -1358,7 +1358,7 @@ static void connect_time_expired(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; ppp_info("Connect time expired"); pcb->err_code = PPPERR_CONNECTTIME; - lcp_close(pcb, "Connect time expired"); /* Close connection */ + lcp_close(pcb, "Connect time expired"); /* Close connection */ } #endif /* PPP_MAXCONNECT */ @@ -1375,62 +1375,62 @@ auth_check_options() /* Default our_name to hostname, and user to our_name */ if (our_name[0] == 0 || usehostname) - strlcpy(our_name, hostname, sizeof(our_name)); + strlcpy(our_name, hostname, sizeof(our_name)); /* If a blank username was explicitly given as an option, trust the user and don't use our_name */ if (ppp_settings.user[0] == 0 && !explicit_user) - strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); + strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); /* * If we have a default route, require the peer to authenticate * unless the noauth option was given or the real user is root. */ if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { - auth_required = 1; - default_auth = 1; + auth_required = 1; + default_auth = 1; } #if CHAP_SUPPORT /* If we selected any CHAP flavors, we should probably negotiate it. :-) */ if (wo->chap_mdtype) - wo->neg_chap = 1; + wo->neg_chap = 1; #endif /* CHAP_SUPPORT */ /* If authentication is required, ask peer for CHAP, PAP, or EAP. */ if (auth_required) { - allow_any_ip = 0; - if (1 + allow_any_ip = 0; + if (1 #if CHAP_SUPPORT - && !wo->neg_chap + && !wo->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - && !wo->neg_upap + && !wo->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - && !wo->neg_eap + && !wo->neg_eap #endif /* EAP_SUPPORT */ - ) { + ) { #if CHAP_SUPPORT - wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; - wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; + wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; + wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 1; + wo->neg_upap = 1; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 1; + wo->neg_eap = 1; #endif /* EAP_SUPPORT */ - } + } } else { #if CHAP_SUPPORT - wo->neg_chap = 0; - wo->chap_mdtype = MDTYPE_NONE; + wo->neg_chap = 0; + wo->chap_mdtype = MDTYPE_NONE; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 0; + wo->neg_upap = 0; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 0; + wo->neg_eap = 0; #endif /* EAP_SUPPORT */ } @@ -1447,56 +1447,56 @@ auth_check_options() #endif /* PAP_SUPPORT */ if (!can_auth && (0 #if CHAP_SUPPORT - || wo->neg_chap + || wo->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || wo->neg_eap + || wo->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if CHAP_SUPPORT - can_auth = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + can_auth = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); #else - can_auth = 0; + can_auth = 0; #endif } if (!can_auth #if EAP_SUPPORT - && wo->neg_eap + && wo->neg_eap #endif /* EAP_SUPPORT */ - ) { - can_auth = have_srp_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + ) { + can_auth = have_srp_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); } if (auth_required && !can_auth && noauth_addrs == NULL) { - if (default_auth) { - option_error( + if (default_auth) { + option_error( "By default the remote system is required to authenticate itself"); - option_error( + option_error( "(because this system has a default route to the internet)"); - } else if (explicit_remote) - option_error( + } else if (explicit_remote) + option_error( "The remote system (%s) is required to authenticate itself", - remote_name); - else - option_error( + remote_name); + else + option_error( "The remote system is required to authenticate itself"); - option_error( + option_error( "but I couldn't find any suitable secret (password) for it to use to do so."); - if (lacks_ip) - option_error( + if (lacks_ip) + option_error( "(None of the available passwords would let it use an IP address.)"); - exit(1); + exit(1); } /* * Early check for remote number authorization. */ if (!auth_number()) { - ppp_warn("calling number %q is not authorized", remote_number); - exit(EXIT_CNID_AUTH_FAILED); + ppp_warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); } } #endif /* PPP_OPTIONS */ @@ -1518,30 +1518,30 @@ auth_reset(unit) hadchap = -1; ao->neg_upap = !refuse_pap && (passwd[0] != 0 || get_pap_passwd(NULL)); ao->neg_chap = (!refuse_chap || !refuse_mschap || !refuse_mschap_v2) - && (passwd[0] != 0 || - (hadchap = have_chap_secret(user, (explicit_remote? remote_name: - NULL), 0, NULL))); + && (passwd[0] != 0 || + (hadchap = have_chap_secret(user, (explicit_remote? remote_name: + NULL), 0, NULL))); ao->neg_eap = !refuse_eap && ( - passwd[0] != 0 || - (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, - (explicit_remote? remote_name: NULL), 0, NULL))) || - have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); + passwd[0] != 0 || + (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, + (explicit_remote? remote_name: NULL), 0, NULL))) || + have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); hadchap = -1; if (go->neg_upap && !uselogin && !have_pap_secret(NULL)) - go->neg_upap = 0; + go->neg_upap = 0; if (go->neg_chap) { - if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, NULL))) - go->neg_chap = 0; + if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, NULL))) + go->neg_chap = 0; } if (go->neg_eap && - (hadchap == 0 || (hadchap == -1 && - !have_chap_secret((explicit_remote? remote_name: NULL), our_name, - 1, NULL))) && - !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, - NULL)) - go->neg_eap = 0; + (hadchap == 0 || (hadchap == -1 && + !have_chap_secret((explicit_remote? remote_name: NULL), our_name, + 1, NULL))) && + !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, + NULL)) + go->neg_eap = 0; } /* @@ -1550,8 +1550,8 @@ auth_reset(unit) * and login the user if OK. * * returns: - * UPAP_AUTHNAK: Authentication failed. - * UPAP_AUTHACK: Authentication succeeded. + * UPAP_AUTHNAK: Authentication failed. + * UPAP_AUTHACK: Authentication succeeded. * In either case, msg points to an appropriate message. */ int @@ -1585,19 +1585,19 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) * Check if a plugin wants to handle this. */ if (pap_auth_hook) { - ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); - if (ret >= 0) { - /* note: set_allowed_addrs() saves opts (but not addrs): - don't free it! */ - if (ret) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); - BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); - return ret? UPAP_AUTHACK: UPAP_AUTHNAK; - } + ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); + if (ret >= 0) { + /* note: set_allowed_addrs() saves opts (but not addrs): + don't free it! */ + if (ret) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); + return ret? UPAP_AUTHACK: UPAP_AUTHNAK; + } } /* @@ -1609,67 +1609,67 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) ret = UPAP_AUTHNAK; f = fopen(filename, "r"); if (f == NULL) { - ppp_error("Can't open PAP password file %s: %m", filename); + ppp_error("Can't open PAP password file %s: %m", filename); } else { - check_access(f, filename); - if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { - ppp_warn("no PAP secret found for %s", user); - } else { - /* - * If the secret is "@login", it means to check - * the password against the login database. - */ - int login_secret = strcmp(secret, "@login") == 0; - ret = UPAP_AUTHACK; - if (uselogin || login_secret) { - /* login option or secret is @login */ - if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { - ret = UPAP_AUTHNAK; - } - } else if (session_mgmt) { - if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { - ppp_warn("Peer %q failed PAP Session verification", user); - ret = UPAP_AUTHNAK; - } - } - if (secret[0] != 0 && !login_secret) { - /* password given in pap-secrets - must match */ - if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) - && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) - ret = UPAP_AUTHNAK; - } - } - fclose(f); + check_access(f, filename); + if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { + ppp_warn("no PAP secret found for %s", user); + } else { + /* + * If the secret is "@login", it means to check + * the password against the login database. + */ + int login_secret = strcmp(secret, "@login") == 0; + ret = UPAP_AUTHACK; + if (uselogin || login_secret) { + /* login option or secret is @login */ + if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { + ret = UPAP_AUTHNAK; + } + } else if (session_mgmt) { + if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { + ppp_warn("Peer %q failed PAP Session verification", user); + ret = UPAP_AUTHNAK; + } + } + if (secret[0] != 0 && !login_secret) { + /* password given in pap-secrets - must match */ + if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) + && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) + ret = UPAP_AUTHNAK; + } + } + fclose(f); } if (ret == UPAP_AUTHNAK) { if (**msg == 0) - *msg = "Login incorrect"; - /* - * XXX can we ever get here more than once?? - * Frustrate passwd stealer programs. - * Allow 10 tries, but start backing off after 3 (stolen from login). - * On 10'th, drop the connection. - */ - if (attempts++ >= 10) { - ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); - lcp_close(pcb, "login failed"); - } - if (attempts > 3) - sleep((u_int) (attempts - 3) * 5); - if (opts != NULL) - free_wordlist(opts); + *msg = "Login incorrect"; + /* + * XXX can we ever get here more than once?? + * Frustrate passwd stealer programs. + * Allow 10 tries, but start backing off after 3 (stolen from login). + * On 10'th, drop the connection. + */ + if (attempts++ >= 10) { + ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); + lcp_close(pcb, "login failed"); + } + if (attempts > 3) + sleep((u_int) (attempts - 3) * 5); + if (opts != NULL) + free_wordlist(opts); } else { - attempts = 0; /* Reset count */ - if (**msg == 0) - *msg = "Login ok"; - set_allowed_addrs(unit, addrs, opts); + attempts = 0; /* Reset count */ + if (**msg == 0) + *msg = "Login ok"; + set_allowed_addrs(unit, addrs, opts); } if (addrs != NULL) - free_wordlist(addrs); + free_wordlist(addrs); BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); BZERO(secret, sizeof(secret)); @@ -1696,31 +1696,31 @@ null_login(unit) */ ret = -1; if (null_auth_hook) - ret = (*null_auth_hook)(&addrs, &opts); + ret = (*null_auth_hook)(&addrs, &opts); /* * Open the file of pap secrets and scan for a suitable secret. */ if (ret <= 0) { - filename = _PATH_UPAPFILE; - addrs = NULL; - f = fopen(filename, "r"); - if (f == NULL) - return 0; - check_access(f, filename); + filename = _PATH_UPAPFILE; + addrs = NULL; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + check_access(f, filename); - i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); - ret = i >= 0 && secret[0] == 0; - BZERO(secret, sizeof(secret)); - fclose(f); + i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); + ret = i >= 0 && secret[0] == 0; + BZERO(secret, sizeof(secret)); + fclose(f); } if (ret) - set_allowed_addrs(unit, addrs, opts); + set_allowed_addrs(unit, addrs, opts); else if (opts != 0) - free_wordlist(opts); + free_wordlist(opts); if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret; } @@ -1744,24 +1744,24 @@ get_pap_passwd(passwd) * Check whether a plugin wants to supply this. */ if (pap_passwd_hook) { - ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); - if (ret >= 0) - return ret; + ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; check_access(f, filename); ret = scan_authfile(f, user, - (remote_name[0]? remote_name: NULL), - secret, NULL, NULL, filename, 0); + (remote_name[0]? remote_name: NULL), + secret, NULL, NULL, filename, 0); fclose(f); if (ret < 0) - return 0; + return 0; if (passwd != NULL) - strlcpy(passwd, secret, MAXSECRETLEN); + strlcpy(passwd, secret, MAXSECRETLEN); BZERO(secret, sizeof(secret)); return 1; } @@ -1781,26 +1781,26 @@ have_pap_secret(lacks_ipp) /* let the plugin decide, if there is one */ if (pap_check_hook) { - ret = (*pap_check_hook)(); - if (ret >= 0) - return ret; + ret = (*pap_check_hook)(); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; ret = scan_authfile(f, (explicit_remote? remote_name: NULL), our_name, - NULL, &addrs, NULL, filename, 0); + NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1824,31 +1824,31 @@ have_chap_secret(client, server, need_ip, lacks_ipp) struct wordlist *addrs; if (chap_check_hook) { - ret = (*chap_check_hook)(); - if (ret >= 0) { - return ret; - } + ret = (*chap_check_hook)(); + if (ret >= 0) { + return ret; + } } filename = _PATH_CHAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1874,22 +1874,22 @@ have_srp_secret(client, server, need_ip, lacks_ipp) filename = _PATH_SRPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1930,42 +1930,42 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre addrs = NULL; if (!am_server && ppp_settings.passwd[0] != 0) { - strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); + strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); } else if (!am_server && chap_passwd_hook) { - if ( (*chap_passwd_hook)(client, secbuf) < 0) { - ppp_error("Unable to obtain CHAP password for %s on %s from plugin", - client, server); - return 0; - } + if ( (*chap_passwd_hook)(client, secbuf) < 0) { + ppp_error("Unable to obtain CHAP password for %s on %s from plugin", + client, server); + return 0; + } } else { - filename = _PATH_CHAPFILE; - addrs = NULL; - secbuf[0] = 0; - - f = fopen(filename, "r"); - if (f == NULL) { - ppp_error("Can't open chap secret file %s: %m", filename); - return 0; - } - check_access(f, filename); - - ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); - fclose(f); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); + filename = _PATH_CHAPFILE; + addrs = NULL; + secbuf[0] = 0; + + f = fopen(filename, "r"); + if (f == NULL) { + ppp_error("Can't open chap secret file %s: %m", filename); + return 0; + } + check_access(f, filename); + + ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); + fclose(f); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); } len = strlen(secbuf); if (len > MAXSECRETLEN) { - ppp_error("Secret for %s on %s is too long", client, server); - len = MAXSECRETLEN; + ppp_error("Secret for %s on %s is too long", client, server); + len = MAXSECRETLEN; } MEMCPY(secret, secbuf, len); BZERO(secbuf, sizeof(secbuf)); @@ -1997,31 +1997,31 @@ get_srp_secret(unit, client, server, secret, am_server) struct wordlist *addrs, *opts; if (!am_server && ppp_settings.passwd[0] != '\0') { - strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); + strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); } else { - filename = _PATH_SRPFILE; - addrs = NULL; - - fp = fopen(filename, "r"); - if (fp == NULL) { - ppp_error("Can't open srp secret file %s: %m", filename); - return 0; - } - check_access(fp, filename); - - secret[0] = '\0'; - ret = scan_authfile(fp, client, server, secret, &addrs, &opts, - filename, am_server); - fclose(fp); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != NULL) - free_wordlist(opts); - if (addrs != NULL) - free_wordlist(addrs); + filename = _PATH_SRPFILE; + addrs = NULL; + + fp = fopen(filename, "r"); + if (fp == NULL) { + ppp_error("Can't open srp secret file %s: %m", filename); + return 0; + } + check_access(fp, filename); + + secret[0] = '\0'; + ret = scan_authfile(fp, client, server, secret, &addrs, &opts, + filename, am_server); + fclose(fp); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != NULL) + free_wordlist(opts); + if (addrs != NULL) + free_wordlist(addrs); } return 1; @@ -2049,10 +2049,10 @@ set_allowed_addrs(unit, addrs, opts) u32_t suggested_ip = 0; if (addresses[unit] != NULL) - free(addresses[unit]); + free(addresses[unit]); addresses[unit] = NULL; if (extra_options != NULL) - free_wordlist(extra_options); + free_wordlist(extra_options); extra_options = opts; /* @@ -2060,109 +2060,109 @@ set_allowed_addrs(unit, addrs, opts) */ n = wordlist_count(addrs) + wordlist_count(noauth_addrs); if (n == 0) - return; + return; ip = (struct permitted_ip *) malloc((n + 1) * sizeof(struct permitted_ip)); if (ip == 0) - return; + return; /* temporarily append the noauth_addrs list to addrs */ for (plink = &addrs; *plink != NULL; plink = &(*plink)->next) - ; + ; *plink = noauth_addrs; n = 0; for (ap = addrs; ap != NULL; ap = ap->next) { - /* "-" means no addresses authorized, "*" means any address allowed */ - ptr_word = ap->word; - if (strcmp(ptr_word, "-") == 0) - break; - if (strcmp(ptr_word, "*") == 0) { - ip[n].permit = 1; - ip[n].base = ip[n].mask = 0; - ++n; - break; - } - - ip[n].permit = 1; - if (*ptr_word == '!') { - ip[n].permit = 0; - ++ptr_word; - } - - mask = ~ (u32_t) 0; - offset = 0; - ptr_mask = strchr (ptr_word, '/'); - if (ptr_mask != NULL) { - int bit_count; - char *endp; - - bit_count = (int) strtol (ptr_mask+1, &endp, 10); - if (bit_count <= 0 || bit_count > 32) { - ppp_warn("invalid address length %v in auth. address list", - ptr_mask+1); - continue; - } - bit_count = 32 - bit_count; /* # bits in host part */ - if (*endp == '+') { - offset = ifunit + 1; - ++endp; - } - if (*endp != 0) { - ppp_warn("invalid address length syntax: %v", ptr_mask+1); - continue; - } - *ptr_mask = '\0'; - mask <<= bit_count; - } - - hp = gethostbyname(ptr_word); - if (hp != NULL && hp->h_addrtype == AF_INET) { - a = *(u32_t *)hp->h_addr; - } else { - np = getnetbyname (ptr_word); - if (np != NULL && np->n_addrtype == AF_INET) { - a = lwip_htonl ((u32_t)np->n_net); - if (ptr_mask == NULL) { - /* calculate appropriate mask for net */ - ah = lwip_ntohl(a); - if (IN_CLASSA(ah)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(ah)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(ah)) - mask = IN_CLASSC_NET; - } - } else { - a = inet_addr (ptr_word); - } - } - - if (ptr_mask != NULL) - *ptr_mask = '/'; - - if (a == (u32_t)-1L) { - ppp_warn("unknown host %s in auth. address list", ap->word); - continue; - } - if (offset != 0) { - if (offset >= ~mask) { - ppp_warn("interface unit %d too large for subnet %v", - ifunit, ptr_word); - continue; - } - a = lwip_htonl((lwip_ntohl(a) & mask) + offset); - mask = ~(u32_t)0; - } - ip[n].mask = lwip_htonl(mask); - ip[n].base = a & ip[n].mask; - ++n; - if (~mask == 0 && suggested_ip == 0) - suggested_ip = a; + /* "-" means no addresses authorized, "*" means any address allowed */ + ptr_word = ap->word; + if (strcmp(ptr_word, "-") == 0) + break; + if (strcmp(ptr_word, "*") == 0) { + ip[n].permit = 1; + ip[n].base = ip[n].mask = 0; + ++n; + break; + } + + ip[n].permit = 1; + if (*ptr_word == '!') { + ip[n].permit = 0; + ++ptr_word; + } + + mask = ~ (u32_t) 0; + offset = 0; + ptr_mask = strchr (ptr_word, '/'); + if (ptr_mask != NULL) { + int bit_count; + char *endp; + + bit_count = (int) strtol (ptr_mask+1, &endp, 10); + if (bit_count <= 0 || bit_count > 32) { + ppp_warn("invalid address length %v in auth. address list", + ptr_mask+1); + continue; + } + bit_count = 32 - bit_count; /* # bits in host part */ + if (*endp == '+') { + offset = ifunit + 1; + ++endp; + } + if (*endp != 0) { + ppp_warn("invalid address length syntax: %v", ptr_mask+1); + continue; + } + *ptr_mask = '\0'; + mask <<= bit_count; + } + + hp = gethostbyname(ptr_word); + if (hp != NULL && hp->h_addrtype == AF_INET) { + a = *(u32_t *)hp->h_addr; + } else { + np = getnetbyname (ptr_word); + if (np != NULL && np->n_addrtype == AF_INET) { + a = lwip_htonl ((u32_t)np->n_net); + if (ptr_mask == NULL) { + /* calculate appropriate mask for net */ + ah = lwip_ntohl(a); + if (IN_CLASSA(ah)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(ah)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(ah)) + mask = IN_CLASSC_NET; + } + } else { + a = inet_addr (ptr_word); + } + } + + if (ptr_mask != NULL) + *ptr_mask = '/'; + + if (a == (u32_t)-1L) { + ppp_warn("unknown host %s in auth. address list", ap->word); + continue; + } + if (offset != 0) { + if (offset >= ~mask) { + ppp_warn("interface unit %d too large for subnet %v", + ifunit, ptr_word); + continue; + } + a = lwip_htonl((lwip_ntohl(a) & mask) + offset); + mask = ~(u32_t)0; + } + ip[n].mask = lwip_htonl(mask); + ip[n].base = a & ip[n].mask; + ++n; + if (~mask == 0 && suggested_ip == 0) + suggested_ip = a; } *plink = NULL; - ip[n].permit = 0; /* make the last entry forbid all addresses */ - ip[n].base = 0; /* to terminate the list */ + ip[n].permit = 0; /* make the last entry forbid all addresses */ + ip[n].base = 0; /* to terminate the list */ ip[n].mask = 0; addresses[unit] = ip; @@ -2173,14 +2173,14 @@ set_allowed_addrs(unit, addrs, opts) * which is a single host, then use that if we find one. */ if (suggested_ip != 0 - && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { - wo->hisaddr = suggested_ip; - /* - * Do we insist on this address? No, if there are other - * addresses authorized than the suggested one. - */ - if (n > 1) - wo->accept_remote = 1; + && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { + wo->hisaddr = suggested_ip; + /* + * Do we insist on this address? No, if there are other + * addresses authorized than the suggested one. + */ + if (n > 1) + wo->accept_remote = 1; } } @@ -2197,21 +2197,21 @@ auth_ip_addr(unit, addr) /* don't allow loopback or multicast address */ if (bad_ip_adrs(addr)) - return 0; + return 0; if (allowed_address_hook) { - ok = allowed_address_hook(addr); - if (ok >= 0) return ok; + ok = allowed_address_hook(addr); + if (ok >= 0) return ok; } if (addresses[unit] != NULL) { - ok = ip_addr_check(addr, addresses[unit]); - if (ok >= 0) - return ok; + ok = ip_addr_check(addr, addresses[unit]); + if (ok >= 0) + return ok; } if (auth_required) - return 0; /* no addresses authorized */ + return 0; /* no addresses authorized */ return allow_any_ip || privileged || !have_route_to(addr); } @@ -2221,8 +2221,8 @@ ip_addr_check(addr, addrs) struct permitted_ip *addrs; { for (; ; ++addrs) - if ((addr & addrs->mask) == addrs->base) - return addrs->permit; + if ((addr & addrs->mask) == addrs->base) + return addrs->permit; } /* @@ -2236,7 +2236,7 @@ bad_ip_adrs(addr) { addr = lwip_ntohl(addr); return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET - || IN_MULTICAST(addr) || IN_BADCLASS(addr); + || IN_MULTICAST(addr) || IN_BADCLASS(addr); } /* @@ -2248,10 +2248,10 @@ some_ip_ok(addrs) struct wordlist *addrs; { for (; addrs != 0; addrs = addrs->next) { - if (addrs->word[0] == '-') - break; - if (addrs->word[0] != '!') - return 1; /* some IP address is allowed */ + if (addrs->word[0] == '-') + break; + if (addrs->word[0] != '!') + return 1; /* some IP address is allowed */ } return 0; } @@ -2268,17 +2268,17 @@ auth_number() /* Allow all if no authorization list. */ if (!wp) - return 1; + return 1; /* Allow if we have a match in the authorization list. */ while (wp) { - /* trailing '*' wildcard */ - l = strlen(wp->word); - if ((wp->word)[l - 1] == '*') - l--; - if (!strncasecmp(wp->word, remote_number, l)) - return 1; - wp = wp->next; + /* trailing '*' wildcard */ + l = strlen(wp->word); + if ((wp->word)[l - 1] == '*') + l--; + if (!strncasecmp(wp->word, remote_number, l)) + return 1; + wp = wp->next; } return 0; @@ -2295,10 +2295,10 @@ check_access(f, filename) struct stat sbuf; if (fstat(fileno(f), &sbuf) < 0) { - ppp_warn("cannot stat secret file %s: %m", filename); + ppp_warn("cannot stat secret file %s: %m", filename); } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { - ppp_warn("Warning - secret file %s has world and/or group access", - filename); + ppp_warn("Warning - secret file %s has world and/or group access", + filename); } } @@ -2337,141 +2337,141 @@ scan_authfile(f, client, server, secret, addrs, opts, filename, flags) char *cp; if (addrs != NULL) - *addrs = NULL; + *addrs = NULL; if (opts != NULL) - *opts = NULL; + *opts = NULL; addr_list = NULL; if (!getword(f, word, &newline, filename)) - return -1; /* file is empty??? */ + return -1; /* file is empty??? */ newline = 1; best_flag = -1; for (;;) { - /* - * Skip until we find a word at the start of a line. - */ - while (!newline && getword(f, word, &newline, filename)) - ; - if (!newline) - break; /* got to end of file */ - - /* - * Got a client - check if it's a match or a wildcard. - */ - got_flag = 0; - if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { - newline = 0; - continue; - } - if (!ISWILD(word)) - got_flag = NONWILD_CLIENT; - - /* - * Now get a server and check if it matches. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - if (!ISWILD(word)) { - if (server != NULL && strcmp(word, server) != 0) - continue; - got_flag |= NONWILD_SERVER; - } - - /* - * Got some sort of a match - see if it's better than what - * we have already. - */ - if (got_flag <= best_flag) - continue; - - /* - * Get the secret. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - - /* - * SRP-SHA1 authenticator should never be reading secrets from - * a file. (Authenticatee may, though.) - */ - if (flags && ((cp = strchr(word, ':')) == NULL || - strchr(cp + 1, ':') == NULL)) - continue; - - if (secret != NULL) { - /* - * Special syntax: @/pathname means read secret from file. - */ - if (word[0] == '@' && word[1] == '/') { - strlcpy(atfile, word+1, sizeof(atfile)); - if ((sf = fopen(atfile, "r")) == NULL) { - ppp_warn("can't open indirect secret file %s", atfile); - continue; - } - check_access(sf, atfile); - if (!getword(sf, word, &xxx, atfile)) { - ppp_warn("no secret in indirect secret file %s", atfile); - fclose(sf); - continue; - } - fclose(sf); - } - strlcpy(lsecret, word, sizeof(lsecret)); - } - - /* - * Now read address authorization info and make a wordlist. - */ - app = &alist; - for (;;) { - if (!getword(f, word, &newline, filename) || newline) - break; - ap = (struct wordlist *) - malloc(sizeof(struct wordlist) + strlen(word) + 1); - if (ap == NULL) - novm("authorized addresses"); - ap->word = (char *) (ap + 1); - strcpy(ap->word, word); - *app = ap; - app = &ap->next; - } - *app = NULL; - - /* - * This is the best so far; remember it. - */ - best_flag = got_flag; - if (addr_list) - free_wordlist(addr_list); - addr_list = alist; - if (secret != NULL) - strlcpy(secret, lsecret, MAXWORDLEN); - - if (!newline) - break; + /* + * Skip until we find a word at the start of a line. + */ + while (!newline && getword(f, word, &newline, filename)) + ; + if (!newline) + break; /* got to end of file */ + + /* + * Got a client - check if it's a match or a wildcard. + */ + got_flag = 0; + if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { + newline = 0; + continue; + } + if (!ISWILD(word)) + got_flag = NONWILD_CLIENT; + + /* + * Now get a server and check if it matches. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + if (!ISWILD(word)) { + if (server != NULL && strcmp(word, server) != 0) + continue; + got_flag |= NONWILD_SERVER; + } + + /* + * Got some sort of a match - see if it's better than what + * we have already. + */ + if (got_flag <= best_flag) + continue; + + /* + * Get the secret. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + + /* + * SRP-SHA1 authenticator should never be reading secrets from + * a file. (Authenticatee may, though.) + */ + if (flags && ((cp = strchr(word, ':')) == NULL || + strchr(cp + 1, ':') == NULL)) + continue; + + if (secret != NULL) { + /* + * Special syntax: @/pathname means read secret from file. + */ + if (word[0] == '@' && word[1] == '/') { + strlcpy(atfile, word+1, sizeof(atfile)); + if ((sf = fopen(atfile, "r")) == NULL) { + ppp_warn("can't open indirect secret file %s", atfile); + continue; + } + check_access(sf, atfile); + if (!getword(sf, word, &xxx, atfile)) { + ppp_warn("no secret in indirect secret file %s", atfile); + fclose(sf); + continue; + } + fclose(sf); + } + strlcpy(lsecret, word, sizeof(lsecret)); + } + + /* + * Now read address authorization info and make a wordlist. + */ + app = &alist; + for (;;) { + if (!getword(f, word, &newline, filename) || newline) + break; + ap = (struct wordlist *) + malloc(sizeof(struct wordlist) + strlen(word) + 1); + if (ap == NULL) + novm("authorized addresses"); + ap->word = (char *) (ap + 1); + strcpy(ap->word, word); + *app = ap; + app = &ap->next; + } + *app = NULL; + + /* + * This is the best so far; remember it. + */ + best_flag = got_flag; + if (addr_list) + free_wordlist(addr_list); + addr_list = alist; + if (secret != NULL) + strlcpy(secret, lsecret, MAXWORDLEN); + + if (!newline) + break; } /* scan for a -- word indicating the start of options */ for (app = &addr_list; (ap = *app) != NULL; app = &ap->next) - if (strcmp(ap->word, "--") == 0) - break; + if (strcmp(ap->word, "--") == 0) + break; /* ap = start of options */ if (ap != NULL) { - ap = ap->next; /* first option */ - free(*app); /* free the "--" word */ - *app = NULL; /* terminate addr list */ + ap = ap->next; /* first option */ + free(*app); /* free the "--" word */ + *app = NULL; /* terminate addr list */ } if (opts != NULL) - *opts = ap; + *opts = ap; else if (ap != NULL) - free_wordlist(ap); + free_wordlist(ap); if (addrs != NULL) - *addrs = addr_list; + *addrs = addr_list; else if (addr_list != NULL) - free_wordlist(addr_list); + free_wordlist(addr_list); return best_flag; } @@ -2486,7 +2486,7 @@ wordlist_count(wp) int n; for (n = 0; wp != NULL; wp = wp->next) - ++n; + ++n; return n; } @@ -2500,9 +2500,9 @@ free_wordlist(wp) struct wordlist *next; while (wp != NULL) { - next = wp->next; - free(wp); - wp = next; + next = wp->next; + free(wp); + wp = next; } } #endif /* UNUSED */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ccp.c b/components/net/lwip-2.0.2/src/netif/ppp/ccp.c index 5e5b75c361..f8519ebece 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ccp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ccp.c @@ -40,8 +40,8 @@ #include "netif/ppp/ccp.h" #if MPPE_SUPPORT -#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ -#include "netif/ppp/mppe.h" /* mppe_init() */ +#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ +#include "netif/ppp/mppe.h" /* mppe_init() */ #endif /* MPPE_SUPPORT */ /* @@ -51,7 +51,7 @@ * Until this is fixed we only accept sizes in the range 9 .. 15. * Thanks to James Carlson for pointing this out. */ -#define DEFLATE_MIN_WORKS 9 +#define DEFLATE_MIN_WORKS 9 /* * Command-line options. @@ -66,7 +66,7 @@ static char deflate_value[8]; * Option variables. */ #if MPPE_SUPPORT -bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ +bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ #endif /* MPPE_SUPPORT */ static option_t ccp_option_list[] = { @@ -248,27 +248,27 @@ static const fsm_callbacks ccp_callbacks = { static int ccp_anycompress(ccp_options *opt) { return (0 #if DEFLATE_SUPPORT - || (opt)->deflate + || (opt)->deflate #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - || (opt)->bsd_compress + || (opt)->bsd_compress #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - || (opt)->predictor_1 || (opt)->predictor_2 + || (opt)->predictor_1 || (opt)->predictor_2 #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - || (opt)->mppe + || (opt)->mppe #endif /* MPPE_SUPPORT */ - ); + ); } /* * Local state (mainly for handling reset-reqs and reset-acks). */ -#define RACK_PENDING 1 /* waiting for reset-ack */ -#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ +#define RACK_PENDING 1 /* waiting for reset-ack */ +#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ -#define RACKTIMEOUT 1 /* second */ +#define RACKTIMEOUT 1 /* second */ #if PPP_OPTIONS /* @@ -284,31 +284,31 @@ setbsdcomp(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for bsdcomp option", *argv); - return 0; + option_error("invalid parameter '%s' for bsdcomp option", *argv); + return 0; } if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS)) - || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { - option_error("bsdcomp option values must be 0 or %d .. %d", - BSD_MIN_BITS, BSD_MAX_BITS); - return 0; + || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { + option_error("bsdcomp option values must be 0 or %d .. %d", + BSD_MIN_BITS, BSD_MAX_BITS); + return 0; } if (rbits > 0) { - ccp_wantoptions[0].bsd_compress = 1; - ccp_wantoptions[0].bsd_bits = rbits; + ccp_wantoptions[0].bsd_compress = 1; + ccp_wantoptions[0].bsd_bits = rbits; } else - ccp_wantoptions[0].bsd_compress = 0; + ccp_wantoptions[0].bsd_compress = 0; if (abits > 0) { - ccp_allowoptions[0].bsd_compress = 1; - ccp_allowoptions[0].bsd_bits = abits; + ccp_allowoptions[0].bsd_compress = 1; + ccp_allowoptions[0].bsd_bits = abits; } else - ccp_allowoptions[0].bsd_compress = 0; + ccp_allowoptions[0].bsd_compress = 0; ppp_slprintf(bsd_value, sizeof(bsd_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -323,40 +323,40 @@ setdeflate(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for deflate option", *argv); - return 0; + option_error("invalid parameter '%s' for deflate option", *argv); + return 0; } if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE)) - || (abits != 0 && (abits < DEFLATE_MIN_SIZE - || abits > DEFLATE_MAX_SIZE))) { - option_error("deflate option values must be 0 or %d .. %d", - DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); - return 0; + || (abits != 0 && (abits < DEFLATE_MIN_SIZE + || abits > DEFLATE_MAX_SIZE))) { + option_error("deflate option values must be 0 or %d .. %d", + DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); + return 0; } if (rbits == DEFLATE_MIN_SIZE || abits == DEFLATE_MIN_SIZE) { - if (rbits == DEFLATE_MIN_SIZE) - rbits = DEFLATE_MIN_WORKS; - if (abits == DEFLATE_MIN_SIZE) - abits = DEFLATE_MIN_WORKS; - warn("deflate option value of %d changed to %d to avoid zlib bug", - DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); + if (rbits == DEFLATE_MIN_SIZE) + rbits = DEFLATE_MIN_WORKS; + if (abits == DEFLATE_MIN_SIZE) + abits = DEFLATE_MIN_WORKS; + warn("deflate option value of %d changed to %d to avoid zlib bug", + DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); } if (rbits > 0) { - ccp_wantoptions[0].deflate = 1; - ccp_wantoptions[0].deflate_size = rbits; + ccp_wantoptions[0].deflate = 1; + ccp_wantoptions[0].deflate_size = rbits; } else - ccp_wantoptions[0].deflate = 0; + ccp_wantoptions[0].deflate = 0; if (abits > 0) { - ccp_allowoptions[0].deflate = 1; - ccp_allowoptions[0].deflate_size = abits; + ccp_allowoptions[0].deflate = 1; + ccp_allowoptions[0].deflate_size = abits; } else - ccp_allowoptions[0].deflate = 0; + ccp_allowoptions[0].deflate = 0; ppp_slprintf(deflate_value, sizeof(deflate_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -411,7 +411,7 @@ static void ccp_open(ppp_pcb *pcb) { ccp_options *go = &pcb->ccp_gotoptions; if (f->state != PPP_FSM_OPENED) - ccp_set(pcb, 1, 0, 0, 0); + ccp_set(pcb, 1, 0, 0, 0); /* * Find out which compressors the kernel supports before @@ -419,7 +419,7 @@ static void ccp_open(ppp_pcb *pcb) { */ ccp_resetci(f); if (!ccp_anycompress(go)) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -463,12 +463,12 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { oldstate = f->state; fsm_input(f, p, len); if (oldstate == PPP_FSM_OPENED && p[0] == TERMREQ && f->state != PPP_FSM_OPENED) { - ppp_notice("Compression disabled by peer."); + ppp_notice("Compression disabled by peer."); #if MPPE_SUPPORT - if (go->mppe) { - ppp_error("MPPE disabled, closing LCP"); - lcp_close(pcb, "MPPE disabled by peer"); - } + if (go->mppe) { + ppp_error("MPPE disabled, closing LCP"); + lcp_close(pcb, "MPPE disabled by peer"); + } #endif /* MPPE_SUPPORT */ } @@ -477,8 +477,8 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { * close CCP. */ if (oldstate == PPP_FSM_REQSENT && p[0] == TERMACK - && !ccp_anycompress(go)) - ccp_close(pcb, "No compression negotiated"); + && !ccp_anycompress(go)) + ccp_close(pcb, "No compression negotiated"); } /* @@ -491,24 +491,24 @@ static int ccp_extcode(fsm *f, int code, int id, u_char *p, int len) { switch (code) { case CCP_RESETREQ: - if (f->state != PPP_FSM_OPENED) - break; - ccp_reset_comp(pcb); - /* send a reset-ack, which the transmitter will see and - reset its compression state. */ - fsm_sdata(f, CCP_RESETACK, id, NULL, 0); - break; + if (f->state != PPP_FSM_OPENED) + break; + ccp_reset_comp(pcb); + /* send a reset-ack, which the transmitter will see and + reset its compression state. */ + fsm_sdata(f, CCP_RESETACK, id, NULL, 0); + break; case CCP_RESETACK: - if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { - pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); - UNTIMEOUT(ccp_rack_timeout, f); - ccp_reset_decomp(pcb); - } - break; + if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { + pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); + UNTIMEOUT(ccp_rack_timeout, f); + ccp_reset_decomp(pcb); + } + break; default: - return 0; + return 0; } return 1; @@ -528,8 +528,8 @@ static void ccp_protrej(ppp_pcb *pcb) { #if MPPE_SUPPORT if (go->mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ @@ -554,9 +554,9 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (pcb->settings.require_mppe) { - wo->mppe = ao->mppe = - (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) - | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); + wo->mppe = ao->mppe = + (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) + | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); } #endif /* MPPE_SUPPORT */ @@ -565,78 +565,78 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (go->mppe) { - int auth_mschap_bits = pcb->auth_done; - int numbits; - - /* - * Start with a basic sanity check: mschap[v2] auth must be in - * exactly one direction. RFC 3079 says that the keys are - * 'derived from the credentials of the peer that initiated the call', - * however the PPP protocol doesn't have such a concept, and pppd - * cannot get this info externally. Instead we do the best we can. - * NB: If MPPE is required, all other compression opts are invalid. - * So, we return right away if we can't do it. - */ - - /* Leave only the mschap auth bits set */ - auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | - CHAP_MS2_WITHPEER | CHAP_MS2_PEER); - /* Count the mschap auths */ - auth_mschap_bits >>= CHAP_MS_SHIFT; - numbits = 0; - do { - numbits += auth_mschap_bits & 1; - auth_mschap_bits >>= 1; - } while (auth_mschap_bits); - if (numbits > 1) { - ppp_error("MPPE required, but auth done in both directions."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - if (!numbits) { - ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* A plugin (eg radius) may not have obtained key material. */ - if (!pcb->mppe_keys_set) { - ppp_error("MPPE required, but keys are not available. " - "Possible plugin problem?"); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* LM auth not supported for MPPE */ - if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { - /* This might be noise */ - if (go->mppe & MPPE_OPT_40) { - ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); - go->mppe &= ~MPPE_OPT_40; - wo->mppe &= ~MPPE_OPT_40; - } - } - - /* Last check: can we actually negotiate something? */ - if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { - /* Could be misconfig, could be 40-bit disabled above. */ - ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* sync options */ - ao->mppe = go->mppe; - /* MPPE is not compatible with other compression types */ + int auth_mschap_bits = pcb->auth_done; + int numbits; + + /* + * Start with a basic sanity check: mschap[v2] auth must be in + * exactly one direction. RFC 3079 says that the keys are + * 'derived from the credentials of the peer that initiated the call', + * however the PPP protocol doesn't have such a concept, and pppd + * cannot get this info externally. Instead we do the best we can. + * NB: If MPPE is required, all other compression opts are invalid. + * So, we return right away if we can't do it. + */ + + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | + CHAP_MS2_WITHPEER | CHAP_MS2_PEER); + /* Count the mschap auths */ + auth_mschap_bits >>= CHAP_MS_SHIFT; + numbits = 0; + do { + numbits += auth_mschap_bits & 1; + auth_mschap_bits >>= 1; + } while (auth_mschap_bits); + if (numbits > 1) { + ppp_error("MPPE required, but auth done in both directions."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + if (!numbits) { + ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* A plugin (eg radius) may not have obtained key material. */ + if (!pcb->mppe_keys_set) { + ppp_error("MPPE required, but keys are not available. " + "Possible plugin problem?"); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* LM auth not supported for MPPE */ + if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { + /* This might be noise */ + if (go->mppe & MPPE_OPT_40) { + ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); + go->mppe &= ~MPPE_OPT_40; + wo->mppe &= ~MPPE_OPT_40; + } + } + + /* Last check: can we actually negotiate something? */ + if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { + /* Could be misconfig, could be 40-bit disabled above. */ + ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* sync options */ + ao->mppe = go->mppe; + /* MPPE is not compatible with other compression types */ #if BSDCOMPRESS_SUPPORT - ao->bsd_compress = go->bsd_compress = 0; + ao->bsd_compress = go->bsd_compress = 0; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - ao->predictor_1 = go->predictor_1 = 0; - ao->predictor_2 = go->predictor_2 = 0; + ao->predictor_1 = go->predictor_1 = 0; + ao->predictor_2 = go->predictor_2 = 0; #endif /* PREDICTOR_SUPPORT */ #if DEFLATE_SUPPORT - ao->deflate = go->deflate = 0; + ao->deflate = go->deflate = 0; #endif /* DEFLATE_SUPPORT */ } #endif /* MPPE_SUPPORT */ @@ -650,23 +650,23 @@ static void ccp_resetci(fsm *f) { * if BSDCOMPRESS_SUPPORT is set, it is. */ if (go->bsd_compress) { - opt_buf[0] = CI_BSD_COMPRESS; - opt_buf[1] = CILEN_BSD_COMPRESS; - for (;;) { - if (go->bsd_bits < BSD_MIN_BITS) { - go->bsd_compress = 0; - break; - } - opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->bsd_compress = 0; - break; - } - go->bsd_bits--; - } + opt_buf[0] = CI_BSD_COMPRESS; + opt_buf[1] = CILEN_BSD_COMPRESS; + for (;;) { + if (go->bsd_bits < BSD_MIN_BITS) { + go->bsd_compress = 0; + break; + } + opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->bsd_compress = 0; + break; + } + go->bsd_bits--; + } } #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -674,48 +674,48 @@ static void ccp_resetci(fsm *f) { * if DEFLATE_SUPPORT is set, it is. */ if (go->deflate) { - if (go->deflate_correct) { - opt_buf[0] = CI_DEFLATE; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_correct = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_correct = 0; - break; - } - go->deflate_size--; - } - } - if (go->deflate_draft) { - opt_buf[0] = CI_DEFLATE_DRAFT; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_draft = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_draft = 0; - break; - } - go->deflate_size--; - } - } - if (!go->deflate_correct && !go->deflate_draft) - go->deflate = 0; + if (go->deflate_correct) { + opt_buf[0] = CI_DEFLATE; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_correct = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_correct = 0; + break; + } + go->deflate_size--; + } + } + if (go->deflate_draft) { + opt_buf[0] = CI_DEFLATE_DRAFT; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_draft = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_draft = 0; + break; + } + go->deflate_size--; + } + } + if (!go->deflate_correct && !go->deflate_draft) + go->deflate = 0; } #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT @@ -723,16 +723,16 @@ static void ccp_resetci(fsm *f) { * if PREDICTOR_SUPPORT is set, it is. */ if (go->predictor_1) { - opt_buf[0] = CI_PREDICTOR_1; - opt_buf[1] = CILEN_PREDICTOR_1; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) - go->predictor_1 = 0; + opt_buf[0] = CI_PREDICTOR_1; + opt_buf[1] = CILEN_PREDICTOR_1; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) + go->predictor_1 = 0; } if (go->predictor_2) { - opt_buf[0] = CI_PREDICTOR_2; - opt_buf[1] = CILEN_PREDICTOR_2; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) - go->predictor_2 = 0; + opt_buf[0] = CI_PREDICTOR_2; + opt_buf[1] = CILEN_PREDICTOR_2; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) + go->predictor_2 = 0; } #endif /* PREDICTOR_SUPPORT */ } @@ -746,20 +746,20 @@ static int ccp_cilen(fsm *f) { return 0 #if BSDCOMPRESS_SUPPORT - + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) + + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) - + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT - + (go->predictor_1? CILEN_PREDICTOR_1: 0) - + (go->predictor_2? CILEN_PREDICTOR_2: 0) + + (go->predictor_1? CILEN_PREDICTOR_1: 0) + + (go->predictor_2? CILEN_PREDICTOR_2: 0) #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - + (go->mppe? CILEN_MPPE: 0) + + (go->mppe? CILEN_MPPE: 0) #endif /* MPPE_SUPPORT */ - ; + ; } /* @@ -776,50 +776,50 @@ static void ccp_addci(fsm *f, u_char *p, int *lenp) { */ #if MPPE_SUPPORT if (go->mppe) { - p[0] = CI_MPPE; - p[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &p[2]); - mppe_init(pcb, &pcb->mppe_decomp, go->mppe); - p += CILEN_MPPE; + p[0] = CI_MPPE; + p[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &p[2]); + mppe_init(pcb, &pcb->mppe_decomp, go->mppe); + p += CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (go->deflate_correct) { - p[0] = CI_DEFLATE; - p[1] = CILEN_DEFLATE; - p[2] = DEFLATE_MAKE_OPT(go->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } - if (go->deflate_draft) { - p[0] = CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; - p[2] = p[2 - CILEN_DEFLATE]; - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } + if (go->deflate_correct) { + p[0] = CI_DEFLATE; + p[1] = CILEN_DEFLATE; + p[2] = DEFLATE_MAKE_OPT(go->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } + if (go->deflate_draft) { + p[0] = CI_DEFLATE_DRAFT; + p[1] = CILEN_DEFLATE; + p[2] = p[2 - CILEN_DEFLATE]; + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - p[0] = CI_BSD_COMPRESS; - p[1] = CILEN_BSD_COMPRESS; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - p += CILEN_BSD_COMPRESS; + p[0] = CI_BSD_COMPRESS; + p[1] = CILEN_BSD_COMPRESS; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + p += CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT /* XXX Should Predictor 2 be preferable to Predictor 1? */ if (go->predictor_1) { - p[0] = CI_PREDICTOR_1; - p[1] = CILEN_PREDICTOR_1; - p += CILEN_PREDICTOR_1; + p[0] = CI_PREDICTOR_1; + p[1] = CILEN_PREDICTOR_1; + p += CILEN_PREDICTOR_1; } if (go->predictor_2) { - p[0] = CI_PREDICTOR_2; - p[1] = CILEN_PREDICTOR_2; - p += CILEN_PREDICTOR_2; + p[0] = CI_PREDICTOR_2; + p[1] = CILEN_PREDICTOR_2; + p += CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ @@ -841,83 +841,83 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { #if MPPE_SUPPORT if (go->mppe) { - u_char opt_buf[CILEN_MPPE]; - - opt_buf[0] = CI_MPPE; - opt_buf[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); - if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) - return 0; - p += CILEN_MPPE; - len -= CILEN_MPPE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; + u_char opt_buf[CILEN_MPPE]; + + opt_buf[0] = CI_MPPE; + opt_buf[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); + if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) + return 0; + p += CILEN_MPPE; + len -= CILEN_MPPE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (len < CILEN_DEFLATE - || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; - if (go->deflate_correct && go->deflate_draft) { - if (len < CILEN_DEFLATE - || p[0] != CI_DEFLATE_DRAFT - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + if (len < CILEN_DEFLATE + || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; + if (go->deflate_correct && go->deflate_draft) { + if (len < CILEN_DEFLATE + || p[0] != CI_DEFLATE_DRAFT + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - if (len < CILEN_BSD_COMPRESS - || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS - || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_BSD_COMPRESS + || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS + || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1) { - if (len < CILEN_PREDICTOR_1 - || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) - return 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_1 + || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) + return 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } if (go->predictor_2) { - if (len < CILEN_PREDICTOR_2 - || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) - return 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_2 + || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) + return 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; return 1; } @@ -928,8 +928,8 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options no; /* options we've seen already */ - ccp_options try_; /* options to ask for next time */ + ccp_options no; /* options we've seen already */ + ccp_options try_; /* options to ask for next time */ LWIP_UNUSED_ARG(treat_as_reject); #if !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT LWIP_UNUSED_ARG(p); @@ -941,66 +941,66 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - no.mppe = 1; - /* - * Peer wants us to use a different strength or other setting. - * Fail if we aren't willing to use his suggestion. - */ - MPPE_CI_TO_OPTS(&p[2], try_.mppe); - if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - try_.mppe = 0; - } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { - /* Peer must have set options we didn't request (suggest) */ - try_.mppe = 0; - } - - if (!try_.mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - } + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + no.mppe = 1; + /* + * Peer wants us to use a different strength or other setting. + * Fail if we aren't willing to use his suggestion. + */ + MPPE_CI_TO_OPTS(&p[2], try_.mppe); + if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + try_.mppe = 0; + } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { + /* Peer must have set options we didn't request (suggest) */ + try_.mppe = 0; + } + + if (!try_.mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { - no.deflate = 1; - /* - * Peer wants us to use a different code size or something. - * Stop asking for Deflate if we don't understand his suggestion. - */ - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS - || p[3] != DEFLATE_CHK_SEQUENCE) - try_.deflate = 0; - else if (DEFLATE_SIZE(p[2]) < go->deflate_size) - try_.deflate_size = DEFLATE_SIZE(p[2]); - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - if (go->deflate_correct && go->deflate_draft - && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT - && p[1] == CILEN_DEFLATE) { - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + && p[1] == CILEN_DEFLATE) { + no.deflate = 1; + /* + * Peer wants us to use a different code size or something. + * Stop asking for Deflate if we don't understand his suggestion. + */ + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS + || p[3] != DEFLATE_CHK_SEQUENCE) + try_.deflate = 0; + else if (DEFLATE_SIZE(p[2]) < go->deflate_size) + try_.deflate_size = DEFLATE_SIZE(p[2]); + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + if (go->deflate_correct && go->deflate_draft + && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT + && p[1] == CILEN_DEFLATE) { + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - no.bsd_compress = 1; - /* - * Peer wants us to use a different number of bits - * or a different version. - */ - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) - try_.bsd_compress = 0; - else if (BSD_NBITS(p[2]) < go->bsd_bits) - try_.bsd_bits = BSD_NBITS(p[2]); - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + no.bsd_compress = 1; + /* + * Peer wants us to use a different number of bits + * or a different version. + */ + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) + try_.bsd_compress = 0; + else if (BSD_NBITS(p[2]) < go->bsd_bits) + try_.bsd_bits = BSD_NBITS(p[2]); + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ @@ -1011,7 +1011,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1021,7 +1021,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { static int ccp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options try_; /* options to request next time */ + ccp_options try_; /* options to request next time */ try_ = *go; @@ -1030,69 +1030,69 @@ static int ccp_rejci(fsm *f, u_char *p, int len) { * configure-requests. */ if (len == 0 && pcb->ccp_all_rejected) - return -1; + return -1; #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - ppp_error("MPPE required but peer refused"); - lcp_close(pcb, "MPPE required but peer refused"); - p += CILEN_MPPE; - len -= CILEN_MPPE; + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + ppp_error("MPPE required but peer refused"); + lcp_close(pcb, "MPPE required but peer refused"); + p += CILEN_MPPE; + len -= CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate_correct && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_correct = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_correct = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (go->deflate_draft && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_draft = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_draft = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (!try_.deflate_correct && !try_.deflate_draft) - try_.deflate = 0; + try_.deflate = 0; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - try_.bsd_compress = 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + try_.bsd_compress = 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1 && len >= CILEN_PREDICTOR_1 - && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { - try_.predictor_1 = 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; + && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { + try_.predictor_1 = 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; } if (go->predictor_2 && len >= CILEN_PREDICTOR_2 - && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { - try_.predictor_2 = 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; + && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { + try_.predictor_2 = 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1114,8 +1114,8 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { u_char *p0, *retp; int len, clen, type; #if MPPE_SUPPORT - u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ - /* CI_MPPE, or due to other options? */ + u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ + /* CI_MPPE, or due to other options? */ #endif /* MPPE_SUPPORT */ ret = CONFACK; @@ -1126,257 +1126,257 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { ho->method = (len > 0)? p[0]: 0; while (len > 0) { - newret = CONFACK; - if (len < 2 || p[1] < 2 || p[1] > len) { - /* length is bad */ - clen = len; - newret = CONFREJ; + newret = CONFACK; + if (len < 2 || p[1] < 2 || p[1] > len) { + /* length is bad */ + clen = len; + newret = CONFREJ; - } else { - type = p[0]; - clen = p[1]; + } else { + type = p[0]; + clen = p[1]; - switch (type) { + switch (type) { #if MPPE_SUPPORT - case CI_MPPE: - if (!ao->mppe || clen != CILEN_MPPE) { - newret = CONFREJ; - break; - } - MPPE_CI_TO_OPTS(&p[2], ho->mppe); - - /* Nak if anything unsupported or unknown are set. */ - if (ho->mppe & MPPE_OPT_UNSUPPORTED) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNSUPPORTED; - } - if (ho->mppe & MPPE_OPT_UNKNOWN) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNKNOWN; - } - - /* Check state opt */ - if (ho->mppe & MPPE_OPT_STATEFUL) { - /* - * We can Nak and request stateless, but it's a - * lot easier to just assume the peer will request - * it if he can do it; stateful mode is bad over - * the Internet -- which is where we expect MPPE. - */ - if (pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - newret = CONFREJ; - break; - } - } - - /* Find out which of {S,L} are set. */ - if ((ho->mppe & MPPE_OPT_128) - && (ho->mppe & MPPE_OPT_40)) { - /* Both are set, negotiate the strongest. */ - newret = CONFNAK; - if (ao->mppe & MPPE_OPT_128) - ho->mppe &= ~MPPE_OPT_40; - else if (ao->mppe & MPPE_OPT_40) - ho->mppe &= ~MPPE_OPT_128; - else { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_128) { - if (!(ao->mppe & MPPE_OPT_128)) { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_40) { - if (!(ao->mppe & MPPE_OPT_40)) { - newret = CONFREJ; - break; - } - } else { - /* Neither are set. */ - /* We cannot accept this. */ - newret = CONFNAK; - /* Give the peer our idea of what can be used, - so it can choose and confirm */ - ho->mppe = ao->mppe; - } - - /* rebuild the opts */ - MPPE_OPTS_TO_CI(ho->mppe, &p[2]); - if (newret == CONFACK) { - int mtu; - - mppe_init(pcb, &pcb->mppe_comp, ho->mppe); - /* - * We need to decrease the interface MTU by MPPE_PAD - * because MPPE frames **grow**. The kernel [must] - * allocate MPPE_PAD extra bytes in xmit buffers. - */ - mtu = netif_get_mtu(pcb); - if (mtu) - netif_set_mtu(pcb, mtu - MPPE_PAD); - else - newret = CONFREJ; - } - - /* - * We have accepted MPPE or are willing to negotiate - * MPPE parameters. A CONFREJ is due to subsequent - * (non-MPPE) processing. - */ - rej_for_ci_mppe = 0; - break; + case CI_MPPE: + if (!ao->mppe || clen != CILEN_MPPE) { + newret = CONFREJ; + break; + } + MPPE_CI_TO_OPTS(&p[2], ho->mppe); + + /* Nak if anything unsupported or unknown are set. */ + if (ho->mppe & MPPE_OPT_UNSUPPORTED) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNSUPPORTED; + } + if (ho->mppe & MPPE_OPT_UNKNOWN) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNKNOWN; + } + + /* Check state opt */ + if (ho->mppe & MPPE_OPT_STATEFUL) { + /* + * We can Nak and request stateless, but it's a + * lot easier to just assume the peer will request + * it if he can do it; stateful mode is bad over + * the Internet -- which is where we expect MPPE. + */ + if (pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + newret = CONFREJ; + break; + } + } + + /* Find out which of {S,L} are set. */ + if ((ho->mppe & MPPE_OPT_128) + && (ho->mppe & MPPE_OPT_40)) { + /* Both are set, negotiate the strongest. */ + newret = CONFNAK; + if (ao->mppe & MPPE_OPT_128) + ho->mppe &= ~MPPE_OPT_40; + else if (ao->mppe & MPPE_OPT_40) + ho->mppe &= ~MPPE_OPT_128; + else { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_128) { + if (!(ao->mppe & MPPE_OPT_128)) { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_40) { + if (!(ao->mppe & MPPE_OPT_40)) { + newret = CONFREJ; + break; + } + } else { + /* Neither are set. */ + /* We cannot accept this. */ + newret = CONFNAK; + /* Give the peer our idea of what can be used, + so it can choose and confirm */ + ho->mppe = ao->mppe; + } + + /* rebuild the opts */ + MPPE_OPTS_TO_CI(ho->mppe, &p[2]); + if (newret == CONFACK) { + int mtu; + + mppe_init(pcb, &pcb->mppe_comp, ho->mppe); + /* + * We need to decrease the interface MTU by MPPE_PAD + * because MPPE frames **grow**. The kernel [must] + * allocate MPPE_PAD extra bytes in xmit buffers. + */ + mtu = netif_get_mtu(pcb); + if (mtu) + netif_set_mtu(pcb, mtu - MPPE_PAD); + else + newret = CONFREJ; + } + + /* + * We have accepted MPPE or are willing to negotiate + * MPPE parameters. A CONFREJ is due to subsequent + * (non-MPPE) processing. + */ + rej_for_ci_mppe = 0; + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (!ao->deflate || clen != CILEN_DEFLATE - || (!ao->deflate_correct && type == CI_DEFLATE) - || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { - newret = CONFREJ; - break; - } - - ho->deflate = 1; - ho->deflate_size = nb = DEFLATE_SIZE(p[2]); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || p[3] != DEFLATE_CHK_SEQUENCE - || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do Deflate with the window - * size they want. If the window is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_DEFLATE, 1); - if (res > 0) - break; /* it's OK now */ - if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { - newret = CONFREJ; - p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); - break; - } - newret = CONFNAK; - --nb; - p[2] = DEFLATE_MAKE_OPT(nb); - } - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (!ao->deflate || clen != CILEN_DEFLATE + || (!ao->deflate_correct && type == CI_DEFLATE) + || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { + newret = CONFREJ; + break; + } + + ho->deflate = 1; + ho->deflate_size = nb = DEFLATE_SIZE(p[2]); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || p[3] != DEFLATE_CHK_SEQUENCE + || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do Deflate with the window + * size they want. If the window is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_DEFLATE, 1); + if (res > 0) + break; /* it's OK now */ + if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { + newret = CONFREJ; + p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); + break; + } + newret = CONFNAK; + --nb; + p[2] = DEFLATE_MAKE_OPT(nb); + } + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { - newret = CONFREJ; - break; - } - - ho->bsd_compress = 1; - ho->bsd_bits = nb = BSD_NBITS(p[2]); - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION - || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do BSD-Compress with the code - * size they want. If the code size is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); - if (res > 0) - break; - if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { - newret = CONFREJ; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, - ho->bsd_bits); - break; - } - newret = CONFNAK; - --nb; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); - } - } - break; + case CI_BSD_COMPRESS: + if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { + newret = CONFREJ; + break; + } + + ho->bsd_compress = 1; + ho->bsd_bits = nb = BSD_NBITS(p[2]); + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION + || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do BSD-Compress with the code + * size they want. If the code size is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); + if (res > 0) + break; + if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { + newret = CONFREJ; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, + ho->bsd_bits); + break; + } + newret = CONFNAK; + --nb; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); + } + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { - newret = CONFREJ; - break; - } - - ho->predictor_1 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { - newret = CONFREJ; - } - break; - - case CI_PREDICTOR_2: - if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { - newret = CONFREJ; - break; - } - - ho->predictor_2 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { - newret = CONFREJ; - } - break; + case CI_PREDICTOR_1: + if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { + newret = CONFREJ; + break; + } + + ho->predictor_1 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { + newret = CONFREJ; + } + break; + + case CI_PREDICTOR_2: + if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { + newret = CONFREJ; + break; + } + + ho->predictor_2 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { + newret = CONFREJ; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: - newret = CONFREJ; - } - } + default: + newret = CONFREJ; + } + } - if (newret == CONFNAK && dont_nak) - newret = CONFREJ; - if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { - /* we're returning this option */ - if (newret == CONFREJ && ret == CONFNAK) - retp = p0; - ret = newret; - if (p != retp) - MEMCPY(retp, p, clen); - retp += clen; - } + if (newret == CONFNAK && dont_nak) + newret = CONFREJ; + if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { + /* we're returning this option */ + if (newret == CONFREJ && ret == CONFNAK) + retp = p0; + ret = newret; + if (p != retp) + MEMCPY(retp, p, clen); + retp += clen; + } - p += clen; - len -= clen; + p += clen; + len -= clen; } if (ret != CONFACK) { - if (ret == CONFREJ && *lenp == retp - p0) - pcb->ccp_all_rejected = 1; - else - *lenp = retp - p0; + if (ret == CONFREJ && *lenp == retp - p0) + pcb->ccp_all_rejected = 1; + else + *lenp = retp - p0; } #if MPPE_SUPPORT if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ return ret; @@ -1392,63 +1392,63 @@ static const char *method_name(ccp_options *opt, ccp_options *opt2) { #endif /* !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT */ if (!ccp_anycompress(opt)) - return "(none)"; + return "(none)"; switch (opt->method) { #if MPPE_SUPPORT case CI_MPPE: { - char *p = result; - char *q = result + sizeof(result); /* 1 past result */ - - ppp_slprintf(p, q - p, "MPPE "); - p += 5; - if (opt->mppe & MPPE_OPT_128) { - ppp_slprintf(p, q - p, "128-bit "); - p += 8; - } - if (opt->mppe & MPPE_OPT_40) { - ppp_slprintf(p, q - p, "40-bit "); - p += 7; - } - if (opt->mppe & MPPE_OPT_STATEFUL) - ppp_slprintf(p, q - p, "stateful"); - else - ppp_slprintf(p, q - p, "stateless"); - - break; + char *p = result; + char *q = result + sizeof(result); /* 1 past result */ + + ppp_slprintf(p, q - p, "MPPE "); + p += 5; + if (opt->mppe & MPPE_OPT_128) { + ppp_slprintf(p, q - p, "128-bit "); + p += 8; + } + if (opt->mppe & MPPE_OPT_40) { + ppp_slprintf(p, q - p, "40-bit "); + p += 7; + } + if (opt->mppe & MPPE_OPT_STATEFUL) + ppp_slprintf(p, q - p, "stateful"); + else + ppp_slprintf(p, q - p, "stateless"); + + break; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT case CI_DEFLATE: case CI_DEFLATE_DRAFT: - if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) - ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size, opt2->deflate_size); - else - ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size); - break; + if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) + ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size, opt2->deflate_size); + else + ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size); + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT case CI_BSD_COMPRESS: - if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", - opt->bsd_bits, opt2->bsd_bits); - else - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", - opt->bsd_bits); - break; + if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", + opt->bsd_bits, opt2->bsd_bits); + else + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", + opt->bsd_bits); + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT case CI_PREDICTOR_1: - return "Predictor 1"; + return "Predictor 1"; case CI_PREDICTOR_2: - return "Predictor 2"; + return "Predictor 2"; #endif /* PREDICTOR_SUPPORT */ default: - ppp_slprintf(result, sizeof(result), "Method %d", opt->method); + ppp_slprintf(result, sizeof(result), "Method %d", opt->method); } return result; } @@ -1464,21 +1464,21 @@ static void ccp_up(fsm *f) { ccp_set(pcb, 1, 1, go->method, ho->method); if (ccp_anycompress(go)) { - if (ccp_anycompress(ho)) { - if (go->method == ho->method) { - ppp_notice("%s compression enabled", method_name(go, ho)); - } else { - ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); - ppp_notice("%s / %s compression enabled", - method1, method_name(ho, NULL)); - } - } else - ppp_notice("%s receive compression enabled", method_name(go, NULL)); + if (ccp_anycompress(ho)) { + if (go->method == ho->method) { + ppp_notice("%s compression enabled", method_name(go, ho)); + } else { + ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); + ppp_notice("%s / %s compression enabled", + method1, method_name(ho, NULL)); + } + } else + ppp_notice("%s receive compression enabled", method_name(go, NULL)); } else if (ccp_anycompress(ho)) - ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); + ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); #if MPPE_SUPPORT if (go->mppe) { - continue_networks(pcb); /* Bring up IP et al */ + continue_networks(pcb); /* Bring up IP et al */ } #endif /* MPPE_SUPPORT */ } @@ -1493,17 +1493,17 @@ static void ccp_down(fsm *f) { #endif /* MPPE_SUPPORT */ if (pcb->ccp_localstate & RACK_PENDING) - UNTIMEOUT(ccp_rack_timeout, f); + UNTIMEOUT(ccp_rack_timeout, f); pcb->ccp_localstate = 0; ccp_set(pcb, 1, 0, 0, 0); #if MPPE_SUPPORT if (go->mppe) { - go->mppe = 0; - if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { - /* If LCP is not already going down, make sure it does. */ - ppp_error("MPPE disabled"); - lcp_close(pcb, "MPPE disabled"); - } + go->mppe = 0; + if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { + /* If LCP is not already going down, make sure it does. */ + ppp_error("MPPE disabled"); + lcp_close(pcb, "MPPE disabled"); + } } #endif /* MPPE_SUPPORT */ } @@ -1526,17 +1526,17 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons p0 = p; if (plen < HEADERLEN) - return 0; + return 0; code = p[0]; id = p[1]; len = (p[2] << 8) + p[3]; if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ccp_codenames) && ccp_codenames[code-1] != NULL) - printer(arg, " %s", ccp_codenames[code-1]); + printer(arg, " %s", ccp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; p += HEADERLEN; @@ -1546,99 +1546,99 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons case CONFACK: case CONFNAK: case CONFREJ: - /* print list of possible compression methods */ - while (len >= 2) { - code = p[0]; - optlen = p[1]; - if (optlen < 2 || optlen > len) - break; - printer(arg, " <"); - len -= optlen; - optend = p + optlen; - switch (code) { + /* print list of possible compression methods */ + while (len >= 2) { + code = p[0]; + optlen = p[1]; + if (optlen < 2 || optlen > len) + break; + printer(arg, " <"); + len -= optlen; + optend = p + optlen; + switch (code) { #if MPPE_SUPPORT - case CI_MPPE: - if (optlen >= CILEN_MPPE) { - u_char mppe_opts; - - MPPE_CI_TO_OPTS(&p[2], mppe_opts); - printer(arg, "mppe %s %s %s %s %s %s%s", - (p[2] & MPPE_H_BIT)? "+H": "-H", - (p[5] & MPPE_M_BIT)? "+M": "-M", - (p[5] & MPPE_S_BIT)? "+S": "-S", - (p[5] & MPPE_L_BIT)? "+L": "-L", - (p[5] & MPPE_D_BIT)? "+D": "-D", - (p[5] & MPPE_C_BIT)? "+C": "-C", - (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); - if (mppe_opts & MPPE_OPT_UNKNOWN) - printer(arg, " (%.2x %.2x %.2x %.2x)", - p[2], p[3], p[4], p[5]); - p += CILEN_MPPE; - } - break; + case CI_MPPE: + if (optlen >= CILEN_MPPE) { + u_char mppe_opts; + + MPPE_CI_TO_OPTS(&p[2], mppe_opts); + printer(arg, "mppe %s %s %s %s %s %s%s", + (p[2] & MPPE_H_BIT)? "+H": "-H", + (p[5] & MPPE_M_BIT)? "+M": "-M", + (p[5] & MPPE_S_BIT)? "+S": "-S", + (p[5] & MPPE_L_BIT)? "+L": "-L", + (p[5] & MPPE_D_BIT)? "+D": "-D", + (p[5] & MPPE_C_BIT)? "+C": "-C", + (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); + if (mppe_opts & MPPE_OPT_UNKNOWN) + printer(arg, " (%.2x %.2x %.2x %.2x)", + p[2], p[3], p[4], p[5]); + p += CILEN_MPPE; + } + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (optlen >= CILEN_DEFLATE) { - printer(arg, "deflate%s %d", - (code == CI_DEFLATE_DRAFT? "(old#)": ""), - DEFLATE_SIZE(p[2])); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) - printer(arg, " method %d", DEFLATE_METHOD(p[2])); - if (p[3] != DEFLATE_CHK_SEQUENCE) - printer(arg, " check %d", p[3]); - p += CILEN_DEFLATE; - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (optlen >= CILEN_DEFLATE) { + printer(arg, "deflate%s %d", + (code == CI_DEFLATE_DRAFT? "(old#)": ""), + DEFLATE_SIZE(p[2])); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) + printer(arg, " method %d", DEFLATE_METHOD(p[2])); + if (p[3] != DEFLATE_CHK_SEQUENCE) + printer(arg, " check %d", p[3]); + p += CILEN_DEFLATE; + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (optlen >= CILEN_BSD_COMPRESS) { - printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), - BSD_NBITS(p[2])); - p += CILEN_BSD_COMPRESS; - } - break; + case CI_BSD_COMPRESS: + if (optlen >= CILEN_BSD_COMPRESS) { + printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), + BSD_NBITS(p[2])); + p += CILEN_BSD_COMPRESS; + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (optlen >= CILEN_PREDICTOR_1) { - printer(arg, "predictor 1"); - p += CILEN_PREDICTOR_1; - } - break; - case CI_PREDICTOR_2: - if (optlen >= CILEN_PREDICTOR_2) { - printer(arg, "predictor 2"); - p += CILEN_PREDICTOR_2; - } - break; + case CI_PREDICTOR_1: + if (optlen >= CILEN_PREDICTOR_1) { + printer(arg, "predictor 1"); + p += CILEN_PREDICTOR_1; + } + break; + case CI_PREDICTOR_2: + if (optlen >= CILEN_PREDICTOR_2) { + printer(arg, "predictor 2"); + p += CILEN_PREDICTOR_2; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: + default: break; - } - while (p < optend) - printer(arg, " %.2x", *p++); - printer(arg, ">"); - } - break; + } + while (p < optend) + printer(arg, " %.2x", *p++); + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: break; } /* dump out the rest of the packet in hex */ while (--len >= 0) - printer(arg, " %.2x", *p++); + printer(arg, " %.2x", *p++); return p - p0; } @@ -1667,34 +1667,34 @@ static void ccp_datainput(ppp_pcb *pcb, u_char *pkt, int len) { f = &pcb->ccp_fsm; if (f->state == PPP_FSM_OPENED) { - if (ccp_fatal_error(pcb)) { - /* - * Disable compression by taking CCP down. - */ - ppp_error("Lost compression sync: disabling compression"); - ccp_close(pcb, "Lost compression sync"); + if (ccp_fatal_error(pcb)) { + /* + * Disable compression by taking CCP down. + */ + ppp_error("Lost compression sync: disabling compression"); + ccp_close(pcb, "Lost compression sync"); #if MPPE_SUPPORT - /* - * If we were doing MPPE, we must also take the link down. - */ - if (go->mppe) { - ppp_error("Too many MPPE errors, closing LCP"); - lcp_close(pcb, "Too many MPPE errors"); - } + /* + * If we were doing MPPE, we must also take the link down. + */ + if (go->mppe) { + ppp_error("Too many MPPE errors, closing LCP"); + lcp_close(pcb, "Too many MPPE errors"); + } #endif /* MPPE_SUPPORT */ - } else { - /* - * Send a reset-request to reset the peer's compressor. - * We don't do that if we are still waiting for an - * acknowledgement to a previous reset-request. - */ - if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; - } else - pcb->ccp_localstate |= RREQ_REPEAT; - } + } else { + /* + * Send a reset-request to reset the peer's compressor. + * We don't do that if we are still waiting for an + * acknowledgement to a previous reset-request. + */ + if (!(pcb->ccp_localstate & RACK_PENDING)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; + } else + pcb->ccp_localstate |= RREQ_REPEAT; + } } } #endif /* PPP_DATAINPUT */ @@ -1707,7 +1707,7 @@ void ccp_resetrequest(ppp_pcb *pcb) { fsm *f = &pcb->ccp_fsm; if (f->state != PPP_FSM_OPENED) - return; + return; /* * Send a reset-request to reset the peer's compressor. @@ -1715,11 +1715,11 @@ void ccp_resetrequest(ppp_pcb *pcb) { * acknowledgement to a previous reset-request. */ if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; } else - pcb->ccp_localstate |= RREQ_REPEAT; + pcb->ccp_localstate |= RREQ_REPEAT; } /* @@ -1730,11 +1730,11 @@ static void ccp_rack_timeout(void *arg) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED && (pcb->ccp_localstate & RREQ_REPEAT)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate &= ~RREQ_REPEAT; + fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate &= ~RREQ_REPEAT; } else - pcb->ccp_localstate &= ~RACK_PENDING; + pcb->ccp_localstate &= ~RACK_PENDING; } #endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c b/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c index 2b7c9b36a8..88f069f032 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/chap-md5.c @@ -43,84 +43,84 @@ #include "netif/ppp/magic.h" #include "netif/ppp/pppcrypt.h" -#define MD5_HASH_SIZE 16 -#define MD5_MIN_CHALLENGE 17 -#define MD5_MAX_CHALLENGE 24 +#define MD5_HASH_SIZE 16 +#define MD5_MIN_CHALLENGE 17 +#define MD5_MAX_CHALLENGE 24 #define MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE 3 /* 2^3-1 = 7, 17+7 = 24 */ #if PPP_SERVER static void chap_md5_generate_challenge(ppp_pcb *pcb, unsigned char *cp) { - int clen; - LWIP_UNUSED_ARG(pcb); + int clen; + LWIP_UNUSED_ARG(pcb); - clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); - *cp++ = clen; - magic_random_bytes(cp, clen); + clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); + *cp++ = clen; + magic_random_bytes(cp, clen); } static int chap_md5_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - lwip_md5_context ctx; - unsigned char idbyte = id; - unsigned char hash[MD5_HASH_SIZE]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(name); - LWIP_UNUSED_ARG(pcb); + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + lwip_md5_context ctx; + unsigned char idbyte = id; + unsigned char hash[MD5_HASH_SIZE]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(pcb); - challenge_len = *challenge++; - response_len = *response++; - if (response_len == MD5_HASH_SIZE) { - /* Generate hash of ID, secret, challenge */ - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, hash); - lwip_md5_free(&ctx); + challenge_len = *challenge++; + response_len = *response++; + if (response_len == MD5_HASH_SIZE) { + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, hash); + lwip_md5_free(&ctx); - /* Test if our hash matches the peer's response */ - if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } - } - ppp_slprintf(message, message_space, "Access denied"); - return 0; + /* Test if our hash matches the peer's response */ + if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } + } + ppp_slprintf(message, message_space, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chap_md5_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - lwip_md5_context ctx; - unsigned char idbyte = id; - int challenge_len = *challenge++; - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - LWIP_UNUSED_ARG(pcb); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + lwip_md5_context ctx; + unsigned char idbyte = id; + int challenge_len = *challenge++; + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + LWIP_UNUSED_ARG(pcb); - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, (const u_char *)secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, &response[1]); - lwip_md5_free(&ctx); - response[0] = MD5_HASH_SIZE; + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, (const u_char *)secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, &response[1]); + lwip_md5_free(&ctx); + response[0] = MD5_HASH_SIZE; } const struct chap_digest_type md5_digest = { - CHAP_MD5, /* code */ + CHAP_MD5, /* code */ #if PPP_SERVER - chap_md5_generate_challenge, - chap_md5_verify_response, + chap_md5_generate_challenge, + chap_md5_verify_response, #endif /* PPP_SERVER */ - chap_md5_make_response, - NULL, /* check_success */ - NULL, /* handle_failure */ + chap_md5_make_response, + NULL, /* check_success */ + NULL, /* handle_failure */ }; #endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c b/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c index e599f3eb76..485122d272 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/chap-new.c @@ -52,9 +52,9 @@ #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ int (*chap_verify_hook)(const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) = NULL; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) = NULL; #endif /* UNUSED */ #if PPP_OPTIONS @@ -62,24 +62,24 @@ int (*chap_verify_hook)(const char *name, const char *ourname, int id, * Command-line options. */ static option_t chap_option_list[] = { - { "chap-restart", o_int, &chap_timeout_time, - "Set timeout for CHAP", OPT_PRIO }, - { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, - "Set max #xmits for challenge", OPT_PRIO }, - { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, - "Set interval for rechallenge", OPT_PRIO }, - { NULL } + { "chap-restart", o_int, &chap_timeout_time, + "Set timeout for CHAP", OPT_PRIO }, + { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, + "Set max #xmits for challenge", OPT_PRIO }, + { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, + "Set interval for rechallenge", OPT_PRIO }, + { NULL } }; #endif /* PPP_OPTIONS */ /* Values for flags in chap_client_state and chap_server_state */ -#define LOWERUP 1 -#define AUTH_STARTED 2 -#define AUTH_DONE 4 -#define AUTH_FAILED 8 -#define TIMEOUT_PENDING 0x10 -#define CHALLENGE_VALID 0x20 +#define LOWERUP 1 +#define AUTH_STARTED 2 +#define AUTH_DONE 4 +#define AUTH_FAILED 8 +#define TIMEOUT_PENDING 0x10 +#define CHALLENGE_VALID 0x20 /* * Prototypes. @@ -91,21 +91,21 @@ static void chap_lowerdown(ppp_pcb *pcb); static void chap_timeout(void *arg); static void chap_generate_challenge(ppp_pcb *pcb); static void chap_handle_response(ppp_pcb *pcb, int code, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_protrej(ppp_pcb *pcb); static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen); #if PRINTPKT_SUPPORT static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ /* List of digest types that we know about */ @@ -122,12 +122,12 @@ static const struct chap_digest_type* const chap_digests[] = { * chap_init - reset to initial state. */ static void chap_init(ppp_pcb *pcb) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); #if 0 /* Not necessary, everything is cleared in ppp_new() */ - memset(&pcb->chap_client, 0, sizeof(chap_client_state)); + memset(&pcb->chap_client, 0, sizeof(chap_client_state)); #if PPP_SERVER - memset(&pcb->chap_server, 0, sizeof(chap_server_state)); + memset(&pcb->chap_server, 0, sizeof(chap_server_state)); #endif /* PPP_SERVER */ #endif /* 0 */ } @@ -137,21 +137,21 @@ static void chap_init(ppp_pcb *pcb) { */ static void chap_lowerup(ppp_pcb *pcb) { - pcb->chap_client.flags |= LOWERUP; + pcb->chap_client.flags |= LOWERUP; #if PPP_SERVER - pcb->chap_server.flags |= LOWERUP; - if (pcb->chap_server.flags & AUTH_STARTED) - chap_timeout(pcb); + pcb->chap_server.flags |= LOWERUP; + if (pcb->chap_server.flags & AUTH_STARTED) + chap_timeout(pcb); #endif /* PPP_SERVER */ } static void chap_lowerdown(ppp_pcb *pcb) { - pcb->chap_client.flags = 0; + pcb->chap_client.flags = 0; #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) - UNTIMEOUT(chap_timeout, pcb); - pcb->chap_server.flags = 0; + if (pcb->chap_server.flags & TIMEOUT_PENDING) + UNTIMEOUT(chap_timeout, pcb); + pcb->chap_server.flags = 0; #endif /* PPP_SERVER */ } @@ -162,27 +162,27 @@ static void chap_lowerdown(ppp_pcb *pcb) { * otherwise we wait for the lower layer to come up. */ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if (pcb->chap_server.flags & AUTH_STARTED) { - ppp_error("CHAP: peer authentication already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_server.digest = dp; - pcb->chap_server.name = our_name; - /* Start with a random ID value */ - pcb->chap_server.id = magic(); - pcb->chap_server.flags |= AUTH_STARTED; - if (pcb->chap_server.flags & LOWERUP) - chap_timeout(pcb); + const struct chap_digest_type *dp; + int i; + + if (pcb->chap_server.flags & AUTH_STARTED) { + ppp_error("CHAP: peer authentication already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_server.digest = dp; + pcb->chap_server.name = our_name; + /* Start with a random ID value */ + pcb->chap_server.id = magic(); + pcb->chap_server.flags |= AUTH_STARTED; + if (pcb->chap_server.flags & LOWERUP) + chap_timeout(pcb); } #endif /* PPP_SERVER */ @@ -191,27 +191,27 @@ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * There isn't much to do until we receive a challenge. */ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if(NULL == our_name) - return; - - if (pcb->chap_client.flags & AUTH_STARTED) { - ppp_error("CHAP: authentication with peer already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_client.digest = dp; - pcb->chap_client.name = our_name; - pcb->chap_client.flags |= AUTH_STARTED; + const struct chap_digest_type *dp; + int i; + + if(NULL == our_name) + return; + + if (pcb->chap_client.flags & AUTH_STARTED) { + ppp_error("CHAP: authentication with peer already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_client.digest = dp; + pcb->chap_client.name = our_name; + pcb->chap_client.flags |= AUTH_STARTED; } #if PPP_SERVER @@ -221,33 +221,33 @@ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * or a new challenge to start re-authentication. */ static void chap_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; - struct pbuf *p; - - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { - pcb->chap_server.challenge_xmits = 0; - chap_generate_challenge(pcb); - pcb->chap_server.flags |= CHALLENGE_VALID; - } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; - auth_peer_fail(pcb, PPP_CHAP); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); - ppp_write(pcb, p); - ++pcb->chap_server.challenge_xmits; - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); + ppp_pcb *pcb = (ppp_pcb*)arg; + struct pbuf *p; + + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { + pcb->chap_server.challenge_xmits = 0; + chap_generate_challenge(pcb); + pcb->chap_server.flags |= CHALLENGE_VALID; + } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; + auth_peer_fail(pcb, PPP_CHAP); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); + ppp_write(pcb, p); + ++pcb->chap_server.challenge_xmits; + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); } /* @@ -255,152 +255,152 @@ static void chap_timeout(void *arg) { * the challenge packet in pcb->chap_server.challenge_pkt. */ static void chap_generate_challenge(ppp_pcb *pcb) { - int clen = 1, nlen, len; - unsigned char *p; - - p = pcb->chap_server.challenge; - MAKEHEADER(p, PPP_CHAP); - p += CHAP_HDRLEN; - pcb->chap_server.digest->generate_challenge(pcb, p); - clen = *p; - nlen = strlen(pcb->chap_server.name); - memcpy(p + 1 + clen, pcb->chap_server.name, nlen); - - len = CHAP_HDRLEN + 1 + clen + nlen; - pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; - - p = pcb->chap_server.challenge + PPP_HDRLEN; - p[0] = CHAP_CHALLENGE; - p[1] = ++pcb->chap_server.id; - p[2] = len >> 8; - p[3] = len; + int clen = 1, nlen, len; + unsigned char *p; + + p = pcb->chap_server.challenge; + MAKEHEADER(p, PPP_CHAP); + p += CHAP_HDRLEN; + pcb->chap_server.digest->generate_challenge(pcb, p); + clen = *p; + nlen = strlen(pcb->chap_server.name); + memcpy(p + 1 + clen, pcb->chap_server.name, nlen); + + len = CHAP_HDRLEN + 1 + clen + nlen; + pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; + + p = pcb->chap_server.challenge + PPP_HDRLEN; + p[0] = CHAP_CHALLENGE; + p[1] = ++pcb->chap_server.id; + p[2] = len >> 8; + p[3] = len; } /* * chap_handle_response - check the response to our challenge. */ static void chap_handle_response(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int response_len, ok, mlen; - const unsigned char *response; - unsigned char *outp; - struct pbuf *p; - const char *name = NULL; /* initialized to shut gcc up */ + unsigned char *pkt, int len) { + int response_len, ok, mlen; + const unsigned char *response; + unsigned char *outp; + struct pbuf *p; + const char *name = NULL; /* initialized to shut gcc up */ #if 0 /* UNUSED */ - int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, - const unsigned char *, const unsigned char *, char *, int); + int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, + const unsigned char *, const unsigned char *, char *, int); #endif /* UNUSED */ - char rname[MAXNAMELEN+1]; - char message[256]; - - if ((pcb->chap_server.flags & LOWERUP) == 0) - return; - if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) - return; - if (pcb->chap_server.flags & CHALLENGE_VALID) { - response = pkt; - GETCHAR(response_len, pkt); - len -= response_len + 1; /* length of name */ - name = (char *)pkt + response_len; - if (len < 0) - return; - - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } + char rname[MAXNAMELEN+1]; + char message[256]; + + if ((pcb->chap_server.flags & LOWERUP) == 0) + return; + if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) + return; + if (pcb->chap_server.flags & CHALLENGE_VALID) { + response = pkt; + GETCHAR(response_len, pkt); + len -= response_len + 1; /* length of name */ + name = (char *)pkt + response_len; + if (len < 0) + return; + + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } #if PPP_REMOTENAME - if (pcb->settings.explicit_remote) { - name = pcb->remote_name; - } else + if (pcb->settings.explicit_remote) { + name = pcb->remote_name; + } else #endif /* PPP_REMOTENAME */ - { - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); - name = rname; - } + { + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); + name = rname; + } #if 0 /* UNUSED */ - if (chap_verify_hook) - verifier = chap_verify_hook; - else - verifier = chap_verify_response; - ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, - pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, - response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); + if (chap_verify_hook) + verifier = chap_verify_hook; + else + verifier = chap_verify_response; + ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, + pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, + response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); #endif /* UNUSED */ - ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, + ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, response, message, sizeof(message)); #if 0 /* UNUSED */ - if (!ok || !auth_number()) { + if (!ok || !auth_number()) { #endif /* UNUSED */ - if (!ok) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP authentication", name); - } - } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) - return; - - /* send the response */ - mlen = strlen(message); - len = CHAP_HDRLEN + mlen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (unsigned char *)p->payload; - MAKEHEADER(outp, PPP_CHAP); - - outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - if (mlen > 0) - memcpy(outp + CHAP_HDRLEN, message, mlen); - ppp_write(pcb, p); - - if (pcb->chap_server.flags & CHALLENGE_VALID) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { + if (!ok) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP authentication", name); + } + } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) + return; + + /* send the response */ + mlen = strlen(message); + len = CHAP_HDRLEN + mlen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (unsigned char *)p->payload; + MAKEHEADER(outp, PPP_CHAP); + + outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + if (mlen > 0) + memcpy(outp + CHAP_HDRLEN, message, mlen); + ppp_write(pcb, p); + + if (pcb->chap_server.flags & CHALLENGE_VALID) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { #if 0 /* UNUSED */ - /* - * Auth is OK, so now we need to check session restrictions - * to ensure everything is OK, but only if we used a - * plugin, and only if we're configured to check. This - * allows us to do PAM checks on PPP servers that - * authenticate against ActiveDirectory, and use AD for - * account info (like when using Winbind integrated with - * PAM). - */ - if (session_mgmt && - session_check(name, NULL, devnam, NULL) == 0) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP Session verification", name); - } + /* + * Auth is OK, so now we need to check session restrictions + * to ensure everything is OK, but only if we used a + * plugin, and only if we're configured to check. This + * allows us to do PAM checks on PPP servers that + * authenticate against ActiveDirectory, and use AD for + * account info (like when using Winbind integrated with + * PAM). + */ + if (session_mgmt && + session_check(name, NULL, devnam, NULL) == 0) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP Session verification", name); + } #endif /* UNUSED */ - } - if (pcb->chap_server.flags & AUTH_FAILED) { - auth_peer_fail(pcb, PPP_CHAP); - } else { - if ((pcb->chap_server.flags & AUTH_DONE) == 0) - auth_peer_success(pcb, PPP_CHAP, - pcb->chap_server.digest->code, - name, strlen(name)); - if (pcb->settings.chap_rechallenge_time) { - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, pcb, - pcb->settings.chap_rechallenge_time); - } - } - pcb->chap_server.flags |= AUTH_DONE; - } + } + if (pcb->chap_server.flags & AUTH_FAILED) { + auth_peer_fail(pcb, PPP_CHAP); + } else { + if ((pcb->chap_server.flags & AUTH_DONE) == 0) + auth_peer_success(pcb, PPP_CHAP, + pcb->chap_server.digest->code, + name, strlen(name)); + if (pcb->settings.chap_rechallenge_time) { + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, pcb, + pcb->settings.chap_rechallenge_time); + } + } + pcb->chap_server.flags |= AUTH_DONE; + } } /* @@ -409,23 +409,23 @@ static void chap_handle_response(ppp_pcb *pcb, int id, * succeeded), or 0 if it doesn't. */ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - int ok; - unsigned char secret[MAXSECRETLEN]; - int secret_len; - - /* Get the secret that the peer is supposed to know */ - if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { - ppp_error("No CHAP secret found for authenticating %q", name); - return 0; - } - ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, - response, message, message_space); - memset(secret, 0, sizeof(secret)); - - return ok; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + int ok; + unsigned char secret[MAXSECRETLEN]; + int secret_len; + + /* Get the secret that the peer is supposed to know */ + if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { + ppp_error("No CHAP secret found for authenticating %q", name); + return 0; + } + ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, + response, message, message_space); + memset(secret, 0, sizeof(secret)); + + return ok; } #endif /* PPP_SERVER */ @@ -433,153 +433,153 @@ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourn * chap_respond - Generate and send a response to a challenge. */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int clen, nlen; - int secret_len; - struct pbuf *p; - u_char *outp; - char rname[MAXNAMELEN+1]; - char secret[MAXSECRETLEN+1]; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) - return; /* not ready */ - if (len < 2 || len < pkt[0] + 1) - return; /* too short */ - clen = pkt[0]; - nlen = len - (clen + 1); - - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); + unsigned char *pkt, int len) { + int clen, nlen; + int secret_len; + struct pbuf *p; + u_char *outp; + char rname[MAXNAMELEN+1]; + char secret[MAXSECRETLEN+1]; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) + return; /* not ready */ + if (len < 2 || len < pkt[0] + 1) + return; /* too short */ + clen = pkt[0]; + nlen = len - (clen + 1); + + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); #if PPP_REMOTENAME - /* Microsoft doesn't send their name back in the PPP packet */ - if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) - strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); + /* Microsoft doesn't send their name back in the PPP packet */ + if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) + strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); #endif /* PPP_REMOTENAME */ - /* get secret for authenticating ourselves with the specified host */ - if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { - secret_len = 0; /* assume null secret if can't find one */ - ppp_warn("No CHAP secret found for authenticating us to %q", rname); - } - - outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_CHAP); - outp += CHAP_HDRLEN; - - pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, - secret, secret_len, pcb->chap_client.priv); - memset(secret, 0, secret_len); - - clen = *outp; - nlen = strlen(pcb->chap_client.name); - memcpy(outp + clen + 1, pcb->chap_client.name, nlen); - - outp = (u_char*)p->payload + PPP_HDRLEN; - len = CHAP_HDRLEN + clen + 1 + nlen; - outp[0] = CHAP_RESPONSE; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - - pbuf_realloc(p, PPP_HDRLEN + len); - ppp_write(pcb, p); + /* get secret for authenticating ourselves with the specified host */ + if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { + secret_len = 0; /* assume null secret if can't find one */ + ppp_warn("No CHAP secret found for authenticating us to %q", rname); + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_CHAP); + outp += CHAP_HDRLEN; + + pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, + secret, secret_len, pcb->chap_client.priv); + memset(secret, 0, secret_len); + + clen = *outp; + nlen = strlen(pcb->chap_client.name); + memcpy(outp + clen + 1, pcb->chap_client.name, nlen); + + outp = (u_char*)p->payload + PPP_HDRLEN; + len = CHAP_HDRLEN + clen + 1 + nlen; + outp[0] = CHAP_RESPONSE; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + + pbuf_realloc(p, PPP_HDRLEN + len); + ppp_write(pcb, p); } static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len) { - const char *msg = NULL; - LWIP_UNUSED_ARG(id); - - if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) - != (AUTH_STARTED|LOWERUP)) - return; - pcb->chap_client.flags |= AUTH_DONE; - - if (code == CHAP_SUCCESS) { - /* used for MS-CHAP v2 mutual auth, yuck */ - if (pcb->chap_client.digest->check_success != NULL) { - if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) - code = CHAP_FAILURE; - } else - msg = "CHAP authentication succeeded"; - } else { - if (pcb->chap_client.digest->handle_failure != NULL) - (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); - else - msg = "CHAP authentication failed"; - } - if (msg) { - if (len > 0) - ppp_info("%s: %.*v", msg, len, pkt); - else - ppp_info("%s", msg); - } - if (code == CHAP_SUCCESS) - auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); - else { - pcb->chap_client.flags |= AUTH_FAILED; - ppp_error("CHAP authentication failed"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + unsigned char *pkt, int len) { + const char *msg = NULL; + LWIP_UNUSED_ARG(id); + + if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) + != (AUTH_STARTED|LOWERUP)) + return; + pcb->chap_client.flags |= AUTH_DONE; + + if (code == CHAP_SUCCESS) { + /* used for MS-CHAP v2 mutual auth, yuck */ + if (pcb->chap_client.digest->check_success != NULL) { + if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) + code = CHAP_FAILURE; + } else + msg = "CHAP authentication succeeded"; + } else { + if (pcb->chap_client.digest->handle_failure != NULL) + (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); + else + msg = "CHAP authentication failed"; + } + if (msg) { + if (len > 0) + ppp_info("%s: %.*v", msg, len, pkt); + else + ppp_info("%s", msg); + } + if (code == CHAP_SUCCESS) + auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); + else { + pcb->chap_client.flags |= AUTH_FAILED; + ppp_error("CHAP authentication failed"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen) { - unsigned char code, id; - int len; - - if (pktlen < CHAP_HDRLEN) - return; - GETCHAR(code, pkt); - GETCHAR(id, pkt); - GETSHORT(len, pkt); - if (len < CHAP_HDRLEN || len > pktlen) - return; - len -= CHAP_HDRLEN; - - switch (code) { - case CHAP_CHALLENGE: - chap_respond(pcb, id, pkt, len); - break; + unsigned char code, id; + int len; + + if (pktlen < CHAP_HDRLEN) + return; + GETCHAR(code, pkt); + GETCHAR(id, pkt); + GETSHORT(len, pkt); + if (len < CHAP_HDRLEN || len > pktlen) + return; + len -= CHAP_HDRLEN; + + switch (code) { + case CHAP_CHALLENGE: + chap_respond(pcb, id, pkt, len); + break; #if PPP_SERVER - case CHAP_RESPONSE: - chap_handle_response(pcb, id, pkt, len); - break; + case CHAP_RESPONSE: + chap_handle_response(pcb, id, pkt, len); + break; #endif /* PPP_SERVER */ - case CHAP_FAILURE: - case CHAP_SUCCESS: - chap_handle_status(pcb, code, id, pkt, len); - break; - default: - break; - } + case CHAP_FAILURE: + case CHAP_SUCCESS: + chap_handle_status(pcb, code, id, pkt, len); + break; + default: + break; + } } static void chap_protrej(ppp_pcb *pcb) { #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } - if (pcb->chap_server.flags & AUTH_STARTED) { - pcb->chap_server.flags = 0; - auth_peer_fail(pcb, PPP_CHAP); - } + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } + if (pcb->chap_server.flags & AUTH_STARTED) { + pcb->chap_server.flags = 0; + auth_peer_fail(pcb, PPP_CHAP); + } #endif /* PPP_SERVER */ - if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { - pcb->chap_client.flags &= ~AUTH_STARTED; - ppp_error("CHAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { + pcb->chap_client.flags &= ~AUTH_STARTED; + ppp_error("CHAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } #if PRINTPKT_SUPPORT @@ -587,90 +587,90 @@ static void chap_protrej(ppp_pcb *pcb) { * chap_print_pkt - print the contents of a CHAP packet. */ static const char* const chap_code_names[] = { - "Challenge", "Response", "Success", "Failure" + "Challenge", "Response", "Success", "Failure" }; static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len; - int clen, nlen; - unsigned char x; - - if (plen < CHAP_HDRLEN) - return 0; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < CHAP_HDRLEN || len > plen) - return 0; - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) - printer(arg, " %s", chap_code_names[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= CHAP_HDRLEN; - switch (code) { - case CHAP_CHALLENGE: - case CHAP_RESPONSE: - if (len < 1) - break; - clen = p[0]; - if (len < clen + 1) - break; - ++p; - nlen = len - clen - 1; - printer(arg, " <"); - for (; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, "%.2x", x); - } - printer(arg, ">, name = "); - ppp_print_string(p, nlen, printer, arg); - break; - case CHAP_FAILURE: - case CHAP_SUCCESS: - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - break; - default: - for (clen = len; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, " %.2x", x); - } - /* no break */ - } - - return len + CHAP_HDRLEN; + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len; + int clen, nlen; + unsigned char x; + + if (plen < CHAP_HDRLEN) + return 0; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < CHAP_HDRLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) + printer(arg, " %s", chap_code_names[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= CHAP_HDRLEN; + switch (code) { + case CHAP_CHALLENGE: + case CHAP_RESPONSE: + if (len < 1) + break; + clen = p[0]; + if (len < clen + 1) + break; + ++p; + nlen = len - clen - 1; + printer(arg, " <"); + for (; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, "%.2x", x); + } + printer(arg, ">, name = "); + ppp_print_string(p, nlen, printer, arg); + break; + case CHAP_FAILURE: + case CHAP_SUCCESS: + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + break; + default: + for (clen = len; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, " %.2x", x); + } + /* no break */ + } + + return len + CHAP_HDRLEN; } #endif /* PRINTPKT_SUPPORT */ const struct protent chap_protent = { - PPP_CHAP, - chap_init, - chap_input, - chap_protrej, - chap_lowerup, - chap_lowerdown, - NULL, /* open */ - NULL, /* close */ + PPP_CHAP, + chap_init, + chap_input, + chap_protrej, + chap_lowerup, + chap_lowerdown, + NULL, /* open */ + NULL, /* close */ #if PRINTPKT_SUPPORT - chap_print_pkt, + chap_print_pkt, #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* datainput */ + NULL, /* datainput */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "CHAP", /* name */ - NULL, /* data_name */ + "CHAP", /* name */ + NULL, /* data_name */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - chap_option_list, - NULL, /* check_options */ + chap_option_list, + NULL, /* check_options */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, - NULL + NULL, + NULL #endif /* DEMAND_SUPPORT */ }; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c b/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c index b050aa1cd1..5a989c9b7e 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/chap_ms.c @@ -97,41 +97,41 @@ #include "netif/ppp/mppe.h" /* For mppe_sha1_pad*, mppe_set_key() */ #endif /* MPPE_SUPPORT */ -#define SHA1_SIGNATURE_SIZE 20 -#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ -#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ +#define SHA1_SIGNATURE_SIZE 20 +#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ +#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ -#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ -#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ -#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ - /* as ASCII */ +#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ +#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ +#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ + /* as ASCII */ /* Error codes for MS-CHAP failure messages. */ -#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 -#define MS_CHAP_ERROR_ACCT_DISABLED 647 -#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 -#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 -#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 -#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 +#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 +#define MS_CHAP_ERROR_ACCT_DISABLED 647 +#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 +#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 +#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 +#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 /* * Offsets within the response field for MS-CHAP */ -#define MS_CHAP_LANMANRESP 0 -#define MS_CHAP_LANMANRESP_LEN 24 -#define MS_CHAP_NTRESP 24 -#define MS_CHAP_NTRESP_LEN 24 -#define MS_CHAP_USENT 48 +#define MS_CHAP_LANMANRESP 0 +#define MS_CHAP_LANMANRESP_LEN 24 +#define MS_CHAP_NTRESP 24 +#define MS_CHAP_NTRESP_LEN 24 +#define MS_CHAP_USENT 48 /* * Offsets within the response field for MS-CHAP2 */ -#define MS_CHAP2_PEER_CHALLENGE 0 -#define MS_CHAP2_PEER_CHAL_LEN 16 -#define MS_CHAP2_RESERVED_LEN 8 -#define MS_CHAP2_NTRESP 24 -#define MS_CHAP2_NTRESP_LEN 24 -#define MS_CHAP2_FLAGS 48 +#define MS_CHAP2_PEER_CHALLENGE 0 +#define MS_CHAP2_PEER_CHAL_LEN 16 +#define MS_CHAP2_RESERVED_LEN 8 +#define MS_CHAP2_NTRESP 24 +#define MS_CHAP2_NTRESP_LEN 24 +#define MS_CHAP2_FLAGS 48 #if MPPE_SUPPORT #if 0 /* UNUSED */ @@ -150,37 +150,37 @@ extern void set_mppe_enc_types(int, int); #define MS_CHAP2_AUTHENTICATEE 0 #define MS_CHAP2_AUTHENTICATOR 1 -static void ascii2unicode (const char[], int, u_char[]); -static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); -static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); -static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); -static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); -static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, - u_char[24]); -static void GenerateAuthenticatorResponsePlain - (const char*, int, u_char[24], const u_char[16], const u_char *, - const char *, u_char[41]); +static void ascii2unicode (const char[], int, u_char[]); +static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); +static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); +static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); +static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); +static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, + u_char[24]); +static void GenerateAuthenticatorResponsePlain + (const char*, int, u_char[24], const u_char[16], const u_char *, + const char *, u_char[41]); #ifdef MSLANMAN -static void ChapMS_LANMan (u_char *, char *, int, u_char *); +static void ChapMS_LANMan (u_char *, char *, int, u_char *); #endif static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); #if MPPE_SUPPORT -static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); -static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); +static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); +static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); #endif /* MPPE_SUPPORT */ static void ChapMS (ppp_pcb *pcb, const u_char *, const char *, int, u_char *); static void ChapMS2 (ppp_pcb *pcb, const u_char *, const u_char *, const char *, const char *, int, - u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); + u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); #ifdef MSLANMAN -bool ms_lanman = 0; /* Use LanMan password instead of NT */ - /* Has meaning only with MS-CHAP challenges */ +bool ms_lanman = 0; /* Use LanMan password instead of NT */ + /* Has meaning only with MS-CHAP challenges */ #endif #if MPPE_SUPPORT @@ -192,7 +192,7 @@ static char *mschap_challenge = NULL; static char *mschap2_peer_challenge = NULL; #endif -#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ +#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ #include "netif/ppp/ccp.h" #endif /* MPPE_SUPPORT */ @@ -202,16 +202,16 @@ static char *mschap2_peer_challenge = NULL; */ static option_t chapms_option_list[] = { #ifdef MSLANMAN - { "ms-lanman", o_bool, &ms_lanman, - "Use LanMan passwd when using MS-CHAP", 1 }, + { "ms-lanman", o_bool, &ms_lanman, + "Use LanMan passwd when using MS-CHAP", 1 }, #endif #ifdef DEBUGMPPEKEY - { "mschap-challenge", o_string, &mschap_challenge, - "specify CHAP challenge" }, - { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, - "specify CHAP peer challenge" }, + { "mschap-challenge", o_string, &mschap_challenge, + "specify CHAP challenge" }, + { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, + "specify CHAP peer challenge" }, #endif - { NULL } + { NULL } }; #endif /* PPP_OPTIONS */ @@ -223,279 +223,279 @@ static option_t chapms_option_list[] = { * at challenge[1]. */ static void chapms_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 8; + *challenge++ = 8; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 8) - memcpy(challenge, mschap_challenge, 8); - else + if (mschap_challenge && strlen(mschap_challenge) == 8) + memcpy(challenge, mschap_challenge, 8); + else #endif - magic_random_bytes(challenge, 8); + magic_random_bytes(challenge, 8); } static void chapms2_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 16; + *challenge++ = 16; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 16) - memcpy(challenge, mschap_challenge, 16); - else + if (mschap_challenge && strlen(mschap_challenge) == 16) + memcpy(challenge, mschap_challenge, 16); + else #endif - magic_random_bytes(challenge, 16); + magic_random_bytes(challenge, 16); } static int chapms_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP_RESPONSE_LEN]; - int diff; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(name); - - challenge_len = *challenge++; /* skip length, is 8 */ - response_len = *response++; - if (response_len != MS_CHAP_RESPONSE_LEN) - goto bad; + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP_RESPONSE_LEN]; + int diff; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(name); + + challenge_len = *challenge++; /* skip length, is 8 */ + response_len = *response++; + if (response_len != MS_CHAP_RESPONSE_LEN) + goto bad; #ifndef MSLANMAN - if (!response[MS_CHAP_USENT]) { - /* Should really propagate this into the error packet. */ - ppp_notice("Peer request for LANMAN auth not supported"); - goto bad; - } + if (!response[MS_CHAP_USENT]) { + /* Should really propagate this into the error packet. */ + ppp_notice("Peer request for LANMAN auth not supported"); + goto bad; + } #endif - /* Generate the expected response. */ - ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); + /* Generate the expected response. */ + ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); #ifdef MSLANMAN - /* Determine which part of response to verify against */ - if (!response[MS_CHAP_USENT]) - diff = memcmp(&response[MS_CHAP_LANMANRESP], - &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); - else + /* Determine which part of response to verify against */ + if (!response[MS_CHAP_USENT]) + diff = memcmp(&response[MS_CHAP_LANMANRESP], + &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); + else #endif - diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], - MS_CHAP_NTRESP_LEN); + diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], + MS_CHAP_NTRESP_LEN); - if (diff == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } + if (diff == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } bad: - /* See comments below for MS-CHAP V2 */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", - challenge_len, challenge); - return 0; + /* See comments below for MS-CHAP V2 */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", + challenge_len, challenge); + return 0; } static int chapms2_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP2_RESPONSE_LEN]; - char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - - challenge_len = *challenge++; /* skip length, is 16 */ - response_len = *response++; - if (response_len != MS_CHAP2_RESPONSE_LEN) - goto bad; /* not even the right length */ - - /* Generate the expected response and our mutual auth. */ - ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, - (const char *)secret, secret_len, md, - (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); - - /* compare MDs and send the appropriate status */ - /* - * Per RFC 2759, success message must be formatted as - * "S= M=" - * where - * is the Authenticator Response (mutual auth) - * is a text message - * - * However, some versions of Windows (win98 tested) do not know - * about the M= part (required per RFC 2759) and flag - * it as an error (reported incorrectly as an encryption error - * to the user). Since the RFC requires it, and it can be - * useful information, we supply it if the peer is a conforming - * system. Luckily (?), win98 sets the Flags field to 0x04 - * (contrary to RFC requirements) so we can use that to - * distinguish between conforming and non-conforming systems. - * - * Special thanks to Alex Swiridov for - * help debugging this. - */ - if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], - MS_CHAP2_NTRESP_LEN) == 0) { - if (response[MS_CHAP2_FLAGS]) - ppp_slprintf(message, message_space, "S=%s", saresponse); - else - ppp_slprintf(message, message_space, "S=%s M=%s", - saresponse, "Access granted"); - return 1; - } + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP2_RESPONSE_LEN]; + char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + + challenge_len = *challenge++; /* skip length, is 16 */ + response_len = *response++; + if (response_len != MS_CHAP2_RESPONSE_LEN) + goto bad; /* not even the right length */ + + /* Generate the expected response and our mutual auth. */ + ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, + (const char *)secret, secret_len, md, + (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); + + /* compare MDs and send the appropriate status */ + /* + * Per RFC 2759, success message must be formatted as + * "S= M=" + * where + * is the Authenticator Response (mutual auth) + * is a text message + * + * However, some versions of Windows (win98 tested) do not know + * about the M= part (required per RFC 2759) and flag + * it as an error (reported incorrectly as an encryption error + * to the user). Since the RFC requires it, and it can be + * useful information, we supply it if the peer is a conforming + * system. Luckily (?), win98 sets the Flags field to 0x04 + * (contrary to RFC requirements) so we can use that to + * distinguish between conforming and non-conforming systems. + * + * Special thanks to Alex Swiridov for + * help debugging this. + */ + if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], + MS_CHAP2_NTRESP_LEN) == 0) { + if (response[MS_CHAP2_FLAGS]) + ppp_slprintf(message, message_space, "S=%s", saresponse); + else + ppp_slprintf(message, message_space, "S=%s M=%s", + saresponse, "Access granted"); + return 1; + } bad: - /* - * Failure message must be formatted as - * "E=e R=r C=c V=v M=m" - * where - * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) - * r = retry (we use 1, ok to retry) - * c = challenge to use for next response, we reuse previous - * v = Change Password version supported, we use 0 - * m = text message - * - * The M=m part is only for MS-CHAPv2. Neither win2k nor - * win98 (others untested) display the message to the user anyway. - * They also both ignore the E=e code. - * - * Note that it's safe to reuse the same challenge as we don't - * actually accept another response based on the error message - * (and no clients try to resend a response anyway). - * - * Basically, this whole bit is useless code, even the small - * implementation here is only because of overspecification. - */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", - challenge_len, challenge, "Access denied"); - return 0; + /* + * Failure message must be formatted as + * "E=e R=r C=c V=v M=m" + * where + * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) + * r = retry (we use 1, ok to retry) + * c = challenge to use for next response, we reuse previous + * v = Change Password version supported, we use 0 + * m = text message + * + * The M=m part is only for MS-CHAPv2. Neither win2k nor + * win98 (others untested) display the message to the user anyway. + * They also both ignore the E=e code. + * + * Note that it's safe to reuse the same challenge as we don't + * actually accept another response based on the error message + * (and no clients try to resend a response anyway). + * + * Basically, this whole bit is useless code, even the small + * implementation here is only because of overspecification. + */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", + challenge_len, challenge, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chapms_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - challenge++; /* skip length, should be 8 */ - *response++ = MS_CHAP_RESPONSE_LEN; - ChapMS(pcb, challenge, secret, secret_len, response); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + challenge++; /* skip length, should be 8 */ + *response++ = MS_CHAP_RESPONSE_LEN; + ChapMS(pcb, challenge, secret, secret_len, response); } static void chapms2_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - challenge++; /* skip length, should be 16 */ - *response++ = MS_CHAP2_RESPONSE_LEN; - ChapMS2(pcb, challenge, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + challenge++; /* skip length, should be 16 */ + *response++ = MS_CHAP2_RESPONSE_LEN; + ChapMS2(pcb, challenge, #ifdef DEBUGMPPEKEY - mschap2_peer_challenge, + mschap2_peer_challenge, #else - NULL, + NULL, #endif - our_name, secret, secret_len, response, private_, - MS_CHAP2_AUTHENTICATEE); + our_name, secret, secret_len, response, private_, + MS_CHAP2_AUTHENTICATEE); } static int chapms2_check_success(ppp_pcb *pcb, unsigned char *msg, int len, unsigned char *private_) { - LWIP_UNUSED_ARG(pcb); - - if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || - strncmp((char *)msg, "S=", 2) != 0) { - /* Packet does not start with "S=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - msg += 2; - len -= 2; - if (len < MS_AUTH_RESPONSE_LENGTH - || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { - /* Authenticator Response did not match expected. */ - ppp_error("MS-CHAPv2 mutual authentication failed."); - return 0; - } - /* Authenticator Response matches. */ - msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ - len -= MS_AUTH_RESPONSE_LENGTH; - if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { - msg += 3; /* Eat the delimiter */ - } else if (len) { - /* Packet has extra text which does not begin " M=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - return 1; + LWIP_UNUSED_ARG(pcb); + + if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || + strncmp((char *)msg, "S=", 2) != 0) { + /* Packet does not start with "S=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + msg += 2; + len -= 2; + if (len < MS_AUTH_RESPONSE_LENGTH + || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { + /* Authenticator Response did not match expected. */ + ppp_error("MS-CHAPv2 mutual authentication failed."); + return 0; + } + /* Authenticator Response matches. */ + msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ + len -= MS_AUTH_RESPONSE_LENGTH; + if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { + msg += 3; /* Eat the delimiter */ + } else if (len) { + /* Packet has extra text which does not begin " M=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + return 1; } static void chapms_handle_failure(ppp_pcb *pcb, unsigned char *inp, int len) { - int err; - const char *p; - char msg[64]; - LWIP_UNUSED_ARG(pcb); - - /* We want a null-terminated string for strxxx(). */ - len = LWIP_MIN(len, 63); - MEMCPY(msg, inp, len); - msg[len] = 0; - p = msg; - - /* - * Deal with MS-CHAP formatted failure messages; just print the - * M= part (if any). For MS-CHAP we're not really supposed - * to use M=, but it shouldn't hurt. See - * chapms[2]_verify_response. - */ - if (!strncmp(p, "E=", 2)) - err = strtol(p+2, NULL, 10); /* Remember the error code. */ - else - goto print_msg; /* Message is badly formatted. */ - - if (len && ((p = strstr(p, " M=")) != NULL)) { - /* M= field found. */ - p += 3; - } else { - /* No M=; use the error code. */ - switch (err) { - case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: - p = "E=646 Restricted logon hours"; - break; - - case MS_CHAP_ERROR_ACCT_DISABLED: - p = "E=647 Account disabled"; - break; - - case MS_CHAP_ERROR_PASSWD_EXPIRED: - p = "E=648 Password expired"; - break; - - case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: - p = "E=649 No dialin permission"; - break; - - case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: - p = "E=691 Authentication failure"; - break; - - case MS_CHAP_ERROR_CHANGING_PASSWORD: - /* Should never see this, we don't support Change Password. */ - p = "E=709 Error changing password"; - break; - - default: - ppp_error("Unknown MS-CHAP authentication failure: %.*v", - len, inp); - return; - } - } + int err; + const char *p; + char msg[64]; + LWIP_UNUSED_ARG(pcb); + + /* We want a null-terminated string for strxxx(). */ + len = LWIP_MIN(len, 63); + MEMCPY(msg, inp, len); + msg[len] = 0; + p = msg; + + /* + * Deal with MS-CHAP formatted failure messages; just print the + * M= part (if any). For MS-CHAP we're not really supposed + * to use M=, but it shouldn't hurt. See + * chapms[2]_verify_response. + */ + if (!strncmp(p, "E=", 2)) + err = strtol(p+2, NULL, 10); /* Remember the error code. */ + else + goto print_msg; /* Message is badly formatted. */ + + if (len && ((p = strstr(p, " M=")) != NULL)) { + /* M= field found. */ + p += 3; + } else { + /* No M=; use the error code. */ + switch (err) { + case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: + p = "E=646 Restricted logon hours"; + break; + + case MS_CHAP_ERROR_ACCT_DISABLED: + p = "E=647 Account disabled"; + break; + + case MS_CHAP_ERROR_PASSWD_EXPIRED: + p = "E=648 Password expired"; + break; + + case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: + p = "E=649 No dialin permission"; + break; + + case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: + p = "E=691 Authentication failure"; + break; + + case MS_CHAP_ERROR_CHANGING_PASSWORD: + /* Should never see this, we don't support Change Password. */ + p = "E=709 Error changing password"; + break; + + default: + ppp_error("Unknown MS-CHAP authentication failure: %.*v", + len, inp); + return; + } + } print_msg: - if (p != NULL) - ppp_error("MS-CHAP authentication failed: %v", p); + if (p != NULL) + ppp_error("MS-CHAP authentication failed: %v", p); } static void ChallengeResponse(const u_char *challenge, - const u_char PasswordHash[MD4_SIGNATURE_SIZE], - u_char response[24]) { + const u_char PasswordHash[MD4_SIGNATURE_SIZE], + u_char response[24]) { u_char ZPasswordHash[21]; lwip_des_context des; u_char des_key[8]; @@ -505,7 +505,7 @@ static void ChallengeResponse(const u_char *challenge, #if 0 dbglog("ChallengeResponse - ZPasswordHash %.*B", - sizeof(ZPasswordHash), ZPasswordHash); + sizeof(ZPasswordHash), ZPasswordHash); #endif pppcrypt_56_to_64_bit_key(ZPasswordHash + 0, des_key); @@ -532,16 +532,16 @@ static void ChallengeResponse(const u_char *challenge, } static void ChallengeHash(const u_char PeerChallenge[16], const u_char *rchallenge, - const char *username, u_char Challenge[8]) { - lwip_sha1_context sha1Context; - u_char sha1Hash[SHA1_SIGNATURE_SIZE]; - const char *user; + const char *username, u_char Challenge[8]) { + lwip_sha1_context sha1Context; + u_char sha1Hash[SHA1_SIGNATURE_SIZE]; + const char *user; /* remove domain from "domain\username" */ if ((user = strrchr(username, '\\')) != NULL) - ++user; + ++user; else - user = username; + user = username; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -566,11 +566,11 @@ static void ascii2unicode(const char ascii[], int ascii_len, u_char unicode[]) { BZERO(unicode, ascii_len * 2); for (i = 0; i < ascii_len; i++) - unicode[i * 2] = (u_char) ascii[i]; + unicode[i * 2] = (u_char) ascii[i]; } static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE]) { - lwip_md4_context md4Context; + lwip_md4_context md4Context; lwip_md4_init(&md4Context); lwip_md4_starts(&md4Context); @@ -580,9 +580,9 @@ static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNA } static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_len, - u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; /* Hash the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -592,10 +592,10 @@ static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_l } static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], const char *username, - const char *secret, int secret_len, u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char Challenge[8]; + const char *secret, int secret_len, u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char Challenge[8]; ChallengeHash(PeerChallenge, rchallenge, username, Challenge); @@ -610,10 +610,10 @@ static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, - unsigned char *response) { - int i; - u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + unsigned char *response) { + int i; + u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ + u_char PasswordHash[MD4_SIGNATURE_SIZE]; lwip_des_context des; u_char des_key[8]; @@ -640,28 +640,28 @@ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { /* * "Magic" constants used in response generation, from RFC 2759. */ static const u_char Magic1[39] = /* "Magic server to client signing constant" */ - { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, - 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, - 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; + { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, + 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, + 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; static const u_char Magic2[41] = /* "Pad to make it do more than one iteration" */ - { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, - 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, - 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, - 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, - 0x6E }; + { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, + 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, + 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, + 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, + 0x6E }; - int i; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; - u_char Challenge[8]; + int i; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; + u_char Challenge[8]; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -683,27 +683,27 @@ static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGN /* Convert to ASCII hex string. */ for (i = 0; i < LWIP_MAX((MS_AUTH_RESPONSE_LENGTH / 2), (int)sizeof(Digest)); i++) - sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); + sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); } static void GenerateAuthenticatorResponsePlain( - const char *secret, int secret_len, - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + const char *secret, int secret_len, + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); NTPasswordHash(PasswordHash, sizeof(PasswordHash), - PasswordHashHash); + PasswordHashHash); GenerateAuthenticatorResponse(PasswordHashHash, NTResponse, PeerChallenge, - rchallenge, username, authResponse); + rchallenge, username, authResponse); } @@ -712,11 +712,11 @@ static void GenerateAuthenticatorResponsePlain( * Set mppe_xxxx_key from MS-CHAP credentials. (see RFC 3079) */ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, int secret_len) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -742,43 +742,43 @@ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *se * Set mppe_xxxx_key from MS-CHAPv2 credentials. (see RFC 3079) */ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_char NTResponse[24], int IsServer) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ const u_char *s; /* "This is the MPPE Master Key" */ static const u_char Magic1[27] = - { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; + { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; /* "On the client side, this is the send key; " "on the server side, it is the receive key." */ static const u_char Magic2[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, - 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, - 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, + 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, + 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* "On the client side, this is the receive key; " "on the server side, it is the send key." */ static const u_char Magic3[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, - 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, + 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -797,9 +797,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate send key */ if (IsServer) - s = Magic3; + s = Magic3; else - s = Magic2; + s = Magic2; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -815,9 +815,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate recv key */ if (IsServer) - s = Magic2; + s = Magic2; else - s = Magic3; + s = Magic3; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -846,7 +846,7 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i #ifdef MSLANMAN ChapMS_LANMan(rchallenge, secret, secret_len, - &response[MS_CHAP_LANMANRESP]); + &response[MS_CHAP_LANMANRESP]); /* preferred method is set by option */ response[MS_CHAP_USENT] = !ms_lanman; @@ -871,8 +871,8 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i * Authenticator Response. */ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerChallenge, - const char *user, const char *secret, int secret_len, unsigned char *response, - u_char authResponse[], int authenticator) { + const char *user, const char *secret, int secret_len, unsigned char *response, + u_char authResponse[], int authenticator) { /* ARGSUSED */ LWIP_UNUSED_ARG(authenticator); #if !MPPE_SUPPORT @@ -883,24 +883,24 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh /* Generate the Peer-Challenge if requested, or copy it if supplied. */ if (!PeerChallenge) - magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); + magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); else - MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, - MS_CHAP2_PEER_CHAL_LEN); + MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, + MS_CHAP2_PEER_CHAL_LEN); /* Generate the NT-Response */ ChapMS2_NT(rchallenge, &response[MS_CHAP2_PEER_CHALLENGE], user, - secret, secret_len, &response[MS_CHAP2_NTRESP]); + secret, secret_len, &response[MS_CHAP2_NTRESP]); /* Generate the Authenticator Response. */ GenerateAuthenticatorResponsePlain(secret, secret_len, - &response[MS_CHAP2_NTRESP], - &response[MS_CHAP2_PEER_CHALLENGE], - rchallenge, user, authResponse); + &response[MS_CHAP2_NTRESP], + &response[MS_CHAP2_PEER_CHALLENGE], + rchallenge, user, authResponse); #if MPPE_SUPPORT SetMasterKeys(pcb, secret, secret_len, - &response[MS_CHAP2_NTRESP], authenticator); + &response[MS_CHAP2_NTRESP], authenticator); #endif /* MPPE_SUPPORT */ } @@ -912,51 +912,51 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh void set_mppe_enc_types(int policy, int types) { /* Early exit for unknown policies. */ if (policy != MPPE_ENC_POL_ENC_ALLOWED || - policy != MPPE_ENC_POL_ENC_REQUIRED) - return; + policy != MPPE_ENC_POL_ENC_REQUIRED) + return; /* Don't modify MPPE if it's optional and wasn't already configured. */ if (policy == MPPE_ENC_POL_ENC_ALLOWED && !ccp_wantoptions[0].mppe) - return; + return; /* * Disable undesirable encryption types. Note that we don't ENABLE * any encryption types, to avoid overriding manual configuration. */ switch(types) { - case MPPE_ENC_TYPES_RC4_40: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ - break; - case MPPE_ENC_TYPES_RC4_128: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ - break; - default: - break; + case MPPE_ENC_TYPES_RC4_40: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ + break; + case MPPE_ENC_TYPES_RC4_128: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ + break; + default: + break; } } #endif /* MPPE_SUPPORT */ #endif /* UNUSED */ const struct chap_digest_type chapms_digest = { - CHAP_MICROSOFT, /* code */ + CHAP_MICROSOFT, /* code */ #if PPP_SERVER - chapms_generate_challenge, - chapms_verify_response, + chapms_generate_challenge, + chapms_verify_response, #endif /* PPP_SERVER */ - chapms_make_response, - NULL, /* check_success */ - chapms_handle_failure, + chapms_make_response, + NULL, /* check_success */ + chapms_handle_failure, }; const struct chap_digest_type chapms2_digest = { - CHAP_MICROSOFT_V2, /* code */ + CHAP_MICROSOFT_V2, /* code */ #if PPP_SERVER - chapms2_generate_challenge, - chapms2_verify_response, + chapms2_generate_challenge, + chapms2_verify_response, #endif /* PPP_SERVER */ - chapms2_make_response, - chapms2_check_success, - chapms_handle_failure, + chapms2_make_response, + chapms2_check_success, + chapms_handle_failure, }; #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/demand.c b/components/net/lwip-2.0.2/src/netif/ppp/demand.c index f3774e087c..26c6c30db1 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/demand.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/demand.c @@ -87,11 +87,11 @@ demand_conf() /* framemax = lcp_allowoptions[0].mru; if (framemax < PPP_MRU) */ - framemax = PPP_MRU; + framemax = PPP_MRU; framemax += PPP_HDRLEN + PPP_FCSLEN; frame = malloc(framemax); if (frame == NULL) - novm("demand frame"); + novm("demand frame"); framelen = 0; pend_q = NULL; escape_flag = 0; @@ -100,8 +100,8 @@ demand_conf() netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) - fatal("Couldn't set up demand-dialled PPP interface: %m"); + || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) + fatal("Couldn't set up demand-dialled PPP interface: %m"); #ifdef PPP_FILTER set_filters(&pass_filter, &active_filter); @@ -111,12 +111,12 @@ demand_conf() * Call the demand_conf procedure for each protocol that's got one. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - ((*protp->demand_conf)(pcb)); + if (protp->demand_conf != NULL) + ((*protp->demand_conf)(pcb)); /* FIXME: find a way to die() here */ #if 0 - if (!((*protp->demand_conf)(pcb))) - die(1); + if (!((*protp->demand_conf)(pcb))) + die(1); #endif } @@ -131,8 +131,8 @@ demand_block() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); get_loop_output(); } @@ -148,14 +148,14 @@ demand_discard() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); get_loop_output(); /* discard all saved packets */ for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - free(pkt); + nextpkt = pkt->next; + free(pkt); } pend_q = NULL; framelen = 0; @@ -174,46 +174,46 @@ demand_unblock() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); } /* * FCS lookup table as calculated by genfcstab. */ static u_short fcstab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /* @@ -238,35 +238,35 @@ loop_chars(p, n) } for (; n > 0; --n) { - c = *p++; - if (c == PPP_FLAG) { - if (!escape_flag && !flush_flag - && framelen > 2 && fcs == PPP_GOODFCS) { - framelen -= 2; - if (loop_frame((unsigned char *)frame, framelen)) - rv = 1; - } - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; - continue; - } - if (flush_flag) - continue; - if (escape_flag) { - c ^= PPP_TRANS; - escape_flag = 0; - } else if (c == PPP_ESCAPE) { - escape_flag = 1; - continue; - } - if (framelen >= framemax) { - flush_flag = 1; - continue; - } - frame[framelen++] = c; - fcs = PPP_FCS(fcs, c); + c = *p++; + if (c == PPP_FLAG) { + if (!escape_flag && !flush_flag + && framelen > 2 && fcs == PPP_GOODFCS) { + framelen -= 2; + if (loop_frame((unsigned char *)frame, framelen)) + rv = 1; + } + framelen = 0; + flush_flag = 0; + escape_flag = 0; + fcs = PPP_INITFCS; + continue; + } + if (flush_flag) + continue; + if (escape_flag) { + c ^= PPP_TRANS; + escape_flag = 0; + } else if (c == PPP_ESCAPE) { + escape_flag = 1; + continue; + } + if (framelen >= framemax) { + flush_flag = 1; + continue; + } + frame[framelen++] = c; + fcs = PPP_FCS(fcs, c); } return rv; } @@ -290,22 +290,22 @@ loop_frame(frame, len) /* dbglog("from loop: %P", frame, len); */ if (len < PPP_HDRLEN) - return 0; + return 0; if ((PPP_PROTOCOL(frame) & 0x8000) != 0) - return 0; /* shouldn't get any of these anyway */ + return 0; /* shouldn't get any of these anyway */ if (!active_packet(frame, len)) - return 0; + return 0; pkt = (struct packet *) malloc(sizeof(struct packet) + len); if (pkt != NULL) { - pkt->length = len; - pkt->next = NULL; - memcpy(pkt->data, frame, len); - if (pend_q == NULL) - pend_q = pkt; - else - pend_qtail->next = pkt; - pend_qtail = pkt; + pkt->length = len; + pkt->next = NULL; + memcpy(pkt->data, frame, len); + if (pend_q == NULL) + pend_q = pkt; + else + pend_qtail->next = pkt; + pend_qtail = pkt; } return 1; } @@ -332,23 +332,23 @@ demand_rexmit(proto, newip) pend_q = NULL; tv.tv_sec = 1; tv.tv_usec = 0; - select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ + select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ for (; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - if (PPP_PROTOCOL(pkt->data) == proto) { + nextpkt = pkt->next; + if (PPP_PROTOCOL(pkt->data) == proto) { if ( (proto == PPP_IP) && newip ) { - /* Get old checksum */ + /* Get old checksum */ - iphdr = (pkt->data[4] & 15) << 2; - checksum = *((unsigned short *) (pkt->data+14)); + iphdr = (pkt->data[4] & 15) << 2; + checksum = *((unsigned short *) (pkt->data+14)); if (checksum == 0xFFFF) { checksum = 0; } - + if (pkt->data[13] == 17) { pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr)); - if (pkt_checksum) { + if (pkt_checksum) { cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; @@ -359,71 +359,71 @@ demand_rexmit(proto, newip) } } - if (pkt->data[13] == 6) { - pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); - cv = 1; + if (pkt->data[13] == 6) { + pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); + cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; } - } + } - /* Delete old Source-IP-Address */ + /* Delete old Source-IP-Address */ checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Change Source-IP-Address */ + /* Change Source-IP-Address */ * ((u32_t *) (pkt->data + 16)) = newip; - /* Add new Source-IP-Address */ + /* Add new Source-IP-Address */ checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Write new checksum */ + /* Write new checksum */ if (!checksum) { checksum = 0xFFFF; } *((unsigned short *) (pkt->data+14)) = checksum; - if (pkt->data[13] == 6) { - *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; - } - if (cv && (pkt->data[13] == 17) ) { - *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; - } - - /* Log Packet */ - strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); - if (pkt->data[13] == 1) { - syslog(LOG_INFO,"Open ICMP %s -> %s\n", - ipstr, - inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); - } else { - syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", - pkt->data[13] == 6 ? "TCP" : "UDP", - ipstr, - ntohs(*( (short *) (pkt->data+iphdr+4))), - inet_ntoa(*( (struct in_addr *) (pkt->data+20))), - ntohs(*( (short *) (pkt->data+iphdr+6)))); + if (pkt->data[13] == 6) { + *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; + } + if (cv && (pkt->data[13] == 17) ) { + *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; + } + + /* Log Packet */ + strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); + if (pkt->data[13] == 1) { + syslog(LOG_INFO,"Open ICMP %s -> %s\n", + ipstr, + inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); + } else { + syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", + pkt->data[13] == 6 ? "TCP" : "UDP", + ipstr, + ntohs(*( (short *) (pkt->data+iphdr+4))), + inet_ntoa(*( (struct in_addr *) (pkt->data+20))), + ntohs(*( (short *) (pkt->data+iphdr+6)))); } } - output(pcb, pkt->data, pkt->length); - free(pkt); - } else { - if (prev == NULL) - pend_q = pkt; - else - prev->next = pkt; - prev = pkt; - } + output(pcb, pkt->data, pkt->length); + free(pkt); + } else { + if (prev == NULL) + pend_q = pkt; + else + prev->next = pkt; + prev = pkt; + } } pend_qtail = prev; if (prev != NULL) - prev->next = NULL; + prev->next = NULL; } /* @@ -439,27 +439,27 @@ active_packet(p, len) const struct protent *protp; if (len < PPP_HDRLEN) - return 0; + return 0; proto = PPP_PROTOCOL(p); #ifdef PPP_FILTER - p[0] = 1; /* outbound packet indicator */ + p[0] = 1; /* outbound packet indicator */ if ((pass_filter.bf_len != 0 - && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) - || (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { - p[0] = 0xff; - return 0; + && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) + || (active_filter.bf_len != 0 + && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { + p[0] = 0xff; + return 0; } p[0] = 0xff; #endif for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (protp->active_pkt == NULL) - return 1; - return (*protp->active_pkt)(p, len); - } + if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { + if (protp->active_pkt == NULL) + return 1; + return (*protp->active_pkt)(p, len); + } } - return 0; /* not a supported protocol !!?? */ + return 0; /* not a supported protocol !!?? */ } #endif /* PPP_SUPPORT && DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/eap.c b/components/net/lwip-2.0.2/src/netif/ppp/eap.c index 8ca53d2a0d..8fb56368e7 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/eap.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/eap.c @@ -58,11 +58,11 @@ #endif /* USE_SRP */ #ifndef SHA_DIGESTSIZE -#define SHA_DIGESTSIZE 20 +#define SHA_DIGESTSIZE 20 #endif #ifdef USE_SRP -static char *pn_secret = NULL; /* Pseudonym generating secret */ +static char *pn_secret = NULL; /* Pseudonym generating secret */ #endif #if PPP_OPTIONS @@ -106,31 +106,31 @@ static int eap_printpkt(const u_char *inp, int inlen, #endif /* PRINTPKT_SUPPORT */ const struct protent eap_protent = { - PPP_EAP, /* protocol number */ - eap_init, /* initialization procedure */ - eap_input, /* process a received packet */ - eap_protrej, /* process a received protocol-reject */ - eap_lowerup, /* lower layer has gone up */ - eap_lowerdown, /* lower layer has gone down */ - NULL, /* open the protocol */ - NULL, /* close the protocol */ + PPP_EAP, /* protocol number */ + eap_init, /* initialization procedure */ + eap_input, /* process a received packet */ + eap_protrej, /* process a received protocol-reject */ + eap_lowerup, /* lower layer has gone up */ + eap_lowerdown, /* lower layer has gone down */ + NULL, /* open the protocol */ + NULL, /* close the protocol */ #if PRINTPKT_SUPPORT - eap_printpkt, /* print a packet in readable form */ + eap_printpkt, /* print a packet in readable form */ #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* process a received data packet */ + NULL, /* process a received data packet */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "EAP", /* text name of protocol */ - NULL, /* text name of corresponding data protocol */ + "EAP", /* text name of protocol */ + NULL, /* text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - eap_option_list, /* list of command-line options */ - NULL, /* check requested options; assign defaults */ + eap_option_list, /* list of command-line options */ + NULL, /* check requested options; assign defaults */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, /* configure interface for demand-dial */ - NULL /* say whether to bring up link for this pkt */ + NULL, /* configure interface for demand-dial */ + NULL /* say whether to bring up link for this pkt */ #endif /* DEMAND_SUPPORT */ }; @@ -139,38 +139,38 @@ const struct protent eap_protent = { * A well-known 2048 bit modulus. */ static const u_char wkmodulus[] = { - 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, - 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, - 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, - 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, - 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, - 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, - 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, - 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, - 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, - 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, - 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, - 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, - 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, - 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, - 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, - 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, - 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, - 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, - 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, - 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, - 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, - 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, - 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, - 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, - 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, - 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, - 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, - 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, - 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, - 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, - 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, - 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 + 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, + 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, + 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, + 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, + 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, + 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, + 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, + 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, + 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, + 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, + 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, + 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, + 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, + 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, + 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, + 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, + 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, + 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, + 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, + 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, + 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, + 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, + 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, + 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, + 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, + 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, + 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, + 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, + 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, + 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, + 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, + 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 }; #endif @@ -184,9 +184,9 @@ static void eap_server_timeout(void *arg); */ static const char * eap_state_name(enum eap_state_code esc) { - static const char *state_names[] = { EAP_STATES }; + static const char *state_names[] = { EAP_STATES }; - return (state_names[(int)esc]); + return (state_names[(int)esc]); } /* @@ -195,9 +195,9 @@ static const char * eap_state_name(enum eap_state_code esc) */ static void eap_init(ppp_pcb *pcb) { - BZERO(&pcb->eap, sizeof(eap_state)); + BZERO(&pcb->eap, sizeof(eap_state)); #if PPP_SERVER - pcb->eap.es_server.ea_id = magic(); + pcb->eap.es_server.ea_id = magic(); #endif /* PPP_SERVER */ } @@ -206,14 +206,14 @@ static void eap_init(ppp_pcb *pcb) { * Request messages. */ static void eap_client_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_client_active(pcb)) - return; + if (!eap_client_active(pcb)) + return; - ppp_error("EAP: timeout waiting for Request from peer"); - auth_withpeer_fail(pcb, PPP_EAP); - pcb->eap.es_client.ea_state = eapBadAuth; + ppp_error("EAP: timeout waiting for Request from peer"); + auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; } /* @@ -224,22 +224,22 @@ static void eap_client_timeout(void *arg) { */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { - if(NULL == localname) - return; + if(NULL == localname) + return; - /* Save the peer name we're given */ - pcb->eap.es_client.ea_name = localname; - pcb->eap.es_client.ea_namelen = strlen(localname); + /* Save the peer name we're given */ + pcb->eap.es_client.ea_name = localname; + pcb->eap.es_client.ea_namelen = strlen(localname); - pcb->eap.es_client.ea_state = eapListen; + pcb->eap.es_client.ea_state = eapListen; - /* - * Start a timer so that if the other end just goes - * silent, we don't sit here waiting forever. - */ - if (pcb->settings.eap_req_time > 0) - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); + /* + * Start a timer so that if the other end just goes + * silent, we don't sit here waiting forever. + */ + if (pcb->settings.eap_req_time > 0) + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); } #if PPP_SERVER @@ -248,30 +248,30 @@ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { * (Server operation) */ static void eap_send_failure(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; + struct pbuf *p; + u_char *outp; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } - outp = (u_char*)p->payload; + outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_EAP); + MAKEHEADER(outp, PPP_EAP); - PUTCHAR(EAP_FAILURE, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); + PUTCHAR(EAP_FAILURE, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); - ppp_write(pcb, p); + ppp_write(pcb, p); - pcb->eap.es_server.ea_state = eapBadAuth; - auth_peer_fail(pcb, PPP_EAP); + pcb->eap.es_server.ea_state = eapBadAuth; + auth_peer_fail(pcb, PPP_EAP); } /* @@ -279,30 +279,30 @@ static void eap_send_failure(ppp_pcb *pcb) { * (Server operation) */ static void eap_send_success(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_SUCCESS, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); - - ppp_write(pcb, p); - - auth_peer_success(pcb, PPP_EAP, 0, - pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); + struct pbuf *p; + u_char *outp; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_SUCCESS, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); + + ppp_write(pcb, p); + + auth_peer_success(pcb, PPP_EAP, 0, + pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); } #endif /* PPP_SERVER */ @@ -314,31 +314,31 @@ static void eap_send_success(ppp_pcb *pcb) { static bool pncrypt_setkey(int timeoffs) { - struct tm *tp; - char tbuf[9]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - time_t reftime; - - if (pn_secret == NULL) - return (0); - reftime = time(NULL) + timeoffs; - tp = localtime(&reftime); - SHA1Init(&ctxt); - SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); - strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); - SHA1Update(&ctxt, tbuf, strlen(tbuf)); - SHA1Final(dig, &ctxt); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - return (DesSetkey(dig)); + struct tm *tp; + char tbuf[9]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + time_t reftime; + + if (pn_secret == NULL) + return (0); + reftime = time(NULL) + timeoffs; + tp = localtime(&reftime); + SHA1Init(&ctxt); + SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); + strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); + SHA1Update(&ctxt, tbuf, strlen(tbuf)); + SHA1Final(dig, &ctxt); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + return (DesSetkey(dig)); } static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; struct b64state { - u32_t bs_bits; - int bs_offs; + u32_t bs_bits; + int bs_offs; }; static int @@ -348,23 +348,23 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - - while (inlen > 0) { - bs->bs_bits = (bs->bs_bits << 8) | *inp++; - inlen--; - bs->bs_offs += 8; - if (bs->bs_offs >= 24) { - *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; - *outp++ = base64[bs->bs_bits & 0x3F]; - outlen += 4; - bs->bs_offs = 0; - bs->bs_bits = 0; - } - } - return (outlen); + int outlen = 0; + + while (inlen > 0) { + bs->bs_bits = (bs->bs_bits << 8) | *inp++; + inlen--; + bs->bs_offs += 8; + if (bs->bs_offs >= 24) { + *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; + *outp++ = base64[bs->bs_bits & 0x3F]; + outlen += 4; + bs->bs_offs = 0; + bs->bs_bits = 0; + } + } + return (outlen); } static int @@ -372,21 +372,21 @@ b64flush(bs, outp) struct b64state *bs; u_char *outp; { - int outlen = 0; - - if (bs->bs_offs == 8) { - *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; - outlen = 2; - } else if (bs->bs_offs == 16) { - *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; - outlen = 3; - } - bs->bs_offs = 0; - bs->bs_bits = 0; - return (outlen); + int outlen = 0; + + if (bs->bs_offs == 8) { + *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; + outlen = 2; + } else if (bs->bs_offs == 16) { + *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; + outlen = 3; + } + bs->bs_offs = 0; + bs->bs_bits = 0; + return (outlen); } static int @@ -396,22 +396,22 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - char *cp; - - while (inlen > 0) { - if ((cp = strchr(base64, *inp++)) == NULL) - break; - bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); - inlen--; - bs->bs_offs += 6; - if (bs->bs_offs >= 8) { - *outp++ = bs->bs_bits >> (bs->bs_offs - 8); - outlen++; - bs->bs_offs -= 8; - } - } - return (outlen); + int outlen = 0; + char *cp; + + while (inlen > 0) { + if ((cp = strchr(base64, *inp++)) == NULL) + break; + bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); + inlen--; + bs->bs_offs += 6; + if (bs->bs_offs >= 8) { + *outp++ = bs->bs_bits >> (bs->bs_offs - 8); + outlen++; + bs->bs_offs -= 8; + } + } + return (outlen); } #endif /* USE_SRP */ @@ -424,211 +424,211 @@ u_char *outp; */ static void eap_figure_next_state(ppp_pcb *pcb, int status) { #ifdef USE_SRP - unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; - struct t_pw tpw; - struct t_confent *tce, mytce; - char *cp, *cp2; - struct t_server *ts; - int id, i, plen, toffs; - u_char vals[2]; - struct b64state bs; + unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; + struct t_pw tpw; + struct t_confent *tce, mytce; + char *cp, *cp2; + struct t_server *ts; + int id, i, plen, toffs; + u_char vals[2]; + struct b64state bs; #endif /* USE_SRP */ - pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; - switch (pcb->eap.es_server.ea_state) { - case eapBadAuth: - return; + pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; + switch (pcb->eap.es_server.ea_state) { + case eapBadAuth: + return; - case eapIdentify: + case eapIdentify: #ifdef USE_SRP - /* Discard any previous session. */ - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + /* Discard any previous session. */ + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } #ifdef USE_SRP - /* If we've got a pseudonym, try to decode to real name. */ - if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && - strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, - SRP_PSEUDO_LEN) == 0 && - (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < - sizeof (secbuf)) { - BZERO(&bs, sizeof (bs)); - plen = b64dec(&bs, - pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, - pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, - secbuf); - toffs = 0; - for (i = 0; i < 5; i++) { - pncrypt_setkey(toffs); - toffs -= 86400; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesDecrypt(secbuf, clear)) { - ppp_dbglog("no DES here; cannot decode " - "pseudonym"); - return; - } - id = *(unsigned char *)clear; - if (id + 1 <= plen && id + 9 > plen) - break; - } - if (plen % 8 == 0 && i < 5) { - /* - * Note that this is always shorter than the - * original stored string, so there's no need - * to realloc. - */ - if ((i = plen = *(unsigned char *)clear) > 7) - i = 7; - pcb->eap.es_server.ea_peerlen = plen; - dp = (unsigned char *)pcb->eap.es_server.ea_peer; - MEMCPY(dp, clear + 1, i); - plen -= i; - dp += i; - sp = secbuf + 8; - while (plen > 0) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesDecrypt(sp, dp); - sp += 8; - dp += 8; - plen -= 8; - } - pcb->eap.es_server.ea_peer[ - pcb->eap.es_server.ea_peerlen] = '\0'; - ppp_dbglog("decoded pseudonym to \"%.*q\"", - pcb->eap.es_server.ea_peerlen, - pcb->eap.es_server.ea_peer); - } else { - ppp_dbglog("failed to decode real name"); - /* Stay in eapIdentfy state; requery */ - break; - } - } - /* Look up user in secrets database. */ - if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { - /* Set up default in case SRP entry is bad */ - pcb->eap.es_server.ea_state = eapMD5Chall; - /* Get t_confent based on index in srp-secrets */ - id = strtol((char *)secbuf, &cp, 10); - if (*cp++ != ':' || id < 0) - break; - if (id == 0) { - mytce.index = 0; - mytce.modulus.data = (u_char *)wkmodulus; - mytce.modulus.len = sizeof (wkmodulus); - mytce.generator.data = (u_char *)"\002"; - mytce.generator.len = 1; - tce = &mytce; - } else if ((tce = gettcid(id)) != NULL) { - /* - * Client will have to verify this modulus/ - * generator combination, and that will take - * a while. Lengthen the timeout here. - */ - if (pcb->settings.eap_timeout_time > 0 && - pcb->settings.eap_timeout_time < 30) - pcb->settings.eap_timeout_time = 30; - } else { - break; - } - if ((cp2 = strchr(cp, ':')) == NULL) - break; - *cp2++ = '\0'; - tpw.pebuf.name = pcb->eap.es_server.ea_peer; - tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, - cp); - tpw.pebuf.password.data = tpw.pwbuf; - tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, - cp2); - tpw.pebuf.salt.data = tpw.saltbuf; - if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) - break; - pcb->eap.es_server.ea_session = (void *)ts; - pcb->eap.es_server.ea_state = eapSRP1; - vals[0] = pcb->eap.es_server.ea_id + 1; - vals[1] = EAPT_SRP; - t_serveraddexdata(ts, vals, 2); - /* Generate B; must call before t_servergetkey() */ - t_servergenexp(ts); - break; - } + /* If we've got a pseudonym, try to decode to real name. */ + if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && + strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, + SRP_PSEUDO_LEN) == 0 && + (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < + sizeof (secbuf)) { + BZERO(&bs, sizeof (bs)); + plen = b64dec(&bs, + pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, + pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, + secbuf); + toffs = 0; + for (i = 0; i < 5; i++) { + pncrypt_setkey(toffs); + toffs -= 86400; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesDecrypt(secbuf, clear)) { + ppp_dbglog("no DES here; cannot decode " + "pseudonym"); + return; + } + id = *(unsigned char *)clear; + if (id + 1 <= plen && id + 9 > plen) + break; + } + if (plen % 8 == 0 && i < 5) { + /* + * Note that this is always shorter than the + * original stored string, so there's no need + * to realloc. + */ + if ((i = plen = *(unsigned char *)clear) > 7) + i = 7; + pcb->eap.es_server.ea_peerlen = plen; + dp = (unsigned char *)pcb->eap.es_server.ea_peer; + MEMCPY(dp, clear + 1, i); + plen -= i; + dp += i; + sp = secbuf + 8; + while (plen > 0) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesDecrypt(sp, dp); + sp += 8; + dp += 8; + plen -= 8; + } + pcb->eap.es_server.ea_peer[ + pcb->eap.es_server.ea_peerlen] = '\0'; + ppp_dbglog("decoded pseudonym to \"%.*q\"", + pcb->eap.es_server.ea_peerlen, + pcb->eap.es_server.ea_peer); + } else { + ppp_dbglog("failed to decode real name"); + /* Stay in eapIdentfy state; requery */ + break; + } + } + /* Look up user in secrets database. */ + if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { + /* Set up default in case SRP entry is bad */ + pcb->eap.es_server.ea_state = eapMD5Chall; + /* Get t_confent based on index in srp-secrets */ + id = strtol((char *)secbuf, &cp, 10); + if (*cp++ != ':' || id < 0) + break; + if (id == 0) { + mytce.index = 0; + mytce.modulus.data = (u_char *)wkmodulus; + mytce.modulus.len = sizeof (wkmodulus); + mytce.generator.data = (u_char *)"\002"; + mytce.generator.len = 1; + tce = &mytce; + } else if ((tce = gettcid(id)) != NULL) { + /* + * Client will have to verify this modulus/ + * generator combination, and that will take + * a while. Lengthen the timeout here. + */ + if (pcb->settings.eap_timeout_time > 0 && + pcb->settings.eap_timeout_time < 30) + pcb->settings.eap_timeout_time = 30; + } else { + break; + } + if ((cp2 = strchr(cp, ':')) == NULL) + break; + *cp2++ = '\0'; + tpw.pebuf.name = pcb->eap.es_server.ea_peer; + tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, + cp); + tpw.pebuf.password.data = tpw.pwbuf; + tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, + cp2); + tpw.pebuf.salt.data = tpw.saltbuf; + if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) + break; + pcb->eap.es_server.ea_session = (void *)ts; + pcb->eap.es_server.ea_state = eapSRP1; + vals[0] = pcb->eap.es_server.ea_id + 1; + vals[1] = EAPT_SRP; + t_serveraddexdata(ts, vals, 2); + /* Generate B; must call before t_servergetkey() */ + t_servergenexp(ts); + break; + } #endif /* USE_SRP */ - pcb->eap.es_server.ea_state = eapMD5Chall; - break; + pcb->eap.es_server.ea_state = eapMD5Chall; + break; - case eapSRP1: + case eapSRP1: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status == 1) { - pcb->eap.es_server.ea_state = eapMD5Chall; - } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP2; - } - break; - - case eapSRP2: + if (status == 1) { + pcb->eap.es_server.ea_state = eapMD5Chall; + } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP2; + } + break; + + case eapSRP2: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP3; - } - break; - - case eapSRP3: - case eapSRP4: + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP3; + } + break; + + case eapSRP3: + case eapSRP4: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - case eapMD5Chall: - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - default: - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } - if (pcb->eap.es_server.ea_state == eapBadAuth) - eap_send_failure(pcb); + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + case eapMD5Chall: + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + default: + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } + if (pcb->eap.es_server.ea_state == eapBadAuth) + eap_send_failure(pcb); } /* @@ -636,235 +636,235 @@ static void eap_figure_next_state(ppp_pcb *pcb, int status) { * type depends on current state. (Server operation) */ static void eap_send_request(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - u_char *lenloc; - int outlen; - int len; - const char *str; + struct pbuf *p; + u_char *outp; + u_char *lenloc; + int outlen; + int len; + const char *str; #ifdef USE_SRP - struct t_server *ts; - u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; - int i, j; - struct b64state b64; - SHA1_CTX ctxt; + struct t_server *ts; + u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; + int i, j; + struct b64state b64; + SHA1_CTX ctxt; #endif /* USE_SRP */ - /* Handle both initial auth and restart */ - if (pcb->eap.es_server.ea_state < eapIdentify && - pcb->eap.es_server.ea_state != eapInitial) { - pcb->eap.es_server.ea_state = eapIdentify; + /* Handle both initial auth and restart */ + if (pcb->eap.es_server.ea_state < eapIdentify && + pcb->eap.es_server.ea_state != eapInitial) { + pcb->eap.es_server.ea_state = eapIdentify; #if PPP_REMOTENAME - if (pcb->settings.explicit_remote && pcb->remote_name) { - /* - * If we already know the peer's - * unauthenticated name, then there's no - * reason to ask. Go to next state instead. - */ - int len = (int)strlen(pcb->remote_name); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - } + if (pcb->settings.explicit_remote && pcb->remote_name) { + /* + * If we already know the peer's + * unauthenticated name, then there's no + * reason to ask. Go to next state instead. + */ + int len = (int)strlen(pcb->remote_name); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + } #endif /* PPP_REMOTENAME */ - } - - if (pcb->settings.eap_max_transmits > 0 && - pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { - if (pcb->eap.es_server.ea_responses > 0) - ppp_error("EAP: too many Requests sent"); - else - ppp_error("EAP: no response to Requests"); - eap_send_failure(pcb); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_REQUEST, outp); - PUTCHAR(pcb->eap.es_server.ea_id, outp); - lenloc = outp; - INCPTR(2, outp); - - switch (pcb->eap.es_server.ea_state) { - case eapIdentify: - PUTCHAR(EAPT_IDENTITY, outp); - str = "Name"; - len = strlen(str); - MEMCPY(outp, str, len); - INCPTR(len, outp); - break; - - case eapMD5Chall: - PUTCHAR(EAPT_MD5CHAP, outp); - /* - * pick a random challenge length between - * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH - */ - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - PUTCHAR(pcb->eap.es_challen, outp); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - break; + } + + if (pcb->settings.eap_max_transmits > 0 && + pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { + if (pcb->eap.es_server.ea_responses > 0) + ppp_error("EAP: too many Requests sent"); + else + ppp_error("EAP: no response to Requests"); + eap_send_failure(pcb); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_REQUEST, outp); + PUTCHAR(pcb->eap.es_server.ea_id, outp); + lenloc = outp; + INCPTR(2, outp); + + switch (pcb->eap.es_server.ea_state) { + case eapIdentify: + PUTCHAR(EAPT_IDENTITY, outp); + str = "Name"; + len = strlen(str); + MEMCPY(outp, str, len); + INCPTR(len, outp); + break; + + case eapMD5Chall: + PUTCHAR(EAPT_MD5CHAP, outp); + /* + * pick a random challenge length between + * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH + */ + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + PUTCHAR(pcb->eap.es_challen, outp); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + break; #ifdef USE_SRP - case eapSRP1: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CHALLENGE, outp); - - PUTCHAR(pcb->eap.es_server.ea_namelen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - PUTCHAR(ts->s.len, outp); - MEMCPY(outp, ts->s.data, ts->s.len); - INCPTR(ts->s.len, outp); - - if (ts->g.len == 1 && ts->g.data[0] == 2) { - PUTCHAR(0, outp); - } else { - PUTCHAR(ts->g.len, outp); - MEMCPY(outp, ts->g.data, ts->g.len); - INCPTR(ts->g.len, outp); - } - - if (ts->n.len != sizeof (wkmodulus) || - BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { - MEMCPY(outp, ts->n.data, ts->n.len); - INCPTR(ts->n.len, outp); - } - break; - - case eapSRP2: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SKEY, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, ts->B.data, ts->B.len); - INCPTR(ts->B.len, outp); - break; - - case eapSRP3: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SVALIDATOR, outp); - PUTLONG(SRPVAL_EBIT, outp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); - INCPTR(SHA_DIGESTSIZE, outp); - - if (pncrypt_setkey(0)) { - /* Generate pseudonym */ - optr = outp; - cp = (unsigned char *)pcb->eap.es_server.ea_peer; - if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) - j = 7; - clear[0] = i; - MEMCPY(clear + 1, cp, j); - i -= j; - cp += j; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesEncrypt(clear, cipher)) { - ppp_dbglog("no DES here; not generating pseudonym"); - break; - } - BZERO(&b64, sizeof (b64)); - outp++; /* space for pseudonym length */ - outp += b64enc(&b64, cipher, 8, outp); - while (i >= 8) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(cp, cipher); - outp += b64enc(&b64, cipher, 8, outp); - cp += 8; - i -= 8; - } - if (i > 0) { - MEMCPY(clear, cp, i); - cp += i; - magic_random_bytes(cp, 8-i); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(clear, cipher); - outp += b64enc(&b64, cipher, 8, outp); - } - outp += b64flush(&b64, outp); - - /* Set length and pad out to next 20 octet boundary */ - i = outp - optr - 1; - *optr = i; - i %= SHA_DIGESTSIZE; - if (i != 0) { - magic_random_bytes(outp, SHA_DIGESTSIZE-i); - INCPTR(SHA_DIGESTSIZE-i, outp); - } - - /* Obscure the pseudonym with SHA1 hash */ - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - while (optr < outp) { - SHA1Final(dig, &ctxt); - cp = dig; - while (cp < dig + SHA_DIGESTSIZE) - *optr++ ^= *cp++; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, - SHA_DIGESTSIZE); - } - } - break; - - case eapSRP4: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_LWRECHALLENGE, outp); - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - break; + case eapSRP1: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CHALLENGE, outp); + + PUTCHAR(pcb->eap.es_server.ea_namelen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + PUTCHAR(ts->s.len, outp); + MEMCPY(outp, ts->s.data, ts->s.len); + INCPTR(ts->s.len, outp); + + if (ts->g.len == 1 && ts->g.data[0] == 2) { + PUTCHAR(0, outp); + } else { + PUTCHAR(ts->g.len, outp); + MEMCPY(outp, ts->g.data, ts->g.len); + INCPTR(ts->g.len, outp); + } + + if (ts->n.len != sizeof (wkmodulus) || + BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { + MEMCPY(outp, ts->n.data, ts->n.len); + INCPTR(ts->n.len, outp); + } + break; + + case eapSRP2: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SKEY, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, ts->B.data, ts->B.len); + INCPTR(ts->B.len, outp); + break; + + case eapSRP3: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SVALIDATOR, outp); + PUTLONG(SRPVAL_EBIT, outp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); + INCPTR(SHA_DIGESTSIZE, outp); + + if (pncrypt_setkey(0)) { + /* Generate pseudonym */ + optr = outp; + cp = (unsigned char *)pcb->eap.es_server.ea_peer; + if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) + j = 7; + clear[0] = i; + MEMCPY(clear + 1, cp, j); + i -= j; + cp += j; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesEncrypt(clear, cipher)) { + ppp_dbglog("no DES here; not generating pseudonym"); + break; + } + BZERO(&b64, sizeof (b64)); + outp++; /* space for pseudonym length */ + outp += b64enc(&b64, cipher, 8, outp); + while (i >= 8) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(cp, cipher); + outp += b64enc(&b64, cipher, 8, outp); + cp += 8; + i -= 8; + } + if (i > 0) { + MEMCPY(clear, cp, i); + cp += i; + magic_random_bytes(cp, 8-i); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(clear, cipher); + outp += b64enc(&b64, cipher, 8, outp); + } + outp += b64flush(&b64, outp); + + /* Set length and pad out to next 20 octet boundary */ + i = outp - optr - 1; + *optr = i; + i %= SHA_DIGESTSIZE; + if (i != 0) { + magic_random_bytes(outp, SHA_DIGESTSIZE-i); + INCPTR(SHA_DIGESTSIZE-i, outp); + } + + /* Obscure the pseudonym with SHA1 hash */ + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + while (optr < outp) { + SHA1Final(dig, &ctxt); + cp = dig; + while (cp < dig + SHA_DIGESTSIZE) + *optr++ ^= *cp++; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, + SHA_DIGESTSIZE); + } + } + break; + + case eapSRP4: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_LWRECHALLENGE, outp); + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + break; #endif /* USE_SRP */ - default: - return; - } + default: + return; + } - outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; - PUTSHORT(outlen, lenloc); + outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; + PUTSHORT(outlen, lenloc); - pbuf_realloc(p, outlen + PPP_HDRLEN); - ppp_write(pcb, p); + pbuf_realloc(p, outlen + PPP_HDRLEN); + ppp_write(pcb, p); - pcb->eap.es_server.ea_requests++; + pcb->eap.es_server.ea_requests++; - if (pcb->settings.eap_timeout_time > 0) - TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); + if (pcb->settings.eap_timeout_time > 0) + TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); } /* @@ -875,23 +875,23 @@ static void eap_send_request(ppp_pcb *pcb) { */ void eap_authpeer(ppp_pcb *pcb, const char *localname) { - /* Save the name we're given. */ - pcb->eap.es_server.ea_name = localname; - pcb->eap.es_server.ea_namelen = strlen(localname); + /* Save the name we're given. */ + pcb->eap.es_server.ea_name = localname; + pcb->eap.es_server.ea_namelen = strlen(localname); - pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; + pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; - /* Lower layer up yet? */ - if (pcb->eap.es_server.ea_state == eapInitial || - pcb->eap.es_server.ea_state == eapPending) { - pcb->eap.es_server.ea_state = eapPending; - return; - } + /* Lower layer up yet? */ + if (pcb->eap.es_server.ea_state == eapInitial || + pcb->eap.es_server.ea_state == eapPending) { + pcb->eap.es_server.ea_state = eapPending; + return; + } - pcb->eap.es_server.ea_state = eapPending; + pcb->eap.es_server.ea_state = eapPending; - /* ID number not updated here intentionally; hashed into M1 */ - eap_send_request(pcb); + /* ID number not updated here intentionally; hashed into M1 */ + eap_send_request(pcb); } /* @@ -899,13 +899,13 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname) { * expired. */ static void eap_server_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_server_active(pcb)) - return; + if (!eap_server_active(pcb)) + return; - /* EAP ID number must not change on timeout. */ - eap_send_request(pcb); + /* EAP ID number must not change on timeout. */ + eap_send_request(pcb); } /* @@ -914,30 +914,30 @@ static void eap_server_timeout(void *arg) { * will restart the timer. If it fails, then the link is dropped. */ static void eap_rechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen && - pcb->eap.es_server.ea_state != eapSRP4) - return; + if (pcb->eap.es_server.ea_state != eapOpen && + pcb->eap.es_server.ea_state != eapSRP4) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } static void srp_lwrechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen || - pcb->eap.es_server.ea_type != EAPT_SRP) - return; + if (pcb->eap.es_server.ea_state != eapOpen || + pcb->eap.es_server.ea_type != EAPT_SRP) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapSRP4; - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapSRP4; + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } #endif /* PPP_SERVER */ @@ -950,9 +950,9 @@ static void srp_lwrechallenge(void *arg) { * thing. */ static void eap_lowerup(ppp_pcb *pcb) { - pcb->eap.es_client.ea_state = eapClosed; + pcb->eap.es_client.ea_state = eapClosed; #if PPP_SERVER - pcb->eap.es_server.ea_state = eapClosed; + pcb->eap.es_server.ea_state = eapClosed; #endif /* PPP_SERVER */ } @@ -963,28 +963,28 @@ static void eap_lowerup(ppp_pcb *pcb) { */ static void eap_lowerdown(ppp_pcb *pcb) { - if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - } else { - if ((pcb->eap.es_server.ea_state == eapOpen || - pcb->eap.es_server.ea_state == eapSRP4) && - pcb->eap.es_rechallenge > 0) { - UNTIMEOUT(eap_rechallenge, (void *)pcb); - } - if (pcb->eap.es_server.ea_state == eapOpen && - pcb->eap.es_lwrechallenge > 0) { - UNTIMEOUT(srp_lwrechallenge, (void *)pcb); - } - } - - pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; - pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; + if (eap_server_active(pcb)) { + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + } else { + if ((pcb->eap.es_server.ea_state == eapOpen || + pcb->eap.es_server.ea_state == eapSRP4) && + pcb->eap.es_rechallenge > 0) { + UNTIMEOUT(eap_rechallenge, (void *)pcb); + } + if (pcb->eap.es_server.ea_state == eapOpen && + pcb->eap.es_lwrechallenge > 0) { + UNTIMEOUT(srp_lwrechallenge, (void *)pcb); + } + } + + pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; + pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; #endif /* PPP_SERVER */ } @@ -996,87 +996,87 @@ static void eap_lowerdown(ppp_pcb *pcb) { */ static void eap_protrej(ppp_pcb *pcb) { - if (eap_client_active(pcb)) { - ppp_error("EAP authentication failed due to Protocol-Reject"); - auth_withpeer_fail(pcb, PPP_EAP); - } + if (eap_client_active(pcb)) { + ppp_error("EAP authentication failed due to Protocol-Reject"); + auth_withpeer_fail(pcb, PPP_EAP); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - ppp_error("EAP authentication of peer failed on Protocol-Reject"); - auth_peer_fail(pcb, PPP_EAP); - } + if (eap_server_active(pcb)) { + ppp_error("EAP authentication of peer failed on Protocol-Reject"); + auth_peer_fail(pcb, PPP_EAP); + } #endif /* PPP_SERVER */ - eap_lowerdown(pcb); + eap_lowerdown(pcb); } /* * Format and send a regular EAP Response message. */ static void eap_send_response(ppp_pcb *pcb, u_char id, u_char typenum, const u_char *str, int lenstr) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(typenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(typenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* * Format and send an MD5-Challenge EAP Response message. */ static void eap_chap_response(ppp_pcb *pcb, u_char id, u_char *hash, const char *name, int namelen) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + - namelen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_MD5CHAP, outp); - PUTCHAR(MD5_SIGNATURE_SIZE, outp); - MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); - INCPTR(MD5_SIGNATURE_SIZE, outp); - if (namelen > 0) { - MEMCPY(outp, name, namelen); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + + namelen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_MD5CHAP, outp); + PUTCHAR(MD5_SIGNATURE_SIZE, outp); + MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); + INCPTR(MD5_SIGNATURE_SIZE, outp); + if (namelen > 0) { + MEMCPY(outp, name, namelen); + } + + ppp_write(pcb, p); } #ifdef USE_SRP @@ -1091,35 +1091,35 @@ u_char subtypenum; u_char *str; int lenstr; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(subtypenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(subtypenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* @@ -1132,118 +1132,118 @@ u_char id; u32_t flags; u_char *str; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + - SHA_DIGESTSIZE; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CVALIDATOR, outp); - PUTLONG(flags, outp); - MEMCPY(outp, str, SHA_DIGESTSIZE); - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + + SHA_DIGESTSIZE; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CVALIDATOR, outp); + PUTLONG(flags, outp); + MEMCPY(outp, str, SHA_DIGESTSIZE); + + ppp_write(pcb, p); } #endif /* USE_SRP */ static void eap_send_nak(ppp_pcb *pcb, u_char id, u_char type) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char); - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_NAK, outp); - PUTCHAR(type, outp); - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char); + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_NAK, outp); + PUTCHAR(type, outp); + + ppp_write(pcb, p); } #ifdef USE_SRP static char * name_of_pn_file() { - char *user, *path, *file; - struct passwd *pw; - size_t pl; - static bool pnlogged = 0; - - pw = getpwuid(getuid()); - if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { - errno = EINVAL; - return (NULL); - } - file = _PATH_PSEUDONYM; - pl = strlen(user) + strlen(file) + 2; - path = malloc(pl); - if (path == NULL) - return (NULL); - (void) slprintf(path, pl, "%s/%s", user, file); - if (!pnlogged) { - ppp_dbglog("pseudonym file: %s", path); - pnlogged = 1; - } - return (path); + char *user, *path, *file; + struct passwd *pw; + size_t pl; + static bool pnlogged = 0; + + pw = getpwuid(getuid()); + if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { + errno = EINVAL; + return (NULL); + } + file = _PATH_PSEUDONYM; + pl = strlen(user) + strlen(file) + 2; + path = malloc(pl); + if (path == NULL) + return (NULL); + (void) slprintf(path, pl, "%s/%s", user, file); + if (!pnlogged) { + ppp_dbglog("pseudonym file: %s", path); + pnlogged = 1; + } + return (path); } static int open_pn_file(modebits) mode_t modebits; { - char *path; - int fd, err; - - if ((path = name_of_pn_file()) == NULL) - return (-1); - fd = open(path, modebits, S_IRUSR | S_IWUSR); - err = errno; - free(path); - errno = err; - return (fd); + char *path; + int fd, err; + + if ((path = name_of_pn_file()) == NULL) + return (-1); + fd = open(path, modebits, S_IRUSR | S_IWUSR); + err = errno; + free(path); + errno = err; + return (fd); } static void remove_pn_file() { - char *path; + char *path; - if ((path = name_of_pn_file()) != NULL) { - (void) unlink(path); - (void) free(path); - } + if ((path = name_of_pn_file()) != NULL) { + (void) unlink(path); + (void) free(path); + } } static void @@ -1252,56 +1252,56 @@ eap_state *esp; u_char *inp; int len, id; { - u_char val; - u_char *datp, *digp; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int dsize, fd, olen = len; - - /* - * Do the decoding by working backwards. This eliminates the need - * to save the decoded output in a separate buffer. - */ - val = id; - while (len > 0) { - if ((dsize = len % SHA_DIGESTSIZE) == 0) - dsize = SHA_DIGESTSIZE; - len -= dsize; - datp = inp + len; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &val, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); - if (len > 0) { - SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); - } else { - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - } - SHA1Final(dig, &ctxt); - for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) - *datp++ ^= *digp; - } - - /* Now check that the result is sane */ - if (olen <= 0 || *inp + 1 > olen) { - ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); - return; - } - - /* Save it away */ - fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); - if (fd < 0) { - ppp_dbglog("EAP: error saving pseudonym: %m"); - return; - } - len = write(fd, inp + 1, *inp); - if (close(fd) != -1 && len == *inp) { - ppp_dbglog("EAP: saved pseudonym"); - pcb->eap.es_usedpseudo = 0; - } else { - ppp_dbglog("EAP: failed to save pseudonym"); - remove_pn_file(); - } + u_char val; + u_char *datp, *digp; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int dsize, fd, olen = len; + + /* + * Do the decoding by working backwards. This eliminates the need + * to save the decoded output in a separate buffer. + */ + val = id; + while (len > 0) { + if ((dsize = len % SHA_DIGESTSIZE) == 0) + dsize = SHA_DIGESTSIZE; + len -= dsize; + datp = inp + len; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &val, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); + if (len > 0) { + SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); + } else { + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + } + SHA1Final(dig, &ctxt); + for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) + *datp++ ^= *digp; + } + + /* Now check that the result is sane */ + if (olen <= 0 || *inp + 1 > olen) { + ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); + return; + } + + /* Save it away */ + fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); + if (fd < 0) { + ppp_dbglog("EAP: error saving pseudonym: %m"); + return; + } + len = write(fd, inp + 1, *inp); + if (close(fd) != -1 && len == *inp) { + ppp_dbglog("EAP: saved pseudonym"); + pcb->eap.es_usedpseudo = 0; + } else { + ppp_dbglog("EAP: failed to save pseudonym"); + remove_pn_file(); + } } #endif /* USE_SRP */ @@ -1309,412 +1309,412 @@ int len, id; * eap_request - Receive EAP Request message (client mode). */ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_client *tc; - struct t_num sval, gval, Nval, *Ap, Bval; - u_char vals[2]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int fd; + struct t_client *tc; + struct t_num sval, gval, Nval, *Ap, Bval; + u_char vals[2]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int fd; #endif /* USE_SRP */ - /* - * Note: we update es_client.ea_id *only if* a Response - * message is being generated. Otherwise, we leave it the - * same for duplicate detection purposes. - */ - - pcb->eap.es_client.ea_requests++; - if (pcb->settings.eap_allow_req != 0 && - pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { - ppp_info("EAP: received too many Request messages"); - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - auth_withpeer_fail(pcb, PPP_EAP); - return; - } - - if (len <= 0) { - ppp_error("EAP: empty Request message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (len > 0) - ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); + /* + * Note: we update es_client.ea_id *only if* a Response + * message is being generated. Otherwise, we leave it the + * same for duplicate detection purposes. + */ + + pcb->eap.es_client.ea_requests++; + if (pcb->settings.eap_allow_req != 0 && + pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { + ppp_info("EAP: received too many Request messages"); + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + auth_withpeer_fail(pcb, PPP_EAP); + return; + } + + if (len <= 0) { + ppp_error("EAP: empty Request message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (len > 0) + ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); #ifdef USE_SRP - if (pcb->eap.es_usepseudo && - (pcb->eap.es_usedpseudo == 0 || - (pcb->eap.es_usedpseudo == 1 && - id == pcb->eap.es_client.ea_id))) { - pcb->eap.es_usedpseudo = 1; - /* Try to get a pseudonym */ - if ((fd = open_pn_file(O_RDONLY)) >= 0) { - strcpy(rhostname, SRP_PSEUDO_ID); - len = read(fd, rhostname + SRP_PSEUDO_LEN, - sizeof (rhostname) - SRP_PSEUDO_LEN); - /* XXX NAI unsupported */ - if (len > 0) { - eap_send_response(pcb, id, typenum, - rhostname, len + SRP_PSEUDO_LEN); - } - (void) close(fd); - if (len > 0) - break; - } - } - /* Stop using pseudonym now. */ - if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { - remove_pn_file(); - pcb->eap.es_usedpseudo = 2; - } + if (pcb->eap.es_usepseudo && + (pcb->eap.es_usedpseudo == 0 || + (pcb->eap.es_usedpseudo == 1 && + id == pcb->eap.es_client.ea_id))) { + pcb->eap.es_usedpseudo = 1; + /* Try to get a pseudonym */ + if ((fd = open_pn_file(O_RDONLY)) >= 0) { + strcpy(rhostname, SRP_PSEUDO_ID); + len = read(fd, rhostname + SRP_PSEUDO_LEN, + sizeof (rhostname) - SRP_PSEUDO_LEN); + /* XXX NAI unsupported */ + if (len > 0) { + eap_send_response(pcb, id, typenum, + rhostname, len + SRP_PSEUDO_LEN); + } + (void) close(fd); + if (len > 0) + break; + } + } + /* Stop using pseudonym now. */ + if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { + remove_pn_file(); + pcb->eap.es_usedpseudo = 2; + } #endif /* USE_SRP */ - eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; - - case EAPT_NOTIFICATION: - if (len > 0) - ppp_info("EAP: Notification \"%.*q\"", len, inp); - eap_send_response(pcb, id, typenum, NULL, 0); - break; - - case EAPT_NAK: - /* - * Avoid the temptation to send Response Nak in reply - * to Request Nak here. It can only lead to trouble. - */ - ppp_warn("EAP: unexpected Nak in Request; ignored"); - /* Return because we're waiting for something real. */ - return; - - case EAPT_MD5CHAP: - if (len < 1) { - ppp_error("EAP: received MD5-Challenge with no data"); - /* Bogus request; wait for something real. */ - return; - } - GETCHAR(vallen, inp); - len--; - if (vallen < 8 || vallen > len) { - ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", - vallen, len); - /* Try something better. */ - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; + + case EAPT_NOTIFICATION: + if (len > 0) + ppp_info("EAP: Notification \"%.*q\"", len, inp); + eap_send_response(pcb, id, typenum, NULL, 0); + break; + + case EAPT_NAK: + /* + * Avoid the temptation to send Response Nak in reply + * to Request Nak here. It can only lead to trouble. + */ + ppp_warn("EAP: unexpected Nak in Request; ignored"); + /* Return because we're waiting for something real. */ + return; + + case EAPT_MD5CHAP: + if (len < 1) { + ppp_error("EAP: received MD5-Challenge with no data"); + /* Bogus request; wait for something real. */ + return; + } + GETCHAR(vallen, inp); + len--; + if (vallen < 8 || vallen > len) { + ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", + vallen, len); + /* Try something better. */ + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (pcb->settings.explicit_remote || - (pcb->settings.remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (pcb->settings.explicit_remote || + (pcb->settings.remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating ourselves with - * the specified host. - */ - if (!get_secret(pcb, pcb->eap.es_client.ea_name, - rhostname, secret, &secret_len, 0)) { - ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - typenum = id; - lwip_md5_update(&mdContext, &typenum, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, inp, vallen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; + /* + * Get the secret for authenticating ourselves with + * the specified host. + */ + if (!get_secret(pcb, pcb->eap.es_client.ea_name, + rhostname, secret, &secret_len, 0)) { + ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + typenum = id; + lwip_md5_update(&mdContext, &typenum, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, inp, vallen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: received empty SRP Request"); - /* Bogus request; wait for something real. */ - return; - } - - /* Get subtype */ - GETCHAR(vallen, inp); - len--; - switch (vallen) { - case EAPSRP_CHALLENGE: - tc = NULL; - if (pcb->eap.es_client.ea_session != NULL) { - tc = (struct t_client *)pcb->eap.es_client. - ea_session; - /* - * If this is a new challenge, then start - * over with a new client session context. - * Otherwise, just resend last response. - */ - if (id != pcb->eap.es_client.ea_id) { - t_clientclose(tc); - pcb->eap.es_client.ea_session = NULL; - tc = NULL; - } - } - /* No session key just yet */ - pcb->eap.es_client.ea_skey = NULL; - if (tc == NULL) { - int rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (name)"); - /* Ignore badly-formed messages */ - return; - } - MEMCPY(rhostname, inp, vallen); - rhostname[vallen] = '\0'; - INCPTR(vallen, inp); - len -= vallen; - - /* - * In case the remote doesn't give us his name, - * use configured name. - */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == 0)) { - strlcpy(rhostname, remote_name, - sizeof (rhostname)); - } - - rhostnamelen = (int)strlen(rhostname); - if (rhostnamelen > MAXNAMELEN) { - rhostnamelen = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); - pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; - pcb->eap.es_client.ea_peerlen = rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (s)"); - /* Ignore badly-formed messages */ - return; - } - sval.data = inp; - sval.len = vallen; - INCPTR(vallen, inp); - len -= vallen; - - GETCHAR(vallen, inp); - len--; - if (vallen > len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (g)"); - /* Ignore badly-formed messages */ - return; - } - /* If no generator present, then use value 2 */ - if (vallen == 0) { - gval.data = (u_char *)"\002"; - gval.len = 1; - } else { - gval.data = inp; - gval.len = vallen; - } - INCPTR(vallen, inp); - len -= vallen; - - /* - * If no modulus present, then use well-known - * value. - */ - if (len == 0) { - Nval.data = (u_char *)wkmodulus; - Nval.len = sizeof (wkmodulus); - } else { - Nval.data = inp; - Nval.len = len; - } - tc = t_clientopen(pcb->eap.es_client.ea_name, - &Nval, &gval, &sval); - if (tc == NULL) { - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - pcb->eap.es_client.ea_session = (void *)tc; - - /* Add Challenge ID & type to verifier */ - vals[0] = id; - vals[1] = EAPT_SRP; - t_clientaddexdata(tc, vals, 2); - } - Ap = t_clientgenexp(tc); - eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, - Ap->len); - break; - - case EAPSRP_SKEY: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL) { - ppp_warn("EAP: peer sent Subtype 2 without 1"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - if (pcb->eap.es_client.ea_skey != NULL) { - /* - * ID number should not change here. Warn - * if it does (but otherwise ignore). - */ - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 2 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - if (get_srp_secret(pcb->eap.es_unit, - pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_peer, secret, 0) == 0) { - /* - * Can't work with this peer because - * the secret is missing. Just give - * up. - */ - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - Bval.data = inp; - Bval.len = len; - t_clientpasswd(tc, secret); - BZERO(secret, sizeof (secret)); - pcb->eap.es_client.ea_skey = - t_clientgetkey(tc, &Bval); - if (pcb->eap.es_client.ea_skey == NULL) { - /* Server is rogue; stop now */ - ppp_error("EAP: SRP server is rogue"); - goto client_failure; - } - } - eap_srpval_response(esp, id, SRPVAL_EBIT, - t_clientresponse(tc)); - break; - - case EAPSRP_SVALIDATOR: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { - ppp_warn("EAP: peer sent Subtype 3 without 1/2"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - /* - * If we're already open, then this ought to be a - * duplicate. Otherwise, check that the server is - * who we think it is. - */ - if (pcb->eap.es_client.ea_state == eapOpen) { - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 3 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - len -= sizeof (u32_t) + SHA_DIGESTSIZE; - if (len < 0 || t_clientverify(tc, inp + - sizeof (u32_t)) != 0) { - ppp_error("EAP: SRP server verification " - "failed"); - goto client_failure; - } - GETLONG(pcb->eap.es_client.ea_keyflags, inp); - /* Save pseudonym if user wants it. */ - if (len > 0 && pcb->eap.es_usepseudo) { - INCPTR(SHA_DIGESTSIZE, inp); - write_pseudonym(esp, inp, len, id); - } - } - /* - * We've verified our peer. We're now mostly done, - * except for waiting on the regular EAP Success - * message. - */ - eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); - break; - - case EAPSRP_LWRECHALLENGE: - if (len < 4) { - ppp_warn("EAP: malformed Lightweight rechallenge"); - return; - } - SHA1Init(&ctxt); - vals[0] = id; - SHA1Update(&ctxt, vals, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, inp, len); - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - SHA1Final(dig, &ctxt); - eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, - SHA_DIGESTSIZE); - break; - - default: - ppp_error("EAP: unknown SRP Subtype %d", vallen); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: received empty SRP Request"); + /* Bogus request; wait for something real. */ + return; + } + + /* Get subtype */ + GETCHAR(vallen, inp); + len--; + switch (vallen) { + case EAPSRP_CHALLENGE: + tc = NULL; + if (pcb->eap.es_client.ea_session != NULL) { + tc = (struct t_client *)pcb->eap.es_client. + ea_session; + /* + * If this is a new challenge, then start + * over with a new client session context. + * Otherwise, just resend last response. + */ + if (id != pcb->eap.es_client.ea_id) { + t_clientclose(tc); + pcb->eap.es_client.ea_session = NULL; + tc = NULL; + } + } + /* No session key just yet */ + pcb->eap.es_client.ea_skey = NULL; + if (tc == NULL) { + int rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (name)"); + /* Ignore badly-formed messages */ + return; + } + MEMCPY(rhostname, inp, vallen); + rhostname[vallen] = '\0'; + INCPTR(vallen, inp); + len -= vallen; + + /* + * In case the remote doesn't give us his name, + * use configured name. + */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == 0)) { + strlcpy(rhostname, remote_name, + sizeof (rhostname)); + } + + rhostnamelen = (int)strlen(rhostname); + if (rhostnamelen > MAXNAMELEN) { + rhostnamelen = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); + pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; + pcb->eap.es_client.ea_peerlen = rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (s)"); + /* Ignore badly-formed messages */ + return; + } + sval.data = inp; + sval.len = vallen; + INCPTR(vallen, inp); + len -= vallen; + + GETCHAR(vallen, inp); + len--; + if (vallen > len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (g)"); + /* Ignore badly-formed messages */ + return; + } + /* If no generator present, then use value 2 */ + if (vallen == 0) { + gval.data = (u_char *)"\002"; + gval.len = 1; + } else { + gval.data = inp; + gval.len = vallen; + } + INCPTR(vallen, inp); + len -= vallen; + + /* + * If no modulus present, then use well-known + * value. + */ + if (len == 0) { + Nval.data = (u_char *)wkmodulus; + Nval.len = sizeof (wkmodulus); + } else { + Nval.data = inp; + Nval.len = len; + } + tc = t_clientopen(pcb->eap.es_client.ea_name, + &Nval, &gval, &sval); + if (tc == NULL) { + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + pcb->eap.es_client.ea_session = (void *)tc; + + /* Add Challenge ID & type to verifier */ + vals[0] = id; + vals[1] = EAPT_SRP; + t_clientaddexdata(tc, vals, 2); + } + Ap = t_clientgenexp(tc); + eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, + Ap->len); + break; + + case EAPSRP_SKEY: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL) { + ppp_warn("EAP: peer sent Subtype 2 without 1"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + if (pcb->eap.es_client.ea_skey != NULL) { + /* + * ID number should not change here. Warn + * if it does (but otherwise ignore). + */ + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 2 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + if (get_srp_secret(pcb->eap.es_unit, + pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_peer, secret, 0) == 0) { + /* + * Can't work with this peer because + * the secret is missing. Just give + * up. + */ + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + Bval.data = inp; + Bval.len = len; + t_clientpasswd(tc, secret); + BZERO(secret, sizeof (secret)); + pcb->eap.es_client.ea_skey = + t_clientgetkey(tc, &Bval); + if (pcb->eap.es_client.ea_skey == NULL) { + /* Server is rogue; stop now */ + ppp_error("EAP: SRP server is rogue"); + goto client_failure; + } + } + eap_srpval_response(esp, id, SRPVAL_EBIT, + t_clientresponse(tc)); + break; + + case EAPSRP_SVALIDATOR: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { + ppp_warn("EAP: peer sent Subtype 3 without 1/2"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + /* + * If we're already open, then this ought to be a + * duplicate. Otherwise, check that the server is + * who we think it is. + */ + if (pcb->eap.es_client.ea_state == eapOpen) { + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 3 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + len -= sizeof (u32_t) + SHA_DIGESTSIZE; + if (len < 0 || t_clientverify(tc, inp + + sizeof (u32_t)) != 0) { + ppp_error("EAP: SRP server verification " + "failed"); + goto client_failure; + } + GETLONG(pcb->eap.es_client.ea_keyflags, inp); + /* Save pseudonym if user wants it. */ + if (len > 0 && pcb->eap.es_usepseudo) { + INCPTR(SHA_DIGESTSIZE, inp); + write_pseudonym(esp, inp, len, id); + } + } + /* + * We've verified our peer. We're now mostly done, + * except for waiting on the regular EAP Success + * message. + */ + eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); + break; + + case EAPSRP_LWRECHALLENGE: + if (len < 4) { + ppp_warn("EAP: malformed Lightweight rechallenge"); + return; + } + SHA1Init(&ctxt); + vals[0] = id; + SHA1Update(&ctxt, vals, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, inp, len); + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + SHA1Final(dig, &ctxt); + eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, + SHA_DIGESTSIZE); + break; + + default: + ppp_error("EAP: unknown SRP Subtype %d", vallen); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + break; #endif /* USE_SRP */ - default: - ppp_info("EAP: unknown authentication type %d; Naking", typenum); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } + default: + ppp_info("EAP: unknown authentication type %d; Naking", typenum); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); - } - return; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); + } + return; #ifdef USE_SRP client_failure: - pcb->eap.es_client.ea_state = eapBadAuth; - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, (void *)esp); - } - pcb->eap.es_client.ea_session = NULL; - t_clientclose(tc); - auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, (void *)esp); + } + pcb->eap.es_client.ea_session = NULL; + t_clientclose(tc); + auth_withpeer_fail(pcb, PPP_EAP); #endif /* USE_SRP */ } @@ -1723,291 +1723,291 @@ client_failure: * eap_response - Receive EAP Response message (server mode). */ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_server *ts; - struct t_num A; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; + struct t_server *ts; + struct t_num A; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; #endif /* USE_SRP */ - if (pcb->eap.es_server.ea_id != id) { - ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, - pcb->eap.es_server.ea_id); - return; - } - - pcb->eap.es_server.ea_responses++; - - if (len <= 0) { - ppp_error("EAP: empty Response message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (pcb->eap.es_server.ea_state != eapIdentify) { - ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, - inp); - break; - } - ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, inp, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_NOTIFICATION: - ppp_dbglog("EAP unexpected Notification; response discarded"); - break; - - case EAPT_NAK: - if (len < 1) { - ppp_info("EAP: Nak Response with no suggested protocol"); - eap_figure_next_state(pcb, 1); - break; - } - - GETCHAR(vallen, inp); - len--; - - if ( + if (pcb->eap.es_server.ea_id != id) { + ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, + pcb->eap.es_server.ea_id); + return; + } + + pcb->eap.es_server.ea_responses++; + + if (len <= 0) { + ppp_error("EAP: empty Response message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (pcb->eap.es_server.ea_state != eapIdentify) { + ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, + inp); + break; + } + ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, inp, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_NOTIFICATION: + ppp_dbglog("EAP unexpected Notification; response discarded"); + break; + + case EAPT_NAK: + if (len < 1) { + ppp_info("EAP: Nak Response with no suggested protocol"); + eap_figure_next_state(pcb, 1); + break; + } + + GETCHAR(vallen, inp); + len--; + + if ( #if PPP_REMOTENAME - !pcb->explicit_remote && + !pcb->explicit_remote && #endif /* PPP_REMOTENAME */ - pcb->eap.es_server.ea_state == eapIdentify){ - /* Peer cannot Nak Identify Request */ - eap_figure_next_state(pcb, 1); - break; - } - - switch (vallen) { - case EAPT_SRP: - /* Run through SRP validator selection again. */ - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_MD5CHAP: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - - default: - ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); - switch (pcb->eap.es_server.ea_state) { - case eapSRP1: - case eapSRP2: - case eapSRP3: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - case eapMD5Chall: - case eapSRP4: - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - default: - break; - } - break; - } - break; - - case EAPT_MD5CHAP: - if (pcb->eap.es_server.ea_state != eapMD5Chall) { - ppp_error("EAP: unexpected MD5-Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < 1) { - ppp_error("EAP: received MD5-Response with no data"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen != 16 || vallen > len) { - ppp_error("EAP: MD5-Response with bad length %d", vallen); - eap_figure_next_state(pcb, 1); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + pcb->eap.es_server.ea_state == eapIdentify){ + /* Peer cannot Nak Identify Request */ + eap_figure_next_state(pcb, 1); + break; + } + + switch (vallen) { + case EAPT_SRP: + /* Run through SRP validator selection again. */ + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_MD5CHAP: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + + default: + ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); + switch (pcb->eap.es_server.ea_state) { + case eapSRP1: + case eapSRP2: + case eapSRP3: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + case eapMD5Chall: + case eapSRP4: + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + default: + break; + } + break; + } + break; + + case EAPT_MD5CHAP: + if (pcb->eap.es_server.ea_state != eapMD5Chall) { + ppp_error("EAP: unexpected MD5-Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < 1) { + ppp_error("EAP: received MD5-Response with no data"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen != 16 || vallen > len) { + ppp_error("EAP: MD5-Response with bad length %d", vallen); + eap_figure_next_state(pcb, 1); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating the specified - * host. - */ - if (!get_secret(pcb, rhostname, - pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { - ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); - eap_send_failure(pcb); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_type = EAPT_MD5CHAP; - eap_send_success(pcb); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); - break; + /* + * Get the secret for authenticating the specified + * host. + */ + if (!get_secret(pcb, rhostname, + pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { + ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); + eap_send_failure(pcb); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_type = EAPT_MD5CHAP; + eap_send_success(pcb); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: empty SRP Response"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(typenum, inp); - len--; - switch (typenum) { - case EAPSRP_CKEY: - if (pcb->eap.es_server.ea_state != eapSRP1) { - ppp_error("EAP: unexpected SRP Subtype 1 Response"); - eap_figure_next_state(pcb, 1); - break; - } - A.data = inp; - A.len = len; - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); - if (pcb->eap.es_server.ea_skey == NULL) { - /* Client's A value is bogus; terminate now */ - ppp_error("EAP: bogus A value from client"); - eap_send_failure(pcb); - } else { - eap_figure_next_state(pcb, 0); - } - break; - - case EAPSRP_CVALIDATOR: - if (pcb->eap.es_server.ea_state != eapSRP2) { - ppp_error("EAP: unexpected SRP Subtype 2 Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { - ppp_error("EAP: M1 length %d < %d", len, - sizeof (u32_t) + SHA_DIGESTSIZE); - eap_figure_next_state(pcb, 1); - break; - } - GETLONG(pcb->eap.es_server.ea_keyflags, inp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - if (t_serververify(ts, inp)) { - ppp_info("EAP: unable to validate client identity"); - eap_send_failure(pcb); - break; - } - eap_figure_next_state(pcb, 0); - break; - - case EAPSRP_ACK: - if (pcb->eap.es_server.ea_state != eapSRP3) { - ppp_error("EAP: unexpected SRP Subtype 3 Response"); - eap_send_failure(esp); - break; - } - pcb->eap.es_server.ea_type = EAPT_SRP; - eap_send_success(pcb, esp); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, - pcb->eap.es_rechallenge); - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, pcb, - pcb->eap.es_lwrechallenge); - break; - - case EAPSRP_LWRECHALLENGE: - if (pcb->eap.es_server.ea_state != eapSRP4) { - ppp_info("EAP: unexpected SRP Subtype 4 Response"); - return; - } - if (len != SHA_DIGESTSIZE) { - ppp_error("EAP: bad Lightweight rechallenge " - "response"); - return; - } - SHA1Init(&ctxt); - vallen = id; - SHA1Update(&ctxt, &vallen, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - SHA1Final(dig, &ctxt); - if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { - ppp_error("EAP: failed Lightweight rechallenge"); - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_state = eapOpen; - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, esp, - pcb->eap.es_lwrechallenge); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: empty SRP Response"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(typenum, inp); + len--; + switch (typenum) { + case EAPSRP_CKEY: + if (pcb->eap.es_server.ea_state != eapSRP1) { + ppp_error("EAP: unexpected SRP Subtype 1 Response"); + eap_figure_next_state(pcb, 1); + break; + } + A.data = inp; + A.len = len; + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); + if (pcb->eap.es_server.ea_skey == NULL) { + /* Client's A value is bogus; terminate now */ + ppp_error("EAP: bogus A value from client"); + eap_send_failure(pcb); + } else { + eap_figure_next_state(pcb, 0); + } + break; + + case EAPSRP_CVALIDATOR: + if (pcb->eap.es_server.ea_state != eapSRP2) { + ppp_error("EAP: unexpected SRP Subtype 2 Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { + ppp_error("EAP: M1 length %d < %d", len, + sizeof (u32_t) + SHA_DIGESTSIZE); + eap_figure_next_state(pcb, 1); + break; + } + GETLONG(pcb->eap.es_server.ea_keyflags, inp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + if (t_serververify(ts, inp)) { + ppp_info("EAP: unable to validate client identity"); + eap_send_failure(pcb); + break; + } + eap_figure_next_state(pcb, 0); + break; + + case EAPSRP_ACK: + if (pcb->eap.es_server.ea_state != eapSRP3) { + ppp_error("EAP: unexpected SRP Subtype 3 Response"); + eap_send_failure(esp); + break; + } + pcb->eap.es_server.ea_type = EAPT_SRP; + eap_send_success(pcb, esp); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, + pcb->eap.es_rechallenge); + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, pcb, + pcb->eap.es_lwrechallenge); + break; + + case EAPSRP_LWRECHALLENGE: + if (pcb->eap.es_server.ea_state != eapSRP4) { + ppp_info("EAP: unexpected SRP Subtype 4 Response"); + return; + } + if (len != SHA_DIGESTSIZE) { + ppp_error("EAP: bad Lightweight rechallenge " + "response"); + return; + } + SHA1Init(&ctxt); + vallen = id; + SHA1Update(&ctxt, &vallen, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + SHA1Final(dig, &ctxt); + if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { + ppp_error("EAP: failed Lightweight rechallenge"); + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_state = eapOpen; + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, esp, + pcb->eap.es_lwrechallenge); + break; + } + break; #endif /* USE_SRP */ - default: - /* This can't happen. */ - ppp_error("EAP: unknown Response type %d; ignored", typenum); - return; - } - - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - - if (pcb->eap.es_server.ea_state != eapBadAuth && - pcb->eap.es_server.ea_state != eapOpen) { - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); - } + default: + /* This can't happen. */ + ppp_error("EAP: unknown Response type %d; ignored", typenum); + return; + } + + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + + if (pcb->eap.es_server.ea_state != eapBadAuth && + pcb->eap.es_server.ea_state != eapOpen) { + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); + } } #endif /* PPP_SERVER */ @@ -2015,105 +2015,105 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { * eap_success - Receive EAP Success message (client mode). */ static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); - - if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected success message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - return; - } - - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } - - pcb->eap.es_client.ea_state = eapOpen; - auth_withpeer_success(pcb, PPP_EAP, 0); + LWIP_UNUSED_ARG(id); + + if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected success message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + return; + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } + + pcb->eap.es_client.ea_state = eapOpen; + auth_withpeer_success(pcb, PPP_EAP, 0); } /* * eap_failure - Receive EAP Failure message (client mode). */ static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(id); - if (!eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected failure message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - } + if (!eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected failure message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } - pcb->eap.es_client.ea_state = eapBadAuth; + pcb->eap.es_client.ea_state = eapBadAuth; - ppp_error("EAP: peer reports authentication failure"); - auth_withpeer_fail(pcb, PPP_EAP); + ppp_error("EAP: peer reports authentication failure"); + auth_withpeer_fail(pcb, PPP_EAP); } /* * eap_input - Handle received EAP message. */ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { - u_char code, id; - int len; - - /* - * Parse header (code, id and length). If packet too short, - * drop it. - */ - if (inlen < EAP_HEADERLEN) { - ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) { - ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, - EAP_HEADERLEN, inlen); - return; - } - len -= EAP_HEADERLEN; - - /* Dispatch based on message code */ - switch (code) { - case EAP_REQUEST: - eap_request(pcb, inp, id, len); - break; + u_char code, id; + int len; + + /* + * Parse header (code, id and length). If packet too short, + * drop it. + */ + if (inlen < EAP_HEADERLEN) { + ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) { + ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, + EAP_HEADERLEN, inlen); + return; + } + len -= EAP_HEADERLEN; + + /* Dispatch based on message code */ + switch (code) { + case EAP_REQUEST: + eap_request(pcb, inp, id, len); + break; #if PPP_SERVER - case EAP_RESPONSE: - eap_response(pcb, inp, id, len); - break; + case EAP_RESPONSE: + eap_response(pcb, inp, id, len); + break; #endif /* PPP_SERVER */ - case EAP_SUCCESS: - eap_success(pcb, inp, id, len); - break; + case EAP_SUCCESS: + eap_success(pcb, inp, id, len); + break; - case EAP_FAILURE: - eap_failure(pcb, inp, id, len); - break; + case EAP_FAILURE: + eap_failure(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - /* Note: it's not legal to send EAP Nak here. */ - ppp_warn("EAP: unknown code %d received", code); - break; - } + default: /* XXX Need code reject */ + /* Note: it's not legal to send EAP Nak here. */ + ppp_warn("EAP: unknown code %d received", code); + break; + } } #if PRINTPKT_SUPPORT @@ -2121,302 +2121,302 @@ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { * eap_printpkt - print the contents of an EAP packet. */ static const char* const eap_codenames[] = { - "Request", "Response", "Success", "Failure" + "Request", "Response", "Success", "Failure" }; static const char* const eap_typenames[] = { - "Identity", "Notification", "Nak", "MD5-Challenge", - "OTP", "Generic-Token", NULL, NULL, - "RSA", "DSS", "KEA", "KEA-Validate", - "TLS", "Defender", "Windows 2000", "Arcot", - "Cisco", "Nokia", "SRP" + "Identity", "Notification", "Nak", "MD5-Challenge", + "OTP", "Generic-Token", NULL, NULL, + "RSA", "DSS", "KEA", "KEA-Validate", + "TLS", "Defender", "Windows 2000", "Arcot", + "Cisco", "Nokia", "SRP" }; static int eap_printpkt(const u_char *inp, int inlen, void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len, rtype, vallen; - const u_char *pstart; - u32_t uval; - - if (inlen < EAP_HEADERLEN) - return (0); - pstart = inp; - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) - return (0); - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) - printer(arg, " %s", eap_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= EAP_HEADERLEN; - switch (code) { - case EAP_REQUEST: - if (len < 1) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - case EAPT_NOTIFICATION: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_MD5CHAP: - if (len <= 0) - break; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 3) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CHALLENGE: - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - if (vallen > 0) { - printer(arg, " "); - } else { - printer(arg, " "); - } - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - if (vallen == 0) { - printer(arg, " "); - } else { - printer(arg, " ", vallen, inp); - } - INCPTR(vallen, inp); - len -= vallen; - if (len == 0) { - printer(arg, " "); - } else { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_SKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_SVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - printer(arg, " ", len, inp, - len < SHA_DIGESTSIZE ? "?" : ""); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_RESPONSE: - if (len < 1) - break; - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPT_NAK: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " (%s)", eap_typenames[rtype-1]); - printer(arg, ">"); - break; - - case EAPT_MD5CHAP: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 1) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_CVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_ACK: - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - INCPTR(vallen, inp); - len -= vallen; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_SUCCESS: /* No payload expected for these! */ - case EAP_FAILURE: - default: - break; - - truncated: - printer(arg, " "); - break; - } - - if (len > 8) - printer(arg, "%8B...", inp); - else if (len > 0) - printer(arg, "%.*B", len, inp); - INCPTR(len, inp); - - return (inp - pstart); + int code, id, len, rtype, vallen; + const u_char *pstart; + u32_t uval; + + if (inlen < EAP_HEADERLEN) + return (0); + pstart = inp; + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) + return (0); + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) + printer(arg, " %s", eap_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= EAP_HEADERLEN; + switch (code) { + case EAP_REQUEST: + if (len < 1) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + case EAPT_NOTIFICATION: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_MD5CHAP: + if (len <= 0) + break; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 3) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CHALLENGE: + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + if (vallen > 0) { + printer(arg, " "); + } else { + printer(arg, " "); + } + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + if (vallen == 0) { + printer(arg, " "); + } else { + printer(arg, " ", vallen, inp); + } + INCPTR(vallen, inp); + len -= vallen; + if (len == 0) { + printer(arg, " "); + } else { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_SKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_SVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + printer(arg, " ", len, inp, + len < SHA_DIGESTSIZE ? "?" : ""); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_RESPONSE: + if (len < 1) + break; + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPT_NAK: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " (%s)", eap_typenames[rtype-1]); + printer(arg, ">"); + break; + + case EAPT_MD5CHAP: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 1) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_CVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_ACK: + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + INCPTR(vallen, inp); + len -= vallen; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_SUCCESS: /* No payload expected for these! */ + case EAP_FAILURE: + default: + break; + + truncated: + printer(arg, " "); + break; + } + + if (len > 8) + printer(arg, "%8B...", inp); + else if (len > 0) + printer(arg, "%.*B", len, inp); + INCPTR(len, inp); + + return (inp - pstart); } #endif /* PRINTPKT_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ecp.c b/components/net/lwip-2.0.2/src/netif/ppp/ecp.c index 5b3b331560..4d84f60931 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ecp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ecp.c @@ -92,8 +92,8 @@ static void ecp_protrej (int unit); */ #if PRINTPKT_SUPPORT static int ecp_printpkt (const u_char *pkt, int len, - void (*printer) (void *, char *, ...), - void *arg); + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ /* static void ecp_datainput (int unit, u_char *pkt, int len); @@ -129,10 +129,10 @@ const struct protent ecp_protent = { }; fsm ecp_fsm[NUM_PPP]; -ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ -ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ -ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ -ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ +ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ +ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ +ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ +ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ static const fsm_callbacks ecp_callbacks = { NULL, /* ecp_resetci, */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/eui64.c b/components/net/lwip-2.0.2/src/netif/ppp/eui64.c index 9e25fc4c2f..01493bc1f8 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/eui64.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/eui64.c @@ -48,8 +48,8 @@ char *eui64_ntoa(eui64_t e) { static char buf[20]; sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", - e.e8[0], e.e8[1], e.e8[2], e.e8[3], - e.e8[4], e.e8[5], e.e8[6], e.e8[7]); + e.e8[0], e.e8[1], e.e8[2], e.e8[3], + e.e8[4], e.e8[5], e.e8[6], e.e8[7]); return buf; } diff --git a/components/net/lwip-2.0.2/src/netif/ppp/fsm.c b/components/net/lwip-2.0.2/src/netif/ppp/fsm.c index 0f6cafa5b1..81eba11602 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/fsm.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/fsm.c @@ -68,7 +68,7 @@ static void fsm_rtermack(fsm *f); static void fsm_rcoderej(fsm *f, u_char *inp, int len); static void fsm_sconfreq(fsm *f, int retransmit); -#define PROTO_NAME(f) ((f)->callbacks->proto_name) +#define PROTO_NAME(f) ((f)->callbacks->proto_name) /* * fsm_init - Initialize fsm. @@ -79,7 +79,7 @@ void fsm_init(fsm *f) { ppp_pcb *pcb = f->pcb; f->state = PPP_FSM_INITIAL; f->flags = 0; - f->id = 0; /* XXX Start with random id? */ + f->id = 0; /* XXX Start with random id? */ f->maxnakloops = pcb->settings.fsm_max_nak_loops; f->term_reason_len = 0; } @@ -91,22 +91,22 @@ void fsm_init(fsm *f) { void fsm_lowerup(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STARTING: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -119,37 +119,37 @@ void fsm_lowerup(fsm *f) { void fsm_lowerdown(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSED: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_INITIAL; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_INITIAL; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_STARTING; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_STARTING; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_OPENED: - if( f->callbacks->down ) - (*f->callbacks->down)(f); - f->state = PPP_FSM_STARTING; - break; + if( f->callbacks->down ) + (*f->callbacks->down)(f); + f->state = PPP_FSM_STARTING; + break; default: - FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -160,34 +160,34 @@ void fsm_lowerdown(fsm *f) { void fsm_open(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSED: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_STOPPING; - /* fall through */ - /* no break */ + f->state = PPP_FSM_STOPPING; + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: case PPP_FSM_OPENED: - if( f->flags & OPT_RESTART ){ - fsm_lowerdown(f); - fsm_lowerup(f); - } - break; + if( f->flags & OPT_RESTART ){ + fsm_lowerdown(f); + fsm_lowerup(f); + } + break; default: - break; + break; } } @@ -201,25 +201,25 @@ static void terminate_layer(fsm *f, int nextstate) { ppp_pcb *pcb = f->pcb; if( f->state != PPP_FSM_OPENED ) - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ else if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers we're down */ + (*f->callbacks->down)(f); /* Inform upper layers we're down */ /* Init restart counter and send Terminate-Request */ f->retransmits = pcb->settings.fsm_max_term_transmits; fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); + (const u_char *) f->term_reason, f->term_reason_len); if (f->retransmits == 0) { - /* - * User asked for no terminate requests at all; just close it. - * We've already fired off one Terminate-Request just to be nice - * to the peer, but we're not going to wait for a reply. - */ - f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - return; + /* + * User asked for no terminate requests at all; just close it. + * We've already fired off one Terminate-Request just to be nice + * to the peer, but we're not going to wait for a reply. + */ + f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + return; } TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); @@ -239,23 +239,23 @@ void fsm_close(fsm *f, const char *reason) { f->term_reason_len = (reason == NULL? 0: LWIP_MIN(strlen(reason), 0xFF) ); switch( f->state ){ case PPP_FSM_STARTING: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STOPPING: - f->state = PPP_FSM_CLOSING; - break; + f->state = PPP_FSM_CLOSING; + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_CLOSING); - break; + terminate_layer(f, PPP_FSM_CLOSING); + break; default: - break; + break; } } @@ -270,44 +270,44 @@ static void fsm_timeout(void *arg) { switch (f->state) { case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - if( f->retransmits <= 0 ){ - /* - * We've waited for an ack long enough. Peer probably heard us. - */ - f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - } else { - /* Send Terminate-Request */ - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - --f->retransmits; - } - break; + if( f->retransmits <= 0 ){ + /* + * We've waited for an ack long enough. Peer probably heard us. + */ + f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + } else { + /* Send Terminate-Request */ + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (const u_char *) f->term_reason, f->term_reason_len); + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + --f->retransmits; + } + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - if (f->retransmits <= 0) { - ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); - f->state = PPP_FSM_STOPPED; - if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) - (*f->callbacks->finished)(f); - - } else { - /* Retransmit the configure-request */ - if (f->callbacks->retransmit) - (*f->callbacks->retransmit)(f); - fsm_sconfreq(f, 1); /* Re-send Configure-Request */ - if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; - } - break; + if (f->retransmits <= 0) { + ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); + f->state = PPP_FSM_STOPPED; + if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) + (*f->callbacks->finished)(f); + + } else { + /* Retransmit the configure-request */ + if (f->callbacks->retransmit) + (*f->callbacks->retransmit)(f); + fsm_sconfreq(f, 1); /* Re-send Configure-Request */ + if( f->state == PPP_FSM_ACKRCVD ) + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -326,26 +326,26 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ inp = inpacket; if (l < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); + return; } if (len > l) { - FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); + return; } - len -= HEADERLEN; /* subtract header length */ + len -= HEADERLEN; /* subtract header length */ if( f->state == PPP_FSM_INITIAL || f->state == PPP_FSM_STARTING ){ - FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", - f->protocol, f->state)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", + f->protocol, f->state)); + return; } /* @@ -353,35 +353,35 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ switch (code) { case CONFREQ: - fsm_rconfreq(f, id, inp, len); - break; - + fsm_rconfreq(f, id, inp, len); + break; + case CONFACK: - fsm_rconfack(f, id, inp, len); - break; - + fsm_rconfack(f, id, inp, len); + break; + case CONFNAK: case CONFREJ: - fsm_rconfnakrej(f, code, id, inp, len); - break; - + fsm_rconfnakrej(f, code, id, inp, len); + break; + case TERMREQ: - fsm_rtermreq(f, id, inp, len); - break; - + fsm_rtermreq(f, id, inp, len); + break; + case TERMACK: - fsm_rtermack(f); - break; - + fsm_rtermack(f); + break; + case CODEREJ: - fsm_rcoderej(f, inp, len); - break; - + fsm_rcoderej(f, inp, len); + break; + default: - if( !f->callbacks->extcode - || !(*f->callbacks->extcode)(f, code, id, inp, len) ) - fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); - break; + if( !f->callbacks->extcode + || !(*f->callbacks->extcode)(f, code, id, inp, len) ) + fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); + break; } } @@ -394,61 +394,61 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { switch( f->state ){ case PPP_FSM_CLOSED: - /* Go away, we're closed */ - fsm_sdata(f, TERMACK, id, NULL, 0); - return; + /* Go away, we're closed */ + fsm_sdata(f, TERMACK, id, NULL, 0); + return; case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - return; + return; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if( f->callbacks->down ) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_STOPPED: - /* Negotiation started by our peer */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Negotiation started by our peer */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } /* * Pass the requested configuration options * to protocol-specific code for checking. */ - if (f->callbacks->reqci){ /* Check CI */ - reject_if_disagree = (f->nakloops >= f->maxnakloops); - code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); + if (f->callbacks->reqci){ /* Check CI */ + reject_if_disagree = (f->nakloops >= f->maxnakloops); + code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); } else if (len) - code = CONFREJ; /* Reject all CI */ + code = CONFREJ; /* Reject all CI */ else - code = CONFACK; + code = CONFACK; /* send the Ack, Nak or Rej to the peer */ fsm_sdata(f, code, id, inp, len); if (code == CONFACK) { - if (f->state == PPP_FSM_ACKRCVD) { - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - } else - f->state = PPP_FSM_ACKSENT; - f->nakloops = 0; + if (f->state == PPP_FSM_ACKRCVD) { + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + } else + f->state = PPP_FSM_ACKSENT; + f->nakloops = 0; } else { - /* we sent CONFACK or CONFREJ */ - if (f->state != PPP_FSM_ACKRCVD) - f->state = PPP_FSM_REQSENT; - if( code == CONFNAK ) - ++f->nakloops; + /* we sent CONFACK or CONFREJ */ + if (f->state != PPP_FSM_ACKRCVD) + f->state = PPP_FSM_REQSENT; + if( code == CONFNAK ) + ++f->nakloops; } } @@ -459,13 +459,13 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { ppp_pcb *pcb = f->pcb; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if( !(f->callbacks->ackci? (*f->callbacks->ackci)(f, inp, len): - (len == 0)) ){ - /* Ack is bad - ignore it */ - ppp_error("Received bad configure-ack: %P", inp, len); - return; + (len == 0)) ){ + /* Ack is bad - ignore it */ + ppp_error("Received bad configure-ack: %P", inp, len); + return; } f->seen_ack = 1; f->rnakloops = 0; @@ -473,38 +473,38 @@ static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: - f->state = PPP_FSM_ACKRCVD; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - break; + f->state = PPP_FSM_ACKRCVD; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + break; case PPP_FSM_ACKRCVD: - /* Huh? an extra valid Ack? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Huh? an extra valid Ack? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - break; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -516,24 +516,24 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { int ret; int treat_as_reject; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if (code == CONFNAK) { - ++f->rnakloops; - treat_as_reject = (f->rnakloops >= f->maxnakloops); - if (f->callbacks->nakci == NULL - || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { - ppp_error("Received bad configure-nak: %P", inp, len); - return; - } + ++f->rnakloops; + treat_as_reject = (f->rnakloops >= f->maxnakloops); + if (f->callbacks->nakci == NULL + || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { + ppp_error("Received bad configure-nak: %P", inp, len); + return; + } } else { - f->rnakloops = 0; - if (f->callbacks->rejci == NULL - || !(ret = f->callbacks->rejci(f, inp, len))) { - ppp_error("Received bad configure-rej: %P", inp, len); - return; - } + f->rnakloops = 0; + if (f->callbacks->rejci == NULL + || !(ret = f->callbacks->rejci(f, inp, len))) { + ppp_error("Received bad configure-rej: %P", inp, len); + return; + } } f->seen_ack = 1; @@ -541,35 +541,35 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKSENT: - /* They didn't agree to what we wanted - try another request */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - if (ret < 0) - f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ - else - fsm_sconfreq(f, 0); /* Send Configure-Request */ - break; + /* They didn't agree to what we wanted - try another request */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + if (ret < 0) + f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ + else + fsm_sconfreq(f, 0); /* Send Configure-Request */ + break; case PPP_FSM_ACKRCVD: - /* Got a Nak/reject when we had already had an Ack?? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Got a Nak/reject when we had already had an Ack?? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -583,22 +583,22 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { switch (f->state) { case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ - break; + f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ + break; case PPP_FSM_OPENED: - if (len > 0) { - ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); - } else - ppp_info("%s terminated by peer", PROTO_NAME(f)); - f->retransmits = 0; - f->state = PPP_FSM_STOPPING; - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - break; + if (len > 0) { + ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); + } else + ppp_info("%s terminated by peer", PROTO_NAME(f)); + f->retransmits = 0; + f->state = PPP_FSM_STOPPING; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + break; default: - break; + break; } fsm_sdata(f, TERMACK, id, NULL, 0); @@ -611,30 +611,30 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { static void fsm_rtermack(fsm *f) { switch (f->state) { case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_ACKRCVD: - f->state = PPP_FSM_REQSENT; - break; + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -646,15 +646,15 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; if (len < HEADERLEN) { - FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); - return; + FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); ppp_warn("%s: Rcvd Code-Reject for code %d, id %d", PROTO_NAME(f), code, id); if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; + f->state = PPP_FSM_REQSENT; } @@ -666,36 +666,36 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { void fsm_protreject(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_CLOSED: - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_STOPPING); - break; + terminate_layer(f, PPP_FSM_STOPPING); + break; default: - FSMDEBUG(("%s: Protocol-reject event in state %d!", - PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Protocol-reject event in state %d!", + PROTO_NAME(f), f->state)); + /* no break */ } } @@ -710,17 +710,17 @@ static void fsm_sconfreq(fsm *f, int retransmit) { int cilen; if( f->state != PPP_FSM_REQSENT && f->state != PPP_FSM_ACKRCVD && f->state != PPP_FSM_ACKSENT ){ - /* Not currently negotiating - reset options */ - if( f->callbacks->resetci ) - (*f->callbacks->resetci)(f); - f->nakloops = 0; - f->rnakloops = 0; + /* Not currently negotiating - reset options */ + if( f->callbacks->resetci ) + (*f->callbacks->resetci)(f); + f->nakloops = 0; + f->rnakloops = 0; } if( !retransmit ){ - /* New request - reset retransmission counter, use new ID */ - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - f->reqid = ++f->id; + /* New request - reset retransmission counter, use new ID */ + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + f->reqid = ++f->id; } f->seen_ack = 0; @@ -729,11 +729,11 @@ static void fsm_sconfreq(fsm *f, int retransmit) { * Make up the request packet */ if( f->callbacks->cilen && f->callbacks->addci ){ - cilen = (*f->callbacks->cilen)(f); - if( cilen > pcb->peer_mru - HEADERLEN ) - cilen = pcb->peer_mru - HEADERLEN; + cilen = (*f->callbacks->cilen)(f); + if( cilen > pcb->peer_mru - HEADERLEN ) + cilen = pcb->peer_mru - HEADERLEN; } else - cilen = 0; + cilen = 0; p = pbuf_alloc(PBUF_RAW, (u16_t)(cilen + HEADERLEN + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); if(NULL == p) @@ -750,8 +750,8 @@ static void fsm_sconfreq(fsm *f, int retransmit) { PUTCHAR(f->reqid, outp); PUTSHORT(cilen + HEADERLEN, outp); if (cilen != 0) { - (*f->callbacks->addci)(f, outp, &cilen); - LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); + (*f->callbacks->addci)(f, outp, &cilen); + LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); } ppp_write(pcb, p); @@ -775,7 +775,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) /* Adjust length to be smaller than MTU */ if (datalen > pcb->peer_mru - HEADERLEN) - datalen = pcb->peer_mru - HEADERLEN; + datalen = pcb->peer_mru - HEADERLEN; outlen = datalen + HEADERLEN; p = pbuf_alloc(PBUF_RAW, (u16_t)(outlen + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); @@ -788,7 +788,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) outp = (u_char*)p->payload; if (datalen) /* && data != outp + PPP_HDRLEN + HEADERLEN) -- was only for fsm_sconfreq() */ - MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); + MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); MAKEHEADER(outp, f->protocol); PUTCHAR(code, outp); PUTCHAR(id, outp); diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c b/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c index feb1f4becc..b7c766eb0b 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ipcp.c @@ -66,15 +66,15 @@ #if 0 /* UNUSED */ /* global vars */ -u32_t netmask = 0; /* IP netmask to set on interface */ +u32_t netmask = 0; /* IP netmask to set on interface */ #endif /* UNUSED */ #if 0 /* UNUSED */ -bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ +bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ #endif /* UNUSED */ #if 0 /* moved to ppp_settings */ -bool noremoteip = 0; /* Let him have no IP address */ +bool noremoteip = 0; /* Let him have no IP address */ #endif /* moved to ppp_setting */ #if 0 /* UNUSED */ @@ -96,47 +96,47 @@ struct notifier *ip_down_notifier = NULL; /* local vars */ #if 0 /* moved to ppp_pcb */ -static int default_route_set[NUM_PPP]; /* Have set up a default route */ -static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ -static int ipcp_is_up; /* have called np_up() */ -static int ipcp_is_open; /* haven't called np_finished() */ -static bool ask_for_local; /* request our address from peer */ +static int default_route_set[NUM_PPP]; /* Have set up a default route */ +static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ +static int ipcp_is_up; /* have called np_up() */ +static int ipcp_is_open; /* haven't called np_finished() */ +static bool ask_for_local; /* request our address from peer */ #endif /* moved to ppp_pcb */ #if 0 /* UNUSED */ -static char vj_value[8]; /* string form of vj option value */ -static char netmask_str[20]; /* string form of netmask value */ +static char vj_value[8]; /* string form of vj option value */ +static char netmask_str[20]; /* string form of netmask value */ #endif /* UNUSED */ /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void ipcp_resetci(fsm *f); /* Reset our CI */ -static int ipcp_cilen(fsm *f); /* Return length of our CI */ +static void ipcp_resetci(fsm *f); /* Reset our CI */ +static int ipcp_cilen(fsm *f); /* Return length of our CI */ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI */ -static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject);/* Peer nak'd our CI */ -static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree); /* Rcv CI */ -static void ipcp_up(fsm *f); /* We're UP */ -static void ipcp_down(fsm *f); /* We're DOWN */ -static void ipcp_finished(fsm *f); /* Don't need lower layer */ +static void ipcp_up(fsm *f); /* We're UP */ +static void ipcp_down(fsm *f); /* We're DOWN */ +static void ipcp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ - ipcp_resetci, /* Reset our Configuration Information */ - ipcp_cilen, /* Length of our Configuration Information */ - ipcp_addci, /* Add our Configuration Information */ - ipcp_ackci, /* ACK our Configuration Information */ - ipcp_nakci, /* NAK our Configuration Information */ - ipcp_rejci, /* Reject our Configuration Information */ - ipcp_reqci, /* Request peer's Configuration Information */ - ipcp_up, /* Called when fsm reaches OPENED state */ - ipcp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPCP" /* String name of protocol */ + ipcp_resetci, /* Reset our Configuration Information */ + ipcp_cilen, /* Length of our Configuration Information */ + ipcp_addci, /* Add our Configuration Information */ + ipcp_ackci, /* ACK our Configuration Information */ + ipcp_nakci, /* NAK our Configuration Information */ + ipcp_rejci, /* Reject our Configuration Information */ + ipcp_reqci, /* Request peer's Configuration Information */ + ipcp_up, /* Called when fsm reaches OPENED state */ + ipcp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPCP" /* String name of protocol */ }; /* @@ -209,13 +209,13 @@ static option_t ipcp_option_list[] = { &ipcp_wantoptions[0].default_route }, { "replacedefaultroute", o_bool, - &ipcp_wantoptions[0].replace_default_route, + &ipcp_wantoptions[0].replace_default_route, "Replace default route", 1 }, { "noreplacedefaultroute", o_bool, - &ipcp_allowoptions[0].replace_default_route, + &ipcp_allowoptions[0].replace_default_route, "Never replace default route", OPT_A2COPY, - &ipcp_wantoptions[0].replace_default_route }, + &ipcp_wantoptions[0].replace_default_route }, { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, @@ -265,7 +265,7 @@ static void ipcp_input(ppp_pcb *pcb, u_char *p, int len); static void ipcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS static void ip_check_options (void); @@ -312,15 +312,15 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ -#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ -#define CILEN_ADDR 6 /* new-style single address option */ -#define CILEN_ADDRS 10 /* old-style dual address option */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ +#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ +#define CILEN_ADDR 6 /* new-style single address option */ +#define CILEN_ADDRS 10 /* old-style dual address option */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED, already defined by lwIP */ /* @@ -351,11 +351,11 @@ setvjslots(argv) int value; if (!int_option(*argv, &value)) - return 0; + return 0; if (value < 2 || value > 16) { - option_error("vj-max-slots value must be between 2 and 16"); - return 0; + option_error("vj-max-slots value must be between 2 and 16"); + return 0; } ipcp_wantoptions [0].maxslotindex = ipcp_allowoptions[0].maxslotindex = value - 1; @@ -375,21 +375,21 @@ setdnsaddr(argv) dns = inet_addr(*argv); if (dns == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-dns option", - *argv); - return 0; - } - dns = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-dns option", + *argv); + return 0; + } + dns = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].dnsaddr[1] == 0) - ipcp_allowoptions[0].dnsaddr[0] = dns; + ipcp_allowoptions[0].dnsaddr[0] = dns; else - ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; + ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].dnsaddr[1] = dns; @@ -411,21 +411,21 @@ setwinsaddr(argv) wins = inet_addr(*argv); if (wins == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-wins option", - *argv); - return 0; - } - wins = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-wins option", + *argv); + return 0; + } + wins = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].winsaddr[1] == 0) - ipcp_allowoptions[0].winsaddr[0] = wins; + ipcp_allowoptions[0].winsaddr[0] = wins; else - ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; + ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].winsaddr[1] = wins; @@ -455,52 +455,52 @@ setipaddr(arg, argv, doit) * IP address pair separated by ":". */ if ((colon = strchr(arg, ':')) == NULL) - return 0; + return 0; if (!doit) - return 1; - + return 1; + /* * If colon first character, then no local addr. */ if (colon != arg && option_priority >= prio_local) { - *colon = '\0'; - if ((local = inet_addr(arg)) == (u32_t) -1) { - if ((hp = gethostbyname(arg)) == NULL) { - option_error("unknown host: %s", arg); - return 0; - } - local = *(u32_t *)hp->h_addr; - } - if (bad_ip_adrs(local)) { - option_error("bad local IP address %s", ip_ntoa(local)); - return 0; - } - if (local != 0) - wo->ouraddr = local; - *colon = ':'; - prio_local = option_priority; - } - + *colon = '\0'; + if ((local = inet_addr(arg)) == (u32_t) -1) { + if ((hp = gethostbyname(arg)) == NULL) { + option_error("unknown host: %s", arg); + return 0; + } + local = *(u32_t *)hp->h_addr; + } + if (bad_ip_adrs(local)) { + option_error("bad local IP address %s", ip_ntoa(local)); + return 0; + } + if (local != 0) + wo->ouraddr = local; + *colon = ':'; + prio_local = option_priority; + } + /* * If colon last character, then no remote addr. */ if (*++colon != '\0' && option_priority >= prio_remote) { - if ((remote = inet_addr(colon)) == (u32_t) -1) { - if ((hp = gethostbyname(colon)) == NULL) { - option_error("unknown host: %s", colon); - return 0; - } - remote = *(u32_t *)hp->h_addr; - if (remote_name[0] == 0) - strlcpy(remote_name, colon, sizeof(remote_name)); - } - if (bad_ip_adrs(remote)) { - option_error("bad remote IP address %s", ip_ntoa(remote)); - return 0; - } - if (remote != 0) - wo->hisaddr = remote; - prio_remote = option_priority; + if ((remote = inet_addr(colon)) == (u32_t) -1) { + if ((hp = gethostbyname(colon)) == NULL) { + option_error("unknown host: %s", colon); + return 0; + } + remote = *(u32_t *)hp->h_addr; + if (remote_name[0] == 0) + strlcpy(remote_name, colon, sizeof(remote_name)); + } + if (bad_ip_adrs(remote)) { + option_error("bad remote IP address %s", ip_ntoa(remote)); + return 0; + } + if (remote != 0) + wo->hisaddr = remote; + prio_remote = option_priority; } return 1; @@ -512,13 +512,13 @@ printipaddr(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - ipcp_options *wo = &ipcp_wantoptions[0]; + ipcp_options *wo = &ipcp_wantoptions[0]; - if (wo->ouraddr != 0) - printer(arg, "%I", wo->ouraddr); - printer(arg, ":"); - if (wo->hisaddr != 0) - printer(arg, "%I", wo->hisaddr); + if (wo->ouraddr != 0) + printer(arg, "%I", wo->ouraddr); + printer(arg, ":"); + if (wo->hisaddr != 0) + printer(arg, "%I", wo->hisaddr); } /* @@ -542,8 +542,8 @@ setnetmask(argv) mask = lwip_htonl(mask); if (n == 0 || p[n] != 0 || (netmask & ~mask) != 0) { - option_error("invalid netmask value '%s'", *argv); - return 0; + option_error("invalid netmask value '%s'", *argv); + return 0; } netmask = mask; @@ -563,23 +563,23 @@ parse_dotted_ip(p, vp) v = 0; for (n = 3;; --n) { - b = strtoul(p, &endp, 0); - if (endp == p) - return 0; - if (b > 255) { - if (n < 3) - return 0; - /* accept e.g. 0xffffff00 */ - *vp = b; - return endp - p0; - } - v |= b << (n * 8); - p = endp; - if (n == 0) - break; - if (*p != '.') - return 0; - ++p; + b = strtoul(p, &endp, 0); + if (endp == p) + return 0; + if (b > 255) { + if (n < 3) + return 0; + /* accept e.g. 0xffffff00 */ + *vp = b; + return endp - p0; + } + v |= b << (n * 8); + p = endp; + if (n == 0) + break; + if (*p != '.') + return 0; + ++p; } *vp = v; return p - p0; @@ -716,23 +716,23 @@ static void ipcp_resetci(fsm *f) { ipcp_options *ao = &pcb->ipcp_allowoptions; wo->req_addr = (wo->neg_addr || wo->old_addrs) && - (ao->neg_addr || ao->old_addrs); + (ao->neg_addr || ao->old_addrs); if (wo->ouraddr == 0) - wo->accept_local = 1; + wo->accept_local = 1; if (wo->hisaddr == 0) - wo->accept_remote = 1; + wo->accept_remote = 1; #if LWIP_DNS - wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ + wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ #endif /* LWIP_DNS */ *go = *wo; if (!pcb->ask_for_local) - go->ouraddr = 0; + go->ouraddr = 0; #if 0 /* UNUSED */ if (ip_choose_hook) { - ip_choose_hook(&wo->hisaddr); - if (wo->hisaddr) { - wo->accept_remote = 0; - } + ip_choose_hook(&wo->hisaddr); + if (wo->hisaddr) { + wo->accept_remote = 0; + } } #endif /* UNUSED */ BZERO(&pcb->ipcp_hisoptions, sizeof(ipcp_options)); @@ -751,16 +751,16 @@ static int ipcp_cilen(fsm *f) { #endif /* VJ_SUPPORT */ ipcp_options *ho = &pcb->ipcp_hisoptions; -#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) +#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) #if VJ_SUPPORT -#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) +#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) #endif /* VJ_SUPPORT */ -#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) +#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) #if LWIP_DNS -#define LENCIDNS(neg) LENCIADDR(neg) +#define LENCIDNS(neg) LENCIADDR(neg) #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ -#define LENCIWINS(neg) LENCIADDR(neg) +#define LENCIWINS(neg) LENCIADDR(neg) #endif /* UNUSED - WINS */ /* @@ -768,34 +768,34 @@ static int ipcp_cilen(fsm *f) { * forms because we have received old forms from the peer. */ if (go->neg_addr && go->old_addrs && !ho->neg_addr && ho->old_addrs) - go->neg_addr = 0; + go->neg_addr = 0; #if VJ_SUPPORT if (wo->neg_vj && !go->neg_vj && !go->old_vj) { - /* try an older style of VJ negotiation */ - /* use the old style only if the peer did */ - if (ho->neg_vj && ho->old_vj) { - go->neg_vj = 1; - go->old_vj = 1; - go->vj_protocol = ho->vj_protocol; - } + /* try an older style of VJ negotiation */ + /* use the old style only if the peer did */ + if (ho->neg_vj && ho->old_vj) { + go->neg_vj = 1; + go->old_vj = 1; + go->vj_protocol = ho->vj_protocol; + } } #endif /* VJ_SUPPORT */ return (LENCIADDRS(!go->neg_addr && go->old_addrs) + #if VJ_SUPPORT - LENCIVJ(go->neg_vj, go->old_vj) + + LENCIVJ(go->neg_vj, go->old_vj) + #endif /* VJ_SUPPORT */ - LENCIADDR(go->neg_addr) + + LENCIADDR(go->neg_addr) + #if LWIP_DNS - LENCIDNS(go->req_dns1) + - LENCIDNS(go->req_dns2) + + LENCIDNS(go->req_dns1) + + LENCIDNS(go->req_dns2) + #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - LENCIWINS(go->winsaddr[0]) + - LENCIWINS(go->winsaddr[1]) + + LENCIWINS(go->winsaddr[0]) + + LENCIWINS(go->winsaddr[1]) + #endif /* UNUSED - WINS */ - 0); + 0); } @@ -810,86 +810,86 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - if (len >= CILEN_ADDRS) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDRS, ucp); \ - l = lwip_ntohl(val1); \ - PUTLONG(l, ucp); \ - l = lwip_ntohl(val2); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDRS; \ - } else \ - go->old_addrs = 0; \ + if (len >= CILEN_ADDRS) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDRS, ucp); \ + l = lwip_ntohl(val1); \ + PUTLONG(l, ucp); \ + l = lwip_ntohl(val2); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDRS; \ + } else \ + go->old_addrs = 0; \ } #if VJ_SUPPORT #define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - if (!old) { \ - PUTCHAR(maxslotindex, ucp); \ - PUTCHAR(cflag, ucp); \ - } \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + if (!old) { \ + PUTCHAR(maxslotindex, ucp); \ + PUTCHAR(cflag, ucp); \ + } \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* VJ_SUPPORT */ #define ADDCIADDR(opt, neg, val) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(val); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(val); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #if LWIP_DNS #define ADDCIDNS(opt, neg, addr) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ADDCIWINS(opt, addr) \ if (addr) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - addr = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + addr = 0; \ } #endif /* UNUSED - WINS */ ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ADDCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -905,7 +905,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); #endif /* UNUSED - WINS */ - + *lenp -= len; } @@ -915,8 +915,8 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { * Called by fsm_rconfack, Receive Configure ACK. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -936,105 +936,105 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { #define ACKCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDRS) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDRS || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val1 != cilong) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val2 != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDRS) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDRS || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val1 != cilong) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val2 != cilong) \ + goto bad; \ } #if VJ_SUPPORT #define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslotindex) \ - goto bad; \ - GETCHAR(cicflag, p); \ - if (cicflag != cflag) \ - goto bad; \ - } \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslotindex) \ + goto bad; \ + GETCHAR(cicflag, p); \ + if (cicflag != cflag) \ + goto bad; \ + } \ } #endif /* VJ_SUPPORT */ #define ACKCIADDR(opt, neg, val) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val != cilong) \ + goto bad; \ } #if LWIP_DNS #define ACKCIDNS(opt, neg, addr) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ACKCIWINS(opt, addr) \ if (addr) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* UNUSED - WINS */ ACKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ACKCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -1055,7 +1055,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -1070,8 +1070,8 @@ bad: * Calback from fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1085,8 +1085,8 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if LWIP_DNS u32_t cidnsaddr; #endif /* LWIP_DNS */ - ipcp_options no; /* options we've seen Naks for */ - ipcp_options try_; /* options to request next time */ + ipcp_options no; /* options we've seen Naks for */ + ipcp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -1098,58 +1098,58 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIADDRS(opt, neg, code) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - GETLONG(l, p); \ - ciaddr2 = lwip_htonl(l); \ - no.old_addrs = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + GETLONG(l, p); \ + ciaddr2 = lwip_htonl(l); \ + no.old_addrs = 1; \ + code \ } #if VJ_SUPPORT #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* VJ_SUPPORT */ #define NAKCIADDR(opt, neg, code) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - no.neg = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #if LWIP_DNS #define NAKCIDNS(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cidnsaddr = lwip_htonl(l); \ - no.neg = 1; \ - code \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cidnsaddr = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #endif /* LWIP_DNS */ @@ -1158,19 +1158,19 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - if (treat_as_reject) { - try_.old_addrs = 0; - } else { - if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - if (go->accept_remote && ciaddr2) { - /* take his idea of his address */ - try_.hisaddr = ciaddr2; - } - } - ); + if (treat_as_reject) { + try_.old_addrs = 0; + } else { + if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + if (go->accept_remote && ciaddr2) { + /* take his idea of his address */ + try_.hisaddr = ciaddr2; + } + } + ); #if VJ_SUPPORT /* @@ -1180,57 +1180,57 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the peer wants. */ NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - if (treat_as_reject) { - try_.neg_vj = 0; - } else if (cilen == CILEN_VJ) { - GETCHAR(cimaxslotindex, p); - GETCHAR(cicflag, p); - if (cishort == IPCP_VJ_COMP) { - try_.old_vj = 0; - if (cimaxslotindex < go->maxslotindex) - try_.maxslotindex = cimaxslotindex; - if (!cicflag) - try_.cflag = 0; - } else { - try_.neg_vj = 0; - } - } else { - if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { - try_.old_vj = 1; - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + if (treat_as_reject) { + try_.neg_vj = 0; + } else if (cilen == CILEN_VJ) { + GETCHAR(cimaxslotindex, p); + GETCHAR(cicflag, p); + if (cishort == IPCP_VJ_COMP) { + try_.old_vj = 0; + if (cimaxslotindex < go->maxslotindex) + try_.maxslotindex = cimaxslotindex; + if (!cicflag) + try_.cflag = 0; + } else { + try_.neg_vj = 0; + } + } else { + if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { + try_.old_vj = 1; + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* VJ_SUPPORT */ NAKCIADDR(CI_ADDR, neg_addr, - if (treat_as_reject) { - try_.neg_addr = 0; - try_.old_addrs = 0; - } else if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - ); + if (treat_as_reject) { + try_.neg_addr = 0; + try_.old_addrs = 0; + } else if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + ); #if LWIP_DNS NAKCIDNS(CI_MS_DNS1, req_dns1, - if (treat_as_reject) { - try_.req_dns1 = 0; - } else { - try_.dnsaddr[0] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns1 = 0; + } else { + try_.dnsaddr[0] = cidnsaddr; + } + ); NAKCIDNS(CI_MS_DNS2, req_dns2, - if (treat_as_reject) { - try_.req_dns2 = 0; - } else { - try_.dnsaddr[1] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns2 = 0; + } else { + try_.dnsaddr[1] = cidnsaddr; + } + ); #endif /* #if LWIP_DNS */ /* @@ -1242,81 +1242,81 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * peers get huffy if we don't. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* VJ_SUPPORT */ - case CI_ADDRS: - if ((!go->neg_addr && go->old_addrs) || no.old_addrs - || cilen != CILEN_ADDRS) - goto bad; - try_.neg_addr = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - GETLONG(l, p); - ciaddr2 = lwip_htonl(l); - if (ciaddr2 && go->accept_remote) - try_.hisaddr = ciaddr2; - no.old_addrs = 1; - break; - case CI_ADDR: - if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) - goto bad; - try_.old_addrs = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - if (try_.ouraddr != 0) - try_.neg_addr = 1; - no.neg_addr = 1; - break; + case CI_ADDRS: + if ((!go->neg_addr && go->old_addrs) || no.old_addrs + || cilen != CILEN_ADDRS) + goto bad; + try_.neg_addr = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + GETLONG(l, p); + ciaddr2 = lwip_htonl(l); + if (ciaddr2 && go->accept_remote) + try_.hisaddr = ciaddr2; + no.old_addrs = 1; + break; + case CI_ADDR: + if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) + goto bad; + try_.old_addrs = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + if (try_.ouraddr != 0) + try_.neg_addr = 1; + no.neg_addr = 1; + break; #if LWIP_DNS - case CI_MS_DNS1: - if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[0] = lwip_htonl(l); - try_.req_dns1 = 1; - no.req_dns1 = 1; - break; - case CI_MS_DNS2: - if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[1] = lwip_htonl(l); - try_.req_dns2 = 1; - no.req_dns2 = 1; - break; + case CI_MS_DNS1: + if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[0] = lwip_htonl(l); + try_.req_dns1 = 1; + no.req_dns1 = 1; + break; + case CI_MS_DNS2: + if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[1] = lwip_htonl(l); + try_.req_dns2 = 1; + no.req_dns2 = 1; + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - if (cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1) - try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + if (cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1) + try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; + break; #endif /* UNUSED - WINS */ - default: - break; - } - p = next; + default: + break; + } + p = next; } /* @@ -1324,7 +1324,7 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any remaining options, we ignore them. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -1347,7 +1347,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* VJ_SUPPORT */ u32_t cilong; - ipcp_options try_; /* options to request next time */ + ipcp_options try_; /* options to request next time */ try_ = *go; /* @@ -1357,107 +1357,107 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIADDRS(opt, neg, val1, val2) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val1) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val2) \ - goto bad; \ - try_.old_addrs = 0; \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val1) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val2) \ + goto bad; \ + try_.old_addrs = 0; \ } #if VJ_SUPPORT #define REJCIVJ(opt, neg, val, old, maxslot, cflag) \ if (go->neg && \ - p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslot) \ - goto bad; \ - GETCHAR(ciflag, p); \ - if (ciflag != cflag) \ - goto bad; \ + p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslot) \ + goto bad; \ + GETCHAR(ciflag, p); \ + if (ciflag != cflag) \ + goto bad; \ } \ - try_.neg = 0; \ + try_.neg = 0; \ } #endif /* VJ_SUPPORT */ #define REJCIADDR(opt, neg, val) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LWIP_DNS #define REJCIDNS(opt, neg, dnsaddr) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != dnsaddr) \ - goto bad; \ - try_.neg = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != dnsaddr) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define REJCIWINS(opt, addr) \ if (addr && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != addr) \ - goto bad; \ - try_.winsaddr[opt == CI_MS_WINS2] = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != addr) \ + goto bad; \ + try_.winsaddr[opt == CI_MS_WINS2] = 0; \ } #endif /* UNUSED - WINS */ REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - go->ouraddr, go->hisaddr); + go->ouraddr, go->hisaddr); #if VJ_SUPPORT REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ REJCIADDR(CI_ADDR, neg_addr, go->ouraddr); @@ -1478,12 +1478,12 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1508,17 +1508,17 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipcp_options *wo = &pcb->ipcp_wantoptions; ipcp_options *ho = &pcb->ipcp_hisoptions; ipcp_options *ao = &pcb->ipcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #if VJ_SUPPORT - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* VJ_SUPPORT */ u32_t tl, ciaddr1, ciaddr2;/* Parsed address values */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ #if VJ_SUPPORT u_char maxslotindex, cflag; #endif /* VJ_SUPPORT */ @@ -1530,243 +1530,243 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPCPDEBUG(("ipcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_ADDRS: - if (!ao->old_addrs || ho->neg_addr || - cilen != CILEN_ADDRS) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * If neither we nor he knows his address, reject the option. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - /* - * If he doesn't know our address, or if we both have our address - * but disagree about it, then NAK it with our idea. - */ - GETLONG(tl, p); /* Parse desination address (ours) */ - ciaddr2 = lwip_htonl(tl); - if (ciaddr2 != wo->ouraddr) { - if (ciaddr2 == 0 || !wo->accept_local) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->ouraddr); - PUTLONG(tl, p); - } - } else { - wo->ouraddr = ciaddr2; /* accept peer's idea */ - } - } - - ho->old_addrs = 1; - ho->hisaddr = ciaddr1; - ho->ouraddr = ciaddr2; - break; - - case CI_ADDR: - if (!ao->neg_addr || ho->old_addrs || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * Don't ACK an address of 0.0.0.0 - reject it instead. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - ho->neg_addr = 1; - ho->hisaddr = ciaddr1; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPCPDEBUG(("ipcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_ADDRS: + if (!ao->old_addrs || ho->neg_addr || + cilen != CILEN_ADDRS) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * If neither we nor he knows his address, reject the option. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + /* + * If he doesn't know our address, or if we both have our address + * but disagree about it, then NAK it with our idea. + */ + GETLONG(tl, p); /* Parse desination address (ours) */ + ciaddr2 = lwip_htonl(tl); + if (ciaddr2 != wo->ouraddr) { + if (ciaddr2 == 0 || !wo->accept_local) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->ouraddr); + PUTLONG(tl, p); + } + } else { + wo->ouraddr = ciaddr2; /* accept peer's idea */ + } + } + + ho->old_addrs = 1; + ho->hisaddr = ciaddr1; + ho->ouraddr = ciaddr2; + break; + + case CI_ADDR: + if (!ao->neg_addr || ho->old_addrs || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * Don't ACK an address of 0.0.0.0 - reject it instead. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + ho->neg_addr = 1; + ho->hisaddr = ciaddr1; + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - /* Microsoft primary or secondary DNS request */ - d = citype == CI_MS_DNS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->dnsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->dnsaddr[d]) { + case CI_MS_DNS1: + case CI_MS_DNS2: + /* Microsoft primary or secondary DNS request */ + d = citype == CI_MS_DNS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->dnsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->dnsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->dnsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->dnsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - /* Microsoft primary or secondary WINS request */ - d = citype == CI_MS_WINS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->winsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->winsaddr[d]) { + case CI_MS_WINS1: + case CI_MS_WINS2: + /* Microsoft primary or secondary WINS request */ + d = citype == CI_MS_WINS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->winsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->winsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->winsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->winsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* UNUSED - WINS */ #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (!ao->neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - if (!(cishort == IPCP_VJ_COMP || - (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - if (cilen == CILEN_VJ) { - GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(ao->maxslotindex, p); - } - } - GETCHAR(cflag, p); - if (cflag && !ao->cflag) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(wo->cflag, p); - } - } - ho->maxslotindex = maxslotindex; - ho->cflag = cflag; - } else { - ho->old_vj = 1; - ho->maxslotindex = MAX_STATES - 1; - ho->cflag = 1; - } - break; + case CI_COMPRESSTYPE: + if (!ao->neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + if (!(cishort == IPCP_VJ_COMP || + (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + if (cilen == CILEN_VJ) { + GETCHAR(maxslotindex, p); + if (maxslotindex > ao->maxslotindex) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(ao->maxslotindex, p); + } + } + GETCHAR(cflag, p); + if (cflag && !ao->cflag) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(wo->cflag, p); + } + } + ho->maxslotindex = maxslotindex; + ho->cflag = cflag; + } else { + ho->old_vj = 1; + ho->maxslotindex = MAX_STATES - 1; + ho->cflag = 1; + } + break; #endif /* VJ_SUPPORT */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1777,21 +1777,21 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs && - wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_addr = 0; /* don't ask again */ - } - PUTCHAR(CI_ADDR, ucp); - PUTCHAR(CILEN_ADDR, ucp); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, ucp); - } - - *len = ucp - inp; /* Compute output length */ + wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_addr = 0; /* don't ask again */ + } + PUTCHAR(CI_ADDR, ucp); + PUTCHAR(CILEN_ADDR, ucp); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, ucp); + } + + *len = ucp - inp; /* Compute output length */ IPCPDEBUG(("ipcp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -1812,17 +1812,17 @@ ip_check_options() * If local IP address already given, don't bother. */ if (wo->ouraddr == 0 && !disable_defaultip) { - /* - * Look up our hostname (possibly with domain name appended) - * and take the first IP address as our local IP address. - * If there isn't an IP address for our hostname, too bad. - */ - wo->accept_local = 1; /* don't insist on this default value */ - if ((hp = gethostbyname(hostname)) != NULL) { - local = *(u32_t *)hp->h_addr; - if (local != 0 && !bad_ip_adrs(local)) - wo->ouraddr = local; - } + /* + * Look up our hostname (possibly with domain name appended) + * and take the first IP address as our local IP address. + * If there isn't an IP address for our hostname, too bad. + */ + wo->accept_local = 1; /* don't insist on this default value */ + if ((hp = gethostbyname(hostname)) != NULL) { + local = *(u32_t *)hp->h_addr; + if (local != 0 && !bad_ip_adrs(local)) + wo->ouraddr = local; + } } ask_for_local = wo->ouraddr != 0 || !disable_defaultip; } @@ -1841,37 +1841,37 @@ ip_demand_conf(u) ipcp_options *wo = &ipcp_wantoptions[u]; if (wo->hisaddr == 0 && !pcb->settings.noremoteip) { - /* make up an arbitrary address for the peer */ - wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); - wo->accept_remote = 1; + /* make up an arbitrary address for the peer */ + wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); + wo->accept_remote = 1; } if (wo->ouraddr == 0) { - /* make up an arbitrary address for us */ - wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); - wo->accept_local = 1; - ask_for_local = 0; /* don't tell the peer this address */ + /* make up an arbitrary address for us */ + wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); + wo->accept_local = 1; + ask_for_local = 0; /* don't tell the peer this address */ } if (!sifaddr(pcb, wo->ouraddr, wo->hisaddr, get_mask(wo->ouraddr))) - return 0; + return 0; if (!sifup(pcb)) - return 0; + return 0; if (!sifnpmode(pcb, PPP_IP, NPMODE_QUEUE)) - return 0; + return 0; #if 0 /* UNUSED */ if (wo->default_route) - if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, - wo->replace_default_route)) - default_route_set[u] = 1; + if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, + wo->replace_default_route)) + default_route_set[u] = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ if (wo->proxy_arp) - if (sifproxyarp(pcb, wo->hisaddr)) - proxy_arp_set[u] = 1; + if (sifproxyarp(pcb, wo->hisaddr)) + proxy_arp_set[u] = 1; #endif /* UNUSED - PROXY ARP */ ppp_notice("local IP address %I", wo->ouraddr); if (wo->hisaddr) - ppp_notice("remote IP address %I", wo->hisaddr); + ppp_notice("remote IP address %I", wo->hisaddr); return 1; } @@ -1895,46 +1895,46 @@ static void ipcp_up(fsm *f) { * We must have a non-zero IP address for both ends of the link. */ if (!ho->neg_addr && !ho->old_addrs) - ho->hisaddr = wo->hisaddr; + ho->hisaddr = wo->hisaddr; if (!(go->neg_addr || go->old_addrs) && (wo->neg_addr || wo->old_addrs) - && wo->ouraddr != 0) { - ppp_error("Peer refused to agree to our IP address"); - ipcp_close(f->pcb, "Refused our IP address"); - return; + && wo->ouraddr != 0) { + ppp_error("Peer refused to agree to our IP address"); + ipcp_close(f->pcb, "Refused our IP address"); + return; } if (go->ouraddr == 0) { - ppp_error("Could not determine local IP address"); - ipcp_close(f->pcb, "Could not determine local IP address"); - return; + ppp_error("Could not determine local IP address"); + ipcp_close(f->pcb, "Could not determine local IP address"); + return; } if (ho->hisaddr == 0 && !pcb->settings.noremoteip) { - ho->hisaddr = lwip_htonl(0x0a404040); - ppp_warn("Could not determine remote IP address: defaulting to %I", - ho->hisaddr); + ho->hisaddr = lwip_htonl(0x0a404040); + ppp_warn("Could not determine remote IP address: defaulting to %I", + ho->hisaddr); } #if 0 /* UNUSED */ script_setenv("IPLOCAL", ip_ntoa(go->ouraddr), 0); if (ho->hisaddr != 0) - script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); + script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); #endif /* UNUSED */ #if LWIP_DNS if (!go->req_dns1) - go->dnsaddr[0] = 0; + go->dnsaddr[0] = 0; if (!go->req_dns2) - go->dnsaddr[1] = 0; + go->dnsaddr[1] = 0; #if 0 /* UNUSED */ if (go->dnsaddr[0]) - script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); + script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); if (go->dnsaddr[1]) - script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); + script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); #endif /* UNUSED */ if (pcb->settings.usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { - sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #if 0 /* UNUSED */ - script_setenv("USEPEERDNS", "1", 0); - create_resolv(go->dnsaddr[0], go->dnsaddr[1]); + script_setenv("USEPEERDNS", "1", 0); + create_resolv(go->dnsaddr[0], go->dnsaddr[1]); #endif /* UNUSED */ } #endif /* LWIP_DNS */ @@ -1943,29 +1943,29 @@ static void ipcp_up(fsm *f) { * Check that the peer is allowed to use the IP address it wants. */ if (ho->hisaddr != 0) { - u32_t addr = lwip_ntohl(ho->hisaddr); - if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET - || IP_MULTICAST(addr) || IP_BADCLASS(addr) - /* - * For now, consider that PPP in server mode with peer required - * to authenticate must provide the peer IP address, reject any - * IP address wanted by peer different than the one we wanted. - */ + u32_t addr = lwip_ntohl(ho->hisaddr); + if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET + || IP_MULTICAST(addr) || IP_BADCLASS(addr) + /* + * For now, consider that PPP in server mode with peer required + * to authenticate must provide the peer IP address, reject any + * IP address wanted by peer different than the one we wanted. + */ #if PPP_SERVER && PPP_AUTH_SUPPORT - || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) + || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) #endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ - ) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(pcb, "Unauthorized remote IP address"); - return; - } + ) { + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(pcb, "Unauthorized remote IP address"); + return; + } } #if 0 /* Unused */ /* Upstream checking code */ if (ho->hisaddr != 0 && !auth_ip_addr(f->unit, ho->hisaddr)) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(f->unit, "Unauthorized remote IP address"); - return; + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(f->unit, "Unauthorized remote IP address"); + return; } #endif /* Unused */ @@ -1981,114 +1981,114 @@ static void ipcp_up(fsm *f) { * interface to pass IP packets. */ if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { - ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, - wo->replace_default_route); - if (go->ouraddr != wo->ouraddr) { - ppp_warn("Local IP address changed to %I", go->ouraddr); - script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); - wo->ouraddr = go->ouraddr; - } else - script_unsetenv("OLDIPLOCAL"); - if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { - ppp_warn("Remote IP address changed to %I", ho->hisaddr); - script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); - wo->hisaddr = ho->hisaddr; - } else - script_unsetenv("OLDIPREMOTE"); - - /* Set the interface to the new addresses */ - mask = get_mask(go->ouraddr); - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { + ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, + wo->replace_default_route); + if (go->ouraddr != wo->ouraddr) { + ppp_warn("Local IP address changed to %I", go->ouraddr); + script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); + wo->ouraddr = go->ouraddr; + } else + script_unsetenv("OLDIPLOCAL"); + if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { + ppp_warn("Remote IP address changed to %I", ho->hisaddr); + script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); + wo->hisaddr = ho->hisaddr; + } else + script_unsetenv("OLDIPREMOTE"); + + /* Set the interface to the new addresses */ + mask = get_mask(go->ouraddr); + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - default_route_set[f->unit] = 1; + /* assign a default route through the interface if required */ + if (ipcp_wantoptions[f->unit].default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + default_route_set[f->unit] = 1; #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - proxy_arp_set[f->unit] = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + proxy_arp_set[f->unit] = 1; #endif /* UNUSED - PROXY ARP */ - } - demand_rexmit(PPP_IP,go->ouraddr); - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + } + demand_rexmit(PPP_IP,go->ouraddr); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set IP addresses and (if specified) netmask. - */ - mask = get_mask(go->ouraddr); + /* + * Set IP addresses and (if specified) netmask. + */ + mask = get_mask(go->ouraddr); #if !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #endif - /* bring the interface up for IP */ - if (!sifup(pcb)) { + /* bring the interface up for IP */ + if (!sifup(pcb)) { #if PPP_DEBUG - ppp_warn("Interface failed to come up"); + ppp_warn("Interface failed to come up"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #if (defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } #endif #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ #if 0 /* UNUSED */ - /* assign a default route through the interface if required */ - if (wo->default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - pcb->default_route_set = 1; + /* assign a default route through the interface if required */ + if (wo->default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + pcb->default_route_set = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && wo->proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - pcb->proxy_arp_set = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && wo->proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + pcb->proxy_arp_set = 1; #endif /* UNUSED - PROXY ARP */ - wo->ouraddr = go->ouraddr; + wo->ouraddr = go->ouraddr; - ppp_notice("local IP address %I", go->ouraddr); - if (ho->hisaddr != 0) - ppp_notice("remote IP address %I", ho->hisaddr); + ppp_notice("local IP address %I", go->ouraddr); + if (ho->hisaddr != 0) + ppp_notice("remote IP address %I", ho->hisaddr); #if LWIP_DNS - if (go->dnsaddr[0]) - ppp_notice("primary DNS address %I", go->dnsaddr[0]); - if (go->dnsaddr[1]) - ppp_notice("secondary DNS address %I", go->dnsaddr[1]); + if (go->dnsaddr[0]) + ppp_notice("primary DNS address %I", go->dnsaddr[0]); + if (go->dnsaddr[1]) + ppp_notice("secondary DNS address %I", go->dnsaddr[1]); #endif /* LWIP_DNS */ } @@ -2104,7 +2104,7 @@ static void ipcp_up(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_up_hook) - ip_up_hook(); + ip_up_hook(); #endif /* UNUSED */ } @@ -2133,11 +2133,11 @@ static void ipcp_down(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_down_hook) - ip_down_hook(); + ip_down_hook(); #endif /* UNUSED */ if (pcb->ipcp_is_up) { - pcb->ipcp_is_up = 0; - np_down(pcb, PPP_IP); + pcb->ipcp_is_up = 0; + np_down(pcb, PPP_IP); } #if VJ_SUPPORT sifvjcomp(pcb, 0, 0, 0); @@ -2145,8 +2145,8 @@ static void ipcp_down(fsm *f) { #if PPP_STATS_SUPPORT print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), - * because print_link_stats() sets link_stats_valid - * to 0 (zero) */ + * because print_link_stats() sets link_stats_valid + * to 0 (zero) */ #endif /* PPP_STATS_SUPPORT */ #if DEMAND_SUPPORT @@ -2155,18 +2155,18 @@ static void ipcp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); + sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_DROP); + sifnpmode(pcb, PPP_IP, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - sifdown(pcb); - ipcp_clear_addrs(pcb, go->ouraddr, - ho->hisaddr, 0); + sifdown(pcb); + ipcp_clear_addrs(pcb, go->ouraddr, + ho->hisaddr, 0); #if LWIP_DNS - cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #endif /* LWIP_DNS */ } } @@ -2181,8 +2181,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re #if 0 /* UNUSED - PROXY ARP */ if (pcb->proxy_arp_set) { - cifproxyarp(pcb, hisaddr); - pcb->proxy_arp_set = 0; + cifproxyarp(pcb, hisaddr); + pcb->proxy_arp_set = 0; } #endif /* UNUSED - PROXY ARP */ #if 0 /* UNUSED */ @@ -2195,8 +2195,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * is one saved by an sifdefaultroute with replacedefaultroute. */ if (!replacedefaultroute && pcb->default_route_set) { - cifdefaultroute(pcb, ouraddr, hisaddr); - pcb->default_route_set = 0; + cifdefaultroute(pcb, ouraddr, hisaddr); + pcb->default_route_set = 0; } #endif /* UNUSED */ cifaddr(pcb, ouraddr, hisaddr); @@ -2207,11 +2207,11 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * ipcp_finished - possibly shut down the lower layers. */ static void ipcp_finished(fsm *f) { - ppp_pcb *pcb = f->pcb; - if (pcb->ipcp_is_open) { - pcb->ipcp_is_open = 0; - np_finished(pcb, PPP_IP); - } + ppp_pcb *pcb = f->pcb; + if (pcb->ipcp_is_open) { + pcb->ipcp_is_open = 0; + np_finished(pcb, PPP_IP); + } } @@ -2237,7 +2237,7 @@ static const char* const ipcp_codenames[] = { }; static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #if VJ_SUPPORT @@ -2246,18 +2246,18 @@ static int ipcp_printpkt(const u_char *p, int plen, u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipcp_codenames)) - printer(arg, " %s", ipcp_codenames[code-1]); + printer(arg, " %s", ipcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2265,98 +2265,98 @@ static int ipcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_ADDRS: - if (olen == CILEN_ADDRS) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addrs %I", lwip_htonl(cilong)); - GETLONG(cilong, p); - printer(arg, " %I", lwip_htonl(cilong)); - } - break; + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_ADDRS: + if (olen == CILEN_ADDRS) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addrs %I", lwip_htonl(cilong)); + GETLONG(cilong, p); + printer(arg, " %I", lwip_htonl(cilong)); + } + break; #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - switch (cishort) { - case IPCP_VJ_COMP: - printer(arg, "VJ"); - break; - case IPCP_VJ_COMP_OLD: - printer(arg, "old-VJ"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + switch (cishort) { + case IPCP_VJ_COMP: + printer(arg, "VJ"); + break; + case IPCP_VJ_COMP_OLD: + printer(arg, "old-VJ"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* VJ_SUPPORT */ - case CI_ADDR: - if (olen == CILEN_ADDR) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addr %I", lwip_htonl(cilong)); - } - break; + case CI_ADDR: + if (olen == CILEN_ADDR) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addr %I", lwip_htonl(cilong)); + } + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), - htonl(cilong)); - break; + case CI_MS_DNS1: + case CI_MS_DNS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), + htonl(cilong)); + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-wins %I", lwip_htonl(cilong)); - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-wins %I", lwip_htonl(cilong)); + break; #endif /* UNUSED - WINS */ - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -2369,25 +2369,25 @@ static int ipcp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP_HDRLEN 20 /* bytes */ -#define IP_OFFMASK 0x1fff +#define IP_HDRLEN 20 /* bytes */ +#define IP_OFFMASK 0x1fff #ifndef IPPROTO_TCP -#define IPPROTO_TCP 6 +#define IPPROTO_TCP 6 #endif -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define net_short(x) (((x)[0] << 8) + (x)[1]) -#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) -#define get_ipoff(x) net_short((unsigned char *)(x) + 6) -#define get_ipproto(x) (((unsigned char *)(x))[9]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define net_short(x) (((x)[0] << 8) + (x)[1]) +#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) +#define get_ipoff(x) net_short((unsigned char *)(x) + 6) +#define get_ipproto(x) (((unsigned char *)(x))[9]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ip_active_pkt(pkt, len) @@ -2400,17 +2400,17 @@ ip_active_pkt(pkt, len) len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP_HDRLEN) - return 0; + return 0; if ((get_ipoff(pkt) & IP_OFFMASK) != 0) - return 0; + return 0; if (get_ipproto(pkt) != IPPROTO_TCP) - return 1; + return 1; hlen = get_iphl(pkt) * 4; if (len < hlen + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + hlen; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c b/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c index 47521eeb02..11c18df743 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ipv6cp.c @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -135,11 +135,11 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ + * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ */ /* - * @todo: + * @todo: * * Proxy Neighbour Discovery. * @@ -188,21 +188,21 @@ static void ipv6cp_down(fsm *f); /* We're DOWN */ static void ipv6cp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ - ipv6cp_resetci, /* Reset our Configuration Information */ - ipv6cp_cilen, /* Length of our Configuration Information */ - ipv6cp_addci, /* Add our Configuration Information */ - ipv6cp_ackci, /* ACK our Configuration Information */ - ipv6cp_nakci, /* NAK our Configuration Information */ - ipv6cp_rejci, /* Reject our Configuration Information */ - ipv6cp_reqci, /* Request peer's Configuration Information */ - ipv6cp_up, /* Called when fsm reaches OPENED state */ - ipv6cp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipv6cp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPV6CP" /* String name of protocol */ + ipv6cp_resetci, /* Reset our Configuration Information */ + ipv6cp_cilen, /* Length of our Configuration Information */ + ipv6cp_addci, /* Add our Configuration Information */ + ipv6cp_ackci, /* ACK our Configuration Information */ + ipv6cp_nakci, /* NAK our Configuration Information */ + ipv6cp_rejci, /* Reject our Configuration Information */ + ipv6cp_reqci, /* Request peer's Configuration Information */ + ipv6cp_up, /* Called when fsm reaches OPENED state */ + ipv6cp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipv6cp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPV6CP" /* String name of protocol */ }; #if PPP_OPTIONS @@ -211,7 +211,7 @@ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ */ static int setifaceid(char **arg)); static void printifaceid(option_t *, - void (*)(void *, char *, ...), void *)); + void (*)(void *, char *, ...), void *)); static option_t ipv6cp_option_list[] = { { "ipv6", o_special, (void *)setifaceid, @@ -265,7 +265,7 @@ static int ipv6_demand_conf(int u); #endif /* DEMAND_SUPPORT */ #if PRINTPKT_SUPPORT static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg); + void (*printer)(void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if DEMAND_SUPPORT static int ipv6_active_pkt(u_char *pkt, int len); @@ -309,12 +309,12 @@ static void ipv6cp_script_done(void *)); /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ -#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ +#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED */ /* @@ -344,49 +344,49 @@ setifaceid(argv) static int prio_local, prio_remote; #define VALIDID(a) ( (((a).s6_addr32[0] == 0) && ((a).s6_addr32[1] == 0)) && \ - (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) - + (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) + arg = *argv; if ((comma = strchr(arg, ',')) == NULL) - comma = arg + strlen(arg); - - /* + comma = arg + strlen(arg); + + /* * If comma first character, then no local identifier */ if (comma != arg) { - c = *comma; - *comma = '\0'; - - if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (local): %s", arg); - return 0; - } - - if (option_priority >= prio_local) { - eui64_copy(addr.s6_addr32[2], wo->ourid); - wo->opt_local = 1; - prio_local = option_priority; - } - *comma = c; + c = *comma; + *comma = '\0'; + + if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (local): %s", arg); + return 0; + } + + if (option_priority >= prio_local) { + eui64_copy(addr.s6_addr32[2], wo->ourid); + wo->opt_local = 1; + prio_local = option_priority; + } + *comma = c; } - + /* * If comma last character, the no remote identifier */ if (*comma != 0 && *++comma != '\0') { - if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (remote): %s", comma); - return 0; - } - if (option_priority >= prio_remote) { - eui64_copy(addr.s6_addr32[2], wo->hisid); - wo->opt_remote = 1; - prio_remote = option_priority; - } + if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (remote): %s", comma); + return 0; + } + if (option_priority >= prio_remote) { + eui64_copy(addr.s6_addr32[2], wo->hisid); + wo->opt_remote = 1; + prio_remote = option_priority; + } } if (override_value("+ipv6", option_priority, option_source)) - ipv6cp_protent.enabled_flag = 1; + ipv6cp_protent.enabled_flag = 1; return 1; } @@ -396,13 +396,13 @@ printifaceid(opt, printer, arg) void (*printer)(void *, char *, ...)); void *arg; { - ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; - if (wo->opt_local) - printer(arg, "%s", llv6_ntoa(wo->ourid)); - printer(arg, ","); - if (wo->opt_remote) - printer(arg, "%s", llv6_ntoa(wo->hisid)); + if (wo->opt_local) + printer(arg, "%s", llv6_ntoa(wo->ourid)); + printer(arg, ","); + if (wo->opt_remote) + printer(arg, "%s", llv6_ntoa(wo->hisid)); } #endif /* PPP_OPTIONS */ @@ -513,13 +513,13 @@ static void ipv6cp_resetci(fsm *f) { ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; wo->req_ifaceid = wo->neg_ifaceid && ao->neg_ifaceid; - + if (!wo->opt_local) { - eui64_magic_nz(wo->ourid); + eui64_magic_nz(wo->ourid); } - + *go = *wo; - eui64_zero(go->hisid); /* last proposed interface identifier */ + eui64_zero(go->hisid); /* last proposed interface identifier */ } @@ -531,15 +531,15 @@ static int ipv6cp_cilen(fsm *f) { ipv6cp_options *go = &pcb->ipv6cp_gotoptions; #ifdef IPV6CP_COMP -#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) +#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) #endif /* IPV6CP_COMP */ -#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) +#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) return (LENCIIFACEID(go->neg_ifaceid) + #ifdef IPV6CP_COMP - LENCIVJ(go->neg_vj) + + LENCIVJ(go->neg_vj) + #endif /* IPV6CP_COMP */ - 0); + 0); } @@ -554,27 +554,27 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { #ifdef IPV6CP_COMP #define ADDCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = CILEN_COMPRESS; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* IPV6CP_COMP */ #define ADDCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if (len >= idlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(idlen, ucp); \ - eui64_put(val1, ucp); \ - len -= idlen; \ - } else \ - neg = 0; \ + int idlen = CILEN_IFACEID; \ + if (len >= idlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(idlen, ucp); \ + eui64_put(val1, ucp); \ + len -= idlen; \ + } else \ + neg = 0; \ } ADDCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -591,8 +591,8 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { * ipv6cp_ackci - Ack our CIs. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -612,33 +612,33 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { #ifdef IPV6CP_COMP #define ACKCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + int vjlen = CILEN_COMPRESS; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #endif /* IPV6CP_COMP */ #define ACKCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if ((len -= idlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != idlen || \ - citype != opt) \ - goto bad; \ - eui64_get(ifaceid, p); \ - if (! eui64_equals(val1, ifaceid)) \ - goto bad; \ + int idlen = CILEN_IFACEID; \ + if ((len -= idlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != idlen || \ + citype != opt) \ + goto bad; \ + eui64_get(ifaceid, p); \ + if (! eui64_equals(val1, ifaceid)) \ + goto bad; \ } ACKCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -651,7 +651,7 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -665,8 +665,8 @@ bad: * or if IPV6CP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -676,8 +676,8 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options no; /* options we've seen Naks for */ - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options no; /* options we've seen Naks for */ + ipv6cp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -689,26 +689,26 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIIFACEID(opt, neg, code) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - no.neg = 1; \ - code \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + no.neg = 1; \ + code \ } #ifdef IPV6CP_COMP #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* IPV6CP_COMP */ @@ -718,27 +718,27 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIIFACEID(CI_IFACEID, neg_ifaceid, - if (treat_as_reject) { - try_.neg_ifaceid = 0; - } else if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); - } - ); + if (treat_as_reject) { + try_.neg_ifaceid = 0; + } else if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); + } + ); #ifdef IPV6CP_COMP NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - { - if (cishort == IPV6CP_COMP && !treat_as_reject) { - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + { + if (cishort == IPV6CP_COMP && !treat_as_reject) { + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* IPV6CP_COMP */ /* @@ -748,49 +748,49 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they want us to ask for compression, we refuse. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) - goto bad; - try_.neg_ifaceid = 1; - eui64_get(ifaceid, p); - if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - } - no.neg_ifaceid = 1; - break; - default: - break; - } - p = next; + case CI_IFACEID: + if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) + goto bad; + try_.neg_ifaceid = 1; + eui64_get(ifaceid, p); + if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + } + no.neg_ifaceid = 1; + break; + default: + break; + } + p = next; } /* If there is still anything left, this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * OK, the Nak is good. Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -811,7 +811,7 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options try_; /* options to request next time */ try_ = *go; /* @@ -821,31 +821,31 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIIFACEID(opt, neg, val1) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - /* Check rejected value. */ \ - if (! eui64_equals(ifaceid, val1)) \ - goto bad; \ - try_.neg = 0; \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + /* Check rejected value. */ \ + if (! eui64_equals(ifaceid, val1)) \ + goto bad; \ + try_.neg = 0; \ } #ifdef IPV6CP_COMP #define REJCIVJ(opt, neg, val) \ if (go->neg && \ - p[1] == CILEN_COMPRESS && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + p[1] == CILEN_COMPRESS && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* IPV6CP_COMP */ @@ -859,12 +859,12 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -890,150 +890,150 @@ static int ipv6cp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; ipv6cp_options *go = &pcb->ipv6cp_gotoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #ifdef IPV6CP_COMP - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* IPV6CP_COMP */ - eui64_t ifaceid; /* Parsed interface identifier */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + eui64_t ifaceid; /* Parsed interface identifier */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ /* * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_IFACEID: - IPV6CPDEBUG(("ipv6cp: received interface identifier ")); - - if (!ao->neg_ifaceid || - cilen != CILEN_IFACEID) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no interface identifier, or if we both have same - * identifier then NAK it with new idea. - * In particular, if we don't know his identifier, but he does, - * then accept it. - */ - eui64_get(ifaceid, p); - IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); - if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { - orc = CONFREJ; /* Reject CI */ - break; - } - if (!eui64_iszero(wo->hisid) && - !eui64_equals(ifaceid, wo->hisid) && - eui64_iszero(go->hisid)) { - - orc = CONFNAK; - ifaceid = wo->hisid; - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } else - if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { - orc = CONFNAK; - if (eui64_iszero(go->hisid)) /* first time, try option */ - ifaceid = wo->hisid; - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->ourid)) /* bad luck */ - eui64_magic(ifaceid); - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } - - ho->neg_ifaceid = 1; - ho->hisid = ifaceid; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_IFACEID: + IPV6CPDEBUG(("ipv6cp: received interface identifier ")); + + if (!ao->neg_ifaceid || + cilen != CILEN_IFACEID) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no interface identifier, or if we both have same + * identifier then NAK it with new idea. + * In particular, if we don't know his identifier, but he does, + * then accept it. + */ + eui64_get(ifaceid, p); + IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); + if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { + orc = CONFREJ; /* Reject CI */ + break; + } + if (!eui64_iszero(wo->hisid) && + !eui64_equals(ifaceid, wo->hisid) && + eui64_iszero(go->hisid)) { + + orc = CONFNAK; + ifaceid = wo->hisid; + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } else + if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { + orc = CONFNAK; + if (eui64_iszero(go->hisid)) /* first time, try option */ + ifaceid = wo->hisid; + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->ourid)) /* bad luck */ + eui64_magic(ifaceid); + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } + + ho->neg_ifaceid = 1; + ho->hisid = ifaceid; + break; #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); - if (!ao->neg_vj || - (cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - IPV6CPDEBUG(("(%d)", cishort)); - - if (!(cishort == IPV6CP_COMP)) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - break; + case CI_COMPRESSTYPE: + IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); + if (!ao->neg_vj || + (cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + IPV6CPDEBUG(("(%d)", cishort)); + + if (!(cishort == IPV6CP_COMP)) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + break; #endif /* IPV6CP_COMP */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); - - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); + + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1044,20 +1044,20 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_ifaceid && - wo->req_ifaceid && !reject_if_disagree) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_ifaceid = 0; /* don't ask again */ - } - PUTCHAR(CI_IFACEID, ucp); - PUTCHAR(CILEN_IFACEID, ucp); - eui64_put(wo->hisid, ucp); + wo->req_ifaceid && !reject_if_disagree) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_ifaceid = 0; /* don't ask again */ + } + PUTCHAR(CI_IFACEID, ucp); + PUTCHAR(CILEN_IFACEID, ucp); + eui64_put(wo->hisid, ucp); } - *len = ucp - inp; /* Compute output length */ + *len = ucp - inp; /* Compute output length */ IPV6CPDEBUG(("ipv6cp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } #if PPP_OPTIONS @@ -1069,7 +1069,7 @@ static void ipv6_check_options() { ipv6cp_options *wo = &ipv6cp_wantoptions[0]; if (!ipv6cp_protent.enabled_flag) - return; + return; /* * Persistent link-local id is only used when user has not explicitly @@ -1077,42 +1077,42 @@ static void ipv6_check_options() { */ if ((wo->use_persistent) && (!wo->opt_local) && (!wo->opt_remote)) { - /* - * On systems where there are no Ethernet interfaces used, there - * may be other ways to obtain a persistent id. Right now, it - * will fall back to using magic [see eui64_magic] below when - * an EUI-48 from MAC address can't be obtained. Other possibilities - * include obtaining EEPROM serial numbers, or some other unique - * yet persistent number. On Sparc platforms, this is possible, - * but too bad there's no standards yet for x86 machines. - */ - if (ether_to_eui64(&wo->ourid)) { - wo->opt_local = 1; - } - } - - if (!wo->opt_local) { /* init interface identifier */ - if (wo->use_ip && eui64_iszero(wo->ourid)) { - eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); - if (!eui64_iszero(wo->ourid)) - wo->opt_local = 1; + /* + * On systems where there are no Ethernet interfaces used, there + * may be other ways to obtain a persistent id. Right now, it + * will fall back to using magic [see eui64_magic] below when + * an EUI-48 from MAC address can't be obtained. Other possibilities + * include obtaining EEPROM serial numbers, or some other unique + * yet persistent number. On Sparc platforms, this is possible, + * but too bad there's no standards yet for x86 machines. + */ + if (ether_to_eui64(&wo->ourid)) { + wo->opt_local = 1; + } } - while (eui64_iszero(wo->ourid)) - eui64_magic(wo->ourid); + if (!wo->opt_local) { /* init interface identifier */ + if (wo->use_ip && eui64_iszero(wo->ourid)) { + eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); + if (!eui64_iszero(wo->ourid)) + wo->opt_local = 1; + } + + while (eui64_iszero(wo->ourid)) + eui64_magic(wo->ourid); } if (!wo->opt_remote) { - if (wo->use_ip && eui64_iszero(wo->hisid)) { - eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); - if (!eui64_iszero(wo->hisid)) - wo->opt_remote = 1; - } + if (wo->use_ip && eui64_iszero(wo->hisid)) { + eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); + if (!eui64_iszero(wo->hisid)) + wo->opt_remote = 1; + } } if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) { - option_error("local/remote LL address required for demand-dialling\n"); - exit(1); + option_error("local/remote LL address required for demand-dialling\n"); + exit(1); } } #endif /* PPP_OPTIONS */ @@ -1126,13 +1126,13 @@ static int ipv6_demand_conf(int u) { ipv6cp_options *wo = &ipv6cp_wantoptions[u]; if (!sif6up(u)) - return 0; + return 0; if (!sif6addr(u, wo->ourid, wo->hisid)) - return 0; + return 0; if (!sifnpmode(u, PPP_IPV6, NPMODE_QUEUE)) - return 0; + return 0; ppp_notice("ipv6_demand_conf"); ppp_notice("local LL address %s", llv6_ntoa(wo->ourid)); @@ -1160,26 +1160,26 @@ static void ipv6cp_up(fsm *f) { * We must have a non-zero LL address for both ends of the link. */ if (!ho->neg_ifaceid) - ho->hisid = wo->hisid; + ho->hisid = wo->hisid; #if 0 /* UNUSED */ if(!no_ifaceid_neg) { #endif /* UNUSED */ - if (eui64_iszero(ho->hisid)) { - ppp_error("Could not determine remote LL address"); - ipv6cp_close(f->pcb, "Could not determine remote LL address"); - return; - } - if (eui64_iszero(go->ourid)) { - ppp_error("Could not determine local LL address"); - ipv6cp_close(f->pcb, "Could not determine local LL address"); - return; - } - if (eui64_equals(go->ourid, ho->hisid)) { - ppp_error("local and remote LL addresses are equal"); - ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); - return; - } + if (eui64_iszero(ho->hisid)) { + ppp_error("Could not determine remote LL address"); + ipv6cp_close(f->pcb, "Could not determine remote LL address"); + return; + } + if (eui64_iszero(go->ourid)) { + ppp_error("Could not determine local LL address"); + ipv6cp_close(f->pcb, "Could not determine local LL address"); + return; + } + if (eui64_equals(go->ourid, ho->hisid)) { + ppp_error("local and remote LL addresses are equal"); + ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); + return; + } #if 0 /* UNUSED */ } #endif /* UNUSED */ @@ -1200,52 +1200,52 @@ static void ipv6cp_up(fsm *f) { * interface to pass IPv6 packets. */ if (demand) { - if (! eui64_equals(go->ourid, wo->ourid) || - ! eui64_equals(ho->hisid, wo->hisid)) { - if (! eui64_equals(go->ourid, wo->ourid)) - warn("Local LL address changed to %s", - llv6_ntoa(go->ourid)); - if (! eui64_equals(ho->hisid, wo->hisid)) - warn("Remote LL address changed to %s", - llv6_ntoa(ho->hisid)); - ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); - - /* Set the interface to the new addresses */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - if (debug) - warn("sif6addr failed"); - ipv6cp_close(f->unit, "Interface configuration failed"); - return; - } - - } - demand_rexmit(PPP_IPV6); - sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); + if (! eui64_equals(go->ourid, wo->ourid) || + ! eui64_equals(ho->hisid, wo->hisid)) { + if (! eui64_equals(go->ourid, wo->ourid)) + warn("Local LL address changed to %s", + llv6_ntoa(go->ourid)); + if (! eui64_equals(ho->hisid, wo->hisid)) + warn("Remote LL address changed to %s", + llv6_ntoa(ho->hisid)); + ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); + + /* Set the interface to the new addresses */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + if (debug) + warn("sif6addr failed"); + ipv6cp_close(f->unit, "Interface configuration failed"); + return; + } + + } + demand_rexmit(PPP_IPV6); + sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set LL addresses - */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } - - /* bring the interface up for IPv6 */ - if (!sif6up(f->pcb)) { - PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } + /* + * Set LL addresses + */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } + + /* bring the interface up for IPv6 */ + if (!sif6up(f->pcb)) { + PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ - ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); - ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); + ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); + ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); } np_up(f->pcb, PPP_IPV6); @@ -1254,11 +1254,11 @@ static void ipv6cp_up(fsm *f) { #if 0 /* UNUSED */ /* * Execute the ipv6-up script, like this: - * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL + * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL */ if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); } #endif /* UNUSED */ } @@ -1280,8 +1280,8 @@ static void ipv6cp_down(fsm *f) { update_link_stats(f->unit); #endif /* PPP_STATS_SUPPORT */ if (pcb->ipv6cp_is_up) { - pcb->ipv6cp_is_up = 0; - np_down(f->pcb, PPP_IPV6); + pcb->ipv6cp_is_up = 0; + np_down(f->pcb, PPP_IPV6); } #ifdef IPV6CP_COMP sif6comp(f->unit, 0); @@ -1293,24 +1293,24 @@ static void ipv6cp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - ipv6cp_clear_addrs(f->pcb, - go->ourid, - ho->hisid); - sif6down(f->pcb); + ipv6cp_clear_addrs(f->pcb, + go->ourid, + ho->hisid); + sif6down(f->pcb); } #if 0 /* UNUSED */ /* Execute the ipv6-down script */ if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); } #endif /* UNUSED */ } @@ -1345,17 +1345,17 @@ ipv6cp_script_done(arg) ipv6cp_script_pid = 0; switch (ipv6cp_script_state) { case s_up: - if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); - } - break; + if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); + } + break; case s_down: - if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); - } - break; + if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); + } + break; } } @@ -1385,7 +1385,7 @@ ipv6cp_script(script) argv[7] = NULL; ipv6cp_script_pid = run_program(script, argv, 0, ipv6cp_script_done, - NULL, 0); + NULL, 0); } #endif /* UNUSED */ @@ -1399,7 +1399,7 @@ static const char* const ipv6cp_codenames[] = { }; static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg) { + void (*printer)(void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #ifdef IPV6CP_COMP @@ -1408,18 +1408,18 @@ static int ipv6cp_printpkt(const u_char *p, int plen, eui64_t ifaceid; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipv6cp_codenames)) - printer(arg, " %s", ipv6cp_codenames[code-1]); + printer(arg, " %s", ipv6cp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -1427,63 +1427,63 @@ static int ipv6cp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - printer(arg, "0x%x", cishort); - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + printer(arg, "0x%x", cishort); + } + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (olen == CILEN_IFACEID) { - p += 2; - eui64_get(ifaceid, p); - printer(arg, "addr %s", llv6_ntoa(ifaceid)); - } - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + case CI_IFACEID: + if (olen == CILEN_IFACEID) { + p += 2; + eui64_get(ifaceid, p); + printer(arg, "addr %s", llv6_ntoa(ifaceid)); + } + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -1496,19 +1496,19 @@ static int ipv6cp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP6_HDRLEN 40 /* bytes */ -#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define IP6_HDRLEN 40 /* bytes */ +#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define get_ip6nh(x) (((unsigned char *)(x))[6]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define get_ip6nh(x) (((unsigned char *)(x))[6]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ipv6_active_pkt(u_char *pkt, int len) { u_char *tcp; @@ -1516,16 +1516,16 @@ static int ipv6_active_pkt(u_char *pkt, int len) { len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP6_HDRLEN) - return 0; + return 0; if (get_ip6nh(pkt) == IP6_NHDR_FRAG) - return 0; + return 0; if (get_ip6nh(pkt) != IPPROTO_TCP) - return 1; + return 1; if (len < IP6_HDRLEN + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + IP6_HDRLEN; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == IP6_HDRLEN + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/lcp.c b/components/net/lwip-2.0.2/src/netif/ppp/lcp.c index 040135637c..90ed183b75 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/lcp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/lcp.c @@ -68,7 +68,7 @@ * configure-requests. We do this by delaying the fsm_lowerup call. */ /* steal a bit in fsm flags word */ -#define DELAYED_UP 0x80 +#define DELAYED_UP 0x80 static void lcp_delayed_up(void *arg); @@ -76,8 +76,8 @@ static void lcp_delayed_up(void *arg); * LCP-related command-line options. */ #if 0 /* UNUSED */ -int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ -int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ +int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ +int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -88,10 +88,10 @@ static u_int lcp_echo_fails = LCP_MAXECHOFAILS; /* Tolerance to unanswer #if 0 /* UNUSED */ #if PPP_LCP_ADAPTIVE -bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ +bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ #endif -bool lax_recv = 0; /* accept control chars in asyncmap */ -bool noendpoint = 0; /* don't send/accept endpoint discriminator */ +bool lax_recv = 0; /* accept control chars in asyncmap */ +bool noendpoint = 0; /* don't send/accept endpoint discriminator */ #endif /* UNUSED */ #if PPP_OPTIONS @@ -101,7 +101,7 @@ static int noopt (char **); #ifdef HAVE_MULTILINK static int setendpoint (char **); static void printendpoint (option_t *, void (*)(void *, char *, ...), - void *); + void *); #endif /* HAVE_MULTILINK */ #if PPP_OPTIONS @@ -215,17 +215,17 @@ static option_t lcp_option_list[] = { /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void lcp_resetci(fsm *f); /* Reset our CI */ -static int lcp_cilen(fsm *f); /* Return length of our CI */ +static void lcp_resetci(fsm *f); /* Reset our CI */ +static int lcp_cilen(fsm *f); /* Return length of our CI */ static void lcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI to pkt */ static int lcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject); /* Peer nak'd our CI */ static int lcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree); /* Rcv peer CI */ -static void lcp_up(fsm *f); /* We're UP */ -static void lcp_down(fsm *f); /* We're DOWN */ -static void lcp_starting (fsm *); /* We need lower layer up */ -static void lcp_finished (fsm *); /* We need lower layer down */ +static void lcp_up(fsm *f); /* We're UP */ +static void lcp_down(fsm *f); /* We're DOWN */ +static void lcp_starting (fsm *); /* We need lower layer up */ +static void lcp_finished (fsm *); /* We need lower layer down */ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len); static void lcp_rprotrej(fsm *f, u_char *inp, int len); @@ -241,22 +241,22 @@ static void LcpSendEchoRequest(fsm *f); static void LcpLinkFailure(fsm *f); static void LcpEchoCheck(fsm *f); -static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ - lcp_resetci, /* Reset our Configuration Information */ - lcp_cilen, /* Length of our Configuration Information */ - lcp_addci, /* Add our Configuration Information */ - lcp_ackci, /* ACK our Configuration Information */ - lcp_nakci, /* NAK our Configuration Information */ - lcp_rejci, /* Reject our Configuration Information */ - lcp_reqci, /* Request peer's Configuration Information */ - lcp_up, /* Called when fsm reaches OPENED state */ - lcp_down, /* Called when fsm leaves OPENED state */ - lcp_starting, /* Called when we want the lower layer up */ - lcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - lcp_extcode, /* Called to handle LCP-specific codes */ - "LCP" /* String name of protocol */ +static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ + lcp_resetci, /* Reset our Configuration Information */ + lcp_cilen, /* Length of our Configuration Information */ + lcp_addci, /* Add our Configuration Information */ + lcp_ackci, /* ACK our Configuration Information */ + lcp_nakci, /* NAK our Configuration Information */ + lcp_rejci, /* Reject our Configuration Information */ + lcp_reqci, /* Request peer's Configuration Information */ + lcp_up, /* Called when fsm reaches OPENED state */ + lcp_down, /* Called when fsm leaves OPENED state */ + lcp_starting, /* Called when we want the lower layer up */ + lcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + lcp_extcode, /* Called to handle LCP-specific codes */ + "LCP" /* String name of protocol */ }; /* @@ -269,7 +269,7 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len); static void lcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ const struct protent lcp_protent = { @@ -304,20 +304,20 @@ const struct protent lcp_protent = { /* * Length of each type of configuration option (in octets) */ -#define CILEN_VOID 2 -#define CILEN_CHAR 3 -#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ +#define CILEN_VOID 2 +#define CILEN_CHAR 3 +#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ #if CHAP_SUPPORT -#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ +#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ #endif /* CHAP_SUPPORT */ -#define CILEN_LONG 6 /* CILEN_VOID + 4 */ +#define CILEN_LONG 6 /* CILEN_VOID + 4 */ #if LQR_SUPPORT -#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ +#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ #endif /* LQR_SUPPORT */ -#define CILEN_CBCP 3 +#define CILEN_CBCP 3 -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if PPP_OPTIONS /* @@ -340,8 +340,8 @@ setendpoint(argv) char **argv; { if (str_to_epdisc(&lcp_wantoptions[0].endpoint, *argv)) { - lcp_wantoptions[0].neg_endpoint = 1; - return 1; + lcp_wantoptions[0].neg_endpoint = 1; + return 1; } option_error("Can't parse '%s' as an endpoint discriminator", *argv); return 0; @@ -353,7 +353,7 @@ printendpoint(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); + printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); } #endif /* HAVE_MULTILINK */ @@ -409,9 +409,9 @@ void lcp_open(ppp_pcb *pcb) { f->flags &= ~(OPT_PASSIVE | OPT_SILENT); if (wo->passive) - f->flags |= OPT_PASSIVE; + f->flags |= OPT_PASSIVE; if (wo->silent) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -428,25 +428,25 @@ void lcp_close(ppp_pcb *pcb, const char *reason) { && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - new_phase(pcb, PPP_PHASE_TERMINATE); + new_phase(pcb, PPP_PHASE_TERMINATE); if (f->flags & DELAYED_UP) { - UNTIMEOUT(lcp_delayed_up, f); - f->state = PPP_FSM_STOPPED; + UNTIMEOUT(lcp_delayed_up, f); + f->state = PPP_FSM_STOPPED; } oldstate = f->state; fsm_close(f, reason); if (oldstate == PPP_FSM_STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP))) { - /* - * This action is not strictly according to the FSM in RFC1548, - * but it does mean that the program terminates if you do a - * lcp_close() when a connection hasn't been established - * because we are in passive/silent mode or because we have - * delayed the fsm_lowerup() call and it hasn't happened yet. - */ - f->flags &= ~DELAYED_UP; - lcp_finished(f); + /* + * This action is not strictly according to the FSM in RFC1548, + * but it does mean that the program terminates if you do a + * lcp_close() when a connection hasn't been established + * because we are in passive/silent mode or because we have + * delayed the fsm_lowerup() call and it hasn't happened yet. + */ + f->flags &= ~DELAYED_UP; + lcp_finished(f); } } @@ -463,16 +463,16 @@ void lcp_lowerup(ppp_pcb *pcb) { * if we are going to ask for A/C and protocol compression. */ if (ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), - wo->neg_pcompression, wo->neg_accompression) < 0) - return; + || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), + wo->neg_pcompression, wo->neg_accompression) < 0) + return; pcb->peer_mru = PPP_MRU; if (pcb->settings.listen_time != 0) { - f->flags |= DELAYED_UP; - TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); + f->flags |= DELAYED_UP; + TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); } else - fsm_lowerup(f); + fsm_lowerup(f); } @@ -483,10 +483,10 @@ void lcp_lowerdown(ppp_pcb *pcb) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); } else - fsm_lowerdown(f); + fsm_lowerdown(f); } @@ -497,8 +497,8 @@ static void lcp_delayed_up(void *arg) { fsm *f = (fsm*)arg; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + fsm_lowerup(f); } } @@ -510,9 +510,9 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); + fsm_lowerup(f); } fsm_input(f, p, len); } @@ -527,33 +527,33 @@ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len) { switch( code ){ case PROTREJ: - lcp_rprotrej(f, inp, len); - break; - + lcp_rprotrej(f, inp, len); + break; + case ECHOREQ: - if (f->state != PPP_FSM_OPENED) - break; - magp = inp; - PUTLONG(go->magicnumber, magp); - fsm_sdata(f, ECHOREP, id, inp, len); - break; - + if (f->state != PPP_FSM_OPENED) + break; + magp = inp; + PUTLONG(go->magicnumber, magp); + fsm_sdata(f, ECHOREP, id, inp, len); + break; + case ECHOREP: - lcp_received_echo_reply(f, id, inp, len); - break; + lcp_received_echo_reply(f, id, inp, len); + break; case DISCREQ: case IDENTIF: case TIMEREM: - break; + break; default: - return 0; + return 0; } return 1; } - + /* * lcp_rprotrej - Receive an Protocol-Reject. * @@ -568,8 +568,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { #endif /* PPP_PROTOCOLNAME */ if (len < 2) { - LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); - return; + LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); + return; } GETSHORT(prot, inp); @@ -579,8 +579,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * OPENED state SHOULD be silently discarded. */ if( f->state != PPP_FSM_OPENED ){ - LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); - return; + LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); + return; } #if PPP_PROTOCOLNAME @@ -591,25 +591,25 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * Upcall the proper Protocol-Reject routine. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol == prot) { + if (protp->protocol == prot) { #if PPP_PROTOCOLNAME - if (pname != NULL) - ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, - prot); - else + if (pname != NULL) + ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, + prot); + else #endif /* PPP_PROTOCOLNAME */ - ppp_dbglog("Protocol-Reject for 0x%x received", prot); - (*protp->protrej)(f->pcb); - return; - } + ppp_dbglog("Protocol-Reject for 0x%x received", prot); + (*protp->protrej)(f->pcb); + return; + } #if PPP_PROTOCOLNAME if (pname != NULL) - ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, - prot); + ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, + prot); else #endif /* #if PPP_PROTOCOLNAME */ - ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); + ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); } @@ -641,7 +641,7 @@ void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len) { #endif fsm_sdata(f, PROTREJ, ++f->id, - p, len); + p, len); } @@ -748,15 +748,15 @@ static void lcp_resetci(fsm *f) { *go = *wo; #ifdef HAVE_MULTILINK if (!multilink) { - go->neg_mrru = 0; + go->neg_mrru = 0; #endif /* HAVE_MULTILINK */ - go->neg_ssnhf = 0; - go->neg_endpoint = 0; + go->neg_ssnhf = 0; + go->neg_endpoint = 0; #ifdef HAVE_MULTILINK } #endif /* HAVE_MULTILINK */ if (pcb->settings.noendpoint) - ao->neg_endpoint = 0; + ao->neg_endpoint = 0; pcb->peer_mru = PPP_MRU; #if 0 /* UNUSED */ auth_reset(pcb); @@ -771,60 +771,60 @@ static int lcp_cilen(fsm *f) { ppp_pcb *pcb = f->pcb; lcp_options *go = &pcb->lcp_gotoptions; -#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) +#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) #if CHAP_SUPPORT -#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) +#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) #endif /* CHAP_SUPPORT */ -#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) -#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) +#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) +#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) #if LQR_SUPPORT -#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) +#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) #endif /* LQR_SUPPORT */ -#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) +#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) /* * NB: we only ask for one of CHAP, UPAP, or EAP, even if we will * accept more than one. We prefer EAP first, then CHAP, then * PAP. */ return (LENCISHORT(go->neg_mru && go->mru != PPP_DEFMRU) + - LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + + LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + #if EAP_SUPPORT - LENCISHORT(go->neg_eap) + + LENCISHORT(go->neg_eap) + #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT - LENCICHAP(!go->neg_eap && go->neg_chap) + + LENCICHAP(!go->neg_eap && go->neg_chap) + #endif /* EAP_SUPPORT */ #if !EAP_SUPPORT - LENCICHAP(go->neg_chap) + + LENCICHAP(go->neg_chap) + #endif /* !EAP_SUPPORT */ #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + #endif /* EAP_SUPPORT && CHAP_SUPPORT */ #if EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(!go->neg_eap && go->neg_upap) + + LENCISHORT(!go->neg_eap && go->neg_upap) + #endif /* EAP_SUPPORT && !CHAP_SUPPORT */ #if !EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_chap && go->neg_upap) + #endif /* !EAP_SUPPORT && CHAP_SUPPORT */ #if !EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(go->neg_upap) + + LENCISHORT(go->neg_upap) + #endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT - LENCILQR(go->neg_lqr) + + LENCILQR(go->neg_lqr) + #endif /* LQR_SUPPORT */ - LENCICBCP(go->neg_cbcp) + - LENCILONG(go->neg_magicnumber) + - LENCIVOID(go->neg_pcompression) + - LENCIVOID(go->neg_accompression) + + LENCICBCP(go->neg_cbcp) + + LENCILONG(go->neg_magicnumber) + + LENCIVOID(go->neg_pcompression) + + LENCIVOID(go->neg_accompression) + #ifdef HAVE_MULTILINK - LENCISHORT(go->neg_mrru) + + LENCISHORT(go->neg_mrru) + #endif /* HAVE_MULTILINK */ - LENCIVOID(go->neg_ssnhf) + - (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); + LENCIVOID(go->neg_ssnhf) + + (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); } @@ -838,58 +838,58 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIVOID(opt, neg) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_VOID, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_VOID, ucp); \ } #define ADDCISHORT(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_SHORT, ucp); \ - PUTSHORT(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_SHORT, ucp); \ + PUTSHORT(val, ucp); \ } #if CHAP_SUPPORT #define ADDCICHAP(opt, neg, val) \ if (neg) { \ - PUTCHAR((opt), ucp); \ - PUTCHAR(CILEN_CHAP, ucp); \ - PUTSHORT(PPP_CHAP, ucp); \ - PUTCHAR((CHAP_DIGEST(val)), ucp); \ + PUTCHAR((opt), ucp); \ + PUTCHAR(CILEN_CHAP, ucp); \ + PUTSHORT(PPP_CHAP, ucp); \ + PUTCHAR((CHAP_DIGEST(val)), ucp); \ } #endif /* CHAP_SUPPORT */ #define ADDCILONG(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LONG, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LONG, ucp); \ + PUTLONG(val, ucp); \ } #if LQR_SUPPORT #define ADDCILQR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LQR, ucp); \ - PUTSHORT(PPP_LQR, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LQR, ucp); \ + PUTSHORT(PPP_LQR, ucp); \ + PUTLONG(val, ucp); \ } #endif /* LQR_SUPPORT */ #define ADDCICHAR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR, ucp); \ - PUTCHAR(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR, ucp); \ + PUTCHAR(val, ucp); \ } #define ADDCIENDP(opt, neg, class, val, len) \ if (neg) { \ - int i; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR + len, ucp); \ - PUTCHAR(class, ucp); \ - for (i = 0; i < len; ++i) \ - PUTCHAR(val[i], ucp); \ + int i; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR + len, ucp); \ + PUTCHAR(class, ucp); \ + for (i = 0; i < len; ++i) \ + PUTCHAR(val[i], ucp); \ } ADDCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ADDCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -927,11 +927,11 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #endif ADDCIVOID(CI_SSNHF, go->neg_ssnhf); ADDCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); if (ucp - start_ucp != *lenp) { - /* this should never happen, because peer_mtu should be 1500 */ - ppp_error("Bug in lcp_addci: wrong length"); + /* this should never happen, because peer_mtu should be 1500 */ + ppp_error("Bug in lcp_addci: wrong length"); } } @@ -941,8 +941,8 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { * This should not modify any state if the Ack is bad. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int lcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -958,112 +958,112 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { */ #define ACKCIVOID(opt, neg) \ if (neg) { \ - if ((len -= CILEN_VOID) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || \ - citype != opt) \ - goto bad; \ + if ((len -= CILEN_VOID) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_VOID || \ + citype != opt) \ + goto bad; \ } #define ACKCISHORT(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_SHORT) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_SHORT || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + if ((len -= CILEN_SHORT) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_SHORT || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #define ACKCICHAR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != val) \ - goto bad; \ + if ((len -= CILEN_CHAR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != val) \ + goto bad; \ } #if CHAP_SUPPORT #define ACKCICHAP(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAP) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAP || \ - citype != (opt)) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_CHAP) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != (CHAP_DIGEST(val))) \ - goto bad; \ + if ((len -= CILEN_CHAP) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAP || \ + citype != (opt)) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_CHAP) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != (CHAP_DIGEST(val))) \ + goto bad; \ } #endif /* CHAP_SUPPORT */ #define ACKCILONG(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LONG) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LONG || \ - citype != opt) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LONG) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LONG || \ + citype != opt) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #if LQR_SUPPORT #define ACKCILQR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LQR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LQR || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_LQR) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LQR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LQR || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_LQR) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #endif /* LQR_SUPPORT */ #define ACKCIENDP(opt, neg, class, val, vlen) \ if (neg) { \ - int i; \ - if ((len -= CILEN_CHAR + vlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR + vlen || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ + int i; \ + if ((len -= CILEN_CHAR + vlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR + vlen || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ } ACKCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ACKCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -1101,13 +1101,13 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ ACKCIVOID(CI_SSNHF, go->neg_ssnhf); ACKCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: LCPDEBUG(("lcp_acki: received bad Ack!")); @@ -1121,8 +1121,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1131,8 +1131,8 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_char citype, cichar, *next; u_short cishort; u32_t cilong; - lcp_options no; /* options we've seen Naks for */ - lcp_options try_; /* options to request next time */ + lcp_options no; /* options we've seen Naks for */ + lcp_options try_; /* options to request next time */ int looped_back = 0; int cilen; @@ -1146,85 +1146,85 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + no.neg = 1; \ + try_.neg = 0; \ } #if CHAP_SUPPORT #define NAKCICHAP(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #endif /* CHAP_SUPPORT */ #define NAKCICHAR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[1] == CILEN_CHAR && \ - p[0] == opt) { \ - len -= CILEN_CHAR; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAR && \ + p[1] == CILEN_CHAR && \ + p[0] == opt) { \ + len -= CILEN_CHAR; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #define NAKCISHORT(opt, neg, code) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ - code \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ } #define NAKCILONG(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #if LQR_SUPPORT #define NAKCILQR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #endif /* LQR_SUPPORT */ #define NAKCIENDP(opt, neg) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[0] == opt && \ - p[1] >= CILEN_CHAR && \ - p[1] <= len) { \ - len -= p[1]; \ - INCPTR(p[1], p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_CHAR && \ + p[0] == opt && \ + p[1] >= CILEN_CHAR && \ + p[1] <= len) { \ + len -= p[1]; \ + INCPTR(p[1], p); \ + no.neg = 1; \ + try_.neg = 0; \ } /* @@ -1239,19 +1239,19 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the limit of the default MRU we'd get if we didn't negotiate. */ if (go->neg_mru && go->mru != PPP_DEFMRU) { - NAKCISHORT(CI_MRU, neg_mru, - if (cishort <= wo->mru || cishort <= PPP_DEFMRU) - try_.mru = cishort; - ); + NAKCISHORT(CI_MRU, neg_mru, + if (cishort <= wo->mru || cishort <= PPP_DEFMRU) + try_.mru = cishort; + ); } /* * Add any characters they want to our (receive-side) asyncmap. */ if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) { - NAKCILONG(CI_ASYNCMAP, neg_asyncmap, - try_.asyncmap = go->asyncmap | cilong; - ); + NAKCILONG(CI_ASYNCMAP, neg_asyncmap, + try_.asyncmap = go->asyncmap | cilong; + ); } /* @@ -1270,125 +1270,125 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_eap #endif /* EAP_SUPPORT */ ) - && len >= CILEN_SHORT - && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { - cilen = p[1]; - len -= cilen; + && len >= CILEN_SHORT + && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { + cilen = p[1]; + len -= cilen; #if CHAP_SUPPORT - no.neg_chap = go->neg_chap; + no.neg_chap = go->neg_chap; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - no.neg_upap = go->neg_upap; + no.neg_upap = go->neg_upap; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - no.neg_eap = go->neg_eap; + no.neg_eap = go->neg_eap; #endif /* EAP_SUPPORT */ - INCPTR(2, p); - GETSHORT(cishort, p); + INCPTR(2, p); + GETSHORT(cishort, p); #if PAP_SUPPORT - if (cishort == PPP_PAP && cilen == CILEN_SHORT) { + if (cishort == PPP_PAP && cilen == CILEN_SHORT) { #if EAP_SUPPORT - /* If we were asking for EAP, then we need to stop that. */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* If we were asking for EAP, then we need to stop that. */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - /* If we were asking for CHAP, then we need to stop that. */ - if (go->neg_chap) - try_.neg_chap = 0; - else + /* If we were asking for CHAP, then we need to stop that. */ + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ - /* - * If we weren't asking for CHAP or EAP, then we were asking for - * PAP, in which case this Nak is bad. - */ - goto bad; - } else + /* + * If we weren't asking for CHAP or EAP, then we were asking for + * PAP, in which case this Nak is bad. + */ + goto bad; + } else #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { - GETCHAR(cichar, p); + if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { + GETCHAR(cichar, p); #if EAP_SUPPORT - /* Stop asking for EAP, if we were. */ - if (go->neg_eap) { - try_.neg_eap = 0; - /* Try to set up to use their suggestion, if possible */ - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else + /* Stop asking for EAP, if we were. */ + if (go->neg_eap) { + try_.neg_eap = 0; + /* Try to set up to use their suggestion, if possible */ + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else #endif /* EAP_SUPPORT */ - if (go->neg_chap) { - /* - * We were asking for our preferred algorithm, they must - * want something different. - */ - if (cichar != CHAP_DIGEST(go->chap_mdtype)) { - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { - /* Use their suggestion if we support it ... */ - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else { - /* ... otherwise, try our next-preferred algorithm. */ - try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); - if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ - try_.neg_chap = 0; - } - } else { - /* - * Whoops, they Nak'd our algorithm of choice - * but then suggested it back to us. - */ - goto bad; - } - } else { - /* - * Stop asking for PAP if we were asking for it. - */ + if (go->neg_chap) { + /* + * We were asking for our preferred algorithm, they must + * want something different. + */ + if (cichar != CHAP_DIGEST(go->chap_mdtype)) { + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { + /* Use their suggestion if we support it ... */ + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else { + /* ... otherwise, try our next-preferred algorithm. */ + try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); + if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ + try_.neg_chap = 0; + } + } else { + /* + * Whoops, they Nak'd our algorithm of choice + * but then suggested it back to us. + */ + goto bad; + } + } else { + /* + * Stop asking for PAP if we were asking for it. + */ #if PAP_SUPPORT - try_.neg_upap = 0; + try_.neg_upap = 0; #endif /* PAP_SUPPORT */ - } + } - } else + } else #endif /* CHAP_SUPPORT */ - { + { #if EAP_SUPPORT - /* - * If we were asking for EAP, and they're Conf-Naking EAP, - * well, that's just strange. Nobody should do that. - */ - if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) - ppp_dbglog("Unexpected Conf-Nak for EAP"); - - /* - * We don't recognize what they're suggesting. - * Stop asking for what we were asking for. - */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* + * If we were asking for EAP, and they're Conf-Naking EAP, + * well, that's just strange. Nobody should do that. + */ + if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) + ppp_dbglog("Unexpected Conf-Nak for EAP"); + + /* + * We don't recognize what they're suggesting. + * Stop asking for what we were asking for. + */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (go->neg_chap) - try_.neg_chap = 0; - else + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) - try_.neg_upap = 0; - else + if(1) + try_.neg_upap = 0; + else #endif /* PAP_SUPPORT */ - {} + {} - p += cilen - CILEN_SHORT; - } + p += cilen - CILEN_SHORT; + } } #if LQR_SUPPORT @@ -1398,11 +1398,11 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they Nak the reporting period, take their value XXX ? */ NAKCILQR(CI_QUALITY, neg_lqr, - if (cishort != PPP_LQR) - try_.neg_lqr = 0; - else - try_.lqr_period = cilong; - ); + if (cishort != PPP_LQR) + try_.neg_lqr = 0; + else + try_.lqr_period = cilong; + ); #endif /* LQR_SUPPORT */ /* @@ -1417,9 +1417,9 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * Check for a looped-back line. */ NAKCILONG(CI_MAGICNUMBER, neg_magicnumber, - try_.magicnumber = magic(); - looped_back = 1; - ); + try_.magicnumber = magic(); + looped_back = 1; + ); /* * Peer shouldn't send Nak for protocol compression or @@ -1435,12 +1435,12 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * than the one we want. */ if (go->neg_mrru) { - NAKCISHORT(CI_MRRU, neg_mrru, - if (treat_as_reject) - try_.neg_mrru = 0; - else if (cishort <= wo->mrru) - try_.mrru = cishort; - ); + NAKCISHORT(CI_MRRU, neg_mrru, + if (treat_as_reject) + try_.neg_mrru = 0; + else if (cishort <= wo->mrru) + try_.mrru = cishort; + ); } #else /* HAVE_MULTILINK */ LWIP_UNUSED_ARG(treat_as_reject); @@ -1475,30 +1475,30 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * negotiate some option we don't support, so ignore it. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if (cilen < CILEN_VOID || (len -= cilen) < 0) - goto bad; - next = p + cilen - 2; - - switch (citype) { - case CI_MRU: - if ((go->neg_mru && go->mru != PPP_DEFMRU) - || no.neg_mru || cilen != CILEN_SHORT) - goto bad; - GETSHORT(cishort, p); - if (cishort < PPP_DEFMRU) { - try_.neg_mru = 1; - try_.mru = cishort; - } - break; - case CI_ASYNCMAP: - if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) - || no.neg_asyncmap || cilen != CILEN_LONG) - goto bad; - break; - case CI_AUTHTYPE: - if (0 + GETCHAR(citype, p); + GETCHAR(cilen, p); + if (cilen < CILEN_VOID || (len -= cilen) < 0) + goto bad; + next = p + cilen - 2; + + switch (citype) { + case CI_MRU: + if ((go->neg_mru && go->mru != PPP_DEFMRU) + || no.neg_mru || cilen != CILEN_SHORT) + goto bad; + GETSHORT(cishort, p); + if (cishort < PPP_DEFMRU) { + try_.neg_mru = 1; + try_.mru = cishort; + } + break; + case CI_ASYNCMAP: + if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + || no.neg_asyncmap || cilen != CILEN_LONG) + goto bad; + break; + case CI_AUTHTYPE: + if (0 #if CHAP_SUPPORT || go->neg_chap || no.neg_chap #endif /* CHAP_SUPPORT */ @@ -1506,51 +1506,51 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_upap || no.neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap || no.neg_eap + || go->neg_eap || no.neg_eap #endif /* EAP_SUPPORT */ - ) - goto bad; - break; - case CI_MAGICNUMBER: - if (go->neg_magicnumber || no.neg_magicnumber || - cilen != CILEN_LONG) - goto bad; - break; - case CI_PCOMPRESSION: - if (go->neg_pcompression || no.neg_pcompression - || cilen != CILEN_VOID) - goto bad; - break; - case CI_ACCOMPRESSION: - if (go->neg_accompression || no.neg_accompression - || cilen != CILEN_VOID) - goto bad; - break; + ) + goto bad; + break; + case CI_MAGICNUMBER: + if (go->neg_magicnumber || no.neg_magicnumber || + cilen != CILEN_LONG) + goto bad; + break; + case CI_PCOMPRESSION: + if (go->neg_pcompression || no.neg_pcompression + || cilen != CILEN_VOID) + goto bad; + break; + case CI_ACCOMPRESSION: + if (go->neg_accompression || no.neg_accompression + || cilen != CILEN_VOID) + goto bad; + break; #if LQR_SUPPORT - case CI_QUALITY: - if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) - goto bad; - break; + case CI_QUALITY: + if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) + goto bad; + break; #endif /* LQR_SUPPORT */ #ifdef HAVE_MULTILINK - case CI_MRRU: - if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) - goto bad; - break; + case CI_MRRU: + if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) + goto bad; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) - goto bad; - try_.neg_ssnhf = 1; - break; - case CI_EPDISC: - if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) - goto bad; - break; - default: - break; - } - p = next; + case CI_SSNHF: + if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) + goto bad; + try_.neg_ssnhf = 1; + break; + case CI_EPDISC: + if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) + goto bad; + break; + default: + break; + } + p = next; } /* @@ -1558,15 +1558,15 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any options left we ignore them. */ if (f->state != PPP_FSM_OPENED) { - if (looped_back) { - if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { - ppp_notice("Serial line is looped back."); - pcb->err_code = PPPERR_LOOPBACK; - lcp_close(f->pcb, "Loopback detected"); - } - } else - try_.numloops = 0; - *go = try_; + if (looped_back) { + if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { + ppp_notice("Serial line is looped back."); + pcb->err_code = PPPERR_LOOPBACK; + lcp_close(f->pcb, "Loopback detected"); + } + } else + try_.numloops = 0; + *go = try_; } return 1; @@ -1583,8 +1583,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Reject was bad. - * 1 - Reject was good. + * 0 - Reject was bad. + * 1 - Reject was good. */ static int lcp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -1592,7 +1592,7 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { u_char cichar; u_short cishort; u32_t cilong; - lcp_options try_; /* options to request next time */ + lcp_options try_; /* options to request next time */ try_ = *go; @@ -1603,157 +1603,157 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + try_.neg = 0; \ } #define REJCISHORT(opt, neg, val) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #if CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT */ #define REJCILONG(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LQR_SUPPORT #define REJCILQR(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cishort != PPP_LQR || cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cishort != PPP_LQR || cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LQR_SUPPORT */ #define REJCICBCP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CBCP && \ - p[1] == CILEN_CBCP && \ - p[0] == opt) { \ - len -= CILEN_CBCP; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if (cichar != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CBCP && \ + p[1] == CILEN_CBCP && \ + p[0] == opt) { \ + len -= CILEN_CBCP; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if (cichar != val) \ + goto bad; \ + try_.neg = 0; \ } #define REJCIENDP(opt, neg, class, val, vlen) \ if (go->neg && \ - len >= CILEN_CHAR + vlen && \ - p[0] == opt && \ - p[1] == CILEN_CHAR + vlen) { \ - int i; \ - len -= CILEN_CHAR + vlen; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ - try_.neg = 0; \ + len >= CILEN_CHAR + vlen && \ + p[0] == opt && \ + p[1] == CILEN_CHAR + vlen) { \ + int i; \ + len -= CILEN_CHAR + vlen; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ + try_.neg = 0; \ } REJCISHORT(CI_MRU, neg_mru, go->mru); @@ -1763,14 +1763,14 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { if (!go->neg_eap) { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); - if (!go->neg_chap) { + REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); + if (!go->neg_chap) { #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); + REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - } + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT } @@ -1787,18 +1787,18 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ REJCIVOID(CI_SSNHF, neg_ssnhf); REJCIENDP(CI_EPDISC, neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1822,17 +1822,17 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { lcp_options *go = &pcb->lcp_gotoptions; lcp_options *ho = &pcb->lcp_hisoptions; lcp_options *ao = &pcb->lcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - int cilen, citype, cichar; /* Parsed len, type, char value */ - u_short cishort; /* Parsed short value */ - u32_t cilong; /* Parse long value */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *rejp; /* Pointer to next char in reject frame */ + u_char *cip, *next; /* Pointer to current and next CIs */ + int cilen, citype, cichar; /* Parsed len, type, char value */ + u_short cishort; /* Parsed short value */ + u32_t cilong; /* Parse long value */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *rejp; /* Pointer to next char in reject frame */ struct pbuf *nakp; /* Nak buffer */ - u_char *nakoutp; /* Pointer to next char in Nak frame */ - int l = *lenp; /* Length left */ + u_char *nakoutp; /* Pointer to next char in Nak frame */ + int l = *lenp; /* Length left */ /* * Reset all his options. @@ -1854,403 +1854,403 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { nakoutp = (u_char*)nakp->payload; rejp = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - LCPDEBUG(("lcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - citype = 0; - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_MRU: - if (!ao->neg_mru || /* Allow option? */ - cilen != CILEN_SHORT) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETSHORT(cishort, p); /* Parse MRU */ - - /* - * He must be able to receive at least our minimum. - * No need to check a maximum. If he sends a large number, - * we'll just ignore it. - */ - if (cishort < PPP_MINMRU) { - orc = CONFNAK; /* Nak CI */ - PUTCHAR(CI_MRU, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ - break; - } - ho->neg_mru = 1; /* Remember he sent MRU */ - ho->mru = cishort; /* And remember value */ - break; - - case CI_ASYNCMAP: - if (!ao->neg_asyncmap || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * Asyncmap must have set at least the bits - * which are set in lcp_allowoptions[unit].asyncmap. - */ - if ((ao->asyncmap & ~cilong) != 0) { - orc = CONFNAK; - PUTCHAR(CI_ASYNCMAP, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(ao->asyncmap | cilong, nakoutp); - break; - } - ho->neg_asyncmap = 1; - ho->asyncmap = cilong; - break; - - case CI_AUTHTYPE: - if (cilen < CILEN_SHORT || - !(0 + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + LCPDEBUG(("lcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + citype = 0; + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_MRU: + if (!ao->neg_mru || /* Allow option? */ + cilen != CILEN_SHORT) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETSHORT(cishort, p); /* Parse MRU */ + + /* + * He must be able to receive at least our minimum. + * No need to check a maximum. If he sends a large number, + * we'll just ignore it. + */ + if (cishort < PPP_MINMRU) { + orc = CONFNAK; /* Nak CI */ + PUTCHAR(CI_MRU, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ + break; + } + ho->neg_mru = 1; /* Remember he sent MRU */ + ho->mru = cishort; /* And remember value */ + break; + + case CI_ASYNCMAP: + if (!ao->neg_asyncmap || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * Asyncmap must have set at least the bits + * which are set in lcp_allowoptions[unit].asyncmap. + */ + if ((ao->asyncmap & ~cilong) != 0) { + orc = CONFNAK; + PUTCHAR(CI_ASYNCMAP, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(ao->asyncmap | cilong, nakoutp); + break; + } + ho->neg_asyncmap = 1; + ho->asyncmap = cilong; + break; + + case CI_AUTHTYPE: + if (cilen < CILEN_SHORT || + !(0 #if PAP_SUPPORT - || ao->neg_upap + || ao->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || ao->neg_chap + || ao->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ao->neg_eap + || ao->neg_eap #endif /* EAP_SUPPORT */ - )) { - /* - * Reject the option if we're not willing to authenticate. - */ - ppp_dbglog("No auth is possible"); - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - /* - * Authtype must be PAP, CHAP, or EAP. - * - * Note: if more than one of ao->neg_upap, ao->neg_chap, and - * ao->neg_eap are set, and the peer sends a Configure-Request - * with two or more authenticate-protocol requests, then we will - * reject the second request. - * Whether we end up doing CHAP, UPAP, or EAP depends then on - * the ordering of the CIs in the peer's Configure-Request. + )) { + /* + * Reject the option if we're not willing to authenticate. + */ + ppp_dbglog("No auth is possible"); + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + /* + * Authtype must be PAP, CHAP, or EAP. + * + * Note: if more than one of ao->neg_upap, ao->neg_chap, and + * ao->neg_eap are set, and the peer sends a Configure-Request + * with two or more authenticate-protocol requests, then we will + * reject the second request. + * Whether we end up doing CHAP, UPAP, or EAP depends then on + * the ordering of the CIs in the peer's Configure-Request. */ #if PAP_SUPPORT - if (cishort == PPP_PAP) { - /* we've already accepted CHAP or EAP */ - if (0 + if (cishort == PPP_PAP) { + /* we've already accepted CHAP or EAP */ + if (0 #if CHAP_SUPPORT - || ho->neg_chap + || ho->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ho->neg_eap + || ho->neg_eap #endif /* EAP_SUPPORT */ - || cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_upap) { /* we don't want to do PAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + || cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_upap) { /* we don't want to do PAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else { + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - } + } #endif /* EAP_SUPPORT */ - break; - } - ho->neg_upap = 1; - break; - } + break; + } + ho->neg_upap = 1; + break; + } #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP) { - /* we've already accepted PAP or EAP */ - if ( + if (cishort == PPP_CHAP) { + /* we've already accepted PAP or EAP */ + if ( #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - ho->neg_eap || + ho->neg_eap || #endif /* EAP_SUPPORT */ - cilen != CILEN_CHAP) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_chap) { /* we don't want to do CHAP */ - orc = CONFNAK; /* NAK it and suggest EAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); + cilen != CILEN_CHAP) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_chap) { /* we don't want to do CHAP */ + orc = CONFNAK; /* NAK it and suggest EAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTSHORT(PPP_PAP, nakoutp); - } - else + if(1) { + PUTSHORT(PPP_PAP, nakoutp); + } + else #endif /* PAP_SUPPORT */ - {} - break; - } - GETCHAR(cichar, p); /* get digest type */ - if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { - /* - * We can't/won't do the requested type, - * suggest something else. - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - break; - } - ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ - ho->neg_chap = 1; - break; - } + {} + break; + } + GETCHAR(cichar, p); /* get digest type */ + if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { + /* + * We can't/won't do the requested type, + * suggest something else. + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + break; + } + ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ + ho->neg_chap = 1; + break; + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - if (cishort == PPP_EAP) { - /* we've already accepted CHAP or PAP */ - if ( + if (cishort == PPP_EAP) { + /* we've already accepted CHAP or PAP */ + if ( #if CHAP_SUPPORT - ho->neg_chap || + ho->neg_chap || #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ - cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_eap) { /* we don't want to do EAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_eap) { /* we don't want to do EAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; - } - ho->neg_eap = 1; - break; - } + {} + break; + } + ho->neg_eap = 1; + break; + } #endif /* EAP_SUPPORT */ - /* - * We don't recognize the protocol they're asking for. - * Nak it with something we're willing to do. - * (At this point we know ao->neg_upap || ao->neg_chap || - * ao->neg_eap.) - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); + /* + * We don't recognize the protocol they're asking for. + * Nak it with something we're willing to do. + * (At this point we know ao->neg_upap || ao->neg_chap || + * ao->neg_eap.) + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; + {} + break; #if LQR_SUPPORT - case CI_QUALITY: - if (!ao->neg_lqr || - cilen != CILEN_LQR) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - GETLONG(cilong, p); - - /* - * Check the protocol and the reporting period. - * XXX When should we Nak this, and what with? - */ - if (cishort != PPP_LQR) { - orc = CONFNAK; - PUTCHAR(CI_QUALITY, nakoutp); - PUTCHAR(CILEN_LQR, nakoutp); - PUTSHORT(PPP_LQR, nakoutp); - PUTLONG(ao->lqr_period, nakoutp); - break; - } - break; + case CI_QUALITY: + if (!ao->neg_lqr || + cilen != CILEN_LQR) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + GETLONG(cilong, p); + + /* + * Check the protocol and the reporting period. + * XXX When should we Nak this, and what with? + */ + if (cishort != PPP_LQR) { + orc = CONFNAK; + PUTCHAR(CI_QUALITY, nakoutp); + PUTCHAR(CILEN_LQR, nakoutp); + PUTSHORT(PPP_LQR, nakoutp); + PUTLONG(ao->lqr_period, nakoutp); + break; + } + break; #endif /* LQR_SUPPORT */ - case CI_MAGICNUMBER: - if (!(ao->neg_magicnumber || go->neg_magicnumber) || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * He must have a different magic number. - */ - if (go->neg_magicnumber && - cilong == go->magicnumber) { - cilong = magic(); /* Don't put magic() inside macro! */ - orc = CONFNAK; - PUTCHAR(CI_MAGICNUMBER, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(cilong, nakoutp); - break; - } - ho->neg_magicnumber = 1; - ho->magicnumber = cilong; - break; - - - case CI_PCOMPRESSION: - if (!ao->neg_pcompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_pcompression = 1; - break; - - case CI_ACCOMPRESSION: - if (!ao->neg_accompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_accompression = 1; - break; + case CI_MAGICNUMBER: + if (!(ao->neg_magicnumber || go->neg_magicnumber) || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * He must have a different magic number. + */ + if (go->neg_magicnumber && + cilong == go->magicnumber) { + cilong = magic(); /* Don't put magic() inside macro! */ + orc = CONFNAK; + PUTCHAR(CI_MAGICNUMBER, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(cilong, nakoutp); + break; + } + ho->neg_magicnumber = 1; + ho->magicnumber = cilong; + break; + + + case CI_PCOMPRESSION: + if (!ao->neg_pcompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_pcompression = 1; + break; + + case CI_ACCOMPRESSION: + if (!ao->neg_accompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_accompression = 1; + break; #ifdef HAVE_MULTILINK - case CI_MRRU: - if (!ao->neg_mrru - || !multilink - || cilen != CILEN_SHORT) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - /* possibly should insist on a minimum/maximum MRRU here */ - ho->neg_mrru = 1; - ho->mrru = cishort; - break; + case CI_MRRU: + if (!ao->neg_mrru + || !multilink + || cilen != CILEN_SHORT) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + /* possibly should insist on a minimum/maximum MRRU here */ + ho->neg_mrru = 1; + ho->mrru = cishort; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (!ao->neg_ssnhf + case CI_SSNHF: + if (!ao->neg_ssnhf #ifdef HAVE_MULTILINK - || !multilink + || !multilink #endif /* HAVE_MULTILINK */ - || cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_ssnhf = 1; - break; - - case CI_EPDISC: - if (!ao->neg_endpoint || - cilen < CILEN_CHAR || - cilen > CILEN_CHAR + MAX_ENDP_LEN) { - orc = CONFREJ; - break; - } - GETCHAR(cichar, p); - cilen -= CILEN_CHAR; - ho->neg_endpoint = 1; - ho->endpoint.class_ = cichar; - ho->endpoint.length = cilen; - MEMCPY(ho->endpoint.value, p, cilen); - INCPTR(cilen, p); - break; - - default: - LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); - orc = CONFREJ; - break; - } + || cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_ssnhf = 1; + break; + + case CI_EPDISC: + if (!ao->neg_endpoint || + cilen < CILEN_CHAR || + cilen > CILEN_CHAR + MAX_ENDP_LEN) { + orc = CONFREJ; + break; + } + GETCHAR(cichar, p); + cilen -= CILEN_CHAR; + ho->neg_endpoint = 1; + ho->endpoint.class_ = cichar; + ho->endpoint.length = cilen; + MEMCPY(ho->endpoint.value, p, cilen); + INCPTR(cilen, p); + break; + + default: + LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree /* Getting fed up with sending NAKs? */ - && citype != CI_MAGICNUMBER) { - orc = CONFREJ; /* Get tough if so */ - } else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - rc = CONFNAK; - } - } - if (orc == CONFREJ) { /* Reject this CI */ - rc = CONFREJ; - if (cip != rejp) /* Need to move rejected CI? */ - MEMCPY(rejp, cip, cilen); /* Move it */ - INCPTR(cilen, rejp); /* Update output pointer */ - } + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree /* Getting fed up with sending NAKs? */ + && citype != CI_MAGICNUMBER) { + orc = CONFREJ; /* Get tough if so */ + } else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + rc = CONFNAK; + } + } + if (orc == CONFREJ) { /* Reject this CI */ + rc = CONFREJ; + if (cip != rejp) /* Need to move rejected CI? */ + MEMCPY(rejp, cip, cilen); /* Move it */ + INCPTR(cilen, rejp); /* Update output pointer */ + } } /* @@ -2262,25 +2262,25 @@ endswitch: switch (rc) { case CONFACK: - *lenp = next - inp; - break; + *lenp = next - inp; + break; case CONFNAK: - /* - * Copy the Nak'd options from the nak buffer to the caller's buffer. - */ - *lenp = nakoutp - (u_char*)nakp->payload; - MEMCPY(inp, nakp->payload, *lenp); - break; + /* + * Copy the Nak'd options from the nak buffer to the caller's buffer. + */ + *lenp = nakoutp - (u_char*)nakp->payload; + MEMCPY(inp, nakp->payload, *lenp); + break; case CONFREJ: - *lenp = rejp - inp; - break; + *lenp = rejp - inp; + break; default: - break; + break; } pbuf_free(nakp); LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -2296,9 +2296,9 @@ static void lcp_up(fsm *f) { int mtu, mru; if (!go->neg_magicnumber) - go->magicnumber = 0; + go->magicnumber = 0; if (!ho->neg_magicnumber) - ho->magicnumber = 0; + ho->magicnumber = 0; /* * Set our MTU to the smaller of the MTU we wanted and @@ -2314,16 +2314,16 @@ static void lcp_up(fsm *f) { #ifdef HAVE_MULTILINK if (!(multilink && go->neg_mrru && ho->neg_mrru)) #endif /* HAVE_MULTILINK */ - netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); + netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); ppp_send_config(pcb, mtu, - (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), - ho->neg_pcompression, ho->neg_accompression); + (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), + ho->neg_pcompression, ho->neg_accompression); ppp_recv_config(pcb, mru, - (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); if (ho->neg_mru) - pcb->peer_mru = ho->mru; + pcb->peer_mru = ho->mru; lcp_echo_lowerup(f->pcb); /* Enable echo messages */ @@ -2346,8 +2346,8 @@ static void lcp_down(fsm *f) { ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0); ppp_recv_config(pcb, PPP_MRU, - (go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); pcb->peer_mru = PPP_MRU; } @@ -2382,25 +2382,25 @@ static const char* const lcp_codenames[] = { }; static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen, i; const u_char *pstart, *optend; u_short cishort; u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(lcp_codenames)) - printer(arg, " %s", lcp_codenames[code-1]); + printer(arg, " %s", lcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2408,224 +2408,224 @@ static int lcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_MRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mru %d", cishort); - } - break; - case CI_ASYNCMAP: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "asyncmap 0x%x", cilong); - } - break; - case CI_AUTHTYPE: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "auth "); - GETSHORT(cishort, p); - switch (cishort) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_MRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mru %d", cishort); + } + break; + case CI_ASYNCMAP: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "asyncmap 0x%x", cilong); + } + break; + case CI_AUTHTYPE: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "auth "); + GETSHORT(cishort, p); + switch (cishort) { #if PAP_SUPPORT - case PPP_PAP: - printer(arg, "pap"); - break; + case PPP_PAP: + printer(arg, "pap"); + break; #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - case PPP_CHAP: - printer(arg, "chap"); - if (p < optend) { - switch (*p) { - case CHAP_MD5: - printer(arg, " MD5"); - ++p; - break; + case PPP_CHAP: + printer(arg, "chap"); + if (p < optend) { + switch (*p) { + case CHAP_MD5: + printer(arg, " MD5"); + ++p; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - printer(arg, " MS"); - ++p; - break; - - case CHAP_MICROSOFT_V2: - printer(arg, " MS-v2"); - ++p; - break; + case CHAP_MICROSOFT: + printer(arg, " MS"); + ++p; + break; + + case CHAP_MICROSOFT_V2: + printer(arg, " MS-v2"); + ++p; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - } - break; + default: + break; + } + } + break; #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - case PPP_EAP: - printer(arg, "eap"); - break; + case PPP_EAP: + printer(arg, "eap"); + break; #endif /* EAP_SUPPORT */ - default: - printer(arg, "0x%x", cishort); - } - } - break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #if LQR_SUPPORT - case CI_QUALITY: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "quality "); - GETSHORT(cishort, p); - switch (cishort) { - case PPP_LQR: - printer(arg, "lqr"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_QUALITY: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "quality "); + GETSHORT(cishort, p); + switch (cishort) { + case PPP_LQR: + printer(arg, "lqr"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* LQR_SUPPORT */ - case CI_CALLBACK: - if (olen >= CILEN_CHAR) { - p += 2; - printer(arg, "callback "); - GETCHAR(cishort, p); - switch (cishort) { - case CBCP_OPT: - printer(arg, "CBCP"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_MAGICNUMBER: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "magic 0x%x", cilong); - } - break; - case CI_PCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "pcomp"); - } - break; - case CI_ACCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "accomp"); - } - break; - case CI_MRRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mrru %d", cishort); - } - break; - case CI_SSNHF: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "ssnhf"); - } - break; - case CI_EPDISC: + case CI_CALLBACK: + if (olen >= CILEN_CHAR) { + p += 2; + printer(arg, "callback "); + GETCHAR(cishort, p); + switch (cishort) { + case CBCP_OPT: + printer(arg, "CBCP"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; + case CI_MAGICNUMBER: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "magic 0x%x", cilong); + } + break; + case CI_PCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "pcomp"); + } + break; + case CI_ACCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "accomp"); + } + break; + case CI_MRRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mrru %d", cishort); + } + break; + case CI_SSNHF: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "ssnhf"); + } + break; + case CI_EPDISC: #ifdef HAVE_MULTILINK - if (olen >= CILEN_CHAR) { - struct epdisc epd; - p += 2; - GETCHAR(epd.class, p); - epd.length = olen - CILEN_CHAR; - if (epd.length > MAX_ENDP_LEN) - epd.length = MAX_ENDP_LEN; - if (epd.length > 0) { - MEMCPY(epd.value, p, epd.length); - p += epd.length; - } - printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); - } + if (olen >= CILEN_CHAR) { + struct epdisc epd; + p += 2; + GETCHAR(epd.class, p); + epd.length = olen - CILEN_CHAR; + if (epd.length > MAX_ENDP_LEN) + epd.length = MAX_ENDP_LEN; + if (epd.length > 0) { + MEMCPY(epd.value, p, epd.length); + p += epd.length; + } + printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); + } #else - printer(arg, "endpoint"); + printer(arg, "endpoint"); #endif - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; case ECHOREQ: case ECHOREP: case DISCREQ: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + break; case IDENTIF: case TIMEREM: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - if (code == TIMEREM) { - if (len < 4) - break; - GETLONG(cilong, p); - printer(arg, " seconds=%u", cilong); - len -= 4; - } - if (len > 0) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + if (code == TIMEREM) { + if (len < 4) + break; + GETLONG(cilong, p); + printer(arg, " seconds=%u", cilong); + len -= 4; + } + if (len > 0) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (i = 0; i < len && i < 32; ++i) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } if (i < len) { - printer(arg, " ..."); - p += len - i; + printer(arg, " ..."); + p += len - i; } return p - pstart; @@ -2639,10 +2639,10 @@ static int lcp_printpkt(const u_char *p, int plen, static void LcpLinkFailure(fsm *f) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED) { - ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); + ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); ppp_notice("Serial link appears to be disconnected."); - pcb->err_code = PPPERR_PEERDEAD; - lcp_close(pcb, "Peer not responding"); + pcb->err_code = PPPERR_PEERDEAD; + lcp_close(pcb, "Peer not responding"); } } @@ -2655,13 +2655,13 @@ static void LcpEchoCheck(fsm *f) { LcpSendEchoRequest (f); if (f->state != PPP_FSM_OPENED) - return; + return; /* * Start the timer for the next interval. */ if (pcb->lcp_echo_timer_running) - ppp_warn("assertion lcp_echo_timer_running==0 failed"); + ppp_warn("assertion lcp_echo_timer_running==0 failed"); TIMEOUT (LcpEchoTimeout, f, pcb->settings.lcp_echo_interval); pcb->lcp_echo_timer_running = 1; } @@ -2691,14 +2691,14 @@ static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) { /* Check the magic number - don't count replies from ourselves. */ if (len < 4) { - ppp_dbglog("lcp: received short Echo-Reply, length %d", len); - return; + ppp_dbglog("lcp: received short Echo-Reply, length %d", len); + return; } GETLONG(magic_val, inp); if (go->neg_magicnumber - && magic_val == go->magicnumber) { - ppp_warn("appear to have received our own echo-reply!"); - return; + && magic_val == go->magicnumber) { + ppp_warn("appear to have received our own echo-reply!"); + return; } /* Reset the number of outstanding echo frames */ @@ -2722,7 +2722,7 @@ static void LcpSendEchoRequest(fsm *f) { if (pcb->lcp_echos_pending >= pcb->settings.lcp_echo_fails) { LcpLinkFailure(f); pcb->lcp_echos_pending = 0; - } + } } #if PPP_LCP_ADAPTIVE @@ -2731,17 +2731,17 @@ static void LcpSendEchoRequest(fsm *f) { * no traffic was received since the last one. */ if (pcb->settings.lcp_echo_adaptive) { - static unsigned int last_pkts_in = 0; + static unsigned int last_pkts_in = 0; #if PPP_STATS_SUPPORT - update_link_stats(f->unit); - link_stats_valid = 0; + update_link_stats(f->unit); + link_stats_valid = 0; #endif /* PPP_STATS_SUPPORT */ - if (link_stats.pkts_in != last_pkts_in) { - last_pkts_in = link_stats.pkts_in; - return; - } + if (link_stats.pkts_in != last_pkts_in) { + last_pkts_in = link_stats.pkts_in; + return; + } } #endif @@ -2750,10 +2750,10 @@ static void LcpSendEchoRequest(fsm *f) { */ if (f->state == PPP_FSM_OPENED) { lcp_magic = go->magicnumber; - pktp = pkt; - PUTLONG(lcp_magic, pktp); + pktp = pkt; + PUTLONG(lcp_magic, pktp); fsm_sdata(f, ECHOREQ, pcb->lcp_echo_number++, pkt, pktp - pkt); - ++pcb->lcp_echos_pending; + ++pcb->lcp_echos_pending; } } @@ -2768,7 +2768,7 @@ static void lcp_echo_lowerup(ppp_pcb *pcb) { pcb->lcp_echos_pending = 0; pcb->lcp_echo_number = 0; pcb->lcp_echo_timer_running = 0; - + /* If a timeout interval is specified then start the timer */ if (pcb->settings.lcp_echo_interval != 0) LcpEchoCheck (f); diff --git a/components/net/lwip-2.0.2/src/netif/ppp/mppe.c b/components/net/lwip-2.0.2/src/netif/ppp/mppe.c index 5cab8a407e..331039f8ed 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/mppe.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/mppe.c @@ -39,20 +39,20 @@ #define SHA1_SIGNATURE_SIZE 20 /* ppp_mppe_state.bits definitions */ -#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ -#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ -#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ -#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ +#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ +#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ +#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ +#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ -#define MPPE_BIT_FLUSHED MPPE_BIT_A -#define MPPE_BIT_ENCRYPTED MPPE_BIT_D +#define MPPE_BIT_FLUSHED MPPE_BIT_A +#define MPPE_BIT_ENCRYPTED MPPE_BIT_D #define MPPE_BITS(p) ((p)[0] & 0xf0) #define MPPE_CCOUNT(p) ((((p)[0] & 0x0f) << 8) + (p)[1]) -#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ +#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ -#define MPPE_OVHD 2 /* MPPE overhead/packet */ -#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ +#define MPPE_OVHD 2 /* MPPE overhead/packet */ +#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ /* * Perform the MPPE rekey algorithm, from RFC 3078, sec. 7.3. @@ -60,37 +60,37 @@ */ static void mppe_rekey(ppp_mppe_state * state, int initial_key) { - lwip_sha1_context sha1_ctx; - u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; - - /* - * Key Derivation, from RFC 3078, RFC 3079. - * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. - */ - lwip_sha1_init(&sha1_ctx); - lwip_sha1_starts(&sha1_ctx); - lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); - lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); - lwip_sha1_finish(&sha1_ctx, sha1_digest); - lwip_sha1_free(&sha1_ctx); - MEMCPY(state->session_key, sha1_digest, state->keylen); - - if (!initial_key) { - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); - lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); - lwip_arc4_free(&state->arc4); - } - if (state->keylen == 8) { - /* See RFC 3078 */ - state->session_key[0] = 0xd1; - state->session_key[1] = 0x26; - state->session_key[2] = 0x9e; - } - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); + lwip_sha1_context sha1_ctx; + u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; + + /* + * Key Derivation, from RFC 3078, RFC 3079. + * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. + */ + lwip_sha1_init(&sha1_ctx); + lwip_sha1_starts(&sha1_ctx); + lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1_ctx, sha1_digest); + lwip_sha1_free(&sha1_ctx); + MEMCPY(state->session_key, sha1_digest, state->keylen); + + if (!initial_key) { + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); + lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); + lwip_arc4_free(&state->arc4); + } + if (state->keylen == 8) { + /* See RFC 3078 */ + state->session_key[0] = 0xd1; + state->session_key[1] = 0x26; + state->session_key[2] = 0x9e; + } + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); } /* @@ -98,8 +98,8 @@ static void mppe_rekey(ppp_mppe_state * state, int initial_key) * don't have to keep multiple copies of keys. */ void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key) { - LWIP_UNUSED_ARG(pcb); - MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); + LWIP_UNUSED_ARG(pcb); + MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); } /* @@ -109,64 +109,64 @@ void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) { #if PPP_DEBUG - const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; - if (&pcb->mppe_decomp == state) { - debugstr = (const u8_t*)"mppe_decomp_init"; - } + const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; + if (&pcb->mppe_decomp == state) { + debugstr = (const u8_t*)"mppe_decomp_init"; + } #endif /* PPP_DEBUG */ - /* Save keys. */ - MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); - - if (options & MPPE_OPT_128) - state->keylen = 16; - else if (options & MPPE_OPT_40) - state->keylen = 8; - else { - PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, - pcb->netif->num)); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - return; - } - if (options & MPPE_OPT_STATEFUL) - state->stateful = 1; - - /* Generate the initial session key. */ - mppe_rekey(state, 1); + /* Save keys. */ + MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); + + if (options & MPPE_OPT_128) + state->keylen = 16; + else if (options & MPPE_OPT_40) + state->keylen = 8; + else { + PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, + pcb->netif->num)); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + return; + } + if (options & MPPE_OPT_STATEFUL) + state->stateful = 1; + + /* Generate the initial session key. */ + mppe_rekey(state, 1); #if PPP_DEBUG - { - int i; - char mkey[sizeof(state->master_key) * 2 + 1]; - char skey[sizeof(state->session_key) * 2 + 1]; - - PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", - debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, - (state->stateful) ? "stateful" : "stateless")); - - for (i = 0; i < (int)sizeof(state->master_key); i++) - sprintf(mkey + i * 2, "%02x", state->master_key[i]); - for (i = 0; i < (int)sizeof(state->session_key); i++) - sprintf(skey + i * 2, "%02x", state->session_key[i]); - PPPDEBUG(LOG_DEBUG, - ("%s[%d]: keys: master: %s initial session: %s\n", - debugstr, pcb->netif->num, mkey, skey)); - } + { + int i; + char mkey[sizeof(state->master_key) * 2 + 1]; + char skey[sizeof(state->session_key) * 2 + 1]; + + PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", + debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, + (state->stateful) ? "stateful" : "stateless")); + + for (i = 0; i < (int)sizeof(state->master_key); i++) + sprintf(mkey + i * 2, "%02x", state->master_key[i]); + for (i = 0; i < (int)sizeof(state->session_key); i++) + sprintf(skey + i * 2, "%02x", state->session_key[i]); + PPPDEBUG(LOG_DEBUG, + ("%s[%d]: keys: master: %s initial session: %s\n", + debugstr, pcb->netif->num, mkey, skey)); + } #endif /* PPP_DEBUG */ - /* - * Initialize the coherency count. The initial value is not specified - * in RFC 3078, but we can make a reasonable assumption that it will - * start at 0. Setting it to the max here makes the comp/decomp code - * do the right thing (determined through experiment). - */ - state->ccount = MPPE_CCOUNT_SPACE - 1; - - /* - * Note that even though we have initialized the key table, we don't - * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. - */ - state->bits = MPPE_BIT_ENCRYPTED; + /* + * Initialize the coherency count. The initial value is not specified + * in RFC 3078, but we can make a reasonable assumption that it will + * start at 0. Setting it to the max here makes the comp/decomp code + * do the right thing (determined through experiment). + */ + state->ccount = MPPE_CCOUNT_SPACE - 1; + + /* + * Note that even though we have initialized the key table, we don't + * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. + */ + state->bits = MPPE_BIT_ENCRYPTED; } /* @@ -180,8 +180,8 @@ mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) */ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - state->bits |= MPPE_BIT_FLUSHED; + LWIP_UNUSED_ARG(pcb); + state->bits |= MPPE_BIT_FLUSHED; } /* @@ -192,74 +192,74 @@ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol) { - struct pbuf *n, *np; - u8_t *pl; - err_t err; - - LWIP_UNUSED_ARG(pcb); - - /* TCP stack requires that we don't change the packet payload, therefore we copy - * the whole packet before encryption. - */ - np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_POOL); - if (!np) { - return ERR_MEM; - } - - /* Hide MPPE header + protocol */ - pbuf_header(np, -(s16_t)(MPPE_OVHD + sizeof(protocol))); - - if ((err = pbuf_copy(np, *pb)) != ERR_OK) { - pbuf_free(np); - return err; - } - - /* Reveal MPPE header + protocol */ - pbuf_header(np, (s16_t)(MPPE_OVHD + sizeof(protocol))); - - *pb = np; - pl = (u8_t*)np->payload; - - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); - /* FIXME: use PUT* macros */ - pl[0] = state->ccount>>8; - pl[1] = state->ccount; - - if (!state->stateful || /* stateless mode */ - ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ - (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ - /* We must rekey */ - if (state->stateful) { - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); - } - mppe_rekey(state, 0); - state->bits |= MPPE_BIT_FLUSHED; - } - pl[0] |= state->bits; - state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ - pl += MPPE_OVHD; - - /* Add protocol */ - /* FIXME: add PFC support */ - pl[0] = protocol >> 8; - pl[1] = protocol; - - /* Hide MPPE header */ - pbuf_header(np, -(s16_t)MPPE_OVHD); - - /* Encrypt packet */ - for (n = np; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* Reveal MPPE header */ - pbuf_header(np, (s16_t)MPPE_OVHD); - - return ERR_OK; + struct pbuf *n, *np; + u8_t *pl; + err_t err; + + LWIP_UNUSED_ARG(pcb); + + /* TCP stack requires that we don't change the packet payload, therefore we copy + * the whole packet before encryption. + */ + np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_POOL); + if (!np) { + return ERR_MEM; + } + + /* Hide MPPE header + protocol */ + pbuf_header(np, -(s16_t)(MPPE_OVHD + sizeof(protocol))); + + if ((err = pbuf_copy(np, *pb)) != ERR_OK) { + pbuf_free(np); + return err; + } + + /* Reveal MPPE header + protocol */ + pbuf_header(np, (s16_t)(MPPE_OVHD + sizeof(protocol))); + + *pb = np; + pl = (u8_t*)np->payload; + + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); + /* FIXME: use PUT* macros */ + pl[0] = state->ccount>>8; + pl[1] = state->ccount; + + if (!state->stateful || /* stateless mode */ + ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ + (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ + /* We must rekey */ + if (state->stateful) { + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); + } + mppe_rekey(state, 0); + state->bits |= MPPE_BIT_FLUSHED; + } + pl[0] |= state->bits; + state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ + pl += MPPE_OVHD; + + /* Add protocol */ + /* FIXME: add PFC support */ + pl[0] = protocol >> 8; + pl[1] = protocol; + + /* Hide MPPE header */ + pbuf_header(np, -(s16_t)MPPE_OVHD); + + /* Encrypt packet */ + for (n = np; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* Reveal MPPE header */ + pbuf_header(np, (s16_t)MPPE_OVHD); + + return ERR_OK; } /* @@ -267,9 +267,9 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto */ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - LWIP_UNUSED_ARG(state); - return; + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(state); + return; } /* @@ -278,135 +278,135 @@ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb) { - struct pbuf *n0 = *pb, *n; - u8_t *pl; - u16_t ccount; - u8_t flushed; - - /* MPPE Header */ - if (n0->len < MPPE_OVHD) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: short pkt (%d)\n", - pcb->netif->num, n0->len)); - state->sanity_errors += 100; - goto sanity_error; - } - - pl = (u8_t*)n0->payload; - flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; - ccount = MPPE_CCOUNT(pl); - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", - pcb->netif->num, ccount)); - - /* sanity checks -- terminate with extreme prejudice */ - if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", - pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (!state->stateful && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " - "stateless mode!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " - "flag packet!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - - /* - * Check the coherency count. - */ - - if (!state->stateful) { - /* Discard late packet */ - if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { - state->sanity_errors++; - goto sanity_error; - } - - /* RFC 3078, sec 8.1. Rekey for every packet. */ - while (state->ccount != ccount) { - mppe_rekey(state, 0); - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - } - } else { - /* RFC 3078, sec 8.2. */ - if (!state->discard) { - /* normal state */ - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - if (ccount != state->ccount) { - /* - * (ccount > state->ccount) - * Packet loss detected, enter the discard state. - * Signal the peer to rekey (by sending a CCP Reset-Request). - */ - state->discard = 1; - ccp_resetrequest(pcb); - return ERR_BUF; - } - } else { - /* discard state */ - if (!flushed) { - /* ccp.c will be silent (no additional CCP Reset-Requests). */ - return ERR_BUF; - } else { - /* Rekey for every missed "flag" packet. */ - while ((ccount & ~0xff) != - (state->ccount & ~0xff)) { - mppe_rekey(state, 0); - state->ccount = - (state->ccount + - 256) % MPPE_CCOUNT_SPACE; - } - - /* reset */ - state->discard = 0; - state->ccount = ccount; - /* - * Another problem with RFC 3078 here. It implies that the - * peer need not send a Reset-Ack packet. But RFC 1962 - * requires it. Hopefully, M$ does send a Reset-Ack; even - * though it isn't required for MPPE synchronization, it is - * required to reset CCP state. - */ - } - } - if (flushed) - mppe_rekey(state, 0); - } - - /* Hide MPPE header */ - pbuf_header(n0, -(s16_t)(MPPE_OVHD)); - - /* Decrypt the packet. */ - for (n = n0; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* good packet credit */ - state->sanity_errors >>= 1; - - return ERR_OK; + struct pbuf *n0 = *pb, *n; + u8_t *pl; + u16_t ccount; + u8_t flushed; + + /* MPPE Header */ + if (n0->len < MPPE_OVHD) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: short pkt (%d)\n", + pcb->netif->num, n0->len)); + state->sanity_errors += 100; + goto sanity_error; + } + + pl = (u8_t*)n0->payload; + flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; + ccount = MPPE_CCOUNT(pl); + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", + pcb->netif->num, ccount)); + + /* sanity checks -- terminate with extreme prejudice */ + if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", + pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (!state->stateful && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " + "stateless mode!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " + "flag packet!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + + /* + * Check the coherency count. + */ + + if (!state->stateful) { + /* Discard late packet */ + if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { + state->sanity_errors++; + goto sanity_error; + } + + /* RFC 3078, sec 8.1. Rekey for every packet. */ + while (state->ccount != ccount) { + mppe_rekey(state, 0); + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + } + } else { + /* RFC 3078, sec 8.2. */ + if (!state->discard) { + /* normal state */ + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + if (ccount != state->ccount) { + /* + * (ccount > state->ccount) + * Packet loss detected, enter the discard state. + * Signal the peer to rekey (by sending a CCP Reset-Request). + */ + state->discard = 1; + ccp_resetrequest(pcb); + return ERR_BUF; + } + } else { + /* discard state */ + if (!flushed) { + /* ccp.c will be silent (no additional CCP Reset-Requests). */ + return ERR_BUF; + } else { + /* Rekey for every missed "flag" packet. */ + while ((ccount & ~0xff) != + (state->ccount & ~0xff)) { + mppe_rekey(state, 0); + state->ccount = + (state->ccount + + 256) % MPPE_CCOUNT_SPACE; + } + + /* reset */ + state->discard = 0; + state->ccount = ccount; + /* + * Another problem with RFC 3078 here. It implies that the + * peer need not send a Reset-Ack packet. But RFC 1962 + * requires it. Hopefully, M$ does send a Reset-Ack; even + * though it isn't required for MPPE synchronization, it is + * required to reset CCP state. + */ + } + } + if (flushed) + mppe_rekey(state, 0); + } + + /* Hide MPPE header */ + pbuf_header(n0, -(s16_t)(MPPE_OVHD)); + + /* Decrypt the packet. */ + for (n = n0; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* good packet credit */ + state->sanity_errors >>= 1; + + return ERR_OK; sanity_error: - if (state->sanity_errors >= SANITY_MAX) { - /* - * Take LCP down if the peer is sending too many bogons. - * We don't want to do this for a single or just a few - * instances since it could just be due to packet corruption. - */ - lcp_close(pcb, "Too many MPPE errors"); - } - return ERR_BUF; + if (state->sanity_errors >= SANITY_MAX) { + /* + * Take LCP down if the peer is sending too many bogons. + * We don't want to do this for a single or just a few + * instances since it could just be due to packet corruption. + */ + lcp_close(pcb, "Too many MPPE errors"); + } + return ERR_BUF; } #endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/multilink.c b/components/net/lwip-2.0.2/src/netif/ppp/multilink.c index 08e8130d48..62014e8c87 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/multilink.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/multilink.c @@ -55,11 +55,11 @@ #include "netif/ppp/lcp.h" #include "netif/ppp/tdb.h" -bool endpoint_specified; /* user gave explicit endpoint discriminator */ -char *bundle_id; /* identifier for our bundle */ -char *blinks_id; /* key for the list of links */ -bool doing_multilink; /* multilink was enabled and agreed to */ -bool multilink_master; /* we own the multilink bundle */ +bool endpoint_specified; /* user gave explicit endpoint discriminator */ +char *bundle_id; /* identifier for our bundle */ +char *blinks_id; /* key for the list of links */ +bool doing_multilink; /* multilink was enabled and agreed to */ +bool multilink_master; /* we own the multilink bundle */ extern TDB_CONTEXT *pppdb; extern char db_key[]; @@ -72,43 +72,43 @@ static int get_default_epdisc (struct epdisc *); static int parse_num (char *str, const char *key, int *valp); static int owns_unit (TDB_DATA pid, int unit); -#define set_ip_epdisc(ep, addr) do { \ - ep->length = 4; \ - ep->value[0] = addr >> 24; \ - ep->value[1] = addr >> 16; \ - ep->value[2] = addr >> 8; \ - ep->value[3] = addr; \ +#define set_ip_epdisc(ep, addr) do { \ + ep->length = 4; \ + ep->value[0] = addr >> 24; \ + ep->value[1] = addr >> 16; \ + ep->value[2] = addr >> 8; \ + ep->value[3] = addr; \ } while (0) -#define LOCAL_IP_ADDR(addr) \ - (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ - || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ - || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ +#define LOCAL_IP_ADDR(addr) \ + (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ + || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ + || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ -#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) +#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) void mp_check_options() { - lcp_options *wo = &lcp_wantoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - - doing_multilink = 0; - if (!multilink) - return; - /* if we're doing multilink, we have to negotiate MRRU */ - if (!wo->neg_mrru) { - /* mrru not specified, default to mru */ - wo->mrru = wo->mru; - wo->neg_mrru = 1; - } - ao->mrru = ao->mru; - ao->neg_mrru = 1; - - if (!wo->neg_endpoint && !noendpoint) { - /* get a default endpoint value */ - wo->neg_endpoint = get_default_epdisc(&wo->endpoint); - } + lcp_options *wo = &lcp_wantoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + + doing_multilink = 0; + if (!multilink) + return; + /* if we're doing multilink, we have to negotiate MRRU */ + if (!wo->neg_mrru) { + /* mrru not specified, default to mru */ + wo->mrru = wo->mru; + wo->neg_mrru = 1; + } + ao->mrru = ao->mru; + ao->neg_mrru = 1; + + if (!wo->neg_endpoint && !noendpoint) { + /* get a default endpoint value */ + wo->neg_endpoint = get_default_epdisc(&wo->endpoint); + } } /* @@ -118,289 +118,289 @@ mp_check_options() int mp_join_bundle() { - lcp_options *go = &lcp_gotoptions[0]; - lcp_options *ho = &lcp_hisoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - int unit, pppd_pid; - int l, mtu; - char *p; - TDB_DATA key, pid, rec; - - if (doing_multilink) { - /* have previously joined a bundle */ - if (!go->neg_mrru || !ho->neg_mrru) { - notice("oops, didn't get multilink on renegotiation"); - lcp_close(pcb, "multilink required"); - return 0; - } - /* XXX should check the peer_authname and ho->endpoint - are the same as previously */ - return 0; - } - - if (!go->neg_mrru || !ho->neg_mrru) { - /* not doing multilink */ - if (go->neg_mrru) - notice("oops, multilink negotiated only for receive"); - mtu = ho->neg_mru? ho->mru: PPP_MRU; - if (mtu > ao->mru) - mtu = ao->mru; - if (demand) { - /* already have a bundle */ - cfg_bundle(0, 0, 0, 0); - netif_set_mtu(pcb, mtu); - return 0; - } - make_new_bundle(0, 0, 0, 0); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - return 0; - } - - doing_multilink = 1; - - /* - * Find the appropriate bundle or join a new one. - * First we make up a name for the bundle. - * The length estimate is worst-case assuming every - * character has to be quoted. - */ - l = 4 * strlen(peer_authname) + 10; - if (ho->neg_endpoint) - l += 3 * ho->endpoint.length + 8; - if (bundle_name) - l += 3 * strlen(bundle_name) + 2; - bundle_id = malloc(l); - if (bundle_id == 0) - novm("bundle identifier"); - - p = bundle_id; - p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); - if (ho->neg_endpoint || bundle_name) - *p++ = '/'; - if (ho->neg_endpoint) - p += slprintf(p, bundle_id+l-p, "%s", - epdisc_to_str(&ho->endpoint)); - if (bundle_name) - p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); - - /* Make the key for the list of links belonging to the bundle */ - l = p - bundle_id; - blinks_id = malloc(l + 7); - if (blinks_id == NULL) - novm("bundle links key"); - slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); - - /* - * For demand mode, we only need to configure the bundle - * and attach the link. - */ - mtu = LWIP_MIN(ho->mrru, ao->mru); - if (demand) { - cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - return 0; - } - - /* - * Check if the bundle ID is already in the database. - */ - unit = -1; - lock_db(); - key.dptr = bundle_id; - key.dsize = p - bundle_id; - pid = tdb_fetch(pppdb, key); - if (pid.dptr != NULL) { - /* bundle ID exists, see if the pppd record exists */ - rec = tdb_fetch(pppdb, pid); - if (rec.dptr != NULL && rec.dsize > 0) { - /* make sure the string is null-terminated */ - rec.dptr[rec.dsize-1] = 0; - /* parse the interface number */ - parse_num(rec.dptr, "IFNAME=ppp", &unit); - /* check the pid value */ - if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) - || !process_exists(pppd_pid) - || !owns_unit(pid, unit)) - unit = -1; - free(rec.dptr); - } - free(pid.dptr); - } - - if (unit >= 0) { - /* attach to existing unit */ - if (bundle_attach(unit)) { - set_ifunit(0); - script_setenv("BUNDLE", bundle_id + 7, 0); - make_bundle_links(1); - unlock_db(); - info("Link attached to %s", ifname); - return 1; - } - /* attach failed because bundle doesn't exist */ - } - - /* we have to make a new bundle */ - make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - make_bundle_links(pcb); - unlock_db(); - info("New bundle %s created", ifname); - multilink_master = 1; - return 0; + lcp_options *go = &lcp_gotoptions[0]; + lcp_options *ho = &lcp_hisoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + int unit, pppd_pid; + int l, mtu; + char *p; + TDB_DATA key, pid, rec; + + if (doing_multilink) { + /* have previously joined a bundle */ + if (!go->neg_mrru || !ho->neg_mrru) { + notice("oops, didn't get multilink on renegotiation"); + lcp_close(pcb, "multilink required"); + return 0; + } + /* XXX should check the peer_authname and ho->endpoint + are the same as previously */ + return 0; + } + + if (!go->neg_mrru || !ho->neg_mrru) { + /* not doing multilink */ + if (go->neg_mrru) + notice("oops, multilink negotiated only for receive"); + mtu = ho->neg_mru? ho->mru: PPP_MRU; + if (mtu > ao->mru) + mtu = ao->mru; + if (demand) { + /* already have a bundle */ + cfg_bundle(0, 0, 0, 0); + netif_set_mtu(pcb, mtu); + return 0; + } + make_new_bundle(0, 0, 0, 0); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + return 0; + } + + doing_multilink = 1; + + /* + * Find the appropriate bundle or join a new one. + * First we make up a name for the bundle. + * The length estimate is worst-case assuming every + * character has to be quoted. + */ + l = 4 * strlen(peer_authname) + 10; + if (ho->neg_endpoint) + l += 3 * ho->endpoint.length + 8; + if (bundle_name) + l += 3 * strlen(bundle_name) + 2; + bundle_id = malloc(l); + if (bundle_id == 0) + novm("bundle identifier"); + + p = bundle_id; + p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); + if (ho->neg_endpoint || bundle_name) + *p++ = '/'; + if (ho->neg_endpoint) + p += slprintf(p, bundle_id+l-p, "%s", + epdisc_to_str(&ho->endpoint)); + if (bundle_name) + p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); + + /* Make the key for the list of links belonging to the bundle */ + l = p - bundle_id; + blinks_id = malloc(l + 7); + if (blinks_id == NULL) + novm("bundle links key"); + slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); + + /* + * For demand mode, we only need to configure the bundle + * and attach the link. + */ + mtu = LWIP_MIN(ho->mrru, ao->mru); + if (demand) { + cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + return 0; + } + + /* + * Check if the bundle ID is already in the database. + */ + unit = -1; + lock_db(); + key.dptr = bundle_id; + key.dsize = p - bundle_id; + pid = tdb_fetch(pppdb, key); + if (pid.dptr != NULL) { + /* bundle ID exists, see if the pppd record exists */ + rec = tdb_fetch(pppdb, pid); + if (rec.dptr != NULL && rec.dsize > 0) { + /* make sure the string is null-terminated */ + rec.dptr[rec.dsize-1] = 0; + /* parse the interface number */ + parse_num(rec.dptr, "IFNAME=ppp", &unit); + /* check the pid value */ + if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) + || !process_exists(pppd_pid) + || !owns_unit(pid, unit)) + unit = -1; + free(rec.dptr); + } + free(pid.dptr); + } + + if (unit >= 0) { + /* attach to existing unit */ + if (bundle_attach(unit)) { + set_ifunit(0); + script_setenv("BUNDLE", bundle_id + 7, 0); + make_bundle_links(1); + unlock_db(); + info("Link attached to %s", ifname); + return 1; + } + /* attach failed because bundle doesn't exist */ + } + + /* we have to make a new bundle */ + make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + make_bundle_links(pcb); + unlock_db(); + info("New bundle %s created", ifname); + multilink_master = 1; + return 0; } void mp_exit_bundle() { - lock_db(); - remove_bundle_link(); - unlock_db(); + lock_db(); + remove_bundle_link(); + unlock_db(); } static void sendhup(char *str) { - int pid; + int pid; - if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { - if (debug) - dbglog("sending SIGHUP to process %d", pid); - kill(pid, SIGHUP); - } + if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { + if (debug) + dbglog("sending SIGHUP to process %d", pid); + kill(pid, SIGHUP); + } } void mp_bundle_terminated() { - TDB_DATA key; + TDB_DATA key; - bundle_terminating = 1; - upper_layers_down(pcb); - notice("Connection terminated."); + bundle_terminating = 1; + upper_layers_down(pcb); + notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ - if (!demand) { - remove_pidfiles(); - script_unsetenv("IFNAME"); - } - - lock_db(); - destroy_bundle(); - iterate_bundle_links(sendhup); - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - tdb_delete(pppdb, key); - unlock_db(); - - new_phase(PPP_PHASE_DEAD); - - doing_multilink = 0; - multilink_master = 0; + if (!demand) { + remove_pidfiles(); + script_unsetenv("IFNAME"); + } + + lock_db(); + destroy_bundle(); + iterate_bundle_links(sendhup); + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + tdb_delete(pppdb, key); + unlock_db(); + + new_phase(PPP_PHASE_DEAD); + + doing_multilink = 0; + multilink_master = 0; } static void make_bundle_links(int append) { - TDB_DATA key, rec; - char *p; - char entry[32]; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - p = entry; - if (append) { - rec = tdb_fetch(pppdb, key); - if (rec.dptr != NULL && rec.dsize > 0) { - rec.dptr[rec.dsize-1] = 0; - if (strstr(rec.dptr, db_key) != NULL) { - /* already in there? strange */ - warn("link entry already exists in tdb"); - return; - } - l = rec.dsize + strlen(entry); - p = malloc(l); - if (p == NULL) - novm("bundle link list"); - slprintf(p, l, "%s%s", rec.dptr, entry); - } else { - warn("bundle link list not found"); - } - if (rec.dptr != NULL) - free(rec.dptr); - } - rec.dptr = p; - rec.dsize = strlen(p) + 1; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't %s bundle link list", - append? "update": "create"); - if (p != entry) - free(p); + TDB_DATA key, rec; + char *p; + char entry[32]; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + p = entry; + if (append) { + rec = tdb_fetch(pppdb, key); + if (rec.dptr != NULL && rec.dsize > 0) { + rec.dptr[rec.dsize-1] = 0; + if (strstr(rec.dptr, db_key) != NULL) { + /* already in there? strange */ + warn("link entry already exists in tdb"); + return; + } + l = rec.dsize + strlen(entry); + p = malloc(l); + if (p == NULL) + novm("bundle link list"); + slprintf(p, l, "%s%s", rec.dptr, entry); + } else { + warn("bundle link list not found"); + } + if (rec.dptr != NULL) + free(rec.dptr); + } + rec.dptr = p; + rec.dsize = strlen(p) + 1; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't %s bundle link list", + append? "update": "create"); + if (p != entry) + free(p); } static void remove_bundle_link() { - TDB_DATA key, rec; - char entry[32]; - char *p, *q; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - rec.dptr[rec.dsize-1] = 0; - p = strstr(rec.dptr, entry); - if (p != NULL) { - q = p + strlen(entry); - l = strlen(q) + 1; - memmove(p, q, l); - rec.dsize = p - rec.dptr + l; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't update bundle link list (removal)"); - } - free(rec.dptr); + TDB_DATA key, rec; + char entry[32]; + char *p, *q; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + rec.dptr[rec.dsize-1] = 0; + p = strstr(rec.dptr, entry); + if (p != NULL) { + q = p + strlen(entry); + l = strlen(q) + 1; + memmove(p, q, l); + rec.dsize = p - rec.dptr + l; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't update bundle link list (removal)"); + } + free(rec.dptr); } static void iterate_bundle_links(void (*func)(char *)) { - TDB_DATA key, rec, pp; - char *p, *q; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - error("bundle link list not found (iterating list)"); - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - p = rec.dptr; - p[rec.dsize-1] = 0; - while ((q = strchr(p, ';')) != NULL) { - *q = 0; - key.dptr = p; - key.dsize = q - p; - pp = tdb_fetch(pppdb, key); - if (pp.dptr != NULL && pp.dsize > 0) { - pp.dptr[pp.dsize-1] = 0; - func(pp.dptr); - } - if (pp.dptr != NULL) - free(pp.dptr); - p = q + 1; - } - free(rec.dptr); + TDB_DATA key, rec, pp; + char *p, *q; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + error("bundle link list not found (iterating list)"); + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + p = rec.dptr; + p[rec.dsize-1] = 0; + while ((q = strchr(p, ';')) != NULL) { + *q = 0; + key.dptr = p; + key.dsize = q - p; + pp = tdb_fetch(pppdb, key); + if (pp.dptr != NULL && pp.dsize > 0) { + pp.dptr[pp.dsize-1] = 0; + func(pp.dptr); + } + if (pp.dptr != NULL) + free(pp.dptr); + p = q + 1; + } + free(rec.dptr); } static int @@ -409,19 +409,19 @@ parse_num(str, key, valp) const char *key; int *valp; { - char *p, *endp; - int i; - - p = strstr(str, key); - if (p != 0) { - p += strlen(key); - i = strtol(p, &endp, 10); - if (endp != p && (*endp == 0 || *endp == ';')) { - *valp = i; - return 1; - } - } - return 0; + char *p, *endp; + int i; + + p = strstr(str, key); + if (p != 0) { + p += strlen(key); + i = strtol(p, &endp, 10); + if (endp != p && (*endp == 0 || *endp == ';')) { + *valp = i; + return 1; + } + } + return 0; } /* @@ -432,53 +432,53 @@ owns_unit(key, unit) TDB_DATA key; int unit; { - char ifkey[32]; - TDB_DATA kd, vd; - int ret = 0; - - slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); - kd.dptr = ifkey; - kd.dsize = strlen(ifkey); - vd = tdb_fetch(pppdb, kd); - if (vd.dptr != NULL) { - ret = vd.dsize == key.dsize - && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; - free(vd.dptr); - } - return ret; + char ifkey[32]; + TDB_DATA kd, vd; + int ret = 0; + + slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); + kd.dptr = ifkey; + kd.dsize = strlen(ifkey); + vd = tdb_fetch(pppdb, kd); + if (vd.dptr != NULL) { + ret = vd.dsize == key.dsize + && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; + free(vd.dptr); + } + return ret; } static int get_default_epdisc(ep) struct epdisc *ep; { - char *p; - struct hostent *hp; - u32_t addr; - - /* First try for an ethernet MAC address */ - p = get_first_ethernet(); - if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { - ep->class = EPD_MAC; - ep->length = 6; - return 1; - } - - /* see if our hostname corresponds to a reasonable IP address */ - hp = gethostbyname(hostname); - if (hp != NULL) { - addr = *(u32_t *)hp->h_addr; - if (!bad_ip_adrs(addr)) { - addr = lwip_ntohl(addr); - if (!LOCAL_IP_ADDR(addr)) { - ep->class = EPD_IP; - set_ip_epdisc(ep, addr); - return 1; - } - } - } - - return 0; + char *p; + struct hostent *hp; + u32_t addr; + + /* First try for an ethernet MAC address */ + p = get_first_ethernet(); + if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { + ep->class = EPD_MAC; + ep->length = 6; + return 1; + } + + /* see if our hostname corresponds to a reasonable IP address */ + hp = gethostbyname(hostname); + if (hp != NULL) { + addr = *(u32_t *)hp->h_addr; + if (!bad_ip_adrs(addr)) { + addr = lwip_ntohl(addr); + if (!LOCAL_IP_ADDR(addr)) { + ep->class = EPD_IP; + set_ip_epdisc(ep, addr); + return 1; + } + } + } + + return 0; } /* @@ -493,51 +493,51 @@ char * epdisc_to_str(ep) struct epdisc *ep; { - static char str[MAX_ENDP_LEN*3+8]; - u_char *p = ep->value; - int i, mask = 0; - char *q, c, c2; - - if (ep->class == EPD_NULL && ep->length == 0) - return "null"; - if (ep->class == EPD_IP && ep->length == 4) { - u32_t addr; - - GETLONG(addr, p); - slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); - return str; - } - - c = ':'; - c2 = '.'; - if (ep->class == EPD_MAC && ep->length == 6) - c2 = ':'; - else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) - mask = 3; - q = str; - if (ep->class <= EPD_PHONENUM) - q += slprintf(q, sizeof(str)-1, "%s", - endp_class_names[ep->class]); - else - q += slprintf(q, sizeof(str)-1, "%d", ep->class); - c = ':'; - for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { - if ((i & mask) == 0) { - *q++ = c; - c = c2; - } - q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); - } - return str; + static char str[MAX_ENDP_LEN*3+8]; + u_char *p = ep->value; + int i, mask = 0; + char *q, c, c2; + + if (ep->class == EPD_NULL && ep->length == 0) + return "null"; + if (ep->class == EPD_IP && ep->length == 4) { + u32_t addr; + + GETLONG(addr, p); + slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); + return str; + } + + c = ':'; + c2 = '.'; + if (ep->class == EPD_MAC && ep->length == 6) + c2 = ':'; + else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) + mask = 3; + q = str; + if (ep->class <= EPD_PHONENUM) + q += slprintf(q, sizeof(str)-1, "%s", + endp_class_names[ep->class]); + else + q += slprintf(q, sizeof(str)-1, "%d", ep->class); + c = ':'; + for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { + if ((i & mask) == 0) { + *q++ = c; + c = c2; + } + q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); + } + return str; } static int hexc_val(int c) { - if (c >= 'a') - return c - 'a' + 10; - if (c >= 'A') - return c - 'A' + 10; - return c - '0'; + if (c >= 'a') + return c - 'a' + 10; + if (c >= 'A') + return c - 'A' + 10; + return c - '0'; } int @@ -545,65 +545,65 @@ str_to_epdisc(ep, str) struct epdisc *ep; char *str; { - int i, l; - char *p, *endp; - - for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { - int sl = strlen(endp_class_names[i]); - if (strncasecmp(str, endp_class_names[i], sl) == 0) { - str += sl; - break; - } - } - if (i > EPD_PHONENUM) { - /* not a class name, try a decimal class number */ - i = strtol(str, &endp, 10); - if (endp == str) - return 0; /* can't parse class number */ - str = endp; - } - ep->class = i; - if (*str == 0) { - ep->length = 0; - return 1; - } - if (*str != ':' && *str != '.') - return 0; - ++str; - - if (i == EPD_IP) { - u32_t addr; - i = parse_dotted_ip(str, &addr); - if (i == 0 || str[i] != 0) - return 0; - set_ip_epdisc(ep, addr); - return 1; - } - if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { - ep->length = 6; - return 1; - } - - p = str; - for (l = 0; l < MAX_ENDP_LEN; ++l) { - if (*str == 0) - break; - if (p <= str) - for (p = str; isxdigit(*p); ++p) - ; - i = p - str; - if (i == 0) - return 0; - ep->value[l] = hexc_val(*str++); - if ((i & 1) == 0) - ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); - if (*str == ':' || *str == '.') - ++str; - } - if (*str != 0 || (ep->class == EPD_MAC && l != 6)) - return 0; - ep->length = l; - return 1; + int i, l; + char *p, *endp; + + for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { + int sl = strlen(endp_class_names[i]); + if (strncasecmp(str, endp_class_names[i], sl) == 0) { + str += sl; + break; + } + } + if (i > EPD_PHONENUM) { + /* not a class name, try a decimal class number */ + i = strtol(str, &endp, 10); + if (endp == str) + return 0; /* can't parse class number */ + str = endp; + } + ep->class = i; + if (*str == 0) { + ep->length = 0; + return 1; + } + if (*str != ':' && *str != '.') + return 0; + ++str; + + if (i == EPD_IP) { + u32_t addr; + i = parse_dotted_ip(str, &addr); + if (i == 0 || str[i] != 0) + return 0; + set_ip_epdisc(ep, addr); + return 1; + } + if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { + ep->length = 6; + return 1; + } + + p = str; + for (l = 0; l < MAX_ENDP_LEN; ++l) { + if (*str == 0) + break; + if (p <= str) + for (p = str; isxdigit(*p); ++p) + ; + i = p - str; + if (i == 0) + return 0; + ep->value[l] = hexc_val(*str++); + if ((i & 1) == 0) + ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); + if (*str == ':' || *str == '.') + ++str; + } + if (*str != 0 || (ep->class == EPD_MAC && l != 6)) + return 0; + ep->length = l; + return 1; } #endif /* PPP_SUPPORT && HAVE_MULTILINK */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c index cb31b8761e..6e17ec421b 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/arc4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c index b01e07fa5c..9a89d007bd 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/des.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c index 34e5b10cd4..b1701a07b9 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c index fa6365848f..1ec4d81a69 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/md5.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -156,7 +156,7 @@ static void md5_process( md5_context *ctx, const unsigned char data[64] ) P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F - + #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); diff --git a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c index 6079af3ba2..c2192eac54 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/polarssl/sha1.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.0.2/src/netif/ppp/ppp.c b/components/net/lwip-2.0.2/src/netif/ppp/ppp.c index 66a1156ff8..8b77765e5a 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/ppp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/ppp.c @@ -629,7 +629,7 @@ int ppp_init(void) return 0; } - + /* * Create a new PPP control block. * diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c b/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c index 0ad8e986b4..947f7ba8c1 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppapi.c @@ -57,10 +57,10 @@ LWIP_MEMPOOL_DECLARE(PPPAPI_MSG, MEMP_NUM_PPP_API_MSG, sizeof(struct pppapi_msg) static err_t pppapi_do_ppp_set_default(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; - + ppp_set_default(msg->msg.ppp); return ERR_OK; } @@ -90,7 +90,7 @@ pppapi_set_default(ppp_pcb *pcb) static err_t pppapi_do_ppp_set_notify_phase_callback(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -125,7 +125,7 @@ pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_pha static err_t pppapi_do_pppos_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -166,7 +166,7 @@ pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, static err_t pppapi_do_pppoe_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -211,7 +211,7 @@ pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *servic static err_t pppapi_do_pppol2tp_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -270,7 +270,7 @@ pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipad static err_t pppapi_do_ppp_connect(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -303,7 +303,7 @@ pppapi_connect(ppp_pcb *pcb, u16_t holdoff) static err_t pppapi_do_ppp_listen(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -335,7 +335,7 @@ pppapi_listen(ppp_pcb *pcb) static err_t pppapi_do_ppp_close(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -367,7 +367,7 @@ pppapi_close(ppp_pcb *pcb, u8_t nocarrier) static err_t pppapi_do_ppp_free(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -398,7 +398,7 @@ pppapi_free(ppp_pcb *pcb) static err_t pppapi_do_ppp_ioctl(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c b/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c index 81e4008d3d..82d78c13ac 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppcrypt.c @@ -39,28 +39,28 @@ static u_char pppcrypt_get_7bits(u_char *input, int startBit) { - unsigned int word; + unsigned int word; - word = (unsigned)input[startBit / 8] << 8; - word |= (unsigned)input[startBit / 8 + 1]; + word = (unsigned)input[startBit / 8] << 8; + word |= (unsigned)input[startBit / 8 + 1]; - word >>= 15 - (startBit % 8 + 7); + word >>= 15 - (startBit % 8 + 7); - return word & 0xFE; + return word & 0xFE; } /* IN 56 bit DES key missing parity bits * OUT 64 bit DES key with parity bits added */ void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { - des_key[0] = pppcrypt_get_7bits(key, 0); - des_key[1] = pppcrypt_get_7bits(key, 7); - des_key[2] = pppcrypt_get_7bits(key, 14); - des_key[3] = pppcrypt_get_7bits(key, 21); - des_key[4] = pppcrypt_get_7bits(key, 28); - des_key[5] = pppcrypt_get_7bits(key, 35); - des_key[6] = pppcrypt_get_7bits(key, 42); - des_key[7] = pppcrypt_get_7bits(key, 49); + des_key[0] = pppcrypt_get_7bits(key, 0); + des_key[1] = pppcrypt_get_7bits(key, 7); + des_key[2] = pppcrypt_get_7bits(key, 14); + des_key[3] = pppcrypt_get_7bits(key, 21); + des_key[4] = pppcrypt_get_7bits(key, 28); + des_key[5] = pppcrypt_get_7bits(key, 35); + des_key[6] = pppcrypt_get_7bits(key, 42); + des_key[7] = pppcrypt_get_7bits(key, 49); } #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c b/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c index 48260be832..eabfa4d041 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppoe.c @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -664,7 +664,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } if (pb->len < sizeof(*ph)) { PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: could not get PPPoE header\n")); @@ -697,7 +697,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header PPPOE_HEADERLEN failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, diff --git a/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c b/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c index 9033fb3a34..d44471e25f 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/pppol2tp.c @@ -740,15 +740,15 @@ static void pppol2tp_timeout(void *arg) { PPPDEBUG(LOG_DEBUG, ("pppol2tp: icrq_retried=%d\n", l2tp->icrq_retried)); if (l2tp->peer_nr <= l2tp->our_ns -1) { /* the SCCCN was not acknowledged */ if ((err = pppol2tp_send_scccn(l2tp, l2tp->our_ns -1)) != 0) { - l2tp->icrq_retried--; - PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCCN, error=%d\n", err)); - sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); - break; - } + l2tp->icrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send SCCCN, error=%d\n", err)); + sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); + break; + } } if ((err = pppol2tp_send_icrq(l2tp, l2tp->our_ns)) != 0) { - l2tp->icrq_retried--; - PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICRQ, error=%d\n", err)); + l2tp->icrq_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICRQ, error=%d\n", err)); } sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); break; @@ -761,8 +761,8 @@ static void pppol2tp_timeout(void *arg) { } PPPDEBUG(LOG_DEBUG, ("pppol2tp: iccn_retried=%d\n", l2tp->iccn_retried)); if ((err = pppol2tp_send_iccn(l2tp, l2tp->our_ns)) != 0) { - l2tp->iccn_retried--; - PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICCN, error=%d\n", err)); + l2tp->iccn_retried--; + PPPDEBUG(LOG_DEBUG, ("pppol2tp: failed to send ICCN, error=%d\n", err)); } sys_timeout(PPPOL2TP_CONTROL_TIMEOUT, pppol2tp_timeout, l2tp); break; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/upap.c b/components/net/lwip-2.0.2/src/netif/ppp/upap.c index f00f2ac46e..d00c2d76e5 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/upap.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/upap.c @@ -166,12 +166,12 @@ void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password) { /* Lower layer up yet? */ if (pcb->upap.us_clientstate == UPAPCS_INITIAL || - pcb->upap.us_clientstate == UPAPCS_PENDING) { - pcb->upap.us_clientstate = UPAPCS_PENDING; - return; + pcb->upap.us_clientstate == UPAPCS_PENDING) { + pcb->upap.us_clientstate = UPAPCS_PENDING; + return; } - upap_sauthreq(pcb); /* Start protocol */ + upap_sauthreq(pcb); /* Start protocol */ } #if PPP_SERVER @@ -184,14 +184,14 @@ void upap_authpeer(ppp_pcb *pcb) { /* Lower layer up yet? */ if (pcb->upap.us_serverstate == UPAPSS_INITIAL || - pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_PENDING; - return; + pcb->upap.us_serverstate == UPAPSS_PENDING) { + pcb->upap.us_serverstate = UPAPSS_PENDING; + return; } pcb->upap.us_serverstate = UPAPSS_LISTEN; if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ @@ -202,17 +202,17 @@ static void upap_timeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) - return; + return; if (pcb->upap.us_transmits >= pcb->settings.pap_max_transmits) { - /* give up in disgust */ - ppp_error("No response to PAP authenticate-requests"); - pcb->upap.us_clientstate = UPAPCS_BADAUTH; - auth_withpeer_fail(pcb, PPP_PAP); - return; + /* give up in disgust */ + ppp_error("No response to PAP authenticate-requests"); + pcb->upap.us_clientstate = UPAPCS_BADAUTH; + auth_withpeer_fail(pcb, PPP_PAP); + return; } - upap_sauthreq(pcb); /* Send Authenticate-Request */ + upap_sauthreq(pcb); /* Send Authenticate-Request */ } @@ -224,7 +224,7 @@ static void upap_reqtimeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_serverstate != UPAPSS_LISTEN) - return; /* huh?? */ + return; /* huh?? */ auth_peer_fail(pcb, PPP_PAP); pcb->upap.us_serverstate = UPAPSS_BADAUTH; @@ -240,18 +240,18 @@ static void upap_reqtimeout(void *arg) { static void upap_lowerup(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_INITIAL) - pcb->upap.us_clientstate = UPAPCS_CLOSED; + pcb->upap.us_clientstate = UPAPCS_CLOSED; else if (pcb->upap.us_clientstate == UPAPCS_PENDING) { - upap_sauthreq(pcb); /* send an auth-request */ + upap_sauthreq(pcb); /* send an auth-request */ } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_INITIAL) - pcb->upap.us_serverstate = UPAPSS_CLOSED; + pcb->upap.us_serverstate = UPAPSS_CLOSED; else if (pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_LISTEN; - if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + pcb->upap.us_serverstate = UPAPSS_LISTEN; + if (pcb->settings.pap_req_timeout > 0) + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ } @@ -264,11 +264,11 @@ static void upap_lowerup(ppp_pcb *pcb) { */ static void upap_lowerdown(ppp_pcb *pcb) { - if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ - UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ + if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ + UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN && pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); #endif /* PPP_SERVER */ pcb->upap.us_clientstate = UPAPCS_INITIAL; @@ -286,13 +286,13 @@ static void upap_lowerdown(ppp_pcb *pcb) { static void upap_protrej(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) { - ppp_error("PAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_PAP); } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN) { - ppp_error("PAP authentication of peer failed (protocol-reject)"); - auth_peer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication of peer failed (protocol-reject)"); + auth_peer_fail(pcb, PPP_PAP); } #endif /* PPP_SERVER */ upap_lowerdown(pcb); @@ -313,19 +313,19 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { */ inp = inpacket; if (l < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd short header.")); - return; + UPAPDEBUG(("pap_input: rcvd short header.")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd illegal length.")); - return; + UPAPDEBUG(("pap_input: rcvd illegal length.")); + return; } if (len > l) { - UPAPDEBUG(("pap_input: rcvd short packet.")); - return; + UPAPDEBUG(("pap_input: rcvd short packet.")); + return; } len -= UPAP_HEADERLEN; @@ -335,20 +335,20 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { switch (code) { case UPAP_AUTHREQ: #if PPP_SERVER - upap_rauthreq(pcb, inp, id, len); + upap_rauthreq(pcb, inp, id, len); #endif /* PPP_SERVER */ - break; + break; case UPAP_AUTHACK: - upap_rauthack(pcb, inp, id, len); - break; + upap_rauthack(pcb, inp, id, len); + break; case UPAP_AUTHNAK: - upap_rauthnak(pcb, inp, id, len); - break; + upap_rauthnak(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - break; + default: /* XXX Need code reject */ + break; } } @@ -366,40 +366,40 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { int msglen; if (pcb->upap.us_serverstate < UPAPSS_LISTEN) - return; + return; /* * If we receive a duplicate authenticate-request, we are * supposed to return the same status as for the first request. */ if (pcb->upap.us_serverstate == UPAPSS_OPEN) { - upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ - return; + upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ + return; } if (pcb->upap.us_serverstate == UPAPSS_BADAUTH) { - upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ - return; + upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ + return; } /* * Parse user/passwd. */ if (len < 1) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } GETCHAR(ruserlen, inp); len -= sizeof (u_char) + ruserlen + sizeof (u_char); if (len < 0) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } ruser = (char *) inp; INCPTR(ruserlen, inp); GETCHAR(rpasswdlen, inp); if (len < rpasswdlen) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } rpasswd = (char *) inp; @@ -420,16 +420,16 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { * return an authenticate failure, is leaving it for us to verify. */ if (retcode == UPAP_AUTHACK) { - if (!auth_number()) { - /* We do not want to leak info about the pap result. */ - retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ - warn("calling number %q is not authorized", remote_number); - } + if (!auth_number()) { + /* We do not want to leak info about the pap result. */ + retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ + warn("calling number %q is not authorized", remote_number); + } } msglen = strlen(msg); if (msglen > 255) - msglen = 255; + msglen = 255; #endif /* UNUSED */ upap_sresp(pcb, retcode, id, msg, msglen); @@ -438,17 +438,17 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { ppp_slprintf(rhostname, sizeof(rhostname), "%.*v", ruserlen, ruser); if (retcode == UPAP_AUTHACK) { - pcb->upap.us_serverstate = UPAPSS_OPEN; - ppp_notice("PAP peer authentication succeeded for %q", rhostname); - auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); + pcb->upap.us_serverstate = UPAPSS_OPEN; + ppp_notice("PAP peer authentication succeeded for %q", rhostname); + auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); } else { - pcb->upap.us_serverstate = UPAPSS_BADAUTH; - ppp_warn("PAP peer authentication failed for %q", rhostname); - auth_peer_fail(pcb, PPP_PAP); + pcb->upap.us_serverstate = UPAPSS_BADAUTH; + ppp_warn("PAP peer authentication failed for %q", rhostname); + auth_peer_fail(pcb, PPP_PAP); } if (pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); } #endif /* PPP_SERVER */ @@ -461,24 +461,24 @@ static void upap_rauthack(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthack: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthack: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_OPEN; @@ -496,24 +496,24 @@ static void upap_rauthnak(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_BADAUTH; @@ -532,7 +532,7 @@ static void upap_sauthreq(ppp_pcb *pcb) { int outlen; outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + - pcb->upap.us_userlen + pcb->upap.us_passwdlen; + pcb->upap.us_userlen + pcb->upap.us_passwdlen; p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE); if(NULL == p) return; @@ -606,68 +606,68 @@ static int upap_printpkt(const u_char *p, int plen, void (*printer) (void *, con const u_char *pstart; if (plen < UPAP_HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < UPAP_HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(upap_codenames)) - printer(arg, " %s", upap_codenames[code-1]); + printer(arg, " %s", upap_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= UPAP_HEADERLEN; switch (code) { case UPAP_AUTHREQ: - if (len < 1) - break; - ulen = p[0]; - if (len < ulen + 2) - break; - wlen = p[ulen + 1]; - if (len < ulen + wlen + 2) - break; - user = (const u_char *) (p + 1); - pwd = (const u_char *) (p + ulen + 2); - p += ulen + wlen + 2; - len -= ulen + wlen + 2; - printer(arg, " user="); - ppp_print_string(user, ulen, printer, arg); - printer(arg, " password="); + if (len < 1) + break; + ulen = p[0]; + if (len < ulen + 2) + break; + wlen = p[ulen + 1]; + if (len < ulen + wlen + 2) + break; + user = (const u_char *) (p + 1); + pwd = (const u_char *) (p + ulen + 2); + p += ulen + wlen + 2; + len -= ulen + wlen + 2; + printer(arg, " user="); + ppp_print_string(user, ulen, printer, arg); + printer(arg, " password="); /* FIXME: require ppp_pcb struct as printpkt() argument */ #if 0 - if (!pcb->settings.hide_password) + if (!pcb->settings.hide_password) #endif - ppp_print_string(pwd, wlen, printer, arg); + ppp_print_string(pwd, wlen, printer, arg); #if 0 - else - printer(arg, ""); + else + printer(arg, ""); #endif - break; + break; case UPAP_AUTHACK: case UPAP_AUTHNAK: - if (len < 1) - break; - mlen = p[0]; - if (len < mlen + 1) - break; - msg = (const u_char *) (p + 1); - p += mlen + 1; - len -= mlen + 1; - printer(arg, " "); - ppp_print_string(msg, mlen, printer, arg); - break; + if (len < 1) + break; + mlen = p[0]; + if (len < mlen + 1) + break; + msg = (const u_char *) (p + 1); + p += mlen + 1; + len -= mlen + 1; + printer(arg, " "); + ppp_print_string(msg, mlen, printer, arg); + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; diff --git a/components/net/lwip-2.0.2/src/netif/ppp/utils.c b/components/net/lwip-2.0.2/src/netif/ppp/utils.c index dd8e0f3b7c..008c63375a 100644 --- a/components/net/lwip-2.0.2/src/netif/ppp/utils.c +++ b/components/net/lwip-2.0.2/src/netif/ppp/utils.c @@ -74,7 +74,7 @@ static void ppp_log_write(int level, char *buf); #if PRINTPKT_SUPPORT static void ppp_vslp_printer(void *arg, const char *fmt, ...); static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); struct buffer_info { char *ptr; @@ -90,12 +90,12 @@ size_t ppp_strlcpy(char *dest, const char *src, size_t len) { size_t ret = strlen(src); if (len != 0) { - if (ret < len) - strcpy(dest, src); - else { - strncpy(dest, src, len - 1); - dest[len-1] = 0; - } + if (ret < len) + strcpy(dest, src); + else { + strncpy(dest, src, len - 1); + dest[len-1] = 0; + } } return ret; } @@ -132,7 +132,7 @@ int ppp_slprintf(char *buf, int buflen, const char *fmt, ...) { /* * ppp_vslprintf - like ppp_slprintf, takes a va_list instead of a list of args. */ -#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) +#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { int c, i, n; @@ -155,249 +155,249 @@ int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { buf0 = buf; --buflen; while (buflen > 0) { - for (f = fmt; *f != '%' && *f != 0; ++f) - ; - if (f > fmt) { - len = f - fmt; - if (len > buflen) - len = buflen; - memcpy(buf, fmt, len); - buf += len; - buflen -= len; - fmt = f; - } - if (*fmt == 0) - break; - c = *++fmt; - width = 0; - prec = -1; - fillch = ' '; - if (c == '0') { - fillch = '0'; - c = *++fmt; - } - if (c == '*') { - width = va_arg(args, int); - c = *++fmt; - } else { - while (isdigit(c)) { - width = width * 10 + c - '0'; - c = *++fmt; - } - } - if (c == '.') { - c = *++fmt; - if (c == '*') { - prec = va_arg(args, int); - c = *++fmt; - } else { - prec = 0; - while (isdigit(c)) { - prec = prec * 10 + c - '0'; - c = *++fmt; - } - } - } - str = 0; - base = 0; - neg = 0; - ++fmt; - switch (c) { - case 'l': - c = *fmt++; - switch (c) { - case 'd': - val = va_arg(args, long); - if ((long)val < 0) { - neg = 1; - val = (unsigned long)-(long)val; - } - base = 10; - break; - case 'u': - val = va_arg(args, unsigned long); - base = 10; - break; - default: - OUTCHAR('%'); - OUTCHAR('l'); - --fmt; /* so %lz outputs %lz etc. */ - continue; - } - break; - case 'd': - i = va_arg(args, int); - if (i < 0) { - neg = 1; - val = -i; - } else - val = i; - base = 10; - break; - case 'u': - val = va_arg(args, unsigned int); - base = 10; - break; - case 'o': - val = va_arg(args, unsigned int); - base = 8; - break; - case 'x': - case 'X': - val = va_arg(args, unsigned int); - base = 16; - break; + for (f = fmt; *f != '%' && *f != 0; ++f) + ; + if (f > fmt) { + len = f - fmt; + if (len > buflen) + len = buflen; + memcpy(buf, fmt, len); + buf += len; + buflen -= len; + fmt = f; + } + if (*fmt == 0) + break; + c = *++fmt; + width = 0; + prec = -1; + fillch = ' '; + if (c == '0') { + fillch = '0'; + c = *++fmt; + } + if (c == '*') { + width = va_arg(args, int); + c = *++fmt; + } else { + while (isdigit(c)) { + width = width * 10 + c - '0'; + c = *++fmt; + } + } + if (c == '.') { + c = *++fmt; + if (c == '*') { + prec = va_arg(args, int); + c = *++fmt; + } else { + prec = 0; + while (isdigit(c)) { + prec = prec * 10 + c - '0'; + c = *++fmt; + } + } + } + str = 0; + base = 0; + neg = 0; + ++fmt; + switch (c) { + case 'l': + c = *fmt++; + switch (c) { + case 'd': + val = va_arg(args, long); + if ((long)val < 0) { + neg = 1; + val = (unsigned long)-(long)val; + } + base = 10; + break; + case 'u': + val = va_arg(args, unsigned long); + base = 10; + break; + default: + OUTCHAR('%'); + OUTCHAR('l'); + --fmt; /* so %lz outputs %lz etc. */ + continue; + } + break; + case 'd': + i = va_arg(args, int); + if (i < 0) { + neg = 1; + val = -i; + } else + val = i; + base = 10; + break; + case 'u': + val = va_arg(args, unsigned int); + base = 10; + break; + case 'o': + val = va_arg(args, unsigned int); + base = 8; + break; + case 'x': + case 'X': + val = va_arg(args, unsigned int); + base = 16; + break; #if 0 /* unused (and wrong on LLP64 systems) */ - case 'p': - val = (unsigned long) va_arg(args, void *); - base = 16; - neg = 2; - break; + case 'p': + val = (unsigned long) va_arg(args, void *); + base = 16; + neg = 2; + break; #endif /* unused (and wrong on LLP64 systems) */ - case 's': - str = va_arg(args, char *); - break; - case 'c': - num[0] = va_arg(args, int); - num[1] = 0; - str = num; - break; + case 's': + str = va_arg(args, char *); + break; + case 'c': + num[0] = va_arg(args, int); + num[1] = 0; + str = num; + break; #if 0 /* do we always have strerror() in embedded ? */ - case 'm': - str = strerror(errno); - break; + case 'm': + str = strerror(errno); + break; #endif /* do we always have strerror() in embedded ? */ - case 'I': - ip = va_arg(args, u32_t); - ip = lwip_ntohl(ip); - ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, - (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); - str = num; - break; + case 'I': + ip = va_arg(args, u32_t); + ip = lwip_ntohl(ip); + ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, + (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); + str = num; + break; #if 0 /* need port */ - case 't': - time(&t); - str = ctime(&t); - str += 4; /* chop off the day name */ - str[15] = 0; /* chop off year and newline */ - break; + case 't': + time(&t); + str = ctime(&t); + str += 4; /* chop off the day name */ + str[15] = 0; /* chop off year and newline */ + break; #endif /* need port */ - case 'v': /* "visible" string */ - case 'q': /* quoted string */ - quoted = c == 'q'; - p = va_arg(args, unsigned char *); - if (p == NULL) - p = (const unsigned char *)""; - if (fillch == '0' && prec >= 0) { - n = prec; - } else { - n = strlen((const char *)p); - if (prec >= 0 && n > prec) - n = prec; - } - while (n > 0 && buflen > 0) { - c = *p++; - --n; - if (!quoted && c >= 0x80) { - OUTCHAR('M'); - OUTCHAR('-'); - c -= 0x80; - } - if (quoted && (c == '"' || c == '\\')) - OUTCHAR('\\'); - if (c < 0x20 || (0x7f <= c && c < 0xa0)) { - if (quoted) { - OUTCHAR('\\'); - switch (c) { - case '\t': OUTCHAR('t'); break; - case '\n': OUTCHAR('n'); break; - case '\b': OUTCHAR('b'); break; - case '\f': OUTCHAR('f'); break; - default: - OUTCHAR('x'); - OUTCHAR(hexchars[c >> 4]); - OUTCHAR(hexchars[c & 0xf]); - } - } else { - if (c == '\t') - OUTCHAR(c); - else { - OUTCHAR('^'); - OUTCHAR(c ^ 0x40); - } - } - } else - OUTCHAR(c); - } - continue; + case 'v': /* "visible" string */ + case 'q': /* quoted string */ + quoted = c == 'q'; + p = va_arg(args, unsigned char *); + if (p == NULL) + p = (const unsigned char *)""; + if (fillch == '0' && prec >= 0) { + n = prec; + } else { + n = strlen((const char *)p); + if (prec >= 0 && n > prec) + n = prec; + } + while (n > 0 && buflen > 0) { + c = *p++; + --n; + if (!quoted && c >= 0x80) { + OUTCHAR('M'); + OUTCHAR('-'); + c -= 0x80; + } + if (quoted && (c == '"' || c == '\\')) + OUTCHAR('\\'); + if (c < 0x20 || (0x7f <= c && c < 0xa0)) { + if (quoted) { + OUTCHAR('\\'); + switch (c) { + case '\t': OUTCHAR('t'); break; + case '\n': OUTCHAR('n'); break; + case '\b': OUTCHAR('b'); break; + case '\f': OUTCHAR('f'); break; + default: + OUTCHAR('x'); + OUTCHAR(hexchars[c >> 4]); + OUTCHAR(hexchars[c & 0xf]); + } + } else { + if (c == '\t') + OUTCHAR(c); + else { + OUTCHAR('^'); + OUTCHAR(c ^ 0x40); + } + } + } else + OUTCHAR(c); + } + continue; #if PRINTPKT_SUPPORT - case 'P': /* print PPP packet */ - bufinfo.ptr = buf; - bufinfo.len = buflen + 1; - p = va_arg(args, unsigned char *); - n = va_arg(args, int); - ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); - buf = bufinfo.ptr; - buflen = bufinfo.len - 1; - continue; + case 'P': /* print PPP packet */ + bufinfo.ptr = buf; + bufinfo.len = buflen + 1; + p = va_arg(args, unsigned char *); + n = va_arg(args, int); + ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); + buf = bufinfo.ptr; + buflen = bufinfo.len - 1; + continue; #endif /* PRINTPKT_SUPPORT */ - case 'B': - p = va_arg(args, unsigned char *); - for (n = prec; n > 0; --n) { - c = *p++; - if (fillch == ' ') - OUTCHAR(' '); - OUTCHAR(hexchars[(c >> 4) & 0xf]); - OUTCHAR(hexchars[c & 0xf]); - } - continue; - default: - *buf++ = '%'; - if (c != '%') - --fmt; /* so %z outputs %z etc. */ - --buflen; - continue; - } - if (base != 0) { - str = num + sizeof(num); - *--str = 0; - while (str > num + neg) { - *--str = hexchars[val % base]; - val = val / base; - if (--prec <= 0 && val == 0) - break; - } - switch (neg) { - case 1: - *--str = '-'; - break; - case 2: - *--str = 'x'; - *--str = '0'; - break; - default: - break; - } - len = num + sizeof(num) - 1 - str; - } else { - len = strlen(str); - if (prec >= 0 && len > prec) - len = prec; - } - if (width > 0) { - if (width > buflen) - width = buflen; - if ((n = width - len) > 0) { - buflen -= n; - for (; n > 0; --n) - *buf++ = fillch; - } - } - if (len > buflen) - len = buflen; - memcpy(buf, str, len); - buf += len; - buflen -= len; + case 'B': + p = va_arg(args, unsigned char *); + for (n = prec; n > 0; --n) { + c = *p++; + if (fillch == ' ') + OUTCHAR(' '); + OUTCHAR(hexchars[(c >> 4) & 0xf]); + OUTCHAR(hexchars[c & 0xf]); + } + continue; + default: + *buf++ = '%'; + if (c != '%') + --fmt; /* so %z outputs %z etc. */ + --buflen; + continue; + } + if (base != 0) { + str = num + sizeof(num); + *--str = 0; + while (str > num + neg) { + *--str = hexchars[val % base]; + val = val / base; + if (--prec <= 0 && val == 0) + break; + } + switch (neg) { + case 1: + *--str = '-'; + break; + case 2: + *--str = 'x'; + *--str = '0'; + break; + default: + break; + } + len = num + sizeof(num) - 1 - str; + } else { + len = strlen(str); + if (prec >= 0 && len > prec) + len = prec; + } + if (width > 0) { + if (width > buflen) + width = buflen; + if ((n = width - len) > 0) { + buflen -= n; + for (; n > 0; --n) + *buf++ = fillch; + } + } + if (len > buflen) + len = buflen; + memcpy(buf, str, len); + buf += len; + buflen -= len; } *buf = 0; return buf - buf0; @@ -434,9 +434,9 @@ log_packet(p, len, prefix, level) char *prefix; int level; { - init_pr_log(prefix, level); - ppp_format_packet(p, len, pr_log, &level); - end_pr_log(); + init_pr_log(prefix, level); + ppp_format_packet(p, len, pr_log, &level); + end_pr_log(); } #endif /* UNUSED */ @@ -446,43 +446,43 @@ log_packet(p, len, prefix, level) * calling `printer(arg, format, ...)' to output it. */ static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int i, n; u_short proto; const struct protent *protp; if (len >= 2) { - GETSHORT(proto, p); - len -= 2; - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == protp->protocol) - break; - if (protp != NULL) { - printer(arg, "[%s", protp->name); - n = (*protp->printpkt)(p, len, printer, arg); - printer(arg, "]"); - p += n; - len -= n; - } else { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == (protp->protocol & ~0x8000)) - break; - if (protp != 0 && protp->data_name != 0) { - printer(arg, "[%s data]", protp->data_name); - if (len > 8) - printer(arg, "%.8B ...", p); - else - printer(arg, "%.*B", len, p); - len = 0; - } else - printer(arg, "[proto=0x%x]", proto); - } + GETSHORT(proto, p); + len -= 2; + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == protp->protocol) + break; + if (protp != NULL) { + printer(arg, "[%s", protp->name); + n = (*protp->printpkt)(p, len, printer, arg); + printer(arg, "]"); + p += n; + len -= n; + } else { + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == (protp->protocol & ~0x8000)) + break; + if (protp != 0 && protp->data_name != 0) { + printer(arg, "[%s data]", protp->data_name); + if (len > 8) + printer(arg, "%.8B ...", p); + else + printer(arg, "%.*B", len, p); + len = 0; + } else + printer(arg, "[proto=0x%x]", proto); + } } if (len > 32) - printer(arg, "%.32B ...", p); + printer(arg, "%.32B ...", p); else - printer(arg, "%.*B", len, p); + printer(arg, "%.*B", len, p); } #endif /* PRINTPKT_SUPPORT */ @@ -491,30 +491,30 @@ static void ppp_format_packet(const u_char *p, int len, * init_pr_log, end_pr_log - initialize and finish use of pr_log. */ -static char line[256]; /* line to be logged accumulated here */ -static char *linep; /* current pointer within line */ -static int llevel; /* level for logging */ +static char line[256]; /* line to be logged accumulated here */ +static char *linep; /* current pointer within line */ +static int llevel; /* level for logging */ void init_pr_log(prefix, level) const char *prefix; int level; { - linep = line; - if (prefix != NULL) { - ppp_strlcpy(line, prefix, sizeof(line)); - linep = line + strlen(line); - } - llevel = level; + linep = line; + if (prefix != NULL) { + ppp_strlcpy(line, prefix, sizeof(line)); + linep = line + strlen(line); + } + llevel = level; } void end_pr_log() { - if (linep != line) { - *linep = 0; - ppp_log_write(llevel, line); - } + if (linep != line) { + *linep = 0; + ppp_log_write(llevel, line); + } } /* @@ -523,47 +523,47 @@ end_pr_log() void pr_log (void *arg, const char *fmt, ...) { - int l, n; - va_list pvar; - char *p, *eol; - char buf[256]; - - va_start(pvar, fmt); - n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); - va_end(pvar); - - p = buf; - eol = strchr(buf, '\n'); - if (linep != line) { - l = (eol == NULL)? n: eol - buf; - if (linep + l < line + sizeof(line)) { - if (l > 0) { - memcpy(linep, buf, l); - linep += l; - } - if (eol == NULL) - return; - p = eol + 1; - eol = strchr(p, '\n'); - } - *linep = 0; - ppp_log_write(llevel, line); - linep = line; - } - - while (eol != NULL) { - *eol = 0; - ppp_log_write(llevel, p); - p = eol + 1; - eol = strchr(p, '\n'); - } - - /* assumes sizeof(buf) <= sizeof(line) */ - l = buf + n - p; - if (l > 0) { - memcpy(line, p, n); - linep = line + l; - } + int l, n; + va_list pvar; + char *p, *eol; + char buf[256]; + + va_start(pvar, fmt); + n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); + va_end(pvar); + + p = buf; + eol = strchr(buf, '\n'); + if (linep != line) { + l = (eol == NULL)? n: eol - buf; + if (linep + l < line + sizeof(line)) { + if (l > 0) { + memcpy(linep, buf, l); + linep += l; + } + if (eol == NULL) + return; + p = eol + 1; + eol = strchr(p, '\n'); + } + *linep = 0; + ppp_log_write(llevel, line); + linep = line; + } + + while (eol != NULL) { + *eol = 0; + ppp_log_write(llevel, p); + p = eol + 1; + eol = strchr(p, '\n'); + } + + /* assumes sizeof(buf) <= sizeof(line) */ + l = buf + n - p; + if (l > 0) { + memcpy(line, p, n); + linep = line + l; + } } #endif /* UNUSED */ @@ -576,27 +576,27 @@ void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const c printer(arg, "\""); for (; len > 0; --len) { - c = *p++; - if (' ' <= c && c <= '~') { - if (c == '\\' || c == '"') - printer(arg, "\\"); - printer(arg, "%c", c); - } else { - switch (c) { - case '\n': - printer(arg, "\\n"); - break; - case '\r': - printer(arg, "\\r"); - break; - case '\t': - printer(arg, "\\t"); - break; - default: - printer(arg, "\\%.3o", (u8_t)c); - /* no break */ - } - } + c = *p++; + if (' ' <= c && c <= '~') { + if (c == '\\' || c == '"') + printer(arg, "\\"); + printer(arg, "%c", c); + } else { + switch (c) { + case '\n': + printer(arg, "\\n"); + break; + case '\r': + printer(arg, "\\r"); + break; + case '\t': + printer(arg, "\\t"); + break; + default: + printer(arg, "\\%.3o", (u8_t)c); + /* no break */ + } + } } printer(arg, "\""); } @@ -617,13 +617,13 @@ static void ppp_log_write(int level, char *buf) { PPPDEBUG(level, ("%s\n", buf) ); #if 0 if (log_to_fd >= 0 && (level != LOG_DEBUG || debug)) { - int n = strlen(buf); + int n = strlen(buf); - if (n > 0 && buf[n-1] == '\n') - --n; - if (write(log_to_fd, buf, n) != n - || write(log_to_fd, "\n", 1) != 1) - log_to_fd = -1; + if (n > 0 && buf[n-1] == '\n') + --n; + if (write(log_to_fd, buf, n) != n + || write(log_to_fd, "\n", 1) != 1) + log_to_fd = -1; } #endif } @@ -712,18 +712,18 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { */ proto = (p[0] << 8) + p[1]; if (proto < 0xC000 && (proto & ~0x8000) == proto) - return; + return; /* * don't print valid LCP echo request/reply packets if the link is up. */ if (proto == PPP_LCP && pcb->phase == PPP_PHASE_RUNNING && len >= 2 + HEADERLEN) { - unsigned char *lcp = p + 2; - int l = (lcp[2] << 8) + lcp[3]; + unsigned char *lcp = p + 2; + int l = (lcp[2] << 8) + lcp[3]; - if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) - && l >= HEADERLEN && l <= len - 2) - return; + if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) + && l >= HEADERLEN && l <= len - 2) + return; } ppp_dbglog("%s %P", tag, p, len); @@ -739,34 +739,34 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { ssize_t complete_read(int fd, void *buf, size_t count) { - size_t done; - ssize_t nb; - char *ptr = buf; - - for (done = 0; done < count; ) { - nb = read(fd, ptr, count - done); - if (nb < 0) { - if (errno == EINTR) - continue; - return -1; - } - if (nb == 0) - break; - done += nb; - ptr += nb; - } - return done; + size_t done; + ssize_t nb; + char *ptr = buf; + + for (done = 0; done < count; ) { + nb = read(fd, ptr, count - done); + if (nb < 0) { + if (errno == EINTR) + continue; + return -1; + } + if (nb == 0) + break; + done += nb; + ptr += nb; + } + return done; } /* Procedures for locking the serial device using a lock file. */ #ifndef LOCK_DIR #ifdef __linux__ -#define LOCK_DIR "/var/lock" +#define LOCK_DIR "/var/lock" #else #ifdef SVR4 -#define LOCK_DIR "/var/spool/locks" +#define LOCK_DIR "/var/spool/locks" #else -#define LOCK_DIR "/var/spool/lock" +#define LOCK_DIR "/var/spool/lock" #endif #endif #endif /* LOCK_DIR */ @@ -785,14 +785,14 @@ lock(dev) result = mklock (dev, (void *) 0); if (result == 0) { - ppp_strlcpy(lock_file, dev, sizeof(lock_file)); - return 0; + ppp_strlcpy(lock_file, dev, sizeof(lock_file)); + return 0; } if (result > 0) ppp_notice("Device %s is locked by pid %d", dev, result); else - ppp_error("Can't create lock file %s", lock_file); + ppp_error("Can't create lock file %s", lock_file); return -1; #else /* LOCKLIB */ @@ -804,83 +804,83 @@ lock(dev) struct stat sbuf; if (stat(dev, &sbuf) < 0) { - ppp_error("Can't get device number for %s: %m", dev); - return -1; + ppp_error("Can't get device number for %s: %m", dev); + return -1; } if ((sbuf.st_mode & S_IFMT) != S_IFCHR) { - ppp_error("Can't lock %s: not a character device", dev); - return -1; + ppp_error("Can't lock %s: not a character device", dev); + return -1; } ppp_slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d", - LOCK_DIR, major(sbuf.st_dev), - major(sbuf.st_rdev), minor(sbuf.st_rdev)); + LOCK_DIR, major(sbuf.st_dev), + major(sbuf.st_rdev), minor(sbuf.st_rdev)); #else char *p; char lockdev[MAXPATHLEN]; if ((p = strstr(dev, "dev/")) != NULL) { - dev = p + 4; - strncpy(lockdev, dev, MAXPATHLEN-1); - lockdev[MAXPATHLEN-1] = 0; - while ((p = strrchr(lockdev, '/')) != NULL) { - *p = '_'; - } - dev = lockdev; + dev = p + 4; + strncpy(lockdev, dev, MAXPATHLEN-1); + lockdev[MAXPATHLEN-1] = 0; + while ((p = strrchr(lockdev, '/')) != NULL) { + *p = '_'; + } + dev = lockdev; } else - if ((p = strrchr(dev, '/')) != NULL) - dev = p + 1; + if ((p = strrchr(dev, '/')) != NULL) + dev = p + 1; ppp_slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); #endif while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) { - if (errno != EEXIST) { - ppp_error("Can't create lock file %s: %m", lock_file); - break; - } - - /* Read the lock file to find out who has the device locked. */ - fd = open(lock_file, O_RDONLY, 0); - if (fd < 0) { - if (errno == ENOENT) /* This is just a timing problem. */ - continue; - ppp_error("Can't open existing lock file %s: %m", lock_file); - break; - } + if (errno != EEXIST) { + ppp_error("Can't create lock file %s: %m", lock_file); + break; + } + + /* Read the lock file to find out who has the device locked. */ + fd = open(lock_file, O_RDONLY, 0); + if (fd < 0) { + if (errno == ENOENT) /* This is just a timing problem. */ + continue; + ppp_error("Can't open existing lock file %s: %m", lock_file); + break; + } #ifndef LOCK_BINARY - n = read(fd, lock_buffer, 11); + n = read(fd, lock_buffer, 11); #else - n = read(fd, &pid, sizeof(pid)); + n = read(fd, &pid, sizeof(pid)); #endif /* LOCK_BINARY */ - close(fd); - fd = -1; - if (n <= 0) { - ppp_error("Can't read pid from lock file %s", lock_file); - break; - } - - /* See if the process still exists. */ + close(fd); + fd = -1; + if (n <= 0) { + ppp_error("Can't read pid from lock file %s", lock_file); + break; + } + + /* See if the process still exists. */ #ifndef LOCK_BINARY - lock_buffer[n] = 0; - pid = atoi(lock_buffer); + lock_buffer[n] = 0; + pid = atoi(lock_buffer); #endif /* LOCK_BINARY */ - if (pid == getpid()) - return 1; /* somebody else locked it for us */ - if (pid == 0 - || (kill(pid, 0) == -1 && errno == ESRCH)) { - if (unlink (lock_file) == 0) { - ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); - continue; - } - ppp_warn("Couldn't remove stale lock on %s", dev); - } else - ppp_notice("Device %s is locked by pid %d", dev, pid); - break; + if (pid == getpid()) + return 1; /* somebody else locked it for us */ + if (pid == 0 + || (kill(pid, 0) == -1 && errno == ESRCH)) { + if (unlink (lock_file) == 0) { + ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); + continue; + } + ppp_warn("Couldn't remove stale lock on %s", dev); + } else + ppp_notice("Device %s is locked by pid %d", dev, pid); + break; } if (fd < 0) { - lock_file[0] = 0; - return -1; + lock_file[0] = 0; + return -1; } pid = getpid(); @@ -918,12 +918,12 @@ relock(pid) char lock_buffer[12]; if (lock_file[0] == 0) - return -1; + return -1; fd = open(lock_file, O_WRONLY, 0); if (fd < 0) { - ppp_error("Couldn't reopen lock file %s: %m", lock_file); - lock_file[0] = 0; - return -1; + ppp_error("Couldn't reopen lock file %s: %m", lock_file); + lock_file[0] = 0; + return -1; } #ifndef LOCK_BINARY @@ -946,11 +946,11 @@ unlock() { if (lock_file[0]) { #ifdef LOCKLIB - (void) rmlock(lock_file, (void *) 0); + (void) rmlock(lock_file, (void *) 0); #else - unlink(lock_file); + unlink(lock_file); #endif - lock_file[0] = 0; + lock_file[0] = 0; } } diff --git a/components/net/lwip-2.0.2/test/fuzz/fuzz.c b/components/net/lwip-2.0.2/test/fuzz/fuzz.c index ecf81d7e21..a9157f1385 100644 --- a/components/net/lwip-2.0.2/test/fuzz/fuzz.c +++ b/components/net/lwip-2.0.2/test/fuzz/fuzz.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Erik Ekman * */ diff --git a/components/net/lwip-2.0.2/test/fuzz/lwipopts.h b/components/net/lwip-2.0.2/test/fuzz/lwipopts.h index 1e355599e5..4aff09bad6 100644 --- a/components/net/lwip-2.0.2/test/fuzz/lwipopts.h +++ b/components/net/lwip-2.0.2/test/fuzz/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c b/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c index a9a2507937..47aaa08420 100644 --- a/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c +++ b/components/net/lwip-2.0.2/test/unit/dhcp/test_dhcp.c @@ -888,7 +888,7 @@ START_TEST(test_dhcp_nak_no_endmarker) xid = htonl(netif_dhcp_data(&net_test)->xid); memcpy(&dhcp_offer[46], &xid, 4); /* insert correct transaction id */ send_pkt(&net_test, dhcp_offer, sizeof(dhcp_offer)); - + fail_unless(netif_dhcp_data(&net_test)->state == DHCP_STATE_REQUESTING); fail_unless(txpacket == 2); /* No more sent */ diff --git a/components/net/lwip-2.0.2/test/unit/lwipopts.h b/components/net/lwip-2.0.2/test/unit/lwipopts.h index ea0ff2e0b5..25252b426c 100644 --- a/components/net/lwip-2.0.2/test/unit/lwipopts.h +++ b/components/net/lwip-2.0.2/test/unit/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c b/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c index 1512b03cd1..64121ca8f3 100644 --- a/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c +++ b/components/net/lwip-2.0.2/test/unit/tcp/tcp_helper.c @@ -146,13 +146,13 @@ tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, /* @todo: are these all states? */ /* @todo: remove from previous list */ pcb->state = state; - + iss = tcp_next_iss(pcb); pcb->snd_wl2 = iss; pcb->snd_nxt = iss; pcb->lastack = iss; pcb->snd_lbb = iss; - + if (state == ESTABLISHED) { TCP_REG(&tcp_active_pcbs, pcb); ip_addr_copy(pcb->local_ip, *local_ip); diff --git a/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c b/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c index 86dd6cc95c..d99b807d96 100644 --- a/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c +++ b/components/net/lwip-2.0.2/test/unit/tcp/test_tcp.c @@ -281,7 +281,7 @@ START_TEST(test_tcp_fast_retx_recover) EXPECT_RET(pcb->dupacks == 3); memset(&txcounters, 0, sizeof(txcounters)); /* @todo: check expected data?*/ - + /* send data5, not output yet */ err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); EXPECT_RET(err == ERR_OK); diff --git a/components/net/lwip-2.1.2/src/api/tcpip.c b/components/net/lwip-2.1.2/src/api/tcpip.c index b0382e83c4..743553a587 100644 --- a/components/net/lwip-2.1.2/src/api/tcpip.c +++ b/components/net/lwip-2.1.2/src/api/tcpip.c @@ -519,7 +519,7 @@ tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call) * e.g. the message is allocated once and posted several times from an IRQ * using tcpip_callbackmsg_trycallback(). * Example usage: Trigger execution of an ethernet IRQ DPC routine in lwIP thread context. - * + * * @param function the function to call * @param ctx parameter passed to function * @return a struct pointer to pass to tcpip_callbackmsg_trycallback(). diff --git a/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c b/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c index d5ff3fe4f0..d642decb54 100644 --- a/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c +++ b/components/net/lwip-2.1.2/src/apps/altcp_tls/altcp_tls_mbedtls.c @@ -886,7 +886,7 @@ altcp_tls_free_config(struct altcp_tls_config *conf) } if (conf->ca) { mbedtls_x509_crt_free(conf->ca); - } + } altcp_mbedtls_free_config(conf); } diff --git a/components/net/lwip-2.1.2/src/apps/http/http_client.c b/components/net/lwip-2.1.2/src/apps/http/http_client.c index 6fbb691510..82da60d73a 100644 --- a/components/net/lwip-2.1.2/src/apps/http/http_client.c +++ b/components/net/lwip-2.1.2/src/apps/http/http_client.c @@ -615,7 +615,7 @@ httpc_init_connection_addr(httpc_state_t **connection, const httpc_connection_t } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file by passing server IP address * * @param server_addr IP address of the server to connect @@ -660,7 +660,7 @@ httpc_get_file(const ip_addr_t* server_addr, u16_t port, const char* uri, const } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file by passing server name as string (DNS name or IP address string) * * @param server_name server name as string (DNS name or IP address string) @@ -802,7 +802,7 @@ httpc_fs_tcp_recv(void *arg, struct altcp_pcb *pcb, struct pbuf *p, err_t err) } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file to disk by passing server IP address * * @param server_addr IP address of the server to connect @@ -854,7 +854,7 @@ httpc_get_file_to_disk(const ip_addr_t* server_addr, u16_t port, const char* uri } /** - * @ingroup httpc + * @ingroup httpc * HTTP client API: get a file to disk by passing server name as string (DNS name or IP address string) * * @param server_name server name as string (DNS name or IP address string) diff --git a/components/net/lwip-2.1.2/src/apps/http/httpd.c b/components/net/lwip-2.1.2/src/apps/http/httpd.c index 6e53b48412..ccc9ba7284 100644 --- a/components/net/lwip-2.1.2/src/apps/http/httpd.c +++ b/components/net/lwip-2.1.2/src/apps/http/httpd.c @@ -233,7 +233,7 @@ struct http_ssi_state { struct http_ssi_tag_description { const char *lead_in; - const char *lead_out; + const char *lead_out; }; #endif /* LWIP_HTTPD_SSI */ diff --git a/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h b/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h index 88043e8e93..32ae5e84a9 100644 --- a/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h +++ b/components/net/lwip-2.1.2/src/apps/http/makefsdata/tinydir.h @@ -121,7 +121,7 @@ extern "C" { /* readdir_r is a POSIX-only function, and may not be available under various * environments/settings, e.g. MinGW. Use readdir fallback */ #if _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE ||\ - _POSIX_SOURCE + _POSIX_SOURCE # define _TINYDIR_HAS_READDIR_R #endif #if _POSIX_C_SOURCE >= 200112L @@ -129,16 +129,16 @@ extern "C" { # include #endif #if _BSD_SOURCE || _SVID_SOURCE || \ - (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) + (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) # define _TINYDIR_HAS_DIRFD # include #endif #if defined _TINYDIR_HAS_FPATHCONF && defined _TINYDIR_HAS_DIRFD &&\ - defined _PC_NAME_MAX + defined _PC_NAME_MAX # define _TINYDIR_USE_FPATHCONF #endif #if defined __MINGW32__ || !defined _TINYDIR_HAS_READDIR_R ||\ - !(defined _TINYDIR_USE_FPATHCONF || defined NAME_MAX) + !(defined _TINYDIR_USE_FPATHCONF || defined NAME_MAX) # define _TINYDIR_USE_READDIR #endif @@ -172,42 +172,42 @@ extern "C" { #endif #if !defined(_TINYDIR_MALLOC) - #define _TINYDIR_MALLOC(_size) malloc(_size) - #define _TINYDIR_FREE(_ptr) free(_ptr) + #define _TINYDIR_MALLOC(_size) malloc(_size) + #define _TINYDIR_FREE(_ptr) free(_ptr) #endif /* !defined(_TINYDIR_MALLOC) */ typedef struct tinydir_file { - _tinydir_char_t path[_TINYDIR_PATH_MAX]; - _tinydir_char_t name[_TINYDIR_FILENAME_MAX]; - _tinydir_char_t *extension; - int is_dir; - int is_reg; + _tinydir_char_t path[_TINYDIR_PATH_MAX]; + _tinydir_char_t name[_TINYDIR_FILENAME_MAX]; + _tinydir_char_t *extension; + int is_dir; + int is_reg; #ifndef _MSC_VER #ifdef __MINGW32__ - struct _stat _s; + struct _stat _s; #else - struct stat _s; + struct stat _s; #endif #endif } tinydir_file; typedef struct tinydir_dir { - _tinydir_char_t path[_TINYDIR_PATH_MAX]; - int has_next; - size_t n_files; + _tinydir_char_t path[_TINYDIR_PATH_MAX]; + int has_next; + size_t n_files; - tinydir_file *_files; + tinydir_file *_files; #ifdef _MSC_VER - HANDLE _h; - WIN32_FIND_DATA _f; + HANDLE _h; + WIN32_FIND_DATA _f; #else - _TINYDIR_DIR *_d; - struct _tinydir_dirent *_e; + _TINYDIR_DIR *_d; + struct _tinydir_dirent *_e; #ifndef _TINYDIR_USE_READDIR - struct _tinydir_dirent *_ep; + struct _tinydir_dirent *_ep; #endif #endif } tinydir_dir; @@ -252,184 +252,184 @@ int tinydir_open(tinydir_dir *dir, const _tinydir_char_t *path) { #ifndef _MSC_VER #ifndef _TINYDIR_USE_READDIR - int error; - int size; /* using int size */ + int error; + int size; /* using int size */ #endif #else - _tinydir_char_t path_buf[_TINYDIR_PATH_MAX]; -#endif - _tinydir_char_t *pathp; - - if (dir == NULL || path == NULL || _tinydir_strlen(path) == 0) - { - errno = EINVAL; - return -1; - } - if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) - { - errno = ENAMETOOLONG; - return -1; - } - - /* initialise dir */ - dir->_files = NULL; + _tinydir_char_t path_buf[_TINYDIR_PATH_MAX]; +#endif + _tinydir_char_t *pathp; + + if (dir == NULL || path == NULL || _tinydir_strlen(path) == 0) + { + errno = EINVAL; + return -1; + } + if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) + { + errno = ENAMETOOLONG; + return -1; + } + + /* initialise dir */ + dir->_files = NULL; #ifdef _MSC_VER - dir->_h = INVALID_HANDLE_VALUE; + dir->_h = INVALID_HANDLE_VALUE; #else - dir->_d = NULL; + dir->_d = NULL; #ifndef _TINYDIR_USE_READDIR - dir->_ep = NULL; + dir->_ep = NULL; #endif #endif - tinydir_close(dir); + tinydir_close(dir); - _tinydir_strcpy(dir->path, path); - /* Remove trailing slashes */ - pathp = &dir->path[_tinydir_strlen(dir->path) - 1]; - while (pathp != dir->path && (*pathp == TINYDIR_STRING('\\') || *pathp == TINYDIR_STRING('/'))) - { - *pathp = TINYDIR_STRING('\0'); - pathp++; - } + _tinydir_strcpy(dir->path, path); + /* Remove trailing slashes */ + pathp = &dir->path[_tinydir_strlen(dir->path) - 1]; + while (pathp != dir->path && (*pathp == TINYDIR_STRING('\\') || *pathp == TINYDIR_STRING('/'))) + { + *pathp = TINYDIR_STRING('\0'); + pathp++; + } #ifdef _MSC_VER - _tinydir_strcpy(path_buf, dir->path); - _tinydir_strcat(path_buf, TINYDIR_STRING("\\*")); + _tinydir_strcpy(path_buf, dir->path); + _tinydir_strcat(path_buf, TINYDIR_STRING("\\*")); #if (defined WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) - dir->_h = FindFirstFileEx(path_buf, FindExInfoStandard, &dir->_f, FindExSearchNameMatch, NULL, 0); + dir->_h = FindFirstFileEx(path_buf, FindExInfoStandard, &dir->_f, FindExSearchNameMatch, NULL, 0); #else - dir->_h = FindFirstFile(path_buf, &dir->_f); + dir->_h = FindFirstFile(path_buf, &dir->_f); #endif - if (dir->_h == INVALID_HANDLE_VALUE) - { - errno = ENOENT; + if (dir->_h == INVALID_HANDLE_VALUE) + { + errno = ENOENT; #else - dir->_d = _tinydir_opendir(path); - if (dir->_d == NULL) - { + dir->_d = _tinydir_opendir(path); + if (dir->_d == NULL) + { #endif - goto bail; - } + goto bail; + } - /* read first file */ - dir->has_next = 1; + /* read first file */ + dir->has_next = 1; #ifndef _MSC_VER #ifdef _TINYDIR_USE_READDIR - dir->_e = _tinydir_readdir(dir->_d); + dir->_e = _tinydir_readdir(dir->_d); #else - /* allocate dirent buffer for readdir_r */ - size = _tinydir_dirent_buf_size(dir->_d); /* conversion to int */ - if (size == -1) return -1; - dir->_ep = (struct _tinydir_dirent*)_TINYDIR_MALLOC(size); - if (dir->_ep == NULL) return -1; + /* allocate dirent buffer for readdir_r */ + size = _tinydir_dirent_buf_size(dir->_d); /* conversion to int */ + if (size == -1) return -1; + dir->_ep = (struct _tinydir_dirent*)_TINYDIR_MALLOC(size); + if (dir->_ep == NULL) return -1; - error = readdir_r(dir->_d, dir->_ep, &dir->_e); - if (error != 0) return -1; + error = readdir_r(dir->_d, dir->_ep, &dir->_e); + if (error != 0) return -1; #endif - if (dir->_e == NULL) - { - dir->has_next = 0; - } + if (dir->_e == NULL) + { + dir->has_next = 0; + } #endif - return 0; + return 0; bail: - tinydir_close(dir); - return -1; + tinydir_close(dir); + return -1; } _TINYDIR_FUNC int tinydir_open_sorted(tinydir_dir *dir, const _tinydir_char_t *path) { - /* Count the number of files first, to pre-allocate the files array */ - size_t n_files = 0; - if (tinydir_open(dir, path) == -1) - { - return -1; - } - while (dir->has_next) - { - n_files++; - if (tinydir_next(dir) == -1) - { - goto bail; - } - } - tinydir_close(dir); - - if (tinydir_open(dir, path) == -1) - { - return -1; - } - - dir->n_files = 0; - dir->_files = (tinydir_file *)_TINYDIR_MALLOC(sizeof *dir->_files * n_files); - if (dir->_files == NULL) - { - goto bail; - } - while (dir->has_next) - { - tinydir_file *p_file; - dir->n_files++; - - p_file = &dir->_files[dir->n_files - 1]; - if (tinydir_readfile(dir, p_file) == -1) - { - goto bail; - } - - if (tinydir_next(dir) == -1) - { - goto bail; - } - - /* Just in case the number of files has changed between the first and - second reads, terminate without writing into unallocated memory */ - if (dir->n_files == n_files) - { - break; - } - } - - qsort(dir->_files, dir->n_files, sizeof(tinydir_file), _tinydir_file_cmp); - - return 0; + /* Count the number of files first, to pre-allocate the files array */ + size_t n_files = 0; + if (tinydir_open(dir, path) == -1) + { + return -1; + } + while (dir->has_next) + { + n_files++; + if (tinydir_next(dir) == -1) + { + goto bail; + } + } + tinydir_close(dir); + + if (tinydir_open(dir, path) == -1) + { + return -1; + } + + dir->n_files = 0; + dir->_files = (tinydir_file *)_TINYDIR_MALLOC(sizeof *dir->_files * n_files); + if (dir->_files == NULL) + { + goto bail; + } + while (dir->has_next) + { + tinydir_file *p_file; + dir->n_files++; + + p_file = &dir->_files[dir->n_files - 1]; + if (tinydir_readfile(dir, p_file) == -1) + { + goto bail; + } + + if (tinydir_next(dir) == -1) + { + goto bail; + } + + /* Just in case the number of files has changed between the first and + second reads, terminate without writing into unallocated memory */ + if (dir->n_files == n_files) + { + break; + } + } + + qsort(dir->_files, dir->n_files, sizeof(tinydir_file), _tinydir_file_cmp); + + return 0; bail: - tinydir_close(dir); - return -1; + tinydir_close(dir); + return -1; } _TINYDIR_FUNC void tinydir_close(tinydir_dir *dir) { - if (dir == NULL) - { - return; - } - - memset(dir->path, 0, sizeof(dir->path)); - dir->has_next = 0; - dir->n_files = 0; - _TINYDIR_FREE(dir->_files); - dir->_files = NULL; + if (dir == NULL) + { + return; + } + + memset(dir->path, 0, sizeof(dir->path)); + dir->has_next = 0; + dir->n_files = 0; + _TINYDIR_FREE(dir->_files); + dir->_files = NULL; #ifdef _MSC_VER - if (dir->_h != INVALID_HANDLE_VALUE) - { - FindClose(dir->_h); - } - dir->_h = INVALID_HANDLE_VALUE; + if (dir->_h != INVALID_HANDLE_VALUE) + { + FindClose(dir->_h); + } + dir->_h = INVALID_HANDLE_VALUE; #else - if (dir->_d) - { - _tinydir_closedir(dir->_d); - } - dir->_d = NULL; - dir->_e = NULL; + if (dir->_d) + { + _tinydir_closedir(dir->_d); + } + dir->_d = NULL; + dir->_e = NULL; #ifndef _TINYDIR_USE_READDIR - _TINYDIR_FREE(dir->_ep); - dir->_ep = NULL; + _TINYDIR_FREE(dir->_ep); + dir->_ep = NULL; #endif #endif } @@ -437,323 +437,323 @@ void tinydir_close(tinydir_dir *dir) _TINYDIR_FUNC int tinydir_next(tinydir_dir *dir) { - if (dir == NULL) - { - errno = EINVAL; - return -1; - } - if (!dir->has_next) - { - errno = ENOENT; - return -1; - } + if (dir == NULL) + { + errno = EINVAL; + return -1; + } + if (!dir->has_next) + { + errno = ENOENT; + return -1; + } #ifdef _MSC_VER - if (FindNextFile(dir->_h, &dir->_f) == 0) + if (FindNextFile(dir->_h, &dir->_f) == 0) #else #ifdef _TINYDIR_USE_READDIR - dir->_e = _tinydir_readdir(dir->_d); + dir->_e = _tinydir_readdir(dir->_d); #else - if (dir->_ep == NULL) - { - return -1; - } - if (readdir_r(dir->_d, dir->_ep, &dir->_e) != 0) - { - return -1; - } -#endif - if (dir->_e == NULL) -#endif - { - dir->has_next = 0; + if (dir->_ep == NULL) + { + return -1; + } + if (readdir_r(dir->_d, dir->_ep, &dir->_e) != 0) + { + return -1; + } +#endif + if (dir->_e == NULL) +#endif + { + dir->has_next = 0; #ifdef _MSC_VER - if (GetLastError() != ERROR_SUCCESS && - GetLastError() != ERROR_NO_MORE_FILES) - { - tinydir_close(dir); - errno = EIO; - return -1; - } + if (GetLastError() != ERROR_SUCCESS && + GetLastError() != ERROR_NO_MORE_FILES) + { + tinydir_close(dir); + errno = EIO; + return -1; + } #endif - } + } - return 0; + return 0; } _TINYDIR_FUNC int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file) { - if (dir == NULL || file == NULL) - { - errno = EINVAL; - return -1; - } + if (dir == NULL || file == NULL) + { + errno = EINVAL; + return -1; + } #ifdef _MSC_VER - if (dir->_h == INVALID_HANDLE_VALUE) + if (dir->_h == INVALID_HANDLE_VALUE) #else - if (dir->_e == NULL) -#endif - { - errno = ENOENT; - return -1; - } - if (_tinydir_strlen(dir->path) + - _tinydir_strlen( + if (dir->_e == NULL) +#endif + { + errno = ENOENT; + return -1; + } + if (_tinydir_strlen(dir->path) + + _tinydir_strlen( #ifdef _MSC_VER - dir->_f.cFileName + dir->_f.cFileName #else - dir->_e->d_name -#endif - ) + 1 + _TINYDIR_PATH_EXTRA >= - _TINYDIR_PATH_MAX) - { - /* the path for the file will be too long */ - errno = ENAMETOOLONG; - return -1; - } - if (_tinydir_strlen( + dir->_e->d_name +#endif + ) + 1 + _TINYDIR_PATH_EXTRA >= + _TINYDIR_PATH_MAX) + { + /* the path for the file will be too long */ + errno = ENAMETOOLONG; + return -1; + } + if (_tinydir_strlen( #ifdef _MSC_VER - dir->_f.cFileName + dir->_f.cFileName #else - dir->_e->d_name + dir->_e->d_name #endif - ) >= _TINYDIR_FILENAME_MAX) - { - errno = ENAMETOOLONG; - return -1; - } + ) >= _TINYDIR_FILENAME_MAX) + { + errno = ENAMETOOLONG; + return -1; + } - _tinydir_strcpy(file->path, dir->path); - _tinydir_strcat(file->path, TINYDIR_STRING("/")); - _tinydir_strcpy(file->name, + _tinydir_strcpy(file->path, dir->path); + _tinydir_strcat(file->path, TINYDIR_STRING("/")); + _tinydir_strcpy(file->name, #ifdef _MSC_VER - dir->_f.cFileName + dir->_f.cFileName #else - dir->_e->d_name + dir->_e->d_name #endif - ); - _tinydir_strcat(file->path, file->name); + ); + _tinydir_strcat(file->path, file->name); #ifndef _MSC_VER #ifdef __MINGW32__ - if (_tstat( + if (_tstat( #else - if (stat( + if (stat( #endif - file->path, &file->_s) == -1) - { - return -1; - } + file->path, &file->_s) == -1) + { + return -1; + } #endif - _tinydir_get_ext(file); + _tinydir_get_ext(file); - file->is_dir = + file->is_dir = #ifdef _MSC_VER - !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); #else - S_ISDIR(file->_s.st_mode); + S_ISDIR(file->_s.st_mode); #endif - file->is_reg = + file->is_reg = #ifdef _MSC_VER - !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) || - ( - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) && - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) && + !!(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NORMAL) || + ( + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) && #ifdef FILE_ATTRIBUTE_INTEGRITY_STREAM - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_INTEGRITY_STREAM) && #endif #ifdef FILE_ATTRIBUTE_NO_SCRUB_DATA - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_NO_SCRUB_DATA) && #endif - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) && - !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY)); + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_OFFLINE) && + !(dir->_f.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY)); #else - S_ISREG(file->_s.st_mode); + S_ISREG(file->_s.st_mode); #endif - return 0; + return 0; } _TINYDIR_FUNC int tinydir_readfile_n(const tinydir_dir *dir, tinydir_file *file, size_t i) { - if (dir == NULL || file == NULL) - { - errno = EINVAL; - return -1; - } - if (i >= dir->n_files) - { - errno = ENOENT; - return -1; - } - - memcpy(file, &dir->_files[i], sizeof(tinydir_file)); - _tinydir_get_ext(file); - - return 0; + if (dir == NULL || file == NULL) + { + errno = EINVAL; + return -1; + } + if (i >= dir->n_files) + { + errno = ENOENT; + return -1; + } + + memcpy(file, &dir->_files[i], sizeof(tinydir_file)); + _tinydir_get_ext(file); + + return 0; } _TINYDIR_FUNC int tinydir_open_subdir_n(tinydir_dir *dir, size_t i) { - _tinydir_char_t path[_TINYDIR_PATH_MAX]; - if (dir == NULL) - { - errno = EINVAL; - return -1; - } - if (i >= dir->n_files || !dir->_files[i].is_dir) - { - errno = ENOENT; - return -1; - } - - _tinydir_strcpy(path, dir->_files[i].path); - tinydir_close(dir); - if (tinydir_open_sorted(dir, path) == -1) - { - return -1; - } - - return 0; + _tinydir_char_t path[_TINYDIR_PATH_MAX]; + if (dir == NULL) + { + errno = EINVAL; + return -1; + } + if (i >= dir->n_files || !dir->_files[i].is_dir) + { + errno = ENOENT; + return -1; + } + + _tinydir_strcpy(path, dir->_files[i].path); + tinydir_close(dir); + if (tinydir_open_sorted(dir, path) == -1) + { + return -1; + } + + return 0; } /* Open a single file given its path */ _TINYDIR_FUNC int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path) { - tinydir_dir dir; - int result = 0; - int found = 0; - _tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX]; - _tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX]; - _tinydir_char_t *dir_name; - _tinydir_char_t *base_name; + tinydir_dir dir; + int result = 0; + int found = 0; + _tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX]; + _tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX]; + _tinydir_char_t *dir_name; + _tinydir_char_t *base_name; #if (defined _MSC_VER || defined __MINGW32__) - _tinydir_char_t drive_buf[_TINYDIR_PATH_MAX]; - _tinydir_char_t ext_buf[_TINYDIR_FILENAME_MAX]; -#endif - - if (file == NULL || path == NULL || _tinydir_strlen(path) == 0) - { - errno = EINVAL; - return -1; - } - if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) - { - errno = ENAMETOOLONG; - return -1; - } - - /* Get the parent path */ + _tinydir_char_t drive_buf[_TINYDIR_PATH_MAX]; + _tinydir_char_t ext_buf[_TINYDIR_FILENAME_MAX]; +#endif + + if (file == NULL || path == NULL || _tinydir_strlen(path) == 0) + { + errno = EINVAL; + return -1; + } + if (_tinydir_strlen(path) + _TINYDIR_PATH_EXTRA >= _TINYDIR_PATH_MAX) + { + errno = ENAMETOOLONG; + return -1; + } + + /* Get the parent path */ #if (defined _MSC_VER || defined __MINGW32__) #if ((defined _MSC_VER) && (_MSC_VER >= 1400)) - _tsplitpath_s( - path, - drive_buf, _TINYDIR_DRIVE_MAX, - dir_name_buf, _TINYDIR_FILENAME_MAX, - file_name_buf, _TINYDIR_FILENAME_MAX, - ext_buf, _TINYDIR_FILENAME_MAX); + _tsplitpath_s( + path, + drive_buf, _TINYDIR_DRIVE_MAX, + dir_name_buf, _TINYDIR_FILENAME_MAX, + file_name_buf, _TINYDIR_FILENAME_MAX, + ext_buf, _TINYDIR_FILENAME_MAX); #else - _tsplitpath( - path, - drive_buf, - dir_name_buf, - file_name_buf, - ext_buf); + _tsplitpath( + path, + drive_buf, + dir_name_buf, + file_name_buf, + ext_buf); #endif /* _splitpath_s not work fine with only filename and widechar support */ #ifdef _UNICODE - if (drive_buf[0] == L'\xFEFE') - drive_buf[0] = '\0'; - if (dir_name_buf[0] == L'\xFEFE') - dir_name_buf[0] = '\0'; -#endif - - if (errno) - { - errno = EINVAL; - return -1; - } - /* Emulate the behavior of dirname by returning "." for dir name if it's - empty */ - if (drive_buf[0] == '\0' && dir_name_buf[0] == '\0') - { - _tinydir_strcpy(dir_name_buf, TINYDIR_STRING(".")); - } - /* Concatenate the drive letter and dir name to form full dir name */ - _tinydir_strcat(drive_buf, dir_name_buf); - dir_name = drive_buf; - /* Concatenate the file name and extension to form base name */ - _tinydir_strcat(file_name_buf, ext_buf); - base_name = file_name_buf; + if (drive_buf[0] == L'\xFEFE') + drive_buf[0] = '\0'; + if (dir_name_buf[0] == L'\xFEFE') + dir_name_buf[0] = '\0'; +#endif + + if (errno) + { + errno = EINVAL; + return -1; + } + /* Emulate the behavior of dirname by returning "." for dir name if it's + empty */ + if (drive_buf[0] == '\0' && dir_name_buf[0] == '\0') + { + _tinydir_strcpy(dir_name_buf, TINYDIR_STRING(".")); + } + /* Concatenate the drive letter and dir name to form full dir name */ + _tinydir_strcat(drive_buf, dir_name_buf); + dir_name = drive_buf; + /* Concatenate the file name and extension to form base name */ + _tinydir_strcat(file_name_buf, ext_buf); + base_name = file_name_buf; #else - _tinydir_strcpy(dir_name_buf, path); - dir_name = dirname(dir_name_buf); - _tinydir_strcpy(file_name_buf, path); - base_name =basename(file_name_buf); -#endif - - /* Open the parent directory */ - if (tinydir_open(&dir, dir_name) == -1) - { - return -1; - } - - /* Read through the parent directory and look for the file */ - while (dir.has_next) - { - if (tinydir_readfile(&dir, file) == -1) - { - result = -1; - goto bail; - } - if (_tinydir_strcmp(file->name, base_name) == 0) - { - /* File found */ - found = 1; - break; - } - tinydir_next(&dir); - } - if (!found) - { - result = -1; - errno = ENOENT; - } + _tinydir_strcpy(dir_name_buf, path); + dir_name = dirname(dir_name_buf); + _tinydir_strcpy(file_name_buf, path); + base_name =basename(file_name_buf); +#endif + + /* Open the parent directory */ + if (tinydir_open(&dir, dir_name) == -1) + { + return -1; + } + + /* Read through the parent directory and look for the file */ + while (dir.has_next) + { + if (tinydir_readfile(&dir, file) == -1) + { + result = -1; + goto bail; + } + if (_tinydir_strcmp(file->name, base_name) == 0) + { + /* File found */ + found = 1; + break; + } + tinydir_next(&dir); + } + if (!found) + { + result = -1; + errno = ENOENT; + } bail: - tinydir_close(&dir); - return result; + tinydir_close(&dir); + return result; } _TINYDIR_FUNC void _tinydir_get_ext(tinydir_file *file) { - _tinydir_char_t *period = _tinydir_strrchr(file->name, TINYDIR_STRING('.')); - if (period == NULL) - { - file->extension = &(file->name[_tinydir_strlen(file->name)]); - } - else - { - file->extension = period + 1; - } + _tinydir_char_t *period = _tinydir_strrchr(file->name, TINYDIR_STRING('.')); + if (period == NULL) + { + file->extension = &(file->name[_tinydir_strlen(file->name)]); + } + else + { + file->extension = period + 1; + } } _TINYDIR_FUNC int _tinydir_file_cmp(const void *a, const void *b) { - const tinydir_file *fa = (const tinydir_file *)a; - const tinydir_file *fb = (const tinydir_file *)b; - if (fa->is_dir != fb->is_dir) - { - return -(fa->is_dir - fb->is_dir); - } - return _tinydir_strncmp(fa->name, fb->name, _TINYDIR_FILENAME_MAX); + const tinydir_file *fa = (const tinydir_file *)a; + const tinydir_file *fb = (const tinydir_file *)b; + if (fa->is_dir != fb->is_dir) + { + return -(fa->is_dir - fb->is_dir); + } + return _tinydir_strncmp(fa->name, fb->name, _TINYDIR_FILENAME_MAX); } #ifndef _MSC_VER @@ -772,27 +772,27 @@ from https://womble.decadent.org.uk/readdir_r-advisory.html _TINYDIR_FUNC size_t _tinydir_dirent_buf_size(_TINYDIR_DIR *dirp) { - long name_max; - size_t name_end; - /* parameter may be unused */ - (void)dirp; + long name_max; + size_t name_end; + /* parameter may be unused */ + (void)dirp; #if defined _TINYDIR_USE_FPATHCONF - name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX); - if (name_max == -1) + name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX); + if (name_max == -1) #if defined(NAME_MAX) - name_max = (NAME_MAX > 255) ? NAME_MAX : 255; + name_max = (NAME_MAX > 255) ? NAME_MAX : 255; #else - return (size_t)(-1); + return (size_t)(-1); #endif #elif defined(NAME_MAX) - name_max = (NAME_MAX > 255) ? NAME_MAX : 255; + name_max = (NAME_MAX > 255) ? NAME_MAX : 255; #else #error "buffer size for readdir_r cannot be determined" #endif - name_end = (size_t)offsetof(struct _tinydir_dirent, d_name) + name_max + 1; - return (name_end > sizeof(struct _tinydir_dirent) ? - name_end : sizeof(struct _tinydir_dirent)); + name_end = (size_t)offsetof(struct _tinydir_dirent, d_name) + name_max + 1; + return (name_end > sizeof(struct _tinydir_dirent) ? + name_end : sizeof(struct _tinydir_dirent)); } #endif #endif diff --git a/components/net/lwip-2.1.2/src/apps/smtp/smtp.c b/components/net/lwip-2.1.2/src/apps/smtp/smtp.c index 2aa21ce045..55303c35d4 100644 --- a/components/net/lwip-2.1.2/src/apps/smtp/smtp.c +++ b/components/net/lwip-2.1.2/src/apps/smtp/smtp.c @@ -1,12 +1,12 @@ /** * @file * SMTP client module - * + * * Author: Simon Goldschmidt * * @defgroup smtp SMTP client * @ingroup apps - * + * * This is simple SMTP client for raw API. * It is a minimal implementation of SMTP as specified in RFC 5321. * @@ -29,7 +29,7 @@ * When using from any other thread than the tcpip_thread (for NO_SYS==0), use * smtp_send_mail_int()! - * + * * SMTP_BODYDH usage: @code{.c} int my_smtp_bodydh_fn(void *arg, struct smtp_bodydh *bdh) @@ -42,11 +42,11 @@ ++bdh->state; return BDH_WORKING; } - - smtp_send_mail_bodycback("sender", "recipient", "subject", + + smtp_send_mail_bodycback("sender", "recipient", "subject", my_smtp_bodydh_fn, my_smtp_result_fn, some_argument); @endcode - * + * * @todo: * - attachments (the main difficulty here is streaming base64-encoding to * prevent having to allocate a buffer for the whole encoded file at once) diff --git a/components/net/lwip-2.1.2/src/arch/include/arch/perf.h b/components/net/lwip-2.1.2/src/arch/include/arch/perf.h index 4b7720ef40..675f1f65dc 100644 --- a/components/net/lwip-2.1.2/src/arch/include/arch/perf.h +++ b/components/net/lwip-2.1.2/src/arch/include/arch/perf.h @@ -1,33 +1,33 @@ /* * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * * $Id: perf.h,v 1.1.1.1 2004/12/16 14:17:13 bear Exp $ @@ -42,8 +42,8 @@ /* void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); + unsigned long c2l, unsigned long c2h, + char *key); void perf_print_times(struct tms *start, struct tms *end, char *key); diff --git a/components/net/lwip-2.1.2/src/core/altcp.c b/components/net/lwip-2.1.2/src/core/altcp.c index 1156307aca..d46d6cdb1d 100644 --- a/components/net/lwip-2.1.2/src/core/altcp.c +++ b/components/net/lwip-2.1.2/src/core/altcp.c @@ -158,7 +158,7 @@ altcp_free(struct altcp_pcb *conn) /** * @ingroup altcp - * altcp_new_ip6: @ref altcp_new for IPv6 + * altcp_new_ip6: @ref altcp_new for IPv6 */ struct altcp_pcb * altcp_new_ip6(altcp_allocator_t *allocator) @@ -166,9 +166,9 @@ altcp_new_ip6(altcp_allocator_t *allocator) return altcp_new_ip_type(allocator, IPADDR_TYPE_V6); } -/** +/** * @ingroup altcp - * altcp_new: @ref altcp_new for IPv4 + * altcp_new: @ref altcp_new for IPv4 */ struct altcp_pcb * altcp_new(altcp_allocator_t *allocator) diff --git a/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c b/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c index 1427900ebd..534574feac 100644 --- a/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c +++ b/components/net/lwip-2.1.2/src/core/ipv4/dhcp.c @@ -1743,7 +1743,7 @@ decode_next: /* make sure the string is really NULL-terminated */ dhcp->boot_file_name[DHCP_FILE_LEN-1] = 0; } -#endif /* LWIP_DHCP_BOOTP_FILE */ +#endif /* LWIP_DHCP_BOOTP_FILE */ return ERR_OK; } diff --git a/components/net/lwip-2.1.2/src/core/ipv6/ip6.c b/components/net/lwip-2.1.2/src/core/ipv6/ip6.c index afa69f1be9..eda11dc882 100644 --- a/components/net/lwip-2.1.2/src/core/ipv6/ip6.c +++ b/components/net/lwip-2.1.2/src/core/ipv6/ip6.c @@ -1047,7 +1047,7 @@ options_done: LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: p->len %"U16_F" p->tot_len %"U16_F"\n", p->len, p->tot_len)); ip_data.current_ip_header_tot_len = hlen_tot; - + #if LWIP_RAW /* p points to IPv6 header again for raw_input. */ pbuf_add_header_force(p, hlen_tot); diff --git a/components/net/lwip-2.1.2/src/core/ipv6/mld6.c b/components/net/lwip-2.1.2/src/core/ipv6/mld6.c index fb4e9ef49a..6387d468cc 100644 --- a/components/net/lwip-2.1.2/src/core/ipv6/mld6.c +++ b/components/net/lwip-2.1.2/src/core/ipv6/mld6.c @@ -6,7 +6,7 @@ * @ingroup ip6 * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. * No support for MLDv2.\n - * Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your + * Note: The allnodes (ff01::1, ff02::1) group is assumed be received by your * netif since it must always be received for correct IPv6 operation (e.g. SLAAC). * Ensure the netif filters are configured accordingly!\n * The netif flags also need NETIF_FLAG_MLD6 flag set to enable MLD6 on a diff --git a/components/net/lwip-2.1.2/src/core/ipv6/nd6.c b/components/net/lwip-2.1.2/src/core/ipv6/nd6.c index 75899c65f4..db0c132e48 100644 --- a/components/net/lwip-2.1.2/src/core/ipv6/nd6.c +++ b/components/net/lwip-2.1.2/src/core/ipv6/nd6.c @@ -1835,9 +1835,9 @@ nd6_new_router(const ip6_addr_t *router_addr, struct netif *netif) for (router_index = LWIP_ND6_NUM_ROUTERS - 1; router_index >= 0; router_index--) { /* check if router already exists (this is a special case for 2 netifs on the same subnet - e.g. wifi and cable) */ - if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ - return router_index; - } + if(default_router_list[router_index].neighbor_entry == &(neighbor_cache[neighbor_index])){ + return router_index; + } if (default_router_list[router_index].neighbor_entry == NULL) { /* remember lowest free index to create a new entry */ free_router_index = router_index; diff --git a/components/net/lwip-2.1.2/src/core/sys.c b/components/net/lwip-2.1.2/src/core/sys.c index 69d7197a1f..5f08352bfb 100644 --- a/components/net/lwip-2.1.2/src/core/sys.c +++ b/components/net/lwip-2.1.2/src/core/sys.c @@ -45,30 +45,30 @@ * No need to implement functions in this section in NO_SYS mode. * The OS-specific code should be implemented in arch/sys_arch.h * and sys_arch.c of your port. - * + * * The operating system emulation layer provides a common interface * between the lwIP code and the underlying operating system kernel. The * general idea is that porting lwIP to new architectures requires only * small changes to a few header files and a new sys_arch * implementation. It is also possible to do a sys_arch implementation * that does not rely on any underlying operating system. - * + * * The sys_arch provides semaphores, mailboxes and mutexes to lwIP. For the full * lwIP functionality, multiple threads support can be implemented in the * sys_arch, but this is not required for the basic lwIP * functionality. Timer scheduling is implemented in lwIP, but can be implemented * by the sys_arch port (LWIP_TIMERS_CUSTOM==1). - * + * * In addition to the source file providing the functionality of sys_arch, * the OS emulation layer must provide several header files defining * macros used throughout lwip. The files required and the macros they * must define are listed below the sys_arch description. - * + * * Since lwIP 1.4.0, semaphore, mutexes and mailbox functions are prototyped in a way that * allows both using pointers or actual OS structures to be used. This way, memory * required for such types can be either allocated in place (globally or on the * stack) or on the heap (allocated internally in the "*_new()" functions). - * + * * Note: * ----- * Be careful with using mem_malloc() in sys_arch. When malloc() refers to @@ -96,7 +96,7 @@ * Mailboxes should be implemented as a queue which allows multiple messages * to be posted (implementing as a rendez-vous point where only one message can be * posted at a time can have a highly negative impact on performance). A message - * in a mailbox is just a pointer, nothing more. + * in a mailbox is just a pointer, nothing more. * * @defgroup sys_time Time * @ingroup sys_layer diff --git a/components/net/lwip-2.1.2/src/core/tcp.c b/components/net/lwip-2.1.2/src/core/tcp.c index 10aaf21968..bd7d64ec39 100644 --- a/components/net/lwip-2.1.2/src/core/tcp.c +++ b/components/net/lwip-2.1.2/src/core/tcp.c @@ -11,7 +11,7 @@ * Common functions for the TCP implementation, such as functions * for manipulating the data structures and the TCP timer functions. TCP functions * related to input and output is found in tcp_in.c and tcp_out.c respectively.\n - * + * * TCP connection setup * -------------------- * The functions used for setting up connections is similar to that of @@ -24,7 +24,7 @@ * - tcp_listen() and tcp_listen_with_backlog() * - tcp_accept() * - tcp_connect() - * + * * Sending TCP data * ---------------- * TCP data is sent by enqueueing the data with a call to tcp_write() and @@ -34,7 +34,7 @@ * - tcp_write() * - tcp_output() * - tcp_sent() - * + * * Receiving TCP data * ------------------ * TCP data reception is callback based - an application specified @@ -44,7 +44,7 @@ * window. * - tcp_recv() * - tcp_recved() - * + * * Application polling * ------------------- * When a connection is idle (i.e., no data is either transmitted or @@ -62,7 +62,7 @@ * - tcp_close() * - tcp_abort() * - tcp_err() - * + * */ /* @@ -469,7 +469,7 @@ tcp_close_shutdown_fin(struct tcp_pcb *pcb) * a closing state), the connection is closed, and put in a closing state. * The pcb is then automatically freed in tcp_slowtmr(). It is therefore * unsafe to reference it (unless an error is returned). - * + * * The function may return ERR_MEM if no memory * was available for closing the connection. If so, the application * should wait and try again either by using the acknowledgment @@ -797,7 +797,7 @@ tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) * When an incoming connection is accepted, the function specified with * the tcp_accept() function will be called. The pcb has to be bound * to a local port with the tcp_bind() function. - * + * * The tcp_listen() function returns a new connection identifier, and * the one passed as an argument to the function will be * deallocated. The reason for this behavior is that less memory is @@ -812,7 +812,7 @@ tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) * The backlog limits the number of outstanding connections * in the listen queue to the value specified by the backlog argument. * To use it, your need to set TCP_LISTEN_BACKLOG=1 in your lwipopts.h. - * + * * @param pcb the original tcp_pcb * @param backlog the incoming connections queue limit * @return tcp_pcb used for listening, consumes less memory. @@ -1039,7 +1039,7 @@ again: * Connects to another host. The function given as the "connected" * argument will be called when the connection has been established. * Sets up the pcb to connect to the remote host and sends the - * initial SYN segment which opens the connection. + * initial SYN segment which opens the connection. * * The tcp_connect() function returns immediately; it does not wait for * the connection to be properly setup. Instead, it will call the @@ -1711,14 +1711,14 @@ tcp_kill_prio(u8_t prio) mprio = LWIP_MIN(TCP_PRIO_MAX, prio); - /* We want to kill connections with a lower prio, so bail out if + /* We want to kill connections with a lower prio, so bail out if * supplied prio is 0 - there can never be a lower prio */ if (mprio == 0) { return; } - /* We only want kill connections with a lower prio, so decrement prio by one + /* We only want kill connections with a lower prio, so decrement prio by one * and start searching for oldest connection with same or lower priority than mprio. * We want to find the connections with the lowest possible prio, and among * these the one with the longest inactivity time. @@ -2041,7 +2041,7 @@ tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent) * @ingroup tcp_raw * Used to specify the function that should be called when a fatal error * has occurred on the connection. - * + * * If a connection is aborted because of an error, the application is * alerted of this event by the err callback. Errors that might abort a * connection are when there is a shortage of memory. The callback @@ -2091,7 +2091,7 @@ tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept) * number of TCP coarse grained timer shots, which typically occurs * twice a second. An interval of 10 means that the application would * be polled every 5 seconds. - * + * * When a connection is idle (i.e., no data is either transmitted or * received), lwIP will repeatedly poll the application by calling a * specified callback function. This can be used either as a watchdog diff --git a/components/net/lwip-2.1.2/src/core/tcp_out.c b/components/net/lwip-2.1.2/src/core/tcp_out.c index a00ce23f66..724df1097c 100644 --- a/components/net/lwip-2.1.2/src/core/tcp_out.c +++ b/components/net/lwip-2.1.2/src/core/tcp_out.c @@ -355,7 +355,7 @@ tcp_write_checks(struct tcp_pcb *pcb, u16_t len) * it can send them more efficiently by combining them together). * To prompt the system to send data now, call tcp_output() after * calling tcp_write(). - * + * * This function enqueues the data pointed to by the argument dataptr. The length of * the data is passed as the len parameter. The apiflags can be one or more of: * - TCP_WRITE_FLAG_COPY: indicates whether the new memory should be allocated diff --git a/components/net/lwip-2.1.2/src/core/timeouts.c b/components/net/lwip-2.1.2/src/core/timeouts.c index 8c8d497271..f37acfec99 100644 --- a/components/net/lwip-2.1.2/src/core/timeouts.c +++ b/components/net/lwip-2.1.2/src/core/timeouts.c @@ -241,7 +241,7 @@ lwip_cyclic_timer(void *arg) cyclic->handler(); now = sys_now(); - next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */ + next_timeout_time = (u32_t)(current_timeout_due_time + cyclic->interval_ms); /* overflow handled by TIME_LESS_THAN macro */ if (TIME_LESS_THAN(next_timeout_time, now)) { /* timer would immediately expire again -> "overload" -> restart without any correction */ #if LWIP_DEBUG_TIMERNAMES @@ -296,7 +296,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) LWIP_ASSERT("Timeout time too long, max is LWIP_UINT32_MAX/4 msecs", msecs <= (LWIP_UINT32_MAX / 4)); - next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */ + next_timeout_time = (u32_t)(sys_now() + msecs); /* overflow handled by TIME_LESS_THAN macro */ #if LWIP_DEBUG_TIMERNAMES sys_timeout_abs(next_timeout_time, handler, arg, handler_name); diff --git a/components/net/lwip-2.1.2/src/core/udp.c b/components/net/lwip-2.1.2/src/core/udp.c index 7c25912e67..9d2cb4af7f 100644 --- a/components/net/lwip-2.1.2/src/core/udp.c +++ b/components/net/lwip-2.1.2/src/core/udp.c @@ -911,7 +911,7 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d /** * @ingroup udp_raw * Bind an UDP PCB. - * + * * @param pcb UDP PCB to be bound with a local address ipaddr and port. * @param ipaddr local IP address to bind with. Use IP_ANY_TYPE to * bind to all local interfaces. @@ -1168,8 +1168,8 @@ udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg) /** * @ingroup udp_raw - * Removes and deallocates the pcb. - * + * Removes and deallocates the pcb. + * * @param pcb UDP PCB to be removed. The PCB is removed from the list of * UDP PCB's and the data structure is freed from memory. * @@ -1242,7 +1242,7 @@ udp_new(void) * Create a UDP PCB for specific IP type. * The pcb is not active until it has either been bound to a local address * or connected to a remote address. - * + * * @param type IP address type, see @ref lwip_ip_addr_type definitions. * If you want to listen to IPv4 and IPv6 (dual-stack) packets, * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. diff --git a/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h b/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h index 8b8e48198d..6b8e63a527 100644 --- a/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h +++ b/components/net/lwip-2.1.2/src/include/compat/posix/net/if.h @@ -7,7 +7,7 @@ * Copyright (c) 2017 Joel Cunningham, Garmin International, Inc. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without modification, + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -16,17 +16,17 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. diff --git a/components/net/lwip-2.1.2/src/include/lwip/api.h b/components/net/lwip-2.1.2/src/include/lwip/api.h index 739f8be5bc..c2afaf26d3 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/api.h +++ b/components/net/lwip-2.1.2/src/include/lwip/api.h @@ -153,27 +153,27 @@ enum netconn_state { }; /** Used to inform the callback function about changes - * + * * Event explanation: - * + * * In the netconn implementation, there are three ways to block a client: - * + * * - accept mbox (sys_arch_mbox_fetch(&conn->acceptmbox, &accept_ptr, 0); in netconn_accept()) * - receive mbox (sys_arch_mbox_fetch(&conn->recvmbox, &buf, 0); in netconn_recv_data()) * - send queue is full (sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0); in lwip_netconn_do_write()) - * + * * The events have to be seen as events signaling the state of these mboxes/semaphores. For non-blocking * connections, you need to know in advance whether a call to a netconn function call would block or not, * and these events tell you about that. - * - * RCVPLUS events say: Safe to perform a potentially blocking call call once more. + * + * RCVPLUS events say: Safe to perform a potentially blocking call call once more. * They are counted in sockets - three RCVPLUS events for accept mbox means you are safe * to call netconn_accept 3 times without being blocked. * Same thing for receive mbox. - * + * * RCVMINUS events say: Your call to to a possibly blocking function is "acknowledged". * Socket implementation decrements the counter. - * + * * For TX, there is no need to count, its merely a flag. SENDPLUS means you may send something. * SENDPLUS occurs when enough data was delivered to peer so netconn_send() can be called again. * A SENDMINUS event occurs when the next call to a netconn_send() would be blocking. diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h b/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h index 5be77c1b9d..67b9a60a9c 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/fs.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Adam Dunkels * */ diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h b/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h index d39e1bf829..8a0630833f 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/http_client.h @@ -52,7 +52,7 @@ extern "C" { #endif /** - * @ingroup httpc + * @ingroup httpc * HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly * to disk via fopen/fwrite. * These functions are example implementations of the interface only. @@ -62,13 +62,13 @@ extern "C" { #endif /** - * @ingroup httpc + * @ingroup httpc * The default TCP port used for HTTP */ #define HTTP_DEFAULT_PORT LWIP_IANA_PORT_HTTP /** - * @ingroup httpc + * @ingroup httpc * HTTP client result codes */ typedef enum ehttpc_result { @@ -97,7 +97,7 @@ typedef enum ehttpc_result { typedef struct _httpc_state httpc_state_t; /** - * @ingroup httpc + * @ingroup httpc * Prototype of a http client callback function * * @param arg argument specified when initiating the request @@ -110,7 +110,7 @@ typedef struct _httpc_state httpc_state_t; typedef void (*httpc_result_fn)(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err); /** - * @ingroup httpc + * @ingroup httpc * Prototype of http client callback: called when the headers are received * * @param connection http client connection diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h b/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h index dd0c075de9..8723961fd4 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/httpd_opts.h @@ -175,7 +175,7 @@ #define HTTPD_DEBUG LWIP_DBG_OFF #endif -/** Set this to 1 to use a memp pool for allocating +/** Set this to 1 to use a memp pool for allocating * struct http_state instead of the heap. * If enabled, you'll need to define MEMP_NUM_PARALLEL_HTTPD_CONNS * (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h b/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h index f099812d2e..c2bb2288f4 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/mqtt.h @@ -134,7 +134,7 @@ enum { MQTT_DATA_FLAG_LAST = 1 }; -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish data callback function. Called when data * arrives to a subscribed topic @see mqtt_subscribe @@ -149,7 +149,7 @@ enum { typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags); -/** +/** * @ingroup mqtt * Function prototype for MQTT incoming publish function. Called when an incoming publish * arrives to a subscribed topic @see mqtt_subscribe diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h b/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h index 4ce2d5122b..bc743f679e 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/smtp_opts.h @@ -6,14 +6,14 @@ #ifdef __cplusplus extern "C" { #endif - + /** * @defgroup smtp_opts Options * @ingroup smtp - * + * * @{ */ - + /** Set this to 1 to enable data handler callback on BODY */ #ifndef SMTP_BODYDH #define SMTP_BODYDH 0 diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h b/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h index 5a8a49f8d2..6021c72220 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/snmp_core.h @@ -101,7 +101,7 @@ extern "C" { /** error codes predefined by SNMP prot. */ typedef enum { SNMP_ERR_NOERROR = 0, -/* +/* outdated v1 error codes. do not use anmore! #define SNMP_ERR_NOSUCHNAME 2 use SNMP_ERR_NOSUCHINSTANCE instead #define SNMP_ERR_BADVALUE 3 use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h index ec0b6316aa..198f632b68 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_opts.h @@ -11,7 +11,7 @@ * */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * diff --git a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h index efd50a057b..0a7fbee02a 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h +++ b/components/net/lwip-2.1.2/src/include/lwip/apps/tftp_server.h @@ -11,7 +11,7 @@ * */ -/* +/* * Redistribution and use in source and binary forms, with or without * modification,are permitted provided that the following conditions are met: * @@ -67,7 +67,7 @@ struct tftp_context { */ void (*close)(void* handle); /** - * Read from file + * Read from file * @param handle File handle returned by open() * @param buf Target buffer to copy read data to * @param bytes Number of bytes to copy to buf diff --git a/components/net/lwip-2.1.2/src/include/lwip/arch.h b/components/net/lwip-2.1.2/src/include/lwip/arch.h index fd73dec5fc..1606d4faab 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/arch.h +++ b/components/net/lwip-2.1.2/src/include/lwip/arch.h @@ -74,7 +74,7 @@ /** Platform specific diagnostic output.\n * Note the default implementation pulls in printf, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_DIAG @@ -85,7 +85,7 @@ /** Platform specific assertion handling.\n * Note the default implementation pulls in printf, fflush and abort, which may - * in turn pull in a lot of standard libary code. In resource-constrained + * in turn pull in a lot of standard libary code. In resource-constrained * systems, this should be defined to something less resource-consuming. */ #ifndef LWIP_PLATFORM_ASSERT diff --git a/components/net/lwip-2.1.2/src/include/lwip/igmp.h b/components/net/lwip-2.1.2/src/include/lwip/igmp.h index 0a16db0397..ffd80e680c 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/igmp.h +++ b/components/net/lwip-2.1.2/src/include/lwip/igmp.h @@ -99,7 +99,7 @@ err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr); err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr); void igmp_tmr(void); -/** @ingroup igmp +/** @ingroup igmp * Get list head of IGMP groups for netif. * Note: The allsystems group IP is contained in the list as first entry. * @see @ref netif_set_igmp_mac_filter() diff --git a/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h b/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h index ee7a0c9da2..2f977709d1 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h +++ b/components/net/lwip-2.1.2/src/include/lwip/ip_addr.h @@ -404,7 +404,7 @@ extern const ip_addr_t ip_addr_broadcast; extern const ip_addr_t ip6_addr_any; -/** +/** * @ingroup ip6addr * IP6_ADDR_ANY can be used as a fixed ip_addr_t * for the IPv6 wildcard address diff --git a/components/net/lwip-2.1.2/src/include/lwip/mld6.h b/components/net/lwip-2.1.2/src/include/lwip/mld6.h index 2764fdd42d..7fa0797f27 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/mld6.h +++ b/components/net/lwip-2.1.2/src/include/lwip/mld6.h @@ -84,7 +84,7 @@ err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); /** @ingroup mld6 * Get list head of MLD6 groups for netif. - * Note: The allnodes group IP is NOT in the list, since it must always + * Note: The allnodes group IP is NOT in the list, since it must always * be received for correct IPv6 operation. * @see @ref netif_set_mld_mac_filter() */ diff --git a/components/net/lwip-2.1.2/src/include/lwip/netif.h b/components/net/lwip-2.1.2/src/include/lwip/netif.h index 03b48a0ea4..911196ab3d 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/netif.h +++ b/components/net/lwip-2.1.2/src/include/lwip/netif.h @@ -345,7 +345,7 @@ struct netif { u8_t flags; /** descriptive abbreviation */ char name[2]; - /** number of this interface. Used for @ref if_api and @ref netifapi_netif, + /** number of this interface. Used for @ref if_api and @ref netifapi_netif, * as well as for IPv6 zones */ u8_t num; #if LWIP_IPV6_AUTOCONFIG diff --git a/components/net/lwip-2.1.2/src/include/lwip/opt.h b/components/net/lwip-2.1.2/src/include/lwip/opt.h index 1e8eb6a35a..82c420c167 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/opt.h +++ b/components/net/lwip-2.1.2/src/include/lwip/opt.h @@ -1601,7 +1601,7 @@ #endif /** - * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function + * LWIP_NETIF_EXT_STATUS_CALLBACK==1: Support an extended callback function * for several netif related event that supports multiple subscribers. * @see netif_ext_status_callback */ @@ -2389,7 +2389,7 @@ * All addresses that have a scope according to the default policy (link-local * unicast addresses, interface-local and link-local multicast addresses) should * now have a zone set on them before being passed to the core API, although - * lwIP will currently attempt to select a zone on the caller's behalf when + * lwIP will currently attempt to select a zone on the caller's behalf when * necessary. Applications that directly assign IPv6 addresses to interfaces * (which is NOT recommended) must now ensure that link-local addresses carry * the netif's zone. See the new ip6_zone.h header file for more information and @@ -3027,8 +3027,8 @@ * - src: source eth address * - dst: destination eth address * - eth_type: ethernet type to packet to be sent\n - * - * + * + * * Return values: * - <0: Packet shall not contain VLAN header. * - 0 <= return value <= 0xFFFF: Packet shall contain VLAN header. Return value is prio_vid in host byte order. diff --git a/components/net/lwip-2.1.2/src/include/lwip/pbuf.h b/components/net/lwip-2.1.2/src/include/lwip/pbuf.h index 2ddd913af1..82902a4e98 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/pbuf.h +++ b/components/net/lwip-2.1.2/src/include/lwip/pbuf.h @@ -55,7 +55,7 @@ extern "C" { #define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)) #endif -/** @ingroup pbuf +/** @ingroup pbuf * PBUF_NEEDS_COPY(p): return a boolean value indicating whether the given * pbuf needs to be copied in order to be kept around beyond the current call * stack without risking being corrupted. The default setting provides safety: diff --git a/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h b/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h index dce8bebce1..db865635be 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h +++ b/components/net/lwip-2.1.2/src/include/lwip/prot/ieee.h @@ -53,7 +53,7 @@ enum lwip_ieee_eth_type { /** Internet protocol v4 */ ETHTYPE_IP = 0x0800U, /** Address resolution protocol */ - ETHTYPE_ARP = 0x0806U, + ETHTYPE_ARP = 0x0806U, /** Wake on lan */ ETHTYPE_WOL = 0x0842U, /** RARP */ diff --git a/components/net/lwip-2.1.2/src/include/lwip/sys.h b/components/net/lwip-2.1.2/src/include/lwip/sys.h index cf13e1dcc4..168e465baa 100644 --- a/components/net/lwip-2.1.2/src/include/lwip/sys.h +++ b/components/net/lwip-2.1.2/src/include/lwip/sys.h @@ -130,7 +130,7 @@ typedef void (*lwip_thread_fn)(void *arg); * If the mutex has been created, ERR_OK should be returned. Returning any * other error will provide a hint what went wrong, but except for assertions, * no real error handling is implemented. - * + * * @param mutex pointer to the mutex to create * @return ERR_OK if successful, another err_t otherwise */ @@ -205,13 +205,13 @@ void sys_sem_signal(sys_sem_t *sem); * "timeout" argument is non-zero, the thread should only be blocked for the * specified time (measured in milliseconds). If the "timeout" argument is zero, * the thread should be blocked until the semaphore is signalled. - * + * * The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within * the specified time or any other value if it was signaled (with or without * waiting). * Notice that lwIP implements a function with a similar name, * sys_sem_wait(), that uses the sys_arch_sem_wait() function. - * + * * @param sem the semaphore to wait for * @param timeout timeout in milliseconds to wait (0 = wait forever) * @return SYS_ARCH_TIMEOUT on timeout, any other value on success @@ -277,7 +277,7 @@ void sys_msleep(u32_t ms); /* only has a (close to) 1 ms resolution. */ * If the mailbox has been created, ERR_OK should be returned. Returning any * other error will provide a hint what went wrong, but except for assertions, * no real error handling is implemented. - * + * * @param mbox pointer to the mbox to create * @param size (minimum) number of messages in this mbox * @return ERR_OK if successful, another err_t otherwise @@ -287,7 +287,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size); * @ingroup sys_mbox * Post a message to an mbox - may not fail * -> blocks if full, only to be used from tasks NOT from ISR! - * + * * @param mbox mbox to posts the message * @param msg message to post (ATTENTION: can be NULL) */ @@ -297,7 +297,7 @@ void sys_mbox_post(sys_mbox_t *mbox, void *msg); * Try to post a message to an mbox - may fail if full. * Can be used from ISR (if the sys arch layer allows this). * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted. - * + * * @param mbox mbox to posts the message * @param msg message to post (ATTENTION: can be NULL) */ @@ -307,7 +307,7 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg); * Try to post a message to an mbox - may fail if full. * To be be used from ISR. * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted. - * + * * @param mbox mbox to posts the message * @param msg message to post (ATTENTION: can be NULL) */ @@ -324,10 +324,10 @@ err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg); * The return values are the same as for the sys_arch_sem_wait() function: * SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages * is received. - * + * * Note that a function with a similar name, sys_mbox_fetch(), is - * implemented by lwIP. - * + * implemented by lwIP. + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever) @@ -346,7 +346,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout); * example, a naive implementation could be: * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1) * although this would introduce unnecessary delays. - * + * * @param mbox mbox to get a message from * @param msg pointer where the message is stored * @return 0 (milliseconds) if a message has been received @@ -363,7 +363,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg); * Deallocates a mailbox. If there are messages still present in the * mailbox when the mailbox is deallocated, it is an indication of a * programming error in lwIP and the developer should be notified. - * + * * @param mbox mbox to delete */ void sys_mbox_free(sys_mbox_t *mbox); @@ -411,7 +411,7 @@ void sys_mbox_set_invalid(sys_mbox_t *mbox); * the "stacksize" parameter. The id of the new thread is returned. Both the id * and the priority are system dependent. * ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!) - * + * * @param name human-readable name for the thread (used for debugging purposes) * @param thread thread-function * @param arg parameter passed to 'thread' diff --git a/components/net/lwip-2.1.2/src/include/netif/ethernetif.h b/components/net/lwip-2.1.2/src/include/netif/ethernetif.h index 09c6d9a56f..244bafdd1b 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ethernetif.h +++ b/components/net/lwip-2.1.2/src/include/netif/ethernetif.h @@ -4,16 +4,16 @@ #include "lwip/netif.h" #include -#define NIOCTL_GADDR 0x01 +#define NIOCTL_GADDR 0x01 #ifndef RT_LWIP_ETH_MTU -#define ETHERNET_MTU 1500 +#define ETHERNET_MTU 1500 #else -#define ETHERNET_MTU RT_LWIP_ETH_MTU +#define ETHERNET_MTU RT_LWIP_ETH_MTU #endif /* eth flag with auto_linkup or phy_linkup */ -#define ETHIF_LINK_AUTOUP 0x0000 -#define ETHIF_LINK_PHYUP 0x0100 +#define ETHIF_LINK_AUTOUP 0x0000 +#define ETHIF_LINK_PHYUP 0x0100 struct eth_device { diff --git a/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h b/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h index 5190e7bc29..01896a7ff6 100644 --- a/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h +++ b/components/net/lwip-2.1.2/src/include/netif/lowpan6_ble.h @@ -6,7 +6,7 @@ /* * Copyright (c) 2017 Benjamin Aigner * Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer - * + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -32,10 +32,10 @@ * OF SUCH DAMAGE. * * Author: Benjamin Aigner - * + * * Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c) */ - + #ifndef LWIP_HDR_LOWPAN6_BLE_H #define LWIP_HDR_LOWPAN6_BLE_H diff --git a/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h b/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h index 32e5c5ee14..17d46cdcc5 100644 --- a/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h +++ b/components/net/lwip-2.1.2/src/include/netif/lowpan6_opts.h @@ -109,7 +109,7 @@ #define LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG LWIP_DBG_OFF #endif -/** LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS: +/** LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS: * Currently, the linux kernel driver for 6lowpan sets/clears a bit in * the address, depending on the BD address (either public or not). * Might not be RFC7668 conform, so you may select to do that (=1) or diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h index 830dc3137f..b2285228b8 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ccp.h @@ -44,48 +44,48 @@ extern "C" { * CCP codes. */ -#define CCP_CONFREQ 1 -#define CCP_CONFACK 2 -#define CCP_TERMREQ 5 -#define CCP_TERMACK 6 -#define CCP_RESETREQ 14 -#define CCP_RESETACK 15 +#define CCP_CONFREQ 1 +#define CCP_CONFACK 2 +#define CCP_TERMREQ 5 +#define CCP_TERMACK 6 +#define CCP_RESETREQ 14 +#define CCP_RESETACK 15 /* * Max # bytes for a CCP option */ -#define CCP_MAX_OPTION_LENGTH 32 +#define CCP_MAX_OPTION_LENGTH 32 /* * Parts of a CCP packet. */ -#define CCP_CODE(dp) ((dp)[0]) -#define CCP_ID(dp) ((dp)[1]) -#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) -#define CCP_HDRLEN 4 +#define CCP_CODE(dp) ((dp)[0]) +#define CCP_ID(dp) ((dp)[1]) +#define CCP_LENGTH(dp) (((dp)[2] << 8) + (dp)[3]) +#define CCP_HDRLEN 4 -#define CCP_OPT_CODE(dp) ((dp)[0]) -#define CCP_OPT_LENGTH(dp) ((dp)[1]) -#define CCP_OPT_MINLEN 2 +#define CCP_OPT_CODE(dp) ((dp)[0]) +#define CCP_OPT_LENGTH(dp) ((dp)[1]) +#define CCP_OPT_MINLEN 2 #if BSDCOMPRESS_SUPPORT /* * Definitions for BSD-Compress. */ -#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ -#define CILEN_BSD_COMPRESS 3 /* length of config. option */ +#define CI_BSD_COMPRESS 21 /* config. option for BSD-Compress */ +#define CILEN_BSD_COMPRESS 3 /* length of config. option */ /* Macros for handling the 3rd byte of the BSD-Compress config option. */ -#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ -#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ -#define BSD_CURRENT_VERSION 1 /* current version number */ -#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) +#define BSD_NBITS(x) ((x) & 0x1F) /* number of bits requested */ +#define BSD_VERSION(x) ((x) >> 5) /* version of option format */ +#define BSD_CURRENT_VERSION 1 /* current version number */ +#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n)) -#define BSD_MIN_BITS 9 /* smallest code size supported */ -#define BSD_MAX_BITS 15 /* largest code size supported */ +#define BSD_MIN_BITS 9 /* smallest code size supported */ +#define BSD_MAX_BITS 15 /* largest code size supported */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -93,17 +93,17 @@ extern "C" { * Definitions for Deflate. */ -#define CI_DEFLATE 26 /* config option for Deflate */ -#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ -#define CILEN_DEFLATE 4 /* length of its config option */ - -#define DEFLATE_MIN_SIZE 9 -#define DEFLATE_MAX_SIZE 15 -#define DEFLATE_METHOD_VAL 8 -#define DEFLATE_SIZE(x) (((x) >> 4) + 8) -#define DEFLATE_METHOD(x) ((x) & 0x0F) -#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) -#define DEFLATE_CHK_SEQUENCE 0 +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ +#define CILEN_DEFLATE 4 /* length of its config option */ + +#define DEFLATE_MIN_SIZE 9 +#define DEFLATE_MAX_SIZE 15 +#define DEFLATE_METHOD_VAL 8 +#define DEFLATE_SIZE(x) (((x) >> 4) + 8) +#define DEFLATE_METHOD(x) ((x) & 0x0F) +#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL) +#define DEFLATE_CHK_SEQUENCE 0 #endif /* DEFLATE_SUPPORT */ #if MPPE_SUPPORT @@ -120,10 +120,10 @@ extern "C" { * Definitions for other, as yet unsupported, compression methods. */ -#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ -#define CILEN_PREDICTOR_1 2 /* length of its config option */ -#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ -#define CILEN_PREDICTOR_2 2 /* length of its config option */ +#define CI_PREDICTOR_1 1 /* config option for Predictor-1 */ +#define CILEN_PREDICTOR_1 2 /* length of its config option */ +#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */ +#define CILEN_PREDICTOR_2 2 /* length of its config option */ #endif /* PREDICTOR_SUPPORT */ typedef struct ccp_options { @@ -141,15 +141,15 @@ typedef struct ccp_options { #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - u8_t mppe; /* MPPE bitfield */ + u8_t mppe; /* MPPE bitfield */ #endif /* MPPE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - u_short bsd_bits; /* # bits/code for BSD Compress */ + u_short bsd_bits; /* # bits/code for BSD Compress */ #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - u_short deflate_size; /* lg(window size) for Deflate */ + u_short deflate_size; /* lg(window size) for Deflate */ #endif /* DEFLATE_SUPPORT */ - u8_t method; /* code for chosen compression method */ + u8_t method; /* code for chosen compression method */ } ccp_options; extern const struct protent ccp_protent; diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h b/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h index 3d26413664..2d8cd9ca99 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/chap-new.h @@ -43,45 +43,45 @@ extern "C" { /* * CHAP packets begin with a standard header with code, id, len (2 bytes). */ -#define CHAP_HDRLEN 4 +#define CHAP_HDRLEN 4 /* * Values for the code field. */ -#define CHAP_CHALLENGE 1 -#define CHAP_RESPONSE 2 -#define CHAP_SUCCESS 3 -#define CHAP_FAILURE 4 +#define CHAP_CHALLENGE 1 +#define CHAP_RESPONSE 2 +#define CHAP_SUCCESS 3 +#define CHAP_FAILURE 4 /* * CHAP digest codes. */ -#define CHAP_MD5 5 +#define CHAP_MD5 5 #if MSCHAP_SUPPORT -#define CHAP_MICROSOFT 0x80 -#define CHAP_MICROSOFT_V2 0x81 +#define CHAP_MICROSOFT 0x80 +#define CHAP_MICROSOFT_V2 0x81 #endif /* MSCHAP_SUPPORT */ /* * Semi-arbitrary limits on challenge and response fields. */ -#define MAX_CHALLENGE_LEN 64 -#define MAX_RESPONSE_LEN 64 +#define MAX_CHALLENGE_LEN 64 +#define MAX_RESPONSE_LEN 64 /* * These limits apply to challenge and response packets we send. * The +4 is the +1 that we actually need rounded up. */ -#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) -#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) +#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN) +#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN) /* bitmask of supported algorithms */ #if MSCHAP_SUPPORT -#define MDTYPE_MICROSOFT_V2 0x1 -#define MDTYPE_MICROSOFT 0x2 +#define MDTYPE_MICROSOFT_V2 0x1 +#define MDTYPE_MICROSOFT 0x2 #endif /* MSCHAP_SUPPORT */ -#define MDTYPE_MD5 0x4 -#define MDTYPE_NONE 0 +#define MDTYPE_MD5 0x4 +#define MDTYPE_NONE 0 #if MSCHAP_SUPPORT /* Return the digest alg. ID for the most preferred digest type. */ @@ -129,24 +129,24 @@ extern "C" { * The code for each digest type has to supply one of these. */ struct chap_digest_type { - int code; + int code; #if PPP_SERVER - /* - * Note: challenge and response arguments below are formatted as - * a length byte followed by the actual challenge/response data. - */ - void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); - int (*verify_response)(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + /* + * Note: challenge and response arguments below are formatted as + * a length byte followed by the actual challenge/response data. + */ + void (*generate_challenge)(ppp_pcb *pcb, unsigned char *challenge); + int (*verify_response)(ppp_pcb *pcb, int id, const char *name, + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ - void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *priv); - int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); - void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); + void (*make_response)(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *priv); + int (*check_success)(ppp_pcb *pcb, unsigned char *pkt, int len, unsigned char *priv); + void (*handle_failure)(ppp_pcb *pcb, unsigned char *pkt, int len); }; /* @@ -154,21 +154,21 @@ struct chap_digest_type { */ #if CHAP_SUPPORT typedef struct chap_client_state { - u8_t flags; - const char *name; - const struct chap_digest_type *digest; - unsigned char priv[64]; /* private area for digest's use */ + u8_t flags; + const char *name; + const struct chap_digest_type *digest; + unsigned char priv[64]; /* private area for digest's use */ } chap_client_state; #if PPP_SERVER typedef struct chap_server_state { - u8_t flags; - u8_t id; - const char *name; - const struct chap_digest_type *digest; - int challenge_xmits; - int challenge_pktlen; - unsigned char challenge[CHAL_MAX_PKTLEN]; + u8_t flags; + u8_t id; + const char *name; + const struct chap_digest_type *digest; + int challenge_xmits; + int challenge_pktlen; + unsigned char challenge[CHAL_MAX_PKTLEN]; } chap_server_state; #endif /* PPP_SERVER */ #endif /* CHAP_SUPPORT */ @@ -176,9 +176,9 @@ typedef struct chap_server_state { #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ extern int (*chap_verify_hook)(char *name, char *ourname, int id, - const struct chap_digest_type *digest, - unsigned char *challenge, unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + unsigned char *challenge, unsigned char *response, + char *message, int message_space); #endif /* UNUSED */ #if PPP_SERVER diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h b/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h index 491e52ab11..3ee9aaf81a 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/eap.h @@ -24,135 +24,135 @@ #if PPP_SUPPORT && EAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef PPP_EAP_H -#define PPP_EAP_H +#define PPP_EAP_H #include "ppp.h" -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif /* * Packet header = Code, id, length. */ -#define EAP_HEADERLEN 4 +#define EAP_HEADERLEN 4 /* EAP message codes. */ -#define EAP_REQUEST 1 -#define EAP_RESPONSE 2 -#define EAP_SUCCESS 3 -#define EAP_FAILURE 4 +#define EAP_REQUEST 1 +#define EAP_RESPONSE 2 +#define EAP_SUCCESS 3 +#define EAP_FAILURE 4 /* EAP types */ -#define EAPT_IDENTITY 1 -#define EAPT_NOTIFICATION 2 -#define EAPT_NAK 3 /* (response only) */ -#define EAPT_MD5CHAP 4 -#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ -#define EAPT_TOKEN 6 /* Generic Token Card */ +#define EAPT_IDENTITY 1 +#define EAPT_NOTIFICATION 2 +#define EAPT_NAK 3 /* (response only) */ +#define EAPT_MD5CHAP 4 +#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */ +#define EAPT_TOKEN 6 /* Generic Token Card */ /* 7 and 8 are unassigned. */ -#define EAPT_RSA 9 /* RSA Public Key Authentication */ -#define EAPT_DSS 10 /* DSS Unilateral */ -#define EAPT_KEA 11 /* KEA */ -#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ -#define EAPT_TLS 13 /* EAP-TLS */ -#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ -#define EAPT_W2K 15 /* Windows 2000 EAP */ -#define EAPT_ARCOT 16 /* Arcot Systems */ -#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ -#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ -#define EAPT_SRP 19 /* Secure Remote Password */ +#define EAPT_RSA 9 /* RSA Public Key Authentication */ +#define EAPT_DSS 10 /* DSS Unilateral */ +#define EAPT_KEA 11 /* KEA */ +#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */ +#define EAPT_TLS 13 /* EAP-TLS */ +#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */ +#define EAPT_W2K 15 /* Windows 2000 EAP */ +#define EAPT_ARCOT 16 /* Arcot Systems */ +#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */ +#define EAPT_NOKIACARD 18 /* Nokia IP smart card */ +#define EAPT_SRP 19 /* Secure Remote Password */ /* 20 is deprecated */ /* EAP SRP-SHA1 Subtypes */ -#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ -#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ -#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ -#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ -#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ -#define EAPSRP_ACK 3 /* Response 3 - final ack */ -#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ - -#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ - -#define SRP_PSEUDO_ID "pseudo_" -#define SRP_PSEUDO_LEN 7 - -#define MD5_SIGNATURE_SIZE 16 -#define EAP_MIN_CHALLENGE_LENGTH 17 -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */ +#define EAPSRP_CKEY 1 /* Response 1 - Client Key */ +#define EAPSRP_SKEY 2 /* Request 2 - Server Key */ +#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */ +#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */ +#define EAPSRP_ACK 3 /* Response 3 - final ack */ +#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */ + +#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */ + +#define SRP_PSEUDO_ID "pseudo_" +#define SRP_PSEUDO_LEN 7 + +#define MD5_SIGNATURE_SIZE 16 +#define EAP_MIN_CHALLENGE_LENGTH 17 +#define EAP_MAX_CHALLENGE_LENGTH 24 #define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH 3 /* 2^3-1 = 7, 17+7 = 24 */ -#define EAP_STATES \ - "Initial", "Pending", "Closed", "Listen", "Identify", \ - "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" +#define EAP_STATES \ + "Initial", "Pending", "Closed", "Listen", "Identify", \ + "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth" -#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) +#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen) #if PPP_SERVER -#define eap_server_active(pcb) \ - ((pcb)->eap.es_server.ea_state >= eapIdentify && \ - (pcb)->eap.es_server.ea_state <= eapMD5Chall) +#define eap_server_active(pcb) \ + ((pcb)->eap.es_server.ea_state >= eapIdentify && \ + (pcb)->eap.es_server.ea_state <= eapMD5Chall) #endif /* PPP_SERVER */ /* * Complete EAP state for one PPP session. */ enum eap_state_code { - eapInitial = 0, /* No EAP authentication yet requested */ - eapPending, /* Waiting for LCP (no timer) */ - eapClosed, /* Authentication not in use */ - eapListen, /* Client ready (and timer running) */ - eapIdentify, /* EAP Identify sent */ - eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ - eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ - eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ - eapMD5Chall, /* Sent MD5-Challenge */ - eapOpen, /* Completed authentication */ - eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ - eapBadAuth /* Failed authentication */ + eapInitial = 0, /* No EAP authentication yet requested */ + eapPending, /* Waiting for LCP (no timer) */ + eapClosed, /* Authentication not in use */ + eapListen, /* Client ready (and timer running) */ + eapIdentify, /* EAP Identify sent */ + eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */ + eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */ + eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */ + eapMD5Chall, /* Sent MD5-Challenge */ + eapOpen, /* Completed authentication */ + eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */ + eapBadAuth /* Failed authentication */ }; struct eap_auth { - const char *ea_name; /* Our name */ - char ea_peer[MAXNAMELEN +1]; /* Peer's name */ - void *ea_session; /* Authentication library linkage */ - u_char *ea_skey; /* Shared encryption key */ - u_short ea_namelen; /* Length of our name */ - u_short ea_peerlen; /* Length of peer's name */ - enum eap_state_code ea_state; - u_char ea_id; /* Current id */ - u_char ea_requests; /* Number of Requests sent/received */ - u_char ea_responses; /* Number of Responses */ - u_char ea_type; /* One of EAPT_* */ - u32_t ea_keyflags; /* SRP shared key usage flags */ + const char *ea_name; /* Our name */ + char ea_peer[MAXNAMELEN +1]; /* Peer's name */ + void *ea_session; /* Authentication library linkage */ + u_char *ea_skey; /* Shared encryption key */ + u_short ea_namelen; /* Length of our name */ + u_short ea_peerlen; /* Length of peer's name */ + enum eap_state_code ea_state; + u_char ea_id; /* Current id */ + u_char ea_requests; /* Number of Requests sent/received */ + u_char ea_responses; /* Number of Responses */ + u_char ea_type; /* One of EAPT_* */ + u32_t ea_keyflags; /* SRP shared key usage flags */ }; #ifndef EAP_MAX_CHALLENGE_LENGTH -#define EAP_MAX_CHALLENGE_LENGTH 24 +#define EAP_MAX_CHALLENGE_LENGTH 24 #endif typedef struct eap_state { - struct eap_auth es_client; /* Client (authenticatee) data */ + struct eap_auth es_client; /* Client (authenticatee) data */ #if PPP_SERVER - struct eap_auth es_server; /* Server (authenticator) data */ + struct eap_auth es_server; /* Server (authenticator) data */ #endif /* PPP_SERVER */ - int es_savedtime; /* Saved timeout */ - int es_rechallenge; /* EAP rechallenge interval */ - int es_lwrechallenge; /* SRP lightweight rechallenge inter */ - u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ - int es_usedpseudo; /* Set if we already sent PN */ - int es_challen; /* Length of challenge string */ - u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; + int es_savedtime; /* Saved timeout */ + int es_rechallenge; /* EAP rechallenge interval */ + int es_lwrechallenge; /* SRP lightweight rechallenge inter */ + u8_t es_usepseudo; /* Use SRP Pseudonym if offered one */ + int es_usedpseudo; /* Set if we already sent PN */ + int es_challen; /* Length of challenge string */ + u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH]; } eap_state; /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ -#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ -#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ -#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ +#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */ +#define EAP_DEFTRANSMITS 10 /* max # times to transmit */ +#define EAP_DEFREQTIME 20 /* Time to wait for peer request */ +#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */ #endif /* moved to ppp_opts.h */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname); @@ -160,7 +160,7 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname); extern const struct protent eap_protent; -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h index fa373fe76f..d8808c3ab2 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ecp.h @@ -42,8 +42,8 @@ extern "C" { #endif typedef struct ecp_options { - bool required; /* Is ECP required? */ - unsigned enctype; /* Encryption type */ + bool required; /* Is ECP required? */ + unsigned enctype; /* Encryption type */ } ecp_options; extern fsm ecp_fsm[]; diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h b/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h index 3a20081f81..5adeb482a8 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/eui64.h @@ -57,42 +57,42 @@ typedef union u32_t e32[2]; } eui64_t; -#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) -#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ - ((e).e32[1] == (o).e32[1])) -#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; +#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) +#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ + ((e).e32[1] == (o).e32[1])) +#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; -#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) +#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) -#define eui64_magic(e) do { \ - (e).e32[0] = magic(); \ - (e).e32[1] = magic(); \ - (e).e8[0] &= ~2; \ - } while (0) -#define eui64_magic_nz(x) do { \ - eui64_magic(x); \ - } while (eui64_iszero(x)) -#define eui64_magic_ne(x, y) do { \ - eui64_magic(x); \ - } while (eui64_equals(x, y)) +#define eui64_magic(e) do { \ + (e).e32[0] = magic(); \ + (e).e32[1] = magic(); \ + (e).e8[0] &= ~2; \ + } while (0) +#define eui64_magic_nz(x) do { \ + eui64_magic(x); \ + } while (eui64_iszero(x)) +#define eui64_magic_ne(x, y) do { \ + eui64_magic(x); \ + } while (eui64_equals(x, y)) -#define eui64_get(ll, cp) do { \ - eui64_copy((*cp), (ll)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_get(ll, cp) do { \ + eui64_copy((*cp), (ll)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_put(ll, cp) do { \ - eui64_copy((ll), (*cp)); \ - (cp) += sizeof(eui64_t); \ - } while (0) +#define eui64_put(ll, cp) do { \ + eui64_copy((ll), (*cp)); \ + (cp) += sizeof(eui64_t); \ + } while (0) -#define eui64_set32(e, l) do { \ - (e).e32[0] = 0; \ - (e).e32[1] = lwip_htonl(l); \ - } while (0) -#define eui64_setlo32(e, l) eui64_set32(e, l) +#define eui64_set32(e, l) do { \ + (e).e32[0] = 0; \ + (e).e32[1] = lwip_htonl(l); \ + } while (0) +#define eui64_setlo32(e, l) eui64_set32(e, l) -char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ +char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ #ifdef __cplusplus } diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h b/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h index 69d965a581..8dec700e07 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/fsm.h @@ -46,7 +46,7 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef FSM_H -#define FSM_H +#define FSM_H #include "ppp.h" @@ -57,108 +57,108 @@ extern "C" { /* * Packet header = Code, id, length. */ -#define HEADERLEN 4 +#define HEADERLEN 4 /* * CP (LCP, IPCP, etc.) codes. */ -#define CONFREQ 1 /* Configuration Request */ -#define CONFACK 2 /* Configuration Ack */ -#define CONFNAK 3 /* Configuration Nak */ -#define CONFREJ 4 /* Configuration Reject */ -#define TERMREQ 5 /* Termination Request */ -#define TERMACK 6 /* Termination Ack */ -#define CODEREJ 7 /* Code Reject */ +#define CONFREQ 1 /* Configuration Request */ +#define CONFACK 2 /* Configuration Ack */ +#define CONFNAK 3 /* Configuration Nak */ +#define CONFREJ 4 /* Configuration Reject */ +#define TERMREQ 5 /* Termination Request */ +#define TERMACK 6 /* Termination Ack */ +#define CODEREJ 7 /* Code Reject */ /* * Each FSM is described by an fsm structure and fsm callbacks. */ typedef struct fsm { - ppp_pcb *pcb; /* PPP Interface */ - const struct fsm_callbacks *callbacks; /* Callback routines */ - const char *term_reason; /* Reason for closing protocol */ - u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ - /* -- This is our only flag, we might use u_int :1 if we have more flags */ - u16_t protocol; /* Data Link Layer Protocol field value */ - u8_t state; /* State */ - u8_t flags; /* Contains option bits */ - u8_t id; /* Current id */ - u8_t reqid; /* Current request id */ - u8_t retransmits; /* Number of retransmissions left */ - u8_t nakloops; /* Number of nak loops since last ack */ - u8_t rnakloops; /* Number of naks received */ - u8_t maxnakloops; /* Maximum number of nak loops tolerated - (necessary because IPCP require a custom large max nak loops value) */ - u8_t term_reason_len; /* Length of term_reason */ + ppp_pcb *pcb; /* PPP Interface */ + const struct fsm_callbacks *callbacks; /* Callback routines */ + const char *term_reason; /* Reason for closing protocol */ + u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + /* -- This is our only flag, we might use u_int :1 if we have more flags */ + u16_t protocol; /* Data Link Layer Protocol field value */ + u8_t state; /* State */ + u8_t flags; /* Contains option bits */ + u8_t id; /* Current id */ + u8_t reqid; /* Current request id */ + u8_t retransmits; /* Number of retransmissions left */ + u8_t nakloops; /* Number of nak loops since last ack */ + u8_t rnakloops; /* Number of naks received */ + u8_t maxnakloops; /* Maximum number of nak loops tolerated + (necessary because IPCP require a custom large max nak loops value) */ + u8_t term_reason_len; /* Length of term_reason */ } fsm; typedef struct fsm_callbacks { - void (*resetci) /* Reset our Configuration Information */ - (fsm *); - int (*cilen) /* Length of our Configuration Information */ - (fsm *); - void (*addci) /* Add our Configuration Information */ - (fsm *, u_char *, int *); - int (*ackci) /* ACK our Configuration Information */ - (fsm *, u_char *, int); - int (*nakci) /* NAK our Configuration Information */ - (fsm *, u_char *, int, int); - int (*rejci) /* Reject our Configuration Information */ - (fsm *, u_char *, int); - int (*reqci) /* Request peer's Configuration Information */ - (fsm *, u_char *, int *, int); - void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ - (fsm *); - void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ - (fsm *); - void (*starting) /* Called when we want the lower layer */ - (fsm *); - void (*finished) /* Called when we don't want the lower layer */ - (fsm *); - void (*protreject) /* Called when Protocol-Reject received */ - (int); - void (*retransmit) /* Retransmission is necessary */ - (fsm *); - int (*extcode) /* Called when unknown code received */ - (fsm *, int, int, u_char *, int); - const char *proto_name; /* String name for protocol (for messages) */ + void (*resetci) /* Reset our Configuration Information */ + (fsm *); + int (*cilen) /* Length of our Configuration Information */ + (fsm *); + void (*addci) /* Add our Configuration Information */ + (fsm *, u_char *, int *); + int (*ackci) /* ACK our Configuration Information */ + (fsm *, u_char *, int); + int (*nakci) /* NAK our Configuration Information */ + (fsm *, u_char *, int, int); + int (*rejci) /* Reject our Configuration Information */ + (fsm *, u_char *, int); + int (*reqci) /* Request peer's Configuration Information */ + (fsm *, u_char *, int *, int); + void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ + (fsm *); + void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ + (fsm *); + void (*starting) /* Called when we want the lower layer */ + (fsm *); + void (*finished) /* Called when we don't want the lower layer */ + (fsm *); + void (*protreject) /* Called when Protocol-Reject received */ + (int); + void (*retransmit) /* Retransmission is necessary */ + (fsm *); + int (*extcode) /* Called when unknown code received */ + (fsm *, int, int, u_char *, int); + const char *proto_name; /* String name for protocol (for messages) */ } fsm_callbacks; /* * Link states. */ -#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ -#define PPP_FSM_STARTING 1 /* Down, been opened */ -#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ -#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ -#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ -#define PPP_FSM_STOPPING 5 /* Terminating, but open */ -#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ -#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ -#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ -#define PPP_FSM_OPENED 9 /* Connection available */ +#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ +#define PPP_FSM_STARTING 1 /* Down, been opened */ +#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ +#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ +#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ +#define PPP_FSM_STOPPING 5 /* Terminating, but open */ +#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ +#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ +#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ +#define PPP_FSM_OPENED 9 /* Connection available */ /* * Flags - indicate options controlling FSM operation */ -#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ -#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ -#define OPT_SILENT 4 /* Wait for peer to speak first */ +#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ +#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ +#define OPT_SILENT 4 /* Wait for peer to speak first */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define DEFTIMEOUT 3 /* Timeout time in seconds */ -#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ +#define DEFTIMEOUT 3 /* Timeout time in seconds */ +#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ #endif /* moved to ppp_opts.h */ diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h index 6d822fef0c..32fdd1c641 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ipcp.h @@ -46,7 +46,7 @@ #if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPCP_H -#define IPCP_H +#define IPCP_H #ifdef __cplusplus extern "C" { @@ -55,32 +55,32 @@ extern "C" { /* * Options. */ -#define CI_ADDRS 1 /* IP Addresses */ +#define CI_ADDRS 1 /* IP Addresses */ #if VJ_SUPPORT -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* VJ_SUPPORT */ -#define CI_ADDR 3 +#define CI_ADDR 3 #if LWIP_DNS -#define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_DNS1 129 /* Primary DNS value */ #define CI_MS_DNS2 131 /* Secondary DNS value */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define CI_MS_WINS1 130 /* Primary WINS value */ -#define CI_MS_WINS2 132 /* Secondary WINS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT -#define MAX_STATES 16 /* from slcompress.h */ +#define MAX_STATES 16 /* from slcompress.h */ -#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ -#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ -#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ +#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ +#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ +#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ /* maxslot and slot number compression) */ -#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ -#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option*/ +#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ +#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ + /* compression option*/ #endif /* VJ_SUPPORT */ typedef struct ipcp_options { @@ -106,17 +106,17 @@ typedef struct ipcp_options { unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ #endif /* LWIP_DNS */ - u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ + u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ #if LWIP_DNS - u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ + u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ + u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ #endif /* UNUSED - WINS */ #if VJ_SUPPORT - u16_t vj_protocol; /* protocol value to use in VJ option */ - u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ + u16_t vj_protocol; /* protocol value to use in VJ option */ + u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ #endif /* VJ_SUPPORT */ } ipcp_options; diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h index 756b3ecd4c..9099973869 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ipv6cp.h @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -142,7 +142,7 @@ #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef IPV6CP_H -#define IPV6CP_H +#define IPV6CP_H #include "eui64.h" @@ -153,13 +153,13 @@ extern "C" { /* * Options. */ -#define CI_IFACEID 1 /* Interface Identifier */ +#define CI_IFACEID 1 /* Interface Identifier */ #ifdef IPV6CP_COMP -#define CI_COMPRESSTYPE 2 /* Compression Type */ +#define CI_COMPRESSTYPE 2 /* Compression Type */ #endif /* IPV6CP_COMP */ /* No compression types yet defined. - *#define IPV6CP_COMP 0x004f + *#define IPV6CP_COMP 0x004f */ typedef struct ipv6cp_options { unsigned int neg_ifaceid :1; /* Negotiate interface identifier? */ diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h index 2b49bf7ede..18ad1cb23b 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/lcp.h @@ -46,7 +46,7 @@ #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ #ifndef LCP_H -#define LCP_H +#define LCP_H #include "ppp.h" @@ -57,55 +57,55 @@ extern "C" { /* * Options. */ -#define CI_VENDOR 0 /* Vendor Specific */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_FCSALTERN 9 /* FCS-Alternatives */ -#define CI_SDP 10 /* Self-Describing-Pad */ -#define CI_NUMBERED 11 /* Numbered-Mode */ -#define CI_CALLBACK 13 /* callback */ -#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ -#define CI_SSNHF 18 /* short sequence numbers for multilink */ -#define CI_EPDISC 19 /* endpoint discriminator */ -#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ -#define CI_LDISC 23 /* Link-Discriminator */ -#define CI_LCPAUTH 24 /* LCP Authentication */ -#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ -#define CI_PREFELIS 26 /* Prefix Elision */ -#define CI_MPHDRFMT 27 /* MP Header Format */ -#define CI_I18N 28 /* Internationalization */ -#define CI_SDL 29 /* Simple Data Link */ +#define CI_VENDOR 0 /* Vendor Specific */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCSALTERN 9 /* FCS-Alternatives */ +#define CI_SDP 10 /* Self-Describing-Pad */ +#define CI_NUMBERED 11 /* Numbered-Mode */ +#define CI_CALLBACK 13 /* callback */ +#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ +#define CI_SSNHF 18 /* short sequence numbers for multilink */ +#define CI_EPDISC 19 /* endpoint discriminator */ +#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ +#define CI_LDISC 23 /* Link-Discriminator */ +#define CI_LCPAUTH 24 /* LCP Authentication */ +#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ +#define CI_PREFELIS 26 /* Prefix Elision */ +#define CI_MPHDRFMT 27 /* MP Header Format */ +#define CI_I18N 28 /* Internationalization */ +#define CI_SDL 29 /* Simple Data Link */ /* * LCP-specific packet types (code numbers). */ -#define PROTREJ 8 /* Protocol Reject */ -#define ECHOREQ 9 /* Echo Request */ -#define ECHOREP 10 /* Echo Reply */ -#define DISCREQ 11 /* Discard Request */ -#define IDENTIF 12 /* Identification */ -#define TIMEREM 13 /* Time Remaining */ +#define PROTREJ 8 /* Protocol Reject */ +#define ECHOREQ 9 /* Echo Request */ +#define ECHOREP 10 /* Echo Reply */ +#define DISCREQ 11 /* Discard Request */ +#define IDENTIF 12 /* Identification */ +#define TIMEREM 13 /* Time Remaining */ /* Value used as data for CI_CALLBACK option */ -#define CBCP_OPT 6 /* Use callback control protocol */ +#define CBCP_OPT 6 /* Use callback control protocol */ #if 0 /* moved to ppp_opts.h */ -#define DEFMRU 1500 /* Try for this */ -#define MINMRU 128 /* No MRUs below this */ -#define MAXMRU 16384 /* Normally limit MRU to this */ +#define DEFMRU 1500 /* Try for this */ +#define MINMRU 128 /* No MRUs below this */ +#define MAXMRU 16384 /* Normally limit MRU to this */ #endif /* moved to ppp_opts.h */ /* An endpoint discriminator, used with multilink. */ -#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ struct epdisc { - unsigned char class_; /* -- The word "class" is reserved in C++. */ - unsigned char length; - unsigned char value[MAX_ENDP_LEN]; + unsigned char class_; /* -- The word "class" is reserved in C++. */ + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; }; /* @@ -141,20 +141,20 @@ typedef struct lcp_options { unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ - u16_t mru; /* Value of MRU */ + u16_t mru; /* Value of MRU */ #ifdef HAVE_MULTILINK - u16_t mrru; /* Value of MRRU, and multilink enable */ + u16_t mrru; /* Value of MRRU, and multilink enable */ #endif /* MULTILINK */ #if CHAP_SUPPORT - u8_t chap_mdtype; /* which MD types (hashing algorithm) */ + u8_t chap_mdtype; /* which MD types (hashing algorithm) */ #endif /* CHAP_SUPPORT */ - u32_t asyncmap; /* Value of async map */ + u32_t asyncmap; /* Value of async map */ u32_t magicnumber; - u8_t numloops; /* Number of loops during magic number neg. */ + u8_t numloops; /* Number of loops during magic number neg. */ #if LQR_SUPPORT - u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ + u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ #endif /* LQR_SUPPORT */ - struct epdisc endpoint; /* endpoint discriminator */ + struct epdisc endpoint; /* endpoint discriminator */ } lcp_options; void lcp_open(ppp_pcb *pcb); @@ -168,7 +168,7 @@ extern const struct protent lcp_protent; #if 0 /* moved to ppp_opts.h */ /* Default number of times we receive our magic number from the peer before deciding the link is looped-back. */ -#define DEFLOOPBACKFAIL 10 +#define DEFLOOPBACKFAIL 10 #endif /* moved to ppp_opts.h */ #ifdef __cplusplus diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h b/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h index b937ec6d88..a165e18fa6 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/magic.h @@ -102,7 +102,7 @@ void magic_randomize(void); /* * Return a new random number. */ -u32_t magic(void); /* Returns the next magic number */ +u32_t magic(void); /* Returns the next magic number */ /* * Fill buffer with random bytes diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h b/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h index 55f0487b93..5de1128479 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/mppe.h @@ -45,19 +45,19 @@ extern "C" { #endif -#define MPPE_PAD 4 /* MPPE growth per frame */ -#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ +#define MPPE_PAD 4 /* MPPE growth per frame */ +#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ /* option bits for ccp_options.mppe */ -#define MPPE_OPT_40 0x01 /* 40 bit */ -#define MPPE_OPT_128 0x02 /* 128 bit */ -#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ +#define MPPE_OPT_40 0x01 /* 40 bit */ +#define MPPE_OPT_128 0x02 /* 128 bit */ +#define MPPE_OPT_STATEFUL 0x04 /* stateful mode */ /* unsupported opts */ -#define MPPE_OPT_56 0x08 /* 56 bit */ -#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ -#define MPPE_OPT_D 0x20 /* Unknown */ +#define MPPE_OPT_56 0x08 /* 56 bit */ +#define MPPE_OPT_MPPC 0x10 /* MPPC compression */ +#define MPPE_OPT_D 0x20 /* Unknown */ #define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D) -#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ +#define MPPE_OPT_UNKNOWN 0x40 /* Bits !defined in RFC 3078 were set */ /* * This is not nice ... the alternative is a bitfield struct though. @@ -66,70 +66,70 @@ extern "C" { * but then we have to do a lwip_htonl() all the time and/or we still need * to know which octet is which. */ -#define MPPE_C_BIT 0x01 /* MPPC */ -#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ -#define MPPE_L_BIT 0x20 /* 40-bit */ -#define MPPE_S_BIT 0x40 /* 128-bit */ -#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ -#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ +#define MPPE_C_BIT 0x01 /* MPPC */ +#define MPPE_D_BIT 0x10 /* Obsolete, usage unknown */ +#define MPPE_L_BIT 0x20 /* 40-bit */ +#define MPPE_S_BIT 0x40 /* 128-bit */ +#define MPPE_M_BIT 0x80 /* 56-bit, not supported */ +#define MPPE_H_BIT 0x01 /* Stateless (in a different byte) */ /* Does not include H bit; used for least significant octet only. */ #define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT) /* Build a CI from mppe opts (see RFC 3078) */ -#define MPPE_OPTS_TO_CI(opts, ci) \ - do { \ - u_char *ptr = ci; /* u_char[4] */ \ - \ - /* H bit */ \ - if (opts & MPPE_OPT_STATEFUL) \ - *ptr++ = 0x0; \ - else \ - *ptr++ = MPPE_H_BIT; \ - *ptr++ = 0; \ - *ptr++ = 0; \ - \ - /* S,L bits */ \ - *ptr = 0; \ - if (opts & MPPE_OPT_128) \ - *ptr |= MPPE_S_BIT; \ - if (opts & MPPE_OPT_40) \ - *ptr |= MPPE_L_BIT; \ - /* M,D,C bits not supported */ \ +#define MPPE_OPTS_TO_CI(opts, ci) \ + do { \ + u_char *ptr = ci; /* u_char[4] */ \ + \ + /* H bit */ \ + if (opts & MPPE_OPT_STATEFUL) \ + *ptr++ = 0x0; \ + else \ + *ptr++ = MPPE_H_BIT; \ + *ptr++ = 0; \ + *ptr++ = 0; \ + \ + /* S,L bits */ \ + *ptr = 0; \ + if (opts & MPPE_OPT_128) \ + *ptr |= MPPE_S_BIT; \ + if (opts & MPPE_OPT_40) \ + *ptr |= MPPE_L_BIT; \ + /* M,D,C bits not supported */ \ } while (/* CONSTCOND */ 0) /* The reverse of the above */ -#define MPPE_CI_TO_OPTS(ci, opts) \ - do { \ - const u_char *ptr = ci; /* u_char[4] */ \ - \ - opts = 0; \ - \ - /* H bit */ \ - if (!(ptr[0] & MPPE_H_BIT)) \ - opts |= MPPE_OPT_STATEFUL; \ - \ - /* S,L bits */ \ - if (ptr[3] & MPPE_S_BIT) \ - opts |= MPPE_OPT_128; \ - if (ptr[3] & MPPE_L_BIT) \ - opts |= MPPE_OPT_40; \ - \ - /* M,D,C bits */ \ - if (ptr[3] & MPPE_M_BIT) \ - opts |= MPPE_OPT_56; \ - if (ptr[3] & MPPE_D_BIT) \ - opts |= MPPE_OPT_D; \ - if (ptr[3] & MPPE_C_BIT) \ - opts |= MPPE_OPT_MPPC; \ - \ - /* Other bits */ \ - if (ptr[0] & ~MPPE_H_BIT) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[1] || ptr[2]) \ - opts |= MPPE_OPT_UNKNOWN; \ - if (ptr[3] & ~MPPE_ALL_BITS) \ - opts |= MPPE_OPT_UNKNOWN; \ +#define MPPE_CI_TO_OPTS(ci, opts) \ + do { \ + const u_char *ptr = ci; /* u_char[4] */ \ + \ + opts = 0; \ + \ + /* H bit */ \ + if (!(ptr[0] & MPPE_H_BIT)) \ + opts |= MPPE_OPT_STATEFUL; \ + \ + /* S,L bits */ \ + if (ptr[3] & MPPE_S_BIT) \ + opts |= MPPE_OPT_128; \ + if (ptr[3] & MPPE_L_BIT) \ + opts |= MPPE_OPT_40; \ + \ + /* M,D,C bits */ \ + if (ptr[3] & MPPE_M_BIT) \ + opts |= MPPE_OPT_56; \ + if (ptr[3] & MPPE_D_BIT) \ + opts |= MPPE_OPT_D; \ + if (ptr[3] & MPPE_C_BIT) \ + opts |= MPPE_OPT_MPPC; \ + \ + /* Other bits */ \ + if (ptr[0] & ~MPPE_H_BIT) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[1] || ptr[2]) \ + opts |= MPPE_OPT_UNKNOWN; \ + if (ptr[3] & ~MPPE_ALL_BITS) \ + opts |= MPPE_OPT_UNKNOWN; \ } while (/* CONSTCOND */ 0) /* Shared MPPE padding between MSCHAP and MPPE */ @@ -152,18 +152,18 @@ static const u8_t mppe_sha1_pad2[SHA1_PAD_SIZE] = { * State for an MPPE (de)compressor. */ typedef struct ppp_mppe_state { - lwip_arc4_context arc4; - u8_t master_key[MPPE_MAX_KEY_LEN]; - u8_t session_key[MPPE_MAX_KEY_LEN]; - u8_t keylen; /* key length in bytes */ - /* NB: 128-bit == 16, 40-bit == 8! - * If we want to support 56-bit, the unit has to change to bits - */ - u8_t bits; /* MPPE control bits */ - u16_t ccount; /* 12-bit coherency count (seqno) */ - u16_t sanity_errors; /* take down LCP if too many */ - unsigned int stateful :1; /* stateful mode flag */ - unsigned int discard :1; /* stateful mode packet loss flag */ + lwip_arc4_context arc4; + u8_t master_key[MPPE_MAX_KEY_LEN]; + u8_t session_key[MPPE_MAX_KEY_LEN]; + u8_t keylen; /* key length in bytes */ + /* NB: 128-bit == 16, 40-bit == 8! + * If we want to support 56-bit, the unit has to change to bits + */ + u8_t bits; /* MPPE control bits */ + u16_t ccount; /* 12-bit coherency count (seqno) */ + u16_t sanity_errors; /* take down LCP if too many */ + unsigned int stateful :1; /* stateful mode flag */ + unsigned int discard :1; /* stateful mode packet loss flag */ } ppp_mppe_state; void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key); diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h index 91b08e6779..4af724cd90 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/arc4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h index 5e3a085165..e893890ed7 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/des.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h index a4aa1dcc83..570445687e 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md4.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h index 4d7b04d8d0..1244011890 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/md5.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h index d8f347c64e..a4c53e07c5 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/polarssl/sha1.h @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h index eea52f8cd8..3d73c36570 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp.h @@ -7,13 +7,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -107,8 +107,8 @@ extern "C" { /* * The basic PPP frame. */ -#define PPP_HDRLEN 4 /* octets for standard ppp header */ -#define PPP_FCSLEN 2 /* octets for FCS */ +#define PPP_HDRLEN 4 /* octets for standard ppp header */ +#define PPP_FCSLEN 2 /* octets for FCS */ /* * Values for phase. diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h index 29a85c6827..40843d5a0a 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/ppp_impl.h @@ -74,66 +74,66 @@ extern "C" { /* * The basic PPP frame. */ -#define PPP_ADDRESS(p) (((u_char *)(p))[0]) -#define PPP_CONTROL(p) (((u_char *)(p))[1]) -#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) +#define PPP_ADDRESS(p) (((u_char *)(p))[0]) +#define PPP_CONTROL(p) (((u_char *)(p))[1]) +#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3]) /* * Significant octet values. */ -#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ -#define PPP_UI 0x03 /* Unnumbered Information */ -#define PPP_FLAG 0x7e /* Flag Sequence */ -#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ -#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ +#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */ +#define PPP_UI 0x03 /* Unnumbered Information */ +#define PPP_FLAG 0x7e /* Flag Sequence */ +#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */ +#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */ /* * Protocol field values. */ -#define PPP_IP 0x21 /* Internet Protocol */ +#define PPP_IP 0x21 /* Internet Protocol */ #if 0 /* UNUSED */ -#define PPP_AT 0x29 /* AppleTalk Protocol */ -#define PPP_IPX 0x2b /* IPX protocol */ +#define PPP_AT 0x29 /* AppleTalk Protocol */ +#define PPP_IPX 0x2b /* IPX protocol */ #endif /* UNUSED */ #if VJ_SUPPORT -#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ -#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ +#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */ +#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */ #endif /* VJ_SUPPORT */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ +#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_COMP 0xfd /* compressed packet */ +#define PPP_COMP 0xfd /* compressed packet */ #endif /* CCP_SUPPORT */ -#define PPP_IPCP 0x8021 /* IP Control Protocol */ +#define PPP_IPCP 0x8021 /* IP Control Protocol */ #if 0 /* UNUSED */ -#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ -#define PPP_IPXCP 0x802b /* IPX Control Protocol */ +#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */ +#define PPP_IPXCP 0x802b /* IPX Control Protocol */ #endif /* UNUSED */ #if PPP_IPV6_SUPPORT -#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ +#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #endif /* PPP_IPV6_SUPPORT */ #if CCP_SUPPORT -#define PPP_CCP 0x80fd /* Compression Control Protocol */ +#define PPP_CCP 0x80fd /* Compression Control Protocol */ #endif /* CCP_SUPPORT */ #if ECP_SUPPORT -#define PPP_ECP 0x8053 /* Encryption Control Protocol */ +#define PPP_ECP 0x8053 /* Encryption Control Protocol */ #endif /* ECP_SUPPORT */ -#define PPP_LCP 0xc021 /* Link Control Protocol */ +#define PPP_LCP 0xc021 /* Link Control Protocol */ #if PAP_SUPPORT -#define PPP_PAP 0xc023 /* Password Authentication Protocol */ +#define PPP_PAP 0xc023 /* Password Authentication Protocol */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT -#define PPP_LQR 0xc025 /* Link Quality Report protocol */ +#define PPP_LQR 0xc025 /* Link Quality Report protocol */ #endif /* LQR_SUPPORT */ #if CHAP_SUPPORT -#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ +#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */ #endif /* CHAP_SUPPORT */ #if CBCP_SUPPORT -#define PPP_CBCP 0xc029 /* Callback Control Protocol */ +#define PPP_CBCP 0xc029 /* Callback Control Protocol */ #endif /* CBCP_SUPPORT */ #if EAP_SUPPORT -#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ +#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */ #endif /* EAP_SUPPORT */ /* @@ -165,59 +165,59 @@ struct link_callbacks { * What to do with network protocol (NP) packets. */ enum NPmode { - NPMODE_PASS, /* pass the packet through */ - NPMODE_DROP, /* silently drop the packet */ - NPMODE_ERROR, /* return an error */ - NPMODE_QUEUE /* save it up for later. */ + NPMODE_PASS, /* pass the packet through */ + NPMODE_DROP, /* silently drop the packet */ + NPMODE_ERROR, /* return an error */ + NPMODE_QUEUE /* save it up for later. */ }; /* * Statistics. */ #if PPP_STATS_SUPPORT -struct pppstat { - unsigned int ppp_ibytes; /* bytes received */ - unsigned int ppp_ipackets; /* packets received */ - unsigned int ppp_ierrors; /* receive errors */ - unsigned int ppp_obytes; /* bytes sent */ - unsigned int ppp_opackets; /* packets sent */ - unsigned int ppp_oerrors; /* transmit errors */ +struct pppstat { + unsigned int ppp_ibytes; /* bytes received */ + unsigned int ppp_ipackets; /* packets received */ + unsigned int ppp_ierrors; /* receive errors */ + unsigned int ppp_obytes; /* bytes sent */ + unsigned int ppp_opackets; /* packets sent */ + unsigned int ppp_oerrors; /* transmit errors */ }; #if VJ_SUPPORT struct vjstat { - unsigned int vjs_packets; /* outbound packets */ + unsigned int vjs_packets; /* outbound packets */ unsigned int vjs_compressed; /* outbound compressed packets */ - unsigned int vjs_searches; /* searches for connection state */ - unsigned int vjs_misses; /* times couldn't find conn. state */ + unsigned int vjs_searches; /* searches for connection state */ + unsigned int vjs_misses; /* times couldn't find conn. state */ unsigned int vjs_uncompressedin; /* inbound uncompressed packets */ unsigned int vjs_compressedin; /* inbound compressed packets */ - unsigned int vjs_errorin; /* inbound unknown type packets */ - unsigned int vjs_tossed; /* inbound packets tossed because of error */ + unsigned int vjs_errorin; /* inbound unknown type packets */ + unsigned int vjs_tossed; /* inbound packets tossed because of error */ }; #endif /* VJ_SUPPORT */ struct ppp_stats { - struct pppstat p; /* basic PPP statistics */ + struct pppstat p; /* basic PPP statistics */ #if VJ_SUPPORT - struct vjstat vj; /* VJ header compression statistics */ + struct vjstat vj; /* VJ header compression statistics */ #endif /* VJ_SUPPORT */ }; #if CCP_SUPPORT struct compstat { - unsigned int unc_bytes; /* total uncompressed bytes */ - unsigned int unc_packets; /* total uncompressed packets */ - unsigned int comp_bytes; /* compressed bytes */ - unsigned int comp_packets; /* compressed packets */ - unsigned int inc_bytes; /* incompressible bytes */ - unsigned int inc_packets; /* incompressible packets */ - unsigned int ratio; /* recent compression ratio << 8 */ + unsigned int unc_bytes; /* total uncompressed bytes */ + unsigned int unc_packets; /* total uncompressed packets */ + unsigned int comp_bytes; /* compressed bytes */ + unsigned int comp_packets; /* compressed packets */ + unsigned int inc_bytes; /* incompressible bytes */ + unsigned int inc_packets; /* incompressible packets */ + unsigned int ratio; /* recent compression ratio << 8 */ }; struct ppp_comp_stats { - struct compstat c; /* packet compression statistics */ - struct compstat d; /* packet decompression statistics */ + struct compstat c; /* packet compression statistics */ + struct compstat d; /* packet decompression statistics */ }; #endif /* CCP_SUPPORT */ @@ -229,37 +229,37 @@ struct ppp_comp_stats { * the last NP packet was sent or received. */ struct ppp_idle { - time_t xmit_idle; /* time since last NP packet sent */ - time_t recv_idle; /* time since last NP packet received */ + time_t xmit_idle; /* time since last NP packet sent */ + time_t recv_idle; /* time since last NP packet received */ }; #endif /* PPP_IDLETIMELIMIT */ /* values for epdisc.class */ -#define EPD_NULL 0 /* null discriminator, no data */ -#define EPD_LOCAL 1 -#define EPD_IP 2 -#define EPD_MAC 3 -#define EPD_MAGIC 4 -#define EPD_PHONENUM 5 +#define EPD_NULL 0 /* null discriminator, no data */ +#define EPD_LOCAL 1 +#define EPD_IP 2 +#define EPD_MAC 3 +#define EPD_MAGIC 4 +#define EPD_PHONENUM 5 /* * Global variables. */ #ifdef HAVE_MULTILINK -extern u8_t multilink; /* enable multilink operation */ -extern u8_t doing_multilink; -extern u8_t multilink_master; -extern u8_t bundle_eof; -extern u8_t bundle_terminating; +extern u8_t multilink; /* enable multilink operation */ +extern u8_t doing_multilink; +extern u8_t multilink_master; +extern u8_t bundle_eof; +extern u8_t bundle_terminating; #endif #ifdef MAXOCTETS -extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ extern int maxoctets_dir; /* Direction : - 0 - in+out (default) - 1 - in - 2 - out - 3 - max(in,out) */ + 0 - in+out (default) + 1 - in + 2 - out + 3 - max(in,out) */ extern int maxoctets_timeout; /* Timeout for check of octets limit */ #define PPP_OCTETS_DIRECTION_SUM 0 #define PPP_OCTETS_DIRECTION_IN 1 @@ -279,7 +279,7 @@ extern int maxoctets_timeout; /* Timeout for check of octets limit */ * for a particular protocol. */ struct protent { - u_short protocol; /* PPP protocol number */ + u_short protocol; /* PPP protocol number */ /* Initialization procedure */ void (*init) (ppp_pcb *pcb); /* Process a received packet */ @@ -297,19 +297,19 @@ struct protent { #if PRINTPKT_SUPPORT /* Print a packet in readable form */ int (*printpkt) (const u_char *pkt, int len, - void (*printer) (void *, const char *, ...), - void *arg); + void (*printer) (void *, const char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT /* Process a received data packet */ void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - const char *name; /* Text name of protocol */ - const char *data_name; /* Text name of corresponding data protocol */ + const char *name; /* Text name of protocol */ + const char *data_name; /* Text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - option_t *options; /* List of command-line options */ + option_t *options; /* List of command-line options */ /* Check requested options, assign defaults */ void (*check_options) (void); #endif /* PPP_OPTIONS */ @@ -327,28 +327,28 @@ extern const struct protent* const protocols[]; /* Values for auth_pending, auth_done */ #if PAP_SUPPORT -#define PAP_WITHPEER 0x1 -#define PAP_PEER 0x2 +#define PAP_WITHPEER 0x1 +#define PAP_PEER 0x2 #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT -#define CHAP_WITHPEER 0x4 -#define CHAP_PEER 0x8 +#define CHAP_WITHPEER 0x4 +#define CHAP_PEER 0x8 #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT -#define EAP_WITHPEER 0x10 -#define EAP_PEER 0x20 +#define EAP_WITHPEER 0x10 +#define EAP_PEER 0x20 #endif /* EAP_SUPPORT */ /* Values for auth_done only */ #if CHAP_SUPPORT -#define CHAP_MD5_WITHPEER 0x40 -#define CHAP_MD5_PEER 0x80 +#define CHAP_MD5_WITHPEER 0x40 +#define CHAP_MD5_PEER 0x80 #if MSCHAP_SUPPORT -#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ -#define CHAP_MS_WITHPEER 0x100 -#define CHAP_MS_PEER 0x200 -#define CHAP_MS2_WITHPEER 0x400 -#define CHAP_MS2_PEER 0x800 +#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ +#define CHAP_MS_WITHPEER 0x100 +#define CHAP_MS_PEER 0x200 +#define CHAP_MS2_WITHPEER 0x400 +#define CHAP_MS2_PEER 0x800 #endif /* MSCHAP_SUPPORT */ #endif /* CHAP_SUPPORT */ @@ -370,10 +370,10 @@ extern const struct protent* const protocols[]; * PPP statistics structure */ struct pppd_stats { - unsigned int bytes_in; - unsigned int bytes_out; - unsigned int pkts_in; - unsigned int pkts_out; + unsigned int bytes_in; + unsigned int bytes_out; + unsigned int pkts_in; + unsigned int pkts_out; }; #endif /* PPP_STATS_SUPPORT */ @@ -382,7 +382,7 @@ struct pppd_stats { * PPP private functions */ - + /* * Functions called from lwIP core. */ @@ -500,34 +500,34 @@ void update_link_stats(int u); /* Get stats at link termination */ * cp MUST be u_char *. */ #define GETCHAR(c, cp) { \ - (c) = *(cp)++; \ + (c) = *(cp)++; \ } #define PUTCHAR(c, cp) { \ - *(cp)++ = (u_char) (c); \ + *(cp)++ = (u_char) (c); \ } #define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ + (s) = *(cp)++ << 8; \ + (s) |= *(cp)++; \ } #define PUTSHORT(s, cp) { \ - *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ + *(cp)++ = (u_char) ((s) >> 8); \ + *(cp)++ = (u_char) (s); \ } #define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ + (l) = *(cp)++ << 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; (l) <<= 8; \ + (l) |= *(cp)++; \ } #define PUTLONG(l, cp) { \ - *(cp)++ = (u_char) ((l) >> 24); \ - *(cp)++ = (u_char) ((l) >> 16); \ - *(cp)++ = (u_char) ((l) >> 8); \ - *(cp)++ = (u_char) (l); \ + *(cp)++ = (u_char) ((l) >> 24); \ + *(cp)++ = (u_char) ((l) >> 16); \ + *(cp)++ = (u_char) ((l) >> 8); \ + *(cp)++ = (u_char) (l); \ } -#define INCPTR(n, cp) ((cp) += (n)) -#define DECPTR(n, cp) ((cp) -= (n)) +#define INCPTR(n, cp) ((cp) += (n)) +#define DECPTR(n, cp) ((cp) -= (n)) /* * System dependent definitions for user-level 4.3BSD UNIX implementation. @@ -536,10 +536,10 @@ void update_link_stats(int u); /* Get stats at link termination */ #define TIMEOUTMS(f, a, t) do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0) #define UNTIMEOUT(f, a) sys_untimeout((f), (a)) -#define BZERO(s, n) memset(s, 0, n) -#define BCMP(s1, s2, l) memcmp(s1, s2, l) +#define BZERO(s, n) memset(s, 0, n) +#define BCMP(s1, s2, l) memcmp(s1, s2, l) -#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } +#define PRINTMSG(m, l) { ppp_info("Remote message: %0.*v", l, m); } /* * MAKEHEADER - Add Header fields to a packet. @@ -552,7 +552,7 @@ void update_link_stats(int u); /* Get stats at link termination */ /* Procedures exported from auth.c */ void link_required(ppp_pcb *pcb); /* we are starting to use the link */ void link_terminated(ppp_pcb *pcb); /* we are finished with the link */ -void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ +void link_down(ppp_pcb *pcb); /* the LCP layer has left the Opened state */ void upper_layers_down(ppp_pcb *pcb); /* take all NCPs down */ void link_established(ppp_pcb *pcb); /* the link is up; authenticate now */ void start_networks(ppp_pcb *pcb); /* start all the network control protos */ @@ -562,21 +562,21 @@ void continue_networks(ppp_pcb *pcb); /* start network [ip, etc] control protos int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen); /* check the user name and passwd against configuration */ void auth_peer_fail(ppp_pcb *pcb, int protocol); - /* peer failed to authenticate itself */ + /* peer failed to authenticate itself */ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen); - /* peer successfully authenticated itself */ + /* peer successfully authenticated itself */ #endif /* PPP_SERVER */ void auth_withpeer_fail(ppp_pcb *pcb, int protocol); - /* we failed to authenticate ourselves */ + /* we failed to authenticate ourselves */ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor); - /* we successfully authenticated ourselves */ + /* we successfully authenticated ourselves */ #endif /* PPP_AUTH_SUPPORT */ void np_up(ppp_pcb *pcb, int proto); /* a network protocol has come up */ void np_down(ppp_pcb *pcb, int proto); /* a network protocol has gone down */ void np_finished(ppp_pcb *pcb, int proto); /* a network protocol no longer needs link */ #if PPP_AUTH_SUPPORT int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server); - /* get "secret" for chap */ + /* get "secret" for chap */ #endif /* PPP_AUTH_SUPPORT */ /* Procedures exported from ipcp.c */ @@ -584,8 +584,8 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre /* Procedures exported from demand.c */ #if DEMAND_SUPPORT -void demand_conf (void); /* config interface(s) for demand-dial */ -void demand_block (void); /* set all NPs to queue up packets */ +void demand_conf (void); /* config interface(s) for demand-dial */ +void demand_block (void); /* set all NPs to queue up packets */ void demand_unblock (void); /* set all NPs to pass packets */ void demand_discard (void); /* set all NPs to discard packets */ void demand_rexmit (int, u32_t); /* retransmit saved frames for an NP*/ @@ -602,10 +602,10 @@ void mp_bundle_terminated (void); char *epdisc_to_str (struct epdisc *); /* string from endpoint discrim. */ int str_to_epdisc (struct epdisc *, char *); /* endpt disc. from str */ #else -#define mp_bundle_terminated() /* nothing */ -#define mp_exit_bundle() /* nothing */ -#define doing_multilink 0 -#define multilink_master 0 +#define mp_bundle_terminated() /* nothing */ +#define mp_exit_bundle() /* nothing */ +#define doing_multilink 0 +#define multilink_master 0 #endif /* Procedures exported from utils.c. */ diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h b/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h index 2531ee0a99..c0230bbcb7 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/pppcrypt.h @@ -36,7 +36,7 @@ /* This header file is included in all PPP modules needing hashes and/or ciphers */ #ifndef PPPCRYPT_H -#define PPPCRYPT_H +#define PPPCRYPT_H /* * If included PolarSSL copy is not used, user is expected to include diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h b/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h index 5e6741bf01..36ee4f9bf9 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/pppdebug.h @@ -8,13 +8,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h b/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h index c96eb784dd..08ab7ab54e 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/pppoe.h @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, diff --git a/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h b/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h index caf81939d8..540d981492 100644 --- a/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h +++ b/components/net/lwip-2.1.2/src/include/netif/ppp/upap.h @@ -57,44 +57,44 @@ extern "C" { /* * Packet header = Code, id, length. */ -#define UPAP_HEADERLEN 4 +#define UPAP_HEADERLEN 4 /* * UPAP codes. */ -#define UPAP_AUTHREQ 1 /* Authenticate-Request */ -#define UPAP_AUTHACK 2 /* Authenticate-Ack */ -#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ +#define UPAP_AUTHREQ 1 /* Authenticate-Request */ +#define UPAP_AUTHACK 2 /* Authenticate-Ack */ +#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ /* * Client states. */ -#define UPAPCS_INITIAL 0 /* Connection down */ -#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ -#define UPAPCS_OPEN 4 /* We've received an Ack */ -#define UPAPCS_BADAUTH 5 /* We've received a Nak */ +#define UPAPCS_INITIAL 0 /* Connection down */ +#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ +#define UPAPCS_OPEN 4 /* We've received an Ack */ +#define UPAPCS_BADAUTH 5 /* We've received a Nak */ /* * Server states. */ -#define UPAPSS_INITIAL 0 /* Connection down */ -#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ -#define UPAPSS_OPEN 4 /* We've sent an Ack */ -#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ +#define UPAPSS_INITIAL 0 /* Connection down */ +#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ +#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ +#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ +#define UPAPSS_OPEN 4 /* We've sent an Ack */ +#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ /* * Timeouts. */ #if 0 /* moved to ppp_opts.h */ -#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ +#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */ +#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ #endif /* moved to ppp_opts.h */ /* @@ -102,16 +102,16 @@ extern "C" { */ #if PAP_SUPPORT typedef struct upap_state { - const char *us_user; /* User */ - u8_t us_userlen; /* User length */ - const char *us_passwd; /* Password */ - u8_t us_passwdlen; /* Password length */ - u8_t us_clientstate; /* Client state */ + const char *us_user; /* User */ + u8_t us_userlen; /* User length */ + const char *us_passwd; /* Password */ + u8_t us_passwdlen; /* Password length */ + u8_t us_clientstate; /* Client state */ #if PPP_SERVER - u8_t us_serverstate; /* Server state */ + u8_t us_serverstate; /* Server state */ #endif /* PPP_SERVER */ - u8_t us_id; /* Current id */ - u8_t us_transmits; /* Number of auth-reqs sent */ + u8_t us_id; /* Current id */ + u8_t us_transmits; /* Number of auth-reqs sent */ } upap_state; #endif /* PAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c b/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c index 2f052ec093..6739fc247c 100644 --- a/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c +++ b/components/net/lwip-2.1.2/src/netif/bridgeif_fdb.c @@ -69,7 +69,7 @@ typedef struct bridgeif_dfdb_s { * remembers known src mac addresses to know which port to send frames destined for that * mac address. * - * ATTENTION: This is meant as an example only, in real-world use, you should + * ATTENTION: This is meant as an example only, in real-world use, you should * provide a better implementation :-) */ void @@ -120,9 +120,9 @@ bridgeif_fdb_update_src(void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx) /* not found, no free entry -> flood */ } -/** +/** * @ingroup bridgeif_fdb - * Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown + * Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown */ bridgeif_portmask_t bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr) diff --git a/components/net/lwip-2.1.2/src/netif/ethernetif.c b/components/net/lwip-2.1.2/src/netif/ethernetif.c index 829978c139..52bd0fb7b6 100644 --- a/components/net/lwip-2.1.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.1.2/src/netif/ethernetif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * COPYRIGHT (C) 2006-2021, RT-Thread Development Team + * COPYRIGHT (C) 2006-2018, RT-Thread Development Team * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -163,16 +163,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) { netdev_low_level_set_dhcp_status(netif, is_enabled); - + if(RT_TRUE == is_enabled) { dhcp_start((struct netif *)netif->user_data); } else { - dhcp_stop((struct netif *)netif->user_data); + dhcp_stop((struct netif *)netif->user_data); } - + return ERR_OK; } #endif /* RT_LWIP_DHCP */ @@ -182,7 +182,7 @@ static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled) extern int lwip_ping_recv(int s, int *ttl); extern err_t lwip_ping_send(int s, ip_addr_t *addr, int size); -int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, +int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp) { int s, ttl, recv_len, result = 0; @@ -197,7 +197,7 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, struct addrinfo hint, *res = RT_NULL; struct sockaddr_in *h = RT_NULL; struct in_addr ina; - + RT_ASSERT(netif); RT_ASSERT(host); RT_ASSERT(ping_resp); @@ -216,7 +216,7 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len, return -RT_ERROR; } rt_memcpy(&(ping_resp->ip_addr), &target_addr, sizeof(ip_addr_t)); - + /* new a socket */ if ((s = lwip_socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP)) < 0) { @@ -284,7 +284,7 @@ const struct netdev_ops lwip_netdev_ops = lwip_netdev_set_addr_info, #ifdef RT_LWIP_DNS lwip_netdev_set_dns_server, -#else +#else NULL, #endif /* RT_LWIP_DNS */ @@ -323,7 +323,7 @@ static int netdev_add(struct netif *lwip_netif) { return -ERR_IF; } - + #ifdef SAL_USING_LWIP extern int sal_lwip_netdev_set_pf_info(struct netdev *netdev); /* set the lwIP network interface device protocol family information */ @@ -332,7 +332,7 @@ static int netdev_add(struct netif *lwip_netif) rt_strncpy(name, lwip_netif->name, LWIP_NETIF_NAME_LEN); result = netdev_register(netdev, name, (void *)lwip_netif); - + /* Update netdev info after registered */ netdev->flags = lwip_netif->flags; netdev->mtu = lwip_netif->mtu; @@ -375,7 +375,7 @@ static int netdev_flags_sync(struct netif *lwip_netif) { return -ERR_IF; } - + netdev->mtu = lwip_netif->mtu; netdev->flags |= lwip_netif->flags; @@ -438,7 +438,7 @@ static err_t eth_netif_device_init(struct netif *netif) /* copy device flags to netif flags */ netif->flags = (ethif->flags & 0xff); netif->mtu = ETHERNET_MTU; - + /* set output */ netif->output = etharp_output; @@ -530,7 +530,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ /* set linkoutput */ netif->linkoutput = ethernetif_linkoutput; - + /* get hardware MAC address */ rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr); @@ -550,7 +550,7 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_ ipaddr.addr = inet_addr(RT_LWIP_IPADDR); gw.addr = inet_addr(RT_LWIP_GWADDR); netmask.addr = inet_addr(RT_LWIP_MSKADDR); -#else +#else IP4_ADDR(&ipaddr, 0, 0, 0, 0); IP4_ADDR(&gw, 0, 0, 0, 0); IP4_ADDR(&netmask, 0, 0, 0, 0); @@ -702,7 +702,7 @@ static void eth_rx_thread_entry(void* parameter) while (1) { if(device->eth_rx == RT_NULL) break; - + p = device->eth_rx(&(device->parent)); if (p != RT_NULL) { @@ -725,9 +725,9 @@ static void eth_rx_thread_entry(void* parameter) } #endif -/* this function does not need, - * use eth_system_device_init_private() - * call by lwip_system_init(). +/* this function does not need, + * use eth_system_device_init_private() + * call by lwip_system_init(). */ int eth_system_device_init(void) { @@ -870,27 +870,27 @@ void list_if(void) rt_kprintf("gw address: %s\n", ipaddr_ntoa(&(netif->gw))); rt_kprintf("net mask : %s\n", ipaddr_ntoa(&(netif->netmask))); #if LWIP_IPV6 - { - ip6_addr_t *addr; - int addr_state; - int i; - - addr = (ip6_addr_t *)&netif->ip6_addr[0]; - addr_state = netif->ip6_addr_state[0]; - - rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - - for(i=1; iip6_addr[i]; - addr_state = netif->ip6_addr_state[i]; - - rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), - addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); - } - - } + { + ip6_addr_t *addr; + int addr_state; + int i; + + addr = (ip6_addr_t *)&netif->ip6_addr[0]; + addr_state = netif->ip6_addr_state[0]; + + rt_kprintf("\nipv6 link-local: %s state:%02X %s\n", ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + + for(i=1; iip6_addr[i]; + addr_state = netif->ip6_addr_state[i]; + + rt_kprintf("ipv6[%d] address: %s state:%02X %s\n", i, ip6addr_ntoa(addr), + addr_state, ip6_addr_isvalid(addr_state)?"VALID":"INVALID"); + } + + } rt_kprintf("\r\n"); #endif /* LWIP_IPV6 */ netif = netif->next; diff --git a/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c b/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c index d59b432f53..d89816d3b0 100644 --- a/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c +++ b/components/net/lwip-2.1.2/src/netif/lowpan6_ble.c @@ -6,7 +6,7 @@ /* * Copyright (c) 2017 Benjamin Aigner * Copyright (c) 2015 Inico Technologies Ltd. , Author: Ivan Delamer - * + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -32,7 +32,7 @@ * OF SUCH DAMAGE. * * Author: Benjamin Aigner - * + * * Based on the original 6lowpan implementation of lwIP ( @see 6lowpan.c) */ @@ -95,15 +95,15 @@ static struct lowpan6_link_addr rfc7668_peer_addr; /** * @ingroup rfc7668if * convert BT address to EUI64 addr - * + * * This method converts a Bluetooth MAC address to an EUI64 address, * which is used within IPv6 communication - * + * * @param dst IPv6 destination space * @param src BLE MAC address source * @param public_addr If the LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS * option is set, bit 0x02 will be set if param=0 (no public addr); cleared otherwise - * + * * @see LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS */ void @@ -128,12 +128,12 @@ ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr) /** * @ingroup rfc7668if * convert EUI64 address to Bluetooth MAC addr - * + * * This method converts an EUI64 address to a Bluetooth MAC address, - * + * * @param dst BLE MAC address destination * @param src IPv6 source - * + * */ void eui64_to_ble_addr(uint8_t *dst, const uint8_t *src) @@ -214,16 +214,16 @@ rfc7668_set_peer_addr_mac48(struct netif *netif, const u8_t *peer_addr, size_t p } /** Encapsulate IPv6 frames for BLE transmission - * + * * This method implements the IPv6 header compression: * *) According to RFC6282 * *) See Figure 2, contains base format of bit positions * *) Fragmentation not necessary (done at L2CAP layer of BLE) * @note Currently the pbuf allocation uses 256 bytes. If longer packets are used (possible due to MTU=1480Bytes), increase it here! - * + * * @param p Pbuf struct, containing the payload data * @param netif Output network interface. Should be of RFC7668 type - * + * * @return Same as netif->output. */ static err_t @@ -340,7 +340,7 @@ rfc7668_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr) * @param p the received packet, p->payload pointing to the * IPv6 header (maybe compressed) * @param netif the network interface on which the packet was received - * + * * @return ERR_OK if everything was fine */ err_t @@ -352,7 +352,7 @@ rfc7668_input(struct pbuf * p, struct netif *netif) /* Load first header byte */ puc = (u8_t*)p->payload; - + /* no IP header compression */ if (*puc == 0x41) { LWIP_DEBUGF(LWIP_LOWPAN6_DECOMPRESSION_DEBUG, ("Completed packet, removing dispatch: 0x%2x \n", *puc)); @@ -398,12 +398,12 @@ rfc7668_input(struct pbuf * p, struct netif *netif) /** * @ingroup rfc7668if * Initialize the netif - * + * * No flags are used (broadcast not possible, not ethernet, ...) * The shortname for this netif is "BT" * * @param netif the network interface to be initialized as RFC7668 netif - * + * * @return ERR_OK if everything went fine */ err_t @@ -433,7 +433,7 @@ rfc7668_if_init(struct netif *netif) * @param p the received packet, p->payload pointing to the * IEEE 802.15.4 header. * @param inp the network interface on which the packet was received - * + * * @return see @ref tcpip_inpkt, same return values */ err_t diff --git a/components/net/lwip-2.1.2/src/netif/lowpan6_common.c b/components/net/lwip-2.1.2/src/netif/lowpan6_common.c index 89758d94d9..baea206a71 100644 --- a/components/net/lwip-2.1.2/src/netif/lowpan6_common.c +++ b/components/net/lwip-2.1.2/src/netif/lowpan6_common.c @@ -430,7 +430,7 @@ lowpan6_decompress_hdr(u8_t *lowpan6_buffer, size_t lowpan6_bufsize, /* offset for inline IP headers (RFC 6282 ch3)*/ lowpan6_offset = 2; - /* if CID is set (context identifier), the context byte + /* if CID is set (context identifier), the context byte * follows immediately after the header, so other IPHC fields are @+3 */ if (lowpan6_buffer[1] & 0x80) { lowpan6_offset++; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/auth.c b/components/net/lwip-2.1.2/src/netif/ppp/auth.c index 480a653ddd..c8673ad0fb 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/auth.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/auth.c @@ -133,10 +133,10 @@ #if 0 /* UNUSED */ /* Bits in scan_authfile return value */ -#define NONWILD_SERVER 1 -#define NONWILD_CLIENT 2 +#define NONWILD_SERVER 1 +#define NONWILD_CLIENT 2 -#define ISWILD(word) (word[0] == '*' && word[1] == 0) +#define ISWILD(word) (word[0] == '*' && word[1] == 0) #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -169,8 +169,8 @@ int (*pap_check_hook) (void) = NULL; /* Hook for a plugin to check the PAP user and password */ int (*pap_auth_hook) (char *user, char *passwd, char **msgp, - struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **paddrs, + struct wordlist **popts) = NULL; /* Hook for a plugin to know about the PAP user logout */ void (*pap_logout_hook) (void) = NULL; @@ -187,7 +187,7 @@ int (*chap_passwd_hook) (char *user, char *passwd) = NULL; /* Hook for a plugin to say whether it is OK if the peer refuses to authenticate. */ int (*null_auth_hook) (struct wordlist **paddrs, - struct wordlist **popts) = NULL; + struct wordlist **popts) = NULL; int (*allowed_address_hook) (u32_t addr) = NULL; #endif /* UNUSED */ @@ -210,27 +210,27 @@ struct notifier *link_down_notifier = NULL; * Option variables. */ #if 0 /* MOVED TO ppp_settings */ -bool uselogin = 0; /* Use /etc/passwd for checking PAP */ -bool session_mgmt = 0; /* Do session management (login records) */ -bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ -bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ -bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ -bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ +bool uselogin = 0; /* Use /etc/passwd for checking PAP */ +bool session_mgmt = 0; /* Do session management (login records) */ +bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ +bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ +bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ +bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */ #if MSCHAP_SUPPORT -bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #else /* MSCHAP_SUPPORT */ -bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ -bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ +bool refuse_mschap = 1; /* Don't wanna auth. ourselves with MS-CHAP */ +bool refuse_mschap_v2 = 1; /* Don't wanna auth. ourselves with MS-CHAPv2 */ #endif /* MSCHAP_SUPPORT */ -bool usehostname = 0; /* Use hostname for our_name */ -bool auth_required = 0; /* Always require authentication from peer */ -bool allow_any_ip = 0; /* Allow peer to use any IP address */ -bool explicit_remote = 0; /* User specified explicit remote name */ -bool explicit_user = 0; /* Set if "user" option supplied */ -bool explicit_passwd = 0; /* Set if "password" option supplied */ -char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -static char *uafname; /* name of most recent +ua file */ +bool usehostname = 0; /* Use hostname for our_name */ +bool auth_required = 0; /* Always require authentication from peer */ +bool allow_any_ip = 0; /* Allow peer to use any IP address */ +bool explicit_remote = 0; /* User specified explicit remote name */ +bool explicit_user = 0; /* Set if "user" option supplied */ +bool explicit_passwd = 0; /* Set if "password" option supplied */ +char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ +static char *uafname; /* name of most recent +ua file */ extern char *crypt (const char *, const char *); #endif /* UNUSED */ @@ -252,8 +252,8 @@ static int have_srp_secret (char *client, char *server, int need_ip, int *lacks_ipp); static int ip_addr_check (u32_t, struct permitted_ip *); static int scan_authfile (FILE *, char *, char *, char *, - struct wordlist **, struct wordlist **, - char *, int); + struct wordlist **, struct wordlist **, + char *, int); static void free_wordlist (struct wordlist *); static void set_allowed_addrs (int, struct wordlist *, struct wordlist *); static int some_ip_ok (struct wordlist *); @@ -427,46 +427,46 @@ setupapfile(argv) /* open user info file */ fname = strdup(*argv); if (fname == NULL) - novm("+ua file name"); + novm("+ua file name"); euid = geteuid(); if (seteuid(getuid()) == -1) { - option_error("unable to reset uid before opening %s: %m", fname); - return 0; + option_error("unable to reset uid before opening %s: %m", fname); + return 0; } ufile = fopen(fname, "r"); if (seteuid(euid) == -1) - fatal("unable to regain privileges: %m"); + fatal("unable to regain privileges: %m"); if (ufile == NULL) { - option_error("unable to open user login data file %s", fname); - return 0; + option_error("unable to open user login data file %s", fname); + return 0; } check_access(ufile, fname); uafname = fname; /* get username */ if (fgets(u, MAXNAMELEN - 1, ufile) == NULL - || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { - fclose(ufile); - option_error("unable to read user login data file %s", fname); - return 0; + || fgets(p, MAXSECRETLEN - 1, ufile) == NULL) { + fclose(ufile); + option_error("unable to read user login data file %s", fname); + return 0; } fclose(ufile); /* get rid of newlines */ l = strlen(u); if (l > 0 && u[l-1] == '\n') - u[l-1] = 0; + u[l-1] = 0; l = strlen(p); if (l > 0 && p[l-1] == '\n') - p[l-1] = 0; + p[l-1] = 0; if (override_value("user", option_priority, fname)) { - strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); - explicit_user = 1; + strlcpy(ppp_settings.user, u, sizeof(ppp_settings.user)); + explicit_user = 1; } if (override_value("passwd", option_priority, fname)) { - strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); - explicit_passwd = 1; + strlcpy(ppp_settings.passwd, p, sizeof(ppp_settings.passwd)); + explicit_passwd = 1; } return (1); @@ -484,14 +484,14 @@ privgroup(argv) g = getgrnam(*argv); if (g == 0) { - option_error("group %s is unknown", *argv); - return 0; + option_error("group %s is unknown", *argv); + return 0; } for (i = 0; i < ngroups; ++i) { - if (groups[i] == g->gr_gid) { - privileged = 1; - break; - } + if (groups[i] == g->gr_gid) { + privileged = 1; + break; + } } return 1; } @@ -511,7 +511,7 @@ set_noauth_addr(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-ip argument"); + novm("allow-ip argument"); wp->word = (char *) (wp + 1); wp->next = noauth_addrs; MEMCPY(wp->word, addr, l); @@ -533,7 +533,7 @@ set_permitted_number(argv) wp = (struct wordlist *) malloc(sizeof(struct wordlist) + l); if (wp == NULL) - novm("allow-number argument"); + novm("allow-number argument"); wp->word = (char *) (wp + 1); wp->next = permitted_numbers; MEMCPY(wp->word, number, l); @@ -566,7 +566,7 @@ void start_link(unit) devfd = the_channel->connect(); msg = "Connect script failed"; if (devfd < 0) - goto fail; + goto fail; /* set up the serial device as a ppp interface */ /* @@ -579,21 +579,21 @@ void start_link(unit) fd_ppp = the_channel->establish_ppp(devfd); msg = "ppp establishment failed"; if (fd_ppp < 0) { - status = EXIT_FATAL_ERROR; - goto disconnect; + status = EXIT_FATAL_ERROR; + goto disconnect; } if (!demand && ifunit >= 0) - set_ifunit(1); + set_ifunit(1); /* * Start opening the connection and wait for * incoming events (reply, timeout, etc.). */ if (ifunit >= 0) - ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); + ppp_notice("Connect: %s <--> %s", ifname, ppp_devnam); else - ppp_notice("Starting negotiation on %s", ppp_devnam); + ppp_notice("Starting negotiation on %s", ppp_devnam); add_fd(fd_ppp); new_phase(pcb, PPP_PHASE_ESTABLISH); @@ -604,12 +604,12 @@ void start_link(unit) disconnect: new_phase(pcb, PPP_PHASE_DISCONNECT); if (the_channel->disconnect) - the_channel->disconnect(); + the_channel->disconnect(); fail: new_phase(pcb, PPP_PHASE_DEAD); if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); } #endif @@ -623,23 +623,23 @@ void link_terminated(ppp_pcb *pcb) { || pcb->phase == PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - return; + return; new_phase(pcb, PPP_PHASE_DISCONNECT); #if 0 /* UNUSED */ if (pap_logout_hook) { - pap_logout_hook(); + pap_logout_hook(); } session_end(devnam); #endif /* UNUSED */ if (!doing_multilink) { - ppp_notice("Connection terminated."); + ppp_notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ } else - ppp_notice("Link terminated."); + ppp_notice("Link terminated."); lcp_lowerdown(pcb); @@ -651,7 +651,7 @@ void link_terminated(ppp_pcb *pcb) { * we delete its pid file. */ if (!doing_multilink && !demand) - remove_pidfiles(); + remove_pidfiles(); /* * If we may want to bring the link up again, transfer @@ -659,36 +659,36 @@ void link_terminated(ppp_pcb *pcb) { * real serial device back to its normal mode of operation. */ if (fd_ppp >= 0) { - remove_fd(fd_ppp); - clean_check(); - the_channel->disestablish_ppp(devfd); - if (doing_multilink) - mp_exit_bundle(); - fd_ppp = -1; + remove_fd(fd_ppp); + clean_check(); + the_channel->disestablish_ppp(devfd); + if (doing_multilink) + mp_exit_bundle(); + fd_ppp = -1; } if (!hungup) - lcp_lowerdown(pcb); + lcp_lowerdown(pcb); if (!doing_multilink && !demand) - script_unsetenv("IFNAME"); + script_unsetenv("IFNAME"); /* * Run disconnector script, if requested. * XXX we may not be able to do this if the line has hung up! */ if (devfd >= 0 && the_channel->disconnect) { - the_channel->disconnect(); - devfd = -1; + the_channel->disconnect(); + devfd = -1; } if (the_channel->cleanup) - (*the_channel->cleanup)(); + (*the_channel->cleanup)(); if (doing_multilink && multilink_master) { - if (!bundle_terminating) - new_phase(pcb, PPP_PHASE_MASTER); - else - mp_bundle_terminated(); + if (!bundle_terminating) + new_phase(pcb, PPP_PHASE_MASTER); + else + mp_bundle_terminated(); } else - new_phase(pcb, PPP_PHASE_DEAD); + new_phase(pcb, PPP_PHASE_DEAD); #endif } @@ -701,13 +701,13 @@ void link_down(ppp_pcb *pcb) { #endif /* PPP_NOTIFY */ if (!doing_multilink) { - upper_layers_down(pcb); - if (pcb->phase != PPP_PHASE_DEAD + upper_layers_down(pcb); + if (pcb->phase != PPP_PHASE_DEAD #ifdef HAVE_MULTILINK - && pcb->phase != PPP_PHASE_MASTER + && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ - ) - new_phase(pcb, PPP_PHASE_ESTABLISH); + ) + new_phase(pcb, PPP_PHASE_ESTABLISH); } /* XXX if doing_multilink, should do something to stop network-layer traffic on the link */ @@ -719,9 +719,9 @@ void upper_layers_down(ppp_pcb *pcb) { for (i = 0; (protp = protocols[i]) != NULL; ++i) { if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) - (*protp->lowerdown)(pcb); + (*protp->lowerdown)(pcb); if (protp->protocol < 0xC000 && protp->close != NULL) - (*protp->close)(pcb, "LCP down"); + (*protp->close)(pcb, "LCP down"); } pcb->num_np_open = 0; pcb->num_np_up = 0; @@ -749,56 +749,56 @@ void link_established(ppp_pcb *pcb) { * Tell higher-level protocols that LCP is up. */ if (!doing_multilink) { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol != PPP_LCP - && protp->lowerup != NULL) - (*protp->lowerup)(pcb); + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (protp->protocol != PPP_LCP + && protp->lowerup != NULL) + (*protp->lowerup)(pcb); } #if PPP_AUTH_SUPPORT #if PPP_SERVER #if PPP_ALLOWED_ADDRS if (!auth_required && noauth_addrs != NULL) - set_allowed_addrs(unit, NULL, NULL); + set_allowed_addrs(unit, NULL, NULL); #endif /* PPP_ALLOWED_ADDRS */ if (pcb->settings.auth_required && !(0 #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if PPP_ALLOWED_ADDRS - /* - * We wanted the peer to authenticate itself, and it refused: - * if we have some address(es) it can use without auth, fine, - * otherwise treat it as though it authenticated with PAP using - * a username of "" and a password of "". If that's not OK, - * boot it out. - */ - if (noauth_addrs != NULL) { - set_allowed_addrs(unit, NULL, NULL); - } else + /* + * We wanted the peer to authenticate itself, and it refused: + * if we have some address(es) it can use without auth, fine, + * otherwise treat it as though it authenticated with PAP using + * a username of "" and a password of "". If that's not OK, + * boot it out. + */ + if (noauth_addrs != NULL) { + set_allowed_addrs(unit, NULL, NULL); + } else #endif /* PPP_ALLOWED_ADDRS */ - if (!pcb->settings.null_login + if (!pcb->settings.null_login #if PAP_SUPPORT - || !wo->neg_upap + || !wo->neg_upap #endif /* PAP_SUPPORT */ - ) { - ppp_warn("peer refused to authenticate: terminating link"); + ) { + ppp_warn("peer refused to authenticate: terminating link"); #if 0 /* UNUSED */ - status = EXIT_PEER_AUTH_FAILED; + status = EXIT_PEER_AUTH_FAILED; #endif /* UNUSED */ - pcb->err_code = PPPERR_AUTHFAIL; - lcp_close(pcb, "peer refused to authenticate"); - return; - } + pcb->err_code = PPPERR_AUTHFAIL; + lcp_close(pcb, "peer refused to authenticate"); + return; + } } #endif /* PPP_SERVER */ @@ -807,20 +807,20 @@ void link_established(ppp_pcb *pcb) { #if PPP_SERVER #if EAP_SUPPORT if (go->neg_eap) { - eap_authpeer(pcb, PPP_OUR_NAME); - auth |= EAP_PEER; + eap_authpeer(pcb, PPP_OUR_NAME); + auth |= EAP_PEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (go->neg_chap) { - chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); - auth |= CHAP_PEER; + chap_auth_peer(pcb, PPP_OUR_NAME, CHAP_DIGEST(go->chap_mdtype)); + auth |= CHAP_PEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (go->neg_upap) { - upap_authpeer(pcb); - auth |= PAP_PEER; + upap_authpeer(pcb); + auth |= PAP_PEER; } else #endif /* PAP_SUPPORT */ {} @@ -828,20 +828,20 @@ void link_established(ppp_pcb *pcb) { #if EAP_SUPPORT if (ho->neg_eap) { - eap_authwithpeer(pcb, pcb->settings.user); - auth |= EAP_WITHPEER; + eap_authwithpeer(pcb, pcb->settings.user); + auth |= EAP_WITHPEER; } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT if (ho->neg_chap) { - chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); - auth |= CHAP_WITHPEER; + chap_auth_with_peer(pcb, pcb->settings.user, CHAP_DIGEST(ho->chap_mdtype)); + auth |= CHAP_WITHPEER; } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT if (ho->neg_upap) { - upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); - auth |= PAP_WITHPEER; + upap_authwithpeer(pcb, pcb->settings.user, pcb->settings.passwd); + auth |= PAP_WITHPEER; } else #endif /* PAP_SUPPORT */ {} @@ -851,7 +851,7 @@ void link_established(ppp_pcb *pcb) { if (!auth) #endif /* PPP_AUTH_SUPPORT */ - network_phase(pcb); + network_phase(pcb); } /* @@ -868,7 +868,7 @@ static void network_phase(ppp_pcb *pcb) { #if 0 /* UNUSED */ /* Log calling number. */ if (*remote_number) - ppp_notice("peer from calling number %q authorized", remote_number); + ppp_notice("peer from calling number %q authorized", remote_number); #endif /* UNUSED */ #if PPP_NOTIFY @@ -877,16 +877,16 @@ static void network_phase(ppp_pcb *pcb) { */ if (0 #if CHAP_SUPPORT - || go->neg_chap + || go->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - || go->neg_upap + || go->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap + || go->neg_eap #endif /* EAP_SUPPORT */ - ) { - notify(auth_up_notifier, 0); + ) { + notify(auth_up_notifier, 0); } #endif /* PPP_NOTIFY */ @@ -895,9 +895,9 @@ static void network_phase(ppp_pcb *pcb) { * If we negotiated callback, do it now. */ if (go->neg_cbcp) { - new_phase(pcb, PPP_PHASE_CALLBACK); - (*cbcp_protent.open)(pcb); - return; + new_phase(pcb, PPP_PHASE_CALLBACK); + (*cbcp_protent.open)(pcb); + return; } #endif @@ -906,9 +906,9 @@ static void network_phase(ppp_pcb *pcb) { * Process extra options from the secrets file */ if (extra_options) { - options_from_list(extra_options, 1); - free_wordlist(extra_options); - extra_options = 0; + options_from_list(extra_options, 1); + free_wordlist(extra_options); + extra_options = 0; } #endif /* PPP_OPTIONS */ start_networks(pcb); @@ -924,34 +924,34 @@ void start_networks(ppp_pcb *pcb) { #ifdef HAVE_MULTILINK if (multilink) { - if (mp_join_bundle()) { - if (multilink_join_hook) - (*multilink_join_hook)(); - if (updetach && !nodetach) - detach(); - return; - } + if (mp_join_bundle()) { + if (multilink_join_hook) + (*multilink_join_hook)(); + if (updetach && !nodetach) + detach(); + return; + } } #endif /* HAVE_MULTILINK */ #ifdef PPP_FILTER if (!demand) - set_filters(&pass_filter, &active_filter); + set_filters(&pass_filter, &active_filter); #endif #if CCP_SUPPORT || ECP_SUPPORT /* Start CCP and ECP */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if ( - (0 + if ( + (0 #if ECP_SUPPORT - || protp->protocol == PPP_ECP + || protp->protocol == PPP_ECP #endif /* ECP_SUPPORT */ #if CCP_SUPPORT - || protp->protocol == PPP_CCP + || protp->protocol == PPP_CCP #endif /* CCP_SUPPORT */ - ) - && protp->open != NULL) - (*protp->open)(pcb); + ) + && protp->open != NULL) + (*protp->open)(pcb); #endif /* CCP_SUPPORT || ECP_SUPPORT */ /* @@ -965,7 +965,7 @@ void start_networks(ppp_pcb *pcb) { && !pcb->ccp_gotoptions.mppe #endif /* MPPE_SUPPORT */ ) - continue_networks(pcb); + continue_networks(pcb); } void continue_networks(ppp_pcb *pcb) { @@ -976,21 +976,21 @@ void continue_networks(ppp_pcb *pcb) { * Start the "real" network protocols. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol < 0xC000 + if (protp->protocol < 0xC000 #if CCP_SUPPORT - && protp->protocol != PPP_CCP + && protp->protocol != PPP_CCP #endif /* CCP_SUPPORT */ #if ECP_SUPPORT - && protp->protocol != PPP_ECP + && protp->protocol != PPP_ECP #endif /* ECP_SUPPORT */ - && protp->open != NULL) { - (*protp->open)(pcb); - ++pcb->num_np_open; - } + && protp->open != NULL) { + (*protp->open)(pcb); + ++pcb->num_np_open; + } if (pcb->num_np_open == 0) - /* nothing to do */ - lcp_close(pcb, "No network protocols running"); + /* nothing to do */ + lcp_close(pcb, "No network protocols running"); } #if PPP_AUTH_SUPPORT @@ -1053,37 +1053,37 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_PEER; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_PEER; - break; + bit = CHAP_PEER; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_PEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_PEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_PEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_PEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_PEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_PEER; - break; + bit = PAP_PEER; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_PEER; - break; + bit = EAP_PEER; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_peer_success: unknown protocol %x", protocol); - return; + ppp_warn("auth_peer_success: unknown protocol %x", protocol); + return; } #ifdef HAVE_MULTILINK @@ -1091,7 +1091,7 @@ void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char * * Save the authenticated name of the peer for later. */ if (namelen > (int)sizeof(pcb->peer_authname) - 1) - namelen = (int)sizeof(pcb->peer_authname) - 1; + namelen = (int)sizeof(pcb->peer_authname) - 1; MEMCPY(pcb->peer_authname, name, namelen); pcb->peer_authname[namelen] = 0; #endif /* HAVE_MULTILINK */ @@ -1140,41 +1140,41 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { switch (protocol) { #if CHAP_SUPPORT case PPP_CHAP: - bit = CHAP_WITHPEER; - prot = "CHAP"; - switch (prot_flavor) { - case CHAP_MD5: - bit |= CHAP_MD5_WITHPEER; - break; + bit = CHAP_WITHPEER; + prot = "CHAP"; + switch (prot_flavor) { + case CHAP_MD5: + bit |= CHAP_MD5_WITHPEER; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - bit |= CHAP_MS_WITHPEER; - break; - case CHAP_MICROSOFT_V2: - bit |= CHAP_MS2_WITHPEER; - break; + case CHAP_MICROSOFT: + bit |= CHAP_MS_WITHPEER; + break; + case CHAP_MICROSOFT_V2: + bit |= CHAP_MS2_WITHPEER; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - break; + default: + break; + } + break; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT case PPP_PAP: - bit = PAP_WITHPEER; - prot = "PAP"; - break; + bit = PAP_WITHPEER; + prot = "PAP"; + break; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT case PPP_EAP: - bit = EAP_WITHPEER; - prot = "EAP"; - break; + bit = EAP_WITHPEER; + prot = "EAP"; + break; #endif /* EAP_SUPPORT */ default: - ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); - bit = 0; - /* no break */ + ppp_warn("auth_withpeer_success: unknown protocol %x", protocol); + bit = 0; + /* no break */ } ppp_notice("%s authentication succeeded", prot); @@ -1187,7 +1187,7 @@ void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor) { * proceed to the network (or callback) phase. */ if ((pcb->auth_pending &= ~bit) == 0) - network_phase(pcb); + network_phase(pcb); } #endif /* PPP_AUTH_SUPPORT */ @@ -1202,42 +1202,42 @@ void np_up(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (pcb->num_np_up == 0) { - /* - * At this point we consider that the link has come up successfully. - */ - new_phase(pcb, PPP_PHASE_RUNNING); + /* + * At this point we consider that the link has come up successfully. + */ + new_phase(pcb, PPP_PHASE_RUNNING); #if PPP_IDLETIMELIMIT #if 0 /* UNUSED */ - if (idle_time_hook != 0) - tlim = (*idle_time_hook)(NULL); - else + if (idle_time_hook != 0) + tlim = (*idle_time_hook)(NULL); + else #endif /* UNUSED */ - tlim = pcb->settings.idle_time_limit; - if (tlim > 0) - TIMEOUT(check_idle, (void*)pcb, tlim); + tlim = pcb->settings.idle_time_limit; + if (tlim > 0) + TIMEOUT(check_idle, (void*)pcb, tlim); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - /* - * Set a timeout to close the connection once the maximum - * connect time has expired. - */ - if (pcb->settings.maxconnect > 0) - TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); + /* + * Set a timeout to close the connection once the maximum + * connect time has expired. + */ + if (pcb->settings.maxconnect > 0) + TIMEOUT(connect_time_expired, (void*)pcb, pcb->settings.maxconnect); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - if (maxoctets > 0) - TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); + if (maxoctets > 0) + TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); #endif #if 0 /* Unused */ - /* - * Detach now, if the updetach option was given. - */ - if (updetach && !nodetach) - detach(); + /* + * Detach now, if the updetach option was given. + */ + if (updetach && !nodetach) + detach(); #endif /* Unused */ } ++pcb->num_np_up; @@ -1250,15 +1250,15 @@ void np_down(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_up == 0) { #if PPP_IDLETIMELIMIT - UNTIMEOUT(check_idle, (void*)pcb); + UNTIMEOUT(check_idle, (void*)pcb); #endif /* PPP_IDLETIMELIMIT */ #if PPP_MAXCONNECT - UNTIMEOUT(connect_time_expired, NULL); + UNTIMEOUT(connect_time_expired, NULL); #endif /* PPP_MAXCONNECT */ #ifdef MAXOCTETS - UNTIMEOUT(check_maxoctets, NULL); + UNTIMEOUT(check_maxoctets, NULL); #endif - new_phase(pcb, PPP_PHASE_NETWORK); + new_phase(pcb, PPP_PHASE_NETWORK); } } @@ -1268,8 +1268,8 @@ void np_down(ppp_pcb *pcb, int proto) { void np_finished(ppp_pcb *pcb, int proto) { LWIP_UNUSED_ARG(proto); if (--pcb->num_np_open <= 0) { - /* no further use for the link: shut up shop. */ - lcp_close(pcb, "No network protocols running"); + /* no further use for the link: shut up shop. */ + lcp_close(pcb, "No network protocols running"); } } @@ -1285,26 +1285,26 @@ check_maxoctets(arg) link_stats_valid=0; switch(maxoctets_dir) { - case PPP_OCTETS_DIRECTION_IN: - used = link_stats.bytes_in; - break; - case PPP_OCTETS_DIRECTION_OUT: - used = link_stats.bytes_out; - break; - case PPP_OCTETS_DIRECTION_MAXOVERAL: - case PPP_OCTETS_DIRECTION_MAXSESSION: - used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; - break; - default: - used = link_stats.bytes_in+link_stats.bytes_out; - break; + case PPP_OCTETS_DIRECTION_IN: + used = link_stats.bytes_in; + break; + case PPP_OCTETS_DIRECTION_OUT: + used = link_stats.bytes_out; + break; + case PPP_OCTETS_DIRECTION_MAXOVERAL: + case PPP_OCTETS_DIRECTION_MAXSESSION: + used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out; + break; + default: + used = link_stats.bytes_in+link_stats.bytes_out; + break; } if (used > maxoctets) { - ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); - status = EXIT_TRAFFIC_LIMIT; - lcp_close(pcb, "Traffic limit"); + ppp_notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); + status = EXIT_TRAFFIC_LIMIT; + lcp_close(pcb, "Traffic limit"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); @@ -1325,27 +1325,27 @@ static void check_idle(void *arg) { int tlim; if (!get_idle_time(pcb, &idle)) - return; + return; #if 0 /* UNUSED */ if (idle_time_hook != 0) { - tlim = idle_time_hook(&idle); + tlim = idle_time_hook(&idle); } else { #endif /* UNUSED */ - itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); - tlim = pcb->settings.idle_time_limit - itime; + itime = LWIP_MIN(idle.xmit_idle, idle.recv_idle); + tlim = pcb->settings.idle_time_limit - itime; #if 0 /* UNUSED */ } #endif /* UNUSED */ if (tlim <= 0) { - /* link is idle: shut it down. */ - ppp_notice("Terminating connection due to lack of activity."); - pcb->err_code = PPPERR_IDLETIMEOUT; - lcp_close(pcb, "Link inactive"); + /* link is idle: shut it down. */ + ppp_notice("Terminating connection due to lack of activity."); + pcb->err_code = PPPERR_IDLETIMEOUT; + lcp_close(pcb, "Link inactive"); #if 0 /* UNUSED */ - need_holdoff = 0; + need_holdoff = 0; #endif /* UNUSED */ } else { - TIMEOUT(check_idle, (void*)pcb, tlim); + TIMEOUT(check_idle, (void*)pcb, tlim); } } #endif /* PPP_IDLETIMELIMIT */ @@ -1358,7 +1358,7 @@ static void connect_time_expired(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; ppp_info("Connect time expired"); pcb->err_code = PPPERR_CONNECTTIME; - lcp_close(pcb, "Connect time expired"); /* Close connection */ + lcp_close(pcb, "Connect time expired"); /* Close connection */ } #endif /* PPP_MAXCONNECT */ @@ -1375,62 +1375,62 @@ auth_check_options() /* Default our_name to hostname, and user to our_name */ if (our_name[0] == 0 || usehostname) - strlcpy(our_name, hostname, sizeof(our_name)); + strlcpy(our_name, hostname, sizeof(our_name)); /* If a blank username was explicitly given as an option, trust the user and don't use our_name */ if (ppp_settings.user[0] == 0 && !explicit_user) - strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); + strlcpy(ppp_settings.user, our_name, sizeof(ppp_settings.user)); /* * If we have a default route, require the peer to authenticate * unless the noauth option was given or the real user is root. */ if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { - auth_required = 1; - default_auth = 1; + auth_required = 1; + default_auth = 1; } #if CHAP_SUPPORT /* If we selected any CHAP flavors, we should probably negotiate it. :-) */ if (wo->chap_mdtype) - wo->neg_chap = 1; + wo->neg_chap = 1; #endif /* CHAP_SUPPORT */ /* If authentication is required, ask peer for CHAP, PAP, or EAP. */ if (auth_required) { - allow_any_ip = 0; - if (1 + allow_any_ip = 0; + if (1 #if CHAP_SUPPORT - && !wo->neg_chap + && !wo->neg_chap #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - && !wo->neg_upap + && !wo->neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - && !wo->neg_eap + && !wo->neg_eap #endif /* EAP_SUPPORT */ - ) { + ) { #if CHAP_SUPPORT - wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; - wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; + wo->neg_chap = CHAP_MDTYPE_SUPPORTED != MDTYPE_NONE; + wo->chap_mdtype = CHAP_MDTYPE_SUPPORTED; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 1; + wo->neg_upap = 1; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 1; + wo->neg_eap = 1; #endif /* EAP_SUPPORT */ - } + } } else { #if CHAP_SUPPORT - wo->neg_chap = 0; - wo->chap_mdtype = MDTYPE_NONE; + wo->neg_chap = 0; + wo->chap_mdtype = MDTYPE_NONE; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - wo->neg_upap = 0; + wo->neg_upap = 0; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - wo->neg_eap = 0; + wo->neg_eap = 0; #endif /* EAP_SUPPORT */ } @@ -1447,56 +1447,56 @@ auth_check_options() #endif /* PAP_SUPPORT */ if (!can_auth && (0 #if CHAP_SUPPORT - || wo->neg_chap + || wo->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || wo->neg_eap + || wo->neg_eap #endif /* EAP_SUPPORT */ - )) { + )) { #if CHAP_SUPPORT - can_auth = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + can_auth = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); #else - can_auth = 0; + can_auth = 0; #endif } if (!can_auth #if EAP_SUPPORT - && wo->neg_eap + && wo->neg_eap #endif /* EAP_SUPPORT */ - ) { - can_auth = have_srp_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); + ) { + can_auth = have_srp_secret((explicit_remote? remote_name: NULL), + our_name, 1, &lacks_ip); } if (auth_required && !can_auth && noauth_addrs == NULL) { - if (default_auth) { - option_error( + if (default_auth) { + option_error( "By default the remote system is required to authenticate itself"); - option_error( + option_error( "(because this system has a default route to the internet)"); - } else if (explicit_remote) - option_error( + } else if (explicit_remote) + option_error( "The remote system (%s) is required to authenticate itself", - remote_name); - else - option_error( + remote_name); + else + option_error( "The remote system is required to authenticate itself"); - option_error( + option_error( "but I couldn't find any suitable secret (password) for it to use to do so."); - if (lacks_ip) - option_error( + if (lacks_ip) + option_error( "(None of the available passwords would let it use an IP address.)"); - exit(1); + exit(1); } /* * Early check for remote number authorization. */ if (!auth_number()) { - ppp_warn("calling number %q is not authorized", remote_number); - exit(EXIT_CNID_AUTH_FAILED); + ppp_warn("calling number %q is not authorized", remote_number); + exit(EXIT_CNID_AUTH_FAILED); } } #endif /* PPP_OPTIONS */ @@ -1518,30 +1518,30 @@ auth_reset(unit) hadchap = -1; ao->neg_upap = !refuse_pap && (passwd[0] != 0 || get_pap_passwd(NULL)); ao->neg_chap = (!refuse_chap || !refuse_mschap || !refuse_mschap_v2) - && (passwd[0] != 0 || - (hadchap = have_chap_secret(user, (explicit_remote? remote_name: - NULL), 0, NULL))); + && (passwd[0] != 0 || + (hadchap = have_chap_secret(user, (explicit_remote? remote_name: + NULL), 0, NULL))); ao->neg_eap = !refuse_eap && ( - passwd[0] != 0 || - (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, - (explicit_remote? remote_name: NULL), 0, NULL))) || - have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); + passwd[0] != 0 || + (hadchap == 1 || (hadchap == -1 && have_chap_secret(user, + (explicit_remote? remote_name: NULL), 0, NULL))) || + have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)); hadchap = -1; if (go->neg_upap && !uselogin && !have_pap_secret(NULL)) - go->neg_upap = 0; + go->neg_upap = 0; if (go->neg_chap) { - if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, NULL))) - go->neg_chap = 0; + if (!(hadchap = have_chap_secret((explicit_remote? remote_name: NULL), + our_name, 1, NULL))) + go->neg_chap = 0; } if (go->neg_eap && - (hadchap == 0 || (hadchap == -1 && - !have_chap_secret((explicit_remote? remote_name: NULL), our_name, - 1, NULL))) && - !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, - NULL)) - go->neg_eap = 0; + (hadchap == 0 || (hadchap == -1 && + !have_chap_secret((explicit_remote? remote_name: NULL), our_name, + 1, NULL))) && + !have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1, + NULL)) + go->neg_eap = 0; } /* @@ -1550,8 +1550,8 @@ auth_reset(unit) * and login the user if OK. * * returns: - * UPAP_AUTHNAK: Authentication failed. - * UPAP_AUTHACK: Authentication succeeded. + * UPAP_AUTHNAK: Authentication failed. + * UPAP_AUTHACK: Authentication succeeded. * In either case, msg points to an appropriate message. */ int @@ -1585,19 +1585,19 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) * Check if a plugin wants to handle this. */ if (pap_auth_hook) { - ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); - if (ret >= 0) { - /* note: set_allowed_addrs() saves opts (but not addrs): - don't free it! */ - if (ret) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); - BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); - return ret? UPAP_AUTHACK: UPAP_AUTHNAK; - } + ret = (*pap_auth_hook)(ppp_settings.user, ppp_settings.passwd, msg, &addrs, &opts); + if (ret >= 0) { + /* note: set_allowed_addrs() saves opts (but not addrs): + don't free it! */ + if (ret) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); + BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); + return ret? UPAP_AUTHACK: UPAP_AUTHNAK; + } } /* @@ -1609,67 +1609,67 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) ret = UPAP_AUTHNAK; f = fopen(filename, "r"); if (f == NULL) { - ppp_error("Can't open PAP password file %s: %m", filename); + ppp_error("Can't open PAP password file %s: %m", filename); } else { - check_access(f, filename); - if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { - ppp_warn("no PAP secret found for %s", user); - } else { - /* - * If the secret is "@login", it means to check - * the password against the login database. - */ - int login_secret = strcmp(secret, "@login") == 0; - ret = UPAP_AUTHACK; - if (uselogin || login_secret) { - /* login option or secret is @login */ - if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { - ret = UPAP_AUTHNAK; - } - } else if (session_mgmt) { - if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { - ppp_warn("Peer %q failed PAP Session verification", user); - ret = UPAP_AUTHNAK; - } - } - if (secret[0] != 0 && !login_secret) { - /* password given in pap-secrets - must match */ - if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) - && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) - ret = UPAP_AUTHNAK; - } - } - fclose(f); + check_access(f, filename); + if (scan_authfile(f, ppp_settings.user, our_name, secret, &addrs, &opts, filename, 0) < 0) { + ppp_warn("no PAP secret found for %s", user); + } else { + /* + * If the secret is "@login", it means to check + * the password against the login database. + */ + int login_secret = strcmp(secret, "@login") == 0; + ret = UPAP_AUTHACK; + if (uselogin || login_secret) { + /* login option or secret is @login */ + if (session_full(ppp_settings.user, ppp_settings.passwd, devnam, msg) == 0) { + ret = UPAP_AUTHNAK; + } + } else if (session_mgmt) { + if (session_check(ppp_settings.user, NULL, devnam, NULL) == 0) { + ppp_warn("Peer %q failed PAP Session verification", user); + ret = UPAP_AUTHNAK; + } + } + if (secret[0] != 0 && !login_secret) { + /* password given in pap-secrets - must match */ + if ((cryptpap || strcmp(ppp_settings.passwd, secret) != 0) + && strcmp(crypt(ppp_settings.passwd, secret), secret) != 0) + ret = UPAP_AUTHNAK; + } + } + fclose(f); } if (ret == UPAP_AUTHNAK) { if (**msg == 0) - *msg = "Login incorrect"; - /* - * XXX can we ever get here more than once?? - * Frustrate passwd stealer programs. - * Allow 10 tries, but start backing off after 3 (stolen from login). - * On 10'th, drop the connection. - */ - if (attempts++ >= 10) { - ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); - lcp_close(pcb, "login failed"); - } - if (attempts > 3) - sleep((u_int) (attempts - 3) * 5); - if (opts != NULL) - free_wordlist(opts); + *msg = "Login incorrect"; + /* + * XXX can we ever get here more than once?? + * Frustrate passwd stealer programs. + * Allow 10 tries, but start backing off after 3 (stolen from login). + * On 10'th, drop the connection. + */ + if (attempts++ >= 10) { + ppp_warn("%d LOGIN FAILURES ON %s, %s", attempts, devnam, user); + lcp_close(pcb, "login failed"); + } + if (attempts > 3) + sleep((u_int) (attempts - 3) * 5); + if (opts != NULL) + free_wordlist(opts); } else { - attempts = 0; /* Reset count */ - if (**msg == 0) - *msg = "Login ok"; - set_allowed_addrs(unit, addrs, opts); + attempts = 0; /* Reset count */ + if (**msg == 0) + *msg = "Login ok"; + set_allowed_addrs(unit, addrs, opts); } if (addrs != NULL) - free_wordlist(addrs); + free_wordlist(addrs); BZERO(ppp_settings.passwd, sizeof(ppp_settings.passwd)); BZERO(secret, sizeof(secret)); @@ -1696,31 +1696,31 @@ null_login(unit) */ ret = -1; if (null_auth_hook) - ret = (*null_auth_hook)(&addrs, &opts); + ret = (*null_auth_hook)(&addrs, &opts); /* * Open the file of pap secrets and scan for a suitable secret. */ if (ret <= 0) { - filename = _PATH_UPAPFILE; - addrs = NULL; - f = fopen(filename, "r"); - if (f == NULL) - return 0; - check_access(f, filename); + filename = _PATH_UPAPFILE; + addrs = NULL; + f = fopen(filename, "r"); + if (f == NULL) + return 0; + check_access(f, filename); - i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); - ret = i >= 0 && secret[0] == 0; - BZERO(secret, sizeof(secret)); - fclose(f); + i = scan_authfile(f, "", our_name, secret, &addrs, &opts, filename, 0); + ret = i >= 0 && secret[0] == 0; + BZERO(secret, sizeof(secret)); + fclose(f); } if (ret) - set_allowed_addrs(unit, addrs, opts); + set_allowed_addrs(unit, addrs, opts); else if (opts != 0) - free_wordlist(opts); + free_wordlist(opts); if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret; } @@ -1744,24 +1744,24 @@ get_pap_passwd(passwd) * Check whether a plugin wants to supply this. */ if (pap_passwd_hook) { - ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); - if (ret >= 0) - return ret; + ret = (*pap_passwd_hook)(ppp_settings,user, ppp_settings.passwd); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; check_access(f, filename); ret = scan_authfile(f, user, - (remote_name[0]? remote_name: NULL), - secret, NULL, NULL, filename, 0); + (remote_name[0]? remote_name: NULL), + secret, NULL, NULL, filename, 0); fclose(f); if (ret < 0) - return 0; + return 0; if (passwd != NULL) - strlcpy(passwd, secret, MAXSECRETLEN); + strlcpy(passwd, secret, MAXSECRETLEN); BZERO(secret, sizeof(secret)); return 1; } @@ -1781,26 +1781,26 @@ have_pap_secret(lacks_ipp) /* let the plugin decide, if there is one */ if (pap_check_hook) { - ret = (*pap_check_hook)(); - if (ret >= 0) - return ret; + ret = (*pap_check_hook)(); + if (ret >= 0) + return ret; } filename = _PATH_UPAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; ret = scan_authfile(f, (explicit_remote? remote_name: NULL), our_name, - NULL, &addrs, NULL, filename, 0); + NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1824,31 +1824,31 @@ have_chap_secret(client, server, need_ip, lacks_ipp) struct wordlist *addrs; if (chap_check_hook) { - ret = (*chap_check_hook)(); - if (ret >= 0) { - return ret; - } + ret = (*chap_check_hook)(); + if (ret >= 0) { + return ret; + } } filename = _PATH_CHAPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1874,22 +1874,22 @@ have_srp_secret(client, server, need_ip, lacks_ipp) filename = _PATH_SRPFILE; f = fopen(filename, "r"); if (f == NULL) - return 0; + return 0; if (client != NULL && client[0] == 0) - client = NULL; + client = NULL; else if (server != NULL && server[0] == 0) - server = NULL; + server = NULL; ret = scan_authfile(f, client, server, NULL, &addrs, NULL, filename, 0); fclose(f); if (ret >= 0 && need_ip && !some_ip_ok(addrs)) { - if (lacks_ipp != 0) - *lacks_ipp = 1; - ret = -1; + if (lacks_ipp != 0) + *lacks_ipp = 1; + ret = -1; } if (addrs != 0) - free_wordlist(addrs); + free_wordlist(addrs); return ret >= 0; } @@ -1930,42 +1930,42 @@ int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secre addrs = NULL; if (!am_server && ppp_settings.passwd[0] != 0) { - strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); + strlcpy(secbuf, ppp_settings.passwd, sizeof(secbuf)); } else if (!am_server && chap_passwd_hook) { - if ( (*chap_passwd_hook)(client, secbuf) < 0) { - ppp_error("Unable to obtain CHAP password for %s on %s from plugin", - client, server); - return 0; - } + if ( (*chap_passwd_hook)(client, secbuf) < 0) { + ppp_error("Unable to obtain CHAP password for %s on %s from plugin", + client, server); + return 0; + } } else { - filename = _PATH_CHAPFILE; - addrs = NULL; - secbuf[0] = 0; - - f = fopen(filename, "r"); - if (f == NULL) { - ppp_error("Can't open chap secret file %s: %m", filename); - return 0; - } - check_access(f, filename); - - ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); - fclose(f); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != 0) - free_wordlist(opts); - if (addrs != 0) - free_wordlist(addrs); + filename = _PATH_CHAPFILE; + addrs = NULL; + secbuf[0] = 0; + + f = fopen(filename, "r"); + if (f == NULL) { + ppp_error("Can't open chap secret file %s: %m", filename); + return 0; + } + check_access(f, filename); + + ret = scan_authfile(f, client, server, secbuf, &addrs, &opts, filename, 0); + fclose(f); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != 0) + free_wordlist(opts); + if (addrs != 0) + free_wordlist(addrs); } len = strlen(secbuf); if (len > MAXSECRETLEN) { - ppp_error("Secret for %s on %s is too long", client, server); - len = MAXSECRETLEN; + ppp_error("Secret for %s on %s is too long", client, server); + len = MAXSECRETLEN; } MEMCPY(secret, secbuf, len); BZERO(secbuf, sizeof(secbuf)); @@ -1997,31 +1997,31 @@ get_srp_secret(unit, client, server, secret, am_server) struct wordlist *addrs, *opts; if (!am_server && ppp_settings.passwd[0] != '\0') { - strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); + strlcpy(secret, ppp_settings.passwd, MAXWORDLEN); } else { - filename = _PATH_SRPFILE; - addrs = NULL; - - fp = fopen(filename, "r"); - if (fp == NULL) { - ppp_error("Can't open srp secret file %s: %m", filename); - return 0; - } - check_access(fp, filename); - - secret[0] = '\0'; - ret = scan_authfile(fp, client, server, secret, &addrs, &opts, - filename, am_server); - fclose(fp); - if (ret < 0) - return 0; - - if (am_server) - set_allowed_addrs(unit, addrs, opts); - else if (opts != NULL) - free_wordlist(opts); - if (addrs != NULL) - free_wordlist(addrs); + filename = _PATH_SRPFILE; + addrs = NULL; + + fp = fopen(filename, "r"); + if (fp == NULL) { + ppp_error("Can't open srp secret file %s: %m", filename); + return 0; + } + check_access(fp, filename); + + secret[0] = '\0'; + ret = scan_authfile(fp, client, server, secret, &addrs, &opts, + filename, am_server); + fclose(fp); + if (ret < 0) + return 0; + + if (am_server) + set_allowed_addrs(unit, addrs, opts); + else if (opts != NULL) + free_wordlist(opts); + if (addrs != NULL) + free_wordlist(addrs); } return 1; @@ -2049,10 +2049,10 @@ set_allowed_addrs(unit, addrs, opts) u32_t suggested_ip = 0; if (addresses[unit] != NULL) - free(addresses[unit]); + free(addresses[unit]); addresses[unit] = NULL; if (extra_options != NULL) - free_wordlist(extra_options); + free_wordlist(extra_options); extra_options = opts; /* @@ -2060,109 +2060,109 @@ set_allowed_addrs(unit, addrs, opts) */ n = wordlist_count(addrs) + wordlist_count(noauth_addrs); if (n == 0) - return; + return; ip = (struct permitted_ip *) malloc((n + 1) * sizeof(struct permitted_ip)); if (ip == 0) - return; + return; /* temporarily append the noauth_addrs list to addrs */ for (plink = &addrs; *plink != NULL; plink = &(*plink)->next) - ; + ; *plink = noauth_addrs; n = 0; for (ap = addrs; ap != NULL; ap = ap->next) { - /* "-" means no addresses authorized, "*" means any address allowed */ - ptr_word = ap->word; - if (strcmp(ptr_word, "-") == 0) - break; - if (strcmp(ptr_word, "*") == 0) { - ip[n].permit = 1; - ip[n].base = ip[n].mask = 0; - ++n; - break; - } - - ip[n].permit = 1; - if (*ptr_word == '!') { - ip[n].permit = 0; - ++ptr_word; - } - - mask = ~ (u32_t) 0; - offset = 0; - ptr_mask = strchr (ptr_word, '/'); - if (ptr_mask != NULL) { - int bit_count; - char *endp; - - bit_count = (int) strtol (ptr_mask+1, &endp, 10); - if (bit_count <= 0 || bit_count > 32) { - ppp_warn("invalid address length %v in auth. address list", - ptr_mask+1); - continue; - } - bit_count = 32 - bit_count; /* # bits in host part */ - if (*endp == '+') { - offset = ifunit + 1; - ++endp; - } - if (*endp != 0) { - ppp_warn("invalid address length syntax: %v", ptr_mask+1); - continue; - } - *ptr_mask = '\0'; - mask <<= bit_count; - } - - hp = gethostbyname(ptr_word); - if (hp != NULL && hp->h_addrtype == AF_INET) { - a = *(u32_t *)hp->h_addr; - } else { - np = getnetbyname (ptr_word); - if (np != NULL && np->n_addrtype == AF_INET) { - a = lwip_htonl ((u32_t)np->n_net); - if (ptr_mask == NULL) { - /* calculate appropriate mask for net */ - ah = lwip_ntohl(a); - if (IN_CLASSA(ah)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(ah)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(ah)) - mask = IN_CLASSC_NET; - } - } else { - a = inet_addr (ptr_word); - } - } - - if (ptr_mask != NULL) - *ptr_mask = '/'; - - if (a == (u32_t)-1L) { - ppp_warn("unknown host %s in auth. address list", ap->word); - continue; - } - if (offset != 0) { - if (offset >= ~mask) { - ppp_warn("interface unit %d too large for subnet %v", - ifunit, ptr_word); - continue; - } - a = lwip_htonl((lwip_ntohl(a) & mask) + offset); - mask = ~(u32_t)0; - } - ip[n].mask = lwip_htonl(mask); - ip[n].base = a & ip[n].mask; - ++n; - if (~mask == 0 && suggested_ip == 0) - suggested_ip = a; + /* "-" means no addresses authorized, "*" means any address allowed */ + ptr_word = ap->word; + if (strcmp(ptr_word, "-") == 0) + break; + if (strcmp(ptr_word, "*") == 0) { + ip[n].permit = 1; + ip[n].base = ip[n].mask = 0; + ++n; + break; + } + + ip[n].permit = 1; + if (*ptr_word == '!') { + ip[n].permit = 0; + ++ptr_word; + } + + mask = ~ (u32_t) 0; + offset = 0; + ptr_mask = strchr (ptr_word, '/'); + if (ptr_mask != NULL) { + int bit_count; + char *endp; + + bit_count = (int) strtol (ptr_mask+1, &endp, 10); + if (bit_count <= 0 || bit_count > 32) { + ppp_warn("invalid address length %v in auth. address list", + ptr_mask+1); + continue; + } + bit_count = 32 - bit_count; /* # bits in host part */ + if (*endp == '+') { + offset = ifunit + 1; + ++endp; + } + if (*endp != 0) { + ppp_warn("invalid address length syntax: %v", ptr_mask+1); + continue; + } + *ptr_mask = '\0'; + mask <<= bit_count; + } + + hp = gethostbyname(ptr_word); + if (hp != NULL && hp->h_addrtype == AF_INET) { + a = *(u32_t *)hp->h_addr; + } else { + np = getnetbyname (ptr_word); + if (np != NULL && np->n_addrtype == AF_INET) { + a = lwip_htonl ((u32_t)np->n_net); + if (ptr_mask == NULL) { + /* calculate appropriate mask for net */ + ah = lwip_ntohl(a); + if (IN_CLASSA(ah)) + mask = IN_CLASSA_NET; + else if (IN_CLASSB(ah)) + mask = IN_CLASSB_NET; + else if (IN_CLASSC(ah)) + mask = IN_CLASSC_NET; + } + } else { + a = inet_addr (ptr_word); + } + } + + if (ptr_mask != NULL) + *ptr_mask = '/'; + + if (a == (u32_t)-1L) { + ppp_warn("unknown host %s in auth. address list", ap->word); + continue; + } + if (offset != 0) { + if (offset >= ~mask) { + ppp_warn("interface unit %d too large for subnet %v", + ifunit, ptr_word); + continue; + } + a = lwip_htonl((lwip_ntohl(a) & mask) + offset); + mask = ~(u32_t)0; + } + ip[n].mask = lwip_htonl(mask); + ip[n].base = a & ip[n].mask; + ++n; + if (~mask == 0 && suggested_ip == 0) + suggested_ip = a; } *plink = NULL; - ip[n].permit = 0; /* make the last entry forbid all addresses */ - ip[n].base = 0; /* to terminate the list */ + ip[n].permit = 0; /* make the last entry forbid all addresses */ + ip[n].base = 0; /* to terminate the list */ ip[n].mask = 0; addresses[unit] = ip; @@ -2173,14 +2173,14 @@ set_allowed_addrs(unit, addrs, opts) * which is a single host, then use that if we find one. */ if (suggested_ip != 0 - && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { - wo->hisaddr = suggested_ip; - /* - * Do we insist on this address? No, if there are other - * addresses authorized than the suggested one. - */ - if (n > 1) - wo->accept_remote = 1; + && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) { + wo->hisaddr = suggested_ip; + /* + * Do we insist on this address? No, if there are other + * addresses authorized than the suggested one. + */ + if (n > 1) + wo->accept_remote = 1; } } @@ -2197,21 +2197,21 @@ auth_ip_addr(unit, addr) /* don't allow loopback or multicast address */ if (bad_ip_adrs(addr)) - return 0; + return 0; if (allowed_address_hook) { - ok = allowed_address_hook(addr); - if (ok >= 0) return ok; + ok = allowed_address_hook(addr); + if (ok >= 0) return ok; } if (addresses[unit] != NULL) { - ok = ip_addr_check(addr, addresses[unit]); - if (ok >= 0) - return ok; + ok = ip_addr_check(addr, addresses[unit]); + if (ok >= 0) + return ok; } if (auth_required) - return 0; /* no addresses authorized */ + return 0; /* no addresses authorized */ return allow_any_ip || privileged || !have_route_to(addr); } @@ -2221,8 +2221,8 @@ ip_addr_check(addr, addrs) struct permitted_ip *addrs; { for (; ; ++addrs) - if ((addr & addrs->mask) == addrs->base) - return addrs->permit; + if ((addr & addrs->mask) == addrs->base) + return addrs->permit; } /* @@ -2236,7 +2236,7 @@ bad_ip_adrs(addr) { addr = lwip_ntohl(addr); return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET - || IN_MULTICAST(addr) || IN_BADCLASS(addr); + || IN_MULTICAST(addr) || IN_BADCLASS(addr); } /* @@ -2248,10 +2248,10 @@ some_ip_ok(addrs) struct wordlist *addrs; { for (; addrs != 0; addrs = addrs->next) { - if (addrs->word[0] == '-') - break; - if (addrs->word[0] != '!') - return 1; /* some IP address is allowed */ + if (addrs->word[0] == '-') + break; + if (addrs->word[0] != '!') + return 1; /* some IP address is allowed */ } return 0; } @@ -2268,17 +2268,17 @@ auth_number() /* Allow all if no authorization list. */ if (!wp) - return 1; + return 1; /* Allow if we have a match in the authorization list. */ while (wp) { - /* trailing '*' wildcard */ - l = strlen(wp->word); - if ((wp->word)[l - 1] == '*') - l--; - if (!strncasecmp(wp->word, remote_number, l)) - return 1; - wp = wp->next; + /* trailing '*' wildcard */ + l = strlen(wp->word); + if ((wp->word)[l - 1] == '*') + l--; + if (!strncasecmp(wp->word, remote_number, l)) + return 1; + wp = wp->next; } return 0; @@ -2295,10 +2295,10 @@ check_access(f, filename) struct stat sbuf; if (fstat(fileno(f), &sbuf) < 0) { - ppp_warn("cannot stat secret file %s: %m", filename); + ppp_warn("cannot stat secret file %s: %m", filename); } else if ((sbuf.st_mode & (S_IRWXG | S_IRWXO)) != 0) { - ppp_warn("Warning - secret file %s has world and/or group access", - filename); + ppp_warn("Warning - secret file %s has world and/or group access", + filename); } } @@ -2337,141 +2337,141 @@ scan_authfile(f, client, server, secret, addrs, opts, filename, flags) char *cp; if (addrs != NULL) - *addrs = NULL; + *addrs = NULL; if (opts != NULL) - *opts = NULL; + *opts = NULL; addr_list = NULL; if (!getword(f, word, &newline, filename)) - return -1; /* file is empty??? */ + return -1; /* file is empty??? */ newline = 1; best_flag = -1; for (;;) { - /* - * Skip until we find a word at the start of a line. - */ - while (!newline && getword(f, word, &newline, filename)) - ; - if (!newline) - break; /* got to end of file */ - - /* - * Got a client - check if it's a match or a wildcard. - */ - got_flag = 0; - if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { - newline = 0; - continue; - } - if (!ISWILD(word)) - got_flag = NONWILD_CLIENT; - - /* - * Now get a server and check if it matches. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - if (!ISWILD(word)) { - if (server != NULL && strcmp(word, server) != 0) - continue; - got_flag |= NONWILD_SERVER; - } - - /* - * Got some sort of a match - see if it's better than what - * we have already. - */ - if (got_flag <= best_flag) - continue; - - /* - * Get the secret. - */ - if (!getword(f, word, &newline, filename)) - break; - if (newline) - continue; - - /* - * SRP-SHA1 authenticator should never be reading secrets from - * a file. (Authenticatee may, though.) - */ - if (flags && ((cp = strchr(word, ':')) == NULL || - strchr(cp + 1, ':') == NULL)) - continue; - - if (secret != NULL) { - /* - * Special syntax: @/pathname means read secret from file. - */ - if (word[0] == '@' && word[1] == '/') { - strlcpy(atfile, word+1, sizeof(atfile)); - if ((sf = fopen(atfile, "r")) == NULL) { - ppp_warn("can't open indirect secret file %s", atfile); - continue; - } - check_access(sf, atfile); - if (!getword(sf, word, &xxx, atfile)) { - ppp_warn("no secret in indirect secret file %s", atfile); - fclose(sf); - continue; - } - fclose(sf); - } - strlcpy(lsecret, word, sizeof(lsecret)); - } - - /* - * Now read address authorization info and make a wordlist. - */ - app = &alist; - for (;;) { - if (!getword(f, word, &newline, filename) || newline) - break; - ap = (struct wordlist *) - malloc(sizeof(struct wordlist) + strlen(word) + 1); - if (ap == NULL) - novm("authorized addresses"); - ap->word = (char *) (ap + 1); - strcpy(ap->word, word); - *app = ap; - app = &ap->next; - } - *app = NULL; - - /* - * This is the best so far; remember it. - */ - best_flag = got_flag; - if (addr_list) - free_wordlist(addr_list); - addr_list = alist; - if (secret != NULL) - strlcpy(secret, lsecret, MAXWORDLEN); - - if (!newline) - break; + /* + * Skip until we find a word at the start of a line. + */ + while (!newline && getword(f, word, &newline, filename)) + ; + if (!newline) + break; /* got to end of file */ + + /* + * Got a client - check if it's a match or a wildcard. + */ + got_flag = 0; + if (client != NULL && strcmp(word, client) != 0 && !ISWILD(word)) { + newline = 0; + continue; + } + if (!ISWILD(word)) + got_flag = NONWILD_CLIENT; + + /* + * Now get a server and check if it matches. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + if (!ISWILD(word)) { + if (server != NULL && strcmp(word, server) != 0) + continue; + got_flag |= NONWILD_SERVER; + } + + /* + * Got some sort of a match - see if it's better than what + * we have already. + */ + if (got_flag <= best_flag) + continue; + + /* + * Get the secret. + */ + if (!getword(f, word, &newline, filename)) + break; + if (newline) + continue; + + /* + * SRP-SHA1 authenticator should never be reading secrets from + * a file. (Authenticatee may, though.) + */ + if (flags && ((cp = strchr(word, ':')) == NULL || + strchr(cp + 1, ':') == NULL)) + continue; + + if (secret != NULL) { + /* + * Special syntax: @/pathname means read secret from file. + */ + if (word[0] == '@' && word[1] == '/') { + strlcpy(atfile, word+1, sizeof(atfile)); + if ((sf = fopen(atfile, "r")) == NULL) { + ppp_warn("can't open indirect secret file %s", atfile); + continue; + } + check_access(sf, atfile); + if (!getword(sf, word, &xxx, atfile)) { + ppp_warn("no secret in indirect secret file %s", atfile); + fclose(sf); + continue; + } + fclose(sf); + } + strlcpy(lsecret, word, sizeof(lsecret)); + } + + /* + * Now read address authorization info and make a wordlist. + */ + app = &alist; + for (;;) { + if (!getword(f, word, &newline, filename) || newline) + break; + ap = (struct wordlist *) + malloc(sizeof(struct wordlist) + strlen(word) + 1); + if (ap == NULL) + novm("authorized addresses"); + ap->word = (char *) (ap + 1); + strcpy(ap->word, word); + *app = ap; + app = &ap->next; + } + *app = NULL; + + /* + * This is the best so far; remember it. + */ + best_flag = got_flag; + if (addr_list) + free_wordlist(addr_list); + addr_list = alist; + if (secret != NULL) + strlcpy(secret, lsecret, MAXWORDLEN); + + if (!newline) + break; } /* scan for a -- word indicating the start of options */ for (app = &addr_list; (ap = *app) != NULL; app = &ap->next) - if (strcmp(ap->word, "--") == 0) - break; + if (strcmp(ap->word, "--") == 0) + break; /* ap = start of options */ if (ap != NULL) { - ap = ap->next; /* first option */ - free(*app); /* free the "--" word */ - *app = NULL; /* terminate addr list */ + ap = ap->next; /* first option */ + free(*app); /* free the "--" word */ + *app = NULL; /* terminate addr list */ } if (opts != NULL) - *opts = ap; + *opts = ap; else if (ap != NULL) - free_wordlist(ap); + free_wordlist(ap); if (addrs != NULL) - *addrs = addr_list; + *addrs = addr_list; else if (addr_list != NULL) - free_wordlist(addr_list); + free_wordlist(addr_list); return best_flag; } @@ -2486,7 +2486,7 @@ wordlist_count(wp) int n; for (n = 0; wp != NULL; wp = wp->next) - ++n; + ++n; return n; } @@ -2500,9 +2500,9 @@ free_wordlist(wp) struct wordlist *next; while (wp != NULL) { - next = wp->next; - free(wp); - wp = next; + next = wp->next; + free(wp); + wp = next; } } #endif /* UNUSED */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ccp.c b/components/net/lwip-2.1.2/src/netif/ppp/ccp.c index 5e5b75c361..f8519ebece 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ccp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ccp.c @@ -40,8 +40,8 @@ #include "netif/ppp/ccp.h" #if MPPE_SUPPORT -#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ -#include "netif/ppp/mppe.h" /* mppe_init() */ +#include "netif/ppp/lcp.h" /* lcp_close(), lcp_fsm */ +#include "netif/ppp/mppe.h" /* mppe_init() */ #endif /* MPPE_SUPPORT */ /* @@ -51,7 +51,7 @@ * Until this is fixed we only accept sizes in the range 9 .. 15. * Thanks to James Carlson for pointing this out. */ -#define DEFLATE_MIN_WORKS 9 +#define DEFLATE_MIN_WORKS 9 /* * Command-line options. @@ -66,7 +66,7 @@ static char deflate_value[8]; * Option variables. */ #if MPPE_SUPPORT -bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ +bool refuse_mppe_stateful = 1; /* Allow stateful mode? */ #endif /* MPPE_SUPPORT */ static option_t ccp_option_list[] = { @@ -248,27 +248,27 @@ static const fsm_callbacks ccp_callbacks = { static int ccp_anycompress(ccp_options *opt) { return (0 #if DEFLATE_SUPPORT - || (opt)->deflate + || (opt)->deflate #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - || (opt)->bsd_compress + || (opt)->bsd_compress #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - || (opt)->predictor_1 || (opt)->predictor_2 + || (opt)->predictor_1 || (opt)->predictor_2 #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - || (opt)->mppe + || (opt)->mppe #endif /* MPPE_SUPPORT */ - ); + ); } /* * Local state (mainly for handling reset-reqs and reset-acks). */ -#define RACK_PENDING 1 /* waiting for reset-ack */ -#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ +#define RACK_PENDING 1 /* waiting for reset-ack */ +#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ -#define RACKTIMEOUT 1 /* second */ +#define RACKTIMEOUT 1 /* second */ #if PPP_OPTIONS /* @@ -284,31 +284,31 @@ setbsdcomp(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for bsdcomp option", *argv); - return 0; + option_error("invalid parameter '%s' for bsdcomp option", *argv); + return 0; } if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS)) - || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { - option_error("bsdcomp option values must be 0 or %d .. %d", - BSD_MIN_BITS, BSD_MAX_BITS); - return 0; + || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { + option_error("bsdcomp option values must be 0 or %d .. %d", + BSD_MIN_BITS, BSD_MAX_BITS); + return 0; } if (rbits > 0) { - ccp_wantoptions[0].bsd_compress = 1; - ccp_wantoptions[0].bsd_bits = rbits; + ccp_wantoptions[0].bsd_compress = 1; + ccp_wantoptions[0].bsd_bits = rbits; } else - ccp_wantoptions[0].bsd_compress = 0; + ccp_wantoptions[0].bsd_compress = 0; if (abits > 0) { - ccp_allowoptions[0].bsd_compress = 1; - ccp_allowoptions[0].bsd_bits = abits; + ccp_allowoptions[0].bsd_compress = 1; + ccp_allowoptions[0].bsd_bits = abits; } else - ccp_allowoptions[0].bsd_compress = 0; + ccp_allowoptions[0].bsd_compress = 0; ppp_slprintf(bsd_value, sizeof(bsd_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -323,40 +323,40 @@ setdeflate(argv) str = *argv; abits = rbits = strtol(str, &endp, 0); if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); + str = endp + 1; + abits = strtol(str, &endp, 0); } if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for deflate option", *argv); - return 0; + option_error("invalid parameter '%s' for deflate option", *argv); + return 0; } if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE)) - || (abits != 0 && (abits < DEFLATE_MIN_SIZE - || abits > DEFLATE_MAX_SIZE))) { - option_error("deflate option values must be 0 or %d .. %d", - DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); - return 0; + || (abits != 0 && (abits < DEFLATE_MIN_SIZE + || abits > DEFLATE_MAX_SIZE))) { + option_error("deflate option values must be 0 or %d .. %d", + DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); + return 0; } if (rbits == DEFLATE_MIN_SIZE || abits == DEFLATE_MIN_SIZE) { - if (rbits == DEFLATE_MIN_SIZE) - rbits = DEFLATE_MIN_WORKS; - if (abits == DEFLATE_MIN_SIZE) - abits = DEFLATE_MIN_WORKS; - warn("deflate option value of %d changed to %d to avoid zlib bug", - DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); + if (rbits == DEFLATE_MIN_SIZE) + rbits = DEFLATE_MIN_WORKS; + if (abits == DEFLATE_MIN_SIZE) + abits = DEFLATE_MIN_WORKS; + warn("deflate option value of %d changed to %d to avoid zlib bug", + DEFLATE_MIN_SIZE, DEFLATE_MIN_WORKS); } if (rbits > 0) { - ccp_wantoptions[0].deflate = 1; - ccp_wantoptions[0].deflate_size = rbits; + ccp_wantoptions[0].deflate = 1; + ccp_wantoptions[0].deflate_size = rbits; } else - ccp_wantoptions[0].deflate = 0; + ccp_wantoptions[0].deflate = 0; if (abits > 0) { - ccp_allowoptions[0].deflate = 1; - ccp_allowoptions[0].deflate_size = abits; + ccp_allowoptions[0].deflate = 1; + ccp_allowoptions[0].deflate_size = abits; } else - ccp_allowoptions[0].deflate = 0; + ccp_allowoptions[0].deflate = 0; ppp_slprintf(deflate_value, sizeof(deflate_value), - rbits == abits? "%d": "%d,%d", rbits, abits); + rbits == abits? "%d": "%d,%d", rbits, abits); return 1; } @@ -411,7 +411,7 @@ static void ccp_open(ppp_pcb *pcb) { ccp_options *go = &pcb->ccp_gotoptions; if (f->state != PPP_FSM_OPENED) - ccp_set(pcb, 1, 0, 0, 0); + ccp_set(pcb, 1, 0, 0, 0); /* * Find out which compressors the kernel supports before @@ -419,7 +419,7 @@ static void ccp_open(ppp_pcb *pcb) { */ ccp_resetci(f); if (!ccp_anycompress(go)) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -463,12 +463,12 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { oldstate = f->state; fsm_input(f, p, len); if (oldstate == PPP_FSM_OPENED && p[0] == TERMREQ && f->state != PPP_FSM_OPENED) { - ppp_notice("Compression disabled by peer."); + ppp_notice("Compression disabled by peer."); #if MPPE_SUPPORT - if (go->mppe) { - ppp_error("MPPE disabled, closing LCP"); - lcp_close(pcb, "MPPE disabled by peer"); - } + if (go->mppe) { + ppp_error("MPPE disabled, closing LCP"); + lcp_close(pcb, "MPPE disabled by peer"); + } #endif /* MPPE_SUPPORT */ } @@ -477,8 +477,8 @@ static void ccp_input(ppp_pcb *pcb, u_char *p, int len) { * close CCP. */ if (oldstate == PPP_FSM_REQSENT && p[0] == TERMACK - && !ccp_anycompress(go)) - ccp_close(pcb, "No compression negotiated"); + && !ccp_anycompress(go)) + ccp_close(pcb, "No compression negotiated"); } /* @@ -491,24 +491,24 @@ static int ccp_extcode(fsm *f, int code, int id, u_char *p, int len) { switch (code) { case CCP_RESETREQ: - if (f->state != PPP_FSM_OPENED) - break; - ccp_reset_comp(pcb); - /* send a reset-ack, which the transmitter will see and - reset its compression state. */ - fsm_sdata(f, CCP_RESETACK, id, NULL, 0); - break; + if (f->state != PPP_FSM_OPENED) + break; + ccp_reset_comp(pcb); + /* send a reset-ack, which the transmitter will see and + reset its compression state. */ + fsm_sdata(f, CCP_RESETACK, id, NULL, 0); + break; case CCP_RESETACK: - if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { - pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); - UNTIMEOUT(ccp_rack_timeout, f); - ccp_reset_decomp(pcb); - } - break; + if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { + pcb->ccp_localstate &= ~(RACK_PENDING | RREQ_REPEAT); + UNTIMEOUT(ccp_rack_timeout, f); + ccp_reset_decomp(pcb); + } + break; default: - return 0; + return 0; } return 1; @@ -528,8 +528,8 @@ static void ccp_protrej(ppp_pcb *pcb) { #if MPPE_SUPPORT if (go->mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ @@ -554,9 +554,9 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (pcb->settings.require_mppe) { - wo->mppe = ao->mppe = - (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) - | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); + wo->mppe = ao->mppe = + (pcb->settings.refuse_mppe_40 ? 0 : MPPE_OPT_40) + | (pcb->settings.refuse_mppe_128 ? 0 : MPPE_OPT_128); } #endif /* MPPE_SUPPORT */ @@ -565,78 +565,78 @@ static void ccp_resetci(fsm *f) { #if MPPE_SUPPORT if (go->mppe) { - int auth_mschap_bits = pcb->auth_done; - int numbits; - - /* - * Start with a basic sanity check: mschap[v2] auth must be in - * exactly one direction. RFC 3079 says that the keys are - * 'derived from the credentials of the peer that initiated the call', - * however the PPP protocol doesn't have such a concept, and pppd - * cannot get this info externally. Instead we do the best we can. - * NB: If MPPE is required, all other compression opts are invalid. - * So, we return right away if we can't do it. - */ - - /* Leave only the mschap auth bits set */ - auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | - CHAP_MS2_WITHPEER | CHAP_MS2_PEER); - /* Count the mschap auths */ - auth_mschap_bits >>= CHAP_MS_SHIFT; - numbits = 0; - do { - numbits += auth_mschap_bits & 1; - auth_mschap_bits >>= 1; - } while (auth_mschap_bits); - if (numbits > 1) { - ppp_error("MPPE required, but auth done in both directions."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - if (!numbits) { - ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* A plugin (eg radius) may not have obtained key material. */ - if (!pcb->mppe_keys_set) { - ppp_error("MPPE required, but keys are not available. " - "Possible plugin problem?"); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* LM auth not supported for MPPE */ - if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { - /* This might be noise */ - if (go->mppe & MPPE_OPT_40) { - ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); - go->mppe &= ~MPPE_OPT_40; - wo->mppe &= ~MPPE_OPT_40; - } - } - - /* Last check: can we actually negotiate something? */ - if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { - /* Could be misconfig, could be 40-bit disabled above. */ - ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); - lcp_close(pcb, "MPPE required but not available"); - return; - } - - /* sync options */ - ao->mppe = go->mppe; - /* MPPE is not compatible with other compression types */ + int auth_mschap_bits = pcb->auth_done; + int numbits; + + /* + * Start with a basic sanity check: mschap[v2] auth must be in + * exactly one direction. RFC 3079 says that the keys are + * 'derived from the credentials of the peer that initiated the call', + * however the PPP protocol doesn't have such a concept, and pppd + * cannot get this info externally. Instead we do the best we can. + * NB: If MPPE is required, all other compression opts are invalid. + * So, we return right away if we can't do it. + */ + + /* Leave only the mschap auth bits set */ + auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER | + CHAP_MS2_WITHPEER | CHAP_MS2_PEER); + /* Count the mschap auths */ + auth_mschap_bits >>= CHAP_MS_SHIFT; + numbits = 0; + do { + numbits += auth_mschap_bits & 1; + auth_mschap_bits >>= 1; + } while (auth_mschap_bits); + if (numbits > 1) { + ppp_error("MPPE required, but auth done in both directions."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + if (!numbits) { + ppp_error("MPPE required, but MS-CHAP[v2] auth not performed."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* A plugin (eg radius) may not have obtained key material. */ + if (!pcb->mppe_keys_set) { + ppp_error("MPPE required, but keys are not available. " + "Possible plugin problem?"); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* LM auth not supported for MPPE */ + if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { + /* This might be noise */ + if (go->mppe & MPPE_OPT_40) { + ppp_notice("Disabling 40-bit MPPE; MS-CHAP LM not supported"); + go->mppe &= ~MPPE_OPT_40; + wo->mppe &= ~MPPE_OPT_40; + } + } + + /* Last check: can we actually negotiate something? */ + if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { + /* Could be misconfig, could be 40-bit disabled above. */ + ppp_error("MPPE required, but both 40-bit and 128-bit disabled."); + lcp_close(pcb, "MPPE required but not available"); + return; + } + + /* sync options */ + ao->mppe = go->mppe; + /* MPPE is not compatible with other compression types */ #if BSDCOMPRESS_SUPPORT - ao->bsd_compress = go->bsd_compress = 0; + ao->bsd_compress = go->bsd_compress = 0; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - ao->predictor_1 = go->predictor_1 = 0; - ao->predictor_2 = go->predictor_2 = 0; + ao->predictor_1 = go->predictor_1 = 0; + ao->predictor_2 = go->predictor_2 = 0; #endif /* PREDICTOR_SUPPORT */ #if DEFLATE_SUPPORT - ao->deflate = go->deflate = 0; + ao->deflate = go->deflate = 0; #endif /* DEFLATE_SUPPORT */ } #endif /* MPPE_SUPPORT */ @@ -650,23 +650,23 @@ static void ccp_resetci(fsm *f) { * if BSDCOMPRESS_SUPPORT is set, it is. */ if (go->bsd_compress) { - opt_buf[0] = CI_BSD_COMPRESS; - opt_buf[1] = CILEN_BSD_COMPRESS; - for (;;) { - if (go->bsd_bits < BSD_MIN_BITS) { - go->bsd_compress = 0; - break; - } - opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->bsd_compress = 0; - break; - } - go->bsd_bits--; - } + opt_buf[0] = CI_BSD_COMPRESS; + opt_buf[1] = CILEN_BSD_COMPRESS; + for (;;) { + if (go->bsd_bits < BSD_MIN_BITS) { + go->bsd_compress = 0; + break; + } + opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + res = ccp_test(pcb, opt_buf, CILEN_BSD_COMPRESS, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->bsd_compress = 0; + break; + } + go->bsd_bits--; + } } #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT @@ -674,48 +674,48 @@ static void ccp_resetci(fsm *f) { * if DEFLATE_SUPPORT is set, it is. */ if (go->deflate) { - if (go->deflate_correct) { - opt_buf[0] = CI_DEFLATE; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_correct = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_correct = 0; - break; - } - go->deflate_size--; - } - } - if (go->deflate_draft) { - opt_buf[0] = CI_DEFLATE_DRAFT; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - if (go->deflate_size < DEFLATE_MIN_WORKS) { - go->deflate_draft = 0; - break; - } - opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); - res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); - if (res > 0) { - break; - } else if (res < 0) { - go->deflate_draft = 0; - break; - } - go->deflate_size--; - } - } - if (!go->deflate_correct && !go->deflate_draft) - go->deflate = 0; + if (go->deflate_correct) { + opt_buf[0] = CI_DEFLATE; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_correct = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_correct = 0; + break; + } + go->deflate_size--; + } + } + if (go->deflate_draft) { + opt_buf[0] = CI_DEFLATE_DRAFT; + opt_buf[1] = CILEN_DEFLATE; + opt_buf[3] = DEFLATE_CHK_SEQUENCE; + for (;;) { + if (go->deflate_size < DEFLATE_MIN_WORKS) { + go->deflate_draft = 0; + break; + } + opt_buf[2] = DEFLATE_MAKE_OPT(go->deflate_size); + res = ccp_test(pcb, opt_buf, CILEN_DEFLATE, 0); + if (res > 0) { + break; + } else if (res < 0) { + go->deflate_draft = 0; + break; + } + go->deflate_size--; + } + } + if (!go->deflate_correct && !go->deflate_draft) + go->deflate = 0; } #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT @@ -723,16 +723,16 @@ static void ccp_resetci(fsm *f) { * if PREDICTOR_SUPPORT is set, it is. */ if (go->predictor_1) { - opt_buf[0] = CI_PREDICTOR_1; - opt_buf[1] = CILEN_PREDICTOR_1; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) - go->predictor_1 = 0; + opt_buf[0] = CI_PREDICTOR_1; + opt_buf[1] = CILEN_PREDICTOR_1; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) + go->predictor_1 = 0; } if (go->predictor_2) { - opt_buf[0] = CI_PREDICTOR_2; - opt_buf[1] = CILEN_PREDICTOR_2; - if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) - go->predictor_2 = 0; + opt_buf[0] = CI_PREDICTOR_2; + opt_buf[1] = CILEN_PREDICTOR_2; + if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) + go->predictor_2 = 0; } #endif /* PREDICTOR_SUPPORT */ } @@ -746,20 +746,20 @@ static int ccp_cilen(fsm *f) { return 0 #if BSDCOMPRESS_SUPPORT - + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) + + (go->bsd_compress? CILEN_BSD_COMPRESS: 0) #endif /* BSDCOMPRESS_SUPPORT */ #if DEFLATE_SUPPORT - + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) - + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_correct? CILEN_DEFLATE: 0) + + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) #endif /* DEFLATE_SUPPORT */ #if PREDICTOR_SUPPORT - + (go->predictor_1? CILEN_PREDICTOR_1: 0) - + (go->predictor_2? CILEN_PREDICTOR_2: 0) + + (go->predictor_1? CILEN_PREDICTOR_1: 0) + + (go->predictor_2? CILEN_PREDICTOR_2: 0) #endif /* PREDICTOR_SUPPORT */ #if MPPE_SUPPORT - + (go->mppe? CILEN_MPPE: 0) + + (go->mppe? CILEN_MPPE: 0) #endif /* MPPE_SUPPORT */ - ; + ; } /* @@ -776,50 +776,50 @@ static void ccp_addci(fsm *f, u_char *p, int *lenp) { */ #if MPPE_SUPPORT if (go->mppe) { - p[0] = CI_MPPE; - p[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &p[2]); - mppe_init(pcb, &pcb->mppe_decomp, go->mppe); - p += CILEN_MPPE; + p[0] = CI_MPPE; + p[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &p[2]); + mppe_init(pcb, &pcb->mppe_decomp, go->mppe); + p += CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (go->deflate_correct) { - p[0] = CI_DEFLATE; - p[1] = CILEN_DEFLATE; - p[2] = DEFLATE_MAKE_OPT(go->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } - if (go->deflate_draft) { - p[0] = CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; - p[2] = p[2 - CILEN_DEFLATE]; - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } + if (go->deflate_correct) { + p[0] = CI_DEFLATE; + p[1] = CILEN_DEFLATE; + p[2] = DEFLATE_MAKE_OPT(go->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } + if (go->deflate_draft) { + p[0] = CI_DEFLATE_DRAFT; + p[1] = CILEN_DEFLATE; + p[2] = p[2 - CILEN_DEFLATE]; + p[3] = DEFLATE_CHK_SEQUENCE; + p += CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - p[0] = CI_BSD_COMPRESS; - p[1] = CILEN_BSD_COMPRESS; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - p += CILEN_BSD_COMPRESS; + p[0] = CI_BSD_COMPRESS; + p[1] = CILEN_BSD_COMPRESS; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); + p += CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT /* XXX Should Predictor 2 be preferable to Predictor 1? */ if (go->predictor_1) { - p[0] = CI_PREDICTOR_1; - p[1] = CILEN_PREDICTOR_1; - p += CILEN_PREDICTOR_1; + p[0] = CI_PREDICTOR_1; + p[1] = CILEN_PREDICTOR_1; + p += CILEN_PREDICTOR_1; } if (go->predictor_2) { - p[0] = CI_PREDICTOR_2; - p[1] = CILEN_PREDICTOR_2; - p += CILEN_PREDICTOR_2; + p[0] = CI_PREDICTOR_2; + p[1] = CILEN_PREDICTOR_2; + p += CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ @@ -841,83 +841,83 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { #if MPPE_SUPPORT if (go->mppe) { - u_char opt_buf[CILEN_MPPE]; - - opt_buf[0] = CI_MPPE; - opt_buf[1] = CILEN_MPPE; - MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); - if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) - return 0; - p += CILEN_MPPE; - len -= CILEN_MPPE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; + u_char opt_buf[CILEN_MPPE]; + + opt_buf[0] = CI_MPPE; + opt_buf[1] = CILEN_MPPE; + MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]); + if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) + return 0; + p += CILEN_MPPE; + len -= CILEN_MPPE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate) { - if (len < CILEN_DEFLATE - || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; - if (go->deflate_correct && go->deflate_draft) { - if (len < CILEN_DEFLATE - || p[0] != CI_DEFLATE_DRAFT - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + if (len < CILEN_DEFLATE + || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + /* XXX Cope with first/fast ack */ + if (len == 0) + return 1; + if (go->deflate_correct && go->deflate_draft) { + if (len < CILEN_DEFLATE + || p[0] != CI_DEFLATE_DRAFT + || p[1] != CILEN_DEFLATE + || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress) { - if (len < CILEN_BSD_COMPRESS - || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS - || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_BSD_COMPRESS + || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS + || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1) { - if (len < CILEN_PREDICTOR_1 - || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) - return 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_1 + || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) + return 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } if (go->predictor_2) { - if (len < CILEN_PREDICTOR_2 - || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) - return 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; + if (len < CILEN_PREDICTOR_2 + || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) + return 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; + /* XXX Cope with first/fast ack */ + if (p == p0 && len == 0) + return 1; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; return 1; } @@ -928,8 +928,8 @@ static int ccp_ackci(fsm *f, u_char *p, int len) { static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options no; /* options we've seen already */ - ccp_options try_; /* options to ask for next time */ + ccp_options no; /* options we've seen already */ + ccp_options try_; /* options to ask for next time */ LWIP_UNUSED_ARG(treat_as_reject); #if !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT LWIP_UNUSED_ARG(p); @@ -941,66 +941,66 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - no.mppe = 1; - /* - * Peer wants us to use a different strength or other setting. - * Fail if we aren't willing to use his suggestion. - */ - MPPE_CI_TO_OPTS(&p[2], try_.mppe); - if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - try_.mppe = 0; - } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { - /* Peer must have set options we didn't request (suggest) */ - try_.mppe = 0; - } - - if (!try_.mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - } + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + no.mppe = 1; + /* + * Peer wants us to use a different strength or other setting. + * Fail if we aren't willing to use his suggestion. + */ + MPPE_CI_TO_OPTS(&p[2], try_.mppe); + if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + try_.mppe = 0; + } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { + /* Peer must have set options we didn't request (suggest) */ + try_.mppe = 0; + } + + if (!try_.mppe) { + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + } } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { - no.deflate = 1; - /* - * Peer wants us to use a different code size or something. - * Stop asking for Deflate if we don't understand his suggestion. - */ - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS - || p[3] != DEFLATE_CHK_SEQUENCE) - try_.deflate = 0; - else if (DEFLATE_SIZE(p[2]) < go->deflate_size) - try_.deflate_size = DEFLATE_SIZE(p[2]); - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - if (go->deflate_correct && go->deflate_draft - && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT - && p[1] == CILEN_DEFLATE) { - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } + && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) + && p[1] == CILEN_DEFLATE) { + no.deflate = 1; + /* + * Peer wants us to use a different code size or something. + * Stop asking for Deflate if we don't understand his suggestion. + */ + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_WORKS + || p[3] != DEFLATE_CHK_SEQUENCE) + try_.deflate = 0; + else if (DEFLATE_SIZE(p[2]) < go->deflate_size) + try_.deflate_size = DEFLATE_SIZE(p[2]); + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + if (go->deflate_correct && go->deflate_draft + && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT + && p[1] == CILEN_DEFLATE) { + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; + } } #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - no.bsd_compress = 1; - /* - * Peer wants us to use a different number of bits - * or a different version. - */ - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) - try_.bsd_compress = 0; - else if (BSD_NBITS(p[2]) < go->bsd_bits) - try_.bsd_bits = BSD_NBITS(p[2]); - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + no.bsd_compress = 1; + /* + * Peer wants us to use a different number of bits + * or a different version. + */ + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) + try_.bsd_compress = 0; + else if (BSD_NBITS(p[2]) < go->bsd_bits) + try_.bsd_bits = BSD_NBITS(p[2]); + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ @@ -1011,7 +1011,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1021,7 +1021,7 @@ static int ccp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { static int ccp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; ccp_options *go = &pcb->ccp_gotoptions; - ccp_options try_; /* options to request next time */ + ccp_options try_; /* options to request next time */ try_ = *go; @@ -1030,69 +1030,69 @@ static int ccp_rejci(fsm *f, u_char *p, int len) { * configure-requests. */ if (len == 0 && pcb->ccp_all_rejected) - return -1; + return -1; #if MPPE_SUPPORT if (go->mppe && len >= CILEN_MPPE - && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { - ppp_error("MPPE required but peer refused"); - lcp_close(pcb, "MPPE required but peer refused"); - p += CILEN_MPPE; - len -= CILEN_MPPE; + && p[0] == CI_MPPE && p[1] == CILEN_MPPE) { + ppp_error("MPPE required but peer refused"); + lcp_close(pcb, "MPPE required but peer refused"); + p += CILEN_MPPE; + len -= CILEN_MPPE; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT if (go->deflate_correct && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_correct = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_correct = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (go->deflate_draft && len >= CILEN_DEFLATE - && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try_.deflate_draft = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; + && p[0] == CI_DEFLATE_DRAFT && p[1] == CILEN_DEFLATE) { + if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) + || p[3] != DEFLATE_CHK_SEQUENCE) + return 0; /* Rej is bad */ + try_.deflate_draft = 0; + p += CILEN_DEFLATE; + len -= CILEN_DEFLATE; } if (!try_.deflate_correct && !try_.deflate_draft) - try_.deflate = 0; + try_.deflate = 0; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - try_.bsd_compress = 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; + && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { + if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) + return 0; + try_.bsd_compress = 0; + p += CILEN_BSD_COMPRESS; + len -= CILEN_BSD_COMPRESS; } #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT if (go->predictor_1 && len >= CILEN_PREDICTOR_1 - && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { - try_.predictor_1 = 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; + && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { + try_.predictor_1 = 0; + p += CILEN_PREDICTOR_1; + len -= CILEN_PREDICTOR_1; } if (go->predictor_2 && len >= CILEN_PREDICTOR_2 - && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { - try_.predictor_2 = 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; + && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { + try_.predictor_2 = 0; + p += CILEN_PREDICTOR_2; + len -= CILEN_PREDICTOR_2; } #endif /* PREDICTOR_SUPPORT */ if (len != 0) - return 0; + return 0; if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; } @@ -1114,8 +1114,8 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { u_char *p0, *retp; int len, clen, type; #if MPPE_SUPPORT - u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ - /* CI_MPPE, or due to other options? */ + u8_t rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */ + /* CI_MPPE, or due to other options? */ #endif /* MPPE_SUPPORT */ ret = CONFACK; @@ -1126,257 +1126,257 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { ho->method = (len > 0)? p[0]: 0; while (len > 0) { - newret = CONFACK; - if (len < 2 || p[1] < 2 || p[1] > len) { - /* length is bad */ - clen = len; - newret = CONFREJ; + newret = CONFACK; + if (len < 2 || p[1] < 2 || p[1] > len) { + /* length is bad */ + clen = len; + newret = CONFREJ; - } else { - type = p[0]; - clen = p[1]; + } else { + type = p[0]; + clen = p[1]; - switch (type) { + switch (type) { #if MPPE_SUPPORT - case CI_MPPE: - if (!ao->mppe || clen != CILEN_MPPE) { - newret = CONFREJ; - break; - } - MPPE_CI_TO_OPTS(&p[2], ho->mppe); - - /* Nak if anything unsupported or unknown are set. */ - if (ho->mppe & MPPE_OPT_UNSUPPORTED) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNSUPPORTED; - } - if (ho->mppe & MPPE_OPT_UNKNOWN) { - newret = CONFNAK; - ho->mppe &= ~MPPE_OPT_UNKNOWN; - } - - /* Check state opt */ - if (ho->mppe & MPPE_OPT_STATEFUL) { - /* - * We can Nak and request stateless, but it's a - * lot easier to just assume the peer will request - * it if he can do it; stateful mode is bad over - * the Internet -- which is where we expect MPPE. - */ - if (pcb->settings.refuse_mppe_stateful) { - ppp_error("Refusing MPPE stateful mode offered by peer"); - newret = CONFREJ; - break; - } - } - - /* Find out which of {S,L} are set. */ - if ((ho->mppe & MPPE_OPT_128) - && (ho->mppe & MPPE_OPT_40)) { - /* Both are set, negotiate the strongest. */ - newret = CONFNAK; - if (ao->mppe & MPPE_OPT_128) - ho->mppe &= ~MPPE_OPT_40; - else if (ao->mppe & MPPE_OPT_40) - ho->mppe &= ~MPPE_OPT_128; - else { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_128) { - if (!(ao->mppe & MPPE_OPT_128)) { - newret = CONFREJ; - break; - } - } else if (ho->mppe & MPPE_OPT_40) { - if (!(ao->mppe & MPPE_OPT_40)) { - newret = CONFREJ; - break; - } - } else { - /* Neither are set. */ - /* We cannot accept this. */ - newret = CONFNAK; - /* Give the peer our idea of what can be used, - so it can choose and confirm */ - ho->mppe = ao->mppe; - } - - /* rebuild the opts */ - MPPE_OPTS_TO_CI(ho->mppe, &p[2]); - if (newret == CONFACK) { - int mtu; - - mppe_init(pcb, &pcb->mppe_comp, ho->mppe); - /* - * We need to decrease the interface MTU by MPPE_PAD - * because MPPE frames **grow**. The kernel [must] - * allocate MPPE_PAD extra bytes in xmit buffers. - */ - mtu = netif_get_mtu(pcb); - if (mtu) - netif_set_mtu(pcb, mtu - MPPE_PAD); - else - newret = CONFREJ; - } - - /* - * We have accepted MPPE or are willing to negotiate - * MPPE parameters. A CONFREJ is due to subsequent - * (non-MPPE) processing. - */ - rej_for_ci_mppe = 0; - break; + case CI_MPPE: + if (!ao->mppe || clen != CILEN_MPPE) { + newret = CONFREJ; + break; + } + MPPE_CI_TO_OPTS(&p[2], ho->mppe); + + /* Nak if anything unsupported or unknown are set. */ + if (ho->mppe & MPPE_OPT_UNSUPPORTED) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNSUPPORTED; + } + if (ho->mppe & MPPE_OPT_UNKNOWN) { + newret = CONFNAK; + ho->mppe &= ~MPPE_OPT_UNKNOWN; + } + + /* Check state opt */ + if (ho->mppe & MPPE_OPT_STATEFUL) { + /* + * We can Nak and request stateless, but it's a + * lot easier to just assume the peer will request + * it if he can do it; stateful mode is bad over + * the Internet -- which is where we expect MPPE. + */ + if (pcb->settings.refuse_mppe_stateful) { + ppp_error("Refusing MPPE stateful mode offered by peer"); + newret = CONFREJ; + break; + } + } + + /* Find out which of {S,L} are set. */ + if ((ho->mppe & MPPE_OPT_128) + && (ho->mppe & MPPE_OPT_40)) { + /* Both are set, negotiate the strongest. */ + newret = CONFNAK; + if (ao->mppe & MPPE_OPT_128) + ho->mppe &= ~MPPE_OPT_40; + else if (ao->mppe & MPPE_OPT_40) + ho->mppe &= ~MPPE_OPT_128; + else { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_128) { + if (!(ao->mppe & MPPE_OPT_128)) { + newret = CONFREJ; + break; + } + } else if (ho->mppe & MPPE_OPT_40) { + if (!(ao->mppe & MPPE_OPT_40)) { + newret = CONFREJ; + break; + } + } else { + /* Neither are set. */ + /* We cannot accept this. */ + newret = CONFNAK; + /* Give the peer our idea of what can be used, + so it can choose and confirm */ + ho->mppe = ao->mppe; + } + + /* rebuild the opts */ + MPPE_OPTS_TO_CI(ho->mppe, &p[2]); + if (newret == CONFACK) { + int mtu; + + mppe_init(pcb, &pcb->mppe_comp, ho->mppe); + /* + * We need to decrease the interface MTU by MPPE_PAD + * because MPPE frames **grow**. The kernel [must] + * allocate MPPE_PAD extra bytes in xmit buffers. + */ + mtu = netif_get_mtu(pcb); + if (mtu) + netif_set_mtu(pcb, mtu - MPPE_PAD); + else + newret = CONFREJ; + } + + /* + * We have accepted MPPE or are willing to negotiate + * MPPE parameters. A CONFREJ is due to subsequent + * (non-MPPE) processing. + */ + rej_for_ci_mppe = 0; + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (!ao->deflate || clen != CILEN_DEFLATE - || (!ao->deflate_correct && type == CI_DEFLATE) - || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { - newret = CONFREJ; - break; - } - - ho->deflate = 1; - ho->deflate_size = nb = DEFLATE_SIZE(p[2]); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || p[3] != DEFLATE_CHK_SEQUENCE - || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do Deflate with the window - * size they want. If the window is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_DEFLATE, 1); - if (res > 0) - break; /* it's OK now */ - if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { - newret = CONFREJ; - p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); - break; - } - newret = CONFNAK; - --nb; - p[2] = DEFLATE_MAKE_OPT(nb); - } - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (!ao->deflate || clen != CILEN_DEFLATE + || (!ao->deflate_correct && type == CI_DEFLATE) + || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { + newret = CONFREJ; + break; + } + + ho->deflate = 1; + ho->deflate_size = nb = DEFLATE_SIZE(p[2]); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL + || p[3] != DEFLATE_CHK_SEQUENCE + || nb > ao->deflate_size || nb < DEFLATE_MIN_WORKS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); + p[3] = DEFLATE_CHK_SEQUENCE; + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do Deflate with the window + * size they want. If the window is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_DEFLATE, 1); + if (res > 0) + break; /* it's OK now */ + if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { + newret = CONFREJ; + p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); + break; + } + newret = CONFNAK; + --nb; + p[2] = DEFLATE_MAKE_OPT(nb); + } + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { - newret = CONFREJ; - break; - } - - ho->bsd_compress = 1; - ho->bsd_bits = nb = BSD_NBITS(p[2]); - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION - || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do BSD-Compress with the code - * size they want. If the code size is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); - if (res > 0) - break; - if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { - newret = CONFREJ; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, - ho->bsd_bits); - break; - } - newret = CONFNAK; - --nb; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); - } - } - break; + case CI_BSD_COMPRESS: + if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { + newret = CONFREJ; + break; + } + + ho->bsd_compress = 1; + ho->bsd_bits = nb = BSD_NBITS(p[2]); + if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION + || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { + newret = CONFNAK; + if (!dont_nak) { + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); + /* fall through to test this #bits below */ + } else + break; + } + + /* + * Check whether we can do BSD-Compress with the code + * size they want. If the code size is too big, reduce + * it until the kernel can cope and nak with that. + * We only check this for the first option. + */ + if (p == p0) { + for (;;) { + res = ccp_test(pcb, p, CILEN_BSD_COMPRESS, 1); + if (res > 0) + break; + if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { + newret = CONFREJ; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, + ho->bsd_bits); + break; + } + newret = CONFNAK; + --nb; + p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); + } + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { - newret = CONFREJ; - break; - } - - ho->predictor_1 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { - newret = CONFREJ; - } - break; - - case CI_PREDICTOR_2: - if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { - newret = CONFREJ; - break; - } - - ho->predictor_2 = 1; - if (p == p0 - && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { - newret = CONFREJ; - } - break; + case CI_PREDICTOR_1: + if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { + newret = CONFREJ; + break; + } + + ho->predictor_1 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_1, 1) <= 0) { + newret = CONFREJ; + } + break; + + case CI_PREDICTOR_2: + if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { + newret = CONFREJ; + break; + } + + ho->predictor_2 = 1; + if (p == p0 + && ccp_test(pcb, p, CILEN_PREDICTOR_2, 1) <= 0) { + newret = CONFREJ; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: - newret = CONFREJ; - } - } + default: + newret = CONFREJ; + } + } - if (newret == CONFNAK && dont_nak) - newret = CONFREJ; - if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { - /* we're returning this option */ - if (newret == CONFREJ && ret == CONFNAK) - retp = p0; - ret = newret; - if (p != retp) - MEMCPY(retp, p, clen); - retp += clen; - } + if (newret == CONFNAK && dont_nak) + newret = CONFREJ; + if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { + /* we're returning this option */ + if (newret == CONFREJ && ret == CONFNAK) + retp = p0; + ret = newret; + if (p != retp) + MEMCPY(retp, p, clen); + retp += clen; + } - p += clen; - len -= clen; + p += clen; + len -= clen; } if (ret != CONFACK) { - if (ret == CONFREJ && *lenp == retp - p0) - pcb->ccp_all_rejected = 1; - else - *lenp = retp - p0; + if (ret == CONFREJ && *lenp == retp - p0) + pcb->ccp_all_rejected = 1; + else + *lenp = retp - p0; } #if MPPE_SUPPORT if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { - ppp_error("MPPE required but peer negotiation failed"); - lcp_close(pcb, "MPPE required but peer negotiation failed"); + ppp_error("MPPE required but peer negotiation failed"); + lcp_close(pcb, "MPPE required but peer negotiation failed"); } #endif /* MPPE_SUPPORT */ return ret; @@ -1392,63 +1392,63 @@ static const char *method_name(ccp_options *opt, ccp_options *opt2) { #endif /* !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT */ if (!ccp_anycompress(opt)) - return "(none)"; + return "(none)"; switch (opt->method) { #if MPPE_SUPPORT case CI_MPPE: { - char *p = result; - char *q = result + sizeof(result); /* 1 past result */ - - ppp_slprintf(p, q - p, "MPPE "); - p += 5; - if (opt->mppe & MPPE_OPT_128) { - ppp_slprintf(p, q - p, "128-bit "); - p += 8; - } - if (opt->mppe & MPPE_OPT_40) { - ppp_slprintf(p, q - p, "40-bit "); - p += 7; - } - if (opt->mppe & MPPE_OPT_STATEFUL) - ppp_slprintf(p, q - p, "stateful"); - else - ppp_slprintf(p, q - p, "stateless"); - - break; + char *p = result; + char *q = result + sizeof(result); /* 1 past result */ + + ppp_slprintf(p, q - p, "MPPE "); + p += 5; + if (opt->mppe & MPPE_OPT_128) { + ppp_slprintf(p, q - p, "128-bit "); + p += 8; + } + if (opt->mppe & MPPE_OPT_40) { + ppp_slprintf(p, q - p, "40-bit "); + p += 7; + } + if (opt->mppe & MPPE_OPT_STATEFUL) + ppp_slprintf(p, q - p, "stateful"); + else + ppp_slprintf(p, q - p, "stateless"); + + break; } #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT case CI_DEFLATE: case CI_DEFLATE_DRAFT: - if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) - ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size, opt2->deflate_size); - else - ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size); - break; + if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) + ppp_slprintf(result, sizeof(result), "Deflate%s (%d/%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size, opt2->deflate_size); + else + ppp_slprintf(result, sizeof(result), "Deflate%s (%d)", + (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), + opt->deflate_size); + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT case CI_BSD_COMPRESS: - if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", - opt->bsd_bits, opt2->bsd_bits); - else - ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", - opt->bsd_bits); - break; + if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", + opt->bsd_bits, opt2->bsd_bits); + else + ppp_slprintf(result, sizeof(result), "BSD-Compress (%d)", + opt->bsd_bits); + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT case CI_PREDICTOR_1: - return "Predictor 1"; + return "Predictor 1"; case CI_PREDICTOR_2: - return "Predictor 2"; + return "Predictor 2"; #endif /* PREDICTOR_SUPPORT */ default: - ppp_slprintf(result, sizeof(result), "Method %d", opt->method); + ppp_slprintf(result, sizeof(result), "Method %d", opt->method); } return result; } @@ -1464,21 +1464,21 @@ static void ccp_up(fsm *f) { ccp_set(pcb, 1, 1, go->method, ho->method); if (ccp_anycompress(go)) { - if (ccp_anycompress(ho)) { - if (go->method == ho->method) { - ppp_notice("%s compression enabled", method_name(go, ho)); - } else { - ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); - ppp_notice("%s / %s compression enabled", - method1, method_name(ho, NULL)); - } - } else - ppp_notice("%s receive compression enabled", method_name(go, NULL)); + if (ccp_anycompress(ho)) { + if (go->method == ho->method) { + ppp_notice("%s compression enabled", method_name(go, ho)); + } else { + ppp_strlcpy(method1, method_name(go, NULL), sizeof(method1)); + ppp_notice("%s / %s compression enabled", + method1, method_name(ho, NULL)); + } + } else + ppp_notice("%s receive compression enabled", method_name(go, NULL)); } else if (ccp_anycompress(ho)) - ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); + ppp_notice("%s transmit compression enabled", method_name(ho, NULL)); #if MPPE_SUPPORT if (go->mppe) { - continue_networks(pcb); /* Bring up IP et al */ + continue_networks(pcb); /* Bring up IP et al */ } #endif /* MPPE_SUPPORT */ } @@ -1493,17 +1493,17 @@ static void ccp_down(fsm *f) { #endif /* MPPE_SUPPORT */ if (pcb->ccp_localstate & RACK_PENDING) - UNTIMEOUT(ccp_rack_timeout, f); + UNTIMEOUT(ccp_rack_timeout, f); pcb->ccp_localstate = 0; ccp_set(pcb, 1, 0, 0, 0); #if MPPE_SUPPORT if (go->mppe) { - go->mppe = 0; - if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { - /* If LCP is not already going down, make sure it does. */ - ppp_error("MPPE disabled"); - lcp_close(pcb, "MPPE disabled"); - } + go->mppe = 0; + if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { + /* If LCP is not already going down, make sure it does. */ + ppp_error("MPPE disabled"); + lcp_close(pcb, "MPPE disabled"); + } } #endif /* MPPE_SUPPORT */ } @@ -1526,17 +1526,17 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons p0 = p; if (plen < HEADERLEN) - return 0; + return 0; code = p[0]; id = p[1]; len = (p[2] << 8) + p[3]; if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ccp_codenames) && ccp_codenames[code-1] != NULL) - printer(arg, " %s", ccp_codenames[code-1]); + printer(arg, " %s", ccp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; p += HEADERLEN; @@ -1546,99 +1546,99 @@ static int ccp_printpkt(const u_char *p, int plen, void (*printer) (void *, cons case CONFACK: case CONFNAK: case CONFREJ: - /* print list of possible compression methods */ - while (len >= 2) { - code = p[0]; - optlen = p[1]; - if (optlen < 2 || optlen > len) - break; - printer(arg, " <"); - len -= optlen; - optend = p + optlen; - switch (code) { + /* print list of possible compression methods */ + while (len >= 2) { + code = p[0]; + optlen = p[1]; + if (optlen < 2 || optlen > len) + break; + printer(arg, " <"); + len -= optlen; + optend = p + optlen; + switch (code) { #if MPPE_SUPPORT - case CI_MPPE: - if (optlen >= CILEN_MPPE) { - u_char mppe_opts; - - MPPE_CI_TO_OPTS(&p[2], mppe_opts); - printer(arg, "mppe %s %s %s %s %s %s%s", - (p[2] & MPPE_H_BIT)? "+H": "-H", - (p[5] & MPPE_M_BIT)? "+M": "-M", - (p[5] & MPPE_S_BIT)? "+S": "-S", - (p[5] & MPPE_L_BIT)? "+L": "-L", - (p[5] & MPPE_D_BIT)? "+D": "-D", - (p[5] & MPPE_C_BIT)? "+C": "-C", - (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); - if (mppe_opts & MPPE_OPT_UNKNOWN) - printer(arg, " (%.2x %.2x %.2x %.2x)", - p[2], p[3], p[4], p[5]); - p += CILEN_MPPE; - } - break; + case CI_MPPE: + if (optlen >= CILEN_MPPE) { + u_char mppe_opts; + + MPPE_CI_TO_OPTS(&p[2], mppe_opts); + printer(arg, "mppe %s %s %s %s %s %s%s", + (p[2] & MPPE_H_BIT)? "+H": "-H", + (p[5] & MPPE_M_BIT)? "+M": "-M", + (p[5] & MPPE_S_BIT)? "+S": "-S", + (p[5] & MPPE_L_BIT)? "+L": "-L", + (p[5] & MPPE_D_BIT)? "+D": "-D", + (p[5] & MPPE_C_BIT)? "+C": "-C", + (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": ""); + if (mppe_opts & MPPE_OPT_UNKNOWN) + printer(arg, " (%.2x %.2x %.2x %.2x)", + p[2], p[3], p[4], p[5]); + p += CILEN_MPPE; + } + break; #endif /* MPPE_SUPPORT */ #if DEFLATE_SUPPORT - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (optlen >= CILEN_DEFLATE) { - printer(arg, "deflate%s %d", - (code == CI_DEFLATE_DRAFT? "(old#)": ""), - DEFLATE_SIZE(p[2])); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) - printer(arg, " method %d", DEFLATE_METHOD(p[2])); - if (p[3] != DEFLATE_CHK_SEQUENCE) - printer(arg, " check %d", p[3]); - p += CILEN_DEFLATE; - } - break; + case CI_DEFLATE: + case CI_DEFLATE_DRAFT: + if (optlen >= CILEN_DEFLATE) { + printer(arg, "deflate%s %d", + (code == CI_DEFLATE_DRAFT? "(old#)": ""), + DEFLATE_SIZE(p[2])); + if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) + printer(arg, " method %d", DEFLATE_METHOD(p[2])); + if (p[3] != DEFLATE_CHK_SEQUENCE) + printer(arg, " check %d", p[3]); + p += CILEN_DEFLATE; + } + break; #endif /* DEFLATE_SUPPORT */ #if BSDCOMPRESS_SUPPORT - case CI_BSD_COMPRESS: - if (optlen >= CILEN_BSD_COMPRESS) { - printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), - BSD_NBITS(p[2])); - p += CILEN_BSD_COMPRESS; - } - break; + case CI_BSD_COMPRESS: + if (optlen >= CILEN_BSD_COMPRESS) { + printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), + BSD_NBITS(p[2])); + p += CILEN_BSD_COMPRESS; + } + break; #endif /* BSDCOMPRESS_SUPPORT */ #if PREDICTOR_SUPPORT - case CI_PREDICTOR_1: - if (optlen >= CILEN_PREDICTOR_1) { - printer(arg, "predictor 1"); - p += CILEN_PREDICTOR_1; - } - break; - case CI_PREDICTOR_2: - if (optlen >= CILEN_PREDICTOR_2) { - printer(arg, "predictor 2"); - p += CILEN_PREDICTOR_2; - } - break; + case CI_PREDICTOR_1: + if (optlen >= CILEN_PREDICTOR_1) { + printer(arg, "predictor 1"); + p += CILEN_PREDICTOR_1; + } + break; + case CI_PREDICTOR_2: + if (optlen >= CILEN_PREDICTOR_2) { + printer(arg, "predictor 2"); + p += CILEN_PREDICTOR_2; + } + break; #endif /* PREDICTOR_SUPPORT */ - default: + default: break; - } - while (p < optend) - printer(arg, " %.2x", *p++); - printer(arg, ">"); - } - break; + } + while (p < optend) + printer(arg, " %.2x", *p++); + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: break; } /* dump out the rest of the packet in hex */ while (--len >= 0) - printer(arg, " %.2x", *p++); + printer(arg, " %.2x", *p++); return p - p0; } @@ -1667,34 +1667,34 @@ static void ccp_datainput(ppp_pcb *pcb, u_char *pkt, int len) { f = &pcb->ccp_fsm; if (f->state == PPP_FSM_OPENED) { - if (ccp_fatal_error(pcb)) { - /* - * Disable compression by taking CCP down. - */ - ppp_error("Lost compression sync: disabling compression"); - ccp_close(pcb, "Lost compression sync"); + if (ccp_fatal_error(pcb)) { + /* + * Disable compression by taking CCP down. + */ + ppp_error("Lost compression sync: disabling compression"); + ccp_close(pcb, "Lost compression sync"); #if MPPE_SUPPORT - /* - * If we were doing MPPE, we must also take the link down. - */ - if (go->mppe) { - ppp_error("Too many MPPE errors, closing LCP"); - lcp_close(pcb, "Too many MPPE errors"); - } + /* + * If we were doing MPPE, we must also take the link down. + */ + if (go->mppe) { + ppp_error("Too many MPPE errors, closing LCP"); + lcp_close(pcb, "Too many MPPE errors"); + } #endif /* MPPE_SUPPORT */ - } else { - /* - * Send a reset-request to reset the peer's compressor. - * We don't do that if we are still waiting for an - * acknowledgement to a previous reset-request. - */ - if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; - } else - pcb->ccp_localstate |= RREQ_REPEAT; - } + } else { + /* + * Send a reset-request to reset the peer's compressor. + * We don't do that if we are still waiting for an + * acknowledgement to a previous reset-request. + */ + if (!(pcb->ccp_localstate & RACK_PENDING)) { + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; + } else + pcb->ccp_localstate |= RREQ_REPEAT; + } } } #endif /* PPP_DATAINPUT */ @@ -1707,7 +1707,7 @@ void ccp_resetrequest(ppp_pcb *pcb) { fsm *f = &pcb->ccp_fsm; if (f->state != PPP_FSM_OPENED) - return; + return; /* * Send a reset-request to reset the peer's compressor. @@ -1715,11 +1715,11 @@ void ccp_resetrequest(ppp_pcb *pcb) { * acknowledgement to a previous reset-request. */ if (!(pcb->ccp_localstate & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate |= RACK_PENDING; + fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate |= RACK_PENDING; } else - pcb->ccp_localstate |= RREQ_REPEAT; + pcb->ccp_localstate |= RREQ_REPEAT; } /* @@ -1730,11 +1730,11 @@ static void ccp_rack_timeout(void *arg) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED && (pcb->ccp_localstate & RREQ_REPEAT)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - pcb->ccp_localstate &= ~RREQ_REPEAT; + fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); + TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); + pcb->ccp_localstate &= ~RREQ_REPEAT; } else - pcb->ccp_localstate &= ~RACK_PENDING; + pcb->ccp_localstate &= ~RACK_PENDING; } #endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c b/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c index 2b7c9b36a8..88f069f032 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/chap-md5.c @@ -43,84 +43,84 @@ #include "netif/ppp/magic.h" #include "netif/ppp/pppcrypt.h" -#define MD5_HASH_SIZE 16 -#define MD5_MIN_CHALLENGE 17 -#define MD5_MAX_CHALLENGE 24 +#define MD5_HASH_SIZE 16 +#define MD5_MIN_CHALLENGE 17 +#define MD5_MAX_CHALLENGE 24 #define MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE 3 /* 2^3-1 = 7, 17+7 = 24 */ #if PPP_SERVER static void chap_md5_generate_challenge(ppp_pcb *pcb, unsigned char *cp) { - int clen; - LWIP_UNUSED_ARG(pcb); + int clen; + LWIP_UNUSED_ARG(pcb); - clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); - *cp++ = clen; - magic_random_bytes(cp, clen); + clen = MD5_MIN_CHALLENGE + magic_pow(MD5_MIN_MAX_POWER_OF_TWO_CHALLENGE); + *cp++ = clen; + magic_random_bytes(cp, clen); } static int chap_md5_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - lwip_md5_context ctx; - unsigned char idbyte = id; - unsigned char hash[MD5_HASH_SIZE]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(name); - LWIP_UNUSED_ARG(pcb); + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + lwip_md5_context ctx; + unsigned char idbyte = id; + unsigned char hash[MD5_HASH_SIZE]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(name); + LWIP_UNUSED_ARG(pcb); - challenge_len = *challenge++; - response_len = *response++; - if (response_len == MD5_HASH_SIZE) { - /* Generate hash of ID, secret, challenge */ - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, hash); - lwip_md5_free(&ctx); + challenge_len = *challenge++; + response_len = *response++; + if (response_len == MD5_HASH_SIZE) { + /* Generate hash of ID, secret, challenge */ + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, hash); + lwip_md5_free(&ctx); - /* Test if our hash matches the peer's response */ - if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } - } - ppp_slprintf(message, message_space, "Access denied"); - return 0; + /* Test if our hash matches the peer's response */ + if (memcmp(hash, response, MD5_HASH_SIZE) == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } + } + ppp_slprintf(message, message_space, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chap_md5_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - lwip_md5_context ctx; - unsigned char idbyte = id; - int challenge_len = *challenge++; - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - LWIP_UNUSED_ARG(pcb); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + lwip_md5_context ctx; + unsigned char idbyte = id; + int challenge_len = *challenge++; + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + LWIP_UNUSED_ARG(pcb); - lwip_md5_init(&ctx); - lwip_md5_starts(&ctx); - lwip_md5_update(&ctx, &idbyte, 1); - lwip_md5_update(&ctx, (const u_char *)secret, secret_len); - lwip_md5_update(&ctx, challenge, challenge_len); - lwip_md5_finish(&ctx, &response[1]); - lwip_md5_free(&ctx); - response[0] = MD5_HASH_SIZE; + lwip_md5_init(&ctx); + lwip_md5_starts(&ctx); + lwip_md5_update(&ctx, &idbyte, 1); + lwip_md5_update(&ctx, (const u_char *)secret, secret_len); + lwip_md5_update(&ctx, challenge, challenge_len); + lwip_md5_finish(&ctx, &response[1]); + lwip_md5_free(&ctx); + response[0] = MD5_HASH_SIZE; } const struct chap_digest_type md5_digest = { - CHAP_MD5, /* code */ + CHAP_MD5, /* code */ #if PPP_SERVER - chap_md5_generate_challenge, - chap_md5_verify_response, + chap_md5_generate_challenge, + chap_md5_verify_response, #endif /* PPP_SERVER */ - chap_md5_make_response, - NULL, /* check_success */ - NULL, /* handle_failure */ + chap_md5_make_response, + NULL, /* check_success */ + NULL, /* handle_failure */ }; #endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c b/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c index e599f3eb76..485122d272 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/chap-new.c @@ -52,9 +52,9 @@ #if 0 /* UNUSED */ /* Hook for a plugin to validate CHAP challenge */ int (*chap_verify_hook)(const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) = NULL; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) = NULL; #endif /* UNUSED */ #if PPP_OPTIONS @@ -62,24 +62,24 @@ int (*chap_verify_hook)(const char *name, const char *ourname, int id, * Command-line options. */ static option_t chap_option_list[] = { - { "chap-restart", o_int, &chap_timeout_time, - "Set timeout for CHAP", OPT_PRIO }, - { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, - "Set max #xmits for challenge", OPT_PRIO }, - { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, - "Set interval for rechallenge", OPT_PRIO }, - { NULL } + { "chap-restart", o_int, &chap_timeout_time, + "Set timeout for CHAP", OPT_PRIO }, + { "chap-max-challenge", o_int, &pcb->settings.chap_max_transmits, + "Set max #xmits for challenge", OPT_PRIO }, + { "chap-interval", o_int, &pcb->settings.chap_rechallenge_time, + "Set interval for rechallenge", OPT_PRIO }, + { NULL } }; #endif /* PPP_OPTIONS */ /* Values for flags in chap_client_state and chap_server_state */ -#define LOWERUP 1 -#define AUTH_STARTED 2 -#define AUTH_DONE 4 -#define AUTH_FAILED 8 -#define TIMEOUT_PENDING 0x10 -#define CHALLENGE_VALID 0x20 +#define LOWERUP 1 +#define AUTH_STARTED 2 +#define AUTH_DONE 4 +#define AUTH_FAILED 8 +#define TIMEOUT_PENDING 0x10 +#define CHALLENGE_VALID 0x20 /* * Prototypes. @@ -91,21 +91,21 @@ static void chap_lowerdown(ppp_pcb *pcb); static void chap_timeout(void *arg); static void chap_generate_challenge(ppp_pcb *pcb); static void chap_handle_response(ppp_pcb *pcb, int code, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space); + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space); #endif /* PPP_SERVER */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len); + unsigned char *pkt, int len); static void chap_protrej(ppp_pcb *pcb); static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen); #if PRINTPKT_SUPPORT static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ /* List of digest types that we know about */ @@ -122,12 +122,12 @@ static const struct chap_digest_type* const chap_digests[] = { * chap_init - reset to initial state. */ static void chap_init(ppp_pcb *pcb) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); #if 0 /* Not necessary, everything is cleared in ppp_new() */ - memset(&pcb->chap_client, 0, sizeof(chap_client_state)); + memset(&pcb->chap_client, 0, sizeof(chap_client_state)); #if PPP_SERVER - memset(&pcb->chap_server, 0, sizeof(chap_server_state)); + memset(&pcb->chap_server, 0, sizeof(chap_server_state)); #endif /* PPP_SERVER */ #endif /* 0 */ } @@ -137,21 +137,21 @@ static void chap_init(ppp_pcb *pcb) { */ static void chap_lowerup(ppp_pcb *pcb) { - pcb->chap_client.flags |= LOWERUP; + pcb->chap_client.flags |= LOWERUP; #if PPP_SERVER - pcb->chap_server.flags |= LOWERUP; - if (pcb->chap_server.flags & AUTH_STARTED) - chap_timeout(pcb); + pcb->chap_server.flags |= LOWERUP; + if (pcb->chap_server.flags & AUTH_STARTED) + chap_timeout(pcb); #endif /* PPP_SERVER */ } static void chap_lowerdown(ppp_pcb *pcb) { - pcb->chap_client.flags = 0; + pcb->chap_client.flags = 0; #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) - UNTIMEOUT(chap_timeout, pcb); - pcb->chap_server.flags = 0; + if (pcb->chap_server.flags & TIMEOUT_PENDING) + UNTIMEOUT(chap_timeout, pcb); + pcb->chap_server.flags = 0; #endif /* PPP_SERVER */ } @@ -162,27 +162,27 @@ static void chap_lowerdown(ppp_pcb *pcb) { * otherwise we wait for the lower layer to come up. */ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if (pcb->chap_server.flags & AUTH_STARTED) { - ppp_error("CHAP: peer authentication already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_server.digest = dp; - pcb->chap_server.name = our_name; - /* Start with a random ID value */ - pcb->chap_server.id = magic(); - pcb->chap_server.flags |= AUTH_STARTED; - if (pcb->chap_server.flags & LOWERUP) - chap_timeout(pcb); + const struct chap_digest_type *dp; + int i; + + if (pcb->chap_server.flags & AUTH_STARTED) { + ppp_error("CHAP: peer authentication already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_server.digest = dp; + pcb->chap_server.name = our_name; + /* Start with a random ID value */ + pcb->chap_server.id = magic(); + pcb->chap_server.flags |= AUTH_STARTED; + if (pcb->chap_server.flags & LOWERUP) + chap_timeout(pcb); } #endif /* PPP_SERVER */ @@ -191,27 +191,27 @@ void chap_auth_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * There isn't much to do until we receive a challenge. */ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { - const struct chap_digest_type *dp; - int i; - - if(NULL == our_name) - return; - - if (pcb->chap_client.flags & AUTH_STARTED) { - ppp_error("CHAP: authentication with peer already started!"); - return; - } - for (i = 0; (dp = chap_digests[i]) != NULL; ++i) - if (dp->code == digest_code) - break; - - if (dp == NULL) - ppp_fatal("CHAP digest 0x%x requested but not available", - digest_code); - - pcb->chap_client.digest = dp; - pcb->chap_client.name = our_name; - pcb->chap_client.flags |= AUTH_STARTED; + const struct chap_digest_type *dp; + int i; + + if(NULL == our_name) + return; + + if (pcb->chap_client.flags & AUTH_STARTED) { + ppp_error("CHAP: authentication with peer already started!"); + return; + } + for (i = 0; (dp = chap_digests[i]) != NULL; ++i) + if (dp->code == digest_code) + break; + + if (dp == NULL) + ppp_fatal("CHAP digest 0x%x requested but not available", + digest_code); + + pcb->chap_client.digest = dp; + pcb->chap_client.name = our_name; + pcb->chap_client.flags |= AUTH_STARTED; } #if PPP_SERVER @@ -221,33 +221,33 @@ void chap_auth_with_peer(ppp_pcb *pcb, const char *our_name, int digest_code) { * or a new challenge to start re-authentication. */ static void chap_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; - struct pbuf *p; - - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { - pcb->chap_server.challenge_xmits = 0; - chap_generate_challenge(pcb); - pcb->chap_server.flags |= CHALLENGE_VALID; - } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; - auth_peer_fail(pcb, PPP_CHAP); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); - ppp_write(pcb, p); - ++pcb->chap_server.challenge_xmits; - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); + ppp_pcb *pcb = (ppp_pcb*)arg; + struct pbuf *p; + + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + if ((pcb->chap_server.flags & CHALLENGE_VALID) == 0) { + pcb->chap_server.challenge_xmits = 0; + chap_generate_challenge(pcb); + pcb->chap_server.flags |= CHALLENGE_VALID; + } else if (pcb->chap_server.challenge_xmits >= pcb->settings.chap_max_transmits) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + pcb->chap_server.flags |= AUTH_DONE | AUTH_FAILED; + auth_peer_fail(pcb, PPP_CHAP); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(pcb->chap_server.challenge_pktlen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + MEMCPY(p->payload, pcb->chap_server.challenge, pcb->chap_server.challenge_pktlen); + ppp_write(pcb, p); + ++pcb->chap_server.challenge_xmits; + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, arg, pcb->settings.chap_timeout_time); } /* @@ -255,152 +255,152 @@ static void chap_timeout(void *arg) { * the challenge packet in pcb->chap_server.challenge_pkt. */ static void chap_generate_challenge(ppp_pcb *pcb) { - int clen = 1, nlen, len; - unsigned char *p; - - p = pcb->chap_server.challenge; - MAKEHEADER(p, PPP_CHAP); - p += CHAP_HDRLEN; - pcb->chap_server.digest->generate_challenge(pcb, p); - clen = *p; - nlen = strlen(pcb->chap_server.name); - memcpy(p + 1 + clen, pcb->chap_server.name, nlen); - - len = CHAP_HDRLEN + 1 + clen + nlen; - pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; - - p = pcb->chap_server.challenge + PPP_HDRLEN; - p[0] = CHAP_CHALLENGE; - p[1] = ++pcb->chap_server.id; - p[2] = len >> 8; - p[3] = len; + int clen = 1, nlen, len; + unsigned char *p; + + p = pcb->chap_server.challenge; + MAKEHEADER(p, PPP_CHAP); + p += CHAP_HDRLEN; + pcb->chap_server.digest->generate_challenge(pcb, p); + clen = *p; + nlen = strlen(pcb->chap_server.name); + memcpy(p + 1 + clen, pcb->chap_server.name, nlen); + + len = CHAP_HDRLEN + 1 + clen + nlen; + pcb->chap_server.challenge_pktlen = PPP_HDRLEN + len; + + p = pcb->chap_server.challenge + PPP_HDRLEN; + p[0] = CHAP_CHALLENGE; + p[1] = ++pcb->chap_server.id; + p[2] = len >> 8; + p[3] = len; } /* * chap_handle_response - check the response to our challenge. */ static void chap_handle_response(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int response_len, ok, mlen; - const unsigned char *response; - unsigned char *outp; - struct pbuf *p; - const char *name = NULL; /* initialized to shut gcc up */ + unsigned char *pkt, int len) { + int response_len, ok, mlen; + const unsigned char *response; + unsigned char *outp; + struct pbuf *p; + const char *name = NULL; /* initialized to shut gcc up */ #if 0 /* UNUSED */ - int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, - const unsigned char *, const unsigned char *, char *, int); + int (*verifier)(const char *, const char *, int, const struct chap_digest_type *, + const unsigned char *, const unsigned char *, char *, int); #endif /* UNUSED */ - char rname[MAXNAMELEN+1]; - char message[256]; - - if ((pcb->chap_server.flags & LOWERUP) == 0) - return; - if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) - return; - if (pcb->chap_server.flags & CHALLENGE_VALID) { - response = pkt; - GETCHAR(response_len, pkt); - len -= response_len + 1; /* length of name */ - name = (char *)pkt + response_len; - if (len < 0) - return; - - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } + char rname[MAXNAMELEN+1]; + char message[256]; + + if ((pcb->chap_server.flags & LOWERUP) == 0) + return; + if (id != pcb->chap_server.challenge[PPP_HDRLEN+1] || len < 2) + return; + if (pcb->chap_server.flags & CHALLENGE_VALID) { + response = pkt; + GETCHAR(response_len, pkt); + len -= response_len + 1; /* length of name */ + name = (char *)pkt + response_len; + if (len < 0) + return; + + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } #if PPP_REMOTENAME - if (pcb->settings.explicit_remote) { - name = pcb->remote_name; - } else + if (pcb->settings.explicit_remote) { + name = pcb->remote_name; + } else #endif /* PPP_REMOTENAME */ - { - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); - name = rname; - } + { + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", len, name); + name = rname; + } #if 0 /* UNUSED */ - if (chap_verify_hook) - verifier = chap_verify_hook; - else - verifier = chap_verify_response; - ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, - pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, - response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); + if (chap_verify_hook) + verifier = chap_verify_hook; + else + verifier = chap_verify_response; + ok = (*verifier)(name, pcb->chap_server.name, id, pcb->chap_server.digest, + pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, + response, pcb->chap_server.message, sizeof(pcb->chap_server.message)); #endif /* UNUSED */ - ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, + ok = chap_verify_response(pcb, name, pcb->chap_server.name, id, pcb->chap_server.digest, pcb->chap_server.challenge + PPP_HDRLEN + CHAP_HDRLEN, response, message, sizeof(message)); #if 0 /* UNUSED */ - if (!ok || !auth_number()) { + if (!ok || !auth_number()) { #endif /* UNUSED */ - if (!ok) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP authentication", name); - } - } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) - return; - - /* send the response */ - mlen = strlen(message); - len = CHAP_HDRLEN + mlen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (unsigned char *)p->payload; - MAKEHEADER(outp, PPP_CHAP); - - outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - if (mlen > 0) - memcpy(outp + CHAP_HDRLEN, message, mlen); - ppp_write(pcb, p); - - if (pcb->chap_server.flags & CHALLENGE_VALID) { - pcb->chap_server.flags &= ~CHALLENGE_VALID; - if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { + if (!ok) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP authentication", name); + } + } else if ((pcb->chap_server.flags & AUTH_DONE) == 0) + return; + + /* send the response */ + mlen = strlen(message); + len = CHAP_HDRLEN + mlen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +len), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (unsigned char *)p->payload; + MAKEHEADER(outp, PPP_CHAP); + + outp[0] = (pcb->chap_server.flags & AUTH_FAILED)? CHAP_FAILURE: CHAP_SUCCESS; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + if (mlen > 0) + memcpy(outp + CHAP_HDRLEN, message, mlen); + ppp_write(pcb, p); + + if (pcb->chap_server.flags & CHALLENGE_VALID) { + pcb->chap_server.flags &= ~CHALLENGE_VALID; + if (!(pcb->chap_server.flags & AUTH_DONE) && !(pcb->chap_server.flags & AUTH_FAILED)) { #if 0 /* UNUSED */ - /* - * Auth is OK, so now we need to check session restrictions - * to ensure everything is OK, but only if we used a - * plugin, and only if we're configured to check. This - * allows us to do PAM checks on PPP servers that - * authenticate against ActiveDirectory, and use AD for - * account info (like when using Winbind integrated with - * PAM). - */ - if (session_mgmt && - session_check(name, NULL, devnam, NULL) == 0) { - pcb->chap_server.flags |= AUTH_FAILED; - ppp_warn("Peer %q failed CHAP Session verification", name); - } + /* + * Auth is OK, so now we need to check session restrictions + * to ensure everything is OK, but only if we used a + * plugin, and only if we're configured to check. This + * allows us to do PAM checks on PPP servers that + * authenticate against ActiveDirectory, and use AD for + * account info (like when using Winbind integrated with + * PAM). + */ + if (session_mgmt && + session_check(name, NULL, devnam, NULL) == 0) { + pcb->chap_server.flags |= AUTH_FAILED; + ppp_warn("Peer %q failed CHAP Session verification", name); + } #endif /* UNUSED */ - } - if (pcb->chap_server.flags & AUTH_FAILED) { - auth_peer_fail(pcb, PPP_CHAP); - } else { - if ((pcb->chap_server.flags & AUTH_DONE) == 0) - auth_peer_success(pcb, PPP_CHAP, - pcb->chap_server.digest->code, - name, strlen(name)); - if (pcb->settings.chap_rechallenge_time) { - pcb->chap_server.flags |= TIMEOUT_PENDING; - TIMEOUT(chap_timeout, pcb, - pcb->settings.chap_rechallenge_time); - } - } - pcb->chap_server.flags |= AUTH_DONE; - } + } + if (pcb->chap_server.flags & AUTH_FAILED) { + auth_peer_fail(pcb, PPP_CHAP); + } else { + if ((pcb->chap_server.flags & AUTH_DONE) == 0) + auth_peer_success(pcb, PPP_CHAP, + pcb->chap_server.digest->code, + name, strlen(name)); + if (pcb->settings.chap_rechallenge_time) { + pcb->chap_server.flags |= TIMEOUT_PENDING; + TIMEOUT(chap_timeout, pcb, + pcb->settings.chap_rechallenge_time); + } + } + pcb->chap_server.flags |= AUTH_DONE; + } } /* @@ -409,23 +409,23 @@ static void chap_handle_response(ppp_pcb *pcb, int id, * succeeded), or 0 if it doesn't. */ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourname, int id, - const struct chap_digest_type *digest, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - int ok; - unsigned char secret[MAXSECRETLEN]; - int secret_len; - - /* Get the secret that the peer is supposed to know */ - if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { - ppp_error("No CHAP secret found for authenticating %q", name); - return 0; - } - ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, - response, message, message_space); - memset(secret, 0, sizeof(secret)); - - return ok; + const struct chap_digest_type *digest, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + int ok; + unsigned char secret[MAXSECRETLEN]; + int secret_len; + + /* Get the secret that the peer is supposed to know */ + if (!get_secret(pcb, name, ourname, (char *)secret, &secret_len, 1)) { + ppp_error("No CHAP secret found for authenticating %q", name); + return 0; + } + ok = digest->verify_response(pcb, id, name, secret, secret_len, challenge, + response, message, message_space); + memset(secret, 0, sizeof(secret)); + + return ok; } #endif /* PPP_SERVER */ @@ -433,153 +433,153 @@ static int chap_verify_response(ppp_pcb *pcb, const char *name, const char *ourn * chap_respond - Generate and send a response to a challenge. */ static void chap_respond(ppp_pcb *pcb, int id, - unsigned char *pkt, int len) { - int clen, nlen; - int secret_len; - struct pbuf *p; - u_char *outp; - char rname[MAXNAMELEN+1]; - char secret[MAXSECRETLEN+1]; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) - return; /* not ready */ - if (len < 2 || len < pkt[0] + 1) - return; /* too short */ - clen = pkt[0]; - nlen = len - (clen + 1); - - /* Null terminate and clean remote name. */ - ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); + unsigned char *pkt, int len) { + int clen, nlen; + int secret_len; + struct pbuf *p; + u_char *outp; + char rname[MAXNAMELEN+1]; + char secret[MAXSECRETLEN+1]; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(RESP_MAX_PKTLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + if ((pcb->chap_client.flags & (LOWERUP | AUTH_STARTED)) != (LOWERUP | AUTH_STARTED)) + return; /* not ready */ + if (len < 2 || len < pkt[0] + 1) + return; /* too short */ + clen = pkt[0]; + nlen = len - (clen + 1); + + /* Null terminate and clean remote name. */ + ppp_slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1); #if PPP_REMOTENAME - /* Microsoft doesn't send their name back in the PPP packet */ - if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) - strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); + /* Microsoft doesn't send their name back in the PPP packet */ + if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0)) + strlcpy(rname, pcb->settings.remote_name, sizeof(rname)); #endif /* PPP_REMOTENAME */ - /* get secret for authenticating ourselves with the specified host */ - if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { - secret_len = 0; /* assume null secret if can't find one */ - ppp_warn("No CHAP secret found for authenticating us to %q", rname); - } - - outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_CHAP); - outp += CHAP_HDRLEN; - - pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, - secret, secret_len, pcb->chap_client.priv); - memset(secret, 0, secret_len); - - clen = *outp; - nlen = strlen(pcb->chap_client.name); - memcpy(outp + clen + 1, pcb->chap_client.name, nlen); - - outp = (u_char*)p->payload + PPP_HDRLEN; - len = CHAP_HDRLEN + clen + 1 + nlen; - outp[0] = CHAP_RESPONSE; - outp[1] = id; - outp[2] = len >> 8; - outp[3] = len; - - pbuf_realloc(p, PPP_HDRLEN + len); - ppp_write(pcb, p); + /* get secret for authenticating ourselves with the specified host */ + if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) { + secret_len = 0; /* assume null secret if can't find one */ + ppp_warn("No CHAP secret found for authenticating us to %q", rname); + } + + outp = (u_char*)p->payload; + MAKEHEADER(outp, PPP_CHAP); + outp += CHAP_HDRLEN; + + pcb->chap_client.digest->make_response(pcb, outp, id, pcb->chap_client.name, pkt, + secret, secret_len, pcb->chap_client.priv); + memset(secret, 0, secret_len); + + clen = *outp; + nlen = strlen(pcb->chap_client.name); + memcpy(outp + clen + 1, pcb->chap_client.name, nlen); + + outp = (u_char*)p->payload + PPP_HDRLEN; + len = CHAP_HDRLEN + clen + 1 + nlen; + outp[0] = CHAP_RESPONSE; + outp[1] = id; + outp[2] = len >> 8; + outp[3] = len; + + pbuf_realloc(p, PPP_HDRLEN + len); + ppp_write(pcb, p); } static void chap_handle_status(ppp_pcb *pcb, int code, int id, - unsigned char *pkt, int len) { - const char *msg = NULL; - LWIP_UNUSED_ARG(id); - - if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) - != (AUTH_STARTED|LOWERUP)) - return; - pcb->chap_client.flags |= AUTH_DONE; - - if (code == CHAP_SUCCESS) { - /* used for MS-CHAP v2 mutual auth, yuck */ - if (pcb->chap_client.digest->check_success != NULL) { - if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) - code = CHAP_FAILURE; - } else - msg = "CHAP authentication succeeded"; - } else { - if (pcb->chap_client.digest->handle_failure != NULL) - (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); - else - msg = "CHAP authentication failed"; - } - if (msg) { - if (len > 0) - ppp_info("%s: %.*v", msg, len, pkt); - else - ppp_info("%s", msg); - } - if (code == CHAP_SUCCESS) - auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); - else { - pcb->chap_client.flags |= AUTH_FAILED; - ppp_error("CHAP authentication failed"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + unsigned char *pkt, int len) { + const char *msg = NULL; + LWIP_UNUSED_ARG(id); + + if ((pcb->chap_client.flags & (AUTH_DONE|AUTH_STARTED|LOWERUP)) + != (AUTH_STARTED|LOWERUP)) + return; + pcb->chap_client.flags |= AUTH_DONE; + + if (code == CHAP_SUCCESS) { + /* used for MS-CHAP v2 mutual auth, yuck */ + if (pcb->chap_client.digest->check_success != NULL) { + if (!(*pcb->chap_client.digest->check_success)(pcb, pkt, len, pcb->chap_client.priv)) + code = CHAP_FAILURE; + } else + msg = "CHAP authentication succeeded"; + } else { + if (pcb->chap_client.digest->handle_failure != NULL) + (*pcb->chap_client.digest->handle_failure)(pcb, pkt, len); + else + msg = "CHAP authentication failed"; + } + if (msg) { + if (len > 0) + ppp_info("%s: %.*v", msg, len, pkt); + else + ppp_info("%s", msg); + } + if (code == CHAP_SUCCESS) + auth_withpeer_success(pcb, PPP_CHAP, pcb->chap_client.digest->code); + else { + pcb->chap_client.flags |= AUTH_FAILED; + ppp_error("CHAP authentication failed"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } static void chap_input(ppp_pcb *pcb, unsigned char *pkt, int pktlen) { - unsigned char code, id; - int len; - - if (pktlen < CHAP_HDRLEN) - return; - GETCHAR(code, pkt); - GETCHAR(id, pkt); - GETSHORT(len, pkt); - if (len < CHAP_HDRLEN || len > pktlen) - return; - len -= CHAP_HDRLEN; - - switch (code) { - case CHAP_CHALLENGE: - chap_respond(pcb, id, pkt, len); - break; + unsigned char code, id; + int len; + + if (pktlen < CHAP_HDRLEN) + return; + GETCHAR(code, pkt); + GETCHAR(id, pkt); + GETSHORT(len, pkt); + if (len < CHAP_HDRLEN || len > pktlen) + return; + len -= CHAP_HDRLEN; + + switch (code) { + case CHAP_CHALLENGE: + chap_respond(pcb, id, pkt, len); + break; #if PPP_SERVER - case CHAP_RESPONSE: - chap_handle_response(pcb, id, pkt, len); - break; + case CHAP_RESPONSE: + chap_handle_response(pcb, id, pkt, len); + break; #endif /* PPP_SERVER */ - case CHAP_FAILURE: - case CHAP_SUCCESS: - chap_handle_status(pcb, code, id, pkt, len); - break; - default: - break; - } + case CHAP_FAILURE: + case CHAP_SUCCESS: + chap_handle_status(pcb, code, id, pkt, len); + break; + default: + break; + } } static void chap_protrej(ppp_pcb *pcb) { #if PPP_SERVER - if (pcb->chap_server.flags & TIMEOUT_PENDING) { - pcb->chap_server.flags &= ~TIMEOUT_PENDING; - UNTIMEOUT(chap_timeout, pcb); - } - if (pcb->chap_server.flags & AUTH_STARTED) { - pcb->chap_server.flags = 0; - auth_peer_fail(pcb, PPP_CHAP); - } + if (pcb->chap_server.flags & TIMEOUT_PENDING) { + pcb->chap_server.flags &= ~TIMEOUT_PENDING; + UNTIMEOUT(chap_timeout, pcb); + } + if (pcb->chap_server.flags & AUTH_STARTED) { + pcb->chap_server.flags = 0; + auth_peer_fail(pcb, PPP_CHAP); + } #endif /* PPP_SERVER */ - if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { - pcb->chap_client.flags &= ~AUTH_STARTED; - ppp_error("CHAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_CHAP); - } + if ((pcb->chap_client.flags & (AUTH_STARTED|AUTH_DONE)) == AUTH_STARTED) { + pcb->chap_client.flags &= ~AUTH_STARTED; + ppp_error("CHAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_CHAP); + } } #if PRINTPKT_SUPPORT @@ -587,90 +587,90 @@ static void chap_protrej(ppp_pcb *pcb) { * chap_print_pkt - print the contents of a CHAP packet. */ static const char* const chap_code_names[] = { - "Challenge", "Response", "Success", "Failure" + "Challenge", "Response", "Success", "Failure" }; static int chap_print_pkt(const unsigned char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len; - int clen, nlen; - unsigned char x; - - if (plen < CHAP_HDRLEN) - return 0; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < CHAP_HDRLEN || len > plen) - return 0; - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) - printer(arg, " %s", chap_code_names[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= CHAP_HDRLEN; - switch (code) { - case CHAP_CHALLENGE: - case CHAP_RESPONSE: - if (len < 1) - break; - clen = p[0]; - if (len < clen + 1) - break; - ++p; - nlen = len - clen - 1; - printer(arg, " <"); - for (; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, "%.2x", x); - } - printer(arg, ">, name = "); - ppp_print_string(p, nlen, printer, arg); - break; - case CHAP_FAILURE: - case CHAP_SUCCESS: - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - break; - default: - for (clen = len; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, " %.2x", x); - } - /* no break */ - } - - return len + CHAP_HDRLEN; + void (*printer) (void *, const char *, ...), void *arg) { + int code, id, len; + int clen, nlen; + unsigned char x; + + if (plen < CHAP_HDRLEN) + return 0; + GETCHAR(code, p); + GETCHAR(id, p); + GETSHORT(len, p); + if (len < CHAP_HDRLEN || len > plen) + return 0; + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(chap_code_names)) + printer(arg, " %s", chap_code_names[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= CHAP_HDRLEN; + switch (code) { + case CHAP_CHALLENGE: + case CHAP_RESPONSE: + if (len < 1) + break; + clen = p[0]; + if (len < clen + 1) + break; + ++p; + nlen = len - clen - 1; + printer(arg, " <"); + for (; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, "%.2x", x); + } + printer(arg, ">, name = "); + ppp_print_string(p, nlen, printer, arg); + break; + case CHAP_FAILURE: + case CHAP_SUCCESS: + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + break; + default: + for (clen = len; clen > 0; --clen) { + GETCHAR(x, p); + printer(arg, " %.2x", x); + } + /* no break */ + } + + return len + CHAP_HDRLEN; } #endif /* PRINTPKT_SUPPORT */ const struct protent chap_protent = { - PPP_CHAP, - chap_init, - chap_input, - chap_protrej, - chap_lowerup, - chap_lowerdown, - NULL, /* open */ - NULL, /* close */ + PPP_CHAP, + chap_init, + chap_input, + chap_protrej, + chap_lowerup, + chap_lowerdown, + NULL, /* open */ + NULL, /* close */ #if PRINTPKT_SUPPORT - chap_print_pkt, + chap_print_pkt, #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* datainput */ + NULL, /* datainput */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "CHAP", /* name */ - NULL, /* data_name */ + "CHAP", /* name */ + NULL, /* data_name */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - chap_option_list, - NULL, /* check_options */ + chap_option_list, + NULL, /* check_options */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, - NULL + NULL, + NULL #endif /* DEMAND_SUPPORT */ }; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c b/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c index b050aa1cd1..5a989c9b7e 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/chap_ms.c @@ -97,41 +97,41 @@ #include "netif/ppp/mppe.h" /* For mppe_sha1_pad*, mppe_set_key() */ #endif /* MPPE_SUPPORT */ -#define SHA1_SIGNATURE_SIZE 20 -#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ -#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ +#define SHA1_SIGNATURE_SIZE 20 +#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ +#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */ -#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ -#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ -#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ - /* as ASCII */ +#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ +#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */ +#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */ + /* as ASCII */ /* Error codes for MS-CHAP failure messages. */ -#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 -#define MS_CHAP_ERROR_ACCT_DISABLED 647 -#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 -#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 -#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 -#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 +#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646 +#define MS_CHAP_ERROR_ACCT_DISABLED 647 +#define MS_CHAP_ERROR_PASSWD_EXPIRED 648 +#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649 +#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691 +#define MS_CHAP_ERROR_CHANGING_PASSWORD 709 /* * Offsets within the response field for MS-CHAP */ -#define MS_CHAP_LANMANRESP 0 -#define MS_CHAP_LANMANRESP_LEN 24 -#define MS_CHAP_NTRESP 24 -#define MS_CHAP_NTRESP_LEN 24 -#define MS_CHAP_USENT 48 +#define MS_CHAP_LANMANRESP 0 +#define MS_CHAP_LANMANRESP_LEN 24 +#define MS_CHAP_NTRESP 24 +#define MS_CHAP_NTRESP_LEN 24 +#define MS_CHAP_USENT 48 /* * Offsets within the response field for MS-CHAP2 */ -#define MS_CHAP2_PEER_CHALLENGE 0 -#define MS_CHAP2_PEER_CHAL_LEN 16 -#define MS_CHAP2_RESERVED_LEN 8 -#define MS_CHAP2_NTRESP 24 -#define MS_CHAP2_NTRESP_LEN 24 -#define MS_CHAP2_FLAGS 48 +#define MS_CHAP2_PEER_CHALLENGE 0 +#define MS_CHAP2_PEER_CHAL_LEN 16 +#define MS_CHAP2_RESERVED_LEN 8 +#define MS_CHAP2_NTRESP 24 +#define MS_CHAP2_NTRESP_LEN 24 +#define MS_CHAP2_FLAGS 48 #if MPPE_SUPPORT #if 0 /* UNUSED */ @@ -150,37 +150,37 @@ extern void set_mppe_enc_types(int, int); #define MS_CHAP2_AUTHENTICATEE 0 #define MS_CHAP2_AUTHENTICATOR 1 -static void ascii2unicode (const char[], int, u_char[]); -static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); -static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); -static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); -static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); -static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, - u_char[24]); -static void GenerateAuthenticatorResponsePlain - (const char*, int, u_char[24], const u_char[16], const u_char *, - const char *, u_char[41]); +static void ascii2unicode (const char[], int, u_char[]); +static void NTPasswordHash (u_char *, int, u_char[MD4_SIGNATURE_SIZE]); +static void ChallengeResponse (const u_char *, const u_char *, u_char[24]); +static void ChallengeHash (const u_char[16], const u_char *, const char *, u_char[8]); +static void ChapMS_NT (const u_char *, const char *, int, u_char[24]); +static void ChapMS2_NT (const u_char *, const u_char[16], const char *, const char *, int, + u_char[24]); +static void GenerateAuthenticatorResponsePlain + (const char*, int, u_char[24], const u_char[16], const u_char *, + const char *, u_char[41]); #ifdef MSLANMAN -static void ChapMS_LANMan (u_char *, char *, int, u_char *); +static void ChapMS_LANMan (u_char *, char *, int, u_char *); #endif static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]); #if MPPE_SUPPORT -static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); -static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); +static void Set_Start_Key (ppp_pcb *pcb, const u_char *, const char *, int); +static void SetMasterKeys (ppp_pcb *pcb, const char *, int, u_char[24], int); #endif /* MPPE_SUPPORT */ static void ChapMS (ppp_pcb *pcb, const u_char *, const char *, int, u_char *); static void ChapMS2 (ppp_pcb *pcb, const u_char *, const u_char *, const char *, const char *, int, - u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); + u_char *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int); #ifdef MSLANMAN -bool ms_lanman = 0; /* Use LanMan password instead of NT */ - /* Has meaning only with MS-CHAP challenges */ +bool ms_lanman = 0; /* Use LanMan password instead of NT */ + /* Has meaning only with MS-CHAP challenges */ #endif #if MPPE_SUPPORT @@ -192,7 +192,7 @@ static char *mschap_challenge = NULL; static char *mschap2_peer_challenge = NULL; #endif -#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ +#include "netif/ppp/fsm.h" /* Need to poke MPPE options */ #include "netif/ppp/ccp.h" #endif /* MPPE_SUPPORT */ @@ -202,16 +202,16 @@ static char *mschap2_peer_challenge = NULL; */ static option_t chapms_option_list[] = { #ifdef MSLANMAN - { "ms-lanman", o_bool, &ms_lanman, - "Use LanMan passwd when using MS-CHAP", 1 }, + { "ms-lanman", o_bool, &ms_lanman, + "Use LanMan passwd when using MS-CHAP", 1 }, #endif #ifdef DEBUGMPPEKEY - { "mschap-challenge", o_string, &mschap_challenge, - "specify CHAP challenge" }, - { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, - "specify CHAP peer challenge" }, + { "mschap-challenge", o_string, &mschap_challenge, + "specify CHAP challenge" }, + { "mschap2-peer-challenge", o_string, &mschap2_peer_challenge, + "specify CHAP peer challenge" }, #endif - { NULL } + { NULL } }; #endif /* PPP_OPTIONS */ @@ -223,279 +223,279 @@ static option_t chapms_option_list[] = { * at challenge[1]. */ static void chapms_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 8; + *challenge++ = 8; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 8) - memcpy(challenge, mschap_challenge, 8); - else + if (mschap_challenge && strlen(mschap_challenge) == 8) + memcpy(challenge, mschap_challenge, 8); + else #endif - magic_random_bytes(challenge, 8); + magic_random_bytes(challenge, 8); } static void chapms2_generate_challenge(ppp_pcb *pcb, unsigned char *challenge) { - LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(pcb); - *challenge++ = 16; + *challenge++ = 16; #ifdef DEBUGMPPEKEY - if (mschap_challenge && strlen(mschap_challenge) == 16) - memcpy(challenge, mschap_challenge, 16); - else + if (mschap_challenge && strlen(mschap_challenge) == 16) + memcpy(challenge, mschap_challenge, 16); + else #endif - magic_random_bytes(challenge, 16); + magic_random_bytes(challenge, 16); } static int chapms_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP_RESPONSE_LEN]; - int diff; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(name); - - challenge_len = *challenge++; /* skip length, is 8 */ - response_len = *response++; - if (response_len != MS_CHAP_RESPONSE_LEN) - goto bad; + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP_RESPONSE_LEN]; + int diff; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(name); + + challenge_len = *challenge++; /* skip length, is 8 */ + response_len = *response++; + if (response_len != MS_CHAP_RESPONSE_LEN) + goto bad; #ifndef MSLANMAN - if (!response[MS_CHAP_USENT]) { - /* Should really propagate this into the error packet. */ - ppp_notice("Peer request for LANMAN auth not supported"); - goto bad; - } + if (!response[MS_CHAP_USENT]) { + /* Should really propagate this into the error packet. */ + ppp_notice("Peer request for LANMAN auth not supported"); + goto bad; + } #endif - /* Generate the expected response. */ - ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); + /* Generate the expected response. */ + ChapMS(pcb, (const u_char *)challenge, (const char *)secret, secret_len, md); #ifdef MSLANMAN - /* Determine which part of response to verify against */ - if (!response[MS_CHAP_USENT]) - diff = memcmp(&response[MS_CHAP_LANMANRESP], - &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); - else + /* Determine which part of response to verify against */ + if (!response[MS_CHAP_USENT]) + diff = memcmp(&response[MS_CHAP_LANMANRESP], + &md[MS_CHAP_LANMANRESP], MS_CHAP_LANMANRESP_LEN); + else #endif - diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], - MS_CHAP_NTRESP_LEN); + diff = memcmp(&response[MS_CHAP_NTRESP], &md[MS_CHAP_NTRESP], + MS_CHAP_NTRESP_LEN); - if (diff == 0) { - ppp_slprintf(message, message_space, "Access granted"); - return 1; - } + if (diff == 0) { + ppp_slprintf(message, message_space, "Access granted"); + return 1; + } bad: - /* See comments below for MS-CHAP V2 */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", - challenge_len, challenge); - return 0; + /* See comments below for MS-CHAP V2 */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0", + challenge_len, challenge); + return 0; } static int chapms2_verify_response(ppp_pcb *pcb, int id, const char *name, - const unsigned char *secret, int secret_len, - const unsigned char *challenge, const unsigned char *response, - char *message, int message_space) { - unsigned char md[MS_CHAP2_RESPONSE_LEN]; - char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; - int challenge_len, response_len; - LWIP_UNUSED_ARG(id); - - challenge_len = *challenge++; /* skip length, is 16 */ - response_len = *response++; - if (response_len != MS_CHAP2_RESPONSE_LEN) - goto bad; /* not even the right length */ - - /* Generate the expected response and our mutual auth. */ - ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, - (const char *)secret, secret_len, md, - (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); - - /* compare MDs and send the appropriate status */ - /* - * Per RFC 2759, success message must be formatted as - * "S= M=" - * where - * is the Authenticator Response (mutual auth) - * is a text message - * - * However, some versions of Windows (win98 tested) do not know - * about the M= part (required per RFC 2759) and flag - * it as an error (reported incorrectly as an encryption error - * to the user). Since the RFC requires it, and it can be - * useful information, we supply it if the peer is a conforming - * system. Luckily (?), win98 sets the Flags field to 0x04 - * (contrary to RFC requirements) so we can use that to - * distinguish between conforming and non-conforming systems. - * - * Special thanks to Alex Swiridov for - * help debugging this. - */ - if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], - MS_CHAP2_NTRESP_LEN) == 0) { - if (response[MS_CHAP2_FLAGS]) - ppp_slprintf(message, message_space, "S=%s", saresponse); - else - ppp_slprintf(message, message_space, "S=%s M=%s", - saresponse, "Access granted"); - return 1; - } + const unsigned char *secret, int secret_len, + const unsigned char *challenge, const unsigned char *response, + char *message, int message_space) { + unsigned char md[MS_CHAP2_RESPONSE_LEN]; + char saresponse[MS_AUTH_RESPONSE_LENGTH+1]; + int challenge_len, response_len; + LWIP_UNUSED_ARG(id); + + challenge_len = *challenge++; /* skip length, is 16 */ + response_len = *response++; + if (response_len != MS_CHAP2_RESPONSE_LEN) + goto bad; /* not even the right length */ + + /* Generate the expected response and our mutual auth. */ + ChapMS2(pcb, (const u_char*)challenge, (const u_char*)&response[MS_CHAP2_PEER_CHALLENGE], name, + (const char *)secret, secret_len, md, + (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR); + + /* compare MDs and send the appropriate status */ + /* + * Per RFC 2759, success message must be formatted as + * "S= M=" + * where + * is the Authenticator Response (mutual auth) + * is a text message + * + * However, some versions of Windows (win98 tested) do not know + * about the M= part (required per RFC 2759) and flag + * it as an error (reported incorrectly as an encryption error + * to the user). Since the RFC requires it, and it can be + * useful information, we supply it if the peer is a conforming + * system. Luckily (?), win98 sets the Flags field to 0x04 + * (contrary to RFC requirements) so we can use that to + * distinguish between conforming and non-conforming systems. + * + * Special thanks to Alex Swiridov for + * help debugging this. + */ + if (memcmp(&md[MS_CHAP2_NTRESP], &response[MS_CHAP2_NTRESP], + MS_CHAP2_NTRESP_LEN) == 0) { + if (response[MS_CHAP2_FLAGS]) + ppp_slprintf(message, message_space, "S=%s", saresponse); + else + ppp_slprintf(message, message_space, "S=%s M=%s", + saresponse, "Access granted"); + return 1; + } bad: - /* - * Failure message must be formatted as - * "E=e R=r C=c V=v M=m" - * where - * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) - * r = retry (we use 1, ok to retry) - * c = challenge to use for next response, we reuse previous - * v = Change Password version supported, we use 0 - * m = text message - * - * The M=m part is only for MS-CHAPv2. Neither win2k nor - * win98 (others untested) display the message to the user anyway. - * They also both ignore the E=e code. - * - * Note that it's safe to reuse the same challenge as we don't - * actually accept another response based on the error message - * (and no clients try to resend a response anyway). - * - * Basically, this whole bit is useless code, even the small - * implementation here is only because of overspecification. - */ - ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", - challenge_len, challenge, "Access denied"); - return 0; + /* + * Failure message must be formatted as + * "E=e R=r C=c V=v M=m" + * where + * e = error code (we use 691, ERROR_AUTHENTICATION_FAILURE) + * r = retry (we use 1, ok to retry) + * c = challenge to use for next response, we reuse previous + * v = Change Password version supported, we use 0 + * m = text message + * + * The M=m part is only for MS-CHAPv2. Neither win2k nor + * win98 (others untested) display the message to the user anyway. + * They also both ignore the E=e code. + * + * Note that it's safe to reuse the same challenge as we don't + * actually accept another response based on the error message + * (and no clients try to resend a response anyway). + * + * Basically, this whole bit is useless code, even the small + * implementation here is only because of overspecification. + */ + ppp_slprintf(message, message_space, "E=691 R=1 C=%0.*B V=0 M=%s", + challenge_len, challenge, "Access denied"); + return 0; } #endif /* PPP_SERVER */ static void chapms_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - LWIP_UNUSED_ARG(our_name); - LWIP_UNUSED_ARG(private_); - challenge++; /* skip length, should be 8 */ - *response++ = MS_CHAP_RESPONSE_LEN; - ChapMS(pcb, challenge, secret, secret_len, response); + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(our_name); + LWIP_UNUSED_ARG(private_); + challenge++; /* skip length, should be 8 */ + *response++ = MS_CHAP_RESPONSE_LEN; + ChapMS(pcb, challenge, secret, secret_len, response); } static void chapms2_make_response(ppp_pcb *pcb, unsigned char *response, int id, const char *our_name, - const unsigned char *challenge, const char *secret, int secret_len, - unsigned char *private_) { - LWIP_UNUSED_ARG(id); - challenge++; /* skip length, should be 16 */ - *response++ = MS_CHAP2_RESPONSE_LEN; - ChapMS2(pcb, challenge, + const unsigned char *challenge, const char *secret, int secret_len, + unsigned char *private_) { + LWIP_UNUSED_ARG(id); + challenge++; /* skip length, should be 16 */ + *response++ = MS_CHAP2_RESPONSE_LEN; + ChapMS2(pcb, challenge, #ifdef DEBUGMPPEKEY - mschap2_peer_challenge, + mschap2_peer_challenge, #else - NULL, + NULL, #endif - our_name, secret, secret_len, response, private_, - MS_CHAP2_AUTHENTICATEE); + our_name, secret, secret_len, response, private_, + MS_CHAP2_AUTHENTICATEE); } static int chapms2_check_success(ppp_pcb *pcb, unsigned char *msg, int len, unsigned char *private_) { - LWIP_UNUSED_ARG(pcb); - - if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || - strncmp((char *)msg, "S=", 2) != 0) { - /* Packet does not start with "S=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - msg += 2; - len -= 2; - if (len < MS_AUTH_RESPONSE_LENGTH - || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { - /* Authenticator Response did not match expected. */ - ppp_error("MS-CHAPv2 mutual authentication failed."); - return 0; - } - /* Authenticator Response matches. */ - msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ - len -= MS_AUTH_RESPONSE_LENGTH; - if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { - msg += 3; /* Eat the delimiter */ - } else if (len) { - /* Packet has extra text which does not begin " M=" */ - ppp_error("MS-CHAPv2 Success packet is badly formed."); - return 0; - } - return 1; + LWIP_UNUSED_ARG(pcb); + + if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || + strncmp((char *)msg, "S=", 2) != 0) { + /* Packet does not start with "S=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + msg += 2; + len -= 2; + if (len < MS_AUTH_RESPONSE_LENGTH + || memcmp(msg, private_, MS_AUTH_RESPONSE_LENGTH)) { + /* Authenticator Response did not match expected. */ + ppp_error("MS-CHAPv2 mutual authentication failed."); + return 0; + } + /* Authenticator Response matches. */ + msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */ + len -= MS_AUTH_RESPONSE_LENGTH; + if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) { + msg += 3; /* Eat the delimiter */ + } else if (len) { + /* Packet has extra text which does not begin " M=" */ + ppp_error("MS-CHAPv2 Success packet is badly formed."); + return 0; + } + return 1; } static void chapms_handle_failure(ppp_pcb *pcb, unsigned char *inp, int len) { - int err; - const char *p; - char msg[64]; - LWIP_UNUSED_ARG(pcb); - - /* We want a null-terminated string for strxxx(). */ - len = LWIP_MIN(len, 63); - MEMCPY(msg, inp, len); - msg[len] = 0; - p = msg; - - /* - * Deal with MS-CHAP formatted failure messages; just print the - * M= part (if any). For MS-CHAP we're not really supposed - * to use M=, but it shouldn't hurt. See - * chapms[2]_verify_response. - */ - if (!strncmp(p, "E=", 2)) - err = strtol(p+2, NULL, 10); /* Remember the error code. */ - else - goto print_msg; /* Message is badly formatted. */ - - if (len && ((p = strstr(p, " M=")) != NULL)) { - /* M= field found. */ - p += 3; - } else { - /* No M=; use the error code. */ - switch (err) { - case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: - p = "E=646 Restricted logon hours"; - break; - - case MS_CHAP_ERROR_ACCT_DISABLED: - p = "E=647 Account disabled"; - break; - - case MS_CHAP_ERROR_PASSWD_EXPIRED: - p = "E=648 Password expired"; - break; - - case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: - p = "E=649 No dialin permission"; - break; - - case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: - p = "E=691 Authentication failure"; - break; - - case MS_CHAP_ERROR_CHANGING_PASSWORD: - /* Should never see this, we don't support Change Password. */ - p = "E=709 Error changing password"; - break; - - default: - ppp_error("Unknown MS-CHAP authentication failure: %.*v", - len, inp); - return; - } - } + int err; + const char *p; + char msg[64]; + LWIP_UNUSED_ARG(pcb); + + /* We want a null-terminated string for strxxx(). */ + len = LWIP_MIN(len, 63); + MEMCPY(msg, inp, len); + msg[len] = 0; + p = msg; + + /* + * Deal with MS-CHAP formatted failure messages; just print the + * M= part (if any). For MS-CHAP we're not really supposed + * to use M=, but it shouldn't hurt. See + * chapms[2]_verify_response. + */ + if (!strncmp(p, "E=", 2)) + err = strtol(p+2, NULL, 10); /* Remember the error code. */ + else + goto print_msg; /* Message is badly formatted. */ + + if (len && ((p = strstr(p, " M=")) != NULL)) { + /* M= field found. */ + p += 3; + } else { + /* No M=; use the error code. */ + switch (err) { + case MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS: + p = "E=646 Restricted logon hours"; + break; + + case MS_CHAP_ERROR_ACCT_DISABLED: + p = "E=647 Account disabled"; + break; + + case MS_CHAP_ERROR_PASSWD_EXPIRED: + p = "E=648 Password expired"; + break; + + case MS_CHAP_ERROR_NO_DIALIN_PERMISSION: + p = "E=649 No dialin permission"; + break; + + case MS_CHAP_ERROR_AUTHENTICATION_FAILURE: + p = "E=691 Authentication failure"; + break; + + case MS_CHAP_ERROR_CHANGING_PASSWORD: + /* Should never see this, we don't support Change Password. */ + p = "E=709 Error changing password"; + break; + + default: + ppp_error("Unknown MS-CHAP authentication failure: %.*v", + len, inp); + return; + } + } print_msg: - if (p != NULL) - ppp_error("MS-CHAP authentication failed: %v", p); + if (p != NULL) + ppp_error("MS-CHAP authentication failed: %v", p); } static void ChallengeResponse(const u_char *challenge, - const u_char PasswordHash[MD4_SIGNATURE_SIZE], - u_char response[24]) { + const u_char PasswordHash[MD4_SIGNATURE_SIZE], + u_char response[24]) { u_char ZPasswordHash[21]; lwip_des_context des; u_char des_key[8]; @@ -505,7 +505,7 @@ static void ChallengeResponse(const u_char *challenge, #if 0 dbglog("ChallengeResponse - ZPasswordHash %.*B", - sizeof(ZPasswordHash), ZPasswordHash); + sizeof(ZPasswordHash), ZPasswordHash); #endif pppcrypt_56_to_64_bit_key(ZPasswordHash + 0, des_key); @@ -532,16 +532,16 @@ static void ChallengeResponse(const u_char *challenge, } static void ChallengeHash(const u_char PeerChallenge[16], const u_char *rchallenge, - const char *username, u_char Challenge[8]) { - lwip_sha1_context sha1Context; - u_char sha1Hash[SHA1_SIGNATURE_SIZE]; - const char *user; + const char *username, u_char Challenge[8]) { + lwip_sha1_context sha1Context; + u_char sha1Hash[SHA1_SIGNATURE_SIZE]; + const char *user; /* remove domain from "domain\username" */ if ((user = strrchr(username, '\\')) != NULL) - ++user; + ++user; else - user = username; + user = username; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -566,11 +566,11 @@ static void ascii2unicode(const char ascii[], int ascii_len, u_char unicode[]) { BZERO(unicode, ascii_len * 2); for (i = 0; i < ascii_len; i++) - unicode[i * 2] = (u_char) ascii[i]; + unicode[i * 2] = (u_char) ascii[i]; } static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE]) { - lwip_md4_context md4Context; + lwip_md4_context md4Context; lwip_md4_init(&md4Context); lwip_md4_starts(&md4Context); @@ -580,9 +580,9 @@ static void NTPasswordHash(u_char *secret, int secret_len, u_char hash[MD4_SIGNA } static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_len, - u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; /* Hash the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -592,10 +592,10 @@ static void ChapMS_NT(const u_char *rchallenge, const char *secret, int secret_l } static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], const char *username, - const char *secret, int secret_len, u_char NTResponse[24]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char Challenge[8]; + const char *secret, int secret_len, u_char NTResponse[24]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char Challenge[8]; ChallengeHash(PeerChallenge, rchallenge, username, Challenge); @@ -610,10 +610,10 @@ static void ChapMS2_NT(const u_char *rchallenge, const u_char PeerChallenge[16], static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, - unsigned char *response) { - int i; - u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ - u_char PasswordHash[MD4_SIGNATURE_SIZE]; + unsigned char *response) { + int i; + u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ + u_char PasswordHash[MD4_SIGNATURE_SIZE]; lwip_des_context des; u_char des_key[8]; @@ -640,28 +640,28 @@ static void ChapMS_LANMan(u_char *rchallenge, char *secret, int secret_len, static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGNATURE_SIZE], - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { /* * "Magic" constants used in response generation, from RFC 2759. */ static const u_char Magic1[39] = /* "Magic server to client signing constant" */ - { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, - 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, - 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; + { 0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65, + 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67, + 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74 }; static const u_char Magic2[41] = /* "Pad to make it do more than one iteration" */ - { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, - 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, - 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, - 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, - 0x6E }; + { 0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B, + 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F, + 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E, + 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F, + 0x6E }; - int i; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; - u_char Challenge[8]; + int i; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; + u_char Challenge[8]; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); @@ -683,27 +683,27 @@ static void GenerateAuthenticatorResponse(const u_char PasswordHashHash[MD4_SIGN /* Convert to ASCII hex string. */ for (i = 0; i < LWIP_MAX((MS_AUTH_RESPONSE_LENGTH / 2), (int)sizeof(Digest)); i++) - sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); + sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]); } static void GenerateAuthenticatorResponsePlain( - const char *secret, int secret_len, - u_char NTResponse[24], const u_char PeerChallenge[16], - const u_char *rchallenge, const char *username, - u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + const char *secret, int secret_len, + u_char NTResponse[24], const u_char PeerChallenge[16], + const u_char *rchallenge, const char *username, + u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]) { + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash); NTPasswordHash(PasswordHash, sizeof(PasswordHash), - PasswordHashHash); + PasswordHashHash); GenerateAuthenticatorResponse(PasswordHashHash, NTResponse, PeerChallenge, - rchallenge, username, authResponse); + rchallenge, username, authResponse); } @@ -712,11 +712,11 @@ static void GenerateAuthenticatorResponsePlain( * Set mppe_xxxx_key from MS-CHAP credentials. (see RFC 3079) */ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, int secret_len) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -742,43 +742,43 @@ static void Set_Start_Key(ppp_pcb *pcb, const u_char *rchallenge, const char *se * Set mppe_xxxx_key from MS-CHAPv2 credentials. (see RFC 3079) */ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_char NTResponse[24], int IsServer) { - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; - lwip_sha1_context sha1Context; - u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ - u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char unicodePassword[MAX_NT_PASSWORD * 2]; + u_char PasswordHash[MD4_SIGNATURE_SIZE]; + u_char PasswordHashHash[MD4_SIGNATURE_SIZE]; + lwip_sha1_context sha1Context; + u_char MasterKey[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ + u_char Digest[SHA1_SIGNATURE_SIZE]; /* >= MPPE_MAX_KEY_LEN */ const u_char *s; /* "This is the MPPE Master Key" */ static const u_char Magic1[27] = - { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; + { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79 }; /* "On the client side, this is the send key; " "on the server side, it is the receive key." */ static const u_char Magic2[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, - 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, - 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79, + 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65, + 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* "On the client side, this is the receive key; " "on the server side, it is the send key." */ static const u_char Magic3[84] = - { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, - 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, - 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, - 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, - 0x6b, 0x65, 0x79, 0x2e }; + { 0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20, + 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, + 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, + 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, + 0x6b, 0x65, 0x79, 0x2e }; /* Hash (x2) the Unicode version of the secret (== password). */ ascii2unicode(secret, secret_len, unicodePassword); @@ -797,9 +797,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate send key */ if (IsServer) - s = Magic3; + s = Magic3; else - s = Magic2; + s = Magic2; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -815,9 +815,9 @@ static void SetMasterKeys(ppp_pcb *pcb, const char *secret, int secret_len, u_ch * generate recv key */ if (IsServer) - s = Magic2; + s = Magic2; else - s = Magic3; + s = Magic3; lwip_sha1_init(&sha1Context); lwip_sha1_starts(&sha1Context); lwip_sha1_update(&sha1Context, MasterKey, 16); @@ -846,7 +846,7 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i #ifdef MSLANMAN ChapMS_LANMan(rchallenge, secret, secret_len, - &response[MS_CHAP_LANMANRESP]); + &response[MS_CHAP_LANMANRESP]); /* preferred method is set by option */ response[MS_CHAP_USENT] = !ms_lanman; @@ -871,8 +871,8 @@ static void ChapMS(ppp_pcb *pcb, const u_char *rchallenge, const char *secret, i * Authenticator Response. */ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerChallenge, - const char *user, const char *secret, int secret_len, unsigned char *response, - u_char authResponse[], int authenticator) { + const char *user, const char *secret, int secret_len, unsigned char *response, + u_char authResponse[], int authenticator) { /* ARGSUSED */ LWIP_UNUSED_ARG(authenticator); #if !MPPE_SUPPORT @@ -883,24 +883,24 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh /* Generate the Peer-Challenge if requested, or copy it if supplied. */ if (!PeerChallenge) - magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); + magic_random_bytes(&response[MS_CHAP2_PEER_CHALLENGE], MS_CHAP2_PEER_CHAL_LEN); else - MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, - MS_CHAP2_PEER_CHAL_LEN); + MEMCPY(&response[MS_CHAP2_PEER_CHALLENGE], PeerChallenge, + MS_CHAP2_PEER_CHAL_LEN); /* Generate the NT-Response */ ChapMS2_NT(rchallenge, &response[MS_CHAP2_PEER_CHALLENGE], user, - secret, secret_len, &response[MS_CHAP2_NTRESP]); + secret, secret_len, &response[MS_CHAP2_NTRESP]); /* Generate the Authenticator Response. */ GenerateAuthenticatorResponsePlain(secret, secret_len, - &response[MS_CHAP2_NTRESP], - &response[MS_CHAP2_PEER_CHALLENGE], - rchallenge, user, authResponse); + &response[MS_CHAP2_NTRESP], + &response[MS_CHAP2_PEER_CHALLENGE], + rchallenge, user, authResponse); #if MPPE_SUPPORT SetMasterKeys(pcb, secret, secret_len, - &response[MS_CHAP2_NTRESP], authenticator); + &response[MS_CHAP2_NTRESP], authenticator); #endif /* MPPE_SUPPORT */ } @@ -912,51 +912,51 @@ static void ChapMS2(ppp_pcb *pcb, const u_char *rchallenge, const u_char *PeerCh void set_mppe_enc_types(int policy, int types) { /* Early exit for unknown policies. */ if (policy != MPPE_ENC_POL_ENC_ALLOWED || - policy != MPPE_ENC_POL_ENC_REQUIRED) - return; + policy != MPPE_ENC_POL_ENC_REQUIRED) + return; /* Don't modify MPPE if it's optional and wasn't already configured. */ if (policy == MPPE_ENC_POL_ENC_ALLOWED && !ccp_wantoptions[0].mppe) - return; + return; /* * Disable undesirable encryption types. Note that we don't ENABLE * any encryption types, to avoid overriding manual configuration. */ switch(types) { - case MPPE_ENC_TYPES_RC4_40: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ - break; - case MPPE_ENC_TYPES_RC4_128: - ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ - break; - default: - break; + case MPPE_ENC_TYPES_RC4_40: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */ + break; + case MPPE_ENC_TYPES_RC4_128: + ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */ + break; + default: + break; } } #endif /* MPPE_SUPPORT */ #endif /* UNUSED */ const struct chap_digest_type chapms_digest = { - CHAP_MICROSOFT, /* code */ + CHAP_MICROSOFT, /* code */ #if PPP_SERVER - chapms_generate_challenge, - chapms_verify_response, + chapms_generate_challenge, + chapms_verify_response, #endif /* PPP_SERVER */ - chapms_make_response, - NULL, /* check_success */ - chapms_handle_failure, + chapms_make_response, + NULL, /* check_success */ + chapms_handle_failure, }; const struct chap_digest_type chapms2_digest = { - CHAP_MICROSOFT_V2, /* code */ + CHAP_MICROSOFT_V2, /* code */ #if PPP_SERVER - chapms2_generate_challenge, - chapms2_verify_response, + chapms2_generate_challenge, + chapms2_verify_response, #endif /* PPP_SERVER */ - chapms2_make_response, - chapms2_check_success, - chapms_handle_failure, + chapms2_make_response, + chapms2_check_success, + chapms_handle_failure, }; #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/demand.c b/components/net/lwip-2.1.2/src/netif/ppp/demand.c index f3774e087c..26c6c30db1 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/demand.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/demand.c @@ -87,11 +87,11 @@ demand_conf() /* framemax = lcp_allowoptions[0].mru; if (framemax < PPP_MRU) */ - framemax = PPP_MRU; + framemax = PPP_MRU; framemax += PPP_HDRLEN + PPP_FCSLEN; frame = malloc(framemax); if (frame == NULL) - novm("demand frame"); + novm("demand frame"); framelen = 0; pend_q = NULL; escape_flag = 0; @@ -100,8 +100,8 @@ demand_conf() netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) - fatal("Couldn't set up demand-dialled PPP interface: %m"); + || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) + fatal("Couldn't set up demand-dialled PPP interface: %m"); #ifdef PPP_FILTER set_filters(&pass_filter, &active_filter); @@ -111,12 +111,12 @@ demand_conf() * Call the demand_conf procedure for each protocol that's got one. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - ((*protp->demand_conf)(pcb)); + if (protp->demand_conf != NULL) + ((*protp->demand_conf)(pcb)); /* FIXME: find a way to die() here */ #if 0 - if (!((*protp->demand_conf)(pcb))) - die(1); + if (!((*protp->demand_conf)(pcb))) + die(1); #endif } @@ -131,8 +131,8 @@ demand_block() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); get_loop_output(); } @@ -148,14 +148,14 @@ demand_discard() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); get_loop_output(); /* discard all saved packets */ for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - free(pkt); + nextpkt = pkt->next; + free(pkt); } pend_q = NULL; framelen = 0; @@ -174,46 +174,46 @@ demand_unblock() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->demand_conf != NULL) - sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); + if (protp->demand_conf != NULL) + sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); } /* * FCS lookup table as calculated by genfcstab. */ static u_short fcstab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /* @@ -238,35 +238,35 @@ loop_chars(p, n) } for (; n > 0; --n) { - c = *p++; - if (c == PPP_FLAG) { - if (!escape_flag && !flush_flag - && framelen > 2 && fcs == PPP_GOODFCS) { - framelen -= 2; - if (loop_frame((unsigned char *)frame, framelen)) - rv = 1; - } - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; - continue; - } - if (flush_flag) - continue; - if (escape_flag) { - c ^= PPP_TRANS; - escape_flag = 0; - } else if (c == PPP_ESCAPE) { - escape_flag = 1; - continue; - } - if (framelen >= framemax) { - flush_flag = 1; - continue; - } - frame[framelen++] = c; - fcs = PPP_FCS(fcs, c); + c = *p++; + if (c == PPP_FLAG) { + if (!escape_flag && !flush_flag + && framelen > 2 && fcs == PPP_GOODFCS) { + framelen -= 2; + if (loop_frame((unsigned char *)frame, framelen)) + rv = 1; + } + framelen = 0; + flush_flag = 0; + escape_flag = 0; + fcs = PPP_INITFCS; + continue; + } + if (flush_flag) + continue; + if (escape_flag) { + c ^= PPP_TRANS; + escape_flag = 0; + } else if (c == PPP_ESCAPE) { + escape_flag = 1; + continue; + } + if (framelen >= framemax) { + flush_flag = 1; + continue; + } + frame[framelen++] = c; + fcs = PPP_FCS(fcs, c); } return rv; } @@ -290,22 +290,22 @@ loop_frame(frame, len) /* dbglog("from loop: %P", frame, len); */ if (len < PPP_HDRLEN) - return 0; + return 0; if ((PPP_PROTOCOL(frame) & 0x8000) != 0) - return 0; /* shouldn't get any of these anyway */ + return 0; /* shouldn't get any of these anyway */ if (!active_packet(frame, len)) - return 0; + return 0; pkt = (struct packet *) malloc(sizeof(struct packet) + len); if (pkt != NULL) { - pkt->length = len; - pkt->next = NULL; - memcpy(pkt->data, frame, len); - if (pend_q == NULL) - pend_q = pkt; - else - pend_qtail->next = pkt; - pend_qtail = pkt; + pkt->length = len; + pkt->next = NULL; + memcpy(pkt->data, frame, len); + if (pend_q == NULL) + pend_q = pkt; + else + pend_qtail->next = pkt; + pend_qtail = pkt; } return 1; } @@ -332,23 +332,23 @@ demand_rexmit(proto, newip) pend_q = NULL; tv.tv_sec = 1; tv.tv_usec = 0; - select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ + select(0,NULL,NULL,NULL,&tv); /* Sleep for 1 Seconds */ for (; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - if (PPP_PROTOCOL(pkt->data) == proto) { + nextpkt = pkt->next; + if (PPP_PROTOCOL(pkt->data) == proto) { if ( (proto == PPP_IP) && newip ) { - /* Get old checksum */ + /* Get old checksum */ - iphdr = (pkt->data[4] & 15) << 2; - checksum = *((unsigned short *) (pkt->data+14)); + iphdr = (pkt->data[4] & 15) << 2; + checksum = *((unsigned short *) (pkt->data+14)); if (checksum == 0xFFFF) { checksum = 0; } - + if (pkt->data[13] == 17) { pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr)); - if (pkt_checksum) { + if (pkt_checksum) { cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; @@ -359,71 +359,71 @@ demand_rexmit(proto, newip) } } - if (pkt->data[13] == 6) { - pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); - cv = 1; + if (pkt->data[13] == 6) { + pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr)); + cv = 1; if (pkt_checksum == 0xFFFF) { pkt_checksum = 0; } - } + } - /* Delete old Source-IP-Address */ + /* Delete old Source-IP-Address */ checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; - pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; + pkt_checksum -= *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Change Source-IP-Address */ + /* Change Source-IP-Address */ * ((u32_t *) (pkt->data + 16)) = newip; - /* Add new Source-IP-Address */ + /* Add new Source-IP-Address */ checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+16)) ^ 0xFFFF; pkt_checksum += *((unsigned short *) (pkt->data+18)) ^ 0xFFFF; - /* Write new checksum */ + /* Write new checksum */ if (!checksum) { checksum = 0xFFFF; } *((unsigned short *) (pkt->data+14)) = checksum; - if (pkt->data[13] == 6) { - *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; - } - if (cv && (pkt->data[13] == 17) ) { - *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; - } - - /* Log Packet */ - strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); - if (pkt->data[13] == 1) { - syslog(LOG_INFO,"Open ICMP %s -> %s\n", - ipstr, - inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); - } else { - syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", - pkt->data[13] == 6 ? "TCP" : "UDP", - ipstr, - ntohs(*( (short *) (pkt->data+iphdr+4))), - inet_ntoa(*( (struct in_addr *) (pkt->data+20))), - ntohs(*( (short *) (pkt->data+iphdr+6)))); + if (pkt->data[13] == 6) { + *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum; + } + if (cv && (pkt->data[13] == 17) ) { + *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum; + } + + /* Log Packet */ + strcpy(ipstr,inet_ntoa(*( (struct in_addr *) (pkt->data+16)))); + if (pkt->data[13] == 1) { + syslog(LOG_INFO,"Open ICMP %s -> %s\n", + ipstr, + inet_ntoa(*( (struct in_addr *) (pkt->data+20)))); + } else { + syslog(LOG_INFO,"Open %s %s:%d -> %s:%d\n", + pkt->data[13] == 6 ? "TCP" : "UDP", + ipstr, + ntohs(*( (short *) (pkt->data+iphdr+4))), + inet_ntoa(*( (struct in_addr *) (pkt->data+20))), + ntohs(*( (short *) (pkt->data+iphdr+6)))); } } - output(pcb, pkt->data, pkt->length); - free(pkt); - } else { - if (prev == NULL) - pend_q = pkt; - else - prev->next = pkt; - prev = pkt; - } + output(pcb, pkt->data, pkt->length); + free(pkt); + } else { + if (prev == NULL) + pend_q = pkt; + else + prev->next = pkt; + prev = pkt; + } } pend_qtail = prev; if (prev != NULL) - prev->next = NULL; + prev->next = NULL; } /* @@ -439,27 +439,27 @@ active_packet(p, len) const struct protent *protp; if (len < PPP_HDRLEN) - return 0; + return 0; proto = PPP_PROTOCOL(p); #ifdef PPP_FILTER - p[0] = 1; /* outbound packet indicator */ + p[0] = 1; /* outbound packet indicator */ if ((pass_filter.bf_len != 0 - && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) - || (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { - p[0] = 0xff; - return 0; + && bpf_filter(pass_filter.bf_insns, p, len, len) == 0) + || (active_filter.bf_len != 0 + && bpf_filter(active_filter.bf_insns, p, len, len) == 0)) { + p[0] = 0xff; + return 0; } p[0] = 0xff; #endif for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (protp->active_pkt == NULL) - return 1; - return (*protp->active_pkt)(p, len); - } + if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { + if (protp->active_pkt == NULL) + return 1; + return (*protp->active_pkt)(p, len); + } } - return 0; /* not a supported protocol !!?? */ + return 0; /* not a supported protocol !!?? */ } #endif /* PPP_SUPPORT && DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/eap.c b/components/net/lwip-2.1.2/src/netif/ppp/eap.c index 8ca53d2a0d..8fb56368e7 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/eap.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/eap.c @@ -58,11 +58,11 @@ #endif /* USE_SRP */ #ifndef SHA_DIGESTSIZE -#define SHA_DIGESTSIZE 20 +#define SHA_DIGESTSIZE 20 #endif #ifdef USE_SRP -static char *pn_secret = NULL; /* Pseudonym generating secret */ +static char *pn_secret = NULL; /* Pseudonym generating secret */ #endif #if PPP_OPTIONS @@ -106,31 +106,31 @@ static int eap_printpkt(const u_char *inp, int inlen, #endif /* PRINTPKT_SUPPORT */ const struct protent eap_protent = { - PPP_EAP, /* protocol number */ - eap_init, /* initialization procedure */ - eap_input, /* process a received packet */ - eap_protrej, /* process a received protocol-reject */ - eap_lowerup, /* lower layer has gone up */ - eap_lowerdown, /* lower layer has gone down */ - NULL, /* open the protocol */ - NULL, /* close the protocol */ + PPP_EAP, /* protocol number */ + eap_init, /* initialization procedure */ + eap_input, /* process a received packet */ + eap_protrej, /* process a received protocol-reject */ + eap_lowerup, /* lower layer has gone up */ + eap_lowerdown, /* lower layer has gone down */ + NULL, /* open the protocol */ + NULL, /* close the protocol */ #if PRINTPKT_SUPPORT - eap_printpkt, /* print a packet in readable form */ + eap_printpkt, /* print a packet in readable form */ #endif /* PRINTPKT_SUPPORT */ #if PPP_DATAINPUT - NULL, /* process a received data packet */ + NULL, /* process a received data packet */ #endif /* PPP_DATAINPUT */ #if PRINTPKT_SUPPORT - "EAP", /* text name of protocol */ - NULL, /* text name of corresponding data protocol */ + "EAP", /* text name of protocol */ + NULL, /* text name of corresponding data protocol */ #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS - eap_option_list, /* list of command-line options */ - NULL, /* check requested options; assign defaults */ + eap_option_list, /* list of command-line options */ + NULL, /* check requested options; assign defaults */ #endif /* PPP_OPTIONS */ #if DEMAND_SUPPORT - NULL, /* configure interface for demand-dial */ - NULL /* say whether to bring up link for this pkt */ + NULL, /* configure interface for demand-dial */ + NULL /* say whether to bring up link for this pkt */ #endif /* DEMAND_SUPPORT */ }; @@ -139,38 +139,38 @@ const struct protent eap_protent = { * A well-known 2048 bit modulus. */ static const u_char wkmodulus[] = { - 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, - 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, - 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, - 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, - 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, - 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, - 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, - 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, - 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, - 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, - 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, - 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, - 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, - 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, - 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, - 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, - 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, - 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, - 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, - 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, - 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, - 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, - 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, - 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, - 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, - 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, - 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, - 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, - 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, - 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, - 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, - 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 + 0xAC, 0x6B, 0xDB, 0x41, 0x32, 0x4A, 0x9A, 0x9B, + 0xF1, 0x66, 0xDE, 0x5E, 0x13, 0x89, 0x58, 0x2F, + 0xAF, 0x72, 0xB6, 0x65, 0x19, 0x87, 0xEE, 0x07, + 0xFC, 0x31, 0x92, 0x94, 0x3D, 0xB5, 0x60, 0x50, + 0xA3, 0x73, 0x29, 0xCB, 0xB4, 0xA0, 0x99, 0xED, + 0x81, 0x93, 0xE0, 0x75, 0x77, 0x67, 0xA1, 0x3D, + 0xD5, 0x23, 0x12, 0xAB, 0x4B, 0x03, 0x31, 0x0D, + 0xCD, 0x7F, 0x48, 0xA9, 0xDA, 0x04, 0xFD, 0x50, + 0xE8, 0x08, 0x39, 0x69, 0xED, 0xB7, 0x67, 0xB0, + 0xCF, 0x60, 0x95, 0x17, 0x9A, 0x16, 0x3A, 0xB3, + 0x66, 0x1A, 0x05, 0xFB, 0xD5, 0xFA, 0xAA, 0xE8, + 0x29, 0x18, 0xA9, 0x96, 0x2F, 0x0B, 0x93, 0xB8, + 0x55, 0xF9, 0x79, 0x93, 0xEC, 0x97, 0x5E, 0xEA, + 0xA8, 0x0D, 0x74, 0x0A, 0xDB, 0xF4, 0xFF, 0x74, + 0x73, 0x59, 0xD0, 0x41, 0xD5, 0xC3, 0x3E, 0xA7, + 0x1D, 0x28, 0x1E, 0x44, 0x6B, 0x14, 0x77, 0x3B, + 0xCA, 0x97, 0xB4, 0x3A, 0x23, 0xFB, 0x80, 0x16, + 0x76, 0xBD, 0x20, 0x7A, 0x43, 0x6C, 0x64, 0x81, + 0xF1, 0xD2, 0xB9, 0x07, 0x87, 0x17, 0x46, 0x1A, + 0x5B, 0x9D, 0x32, 0xE6, 0x88, 0xF8, 0x77, 0x48, + 0x54, 0x45, 0x23, 0xB5, 0x24, 0xB0, 0xD5, 0x7D, + 0x5E, 0xA7, 0x7A, 0x27, 0x75, 0xD2, 0xEC, 0xFA, + 0x03, 0x2C, 0xFB, 0xDB, 0xF5, 0x2F, 0xB3, 0x78, + 0x61, 0x60, 0x27, 0x90, 0x04, 0xE5, 0x7A, 0xE6, + 0xAF, 0x87, 0x4E, 0x73, 0x03, 0xCE, 0x53, 0x29, + 0x9C, 0xCC, 0x04, 0x1C, 0x7B, 0xC3, 0x08, 0xD8, + 0x2A, 0x56, 0x98, 0xF3, 0xA8, 0xD0, 0xC3, 0x82, + 0x71, 0xAE, 0x35, 0xF8, 0xE9, 0xDB, 0xFB, 0xB6, + 0x94, 0xB5, 0xC8, 0x03, 0xD8, 0x9F, 0x7A, 0xE4, + 0x35, 0xDE, 0x23, 0x6D, 0x52, 0x5F, 0x54, 0x75, + 0x9B, 0x65, 0xE3, 0x72, 0xFC, 0xD6, 0x8E, 0xF2, + 0x0F, 0xA7, 0x11, 0x1F, 0x9E, 0x4A, 0xFF, 0x73 }; #endif @@ -184,9 +184,9 @@ static void eap_server_timeout(void *arg); */ static const char * eap_state_name(enum eap_state_code esc) { - static const char *state_names[] = { EAP_STATES }; + static const char *state_names[] = { EAP_STATES }; - return (state_names[(int)esc]); + return (state_names[(int)esc]); } /* @@ -195,9 +195,9 @@ static const char * eap_state_name(enum eap_state_code esc) */ static void eap_init(ppp_pcb *pcb) { - BZERO(&pcb->eap, sizeof(eap_state)); + BZERO(&pcb->eap, sizeof(eap_state)); #if PPP_SERVER - pcb->eap.es_server.ea_id = magic(); + pcb->eap.es_server.ea_id = magic(); #endif /* PPP_SERVER */ } @@ -206,14 +206,14 @@ static void eap_init(ppp_pcb *pcb) { * Request messages. */ static void eap_client_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_client_active(pcb)) - return; + if (!eap_client_active(pcb)) + return; - ppp_error("EAP: timeout waiting for Request from peer"); - auth_withpeer_fail(pcb, PPP_EAP); - pcb->eap.es_client.ea_state = eapBadAuth; + ppp_error("EAP: timeout waiting for Request from peer"); + auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; } /* @@ -224,22 +224,22 @@ static void eap_client_timeout(void *arg) { */ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { - if(NULL == localname) - return; + if(NULL == localname) + return; - /* Save the peer name we're given */ - pcb->eap.es_client.ea_name = localname; - pcb->eap.es_client.ea_namelen = strlen(localname); + /* Save the peer name we're given */ + pcb->eap.es_client.ea_name = localname; + pcb->eap.es_client.ea_namelen = strlen(localname); - pcb->eap.es_client.ea_state = eapListen; + pcb->eap.es_client.ea_state = eapListen; - /* - * Start a timer so that if the other end just goes - * silent, we don't sit here waiting forever. - */ - if (pcb->settings.eap_req_time > 0) - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); + /* + * Start a timer so that if the other end just goes + * silent, we don't sit here waiting forever. + */ + if (pcb->settings.eap_req_time > 0) + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); } #if PPP_SERVER @@ -248,30 +248,30 @@ void eap_authwithpeer(ppp_pcb *pcb, const char *localname) { * (Server operation) */ static void eap_send_failure(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; + struct pbuf *p; + u_char *outp; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } - outp = (u_char*)p->payload; + outp = (u_char*)p->payload; - MAKEHEADER(outp, PPP_EAP); + MAKEHEADER(outp, PPP_EAP); - PUTCHAR(EAP_FAILURE, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); + PUTCHAR(EAP_FAILURE, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); - ppp_write(pcb, p); + ppp_write(pcb, p); - pcb->eap.es_server.ea_state = eapBadAuth; - auth_peer_fail(pcb, PPP_EAP); + pcb->eap.es_server.ea_state = eapBadAuth; + auth_peer_fail(pcb, PPP_EAP); } /* @@ -279,30 +279,30 @@ static void eap_send_failure(ppp_pcb *pcb) { * (Server operation) */ static void eap_send_success(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_SUCCESS, outp); - pcb->eap.es_server.ea_id++; - PUTCHAR(pcb->eap.es_server.ea_id, outp); - PUTSHORT(EAP_HEADERLEN, outp); - - ppp_write(pcb, p); - - auth_peer_success(pcb, PPP_EAP, 0, - pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); + struct pbuf *p; + u_char *outp; + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + EAP_HEADERLEN), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_SUCCESS, outp); + pcb->eap.es_server.ea_id++; + PUTCHAR(pcb->eap.es_server.ea_id, outp); + PUTSHORT(EAP_HEADERLEN, outp); + + ppp_write(pcb, p); + + auth_peer_success(pcb, PPP_EAP, 0, + pcb->eap.es_server.ea_peer, pcb->eap.es_server.ea_peerlen); } #endif /* PPP_SERVER */ @@ -314,31 +314,31 @@ static void eap_send_success(ppp_pcb *pcb) { static bool pncrypt_setkey(int timeoffs) { - struct tm *tp; - char tbuf[9]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - time_t reftime; - - if (pn_secret == NULL) - return (0); - reftime = time(NULL) + timeoffs; - tp = localtime(&reftime); - SHA1Init(&ctxt); - SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); - strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); - SHA1Update(&ctxt, tbuf, strlen(tbuf)); - SHA1Final(dig, &ctxt); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - return (DesSetkey(dig)); + struct tm *tp; + char tbuf[9]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + time_t reftime; + + if (pn_secret == NULL) + return (0); + reftime = time(NULL) + timeoffs; + tp = localtime(&reftime); + SHA1Init(&ctxt); + SHA1Update(&ctxt, pn_secret, strlen(pn_secret)); + strftime(tbuf, sizeof (tbuf), "%Y%m%d", tp); + SHA1Update(&ctxt, tbuf, strlen(tbuf)); + SHA1Final(dig, &ctxt); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + return (DesSetkey(dig)); } static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; struct b64state { - u32_t bs_bits; - int bs_offs; + u32_t bs_bits; + int bs_offs; }; static int @@ -348,23 +348,23 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - - while (inlen > 0) { - bs->bs_bits = (bs->bs_bits << 8) | *inp++; - inlen--; - bs->bs_offs += 8; - if (bs->bs_offs >= 24) { - *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; - *outp++ = base64[bs->bs_bits & 0x3F]; - outlen += 4; - bs->bs_offs = 0; - bs->bs_bits = 0; - } - } - return (outlen); + int outlen = 0; + + while (inlen > 0) { + bs->bs_bits = (bs->bs_bits << 8) | *inp++; + inlen--; + bs->bs_offs += 8; + if (bs->bs_offs >= 24) { + *outp++ = base64[(bs->bs_bits >> 18) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 12) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 6) & 0x3F]; + *outp++ = base64[bs->bs_bits & 0x3F]; + outlen += 4; + bs->bs_offs = 0; + bs->bs_bits = 0; + } + } + return (outlen); } static int @@ -372,21 +372,21 @@ b64flush(bs, outp) struct b64state *bs; u_char *outp; { - int outlen = 0; - - if (bs->bs_offs == 8) { - *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; - outlen = 2; - } else if (bs->bs_offs == 16) { - *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; - *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; - *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; - outlen = 3; - } - bs->bs_offs = 0; - bs->bs_bits = 0; - return (outlen); + int outlen = 0; + + if (bs->bs_offs == 8) { + *outp++ = base64[(bs->bs_bits >> 2) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 4) & 0x3F]; + outlen = 2; + } else if (bs->bs_offs == 16) { + *outp++ = base64[(bs->bs_bits >> 10) & 0x3F]; + *outp++ = base64[(bs->bs_bits >> 4) & 0x3F]; + *outp++ = base64[(bs->bs_bits << 2) & 0x3F]; + outlen = 3; + } + bs->bs_offs = 0; + bs->bs_bits = 0; + return (outlen); } static int @@ -396,22 +396,22 @@ u_char *inp; int inlen; u_char *outp; { - int outlen = 0; - char *cp; - - while (inlen > 0) { - if ((cp = strchr(base64, *inp++)) == NULL) - break; - bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); - inlen--; - bs->bs_offs += 6; - if (bs->bs_offs >= 8) { - *outp++ = bs->bs_bits >> (bs->bs_offs - 8); - outlen++; - bs->bs_offs -= 8; - } - } - return (outlen); + int outlen = 0; + char *cp; + + while (inlen > 0) { + if ((cp = strchr(base64, *inp++)) == NULL) + break; + bs->bs_bits = (bs->bs_bits << 6) | (cp - base64); + inlen--; + bs->bs_offs += 6; + if (bs->bs_offs >= 8) { + *outp++ = bs->bs_bits >> (bs->bs_offs - 8); + outlen++; + bs->bs_offs -= 8; + } + } + return (outlen); } #endif /* USE_SRP */ @@ -424,211 +424,211 @@ u_char *outp; */ static void eap_figure_next_state(ppp_pcb *pcb, int status) { #ifdef USE_SRP - unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; - struct t_pw tpw; - struct t_confent *tce, mytce; - char *cp, *cp2; - struct t_server *ts; - int id, i, plen, toffs; - u_char vals[2]; - struct b64state bs; + unsigned char secbuf[MAXSECRETLEN], clear[8], *sp, *dp; + struct t_pw tpw; + struct t_confent *tce, mytce; + char *cp, *cp2; + struct t_server *ts; + int id, i, plen, toffs; + u_char vals[2]; + struct b64state bs; #endif /* USE_SRP */ - pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; - switch (pcb->eap.es_server.ea_state) { - case eapBadAuth: - return; + pcb->settings.eap_timeout_time = pcb->eap.es_savedtime; + switch (pcb->eap.es_server.ea_state) { + case eapBadAuth: + return; - case eapIdentify: + case eapIdentify: #ifdef USE_SRP - /* Discard any previous session. */ - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + /* Discard any previous session. */ + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } #ifdef USE_SRP - /* If we've got a pseudonym, try to decode to real name. */ - if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && - strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, - SRP_PSEUDO_LEN) == 0 && - (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < - sizeof (secbuf)) { - BZERO(&bs, sizeof (bs)); - plen = b64dec(&bs, - pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, - pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, - secbuf); - toffs = 0; - for (i = 0; i < 5; i++) { - pncrypt_setkey(toffs); - toffs -= 86400; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesDecrypt(secbuf, clear)) { - ppp_dbglog("no DES here; cannot decode " - "pseudonym"); - return; - } - id = *(unsigned char *)clear; - if (id + 1 <= plen && id + 9 > plen) - break; - } - if (plen % 8 == 0 && i < 5) { - /* - * Note that this is always shorter than the - * original stored string, so there's no need - * to realloc. - */ - if ((i = plen = *(unsigned char *)clear) > 7) - i = 7; - pcb->eap.es_server.ea_peerlen = plen; - dp = (unsigned char *)pcb->eap.es_server.ea_peer; - MEMCPY(dp, clear + 1, i); - plen -= i; - dp += i; - sp = secbuf + 8; - while (plen > 0) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesDecrypt(sp, dp); - sp += 8; - dp += 8; - plen -= 8; - } - pcb->eap.es_server.ea_peer[ - pcb->eap.es_server.ea_peerlen] = '\0'; - ppp_dbglog("decoded pseudonym to \"%.*q\"", - pcb->eap.es_server.ea_peerlen, - pcb->eap.es_server.ea_peer); - } else { - ppp_dbglog("failed to decode real name"); - /* Stay in eapIdentfy state; requery */ - break; - } - } - /* Look up user in secrets database. */ - if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { - /* Set up default in case SRP entry is bad */ - pcb->eap.es_server.ea_state = eapMD5Chall; - /* Get t_confent based on index in srp-secrets */ - id = strtol((char *)secbuf, &cp, 10); - if (*cp++ != ':' || id < 0) - break; - if (id == 0) { - mytce.index = 0; - mytce.modulus.data = (u_char *)wkmodulus; - mytce.modulus.len = sizeof (wkmodulus); - mytce.generator.data = (u_char *)"\002"; - mytce.generator.len = 1; - tce = &mytce; - } else if ((tce = gettcid(id)) != NULL) { - /* - * Client will have to verify this modulus/ - * generator combination, and that will take - * a while. Lengthen the timeout here. - */ - if (pcb->settings.eap_timeout_time > 0 && - pcb->settings.eap_timeout_time < 30) - pcb->settings.eap_timeout_time = 30; - } else { - break; - } - if ((cp2 = strchr(cp, ':')) == NULL) - break; - *cp2++ = '\0'; - tpw.pebuf.name = pcb->eap.es_server.ea_peer; - tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, - cp); - tpw.pebuf.password.data = tpw.pwbuf; - tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, - cp2); - tpw.pebuf.salt.data = tpw.saltbuf; - if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) - break; - pcb->eap.es_server.ea_session = (void *)ts; - pcb->eap.es_server.ea_state = eapSRP1; - vals[0] = pcb->eap.es_server.ea_id + 1; - vals[1] = EAPT_SRP; - t_serveraddexdata(ts, vals, 2); - /* Generate B; must call before t_servergetkey() */ - t_servergenexp(ts); - break; - } + /* If we've got a pseudonym, try to decode to real name. */ + if (pcb->eap.es_server.ea_peerlen > SRP_PSEUDO_LEN && + strncmp(pcb->eap.es_server.ea_peer, SRP_PSEUDO_ID, + SRP_PSEUDO_LEN) == 0 && + (pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN) * 3 / 4 < + sizeof (secbuf)) { + BZERO(&bs, sizeof (bs)); + plen = b64dec(&bs, + pcb->eap.es_server.ea_peer + SRP_PSEUDO_LEN, + pcb->eap.es_server.ea_peerlen - SRP_PSEUDO_LEN, + secbuf); + toffs = 0; + for (i = 0; i < 5; i++) { + pncrypt_setkey(toffs); + toffs -= 86400; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesDecrypt(secbuf, clear)) { + ppp_dbglog("no DES here; cannot decode " + "pseudonym"); + return; + } + id = *(unsigned char *)clear; + if (id + 1 <= plen && id + 9 > plen) + break; + } + if (plen % 8 == 0 && i < 5) { + /* + * Note that this is always shorter than the + * original stored string, so there's no need + * to realloc. + */ + if ((i = plen = *(unsigned char *)clear) > 7) + i = 7; + pcb->eap.es_server.ea_peerlen = plen; + dp = (unsigned char *)pcb->eap.es_server.ea_peer; + MEMCPY(dp, clear + 1, i); + plen -= i; + dp += i; + sp = secbuf + 8; + while (plen > 0) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesDecrypt(sp, dp); + sp += 8; + dp += 8; + plen -= 8; + } + pcb->eap.es_server.ea_peer[ + pcb->eap.es_server.ea_peerlen] = '\0'; + ppp_dbglog("decoded pseudonym to \"%.*q\"", + pcb->eap.es_server.ea_peerlen, + pcb->eap.es_server.ea_peer); + } else { + ppp_dbglog("failed to decode real name"); + /* Stay in eapIdentfy state; requery */ + break; + } + } + /* Look up user in secrets database. */ + if (get_srp_secret(pcb->eap.es_unit, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_name, (char *)secbuf, 1) != 0) { + /* Set up default in case SRP entry is bad */ + pcb->eap.es_server.ea_state = eapMD5Chall; + /* Get t_confent based on index in srp-secrets */ + id = strtol((char *)secbuf, &cp, 10); + if (*cp++ != ':' || id < 0) + break; + if (id == 0) { + mytce.index = 0; + mytce.modulus.data = (u_char *)wkmodulus; + mytce.modulus.len = sizeof (wkmodulus); + mytce.generator.data = (u_char *)"\002"; + mytce.generator.len = 1; + tce = &mytce; + } else if ((tce = gettcid(id)) != NULL) { + /* + * Client will have to verify this modulus/ + * generator combination, and that will take + * a while. Lengthen the timeout here. + */ + if (pcb->settings.eap_timeout_time > 0 && + pcb->settings.eap_timeout_time < 30) + pcb->settings.eap_timeout_time = 30; + } else { + break; + } + if ((cp2 = strchr(cp, ':')) == NULL) + break; + *cp2++ = '\0'; + tpw.pebuf.name = pcb->eap.es_server.ea_peer; + tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf, + cp); + tpw.pebuf.password.data = tpw.pwbuf; + tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf, + cp2); + tpw.pebuf.salt.data = tpw.saltbuf; + if ((ts = t_serveropenraw(&tpw.pebuf, tce)) == NULL) + break; + pcb->eap.es_server.ea_session = (void *)ts; + pcb->eap.es_server.ea_state = eapSRP1; + vals[0] = pcb->eap.es_server.ea_id + 1; + vals[1] = EAPT_SRP; + t_serveraddexdata(ts, vals, 2); + /* Generate B; must call before t_servergetkey() */ + t_servergenexp(ts); + break; + } #endif /* USE_SRP */ - pcb->eap.es_server.ea_state = eapMD5Chall; - break; + pcb->eap.es_server.ea_state = eapMD5Chall; + break; - case eapSRP1: + case eapSRP1: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status == 1) { - pcb->eap.es_server.ea_state = eapMD5Chall; - } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP2; - } - break; - - case eapSRP2: + if (status == 1) { + pcb->eap.es_server.ea_state = eapMD5Chall; + } else if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP2; + } + break; + + case eapSRP2: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapSRP3; - } - break; - - case eapSRP3: - case eapSRP4: + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapSRP3; + } + break; + + case eapSRP3: + case eapSRP4: #ifdef USE_SRP - ts = (struct t_server *)pcb->eap.es_server.ea_session; - if (ts != NULL && status != 0) { - t_serverclose(ts); - pcb->eap.es_server.ea_session = NULL; - pcb->eap.es_server.ea_skey = NULL; - } + ts = (struct t_server *)pcb->eap.es_server.ea_session; + if (ts != NULL && status != 0) { + t_serverclose(ts); + pcb->eap.es_server.ea_session = NULL; + pcb->eap.es_server.ea_skey = NULL; + } #endif /* USE_SRP */ - if (status != 0 || pcb->eap.es_server.ea_session == NULL) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - case eapMD5Chall: - if (status != 0) { - pcb->eap.es_server.ea_state = eapBadAuth; - } else { - pcb->eap.es_server.ea_state = eapOpen; - } - break; - - default: - pcb->eap.es_server.ea_state = eapBadAuth; - break; - } - if (pcb->eap.es_server.ea_state == eapBadAuth) - eap_send_failure(pcb); + if (status != 0 || pcb->eap.es_server.ea_session == NULL) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + case eapMD5Chall: + if (status != 0) { + pcb->eap.es_server.ea_state = eapBadAuth; + } else { + pcb->eap.es_server.ea_state = eapOpen; + } + break; + + default: + pcb->eap.es_server.ea_state = eapBadAuth; + break; + } + if (pcb->eap.es_server.ea_state == eapBadAuth) + eap_send_failure(pcb); } /* @@ -636,235 +636,235 @@ static void eap_figure_next_state(ppp_pcb *pcb, int status) { * type depends on current state. (Server operation) */ static void eap_send_request(ppp_pcb *pcb) { - struct pbuf *p; - u_char *outp; - u_char *lenloc; - int outlen; - int len; - const char *str; + struct pbuf *p; + u_char *outp; + u_char *lenloc; + int outlen; + int len; + const char *str; #ifdef USE_SRP - struct t_server *ts; - u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; - int i, j; - struct b64state b64; - SHA1_CTX ctxt; + struct t_server *ts; + u_char clear[8], cipher[8], dig[SHA_DIGESTSIZE], *optr, *cp; + int i, j; + struct b64state b64; + SHA1_CTX ctxt; #endif /* USE_SRP */ - /* Handle both initial auth and restart */ - if (pcb->eap.es_server.ea_state < eapIdentify && - pcb->eap.es_server.ea_state != eapInitial) { - pcb->eap.es_server.ea_state = eapIdentify; + /* Handle both initial auth and restart */ + if (pcb->eap.es_server.ea_state < eapIdentify && + pcb->eap.es_server.ea_state != eapInitial) { + pcb->eap.es_server.ea_state = eapIdentify; #if PPP_REMOTENAME - if (pcb->settings.explicit_remote && pcb->remote_name) { - /* - * If we already know the peer's - * unauthenticated name, then there's no - * reason to ask. Go to next state instead. - */ - int len = (int)strlen(pcb->remote_name); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - } + if (pcb->settings.explicit_remote && pcb->remote_name) { + /* + * If we already know the peer's + * unauthenticated name, then there's no + * reason to ask. Go to next state instead. + */ + int len = (int)strlen(pcb->remote_name); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, pcb->remote_name, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + } #endif /* PPP_REMOTENAME */ - } - - if (pcb->settings.eap_max_transmits > 0 && - pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { - if (pcb->eap.es_server.ea_responses > 0) - ppp_error("EAP: too many Requests sent"); - else - ppp_error("EAP: no response to Requests"); - eap_send_failure(pcb); - return; - } - - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_REQUEST, outp); - PUTCHAR(pcb->eap.es_server.ea_id, outp); - lenloc = outp; - INCPTR(2, outp); - - switch (pcb->eap.es_server.ea_state) { - case eapIdentify: - PUTCHAR(EAPT_IDENTITY, outp); - str = "Name"; - len = strlen(str); - MEMCPY(outp, str, len); - INCPTR(len, outp); - break; - - case eapMD5Chall: - PUTCHAR(EAPT_MD5CHAP, outp); - /* - * pick a random challenge length between - * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH - */ - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - PUTCHAR(pcb->eap.es_challen, outp); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - break; + } + + if (pcb->settings.eap_max_transmits > 0 && + pcb->eap.es_server.ea_requests >= pcb->settings.eap_max_transmits) { + if (pcb->eap.es_server.ea_responses > 0) + ppp_error("EAP: too many Requests sent"); + else + ppp_error("EAP: no response to Requests"); + eap_send_failure(pcb); + return; + } + + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_CTRL_PBUF_MAX_SIZE), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_REQUEST, outp); + PUTCHAR(pcb->eap.es_server.ea_id, outp); + lenloc = outp; + INCPTR(2, outp); + + switch (pcb->eap.es_server.ea_state) { + case eapIdentify: + PUTCHAR(EAPT_IDENTITY, outp); + str = "Name"; + len = strlen(str); + MEMCPY(outp, str, len); + INCPTR(len, outp); + break; + + case eapMD5Chall: + PUTCHAR(EAPT_MD5CHAP, outp); + /* + * pick a random challenge length between + * EAP_MIN_CHALLENGE_LENGTH and EAP_MAX_CHALLENGE_LENGTH + */ + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + PUTCHAR(pcb->eap.es_challen, outp); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + break; #ifdef USE_SRP - case eapSRP1: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CHALLENGE, outp); - - PUTCHAR(pcb->eap.es_server.ea_namelen, outp); - MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); - INCPTR(pcb->eap.es_server.ea_namelen, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - PUTCHAR(ts->s.len, outp); - MEMCPY(outp, ts->s.data, ts->s.len); - INCPTR(ts->s.len, outp); - - if (ts->g.len == 1 && ts->g.data[0] == 2) { - PUTCHAR(0, outp); - } else { - PUTCHAR(ts->g.len, outp); - MEMCPY(outp, ts->g.data, ts->g.len); - INCPTR(ts->g.len, outp); - } - - if (ts->n.len != sizeof (wkmodulus) || - BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { - MEMCPY(outp, ts->n.data, ts->n.len); - INCPTR(ts->n.len, outp); - } - break; - - case eapSRP2: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SKEY, outp); - - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, ts->B.data, ts->B.len); - INCPTR(ts->B.len, outp); - break; - - case eapSRP3: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_SVALIDATOR, outp); - PUTLONG(SRPVAL_EBIT, outp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); - INCPTR(SHA_DIGESTSIZE, outp); - - if (pncrypt_setkey(0)) { - /* Generate pseudonym */ - optr = outp; - cp = (unsigned char *)pcb->eap.es_server.ea_peer; - if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) - j = 7; - clear[0] = i; - MEMCPY(clear + 1, cp, j); - i -= j; - cp += j; - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - if (!DesEncrypt(clear, cipher)) { - ppp_dbglog("no DES here; not generating pseudonym"); - break; - } - BZERO(&b64, sizeof (b64)); - outp++; /* space for pseudonym length */ - outp += b64enc(&b64, cipher, 8, outp); - while (i >= 8) { - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(cp, cipher); - outp += b64enc(&b64, cipher, 8, outp); - cp += 8; - i -= 8; - } - if (i > 0) { - MEMCPY(clear, cp, i); - cp += i; - magic_random_bytes(cp, 8-i); - /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ - (void) DesEncrypt(clear, cipher); - outp += b64enc(&b64, cipher, 8, outp); - } - outp += b64flush(&b64, outp); - - /* Set length and pad out to next 20 octet boundary */ - i = outp - optr - 1; - *optr = i; - i %= SHA_DIGESTSIZE; - if (i != 0) { - magic_random_bytes(outp, SHA_DIGESTSIZE-i); - INCPTR(SHA_DIGESTSIZE-i, outp); - } - - /* Obscure the pseudonym with SHA1 hash */ - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - while (optr < outp) { - SHA1Final(dig, &ctxt); - cp = dig; - while (cp < dig + SHA_DIGESTSIZE) - *optr++ ^= *cp++; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, - SHA_DIGESTSIZE); - } - } - break; - - case eapSRP4: - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_LWRECHALLENGE, outp); - pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + - magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); - magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); - MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); - INCPTR(pcb->eap.es_challen, outp); - break; + case eapSRP1: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CHALLENGE, outp); + + PUTCHAR(pcb->eap.es_server.ea_namelen, outp); + MEMCPY(outp, pcb->eap.es_server.ea_name, pcb->eap.es_server.ea_namelen); + INCPTR(pcb->eap.es_server.ea_namelen, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + PUTCHAR(ts->s.len, outp); + MEMCPY(outp, ts->s.data, ts->s.len); + INCPTR(ts->s.len, outp); + + if (ts->g.len == 1 && ts->g.data[0] == 2) { + PUTCHAR(0, outp); + } else { + PUTCHAR(ts->g.len, outp); + MEMCPY(outp, ts->g.data, ts->g.len); + INCPTR(ts->g.len, outp); + } + + if (ts->n.len != sizeof (wkmodulus) || + BCMP(ts->n.data, wkmodulus, sizeof (wkmodulus)) != 0) { + MEMCPY(outp, ts->n.data, ts->n.len); + INCPTR(ts->n.len, outp); + } + break; + + case eapSRP2: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SKEY, outp); + + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, ts->B.data, ts->B.len); + INCPTR(ts->B.len, outp); + break; + + case eapSRP3: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_SVALIDATOR, outp); + PUTLONG(SRPVAL_EBIT, outp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + MEMCPY(outp, t_serverresponse(ts), SHA_DIGESTSIZE); + INCPTR(SHA_DIGESTSIZE, outp); + + if (pncrypt_setkey(0)) { + /* Generate pseudonym */ + optr = outp; + cp = (unsigned char *)pcb->eap.es_server.ea_peer; + if ((j = i = pcb->eap.es_server.ea_peerlen) > 7) + j = 7; + clear[0] = i; + MEMCPY(clear + 1, cp, j); + i -= j; + cp += j; + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + if (!DesEncrypt(clear, cipher)) { + ppp_dbglog("no DES here; not generating pseudonym"); + break; + } + BZERO(&b64, sizeof (b64)); + outp++; /* space for pseudonym length */ + outp += b64enc(&b64, cipher, 8, outp); + while (i >= 8) { + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(cp, cipher); + outp += b64enc(&b64, cipher, 8, outp); + cp += 8; + i -= 8; + } + if (i > 0) { + MEMCPY(clear, cp, i); + cp += i; + magic_random_bytes(cp, 8-i); + /* FIXME: if we want to do SRP, we need to find a way to pass the PolarSSL des_context instead of using static memory */ + (void) DesEncrypt(clear, cipher); + outp += b64enc(&b64, cipher, 8, outp); + } + outp += b64flush(&b64, outp); + + /* Set length and pad out to next 20 octet boundary */ + i = outp - optr - 1; + *optr = i; + i %= SHA_DIGESTSIZE; + if (i != 0) { + magic_random_bytes(outp, SHA_DIGESTSIZE-i); + INCPTR(SHA_DIGESTSIZE-i, outp); + } + + /* Obscure the pseudonym with SHA1 hash */ + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + while (optr < outp) { + SHA1Final(dig, &ctxt); + cp = dig; + while (cp < dig + SHA_DIGESTSIZE) + *optr++ ^= *cp++; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &pcb->eap.es_server.ea_id, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, optr - SHA_DIGESTSIZE, + SHA_DIGESTSIZE); + } + } + break; + + case eapSRP4: + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_LWRECHALLENGE, outp); + pcb->eap.es_challen = EAP_MIN_CHALLENGE_LENGTH + + magic_pow(EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH); + magic_random_bytes(pcb->eap.es_challenge, pcb->eap.es_challen); + MEMCPY(outp, pcb->eap.es_challenge, pcb->eap.es_challen); + INCPTR(pcb->eap.es_challen, outp); + break; #endif /* USE_SRP */ - default: - return; - } + default: + return; + } - outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; - PUTSHORT(outlen, lenloc); + outlen = (outp - (unsigned char*)p->payload) - PPP_HDRLEN; + PUTSHORT(outlen, lenloc); - pbuf_realloc(p, outlen + PPP_HDRLEN); - ppp_write(pcb, p); + pbuf_realloc(p, outlen + PPP_HDRLEN); + ppp_write(pcb, p); - pcb->eap.es_server.ea_requests++; + pcb->eap.es_server.ea_requests++; - if (pcb->settings.eap_timeout_time > 0) - TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); + if (pcb->settings.eap_timeout_time > 0) + TIMEOUT(eap_server_timeout, pcb, pcb->settings.eap_timeout_time); } /* @@ -875,23 +875,23 @@ static void eap_send_request(ppp_pcb *pcb) { */ void eap_authpeer(ppp_pcb *pcb, const char *localname) { - /* Save the name we're given. */ - pcb->eap.es_server.ea_name = localname; - pcb->eap.es_server.ea_namelen = strlen(localname); + /* Save the name we're given. */ + pcb->eap.es_server.ea_name = localname; + pcb->eap.es_server.ea_namelen = strlen(localname); - pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; + pcb->eap.es_savedtime = pcb->settings.eap_timeout_time; - /* Lower layer up yet? */ - if (pcb->eap.es_server.ea_state == eapInitial || - pcb->eap.es_server.ea_state == eapPending) { - pcb->eap.es_server.ea_state = eapPending; - return; - } + /* Lower layer up yet? */ + if (pcb->eap.es_server.ea_state == eapInitial || + pcb->eap.es_server.ea_state == eapPending) { + pcb->eap.es_server.ea_state = eapPending; + return; + } - pcb->eap.es_server.ea_state = eapPending; + pcb->eap.es_server.ea_state = eapPending; - /* ID number not updated here intentionally; hashed into M1 */ - eap_send_request(pcb); + /* ID number not updated here intentionally; hashed into M1 */ + eap_send_request(pcb); } /* @@ -899,13 +899,13 @@ void eap_authpeer(ppp_pcb *pcb, const char *localname) { * expired. */ static void eap_server_timeout(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (!eap_server_active(pcb)) - return; + if (!eap_server_active(pcb)) + return; - /* EAP ID number must not change on timeout. */ - eap_send_request(pcb); + /* EAP ID number must not change on timeout. */ + eap_send_request(pcb); } /* @@ -914,30 +914,30 @@ static void eap_server_timeout(void *arg) { * will restart the timer. If it fails, then the link is dropped. */ static void eap_rechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen && - pcb->eap.es_server.ea_state != eapSRP4) - return; + if (pcb->eap.es_server.ea_state != eapOpen && + pcb->eap.es_server.ea_state != eapSRP4) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } static void srp_lwrechallenge(void *arg) { - ppp_pcb *pcb = (ppp_pcb*)arg; + ppp_pcb *pcb = (ppp_pcb*)arg; - if (pcb->eap.es_server.ea_state != eapOpen || - pcb->eap.es_server.ea_type != EAPT_SRP) - return; + if (pcb->eap.es_server.ea_state != eapOpen || + pcb->eap.es_server.ea_type != EAPT_SRP) + return; - pcb->eap.es_server.ea_requests = 0; - pcb->eap.es_server.ea_state = eapSRP4; - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); + pcb->eap.es_server.ea_requests = 0; + pcb->eap.es_server.ea_state = eapSRP4; + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); } #endif /* PPP_SERVER */ @@ -950,9 +950,9 @@ static void srp_lwrechallenge(void *arg) { * thing. */ static void eap_lowerup(ppp_pcb *pcb) { - pcb->eap.es_client.ea_state = eapClosed; + pcb->eap.es_client.ea_state = eapClosed; #if PPP_SERVER - pcb->eap.es_server.ea_state = eapClosed; + pcb->eap.es_server.ea_state = eapClosed; #endif /* PPP_SERVER */ } @@ -963,28 +963,28 @@ static void eap_lowerup(ppp_pcb *pcb) { */ static void eap_lowerdown(ppp_pcb *pcb) { - if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (eap_client_active(pcb) && pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - } else { - if ((pcb->eap.es_server.ea_state == eapOpen || - pcb->eap.es_server.ea_state == eapSRP4) && - pcb->eap.es_rechallenge > 0) { - UNTIMEOUT(eap_rechallenge, (void *)pcb); - } - if (pcb->eap.es_server.ea_state == eapOpen && - pcb->eap.es_lwrechallenge > 0) { - UNTIMEOUT(srp_lwrechallenge, (void *)pcb); - } - } - - pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; - pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; + if (eap_server_active(pcb)) { + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + } else { + if ((pcb->eap.es_server.ea_state == eapOpen || + pcb->eap.es_server.ea_state == eapSRP4) && + pcb->eap.es_rechallenge > 0) { + UNTIMEOUT(eap_rechallenge, (void *)pcb); + } + if (pcb->eap.es_server.ea_state == eapOpen && + pcb->eap.es_lwrechallenge > 0) { + UNTIMEOUT(srp_lwrechallenge, (void *)pcb); + } + } + + pcb->eap.es_client.ea_state = pcb->eap.es_server.ea_state = eapInitial; + pcb->eap.es_client.ea_requests = pcb->eap.es_server.ea_requests = 0; #endif /* PPP_SERVER */ } @@ -996,87 +996,87 @@ static void eap_lowerdown(ppp_pcb *pcb) { */ static void eap_protrej(ppp_pcb *pcb) { - if (eap_client_active(pcb)) { - ppp_error("EAP authentication failed due to Protocol-Reject"); - auth_withpeer_fail(pcb, PPP_EAP); - } + if (eap_client_active(pcb)) { + ppp_error("EAP authentication failed due to Protocol-Reject"); + auth_withpeer_fail(pcb, PPP_EAP); + } #if PPP_SERVER - if (eap_server_active(pcb)) { - ppp_error("EAP authentication of peer failed on Protocol-Reject"); - auth_peer_fail(pcb, PPP_EAP); - } + if (eap_server_active(pcb)) { + ppp_error("EAP authentication of peer failed on Protocol-Reject"); + auth_peer_fail(pcb, PPP_EAP); + } #endif /* PPP_SERVER */ - eap_lowerdown(pcb); + eap_lowerdown(pcb); } /* * Format and send a regular EAP Response message. */ static void eap_send_response(ppp_pcb *pcb, u_char id, u_char typenum, const u_char *str, int lenstr) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(typenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(typenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* * Format and send an MD5-Challenge EAP Response message. */ static void eap_chap_response(ppp_pcb *pcb, u_char id, u_char *hash, const char *name, int namelen) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + - namelen; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_MD5CHAP, outp); - PUTCHAR(MD5_SIGNATURE_SIZE, outp); - MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); - INCPTR(MD5_SIGNATURE_SIZE, outp); - if (namelen > 0) { - MEMCPY(outp, name, namelen); - } - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + MD5_SIGNATURE_SIZE + + namelen; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_MD5CHAP, outp); + PUTCHAR(MD5_SIGNATURE_SIZE, outp); + MEMCPY(outp, hash, MD5_SIGNATURE_SIZE); + INCPTR(MD5_SIGNATURE_SIZE, outp); + if (namelen > 0) { + MEMCPY(outp, name, namelen); + } + + ppp_write(pcb, p); } #ifdef USE_SRP @@ -1091,35 +1091,35 @@ u_char subtypenum; u_char *str; int lenstr; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(subtypenum, outp); - if (lenstr > 0) { - MEMCPY(outp, str, lenstr); - } - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + lenstr; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(subtypenum, outp); + if (lenstr > 0) { + MEMCPY(outp, str, lenstr); + } + + ppp_write(pcb, p); } /* @@ -1132,118 +1132,118 @@ u_char id; u32_t flags; u_char *str; { - ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + - SHA_DIGESTSIZE; - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_SRP, outp); - PUTCHAR(EAPSRP_CVALIDATOR, outp); - PUTLONG(flags, outp); - MEMCPY(outp, str, SHA_DIGESTSIZE); - - ppp_write(pcb, p); + ppp_pcb *pcb = &ppp_pcb_list[pcb->eap.es_unit]; + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char) + sizeof (u32_t) + + SHA_DIGESTSIZE; + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_SRP, outp); + PUTCHAR(EAPSRP_CVALIDATOR, outp); + PUTLONG(flags, outp); + MEMCPY(outp, str, SHA_DIGESTSIZE); + + ppp_write(pcb, p); } #endif /* USE_SRP */ static void eap_send_nak(ppp_pcb *pcb, u_char id, u_char type) { - struct pbuf *p; - u_char *outp; - int msglen; - - msglen = EAP_HEADERLEN + 2 * sizeof (u_char); - p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); - if(NULL == p) - return; - if(p->tot_len != p->len) { - pbuf_free(p); - return; - } - - outp = (u_char*)p->payload; - - MAKEHEADER(outp, PPP_EAP); - - PUTCHAR(EAP_RESPONSE, outp); - PUTCHAR(id, outp); - pcb->eap.es_client.ea_id = id; - PUTSHORT(msglen, outp); - PUTCHAR(EAPT_NAK, outp); - PUTCHAR(type, outp); - - ppp_write(pcb, p); + struct pbuf *p; + u_char *outp; + int msglen; + + msglen = EAP_HEADERLEN + 2 * sizeof (u_char); + p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN + msglen), PPP_CTRL_PBUF_TYPE); + if(NULL == p) + return; + if(p->tot_len != p->len) { + pbuf_free(p); + return; + } + + outp = (u_char*)p->payload; + + MAKEHEADER(outp, PPP_EAP); + + PUTCHAR(EAP_RESPONSE, outp); + PUTCHAR(id, outp); + pcb->eap.es_client.ea_id = id; + PUTSHORT(msglen, outp); + PUTCHAR(EAPT_NAK, outp); + PUTCHAR(type, outp); + + ppp_write(pcb, p); } #ifdef USE_SRP static char * name_of_pn_file() { - char *user, *path, *file; - struct passwd *pw; - size_t pl; - static bool pnlogged = 0; - - pw = getpwuid(getuid()); - if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { - errno = EINVAL; - return (NULL); - } - file = _PATH_PSEUDONYM; - pl = strlen(user) + strlen(file) + 2; - path = malloc(pl); - if (path == NULL) - return (NULL); - (void) slprintf(path, pl, "%s/%s", user, file); - if (!pnlogged) { - ppp_dbglog("pseudonym file: %s", path); - pnlogged = 1; - } - return (path); + char *user, *path, *file; + struct passwd *pw; + size_t pl; + static bool pnlogged = 0; + + pw = getpwuid(getuid()); + if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0) { + errno = EINVAL; + return (NULL); + } + file = _PATH_PSEUDONYM; + pl = strlen(user) + strlen(file) + 2; + path = malloc(pl); + if (path == NULL) + return (NULL); + (void) slprintf(path, pl, "%s/%s", user, file); + if (!pnlogged) { + ppp_dbglog("pseudonym file: %s", path); + pnlogged = 1; + } + return (path); } static int open_pn_file(modebits) mode_t modebits; { - char *path; - int fd, err; - - if ((path = name_of_pn_file()) == NULL) - return (-1); - fd = open(path, modebits, S_IRUSR | S_IWUSR); - err = errno; - free(path); - errno = err; - return (fd); + char *path; + int fd, err; + + if ((path = name_of_pn_file()) == NULL) + return (-1); + fd = open(path, modebits, S_IRUSR | S_IWUSR); + err = errno; + free(path); + errno = err; + return (fd); } static void remove_pn_file() { - char *path; + char *path; - if ((path = name_of_pn_file()) != NULL) { - (void) unlink(path); - (void) free(path); - } + if ((path = name_of_pn_file()) != NULL) { + (void) unlink(path); + (void) free(path); + } } static void @@ -1252,56 +1252,56 @@ eap_state *esp; u_char *inp; int len, id; { - u_char val; - u_char *datp, *digp; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int dsize, fd, olen = len; - - /* - * Do the decoding by working backwards. This eliminates the need - * to save the decoded output in a separate buffer. - */ - val = id; - while (len > 0) { - if ((dsize = len % SHA_DIGESTSIZE) == 0) - dsize = SHA_DIGESTSIZE; - len -= dsize; - datp = inp + len; - SHA1Init(&ctxt); - SHA1Update(&ctxt, &val, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); - if (len > 0) { - SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); - } else { - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - } - SHA1Final(dig, &ctxt); - for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) - *datp++ ^= *digp; - } - - /* Now check that the result is sane */ - if (olen <= 0 || *inp + 1 > olen) { - ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); - return; - } - - /* Save it away */ - fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); - if (fd < 0) { - ppp_dbglog("EAP: error saving pseudonym: %m"); - return; - } - len = write(fd, inp + 1, *inp); - if (close(fd) != -1 && len == *inp) { - ppp_dbglog("EAP: saved pseudonym"); - pcb->eap.es_usedpseudo = 0; - } else { - ppp_dbglog("EAP: failed to save pseudonym"); - remove_pn_file(); - } + u_char val; + u_char *datp, *digp; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int dsize, fd, olen = len; + + /* + * Do the decoding by working backwards. This eliminates the need + * to save the decoded output in a separate buffer. + */ + val = id; + while (len > 0) { + if ((dsize = len % SHA_DIGESTSIZE) == 0) + dsize = SHA_DIGESTSIZE; + len -= dsize; + datp = inp + len; + SHA1Init(&ctxt); + SHA1Update(&ctxt, &val, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, SESSION_KEY_LEN); + if (len > 0) { + SHA1Update(&ctxt, datp, SHA_DIGESTSIZE); + } else { + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + } + SHA1Final(dig, &ctxt); + for (digp = dig; digp < dig + SHA_DIGESTSIZE; digp++) + *datp++ ^= *digp; + } + + /* Now check that the result is sane */ + if (olen <= 0 || *inp + 1 > olen) { + ppp_dbglog("EAP: decoded pseudonym is unusable <%.*B>", olen, inp); + return; + } + + /* Save it away */ + fd = open_pn_file(O_WRONLY | O_CREAT | O_TRUNC); + if (fd < 0) { + ppp_dbglog("EAP: error saving pseudonym: %m"); + return; + } + len = write(fd, inp + 1, *inp); + if (close(fd) != -1 && len == *inp) { + ppp_dbglog("EAP: saved pseudonym"); + pcb->eap.es_usedpseudo = 0; + } else { + ppp_dbglog("EAP: failed to save pseudonym"); + remove_pn_file(); + } } #endif /* USE_SRP */ @@ -1309,412 +1309,412 @@ int len, id; * eap_request - Receive EAP Request message (client mode). */ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_client *tc; - struct t_num sval, gval, Nval, *Ap, Bval; - u_char vals[2]; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; - int fd; + struct t_client *tc; + struct t_num sval, gval, Nval, *Ap, Bval; + u_char vals[2]; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; + int fd; #endif /* USE_SRP */ - /* - * Note: we update es_client.ea_id *only if* a Response - * message is being generated. Otherwise, we leave it the - * same for duplicate detection purposes. - */ - - pcb->eap.es_client.ea_requests++; - if (pcb->settings.eap_allow_req != 0 && - pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { - ppp_info("EAP: received too many Request messages"); - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - auth_withpeer_fail(pcb, PPP_EAP); - return; - } - - if (len <= 0) { - ppp_error("EAP: empty Request message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (len > 0) - ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); + /* + * Note: we update es_client.ea_id *only if* a Response + * message is being generated. Otherwise, we leave it the + * same for duplicate detection purposes. + */ + + pcb->eap.es_client.ea_requests++; + if (pcb->settings.eap_allow_req != 0 && + pcb->eap.es_client.ea_requests > pcb->settings.eap_allow_req) { + ppp_info("EAP: received too many Request messages"); + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + auth_withpeer_fail(pcb, PPP_EAP); + return; + } + + if (len <= 0) { + ppp_error("EAP: empty Request message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (len > 0) + ppp_info("EAP: Identity prompt \"%.*q\"", len, inp); #ifdef USE_SRP - if (pcb->eap.es_usepseudo && - (pcb->eap.es_usedpseudo == 0 || - (pcb->eap.es_usedpseudo == 1 && - id == pcb->eap.es_client.ea_id))) { - pcb->eap.es_usedpseudo = 1; - /* Try to get a pseudonym */ - if ((fd = open_pn_file(O_RDONLY)) >= 0) { - strcpy(rhostname, SRP_PSEUDO_ID); - len = read(fd, rhostname + SRP_PSEUDO_LEN, - sizeof (rhostname) - SRP_PSEUDO_LEN); - /* XXX NAI unsupported */ - if (len > 0) { - eap_send_response(pcb, id, typenum, - rhostname, len + SRP_PSEUDO_LEN); - } - (void) close(fd); - if (len > 0) - break; - } - } - /* Stop using pseudonym now. */ - if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { - remove_pn_file(); - pcb->eap.es_usedpseudo = 2; - } + if (pcb->eap.es_usepseudo && + (pcb->eap.es_usedpseudo == 0 || + (pcb->eap.es_usedpseudo == 1 && + id == pcb->eap.es_client.ea_id))) { + pcb->eap.es_usedpseudo = 1; + /* Try to get a pseudonym */ + if ((fd = open_pn_file(O_RDONLY)) >= 0) { + strcpy(rhostname, SRP_PSEUDO_ID); + len = read(fd, rhostname + SRP_PSEUDO_LEN, + sizeof (rhostname) - SRP_PSEUDO_LEN); + /* XXX NAI unsupported */ + if (len > 0) { + eap_send_response(pcb, id, typenum, + rhostname, len + SRP_PSEUDO_LEN); + } + (void) close(fd); + if (len > 0) + break; + } + } + /* Stop using pseudonym now. */ + if (pcb->eap.es_usepseudo && pcb->eap.es_usedpseudo != 2) { + remove_pn_file(); + pcb->eap.es_usedpseudo = 2; + } #endif /* USE_SRP */ - eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; - - case EAPT_NOTIFICATION: - if (len > 0) - ppp_info("EAP: Notification \"%.*q\"", len, inp); - eap_send_response(pcb, id, typenum, NULL, 0); - break; - - case EAPT_NAK: - /* - * Avoid the temptation to send Response Nak in reply - * to Request Nak here. It can only lead to trouble. - */ - ppp_warn("EAP: unexpected Nak in Request; ignored"); - /* Return because we're waiting for something real. */ - return; - - case EAPT_MD5CHAP: - if (len < 1) { - ppp_error("EAP: received MD5-Challenge with no data"); - /* Bogus request; wait for something real. */ - return; - } - GETCHAR(vallen, inp); - len--; - if (vallen < 8 || vallen > len) { - ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", - vallen, len); - /* Try something better. */ - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + eap_send_response(pcb, id, typenum, (const u_char*)pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; + + case EAPT_NOTIFICATION: + if (len > 0) + ppp_info("EAP: Notification \"%.*q\"", len, inp); + eap_send_response(pcb, id, typenum, NULL, 0); + break; + + case EAPT_NAK: + /* + * Avoid the temptation to send Response Nak in reply + * to Request Nak here. It can only lead to trouble. + */ + ppp_warn("EAP: unexpected Nak in Request; ignored"); + /* Return because we're waiting for something real. */ + return; + + case EAPT_MD5CHAP: + if (len < 1) { + ppp_error("EAP: received MD5-Challenge with no data"); + /* Bogus request; wait for something real. */ + return; + } + GETCHAR(vallen, inp); + len--; + if (vallen < 8 || vallen > len) { + ppp_error("EAP: MD5-Challenge with bad length %d (8..%d)", + vallen, len); + /* Try something better. */ + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (pcb->settings.explicit_remote || - (pcb->settings.remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (pcb->settings.explicit_remote || + (pcb->settings.remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating ourselves with - * the specified host. - */ - if (!get_secret(pcb, pcb->eap.es_client.ea_name, - rhostname, secret, &secret_len, 0)) { - ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - typenum = id; - lwip_md5_update(&mdContext, &typenum, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, inp, vallen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - break; + /* + * Get the secret for authenticating ourselves with + * the specified host. + */ + if (!get_secret(pcb, pcb->eap.es_client.ea_name, + rhostname, secret, &secret_len, 0)) { + ppp_dbglog("EAP: no MD5 secret for auth to %q", rhostname); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + typenum = id; + lwip_md5_update(&mdContext, &typenum, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, inp, vallen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + eap_chap_response(pcb, id, hash, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: received empty SRP Request"); - /* Bogus request; wait for something real. */ - return; - } - - /* Get subtype */ - GETCHAR(vallen, inp); - len--; - switch (vallen) { - case EAPSRP_CHALLENGE: - tc = NULL; - if (pcb->eap.es_client.ea_session != NULL) { - tc = (struct t_client *)pcb->eap.es_client. - ea_session; - /* - * If this is a new challenge, then start - * over with a new client session context. - * Otherwise, just resend last response. - */ - if (id != pcb->eap.es_client.ea_id) { - t_clientclose(tc); - pcb->eap.es_client.ea_session = NULL; - tc = NULL; - } - } - /* No session key just yet */ - pcb->eap.es_client.ea_skey = NULL; - if (tc == NULL) { - int rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (name)"); - /* Ignore badly-formed messages */ - return; - } - MEMCPY(rhostname, inp, vallen); - rhostname[vallen] = '\0'; - INCPTR(vallen, inp); - len -= vallen; - - /* - * In case the remote doesn't give us his name, - * use configured name. - */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == 0)) { - strlcpy(rhostname, remote_name, - sizeof (rhostname)); - } - - rhostnamelen = (int)strlen(rhostname); - if (rhostnamelen > MAXNAMELEN) { - rhostnamelen = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); - pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; - pcb->eap.es_client.ea_peerlen = rhostnamelen; - - GETCHAR(vallen, inp); - len--; - if (vallen >= len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (s)"); - /* Ignore badly-formed messages */ - return; - } - sval.data = inp; - sval.len = vallen; - INCPTR(vallen, inp); - len -= vallen; - - GETCHAR(vallen, inp); - len--; - if (vallen > len) { - ppp_error("EAP: badly-formed SRP Challenge" - " (g)"); - /* Ignore badly-formed messages */ - return; - } - /* If no generator present, then use value 2 */ - if (vallen == 0) { - gval.data = (u_char *)"\002"; - gval.len = 1; - } else { - gval.data = inp; - gval.len = vallen; - } - INCPTR(vallen, inp); - len -= vallen; - - /* - * If no modulus present, then use well-known - * value. - */ - if (len == 0) { - Nval.data = (u_char *)wkmodulus; - Nval.len = sizeof (wkmodulus); - } else { - Nval.data = inp; - Nval.len = len; - } - tc = t_clientopen(pcb->eap.es_client.ea_name, - &Nval, &gval, &sval); - if (tc == NULL) { - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - pcb->eap.es_client.ea_session = (void *)tc; - - /* Add Challenge ID & type to verifier */ - vals[0] = id; - vals[1] = EAPT_SRP; - t_clientaddexdata(tc, vals, 2); - } - Ap = t_clientgenexp(tc); - eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, - Ap->len); - break; - - case EAPSRP_SKEY: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL) { - ppp_warn("EAP: peer sent Subtype 2 without 1"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - if (pcb->eap.es_client.ea_skey != NULL) { - /* - * ID number should not change here. Warn - * if it does (but otherwise ignore). - */ - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 2 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - if (get_srp_secret(pcb->eap.es_unit, - pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_peer, secret, 0) == 0) { - /* - * Can't work with this peer because - * the secret is missing. Just give - * up. - */ - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - Bval.data = inp; - Bval.len = len; - t_clientpasswd(tc, secret); - BZERO(secret, sizeof (secret)); - pcb->eap.es_client.ea_skey = - t_clientgetkey(tc, &Bval); - if (pcb->eap.es_client.ea_skey == NULL) { - /* Server is rogue; stop now */ - ppp_error("EAP: SRP server is rogue"); - goto client_failure; - } - } - eap_srpval_response(esp, id, SRPVAL_EBIT, - t_clientresponse(tc)); - break; - - case EAPSRP_SVALIDATOR: - tc = (struct t_client *)pcb->eap.es_client.ea_session; - if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { - ppp_warn("EAP: peer sent Subtype 3 without 1/2"); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - /* - * If we're already open, then this ought to be a - * duplicate. Otherwise, check that the server is - * who we think it is. - */ - if (pcb->eap.es_client.ea_state == eapOpen) { - if (id != pcb->eap.es_client.ea_id) { - ppp_warn("EAP: ID changed from %d to %d " - "in SRP Subtype 3 rexmit", - pcb->eap.es_client.ea_id, id); - } - } else { - len -= sizeof (u32_t) + SHA_DIGESTSIZE; - if (len < 0 || t_clientverify(tc, inp + - sizeof (u32_t)) != 0) { - ppp_error("EAP: SRP server verification " - "failed"); - goto client_failure; - } - GETLONG(pcb->eap.es_client.ea_keyflags, inp); - /* Save pseudonym if user wants it. */ - if (len > 0 && pcb->eap.es_usepseudo) { - INCPTR(SHA_DIGESTSIZE, inp); - write_pseudonym(esp, inp, len, id); - } - } - /* - * We've verified our peer. We're now mostly done, - * except for waiting on the regular EAP Success - * message. - */ - eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); - break; - - case EAPSRP_LWRECHALLENGE: - if (len < 4) { - ppp_warn("EAP: malformed Lightweight rechallenge"); - return; - } - SHA1Init(&ctxt); - vals[0] = id; - SHA1Update(&ctxt, vals, 1); - SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, inp, len); - SHA1Update(&ctxt, pcb->eap.es_client.ea_name, - pcb->eap.es_client.ea_namelen); - SHA1Final(dig, &ctxt); - eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, - SHA_DIGESTSIZE); - break; - - default: - ppp_error("EAP: unknown SRP Subtype %d", vallen); - eap_send_nak(pcb, id, EAPT_MD5CHAP); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: received empty SRP Request"); + /* Bogus request; wait for something real. */ + return; + } + + /* Get subtype */ + GETCHAR(vallen, inp); + len--; + switch (vallen) { + case EAPSRP_CHALLENGE: + tc = NULL; + if (pcb->eap.es_client.ea_session != NULL) { + tc = (struct t_client *)pcb->eap.es_client. + ea_session; + /* + * If this is a new challenge, then start + * over with a new client session context. + * Otherwise, just resend last response. + */ + if (id != pcb->eap.es_client.ea_id) { + t_clientclose(tc); + pcb->eap.es_client.ea_session = NULL; + tc = NULL; + } + } + /* No session key just yet */ + pcb->eap.es_client.ea_skey = NULL; + if (tc == NULL) { + int rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (name)"); + /* Ignore badly-formed messages */ + return; + } + MEMCPY(rhostname, inp, vallen); + rhostname[vallen] = '\0'; + INCPTR(vallen, inp); + len -= vallen; + + /* + * In case the remote doesn't give us his name, + * use configured name. + */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == 0)) { + strlcpy(rhostname, remote_name, + sizeof (rhostname)); + } + + rhostnamelen = (int)strlen(rhostname); + if (rhostnamelen > MAXNAMELEN) { + rhostnamelen = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_client.ea_peer, rhostname, rhostnamelen); + pcb->eap.es_client.ea_peer[rhostnamelen] = '\0'; + pcb->eap.es_client.ea_peerlen = rhostnamelen; + + GETCHAR(vallen, inp); + len--; + if (vallen >= len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (s)"); + /* Ignore badly-formed messages */ + return; + } + sval.data = inp; + sval.len = vallen; + INCPTR(vallen, inp); + len -= vallen; + + GETCHAR(vallen, inp); + len--; + if (vallen > len) { + ppp_error("EAP: badly-formed SRP Challenge" + " (g)"); + /* Ignore badly-formed messages */ + return; + } + /* If no generator present, then use value 2 */ + if (vallen == 0) { + gval.data = (u_char *)"\002"; + gval.len = 1; + } else { + gval.data = inp; + gval.len = vallen; + } + INCPTR(vallen, inp); + len -= vallen; + + /* + * If no modulus present, then use well-known + * value. + */ + if (len == 0) { + Nval.data = (u_char *)wkmodulus; + Nval.len = sizeof (wkmodulus); + } else { + Nval.data = inp; + Nval.len = len; + } + tc = t_clientopen(pcb->eap.es_client.ea_name, + &Nval, &gval, &sval); + if (tc == NULL) { + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + pcb->eap.es_client.ea_session = (void *)tc; + + /* Add Challenge ID & type to verifier */ + vals[0] = id; + vals[1] = EAPT_SRP; + t_clientaddexdata(tc, vals, 2); + } + Ap = t_clientgenexp(tc); + eap_srp_response(esp, id, EAPSRP_CKEY, Ap->data, + Ap->len); + break; + + case EAPSRP_SKEY: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL) { + ppp_warn("EAP: peer sent Subtype 2 without 1"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + if (pcb->eap.es_client.ea_skey != NULL) { + /* + * ID number should not change here. Warn + * if it does (but otherwise ignore). + */ + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 2 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + if (get_srp_secret(pcb->eap.es_unit, + pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_peer, secret, 0) == 0) { + /* + * Can't work with this peer because + * the secret is missing. Just give + * up. + */ + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + Bval.data = inp; + Bval.len = len; + t_clientpasswd(tc, secret); + BZERO(secret, sizeof (secret)); + pcb->eap.es_client.ea_skey = + t_clientgetkey(tc, &Bval); + if (pcb->eap.es_client.ea_skey == NULL) { + /* Server is rogue; stop now */ + ppp_error("EAP: SRP server is rogue"); + goto client_failure; + } + } + eap_srpval_response(esp, id, SRPVAL_EBIT, + t_clientresponse(tc)); + break; + + case EAPSRP_SVALIDATOR: + tc = (struct t_client *)pcb->eap.es_client.ea_session; + if (tc == NULL || pcb->eap.es_client.ea_skey == NULL) { + ppp_warn("EAP: peer sent Subtype 3 without 1/2"); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + /* + * If we're already open, then this ought to be a + * duplicate. Otherwise, check that the server is + * who we think it is. + */ + if (pcb->eap.es_client.ea_state == eapOpen) { + if (id != pcb->eap.es_client.ea_id) { + ppp_warn("EAP: ID changed from %d to %d " + "in SRP Subtype 3 rexmit", + pcb->eap.es_client.ea_id, id); + } + } else { + len -= sizeof (u32_t) + SHA_DIGESTSIZE; + if (len < 0 || t_clientverify(tc, inp + + sizeof (u32_t)) != 0) { + ppp_error("EAP: SRP server verification " + "failed"); + goto client_failure; + } + GETLONG(pcb->eap.es_client.ea_keyflags, inp); + /* Save pseudonym if user wants it. */ + if (len > 0 && pcb->eap.es_usepseudo) { + INCPTR(SHA_DIGESTSIZE, inp); + write_pseudonym(esp, inp, len, id); + } + } + /* + * We've verified our peer. We're now mostly done, + * except for waiting on the regular EAP Success + * message. + */ + eap_srp_response(esp, id, EAPSRP_ACK, NULL, 0); + break; + + case EAPSRP_LWRECHALLENGE: + if (len < 4) { + ppp_warn("EAP: malformed Lightweight rechallenge"); + return; + } + SHA1Init(&ctxt); + vals[0] = id; + SHA1Update(&ctxt, vals, 1); + SHA1Update(&ctxt, pcb->eap.es_client.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, inp, len); + SHA1Update(&ctxt, pcb->eap.es_client.ea_name, + pcb->eap.es_client.ea_namelen); + SHA1Final(dig, &ctxt); + eap_srp_response(esp, id, EAPSRP_LWRECHALLENGE, dig, + SHA_DIGESTSIZE); + break; + + default: + ppp_error("EAP: unknown SRP Subtype %d", vallen); + eap_send_nak(pcb, id, EAPT_MD5CHAP); + break; + } + break; #endif /* USE_SRP */ - default: - ppp_info("EAP: unknown authentication type %d; Naking", typenum); - eap_send_nak(pcb, id, EAPT_SRP); - break; - } + default: + ppp_info("EAP: unknown authentication type %d; Naking", typenum); + eap_send_nak(pcb, id, EAPT_SRP); + break; + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - TIMEOUT(eap_client_timeout, pcb, - pcb->settings.eap_req_time); - } - return; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + TIMEOUT(eap_client_timeout, pcb, + pcb->settings.eap_req_time); + } + return; #ifdef USE_SRP client_failure: - pcb->eap.es_client.ea_state = eapBadAuth; - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, (void *)esp); - } - pcb->eap.es_client.ea_session = NULL; - t_clientclose(tc); - auth_withpeer_fail(pcb, PPP_EAP); + pcb->eap.es_client.ea_state = eapBadAuth; + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, (void *)esp); + } + pcb->eap.es_client.ea_session = NULL; + t_clientclose(tc); + auth_withpeer_fail(pcb, PPP_EAP); #endif /* USE_SRP */ } @@ -1723,291 +1723,291 @@ client_failure: * eap_response - Receive EAP Response message (server mode). */ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { - u_char typenum; - u_char vallen; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[MAXNAMELEN]; - lwip_md5_context mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; + u_char typenum; + u_char vallen; + int secret_len; + char secret[MAXSECRETLEN]; + char rhostname[MAXNAMELEN]; + lwip_md5_context mdContext; + u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP - struct t_server *ts; - struct t_num A; - SHA1_CTX ctxt; - u_char dig[SHA_DIGESTSIZE]; + struct t_server *ts; + struct t_num A; + SHA1_CTX ctxt; + u_char dig[SHA_DIGESTSIZE]; #endif /* USE_SRP */ - if (pcb->eap.es_server.ea_id != id) { - ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, - pcb->eap.es_server.ea_id); - return; - } - - pcb->eap.es_server.ea_responses++; - - if (len <= 0) { - ppp_error("EAP: empty Response message discarded"); - return; - } - - GETCHAR(typenum, inp); - len--; - - switch (typenum) { - case EAPT_IDENTITY: - if (pcb->eap.es_server.ea_state != eapIdentify) { - ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, - inp); - break; - } - ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); - if (len > MAXNAMELEN) { - len = MAXNAMELEN; - } - MEMCPY(pcb->eap.es_server.ea_peer, inp, len); - pcb->eap.es_server.ea_peer[len] = '\0'; - pcb->eap.es_server.ea_peerlen = len; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_NOTIFICATION: - ppp_dbglog("EAP unexpected Notification; response discarded"); - break; - - case EAPT_NAK: - if (len < 1) { - ppp_info("EAP: Nak Response with no suggested protocol"); - eap_figure_next_state(pcb, 1); - break; - } - - GETCHAR(vallen, inp); - len--; - - if ( + if (pcb->eap.es_server.ea_id != id) { + ppp_dbglog("EAP: discarding Response %d; expected ID %d", id, + pcb->eap.es_server.ea_id); + return; + } + + pcb->eap.es_server.ea_responses++; + + if (len <= 0) { + ppp_error("EAP: empty Response message discarded"); + return; + } + + GETCHAR(typenum, inp); + len--; + + switch (typenum) { + case EAPT_IDENTITY: + if (pcb->eap.es_server.ea_state != eapIdentify) { + ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len, + inp); + break; + } + ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp); + if (len > MAXNAMELEN) { + len = MAXNAMELEN; + } + MEMCPY(pcb->eap.es_server.ea_peer, inp, len); + pcb->eap.es_server.ea_peer[len] = '\0'; + pcb->eap.es_server.ea_peerlen = len; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_NOTIFICATION: + ppp_dbglog("EAP unexpected Notification; response discarded"); + break; + + case EAPT_NAK: + if (len < 1) { + ppp_info("EAP: Nak Response with no suggested protocol"); + eap_figure_next_state(pcb, 1); + break; + } + + GETCHAR(vallen, inp); + len--; + + if ( #if PPP_REMOTENAME - !pcb->explicit_remote && + !pcb->explicit_remote && #endif /* PPP_REMOTENAME */ - pcb->eap.es_server.ea_state == eapIdentify){ - /* Peer cannot Nak Identify Request */ - eap_figure_next_state(pcb, 1); - break; - } - - switch (vallen) { - case EAPT_SRP: - /* Run through SRP validator selection again. */ - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - - case EAPT_MD5CHAP: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - - default: - ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); - switch (pcb->eap.es_server.ea_state) { - case eapSRP1: - case eapSRP2: - case eapSRP3: - pcb->eap.es_server.ea_state = eapMD5Chall; - break; - case eapMD5Chall: - case eapSRP4: - pcb->eap.es_server.ea_state = eapIdentify; - eap_figure_next_state(pcb, 0); - break; - default: - break; - } - break; - } - break; - - case EAPT_MD5CHAP: - if (pcb->eap.es_server.ea_state != eapMD5Chall) { - ppp_error("EAP: unexpected MD5-Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < 1) { - ppp_error("EAP: received MD5-Response with no data"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen != 16 || vallen > len) { - ppp_error("EAP: MD5-Response with bad length %d", vallen); - eap_figure_next_state(pcb, 1); - break; - } - - /* Not so likely to happen. */ - if (vallen >= len + sizeof (rhostname)) { - ppp_dbglog("EAP: trimming really long peer name down"); - MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; - } else { - MEMCPY(rhostname, inp + vallen, len - vallen); - rhostname[len - vallen] = '\0'; - } + pcb->eap.es_server.ea_state == eapIdentify){ + /* Peer cannot Nak Identify Request */ + eap_figure_next_state(pcb, 1); + break; + } + + switch (vallen) { + case EAPT_SRP: + /* Run through SRP validator selection again. */ + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + + case EAPT_MD5CHAP: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + + default: + ppp_dbglog("EAP: peer requesting unknown Type %d", vallen); + switch (pcb->eap.es_server.ea_state) { + case eapSRP1: + case eapSRP2: + case eapSRP3: + pcb->eap.es_server.ea_state = eapMD5Chall; + break; + case eapMD5Chall: + case eapSRP4: + pcb->eap.es_server.ea_state = eapIdentify; + eap_figure_next_state(pcb, 0); + break; + default: + break; + } + break; + } + break; + + case EAPT_MD5CHAP: + if (pcb->eap.es_server.ea_state != eapMD5Chall) { + ppp_error("EAP: unexpected MD5-Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < 1) { + ppp_error("EAP: received MD5-Response with no data"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen != 16 || vallen > len) { + ppp_error("EAP: MD5-Response with bad length %d", vallen); + eap_figure_next_state(pcb, 1); + break; + } + + /* Not so likely to happen. */ + if (vallen >= len + sizeof (rhostname)) { + ppp_dbglog("EAP: trimming really long peer name down"); + MEMCPY(rhostname, inp + vallen, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; + } else { + MEMCPY(rhostname, inp + vallen, len - vallen); + rhostname[len - vallen] = '\0'; + } #if PPP_REMOTENAME - /* In case the remote doesn't give us his name. */ - if (explicit_remote || - (remote_name[0] != '\0' && vallen == len)) - strlcpy(rhostname, remote_name, sizeof (rhostname)); + /* In case the remote doesn't give us his name. */ + if (explicit_remote || + (remote_name[0] != '\0' && vallen == len)) + strlcpy(rhostname, remote_name, sizeof (rhostname)); #endif /* PPP_REMOTENAME */ - /* - * Get the secret for authenticating the specified - * host. - */ - if (!get_secret(pcb, rhostname, - pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { - ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); - eap_send_failure(pcb); - break; - } - lwip_md5_init(&mdContext); - lwip_md5_starts(&mdContext); - lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); - lwip_md5_update(&mdContext, (u_char *)secret, secret_len); - BZERO(secret, sizeof (secret)); - lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); - lwip_md5_finish(&mdContext, hash); - lwip_md5_free(&mdContext); - if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_type = EAPT_MD5CHAP; - eap_send_success(pcb); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); - break; + /* + * Get the secret for authenticating the specified + * host. + */ + if (!get_secret(pcb, rhostname, + pcb->eap.es_server.ea_name, secret, &secret_len, 1)) { + ppp_dbglog("EAP: no MD5 secret for auth of %q", rhostname); + eap_send_failure(pcb); + break; + } + lwip_md5_init(&mdContext); + lwip_md5_starts(&mdContext); + lwip_md5_update(&mdContext, &pcb->eap.es_server.ea_id, 1); + lwip_md5_update(&mdContext, (u_char *)secret, secret_len); + BZERO(secret, sizeof (secret)); + lwip_md5_update(&mdContext, pcb->eap.es_challenge, pcb->eap.es_challen); + lwip_md5_finish(&mdContext, hash); + lwip_md5_free(&mdContext); + if (BCMP(hash, inp, MD5_SIGNATURE_SIZE) != 0) { + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_type = EAPT_MD5CHAP; + eap_send_success(pcb); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, pcb->eap.es_rechallenge); + break; #ifdef USE_SRP - case EAPT_SRP: - if (len < 1) { - ppp_error("EAP: empty SRP Response"); - eap_figure_next_state(pcb, 1); - break; - } - GETCHAR(typenum, inp); - len--; - switch (typenum) { - case EAPSRP_CKEY: - if (pcb->eap.es_server.ea_state != eapSRP1) { - ppp_error("EAP: unexpected SRP Subtype 1 Response"); - eap_figure_next_state(pcb, 1); - break; - } - A.data = inp; - A.len = len; - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); - if (pcb->eap.es_server.ea_skey == NULL) { - /* Client's A value is bogus; terminate now */ - ppp_error("EAP: bogus A value from client"); - eap_send_failure(pcb); - } else { - eap_figure_next_state(pcb, 0); - } - break; - - case EAPSRP_CVALIDATOR: - if (pcb->eap.es_server.ea_state != eapSRP2) { - ppp_error("EAP: unexpected SRP Subtype 2 Response"); - eap_figure_next_state(pcb, 1); - break; - } - if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { - ppp_error("EAP: M1 length %d < %d", len, - sizeof (u32_t) + SHA_DIGESTSIZE); - eap_figure_next_state(pcb, 1); - break; - } - GETLONG(pcb->eap.es_server.ea_keyflags, inp); - ts = (struct t_server *)pcb->eap.es_server.ea_session; - assert(ts != NULL); - if (t_serververify(ts, inp)) { - ppp_info("EAP: unable to validate client identity"); - eap_send_failure(pcb); - break; - } - eap_figure_next_state(pcb, 0); - break; - - case EAPSRP_ACK: - if (pcb->eap.es_server.ea_state != eapSRP3) { - ppp_error("EAP: unexpected SRP Subtype 3 Response"); - eap_send_failure(esp); - break; - } - pcb->eap.es_server.ea_type = EAPT_SRP; - eap_send_success(pcb, esp); - eap_figure_next_state(pcb, 0); - if (pcb->eap.es_rechallenge != 0) - TIMEOUT(eap_rechallenge, pcb, - pcb->eap.es_rechallenge); - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, pcb, - pcb->eap.es_lwrechallenge); - break; - - case EAPSRP_LWRECHALLENGE: - if (pcb->eap.es_server.ea_state != eapSRP4) { - ppp_info("EAP: unexpected SRP Subtype 4 Response"); - return; - } - if (len != SHA_DIGESTSIZE) { - ppp_error("EAP: bad Lightweight rechallenge " - "response"); - return; - } - SHA1Init(&ctxt); - vallen = id; - SHA1Update(&ctxt, &vallen, 1); - SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, - SESSION_KEY_LEN); - SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); - SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, - pcb->eap.es_server.ea_peerlen); - SHA1Final(dig, &ctxt); - if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { - ppp_error("EAP: failed Lightweight rechallenge"); - eap_send_failure(pcb); - break; - } - pcb->eap.es_server.ea_state = eapOpen; - if (pcb->eap.es_lwrechallenge != 0) - TIMEOUT(srp_lwrechallenge, esp, - pcb->eap.es_lwrechallenge); - break; - } - break; + case EAPT_SRP: + if (len < 1) { + ppp_error("EAP: empty SRP Response"); + eap_figure_next_state(pcb, 1); + break; + } + GETCHAR(typenum, inp); + len--; + switch (typenum) { + case EAPSRP_CKEY: + if (pcb->eap.es_server.ea_state != eapSRP1) { + ppp_error("EAP: unexpected SRP Subtype 1 Response"); + eap_figure_next_state(pcb, 1); + break; + } + A.data = inp; + A.len = len; + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + pcb->eap.es_server.ea_skey = t_servergetkey(ts, &A); + if (pcb->eap.es_server.ea_skey == NULL) { + /* Client's A value is bogus; terminate now */ + ppp_error("EAP: bogus A value from client"); + eap_send_failure(pcb); + } else { + eap_figure_next_state(pcb, 0); + } + break; + + case EAPSRP_CVALIDATOR: + if (pcb->eap.es_server.ea_state != eapSRP2) { + ppp_error("EAP: unexpected SRP Subtype 2 Response"); + eap_figure_next_state(pcb, 1); + break; + } + if (len < sizeof (u32_t) + SHA_DIGESTSIZE) { + ppp_error("EAP: M1 length %d < %d", len, + sizeof (u32_t) + SHA_DIGESTSIZE); + eap_figure_next_state(pcb, 1); + break; + } + GETLONG(pcb->eap.es_server.ea_keyflags, inp); + ts = (struct t_server *)pcb->eap.es_server.ea_session; + assert(ts != NULL); + if (t_serververify(ts, inp)) { + ppp_info("EAP: unable to validate client identity"); + eap_send_failure(pcb); + break; + } + eap_figure_next_state(pcb, 0); + break; + + case EAPSRP_ACK: + if (pcb->eap.es_server.ea_state != eapSRP3) { + ppp_error("EAP: unexpected SRP Subtype 3 Response"); + eap_send_failure(esp); + break; + } + pcb->eap.es_server.ea_type = EAPT_SRP; + eap_send_success(pcb, esp); + eap_figure_next_state(pcb, 0); + if (pcb->eap.es_rechallenge != 0) + TIMEOUT(eap_rechallenge, pcb, + pcb->eap.es_rechallenge); + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, pcb, + pcb->eap.es_lwrechallenge); + break; + + case EAPSRP_LWRECHALLENGE: + if (pcb->eap.es_server.ea_state != eapSRP4) { + ppp_info("EAP: unexpected SRP Subtype 4 Response"); + return; + } + if (len != SHA_DIGESTSIZE) { + ppp_error("EAP: bad Lightweight rechallenge " + "response"); + return; + } + SHA1Init(&ctxt); + vallen = id; + SHA1Update(&ctxt, &vallen, 1); + SHA1Update(&ctxt, pcb->eap.es_server.ea_skey, + SESSION_KEY_LEN); + SHA1Update(&ctxt, pcb->eap.es_challenge, pcb->eap.es_challen); + SHA1Update(&ctxt, pcb->eap.es_server.ea_peer, + pcb->eap.es_server.ea_peerlen); + SHA1Final(dig, &ctxt); + if (BCMP(dig, inp, SHA_DIGESTSIZE) != 0) { + ppp_error("EAP: failed Lightweight rechallenge"); + eap_send_failure(pcb); + break; + } + pcb->eap.es_server.ea_state = eapOpen; + if (pcb->eap.es_lwrechallenge != 0) + TIMEOUT(srp_lwrechallenge, esp, + pcb->eap.es_lwrechallenge); + break; + } + break; #endif /* USE_SRP */ - default: - /* This can't happen. */ - ppp_error("EAP: unknown Response type %d; ignored", typenum); - return; - } - - if (pcb->settings.eap_timeout_time > 0) { - UNTIMEOUT(eap_server_timeout, pcb); - } - - if (pcb->eap.es_server.ea_state != eapBadAuth && - pcb->eap.es_server.ea_state != eapOpen) { - pcb->eap.es_server.ea_id++; - eap_send_request(pcb); - } + default: + /* This can't happen. */ + ppp_error("EAP: unknown Response type %d; ignored", typenum); + return; + } + + if (pcb->settings.eap_timeout_time > 0) { + UNTIMEOUT(eap_server_timeout, pcb); + } + + if (pcb->eap.es_server.ea_state != eapBadAuth && + pcb->eap.es_server.ea_state != eapOpen) { + pcb->eap.es_server.ea_id++; + eap_send_request(pcb); + } } #endif /* PPP_SERVER */ @@ -2015,105 +2015,105 @@ static void eap_response(ppp_pcb *pcb, u_char *inp, int id, int len) { * eap_success - Receive EAP Success message (client mode). */ static void eap_success(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); - - if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected success message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - return; - } - - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } - - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } - - pcb->eap.es_client.ea_state = eapOpen; - auth_withpeer_success(pcb, PPP_EAP, 0); + LWIP_UNUSED_ARG(id); + + if (pcb->eap.es_client.ea_state != eapOpen && !eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected success message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + return; + } + + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } + + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } + + pcb->eap.es_client.ea_state = eapOpen; + auth_withpeer_success(pcb, PPP_EAP, 0); } /* * eap_failure - Receive EAP Failure message (client mode). */ static void eap_failure(ppp_pcb *pcb, u_char *inp, int id, int len) { - LWIP_UNUSED_ARG(id); + LWIP_UNUSED_ARG(id); - if (!eap_client_active(pcb)) { - ppp_dbglog("EAP unexpected failure message in state %s (%d)", - eap_state_name(pcb->eap.es_client.ea_state), - pcb->eap.es_client.ea_state); - } + if (!eap_client_active(pcb)) { + ppp_dbglog("EAP unexpected failure message in state %s (%d)", + eap_state_name(pcb->eap.es_client.ea_state), + pcb->eap.es_client.ea_state); + } - if (pcb->settings.eap_req_time > 0) { - UNTIMEOUT(eap_client_timeout, pcb); - } + if (pcb->settings.eap_req_time > 0) { + UNTIMEOUT(eap_client_timeout, pcb); + } - if (len > 0) { - /* This is odd. The spec doesn't allow for this. */ - PRINTMSG(inp, len); - } + if (len > 0) { + /* This is odd. The spec doesn't allow for this. */ + PRINTMSG(inp, len); + } - pcb->eap.es_client.ea_state = eapBadAuth; + pcb->eap.es_client.ea_state = eapBadAuth; - ppp_error("EAP: peer reports authentication failure"); - auth_withpeer_fail(pcb, PPP_EAP); + ppp_error("EAP: peer reports authentication failure"); + auth_withpeer_fail(pcb, PPP_EAP); } /* * eap_input - Handle received EAP message. */ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { - u_char code, id; - int len; - - /* - * Parse header (code, id and length). If packet too short, - * drop it. - */ - if (inlen < EAP_HEADERLEN) { - ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) { - ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, - EAP_HEADERLEN, inlen); - return; - } - len -= EAP_HEADERLEN; - - /* Dispatch based on message code */ - switch (code) { - case EAP_REQUEST: - eap_request(pcb, inp, id, len); - break; + u_char code, id; + int len; + + /* + * Parse header (code, id and length). If packet too short, + * drop it. + */ + if (inlen < EAP_HEADERLEN) { + ppp_error("EAP: packet too short: %d < %d", inlen, EAP_HEADERLEN); + return; + } + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) { + ppp_error("EAP: packet has illegal length field %d (%d..%d)", len, + EAP_HEADERLEN, inlen); + return; + } + len -= EAP_HEADERLEN; + + /* Dispatch based on message code */ + switch (code) { + case EAP_REQUEST: + eap_request(pcb, inp, id, len); + break; #if PPP_SERVER - case EAP_RESPONSE: - eap_response(pcb, inp, id, len); - break; + case EAP_RESPONSE: + eap_response(pcb, inp, id, len); + break; #endif /* PPP_SERVER */ - case EAP_SUCCESS: - eap_success(pcb, inp, id, len); - break; + case EAP_SUCCESS: + eap_success(pcb, inp, id, len); + break; - case EAP_FAILURE: - eap_failure(pcb, inp, id, len); - break; + case EAP_FAILURE: + eap_failure(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - /* Note: it's not legal to send EAP Nak here. */ - ppp_warn("EAP: unknown code %d received", code); - break; - } + default: /* XXX Need code reject */ + /* Note: it's not legal to send EAP Nak here. */ + ppp_warn("EAP: unknown code %d received", code); + break; + } } #if PRINTPKT_SUPPORT @@ -2121,302 +2121,302 @@ static void eap_input(ppp_pcb *pcb, u_char *inp, int inlen) { * eap_printpkt - print the contents of an EAP packet. */ static const char* const eap_codenames[] = { - "Request", "Response", "Success", "Failure" + "Request", "Response", "Success", "Failure" }; static const char* const eap_typenames[] = { - "Identity", "Notification", "Nak", "MD5-Challenge", - "OTP", "Generic-Token", NULL, NULL, - "RSA", "DSS", "KEA", "KEA-Validate", - "TLS", "Defender", "Windows 2000", "Arcot", - "Cisco", "Nokia", "SRP" + "Identity", "Notification", "Nak", "MD5-Challenge", + "OTP", "Generic-Token", NULL, NULL, + "RSA", "DSS", "KEA", "KEA-Validate", + "TLS", "Defender", "Windows 2000", "Arcot", + "Cisco", "Nokia", "SRP" }; static int eap_printpkt(const u_char *inp, int inlen, void (*printer) (void *, const char *, ...), void *arg) { - int code, id, len, rtype, vallen; - const u_char *pstart; - u32_t uval; - - if (inlen < EAP_HEADERLEN) - return (0); - pstart = inp; - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < EAP_HEADERLEN || len > inlen) - return (0); - - if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) - printer(arg, " %s", eap_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= EAP_HEADERLEN; - switch (code) { - case EAP_REQUEST: - if (len < 1) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - case EAPT_NOTIFICATION: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_MD5CHAP: - if (len <= 0) - break; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 3) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CHALLENGE: - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - if (vallen > 0) { - printer(arg, " "); - } else { - printer(arg, " "); - } - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen >= len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - if (vallen == 0) { - printer(arg, " "); - } else { - printer(arg, " ", vallen, inp); - } - INCPTR(vallen, inp); - len -= vallen; - if (len == 0) { - printer(arg, " "); - } else { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_SKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_SVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - printer(arg, " ", len, inp, - len < SHA_DIGESTSIZE ? "?" : ""); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_RESPONSE: - if (len < 1) - break; - GETCHAR(rtype, inp); - len--; - if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " %s", eap_typenames[rtype-1]); - else - printer(arg, " type=0x%x", rtype); - switch (rtype) { - case EAPT_IDENTITY: - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } - break; - - case EAPT_NAK: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(rtype, inp); - len--; - printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) - printer(arg, " (%s)", eap_typenames[rtype-1]); - printer(arg, ">"); - break; - - case EAPT_MD5CHAP: - if (len <= 0) { - printer(arg, " "); - break; - } - GETCHAR(vallen, inp); - len--; - if (vallen > len) - goto truncated; - printer(arg, " ", vallen, inp); - INCPTR(vallen, inp); - len -= vallen; - if (len > 0) { - printer(arg, " "); - INCPTR(len, inp); - len = 0; - } else { - printer(arg, " "); - } - break; - - case EAPT_SRP: - if (len < 1) - goto truncated; - GETCHAR(vallen, inp); - len--; - printer(arg, "-%d", vallen); - switch (vallen) { - case EAPSRP_CKEY: - printer(arg, " ", len, inp); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_CVALIDATOR: - if (len < (int)sizeof (u32_t)) - break; - GETLONG(uval, inp); - len -= sizeof (u32_t); - if (uval & SRPVAL_EBIT) { - printer(arg, " E"); - uval &= ~SRPVAL_EBIT; - } - if (uval != 0) { - printer(arg, " f<%X>", uval); - } - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - INCPTR(len, inp); - len = 0; - break; - - case EAPSRP_ACK: - break; - - case EAPSRP_LWRECHALLENGE: - printer(arg, " ", len, inp, - len == SHA_DIGESTSIZE ? "" : "?"); - if ((vallen = len) > SHA_DIGESTSIZE) - vallen = SHA_DIGESTSIZE; - INCPTR(vallen, inp); - len -= vallen; - break; - default: - break; - } - break; - default: - break; - } - break; - - case EAP_SUCCESS: /* No payload expected for these! */ - case EAP_FAILURE: - default: - break; - - truncated: - printer(arg, " "); - break; - } - - if (len > 8) - printer(arg, "%8B...", inp); - else if (len > 0) - printer(arg, "%.*B", len, inp); - INCPTR(len, inp); - - return (inp - pstart); + int code, id, len, rtype, vallen; + const u_char *pstart; + u32_t uval; + + if (inlen < EAP_HEADERLEN) + return (0); + pstart = inp; + GETCHAR(code, inp); + GETCHAR(id, inp); + GETSHORT(len, inp); + if (len < EAP_HEADERLEN || len > inlen) + return (0); + + if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(eap_codenames)) + printer(arg, " %s", eap_codenames[code-1]); + else + printer(arg, " code=0x%x", code); + printer(arg, " id=0x%x", id); + len -= EAP_HEADERLEN; + switch (code) { + case EAP_REQUEST: + if (len < 1) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + case EAPT_NOTIFICATION: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_MD5CHAP: + if (len <= 0) + break; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 3) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CHALLENGE: + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + if (vallen > 0) { + printer(arg, " "); + } else { + printer(arg, " "); + } + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen >= len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + if (vallen == 0) { + printer(arg, " "); + } else { + printer(arg, " ", vallen, inp); + } + INCPTR(vallen, inp); + len -= vallen; + if (len == 0) { + printer(arg, " "); + } else { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_SKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_SVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + printer(arg, " ", len, inp, + len < SHA_DIGESTSIZE ? "?" : ""); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_RESPONSE: + if (len < 1) + break; + GETCHAR(rtype, inp); + len--; + if (rtype >= 1 && rtype <= (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " %s", eap_typenames[rtype-1]); + else + printer(arg, " type=0x%x", rtype); + switch (rtype) { + case EAPT_IDENTITY: + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } + break; + + case EAPT_NAK: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(rtype, inp); + len--; + printer(arg, " = 1 && rtype < (int)LWIP_ARRAYSIZE(eap_typenames)) + printer(arg, " (%s)", eap_typenames[rtype-1]); + printer(arg, ">"); + break; + + case EAPT_MD5CHAP: + if (len <= 0) { + printer(arg, " "); + break; + } + GETCHAR(vallen, inp); + len--; + if (vallen > len) + goto truncated; + printer(arg, " ", vallen, inp); + INCPTR(vallen, inp); + len -= vallen; + if (len > 0) { + printer(arg, " "); + INCPTR(len, inp); + len = 0; + } else { + printer(arg, " "); + } + break; + + case EAPT_SRP: + if (len < 1) + goto truncated; + GETCHAR(vallen, inp); + len--; + printer(arg, "-%d", vallen); + switch (vallen) { + case EAPSRP_CKEY: + printer(arg, " ", len, inp); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_CVALIDATOR: + if (len < (int)sizeof (u32_t)) + break; + GETLONG(uval, inp); + len -= sizeof (u32_t); + if (uval & SRPVAL_EBIT) { + printer(arg, " E"); + uval &= ~SRPVAL_EBIT; + } + if (uval != 0) { + printer(arg, " f<%X>", uval); + } + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + INCPTR(len, inp); + len = 0; + break; + + case EAPSRP_ACK: + break; + + case EAPSRP_LWRECHALLENGE: + printer(arg, " ", len, inp, + len == SHA_DIGESTSIZE ? "" : "?"); + if ((vallen = len) > SHA_DIGESTSIZE) + vallen = SHA_DIGESTSIZE; + INCPTR(vallen, inp); + len -= vallen; + break; + default: + break; + } + break; + default: + break; + } + break; + + case EAP_SUCCESS: /* No payload expected for these! */ + case EAP_FAILURE: + default: + break; + + truncated: + printer(arg, " "); + break; + } + + if (len > 8) + printer(arg, "%8B...", inp); + else if (len > 0) + printer(arg, "%.*B", len, inp); + INCPTR(len, inp); + + return (inp - pstart); } #endif /* PRINTPKT_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ecp.c b/components/net/lwip-2.1.2/src/netif/ppp/ecp.c index 5b3b331560..4d84f60931 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ecp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ecp.c @@ -92,8 +92,8 @@ static void ecp_protrej (int unit); */ #if PRINTPKT_SUPPORT static int ecp_printpkt (const u_char *pkt, int len, - void (*printer) (void *, char *, ...), - void *arg); + void (*printer) (void *, char *, ...), + void *arg); #endif /* PRINTPKT_SUPPORT */ /* static void ecp_datainput (int unit, u_char *pkt, int len); @@ -129,10 +129,10 @@ const struct protent ecp_protent = { }; fsm ecp_fsm[NUM_PPP]; -ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ -ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ -ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ -ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ +ecp_options ecp_wantoptions[NUM_PPP]; /* what to request the peer to use */ +ecp_options ecp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ +ecp_options ecp_allowoptions[NUM_PPP]; /* what we'll agree to do */ +ecp_options ecp_hisoptions[NUM_PPP]; /* what we agreed to do */ static const fsm_callbacks ecp_callbacks = { NULL, /* ecp_resetci, */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/eui64.c b/components/net/lwip-2.1.2/src/netif/ppp/eui64.c index 9e25fc4c2f..01493bc1f8 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/eui64.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/eui64.c @@ -48,8 +48,8 @@ char *eui64_ntoa(eui64_t e) { static char buf[20]; sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", - e.e8[0], e.e8[1], e.e8[2], e.e8[3], - e.e8[4], e.e8[5], e.e8[6], e.e8[7]); + e.e8[0], e.e8[1], e.e8[2], e.e8[3], + e.e8[4], e.e8[5], e.e8[6], e.e8[7]); return buf; } diff --git a/components/net/lwip-2.1.2/src/netif/ppp/fsm.c b/components/net/lwip-2.1.2/src/netif/ppp/fsm.c index 9df98b1ef7..b1f08affff 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/fsm.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/fsm.c @@ -68,7 +68,7 @@ static void fsm_rtermack(fsm *f); static void fsm_rcoderej(fsm *f, u_char *inp, int len); static void fsm_sconfreq(fsm *f, int retransmit); -#define PROTO_NAME(f) ((f)->callbacks->proto_name) +#define PROTO_NAME(f) ((f)->callbacks->proto_name) /* * fsm_init - Initialize fsm. @@ -79,7 +79,7 @@ void fsm_init(fsm *f) { ppp_pcb *pcb = f->pcb; f->state = PPP_FSM_INITIAL; f->flags = 0; - f->id = 0; /* XXX Start with random id? */ + f->id = 0; /* XXX Start with random id? */ f->maxnakloops = pcb->settings.fsm_max_nak_loops; f->term_reason_len = 0; } @@ -91,22 +91,22 @@ void fsm_init(fsm *f) { void fsm_lowerup(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STARTING: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -119,37 +119,37 @@ void fsm_lowerup(fsm *f) { void fsm_lowerdown(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSED: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_INITIAL; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_INITIAL; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_STARTING; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; + f->state = PPP_FSM_STARTING; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + break; case PPP_FSM_OPENED: - if( f->callbacks->down ) - (*f->callbacks->down)(f); - f->state = PPP_FSM_STARTING; - break; + if( f->callbacks->down ) + (*f->callbacks->down)(f); + f->state = PPP_FSM_STARTING; + break; default: - FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -160,34 +160,34 @@ void fsm_lowerdown(fsm *f) { void fsm_open(fsm *f) { switch( f->state ){ case PPP_FSM_INITIAL: - f->state = PPP_FSM_STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; + f->state = PPP_FSM_STARTING; + if( f->callbacks->starting ) + (*f->callbacks->starting)(f); + break; case PPP_FSM_CLOSED: - if( f->flags & OPT_SILENT ) - f->state = PPP_FSM_STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - } - break; + if( f->flags & OPT_SILENT ) + f->state = PPP_FSM_STOPPED; + else { + /* Send an initial configure-request */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + } + break; case PPP_FSM_CLOSING: - f->state = PPP_FSM_STOPPING; - /* fall through */ - /* no break */ + f->state = PPP_FSM_STOPPING; + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: case PPP_FSM_OPENED: - if( f->flags & OPT_RESTART ){ - fsm_lowerdown(f); - fsm_lowerup(f); - } - break; + if( f->flags & OPT_RESTART ){ + fsm_lowerdown(f); + fsm_lowerup(f); + } + break; default: - break; + break; } } @@ -201,25 +201,25 @@ static void terminate_layer(fsm *f, int nextstate) { ppp_pcb *pcb = f->pcb; if( f->state != PPP_FSM_OPENED ) - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ else if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers we're down */ + (*f->callbacks->down)(f); /* Inform upper layers we're down */ /* Init restart counter and send Terminate-Request */ f->retransmits = pcb->settings.fsm_max_term_transmits; fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); + (const u_char *) f->term_reason, f->term_reason_len); if (f->retransmits == 0) { - /* - * User asked for no terminate requests at all; just close it. - * We've already fired off one Terminate-Request just to be nice - * to the peer, but we're not going to wait for a reply. - */ - f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - return; + /* + * User asked for no terminate requests at all; just close it. + * We've already fired off one Terminate-Request just to be nice + * to the peer, but we're not going to wait for a reply. + */ + f->state = nextstate == PPP_FSM_CLOSING ? PPP_FSM_CLOSED : PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + return; } TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); @@ -239,23 +239,23 @@ void fsm_close(fsm *f, const char *reason) { f->term_reason_len = (reason == NULL? 0: (u8_t)LWIP_MIN(strlen(reason), 0xFF) ); switch( f->state ){ case PPP_FSM_STARTING: - f->state = PPP_FSM_INITIAL; - break; + f->state = PPP_FSM_INITIAL; + break; case PPP_FSM_STOPPED: - f->state = PPP_FSM_CLOSED; - break; + f->state = PPP_FSM_CLOSED; + break; case PPP_FSM_STOPPING: - f->state = PPP_FSM_CLOSING; - break; + f->state = PPP_FSM_CLOSING; + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_CLOSING); - break; + terminate_layer(f, PPP_FSM_CLOSING); + break; default: - break; + break; } } @@ -270,44 +270,44 @@ static void fsm_timeout(void *arg) { switch (f->state) { case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - if( f->retransmits <= 0 ){ - /* - * We've waited for an ack long enough. Peer probably heard us. - */ - f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - } else { - /* Send Terminate-Request */ - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (const u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - --f->retransmits; - } - break; + if( f->retransmits <= 0 ){ + /* + * We've waited for an ack long enough. Peer probably heard us. + */ + f->state = (f->state == PPP_FSM_CLOSING)? PPP_FSM_CLOSED: PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + } else { + /* Send Terminate-Request */ + fsm_sdata(f, TERMREQ, f->reqid = ++f->id, + (const u_char *) f->term_reason, f->term_reason_len); + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + --f->retransmits; + } + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - if (f->retransmits <= 0) { - ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); - f->state = PPP_FSM_STOPPED; - if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) - (*f->callbacks->finished)(f); - - } else { - /* Retransmit the configure-request */ - if (f->callbacks->retransmit) - (*f->callbacks->retransmit)(f); - fsm_sconfreq(f, 1); /* Re-send Configure-Request */ - if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; - } - break; + if (f->retransmits <= 0) { + ppp_warn("%s: timeout sending Config-Requests", PROTO_NAME(f)); + f->state = PPP_FSM_STOPPED; + if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) + (*f->callbacks->finished)(f); + + } else { + /* Retransmit the configure-request */ + if (f->callbacks->retransmit) + (*f->callbacks->retransmit)(f); + fsm_sconfreq(f, 1); /* Re-send Configure-Request */ + if( f->state == PPP_FSM_ACKRCVD ) + f->state = PPP_FSM_REQSENT; + } + break; default: - FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -326,26 +326,26 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ inp = inpacket; if (l < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); + return; } if (len > l) { - FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); + return; } - len -= HEADERLEN; /* subtract header length */ + len -= HEADERLEN; /* subtract header length */ if( f->state == PPP_FSM_INITIAL || f->state == PPP_FSM_STARTING ){ - FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", - f->protocol, f->state)); - return; + FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", + f->protocol, f->state)); + return; } /* @@ -353,35 +353,35 @@ void fsm_input(fsm *f, u_char *inpacket, int l) { */ switch (code) { case CONFREQ: - fsm_rconfreq(f, id, inp, len); - break; - + fsm_rconfreq(f, id, inp, len); + break; + case CONFACK: - fsm_rconfack(f, id, inp, len); - break; - + fsm_rconfack(f, id, inp, len); + break; + case CONFNAK: case CONFREJ: - fsm_rconfnakrej(f, code, id, inp, len); - break; - + fsm_rconfnakrej(f, code, id, inp, len); + break; + case TERMREQ: - fsm_rtermreq(f, id, inp, len); - break; - + fsm_rtermreq(f, id, inp, len); + break; + case TERMACK: - fsm_rtermack(f); - break; - + fsm_rtermack(f); + break; + case CODEREJ: - fsm_rcoderej(f, inp, len); - break; - + fsm_rcoderej(f, inp, len); + break; + default: - if( !f->callbacks->extcode - || !(*f->callbacks->extcode)(f, code, id, inp, len) ) - fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); - break; + if( !f->callbacks->extcode + || !(*f->callbacks->extcode)(f, code, id, inp, len) ) + fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); + break; } } @@ -394,61 +394,61 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { switch( f->state ){ case PPP_FSM_CLOSED: - /* Go away, we're closed */ - fsm_sdata(f, TERMACK, id, NULL, 0); - return; + /* Go away, we're closed */ + fsm_sdata(f, TERMACK, id, NULL, 0); + return; case PPP_FSM_CLOSING: case PPP_FSM_STOPPING: - return; + return; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if( f->callbacks->down ) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_STOPPED: - /* Negotiation started by our peer */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Negotiation started by our peer */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } /* * Pass the requested configuration options * to protocol-specific code for checking. */ - if (f->callbacks->reqci){ /* Check CI */ - reject_if_disagree = (f->nakloops >= f->maxnakloops); - code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); + if (f->callbacks->reqci){ /* Check CI */ + reject_if_disagree = (f->nakloops >= f->maxnakloops); + code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); } else if (len) - code = CONFREJ; /* Reject all CI */ + code = CONFREJ; /* Reject all CI */ else - code = CONFACK; + code = CONFACK; /* send the Ack, Nak or Rej to the peer */ fsm_sdata(f, code, id, inp, len); if (code == CONFACK) { - if (f->state == PPP_FSM_ACKRCVD) { - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - } else - f->state = PPP_FSM_ACKSENT; - f->nakloops = 0; + if (f->state == PPP_FSM_ACKRCVD) { + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + } else + f->state = PPP_FSM_ACKSENT; + f->nakloops = 0; } else { - /* we sent CONFACK or CONFREJ */ - if (f->state != PPP_FSM_ACKRCVD) - f->state = PPP_FSM_REQSENT; - if( code == CONFNAK ) - ++f->nakloops; + /* we sent CONFACK or CONFREJ */ + if (f->state != PPP_FSM_ACKRCVD) + f->state = PPP_FSM_REQSENT; + if( code == CONFNAK ) + ++f->nakloops; } } @@ -459,13 +459,13 @@ static void fsm_rconfreq(fsm *f, u_char id, u_char *inp, int len) { static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { ppp_pcb *pcb = f->pcb; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if( !(f->callbacks->ackci? (*f->callbacks->ackci)(f, inp, len): - (len == 0)) ){ - /* Ack is bad - ignore it */ - ppp_error("Received bad configure-ack: %P", inp, len); - return; + (len == 0)) ){ + /* Ack is bad - ignore it */ + ppp_error("Received bad configure-ack: %P", inp, len); + return; } f->seen_ack = 1; f->rnakloops = 0; @@ -473,38 +473,38 @@ static void fsm_rconfack(fsm *f, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: - f->state = PPP_FSM_ACKRCVD; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - break; + f->state = PPP_FSM_ACKRCVD; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + break; case PPP_FSM_ACKRCVD: - /* Huh? an extra valid Ack? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Huh? an extra valid Ack? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = PPP_FSM_OPENED; - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - break; + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + f->state = PPP_FSM_OPENED; + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + if (f->callbacks->up) + (*f->callbacks->up)(f); /* Inform upper layers */ + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -516,24 +516,24 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { int ret; int treat_as_reject; - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ + if (id != f->reqid || f->seen_ack) /* Expected id? */ + return; /* Nope, toss... */ if (code == CONFNAK) { - ++f->rnakloops; - treat_as_reject = (f->rnakloops >= f->maxnakloops); - if (f->callbacks->nakci == NULL - || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { - ppp_error("Received bad configure-nak: %P", inp, len); - return; - } + ++f->rnakloops; + treat_as_reject = (f->rnakloops >= f->maxnakloops); + if (f->callbacks->nakci == NULL + || !(ret = f->callbacks->nakci(f, inp, len, treat_as_reject))) { + ppp_error("Received bad configure-nak: %P", inp, len); + return; + } } else { - f->rnakloops = 0; - if (f->callbacks->rejci == NULL - || !(ret = f->callbacks->rejci(f, inp, len))) { - ppp_error("Received bad configure-rej: %P", inp, len); - return; - } + f->rnakloops = 0; + if (f->callbacks->rejci == NULL + || !(ret = f->callbacks->rejci(f, inp, len))) { + ppp_error("Received bad configure-rej: %P", inp, len); + return; + } } f->seen_ack = 1; @@ -541,35 +541,35 @@ static void fsm_rconfnakrej(fsm *f, int code, int id, u_char *inp, int len) { switch (f->state) { case PPP_FSM_CLOSED: case PPP_FSM_STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; + fsm_sdata(f, TERMACK, id, NULL, 0); + break; case PPP_FSM_REQSENT: case PPP_FSM_ACKSENT: - /* They didn't agree to what we wanted - try another request */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - if (ret < 0) - f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ - else - fsm_sconfreq(f, 0); /* Send Configure-Request */ - break; + /* They didn't agree to what we wanted - try another request */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + if (ret < 0) + f->state = PPP_FSM_STOPPED; /* kludge for stopping CCP */ + else + fsm_sconfreq(f, 0); /* Send Configure-Request */ + break; case PPP_FSM_ACKRCVD: - /* Got a Nak/reject when we had already had an Ack?? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + /* Got a Nak/reject when we had already had an Ack?? oh well... */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = PPP_FSM_REQSENT; - break; + /* Go down and restart negotiation */ + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); /* Send initial Configure-Request */ + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -583,22 +583,22 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { switch (f->state) { case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ - break; + f->state = PPP_FSM_REQSENT; /* Start over but keep trying */ + break; case PPP_FSM_OPENED: - if (len > 0) { - ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); - } else - ppp_info("%s terminated by peer", PROTO_NAME(f)); - f->retransmits = 0; - f->state = PPP_FSM_STOPPING; - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); - break; + if (len > 0) { + ppp_info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); + } else + ppp_info("%s terminated by peer", PROTO_NAME(f)); + f->retransmits = 0; + f->state = PPP_FSM_STOPPING; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + TIMEOUT(fsm_timeout, f, pcb->settings.fsm_timeout_time); + break; default: - break; + break; } fsm_sdata(f, TERMACK, id, NULL, 0); @@ -611,30 +611,30 @@ static void fsm_rtermreq(fsm *f, int id, u_char *p, int len) { static void fsm_rtermack(fsm *f) { switch (f->state) { case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: - UNTIMEOUT(fsm_timeout, f); - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + UNTIMEOUT(fsm_timeout, f); + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_ACKRCVD: - f->state = PPP_FSM_REQSENT; - break; + f->state = PPP_FSM_REQSENT; + break; case PPP_FSM_OPENED: - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); - f->state = PPP_FSM_REQSENT; - break; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ + fsm_sconfreq(f, 0); + f->state = PPP_FSM_REQSENT; + break; default: - break; + break; } } @@ -646,15 +646,15 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { u_char code, id; if (len < HEADERLEN) { - FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); - return; + FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); ppp_warn("%s: Rcvd Code-Reject for code %d, id %d", PROTO_NAME(f), code, id); if( f->state == PPP_FSM_ACKRCVD ) - f->state = PPP_FSM_REQSENT; + f->state = PPP_FSM_REQSENT; } @@ -666,36 +666,36 @@ static void fsm_rcoderej(fsm *f, u_char *inp, int len) { void fsm_protreject(fsm *f) { switch( f->state ){ case PPP_FSM_CLOSING: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_CLOSED: - f->state = PPP_FSM_CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_CLOSED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_STOPPING: case PPP_FSM_REQSENT: case PPP_FSM_ACKRCVD: case PPP_FSM_ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - /* no break */ + UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ + /* fall through */ + /* no break */ case PPP_FSM_STOPPED: - f->state = PPP_FSM_STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; + f->state = PPP_FSM_STOPPED; + if( f->callbacks->finished ) + (*f->callbacks->finished)(f); + break; case PPP_FSM_OPENED: - terminate_layer(f, PPP_FSM_STOPPING); - break; + terminate_layer(f, PPP_FSM_STOPPING); + break; default: - FSMDEBUG(("%s: Protocol-reject event in state %d!", - PROTO_NAME(f), f->state)); - /* no break */ + FSMDEBUG(("%s: Protocol-reject event in state %d!", + PROTO_NAME(f), f->state)); + /* no break */ } } @@ -710,17 +710,17 @@ static void fsm_sconfreq(fsm *f, int retransmit) { int cilen; if( f->state != PPP_FSM_REQSENT && f->state != PPP_FSM_ACKRCVD && f->state != PPP_FSM_ACKSENT ){ - /* Not currently negotiating - reset options */ - if( f->callbacks->resetci ) - (*f->callbacks->resetci)(f); - f->nakloops = 0; - f->rnakloops = 0; + /* Not currently negotiating - reset options */ + if( f->callbacks->resetci ) + (*f->callbacks->resetci)(f); + f->nakloops = 0; + f->rnakloops = 0; } if( !retransmit ){ - /* New request - reset retransmission counter, use new ID */ - f->retransmits = pcb->settings.fsm_max_conf_req_transmits; - f->reqid = ++f->id; + /* New request - reset retransmission counter, use new ID */ + f->retransmits = pcb->settings.fsm_max_conf_req_transmits; + f->reqid = ++f->id; } f->seen_ack = 0; @@ -729,11 +729,11 @@ static void fsm_sconfreq(fsm *f, int retransmit) { * Make up the request packet */ if( f->callbacks->cilen && f->callbacks->addci ){ - cilen = (*f->callbacks->cilen)(f); - if( cilen > pcb->peer_mru - HEADERLEN ) - cilen = pcb->peer_mru - HEADERLEN; + cilen = (*f->callbacks->cilen)(f); + if( cilen > pcb->peer_mru - HEADERLEN ) + cilen = pcb->peer_mru - HEADERLEN; } else - cilen = 0; + cilen = 0; p = pbuf_alloc(PBUF_RAW, (u16_t)(cilen + HEADERLEN + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); if(NULL == p) @@ -750,8 +750,8 @@ static void fsm_sconfreq(fsm *f, int retransmit) { PUTCHAR(f->reqid, outp); PUTSHORT(cilen + HEADERLEN, outp); if (cilen != 0) { - (*f->callbacks->addci)(f, outp, &cilen); - LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); + (*f->callbacks->addci)(f, outp, &cilen); + LWIP_ASSERT("cilen == p->len - HEADERLEN - PPP_HDRLEN", cilen == p->len - HEADERLEN - PPP_HDRLEN); } ppp_write(pcb, p); @@ -775,7 +775,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) /* Adjust length to be smaller than MTU */ if (datalen > pcb->peer_mru - HEADERLEN) - datalen = pcb->peer_mru - HEADERLEN; + datalen = pcb->peer_mru - HEADERLEN; outlen = datalen + HEADERLEN; p = pbuf_alloc(PBUF_RAW, (u16_t)(outlen + PPP_HDRLEN), PPP_CTRL_PBUF_TYPE); @@ -788,7 +788,7 @@ void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen) outp = (u_char*)p->payload; if (datalen) /* && data != outp + PPP_HDRLEN + HEADERLEN) -- was only for fsm_sconfreq() */ - MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); + MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen); MAKEHEADER(outp, f->protocol); PUTCHAR(code, outp); PUTCHAR(id, outp); diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c b/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c index feb1f4becc..b7c766eb0b 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ipcp.c @@ -66,15 +66,15 @@ #if 0 /* UNUSED */ /* global vars */ -u32_t netmask = 0; /* IP netmask to set on interface */ +u32_t netmask = 0; /* IP netmask to set on interface */ #endif /* UNUSED */ #if 0 /* UNUSED */ -bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ +bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ #endif /* UNUSED */ #if 0 /* moved to ppp_settings */ -bool noremoteip = 0; /* Let him have no IP address */ +bool noremoteip = 0; /* Let him have no IP address */ #endif /* moved to ppp_setting */ #if 0 /* UNUSED */ @@ -96,47 +96,47 @@ struct notifier *ip_down_notifier = NULL; /* local vars */ #if 0 /* moved to ppp_pcb */ -static int default_route_set[NUM_PPP]; /* Have set up a default route */ -static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ -static int ipcp_is_up; /* have called np_up() */ -static int ipcp_is_open; /* haven't called np_finished() */ -static bool ask_for_local; /* request our address from peer */ +static int default_route_set[NUM_PPP]; /* Have set up a default route */ +static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ +static int ipcp_is_up; /* have called np_up() */ +static int ipcp_is_open; /* haven't called np_finished() */ +static bool ask_for_local; /* request our address from peer */ #endif /* moved to ppp_pcb */ #if 0 /* UNUSED */ -static char vj_value[8]; /* string form of vj option value */ -static char netmask_str[20]; /* string form of netmask value */ +static char vj_value[8]; /* string form of vj option value */ +static char netmask_str[20]; /* string form of netmask value */ #endif /* UNUSED */ /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void ipcp_resetci(fsm *f); /* Reset our CI */ -static int ipcp_cilen(fsm *f); /* Return length of our CI */ +static void ipcp_resetci(fsm *f); /* Reset our CI */ +static int ipcp_cilen(fsm *f); /* Return length of our CI */ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI */ -static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ +static int ipcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject);/* Peer nak'd our CI */ -static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ +static int ipcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree); /* Rcv CI */ -static void ipcp_up(fsm *f); /* We're UP */ -static void ipcp_down(fsm *f); /* We're DOWN */ -static void ipcp_finished(fsm *f); /* Don't need lower layer */ +static void ipcp_up(fsm *f); /* We're UP */ +static void ipcp_down(fsm *f); /* We're DOWN */ +static void ipcp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ - ipcp_resetci, /* Reset our Configuration Information */ - ipcp_cilen, /* Length of our Configuration Information */ - ipcp_addci, /* Add our Configuration Information */ - ipcp_ackci, /* ACK our Configuration Information */ - ipcp_nakci, /* NAK our Configuration Information */ - ipcp_rejci, /* Reject our Configuration Information */ - ipcp_reqci, /* Request peer's Configuration Information */ - ipcp_up, /* Called when fsm reaches OPENED state */ - ipcp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPCP" /* String name of protocol */ + ipcp_resetci, /* Reset our Configuration Information */ + ipcp_cilen, /* Length of our Configuration Information */ + ipcp_addci, /* Add our Configuration Information */ + ipcp_ackci, /* ACK our Configuration Information */ + ipcp_nakci, /* NAK our Configuration Information */ + ipcp_rejci, /* Reject our Configuration Information */ + ipcp_reqci, /* Request peer's Configuration Information */ + ipcp_up, /* Called when fsm reaches OPENED state */ + ipcp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPCP" /* String name of protocol */ }; /* @@ -209,13 +209,13 @@ static option_t ipcp_option_list[] = { &ipcp_wantoptions[0].default_route }, { "replacedefaultroute", o_bool, - &ipcp_wantoptions[0].replace_default_route, + &ipcp_wantoptions[0].replace_default_route, "Replace default route", 1 }, { "noreplacedefaultroute", o_bool, - &ipcp_allowoptions[0].replace_default_route, + &ipcp_allowoptions[0].replace_default_route, "Never replace default route", OPT_A2COPY, - &ipcp_wantoptions[0].replace_default_route }, + &ipcp_wantoptions[0].replace_default_route }, { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, @@ -265,7 +265,7 @@ static void ipcp_input(ppp_pcb *pcb, u_char *p, int len); static void ipcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if PPP_OPTIONS static void ip_check_options (void); @@ -312,15 +312,15 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ -#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ -#define CILEN_ADDR 6 /* new-style single address option */ -#define CILEN_ADDRS 10 /* old-style dual address option */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ +#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ +#define CILEN_ADDR 6 /* new-style single address option */ +#define CILEN_ADDRS 10 /* old-style dual address option */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED, already defined by lwIP */ /* @@ -351,11 +351,11 @@ setvjslots(argv) int value; if (!int_option(*argv, &value)) - return 0; + return 0; if (value < 2 || value > 16) { - option_error("vj-max-slots value must be between 2 and 16"); - return 0; + option_error("vj-max-slots value must be between 2 and 16"); + return 0; } ipcp_wantoptions [0].maxslotindex = ipcp_allowoptions[0].maxslotindex = value - 1; @@ -375,21 +375,21 @@ setdnsaddr(argv) dns = inet_addr(*argv); if (dns == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-dns option", - *argv); - return 0; - } - dns = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-dns option", + *argv); + return 0; + } + dns = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].dnsaddr[1] == 0) - ipcp_allowoptions[0].dnsaddr[0] = dns; + ipcp_allowoptions[0].dnsaddr[0] = dns; else - ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; + ipcp_allowoptions[0].dnsaddr[0] = ipcp_allowoptions[0].dnsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].dnsaddr[1] = dns; @@ -411,21 +411,21 @@ setwinsaddr(argv) wins = inet_addr(*argv); if (wins == (u32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-wins option", - *argv); - return 0; - } - wins = *(u32_t *)hp->h_addr; + if ((hp = gethostbyname(*argv)) == NULL) { + option_error("invalid address parameter '%s' for ms-wins option", + *argv); + return 0; + } + wins = *(u32_t *)hp->h_addr; } /* We take the last 2 values given, the 2nd-last as the primary and the last as the secondary. If only one is given it becomes both primary and secondary. */ if (ipcp_allowoptions[0].winsaddr[1] == 0) - ipcp_allowoptions[0].winsaddr[0] = wins; + ipcp_allowoptions[0].winsaddr[0] = wins; else - ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; + ipcp_allowoptions[0].winsaddr[0] = ipcp_allowoptions[0].winsaddr[1]; /* always set the secondary address value. */ ipcp_allowoptions[0].winsaddr[1] = wins; @@ -455,52 +455,52 @@ setipaddr(arg, argv, doit) * IP address pair separated by ":". */ if ((colon = strchr(arg, ':')) == NULL) - return 0; + return 0; if (!doit) - return 1; - + return 1; + /* * If colon first character, then no local addr. */ if (colon != arg && option_priority >= prio_local) { - *colon = '\0'; - if ((local = inet_addr(arg)) == (u32_t) -1) { - if ((hp = gethostbyname(arg)) == NULL) { - option_error("unknown host: %s", arg); - return 0; - } - local = *(u32_t *)hp->h_addr; - } - if (bad_ip_adrs(local)) { - option_error("bad local IP address %s", ip_ntoa(local)); - return 0; - } - if (local != 0) - wo->ouraddr = local; - *colon = ':'; - prio_local = option_priority; - } - + *colon = '\0'; + if ((local = inet_addr(arg)) == (u32_t) -1) { + if ((hp = gethostbyname(arg)) == NULL) { + option_error("unknown host: %s", arg); + return 0; + } + local = *(u32_t *)hp->h_addr; + } + if (bad_ip_adrs(local)) { + option_error("bad local IP address %s", ip_ntoa(local)); + return 0; + } + if (local != 0) + wo->ouraddr = local; + *colon = ':'; + prio_local = option_priority; + } + /* * If colon last character, then no remote addr. */ if (*++colon != '\0' && option_priority >= prio_remote) { - if ((remote = inet_addr(colon)) == (u32_t) -1) { - if ((hp = gethostbyname(colon)) == NULL) { - option_error("unknown host: %s", colon); - return 0; - } - remote = *(u32_t *)hp->h_addr; - if (remote_name[0] == 0) - strlcpy(remote_name, colon, sizeof(remote_name)); - } - if (bad_ip_adrs(remote)) { - option_error("bad remote IP address %s", ip_ntoa(remote)); - return 0; - } - if (remote != 0) - wo->hisaddr = remote; - prio_remote = option_priority; + if ((remote = inet_addr(colon)) == (u32_t) -1) { + if ((hp = gethostbyname(colon)) == NULL) { + option_error("unknown host: %s", colon); + return 0; + } + remote = *(u32_t *)hp->h_addr; + if (remote_name[0] == 0) + strlcpy(remote_name, colon, sizeof(remote_name)); + } + if (bad_ip_adrs(remote)) { + option_error("bad remote IP address %s", ip_ntoa(remote)); + return 0; + } + if (remote != 0) + wo->hisaddr = remote; + prio_remote = option_priority; } return 1; @@ -512,13 +512,13 @@ printipaddr(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - ipcp_options *wo = &ipcp_wantoptions[0]; + ipcp_options *wo = &ipcp_wantoptions[0]; - if (wo->ouraddr != 0) - printer(arg, "%I", wo->ouraddr); - printer(arg, ":"); - if (wo->hisaddr != 0) - printer(arg, "%I", wo->hisaddr); + if (wo->ouraddr != 0) + printer(arg, "%I", wo->ouraddr); + printer(arg, ":"); + if (wo->hisaddr != 0) + printer(arg, "%I", wo->hisaddr); } /* @@ -542,8 +542,8 @@ setnetmask(argv) mask = lwip_htonl(mask); if (n == 0 || p[n] != 0 || (netmask & ~mask) != 0) { - option_error("invalid netmask value '%s'", *argv); - return 0; + option_error("invalid netmask value '%s'", *argv); + return 0; } netmask = mask; @@ -563,23 +563,23 @@ parse_dotted_ip(p, vp) v = 0; for (n = 3;; --n) { - b = strtoul(p, &endp, 0); - if (endp == p) - return 0; - if (b > 255) { - if (n < 3) - return 0; - /* accept e.g. 0xffffff00 */ - *vp = b; - return endp - p0; - } - v |= b << (n * 8); - p = endp; - if (n == 0) - break; - if (*p != '.') - return 0; - ++p; + b = strtoul(p, &endp, 0); + if (endp == p) + return 0; + if (b > 255) { + if (n < 3) + return 0; + /* accept e.g. 0xffffff00 */ + *vp = b; + return endp - p0; + } + v |= b << (n * 8); + p = endp; + if (n == 0) + break; + if (*p != '.') + return 0; + ++p; } *vp = v; return p - p0; @@ -716,23 +716,23 @@ static void ipcp_resetci(fsm *f) { ipcp_options *ao = &pcb->ipcp_allowoptions; wo->req_addr = (wo->neg_addr || wo->old_addrs) && - (ao->neg_addr || ao->old_addrs); + (ao->neg_addr || ao->old_addrs); if (wo->ouraddr == 0) - wo->accept_local = 1; + wo->accept_local = 1; if (wo->hisaddr == 0) - wo->accept_remote = 1; + wo->accept_remote = 1; #if LWIP_DNS - wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ + wo->req_dns1 = wo->req_dns2 = pcb->settings.usepeerdns; /* Request DNS addresses from the peer */ #endif /* LWIP_DNS */ *go = *wo; if (!pcb->ask_for_local) - go->ouraddr = 0; + go->ouraddr = 0; #if 0 /* UNUSED */ if (ip_choose_hook) { - ip_choose_hook(&wo->hisaddr); - if (wo->hisaddr) { - wo->accept_remote = 0; - } + ip_choose_hook(&wo->hisaddr); + if (wo->hisaddr) { + wo->accept_remote = 0; + } } #endif /* UNUSED */ BZERO(&pcb->ipcp_hisoptions, sizeof(ipcp_options)); @@ -751,16 +751,16 @@ static int ipcp_cilen(fsm *f) { #endif /* VJ_SUPPORT */ ipcp_options *ho = &pcb->ipcp_hisoptions; -#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) +#define LENCIADDRS(neg) (neg ? CILEN_ADDRS : 0) #if VJ_SUPPORT -#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) +#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) #endif /* VJ_SUPPORT */ -#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) +#define LENCIADDR(neg) (neg ? CILEN_ADDR : 0) #if LWIP_DNS -#define LENCIDNS(neg) LENCIADDR(neg) +#define LENCIDNS(neg) LENCIADDR(neg) #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ -#define LENCIWINS(neg) LENCIADDR(neg) +#define LENCIWINS(neg) LENCIADDR(neg) #endif /* UNUSED - WINS */ /* @@ -768,34 +768,34 @@ static int ipcp_cilen(fsm *f) { * forms because we have received old forms from the peer. */ if (go->neg_addr && go->old_addrs && !ho->neg_addr && ho->old_addrs) - go->neg_addr = 0; + go->neg_addr = 0; #if VJ_SUPPORT if (wo->neg_vj && !go->neg_vj && !go->old_vj) { - /* try an older style of VJ negotiation */ - /* use the old style only if the peer did */ - if (ho->neg_vj && ho->old_vj) { - go->neg_vj = 1; - go->old_vj = 1; - go->vj_protocol = ho->vj_protocol; - } + /* try an older style of VJ negotiation */ + /* use the old style only if the peer did */ + if (ho->neg_vj && ho->old_vj) { + go->neg_vj = 1; + go->old_vj = 1; + go->vj_protocol = ho->vj_protocol; + } } #endif /* VJ_SUPPORT */ return (LENCIADDRS(!go->neg_addr && go->old_addrs) + #if VJ_SUPPORT - LENCIVJ(go->neg_vj, go->old_vj) + + LENCIVJ(go->neg_vj, go->old_vj) + #endif /* VJ_SUPPORT */ - LENCIADDR(go->neg_addr) + + LENCIADDR(go->neg_addr) + #if LWIP_DNS - LENCIDNS(go->req_dns1) + - LENCIDNS(go->req_dns2) + + LENCIDNS(go->req_dns1) + + LENCIDNS(go->req_dns2) + #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - LENCIWINS(go->winsaddr[0]) + - LENCIWINS(go->winsaddr[1]) + + LENCIWINS(go->winsaddr[0]) + + LENCIWINS(go->winsaddr[1]) + #endif /* UNUSED - WINS */ - 0); + 0); } @@ -810,86 +810,86 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - if (len >= CILEN_ADDRS) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDRS, ucp); \ - l = lwip_ntohl(val1); \ - PUTLONG(l, ucp); \ - l = lwip_ntohl(val2); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDRS; \ - } else \ - go->old_addrs = 0; \ + if (len >= CILEN_ADDRS) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDRS, ucp); \ + l = lwip_ntohl(val1); \ + PUTLONG(l, ucp); \ + l = lwip_ntohl(val2); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDRS; \ + } else \ + go->old_addrs = 0; \ } #if VJ_SUPPORT #define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - if (!old) { \ - PUTCHAR(maxslotindex, ucp); \ - PUTCHAR(cflag, ucp); \ - } \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + if (!old) { \ + PUTCHAR(maxslotindex, ucp); \ + PUTCHAR(cflag, ucp); \ + } \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* VJ_SUPPORT */ #define ADDCIADDR(opt, neg, val) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(val); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(val); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #if LWIP_DNS #define ADDCIDNS(opt, neg, addr) \ if (neg) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ADDCIWINS(opt, addr) \ if (addr) { \ - if (len >= CILEN_ADDR) { \ - u32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = lwip_ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - addr = 0; \ + if (len >= CILEN_ADDR) { \ + u32_t l; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_ADDR, ucp); \ + l = lwip_ntohl(addr); \ + PUTLONG(l, ucp); \ + len -= CILEN_ADDR; \ + } else \ + addr = 0; \ } #endif /* UNUSED - WINS */ ADDCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ADDCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -905,7 +905,7 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { ADDCIWINS(CI_MS_WINS2, go->winsaddr[1]); #endif /* UNUSED - WINS */ - + *lenp -= len; } @@ -915,8 +915,8 @@ static void ipcp_addci(fsm *f, u_char *ucp, int *lenp) { * Called by fsm_rconfack, Receive Configure ACK. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -936,105 +936,105 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { #define ACKCIADDRS(opt, neg, val1, val2) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDRS) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDRS || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val1 != cilong) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val2 != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDRS) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDRS || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val1 != cilong) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val2 != cilong) \ + goto bad; \ } #if VJ_SUPPORT #define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \ if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslotindex) \ - goto bad; \ - GETCHAR(cicflag, p); \ - if (cicflag != cflag) \ - goto bad; \ - } \ + int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslotindex) \ + goto bad; \ + GETCHAR(cicflag, p); \ + if (cicflag != cflag) \ + goto bad; \ + } \ } #endif /* VJ_SUPPORT */ #define ACKCIADDR(opt, neg, val) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (val != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || \ + citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (val != cilong) \ + goto bad; \ } #if LWIP_DNS #define ACKCIDNS(opt, neg, addr) \ if (neg) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define ACKCIWINS(opt, addr) \ if (addr) { \ - u32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - if (addr != cilong) \ - goto bad; \ + u32_t l; \ + if ((len -= CILEN_ADDR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_ADDR || citype != opt) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + if (addr != cilong) \ + goto bad; \ } #endif /* UNUSED - WINS */ ACKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, go->ouraddr, - go->hisaddr); + go->hisaddr); #if VJ_SUPPORT ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ ACKCIADDR(CI_ADDR, go->neg_addr, go->ouraddr); @@ -1055,7 +1055,7 @@ static int ipcp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -1070,8 +1070,8 @@ bad: * Calback from fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1085,8 +1085,8 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { #if LWIP_DNS u32_t cidnsaddr; #endif /* LWIP_DNS */ - ipcp_options no; /* options we've seen Naks for */ - ipcp_options try_; /* options to request next time */ + ipcp_options no; /* options we've seen Naks for */ + ipcp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -1098,58 +1098,58 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIADDRS(opt, neg, code) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - GETLONG(l, p); \ - ciaddr2 = lwip_htonl(l); \ - no.old_addrs = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + GETLONG(l, p); \ + ciaddr2 = lwip_htonl(l); \ + no.old_addrs = 1; \ + code \ } #if VJ_SUPPORT #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* VJ_SUPPORT */ #define NAKCIADDR(opt, neg, code) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = lwip_htonl(l); \ - no.neg = 1; \ - code \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + ciaddr1 = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #if LWIP_DNS #define NAKCIDNS(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cidnsaddr = lwip_htonl(l); \ - no.neg = 1; \ - code \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cidnsaddr = lwip_htonl(l); \ + no.neg = 1; \ + code \ } #endif /* LWIP_DNS */ @@ -1158,19 +1158,19 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - if (treat_as_reject) { - try_.old_addrs = 0; - } else { - if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - if (go->accept_remote && ciaddr2) { - /* take his idea of his address */ - try_.hisaddr = ciaddr2; - } - } - ); + if (treat_as_reject) { + try_.old_addrs = 0; + } else { + if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + if (go->accept_remote && ciaddr2) { + /* take his idea of his address */ + try_.hisaddr = ciaddr2; + } + } + ); #if VJ_SUPPORT /* @@ -1180,57 +1180,57 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the peer wants. */ NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - if (treat_as_reject) { - try_.neg_vj = 0; - } else if (cilen == CILEN_VJ) { - GETCHAR(cimaxslotindex, p); - GETCHAR(cicflag, p); - if (cishort == IPCP_VJ_COMP) { - try_.old_vj = 0; - if (cimaxslotindex < go->maxslotindex) - try_.maxslotindex = cimaxslotindex; - if (!cicflag) - try_.cflag = 0; - } else { - try_.neg_vj = 0; - } - } else { - if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { - try_.old_vj = 1; - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + if (treat_as_reject) { + try_.neg_vj = 0; + } else if (cilen == CILEN_VJ) { + GETCHAR(cimaxslotindex, p); + GETCHAR(cicflag, p); + if (cishort == IPCP_VJ_COMP) { + try_.old_vj = 0; + if (cimaxslotindex < go->maxslotindex) + try_.maxslotindex = cimaxslotindex; + if (!cicflag) + try_.cflag = 0; + } else { + try_.neg_vj = 0; + } + } else { + if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { + try_.old_vj = 1; + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* VJ_SUPPORT */ NAKCIADDR(CI_ADDR, neg_addr, - if (treat_as_reject) { - try_.neg_addr = 0; - try_.old_addrs = 0; - } else if (go->accept_local && ciaddr1) { - /* take his idea of our address */ - try_.ouraddr = ciaddr1; - } - ); + if (treat_as_reject) { + try_.neg_addr = 0; + try_.old_addrs = 0; + } else if (go->accept_local && ciaddr1) { + /* take his idea of our address */ + try_.ouraddr = ciaddr1; + } + ); #if LWIP_DNS NAKCIDNS(CI_MS_DNS1, req_dns1, - if (treat_as_reject) { - try_.req_dns1 = 0; - } else { - try_.dnsaddr[0] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns1 = 0; + } else { + try_.dnsaddr[0] = cidnsaddr; + } + ); NAKCIDNS(CI_MS_DNS2, req_dns2, - if (treat_as_reject) { - try_.req_dns2 = 0; - } else { - try_.dnsaddr[1] = cidnsaddr; - } - ); + if (treat_as_reject) { + try_.req_dns2 = 0; + } else { + try_.dnsaddr[1] = cidnsaddr; + } + ); #endif /* #if LWIP_DNS */ /* @@ -1242,81 +1242,81 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * peers get huffy if we don't. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* VJ_SUPPORT */ - case CI_ADDRS: - if ((!go->neg_addr && go->old_addrs) || no.old_addrs - || cilen != CILEN_ADDRS) - goto bad; - try_.neg_addr = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - GETLONG(l, p); - ciaddr2 = lwip_htonl(l); - if (ciaddr2 && go->accept_remote) - try_.hisaddr = ciaddr2; - no.old_addrs = 1; - break; - case CI_ADDR: - if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) - goto bad; - try_.old_addrs = 0; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1 && go->accept_local) - try_.ouraddr = ciaddr1; - if (try_.ouraddr != 0) - try_.neg_addr = 1; - no.neg_addr = 1; - break; + case CI_ADDRS: + if ((!go->neg_addr && go->old_addrs) || no.old_addrs + || cilen != CILEN_ADDRS) + goto bad; + try_.neg_addr = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + GETLONG(l, p); + ciaddr2 = lwip_htonl(l); + if (ciaddr2 && go->accept_remote) + try_.hisaddr = ciaddr2; + no.old_addrs = 1; + break; + case CI_ADDR: + if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) + goto bad; + try_.old_addrs = 0; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1 && go->accept_local) + try_.ouraddr = ciaddr1; + if (try_.ouraddr != 0) + try_.neg_addr = 1; + no.neg_addr = 1; + break; #if LWIP_DNS - case CI_MS_DNS1: - if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[0] = lwip_htonl(l); - try_.req_dns1 = 1; - no.req_dns1 = 1; - break; - case CI_MS_DNS2: - if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - try_.dnsaddr[1] = lwip_htonl(l); - try_.req_dns2 = 1; - no.req_dns2 = 1; - break; + case CI_MS_DNS1: + if (go->req_dns1 || no.req_dns1 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[0] = lwip_htonl(l); + try_.req_dns1 = 1; + no.req_dns1 = 1; + break; + case CI_MS_DNS2: + if (go->req_dns2 || no.req_dns2 || cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + try_.dnsaddr[1] = lwip_htonl(l); + try_.req_dns2 = 1; + no.req_dns2 = 1; + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - if (cilen != CILEN_ADDR) - goto bad; - GETLONG(l, p); - ciaddr1 = lwip_htonl(l); - if (ciaddr1) - try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + if (cilen != CILEN_ADDR) + goto bad; + GETLONG(l, p); + ciaddr1 = lwip_htonl(l); + if (ciaddr1) + try_.winsaddr[citype == CI_MS_WINS2] = ciaddr1; + break; #endif /* UNUSED - WINS */ - default: - break; - } - p = next; + default: + break; + } + p = next; } /* @@ -1324,7 +1324,7 @@ static int ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any remaining options, we ignore them. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -1347,7 +1347,7 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* VJ_SUPPORT */ u32_t cilong; - ipcp_options try_; /* options to request next time */ + ipcp_options try_; /* options to request next time */ try_ = *go; /* @@ -1357,107 +1357,107 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIADDRS(opt, neg, val1, val2) \ if ((neg) && \ - (cilen = p[1]) == CILEN_ADDRS && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val1) \ - goto bad; \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val2) \ - goto bad; \ - try_.old_addrs = 0; \ + (cilen = p[1]) == CILEN_ADDRS && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val1) \ + goto bad; \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val2) \ + goto bad; \ + try_.old_addrs = 0; \ } #if VJ_SUPPORT #define REJCIVJ(opt, neg, val, old, maxslot, cflag) \ if (go->neg && \ - p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslot) \ - goto bad; \ - GETCHAR(ciflag, p); \ - if (ciflag != cflag) \ - goto bad; \ + p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + if (!old) { \ + GETCHAR(cimaxslotindex, p); \ + if (cimaxslotindex != maxslot) \ + goto bad; \ + GETCHAR(ciflag, p); \ + if (ciflag != cflag) \ + goto bad; \ } \ - try_.neg = 0; \ + try_.neg = 0; \ } #endif /* VJ_SUPPORT */ #define REJCIADDR(opt, neg, val) \ if (go->neg && \ - (cilen = p[1]) == CILEN_ADDR && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + (cilen = p[1]) == CILEN_ADDR && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LWIP_DNS #define REJCIDNS(opt, neg, dnsaddr) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != dnsaddr) \ - goto bad; \ - try_.neg = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != dnsaddr) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ #define REJCIWINS(opt, addr) \ if (addr && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = lwip_htonl(l); \ - /* Check rejected value. */ \ - if (cilong != addr) \ - goto bad; \ - try_.winsaddr[opt == CI_MS_WINS2] = 0; \ + ((cilen = p[1]) == CILEN_ADDR) && \ + len >= cilen && \ + p[0] == opt) { \ + u32_t l; \ + len -= cilen; \ + INCPTR(2, p); \ + GETLONG(l, p); \ + cilong = lwip_htonl(l); \ + /* Check rejected value. */ \ + if (cilong != addr) \ + goto bad; \ + try_.winsaddr[opt == CI_MS_WINS2] = 0; \ } #endif /* UNUSED - WINS */ REJCIADDRS(CI_ADDRS, !go->neg_addr && go->old_addrs, - go->ouraddr, go->hisaddr); + go->ouraddr, go->hisaddr); #if VJ_SUPPORT REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); + go->maxslotindex, go->cflag); #endif /* VJ_SUPPORT */ REJCIADDR(CI_ADDR, neg_addr, go->ouraddr); @@ -1478,12 +1478,12 @@ static int ipcp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1508,17 +1508,17 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipcp_options *wo = &pcb->ipcp_wantoptions; ipcp_options *ho = &pcb->ipcp_hisoptions; ipcp_options *ao = &pcb->ipcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #if VJ_SUPPORT - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* VJ_SUPPORT */ u32_t tl, ciaddr1, ciaddr2;/* Parsed address values */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ #if VJ_SUPPORT u_char maxslotindex, cflag; #endif /* VJ_SUPPORT */ @@ -1530,243 +1530,243 @@ static int ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPCPDEBUG(("ipcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_ADDRS: - if (!ao->old_addrs || ho->neg_addr || - cilen != CILEN_ADDRS) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * If neither we nor he knows his address, reject the option. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - /* - * If he doesn't know our address, or if we both have our address - * but disagree about it, then NAK it with our idea. - */ - GETLONG(tl, p); /* Parse desination address (ours) */ - ciaddr2 = lwip_htonl(tl); - if (ciaddr2 != wo->ouraddr) { - if (ciaddr2 == 0 || !wo->accept_local) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->ouraddr); - PUTLONG(tl, p); - } - } else { - wo->ouraddr = ciaddr2; /* accept peer's idea */ - } - } - - ho->old_addrs = 1; - ho->hisaddr = ciaddr1; - ho->ouraddr = ciaddr2; - break; - - case CI_ADDR: - if (!ao->neg_addr || ho->old_addrs || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = lwip_htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * Don't ACK an address of 0.0.0.0 - reject it instead. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - ho->neg_addr = 1; - ho->hisaddr = ciaddr1; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPCPDEBUG(("ipcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_ADDRS: + if (!ao->old_addrs || ho->neg_addr || + cilen != CILEN_ADDRS) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * If neither we nor he knows his address, reject the option. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + /* + * If he doesn't know our address, or if we both have our address + * but disagree about it, then NAK it with our idea. + */ + GETLONG(tl, p); /* Parse desination address (ours) */ + ciaddr2 = lwip_htonl(tl); + if (ciaddr2 != wo->ouraddr) { + if (ciaddr2 == 0 || !wo->accept_local) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->ouraddr); + PUTLONG(tl, p); + } + } else { + wo->ouraddr = ciaddr2; /* accept peer's idea */ + } + } + + ho->old_addrs = 1; + ho->hisaddr = ciaddr1; + ho->ouraddr = ciaddr2; + break; + + case CI_ADDR: + if (!ao->neg_addr || ho->old_addrs || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no address, or if we both have his address but + * disagree about it, then NAK it with our idea. + * In particular, if we don't know his address, but he does, + * then accept it. + */ + GETLONG(tl, p); /* Parse source address (his) */ + ciaddr1 = lwip_htonl(tl); + if (ciaddr1 != wo->hisaddr + && (ciaddr1 == 0 || !wo->accept_remote)) { + orc = CONFNAK; + if (!reject_if_disagree) { + DECPTR(sizeof(u32_t), p); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, p); + } + } else if (ciaddr1 == 0 && wo->hisaddr == 0) { + /* + * Don't ACK an address of 0.0.0.0 - reject it instead. + */ + orc = CONFREJ; + wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ + break; + } + + ho->neg_addr = 1; + ho->hisaddr = ciaddr1; + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - /* Microsoft primary or secondary DNS request */ - d = citype == CI_MS_DNS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->dnsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->dnsaddr[d]) { + case CI_MS_DNS1: + case CI_MS_DNS2: + /* Microsoft primary or secondary DNS request */ + d = citype == CI_MS_DNS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->dnsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->dnsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->dnsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->dnsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - /* Microsoft primary or secondary WINS request */ - d = citype == CI_MS_WINS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->winsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (lwip_htonl(tl) != ao->winsaddr[d]) { + case CI_MS_WINS1: + case CI_MS_WINS2: + /* Microsoft primary or secondary WINS request */ + d = citype == CI_MS_WINS2; + + /* If we do not have a DNS address then we cannot send it */ + if (ao->winsaddr[d] == 0 || + cilen != CILEN_ADDR) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETLONG(tl, p); + if (lwip_htonl(tl) != ao->winsaddr[d]) { DECPTR(sizeof(u32_t), p); - tl = lwip_ntohl(ao->winsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; + tl = lwip_ntohl(ao->winsaddr[d]); + PUTLONG(tl, p); + orc = CONFNAK; } break; #endif /* UNUSED - WINS */ #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (!ao->neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - if (!(cishort == IPCP_VJ_COMP || - (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - if (cilen == CILEN_VJ) { - GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(ao->maxslotindex, p); - } - } - GETCHAR(cflag, p); - if (cflag && !ao->cflag) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(wo->cflag, p); - } - } - ho->maxslotindex = maxslotindex; - ho->cflag = cflag; - } else { - ho->old_vj = 1; - ho->maxslotindex = MAX_STATES - 1; - ho->cflag = 1; - } - break; + case CI_COMPRESSTYPE: + if (!ao->neg_vj || + (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + if (!(cishort == IPCP_VJ_COMP || + (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + if (cilen == CILEN_VJ) { + GETCHAR(maxslotindex, p); + if (maxslotindex > ao->maxslotindex) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(ao->maxslotindex, p); + } + } + GETCHAR(cflag, p); + if (cflag && !ao->cflag) { + orc = CONFNAK; + if (!reject_if_disagree){ + DECPTR(1, p); + PUTCHAR(wo->cflag, p); + } + } + ho->maxslotindex = maxslotindex; + ho->cflag = cflag; + } else { + ho->old_vj = 1; + ho->maxslotindex = MAX_STATES - 1; + ho->cflag = 1; + } + break; #endif /* VJ_SUPPORT */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1777,21 +1777,21 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs && - wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_addr = 0; /* don't ask again */ - } - PUTCHAR(CI_ADDR, ucp); - PUTCHAR(CILEN_ADDR, ucp); - tl = lwip_ntohl(wo->hisaddr); - PUTLONG(tl, ucp); - } - - *len = ucp - inp; /* Compute output length */ + wo->req_addr && !reject_if_disagree && !pcb->settings.noremoteip) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_addr = 0; /* don't ask again */ + } + PUTCHAR(CI_ADDR, ucp); + PUTCHAR(CILEN_ADDR, ucp); + tl = lwip_ntohl(wo->hisaddr); + PUTLONG(tl, ucp); + } + + *len = ucp - inp; /* Compute output length */ IPCPDEBUG(("ipcp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -1812,17 +1812,17 @@ ip_check_options() * If local IP address already given, don't bother. */ if (wo->ouraddr == 0 && !disable_defaultip) { - /* - * Look up our hostname (possibly with domain name appended) - * and take the first IP address as our local IP address. - * If there isn't an IP address for our hostname, too bad. - */ - wo->accept_local = 1; /* don't insist on this default value */ - if ((hp = gethostbyname(hostname)) != NULL) { - local = *(u32_t *)hp->h_addr; - if (local != 0 && !bad_ip_adrs(local)) - wo->ouraddr = local; - } + /* + * Look up our hostname (possibly with domain name appended) + * and take the first IP address as our local IP address. + * If there isn't an IP address for our hostname, too bad. + */ + wo->accept_local = 1; /* don't insist on this default value */ + if ((hp = gethostbyname(hostname)) != NULL) { + local = *(u32_t *)hp->h_addr; + if (local != 0 && !bad_ip_adrs(local)) + wo->ouraddr = local; + } } ask_for_local = wo->ouraddr != 0 || !disable_defaultip; } @@ -1841,37 +1841,37 @@ ip_demand_conf(u) ipcp_options *wo = &ipcp_wantoptions[u]; if (wo->hisaddr == 0 && !pcb->settings.noremoteip) { - /* make up an arbitrary address for the peer */ - wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); - wo->accept_remote = 1; + /* make up an arbitrary address for the peer */ + wo->hisaddr = lwip_htonl(0x0a707070 + ifunit); + wo->accept_remote = 1; } if (wo->ouraddr == 0) { - /* make up an arbitrary address for us */ - wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); - wo->accept_local = 1; - ask_for_local = 0; /* don't tell the peer this address */ + /* make up an arbitrary address for us */ + wo->ouraddr = lwip_htonl(0x0a404040 + ifunit); + wo->accept_local = 1; + ask_for_local = 0; /* don't tell the peer this address */ } if (!sifaddr(pcb, wo->ouraddr, wo->hisaddr, get_mask(wo->ouraddr))) - return 0; + return 0; if (!sifup(pcb)) - return 0; + return 0; if (!sifnpmode(pcb, PPP_IP, NPMODE_QUEUE)) - return 0; + return 0; #if 0 /* UNUSED */ if (wo->default_route) - if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, - wo->replace_default_route)) - default_route_set[u] = 1; + if (sifdefaultroute(pcb, wo->ouraddr, wo->hisaddr, + wo->replace_default_route)) + default_route_set[u] = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ if (wo->proxy_arp) - if (sifproxyarp(pcb, wo->hisaddr)) - proxy_arp_set[u] = 1; + if (sifproxyarp(pcb, wo->hisaddr)) + proxy_arp_set[u] = 1; #endif /* UNUSED - PROXY ARP */ ppp_notice("local IP address %I", wo->ouraddr); if (wo->hisaddr) - ppp_notice("remote IP address %I", wo->hisaddr); + ppp_notice("remote IP address %I", wo->hisaddr); return 1; } @@ -1895,46 +1895,46 @@ static void ipcp_up(fsm *f) { * We must have a non-zero IP address for both ends of the link. */ if (!ho->neg_addr && !ho->old_addrs) - ho->hisaddr = wo->hisaddr; + ho->hisaddr = wo->hisaddr; if (!(go->neg_addr || go->old_addrs) && (wo->neg_addr || wo->old_addrs) - && wo->ouraddr != 0) { - ppp_error("Peer refused to agree to our IP address"); - ipcp_close(f->pcb, "Refused our IP address"); - return; + && wo->ouraddr != 0) { + ppp_error("Peer refused to agree to our IP address"); + ipcp_close(f->pcb, "Refused our IP address"); + return; } if (go->ouraddr == 0) { - ppp_error("Could not determine local IP address"); - ipcp_close(f->pcb, "Could not determine local IP address"); - return; + ppp_error("Could not determine local IP address"); + ipcp_close(f->pcb, "Could not determine local IP address"); + return; } if (ho->hisaddr == 0 && !pcb->settings.noremoteip) { - ho->hisaddr = lwip_htonl(0x0a404040); - ppp_warn("Could not determine remote IP address: defaulting to %I", - ho->hisaddr); + ho->hisaddr = lwip_htonl(0x0a404040); + ppp_warn("Could not determine remote IP address: defaulting to %I", + ho->hisaddr); } #if 0 /* UNUSED */ script_setenv("IPLOCAL", ip_ntoa(go->ouraddr), 0); if (ho->hisaddr != 0) - script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); + script_setenv("IPREMOTE", ip_ntoa(ho->hisaddr), 1); #endif /* UNUSED */ #if LWIP_DNS if (!go->req_dns1) - go->dnsaddr[0] = 0; + go->dnsaddr[0] = 0; if (!go->req_dns2) - go->dnsaddr[1] = 0; + go->dnsaddr[1] = 0; #if 0 /* UNUSED */ if (go->dnsaddr[0]) - script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); + script_setenv("DNS1", ip_ntoa(go->dnsaddr[0]), 0); if (go->dnsaddr[1]) - script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); + script_setenv("DNS2", ip_ntoa(go->dnsaddr[1]), 0); #endif /* UNUSED */ if (pcb->settings.usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { - sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + sdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #if 0 /* UNUSED */ - script_setenv("USEPEERDNS", "1", 0); - create_resolv(go->dnsaddr[0], go->dnsaddr[1]); + script_setenv("USEPEERDNS", "1", 0); + create_resolv(go->dnsaddr[0], go->dnsaddr[1]); #endif /* UNUSED */ } #endif /* LWIP_DNS */ @@ -1943,29 +1943,29 @@ static void ipcp_up(fsm *f) { * Check that the peer is allowed to use the IP address it wants. */ if (ho->hisaddr != 0) { - u32_t addr = lwip_ntohl(ho->hisaddr); - if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET - || IP_MULTICAST(addr) || IP_BADCLASS(addr) - /* - * For now, consider that PPP in server mode with peer required - * to authenticate must provide the peer IP address, reject any - * IP address wanted by peer different than the one we wanted. - */ + u32_t addr = lwip_ntohl(ho->hisaddr); + if ((addr >> IP_CLASSA_NSHIFT) == IP_LOOPBACKNET + || IP_MULTICAST(addr) || IP_BADCLASS(addr) + /* + * For now, consider that PPP in server mode with peer required + * to authenticate must provide the peer IP address, reject any + * IP address wanted by peer different than the one we wanted. + */ #if PPP_SERVER && PPP_AUTH_SUPPORT - || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) + || (pcb->settings.auth_required && wo->hisaddr != ho->hisaddr) #endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ - ) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(pcb, "Unauthorized remote IP address"); - return; - } + ) { + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(pcb, "Unauthorized remote IP address"); + return; + } } #if 0 /* Unused */ /* Upstream checking code */ if (ho->hisaddr != 0 && !auth_ip_addr(f->unit, ho->hisaddr)) { - ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(f->unit, "Unauthorized remote IP address"); - return; + ppp_error("Peer is not authorized to use remote address %I", ho->hisaddr); + ipcp_close(f->unit, "Unauthorized remote IP address"); + return; } #endif /* Unused */ @@ -1981,114 +1981,114 @@ static void ipcp_up(fsm *f) { * interface to pass IP packets. */ if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { - ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, - wo->replace_default_route); - if (go->ouraddr != wo->ouraddr) { - ppp_warn("Local IP address changed to %I", go->ouraddr); - script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); - wo->ouraddr = go->ouraddr; - } else - script_unsetenv("OLDIPLOCAL"); - if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { - ppp_warn("Remote IP address changed to %I", ho->hisaddr); - script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); - wo->hisaddr = ho->hisaddr; - } else - script_unsetenv("OLDIPREMOTE"); - - /* Set the interface to the new addresses */ - mask = get_mask(go->ouraddr); - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { + ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, + wo->replace_default_route); + if (go->ouraddr != wo->ouraddr) { + ppp_warn("Local IP address changed to %I", go->ouraddr); + script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0); + wo->ouraddr = go->ouraddr; + } else + script_unsetenv("OLDIPLOCAL"); + if (ho->hisaddr != wo->hisaddr && wo->hisaddr != 0) { + ppp_warn("Remote IP address changed to %I", ho->hisaddr); + script_setenv("OLDIPREMOTE", ip_ntoa(wo->hisaddr), 0); + wo->hisaddr = ho->hisaddr; + } else + script_unsetenv("OLDIPREMOTE"); + + /* Set the interface to the new addresses */ + mask = get_mask(go->ouraddr); + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - default_route_set[f->unit] = 1; + /* assign a default route through the interface if required */ + if (ipcp_wantoptions[f->unit].default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + default_route_set[f->unit] = 1; #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - proxy_arp_set[f->unit] = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && ipcp_wantoptions[f->unit].proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + proxy_arp_set[f->unit] = 1; #endif /* UNUSED - PROXY ARP */ - } - demand_rexmit(PPP_IP,go->ouraddr); - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + } + demand_rexmit(PPP_IP,go->ouraddr); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set IP addresses and (if specified) netmask. - */ - mask = get_mask(go->ouraddr); + /* + * Set IP addresses and (if specified) netmask. + */ + mask = get_mask(go->ouraddr); #if !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #endif - /* bring the interface up for IP */ - if (!sifup(pcb)) { + /* bring the interface up for IP */ + if (!sifup(pcb)) { #if PPP_DEBUG - ppp_warn("Interface failed to come up"); + ppp_warn("Interface failed to come up"); #endif /* PPP_DEBUG */ - ipcp_close(f->pcb, "Interface configuration failed"); - return; - } + ipcp_close(f->pcb, "Interface configuration failed"); + return; + } #if (defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { + if (!sifaddr(pcb, go->ouraddr, ho->hisaddr, mask)) { #if PPP_DEBUG - ppp_warn("Interface configuration failed"); + ppp_warn("Interface configuration failed"); #endif /* PPP_DEBUG */ - ipcp_close(f->unit, "Interface configuration failed"); - return; - } + ipcp_close(f->unit, "Interface configuration failed"); + return; + } #endif #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_PASS); + sifnpmode(pcb, PPP_IP, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ #if 0 /* UNUSED */ - /* assign a default route through the interface if required */ - if (wo->default_route) - if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, - wo->replace_default_route)) - pcb->default_route_set = 1; + /* assign a default route through the interface if required */ + if (wo->default_route) + if (sifdefaultroute(pcb, go->ouraddr, ho->hisaddr, + wo->replace_default_route)) + pcb->default_route_set = 1; #endif /* UNUSED */ #if 0 /* UNUSED - PROXY ARP */ - /* Make a proxy ARP entry if requested. */ - if (ho->hisaddr != 0 && wo->proxy_arp) - if (sifproxyarp(pcb, ho->hisaddr)) - pcb->proxy_arp_set = 1; + /* Make a proxy ARP entry if requested. */ + if (ho->hisaddr != 0 && wo->proxy_arp) + if (sifproxyarp(pcb, ho->hisaddr)) + pcb->proxy_arp_set = 1; #endif /* UNUSED - PROXY ARP */ - wo->ouraddr = go->ouraddr; + wo->ouraddr = go->ouraddr; - ppp_notice("local IP address %I", go->ouraddr); - if (ho->hisaddr != 0) - ppp_notice("remote IP address %I", ho->hisaddr); + ppp_notice("local IP address %I", go->ouraddr); + if (ho->hisaddr != 0) + ppp_notice("remote IP address %I", ho->hisaddr); #if LWIP_DNS - if (go->dnsaddr[0]) - ppp_notice("primary DNS address %I", go->dnsaddr[0]); - if (go->dnsaddr[1]) - ppp_notice("secondary DNS address %I", go->dnsaddr[1]); + if (go->dnsaddr[0]) + ppp_notice("primary DNS address %I", go->dnsaddr[0]); + if (go->dnsaddr[1]) + ppp_notice("secondary DNS address %I", go->dnsaddr[1]); #endif /* LWIP_DNS */ } @@ -2104,7 +2104,7 @@ static void ipcp_up(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_up_hook) - ip_up_hook(); + ip_up_hook(); #endif /* UNUSED */ } @@ -2133,11 +2133,11 @@ static void ipcp_down(fsm *f) { #endif /* PPP_NOTIFY */ #if 0 /* UNUSED */ if (ip_down_hook) - ip_down_hook(); + ip_down_hook(); #endif /* UNUSED */ if (pcb->ipcp_is_up) { - pcb->ipcp_is_up = 0; - np_down(pcb, PPP_IP); + pcb->ipcp_is_up = 0; + np_down(pcb, PPP_IP); } #if VJ_SUPPORT sifvjcomp(pcb, 0, 0, 0); @@ -2145,8 +2145,8 @@ static void ipcp_down(fsm *f) { #if PPP_STATS_SUPPORT print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), - * because print_link_stats() sets link_stats_valid - * to 0 (zero) */ + * because print_link_stats() sets link_stats_valid + * to 0 (zero) */ #endif /* PPP_STATS_SUPPORT */ #if DEMAND_SUPPORT @@ -2155,18 +2155,18 @@ static void ipcp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); + sifnpmode(pcb, PPP_IP, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(pcb, PPP_IP, NPMODE_DROP); + sifnpmode(pcb, PPP_IP, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - sifdown(pcb); - ipcp_clear_addrs(pcb, go->ouraddr, - ho->hisaddr, 0); + sifdown(pcb); + ipcp_clear_addrs(pcb, go->ouraddr, + ho->hisaddr, 0); #if LWIP_DNS - cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); + cdns(pcb, go->dnsaddr[0], go->dnsaddr[1]); #endif /* LWIP_DNS */ } } @@ -2181,8 +2181,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re #if 0 /* UNUSED - PROXY ARP */ if (pcb->proxy_arp_set) { - cifproxyarp(pcb, hisaddr); - pcb->proxy_arp_set = 0; + cifproxyarp(pcb, hisaddr); + pcb->proxy_arp_set = 0; } #endif /* UNUSED - PROXY ARP */ #if 0 /* UNUSED */ @@ -2195,8 +2195,8 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * is one saved by an sifdefaultroute with replacedefaultroute. */ if (!replacedefaultroute && pcb->default_route_set) { - cifdefaultroute(pcb, ouraddr, hisaddr); - pcb->default_route_set = 0; + cifdefaultroute(pcb, ouraddr, hisaddr); + pcb->default_route_set = 0; } #endif /* UNUSED */ cifaddr(pcb, ouraddr, hisaddr); @@ -2207,11 +2207,11 @@ static void ipcp_clear_addrs(ppp_pcb *pcb, u32_t ouraddr, u32_t hisaddr, u8_t re * ipcp_finished - possibly shut down the lower layers. */ static void ipcp_finished(fsm *f) { - ppp_pcb *pcb = f->pcb; - if (pcb->ipcp_is_open) { - pcb->ipcp_is_open = 0; - np_finished(pcb, PPP_IP); - } + ppp_pcb *pcb = f->pcb; + if (pcb->ipcp_is_open) { + pcb->ipcp_is_open = 0; + np_finished(pcb, PPP_IP); + } } @@ -2237,7 +2237,7 @@ static const char* const ipcp_codenames[] = { }; static int ipcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #if VJ_SUPPORT @@ -2246,18 +2246,18 @@ static int ipcp_printpkt(const u_char *p, int plen, u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipcp_codenames)) - printer(arg, " %s", ipcp_codenames[code-1]); + printer(arg, " %s", ipcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2265,98 +2265,98 @@ static int ipcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_ADDRS: - if (olen == CILEN_ADDRS) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addrs %I", lwip_htonl(cilong)); - GETLONG(cilong, p); - printer(arg, " %I", lwip_htonl(cilong)); - } - break; + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_ADDRS: + if (olen == CILEN_ADDRS) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addrs %I", lwip_htonl(cilong)); + GETLONG(cilong, p); + printer(arg, " %I", lwip_htonl(cilong)); + } + break; #if VJ_SUPPORT - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - switch (cishort) { - case IPCP_VJ_COMP: - printer(arg, "VJ"); - break; - case IPCP_VJ_COMP_OLD: - printer(arg, "old-VJ"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + switch (cishort) { + case IPCP_VJ_COMP: + printer(arg, "VJ"); + break; + case IPCP_VJ_COMP_OLD: + printer(arg, "old-VJ"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* VJ_SUPPORT */ - case CI_ADDR: - if (olen == CILEN_ADDR) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addr %I", lwip_htonl(cilong)); - } - break; + case CI_ADDR: + if (olen == CILEN_ADDR) { + p += 2; + GETLONG(cilong, p); + printer(arg, "addr %I", lwip_htonl(cilong)); + } + break; #if LWIP_DNS - case CI_MS_DNS1: - case CI_MS_DNS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), - htonl(cilong)); - break; + case CI_MS_DNS1: + case CI_MS_DNS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-dns%d %I", (code == CI_MS_DNS1? 1: 2), + htonl(cilong)); + break; #endif /* LWIP_DNS */ #if 0 /* UNUSED - WINS */ - case CI_MS_WINS1: - case CI_MS_WINS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-wins %I", lwip_htonl(cilong)); - break; + case CI_MS_WINS1: + case CI_MS_WINS2: + p += 2; + GETLONG(cilong, p); + printer(arg, "ms-wins %I", lwip_htonl(cilong)); + break; #endif /* UNUSED - WINS */ - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -2369,25 +2369,25 @@ static int ipcp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP_HDRLEN 20 /* bytes */ -#define IP_OFFMASK 0x1fff +#define IP_HDRLEN 20 /* bytes */ +#define IP_OFFMASK 0x1fff #ifndef IPPROTO_TCP -#define IPPROTO_TCP 6 +#define IPPROTO_TCP 6 #endif -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define net_short(x) (((x)[0] << 8) + (x)[1]) -#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) -#define get_ipoff(x) net_short((unsigned char *)(x) + 6) -#define get_ipproto(x) (((unsigned char *)(x))[9]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define net_short(x) (((x)[0] << 8) + (x)[1]) +#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) +#define get_ipoff(x) net_short((unsigned char *)(x) + 6) +#define get_ipproto(x) (((unsigned char *)(x))[9]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ip_active_pkt(pkt, len) @@ -2400,17 +2400,17 @@ ip_active_pkt(pkt, len) len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP_HDRLEN) - return 0; + return 0; if ((get_ipoff(pkt) & IP_OFFMASK) != 0) - return 0; + return 0; if (get_ipproto(pkt) != IPPROTO_TCP) - return 1; + return 1; hlen = get_iphl(pkt) * 4; if (len < hlen + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + hlen; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c b/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c index 47521eeb02..11c18df743 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ipv6cp.c @@ -73,7 +73,7 @@ between BULL S.A. and INRIA). This software is available with usual "research" terms - with the aim of retain credits of the software. + with the aim of retain credits of the software. Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, @@ -135,11 +135,11 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ + * $Id: ipv6cp.c,v 1.21 2005/08/25 23:59:34 paulus Exp $ */ /* - * @todo: + * @todo: * * Proxy Neighbour Discovery. * @@ -188,21 +188,21 @@ static void ipv6cp_down(fsm *f); /* We're DOWN */ static void ipv6cp_finished(fsm *f); /* Don't need lower layer */ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ - ipv6cp_resetci, /* Reset our Configuration Information */ - ipv6cp_cilen, /* Length of our Configuration Information */ - ipv6cp_addci, /* Add our Configuration Information */ - ipv6cp_ackci, /* ACK our Configuration Information */ - ipv6cp_nakci, /* NAK our Configuration Information */ - ipv6cp_rejci, /* Reject our Configuration Information */ - ipv6cp_reqci, /* Request peer's Configuration Information */ - ipv6cp_up, /* Called when fsm reaches OPENED state */ - ipv6cp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipv6cp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPV6CP" /* String name of protocol */ + ipv6cp_resetci, /* Reset our Configuration Information */ + ipv6cp_cilen, /* Length of our Configuration Information */ + ipv6cp_addci, /* Add our Configuration Information */ + ipv6cp_ackci, /* ACK our Configuration Information */ + ipv6cp_nakci, /* NAK our Configuration Information */ + ipv6cp_rejci, /* Reject our Configuration Information */ + ipv6cp_reqci, /* Request peer's Configuration Information */ + ipv6cp_up, /* Called when fsm reaches OPENED state */ + ipv6cp_down, /* Called when fsm leaves OPENED state */ + NULL, /* Called when we want the lower layer up */ + ipv6cp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + NULL, /* Called to handle protocol-specific codes */ + "IPV6CP" /* String name of protocol */ }; #if PPP_OPTIONS @@ -211,7 +211,7 @@ static const fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ */ static int setifaceid(char **arg)); static void printifaceid(option_t *, - void (*)(void *, char *, ...), void *)); + void (*)(void *, char *, ...), void *)); static option_t ipv6cp_option_list[] = { { "ipv6", o_special, (void *)setifaceid, @@ -265,7 +265,7 @@ static int ipv6_demand_conf(int u); #endif /* DEMAND_SUPPORT */ #if PRINTPKT_SUPPORT static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg); + void (*printer)(void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ #if DEMAND_SUPPORT static int ipv6_active_pkt(u_char *pkt, int len); @@ -309,12 +309,12 @@ static void ipv6cp_script_done(void *)); /* * Lengths of configuration options. */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ -#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ +#define CILEN_VOID 2 +#define CILEN_COMPRESS 4 /* length for RFC2023 compress opt. */ +#define CILEN_IFACEID 10 /* RFC2472, interface identifier */ -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if 0 /* UNUSED */ /* @@ -344,49 +344,49 @@ setifaceid(argv) static int prio_local, prio_remote; #define VALIDID(a) ( (((a).s6_addr32[0] == 0) && ((a).s6_addr32[1] == 0)) && \ - (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) - + (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) + arg = *argv; if ((comma = strchr(arg, ',')) == NULL) - comma = arg + strlen(arg); - - /* + comma = arg + strlen(arg); + + /* * If comma first character, then no local identifier */ if (comma != arg) { - c = *comma; - *comma = '\0'; - - if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (local): %s", arg); - return 0; - } - - if (option_priority >= prio_local) { - eui64_copy(addr.s6_addr32[2], wo->ourid); - wo->opt_local = 1; - prio_local = option_priority; - } - *comma = c; + c = *comma; + *comma = '\0'; + + if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (local): %s", arg); + return 0; + } + + if (option_priority >= prio_local) { + eui64_copy(addr.s6_addr32[2], wo->ourid); + wo->opt_local = 1; + prio_local = option_priority; + } + *comma = c; } - + /* * If comma last character, the no remote identifier */ if (*comma != 0 && *++comma != '\0') { - if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { - option_error("Illegal interface identifier (remote): %s", comma); - return 0; - } - if (option_priority >= prio_remote) { - eui64_copy(addr.s6_addr32[2], wo->hisid); - wo->opt_remote = 1; - prio_remote = option_priority; - } + if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) { + option_error("Illegal interface identifier (remote): %s", comma); + return 0; + } + if (option_priority >= prio_remote) { + eui64_copy(addr.s6_addr32[2], wo->hisid); + wo->opt_remote = 1; + prio_remote = option_priority; + } } if (override_value("+ipv6", option_priority, option_source)) - ipv6cp_protent.enabled_flag = 1; + ipv6cp_protent.enabled_flag = 1; return 1; } @@ -396,13 +396,13 @@ printifaceid(opt, printer, arg) void (*printer)(void *, char *, ...)); void *arg; { - ipv6cp_options *wo = &ipv6cp_wantoptions[0]; + ipv6cp_options *wo = &ipv6cp_wantoptions[0]; - if (wo->opt_local) - printer(arg, "%s", llv6_ntoa(wo->ourid)); - printer(arg, ","); - if (wo->opt_remote) - printer(arg, "%s", llv6_ntoa(wo->hisid)); + if (wo->opt_local) + printer(arg, "%s", llv6_ntoa(wo->ourid)); + printer(arg, ","); + if (wo->opt_remote) + printer(arg, "%s", llv6_ntoa(wo->hisid)); } #endif /* PPP_OPTIONS */ @@ -513,13 +513,13 @@ static void ipv6cp_resetci(fsm *f) { ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; wo->req_ifaceid = wo->neg_ifaceid && ao->neg_ifaceid; - + if (!wo->opt_local) { - eui64_magic_nz(wo->ourid); + eui64_magic_nz(wo->ourid); } - + *go = *wo; - eui64_zero(go->hisid); /* last proposed interface identifier */ + eui64_zero(go->hisid); /* last proposed interface identifier */ } @@ -531,15 +531,15 @@ static int ipv6cp_cilen(fsm *f) { ipv6cp_options *go = &pcb->ipv6cp_gotoptions; #ifdef IPV6CP_COMP -#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) +#define LENCIVJ(neg) (neg ? CILEN_COMPRESS : 0) #endif /* IPV6CP_COMP */ -#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) +#define LENCIIFACEID(neg) (neg ? CILEN_IFACEID : 0) return (LENCIIFACEID(go->neg_ifaceid) + #ifdef IPV6CP_COMP - LENCIVJ(go->neg_vj) + + LENCIVJ(go->neg_vj) + #endif /* IPV6CP_COMP */ - 0); + 0); } @@ -554,27 +554,27 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { #ifdef IPV6CP_COMP #define ADDCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - len -= vjlen; \ - } else \ - neg = 0; \ + int vjlen = CILEN_COMPRESS; \ + if (len >= vjlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(vjlen, ucp); \ + PUTSHORT(val, ucp); \ + len -= vjlen; \ + } else \ + neg = 0; \ } #endif /* IPV6CP_COMP */ #define ADDCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if (len >= idlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(idlen, ucp); \ - eui64_put(val1, ucp); \ - len -= idlen; \ - } else \ - neg = 0; \ + int idlen = CILEN_IFACEID; \ + if (len >= idlen) { \ + PUTCHAR(opt, ucp); \ + PUTCHAR(idlen, ucp); \ + eui64_put(val1, ucp); \ + len -= idlen; \ + } else \ + neg = 0; \ } ADDCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -591,8 +591,8 @@ static void ipv6cp_addci(fsm *f, u_char *ucp, int *lenp) { * ipv6cp_ackci - Ack our CIs. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -612,33 +612,33 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { #ifdef IPV6CP_COMP #define ACKCIVJ(opt, neg, val) \ if (neg) { \ - int vjlen = CILEN_COMPRESS; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + int vjlen = CILEN_COMPRESS; \ + if ((len -= vjlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != vjlen || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #endif /* IPV6CP_COMP */ #define ACKCIIFACEID(opt, neg, val1) \ if (neg) { \ - int idlen = CILEN_IFACEID; \ - if ((len -= idlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != idlen || \ - citype != opt) \ - goto bad; \ - eui64_get(ifaceid, p); \ - if (! eui64_equals(val1, ifaceid)) \ - goto bad; \ + int idlen = CILEN_IFACEID; \ + if ((len -= idlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != idlen || \ + citype != opt) \ + goto bad; \ + eui64_get(ifaceid, p); \ + if (! eui64_equals(val1, ifaceid)) \ + goto bad; \ } ACKCIIFACEID(CI_IFACEID, go->neg_ifaceid, go->ourid); @@ -651,7 +651,7 @@ static int ipv6cp_ackci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: @@ -665,8 +665,8 @@ bad: * or if IPV6CP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -676,8 +676,8 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options no; /* options we've seen Naks for */ - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options no; /* options we've seen Naks for */ + ipv6cp_options try_; /* options to request next time */ BZERO(&no, sizeof(no)); try_ = *go; @@ -689,26 +689,26 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIIFACEID(opt, neg, code) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - no.neg = 1; \ - code \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + no.neg = 1; \ + code \ } #ifdef IPV6CP_COMP #define NAKCIVJ(opt, neg, code) \ if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ + ((cilen = p[1]) == CILEN_COMPRESS) && \ + len >= cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ code \ } #endif /* IPV6CP_COMP */ @@ -718,27 +718,27 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * from our idea, only if the accept_{local,remote} flag is set. */ NAKCIIFACEID(CI_IFACEID, neg_ifaceid, - if (treat_as_reject) { - try_.neg_ifaceid = 0; - } else if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); - } - ); + if (treat_as_reject) { + try_.neg_ifaceid = 0; + } else if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + IPV6CPDEBUG(("local LL address %s", llv6_ntoa(ifaceid))); + } + ); #ifdef IPV6CP_COMP NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - { - if (cishort == IPV6CP_COMP && !treat_as_reject) { - try_.vj_protocol = cishort; - } else { - try_.neg_vj = 0; - } - } - ); + { + if (cishort == IPV6CP_COMP && !treat_as_reject) { + try_.vj_protocol = cishort; + } else { + try_.neg_vj = 0; + } + } + ); #endif /* IPV6CP_COMP */ /* @@ -748,49 +748,49 @@ static int ipv6cp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they want us to ask for compression, we refuse. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; + GETCHAR(citype, p); + GETCHAR(cilen, p); + if ( cilen < CILEN_VOID || (len -= cilen) < 0 ) + goto bad; + next = p + cilen - 2; - switch (citype) { + switch (citype) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; + case CI_COMPRESSTYPE: + if (go->neg_vj || no.neg_vj || + (cilen != CILEN_COMPRESS)) + goto bad; + no.neg_vj = 1; + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) - goto bad; - try_.neg_ifaceid = 1; - eui64_get(ifaceid, p); - if (go->accept_local) { - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->hisid)) /* bad luck */ - eui64_magic(ifaceid); - try_.ourid = ifaceid; - } - no.neg_ifaceid = 1; - break; - default: - break; - } - p = next; + case CI_IFACEID: + if (go->neg_ifaceid || no.neg_ifaceid || cilen != CILEN_IFACEID) + goto bad; + try_.neg_ifaceid = 1; + eui64_get(ifaceid, p); + if (go->accept_local) { + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->hisid)) /* bad luck */ + eui64_magic(ifaceid); + try_.ourid = ifaceid; + } + no.neg_ifaceid = 1; + break; + default: + break; + } + p = next; } /* If there is still anything left, this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * OK, the Nak is good. Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; @@ -811,7 +811,7 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { u_short cishort; #endif /* IPV6CP_COMP */ eui64_t ifaceid; - ipv6cp_options try_; /* options to request next time */ + ipv6cp_options try_; /* options to request next time */ try_ = *go; /* @@ -821,31 +821,31 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIIFACEID(opt, neg, val1) \ if (go->neg && \ - len >= (cilen = CILEN_IFACEID) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - eui64_get(ifaceid, p); \ - /* Check rejected value. */ \ - if (! eui64_equals(ifaceid, val1)) \ - goto bad; \ - try_.neg = 0; \ + len >= (cilen = CILEN_IFACEID) && \ + p[1] == cilen && \ + p[0] == opt) { \ + len -= cilen; \ + INCPTR(2, p); \ + eui64_get(ifaceid, p); \ + /* Check rejected value. */ \ + if (! eui64_equals(ifaceid, val1)) \ + goto bad; \ + try_.neg = 0; \ } #ifdef IPV6CP_COMP #define REJCIVJ(opt, neg, val) \ if (go->neg && \ - p[1] == CILEN_COMPRESS && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + p[1] == CILEN_COMPRESS && \ + len >= p[1] && \ + p[0] == opt) { \ + len -= p[1]; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* IPV6CP_COMP */ @@ -859,12 +859,12 @@ static int ipv6cp_rejci(fsm *f, u_char *p, int len) { * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -890,150 +890,150 @@ static int ipv6cp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree) { ipv6cp_options *ho = &pcb->ipv6cp_hisoptions; ipv6cp_options *ao = &pcb->ipv6cp_allowoptions; ipv6cp_options *go = &pcb->ipv6cp_gotoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ + u_char *cip, *next; /* Pointer to current and next CIs */ + u_short cilen, citype; /* Parsed len, type */ #ifdef IPV6CP_COMP - u_short cishort; /* Parsed short value */ + u_short cishort; /* Parsed short value */ #endif /* IPV6CP_COMP */ - eui64_t ifaceid; /* Parsed interface identifier */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ + eui64_t ifaceid; /* Parsed interface identifier */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *ucp = inp; /* Pointer to current output char */ + int l = *len; /* Length left */ /* * Reset all his options. */ BZERO(ho, sizeof(*ho)); - + /* * Process all his options. */ next = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_IFACEID: - IPV6CPDEBUG(("ipv6cp: received interface identifier ")); - - if (!ao->neg_ifaceid || - cilen != CILEN_IFACEID) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no interface identifier, or if we both have same - * identifier then NAK it with new idea. - * In particular, if we don't know his identifier, but he does, - * then accept it. - */ - eui64_get(ifaceid, p); - IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); - if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { - orc = CONFREJ; /* Reject CI */ - break; - } - if (!eui64_iszero(wo->hisid) && - !eui64_equals(ifaceid, wo->hisid) && - eui64_iszero(go->hisid)) { - - orc = CONFNAK; - ifaceid = wo->hisid; - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } else - if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { - orc = CONFNAK; - if (eui64_iszero(go->hisid)) /* first time, try option */ - ifaceid = wo->hisid; - while (eui64_iszero(ifaceid) || - eui64_equals(ifaceid, go->ourid)) /* bad luck */ - eui64_magic(ifaceid); - go->hisid = ifaceid; - DECPTR(sizeof(ifaceid), p); - eui64_put(ifaceid, p); - } - - ho->neg_ifaceid = 1; - ho->hisid = ifaceid; - break; + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + IPV6CPDEBUG(("ipv6cp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_IFACEID: + IPV6CPDEBUG(("ipv6cp: received interface identifier ")); + + if (!ao->neg_ifaceid || + cilen != CILEN_IFACEID) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + + /* + * If he has no interface identifier, or if we both have same + * identifier then NAK it with new idea. + * In particular, if we don't know his identifier, but he does, + * then accept it. + */ + eui64_get(ifaceid, p); + IPV6CPDEBUG(("(%s)", llv6_ntoa(ifaceid))); + if (eui64_iszero(ifaceid) && eui64_iszero(go->ourid)) { + orc = CONFREJ; /* Reject CI */ + break; + } + if (!eui64_iszero(wo->hisid) && + !eui64_equals(ifaceid, wo->hisid) && + eui64_iszero(go->hisid)) { + + orc = CONFNAK; + ifaceid = wo->hisid; + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } else + if (eui64_iszero(ifaceid) || eui64_equals(ifaceid, go->ourid)) { + orc = CONFNAK; + if (eui64_iszero(go->hisid)) /* first time, try option */ + ifaceid = wo->hisid; + while (eui64_iszero(ifaceid) || + eui64_equals(ifaceid, go->ourid)) /* bad luck */ + eui64_magic(ifaceid); + go->hisid = ifaceid; + DECPTR(sizeof(ifaceid), p); + eui64_put(ifaceid, p); + } + + ho->neg_ifaceid = 1; + ho->hisid = ifaceid; + break; #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); - if (!ao->neg_vj || - (cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - IPV6CPDEBUG(("(%d)", cishort)); - - if (!(cishort == IPV6CP_COMP)) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - break; + case CI_COMPRESSTYPE: + IPV6CPDEBUG(("ipv6cp: received COMPRESSTYPE ")); + if (!ao->neg_vj || + (cilen != CILEN_COMPRESS)) { + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + IPV6CPDEBUG(("(%d)", cishort)); + + if (!(cishort == IPV6CP_COMP)) { + orc = CONFREJ; + break; + } + + ho->neg_vj = 1; + ho->vj_protocol = cishort; + break; #endif /* IPV6CP_COMP */ - default: - orc = CONFREJ; - break; - } + default: + orc = CONFREJ; + break; + } endswitch: - IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); - - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - MEMCPY(ucp, cip, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); + IPV6CPDEBUG((" (%s)\n", CODENAME(orc))); + + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree) /* Getting fed up with sending NAKs? */ + orc = CONFREJ; /* Get tough if so */ + else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + if (rc == CONFACK) { /* Ack'd all prior CIs? */ + rc = CONFNAK; /* Not anymore... */ + ucp = inp; /* Backup */ + } + } + } + + if (orc == CONFREJ && /* Reject this CI */ + rc != CONFREJ) { /* but no prior ones? */ + rc = CONFREJ; + ucp = inp; /* Backup */ + } + + /* Need to move CI? */ + if (ucp != cip) + MEMCPY(ucp, cip, cilen); /* Move it */ + + /* Update output pointer */ + INCPTR(cilen, ucp); } /* @@ -1044,20 +1044,20 @@ endswitch: * option safely. */ if (rc != CONFREJ && !ho->neg_ifaceid && - wo->req_ifaceid && !reject_if_disagree) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_ifaceid = 0; /* don't ask again */ - } - PUTCHAR(CI_IFACEID, ucp); - PUTCHAR(CILEN_IFACEID, ucp); - eui64_put(wo->hisid, ucp); + wo->req_ifaceid && !reject_if_disagree) { + if (rc == CONFACK) { + rc = CONFNAK; + ucp = inp; /* reset pointer */ + wo->req_ifaceid = 0; /* don't ask again */ + } + PUTCHAR(CI_IFACEID, ucp); + PUTCHAR(CILEN_IFACEID, ucp); + eui64_put(wo->hisid, ucp); } - *len = ucp - inp; /* Compute output length */ + *len = ucp - inp; /* Compute output length */ IPV6CPDEBUG(("ipv6cp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } #if PPP_OPTIONS @@ -1069,7 +1069,7 @@ static void ipv6_check_options() { ipv6cp_options *wo = &ipv6cp_wantoptions[0]; if (!ipv6cp_protent.enabled_flag) - return; + return; /* * Persistent link-local id is only used when user has not explicitly @@ -1077,42 +1077,42 @@ static void ipv6_check_options() { */ if ((wo->use_persistent) && (!wo->opt_local) && (!wo->opt_remote)) { - /* - * On systems where there are no Ethernet interfaces used, there - * may be other ways to obtain a persistent id. Right now, it - * will fall back to using magic [see eui64_magic] below when - * an EUI-48 from MAC address can't be obtained. Other possibilities - * include obtaining EEPROM serial numbers, or some other unique - * yet persistent number. On Sparc platforms, this is possible, - * but too bad there's no standards yet for x86 machines. - */ - if (ether_to_eui64(&wo->ourid)) { - wo->opt_local = 1; - } - } - - if (!wo->opt_local) { /* init interface identifier */ - if (wo->use_ip && eui64_iszero(wo->ourid)) { - eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); - if (!eui64_iszero(wo->ourid)) - wo->opt_local = 1; + /* + * On systems where there are no Ethernet interfaces used, there + * may be other ways to obtain a persistent id. Right now, it + * will fall back to using magic [see eui64_magic] below when + * an EUI-48 from MAC address can't be obtained. Other possibilities + * include obtaining EEPROM serial numbers, or some other unique + * yet persistent number. On Sparc platforms, this is possible, + * but too bad there's no standards yet for x86 machines. + */ + if (ether_to_eui64(&wo->ourid)) { + wo->opt_local = 1; + } } - while (eui64_iszero(wo->ourid)) - eui64_magic(wo->ourid); + if (!wo->opt_local) { /* init interface identifier */ + if (wo->use_ip && eui64_iszero(wo->ourid)) { + eui64_setlo32(wo->ourid, lwip_ntohl(ipcp_wantoptions[0].ouraddr)); + if (!eui64_iszero(wo->ourid)) + wo->opt_local = 1; + } + + while (eui64_iszero(wo->ourid)) + eui64_magic(wo->ourid); } if (!wo->opt_remote) { - if (wo->use_ip && eui64_iszero(wo->hisid)) { - eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); - if (!eui64_iszero(wo->hisid)) - wo->opt_remote = 1; - } + if (wo->use_ip && eui64_iszero(wo->hisid)) { + eui64_setlo32(wo->hisid, lwip_ntohl(ipcp_wantoptions[0].hisaddr)); + if (!eui64_iszero(wo->hisid)) + wo->opt_remote = 1; + } } if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) { - option_error("local/remote LL address required for demand-dialling\n"); - exit(1); + option_error("local/remote LL address required for demand-dialling\n"); + exit(1); } } #endif /* PPP_OPTIONS */ @@ -1126,13 +1126,13 @@ static int ipv6_demand_conf(int u) { ipv6cp_options *wo = &ipv6cp_wantoptions[u]; if (!sif6up(u)) - return 0; + return 0; if (!sif6addr(u, wo->ourid, wo->hisid)) - return 0; + return 0; if (!sifnpmode(u, PPP_IPV6, NPMODE_QUEUE)) - return 0; + return 0; ppp_notice("ipv6_demand_conf"); ppp_notice("local LL address %s", llv6_ntoa(wo->ourid)); @@ -1160,26 +1160,26 @@ static void ipv6cp_up(fsm *f) { * We must have a non-zero LL address for both ends of the link. */ if (!ho->neg_ifaceid) - ho->hisid = wo->hisid; + ho->hisid = wo->hisid; #if 0 /* UNUSED */ if(!no_ifaceid_neg) { #endif /* UNUSED */ - if (eui64_iszero(ho->hisid)) { - ppp_error("Could not determine remote LL address"); - ipv6cp_close(f->pcb, "Could not determine remote LL address"); - return; - } - if (eui64_iszero(go->ourid)) { - ppp_error("Could not determine local LL address"); - ipv6cp_close(f->pcb, "Could not determine local LL address"); - return; - } - if (eui64_equals(go->ourid, ho->hisid)) { - ppp_error("local and remote LL addresses are equal"); - ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); - return; - } + if (eui64_iszero(ho->hisid)) { + ppp_error("Could not determine remote LL address"); + ipv6cp_close(f->pcb, "Could not determine remote LL address"); + return; + } + if (eui64_iszero(go->ourid)) { + ppp_error("Could not determine local LL address"); + ipv6cp_close(f->pcb, "Could not determine local LL address"); + return; + } + if (eui64_equals(go->ourid, ho->hisid)) { + ppp_error("local and remote LL addresses are equal"); + ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); + return; + } #if 0 /* UNUSED */ } #endif /* UNUSED */ @@ -1200,52 +1200,52 @@ static void ipv6cp_up(fsm *f) { * interface to pass IPv6 packets. */ if (demand) { - if (! eui64_equals(go->ourid, wo->ourid) || - ! eui64_equals(ho->hisid, wo->hisid)) { - if (! eui64_equals(go->ourid, wo->ourid)) - warn("Local LL address changed to %s", - llv6_ntoa(go->ourid)); - if (! eui64_equals(ho->hisid, wo->hisid)) - warn("Remote LL address changed to %s", - llv6_ntoa(ho->hisid)); - ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); - - /* Set the interface to the new addresses */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - if (debug) - warn("sif6addr failed"); - ipv6cp_close(f->unit, "Interface configuration failed"); - return; - } - - } - demand_rexmit(PPP_IPV6); - sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); + if (! eui64_equals(go->ourid, wo->ourid) || + ! eui64_equals(ho->hisid, wo->hisid)) { + if (! eui64_equals(go->ourid, wo->ourid)) + warn("Local LL address changed to %s", + llv6_ntoa(go->ourid)); + if (! eui64_equals(ho->hisid, wo->hisid)) + warn("Remote LL address changed to %s", + llv6_ntoa(ho->hisid)); + ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); + + /* Set the interface to the new addresses */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + if (debug) + warn("sif6addr failed"); + ipv6cp_close(f->unit, "Interface configuration failed"); + return; + } + + } + demand_rexmit(PPP_IPV6); + sifnpmode(f->unit, PPP_IPV6, NPMODE_PASS); } else #endif /* DEMAND_SUPPORT */ { - /* - * Set LL addresses - */ - if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { - PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } - - /* bring the interface up for IPv6 */ - if (!sif6up(f->pcb)) { - PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); - ipv6cp_close(f->pcb, "Interface configuration failed"); - return; - } + /* + * Set LL addresses + */ + if (!sif6addr(f->pcb, go->ourid, ho->hisid)) { + PPPDEBUG(LOG_DEBUG, ("sif6addr failed")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } + + /* bring the interface up for IPv6 */ + if (!sif6up(f->pcb)) { + PPPDEBUG(LOG_DEBUG, ("sif6up failed (IPV6)")); + ipv6cp_close(f->pcb, "Interface configuration failed"); + return; + } #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); #endif /* DEMAND_SUPPORT */ - ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); - ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); + ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); + ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); } np_up(f->pcb, PPP_IPV6); @@ -1254,11 +1254,11 @@ static void ipv6cp_up(fsm *f) { #if 0 /* UNUSED */ /* * Execute the ipv6-up script, like this: - * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL + * /etc/ppp/ipv6-up interface tty speed local-LL remote-LL */ if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); } #endif /* UNUSED */ } @@ -1280,8 +1280,8 @@ static void ipv6cp_down(fsm *f) { update_link_stats(f->unit); #endif /* PPP_STATS_SUPPORT */ if (pcb->ipv6cp_is_up) { - pcb->ipv6cp_is_up = 0; - np_down(f->pcb, PPP_IPV6); + pcb->ipv6cp_is_up = 0; + np_down(f->pcb, PPP_IPV6); } #ifdef IPV6CP_COMP sif6comp(f->unit, 0); @@ -1293,24 +1293,24 @@ static void ipv6cp_down(fsm *f) { * to queue up outgoing packets (for now). */ if (demand) { - sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE); } else #endif /* DEMAND_SUPPORT */ { #if DEMAND_SUPPORT - sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); + sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); #endif /* DEMAND_SUPPORT */ - ipv6cp_clear_addrs(f->pcb, - go->ourid, - ho->hisid); - sif6down(f->pcb); + ipv6cp_clear_addrs(f->pcb, + go->ourid, + ho->hisid); + sif6down(f->pcb); } #if 0 /* UNUSED */ /* Execute the ipv6-down script */ if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); } #endif /* UNUSED */ } @@ -1345,17 +1345,17 @@ ipv6cp_script_done(arg) ipv6cp_script_pid = 0; switch (ipv6cp_script_state) { case s_up: - if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { - ipv6cp_script_state = s_down; - ipv6cp_script(_PATH_IPV6DOWN); - } - break; + if (ipv6cp_fsm[0].state != PPP_FSM_OPENED) { + ipv6cp_script_state = s_down; + ipv6cp_script(_PATH_IPV6DOWN); + } + break; case s_down: - if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { - ipv6cp_script_state = s_up; - ipv6cp_script(_PATH_IPV6UP); - } - break; + if (ipv6cp_fsm[0].state == PPP_FSM_OPENED) { + ipv6cp_script_state = s_up; + ipv6cp_script(_PATH_IPV6UP); + } + break; } } @@ -1385,7 +1385,7 @@ ipv6cp_script(script) argv[7] = NULL; ipv6cp_script_pid = run_program(script, argv, 0, ipv6cp_script_done, - NULL, 0); + NULL, 0); } #endif /* UNUSED */ @@ -1399,7 +1399,7 @@ static const char* const ipv6cp_codenames[] = { }; static int ipv6cp_printpkt(const u_char *p, int plen, - void (*printer)(void *, const char *, ...), void *arg) { + void (*printer)(void *, const char *, ...), void *arg) { int code, id, len, olen; const u_char *pstart, *optend; #ifdef IPV6CP_COMP @@ -1408,18 +1408,18 @@ static int ipv6cp_printpkt(const u_char *p, int plen, eui64_t ifaceid; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ipv6cp_codenames)) - printer(arg, " %s", ipv6cp_codenames[code-1]); + printer(arg, " %s", ipv6cp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -1427,63 +1427,63 @@ static int ipv6cp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { #ifdef IPV6CP_COMP - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - printer(arg, "0x%x", cishort); - } - break; + case CI_COMPRESSTYPE: + if (olen >= CILEN_COMPRESS) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "compress "); + printer(arg, "0x%x", cishort); + } + break; #endif /* IPV6CP_COMP */ - case CI_IFACEID: - if (olen == CILEN_IFACEID) { - p += 2; - eui64_get(ifaceid, p); - printer(arg, "addr %s", llv6_ntoa(ifaceid)); - } - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + case CI_IFACEID: + if (olen == CILEN_IFACEID) { + p += 2; + eui64_get(ifaceid, p); + printer(arg, "addr %s", llv6_ntoa(ifaceid)); + } + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; @@ -1496,19 +1496,19 @@ static int ipv6cp_printpkt(const u_char *p, int plen, * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */ -#define IP6_HDRLEN 40 /* bytes */ -#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 +#define IP6_HDRLEN 40 /* bytes */ +#define IP6_NHDR_FRAG 44 /* fragment IPv6 header */ +#define TCP_HDRLEN 20 +#define TH_FIN 0x01 /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */ -#define get_ip6nh(x) (((unsigned char *)(x))[6]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) +#define get_ip6nh(x) (((unsigned char *)(x))[6]) +#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) +#define get_tcpflags(x) (((unsigned char *)(x))[13]) static int ipv6_active_pkt(u_char *pkt, int len) { u_char *tcp; @@ -1516,16 +1516,16 @@ static int ipv6_active_pkt(u_char *pkt, int len) { len -= PPP_HDRLEN; pkt += PPP_HDRLEN; if (len < IP6_HDRLEN) - return 0; + return 0; if (get_ip6nh(pkt) == IP6_NHDR_FRAG) - return 0; + return 0; if (get_ip6nh(pkt) != IPPROTO_TCP) - return 1; + return 1; if (len < IP6_HDRLEN + TCP_HDRLEN) - return 0; + return 0; tcp = pkt + IP6_HDRLEN; if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == IP6_HDRLEN + get_tcpoff(tcp) * 4) - return 0; + return 0; return 1; } #endif /* DEMAND_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/lcp.c b/components/net/lwip-2.1.2/src/netif/ppp/lcp.c index 040135637c..90ed183b75 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/lcp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/lcp.c @@ -68,7 +68,7 @@ * configure-requests. We do this by delaying the fsm_lowerup call. */ /* steal a bit in fsm flags word */ -#define DELAYED_UP 0x80 +#define DELAYED_UP 0x80 static void lcp_delayed_up(void *arg); @@ -76,8 +76,8 @@ static void lcp_delayed_up(void *arg); * LCP-related command-line options. */ #if 0 /* UNUSED */ -int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ -int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ +int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ +int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ #endif /* UNUSED */ #if 0 /* UNUSED */ @@ -88,10 +88,10 @@ static u_int lcp_echo_fails = LCP_MAXECHOFAILS; /* Tolerance to unanswer #if 0 /* UNUSED */ #if PPP_LCP_ADAPTIVE -bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ +bool lcp_echo_adaptive = 0; /* request echo only if the link was idle */ #endif -bool lax_recv = 0; /* accept control chars in asyncmap */ -bool noendpoint = 0; /* don't send/accept endpoint discriminator */ +bool lax_recv = 0; /* accept control chars in asyncmap */ +bool noendpoint = 0; /* don't send/accept endpoint discriminator */ #endif /* UNUSED */ #if PPP_OPTIONS @@ -101,7 +101,7 @@ static int noopt (char **); #ifdef HAVE_MULTILINK static int setendpoint (char **); static void printendpoint (option_t *, void (*)(void *, char *, ...), - void *); + void *); #endif /* HAVE_MULTILINK */ #if PPP_OPTIONS @@ -215,17 +215,17 @@ static option_t lcp_option_list[] = { /* * Callbacks for fsm code. (CI = Configuration Information) */ -static void lcp_resetci(fsm *f); /* Reset our CI */ -static int lcp_cilen(fsm *f); /* Return length of our CI */ +static void lcp_resetci(fsm *f); /* Reset our CI */ +static int lcp_cilen(fsm *f); /* Return length of our CI */ static void lcp_addci(fsm *f, u_char *ucp, int *lenp); /* Add our CI to pkt */ static int lcp_ackci(fsm *f, u_char *p, int len); /* Peer ack'd our CI */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject); /* Peer nak'd our CI */ static int lcp_rejci(fsm *f, u_char *p, int len); /* Peer rej'd our CI */ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree); /* Rcv peer CI */ -static void lcp_up(fsm *f); /* We're UP */ -static void lcp_down(fsm *f); /* We're DOWN */ -static void lcp_starting (fsm *); /* We need lower layer up */ -static void lcp_finished (fsm *); /* We need lower layer down */ +static void lcp_up(fsm *f); /* We're UP */ +static void lcp_down(fsm *f); /* We're DOWN */ +static void lcp_starting (fsm *); /* We need lower layer up */ +static void lcp_finished (fsm *); /* We need lower layer down */ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len); static void lcp_rprotrej(fsm *f, u_char *inp, int len); @@ -241,22 +241,22 @@ static void LcpSendEchoRequest(fsm *f); static void LcpLinkFailure(fsm *f); static void LcpEchoCheck(fsm *f); -static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ - lcp_resetci, /* Reset our Configuration Information */ - lcp_cilen, /* Length of our Configuration Information */ - lcp_addci, /* Add our Configuration Information */ - lcp_ackci, /* ACK our Configuration Information */ - lcp_nakci, /* NAK our Configuration Information */ - lcp_rejci, /* Reject our Configuration Information */ - lcp_reqci, /* Request peer's Configuration Information */ - lcp_up, /* Called when fsm reaches OPENED state */ - lcp_down, /* Called when fsm leaves OPENED state */ - lcp_starting, /* Called when we want the lower layer up */ - lcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - lcp_extcode, /* Called to handle LCP-specific codes */ - "LCP" /* String name of protocol */ +static const fsm_callbacks lcp_callbacks = { /* LCP callback routines */ + lcp_resetci, /* Reset our Configuration Information */ + lcp_cilen, /* Length of our Configuration Information */ + lcp_addci, /* Add our Configuration Information */ + lcp_ackci, /* ACK our Configuration Information */ + lcp_nakci, /* NAK our Configuration Information */ + lcp_rejci, /* Reject our Configuration Information */ + lcp_reqci, /* Request peer's Configuration Information */ + lcp_up, /* Called when fsm reaches OPENED state */ + lcp_down, /* Called when fsm leaves OPENED state */ + lcp_starting, /* Called when we want the lower layer up */ + lcp_finished, /* Called when we want the lower layer down */ + NULL, /* Called when Protocol-Reject received */ + NULL, /* Retransmission is necessary */ + lcp_extcode, /* Called to handle LCP-specific codes */ + "LCP" /* String name of protocol */ }; /* @@ -269,7 +269,7 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len); static void lcp_protrej(ppp_pcb *pcb); #if PRINTPKT_SUPPORT static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); #endif /* PRINTPKT_SUPPORT */ const struct protent lcp_protent = { @@ -304,20 +304,20 @@ const struct protent lcp_protent = { /* * Length of each type of configuration option (in octets) */ -#define CILEN_VOID 2 -#define CILEN_CHAR 3 -#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ +#define CILEN_VOID 2 +#define CILEN_CHAR 3 +#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ #if CHAP_SUPPORT -#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ +#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ #endif /* CHAP_SUPPORT */ -#define CILEN_LONG 6 /* CILEN_VOID + 4 */ +#define CILEN_LONG 6 /* CILEN_VOID + 4 */ #if LQR_SUPPORT -#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ +#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ #endif /* LQR_SUPPORT */ -#define CILEN_CBCP 3 +#define CILEN_CBCP 3 -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") +#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ + (x) == CONFNAK ? "NAK" : "REJ") #if PPP_OPTIONS /* @@ -340,8 +340,8 @@ setendpoint(argv) char **argv; { if (str_to_epdisc(&lcp_wantoptions[0].endpoint, *argv)) { - lcp_wantoptions[0].neg_endpoint = 1; - return 1; + lcp_wantoptions[0].neg_endpoint = 1; + return 1; } option_error("Can't parse '%s' as an endpoint discriminator", *argv); return 0; @@ -353,7 +353,7 @@ printendpoint(opt, printer, arg) void (*printer) (void *, char *, ...); void *arg; { - printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); + printer(arg, "%s", epdisc_to_str(&lcp_wantoptions[0].endpoint)); } #endif /* HAVE_MULTILINK */ @@ -409,9 +409,9 @@ void lcp_open(ppp_pcb *pcb) { f->flags &= ~(OPT_PASSIVE | OPT_SILENT); if (wo->passive) - f->flags |= OPT_PASSIVE; + f->flags |= OPT_PASSIVE; if (wo->silent) - f->flags |= OPT_SILENT; + f->flags |= OPT_SILENT; fsm_open(f); } @@ -428,25 +428,25 @@ void lcp_close(ppp_pcb *pcb, const char *reason) { && pcb->phase != PPP_PHASE_MASTER #endif /* HAVE_MULTILINK */ ) - new_phase(pcb, PPP_PHASE_TERMINATE); + new_phase(pcb, PPP_PHASE_TERMINATE); if (f->flags & DELAYED_UP) { - UNTIMEOUT(lcp_delayed_up, f); - f->state = PPP_FSM_STOPPED; + UNTIMEOUT(lcp_delayed_up, f); + f->state = PPP_FSM_STOPPED; } oldstate = f->state; fsm_close(f, reason); if (oldstate == PPP_FSM_STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP))) { - /* - * This action is not strictly according to the FSM in RFC1548, - * but it does mean that the program terminates if you do a - * lcp_close() when a connection hasn't been established - * because we are in passive/silent mode or because we have - * delayed the fsm_lowerup() call and it hasn't happened yet. - */ - f->flags &= ~DELAYED_UP; - lcp_finished(f); + /* + * This action is not strictly according to the FSM in RFC1548, + * but it does mean that the program terminates if you do a + * lcp_close() when a connection hasn't been established + * because we are in passive/silent mode or because we have + * delayed the fsm_lowerup() call and it hasn't happened yet. + */ + f->flags &= ~DELAYED_UP; + lcp_finished(f); } } @@ -463,16 +463,16 @@ void lcp_lowerup(ppp_pcb *pcb) { * if we are going to ask for A/C and protocol compression. */ if (ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0) < 0 - || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), - wo->neg_pcompression, wo->neg_accompression) < 0) - return; + || ppp_recv_config(pcb, PPP_MRU, (pcb->settings.lax_recv? 0: 0xffffffff), + wo->neg_pcompression, wo->neg_accompression) < 0) + return; pcb->peer_mru = PPP_MRU; if (pcb->settings.listen_time != 0) { - f->flags |= DELAYED_UP; - TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); + f->flags |= DELAYED_UP; + TIMEOUTMS(lcp_delayed_up, f, pcb->settings.listen_time); } else - fsm_lowerup(f); + fsm_lowerup(f); } @@ -483,10 +483,10 @@ void lcp_lowerdown(ppp_pcb *pcb) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); } else - fsm_lowerdown(f); + fsm_lowerdown(f); } @@ -497,8 +497,8 @@ static void lcp_delayed_up(void *arg) { fsm *f = (fsm*)arg; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + fsm_lowerup(f); } } @@ -510,9 +510,9 @@ static void lcp_input(ppp_pcb *pcb, u_char *p, int len) { fsm *f = &pcb->lcp_fsm; if (f->flags & DELAYED_UP) { - f->flags &= ~DELAYED_UP; - UNTIMEOUT(lcp_delayed_up, f); - fsm_lowerup(f); + f->flags &= ~DELAYED_UP; + UNTIMEOUT(lcp_delayed_up, f); + fsm_lowerup(f); } fsm_input(f, p, len); } @@ -527,33 +527,33 @@ static int lcp_extcode(fsm *f, int code, int id, u_char *inp, int len) { switch( code ){ case PROTREJ: - lcp_rprotrej(f, inp, len); - break; - + lcp_rprotrej(f, inp, len); + break; + case ECHOREQ: - if (f->state != PPP_FSM_OPENED) - break; - magp = inp; - PUTLONG(go->magicnumber, magp); - fsm_sdata(f, ECHOREP, id, inp, len); - break; - + if (f->state != PPP_FSM_OPENED) + break; + magp = inp; + PUTLONG(go->magicnumber, magp); + fsm_sdata(f, ECHOREP, id, inp, len); + break; + case ECHOREP: - lcp_received_echo_reply(f, id, inp, len); - break; + lcp_received_echo_reply(f, id, inp, len); + break; case DISCREQ: case IDENTIF: case TIMEREM: - break; + break; default: - return 0; + return 0; } return 1; } - + /* * lcp_rprotrej - Receive an Protocol-Reject. * @@ -568,8 +568,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { #endif /* PPP_PROTOCOLNAME */ if (len < 2) { - LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); - return; + LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); + return; } GETSHORT(prot, inp); @@ -579,8 +579,8 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * OPENED state SHOULD be silently discarded. */ if( f->state != PPP_FSM_OPENED ){ - LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); - return; + LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); + return; } #if PPP_PROTOCOLNAME @@ -591,25 +591,25 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * Upcall the proper Protocol-Reject routine. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol == prot) { + if (protp->protocol == prot) { #if PPP_PROTOCOLNAME - if (pname != NULL) - ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, - prot); - else + if (pname != NULL) + ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, + prot); + else #endif /* PPP_PROTOCOLNAME */ - ppp_dbglog("Protocol-Reject for 0x%x received", prot); - (*protp->protrej)(f->pcb); - return; - } + ppp_dbglog("Protocol-Reject for 0x%x received", prot); + (*protp->protrej)(f->pcb); + return; + } #if PPP_PROTOCOLNAME if (pname != NULL) - ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, - prot); + ppp_warn("Protocol-Reject for unsupported protocol '%s' (0x%x)", pname, + prot); else #endif /* #if PPP_PROTOCOLNAME */ - ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); + ppp_warn("Protocol-Reject for unsupported protocol 0x%x", prot); } @@ -641,7 +641,7 @@ void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len) { #endif fsm_sdata(f, PROTREJ, ++f->id, - p, len); + p, len); } @@ -748,15 +748,15 @@ static void lcp_resetci(fsm *f) { *go = *wo; #ifdef HAVE_MULTILINK if (!multilink) { - go->neg_mrru = 0; + go->neg_mrru = 0; #endif /* HAVE_MULTILINK */ - go->neg_ssnhf = 0; - go->neg_endpoint = 0; + go->neg_ssnhf = 0; + go->neg_endpoint = 0; #ifdef HAVE_MULTILINK } #endif /* HAVE_MULTILINK */ if (pcb->settings.noendpoint) - ao->neg_endpoint = 0; + ao->neg_endpoint = 0; pcb->peer_mru = PPP_MRU; #if 0 /* UNUSED */ auth_reset(pcb); @@ -771,60 +771,60 @@ static int lcp_cilen(fsm *f) { ppp_pcb *pcb = f->pcb; lcp_options *go = &pcb->lcp_gotoptions; -#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) +#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) #if CHAP_SUPPORT -#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) +#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) #endif /* CHAP_SUPPORT */ -#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) -#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) +#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) +#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) #if LQR_SUPPORT -#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) +#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) #endif /* LQR_SUPPORT */ -#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) +#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) /* * NB: we only ask for one of CHAP, UPAP, or EAP, even if we will * accept more than one. We prefer EAP first, then CHAP, then * PAP. */ return (LENCISHORT(go->neg_mru && go->mru != PPP_DEFMRU) + - LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + + LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + #if EAP_SUPPORT - LENCISHORT(go->neg_eap) + + LENCISHORT(go->neg_eap) + #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT - LENCICHAP(!go->neg_eap && go->neg_chap) + + LENCICHAP(!go->neg_eap && go->neg_chap) + #endif /* EAP_SUPPORT */ #if !EAP_SUPPORT - LENCICHAP(go->neg_chap) + + LENCICHAP(go->neg_chap) + #endif /* !EAP_SUPPORT */ #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT /* cannot be improved, embedding a directive within macro arguments is not portable */ #if EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_eap && !go->neg_chap && go->neg_upap) + #endif /* EAP_SUPPORT && CHAP_SUPPORT */ #if EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(!go->neg_eap && go->neg_upap) + + LENCISHORT(!go->neg_eap && go->neg_upap) + #endif /* EAP_SUPPORT && !CHAP_SUPPORT */ #if !EAP_SUPPORT && CHAP_SUPPORT - LENCISHORT(!go->neg_chap && go->neg_upap) + + LENCISHORT(!go->neg_chap && go->neg_upap) + #endif /* !EAP_SUPPORT && CHAP_SUPPORT */ #if !EAP_SUPPORT && !CHAP_SUPPORT - LENCISHORT(go->neg_upap) + + LENCISHORT(go->neg_upap) + #endif /* !EAP_SUPPORT && !CHAP_SUPPORT */ #endif /* PAP_SUPPORT */ #if LQR_SUPPORT - LENCILQR(go->neg_lqr) + + LENCILQR(go->neg_lqr) + #endif /* LQR_SUPPORT */ - LENCICBCP(go->neg_cbcp) + - LENCILONG(go->neg_magicnumber) + - LENCIVOID(go->neg_pcompression) + - LENCIVOID(go->neg_accompression) + + LENCICBCP(go->neg_cbcp) + + LENCILONG(go->neg_magicnumber) + + LENCIVOID(go->neg_pcompression) + + LENCIVOID(go->neg_accompression) + #ifdef HAVE_MULTILINK - LENCISHORT(go->neg_mrru) + + LENCISHORT(go->neg_mrru) + #endif /* HAVE_MULTILINK */ - LENCIVOID(go->neg_ssnhf) + - (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); + LENCIVOID(go->neg_ssnhf) + + (go->neg_endpoint? CILEN_CHAR + go->endpoint.length: 0)); } @@ -838,58 +838,58 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #define ADDCIVOID(opt, neg) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_VOID, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_VOID, ucp); \ } #define ADDCISHORT(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_SHORT, ucp); \ - PUTSHORT(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_SHORT, ucp); \ + PUTSHORT(val, ucp); \ } #if CHAP_SUPPORT #define ADDCICHAP(opt, neg, val) \ if (neg) { \ - PUTCHAR((opt), ucp); \ - PUTCHAR(CILEN_CHAP, ucp); \ - PUTSHORT(PPP_CHAP, ucp); \ - PUTCHAR((CHAP_DIGEST(val)), ucp); \ + PUTCHAR((opt), ucp); \ + PUTCHAR(CILEN_CHAP, ucp); \ + PUTSHORT(PPP_CHAP, ucp); \ + PUTCHAR((CHAP_DIGEST(val)), ucp); \ } #endif /* CHAP_SUPPORT */ #define ADDCILONG(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LONG, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LONG, ucp); \ + PUTLONG(val, ucp); \ } #if LQR_SUPPORT #define ADDCILQR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LQR, ucp); \ - PUTSHORT(PPP_LQR, ucp); \ - PUTLONG(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_LQR, ucp); \ + PUTSHORT(PPP_LQR, ucp); \ + PUTLONG(val, ucp); \ } #endif /* LQR_SUPPORT */ #define ADDCICHAR(opt, neg, val) \ if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR, ucp); \ - PUTCHAR(val, ucp); \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR, ucp); \ + PUTCHAR(val, ucp); \ } #define ADDCIENDP(opt, neg, class, val, len) \ if (neg) { \ - int i; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR + len, ucp); \ - PUTCHAR(class, ucp); \ - for (i = 0; i < len; ++i) \ - PUTCHAR(val[i], ucp); \ + int i; \ + PUTCHAR(opt, ucp); \ + PUTCHAR(CILEN_CHAR + len, ucp); \ + PUTCHAR(class, ucp); \ + for (i = 0; i < len; ++i) \ + PUTCHAR(val[i], ucp); \ } ADDCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ADDCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -927,11 +927,11 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { #endif ADDCIVOID(CI_SSNHF, go->neg_ssnhf); ADDCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); if (ucp - start_ucp != *lenp) { - /* this should never happen, because peer_mtu should be 1500 */ - ppp_error("Bug in lcp_addci: wrong length"); + /* this should never happen, because peer_mtu should be 1500 */ + ppp_error("Bug in lcp_addci: wrong length"); } } @@ -941,8 +941,8 @@ static void lcp_addci(fsm *f, u_char *ucp, int *lenp) { * This should not modify any state if the Ack is bad. * * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. + * 0 - Ack was bad. + * 1 - Ack was good. */ static int lcp_ackci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -958,112 +958,112 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { */ #define ACKCIVOID(opt, neg) \ if (neg) { \ - if ((len -= CILEN_VOID) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || \ - citype != opt) \ - goto bad; \ + if ((len -= CILEN_VOID) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_VOID || \ + citype != opt) \ + goto bad; \ } #define ACKCISHORT(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_SHORT) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_SHORT || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ + if ((len -= CILEN_SHORT) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_SHORT || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != val) \ + goto bad; \ } #define ACKCICHAR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != val) \ - goto bad; \ + if ((len -= CILEN_CHAR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != val) \ + goto bad; \ } #if CHAP_SUPPORT #define ACKCICHAP(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_CHAP) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAP || \ - citype != (opt)) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_CHAP) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != (CHAP_DIGEST(val))) \ - goto bad; \ + if ((len -= CILEN_CHAP) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAP || \ + citype != (opt)) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_CHAP) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != (CHAP_DIGEST(val))) \ + goto bad; \ } #endif /* CHAP_SUPPORT */ #define ACKCILONG(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LONG) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LONG || \ - citype != opt) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LONG) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LONG || \ + citype != opt) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #if LQR_SUPPORT #define ACKCILQR(opt, neg, val) \ if (neg) { \ - if ((len -= CILEN_LQR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LQR || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_LQR) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ + if ((len -= CILEN_LQR) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_LQR || \ + citype != opt) \ + goto bad; \ + GETSHORT(cishort, p); \ + if (cishort != PPP_LQR) \ + goto bad; \ + GETLONG(cilong, p); \ + if (cilong != val) \ + goto bad; \ } #endif /* LQR_SUPPORT */ #define ACKCIENDP(opt, neg, class, val, vlen) \ if (neg) { \ - int i; \ - if ((len -= CILEN_CHAR + vlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR + vlen || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ + int i; \ + if ((len -= CILEN_CHAR + vlen) < 0) \ + goto bad; \ + GETCHAR(citype, p); \ + GETCHAR(cilen, p); \ + if (cilen != CILEN_CHAR + vlen || \ + citype != opt) \ + goto bad; \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ } ACKCISHORT(CI_MRU, go->neg_mru && go->mru != PPP_DEFMRU, go->mru); ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); + go->asyncmap); #if EAP_SUPPORT ACKCISHORT(CI_AUTHTYPE, go->neg_eap, PPP_EAP); #endif /* EAP_SUPPORT */ @@ -1101,13 +1101,13 @@ static int lcp_ackci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ ACKCIVOID(CI_SSNHF, go->neg_ssnhf); ACKCIENDP(CI_EPDISC, go->neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; return (1); bad: LCPDEBUG(("lcp_acki: received bad Ack!")); @@ -1121,8 +1121,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. + * 0 - Nak was bad. + * 1 - Nak was good. */ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { ppp_pcb *pcb = f->pcb; @@ -1131,8 +1131,8 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { u_char citype, cichar, *next; u_short cishort; u32_t cilong; - lcp_options no; /* options we've seen Naks for */ - lcp_options try_; /* options to request next time */ + lcp_options no; /* options we've seen Naks for */ + lcp_options try_; /* options to request next time */ int looped_back = 0; int cilen; @@ -1146,85 +1146,85 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { */ #define NAKCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + no.neg = 1; \ + try_.neg = 0; \ } #if CHAP_SUPPORT #define NAKCICHAP(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #endif /* CHAP_SUPPORT */ #define NAKCICHAR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[1] == CILEN_CHAR && \ - p[0] == opt) { \ - len -= CILEN_CHAR; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ + len >= CILEN_CHAR && \ + p[1] == CILEN_CHAR && \ + p[0] == opt) { \ + len -= CILEN_CHAR; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + no.neg = 1; \ + code \ } #define NAKCISHORT(opt, neg, code) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ - code \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + no.neg = 1; \ + code \ } #define NAKCILONG(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #if LQR_SUPPORT #define NAKCILQR(opt, neg, code) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + no.neg = 1; \ + code \ } #endif /* LQR_SUPPORT */ #define NAKCIENDP(opt, neg) \ if (go->neg && \ - len >= CILEN_CHAR && \ - p[0] == opt && \ - p[1] >= CILEN_CHAR && \ - p[1] <= len) { \ - len -= p[1]; \ - INCPTR(p[1], p); \ - no.neg = 1; \ - try_.neg = 0; \ + len >= CILEN_CHAR && \ + p[0] == opt && \ + p[1] >= CILEN_CHAR && \ + p[1] <= len) { \ + len -= p[1]; \ + INCPTR(p[1], p); \ + no.neg = 1; \ + try_.neg = 0; \ } /* @@ -1239,19 +1239,19 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * the limit of the default MRU we'd get if we didn't negotiate. */ if (go->neg_mru && go->mru != PPP_DEFMRU) { - NAKCISHORT(CI_MRU, neg_mru, - if (cishort <= wo->mru || cishort <= PPP_DEFMRU) - try_.mru = cishort; - ); + NAKCISHORT(CI_MRU, neg_mru, + if (cishort <= wo->mru || cishort <= PPP_DEFMRU) + try_.mru = cishort; + ); } /* * Add any characters they want to our (receive-side) asyncmap. */ if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) { - NAKCILONG(CI_ASYNCMAP, neg_asyncmap, - try_.asyncmap = go->asyncmap | cilong; - ); + NAKCILONG(CI_ASYNCMAP, neg_asyncmap, + try_.asyncmap = go->asyncmap | cilong; + ); } /* @@ -1270,125 +1270,125 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_eap #endif /* EAP_SUPPORT */ ) - && len >= CILEN_SHORT - && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { - cilen = p[1]; - len -= cilen; + && len >= CILEN_SHORT + && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { + cilen = p[1]; + len -= cilen; #if CHAP_SUPPORT - no.neg_chap = go->neg_chap; + no.neg_chap = go->neg_chap; #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - no.neg_upap = go->neg_upap; + no.neg_upap = go->neg_upap; #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - no.neg_eap = go->neg_eap; + no.neg_eap = go->neg_eap; #endif /* EAP_SUPPORT */ - INCPTR(2, p); - GETSHORT(cishort, p); + INCPTR(2, p); + GETSHORT(cishort, p); #if PAP_SUPPORT - if (cishort == PPP_PAP && cilen == CILEN_SHORT) { + if (cishort == PPP_PAP && cilen == CILEN_SHORT) { #if EAP_SUPPORT - /* If we were asking for EAP, then we need to stop that. */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* If we were asking for EAP, then we need to stop that. */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - /* If we were asking for CHAP, then we need to stop that. */ - if (go->neg_chap) - try_.neg_chap = 0; - else + /* If we were asking for CHAP, then we need to stop that. */ + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ - /* - * If we weren't asking for CHAP or EAP, then we were asking for - * PAP, in which case this Nak is bad. - */ - goto bad; - } else + /* + * If we weren't asking for CHAP or EAP, then we were asking for + * PAP, in which case this Nak is bad. + */ + goto bad; + } else #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { - GETCHAR(cichar, p); + if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { + GETCHAR(cichar, p); #if EAP_SUPPORT - /* Stop asking for EAP, if we were. */ - if (go->neg_eap) { - try_.neg_eap = 0; - /* Try to set up to use their suggestion, if possible */ - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else + /* Stop asking for EAP, if we were. */ + if (go->neg_eap) { + try_.neg_eap = 0; + /* Try to set up to use their suggestion, if possible */ + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else #endif /* EAP_SUPPORT */ - if (go->neg_chap) { - /* - * We were asking for our preferred algorithm, they must - * want something different. - */ - if (cichar != CHAP_DIGEST(go->chap_mdtype)) { - if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { - /* Use their suggestion if we support it ... */ - try_.chap_mdtype = CHAP_MDTYPE_D(cichar); - } else { - /* ... otherwise, try our next-preferred algorithm. */ - try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); - if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ - try_.neg_chap = 0; - } - } else { - /* - * Whoops, they Nak'd our algorithm of choice - * but then suggested it back to us. - */ - goto bad; - } - } else { - /* - * Stop asking for PAP if we were asking for it. - */ + if (go->neg_chap) { + /* + * We were asking for our preferred algorithm, they must + * want something different. + */ + if (cichar != CHAP_DIGEST(go->chap_mdtype)) { + if (CHAP_CANDIGEST(go->chap_mdtype, cichar)) { + /* Use their suggestion if we support it ... */ + try_.chap_mdtype = CHAP_MDTYPE_D(cichar); + } else { + /* ... otherwise, try our next-preferred algorithm. */ + try_.chap_mdtype &= ~(CHAP_MDTYPE(try_.chap_mdtype)); + if (try_.chap_mdtype == MDTYPE_NONE) /* out of algos */ + try_.neg_chap = 0; + } + } else { + /* + * Whoops, they Nak'd our algorithm of choice + * but then suggested it back to us. + */ + goto bad; + } + } else { + /* + * Stop asking for PAP if we were asking for it. + */ #if PAP_SUPPORT - try_.neg_upap = 0; + try_.neg_upap = 0; #endif /* PAP_SUPPORT */ - } + } - } else + } else #endif /* CHAP_SUPPORT */ - { + { #if EAP_SUPPORT - /* - * If we were asking for EAP, and they're Conf-Naking EAP, - * well, that's just strange. Nobody should do that. - */ - if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) - ppp_dbglog("Unexpected Conf-Nak for EAP"); - - /* - * We don't recognize what they're suggesting. - * Stop asking for what we were asking for. - */ - if (go->neg_eap) - try_.neg_eap = 0; - else + /* + * If we were asking for EAP, and they're Conf-Naking EAP, + * well, that's just strange. Nobody should do that. + */ + if (cishort == PPP_EAP && cilen == CILEN_SHORT && go->neg_eap) + ppp_dbglog("Unexpected Conf-Nak for EAP"); + + /* + * We don't recognize what they're suggesting. + * Stop asking for what we were asking for. + */ + if (go->neg_eap) + try_.neg_eap = 0; + else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (go->neg_chap) - try_.neg_chap = 0; - else + if (go->neg_chap) + try_.neg_chap = 0; + else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) - try_.neg_upap = 0; - else + if(1) + try_.neg_upap = 0; + else #endif /* PAP_SUPPORT */ - {} + {} - p += cilen - CILEN_SHORT; - } + p += cilen - CILEN_SHORT; + } } #if LQR_SUPPORT @@ -1398,11 +1398,11 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If they Nak the reporting period, take their value XXX ? */ NAKCILQR(CI_QUALITY, neg_lqr, - if (cishort != PPP_LQR) - try_.neg_lqr = 0; - else - try_.lqr_period = cilong; - ); + if (cishort != PPP_LQR) + try_.neg_lqr = 0; + else + try_.lqr_period = cilong; + ); #endif /* LQR_SUPPORT */ /* @@ -1417,9 +1417,9 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * Check for a looped-back line. */ NAKCILONG(CI_MAGICNUMBER, neg_magicnumber, - try_.magicnumber = magic(); - looped_back = 1; - ); + try_.magicnumber = magic(); + looped_back = 1; + ); /* * Peer shouldn't send Nak for protocol compression or @@ -1435,12 +1435,12 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * than the one we want. */ if (go->neg_mrru) { - NAKCISHORT(CI_MRRU, neg_mrru, - if (treat_as_reject) - try_.neg_mrru = 0; - else if (cishort <= wo->mrru) - try_.mrru = cishort; - ); + NAKCISHORT(CI_MRRU, neg_mrru, + if (treat_as_reject) + try_.neg_mrru = 0; + else if (cishort <= wo->mrru) + try_.mrru = cishort; + ); } #else /* HAVE_MULTILINK */ LWIP_UNUSED_ARG(treat_as_reject); @@ -1475,30 +1475,30 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * negotiate some option we don't support, so ignore it. */ while (len >= CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if (cilen < CILEN_VOID || (len -= cilen) < 0) - goto bad; - next = p + cilen - 2; - - switch (citype) { - case CI_MRU: - if ((go->neg_mru && go->mru != PPP_DEFMRU) - || no.neg_mru || cilen != CILEN_SHORT) - goto bad; - GETSHORT(cishort, p); - if (cishort < PPP_DEFMRU) { - try_.neg_mru = 1; - try_.mru = cishort; - } - break; - case CI_ASYNCMAP: - if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) - || no.neg_asyncmap || cilen != CILEN_LONG) - goto bad; - break; - case CI_AUTHTYPE: - if (0 + GETCHAR(citype, p); + GETCHAR(cilen, p); + if (cilen < CILEN_VOID || (len -= cilen) < 0) + goto bad; + next = p + cilen - 2; + + switch (citype) { + case CI_MRU: + if ((go->neg_mru && go->mru != PPP_DEFMRU) + || no.neg_mru || cilen != CILEN_SHORT) + goto bad; + GETSHORT(cishort, p); + if (cishort < PPP_DEFMRU) { + try_.neg_mru = 1; + try_.mru = cishort; + } + break; + case CI_ASYNCMAP: + if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + || no.neg_asyncmap || cilen != CILEN_LONG) + goto bad; + break; + case CI_AUTHTYPE: + if (0 #if CHAP_SUPPORT || go->neg_chap || no.neg_chap #endif /* CHAP_SUPPORT */ @@ -1506,51 +1506,51 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { || go->neg_upap || no.neg_upap #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - || go->neg_eap || no.neg_eap + || go->neg_eap || no.neg_eap #endif /* EAP_SUPPORT */ - ) - goto bad; - break; - case CI_MAGICNUMBER: - if (go->neg_magicnumber || no.neg_magicnumber || - cilen != CILEN_LONG) - goto bad; - break; - case CI_PCOMPRESSION: - if (go->neg_pcompression || no.neg_pcompression - || cilen != CILEN_VOID) - goto bad; - break; - case CI_ACCOMPRESSION: - if (go->neg_accompression || no.neg_accompression - || cilen != CILEN_VOID) - goto bad; - break; + ) + goto bad; + break; + case CI_MAGICNUMBER: + if (go->neg_magicnumber || no.neg_magicnumber || + cilen != CILEN_LONG) + goto bad; + break; + case CI_PCOMPRESSION: + if (go->neg_pcompression || no.neg_pcompression + || cilen != CILEN_VOID) + goto bad; + break; + case CI_ACCOMPRESSION: + if (go->neg_accompression || no.neg_accompression + || cilen != CILEN_VOID) + goto bad; + break; #if LQR_SUPPORT - case CI_QUALITY: - if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) - goto bad; - break; + case CI_QUALITY: + if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) + goto bad; + break; #endif /* LQR_SUPPORT */ #ifdef HAVE_MULTILINK - case CI_MRRU: - if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) - goto bad; - break; + case CI_MRRU: + if (go->neg_mrru || no.neg_mrru || cilen != CILEN_SHORT) + goto bad; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) - goto bad; - try_.neg_ssnhf = 1; - break; - case CI_EPDISC: - if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) - goto bad; - break; - default: - break; - } - p = next; + case CI_SSNHF: + if (go->neg_ssnhf || no.neg_ssnhf || cilen != CILEN_VOID) + goto bad; + try_.neg_ssnhf = 1; + break; + case CI_EPDISC: + if (go->neg_endpoint || no.neg_endpoint || cilen < CILEN_CHAR) + goto bad; + break; + default: + break; + } + p = next; } /* @@ -1558,15 +1558,15 @@ static int lcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject) { * If there are any options left we ignore them. */ if (f->state != PPP_FSM_OPENED) { - if (looped_back) { - if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { - ppp_notice("Serial line is looped back."); - pcb->err_code = PPPERR_LOOPBACK; - lcp_close(f->pcb, "Loopback detected"); - } - } else - try_.numloops = 0; - *go = try_; + if (looped_back) { + if (++try_.numloops >= pcb->settings.lcp_loopbackfail) { + ppp_notice("Serial line is looped back."); + pcb->err_code = PPPERR_LOOPBACK; + lcp_close(f->pcb, "Loopback detected"); + } + } else + try_.numloops = 0; + *go = try_; } return 1; @@ -1583,8 +1583,8 @@ bad: * or if LCP is in the OPENED state. * * Returns: - * 0 - Reject was bad. - * 1 - Reject was good. + * 0 - Reject was bad. + * 1 - Reject was good. */ static int lcp_rejci(fsm *f, u_char *p, int len) { ppp_pcb *pcb = f->pcb; @@ -1592,7 +1592,7 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { u_char cichar; u_short cishort; u32_t cilong; - lcp_options try_; /* options to request next time */ + lcp_options try_; /* options to request next time */ try_ = *go; @@ -1603,157 +1603,157 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { */ #define REJCIVOID(opt, neg) \ if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - try_.neg = 0; \ + len >= CILEN_VOID && \ + p[1] == CILEN_VOID && \ + p[0] == opt) { \ + len -= CILEN_VOID; \ + INCPTR(CILEN_VOID, p); \ + try_.neg = 0; \ } #define REJCISHORT(opt, neg, val) \ if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_SHORT && \ + p[1] == CILEN_SHORT && \ + p[0] == opt) { \ + len -= CILEN_SHORT; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + /* Check rejected value. */ \ + if (cishort != val) \ + goto bad; \ + try_.neg = 0; \ } #if CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_upap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_upap = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && PAP_SUPPORT */ #if CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ - try_.neg_eap = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ + try_.neg_eap = 0; \ } #endif /* CHAP_SUPPORT && EAP_SUPPORT && !PAP_SUPPORT */ #if CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT #define REJCICHAP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CHAP && \ + p[1] == CILEN_CHAP && \ + p[0] == opt) { \ + len -= CILEN_CHAP; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if ((cishort != PPP_CHAP) || (cichar != (CHAP_DIGEST(val)))) \ + goto bad; \ + try_.neg = 0; \ } #endif /* CHAP_SUPPORT && !EAP_SUPPORT && !PAP_SUPPORT */ #define REJCILONG(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LONG && \ + p[1] == CILEN_LONG && \ + p[0] == opt) { \ + len -= CILEN_LONG; \ + INCPTR(2, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #if LQR_SUPPORT #define REJCILQR(opt, neg, val) \ if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cishort != PPP_LQR || cilong != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_LQR && \ + p[1] == CILEN_LQR && \ + p[0] == opt) { \ + len -= CILEN_LQR; \ + INCPTR(2, p); \ + GETSHORT(cishort, p); \ + GETLONG(cilong, p); \ + /* Check rejected value. */ \ + if (cishort != PPP_LQR || cilong != val) \ + goto bad; \ + try_.neg = 0; \ } #endif /* LQR_SUPPORT */ #define REJCICBCP(opt, neg, val) \ if (go->neg && \ - len >= CILEN_CBCP && \ - p[1] == CILEN_CBCP && \ - p[0] == opt) { \ - len -= CILEN_CBCP; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if (cichar != val) \ - goto bad; \ - try_.neg = 0; \ + len >= CILEN_CBCP && \ + p[1] == CILEN_CBCP && \ + p[0] == opt) { \ + len -= CILEN_CBCP; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + /* Check rejected value. */ \ + if (cichar != val) \ + goto bad; \ + try_.neg = 0; \ } #define REJCIENDP(opt, neg, class, val, vlen) \ if (go->neg && \ - len >= CILEN_CHAR + vlen && \ - p[0] == opt && \ - p[1] == CILEN_CHAR + vlen) { \ - int i; \ - len -= CILEN_CHAR + vlen; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - if (cichar != class) \ - goto bad; \ - for (i = 0; i < vlen; ++i) { \ - GETCHAR(cichar, p); \ - if (cichar != val[i]) \ - goto bad; \ - } \ - try_.neg = 0; \ + len >= CILEN_CHAR + vlen && \ + p[0] == opt && \ + p[1] == CILEN_CHAR + vlen) { \ + int i; \ + len -= CILEN_CHAR + vlen; \ + INCPTR(2, p); \ + GETCHAR(cichar, p); \ + if (cichar != class) \ + goto bad; \ + for (i = 0; i < vlen; ++i) { \ + GETCHAR(cichar, p); \ + if (cichar != val[i]) \ + goto bad; \ + } \ + try_.neg = 0; \ } REJCISHORT(CI_MRU, neg_mru, go->mru); @@ -1763,14 +1763,14 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { if (!go->neg_eap) { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); - if (!go->neg_chap) { + REJCICHAP(CI_AUTHTYPE, neg_chap, go->chap_mdtype); + if (!go->neg_chap) { #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); + REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - } + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT } @@ -1787,18 +1787,18 @@ static int lcp_rejci(fsm *f, u_char *p, int len) { #endif /* HAVE_MULTILINK */ REJCIVOID(CI_SSNHF, neg_ssnhf); REJCIENDP(CI_EPDISC, neg_endpoint, go->endpoint.class_, - go->endpoint.value, go->endpoint.length); + go->endpoint.value, go->endpoint.length); /* * If there are any remaining CIs, then this packet is bad. */ if (len != 0) - goto bad; + goto bad; /* * Now we can update state. */ if (f->state != PPP_FSM_OPENED) - *go = try_; + *go = try_; return 1; bad: @@ -1822,17 +1822,17 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { lcp_options *go = &pcb->lcp_gotoptions; lcp_options *ho = &pcb->lcp_hisoptions; lcp_options *ao = &pcb->lcp_allowoptions; - u_char *cip, *next; /* Pointer to current and next CIs */ - int cilen, citype, cichar; /* Parsed len, type, char value */ - u_short cishort; /* Parsed short value */ - u32_t cilong; /* Parse long value */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *rejp; /* Pointer to next char in reject frame */ + u_char *cip, *next; /* Pointer to current and next CIs */ + int cilen, citype, cichar; /* Parsed len, type, char value */ + u_short cishort; /* Parsed short value */ + u32_t cilong; /* Parse long value */ + int rc = CONFACK; /* Final packet return code */ + int orc; /* Individual option return code */ + u_char *p; /* Pointer to next char to parse */ + u_char *rejp; /* Pointer to next char in reject frame */ struct pbuf *nakp; /* Nak buffer */ - u_char *nakoutp; /* Pointer to next char in Nak frame */ - int l = *lenp; /* Length left */ + u_char *nakoutp; /* Pointer to next char in Nak frame */ + int l = *lenp; /* Length left */ /* * Reset all his options. @@ -1854,403 +1854,403 @@ static int lcp_reqci(fsm *f, u_char *inp, int *lenp, int reject_if_disagree) { nakoutp = (u_char*)nakp->payload; rejp = inp; while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - LCPDEBUG(("lcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - citype = 0; - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_MRU: - if (!ao->neg_mru || /* Allow option? */ - cilen != CILEN_SHORT) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETSHORT(cishort, p); /* Parse MRU */ - - /* - * He must be able to receive at least our minimum. - * No need to check a maximum. If he sends a large number, - * we'll just ignore it. - */ - if (cishort < PPP_MINMRU) { - orc = CONFNAK; /* Nak CI */ - PUTCHAR(CI_MRU, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ - break; - } - ho->neg_mru = 1; /* Remember he sent MRU */ - ho->mru = cishort; /* And remember value */ - break; - - case CI_ASYNCMAP: - if (!ao->neg_asyncmap || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * Asyncmap must have set at least the bits - * which are set in lcp_allowoptions[unit].asyncmap. - */ - if ((ao->asyncmap & ~cilong) != 0) { - orc = CONFNAK; - PUTCHAR(CI_ASYNCMAP, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(ao->asyncmap | cilong, nakoutp); - break; - } - ho->neg_asyncmap = 1; - ho->asyncmap = cilong; - break; - - case CI_AUTHTYPE: - if (cilen < CILEN_SHORT || - !(0 + orc = CONFACK; /* Assume success */ + cip = p = next; /* Remember begining of CI */ + if (l < 2 || /* Not enough data for CI header or */ + p[1] < 2 || /* CI length too small or */ + p[1] > l) { /* CI length too big? */ + LCPDEBUG(("lcp_reqci: bad CI length!")); + orc = CONFREJ; /* Reject bad CI */ + cilen = l; /* Reject till end of packet */ + l = 0; /* Don't loop again */ + citype = 0; + goto endswitch; + } + GETCHAR(citype, p); /* Parse CI type */ + GETCHAR(cilen, p); /* Parse CI length */ + l -= cilen; /* Adjust remaining length */ + next += cilen; /* Step to next CI */ + + switch (citype) { /* Check CI type */ + case CI_MRU: + if (!ao->neg_mru || /* Allow option? */ + cilen != CILEN_SHORT) { /* Check CI length */ + orc = CONFREJ; /* Reject CI */ + break; + } + GETSHORT(cishort, p); /* Parse MRU */ + + /* + * He must be able to receive at least our minimum. + * No need to check a maximum. If he sends a large number, + * we'll just ignore it. + */ + if (cishort < PPP_MINMRU) { + orc = CONFNAK; /* Nak CI */ + PUTCHAR(CI_MRU, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_MINMRU, nakoutp); /* Give him a hint */ + break; + } + ho->neg_mru = 1; /* Remember he sent MRU */ + ho->mru = cishort; /* And remember value */ + break; + + case CI_ASYNCMAP: + if (!ao->neg_asyncmap || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * Asyncmap must have set at least the bits + * which are set in lcp_allowoptions[unit].asyncmap. + */ + if ((ao->asyncmap & ~cilong) != 0) { + orc = CONFNAK; + PUTCHAR(CI_ASYNCMAP, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(ao->asyncmap | cilong, nakoutp); + break; + } + ho->neg_asyncmap = 1; + ho->asyncmap = cilong; + break; + + case CI_AUTHTYPE: + if (cilen < CILEN_SHORT || + !(0 #if PAP_SUPPORT - || ao->neg_upap + || ao->neg_upap #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - || ao->neg_chap + || ao->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ao->neg_eap + || ao->neg_eap #endif /* EAP_SUPPORT */ - )) { - /* - * Reject the option if we're not willing to authenticate. - */ - ppp_dbglog("No auth is possible"); - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - /* - * Authtype must be PAP, CHAP, or EAP. - * - * Note: if more than one of ao->neg_upap, ao->neg_chap, and - * ao->neg_eap are set, and the peer sends a Configure-Request - * with two or more authenticate-protocol requests, then we will - * reject the second request. - * Whether we end up doing CHAP, UPAP, or EAP depends then on - * the ordering of the CIs in the peer's Configure-Request. + )) { + /* + * Reject the option if we're not willing to authenticate. + */ + ppp_dbglog("No auth is possible"); + orc = CONFREJ; + break; + } + GETSHORT(cishort, p); + + /* + * Authtype must be PAP, CHAP, or EAP. + * + * Note: if more than one of ao->neg_upap, ao->neg_chap, and + * ao->neg_eap are set, and the peer sends a Configure-Request + * with two or more authenticate-protocol requests, then we will + * reject the second request. + * Whether we end up doing CHAP, UPAP, or EAP depends then on + * the ordering of the CIs in the peer's Configure-Request. */ #if PAP_SUPPORT - if (cishort == PPP_PAP) { - /* we've already accepted CHAP or EAP */ - if (0 + if (cishort == PPP_PAP) { + /* we've already accepted CHAP or EAP */ + if (0 #if CHAP_SUPPORT - || ho->neg_chap + || ho->neg_chap #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - || ho->neg_eap + || ho->neg_eap #endif /* EAP_SUPPORT */ - || cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_upap) { /* we don't want to do PAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + || cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_upap) { /* we don't want to do PAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or EAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else { + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else { #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - } + } #endif /* EAP_SUPPORT */ - break; - } - ho->neg_upap = 1; - break; - } + break; + } + ho->neg_upap = 1; + break; + } #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - if (cishort == PPP_CHAP) { - /* we've already accepted PAP or EAP */ - if ( + if (cishort == PPP_CHAP) { + /* we've already accepted PAP or EAP */ + if ( #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ #if EAP_SUPPORT - ho->neg_eap || + ho->neg_eap || #endif /* EAP_SUPPORT */ - cilen != CILEN_CHAP) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_chap) { /* we don't want to do CHAP */ - orc = CONFNAK; /* NAK it and suggest EAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_SHORT, nakoutp); + cilen != CILEN_CHAP) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_chap) { /* we don't want to do CHAP */ + orc = CONFNAK; /* NAK it and suggest EAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_SHORT, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTSHORT(PPP_PAP, nakoutp); - } - else + if(1) { + PUTSHORT(PPP_PAP, nakoutp); + } + else #endif /* PAP_SUPPORT */ - {} - break; - } - GETCHAR(cichar, p); /* get digest type */ - if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { - /* - * We can't/won't do the requested type, - * suggest something else. - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - break; - } - ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ - ho->neg_chap = 1; - break; - } + {} + break; + } + GETCHAR(cichar, p); /* get digest type */ + if (!(CHAP_CANDIGEST(ao->chap_mdtype, cichar))) { + /* + * We can't/won't do the requested type, + * suggest something else. + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + break; + } + ho->chap_mdtype = CHAP_MDTYPE_D(cichar); /* save md type */ + ho->neg_chap = 1; + break; + } #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - if (cishort == PPP_EAP) { - /* we've already accepted CHAP or PAP */ - if ( + if (cishort == PPP_EAP) { + /* we've already accepted CHAP or PAP */ + if ( #if CHAP_SUPPORT - ho->neg_chap || + ho->neg_chap || #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - ho->neg_upap || + ho->neg_upap || #endif /* PAP_SUPPORT */ - cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_eap) { /* we don't want to do EAP */ - orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ - PUTCHAR(CI_AUTHTYPE, nakoutp); + cilen != CILEN_SHORT) { + LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE EAP, rejecting...")); + orc = CONFREJ; + break; + } + if (!ao->neg_eap) { /* we don't want to do EAP */ + orc = CONFNAK; /* NAK it and suggest CHAP or PAP */ + PUTCHAR(CI_AUTHTYPE, nakoutp); #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; - } - ho->neg_eap = 1; - break; - } + {} + break; + } + ho->neg_eap = 1; + break; + } #endif /* EAP_SUPPORT */ - /* - * We don't recognize the protocol they're asking for. - * Nak it with something we're willing to do. - * (At this point we know ao->neg_upap || ao->neg_chap || - * ao->neg_eap.) - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakoutp); + /* + * We don't recognize the protocol they're asking for. + * Nak it with something we're willing to do. + * (At this point we know ao->neg_upap || ao->neg_chap || + * ao->neg_eap.) + */ + orc = CONFNAK; + PUTCHAR(CI_AUTHTYPE, nakoutp); #if EAP_SUPPORT - if (ao->neg_eap) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_EAP, nakoutp); - } else + if (ao->neg_eap) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_EAP, nakoutp); + } else #endif /* EAP_SUPPORT */ #if CHAP_SUPPORT - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakoutp); - PUTSHORT(PPP_CHAP, nakoutp); - PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); - } else + if (ao->neg_chap) { + PUTCHAR(CILEN_CHAP, nakoutp); + PUTSHORT(PPP_CHAP, nakoutp); + PUTCHAR(CHAP_DIGEST(ao->chap_mdtype), nakoutp); + } else #endif /* CHAP_SUPPORT */ #if PAP_SUPPORT - if(1) { - PUTCHAR(CILEN_SHORT, nakoutp); - PUTSHORT(PPP_PAP, nakoutp); - } else + if(1) { + PUTCHAR(CILEN_SHORT, nakoutp); + PUTSHORT(PPP_PAP, nakoutp); + } else #endif /* PAP_SUPPORT */ - {} - break; + {} + break; #if LQR_SUPPORT - case CI_QUALITY: - if (!ao->neg_lqr || - cilen != CILEN_LQR) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - GETLONG(cilong, p); - - /* - * Check the protocol and the reporting period. - * XXX When should we Nak this, and what with? - */ - if (cishort != PPP_LQR) { - orc = CONFNAK; - PUTCHAR(CI_QUALITY, nakoutp); - PUTCHAR(CILEN_LQR, nakoutp); - PUTSHORT(PPP_LQR, nakoutp); - PUTLONG(ao->lqr_period, nakoutp); - break; - } - break; + case CI_QUALITY: + if (!ao->neg_lqr || + cilen != CILEN_LQR) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + GETLONG(cilong, p); + + /* + * Check the protocol and the reporting period. + * XXX When should we Nak this, and what with? + */ + if (cishort != PPP_LQR) { + orc = CONFNAK; + PUTCHAR(CI_QUALITY, nakoutp); + PUTCHAR(CILEN_LQR, nakoutp); + PUTSHORT(PPP_LQR, nakoutp); + PUTLONG(ao->lqr_period, nakoutp); + break; + } + break; #endif /* LQR_SUPPORT */ - case CI_MAGICNUMBER: - if (!(ao->neg_magicnumber || go->neg_magicnumber) || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * He must have a different magic number. - */ - if (go->neg_magicnumber && - cilong == go->magicnumber) { - cilong = magic(); /* Don't put magic() inside macro! */ - orc = CONFNAK; - PUTCHAR(CI_MAGICNUMBER, nakoutp); - PUTCHAR(CILEN_LONG, nakoutp); - PUTLONG(cilong, nakoutp); - break; - } - ho->neg_magicnumber = 1; - ho->magicnumber = cilong; - break; - - - case CI_PCOMPRESSION: - if (!ao->neg_pcompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_pcompression = 1; - break; - - case CI_ACCOMPRESSION: - if (!ao->neg_accompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_accompression = 1; - break; + case CI_MAGICNUMBER: + if (!(ao->neg_magicnumber || go->neg_magicnumber) || + cilen != CILEN_LONG) { + orc = CONFREJ; + break; + } + GETLONG(cilong, p); + + /* + * He must have a different magic number. + */ + if (go->neg_magicnumber && + cilong == go->magicnumber) { + cilong = magic(); /* Don't put magic() inside macro! */ + orc = CONFNAK; + PUTCHAR(CI_MAGICNUMBER, nakoutp); + PUTCHAR(CILEN_LONG, nakoutp); + PUTLONG(cilong, nakoutp); + break; + } + ho->neg_magicnumber = 1; + ho->magicnumber = cilong; + break; + + + case CI_PCOMPRESSION: + if (!ao->neg_pcompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_pcompression = 1; + break; + + case CI_ACCOMPRESSION: + if (!ao->neg_accompression || + cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_accompression = 1; + break; #ifdef HAVE_MULTILINK - case CI_MRRU: - if (!ao->neg_mrru - || !multilink - || cilen != CILEN_SHORT) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - /* possibly should insist on a minimum/maximum MRRU here */ - ho->neg_mrru = 1; - ho->mrru = cishort; - break; + case CI_MRRU: + if (!ao->neg_mrru + || !multilink + || cilen != CILEN_SHORT) { + orc = CONFREJ; + break; + } + + GETSHORT(cishort, p); + /* possibly should insist on a minimum/maximum MRRU here */ + ho->neg_mrru = 1; + ho->mrru = cishort; + break; #endif /* HAVE_MULTILINK */ - case CI_SSNHF: - if (!ao->neg_ssnhf + case CI_SSNHF: + if (!ao->neg_ssnhf #ifdef HAVE_MULTILINK - || !multilink + || !multilink #endif /* HAVE_MULTILINK */ - || cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_ssnhf = 1; - break; - - case CI_EPDISC: - if (!ao->neg_endpoint || - cilen < CILEN_CHAR || - cilen > CILEN_CHAR + MAX_ENDP_LEN) { - orc = CONFREJ; - break; - } - GETCHAR(cichar, p); - cilen -= CILEN_CHAR; - ho->neg_endpoint = 1; - ho->endpoint.class_ = cichar; - ho->endpoint.length = cilen; - MEMCPY(ho->endpoint.value, p, cilen); - INCPTR(cilen, p); - break; - - default: - LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); - orc = CONFREJ; - break; - } + || cilen != CILEN_VOID) { + orc = CONFREJ; + break; + } + ho->neg_ssnhf = 1; + break; + + case CI_EPDISC: + if (!ao->neg_endpoint || + cilen < CILEN_CHAR || + cilen > CILEN_CHAR + MAX_ENDP_LEN) { + orc = CONFREJ; + break; + } + GETCHAR(cichar, p); + cilen -= CILEN_CHAR; + ho->neg_endpoint = 1; + ho->endpoint.class_ = cichar; + ho->endpoint.length = cilen; + MEMCPY(ho->endpoint.value, p, cilen); + INCPTR(cilen, p); + break; + + default: + LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); + orc = CONFREJ; + break; + } endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree /* Getting fed up with sending NAKs? */ - && citype != CI_MAGICNUMBER) { - orc = CONFREJ; /* Get tough if so */ - } else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - rc = CONFNAK; - } - } - if (orc == CONFREJ) { /* Reject this CI */ - rc = CONFREJ; - if (cip != rejp) /* Need to move rejected CI? */ - MEMCPY(rejp, cip, cilen); /* Move it */ - INCPTR(cilen, rejp); /* Update output pointer */ - } + if (orc == CONFACK && /* Good CI */ + rc != CONFACK) /* but prior CI wasnt? */ + continue; /* Don't send this one */ + + if (orc == CONFNAK) { /* Nak this CI? */ + if (reject_if_disagree /* Getting fed up with sending NAKs? */ + && citype != CI_MAGICNUMBER) { + orc = CONFREJ; /* Get tough if so */ + } else { + if (rc == CONFREJ) /* Rejecting prior CI? */ + continue; /* Don't send this one */ + rc = CONFNAK; + } + } + if (orc == CONFREJ) { /* Reject this CI */ + rc = CONFREJ; + if (cip != rejp) /* Need to move rejected CI? */ + MEMCPY(rejp, cip, cilen); /* Move it */ + INCPTR(cilen, rejp); /* Update output pointer */ + } } /* @@ -2262,25 +2262,25 @@ endswitch: switch (rc) { case CONFACK: - *lenp = next - inp; - break; + *lenp = next - inp; + break; case CONFNAK: - /* - * Copy the Nak'd options from the nak buffer to the caller's buffer. - */ - *lenp = nakoutp - (u_char*)nakp->payload; - MEMCPY(inp, nakp->payload, *lenp); - break; + /* + * Copy the Nak'd options from the nak buffer to the caller's buffer. + */ + *lenp = nakoutp - (u_char*)nakp->payload; + MEMCPY(inp, nakp->payload, *lenp); + break; case CONFREJ: - *lenp = rejp - inp; - break; + *lenp = rejp - inp; + break; default: - break; + break; } pbuf_free(nakp); LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc))); - return (rc); /* Return final code */ + return (rc); /* Return final code */ } @@ -2296,9 +2296,9 @@ static void lcp_up(fsm *f) { int mtu, mru; if (!go->neg_magicnumber) - go->magicnumber = 0; + go->magicnumber = 0; if (!ho->neg_magicnumber) - ho->magicnumber = 0; + ho->magicnumber = 0; /* * Set our MTU to the smaller of the MTU we wanted and @@ -2314,16 +2314,16 @@ static void lcp_up(fsm *f) { #ifdef HAVE_MULTILINK if (!(multilink && go->neg_mrru && ho->neg_mrru)) #endif /* HAVE_MULTILINK */ - netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); + netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); ppp_send_config(pcb, mtu, - (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), - ho->neg_pcompression, ho->neg_accompression); + (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), + ho->neg_pcompression, ho->neg_accompression); ppp_recv_config(pcb, mru, - (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (pcb->settings.lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); if (ho->neg_mru) - pcb->peer_mru = ho->mru; + pcb->peer_mru = ho->mru; lcp_echo_lowerup(f->pcb); /* Enable echo messages */ @@ -2346,8 +2346,8 @@ static void lcp_down(fsm *f) { ppp_send_config(pcb, PPP_MRU, 0xffffffff, 0, 0); ppp_recv_config(pcb, PPP_MRU, - (go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); + (go->neg_asyncmap? go->asyncmap: 0xffffffff), + go->neg_pcompression, go->neg_accompression); pcb->peer_mru = PPP_MRU; } @@ -2382,25 +2382,25 @@ static const char* const lcp_codenames[] = { }; static int lcp_printpkt(const u_char *p, int plen, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int code, id, len, olen, i; const u_char *pstart, *optend; u_short cishort; u32_t cilong; if (plen < HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(lcp_codenames)) - printer(arg, " %s", lcp_codenames[code-1]); + printer(arg, " %s", lcp_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= HEADERLEN; switch (code) { @@ -2408,224 +2408,224 @@ static int lcp_printpkt(const u_char *p, int plen, case CONFACK: case CONFNAK: case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_MRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mru %d", cishort); - } - break; - case CI_ASYNCMAP: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "asyncmap 0x%x", cilong); - } - break; - case CI_AUTHTYPE: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "auth "); - GETSHORT(cishort, p); - switch (cishort) { + /* print option list */ + while (len >= 2) { + GETCHAR(code, p); + GETCHAR(olen, p); + p -= 2; + if (olen < 2 || olen > len) { + break; + } + printer(arg, " <"); + len -= olen; + optend = p + olen; + switch (code) { + case CI_MRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mru %d", cishort); + } + break; + case CI_ASYNCMAP: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "asyncmap 0x%x", cilong); + } + break; + case CI_AUTHTYPE: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "auth "); + GETSHORT(cishort, p); + switch (cishort) { #if PAP_SUPPORT - case PPP_PAP: - printer(arg, "pap"); - break; + case PPP_PAP: + printer(arg, "pap"); + break; #endif /* PAP_SUPPORT */ #if CHAP_SUPPORT - case PPP_CHAP: - printer(arg, "chap"); - if (p < optend) { - switch (*p) { - case CHAP_MD5: - printer(arg, " MD5"); - ++p; - break; + case PPP_CHAP: + printer(arg, "chap"); + if (p < optend) { + switch (*p) { + case CHAP_MD5: + printer(arg, " MD5"); + ++p; + break; #if MSCHAP_SUPPORT - case CHAP_MICROSOFT: - printer(arg, " MS"); - ++p; - break; - - case CHAP_MICROSOFT_V2: - printer(arg, " MS-v2"); - ++p; - break; + case CHAP_MICROSOFT: + printer(arg, " MS"); + ++p; + break; + + case CHAP_MICROSOFT_V2: + printer(arg, " MS-v2"); + ++p; + break; #endif /* MSCHAP_SUPPORT */ - default: - break; - } - } - break; + default: + break; + } + } + break; #endif /* CHAP_SUPPORT */ #if EAP_SUPPORT - case PPP_EAP: - printer(arg, "eap"); - break; + case PPP_EAP: + printer(arg, "eap"); + break; #endif /* EAP_SUPPORT */ - default: - printer(arg, "0x%x", cishort); - } - } - break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #if LQR_SUPPORT - case CI_QUALITY: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "quality "); - GETSHORT(cishort, p); - switch (cishort) { - case PPP_LQR: - printer(arg, "lqr"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; + case CI_QUALITY: + if (olen >= CILEN_SHORT) { + p += 2; + printer(arg, "quality "); + GETSHORT(cishort, p); + switch (cishort) { + case PPP_LQR: + printer(arg, "lqr"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; #endif /* LQR_SUPPORT */ - case CI_CALLBACK: - if (olen >= CILEN_CHAR) { - p += 2; - printer(arg, "callback "); - GETCHAR(cishort, p); - switch (cishort) { - case CBCP_OPT: - printer(arg, "CBCP"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_MAGICNUMBER: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "magic 0x%x", cilong); - } - break; - case CI_PCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "pcomp"); - } - break; - case CI_ACCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "accomp"); - } - break; - case CI_MRRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mrru %d", cishort); - } - break; - case CI_SSNHF: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "ssnhf"); - } - break; - case CI_EPDISC: + case CI_CALLBACK: + if (olen >= CILEN_CHAR) { + p += 2; + printer(arg, "callback "); + GETCHAR(cishort, p); + switch (cishort) { + case CBCP_OPT: + printer(arg, "CBCP"); + break; + default: + printer(arg, "0x%x", cishort); + } + } + break; + case CI_MAGICNUMBER: + if (olen == CILEN_LONG) { + p += 2; + GETLONG(cilong, p); + printer(arg, "magic 0x%x", cilong); + } + break; + case CI_PCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "pcomp"); + } + break; + case CI_ACCOMPRESSION: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "accomp"); + } + break; + case CI_MRRU: + if (olen == CILEN_SHORT) { + p += 2; + GETSHORT(cishort, p); + printer(arg, "mrru %d", cishort); + } + break; + case CI_SSNHF: + if (olen == CILEN_VOID) { + p += 2; + printer(arg, "ssnhf"); + } + break; + case CI_EPDISC: #ifdef HAVE_MULTILINK - if (olen >= CILEN_CHAR) { - struct epdisc epd; - p += 2; - GETCHAR(epd.class, p); - epd.length = olen - CILEN_CHAR; - if (epd.length > MAX_ENDP_LEN) - epd.length = MAX_ENDP_LEN; - if (epd.length > 0) { - MEMCPY(epd.value, p, epd.length); - p += epd.length; - } - printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); - } + if (olen >= CILEN_CHAR) { + struct epdisc epd; + p += 2; + GETCHAR(epd.class, p); + epd.length = olen - CILEN_CHAR; + if (epd.length > MAX_ENDP_LEN) + epd.length = MAX_ENDP_LEN; + if (epd.length > 0) { + MEMCPY(epd.value, p, epd.length); + p += epd.length; + } + printer(arg, "endpoint [%s]", epdisc_to_str(&epd)); + } #else - printer(arg, "endpoint"); + printer(arg, "endpoint"); #endif - break; - default: - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; + break; + default: + break; + } + while (p < optend) { + GETCHAR(code, p); + printer(arg, " %.2x", code); + } + printer(arg, ">"); + } + break; case TERMACK: case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len > 0 && *p >= ' ' && *p < 0x7f) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; case ECHOREQ: case ECHOREP: case DISCREQ: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + break; case IDENTIF: case TIMEREM: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - len -= 4; - } - if (code == TIMEREM) { - if (len < 4) - break; - GETLONG(cilong, p); - printer(arg, " seconds=%u", cilong); - len -= 4; - } - if (len > 0) { - printer(arg, " "); - ppp_print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; + if (len >= 4) { + GETLONG(cilong, p); + printer(arg, " magic=0x%x", cilong); + len -= 4; + } + if (code == TIMEREM) { + if (len < 4) + break; + GETLONG(cilong, p); + printer(arg, " seconds=%u", cilong); + len -= 4; + } + if (len > 0) { + printer(arg, " "); + ppp_print_string(p, len, printer, arg); + p += len; + len = 0; + } + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (i = 0; i < len && i < 32; ++i) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } if (i < len) { - printer(arg, " ..."); - p += len - i; + printer(arg, " ..."); + p += len - i; } return p - pstart; @@ -2639,10 +2639,10 @@ static int lcp_printpkt(const u_char *p, int plen, static void LcpLinkFailure(fsm *f) { ppp_pcb *pcb = f->pcb; if (f->state == PPP_FSM_OPENED) { - ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); + ppp_info("No response to %d echo-requests", pcb->lcp_echos_pending); ppp_notice("Serial link appears to be disconnected."); - pcb->err_code = PPPERR_PEERDEAD; - lcp_close(pcb, "Peer not responding"); + pcb->err_code = PPPERR_PEERDEAD; + lcp_close(pcb, "Peer not responding"); } } @@ -2655,13 +2655,13 @@ static void LcpEchoCheck(fsm *f) { LcpSendEchoRequest (f); if (f->state != PPP_FSM_OPENED) - return; + return; /* * Start the timer for the next interval. */ if (pcb->lcp_echo_timer_running) - ppp_warn("assertion lcp_echo_timer_running==0 failed"); + ppp_warn("assertion lcp_echo_timer_running==0 failed"); TIMEOUT (LcpEchoTimeout, f, pcb->settings.lcp_echo_interval); pcb->lcp_echo_timer_running = 1; } @@ -2691,14 +2691,14 @@ static void lcp_received_echo_reply(fsm *f, int id, u_char *inp, int len) { /* Check the magic number - don't count replies from ourselves. */ if (len < 4) { - ppp_dbglog("lcp: received short Echo-Reply, length %d", len); - return; + ppp_dbglog("lcp: received short Echo-Reply, length %d", len); + return; } GETLONG(magic_val, inp); if (go->neg_magicnumber - && magic_val == go->magicnumber) { - ppp_warn("appear to have received our own echo-reply!"); - return; + && magic_val == go->magicnumber) { + ppp_warn("appear to have received our own echo-reply!"); + return; } /* Reset the number of outstanding echo frames */ @@ -2722,7 +2722,7 @@ static void LcpSendEchoRequest(fsm *f) { if (pcb->lcp_echos_pending >= pcb->settings.lcp_echo_fails) { LcpLinkFailure(f); pcb->lcp_echos_pending = 0; - } + } } #if PPP_LCP_ADAPTIVE @@ -2731,17 +2731,17 @@ static void LcpSendEchoRequest(fsm *f) { * no traffic was received since the last one. */ if (pcb->settings.lcp_echo_adaptive) { - static unsigned int last_pkts_in = 0; + static unsigned int last_pkts_in = 0; #if PPP_STATS_SUPPORT - update_link_stats(f->unit); - link_stats_valid = 0; + update_link_stats(f->unit); + link_stats_valid = 0; #endif /* PPP_STATS_SUPPORT */ - if (link_stats.pkts_in != last_pkts_in) { - last_pkts_in = link_stats.pkts_in; - return; - } + if (link_stats.pkts_in != last_pkts_in) { + last_pkts_in = link_stats.pkts_in; + return; + } } #endif @@ -2750,10 +2750,10 @@ static void LcpSendEchoRequest(fsm *f) { */ if (f->state == PPP_FSM_OPENED) { lcp_magic = go->magicnumber; - pktp = pkt; - PUTLONG(lcp_magic, pktp); + pktp = pkt; + PUTLONG(lcp_magic, pktp); fsm_sdata(f, ECHOREQ, pcb->lcp_echo_number++, pkt, pktp - pkt); - ++pcb->lcp_echos_pending; + ++pcb->lcp_echos_pending; } } @@ -2768,7 +2768,7 @@ static void lcp_echo_lowerup(ppp_pcb *pcb) { pcb->lcp_echos_pending = 0; pcb->lcp_echo_number = 0; pcb->lcp_echo_timer_running = 0; - + /* If a timeout interval is specified then start the timer */ if (pcb->settings.lcp_echo_interval != 0) LcpEchoCheck (f); diff --git a/components/net/lwip-2.1.2/src/netif/ppp/mppe.c b/components/net/lwip-2.1.2/src/netif/ppp/mppe.c index 6e9ffe674e..4cca89dec1 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/mppe.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/mppe.c @@ -39,20 +39,20 @@ #define SHA1_SIGNATURE_SIZE 20 /* ppp_mppe_state.bits definitions */ -#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ -#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ -#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ -#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ +#define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ +#define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */ +#define MPPE_BIT_C 0x20 /* MPPC only (not implemented) */ +#define MPPE_BIT_D 0x10 /* This is an encrypted frame */ -#define MPPE_BIT_FLUSHED MPPE_BIT_A -#define MPPE_BIT_ENCRYPTED MPPE_BIT_D +#define MPPE_BIT_FLUSHED MPPE_BIT_A +#define MPPE_BIT_ENCRYPTED MPPE_BIT_D #define MPPE_BITS(p) ((p)[0] & 0xf0) #define MPPE_CCOUNT(p) ((((p)[0] & 0x0f) << 8) + (p)[1]) -#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ +#define MPPE_CCOUNT_SPACE 0x1000 /* The size of the ccount space */ -#define MPPE_OVHD 2 /* MPPE overhead/packet */ -#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ +#define MPPE_OVHD 2 /* MPPE overhead/packet */ +#define SANITY_MAX 1600 /* Max bogon factor we will tolerate */ /* * Perform the MPPE rekey algorithm, from RFC 3078, sec. 7.3. @@ -60,37 +60,37 @@ */ static void mppe_rekey(ppp_mppe_state * state, int initial_key) { - lwip_sha1_context sha1_ctx; - u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; - - /* - * Key Derivation, from RFC 3078, RFC 3079. - * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. - */ - lwip_sha1_init(&sha1_ctx); - lwip_sha1_starts(&sha1_ctx); - lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); - lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); - lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); - lwip_sha1_finish(&sha1_ctx, sha1_digest); - lwip_sha1_free(&sha1_ctx); - MEMCPY(state->session_key, sha1_digest, state->keylen); - - if (!initial_key) { - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); - lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); - lwip_arc4_free(&state->arc4); - } - if (state->keylen == 8) { - /* See RFC 3078 */ - state->session_key[0] = 0xd1; - state->session_key[1] = 0x26; - state->session_key[2] = 0x9e; - } - lwip_arc4_init(&state->arc4); - lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); + lwip_sha1_context sha1_ctx; + u8_t sha1_digest[SHA1_SIGNATURE_SIZE]; + + /* + * Key Derivation, from RFC 3078, RFC 3079. + * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. + */ + lwip_sha1_init(&sha1_ctx); + lwip_sha1_starts(&sha1_ctx); + lwip_sha1_update(&sha1_ctx, state->master_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad1, SHA1_PAD_SIZE); + lwip_sha1_update(&sha1_ctx, state->session_key, state->keylen); + lwip_sha1_update(&sha1_ctx, mppe_sha1_pad2, SHA1_PAD_SIZE); + lwip_sha1_finish(&sha1_ctx, sha1_digest); + lwip_sha1_free(&sha1_ctx); + MEMCPY(state->session_key, sha1_digest, state->keylen); + + if (!initial_key) { + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, sha1_digest, state->keylen); + lwip_arc4_crypt(&state->arc4, state->session_key, state->keylen); + lwip_arc4_free(&state->arc4); + } + if (state->keylen == 8) { + /* See RFC 3078 */ + state->session_key[0] = 0xd1; + state->session_key[1] = 0x26; + state->session_key[2] = 0x9e; + } + lwip_arc4_init(&state->arc4); + lwip_arc4_setup(&state->arc4, state->session_key, state->keylen); } /* @@ -98,8 +98,8 @@ static void mppe_rekey(ppp_mppe_state * state, int initial_key) * don't have to keep multiple copies of keys. */ void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key) { - LWIP_UNUSED_ARG(pcb); - MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); + LWIP_UNUSED_ARG(pcb); + MEMCPY(state->master_key, key, MPPE_MAX_KEY_LEN); } /* @@ -109,64 +109,64 @@ void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) { #if PPP_DEBUG - const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; - if (&pcb->mppe_decomp == state) { - debugstr = (const u8_t*)"mppe_decomp_init"; - } + const u8_t *debugstr = (const u8_t*)"mppe_comp_init"; + if (&pcb->mppe_decomp == state) { + debugstr = (const u8_t*)"mppe_decomp_init"; + } #endif /* PPP_DEBUG */ - /* Save keys. */ - MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); - - if (options & MPPE_OPT_128) - state->keylen = 16; - else if (options & MPPE_OPT_40) - state->keylen = 8; - else { - PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, - pcb->netif->num)); - lcp_close(pcb, "MPPE required but peer negotiation failed"); - return; - } - if (options & MPPE_OPT_STATEFUL) - state->stateful = 1; - - /* Generate the initial session key. */ - mppe_rekey(state, 1); + /* Save keys. */ + MEMCPY(state->session_key, state->master_key, sizeof(state->master_key)); + + if (options & MPPE_OPT_128) + state->keylen = 16; + else if (options & MPPE_OPT_40) + state->keylen = 8; + else { + PPPDEBUG(LOG_DEBUG, ("%s[%d]: unknown key length\n", debugstr, + pcb->netif->num)); + lcp_close(pcb, "MPPE required but peer negotiation failed"); + return; + } + if (options & MPPE_OPT_STATEFUL) + state->stateful = 1; + + /* Generate the initial session key. */ + mppe_rekey(state, 1); #if PPP_DEBUG - { - int i; - char mkey[sizeof(state->master_key) * 2 + 1]; - char skey[sizeof(state->session_key) * 2 + 1]; - - PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", - debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, - (state->stateful) ? "stateful" : "stateless")); - - for (i = 0; i < (int)sizeof(state->master_key); i++) - sprintf(mkey + i * 2, "%02x", state->master_key[i]); - for (i = 0; i < (int)sizeof(state->session_key); i++) - sprintf(skey + i * 2, "%02x", state->session_key[i]); - PPPDEBUG(LOG_DEBUG, - ("%s[%d]: keys: master: %s initial session: %s\n", - debugstr, pcb->netif->num, mkey, skey)); - } + { + int i; + char mkey[sizeof(state->master_key) * 2 + 1]; + char skey[sizeof(state->session_key) * 2 + 1]; + + PPPDEBUG(LOG_DEBUG, ("%s[%d]: initialized with %d-bit %s mode\n", + debugstr, pcb->netif->num, (state->keylen == 16) ? 128 : 40, + (state->stateful) ? "stateful" : "stateless")); + + for (i = 0; i < (int)sizeof(state->master_key); i++) + sprintf(mkey + i * 2, "%02x", state->master_key[i]); + for (i = 0; i < (int)sizeof(state->session_key); i++) + sprintf(skey + i * 2, "%02x", state->session_key[i]); + PPPDEBUG(LOG_DEBUG, + ("%s[%d]: keys: master: %s initial session: %s\n", + debugstr, pcb->netif->num, mkey, skey)); + } #endif /* PPP_DEBUG */ - /* - * Initialize the coherency count. The initial value is not specified - * in RFC 3078, but we can make a reasonable assumption that it will - * start at 0. Setting it to the max here makes the comp/decomp code - * do the right thing (determined through experiment). - */ - state->ccount = MPPE_CCOUNT_SPACE - 1; - - /* - * Note that even though we have initialized the key table, we don't - * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. - */ - state->bits = MPPE_BIT_ENCRYPTED; + /* + * Initialize the coherency count. The initial value is not specified + * in RFC 3078, but we can make a reasonable assumption that it will + * start at 0. Setting it to the max here makes the comp/decomp code + * do the right thing (determined through experiment). + */ + state->ccount = MPPE_CCOUNT_SPACE - 1; + + /* + * Note that even though we have initialized the key table, we don't + * set the FLUSHED bit. This is contrary to RFC 3078, sec. 3.1. + */ + state->bits = MPPE_BIT_ENCRYPTED; } /* @@ -180,8 +180,8 @@ mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options) */ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - state->bits |= MPPE_BIT_FLUSHED; + LWIP_UNUSED_ARG(pcb); + state->bits |= MPPE_BIT_FLUSHED; } /* @@ -192,74 +192,74 @@ void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol) { - struct pbuf *n, *np; - u8_t *pl; - err_t err; - - LWIP_UNUSED_ARG(pcb); - - /* TCP stack requires that we don't change the packet payload, therefore we copy - * the whole packet before encryption. - */ - np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_RAM); - if (!np) { - return ERR_MEM; - } - - /* Hide MPPE header + protocol */ - pbuf_remove_header(np, MPPE_OVHD + sizeof(protocol)); - - if ((err = pbuf_copy(np, *pb)) != ERR_OK) { - pbuf_free(np); - return err; - } - - /* Reveal MPPE header + protocol */ - pbuf_add_header(np, MPPE_OVHD + sizeof(protocol)); - - *pb = np; - pl = (u8_t*)np->payload; - - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); - /* FIXME: use PUT* macros */ - pl[0] = state->ccount>>8; - pl[1] = state->ccount; - - if (!state->stateful || /* stateless mode */ - ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ - (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ - /* We must rekey */ - if (state->stateful) { - PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); - } - mppe_rekey(state, 0); - state->bits |= MPPE_BIT_FLUSHED; - } - pl[0] |= state->bits; - state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ - pl += MPPE_OVHD; - - /* Add protocol */ - /* FIXME: add PFC support */ - pl[0] = protocol >> 8; - pl[1] = protocol; - - /* Hide MPPE header */ - pbuf_remove_header(np, MPPE_OVHD); - - /* Encrypt packet */ - for (n = np; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* Reveal MPPE header */ - pbuf_add_header(np, MPPE_OVHD); - - return ERR_OK; + struct pbuf *n, *np; + u8_t *pl; + err_t err; + + LWIP_UNUSED_ARG(pcb); + + /* TCP stack requires that we don't change the packet payload, therefore we copy + * the whole packet before encryption. + */ + np = pbuf_alloc(PBUF_RAW, MPPE_OVHD + sizeof(protocol) + (*pb)->tot_len, PBUF_RAM); + if (!np) { + return ERR_MEM; + } + + /* Hide MPPE header + protocol */ + pbuf_remove_header(np, MPPE_OVHD + sizeof(protocol)); + + if ((err = pbuf_copy(np, *pb)) != ERR_OK) { + pbuf_free(np); + return err; + } + + /* Reveal MPPE header + protocol */ + pbuf_add_header(np, MPPE_OVHD + sizeof(protocol)); + + *pb = np; + pl = (u8_t*)np->payload; + + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: ccount %d\n", pcb->netif->num, state->ccount)); + /* FIXME: use PUT* macros */ + pl[0] = state->ccount>>8; + pl[1] = state->ccount; + + if (!state->stateful || /* stateless mode */ + ((state->ccount & 0xff) == 0xff) || /* "flag" packet */ + (state->bits & MPPE_BIT_FLUSHED)) { /* CCP Reset-Request */ + /* We must rekey */ + if (state->stateful) { + PPPDEBUG(LOG_DEBUG, ("mppe_compress[%d]: rekeying\n", pcb->netif->num)); + } + mppe_rekey(state, 0); + state->bits |= MPPE_BIT_FLUSHED; + } + pl[0] |= state->bits; + state->bits &= ~MPPE_BIT_FLUSHED; /* reset for next xmit */ + pl += MPPE_OVHD; + + /* Add protocol */ + /* FIXME: add PFC support */ + pl[0] = protocol >> 8; + pl[1] = protocol; + + /* Hide MPPE header */ + pbuf_remove_header(np, MPPE_OVHD); + + /* Encrypt packet */ + for (n = np; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* Reveal MPPE header */ + pbuf_add_header(np, MPPE_OVHD); + + return ERR_OK; } /* @@ -267,9 +267,9 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto */ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) { - LWIP_UNUSED_ARG(pcb); - LWIP_UNUSED_ARG(state); - return; + LWIP_UNUSED_ARG(pcb); + LWIP_UNUSED_ARG(state); + return; } /* @@ -278,135 +278,135 @@ void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state) err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb) { - struct pbuf *n0 = *pb, *n; - u8_t *pl; - u16_t ccount; - u8_t flushed; - - /* MPPE Header */ - if (n0->len < MPPE_OVHD) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: short pkt (%d)\n", - pcb->netif->num, n0->len)); - state->sanity_errors += 100; - goto sanity_error; - } - - pl = (u8_t*)n0->payload; - flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; - ccount = MPPE_CCOUNT(pl); - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", - pcb->netif->num, ccount)); - - /* sanity checks -- terminate with extreme prejudice */ - if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { - PPPDEBUG(LOG_DEBUG, - ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", - pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (!state->stateful && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " - "stateless mode!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { - PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " - "flag packet!\n", pcb->netif->num)); - state->sanity_errors += 100; - goto sanity_error; - } - - /* - * Check the coherency count. - */ - - if (!state->stateful) { - /* Discard late packet */ - if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { - state->sanity_errors++; - goto sanity_error; - } - - /* RFC 3078, sec 8.1. Rekey for every packet. */ - while (state->ccount != ccount) { - mppe_rekey(state, 0); - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - } - } else { - /* RFC 3078, sec 8.2. */ - if (!state->discard) { - /* normal state */ - state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; - if (ccount != state->ccount) { - /* - * (ccount > state->ccount) - * Packet loss detected, enter the discard state. - * Signal the peer to rekey (by sending a CCP Reset-Request). - */ - state->discard = 1; - ccp_resetrequest(pcb); - return ERR_BUF; - } - } else { - /* discard state */ - if (!flushed) { - /* ccp.c will be silent (no additional CCP Reset-Requests). */ - return ERR_BUF; - } else { - /* Rekey for every missed "flag" packet. */ - while ((ccount & ~0xff) != - (state->ccount & ~0xff)) { - mppe_rekey(state, 0); - state->ccount = - (state->ccount + - 256) % MPPE_CCOUNT_SPACE; - } - - /* reset */ - state->discard = 0; - state->ccount = ccount; - /* - * Another problem with RFC 3078 here. It implies that the - * peer need not send a Reset-Ack packet. But RFC 1962 - * requires it. Hopefully, M$ does send a Reset-Ack; even - * though it isn't required for MPPE synchronization, it is - * required to reset CCP state. - */ - } - } - if (flushed) - mppe_rekey(state, 0); - } - - /* Hide MPPE header */ - pbuf_remove_header(n0, MPPE_OVHD); - - /* Decrypt the packet. */ - for (n = n0; n != NULL; n = n->next) { - lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); - if (n->tot_len == n->len) { - break; - } - } - - /* good packet credit */ - state->sanity_errors >>= 1; - - return ERR_OK; + struct pbuf *n0 = *pb, *n; + u8_t *pl; + u16_t ccount; + u8_t flushed; + + /* MPPE Header */ + if (n0->len < MPPE_OVHD) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: short pkt (%d)\n", + pcb->netif->num, n0->len)); + state->sanity_errors += 100; + goto sanity_error; + } + + pl = (u8_t*)n0->payload; + flushed = MPPE_BITS(pl) & MPPE_BIT_FLUSHED; + ccount = MPPE_CCOUNT(pl); + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: ccount %d\n", + pcb->netif->num, ccount)); + + /* sanity checks -- terminate with extreme prejudice */ + if (!(MPPE_BITS(pl) & MPPE_BIT_ENCRYPTED)) { + PPPDEBUG(LOG_DEBUG, + ("mppe_decompress[%d]: ENCRYPTED bit not set!\n", + pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (!state->stateful && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set in " + "stateless mode!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + if (state->stateful && ((ccount & 0xff) == 0xff) && !flushed) { + PPPDEBUG(LOG_DEBUG, ("mppe_decompress[%d]: FLUSHED bit not set on " + "flag packet!\n", pcb->netif->num)); + state->sanity_errors += 100; + goto sanity_error; + } + + /* + * Check the coherency count. + */ + + if (!state->stateful) { + /* Discard late packet */ + if ((ccount - state->ccount) % MPPE_CCOUNT_SPACE > MPPE_CCOUNT_SPACE / 2) { + state->sanity_errors++; + goto sanity_error; + } + + /* RFC 3078, sec 8.1. Rekey for every packet. */ + while (state->ccount != ccount) { + mppe_rekey(state, 0); + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + } + } else { + /* RFC 3078, sec 8.2. */ + if (!state->discard) { + /* normal state */ + state->ccount = (state->ccount + 1) % MPPE_CCOUNT_SPACE; + if (ccount != state->ccount) { + /* + * (ccount > state->ccount) + * Packet loss detected, enter the discard state. + * Signal the peer to rekey (by sending a CCP Reset-Request). + */ + state->discard = 1; + ccp_resetrequest(pcb); + return ERR_BUF; + } + } else { + /* discard state */ + if (!flushed) { + /* ccp.c will be silent (no additional CCP Reset-Requests). */ + return ERR_BUF; + } else { + /* Rekey for every missed "flag" packet. */ + while ((ccount & ~0xff) != + (state->ccount & ~0xff)) { + mppe_rekey(state, 0); + state->ccount = + (state->ccount + + 256) % MPPE_CCOUNT_SPACE; + } + + /* reset */ + state->discard = 0; + state->ccount = ccount; + /* + * Another problem with RFC 3078 here. It implies that the + * peer need not send a Reset-Ack packet. But RFC 1962 + * requires it. Hopefully, M$ does send a Reset-Ack; even + * though it isn't required for MPPE synchronization, it is + * required to reset CCP state. + */ + } + } + if (flushed) + mppe_rekey(state, 0); + } + + /* Hide MPPE header */ + pbuf_remove_header(n0, MPPE_OVHD); + + /* Decrypt the packet. */ + for (n = n0; n != NULL; n = n->next) { + lwip_arc4_crypt(&state->arc4, (u8_t*)n->payload, n->len); + if (n->tot_len == n->len) { + break; + } + } + + /* good packet credit */ + state->sanity_errors >>= 1; + + return ERR_OK; sanity_error: - if (state->sanity_errors >= SANITY_MAX) { - /* - * Take LCP down if the peer is sending too many bogons. - * We don't want to do this for a single or just a few - * instances since it could just be due to packet corruption. - */ - lcp_close(pcb, "Too many MPPE errors"); - } - return ERR_BUF; + if (state->sanity_errors >= SANITY_MAX) { + /* + * Take LCP down if the peer is sending too many bogons. + * We don't want to do this for a single or just a few + * instances since it could just be due to packet corruption. + */ + lcp_close(pcb, "Too many MPPE errors"); + } + return ERR_BUF; } #endif /* PPP_SUPPORT && MPPE_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/multilink.c b/components/net/lwip-2.1.2/src/netif/ppp/multilink.c index 08e8130d48..62014e8c87 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/multilink.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/multilink.c @@ -55,11 +55,11 @@ #include "netif/ppp/lcp.h" #include "netif/ppp/tdb.h" -bool endpoint_specified; /* user gave explicit endpoint discriminator */ -char *bundle_id; /* identifier for our bundle */ -char *blinks_id; /* key for the list of links */ -bool doing_multilink; /* multilink was enabled and agreed to */ -bool multilink_master; /* we own the multilink bundle */ +bool endpoint_specified; /* user gave explicit endpoint discriminator */ +char *bundle_id; /* identifier for our bundle */ +char *blinks_id; /* key for the list of links */ +bool doing_multilink; /* multilink was enabled and agreed to */ +bool multilink_master; /* we own the multilink bundle */ extern TDB_CONTEXT *pppdb; extern char db_key[]; @@ -72,43 +72,43 @@ static int get_default_epdisc (struct epdisc *); static int parse_num (char *str, const char *key, int *valp); static int owns_unit (TDB_DATA pid, int unit); -#define set_ip_epdisc(ep, addr) do { \ - ep->length = 4; \ - ep->value[0] = addr >> 24; \ - ep->value[1] = addr >> 16; \ - ep->value[2] = addr >> 8; \ - ep->value[3] = addr; \ +#define set_ip_epdisc(ep, addr) do { \ + ep->length = 4; \ + ep->value[0] = addr >> 24; \ + ep->value[1] = addr >> 16; \ + ep->value[2] = addr >> 8; \ + ep->value[3] = addr; \ } while (0) -#define LOCAL_IP_ADDR(addr) \ - (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ - || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ - || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ +#define LOCAL_IP_ADDR(addr) \ + (((addr) & 0xff000000) == 0x0a000000 /* 10.x.x.x */ \ + || ((addr) & 0xfff00000) == 0xac100000 /* 172.16.x.x */ \ + || ((addr) & 0xffff0000) == 0xc0a80000) /* 192.168.x.x */ -#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) +#define process_exists(n) (kill((n), 0) == 0 || errno != ESRCH) void mp_check_options() { - lcp_options *wo = &lcp_wantoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - - doing_multilink = 0; - if (!multilink) - return; - /* if we're doing multilink, we have to negotiate MRRU */ - if (!wo->neg_mrru) { - /* mrru not specified, default to mru */ - wo->mrru = wo->mru; - wo->neg_mrru = 1; - } - ao->mrru = ao->mru; - ao->neg_mrru = 1; - - if (!wo->neg_endpoint && !noendpoint) { - /* get a default endpoint value */ - wo->neg_endpoint = get_default_epdisc(&wo->endpoint); - } + lcp_options *wo = &lcp_wantoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + + doing_multilink = 0; + if (!multilink) + return; + /* if we're doing multilink, we have to negotiate MRRU */ + if (!wo->neg_mrru) { + /* mrru not specified, default to mru */ + wo->mrru = wo->mru; + wo->neg_mrru = 1; + } + ao->mrru = ao->mru; + ao->neg_mrru = 1; + + if (!wo->neg_endpoint && !noendpoint) { + /* get a default endpoint value */ + wo->neg_endpoint = get_default_epdisc(&wo->endpoint); + } } /* @@ -118,289 +118,289 @@ mp_check_options() int mp_join_bundle() { - lcp_options *go = &lcp_gotoptions[0]; - lcp_options *ho = &lcp_hisoptions[0]; - lcp_options *ao = &lcp_allowoptions[0]; - int unit, pppd_pid; - int l, mtu; - char *p; - TDB_DATA key, pid, rec; - - if (doing_multilink) { - /* have previously joined a bundle */ - if (!go->neg_mrru || !ho->neg_mrru) { - notice("oops, didn't get multilink on renegotiation"); - lcp_close(pcb, "multilink required"); - return 0; - } - /* XXX should check the peer_authname and ho->endpoint - are the same as previously */ - return 0; - } - - if (!go->neg_mrru || !ho->neg_mrru) { - /* not doing multilink */ - if (go->neg_mrru) - notice("oops, multilink negotiated only for receive"); - mtu = ho->neg_mru? ho->mru: PPP_MRU; - if (mtu > ao->mru) - mtu = ao->mru; - if (demand) { - /* already have a bundle */ - cfg_bundle(0, 0, 0, 0); - netif_set_mtu(pcb, mtu); - return 0; - } - make_new_bundle(0, 0, 0, 0); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - return 0; - } - - doing_multilink = 1; - - /* - * Find the appropriate bundle or join a new one. - * First we make up a name for the bundle. - * The length estimate is worst-case assuming every - * character has to be quoted. - */ - l = 4 * strlen(peer_authname) + 10; - if (ho->neg_endpoint) - l += 3 * ho->endpoint.length + 8; - if (bundle_name) - l += 3 * strlen(bundle_name) + 2; - bundle_id = malloc(l); - if (bundle_id == 0) - novm("bundle identifier"); - - p = bundle_id; - p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); - if (ho->neg_endpoint || bundle_name) - *p++ = '/'; - if (ho->neg_endpoint) - p += slprintf(p, bundle_id+l-p, "%s", - epdisc_to_str(&ho->endpoint)); - if (bundle_name) - p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); - - /* Make the key for the list of links belonging to the bundle */ - l = p - bundle_id; - blinks_id = malloc(l + 7); - if (blinks_id == NULL) - novm("bundle links key"); - slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); - - /* - * For demand mode, we only need to configure the bundle - * and attach the link. - */ - mtu = LWIP_MIN(ho->mrru, ao->mru); - if (demand) { - cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - return 0; - } - - /* - * Check if the bundle ID is already in the database. - */ - unit = -1; - lock_db(); - key.dptr = bundle_id; - key.dsize = p - bundle_id; - pid = tdb_fetch(pppdb, key); - if (pid.dptr != NULL) { - /* bundle ID exists, see if the pppd record exists */ - rec = tdb_fetch(pppdb, pid); - if (rec.dptr != NULL && rec.dsize > 0) { - /* make sure the string is null-terminated */ - rec.dptr[rec.dsize-1] = 0; - /* parse the interface number */ - parse_num(rec.dptr, "IFNAME=ppp", &unit); - /* check the pid value */ - if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) - || !process_exists(pppd_pid) - || !owns_unit(pid, unit)) - unit = -1; - free(rec.dptr); - } - free(pid.dptr); - } - - if (unit >= 0) { - /* attach to existing unit */ - if (bundle_attach(unit)) { - set_ifunit(0); - script_setenv("BUNDLE", bundle_id + 7, 0); - make_bundle_links(1); - unlock_db(); - info("Link attached to %s", ifname); - return 1; - } - /* attach failed because bundle doesn't exist */ - } - - /* we have to make a new bundle */ - make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - set_ifunit(1); - netif_set_mtu(pcb, mtu); - script_setenv("BUNDLE", bundle_id + 7, 1); - make_bundle_links(pcb); - unlock_db(); - info("New bundle %s created", ifname); - multilink_master = 1; - return 0; + lcp_options *go = &lcp_gotoptions[0]; + lcp_options *ho = &lcp_hisoptions[0]; + lcp_options *ao = &lcp_allowoptions[0]; + int unit, pppd_pid; + int l, mtu; + char *p; + TDB_DATA key, pid, rec; + + if (doing_multilink) { + /* have previously joined a bundle */ + if (!go->neg_mrru || !ho->neg_mrru) { + notice("oops, didn't get multilink on renegotiation"); + lcp_close(pcb, "multilink required"); + return 0; + } + /* XXX should check the peer_authname and ho->endpoint + are the same as previously */ + return 0; + } + + if (!go->neg_mrru || !ho->neg_mrru) { + /* not doing multilink */ + if (go->neg_mrru) + notice("oops, multilink negotiated only for receive"); + mtu = ho->neg_mru? ho->mru: PPP_MRU; + if (mtu > ao->mru) + mtu = ao->mru; + if (demand) { + /* already have a bundle */ + cfg_bundle(0, 0, 0, 0); + netif_set_mtu(pcb, mtu); + return 0; + } + make_new_bundle(0, 0, 0, 0); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + return 0; + } + + doing_multilink = 1; + + /* + * Find the appropriate bundle or join a new one. + * First we make up a name for the bundle. + * The length estimate is worst-case assuming every + * character has to be quoted. + */ + l = 4 * strlen(peer_authname) + 10; + if (ho->neg_endpoint) + l += 3 * ho->endpoint.length + 8; + if (bundle_name) + l += 3 * strlen(bundle_name) + 2; + bundle_id = malloc(l); + if (bundle_id == 0) + novm("bundle identifier"); + + p = bundle_id; + p += slprintf(p, l-1, "BUNDLE=\"%q\"", peer_authname); + if (ho->neg_endpoint || bundle_name) + *p++ = '/'; + if (ho->neg_endpoint) + p += slprintf(p, bundle_id+l-p, "%s", + epdisc_to_str(&ho->endpoint)); + if (bundle_name) + p += slprintf(p, bundle_id+l-p, "/%v", bundle_name); + + /* Make the key for the list of links belonging to the bundle */ + l = p - bundle_id; + blinks_id = malloc(l + 7); + if (blinks_id == NULL) + novm("bundle links key"); + slprintf(blinks_id, l + 7, "BUNDLE_LINKS=%s", bundle_id + 7); + + /* + * For demand mode, we only need to configure the bundle + * and attach the link. + */ + mtu = LWIP_MIN(ho->mrru, ao->mru); + if (demand) { + cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + return 0; + } + + /* + * Check if the bundle ID is already in the database. + */ + unit = -1; + lock_db(); + key.dptr = bundle_id; + key.dsize = p - bundle_id; + pid = tdb_fetch(pppdb, key); + if (pid.dptr != NULL) { + /* bundle ID exists, see if the pppd record exists */ + rec = tdb_fetch(pppdb, pid); + if (rec.dptr != NULL && rec.dsize > 0) { + /* make sure the string is null-terminated */ + rec.dptr[rec.dsize-1] = 0; + /* parse the interface number */ + parse_num(rec.dptr, "IFNAME=ppp", &unit); + /* check the pid value */ + if (!parse_num(rec.dptr, "PPPD_PID=", &pppd_pid) + || !process_exists(pppd_pid) + || !owns_unit(pid, unit)) + unit = -1; + free(rec.dptr); + } + free(pid.dptr); + } + + if (unit >= 0) { + /* attach to existing unit */ + if (bundle_attach(unit)) { + set_ifunit(0); + script_setenv("BUNDLE", bundle_id + 7, 0); + make_bundle_links(1); + unlock_db(); + info("Link attached to %s", ifname); + return 1; + } + /* attach failed because bundle doesn't exist */ + } + + /* we have to make a new bundle */ + make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); + set_ifunit(1); + netif_set_mtu(pcb, mtu); + script_setenv("BUNDLE", bundle_id + 7, 1); + make_bundle_links(pcb); + unlock_db(); + info("New bundle %s created", ifname); + multilink_master = 1; + return 0; } void mp_exit_bundle() { - lock_db(); - remove_bundle_link(); - unlock_db(); + lock_db(); + remove_bundle_link(); + unlock_db(); } static void sendhup(char *str) { - int pid; + int pid; - if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { - if (debug) - dbglog("sending SIGHUP to process %d", pid); - kill(pid, SIGHUP); - } + if (parse_num(str, "PPPD_PID=", &pid) && pid != getpid()) { + if (debug) + dbglog("sending SIGHUP to process %d", pid); + kill(pid, SIGHUP); + } } void mp_bundle_terminated() { - TDB_DATA key; + TDB_DATA key; - bundle_terminating = 1; - upper_layers_down(pcb); - notice("Connection terminated."); + bundle_terminating = 1; + upper_layers_down(pcb); + notice("Connection terminated."); #if PPP_STATS_SUPPORT - print_link_stats(); + print_link_stats(); #endif /* PPP_STATS_SUPPORT */ - if (!demand) { - remove_pidfiles(); - script_unsetenv("IFNAME"); - } - - lock_db(); - destroy_bundle(); - iterate_bundle_links(sendhup); - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - tdb_delete(pppdb, key); - unlock_db(); - - new_phase(PPP_PHASE_DEAD); - - doing_multilink = 0; - multilink_master = 0; + if (!demand) { + remove_pidfiles(); + script_unsetenv("IFNAME"); + } + + lock_db(); + destroy_bundle(); + iterate_bundle_links(sendhup); + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + tdb_delete(pppdb, key); + unlock_db(); + + new_phase(PPP_PHASE_DEAD); + + doing_multilink = 0; + multilink_master = 0; } static void make_bundle_links(int append) { - TDB_DATA key, rec; - char *p; - char entry[32]; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - p = entry; - if (append) { - rec = tdb_fetch(pppdb, key); - if (rec.dptr != NULL && rec.dsize > 0) { - rec.dptr[rec.dsize-1] = 0; - if (strstr(rec.dptr, db_key) != NULL) { - /* already in there? strange */ - warn("link entry already exists in tdb"); - return; - } - l = rec.dsize + strlen(entry); - p = malloc(l); - if (p == NULL) - novm("bundle link list"); - slprintf(p, l, "%s%s", rec.dptr, entry); - } else { - warn("bundle link list not found"); - } - if (rec.dptr != NULL) - free(rec.dptr); - } - rec.dptr = p; - rec.dsize = strlen(p) + 1; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't %s bundle link list", - append? "update": "create"); - if (p != entry) - free(p); + TDB_DATA key, rec; + char *p; + char entry[32]; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + p = entry; + if (append) { + rec = tdb_fetch(pppdb, key); + if (rec.dptr != NULL && rec.dsize > 0) { + rec.dptr[rec.dsize-1] = 0; + if (strstr(rec.dptr, db_key) != NULL) { + /* already in there? strange */ + warn("link entry already exists in tdb"); + return; + } + l = rec.dsize + strlen(entry); + p = malloc(l); + if (p == NULL) + novm("bundle link list"); + slprintf(p, l, "%s%s", rec.dptr, entry); + } else { + warn("bundle link list not found"); + } + if (rec.dptr != NULL) + free(rec.dptr); + } + rec.dptr = p; + rec.dsize = strlen(p) + 1; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't %s bundle link list", + append? "update": "create"); + if (p != entry) + free(p); } static void remove_bundle_link() { - TDB_DATA key, rec; - char entry[32]; - char *p, *q; - int l; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - slprintf(entry, sizeof(entry), "%s;", db_key); - - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - rec.dptr[rec.dsize-1] = 0; - p = strstr(rec.dptr, entry); - if (p != NULL) { - q = p + strlen(entry); - l = strlen(q) + 1; - memmove(p, q, l); - rec.dsize = p - rec.dptr + l; - if (tdb_store(pppdb, key, rec, TDB_REPLACE)) - error("couldn't update bundle link list (removal)"); - } - free(rec.dptr); + TDB_DATA key, rec; + char entry[32]; + char *p, *q; + int l; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + slprintf(entry, sizeof(entry), "%s;", db_key); + + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + rec.dptr[rec.dsize-1] = 0; + p = strstr(rec.dptr, entry); + if (p != NULL) { + q = p + strlen(entry); + l = strlen(q) + 1; + memmove(p, q, l); + rec.dsize = p - rec.dptr + l; + if (tdb_store(pppdb, key, rec, TDB_REPLACE)) + error("couldn't update bundle link list (removal)"); + } + free(rec.dptr); } static void iterate_bundle_links(void (*func)(char *)) { - TDB_DATA key, rec, pp; - char *p, *q; - - key.dptr = blinks_id; - key.dsize = strlen(blinks_id); - rec = tdb_fetch(pppdb, key); - if (rec.dptr == NULL || rec.dsize <= 0) { - error("bundle link list not found (iterating list)"); - if (rec.dptr != NULL) - free(rec.dptr); - return; - } - p = rec.dptr; - p[rec.dsize-1] = 0; - while ((q = strchr(p, ';')) != NULL) { - *q = 0; - key.dptr = p; - key.dsize = q - p; - pp = tdb_fetch(pppdb, key); - if (pp.dptr != NULL && pp.dsize > 0) { - pp.dptr[pp.dsize-1] = 0; - func(pp.dptr); - } - if (pp.dptr != NULL) - free(pp.dptr); - p = q + 1; - } - free(rec.dptr); + TDB_DATA key, rec, pp; + char *p, *q; + + key.dptr = blinks_id; + key.dsize = strlen(blinks_id); + rec = tdb_fetch(pppdb, key); + if (rec.dptr == NULL || rec.dsize <= 0) { + error("bundle link list not found (iterating list)"); + if (rec.dptr != NULL) + free(rec.dptr); + return; + } + p = rec.dptr; + p[rec.dsize-1] = 0; + while ((q = strchr(p, ';')) != NULL) { + *q = 0; + key.dptr = p; + key.dsize = q - p; + pp = tdb_fetch(pppdb, key); + if (pp.dptr != NULL && pp.dsize > 0) { + pp.dptr[pp.dsize-1] = 0; + func(pp.dptr); + } + if (pp.dptr != NULL) + free(pp.dptr); + p = q + 1; + } + free(rec.dptr); } static int @@ -409,19 +409,19 @@ parse_num(str, key, valp) const char *key; int *valp; { - char *p, *endp; - int i; - - p = strstr(str, key); - if (p != 0) { - p += strlen(key); - i = strtol(p, &endp, 10); - if (endp != p && (*endp == 0 || *endp == ';')) { - *valp = i; - return 1; - } - } - return 0; + char *p, *endp; + int i; + + p = strstr(str, key); + if (p != 0) { + p += strlen(key); + i = strtol(p, &endp, 10); + if (endp != p && (*endp == 0 || *endp == ';')) { + *valp = i; + return 1; + } + } + return 0; } /* @@ -432,53 +432,53 @@ owns_unit(key, unit) TDB_DATA key; int unit; { - char ifkey[32]; - TDB_DATA kd, vd; - int ret = 0; - - slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); - kd.dptr = ifkey; - kd.dsize = strlen(ifkey); - vd = tdb_fetch(pppdb, kd); - if (vd.dptr != NULL) { - ret = vd.dsize == key.dsize - && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; - free(vd.dptr); - } - return ret; + char ifkey[32]; + TDB_DATA kd, vd; + int ret = 0; + + slprintf(ifkey, sizeof(ifkey), "IFNAME=ppp%d", unit); + kd.dptr = ifkey; + kd.dsize = strlen(ifkey); + vd = tdb_fetch(pppdb, kd); + if (vd.dptr != NULL) { + ret = vd.dsize == key.dsize + && memcmp(vd.dptr, key.dptr, vd.dsize) == 0; + free(vd.dptr); + } + return ret; } static int get_default_epdisc(ep) struct epdisc *ep; { - char *p; - struct hostent *hp; - u32_t addr; - - /* First try for an ethernet MAC address */ - p = get_first_ethernet(); - if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { - ep->class = EPD_MAC; - ep->length = 6; - return 1; - } - - /* see if our hostname corresponds to a reasonable IP address */ - hp = gethostbyname(hostname); - if (hp != NULL) { - addr = *(u32_t *)hp->h_addr; - if (!bad_ip_adrs(addr)) { - addr = lwip_ntohl(addr); - if (!LOCAL_IP_ADDR(addr)) { - ep->class = EPD_IP; - set_ip_epdisc(ep, addr); - return 1; - } - } - } - - return 0; + char *p; + struct hostent *hp; + u32_t addr; + + /* First try for an ethernet MAC address */ + p = get_first_ethernet(); + if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) { + ep->class = EPD_MAC; + ep->length = 6; + return 1; + } + + /* see if our hostname corresponds to a reasonable IP address */ + hp = gethostbyname(hostname); + if (hp != NULL) { + addr = *(u32_t *)hp->h_addr; + if (!bad_ip_adrs(addr)) { + addr = lwip_ntohl(addr); + if (!LOCAL_IP_ADDR(addr)) { + ep->class = EPD_IP; + set_ip_epdisc(ep, addr); + return 1; + } + } + } + + return 0; } /* @@ -493,51 +493,51 @@ char * epdisc_to_str(ep) struct epdisc *ep; { - static char str[MAX_ENDP_LEN*3+8]; - u_char *p = ep->value; - int i, mask = 0; - char *q, c, c2; - - if (ep->class == EPD_NULL && ep->length == 0) - return "null"; - if (ep->class == EPD_IP && ep->length == 4) { - u32_t addr; - - GETLONG(addr, p); - slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); - return str; - } - - c = ':'; - c2 = '.'; - if (ep->class == EPD_MAC && ep->length == 6) - c2 = ':'; - else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) - mask = 3; - q = str; - if (ep->class <= EPD_PHONENUM) - q += slprintf(q, sizeof(str)-1, "%s", - endp_class_names[ep->class]); - else - q += slprintf(q, sizeof(str)-1, "%d", ep->class); - c = ':'; - for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { - if ((i & mask) == 0) { - *q++ = c; - c = c2; - } - q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); - } - return str; + static char str[MAX_ENDP_LEN*3+8]; + u_char *p = ep->value; + int i, mask = 0; + char *q, c, c2; + + if (ep->class == EPD_NULL && ep->length == 0) + return "null"; + if (ep->class == EPD_IP && ep->length == 4) { + u32_t addr; + + GETLONG(addr, p); + slprintf(str, sizeof(str), "IP:%I", lwip_htonl(addr)); + return str; + } + + c = ':'; + c2 = '.'; + if (ep->class == EPD_MAC && ep->length == 6) + c2 = ':'; + else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0) + mask = 3; + q = str; + if (ep->class <= EPD_PHONENUM) + q += slprintf(q, sizeof(str)-1, "%s", + endp_class_names[ep->class]); + else + q += slprintf(q, sizeof(str)-1, "%d", ep->class); + c = ':'; + for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) { + if ((i & mask) == 0) { + *q++ = c; + c = c2; + } + q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]); + } + return str; } static int hexc_val(int c) { - if (c >= 'a') - return c - 'a' + 10; - if (c >= 'A') - return c - 'A' + 10; - return c - '0'; + if (c >= 'a') + return c - 'a' + 10; + if (c >= 'A') + return c - 'A' + 10; + return c - '0'; } int @@ -545,65 +545,65 @@ str_to_epdisc(ep, str) struct epdisc *ep; char *str; { - int i, l; - char *p, *endp; - - for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { - int sl = strlen(endp_class_names[i]); - if (strncasecmp(str, endp_class_names[i], sl) == 0) { - str += sl; - break; - } - } - if (i > EPD_PHONENUM) { - /* not a class name, try a decimal class number */ - i = strtol(str, &endp, 10); - if (endp == str) - return 0; /* can't parse class number */ - str = endp; - } - ep->class = i; - if (*str == 0) { - ep->length = 0; - return 1; - } - if (*str != ':' && *str != '.') - return 0; - ++str; - - if (i == EPD_IP) { - u32_t addr; - i = parse_dotted_ip(str, &addr); - if (i == 0 || str[i] != 0) - return 0; - set_ip_epdisc(ep, addr); - return 1; - } - if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { - ep->length = 6; - return 1; - } - - p = str; - for (l = 0; l < MAX_ENDP_LEN; ++l) { - if (*str == 0) - break; - if (p <= str) - for (p = str; isxdigit(*p); ++p) - ; - i = p - str; - if (i == 0) - return 0; - ep->value[l] = hexc_val(*str++); - if ((i & 1) == 0) - ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); - if (*str == ':' || *str == '.') - ++str; - } - if (*str != 0 || (ep->class == EPD_MAC && l != 6)) - return 0; - ep->length = l; - return 1; + int i, l; + char *p, *endp; + + for (i = EPD_NULL; i <= EPD_PHONENUM; ++i) { + int sl = strlen(endp_class_names[i]); + if (strncasecmp(str, endp_class_names[i], sl) == 0) { + str += sl; + break; + } + } + if (i > EPD_PHONENUM) { + /* not a class name, try a decimal class number */ + i = strtol(str, &endp, 10); + if (endp == str) + return 0; /* can't parse class number */ + str = endp; + } + ep->class = i; + if (*str == 0) { + ep->length = 0; + return 1; + } + if (*str != ':' && *str != '.') + return 0; + ++str; + + if (i == EPD_IP) { + u32_t addr; + i = parse_dotted_ip(str, &addr); + if (i == 0 || str[i] != 0) + return 0; + set_ip_epdisc(ep, addr); + return 1; + } + if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) { + ep->length = 6; + return 1; + } + + p = str; + for (l = 0; l < MAX_ENDP_LEN; ++l) { + if (*str == 0) + break; + if (p <= str) + for (p = str; isxdigit(*p); ++p) + ; + i = p - str; + if (i == 0) + return 0; + ep->value[l] = hexc_val(*str++); + if ((i & 1) == 0) + ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++); + if (*str == ':' || *str == '.') + ++str; + } + if (*str != 0 || (ep->class == EPD_MAC && l != 6)) + return 0; + ep->length = l; + return 1; } #endif /* PPP_SUPPORT && HAVE_MULTILINK */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c index cb31b8761e..6e17ec421b 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/arc4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c index b01e07fa5c..9a89d007bd 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/des.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c index 34e5b10cd4..b1701a07b9 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md4.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c index fa6365848f..1ec4d81a69 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/md5.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -156,7 +156,7 @@ static void md5_process( md5_context *ctx, const unsigned char data[64] ) P( B, C, D, A, 12, 20, 0x8D2A4C8A ); #undef F - + #define F(x,y,z) (x ^ y ^ z) P( A, B, C, D, 5, 4, 0xFFFA3942 ); diff --git a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c index 6079af3ba2..c2192eac54 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/polarssl/sha1.c @@ -10,7 +10,7 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -19,7 +19,7 @@ * * Neither the names of PolarSSL or XySSL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS diff --git a/components/net/lwip-2.1.2/src/netif/ppp/ppp.c b/components/net/lwip-2.1.2/src/netif/ppp/ppp.c index d2eaf5594e..a9c18e304f 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/ppp.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/ppp.c @@ -633,7 +633,7 @@ int ppp_init(void) return 0; } - + /* * Create a new PPP control block. * diff --git a/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c b/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c index 0ad8e986b4..947f7ba8c1 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/pppapi.c @@ -57,10 +57,10 @@ LWIP_MEMPOOL_DECLARE(PPPAPI_MSG, MEMP_NUM_PPP_API_MSG, sizeof(struct pppapi_msg) static err_t pppapi_do_ppp_set_default(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; - + ppp_set_default(msg->msg.ppp); return ERR_OK; } @@ -90,7 +90,7 @@ pppapi_set_default(ppp_pcb *pcb) static err_t pppapi_do_ppp_set_notify_phase_callback(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -125,7 +125,7 @@ pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_pha static err_t pppapi_do_pppos_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -166,7 +166,7 @@ pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, static err_t pppapi_do_pppoe_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -211,7 +211,7 @@ pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *servic static err_t pppapi_do_pppol2tp_create(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -270,7 +270,7 @@ pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipad static err_t pppapi_do_ppp_connect(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -303,7 +303,7 @@ pppapi_connect(ppp_pcb *pcb, u16_t holdoff) static err_t pppapi_do_ppp_listen(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -335,7 +335,7 @@ pppapi_listen(ppp_pcb *pcb) static err_t pppapi_do_ppp_close(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -367,7 +367,7 @@ pppapi_close(ppp_pcb *pcb, u8_t nocarrier) static err_t pppapi_do_ppp_free(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; @@ -398,7 +398,7 @@ pppapi_free(ppp_pcb *pcb) static err_t pppapi_do_ppp_ioctl(struct tcpip_api_call_data *m) { - /* cast through void* to silence alignment warnings. + /* cast through void* to silence alignment warnings. * We know it works because the structs have been instantiated as struct pppapi_msg */ struct pppapi_msg *msg = (struct pppapi_msg *)(void*)m; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c b/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c index 81e4008d3d..82d78c13ac 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/pppcrypt.c @@ -39,28 +39,28 @@ static u_char pppcrypt_get_7bits(u_char *input, int startBit) { - unsigned int word; + unsigned int word; - word = (unsigned)input[startBit / 8] << 8; - word |= (unsigned)input[startBit / 8 + 1]; + word = (unsigned)input[startBit / 8] << 8; + word |= (unsigned)input[startBit / 8 + 1]; - word >>= 15 - (startBit % 8 + 7); + word >>= 15 - (startBit % 8 + 7); - return word & 0xFE; + return word & 0xFE; } /* IN 56 bit DES key missing parity bits * OUT 64 bit DES key with parity bits added */ void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { - des_key[0] = pppcrypt_get_7bits(key, 0); - des_key[1] = pppcrypt_get_7bits(key, 7); - des_key[2] = pppcrypt_get_7bits(key, 14); - des_key[3] = pppcrypt_get_7bits(key, 21); - des_key[4] = pppcrypt_get_7bits(key, 28); - des_key[5] = pppcrypt_get_7bits(key, 35); - des_key[6] = pppcrypt_get_7bits(key, 42); - des_key[7] = pppcrypt_get_7bits(key, 49); + des_key[0] = pppcrypt_get_7bits(key, 0); + des_key[1] = pppcrypt_get_7bits(key, 7); + des_key[2] = pppcrypt_get_7bits(key, 14); + des_key[3] = pppcrypt_get_7bits(key, 21); + des_key[4] = pppcrypt_get_7bits(key, 28); + des_key[5] = pppcrypt_get_7bits(key, 35); + des_key[6] = pppcrypt_get_7bits(key, 42); + des_key[7] = pppcrypt_get_7bits(key, 49); } #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ diff --git a/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c b/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c index 461e8bce56..8ed2d638fd 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/pppoe.c @@ -6,13 +6,13 @@ * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this -* notice and the following disclaimer are included verbatim in any +* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required * for any of the authorized uses. * * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, @@ -666,7 +666,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_remove_header failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } if (pb->len < sizeof(*ph)) { PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: could not get PPPoE header\n")); @@ -699,7 +699,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb) PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_remove_header PPPOE_HEADERLEN failed\n")); LINK_STATS_INC(link.lenerr); goto drop; - } + } PPPDEBUG(LOG_DEBUG, ("pppoe_data_input: %c%c%"U16_F": pkthdr.len=%d, pppoe.len=%d\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num, diff --git a/components/net/lwip-2.1.2/src/netif/ppp/upap.c b/components/net/lwip-2.1.2/src/netif/ppp/upap.c index 23891284e5..3b2399dc23 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/upap.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/upap.c @@ -166,12 +166,12 @@ void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password) { /* Lower layer up yet? */ if (pcb->upap.us_clientstate == UPAPCS_INITIAL || - pcb->upap.us_clientstate == UPAPCS_PENDING) { - pcb->upap.us_clientstate = UPAPCS_PENDING; - return; + pcb->upap.us_clientstate == UPAPCS_PENDING) { + pcb->upap.us_clientstate = UPAPCS_PENDING; + return; } - upap_sauthreq(pcb); /* Start protocol */ + upap_sauthreq(pcb); /* Start protocol */ } #if PPP_SERVER @@ -184,14 +184,14 @@ void upap_authpeer(ppp_pcb *pcb) { /* Lower layer up yet? */ if (pcb->upap.us_serverstate == UPAPSS_INITIAL || - pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_PENDING; - return; + pcb->upap.us_serverstate == UPAPSS_PENDING) { + pcb->upap.us_serverstate = UPAPSS_PENDING; + return; } pcb->upap.us_serverstate = UPAPSS_LISTEN; if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ @@ -202,17 +202,17 @@ static void upap_timeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) - return; + return; if (pcb->upap.us_transmits >= pcb->settings.pap_max_transmits) { - /* give up in disgust */ - ppp_error("No response to PAP authenticate-requests"); - pcb->upap.us_clientstate = UPAPCS_BADAUTH; - auth_withpeer_fail(pcb, PPP_PAP); - return; + /* give up in disgust */ + ppp_error("No response to PAP authenticate-requests"); + pcb->upap.us_clientstate = UPAPCS_BADAUTH; + auth_withpeer_fail(pcb, PPP_PAP); + return; } - upap_sauthreq(pcb); /* Send Authenticate-Request */ + upap_sauthreq(pcb); /* Send Authenticate-Request */ } @@ -224,7 +224,7 @@ static void upap_reqtimeout(void *arg) { ppp_pcb *pcb = (ppp_pcb*)arg; if (pcb->upap.us_serverstate != UPAPSS_LISTEN) - return; /* huh?? */ + return; /* huh?? */ auth_peer_fail(pcb, PPP_PAP); pcb->upap.us_serverstate = UPAPSS_BADAUTH; @@ -240,18 +240,18 @@ static void upap_reqtimeout(void *arg) { static void upap_lowerup(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_INITIAL) - pcb->upap.us_clientstate = UPAPCS_CLOSED; + pcb->upap.us_clientstate = UPAPCS_CLOSED; else if (pcb->upap.us_clientstate == UPAPCS_PENDING) { - upap_sauthreq(pcb); /* send an auth-request */ + upap_sauthreq(pcb); /* send an auth-request */ } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_INITIAL) - pcb->upap.us_serverstate = UPAPSS_CLOSED; + pcb->upap.us_serverstate = UPAPSS_CLOSED; else if (pcb->upap.us_serverstate == UPAPSS_PENDING) { - pcb->upap.us_serverstate = UPAPSS_LISTEN; - if (pcb->settings.pap_req_timeout > 0) - TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); + pcb->upap.us_serverstate = UPAPSS_LISTEN; + if (pcb->settings.pap_req_timeout > 0) + TIMEOUT(upap_reqtimeout, pcb, pcb->settings.pap_req_timeout); } #endif /* PPP_SERVER */ } @@ -264,11 +264,11 @@ static void upap_lowerup(ppp_pcb *pcb) { */ static void upap_lowerdown(ppp_pcb *pcb) { - if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ - UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ + if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ + UNTIMEOUT(upap_timeout, pcb); /* Cancel timeout */ #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN && pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); #endif /* PPP_SERVER */ pcb->upap.us_clientstate = UPAPCS_INITIAL; @@ -286,13 +286,13 @@ static void upap_lowerdown(ppp_pcb *pcb) { static void upap_protrej(ppp_pcb *pcb) { if (pcb->upap.us_clientstate == UPAPCS_AUTHREQ) { - ppp_error("PAP authentication failed due to protocol-reject"); - auth_withpeer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication failed due to protocol-reject"); + auth_withpeer_fail(pcb, PPP_PAP); } #if PPP_SERVER if (pcb->upap.us_serverstate == UPAPSS_LISTEN) { - ppp_error("PAP authentication of peer failed (protocol-reject)"); - auth_peer_fail(pcb, PPP_PAP); + ppp_error("PAP authentication of peer failed (protocol-reject)"); + auth_peer_fail(pcb, PPP_PAP); } #endif /* PPP_SERVER */ upap_lowerdown(pcb); @@ -313,19 +313,19 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { */ inp = inpacket; if (l < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd short header.")); - return; + UPAPDEBUG(("pap_input: rcvd short header.")); + return; } GETCHAR(code, inp); GETCHAR(id, inp); GETSHORT(len, inp); if (len < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd illegal length.")); - return; + UPAPDEBUG(("pap_input: rcvd illegal length.")); + return; } if (len > l) { - UPAPDEBUG(("pap_input: rcvd short packet.")); - return; + UPAPDEBUG(("pap_input: rcvd short packet.")); + return; } len -= UPAP_HEADERLEN; @@ -335,20 +335,20 @@ static void upap_input(ppp_pcb *pcb, u_char *inpacket, int l) { switch (code) { case UPAP_AUTHREQ: #if PPP_SERVER - upap_rauthreq(pcb, inp, id, len); + upap_rauthreq(pcb, inp, id, len); #endif /* PPP_SERVER */ - break; + break; case UPAP_AUTHACK: - upap_rauthack(pcb, inp, id, len); - break; + upap_rauthack(pcb, inp, id, len); + break; case UPAP_AUTHNAK: - upap_rauthnak(pcb, inp, id, len); - break; + upap_rauthnak(pcb, inp, id, len); + break; - default: /* XXX Need code reject */ - break; + default: /* XXX Need code reject */ + break; } } @@ -366,40 +366,40 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { int msglen; if (pcb->upap.us_serverstate < UPAPSS_LISTEN) - return; + return; /* * If we receive a duplicate authenticate-request, we are * supposed to return the same status as for the first request. */ if (pcb->upap.us_serverstate == UPAPSS_OPEN) { - upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ - return; + upap_sresp(pcb, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ + return; } if (pcb->upap.us_serverstate == UPAPSS_BADAUTH) { - upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ - return; + upap_sresp(pcb, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ + return; } /* * Parse user/passwd. */ if (len < 1) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } GETCHAR(ruserlen, inp); len -= sizeof (u_char) + ruserlen + sizeof (u_char); if (len < 0) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } ruser = (char *) inp; INCPTR(ruserlen, inp); GETCHAR(rpasswdlen, inp); if (len < rpasswdlen) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; + UPAPDEBUG(("pap_rauth: rcvd short packet.")); + return; } rpasswd = (char *) inp; @@ -420,16 +420,16 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { * return an authenticate failure, is leaving it for us to verify. */ if (retcode == UPAP_AUTHACK) { - if (!auth_number()) { - /* We do not want to leak info about the pap result. */ - retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ - warn("calling number %q is not authorized", remote_number); - } + if (!auth_number()) { + /* We do not want to leak info about the pap result. */ + retcode = UPAP_AUTHNAK; /* XXX exit value will be "wrong" */ + warn("calling number %q is not authorized", remote_number); + } } msglen = strlen(msg); if (msglen > 255) - msglen = 255; + msglen = 255; #endif /* UNUSED */ upap_sresp(pcb, retcode, id, msg, msglen); @@ -438,17 +438,17 @@ static void upap_rauthreq(ppp_pcb *pcb, u_char *inp, int id, int len) { ppp_slprintf(rhostname, sizeof(rhostname), "%.*v", ruserlen, ruser); if (retcode == UPAP_AUTHACK) { - pcb->upap.us_serverstate = UPAPSS_OPEN; - ppp_notice("PAP peer authentication succeeded for %q", rhostname); - auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); + pcb->upap.us_serverstate = UPAPSS_OPEN; + ppp_notice("PAP peer authentication succeeded for %q", rhostname); + auth_peer_success(pcb, PPP_PAP, 0, ruser, ruserlen); } else { - pcb->upap.us_serverstate = UPAPSS_BADAUTH; - ppp_warn("PAP peer authentication failed for %q", rhostname); - auth_peer_fail(pcb, PPP_PAP); + pcb->upap.us_serverstate = UPAPSS_BADAUTH; + ppp_warn("PAP peer authentication failed for %q", rhostname); + auth_peer_fail(pcb, PPP_PAP); } if (pcb->settings.pap_req_timeout > 0) - UNTIMEOUT(upap_reqtimeout, pcb); + UNTIMEOUT(upap_reqtimeout, pcb); } #endif /* PPP_SERVER */ @@ -461,24 +461,24 @@ static void upap_rauthack(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthack: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthack: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_OPEN; @@ -496,24 +496,24 @@ static void upap_rauthnak(ppp_pcb *pcb, u_char *inp, int id, int len) { LWIP_UNUSED_ARG(id); if (pcb->upap.us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; + return; /* * Parse message. */ if (len < 1) { - UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); + UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } + GETCHAR(msglen, inp); + if (msglen > 0) { + len -= sizeof (u_char); + if (len < msglen) { + UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); + return; + } + msg = (char *) inp; + PRINTMSG(msg, msglen); + } } pcb->upap.us_clientstate = UPAPCS_BADAUTH; @@ -532,7 +532,7 @@ static void upap_sauthreq(ppp_pcb *pcb) { int outlen; outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + - pcb->upap.us_userlen + pcb->upap.us_passwdlen; + pcb->upap.us_userlen + pcb->upap.us_passwdlen; p = pbuf_alloc(PBUF_RAW, (u16_t)(PPP_HDRLEN +outlen), PPP_CTRL_PBUF_TYPE); if(NULL == p) return; @@ -606,68 +606,68 @@ static int upap_printpkt(const u_char *p, int plen, void (*printer) (void *, con const u_char *pstart; if (plen < UPAP_HEADERLEN) - return 0; + return 0; pstart = p; GETCHAR(code, p); GETCHAR(id, p); GETSHORT(len, p); if (len < UPAP_HEADERLEN || len > plen) - return 0; + return 0; if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(upap_codenames)) - printer(arg, " %s", upap_codenames[code-1]); + printer(arg, " %s", upap_codenames[code-1]); else - printer(arg, " code=0x%x", code); + printer(arg, " code=0x%x", code); printer(arg, " id=0x%x", id); len -= UPAP_HEADERLEN; switch (code) { case UPAP_AUTHREQ: - if (len < 1) - break; - ulen = p[0]; - if (len < ulen + 2) - break; - wlen = p[ulen + 1]; - if (len < ulen + wlen + 2) - break; - user = (const u_char *) (p + 1); - pwd = (const u_char *) (p + ulen + 2); - p += ulen + wlen + 2; - len -= ulen + wlen + 2; - printer(arg, " user="); - ppp_print_string(user, ulen, printer, arg); - printer(arg, " password="); + if (len < 1) + break; + ulen = p[0]; + if (len < ulen + 2) + break; + wlen = p[ulen + 1]; + if (len < ulen + wlen + 2) + break; + user = (const u_char *) (p + 1); + pwd = (const u_char *) (p + ulen + 2); + p += ulen + wlen + 2; + len -= ulen + wlen + 2; + printer(arg, " user="); + ppp_print_string(user, ulen, printer, arg); + printer(arg, " password="); /* FIXME: require ppp_pcb struct as printpkt() argument */ #if 0 - if (!pcb->settings.hide_password) + if (!pcb->settings.hide_password) #endif - ppp_print_string(pwd, wlen, printer, arg); + ppp_print_string(pwd, wlen, printer, arg); #if 0 - else - printer(arg, ""); + else + printer(arg, ""); #endif - break; + break; case UPAP_AUTHACK: case UPAP_AUTHNAK: - if (len < 1) - break; - mlen = p[0]; - if (len < mlen + 1) - break; - msg = (const u_char *) (p + 1); - p += mlen + 1; - len -= mlen + 1; - printer(arg, " "); - ppp_print_string(msg, mlen, printer, arg); - break; + if (len < 1) + break; + mlen = p[0]; + if (len < mlen + 1) + break; + msg = (const u_char *) (p + 1); + p += mlen + 1; + len -= mlen + 1; + printer(arg, " "); + ppp_print_string(msg, mlen, printer, arg); + break; default: - break; + break; } /* print the rest of the bytes in the packet */ for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); + GETCHAR(code, p); + printer(arg, " %.2x", code); } return p - pstart; diff --git a/components/net/lwip-2.1.2/src/netif/ppp/utils.c b/components/net/lwip-2.1.2/src/netif/ppp/utils.c index e9c8ba1cc4..f1366dae45 100644 --- a/components/net/lwip-2.1.2/src/netif/ppp/utils.c +++ b/components/net/lwip-2.1.2/src/netif/ppp/utils.c @@ -72,7 +72,7 @@ static void ppp_log_write(int level, char *buf); #if PRINTPKT_SUPPORT static void ppp_vslp_printer(void *arg, const char *fmt, ...); static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg); + void (*printer) (void *, const char *, ...), void *arg); struct buffer_info { char *ptr; @@ -88,12 +88,12 @@ size_t ppp_strlcpy(char *dest, const char *src, size_t len) { size_t ret = strlen(src); if (len != 0) { - if (ret < len) - strcpy(dest, src); - else { - strncpy(dest, src, len - 1); - dest[len-1] = 0; - } + if (ret < len) + strcpy(dest, src); + else { + strncpy(dest, src, len - 1); + dest[len-1] = 0; + } } return ret; } @@ -130,7 +130,7 @@ int ppp_slprintf(char *buf, int buflen, const char *fmt, ...) { /* * ppp_vslprintf - like ppp_slprintf, takes a va_list instead of a list of args. */ -#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) +#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { int c, i, n; @@ -153,249 +153,249 @@ int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args) { buf0 = buf; --buflen; while (buflen > 0) { - for (f = fmt; *f != '%' && *f != 0; ++f) - ; - if (f > fmt) { - len = f - fmt; - if (len > buflen) - len = buflen; - memcpy(buf, fmt, len); - buf += len; - buflen -= len; - fmt = f; - } - if (*fmt == 0) - break; - c = *++fmt; - width = 0; - prec = -1; - fillch = ' '; - if (c == '0') { - fillch = '0'; - c = *++fmt; - } - if (c == '*') { - width = va_arg(args, int); - c = *++fmt; - } else { - while (lwip_isdigit(c)) { - width = width * 10 + c - '0'; - c = *++fmt; - } - } - if (c == '.') { - c = *++fmt; - if (c == '*') { - prec = va_arg(args, int); - c = *++fmt; - } else { - prec = 0; - while (lwip_isdigit(c)) { - prec = prec * 10 + c - '0'; - c = *++fmt; - } - } - } - str = 0; - base = 0; - neg = 0; - ++fmt; - switch (c) { - case 'l': - c = *fmt++; - switch (c) { - case 'd': - val = va_arg(args, long); - if ((long)val < 0) { - neg = 1; - val = (unsigned long)-(long)val; - } - base = 10; - break; - case 'u': - val = va_arg(args, unsigned long); - base = 10; - break; - default: - OUTCHAR('%'); - OUTCHAR('l'); - --fmt; /* so %lz outputs %lz etc. */ - continue; - } - break; - case 'd': - i = va_arg(args, int); - if (i < 0) { - neg = 1; - val = -i; - } else - val = i; - base = 10; - break; - case 'u': - val = va_arg(args, unsigned int); - base = 10; - break; - case 'o': - val = va_arg(args, unsigned int); - base = 8; - break; - case 'x': - case 'X': - val = va_arg(args, unsigned int); - base = 16; - break; + for (f = fmt; *f != '%' && *f != 0; ++f) + ; + if (f > fmt) { + len = f - fmt; + if (len > buflen) + len = buflen; + memcpy(buf, fmt, len); + buf += len; + buflen -= len; + fmt = f; + } + if (*fmt == 0) + break; + c = *++fmt; + width = 0; + prec = -1; + fillch = ' '; + if (c == '0') { + fillch = '0'; + c = *++fmt; + } + if (c == '*') { + width = va_arg(args, int); + c = *++fmt; + } else { + while (lwip_isdigit(c)) { + width = width * 10 + c - '0'; + c = *++fmt; + } + } + if (c == '.') { + c = *++fmt; + if (c == '*') { + prec = va_arg(args, int); + c = *++fmt; + } else { + prec = 0; + while (lwip_isdigit(c)) { + prec = prec * 10 + c - '0'; + c = *++fmt; + } + } + } + str = 0; + base = 0; + neg = 0; + ++fmt; + switch (c) { + case 'l': + c = *fmt++; + switch (c) { + case 'd': + val = va_arg(args, long); + if ((long)val < 0) { + neg = 1; + val = (unsigned long)-(long)val; + } + base = 10; + break; + case 'u': + val = va_arg(args, unsigned long); + base = 10; + break; + default: + OUTCHAR('%'); + OUTCHAR('l'); + --fmt; /* so %lz outputs %lz etc. */ + continue; + } + break; + case 'd': + i = va_arg(args, int); + if (i < 0) { + neg = 1; + val = -i; + } else + val = i; + base = 10; + break; + case 'u': + val = va_arg(args, unsigned int); + base = 10; + break; + case 'o': + val = va_arg(args, unsigned int); + base = 8; + break; + case 'x': + case 'X': + val = va_arg(args, unsigned int); + base = 16; + break; #if 0 /* unused (and wrong on LLP64 systems) */ - case 'p': - val = (unsigned long) va_arg(args, void *); - base = 16; - neg = 2; - break; + case 'p': + val = (unsigned long) va_arg(args, void *); + base = 16; + neg = 2; + break; #endif /* unused (and wrong on LLP64 systems) */ - case 's': - str = va_arg(args, char *); - break; - case 'c': - num[0] = va_arg(args, int); - num[1] = 0; - str = num; - break; + case 's': + str = va_arg(args, char *); + break; + case 'c': + num[0] = va_arg(args, int); + num[1] = 0; + str = num; + break; #if 0 /* do we always have strerror() in embedded ? */ - case 'm': - str = strerror(errno); - break; + case 'm': + str = strerror(errno); + break; #endif /* do we always have strerror() in embedded ? */ - case 'I': - ip = va_arg(args, u32_t); - ip = lwip_ntohl(ip); - ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, - (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); - str = num; - break; + case 'I': + ip = va_arg(args, u32_t); + ip = lwip_ntohl(ip); + ppp_slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, + (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); + str = num; + break; #if 0 /* need port */ - case 't': - time(&t); - str = ctime(&t); - str += 4; /* chop off the day name */ - str[15] = 0; /* chop off year and newline */ - break; + case 't': + time(&t); + str = ctime(&t); + str += 4; /* chop off the day name */ + str[15] = 0; /* chop off year and newline */ + break; #endif /* need port */ - case 'v': /* "visible" string */ - case 'q': /* quoted string */ - quoted = c == 'q'; - p = va_arg(args, unsigned char *); - if (p == NULL) - p = (const unsigned char *)""; - if (fillch == '0' && prec >= 0) { - n = prec; - } else { - n = strlen((const char *)p); - if (prec >= 0 && n > prec) - n = prec; - } - while (n > 0 && buflen > 0) { - c = *p++; - --n; - if (!quoted && c >= 0x80) { - OUTCHAR('M'); - OUTCHAR('-'); - c -= 0x80; - } - if (quoted && (c == '"' || c == '\\')) - OUTCHAR('\\'); - if (c < 0x20 || (0x7f <= c && c < 0xa0)) { - if (quoted) { - OUTCHAR('\\'); - switch (c) { - case '\t': OUTCHAR('t'); break; - case '\n': OUTCHAR('n'); break; - case '\b': OUTCHAR('b'); break; - case '\f': OUTCHAR('f'); break; - default: - OUTCHAR('x'); - OUTCHAR(hexchars[c >> 4]); - OUTCHAR(hexchars[c & 0xf]); - } - } else { - if (c == '\t') - OUTCHAR(c); - else { - OUTCHAR('^'); - OUTCHAR(c ^ 0x40); - } - } - } else - OUTCHAR(c); - } - continue; + case 'v': /* "visible" string */ + case 'q': /* quoted string */ + quoted = c == 'q'; + p = va_arg(args, unsigned char *); + if (p == NULL) + p = (const unsigned char *)""; + if (fillch == '0' && prec >= 0) { + n = prec; + } else { + n = strlen((const char *)p); + if (prec >= 0 && n > prec) + n = prec; + } + while (n > 0 && buflen > 0) { + c = *p++; + --n; + if (!quoted && c >= 0x80) { + OUTCHAR('M'); + OUTCHAR('-'); + c -= 0x80; + } + if (quoted && (c == '"' || c == '\\')) + OUTCHAR('\\'); + if (c < 0x20 || (0x7f <= c && c < 0xa0)) { + if (quoted) { + OUTCHAR('\\'); + switch (c) { + case '\t': OUTCHAR('t'); break; + case '\n': OUTCHAR('n'); break; + case '\b': OUTCHAR('b'); break; + case '\f': OUTCHAR('f'); break; + default: + OUTCHAR('x'); + OUTCHAR(hexchars[c >> 4]); + OUTCHAR(hexchars[c & 0xf]); + } + } else { + if (c == '\t') + OUTCHAR(c); + else { + OUTCHAR('^'); + OUTCHAR(c ^ 0x40); + } + } + } else + OUTCHAR(c); + } + continue; #if PRINTPKT_SUPPORT - case 'P': /* print PPP packet */ - bufinfo.ptr = buf; - bufinfo.len = buflen + 1; - p = va_arg(args, unsigned char *); - n = va_arg(args, int); - ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); - buf = bufinfo.ptr; - buflen = bufinfo.len - 1; - continue; + case 'P': /* print PPP packet */ + bufinfo.ptr = buf; + bufinfo.len = buflen + 1; + p = va_arg(args, unsigned char *); + n = va_arg(args, int); + ppp_format_packet(p, n, ppp_vslp_printer, &bufinfo); + buf = bufinfo.ptr; + buflen = bufinfo.len - 1; + continue; #endif /* PRINTPKT_SUPPORT */ - case 'B': - p = va_arg(args, unsigned char *); - for (n = prec; n > 0; --n) { - c = *p++; - if (fillch == ' ') - OUTCHAR(' '); - OUTCHAR(hexchars[(c >> 4) & 0xf]); - OUTCHAR(hexchars[c & 0xf]); - } - continue; - default: - *buf++ = '%'; - if (c != '%') - --fmt; /* so %z outputs %z etc. */ - --buflen; - continue; - } - if (base != 0) { - str = num + sizeof(num); - *--str = 0; - while (str > num + neg) { - *--str = hexchars[val % base]; - val = val / base; - if (--prec <= 0 && val == 0) - break; - } - switch (neg) { - case 1: - *--str = '-'; - break; - case 2: - *--str = 'x'; - *--str = '0'; - break; - default: - break; - } - len = num + sizeof(num) - 1 - str; - } else { - len = strlen(str); - if (prec >= 0 && len > prec) - len = prec; - } - if (width > 0) { - if (width > buflen) - width = buflen; - if ((n = width - len) > 0) { - buflen -= n; - for (; n > 0; --n) - *buf++ = fillch; - } - } - if (len > buflen) - len = buflen; - memcpy(buf, str, len); - buf += len; - buflen -= len; + case 'B': + p = va_arg(args, unsigned char *); + for (n = prec; n > 0; --n) { + c = *p++; + if (fillch == ' ') + OUTCHAR(' '); + OUTCHAR(hexchars[(c >> 4) & 0xf]); + OUTCHAR(hexchars[c & 0xf]); + } + continue; + default: + *buf++ = '%'; + if (c != '%') + --fmt; /* so %z outputs %z etc. */ + --buflen; + continue; + } + if (base != 0) { + str = num + sizeof(num); + *--str = 0; + while (str > num + neg) { + *--str = hexchars[val % base]; + val = val / base; + if (--prec <= 0 && val == 0) + break; + } + switch (neg) { + case 1: + *--str = '-'; + break; + case 2: + *--str = 'x'; + *--str = '0'; + break; + default: + break; + } + len = num + sizeof(num) - 1 - str; + } else { + len = strlen(str); + if (prec >= 0 && len > prec) + len = prec; + } + if (width > 0) { + if (width > buflen) + width = buflen; + if ((n = width - len) > 0) { + buflen -= n; + for (; n > 0; --n) + *buf++ = fillch; + } + } + if (len > buflen) + len = buflen; + memcpy(buf, str, len); + buf += len; + buflen -= len; } *buf = 0; return buf - buf0; @@ -432,9 +432,9 @@ log_packet(p, len, prefix, level) char *prefix; int level; { - init_pr_log(prefix, level); - ppp_format_packet(p, len, pr_log, &level); - end_pr_log(); + init_pr_log(prefix, level); + ppp_format_packet(p, len, pr_log, &level); + end_pr_log(); } #endif /* UNUSED */ @@ -444,43 +444,43 @@ log_packet(p, len, prefix, level) * calling `printer(arg, format, ...)' to output it. */ static void ppp_format_packet(const u_char *p, int len, - void (*printer) (void *, const char *, ...), void *arg) { + void (*printer) (void *, const char *, ...), void *arg) { int i, n; u_short proto; const struct protent *protp; if (len >= 2) { - GETSHORT(proto, p); - len -= 2; - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == protp->protocol) - break; - if (protp != NULL) { - printer(arg, "[%s", protp->name); - n = (*protp->printpkt)(p, len, printer, arg); - printer(arg, "]"); - p += n; - len -= n; - } else { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == (protp->protocol & ~0x8000)) - break; - if (protp != 0 && protp->data_name != 0) { - printer(arg, "[%s data]", protp->data_name); - if (len > 8) - printer(arg, "%.8B ...", p); - else - printer(arg, "%.*B", len, p); - len = 0; - } else - printer(arg, "[proto=0x%x]", proto); - } + GETSHORT(proto, p); + len -= 2; + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == protp->protocol) + break; + if (protp != NULL) { + printer(arg, "[%s", protp->name); + n = (*protp->printpkt)(p, len, printer, arg); + printer(arg, "]"); + p += n; + len -= n; + } else { + for (i = 0; (protp = protocols[i]) != NULL; ++i) + if (proto == (protp->protocol & ~0x8000)) + break; + if (protp != 0 && protp->data_name != 0) { + printer(arg, "[%s data]", protp->data_name); + if (len > 8) + printer(arg, "%.8B ...", p); + else + printer(arg, "%.*B", len, p); + len = 0; + } else + printer(arg, "[proto=0x%x]", proto); + } } if (len > 32) - printer(arg, "%.32B ...", p); + printer(arg, "%.32B ...", p); else - printer(arg, "%.*B", len, p); + printer(arg, "%.*B", len, p); } #endif /* PRINTPKT_SUPPORT */ @@ -489,30 +489,30 @@ static void ppp_format_packet(const u_char *p, int len, * init_pr_log, end_pr_log - initialize and finish use of pr_log. */ -static char line[256]; /* line to be logged accumulated here */ -static char *linep; /* current pointer within line */ -static int llevel; /* level for logging */ +static char line[256]; /* line to be logged accumulated here */ +static char *linep; /* current pointer within line */ +static int llevel; /* level for logging */ void init_pr_log(prefix, level) const char *prefix; int level; { - linep = line; - if (prefix != NULL) { - ppp_strlcpy(line, prefix, sizeof(line)); - linep = line + strlen(line); - } - llevel = level; + linep = line; + if (prefix != NULL) { + ppp_strlcpy(line, prefix, sizeof(line)); + linep = line + strlen(line); + } + llevel = level; } void end_pr_log() { - if (linep != line) { - *linep = 0; - ppp_log_write(llevel, line); - } + if (linep != line) { + *linep = 0; + ppp_log_write(llevel, line); + } } /* @@ -521,47 +521,47 @@ end_pr_log() void pr_log (void *arg, const char *fmt, ...) { - int l, n; - va_list pvar; - char *p, *eol; - char buf[256]; - - va_start(pvar, fmt); - n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); - va_end(pvar); - - p = buf; - eol = strchr(buf, '\n'); - if (linep != line) { - l = (eol == NULL)? n: eol - buf; - if (linep + l < line + sizeof(line)) { - if (l > 0) { - memcpy(linep, buf, l); - linep += l; - } - if (eol == NULL) - return; - p = eol + 1; - eol = strchr(p, '\n'); - } - *linep = 0; - ppp_log_write(llevel, line); - linep = line; - } - - while (eol != NULL) { - *eol = 0; - ppp_log_write(llevel, p); - p = eol + 1; - eol = strchr(p, '\n'); - } - - /* assumes sizeof(buf) <= sizeof(line) */ - l = buf + n - p; - if (l > 0) { - memcpy(line, p, n); - linep = line + l; - } + int l, n; + va_list pvar; + char *p, *eol; + char buf[256]; + + va_start(pvar, fmt); + n = ppp_vslprintf(buf, sizeof(buf), fmt, pvar); + va_end(pvar); + + p = buf; + eol = strchr(buf, '\n'); + if (linep != line) { + l = (eol == NULL)? n: eol - buf; + if (linep + l < line + sizeof(line)) { + if (l > 0) { + memcpy(linep, buf, l); + linep += l; + } + if (eol == NULL) + return; + p = eol + 1; + eol = strchr(p, '\n'); + } + *linep = 0; + ppp_log_write(llevel, line); + linep = line; + } + + while (eol != NULL) { + *eol = 0; + ppp_log_write(llevel, p); + p = eol + 1; + eol = strchr(p, '\n'); + } + + /* assumes sizeof(buf) <= sizeof(line) */ + l = buf + n - p; + if (l > 0) { + memcpy(line, p, n); + linep = line + l; + } } #endif /* UNUSED */ @@ -574,27 +574,27 @@ void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const c printer(arg, "\""); for (; len > 0; --len) { - c = *p++; - if (' ' <= c && c <= '~') { - if (c == '\\' || c == '"') - printer(arg, "\\"); - printer(arg, "%c", c); - } else { - switch (c) { - case '\n': - printer(arg, "\\n"); - break; - case '\r': - printer(arg, "\\r"); - break; - case '\t': - printer(arg, "\\t"); - break; - default: - printer(arg, "\\%.3o", (u8_t)c); - /* no break */ - } - } + c = *p++; + if (' ' <= c && c <= '~') { + if (c == '\\' || c == '"') + printer(arg, "\\"); + printer(arg, "%c", c); + } else { + switch (c) { + case '\n': + printer(arg, "\\n"); + break; + case '\r': + printer(arg, "\\r"); + break; + case '\t': + printer(arg, "\\t"); + break; + default: + printer(arg, "\\%.3o", (u8_t)c); + /* no break */ + } + } } printer(arg, "\""); } @@ -615,13 +615,13 @@ static void ppp_log_write(int level, char *buf) { PPPDEBUG(level, ("%s\n", buf) ); #if 0 if (log_to_fd >= 0 && (level != LOG_DEBUG || debug)) { - int n = strlen(buf); + int n = strlen(buf); - if (n > 0 && buf[n-1] == '\n') - --n; - if (write(log_to_fd, buf, n) != n - || write(log_to_fd, "\n", 1) != 1) - log_to_fd = -1; + if (n > 0 && buf[n-1] == '\n') + --n; + if (write(log_to_fd, buf, n) != n + || write(log_to_fd, "\n", 1) != 1) + log_to_fd = -1; } #endif } @@ -710,18 +710,18 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { */ proto = (p[0] << 8) + p[1]; if (proto < 0xC000 && (proto & ~0x8000) == proto) - return; + return; /* * don't print valid LCP echo request/reply packets if the link is up. */ if (proto == PPP_LCP && pcb->phase == PPP_PHASE_RUNNING && len >= 2 + HEADERLEN) { - unsigned char *lcp = p + 2; - int l = (lcp[2] << 8) + lcp[3]; + unsigned char *lcp = p + 2; + int l = (lcp[2] << 8) + lcp[3]; - if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) - && l >= HEADERLEN && l <= len - 2) - return; + if ((lcp[0] == ECHOREQ || lcp[0] == ECHOREP) + && l >= HEADERLEN && l <= len - 2) + return; } ppp_dbglog("%s %P", tag, p, len); @@ -737,34 +737,34 @@ void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len) { ssize_t complete_read(int fd, void *buf, size_t count) { - size_t done; - ssize_t nb; - char *ptr = buf; - - for (done = 0; done < count; ) { - nb = read(fd, ptr, count - done); - if (nb < 0) { - if (errno == EINTR) - continue; - return -1; - } - if (nb == 0) - break; - done += nb; - ptr += nb; - } - return done; + size_t done; + ssize_t nb; + char *ptr = buf; + + for (done = 0; done < count; ) { + nb = read(fd, ptr, count - done); + if (nb < 0) { + if (errno == EINTR) + continue; + return -1; + } + if (nb == 0) + break; + done += nb; + ptr += nb; + } + return done; } /* Procedures for locking the serial device using a lock file. */ #ifndef LOCK_DIR #ifdef __linux__ -#define LOCK_DIR "/var/lock" +#define LOCK_DIR "/var/lock" #else #ifdef SVR4 -#define LOCK_DIR "/var/spool/locks" +#define LOCK_DIR "/var/spool/locks" #else -#define LOCK_DIR "/var/spool/lock" +#define LOCK_DIR "/var/spool/lock" #endif #endif #endif /* LOCK_DIR */ @@ -783,14 +783,14 @@ lock(dev) result = mklock (dev, (void *) 0); if (result == 0) { - ppp_strlcpy(lock_file, dev, sizeof(lock_file)); - return 0; + ppp_strlcpy(lock_file, dev, sizeof(lock_file)); + return 0; } if (result > 0) ppp_notice("Device %s is locked by pid %d", dev, result); else - ppp_error("Can't create lock file %s", lock_file); + ppp_error("Can't create lock file %s", lock_file); return -1; #else /* LOCKLIB */ @@ -802,83 +802,83 @@ lock(dev) struct stat sbuf; if (stat(dev, &sbuf) < 0) { - ppp_error("Can't get device number for %s: %m", dev); - return -1; + ppp_error("Can't get device number for %s: %m", dev); + return -1; } if ((sbuf.st_mode & S_IFMT) != S_IFCHR) { - ppp_error("Can't lock %s: not a character device", dev); - return -1; + ppp_error("Can't lock %s: not a character device", dev); + return -1; } ppp_slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d", - LOCK_DIR, major(sbuf.st_dev), - major(sbuf.st_rdev), minor(sbuf.st_rdev)); + LOCK_DIR, major(sbuf.st_dev), + major(sbuf.st_rdev), minor(sbuf.st_rdev)); #else char *p; char lockdev[MAXPATHLEN]; if ((p = strstr(dev, "dev/")) != NULL) { - dev = p + 4; - strncpy(lockdev, dev, MAXPATHLEN-1); - lockdev[MAXPATHLEN-1] = 0; - while ((p = strrchr(lockdev, '/')) != NULL) { - *p = '_'; - } - dev = lockdev; + dev = p + 4; + strncpy(lockdev, dev, MAXPATHLEN-1); + lockdev[MAXPATHLEN-1] = 0; + while ((p = strrchr(lockdev, '/')) != NULL) { + *p = '_'; + } + dev = lockdev; } else - if ((p = strrchr(dev, '/')) != NULL) - dev = p + 1; + if ((p = strrchr(dev, '/')) != NULL) + dev = p + 1; ppp_slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); #endif while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) { - if (errno != EEXIST) { - ppp_error("Can't create lock file %s: %m", lock_file); - break; - } - - /* Read the lock file to find out who has the device locked. */ - fd = open(lock_file, O_RDONLY, 0); - if (fd < 0) { - if (errno == ENOENT) /* This is just a timing problem. */ - continue; - ppp_error("Can't open existing lock file %s: %m", lock_file); - break; - } + if (errno != EEXIST) { + ppp_error("Can't create lock file %s: %m", lock_file); + break; + } + + /* Read the lock file to find out who has the device locked. */ + fd = open(lock_file, O_RDONLY, 0); + if (fd < 0) { + if (errno == ENOENT) /* This is just a timing problem. */ + continue; + ppp_error("Can't open existing lock file %s: %m", lock_file); + break; + } #ifndef LOCK_BINARY - n = read(fd, lock_buffer, 11); + n = read(fd, lock_buffer, 11); #else - n = read(fd, &pid, sizeof(pid)); + n = read(fd, &pid, sizeof(pid)); #endif /* LOCK_BINARY */ - close(fd); - fd = -1; - if (n <= 0) { - ppp_error("Can't read pid from lock file %s", lock_file); - break; - } - - /* See if the process still exists. */ + close(fd); + fd = -1; + if (n <= 0) { + ppp_error("Can't read pid from lock file %s", lock_file); + break; + } + + /* See if the process still exists. */ #ifndef LOCK_BINARY - lock_buffer[n] = 0; - pid = atoi(lock_buffer); + lock_buffer[n] = 0; + pid = atoi(lock_buffer); #endif /* LOCK_BINARY */ - if (pid == getpid()) - return 1; /* somebody else locked it for us */ - if (pid == 0 - || (kill(pid, 0) == -1 && errno == ESRCH)) { - if (unlink (lock_file) == 0) { - ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); - continue; - } - ppp_warn("Couldn't remove stale lock on %s", dev); - } else - ppp_notice("Device %s is locked by pid %d", dev, pid); - break; + if (pid == getpid()) + return 1; /* somebody else locked it for us */ + if (pid == 0 + || (kill(pid, 0) == -1 && errno == ESRCH)) { + if (unlink (lock_file) == 0) { + ppp_notice("Removed stale lock on %s (pid %d)", dev, pid); + continue; + } + ppp_warn("Couldn't remove stale lock on %s", dev); + } else + ppp_notice("Device %s is locked by pid %d", dev, pid); + break; } if (fd < 0) { - lock_file[0] = 0; - return -1; + lock_file[0] = 0; + return -1; } pid = getpid(); @@ -916,12 +916,12 @@ relock(pid) char lock_buffer[12]; if (lock_file[0] == 0) - return -1; + return -1; fd = open(lock_file, O_WRONLY, 0); if (fd < 0) { - ppp_error("Couldn't reopen lock file %s: %m", lock_file); - lock_file[0] = 0; - return -1; + ppp_error("Couldn't reopen lock file %s: %m", lock_file); + lock_file[0] = 0; + return -1; } #ifndef LOCK_BINARY @@ -944,11 +944,11 @@ unlock() { if (lock_file[0]) { #ifdef LOCKLIB - (void) rmlock(lock_file, (void *) 0); + (void) rmlock(lock_file, (void *) 0); #else - unlink(lock_file); + unlink(lock_file); #endif - lock_file[0] = 0; + lock_file[0] = 0; } } diff --git a/components/net/lwip-2.1.2/test/fuzz/fuzz.c b/components/net/lwip-2.1.2/test/fuzz/fuzz.c index ecebc57052..8aa07ecc26 100644 --- a/components/net/lwip-2.1.2/test/fuzz/fuzz.c +++ b/components/net/lwip-2.1.2/test/fuzz/fuzz.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Erik Ekman * */ diff --git a/components/net/lwip-2.1.2/test/fuzz/lwipopts.h b/components/net/lwip-2.1.2/test/fuzz/lwipopts.h index 50e60806b1..4ab26f289b 100644 --- a/components/net/lwip-2.1.2/test/fuzz/lwipopts.h +++ b/components/net/lwip-2.1.2/test/fuzz/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c index e73cfe3bb1..3ac553b151 100644 --- a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c +++ b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.c @@ -16,12 +16,12 @@ * - full duplex * - add asserts about internal socket/netconn/pcb state? */ - + /* * Copyright (c) 2017 Simon Goldschmidt * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -30,21 +30,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h index 256ea000fc..178e604ae6 100644 --- a/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h +++ b/components/net/lwip-2.1.2/test/sockets/sockets_stresstest.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2017 Simon Goldschmidt * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/api/test_sockets.c b/components/net/lwip-2.1.2/test/unit/api/test_sockets.c index ed2b811275..472fa48950 100644 --- a/components/net/lwip-2.1.2/test/unit/api/test_sockets.c +++ b/components/net/lwip-2.1.2/test/unit/api/test_sockets.c @@ -255,7 +255,7 @@ static void test_sockets_msgapi_update_iovs(struct msghdr *msg, size_t bytes) /* note: this modifies the underyling iov_base and iov_len for a partial read for an individual vector. This updates the msg->msg_iov pointer to skip fully consumed vecotrs */ - + /* process fully consumed vectors */ for (i = 0; i < msg->msg_iovlen; i++) { if (msg->msg_iov[i].iov_len <= bytes) { @@ -395,7 +395,7 @@ static void test_sockets_msgapi_tcp(int domain) /* note: since we always receive after sending, there will be open space in the send buffer */ fail_unless(ret > 0); - + bytes_written += ret; if (bytes_written < TOTAL_DATA_SZ) { test_sockets_msgapi_update_iovs(&smsg, (size_t)ret); @@ -432,7 +432,7 @@ static void test_sockets_msgapi_tcp(int domain) } } while(ret > 0); } - + ret = lwip_close(s1); fail_unless(ret == 0); ret = lwip_close(s2); @@ -588,13 +588,13 @@ static void test_sockets_msgapi_cmsg(int domain) memset(rcv_buf, 0, sizeof(rcv_buf)); ret = lwip_sendto(s, snd_buf, sizeof(snd_buf), 0, (struct sockaddr*)&addr_storage, addr_size); fail_unless(ret == sizeof(snd_buf)); - + tcpip_thread_poll_one(); ret = lwip_recvmsg(s, &msg, 0); fail_unless(ret == sizeof(rcv_buf)); fail_unless(!memcmp(rcv_buf, snd_buf, sizeof(rcv_buf))); - + /* Verify message header */ cmsg = CMSG_FIRSTHDR(&msg); fail_unless(cmsg != NULL); diff --git a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c index a84e3784e9..cf826ebfe3 100644 --- a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2017 Simon Goldschmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h index ef829decb9..331c2f2f15 100644 --- a/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h +++ b/components/net/lwip-2.1.2/test/unit/arch/sys_arch.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2017 Simon Goldschmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/core/test_timers.c b/components/net/lwip-2.1.2/test/unit/core/test_timers.c index 30f6ac4cd8..820b718924 100644 --- a/components/net/lwip-2.1.2/test/unit/core/test_timers.c +++ b/components/net/lwip-2.1.2/test/unit/core/test_timers.c @@ -61,7 +61,7 @@ do_test_cyclic_timers(u32_t offset) fail_unless(cyclic_fired == 1); fail_unless((*list_head)->time == (u32_t)(lwip_sys_now + test_cyclic.interval_ms - HANDLER_EXECUTION_TIME)); - + sys_untimeout(lwip_cyclic_timer, &test_cyclic); @@ -128,7 +128,7 @@ static void do_test_timers(u32_t offset) { struct sys_timeo** list_head = sys_timeouts_get_next_timeout(); - + lwip_sys_now = offset + 0; sys_timeout(10, dummy_handler, LWIP_PTR_NUMERIC_CAST(void*, 0)); @@ -142,7 +142,7 @@ do_test_timers(u32_t offset) fail_unless((*list_head)->time == (u32_t)(lwip_sys_now + 5)); fail_unless((*list_head)->next->time == (u32_t)(lwip_sys_now + 10)); fail_unless((*list_head)->next->next->time == (u32_t)(lwip_sys_now + 20)); - + /* check timers expire in correct order */ memset(&fired, 0, sizeof(fired)); diff --git a/components/net/lwip-2.1.2/test/unit/lwipopts.h b/components/net/lwip-2.1.2/test/unit/lwipopts.h index 7f077d21db..c00ace1561 100644 --- a/components/net/lwip-2.1.2/test/unit/lwipopts.h +++ b/components/net/lwip-2.1.2/test/unit/lwipopts.h @@ -1,8 +1,8 @@ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, @@ -11,21 +11,21 @@ * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. - * + * * Author: Simon Goldschmidt * */ diff --git a/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c b/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c index feaa3e5df1..8689b71ac8 100644 --- a/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c +++ b/components/net/lwip-2.1.2/test/unit/tcp/tcp_helper.c @@ -151,13 +151,13 @@ tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, const ip_addr_t* local_ /* @todo: are these all states? */ /* @todo: remove from previous list */ pcb->state = state; - + iss = tcp_next_iss(pcb); pcb->snd_wl2 = iss; pcb->snd_nxt = iss; pcb->lastack = iss; pcb->snd_lbb = iss; - + if (state == ESTABLISHED) { TCP_REG(&tcp_active_pcbs, pcb); ip_addr_copy(pcb->local_ip, *local_ip); diff --git a/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c b/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c index 941e4f42d9..c7f85f6a16 100644 --- a/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c +++ b/components/net/lwip-2.1.2/test/unit/tcp/test_tcp.c @@ -524,7 +524,7 @@ START_TEST(test_tcp_fast_retx_recover) EXPECT_RET(pcb->dupacks == 3); memset(&txcounters, 0, sizeof(txcounters)); /* @todo: check expected data?*/ - + /* send data5, not output yet */ err = tcp_write(pcb, data5, sizeof(data5), TCP_WRITE_FLAG_COPY); EXPECT_RET(err == ERR_OK); @@ -1263,7 +1263,7 @@ static void test_tcp_rto_timeout_impl(int link_down) /* check our pcb is no longer active */ for (cur = tcp_active_pcbs; cur != NULL; cur = cur->next) { EXPECT(cur != pcb); - } + } EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); } @@ -1359,7 +1359,7 @@ static void test_tcp_rto_timeout_syn_sent_impl(int link_down) /* check our pcb is no longer active */ for (cur = tcp_active_pcbs; cur != NULL; cur = cur->next) { EXPECT(cur != pcb); - } + } EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); } @@ -1409,7 +1409,7 @@ static void test_tcp_zwp_timeout_impl(int link_down) EXPECT(err == ERR_OK); err = tcp_output(pcb); EXPECT(err == ERR_OK); - + /* verify segment is in-flight */ EXPECT(pcb->unsent == NULL); check_seqnos(pcb->unacked, 1, seqnos); @@ -1488,7 +1488,7 @@ static void test_tcp_zwp_timeout_impl(int link_down) /* check our pcb is no longer active */ for (cur = tcp_active_pcbs; cur != NULL; cur = cur->next) { EXPECT(cur != pcb); - } + } EXPECT_RET(MEMP_STATS_GET(used, MEMP_TCP_PCB) == 0); } -- cgit v1.3.1 From 67e3282aec47fbc3add3424220f9832d83835073 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 11 Mar 2021 15:18:32 +0800 Subject: [ab32vg1] 增加看门狗溢出时间å®�定义 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/bluetrum/libraries/hal_drivers/drv_wdt.c | 34 +++++++++++++++------------- bsp/bluetrum/libraries/hal_drivers/drv_wdt.h | 23 +++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 bsp/bluetrum/libraries/hal_drivers/drv_wdt.h diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c b/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c index fc2bc0279b..423b4d1f60 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c @@ -12,6 +12,8 @@ #ifdef RT_USING_WDT +#include + // #define DRV_DEBUG #define LOG_TAG "drv.wdt" #include @@ -49,35 +51,35 @@ static rt_err_t wdt_control(rt_watchdog_t *wdt, int cmd, void *arg) switch (*((rt_uint32_t *)arg)) { - case 0: + case AB32_WDT_TIMEOUT_1MS: LOG_I("The watchdog timeout is set to 1ms"); tmp |= (0xa << 24) | (0x00 << 20); break; - case 1: + case AB32_WDT_TIMEOUT_256MS: LOG_I("The watchdog timeout is set to 256ms"); tmp |= (0xa << 24) | (0x01 << 20); break; - case 2: + case AB32_WDT_TIMEOUT_512MS: LOG_I("The watchdog timeout is set to 512ms"); tmp |= (0xa << 24) | (0x02 << 20); break; - case 3: + case AB32_WDT_TIMEOUT_1024MS: LOG_I("The watchdog timeout is set to 1024ms"); tmp |= (0xa << 24) | (0x03 << 20); break; - case 4: + case AB32_WDT_TIMEOUT_2048MS: LOG_I("The watchdog timeout is set to 2048ms"); tmp |= (0xa << 24) | (0x04 << 20); break; - case 5: + case AB32_WDT_TIMEOUT_4096MS: LOG_I("The watchdog timeout is set to 4096ms"); tmp |= (0xa << 24) | (0x05 << 20); break; - case 6: + case AB32_WDT_TIMEOUT_8192MS: LOG_I("The watchdog timeout is set to 8192ms"); tmp |= (0xa << 24) | (0x06 << 20); break; - case 7: + case AB32_WDT_TIMEOUT_16384MS: LOG_I("The watchdog timeout is set to 16384ms"); tmp |= (0xa << 24) | (0x07 << 20); break; @@ -92,28 +94,28 @@ static rt_err_t wdt_control(rt_watchdog_t *wdt, int cmd, void *arg) case RT_DEVICE_CTRL_WDT_GET_TIMEOUT: switch ((WDTCON >> 20) & 0x7) { - case 0: + case AB32_WDT_TIMEOUT_1MS: LOG_D("The watchdog timeout is set to 1ms"); break; - case 1: + case AB32_WDT_TIMEOUT_256MS: LOG_D("The watchdog timeout is set to 256ms"); break; - case 2: + case AB32_WDT_TIMEOUT_512MS: LOG_D("The watchdog timeout is set to 512ms"); break; - case 3: + case AB32_WDT_TIMEOUT_1024MS: LOG_D("The watchdog timeout is set to 1024ms"); break; - case 4: + case AB32_WDT_TIMEOUT_2048MS: LOG_D("The watchdog timeout is set to 2048ms"); break; - case 5: + case AB32_WDT_TIMEOUT_4096MS: LOG_D("The watchdog timeout is set to 4096ms"); break; - case 6: + case AB32_WDT_TIMEOUT_8192MS: LOG_D("The watchdog timeout is set to 8192ms"); break; - case 7: + case AB32_WDT_TIMEOUT_16384MS: LOG_D("The watchdog timeout is set to 16384ms"); break; default: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_wdt.h b/bsp/bluetrum/libraries/hal_drivers/drv_wdt.h new file mode 100644 index 0000000000..5f8d61aaff --- /dev/null +++ b/bsp/bluetrum/libraries/hal_drivers/drv_wdt.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020-2021, Bluetrum Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-03-11 Meco Man first version + */ + +#ifndef DRV_WDT_H__ +#define DRV_WDT_H__ + +#define AB32_WDT_TIMEOUT_1MS 0 +#define AB32_WDT_TIMEOUT_256MS 1 +#define AB32_WDT_TIMEOUT_512MS 2 +#define AB32_WDT_TIMEOUT_1024MS 3 +#define AB32_WDT_TIMEOUT_2048MS 4 +#define AB32_WDT_TIMEOUT_4096MS 5 +#define AB32_WDT_TIMEOUT_8192MS 6 +#define AB32_WDT_TIMEOUT_16384MS 7 + +#endif -- cgit v1.3.1 From 1a06e7ec272fa1d3fee35ff8853895df379db309 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 11 Mar 2021 15:19:36 +0800 Subject: [ab32] update readme --- bsp/bluetrum/ab32vg1-ab-prougen/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/README.md b/bsp/bluetrum/ab32vg1-ab-prougen/README.md index 6f24c84c46..7826256285 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/README.md +++ b/bsp/bluetrum/ab32vg1-ab-prougen/README.md @@ -94,13 +94,12 @@ msh > æ­¤ BSP 默认å�ªå¼€å�¯äº† GPIO å’Œ 串å�£0 的功能,如果需使用 SD å�¡ã€�Flash 等更多高级功能,需è¦�利用 ENV 工具对BSP 进行é…�置,步骤如下: 1. 在 bsp 下打开 env 工具。 - 2. 输入`menuconfig`命令é…�置工程,é…�置好之å�Žä¿�存退出。 - 3. 输入`pkgs --update`命令更新软件包。 - 4. 输入`scons` 命令é‡�新编译工程。 +更多细节请å�‚è§�使用指å�—:https://ab32vg1-example.readthedocs.io/zh/latest/introduction.html + ## 注æ„�事项 波特率默认为 1.5M,需è¦�使用 [Downloader](https://github.com/BLUETRUM/Downloader) 下载 `.dcf` 到芯片,需è¦�编译å�Žè‡ªåŠ¨ä¸‹è½½ï¼Œéœ€è¦�在 `Downloader` 中的下载的下拉窗中选择 `自动`;目å‰�暂时å±�蔽 uart1 打å�° -- cgit v1.3.1 From bc606f9a782a53a7658fe4878fe33a68a8ed4eff Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Thu, 11 Mar 2021 15:42:22 +0800 Subject: Delete rmtx.c --- components/libc/compilers/dlib/rmtx.c | 60 ----------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 components/libc/compilers/dlib/rmtx.c diff --git a/components/libc/compilers/dlib/rmtx.c b/components/libc/compilers/dlib/rmtx.c deleted file mode 100644 index 66c3f9377d..0000000000 --- a/components/libc/compilers/dlib/rmtx.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2015-01-28 Bernard first version - */ -#include -#include - -/* - * for IAR compiler, we recommand to define _DLIB_THREAD_SUPPORT - * as 2 for dlib multi-thread support. - */ - -#if _DLIB_THREAD_SUPPORT -typedef void* _Rmtx; -void _Mtxinit(_Rmtx *m) -{ - rt_mutex_t mutex; - - RT_ASSERT(m != RT_NULL); - - mutex = (rt_mutex_t)m; - rt_mutex_init(mutex, "iarMtx", RT_IPC_FLAG_FIFO); -} - -void _Mtxdst(_Rmtx *m) -{ - rt_mutex_t mutex; - - RT_ASSERT(m != RT_NULL); - - mutex = (rt_mutex_t)m; - rt_mutex_detach(mutex); -} - -void _Mtxlock(_Rmtx *m) -{ - rt_mutex_t mutex; - - RT_ASSERT(m != RT_NULL); - - mutex = (rt_mutex_t)m; - rt_mutex_take(mutex, RT_WAITING_FOREVER); -} - -void _Mtxunlock(_Rmtx *m) -{ - rt_mutex_t mutex; - - RT_ASSERT(m != RT_NULL); - - mutex = (rt_mutex_t)m; - rt_mutex_release(mutex); -} -#endif - -- cgit v1.3.1 From 29d11a6d0d45c60498506003bdcd9e4b5b969472 Mon Sep 17 00:00:00 2001 From: yangjie Date: Thu, 11 Mar 2021 16:47:15 +0800 Subject: [components][dfs] remove jffs2 and uffs --- components/dfs/Kconfig | 37 - components/dfs/filesystems/jffs2/SConscript | 50 - .../dfs/filesystems/jffs2/cyg/compress/ChangeLog | 218 -- .../jffs2/cyg/compress/cdl/compress_zlib.cdl | 170 -- .../filesystems/jffs2/cyg/compress/include/zconf.h | 349 ---- .../filesystems/jffs2/cyg/compress/include/zlib.h | 1358 ------------ .../filesystems/jffs2/cyg/compress/src/ChangeLog | 854 -------- .../dfs/filesystems/jffs2/cyg/compress/src/FAQ | 339 --- .../dfs/filesystems/jffs2/cyg/compress/src/INDEX | 51 - .../jffs2/cyg/compress/src/Make_vms.com | 461 ----- .../filesystems/jffs2/cyg/compress/src/Makefile | 154 -- .../filesystems/jffs2/cyg/compress/src/Makefile.in | 154 -- .../jffs2/cyg/compress/src/Makefile.riscos | 151 -- .../dfs/filesystems/jffs2/cyg/compress/src/README | 125 -- .../filesystems/jffs2/cyg/compress/src/README.eCos | 27 - .../filesystems/jffs2/cyg/compress/src/adler32.c | 153 -- .../jffs2/cyg/compress/src/algorithm.txt | 209 -- .../filesystems/jffs2/cyg/compress/src/compress.c | 83 - .../filesystems/jffs2/cyg/compress/src/configure | 459 ----- .../filesystems/jffs2/cyg/compress/src/deflate.c | 1736 ---------------- .../filesystems/jffs2/cyg/compress/src/deflate.h | 331 --- .../filesystems/jffs2/cyg/compress/src/descrip.mms | 48 - .../filesystems/jffs2/cyg/compress/src/example.c | 565 ----- .../dfs/filesystems/jffs2/cyg/compress/src/gzio.c | 1026 --------- .../filesystems/jffs2/cyg/compress/src/infback.c | 623 ------ .../filesystems/jffs2/cyg/compress/src/infblock.c | 403 ---- .../filesystems/jffs2/cyg/compress/src/infblock.h | 39 - .../filesystems/jffs2/cyg/compress/src/inffast.c | 318 --- .../filesystems/jffs2/cyg/compress/src/inffast.h | 11 - .../filesystems/jffs2/cyg/compress/src/inffixed.h | 94 - .../filesystems/jffs2/cyg/compress/src/inflate.c | 1368 ------------ .../filesystems/jffs2/cyg/compress/src/inflate.h | 115 -- .../filesystems/jffs2/cyg/compress/src/inftrees.c | 329 --- .../filesystems/jffs2/cyg/compress/src/inftrees.h | 55 - .../filesystems/jffs2/cyg/compress/src/infutil.c | 87 - .../filesystems/jffs2/cyg/compress/src/infutil.h | 98 - .../filesystems/jffs2/cyg/compress/src/maketree.c | 85 - .../filesystems/jffs2/cyg/compress/src/minigzip.c | 322 --- .../dfs/filesystems/jffs2/cyg/compress/src/trees.c | 1219 ----------- .../dfs/filesystems/jffs2/cyg/compress/src/trees.h | 128 -- .../filesystems/jffs2/cyg/compress/src/uncompr.c | 65 - .../dfs/filesystems/jffs2/cyg/compress/src/zlib.3 | 159 -- .../dfs/filesystems/jffs2/cyg/compress/src/zutil.c | 318 --- .../dfs/filesystems/jffs2/cyg/compress/src/zutil.h | 276 --- .../filesystems/jffs2/cyg/compress/tests/zlib1.c | 232 --- .../filesystems/jffs2/cyg/compress/tests/zlib2.c | 307 --- .../dfs/filesystems/jffs2/cyg/compress/zconf.h | 358 ---- .../dfs/filesystems/jffs2/cyg/compress/zlib.h | 1358 ------------ components/dfs/filesystems/jffs2/cyg/crc/crc.h | 105 - components/dfs/filesystems/jffs2/cyg/crc/crc16.c | 104 - components/dfs/filesystems/jffs2/cyg/crc/crc32.c | 166 -- .../dfs/filesystems/jffs2/cyg/crc/posix_crc.c | 116 -- .../dfs/filesystems/jffs2/cyg/fileio/fileio.h | 489 ----- .../dfs/filesystems/jffs2/cyg/hal/basetype.h | 91 - components/dfs/filesystems/jffs2/cyg/hal/drv_api.h | 250 --- .../dfs/filesystems/jffs2/cyg/infra/cyg_type.h | 544 ----- components/dfs/filesystems/jffs2/dfs_jffs2.c | 687 ------- components/dfs/filesystems/jffs2/dfs_jffs2.h | 14 - .../dfs/filesystems/jffs2/include/linux/jffs2.h | 229 --- .../filesystems/jffs2/include/linux/jffs2_fs_i.h | 50 - .../filesystems/jffs2/include/linux/jffs2_fs_sb.h | 120 -- .../dfs/filesystems/jffs2/include/port/codes.h | 99 - .../dfs/filesystems/jffs2/include/port/fcntl.h | 31 - .../dfs/filesystems/jffs2/include/port/sys/stat.h | 294 --- .../dfs/filesystems/jffs2/include/port/sys/types.h | 90 - components/dfs/filesystems/jffs2/jffs2_config.h | 53 - .../dfs/filesystems/jffs2/kernel/asm/atomic.h | 10 - components/dfs/filesystems/jffs2/kernel/asm/bug.h | 6 - components/dfs/filesystems/jffs2/kernel/asm/page.h | 12 - .../dfs/filesystems/jffs2/kernel/asm/semaphore.h | 120 -- components/dfs/filesystems/jffs2/kernel/linux/TODO | 11 - .../dfs/filesystems/jffs2/kernel/linux/compiler.h | 7 - .../filesystems/jffs2/kernel/linux/completion.h | 13 - .../dfs/filesystems/jffs2/kernel/linux/config.h | 12 - .../dfs/filesystems/jffs2/kernel/linux/crc32.h | 8 - .../dfs/filesystems/jffs2/kernel/linux/errno.h | 2 - components/dfs/filesystems/jffs2/kernel/linux/fs.h | 6 - .../dfs/filesystems/jffs2/kernel/linux/init.h | 3 - .../dfs/filesystems/jffs2/kernel/linux/kernel.h | 38 - .../dfs/filesystems/jffs2/kernel/linux/list.h | 147 -- .../filesystems/jffs2/kernel/linux/mtd/compatmac.h | 5 - .../dfs/filesystems/jffs2/kernel/linux/mtd/mtd.h | 5 - .../dfs/filesystems/jffs2/kernel/linux/pagemap.h | 19 - .../dfs/filesystems/jffs2/kernel/linux/rbtree.h | 62 - .../dfs/filesystems/jffs2/kernel/linux/rwsem.h | 20 - .../dfs/filesystems/jffs2/kernel/linux/sched.h | 7 - .../dfs/filesystems/jffs2/kernel/linux/slab.h | 14 - .../dfs/filesystems/jffs2/kernel/linux/spinlock.h | 43 - .../dfs/filesystems/jffs2/kernel/linux/stat.h | 12 - .../dfs/filesystems/jffs2/kernel/linux/string.h | 6 - .../dfs/filesystems/jffs2/kernel/linux/timer.h | 15 - .../dfs/filesystems/jffs2/kernel/linux/types.h | 9 - .../dfs/filesystems/jffs2/kernel/linux/version.h | 6 - .../dfs/filesystems/jffs2/kernel/linux/vmalloc.h | 3 - .../dfs/filesystems/jffs2/kernel/linux/wait.h | 21 - .../dfs/filesystems/jffs2/kernel/linux/workqueue.h | 18 - .../dfs/filesystems/jffs2/kernel/linux/zlib.h | 15 - .../dfs/filesystems/jffs2/kernel/linux/zutil.h | 6 - components/dfs/filesystems/jffs2/kernel/rbtree.c | 408 ---- components/dfs/filesystems/jffs2/porting.c | 29 - components/dfs/filesystems/jffs2/porting.h | 51 - components/dfs/filesystems/jffs2/src/LICENCE | 35 - components/dfs/filesystems/jffs2/src/build.c | 371 ---- components/dfs/filesystems/jffs2/src/compr.c | 457 ---- components/dfs/filesystems/jffs2/src/compr.h | 107 - components/dfs/filesystems/jffs2/src/compr_rtime.c | 156 -- components/dfs/filesystems/jffs2/src/compr_rubin.c | 427 ---- components/dfs/filesystems/jffs2/src/compr_rubin.h | 21 - components/dfs/filesystems/jffs2/src/compr_zlib.c | 246 --- components/dfs/filesystems/jffs2/src/debug.c | 711 ------- components/dfs/filesystems/jffs2/src/debug.h | 276 --- components/dfs/filesystems/jffs2/src/dir-ecos.c | 369 ---- components/dfs/filesystems/jffs2/src/dir.txt | 70 - components/dfs/filesystems/jffs2/src/erase.c | 469 ----- components/dfs/filesystems/jffs2/src/flashio.c | 151 -- components/dfs/filesystems/jffs2/src/fs-ecos.c | 2174 -------------------- components/dfs/filesystems/jffs2/src/gc.c | 1271 ------------ components/dfs/filesystems/jffs2/src/gcthread.c | 274 --- components/dfs/filesystems/jffs2/src/histo.h | 3 - components/dfs/filesystems/jffs2/src/histo_mips.h | 2 - components/dfs/filesystems/jffs2/src/malloc-ecos.c | 163 -- components/dfs/filesystems/jffs2/src/nodelist.c | 534 ----- components/dfs/filesystems/jffs2/src/nodelist.h | 415 ---- components/dfs/filesystems/jffs2/src/nodemgmt.c | 680 ------ components/dfs/filesystems/jffs2/src/os-ecos.h | 265 --- components/dfs/filesystems/jffs2/src/os-rtthread.h | 263 --- components/dfs/filesystems/jffs2/src/pushpull.h | 72 - components/dfs/filesystems/jffs2/src/read.c | 223 -- components/dfs/filesystems/jffs2/src/readinode.c | 895 -------- components/dfs/filesystems/jffs2/src/scan.c | 946 --------- components/dfs/filesystems/jffs2/src/write.c | 702 ------- components/dfs/filesystems/uffs/AUTHORS | 1 - components/dfs/filesystems/uffs/CMakeLists.txt | 27 - components/dfs/filesystems/uffs/COPYING | 339 --- components/dfs/filesystems/uffs/Doxyfile | 275 --- components/dfs/filesystems/uffs/README | 275 --- components/dfs/filesystems/uffs/SConscript | 38 - components/dfs/filesystems/uffs/TODO | 5 - components/dfs/filesystems/uffs/dfs_uffs.c | 660 ------ components/dfs/filesystems/uffs/dfs_uffs.h | 89 - .../filesystems/uffs/doc/Understanding-UFFS.odp | Bin 369408 -> 0 bytes .../filesystems/uffs/doc/Understanding-UFFS.pdf | Bin 326206 -> 0 bytes .../uffs/doc/uffs-serial-num-relationship.JPG | Bin 26858 -> 0 bytes components/dfs/filesystems/uffs/src/CMakeLists.txt | 7 - .../dfs/filesystems/uffs/src/emu/CMakeLists.txt | 24 - components/dfs/filesystems/uffs/src/emu/cmdline.c | 643 ------ components/dfs/filesystems/uffs/src/emu/cmdline.h | 83 - .../dfs/filesystems/uffs/src/emu/helper_cmds.c | 694 ------- .../dfs/filesystems/uffs/src/emu/test_cmds.c | 1186 ----------- .../dfs/filesystems/uffs/src/emu/uffs_fileem.c | 113 - .../dfs/filesystems/uffs/src/emu/uffs_fileem.h | 88 - .../filesystems/uffs/src/emu/uffs_fileem_ecc_hw.c | 236 --- .../uffs/src/emu/uffs_fileem_ecc_hw_auto.c | 356 ---- .../uffs/src/emu/uffs_fileem_ecc_soft.c | 212 -- .../filesystems/uffs/src/emu/uffs_fileem_share.c | 232 --- .../filesystems/uffs/src/emu/uffs_fileem_wrap.c | 311 --- .../filesystems/uffs/src/example/CMakeLists.txt | 22 - .../uffs/src/example/flash-interface-example.c | 434 ---- .../uffs/src/example/static-mem-allocate.c | 163 -- .../dfs/filesystems/uffs/src/inc/uffs/uffs.h | 101 - .../filesystems/uffs/src/inc/uffs/uffs_badblock.h | 75 - .../filesystems/uffs/src/inc/uffs/uffs_blockinfo.h | 107 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_buf.h | 178 -- .../dfs/filesystems/uffs/src/inc/uffs/uffs_core.h | 59 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_crc.h | 46 - .../filesystems/uffs/src/inc/uffs/uffs_device.h | 211 -- .../dfs/filesystems/uffs/src/inc/uffs/uffs_ecc.h | 89 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_fd.h | 151 -- .../dfs/filesystems/uffs/src/inc/uffs/uffs_find.h | 76 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_flash.h | 311 --- .../dfs/filesystems/uffs/src/inc/uffs/uffs_fs.h | 138 -- .../dfs/filesystems/uffs/src/inc/uffs/uffs_mem.h | 83 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_mtb.h | 96 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_os.h | 75 - .../dfs/filesystems/uffs/src/inc/uffs/uffs_pool.h | 94 - .../filesystems/uffs/src/inc/uffs/uffs_public.h | 336 --- .../dfs/filesystems/uffs/src/inc/uffs/uffs_tree.h | 237 --- .../dfs/filesystems/uffs/src/inc/uffs/uffs_types.h | 160 -- .../dfs/filesystems/uffs/src/inc/uffs/uffs_utils.h | 64 - .../filesystems/uffs/src/inc/uffs/uffs_version.h | 55 - .../filesystems/uffs/src/platform/CMakeLists.txt | 13 - .../uffs/src/platform/posix/uffs_config.h | 322 --- .../filesystems/uffs/src/platform/posix/uffs_os.c | 148 -- .../uffs/src/platform/win32/uffs_config.h | 317 --- .../filesystems/uffs/src/platform/win32/uffs_os.c | 148 -- .../dfs/filesystems/uffs/src/uffs/CMakeLists.txt | 59 - .../dfs/filesystems/uffs/src/uffs/uffs_badblock.c | 249 --- .../dfs/filesystems/uffs/src/uffs/uffs_blockinfo.c | 413 ---- .../dfs/filesystems/uffs/src/uffs/uffs_buf.c | 1799 ---------------- .../dfs/filesystems/uffs/src/uffs/uffs_crc.c | 93 - .../dfs/filesystems/uffs/src/uffs/uffs_debug.c | 188 -- .../dfs/filesystems/uffs/src/uffs/uffs_device.c | 93 - .../dfs/filesystems/uffs/src/uffs/uffs_ecc.c | 384 ---- components/dfs/filesystems/uffs/src/uffs/uffs_fd.c | 746 ------- .../dfs/filesystems/uffs/src/uffs/uffs_find.c | 378 ---- .../dfs/filesystems/uffs/src/uffs/uffs_flash.c | 1034 ---------- components/dfs/filesystems/uffs/src/uffs/uffs_fs.c | 1944 ----------------- .../dfs/filesystems/uffs/src/uffs/uffs_init.c | 204 -- .../dfs/filesystems/uffs/src/uffs/uffs_mem.c | 92 - .../dfs/filesystems/uffs/src/uffs/uffs_mtb.c | 366 ---- .../dfs/filesystems/uffs/src/uffs/uffs_pool.c | 386 ---- .../dfs/filesystems/uffs/src/uffs/uffs_public.c | 448 ---- .../dfs/filesystems/uffs/src/uffs/uffs_tree.c | 1278 ------------ .../dfs/filesystems/uffs/src/uffs/uffs_utils.c | 402 ---- .../dfs/filesystems/uffs/src/uffs/uffs_version.c | 73 - .../dfs/filesystems/uffs/src/utils/CMakeLists.txt | 20 - components/dfs/filesystems/uffs/src/utils/mkuffs.c | 493 ----- .../filesystems/uffs/tools/chomp_uffs_perror.rb | 25 - .../dfs/filesystems/uffs/tools/format_code.rb | 24 - .../dfs/filesystems/uffs/tools/make_package.sh | 3 - components/dfs/filesystems/uffs/uffs_config.h | 322 --- components/dfs/filesystems/uffs/uffs_nandif.c | 359 ---- components/dfs/filesystems/uffs/uffs_rtthread.c | 158 -- 213 files changed, 57160 deletions(-) delete mode 100644 components/dfs/filesystems/jffs2/SConscript delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/ChangeLog delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/cdl/compress_zlib.cdl delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/include/zconf.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/include/zlib.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/ChangeLog delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/FAQ delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/INDEX delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/Make_vms.com delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/Makefile delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.in delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.riscos delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/README delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/README.eCos delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/adler32.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/algorithm.txt delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/compress.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/configure delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/deflate.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/deflate.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/descrip.mms delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/example.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/gzio.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/infback.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/infblock.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/infblock.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inffast.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inffast.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inffixed.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inflate.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inflate.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/infutil.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/infutil.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/maketree.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/minigzip.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/trees.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/trees.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/uncompr.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/zlib.3 delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/zutil.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/src/zutil.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/tests/zlib1.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/tests/zlib2.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/zconf.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/compress/zlib.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/crc/crc.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/crc/crc16.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/crc/crc32.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/crc/posix_crc.c delete mode 100644 components/dfs/filesystems/jffs2/cyg/fileio/fileio.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/hal/basetype.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/hal/drv_api.h delete mode 100644 components/dfs/filesystems/jffs2/cyg/infra/cyg_type.h delete mode 100644 components/dfs/filesystems/jffs2/dfs_jffs2.c delete mode 100644 components/dfs/filesystems/jffs2/dfs_jffs2.h delete mode 100644 components/dfs/filesystems/jffs2/include/linux/jffs2.h delete mode 100644 components/dfs/filesystems/jffs2/include/linux/jffs2_fs_i.h delete mode 100644 components/dfs/filesystems/jffs2/include/linux/jffs2_fs_sb.h delete mode 100644 components/dfs/filesystems/jffs2/include/port/codes.h delete mode 100644 components/dfs/filesystems/jffs2/include/port/fcntl.h delete mode 100644 components/dfs/filesystems/jffs2/include/port/sys/stat.h delete mode 100644 components/dfs/filesystems/jffs2/include/port/sys/types.h delete mode 100644 components/dfs/filesystems/jffs2/jffs2_config.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/asm/atomic.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/asm/bug.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/asm/page.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/asm/semaphore.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/TODO delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/compiler.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/completion.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/config.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/crc32.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/errno.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/fs.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/init.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/kernel.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/list.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/mtd/compatmac.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/mtd/mtd.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/pagemap.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/rbtree.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/rwsem.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/sched.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/slab.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/spinlock.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/stat.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/string.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/timer.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/types.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/version.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/vmalloc.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/wait.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/workqueue.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/zlib.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/linux/zutil.h delete mode 100644 components/dfs/filesystems/jffs2/kernel/rbtree.c delete mode 100644 components/dfs/filesystems/jffs2/porting.c delete mode 100644 components/dfs/filesystems/jffs2/porting.h delete mode 100644 components/dfs/filesystems/jffs2/src/LICENCE delete mode 100644 components/dfs/filesystems/jffs2/src/build.c delete mode 100644 components/dfs/filesystems/jffs2/src/compr.c delete mode 100644 components/dfs/filesystems/jffs2/src/compr.h delete mode 100644 components/dfs/filesystems/jffs2/src/compr_rtime.c delete mode 100644 components/dfs/filesystems/jffs2/src/compr_rubin.c delete mode 100644 components/dfs/filesystems/jffs2/src/compr_rubin.h delete mode 100644 components/dfs/filesystems/jffs2/src/compr_zlib.c delete mode 100644 components/dfs/filesystems/jffs2/src/debug.c delete mode 100644 components/dfs/filesystems/jffs2/src/debug.h delete mode 100644 components/dfs/filesystems/jffs2/src/dir-ecos.c delete mode 100644 components/dfs/filesystems/jffs2/src/dir.txt delete mode 100644 components/dfs/filesystems/jffs2/src/erase.c delete mode 100644 components/dfs/filesystems/jffs2/src/flashio.c delete mode 100644 components/dfs/filesystems/jffs2/src/fs-ecos.c delete mode 100644 components/dfs/filesystems/jffs2/src/gc.c delete mode 100644 components/dfs/filesystems/jffs2/src/gcthread.c delete mode 100644 components/dfs/filesystems/jffs2/src/histo.h delete mode 100644 components/dfs/filesystems/jffs2/src/histo_mips.h delete mode 100644 components/dfs/filesystems/jffs2/src/malloc-ecos.c delete mode 100644 components/dfs/filesystems/jffs2/src/nodelist.c delete mode 100644 components/dfs/filesystems/jffs2/src/nodelist.h delete mode 100644 components/dfs/filesystems/jffs2/src/nodemgmt.c delete mode 100644 components/dfs/filesystems/jffs2/src/os-ecos.h delete mode 100644 components/dfs/filesystems/jffs2/src/os-rtthread.h delete mode 100644 components/dfs/filesystems/jffs2/src/pushpull.h delete mode 100644 components/dfs/filesystems/jffs2/src/read.c delete mode 100644 components/dfs/filesystems/jffs2/src/readinode.c delete mode 100644 components/dfs/filesystems/jffs2/src/scan.c delete mode 100644 components/dfs/filesystems/jffs2/src/write.c delete mode 100644 components/dfs/filesystems/uffs/AUTHORS delete mode 100644 components/dfs/filesystems/uffs/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/COPYING delete mode 100644 components/dfs/filesystems/uffs/Doxyfile delete mode 100644 components/dfs/filesystems/uffs/README delete mode 100644 components/dfs/filesystems/uffs/SConscript delete mode 100644 components/dfs/filesystems/uffs/TODO delete mode 100644 components/dfs/filesystems/uffs/dfs_uffs.c delete mode 100644 components/dfs/filesystems/uffs/dfs_uffs.h delete mode 100644 components/dfs/filesystems/uffs/doc/Understanding-UFFS.odp delete mode 100644 components/dfs/filesystems/uffs/doc/Understanding-UFFS.pdf delete mode 100644 components/dfs/filesystems/uffs/doc/uffs-serial-num-relationship.JPG delete mode 100644 components/dfs/filesystems/uffs/src/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/src/emu/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/src/emu/cmdline.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/cmdline.h delete mode 100644 components/dfs/filesystems/uffs/src/emu/helper_cmds.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/test_cmds.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem.h delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw_auto.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_soft.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem_share.c delete mode 100644 components/dfs/filesystems/uffs/src/emu/uffs_fileem_wrap.c delete mode 100644 components/dfs/filesystems/uffs/src/example/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/src/example/flash-interface-example.c delete mode 100644 components/dfs/filesystems/uffs/src/example/static-mem-allocate.c delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_badblock.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_blockinfo.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_buf.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_core.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_crc.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_device.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_ecc.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_fd.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_find.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_flash.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_fs.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_mem.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_mtb.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_os.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_pool.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_public.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_tree.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_types.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_utils.h delete mode 100644 components/dfs/filesystems/uffs/src/inc/uffs/uffs_version.h delete mode 100644 components/dfs/filesystems/uffs/src/platform/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/src/platform/posix/uffs_config.h delete mode 100644 components/dfs/filesystems/uffs/src/platform/posix/uffs_os.c delete mode 100644 components/dfs/filesystems/uffs/src/platform/win32/uffs_config.h delete mode 100644 components/dfs/filesystems/uffs/src/platform/win32/uffs_os.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_badblock.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_blockinfo.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_buf.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_crc.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_debug.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_device.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_ecc.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_fd.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_find.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_flash.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_fs.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_init.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_mem.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_mtb.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_pool.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_public.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_tree.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_utils.c delete mode 100644 components/dfs/filesystems/uffs/src/uffs/uffs_version.c delete mode 100644 components/dfs/filesystems/uffs/src/utils/CMakeLists.txt delete mode 100644 components/dfs/filesystems/uffs/src/utils/mkuffs.c delete mode 100644 components/dfs/filesystems/uffs/tools/chomp_uffs_perror.rb delete mode 100644 components/dfs/filesystems/uffs/tools/format_code.rb delete mode 100644 components/dfs/filesystems/uffs/tools/make_package.sh delete mode 100644 components/dfs/filesystems/uffs/uffs_config.h delete mode 100644 components/dfs/filesystems/uffs/uffs_nandif.c delete mode 100644 components/dfs/filesystems/uffs/uffs_rtthread.c diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig index c6b493f0d2..3d70820173 100644 --- a/components/dfs/Kconfig +++ b/components/dfs/Kconfig @@ -140,43 +140,6 @@ if RT_USING_DFS select RT_USING_MEMHEAP default n - config RT_USING_DFS_UFFS - bool "Enable UFFS file system: Ultra-low-cost Flash File System" - select RT_USING_MTD_NAND - default n - - if RT_USING_DFS_UFFS - choice - prompt "UFFS ECC mode" - default RT_UFFS_ECC_MODE_1 - - config RT_UFFS_ECC_MODE_0 - bool "0: Do not use ECC" - - config RT_UFFS_ECC_MODE_1 - bool "1: UFFS calculate the ECC" - - config RT_UFFS_ECC_MODE_2 - bool "2: Flash driver(or by hardware) calculate the ECC" - - config RT_UFFS_ECC_MODE_3 - bool "3: Hardware calculate the ECC and automatically write to spare." - endchoice - - config RT_UFFS_ECC_MODE - int - default 0 if RT_UFFS_ECC_MODE_0 - default 1 if RT_UFFS_ECC_MODE_1 - default 2 if RT_UFFS_ECC_MODE_2 - default 3 if RT_UFFS_ECC_MODE_3 - - endif - - config RT_USING_DFS_JFFS2 - bool "Enable JFFS2 file system" - select RT_USING_MTD_NOR - default n - config RT_USING_DFS_NFS bool "Using NFS v3 client file system" depends on RT_USING_LWIP diff --git a/components/dfs/filesystems/jffs2/SConscript b/components/dfs/filesystems/jffs2/SConscript deleted file mode 100644 index 47854393e3..0000000000 --- a/components/dfs/filesystems/jffs2/SConscript +++ /dev/null @@ -1,50 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() -src = Split(''' -dfs_jffs2.c -porting.c - -cyg/compress/src/adler32.c -cyg/compress/src/compress.c -cyg/compress/src/deflate.c -cyg/compress/src/infback.c -cyg/compress/src/inffast.c -cyg/compress/src/inflate.c -cyg/compress/src/inftrees.c -cyg/compress/src/trees.c -cyg/compress/src/uncompr.c -cyg/compress/src/zutil.c - -cyg/crc/crc16.c -cyg/crc/crc32.c -cyg/crc/posix_crc.c -kernel/rbtree.c -src/build.c -src/compr.c -src/compr_rtime.c -src/compr_rubin.c -src/compr_zlib.c -src/debug.c -src/dir-ecos.c -src/erase.c -src/flashio.c -src/fs-ecos.c -src/gc.c -src/gcthread.c -src/malloc-ecos.c -src/nodelist.c -src/nodemgmt.c -src/read.c -src/readinode.c -src/scan.c -src/write.c -''') - -CPPPATH = [cwd, cwd + '/include', cwd + '/src', cwd + '/cyg', cwd + '/kernel', cwd + '/cyg/compress'] - -group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_JFFS2'], CPPPATH = CPPPATH) - -Return('group') diff --git a/components/dfs/filesystems/jffs2/cyg/compress/ChangeLog b/components/dfs/filesystems/jffs2/cyg/compress/ChangeLog deleted file mode 100644 index 295e5cdd48..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/ChangeLog +++ /dev/null @@ -1,218 +0,0 @@ -2009-03-09 John Dallaway - - * cdl/compress_zlib.cdl: Reference test executable filenames for - compatibility with the eCos Configuration Tool. - -2005-10-16 Peter Korsgaard - - * cdl/compress_zlib.cdl (CYGFUN_COMPRESS_ZLIB_GZIO): New option to - include zlib stdio-like utility functions. - -2005-07-27 Peter Korsgaard - - * src/ChangeLog: - * src/configure: - * src/deflate.c: - * src/deflate.h: - * src/FAQ: - * src/gzio.c: - * src/Make_vms.com: - * src/adler32.c: - * src/compress.c: - * src/example.c: - * src/minigzip.c: - * src/infback.c: - * src/inffast.c: - * src/inflate.c: - * src/inflate.h: - * src/inftrees.c: - * src/inftrees.h: - * src/Makefile: - * src/Makefile.in: - * src/README: - * src/README.eCos: - * src/trees.c: - * src/zlib.3: - * src/zutil.c: - * src/zutil.h: - * include/zlib.h: - * include/zconf.h: Upgrade to zlib-1.2.3 - -2005-06-28 Peter Korsgaard - - * src/ChangeLog: - * src/configure: - * src/deflate.c: - * src/deflate.h: - * src/FAQ: - * src/gzio.c: - * src/INDEX: - * src/infback.c: - * src/inffast.c: - * src/inflate.c: - * src/Makefile: - * src/Makefile.in: - * src/README: - * src/trees.c: - * src/zlib.3: - * src/zutil.h: - * include/zlib.h: - * include/zconf.h: Upgrade to zlib-1.2.2 - -2005-03-27 Andrew Lunn - - * tests/zlib1.c: Include diag.h for diag_printf proto. - -2004-05-25 Gary Thomas - - * src/zutil.h: Fix redefine of 'crc32' - - * include/zconf.h: Force define of __ECOS__ to make it easier for - applications to use this library. Also define Z_PREFIX to minimize - namespace pollution. !CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP now - implies NO_GZCOMPRESS and NO_GZIP. - -2004-05-24 Gary Thomas - - * tests/zlib2.c: - * tests/zlib1.c: - * src/zutil.h: - * src/zutil.c: - * src/zlib.3: - * src/uncompr.c: - * src/trees.c: - * src/minigzip.c: - * src/inftrees.h: - * src/inftrees.c: - * src/inflate.h: - * src/inflate.c: - * src/inffixed.h: - * src/inffast.h: - * src/inffast.c: - * src/infback.c: - * src/gzio.c: - * src/example.c: - * src/deflate.h: - * src/deflate.c: - * src/configure: - * src/compress.c: - * src/algorithm.txt: - * src/adler32.c: - * src/README.eCos: - * src/README: - * src/Makefile.in: - * src/Makefile: - * src/INDEX: - * src/FAQ: - * include/zlib.h: - * include/zconf.h: - * cdl/compress_zlib.cdl: Upgrade to zlib-1.2.1 - -2004-04-29 Oyvind Harboe - - * src/inffixed.h: added "const" to tables that do not - change in order to save RAM. Ca. 4k. - -2003-11-20 Andrew Lunn - - * tests/zlib[12].c: Modified the text to the gcc3.3 friendly. - -2003-11-13 Daniel Néri - - * Upgrade to zlib 1.1.4 and additional fix for inflate bug on - machines with 16-bit pointers. - -2003-09-08 Thomas Koeller - - * cdl/compress_zlib.cdl : Displayed package name was wrong. - -2002-10-10 Andrew Lunn - - * include/zutil.h: - * include/zlib.h: - * src/inflate.c (inflate): Use the CRC function from the CRC - package. - * src/crc32.c: Removed. - -2002-09-09 Mark Salter - - * inflate.c (inflate): Fix CRC calculation over multiple invocations - with same output buffer. - -2002-02-18 Jesper Skov - - * src/infblock.c: Applied fix for double-free which could cause a - zlib crash. Fixed indentation. - -2001-10-15 Gary Thomas - - * include/zconf.h: - * cdl/compress_zlib.cdl: - Define new interface CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC which allows - users of this code (applications) to provide their own allocators. - -2001-04-02 Jesper Skov - - * tests/zlib2.c: Removed BAD_CRC state. - -2001-03-12 Jesper Skov - - * src/inflate.c: Remove BAD_CRC state. Do separate CRC for - gzippped data. - * include/zlib.h: Removed Z_BAD_CRC hack. Rename crc32 function. - * src/crc32.c: Include zlib.h header from - include/cyg/compress. Rename function. - * cdl/compress_zlib.cdl: Build the crc32.c file. - -2001-03-09 Jesper Skov - - * src/compress.c: Include zlib.h header from include/cyg/compress. - * src/uncompr.c: Same. - * tests/zlib1.c: Added. - * tests/zlib2.c: Added. - * cdl/compress_zlib.cdl: Compile tests. Compile - files holding compress/uncompress functions. - - * cdl/compress_zlib.cdl: Don't warn about prototypes when building. - -2001-03-08 Jesper Skov - - * cdl/compress_zlib.cdl: Add isoinfra requirement. - - * include/zconf.h: Override STDC check. - - * include/zlib.h: Added new BAD_CRC return type. Comment out crc32 - declaration. - - * src/inflate.c: Added additional states to allow for gzip header - decoding. - - * src/adler32.c: Include zlib.h header from include/cyg/compress. - * src/zutil.h: Same. - - * Import zlib 1.1.3 sources, but leave out some sub - directories. See src/README.eCos for details. - -//=========================================================================== -// ####GPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 or (at your option) any -// later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., 51 Franklin Street, -// Fifth Floor, Boston, MA 02110-1301, USA. -// ------------------------------------------- -// ####GPLCOPYRIGHTEND#### -//=========================================================================== diff --git a/components/dfs/filesystems/jffs2/cyg/compress/cdl/compress_zlib.cdl b/components/dfs/filesystems/jffs2/cyg/compress/cdl/compress_zlib.cdl deleted file mode 100644 index d5787570b7..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/cdl/compress_zlib.cdl +++ /dev/null @@ -1,170 +0,0 @@ -# ==================================================================== -# -# compress_zlib.cdl -# -# Zlib compress/decompress configuration data -# -# ==================================================================== -## ####ECOSGPLCOPYRIGHTBEGIN#### -## ------------------------------------------- -## This file is part of eCos, the Embedded Configurable Operating System. -## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. -## -## eCos is free software; you can redistribute it and/or modify it under -## the terms of the GNU General Public License as published by the Free -## Software Foundation; either version 2 or (at your option) any later -## version. -## -## eCos is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with eCos; if not, write to the Free Software Foundation, Inc., -## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -## -## As a special exception, if other files instantiate templates or use -## macros or inline functions from this file, or you compile this file -## and link it with other works to produce a work based on this file, -## this file does not by itself cause the resulting work to be covered by -## the GNU General Public License. However the source code for this file -## must still be made available in accordance with section (3) of the GNU -## General Public License v2. -## -## This exception does not invalidate any other reasons why a work based -## on this file might be covered by the GNU General Public License. -## ------------------------------------------- -## ####ECOSGPLCOPYRIGHTEND#### -# ==================================================================== -######DESCRIPTIONBEGIN#### -# -# Author(s): jskov -# Contributors: -# Date: 2001-03-06 -# -#####DESCRIPTIONEND#### -# -# ==================================================================== - -cdl_package CYGPKG_COMPRESS_ZLIB { - display "Zlib compress and decompress package" - description " - This package provides support for compression and - decompression." - include_dir cyg/compress - - requires CYGPKG_ISOINFRA - requires CYGPKG_CRC - - compile adler32.c compress.c uncompr.c zutil.c trees.c - compile deflate.c infback.c inffast.c inflate.c inftrees.c - - cdl_interface CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC { - display "Override memory allocation routines." - } - - cdl_option CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP { - display "Should deflate() produce 'gzip' compatible output?" - flavor bool - default_value 1 - description " - If this option is set then the output of calling deflate() - will be wrapped up as a 'gzip' compatible file." - } - - cdl_option CYGSEM_COMPRESS_ZLIB_NEEDS_MALLOC { - display "Does this library need malloc?" - flavor bool - active_if { CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC == 0 } - requires CYGPKG_MEMALLOC - no_define - default_value 1 - description " - This pseudo-option will force the memalloc library to be - required iff the application does not provide it's own - infrastructure." - } - - cdl_option CYGFUN_COMPRESS_ZLIB_GZIO { - display "Include stdio-like utility functions" - flavor bool - requires CYGINT_ISO_STDIO_FILEPOS - requires CYGINT_ISO_STRING_STRFUNCS - requires CYGINT_ISO_STDIO_FORMATTED_IO - requires CYGINT_ISO_STDIO_FILEACCESS - default_value { CYGPKG_LIBC_STDIO_OPEN ? 1 : 0 } - compile gzio.c - description " - This option enables the stdio-like zlib utility functions - (gzread/gzwrite and friends) provided in gzio.c." - } - - -# ==================================================================== - - cdl_component CYGPKG_COMPRESS_ZLIB_OPTIONS { - display "Zlib compress and decompress package build options" - flavor none - no_define - description " - Package specific build options including control over - compiler flags used only in building this package, - and details of which tests are built." - - cdl_option CYGPKG_COMPRESS_ZLIB_CFLAGS_ADD { - display "Additional compiler flags" - flavor data - no_define - default_value { "-D__ECOS__ -DNO_ERRNO_H" } - description " - This option modifies the set of compiler flags for - building this package. These flags are used in addition - to the set of global flags." - } - - cdl_option CYGPKG_COMPRESS_ZLIB_CFLAGS_REMOVE { - display "Suppressed compiler flags" - flavor data - no_define - default_value { "-Wstrict-prototypes" } - description " - This option modifies the set of compiler flags for - building this package. These flags are removed from - the set of global flags if present." - } - - cdl_option CYGPKG_COMPRESS_ZLIB_LDFLAGS_ADD { - display "Additional compiler flags" - flavor data - no_define - default_value { "" } - description " - This option modifies the set of compiler flags for - building this package. These flags are used in addition - to the set of global flags." - } - - cdl_option CYGPKG_COMPRESS_ZLIB_LDFLAGS_REMOVE { - display "Suppressed compiler flags" - flavor data - no_define - default_value { "" } - description " - This option modifies the set of compiler flags for - building this package. These flags are removed from - the set of global flags if present." - } - - } - - cdl_option CYGPKG_COMPRESS_ZLIB_TESTS { - display "zlib tests" - flavor data - no_define - calculated { "tests/zlib1 tests/zlib2" } - } -} - -# ==================================================================== -# EOF compress_zlib.cdl diff --git a/components/dfs/filesystems/jffs2/cyg/compress/include/zconf.h b/components/dfs/filesystems/jffs2/cyg/compress/include/zconf.h deleted file mode 100644 index 09608dcc34..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/include/zconf.h +++ /dev/null @@ -1,349 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -// #ifdef __ECOS__ -#undef __ECOS__ -#define __ECOS__ -#define Z_PREFIX -#include -#if CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC != 0 -#define MY_ZCALLOC -#endif -#ifdef CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP -#undef MAX_WBITS -#define MAX_WBITS 15+16 /* 32K LZ77 window */ -#else -#define NO_GZIP -#define NO_GZCOMPRESS -#endif -// #endif - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/include/zlib.h b/components/dfs/filesystems/jffs2/cyg/compress/include/zlib.h deleted file mode 100644 index 081e7c912f..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/include/zlib.h +++ /dev/null @@ -1,1358 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -#ifndef __ECOS__ -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ -#endif // __ECOS__ - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_stream FAR *strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/ChangeLog b/components/dfs/filesystems/jffs2/cyg/compress/src/ChangeLog deleted file mode 100644 index dfdd0295e8..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/ChangeLog +++ /dev/null @@ -1,854 +0,0 @@ - ChangeLog file for zlib - -Changes in 1.2.2 (3 October 2004) -Changes in 1.2.3 (18 July 2005) -- Apply security vulnerability fixes to contrib/infback9 as well -- Clean up some text files (carriage returns, trailing space) -- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant] - -Changes in 1.2.2.4 (11 July 2005) -- Add inflatePrime() function for starting inflation at bit boundary -- Avoid some Visual C warnings in deflate.c -- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit - compile -- Fix some spelling errors in comments [Betts] -- Correct inflateInit2() error return documentation in zlib.h -- Added zran.c example of compressed data random access to examples - directory, shows use of inflatePrime() -- Fix cast for assignments to strm->state in inflate.c and infback.c -- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] -- Move declarations of gf2 functions to right place in crc32.c [Oberhumer] -- Add cast in trees.c t avoid a warning [Oberhumer] -- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer] -- Update make_vms.com [Zinser] -- Initialize state->write in inflateReset() since copied in inflate_fast() -- Be more strict on incomplete code sets in inflate_table() and increase - ENOUGH and MAXD -- this repairs a possible security vulnerability for - invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for - discovering the vulnerability and providing test cases. -- Add ia64 support to configure for HP-UX [Smith] -- Add error return to gzread() for format or i/o error [Levin] -- Use malloc.h for OS/2 [Necasek] - -Changes in 1.2.2.3 (27 May 2005) -- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile -- Typecast fread() return values in gzio.c [Vollant] -- Remove trailing space in minigzip.c outmode (VC++ can't deal with it) -- Fix crc check bug in gzread() after gzungetc() [Heiner] -- Add the deflateTune() function to adjust internal compression parameters -- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack) -- Remove an incorrect assertion in examples/zpipe.c -- Add C++ wrapper in infback9.h [Donais] -- Fix bug in inflateCopy() when decoding fixed codes -- Note in zlib.h how much deflateSetDictionary() actually uses -- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used) -- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer] -- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer] -- Add gzdirect() function to indicate transparent reads -- Update contrib/minizip [Vollant] -- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer] -- Add casts in crc32.c to avoid warnings [Oberhumer] -- Add contrib/masmx64 [Vollant] -- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant] - -Changes in 1.2.2.2 (30 December 2004) -- Replace structure assignments in deflate.c and inflate.c with zmemcpy to - avoid implicit memcpy calls (portability for no-library compilation) -- Increase sprintf() buffer size in gzdopen() to allow for large numbers -- Add INFLATE_STRICT to check distances against zlib header -- Improve WinCE errno handling and comments [Chang] -- Remove comment about no gzip header processing in FAQ -- Add Z_FIXED strategy option to deflateInit2() to force fixed trees -- Add updated make_vms.com [Coghlan], update README -- Create a new "examples" directory, move gzappend.c there, add zpipe.c, - fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html. -- Add FAQ entry and comments in deflate.c on uninitialized memory access -- Add Solaris 9 make options in configure [Gilbert] -- Allow strerror() usage in gzio.c for STDC -- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer] -- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant] -- Use z_off_t for adler32_combine() and crc32_combine() lengths -- Make adler32() much faster for small len -- Use OS_CODE in deflate() default gzip header - -Changes in 1.2.2.1 (31 October 2004) -- Allow inflateSetDictionary() call for raw inflate -- Fix inflate header crc check bug for file names and comments -- Add deflateSetHeader() and gz_header structure for custom gzip headers -- Add inflateGetheader() to retrieve gzip headers -- Add crc32_combine() and adler32_combine() functions -- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list -- Use zstreamp consistently in zlib.h (inflate_back functions) -- Remove GUNZIP condition from definition of inflate_mode in inflate.h - and in contrib/inflate86/inffast.S [Truta, Anderson] -- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson] -- Update projects/README.projects and projects/visualc6 [Truta] -- Update win32/DLL_FAQ.txt [Truta] -- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta] -- Deprecate Z_ASCII; use Z_TEXT instead [Truta] -- Use a new algorithm for setting strm->data_type in trees.c [Truta] -- Do not define an exit() prototype in zutil.c unless DEBUG defined -- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta] -- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate() -- Fix Darwin build version identification [Peterson] - -- Update zlib.h comments on gzip in-memory processing -- Set adler to 1 in inflateReset() to support Java test suite [Walles] -- Add contrib/dotzlib [Ravn] -- Update win32/DLL_FAQ.txt [Truta] -- Update contrib/minizip [Vollant] -- Move contrib/visual-basic.txt to old/ [Truta] -- Fix assembler builds in projects/visualc6/ [Truta] - -Changes in 1.2.1.2 (9 September 2004) -- Update INDEX file -- Fix trees.c to update strm->data_type (no one ever noticed!) -- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown] -- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE) -- Add limited multitasking protection to DYNAMIC_CRC_TABLE -- Add NO_vsnprintf for VMS in zutil.h [Mozilla] -- Don't declare strerror() under VMS [Mozilla] -- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize -- Update contrib/ada [Anisimkov] -- Update contrib/minizip [Vollant] -- Fix configure to not hardcode directories for Darwin [Peterson] -- Fix gzio.c to not return error on empty files [Brown] -- Fix indentation; update version in contrib/delphi/ZLib.pas and - contrib/pascal/zlibpas.pas [Truta] -- Update mkasm.bat in contrib/masmx86 [Truta] -- Update contrib/untgz [Truta] -- Add projects/README.projects [Truta] -- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta] -- Update win32/DLL_FAQ.txt [Truta] -- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta] -- Remove an unnecessary assignment to curr in inftrees.c [Truta] -- Add OS/2 to exe builds in configure [Poltorak] -- Remove err dummy parameter in zlib.h [Kientzle] - -Changes in 1.2.1.1 (9 January 2004) -- Update email address in README -- Several FAQ updates -- Fix a big fat bug in inftrees.c that prevented decoding valid - dynamic blocks with only literals and no distance codes -- - Thanks to "Hot Emu" for the bug report and sample file -- Add a note to puff.c on no distance codes case. - -Changes in 1.2.1 (17 November 2003) -- Remove a tab in contrib/gzappend/gzappend.c -- Update some interfaces in contrib for new zlib functions -- Update zlib version number in some contrib entries -- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta] -- Support shared libraries on Hurd and KFreeBSD [Brown] -- Fix error in NO_DIVIDE option of adler32.c - -Changes in 1.2.0.8 (4 November 2003) -- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas -- Add experimental NO_DIVIDE #define in adler32.c - - Possibly faster on some processors (let me know if it is) -- Correct Z_BLOCK to not return on first inflate call if no wrap -- Fix strm->data_type on inflate() return to correctly indicate EOB -- Add deflatePrime() function for appending in the middle of a byte -- Add contrib/gzappend for an example of appending to a stream -- Update win32/DLL_FAQ.txt [Truta] -- Delete Turbo C comment in README [Truta] -- Improve some indentation in zconf.h [Truta] -- Fix infinite loop on bad input in configure script [Church] -- Fix gzeof() for concatenated gzip files [Johnson] -- Add example to contrib/visual-basic.txt [Michael B.] -- Add -p to mkdir's in Makefile.in [vda] -- Fix configure to properly detect presence or lack of printf functions -- Add AS400 support [Monnerat] -- Add a little Cygwin support [Wilson] - -Changes in 1.2.0.7 (21 September 2003) -- Correct some debug formats in contrib/infback9 -- Cast a type in a debug statement in trees.c -- Change search and replace delimiter in configure from % to # [Beebe] -- Update contrib/untgz to 0.2 with various fixes [Truta] -- Add build support for Amiga [Nikl] -- Remove some directories in old that have been updated to 1.2 -- Add dylib building for Mac OS X in configure and Makefile.in -- Remove old distribution stuff from Makefile -- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X -- Update links in README - -Changes in 1.2.0.6 (13 September 2003) -- Minor FAQ updates -- Update contrib/minizip to 1.00 [Vollant] -- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta] -- Update POSTINC comment for 68060 [Nikl] -- Add contrib/infback9 with deflate64 decoding (unsupported) -- For MVS define NO_vsnprintf and undefine FAR [van Burik] -- Add pragma for fdopen on MVS [van Burik] - -Changes in 1.2.0.5 (8 September 2003) -- Add OF to inflateBackEnd() declaration in zlib.h -- Remember start when using gzdopen in the middle of a file -- Use internal off_t counters in gz* functions to properly handle seeks -- Perform more rigorous check for distance-too-far in inffast.c -- Add Z_BLOCK flush option to return from inflate at block boundary -- Set strm->data_type on return from inflate - - Indicate bits unused, if at block boundary, and if in last block -- Replace size_t with ptrdiff_t in crc32.c, and check for correct size -- Add condition so old NO_DEFLATE define still works for compatibility -- FAQ update regarding the Windows DLL [Truta] -- INDEX update: add qnx entry, remove aix entry [Truta] -- Install zlib.3 into mandir [Wilson] -- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta] -- Adapt the zlib interface to the new DLL convention guidelines [Truta] -- Introduce ZLIB_WINAPI macro to allow the export of functions using - the WINAPI calling convention, for Visual Basic [Vollant, Truta] -- Update msdos and win32 scripts and makefiles [Truta] -- Export symbols by name, not by ordinal, in win32/zlib.def [Truta] -- Add contrib/ada [Anisimkov] -- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta] -- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant] -- Add contrib/masm686 [Truta] -- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm - [Truta, Vollant] -- Update contrib/delphi; rename to contrib/pascal; add example [Truta] -- Remove contrib/delphi2; add a new contrib/delphi [Truta] -- Avoid inclusion of the nonstandard in contrib/iostream, - and fix some method prototypes [Truta] -- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip - [Truta] -- Avoid the use of backslash (\) in contrib/minizip [Vollant] -- Fix file time handling in contrib/untgz; update makefiles [Truta] -- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines - [Vollant] -- Remove contrib/vstudio/vc15_16 [Vollant] -- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta] -- Update README.contrib [Truta] -- Invert the assignment order of match_head and s->prev[...] in - INSERT_STRING [Truta] -- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings - [Truta] -- Compare function pointers with 0, not with NULL or Z_NULL [Truta] -- Fix prototype of syncsearch in inflate.c [Truta] -- Introduce ASMINF macro to be enabled when using an ASM implementation - of inflate_fast [Truta] -- Change NO_DEFLATE to NO_GZCOMPRESS [Truta] -- Modify test_gzio in example.c to take a single file name as a - parameter [Truta] -- Exit the example.c program if gzopen fails [Truta] -- Add type casts around strlen in example.c [Truta] -- Remove casting to sizeof in minigzip.c; give a proper type - to the variable compared with SUFFIX_LEN [Truta] -- Update definitions of STDC and STDC99 in zconf.h [Truta] -- Synchronize zconf.h with the new Windows DLL interface [Truta] -- Use SYS16BIT instead of __32BIT__ to distinguish between - 16- and 32-bit platforms [Truta] -- Use far memory allocators in small 16-bit memory models for - Turbo C [Truta] -- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in - zlibCompileFlags [Truta] -- Cygwin has vsnprintf [Wilson] -- In Windows16, OS_CODE is 0, as in MSDOS [Truta] -- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson] - -Changes in 1.2.0.4 (10 August 2003) -- Minor FAQ updates -- Be more strict when checking inflateInit2's windowBits parameter -- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well -- Add gzip wrapper option to deflateInit2 using windowBits -- Add updated QNX rule in configure and qnx directory [Bonnefoy] -- Make inflate distance-too-far checks more rigorous -- Clean up FAR usage in inflate -- Add casting to sizeof() in gzio.c and minigzip.c - -Changes in 1.2.0.3 (19 July 2003) -- Fix silly error in gzungetc() implementation [Vollant] -- Update contrib/minizip and contrib/vstudio [Vollant] -- Fix printf format in example.c -- Correct cdecl support in zconf.in.h [Anisimkov] -- Minor FAQ updates - -Changes in 1.2.0.2 (13 July 2003) -- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons -- Attempt to avoid warnings in crc32.c for pointer-int conversion -- Add AIX to configure, remove aix directory [Bakker] -- Add some casts to minigzip.c -- Improve checking after insecure sprintf() or vsprintf() calls -- Remove #elif's from crc32.c -- Change leave label to inf_leave in inflate.c and infback.c to avoid - library conflicts -- Remove inflate gzip decoding by default--only enable gzip decoding by - special request for stricter backward compatibility -- Add zlibCompileFlags() function to return compilation information -- More typecasting in deflate.c to avoid warnings -- Remove leading underscore from _Capital #defines [Truta] -- Fix configure to link shared library when testing -- Add some Windows CE target adjustments [Mai] -- Remove #define ZLIB_DLL in zconf.h [Vollant] -- Add zlib.3 [Rodgers] -- Update RFC URL in deflate.c and algorithm.txt [Mai] -- Add zlib_dll_FAQ.txt to contrib [Truta] -- Add UL to some constants [Truta] -- Update minizip and vstudio [Vollant] -- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h -- Expand use of NO_DUMMY_DECL to avoid all dummy structures -- Added iostream3 to contrib [Schwardt] -- Replace rewind() with fseek() for WinCE [Truta] -- Improve setting of zlib format compression level flags - - Report 0 for huffman and rle strategies and for level == 0 or 1 - - Report 2 only for level == 6 -- Only deal with 64K limit when necessary at compile time [Truta] -- Allow TOO_FAR check to be turned off at compile time [Truta] -- Add gzclearerr() function [Souza] -- Add gzungetc() function - -Changes in 1.2.0.1 (17 March 2003) -- Add Z_RLE strategy for run-length encoding [Truta] - - When Z_RLE requested, restrict matches to distance one - - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE -- Correct FASTEST compilation to allow level == 0 -- Clean up what gets compiled for FASTEST -- Incorporate changes to zconf.in.h [Vollant] - - Refine detection of Turbo C need for dummy returns - - Refine ZLIB_DLL compilation - - Include additional header file on VMS for off_t typedef -- Try to use _vsnprintf where it supplants vsprintf [Vollant] -- Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to - write more than 4095 bytes before compression -- Remove unused state from inflateBackEnd() -- Remove exit(0) from minigzip.c, example.c -- Get rid of all those darn tabs -- Add "check" target to Makefile.in that does the same thing as "test" -- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in -- Update contrib/inflate86 [Anderson] -- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant] -- Add msdos and win32 directories with makefiles [Truta] -- More additions and improvements to the FAQ - -Changes in 1.2.0 (9 March 2003) -- New and improved inflate code - - About 20% faster - - Does not allocate 32K window unless and until needed - - Automatically detects and decompresses gzip streams - - Raw inflate no longer needs an extra dummy byte at end - - Added inflateBack functions using a callback interface--even faster - than inflate, useful for file utilities (gzip, zip) - - Added inflateCopy() function to record state for random access on - externally generated deflate streams (e.g. in gzip files) - - More readable code (I hope) -- New and improved crc32() - - About 50% faster, thanks to suggestions from Rodney Brown -- Add deflateBound() and compressBound() functions -- Fix memory leak in deflateInit2() -- Permit setting dictionary for raw deflate (for parallel deflate) -- Fix const declaration for gzwrite() -- Check for some malloc() failures in gzio.c -- Fix bug in gzopen() on single-byte file 0x1f -- Fix bug in gzread() on concatenated file with 0x1f at end of buffer - and next buffer doesn't start with 0x8b -- Fix uncompress() to return Z_DATA_ERROR on truncated input -- Free memory at end of example.c -- Remove MAX #define in trees.c (conflicted with some libraries) -- Fix static const's in deflate.c, gzio.c, and zutil.[ch] -- Declare malloc() and free() in gzio.c if STDC not defined -- Use malloc() instead of calloc() in zutil.c if int big enough -- Define STDC for AIX -- Add aix/ with approach for compiling shared library on AIX -- Add HP-UX support for shared libraries in configure -- Add OpenUNIX support for shared libraries in configure -- Use $cc instead of gcc to build shared library -- Make prefix directory if needed when installing -- Correct Macintosh avoidance of typedef Byte in zconf.h -- Correct Turbo C memory allocation when under Linux -- Use libz.a instead of -lz in Makefile (assure use of compiled library) -- Update configure to check for snprintf or vsnprintf functions and their - return value, warn during make if using an insecure function -- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that - is lost when library is used--resolution is to build new zconf.h -- Documentation improvements (in zlib.h): - - Document raw deflate and inflate - - Update RFCs URL - - Point out that zlib and gzip formats are different - - Note that Z_BUF_ERROR is not fatal - - Document string limit for gzprintf() and possible buffer overflow - - Note requirement on avail_out when flushing - - Note permitted values of flush parameter of inflate() -- Add some FAQs (and even answers) to the FAQ -- Add contrib/inflate86/ for x86 faster inflate -- Add contrib/blast/ for PKWare Data Compression Library decompression -- Add contrib/puff/ simple inflate for deflate format description - -Changes in 1.1.4 (11 March 2002) -- ZFREE was repeated on same allocation on some error conditions. - This creates a security problem described in - http://www.zlib.org/advisory-2002-03-11.txt -- Returned incorrect error (Z_MEM_ERROR) on some invalid data -- Avoid accesses before window for invalid distances with inflate window - less than 32K. -- force windowBits > 8 to avoid a bug in the encoder for a window size - of 256 bytes. (A complete fix will be available in 1.1.5). - -Changes in 1.1.3 (9 July 1998) -- fix "an inflate input buffer bug that shows up on rare but persistent - occasions" (Mark) -- fix gzread and gztell for concatenated .gz files (Didier Le Botlan) -- fix gzseek(..., SEEK_SET) in write mode -- fix crc check after a gzeek (Frank Faubert) -- fix miniunzip when the last entry in a zip file is itself a zip file - (J Lillge) -- add contrib/asm586 and contrib/asm686 (Brian Raiter) - See http://www.muppetlabs.com/~breadbox/software/assembly.html -- add support for Delphi 3 in contrib/delphi (Bob Dellaca) -- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti) -- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren) -- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks) -- added a FAQ file - -- Support gzdopen on Mac with Metrowerks (Jason Linhart) -- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart) -- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young) -- avoid some warnings with Borland C (Tom Tanner) -- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant) -- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant) -- allow several arguments to configure (Tim Mooney, Frodo Looijaard) -- use libdir and includedir in Makefile.in (Tim Mooney) -- support shared libraries on OSF1 V4 (Tim Mooney) -- remove so_locations in "make clean" (Tim Mooney) -- fix maketree.c compilation error (Glenn, Mark) -- Python interface to zlib now in Python 1.5 (Jeremy Hylton) -- new Makefile.riscos (Rich Walker) -- initialize static descriptors in trees.c for embedded targets (Nick Smith) -- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) -- add the OS/2 files in Makefile.in too (Andrew Zabolotny) -- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) -- fix maketree.c to allow clean compilation of inffixed.h (Mark) -- fix parameter check in deflateCopy (Gunther Nikl) -- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) -- Many portability patches by Christian Spieler: - . zutil.c, zutil.h: added "const" for zmem* - . Make_vms.com: fixed some typos - . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists - . msdos/Makefile.msc: remove "default rtl link library" info from obj files - . msdos/Makefile.*: use model-dependent name for the built zlib library - . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc: - new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT) -- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane) -- replace __far with _far for better portability (Christian Spieler, Tom Lane) -- fix test for errno.h in configure (Tim Newsham) - -Changes in 1.1.2 (19 March 98) -- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) - See http://www.winimage.com/zLibDll/unzip.html -- preinitialize the inflate tables for fixed codes, to make the code - completely thread safe (Mark) -- some simplifications and slight speed-up to the inflate code (Mark) -- fix gzeof on non-compressed files (Allan Schrum) -- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) -- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) -- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) -- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) -- do not wrap extern "C" around system includes (Tom Lane) -- mention zlib binding for TCL in README (Andreas Kupries) -- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) -- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) -- allow "configure --prefix $HOME" (Tim Mooney) -- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) -- move Makefile.sas to amiga/Makefile.sas - -Changes in 1.1.1 (27 Feb 98) -- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson) -- remove block truncation heuristic which had very marginal effect for zlib - (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the - compression ratio on some files. This also allows inlining _tr_tally for - matches in deflate_slow. -- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) - -Changes in 1.1.0 (24 Feb 98) -- do not return STREAM_END prematurely in inflate (John Bowler) -- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler) -- compile with -DFASTEST to get compression code optimized for speed only -- in minigzip, try mmap'ing the input file first (Miguel Albrecht) -- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain - on Sun but significant on HP) - -- add a pointer to experimental unzip library in README (Gilles Vollant) -- initialize variable gcc in configure (Chris Herborth) - -Changes in 1.0.9 (17 Feb 1998) -- added gzputs and gzgets functions -- do not clear eof flag in gzseek (Mark Diekhans) -- fix gzseek for files in transparent mode (Mark Diekhans) -- do not assume that vsprintf returns the number of bytes written (Jens Krinke) -- replace EXPORT with ZEXPORT to avoid conflict with other programs -- added compress2 in zconf.h, zlib.def, zlib.dnt -- new asm code from Gilles Vollant in contrib/asm386 -- simplify the inflate code (Mark): - . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new() - . ZALLOC the length list in inflate_trees_fixed() instead of using stack - . ZALLOC the value area for huft_build() instead of using stack - . Simplify Z_FINISH check in inflate() - -- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 -- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) -- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) -- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) -- read_buf buf parameter of type Bytef* instead of charf* -- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) -- do not redeclare unlink in minigzip.c for WIN32 (John Bowler) -- fix check for presence of directories in "make install" (Ian Willis) - -Changes in 1.0.8 (27 Jan 1998) -- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant) -- fix gzgetc and gzputc for big endian systems (Markus Oberhumer) -- added compress2() to allow setting the compression level -- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) -- use constant arrays for the static trees in trees.c instead of computing - them at run time (thanks to Ken Raeburn for this suggestion). To create - trees.h, compile with GEN_TREES_H and run "make test". -- check return code of example in "make test" and display result -- pass minigzip command line options to file_compress -- simplifying code of inflateSync to avoid gcc 2.8 bug - -- support CC="gcc -Wall" in configure -s (QingLong) -- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn) -- fix test for shared library support to avoid compiler warnings -- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant) -- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit) -- do not use fdopen for Metrowerks on Mac (Brad Pettit)) -- add checks for gzputc and gzputc in example.c -- avoid warnings in gzio.c and deflate.c (Andreas Kleinert) -- use const for the CRC table (Ken Raeburn) -- fixed "make uninstall" for shared libraries -- use Tracev instead of Trace in infblock.c -- in example.c use correct compressed length for test_sync -- suppress +vnocompatwarnings in configure for HPUX (not always supported) - -Changes in 1.0.7 (20 Jan 1998) -- fix gzseek which was broken in write mode -- return error for gzseek to negative absolute position -- fix configure for Linux (Chun-Chung Chen) -- increase stack space for MSC (Tim Wegner) -- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant) -- define EXPORTVA for gzprintf (Gilles Vollant) -- added man page zlib.3 (Rick Rodgers) -- for contrib/untgz, fix makedir() and improve Makefile - -- check gzseek in write mode in example.c -- allocate extra buffer for seeks only if gzseek is actually called -- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant) -- add inflateSyncPoint in zconf.h -- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def - -Changes in 1.0.6 (19 Jan 1998) -- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and - gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) -- Fix a deflate bug occurring only with compression level 0 (thanks to - Andy Buckler for finding this one). -- In minigzip, pass transparently also the first byte for .Z files. -- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() -- check Z_FINISH in inflate (thanks to Marc Schluper) -- Implement deflateCopy (thanks to Adam Costello) -- make static libraries by default in configure, add --shared option. -- move MSDOS or Windows specific files to directory msdos -- suppress the notion of partial flush to simplify the interface - (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) -- suppress history buffer provided by application to simplify the interface - (this feature was not implemented anyway in 1.0.4) -- next_in and avail_in must be initialized before calling inflateInit or - inflateInit2 -- add EXPORT in all exported functions (for Windows DLL) -- added Makefile.nt (thanks to Stephen Williams) -- added the unsupported "contrib" directory: - contrib/asm386/ by Gilles Vollant - 386 asm code replacing longest_match(). - contrib/iostream/ by Kevin Ruland - A C++ I/O streams interface to the zlib gz* functions - contrib/iostream2/ by Tyge Løvset - Another C++ I/O streams interface - contrib/untgz/ by "Pedro A. Aranda Guti\irrez" - A very simple tar.gz file extractor using zlib - contrib/visual-basic.txt by Carlos Rios - How to use compress(), uncompress() and the gz* functions from VB. -- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression - level) in minigzip (thanks to Tom Lane) - -- use const for rommable constants in deflate -- added test for gzseek and gztell in example.c -- add undocumented function inflateSyncPoint() (hack for Paul Mackerras) -- add undocumented function zError to convert error code to string - (for Tim Smithers) -- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. -- Use default memcpy for Symantec MSDOS compiler. -- Add EXPORT keyword for check_func (needed for Windows DLL) -- add current directory to LD_LIBRARY_PATH for "make test" -- create also a link for libz.so.1 -- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura) -- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX) -- added -soname for Linux in configure (Chun-Chung Chen, -- assign numbers to the exported functions in zlib.def (for Windows DLL) -- add advice in zlib.h for best usage of deflateSetDictionary -- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn) -- allow compilation with ANSI keywords only enabled for TurboC in large model -- avoid "versionString"[0] (Borland bug) -- add NEED_DUMMY_RETURN for Borland -- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). -- allow compilation with CC -- defined STDC for OS/2 (David Charlap) -- limit external names to 8 chars for MVS (Thomas Lund) -- in minigzip.c, use static buffers only for 16-bit systems -- fix suffix check for "minigzip -d foo.gz" -- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee) -- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) -- added makelcc.bat for lcc-win32 (Tom St Denis) -- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) -- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. -- check for unistd.h in configure (for off_t) -- remove useless check parameter in inflate_blocks_free -- avoid useless assignment of s->check to itself in inflate_blocks_new -- do not flush twice in gzclose (thanks to Ken Raeburn) -- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h -- use NO_ERRNO_H instead of enumeration of operating systems with errno.h -- work around buggy fclose on pipes for HP/UX -- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson) -- fix configure if CC is already equal to gcc - -Changes in 1.0.5 (3 Jan 98) -- Fix inflate to terminate gracefully when fed corrupted or invalid data -- Use const for rommable constants in inflate -- Eliminate memory leaks on error conditions in inflate -- Removed some vestigial code in inflate -- Update web address in README - -Changes in 1.0.4 (24 Jul 96) -- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF - bit, so the decompressor could decompress all the correct data but went - on to attempt decompressing extra garbage data. This affected minigzip too. -- zlibVersion and gzerror return const char* (needed for DLL) -- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) -- use z_error only for DEBUG (avoid problem with DLLs) - -Changes in 1.0.3 (2 Jul 96) -- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS - small and medium models; this makes the library incompatible with previous - versions for these models. (No effect in large model or on other systems.) -- return OK instead of BUF_ERROR if previous deflate call returned with - avail_out as zero but there is nothing to do -- added memcmp for non STDC compilers -- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) -- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) -- better check for 16-bit mode MSC (avoids problem with Symantec) - -Changes in 1.0.2 (23 May 96) -- added Windows DLL support -- added a function zlibVersion (for the DLL support) -- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model) -- Bytef is define's instead of typedef'd only for Borland C -- avoid reading uninitialized memory in example.c -- mention in README that the zlib format is now RFC1950 -- updated Makefile.dj2 -- added algorithm.doc - -Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] -- fix array overlay in deflate.c which sometimes caused bad compressed data -- fix inflate bug with empty stored block -- fix MSDOS medium model which was broken in 0.99 -- fix deflateParams() which could generated bad compressed data. -- Bytef is define'd instead of typedef'ed (work around Borland bug) -- added an INDEX file -- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), - Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) -- speed up adler32 for modern machines without auto-increment -- added -ansi for IRIX in configure -- static_init_done in trees.c is an int -- define unlink as delete for VMS -- fix configure for QNX -- add configure branch for SCO and HPUX -- avoid many warnings (unused variables, dead assignments, etc...) -- no fdopen for BeOS -- fix the Watcom fix for 32 bit mode (define FAR as empty) -- removed redefinition of Byte for MKWERKS -- work around an MWKERKS bug (incorrect merge of all .h files) - -Changes in 0.99 (27 Jan 96) -- allow preset dictionary shared between compressor and decompressor -- allow compression level 0 (no compression) -- add deflateParams in zlib.h: allow dynamic change of compression level - and compression strategy. -- test large buffers and deflateParams in example.c -- add optional "configure" to build zlib as a shared library -- suppress Makefile.qnx, use configure instead -- fixed deflate for 64-bit systems (detected on Cray) -- fixed inflate_blocks for 64-bit systems (detected on Alpha) -- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2) -- always return Z_BUF_ERROR when deflate() has nothing to do -- deflateInit and inflateInit are now macros to allow version checking -- prefix all global functions and types with z_ with -DZ_PREFIX -- make falloc completely reentrant (inftrees.c) -- fixed very unlikely race condition in ct_static_init -- free in reverse order of allocation to help memory manager -- use zlib-1.0/* instead of zlib/* inside the tar.gz -- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith - -Wconversion -Wstrict-prototypes -Wmissing-prototypes" -- allow gzread on concatenated .gz files -- deflateEnd now returns Z_DATA_ERROR if it was premature -- deflate is finally (?) fully deterministic (no matches beyond end of input) -- Document Z_SYNC_FLUSH -- add uninstall in Makefile -- Check for __cpluplus in zlib.h -- Better test in ct_align for partial flush -- avoid harmless warnings for Borland C++ -- initialize hash_head in deflate.c -- avoid warning on fdopen (gzio.c) for HP cc -Aa -- include stdlib.h for STDC compilers -- include errno.h for Cray -- ignore error if ranlib doesn't exist -- call ranlib twice for NeXTSTEP -- use exec_prefix instead of prefix for libz.a -- renamed ct_* as _tr_* to avoid conflict with applications -- clear z->msg in inflateInit2 before any error return -- initialize opaque in example.c, gzio.c, deflate.c and inflate.c -- fixed typo in zconf.h (_GNUC__ => __GNUC__) -- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode) -- fix typo in Make_vms.com (f$trnlnm -> f$getsyi) -- in fcalloc, normalize pointer if size > 65520 bytes -- don't use special fcalloc for 32 bit Borland C++ -- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... -- use Z_BINARY instead of BINARY -- document that gzclose after gzdopen will close the file -- allow "a" as mode in gzopen. -- fix error checking in gzread -- allow skipping .gz extra-field on pipes -- added reference to Perl interface in README -- put the crc table in FAR data (I dislike more and more the medium model :) -- added get_crc_table -- added a dimension to all arrays (Borland C can't count). -- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast -- guard against multiple inclusion of *.h (for precompiled header on Mac) -- Watcom C pretends to be Microsoft C small model even in 32 bit mode. -- don't use unsized arrays to avoid silly warnings by Visual C++: - warning C4746: 'inflate_mask' : unsized array treated as '__far' - (what's wrong with far data in far model?). -- define enum out of inflate_blocks_state to allow compilation with C++ - -Changes in 0.95 (16 Aug 95) -- fix MSDOS small and medium model (now easier to adapt to any compiler) -- inlined send_bits -- fix the final (:-) bug for deflate with flush (output was correct but - not completely flushed in rare occasions). -- default window size is same for compression and decompression - (it's now sufficient to set MAX_WBITS in zconf.h). -- voidp -> voidpf and voidnp -> voidp (for consistency with other - typedefs and because voidnp was not near in large model). - -Changes in 0.94 (13 Aug 95) -- support MSDOS medium model -- fix deflate with flush (could sometimes generate bad output) -- fix deflateReset (zlib header was incorrectly suppressed) -- added support for VMS -- allow a compression level in gzopen() -- gzflush now calls fflush -- For deflate with flush, flush even if no more input is provided. -- rename libgz.a as libz.a -- avoid complex expression in infcodes.c triggering Turbo C bug -- work around a problem with gcc on Alpha (in INSERT_STRING) -- don't use inline functions (problem with some gcc versions) -- allow renaming of Byte, uInt, etc... with #define. -- avoid warning about (unused) pointer before start of array in deflate.c -- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c -- avoid reserved word 'new' in trees.c - -Changes in 0.93 (25 June 95) -- temporarily disable inline functions -- make deflate deterministic -- give enough lookahead for PARTIAL_FLUSH -- Set binary mode for stdin/stdout in minigzip.c for OS/2 -- don't even use signed char in inflate (not portable enough) -- fix inflate memory leak for segmented architectures - -Changes in 0.92 (3 May 95) -- don't assume that char is signed (problem on SGI) -- Clear bit buffer when starting a stored block -- no memcpy on Pyramid -- suppressed inftest.c -- optimized fill_window, put longest_match inline for gcc -- optimized inflate on stored blocks. -- untabify all sources to simplify patches - -Changes in 0.91 (2 May 95) -- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h -- Document the memory requirements in zconf.h -- added "make install" -- fix sync search logic in inflateSync -- deflate(Z_FULL_FLUSH) now works even if output buffer too short -- after inflateSync, don't scare people with just "lo world" -- added support for DJGPP - -Changes in 0.9 (1 May 95) -- don't assume that zalloc clears the allocated memory (the TurboC bug - was Mark's bug after all :) -- let again gzread copy uncompressed data unchanged (was working in 0.71) -- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented -- added a test of inflateSync in example.c -- moved MAX_WBITS to zconf.h because users might want to change that. -- document explicitly that zalloc(64K) on MSDOS must return a normalized - pointer (zero offset) -- added Makefiles for Microsoft C, Turbo C, Borland C++ -- faster crc32() - -Changes in 0.8 (29 April 95) -- added fast inflate (inffast.c) -- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this - is incompatible with previous versions of zlib which returned Z_OK. -- work around a TurboC compiler bug (bad code for b << 0, see infutil.h) - (actually that was not a compiler bug, see 0.81 above) -- gzread no longer reads one extra byte in certain cases -- In gzio destroy(), don't reference a freed structure -- avoid many warnings for MSDOS -- avoid the ERROR symbol which is used by MS Windows - -Changes in 0.71 (14 April 95) -- Fixed more MSDOS compilation problems :( There is still a bug with - TurboC large model. - -Changes in 0.7 (14 April 95) -- Added full inflate support. -- Simplified the crc32() interface. The pre- and post-conditioning - (one's complement) is now done inside crc32(). WARNING: this is - incompatible with previous versions; see zlib.h for the new usage. - -Changes in 0.61 (12 April 95) -- workaround for a bug in TurboC. example and minigzip now work on MSDOS. - -Changes in 0.6 (11 April 95) -- added minigzip.c -- added gzdopen to reopen a file descriptor as gzFile -- added transparent reading of non-gziped files in gzread. -- fixed bug in gzread (don't read crc as data) -- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). -- don't allocate big arrays in the stack (for MSDOS) -- fix some MSDOS compilation problems - -Changes in 0.5: -- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but - not yet Z_FULL_FLUSH. -- support decompression but only in a single step (forced Z_FINISH) -- added opaque object for zalloc and zfree. -- added deflateReset and inflateReset -- added a variable zlib_version for consistency checking. -- renamed the 'filter' parameter of deflateInit2 as 'strategy'. - Added Z_FILTERED and Z_HUFFMAN_ONLY constants. - -Changes in 0.4: -- avoid "zip" everywhere, use zlib instead of ziplib. -- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush - if compression method == 8. -- added adler32 and crc32 -- renamed deflateOptions as deflateInit2, call one or the other but not both -- added the method parameter for deflateInit2. -- added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting - user-provided history buffer. This is supported only in deflateInit2 - and inflateInit2. - -Changes in 0.3: -- prefix all macro names with Z_ -- use Z_FINISH instead of deflateEnd to finish compression. -- added Z_HUFFMAN_ONLY -- added gzerror() diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/FAQ b/components/dfs/filesystems/jffs2/cyg/compress/src/FAQ deleted file mode 100644 index 441d910daa..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/FAQ +++ /dev/null @@ -1,339 +0,0 @@ - - Frequently Asked Questions about zlib - - -If your question is not there, please check the zlib home page -http://www.zlib.org which may have more recent information. -The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html - - - 1. Is zlib Y2K-compliant? - - Yes. zlib doesn't handle dates. - - 2. Where can I get a Windows DLL version? - - The zlib sources can be compiled without change to produce a DLL. - See the file win32/DLL_FAQ.txt in the zlib distribution. - Pointers to the precompiled DLL are found in the zlib web site at - http://www.zlib.org. - - 3. Where can I get a Visual Basic interface to zlib? - - See - * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm - * contrib/visual-basic.txt in the zlib distribution - * win32/DLL_FAQ.txt in the zlib distribution - - 4. compress() returns Z_BUF_ERROR. - - Make sure that before the call of compress, the length of the compressed - buffer is equal to the total size of the compressed buffer and not - zero. For Visual Basic, check that this parameter is passed by reference - ("as any"), not by value ("as long"). - - 5. deflate() or inflate() returns Z_BUF_ERROR. - - Before making the call, make sure that avail_in and avail_out are not - zero. When setting the parameter flush equal to Z_FINISH, also make sure - that avail_out is big enough to allow processing all pending input. - Note that a Z_BUF_ERROR is not fatal--another call to deflate() or - inflate() can be made with more input or output space. A Z_BUF_ERROR - may in fact be unavoidable depending on how the functions are used, since - it is not possible to tell whether or not there is more output pending - when strm.avail_out returns with zero. - - 6. Where's the zlib documentation (man pages, etc.)? - - It's in zlib.h for the moment, and Francis S. Lin has converted it to a - web page zlib.html. Volunteers to transform this to Unix-style man pages, - please contact us (zlib@gzip.org). Examples of zlib usage are in the files - example.c and minigzip.c. - - 7. Why don't you use GNU autoconf or libtool or ...? - - Because we would like to keep zlib as a very small and simple - package. zlib is rather portable and doesn't need much configuration. - - 8. I found a bug in zlib. - - Most of the time, such problems are due to an incorrect usage of - zlib. Please try to reproduce the problem with a small program and send - the corresponding source to us at zlib@gzip.org . Do not send - multi-megabyte data files without prior agreement. - - 9. Why do I get "undefined reference to gzputc"? - - If "make test" produces something like - - example.o(.text+0x154): undefined reference to `gzputc' - - check that you don't have old files libz.* in /usr/lib, /usr/local/lib or - /usr/X11R6/lib. Remove any old versions, then do "make install". - -10. I need a Delphi interface to zlib. - - See the contrib/delphi directory in the zlib distribution. - -11. Can zlib handle .zip archives? - - Not by itself, no. See the directory contrib/minizip in the zlib - distribution. - -12. Can zlib handle .Z files? - - No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt - the code of uncompress on your own. - -13. How can I make a Unix shared library? - - make clean - ./configure -s - make - -14. How do I install a shared zlib library on Unix? - - After the above, then: - - make install - - However, many flavors of Unix come with a shared zlib already installed. - Before going to the trouble of compiling a shared version of zlib and - trying to install it, you may want to check if it's already there! If you - can #include , it's there. The -lz option will probably link to it. - -15. I have a question about OttoPDF. - - We are not the authors of OttoPDF. The real author is on the OttoPDF web - site: Joel Hainley, jhainley@myndkryme.com. - -16. Can zlib decode Flate data in an Adobe PDF file? - - Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . - To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . - -17. Why am I getting this "register_frame_info not found" error on Solaris? - - After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib - generates an error such as: - - ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: - symbol __register_frame_info: referenced symbol not found - - The symbol __register_frame_info is not part of zlib, it is generated by - the C compiler (cc or gcc). You must recompile applications using zlib - which have this problem. This problem is specific to Solaris. See - http://www.sunfreeware.com for Solaris versions of zlib and applications - using zlib. - -18. Why does gzip give an error on a file I make with compress/deflate? - - The compress and deflate functions produce data in the zlib format, which - is different and incompatible with the gzip format. The gz* functions in - zlib on the other hand use the gzip format. Both the zlib and gzip - formats use the same compressed data format internally, but have different - headers and trailers around the compressed data. - -19. Ok, so why are there two different formats? - - The gzip format was designed to retain the directory information about - a single file, such as the name and last modification date. The zlib - format on the other hand was designed for in-memory and communication - channel applications, and has a much more compact header and trailer and - uses a faster integrity check than gzip. - -20. Well that's nice, but how do I make a gzip file in memory? - - You can request that deflate write the gzip format instead of the zlib - format using deflateInit2(). You can also request that inflate decode - the gzip format using inflateInit2(). Read zlib.h for more details. - -21. Is zlib thread-safe? - - Yes. However any library routines that zlib uses and any application- - provided memory allocation routines must also be thread-safe. zlib's gz* - functions use stdio library routines, and most of zlib's functions use the - library memory allocation routines by default. zlib's Init functions allow - for the application to provide custom memory allocation routines. - - Of course, you should only operate on any given zlib or gzip stream from a - single thread at a time. - -22. Can I use zlib in my commercial application? - - Yes. Please read the license in zlib.h. - -23. Is zlib under the GNU license? - - No. Please read the license in zlib.h. - -24. The license says that altered source versions must be "plainly marked". So - what exactly do I need to do to meet that requirement? - - You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In - particular, the final version number needs to be changed to "f", and an - identification string should be appended to ZLIB_VERSION. Version numbers - x.x.x.f are reserved for modifications to zlib by others than the zlib - maintainers. For example, if the version of the base zlib you are altering - is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and - ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also - update the version strings in deflate.c and inftrees.c. - - For altered source distributions, you should also note the origin and - nature of the changes in zlib.h, as well as in ChangeLog and README, along - with the dates of the alterations. The origin should include at least your - name (or your company's name), and an email address to contact for help or - issues with the library. - - Note that distributing a compiled zlib library along with zlib.h and - zconf.h is also a source distribution, and so you should change - ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes - in zlib.h as you would for a full source distribution. - -25. Will zlib work on a big-endian or little-endian architecture, and can I - exchange compressed data between them? - - Yes and yes. - -26. Will zlib work on a 64-bit machine? - - It should. It has been tested on 64-bit machines, and has no dependence - on any data types being limited to 32-bits in length. If you have any - difficulties, please provide a complete problem report to zlib@gzip.org - -27. Will zlib decompress data from the PKWare Data Compression Library? - - No. The PKWare DCL uses a completely different compressed data format - than does PKZIP and zlib. However, you can look in zlib's contrib/blast - directory for a possible solution to your problem. - -28. Can I access data randomly in a compressed stream? - - No, not without some preparation. If when compressing you periodically - use Z_FULL_FLUSH, carefully write all the pending data at those points, - and keep an index of those locations, then you can start decompression - at those points. You have to be careful to not use Z_FULL_FLUSH too - often, since it can significantly degrade compression. - -29. Does zlib work on MVS, OS/390, CICS, etc.? - - We don't know for sure. We have heard occasional reports of success on - these systems. If you do use it on one of these, please provide us with - a report, instructions, and patches that we can reference when we get - these questions. Thanks. - -30. Is there some simpler, easier to read version of inflate I can look at - to understand the deflate format? - - First off, you should read RFC 1951. Second, yes. Look in zlib's - contrib/puff directory. - -31. Does zlib infringe on any patents? - - As far as we know, no. In fact, that was originally the whole point behind - zlib. Look here for some more information: - - http://www.gzip.org/#faq11 - -32. Can zlib work with greater than 4 GB of data? - - Yes. inflate() and deflate() will process any amount of data correctly. - Each call of inflate() or deflate() is limited to input and output chunks - of the maximum value that can be stored in the compiler's "unsigned int" - type, but there is no limit to the number of chunks. Note however that the - strm.total_in and strm_total_out counters may be limited to 4 GB. These - counters are provided as a convenience and are not used internally by - inflate() or deflate(). The application can easily set up its own counters - updated after each call of inflate() or deflate() to count beyond 4 GB. - compress() and uncompress() may be limited to 4 GB, since they operate in a - single call. gzseek() and gztell() may be limited to 4 GB depending on how - zlib is compiled. See the zlibCompileFlags() function in zlib.h. - - The word "may" appears several times above since there is a 4 GB limit - only if the compiler's "long" type is 32 bits. If the compiler's "long" - type is 64 bits, then the limit is 16 exabytes. - -33. Does zlib have any security vulnerabilities? - - The only one that we are aware of is potentially in gzprintf(). If zlib - is compiled to use sprintf() or vsprintf(), then there is no protection - against a buffer overflow of a 4K string space, other than the caller of - gzprintf() assuring that the output will not exceed 4K. On the other - hand, if zlib is compiled to use snprintf() or vsnprintf(), which should - normally be the case, then there is no vulnerability. The ./configure - script will display warnings if an insecure variation of sprintf() will - be used by gzprintf(). Also the zlibCompileFlags() function will return - information on what variant of sprintf() is used by gzprintf(). - - If you don't have snprintf() or vsnprintf() and would like one, you can - find a portable implementation here: - - http://www.ijs.si/software/snprintf/ - - Note that you should be using the most recent version of zlib. Versions - 1.1.3 and before were subject to a double-free vulnerability. - -34. Is there a Java version of zlib? - - Probably what you want is to use zlib in Java. zlib is already included - as part of the Java SDK in the java.util.zip package. If you really want - a version of zlib written in the Java language, look on the zlib home - page for links: http://www.zlib.org/ - -35. I get this or that compiler or source-code scanner warning when I crank it - up to maximally-pedantic. Can't you guys write proper code? - - Many years ago, we gave up attempting to avoid warnings on every compiler - in the universe. It just got to be a waste of time, and some compilers - were downright silly. So now, we simply make sure that the code always - works. - -36. Valgrind (or some similar memory access checker) says that deflate is - performing a conditional jump that depends on an uninitialized value. - Isn't that a bug? - - No. That is intentional for performance reasons, and the output of - deflate is not affected. This only started showing up recently since - zlib 1.2.x uses malloc() by default for allocations, whereas earlier - versions used calloc(), which zeros out the allocated memory. - -37. Will zlib read the (insert any ancient or arcane format here) compressed - data format? - - Probably not. Look in the comp.compression FAQ for pointers to various - formats and associated software. - -38. How can I encrypt/decrypt zip files with zlib? - - zlib doesn't support encryption. The original PKZIP encryption is very weak - and can be broken with freely available programs. To get strong encryption, - use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. - For PKZIP compatible "encryption", look at http://www.info-zip.org/ - -39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? - - "gzip" is the gzip format, and "deflate" is the zlib format. They should - probably have called the second one "zlib" instead to avoid confusion - with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 - correctly points to the zlib specification in RFC 1950 for the "deflate" - transfer encoding, there have been reports of servers and browsers that - incorrectly produce or expect raw deflate data per the deflate - specficiation in RFC 1951, most notably Microsoft. So even though the - "deflate" transfer encoding using the zlib format would be the more - efficient approach (and in fact exactly what the zlib format was designed - for), using the "gzip" transfer encoding is probably more reliable due to - an unfortunate choice of name on the part of the HTTP 1.1 authors. - - Bottom line: use the gzip format for HTTP 1.1 encoding. - -40. Does zlib support the new "Deflate64" format introduced by PKWare? - - No. PKWare has apparently decided to keep that format proprietary, since - they have not documented it as they have previous compression formats. - In any case, the compression improvements are so modest compared to other - more modern approaches, that it's not worth the effort to implement. - -41. Can you please sign these lengthy legal documents and fax them back to us - so that we can use your software in our product? - - No. Go away. Shoo. diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/INDEX b/components/dfs/filesystems/jffs2/cyg/compress/src/INDEX deleted file mode 100644 index 0587e5902b..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/INDEX +++ /dev/null @@ -1,51 +0,0 @@ -ChangeLog history of changes -FAQ Frequently Asked Questions about zlib -INDEX this file -Makefile makefile for Unix (generated by configure) -Makefile.in makefile for Unix (template for configure) -README guess what -algorithm.txt description of the (de)compression algorithm -configure configure script for Unix -zconf.in.h template for zconf.h (used by configure) - -amiga/ makefiles for Amiga SAS C -as400/ makefiles for IBM AS/400 -msdos/ makefiles for MSDOS -old/ makefiles for various architectures and zlib documentation - files that have not yet been updated for zlib 1.2.x -projects/ projects for various Integrated Development Environments -qnx/ makefiles for QNX -win32/ makefiles for Windows - - zlib public header files (must be kept): -zconf.h -zlib.h - - private source files used to build the zlib library: -adler32.c -compress.c -crc32.c -crc32.h -deflate.c -deflate.h -gzio.c -infback.c -inffast.c -inffast.h -inffixed.h -inflate.c -inflate.h -inftrees.c -inftrees.h -trees.c -trees.h -uncompr.c -zutil.c -zutil.h - - source files for sample programs: -example.c -minigzip.c - - unsupported contribution by third parties -See contrib/README.contrib diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/Make_vms.com b/components/dfs/filesystems/jffs2/cyg/compress/src/Make_vms.com deleted file mode 100644 index c2a1fb54b2..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/Make_vms.com +++ /dev/null @@ -1,461 +0,0 @@ -$! make libz under VMS written by -$! Martin P.J. Zinser -$! -$! -$ on error then goto err_exit -$! -$! -$! Just some general constants... -$! -$ true = 1 -$ false = 0 -$ tmpnam = "temp_" + f$getjpi("","pid") -$ SAY = "WRITE SYS$OUTPUT" -$! -$! Setup variables holding "config" information -$! -$ Make = "" -$ name = "Zlib" -$ version = "?.?.?" -$ v_string = "ZLIB_VERSION" -$ v_file = "zlib.h" -$ ccopt = "" -$ lopts = "" -$ linkonly = false -$ optfile = name + ".opt" -$ its_decc = false -$ its_vaxc = false -$ its_gnuc = false -$ axp = f$getsyi("HW_MODEL").ge.1024 -$ s_case = false -$! Check for MMK/MMS -$! -$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS" -$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK" -$! -$! -$ gosub find_version -$! -$ gosub check_opts -$! -$! Look for the compiler used -$! -$ gosub check_compiler -$ if its_decc -$ then -$ ccopt = "/prefix=all" + ccopt -$ if f$trnlnm("SYS") .eqs. "" -$ then -$ if axp -$ then -$ define sys sys$library: -$ else -$ ccopt = "/decc" + ccopt -$ define sys decc$library_include: -$ endif -$ endif -$ endif -$ if its_vaxc .or. its_gnuc -$ then -$ if f$trnlnm("SYS").eqs."" then define sys sys$library: -$ endif -$! -$! Build the thing plain or with mms -$! -$ write sys$output "Compiling Zlib sources ..." -$ if make.eqs."" -$ then -$ dele example.obj;*,minigzip.obj;* -$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - - adler32.c zlib.h zconf.h -$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - - compress.c zlib.h zconf.h -$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - - crc32.c zlib.h zconf.h -$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - - deflate.c deflate.h zutil.h zlib.h zconf.h -$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - - gzio.c zutil.h zlib.h zconf.h -$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - - infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h -$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - - inffast.c zutil.h zlib.h zconf.h inffast.h -$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - - inflate.c zutil.h zlib.h zconf.h infblock.h -$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - - inftrees.c zutil.h zlib.h zconf.h inftrees.h -$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - - trees.c deflate.h zutil.h zlib.h zconf.h -$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - - uncompr.c zlib.h zconf.h -$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - - zutil.c zutil.h zlib.h zconf.h -$ write sys$output "Building Zlib ..." -$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ -$ write sys$output "Building example..." -$ CALL MAKE example.OBJ "CC ''CCOPT' example" - - example.c zlib.h zconf.h -$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb -$ if f$search("x11vms:xvmsutils.olb") .nes. "" -$ then -$ write sys$output "Building minigzip..." -$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" - - minigzip.c zlib.h zconf.h -$ call make minigzip.exe - - "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - - minigzip.obj libz.olb -$ endif -$ else -$ gosub crea_mms -$ SAY "Make ''name' ''version' with ''Make' " -$ 'make' -$ endif -$! -$! Alpha gets a shareable image -$! -$ If axp -$ Then -$ gosub crea_olist -$ write sys$output "Creating libzshr.exe" -$ call anal_obj_axp modules.opt _link.opt -$ if s_case -$ then -$ open/append optf modules.opt -$ write optf "case_sensitive=YES" -$ close optf -$ endif -$ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,_link.opt/opt -$ endif -$ write sys$output "Zlib build completed" -$ exit -$CC_ERR: -$ write sys$output "C compiler required to build ''name'" -$ goto err_exit -$ERR_EXIT: -$ set message/facil/ident/sever/text -$ write sys$output "Exiting..." -$ exit 2 -$! -$! -$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES -$ V = 'F$Verify(0) -$! P1 = What we are trying to make -$! P2 = Command to make it -$! P3 - P8 What it depends on -$ -$ If F$Search(P1) .Eqs. "" Then Goto Makeit -$ Time = F$CvTime(F$File(P1,"RDT")) -$arg=3 -$Loop: -$ Argument = P'arg -$ If Argument .Eqs. "" Then Goto Exit -$ El=0 -$Loop2: -$ File = F$Element(El," ",Argument) -$ If File .Eqs. " " Then Goto Endl -$ AFile = "" -$Loop3: -$ OFile = AFile -$ AFile = F$Search(File) -$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl -$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit -$ Goto Loop3 -$NextEL: -$ El = El + 1 -$ Goto Loop2 -$EndL: -$ arg=arg+1 -$ If arg .Le. 8 Then Goto Loop -$ Goto Exit -$ -$Makeit: -$ VV=F$VERIFY(0) -$ write sys$output P2 -$ 'P2 -$ VV='F$Verify(VV) -$Exit: -$ If V Then Set Verify -$ENDSUBROUTINE -$!------------------------------------------------------------------------------ -$! -$! Check command line options and set symbols accordingly -$! -$ CHECK_OPTS: -$ i = 1 -$ OPT_LOOP: -$ if i .lt. 9 -$ then -$ cparm = f$edit(p'i',"upcase") -$ if cparm .eqs. "DEBUG" -$ then -$ ccopt = ccopt + "/noopt/deb" -$ lopts = lopts + "/deb" -$ endif -$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm) -$ then -$ start = f$locate("=",cparm) + 1 -$ len = f$length(cparm) - start -$ ccopt = ccopt + f$extract(start,len,cparm) -$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) - - then s_case = true -$ endif -$ if cparm .eqs. "LINK" then linkonly = true -$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm) -$ then -$ start = f$locate("=",cparm) + 1 -$ len = f$length(cparm) - start -$ lopts = lopts + f$extract(start,len,cparm) -$ endif -$ if f$locate("CC=",cparm) .lt. f$length(cparm) -$ then -$ start = f$locate("=",cparm) + 1 -$ len = f$length(cparm) - start -$ cc_com = f$extract(start,len,cparm) - if (cc_com .nes. "DECC") .and. - - (cc_com .nes. "VAXC") .and. - - (cc_com .nes. "GNUC") -$ then -$ write sys$output "Unsupported compiler choice ''cc_com' ignored" -$ write sys$output "Use DECC, VAXC, or GNUC instead" -$ else -$ if cc_com .eqs. "DECC" then its_decc = true -$ if cc_com .eqs. "VAXC" then its_vaxc = true -$ if cc_com .eqs. "GNUC" then its_gnuc = true -$ endif -$ endif -$ if f$locate("MAKE=",cparm) .lt. f$length(cparm) -$ then -$ start = f$locate("=",cparm) + 1 -$ len = f$length(cparm) - start -$ mmks = f$extract(start,len,cparm) -$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS") -$ then -$ make = mmks -$ else -$ write sys$output "Unsupported make choice ''mmks' ignored" -$ write sys$output "Use MMK or MMS instead" -$ endif -$ endif -$ i = i + 1 -$ goto opt_loop -$ endif -$ return -$!------------------------------------------------------------------------------ -$! -$! Look for the compiler used -$! -$CHECK_COMPILER: -$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) -$ then -$ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "") -$ its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "") -$ its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "") -$ endif -$! -$! Exit if no compiler available -$! -$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) -$ then goto CC_ERR -$ else -$ if its_decc then write sys$output "CC compiler check ... Compaq C" -$ if its_vaxc then write sys$output "CC compiler check ... VAX C" -$ if its_gnuc then write sys$output "CC compiler check ... GNU C" -$ endif -$ return -$!------------------------------------------------------------------------------ -$! -$! If MMS/MMK are available dump out the descrip.mms if required -$! -$CREA_MMS: -$ write sys$output "Creating descrip.mms..." -$ create descrip.mms -$ open/append out descrip.mms -$ copy sys$input: out -$ deck -# descrip.mms: MMS description file for building zlib on VMS -# written by Martin P.J. Zinser -# - -OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj, infback.obj\ - deflate.obj, trees.obj, zutil.obj, inflate.obj, \ - inftrees.obj, inffast.obj - -$ eod -$ write out "CFLAGS=", ccopt -$ write out "LOPTS=", lopts -$ copy sys$input: out -$ deck - -all : example.exe minigzip.exe libz.olb - @ write sys$output " Example applications available" - -libz.olb : libz.olb($(OBJS)) - @ write sys$output " libz available" - -example.exe : example.obj libz.olb - link $(LOPTS) example,libz.olb/lib - -minigzip.exe : minigzip.obj libz.olb - link $(LOPTS) minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib - -clean : - delete *.obj;*,libz.olb;*,*.opt;*,*.exe;* - - -# Other dependencies. -adler32.obj : adler32.c zutil.h zlib.h zconf.h -compress.obj : compress.c zlib.h zconf.h -crc32.obj : crc32.c zutil.h zlib.h zconf.h -deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h -example.obj : example.c zlib.h zconf.h -gzio.obj : gzio.c zutil.h zlib.h zconf.h -inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h -inflate.obj : inflate.c zutil.h zlib.h zconf.h -inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h -minigzip.obj : minigzip.c zlib.h zconf.h -trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h -uncompr.obj : uncompr.c zlib.h zconf.h -zutil.obj : zutil.c zutil.h zlib.h zconf.h -infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h -$ eod -$ close out -$ return -$!------------------------------------------------------------------------------ -$! -$! Read list of core library sources from makefile.in and create options -$! needed to build shareable image -$! -$CREA_OLIST: -$ open/read min makefile.in -$ open/write mod modules.opt -$ src_check = "OBJS =" -$MRLOOP: -$ read/end=mrdone min rec -$ if (f$extract(0,6,rec) .nes. src_check) then goto mrloop -$ rec = rec - src_check -$ gosub extra_filnam -$ if (f$element(1,"\",rec) .eqs. "\") then goto mrdone -$MRSLOOP: -$ read/end=mrdone min rec -$ gosub extra_filnam -$ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop -$MRDONE: -$ close min -$ close mod -$ return -$!------------------------------------------------------------------------------ -$! -$! Take record extracted in crea_olist and split it into single filenames -$! -$EXTRA_FILNAM: -$ myrec = f$edit(rec - "\", "trim,compress") -$ i = 0 -$FELOOP: -$ srcfil = f$element(i," ", myrec) -$ if (srcfil .nes. " ") -$ then -$ write mod f$parse(srcfil,,,"NAME"), ".obj" -$ i = i + 1 -$ goto feloop -$ endif -$ return -$!------------------------------------------------------------------------------ -$! -$! Find current Zlib version number -$! -$FIND_VERSION: -$ open/read h_in 'v_file' -$hloop: -$ read/end=hdone h_in rec -$ rec = f$edit(rec,"TRIM") -$ if (f$extract(0,1,rec) .nes. "#") then goto hloop -$ rec = f$edit(rec - "#", "TRIM") -$ if f$element(0," ",rec) .nes. "define" then goto hloop -$ if f$element(1," ",rec) .eqs. v_string -$ then -$ version = 'f$element(2," ",rec)' -$ goto hdone -$ endif -$ goto hloop -$hdone: -$ close h_in -$ return -$!------------------------------------------------------------------------------ -$! -$! Analyze Object files for OpenVMS AXP to extract Procedure and Data -$! information to build a symbol vector for a shareable image -$! All the "brains" of this logic was suggested by Hartmut Becker -$! (Hartmut.Becker@compaq.com). All the bugs were introduced by me -$! (zinser@decus.de), so if you do have problem reports please do not -$! bother Hartmut/HP, but get in touch with me -$! -$ ANAL_OBJ_AXP: Subroutine -$ V = 'F$Verify(0) -$ SAY := "WRITE_ SYS$OUTPUT" -$ -$ IF F$SEARCH("''P1'") .EQS. "" -$ THEN -$ SAY "ANAL_OBJ_AXP-E-NOSUCHFILE: Error, inputfile ''p1' not available" -$ goto exit_aa -$ ENDIF -$ IF "''P2'" .EQS. "" -$ THEN -$ SAY "ANAL_OBJ_AXP: Error, no output file provided" -$ goto exit_aa -$ ENDIF -$ -$ open/read in 'p1 -$ create a.tmp -$ open/append atmp a.tmp -$ loop: -$ read/end=end_loop in line -$ f= f$search(line) -$ if f .eqs. "" -$ then -$ write sys$output "ANAL_OBJ_AXP-w-nosuchfile, ''line'" -$ goto loop -$ endif -$ define/user sys$output nl: -$ define/user sys$error nl: -$ anal/obj/gsd 'f /out=x.tmp -$ open/read xtmp x.tmp -$ XLOOP: -$ read/end=end_xloop xtmp xline -$ xline = f$edit(xline,"compress") -$ write atmp xline -$ goto xloop -$ END_XLOOP: -$ close xtmp -$ goto loop -$ end_loop: -$ close in -$ close atmp -$ if f$search("a.tmp") .eqs. "" - - then $ exit -$ ! all global definitions -$ search a.tmp "symbol:","EGSY$V_DEF 1","EGSY$V_NORM 1"/out=b.tmp -$ ! all procedures -$ search b.tmp "EGSY$V_NORM 1"/wind=(0,1) /out=c.tmp -$ search c.tmp "symbol:"/out=d.tmp -$ define/user sys$output nl: -$ edito/edt/command=sys$input d.tmp -sub/symbol: "/symbol_vector=(/whole -sub/"/=PROCEDURE)/whole -exit -$ ! all data -$ search b.tmp "EGSY$V_DEF 1"/wind=(0,1) /out=e.tmp -$ search e.tmp "symbol:"/out=f.tmp -$ define/user sys$output nl: -$ edito/edt/command=sys$input f.tmp -sub/symbol: "/symbol_vector=(/whole -sub/"/=DATA)/whole -exit -$ sort/nodupl d.tmp,f.tmp 'p2' -$ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;* -$ if f$search("x.tmp") .nes. "" - - then $ delete x.tmp;* -$! -$ EXIT_AA: -$ if V then set verify -$ endsubroutine -$!------------------------------------------------------------------------------ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile b/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile deleted file mode 100644 index 2fd6e45c48..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile +++ /dev/null @@ -1,154 +0,0 @@ -# Makefile for zlib -# Copyright (C) 1995-2005 Jean-loup Gailly. -# For conditions of distribution and use, see copyright notice in zlib.h - -# To compile and test, type: -# ./configure; make test -# The call of configure is optional if you don't have special requirements -# If you wish to build zlib as a shared library, use: ./configure -s - -# To use the asm code, type: -# cp contrib/asm?86/match.S ./match.S -# make LOC=-DASMV OBJA=match.o - -# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: -# make install -# To install in $HOME instead of /usr/local, use: -# make install prefix=$HOME - -CC=cc - -CFLAGS=-O -#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 -#CFLAGS=-g -DDEBUG -#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -# -Wstrict-prototypes -Wmissing-prototypes - -LDFLAGS=libz.a -LDSHARED=$(CC) -CPP=$(CC) -E - -LIBS=libz.a -SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.3 -SHAREDLIBM=libz.so.1 - -AR=ar rc -RANLIB=ranlib -TAR=tar -SHELL=/bin/sh -EXE= - -prefix = /usr/local -exec_prefix = ${prefix} -libdir = ${exec_prefix}/lib -includedir = ${prefix}/include -mandir = ${prefix}/share/man -man3dir = ${mandir}/man3 - -OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ - zutil.o inflate.o infback.o inftrees.o inffast.o - -OBJA = -# to use the asm code: make OBJA=match.o - -TEST_OBJS = example.o minigzip.o - -all: example$(EXE) minigzip$(EXE) - -check: test -test: all - @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ - echo hello world | ./minigzip | ./minigzip -d || \ - echo ' *** minigzip test FAILED ***' ; \ - if ./example; then \ - echo ' *** zlib test OK ***'; \ - else \ - echo ' *** zlib test FAILED ***'; \ - fi - -libz.a: $(OBJS) $(OBJA) - $(AR) $@ $(OBJS) $(OBJA) - -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 - -match.o: match.S - $(CPP) match.S > _match.s - $(CC) -c _match.s - mv _match.o match.o - rm -f _match.s - -$(SHAREDLIBV): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - rm -f $(SHAREDLIB) $(SHAREDLIBM) - ln -s $@ $(SHAREDLIB) - ln -s $@ $(SHAREDLIBM) - -example$(EXE): example.o $(LIBS) - $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) - -minigzip$(EXE): minigzip.o $(LIBS) - $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) - -install: $(LIBS) - -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi - -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi - -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi - -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi - cp zlib.h zconf.h $(includedir) - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h - cp $(LIBS) $(libdir) - cd $(libdir); chmod 755 $(LIBS) - -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 - cd $(libdir); if test -f $(SHAREDLIBV); then \ - rm -f $(SHAREDLIB) $(SHAREDLIBM); \ - ln -s $(SHAREDLIBV) $(SHAREDLIB); \ - ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ - (ldconfig || true) >/dev/null 2>&1; \ - fi - cp zlib.3 $(man3dir) - chmod 644 $(man3dir)/zlib.3 -# The ranlib in install is needed on NeXTSTEP which checks file times -# ldconfig is for Linux - -uninstall: - cd $(includedir); \ - cd $(libdir); rm -f libz.a; \ - if test -f $(SHAREDLIBV); then \ - rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ - fi - cd $(man3dir); rm -f zlib.3 - -mostlyclean: clean -clean: - rm -f *.o *~ example$(EXE) minigzip$(EXE) \ - libz.* foo.gz so_locations \ - _match.s maketree contrib/infback9/*.o - -maintainer-clean: distclean -distclean: clean - cp -p Makefile.in Makefile - cp -p zconf.in.h zconf.h - rm -f .DS_Store - -tags: - etags *.[ch] - -depend: - makedepend -- $(CFLAGS) -- *.[ch] - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -adler32.o: zlib.h zconf.h -compress.o: zlib.h zconf.h -crc32.o: crc32.h zlib.h zconf.h -deflate.o: deflate.h zutil.h zlib.h zconf.h -example.o: zlib.h zconf.h -gzio.o: zutil.h zlib.h zconf.h -inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -inftrees.o: zutil.h zlib.h zconf.h inftrees.h -minigzip.o: zlib.h zconf.h -trees.o: deflate.h zutil.h zlib.h zconf.h trees.h -uncompr.o: zlib.h zconf.h -zutil.o: zutil.h zlib.h zconf.h diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.in b/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.in deleted file mode 100644 index 2fd6e45c48..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.in +++ /dev/null @@ -1,154 +0,0 @@ -# Makefile for zlib -# Copyright (C) 1995-2005 Jean-loup Gailly. -# For conditions of distribution and use, see copyright notice in zlib.h - -# To compile and test, type: -# ./configure; make test -# The call of configure is optional if you don't have special requirements -# If you wish to build zlib as a shared library, use: ./configure -s - -# To use the asm code, type: -# cp contrib/asm?86/match.S ./match.S -# make LOC=-DASMV OBJA=match.o - -# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: -# make install -# To install in $HOME instead of /usr/local, use: -# make install prefix=$HOME - -CC=cc - -CFLAGS=-O -#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 -#CFLAGS=-g -DDEBUG -#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -# -Wstrict-prototypes -Wmissing-prototypes - -LDFLAGS=libz.a -LDSHARED=$(CC) -CPP=$(CC) -E - -LIBS=libz.a -SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.3 -SHAREDLIBM=libz.so.1 - -AR=ar rc -RANLIB=ranlib -TAR=tar -SHELL=/bin/sh -EXE= - -prefix = /usr/local -exec_prefix = ${prefix} -libdir = ${exec_prefix}/lib -includedir = ${prefix}/include -mandir = ${prefix}/share/man -man3dir = ${mandir}/man3 - -OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ - zutil.o inflate.o infback.o inftrees.o inffast.o - -OBJA = -# to use the asm code: make OBJA=match.o - -TEST_OBJS = example.o minigzip.o - -all: example$(EXE) minigzip$(EXE) - -check: test -test: all - @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ - echo hello world | ./minigzip | ./minigzip -d || \ - echo ' *** minigzip test FAILED ***' ; \ - if ./example; then \ - echo ' *** zlib test OK ***'; \ - else \ - echo ' *** zlib test FAILED ***'; \ - fi - -libz.a: $(OBJS) $(OBJA) - $(AR) $@ $(OBJS) $(OBJA) - -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 - -match.o: match.S - $(CPP) match.S > _match.s - $(CC) -c _match.s - mv _match.o match.o - rm -f _match.s - -$(SHAREDLIBV): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - rm -f $(SHAREDLIB) $(SHAREDLIBM) - ln -s $@ $(SHAREDLIB) - ln -s $@ $(SHAREDLIBM) - -example$(EXE): example.o $(LIBS) - $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) - -minigzip$(EXE): minigzip.o $(LIBS) - $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) - -install: $(LIBS) - -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi - -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi - -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi - -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi - cp zlib.h zconf.h $(includedir) - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h - cp $(LIBS) $(libdir) - cd $(libdir); chmod 755 $(LIBS) - -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 - cd $(libdir); if test -f $(SHAREDLIBV); then \ - rm -f $(SHAREDLIB) $(SHAREDLIBM); \ - ln -s $(SHAREDLIBV) $(SHAREDLIB); \ - ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ - (ldconfig || true) >/dev/null 2>&1; \ - fi - cp zlib.3 $(man3dir) - chmod 644 $(man3dir)/zlib.3 -# The ranlib in install is needed on NeXTSTEP which checks file times -# ldconfig is for Linux - -uninstall: - cd $(includedir); \ - cd $(libdir); rm -f libz.a; \ - if test -f $(SHAREDLIBV); then \ - rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ - fi - cd $(man3dir); rm -f zlib.3 - -mostlyclean: clean -clean: - rm -f *.o *~ example$(EXE) minigzip$(EXE) \ - libz.* foo.gz so_locations \ - _match.s maketree contrib/infback9/*.o - -maintainer-clean: distclean -distclean: clean - cp -p Makefile.in Makefile - cp -p zconf.in.h zconf.h - rm -f .DS_Store - -tags: - etags *.[ch] - -depend: - makedepend -- $(CFLAGS) -- *.[ch] - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -adler32.o: zlib.h zconf.h -compress.o: zlib.h zconf.h -crc32.o: crc32.h zlib.h zconf.h -deflate.o: deflate.h zutil.h zlib.h zconf.h -example.o: zlib.h zconf.h -gzio.o: zutil.h zlib.h zconf.h -inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -inftrees.o: zutil.h zlib.h zconf.h inftrees.h -minigzip.o: zlib.h zconf.h -trees.o: deflate.h zutil.h zlib.h zconf.h trees.h -uncompr.o: zlib.h zconf.h -zutil.o: zutil.h zlib.h zconf.h diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.riscos b/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.riscos deleted file mode 100644 index d97f449237..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/Makefile.riscos +++ /dev/null @@ -1,151 +0,0 @@ -# Project: zlib_1_03 -# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430 -# test works out-of-the-box, installs `somewhere' on demand - -# Toolflags: -CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah -C++flags = -c -depend !Depend -IC: -throwback -Linkflags = -aif -c++ -o $@ -ObjAsmflags = -throwback -NoCache -depend !Depend -CMHGflags = -LibFileflags = -c -l -o $@ -Squeezeflags = -o $@ - -# change the line below to where _you_ want the library installed. -libdest = lib:zlib - -# Final targets: -@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \ - @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \ - @.o.uncompr @.o.zutil - LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \ - @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \ - @.o.trees @.o.uncompr @.o.zutil -test: @.minigzip @.example @.lib - @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV - @echo running tests: hang on. - @/@.minigzip -f -9 libc - @/@.minigzip -d libc-gz - @/@.minigzip -f -1 libc - @/@.minigzip -d libc-gz - @/@.minigzip -h -9 libc - @/@.minigzip -d libc-gz - @/@.minigzip -h -1 libc - @/@.minigzip -d libc-gz - @/@.minigzip -9 libc - @/@.minigzip -d libc-gz - @/@.minigzip -1 libc - @/@.minigzip -d libc-gz - @diff @.lib @.libc - @echo that should have reported '@.lib and @.libc identical' if you have diff. - @/@.example @.fred @.fred - @echo that will have given lots of hello!'s. - -@.minigzip: @.o.minigzip @.lib C:o.Stubs - Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs -@.example: @.o.example @.lib C:o.Stubs - Link $(Linkflags) @.o.example @.lib C:o.Stubs - -install: @.lib - cdir $(libdest) - cdir $(libdest).h - @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV - @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV - @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV - @echo okay, installed zlib in $(libdest) - -clean:; remove @.minigzip - remove @.example - remove @.libc - -wipe @.o.* F~r~cV - remove @.fred - -# User-editable dependencies: -.c.o: - cc $(ccflags) -o $@ $< - -# Static dependencies: - -# Dynamic dependencies: -o.example: c.example -o.example: h.zlib -o.example: h.zconf -o.minigzip: c.minigzip -o.minigzip: h.zlib -o.minigzip: h.zconf -o.adler32: c.adler32 -o.adler32: h.zlib -o.adler32: h.zconf -o.compress: c.compress -o.compress: h.zlib -o.compress: h.zconf -o.crc32: c.crc32 -o.crc32: h.zlib -o.crc32: h.zconf -o.deflate: c.deflate -o.deflate: h.deflate -o.deflate: h.zutil -o.deflate: h.zlib -o.deflate: h.zconf -o.gzio: c.gzio -o.gzio: h.zutil -o.gzio: h.zlib -o.gzio: h.zconf -o.infblock: c.infblock -o.infblock: h.zutil -o.infblock: h.zlib -o.infblock: h.zconf -o.infblock: h.infblock -o.infblock: h.inftrees -o.infblock: h.infcodes -o.infblock: h.infutil -o.infcodes: c.infcodes -o.infcodes: h.zutil -o.infcodes: h.zlib -o.infcodes: h.zconf -o.infcodes: h.inftrees -o.infcodes: h.infblock -o.infcodes: h.infcodes -o.infcodes: h.infutil -o.infcodes: h.inffast -o.inffast: c.inffast -o.inffast: h.zutil -o.inffast: h.zlib -o.inffast: h.zconf -o.inffast: h.inftrees -o.inffast: h.infblock -o.inffast: h.infcodes -o.inffast: h.infutil -o.inffast: h.inffast -o.inflate: c.inflate -o.inflate: h.zutil -o.inflate: h.zlib -o.inflate: h.zconf -o.inflate: h.infblock -o.inftrees: c.inftrees -o.inftrees: h.zutil -o.inftrees: h.zlib -o.inftrees: h.zconf -o.inftrees: h.inftrees -o.inftrees: h.inffixed -o.infutil: c.infutil -o.infutil: h.zutil -o.infutil: h.zlib -o.infutil: h.zconf -o.infutil: h.infblock -o.infutil: h.inftrees -o.infutil: h.infcodes -o.infutil: h.infutil -o.trees: c.trees -o.trees: h.deflate -o.trees: h.zutil -o.trees: h.zlib -o.trees: h.zconf -o.trees: h.trees -o.uncompr: c.uncompr -o.uncompr: h.zlib -o.uncompr: h.zconf -o.zutil: c.zutil -o.zutil: h.zutil -o.zutil: h.zlib -o.zutil: h.zconf diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/README b/components/dfs/filesystems/jffs2/cyg/compress/src/README deleted file mode 100644 index 758cc50020..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/README +++ /dev/null @@ -1,125 +0,0 @@ -ZLIB DATA COMPRESSION LIBRARY - -zlib 1.2.3 is a general purpose data compression library. All the code is -thread safe. The data format used by the zlib library is described by RFCs -(Request for Comments) 1950 to 1952 in the files -http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) -and rfc1952.txt (gzip format). These documents are also available in other -formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html - -All functions of the compression library are documented in the file zlib.h -(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example -of the library is given in the file example.c which also tests that the library -is working correctly. Another example is given in the file minigzip.c. The -compression library itself is composed of all source files except example.c and -minigzip.c. - -To compile all files and run the test program, follow the instructions given at -the top of Makefile. In short "make test; make install" should work for most -machines. For Unix: "./configure; make test; make install". For MSDOS, use one -of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. - -Questions about zlib should be sent to , or to Gilles Vollant - for the Windows DLL version. The zlib home page is -http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem, -please check this site to verify that you have the latest version of zlib; -otherwise get the latest version and check whether the problem still exists or -not. - -PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking -for help. - -Mark Nelson wrote an article about zlib for the Jan. 1997 -issue of Dr. Dobb's Journal; a copy of the article is available in -http://dogma.net/markn/articles/zlibtool/zlibtool.htm - -The changes made in version 1.2.3 are documented in the file ChangeLog. - -Unsupported third party contributions are provided in directory "contrib". - -A Java implementation of zlib is available in the Java Development Kit -http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html -See the zlib home page http://www.zlib.org for details. - -A Perl interface to zlib written by Paul Marquess is in the -CPAN (Comprehensive Perl Archive Network) sites -http://www.cpan.org/modules/by-module/Compress/ - -A Python interface to zlib written by A.M. Kuchling is -available in Python 1.5 and later versions, see -http://www.python.org/doc/lib/module-zlib.html - -A zlib binding for TCL written by Andreas Kupries is -availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html - -An experimental package to read and write files in .zip format, written on top -of zlib by Gilles Vollant , is available in the -contrib/minizip directory of zlib. - - -Notes for some targets: - -- For Windows DLL versions, please see win32/DLL_FAQ.txt - -- For 64-bit Irix, deflate.c must be compiled without any optimization. With - -O, one libpng test fails. The test works in 32 bit mode (with the -n32 - compiler flag). The compiler bug has been reported to SGI. - -- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works - when compiled with cc. - -- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is - necessary to get gzprintf working correctly. This is done by configure. - -- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with - other compilers. Use "make test" to check your compiler. - -- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. - -- For PalmOs, see http://palmzlib.sourceforge.net/ - -- When building a shared, i.e. dynamic library on Mac OS X, the library must be - installed before testing (do "make install" before "make test"), since the - library location is specified in the library. - - -Acknowledgments: - - The deflate format used by zlib was defined by Phil Katz. The deflate - and zlib specifications were written by L. Peter Deutsch. Thanks to all the - people who reported problems and suggested various improvements in zlib; - they are too numerous to cite here. - -Copyright notice: - - (C) 1995-2004 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -If you use the zlib library in a product, we would appreciate *not* -receiving lengthy legal documents to sign. The sources are provided -for free but without warranty of any kind. The library has been -entirely written by Jean-loup Gailly and Mark Adler; it does not -include third-party code. - -If you redistribute modified sources, we would appreciate that you include -in the file ChangeLog history information documenting your changes. Please -read the FAQ for more information on the distribution of modified source -versions. diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/README.eCos b/components/dfs/filesystems/jffs2/cyg/compress/src/README.eCos deleted file mode 100644 index 88011312f9..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/README.eCos +++ /dev/null @@ -1,27 +0,0 @@ -See the main site http://www.gzip.org/zlib/ for places to download the -complete sources. Currently based on zlib-1.2.3 - -Note that these are not the complete zlib sources - the following -directories have been deleted since they are irrelevant for the -eCos support: - -amiga/ -as400/ -contrib/ -msdos/ -old/ -projects/ -qnx/ -win32/ - -Additionally, local changes has been made to the remaining files. Code -changes are marked by __ECOS__ (comments or definitions). Finally, the -headers zlib.h and zconf.h have been moved out of the directory into -../include. - -crc32.c + crc32.h has also been removed as it is provided by services/crc/. - -Note: zconf.h always defines __ECOS__. This is necessary to support -programs built outside of the eCos tree which may wish to use this -library (so those programs needn't worry about defining __ECOS__) - diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/adler32.c b/components/dfs/filesystems/jffs2/cyg/compress/src/adler32.c deleted file mode 100644 index 2522ee2120..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/adler32.c +++ /dev/null @@ -1,153 +0,0 @@ -/* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#ifdef __ECOS__ -#include -#else -#include "zlib.h" -#endif // __ECOS__ - -#define BASE 65521UL /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -/* use NO_DIVIDE if your processor does not do division in hardware */ -#ifdef NO_DIVIDE -# define MOD(a) \ - do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -# define MOD4(a) \ - do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -#else -# define MOD(a) a %= BASE -# define MOD4(a) a %= BASE -#endif - -/* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ - unsigned long sum2; - unsigned n; - - /* split Adler-32 into component sums */ - sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) - adler -= BASE; - sum2 += adler; - if (sum2 >= BASE) - sum2 -= BASE; - return adler | (sum2 << 16); - } - - /* initial Adler-32 value (deferred check for len == 1 speed) */ - if (buf == Z_NULL) - return 1L; - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) - adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -/* ========================================================================= */ -uLong ZEXPORT adler32_combine(adler1, adler2, len2) - uLong adler1; - uLong adler2; - z_off_t len2; -{ - unsigned long sum1; - unsigned long sum2; - unsigned rem; - - /* the derivation of this formula is left as an exercise for the reader */ - rem = (unsigned)(len2 % BASE); - sum1 = adler1 & 0xffff; - sum2 = rem * sum1; - MOD(sum2); - sum1 += (adler2 & 0xffff) + BASE - 1; - sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; - if (sum1 > BASE) sum1 -= BASE; - if (sum1 > BASE) sum1 -= BASE; - if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); - if (sum2 > BASE) sum2 -= BASE; - return sum1 | (sum2 << 16); -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/algorithm.txt b/components/dfs/filesystems/jffs2/cyg/compress/src/algorithm.txt deleted file mode 100644 index b022dde312..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/algorithm.txt +++ /dev/null @@ -1,209 +0,0 @@ -1. Compression algorithm (deflate) - -The deflation algorithm used by gzip (also zip and zlib) is a variation of -LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in -the input data. The second occurrence of a string is replaced by a -pointer to the previous string, in the form of a pair (distance, -length). Distances are limited to 32K bytes, and lengths are limited -to 258 bytes. When a string does not occur anywhere in the previous -32K bytes, it is emitted as a sequence of literal bytes. (In this -description, `string' must be taken as an arbitrary sequence of bytes, -and is not restricted to printable characters.) - -Literals or match lengths are compressed with one Huffman tree, and -match distances are compressed with another tree. The trees are stored -in a compact form at the start of each block. The blocks can have any -size (except that the compressed data for one block must fit in -available memory). A block is terminated when deflate() determines that -it would be useful to start another block with fresh trees. (This is -somewhat similar to the behavior of LZW-based _compress_.) - -Duplicated strings are found using a hash table. All input strings of -length 3 are inserted in the hash table. A hash index is computed for -the next 3 bytes. If the hash chain for this index is not empty, all -strings in the chain are compared with the current input string, and -the longest match is selected. - -The hash chains are searched starting with the most recent strings, to -favor small distances and thus take advantage of the Huffman encoding. -The hash chains are singly linked. There are no deletions from the -hash chains, the algorithm simply discards matches that are too old. - -To avoid a worst-case situation, very long hash chains are arbitrarily -truncated at a certain length, determined by a runtime option (level -parameter of deflateInit). So deflate() does not always find the longest -possible match but generally finds a match which is long enough. - -deflate() also defers the selection of matches with a lazy evaluation -mechanism. After a match of length N has been found, deflate() searches for -a longer match at the next input byte. If a longer match is found, the -previous match is truncated to a length of one (thus producing a single -literal byte) and the process of lazy evaluation begins again. Otherwise, -the original match is kept, and the next match search is attempted only N -steps later. - -The lazy match evaluation is also subject to a runtime parameter. If -the current match is long enough, deflate() reduces the search for a longer -match, thus speeding up the whole process. If compression ratio is more -important than speed, deflate() attempts a complete second search even if -the first match is already long enough. - -The lazy match evaluation is not performed for the fastest compression -modes (level parameter 1 to 3). For these fast modes, new strings -are inserted in the hash table only when no match was found, or -when the match is not too long. This degrades the compression ratio -but saves time since there are both fewer insertions and fewer searches. - - -2. Decompression algorithm (inflate) - -2.1 Introduction - -The key question is how to represent a Huffman code (or any prefix code) so -that you can decode fast. The most important characteristic is that shorter -codes are much more common than longer codes, so pay attention to decoding the -short codes fast, and let the long codes take longer to decode. - -inflate() sets up a first level table that covers some number of bits of -input less than the length of longest code. It gets that many bits from the -stream, and looks it up in the table. The table will tell if the next -code is that many bits or less and how many, and if it is, it will tell -the value, else it will point to the next level table for which inflate() -grabs more bits and tries to decode a longer code. - -How many bits to make the first lookup is a tradeoff between the time it -takes to decode and the time it takes to build the table. If building the -table took no time (and if you had infinite memory), then there would only -be a first level table to cover all the way to the longest code. However, -building the table ends up taking a lot longer for more bits since short -codes are replicated many times in such a table. What inflate() does is -simply to make the number of bits in the first table a variable, and then -to set that variable for the maximum speed. - -For inflate, which has 286 possible codes for the literal/length tree, the size -of the first table is nine bits. Also the distance trees have 30 possible -values, and the size of the first table is six bits. Note that for each of -those cases, the table ended up one bit longer than the ``average'' code -length, i.e. the code length of an approximately flat code which would be a -little more than eight bits for 286 symbols and a little less than five bits -for 30 symbols. - - -2.2 More details on the inflate table lookup - -Ok, you want to know what this cleverly obfuscated inflate tree actually -looks like. You are correct that it's not a Huffman tree. It is simply a -lookup table for the first, let's say, nine bits of a Huffman symbol. The -symbol could be as short as one bit or as long as 15 bits. If a particular -symbol is shorter than nine bits, then that symbol's translation is duplicated -in all those entries that start with that symbol's bits. For example, if the -symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a -symbol is nine bits long, it appears in the table once. - -If the symbol is longer than nine bits, then that entry in the table points -to another similar table for the remaining bits. Again, there are duplicated -entries as needed. The idea is that most of the time the symbol will be short -and there will only be one table look up. (That's whole idea behind data -compression in the first place.) For the less frequent long symbols, there -will be two lookups. If you had a compression method with really long -symbols, you could have as many levels of lookups as is efficient. For -inflate, two is enough. - -So a table entry either points to another table (in which case nine bits in -the above example are gobbled), or it contains the translation for the symbol -and the number of bits to gobble. Then you start again with the next -ungobbled bit. - -You may wonder: why not just have one lookup table for how ever many bits the -longest symbol is? The reason is that if you do that, you end up spending -more time filling in duplicate symbol entries than you do actually decoding. -At least for deflate's output that generates new trees every several 10's of -kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code -would take too long if you're only decoding several thousand symbols. At the -other extreme, you could make a new table for every bit in the code. In fact, -that's essentially a Huffman tree. But then you spend two much time -traversing the tree while decoding, even for short symbols. - -So the number of bits for the first lookup table is a trade of the time to -fill out the table vs. the time spent looking at the second level and above of -the table. - -Here is an example, scaled down: - -The code being decoded, with 10 symbols, from 1 to 6 bits long: - -A: 0 -B: 10 -C: 1100 -D: 11010 -E: 11011 -F: 11100 -G: 11101 -H: 11110 -I: 111110 -J: 111111 - -Let's make the first table three bits long (eight entries): - -000: A,1 -001: A,1 -010: A,1 -011: A,1 -100: B,2 -101: B,2 -110: -> table X (gobble 3 bits) -111: -> table Y (gobble 3 bits) - -Each entry is what the bits decode as and how many bits that is, i.e. how -many bits to gobble. Or the entry points to another table, with the number of -bits to gobble implicit in the size of the table. - -Table X is two bits long since the longest code starting with 110 is five bits -long: - -00: C,1 -01: C,1 -10: D,2 -11: E,2 - -Table Y is three bits long since the longest code starting with 111 is six -bits long: - -000: F,2 -001: F,2 -010: G,2 -011: G,2 -100: H,2 -101: H,2 -110: I,3 -111: J,3 - -So what we have here are three tables with a total of 20 entries that had to -be constructed. That's compared to 64 entries for a single table. Or -compared to 16 entries for a Huffman tree (six two entry tables and one four -entry table). Assuming that the code ideally represents the probability of -the symbols, it takes on the average 1.25 lookups per symbol. That's compared -to one lookup for the single table, or 1.66 lookups per symbol for the -Huffman tree. - -There, I think that gives you a picture of what's going on. For inflate, the -meaning of a particular symbol is often more than just a letter. It can be a -byte (a "literal"), or it can be either a length or a distance which -indicates a base value and a number of bits to fetch after the code that is -added to the base value. Or it might be the special end-of-block code. The -data structures created in inftrees.c try to encode all that information -compactly in the tables. - - -Jean-loup Gailly Mark Adler -jloup@gzip.org madler@alumni.caltech.edu - - -References: - -[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data -Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3, -pp. 337-343. - -``DEFLATE Compressed Data Format Specification'' available in -http://www.ietf.org/rfc/rfc1951.txt diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/compress.c b/components/dfs/filesystems/jffs2/cyg/compress/src/compress.c deleted file mode 100644 index f94974537f..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/compress.c +++ /dev/null @@ -1,83 +0,0 @@ -/* compress.c -- compress a memory buffer - * Copyright (C) 1995-2003 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#ifdef __ECOS__ -#include -#else -#include "zlib.h" -#endif // __ECOS__ - -/* =========================================================================== - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least 0.1% larger than sourceLen plus - 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; - int level; -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; -#ifdef MAXSEG_64K - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; -#endif - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - stream.opaque = (voidpf)0; - - err = deflateInit(&stream, level); - if (err != Z_OK) return err; - - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; - - err = deflateEnd(&stream); - return err; -} - -/* =========================================================================== - */ -int ZEXPORT compress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); -} - -/* =========================================================================== - If the default memLevel or windowBits for deflateInit() is changed, then - this function needs to be updated. - */ -uLong ZEXPORT compressBound (sourceLen) - uLong sourceLen; -{ - return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/configure b/components/dfs/filesystems/jffs2/cyg/compress/src/configure deleted file mode 100644 index d7ffdc3458..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/configure +++ /dev/null @@ -1,459 +0,0 @@ -#!/bin/sh -# configure script for zlib. This script is needed only if -# you wish to build a shared library and your system supports them, -# of if you need special compiler, flags or install directory. -# Otherwise, you can just use directly "make test; make install" -# -# To create a shared library, use "configure --shared"; by default a static -# library is created. If the primitive shared library support provided here -# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz -# -# To impose specific compiler or flags or install directory, use for example: -# prefix=$HOME CC=cc CFLAGS="-O4" ./configure -# or for csh/tcsh users: -# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) -# LDSHARED is the command to be used to create a shared library - -# Incorrect settings of CC or CFLAGS may prevent creating a shared library. -# If you have problems, try without defining CC and CFLAGS before reporting -# an error. - -LIBS=libz.a -LDFLAGS="-L. ${LIBS}" -VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` -VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` -VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` -AR=${AR-"ar rc"} -RANLIB=${RANLIB-"ranlib"} -prefix=${prefix-/usr/local} -exec_prefix=${exec_prefix-'${prefix}'} -libdir=${libdir-'${exec_prefix}/lib'} -includedir=${includedir-'${prefix}/include'} -mandir=${mandir-'${prefix}/share/man'} -shared_ext='.so' -shared=0 -gcc=0 -old_cc="$CC" -old_cflags="$CFLAGS" - -while test $# -ge 1 -do -case "$1" in - -h* | --h*) - echo 'usage:' - echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]' - echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]' - exit 0;; - -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; - -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; - -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; - -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;; - -p* | --p*) prefix="$2"; shift; shift;; - -e* | --e*) exec_prefix="$2"; shift; shift;; - -l* | --l*) libdir="$2"; shift; shift;; - -i* | --i*) includedir="$2"; shift; shift;; - -s* | --s*) shared=1; shift;; - *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1;; - esac -done - -test=ztest$$ -cat > $test.c </dev/null; then - CC="$cc" - SFLAGS=${CFLAGS-"-fPIC -O3"} - CFLAGS="$cflags" - case `(uname -s || echo unknown) 2>/dev/null` in - Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; - CYGWIN* | Cygwin* | cygwin* | OS/2* ) - EXE='.exe';; - QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 - # (alain.bonnefoy@icbt.com) - LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};; - HP-UX*) - LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} - case `(uname -m || echo unknown) 2>/dev/null` in - ia64) - shared_ext='.so' - SHAREDLIB='libz.so';; - *) - shared_ext='.sl' - SHAREDLIB='libz.sl';; - esac;; - Darwin*) shared_ext='.dylib' - SHAREDLIB=libz$shared_ext - SHAREDLIBV=libz.$VER$shared_ext - SHAREDLIBM=libz.$VER1$shared_ext - LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"};; - *) LDSHARED=${LDSHARED-"$cc -shared"};; - esac -else - # find system name and corresponding cc options - CC=${CC-cc} - case `(uname -sr || echo unknown) 2>/dev/null` in - HP-UX*) SFLAGS=${CFLAGS-"-O +z"} - CFLAGS=${CFLAGS-"-O"} -# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} - LDSHARED=${LDSHARED-"ld -b"} - case `(uname -m || echo unknown) 2>/dev/null` in - ia64) - shared_ext='.so' - SHAREDLIB='libz.so';; - *) - shared_ext='.sl' - SHAREDLIB='libz.sl';; - esac;; - IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} - CFLAGS=${CFLAGS-"-ansi -O2"} - LDSHARED=${LDSHARED-"cc -shared"};; - OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} - CFLAGS=${CFLAGS-"-O -std1"} - LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; - OSF1*) SFLAGS=${CFLAGS-"-O -std1"} - CFLAGS=${CFLAGS-"-O -std1"} - LDSHARED=${LDSHARED-"cc -shared"};; - QNX*) SFLAGS=${CFLAGS-"-4 -O"} - CFLAGS=${CFLAGS-"-4 -O"} - LDSHARED=${LDSHARED-"cc"} - RANLIB=${RANLIB-"true"} - AR="cc -A";; - SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} - CFLAGS=${CFLAGS-"-O3"} - LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};; - SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."} - CFLAGS=${CFLAGS-"-fast -xcg89"} - LDSHARED=${LDSHARED-"cc -G"};; - SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} - CFLAGS=${CFLAGS-"-O2"} - LDSHARED=${LDSHARED-"ld"};; - SunStudio\ 9*) SFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"} - CFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xtarget=ultra3 -xarch=v9b"} - LDSHARED=${LDSHARED-"cc -xarch=v9b"};; - UNIX_System_V\ 4.2.0) - SFLAGS=${CFLAGS-"-KPIC -O"} - CFLAGS=${CFLAGS-"-O"} - LDSHARED=${LDSHARED-"cc -G"};; - UNIX_SV\ 4.2MP) - SFLAGS=${CFLAGS-"-Kconform_pic -O"} - CFLAGS=${CFLAGS-"-O"} - LDSHARED=${LDSHARED-"cc -G"};; - OpenUNIX\ 5) - SFLAGS=${CFLAGS-"-KPIC -O"} - CFLAGS=${CFLAGS-"-O"} - LDSHARED=${LDSHARED-"cc -G"};; - AIX*) # Courtesy of dbakker@arrayasolutions.com - SFLAGS=${CFLAGS-"-O -qmaxmem=8192"} - CFLAGS=${CFLAGS-"-O -qmaxmem=8192"} - LDSHARED=${LDSHARED-"xlc -G"};; - # send working options for other systems to support@gzip.org - *) SFLAGS=${CFLAGS-"-O"} - CFLAGS=${CFLAGS-"-O"} - LDSHARED=${LDSHARED-"cc -shared"};; - esac -fi - -SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} -SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} -SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} - -if test $shared -eq 1; then - echo Checking for shared library support... - # we must test in two steps (cc then ld), required at least on SunOS 4.x - if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && - test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then - CFLAGS="$SFLAGS" - LIBS="$SHAREDLIBV" - echo Building shared library $SHAREDLIBV with $CC. - elif test -z "$old_cc" -a -z "$old_cflags"; then - echo No shared library support. - shared=0; - else - echo 'No shared library support; try without defining CC and CFLAGS' - shared=0; - fi -fi -if test $shared -eq 0; then - LDSHARED="$CC" - echo Building static library $LIBS version $VER with $CC. -else - LDFLAGS="-L. ${SHAREDLIBV}" -fi - -cat > $test.c < -int main() { return 0; } -EOF -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - sed < zconf.in.h "/HAVE_UNISTD_H/s%0%1%" > zconf.h - echo "Checking for unistd.h... Yes." -else - cp -p zconf.in.h zconf.h - echo "Checking for unistd.h... No." -fi - -cat > $test.c < -#include -#include "zconf.h" - -int main() -{ -#ifndef STDC - choke me -#endif - - return 0; -} -EOF - -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()" - - cat > $test.c < -#include - -int mytest(char *fmt, ...) -{ - char buf[20]; - va_list ap; - - va_start(ap, fmt); - vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return 0; -} - -int main() -{ - return (mytest("Hello%d\n", 1)); -} -EOF - - if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then - echo "Checking for vsnprintf() in stdio.h... Yes." - - cat >$test.c < -#include - -int mytest(char *fmt, ...) -{ - int n; - char buf[20]; - va_list ap; - - va_start(ap, fmt); - n = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return n; -} - -int main() -{ - return (mytest("Hello%d\n", 1)); -} -EOF - - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - echo "Checking for return value of vsnprintf()... Yes." - else - CFLAGS="$CFLAGS -DHAS_vsnprintf_void" - echo "Checking for return value of vsnprintf()... No." - echo " WARNING: apparently vsnprintf() does not return a value. zlib" - echo " can build but will be open to possible string-format security" - echo " vulnerabilities." - fi - else - CFLAGS="$CFLAGS -DNO_vsnprintf" - echo "Checking for vsnprintf() in stdio.h... No." - echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" - echo " can build but will be open to possible buffer-overflow security" - echo " vulnerabilities." - - cat >$test.c < -#include - -int mytest(char *fmt, ...) -{ - int n; - char buf[20]; - va_list ap; - - va_start(ap, fmt); - n = vsprintf(buf, fmt, ap); - va_end(ap); - return n; -} - -int main() -{ - return (mytest("Hello%d\n", 1)); -} -EOF - - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - echo "Checking for return value of vsprintf()... Yes." - else - CFLAGS="$CFLAGS -DHAS_vsprintf_void" - echo "Checking for return value of vsprintf()... No." - echo " WARNING: apparently vsprintf() does not return a value. zlib" - echo " can build but will be open to possible string-format security" - echo " vulnerabilities." - fi - fi -else - echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()" - - cat >$test.c < - -int mytest() -{ - char buf[20]; - - snprintf(buf, sizeof(buf), "%s", "foo"); - return 0; -} - -int main() -{ - return (mytest()); -} -EOF - - if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then - echo "Checking for snprintf() in stdio.h... Yes." - - cat >$test.c < - -int mytest() -{ - char buf[20]; - - return snprintf(buf, sizeof(buf), "%s", "foo"); -} - -int main() -{ - return (mytest()); -} -EOF - - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - echo "Checking for return value of snprintf()... Yes." - else - CFLAGS="$CFLAGS -DHAS_snprintf_void" - echo "Checking for return value of snprintf()... No." - echo " WARNING: apparently snprintf() does not return a value. zlib" - echo " can build but will be open to possible string-format security" - echo " vulnerabilities." - fi - else - CFLAGS="$CFLAGS -DNO_snprintf" - echo "Checking for snprintf() in stdio.h... No." - echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" - echo " can build but will be open to possible buffer-overflow security" - echo " vulnerabilities." - - cat >$test.c < - -int mytest() -{ - char buf[20]; - - return sprintf(buf, "%s", "foo"); -} - -int main() -{ - return (mytest()); -} -EOF - - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - echo "Checking for return value of sprintf()... Yes." - else - CFLAGS="$CFLAGS -DHAS_sprintf_void" - echo "Checking for return value of sprintf()... No." - echo " WARNING: apparently sprintf() does not return a value. zlib" - echo " can build but will be open to possible string-format security" - echo " vulnerabilities." - fi - fi -fi - -cat >$test.c < -int main() { return 0; } -EOF -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - echo "Checking for errno.h... Yes." -else - echo "Checking for errno.h... No." - CFLAGS="$CFLAGS -DNO_ERRNO_H" -fi - -cat > $test.c < -#include -#include -caddr_t hello() { - return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0); -} -EOF -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then - CFLAGS="$CFLAGS -DUSE_MMAP" - echo Checking for mmap support... Yes. -else - echo Checking for mmap support... No. -fi - -CPP=${CPP-"$CC -E"} -case $CFLAGS in - *ASMV*) - if test "`nm $test.o | grep _hello`" = ""; then - CPP="$CPP -DNO_UNDERLINE" - echo Checking for underline in external names... No. - else - echo Checking for underline in external names... Yes. - fi;; -esac - -rm -f $test.[co] $test $test$shared_ext - -# udpate Makefile -sed < Makefile.in " -/^CC *=/s#=.*#=$CC# -/^CFLAGS *=/s#=.*#=$CFLAGS# -/^CPP *=/s#=.*#=$CPP# -/^LDSHARED *=/s#=.*#=$LDSHARED# -/^LIBS *=/s#=.*#=$LIBS# -/^SHAREDLIB *=/s#=.*#=$SHAREDLIB# -/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# -/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# -/^AR *=/s#=.*#=$AR# -/^RANLIB *=/s#=.*#=$RANLIB# -/^EXE *=/s#=.*#=$EXE# -/^prefix *=/s#=.*#=$prefix# -/^exec_prefix *=/s#=.*#=$exec_prefix# -/^libdir *=/s#=.*#=$libdir# -/^includedir *=/s#=.*#=$includedir# -/^mandir *=/s#=.*#=$mandir# -/^LDFLAGS *=/s#=.*#=$LDFLAGS# -" > Makefile diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/deflate.c b/components/dfs/filesystems/jffs2/cyg/compress/src/deflate.c deleted file mode 100644 index 29ce1f64a5..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/deflate.c +++ /dev/null @@ -1,1736 +0,0 @@ -/* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process depends on being able to identify portions - * of the input text which are identical to earlier input (within a - * sliding window trailing behind the input currently being processed). - * - * The most straightforward technique turns out to be the fastest for - * most input files: try all possible matches and select the longest. - * The key feature of this algorithm is that insertions into the string - * dictionary are very simple and thus fast, and deletions are avoided - * completely. Insertions are performed at each input character, whereas - * string matches are performed only when the previous match ends. So it - * is preferable to spend more time in matches to allow very fast string - * insertions and avoid deletions. The matching algorithm for small - * strings is inspired from that of Rabin & Karp. A brute force approach - * is used to find longer strings when a small match has been found. - * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze - * (by Leonid Broukhis). - * A previous version of this file used a more sophisticated algorithm - * (by Fiala and Greene) which is guaranteed to run in linear amortized - * time, but has a larger average cost, uses more memory and is patented. - * However the F&G algorithm may be faster for some highly redundant - * files if the parameter max_chain_length (described below) is too large. - * - * ACKNOWLEDGEMENTS - * - * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and - * I found it in 'freeze' written by Leonid Broukhis. - * Thanks to many people for bug reports and testing. - * - * REFERENCES - * - * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". - * Available in http://www.ietf.org/rfc/rfc1951.txt - * - * A description of the Rabin and Karp algorithm is given in the book - * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. - * - * Fiala,E.R., and Greene,D.H. - * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 - * - */ - -/* @(#) $Id$ */ - -#include "deflate.h" - -const char deflate_copyright[] = - " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* =========================================================================== - * Function prototypes. - */ -typedef enum { - need_more, /* block not completed, need more input or more output */ - block_done, /* block flush performed */ - finish_started, /* finish started, need only more output at next deflate */ - finish_done /* finish done, accept no more input or output */ -} block_state; - -typedef block_state (*compress_func) OF((deflate_state *s, int flush)); -/* Compression function. Returns the block state after the call. */ - -local void fill_window OF((deflate_state *s)); -local block_state deflate_stored OF((deflate_state *s, int flush)); -local block_state deflate_fast OF((deflate_state *s, int flush)); -#ifndef FASTEST -local block_state deflate_slow OF((deflate_state *s, int flush)); -#endif -local void lm_init OF((deflate_state *s)); -local void putShortMSB OF((deflate_state *s, uInt b)); -local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifndef FASTEST -#ifdef ASMV - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else -local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif -#endif -local uInt longest_match_fast OF((deflate_state *s, IPos cur_match)); - -#ifdef DEBUG -local void check_match OF((deflate_state *s, IPos start, IPos match, - int length)); -#endif - -/* =========================================================================== - * Local data - */ - -#define NIL 0 -/* Tail of hash chains */ - -#ifndef TOO_FAR -# define TOO_FAR 4096 -#endif -/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -typedef struct config_s { - ush good_length; /* reduce lazy search above this match length */ - ush max_lazy; /* do not perform lazy search above this match length */ - ush nice_length; /* quit search above this match length */ - ush max_chain; - compress_func func; -} config; - -#ifdef FASTEST -local const config configuration_table[2] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ -#else -local const config configuration_table[10] = { -/* good lazy nice chain */ -/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ -/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ -/* 2 */ {4, 5, 16, 8, deflate_fast}, -/* 3 */ {4, 6, 32, 32, deflate_fast}, - -/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ -/* 5 */ {8, 16, 32, 32, deflate_slow}, -/* 6 */ {8, 16, 128, 128, deflate_slow}, -/* 7 */ {8, 32, 128, 256, deflate_slow}, -/* 8 */ {32, 128, 258, 1024, deflate_slow}, -/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ -#endif - -/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 - * For deflate_fast() (levels <= 3) good is ignored and lazy has a different - * meaning. - */ - -#define EQUAL 0 -/* result of memcmp for equal strings */ - -#ifndef NO_DUMMY_DECL -struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ -#endif - -/* =========================================================================== - * Update a hash value with the given input byte - * IN assertion: all calls to to UPDATE_HASH are made with consecutive - * input characters, so that a running hash key can be computed from the - * previous key instead of complete recalculation each time. - */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) - - -/* =========================================================================== - * Insert string str in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * If this file is compiled with -DFASTEST, the compression level is forced - * to 1, and no hash chains are maintained. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of str are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ -#ifdef FASTEST -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#else -#define INSERT_STRING(s, str, match_head) \ - (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ - match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ - s->head[s->ins_h] = (Pos)(str)) -#endif - -/* =========================================================================== - * Initialize the hash table (avoiding 64K overflow for 16 bit systems). - * prev[] will be initialized on the fly. - */ -#define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); - -/* ========================================================================= */ -int ZEXPORT deflateInit_(strm, level, version, stream_size) - z_streamp strm; - int level; - const char *version; - int stream_size; -{ - return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, - Z_DEFAULT_STRATEGY, version, stream_size); - /* To do: ignore strm->next_in if we use it as window */ -} - -/* ========================================================================= */ -int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, - version, stream_size) - z_streamp strm; - int level; - int method; - int windowBits; - int memLevel; - int strategy; - const char *version; - int stream_size; -{ - deflate_state *s; - int wrap = 1; - static const char my_version[] = ZLIB_VERSION; - - ushf *overlay; - /* We overlay pending_buf and d_buf+l_buf. This works since the average - * output size for (length,distance) codes is <= 24 bits. - */ - - if (version == Z_NULL || version[0] != my_version[0] || - stream_size != sizeof(z_stream)) { - return Z_VERSION_ERROR; - } - if (strm == Z_NULL) return Z_STREAM_ERROR; - - strm->msg = Z_NULL; - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } -#ifdef GZIP - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } -#endif - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ - s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); - if (s == Z_NULL) return Z_MEM_ERROR; - strm->state = (struct internal_state FAR *)s; - s->strm = strm; - - s->wrap = wrap; - s->gzhead = Z_NULL; - s->w_bits = windowBits; - s->w_size = 1 << s->w_bits; - s->w_mask = s->w_size - 1; - - s->hash_bits = memLevel + 7; - s->hash_size = 1 << s->hash_bits; - s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); - - s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); - s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); - s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); - - s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - s->pending_buf = (uchf *) overlay; - s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); - - if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || - s->pending_buf == Z_NULL) { - s->status = FINISH_STATE; - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); - deflateEnd (strm); - return Z_MEM_ERROR; - } - s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - - s->level = level; - s->strategy = strategy; - s->method = (Byte)method; - - return deflateReset(strm); -} - -/* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) - z_streamp strm; - const Bytef *dictionary; - uInt dictLength; -{ - deflate_state *s; - uInt length = dictLength; - uInt n; - IPos hash_head = 0; - - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || - strm->state->wrap == 2 || - (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) - return Z_STREAM_ERROR; - - s = strm->state; - if (s->wrap) - strm->adler = adler32(strm->adler, dictionary, dictLength); - - if (length < MIN_MATCH) return Z_OK; - if (length > MAX_DIST(s)) { - length = MAX_DIST(s); - dictionary += dictLength - length; /* use the tail of the dictionary */ - } - zmemcpy(s->window, dictionary, length); - s->strstart = length; - s->block_start = (long)length; - - /* Insert all strings in the hash table (except for the last two bytes). - * s->lookahead stays null, so s->ins_h will be recomputed at the next - * call of fill_window. - */ - s->ins_h = s->window[0]; - UPDATE_HASH(s, s->ins_h, s->window[1]); - for (n = 0; n <= length - MIN_MATCH; n++) { - INSERT_STRING(s, n, hash_head); - } - if (hash_head) hash_head = 0; /* to make compiler happy */ - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateReset (strm) - z_streamp strm; -{ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { - return Z_STREAM_ERROR; - } - - strm->total_in = strm->total_out = 0; - strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ - strm->data_type = Z_UNKNOWN; - - s = (deflate_state *)strm->state; - s->pending = 0; - s->pending_out = s->pending_buf; - - if (s->wrap < 0) { - s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ - } - s->status = s->wrap ? INIT_STATE : BUSY_STATE; - strm->adler = -#ifdef GZIP - s->wrap == 2 ? crc32(0L, Z_NULL, 0) : -#endif - adler32(0L, Z_NULL, 0); - s->last_flush = Z_NO_FLUSH; - - _tr_init(s); - lm_init(s); - - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) - z_streamp strm; - gz_headerp head; -{ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - if (strm->state->wrap != 2) return Z_STREAM_ERROR; - strm->state->gzhead = head; - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) - z_streamp strm; - int bits; - int value; -{ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - strm->state->bi_valid = bits; - strm->state->bi_buf = (ush)(value & ((1 << bits) - 1)); - return Z_OK; -} - -/* ========================================================================= */ -int ZEXPORT deflateParams(strm, level, strategy) - z_streamp strm; - int level; - int strategy; -{ - deflate_state *s; - compress_func func; - int err = Z_OK; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - s = strm->state; - -#ifdef FASTEST - if (level != 0) level = 1; -#else - if (level == Z_DEFAULT_COMPRESSION) level = 6; -#endif - if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { - return Z_STREAM_ERROR; - } - func = configuration_table[s->level].func; - - if (func != configuration_table[level].func && strm->total_in != 0) { - /* Flush the last buffer: */ - err = deflate(strm, Z_PARTIAL_FLUSH); - } - if (s->level != level) { - s->level = level; - s->max_lazy_match = configuration_table[level].max_lazy; - s->good_match = configuration_table[level].good_length; - s->nice_match = configuration_table[level].nice_length; - s->max_chain_length = configuration_table[level].max_chain; - } - s->strategy = strategy; - return err; -} - -/* ========================================================================= */ -int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) - z_streamp strm; - int good_length; - int max_lazy; - int nice_length; - int max_chain; -{ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - s = strm->state; - s->good_match = good_length; - s->max_lazy_match = max_lazy; - s->nice_match = nice_length; - s->max_chain_length = max_chain; - return Z_OK; -} - -/* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. - * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. - * - * This function could be more sophisticated to provide closer upper bounds - * for every combination of windowBits and memLevel, as well as wrap. - * But even the conservative upper bound of about 14% expansion does not - * seem onerous for output buffer allocation. - */ -uLong ZEXPORT deflateBound(strm, sourceLen) - z_streamp strm; - uLong sourceLen; -{ - deflate_state *s; - uLong destLen; - - /* conservative upper bound */ - destLen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11; - - /* if can't get parameters, return conservative bound */ - if (strm == Z_NULL || strm->state == Z_NULL) - return destLen; - - /* if not default parameters, return conservative bound */ - s = strm->state; - if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return destLen; - - /* default settings: return tight bound for that case */ - return compressBound(sourceLen); -} - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -local void putShortMSB (s, b) - deflate_state *s; - uInt b; -{ - put_byte(s, (Byte)(b >> 8)); - put_byte(s, (Byte)(b & 0xff)); -} - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->next_out buffer and copying into it. - * (See also read_buf()). - */ -local void flush_pending(strm) - z_streamp strm; -{ - unsigned len = strm->state->pending; - - if (len > strm->avail_out) len = strm->avail_out; - if (len == 0) return; - - zmemcpy(strm->next_out, strm->state->pending_out, len); - strm->next_out += len; - strm->state->pending_out += len; - strm->total_out += len; - strm->avail_out -= len; - strm->state->pending -= len; - if (strm->state->pending == 0) { - strm->state->pending_out = strm->state->pending_buf; - } -} - -/* ========================================================================= */ -int ZEXPORT deflate (strm, flush) - z_streamp strm; - int flush; -{ - int old_flush; /* value of flush param for previous deflate call */ - deflate_state *s; - - if (strm == Z_NULL || strm->state == Z_NULL || - flush > Z_FINISH || flush < 0) { - return Z_STREAM_ERROR; - } - s = strm->state; - - if (strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0) || - (s->status == FINISH_STATE && flush != Z_FINISH)) { - ERR_RETURN(strm, Z_STREAM_ERROR); - } - if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - - s->strm = strm; /* just in case */ - old_flush = s->last_flush; - s->last_flush = flush; - - /* Write the header */ - if (s->status == INIT_STATE) { -#ifdef GZIP - if (s->wrap == 2) { - strm->adler = crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (s->gzhead == NULL) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s->status = BUSY_STATE; - } - else { - put_byte(s, (s->gzhead->text ? 1 : 0) + - (s->gzhead->hcrc ? 2 : 0) + - (s->gzhead->extra == Z_NULL ? 0 : 4) + - (s->gzhead->name == Z_NULL ? 0 : 8) + - (s->gzhead->comment == Z_NULL ? 0 : 16) - ); - put_byte(s, (Byte)(s->gzhead->time & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, s->gzhead->os & 0xff); - if (s->gzhead->extra != NULL) { - put_byte(s, s->gzhead->extra_len & 0xff); - put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); - } - if (s->gzhead->hcrc) - strm->adler = crc32(strm->adler, s->pending_buf, - s->pending); - s->gzindex = 0; - s->status = EXTRA_STATE; - } - } - else -#endif - { - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags; - - if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) - level_flags = 0; - else if (s->level < 6) - level_flags = 1; - else if (s->level == 6) - level_flags = 2; - else - level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); - - s->status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - strm->adler = adler32(0L, Z_NULL, 0); - } - } -#ifdef GZIP - if (s->status == EXTRA_STATE) { - if (s->gzhead->extra != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - - while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) - break; - } - put_byte(s, s->gzhead->extra[s->gzindex]); - s->gzindex++; - } - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (s->gzindex == s->gzhead->extra_len) { - s->gzindex = 0; - s->status = NAME_STATE; - } - } - else - s->status = NAME_STATE; - } - if (s->status == NAME_STATE) { - if (s->gzhead->name != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - int val; - - do { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; - } - } - val = s->gzhead->name[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) { - s->gzindex = 0; - s->status = COMMENT_STATE; - } - } - else - s->status = COMMENT_STATE; - } - if (s->status == COMMENT_STATE) { - if (s->gzhead->comment != NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - int val; - - do { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; - } - } - val = s->gzhead->comment[s->gzindex++]; - put_byte(s, val); - } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) - s->status = HCRC_STATE; - } - else - s->status = HCRC_STATE; - } - if (s->status == HCRC_STATE) { - if (s->gzhead->hcrc) { - if (s->pending + 2 > s->pending_buf_size) - flush_pending(strm); - if (s->pending + 2 <= s->pending_buf_size) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - strm->adler = crc32(0L, Z_NULL, 0); - s->status = BUSY_STATE; - } - } - else - s->status = BUSY_STATE; - } -#endif - - /* Flush as much pending output as possible */ - if (s->pending != 0) { - flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s->last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm->avail_in == 0 && flush <= old_flush && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm->avail_in != 0 || s->lookahead != 0 || - (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { - block_state bstate; - - bstate = (*(configuration_table[s->level].func))(s, flush); - - if (bstate == finish_started || bstate == finish_done) { - s->status = FINISH_STATE; - } - if (bstate == need_more || bstate == finish_started) { - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate == block_done) { - if (flush == Z_PARTIAL_FLUSH) { - _tr_align(s); - } else { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block(s, (char*)0, 0L, 0); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush == Z_FULL_FLUSH) { - CLEAR_HASH(s); /* forget history */ - } - } - flush_pending(strm); - if (strm->avail_out == 0) { - s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - Assert(strm->avail_out > 0, "bug2"); - - if (flush != Z_FINISH) return Z_OK; - if (s->wrap <= 0) return Z_STREAM_END; - - /* Write the trailer */ -#ifdef GZIP - if (s->wrap == 2) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); - put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); - put_byte(s, (Byte)(strm->total_in & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); - put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); - } - else -#endif - { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); - } - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ - return s->pending != 0 ? Z_OK : Z_STREAM_END; -} - -/* ========================================================================= */ -int ZEXPORT deflateEnd (strm) - z_streamp strm; -{ - int status; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - - status = strm->state->status; - if (status != INIT_STATE && - status != EXTRA_STATE && - status != NAME_STATE && - status != COMMENT_STATE && - status != HCRC_STATE && - status != BUSY_STATE && - status != FINISH_STATE) { - return Z_STREAM_ERROR; - } - - /* Deallocate in reverse order of allocations: */ - TRY_FREE(strm, strm->state->pending_buf); - TRY_FREE(strm, strm->state->head); - TRY_FREE(strm, strm->state->prev); - TRY_FREE(strm, strm->state->window); - - ZFREE(strm, strm->state); - strm->state = Z_NULL; - - return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; -} - -/* ========================================================================= - * Copy the source state to the destination state. - * To simplify the source, this is not supported for 16-bit MSDOS (which - * doesn't have enough memory anyway to duplicate compression states). - */ -int ZEXPORT deflateCopy (dest, source) - z_streamp dest; - z_streamp source; -{ -#ifdef MAXSEG_64K - return Z_STREAM_ERROR; -#else - deflate_state *ds; - deflate_state *ss; - ushf *overlay; - - - if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { - return Z_STREAM_ERROR; - } - - ss = source->state; - - zmemcpy(dest, source, sizeof(z_stream)); - - ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); - if (ds == Z_NULL) return Z_MEM_ERROR; - dest->state = (struct internal_state FAR *) ds; - zmemcpy(ds, ss, sizeof(deflate_state)); - ds->strm = dest; - - ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); - ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); - ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); - ds->pending_buf = (uchf *) overlay; - - if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || - ds->pending_buf == Z_NULL) { - deflateEnd (dest); - return Z_MEM_ERROR; - } - /* following zmemcpy do not work for 16-bit MSDOS */ - zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); - zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); - zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); - - ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); - ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); - ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; - - ds->l_desc.dyn_tree = ds->dyn_ltree; - ds->d_desc.dyn_tree = ds->dyn_dtree; - ds->bl_desc.dyn_tree = ds->bl_tree; - - return Z_OK; -#endif /* MAXSEG_64K */ -} - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->next_in buffer and copying from it. - * (See also flush_pending()). - */ -local int read_buf(strm, buf, size) - z_streamp strm; - Bytef *buf; - unsigned size; -{ - unsigned len = strm->avail_in; - - if (len > size) len = size; - if (len == 0) return 0; - - strm->avail_in -= len; - - if (strm->state->wrap == 1) { - strm->adler = adler32(strm->adler, strm->next_in, len); - } -#ifdef GZIP - else if (strm->state->wrap == 2) { - strm->adler = crc32(strm->adler, strm->next_in, len); - } -#endif - zmemcpy(buf, strm->next_in, len); - strm->next_in += len; - strm->total_in += len; - - return (int)len; -} - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -local void lm_init (s) - deflate_state *s; -{ - s->window_size = (ulg)2L*s->w_size; - - CLEAR_HASH(s); - - /* Set the default configuration parameters: - */ - s->max_lazy_match = configuration_table[s->level].max_lazy; - s->good_match = configuration_table[s->level].good_length; - s->nice_match = configuration_table[s->level].nice_length; - s->max_chain_length = configuration_table[s->level].max_chain; - - s->strstart = 0; - s->block_start = 0L; - s->lookahead = 0; - s->match_length = s->prev_length = MIN_MATCH-1; - s->match_available = 0; - s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif -} - -#ifndef FASTEST -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ -local uInt longest_match(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - unsigned chain_length = s->max_chain_length;/* max hash chain length */ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ - int nice_match = s->nice_match; /* stop if match long enough */ - IPos limit = s->strstart > (IPos)MAX_DIST(s) ? - s->strstart - (IPos)MAX_DIST(s) : NIL; - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - Posf *prev = s->prev; - uInt wmask = s->w_mask; - -#ifdef UNALIGNED_OK - /* Compare two bytes at a time. Note: this is not always beneficial. - * Try with and without -DUNALIGNED_OK to check. - */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); -#else - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; - register Byte scan_end = scan[best_len]; -#endif - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s->prev_length >= s->good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - Assert(cur_match < s->strstart, "no future"); - match = s->window + cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ -#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) - /* This code assumes sizeof(unsigned short) == 2. Do not use - * UNALIGNED_OK if your compiler uses a different size. - */ - if (*(ushf*)(match+best_len-1) != scan_end || - *(ushf*)match != scan_start) continue; - - /* It is not necessary to compare scan[2] and match[2] since they are - * always equal when the other bytes match, given that the hash keys - * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient - * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is - * necessary to put more guard bytes at the end of the window, or - * to check more often for insufficient lookahead. - */ - Assert(scan[2] == match[2], "scan[2]?"); - scan++, match++; - do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - scan < strend); - /* The funny "do {}" generates better code on most compilers */ - - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - if (*scan == *match) scan++; - - len = (MAX_MATCH - 1) - (int)(strend-scan); - scan = strend - (MAX_MATCH-1); - -#else /* UNALIGNED_OK */ - - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match++; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - scan = strend - MAX_MATCH; - -#endif /* UNALIGNED_OK */ - - if (len > best_len) { - s->match_start = cur_match; - best_len = len; - if (len >= nice_match) break; -#ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); -#else - scan_end1 = scan[best_len-1]; - scan_end = scan[best_len]; -#endif - } - } while ((cur_match = prev[cur_match & wmask]) > limit - && --chain_length != 0); - - if ((uInt)best_len <= s->lookahead) return (uInt)best_len; - return s->lookahead; -} -#endif /* ASMV */ -#endif /* FASTEST */ - -/* --------------------------------------------------------------------------- - * Optimized version for level == 1 or strategy == Z_RLE only - */ -local uInt longest_match_fast(s, cur_match) - deflate_state *s; - IPos cur_match; /* current match */ -{ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - Assert(cur_match < s->strstart, "no future"); - - match = s->window + cur_match; - - /* Return failure if the match length is less than 2: - */ - if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2, match += 2; - Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (*++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - *++scan == *++match && *++scan == *++match && - scan < strend); - - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (int)(strend - scan); - - if (len < MIN_MATCH) return MIN_MATCH - 1; - - s->match_start = cur_match; - return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; -} - -#ifdef DEBUG -/* =========================================================================== - * Check that the match at match_start is indeed a match. - */ -local void check_match(s, start, match, length) - deflate_state *s; - IPos start, match; - int length; -{ - /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); - do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); - z_error("invalid match"); - } - if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); - do { putc(s->window[start++], stderr); } while (--length != 0); - } -} -#else -# define check_match(s, start, match, length) -#endif /* DEBUG */ - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -local void fill_window(s) - deflate_state *s; -{ - register unsigned n, m; - register Posf *p; - unsigned more; /* Amount of free space at the end of the window. */ - uInt wsize = s->w_size; - - do { - more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); - - /* Deal with !@#$% 64K limit: */ - if (sizeof(int) <= 2) { - if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - more = wsize; - - } else if (more == (unsigned)(-1)) { - /* Very unlikely, but possible on 16 bit machine if - * strstart == 0 && lookahead == 1 (input done a byte at time) - */ - more--; - } - } - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s->strstart >= wsize+MAX_DIST(s)) { - - zmemcpy(s->window, s->window+wsize, (unsigned)wsize); - s->match_start -= wsize; - s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ - s->block_start -= (long) wsize; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - /* %%% avoid this when Z_RLE */ - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - } while (--n); - - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif - more += wsize; - } - if (s->strm->avail_in == 0) return; - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - Assert(more >= 2, "more < 2"); - - n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); - s->lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s->lookahead >= MIN_MATCH) { - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); -} - -/* =========================================================================== - * Flush the current block, with given end-of-file flag. - * IN assertion: strstart is set to the end of the current match. - */ -#define FLUSH_BLOCK_ONLY(s, eof) { \ - _tr_flush_block(s, (s->block_start >= 0L ? \ - (charf *)&s->window[(unsigned)s->block_start] : \ - (charf *)Z_NULL), \ - (ulg)((long)s->strstart - s->block_start), \ - (eof)); \ - s->block_start = s->strstart; \ - flush_pending(s->strm); \ - Tracev((stderr,"[FLUSH]")); \ -} - -/* Same but force premature exit if necessary. */ -#define FLUSH_BLOCK(s, eof) { \ - FLUSH_BLOCK_ONLY(s, eof); \ - if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -local block_state deflate_stored(s, flush) - deflate_state *s; - int flush; -{ - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - ulg max_block_size = 0xffff; - ulg max_start; - - if (max_block_size > s->pending_buf_size - 5) { - max_block_size = s->pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s->lookahead <= 1) { - - Assert(s->strstart < s->w_size+MAX_DIST(s) || - s->block_start >= (long)s->w_size, "slide too late"); - - fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; - - if (s->lookahead == 0) break; /* flush the current block */ - } - Assert(s->block_start >= 0L, "block gone"); - - s->strstart += s->lookahead; - s->lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - max_start = s->block_start + max_block_size; - if (s->strstart == 0 || (ulg)s->strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s->lookahead = (uInt)(s->strstart - max_start); - s->strstart = (uInt)max_start; - FLUSH_BLOCK(s, 0); - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { - FLUSH_BLOCK(s, 0); - } - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -local block_state deflate_fast(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head = NIL; /* head of the hash chain */ - int bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ -#ifdef FASTEST - if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) || - (s->strategy == Z_RLE && s->strstart - hash_head == 1)) { - s->match_length = longest_match_fast (s, hash_head); - } -#else - if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { - s->match_length = longest_match (s, hash_head); - } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { - s->match_length = longest_match_fast (s, hash_head); - } -#endif - /* longest_match() or longest_match_fast() sets match_start */ - } - if (s->match_length >= MIN_MATCH) { - check_match(s, s->strstart, s->match_start, s->match_length); - - _tr_tally_dist(s, s->strstart - s->match_start, - s->match_length - MIN_MATCH, bflush); - - s->lookahead -= s->match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ -#ifndef FASTEST - if (s->match_length <= s->max_insert_length && - s->lookahead >= MIN_MATCH) { - s->match_length--; /* string at strstart already in table */ - do { - s->strstart++; - INSERT_STRING(s, s->strstart, hash_head); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s->match_length != 0); - s->strstart++; - } else -#endif - { - s->strstart += s->match_length; - s->match_length = 0; - s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); -#if MIN_MATCH != 3 - Call UPDATE_HASH() MIN_MATCH-3 more times -#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} - -#ifndef FASTEST -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -local block_state deflate_slow(s, flush) - deflate_state *s; - int flush; -{ - IPos hash_head = NIL; /* head of hash chain */ - int bflush; /* set if current block must be flushed */ - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s->lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - if (s->lookahead >= MIN_MATCH) { - INSERT_STRING(s, s->strstart, hash_head); - } - - /* Find the longest match, discarding those <= prev_length. - */ - s->prev_length = s->match_length, s->prev_match = s->match_start; - s->match_length = MIN_MATCH-1; - - if (hash_head != NIL && s->prev_length < s->max_lazy_match && - s->strstart - hash_head <= MAX_DIST(s)) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { - s->match_length = longest_match (s, hash_head); - } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { - s->match_length = longest_match_fast (s, hash_head); - } - /* longest_match() or longest_match_fast() sets match_start */ - - if (s->match_length <= 5 && (s->strategy == Z_FILTERED -#if TOO_FAR <= 32767 - || (s->match_length == MIN_MATCH && - s->strstart - s->match_start > TOO_FAR) -#endif - )) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s->match_length = MIN_MATCH-1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { - uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - check_match(s, s->strstart-1, s->prev_match, s->prev_length); - - _tr_tally_dist(s, s->strstart -1 - s->prev_match, - s->prev_length - MIN_MATCH, bflush); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s->lookahead -= s->prev_length-1; - s->prev_length -= 2; - do { - if (++s->strstart <= max_insert) { - INSERT_STRING(s, s->strstart, hash_head); - } - } while (--s->prev_length != 0); - s->match_available = 0; - s->match_length = MIN_MATCH-1; - s->strstart++; - - if (bflush) FLUSH_BLOCK(s, 0); - - } else if (s->match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - if (bflush) { - FLUSH_BLOCK_ONLY(s, 0); - } - s->strstart++; - s->lookahead--; - if (s->strm->avail_out == 0) return need_more; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s->match_available = 1; - s->strstart++; - s->lookahead--; - } - } - Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); - s->match_available = 0; - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} -#endif /* FASTEST */ - -#if 0 -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -local block_state deflate_rle(s, flush) - deflate_state *s; - int flush; -{ - int bflush; /* set if current block must be flushed */ - uInt run; /* length of run */ - uInt max; /* maximum length of run */ - uInt prev; /* byte at distance one to match */ - Bytef *scan; /* scan for end of run */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest encodable run. - */ - if (s->lookahead < MAX_MATCH) { - fill_window(s); - if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { - return need_more; - } - if (s->lookahead == 0) break; /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - run = 0; - if (s->strstart > 0) { /* if there is a previous byte, that is */ - max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH; - scan = s->window + s->strstart - 1; - prev = *scan++; - do { - if (*scan++ != prev) - break; - } while (++run < max); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (run >= MIN_MATCH) { - check_match(s, s->strstart, s->strstart - 1, run); - _tr_tally_dist(s, 1, run - MIN_MATCH, bflush); - s->lookahead -= run; - s->strstart += run; - } else { - /* No match, output a literal byte */ - Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); - s->lookahead--; - s->strstart++; - } - if (bflush) FLUSH_BLOCK(s, 0); - } - FLUSH_BLOCK(s, flush == Z_FINISH); - return flush == Z_FINISH ? finish_done : block_done; -} -#endif diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/deflate.h b/components/dfs/filesystems/jffs2/cyg/compress/src/deflate.h deleted file mode 100644 index 05a5ab3a2c..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/deflate.h +++ /dev/null @@ -1,331 +0,0 @@ -/* deflate.h -- internal compression state - * Copyright (C) 1995-2004 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef DEFLATE_H -#define DEFLATE_H - -#include "zutil.h" - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer creation by deflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip encoding - should be left enabled. */ -#ifndef NO_GZIP -# define GZIP -#endif - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 -/* Stream status */ - - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ - Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to supress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - - uInt lit_bufsize; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - int last_eob_len; /* bit length of EOB code for last block */ - -#ifdef DEBUG - ulg compressed_len; /* total bit length of compressed file mod 2^32 */ - ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ -#endif - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - -} FAR deflate_state; - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} - - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - - /* in trees.c */ -void _tr_init OF((deflate_state *s)); -int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); -void _tr_align OF((deflate_state *s)); -void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -#ifndef DEBUG -/* Inline versions of _tr_tally for speed: */ - -#if defined(GEN_TREES_H) || !defined(STDC) - extern uch _length_code[]; - extern uch _dist_code[]; -#else - extern const uch _length_code[]; - extern const uch _dist_code[]; -#endif - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -#else -# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) -# define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) -#endif - -#endif /* DEFLATE_H */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/descrip.mms b/components/dfs/filesystems/jffs2/cyg/compress/src/descrip.mms deleted file mode 100644 index 9d364598a2..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/descrip.mms +++ /dev/null @@ -1,48 +0,0 @@ -# descrip.mms: MMS description file for building zlib on VMS -# written by Martin P.J. Zinser - -cc_defs = -c_deb = - -.ifdef __DECC__ -pref = /prefix=all -.endif - -OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\ - deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\ - inftrees.obj, infcodes.obj, infutil.obj, inffast.obj - -CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) - -all : example.exe minigzip.exe - @ write sys$output " Example applications available" -libz.olb : libz.olb($(OBJS)) - @ write sys$output " libz available" - -example.exe : example.obj libz.olb - link example,libz.olb/lib - -minigzip.exe : minigzip.obj libz.olb - link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib - -clean : - delete *.obj;*,libz.olb;* - - -# Other dependencies. -adler32.obj : zutil.h zlib.h zconf.h -compress.obj : zlib.h zconf.h -crc32.obj : zutil.h zlib.h zconf.h -deflate.obj : deflate.h zutil.h zlib.h zconf.h -example.obj : zlib.h zconf.h -gzio.obj : zutil.h zlib.h zconf.h -infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h -infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h -inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h -inflate.obj : zutil.h zlib.h zconf.h infblock.h -inftrees.obj : zutil.h zlib.h zconf.h inftrees.h -infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h -minigzip.obj : zlib.h zconf.h -trees.obj : deflate.h zutil.h zlib.h zconf.h -uncompr.obj : zlib.h zconf.h -zutil.obj : zutil.h zlib.h zconf.h diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/example.c b/components/dfs/filesystems/jffs2/cyg/compress/src/example.c deleted file mode 100644 index 6c8a0ee763..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/example.c +++ /dev/null @@ -1,565 +0,0 @@ -/* example.c -- usage example of the zlib compression library - * Copyright (C) 1995-2004 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include -#include "zlib.h" - -#ifdef STDC -# include -# include -#endif - -#if defined(VMS) || defined(RISCOS) -# define TESTFILE "foo-gz" -#else -# define TESTFILE "foo.gz" -#endif - -#define CHECK_ERR(err, msg) { \ - if (err != Z_OK) { \ - fprintf(stderr, "%s error: %d\n", msg, err); \ - exit(1); \ - } \ -} - -const char hello[] = "hello, hello!"; -/* "hello world" would be more standard, but the repeated "hello" - * stresses the compression code better, sorry... - */ - -const char dictionary[] = "hello"; -uLong dictId; /* Adler32 value of the dictionary */ - -void test_compress OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_gzio OF((const char *fname, - Byte *uncompr, uLong uncomprLen)); -void test_deflate OF((Byte *compr, uLong comprLen)); -void test_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_large_deflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_large_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_flush OF((Byte *compr, uLong *comprLen)); -void test_sync OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -void test_dict_deflate OF((Byte *compr, uLong comprLen)); -void test_dict_inflate OF((Byte *compr, uLong comprLen, - Byte *uncompr, uLong uncomprLen)); -int main OF((int argc, char *argv[])); - -/* =========================================================================== - * Test compress() and uncompress() - */ -void test_compress(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - uLong len = (uLong)strlen(hello)+1; - - err = compress(compr, &comprLen, (const Bytef*)hello, len); - CHECK_ERR(err, "compress"); - - strcpy((char*)uncompr, "garbage"); - - err = uncompress(uncompr, &uncomprLen, compr, comprLen); - CHECK_ERR(err, "uncompress"); - - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad uncompress\n"); - exit(1); - } else { - printf("uncompress(): %s\n", (char *)uncompr); - } -} - -/* =========================================================================== - * Test read/write of .gz files - */ -void test_gzio(fname, uncompr, uncomprLen) - const char *fname; /* compressed file name */ - Byte *uncompr; - uLong uncomprLen; -{ -#ifdef NO_GZCOMPRESS - fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); -#else - int err; - int len = (int)strlen(hello)+1; - gzFile file; - z_off_t pos; - - file = gzopen(fname, "wb"); - if (file == NULL) { - fprintf(stderr, "gzopen error\n"); - exit(1); - } - gzputc(file, 'h'); - if (gzputs(file, "ello") != 4) { - fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err)); - exit(1); - } - if (gzprintf(file, ", %s!", "hello") != 8) { - fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err)); - exit(1); - } - gzseek(file, 1L, SEEK_CUR); /* add one zero byte */ - gzclose(file); - - file = gzopen(fname, "rb"); - if (file == NULL) { - fprintf(stderr, "gzopen error\n"); - exit(1); - } - strcpy((char*)uncompr, "garbage"); - - if (gzread(file, uncompr, (unsigned)uncomprLen) != len) { - fprintf(stderr, "gzread err: %s\n", gzerror(file, &err)); - exit(1); - } - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad gzread: %s\n", (char*)uncompr); - exit(1); - } else { - printf("gzread(): %s\n", (char*)uncompr); - } - - pos = gzseek(file, -8L, SEEK_CUR); - if (pos != 6 || gztell(file) != pos) { - fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", - (long)pos, (long)gztell(file)); - exit(1); - } - - if (gzgetc(file) != ' ') { - fprintf(stderr, "gzgetc error\n"); - exit(1); - } - - if (gzungetc(' ', file) != ' ') { - fprintf(stderr, "gzungetc error\n"); - exit(1); - } - - gzgets(file, (char*)uncompr, (int)uncomprLen); - if (strlen((char*)uncompr) != 7) { /* " hello!" */ - fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); - exit(1); - } - if (strcmp((char*)uncompr, hello + 6)) { - fprintf(stderr, "bad gzgets after gzseek\n"); - exit(1); - } else { - printf("gzgets() after gzseek: %s\n", (char*)uncompr); - } - - gzclose(file); -#endif -} - -/* =========================================================================== - * Test deflate() with small buffers - */ -void test_deflate(compr, comprLen) - Byte *compr; - uLong comprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - uLong len = (uLong)strlen(hello)+1; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); - CHECK_ERR(err, "deflateInit"); - - c_stream.next_in = (Bytef*)hello; - c_stream.next_out = compr; - - while (c_stream.total_in != len && c_stream.total_out < comprLen) { - c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */ - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - } - /* Finish the stream, still forcing small buffers: */ - for (;;) { - c_stream.avail_out = 1; - err = deflate(&c_stream, Z_FINISH); - if (err == Z_STREAM_END) break; - CHECK_ERR(err, "deflate"); - } - - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); -} - -/* =========================================================================== - * Test inflate() with small buffers - */ -void test_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = 0; - d_stream.next_out = uncompr; - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) { - d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */ - err = inflate(&d_stream, Z_NO_FLUSH); - if (err == Z_STREAM_END) break; - CHECK_ERR(err, "inflate"); - } - - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad inflate\n"); - exit(1); - } else { - printf("inflate(): %s\n", (char *)uncompr); - } -} - -/* =========================================================================== - * Test deflate() with large buffers and dynamic change of compression level - */ -void test_large_deflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_BEST_SPEED); - CHECK_ERR(err, "deflateInit"); - - c_stream.next_out = compr; - c_stream.avail_out = (uInt)comprLen; - - /* At this point, uncompr is still mostly zeroes, so it should compress - * very well: - */ - c_stream.next_in = uncompr; - c_stream.avail_in = (uInt)uncomprLen; - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - if (c_stream.avail_in != 0) { - fprintf(stderr, "deflate not greedy\n"); - exit(1); - } - - /* Feed in already compressed data and switch to no compression: */ - deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); - c_stream.next_in = compr; - c_stream.avail_in = (uInt)comprLen/2; - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - - /* Switch back to compressing mode: */ - deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED); - c_stream.next_in = uncompr; - c_stream.avail_in = (uInt)uncomprLen; - err = deflate(&c_stream, Z_NO_FLUSH); - CHECK_ERR(err, "deflate"); - - err = deflate(&c_stream, Z_FINISH); - if (err != Z_STREAM_END) { - fprintf(stderr, "deflate should report Z_STREAM_END\n"); - exit(1); - } - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); -} - -/* =========================================================================== - * Test inflate() with large buffers - */ -void test_large_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = (uInt)comprLen; - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - for (;;) { - d_stream.next_out = uncompr; /* discard the output */ - d_stream.avail_out = (uInt)uncomprLen; - err = inflate(&d_stream, Z_NO_FLUSH); - if (err == Z_STREAM_END) break; - CHECK_ERR(err, "large inflate"); - } - - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - if (d_stream.total_out != 2*uncomprLen + comprLen/2) { - fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out); - exit(1); - } else { - printf("large_inflate(): OK\n"); - } -} - -/* =========================================================================== - * Test deflate() with full flush - */ -void test_flush(compr, comprLen) - Byte *compr; - uLong *comprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - uInt len = (uInt)strlen(hello)+1; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); - CHECK_ERR(err, "deflateInit"); - - c_stream.next_in = (Bytef*)hello; - c_stream.next_out = compr; - c_stream.avail_in = 3; - c_stream.avail_out = (uInt)*comprLen; - err = deflate(&c_stream, Z_FULL_FLUSH); - CHECK_ERR(err, "deflate"); - - compr[3]++; /* force an error in first compressed block */ - c_stream.avail_in = len - 3; - - err = deflate(&c_stream, Z_FINISH); - if (err != Z_STREAM_END) { - CHECK_ERR(err, "deflate"); - } - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); - - *comprLen = c_stream.total_out; -} - -/* =========================================================================== - * Test inflateSync() - */ -void test_sync(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = 2; /* just read the zlib header */ - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - d_stream.next_out = uncompr; - d_stream.avail_out = (uInt)uncomprLen; - - inflate(&d_stream, Z_NO_FLUSH); - CHECK_ERR(err, "inflate"); - - d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */ - err = inflateSync(&d_stream); /* but skip the damaged part */ - CHECK_ERR(err, "inflateSync"); - - err = inflate(&d_stream, Z_FINISH); - if (err != Z_DATA_ERROR) { - fprintf(stderr, "inflate should report DATA_ERROR\n"); - /* Because of incorrect adler32 */ - exit(1); - } - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - printf("after inflateSync(): hel%s\n", (char *)uncompr); -} - -/* =========================================================================== - * Test deflate() with preset dictionary - */ -void test_dict_deflate(compr, comprLen) - Byte *compr; - uLong comprLen; -{ - z_stream c_stream; /* compression stream */ - int err; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - err = deflateInit(&c_stream, Z_BEST_COMPRESSION); - CHECK_ERR(err, "deflateInit"); - - err = deflateSetDictionary(&c_stream, - (const Bytef*)dictionary, sizeof(dictionary)); - CHECK_ERR(err, "deflateSetDictionary"); - - dictId = c_stream.adler; - c_stream.next_out = compr; - c_stream.avail_out = (uInt)comprLen; - - c_stream.next_in = (Bytef*)hello; - c_stream.avail_in = (uInt)strlen(hello)+1; - - err = deflate(&c_stream, Z_FINISH); - if (err != Z_STREAM_END) { - fprintf(stderr, "deflate should report Z_STREAM_END\n"); - exit(1); - } - err = deflateEnd(&c_stream); - CHECK_ERR(err, "deflateEnd"); -} - -/* =========================================================================== - * Test inflate() with a preset dictionary - */ -void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) - Byte *compr, *uncompr; - uLong comprLen, uncomprLen; -{ - int err; - z_stream d_stream; /* decompression stream */ - - strcpy((char*)uncompr, "garbage"); - - d_stream.zalloc = (alloc_func)0; - d_stream.zfree = (free_func)0; - d_stream.opaque = (voidpf)0; - - d_stream.next_in = compr; - d_stream.avail_in = (uInt)comprLen; - - err = inflateInit(&d_stream); - CHECK_ERR(err, "inflateInit"); - - d_stream.next_out = uncompr; - d_stream.avail_out = (uInt)uncomprLen; - - for (;;) { - err = inflate(&d_stream, Z_NO_FLUSH); - if (err == Z_STREAM_END) break; - if (err == Z_NEED_DICT) { - if (d_stream.adler != dictId) { - fprintf(stderr, "unexpected dictionary"); - exit(1); - } - err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary, - sizeof(dictionary)); - } - CHECK_ERR(err, "inflate with dict"); - } - - err = inflateEnd(&d_stream); - CHECK_ERR(err, "inflateEnd"); - - if (strcmp((char*)uncompr, hello)) { - fprintf(stderr, "bad inflate with dict\n"); - exit(1); - } else { - printf("inflate with dictionary: %s\n", (char *)uncompr); - } -} - -/* =========================================================================== - * Usage: example [output.gz [input.gz]] - */ - -int main(argc, argv) - int argc; - char *argv[]; -{ - Byte *compr, *uncompr; - uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ - uLong uncomprLen = comprLen; - static const char* myVersion = ZLIB_VERSION; - - if (zlibVersion()[0] != myVersion[0]) { - fprintf(stderr, "incompatible zlib version\n"); - exit(1); - - } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) { - fprintf(stderr, "warning: different zlib version\n"); - } - - printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n", - ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags()); - - compr = (Byte*)calloc((uInt)comprLen, 1); - uncompr = (Byte*)calloc((uInt)uncomprLen, 1); - /* compr and uncompr are cleared to avoid reading uninitialized - * data and to ensure that uncompr compresses well. - */ - if (compr == Z_NULL || uncompr == Z_NULL) { - printf("out of memory\n"); - exit(1); - } - test_compress(compr, comprLen, uncompr, uncomprLen); - - test_gzio((argc > 1 ? argv[1] : TESTFILE), - uncompr, uncomprLen); - - test_deflate(compr, comprLen); - test_inflate(compr, comprLen, uncompr, uncomprLen); - - test_large_deflate(compr, comprLen, uncompr, uncomprLen); - test_large_inflate(compr, comprLen, uncompr, uncomprLen); - - test_flush(compr, &comprLen); - test_sync(compr, comprLen, uncompr, uncomprLen); - comprLen = uncomprLen; - - test_dict_deflate(compr, comprLen); - test_dict_inflate(compr, comprLen, uncompr, uncomprLen); - - free(compr); - free(uncompr); - - return 0; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/gzio.c b/components/dfs/filesystems/jffs2/cyg/compress/src/gzio.c deleted file mode 100644 index 7e90f4928f..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/gzio.c +++ /dev/null @@ -1,1026 +0,0 @@ -/* gzio.c -- IO on .gz files - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Compile this file with -DNO_GZCOMPRESS to avoid the compression code. - */ - -/* @(#) $Id$ */ - -#include - -#include "zutil.h" - -#ifdef NO_DEFLATE /* for compatibility with old definition */ -# define NO_GZCOMPRESS -#endif - -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - -#ifndef Z_BUFSIZE -# ifdef MAXSEG_64K -# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ -# else -# define Z_BUFSIZE 16384 -# endif -#endif -#ifndef Z_PRINTF_BUFSIZE -# define Z_PRINTF_BUFSIZE 4096 -#endif - -#ifdef __MVS__ -# pragma map (fdopen , "\174\174FDOPEN") - FILE *fdopen(int, const char *); -#endif - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern void free OF((voidpf ptr)); -#endif - -#define ALLOC(size) malloc(size) -#define TRYFREE(p) {if (p) free(p);} - -static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -/* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -typedef struct gz_stream { - z_stream stream; - int z_err; /* error code for last stream operation */ - int z_eof; /* set if end of input file */ - FILE *file; /* .gz file */ - Byte *inbuf; /* input buffer */ - Byte *outbuf; /* output buffer */ - uLong crc; /* crc32 of uncompressed data */ - char *msg; /* error message */ - char *path; /* path name for debugging only */ - int transparent; /* 1 if input file is not a .gz file */ - char mode; /* 'w' or 'r' */ - z_off_t start; /* start of compressed data in file (header skipped) */ - z_off_t in; /* bytes into deflate or inflate */ - z_off_t out; /* bytes out of deflate or inflate */ - int back; /* one character push-back */ - int last; /* true if push-back is last character */ -} gz_stream; - - -local gzFile gz_open OF((const char *path, const char *mode, int fd)); -local int do_flush OF((gzFile file, int flush)); -local int get_byte OF((gz_stream *s)); -local void check_header OF((gz_stream *s)); -local int destroy OF((gz_stream *s)); -local void putLong OF((FILE *file, uLong x)); -local uLong getLong OF((gz_stream *s)); - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb"). The file is given either by file descriptor - or path name (if fd == -1). - gz_open returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). -*/ -local gzFile gz_open (path, mode, fd) - const char *path; - const char *mode; - int fd; -{ - int err; - int level = Z_DEFAULT_COMPRESSION; /* compression level */ - int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ - char *p = (char*)mode; - gz_stream *s; - char fmode[80]; /* copy of mode, without the compression level */ - char *m = fmode; - - if (!path || !mode) return Z_NULL; - - s = (gz_stream *)ALLOC(sizeof(gz_stream)); - if (!s) return Z_NULL; - - s->stream.zalloc = (alloc_func)0; - s->stream.zfree = (free_func)0; - s->stream.opaque = (voidpf)0; - s->stream.next_in = s->inbuf = Z_NULL; - s->stream.next_out = s->outbuf = Z_NULL; - s->stream.avail_in = s->stream.avail_out = 0; - s->file = NULL; - s->z_err = Z_OK; - s->z_eof = 0; - s->in = 0; - s->out = 0; - s->back = EOF; - s->crc = crc32(0L, Z_NULL, 0); - s->msg = NULL; - s->transparent = 0; - - s->path = (char*)ALLOC(strlen(path)+1); - if (s->path == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - strcpy(s->path, path); /* do this early for debugging */ - - s->mode = '\0'; - do { - if (*p == 'r') s->mode = 'r'; - if (*p == 'w' || *p == 'a') s->mode = 'w'; - if (*p >= '0' && *p <= '9') { - level = *p - '0'; - } else if (*p == 'f') { - strategy = Z_FILTERED; - } else if (*p == 'h') { - strategy = Z_HUFFMAN_ONLY; - } else if (*p == 'R') { - strategy = Z_RLE; - } else { - *m++ = *p; /* copy the mode */ - } - } while (*p++ && m != fmode + sizeof(fmode)); - if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateInit2(&(s->stream), level, - Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); - /* windowBits is passed < 0 to suppress zlib header */ - - s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); -#endif - if (err != Z_OK || s->outbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } else { - s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); - - err = inflateInit2(&(s->stream), -MAX_WBITS); - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are - * present after the compressed stream. - */ - if (err != Z_OK || s->inbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } - s->stream.avail_out = Z_BUFSIZE; - - errno = 0; - s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); - - if (s->file == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - if (s->mode == 'w') { - /* Write a very simple .gz header: - */ - fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], - Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); - s->start = 10L; - /* We use 10L instead of ftell(s->file) to because ftell causes an - * fflush on some systems. This version of the library doesn't use - * start anyway in write mode, so this initialization is not - * necessary. - */ - } else { - check_header(s); /* skip the .gz header */ - s->start = ftell(s->file) - s->stream.avail_in; - } - - return (gzFile)s; -} - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. -*/ -gzFile ZEXPORT gzopen (path, mode) - const char *path; - const char *mode; -{ - return gz_open (path, mode, -1); -} - -/* =========================================================================== - Associate a gzFile with the file descriptor fd. fd is not dup'ed here - to mimic the behavio(u)r of fdopen. -*/ -gzFile ZEXPORT gzdopen (fd, mode) - int fd; - const char *mode; -{ - char name[46]; /* allow for up to 128-bit integers */ - - if (fd < 0) return (gzFile)Z_NULL; - sprintf(name, "", fd); /* for debugging */ - - return gz_open (name, mode, fd); -} - -/* =========================================================================== - * Update the compression level and strategy - */ -int ZEXPORT gzsetparams (file, level, strategy) - gzFile file; - int level; - int strategy; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - /* Make room to allow flushing */ - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { - s->z_err = Z_ERRNO; - } - s->stream.avail_out = Z_BUFSIZE; - } - - return deflateParams (&(s->stream), level, strategy); -} - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ -local int get_byte(s) - gz_stream *s; -{ - if (s->z_eof) return EOF; - if (s->stream.avail_in == 0) { - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) s->z_err = Z_ERRNO; - return EOF; - } - s->stream.next_in = s->inbuf; - } - s->stream.avail_in--; - return *(s->stream.next_in)++; -} - -/* =========================================================================== - Check the gzip header of a gz_stream opened for reading. Set the stream - mode to transparent if the gzip magic header is not present; set s->err - to Z_DATA_ERROR if the magic header is present but the rest of the header - is incorrect. - IN assertion: the stream s has already been created sucessfully; - s->stream.avail_in is zero for the first time, but may be non-zero - for concatenated .gz files. -*/ -local void check_header(s) - gz_stream *s; -{ - int method; /* method byte */ - int flags; /* flags byte */ - uInt len; - int c; - - /* Assure two bytes in the buffer so we can peek ahead -- handle case - where first byte of header is at the end of the buffer after the last - gzip segment */ - len = s->stream.avail_in; - if (len < 2) { - if (len) s->inbuf[0] = s->stream.next_in[0]; - errno = 0; - len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); - if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; - s->stream.avail_in += len; - s->stream.next_in = s->inbuf; - if (s->stream.avail_in < 2) { - s->transparent = s->stream.avail_in; - return; - } - } - - /* Peek ahead to check the gzip magic header */ - if (s->stream.next_in[0] != gz_magic[0] || - s->stream.next_in[1] != gz_magic[1]) { - s->transparent = 1; - return; - } - s->stream.avail_in -= 2; - s->stream.next_in += 2; - - /* Check the rest of the gzip header */ - method = get_byte(s); - flags = get_byte(s); - if (method != Z_DEFLATED || (flags & RESERVED) != 0) { - s->z_err = Z_DATA_ERROR; - return; - } - - /* Discard time, xflags and OS code: */ - for (len = 0; len < 6; len++) (void)get_byte(s); - - if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ - len = (uInt)get_byte(s); - len += ((uInt)get_byte(s))<<8; - /* len is garbage if EOF but the loop below will quit anyway */ - while (len-- != 0 && get_byte(s) != EOF) ; - } - if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ - for (len = 0; len < 2; len++) (void)get_byte(s); - } - s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; -} - - /* =========================================================================== - * Cleanup then free the given gz_stream. Return a zlib error code. - Try freeing in the reverse order of allocations. - */ -local int destroy (s) - gz_stream *s; -{ - int err = Z_OK; - - if (!s) return Z_STREAM_ERROR; - - TRYFREE(s->msg); - - if (s->stream.state != NULL) { - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateEnd(&(s->stream)); -#endif - } else if (s->mode == 'r') { - err = inflateEnd(&(s->stream)); - } - } - if (s->file != NULL && fclose(s->file)) { -#ifdef ESPIPE - if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ -#endif - err = Z_ERRNO; - } - if (s->z_err < 0) err = s->z_err; - - TRYFREE(s->inbuf); - TRYFREE(s->outbuf); - TRYFREE(s->path); - TRYFREE(s); - return err; -} - -/* =========================================================================== - Reads the given number of uncompressed bytes from the compressed file. - gzread returns the number of bytes actually read (0 for end of file). -*/ -int ZEXPORT gzread (file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - Bytef *start = (Bytef*)buf; /* starting point for crc computation */ - Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ - - if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; - - if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; - if (s->z_err == Z_STREAM_END) return 0; /* EOF */ - - next_out = (Byte*)buf; - s->stream.next_out = (Bytef*)buf; - s->stream.avail_out = len; - - if (s->stream.avail_out && s->back != EOF) { - *next_out++ = s->back; - s->stream.next_out++; - s->stream.avail_out--; - s->back = EOF; - s->out++; - start++; - if (s->last) { - s->z_err = Z_STREAM_END; - return 1; - } - } - - while (s->stream.avail_out != 0) { - - if (s->transparent) { - /* Copy first the lookahead bytes: */ - uInt n = s->stream.avail_in; - if (n > s->stream.avail_out) n = s->stream.avail_out; - if (n > 0) { - zmemcpy(s->stream.next_out, s->stream.next_in, n); - next_out += n; - s->stream.next_out = next_out; - s->stream.next_in += n; - s->stream.avail_out -= n; - s->stream.avail_in -= n; - } - if (s->stream.avail_out > 0) { - s->stream.avail_out -= - (uInt)fread(next_out, 1, s->stream.avail_out, s->file); - } - len -= s->stream.avail_out; - s->in += len; - s->out += len; - if (len == 0) s->z_eof = 1; - return (int)len; - } - if (s->stream.avail_in == 0 && !s->z_eof) { - - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) { - s->z_err = Z_ERRNO; - break; - } - } - s->stream.next_in = s->inbuf; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = inflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - - if (s->z_err == Z_STREAM_END) { - /* Check CRC and original size */ - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - start = s->stream.next_out; - - if (getLong(s) != s->crc) { - s->z_err = Z_DATA_ERROR; - } else { - (void)getLong(s); - /* The uncompressed length returned by above getlong() may be - * different from s->out in case of concatenated .gz files. - * Check for such files: - */ - check_header(s); - if (s->z_err == Z_OK) { - inflateReset(&(s->stream)); - s->crc = crc32(0L, Z_NULL, 0); - } - } - } - if (s->z_err != Z_OK || s->z_eof) break; - } - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - - if (len == s->stream.avail_out && - (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) - return -1; - return (int)(len - s->stream.avail_out); -} - - -/* =========================================================================== - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ -int ZEXPORT gzgetc(file) - gzFile file; -{ - unsigned char c; - - return gzread(file, &c, 1) == 1 ? c : -1; -} - - -/* =========================================================================== - Push one byte back onto the stream. -*/ -int ZEXPORT gzungetc(c, file) - int c; - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF; - s->back = c; - s->out--; - s->last = (s->z_err == Z_STREAM_END); - if (s->last) s->z_err = Z_OK; - s->z_eof = 0; - return c; -} - - -/* =========================================================================== - Reads bytes from the compressed file until len-1 characters are - read, or a newline character is read and transferred to buf, or an - end-of-file condition is encountered. The string is then terminated - with a null character. - gzgets returns buf, or Z_NULL in case of error. - - The current implementation is not optimized at all. -*/ -char * ZEXPORT gzgets(file, buf, len) - gzFile file; - char *buf; - int len; -{ - char *b = buf; - if (buf == Z_NULL || len <= 0) return Z_NULL; - - while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ; - *buf = '\0'; - return b == buf && len > 0 ? Z_NULL : b; -} - - -#ifndef NO_GZCOMPRESS -/* =========================================================================== - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of bytes actually written (0 in case of error). -*/ -int ZEXPORT gzwrite (file, buf, len) - gzFile file; - voidpc buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.next_in = (Bytef*)buf; - s->stream.avail_in = len; - - while (s->stream.avail_in != 0) { - - if (s->stream.avail_out == 0) { - - s->stream.next_out = s->outbuf; - if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) { - s->z_err = Z_ERRNO; - break; - } - s->stream.avail_out = Z_BUFSIZE; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = deflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - if (s->z_err != Z_OK) break; - } - s->crc = crc32(s->crc, (const Bytef *)buf, len); - - return (int)(len - s->stream.avail_in); -} - - -/* =========================================================================== - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). -*/ -#ifdef STDC -#include - -int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...) -{ - char buf[Z_PRINTF_BUFSIZE]; - va_list va; - int len; - - buf[sizeof(buf) - 1] = 0; - va_start(va, format); -#ifdef NO_vsnprintf -# ifdef HAS_vsprintf_void - (void)vsprintf(buf, format, va); - va_end(va); - for (len = 0; len < sizeof(buf); len++) - if (buf[len] == 0) break; -# else - len = vsprintf(buf, format, va); - va_end(va); -# endif -#else -# ifdef HAS_vsnprintf_void - (void)vsnprintf(buf, sizeof(buf), format, va); - va_end(va); - len = strlen(buf); -# else - len = vsnprintf(buf, sizeof(buf), format, va); - va_end(va); -# endif -#endif - if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0) - return 0; - return gzwrite(file, buf, (unsigned)len); -} -#else /* not ANSI C */ - -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - gzFile file; - const char *format; - int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, - a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; -{ - char buf[Z_PRINTF_BUFSIZE]; - int len; - - buf[sizeof(buf) - 1] = 0; -#ifdef NO_snprintf -# ifdef HAS_sprintf_void - sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - for (len = 0; len < sizeof(buf); len++) - if (buf[len] == 0) break; -# else - len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#else -# ifdef HAS_snprintf_void - snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); - len = strlen(buf); -# else - len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8, - a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); -# endif -#endif - if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0) - return 0; - return gzwrite(file, buf, len); -} -#endif - -/* =========================================================================== - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ -int ZEXPORT gzputc(file, c) - gzFile file; - int c; -{ - unsigned char cc = (unsigned char) c; /* required for big endian systems */ - - return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1; -} - - -/* =========================================================================== - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ -int ZEXPORT gzputs(file, s) - gzFile file; - const char *s; -{ - return gzwrite(file, (char*)s, (unsigned)strlen(s)); -} - - -/* =========================================================================== - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. -*/ -local int do_flush (file, flush) - gzFile file; - int flush; -{ - uInt len; - int done = 0; - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR; - - s->stream.avail_in = 0; /* should be zero already anyway */ - - for (;;) { - len = Z_BUFSIZE - s->stream.avail_out; - - if (len != 0) { - if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) { - s->z_err = Z_ERRNO; - return Z_ERRNO; - } - s->stream.next_out = s->outbuf; - s->stream.avail_out = Z_BUFSIZE; - } - if (done) break; - s->out += s->stream.avail_out; - s->z_err = deflate(&(s->stream), flush); - s->out -= s->stream.avail_out; - - /* Ignore the second of two consecutive flushes: */ - if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK; - - /* deflate has finished flushing only when it hasn't used up - * all the available space in the output buffer: - */ - done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END); - - if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break; - } - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; -} - -int ZEXPORT gzflush (file, flush) - gzFile file; - int flush; -{ - gz_stream *s = (gz_stream*)file; - int err = do_flush (file, flush); - - if (err) return err; - fflush(s->file); - return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; -} -#endif /* NO_GZCOMPRESS */ - -/* =========================================================================== - Sets the starting position for the next gzread or gzwrite on the given - compressed file. The offset represents a number of bytes in the - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error. - SEEK_END is not implemented, returns error. - In this version of the library, gzseek can be extremely slow. -*/ -z_off_t ZEXPORT gzseek (file, offset, whence) - gzFile file; - z_off_t offset; - int whence; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || whence == SEEK_END || - s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) { - return -1L; - } - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - return -1L; -#else - if (whence == SEEK_SET) { - offset -= s->in; - } - if (offset < 0) return -1L; - - /* At this point, offset is the number of zero bytes to write. */ - if (s->inbuf == Z_NULL) { - s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */ - if (s->inbuf == Z_NULL) return -1L; - zmemzero(s->inbuf, Z_BUFSIZE); - } - while (offset > 0) { - uInt size = Z_BUFSIZE; - if (offset < Z_BUFSIZE) size = (uInt)offset; - - size = gzwrite(file, s->inbuf, size); - if (size == 0) return -1L; - - offset -= size; - } - return s->in; -#endif - } - /* Rest of function is for reading only */ - - /* compute absolute position */ - if (whence == SEEK_CUR) { - offset += s->out; - } - if (offset < 0) return -1L; - - if (s->transparent) { - /* map to fseek */ - s->back = EOF; - s->stream.avail_in = 0; - s->stream.next_in = s->inbuf; - if (fseek(s->file, offset, SEEK_SET) < 0) return -1L; - - s->in = s->out = offset; - return offset; - } - - /* For a negative seek, rewind and use positive seek */ - if (offset >= s->out) { - offset -= s->out; - } else if (gzrewind(file) < 0) { - return -1L; - } - /* offset is now the number of bytes to skip. */ - - if (offset != 0 && s->outbuf == Z_NULL) { - s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); - if (s->outbuf == Z_NULL) return -1L; - } - if (offset && s->back != EOF) { - s->back = EOF; - s->out++; - offset--; - if (s->last) s->z_err = Z_STREAM_END; - } - while (offset > 0) { - int size = Z_BUFSIZE; - if (offset < Z_BUFSIZE) size = (int)offset; - - size = gzread(file, s->outbuf, (uInt)size); - if (size <= 0) return -1L; - offset -= size; - } - return s->out; -} - -/* =========================================================================== - Rewinds input file. -*/ -int ZEXPORT gzrewind (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r') return -1; - - s->z_err = Z_OK; - s->z_eof = 0; - s->back = EOF; - s->stream.avail_in = 0; - s->stream.next_in = s->inbuf; - s->crc = crc32(0L, Z_NULL, 0); - if (!s->transparent) (void)inflateReset(&s->stream); - s->in = 0; - s->out = 0; - return fseek(s->file, s->start, SEEK_SET); -} - -/* =========================================================================== - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. -*/ -z_off_t ZEXPORT gztell (file) - gzFile file; -{ - return gzseek(file, 0L, SEEK_CUR); -} - -/* =========================================================================== - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ -int ZEXPORT gzeof (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - /* With concatenated compressed files that can have embedded - * crc trailers, z_eof is no longer the only/best indicator of EOF - * on a gz_stream. Handle end-of-stream error explicitly here. - */ - if (s == NULL || s->mode != 'r') return 0; - if (s->z_eof) return 1; - return s->z_err == Z_STREAM_END; -} - -/* =========================================================================== - Returns 1 if reading and doing so transparently, otherwise zero. -*/ -int ZEXPORT gzdirect (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL || s->mode != 'r') return 0; - return s->transparent; -} - -/* =========================================================================== - Outputs a long in LSB order to the given file -*/ -local void putLong (file, x) - FILE *file; - uLong x; -{ - int n; - for (n = 0; n < 4; n++) { - fputc((int)(x & 0xff), file); - x >>= 8; - } -} - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets z_err in case - of error. -*/ -local uLong getLong (s) - gz_stream *s; -{ - uLong x = (uLong)get_byte(s); - int c; - - x += ((uLong)get_byte(s))<<8; - x += ((uLong)get_byte(s))<<16; - c = get_byte(s); - if (c == EOF) s->z_err = Z_DATA_ERROR; - x += ((uLong)c)<<24; - return x; -} - -/* =========================================================================== - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. -*/ -int ZEXPORT gzclose (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return Z_STREAM_ERROR; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - return Z_STREAM_ERROR; -#else - if (do_flush (file, Z_FINISH) != Z_OK) - return destroy((gz_stream*)file); - - putLong (s->file, s->crc); - putLong (s->file, (uLong)(s->in & 0xffffffff)); -#endif - } - return destroy((gz_stream*)file); -} - -#ifdef STDC -# define zstrerror(errnum) strerror(errnum) -#else -# define zstrerror(errnum) "" -#endif - -/* =========================================================================== - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ -const char * ZEXPORT gzerror (file, errnum) - gzFile file; - int *errnum; -{ - char *m; - gz_stream *s = (gz_stream*)file; - - if (s == NULL) { - *errnum = Z_STREAM_ERROR; - return (const char*)ERR_MSG(Z_STREAM_ERROR); - } - *errnum = s->z_err; - if (*errnum == Z_OK) return (const char*)""; - - m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg); - - if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err); - - TRYFREE(s->msg); - s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3); - if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR); - strcpy(s->msg, s->path); - strcat(s->msg, ": "); - strcat(s->msg, m); - return (const char*)s->msg; -} - -/* =========================================================================== - Clear the error and end-of-file flags, and do the same for the real file. -*/ -void ZEXPORT gzclearerr (file) - gzFile file; -{ - gz_stream *s = (gz_stream*)file; - - if (s == NULL) return; - if (s->z_err != Z_STREAM_END) s->z_err = Z_OK; - s->z_eof = 0; - clearerr(s->file); -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/infback.c b/components/dfs/filesystems/jffs2/cyg/compress/src/infback.c deleted file mode 100644 index 455dbc9ee8..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/infback.c +++ /dev/null @@ -1,623 +0,0 @@ -/* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - This code is largely copied from inflate.c. Normally either infback.o or - inflate.o would be linked into an application--not both. The interface - with inffast.c is retained so that optimized assembler-coded versions of - inflate_fast() can be used with either inflate.c or infback.c. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); - -/* - strm provides memory allocation functions in zalloc and zfree, or - Z_NULL to use the library memory allocation functions. - - windowBits is in the range 8..15, and window is a user-supplied - window and output buffer that is 2**windowBits bytes. - */ -int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) -z_streamp strm; -int windowBits; -unsigned char FAR *window; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL || window == Z_NULL || - windowBits < 8 || windowBits > 15) - return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *)ZALLOC(strm, 1, - sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - state->dmax = 32768U; - state->wbits = windowBits; - state->wsize = 1U << windowBits; - state->window = window; - state->write = 0; - state->whave = 0; - return Z_OK; -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -/* Macros for inflateBack(): */ - -/* Load returned state from inflate_fast() */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Set state from registers for inflate_fast() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Assure that some input is available. If input is requested, but denied, - then return a Z_BUF_ERROR from inflateBack(). */ -#define PULL() \ - do { \ - if (have == 0) { \ - have = in(in_desc, &next); \ - if (have == 0) { \ - next = Z_NULL; \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflateBack() - with an error if there is no input available. */ -#define PULLBYTE() \ - do { \ - PULL(); \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflateBack() with - an error. */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Assure that some output space is available, by writing out the window - if it's full. If the write fails, return from inflateBack() with a - Z_BUF_ERROR. */ -#define ROOM() \ - do { \ - if (left == 0) { \ - put = state->window; \ - left = state->wsize; \ - state->whave = left; \ - if (out(out_desc, put, left)) { \ - ret = Z_BUF_ERROR; \ - goto inf_leave; \ - } \ - } \ - } while (0) - -/* - strm provides the memory allocation functions and window buffer on input, - and provides information on the unused input on return. For Z_DATA_ERROR - returns, strm will also provide an error message. - - in() and out() are the call-back input and output functions. When - inflateBack() needs more input, it calls in(). When inflateBack() has - filled the window with output, or when it completes with data in the - window, it calls out() to write out the data. The application must not - change the provided input until in() is called again or inflateBack() - returns. The application must not change the window/output buffer until - inflateBack() returns. - - in() and out() are called with a descriptor parameter provided in the - inflateBack() call. This parameter can be a structure that provides the - information required to do the read or write, as well as accumulated - information on the input and output such as totals and check values. - - in() should return zero on failure. out() should return non-zero on - failure. If either in() or out() fails, than inflateBack() returns a - Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it - was in() or out() that caused in the error. Otherwise, inflateBack() - returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format - error, or Z_MEM_ERROR if it could not allocate memory for the state. - inflateBack() can also return Z_STREAM_ERROR if the input parameters - are not correct, i.e. strm is Z_NULL or the state was not initialized. - */ -int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) -z_streamp strm; -in_func in; -void FAR *in_desc; -out_func out; -void FAR *out_desc; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - /* Check that the strm exists and that the state was initialized */ - if (strm == Z_NULL || strm->state == Z_NULL) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - - /* Reset the state */ - strm->msg = Z_NULL; - state->mode = TYPE; - state->last = 0; - state->whave = 0; - next = strm->next_in; - have = next != Z_NULL ? strm->avail_in : 0; - hold = 0; - bits = 0; - put = state->window; - left = state->wsize; - - /* Inflate until end of block marked as last */ - for (;;) - switch (state->mode) { - case TYPE: - /* determine and dispatch block type */ - if (state->last) { - BYTEBITS(); - state->mode = DONE; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - - case STORED: - /* get and verify stored block length */ - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - - /* copy stored block from input to output */ - while (state->length != 0) { - copy = state->length; - PULL(); - ROOM(); - if (copy > have) copy = have; - if (copy > left) copy = left; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - - case TABLE: - /* get dynamic table entries descriptor */ - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - - /* get code length code lengths (not a typo) */ - state->have = 0; - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - - /* get length and distance code code lengths */ - state->have = 0; - while (state->have < state->nlen + state->ndist) { - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = (unsigned)(state->lens[state->have - 1]); - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - - case LEN: - /* use inflate_fast() if we have enough input and output */ - if (have >= 6 && left >= 258) { - RESTORE(); - if (state->whave < state->wsize) - state->whave = state->wsize - left; - inflate_fast(strm, state->wsize); - LOAD(); - break; - } - - /* get a literal, length, or end-of-block code */ - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - - /* process literal */ - if (this.op == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - ROOM(); - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - } - - /* process end of block */ - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - - /* invalid code */ - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - - /* length code -- get extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - - /* get distance code */ - for (;;) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - - /* get distance extra bits, if any */ - state->extra = (unsigned)(this.op) & 15; - if (state->extra != 0) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } - if (state->offset > state->wsize - (state->whave < state->wsize ? - left : 0)) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - - /* copy match from window to output */ - do { - ROOM(); - copy = state->wsize - state->offset; - if (copy < left) { - from = put + copy; - copy = left - copy; - } - else { - from = put - state->offset; - copy = left; - } - if (copy > state->length) copy = state->length; - state->length -= copy; - left -= copy; - do { - *put++ = *from++; - } while (--copy); - } while (state->length != 0); - break; - - case DONE: - /* inflate stream terminated properly -- write leftover output */ - ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } - goto inf_leave; - - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - - default: /* can't happen, but makes compilers happy */ - ret = Z_STREAM_ERROR; - goto inf_leave; - } - - /* Return unused input */ - inf_leave: - strm->next_in = next; - strm->avail_in = have; - return ret; -} - -int ZEXPORT inflateBackEnd(strm) -z_streamp strm; -{ - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/infblock.c b/components/dfs/filesystems/jffs2/cyg/compress/src/infblock.c deleted file mode 100644 index c2521d5a87..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/infblock.c +++ /dev/null @@ -1,403 +0,0 @@ -/* infblock.c -- interpret and process block types to last block - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "infblock.h" -#include "inftrees.h" -//#include "infcodes.h" //no such file! -#include "infutil.h" - -struct inflate_codes_state {int dummy;}; /* for buggy compilers */ - -/* simplify the use of the inflate_huft type with some defines */ -#define exop word.what.Exop -#define bits word.what.Bits - -/* Table for deflate from PKZIP's appnote.txt. */ -local const uInt border[] = { /* Order of the bit length code lengths */ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - -/* - Notes beyond the 1.93a appnote.txt: - - 1. Distance pointers never point before the beginning of the output - stream. - 2. Distance pointers can point back across blocks, up to 32k away. - 3. There is an implied maximum of 7 bits for the bit length table and - 15 bits for the actual data. - 4. If only one code exists, then it is encoded using one bit. (Zero - would be more efficient, but perhaps a little confusing.) If two - codes exist, they are coded using one bit each (0 and 1). - 5. There is no way of sending zero distance codes--a dummy must be - sent if there are none. (History: a pre 2.0 version of PKZIP would - store blocks with no distance codes, but this was discovered to be - too harsh a criterion.) Valid only for 1.93a. 2.04c does allow - zero distance codes, which is sent as one code of zero bits in - length. - 6. There are up to 286 literal/length codes. Code 256 represents the - end-of-block. Note however that the static length tree defines - 288 codes just to fill out the Huffman codes. Codes 286 and 287 - cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. - However, static trees define 32 codes (all 5 bits) to fill out the - Huffman codes, but the last two had better not show up in the data. - 7. Unzip can check dynamic Huffman blocks for complete code sets. - The exception is that a single code would not be complete (see #4). - 8. The five bits following the block type is really the number of - literal codes sent minus 257. - 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits - (1+6+6). Therefore, to output three times the length, you output - three codes (1+1+1), whereas to output four times the same length, - you only need two codes (1+3). Hmm. - 10. In the tree reconstruction algorithm, Code = Code + Increment - only if BitLength(i) is not zero. (Pretty obvious.) - 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) - 12. Note: length code 284 can represent 227-258, but length code 285 - really is 258. The last length deserves its own, short code - since it gets used a lot in very redundant files. The length - 258 is special since 258 - 3 (the min match length) is 255. - 13. The literal/length and distance code bit lengths are read as a - single stream of lengths. It is possible (and advantageous) for - a repeat code (16, 17, or 18) to go across the boundary between - the two sets of lengths. - */ - - -void inflate_blocks_reset(s, z, c) -inflate_blocks_statef *s; -z_streamp z; -uLongf *c; -{ - if (c != Z_NULL) - *c = s->check; - if (s->mode == BTREE || s->mode == DTREE) - ZFREE(z, s->sub.trees.blens); - if (s->mode == CODES) - inflate_codes_free(s->sub.decode.codes, z); - s->mode = TYPE; - s->bitk = 0; - s->bitb = 0; - s->read = s->write = s->window; - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); - Tracev((stderr, "inflate: blocks reset\n")); -} - - -inflate_blocks_statef *inflate_blocks_new(z, c, w) -z_streamp z; -check_func c; -uInt w; -{ - inflate_blocks_statef *s; - - if ((s = (inflate_blocks_statef *)ZALLOC - (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL) - return s; - if ((s->hufts = - (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL) - { - ZFREE(z, s); - return Z_NULL; - } - if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL) - { - ZFREE(z, s->hufts); - ZFREE(z, s); - return Z_NULL; - } - s->end = s->window + w; - s->checkfn = c; - s->mode = TYPE; - Tracev((stderr, "inflate: blocks allocated\n")); - inflate_blocks_reset(s, z, Z_NULL); - return s; -} - - -int inflate_blocks(s, z, r) -inflate_blocks_statef *s; -z_streamp z; -int r; -{ - uInt t; /* temporary storage */ - uLong b; /* bit buffer */ - uInt k; /* bits in bit buffer */ - Bytef *p; /* input data pointer */ - uInt n; /* bytes available there */ - Bytef *q; /* output window write pointer */ - uInt m; /* bytes to end of window or read pointer */ - - /* copy input/output information to locals (UPDATE macro restores) */ - LOAD - - /* process input based on current state */ - while (1) switch (s->mode) - { - case TYPE: - NEEDBITS(3) - t = (uInt)b & 7; - s->last = t & 1; - switch (t >> 1) - { - case 0: /* stored */ - Tracev((stderr, "inflate: stored block%s\n", - s->last ? " (last)" : "")); - DUMPBITS(3) - t = k & 7; /* go to byte boundary */ - DUMPBITS(t) - s->mode = LENS; /* get length of stored block */ - break; - case 1: /* fixed */ - Tracev((stderr, "inflate: fixed codes block%s\n", - s->last ? " (last)" : "")); - { - uInt bl, bd; - inflate_huft *tl, *td; - - inflate_trees_fixed(&bl, &bd, &tl, &td, z); - s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); - if (s->sub.decode.codes == Z_NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - } - DUMPBITS(3) - s->mode = CODES; - break; - case 2: /* dynamic */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - s->last ? " (last)" : "")); - DUMPBITS(3) - s->mode = TABLE; - break; - case 3: /* illegal */ - DUMPBITS(3) - s->mode = BAD; - z->msg = (char*)"invalid block type"; - r = Z_DATA_ERROR; - LEAVE - } - break; - case LENS: - NEEDBITS(32) - if ((((~b) >> 16) & 0xffff) != (b & 0xffff)) - { - s->mode = BAD; - z->msg = (char*)"invalid stored block lengths"; - r = Z_DATA_ERROR; - LEAVE - } - s->sub.left = (uInt)b & 0xffff; - b = k = 0; /* dump bits */ - Tracev((stderr, "inflate: stored length %u\n", s->sub.left)); - s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE); - break; - case STORED: - if (n == 0) - LEAVE - NEEDOUT - t = s->sub.left; - if (t > n) t = n; - if (t > m) t = m; - zmemcpy(q, p, t); - p += t; n -= t; - q += t; m -= t; - if ((s->sub.left -= t) != 0) - break; - Tracev((stderr, "inflate: stored end, %lu total out\n", - z->total_out + (q >= s->read ? q - s->read : - (s->end - s->read) + (q - s->window)))); - s->mode = s->last ? DRY : TYPE; - break; - case TABLE: - NEEDBITS(14) - s->sub.trees.table = t = (uInt)b & 0x3fff; -#ifndef PKZIP_BUG_WORKAROUND - if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) - { - s->mode = BAD; - z->msg = (char*)"too many length or distance symbols"; - r = Z_DATA_ERROR; - LEAVE - } -#endif - t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); - if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - DUMPBITS(14) - s->sub.trees.index = 0; - Tracev((stderr, "inflate: table sizes ok\n")); - s->mode = BTREE; - case BTREE: - while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10)) - { - NEEDBITS(3) - s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7; - DUMPBITS(3) - } - while (s->sub.trees.index < 19) - s->sub.trees.blens[border[s->sub.trees.index++]] = 0; - s->sub.trees.bb = 7; - t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, - &s->sub.trees.tb, s->hufts, z); - if (t != Z_OK) - { - r = t; - if (r == Z_DATA_ERROR) - { - ZFREE(z, s->sub.trees.blens); - s->mode = BAD; - } - LEAVE - } - s->sub.trees.index = 0; - Tracev((stderr, "inflate: bits tree ok\n")); - s->mode = DTREE; - case DTREE: - while (t = s->sub.trees.table, - s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) - { - inflate_huft *h; - uInt i, j, c; - - t = s->sub.trees.bb; - NEEDBITS(t) - h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); - t = h->bits; - c = h->base; - if (c < 16) - { - DUMPBITS(t) - s->sub.trees.blens[s->sub.trees.index++] = c; - } - else /* c == 16..18 */ - { - i = c == 18 ? 7 : c - 14; - j = c == 18 ? 11 : 3; - NEEDBITS(t + i) - DUMPBITS(t) - j += (uInt)b & inflate_mask[i]; - DUMPBITS(i) - i = s->sub.trees.index; - t = s->sub.trees.table; - if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || - (c == 16 && i < 1)) - { - ZFREE(z, s->sub.trees.blens); - s->mode = BAD; - z->msg = (char*)"invalid bit length repeat"; - r = Z_DATA_ERROR; - LEAVE - } - c = c == 16 ? s->sub.trees.blens[i - 1] : 0; - do { - s->sub.trees.blens[i++] = c; - } while (--j); - s->sub.trees.index = i; - } - } - s->sub.trees.tb = Z_NULL; - { - uInt bl, bd; - inflate_huft *tl, *td; - inflate_codes_statef *c; - - bl = 9; /* must be <= 9 for lookahead assumptions */ - bd = 6; /* must be <= 9 for lookahead assumptions */ - t = s->sub.trees.table; - t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), - s->sub.trees.blens, &bl, &bd, &tl, &td, - s->hufts, z); - if (t != Z_OK) - { - if (t == (uInt)Z_DATA_ERROR) - { - ZFREE(z, s->sub.trees.blens); - s->mode = BAD; - } - r = t; - LEAVE - } - Tracev((stderr, "inflate: trees ok\n")); - if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) - { - r = Z_MEM_ERROR; - LEAVE - } - s->sub.decode.codes = c; - } - ZFREE(z, s->sub.trees.blens); - s->mode = CODES; - case CODES: - UPDATE - if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) - return inflate_flush(s, z, r); - r = Z_OK; - inflate_codes_free(s->sub.decode.codes, z); - LOAD - Tracev((stderr, "inflate: codes end, %lu total out\n", - z->total_out + (q >= s->read ? q - s->read : - (s->end - s->read) + (q - s->window)))); - if (!s->last) - { - s->mode = TYPE; - break; - } - s->mode = DRY; - case DRY: - FLUSH - if (s->read != s->write) - LEAVE - s->mode = DONE; - case DONE: - r = Z_STREAM_END; - LEAVE - case BAD: - r = Z_DATA_ERROR; - LEAVE - default: - r = Z_STREAM_ERROR; - LEAVE - } -} - - -int inflate_blocks_free(s, z) -inflate_blocks_statef *s; -z_streamp z; -{ - inflate_blocks_reset(s, z, Z_NULL); - ZFREE(z, s->window); - ZFREE(z, s->hufts); - ZFREE(z, s); - Tracev((stderr, "inflate: blocks freed\n")); - return Z_OK; -} - - -void inflate_set_dictionary(s, d, n) -inflate_blocks_statef *s; -const Bytef *d; -uInt n; -{ - zmemcpy(s->window, d, n); - s->read = s->write = s->window + n; -} - - -/* Returns true if inflate is currently at the end of a block generated - * by Z_SYNC_FLUSH or Z_FULL_FLUSH. - * IN assertion: s != Z_NULL - */ -int inflate_blocks_sync_point(s) -inflate_blocks_statef *s; -{ - return s->mode == LENS; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/infblock.h b/components/dfs/filesystems/jffs2/cyg/compress/src/infblock.h deleted file mode 100644 index 17ffbda2f8..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/infblock.h +++ /dev/null @@ -1,39 +0,0 @@ -/* infblock.h -- header to use infblock.c - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -struct inflate_blocks_state; -typedef struct inflate_blocks_state FAR inflate_blocks_statef; -typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len)); // add by prife -extern inflate_blocks_statef * inflate_blocks_new OF(( - z_streamp z, - check_func c, /* check function */ - uInt w)); /* window size */ - -extern int inflate_blocks OF(( - inflate_blocks_statef *, - z_streamp , - int)); /* initial return code */ - -extern void inflate_blocks_reset OF(( - inflate_blocks_statef *, - z_streamp , - uLongf *)); /* check value on output */ - -extern int inflate_blocks_free OF(( - inflate_blocks_statef *, - z_streamp)); - -extern void inflate_set_dictionary OF(( - inflate_blocks_statef *s, - const Bytef *d, /* dictionary */ - uInt n)); /* dictionary length */ - -extern int inflate_blocks_sync_point OF(( - inflate_blocks_statef *s)); diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inffast.c b/components/dfs/filesystems/jffs2/cyg/compress/src/inffast.c deleted file mode 100644 index bbee92ed1e..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inffast.c +++ /dev/null @@ -1,318 +0,0 @@ -/* inffast.c -- fast decoding - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifndef ASMINF - -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ -#else -# define OFF 1 -# define PUP(a) *++(a) -#endif - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ - unsigned char FAR *out; /* local strm->next_out */ - unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ - unsigned char FAR *end; /* while out < end, enough space available */ -#ifdef INFLATE_STRICT - unsigned dmax; /* maximum distance from zlib header */ -#endif - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ - unsigned long hold; /* local strm->hold */ - unsigned bits; /* local strm->bits */ - code const FAR *lcode; /* local strm->lencode */ - code const FAR *dcode; /* local strm->distcode */ - unsigned lmask; /* mask for first level of length codes */ - unsigned dmask; /* mask for first level of distance codes */ - code this; /* retrieved table entry */ - unsigned op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - unsigned len; /* match length, unused bytes */ - unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; - last = in + (strm->avail_in - 5); - out = strm->next_out - OFF; - beg = out - (start - strm->avail_out); - end = out + (strm->avail_out - 257); -#ifdef INFLATE_STRICT - dmax = state->dmax; -#endif - wsize = state->wsize; - whave = state->whave; - write = state->write; - window = state->window; - hold = state->hold; - bits = state->bits; - lcode = state->lencode; - dcode = state->distcode; - lmask = (1U << state->lenbits) - 1; - dmask = (1U << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - do { - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = lcode[hold & lmask]; - dolen: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op == 0) { /* literal */ - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - PUP(out) = (unsigned char)(this.val); - } - else if (op & 16) { /* length base */ - len = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - len += (unsigned)hold & ((1U << op) - 1); - hold >>= op; - bits -= op; - } - Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = dcode[hold & dmask]; - dodist: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op & 16) { /* distance base */ - dist = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - } - dist += (unsigned)hold & ((1U << op) - 1); -#ifdef INFLATE_STRICT - if (dist > dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - hold >>= op; - bits -= op; - Tracevv((stderr, "inflate: distance %u\n", dist)); - op = (unsigned)(out - beg); /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - from = window - OFF; - if (write == 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - else if (write < op) { /* wrap around window */ - from += wsize + write - op; - op -= write; - if (op < len) { /* some from end of window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = window - OFF; - if (write < len) { /* some from start of window */ - op = write; - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - } - else { /* contiguous in window */ - from += write - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - else { - from = out - dist; /* copy direct from output */ - do { /* minimum length is three */ - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } while (len > 2); - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - } - else if ((op & 64) == 0) { /* 2nd level distance code */ - this = dcode[this.val + (hold & ((1U << op) - 1))]; - goto dodist; - } - else { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - } - else if ((op & 64) == 0) { /* 2nd level length code */ - this = lcode[this.val + (hold & ((1U << op) - 1))]; - goto dolen; - } - else if (op & 32) { /* end-of-block */ - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - else { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - } while (in < last && out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - in -= len; - bits -= len << 3; - hold &= (1U << bits) - 1; - - /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; - strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); - strm->avail_out = (unsigned)(out < end ? - 257 + (end - out) : 257 - (out - end)); - state->hold = hold; - state->bits = bits; - return; -} - -/* - inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - - Using bit fields for code structure - - Different op definition to avoid & for extra bits (do & for table bits) - - Three separate decoding do-loops for direct, window, and write == 0 - - Special case for distance > 1 copies to do overlapped load and store copy - - Explicit branch predictions (based on measured branch probabilities) - - Deferring match copy and interspersed it with decoding subsequent codes - - Swapping literal/length else - - Swapping window/direct else - - Larger unrolled copy loops (three is about right) - - Moving len -= 3 statement into middle of loop - */ - -#endif /* !ASMINF */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inffast.h b/components/dfs/filesystems/jffs2/cyg/compress/src/inffast.h deleted file mode 100644 index 1e88d2d97b..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inffast.h +++ /dev/null @@ -1,11 +0,0 @@ -/* inffast.h -- header to use inffast.c - * Copyright (C) 1995-2003 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -void inflate_fast OF((z_streamp strm, unsigned start)); diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inffixed.h b/components/dfs/filesystems/jffs2/cyg/compress/src/inffixed.h deleted file mode 100644 index 75ed4b5978..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inffixed.h +++ /dev/null @@ -1,94 +0,0 @@ - /* inffixed.h -- table for decoding fixed codes - * Generated automatically by makefixed(). - */ - - /* WARNING: this file should *not* be used by applications. It - is part of the implementation of the compression library and - is subject to change. Applications should only use zlib.h. - */ - - static const code lenfix[512] = { - {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, - {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, - {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, - {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, - {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, - {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, - {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, - {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, - {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, - {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, - {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, - {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, - {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, - {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, - {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, - {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, - {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, - {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, - {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, - {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, - {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, - {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, - {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, - {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, - {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, - {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, - {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, - {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, - {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, - {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, - {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, - {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, - {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, - {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, - {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, - {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, - {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, - {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, - {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, - {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, - {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, - {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, - {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, - {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, - {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, - {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, - {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, - {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, - {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, - {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, - {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, - {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, - {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, - {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, - {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, - {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, - {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, - {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, - {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, - {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, - {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, - {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, - {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, - {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, - {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, - {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, - {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, - {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, - {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, - {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, - {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, - {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, - {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, - {0,9,255} - }; - - static const code distfix[32] = { - {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, - {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, - {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, - {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, - {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, - {22,5,193},{64,5,0} - }; diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inflate.c b/components/dfs/filesystems/jffs2/cyg/compress/src/inflate.c deleted file mode 100644 index 792fdee8e9..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inflate.c +++ /dev/null @@ -1,1368 +0,0 @@ -/* inflate.c -- zlib decompression - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * Change history: - * - * 1.2.beta0 24 Nov 2002 - * - First version -- complete rewrite of inflate to simplify code, avoid - * creation of window when not needed, minimize use of window when it is - * needed, make inffast.c even faster, implement gzip decoding, and to - * improve code readability and style over the previous zlib inflate code - * - * 1.2.beta1 25 Nov 2002 - * - Use pointers for available input and output checking in inffast.c - * - Remove input and output counters in inffast.c - * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 - * - Remove unnecessary second byte pull from length extra in inffast.c - * - Unroll direct copy to three copies per loop in inffast.c - * - * 1.2.beta2 4 Dec 2002 - * - Change external routine names to reduce potential conflicts - * - Correct filename to inffixed.h for fixed tables in inflate.c - * - Make hbuf[] unsigned char to match parameter type in inflate.c - * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) - * to avoid negation problem on Alphas (64 bit) in inflate.c - * - * 1.2.beta3 22 Dec 2002 - * - Add comments on state->bits assertion in inffast.c - * - Add comments on op field in inftrees.h - * - Fix bug in reuse of allocated window after inflateReset() - * - Remove bit fields--back to byte structure for speed - * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths - * - Change post-increments to pre-increments in inflate_fast(), PPC biased? - * - Add compile time option, POSTINC, to use post-increments instead (Intel?) - * - Make MATCH copy in inflate() much faster for when inflate_fast() not used - * - Use local copies of stream next and avail values, as well as local bit - * buffer and bit count in inflate()--for speed when inflate_fast() not used - * - * 1.2.beta4 1 Jan 2003 - * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings - * - Move a comment on output buffer sizes from inffast.c to inflate.c - * - Add comments in inffast.c to introduce the inflate_fast() routine - * - Rearrange window copies in inflate_fast() for speed and simplification - * - Unroll last copy for window match in inflate_fast() - * - Use local copies of window variables in inflate_fast() for speed - * - Pull out common write == 0 case for speed in inflate_fast() - * - Make op and len in inflate_fast() unsigned for consistency - * - Add FAR to lcode and dcode declarations in inflate_fast() - * - Simplified bad distance check in inflate_fast() - * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new - * source file infback.c to provide a call-back interface to inflate for - * programs like gzip and unzip -- uses window as output buffer to avoid - * window copying - * - * 1.2.beta5 1 Jan 2003 - * - Improved inflateBack() interface to allow the caller to provide initial - * input in strm. - * - Fixed stored blocks bug in inflateBack() - * - * 1.2.beta6 4 Jan 2003 - * - Added comments in inffast.c on effectiveness of POSTINC - * - Typecasting all around to reduce compiler warnings - * - Changed loops from while (1) or do {} while (1) to for (;;), again to - * make compilers happy - * - Changed type of window in inflateBackInit() to unsigned char * - * - * 1.2.beta7 27 Jan 2003 - * - Changed many types to unsigned or unsigned short to avoid warnings - * - Added inflateCopy() function - * - * 1.2.0 9 Mar 2003 - * - Changed inflateBack() interface to provide separate opaque descriptors - * for the in() and out() functions - * - Changed inflateBack() argument and in_func typedef to swap the length - * and buffer address return values for the input function - * - Check next_in and next_out for Z_NULL on entry to inflate() - * - * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. - */ - -#include "zutil.h" -#include "inftrees.h" -#include "inflate.h" -#include "inffast.h" - -#ifdef MAKEFIXED -# ifndef BUILDFIXED -# define BUILDFIXED -# endif -#endif - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, unsigned out)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, - unsigned len)); - -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - strm->total_in = strm->total_out = state->total = 0; - strm->msg = Z_NULL; - strm->adler = 1; /* to support ill-conceived Java test suite */ - state->mode = HEAD; - state->last = 0; - state->havedict = 0; - state->dmax = 32768U; - state->head = Z_NULL; - state->wsize = 0; - state->whave = 0; - state->write = 0; - state->hold = 0; - state->bits = 0; - state->lencode = state->distcode = state->next = state->codes; - Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; - value &= (1L << bits) - 1; - state->hold += value << state->bits; - state->bits += bits; - return Z_OK; -} - -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL) return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *) - ZALLOC(strm, 1, sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - if (windowBits < 0) { - state->wrap = 0; - windowBits = -windowBits; - } - else { - state->wrap = (windowBits >> 4) + 1; -#ifdef GUNZIP - if (windowBits < 48) windowBits &= 15; -#endif - } - if (windowBits < 8 || windowBits > 15) { - ZFREE(strm, state); - strm->state = Z_NULL; - return Z_STREAM_ERROR; - } - state->wbits = (unsigned)windowBits; - state->window = Z_NULL; - return inflateReset(strm); -} - -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ - return inflateInit2_(strm, DEF_WBITS, version, stream_size); -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifdef BUILDFIXED - static int virgin = 1; - static code *lenfix, *distfix; - static code fixed[544]; - - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - unsigned sym, bits; - static code *next; - - /* literal/length table */ - sym = 0; - while (sym < 144) state->lens[sym++] = 8; - while (sym < 256) state->lens[sym++] = 9; - while (sym < 280) state->lens[sym++] = 7; - while (sym < 288) state->lens[sym++] = 8; - next = fixed; - lenfix = next; - bits = 9; - inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); - - /* distance table */ - sym = 0; - while (sym < 32) state->lens[sym++] = 5; - distfix = next; - bits = 5; - inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); - - /* do this just once */ - virgin = 0; - } -#else /* !BUILDFIXED */ -# include "inffixed.h" -#endif /* BUILDFIXED */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -#ifdef MAKEFIXED -#include - -/* - Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also - defines BUILDFIXED, so the tables are built on the fly. makefixed() writes - those tables to stdout, which would be piped to inffixed.h. A small program - can simply call makefixed to do this: - - void makefixed(void); - - int main(void) - { - makefixed(); - return 0; - } - - Then that can be linked with zlib built with MAKEFIXED defined and run: - - a.out > inffixed.h - */ -void makefixed() -{ - unsigned low, size; - struct inflate_state state; - - fixedtables(&state); - puts(" /* inffixed.h -- table for decoding fixed codes"); - puts(" * Generated automatically by makefixed()."); - puts(" */"); - puts(""); - puts(" /* WARNING: this file should *not* be used by applications."); - puts(" It is part of the implementation of this library and is"); - puts(" subject to change. Applications should only use zlib.h."); - puts(" */"); - puts(""); - size = 1U << 9; - printf(" static const code lenfix[%u] = {", size); - low = 0; - for (;;) { - if ((low % 7) == 0) printf("\n "); - printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits, - state.lencode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); - size = 1U << 5; - printf("\n static const code distfix[%u] = {", size); - low = 0; - for (;;) { - if ((low % 6) == 0) printf("\n "); - printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, - state.distcode[low].val); - if (++low == size) break; - putchar(','); - } - puts("\n };"); -} -#endif /* MAKEFIXED */ - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -local int updatewindow(strm, out) -z_streamp strm; -unsigned out; -{ - struct inflate_state FAR *state; - unsigned copy, dist; - - state = (struct inflate_state FAR *)strm->state; - - /* if it hasn't been done already, allocate space for the window */ - if (state->window == Z_NULL) { - state->window = (unsigned char FAR *) - ZALLOC(strm, 1U << state->wbits, - sizeof(unsigned char)); - if (state->window == Z_NULL) return 1; - } - - /* if window not in use yet, initialize */ - if (state->wsize == 0) { - state->wsize = 1U << state->wbits; - state->write = 0; - state->whave = 0; - } - - /* copy state->wsize or less output bytes into the circular window */ - copy = out - strm->avail_out; - if (copy >= state->wsize) { - zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); - state->write = 0; - state->whave = state->wsize; - } - else { - dist = state->wsize - state->write; - if (dist > copy) dist = copy; - zmemcpy(state->window + state->write, strm->next_out - copy, dist); - copy -= dist; - if (copy) { - zmemcpy(state->window, strm->next_out - copy, copy); - state->write = copy; - state->whave = state->wsize; - } - else { - state->write += dist; - if (state->write == state->wsize) state->write = 0; - if (state->whave < state->wsize) state->whave += dist; - } - } - return 0; -} - -/* Macros for inflate(): */ - -/* check function to use adler32() for zlib or crc32() for gzip */ -#ifdef GUNZIP -# define UPDATE(check, buf, len) \ - (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) -#else -# define UPDATE(check, buf, len) adler32(check, buf, len) -#endif - -/* check macros for header crc */ -#ifdef GUNZIP -# define CRC2(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - check = crc32(check, hbuf, 2); \ - } while (0) - -# define CRC4(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - hbuf[2] = (unsigned char)((word) >> 16); \ - hbuf[3] = (unsigned char)((word) >> 24); \ - check = crc32(check, hbuf, 4); \ - } while (0) -#endif - -/* Load registers with state in inflate() for speed */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Restore state from registers in inflate() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflate() - if there is no input available. */ -#define PULLBYTE() \ - do { \ - if (have == 0) goto inf_leave; \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflate(). */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((1U << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Reverse the bytes in a 32-bit value */ -#define REVERSE(q) \ - ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ - (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) - -/* - inflate() uses a state machine to process as much input data and generate as - much output data as possible before returning. The state machine is - structured roughly as follows: - - for (;;) switch (state) { - ... - case STATEn: - if (not enough input data or output space to make progress) - return; - ... make progress ... - state = STATEm; - break; - ... - } - - so when inflate() is called again, the same case is attempted again, and - if the appropriate resources are provided, the machine proceeds to the - next state. The NEEDBITS() macro is usually the way the state evaluates - whether it can proceed or should return. NEEDBITS() does the return if - the requested bits are not available. The typical use of the BITS macros - is: - - NEEDBITS(n); - ... do something with BITS(n) ... - DROPBITS(n); - - where NEEDBITS(n) either returns from inflate() if there isn't enough - input left to load n bits into the accumulator, or it continues. BITS(n) - gives the low n bits in the accumulator. When done, DROPBITS(n) drops - the low n bits off the accumulator. INITBITS() clears the accumulator - and sets the number of available bits to zero. BYTEBITS() discards just - enough bits to put the accumulator on a byte boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. - - NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return - if there is no input available. The decoding of variable length codes uses - PULLBYTE() directly in order to pull just enough bytes to decode the next - code, and no more. - - Some states loop until they get enough input, making sure that enough - state information is maintained to continue the loop where it left off - if NEEDBITS() returns in the loop. For example, want, need, and keep - would all have to actually be part of the saved state in case NEEDBITS() - returns: - - case STATEw: - while (want < need) { - NEEDBITS(n); - keep[want++] = BITS(n); - DROPBITS(n); - } - state = STATEx; - case STATEx: - - As shown above, if the next state is also the next case, then the break - is omitted. - - A state may also return if there is not enough output space available to - complete that state. Those states are copying stored data, writing a - literal byte, and copying a matching string. - - When returning, a "goto inf_leave" is used to update the total counters, - update the check value, and determine whether any progress has been made - during that inflate() call in order to return the proper return code. - Progress is defined as a change in either strm->avail_in or strm->avail_out. - When there is a window, goto inf_leave will update the window with the last - output written. If a goto inf_leave occurs in the middle of decompression - and there is no window currently, goto inf_leave will create one and copy - output to the window for the next call of inflate(). - - In this implementation, the flush parameter of inflate() only affects the - return code (per zlib.h). inflate() always writes as much as possible to - strm->next_out, given the space available and the provided input--the effect - documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers - the allocation of and copying into a sliding window until necessary, which - provides the effect documented in zlib.h for Z_FINISH when the entire input - stream available. So the only thing the flush parameter actually does is: - when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it - will return Z_BUF_ERROR if it has not reached the end of the stream. - */ - -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned in, out; /* save starting available input and output */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ -#ifdef GUNZIP - unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ -#endif - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0)) - return Z_STREAM_ERROR; - - state = (struct inflate_state FAR *)strm->state; - if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ - LOAD(); - in = have; - out = left; - ret = Z_OK; - for (;;) - switch (state->mode) { - case HEAD: - if (state->wrap == 0) { - state->mode = TYPEDO; - break; - } - NEEDBITS(16); -#ifdef GUNZIP - if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ - state->check = crc32(0L, Z_NULL, 0); - CRC2(state->check, hold); - INITBITS(); - state->mode = FLAGS; - break; - } - state->flags = 0; /* expect zlib header */ - if (state->head != Z_NULL) - state->head->done = -1; - if (!(state->wrap & 1) || /* check if zlib header allowed */ -#else - if ( -#endif - ((BITS(8) << 8) + (hold >> 8)) % 31) { - strm->msg = (char *)"incorrect header check"; - state->mode = BAD; - break; - } - if (BITS(4) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - DROPBITS(4); - len = BITS(4) + 8; - if (len > state->wbits) { - strm->msg = (char *)"invalid window size"; - state->mode = BAD; - break; - } - state->dmax = 1U << len; - Tracev((stderr, "inflate: zlib header ok\n")); - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = hold & 0x200 ? DICTID : TYPE; - INITBITS(); - break; -#ifdef GUNZIP - case FLAGS: - NEEDBITS(16); - state->flags = (int)(hold); - if ((state->flags & 0xff) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - if (state->flags & 0xe000) { - strm->msg = (char *)"unknown header flags set"; - state->mode = BAD; - break; - } - if (state->head != Z_NULL) - state->head->text = (int)((hold >> 8) & 1); - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = TIME; - case TIME: - NEEDBITS(32); - if (state->head != Z_NULL) - state->head->time = hold; - if (state->flags & 0x0200) CRC4(state->check, hold); - INITBITS(); - state->mode = OS; - case OS: - NEEDBITS(16); - if (state->head != Z_NULL) { - state->head->xflags = (int)(hold & 0xff); - state->head->os = (int)(hold >> 8); - } - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = EXLEN; - case EXLEN: - if (state->flags & 0x0400) { - NEEDBITS(16); - state->length = (unsigned)(hold); - if (state->head != Z_NULL) - state->head->extra_len = (unsigned)hold; - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - } - else if (state->head != Z_NULL) - state->head->extra = Z_NULL; - state->mode = EXTRA; - case EXTRA: - if (state->flags & 0x0400) { - copy = state->length; - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); - } - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - state->length -= copy; - } - if (state->length) goto inf_leave; - } - state->length = 0; - state->mode = NAME; - case NAME: - if (state->flags & 0x0800) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->name != Z_NULL && - state->length < state->head->name_max) - state->head->name[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->name = Z_NULL; - state->length = 0; - state->mode = COMMENT; - case COMMENT: - if (state->flags & 0x1000) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->comment != Z_NULL && - state->length < state->head->comm_max) - state->head->comment[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->comment = Z_NULL; - state->mode = HCRC; - case HCRC: - if (state->flags & 0x0200) { - NEEDBITS(16); - if (hold != (state->check & 0xffff)) { - strm->msg = (char *)"header crc mismatch"; - state->mode = BAD; - break; - } - INITBITS(); - } - if (state->head != Z_NULL) { - state->head->hcrc = (int)((state->flags >> 9) & 1); - state->head->done = 1; - } - strm->adler = state->check = crc32(0L, Z_NULL, 0); - state->mode = TYPE; - break; -#endif - case DICTID: - NEEDBITS(32); - strm->adler = state->check = REVERSE(hold); - INITBITS(); - state->mode = DICT; - case DICT: - if (state->havedict == 0) { - RESTORE(); - return Z_NEED_DICT; - } - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = TYPE; - case TYPE: - if (flush == Z_BLOCK) goto inf_leave; - case TYPEDO: - if (state->last) { - BYTEBITS(); - state->mode = CHECK; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - case STORED: - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - state->mode = COPY; - case COPY: - copy = state->length; - if (copy) { - if (copy > have) copy = have; - if (copy > left) copy = left; - if (copy == 0) goto inf_leave; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - break; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - case TABLE: - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - state->have = 0; - state->mode = LENLENS; - case LENLENS: - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - state->have = 0; - state->mode = CODELENS; - case CODELENS: - while (state->have < state->nlen + state->ndist) { - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = state->lens[state->have - 1]; - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - RESTORE(); - inflate_fast(strm, out); - LOAD(); - break; - } - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - if ((int)(this.op) == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - state->mode = LIT; - break; - } - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - state->extra = (unsigned)(this.op) & 15; - state->mode = LENEXT; - case LENEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - state->mode = DIST; - case DIST: - for (;;) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - state->extra = (unsigned)(this.op) & 15; - state->mode = DISTEXT; - case DISTEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } -#ifdef INFLATE_STRICT - if (state->offset > state->dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - if (state->offset > state->whave + out - left) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - state->mode = MATCH; - case MATCH: - if (left == 0) goto inf_leave; - copy = out - left; - if (state->offset > copy) { /* copy from window */ - copy = state->offset - copy; - if (copy > state->write) { - copy -= state->write; - from = state->window + (state->wsize - copy); - } - else - from = state->window + (state->write - copy); - if (copy > state->length) copy = state->length; - } - else { /* copy from output */ - from = put - state->offset; - copy = state->length; - } - if (copy > left) copy = left; - left -= copy; - state->length -= copy; - do { - *put++ = *from++; - } while (--copy); - if (state->length == 0) state->mode = LEN; - break; - case LIT: - if (left == 0) goto inf_leave; - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - case CHECK: - if (state->wrap) { - NEEDBITS(32); - out -= left; - strm->total_out += out; - state->total += out; - if (out) - strm->adler = state->check = - UPDATE(state->check, put - out, out); - out = left; - if (( -#ifdef GUNZIP - state->flags ? hold : -#endif - REVERSE(hold)) != state->check) { - strm->msg = (char *)"incorrect data check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: check matches trailer\n")); - } -#ifdef GUNZIP - state->mode = LENGTH; - case LENGTH: - if (state->wrap && state->flags) { - NEEDBITS(32); - if (hold != (state->total & 0xffffffffUL)) { - strm->msg = (char *)"incorrect length check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: length matches trailer\n")); - } -#endif - state->mode = DONE; - case DONE: - ret = Z_STREAM_END; - goto inf_leave; - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - inf_leave: - RESTORE(); - if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) - if (updatewindow(strm, out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - in -= strm->avail_in; - out -= strm->avail_out; - strm->total_in += in; - strm->total_out += out; - state->total += out; - if (state->wrap && out) - strm->adler = state->check = - UPDATE(state->check, strm->next_out - out, out); - strm->data_type = state->bits + (state->last ? 64 : 0) + - (state->mode == TYPE ? 128 : 0); - if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) - ret = Z_BUF_ERROR; - return ret; -} - -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->window != Z_NULL) ZFREE(strm, state->window); - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} - -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ - struct inflate_state FAR *state; - unsigned long id; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->wrap != 0 && state->mode != DICT) - return Z_STREAM_ERROR; - - /* check for correct dictionary id */ - if (state->mode == DICT) { - id = adler32(0L, Z_NULL, 0); - id = adler32(id, dictionary, dictLength); - if (id != state->check) - return Z_DATA_ERROR; - } - - /* copy dictionary to window */ - if (updatewindow(strm, strm->avail_out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - if (dictLength > state->wsize) { - zmemcpy(state->window, dictionary + dictLength - state->wsize, - state->wsize); - state->whave = state->wsize; - } - else { - zmemcpy(state->window + state->wsize - dictLength, dictionary, - dictLength); - state->whave = dictLength; - } - state->havedict = 1; - Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ - struct inflate_state FAR *state; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; - - /* save header structure */ - state->head = head; - head->done = 0; - return Z_OK; -} - -/* - Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found - or when out of input. When called, *have is the number of pattern bytes - found in order so far, in 0..3. On return *have is updated to the new - state. If on return *have equals four, then the pattern was found and the - return value is how many bytes were read including the last byte of the - pattern. If *have is less than four, then the pattern has not been found - yet and the return value is len. In the latter case, syncsearch() can be - called again with more data and the *have state. *have is initialized to - zero for the first call. - */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -unsigned char FAR *buf; -unsigned len; -{ - unsigned got; - unsigned next; - - got = *have; - next = 0; - while (next < len && got < 4) { - if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) - got++; - else if (buf[next]) - got = 0; - else - got = 4 - got; - next++; - } - *have = got; - return next; -} - -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ - unsigned len; /* number of bytes to look at or looked at */ - unsigned long in, out; /* temporary to save total_in and total_out */ - unsigned char buf[4]; /* to restore bit buffer to byte string */ - struct inflate_state FAR *state; - - /* check parameters */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; - - /* if first time, start search in bit buffer */ - if (state->mode != SYNC) { - state->mode = SYNC; - state->hold <<= state->bits & 7; - state->bits -= state->bits & 7; - len = 0; - while (state->bits >= 8) { - buf[len++] = (unsigned char)(state->hold); - state->hold >>= 8; - state->bits -= 8; - } - state->have = 0; - syncsearch(&(state->have), buf, len); - } - - /* search available input */ - len = syncsearch(&(state->have), strm->next_in, strm->avail_in); - strm->avail_in -= len; - strm->next_in += len; - strm->total_in += len; - - /* return no joy or set up to restart inflate() on a new block */ - if (state->have != 4) return Z_DATA_ERROR; - in = strm->total_in; out = strm->total_out; - inflateReset(strm); - strm->total_in = in; strm->total_out = out; - state->mode = TYPE; - return Z_OK; -} - -/* - Returns true if inflate is currently at the end of a block generated by - Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - implementation to provide an additional safety check. PPP uses - Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored - block. When decompressing, PPP checks that at the end of input packet, - inflate is waiting for these length bytes. - */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - return state->mode == STORED && state->bits == 0; -} - -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ - struct inflate_state FAR *state; - struct inflate_state FAR *copy; - unsigned char FAR *window; - unsigned wsize; - - /* check input */ - if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || - source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)source->state; - - /* allocate space */ - copy = (struct inflate_state FAR *) - ZALLOC(source, 1, sizeof(struct inflate_state)); - if (copy == Z_NULL) return Z_MEM_ERROR; - window = Z_NULL; - if (state->window != Z_NULL) { - window = (unsigned char FAR *) - ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); - if (window == Z_NULL) { - ZFREE(source, copy); - return Z_MEM_ERROR; - } - } - - /* copy state */ - zmemcpy(dest, source, sizeof(z_stream)); - zmemcpy(copy, state, sizeof(struct inflate_state)); - if (state->lencode >= state->codes && - state->lencode <= state->codes + ENOUGH - 1) { - copy->lencode = copy->codes + (state->lencode - state->codes); - copy->distcode = copy->codes + (state->distcode - state->codes); - } - copy->next = copy->codes + (state->next - state->codes); - if (window != Z_NULL) { - wsize = 1U << state->wbits; - zmemcpy(window, state->window, wsize); - } - copy->window = window; - dest->state = (struct internal_state FAR *)copy; - return Z_OK; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inflate.h b/components/dfs/filesystems/jffs2/cyg/compress/src/inflate.h deleted file mode 100644 index 07bd3e78a7..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inflate.h +++ /dev/null @@ -1,115 +0,0 @@ -/* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2004 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* define NO_GZIP when compiling if you want to disable gzip header and - trailer decoding by inflate(). NO_GZIP would be used to avoid linking in - the crc code when it is not needed. For shared libraries, gzip decoding - should be left enabled. */ -#ifndef NO_GZIP -# define GUNZIP -#endif - -/* Possible inflate modes between inflate() calls */ -typedef enum { - HEAD, /* i: waiting for magic header */ - FLAGS, /* i: waiting for method and flags (gzip) */ - TIME, /* i: waiting for modification time (gzip) */ - OS, /* i: waiting for extra flags and operating system (gzip) */ - EXLEN, /* i: waiting for extra length (gzip) */ - EXTRA, /* i: waiting for extra bytes (gzip) */ - NAME, /* i: waiting for end of file name (gzip) */ - COMMENT, /* i: waiting for end of comment (gzip) */ - HCRC, /* i: waiting for header crc (gzip) */ - DICTID, /* i: waiting for dictionary check value */ - DICT, /* waiting for inflateSetDictionary() call */ - TYPE, /* i: waiting for type bits, including last-flag bit */ - TYPEDO, /* i: same, but skip check to exit inflate on new block */ - STORED, /* i: waiting for stored size (length and complement) */ - COPY, /* i/o: waiting for input or output to copy stored block */ - TABLE, /* i: waiting for dynamic block table lengths */ - LENLENS, /* i: waiting for code length code lengths */ - CODELENS, /* i: waiting for length/lit and distance code lengths */ - LEN, /* i: waiting for length/lit code */ - LENEXT, /* i: waiting for length extra bits */ - DIST, /* i: waiting for distance code */ - DISTEXT, /* i: waiting for distance extra bits */ - MATCH, /* o: waiting for output space to copy string */ - LIT, /* o: waiting for output space to write literal */ - CHECK, /* i: waiting for 32-bit check value */ - LENGTH, /* i: waiting for 32-bit length (gzip) */ - DONE, /* finished check, done -- remain here until reset */ - BAD, /* got a data error -- remain here until reset */ - MEM, /* got an inflate() memory error -- remain here until reset */ - SYNC /* looking for synchronization bytes to restart inflate() */ -} inflate_mode; - -/* - State transitions between above modes - - - (most modes can go to the BAD or MEM mode -- not shown for clarity) - - Process header: - HEAD -> (gzip) or (zlib) - (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME - NAME -> COMMENT -> HCRC -> TYPE - (zlib) -> DICTID or TYPE - DICTID -> DICT -> TYPE - Read deflate blocks: - TYPE -> STORED or TABLE or LEN or CHECK - STORED -> COPY -> TYPE - TABLE -> LENLENS -> CODELENS -> LEN - Read deflate codes: - LEN -> LENEXT or LIT or TYPE - LENEXT -> DIST -> DISTEXT -> MATCH -> LEN - LIT -> LEN - Process trailer: - CHECK -> LENGTH -> DONE - */ - -/* state maintained between inflate() calls. Approximately 7K bytes. */ -struct inflate_state { - inflate_mode mode; /* current inflate mode */ - int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ - unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ - unsigned long check; /* protected copy of check value */ - unsigned long total; /* protected copy of output count */ - gz_headerp head; /* where to save gzip header information */ - /* sliding window */ - unsigned wbits; /* log base 2 of requested window size */ - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ - /* bit accumulator */ - unsigned long hold; /* input bit accumulator */ - unsigned bits; /* number of bits in "in" */ - /* for string and stored block copying */ - unsigned length; /* literal or length of data to copy */ - unsigned offset; /* distance back to copy string from */ - /* for table and code decoding */ - unsigned extra; /* extra bits needed */ - /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ - unsigned lenbits; /* index bits for lencode */ - unsigned distbits; /* index bits for distcode */ - /* dynamic table building */ - unsigned ncode; /* number of code length code lengths */ - unsigned nlen; /* number of length code lengths */ - unsigned ndist; /* number of distance code lengths */ - unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ - unsigned short lens[320]; /* temporary storage for code lengths */ - unsigned short work[288]; /* work area for code table building */ - code codes[ENOUGH]; /* space for code tables */ -}; diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.c b/components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.c deleted file mode 100644 index 8a9c13ff03..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.c +++ /dev/null @@ -1,329 +0,0 @@ -/* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "inftrees.h" - -#define MAXBITS 15 - -const char inflate_copyright[] = - " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* - Build a set of tables to decode the provided canonical Huffman code. - The code lengths are lens[0..codes-1]. The result starts at *table, - whose indices are 0..2^bits-1. work is a writable array of at least - lens shorts, which is used as a work area. type is the type of code - to be generated, CODES, LENS, or DISTS. On return, zero is success, - -1 is an invalid code, and +1 means that ENOUGH isn't enough. table - on return points to the next available entry's address. bits is the - requested root table index bits, and on return it is the actual root - table index bits. It will differ if the request is greater than the - longest code or if it is less than the shortest code. - */ -int inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ - unsigned len; /* a code's length in bits */ - unsigned sym; /* index of code symbols */ - unsigned min, max; /* minimum and maximum code lengths */ - unsigned root; /* number of index bits for root table */ - unsigned curr; /* number of index bits for current table */ - unsigned drop; /* code bits to drop for sub-table */ - int left; /* number of prefix codes available */ - unsigned used; /* code entries in table used */ - unsigned huff; /* Huffman code */ - unsigned incr; /* for incrementing code, index */ - unsigned fill; /* index for replicating entries */ - unsigned low; /* low bits for current root entry */ - unsigned mask; /* mask for low root bits */ - code this; /* table entry for duplication */ - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ - unsigned short count[MAXBITS+1]; /* number of codes of each length */ - unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ - static const unsigned short lbase[31] = { /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - static const unsigned short lext[31] = { /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; - static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0}; - static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64}; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) - count[len] = 0; - for (sym = 0; sym < codes; sym++) - count[lens[sym]]++; - - /* bound code lengths, force root to be within code lengths */ - root = *bits; - for (max = MAXBITS; max >= 1; max--) - if (count[max] != 0) break; - if (root > max) root = max; - if (max == 0) { /* no symbols to code at all */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)1; - this.val = (unsigned short)0; - *(*table)++ = this; /* make a table to force an error */ - *(*table)++ = this; - *bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min <= MAXBITS; min++) - if (count[min] != 0) break; - if (root < min) root = min; - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) return -1; /* over-subscribed */ - } - if (left > 0 && (type == CODES || max != 1)) - return -1; /* incomplete set */ - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) - offs[len + 1] = offs[len] + count[len]; - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) - if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked when a LENS table is being made - against the space in *table, ENOUGH, minus the maximum space needed by - the worst case distance code, MAXD. This should never happen, but the - sufficiency of ENOUGH has not been proven exhaustively, hence the check. - This assumes that when type == LENS, bits == 9. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - switch (type) { - case CODES: - base = extra = work; /* dummy value--not used */ - end = 19; - break; - case LENS: - base = lbase; - base -= 257; - extra = lext; - extra -= 257; - end = 256; - break; - default: /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize state for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = *table; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = (unsigned)(-1); /* trigger new sub-table when len > root */ - used = 1U << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - this.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { - this.op = (unsigned char)0; - this.val = work[sym]; - } - else if ((int)(work[sym]) > end) { - this.op = (unsigned char)(extra[work[sym]]); - this.val = base[work[sym]]; - } - else { - this.op = (unsigned char)(32 + 64); /* end of block */ - this.val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1U << (len - drop); - fill = 1U << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - next[(huff >> drop) + fill] = this; - } while (fill != 0); - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - - /* go to next symbol, update count, len */ - sym++; - if (--(count[len]) == 0) { - if (len == max) break; - len = lens[work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) != low) { - /* if first time, transition to sub-tables */ - if (drop == 0) - drop = root; - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = (int)(1 << curr); - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) break; - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1U << curr; - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* point entry in root table to sub-table */ - low = huff & mask; - (*table)[low].op = (unsigned char)curr; - (*table)[low].bits = (unsigned char)root; - (*table)[low].val = (unsigned short)(next - *table); - } - } - - /* - Fill in rest of table for incomplete codes. This loop is similar to the - loop above in incrementing huff for table indices. It is assumed that - len is equal to curr + drop, so there is no loop needed to increment - through high index bits. When the current sub-table is filled, the loop - drops back to the root table to fill in any remaining entries there. - */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)(len - drop); - this.val = (unsigned short)0; - while (huff != 0) { - /* when done with sub-table, drop back to root table */ - if (drop != 0 && (huff & mask) != low) { - drop = 0; - len = root; - next = *table; - this.bits = (unsigned char)len; - } - - /* put invalid code marker in table */ - next[huff >> drop] = this; - - /* backwards increment the len-bit code huff */ - incr = 1U << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - } - - /* set return parameters */ - *table += used; - *bits = root; - return 0; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.h b/components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.h deleted file mode 100644 index b1104c87e7..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/inftrees.h +++ /dev/null @@ -1,55 +0,0 @@ -/* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2005 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* Structure for decoding tables. Each entry provides either the - information needed to do the operation requested by the code that - indexed that table entry, or it provides a pointer to another - table that indexes more bits of the code. op indicates whether - the entry is a pointer to another table, a literal, a length or - distance, an end-of-block, or an invalid code. For a table - pointer, the low four bits of op is the number of index bits of - that table. For a length or distance, the low four bits of op - is the number of extra bits to get after the code. bits is - the number of bits in this code or part of the code to drop off - of the bit buffer. val is the actual byte to output in the case - of a literal, the base length or distance, or the offset from - the current table to the next table. Each entry is four bytes. */ -typedef struct { - unsigned char op; /* operation, extra bits, table bits */ - unsigned char bits; /* bits in this part of the code */ - unsigned short val; /* offset in table or code value */ -} code; - -/* op values as set by inflate_table(): - 00000000 - literal - 0000tttt - table link, tttt != 0 is the number of table index bits - 0001eeee - length or distance, eeee is the number of extra bits - 01100000 - end of block - 01000000 - invalid code - */ - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1444 code structures (852 for length/literals - and 592 for distances, the latter actually the result of an - exhaustive search). The true maximum is not known, but the value - below is more than safe. */ -#define ENOUGH 2048 -#define MAXD 592 - -/* Type of code to build for inftable() */ -typedef enum { - CODES, - LENS, - DISTS -} codetype; - -extern int inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/infutil.c b/components/dfs/filesystems/jffs2/cyg/compress/src/infutil.c deleted file mode 100644 index 9a076221f2..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/infutil.c +++ /dev/null @@ -1,87 +0,0 @@ -/* inflate_util.c -- data and routines common to blocks and codes - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include "zutil.h" -#include "infblock.h" -#include "inftrees.h" -#include "infcodes.h" -#include "infutil.h" - -struct inflate_codes_state {int dummy;}; /* for buggy compilers */ - -/* And'ing with mask[n] masks the lower n bits */ -uInt inflate_mask[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - - -/* copy as much as possible from the sliding window to the output area */ -int inflate_flush(s, z, r) -inflate_blocks_statef *s; -z_streamp z; -int r; -{ - uInt n; - Bytef *p; - Bytef *q; - - /* local copies of source and destination pointers */ - p = z->next_out; - q = s->read; - - /* compute number of bytes to copy as far as end of window */ - n = (uInt)((q <= s->write ? s->write : s->end) - q); - if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; - - /* update counters */ - z->avail_out -= n; - z->total_out += n; - - /* update check information */ - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(s->check, q, n); - - /* copy as far as end of window */ - zmemcpy(p, q, n); - p += n; - q += n; - - /* see if more to copy at beginning of window */ - if (q == s->end) - { - /* wrap pointers */ - q = s->window; - if (s->write == s->end) - s->write = s->window; - - /* compute bytes to copy */ - n = (uInt)(s->write - q); - if (n > z->avail_out) n = z->avail_out; - if (n && r == Z_BUF_ERROR) r = Z_OK; - - /* update counters */ - z->avail_out -= n; - z->total_out += n; - - /* update check information */ - if (s->checkfn != Z_NULL) - z->adler = s->check = (*s->checkfn)(s->check, q, n); - - /* copy */ - zmemcpy(p, q, n); - p += n; - q += n; - } - - /* update pointers */ - z->next_out = p; - s->read = q; - - /* done */ - return r; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/infutil.h b/components/dfs/filesystems/jffs2/cyg/compress/src/infutil.h deleted file mode 100644 index 4401df82fc..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/infutil.h +++ /dev/null @@ -1,98 +0,0 @@ -/* infutil.h -- types and macros common to blocks and codes - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -#ifndef _INFUTIL_H -#define _INFUTIL_H - -typedef enum { - TYPE, /* get type bits (3, including end bit) */ - LENS, /* get lengths for stored */ - STORED, /* processing stored block */ - TABLE, /* get table lengths */ - BTREE, /* get bit lengths tree for a dynamic block */ - DTREE, /* get length, distance trees for a dynamic block */ - CODES, /* processing fixed or dynamic block */ - DRY, /* output remaining window bytes */ - DONE, /* finished last block, done */ - BAD} /* got a data error--stuck here */ -inflate_block_mode; - -/* inflate blocks semi-private state */ -struct inflate_blocks_state { - - /* mode */ - inflate_block_mode mode; /* current inflate_block mode */ - - /* mode dependent information */ - union { - uInt left; /* if STORED, bytes left to copy */ - struct { - uInt table; /* table lengths (14 bits) */ - uInt index; /* index into blens (or border) */ - uIntf *blens; /* bit lengths of codes */ - uInt bb; /* bit length tree depth */ - inflate_huft *tb; /* bit length decoding tree */ - } trees; /* if DTREE, decoding info for trees */ - struct { - inflate_codes_statef - *codes; - } decode; /* if CODES, current state */ - } sub; /* submode */ - uInt last; /* true if this block is the last block */ - - /* mode independent information */ - uInt bitk; /* bits in bit buffer */ - uLong bitb; /* bit buffer */ - inflate_huft *hufts; /* single malloc for tree space */ - Bytef *window; /* sliding window */ - Bytef *end; /* one byte after sliding window */ - Bytef *read; /* window read pointer */ - Bytef *write; /* window write pointer */ - check_func checkfn; /* check function */ - uLong check; /* check on output */ - -}; - - -/* defines for inflate input/output */ -/* update pointers and return */ -#define UPDBITS {s->bitb=b;s->bitk=k;} -#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} -#define UPDOUT {s->write=q;} -#define UPDATE {UPDBITS UPDIN UPDOUT} -#define LEAVE {UPDATE return inflate_flush(s,z,r);} -/* get bytes and bits */ -#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} -#define NEEDBYTE {if(n)r=Z_OK;else LEAVE} -#define NEXTBYTE (n--,*p++) -#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<>=(j);k-=(j);} -/* output bytes */ -#define WAVAIL (uInt)(qread?s->read-q-1:s->end-q) -#define LOADOUT {q=s->write;m=(uInt)WAVAIL;} -#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} -#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} -#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} -#define OUTBYTE(a) {*q++=(Byte)(a);m--;} -/* load local pointers */ -#define LOAD {LOADIN LOADOUT} - -/* masks for lower bits (size given to avoid silly warnings with Visual C++) */ -extern uInt inflate_mask[17]; - -/* copy as much as possible from the sliding window to the output area */ -extern int inflate_flush OF(( - inflate_blocks_statef *, - z_streamp , - int)); - -struct internal_state {int dummy;}; /* for buggy compilers */ - -#endif diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/maketree.c b/components/dfs/filesystems/jffs2/cyg/compress/src/maketree.c deleted file mode 100644 index a16d4b1460..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/maketree.c +++ /dev/null @@ -1,85 +0,0 @@ -/* maketree.c -- make inffixed.h table for decoding fixed codes - * Copyright (C) 1995-2002 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* This program is included in the distribution for completeness. - You do not need to compile or run this program since inffixed.h - is already included in the distribution. To use this program - you need to compile zlib with BUILDFIXED defined and then compile - and link this program with the zlib library. Then the output of - this program can be piped to inffixed.h. */ - -#include -#include -#include "zutil.h" -#include "inftrees.h" - -/* simplify the use of the inflate_huft type with some defines */ -#define exop word.what.Exop -#define bits word.what.Bits - -/* generate initialization table for an inflate_huft structure array */ -void maketree(uInt b, inflate_huft *t) -{ - int i, e; - - i = 0; - while (1) - { - e = t[i].exop; - if (e && (e & (16+64)) == 0) /* table pointer */ - { - fprintf(stderr, "maketree: cannot initialize sub-tables!\n"); - exit(1); - } - if (i % 4 == 0) - printf("\n "); - printf(" {{{%u,%u}},%u}", t[i].exop, t[i].bits, t[i].base); - if (++i == (1< -#include "zlib.h" - -#ifdef STDC -# include -# include -#endif - -#ifdef USE_MMAP -# include -# include -# include -#endif - -#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) -# include -# include -# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) -#else -# define SET_BINARY_MODE(file) -#endif - -#ifdef VMS -# define unlink delete -# define GZ_SUFFIX "-gz" -#endif -#ifdef RISCOS -# define unlink remove -# define GZ_SUFFIX "-gz" -# define fileno(file) file->__file -#endif -#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fileno */ -#endif - -#ifndef WIN32 /* unlink already in stdio.h for WIN32 */ - extern int unlink OF((const char *)); -#endif - -#ifndef GZ_SUFFIX -# define GZ_SUFFIX ".gz" -#endif -#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) - -#define BUFLEN 16384 -#define MAX_NAME_LEN 1024 - -#ifdef MAXSEG_64K -# define local static - /* Needed for systems with limitation on stack size. */ -#else -# define local -#endif - -char *prog; - -void error OF((const char *msg)); -void gz_compress OF((FILE *in, gzFile out)); -#ifdef USE_MMAP -int gz_compress_mmap OF((FILE *in, gzFile out)); -#endif -void gz_uncompress OF((gzFile in, FILE *out)); -void file_compress OF((char *file, char *mode)); -void file_uncompress OF((char *file)); -int main OF((int argc, char *argv[])); - -/* =========================================================================== - * Display error message and exit - */ -void error(msg) - const char *msg; -{ - fprintf(stderr, "%s: %s\n", prog, msg); - exit(1); -} - -/* =========================================================================== - * Compress input to output then close both files. - */ - -void gz_compress(in, out) - FILE *in; - gzFile out; -{ - local char buf[BUFLEN]; - int len; - int err; - -#ifdef USE_MMAP - /* Try first compressing with mmap. If mmap fails (minigzip used in a - * pipe), use the normal fread loop. - */ - if (gz_compress_mmap(in, out) == Z_OK) return; -#endif - for (;;) { - len = (int)fread(buf, 1, sizeof(buf), in); - if (ferror(in)) { - perror("fread"); - exit(1); - } - if (len == 0) break; - - if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); - } - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); -} - -#ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ - -/* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. - */ -int gz_compress_mmap(in, out) - FILE *in; - gzFile out; -{ - int len; - int err; - int ifd = fileno(in); - caddr_t buf; /* mmap'ed buffer for the entire input file */ - off_t buf_len; /* length of the input file */ - struct stat sb; - - /* Determine the size of the file, needed for mmap: */ - if (fstat(ifd, &sb) < 0) return Z_ERRNO; - buf_len = sb.st_size; - if (buf_len <= 0) return Z_ERRNO; - - /* Now do the actual mmap: */ - buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); - if (buf == (caddr_t)(-1)) return Z_ERRNO; - - /* Compress the whole file at once: */ - len = gzwrite(out, (char *)buf, (unsigned)buf_len); - - if (len != (int)buf_len) error(gzerror(out, &err)); - - munmap(buf, buf_len); - fclose(in); - if (gzclose(out) != Z_OK) error("failed gzclose"); - return Z_OK; -} -#endif /* USE_MMAP */ - -/* =========================================================================== - * Uncompress input to output then close both files. - */ -void gz_uncompress(in, out) - gzFile in; - FILE *out; -{ - local char buf[BUFLEN]; - int len; - int err; - - for (;;) { - len = gzread(in, buf, sizeof(buf)); - if (len < 0) error (gzerror(in, &err)); - if (len == 0) break; - - if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { - error("failed fwrite"); - } - } - if (fclose(out)) error("failed fclose"); - - if (gzclose(in) != Z_OK) error("failed gzclose"); -} - - -/* =========================================================================== - * Compress the given file: create a corresponding .gz file and remove the - * original. - */ -void file_compress(file, mode) - char *file; - char *mode; -{ - local char outfile[MAX_NAME_LEN]; - FILE *in; - gzFile out; - - strcpy(outfile, file); - strcat(outfile, GZ_SUFFIX); - - in = fopen(file, "rb"); - if (in == NULL) { - perror(file); - exit(1); - } - out = gzopen(outfile, mode); - if (out == NULL) { - fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); - exit(1); - } - gz_compress(in, out); - - unlink(file); -} - - -/* =========================================================================== - * Uncompress the given file and remove the original. - */ -void file_uncompress(file) - char *file; -{ - local char buf[MAX_NAME_LEN]; - char *infile, *outfile; - FILE *out; - gzFile in; - uInt len = (uInt)strlen(file); - - strcpy(buf, file); - - if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { - infile = file; - outfile = buf; - outfile[len-3] = '\0'; - } else { - outfile = file; - infile = buf; - strcat(infile, GZ_SUFFIX); - } - in = gzopen(infile, "rb"); - if (in == NULL) { - fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); - exit(1); - } - out = fopen(outfile, "wb"); - if (out == NULL) { - perror(file); - exit(1); - } - - gz_uncompress(in, out); - - unlink(infile); -} - - -/* =========================================================================== - * Usage: minigzip [-d] [-f] [-h] [-r] [-1 to -9] [files...] - * -d : decompress - * -f : compress with Z_FILTERED - * -h : compress with Z_HUFFMAN_ONLY - * -r : compress with Z_RLE - * -1 to -9 : compression level - */ - -int main(argc, argv) - int argc; - char *argv[]; -{ - int uncompr = 0; - gzFile file; - char outmode[20]; - - strcpy(outmode, "wb6 "); - - prog = argv[0]; - argc--, argv++; - - while (argc > 0) { - if (strcmp(*argv, "-d") == 0) - uncompr = 1; - else if (strcmp(*argv, "-f") == 0) - outmode[3] = 'f'; - else if (strcmp(*argv, "-h") == 0) - outmode[3] = 'h'; - else if (strcmp(*argv, "-r") == 0) - outmode[3] = 'R'; - else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' && - (*argv)[2] == 0) - outmode[2] = (*argv)[1]; - else - break; - argc--, argv++; - } - if (outmode[3] == ' ') - outmode[3] = 0; - if (argc == 0) { - SET_BINARY_MODE(stdin); - SET_BINARY_MODE(stdout); - if (uncompr) { - file = gzdopen(fileno(stdin), "rb"); - if (file == NULL) error("can't gzdopen stdin"); - gz_uncompress(file, stdout); - } else { - file = gzdopen(fileno(stdout), outmode); - if (file == NULL) error("can't gzdopen stdout"); - gz_compress(stdin, file); - } - } else { - do { - if (uncompr) { - file_uncompress(*argv); - } else { - file_compress(*argv, outmode); - } - } while (argv++, --argc); - } - return 0; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/trees.c b/components/dfs/filesystems/jffs2/cyg/compress/src/trees.c deleted file mode 100644 index 395e4e1681..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/trees.c +++ /dev/null @@ -1,1219 +0,0 @@ -/* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2005 Jean-loup Gailly - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* - * ALGORITHM - * - * The "deflation" process uses several Huffman trees. The more - * common source values are represented by shorter bit sequences. - * - * Each code tree is stored in a compressed form which is itself - * a Huffman encoding of the lengths of all the code strings (in - * ascending order by source values). The actual code strings are - * reconstructed from the lengths in the inflate process, as described - * in the deflate specification. - * - * REFERENCES - * - * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". - * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc - * - * Storer, James A. - * Data Compression: Methods and Theory, pp. 49-50. - * Computer Science Press, 1988. ISBN 0-7167-8156-5. - * - * Sedgewick, R. - * Algorithms, p290. - * Addison-Wesley, 1983. ISBN 0-201-06672-6. - */ - -/* @(#) $Id$ */ - -/* #define GEN_TREES_H */ - -#include "deflate.h" - -#ifdef DEBUG -# include -#endif - -/* =========================================================================== - * Constants - */ - -#define MAX_BL_BITS 7 -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -#define END_BLOCK 256 -/* end of block literal code */ - -#define REP_3_6 16 -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -#define REPZ_3_10 17 -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -#define REPZ_11_138 18 -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ - = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; - -local const int extra_dbits[D_CODES] /* extra bits for each distance code */ - = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ - = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; - -local const uch bl_order[BL_CODES] - = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -#define Buf_size (8 * 2*sizeof(char)) -/* Number of bits used within bi_buf. (bi_buf might be implemented on - * more than 16 bits on some systems.) - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ - -#if defined(GEN_TREES_H) || !defined(STDC) -/* non ANSI compilers may not accept trees.h */ - -local ct_data static_ltree[L_CODES+2]; -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -local ct_data static_dtree[D_CODES]; -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -uch _dist_code[DIST_CODE_LEN]; -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -uch _length_code[MAX_MATCH-MIN_MATCH+1]; -/* length code for each normalized match length (0 == MIN_MATCH) */ - -local int base_length[LENGTH_CODES]; -/* First normalized length for each code (0 = MIN_MATCH) */ - -local int base_dist[D_CODES]; -/* First normalized distance for each code (0 = distance of 1) */ - -#else -# include "trees.h" -#endif /* GEN_TREES_H */ - -struct static_tree_desc_s { - const ct_data *static_tree; /* static tree or NULL */ - const intf *extra_bits; /* extra bits for each code or NULL */ - int extra_base; /* base index for extra_bits */ - int elems; /* max number of elements in the tree */ - int max_length; /* max bit length for the codes */ -}; - -local static_tree_desc static_l_desc = -{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; - -local static_tree_desc static_d_desc = -{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; - -local static_tree_desc static_bl_desc = -{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; - -/* =========================================================================== - * Local (static) routines in this file. - */ - -local void tr_static_init OF((void)); -local void init_block OF((deflate_state *s)); -local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); -local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); -local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); -local void build_tree OF((deflate_state *s, tree_desc *desc)); -local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); -local int build_bl_tree OF((deflate_state *s)); -local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, - int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); -local void set_data_type OF((deflate_state *s)); -local unsigned bi_reverse OF((unsigned value, int length)); -local void bi_windup OF((deflate_state *s)); -local void bi_flush OF((deflate_state *s)); -local void copy_block OF((deflate_state *s, charf *buf, unsigned len, - int header)); - -#ifdef GEN_TREES_H -local void gen_trees_header OF((void)); -#endif - -#ifndef DEBUG -# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) - /* Send a code of the given tree. c and tree must not have side effects */ - -#else /* DEBUG */ -# define send_code(s, c, tree) \ - { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ - send_bits(s, tree[c].Code, tree[c].Len); } -#endif - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -#define put_short(s, w) { \ - put_byte(s, (uch)((w) & 0xff)); \ - put_byte(s, (uch)((ush)(w) >> 8)); \ -} - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -#ifdef DEBUG -local void send_bits OF((deflate_state *s, int value, int length)); - -local void send_bits(s, value, length) - deflate_state *s; - int value; /* value to send */ - int length; /* number of bits */ -{ - Tracevv((stderr," l %2d v %4x ", length, value)); - Assert(length > 0 && length <= 15, "invalid length"); - s->bits_sent += (ulg)length; - - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (s->bi_valid > (int)Buf_size - length) { - s->bi_buf |= (value << s->bi_valid); - put_short(s, s->bi_buf); - s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); - s->bi_valid += length - Buf_size; - } else { - s->bi_buf |= value << s->bi_valid; - s->bi_valid += length; - } -} -#else /* !DEBUG */ - -#define send_bits(s, value, length) \ -{ int len = length;\ - if (s->bi_valid > (int)Buf_size - len) {\ - int val = value;\ - s->bi_buf |= (val << s->bi_valid);\ - put_short(s, s->bi_buf);\ - s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ - s->bi_valid += len - Buf_size;\ - } else {\ - s->bi_buf |= (value) << s->bi_valid;\ - s->bi_valid += len;\ - }\ -} -#endif /* DEBUG */ - - -/* the arguments must not have side effects */ - -/* =========================================================================== - * Initialize the various 'constant' tables. - */ -local void tr_static_init() -{ -#if defined(GEN_TREES_H) || !defined(STDC) - static int static_init_done = 0; - int n; /* iterates over tree elements */ - int bits; /* bit counter */ - int length; /* length value */ - int code; /* code value */ - int dist; /* distance index */ - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - if (static_init_done) return; - - /* For some embedded targets, global variables are not initialized: */ - static_l_desc.static_tree = static_ltree; - static_l_desc.extra_bits = extra_lbits; - static_d_desc.static_tree = static_dtree; - static_d_desc.extra_bits = extra_dbits; - static_bl_desc.extra_bits = extra_blbits; - - /* Initialize the mapping length (0..255) -> length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES-1; code++) { - base_length[code] = length; - for (n = 0; n < (1< dist code (0..29) */ - dist = 0; - for (code = 0 ; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ - for ( ; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { - _dist_code[256 + dist++] = (uch)code; - } - } - Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; - n = 0; - while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; - while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; - while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; - while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n].Len = 5; - static_dtree[n].Code = bi_reverse((unsigned)n, 5); - } - static_init_done = 1; - -# ifdef GEN_TREES_H - gen_trees_header(); -# endif -#endif /* defined(GEN_TREES_H) || !defined(STDC) */ -} - -/* =========================================================================== - * Genererate the file trees.h describing the static trees. - */ -#ifdef GEN_TREES_H -# ifndef DEBUG -# include -# endif - -# define SEPARATOR(i, last, width) \ - ((i) == (last)? "\n};\n\n" : \ - ((i) % (width) == (width)-1 ? ",\n" : ", ")) - -void gen_trees_header() -{ - FILE *header = fopen("trees.h", "w"); - int i; - - Assert (header != NULL, "Can't open trees.h"); - fprintf(header, - "/* header created automatically with -DGEN_TREES_H */\n\n"); - - fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); - for (i = 0; i < L_CODES+2; i++) { - fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, - static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); - } - - fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, - static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); - } - - fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n"); - for (i = 0; i < DIST_CODE_LEN; i++) { - fprintf(header, "%2u%s", _dist_code[i], - SEPARATOR(i, DIST_CODE_LEN-1, 20)); - } - - fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); - for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { - fprintf(header, "%2u%s", _length_code[i], - SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); - } - - fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); - for (i = 0; i < LENGTH_CODES; i++) { - fprintf(header, "%1u%s", base_length[i], - SEPARATOR(i, LENGTH_CODES-1, 20)); - } - - fprintf(header, "local const int base_dist[D_CODES] = {\n"); - for (i = 0; i < D_CODES; i++) { - fprintf(header, "%5u%s", base_dist[i], - SEPARATOR(i, D_CODES-1, 10)); - } - - fclose(header); -} -#endif /* GEN_TREES_H */ - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -void _tr_init(s) - deflate_state *s; -{ - tr_static_init(); - - s->l_desc.dyn_tree = s->dyn_ltree; - s->l_desc.stat_desc = &static_l_desc; - - s->d_desc.dyn_tree = s->dyn_dtree; - s->d_desc.stat_desc = &static_d_desc; - - s->bl_desc.dyn_tree = s->bl_tree; - s->bl_desc.stat_desc = &static_bl_desc; - - s->bi_buf = 0; - s->bi_valid = 0; - s->last_eob_len = 8; /* enough lookahead for inflate */ -#ifdef DEBUG - s->compressed_len = 0L; - s->bits_sent = 0L; -#endif - - /* Initialize the first block of the first file: */ - init_block(s); -} - -/* =========================================================================== - * Initialize a new block. - */ -local void init_block(s) - deflate_state *s; -{ - int n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; - for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; - for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; - - s->dyn_ltree[END_BLOCK].Freq = 1; - s->opt_len = s->static_len = 0L; - s->last_lit = s->matches = 0; -} - -#define SMALLEST 1 -/* Index within the heap array of least frequent node in the Huffman tree */ - - -/* =========================================================================== - * Remove the smallest element from the heap and recreate the heap with - * one less element. Updates heap and heap_len. - */ -#define pqremove(s, tree, top) \ -{\ - top = s->heap[SMALLEST]; \ - s->heap[SMALLEST] = s->heap[s->heap_len--]; \ - pqdownheap(s, tree, SMALLEST); \ -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -#define smaller(tree, n, m, depth) \ - (tree[n].Freq < tree[m].Freq || \ - (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -local void pqdownheap(s, tree, k) - deflate_state *s; - ct_data *tree; /* the tree to restore */ - int k; /* node to move down */ -{ - int v = s->heap[k]; - int j = k << 1; /* left son of k */ - while (j <= s->heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s->heap[j], s->depth)) break; - - /* Exchange v with the smallest son */ - s->heap[k] = s->heap[j]; k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s->heap[k] = v; -} - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -local void gen_bitlen(s, desc) - deflate_state *s; - tree_desc *desc; /* the tree descriptor */ -{ - ct_data *tree = desc->dyn_tree; - int max_code = desc->max_code; - const ct_data *stree = desc->stat_desc->static_tree; - const intf *extra = desc->stat_desc->extra_bits; - int base = desc->stat_desc->extra_base; - int max_length = desc->stat_desc->max_length; - int h; /* heap index */ - int n, m; /* iterate over the tree elements */ - int bits; /* bit length */ - int xbits; /* extra bits */ - ush f; /* frequency */ - int overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { - n = s->heap[h]; - bits = tree[tree[n].Dad].Len + 1; - if (bits > max_length) bits = max_length, overflow++; - tree[n].Len = (ush)bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) continue; /* not a leaf node */ - - s->bl_count[bits]++; - xbits = 0; - if (n >= base) xbits = extra[n-base]; - f = tree[n].Freq; - s->opt_len += (ulg)f * (bits + xbits); - if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); - } - if (overflow == 0) return; - - Trace((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length-1; - while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ - s->bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = s->bl_count[bits]; - while (n != 0) { - m = s->heap[--h]; - if (m > max_code) continue; - if ((unsigned) tree[m].Len != (unsigned) bits) { - Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s->opt_len += ((long)bits - (long)tree[m].Len) - *(long)tree[m].Freq; - tree[m].Len = (ush)bits; - } - n--; - } - } -} - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -local void gen_codes (tree, max_code, bl_count) - ct_data *tree; /* the tree to decorate */ - int max_code; /* largest code with non zero frequency */ - ushf *bl_count; /* number of codes at each bit length */ -{ - ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ - int bits; /* bit index */ - int n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; - const ct_data *stree = desc->stat_desc->static_tree; - int elems = desc->stat_desc->elems; - int n, m; /* iterate over heap elements */ - int max_code = -1; /* largest code with non zero frequency */ - int node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s->heap_len = 0, s->heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].Freq != 0) { - s->heap[++(s->heap_len)] = max_code = n; - s->depth[n] = 0; - } else { - tree[n].Len = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s->heap_len < 2) { - node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); - tree[node].Freq = 1; - s->depth[node] = 0; - s->opt_len--; if (stree) s->static_len -= stree[node].Len; - /* node is 0 or 1 so it does not have extra bits */ - } - desc->max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - pqremove(s, tree, n); /* n = node of least frequency */ - m = s->heap[SMALLEST]; /* m = node of next least frequency */ - - s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ - s->heap[--(s->heap_max)] = m; - - /* Create a new node father of n and m */ - tree[node].Freq = tree[n].Freq + tree[m].Freq; - s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? - s->depth[n] : s->depth[m]) + 1); - tree[n].Dad = tree[m].Dad = (ush)node; -#ifdef DUMP_BL_TREE - if (tree == s->bl_tree) { - fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", - node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); - } -#endif - /* and insert the new node in the heap */ - s->heap[SMALLEST] = node++; - pqdownheap(s, tree, SMALLEST); - - } while (s->heap_len >= 2); - - s->heap[--(s->heap_max)] = s->heap[SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, (tree_desc *)desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes ((ct_data *)tree, max_code, s->bl_count); -} - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -local void scan_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; - } else if (curlen != 0) { - if (curlen != prevlen) s->bl_tree[curlen].Freq++; - s->bl_tree[REP_3_6].Freq++; - } else if (count <= 10) { - s->bl_tree[REPZ_3_10].Freq++; - } else { - s->bl_tree[REPZ_11_138].Freq++; - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -local void send_tree (s, tree, max_code) - deflate_state *s; - ct_data *tree; /* the tree to be scanned */ - int max_code; /* and its largest code of non zero frequency */ -{ - int n; /* iterates over all tree elements */ - int prevlen = -1; /* last emitted length */ - int curlen; /* length of current code */ - int nextlen = tree[0].Len; /* length of next code */ - int count = 0; /* repeat count of the current code */ - int max_count = 7; /* max repeat count */ - int min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen == 0) max_count = 138, min_count = 3; - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { send_code(s, curlen, s->bl_tree); } while (--count != 0); - - } else if (curlen != 0) { - if (curlen != prevlen) { - send_code(s, curlen, s->bl_tree); count--; - } - Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); - - } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); - } - count = 0; prevlen = curlen; - if (nextlen == 0) { - max_count = 138, min_count = 3; - } else if (curlen == nextlen) { - max_count = 6, min_count = 3; - } else { - max_count = 7, min_count = 4; - } - } -} - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -local int build_bl_tree(s) - deflate_state *s; -{ - int max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); - scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { - if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*(max_blindex+1) + 5+5+4; - Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - s->opt_len, s->static_len)); - - return max_blindex; -} - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -local void send_all_trees(s, lcodes, dcodes, blcodes) - deflate_state *s; - int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - int rank; /* index in bl_order */ - - Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - "too many codes"); - Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); - } - Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ - Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ - Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - -/* =========================================================================== - * Send a stored block - */ -void _tr_stored_block(s, buf, stored_len, eof) - deflate_state *s; - charf *buf; /* input block */ - ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ -#ifdef DEBUG - s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; - s->compressed_len += (stored_len + 4) << 3; -#endif - copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ -} - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - * The current inflate code requires 9 bits of lookahead. If the - * last two codes for the previous block (real code plus EOB) were coded - * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode - * the last real code. In this case we send two empty static blocks instead - * of one. (There are no problems if the previous block is stored or fixed.) - * To simplify the code, we assume the worst case of last real code encoded - * on one bit only. - */ -void _tr_align(s) - deflate_state *s; -{ - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG - s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ -#endif - bi_flush(s); - /* Of the 10 bits for the empty block, we have already sent - * (10 - bi_valid) bits. The lookahead for the last real code (before - * the EOB of the previous block) was thus at least one plus the length - * of the EOB plus what we have just sent of the empty static block. - */ - if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { - send_bits(s, STATIC_TREES<<1, 3); - send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG - s->compressed_len += 10L; -#endif - bi_flush(s); - } - s->last_eob_len = 7; -} - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -void _tr_flush_block(s, buf, stored_len, eof) - deflate_state *s; - charf *buf; /* input block, or NULL if too old */ - ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ -{ - ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - int max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s->level > 0) { - - /* Check if the file is binary or text */ - if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) - set_data_type(s); - - /* Construct the literal and distance trees */ - build_tree(s, (tree_desc *)(&(s->l_desc))); - Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - - build_tree(s, (tree_desc *)(&(s->d_desc))); - Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; - - Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - s->last_lit)); - - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; - - } else { - Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - -#ifdef FORCE_STORED - if (buf != (char*)0) { /* force stored block */ -#else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { - /* 4: two words for the lengths */ -#endif - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, eof); - -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+eof, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); -#ifdef DEBUG - s->compressed_len += 3 + s->static_len; -#endif - } else { - send_bits(s, (DYN_TREES<<1)+eof, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); - compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); -#ifdef DEBUG - s->compressed_len += 3 + s->opt_len; -#endif - } - Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (eof) { - bi_windup(s); -#ifdef DEBUG - s->compressed_len += 7; /* align on byte boundary */ -#endif - } - Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*eof)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -int _tr_tally (s, dist, lc) - deflate_state *s; - unsigned dist; /* distance of matched string */ - unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - s->d_buf[s->last_lit] = (ush)dist; - s->l_buf[s->last_lit++] = (uch)lc; - if (dist == 0) { - /* lc is the unmatched char */ - s->dyn_ltree[lc].Freq++; - } else { - s->matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - Assert((ush)dist < (ush)MAX_DIST(s) && - (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; - s->dyn_dtree[d_code(dist)].Freq++; - } - -#ifdef TRUNCATE_BLOCK - /* Try to guess if it is profitable to stop the current block here */ - if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { - /* Compute an upper bound for the compressed length */ - ulg out_length = (ulg)s->last_lit*8L; - ulg in_length = (ulg)((long)s->strstart - s->block_start); - int dcode; - for (dcode = 0; dcode < D_CODES; dcode++) { - out_length += (ulg)s->dyn_dtree[dcode].Freq * - (5L+extra_dbits[dcode]); - } - out_length >>= 3; - Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", - s->last_lit, in_length, out_length, - 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; - } -#endif - return (s->last_lit == s->lit_bufsize-1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -local void compress_block(s, ltree, dtree) - deflate_state *s; - ct_data *ltree; /* literal tree */ - ct_data *dtree; /* distance tree */ -{ - unsigned dist; /* distance of matched string */ - int lc; /* match length or unmatched char (if dist == 0) */ - unsigned lx = 0; /* running index in l_buf */ - unsigned code; /* the code to send */ - int extra; /* number of extra bits to send */ - - if (s->last_lit != 0) do { - dist = s->d_buf[lx]; - lc = s->l_buf[lx++]; - if (dist == 0) { - send_code(s, lc, ltree); /* send a literal byte */ - Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra != 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra != 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - "pendingBuf overflow"); - - } while (lx < s->last_lit); - - send_code(s, END_BLOCK, ltree); - s->last_eob_len = ltree[END_BLOCK].Len; -} - -/* =========================================================================== - * Set the data type to BINARY or TEXT, using a crude approximation: - * set it to Z_TEXT if all symbols are either printable characters (33 to 255) - * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise. - * IN assertion: the fields Freq of dyn_ltree are set. - */ -local void set_data_type(s) - deflate_state *s; -{ - int n; - - for (n = 0; n < 9; n++) - if (s->dyn_ltree[n].Freq != 0) - break; - if (n == 9) - for (n = 14; n < 32; n++) - if (s->dyn_ltree[n].Freq != 0) - break; - s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY; -} - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -local unsigned bi_reverse(code, len) - unsigned code; /* the value to invert */ - int len; /* its bit length */ -{ - register unsigned res = 0; - do { - res |= code & 1; - code >>= 1, res <<= 1; - } while (--len > 0); - return res >> 1; -} - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -local void bi_flush(s) - deflate_state *s; -{ - if (s->bi_valid == 16) { - put_short(s, s->bi_buf); - s->bi_buf = 0; - s->bi_valid = 0; - } else if (s->bi_valid >= 8) { - put_byte(s, (Byte)s->bi_buf); - s->bi_buf >>= 8; - s->bi_valid -= 8; - } -} - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -local void bi_windup(s) - deflate_state *s; -{ - if (s->bi_valid > 8) { - put_short(s, s->bi_buf); - } else if (s->bi_valid > 0) { - put_byte(s, (Byte)s->bi_buf); - } - s->bi_buf = 0; - s->bi_valid = 0; -#ifdef DEBUG - s->bits_sent = (s->bits_sent+7) & ~7; -#endif -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -local void copy_block(s, buf, len, header) - deflate_state *s; - charf *buf; /* the input data */ - unsigned len; /* its length */ - int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - s->last_eob_len = 8; /* enough lookahead for inflate */ - - if (header) { - put_short(s, (ush)len); - put_short(s, (ush)~len); -#ifdef DEBUG - s->bits_sent += 2*16; -#endif - } -#ifdef DEBUG - s->bits_sent += (ulg)len<<3; -#endif - while (len--) { - put_byte(s, *buf++); - } -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/trees.h b/components/dfs/filesystems/jffs2/cyg/compress/src/trees.h deleted file mode 100644 index 72facf900f..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/trees.h +++ /dev/null @@ -1,128 +0,0 @@ -/* header created automatically with -DGEN_TREES_H */ - -local const ct_data static_ltree[L_CODES+2] = { -{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, -{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, -{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, -{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, -{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, -{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, -{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, -{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, -{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, -{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, -{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, -{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, -{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, -{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, -{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, -{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, -{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, -{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, -{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, -{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, -{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, -{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, -{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, -{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, -{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, -{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, -{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, -{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, -{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, -{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, -{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, -{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, -{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, -{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, -{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, -{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, -{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, -{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, -{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, -{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, -{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, -{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, -{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, -{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, -{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, -{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, -{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, -{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, -{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, -{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, -{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, -{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, -{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, -{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, -{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, -{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, -{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, -{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} -}; - -local const ct_data static_dtree[D_CODES] = { -{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, -{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, -{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, -{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, -{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, -{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} -}; - -const uch _dist_code[DIST_CODE_LEN] = { - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, -10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, -11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, -13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, -14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, -18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, -29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 -}; - -const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, -13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, -17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, -19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, -21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, -23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, -26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, -27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 -}; - -local const int base_length[LENGTH_CODES] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, -64, 80, 96, 112, 128, 160, 192, 224, 0 -}; - -local const int base_dist[D_CODES] = { - 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, - 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, - 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 -}; - diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/uncompr.c b/components/dfs/filesystems/jffs2/cyg/compress/src/uncompr.c deleted file mode 100644 index 52040203bc..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/uncompr.c +++ /dev/null @@ -1,65 +0,0 @@ -/* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2003 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#define ZLIB_INTERNAL -#ifdef __ECOS__ -#include -#else -#include "zlib.h" -#endif // __ECOS__ - -/* =========================================================================== - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. -*/ -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; -{ - z_stream stream; - int err; - - stream.next_in = (Bytef*)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *destLen = stream.total_out; - - err = inflateEnd(&stream); - return err; -} diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/zlib.3 b/components/dfs/filesystems/jffs2/cyg/compress/src/zlib.3 deleted file mode 100644 index 90b8162870..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/zlib.3 +++ /dev/null @@ -1,159 +0,0 @@ -.TH ZLIB 3 "18 July 2005" -.SH NAME -zlib \- compression/decompression library -.SH SYNOPSIS -[see -.I zlib.h -for full description] -.SH DESCRIPTION -The -.I zlib -library is a general purpose data compression library. -The code is thread safe. -It provides in-memory compression and decompression functions, -including integrity checks of the uncompressed data. -This version of the library supports only one compression method (deflation) -but other algorithms will be added later -and will have the same stream interface. -.LP -Compression can be done in a single step if the buffers are large enough -(for example if an input file is mmap'ed), -or can be done by repeated calls of the compression function. -In the latter case, -the application must provide more input and/or consume the output -(providing more output space) before each call. -.LP -The library also supports reading and writing files in -.IR gzip (1) -(.gz) format -with an interface similar to that of stdio. -.LP -The library does not install any signal handler. -The decoder checks the consistency of the compressed data, -so the library should never crash even in case of corrupted input. -.LP -All functions of the compression library are documented in the file -.IR zlib.h . -The distribution source includes examples of use of the library -in the files -.I example.c -and -.IR minigzip.c . -.LP -Changes to this version are documented in the file -.I ChangeLog -that accompanies the source, -and are concerned primarily with bug fixes and portability enhancements. -.LP -A Java implementation of -.I zlib -is available in the Java Development Kit 1.1: -.IP -http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html -.LP -A Perl interface to -.IR zlib , -written by Paul Marquess (pmqs@cpan.org), -is available at CPAN (Comprehensive Perl Archive Network) sites, -including: -.IP -http://www.cpan.org/modules/by-module/Compress/ -.LP -A Python interface to -.IR zlib , -written by A.M. Kuchling (amk@magnet.com), -is available in Python 1.5 and later versions: -.IP -http://www.python.org/doc/lib/module-zlib.html -.LP -A -.I zlib -binding for -.IR tcl (1), -written by Andreas Kupries (a.kupries@westend.com), -is availlable at: -.IP -http://www.westend.com/~kupries/doc/trf/man/man.html -.LP -An experimental package to read and write files in .zip format, -written on top of -.I zlib -by Gilles Vollant (info@winimage.com), -is available at: -.IP -http://www.winimage.com/zLibDll/unzip.html -and also in the -.I contrib/minizip -directory of the main -.I zlib -web site. -.SH "SEE ALSO" -The -.I zlib -web site can be found at either of these locations: -.IP -http://www.zlib.org -.br -http://www.gzip.org/zlib/ -.LP -The data format used by the zlib library is described by RFC -(Request for Comments) 1950 to 1952 in the files: -.IP -http://www.ietf.org/rfc/rfc1950.txt (concerning zlib format) -.br -http://www.ietf.org/rfc/rfc1951.txt (concerning deflate format) -.br -http://www.ietf.org/rfc/rfc1952.txt (concerning gzip format) -.LP -These documents are also available in other formats from: -.IP -ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html -.LP -Mark Nelson (markn@ieee.org) wrote an article about -.I zlib -for the Jan. 1997 issue of Dr. Dobb's Journal; -a copy of the article is available at: -.IP -http://dogma.net/markn/articles/zlibtool/zlibtool.htm -.SH "REPORTING PROBLEMS" -Before reporting a problem, -please check the -.I zlib -web site to verify that you have the latest version of -.IR zlib ; -otherwise, -obtain the latest version and see if the problem still exists. -Please read the -.I zlib -FAQ at: -.IP -http://www.gzip.org/zlib/zlib_faq.html -.LP -before asking for help. -Send questions and/or comments to zlib@gzip.org, -or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). -.SH AUTHORS -Version 1.2.3 -Copyright (C) 1995-2005 Jean-loup Gailly (jloup@gzip.org) -and Mark Adler (madler@alumni.caltech.edu). -.LP -This software is provided "as-is," -without any express or implied warranty. -In no event will the authors be held liable for any damages -arising from the use of this software. -See the distribution directory with respect to requirements -governing redistribution. -The deflate format used by -.I zlib -was defined by Phil Katz. -The deflate and -.I zlib -specifications were written by L. Peter Deutsch. -Thanks to all the people who reported problems and suggested various -improvements in -.IR zlib ; -who are too numerous to cite here. -.LP -UNIX manual page by R. P. C. Rodgers, -U.S. National Library of Medicine (rodgers@nlm.nih.gov). -.\" end of man page diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/zutil.c b/components/dfs/filesystems/jffs2/cyg/compress/src/zutil.c deleted file mode 100644 index d55f5948a3..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/zutil.c +++ /dev/null @@ -1,318 +0,0 @@ -/* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#include "zutil.h" - -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - -const char * const z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ -""}; - - -const char * ZEXPORT zlibVersion() -{ - return ZLIB_VERSION; -} - -uLong ZEXPORT zlibCompileFlags() -{ - uLong flags; - - flags = 0; - switch (sizeof(uInt)) { - case 2: break; - case 4: flags += 1; break; - case 8: flags += 2; break; - default: flags += 3; - } - switch (sizeof(uLong)) { - case 2: break; - case 4: flags += 1 << 2; break; - case 8: flags += 2 << 2; break; - default: flags += 3 << 2; - } - switch (sizeof(voidpf)) { - case 2: break; - case 4: flags += 1 << 4; break; - case 8: flags += 2 << 4; break; - default: flags += 3 << 4; - } - switch (sizeof(z_off_t)) { - case 2: break; - case 4: flags += 1 << 6; break; - case 8: flags += 2 << 6; break; - default: flags += 3 << 6; - } -#ifdef DEBUG - flags += 1 << 8; -#endif -#if defined(ASMV) || defined(ASMINF) - flags += 1 << 9; -#endif -#ifdef ZLIB_WINAPI - flags += 1 << 10; -#endif -#ifdef BUILDFIXED - flags += 1 << 12; -#endif -#ifdef DYNAMIC_CRC_TABLE - flags += 1 << 13; -#endif -#ifdef NO_GZCOMPRESS - flags += 1L << 16; -#endif -#ifdef NO_GZIP - flags += 1L << 17; -#endif -#ifdef PKZIP_BUG_WORKAROUND - flags += 1L << 20; -#endif -#ifdef FASTEST - flags += 1L << 21; -#endif -#ifdef STDC -# ifdef NO_vsnprintf - flags += 1L << 25; -# ifdef HAS_vsprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_vsnprintf_void - flags += 1L << 26; -# endif -# endif -#else - flags += 1L << 24; -# ifdef NO_snprintf - flags += 1L << 25; -# ifdef HAS_sprintf_void - flags += 1L << 26; -# endif -# else -# ifdef HAS_snprintf_void - flags += 1L << 26; -# endif -# endif -#endif - return flags; -} - -#ifdef DEBUG - -# ifndef verbose -# define verbose 0 -# endif -int z_verbose = verbose; - -void z_error (m) - char *m; -{ - fprintf(stderr, "%s\n", m); - exit(1); -} -#endif - -/* exported to allow conversion of error code to string for compress() and - * uncompress() - */ -const char * ZEXPORT zError(err) - int err; -{ - return ERR_MSG(err); -} - -#if defined(_WIN32_WCE) - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. - */ - int errno = 0; -#endif - -#ifndef HAVE_MEMCPY - -void zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = *source++; /* ??? to be unrolled */ - } while (--len != 0); -} - -int zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ - uInt j; - - for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; - } - return 0; -} - -void zmemzero(dest, len) - Bytef* dest; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = 0; /* ??? to be unrolled */ - } while (--len != 0); -} -#endif - - -#ifdef SYS16BIT - -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -# define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - voidpf org_ptr; - voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - voidpf buf = opaque; /* just to make some compilers happy */ - ulg bsize = (ulg)items*size; - - /* If we allocate less than 65520 bytes, we assume that farmalloc - * will return a usable pointer which doesn't have to be normalized. - */ - if (bsize < 65520L) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - int n; - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = 0; n < next_ptr; n++) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - ptr = opaque; /* just to make some compilers happy */ - Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - - -#ifdef M_I86 -/* Microsoft C in 16-bit mode */ - -# define MY_ZCALLOC - -#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) -# define _halloc halloc -# define _hfree hfree -#endif - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - return _halloc((long)items, size); -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - _hfree(ptr); -} - -#endif /* M_I86 */ - -#endif /* SYS16BIT */ - - -#ifndef MY_ZCALLOC /* Any system without a special alloc function */ - -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); -#endif - -voidpf zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ - if (opaque) items += size - size; /* make compiler happy */ - return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : - (voidpf)calloc(items, size); -} - -void zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ - free(ptr); - if (opaque) return; /* make compiler happy */ -} - -#endif /* MY_ZCALLOC */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/src/zutil.h b/components/dfs/filesystems/jffs2/cyg/compress/src/zutil.h deleted file mode 100644 index 013754a1f7..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/src/zutil.h +++ /dev/null @@ -1,276 +0,0 @@ -/* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* WARNING: this file should *not* be used by applications. It is - part of the implementation of the compression library and is - subject to change. Applications should only use zlib.h. - */ - -/* @(#) $Id$ */ - -#ifndef ZUTIL_H -#define ZUTIL_H - -#define ZLIB_INTERNAL -#ifdef __ECOS__ -#include -#include -#undef crc32 -#define crc32 cyg_ether_crc32_accumulate -#else -#include "zlib.h" -#endif // __ECOS__ - -#ifdef STDC -# ifndef _WIN32_WCE -# include -# endif -# include -# include -#endif -#ifdef NO_ERRNO_H -# ifdef _WIN32_WCE - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. We rename it to - * avoid conflict with other libraries that use the same workaround. - */ -# define errno z_errno -# endif - extern int errno; -#else -# ifndef _WIN32_WCE -# include -# endif -#endif - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - -extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ -/* (size given to avoid silly warnings with Visual C++) */ - -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] - -#define ERR_RETURN(strm,err) \ - return (strm->msg = (char*)ERR_MSG(err), (err)) -/* To be used only when the state is known to be valid */ - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) -# define OS_CODE 0x00 -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# include -# endif -#endif - -#ifdef AMIGA -# define OS_CODE 0x01 -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 -# define F_OPEN(name, mode) \ - fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 -#endif - -#ifdef OS2 -# define OS_CODE 0x06 -# ifdef M_I86 - #include -# endif -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -#endif - -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - -#ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ -# define OS_CODE 0x0b -# endif -#endif - -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - - /* common defaults */ - -#ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) fopen((name), (mode)) -#endif - - /* functions */ - -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#ifndef HAVE_VSNPRINTF -# ifdef MSDOS - /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ -# define NO_vsnprintf -# endif -# ifdef __TURBOC__ -# define NO_vsnprintf -# endif -# ifdef WIN32 - /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) -# define vsnprintf _vsnprintf -# endif -# endif -# ifdef __SASC -# define NO_vsnprintf -# endif -#endif -#ifdef VMS -# define NO_vsnprintf -#endif - -#if defined(pyr) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy memcpy -# define zmemcmp memcmp -# define zmemzero(dest, len) memset(dest, 0, len) -# endif -#else - extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - extern void zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef DEBUG -# include - extern int z_verbose; - extern void z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - - -voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); -void zcfree OF((voidpf opaque, voidpf ptr)); - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} - -#endif /* ZUTIL_H */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/tests/zlib1.c b/components/dfs/filesystems/jffs2/cyg/compress/tests/zlib1.c deleted file mode 100644 index 22b2d397b5..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/tests/zlib1.c +++ /dev/null @@ -1,232 +0,0 @@ -//================================================================= -// -// zlib1.c -// -// zlib compression/decompression test 1 -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jskov -// Contributors: jskov -// Date: 2001-03-09 -// Description: Tests zlib compress/decompress functionality. -//####DESCRIPTIONEND#### - - -#include // CYGNUM_HAL_STACK_SIZE_TYPICAL - -#include - -#include -#include - -#ifdef CYGFUN_KERNEL_API_C - -#include -#include - -#define NTHREADS 1 -#define STACKSIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL > 8192 ? CYGNUM_HAL_STACK_SIZE_TYPICAL : 8192) - -static cyg_handle_t thread[NTHREADS]; - -static cyg_thread thread_obj[NTHREADS]; -static char stack[NTHREADS][STACKSIZE]; - -static char license_txt[] = -"Red Hat eCos Public License v1.1\n" -"\n" -"\n" -"1. DEFINITIONS\n" -"\n" -"1.1. \"Contributor\" means each entity that creates or\n" -"contributes to the creation of Modifications.\n" -"\n" -"1.2. \"Contributor Version\" means the combination of the\n" -"Original Code, prior Modifications used by a\n" -"Contributor, and the Modifications made by that\n" -"particular Contributor.\n" -"\n" -"1.3. \"Covered Code\" means the Original Code or\n" -"Modifications or the combination of the Original Code\n" -"and Modifications, in each case including portions\n" -"thereof.\n" -"\n" -"1.4. \"Electronic Distribution Mechanism\" means a\n" -"mechanism generally accepted in the software development\n" -"community for the electronic transfer of data.\n" -"\n" -"1.5. \"Executable\" means Covered Code in any form other\n" -"than Source Code.\n" -"1.6. \"Initial Developer\" means the individual or entity\n" -"identified as the Initial Developer in the Source Code\n" -"notice required by Exhibit A.\n" -"\n" -"1.7. \"Larger Work\" means a work which combines Covered\n" -"Code or portions thereof with code not governed by the\n" -"terms of this License.\n" -"\n" -"1.8. \"License\" means this document.\n" -"\n" -"1.9. \"Modifications\" means any addition to or deletion\n" -"from the substance or structure of either the Original\n" -"Code or any previous Modifications. When Covered Code is\n" -"released as a series of files, a Modification is:\n" -"\n" -" A. Any addition to or deletion from the\n" -" contents of a file containing Original Code or\n" -" previous Modifications.\n" -"\n" -" B. Any new file that contains any part of the\n" -" Original Code or previous Modifications.\n" -"\n" -"1.10. \"Original Code\" means Source Code of computer\n" -"software code which is described in the Source Code\n" -"notice required by Exhibit A as Original Code, and\n" -"which, at the time of its release under this License is\n" -"not already Covered Code governed by this License.\n" -"\n" -"1.11. \"Source Code\" means the preferred form of the\n" -"Covered Code for making modifications to it, including\n" -"all modules it contains, plus any associated interface\n" -"definition files, scripts used to control compilation\n" -"and installation of an Executable, or a list of source\n" -"code differential comparisons against either the\n" -"Original Code or another well known, available Covered\n" -"Code of the Contributor's choice. The Source Code can be\n" -"in a compressed or archival form, provided the\n" -"appropriate decompression or de-archiving software is\n" -"widely available for no charge.\n" -"\n" -"1.12. \"You\" means an individual or a legal entity\n" -"exercising rights under, and complying with all of the\n" -"terms of, this License or a future version of this\n" -"License issued under Section 6.1. For legal entities,\n" -"\"You\" includes any entity which controls, is controlled\n" -"by, or is under common control with You. For purposes of\n" -"this definition, \"control\" means (a) the power, direct\n" -"or indirect, to cause the direction or management of\n" -"such entity, whether by contract or otherwise, or (b)\n" -"ownership of fifty percent (50%) or more of the\n" -"outstanding shares or beneficial ownership of such\n" -"entity.\n" -"\n" -"1.13. \"Red Hat Branded Code\" is code that Red Hat\n" -"distributes and/or permits others to distribute under\n" -"different terms than the Red Hat eCos Public License.\n" -"Red Hat's Branded Code may contain part or all of the\n" -"Covered Code.\n"; - -static void entry0( cyg_addrword_t data ) -{ - int i; - unsigned long len; - int err; - int buf_size = sizeof(license_txt)+512; - unsigned char* packed = malloc(buf_size); - unsigned char* unpacked = malloc(buf_size); - - if (NULL == packed || NULL == unpacked) - CYG_TEST_NA("Not enough memory for buffers"); - - CYG_TEST_INFO("Compressing"); - - len = buf_size; - err = compress(packed, &len, license_txt, sizeof(license_txt)); - diag_printf("len = %d", len); - diag_dump_buf(packed, len); - - if (Z_OK != err) - CYG_TEST_NA("Not enough memory for compression"); - - - CYG_TEST_INFO("Decompressing"); - err = uncompress(unpacked, &buf_size, packed, len); - - switch (err) { - case Z_OK: - break; - case Z_MEM_ERROR: - CYG_TEST_NA("Not enough memory for decompression"); - break; - case Z_BUF_ERROR: - CYG_TEST_FAIL_FINISH("Decompressed data larger than original"); - break; - case Z_DATA_ERROR: - CYG_TEST_FAIL_FINISH("Decompression failed"); - break; - default: - CYG_TEST_FAIL_FINISH("Unknown decompression error"); - break; - } - - for (i = 0; i < sizeof(license_txt)-1; i++) { - if (license_txt[i] != unpacked[i]) - CYG_TEST_FAIL_FINISH("Verify failed"); - } - - CYG_TEST_PASS_FINISH("zlib1 OK"); -} - -void zlib1_main( void ) -{ - CYG_TEST_INIT(); - - cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "zlib1", - (void *)stack[0], STACKSIZE,&thread[0], &thread_obj[0]); - cyg_thread_resume(thread[0]); - - cyg_scheduler_start(); - - CYG_TEST_FAIL_FINISH("Not reached"); -} - -externC void -cyg_start( void ) -{ - zlib1_main(); -} - -#else /* def CYGFUN_KERNEL_API_C */ -externC void -cyg_start( void ) -{ - CYG_TEST_INIT(); - CYG_TEST_NA("Kernel C API layer disabled"); -} -#endif /* def CYGFUN_KERNEL_API_C */ - -// EOF zlib1.c diff --git a/components/dfs/filesystems/jffs2/cyg/compress/tests/zlib2.c b/components/dfs/filesystems/jffs2/cyg/compress/tests/zlib2.c deleted file mode 100644 index 11e36e1369..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/tests/zlib2.c +++ /dev/null @@ -1,307 +0,0 @@ -//================================================================= -// -// zlib2.c -// -// zlib decompression test 2 -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jskov -// Contributors: jskov -// Date: 2001-03-09 -// Description: Tests zlib compression of gz compressed image. -//####DESCRIPTIONEND#### - - -#include // CYGNUM_HAL_STACK_SIZE_TYPICAL - -#include - -#include - -#ifdef CYGFUN_KERNEL_API_C - -#include -#include - -#define NTHREADS 1 -#define STACKSIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL > 8192 ? CYGNUM_HAL_STACK_SIZE_TYPICAL : 8192) - -static cyg_handle_t thread[NTHREADS]; - -static cyg_thread thread_obj[NTHREADS]; -static char stack[NTHREADS][STACKSIZE]; - - -unsigned char gzip_test[] = { -0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x8d, 0x56, 0xdb, 0x6e, 0xe3, 0x36, -0x10, 0xed, 0x33, 0xbf, 0x82, 0x08, 0x50, 0x74, 0x03, 0xb8, 0xee, 0xa6, 0xed, 0x6e, 0x2f, 0x6f, -0xd9, 0x24, 0x8b, 0x06, 0xd8, 0x4b, 0x91, 0x2c, 0xba, 0xe8, 0x23, 0x4d, 0x8d, 0x6c, 0x22, 0x12, -0xa9, 0x92, 0x94, 0x9d, 0xfc, 0x7d, 0xcf, 0x0c, 0x25, 0x59, 0x72, 0x1a, 0xa0, 0x7e, 0x32, 0x45, -0x72, 0xe6, 0xcc, 0xcc, 0x99, 0x33, 0xbc, 0xa3, 0x4a, 0xff, 0x61, 0xb2, 0xa6, 0xab, 0x90, 0xf4, -0x9f, 0xfd, 0xa6, 0x71, 0x56, 0x7f, 0x70, 0x96, 0x7c, 0x22, 0xbd, 0xbf, 0x58, 0x5f, 0x28, 0xfc, -0x2e, 0xd6, 0xfa, 0xfa, 0xe6, 0xfd, 0xed, 0xa7, 0xdb, 0x2f, 0xb7, 0x9f, 0x3f, 0xdd, 0xf3, 0x1a, -0x5f, 0xce, 0xae, 0x82, 0xcf, 0xd1, 0x6d, 0xfa, 0x1c, 0xe2, 0x99, 0x6e, 0xc9, 0xf8, 0xa4, 0xc9, -0xd8, 0x9d, 0x26, 0x9f, 0x5d, 0x7e, 0xd2, 0x79, 0x07, 0xab, 0x36, 0x92, 0xc9, 0x94, 0x74, 0x88, -0xca, 0x8e, 0xc7, 0xb1, 0xcc, 0x01, 0xdb, 0x54, 0x76, 0x5d, 0xf0, 0x3a, 0xd4, 0xfa, 0x63, 0xa8, -0x5c, 0xed, 0xac, 0xac, 0xd3, 0x9a, 0x7d, 0xfc, 0xb8, 0xf4, 0xa1, 0xff, 0xa2, 0x98, 0xb0, 0x39, -0xfa, 0x12, 0x03, 0xa1, 0xdd, 0x38, 0x3f, 0xd9, 0xc0, 0x27, 0xf5, 0x39, 0xba, 0x2d, 0x3e, 0x35, -0xfa, 0x2a, 0x54, 0xb4, 0xd2, 0x5d, 0x74, 0xb8, 0xba, 0x30, 0xae, 0xfb, 0x84, 0x98, 0x37, 0x4f, -0xda, 0xa8, 0x99, 0xf9, 0x95, 0x36, 0xbe, 0x12, 0xa3, 0xcb, 0xc3, 0xad, 0xa9, 0x88, 0x0f, 0x73, -0x38, 0xaa, 0x33, 0x31, 0x3b, 0xdb, 0x37, 0x26, 0xea, 0xd9, 0x55, 0x41, 0xfb, 0x93, 0xa0, 0xdd, -0x53, 0x84, 0x6d, 0x76, 0x3d, 0x87, 0xb9, 0xc0, 0xc4, 0xb9, 0x58, 0xba, 0x00, 0xc0, 0xff, 0x0e, -0x66, 0x79, 0x51, 0x31, 0xc0, 0xc5, 0xcd, 0x95, 0x76, 0xbe, 0xe4, 0xdc, 0x1a, 0x94, 0xcb, 0x79, -0xdb, 0xf4, 0x95, 0xf3, 0x5b, 0xdd, 0x85, 0x28, 0x07, 0x14, 0x8c, 0x44, 0x0a, 0xb5, 0x20, 0xfc, -0x19, 0x08, 0x6f, 0x1a, 0xb2, 0x39, 0x06, 0x8f, 0x22, 0x5f, 0xbb, 0x54, 0x02, 0x60, 0x7f, 0x1f, -0xc9, 0xee, 0x8c, 0x77, 0xa9, 0x1d, 0x61, 0x1b, 0xd5, 0x8e, 0x9f, 0xf4, 0x96, 0x3c, 0x45, 0xd3, -0x34, 0xc8, 0x98, 0xb5, 0xd4, 0x65, 0x44, 0x08, 0xbf, 0x8c, 0x2f, 0x85, 0x3a, 0x1f, 0x4c, 0x24, -0x5d, 0xd1, 0x9e, 0x9a, 0xd0, 0xb5, 0xa8, 0x3d, 0x0a, 0xdd, 0xb6, 0xbd, 0x67, 0x0a, 0xd4, 0x43, -0x64, 0x74, 0xf4, 0x9a, 0x23, 0xac, 0xd7, 0x14, 0x39, 0xc2, 0xca, 0x64, 0x23, 0xc8, 0xde, 0x30, -0xb2, 0x47, 0xb2, 0x7d, 0x36, 0x9b, 0x66, 0xca, 0xdc, 0x3c, 0x9b, 0xec, 0xd0, 0x78, 0xb1, 0xd8, -0xea, 0xc0, 0x51, 0x21, 0x34, 0xe3, 0xf5, 0x7d, 0xe8, 0xa3, 0x25, 0x39, 0xb2, 0x86, 0xa1, 0xb7, -0x30, 0x74, 0x0b, 0xd7, 0x0e, 0x29, 0xbb, 0x2e, 0x90, 0x28, 0xce, 0x2b, 0xe1, 0x7c, 0xe5, 0xf6, -0xae, 0xea, 0xb1, 0x0f, 0x6c, 0x85, 0xa9, 0xca, 0x55, 0xfc, 0xa7, 0x76, 0xf0, 0x65, 0xca, 0xb1, -0x67, 0x36, 0xc6, 0x80, 0x67, 0xfe, 0x94, 0x0f, 0xe0, 0x02, 0xe9, 0x48, 0xff, 0xf4, 0x2e, 0x16, -0x46, 0xdd, 0x3c, 0xee, 0xdc, 0xc6, 0x65, 0x7d, 0x29, 0x61, 0xfd, 0x02, 0x34, 0x1f, 0x4c, 0xdc, -0xe2, 0xfa, 0xd7, 0x10, 0x1f, 0xa6, 0xd4, 0xea, 0x03, 0x56, 0xfa, 0xb0, 0x73, 0x5c, 0x38, 0x29, -0x3a, 0x4d, 0xd1, 0xaa, 0x81, 0x22, 0x53, 0x09, 0xf5, 0x50, 0x42, 0x7d, 0x70, 0x99, 0x8f, 0x63, -0x17, 0x8e, 0xf5, 0x96, 0x8f, 0xfb, 0xe2, 0x95, 0x69, 0x9f, 0x29, 0xb6, 0xa9, 0xd0, 0xc6, 0xa5, -0xb1, 0x81, 0x05, 0xc5, 0xaf, 0x8c, 0xa2, 0xac, 0x8f, 0x99, 0xc0, 0x99, 0x2a, 0xd8, 0x9e, 0xeb, -0x25, 0x87, 0x7e, 0xc3, 0xa1, 0x05, 0xb5, 0x26, 0xb0, 0x48, 0xba, 0xa9, 0x2a, 0x27, 0x2c, 0x41, -0xdb, 0x02, 0x59, 0x85, 0x72, 0xf2, 0x52, 0xd5, 0x31, 0xb4, 0x85, 0x06, 0xfd, 0x26, 0x65, 0xe3, -0xad, 0x00, 0x07, 0xab, 0x7a, 0x9b, 0x7b, 0x90, 0x02, 0x68, 0xc8, 0x31, 0xfc, 0x05, 0x97, 0xa7, -0x08, 0xd9, 0x74, 0x17, 0x69, 0xef, 0x42, 0x9f, 0x4e, 0xda, 0x5f, 0x7f, 0xdd, 0x91, 0x3f, 0x21, -0x40, 0x52, 0x11, 0x8e, 0x4d, 0x2a, 0x55, 0x32, 0x3a, 0x51, 0x74, 0x24, 0x21, 0xd7, 0xae, 0x21, -0xf4, 0x82, 0x59, 0x18, 0xc1, 0x85, 0xdf, 0x95, 0xd2, 0xfc, 0xbb, 0x5c, 0xeb, 0xcb, 0x97, 0xc3, -0xd0, 0x63, 0x18, 0xe5, 0x30, 0xcb, 0x14, 0xb2, 0x22, 0x86, 0x8d, 0x98, 0x96, 0x4f, 0xc6, 0x79, -0x6e, 0xac, 0x67, 0x9d, 0x2c, 0x77, 0x5e, 0x88, 0x62, 0x70, 0xff, 0xae, 0xb8, 0xf7, 0x74, 0x28, -0xe6, 0x8a, 0x30, 0x16, 0x9b, 0x25, 0xc1, 0x2c, 0x2b, 0xa3, 0x7e, 0xc9, 0x95, 0x53, 0x37, 0x2f, -0x7b, 0x80, 0x14, 0xbf, 0x46, 0xed, 0x16, 0x17, 0xc6, 0xda, 0xcd, 0xc8, 0xca, 0xd6, 0x41, 0xb5, -0x0e, 0xea, 0x1b, 0xd5, 0xd4, 0xb5, 0xc2, 0xa6, 0xc2, 0x43, 0x26, 0x04, 0x25, 0x0b, 0x41, 0x38, -0x76, 0xf7, 0xff, 0x25, 0x3b, 0xd7, 0xe3, 0x44, 0x76, 0x21, 0x55, 0x4a, 0x0c, 0xe3, 0x6f, 0x16, -0x63, 0xd9, 0xb5, 0x82, 0xc2, 0x21, 0xb5, 0x43, 0x21, 0x75, 0xef, 0x2b, 0x21, 0xc7, 0x91, 0xb1, -0x5c, 0x66, 0xa6, 0xb7, 0x69, 0x30, 0x1a, 0xaa, 0xa7, 0x25, 0x05, 0x96, 0x9c, 0x3f, 0xa1, 0xf9, -0x05, 0x8f, 0xa4, 0x19, 0xe2, 0x79, 0xd7, 0x23, 0x7b, 0x90, 0x1c, 0xb6, 0x53, 0xf4, 0xa3, 0x64, -0x7a, 0x61, 0x9b, 0xa5, 0xaa, 0x35, 0x0f, 0x5c, 0xe3, 0x76, 0x21, 0xce, 0x20, 0x8b, 0xcb, 0xab, -0xa3, 0xb6, 0x2a, 0x08, 0x21, 0x1f, 0xe9, 0xc1, 0x39, 0xec, 0x4c, 0x85, 0xc4, 0xa8, 0x69, 0xfa, -0xa1, 0x5f, 0x52, 0x0a, 0xd6, 0x99, 0xa2, 0x93, 0x48, 0x78, 0x6d, 0x2c, 0xa9, 0x8a, 0x6a, 0xe7, -0x0b, 0xff, 0x06, 0xbe, 0x72, 0xb6, 0xbb, 0x3c, 0x8c, 0x23, 0xb8, 0x91, 0x01, 0x19, 0x1a, 0xa9, -0x93, 0x6b, 0xc4, 0xbd, 0x48, 0x3e, 0x8c, 0x67, 0x38, 0x9d, 0x06, 0x03, 0x64, 0xef, 0x28, 0x96, -0x2b, 0xe9, 0x24, 0xdd, 0x40, 0xcc, 0x79, 0x2f, 0x49, 0x02, 0x94, 0x14, 0x16, 0x51, 0x20, 0x6a, -0x96, 0x36, 0x53, 0x8c, 0x9a, 0xe8, 0x12, 0x87, 0x64, 0xb6, 0x0c, 0x38, 0xcf, 0x9a, 0x53, 0x3d, -0x23, 0x9c, 0xf1, 0xa2, 0xb2, 0xfa, 0x40, 0x08, 0xf7, 0xc1, 0x87, 0x83, 0x47, 0x25, 0xf7, 0x06, -0xb8, 0xe0, 0xf4, 0x44, 0xac, 0xca, 0xac, 0x9a, 0x0d, 0xc4, 0xef, 0x92, 0xb6, 0xbb, 0x80, 0xe2, -0xac, 0xf5, 0x97, 0x25, 0x8f, 0x30, 0xa8, 0xbc, 0xde, 0x90, 0x62, 0x39, 0x17, 0x4c, 0x91, 0x12, -0x87, 0xcf, 0x1e, 0xa3, 0xdd, 0xb9, 0x3d, 0x20, 0x70, 0x8d, 0x78, 0x70, 0x07, 0x08, 0x35, 0xc9, -0x48, 0x56, 0xa6, 0xc3, 0x12, 0xa3, 0x1c, 0x39, 0x05, 0x4d, 0xc7, 0x7b, 0x92, 0x0f, 0x6e, 0xe4, -0xef, 0xcb, 0x5d, 0x2e, 0xde, 0xc4, 0x6d, 0x10, 0xe9, 0x80, 0xfb, 0x3c, 0xb4, 0x26, 0xd8, 0x5c, -0x64, 0x8f, 0x44, 0xef, 0x58, 0x94, 0x0b, 0x6b, 0xf8, 0x91, 0xf1, 0x77, 0xe8, 0x8f, 0x72, 0x77, -0x32, 0x22, 0x90, 0x5a, 0xda, 0xe2, 0xef, 0x30, 0x2a, 0xe8, 0x91, 0xa2, 0x75, 0x89, 0x3d, 0x21, -0x63, 0x3b, 0xae, 0x1e, 0x73, 0xb8, 0x3c, 0x1e, 0x18, 0x57, 0xf3, 0xc4, 0x7b, 0xa2, 0xd5, 0x4c, -0x94, 0x81, 0x6a, 0xa3, 0x3a, 0xaf, 0x96, 0x64, 0x17, 0xfb, 0x75, 0x2f, 0x62, 0xb9, 0x2f, 0xaf, -0x9b, 0x51, 0xc2, 0xd5, 0xb1, 0x21, 0x52, 0x8f, 0x2c, 0x94, 0x56, 0xb9, 0xc7, 0x1c, 0xe5, 0x43, -0x6f, 0xf9, 0x01, 0xf6, 0x1e, 0xd7, 0x67, 0xe0, 0x20, 0x86, 0x2b, 0x55, 0x62, 0x29, 0x64, 0xa5, -0xc2, 0xc6, 0xe1, 0x39, 0x36, 0x8e, 0x1b, 0xe1, 0x18, 0xbf, 0x1c, 0xd2, 0xb8, 0x68, 0x50, 0xc8, -0xcd, 0x93, 0x10, 0xc9, 0x0d, 0xf1, 0x70, 0x28, 0x2d, 0xfc, 0x8c, 0x94, 0x94, 0x78, 0x60, 0xba, -0x38, 0xed, 0xfa, 0xd8, 0x85, 0x24, 0xda, 0xab, 0xca, 0x28, 0x99, 0xb8, 0xbd, 0xd2, 0x67, 0xc3, -0x9d, 0x31, 0xa3, 0xaf, 0xcc, 0x79, 0xe9, 0xc1, 0x70, 0xe0, 0x3c, 0x55, 0x50, 0x0f, 0x9b, 0x15, -0xfb, 0xf2, 0xe5, 0xff, 0x4a, 0xb8, 0x6f, 0xd0, 0x05, 0x72, 0xae, 0x7c, 0x1c, 0x4a, 0xdb, 0x1a, -0x6f, 0xb6, 0xc4, 0x53, 0x8a, 0x7d, 0xa5, 0x7e, 0x7a, 0x5d, 0xae, 0x10, 0x0f, 0x09, 0x41, 0xa1, -0x05, 0xe2, 0xd1, 0xd8, 0xcc, 0x37, 0x84, 0xb5, 0x07, 0x97, 0x4a, 0x63, 0xbc, 0xda, 0x9c, 0x2b, -0x50, 0x17, 0xa9, 0xdd, 0xb9, 0xae, 0x8c, 0x8a, 0x1a, 0xb9, 0xc0, 0x40, 0xb7, 0x6c, 0xf3, 0xd5, -0x9b, 0xd7, 0xdf, 0x9e, 0x8b, 0x9f, 0x10, 0x47, 0x1e, 0xab, 0xd0, 0x67, 0x1e, 0x66, 0xf2, 0x8e, -0x4a, 0x60, 0x8a, 0xbc, 0x5e, 0xc1, 0x59, 0x8f, 0x20, 0x2d, 0xb7, 0xd2, 0xc2, 0x20, 0x63, 0x52, -0x05, 0x53, 0x21, 0x14, 0xbf, 0x03, 0xef, 0x86, 0x37, 0xf5, 0x3b, 0x3c, 0x76, 0xaa, 0xe9, 0x3d, -0x28, 0x19, 0xaf, 0x06, 0xfd, 0x1f, 0x8e, 0xa8, 0x6a, 0x7c, 0x85, 0x49, 0xb5, 0xaa, 0x1f, 0x38, -0xbd, 0x20, 0x0b, 0xab, 0xa4, 0x84, 0x22, 0x02, 0x74, 0x3c, 0x54, 0xca, 0xa3, 0xa6, 0xd6, 0xd6, -0x85, 0x59, 0xf2, 0x16, 0xe2, 0xec, 0xdd, 0xbd, 0xfc, 0x9a, 0x5f, 0xab, 0x61, 0x13, 0xdd, 0x39, -0x07, 0x86, 0x24, 0x3f, 0x8d, 0x2a, 0x36, 0x4c, 0xa2, 0x38, 0xe7, 0xee, 0x5c, 0x26, 0xd7, 0xea, -0x9b, 0x7f, 0x01, 0x21, 0xe0, 0xda, 0x98, 0x30, 0x0c, 0x00, 0x00}; - -unsigned char gzip_test_ref[] = -"Red Hat eCos Public License v1.1\n" -"\n" -"\n" -"\n" -"1. DEFINITIONS\n" -"\n" -"1.1. \"Contributor\" means each entity that creates or\n" -"contributes to the creation of Modifications.\n" -"\n" -"1.2. \"Contributor Version\" means the combination of the\n" -"Original Code, prior Modifications used by a\n" -"Contributor, and the Modifications made by that\n" -"particular Contributor.\n" -"\n" -"1.3. \"Covered Code\" means the Original Code or\n" -"Modifications or the combination of the Original Code\n" -"and Modifications, in each case including portions\n" -"thereof.\n" -"\n" -"1.4. \"Electronic Distribution Mechanism\" means a\n" -"mechanism generally accepted in the software development\n" -"community for the electronic transfer of data.\n" -"\n" -"1.5. \"Executable\" means Covered Code in any form other\n" -"than Source Code.\n" -"1.6. \"Initial Developer\" means the individual or entity\n" -"identified as the Initial Developer in the Source Code\n" -"notice required by Exhibit A.\n" -"\n" -"1.7. \"Larger Work\" means a work which combines Covered\n" -"Code or portions thereof with code not governed by the\n" -"terms of this License.\n" -"\n" -"1.8. \"License\" means this document.\n" -"\n" -"1.9. \"Modifications\" means any addition to or deletion\n" -"from the substance or structure of either the Original\n" -"Code or any previous Modifications. When Covered Code is\n" -"released as a series of files, a Modification is:\n" -"\n" -" A. Any addition to or deletion from the\n" -" contents of a file containing Original Code or\n" -" previous Modifications.\n" -"\n" -" B. Any new file that contains any part of the\n" -" Original Code or previous Modifications.\n" -"\n" -"1.10. \"Original Code\" means Source Code of computer\n" -"software code which is described in the Source Code\n" -"notice required by Exhibit A as Original Code, and\n" -"which, at the time of its release under this License is\n" -"not already Covered Code governed by this License.\n" -"\n" -"1.11. \"Source Code\" means the preferred form of the\n" -"Covered Code for making modifications to it, including\n" -"all modules it contains, plus any associated interface\n" -"definition files, scripts used to control compilation\n" -"and installation of an Executable, or a list of source\n" -"code differential comparisons against either the\n" -"Original Code or another well known, available Covered\n" -"Code of the Contributor's choice. The Source Code can be\n" -"in a compressed or archival form, provided the\n" -"appropriate decompression or de-archiving software is\n" -"widely available for no charge.\n" -"\n" -"1.12. \"You\" means an individual or a legal entity\n" -"exercising rights under, and complying with all of the\n" -"terms of, this License or a future version of this\n" -"License issued under Section 6.1. For legal entities,\n" -"\"You\" includes any entity which controls, is controlled\n" -"by, or is under common control with You. For purposes of\n" -"this definition, \"control\" means (a) the power, direct\n" -"or indirect, to cause the direction or management of\n" -"such entity, whether by contract or otherwise, or (b)\n" -"ownership of fifty percent (50%) or more of the\n" -"outstanding shares or beneficial ownership of such\n" -"entity.\n" -"\n" -"1.13. \"Red Hat Branded Code\" is code that Red Hat\n" -"distributes and/or permits others to distribute under\n" -"different terms than the Red Hat eCos Public License.\n" -"Red Hat's Branded Code may contain part or all of the\n" -"Covered Code.\n"; - -static void entry0( cyg_addrword_t data ) -{ - int i; - unsigned long len; - int err; - int buf_size = sizeof(gzip_test_ref)+512; - unsigned char* unpacked = malloc(buf_size); - - if (NULL == unpacked) - CYG_TEST_NA("Not enough memory for buffers"); - - CYG_TEST_INFO("Decompressing"); - len = buf_size; - err = uncompress(unpacked, &len, gzip_test, sizeof(gzip_test)); - - switch (err) { - case Z_OK: - break; - case Z_MEM_ERROR: - CYG_TEST_NA("Not enough memory for decompression"); - break; - case Z_BUF_ERROR: - CYG_TEST_FAIL_FINISH("Decompressed data larger than original"); - break; - case Z_DATA_ERROR: - CYG_TEST_FAIL_FINISH("Decompression failed"); - break; - default: - CYG_TEST_FAIL_FINISH("Unknown decompression error"); - break; - } - - for (i = 0; i < sizeof(gzip_test_ref)-1; i++) { - if (gzip_test_ref[i] != unpacked[i]) - CYG_TEST_FAIL_FINISH("Verify failed"); - } - - CYG_TEST_PASS_FINISH("zlib2 OK"); -} - -void zlib2_main( void ) -{ - CYG_TEST_INIT(); - - cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "zlib1", - (void *)stack[0], STACKSIZE,&thread[0], &thread_obj[0]); - cyg_thread_resume(thread[0]); - - cyg_scheduler_start(); - - CYG_TEST_FAIL_FINISH("Not reached"); -} - -externC void -cyg_start( void ) -{ - zlib2_main(); -} - -#else /* def CYGFUN_KERNEL_API_C */ -externC void -cyg_start( void ) -{ - CYG_TEST_INIT(); - CYG_TEST_NA("Kernel C API layer disabled"); -} -#endif /* def CYGFUN_KERNEL_API_C */ - -// EOF zlib1.c diff --git a/components/dfs/filesystems/jffs2/cyg/compress/zconf.h b/components/dfs/filesystems/jffs2/cyg/compress/zconf.h deleted file mode 100644 index dc360d8ff6..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/zconf.h +++ /dev/null @@ -1,358 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -// #ifdef __ECOS__ -#undef __ECOS__ -#define __ECOS__ -#include - -#ifndef RT_USING_LIBC -#define malloc rt_malloc -#define free rt_free -#define printf rt_kprintf -#endif - -//#define Z_PREFIX //by prife -//#include //prife no such file. - -#if CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC != 0 -#define MY_ZCALLOC -#endif -#ifdef CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP -#undef MAX_WBITS -#define MAX_WBITS 15+16 /* 32K LZ77 window */ -#else -#define NO_GZIP -#define NO_GZCOMPRESS -#endif -// #endif - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - */ -#ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define deflatePrime z_deflatePrime -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table -# define zError z_zError - -# define alloc_func z_alloc_func -# define free_func z_free_func -# define in_func z_in_func -# define out_func z_out_func -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -# ifdef FAR -# undef FAR -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/components/dfs/filesystems/jffs2/cyg/compress/zlib.h b/components/dfs/filesystems/jffs2/cyg/compress/zlib.h deleted file mode 100644 index 081e7c912f..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/compress/zlib.h +++ /dev/null @@ -1,1358 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has - dropped to zero. It must update next_out and avail_out when avail_out - has dropped to zero. The application must initialize zalloc, zfree and - opaque before calling the init function. All other fields are set by the - compression library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this - if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, - pointers returned by zalloc for objects of exactly 65536 bytes *must* - have their offset normalized to zero. The default allocation function - provided by this library ensures this (see zutil.c). To reduce memory - requirements and avoid any allocation of 64K objects, at the expense of - compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or - progress reports. After compression, total_in holds the total size of - the uncompressed data and may be saved for use in the decompressor - (particularly if the decompressor wants to decompress everything in - a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is - not compatible with the zlib.h header file used by the application. - This check is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. - If zalloc and zfree are set to Z_NULL, deflateInit updates them to - use default allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at - all (the input data is simply copied a block at a time). - Z_DEFAULT_COMPRESSION requests a default compromise between speed and - compression (currently equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if level is not a valid compression level, - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). - msg is set to null if there is no error message. deflateInit does not - perform any compression: this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce some - output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). - Some output may be provided even if flush is not set. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating avail_in or avail_out accordingly; avail_out - should never be zero before the call. The application can consume the - compressed output when it wants, for example when the output buffer is full - (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK - and with zero avail_out, it must be called again after making room in the - output buffer because there might be more output pending. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumualte before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In particular - avail_in is zero after the call if enough output space has been provided - before the call.) Flushing may degrade compression for some compression - algorithms and so it should be used only when necessary. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there - was enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the - stream are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least - the value returned by deflateBound (see below). If deflate does not return - Z_STREAM_END, then it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect - the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, - msg may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the exact - value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller. msg is set to null if there is no error - message. inflateInit does not perform any decompression apart from reading - the zlib header if present: this will be done by inflate(). (So next_in and - avail_in may be modified, but next_out and avail_out are unchanged.) -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing - will resume at this point for the next call of inflate(). - - - Provide more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there - is no more input data or no more space in the output buffer (see below - about the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming - more output, and updating the next_* and avail_* values accordingly. - The application can consume the uncompressed output when it wants, for - example when the output buffer is full (avail_out == 0), or after each - call of inflate(). If inflate returns Z_OK and with zero avail_out, it - must be called again after making room in the output buffer because there - might be more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, - Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() stop - if and when it gets to the next deflate block boundary. When decoding the - zlib or gzip format, this will cause inflate() to return immediately after - the header and before the first block. When doing a raw inflate, inflate() - will go ahead and process the first block, and will return when it gets to - the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 - if inflate() is currently decoding the last block in the deflate stream, - plus 128 if inflate() returned immediately after decoding an end-of-block - code or decoding the complete header up to just before the first byte of the - deflate stream. The end-of-block will not be indicated until all of the - uncompressed data from that block has been written to strm->next_out. The - number of unused bits may in general be greater than seven, except when - bit 7 of data_type is set, in which case the number of unused bits will be - less than eight. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step - (a single call of inflate), the parameter flush should be set to - Z_FINISH. In this case all pending input is processed and all pending - output is flushed; avail_out must be large enough to hold all the - uncompressed data. (The size of the uncompressed data may have been saved - by the compressor for this purpose.) The next operation on this stream must - be inflateEnd to deallocate the decompression state. The use of Z_FINISH - is never required, but can be used to inform inflate that a faster approach - may be used for the single inflate() call. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the only effect of the flush parameter in this implementation - is on the return value of inflate(), as noted below, or when it returns early - because Z_BLOCK is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the adler32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the adler32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() will decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically. Any information - contained in the gzip header is not retained, so applications that need that - information should instead use raw inflate, see inflateInit2() below, or - inflateBack() and perform their own processing of the gzip header and - trailer. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may then - call inflateSync() to look for a good compression block if a partial recovery - of the data is desired. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any - pending output. - - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). -*/ - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields next_in, zalloc, zfree and opaque must be initialized before by - the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but - is slow and reduces compression ratio; memLevel=9 uses maximum memory - for optimal speed. The default value is 8. See zconf.h for total memory - usage as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as - Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy - parameter only affects the compression ratio but not the correctness of the - compressed output even if it is not set appropriately. Z_FIXED prevents the - use of dynamic Huffman codes, allowing for a simpler decoder for special - applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid - method). msg is set to null if there is no error message. deflateInit2 does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. This function must be called - immediately after deflateInit, deflateInit2 or deflateReset, before any - call of deflate. The compressor and decompressor must use exactly the same - dictionary (see inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size in - deflate or deflate2. Thus the strings most likely to be useful should be - put at the end of the dictionary, not at the front. In addition, the - current implementation of deflate will use at most the window size minus - 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the adler32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if the compression method is bsort). deflateSetDictionary does not - perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and - can consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. - The stream will keep the same compression level and any other attributes - that may have been set by deflateInit2. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different - strategy. If the compression level is changed, the input available so far - is compressed with the old level (and may be flushed); the new level will - take effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to - be compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR - if strm->avail_out was zero. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() - or deflateInit2(). This would be used to allocate an output buffer - for deflation in a single pass, and so would be called before deflate(). -*/ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the - bits leftover from a previous deflate stream when appending to it. As such, - this function can only be used for raw deflate, and must be used before the - first deflate() call after a deflateInit2() or deflateReset(). bits must be - less than or equal to 16, and that many of the least significant bits of - value will be inserted in the output. - - deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is - a crc32 instead of an adler32. - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg - is set to null if there is no error message. inflateInit2 does not perform - any decompression apart from reading the zlib header if present: this will - be done by inflate(). (So next_in and avail_in may be modified, but next_out - and avail_out are unchanged.) -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called - immediately after inflateInit2() or inflateReset() and before any call of - inflate() to set the dictionary. The application must insure that the - dictionary that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (such as NULL dictionary) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a full flush point (see above the - description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR - if no more input was provided, Z_DATA_ERROR if no flush point has been found, - or Z_STREAM_ERROR if the stream structure was inconsistent. In the success - case, the application may save the current current value of total_in which - indicates where valid compressed data was found. In the error case, the - application may repeatedly call inflateSync, providing more input each time, - until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. - The stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being NULL). -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK can be used to - force inflate() to return immediately after header processing is complete - and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When - any of extra, name, or comment are not Z_NULL and the respective field is - not present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not - be allocated, or Z_VERSION_ERROR if the version of the library does not - match the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is more efficient than inflate() for - file i/o applications in that it avoids copying between the output and the - sliding window by simply making the window itself the output buffer. This - function trusts the application to not change the output buffer passed by - the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free - the allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects - only the raw deflate stream to decompress. This is different from the - normal behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format - error in the deflate stream (in which case strm->msg is set to indicate the - nature of the error), or Z_STREAM_ERROR if the stream was not properly - initialized. In the case of Z_BUF_ERROR, an input or output error can be - distinguished using strm->next_in which will be Z_NULL only if in() returned - an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to - out() returning non-zero. (in() will always be called before out(), so - strm->next_in is assured to be defined if out() returns non-zero.) Note - that inflateBack() cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - - - /* utility functions */ - -/* - The following utility functions are implemented on top of the - basic stream-oriented functions. To simplify the interface, some - default options are assumed (compression level and memory usage, - standard memory allocation functions). The source code of these - utility functions can easily be modified if you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be at least the value returned - by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - This function can be used to compress a whole file at once if the - input file is mmap'ed. - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before - a compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - This function can be used to decompress a whole file at once if the - input file is mmap'ed. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. -*/ - - -typedef voidp gzFile; - -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); -/* - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb") but can also include a compression level - ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for - Huffman only compression as in "wb1h", or 'R' for run-length encoding - as in "wb1R". (See the description of deflateInit2 for more information - about the strategy parameter.) - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. - - gzopen returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). */ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - gzdopen() associates a gzFile with the file descriptor fd. File - descriptors are obtained from calls like open, dup, creat, pipe or - fileno (in the file has been previously opened with fopen). - The mode parameter is as in gzopen. - The next call of gzclose on the returned gzFile will also close the - file descriptor fd, just like fclose(fdopen(fd), mode) closes the file - descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). - gzdopen returns NULL if there was insufficient memory to allocate - the (de)compression state. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Reads the given number of uncompressed bytes from the compressed file. - If the input file was not in gzip format, gzread copies the given number - of bytes into the buffer. - gzread returns the number of uncompressed bytes actually read (0 for - end of file, -1 for error). */ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, - voidpc buf, unsigned len)); -/* - Writes the given number of uncompressed bytes into the compressed file. - gzwrite returns the number of uncompressed bytes actually written - (0 in case of error). -*/ - -ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); -/* - Converts, formats, and writes the args to the compressed file under - control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written (0 in case of error). The number of - uncompressed bytes written is limited to 4095. The caller should assure that - this limit is not exceeded. If it is exceeded, then gzprintf() will return - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf() - because the secure snprintf() or vsnprintf() functions were not available. -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Writes the given null-terminated string to the compressed file, excluding - the terminating null character. - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Reads bytes from the compressed file until len-1 characters are read, or - a newline character is read and transferred to buf, or an end-of-file - condition is encountered. The string is then terminated with a null - character. - gzgets returns buf, or Z_NULL in case of error. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Writes c, converted to an unsigned char, into the compressed file. - gzputc returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Reads one byte from the compressed file. gzgetc returns this byte - or -1 in case of end of file or error. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push one character back onto the stream to be read again later. - Only one character of push-back is allowed. gzungetc() returns the - character pushed, or -1 on failure. gzungetc() will fail if a - character has been pushed but not read yet, or if c is -1. The pushed - character will be discarded if the stream is repositioned with gzseek() - or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flushes all pending output into the compressed file. The parameter - flush is as in the deflate() function. The return value is the zlib - error number (see function gzerror below). gzflush returns Z_OK if - the flush parameter is Z_FINISH and all output could be flushed. - gzflush should be called only when strictly necessary because it can - degrade compression. -*/ - -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); -/* - Sets the starting position for the next gzread or gzwrite on the - given compressed file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewinds the given file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) -*/ - -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); -/* - Returns the starting position for the next gzread or gzwrite on the - given compressed file. This position represents a number of bytes in the - uncompressed data stream. - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Returns 1 when EOF has previously been detected reading the given - input stream, otherwise zero. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Returns 1 if file is being read directly without decompression, otherwise - zero. -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flushes all pending output if necessary, closes the compressed file - and deallocates all the (de)compression state. The return value is the zlib - error number (see function gzerror below). -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Returns the error message for the last error which occurred on the - given compressed file. errnum is set to zlib error number. If an - error occurred in the file system and not in the compression library, - errnum is set to Z_ERRNO and the application may consult errno - to get the exact error code. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clears the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the - compression library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. If buf is NULL, this function returns - the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed - much faster. Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -#ifndef __ECOS__ -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); -/* - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. If buf is NULL, this function returns the required initial - value for the for the crc. Pre- and post-conditioning (one's complement) is - performed within this function so it shouldn't be done by the application. - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ -#endif // __ECOS__ - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_stream FAR *strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, sizeof(z_stream)) - -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - -/* - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - - -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; /* hack for buggy compilers */ -#endif - -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); -ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/components/dfs/filesystems/jffs2/cyg/crc/crc.h b/components/dfs/filesystems/jffs2/cyg/crc/crc.h deleted file mode 100644 index 7b7db10e9e..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/crc/crc.h +++ /dev/null @@ -1,105 +0,0 @@ -//========================================================================== -// -// crc.h -// -// Interface for the CRC algorithms. -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 2002, 2009 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): Andrew Lunn -// Contributors: Andrew Lunn -// Date: 2002-08-06 -// Purpose: -// Description: -// -// This code is part of eCos (tm). -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#ifndef _SERVICES_CRC_CRC_H_ -#define _SERVICES_CRC_CRC_H_ - -#include - -#ifndef __externC -# ifdef __cplusplus -# define __externC extern "C" -# else -# define __externC extern -# endif -#endif - -// Compute a CRC, using the POSIX 1003 definition - -__externC cyg_uint32 -cyg_posix_crc32(unsigned char *s, int len); - -// Gary S. Brown's 32 bit CRC - -__externC cyg_uint32 -cyg_crc32(unsigned char *s, int len); - -// Gary S. Brown's 32 bit CRC, but accumulate the result from a -// previous CRC calculation - -__externC cyg_uint32 -cyg_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); - -// Ethernet FCS Algorithm - -__externC cyg_uint32 -cyg_ether_crc32(unsigned char *s, int len); - -// Ethernet FCS algorithm, but accumulate the result from a previous -// CRC calculation. - -__externC cyg_uint32 -cyg_ether_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len); - -// 16 bit CRC with polynomial x^16+x^12+x^5+1 - -__externC cyg_uint16 -cyg_crc16(unsigned char *s, int len); - -__externC cyg_uint16 -cyg_crc16_accumulate(cyg_uint16 crc, unsigned char *s, int len); - -#endif // _SERVICES_CRC_CRC_H_ - - - diff --git a/components/dfs/filesystems/jffs2/cyg/crc/crc16.c b/components/dfs/filesystems/jffs2/cyg/crc/crc16.c deleted file mode 100644 index 7d6fa38105..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/crc/crc16.c +++ /dev/null @@ -1,104 +0,0 @@ -//========================================================================== -// -// crc16.c -// -// 16 bit CRC with polynomial x^16+x^12+x^5+1 -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): gthomas -// Contributors: gthomas,asl -// Date: 2001-01-31 -// Purpose: -// Description: -// -// This code is part of eCos (tm). -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#include - -// Table of CRC constants - implements x^16+x^12+x^5+1 -static const cyg_uint16 crc16_tab[] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, - 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, - 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, - 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, - 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, - 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, - 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, - 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, - 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, - 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, - 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, - 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, - 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, - 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, - 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, - 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, - 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, - 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, - 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, - 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, - 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, - 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, -}; - -cyg_uint16 -cyg_crc16(unsigned char *buf, int len) -{ - int i; - cyg_uint16 cksum; - - cksum = 0; - for (i = 0; i < len; i++) { - cksum = crc16_tab[((cksum>>8) ^ *buf++) & 0xFF] ^ (cksum << 8); - } - return cksum; -} - diff --git a/components/dfs/filesystems/jffs2/cyg/crc/crc32.c b/components/dfs/filesystems/jffs2/cyg/crc/crc32.c deleted file mode 100644 index 7e4ea269f2..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/crc/crc32.c +++ /dev/null @@ -1,166 +0,0 @@ -//========================================================================== -// -// crc32.c -// -// Gary S. Brown's 32 bit CRC -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): gthomas -// Contributors: gthomas,asl -// Date: 2001-01-31 -// Purpose: -// Description: -// -// This code is part of eCos (tm). -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#include - - /* ====================================================================== */ - /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */ - /* code or tables extracted from it, as desired without restriction. */ - /* */ - /* First, the polynomial itself and its table of feedback terms. The */ - /* polynomial is */ - /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */ - /* */ - /* ====================================================================== */ - -static const cyg_uint32 crc32_tab[] = { - 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, - 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, - 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, - 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, - 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, - 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, - 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, - 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, - 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, - 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, - 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, - 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, - 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, - 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, - 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, - 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, - 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, - 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, - 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, - 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, - 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, - 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, - 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, - 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, - 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, - 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, - 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, - 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, - 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, - 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, - 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, - 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, - 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, - 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, - 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, - 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, - 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, - 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, - 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, - 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, - 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, - 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, - 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, - 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, - 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, - 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, - 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, - 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, - 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, - 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, - 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, - 0x2d02ef8dL - }; - -/* This is the standard Gary S. Brown's 32 bit CRC algorithm, but - accumulate the CRC into the result of a previous CRC. */ -cyg_uint32 -cyg_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len) -{ - int i; - - for (i = 0; i < len; i++) { - crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8); - } - return crc32val; -} - -/* This is the standard Gary S. Brown's 32 bit CRC algorithm */ -cyg_uint32 -cyg_crc32(unsigned char *s, int len) -{ - return (cyg_crc32_accumulate(0,s,len)); -} - -/* Return a 32-bit CRC of the contents of the buffer accumulating the - result from a previous CRC calculation. This uses the Ethernet FCS - algorithm.*/ -cyg_uint32 -cyg_ether_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len) -{ - int i; - - if (s == 0) return 0L; - - crc32val = crc32val ^ 0xffffffff; - for (i = 0; i < len; i++) { - crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8); - } - return crc32val ^ 0xffffffff; -} - -/* Return a 32-bit CRC of the contents of the buffer, using the - Ethernet FCS algorithm. */ -cyg_uint32 -cyg_ether_crc32(unsigned char *s, int len) -{ - return cyg_ether_crc32_accumulate(0,s,len); -} - - diff --git a/components/dfs/filesystems/jffs2/cyg/crc/posix_crc.c b/components/dfs/filesystems/jffs2/cyg/crc/posix_crc.c deleted file mode 100644 index 0da50e9a40..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/crc/posix_crc.c +++ /dev/null @@ -1,116 +0,0 @@ -//========================================================================== -// -// posix_crc.c -// -// POSIX CRC calculation -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): gthomas -// Contributors: gthomas,asl -// Date: 2001-01-31 -// Purpose: -// Description: -// -// This code is part of eCos (tm). -// -//####DESCRIPTIONEND#### -// -//========================================================================== - -#include - -// Compute a CRC, using the POSIX 1003 definition - -// Same basic algorithm as CRC-16, but the bits are defined in the -// opposite order. This computation matches the output of the -// Linux 'cksum' program. - -static const cyg_uint32 posix_crc32_tab[] = { - 0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005, - 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD, - 0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75, - 0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD, - 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039, 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5, - 0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D, - 0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95, - 0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D, - 0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072, - 0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA, - 0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02, - 0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA, - 0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692, - 0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A, - 0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2, - 0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A, - 0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB, - 0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53, - 0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B, - 0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF, 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623, - 0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B, - 0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3, - 0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B, - 0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3, - 0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C, - 0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24, - 0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC, - 0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654, - 0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C, - 0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4, - 0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C, - 0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4 - }; - -cyg_uint32 -cyg_posix_crc32(unsigned char *s, int len) -{ - int i; - cyg_uint32 crc32val; - unsigned long length; - - crc32val = 0; - for (i = 0; i < len; i++) { - crc32val = (crc32val << 8) ^ posix_crc32_tab[((crc32val >> 24) ^ *s++) & 0xFF]; - } - length = len; - while (length > 0) { - crc32val = (crc32val << 8) ^ posix_crc32_tab[((crc32val >> 24) ^ length) & 0xFF]; - length >>= 8; - } - crc32val = ~crc32val; - return crc32val; -} - diff --git a/components/dfs/filesystems/jffs2/cyg/fileio/fileio.h b/components/dfs/filesystems/jffs2/cyg/fileio/fileio.h deleted file mode 100644 index d364ae3b45..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/fileio/fileio.h +++ /dev/null @@ -1,489 +0,0 @@ -#ifndef CYGONCE_FILEIO_H -#define CYGONCE_FILEIO_H -//============================================================================= -// -// fileio.h -// -// Fileio header -// -//============================================================================= -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//============================================================================= -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg -// Contributors: nickg -// Date: 2000-05-25 -// Purpose: Fileio header -// Description: This header contains the external definitions of the general file -// IO subsystem for POSIX and EL/IX compatability. -// -// Usage: -// #include -// ... -// -// -//####DESCRIPTIONEND#### -// -//============================================================================= - -//#include -//#include - -//#include -//#include -#ifdef CYGFUN_IO_FILEIO_SELECT -#include -#endif - -#include // NULL, size_t -#include -#if defined(__GNUC__) && !defined(__CC_ARM) -#include -#include -#else -#include -#include -#endif -//#include "os_sys_stat.h"//#include - -//============================================================================= -// forward definitions - -struct cyg_mtab_entry; -typedef struct cyg_mtab_entry cyg_mtab_entry; - -struct cyg_fstab_entry; -typedef struct cyg_fstab_entry cyg_fstab_entry; - -struct CYG_FILEOPS_TAG; -typedef struct CYG_FILEOPS_TAG cyg_fileops; - -struct CYG_FILE_TAG; -typedef struct CYG_FILE_TAG cyg_file; - -struct CYG_IOVEC_TAG; -typedef struct CYG_IOVEC_TAG cyg_iovec; - -struct CYG_UIO_TAG; -typedef struct CYG_UIO_TAG cyg_uio; - -struct CYG_SELINFO_TAG; -typedef struct CYG_SELINFO_TAG cyg_selinfo; - -//============================================================================= -// Directory pointer - -typedef CYG_ADDRWORD cyg_dir; - -#define CYG_DIR_NULL 0 - -//============================================================================= -// Filesystem table entry - -typedef int cyg_fsop_mount ( cyg_fstab_entry *fste, cyg_mtab_entry *mte ); -typedef int cyg_fsop_umount ( cyg_mtab_entry *mte ); -typedef int cyg_fsop_open ( cyg_mtab_entry *mte, cyg_dir dir, const char *name, - int mode, cyg_file *fte ); -typedef int cyg_fsop_unlink ( cyg_mtab_entry *mte, cyg_dir dir, const char *name ); -typedef int cyg_fsop_mkdir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name ); -typedef int cyg_fsop_rmdir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name ); -typedef int cyg_fsop_rename ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1, - cyg_dir dir2, const char *name2 ); -typedef int cyg_fsop_link ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1, - cyg_dir dir2, const char *name2, int type ); -typedef int cyg_fsop_opendir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name, - cyg_file *fte ); -typedef int cyg_fsop_chdir ( cyg_mtab_entry *mte, cyg_dir dir, const char *name, - cyg_dir *dir_out ); -typedef int cyg_fsop_stat ( cyg_mtab_entry *mte, cyg_dir dir, const char *name, - struct stat *buf); -typedef int cyg_fsop_getinfo ( cyg_mtab_entry *mte, cyg_dir dir, const char *name, - int key, void *buf, int len ); -typedef int cyg_fsop_setinfo ( cyg_mtab_entry *mte, cyg_dir dir, const char *name, - int key, void *buf, int len ); - - -struct cyg_fstab_entry -{ - const char *name; // filesystem name - CYG_ADDRWORD data; // private data value -//#ifdef CYGOPT_FS_JFFS2_GCTHREAD -// struct rt_mutex syncmode; // synchronization mode -//#endif - cyg_uint32 syncmode; // synchronization mode - cyg_fsop_mount *mount; - cyg_fsop_umount *umount; - cyg_fsop_open *open; - cyg_fsop_unlink *unlink; - cyg_fsop_mkdir *mkdir; - cyg_fsop_rmdir *rmdir; - cyg_fsop_rename *rename; - cyg_fsop_link *link; - cyg_fsop_opendir *opendir; - cyg_fsop_chdir *chdir; - cyg_fsop_stat *stat; - cyg_fsop_getinfo *getinfo; - cyg_fsop_setinfo *setinfo; -} ;// CYG_HAL_TABLE_TYPE; //prife - -//----------------------------------------------------------------------------- -// Keys for getinfo() and setinfo() - -#define FS_INFO_CONF 1 /* pathconf() */ -#define FS_INFO_ACCESS 2 /* access() */ -#define FS_INFO_GETCWD 3 /* getcwd() */ -#define FS_INFO_SYNC 4 /* cyg_fs_fssync() */ -#define FS_INFO_ATTRIB 5 /* cyg_fs_(get|set)_attrib() */ -#ifdef CYGSEM_FILEIO_INFO_DISK_USAGE -#define FS_INFO_DISK_USAGE 6 /* get_disk_usage() */ -#endif -#define FS_INFO_CHMOD 7 /* chmod() */ - -//----------------------------------------------------------------------------- -// Types for link() - -#define CYG_FSLINK_HARD 1 /* form a hard link */ -#define CYG_FSLINK_SOFT 2 /* form a soft link */ - -//----------------------------------------------------------------------------- -// getinfo() and setinfo() buffers structures. - -struct cyg_getcwd_info -{ - char *buf; /* buffer for cwd string */ - size_t size; /* size of buffer */ -}; - -struct cyg_fs_disk_usage{ - cyg_uint64 total_blocks; - cyg_uint64 free_blocks; - cyg_uint32 block_size; -}; - -typedef cyg_uint32 cyg_fs_attrib_t; - -//----------------------------------------------------------------------------- -// Macro to define an initialized fstab entry - -#define FSTAB_ENTRY( _l, _name, _data, _syncmode, _mount, _umount, \ - _open, _unlink, _mkdir, _rmdir, _rename, _link, \ - _opendir, _chdir, _stat, _getinfo, _setinfo) \ -struct cyg_fstab_entry _l /*CYG_HAL_TABLE_ENTRY(fstab) prife*/ = \ -{ \ - _name, \ - _data, \ - _syncmode, \ - _mount, \ - _umount, \ - _open, \ - _unlink, \ - _mkdir, \ - _rmdir, \ - _rename, \ - _link, \ - _opendir, \ - _chdir, \ - _stat, \ - _getinfo, \ - _setinfo \ -}; - -//============================================================================= -// Mount table entry - -struct cyg_mtab_entry -{ - const char *name; // name of mount point - const char *fsname; // name of implementing filesystem - const char *devname; // name of hardware device - CYG_ADDRWORD data; // private data value - - // The following are filled in after a successful mount operation - cyg_bool valid; // Valid entry? - cyg_fstab_entry *fs; // pointer to fstab entry - cyg_dir root; // root directory pointer -} ; // CYG_HAL_TABLE_TYPE; // prife - - -// This macro defines an initialized mtab entry - -#define MTAB_ENTRY( _l, _name, _fsname, _devname, _data ) \ -struct cyg_mtab_entry _l /*CYG_HAL_TABLE_ENTRY(mtab) prife */ = \ -{ \ - _name, \ - _fsname, \ - _devname, \ - _data, \ - false, \ - NULL, \ - CYG_DIR_NULL \ -}; - -//============================================================================= -// IO vector descriptors - -struct CYG_IOVEC_TAG -{ - void *iov_base; /* Base address. */ - ssize_t iov_len; /* Length. */ -}; - -enum cyg_uio_rw { UIO_READ, UIO_WRITE }; - -/* Segment flag values. */ -enum cyg_uio_seg -{ - UIO_USERSPACE, /* from user data space */ - UIO_SYSSPACE /* from system space */ -}; - -struct CYG_UIO_TAG -{ - struct CYG_IOVEC_TAG *uio_iov; /* pointer to array of iovecs */ - int uio_iovcnt; /* number of iovecs in array */ - off_t uio_offset; /* offset into file this uio corresponds to */ - ssize_t uio_resid; /* residual i/o count */ - enum cyg_uio_seg uio_segflg; /* see above */ - enum cyg_uio_rw uio_rw; /* see above */ -}; - -// Limits -#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */ - -//============================================================================= -// Description of open file - -typedef int cyg_fileop_readwrite (struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio); -typedef cyg_fileop_readwrite cyg_fileop_read; -typedef cyg_fileop_readwrite cyg_fileop_write; -typedef int cyg_fileop_lseek (struct CYG_FILE_TAG *fp, off_t *pos, int whence ); -typedef int cyg_fileop_ioctl (struct CYG_FILE_TAG *fp, CYG_ADDRWORD com, - CYG_ADDRWORD data); -typedef cyg_bool cyg_fileop_select (struct CYG_FILE_TAG *fp, int which, CYG_ADDRWORD info); -typedef int cyg_fileop_fsync (struct CYG_FILE_TAG *fp, int mode ); -typedef int cyg_fileop_close (struct CYG_FILE_TAG *fp); -typedef int cyg_fileop_fstat (struct CYG_FILE_TAG *fp, struct stat *buf ); -typedef int cyg_fileop_getinfo (struct CYG_FILE_TAG *fp, int key, void *buf, int len ); -typedef int cyg_fileop_setinfo (struct CYG_FILE_TAG *fp, int key, void *buf, int len ); - -struct CYG_FILEOPS_TAG -{ - cyg_fileop_read *fo_read; - cyg_fileop_write *fo_write; - cyg_fileop_lseek *fo_lseek; - cyg_fileop_ioctl *fo_ioctl; - cyg_fileop_select *fo_select; - cyg_fileop_fsync *fo_fsync; - cyg_fileop_close *fo_close; - cyg_fileop_fstat *fo_fstat; - cyg_fileop_getinfo *fo_getinfo; - cyg_fileop_setinfo *fo_setinfo; -}; - -struct CYG_FILE_TAG -{ - cyg_uint32 f_flag; /* file state */ - cyg_uint16 f_ucount; /* use count */ - cyg_uint16 f_type; /* descriptor type */ - cyg_uint32 f_syncmode; /* synchronization protocol */ - struct CYG_FILEOPS_TAG *f_ops; /* file operations */ - off_t f_offset; /* current offset */ - CYG_ADDRWORD f_data; /* file or socket */ - CYG_ADDRWORD f_xops; /* extra type specific ops */ - cyg_mtab_entry *f_mte; /* mount table entry */ -}; - -//----------------------------------------------------------------------------- -// File flags - -// Allocation here is that bits 0..15 are copies of bits from the open -// flags, bits 16..23 are extra bits that are visible to filesystems but -// are not derived from the open call, and bits 24..31 are reserved for -// the fileio infrastructure. -#define CYG_FREAD O_RDONLY -#define CYG_FWRITE O_WRONLY -#define CYG_FNONBLOCK O_NONBLOCK -#define CYG_FAPPEND O_APPEND -#define CYG_FASYNC 0x00010000 -#define CYG_FDIR 0x00020000 - -#define CYG_FLOCKED 0x01000000 // Set if file is locked -#define CYG_FLOCK 0x02000000 // Lock during file ops -#define CYG_FALLOC 0x80000000 // File is "busy", i.e. allocated - -// Mask for open mode bits stored in file object -#define CYG_FILE_MODE_MASK (CYG_FREAD|CYG_FWRITE|CYG_FNONBLOCK|CYG_FAPPEND) - -//----------------------------------------------------------------------------- -// Type of file - -#define CYG_FILE_TYPE_FILE 1 /* file */ -#define CYG_FILE_TYPE_SOCKET 2 /* communications endpoint */ -#define CYG_FILE_TYPE_DEVICE 3 /* device */ - -//----------------------------------------------------------------------------- -// Keys for getinfo() and setinfo() - -#define FILE_INFO_CONF 1 /* fpathconf() */ - -//----------------------------------------------------------------------------- -// Modes for fsync() - -#define CYG_FSYNC 1 -#define CYG_FDATASYNC 2 - -//----------------------------------------------------------------------------- -// Get/set info buffer structures - -// This is used for pathconf() and fpathconf() -struct cyg_pathconf_info -{ - int name; // POSIX defined variable name - long value; // Returned variable value -}; - -//============================================================================= -// Synchronization modes -// These values are filled into the syncmode fields of the above structures -// and define the synchronization protocol used when accessing the object in -// question. - -#define CYG_SYNCMODE_NONE (0) // no locking required - -#define CYG_SYNCMODE_FILE_FILESYSTEM 0x0002 // lock fs during file ops -#define CYG_SYNCMODE_FILE_MOUNTPOINT 0x0004 // lock mte during file ops -#define CYG_SYNCMODE_IO_FILE 0x0010 // lock file during io ops -#define CYG_SYNCMODE_IO_FILESYSTEM 0x0020 // lock fs during io ops -#define CYG_SYNCMODE_IO_MOUNTPOINT 0x0040 // lock mte during io ops -#define CYG_SYNCMODE_SOCK_FILE 0x0100 // lock socket during socket ops -#define CYG_SYNCMODE_SOCK_NETSTACK 0x0800 // lock netstack during socket ops - -#define CYG_SYNCMODE_IO_SHIFT (4) // shift for IO to file bits -#define CYG_SYNCMODE_SOCK_SHIFT (8) // shift for sock to file bits - -//============================================================================= -// Mount and umount functions - -__externC int mount( const char *devname, - const char *dir, - const char *fsname); - -__externC int umount( const char *name); - -//============================================================================= -// Get/Set info functions - -__externC int cyg_fs_getinfo( const char *path, int key, void *buf, int len ); -__externC int cyg_fs_setinfo( const char *path, int key, void *buf, int len ); -__externC int cyg_fs_fgetinfo( int fd, int key, void *buf, int len ); -__externC int cyg_fs_fsetinfo( int fd, int key, void *buf, int len ); - -#ifdef CYGFUN_IO_FILEIO_SELECT -//============================================================================= -// Select support - -//----------------------------------------------------------------------------- -// Data structure for embedding in client data structures. A pointer to this -// must be passed to cyg_selrecord() and cyg_selwakeup(). - -struct CYG_SELINFO_TAG -{ - CYG_ADDRWORD si_info; // info passed through from fo_select() - cyg_flag_value_t si_waitFlag; // select wait flags -}; - -//----------------------------------------------------------------------------- -// Select support functions. - -// cyg_selinit() is used to initialize a selinfo structure. -__externC void cyg_selinit( struct CYG_SELINFO_TAG *sip ); - -// cyg_selrecord() is called when a client device needs to register -// the current thread for selection. -__externC void cyg_selrecord( CYG_ADDRWORD info, struct CYG_SELINFO_TAG *sip ); - -// cyg_selwakeup() is called when the client device matches the select -// criterion, and needs to wake up a selector. -__externC void cyg_selwakeup( struct CYG_SELINFO_TAG *sip ); -#endif -//============================================================================= -// Timestamp support - -// Provides the current time as a time_t timestamp for use in filesystem -// data strucures. - -__externC time_t jffs2_get_timestamp(void); - -//============================================================================= -// Miscellaneous functions. - -// Provide a function to synchronize an individual file system. (ie write -// file and directory information to disk) -__externC int cyg_fs_fssync(const char *path); - -// Functions to set and get attributes of a file, eg FAT attributes -// like hidden and system. -__externC int cyg_fs_set_attrib( const char *fname, - const cyg_fs_attrib_t new_attrib ); -__externC int cyg_fs_get_attrib( const char *fname, - cyg_fs_attrib_t * const file_attrib ); - -// Functions to lock and unlock a filesystem. These are normally used -// internally by the fileio layer, but the file system might need to -// use them when it needs to lock itself, eg when performing garbage -// collect. -__externC void cyg_fs_lock( cyg_mtab_entry *mte, cyg_uint32 syncmode ); - -__externC void cyg_fs_unlock( cyg_mtab_entry *mte, cyg_uint32 syncmode ); - -// To be able to lock the filesystem you need the mte. This function -// allows the table of mounted filesystems to be searched to find an -// mte which uses the give filesystem root. - -__externC cyg_mtab_entry * cyg_fs_root_lookup( cyg_dir *root ); - -//============================================================================= -// Default functions. -// Cast to the appropriate type, these functions can be put into any of -// the operation table slots to provide the defined error code. - -__externC int cyg_fileio_enosys(void); -__externC int cyg_fileio_erofs(void); -__externC int cyg_fileio_enoerr(void); -__externC int cyg_fileio_enotdir(void); -__externC cyg_fileop_select cyg_fileio_seltrue; - -//----------------------------------------------------------------------------- -#endif // ifndef CYGONCE_FILEIO_H -// End of fileio.h diff --git a/components/dfs/filesystems/jffs2/cyg/hal/basetype.h b/components/dfs/filesystems/jffs2/cyg/hal/basetype.h deleted file mode 100644 index 6f3455c0df..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/hal/basetype.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef CYGONCE_HAL_BASETYPE_H -#define CYGONCE_HAL_BASETYPE_H - -//============================================================================= -// -// basetype.h -// -// Standard types for this architecture. -// -//============================================================================= -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//============================================================================= -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg, gthomas -// Contributors: nickg, gthomas -// Date: 1998-09-11 -// Purpose: Define architecture base types. -// Usage: Included by "cyg_type.h", do not use directly - -// -//####DESCRIPTIONEND#### -// - -//----------------------------------------------------------------------------- -// Characterize the architecture - -#ifdef __ARMEB__ -# define CYG_BYTEORDER CYG_MSBFIRST // Big endian -#else -# define CYG_BYTEORDER CYG_LSBFIRST // Little endian -#endif - -#if defined(__ARMEL__) && defined(__VFP_FP__) -# define CYG_DOUBLE_BYTEORDER CYG_LSBFIRST -#else -# define CYG_DOUBLE_BYTEORDER CYG_MSBFIRST // Big? endian -#endif - -//----------------------------------------------------------------------------- -// ARM does not usually use labels with underscores. - -#define CYG_LABEL_NAME(_name_) _name_ -#define CYG_LABEL_DEFN(_name_) _name_ - -//----------------------------------------------------------------------------- -// Override the alignment definitions from cyg_type.h. ARM only allows 4 -// byte alignment whereas the default is 8 byte. - -#define CYGARC_ALIGNMENT 4 -#define CYGARC_P2ALIGNMENT 2 - -//----------------------------------------------------------------------------- -// Define the standard variable sizes - -// The ARM architecture uses the default definitions of the base types, -// so we do not need to define any here. - -//----------------------------------------------------------------------------- -#endif // CYGONCE_HAL_BASETYPE_H -// End of basetype.h diff --git a/components/dfs/filesystems/jffs2/cyg/hal/drv_api.h b/components/dfs/filesystems/jffs2/cyg/hal/drv_api.h deleted file mode 100644 index de4346673c..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/hal/drv_api.h +++ /dev/null @@ -1,250 +0,0 @@ -#ifndef CYGONCE_HAL_DRV_API_H -#define CYGONCE_HAL_DRV_API_H - -/*========================================================================== -// -// drv_api.h -// -// Native API for Kernel -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg -// Date: 1999-02-24 -// Purpose: Driver API -// Description: This file defines the API used by device drivers to access -// system services. When the kernel is present it maps directly -// to the Kernel C API. When the kernel is absent, it is provided -// by a set of HAL functions. -// -// Usage: #include -// -//####DESCRIPTIONEND#### -// -//========================================================================*/ - -//#include //mod by prife -#include - -#ifdef CYGPKG_KERNEL - -/*------------------------------------------------------------------------*/ -/* Kernel co-resident version of API */ - -#include - -#ifndef CYGFUN_KERNEL_API_C -#error Driver API requres Kernel API to be present -#endif - -#include - -#define cyg_drv_isr_lock cyg_interrupt_disable -#define cyg_drv_isr_unlock cyg_interrupt_enable - -#define cyg_drv_dsr_lock cyg_scheduler_lock -#define cyg_drv_dsr_unlock cyg_scheduler_unlock - -#define cyg_drv_mutex_t cyg_mutex_t -#define cyg_drv_mutex_init cyg_mutex_init -#define cyg_drv_mutex_destroy cyg_mutex_destroy -#define cyg_drv_mutex_lock cyg_mutex_lock -#define cyg_drv_mutex_trylock cyg_mutex_trylock -#define cyg_drv_mutex_unlock cyg_mutex_unlock -#define cyg_drv_mutex_release cyg_mutex_release - -#define cyg_drv_cond_t cyg_cond_t -#define cyg_drv_cond_init cyg_cond_init -#define cyg_drv_cond_destroy cyg_cond_destroy -#define cyg_drv_cond_wait cyg_cond_wait -#define cyg_drv_cond_signal cyg_cond_signal -#define cyg_drv_cond_broadcast cyg_cond_broadcast - -#define cyg_drv_interrupt_create cyg_interrupt_create -#define cyg_drv_interrupt_delete cyg_interrupt_delete -#define cyg_drv_interrupt_attach cyg_interrupt_attach -#define cyg_drv_interrupt_detach cyg_interrupt_detach -#define cyg_drv_interrupt_mask cyg_interrupt_mask -#define cyg_drv_interrupt_unmask cyg_interrupt_unmask -#define cyg_drv_interrupt_mask_intunsafe cyg_interrupt_mask_intunsafe -#define cyg_drv_interrupt_unmask_intunsafe cyg_interrupt_unmask_intunsafe -#define cyg_drv_interrupt_acknowledge cyg_interrupt_acknowledge -#define cyg_drv_interrupt_configure cyg_interrupt_configure -#define cyg_drv_interrupt_level cyg_interrupt_level -#define cyg_drv_interrupt_set_cpu cyg_interrupt_set_cpu -#define cyg_drv_interrupt_get_cpu cyg_interrupt_get_cpu - -#define cyg_drv_spinlock_t cyg_spinlock_t -#define cyg_drv_spinlock_init cyg_spinlock_init -#define cyg_drv_spinlock_spin cyg_spinlock_spin -#define cyg_drv_spinlock_clear cyg_spinlock_clear -#define cyg_drv_spinlock_try cyg_spinlock_try -#define cyg_drv_spinlock_test cyg_spinlock_test -#define cyg_drv_spinlock_spin_intsave cyg_spinlock_spin_intsave -#define cyg_drv_spinlock_clear_intsave cyg_spinlock_clear_intsave - -#else /* CYGPKG_KERNEL */ - -/*------------------------------------------------------------------------*/ -/* Non-kernel version of API */ - -typedef CYG_ADDRWORD cyg_addrword_t; /* May hold pointer or word */ -typedef cyg_addrword_t cyg_handle_t; /* Object handle */ -typedef cyg_uint32 cyg_priority_t; /* type for priorities */ -typedef cyg_uint32 cyg_vector_t; /* Interrupt vector id */ -typedef cyg_uint32 cyg_cpu_t; /* CPU id */ -typedef int cyg_bool_t; -typedef cyg_int32 cyg_code_t; /* type for various codes */ - -typedef cyg_uint32 cyg_ISR_t( cyg_vector_t vector, cyg_addrword_t data); -typedef void cyg_DSR_t(cyg_vector_t vector, - cyg_ucount32 count, - cyg_addrword_t data); - - -externC void cyg_drv_isr_lock(void); -externC void cyg_drv_isr_unlock(void); - -externC void cyg_drv_dsr_lock(void); -externC void cyg_drv_dsr_unlock(void); - -typedef struct -{ - cyg_atomic lock; -} cyg_drv_mutex_t; - -externC void cyg_drv_mutex_init( cyg_drv_mutex_t *mutex ); -externC void cyg_drv_mutex_destroy( cyg_drv_mutex_t *mutex ); -externC cyg_bool_t cyg_drv_mutex_lock( cyg_drv_mutex_t *mutex ); -externC cyg_bool_t cyg_drv_mutex_trylock( cyg_drv_mutex_t *mutex ); -externC void cyg_drv_mutex_unlock( cyg_drv_mutex_t *mutex ); -externC void cyg_drv_mutex_release( cyg_drv_mutex_t *mutex ); - -typedef struct -{ - cyg_atomic wait; - cyg_drv_mutex_t *mutex; -} cyg_drv_cond_t; - -externC void cyg_drv_cond_init( cyg_drv_cond_t *cond, cyg_drv_mutex_t *mutex ); -externC void cyg_drv_cond_destroy( cyg_drv_cond_t *cond ); -externC cyg_bool_t cyg_drv_cond_wait( cyg_drv_cond_t *cond ); -externC void cyg_drv_cond_signal( cyg_drv_cond_t *cond ); -externC void cyg_drv_cond_broadcast( cyg_drv_cond_t *cond ); - -typedef struct cyg_interrupt -{ - cyg_vector_t vector; - cyg_priority_t priority; - cyg_ISR_t *isr; - cyg_DSR_t *dsr; - CYG_ADDRWORD data; - - struct cyg_interrupt* volatile next_dsr; - volatile cyg_int32 dsr_count; - -#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN - struct cyg_interrupt *next; -#endif - -} cyg_interrupt; - -externC void cyg_drv_interrupt_create( - cyg_vector_t vector, - cyg_priority_t priority, - cyg_addrword_t data, - cyg_ISR_t *isr, - cyg_DSR_t *dsr, - cyg_handle_t *handle, - cyg_interrupt *intr - ); -externC void cyg_drv_interrupt_delete( cyg_handle_t interrupt ); -externC void cyg_drv_interrupt_attach( cyg_handle_t interrupt ); -externC void cyg_drv_interrupt_detach( cyg_handle_t interrupt ); - -externC void cyg_drv_interrupt_mask( cyg_vector_t vector ); -externC void cyg_drv_interrupt_mask_intunsafe( cyg_vector_t vector ); -externC void cyg_drv_interrupt_unmask( cyg_vector_t vector ); -externC void cyg_drv_interrupt_unmask_intunsafe( cyg_vector_t vector ); -externC void cyg_drv_interrupt_acknowledge( cyg_vector_t vector ); -externC void cyg_drv_interrupt_configure( - cyg_vector_t vector, - cyg_bool_t level, - cyg_bool_t up - ); -externC void cyg_drv_interrupt_level( cyg_vector_t vector, cyg_priority_t level ); -externC void cyg_drv_interrupt_set_cpu( cyg_vector_t vector, cyg_cpu_t cpu ); -externC cyg_cpu_t cyg_drv_interrupt_get_cpu( cyg_vector_t vector ); - - -enum cyg_ISR_results -{ - CYG_ISR_HANDLED = 1, /* Interrupt was handled */ - CYG_ISR_CALL_DSR = 2 /* Schedule DSR */ -}; - - -typedef struct -{ - cyg_atomic lock; -} cyg_drv_spinlock_t; - -void cyg_drv_spinlock_init( - cyg_drv_spinlock_t *lock, /* spinlock to initialize */ - cyg_bool_t locked /* init locked or unlocked */ -); - -void cyg_drv_spinlock_destroy( cyg_drv_spinlock_t *lock ); - -void cyg_drv_spinlock_spin( cyg_drv_spinlock_t *lock ); - -void cyg_drv_spinlock_clear( cyg_drv_spinlock_t *lock ); - -cyg_bool_t cyg_drv_spinlock_try( cyg_drv_spinlock_t *lock ); - -cyg_bool_t cyg_drv_spinlock_test( cyg_drv_spinlock_t *lock ); - -void cyg_drv_spinlock_spin_intsave( cyg_drv_spinlock_t *lock, - cyg_addrword_t *istate ); - -void cyg_drv_spinlock_clear_intsave( cyg_drv_spinlock_t *lock, - cyg_addrword_t istate ); - -#endif /* CYGPKG_KERNEL */ - -/*------------------------------------------------------------------------*/ -/* EOF drv_api.h */ -#endif // CYGONCE_HAL_DRV_API_H diff --git a/components/dfs/filesystems/jffs2/cyg/infra/cyg_type.h b/components/dfs/filesystems/jffs2/cyg/infra/cyg_type.h deleted file mode 100644 index 01b60c5099..0000000000 --- a/components/dfs/filesystems/jffs2/cyg/infra/cyg_type.h +++ /dev/null @@ -1,544 +0,0 @@ -#ifndef CYGONCE_INFRA_CYG_TYPE_H -#define CYGONCE_INFRA_CYG_TYPE_H - -//========================================================================== -// -// cyg_type.h -// -// Standard types, and some useful coding macros. -// -//========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): nickg from an original by hmt -// Contributors: nickg -// Date: 1997-09-08 -// Purpose: share unambiguously sized types. -// Description: we typedef [cyg_][u]int8,16,32 &c for general use. -// Usage: #include "cyg/infra/cyg_type.h" -// ... -// cyg_int32 my_32bit_integer; -// -//####DESCRIPTIONEND#### -// - -#include // Definition of NULL from the compiler - -// ------------------------------------------------------------------------- -// Some useful macros. These are defined here by default. - -// __externC is used in mixed C/C++ headers to force C linkage on an external -// definition. It avoids having to put all sorts of ifdefs in. - -#ifdef __cplusplus -# define __externC extern "C" -#else -# define __externC extern -#endif -// Also define externC for now - but it is deprecated -#define externC __externC - -// Compiler version. -#ifdef __GNUC__ -# if defined(__GNU_PATCHLEVEL__) -# define __GNUC_VERSION__ (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) -# else -# define __GNUC_VERSION__ (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100) -# endif -#endif - -// ------------------------------------------------------------------------- -// The header defines the base types used here. It is -// supplied either by the target architecture HAL, or by the host -// porting kit. They are all defined as macros, and only those that -// make choices other than the defaults given below need be defined. - -#define CYG_LSBFIRST 1234 -#define CYG_MSBFIRST 4321 - -#include - -#if (CYG_BYTEORDER != CYG_LSBFIRST) && (CYG_BYTEORDER != CYG_MSBFIRST) -# error You must define CYG_BYTEORDER to equal CYG_LSBFIRST or CYG_MSBFIRST -#endif - -#ifndef CYG_DOUBLE_BYTEORDER -#define CYG_DOUBLE_BYTEORDER CYG_BYTEORDER -#endif - -#ifndef cyg_halint8 -# define cyg_halint8 char -#endif -#ifndef cyg_halint16 -# define cyg_halint16 short -#endif -#ifndef cyg_halint32 -# define cyg_halint32 int -#endif -#ifndef cyg_halint64 -# define cyg_halint64 long long -#endif - -#ifndef cyg_halcount8 -# define cyg_halcount8 int -#endif -#ifndef cyg_halcount16 -# define cyg_halcount16 int -#endif -#ifndef cyg_halcount32 -# define cyg_halcount32 int -#endif -#ifndef cyg_halcount64 -# define cyg_halcount64 long long -#endif - -#ifndef cyg_haladdress -# define cyg_haladdress cyg_uint32 -#endif -#ifndef cyg_haladdrword -# define cyg_haladdrword cyg_uint32 -#endif - -#ifndef cyg_halbool -# define cyg_halbool int -#endif - -#ifndef cyg_halatomic -# define cyg_halatomic cyg_halint8 -#endif - -// ------------------------------------------------------------------------- -// Provide a default architecture alignment -// This may be overridden in basetype.h if necessary. -// These should be straightforward numbers to allow use in assembly. - -#ifndef CYGARC_ALIGNMENT -# define CYGARC_ALIGNMENT 8 -#endif -// And corresponding power of two alignment -#ifndef CYGARC_P2ALIGNMENT -# define CYGARC_P2ALIGNMENT 3 -#endif -#if (CYGARC_ALIGNMENT) != (1 << CYGARC_P2ALIGNMENT) -# error "Inconsistent CYGARC_ALIGNMENT and CYGARC_P2ALIGNMENT values" -#endif - -// ------------------------------------------------------------------------- -// The obvious few that compilers may define for you. -// But in case they don't: - -#ifndef NULL -# define NULL 0 -#endif - -#ifndef __cplusplus - -typedef cyg_halbool bool; - -# ifndef false -# define false 0 -# endif - -# ifndef true -# define true (!false) -# endif - -#endif - -// ------------------------------------------------------------------------- -// Allow creation of procedure-like macros that are a single statement, -// and must be followed by a semi-colon - -#define CYG_MACRO_START do { -#define CYG_MACRO_END } while (0) - -#define CYG_EMPTY_STATEMENT CYG_MACRO_START CYG_MACRO_END - -#define CYG_UNUSED_PARAM( _type_, _name_ ) CYG_MACRO_START \ - _type_ __tmp1 = (_name_); \ - _type_ __tmp2 = __tmp1; \ - __tmp1 = __tmp2; \ -CYG_MACRO_END - - -//---------------------------------------------------------------------------- -// The unused attribute stops the compiler warning about the variable -// not being used. -// The used attribute prevents the compiler from optimizing it away. - -#define CYG_REFERENCE_OBJECT(__object__) \ - CYG_MACRO_START \ - static const void* __cygvar_discard_me__ \ - __attribute__ ((unused, used)) = (const void*)&(__object__); \ - CYG_MACRO_END - -// ------------------------------------------------------------------------- -// Define basic types for using integers in memory and structures; -// depends on compiler defaults and CPU type. - -typedef unsigned cyg_halint8 cyg_uint8 ; -typedef signed cyg_halint8 cyg_int8 ; - -typedef unsigned cyg_halint16 cyg_uint16 ; -typedef signed cyg_halint16 cyg_int16 ; - -typedef unsigned cyg_halint32 cyg_uint32 ; -typedef signed cyg_halint32 cyg_int32 ; - -typedef unsigned cyg_halint64 cyg_uint64 ; -typedef signed cyg_halint64 cyg_int64 ; - -typedef cyg_halbool cyg_bool ; - -// ------------------------------------------------------------------------- -// Define types for using integers in registers for looping and the like; -// depends on CPU type, choose what it is most comfortable with, with at -// least the range required. - -typedef unsigned cyg_halcount8 cyg_ucount8 ; -typedef signed cyg_halcount8 cyg_count8 ; - -typedef unsigned cyg_halcount16 cyg_ucount16 ; -typedef signed cyg_halcount16 cyg_count16 ; - -typedef unsigned cyg_halcount32 cyg_ucount32 ; -typedef signed cyg_halcount32 cyg_count32 ; - -typedef unsigned cyg_halcount64 cyg_ucount64 ; -typedef signed cyg_halcount64 cyg_count64 ; - -// ------------------------------------------------------------------------- -// Define a type to be used for atomic accesses. This type is guaranteed -// to be read or written in a single uninterruptible operation. This type -// is at least a single byte. - -typedef volatile unsigned cyg_halatomic cyg_atomic; -typedef volatile unsigned cyg_halatomic CYG_ATOMIC; - -// ------------------------------------------------------------------------- -// Define types for access plain, on-the-metal memory or devices. - -typedef cyg_uint32 CYG_WORD; -typedef cyg_uint8 CYG_BYTE; -typedef cyg_uint16 CYG_WORD16; -typedef cyg_uint32 CYG_WORD32; -typedef cyg_uint64 CYG_WORD64; - -typedef cyg_haladdress CYG_ADDRESS; -typedef cyg_haladdrword CYG_ADDRWORD; - -// ------------------------------------------------------------------------- -// Number of elements in a (statically allocated) array. - -#define CYG_NELEM(a) (sizeof(a) / sizeof((a)[0])) - -// ------------------------------------------------------------------------- -// Constructor ordering macros. These are added as annotations to all -// static objects to order the constuctors appropriately. - -#if defined(__cplusplus) && defined(__GNUC__) && \ - !defined(CYGBLD_ATTRIB_INIT_PRI) -# define CYGBLD_ATTRIB_INIT_PRI( _pri_ ) __attribute__((init_priority(_pri_))) -#elif !defined(CYGBLD_ATTRIB_INIT_PRI) -// FIXME: should maybe just bomb out if this is attempted anywhere else? -// Not sure -# define CYGBLD_ATTRIB_INIT_PRI( _pri_ ) -#endif - -// The following will be removed eventually as it doesn't allow the use of -// e.g. pri+5 format -#define CYG_INIT_PRIORITY( _pri_ ) CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_##_pri_ ) - -#define CYGBLD_ATTRIB_INIT_BEFORE( _pri_ ) CYGBLD_ATTRIB_INIT_PRI(_pri_-100) -#define CYGBLD_ATTRIB_INIT_AFTER( _pri_ ) CYGBLD_ATTRIB_INIT_PRI(_pri_+100) - -#if defined(__GNUC__) && !defined(__cplusplus) && (__GNUC_VERSION__ >= 40300) -// Equivalents of the above for C functions, available from gcc 4.3 onwards. -# define CYGBLD_ATTRIB_C_INIT_PRI( _pri_) __attribute__((constructor (_pri_))) -# define CYGBLD_ATTRIB_C_INIT_BEFORE( _pri_ ) __attribute__((constructor (_pri_-100))) -# define CYGBLD_ATTRIB_C_INIT_AFTER( _pri_ ) __attribute__((constructor (_pri_+100))) -#endif - -// Start with initializing everything inside the cpu and the main memory. -#define CYG_INIT_HAL 10000 -#define CYG_INIT_SCHEDULER 11000 -#define CYG_INIT_IDLE_THREAD 11100 -#define CYG_INIT_INTERRUPTS 12000 -#define CYG_INIT_CLOCK 14000 -#define CYG_INIT_THREADS 16000 -#define CYG_INIT_KERNEL 19000 -#define CYG_INIT_MEMALLOC 20000 -// Now move on to I/O subsystems and device drivers. These can make use of -// kernel and HAL functionality, and can dynamically allocate memory if -// absolutely needed. For now they can also assume that diag_printf() -// functionality is available, but that may change in future. -// -// Primary buses are ones very closely tied to the processor, e.g. PCI. -#define CYG_INIT_BUS_PRIMARY 30000 -// Not yet: on some targets cyg_pci_init() has to be called very early -// on for HAL diagnostics to work. -// #define CYG_INIT_BUS_PCI CYG_INIT_BUS_PRIMARY -// -// Secondary buses may hang off primary buses, e.g. USB host. -#define CYG_INIT_BUS_SECONDARY 31000 -// Tertiary buses are everything else. -#define CYG_INIT_BUS_TERTIARY 32000 -#define CYG_INIT_BUS_I2C CYG_INIT_BUS_TERTIARY -#define CYG_INIT_BUS_SPI CYG_INIT_BUS_TERTIARY -// -// In future HAL diag initialization may happen at this point. -// -// Watchdogs and wallclocks often hang off a tertiary bus but -// have no dependencies -#define CYG_INIT_DEV_WATCHDOG 35000 -#define CYG_INIT_DEV_WALLCLOCK 36000 -// A primary block configuration can be initialized with no need -// for per-unit configuration information. -#define CYG_INIT_DEV_BLOCK_PRIMARY 37000 -#define CYG_INIT_DEV_FLASH CYG_INIT_DEV_BLOCK_PRIMARY -// Per-unit configuration data extracted from primary storage. -// NOTE: for future use, not implemented yet. -#define CYG_INIT_CONFIG 38000 -// Secondary block devices may use per-unit configuration data -// for e.g. interpreting partition layout. Few devices are expected -// to fall into this category. Note that these devices, as well as -// some char devices, may not actually be usable until interrupts -// are enabled. -#define CYG_INIT_DEV_BLOCK_SECONDARY 40000 -// Char devices are everything else: serial, ethernet, CAN, ... -#define CYG_INIT_DEV_CHAR 41000 -// For backwards compatibility. Subject to change in future so -// a CYG_INIT_DEV_ priority should be used instead. -#define CYG_INIT_DRIVERS 48000 -// CYG_INIT_IO and CYG_INIT_IO_FS are poorly defined at present, -// and may get reorganized in future. -#define CYG_INIT_IO 49000 -#define CYG_INIT_IO_FS 50000 -// The I/O subsystems and device drivers have been initialized. -#define CYG_INIT_LIBC 56000 -#define CYG_INIT_COMPAT 58000 -#define CYG_INIT_APPLICATION 60000 -#define CYG_INIT_PREDEFAULT 65534 -#define CYG_INIT_DEFAULT 65535 - -// ------------------------------------------------------------------------- -// Label name macros. Some toolsets generate labels with initial -// underscores and others don't. CYG_LABEL_NAME should be used on -// labels in C/C++ code that are defined in assembly code or linker -// scripts. CYG_LABEL_DEFN is for use in assembly code and linker -// scripts where we need to manufacture labels that can be used from -// C/C++. -// These are default implementations that should work for most targets. -// They may be overridden in basetype.h if necessary. - -#ifndef CYG_LABEL_NAME - -#define CYG_LABEL_NAME(_name_) _name_ - -#endif - -#ifndef CYG_LABEL_DEFN - -#define CYG_LABEL_DEFN(_label) _label - -#endif - -// ------------------------------------------------------------------------- -// COMPILER-SPECIFIC STUFF - -#ifdef __GNUC__ -// Force a 'C' routine to be called like a 'C++' contructor -# if !defined(CYGBLD_ATTRIB_CONSTRUCTOR) -# define CYGBLD_ATTRIB_CONSTRUCTOR __attribute__((constructor)) -# endif - -// Define a compiler-specific rune for saying a function doesn't return -# if !defined(CYGBLD_ATTRIB_NORET) -# define CYGBLD_ATTRIB_NORET __attribute__((noreturn)) -# endif - -// How to define weak symbols - this is only relevant for ELF and a.out, -// but that won't be a problem for eCos -# if !defined(CYGBLD_ATTRIB_WEAK) -# define CYGBLD_ATTRIB_WEAK __attribute__ ((weak)) -# endif - -// How to define alias to symbols. Just pass in the symbol itself, not -// the string name of the symbol -# if !defined(CYGBLD_ATTRIB_ALIAS) -# define CYGBLD_ATTRIB_ALIAS(__symbol__) \ - __attribute__ ((alias (#__symbol__))) -# endif - -// This effectively does the reverse of the previous macro. It defines -// a name that the attributed variable or function will actually have -// in assembler. -# if !defined(CYGBLD_ATTRIB_ASM_ALIAS) -# define __Str(x) #x -# define __Xstr(x) __Str(x) -# define CYGBLD_ATTRIB_ASM_ALIAS(__symbol__) \ - __asm__ ( __Xstr( CYG_LABEL_DEFN( __symbol__ ) ) ) -# endif - -// Shows that a function returns the same value when given the same args, but -// note this can't be used if there are pointer args -# if !defined(CYGBLD_ATTRIB_CONST) -# define CYGBLD_ATTRIB_CONST __attribute__((const)) -#endif - -// Assign a defined variable to a specific section -# if !defined(CYGBLD_ATTRIB_SECTION) -# define CYGBLD_ATTRIB_SECTION(__sect__) __attribute__((section (__sect__))) -# endif - -// Give a type or object explicit minimum alignment -# if !defined(CYGBLD_ATTRIB_ALIGN) -# define CYGBLD_ATTRIB_ALIGN(__align__) __attribute__((aligned(__align__))) -# endif - -# if !defined(CYGBLD_ATTRIB_ALIGN_MAX) -# define CYGBLD_ATTRIB_ALIGN_MAX __attribute__((aligned)) -# endif - -# if !defined(CYGBLD_ATTRIB_ALIGNOFTYPE) -# define CYGBLD_ATTRIB_ALIGNOFTYPE( _type_ ) \ - __attribute__((aligned(__alignof__( _type_ )))) -# endif - -// Teach compiler how to check format of printf-like functions -# define CYGBLD_ATTRIB_PRINTF_FORMAT(__format__, __args__) \ - __attribute__((format (printf, __format__, __args__))) - -// Teach compiler how to check format of scanf-like functions -# define CYGBLD_ATTRIB_SCANF_FORMAT(__format__, __args__) \ - __attribute__((format (scanf, __format__, __args__))) - -// Teach compiler how to check format of strftime-like functions -# define CYGBLD_ATTRIB_STRFTIME_FORMAT(__format__, __args__) \ - __attribute__((format (strftime, __format__, __args__))) - -// Tell the compiler not to throw away a variable or function. Only known -// available on 3.3.2 or above. Old version's didn't throw them away, -// but using the unused attribute should stop warnings. -# if !defined(CYGBLD_ATTRIB_USED) -# if __GNUC_VERSION__ >= 30302 -# define CYGBLD_ATTRIB_USED __attribute__((used)) -# else -# define CYGBLD_ATTRIB_USED __attribute__((unused)) -# endif -# endif -#else // non-GNU - -# define CYGBLD_ATTRIB_CONSTRUCTOR - -# define CYGBLD_ATTRIB_NORET - // This intentionally gives an error only if we actually try to - // use it. #error would give an error if we simply can't. -// FIXME: Had to disarm the bomb - the CYGBLD_ATTRIB_WEAK macro is now -// (indirectly) used in host tools. -# define CYGBLD_ATTRIB_WEAK /* !!!-- Attribute weak not defined --!!! */ - -# define CYGBLD_ATTRIB_ALIAS(__x__) !!!-- Attribute alias not defined --!!! - -# define CYGBLD_ATTRIB_ASM_ALIAS(__symbol__) !!!-- Asm alias not defined --!!! - -# define CYGBLD_ATTRIB_CONST - -# define CYGBLD_ATTRIB_ALIGN(__align__) !!!-- Alignment alias not defined --!!! - -# define CYGBLD_ATTRIB_ALIGN_MAX !!!-- Alignment alias not defined --!!! - -# define CYGBLD_ATTRIB_ALIGNOFTYPE( _type_ ) !!!-- Alignment alias not defined --!!! - -# define CYGBLD_ATTRIB_PRINTF_FORMAT(__format__, __args__) - -# define CYGBLD_ATTRIB_SCANF_FORMAT(__format__, __args__) - -# define CYGBLD_ATTRIB_STRFTIME_FORMAT(__format__, __args__) - - -#endif - -// How to define weak aliases. Currently this is simply a mixture of the -// above - -# define CYGBLD_ATTRIB_WEAK_ALIAS(__symbol__) \ - CYGBLD_ATTRIB_WEAK CYGBLD_ATTRIB_ALIAS(__symbol__) - -#ifdef __cplusplus -# define __THROW throw() -#else -# define __THROW -#endif - -// ------------------------------------------------------------------------- -// Variable annotations -// These annotations may be added to various static variables in the -// HAL and kernel to indicate which component they belong to. These -// are used by some targets to optimize memory placement of these -// variables. - -#ifndef CYGBLD_ANNOTATE_VARIABLE_HAL -#define CYGBLD_ANNOTATE_VARIABLE_HAL -#endif -#ifndef CYGBLD_ANNOTATE_VARIABLE_SCHED -#define CYGBLD_ANNOTATE_VARIABLE_SCHED -#endif -#ifndef CYGBLD_ANNOTATE_VARIABLE_CLOCK -#define CYGBLD_ANNOTATE_VARIABLE_CLOCK -#endif -#ifndef CYGBLD_ANNOTATE_VARIABLE_INTR -#define CYGBLD_ANNOTATE_VARIABLE_INTR -#endif - -// ------------------------------------------------------------------------- -// Various "flavours" of memory regions that can be described by the -// Memory Layout Tool (MLT). - -#define CYGMEM_REGION_ATTR_R 0x01 // Region can be read -#define CYGMEM_REGION_ATTR_W 0x02 // Region can be written - -#if defined (__GNUC__) -#elif defined (MSVC) -#define __inline__ __inline -#define inline __inline -#else -#endif -// ------------------------------------------------------------------------- -#endif // CYGONCE_INFRA_CYG_TYPE_H multiple inclusion protection -// EOF cyg_type.h diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.c b/components/dfs/filesystems/jffs2/dfs_jffs2.c deleted file mode 100644 index c082c21d73..0000000000 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.c +++ /dev/null @@ -1,687 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-1-7 prife the first version - */ - -#include -#include - -#include "cyg/infra/cyg_type.h" -#include "cyg/fileio/fileio.h" -#include "port/codes.h" -#include "port/fcntl.h" -#undef mode_t - -#include -#include - -#include "dfs_jffs2.h" -#include "jffs2_config.h" -#include "porting.h" -#include - -#if DEVICE_PART_MAX > 1 - #error "support only one jffs2 partition on a flash device!" -#endif - -/* make sure the following struct var had been initilased to 0! */ -struct device_part -{ - struct cyg_mtab_entry * mte; - struct rt_mtd_nor_device *dev; -}; -static struct device_part device_partition[DEVICE_PART_MAX] = {0}; -static struct rt_mutex jffs2_lock; - -#define jffs2_mount jffs2_fste.mount -#define jffs2_umount jffs2_fste.umount -#define jffs2_open jffs2_fste.open -#define jffs2_file_unlink jffs2_fste.unlink -#define jffs2_mkdir jffs2_fste.mkdir -#define jffs2_rmdir jffs2_fste.rmdir -#define jffs2_rename jffs2_fste.rename -#define jffs2_link jffs2_fste.link -#define jffs2_opendir jffs2_fste.opendir -#define jffs2_chdir jffs2_fste.chdir -#define jffs2_ops_stat jffs2_fste.stat -#define jffs2_getinfo jffs2_fste.getinfo -#define jffs2_setinfo jffs2_fste.setinfo - -#define jffs2_file_read jffs2_fileops.fo_read -#define jffs2_file_write jffs2_fileops.fo_write -#define jffs2_file_lseek jffs2_fileops.fo_lseek -#define jffs2_file_ioctl jffs2_fileops.fo_ioctl -#define jffs2_file_select jffs2_fileops.fo_select -#define jffs2_file_fsync jffs2_fileops.fo_fsync -#define jffs2_file_colse jffs2_fileops.fo_close -#define jffs2_file_fstat jffs2_fileops.fo_fstat -#define jffs2_file_getinfo jffs2_fileops.fo_getinfo -#define jffs2_file_setinfo jffs2_fileops.fo_setinfo - -#define jffs2_dir_read jffs2_dirops.fo_read -//#define jffs2_dir_write jffs2_dirops.fo_write -#define jffs2_dir_lseek jffs2_dirops.fo_lseek -//#define jffs2_dir_ioctl jffs2_dirops.fo_ioctl -#define jffs2_dir_select jffs2_dirops.fo_select -//#define jffs2_dir_fsync jffs2_dirops.fo_fsync -#define jffs2_dir_colse jffs2_dirops.fo_close -//#define jffs2_dir_fstat jffs2_dirops.fo_fstat -//#define jffs2_dir_getinfo jffs2_dirops.fo_getinfo -//#define jffs2_dir_setinfo jffs2_dirops.fo_setinfo - -/* - * RT-Thread Device Interface for jffs2 - */ - -/* these code is in src/flashio.c */ -static int jffs2_result_to_dfs(int result) -{ - if (result < 0) return result; - if (result > 0) return -result; - - return 0; -} - -/* - * RT-Thread DFS Interface for jffs2 - */ -static int dfs_jffs2_mount(struct dfs_filesystem* fs, - unsigned long rwflag, - const void* data) -{ - unsigned index; - struct cyg_mtab_entry * mte; - int result; - - /* find a empty entry in partition table */ - for (index = 0; index < DEVICE_PART_MAX; index ++) - { - if (device_partition[index].dev == RT_NULL) - break; - } - if (index == DEVICE_PART_MAX) - return -ENOSPC; - - mte = rt_malloc(sizeof(struct cyg_mtab_entry)); - if (mte == RT_NULL) - return -ENOMEM; - - mte->name = fs->path; - mte->fsname = "jffs2"; - mte->devname = NULL; - /* note that, i use mte->data to store rtt's device - * while, in jffs2_mount, mte->data will be copy into - * s_dev in struct super_block, and mte->data will be - * filled with jffs2_sb(see the source of jffs2_mount. - */ - mte->data = (CYG_ADDRWORD)fs->dev_id; - - device_partition[index].dev = RT_MTD_NOR_DEVICE(fs->dev_id); - /* after jffs2_mount, mte->data will not be dev_id any more */ - result = jffs2_mount(NULL, mte); - if (result != 0) - { - device_partition[index].dev = NULL; - return jffs2_result_to_dfs(result); - } - - /* save this pointer */ - device_partition[index].mte = mte; - return 0; -} - -static int _find_fs(struct cyg_mtab_entry ** mte, rt_device_t dev_id) -{ - unsigned index; - - /* find device index */ - for (index = 0; index < DEVICE_PART_MAX; index++) - { - if (device_partition[index].dev == RT_MTD_NOR_DEVICE(dev_id)) - { - *mte = device_partition[index].mte; - return 0; - } - } - - rt_kprintf("error, could not found the fs!"); - return -1; -} - -static int dfs_jffs2_unmount(struct dfs_filesystem* fs) -{ - int result; - unsigned index; - - /* find device index, then umount it */ - for (index = 0; index < DEVICE_PART_MAX; index++) - { - if (device_partition[index].dev == RT_MTD_NOR_DEVICE(fs->dev_id)) - { - result = jffs2_umount(device_partition[index].mte); - if (result) return jffs2_result_to_dfs(result); - - rt_free(device_partition[index].mte); - device_partition[index].dev = NULL; - device_partition[index].mte = NULL; - return RT_EOK; - } - } - - return -ENOENT; -} - -static int dfs_jffs2_mkfs(rt_device_t dev_id) -{ - /* just erase all blocks on this nand partition */ - return -ENOSYS; -} - -static int dfs_jffs2_statfs(struct dfs_filesystem* fs, - struct statfs *buf) -{ - /* since the limit of unsigned long, so the max size of flash device is 4G */ - struct cyg_mtab_entry * mte; - struct jffs2_fs_info info; - int result; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - RT_ASSERT(mte->data != 0); - - jffs2_get_info_from_sb((void *)mte->data, &info); - buf->f_bsize = info.sector_size; - buf->f_blocks = info.nr_blocks; - buf->f_bfree = info.free_size / info.sector_size; - - return 0; -} - -static const char jffs2_root_path[] = "."; - -static int dfs_jffs2_open(struct dfs_fd* file) -{ - int result; - int oflag, mode; - const char * name; - cyg_file * jffs2_file; - struct dfs_filesystem *fs; - struct cyg_mtab_entry * mte; - - oflag = file->flags; - fs = (struct dfs_filesystem *)file->data; - RT_ASSERT(fs != RT_NULL); - - jffs2_file = rt_malloc(sizeof(cyg_file)); - if (jffs2_file == RT_NULL) - return -ENOMEM; - - /* just escape '/' provided by dfs code */ - name = file->path; - if ((name[0] == '/') && (name[1] == 0)) - name = jffs2_root_path; - else /* name[0] still will be '/' */ - name ++; - - result = _find_fs(&mte, fs->dev_id); - if (result) - { - rt_free(jffs2_file); - return -ENOENT; - } - - /* set mount table */ - jffs2_file->f_mte = mte; - - if (oflag & O_DIRECTORY) /* operations about dir */ - { - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - if (oflag & O_CREAT) /* create a dir*/ - { - /* fixme, should test file->path can end with '/' */ - result = jffs2_mkdir(mte, mte->root, name); - if (result) - { - rt_mutex_release(&jffs2_lock); - rt_free(jffs2_file); - return jffs2_result_to_dfs(result); - } - } - - /* open dir */ - result = jffs2_opendir(mte, mte->root, name, jffs2_file); - rt_mutex_release(&jffs2_lock); - if (result) - { - rt_free(jffs2_file); - return jffs2_result_to_dfs(result); - } -#ifdef CONFIG_JFFS2_NO_RELATIVEDIR - jffs2_file->f_offset = 2; -#endif - /* save this pointer, it will be used by dfs_jffs2_getdents*/ - file->data = jffs2_file; - return 0; - } - /* regular file operations */ - mode = JFFS2_O_RDONLY; - if (oflag & O_WRONLY) mode |= JFFS2_O_WRONLY; - if (oflag & O_RDWR) mode |= JFFS2_O_RDWR; - /* Opens the file, if it is existing. If not, a new file is created. */ - if (oflag & O_CREAT) mode |= JFFS2_O_CREAT; - /* Creates a new file. If the file is existing, it is truncated and overwritten. */ - if (oflag & O_TRUNC) mode |= JFFS2_O_TRUNC; - /* Creates a new file. The function fails if the file is already existing. */ - if (oflag & O_EXCL) mode |= JFFS2_O_EXCL; - - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_open(mte, 0, name, mode, jffs2_file); - if (result != 0) - { - rt_mutex_release(&jffs2_lock); - rt_free(jffs2_file); - return jffs2_result_to_dfs(result); - } - - /* save this pointer, it will be used when calling read(), write(), - flush(), lessk(), and will be rt_free when calling close()*/ - file->data = jffs2_file; - file->pos = jffs2_file->f_offset; - file->size = 0; - jffs2_file_lseek(jffs2_file, (off_t *)(&(file->size)), SEEK_END); - jffs2_file->f_offset = (off_t)file->pos; - rt_mutex_release(&jffs2_lock); - - if (oflag & O_APPEND) - { - file->pos = file->size; - jffs2_file->f_offset = file->size; - } - - return 0; -} - -static int dfs_jffs2_close(struct dfs_fd* file) -{ - int result; - cyg_file * jffs2_file; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - - if (file->flags & O_DIRECTORY) /* operations about dir */ - { - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_dir_colse(jffs2_file); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - rt_free(jffs2_file); - return 0; - } - /* regular file operations */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_colse(jffs2_file); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - /* release memory */ - rt_free(jffs2_file); - return 0; -} - -static int dfs_jffs2_ioctl(struct dfs_fd* file, int cmd, void* args) -{ - return -ENOSYS; -} - -static int dfs_jffs2_read(struct dfs_fd* file, void* buf, size_t len) -{ - cyg_file * jffs2_file; - struct CYG_UIO_TAG uio_s; - struct CYG_IOVEC_TAG iovec; - int char_read; - int result; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - uio_s.uio_iov = &iovec; - uio_s.uio_iov->iov_base = buf; - uio_s.uio_iov->iov_len = len; - uio_s.uio_iovcnt = 1; //must be 1 - //uio_s.uio_offset //not used... - uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in jffs2; - - char_read = jffs2_file->f_offset; /* the current offset */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_read(jffs2_file, &uio_s); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - /* update position */ - file->pos = jffs2_file->f_offset; - char_read = jffs2_file->f_offset - char_read; - return char_read; -} - -static int dfs_jffs2_write(struct dfs_fd* file, - const void* buf, - size_t len) -{ - cyg_file * jffs2_file; - struct CYG_UIO_TAG uio_s; - struct CYG_IOVEC_TAG iovec; - int char_write; - int result; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - uio_s.uio_iov = &iovec; - uio_s.uio_iov->iov_base = (void *)buf; - uio_s.uio_iov->iov_len = len; - uio_s.uio_iovcnt = 1; //must be 1 - //uio_s.uio_offset //not used... - uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in jffs2; - - char_write = jffs2_file->f_offset; - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_write(jffs2_file, &uio_s); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - /* update position */ - file->pos = jffs2_file->f_offset; - char_write = jffs2_file->f_offset - char_write; - return char_write; -} - -static int dfs_jffs2_flush(struct dfs_fd* file) -{ - /* infact, jffs2 not support, jffs2_fo_sync just return ok */ - return -ENOSYS; -} - -/* fixme warning: the offset is rt_off_t, so maybe the size of a file is must <= 2G*/ -static int dfs_jffs2_lseek(struct dfs_fd* file, - rt_off_t offset) -{ - cyg_file * jffs2_file; - int result; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - - /* set offset as current offset */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_lseek(jffs2_file, &offset, SEEK_SET); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - /* update file position */ - file->pos = offset; - return offset; -} - -/* return the size of struct dirent*/ -static int dfs_jffs2_getdents(struct dfs_fd* file, - struct dirent* dirp, - rt_uint32_t count) -{ - cyg_file * jffs2_file; - struct CYG_UIO_TAG uio_s; - struct CYG_IOVEC_TAG iovec; - struct jffs2_dirent jffs2_d; - struct dirent * d; - rt_uint32_t index; -#if !defined (CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE) - struct jffs2_stat s; - cyg_mtab_entry * mte; - char * fullname; -#endif - int result; - - RT_ASSERT(file->data != RT_NULL); - jffs2_file = (cyg_file*)(file->data); - mte = jffs2_file->f_mte; - - //set jffs2_d - memset(&jffs2_d, 0, sizeof(struct jffs2_dirent)); - //set CYG_UIO_TAG uio_s - uio_s.uio_iov = &iovec; - uio_s.uio_iov->iov_base = &jffs2_d; - uio_s.uio_iov->iov_len = sizeof(struct jffs2_dirent);; - uio_s.uio_iovcnt = 1; //must be 1 - uio_s.uio_offset = 0;//not used... - uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in jffs2; - - /* make integer count, usually count is 1 */ - count = (count / sizeof(struct dirent)) * sizeof(struct dirent); - if (count == 0) return -EINVAL; - - index = 0; - /* usually, the while loop should only be looped only once! */ - while (1) - { - d = dirp + index; - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_dir_read(jffs2_file, &uio_s); - rt_mutex_release(&jffs2_lock); - /* if met a error or all entry are read over, break while*/ - if (result || jffs2_d.d_name[0] == 0) - break; - -#if defined (CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE) - switch(jffs2_d.d_type & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: d->d_type = DT_REG; break; - case JFFS2_S_IFDIR: d->d_type = DT_DIR; break; - default: d->d_type = DT_UNKNOWN; break; - } -#else - fullname = rt_malloc(FILE_PATH_MAX); - if(fullname == RT_NULL) - return -ENOMEM; - - /* make a right entry */ - if ((file->path[0] == '/') ) - { - if (file->path[1] == 0) - strcpy(fullname, jffs2_d.d_name); - else - rt_sprintf(fullname, "%s/%s", file->path+1, jffs2_d.d_name); - } - else - rt_sprintf(fullname, "%s/%s", file->path, jffs2_d.d_name); - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_porting_stat(mte, mte->root, fullname, (void *)&s); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - rt_free(fullname); - /* convert to dfs stat structure */ - switch(s.st_mode & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: d->d_type = DT_REG; break; - case JFFS2_S_IFDIR: d->d_type = DT_DIR; break; - default: d->d_type = DT_UNKNOWN; break; - } -#endif - /* write the rest fields of struct dirent* dirp */ - d->d_namlen = rt_strlen(jffs2_d.d_name); - d->d_reclen = (rt_uint16_t)sizeof(struct dirent); - rt_strncpy(d->d_name, jffs2_d.d_name, d->d_namlen + 1); - - index ++; - if (index * sizeof(struct dirent) >= count) - break; - } - if (result) - return jffs2_result_to_dfs(result); - return index * sizeof(struct dirent); -} - -static int dfs_jffs2_unlink(struct dfs_filesystem* fs, const char* path) -{ - int result; - struct jffs2_stat s; - cyg_mtab_entry * mte; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - /* deal path */ - if (path[0] == '/') - path++; - - /* judge file type, dir is to be delete by rmdir, others by unlink */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_porting_stat(mte, mte->root, path, (void *)&s); - if (result) - { - rt_mutex_release(&jffs2_lock); - return jffs2_result_to_dfs(result); - } - - switch(s.st_mode & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: - result = jffs2_file_unlink(mte, mte->root, path); - break; - case JFFS2_S_IFDIR: - result = jffs2_rmdir(mte, mte->root, path); - break; - default: - /* unknown file type */ - rt_mutex_release(&jffs2_lock); - return -1; - } - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - return 0; -} - -static int dfs_jffs2_rename(struct dfs_filesystem* fs, - const char* oldpath, - const char* newpath) -{ - int result; - cyg_mtab_entry * mte; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - if (*oldpath == '/') - oldpath += 1; - if (*newpath == '/') - newpath += 1; - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_rename(mte, mte->root, oldpath, mte->root, newpath); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - return 0; -} - -static int dfs_jffs2_stat(struct dfs_filesystem* fs, const char *path, struct stat *st) -{ - int result; - struct jffs2_stat s; - cyg_mtab_entry * mte; - - /* deal the path for jffs2 */ - RT_ASSERT(!((path[0] == '/') && (path[1] == 0))); - - if (path[0] == '/') - path++; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_porting_stat(mte, mte->root, path, (void *)&s); - rt_mutex_release(&jffs2_lock); - - if (result) - return jffs2_result_to_dfs(result); - /* convert to dfs stat structure */ - switch(s.st_mode & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: - st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; - break; - - case JFFS2_S_IFDIR: - st->st_mode = S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH; - break; - - default: - st->st_mode = DT_UNKNOWN; //fixme - break; - } - - st->st_dev = 0; - st->st_size = s.st_size; - st->st_mtime = s.st_mtime; - - return 0; -} - -static const struct dfs_file_ops _jffs2_fops = -{ - dfs_jffs2_open, - dfs_jffs2_close, - dfs_jffs2_ioctl, - dfs_jffs2_read, - dfs_jffs2_write, - dfs_jffs2_flush, - dfs_jffs2_lseek, - dfs_jffs2_getdents, -}; - -static const struct dfs_filesystem_ops _jffs2_ops = -{ - "jffs2", - DFS_FS_FLAG_DEFAULT, - &_jffs2_fops, - - dfs_jffs2_mount, - dfs_jffs2_unmount, - dfs_jffs2_mkfs, - dfs_jffs2_statfs, - - dfs_jffs2_unlink, - dfs_jffs2_stat, - dfs_jffs2_rename, -}; - -int dfs_jffs2_init(void) -{ - /* register fatfs file system */ - dfs_register(&_jffs2_ops); - - /* initialize mutex */ - if (rt_mutex_init(&jffs2_lock, "jffs2lock", RT_IPC_FLAG_FIFO) != RT_EOK) - { - rt_kprintf("init jffs2 lock mutex failed\n"); - } - rt_kprintf("init jffs2 lock mutex okay\n"); - return 0; -} -INIT_COMPONENT_EXPORT(dfs_jffs2_init); diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.h b/components/dfs/filesystems/jffs2/dfs_jffs2.h deleted file mode 100644 index 1be403a19c..0000000000 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef __DFS_JFFS2_H__ -#define __DFS_JFFS2_H__ - -int dfs_jffs2_init(void); - -#endif diff --git a/components/dfs/filesystems/jffs2/include/linux/jffs2.h b/components/dfs/filesystems/jffs2/include/linux/jffs2.h deleted file mode 100644 index ab034effe6..0000000000 --- a/components/dfs/filesystems/jffs2/include/linux/jffs2.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in the - * jffs2 directory. - * - * $Id: jffs2.h,v 1.36 2005/07/26 13:19:36 havasi Exp $ - * - */ - -#ifndef __LINUX_JFFS2_H__ -#define __LINUX_JFFS2_H__ - -/* You must include something which defines the C99 uintXX_t types. - We don't do it from here because this file is used in too many - different environments. */ - -#define JFFS2_SUPER_MAGIC 0x72b6 - -/* Values we may expect to find in the 'magic' field */ -#define JFFS2_OLD_MAGIC_BITMASK 0x1984 -#define JFFS2_MAGIC_BITMASK 0x1985 -#define KSAMTIB_CIGAM_2SFFJ 0x8519 /* For detecting wrong-endian fs */ -#define JFFS2_EMPTY_BITMASK 0xffff -#define JFFS2_DIRTY_BITMASK 0x0000 - -/* We only allow a single char for length, and 0xFF is empty flash so - we don't want it confused with a real length. Hence max 254. -*/ -#define JFFS2_MAX_NAME_LEN 254 - -/* How small can we sensibly write nodes? */ -#define JFFS2_MIN_DATA_LEN 128 - -#define JFFS2_COMPR_NONE 0x00 -#define JFFS2_COMPR_ZERO 0x01 -#define JFFS2_COMPR_RTIME 0x02 -#define JFFS2_COMPR_RUBINMIPS 0x03 -#define JFFS2_COMPR_COPY 0x04 -#define JFFS2_COMPR_DYNRUBIN 0x05 -#define JFFS2_COMPR_ZLIB 0x06 -/* Compatibility flags. */ -#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ -#define JFFS2_NODE_ACCURATE 0x2000 -/* INCOMPAT: Fail to mount the filesystem */ -#define JFFS2_FEATURE_INCOMPAT 0xc000 -/* ROCOMPAT: Mount read-only */ -#define JFFS2_FEATURE_ROCOMPAT 0x8000 -/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */ -#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000 -/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */ -#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000 - -#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1) -#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2) -#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) -#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) - -// Maybe later... -//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) -//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) - - -#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at - mount time, don't wait for it to - happen later */ -#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific - compression type */ - - -/* These can go once we've made sure we've caught all uses without - byteswapping */ -#include - -#if defined(__GNUC__) || (__CC_ARM) -typedef struct { - uint32_t v32; -} __attribute__((packed)) jint32_t; - -typedef struct { - uint32_t m; -} __attribute__((packed)) jmode_t; - -typedef struct { - uint16_t v16; -} __attribute__((packed)) jint16_t; - -struct jffs2_unknown_node -{ - /* All start like this */ - jint16_t magic; - jint16_t nodetype; - jint32_t totlen; /* So we can skip over nodes we don't grok */ - jint32_t hdr_crc; -} __attribute__((packed)); - -struct jffs2_raw_dirent -{ - jint16_t magic; - jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */ - jint32_t totlen; - jint32_t hdr_crc; - jint32_t pino; - jint32_t version; - jint32_t ino; /* == zero for unlink */ - jint32_t mctime; - uint8_t nsize; - uint8_t type; - uint8_t unused[2]; - jint32_t node_crc; - jint32_t name_crc; - uint8_t name[0]; -} __attribute__((packed)); - -/* The JFFS2 raw inode structure: Used for storage on physical media. */ -/* The uid, gid, atime, mtime and ctime members could be longer, but - are left like this for space efficiency. If and when people decide - they really need them extended, it's simple enough to add support for - a new type of raw node. -*/ -struct jffs2_raw_inode -{ - jint16_t magic; /* A constant magic number. */ - jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */ - jint32_t totlen; /* Total length of this node (inc data, etc.) */ - jint32_t hdr_crc; - jint32_t ino; /* Inode number. */ - jint32_t version; /* Version number. */ - jmode_t mode; /* The file's type or mode. */ - jint16_t uid; /* The file's owner. */ - jint16_t gid; /* The file's group. */ - jint32_t isize; /* Total resultant size of this inode (used for truncations) */ - jint32_t atime; /* Last access time. */ - jint32_t mtime; /* Last modification time. */ - jint32_t ctime; /* Change time. */ - jint32_t offset; /* Where to begin to write. */ - jint32_t csize; /* (Compressed) data size */ - jint32_t dsize; /* Size of the node's data. (after decompression) */ - uint8_t compr; /* Compression algorithm used */ - uint8_t usercompr; /* Compression algorithm requested by the user */ - jint16_t flags; /* See JFFS2_INO_FLAG_* */ - jint32_t data_crc; /* CRC for the (compressed) data. */ - jint32_t node_crc; /* CRC for the raw inode (excluding data) */ - uint8_t data[0]; -} __attribute__((packed)); - -#elif defined (MSVC) -typedef uint32_t jint32_t; -//typedef uint32_t jmode_t; -typedef struct { - uint32_t m; -} jmode_t; -typedef uint16_t jint16_t; - -#pragma pack(1) -struct jffs2_unknown_node -{ - /* All start like this */ - jint16_t magic; - jint16_t nodetype; - jint32_t totlen; /* So we can skip over nodes we don't grok */ - jint32_t hdr_crc; -}; - -struct jffs2_raw_dirent -{ - jint16_t magic; - jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */ - jint32_t totlen; - jint32_t hdr_crc; - jint32_t pino; - jint32_t version; - jint32_t ino; /* == zero for unlink */ - jint32_t mctime; - uint8_t nsize; - uint8_t type; - uint8_t unused[2]; - jint32_t node_crc; - jint32_t name_crc; - uint8_t name[0]; -}; - -/* The JFFS2 raw inode structure: Used for storage on physical media. */ -/* The uid, gid, atime, mtime and ctime members could be longer, but - are left like this for space efficiency. If and when people decide - they really need them extended, it's simple enough to add support for - a new type of raw node. -*/ -struct jffs2_raw_inode -{ - jint16_t magic; /* A constant magic number. */ - jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */ - jint32_t totlen; /* Total length of this node (inc data, etc.) */ - jint32_t hdr_crc; - jint32_t ino; /* Inode number. */ - jint32_t version; /* Version number. */ - jmode_t mode; /* The file's type or mode. */ - jint16_t uid; /* The file's owner. */ - jint16_t gid; /* The file's group. */ - jint32_t isize; /* Total resultant size of this inode (used for truncations) */ - jint32_t atime; /* Last access time. */ - jint32_t mtime; /* Last modification time. */ - jint32_t ctime; /* Change time. */ - jint32_t offset; /* Where to begin to write. */ - jint32_t csize; /* (Compressed) data size */ - jint32_t dsize; /* Size of the node's data. (after decompression) */ - uint8_t compr; /* Compression algorithm used */ - uint8_t usercompr; /* Compression algorithm requested by the user */ - jint16_t flags; /* See JFFS2_INO_FLAG_* */ - jint32_t data_crc; /* CRC for the (compressed) data. */ - jint32_t node_crc; /* CRC for the raw inode (excluding data) */ - uint8_t data[0]; -}; -#pragma pack() -#else -#endif - - -union jffs2_node_union { - struct jffs2_raw_inode i; - struct jffs2_raw_dirent d; - struct jffs2_unknown_node u; -}; - -#endif /* __LINUX_JFFS2_H__ */ diff --git a/components/dfs/filesystems/jffs2/include/linux/jffs2_fs_i.h b/components/dfs/filesystems/jffs2/include/linux/jffs2_fs_i.h deleted file mode 100644 index 7f30282653..0000000000 --- a/components/dfs/filesystems/jffs2/include/linux/jffs2_fs_i.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id: jffs2_fs_i.h,v 1.18 2005/07/17 11:13:48 dedekind Exp $ */ - -#ifndef _JFFS2_FS_I -#define _JFFS2_FS_I - -#include -#include -#include - -struct jffs2_inode_info { - /* We need an internal semaphore similar to inode->i_sem. - Unfortunately, we can't used the existing one, because - either the GC would deadlock, or we'd have to release it - before letting GC proceed. Or we'd have to put ugliness - into the GC code so it didn't attempt to obtain the i_sem - for the inode(s) which are already locked */ - struct semaphore sem; - - /* The highest (datanode) version number used for this ino */ - uint32_t highest_version; - - /* List of data fragments which make up the file */ - struct rb_root fragtree; - - /* There may be one datanode which isn't referenced by any of the - above fragments, if it contains a metadata update but no actual - data - or if this is a directory inode */ - /* This also holds the _only_ dnode for symlinks/device nodes, - etc. */ - struct jffs2_full_dnode *metadata; - - /* Directory entries */ - struct jffs2_full_dirent *dents; - - /* The target path if this is the inode of a symlink */ - unsigned char *target; - - /* Some stuff we just have to keep in-core at all times, for each inode. */ - struct jffs2_inode_cache *inocache; - - uint16_t flags; - uint8_t usercompr; -#if !defined (__ECOS) && !defined(RT_THREAD) -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2) - struct inode vfs_inode; -#endif -#endif -}; - -#endif /* _JFFS2_FS_I */ diff --git a/components/dfs/filesystems/jffs2/include/linux/jffs2_fs_sb.h b/components/dfs/filesystems/jffs2/include/linux/jffs2_fs_sb.h deleted file mode 100644 index 066e9400bc..0000000000 --- a/components/dfs/filesystems/jffs2/include/linux/jffs2_fs_sb.h +++ /dev/null @@ -1,120 +0,0 @@ -/* $Id: jffs2_fs_sb.h,v 1.52 2005/05/19 16:12:17 gleixner Exp $ */ - -#ifndef _JFFS2_FS_SB -#define _JFFS2_FS_SB - -#include "jffs2_config.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define JFFS2_SB_FLAG_RO 1 -#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */ -#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */ - -struct jffs2_inodirty; - -/* A struct for the overall file system control. Pointers to - jffs2_sb_info structs are named `c' in the source code. - Nee jffs_control -*/ -struct jffs2_sb_info { - struct mtd_info *mtd; - - uint32_t highest_ino; - uint32_t checked_ino; - - unsigned int flags; - - struct task_struct *gc_task; /* GC task struct */ - struct completion gc_thread_start; /* GC thread start completion */ - struct completion gc_thread_exit; /* GC thread exit completion port */ - - struct semaphore alloc_sem; /* Used to protect all the following - fields, and also to protect against - out-of-order writing of nodes. And GC. */ - uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER - (i.e. zero for OOB CLEANMARKER */ - - uint32_t flash_size; - uint32_t used_size; - uint32_t dirty_size; - uint32_t wasted_size; - uint32_t free_size; - uint32_t erasing_size; - uint32_t bad_size; - uint32_t sector_size; - uint32_t unchecked_size; - - uint32_t nr_free_blocks; - uint32_t nr_erasing_blocks; - - /* Number of free blocks there must be before we... */ - uint8_t resv_blocks_write; /* ... allow a normal filesystem write */ - uint8_t resv_blocks_deletion; /* ... allow a normal filesystem deletion */ - uint8_t resv_blocks_gctrigger; /* ... wake up the GC thread */ - uint8_t resv_blocks_gcbad; /* ... pick a block from the bad_list to GC */ - uint8_t resv_blocks_gcmerge; /* ... merge pages when garbage collecting */ - - uint32_t nospc_dirty_size; - - uint32_t nr_blocks; - struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks - * from the offset (blocks[ofs / sector_size]) */ - struct jffs2_eraseblock *nextblock; /* The block we're currently filling */ - - struct jffs2_eraseblock *gcblock; /* The block we're currently garbage-collecting */ - - struct list_head clean_list; /* Blocks 100% full of clean data */ - struct list_head very_dirty_list; /* Blocks with lots of dirty space */ - struct list_head dirty_list; /* Blocks with some dirty space */ - struct list_head erasable_list; /* Blocks which are completely dirty, and need erasing */ - struct list_head erasable_pending_wbuf_list; /* Blocks which need erasing but only after the current wbuf is flushed */ - struct list_head erasing_list; /* Blocks which are currently erasing */ - struct list_head erase_pending_list; /* Blocks which need erasing now */ - struct list_head erase_complete_list; /* Blocks which are erased and need the clean marker written to them */ - struct list_head free_list; /* Blocks which are free and ready to be used */ - struct list_head bad_list; /* Bad blocks. */ - struct list_head bad_used_list; /* Bad blocks with valid data in. */ - - spinlock_t erase_completion_lock; /* Protect free_list and erasing_list - against erase completion handler */ - wait_queue_head_t erase_wait; /* For waiting for erases to complete */ - - wait_queue_head_t inocache_wq; - struct jffs2_inode_cache **inocache_list; - spinlock_t inocache_lock; - - /* Sem to allow jffs2_garbage_collect_deletion_dirent to - drop the erase_completion_lock while it's holding a pointer - to an obsoleted node. I don't like this. Alternatives welcomed. */ - struct semaphore erase_free_sem; - -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER - /* Write-behind buffer for NAND flash */ - unsigned char *wbuf; - uint32_t wbuf_ofs; - uint32_t wbuf_len; - uint32_t wbuf_pagesize; - struct jffs2_inodirty *wbuf_inodes; - - struct rw_semaphore wbuf_sem; /* Protects the write buffer */ - - /* Information about out-of-band area usage... */ - struct nand_oobinfo *oobinfo; - uint32_t badblock_pos; - uint32_t fsdata_pos; - uint32_t fsdata_len; -#endif - - /* OS-private pointer for getting back to master superblock info */ - void *os_priv; -}; - -#endif /* _JFFS2_FB_SB */ diff --git a/components/dfs/filesystems/jffs2/include/port/codes.h b/components/dfs/filesystems/jffs2/include/port/codes.h deleted file mode 100644 index 2426465c84..0000000000 --- a/components/dfs/filesystems/jffs2/include/port/codes.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef CYGONCE_ERROR_CODES_H -#define CYGONCE_ERROR_CODES_H -/*=========================================================================== -// -// codes.h -// -// Common error code definitions -// -//=========================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//=========================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jlarmour -// Contributors: jlarmour -// Date: 2000-04-14 -// Purpose: To provide a common set of error codes -// Description: This provides a common set of error codes that all -// packages can agree on. It doesn't preclude them defining -// their own error return system, but this is a preferable -// system to use to help error support be as general as -// possible. -// -// We try and conform to the ANSI/POSIX error code format, -// namely starting with the character 'E' -// -// Usage: #include -// -// Example: -// -// err=myfun(); -// if (err != ENOERR) -// { -// str=strerror(err); -// printf("myfun returned error: %s\n", str); -// } -// else .... -// -//####DESCRIPTIONEND#### -// -//=========================================================================*/ - -/* CONFIGURATION */ - -//#include prife // Configuration header - -#ifdef __cplusplus -extern "C" { -#endif - -/* TYPE DEFINITIONS */ - -/* A type for error codes which may be useful to explain the purpose of - * a variable or return code. It shows that it contains an error code - * of the type defined below */ - -typedef int Cyg_ErrNo; - -#include - -#define ENOERR RT_EOK - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* CYGONCE_ERROR_CODES_H multiple inclusion protection */ - -/* EOF codes.h */ diff --git a/components/dfs/filesystems/jffs2/include/port/fcntl.h b/components/dfs/filesystems/jffs2/include/port/fcntl.h deleted file mode 100644 index fcc3088fc7..0000000000 --- a/components/dfs/filesystems/jffs2/include/port/fcntl.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CYGONCE_ISO_FCNTL_H -#define CYGONCE_ISO_FCNTL_H - -/*------------------------------------------------------------------------*/ -/* for dfs_jffs2.c */ -/*------------------------------------------------------------------------*/ -/* File access modes used for open() and fnctl() */ -#define JFFS2_O_RDONLY (O_RDONLY) /* Open for reading only */ -#define JFFS2_O_WRONLY (O_WRONLY) /* Open for writing only */ -#define JFFS2_O_RDWR (O_RDONLY|O_WRONLY) /* Open for reading and writing */ - -/* File access mode mask */ -#define JFFS2_O_ACCMODE (O_RDONLY|O_RDWR|O_WRONLY) - -/* open() mode flags */ - -#define JFFS2_O_CREAT (O_CREAT) /* Create file it it does not exist */ -#define JFFS2_O_EXCL (O_EXCL) /* Exclusive use */ -#define JFFS2_O_NOCTTY (O_NOCTTY) /* Do not assign a controlling terminal */ -#define JFFS2_O_TRUNC (O_TRUNC) /* Truncate */ - -/* File status flags used for open() and fcntl() */ -#define JFFS2_O_APPEND (O_APPEND) /* Set append mode */ -#define JFFS2_O_DSYNC (O_DSYNC) /* Synchronized I/O data integrity writes */ -#define JFFS2_O_NONBLOCK (O_NONBLOCK)/* No delay */ -#define JFFS2_O_RSYNC (O_RSYNC) /* Synchronized read I/O */ -#define JFFS2_O_SYNC (O_SYNC) /* Synchronized I/O file integrity writes */ - -#endif - -/* EOF fcntl.h */ diff --git a/components/dfs/filesystems/jffs2/include/port/sys/stat.h b/components/dfs/filesystems/jffs2/include/port/sys/stat.h deleted file mode 100644 index 43958a752f..0000000000 --- a/components/dfs/filesystems/jffs2/include/port/sys/stat.h +++ /dev/null @@ -1,294 +0,0 @@ -#ifndef CYGONCE_ISO_SYS_TYPES_H -#define CYGONCE_ISO_SYS_TYPES_H -/*======================================================================== -// -// sys/types.h -// -// POSIX types -// -//======================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//======================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jlarmour -// Contributors: -// Date: 2000-04-14 -// Purpose: This file provides various types required by POSIX 1003.1. -// Description: The real contents of this file get set from the -// configuration (set by the implementation) -// Usage: #include -// -//####DESCRIPTIONEND#### -// -//====================================================================== -*/ - -/* CONFIGURATION */ - -//#include -//#include /* Configuration header */ - -/* INCLUDES */ - -/* This is the "standard" way to get size_t from stddef.h, - * which is the canonical location of the definition. - */ -//#define __need_size_t -//#include -#include "port/codes.h" - -/* -#ifndef dev_t -typedef short dev_t; -#endif - -#ifndef ino_t -typedef unsigned int ino_t; -#endif - -#ifndef mode_t -typedef unsigned int mode_t; -#endif -*/ - -typedef unsigned short nlink_t; -typedef long off_t; - -typedef unsigned short gid_t; -typedef unsigned short uid_t; -typedef int pid_t; - -// -typedef void *cyg_io_handle_t; - -/* Variable names for pathconf() */ -#define _PC_ASYNC_IO 1 -#define _PC_CHOWN_RESTRICTED 2 -#define _PC_LINK_MAX 3 -#define _PC_MAX_CANON 4 -#define _PC_MAX_INPUT 5 -#define _PC_NAME_MAX 6 -#define _PC_NO_TRUNC 7 -#define _PC_PATH_MAX 8 -#define _PC_PIPE_BUF 9 -#define _PC_PRIO_IO 10 -#define _PC_SYNC_IO 11 -#define _PC_VDISABLE 12 - -//limit.h -/* DEFINES */ - -/*----------------------------------------------------------------------------- - * Minimum values from POSIX.1 tables 2-3, 2-7 and 2-7a. - - * These are the standard-mandated minimum values. - * These values do not vary with the implementation - they may - * simply be defined - */ - -/* Minimum number of operations in one list I/O call. */ -#define _POSIX_AIO_LISTIO_MAX 2 - -/* Minimal number of outstanding asynchronous I/O operations. */ -#define _POSIX_AIO_MAX 1 - -/* Maximum length of arguments to `execve', including environment. */ -#define _POSIX_ARG_MAX 4096 - -/* Maximum simultaneous processes per real user ID. */ -#define _POSIX_CHILD_MAX 6 - -/* Minimal number of timer expiration overruns. */ -#define _POSIX_DELAYTIMER_MAX 32 - -/* Maximum link count of a file. */ -#define _POSIX_LINK_MAX 8 - -/* Size of storage required for a login name */ -#define _POSIX_LOGIN_NAME_MAX 9 - -/* Number of bytes in a terminal canonical input queue. */ -#define _POSIX_MAX_CANON 255 - -/* Number of bytes for which space will be - available in a terminal input queue. */ -#define _POSIX_MAX_INPUT 255 - -/* Maximum number of message queues open for a process. */ -#define _POSIX_MQ_OPEN_MAX 8 - -/* Maximum number of supported message priorities. */ -#define _POSIX_MQ_PRIO_MAX 32 - -/* Number of bytes in a filename. */ -#define _POSIX_NAME_MAX 14 - -/* Number of simultaneous supplementary group IDs per process. */ -#define _POSIX_NGROUPS_MAX 0 - -/* Number of files one process can have open at once. */ -#define _POSIX_OPEN_MAX 16 - -/* Number of bytes in a pathname. */ -#define _POSIX_PATH_MAX 255 - -/* Number of bytes than can be written atomically to a pipe. */ -#define _POSIX_PIPE_BUF 512 - -/* Minimal number of realtime signals reserved for the application. */ -#define _POSIX_RTSIG_MAX 8 - -/* Number of semaphores a process can have. */ -#define _POSIX_SEM_NSEMS_MAX 256 - -/* Maximal value of a semaphore. */ -#define _POSIX_SEM_VALUE_MAX 32767 - -/* Number of pending realtime signals. */ -#define _POSIX_SIGQUEUE_MAX 32 - -/* Largest value of a `ssize_t'. */ -#define _POSIX_SSIZE_MAX 32767 - -/* Number of streams a process can have open at once. */ -#define _POSIX_STREAM_MAX 8 - -/* Controlling the iterations of destructors for thread-specific data. */ -#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 - -/* The number of data keys per process. */ -#define _POSIX_THREAD_KEYS_MAX 128 - -/* The number of threads per process. */ -#define _POSIX_THREAD_THREADS_MAX 64 - -/* Maximum number of characters in a tty name. */ -#define _POSIX_TTY_NAME_MAX 9 - -/* Number of timer for a process. */ -#define _POSIX_TIMER_MAX 32 - -/* Maximum length of a timezone name (element of `tzname'). */ -#define _POSIX_TZNAME_MAX 3 - -/* Maximum clock resolution in nanoseconds. */ -#define _POSIX_CLOCKRES_MIN 20000000 - - -#ifdef CYGBLD_ISO_SSIZET_HEADER -# include CYGBLD_ISO_SSIZET_HEADER -#else -# ifndef __STRICT_ANSI__ -# define SSIZE_MAX LONG_MAX -# endif -#endif - -/* INCLUDES */ - -#ifdef CYGBLD_ISO_OPEN_MAX_HEADER -# include CYGBLD_ISO_OPEN_MAX_HEADER -#else -# ifndef __STRICT_ANSI__ -# define OPEN_MAX _POSIX_OPEN_MAX -# endif -#endif - -#ifdef CYGBLD_ISO_LINK_MAX_HEADER -# include CYGBLD_ISO_LINK_MAX_HEADER -#else -# ifndef __STRICT_ANSI__ -# define LINK_MAX _POSIX_LINK_MAX -# endif -#endif - -#ifdef CYGBLD_ISO_NAME_MAX_HEADER -# include CYGBLD_ISO_NAME_MAX_HEADER -#else -# ifndef __STRICT_ANSI__ -# define NAME_MAX _POSIX_NAME_MAX -# endif -#endif - -#ifdef CYGBLD_ISO_PATH_MAX_HEADER -# include CYGBLD_ISO_PATH_MAX_HEADER -#else -# ifndef __STRICT_ANSI__ -# define PATH_MAX _POSIX_PATH_MAX -# endif -#endif - -#if CYGINT_ISO_POSIX_LIMITS -# ifdef CYGBLD_ISO_POSIX_LIMITS_HEADER -# include CYGBLD_ISO_POSIX_LIMITS_HEADER -# endif -#endif - - -#define CYGNUM_FILEIO_MTAB_MAX 16 - -//----------------------------------------------- -// stat.h need by fs-ecos.h -//----------------------------------------------- -#define __stat_mode_DIR (1<<0) -#define __stat_mode_CHR (1<<1) -#define __stat_mode_BLK (1<<2) -#define __stat_mode_REG (1<<3) -#define __stat_mode_FIFO (1<<4) -#define __stat_mode_MQ (1<<5) -#define __stat_mode_SEM (1<<6) -#define __stat_mode_SHM (1<<7) -#define __stat_mode_LNK (1<<8) -#define __stat_mode_SOCK (1<<9) - -#if defined(MSVC) -/* for time_t */ -#include -typedef unsigned long mode_t; -typedef unsigned int ino_t; -typedef unsigned int dev_t; -typedef long ssize_t; -#elif defined(__CC_ARM) -#define mode_t unsigned long -typedef unsigned int ino_t; -typedef unsigned int dev_t; -typedef long ssize_t; -typedef long time_t; -#elif defined(__GNUC__) && !defined(__CC_ARM) -#include -#endif - -#endif /* CYGONCE_ISO_SYS_TYPES_H multiple inclusion protection */ - -/* EOF sys/types.h */ - diff --git a/components/dfs/filesystems/jffs2/include/port/sys/types.h b/components/dfs/filesystems/jffs2/include/port/sys/types.h deleted file mode 100644 index ab195a57ea..0000000000 --- a/components/dfs/filesystems/jffs2/include/port/sys/types.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef CYGONCE_ISO_SYS_TYPES_H -#define CYGONCE_ISO_SYS_TYPES_H -/*======================================================================== -// -// sys/types.h -// -// POSIX types -// -//======================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//======================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): jlarmour -// Contributors: -// Date: 2000-04-14 -// Purpose: This file provides various types required by POSIX 1003.1. -// Description: The real contents of this file get set from the -// configuration (set by the implementation) -// Usage: #include -// -//####DESCRIPTIONEND#### -// -//====================================================================== -*/ - -/* CONFIGURATION */ - -//#include -//#include /* Configuration header */ - -/* INCLUDES */ - -/* This is the "standard" way to get size_t from stddef.h, - * which is the canonical location of the definition. - */ -//#define __need_size_t -//#include - -typedef long ssize_t; - -typedef short dev_t; -typedef unsigned int ino_t; -typedef unsigned short nlink_t; -typedef long off_t; - -typedef unsigned short gid_t; -typedef unsigned short uid_t; -typedef int pid_t; - -#if defined(MSVC) -#include -#else -typedef int time_t; -#endif -//#include "os_sys_stat.h" -#endif /* CYGONCE_ISO_SYS_TYPES_H multiple inclusion protection */ - -/* EOF sys/types.h */ - diff --git a/components/dfs/filesystems/jffs2/jffs2_config.h b/components/dfs/filesystems/jffs2/jffs2_config.h deleted file mode 100644 index 3340f1ff17..0000000000 --- a/components/dfs/filesystems/jffs2/jffs2_config.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef JFFS2_CONFIG_H -#define JFFS2_CONFIG_H - -#define __ECOS /* must be defined */ - -#define FILE_PATH_MAX 128 /* the longest file path */ -#define CONFIG_JFFS2_ENTRY_NAME_MAX 23 -#define JFFS2_NAME_MAX CONFIG_JFFS2_ENTRY_NAME_MAX -#define JFFS2_PATH_MAX FILE_PATH_MAX - -#define DEVICE_PART_MAX 1 /* the max partions on a nand deivce*/ - -/* memory page size in kernel/asm/page.h, it is correspond with flash read/write - * option, so this size has a great impact on reading/writing speed */ -#define CONFIG_JFFS2_PAGE_SHIFT 12 /* (1<<12) 4096bytes*/ - -/* jffs2 support relative dir, command "ls" will get - * +-------------------------------+ - * | finsh>>ls("/") | - * | Directory /: | - * | . | - * | .. | - * | dir1 | - * +-------------------------------+ - */ -#define CONFIG_JFFS2_NO_RELATIVEDIR - -//#define CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE -#if defined(CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE) - #define CYGPKG_FILEIO_DIRENT_DTYPE -#endif - -#define CYGOPT_FS_JFFS2_WRITE /* if not defined, jffs2 is read only*/ - -/* jffs2 debug output opion */ -#define CONFIG_JFFS2_FS_DEBUG 0 /* 1 or 2 */ - -/* jffs2 gc thread section */ -//#define CYGOPT_FS_JFFS2_GCTHREAD -#define CYGNUM_JFFS2_GC_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX-2) /* GC thread's priority */ -#define CYGNUM_JFFS2_GS_THREAD_TICKS 20 /* event timeout ticks */ -#define CYGNUM_JFFS2_GC_THREAD_TICKS 20 /* GC thread's running ticks */ - -//#define CONFIG_JFFS2_FS_WRITEBUFFER /* should not be enabled */ - -/* zlib section*/ -//#define CONFIG_JFFS2_ZLIB -//#define CONFIG_JFFS2_RTIME -//#define CONFIG_JFFS2_RUBIN -//#define CONFIG_JFFS2_CMODE_NONE -//#define CONFIG_JFFS2_CMODE_SIZE - -#endif diff --git a/components/dfs/filesystems/jffs2/kernel/asm/atomic.h b/components/dfs/filesystems/jffs2/kernel/asm/atomic.h deleted file mode 100644 index 5cb72ff8ce..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/asm/atomic.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __ASM_ATOMIC_H__ -#define __ASM_ATOMIC_H__ - -#define atomic_t int -#define atomic_inc(atom) (*atom)++ -#define atomic_dec(atom) (*atom)-- -#define atomic_read(atom) (*atom) - - -#endif /* __ASM_ATOMIC_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/asm/bug.h b/components/dfs/filesystems/jffs2/kernel/asm/bug.h deleted file mode 100644 index 054dedc3d3..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/asm/bug.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_BUG_H__ -#define __ASM_BUG_H__ - -#define BUG() do { printf("BUG() at %s %d\n", __FILE__, __LINE__); *(int *)0=0; } while (0) - -#endif /* __ASM_BUG_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/asm/page.h b/components/dfs/filesystems/jffs2/kernel/asm/page.h deleted file mode 100644 index af3081164f..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/asm/page.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __ASM_PAGE_H__ -#define __ASM_PAGE_H__ - -//#include //mod by prife -#include "jffs2_config.h" -#define PAGE_SHIFT CONFIG_JFFS2_PAGE_SHIFT -/* These aren't used by much yet. If that changes, you might want - to make them actually correct :) */ -#define PAGE_SIZE (0x1 << PAGE_SHIFT) - - -#endif /* __ASM_PAGE_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/asm/semaphore.h b/components/dfs/filesystems/jffs2/kernel/asm/semaphore.h deleted file mode 100644 index 94a4f3abd9..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/asm/semaphore.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef __ASM_SEMAPHORE_H__ -#define __ASM_SEMAPHORE_H__ - -#define CONFIG_JFFS2_SEMAPHORE 0 // no mutex, 1 use static, 2 use dynamic -#if CONFIG_JFFS2_SEMAPHORE == 0 -//#include - -struct semaphore { - int x; -}; - -#define DECLARE_MUTEX(x) -#define DECLARE_MUTEX_LOCKED(x) - -#define init_MUTEX(sem) -#define init_MUTEX_LOCKED(sem) -#define down(sem) -#define down_interruptible(sem) 0 -#define down_trylock(sem) -#define up(sem) - -#elif CONFIG_JFFS2_SEMAPHORE == 1 -#include - -struct semaphore { - struct rt_mutex mutex; -}; - -#define DECLARE_MUTEX(x) -#define DECLARE_MUTEX_LOCKED(x) -rt_inline void init_MUTEX(struct semaphore * sem) -{ - if (rt_mutex_init((rt_mutex_t)sem, "mutex", RT_IPC_FLAG_FIFO) == RT_EOK) - { - /* detach the object from system object container */ - rt_object_detach(&(((rt_mutex_t)sem)->parent.parent)); - return; - } - rt_kprintf("get an error at %s:%d \n", __FUNCTION__, __LINE__); - RT_ASSERT(0); -} - -rt_inline void init_MUTEX_LOCKED(struct semaphore * sem) -{ - rt_enter_critical(); - if (rt_mutex_init((rt_mutex_t)sem, "mutex", RT_IPC_FLAG_FIFO) == RT_EOK) - { - /* detach the object from system object container */ - rt_object_detach(&(((rt_mutex_t)sem)->parent.parent)); - rt_exit_critical(); - rt_mutex_take((rt_mutex_t)sem, RT_WAITING_FOREVER); - return; - } - rt_exit_critical(); - - rt_kprintf("get an error at %s:%d \n", __FUNCTION__, __LINE__); - RT_ASSERT(0); -} - -rt_inline down(struct semaphore * sem) -{ - rt_mutex_take((rt_mutex_t)sem, RT_WAITING_FOREVER); -} -rt_inline int down_interruptible(struct semaphore* sem) -{ - rt_mutex_take((rt_mutex_t)sem, RT_WAITING_FOREVER); - return 0; -} -rt_inline up(struct semaphore * sem) -{ - rt_mutex_release((rt_mutex_t)sem); -} -#elif CONFIG_JFFS2_SEMAPHORE == 2 - -#include - -struct semaphore { - rt_mutex_t mutex; -}; - -#define DECLARE_MUTEX(x) -#define DECLARE_MUTEX_LOCKED(x) - -rt_inline void init_MUTEX(struct semaphore * sem) -{ - sem->mutex = rt_mutex_create("mutex", RT_IPC_FLAG_FIFO); -} -rt_inline init_MUTEX_LOCKED(struct semaphore * sem) -{ - sem->mutex = rt_mutex_create("mutex", RT_IPC_FLAG_FIFO); - rt_mutex_take(sem->mutex, RT_WAITING_FOREVER); -} -rt_inline down(struct semaphore * sem) -{ - rt_mutex_take(sem->mutex, RT_WAITING_FOREVER); -} -rt_inline int down_interruptible(struct semaphore* sem) -{ - rt_mutex_take(sem->mutex, RT_WAITING_FOREVER); - return 0; -} -/* -Attempt to lock the mutex pointed to by the mutex argument without waiting. -If the mutex is already locked by some other thread then this function -returns FALSE. If the function can lock the mutex without waiting, then -TRUE is returned. -void cyg_drv_mutex_unlock( cyg_drv_mutex *mutex ) -*/ - -//#define down_trylock(struct semaphore * sem) rt_mutex_take((rt_mutex_t)sem, RT_WAITING_NO) -rt_inline up(struct semaphore * sem) -{ - rt_mutex_release(sem->mutex); -} - -#else -#error "CONFIG_JFFS2_SEMAPHORE should be 0, 1 or 2" -#endif - -#endif /* __ASM_SEMAPHORE_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/TODO b/components/dfs/filesystems/jffs2/kernel/linux/TODO deleted file mode 100644 index df8a6d1a51..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/TODO +++ /dev/null @@ -1,11 +0,0 @@ - -This contains a very limited set of Linux-compatibility headers, initially -just for getting JFFS2 to build. - -Some things are simply stubs which don't _work_, to allow the JFFS2 code -to compile. Note that you may need to implement these _properly_ in order -to use these for making other Linux code work, or indeed for making the -JFFS2 NAND support work. - -The non-working parts include, but are not limited to: - workqueue.h, wait.h, timer.h, spinlock.h, sched.h, compiler.h diff --git a/components/dfs/filesystems/jffs2/kernel/linux/compiler.h b/components/dfs/filesystems/jffs2/kernel/linux/compiler.h deleted file mode 100644 index fb253651a3..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/compiler.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __LINUX_COMPILER_H__ -#define __LINUX_COMPILER_H__ - -#define likely(x) (x) -#define unlikely(x) (x) - -#endif /* __LINUX_COMPILER_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/completion.h b/components/dfs/filesystems/jffs2/kernel/linux/completion.h deleted file mode 100644 index d2493b2710..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/completion.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __LINUX_COMPLETION_H__ -#define __LINUX_COMPLETION_H__ - -#if defined (__GNUC__) -struct completion { } ; -#elif defined (MSVC) -struct completion {int no; } ; -#else -#error "please use a right C compiler" -#endif - -#endif /* __LINUX_COMPLETION_H__ */ - diff --git a/components/dfs/filesystems/jffs2/kernel/linux/config.h b/components/dfs/filesystems/jffs2/kernel/linux/config.h deleted file mode 100644 index 355e175f65..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __LINUX_CONFIG_H__ -#define __LINUX_CONFIG_H__ - -#define GFP_KERNEL 0 - -/* #define CONFIG_JFFS2_FS_WRITEBUFFER 0 */ -/* #define CONFIG_JFFS2_PROC */ -/* #define CONFIG_JFFS2_RTIME */ -/* #define CONFIG_JFFS2_RUBIN */ -/* #define CONFIG_JFFS2_ZLIB */ - -#endif /* __LINUX_CONFIG_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/crc32.h b/components/dfs/filesystems/jffs2/kernel/linux/crc32.h deleted file mode 100644 index 8d19a1eb62..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/crc32.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CRC32_H -#define CRC32_H - -#include - -#define crc32(val, s, len) cyg_crc32_accumulate(val, (unsigned char *)s, len) - -#endif diff --git a/components/dfs/filesystems/jffs2/kernel/linux/errno.h b/components/dfs/filesystems/jffs2/kernel/linux/errno.h deleted file mode 100644 index 2938632411..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/errno.h +++ /dev/null @@ -1,2 +0,0 @@ -//#include -#include "port/codes.h" //fixme diff --git a/components/dfs/filesystems/jffs2/kernel/linux/fs.h b/components/dfs/filesystems/jffs2/kernel/linux/fs.h deleted file mode 100644 index 94f493c91a..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/fs.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __LINUX_FS_H__ -#define __LINUX_FS_H__ - -#include - -#endif /* __LINUX_FS_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/init.h b/components/dfs/filesystems/jffs2/kernel/linux/init.h deleted file mode 100644 index e4c702f996..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/init.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef __LINUX_INIT_H__ -#define __LINUX_INIT_H__ -#endif diff --git a/components/dfs/filesystems/jffs2/kernel/linux/kernel.h b/components/dfs/filesystems/jffs2/kernel/linux/kernel.h deleted file mode 100644 index a0c94a1996..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/kernel.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __LINUX_KERNEL_H__ -#define __LINUX_KERNEL_H__ -//#include -//#include //mod by prife @ 2011/11/20 -#include "jffs2_config.h" - -#define jiffies 100 - -#define ERR_PTR(err) ((void*)(err)) -#define PTR_ERR(err) ((unsigned long)(err)) -#define IS_ERR(err) ((unsigned long)err > (unsigned long)-1000L) - -#define CURRENT_TIME jffs2_get_timestamp() - -#define KERN_EMERG "<0>" // system is unusable -#define KERN_ALERT "<1>" // action must be taken immediately -#define KERN_CRIT "<2>" // critical conditions -#define KERN_ERR "<3>" // error conditions -#define KERN_WARNING "<4>" // warning conditions -#define KERN_NOTICE "<5>" // normal but significant condition -#define KERN_INFO "<6>" // informational -#define KERN_DEBUG "<7>" // debug-level messages -#define printk rt_kprintf//diag_printf //mod by prife - -#ifndef min //mod by prife -#define min(x,y) (x - * - *=========================================================================== - * ####ECOSGPLCOPYRIGHTBEGIN#### - * ------------------------------------------- - * This file is part of eCos, the Embedded Configurable Operating System. - * Copyright (C) 2002, 2003 Free Software Foundation, Inc. - * - * eCos is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 or (at your option) any later - * version. - * - * eCos is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * along with eCos; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * As a special exception, if other files instantiate templates or use - * macros or inline functions from this file, or you compile this file - * and link it with other works to produce a work based on this file, - * this file does not by itself cause the resulting work to be covered by - * the GNU General Public License. However the source code for this file - * must still be made available in accordance with section (3) of the GNU - * General Public License v2. - * - * This exception does not invalidate any other reasons why a work based - * on this file might be covered by the GNU General Public License. - * ------------------------------------------- - * ####ECOSGPLCOPYRIGHTEND#### - *=========================================================================== - * - */ - -#ifndef CYGONCE_FS_JFFS2_LIST_H -#define CYGONCE_FS_JFFS2_LIST_H - - -/* -----------------------------------------------------------------------*/ - -/* Doubly linked list implementation to replace the GPL'd one used in - the Linux kernel. */ - -#include -#include - -/* TYPES */ - -struct list_head { - struct list_head *next; - struct list_head *prev; -}; - -/* MACROS */ - -#define LIST_HEAD_INIT(name) { &(name), &(name) } - -#define LIST_HEAD(name) \ - struct list_head name = LIST_HEAD_INIT(name) - -#define INIT_LIST_HEAD( _list_ ) \ -CYG_MACRO_START \ -(_list_)->next = (_list_)->prev = (_list_); \ -CYG_MACRO_END - -/* FUNCTIONS */ - -/* Insert an entry _after_ the specified entry */ -static __inline__ void -list_add( struct list_head *newent, struct list_head *afterthisent ) -{ - struct list_head *next = afterthisent->next; - newent->next = next; - newent->prev = afterthisent; - afterthisent->next = newent; - next->prev = newent; -} /* list_add() */ - -/* Insert an entry _before_ the specified entry */ -static __inline__ void -list_add_tail( struct list_head *newent, struct list_head *beforethisent ) -{ - struct list_head *prev = beforethisent->prev; - newent->prev = prev; - newent->next = beforethisent; - beforethisent->prev = newent; - prev->next = newent; -} /* list_add_tail() */ - -/* Delete the specified entry */ -static __inline__ void -list_del( struct list_head *ent ) -{ - ent->prev->next = ent->next; - ent->next->prev = ent->prev; -} /* list_del() */ - -/* Is this list empty? */ -static __inline__ int -list_empty( struct list_head *list ) -{ - return ( list->next == list ); -} /* list_empty() */ - -/* list_entry - Assuming you have a struct of type _type_ that contains a - list which has the name _member_ in that struct type, then given the - address of that list in the struct, _list_, this returns the address - of the container structure */ - -#define list_entry( _list_, _type_, _member_ ) \ - ((_type_ *)((char *)(_list_)-(char *)(offsetof(_type_,_member_)))) - -/* list_for_each - using _ent_, iterate through list _list_ */ - -#define list_for_each( _ent_, _list_ ) \ - for ( (_ent_) = (_list_)->next; \ - (_ent_) != (_list_); \ - (_ent_) = (_ent_)->next ) - -/* - * list_for_each_entry - this function can be use to iterate over all - * items in a list* _list_ with it's head at _head_ and link _item_ - */ -#if defined (__GNUC__) -#define list_for_each_entry(_list_, _head_, _item_) \ -for ((_list_) = list_entry((_head_)->next, typeof(*_list_), _item_); \ - &((_list_)->_item_) != (_head_); \ - (_list_) = list_entry((_list_)->_item_.next, typeof(*_list_), _item_)) - -#elif defined (MSVC) -#define list_for_each_entry(_list_, _head_, _item_) \ -for ((_list_) = list_entry((_head_)->next, struct jffs2_compressor, _item_); \ - &((_list_)->_item_) != (_head_); \ - (_list_) = list_entry((_list_)->_item_.next, struct jffs2_compressor, _item_)) -#else -#endif -/* -----------------------------------------------------------------------*/ -#endif /* #ifndef CYGONCE_FS_JFFS2_LIST_H */ -/* EOF list.h */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/mtd/compatmac.h b/components/dfs/filesystems/jffs2/kernel/linux/mtd/compatmac.h deleted file mode 100644 index cee3749250..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/mtd/compatmac.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __LINUX_MTD_COMPATMAC_H__ -#define __LINUX_MTD_COMPATMAC_H__ - - -#endif /* __LINUX_MTD_COMPATMAC_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/mtd/mtd.h b/components/dfs/filesystems/jffs2/kernel/linux/mtd/mtd.h deleted file mode 100644 index 817d31cf6f..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/mtd/mtd.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __LINUX_MTD_MTD_H__ -#define __LINUX_MTD_MTD_H__ - - -#endif /* __LINUX_MTD_MTD_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/pagemap.h b/components/dfs/filesystems/jffs2/kernel/linux/pagemap.h deleted file mode 100644 index fccf9c4061..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/pagemap.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __LINUX_PAGEMAP_H__ -#define __LINUX_PAGEMAP_H__ - -#include -#include - -#define PAGE_CACHE_SHIFT PAGE_SHIFT -#define PAGE_CACHE_SIZE PAGE_SIZE - -#define PageLocked(pg) 1 -#define Page_Uptodate(pg) 0 -#define UnlockPage(pg) -#define PAGE_BUG(pg) BUG() -#define ClearPageUptodate(pg) -#define SetPageError(pg) -#define ClearPageError(pg) -#define SetPageUptodate(pg) - -#endif /* __LINUX_PAGEMAP_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/rbtree.h b/components/dfs/filesystems/jffs2/kernel/linux/rbtree.h deleted file mode 100644 index ffda277e88..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/rbtree.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _LINUX_RBTREE_H -#define _LINUX_RBTREE_H - -#if defined (__GNUC__) -#elif defined (MSVC) -#define __inline__ __inline -#define inline __inline -#else -#endif - -struct rb_node { - struct rb_node *rb_left; /* left element */ - struct rb_node *rb_right; /* right element */ - struct rb_node *rb_parent; /* parent element */ - int rb_color; /* node color */ -}; - -struct rb_root { - struct rb_node *rb_node; /* root of the tree */ -}; - -#ifndef NULL -#define NULL ((void *)0) -#endif - -#if defined (__GNUC__) -#define RB_ROOT ((struct rb_root){NULL}) -#elif defined (MSVC) -#define RB_ROOT {NULL}//{struct rb_root _x = {NULL};} -#else -#endif - -#define rb_entry(p, container, field) \ - ((container *) ((char *)p - ((char *)&(((container *)0)->field)))) - -#define RB_BLACK 0 -#define RB_RED 1 - - -extern void rb_insert_color(struct rb_node *, struct rb_root *); -extern void rb_erase(struct rb_node *, struct rb_root *); - -/* Find logical next and previous nodes in a tree */ -extern struct rb_node *rb_next(struct rb_node *); -extern struct rb_node *rb_prev(struct rb_node *); -extern struct rb_node *rb_first(struct rb_root *); - -/* Fast replacement of a single node without remove/rebalance/add/rebalance */ -extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, - struct rb_root *root); - -static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, - struct rb_node ** rb_link) -{ - node->rb_parent = parent; - node->rb_color = RB_RED; - node->rb_left = node->rb_right = NULL; - - *rb_link = node; -} - -#endif /* _LINUX_RBTREE_H */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/rwsem.h b/components/dfs/filesystems/jffs2/kernel/linux/rwsem.h deleted file mode 100644 index d648a150ca..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/rwsem.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __LINUX_RWSEM_H__ -#define __LINUX_RWSEM_H__ - -// eCos does not have the concept of a read/write semaphore. So just -// map them onto normal semaphores and hope we don't deadlock -// somewhere. - -#include - -struct rw_semaphore; - -#define down_read(sem) cyg_drv_mutex_lock((cyg_drv_mutex_t *)sem) -#define down_read_trylock(sem) cyg_drv_mutex_trylock((cyg_drv_mutex_t *)sem) -#define down_write(sem) cyg_drv_mutex_lock((cyg_drv_mutex_t *)sem) -#define down_write_trylock(sem) cyg_drv_mutex_trylock((cyg_drv_mutex_t *)sem) -#define up_read(sem) cyg_drv_mutex_unlock((cyg_drv_mutex_t *)sem) -#define up_write(sem) cyg_drv_mutex_unlock((cyg_drv_mutex_t *)sem) -#define downgrade_write(sem) - -#endif // __LINUX_RWSEM_H__ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/sched.h b/components/dfs/filesystems/jffs2/kernel/linux/sched.h deleted file mode 100644 index 14a7359754..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/sched.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __LINUX_SCHED_H__ -#define __LINUX_SCHED_H__ - -#define cond_resched() do { } while(0) -#define signal_pending(x) (0) - -#endif /* __LINUX_SCHED_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/slab.h b/components/dfs/filesystems/jffs2/kernel/linux/slab.h deleted file mode 100644 index f5c5745b0e..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/slab.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __LINUX_SLAB_H__ -#define __LINUX_SLAB_H__ - -//#include //prife - -#include /* Don't ask. Linux headers are a mess. */ - -#define kmalloc(x, y) rt_malloc(x) -#define kfree(x) rt_free(x) -#define vmalloc(x) rt_malloc(x) -#define vfree(x) rt_free(x) - -#endif /* __LINUX_SLAB_H__ */ - diff --git a/components/dfs/filesystems/jffs2/kernel/linux/spinlock.h b/components/dfs/filesystems/jffs2/kernel/linux/spinlock.h deleted file mode 100644 index db3f4d4502..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/spinlock.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __LINUX_SPINLOCK_H__ -#define __LINUX_SPINLOCK_H__ - -#if defined (__GNUC__) -typedef struct { } spinlock_t; - -#define SPIN_LOCK_UNLOCKED (spinlock_t) { } -#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED -#elif defined (MSVC) -typedef struct {int no; } spinlock_t; - -#define SPIN_LOCK_UNLOCKED (spinlock_t) ( 0) -#define DEFINE_SPINLOCK(x) spinlock_t x -#else -#error "please use a right C compiler" -#endif - -#define spin_lock_init(lock) \ -CYG_MACRO_START; \ -CYG_UNUSED_PARAM(spinlock_t *, lock); \ -CYG_MACRO_END - -#define spin_lock(lock) \ -CYG_MACRO_START; \ -CYG_UNUSED_PARAM(spinlock_t *, lock); \ -CYG_MACRO_END - -#define spin_unlock(lock) \ -CYG_MACRO_START; \ -CYG_UNUSED_PARAM(spinlock_t *, lock); \ -CYG_MACRO_END - -#define spin_lock_bh(lock) \ -CYG_MACRO_START; \ -CYG_UNUSED_PARAM(spinlock_t *, lock); \ -CYG_MACRO_END - -#define spin_unlock_bh(lock) \ -CYG_MACRO_START; \ -CYG_UNUSED_PARAM(spinlock_t *, lock); \ -CYG_MACRO_END - -#endif /* __LINUX_SPINLOCK_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/stat.h b/components/dfs/filesystems/jffs2/kernel/linux/stat.h deleted file mode 100644 index 8c79205229..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/stat.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __LINUX_STAT_H__ -#define __LINUX_STAT_H__ - - -#include "port/sys/stat.h" //mod by prife - -#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) -#define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) -#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) -#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) - -#endif /* __LINUX_STAT_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/string.h b/components/dfs/filesystems/jffs2/kernel/linux/string.h deleted file mode 100644 index fc14ba607f..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/string.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __LINUX_STRING_H__ -#define __LINUX_STRING_H__ - -#include - -#endif /* __LINUX_STRING_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/timer.h b/components/dfs/filesystems/jffs2/kernel/linux/timer.h deleted file mode 100644 index d6f91a68bc..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/timer.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __LINUX_TIMER_H__ -#define __LINUX_TIMER_H__ - -/* Not yet */ - -#if defined (__GNUC__) -struct timer_list { } ; -#elif defined (MSVC) -struct timer_list {int no; } ; -#else -#error "please use a right C compiler" -#endif - -#endif /* __LINUX_TIMER_H__ */ - diff --git a/components/dfs/filesystems/jffs2/kernel/linux/types.h b/components/dfs/filesystems/jffs2/kernel/linux/types.h deleted file mode 100644 index bfa09c14c0..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/types.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __LINUX_TYPES_H__ -#define __LINUX_TYPES_H__ - -#include "cyg/infra/cyg_type.h" - -#define loff_t off_t - -#define kvec iovec -#endif /* __LINUX_TYPES_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/version.h b/components/dfs/filesystems/jffs2/kernel/linux/version.h deleted file mode 100644 index cd3a45aa38..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/version.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __LINUX_VERSION_H__ -#define __LINUX_VERSION_H__ - -#include - -#endif /* __LINUX_VERSION_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/vmalloc.h b/components/dfs/filesystems/jffs2/kernel/linux/vmalloc.h deleted file mode 100644 index 6f18ab2255..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/vmalloc.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef __LINUX_VMALLOC_H__ -#define __LINUX_VMALLOC_H__ -#endif diff --git a/components/dfs/filesystems/jffs2/kernel/linux/wait.h b/components/dfs/filesystems/jffs2/kernel/linux/wait.h deleted file mode 100644 index db3fd7a608..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/wait.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __LINUX_WAIT_H__ -#define __LINUX_WAIT_H__ - - -#if defined (__GNUC__) -typedef struct { } wait_queue_head_t; -#elif defined (MSVC) -typedef struct {int no; } wait_queue_head_t; -#else -#error "please use a right C compiler" -#endif - -#define init_waitqueue_head(wait) do{} while (0) -#define add_wait_queue(wait,new_wait) do{} while (0) -#define remove_wait_queue(wait,old_wait) do{} while (0) -#define DECLARE_WAITQUEUE(wait,current) do{} while (0) - -static inline void wake_up(wait_queue_head_t *erase_wait) -{ /* Only used for waking up threads blocks on erases. Not used in eCos */ } - -#endif /* __LINUX_WAIT_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/workqueue.h b/components/dfs/filesystems/jffs2/kernel/linux/workqueue.h deleted file mode 100644 index 8b334d5593..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/workqueue.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __LINUX_WORKQUEUE_H__ -#define __LINUX_WORKQUEUE_H__ - -/* We don't do this yet */ -#if defined (__GNUC__) -struct work_struct { } ; -#elif defined (MSVC) -struct work_struct {int no; } ; -#else -#error "please use a right C compiler" -#endif - - -#define INIT_WORK(x,y,z) /* */ -#define schedule_work(x) do { } while(0) -#define flush_scheduled_work() do { } while(0) - -#endif /* __LINUX_WORKQUEUE_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/zlib.h b/components/dfs/filesystems/jffs2/kernel/linux/zlib.h deleted file mode 100644 index 4c32b68c9c..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/zlib.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __LINUX_ZLIB_H__ -#define __LINUX_ZLIB_H__ - -#include - -#define zlib_deflateInit(x,y) deflateInit(x,y) -#define zlib_deflate(x,y) deflate(x,y) -#define zlib_deflateEnd(x) deflateEnd(x) -#define zlib_inflateInit(x) inflateInit(x) -#define zlib_inflateInit2(x,y) inflateInit2(x,y) -#define zlib_inflate(x,y) inflate(x,y) -#define zlib_inflateEnd(x) inflateEnd(x) - - -#endif /* __LINUX_ZLIB_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/linux/zutil.h b/components/dfs/filesystems/jffs2/kernel/linux/zutil.h deleted file mode 100644 index c3774baf9e..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/linux/zutil.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __LINUX_ZUTIL_H__ -#define __LINUX_ZUTIL_H__ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - -#endif /* __LINUX_ZUTIL_H__ */ diff --git a/components/dfs/filesystems/jffs2/kernel/rbtree.c b/components/dfs/filesystems/jffs2/kernel/rbtree.c deleted file mode 100644 index 5bc1cc53e2..0000000000 --- a/components/dfs/filesystems/jffs2/kernel/rbtree.c +++ /dev/null @@ -1,408 +0,0 @@ -/*======================================================================== -// -// rbtree.c -// -// Red Black tree implementation -// -//======================================================================== -// ####ECOSGPLCOPYRIGHTBEGIN#### -// ------------------------------------------- -// This file is part of eCos, the Embedded Configurable Operating System. -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -// -// eCos is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 or (at your option) any later -// version. -// -// eCos is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License -// along with eCos; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -// As a special exception, if other files instantiate templates or use -// macros or inline functions from this file, or you compile this file -// and link it with other works to produce a work based on this file, -// this file does not by itself cause the resulting work to be covered by -// the GNU General Public License. However the source code for this file -// must still be made available in accordance with section (3) of the GNU -// General Public License v2. -// -// This exception does not invalidate any other reasons why a work based -// on this file might be covered by the GNU General Public License. -// ------------------------------------------- -// ####ECOSGPLCOPYRIGHTEND#### -//======================================================================== -//#####DESCRIPTIONBEGIN#### -// -// Author(s): Niels Provos/OpenBSD -// Contributors: dwmw2 -// Date: 2003-01-21 -// Purpose: This file provides an implementation of red-black trees. -// Description: Derived from OpenBSD src/sys/sys/tree.h -// Usage: -// -//####DESCRIPTIONEND#### -// -//====================================================================== -*/ - -/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ -/* - * Copyright 2002 Niels Provos - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* Fields renamed to match Linux ones. */ -#include - - -#define RB_HEAD(head) (head)->rb_node -#define RB_LEFT(elm) (elm)->rb_left -#define RB_RIGHT(elm) (elm)->rb_right -#define RB_PARENT(elm) (elm)->rb_parent -#define RB_COLOR(elm) (elm)->rb_color - - -#define RB_SET(elm, parent) do { \ - RB_PARENT(elm) = parent; \ - RB_LEFT(elm) = RB_RIGHT(elm) = NULL; \ - RB_COLOR(elm) = RB_RED; \ -} while (0) - -#define RB_SET_BLACKRED(black, red) do { \ - RB_COLOR(black) = RB_BLACK; \ - RB_COLOR(red) = RB_RED; \ -} while (0) - -#ifndef RB_AUGMENT -#define RB_AUGMENT(x) -#endif - -#define RB_ROTATE_LEFT(head, elm, tmp) do { \ - (tmp) = RB_RIGHT(elm); \ - if ((RB_RIGHT(elm) = RB_LEFT(tmp))) { \ - RB_PARENT(RB_LEFT(tmp)) = (elm); \ - } \ - RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp) = RB_PARENT(elm))) { \ - if ((elm) == RB_LEFT(RB_PARENT(elm))) \ - RB_LEFT(RB_PARENT(elm)) = (tmp); \ - else \ - RB_RIGHT(RB_PARENT(elm)) = (tmp); \ - } else \ - (head)->rb_node = (tmp); \ - RB_LEFT(tmp) = (elm); \ - RB_PARENT(elm) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp))) \ - RB_AUGMENT(RB_PARENT(tmp)); \ -} while (0) - -#define RB_ROTATE_RIGHT(head, elm, tmp) do { \ - (tmp) = RB_LEFT(elm); \ - if ((RB_LEFT(elm) = RB_RIGHT(tmp))) { \ - RB_PARENT(RB_RIGHT(tmp)) = (elm); \ - } \ - RB_AUGMENT(elm); \ - if ((RB_PARENT(tmp) = RB_PARENT(elm))) { \ - if ((elm) == RB_LEFT(RB_PARENT(elm))) \ - RB_LEFT(RB_PARENT(elm)) = (tmp); \ - else \ - RB_RIGHT(RB_PARENT(elm)) = (tmp); \ - } else \ - (head)->rb_node = (tmp); \ - RB_RIGHT(tmp) = (elm); \ - RB_PARENT(elm) = (tmp); \ - RB_AUGMENT(tmp); \ - if ((RB_PARENT(tmp))) \ - RB_AUGMENT(RB_PARENT(tmp)); \ -} while(0) - -/* Note args swapped to match Linux */ -void rb_insert_color(struct rb_node *elm, struct rb_root *head) -{ - struct rb_node *parent, *gparent, *tmp; - while ((parent = RB_PARENT(elm)) && - RB_COLOR(parent) == RB_RED) { - gparent = RB_PARENT(parent); - if (parent == RB_LEFT(gparent)) { - tmp = RB_RIGHT(gparent); - if (tmp && RB_COLOR(tmp) == RB_RED) { - RB_COLOR(tmp) = RB_BLACK; - RB_SET_BLACKRED(parent, gparent); - elm = gparent; - continue; - } - if (RB_RIGHT(parent) == elm) { - RB_ROTATE_LEFT(head, parent, tmp); - tmp = parent; - parent = elm; - elm = tmp; - } - RB_SET_BLACKRED(parent, gparent); - RB_ROTATE_RIGHT(head, gparent, tmp); - } else { - tmp = RB_LEFT(gparent); - if (tmp && RB_COLOR(tmp) == RB_RED) { - RB_COLOR(tmp) = RB_BLACK; - RB_SET_BLACKRED(parent, gparent); - elm = gparent; - continue; - } - if (RB_LEFT(parent) == elm) { - RB_ROTATE_RIGHT(head, parent, tmp); - tmp = parent; - parent = elm; - elm = tmp; - } - RB_SET_BLACKRED(parent, gparent); - RB_ROTATE_LEFT(head, gparent, tmp); - } - } - RB_COLOR(head->rb_node) = RB_BLACK; -} - - -static void rb_remove_color(struct rb_root *head, struct rb_node *parent, - struct rb_node *elm) -{ - struct rb_node *tmp; - while ((elm == NULL || RB_COLOR(elm) == RB_BLACK) && - elm != RB_HEAD(head)) { - if (RB_LEFT(parent) == elm) { - tmp = RB_RIGHT(parent); - if (RB_COLOR(tmp) == RB_RED) { - RB_SET_BLACKRED(tmp, parent); - RB_ROTATE_LEFT(head, parent, tmp); - tmp = RB_RIGHT(parent); - } - if ((RB_LEFT(tmp) == NULL || - RB_COLOR(RB_LEFT(tmp)) == RB_BLACK) && - (RB_RIGHT(tmp) == NULL || - RB_COLOR(RB_RIGHT(tmp)) == RB_BLACK)) { - RB_COLOR(tmp) = RB_RED; - elm = parent; - parent = RB_PARENT(elm); - } else { - if (RB_RIGHT(tmp) == NULL || - RB_COLOR(RB_RIGHT(tmp)) == RB_BLACK) { - struct rb_node *oleft; - if ((oleft = RB_LEFT(tmp))) - RB_COLOR(oleft) = RB_BLACK; - RB_COLOR(tmp) = RB_RED; - RB_ROTATE_RIGHT(head, tmp, oleft); - tmp = RB_RIGHT(parent); - } - RB_COLOR(tmp) = RB_COLOR(parent); - RB_COLOR(parent) = RB_BLACK; - if (RB_RIGHT(tmp)) - RB_COLOR(RB_RIGHT(tmp)) = RB_BLACK; - RB_ROTATE_LEFT(head, parent, tmp); - elm = RB_HEAD(head); - break; - } - } else { - tmp = RB_LEFT(parent); - if (RB_COLOR(tmp) == RB_RED) { - RB_SET_BLACKRED(tmp, parent); - RB_ROTATE_RIGHT(head, parent, tmp); - tmp = RB_LEFT(parent); - } - if ((RB_LEFT(tmp) == NULL || - RB_COLOR(RB_LEFT(tmp)) == RB_BLACK) && - (RB_RIGHT(tmp) == NULL || - RB_COLOR(RB_RIGHT(tmp)) == RB_BLACK)) { - RB_COLOR(tmp) = RB_RED; - elm = parent; - parent = RB_PARENT(elm); - } else { - if (RB_LEFT(tmp) == NULL || - RB_COLOR(RB_LEFT(tmp)) == RB_BLACK) { - struct rb_node *oright; - if ((oright = RB_RIGHT(tmp))) - RB_COLOR(oright) = RB_BLACK; - RB_COLOR(tmp) = RB_RED; - RB_ROTATE_LEFT(head, tmp, oright); - tmp = RB_LEFT(parent); - } - RB_COLOR(tmp) = RB_COLOR(parent); - RB_COLOR(parent) = RB_BLACK; - if (RB_LEFT(tmp)) - RB_COLOR(RB_LEFT(tmp)) = RB_BLACK; - RB_ROTATE_RIGHT(head, parent, tmp); - elm = RB_HEAD(head); - break; - } - } - } - if (elm) - RB_COLOR(elm) = RB_BLACK; -} - -/* Note name changed. Guess why :) */ -void rb_erase(struct rb_node *elm, struct rb_root *head) -{ - struct rb_node *child, *parent, *old = elm; - int color; - if (RB_LEFT(elm) == NULL) - child = RB_RIGHT(elm); - else if (RB_RIGHT(elm) == NULL) - child = RB_LEFT(elm); - else { - struct rb_node *left; - elm = RB_RIGHT(elm); - while ((left = RB_LEFT(elm))) - elm = left; - child = RB_RIGHT(elm); - parent = RB_PARENT(elm); - color = RB_COLOR(elm); - if (child) - RB_PARENT(child) = parent; - if (parent) { - if (RB_LEFT(parent) == elm) - RB_LEFT(parent) = child; - else - RB_RIGHT(parent) = child; - RB_AUGMENT(parent); - } else - RB_HEAD(head) = child; - if (RB_PARENT(elm) == old) - parent = elm; - *(elm) = *(old); - if (RB_PARENT(old)) { - if (RB_LEFT(RB_PARENT(old)) == old) - RB_LEFT(RB_PARENT(old)) = elm; - else - RB_RIGHT(RB_PARENT(old)) = elm; - RB_AUGMENT(RB_PARENT(old)); - } else - RB_HEAD(head) = elm; - RB_PARENT(RB_LEFT(old)) = elm; - if (RB_RIGHT(old)) - RB_PARENT(RB_RIGHT(old)) = elm; - if (parent) { - left = parent; - do { - RB_AUGMENT(left); - } while ((left = RB_PARENT(left))); - } - goto color; - } - parent = RB_PARENT(elm); - color = RB_COLOR(elm); - if (child) - RB_PARENT(child) = parent; - if (parent) { - if (RB_LEFT(parent) == elm) - RB_LEFT(parent) = child; - else - RB_RIGHT(parent) = child; - RB_AUGMENT(parent); - } else - RB_HEAD(head) = child; -color: - if (color == RB_BLACK) - rb_remove_color(head, parent, child); -} - -struct rb_node *rb_next(struct rb_node *elm) -{ - if (RB_RIGHT(elm)) { - elm = RB_RIGHT(elm); - while (RB_LEFT(elm)) - elm = RB_LEFT(elm); - } else { - if (RB_PARENT(elm) && - (elm == RB_LEFT(RB_PARENT(elm)))) - elm = RB_PARENT(elm); - else { - while (RB_PARENT(elm) && - (elm == RB_RIGHT(RB_PARENT(elm)))) - elm = RB_PARENT(elm); - elm = RB_PARENT(elm); - } - } - return (elm); -} - -struct rb_node *rb_prev(struct rb_node *elm) -{ - if (RB_LEFT(elm)) { - elm = RB_LEFT(elm); - while (RB_RIGHT(elm)) - elm = RB_RIGHT(elm); - } else { - if (RB_PARENT(elm) && - (elm == RB_RIGHT(RB_PARENT(elm)))) - elm = RB_PARENT(elm); - else { - while (RB_PARENT(elm) && - (elm == RB_LEFT(RB_PARENT(elm)))) - elm = RB_PARENT(elm); - elm = RB_PARENT(elm); - } - } - return (elm); -} - -/* These ones are lifted from Linux -- but that's OK because I - wrote them. dwmw2. */ -struct rb_node *rb_first(struct rb_root *root) -{ - struct rb_node *n; - - n = root->rb_node; - if (!n) - return 0; - while (n->rb_left) - n = n->rb_left; - return n; -} - -void rb_replace_node(struct rb_node *victim, struct rb_node *new, - struct rb_root *root) -{ - struct rb_node *parent = victim->rb_parent; - - /* Set the surrounding nodes to point to the replacement */ - if (parent) { - if (victim == parent->rb_left) - parent->rb_left = new; - else - parent->rb_right = new; - } else { - root->rb_node = new; - } - if (victim->rb_left) - victim->rb_left->rb_parent = new; - if (victim->rb_right) - victim->rb_right->rb_parent = new; - - /* Copy the pointers/colour from the victim to the replacement */ - *new = *victim; -} diff --git a/components/dfs/filesystems/jffs2/porting.c b/components/dfs/filesystems/jffs2/porting.c deleted file mode 100644 index 81290bdc32..0000000000 --- a/components/dfs/filesystems/jffs2/porting.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include "nodelist.h" - -#include "porting.h" - -time_t jffs2_get_timestamp(void) -{ - return 0; -} - -void jffs2_get_info_from_sb(void * data, struct jffs2_fs_info * info) -{ - struct jffs2_fs_info; - struct super_block *jffs2_sb; - struct jffs2_sb_info *c; - - jffs2_sb = (struct super_block *)(data); - c = JFFS2_SB_INFO(jffs2_sb); - - info->sector_size = c->sector_size; - info->nr_blocks = c->nr_blocks; - info->free_size = c->free_size + c->dirty_size; //fixme need test! -} - -int jffs2_porting_stat(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - void * stat_buf) -{ - return jffs2_fste.stat(mte, mte->root, name, (struct stat *)stat_buf); -} diff --git a/components/dfs/filesystems/jffs2/porting.h b/components/dfs/filesystems/jffs2/porting.h deleted file mode 100644 index 2671f46dde..0000000000 --- a/components/dfs/filesystems/jffs2/porting.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _PORTING_H -#define _PORTING_H - -#include "jffs2_config.h" -/* the following should be same with os_sys_stat.h */ -#define JFFS2_S_IFMT 0x000003FF -#define JFFS2_S_IFDIR (1<<0) -#define JFFS2_S_IFREG (1<<3) - -struct jffs2_fs_info -{ - unsigned sector_size; /* a erasing block size*/ - unsigned nr_blocks; /* number of blocks in flash */ - unsigned free_size; -}; - -struct jffs2_stat { - unsigned long st_mode; /* File mode */ - unsigned int st_ino; /* File serial number */ - unsigned int st_dev; /* ID of device containing file */ - unsigned short st_nlink; /* Number of hard links */ - unsigned short st_uid; /* User ID of the file owner */ - unsigned short st_gid; /* Group ID of the file's group */ - long st_size; /* File size (regular files only) */ - long st_atime; /* Last access time */ - long st_mtime; /* Last data modification time */ - long st_ctime; /* Last file status change time */ -}; - -struct jffs2_dirent -{ -#ifdef CYGPKG_FILEIO_DIRENT_DTYPE - - unsigned long d_type; // Only supported with FATFS, RAMFS, ROMFS, - // and JFFS2. - // d_type is not part of POSIX so - // should be used with caution. -#endif - char d_name[JFFS2_NAME_MAX+1]; -}; - -extern cyg_fileops jffs2_fileops; -extern cyg_fileops jffs2_dirops; -extern struct cyg_fstab_entry jffs2_fste; - -time_t jffs2_get_timestamp(void); -void jffs2_get_info_from_sb(void * data, struct jffs2_fs_info * info); -int jffs2_porting_stat(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - void * stat_buf); - -#endif diff --git a/components/dfs/filesystems/jffs2/src/LICENCE b/components/dfs/filesystems/jffs2/src/LICENCE deleted file mode 100644 index f3f9a6f6ec..0000000000 --- a/components/dfs/filesystems/jffs2/src/LICENCE +++ /dev/null @@ -1,35 +0,0 @@ -The files in this directory and elsewhere which refer to this LICENCE -file are part of JFFS2, the Journalling Flash File System v2. - - Copyright (C) 2001-2003 Red Hat, Inc. - -JFFS2 is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2 or (at your option) any later -version. - -JFFS2 is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with JFFS2; if not, write to the Free Software Foundation, Inc., -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - -As a special exception, if other files instantiate templates or use -macros or inline functions from these files, or you compile these -files and link them with other works to produce a work based on these -files, these files do not by themselves cause the resulting work to be -covered by the GNU General Public License. However the source code for -these files must still be made available in accordance with section (3) -of the GNU General Public License. - -This exception does not invalidate any other reasons why a work based on -this file might be covered by the GNU General Public License. - -For information on obtaining alternative licences for JFFS2, see -http://sources.redhat.com/jffs2/jffs2-licence.html - - - $Id: LICENCE,v 1.2 2003/10/04 08:33:05 dwmw2 Exp $ diff --git a/components/dfs/filesystems/jffs2/src/build.c b/components/dfs/filesystems/jffs2/src/build.c deleted file mode 100644 index 158b01a829..0000000000 --- a/components/dfs/filesystems/jffs2/src/build.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: build.c,v 1.75 2005/07/22 10:32:07 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include "nodelist.h" - -static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *, struct jffs2_inode_cache *, struct jffs2_full_dirent **); - -static inline struct jffs2_inode_cache * -first_inode_chain(int *i, struct jffs2_sb_info *c) -{ - for (; *i < INOCACHE_HASHSIZE; (*i)++) { - if (c->inocache_list[*i]) - return c->inocache_list[*i]; - } - return NULL; -} - -static inline struct jffs2_inode_cache * -next_inode(int *i, struct jffs2_inode_cache *ic, struct jffs2_sb_info *c) -{ - /* More in this chain? */ - if (ic->next) - return ic->next; - (*i)++; - return first_inode_chain(i, c); -} - -#define for_each_inode(i, c, ic) \ - for (i = 0, ic = first_inode_chain(&i, (c)); \ - ic; \ - ic = next_inode(&i, ic, (c))) - - -static inline void jffs2_build_inode_pass1(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) -{ - struct jffs2_full_dirent *fd; - - D1(printk(KERN_DEBUG "jffs2_build_inode building directory inode #%u\n", ic->ino)); - - /* For each child, increase nlink */ - for(fd = ic->scan_dents; fd; fd = fd->next) { - struct jffs2_inode_cache *child_ic; - if (!fd->ino) - continue; - - /* XXX: Can get high latency here with huge directories */ - - child_ic = jffs2_get_ino_cache(c, fd->ino); - if (!child_ic) { - printk(KERN_NOTICE "Eep. Child \"%s\" (ino #%u) of dir ino #%u doesn't exist!\n", - fd->name, fd->ino, ic->ino); - jffs2_mark_node_obsolete(c, fd->raw); - continue; - } - - if (child_ic->nlink++ && fd->type == DT_DIR) { - printk(KERN_NOTICE "Child dir \"%s\" (ino #%u) of dir ino #%u appears to be a hard link\n", fd->name, fd->ino, ic->ino); - if (fd->ino == 1 && ic->ino == 1) { - printk(KERN_NOTICE "This is mostly harmless, and probably caused by creating a JFFS2 image\n"); - printk(KERN_NOTICE "using a buggy version of mkfs.jffs2. Use at least v1.17.\n"); - } - /* What do we do about it? */ - } - D1(printk(KERN_DEBUG "Increased nlink for child \"%s\" (ino #%u)\n", fd->name, fd->ino)); - /* Can't free them. We might need them in pass 2 */ - } -} - -/* Scan plan: - - Scan physical nodes. Build map of inodes/dirents. Allocate inocaches as we go - - Scan directory tree from top down, setting nlink in inocaches - - Scan inocaches for inodes with nlink==0 -*/ -static int jffs2_build_filesystem(struct jffs2_sb_info *c) -{ - int ret; - int i; - struct jffs2_inode_cache *ic; - struct jffs2_full_dirent *fd; - struct jffs2_full_dirent *dead_fds = NULL; - - /* First, scan the medium and build all the inode caches with - lists of physical nodes */ - - c->flags |= JFFS2_SB_FLAG_SCANNING; - ret = jffs2_scan_medium(c); - c->flags &= ~JFFS2_SB_FLAG_SCANNING; - if (ret) - goto exit; - - D1(printk(KERN_DEBUG "Scanned flash completely\n")); - jffs2_dbg_dump_block_lists_nolock(c); - - c->flags |= JFFS2_SB_FLAG_BUILDING; - /* Now scan the directory tree, increasing nlink according to every dirent found. */ - for_each_inode(i, c, ic) { - D1(printk(KERN_DEBUG "Pass 1: ino #%u\n", ic->ino)); - - D1(BUG_ON(ic->ino > c->highest_ino)); - - if (ic->scan_dents) { - jffs2_build_inode_pass1(c, ic); - cond_resched(); - } - } - - D1(printk(KERN_DEBUG "Pass 1 complete\n")); - - /* Next, scan for inodes with nlink == 0 and remove them. If - they were directories, then decrement the nlink of their - children too, and repeat the scan. As that's going to be - a fairly uncommon occurrence, it's not so evil to do it this - way. Recursion bad. */ - D1(printk(KERN_DEBUG "Pass 2 starting\n")); - - for_each_inode(i, c, ic) { - D1(printk(KERN_DEBUG "Pass 2: ino #%u, nlink %d, ic %p, nodes %p\n", ic->ino, ic->nlink, ic, ic->nodes)); - if (ic->nlink) - continue; - - jffs2_build_remove_unlinked_inode(c, ic, &dead_fds); - cond_resched(); - } - - D1(printk(KERN_DEBUG "Pass 2a starting\n")); - - while (dead_fds) { - fd = dead_fds; - dead_fds = fd->next; - - ic = jffs2_get_ino_cache(c, fd->ino); - D1(printk(KERN_DEBUG "Removing dead_fd ino #%u (\"%s\"), ic at %p\n", fd->ino, fd->name, ic)); - - if (ic) - jffs2_build_remove_unlinked_inode(c, ic, &dead_fds); - jffs2_free_full_dirent(fd); - } - - D1(printk(KERN_DEBUG "Pass 2 complete\n")); - - /* Finally, we can scan again and free the dirent structs */ - for_each_inode(i, c, ic) { - D1(printk(KERN_DEBUG "Pass 3: ino #%u, ic %p, nodes %p\n", ic->ino, ic, ic->nodes)); - - while(ic->scan_dents) { - fd = ic->scan_dents; - ic->scan_dents = fd->next; - jffs2_free_full_dirent(fd); - } - ic->scan_dents = NULL; - cond_resched(); - } - c->flags &= ~JFFS2_SB_FLAG_BUILDING; - - D1(printk(KERN_DEBUG "Pass 3 complete\n")); - jffs2_dbg_dump_block_lists_nolock(c); - - /* Rotate the lists by some number to ensure wear levelling */ - jffs2_rotate_lists(c); - - ret = 0; - -exit: - if (ret) { - for_each_inode(i, c, ic) { - while(ic->scan_dents) { - fd = ic->scan_dents; - ic->scan_dents = fd->next; - jffs2_free_full_dirent(fd); - } - } - } - - return ret; -} - -static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, struct jffs2_full_dirent **dead_fds) -{ - struct jffs2_raw_node_ref *raw; - struct jffs2_full_dirent *fd; - - D1(printk(KERN_DEBUG "JFFS2: Removing ino #%u with nlink == zero.\n", ic->ino)); - - raw = ic->nodes; - while (raw != (void *)ic) { - struct jffs2_raw_node_ref *next = raw->next_in_ino; - D1(printk(KERN_DEBUG "obsoleting node at 0x%08x\n", ref_offset(raw))); - jffs2_mark_node_obsolete(c, raw); - raw = next; - } - - if (ic->scan_dents) { - int whinged = 0; - D1(printk(KERN_DEBUG "Inode #%u was a directory which may have children...\n", ic->ino)); - - while(ic->scan_dents) { - struct jffs2_inode_cache *child_ic; - - fd = ic->scan_dents; - ic->scan_dents = fd->next; - - if (!fd->ino) { - /* It's a deletion dirent. Ignore it */ - D1(printk(KERN_DEBUG "Child \"%s\" is a deletion dirent, skipping...\n", fd->name)); - jffs2_free_full_dirent(fd); - continue; - } - if (!whinged) { - whinged = 1; - printk(KERN_NOTICE "Inode #%u was a directory with children - removing those too...\n", ic->ino); - } - - D1(printk(KERN_DEBUG "Removing child \"%s\", ino #%u\n", - fd->name, fd->ino)); - - child_ic = jffs2_get_ino_cache(c, fd->ino); - if (!child_ic) { - printk(KERN_NOTICE "Cannot remove child \"%s\", ino #%u, because it doesn't exist\n", fd->name, fd->ino); - jffs2_free_full_dirent(fd); - continue; - } - - /* Reduce nlink of the child. If it's now zero, stick it on the - dead_fds list to be cleaned up later. Else just free the fd */ - - child_ic->nlink--; - - if (!child_ic->nlink) { - D1(printk(KERN_DEBUG "Inode #%u (\"%s\") has now got zero nlink. Adding to dead_fds list.\n", - fd->ino, fd->name)); - fd->next = *dead_fds; - *dead_fds = fd; - } else { - D1(printk(KERN_DEBUG "Inode #%u (\"%s\") has now got nlink %d. Ignoring.\n", - fd->ino, fd->name, child_ic->nlink)); - jffs2_free_full_dirent(fd); - } - } - } - - /* - We don't delete the inocache from the hash list and free it yet. - The erase code will do that, when all the nodes are completely gone. - */ -} - -static void jffs2_calc_trigger_levels(struct jffs2_sb_info *c) -{ - uint32_t size; - - /* Deletion should almost _always_ be allowed. We're fairly - buggered once we stop allowing people to delete stuff - because there's not enough free space... */ - c->resv_blocks_deletion = 2; - - /* Be conservative about how much space we need before we allow writes. - On top of that which is required for deletia, require an extra 2% - of the medium to be available, for overhead caused by nodes being - split across blocks, etc. */ - - size = c->flash_size / 50; /* 2% of flash size */ - size += c->nr_blocks * 100; /* And 100 bytes per eraseblock */ - size += c->sector_size - 1; /* ... and round up */ - - c->resv_blocks_write = c->resv_blocks_deletion + (size / c->sector_size); - - /* When do we let the GC thread run in the background */ - - c->resv_blocks_gctrigger = c->resv_blocks_write + 1; - - /* When do we allow garbage collection to merge nodes to make - long-term progress at the expense of short-term space exhaustion? */ - c->resv_blocks_gcmerge = c->resv_blocks_deletion + 1; - - /* When do we allow garbage collection to eat from bad blocks rather - than actually making progress? */ - c->resv_blocks_gcbad = 0;//c->resv_blocks_deletion + 2; - - /* If there's less than this amount of dirty space, don't bother - trying to GC to make more space. It'll be a fruitless task */ - c->nospc_dirty_size = c->sector_size + (c->flash_size / 100); - - D1(printk(KERN_DEBUG "JFFS2 trigger levels (size %d KiB, block size %d KiB, %d blocks)\n", - c->flash_size / 1024, c->sector_size / 1024, c->nr_blocks)); - D1(printk(KERN_DEBUG "Blocks required to allow deletion: %d (%d KiB)\n", - c->resv_blocks_deletion, c->resv_blocks_deletion*c->sector_size/1024)); - D1(printk(KERN_DEBUG "Blocks required to allow writes: %d (%d KiB)\n", - c->resv_blocks_write, c->resv_blocks_write*c->sector_size/1024)); - D1(printk(KERN_DEBUG "Blocks required to quiesce GC thread: %d (%d KiB)\n", - c->resv_blocks_gctrigger, c->resv_blocks_gctrigger*c->sector_size/1024)); - D1(printk(KERN_DEBUG "Blocks required to allow GC merges: %d (%d KiB)\n", - c->resv_blocks_gcmerge, c->resv_blocks_gcmerge*c->sector_size/1024)); - D1(printk(KERN_DEBUG "Blocks required to GC bad blocks: %d (%d KiB)\n", - c->resv_blocks_gcbad, c->resv_blocks_gcbad*c->sector_size/1024)); - D1(printk(KERN_DEBUG "Amount of dirty space required to GC: %d bytes\n", - c->nospc_dirty_size)); -} - -int jffs2_do_mount_fs(struct jffs2_sb_info *c) -{ - int i; - - c->free_size = c->flash_size; - c->nr_blocks = c->flash_size / c->sector_size; -#ifndef __ECOS - if (c->mtd->flags & MTD_NO_VIRTBLOCKS) - c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks); - else -#endif - c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL); - if (!c->blocks) - return -ENOMEM; - for (i=0; inr_blocks; i++) { - INIT_LIST_HEAD(&c->blocks[i].list); - c->blocks[i].offset = i * c->sector_size; - c->blocks[i].free_size = c->sector_size; - c->blocks[i].dirty_size = 0; - c->blocks[i].wasted_size = 0; - c->blocks[i].unchecked_size = 0; - c->blocks[i].used_size = 0; - c->blocks[i].first_node = NULL; - c->blocks[i].last_node = NULL; - c->blocks[i].bad_count = 0; - } - - INIT_LIST_HEAD(&c->clean_list); - INIT_LIST_HEAD(&c->very_dirty_list); - INIT_LIST_HEAD(&c->dirty_list); - INIT_LIST_HEAD(&c->erasable_list); - INIT_LIST_HEAD(&c->erasing_list); - INIT_LIST_HEAD(&c->erase_pending_list); - INIT_LIST_HEAD(&c->erasable_pending_wbuf_list); - INIT_LIST_HEAD(&c->erase_complete_list); - INIT_LIST_HEAD(&c->free_list); - INIT_LIST_HEAD(&c->bad_list); - INIT_LIST_HEAD(&c->bad_used_list); - c->highest_ino = 1; - - if (jffs2_build_filesystem(c)) { - D1(printk(KERN_DEBUG "build_fs failed\n")); - jffs2_free_ino_caches(c); - jffs2_free_raw_node_refs(c); -#ifndef __ECOS - if (c->mtd->flags & MTD_NO_VIRTBLOCKS) - vfree(c->blocks); - else -#endif - kfree(c->blocks); - - return -EIO; - } - - jffs2_calc_trigger_levels(c); - - return 0; -} diff --git a/components/dfs/filesystems/jffs2/src/compr.c b/components/dfs/filesystems/jffs2/src/compr.c deleted file mode 100644 index c9e54b97db..0000000000 --- a/components/dfs/filesystems/jffs2/src/compr.c +++ /dev/null @@ -1,457 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * Created by Arjan van de Ven - * - * Copyright (C) 2004 Ferenc Havasi , - * University of Szeged, Hungary - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: compr.c,v 1.45 2005/07/26 13:24:40 havasi Exp $ - * - */ - -#include "compr.h" - -static DEFINE_SPINLOCK(jffs2_compressor_list_lock); - -/* Available compressors are on this list */ -static LIST_HEAD(jffs2_compressor_list); - -/* Actual compression mode */ -static int jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY; - -/* Statistics for blocks stored without compression */ -static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_compr_size=0; - -/* jffs2_compress: - * @data: Pointer to uncompressed data - * @cdata: Pointer to returned pointer to buffer for compressed data - * @datalen: On entry, holds the amount of data available for compression. - * On exit, expected to hold the amount of data actually compressed. - * @cdatalen: On entry, holds the amount of space available for compressed - * data. On exit, expected to hold the actual size of the compressed - * data. - * - * Returns: Lower byte to be stored with data indicating compression type used. - * Zero is used to show that the data could not be compressed - the - * compressed version was actually larger than the original. - * Upper byte will be used later. (soon) - * - * If the cdata buffer isn't large enough to hold all the uncompressed data, - * jffs2_compress should compress as much as will fit, and should set - * *datalen accordingly to show the amount of data which were compressed. - */ -uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - unsigned char *data_in, unsigned char **cpage_out, - uint32_t *datalen, uint32_t *cdatalen) -{ - int ret = JFFS2_COMPR_NONE; - int compr_ret; - struct jffs2_compressor *this, *best=NULL; - unsigned char *output_buf = NULL, *tmp_buf; - uint32_t orig_slen, orig_dlen; - uint32_t best_slen=0, best_dlen=0; - - switch (jffs2_compression_mode) { - case JFFS2_COMPR_MODE_NONE: - break; - case JFFS2_COMPR_MODE_PRIORITY: - output_buf = kmalloc(*cdatalen,GFP_KERNEL); - if (!output_buf) { - printk(KERN_WARNING "JFFS2: No memory for compressor allocation. Compression failed.\n"); - goto out; - } - orig_slen = *datalen; - orig_dlen = *cdatalen; - spin_lock(&jffs2_compressor_list_lock); - list_for_each_entry(this, &jffs2_compressor_list, list) { - /* Skip decompress-only backwards-compatibility and disabled modules */ - if ((!this->compress)||(this->disabled)) - continue; - - this->usecount++; - spin_unlock(&jffs2_compressor_list_lock); - *datalen = orig_slen; - *cdatalen = orig_dlen; - compr_ret = this->compress(data_in, output_buf, datalen, cdatalen, NULL); - spin_lock(&jffs2_compressor_list_lock); - this->usecount--; - if (!compr_ret) { - ret = this->compr; - this->stat_compr_blocks++; - this->stat_compr_orig_size += *datalen; - this->stat_compr_new_size += *cdatalen; - break; - } - } - spin_unlock(&jffs2_compressor_list_lock); - if (ret == JFFS2_COMPR_NONE) kfree(output_buf); - break; - case JFFS2_COMPR_MODE_SIZE: - orig_slen = *datalen; - orig_dlen = *cdatalen; - spin_lock(&jffs2_compressor_list_lock); - list_for_each_entry(this, &jffs2_compressor_list, list) { - /* Skip decompress-only backwards-compatibility and disabled modules */ - if ((!this->compress)||(this->disabled)) - continue; - /* Allocating memory for output buffer if necessary */ - if ((this->compr_buf_sizecompr_buf)) { - spin_unlock(&jffs2_compressor_list_lock); - kfree(this->compr_buf); - spin_lock(&jffs2_compressor_list_lock); - this->compr_buf_size=0; - this->compr_buf=NULL; - } - if (!this->compr_buf) { - spin_unlock(&jffs2_compressor_list_lock); - tmp_buf = kmalloc(orig_dlen,GFP_KERNEL); - spin_lock(&jffs2_compressor_list_lock); - if (!tmp_buf) { - printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n",orig_dlen); - continue; - } - else { - this->compr_buf = tmp_buf; - this->compr_buf_size = orig_dlen; - } - } - this->usecount++; - spin_unlock(&jffs2_compressor_list_lock); - *datalen = orig_slen; - *cdatalen = orig_dlen; - compr_ret = this->compress(data_in, this->compr_buf, datalen, cdatalen, NULL); - spin_lock(&jffs2_compressor_list_lock); - this->usecount--; - if (!compr_ret) { - if ((!best_dlen)||(best_dlen>*cdatalen)) { - best_dlen = *cdatalen; - best_slen = *datalen; - best = this; - } - } - } - if (best_dlen) { - *cdatalen = best_dlen; - *datalen = best_slen; - output_buf = best->compr_buf; - best->compr_buf = NULL; - best->compr_buf_size = 0; - best->stat_compr_blocks++; - best->stat_compr_orig_size += best_slen; - best->stat_compr_new_size += best_dlen; - ret = best->compr; - } - spin_unlock(&jffs2_compressor_list_lock); - break; - default: - printk(KERN_ERR "JFFS2: unknow compression mode.\n"); - } - out: - if (ret == JFFS2_COMPR_NONE) { - *cpage_out = data_in; - *datalen = *cdatalen; - none_stat_compr_blocks++; - none_stat_compr_size += *datalen; - } - else { - *cpage_out = output_buf; - } - return ret; -} - -int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - uint16_t comprtype, unsigned char *cdata_in, - unsigned char *data_out, uint32_t cdatalen, uint32_t datalen) -{ - struct jffs2_compressor *this; - int ret; - - /* Older code had a bug where it would write non-zero 'usercompr' - fields. Deal with it. */ - if ((comprtype & 0xff) <= JFFS2_COMPR_ZLIB) - comprtype &= 0xff; - - switch (comprtype & 0xff) { - case JFFS2_COMPR_NONE: - /* This should be special-cased elsewhere, but we might as well deal with it */ - memcpy(data_out, cdata_in, datalen); - none_stat_decompr_blocks++; - break; - case JFFS2_COMPR_ZERO: - memset(data_out, 0, datalen); - break; - default: - spin_lock(&jffs2_compressor_list_lock); - list_for_each_entry(this, &jffs2_compressor_list, list) { - if (comprtype == this->compr) { - this->usecount++; - spin_unlock(&jffs2_compressor_list_lock); - ret = this->decompress(cdata_in, data_out, cdatalen, datalen, NULL); - spin_lock(&jffs2_compressor_list_lock); - if (ret) { - printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret); - } - else { - this->stat_decompr_blocks++; - } - this->usecount--; - spin_unlock(&jffs2_compressor_list_lock); - return ret; - } - } - printk(KERN_WARNING "JFFS2 compression type 0x%02x not available.\n", comprtype); - spin_unlock(&jffs2_compressor_list_lock); - return -EIO; - } - return 0; -} - -int jffs2_register_compressor(struct jffs2_compressor *comp) -{ - struct jffs2_compressor *this; - - if (!comp->name) { - printk(KERN_WARNING "NULL compressor name at registering JFFS2 compressor. Failed.\n"); - return -1; - } - comp->compr_buf_size=0; - comp->compr_buf=NULL; - comp->usecount=0; - comp->stat_compr_orig_size=0; - comp->stat_compr_new_size=0; - comp->stat_compr_blocks=0; - comp->stat_decompr_blocks=0; - D1(printk(KERN_DEBUG "Registering JFFS2 compressor \"%s\"\n", comp->name)); - - spin_lock(&jffs2_compressor_list_lock); - - list_for_each_entry(this, &jffs2_compressor_list, list) { - if (this->priority < comp->priority) { - list_add(&comp->list, this->list.prev); - goto out; - } - } - list_add_tail(&comp->list, &jffs2_compressor_list); -out: - D2(list_for_each_entry(this, &jffs2_compressor_list, list) { - printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority); - }) - - spin_unlock(&jffs2_compressor_list_lock); - - return 0; -} - -int jffs2_unregister_compressor(struct jffs2_compressor *comp) -{ - D2(struct jffs2_compressor *this;) - - D1(printk(KERN_DEBUG "Unregistering JFFS2 compressor \"%s\"\n", comp->name)); - - spin_lock(&jffs2_compressor_list_lock); - - if (comp->usecount) { - spin_unlock(&jffs2_compressor_list_lock); - printk(KERN_WARNING "JFFS2: Compressor modul is in use. Unregister failed.\n"); - return -1; - } - list_del(&comp->list); - - D2(list_for_each_entry(this, &jffs2_compressor_list, list) { - printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority); - }) - spin_unlock(&jffs2_compressor_list_lock); - return 0; -} - -#ifdef CONFIG_JFFS2_PROC - -#define JFFS2_STAT_BUF_SIZE 16000 - -char *jffs2_list_compressors(void) -{ - struct jffs2_compressor *this; - char *buf, *act_buf; - - act_buf = buf = kmalloc(JFFS2_STAT_BUF_SIZE,GFP_KERNEL); - list_for_each_entry(this, &jffs2_compressor_list, list) { - act_buf += sprintf(act_buf, "%10s priority:%d ", this->name, this->priority); - if ((this->disabled)||(!this->compress)) - act_buf += sprintf(act_buf,"disabled"); - else - act_buf += sprintf(act_buf,"enabled"); - act_buf += sprintf(act_buf,"\n"); - } - return buf; -} - -char *jffs2_stats(void) -{ - struct jffs2_compressor *this; - char *buf, *act_buf; - - act_buf = buf = kmalloc(JFFS2_STAT_BUF_SIZE,GFP_KERNEL); - - act_buf += sprintf(act_buf,"JFFS2 compressor statistics:\n"); - act_buf += sprintf(act_buf,"%10s ","none"); - act_buf += sprintf(act_buf,"compr: %d blocks (%d) decompr: %d blocks\n", none_stat_compr_blocks, - none_stat_compr_size, none_stat_decompr_blocks); - spin_lock(&jffs2_compressor_list_lock); - list_for_each_entry(this, &jffs2_compressor_list, list) { - act_buf += sprintf(act_buf,"%10s ",this->name); - if ((this->disabled)||(!this->compress)) - act_buf += sprintf(act_buf,"- "); - else - act_buf += sprintf(act_buf,"+ "); - act_buf += sprintf(act_buf,"compr: %d blocks (%d/%d) decompr: %d blocks ", this->stat_compr_blocks, - this->stat_compr_new_size, this->stat_compr_orig_size, - this->stat_decompr_blocks); - act_buf += sprintf(act_buf,"\n"); - } - spin_unlock(&jffs2_compressor_list_lock); - - return buf; -} - -char *jffs2_get_compression_mode_name(void) -{ - switch (jffs2_compression_mode) { - case JFFS2_COMPR_MODE_NONE: - return "none"; - case JFFS2_COMPR_MODE_PRIORITY: - return "priority"; - case JFFS2_COMPR_MODE_SIZE: - return "size"; - } - return "unkown"; -} - -int jffs2_set_compression_mode_name(const char *name) -{ - if (!strcmp("none",name)) { - jffs2_compression_mode = JFFS2_COMPR_MODE_NONE; - return 0; - } - if (!strcmp("priority",name)) { - jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY; - return 0; - } - if (!strcmp("size",name)) { - jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE; - return 0; - } - return 1; -} - -static int jffs2_compressor_Xable(const char *name, int disabled) -{ - struct jffs2_compressor *this; - spin_lock(&jffs2_compressor_list_lock); - list_for_each_entry(this, &jffs2_compressor_list, list) { - if (!strcmp(this->name, name)) { - this->disabled = disabled; - spin_unlock(&jffs2_compressor_list_lock); - return 0; - } - } - spin_unlock(&jffs2_compressor_list_lock); - printk(KERN_WARNING "JFFS2: compressor %s not found.\n",name); - return 1; -} - -int jffs2_enable_compressor_name(const char *name) -{ - return jffs2_compressor_Xable(name, 0); -} - -int jffs2_disable_compressor_name(const char *name) -{ - return jffs2_compressor_Xable(name, 1); -} - -int jffs2_set_compressor_priority(const char *name, int priority) -{ - struct jffs2_compressor *this,*comp; - spin_lock(&jffs2_compressor_list_lock); - list_for_each_entry(this, &jffs2_compressor_list, list) { - if (!strcmp(this->name, name)) { - this->priority = priority; - comp = this; - goto reinsert; - } - } - spin_unlock(&jffs2_compressor_list_lock); - printk(KERN_WARNING "JFFS2: compressor %s not found.\n",name); - return 1; -reinsert: - /* list is sorted in the order of priority, so if - we change it we have to reinsert it into the - good place */ - list_del(&comp->list); - list_for_each_entry(this, &jffs2_compressor_list, list) { - if (this->priority < comp->priority) { - list_add(&comp->list, this->list.prev); - spin_unlock(&jffs2_compressor_list_lock); - return 0; - } - } - list_add_tail(&comp->list, &jffs2_compressor_list); - spin_unlock(&jffs2_compressor_list_lock); - return 0; -} - -#endif - -void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig) -{ - if (orig != comprbuf) - kfree(comprbuf); -} - -int jffs2_compressors_init(void) -{ -/* Registering compressors */ -#ifdef CONFIG_JFFS2_ZLIB - jffs2_zlib_init(); -#endif -#ifdef CONFIG_JFFS2_RTIME - jffs2_rtime_init(); -#endif -#ifdef CONFIG_JFFS2_RUBIN - jffs2_rubinmips_init(); - jffs2_dynrubin_init(); -#endif -/* Setting default compression mode */ -#ifdef CONFIG_JFFS2_CMODE_NONE - jffs2_compression_mode = JFFS2_COMPR_MODE_NONE; - D1(printk(KERN_INFO "JFFS2: default compression mode: none\n");) -#else -#ifdef CONFIG_JFFS2_CMODE_SIZE - jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE; - D1(printk(KERN_INFO "JFFS2: default compression mode: size\n");) -#else - D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");) -#endif -#endif - return 0; -} - -int jffs2_compressors_exit(void) -{ -/* Unregistering compressors */ -#ifdef CONFIG_JFFS2_RUBIN - jffs2_dynrubin_exit(); - jffs2_rubinmips_exit(); -#endif -#ifdef CONFIG_JFFS2_RTIME - jffs2_rtime_exit(); -#endif -#ifdef CONFIG_JFFS2_ZLIB - jffs2_zlib_exit(); -#endif - return 0; -} diff --git a/components/dfs/filesystems/jffs2/src/compr.h b/components/dfs/filesystems/jffs2/src/compr.h deleted file mode 100644 index 9ec6e37d38..0000000000 --- a/components/dfs/filesystems/jffs2/src/compr.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2004 Ferenc Havasi , - * University of Szeged, Hungary - * - * For licensing information, see the file 'LICENCE' in the - * jffs2 directory. - * - * $Id: compr.h,v 1.8 2005/07/26 13:24:40 havasi Exp $ - * - */ - -#ifndef __JFFS2_COMPR_H__ -#define __JFFS2_COMPR_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "nodelist.h" - -#define JFFS2_RUBINMIPS_PRIORITY 10 -#define JFFS2_DYNRUBIN_PRIORITY 20 -#define JFFS2_LZARI_PRIORITY 30 -#define JFFS2_LZO_PRIORITY 40 -#define JFFS2_RTIME_PRIORITY 50 -#define JFFS2_ZLIB_PRIORITY 60 - -#define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */ -#define JFFS2_DYNRUBIN_DISABLED /* for decompression */ - -#define JFFS2_COMPR_MODE_NONE 0 -#define JFFS2_COMPR_MODE_PRIORITY 1 -#define JFFS2_COMPR_MODE_SIZE 2 - -struct jffs2_compressor { - struct list_head list; - int priority; /* used by prirority comr. mode */ - char *name; - char compr; /* JFFS2_COMPR_XXX */ - int (*compress)(unsigned char *data_in, unsigned char *cpage_out, - uint32_t *srclen, uint32_t *destlen, void *model); - int (*decompress)(unsigned char *cdata_in, unsigned char *data_out, - uint32_t cdatalen, uint32_t datalen, void *model); - int usecount; - int disabled; /* if seted the compressor won't compress */ - unsigned char *compr_buf; /* used by size compr. mode */ - uint32_t compr_buf_size; /* used by size compr. mode */ - uint32_t stat_compr_orig_size; - uint32_t stat_compr_new_size; - uint32_t stat_compr_blocks; - uint32_t stat_decompr_blocks; -}; - -int jffs2_register_compressor(struct jffs2_compressor *comp); -int jffs2_unregister_compressor(struct jffs2_compressor *comp); - -int jffs2_compressors_init(void); -int jffs2_compressors_exit(void); - -uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - unsigned char *data_in, unsigned char **cpage_out, - uint32_t *datalen, uint32_t *cdatalen); - -int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - uint16_t comprtype, unsigned char *cdata_in, - unsigned char *data_out, uint32_t cdatalen, uint32_t datalen); - -void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig); - -#ifdef CONFIG_JFFS2_PROC -int jffs2_enable_compressor_name(const char *name); -int jffs2_disable_compressor_name(const char *name); -int jffs2_set_compression_mode_name(const char *mode_name); -char *jffs2_get_compression_mode_name(void); -int jffs2_set_compressor_priority(const char *mode_name, int priority); -char *jffs2_list_compressors(void); -char *jffs2_stats(void); -#endif - -/* Compressor modules */ -/* These functions will be called by jffs2_compressors_init/exit */ - -#ifdef CONFIG_JFFS2_RUBIN -int jffs2_rubinmips_init(void); -void jffs2_rubinmips_exit(void); -int jffs2_dynrubin_init(void); -void jffs2_dynrubin_exit(void); -#endif -#ifdef CONFIG_JFFS2_RTIME -int jffs2_rtime_init(void); -void jffs2_rtime_exit(void); -#endif -#ifdef CONFIG_JFFS2_ZLIB -int jffs2_zlib_init(void); -void jffs2_zlib_exit(void); -#endif - -#endif /* __JFFS2_COMPR_H__ */ diff --git a/components/dfs/filesystems/jffs2/src/compr_rtime.c b/components/dfs/filesystems/jffs2/src/compr_rtime.c deleted file mode 100644 index c7f6b2914e..0000000000 --- a/components/dfs/filesystems/jffs2/src/compr_rtime.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by Arjan van de Ven - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: compr_rtime.c,v 1.15 2005/03/17 20:23:06 gleixner Exp $ - * - * - * Very simple lz77-ish encoder. - * - * Theory of operation: Both encoder and decoder have a list of "last - * occurrences" for every possible source-value; after sending the - * first source-byte, the second byte indicated the "run" length of - * matches - * - * The algorithm is intended to only send "whole bytes", no bit-messing. - * - */ - -#include -#include -#include -#include -#include -#include "compr.h" - -/* _compress returns the compressed size, -1 if bigger */ -static int jffs2_rtime_compress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t *sourcelen, uint32_t *dstlen, - void *model) -{ - short positions[256]; - int outpos = 0; - int pos=0; - - memset(positions,0,sizeof(positions)); - - while (pos < (*sourcelen) && outpos <= (*dstlen)-2) { - int backpos, runlen=0; - unsigned char value; - - value = data_in[pos]; - - cpage_out[outpos++] = data_in[pos++]; - - backpos = positions[value]; - positions[value]=pos; - - while ((backpos < pos) && (pos < (*sourcelen)) && - (data_in[pos]==data_in[backpos++]) && (runlen<255)) { - pos++; - runlen++; - } - cpage_out[outpos++] = runlen; - } - - if (outpos >= pos) { - /* We failed */ - return -1; - } - - /* Tell the caller how much we managed to compress, and how much space it took */ - *sourcelen = pos; - *dstlen = outpos; - return 0; -} - - -static int jffs2_rtime_decompress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t srclen, uint32_t destlen, - void *model) -{ - short positions[256]; - int outpos = 0; - int pos=0; - - memset(positions,0,sizeof(positions)); - - while (outpos= outpos) { - while(repeat) { - cpage_out[outpos++] = cpage_out[backoffs++]; - repeat--; - } - } else { - memcpy(&cpage_out[outpos],&cpage_out[backoffs],repeat); - outpos+=repeat; - } - } - } - return 0; -} - -#if defined (__GNUC__) -static struct jffs2_compressor jffs2_rtime_comp = { - .priority = JFFS2_RTIME_PRIORITY, - .name = "rtime", - .compr = JFFS2_COMPR_RTIME, - .compress = &jffs2_rtime_compress, - .decompress = &jffs2_rtime_decompress, -#ifdef JFFS2_RTIME_DISABLED - .disabled = 1, -#else - .disabled = 0, -#endif -}; -#elif defined (MSVC) -static struct jffs2_compressor jffs2_rtime_comp = { - {NULL}, - JFFS2_RTIME_PRIORITY,//.priority = - "rtime",//.name = - JFFS2_COMPR_RTIME,//.compr = - &jffs2_rtime_compress,//.compress = - &jffs2_rtime_decompress,//.decompress = - 0, -#ifdef JFFS2_RTIME_DISABLED - 1,//.disabled = -#else - 0,//.disabled = -#endif - NULL, - 0, - 0, - 0, - 0, - 0 -}; -#else -#endif - -int jffs2_rtime_init(void) -{ - return jffs2_register_compressor(&jffs2_rtime_comp); -} - -void jffs2_rtime_exit(void) -{ - jffs2_unregister_compressor(&jffs2_rtime_comp); -} diff --git a/components/dfs/filesystems/jffs2/src/compr_rubin.c b/components/dfs/filesystems/jffs2/src/compr_rubin.c deleted file mode 100644 index e1030d6778..0000000000 --- a/components/dfs/filesystems/jffs2/src/compr_rubin.c +++ /dev/null @@ -1,427 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001, 2002 Red Hat, Inc. - * - * Created by Arjan van de Ven - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: compr_rubin.c,v 1.21 2005/05/20 15:39:54 gleixner Exp $ - * - */ - - -#include -#include -#include -#include "compr_rubin.h" -#include "histo_mips.h" -#include "compr.h" - -static void init_rubin(struct rubin_state *rs, int div, int *bits) -{ - int c; - - rs->q = 0; - rs->p = (long) (2 * UPPER_BIT_RUBIN); - rs->bit_number = (long) 0; - rs->bit_divider = div; - for (c=0; c<8; c++) - rs->bits[c] = bits[c]; -} - - -static int encode(struct rubin_state *rs, long A, long B, int symbol) -{ - - long i0, i1; - int ret; - - while ((rs->q >= UPPER_BIT_RUBIN) || ((rs->p + rs->q) <= UPPER_BIT_RUBIN)) { - rs->bit_number++; - - ret = pushbit(&rs->pp, (rs->q & UPPER_BIT_RUBIN) ? 1 : 0, 0); - if (ret) - return ret; - rs->q &= LOWER_BITS_RUBIN; - rs->q <<= 1; - rs->p <<= 1; - } - i0 = A * rs->p / (A + B); - if (i0 <= 0) { - i0 = 1; - } - if (i0 >= rs->p) { - i0 = rs->p - 1; - } - i1 = rs->p - i0; - - if (symbol == 0) - rs->p = i0; - else { - rs->p = i1; - rs->q += i0; - } - return 0; -} - - -static void end_rubin(struct rubin_state *rs) -{ - - int i; - - for (i = 0; i < RUBIN_REG_SIZE; i++) { - pushbit(&rs->pp, (UPPER_BIT_RUBIN & rs->q) ? 1 : 0, 1); - rs->q &= LOWER_BITS_RUBIN; - rs->q <<= 1; - } -} - - -static void init_decode(struct rubin_state *rs, int div, int *bits) -{ - init_rubin(rs, div, bits); - - /* behalve lower */ - rs->rec_q = 0; - - for (rs->bit_number = 0; rs->bit_number++ < RUBIN_REG_SIZE; rs->rec_q = rs->rec_q * 2 + (long) (pullbit(&rs->pp))) - ; -} - -static void __do_decode(struct rubin_state *rs, unsigned long p, unsigned long q) -{ - register unsigned long lower_bits_rubin = LOWER_BITS_RUBIN; - unsigned long rec_q; - int c, bits = 0; - - /* - * First, work out how many bits we need from the input stream. - * Note that we have already done the initial check on this - * loop prior to calling this function. - */ - do { - bits++; - q &= lower_bits_rubin; - q <<= 1; - p <<= 1; - } while ((q >= UPPER_BIT_RUBIN) || ((p + q) <= UPPER_BIT_RUBIN)); - - rs->p = p; - rs->q = q; - - rs->bit_number += bits; - - /* - * Now get the bits. We really want this to be "get n bits". - */ - rec_q = rs->rec_q; - do { - c = pullbit(&rs->pp); - rec_q &= lower_bits_rubin; - rec_q <<= 1; - rec_q += c; - } while (--bits); - rs->rec_q = rec_q; -} - -static int decode(struct rubin_state *rs, long A, long B) -{ - unsigned long p = rs->p, q = rs->q; - long i0, threshold; - int symbol; - - if (q >= UPPER_BIT_RUBIN || ((p + q) <= UPPER_BIT_RUBIN)) - __do_decode(rs, p, q); - - i0 = A * rs->p / (A + B); - if (i0 <= 0) { - i0 = 1; - } - if (i0 >= rs->p) { - i0 = rs->p - 1; - } - - threshold = rs->q + i0; - symbol = rs->rec_q >= threshold; - if (rs->rec_q >= threshold) { - rs->q += i0; - i0 = rs->p - i0; - } - - rs->p = i0; - - return symbol; -} - - - -static int out_byte(struct rubin_state *rs, unsigned char byte) -{ - int i, ret; - struct rubin_state rs_copy; - rs_copy = *rs; - - for (i=0;i<8;i++) { - ret = encode(rs, rs->bit_divider-rs->bits[i],rs->bits[i],byte&1); - if (ret) { - /* Failed. Restore old state */ - *rs = rs_copy; - return ret; - } - byte=byte>>1; - } - return 0; -} - -static int in_byte(struct rubin_state *rs) -{ - int i, result = 0, bit_divider = rs->bit_divider; - - for (i = 0; i < 8; i++) - result |= decode(rs, bit_divider - rs->bits[i], rs->bits[i]) << i; - - return result; -} - - - -static int rubin_do_compress(int bit_divider, int *bits, unsigned char *data_in, - unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen) - { - int outpos = 0; - int pos=0; - struct rubin_state rs; - - init_pushpull(&rs.pp, (char *)cpage_out, *dstlen * 8, 0, 32); - - init_rubin(&rs, bit_divider, bits); - - while (pos < (*sourcelen) && !out_byte(&rs, data_in[pos])) - pos++; - - end_rubin(&rs); - - if (outpos > pos) { - /* We failed */ - return -1; - } - - /* Tell the caller how much we managed to compress, - * and how much space it took */ - - outpos = (pushedbits(&rs.pp)+7)/8; - - if (outpos >= pos) - return -1; /* We didn't actually compress */ - *sourcelen = pos; - *dstlen = outpos; - return 0; -} -#if 0 -/* _compress returns the compressed size, -1 if bigger */ -int jffs2_rubinmips_compress(unsigned char *data_in, unsigned char *cpage_out, - uint32_t *sourcelen, uint32_t *dstlen, void *model) -{ - return rubin_do_compress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen); -} -#endif -static int jffs2_dynrubin_compress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t *sourcelen, uint32_t *dstlen, - void *model) -{ - int bits[8]; - unsigned char histo[256]; - int i; - int ret; - uint32_t mysrclen, mydstlen; - - mysrclen = *sourcelen; - mydstlen = *dstlen - 8; - - if (*dstlen <= 12) - return -1; - - memset(histo, 0, 256); - for (i=0; i 255) bits[i] = 255; - cpage_out[i] = bits[i]; - } - - ret = rubin_do_compress(256, bits, data_in, cpage_out+8, &mysrclen, &mydstlen); - if (ret) - return ret; - - /* Add back the 8 bytes we took for the probabilities */ - mydstlen += 8; - - if (mysrclen <= mydstlen) { - /* We compressed */ - return -1; - } - - *sourcelen = mysrclen; - *dstlen = mydstlen; - return 0; -} - -static void rubin_do_decompress(int bit_divider, int *bits, unsigned char *cdata_in, - unsigned char *page_out, uint32_t srclen, uint32_t destlen) -{ - int outpos = 0; - struct rubin_state rs; - - init_pushpull(&rs.pp, (char *)cdata_in, srclen, 0, 0); - init_decode(&rs, bit_divider, bits); - - while (outpos < destlen) { - page_out[outpos++] = in_byte(&rs); - } -} - - -static int jffs2_rubinmips_decompress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t sourcelen, uint32_t dstlen, - void *model) -{ - rubin_do_decompress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen); - return 0; -} - -static int jffs2_dynrubin_decompress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t sourcelen, uint32_t dstlen, - void *model) -{ - int bits[8]; - int c; - - for (c=0; c<8; c++) - bits[c] = data_in[c]; - - rubin_do_decompress(256, bits, data_in+8, cpage_out, sourcelen-8, dstlen); - return 0; -} - -#if defined (__GNUC__) -static struct jffs2_compressor jffs2_rubinmips_comp = { - .priority = JFFS2_RUBINMIPS_PRIORITY, - .name = "rubinmips", - .compr = JFFS2_COMPR_DYNRUBIN, - .compress = NULL, /*&jffs2_rubinmips_compress,*/ - .decompress = &jffs2_rubinmips_decompress, -#ifdef JFFS2_RUBINMIPS_DISABLED - .disabled = 1, -#else - .disabled = 0, -#endif -}; -#elif defined (MSVC) -static struct jffs2_compressor jffs2_rubinmips_comp = { - {NULL}, - JFFS2_RUBINMIPS_PRIORITY, - "rubinmips", - JFFS2_COMPR_DYNRUBIN, - NULL, /*&jffs2_rubinmips_compress,*/ - &jffs2_rubinmips_decompress, - 0, -#ifdef JFFS2_RUBINMIPS_DISABLED - 1, -#else - 0, -#endif - NULL, - 0, - 0, - 0, - 0, - 0 -}; -#else -#endif - -int jffs2_rubinmips_init(void) -{ - return jffs2_register_compressor(&jffs2_rubinmips_comp); -} - -void jffs2_rubinmips_exit(void) -{ - jffs2_unregister_compressor(&jffs2_rubinmips_comp); -} - -#if defined (__GNUC__) -static struct jffs2_compressor jffs2_dynrubin_comp = { - .priority = JFFS2_DYNRUBIN_PRIORITY, - .name = "dynrubin", - .compr = JFFS2_COMPR_RUBINMIPS, - .compress = jffs2_dynrubin_compress, - .decompress = &jffs2_dynrubin_decompress, -#ifdef JFFS2_DYNRUBIN_DISABLED - .disabled = 1, -#else - .disabled = 0, -#endif -}; -#elif defined (MSVC) -static struct jffs2_compressor jffs2_dynrubin_comp = { - {NULL}, - JFFS2_DYNRUBIN_PRIORITY, - "dynrubin", - JFFS2_COMPR_RUBINMIPS, - jffs2_dynrubin_compress, - &jffs2_dynrubin_decompress, - 0, -#ifdef JFFS2_DYNRUBIN_DISABLED - 1, -#else - 0, -#endif - NULL, - 0, - 0, - 0, - 0, - 0 -}; -#else -#endif - -int jffs2_dynrubin_init(void) -{ - return jffs2_register_compressor(&jffs2_dynrubin_comp); -} - -void jffs2_dynrubin_exit(void) -{ - jffs2_unregister_compressor(&jffs2_dynrubin_comp); -} diff --git a/components/dfs/filesystems/jffs2/src/compr_rubin.h b/components/dfs/filesystems/jffs2/src/compr_rubin.h deleted file mode 100644 index cf51e34f65..0000000000 --- a/components/dfs/filesystems/jffs2/src/compr_rubin.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Rubin encoder/decoder header */ -/* work started at : aug 3, 1994 */ -/* last modification : aug 15, 1994 */ -/* $Id: compr_rubin.h,v 1.6 2002/01/25 01:49:26 dwmw2 Exp $ */ - -#include "pushpull.h" - -#define RUBIN_REG_SIZE 16 -#define UPPER_BIT_RUBIN (((long) 1)<<(RUBIN_REG_SIZE-1)) -#define LOWER_BITS_RUBIN ((((long) 1)<<(RUBIN_REG_SIZE-1))-1) - - -struct rubin_state { - unsigned long p; - unsigned long q; - unsigned long rec_q; - long bit_number; - struct pushpull pp; - int bit_divider; - int bits[8]; -}; diff --git a/components/dfs/filesystems/jffs2/src/compr_zlib.c b/components/dfs/filesystems/jffs2/src/compr_zlib.c deleted file mode 100644 index 7fe18e088c..0000000000 --- a/components/dfs/filesystems/jffs2/src/compr_zlib.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: compr_zlib.c,v 1.31 2005/05/20 19:30:06 gleixner Exp $ - * - */ -#include "jffs2_config.h" -#if !defined(__KERNEL__) && !defined(__ECOS) -#error "The userspace support got too messy and was removed. Update your mkfs.jffs2" -#endif - -#include -#include -#include -#include -#include -#include -#include "nodelist.h" -#include "compr.h" - - /* Plan: call deflate() with avail_in == *sourcelen, - avail_out = *dstlen - 12 and flush == Z_FINISH. - If it doesn't manage to finish, call it again with - avail_in == 0 and avail_out set to the remaining 12 - bytes for it to clean up. - Q: Is 12 bytes sufficient? - */ -#define STREAM_END_SPACE 12 - -static DECLARE_MUTEX(deflate_sem); -static DECLARE_MUTEX(inflate_sem); -static z_stream inf_strm, def_strm; - -#ifdef __KERNEL__ /* Linux-only */ -#include -#include - -static int __init alloc_workspaces(void) -{ - def_strm.workspace = vmalloc(zlib_deflate_workspacesize()); - if (!def_strm.workspace) { - printk(KERN_WARNING "Failed to allocate %d bytes for deflate workspace\n", zlib_deflate_workspacesize()); - return -ENOMEM; - } - D1(printk(KERN_DEBUG "Allocated %d bytes for deflate workspace\n", zlib_deflate_workspacesize())); - inf_strm.workspace = vmalloc(zlib_inflate_workspacesize()); - if (!inf_strm.workspace) { - printk(KERN_WARNING "Failed to allocate %d bytes for inflate workspace\n", zlib_inflate_workspacesize()); - vfree(def_strm.workspace); - return -ENOMEM; - } - D1(printk(KERN_DEBUG "Allocated %d bytes for inflate workspace\n", zlib_inflate_workspacesize())); - return 0; -} - -static void free_workspaces(void) -{ - vfree(def_strm.workspace); - vfree(inf_strm.workspace); -} -#else -#define alloc_workspaces() (0) -#define free_workspaces() do { } while(0) -#endif /* __KERNEL__ */ - -static int jffs2_zlib_compress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t *sourcelen, uint32_t *dstlen, - void *model) -{ - int ret; - - if (*dstlen <= STREAM_END_SPACE) - return -1; - - down(&deflate_sem); - - if (Z_OK != zlib_deflateInit(&def_strm, 3)) { - printk(KERN_WARNING "deflateInit failed\n"); - up(&deflate_sem); - return -1; - } - - def_strm.next_in = data_in; - def_strm.total_in = 0; - - def_strm.next_out = cpage_out; - def_strm.total_out = 0; - - while (def_strm.total_out < *dstlen - STREAM_END_SPACE && def_strm.total_in < *sourcelen) { - def_strm.avail_out = *dstlen - (def_strm.total_out + STREAM_END_SPACE); - def_strm.avail_in = min((unsigned)(*sourcelen-def_strm.total_in), def_strm.avail_out); - D1(printk(KERN_DEBUG "calling deflate with avail_in %d, avail_out %d\n", - def_strm.avail_in, def_strm.avail_out)); - ret = zlib_deflate(&def_strm, Z_PARTIAL_FLUSH); - D1(printk(KERN_DEBUG "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", - def_strm.avail_in, def_strm.avail_out, def_strm.total_in, def_strm.total_out)); - if (ret != Z_OK) { - D1(printk(KERN_DEBUG "deflate in loop returned %d\n", ret)); - zlib_deflateEnd(&def_strm); - up(&deflate_sem); - return -1; - } - } - def_strm.avail_out += STREAM_END_SPACE; - def_strm.avail_in = 0; - ret = zlib_deflate(&def_strm, Z_FINISH); - zlib_deflateEnd(&def_strm); - - if (ret != Z_STREAM_END) { - D1(printk(KERN_DEBUG "final deflate returned %d\n", ret)); - ret = -1; - goto out; - } - - if (def_strm.total_out >= def_strm.total_in) { - D1(printk(KERN_DEBUG "zlib compressed %ld bytes into %ld; failing\n", - def_strm.total_in, def_strm.total_out)); - ret = -1; - goto out; - } - - D1(printk(KERN_DEBUG "zlib compressed %ld bytes into %ld\n", - def_strm.total_in, def_strm.total_out)); - - *dstlen = def_strm.total_out; - *sourcelen = def_strm.total_in; - ret = 0; - out: - up(&deflate_sem); - return ret; -} - -static int jffs2_zlib_decompress(unsigned char *data_in, - unsigned char *cpage_out, - uint32_t srclen, uint32_t destlen, - void *model) -{ - int ret; - int wbits = MAX_WBITS; - - down(&inflate_sem); - - inf_strm.next_in = data_in; - inf_strm.avail_in = srclen; - inf_strm.total_in = 0; - - inf_strm.next_out = cpage_out; - inf_strm.avail_out = destlen; - inf_strm.total_out = 0; - - /* If it's deflate, and it's got no preset dictionary, then - we can tell zlib to skip the adler32 check. */ - if (srclen > 2 && !(data_in[1] & PRESET_DICT) && - ((data_in[0] & 0x0f) == Z_DEFLATED) && - !(((data_in[0]<<8) + data_in[1]) % 31)) { - - D2(printk(KERN_DEBUG "inflate skipping adler32\n")); - wbits = -((data_in[0] >> 4) + 8); - inf_strm.next_in += 2; - inf_strm.avail_in -= 2; - } else { - /* Let this remain D1 for now -- it should never happen */ - D1(printk(KERN_DEBUG "inflate not skipping adler32\n")); - } - - - if (Z_OK != zlib_inflateInit2(&inf_strm, wbits)) { - printk(KERN_WARNING "inflateInit failed\n"); - up(&inflate_sem); - return 1; - } - - while((ret = zlib_inflate(&inf_strm, Z_FINISH)) == Z_OK) - ; - if (ret != Z_STREAM_END) { - printk(KERN_NOTICE "inflate returned %d\n", ret); - } - zlib_inflateEnd(&inf_strm); - up(&inflate_sem); - return 0; -} - -#if defined (__GNUC__) -static struct jffs2_compressor jffs2_zlib_comp = { - .priority = JFFS2_ZLIB_PRIORITY, - .name = "zlib", - .compr = JFFS2_COMPR_ZLIB, - .compress = &jffs2_zlib_compress, - .decompress = &jffs2_zlib_decompress, -#ifdef JFFS2_ZLIB_DISABLED - .disabled = 1, -#else - .disabled = 0, -#endif -}; -#elif defined (MSVC) -static struct jffs2_compressor jffs2_zlib_comp = { - {NULL}, - JFFS2_ZLIB_PRIORITY,//.priority = - "zlib",//.name = - JFFS2_COMPR_ZLIB,//.compr = - &jffs2_zlib_compress,//.compress = - &jffs2_zlib_decompress,//.decompress = - 0, -#ifdef JFFS2_ZLIB_DISABLED - 1,//.disabled = -#else - 0,//.disabled = -#endif - NULL, - 0, - 0, - 0, - 0, - 0 -}; -#else -#endif - -int __init jffs2_zlib_init(void) -{ - int ret; - - ret = alloc_workspaces(); - if (ret) - return ret; - - ret = jffs2_register_compressor(&jffs2_zlib_comp); - if (ret) - free_workspaces(); - - return ret; -} - -void jffs2_zlib_exit(void) -{ - jffs2_unregister_compressor(&jffs2_zlib_comp); - free_workspaces(); -} diff --git a/components/dfs/filesystems/jffs2/src/debug.c b/components/dfs/filesystems/jffs2/src/debug.c deleted file mode 100644 index 3a7c5ea6fc..0000000000 --- a/components/dfs/filesystems/jffs2/src/debug.c +++ /dev/null @@ -1,711 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: debug.c,v 1.1 2005/07/30 15:30:42 asl Exp $ - * - */ -#include -#include -#include -#include -#include -#include -#include "nodelist.h" -#include "debug.h" - -#ifdef JFFS2_DBG_PARANOIA_CHECKS -/* - * Check the fragtree. - */ -void -__jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f) -{ - down(&f->sem); - __jffs2_dbg_fragtree_paranoia_check_nolock(f); - up(&f->sem); -} - -void -__jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f) -{ - struct jffs2_node_frag *frag; - int bitched = 0; - - for (frag = frag_first(&f->fragtree); frag; frag = frag_next(frag)) { - struct jffs2_full_dnode *fn = frag->node; - - if (!fn || !fn->raw) - continue; - - if (ref_flags(fn->raw) == REF_PRISTINE) { - if (fn->frags > 1) { - JFFS2_ERROR("REF_PRISTINE node at 0x%08x had %d frags. Tell dwmw2.\n", - ref_offset(fn->raw), fn->frags); - bitched = 1; - } - - /* A hole node which isn't multi-page should be garbage-collected - and merged anyway, so we just check for the frag size here, - rather than mucking around with actually reading the node - and checking the compression type, which is the real way - to tell a hole node. */ - if (frag->ofs & (PAGE_CACHE_SIZE-1) && frag_prev(frag) - && frag_prev(frag)->size < PAGE_CACHE_SIZE && frag_prev(frag)->node) { - JFFS2_ERROR("REF_PRISTINE node at 0x%08x had a previous non-hole frag " - "in the same page. Tell dwmw2.\n", ref_offset(fn->raw)); - bitched = 1; - } - - if ((frag->ofs+frag->size) & (PAGE_CACHE_SIZE-1) && frag_next(frag) - && frag_next(frag)->size < PAGE_CACHE_SIZE && frag_next(frag)->node) { - JFFS2_ERROR("REF_PRISTINE node at 0x%08x (%08x-%08x) had a following " - "non-hole frag in the same page. Tell dwmw2.\n", - ref_offset(fn->raw), frag->ofs, frag->ofs+frag->size); - bitched = 1; - } - } - } - - if (bitched) { - JFFS2_ERROR("fragtree is corrupted.\n"); - __jffs2_dbg_dump_fragtree_nolock(f); - BUG(); - } -} - -/* - * Check if the flash contains all 0xFF before we start writing. - */ -void -__jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, - uint32_t ofs, int len) -{ - size_t retlen; - int ret, i; - unsigned char *buf; - - buf = kmalloc(len, GFP_KERNEL); - if (!buf) - return; - - ret = jffs2_flash_read(c, ofs, len, &retlen, buf); - if (ret || (retlen != len)) { - JFFS2_WARNING("read %d bytes failed or short. ret %d, retlen %zd.\n", - len, ret, retlen); - kfree(buf); - return; - } - - ret = 0; - for (i = 0; i < len; i++) - if (buf[i] != 0xff) - ret = 1; - - if (ret) { - JFFS2_ERROR("argh, about to write node to %#08x on flash, but there are data " - "already there. The first corrupted byte is at %#08x offset.\n", ofs, ofs + i); - __jffs2_dbg_dump_buffer(buf, len, ofs); - kfree(buf); - BUG(); - } - - kfree(buf); -} - -/* - * Check the space accounting and node_ref list correctness for the JFFS2 erasable block 'jeb'. - */ -void -__jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - spin_lock(&c->erase_completion_lock); - __jffs2_dbg_acct_paranoia_check_nolock(c, jeb); - spin_unlock(&c->erase_completion_lock); -} - -void -__jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - uint32_t my_used_size = 0; - uint32_t my_unchecked_size = 0; - uint32_t my_dirty_size = 0; - struct jffs2_raw_node_ref *ref2 = jeb->first_node; - - while (ref2) { - uint32_t totlen = ref_totlen(c, jeb, ref2); - - if (ref2->flash_offset < jeb->offset || - ref2->flash_offset > jeb->offset + c->sector_size) { - JFFS2_ERROR("node_ref %#08x shouldn't be in block at %#08x.\n", - ref_offset(ref2), jeb->offset); - goto error; - - } - if (ref_flags(ref2) == REF_UNCHECKED) - my_unchecked_size += totlen; - else if (!ref_obsolete(ref2)) - my_used_size += totlen; - else - my_dirty_size += totlen; - - if ((!ref2->next_phys) != (ref2 == jeb->last_node)) { - JFFS2_ERROR("node_ref for node at %#08x (mem %p) has next_phys at %#08x (mem %p), " - "last_node is at %#08x (mem %p).\n", - ref_offset(ref2), ref2, ref_offset(ref2->next_phys), ref2->next_phys, - ref_offset(jeb->last_node), jeb->last_node); - goto error; - } - ref2 = ref2->next_phys; - } - - if (my_used_size != jeb->used_size) { - JFFS2_ERROR("Calculated used size %#08x != stored used size %#08x.\n", - my_used_size, jeb->used_size); - goto error; - } - - if (my_unchecked_size != jeb->unchecked_size) { - JFFS2_ERROR("Calculated unchecked size %#08x != stored unchecked size %#08x.\n", - my_unchecked_size, jeb->unchecked_size); - goto error; - } - -#if 0 - /* This should work when we implement ref->__totlen elemination */ - if (my_dirty_size != jeb->dirty_size + jeb->wasted_size) { - JFFS2_ERROR("Calculated dirty+wasted size %#08x != stored dirty + wasted size %#08x\n", - my_dirty_size, jeb->dirty_size + jeb->wasted_size); - goto error; - } - - if (jeb->free_size == 0 - && my_used_size + my_unchecked_size + my_dirty_size != c->sector_size) { - JFFS2_ERROR("The sum of all nodes in block (%#x) != size of block (%#x)\n", - my_used_size + my_unchecked_size + my_dirty_size, - c->sector_size); - goto error; - } -#endif - - return; - -error: - __jffs2_dbg_dump_node_refs_nolock(c, jeb); - __jffs2_dbg_dump_jeb_nolock(jeb); - __jffs2_dbg_dump_block_lists_nolock(c); - BUG(); - -} -#endif /* JFFS2_DBG_PARANOIA_CHECKS */ - -#if defined(JFFS2_DBG_DUMPS) || defined(JFFS2_DBG_PARANOIA_CHECKS) -/* - * Dump the node_refs of the 'jeb' JFFS2 eraseblock. - */ -void -__jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - spin_lock(&c->erase_completion_lock); - __jffs2_dbg_dump_node_refs_nolock(c, jeb); - spin_unlock(&c->erase_completion_lock); -} - -void -__jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - struct jffs2_raw_node_ref *ref; - int i = 0; - - JFFS2_DEBUG("Dump node_refs of the eraseblock %#08x\n", jeb->offset); - if (!jeb->first_node) { - JFFS2_DEBUG("no nodes in the eraseblock %#08x\n", jeb->offset); - return; - } - - printk(JFFS2_DBG_LVL); - for (ref = jeb->first_node; ; ref = ref->next_phys) { - printk("%#08x(%#x)", ref_offset(ref), ref->__totlen); - if (ref->next_phys) - printk("->"); - else - break; - if (++i == 4) { - i = 0; - printk("\n" JFFS2_DBG_LVL); - } - } - printk("\n"); -} - -/* - * Dump an eraseblock's space accounting. - */ -void -__jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) -{ - spin_lock(&c->erase_completion_lock); - __jffs2_dbg_dump_jeb_nolock(jeb); - spin_unlock(&c->erase_completion_lock); -} - -void -__jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb) -{ - if (!jeb) - return; - - JFFS2_DEBUG("dump space accounting for the eraseblock at %#08x:\n", - jeb->offset); - - printk(JFFS2_DBG_LVL "used_size: %#08x\n", jeb->used_size); - printk(JFFS2_DBG_LVL "dirty_size: %#08x\n", jeb->dirty_size); - printk(JFFS2_DBG_LVL "wasted_size: %#08x\n", jeb->wasted_size); - printk(JFFS2_DBG_LVL "unchecked_size: %#08x\n", jeb->unchecked_size); - printk(JFFS2_DBG_LVL "free_size: %#08x\n", jeb->free_size); -} - -void -__jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c) -{ - spin_lock(&c->erase_completion_lock); - __jffs2_dbg_dump_block_lists_nolock(c); - spin_unlock(&c->erase_completion_lock); -} - -void -__jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c) -{ - JFFS2_DEBUG("dump JFFS2 blocks lists:\n"); - - printk(JFFS2_DBG_LVL "flash_size: %#08x\n", c->flash_size); - printk(JFFS2_DBG_LVL "used_size: %#08x\n", c->used_size); - printk(JFFS2_DBG_LVL "dirty_size: %#08x\n", c->dirty_size); - printk(JFFS2_DBG_LVL "wasted_size: %#08x\n", c->wasted_size); - printk(JFFS2_DBG_LVL "unchecked_size: %#08x\n", c->unchecked_size); - printk(JFFS2_DBG_LVL "free_size: %#08x\n", c->free_size); - printk(JFFS2_DBG_LVL "erasing_size: %#08x\n", c->erasing_size); - printk(JFFS2_DBG_LVL "bad_size: %#08x\n", c->bad_size); - printk(JFFS2_DBG_LVL "sector_size: %#08x\n", c->sector_size); - printk(JFFS2_DBG_LVL "jffs2_reserved_blocks size: %#08x\n", - c->sector_size * c->resv_blocks_write); - - if (c->nextblock) - printk(JFFS2_DBG_LVL "nextblock: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - c->nextblock->offset, c->nextblock->used_size, - c->nextblock->dirty_size, c->nextblock->wasted_size, - c->nextblock->unchecked_size, c->nextblock->free_size); - else - printk(JFFS2_DBG_LVL "nextblock: NULL\n"); - - if (c->gcblock) - printk(JFFS2_DBG_LVL "gcblock: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - c->gcblock->offset, c->gcblock->used_size, c->gcblock->dirty_size, - c->gcblock->wasted_size, c->gcblock->unchecked_size, c->gcblock->free_size); - else - printk(JFFS2_DBG_LVL "gcblock: NULL\n"); - - if (list_empty(&c->clean_list)) { - printk(JFFS2_DBG_LVL "clean_list: empty\n"); - } else { - struct list_head *this; - int numblocks = 0; - uint32_t dirty = 0; - - list_for_each(this, &c->clean_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - numblocks ++; - dirty += jeb->wasted_size; - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "clean_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - - printk (JFFS2_DBG_LVL "Contains %d blocks with total wasted size %u, average wasted size: %u\n", - numblocks, dirty, dirty / numblocks); - } - - if (list_empty(&c->very_dirty_list)) { - printk(JFFS2_DBG_LVL "very_dirty_list: empty\n"); - } else { - struct list_head *this; - int numblocks = 0; - uint32_t dirty = 0; - - list_for_each(this, &c->very_dirty_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - numblocks ++; - dirty += jeb->dirty_size; - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "very_dirty_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - - printk (JFFS2_DBG_LVL "Contains %d blocks with total dirty size %u, average dirty size: %u\n", - numblocks, dirty, dirty / numblocks); - } - - if (list_empty(&c->dirty_list)) { - printk(JFFS2_DBG_LVL "dirty_list: empty\n"); - } else { - struct list_head *this; - int numblocks = 0; - uint32_t dirty = 0; - - list_for_each(this, &c->dirty_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - numblocks ++; - dirty += jeb->dirty_size; - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "dirty_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - - printk (JFFS2_DBG_LVL "contains %d blocks with total dirty size %u, average dirty size: %u\n", - numblocks, dirty, dirty / numblocks); - } - - if (list_empty(&c->erasable_list)) { - printk(JFFS2_DBG_LVL "erasable_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->erasable_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "erasable_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } - - if (list_empty(&c->erasing_list)) { - printk(JFFS2_DBG_LVL "erasing_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->erasing_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "erasing_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } - - if (list_empty(&c->erase_pending_list)) { - printk(JFFS2_DBG_LVL "erase_pending_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->erase_pending_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "erase_pending_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } - - if (list_empty(&c->erasable_pending_wbuf_list)) { - printk(JFFS2_DBG_LVL "erasable_pending_wbuf_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->erasable_pending_wbuf_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "erasable_pending_wbuf_list: %#08x (used %#08x, dirty %#08x, " - "wasted %#08x, unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } - - if (list_empty(&c->free_list)) { - printk(JFFS2_DBG_LVL "free_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->free_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "free_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } - - if (list_empty(&c->bad_list)) { - printk(JFFS2_DBG_LVL "bad_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->bad_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "bad_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } - - if (list_empty(&c->bad_used_list)) { - printk(JFFS2_DBG_LVL "bad_used_list: empty\n"); - } else { - struct list_head *this; - - list_for_each(this, &c->bad_used_list) { - struct jffs2_eraseblock *jeb = list_entry(this, struct jffs2_eraseblock, list); - - if (!(jeb->used_size == 0 && jeb->dirty_size == 0 && jeb->wasted_size == 0)) { - printk(JFFS2_DBG_LVL "bad_used_list: %#08x (used %#08x, dirty %#08x, wasted %#08x, " - "unchecked %#08x, free %#08x)\n", - jeb->offset, jeb->used_size, jeb->dirty_size, jeb->wasted_size, - jeb->unchecked_size, jeb->free_size); - } - } - } -} - -void -__jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f) -{ - down(&f->sem); - jffs2_dbg_dump_fragtree_nolock(f); - up(&f->sem); -} - -void -__jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f) -{ - struct jffs2_node_frag *this = frag_first(&f->fragtree); - uint32_t lastofs = 0; - int buggy = 0; - - JFFS2_DEBUG("dump fragtree of ino #%u\n", f->inocache->ino); - while(this) { - if (this->node) - printk(JFFS2_DBG_LVL "frag %#04x-%#04x: %#08x(%d) on flash (*%p), left (%p), " - "right (%p), parent (%p)\n", - this->ofs, this->ofs+this->size, ref_offset(this->node->raw), - ref_flags(this->node->raw), this, frag_left(this), frag_right(this), - frag_parent(this)); - else - printk(JFFS2_DBG_LVL "frag %#04x-%#04x: hole (*%p). left (%p), right (%p), parent (%p)\n", - this->ofs, this->ofs+this->size, this, frag_left(this), - frag_right(this), frag_parent(this)); - if (this->ofs != lastofs) - buggy = 1; - lastofs = this->ofs + this->size; - this = frag_next(this); - } - - if (f->metadata) - printk(JFFS2_DBG_LVL "metadata at 0x%08x\n", ref_offset(f->metadata->raw)); - - if (buggy) { - JFFS2_ERROR("frag tree got a hole in it.\n"); - BUG(); - } -} - -#define JFFS2_BUFDUMP_BYTES_PER_LINE 32 -void -__jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs) -{ - int skip; - int i; - - JFFS2_DEBUG("dump from offset %#08x to offset %#08x (%x bytes).\n", - offs, offs + len, len); - i = skip = offs % JFFS2_BUFDUMP_BYTES_PER_LINE; - offs = offs & ~(JFFS2_BUFDUMP_BYTES_PER_LINE - 1); - - if (skip != 0) - printk(JFFS2_DBG_LVL "%#08x: ", offs); - - while (skip--) - printk(" "); - - while (i < len) { - if ((i % JFFS2_BUFDUMP_BYTES_PER_LINE) == 0 && i != len -1) { - if (i != 0) - printk("\n"); - offs += JFFS2_BUFDUMP_BYTES_PER_LINE; - printk(JFFS2_DBG_LVL "%0#8x: ", offs); - } - - printk("%02x ", buf[i]); - - i += 1; - } - - printk("\n"); -} - -/* - * Dump a JFFS2 node. - */ -void -__jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs) -{ - union jffs2_node_union node; - int len = sizeof(union jffs2_node_union); - size_t retlen; - uint32_t crc; - int ret; - - JFFS2_DEBUG("dump node at offset %#08x.\n", ofs); - - ret = jffs2_flash_read(c, ofs, len, &retlen, (unsigned char *)&node); - if (ret || (retlen != len)) { - JFFS2_ERROR("read %d bytes failed or short. ret %d, retlen %zd.\n", - len, ret, retlen); - return; - } - - printk(JFFS2_DBG_LVL "magic:\t%#04x\n", - je16_to_cpu(node.u.magic)); - printk(JFFS2_DBG_LVL "nodetype:\t%#04x\n", - je16_to_cpu(node.u.nodetype)); - printk(JFFS2_DBG_LVL "totlen:\t%#08x\n", - je32_to_cpu(node.u.totlen)); - printk(JFFS2_DBG_LVL "hdr_crc:\t%#08x\n", - je32_to_cpu(node.u.hdr_crc)); - - crc = crc32(0, &node.u, sizeof(node.u) - 4); - if (crc != je32_to_cpu(node.u.hdr_crc)) { - JFFS2_ERROR("wrong common header CRC.\n"); - return; - } - - if (je16_to_cpu(node.u.magic) != JFFS2_MAGIC_BITMASK && - je16_to_cpu(node.u.magic) != JFFS2_OLD_MAGIC_BITMASK) - { - JFFS2_ERROR("wrong node magic: %#04x instead of %#04x.\n", - je16_to_cpu(node.u.magic), JFFS2_MAGIC_BITMASK); - return; - } - - switch(je16_to_cpu(node.u.nodetype)) { - - case JFFS2_NODETYPE_INODE: - - printk(JFFS2_DBG_LVL "the node is inode node\n"); - printk(JFFS2_DBG_LVL "ino:\t%#08x\n", - je32_to_cpu(node.i.ino)); - printk(JFFS2_DBG_LVL "version:\t%#08x\n", - je32_to_cpu(node.i.version)); - printk(JFFS2_DBG_LVL "mode:\t%#08x\n", - node.i.mode.m); - printk(JFFS2_DBG_LVL "uid:\t%#04x\n", - je16_to_cpu(node.i.uid)); - printk(JFFS2_DBG_LVL "gid:\t%#04x\n", - je16_to_cpu(node.i.gid)); - printk(JFFS2_DBG_LVL "isize:\t%#08x\n", - je32_to_cpu(node.i.isize)); - printk(JFFS2_DBG_LVL "atime:\t%#08x\n", - je32_to_cpu(node.i.atime)); - printk(JFFS2_DBG_LVL "mtime:\t%#08x\n", - je32_to_cpu(node.i.mtime)); - printk(JFFS2_DBG_LVL "ctime:\t%#08x\n", - je32_to_cpu(node.i.ctime)); - printk(JFFS2_DBG_LVL "offset:\t%#08x\n", - je32_to_cpu(node.i.offset)); - printk(JFFS2_DBG_LVL "csize:\t%#08x\n", - je32_to_cpu(node.i.csize)); - printk(JFFS2_DBG_LVL "dsize:\t%#08x\n", - je32_to_cpu(node.i.dsize)); - printk(JFFS2_DBG_LVL "compr:\t%#02x\n", - node.i.compr); - printk(JFFS2_DBG_LVL "usercompr:\t%#02x\n", - node.i.usercompr); - printk(JFFS2_DBG_LVL "flags:\t%#04x\n", - je16_to_cpu(node.i.flags)); - printk(JFFS2_DBG_LVL "data_crc:\t%#08x\n", - je32_to_cpu(node.i.data_crc)); - printk(JFFS2_DBG_LVL "node_crc:\t%#08x\n", - je32_to_cpu(node.i.node_crc)); - crc = crc32(0, &node.i, sizeof(node.i) - 8); - if (crc != je32_to_cpu(node.i.node_crc)) { - JFFS2_ERROR("wrong node header CRC.\n"); - return; - } - break; - - case JFFS2_NODETYPE_DIRENT: - - printk(JFFS2_DBG_LVL "the node is dirent node\n"); - printk(JFFS2_DBG_LVL "pino:\t%#08x\n", - je32_to_cpu(node.d.pino)); - printk(JFFS2_DBG_LVL "version:\t%#08x\n", - je32_to_cpu(node.d.version)); - printk(JFFS2_DBG_LVL "ino:\t%#08x\n", - je32_to_cpu(node.d.ino)); - printk(JFFS2_DBG_LVL "mctime:\t%#08x\n", - je32_to_cpu(node.d.mctime)); - printk(JFFS2_DBG_LVL "nsize:\t%#02x\n", - node.d.nsize); - printk(JFFS2_DBG_LVL "type:\t%#02x\n", - node.d.type); - printk(JFFS2_DBG_LVL "node_crc:\t%#08x\n", - je32_to_cpu(node.d.node_crc)); - printk(JFFS2_DBG_LVL "name_crc:\t%#08x\n", - je32_to_cpu(node.d.name_crc)); - - node.d.name[node.d.nsize] = '\0'; - printk(JFFS2_DBG_LVL "name:\t\"%s\"\n", node.d.name); - - crc = crc32(0, &node.d, sizeof(node.d) - 8); - if (crc != je32_to_cpu(node.d.node_crc)) { - JFFS2_ERROR("wrong node header CRC.\n"); - return; - } - break; - - default: - printk(JFFS2_DBG_LVL "node type is unknown\n"); - break; - } -} -#endif /* JFFS2_DBG_DUMPS || JFFS2_DBG_PARANOIA_CHECKS */ diff --git a/components/dfs/filesystems/jffs2/src/debug.h b/components/dfs/filesystems/jffs2/src/debug.h deleted file mode 100644 index 652f59068d..0000000000 --- a/components/dfs/filesystems/jffs2/src/debug.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: debug.h,v 1.1 2005/07/30 15:30:42 asl Exp $ - * - */ -#ifndef _JFFS2_DEBUG_H_ -#define _JFFS2_DEBUG_H_ -#include "jffs2_config.h" -#include - -#ifndef CONFIG_JFFS2_FS_DEBUG -#define CONFIG_JFFS2_FS_DEBUG 0 -#endif - -#if CONFIG_JFFS2_FS_DEBUG == 1 -/* Enable "paranoia" checks and dumps */ -#define JFFS2_DBG_PARANOIA_CHECKS -#define JFFS2_DBG_DUMPS -#define JFFS2_DBG_READINODE_MESSAGES -#define JFFS2_DBG_FRAGTREE_MESSAGES -#define JFFS2_DBG_DENTLIST_MESSAGES -#define JFFS2_DBG_NODEREF_MESSAGES -#define JFFS2_DBG_INOCACHE_MESSAGES -#endif - -#if CONFIG_JFFS2_FS_DEBUG == 2 -#define JFFS2_DBG_FRAGTREE2_MESSAGES -#endif - -/* Enable JFFS2 sanity checks by default */ -#define JFFS2_DBG_SANITY_CHECKS - -/* - * Dx() are mainly used for debugging messages, they must go away and be - * superseded by nicer JFFS2_DBG_XXX() macros... - */ -#if CONFIG_JFFS2_FS_DEBUG > 0 -#define D1(x) x -#else -#define D1(x) -#endif - -#if CONFIG_JFFS2_FS_DEBUG > 1 -#define D2(x) x -#else -#define D2(x) -#endif - -/* The prefixes of JFFS2 messages */ -#define JFFS2_DBG_MSG_PREFIX "[JFFS2 DBG]" -#define JFFS2_ERR_MSG_PREFIX "JFFS2 error: " -#define JFFS2_WARN_MSG_PREFIX "JFFS2 warning: " -#define JFFS2_NOTICE_MSG_PREFIX "JFFS2 notice: " - -#define JFFS2_ERR_LVL KERN_ERR -#define JFFS2_WARN_LVL KERN_WARNING -#define JFFS2_NOTICE_LVL KERN_NOTICE -#define JFFS2_DBG_LVL KERN_DEBUG - -/* JFFS2 message macros */ -#define JFFS2_ERROR(fmt, ...) \ - do { \ - printk(JFFS2_ERR_LVL JFFS2_ERR_MSG_PREFIX " %s: " \ - fmt, __FUNCTION__, ##__VA_ARGS__); \ - } while(0) - -#define JFFS2_WARNING(fmt, ...) \ - do { \ - printk(JFFS2_WARN_LVL JFFS2_WARN_MSG_PREFIX " %s: " \ - fmt, __FUNCTION__, ##__VA_ARGS__); \ - } while(0) - -#define JFFS2_NOTICE(fmt, ...) \ - do { \ - printk(JFFS2_NOTICE_LVL JFFS2_NOTICE_MSG_PREFIX " %s: " \ - fmt, __FUNCTION__, ##__VA_ARGS__); \ - } while(0) - -#define JFFS2_DEBUG(fmt, ...) \ - do { \ - printk(JFFS2_DBG_LVL JFFS2_DBG_MSG_PREFIX " %s: " \ - fmt, __FUNCTION__, ##__VA_ARGS__); \ - } while(0) - -/* - * We split our debugging messages on several parts, depending on the JFFS2 - * subsystem the message belongs to. - */ -/* Read inode debugging messages */ -#ifdef JFFS2_DBG_READINODE_MESSAGES -#define JFFS2_DBG_READINODE(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_READINODE(fmt, ...) -#endif - -/* Fragtree build debugging messages */ -#ifdef JFFS2_DBG_FRAGTREE_MESSAGES -#define JFFS2_DBG_FRAGTREE(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_FRAGTREE(fmt, ...) -#endif - -/* Directory entry list manilulation debugging messages */ -#ifdef JFFS2_DBG_DENTLIST_MESSAGES -#define JFFS2_DBG_DENTLIST(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_DENTLIST(fmt, ...) -#endif -#ifdef JFFS2_DBG_FRAGTREE2_MESSAGES -#define JFFS2_DBG_FRAGTREE2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_FRAGTREE2(fmt, ...) -#endif - -/* Print the messages about manipulating node_refs */ -#ifdef JFFS2_DBG_NODEREF_MESSAGES -#define JFFS2_DBG_NODEREF(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_NODEREF(fmt, ...) -#endif - -/* Manipulations with the list of inodes (JFFS2 inocache) */ -#ifdef JFFS2_DBG_INOCACHE_MESSAGES -#define JFFS2_DBG_INOCACHE(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_INOCACHE(fmt, ...) -#endif - -/* Watch the object allocations */ -#ifdef JFFS2_DBG_MEMALLOC_MESSAGES -#define JFFS2_DBG_MEMALLOC(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) -#else -#define JFFS2_DBG_MEMALLOC(fmt, ...) -#endif - - -/* "Paranoia" checks */ -void -__jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f); -void -__jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f); -void -__jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb); -void -__jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb); -void -__jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, - uint32_t ofs, int len); - -/* "Dump" functions */ -void -__jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void -__jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb); -void -__jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c); -void -__jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c); -void -__jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb); -void -__jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb); -void -__jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f); -void -__jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f); -void -__jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs); -void -__jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs); - -#ifdef JFFS2_DBG_PARANOIA_CHECKS -#define jffs2_dbg_fragtree_paranoia_check(f) \ - __jffs2_dbg_fragtree_paranoia_check(f) -#define jffs2_dbg_fragtree_paranoia_check_nolock(f) \ - __jffs2_dbg_fragtree_paranoia_check_nolock(f) -#define jffs2_dbg_acct_paranoia_check(c, jeb) \ - __jffs2_dbg_acct_paranoia_check(c,jeb) -#define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) \ - __jffs2_dbg_acct_paranoia_check_nolock(c,jeb) -#define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) \ - __jffs2_dbg_prewrite_paranoia_check(c, ofs, len) -#else -#define jffs2_dbg_fragtree_paranoia_check(f) -#define jffs2_dbg_fragtree_paranoia_check_nolock(f) -#define jffs2_dbg_acct_paranoia_check(c, jeb) -#define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) -#define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) -#endif /* !JFFS2_PARANOIA_CHECKS */ - -#ifdef JFFS2_DBG_DUMPS -#define jffs2_dbg_dump_jeb(c, jeb) \ - __jffs2_dbg_dump_jeb(c, jeb); -#define jffs2_dbg_dump_jeb_nolock(jeb) \ - __jffs2_dbg_dump_jeb_nolock(jeb); -#define jffs2_dbg_dump_block_lists(c) \ - __jffs2_dbg_dump_block_lists(c) -#define jffs2_dbg_dump_block_lists_nolock(c) \ - __jffs2_dbg_dump_block_lists_nolock(c) -#define jffs2_dbg_dump_fragtree(f) \ - __jffs2_dbg_dump_fragtree(f); -#define jffs2_dbg_dump_fragtree_nolock(f) \ - __jffs2_dbg_dump_fragtree_nolock(f); -#define jffs2_dbg_dump_buffer(buf, len, offs) \ - __jffs2_dbg_dump_buffer(*buf, len, offs); -#define jffs2_dbg_dump_node(c, ofs) \ - __jffs2_dbg_dump_node(c, ofs); -#else -#define jffs2_dbg_dump_jeb(c, jeb) -#define jffs2_dbg_dump_jeb_nolock(jeb) -#define jffs2_dbg_dump_block_lists(c) -#define jffs2_dbg_dump_block_lists_nolock(c) -#define jffs2_dbg_dump_fragtree(f) -#define jffs2_dbg_dump_fragtree_nolock(f) -#define jffs2_dbg_dump_buffer(buf, len, offs) -#define jffs2_dbg_dump_node(c, ofs) -#endif /* !JFFS2_DBG_DUMPS */ - -/* - * Sanity checks are supposed to be light-weight and enabled by default. - */ -#ifdef JFFS2_DBG_SANITY_CHECKS -/* - * Check the space accounting of the file system and of - * the JFFS2 erasable block 'jeb'. - */ -static inline void -jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - if (unlikely(jeb && jeb->used_size + jeb->dirty_size + - jeb->free_size + jeb->wasted_size + - jeb->unchecked_size != c->sector_size)) { - JFFS2_ERROR("eeep, space accounting for block at 0x%08x is screwed.\n", jeb->offset); - JFFS2_ERROR("free %#08x + dirty %#08x + used %#08x + wasted %#08x + unchecked " - "%#08x != total %#08x.\n", jeb->free_size, jeb->dirty_size, jeb->used_size, - jeb->wasted_size, jeb->unchecked_size, c->sector_size); - BUG(); - } - - if (unlikely(c->used_size + c->dirty_size + c->free_size + c->erasing_size + c->bad_size - + c->wasted_size + c->unchecked_size != c->flash_size)) { - JFFS2_ERROR("eeep, space accounting superblock info is screwed.\n"); - JFFS2_ERROR("free %#08x + dirty %#08x + used %#08x + erasing %#08x + bad %#08x + " - "wasted %#08x + unchecked %#08x != total %#08x.\n", - c->free_size, c->dirty_size, c->used_size, c->erasing_size, c->bad_size, - c->wasted_size, c->unchecked_size, c->flash_size); - BUG(); - } -} - -static inline void -jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - spin_lock(&c->erase_completion_lock); - jffs2_dbg_acct_sanity_check_nolock(c, jeb); - spin_unlock(&c->erase_completion_lock); -} -#else -#define jffs2_dbg_acct_sanity_check(c, jeb) -#define jffs2_dbg_acct_sanity_check_nolock(c, jeb) -#endif /* !JFFS2_DBG_SANITY_CHECKS */ - -#endif /* _JFFS2_DEBUG_H_ */ diff --git a/components/dfs/filesystems/jffs2/src/dir-ecos.c b/components/dfs/filesystems/jffs2/src/dir-ecos.c deleted file mode 100644 index b52b89928f..0000000000 --- a/components/dfs/filesystems/jffs2/src/dir-ecos.c +++ /dev/null @@ -1,369 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Free Software Foundation, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: dir-ecos.c,v 1.11 2005/02/08 19:36:27 lunn Exp $ - * - */ - -#include -#include -#include "nodelist.h" - -/***********************************************************************/ - -/* Takes length argument because it can be either NUL-terminated or '/'-terminated */ -struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *d_name, int namelen) -{ - struct jffs2_inode_info *dir_f; - struct jffs2_full_dirent *fd = NULL, *fd_list; - uint32_t ino = 0; - uint32_t hash = full_name_hash(d_name, namelen); - struct _inode *inode = NULL; - - D1(printk("jffs2_lookup()\n")); - - dir_f = JFFS2_INODE_INFO(dir_i); - - down(&dir_f->sem); - - /* NB: The 2.2 backport will need to explicitly check for '.' and '..' here */ - for (fd_list = dir_f->dents; fd_list && fd_list->nhash <= hash; fd_list = fd_list->next) { - if (fd_list->nhash == hash && - (!fd || fd_list->version > fd->version) && - strlen((char *)fd_list->name) == namelen && - !strncmp((char *)fd_list->name, (char *)d_name, namelen)) { - fd = fd_list; - } - } - if (fd) - ino = fd->ino; - up(&dir_f->sem); - if (ino) { - inode = jffs2_iget(dir_i->i_sb, ino); - if (IS_ERR(inode)) { - printk("jffs2_iget() failed for ino #%u\n", ino); - return inode; - } - } - - return inode; -} - -/***********************************************************************/ - - - -int jffs2_create(struct _inode *dir_i, const unsigned char *d_name, int mode, - struct _inode **new_i) -{ - struct jffs2_raw_inode *ri; - struct jffs2_inode_info *f, *dir_f; - struct jffs2_sb_info *c; - struct _inode *inode; - int ret; - - ri = jffs2_alloc_raw_inode(); - if (!ri) - return -ENOMEM; - - c = JFFS2_SB_INFO(dir_i->i_sb); - - D1(printk(KERN_DEBUG "jffs2_create()\n")); - - inode = jffs2_new_inode(dir_i, mode, ri); - - if (IS_ERR(inode)) { - D1(printk(KERN_DEBUG "jffs2_new_inode() failed\n")); - jffs2_free_raw_inode(ri); - return PTR_ERR(inode); - } - - f = JFFS2_INODE_INFO(inode); - dir_f = JFFS2_INODE_INFO(dir_i); - - ret = jffs2_do_create(c, dir_f, f, ri, - (const char *)d_name, - strlen((char *)d_name)); - - if (ret) { - inode->i_nlink = 0; - jffs2_iput(inode); - jffs2_free_raw_inode(ri); - return ret; - } - - jffs2_free_raw_inode(ri); - - D1(printk(KERN_DEBUG "jffs2_create: Created ino #%lu with mode %o, nlink %d(%d)\n", - inode->i_ino, inode->i_mode, inode->i_nlink, f->inocache->nlink)); - *new_i = inode; - return 0; -} - -/***********************************************************************/ - - -int jffs2_unlink(struct _inode *dir_i, struct _inode *d_inode, const unsigned char *d_name) -{ - struct jffs2_sb_info *c = JFFS2_SB_INFO(dir_i->i_sb); - struct jffs2_inode_info *dir_f = JFFS2_INODE_INFO(dir_i); - struct jffs2_inode_info *dead_f = JFFS2_INODE_INFO(d_inode); - int ret; - - ret = jffs2_do_unlink(c, dir_f, (const char *)d_name, - strlen((char *)d_name), dead_f); - if (dead_f->inocache) - d_inode->i_nlink = dead_f->inocache->nlink; - return ret; -} -/***********************************************************************/ - - -int jffs2_link (struct _inode *old_d_inode, struct _inode *dir_i, const unsigned char *d_name) -{ - struct jffs2_sb_info *c = JFFS2_SB_INFO(old_d_inode->i_sb); - struct jffs2_inode_info *f = JFFS2_INODE_INFO(old_d_inode); - struct jffs2_inode_info *dir_f = JFFS2_INODE_INFO(dir_i); - int ret; - - /* XXX: This is ugly */ - uint8_t type = (old_d_inode->i_mode & S_IFMT) >> 12; - if (!type) type = DT_REG; - - ret = jffs2_do_link(c, dir_f, f->inocache->ino, type, - (const char * )d_name, - strlen((char *)d_name)); - - if (!ret) { - down(&f->sem); - old_d_inode->i_nlink = ++f->inocache->nlink; - up(&f->sem); - } - return ret; -} - -int jffs2_mkdir (struct _inode *dir_i, const unsigned char *d_name, int mode) -{ - struct jffs2_inode_info *f, *dir_f; - struct jffs2_sb_info *c; - struct _inode *inode; - struct jffs2_raw_inode *ri; - struct jffs2_raw_dirent *rd; - struct jffs2_full_dnode *fn; - struct jffs2_full_dirent *fd; - int namelen; - uint32_t alloclen, phys_ofs; - int ret; - - mode |= S_IFDIR; - - ri = jffs2_alloc_raw_inode(); - if (!ri) - return -ENOMEM; - - c = JFFS2_SB_INFO(dir_i->i_sb); - - /* Try to reserve enough space for both node and dirent. - * Just the node will do for now, though - */ - namelen = strlen((char *)d_name); - ret = jffs2_reserve_space(c, sizeof(*ri), &phys_ofs, &alloclen, ALLOC_NORMAL); - - if (ret) { - jffs2_free_raw_inode(ri); - return ret; - } - - inode = jffs2_new_inode(dir_i, mode, ri); - - if (IS_ERR(inode)) { - jffs2_free_raw_inode(ri); - jffs2_complete_reservation(c); - return PTR_ERR(inode); - } - - f = JFFS2_INODE_INFO(inode); - - ri->data_crc = cpu_to_je32(0); - ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); - - fn = jffs2_write_dnode(c, f, ri, NULL, 0, phys_ofs, ALLOC_NORMAL); - - jffs2_free_raw_inode(ri); - - if (IS_ERR(fn)) { - /* Eeek. Wave bye bye */ - up(&f->sem); - jffs2_complete_reservation(c); - inode->i_nlink = 0; - jffs2_iput(inode); - return PTR_ERR(fn); - } - /* No data here. Only a metadata node, which will be - obsoleted by the first data write - */ - f->metadata = fn; - up(&f->sem); - - jffs2_complete_reservation(c); - ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_NORMAL); - if (ret) { - /* Eep. */ - inode->i_nlink = 0; - jffs2_iput(inode); - return ret; - } - - rd = jffs2_alloc_raw_dirent(); - if (!rd) { - /* Argh. Now we treat it like a normal delete */ - jffs2_complete_reservation(c); - inode->i_nlink = 0; - jffs2_iput(inode); - return -ENOMEM; - } - - dir_f = JFFS2_INODE_INFO(dir_i); - down(&dir_f->sem); - - rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); - rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); - rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); - - rd->pino = cpu_to_je32(dir_i->i_ino); - rd->version = cpu_to_je32(++dir_f->highest_version); - rd->ino = cpu_to_je32(inode->i_ino); - rd->mctime = cpu_to_je32(jffs2_get_timestamp()); - rd->nsize = namelen; - rd->type = DT_DIR; - rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); - rd->name_crc = cpu_to_je32(crc32(0, d_name, namelen)); - - fd = jffs2_write_dirent(c, dir_f, rd, d_name, namelen, phys_ofs, ALLOC_NORMAL); - - jffs2_complete_reservation(c); - jffs2_free_raw_dirent(rd); - - if (IS_ERR(fd)) { - /* dirent failed to write. Delete the inode normally - as if it were the final unlink() */ - up(&dir_f->sem); - inode->i_nlink = 0; - jffs2_iput(inode); - return PTR_ERR(fd); - } - - /* Link the fd into the inode's list, obsoleting an old - one if necessary. */ - jffs2_add_fd_to_list(c, fd, &dir_f->dents); - up(&dir_f->sem); - - jffs2_iput(inode); - return 0; -} - -int jffs2_rmdir (struct _inode *dir_i, struct _inode *d_inode, const unsigned char *d_name) -{ - struct jffs2_inode_info *f = JFFS2_INODE_INFO(d_inode); - struct jffs2_full_dirent *fd; - - for (fd = f->dents ; fd; fd = fd->next) { - if (fd->ino) - return EPERM; //-ENOTEMPTY; - } - return jffs2_unlink(dir_i, d_inode, d_name); -} - -int jffs2_rename (struct _inode *old_dir_i, struct _inode *d_inode, const unsigned char *old_d_name, - struct _inode *new_dir_i, const unsigned char *new_d_name) -{ - int ret; - struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb); - struct jffs2_inode_info *victim_f = NULL; - uint8_t type; - -#if 0 /* FIXME -- this really doesn't belong in individual file systems. - The fileio code ought to do this for us, or at least part of it */ - if (new_dentry->d_inode) { - if (S_ISDIR(d_inode->i_mode) && - !S_ISDIR(new_dentry->d_inode->i_mode)) { - /* Cannot rename directory over non-directory */ - return -EINVAL; - } - - victim_f = JFFS2_INODE_INFO(new_dentry->d_inode); - - if (S_ISDIR(new_dentry->d_inode->i_mode)) { - struct jffs2_full_dirent *fd; - - if (!S_ISDIR(d_inode->i_mode)) { - /* Cannot rename non-directory over directory */ - return -EINVAL; - } - down(&victim_f->sem); - for (fd = victim_f->dents; fd; fd = fd->next) { - if (fd->ino) { - up(&victim_f->sem); - return -ENOTEMPTY; - } - } - up(&victim_f->sem); - } - } -#endif - - /* XXX: We probably ought to alloc enough space for - both nodes at the same time. Writing the new link, - then getting -ENOSPC, is quite bad :) - */ - - /* Make a hard link */ - - /* XXX: This is ugly */ - type = (d_inode->i_mode & S_IFMT) >> 12; - if (!type) type = DT_REG; - - ret = jffs2_do_link(c, JFFS2_INODE_INFO(new_dir_i), - d_inode->i_ino, type, - (const char *)new_d_name, - strlen((char *)new_d_name)); - - if (ret) - return ret; - - if (victim_f) { - /* There was a victim. Kill it off nicely */ - /* Don't oops if the victim was a dirent pointing to an - inode which didn't exist. */ - if (victim_f->inocache) { - down(&victim_f->sem); - victim_f->inocache->nlink--; - up(&victim_f->sem); - } - } - - /* Unlink the original */ - ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), - (const char *)old_d_name, - strlen((char *)old_d_name), NULL); - - if (ret) { - /* Oh shit. We really ought to make a single node which can do both atomically */ - struct jffs2_inode_info *f = JFFS2_INODE_INFO(d_inode); - down(&f->sem); - if (f->inocache) - d_inode->i_nlink = f->inocache->nlink++; - up(&f->sem); - - printk(KERN_NOTICE "jffs2_rename(): Link succeeded, unlink failed (err %d). You now have a hard link\n", ret); - } - return ret; -} - diff --git a/components/dfs/filesystems/jffs2/src/dir.txt b/components/dfs/filesystems/jffs2/src/dir.txt deleted file mode 100644 index 93767aa2ba..0000000000 --- a/components/dfs/filesystems/jffs2/src/dir.txt +++ /dev/null @@ -1,70 +0,0 @@ -Îļþ¼Ð PATH Áбí -¾íÐòÁкÅΪ 00000200 38BE:1B05 -F:. -jffs2/dfs_jffs2.c -jffs2/porting.c - -adler32.c - -compress.c -configure -deflate.c - -example.c - -gzio.c - -infback.c -infblock.c - -inffast.c - - -inflate.c - -inftrees.c - -infutil.c - - - - -maketree.c - -minigzip.c - - -trees.c - -uncompr.c - -zutil.c - - -jffs2/crc/crcd -jffs2/crc/crc16.c -jffs2/crc/crc32.c -jffs2/crc/posix_crc.c - -jffs2/kernel/rbtree.c - -jffs2/src/build.c -jffs2/src/compr.c -jffs2/src/compr_rtime.c -jffs2/src/compr_rubin.c -jffs2/src/compr_zlib.c -jffs2/src/debug.c -jffs2/src/dir-ecos.c -jffs2/src/erase.c -jffs2/src/flashio.c -jffs2/src/fs-ecos.c -jffs2/src/gc.c -jffs2/src/gcthread.c -jffs2/src/malloc-ecos.c -jffs2/src/nodelist.c -jffs2/src/nodemgmt.c -jffs2/src/read.c -jffs2/src/readinode.c -jffs2/src/scan.c -jffs2/src/write.c - diff --git a/components/dfs/filesystems/jffs2/src/erase.c b/components/dfs/filesystems/jffs2/src/erase.c deleted file mode 100644 index 3844e1d389..0000000000 --- a/components/dfs/filesystems/jffs2/src/erase.c +++ /dev/null @@ -1,469 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: erase.c,v 1.83 2005/07/22 10:32:08 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include "nodelist.h" - -struct erase_priv_struct { - struct jffs2_eraseblock *jeb; - struct jffs2_sb_info *c; -}; - -#ifndef __ECOS -static void jffs2_erase_callback(struct erase_info *); -#endif -static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset); -static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); - -static void jffs2_erase_block(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb) -{ - int ret; - uint32_t bad_offset; -#ifdef __ECOS - ret = jffs2_flash_erase(c, jeb); - if (!ret) { - jffs2_erase_succeeded(c, jeb); - return; - } - bad_offset = jeb->offset; -#else /* Linux */ - struct erase_info *instr; - - D1(printk(KERN_DEBUG "jffs2_erase_block(): erase block %#08x (range %#08x-%#08x)\n", - jeb->offset, jeb->offset, jeb->offset + c->sector_size)); - instr = kmalloc(sizeof(struct erase_info) + sizeof(struct erase_priv_struct), GFP_KERNEL); - if (!instr) { - printk(KERN_WARNING "kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); - spin_lock(&c->erase_completion_lock); - list_del(&jeb->list); - list_add(&jeb->list, &c->erase_pending_list); - c->erasing_size -= c->sector_size; - c->dirty_size += c->sector_size; - jeb->dirty_size = c->sector_size; - spin_unlock(&c->erase_completion_lock); - return; - } - - memset(instr, 0, sizeof(*instr)); - - instr->mtd = c->mtd; - instr->addr = jeb->offset; - instr->len = c->sector_size; - instr->callback = jffs2_erase_callback; - instr->priv = (unsigned long)(&instr[1]); - instr->fail_addr = 0xffffffff; - - ((struct erase_priv_struct *)instr->priv)->jeb = jeb; - ((struct erase_priv_struct *)instr->priv)->c = c; - - ret = c->mtd->erase(c->mtd, instr); - if (!ret) - return; - - bad_offset = instr->fail_addr; - kfree(instr); -#endif /* __ECOS */ - - if (ret == -ENOMEM || ret == -EAGAIN) { - /* Erase failed immediately. Refile it on the list */ - D1(printk(KERN_DEBUG "Erase at 0x%08x failed: %d. Refiling on erase_pending_list\n", jeb->offset, ret)); - spin_lock(&c->erase_completion_lock); - list_del(&jeb->list); - list_add(&jeb->list, &c->erase_pending_list); - c->erasing_size -= c->sector_size; - c->dirty_size += c->sector_size; - jeb->dirty_size = c->sector_size; - spin_unlock(&c->erase_completion_lock); - return; - } - - if (ret == -EROFS) - printk(KERN_WARNING "Erase at 0x%08x failed immediately: -EROFS. Is the sector locked?\n", jeb->offset); - else - printk(KERN_WARNING "Erase at 0x%08x failed immediately: errno %d\n", jeb->offset, ret); - - jffs2_erase_failed(c, jeb, bad_offset); -} - -void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count) -{ - struct jffs2_eraseblock *jeb; - - down(&c->erase_free_sem); - - spin_lock(&c->erase_completion_lock); - - while (!list_empty(&c->erase_complete_list) || - !list_empty(&c->erase_pending_list)) { - - if (!list_empty(&c->erase_complete_list)) { - jeb = list_entry(c->erase_complete_list.next, struct jffs2_eraseblock, list); - list_del(&jeb->list); - spin_unlock(&c->erase_completion_lock); - jffs2_mark_erased_block(c, jeb); - - if (!--count) { - D1(printk(KERN_DEBUG "Count reached. jffs2_erase_pending_blocks leaving\n")); - goto done; - } - - } else if (!list_empty(&c->erase_pending_list)) { - jeb = list_entry(c->erase_pending_list.next, struct jffs2_eraseblock, list); - D1(printk(KERN_DEBUG "Starting erase of pending block 0x%08x\n", jeb->offset)); - list_del(&jeb->list); - c->erasing_size += c->sector_size; - c->wasted_size -= jeb->wasted_size; - c->free_size -= jeb->free_size; - c->used_size -= jeb->used_size; - c->dirty_size -= jeb->dirty_size; - jeb->wasted_size = jeb->used_size = jeb->dirty_size = jeb->free_size = 0; - jffs2_free_all_node_refs(c, jeb); - list_add(&jeb->list, &c->erasing_list); - spin_unlock(&c->erase_completion_lock); - - jffs2_erase_block(c, jeb); - - } else { - BUG(); - } - - /* Be nice */ - cond_resched(); - spin_lock(&c->erase_completion_lock); - } - - spin_unlock(&c->erase_completion_lock); - done: - D1(printk(KERN_DEBUG "jffs2_erase_pending_blocks completed\n")); - - up(&c->erase_free_sem); -} - -static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) -{ - D1(printk(KERN_DEBUG "Erase completed successfully at 0x%08x\n", jeb->offset)); - spin_lock(&c->erase_completion_lock); - list_del(&jeb->list); - list_add_tail(&jeb->list, &c->erase_complete_list); - spin_unlock(&c->erase_completion_lock); - /* Ensure that kupdated calls us again to mark them clean */ - jffs2_erase_pending_trigger(c); -} - -static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset) -{ - /* For NAND, if the failure did not occur at the device level for a - specific physical page, don't bother updating the bad block table. */ - if (jffs2_cleanmarker_oob(c) && (bad_offset != 0xffffffff)) { - /* We had a device-level failure to erase. Let's see if we've - failed too many times. */ - if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) { - /* We'd like to give this block another try. */ - spin_lock(&c->erase_completion_lock); - list_del(&jeb->list); - list_add(&jeb->list, &c->erase_pending_list); - c->erasing_size -= c->sector_size; - c->dirty_size += c->sector_size; - jeb->dirty_size = c->sector_size; - spin_unlock(&c->erase_completion_lock); - return; - } - } - - spin_lock(&c->erase_completion_lock); - c->erasing_size -= c->sector_size; - c->bad_size += c->sector_size; - list_del(&jeb->list); - list_add(&jeb->list, &c->bad_list); - c->nr_erasing_blocks--; - spin_unlock(&c->erase_completion_lock); - wake_up(&c->erase_wait); -} - -#ifndef __ECOS -static void jffs2_erase_callback(struct erase_info *instr) -{ - struct erase_priv_struct *priv = (void *)instr->priv; - - if(instr->state != MTD_ERASE_DONE) { - printk(KERN_WARNING "Erase at 0x%08x finished, but state != MTD_ERASE_DONE. State is 0x%x instead.\n", instr->addr, instr->state); - jffs2_erase_failed(priv->c, priv->jeb, instr->fail_addr); - } else { - jffs2_erase_succeeded(priv->c, priv->jeb); - } - kfree(instr); -} -#endif /* !__ECOS */ - -/* Hmmm. Maybe we should accept the extra space it takes and make - this a standard doubly-linked list? */ -static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c, - struct jffs2_raw_node_ref *ref, struct jffs2_eraseblock *jeb) -{ - struct jffs2_inode_cache *ic = NULL; - struct jffs2_raw_node_ref **prev; - - prev = &ref->next_in_ino; - - /* Walk the inode's list once, removing any nodes from this eraseblock */ - while (1) { - if (!(*prev)->next_in_ino) { - /* We're looking at the jffs2_inode_cache, which is - at the end of the linked list. Stash it and continue - from the beginning of the list */ - ic = (struct jffs2_inode_cache *)(*prev); - prev = &ic->nodes; - continue; - } - - if (SECTOR_ADDR((*prev)->flash_offset) == jeb->offset) { - /* It's in the block we're erasing */ - struct jffs2_raw_node_ref *this; - - this = *prev; - *prev = this->next_in_ino; - this->next_in_ino = NULL; - - if (this == ref) - break; - - continue; - } - /* Not to be deleted. Skip */ - prev = &((*prev)->next_in_ino); - } - - /* PARANOIA */ - if (!ic) { - printk(KERN_WARNING "inode_cache not found in remove_node_refs()!!\n"); - return; - } - - D1(printk(KERN_DEBUG "Removed nodes in range 0x%08x-0x%08x from ino #%u\n", - jeb->offset, jeb->offset + c->sector_size, ic->ino)); - - D2({ - int i=0; - struct jffs2_raw_node_ref *this; - printk(KERN_DEBUG "After remove_node_refs_from_ino_list: \n" KERN_DEBUG); - - this = ic->nodes; - - while(this) { - printk( "0x%08x(%d)->", ref_offset(this), ref_flags(this)); - if (++i == 5) { - printk("\n" KERN_DEBUG); - i=0; - } - this = this->next_in_ino; - } - printk("\n"); - }); - - if (ic->nodes == (void *)ic && ic->nlink == 0) - jffs2_del_ino_cache(c, ic); -} - -static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) -{ - struct jffs2_raw_node_ref *ref; - D1(printk(KERN_DEBUG "Freeing all node refs for eraseblock offset 0x%08x\n", jeb->offset)); - while(jeb->first_node) { - ref = jeb->first_node; - jeb->first_node = ref->next_phys; - - /* Remove from the inode-list */ - if (ref->next_in_ino) - jffs2_remove_node_refs_from_ino_list(c, ref, jeb); - /* else it was a non-inode node or already removed, so don't bother */ - - jffs2_free_raw_node_ref(ref); - } - jeb->last_node = NULL; -} - -static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t *bad_offset) -{ - void *ebuf; - uint32_t ofs; - size_t retlen; - int ret = -EIO; - - ebuf = kmalloc(PAGE_SIZE, GFP_KERNEL); - if (!ebuf) { - printk(KERN_WARNING "Failed to allocate page buffer for verifying erase at 0x%08x. Refiling\n", jeb->offset); - return -EAGAIN; - } - - D1(printk(KERN_DEBUG "Verifying erase at 0x%08x\n", jeb->offset)); - - for (ofs = jeb->offset; ofs < jeb->offset + c->sector_size; ) { - uint32_t readlen = min((uint32_t)PAGE_SIZE, jeb->offset + c->sector_size - ofs); - int i; - - *bad_offset = ofs; - - ret = jffs2_flash_read(c, ofs, readlen, &retlen, ebuf); - if (ret) { - printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); - goto fail; - } - if (retlen != readlen) { - printk(KERN_WARNING "Short read from newly-erased block at 0x%08x. Wanted %d, got %zd\n", ofs, readlen, retlen); - goto fail; - } - for (i=0; ioffset)); - bad_offset = jeb->offset; - - /* Cleanmarker in oob area or no cleanmarker at all ? */ - if (jffs2_cleanmarker_oob(c) || c->cleanmarker_size == 0) { - - if (jffs2_cleanmarker_oob(c)) { - if (jffs2_write_nand_cleanmarker(c, jeb)) - goto filebad; - } - - jeb->first_node = jeb->last_node = NULL; - jeb->free_size = c->sector_size; - jeb->used_size = 0; - jeb->dirty_size = 0; - jeb->wasted_size = 0; - - } else { - - struct kvec vecs[1]; - #if defined (__GNUC__) - struct jffs2_unknown_node marker = { - .magic = cpu_to_je16(JFFS2_MAGIC_BITMASK), - .nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), - .totlen = cpu_to_je32(c->cleanmarker_size) - }; - #elif defined (MSVC) - struct jffs2_unknown_node marker = { - cpu_to_je16(JFFS2_MAGIC_BITMASK), - cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), - cpu_to_je32(c->cleanmarker_size), - 0 - }; - #else - #endif - - marker_ref = jffs2_alloc_raw_node_ref(); - if (!marker_ref) { - printk(KERN_WARNING "Failed to allocate raw node ref for clean marker. Refiling\n"); - goto refile; - } - - marker.hdr_crc = cpu_to_je32(crc32(0, &marker, sizeof(struct jffs2_unknown_node)-4)); - - vecs[0].iov_base = (unsigned char *) ▮ - vecs[0].iov_len = sizeof(marker); - ret = jffs2_flash_direct_writev(c, vecs, 1, jeb->offset, &retlen); - - if (ret || retlen != sizeof(marker)) { - if (ret) - printk(KERN_WARNING "Write clean marker to block at 0x%08x failed: %d\n", - jeb->offset, ret); - else - printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %zd, got %zd\n", - jeb->offset, sizeof(marker), retlen); - - jffs2_free_raw_node_ref(marker_ref); - goto filebad; - } - - marker_ref->next_in_ino = NULL; - marker_ref->next_phys = NULL; - marker_ref->flash_offset = jeb->offset | REF_NORMAL; - marker_ref->__totlen = c->cleanmarker_size; - - jeb->first_node = jeb->last_node = marker_ref; - - jeb->free_size = c->sector_size - c->cleanmarker_size; - jeb->used_size = c->cleanmarker_size; - jeb->dirty_size = 0; - jeb->wasted_size = 0; - } - - spin_lock(&c->erase_completion_lock); - c->erasing_size -= c->sector_size; - c->free_size += jeb->free_size; - c->used_size += jeb->used_size; - - jffs2_dbg_acct_sanity_check_nolock(c,jeb); - jffs2_dbg_acct_paranoia_check_nolock(c, jeb); - - list_add_tail(&jeb->list, &c->free_list); - c->nr_erasing_blocks--; - c->nr_free_blocks++; - spin_unlock(&c->erase_completion_lock); - wake_up(&c->erase_wait); - return; - -filebad: - spin_lock(&c->erase_completion_lock); - /* Stick it on a list (any list) so erase_failed can take it - right off again. Silly, but shouldn't happen often. */ - list_add(&jeb->list, &c->erasing_list); - spin_unlock(&c->erase_completion_lock); - jffs2_erase_failed(c, jeb, bad_offset); - return; - -refile: - /* Stick it back on the list from whence it came and come back later */ - jffs2_erase_pending_trigger(c); - spin_lock(&c->erase_completion_lock); - list_add(&jeb->list, &c->erase_complete_list); - spin_unlock(&c->erase_completion_lock); - return; -} diff --git a/components/dfs/filesystems/jffs2/src/flashio.c b/components/dfs/filesystems/jffs2/src/flashio.c deleted file mode 100644 index 37c332de70..0000000000 --- a/components/dfs/filesystems/jffs2/src/flashio.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by Dominic Ostrowski - * Contributors: David Woodhouse, Nick Garnett, Richard Panton. - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: flashio.c,v 1.1 2003/11/26 14:09:29 dwmw2 Exp $ - * - */ - -#include -#include "nodelist.h" -#include - -int jffs2_flash_read(struct jffs2_sb_info * c, cyg_uint32 offset, - const size_t size, - size_t * return_size, - unsigned char *buffer) -{ - uint32_t len; - struct super_block *sb = OFNI_BS_2SFFJ(c); - - len = rt_mtd_nor_read(RT_MTD_NOR_DEVICE(sb->s_dev), offset, buffer, size); - if (len != size) - return -EIO; - - * return_size = len; - return ENOERR; -} - -int jffs2_flash_write(struct jffs2_sb_info * c, - cyg_uint32 offset, const size_t size, - size_t * return_size, unsigned char *buffer) -{ - uint32_t len; - struct super_block *sb = OFNI_BS_2SFFJ(c); - - len = rt_mtd_nor_write(RT_MTD_NOR_DEVICE(sb->s_dev), offset, buffer, size); - if (len != size) - return -EIO; - - * return_size = len; - return ENOERR; -} - -int jffs2_flash_erase(struct jffs2_sb_info * c, - struct jffs2_eraseblock * jeb) -{ - rt_err_t result; - struct super_block *sb = OFNI_BS_2SFFJ(c); - - result = rt_mtd_nor_erase_block(RT_MTD_NOR_DEVICE(sb->s_dev), jeb->offset, c->sector_size); - if (result != RT_EOK) - return -EIO; - - return ENOERR; -} - -int jffs2_flash_direct_writev(struct jffs2_sb_info *c, - const struct iovec *vecs, unsigned long count, loff_t to, - size_t * retlen) -{ - unsigned long i; - size_t totlen = 0, thislen; - int ret = 0; - - for (i = 0; i < count; i++) - { - // writes need to be aligned but the data we're passed may not be - // Observation suggests most unaligned writes are small, so we - // optimize for that case. - - if (((vecs[i].iov_len & (sizeof(int) - 1))) || - (((unsigned long) vecs[i].iov_base & (sizeof(unsigned long) - 1)))) - { - // are there iov's after this one? Or is it so much we'd need - // to do multiple writes anyway? - if ((i + 1) < count || vecs[i].iov_len > 256) - { - // cop out and malloc - unsigned long j; - ssize_t sizetomalloc = 0, totvecsize = 0; - char *cbuf, *cbufptr; - - for (j = i; j < count; j++) - totvecsize += vecs[j].iov_len; - - // pad up in case unaligned - sizetomalloc = totvecsize + sizeof(int) - 1; - sizetomalloc &= ~(sizeof(int) - 1); - cbuf = (char *) rt_malloc(sizetomalloc); - // malloc returns aligned memory - if (!cbuf) - { - ret = -ENOMEM; - goto writev_out; - } - cbufptr = cbuf; - for (j = i; j < count; j++) - { - memcpy(cbufptr, vecs[j].iov_base, vecs[j].iov_len); - cbufptr += vecs[j].iov_len; - } - //rt_kprintf("direct_write: offset %d, size %d\n", to, sizetomalloc); - ret = jffs2_flash_write(c, to, sizetomalloc, &thislen, - (unsigned char *) cbuf); - if (thislen > totvecsize) // in case it was aligned up - thislen = totvecsize; - totlen += thislen; - rt_free(cbuf); - goto writev_out; - } - else - { - // otherwise optimize for the common case - int buf[256/sizeof(int)]; // int, so int aligned - size_t lentowrite; - - lentowrite = vecs[i].iov_len; - // pad up in case its unaligned - lentowrite += sizeof(int) - 1; - lentowrite &= ~(sizeof(int) - 1); - memcpy(buf, vecs[i].iov_base, lentowrite); - - //rt_kprintf("direct_write: offset %d, size %d\n", to, lentowrite); - ret = jffs2_flash_write(c, to, lentowrite, &thislen, - (unsigned char *) &buf); - if (thislen > vecs[i].iov_len) - thislen = vecs[i].iov_len; - } - } - else - { - //rt_kprintf("direct_writev: offset %d, size %d\n", to, vecs[i].iov_len); - ret = jffs2_flash_write(c, to, vecs[i].iov_len, &thislen, - vecs[i].iov_base); - } - totlen += thislen; - if (ret || thislen != vecs[i].iov_len) break; - to += vecs[i].iov_len; - } - -writev_out: - if (retlen) *retlen = totlen; - - return ret; -} diff --git a/components/dfs/filesystems/jffs2/src/fs-ecos.c b/components/dfs/filesystems/jffs2/src/fs-ecos.c deleted file mode 100644 index 814d2e3010..0000000000 --- a/components/dfs/filesystems/jffs2/src/fs-ecos.c +++ /dev/null @@ -1,2174 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Free Software Foundation, Inc. - * - * Created by Dominic Ostrowski - * Contributors: David Woodhouse, Nick Garnett, Richard Panton. - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: fs-ecos.c,v 1.44 2005/07/24 15:29:57 dedekind Exp $ - * - */ - -#include //prife for SEEK_SET SEEK_CUR SEEK_END -#include -#include "nodelist.h" -#include -#include -#include "compr.h" -#include - -#include - -//-------------------------------------------- -cyg_mtab_entry *cyg_cdir_mtab_entry = NULL; -cyg_dir cyg_cdir_dir = CYG_DIR_NULL; -//========================================================================== -// Default functions - -__externC int cyg_fileio_enosys() { return ENOSYS; } -__externC int cyg_fileio_erofs() { return EROFS; } -__externC int cyg_fileio_enoerr() { return ENOERR; } -__externC int cyg_fileio_enotdir() { return ENOTDIR; } - -__externC cyg_bool cyg_fileio_seltrue (struct CYG_FILE_TAG *fp, int which, CYG_ADDRWORD info) -{ return 1; } - -//-------------------------------------------- -//========================================================================== -// Forward definitions - -// Filesystem operations -int jffs2_mount(cyg_fstab_entry * fste, cyg_mtab_entry * mte); -static int jffs2_umount(cyg_mtab_entry * mte); -int jffs2_open(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - int mode, cyg_file * fte); -#ifdef CYGOPT_FS_JFFS2_WRITE -static int jffs2_ops_unlink(cyg_mtab_entry * mte, cyg_dir dir, - const char *name); -static int jffs2_ops_mkdir(cyg_mtab_entry * mte, cyg_dir dir, const char *name); -static int jffs2_ops_rmdir(cyg_mtab_entry * mte, cyg_dir dir, const char *name); -static int jffs2_ops_rename(cyg_mtab_entry * mte, cyg_dir dir1, - const char *name1, cyg_dir dir2, const char *name2); -static int jffs2_ops_link(cyg_mtab_entry * mte, cyg_dir dir1, const char *name1, - cyg_dir dir2, const char *name2, int type); -#endif -static int jffs2_opendir(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - cyg_file * fte); -static int jffs2_chdir(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - cyg_dir * dir_out); -static int jffs2_stat(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - struct stat *buf); -static int jffs2_getinfo(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - int key, void *buf, int len); -static int jffs2_setinfo(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - int key, void *buf, int len); - -// File operations -int jffs2_fo_read(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio); -#ifdef CYGOPT_FS_JFFS2_WRITE -static int jffs2_fo_write(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio); -#endif -static int jffs2_fo_lseek(struct CYG_FILE_TAG *fp, off_t * pos, int whence); -static int jffs2_fo_ioctl(struct CYG_FILE_TAG *fp, CYG_ADDRWORD com, - CYG_ADDRWORD data); -static int jffs2_fo_fsync(struct CYG_FILE_TAG *fp, int mode); -static int jffs2_fo_close(struct CYG_FILE_TAG *fp); -static int jffs2_fo_fstat(struct CYG_FILE_TAG *fp, struct stat *buf); -static int jffs2_fo_getinfo(struct CYG_FILE_TAG *fp, int key, void *buf, - int len); -static int jffs2_fo_setinfo(struct CYG_FILE_TAG *fp, int key, void *buf, - int len); - -// Directory operations -static int jffs2_fo_dirread(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio); -static int jffs2_fo_dirlseek(struct CYG_FILE_TAG *fp, off_t * pos, int whence); - - -static int jffs2_read_inode (struct _inode *inode); -static void jffs2_clear_inode (struct _inode *inode); -static int jffs2_truncate_file (struct _inode *inode); - -//========================================================================== -// Filesystem table entries - -// ------------------------------------------------------------------------- -// Fstab entry. -// This defines the entry in the filesystem table. -// For simplicity we use _FILESYSTEM synchronization for all accesses since -// we should never block in any filesystem operations. - -#ifdef CYGOPT_FS_JFFS2_WRITE -FSTAB_ENTRY(jffs2_fste, "jffs2", 0, - CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM, - jffs2_mount, - jffs2_umount, - jffs2_open, - jffs2_ops_unlink, - jffs2_ops_mkdir, - jffs2_ops_rmdir, - jffs2_ops_rename, - jffs2_ops_link, - jffs2_opendir, - jffs2_chdir, jffs2_stat, jffs2_getinfo, jffs2_setinfo); -#else -FSTAB_ENTRY(jffs2_fste, "jffs2", 0, - CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM, - jffs2_mount, - jffs2_umount, - jffs2_open, - (cyg_fsop_unlink *)cyg_fileio_erofs, - (cyg_fsop_mkdir *)cyg_fileio_erofs, - (cyg_fsop_rmdir *)cyg_fileio_erofs, - (cyg_fsop_rename *)cyg_fileio_erofs, - (cyg_fsop_link *)cyg_fileio_erofs, - jffs2_opendir, - jffs2_chdir, jffs2_stat, jffs2_getinfo, jffs2_setinfo); -#endif - -// ------------------------------------------------------------------------- -// File operations. -// This set of file operations are used for normal open files. - -cyg_fileops jffs2_fileops = { - jffs2_fo_read, -#ifdef CYGOPT_FS_JFFS2_WRITE - jffs2_fo_write, -#else - (cyg_fileop_write *) cyg_fileio_erofs, -#endif - jffs2_fo_lseek, - jffs2_fo_ioctl, - cyg_fileio_seltrue, - jffs2_fo_fsync, - jffs2_fo_close, - jffs2_fo_fstat, - jffs2_fo_getinfo, - jffs2_fo_setinfo -}; - -// ------------------------------------------------------------------------- -// Directory file operations. -// This set of operations are used for open directories. Most entries -// point to error-returning stub functions. Only the read, lseek and -// close entries are functional. - -cyg_fileops jffs2_dirops = { - jffs2_fo_dirread, - (cyg_fileop_write *) cyg_fileio_enosys, - jffs2_fo_dirlseek, - (cyg_fileop_ioctl *) cyg_fileio_enosys, - cyg_fileio_seltrue, - (cyg_fileop_fsync *) cyg_fileio_enosys, - jffs2_fo_close, - (cyg_fileop_fstat *) cyg_fileio_enosys, - (cyg_fileop_getinfo *) cyg_fileio_enosys, - (cyg_fileop_setinfo *) cyg_fileio_enosys -}; - -//========================================================================== -// STATIC VARIABLES !!! - -static unsigned char gc_buffer[PAGE_CACHE_SIZE]; //avoids malloc when user may be under memory pressure -static unsigned char n_fs_mounted = 0; // a counter to track the number of jffs2 instances mounted - -//========================================================================== -// Directory operations - -struct jffs2_dirsearch { - struct _inode *dir; // directory to search - const unsigned char *path; // path to follow - struct _inode *node; // Node found - const unsigned char *name; // last name fragment used - int namelen; // name fragment length - cyg_bool last; // last name in path? -}; - -typedef struct jffs2_dirsearch jffs2_dirsearch; - -//========================================================================== -// Ref count and nlink management - - -// FIXME: This seems like real cruft. Wouldn't it be better just to do the -// right thing? -static void icache_evict(struct _inode *root_i, struct _inode *i) -{ - struct _inode *this = root_i, *next; - - restart: - D2(printf("icache_evict\n")); - // If this is an absolute search path from the root, - // remove all cached inodes with i_count of zero (these are only - // held where needed for dotdot filepaths) - while (this) { - next = this->i_cache_next; - if (this != i && this->i_count == 0) { - struct _inode *parent = this->i_parent; - if (this->i_cache_next) - this->i_cache_next->i_cache_prev = this->i_cache_prev; - if (this->i_cache_prev) - this->i_cache_prev->i_cache_next = this->i_cache_next; - jffs2_clear_inode(this); - memset(this, 0x5a, sizeof(*this)); - rt_free(this); - if (parent && parent != this) { - parent->i_count--; - this = root_i; - goto restart; - } - } - this = next; - } -} - -//========================================================================== -// Directory search - -// ------------------------------------------------------------------------- -// init_dirsearch() -// Initialize a dirsearch object to start a search - -static void init_dirsearch(jffs2_dirsearch * ds, - struct _inode *dir, const unsigned char *name) -{ - D2(printf("init_dirsearch name = %s\n", name)); - D2(printf("init_dirsearch dir = %x\n", dir)); - - dir->i_count++; - ds->dir = dir; - ds->path = name; - ds->node = dir; - ds->name = name; - ds->namelen = 0; - ds->last = false; -} - -// ------------------------------------------------------------------------- -// find_entry() -// Search a single directory for the next name in a path and update the -// dirsearch object appropriately. - -static int find_entry(jffs2_dirsearch * ds) -{ - struct _inode *dir = ds->dir; - const unsigned char *name = ds->path; - const unsigned char *n = name; - char namelen = 0; - struct _inode *d; - - D2(printf("find_entry\n")); - - // check that we really have a directory - if (!S_ISDIR(dir->i_mode)) - return ENOTDIR; - - // Isolate the next element of the path name. - while (*n != '\0' && *n != '/') - n++, namelen++; - - // Check if this is the last path element. - while( *n == '/') n++; - if (*n == '\0') - ds->last = true; - - // update name in dirsearch object - ds->name = name; - ds->namelen = namelen; - - if (name[0] == '.') - switch (namelen) { - default: - break; - case 2: - // Dot followed by not Dot, treat as any other name - if (name[1] != '.') - break; - // Dot Dot - // Move back up the search path - D2(printf("find_entry found ..\n")); - ds->dir = ds->node; - ds->node = ds->dir->i_parent; - ds->node->i_count++; - return ENOERR; - case 1: - // Dot is consumed - D2(printf("find_entry found .\n")); - ds->node = ds->dir; - ds->dir->i_count++; - return ENOERR; - } - - // Here we have the name and its length set up. - // Search the directory for a matching entry - - D2(printf("find_entry for name = %s\n", ds->path)); - d = jffs2_lookup(dir, name, namelen); - D2(printf("find_entry got dir = %x\n", d)); - - if (d == NULL) - return ENOENT; - if (IS_ERR(d)) - return -PTR_ERR(d); - - // If it's a new directory inode, increase refcount on its parent - if (S_ISDIR(d->i_mode) && !d->i_parent) { - d->i_parent = dir; - dir->i_count++; - } - - // pass back the node we have found - ds->node = d; - return ENOERR; - -} - -// ------------------------------------------------------------------------- -// jffs2_find() -// Main interface to directory search code. This is used in all file -// level operations to locate the object named by the pathname. - -// Returns with use count incremented on both the sought object and -// the directory it was found in -static int jffs2_find(jffs2_dirsearch * d) -{ - int err; - - D2(printf("jffs2_find for path =%s\n", d->path)); - - // Short circuit empty paths - if (*(d->path) == '\0') { - d->node->i_count++; - return ENOERR; - } - - // iterate down directory tree until we find the object - // we want. - for (;;) { - err = find_entry(d); - - if (err != ENOERR) - return err; - - if (d->last) - return ENOERR; - - /* We're done with it, although it we found a subdir that - will have caused the refcount to have been increased */ - jffs2_iput(d->dir); - - // Update dirsearch object to search next directory. - d->dir = d->node; - d->path += d->namelen; - while (*(d->path) == '/') - d->path++; // skip dirname separators - } -} - -//========================================================================== -// Pathconf support -// This function provides support for pathconf() and fpathconf(). - -static int jffs2_pathconf(struct _inode *node, struct cyg_pathconf_info *info) -{ - int err = ENOERR; - D2(printf("jffs2_pathconf\n")); - - switch (info->name) { - case _PC_LINK_MAX: - info->value = LINK_MAX; - break; - - case _PC_MAX_CANON: - info->value = -1; // not supported - err = EINVAL; - break; - - case _PC_MAX_INPUT: - info->value = -1; // not supported - err = EINVAL; - break; - - case _PC_NAME_MAX: - info->value = JFFS2_NAME_MAX; - break; - - case _PC_PATH_MAX: - info->value = JFFS2_PATH_MAX; - break; - - case _PC_PIPE_BUF: - info->value = -1; // not supported - err = EINVAL; - break; - - case _PC_ASYNC_IO: - info->value = -1; // not supported - err = EINVAL; - break; - - case _PC_CHOWN_RESTRICTED: - info->value = -1; // not supported - err = EINVAL; - break; - - case _PC_NO_TRUNC: - info->value = 0; - break; - - case _PC_PRIO_IO: - info->value = 0; - break; - - case _PC_SYNC_IO: - info->value = 0; - break; - - case _PC_VDISABLE: - info->value = -1; // not supported - err = EINVAL; - break; - - default: - err = EINVAL; - break; - } - - return err; -} - -//========================================================================== -// Filesystem operations -// ------------------------------------------------------------------------- -// jffs2_mount() -// Process a mount request. This mainly creates a root for the -// filesystem. -static int jffs2_read_super(struct super_block *sb) -{ - Cyg_ErrNo err; - struct jffs2_sb_info *c; - struct rt_mtd_nor_device *device; - - c = JFFS2_SB_INFO(sb); - device = RT_MTD_NOR_DEVICE(sb->s_dev); - - /* initialize mutex lock */ - init_MUTEX(&c->alloc_sem); - init_MUTEX(&c->erase_free_sem); - - /* sector size is the erase block size */ - c->sector_size = device->block_size; - c->flash_size = (device->block_end - device->block_start) * device->block_size; - c->cleanmarker_size = sizeof(struct jffs2_unknown_node); - - err = jffs2_do_mount_fs(c); - if (err) return -err; - - D1(printk(KERN_DEBUG "jffs2_read_super(): Getting root inode\n")); - sb->s_root = jffs2_iget(sb, 1); - if (IS_ERR(sb->s_root)) { - D1(printk(KERN_WARNING "get root inode failed\n")); - err = PTR_ERR(sb->s_root); - sb->s_root = NULL; - goto out_nodes; - } - return 0; - -out_nodes: - jffs2_free_ino_caches(c); - jffs2_free_raw_node_refs(c); - rt_free(c->blocks); - - return err; -} - -int jffs2_mount(cyg_fstab_entry * fste, cyg_mtab_entry * mte) -{ -// extern cyg_mtab_entry cyg_mtab[], cyg_mtab_end; - struct super_block *jffs2_sb = NULL; - struct jffs2_sb_info *c; -// cyg_mtab_entry *m; - cyg_io_handle_t t; - Cyg_ErrNo err; - - D2(printf("jffs2_mount\n")); - -//prife -// err = cyg_io_lookup(mte->devname, &t); -// if (err != ENOERR) -// return -err; - -// // Iterate through the mount table to see if we're mounted -// // FIXME: this should be done better - perhaps if the superblock -// // can be stored as an inode in the icache. -// for (m = &cyg_mtab[0]; m != &cyg_mtab_end; m++) { -// // stop if there are more than the configured maximum -// if (m - &cyg_mtab[0] >= CYGNUM_FILEIO_MTAB_MAX) { -// m = &cyg_mtab_end; -// break; -// } -// if (m->valid && strcmp(m->fsname, "jffs2") == 0 && -// strcmp(m->devname, mte->devname) == 0) { -// jffs2_sb = (struct super_block *) m->data; -// } -// } - jffs2_sb = NULL; - t = (cyg_io_handle_t)mte->data; //get from dfs_jffs2; - if (jffs2_sb == NULL) { - jffs2_sb = rt_malloc(sizeof (struct super_block)); - - if (jffs2_sb == NULL) - return ENOMEM; - - c = JFFS2_SB_INFO(jffs2_sb); - memset(jffs2_sb, 0, sizeof (struct super_block)); - jffs2_sb->s_dev = t; - - c->inocache_list = rt_malloc(sizeof(struct jffs2_inode_cache *) * INOCACHE_HASHSIZE); - if (!c->inocache_list) { - rt_free(jffs2_sb); - return ENOMEM; - } - memset(c->inocache_list, 0, sizeof(struct jffs2_inode_cache *) * INOCACHE_HASHSIZE); - if (n_fs_mounted++ == 0) { - jffs2_create_slab_caches(); // No error check, cannot fail - jffs2_compressors_init(); - } - - err = jffs2_read_super(jffs2_sb); - - if (err) { - if (--n_fs_mounted == 0) { - jffs2_destroy_slab_caches(); - jffs2_compressors_exit(); - } - - rt_free(jffs2_sb); - rt_free(c->inocache_list); - return err; - } - - jffs2_sb->s_root->i_parent = jffs2_sb->s_root; // points to itself, no dotdot paths above mountpoint - jffs2_sb->s_root->i_cache_prev = NULL; // root inode, so always null - jffs2_sb->s_root->i_cache_next = NULL; - jffs2_sb->s_root->i_count = 1; // Ensures the root inode is always in ram until umount - - D2(printf("jffs2_mount erasing pending blocks\n")); -#ifdef CYGOPT_FS_JFFS2_WRITE - if (!jffs2_is_readonly(c)) - jffs2_erase_pending_blocks(c,0); -#endif -#ifdef CYGOPT_FS_JFFS2_GCTHREAD - jffs2_start_garbage_collect_thread(c); -#endif - } - mte->data = (CYG_ADDRWORD) jffs2_sb; - - jffs2_sb->s_mount_count++; - mte->root = (cyg_dir) jffs2_sb->s_root; - D2(printf("jffs2_mounted superblock at %x\n", mte->root)); - - return ENOERR; -} - -extern cyg_dir cyg_cdir_dir; -extern cyg_mtab_entry *cyg_cdir_mtab_entry; - -// ------------------------------------------------------------------------- -// jffs2_umount() -// Unmount the filesystem. - -static int jffs2_umount(cyg_mtab_entry * mte) -{ - struct _inode *root = (struct _inode *) mte->root; - struct super_block *jffs2_sb = root->i_sb; - struct jffs2_sb_info *c = JFFS2_SB_INFO(jffs2_sb); - struct jffs2_full_dirent *fd, *next; - - D2(printf("jffs2_umount\n")); - - // Only really umount if this is the only mount - if (jffs2_sb->s_mount_count == 1) { - icache_evict(root, NULL); - if (root->i_cache_next != NULL) { - struct _inode *inode = root; - printf("Refuse to unmount.\n"); - while (inode) { - printf("Ino #%u has use count %d\n", - inode->i_ino, inode->i_count); - inode = inode->i_cache_next; - } - // root icount was set to 1 on mount - return EBUSY; - } - if (root->i_count == 2 && - cyg_cdir_mtab_entry == mte && - cyg_cdir_dir == (cyg_dir)root && - !strcmp(mte->name, "/")) { - /* If we were mounted on root, there's no - way for the cwd to change out and free - the file system for unmounting. So we hack - it -- if cwd is '/' we unset it. Perhaps - we should allow chdir(NULL) to unset - cyg_cdir_dir? */ - cyg_cdir_dir = CYG_DIR_NULL; - jffs2_iput(root); - } - /* Argh. The fileio code sets this; never clears it */ - if (cyg_cdir_mtab_entry == mte) - cyg_cdir_mtab_entry = NULL; - - if (root->i_count != 1) { - printf("Ino #1 has use count %d\n", - root->i_count); - return EBUSY; - } -#ifdef CYGOPT_FS_JFFS2_GCTHREAD - jffs2_stop_garbage_collect_thread(c); -#endif - jffs2_iput(root); // Time to free the root inode - - // free directory entries - for (fd = root->jffs2_i.dents; fd; fd = next) { - next=fd->next; - jffs2_free_full_dirent(fd); - } - - rt_free(root); - //Clear root inode - //root_i = NULL; - - // Clean up the super block and root inode - jffs2_free_ino_caches(c); - jffs2_free_raw_node_refs(c); - rt_free(c->blocks); - rt_free(c->inocache_list); - rt_free(jffs2_sb); - // Clear superblock & root pointer - mte->root = CYG_DIR_NULL; - mte->data = 0; - mte->fs->data = 0; // fstab entry, visible to all mounts. No current mount - // That's all folks. - D2(printf("jffs2_umount No current mounts\n")); - } else { - jffs2_sb->s_mount_count--; - } - if (--n_fs_mounted == 0) { - jffs2_destroy_slab_caches(); - jffs2_compressors_exit(); - } - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_open() -// Open a file for reading or writing. - -int jffs2_open(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - int mode, cyg_file * file) -{ - - jffs2_dirsearch ds; - struct _inode *node = NULL; - int err; - - D2(printf("jffs2_open\n")); - - /* If no chdir has been called and we were the first file system - mounted, we get called with dir == NULL. Deal with it */ - if (!dir) - dir = mte->root; - -#ifndef CYGOPT_FS_JFFS2_WRITE - if (mode & (O_CREAT|O_TRUNC|O_WRONLY)) - return EROFS; -#endif - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *) name); - - err = jffs2_find(&ds); - - if (err == ENOENT) { -#ifdef CYGOPT_FS_JFFS2_WRITE - if (ds.last && (mode & O_CREAT)) { - - // No node there, if the O_CREAT bit is set then we must - // create a new one. The dir and name fields of the dirsearch - // object will have been updated so we know where to put it. - - err = jffs2_create(ds.dir, ds.name, S_IRUGO|S_IXUGO|S_IWUSR|S_IFREG, &node); - - if (err != 0) { - //Possible orphaned inode on the flash - but will be gc'd - jffs2_iput(ds.dir); - return -err; - } - - err = ENOERR; - } -#endif - } else if (err == ENOERR) { - // The node exists. If the O_CREAT and O_EXCL bits are set, we - // must fail the open. - - if ((mode & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) { - jffs2_iput(ds.node); - err = EEXIST; - } else - node = ds.node; - } - - // Finished with the directory now - jffs2_iput(ds.dir); - - if (err != ENOERR) - return err; - - // Check that we actually have a file here - if (S_ISDIR(node->i_mode)) { - jffs2_iput(node); - return EISDIR; - } - - // If the O_TRUNC bit is set we must clean out the file data. - if (mode & O_TRUNC) { -#ifdef CYGOPT_FS_JFFS2_WRITE - err = jffs2_truncate_file(node); - if (err) { - jffs2_iput(node); - return err; - } -#else - jffs2_iput(node); - return EROFS; -#endif - } - - // Initialise the file object - file->f_flag = mode & CYG_FILE_MODE_MASK; - file->f_type = CYG_FILE_TYPE_FILE; - file->f_ops = &jffs2_fileops; - file->f_offset = (mode & O_APPEND) ? node->i_size : 0; - file->f_data = (CYG_ADDRWORD) node; - file->f_xops = 0; - - return ENOERR; -} - -#ifdef CYGOPT_FS_JFFS2_WRITE -// ------------------------------------------------------------------------- -// jffs2_ops_unlink() -// Remove a file link from its directory. - -static int jffs2_ops_unlink(cyg_mtab_entry * mte, cyg_dir dir, const char *name) -{ - jffs2_dirsearch ds; - int err; - - D2(printf("jffs2_ops_unlink\n")); - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *)name); - - err = jffs2_find(&ds); - - if (err != ENOERR) { - jffs2_iput(ds.dir); - return err; - } - - // Cannot unlink directories, use rmdir() instead - if (S_ISDIR(ds.node->i_mode)) { - jffs2_iput(ds.dir); - jffs2_iput(ds.node); - return EPERM; - } - - // Delete it from its directory - - err = jffs2_unlink(ds.dir, ds.node, ds.name); - jffs2_iput(ds.dir); - jffs2_iput(ds.node); - - return -err; -} - -// ------------------------------------------------------------------------- -// jffs2_ops_mkdir() -// Create a new directory. - -static int jffs2_ops_mkdir(cyg_mtab_entry * mte, cyg_dir dir, const char *name) -{ - jffs2_dirsearch ds; - int err; - - D2(printf("jffs2_ops_mkdir\n")); - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *)name); - - err = jffs2_find(&ds); - - if (err == ENOENT) { - if (ds.last) { - // The entry does not exist, and it is the last element in - // the pathname, so we can create it here. - - err = -jffs2_mkdir(ds.dir, ds.name, S_IRUGO|S_IXUGO|S_IWUSR); - } - // If this was not the last element, then an intermediate - // directory does not exist. - } else { - // If there we no error, something already exists with that - // name, so we cannot create another one. - if (err == ENOERR) { - jffs2_iput(ds.node); - err = EEXIST; - } - } - jffs2_iput(ds.dir); - return err; -} - -// ------------------------------------------------------------------------- -// jffs2_ops_rmdir() -// Remove a directory. - -static int jffs2_ops_rmdir(cyg_mtab_entry * mte, cyg_dir dir, const char *name) -{ - jffs2_dirsearch ds; - int err; - - D2(printf("jffs2_ops_rmdir\n")); - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *)name); - - err = jffs2_find(&ds); - - if (err != ENOERR) { - jffs2_iput(ds.dir); - return err; - } - - // Check that this is actually a directory. - if (!S_ISDIR(ds.node->i_mode)) { - jffs2_iput(ds.dir); - jffs2_iput(ds.node); - return EPERM; - } - - err = jffs2_rmdir(ds.dir, ds.node, ds.name); - - jffs2_iput(ds.dir); - jffs2_iput(ds.node); - return -err; -} - -// ------------------------------------------------------------------------- -// jffs2_ops_rename() -// Rename a file/dir. - -static int jffs2_ops_rename(cyg_mtab_entry * mte, cyg_dir dir1, - const char *name1, cyg_dir dir2, const char *name2) -{ - jffs2_dirsearch ds1, ds2; - int err; - - D2(printf("jffs2_ops_rename\n")); - - init_dirsearch(&ds1, (struct _inode *) dir1, - (const unsigned char *)name1); - - err = jffs2_find(&ds1); - - if (err != ENOERR) { - jffs2_iput(ds1.dir); - return err; - } - - init_dirsearch(&ds2, (struct _inode *) dir2, - (const unsigned char *)name2); - - err = jffs2_find(&ds2); - - // Allow through renames to non-existent objects. - if (ds2.last && err == ENOENT) { - ds2.node = NULL; - err = ENOERR; - } - - if (err != ENOERR) { - jffs2_iput(ds1.dir); - jffs2_iput(ds1.node); - jffs2_iput(ds2.dir); - return err; - } - - // Null rename, just return - if (ds1.node == ds2.node) { - err = ENOERR; - goto out; - } - - // First deal with any entry that is at the destination - if (ds2.node) { - // Check that we are renaming like-for-like - - if (!S_ISDIR(ds1.node->i_mode) && S_ISDIR(ds2.node->i_mode)) { - err = EISDIR; - goto out; - } - - if (S_ISDIR(ds1.node->i_mode) && !S_ISDIR(ds2.node->i_mode)) { - err = ENOTDIR; - goto out; - } - - // Now delete the destination directory entry - /* Er, what happened to atomicity of rename()? */ - err = -jffs2_unlink(ds2.dir, ds2.node, ds2.name); - - if (err != 0) - goto out; - - } - // Now we know that there is no clashing node at the destination, - // make a new direntry at the destination and delete the old entry - // at the source. - - err = -jffs2_rename(ds1.dir, ds1.node, ds1.name, ds2.dir, ds2.name); - - // Update directory times - if (!err) - ds1.dir->i_ctime = - ds1.dir->i_mtime = - ds2.dir->i_ctime = ds2.dir->i_mtime = jffs2_get_timestamp(); - out: - jffs2_iput(ds1.dir); - if (S_ISDIR(ds1.node->i_mode)) { - /* Renamed a directory to elsewhere... so fix up its - i_parent pointer and the i_counts of its old and - new parents. */ - jffs2_iput(ds1.node->i_parent); - ds1.node->i_parent = ds2.dir; - /* We effectively increase its use count by not... */ - } else { - jffs2_iput(ds2.dir); /* ... doing this */ - } - jffs2_iput(ds1.node); - if (ds2.node) - jffs2_iput(ds2.node); - - return err; -} - -// ------------------------------------------------------------------------- -// jffs2_ops_link() -// Make a new directory entry for a file. - -static int jffs2_ops_link(cyg_mtab_entry * mte, cyg_dir dir1, const char *name1, - cyg_dir dir2, const char *name2, int type) -{ - jffs2_dirsearch ds1, ds2; - int err; - - D2(printf("jffs2_ops_link\n")); - - // Only do hard links for now in this filesystem - if (type != CYG_FSLINK_HARD) - return EINVAL; - - init_dirsearch(&ds1, (struct _inode *) dir1, - (const unsigned char *) name1); - - err = jffs2_find(&ds1); - - if (err != ENOERR) { - jffs2_iput(ds1.dir); - return err; - } - - init_dirsearch(&ds2, (struct _inode *) dir2, - (const unsigned char *) name2); - - err = jffs2_find(&ds2); - - // Don't allow links to existing objects - if (err == ENOERR) { - jffs2_iput(ds1.dir); - jffs2_iput(ds1.node); - jffs2_iput(ds2.dir); - jffs2_iput(ds2.node); - return EEXIST; - } - - // Allow through links to non-existing terminal objects - if (ds2.last && err == ENOENT) { - ds2.node = NULL; - err = ENOERR; - } - - if (err != ENOERR) { - jffs2_iput(ds1.dir); - jffs2_iput(ds1.node); - jffs2_iput(ds2.dir); - return err; - } - - // Now we know that there is no existing node at the destination, - // make a new direntry at the destination. - - err = jffs2_link(ds1.node, ds2.dir, ds2.name); - - if (err == 0) - ds1.node->i_ctime = - ds2.dir->i_ctime = ds2.dir->i_mtime = jffs2_get_timestamp(); - - jffs2_iput(ds1.dir); - jffs2_iput(ds1.node); - jffs2_iput(ds2.dir); - - return -err; -} -#endif /* CYGOPT_FS_JFFS2_WRITE */ -// ------------------------------------------------------------------------- -// jffs2_opendir() -// Open a directory for reading. - -static int jffs2_opendir(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - cyg_file * file) -{ - jffs2_dirsearch ds; - int err; - - D2(printf("jffs2_opendir\n")); - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *) name); - - err = jffs2_find(&ds); - - jffs2_iput(ds.dir); - - if (err != ENOERR) - return err; - - // check it is really a directory. - if (!S_ISDIR(ds.node->i_mode)) { - jffs2_iput(ds.node); - return ENOTDIR; - } - - // Initialize the file object, setting the f_ops field to a - // special set of file ops. - - file->f_flag = 0; - file->f_type = CYG_FILE_TYPE_FILE; - file->f_ops = &jffs2_dirops; - file->f_offset = 0; - file->f_data = (CYG_ADDRWORD) ds.node; - file->f_xops = 0; - - return ENOERR; - -} - -// ------------------------------------------------------------------------- -// jffs2_chdir() -// Change directory support. - -static int jffs2_chdir(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - cyg_dir * dir_out) -{ - D2(printf("jffs2_chdir\n")); - - if (dir_out != NULL) { - // This is a request to get a new directory pointer in - // *dir_out. - - jffs2_dirsearch ds; - int err; - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *) name); - - err = jffs2_find(&ds); - jffs2_iput(ds.dir); - - if (err != ENOERR) - return err; - - // check it is a directory - if (!S_ISDIR(ds.node->i_mode)) { - jffs2_iput(ds.node); - return ENOTDIR; - } - - // Pass it out - *dir_out = (cyg_dir) ds.node; - } else { - // If no output dir is required, this means that the mte and - // dir arguments are the current cdir setting and we should - // forget this fact. - - struct _inode *node = (struct _inode *) dir; - - // Just decrement directory reference count. - jffs2_iput(node); - } - - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_stat() -// Get struct stat info for named object. - -static int jffs2_stat(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - struct stat *buf) -{ - jffs2_dirsearch ds; - int err; - - D2(printf("jffs2_stat\n")); - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *) name); - - err = jffs2_find(&ds); - jffs2_iput(ds.dir); - - if (err != ENOERR) - return err; - - // Fill in the status - buf->st_mode = ds.node->i_mode; - buf->st_ino = ds.node->i_ino; - buf->st_dev = 0; - buf->st_nlink = ds.node->i_nlink; - buf->st_uid = ds.node->i_uid; - buf->st_gid = ds.node->i_gid; - buf->st_size = ds.node->i_size; - buf->st_atime = ds.node->i_atime; - buf->st_mtime = ds.node->i_mtime; - buf->st_ctime = ds.node->i_ctime; - - jffs2_iput(ds.node); - - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_getinfo() -// Getinfo. Currently only support pathconf(). - -static int jffs2_getinfo(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - int key, void *buf, int len) -{ - jffs2_dirsearch ds; - int err; - - D2(printf("jffs2_getinfo\n")); - - init_dirsearch(&ds, (struct _inode *) dir, - (const unsigned char *) name); - - err = jffs2_find(&ds); - jffs2_iput(ds.dir); - - if (err != ENOERR) - return err; - - switch (key) { - case FS_INFO_CONF: - err = jffs2_pathconf(ds.node, (struct cyg_pathconf_info *) buf); - break; - - default: - err = EINVAL; - } - - jffs2_iput(ds.node); - return err; -} - -// ------------------------------------------------------------------------- -// jffs2_setinfo() -// Setinfo. Nothing to support here at present. - -static int jffs2_setinfo(cyg_mtab_entry * mte, cyg_dir dir, const char *name, - int key, void *buf, int len) -{ - // No setinfo keys supported at present - - D2(printf("jffs2_setinfo\n")); - - return EINVAL; -} - -//========================================================================== -// File operations - -// ------------------------------------------------------------------------- -// jffs2_fo_read() -// Read data from the file. - -int jffs2_fo_read(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio) -{ - struct _inode *inode = (struct _inode *) fp->f_data; - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - int i; - ssize_t resid = uio->uio_resid; - off_t pos = fp->f_offset; - - down(&f->sem); - - // Loop over the io vectors until there are none left - for (i = 0; i < uio->uio_iovcnt && pos < inode->i_size; i++) { - int ret; - cyg_iovec *iov = &uio->uio_iov[i]; - off_t len = min(iov->iov_len, inode->i_size - pos); - - D2(printf("jffs2_fo_read inode size %d\n", inode->i_size)); - - ret = - jffs2_read_inode_range(c, f, - (unsigned char *) iov->iov_base, pos, - len); - if (ret) { - D1(printf - ("jffs2_fo_read(): read_inode_range failed %d\n", - ret)); - uio->uio_resid = resid; - up(&f->sem); - return -ret; - } - resid -= len; - pos += len; - } - - // We successfully read some data, update the node's access time - // and update the file offset and transfer residue. - - inode->i_atime = jffs2_get_timestamp(); - - uio->uio_resid = resid; - fp->f_offset = pos; - - up(&f->sem); - - return ENOERR; -} - - -#ifdef CYGOPT_FS_JFFS2_WRITE -// ------------------------------------------------------------------------- -// jffs2_fo_write() -// Write data to file. -static int jffs2_extend_file (struct _inode *inode, struct jffs2_raw_inode *ri, - unsigned long offset) -{ - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - struct jffs2_full_dnode *fn; - uint32_t phys_ofs, alloc_len; - int ret = 0; - - /* Make new hole frag from old EOF to new page */ - D1(printk(KERN_DEBUG "Writing new hole frag 0x%x-0x%x between current EOF and new page\n", - (unsigned int)inode->i_size, offset)); - - ret = jffs2_reserve_space(c, sizeof(*ri), &phys_ofs, &alloc_len, ALLOC_NORMAL); - if (ret) - return ret; - - down(&f->sem); - - ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri->totlen = cpu_to_je32(sizeof(*ri)); - ri->hdr_crc = cpu_to_je32(crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)); - - ri->version = cpu_to_je32(++f->highest_version); - ri->isize = cpu_to_je32(max((uint32_t)inode->i_size, offset)); - - ri->offset = cpu_to_je32(inode->i_size); - ri->dsize = cpu_to_je32(offset - inode->i_size); - ri->csize = cpu_to_je32(0); - ri->compr = JFFS2_COMPR_ZERO; - ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); - ri->data_crc = cpu_to_je32(0); - - fn = jffs2_write_dnode(c, f, ri, NULL, 0, phys_ofs, ALLOC_NORMAL); - jffs2_complete_reservation(c); - if (IS_ERR(fn)) { - ret = PTR_ERR(fn); - up(&f->sem); - return ret; - } - ret = jffs2_add_full_dnode_to_inode(c, f, fn); - if (f->metadata) { - jffs2_mark_node_obsolete(c, f->metadata->raw); - jffs2_free_full_dnode(f->metadata); - f->metadata = NULL; - } - if (ret) { - D1(printk(KERN_DEBUG "Eep. add_full_dnode_to_inode() failed in prepare_write, returned %d\n", ret)); - jffs2_mark_node_obsolete(c, fn->raw); - jffs2_free_full_dnode(fn); - up(&f->sem); - return ret; - } - inode->i_size = offset; - up(&f->sem); - return 0; -} - -// jffs2_fo_open() -// Truncate a file -static int jffs2_truncate_file (struct _inode *inode) -{ - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - struct jffs2_full_dnode *new_metadata, * old_metadata; - struct jffs2_raw_inode *ri; - uint32_t phys_ofs, alloclen; - int err; - - ri = jffs2_alloc_raw_inode(); - if (!ri) { - return ENOMEM; - } - err = jffs2_reserve_space(c, sizeof(*ri), &phys_ofs, &alloclen, ALLOC_NORMAL); - - if (err) { - jffs2_free_raw_inode(ri); - return err; - } - down(&f->sem); - ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri->totlen = cpu_to_je32(sizeof(*ri)); - ri->hdr_crc = cpu_to_je32(crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)); - - ri->ino = cpu_to_je32(inode->i_ino); - ri->version = cpu_to_je32(++f->highest_version); - - ri->uid = cpu_to_je16(inode->i_uid); - ri->gid = cpu_to_je16(inode->i_gid); - ri->mode = cpu_to_jemode(inode->i_mode); - ri->isize = cpu_to_je32(0); - ri->atime = cpu_to_je32(inode->i_atime); - ri->mtime = cpu_to_je32(jffs2_get_timestamp()); - ri->offset = cpu_to_je32(0); - ri->csize = ri->dsize = cpu_to_je32(0); - ri->compr = JFFS2_COMPR_NONE; - ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); - ri->data_crc = cpu_to_je32(0); - new_metadata = jffs2_write_dnode(c, f, ri, NULL, 0, - phys_ofs, ALLOC_NORMAL); - if (IS_ERR(new_metadata)) { - jffs2_complete_reservation(c); - jffs2_free_raw_inode(ri); - up(&f->sem); - return PTR_ERR(new_metadata); - } - - /* It worked. Update the inode */ - inode->i_mtime = jffs2_get_timestamp(); - inode->i_size = 0; - old_metadata = f->metadata; - jffs2_truncate_fragtree (c, &f->fragtree, 0); - f->metadata = new_metadata; - if (old_metadata) { - jffs2_mark_node_obsolete(c, old_metadata->raw); - jffs2_free_full_dnode(old_metadata); - } - jffs2_free_raw_inode(ri); - - up(&f->sem); - jffs2_complete_reservation(c); - - return 0; -} - -static int jffs2_fo_write(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio) -{ - struct _inode *inode = (struct _inode *) fp->f_data; - off_t pos = fp->f_offset; - ssize_t resid = uio->uio_resid; - struct jffs2_raw_inode ri; - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - int i; - - // If the APPEND mode bit was supplied, force all writes to - // the end of the file. - if (fp->f_flag & CYG_FAPPEND) - pos = fp->f_offset = inode->i_size; - - if (pos < 0) - return EINVAL; - - memset(&ri, 0, sizeof(ri)); - - ri.ino = cpu_to_je32(f->inocache->ino); - ri.mode = cpu_to_jemode(inode->i_mode); - ri.uid = cpu_to_je16(inode->i_uid); - ri.gid = cpu_to_je16(inode->i_gid); - ri.atime = ri.ctime = ri.mtime = cpu_to_je32(jffs2_get_timestamp()); - - if (pos > inode->i_size) { - int err; - ri.version = cpu_to_je32(++f->highest_version); - err = jffs2_extend_file(inode, &ri, pos); - if (err) - return -err; - } - ri.isize = cpu_to_je32(inode->i_size); - - // Now loop over the iovecs until they are all done, or - // we get an error. - for (i = 0; i < uio->uio_iovcnt; i++) { - cyg_iovec *iov = &uio->uio_iov[i]; - unsigned char *buf = iov->iov_base; - off_t len = iov->iov_len; - - uint32_t writtenlen; - int err; - - D2(printf("jffs2_fo_write page_start_pos %d\n", pos)); - D2(printf("jffs2_fo_write transfer size %d\n", len)); - - err = jffs2_write_inode_range(c, f, &ri, buf, - pos, len, &writtenlen); - if (err) - return -err; - - if (writtenlen != len) - return ENOSPC; - - pos += len; - resid -= len; - } - - // We wrote some data successfully, update the modified and access - // times of the inode, increase its size appropriately, and update - // the file offset and transfer residue. - inode->i_mtime = inode->i_ctime = je32_to_cpu(ri.mtime); - if (pos > inode->i_size) - inode->i_size = pos; - - uio->uio_resid = resid; - fp->f_offset = pos; - - return ENOERR; -} -#endif /* CYGOPT_FS_JFFS2_WRITE */ - -// ------------------------------------------------------------------------- -// jffs2_fo_lseek() -// Seek to a new file position. - -static int jffs2_fo_lseek(struct CYG_FILE_TAG *fp, off_t * apos, int whence) -{ - struct _inode *node = (struct _inode *) fp->f_data; - off_t pos = *apos; - - D2(printf("jffs2_fo_lseek\n")); - - switch (whence) { - case SEEK_SET: - // Pos is already where we want to be. - break; - - case SEEK_CUR: - // Add pos to current offset. - pos += fp->f_offset; - break; - - case SEEK_END: - // Add pos to file size. - pos += node->i_size; - break; - - default: - return EINVAL; - } - - if (pos < 0 ) - return EINVAL; - - // All OK, set fp offset and return new position. - *apos = fp->f_offset = pos; - - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_fo_ioctl() -// Handle ioctls. Currently none are defined. - -static int jffs2_fo_ioctl(struct CYG_FILE_TAG *fp, CYG_ADDRWORD com, - CYG_ADDRWORD data) -{ - // No Ioctls currenly defined. - - D2(printf("jffs2_fo_ioctl\n")); - - return EINVAL; -} - -// ------------------------------------------------------------------------- -// jffs2_fo_fsync(). -// Force the file out to data storage. - -static int jffs2_fo_fsync(struct CYG_FILE_TAG *fp, int mode) -{ - // Data is always permanently where it belongs, nothing to do - // here. - - D2(printf("jffs2_fo_fsync\n")); - - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_fo_close() -// Close a file. We just decrement the refcnt and let it go away if -// that is all that is keeping it here. - -static int jffs2_fo_close(struct CYG_FILE_TAG *fp) -{ - struct _inode *node = (struct _inode *) fp->f_data; - - D2(printf("jffs2_fo_close\n")); - - jffs2_iput(node); - - fp->f_data = 0; // zero data pointer - - return ENOERR; -} - -// ------------------------------------------------------------------------- -//jffs2_fo_fstat() -// Get file status. - -static int jffs2_fo_fstat(struct CYG_FILE_TAG *fp, struct stat *buf) -{ - struct _inode *node = (struct _inode *) fp->f_data; - - D2(printf("jffs2_fo_fstat\n")); - - // Fill in the status - buf->st_mode = node->i_mode; - buf->st_ino = node->i_ino; - buf->st_dev = 0; - buf->st_nlink = node->i_nlink; - buf->st_uid = node->i_uid; - buf->st_gid = node->i_gid; - buf->st_size = node->i_size; - buf->st_atime = node->i_atime; - buf->st_mtime = node->i_mtime; - buf->st_ctime = node->i_ctime; - - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_fo_getinfo() -// Get info. Currently only supports fpathconf(). - -static int jffs2_fo_getinfo(struct CYG_FILE_TAG *fp, int key, void *buf, - int len) -{ - struct _inode *node = (struct _inode *) fp->f_data; - int err; - - D2(printf("jffs2_fo_getinfo\n")); - - switch (key) { - case FS_INFO_CONF: - err = jffs2_pathconf(node, (struct cyg_pathconf_info *) buf); - break; - - default: - err = EINVAL; - } - return err; -} - -// ------------------------------------------------------------------------- -// jffs2_fo_setinfo() -// Set info. Nothing supported here. - -static int jffs2_fo_setinfo(struct CYG_FILE_TAG *fp, int key, void *buf, - int len) -{ - // No setinfo key supported at present - - D2(printf("jffs2_fo_setinfo\n")); - - return ENOERR; -} - -//========================================================================== -// Directory operations - -// ------------------------------------------------------------------------- -// jffs2_fo_dirread() -// Read a single directory entry from a file. - -static __inline void filldir(char *nbuf, int nlen, const unsigned char *name, int namlen) -{ - int len = nlen < namlen ? nlen : namlen; - memcpy(nbuf, name, len); - nbuf[len] = '\0'; -} - -static int jffs2_fo_dirread(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio) -{ - struct _inode *d_inode = (struct _inode *) fp->f_data; - struct dirent *ent = (struct dirent *) uio->uio_iov[0].iov_base; - char *nbuf = ent->d_name; -#ifdef CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE - struct _inode *c_ino; -#endif - int nlen = sizeof (ent->d_name) - 1; - off_t len = uio->uio_iov[0].iov_len; - struct jffs2_inode_info *f; - struct _inode *inode = d_inode; - struct jffs2_full_dirent *fd; - unsigned long offset, curofs; - int found = 1; - - if (len < sizeof (struct dirent)) - return EINVAL; - - D1(printk - (KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", d_inode->i_ino)); - - f = JFFS2_INODE_INFO(inode); - - offset = fp->f_offset; - - if (offset == 0) { - D1(printk - (KERN_DEBUG "Dirent 0: \".\", ino #%lu\n", inode->i_ino)); - filldir(nbuf, nlen, (const unsigned char *) ".", 1); -#ifdef CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE - // Flags here are the same as jffs2_mkdir. Make sure - // d_type is the same as st_mode of calling stat. - ent->d_type = - jemode_to_cpu(cpu_to_jemode(S_IRUGO|S_IXUGO|S_IWUSR|S_IFDIR)); -#endif - goto out; - } - if (offset == 1) { - filldir(nbuf, nlen, (const unsigned char *) "..", 2); -#ifdef CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE - // Flags here are the same as jffs2_mkdir. Make sure - // d_type is the same as st_mode of calling stat. - ent->d_type = - jemode_to_cpu(cpu_to_jemode(S_IRUGO|S_IXUGO|S_IWUSR|S_IFDIR)); -#endif - goto out; - } - - curofs = 1; - down(&f->sem); - for (fd = f->dents; fd; fd = fd->next) { - - curofs++; - /* First loop: curofs = 2; offset = 2 */ - if (curofs < offset) { - D2(printk - (KERN_DEBUG - "Skipping dirent: \"%s\", ino #%u, type %d, because curofs %ld < offset %ld\n", - fd->name, fd->ino, fd->type, curofs, offset)); - continue; - } - if (!fd->ino) { - D2(printk - (KERN_DEBUG "Skipping deletion dirent \"%s\"\n", - fd->name)); - offset++; - continue; - } - D2(printk - (KERN_DEBUG "Dirent %ld: \"%s\", ino #%u, type %d\n", offset, - fd->name, fd->ino, fd->type)); - filldir(nbuf, nlen, fd->name, strlen((char *)fd->name)); -#ifdef CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE - c_ino = jffs2_iget(inode->i_sb, fd->ino); - if(IS_ERR(c_ino)) { - D1(printk(KERN_WARNING "get entry inode failed\n")); - // fileio already set it to zero, so not needed here - // ent->d_type = 0; - } - else { - ent->d_type = c_ino->i_mode; - jffs2_iput(c_ino); - } -#endif - goto out_sem; - } - /* Reached the end of the directory */ - found = 0; - out_sem: - up(&f->sem); - out: - fp->f_offset = ++offset; - if (found) { - uio->uio_resid -= sizeof (struct dirent); - } - return ENOERR; -} - -// ------------------------------------------------------------------------- -// jffs2_fo_dirlseek() -// Seek directory to start. - -static int jffs2_fo_dirlseek(struct CYG_FILE_TAG *fp, off_t * pos, int whence) -{ - // Only allow SEEK_SET to zero - - D2(printf("jffs2_fo_dirlseek\n")); - - if (whence != SEEK_SET || *pos != 0) - return EINVAL; - - *pos = fp->f_offset = 0; - - return ENOERR; -} - -//========================================================================== -// -// Called by JFFS2 -// =============== -// -// -//========================================================================== - -unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, - struct jffs2_inode_info *f, - unsigned long offset, - unsigned long *priv) -{ - /* FIXME: This works only with one file system mounted at a time */ - int ret; - - ret = jffs2_read_inode_range(c, f, gc_buffer, - offset & ~(PAGE_CACHE_SIZE-1), PAGE_CACHE_SIZE); - if (ret) - return ERR_PTR(ret); - - return gc_buffer; -} - -void jffs2_gc_release_page(struct jffs2_sb_info *c, - unsigned char *ptr, - unsigned long *priv) -{ - /* Do nothing */ -} - -static struct _inode *new_inode(struct super_block *sb) -{ - struct _inode *inode; - struct _inode *cached_inode; - - inode = rt_malloc(sizeof (struct _inode)); - if (inode == NULL) - return 0; - - D2(printf("malloc new_inode %x ####################################\n", - inode)); - - memset(inode, 0, sizeof (struct _inode)); - inode->i_sb = sb; - inode->i_ino = 1; - inode->i_count = 1; - inode->i_nlink = 1; // Let JFFS2 manage the link count - inode->i_size = 0; - - inode->i_cache_next = NULL; // Newest inode, about to be cached - - // Add to the icache - for (cached_inode = sb->s_root; cached_inode != NULL; - cached_inode = cached_inode->i_cache_next) { - if (cached_inode->i_cache_next == NULL) { - cached_inode->i_cache_next = inode; // Current last in cache points to newcomer - inode->i_cache_prev = cached_inode; // Newcomer points back to last - break; - } - } - return inode; -} - -static struct _inode *ilookup(struct super_block *sb, cyg_uint32 ino) -{ - struct _inode *inode = NULL; - - D2(printf("ilookup\n")); - // Check for this inode in the cache - for (inode = sb->s_root; inode != NULL; inode = inode->i_cache_next) { - if (inode->i_ino == ino) { - inode->i_count++; - break; - } - } - return inode; -} - -struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino) -{ - // Called in super.c jffs2_read_super, dir.c jffs2_lookup, - // and gc.c jffs2_garbage_collect_pass - - // Must first check for cached inode - // If this fails let new_inode create one - - struct _inode *inode; - int err; - - D2(printf("jffs2_iget\n")); - - inode = ilookup(sb, ino); - if (inode) - return inode; - - // Not cached, so malloc it - inode = new_inode(sb); - if (inode == NULL) - return ERR_PTR(-ENOMEM); - - inode->i_ino = ino; - - err = jffs2_read_inode(inode); - if (err) { - printf("jffs2_read_inode() failed\n"); - inode->i_nlink = 0; // free _this_ bad inode right now - jffs2_iput(inode); - inode = NULL; - return ERR_PTR(err); - } - return inode; -} - -// ------------------------------------------------------------------------- -// Decrement the reference count on an inode. If this makes the ref count -// zero, then this inode can be freed. - -void jffs2_iput(struct _inode *i) -{ - // Called in jffs2_find - // (and jffs2_open and jffs2_ops_mkdir?) - // super.c jffs2_read_super, - // and gc.c jffs2_garbage_collect_pass - recurse: - if (!i) { - printf("jffs2_iput() called with NULL inode\n"); - // and let it fault... - } - - i->i_count--; - - if (i->i_count < 0) - BUG(); - - if (i->i_count) - return; - - if (!i->i_nlink) { - struct _inode *parent; - - // Remove from the icache linked list and free immediately - if (i->i_cache_prev) - i->i_cache_prev->i_cache_next = i->i_cache_next; - if (i->i_cache_next) - i->i_cache_next->i_cache_prev = i->i_cache_prev; - - parent = i->i_parent; - jffs2_clear_inode(i); - memset(i, 0x5a, sizeof(*i)); - rt_free(i); - - if (parent && parent != i) { - i = parent; - goto recurse; - } - - } else { - // Evict some _other_ inode with i_count zero, leaving - // this latest one in the cache for a while - icache_evict(i->i_sb->s_root, i); - } -} - - -// ------------------------------------------------------------------------- -// EOF jffs2.c - - -static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) -{ - memset(f, 0, sizeof(*f)); - init_MUTEX_LOCKED(&f->sem); -} - -static void jffs2_clear_inode (struct _inode *inode) -{ - /* We can forget about this inode for now - drop all - * the nodelists associated with it, etc. - */ - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - - D1(printk(KERN_DEBUG "jffs2_clear_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode)); - - jffs2_do_clear_inode(c, f); -} - - -/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, - fill in the raw_inode while you're at it. */ -struct _inode *jffs2_new_inode (struct _inode *dir_i, int mode, struct jffs2_raw_inode *ri) -{ - struct _inode *inode; - struct super_block *sb = dir_i->i_sb; - struct jffs2_sb_info *c; - struct jffs2_inode_info *f; - int ret; - - D1(printk(KERN_DEBUG "jffs2_new_inode(): dir_i %ld, mode 0x%x\n", dir_i->i_ino, mode)); - - c = JFFS2_SB_INFO(sb); - - inode = new_inode(sb); - - if (!inode) - return ERR_PTR(-ENOMEM); - - f = JFFS2_INODE_INFO(inode); - jffs2_init_inode_info(f); - - memset(ri, 0, sizeof(*ri)); - /* Set OS-specific defaults for new inodes */ - ri->uid = ri->gid = cpu_to_je16(0); - ri->mode = cpu_to_jemode(mode); - ret = jffs2_do_new_inode (c, f, mode, ri); - if (ret) { - // forceful evict: f->sem is locked already, and the - // inode is bad. - if (inode->i_cache_prev) - inode->i_cache_prev->i_cache_next = inode->i_cache_next; - if (inode->i_cache_next) - inode->i_cache_next->i_cache_prev = inode->i_cache_prev; - up(&(f->sem)); - jffs2_clear_inode(inode); - memset(inode, 0x6a, sizeof(*inode)); - rt_free(inode); - return ERR_PTR(ret); - } - inode->i_nlink = 1; - inode->i_ino = je32_to_cpu(ri->ino); - inode->i_mode = jemode_to_cpu(ri->mode); - inode->i_gid = je16_to_cpu(ri->gid); - inode->i_uid = je16_to_cpu(ri->uid); - inode->i_atime = inode->i_ctime = inode->i_mtime = jffs2_get_timestamp(); - ri->atime = ri->mtime = ri->ctime = cpu_to_je32(inode->i_mtime); - - inode->i_size = 0; - - return inode; -} - - -static int jffs2_read_inode (struct _inode *inode) -{ - struct jffs2_inode_info *f; - struct jffs2_sb_info *c; - struct jffs2_raw_inode latest_node; - int ret; - - D1(printk(KERN_DEBUG "jffs2_read_inode(): inode->i_ino == %lu\n", inode->i_ino)); - - f = JFFS2_INODE_INFO(inode); - c = JFFS2_SB_INFO(inode->i_sb); - - jffs2_init_inode_info(f); - - ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node); - - if (ret) { - up(&f->sem); - return ret; - } - inode->i_mode = jemode_to_cpu(latest_node.mode); - inode->i_uid = je16_to_cpu(latest_node.uid); - inode->i_gid = je16_to_cpu(latest_node.gid); - inode->i_size = je32_to_cpu(latest_node.isize); - inode->i_atime = je32_to_cpu(latest_node.atime); - inode->i_mtime = je32_to_cpu(latest_node.mtime); - inode->i_ctime = je32_to_cpu(latest_node.ctime); - - inode->i_nlink = f->inocache->nlink; - up(&f->sem); - - D1(printk(KERN_DEBUG "jffs2_read_inode() returning\n")); - return 0; -} - - -void jffs2_gc_release_inode(struct jffs2_sb_info *c, - struct jffs2_inode_info *f) -{ - jffs2_iput(OFNI_EDONI_2SFFJ(f)); -} - -struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, - int inum, int nlink) -{ - struct _inode *inode; - struct jffs2_inode_cache *ic; - if (!nlink) { - /* The inode has zero nlink but its nodes weren't yet marked - obsolete. This has to be because we're still waiting for - the final (close() and) jffs2_iput() to happen. - - There's a possibility that the final jffs2_iput() could have - happened while we were contemplating. In order to ensure - that we don't cause a new read_inode() (which would fail) - for the inode in question, we use ilookup() in this case - instead of jffs2_iget(). - - The nlink can't _become_ zero at this point because we're - holding the alloc_sem, and jffs2_do_unlink() would also - need that while decrementing nlink on any inode. - */ - inode = ilookup(OFNI_BS_2SFFJ(c), inum); - if (!inode) { - D1(printk(KERN_DEBUG "ilookup() failed for ino #%u; inode is probably deleted.\n", - inum)); - - spin_lock(&c->inocache_lock); - ic = jffs2_get_ino_cache(c, inum); - if (!ic) { - D1(printk(KERN_DEBUG "Inode cache for ino #%u is gone.\n", inum)); - spin_unlock(&c->inocache_lock); - return NULL; - } - if (ic->state != INO_STATE_CHECKEDABSENT) { - /* Wait for progress. Don't just loop */ - D1(printk(KERN_DEBUG "Waiting for ino #%u in state %d\n", - ic->ino, ic->state)); - sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); - } else { - spin_unlock(&c->inocache_lock); - } - - return NULL; - } - } else { - /* Inode has links to it still; they're not going away because - jffs2_do_unlink() would need the alloc_sem and we have it. - Just jffs2_iget() it, and if read_inode() is necessary that's OK. - */ - inode = jffs2_iget(OFNI_BS_2SFFJ(c), inum); - if (IS_ERR(inode)) - return (void *)inode; - } - - return JFFS2_INODE_INFO(inode); -} - - - -uint32_t jffs2_from_os_mode(uint32_t osmode) -{ - uint32_t jmode = ((osmode & S_IRUSR)?00400:0) | - ((osmode & S_IWUSR)?00200:0) | - ((osmode & S_IXUSR)?00100:0) | - ((osmode & S_IRGRP)?00040:0) | - ((osmode & S_IWGRP)?00020:0) | - ((osmode & S_IXGRP)?00010:0) | - ((osmode & S_IROTH)?00004:0) | - ((osmode & S_IWOTH)?00002:0) | - ((osmode & S_IXOTH)?00001:0); - - switch (osmode & S_IFMT) { -// case S_IFSOCK: -// return jmode | 0140000; -// case S_IFLNK: -// return jmode | 0120000; - case S_IFREG: - return jmode | 0100000; - case S_IFBLK: - return jmode | 0060000; - case S_IFDIR: - return jmode | 0040000; - case S_IFCHR: - return jmode | 0020000; - case S_IFIFO: - return jmode | 0010000; - case S_ISUID: - return jmode | 0004000; - case S_ISGID: - return jmode | 0002000; -#ifdef S_ISVTX - case S_ISVTX: - return jmode | 0001000; -#endif - } - printf("os_to_jffs2_mode() cannot convert 0x%x\n", osmode); - BUG(); - return 0; -} - -uint32_t jffs2_to_os_mode (uint32_t jmode) -{ - uint32_t osmode = ((jmode & 00400)?S_IRUSR:0) | - ((jmode & 00200)?S_IWUSR:0) | - ((jmode & 00100)?S_IXUSR:0) | - ((jmode & 00040)?S_IRGRP:0) | - ((jmode & 00020)?S_IWGRP:0) | - ((jmode & 00010)?S_IXGRP:0) | - ((jmode & 00004)?S_IROTH:0) | - ((jmode & 00002)?S_IWOTH:0) | - ((jmode & 00001)?S_IXOTH:0); - - switch(jmode & 00170000) { -// case 0140000: prife -// return osmode | S_IFSOCK; prife -// case 0120000: prife -// return osmode | S_IFLNK; prife - case 0100000: - return osmode | S_IFREG; - case 0060000: - return osmode | S_IFBLK; - case 0040000: - return osmode | S_IFDIR; - case 0020000: - return osmode | S_IFCHR; - case 0010000: - return osmode | S_IFIFO; - case 0004000: - return osmode | S_ISUID; - case 0002000: - return osmode | S_ISGID; -#ifdef S_ISVTX - case 0001000: - return osmode | S_ISVTX; -#endif - } - printf("jffs2_to_os_mode() cannot convert 0x%x\n", osmode); - BUG(); - return 0; -} diff --git a/components/dfs/filesystems/jffs2/src/gc.c b/components/dfs/filesystems/jffs2/src/gc.c deleted file mode 100644 index 34ad6ca547..0000000000 --- a/components/dfs/filesystems/jffs2/src/gc.c +++ /dev/null @@ -1,1271 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: gc.c,v 1.152 2005/07/24 15:14:14 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include "nodelist.h" -#include "compr.h" - -static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c, - struct jffs2_inode_cache *ic, - struct jffs2_raw_node_ref *raw); -static int jffs2_garbage_collect_metadata(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dnode *fd); -static int jffs2_garbage_collect_dirent(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dirent *fd); -static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dirent *fd); -static int jffs2_garbage_collect_hole(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dnode *fn, - uint32_t start, uint32_t end); -static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dnode *fn, - uint32_t start, uint32_t end); -static int jffs2_garbage_collect_live(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_raw_node_ref *raw, struct jffs2_inode_info *f); - -/* Called with erase_completion_lock held */ -static struct jffs2_eraseblock *jffs2_find_gc_block(struct jffs2_sb_info *c) -{ - struct jffs2_eraseblock *ret; - struct list_head *nextlist = NULL; - int n = jiffies % 128; - - /* Pick an eraseblock to garbage collect next. This is where we'll - put the clever wear-levelling algorithms. Eventually. */ - /* We possibly want to favour the dirtier blocks more when the - number of free blocks is low. */ -again: - if (!list_empty(&c->bad_used_list) && c->nr_free_blocks > c->resv_blocks_gcbad) { - D1(printk(KERN_DEBUG "Picking block from bad_used_list to GC next\n")); - nextlist = &c->bad_used_list; - } else if (n < 50 && !list_empty(&c->erasable_list)) { - /* Note that most of them will have gone directly to be erased. - So don't favour the erasable_list _too_ much. */ - D1(printk(KERN_DEBUG "Picking block from erasable_list to GC next\n")); - nextlist = &c->erasable_list; - } else if (n < 110 && !list_empty(&c->very_dirty_list)) { - /* Most of the time, pick one off the very_dirty list */ - D1(printk(KERN_DEBUG "Picking block from very_dirty_list to GC next\n")); - nextlist = &c->very_dirty_list; - } else if (n < 126 && !list_empty(&c->dirty_list)) { - D1(printk(KERN_DEBUG "Picking block from dirty_list to GC next\n")); - nextlist = &c->dirty_list; - } else if (!list_empty(&c->clean_list)) { - D1(printk(KERN_DEBUG "Picking block from clean_list to GC next\n")); - nextlist = &c->clean_list; - } else if (!list_empty(&c->dirty_list)) { - D1(printk(KERN_DEBUG "Picking block from dirty_list to GC next (clean_list was empty)\n")); - - nextlist = &c->dirty_list; - } else if (!list_empty(&c->very_dirty_list)) { - D1(printk(KERN_DEBUG "Picking block from very_dirty_list to GC next (clean_list and dirty_list were empty)\n")); - nextlist = &c->very_dirty_list; - } else if (!list_empty(&c->erasable_list)) { - D1(printk(KERN_DEBUG "Picking block from erasable_list to GC next (clean_list and {very_,}dirty_list were empty)\n")); - - nextlist = &c->erasable_list; - } else if (!list_empty(&c->erasable_pending_wbuf_list)) { - /* There are blocks are wating for the wbuf sync */ - D1(printk(KERN_DEBUG "Synching wbuf in order to reuse erasable_pending_wbuf_list blocks\n")); - spin_unlock(&c->erase_completion_lock); - jffs2_flush_wbuf_pad(c); - spin_lock(&c->erase_completion_lock); - goto again; - } else { - /* Eep. All were empty */ - D1(printk(KERN_NOTICE "jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?\n")); - return NULL; - } - - ret = list_entry(nextlist->next, struct jffs2_eraseblock, list); - list_del(&ret->list); - c->gcblock = ret; - ret->gc_node = ret->first_node; - if (!ret->gc_node) { - printk(KERN_WARNING "Eep. ret->gc_node for block at 0x%08x is NULL\n", ret->offset); - BUG(); - } - - /* Have we accidentally picked a clean block with wasted space ? */ - if (ret->wasted_size) { - D1(printk(KERN_DEBUG "Converting wasted_size %08x to dirty_size\n", ret->wasted_size)); - ret->dirty_size += ret->wasted_size; - c->wasted_size -= ret->wasted_size; - c->dirty_size += ret->wasted_size; - ret->wasted_size = 0; - } - - return ret; -} - -/* jffs2_garbage_collect_pass - * Make a single attempt to progress GC. Move one node, and possibly - * start erasing one eraseblock. - */ -int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) -{ - struct jffs2_inode_info *f; - struct jffs2_inode_cache *ic; - struct jffs2_eraseblock *jeb; - struct jffs2_raw_node_ref *raw; - int ret = 0, inum, nlink; - - if (down_interruptible(&c->alloc_sem)) - return -EINTR; - - for (;;) { - spin_lock(&c->erase_completion_lock); - if (!c->unchecked_size) - break; - - /* We can't start doing GC yet. We haven't finished checking - the node CRCs etc. Do it now. */ - - /* checked_ino is protected by the alloc_sem */ - if (c->checked_ino > c->highest_ino) { - printk(KERN_CRIT "Checked all inodes but still 0x%x bytes of unchecked space?\n", - c->unchecked_size); - jffs2_dbg_dump_block_lists_nolock(c); - spin_unlock(&c->erase_completion_lock); - BUG(); - } - - spin_unlock(&c->erase_completion_lock); - - spin_lock(&c->inocache_lock); - - ic = jffs2_get_ino_cache(c, c->checked_ino++); - - if (!ic) { - spin_unlock(&c->inocache_lock); - continue; - } - - if (!ic->nlink) { - D1(printk(KERN_DEBUG "Skipping check of ino #%d with nlink zero\n", - ic->ino)); - spin_unlock(&c->inocache_lock); - continue; - } - switch(ic->state) { - case INO_STATE_CHECKEDABSENT: - case INO_STATE_PRESENT: - D1(printk(KERN_DEBUG "Skipping ino #%u already checked\n", ic->ino)); - spin_unlock(&c->inocache_lock); - continue; - - case INO_STATE_GC: - case INO_STATE_CHECKING: - printk(KERN_WARNING "Inode #%u is in state %d during CRC check phase!\n", ic->ino, ic->state); - spin_unlock(&c->inocache_lock); - BUG(); - - case INO_STATE_READING: - /* We need to wait for it to finish, lest we move on - and trigger the BUG() above while we haven't yet - finished checking all its nodes */ - D1(printk(KERN_DEBUG "Waiting for ino #%u to finish reading\n", ic->ino)); - up(&c->alloc_sem); - sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); - return 0; - - default: - BUG(); - - case INO_STATE_UNCHECKED: - ; - } - ic->state = INO_STATE_CHECKING; - spin_unlock(&c->inocache_lock); - - D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass() triggering inode scan of ino#%u\n", ic->ino)); - - ret = jffs2_do_crccheck_inode(c, ic); - if (ret) - printk(KERN_WARNING "Returned error for crccheck of ino #%u. Expect badness...\n", ic->ino); - - jffs2_set_inocache_state(c, ic, INO_STATE_CHECKEDABSENT); - up(&c->alloc_sem); - return ret; - } - - /* First, work out which block we're garbage-collecting */ - jeb = c->gcblock; - - if (!jeb) - jeb = jffs2_find_gc_block(c); - - if (!jeb) { - D1 (printk(KERN_NOTICE "jffs2: Couldn't find erase block to garbage collect!\n")); - spin_unlock(&c->erase_completion_lock); - up(&c->alloc_sem); - return -EIO; - } - - D1(printk(KERN_DEBUG "GC from block %08x, used_size %08x, dirty_size %08x, free_size %08x\n", jeb->offset, jeb->used_size, jeb->dirty_size, jeb->free_size)); - D1(if (c->nextblock) - printk(KERN_DEBUG "Nextblock at %08x, used_size %08x, dirty_size %08x, wasted_size %08x, free_size %08x\n", c->nextblock->offset, c->nextblock->used_size, c->nextblock->dirty_size, c->nextblock->wasted_size, c->nextblock->free_size)); - - if (!jeb->used_size) { - up(&c->alloc_sem); - goto eraseit; - } - - raw = jeb->gc_node; - - while(ref_obsolete(raw)) { - D1(printk(KERN_DEBUG "Node at 0x%08x is obsolete... skipping\n", ref_offset(raw))); - raw = raw->next_phys; - if (unlikely(!raw)) { - printk(KERN_WARNING "eep. End of raw list while still supposedly nodes to GC\n"); - printk(KERN_WARNING "erase block at 0x%08x. free_size 0x%08x, dirty_size 0x%08x, used_size 0x%08x\n", - jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size); - jeb->gc_node = raw; - spin_unlock(&c->erase_completion_lock); - up(&c->alloc_sem); - BUG(); - } - } - jeb->gc_node = raw; - - D1(printk(KERN_DEBUG "Going to garbage collect node at 0x%08x\n", ref_offset(raw))); - - if (!raw->next_in_ino) { - /* Inode-less node. Clean marker, snapshot or something like that */ - /* FIXME: If it's something that needs to be copied, including something - we don't grok that has JFFS2_NODETYPE_RWCOMPAT_COPY, we should do so */ - spin_unlock(&c->erase_completion_lock); - jffs2_mark_node_obsolete(c, raw); - up(&c->alloc_sem); - goto eraseit_lock; - } - - ic = jffs2_raw_ref_to_ic(raw); - - /* We need to hold the inocache. Either the erase_completion_lock or - the inocache_lock are sufficient; we trade down since the inocache_lock - causes less contention. */ - spin_lock(&c->inocache_lock); - - spin_unlock(&c->erase_completion_lock); - - D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass collecting from block @0x%08x. Node @0x%08x(%d), ino #%u\n", jeb->offset, ref_offset(raw), ref_flags(raw), ic->ino)); - - /* Three possibilities: - 1. Inode is already in-core. We must iget it and do proper - updating to its fragtree, etc. - 2. Inode is not in-core, node is REF_PRISTINE. We lock the - inocache to prevent a read_inode(), copy the node intact. - 3. Inode is not in-core, node is not pristine. We must iget() - and take the slow path. - */ - - switch(ic->state) { - case INO_STATE_CHECKEDABSENT: - /* It's been checked, but it's not currently in-core. - We can just copy any pristine nodes, but have - to prevent anyone else from doing read_inode() while - we're at it, so we set the state accordingly */ - if (ref_flags(raw) == REF_PRISTINE) - ic->state = INO_STATE_GC; - else { - D1(printk(KERN_DEBUG "Ino #%u is absent but node not REF_PRISTINE. Reading.\n", - ic->ino)); - } - break; - - case INO_STATE_PRESENT: - /* It's in-core. GC must iget() it. */ - break; - - case INO_STATE_UNCHECKED: - case INO_STATE_CHECKING: - case INO_STATE_GC: - /* Should never happen. We should have finished checking - by the time we actually start doing any GC, and since - we're holding the alloc_sem, no other garbage collection - can happen. - */ - printk(KERN_CRIT "Inode #%u already in state %d in jffs2_garbage_collect_pass()!\n", - ic->ino, ic->state); - up(&c->alloc_sem); - spin_unlock(&c->inocache_lock); - BUG(); - - case INO_STATE_READING: - /* Someone's currently trying to read it. We must wait for - them to finish and then go through the full iget() route - to do the GC. However, sometimes read_inode() needs to get - the alloc_sem() (for marking nodes invalid) so we must - drop the alloc_sem before sleeping. */ - - up(&c->alloc_sem); - D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass() waiting for ino #%u in state %d\n", - ic->ino, ic->state)); - sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); - /* And because we dropped the alloc_sem we must start again from the - beginning. Ponder chance of livelock here -- we're returning success - without actually making any progress. - - Q: What are the chances that the inode is back in INO_STATE_READING - again by the time we next enter this function? And that this happens - enough times to cause a real delay? - - A: Small enough that I don't care :) - */ - return 0; - } - - /* OK. Now if the inode is in state INO_STATE_GC, we are going to copy the - node intact, and we don't have to muck about with the fragtree etc. - because we know it's not in-core. If it _was_ in-core, we go through - all the iget() crap anyway */ - - if (ic->state == INO_STATE_GC) { - spin_unlock(&c->inocache_lock); - - ret = jffs2_garbage_collect_pristine(c, ic, raw); - - spin_lock(&c->inocache_lock); - ic->state = INO_STATE_CHECKEDABSENT; - wake_up(&c->inocache_wq); - - if (ret != -EBADFD) { - spin_unlock(&c->inocache_lock); - goto release_sem; - } - - /* Fall through if it wanted us to, with inocache_lock held */ - } - - /* Prevent the fairly unlikely race where the gcblock is - entirely obsoleted by the final close of a file which had - the only valid nodes in the block, followed by erasure, - followed by freeing of the ic because the erased block(s) - held _all_ the nodes of that inode.... never been seen but - it's vaguely possible. */ - - inum = ic->ino; - nlink = ic->nlink; - spin_unlock(&c->inocache_lock); - - f = jffs2_gc_fetch_inode(c, inum, nlink); - if (IS_ERR(f)) { - ret = PTR_ERR(f); - goto release_sem; - } - if (!f) { - ret = 0; - goto release_sem; - } - - ret = jffs2_garbage_collect_live(c, jeb, raw, f); - - jffs2_gc_release_inode(c, f); - - release_sem: - up(&c->alloc_sem); - - eraseit_lock: - /* If we've finished this block, start it erasing */ - spin_lock(&c->erase_completion_lock); - - eraseit: - if (c->gcblock && !c->gcblock->used_size) { - D1(printk(KERN_DEBUG "Block at 0x%08x completely obsoleted by GC. Moving to erase_pending_list\n", c->gcblock->offset)); - /* We're GC'ing an empty block? */ - list_add_tail(&c->gcblock->list, &c->erase_pending_list); - c->gcblock = NULL; - c->nr_erasing_blocks++; - jffs2_erase_pending_trigger(c); - } - spin_unlock(&c->erase_completion_lock); - - return ret; -} - -static int jffs2_garbage_collect_live(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_raw_node_ref *raw, struct jffs2_inode_info *f) -{ - struct jffs2_node_frag *frag; - struct jffs2_full_dnode *fn = NULL; - struct jffs2_full_dirent *fd; - uint32_t start = 0, end = 0, nrfrags = 0; - int ret = 0; - - down(&f->sem); - - /* Now we have the lock for this inode. Check that it's still the one at the head - of the list. */ - - spin_lock(&c->erase_completion_lock); - - if (c->gcblock != jeb) { - spin_unlock(&c->erase_completion_lock); - D1(printk(KERN_DEBUG "GC block is no longer gcblock. Restart\n")); - goto upnout; - } - if (ref_obsolete(raw)) { - spin_unlock(&c->erase_completion_lock); - D1(printk(KERN_DEBUG "node to be GC'd was obsoleted in the meantime.\n")); - /* They'll call again */ - goto upnout; - } - spin_unlock(&c->erase_completion_lock); - - /* OK. Looks safe. And nobody can get us now because we have the semaphore. Move the block */ - if (f->metadata && f->metadata->raw == raw) { - fn = f->metadata; - ret = jffs2_garbage_collect_metadata(c, jeb, f, fn); - goto upnout; - } - - /* FIXME. Read node and do lookup? */ - for (frag = frag_first(&f->fragtree); frag; frag = frag_next(frag)) { - if (frag->node && frag->node->raw == raw) { - fn = frag->node; - end = frag->ofs + frag->size; - if (!nrfrags++) - start = frag->ofs; - if (nrfrags == frag->node->frags) - break; /* We've found them all */ - } - } - if (fn) { - if (ref_flags(raw) == REF_PRISTINE) { - ret = jffs2_garbage_collect_pristine(c, f->inocache, raw); - if (!ret) { - /* Urgh. Return it sensibly. */ - frag->node->raw = f->inocache->nodes; - } - if (ret != -EBADFD) - goto upnout; - } - /* We found a datanode. Do the GC */ - if((start >> PAGE_CACHE_SHIFT) < ((end-1) >> PAGE_CACHE_SHIFT)) { - /* It crosses a page boundary. Therefore, it must be a hole. */ - ret = jffs2_garbage_collect_hole(c, jeb, f, fn, start, end); - } else { - /* It could still be a hole. But we GC the page this way anyway */ - ret = jffs2_garbage_collect_dnode(c, jeb, f, fn, start, end); - } - goto upnout; - } - - /* Wasn't a dnode. Try dirent */ - for (fd = f->dents; fd; fd=fd->next) { - if (fd->raw == raw) - break; - } - - if (fd && fd->ino) { - ret = jffs2_garbage_collect_dirent(c, jeb, f, fd); - } else if (fd) { - ret = jffs2_garbage_collect_deletion_dirent(c, jeb, f, fd); - } else { - printk(KERN_WARNING "Raw node at 0x%08x wasn't in node lists for ino #%u\n", - ref_offset(raw), f->inocache->ino); - if (ref_obsolete(raw)) { - printk(KERN_WARNING "But it's obsolete so we don't mind too much\n"); - } else { - jffs2_dbg_dump_node(c, ref_offset(raw)); - BUG(); - } - } - upnout: - up(&f->sem); - - return ret; -} - -static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c, - struct jffs2_inode_cache *ic, - struct jffs2_raw_node_ref *raw) -{ - union jffs2_node_union *node; - struct jffs2_raw_node_ref *nraw; - size_t retlen; - int ret; - uint32_t phys_ofs, alloclen; - uint32_t crc, rawlen; - int retried = 0; - - D1(printk(KERN_DEBUG "Going to GC REF_PRISTINE node at 0x%08x\n", ref_offset(raw))); - - rawlen = ref_totlen(c, c->gcblock, raw); - - /* Ask for a small amount of space (or the totlen if smaller) because we - don't want to force wastage of the end of a block if splitting would - work. */ - ret = jffs2_reserve_space_gc(c, min_t(uint32_t, sizeof(struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN, - rawlen), &phys_ofs, &alloclen); - if (ret) - return ret; - - if (alloclen < rawlen) { - /* Doesn't fit untouched. We'll go the old route and split it */ - return -EBADFD; - } - - node = kmalloc(rawlen, GFP_KERNEL); - if (!node) - return -ENOMEM; - - ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (unsigned char *)node); - if (!ret && retlen != rawlen) - ret = -EIO; - if (ret) - goto out_node; - - crc = crc32(0, node, sizeof(struct jffs2_unknown_node)-4); - if (je32_to_cpu(node->u.hdr_crc) != crc) { - printk(KERN_WARNING "Header CRC failed on REF_PRISTINE node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ref_offset(raw), je32_to_cpu(node->u.hdr_crc), crc); - goto bail; - } - - switch(je16_to_cpu(node->u.nodetype)) { - case JFFS2_NODETYPE_INODE: - crc = crc32(0, node, sizeof(node->i)-8); - if (je32_to_cpu(node->i.node_crc) != crc) { - printk(KERN_WARNING "Node CRC failed on REF_PRISTINE data node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ref_offset(raw), je32_to_cpu(node->i.node_crc), crc); - goto bail; - } - - if (je32_to_cpu(node->i.dsize)) { - crc = crc32(0, node->i.data, je32_to_cpu(node->i.csize)); - if (je32_to_cpu(node->i.data_crc) != crc) { - printk(KERN_WARNING "Data CRC failed on REF_PRISTINE data node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ref_offset(raw), je32_to_cpu(node->i.data_crc), crc); - goto bail; - } - } - break; - - case JFFS2_NODETYPE_DIRENT: - crc = crc32(0, node, sizeof(node->d)-8); - if (je32_to_cpu(node->d.node_crc) != crc) { - printk(KERN_WARNING "Node CRC failed on REF_PRISTINE dirent node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ref_offset(raw), je32_to_cpu(node->d.node_crc), crc); - goto bail; - } - - if (node->d.nsize) { - crc = crc32(0, node->d.name, node->d.nsize); - if (je32_to_cpu(node->d.name_crc) != crc) { - printk(KERN_WARNING "Name CRC failed on REF_PRISTINE dirent ode at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ref_offset(raw), je32_to_cpu(node->d.name_crc), crc); - goto bail; - } - } - break; - default: - printk(KERN_WARNING "Unknown node type for REF_PRISTINE node at 0x%08x: 0x%04x\n", - ref_offset(raw), je16_to_cpu(node->u.nodetype)); - goto bail; - } - - nraw = jffs2_alloc_raw_node_ref(); - if (!nraw) { - ret = -ENOMEM; - goto out_node; - } - - /* OK, all the CRCs are good; this node can just be copied as-is. */ - retry: - nraw->flash_offset = phys_ofs; - nraw->__totlen = rawlen; - nraw->next_phys = NULL; - - ret = jffs2_flash_write(c, phys_ofs, rawlen, &retlen, (unsigned char *)node); - - if (ret || (retlen != rawlen)) { - printk(KERN_NOTICE "Write of %d bytes at 0x%08x failed. returned %d, retlen %zd\n", - rawlen, phys_ofs, ret, retlen); - if (retlen) { - /* Doesn't belong to any inode */ - nraw->next_in_ino = NULL; - - nraw->flash_offset |= REF_OBSOLETE; - jffs2_add_physical_node_ref(c, nraw); - jffs2_mark_node_obsolete(c, nraw); - } else { - printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", nraw->flash_offset); - jffs2_free_raw_node_ref(nraw); - } - if (!retried && (nraw = jffs2_alloc_raw_node_ref())) { - /* Try to reallocate space and retry */ - uint32_t dummy; - struct jffs2_eraseblock *jeb = &c->blocks[phys_ofs / c->sector_size]; - - retried = 1; - - D1(printk(KERN_DEBUG "Retrying failed write of REF_PRISTINE node.\n")); - - jffs2_dbg_acct_sanity_check(c,jeb); - jffs2_dbg_acct_paranoia_check(c, jeb); - - ret = jffs2_reserve_space_gc(c, rawlen, &phys_ofs, &dummy); - - if (!ret) { - D1(printk(KERN_DEBUG "Allocated space at 0x%08x to retry failed write.\n", phys_ofs)); - - jffs2_dbg_acct_sanity_check(c,jeb); - jffs2_dbg_acct_paranoia_check(c, jeb); - - goto retry; - } - D1(printk(KERN_DEBUG "Failed to allocate space to retry failed write: %d!\n", ret)); - jffs2_free_raw_node_ref(nraw); - } - - jffs2_free_raw_node_ref(nraw); - if (!ret) - ret = -EIO; - goto out_node; - } - nraw->flash_offset |= REF_PRISTINE; - jffs2_add_physical_node_ref(c, nraw); - - /* Link into per-inode list. This is safe because of the ic - state being INO_STATE_GC. Note that if we're doing this - for an inode which is in-core, the 'nraw' pointer is then - going to be fetched from ic->nodes by our caller. */ - spin_lock(&c->erase_completion_lock); - nraw->next_in_ino = ic->nodes; - ic->nodes = nraw; - spin_unlock(&c->erase_completion_lock); - - jffs2_mark_node_obsolete(c, raw); - D1(printk(KERN_DEBUG "WHEEE! GC REF_PRISTINE node at 0x%08x succeeded\n", ref_offset(raw))); - - out_node: - kfree(node); - return ret; - bail: - ret = -EBADFD; - goto out_node; -} - -static int jffs2_garbage_collect_metadata(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dnode *fn) -{ - struct jffs2_full_dnode *new_fn; - struct jffs2_raw_inode ri; - struct jffs2_node_frag *last_frag; - jint16_t dev; - char *mdata = NULL, mdatalen = 0; - uint32_t alloclen, phys_ofs, ilen; - int ret; - - if (S_ISBLK(JFFS2_F_I_MODE(f)) || - S_ISCHR(JFFS2_F_I_MODE(f)) ) { - /* For these, we don't actually need to read the old node */ - /* FIXME: for minor or major > 255. */ - dev = cpu_to_je16(((JFFS2_F_I_RDEV_MAJ(f) << 8) | - JFFS2_F_I_RDEV_MIN(f))); - mdata = (char *)&dev; - mdatalen = sizeof(dev); - D1(printk(KERN_DEBUG "jffs2_garbage_collect_metadata(): Writing %d bytes of kdev_t\n", mdatalen)); - } else if (S_ISLNK(JFFS2_F_I_MODE(f))) { - mdatalen = fn->size; - mdata = kmalloc(fn->size, GFP_KERNEL); - if (!mdata) { - printk(KERN_WARNING "kmalloc of mdata failed in jffs2_garbage_collect_metadata()\n"); - return -ENOMEM; - } - ret = jffs2_read_dnode(c, f, fn, (unsigned char *)mdata, 0, mdatalen); - if (ret) { - printk(KERN_WARNING "read of old metadata failed in jffs2_garbage_collect_metadata(): %d\n", ret); - kfree(mdata); - return ret; - } - D1(printk(KERN_DEBUG "jffs2_garbage_collect_metadata(): Writing %d bites of symlink target\n", mdatalen)); - - } - - ret = jffs2_reserve_space_gc(c, sizeof(ri) + mdatalen, &phys_ofs, &alloclen); - if (ret) { - printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_metadata failed: %d\n", - sizeof(ri)+ mdatalen, ret); - goto out; - } - - last_frag = frag_last(&f->fragtree); - if (last_frag) - /* Fetch the inode length from the fragtree rather then - * from i_size since i_size may have not been updated yet */ - ilen = last_frag->ofs + last_frag->size; - else - ilen = JFFS2_F_I_SIZE(f); - - memset(&ri, 0, sizeof(ri)); - ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri.totlen = cpu_to_je32(sizeof(ri) + mdatalen); - ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4)); - - ri.ino = cpu_to_je32(f->inocache->ino); - ri.version = cpu_to_je32(++f->highest_version); - ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f)); - ri.uid = cpu_to_je16(JFFS2_F_I_UID(f)); - ri.gid = cpu_to_je16(JFFS2_F_I_GID(f)); - ri.isize = cpu_to_je32(ilen); - ri.atime = cpu_to_je32(JFFS2_F_I_ATIME(f)); - ri.ctime = cpu_to_je32(JFFS2_F_I_CTIME(f)); - ri.mtime = cpu_to_je32(JFFS2_F_I_MTIME(f)); - ri.offset = cpu_to_je32(0); - ri.csize = cpu_to_je32(mdatalen); - ri.dsize = cpu_to_je32(mdatalen); - ri.compr = JFFS2_COMPR_NONE; - ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8)); - ri.data_crc = cpu_to_je32(crc32(0, mdata, mdatalen)); - - new_fn = jffs2_write_dnode(c, f, &ri, (const unsigned char *)mdata, mdatalen, phys_ofs, ALLOC_GC); - - if (IS_ERR(new_fn)) { - printk(KERN_WARNING "Error writing new dnode: %ld\n", PTR_ERR(new_fn)); - ret = PTR_ERR(new_fn); - goto out; - } - jffs2_mark_node_obsolete(c, fn->raw); - jffs2_free_full_dnode(fn); - f->metadata = new_fn; - out: - if (S_ISLNK(JFFS2_F_I_MODE(f))) - kfree(mdata); - return ret; -} - -static int jffs2_garbage_collect_dirent(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dirent *fd) -{ - struct jffs2_full_dirent *new_fd; - struct jffs2_raw_dirent rd; - uint32_t alloclen, phys_ofs; - int ret; - - rd.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - rd.nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); - rd.nsize = strlen((const char *)fd->name); - rd.totlen = cpu_to_je32(sizeof(rd) + rd.nsize); - rd.hdr_crc = cpu_to_je32(crc32(0, &rd, sizeof(struct jffs2_unknown_node)-4)); - - rd.pino = cpu_to_je32(f->inocache->ino); - rd.version = cpu_to_je32(++f->highest_version); - rd.ino = cpu_to_je32(fd->ino); - rd.mctime = cpu_to_je32(max(JFFS2_F_I_MTIME(f), JFFS2_F_I_CTIME(f))); - rd.type = fd->type; - rd.node_crc = cpu_to_je32(crc32(0, &rd, sizeof(rd)-8)); - rd.name_crc = cpu_to_je32(crc32(0, fd->name, rd.nsize)); - - ret = jffs2_reserve_space_gc(c, sizeof(rd)+rd.nsize, &phys_ofs, &alloclen); - if (ret) { - printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_dirent failed: %d\n", - sizeof(rd)+rd.nsize, ret); - return ret; - } - new_fd = jffs2_write_dirent(c, f, &rd, fd->name, rd.nsize, phys_ofs, ALLOC_GC); - - if (IS_ERR(new_fd)) { - printk(KERN_WARNING "jffs2_write_dirent in garbage_collect_dirent failed: %ld\n", PTR_ERR(new_fd)); - return PTR_ERR(new_fd); - } - jffs2_add_fd_to_list(c, new_fd, &f->dents); - return 0; -} - -static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dirent *fd) -{ - struct jffs2_full_dirent **fdp = &f->dents; - int found = 0; - - /* On a medium where we can't actually mark nodes obsolete - pernamently, such as NAND flash, we need to work out - whether this deletion dirent is still needed to actively - delete a 'real' dirent with the same name that's still - somewhere else on the flash. */ - if (!jffs2_can_mark_obsolete(c)) { - struct jffs2_raw_dirent *rd; - struct jffs2_raw_node_ref *raw; - int ret; - size_t retlen; - int name_len = strlen((const char *)fd->name); - uint32_t name_crc = crc32(0, fd->name, name_len); - uint32_t rawlen = ref_totlen(c, jeb, fd->raw); - - rd = kmalloc(rawlen, GFP_KERNEL); - if (!rd) - return -ENOMEM; - - /* Prevent the erase code from nicking the obsolete node refs while - we're looking at them. I really don't like this extra lock but - can't see any alternative. Suggestions on a postcard to... */ - down(&c->erase_free_sem); - - for (raw = f->inocache->nodes; raw != (void *)f->inocache; raw = raw->next_in_ino) { - - /* We only care about obsolete ones */ - if (!(ref_obsolete(raw))) - continue; - - /* Any dirent with the same name is going to have the same length... */ - if (ref_totlen(c, NULL, raw) != rawlen) - continue; - - /* Doesn't matter if there's one in the same erase block. We're going to - delete it too at the same time. */ - if (SECTOR_ADDR(raw->flash_offset) == SECTOR_ADDR(fd->raw->flash_offset)) - continue; - - D1(printk(KERN_DEBUG "Check potential deletion dirent at %08x\n", ref_offset(raw))); - - /* This is an obsolete node belonging to the same directory, and it's of the right - length. We need to take a closer look...*/ - ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (unsigned char *)rd); - if (ret) { - printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Read error (%d) reading obsolete node at %08x\n", ret, ref_offset(raw)); - /* If we can't read it, we don't need to continue to obsolete it. Continue */ - continue; - } - if (retlen != rawlen) { - printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %u) reading header from obsolete node at %08x\n", - retlen, rawlen, ref_offset(raw)); - continue; - } - - if (je16_to_cpu(rd->nodetype) != JFFS2_NODETYPE_DIRENT) - continue; - - /* If the name CRC doesn't match, skip */ - if (je32_to_cpu(rd->name_crc) != name_crc) - continue; - - /* If the name length doesn't match, or it's another deletion dirent, skip */ - if (rd->nsize != name_len || !je32_to_cpu(rd->ino)) - continue; - - /* OK, check the actual name now */ - if (memcmp(rd->name, fd->name, name_len)) - continue; - - /* OK. The name really does match. There really is still an older node on - the flash which our deletion dirent obsoletes. So we have to write out - a new deletion dirent to replace it */ - up(&c->erase_free_sem); - - D1(printk(KERN_DEBUG "Deletion dirent at %08x still obsoletes real dirent \"%s\" at %08x for ino #%u\n", - ref_offset(fd->raw), fd->name, ref_offset(raw), je32_to_cpu(rd->ino))); - kfree(rd); - - return jffs2_garbage_collect_dirent(c, jeb, f, fd); - } - - up(&c->erase_free_sem); - kfree(rd); - } - - /* No need for it any more. Just mark it obsolete and remove it from the list */ - while (*fdp) { - if ((*fdp) == fd) { - found = 1; - *fdp = fd->next; - break; - } - fdp = &(*fdp)->next; - } - if (!found) { - printk(KERN_WARNING "Deletion dirent \"%s\" not found in list for ino #%u\n", fd->name, f->inocache->ino); - } - jffs2_mark_node_obsolete(c, fd->raw); - jffs2_free_full_dirent(fd); - return 0; -} - -static int jffs2_garbage_collect_hole(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dnode *fn, - uint32_t start, uint32_t end) -{ - struct jffs2_raw_inode ri; - struct jffs2_node_frag *frag; - struct jffs2_full_dnode *new_fn; - uint32_t alloclen, phys_ofs, ilen; - int ret; - - D1(printk(KERN_DEBUG "Writing replacement hole node for ino #%u from offset 0x%x to 0x%x\n", - f->inocache->ino, start, end)); - - memset(&ri, 0, sizeof(ri)); - - if(fn->frags > 1) { - size_t readlen; - uint32_t crc; - /* It's partially obsoleted by a later write. So we have to - write it out again with the _same_ version as before */ - ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(ri), &readlen, (unsigned char *)&ri); - if (readlen != sizeof(ri) || ret) { - printk(KERN_WARNING "Node read failed in jffs2_garbage_collect_hole. Ret %d, retlen %zd. Data will be lost by writing new hole node\n", ret, readlen); - goto fill; - } - if (je16_to_cpu(ri.nodetype) != JFFS2_NODETYPE_INODE) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: Node at 0x%08x had node type 0x%04x instead of JFFS2_NODETYPE_INODE(0x%04x)\n", - ref_offset(fn->raw), - je16_to_cpu(ri.nodetype), JFFS2_NODETYPE_INODE); - return -EIO; - } - if (je32_to_cpu(ri.totlen) != sizeof(ri)) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: Node at 0x%08x had totlen 0x%x instead of expected 0x%zx\n", - ref_offset(fn->raw), - je32_to_cpu(ri.totlen), sizeof(ri)); - return -EIO; - } - crc = crc32(0, &ri, sizeof(ri)-8); - if (crc != je32_to_cpu(ri.node_crc)) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: Node at 0x%08x had CRC 0x%08x which doesn't match calculated CRC 0x%08x\n", - ref_offset(fn->raw), - je32_to_cpu(ri.node_crc), crc); - /* FIXME: We could possibly deal with this by writing new holes for each frag */ - printk(KERN_WARNING "Data in the range 0x%08x to 0x%08x of inode #%u will be lost\n", - start, end, f->inocache->ino); - goto fill; - } - if (ri.compr != JFFS2_COMPR_ZERO) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: Node 0x%08x wasn't a hole node!\n", ref_offset(fn->raw)); - printk(KERN_WARNING "Data in the range 0x%08x to 0x%08x of inode #%u will be lost\n", - start, end, f->inocache->ino); - goto fill; - } - } else { - fill: - ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri.totlen = cpu_to_je32(sizeof(ri)); - ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4)); - - ri.ino = cpu_to_je32(f->inocache->ino); - ri.version = cpu_to_je32(++f->highest_version); - ri.offset = cpu_to_je32(start); - ri.dsize = cpu_to_je32(end - start); - ri.csize = cpu_to_je32(0); - ri.compr = JFFS2_COMPR_ZERO; - } - - frag = frag_last(&f->fragtree); - if (frag) - /* Fetch the inode length from the fragtree rather then - * from i_size since i_size may have not been updated yet */ - ilen = frag->ofs + frag->size; - else - ilen = JFFS2_F_I_SIZE(f); - - ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f)); - ri.uid = cpu_to_je16(JFFS2_F_I_UID(f)); - ri.gid = cpu_to_je16(JFFS2_F_I_GID(f)); - ri.isize = cpu_to_je32(ilen); - ri.atime = cpu_to_je32(JFFS2_F_I_ATIME(f)); - ri.ctime = cpu_to_je32(JFFS2_F_I_CTIME(f)); - ri.mtime = cpu_to_je32(JFFS2_F_I_MTIME(f)); - ri.data_crc = cpu_to_je32(0); - ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8)); - - ret = jffs2_reserve_space_gc(c, sizeof(ri), &phys_ofs, &alloclen); - if (ret) { - printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_hole failed: %d\n", - sizeof(ri), ret); - return ret; - } - new_fn = jffs2_write_dnode(c, f, &ri, NULL, 0, phys_ofs, ALLOC_GC); - - if (IS_ERR(new_fn)) { - printk(KERN_WARNING "Error writing new hole node: %ld\n", PTR_ERR(new_fn)); - return PTR_ERR(new_fn); - } - if (je32_to_cpu(ri.version) == f->highest_version) { - jffs2_add_full_dnode_to_inode(c, f, new_fn); - if (f->metadata) { - jffs2_mark_node_obsolete(c, f->metadata->raw); - jffs2_free_full_dnode(f->metadata); - f->metadata = NULL; - } - return 0; - } - - /* - * We should only get here in the case where the node we are - * replacing had more than one frag, so we kept the same version - * number as before. (Except in case of error -- see 'goto fill;' - * above.) - */ - D1(if(unlikely(fn->frags <= 1)) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: Replacing fn with %d frag(s) but new ver %d != highest_version %d of ino #%d\n", - fn->frags, je32_to_cpu(ri.version), f->highest_version, - je32_to_cpu(ri.ino)); - }); - - /* This is a partially-overlapped hole node. Mark it REF_NORMAL not REF_PRISTINE */ - mark_ref_normal(new_fn->raw); - - for (frag = jffs2_lookup_node_frag(&f->fragtree, fn->ofs); - frag; frag = frag_next(frag)) { - if (frag->ofs > fn->size + fn->ofs) - break; - if (frag->node == fn) { - frag->node = new_fn; - new_fn->frags++; - fn->frags--; - } - } - if (fn->frags) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: Old node still has frags!\n"); - BUG(); - } - if (!new_fn->frags) { - printk(KERN_WARNING "jffs2_garbage_collect_hole: New node has no frags!\n"); - BUG(); - } - - jffs2_mark_node_obsolete(c, fn->raw); - jffs2_free_full_dnode(fn); - - return 0; -} - -static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_inode_info *f, struct jffs2_full_dnode *fn, - uint32_t start, uint32_t end) -{ - struct jffs2_full_dnode *new_fn; - struct jffs2_raw_inode ri; - uint32_t alloclen, phys_ofs, offset, orig_end, orig_start; - int ret = 0; - unsigned char *comprbuf = NULL, *writebuf; - unsigned long pg; - unsigned char *pg_ptr; - - memset(&ri, 0, sizeof(ri)); - - D1(printk(KERN_DEBUG "Writing replacement dnode for ino #%u from offset 0x%x to 0x%x\n", - f->inocache->ino, start, end)); - - orig_end = end; - orig_start = start; - - if (c->nr_free_blocks + c->nr_erasing_blocks > c->resv_blocks_gcmerge) { - /* Attempt to do some merging. But only expand to cover logically - adjacent frags if the block containing them is already considered - to be dirty. Otherwise we end up with GC just going round in - circles dirtying the nodes it already wrote out, especially - on NAND where we have small eraseblocks and hence a much higher - chance of nodes having to be split to cross boundaries. */ - - struct jffs2_node_frag *frag; - uint32_t min, max; - - min = start & ~(PAGE_CACHE_SIZE-1); - max = min + PAGE_CACHE_SIZE; - - frag = jffs2_lookup_node_frag(&f->fragtree, start); - - /* BUG_ON(!frag) but that'll happen anyway... */ - - BUG_ON(frag->ofs != start); - - /* First grow down... */ - while((frag = frag_prev(frag)) && frag->ofs >= min) { - - /* If the previous frag doesn't even reach the beginning, there's - excessive fragmentation. Just merge. */ - if (frag->ofs > min) { - D1(printk(KERN_DEBUG "Expanding down to cover partial frag (0x%x-0x%x)\n", - frag->ofs, frag->ofs+frag->size)); - start = frag->ofs; - continue; - } - /* OK. This frag holds the first byte of the page. */ - if (!frag->node || !frag->node->raw) { - D1(printk(KERN_DEBUG "First frag in page is hole (0x%x-0x%x). Not expanding down.\n", - frag->ofs, frag->ofs+frag->size)); - break; - } else { - - /* OK, it's a frag which extends to the beginning of the page. Does it live - in a block which is still considered clean? If so, don't obsolete it. - If not, cover it anyway. */ - - struct jffs2_raw_node_ref *raw = frag->node->raw; - struct jffs2_eraseblock *jeb; - - jeb = &c->blocks[raw->flash_offset / c->sector_size]; - - if (jeb == c->gcblock) { - D1(printk(KERN_DEBUG "Expanding down to cover frag (0x%x-0x%x) in gcblock at %08x\n", - frag->ofs, frag->ofs+frag->size, ref_offset(raw))); - start = frag->ofs; - break; - } - if (!ISDIRTY(jeb->dirty_size + jeb->wasted_size)) { - D1(printk(KERN_DEBUG "Not expanding down to cover frag (0x%x-0x%x) in clean block %08x\n", - frag->ofs, frag->ofs+frag->size, jeb->offset)); - break; - } - - D1(printk(KERN_DEBUG "Expanding down to cover frag (0x%x-0x%x) in dirty block %08x\n", - frag->ofs, frag->ofs+frag->size, jeb->offset)); - start = frag->ofs; - break; - } - } - - /* ... then up */ - - /* Find last frag which is actually part of the node we're to GC. */ - frag = jffs2_lookup_node_frag(&f->fragtree, end-1); - - while((frag = frag_next(frag)) && frag->ofs+frag->size <= max) { - - /* If the previous frag doesn't even reach the beginning, there's lots - of fragmentation. Just merge. */ - if (frag->ofs+frag->size < max) { - D1(printk(KERN_DEBUG "Expanding up to cover partial frag (0x%x-0x%x)\n", - frag->ofs, frag->ofs+frag->size)); - end = frag->ofs + frag->size; - continue; - } - - if (!frag->node || !frag->node->raw) { - D1(printk(KERN_DEBUG "Last frag in page is hole (0x%x-0x%x). Not expanding up.\n", - frag->ofs, frag->ofs+frag->size)); - break; - } else { - - /* OK, it's a frag which extends to the beginning of the page. Does it live - in a block which is still considered clean? If so, don't obsolete it. - If not, cover it anyway. */ - - struct jffs2_raw_node_ref *raw = frag->node->raw; - struct jffs2_eraseblock *jeb; - - jeb = &c->blocks[raw->flash_offset / c->sector_size]; - - if (jeb == c->gcblock) { - D1(printk(KERN_DEBUG "Expanding up to cover frag (0x%x-0x%x) in gcblock at %08x\n", - frag->ofs, frag->ofs+frag->size, ref_offset(raw))); - end = frag->ofs + frag->size; - break; - } - if (!ISDIRTY(jeb->dirty_size + jeb->wasted_size)) { - D1(printk(KERN_DEBUG "Not expanding up to cover frag (0x%x-0x%x) in clean block %08x\n", - frag->ofs, frag->ofs+frag->size, jeb->offset)); - break; - } - - D1(printk(KERN_DEBUG "Expanding up to cover frag (0x%x-0x%x) in dirty block %08x\n", - frag->ofs, frag->ofs+frag->size, jeb->offset)); - end = frag->ofs + frag->size; - break; - } - } - D1(printk(KERN_DEBUG "Expanded dnode to write from (0x%x-0x%x) to (0x%x-0x%x)\n", - orig_start, orig_end, start, end)); - - D1(BUG_ON(end > frag_last(&f->fragtree)->ofs + frag_last(&f->fragtree)->size)); - BUG_ON(end < orig_end); - BUG_ON(start > orig_start); - } - - /* First, use readpage() to read the appropriate page into the page cache */ - /* Q: What happens if we actually try to GC the _same_ page for which commit_write() - * triggered garbage collection in the first place? - * A: I _think_ it's OK. read_cache_page shouldn't deadlock, we'll write out the - * page OK. We'll actually write it out again in commit_write, which is a little - * suboptimal, but at least we're correct. - */ - pg_ptr = jffs2_gc_fetch_page(c, f, start, &pg); - - if (IS_ERR(pg_ptr)) { - printk(KERN_WARNING "read_cache_page() returned error: %ld\n", PTR_ERR(pg_ptr)); - return PTR_ERR(pg_ptr); - } - - offset = start; - while(offset < orig_end) { - uint32_t datalen; - uint32_t cdatalen; - uint16_t comprtype = JFFS2_COMPR_NONE; - - ret = jffs2_reserve_space_gc(c, sizeof(ri) + JFFS2_MIN_DATA_LEN, &phys_ofs, &alloclen); - - if (ret) { - printk(KERN_WARNING "jffs2_reserve_space_gc of %zd bytes for garbage_collect_dnode failed: %d\n", - sizeof(ri)+ JFFS2_MIN_DATA_LEN, ret); - break; - } - cdatalen = min_t(uint32_t, alloclen - sizeof(ri), end - offset); - datalen = end - offset; - - writebuf = pg_ptr + (offset & (PAGE_CACHE_SIZE -1)); - - comprtype = jffs2_compress(c, f, writebuf, &comprbuf, &datalen, &cdatalen); - - ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri.totlen = cpu_to_je32(sizeof(ri) + cdatalen); - ri.hdr_crc = cpu_to_je32(crc32(0, &ri, sizeof(struct jffs2_unknown_node)-4)); - - ri.ino = cpu_to_je32(f->inocache->ino); - ri.version = cpu_to_je32(++f->highest_version); - ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f)); - ri.uid = cpu_to_je16(JFFS2_F_I_UID(f)); - ri.gid = cpu_to_je16(JFFS2_F_I_GID(f)); - ri.isize = cpu_to_je32(JFFS2_F_I_SIZE(f)); - ri.atime = cpu_to_je32(JFFS2_F_I_ATIME(f)); - ri.ctime = cpu_to_je32(JFFS2_F_I_CTIME(f)); - ri.mtime = cpu_to_je32(JFFS2_F_I_MTIME(f)); - ri.offset = cpu_to_je32(offset); - ri.csize = cpu_to_je32(cdatalen); - ri.dsize = cpu_to_je32(datalen); - ri.compr = comprtype & 0xff; - ri.usercompr = (comprtype >> 8) & 0xff; - ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8)); - ri.data_crc = cpu_to_je32(crc32(0, comprbuf, cdatalen)); - - new_fn = jffs2_write_dnode(c, f, &ri, comprbuf, cdatalen, phys_ofs, ALLOC_GC); - - jffs2_free_comprbuf(comprbuf, writebuf); - - if (IS_ERR(new_fn)) { - printk(KERN_WARNING "Error writing new dnode: %ld\n", PTR_ERR(new_fn)); - ret = PTR_ERR(new_fn); - break; - } - ret = jffs2_add_full_dnode_to_inode(c, f, new_fn); - offset += datalen; - if (f->metadata) { - jffs2_mark_node_obsolete(c, f->metadata->raw); - jffs2_free_full_dnode(f->metadata); - f->metadata = NULL; - } - } - - jffs2_gc_release_page(c, pg_ptr, &pg); - return ret; -} - diff --git a/components/dfs/filesystems/jffs2/src/gcthread.c b/components/dfs/filesystems/jffs2/src/gcthread.c deleted file mode 100644 index ab66e1878e..0000000000 --- a/components/dfs/filesystems/jffs2/src/gcthread.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: gcthread.c,v 1.3 2005/01/22 16:01:12 lunn Exp $ - * - */ -#include -#include "nodelist.h" -//#include prife - -#if defined(CYGOPT_FS_JFFS2_GCTHREAD) - -#define GC_THREAD_FLAG_TRIG 1 -#define GC_THREAD_FLAG_STOP 2 -#define GC_THREAD_FLAG_HAS_EXIT 4 - -#if 0 -static cyg_thread_entry_t jffs2_garbage_collect_thread; - -void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) -{ - struct super_block *sb=OFNI_BS_2SFFJ(c); - - /* Wake up the thread */ - D1(printk("jffs2_garbage_collect_trigger\n")); - - cyg_flag_setbits(&sb->s_gc_thread_flags,GC_THREAD_FLAG_TRIG); -} - - -void -jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c) -{ - struct super_block *sb=OFNI_BS_2SFFJ(c); - - RT_ASSERT(c); - RT_ASSERT(!sb->s_gc_thread_handle); - - cyg_flag_init(&sb->s_gc_thread_flags); - cyg_mutex_init(&sb->s_lock); - - D1(printk("jffs2_start_garbage_collect_thread\n")); - /* Start the thread. Doesn't matter if it fails -- it's only an - * optimisation anyway */ - cyg_thread_create(CYGNUM_JFFS2_GC_THREAD_PRIORITY, - jffs2_garbage_collect_thread, - (unsigned long)c,"jffs2 gc thread", - (void*)sb->s_gc_thread_stack, - sizeof(sb->s_gc_thread_stack), - &sb->s_gc_thread_handle, - &sb->s_gc_thread); - - cyg_thread_resume(sb->s_gc_thread_handle); -} - -void -jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) -{ - struct super_block *sb=OFNI_BS_2SFFJ(c); - - RT_ASSERT(sb->s_gc_thread_handle); - - D1(printk("jffs2_stop_garbage_collect_thread\n")); - /* Stop the thread and wait for it if necessary */ - - cyg_flag_setbits(&sb->s_gc_thread_flags,GC_THREAD_FLAG_STOP); - - D1(printk("jffs2_stop_garbage_collect_thread wait\n")); - - cyg_flag_wait(&sb->s_gc_thread_flags, - GC_THREAD_FLAG_HAS_EXIT, - CYG_FLAG_WAITMODE_OR| CYG_FLAG_WAITMODE_CLR); - - // Kill and free the resources ... this is safe due to the flag - // from the thread. - cyg_thread_kill(sb->s_gc_thread_handle); - cyg_thread_delete(sb->s_gc_thread_handle); - - cyg_mutex_destroy(&sb->s_lock); - cyg_flag_destroy(&sb->s_gc_thread_flags); -} - - -static void -jffs2_garbage_collect_thread(unsigned long data) -{ - struct jffs2_sb_info *c=(struct jffs2_sb_info *)data; - struct super_block *sb=OFNI_BS_2SFFJ(c); - cyg_flag_value_t flag; - cyg_mtab_entry *mte; - - D1(printk("jffs2_garbage_collect_thread START\n")); - - while(1) { - flag=cyg_flag_timed_wait(&sb->s_gc_thread_flags, - GC_THREAD_FLAG_TRIG|GC_THREAD_FLAG_STOP, - CYG_FLAG_WAITMODE_OR| CYG_FLAG_WAITMODE_CLR, - cyg_current_time()+ - CYGNUM_JFFS2_GS_THREAD_TICKS); - - if (flag & GC_THREAD_FLAG_STOP) - break; - - D1(printk("jffs2: GC THREAD GC BEGIN\n")); - - mte=cyg_fs_root_lookup((cyg_dir *) sb->s_root); - CYG_ASSERT(mte, "Bad mount point"); - cyg_fs_lock(mte, mte->fs->syncmode); - - if (jffs2_garbage_collect_pass(c) == -ENOSPC) { - printf("No space for garbage collection. " - "Aborting JFFS2 GC thread\n"); - break; - } - cyg_fs_unlock(mte, mte->fs->syncmode); - D1(printk("jffs2: GC THREAD GC END\n")); - } - - D1(printk("jffs2_garbage_collect_thread EXIT\n")); - cyg_flag_setbits(&sb->s_gc_thread_flags,GC_THREAD_FLAG_HAS_EXIT); -} -#endif - -rt_uint32_t cyg_current_time(void) -{ - return 0; -} - -static void -jffs2_garbage_collect_thread(unsigned long data); - -void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) -{ - struct super_block *sb=OFNI_BS_2SFFJ(c); - - /* Wake up the thread */ - D1(printk("jffs2_garbage_collect_trigger\n")); - - rt_event_send(&sb->s_gc_thread_flags,GC_THREAD_FLAG_TRIG); -} - -static struct rt_thread gc_thread; -void -jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c) -{ - struct super_block *sb=OFNI_BS_2SFFJ(c); - cyg_mtab_entry *mte; - int result; - - RT_ASSERT(c); - //RT_ASSERT(!sb->s_gc_thread_handle); - - mte=(cyg_dir *) sb->s_root; - RT_ASSERT(mte); - - rt_event_init(&sb->s_gc_thread_flags, "gc_event", RT_IPC_FLAG_FIFO); - rt_mutex_init(&sb->s_lock, "gc_mutex", RT_IPC_FLAG_FIFO); -// rt_mutex_init(&mte->fs->syncmode, "fs_lock", RT_IPC_FLAG_FIFO); - - D1(printk("jffs2_start_garbage_collect_thread\n")); - /* Start the thread. Doesn't matter if it fails -- it's only an - * optimisation anyway */ - result = rt_thread_init(&sb->s_gc_thread, - "jffs2_gc_thread", - jffs2_garbage_collect_thread, - (void *)c, - (void*)sb->s_gc_thread_stack, - sizeof(sb->s_gc_thread_stack), - CYGNUM_JFFS2_GC_THREAD_PRIORITY, - CYGNUM_JFFS2_GC_THREAD_TICKS - ); - if (result != RT_EOK) { - rt_thread_startup(&sb->s_gc_thread); - /* how to deal with the following filed? */ - /* sb->s_gc_thread_handle; */ - } -} - -void -jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) -{ - struct super_block *sb=OFNI_BS_2SFFJ(c); - cyg_mtab_entry *mte; - rt_uint32_t e; - rt_err_t result; - - //RT_ASSERT(sb->s_gc_thread_handle); - - D1(printk("jffs2_stop_garbage_collect_thread\n")); - /* Stop the thread and wait for it if necessary */ - - rt_event_send(&sb->s_gc_thread_flags,GC_THREAD_FLAG_STOP); - - D1(printk("jffs2_stop_garbage_collect_thread wait\n")); - - result = rt_event_recv(&sb->s_gc_thread_flags, - GC_THREAD_FLAG_HAS_EXIT, - RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, - RT_WAITING_FOREVER, &e); - if (result == -RT_ETIMEOUT) - { - LOG_E("wait completed timeout"); - return; - } - else if (result == -RT_ERROR) - { - LOG_E("event received error"); - return; - } - - // Kill and free the resources ... this is safe due to the flag - // from the thread. - rt_thread_detach(&sb->s_gc_thread); - rt_sem_detach(&sb->s_lock); - rt_event_detach(&sb->s_gc_thread_flags); -} - - -static void -jffs2_garbage_collect_thread(unsigned long data) -{ - struct jffs2_sb_info *c=(struct jffs2_sb_info *)data; - struct super_block *sb=OFNI_BS_2SFFJ(c); - cyg_mtab_entry *mte; - rt_uint32_t flag = 0; - rt_err_t result; - - D1(printk("jffs2_garbage_collect_thread START\n")); - - while(1) { - result = rt_event_recv(&sb->s_gc_thread_flags, - GC_THREAD_FLAG_TRIG | GC_THREAD_FLAG_STOP, - RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, - cyg_current_time() + CYGNUM_JFFS2_GS_THREAD_TICKS, - &flag); - if (result == -RT_ETIMEOUT) - { - LOG_E("wait completed timeout"); - continue; - } - else if (result == -RT_ERROR) - { - LOG_E("event received error"); - continue; - } - - if (flag & GC_THREAD_FLAG_STOP) - break; - - D1(printk("jffs2: GC THREAD GC BEGIN\n")); - - mte=(cyg_dir *) sb->s_root; - RT_ASSERT(mte != NULL); -// rt_mutex_take(&mte->fs->syncmode, RT_WAITING_FOREVER); - - if (jffs2_garbage_collect_pass(c) == -ENOSPC) { - printf("No space for garbage collection. " - "Aborting JFFS2 GC thread\n"); - break; - } -// rt_mutex_release(&mte->fs->syncmode); - D1(printk("jffs2: GC THREAD GC END\n")); - } - - D1(printk("jffs2_garbage_collect_thread EXIT\n")); - rt_event_send(&sb->s_gc_thread_flags,GC_THREAD_FLAG_HAS_EXIT); -} -#endif diff --git a/components/dfs/filesystems/jffs2/src/histo.h b/components/dfs/filesystems/jffs2/src/histo.h deleted file mode 100644 index 84f184f083..0000000000 --- a/components/dfs/filesystems/jffs2/src/histo.h +++ /dev/null @@ -1,3 +0,0 @@ -/* This file provides the bit-probabilities for the input file */ -#define BIT_DIVIDER 629 -static int bits[9] = { 179,167,183,165,159,198,178,119,}; /* ia32 .so files */ diff --git a/components/dfs/filesystems/jffs2/src/histo_mips.h b/components/dfs/filesystems/jffs2/src/histo_mips.h deleted file mode 100644 index 9a443268d8..0000000000 --- a/components/dfs/filesystems/jffs2/src/histo_mips.h +++ /dev/null @@ -1,2 +0,0 @@ -#define BIT_DIVIDER_MIPS 1043 -static int bits_mips[8] = { 277,249,290,267,229,341,212,241}; /* mips32 */ diff --git a/components/dfs/filesystems/jffs2/src/malloc-ecos.c b/components/dfs/filesystems/jffs2/src/malloc-ecos.c deleted file mode 100644 index df6e3c0f5d..0000000000 --- a/components/dfs/filesystems/jffs2/src/malloc-ecos.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Free Software Foundation, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: malloc-ecos.c,v 1.4 2003/11/26 15:55:35 dwmw2 Exp $ - * - */ - -#include -#include -#include "nodelist.h" - -#if !defined(CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE) -# define CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE 0 -#endif - -struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize) -{ - return rt_malloc(sizeof(struct jffs2_full_dirent) + namesize); -} - -void jffs2_free_full_dirent(struct jffs2_full_dirent *x) -{ - rt_free(x); -} - -struct jffs2_full_dnode *jffs2_alloc_full_dnode(void) -{ - return rt_malloc(sizeof(struct jffs2_full_dnode)); -} - -void jffs2_free_full_dnode(struct jffs2_full_dnode *x) -{ - rt_free(x); -} - -struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void) -{ - return rt_malloc(sizeof(struct jffs2_raw_dirent)); -} - -void jffs2_free_raw_dirent(struct jffs2_raw_dirent *x) -{ - rt_free(x); -} - -struct jffs2_raw_inode *jffs2_alloc_raw_inode(void) -{ - return rt_malloc(sizeof(struct jffs2_raw_inode)); -} - -void jffs2_free_raw_inode(struct jffs2_raw_inode *x) -{ - rt_free(x); -} - -struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void) -{ - return rt_malloc(sizeof(struct jffs2_tmp_dnode_info)); -} - -void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x) -{ - rt_free(x); -} - -struct jffs2_node_frag *jffs2_alloc_node_frag(void) -{ - return rt_malloc(sizeof(struct jffs2_node_frag)); -} - -void jffs2_free_node_frag(struct jffs2_node_frag *x) -{ - rt_free(x); -} - -#if CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE == 0 - -int jffs2_create_slab_caches(void) -{ - return 0; -} - -void jffs2_destroy_slab_caches(void) -{ -} - -struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void) -{ - return rt_malloc(sizeof(struct jffs2_raw_node_ref)); -} - -void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x) -{ - rt_free(x); -} - -#else // CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE == 0 - -static struct jffs2_raw_node_ref - rnr_pool[CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE] __attribute__ ((aligned (4))), - * first = NULL; -static cyg_drv_mutex_t mutex; - -int jffs2_create_slab_caches(void) -{ - struct jffs2_raw_node_ref * p; - cyg_drv_mutex_init(&mutex); - for ( - p = rnr_pool; - p < rnr_pool + CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE - 1; - p++ - ) - p->next_phys = p + 1; - rnr_pool[CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE - 1].next_phys = NULL; - first = &rnr_pool[0]; - return 0; -} - -void jffs2_destroy_slab_caches(void) -{ -} - -struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void) -{ - struct jffs2_raw_node_ref * p; - - cyg_drv_mutex_lock(&mutex); - p = first; - if (p != NULL) - first = p->next_phys; - cyg_drv_mutex_unlock(&mutex); - return p; -} - -void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x) -{ - cyg_drv_mutex_lock(&mutex); - x->next_phys = first; - first = x; - cyg_drv_mutex_unlock(&mutex); -} - -#endif // CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE == 0 - -struct jffs2_inode_cache *jffs2_alloc_inode_cache(void) -{ - struct jffs2_inode_cache *ret = rt_malloc(sizeof(struct jffs2_inode_cache)); - D1(printk(KERN_DEBUG "Allocated inocache at %p\n", ret)); - return ret; -} - -void jffs2_free_inode_cache(struct jffs2_inode_cache *x) -{ - D1(printk(KERN_DEBUG "Freeing inocache at %p\n", x)); - rt_free(x); -} - diff --git a/components/dfs/filesystems/jffs2/src/nodelist.c b/components/dfs/filesystems/jffs2/src/nodelist.c deleted file mode 100644 index aee9d88cff..0000000000 --- a/components/dfs/filesystems/jffs2/src/nodelist.c +++ /dev/null @@ -1,534 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: nodelist.c,v 1.102 2005/07/28 12:45:10 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "nodelist.h" - -void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) -{ - struct jffs2_full_dirent **prev = list; - - JFFS2_DBG_DENTLIST("add dirent \"%s\", ino #%u\n", new->name, new->ino); - - while ((*prev) && (*prev)->nhash <= new->nhash) { - if ((*prev)->nhash == new->nhash && !strcmp((const char *)((*prev)->name), (const char *)new->name)) { - /* Duplicate. Free one */ - if (new->version < (*prev)->version) { - JFFS2_DBG_DENTLIST("Eep! Marking new dirent node is obsolete, old is \"%s\", ino #%u\n", - (*prev)->name, (*prev)->ino); - jffs2_mark_node_obsolete(c, new->raw); - jffs2_free_full_dirent(new); - } else { - JFFS2_DBG_DENTLIST("marking old dirent \"%s\", ino #%u bsolete\n", - (*prev)->name, (*prev)->ino); - new->next = (*prev)->next; - jffs2_mark_node_obsolete(c, ((*prev)->raw)); - jffs2_free_full_dirent(*prev); - *prev = new; - } - return; - } - prev = &((*prev)->next); - } - new->next = *prev; - *prev = new; -} - -void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this) -{ - if (this->node) { - this->node->frags--; - if (!this->node->frags) { - /* The node has no valid frags left. It's totally obsoleted */ - JFFS2_DBG_FRAGTREE2("marking old node @0x%08x (0x%04x-0x%04x) obsolete\n", - ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size); - jffs2_mark_node_obsolete(c, this->node->raw); - jffs2_free_full_dnode(this->node); - } else { - JFFS2_DBG_FRAGTREE2("marking old node @0x%08x (0x%04x-0x%04x) REF_NORMAL. frags is %d\n", - ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size, this->node->frags); - mark_ref_normal(this->node->raw); - } - - } - jffs2_free_node_frag(this); -} - -static void jffs2_fragtree_insert(struct jffs2_node_frag *newfrag, struct jffs2_node_frag *base) -{ - struct rb_node *parent = &base->rb; - struct rb_node **link = &parent; - - JFFS2_DBG_FRAGTREE2("insert frag (0x%04x-0x%04x)\n", newfrag->ofs, newfrag->ofs + newfrag->size); - - while (*link) { - parent = *link; - base = rb_entry(parent, struct jffs2_node_frag, rb); - - JFFS2_DBG_FRAGTREE2("considering frag at 0x%08x\n", base->ofs); - if (newfrag->ofs > base->ofs) - link = &base->rb.rb_right; - else if (newfrag->ofs < base->ofs) - link = &base->rb.rb_left; - else { - JFFS2_ERROR("duplicate frag at %08x (%p,%p)\n", newfrag->ofs, newfrag, base); - BUG(); - } - } - - rb_link_node(&newfrag->rb, &base->rb, link); -} - -/* Doesn't set inode->i_size */ -static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *list, struct jffs2_node_frag *newfrag) -{ - struct jffs2_node_frag *this; - uint32_t lastend; - - /* Skip all the nodes which are completed before this one starts */ - this = jffs2_lookup_node_frag(list, newfrag->node->ofs); - - if (this) { - JFFS2_DBG_FRAGTREE2("lookup gave frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n", - this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this); - lastend = this->ofs + this->size; - } else { - JFFS2_DBG_FRAGTREE2("lookup gave no frag\n"); - lastend = 0; - } - - /* See if we ran off the end of the list */ - if (lastend <= newfrag->ofs) { - /* We did */ - - /* Check if 'this' node was on the same page as the new node. - If so, both 'this' and the new node get marked REF_NORMAL so - the GC can take a look. - */ - if (lastend && (lastend-1) >> PAGE_CACHE_SHIFT == newfrag->ofs >> PAGE_CACHE_SHIFT) { - if (this->node) - mark_ref_normal(this->node->raw); - mark_ref_normal(newfrag->node->raw); - } - - if (lastend < newfrag->node->ofs) { - /* ... and we need to put a hole in before the new node */ - struct jffs2_node_frag *holefrag = jffs2_alloc_node_frag(); - if (!holefrag) { - jffs2_free_node_frag(newfrag); - return -ENOMEM; - } - holefrag->ofs = lastend; - holefrag->size = newfrag->node->ofs - lastend; - holefrag->node = NULL; - if (this) { - /* By definition, the 'this' node has no right-hand child, - because there are no frags with offset greater than it. - So that's where we want to put the hole */ - JFFS2_DBG_FRAGTREE2("adding hole frag (%p) on right of node at (%p)\n", holefrag, this); - rb_link_node(&holefrag->rb, &this->rb, &this->rb.rb_right); - } else { - JFFS2_DBG_FRAGTREE2("adding hole frag (%p) at root of tree\n", holefrag); - rb_link_node(&holefrag->rb, NULL, &list->rb_node); - } - rb_insert_color(&holefrag->rb, list); - this = holefrag; - } - if (this) { - /* By definition, the 'this' node has no right-hand child, - because there are no frags with offset greater than it. - So that's where we want to put new fragment */ - JFFS2_DBG_FRAGTREE2("adding new frag (%p) on right of node at (%p)\n", newfrag, this); - rb_link_node(&newfrag->rb, &this->rb, &this->rb.rb_right); - } else { - JFFS2_DBG_FRAGTREE2("adding new frag (%p) at root of tree\n", newfrag); - rb_link_node(&newfrag->rb, NULL, &list->rb_node); - } - rb_insert_color(&newfrag->rb, list); - return 0; - } - - JFFS2_DBG_FRAGTREE2("dealing with frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n", - this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this); - - /* OK. 'this' is pointing at the first frag that newfrag->ofs at least partially obsoletes, - * - i.e. newfrag->ofs < this->ofs+this->size && newfrag->ofs >= this->ofs - */ - if (newfrag->ofs > this->ofs) { - /* This node isn't completely obsoleted. The start of it remains valid */ - - /* Mark the new node and the partially covered node REF_NORMAL -- let - the GC take a look at them */ - mark_ref_normal(newfrag->node->raw); - if (this->node) - mark_ref_normal(this->node->raw); - - if (this->ofs + this->size > newfrag->ofs + newfrag->size) { - /* The new node splits 'this' frag into two */ - struct jffs2_node_frag *newfrag2 = jffs2_alloc_node_frag(); - if (!newfrag2) { - jffs2_free_node_frag(newfrag); - return -ENOMEM; - } - if (this->node) - JFFS2_DBG_FRAGTREE2("split old frag 0x%04x-0x%04x, phys 0x%08x\n", - this->ofs, this->ofs+this->size, ref_offset(this->node->raw)); - else - JFFS2_DBG_FRAGTREE2("split old hole frag 0x%04x-0x%04x\n", - this->ofs, this->ofs+this->size, ref_offset(this->node->raw)); - - /* New second frag pointing to this's node */ - newfrag2->ofs = newfrag->ofs + newfrag->size; - newfrag2->size = (this->ofs+this->size) - newfrag2->ofs; - newfrag2->node = this->node; - if (this->node) - this->node->frags++; - - /* Adjust size of original 'this' */ - this->size = newfrag->ofs - this->ofs; - - /* Now, we know there's no node with offset - greater than this->ofs but smaller than - newfrag2->ofs or newfrag->ofs, for obvious - reasons. So we can do a tree insert from - 'this' to insert newfrag, and a tree insert - from newfrag to insert newfrag2. */ - jffs2_fragtree_insert(newfrag, this); - rb_insert_color(&newfrag->rb, list); - - jffs2_fragtree_insert(newfrag2, newfrag); - rb_insert_color(&newfrag2->rb, list); - - return 0; - } - /* New node just reduces 'this' frag in size, doesn't split it */ - this->size = newfrag->ofs - this->ofs; - - /* Again, we know it lives down here in the tree */ - jffs2_fragtree_insert(newfrag, this); - rb_insert_color(&newfrag->rb, list); - } else { - /* New frag starts at the same point as 'this' used to. Replace - it in the tree without doing a delete and insertion */ - JFFS2_DBG_FRAGTREE2("inserting newfrag (*%p),%d-%d in before 'this' (*%p),%d-%d\n", - newfrag, newfrag->ofs, newfrag->ofs+newfrag->size, this, this->ofs, this->ofs+this->size); - - rb_replace_node(&this->rb, &newfrag->rb, list); - - if (newfrag->ofs + newfrag->size >= this->ofs+this->size) { - JFFS2_DBG_FRAGTREE2("obsoleting node frag %p (%x-%x)\n", this, this->ofs, this->ofs+this->size); - jffs2_obsolete_node_frag(c, this); - } else { - this->ofs += newfrag->size; - this->size -= newfrag->size; - - jffs2_fragtree_insert(this, newfrag); - rb_insert_color(&this->rb, list); - return 0; - } - } - /* OK, now we have newfrag added in the correct place in the tree, but - frag_next(newfrag) may be a fragment which is overlapped by it - */ - while ((this = frag_next(newfrag)) && newfrag->ofs + newfrag->size >= this->ofs + this->size) { - /* 'this' frag is obsoleted completely. */ - JFFS2_DBG_FRAGTREE2("obsoleting node frag %p (%x-%x) and removing from tree\n", - this, this->ofs, this->ofs+this->size); - rb_erase(&this->rb, list); - jffs2_obsolete_node_frag(c, this); - } - /* Now we're pointing at the first frag which isn't totally obsoleted by - the new frag */ - - if (!this || newfrag->ofs + newfrag->size == this->ofs) { - return 0; - } - /* Still some overlap but we don't need to move it in the tree */ - this->size = (this->ofs + this->size) - (newfrag->ofs + newfrag->size); - this->ofs = newfrag->ofs + newfrag->size; - - /* And mark them REF_NORMAL so the GC takes a look at them */ - if (this->node) - mark_ref_normal(this->node->raw); - mark_ref_normal(newfrag->node->raw); - - return 0; -} - -/* Given an inode, probably with existing list of fragments, add the new node - * to the fragment list. - */ -int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn) -{ - int ret; - struct jffs2_node_frag *newfrag; - - if (unlikely(!fn->size)) - return 0; - - newfrag = jffs2_alloc_node_frag(); - if (unlikely(!newfrag)) - return -ENOMEM; - - JFFS2_DBG_FRAGTREE("adding node %#04x-%#04x @0x%08x on flash, newfrag *%p\n", - fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag); - - newfrag->ofs = fn->ofs; - newfrag->size = fn->size; - newfrag->node = fn; - newfrag->node->frags = 1; - - ret = jffs2_add_frag_to_fragtree(c, &f->fragtree, newfrag); - if (unlikely(ret)) - return ret; - - /* If we now share a page with other nodes, mark either previous - or next node REF_NORMAL, as appropriate. */ - if (newfrag->ofs & (PAGE_CACHE_SIZE-1)) { - struct jffs2_node_frag *prev = frag_prev(newfrag); - - mark_ref_normal(fn->raw); - /* If we don't start at zero there's _always_ a previous */ - if (prev->node) - mark_ref_normal(prev->node->raw); - } - - if ((newfrag->ofs+newfrag->size) & (PAGE_CACHE_SIZE-1)) { - struct jffs2_node_frag *next = frag_next(newfrag); - - if (next) { - mark_ref_normal(fn->raw); - if (next->node) - mark_ref_normal(next->node->raw); - } - } - jffs2_dbg_fragtree_paranoia_check_nolock(f); - jffs2_dbg_dump_fragtree_nolock(f); - return 0; -} - - -void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state) -{ - spin_lock(&c->inocache_lock); - ic->state = state; - wake_up(&c->inocache_wq); - spin_unlock(&c->inocache_lock); -} - -/* During mount, this needs no locking. During normal operation, its - callers want to do other stuff while still holding the inocache_lock. - Rather than introducing special case get_ino_cache functions or - callbacks, we just let the caller do the locking itself. */ - -struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino) -{ - struct jffs2_inode_cache *ret; - - ret = c->inocache_list[ino % INOCACHE_HASHSIZE]; - while (ret && ret->ino < ino) { - ret = ret->next; - } - - if (ret && ret->ino != ino) - ret = NULL; - - return ret; -} - -void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new) -{ - struct jffs2_inode_cache **prev; - - spin_lock(&c->inocache_lock); - if (!new->ino) - new->ino = ++c->highest_ino; - - JFFS2_DBG_INOCACHE("add %p (ino #%u)\n", new, new->ino); - - prev = &c->inocache_list[new->ino % INOCACHE_HASHSIZE]; - - while ((*prev) && (*prev)->ino < new->ino) { - prev = &(*prev)->next; - } - new->next = *prev; - *prev = new; - - spin_unlock(&c->inocache_lock); -} - -void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old) -{ - struct jffs2_inode_cache **prev; - - JFFS2_DBG_INOCACHE("del %p (ino #%u)\n", old, old->ino); - spin_lock(&c->inocache_lock); - - prev = &c->inocache_list[old->ino % INOCACHE_HASHSIZE]; - - while ((*prev) && (*prev)->ino < old->ino) { - prev = &(*prev)->next; - } - if ((*prev) == old) { - *prev = old->next; - } - - /* Free it now unless it's in READING or CLEARING state, which - are the transitions upon read_inode() and clear_inode(). The - rest of the time we know nobody else is looking at it, and - if it's held by read_inode() or clear_inode() they'll free it - for themselves. */ - if (old->state != INO_STATE_READING && old->state != INO_STATE_CLEARING) - jffs2_free_inode_cache(old); - - spin_unlock(&c->inocache_lock); -} - -void jffs2_free_ino_caches(struct jffs2_sb_info *c) -{ - int i; - struct jffs2_inode_cache *this, *next; - - for (i=0; iinocache_list[i]; - while (this) { - next = this->next; - jffs2_free_inode_cache(this); - this = next; - } - c->inocache_list[i] = NULL; - } -} - -void jffs2_free_raw_node_refs(struct jffs2_sb_info *c) -{ - int i; - struct jffs2_raw_node_ref *this, *next; - - for (i=0; inr_blocks; i++) { - this = c->blocks[i].first_node; - while(this) { - next = this->next_phys; - jffs2_free_raw_node_ref(this); - this = next; - } - c->blocks[i].first_node = c->blocks[i].last_node = NULL; - } -} - -struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset) -{ - /* The common case in lookup is that there will be a node - which precisely matches. So we go looking for that first */ - struct rb_node *next; - struct jffs2_node_frag *prev = NULL; - struct jffs2_node_frag *frag = NULL; - - JFFS2_DBG_FRAGTREE2("root %p, offset %d\n", fragtree, offset); - - next = fragtree->rb_node; - - while(next) { - frag = rb_entry(next, struct jffs2_node_frag, rb); - - JFFS2_DBG_FRAGTREE2("considering frag %#04x-%#04x (%p). left %p, right %p\n", - frag->ofs, frag->ofs+frag->size, frag, frag->rb.rb_left, frag->rb.rb_right); - if (frag->ofs + frag->size <= offset) { - JFFS2_DBG_FRAGTREE2("going right from frag %#04x-%#04x, before the region we care about\n", - frag->ofs, frag->ofs+frag->size); - /* Remember the closest smaller match on the way down */ - if (!prev || frag->ofs > prev->ofs) - prev = frag; - next = frag->rb.rb_right; - } else if (frag->ofs > offset) { - JFFS2_DBG_FRAGTREE2("going left from frag %#04x-%#04x, after the region we care about\n", - frag->ofs, frag->ofs+frag->size); - next = frag->rb.rb_left; - } else { - JFFS2_DBG_FRAGTREE2("returning frag %#04x-%#04x, matched\n", - frag->ofs, frag->ofs+frag->size); - return frag; - } - } - - /* Exact match not found. Go back up looking at each parent, - and return the closest smaller one */ - - if (prev) - JFFS2_DBG_FRAGTREE2("no match. Returning frag %#04x-%#04x, closest previous\n", - prev->ofs, prev->ofs+prev->size); - else - JFFS2_DBG_FRAGTREE2("returning NULL, empty fragtree\n"); - - return prev; -} - -/* Pass 'c' argument to indicate that nodes should be marked obsolete as - they're killed. */ -void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c) -{ - struct jffs2_node_frag *frag; - struct jffs2_node_frag *parent; - - if (!root->rb_node) - return; - - JFFS2_DBG_FRAGTREE("killing\n"); - - frag = (rb_entry(root->rb_node, struct jffs2_node_frag, rb)); - while(frag) { - if (frag->rb.rb_left) { - JFFS2_DBG_FRAGTREE2("going left from frag (%p) %#04x-%#04x\n", - frag, frag->ofs, frag->ofs+frag->size); - frag = frag_left(frag); - continue; - } - if (frag->rb.rb_right) { - JFFS2_DBG_FRAGTREE2("going right from frag (%p) %#04x-%#04x\n", - frag, frag->ofs, frag->ofs+frag->size); - frag = frag_right(frag); - continue; - } - - JFFS2_DBG_FRAGTREE2("frag %#04x-%#04x: node %p, frags %d\n", - frag->ofs, frag->ofs+frag->size, frag->node, frag->node?frag->node->frags:0); - - if (frag->node && !(--frag->node->frags)) { - /* Not a hole, and it's the final remaining frag - of this node. Free the node */ - if (c) - jffs2_mark_node_obsolete(c, frag->node->raw); - - jffs2_free_full_dnode(frag->node); - } - parent = frag_parent(frag); - if (parent) { - if (frag_left(parent) == frag) - parent->rb.rb_left = NULL; - else - parent->rb.rb_right = NULL; - } - - jffs2_free_node_frag(frag); - frag = parent; - - cond_resched(); - } -} diff --git a/components/dfs/filesystems/jffs2/src/nodelist.h b/components/dfs/filesystems/jffs2/src/nodelist.h deleted file mode 100644 index 53cdb49bbf..0000000000 --- a/components/dfs/filesystems/jffs2/src/nodelist.h +++ /dev/null @@ -1,415 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: nodelist.h,v 1.135 2005/07/27 14:46:11 dedekind Exp $ - * - */ - -#ifndef __JFFS2_NODELIST_H__ -#define __JFFS2_NODELIST_H__ - -#include "jffs2_config.h" -#include -#include -#include -#include -#include -#include - -#ifdef __ECOS -#include "os-ecos.h" -#elif defined(RT_THREAD) -#include "os-rtthread.h" -#else -#include /* For compatibility with older kernels */ -#include "os-linux.h" -#endif - -#define JFFS2_NATIVE_ENDIAN - -/* Note we handle mode bits conversion from JFFS2 (i.e. Linux) to/from - whatever OS we're actually running on here too. */ - -#if defined(JFFS2_NATIVE_ENDIAN) -#if defined (__GNUC__) -#define cpu_to_je16(x) ((jint16_t){x}) -#define cpu_to_je32(x) ((jint32_t){x}) -#define cpu_to_jemode(x) ((jmode_t){os_to_jffs2_mode(x)}) - -#define je16_to_cpu(x) ((x).v16) -#define je32_to_cpu(x) ((x).v32) -#define jemode_to_cpu(x) (jffs2_to_os_mode((x).m)) -#elif defined (MSVC) -#define cpu_to_je16(x) ((jint16_t)(x)) -#define cpu_to_je32(x) ((jint32_t)(x)) -static __inline jmode_t cpu_to_jemode(x) -{ - jmode_t _x; - _x.m = os_to_jffs2_mode(x); - return _x; -} - -#define je16_to_cpu(x) (x) -#define je32_to_cpu(x) (x) -#define jemode_to_cpu(x) (jffs2_to_os_mode((x).m)) -#else -#endif - - -#elif defined(JFFS2_BIG_ENDIAN) -#define cpu_to_je16(x) ((jint16_t){cpu_to_be16(x)}) -#define cpu_to_je32(x) ((jint32_t){cpu_to_be32(x)}) -#define cpu_to_jemode(x) ((jmode_t){cpu_to_be32(os_to_jffs2_mode(x))}) - -#define je16_to_cpu(x) (be16_to_cpu(x.v16)) -#define je32_to_cpu(x) (be32_to_cpu(x.v32)) -#define jemode_to_cpu(x) (be32_to_cpu(jffs2_to_os_mode((x).m))) -#elif defined(JFFS2_LITTLE_ENDIAN) -#define cpu_to_je16(x) ((jint16_t){cpu_to_le16(x)}) -#define cpu_to_je32(x) ((jint32_t){cpu_to_le32(x)}) -#define cpu_to_jemode(x) ((jmode_t){cpu_to_le32(os_to_jffs2_mode(x))}) - -#define je16_to_cpu(x) (le16_to_cpu(x.v16)) -#define je32_to_cpu(x) (le32_to_cpu(x.v32)) -#define jemode_to_cpu(x) (le32_to_cpu(jffs2_to_os_mode((x).m))) -#else -#error wibble -#endif - -/* - This is all we need to keep in-core for each raw node during normal - operation. As and when we do read_inode on a particular inode, we can - scan the nodes which are listed for it and build up a proper map of - which nodes are currently valid. JFFSv1 always used to keep that whole - map in core for each inode. -*/ -struct jffs2_raw_node_ref -{ - struct jffs2_raw_node_ref *next_in_ino; /* Points to the next raw_node_ref - for this inode. If this is the last, it points to the inode_cache - for this inode instead. The inode_cache will have NULL in the first - word so you know when you've got there :) */ - struct jffs2_raw_node_ref *next_phys; - uint32_t flash_offset; - uint32_t __totlen; /* This may die; use ref_totlen(c, jeb, ) below */ -}; - - /* flash_offset & 3 always has to be zero, because nodes are - always aligned at 4 bytes. So we have a couple of extra bits - to play with, which indicate the node's status; see below: */ -#define REF_UNCHECKED 0 /* We haven't yet checked the CRC or built its inode */ -#define REF_OBSOLETE 1 /* Obsolete, can be completely ignored */ -#define REF_PRISTINE 2 /* Completely clean. GC without looking */ -#define REF_NORMAL 3 /* Possibly overlapped. Read the page and write again on GC */ -#define ref_flags(ref) ((ref)->flash_offset & 3) -#define ref_offset(ref) ((ref)->flash_offset & ~3) -#define ref_obsolete(ref) (((ref)->flash_offset & 3) == REF_OBSOLETE) -#define mark_ref_normal(ref) do { (ref)->flash_offset = ref_offset(ref) | REF_NORMAL; } while(0) - -/* For each inode in the filesystem, we need to keep a record of - nlink, because it would be a PITA to scan the whole directory tree - at read_inode() time to calculate it, and to keep sufficient information - in the raw_node_ref (basically both parent and child inode number for - dirent nodes) would take more space than this does. We also keep - a pointer to the first physical node which is part of this inode, too. -*/ -struct jffs2_inode_cache { - struct jffs2_full_dirent *scan_dents; /* Used during scan to hold - temporary lists of dirents, and later must be set to - NULL to mark the end of the raw_node_ref->next_in_ino - chain. */ - struct jffs2_inode_cache *next; - struct jffs2_raw_node_ref *nodes; - uint32_t ino; - int nlink; - int state; -}; - -/* Inode states for 'state' above. We need the 'GC' state to prevent - someone from doing a read_inode() while we're moving a 'REF_PRISTINE' - node without going through all the iget() nonsense */ -#define INO_STATE_UNCHECKED 0 /* CRC checks not yet done */ -#define INO_STATE_CHECKING 1 /* CRC checks in progress */ -#define INO_STATE_PRESENT 2 /* In core */ -#define INO_STATE_CHECKEDABSENT 3 /* Checked, cleared again */ -#define INO_STATE_GC 4 /* GCing a 'pristine' node */ -#define INO_STATE_READING 5 /* In read_inode() */ -#define INO_STATE_CLEARING 6 /* In clear_inode() */ - -#define INOCACHE_HASHSIZE 128 - -/* - Larger representation of a raw node, kept in-core only when the - struct inode for this particular ino is instantiated. -*/ - -struct jffs2_full_dnode -{ - struct jffs2_raw_node_ref *raw; - uint32_t ofs; /* The offset to which the data of this node belongs */ - uint32_t size; - uint32_t frags; /* Number of fragments which currently refer - to this node. When this reaches zero, - the node is obsolete. */ -}; - -/* - Even larger representation of a raw node, kept in-core only while - we're actually building up the original map of which nodes go where, - in read_inode() -*/ -struct jffs2_tmp_dnode_info -{ - struct rb_node rb; - struct jffs2_full_dnode *fn; - uint32_t version; -}; - -struct jffs2_full_dirent -{ - struct jffs2_raw_node_ref *raw; - struct jffs2_full_dirent *next; - uint32_t version; - uint32_t ino; /* == zero for unlink */ - unsigned int nhash; - unsigned char type; - unsigned char name[0]; -}; - -/* - Fragments - used to build a map of which raw node to obtain - data from for each part of the ino -*/ -struct jffs2_node_frag -{ - struct rb_node rb; - struct jffs2_full_dnode *node; /* NULL for holes */ - uint32_t size; - uint32_t ofs; /* The offset to which this fragment belongs */ -}; - -struct jffs2_eraseblock -{ - struct list_head list; - int bad_count; - uint32_t offset; /* of this block in the MTD */ - - uint32_t unchecked_size; - uint32_t used_size; - uint32_t dirty_size; - uint32_t wasted_size; - uint32_t free_size; /* Note that sector_size - free_size - is the address of the first free space */ - struct jffs2_raw_node_ref *first_node; - struct jffs2_raw_node_ref *last_node; - - struct jffs2_raw_node_ref *gc_node; /* Next node to be garbage collected */ -}; - -/* Calculate totlen from surrounding nodes or eraseblock */ -static inline uint32_t __ref_totlen(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb, - struct jffs2_raw_node_ref *ref) -{ - uint32_t ref_end; - - if (ref->next_phys) - ref_end = ref_offset(ref->next_phys); - else { - if (!jeb) - jeb = &c->blocks[ref->flash_offset / c->sector_size]; - - /* Last node in block. Use free_space */ - BUG_ON(ref != jeb->last_node); - ref_end = jeb->offset + c->sector_size - jeb->free_size; - } - return ref_end - ref_offset(ref); -} - -static inline uint32_t ref_totlen(struct jffs2_sb_info *c, - struct jffs2_eraseblock *jeb, - struct jffs2_raw_node_ref *ref) -{ - uint32_t ret; - -#if CONFIG_JFFS2_FS_DEBUG > 0 - if (jeb && jeb != &c->blocks[ref->flash_offset / c->sector_size]) { - printk(KERN_CRIT "ref_totlen called with wrong block -- at 0x%08x instead of 0x%08x; ref 0x%08x\n", - jeb->offset, c->blocks[ref->flash_offset / c->sector_size].offset, ref_offset(ref)); - BUG(); - } -#endif - -#if 1 - ret = ref->__totlen; -#else - /* This doesn't actually work yet */ - ret = __ref_totlen(c, jeb, ref); - if (ret != ref->__totlen) { - printk(KERN_CRIT "Totlen for ref at %p (0x%08x-0x%08x) miscalculated as 0x%x instead of %x\n", - ref, ref_offset(ref), ref_offset(ref)+ref->__totlen, - ret, ref->__totlen); - if (!jeb) - jeb = &c->blocks[ref->flash_offset / c->sector_size]; - jffs2_dbg_dump_node_refs_nolock(c, jeb); - BUG(); - } -#endif - return ret; -} - -#define ALLOC_NORMAL 0 /* Normal allocation */ -#define ALLOC_DELETION 1 /* Deletion node. Best to allow it */ -#define ALLOC_GC 2 /* Space requested for GC. Give it or die */ -#define ALLOC_NORETRY 3 /* For jffs2_write_dnode: On failure, return -EAGAIN instead of retrying */ - -/* How much dirty space before it goes on the very_dirty_list */ -#define VERYDIRTY(c, size) ((size) >= ((c)->sector_size / 2)) - -/* check if dirty space is more than 255 Byte */ -#define ISDIRTY(size) ((size) > sizeof (struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN) - -#define PAD(x) (((x)+3)&~3) - -static inline struct jffs2_inode_cache *jffs2_raw_ref_to_ic(struct jffs2_raw_node_ref *raw) -{ - while(raw->next_in_ino) { - raw = raw->next_in_ino; - } - - return ((struct jffs2_inode_cache *)raw); -} - -static inline struct jffs2_node_frag *frag_first(struct rb_root *root) -{ - struct rb_node *node = root->rb_node; - - if (!node) - return NULL; - while(node->rb_left) - node = node->rb_left; - return rb_entry(node, struct jffs2_node_frag, rb); -} - -static inline struct jffs2_node_frag *frag_last(struct rb_root *root) -{ - struct rb_node *node = root->rb_node; - - if (!node) - return NULL; - while(node->rb_right) - node = node->rb_right; - return rb_entry(node, struct jffs2_node_frag, rb); -} - -#define rb_parent(rb) ((rb)->rb_parent) -#define frag_next(frag) rb_entry(rb_next(&(frag)->rb), struct jffs2_node_frag, rb) -#define frag_prev(frag) rb_entry(rb_prev(&(frag)->rb), struct jffs2_node_frag, rb) -#define frag_parent(frag) rb_entry(rb_parent(&(frag)->rb), struct jffs2_node_frag, rb) -#define frag_left(frag) rb_entry((frag)->rb.rb_left, struct jffs2_node_frag, rb) -#define frag_right(frag) rb_entry((frag)->rb.rb_right, struct jffs2_node_frag, rb) -#define frag_erase(frag, list) rb_erase(&frag->rb, list); - -/* nodelist.c */ -void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list); -void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state); -struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino); -void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new); -void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old); -void jffs2_free_ino_caches(struct jffs2_sb_info *c); -void jffs2_free_raw_node_refs(struct jffs2_sb_info *c); -struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset); -void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c_delete); -struct rb_node *rb_next(struct rb_node *); -struct rb_node *rb_prev(struct rb_node *); -void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root); -void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this); -int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); - -/* nodemgmt.c */ -int jffs2_thread_should_wake(struct jffs2_sb_info *c); -int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len, int prio); -int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len); -int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new); -void jffs2_complete_reservation(struct jffs2_sb_info *c); -void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw); - -/* write.c */ -int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri); - -struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, uint32_t flash_ofs, int alloc_mode); -struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, uint32_t flash_ofs, int alloc_mode); -int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - struct jffs2_raw_inode *ri, unsigned char *buf, - uint32_t offset, uint32_t writelen, uint32_t *retlen); -int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen); -int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f); -int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen); - - -/* readinode.c */ -void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); -int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - uint32_t ino, struct jffs2_raw_inode *latest_node); -int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); -void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); - -/* malloc.c */ -int jffs2_create_slab_caches(void); -void jffs2_destroy_slab_caches(void); - -struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize); -void jffs2_free_full_dirent(struct jffs2_full_dirent *); -struct jffs2_full_dnode *jffs2_alloc_full_dnode(void); -void jffs2_free_full_dnode(struct jffs2_full_dnode *); -struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void); -void jffs2_free_raw_dirent(struct jffs2_raw_dirent *); -struct jffs2_raw_inode *jffs2_alloc_raw_inode(void); -void jffs2_free_raw_inode(struct jffs2_raw_inode *); -struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void); -void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *); -struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void); -void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *); -struct jffs2_node_frag *jffs2_alloc_node_frag(void); -void jffs2_free_node_frag(struct jffs2_node_frag *); -struct jffs2_inode_cache *jffs2_alloc_inode_cache(void); -void jffs2_free_inode_cache(struct jffs2_inode_cache *); - -/* gc.c */ -int jffs2_garbage_collect_pass(struct jffs2_sb_info *c); - -/* read.c */ -int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - struct jffs2_full_dnode *fd, unsigned char *buf, - int ofs, int len); -int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - unsigned char *buf, uint32_t offset, uint32_t len); -char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f); - -/* scan.c */ -int jffs2_scan_medium(struct jffs2_sb_info *c); -void jffs2_rotate_lists(struct jffs2_sb_info *c); - -/* build.c */ -int jffs2_do_mount_fs(struct jffs2_sb_info *c); - -/* erase.c */ -void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count); - -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER -/* wbuf.c */ -int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino); -int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c); -int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -#endif - -#include "debug.h" - -#endif /* __JFFS2_NODELIST_H__ */ diff --git a/components/dfs/filesystems/jffs2/src/nodemgmt.c b/components/dfs/filesystems/jffs2/src/nodemgmt.c deleted file mode 100644 index ef2167aadc..0000000000 --- a/components/dfs/filesystems/jffs2/src/nodemgmt.c +++ /dev/null @@ -1,680 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: nodemgmt.c,v 1.124 2005/07/20 15:32:28 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include /* For cond_resched() */ -#include "nodelist.h" - -/** - * jffs2_reserve_space - request physical space to write nodes to flash - * @c: superblock info - * @minsize: Minimum acceptable size of allocation - * @ofs: Returned value of node offset - * @len: Returned value of allocation length - * @prio: Allocation type - ALLOC_{NORMAL,DELETION} - * - * Requests a block of physical space on the flash. Returns zero for success - * and puts 'ofs' and 'len' into the appriopriate place, or returns -ENOSPC - * or other error if appropriate. - * - * If it returns zero, jffs2_reserve_space() also downs the per-filesystem - * allocation semaphore, to prevent more than one allocation from being - * active at any time. The semaphore is later released by jffs2_commit_allocation() - * - * jffs2_reserve_space() may trigger garbage collection in order to make room - * for the requested allocation. - */ - -static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len); - -int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len, int prio) -{ - int ret = -EAGAIN; - int blocksneeded = c->resv_blocks_write; - /* align it */ - minsize = PAD(minsize); - - D1(printk(KERN_DEBUG "jffs2_reserve_space(): Requested 0x%x bytes\n", minsize)); - down(&c->alloc_sem); - - D1(printk(KERN_DEBUG "jffs2_reserve_space(): alloc sem got\n")); - - spin_lock(&c->erase_completion_lock); - - /* this needs a little more thought (true :)) */ - while(ret == -EAGAIN) { - while(c->nr_free_blocks + c->nr_erasing_blocks < blocksneeded) { - int ret; - uint32_t dirty, avail; - - /* calculate real dirty size - * dirty_size contains blocks on erase_pending_list - * those blocks are counted in c->nr_erasing_blocks. - * If one block is actually erased, it is not longer counted as dirty_space - * but it is counted in c->nr_erasing_blocks, so we add it and subtract it - * with c->nr_erasing_blocks * c->sector_size again. - * Blocks on erasable_list are counted as dirty_size, but not in c->nr_erasing_blocks - * This helps us to force gc and pick eventually a clean block to spread the load. - * We add unchecked_size here, as we hopefully will find some space to use. - * This will affect the sum only once, as gc first finishes checking - * of nodes. - */ - dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks * c->sector_size + c->unchecked_size; - if (dirty < c->nospc_dirty_size) { - if (prio == ALLOC_DELETION && c->nr_free_blocks + c->nr_erasing_blocks >= c->resv_blocks_deletion) { - D1(printk(KERN_NOTICE "jffs2_reserve_space(): Low on dirty space to GC, but it's a deletion. Allowing...\n")); - break; - } - D1(printk(KERN_DEBUG "dirty size 0x%08x + unchecked_size 0x%08x < nospc_dirty_size 0x%08x, returning -ENOSPC\n", - dirty, c->unchecked_size, c->sector_size)); - - spin_unlock(&c->erase_completion_lock); - up(&c->alloc_sem); - return -ENOSPC; - } - - /* Calc possibly available space. Possibly available means that we - * don't know, if unchecked size contains obsoleted nodes, which could give us some - * more usable space. This will affect the sum only once, as gc first finishes checking - * of nodes. - + Return -ENOSPC, if the maximum possibly available space is less or equal than - * blocksneeded * sector_size. - * This blocks endless gc looping on a filesystem, which is nearly full, even if - * the check above passes. - */ - avail = c->free_size + c->dirty_size + c->erasing_size + c->unchecked_size; - if ( (avail / c->sector_size) <= blocksneeded) { - if (prio == ALLOC_DELETION && c->nr_free_blocks + c->nr_erasing_blocks >= c->resv_blocks_deletion) { - D1(printk(KERN_NOTICE "jffs2_reserve_space(): Low on possibly available space, but it's a deletion. Allowing...\n")); - break; - } - - D1(printk(KERN_DEBUG "max. available size 0x%08x < blocksneeded * sector_size 0x%08x, returning -ENOSPC\n", - avail, blocksneeded * c->sector_size)); - spin_unlock(&c->erase_completion_lock); - up(&c->alloc_sem); - return -ENOSPC; - } - - up(&c->alloc_sem); - - D1(printk(KERN_DEBUG "Triggering GC pass. nr_free_blocks %d, nr_erasing_blocks %d, free_size 0x%08x, dirty_size 0x%08x, wasted_size 0x%08x, used_size 0x%08x, erasing_size 0x%08x, bad_size 0x%08x (total 0x%08x of 0x%08x)\n", - c->nr_free_blocks, c->nr_erasing_blocks, c->free_size, c->dirty_size, c->wasted_size, c->used_size, c->erasing_size, c->bad_size, - c->free_size + c->dirty_size + c->wasted_size + c->used_size + c->erasing_size + c->bad_size, c->flash_size)); - spin_unlock(&c->erase_completion_lock); - - ret = jffs2_garbage_collect_pass(c); - if (ret) - return ret; - - cond_resched(); - - if (signal_pending(current)) - return -EINTR; - - down(&c->alloc_sem); - spin_lock(&c->erase_completion_lock); - } - - ret = jffs2_do_reserve_space(c, minsize, ofs, len); - if (ret) { - D1(printk(KERN_DEBUG "jffs2_reserve_space: ret is %d\n", ret)); - } - } - spin_unlock(&c->erase_completion_lock); - if (ret) - up(&c->alloc_sem); - return ret; -} - -int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len) -{ - int ret = -EAGAIN; - minsize = PAD(minsize); - - D1(printk(KERN_DEBUG "jffs2_reserve_space_gc(): Requested 0x%x bytes\n", minsize)); - - spin_lock(&c->erase_completion_lock); - while(ret == -EAGAIN) { - ret = jffs2_do_reserve_space(c, minsize, ofs, len); - if (ret) { - D1(printk(KERN_DEBUG "jffs2_reserve_space_gc: looping, ret is %d\n", ret)); - } - } - spin_unlock(&c->erase_completion_lock); - return ret; -} - -/* Called with alloc sem _and_ erase_completion_lock */ -static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len) -{ - struct jffs2_eraseblock *jeb = c->nextblock; - - restart: - if (jeb && minsize > jeb->free_size) { - /* Skip the end of this block and file it as having some dirty space */ - /* If there's a pending write to it, flush now */ - if (jffs2_wbuf_dirty(c)) { - spin_unlock(&c->erase_completion_lock); - D1(printk(KERN_DEBUG "jffs2_do_reserve_space: Flushing write buffer\n")); - jffs2_flush_wbuf_pad(c); - spin_lock(&c->erase_completion_lock); - jeb = c->nextblock; - goto restart; - } - c->wasted_size += jeb->free_size; - c->free_size -= jeb->free_size; - jeb->wasted_size += jeb->free_size; - jeb->free_size = 0; - - /* Check, if we have a dirty block now, or if it was dirty already */ - if (ISDIRTY (jeb->wasted_size + jeb->dirty_size)) { - c->dirty_size += jeb->wasted_size; - c->wasted_size -= jeb->wasted_size; - jeb->dirty_size += jeb->wasted_size; - jeb->wasted_size = 0; - if (VERYDIRTY(c, jeb->dirty_size)) { - D1(printk(KERN_DEBUG "Adding full erase block at 0x%08x to very_dirty_list (free 0x%08x, dirty 0x%08x, used 0x%08x\n", - jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size)); - list_add_tail(&jeb->list, &c->very_dirty_list); - } else { - D1(printk(KERN_DEBUG "Adding full erase block at 0x%08x to dirty_list (free 0x%08x, dirty 0x%08x, used 0x%08x\n", - jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size)); - list_add_tail(&jeb->list, &c->dirty_list); - } - } else { - D1(printk(KERN_DEBUG "Adding full erase block at 0x%08x to clean_list (free 0x%08x, dirty 0x%08x, used 0x%08x\n", - jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size)); - list_add_tail(&jeb->list, &c->clean_list); - } - c->nextblock = jeb = NULL; - } - - if (!jeb) { - struct list_head *next; - /* Take the next block off the 'free' list */ - - if (list_empty(&c->free_list)) { - - if (!c->nr_erasing_blocks && - !list_empty(&c->erasable_list)) { - struct jffs2_eraseblock *ejeb; - - ejeb = list_entry(c->erasable_list.next, struct jffs2_eraseblock, list); - list_del(&ejeb->list); - list_add_tail(&ejeb->list, &c->erase_pending_list); - c->nr_erasing_blocks++; - jffs2_erase_pending_trigger(c); - D1(printk(KERN_DEBUG "jffs2_do_reserve_space: Triggering erase of erasable block at 0x%08x\n", - ejeb->offset)); - } - - if (!c->nr_erasing_blocks && - !list_empty(&c->erasable_pending_wbuf_list)) { - D1(printk(KERN_DEBUG "jffs2_do_reserve_space: Flushing write buffer\n")); - /* c->nextblock is NULL, no update to c->nextblock allowed */ - spin_unlock(&c->erase_completion_lock); - jffs2_flush_wbuf_pad(c); - spin_lock(&c->erase_completion_lock); - /* Have another go. It'll be on the erasable_list now */ - return -EAGAIN; - } - - if (!c->nr_erasing_blocks) { - /* Ouch. We're in GC, or we wouldn't have got here. - And there's no space left. At all. */ - printk(KERN_CRIT "Argh. No free space left for GC. nr_erasing_blocks is %d. nr_free_blocks is %d. (erasableempty: %s, erasingempty: %s, erasependingempty: %s)\n", - c->nr_erasing_blocks, c->nr_free_blocks, list_empty(&c->erasable_list)?"yes":"no", - list_empty(&c->erasing_list)?"yes":"no", list_empty(&c->erase_pending_list)?"yes":"no"); - return -ENOSPC; - } - - spin_unlock(&c->erase_completion_lock); - /* Don't wait for it; just erase one right now */ - jffs2_erase_pending_blocks(c, 1); - spin_lock(&c->erase_completion_lock); - - /* An erase may have failed, decreasing the - amount of free space available. So we must - restart from the beginning */ - return -EAGAIN; - } - - next = c->free_list.next; - list_del(next); - c->nextblock = jeb = list_entry(next, struct jffs2_eraseblock, list); - c->nr_free_blocks--; - - if (jeb->free_size != c->sector_size - c->cleanmarker_size) { - printk(KERN_WARNING "Eep. Block 0x%08x taken from free_list had free_size of 0x%08x!!\n", jeb->offset, jeb->free_size); - goto restart; - } - } - /* OK, jeb (==c->nextblock) is now pointing at a block which definitely has - enough space */ - *ofs = jeb->offset + (c->sector_size - jeb->free_size); - *len = jeb->free_size; - - if (c->cleanmarker_size && jeb->used_size == c->cleanmarker_size && - !jeb->first_node->next_in_ino) { - /* Only node in it beforehand was a CLEANMARKER node (we think). - So mark it obsolete now that there's going to be another node - in the block. This will reduce used_size to zero but We've - already set c->nextblock so that jffs2_mark_node_obsolete() - won't try to refile it to the dirty_list. - */ - spin_unlock(&c->erase_completion_lock); - jffs2_mark_node_obsolete(c, jeb->first_node); - spin_lock(&c->erase_completion_lock); - } - - D1(printk(KERN_DEBUG "jffs2_do_reserve_space(): Giving 0x%x bytes at 0x%x\n", *len, *ofs)); - return 0; -} - -/** - * jffs2_add_physical_node_ref - add a physical node reference to the list - * @c: superblock info - * @new: new node reference to add - * @len: length of this physical node - * @dirty: dirty flag for new node - * - * Should only be used to report nodes for which space has been allocated - * by jffs2_reserve_space. - * - * Must be called with the alloc_sem held. - */ - -int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new) -{ - struct jffs2_eraseblock *jeb; - uint32_t len; - - jeb = &c->blocks[new->flash_offset / c->sector_size]; - len = ref_totlen(c, jeb, new); - - D1(printk(KERN_DEBUG "jffs2_add_physical_node_ref(): Node at 0x%x(%d), size 0x%x\n", ref_offset(new), ref_flags(new), len)); -#if 1 - /* we could get some obsolete nodes after nextblock was refiled - in wbuf.c */ - if ((c->nextblock || !ref_obsolete(new)) - &&(jeb != c->nextblock || ref_offset(new) != jeb->offset + (c->sector_size - jeb->free_size))) { - printk(KERN_WARNING "argh. node added in wrong place\n"); - jffs2_free_raw_node_ref(new); - return -EINVAL; - } -#endif - spin_lock(&c->erase_completion_lock); - - if (!jeb->first_node) - jeb->first_node = new; - if (jeb->last_node) - jeb->last_node->next_phys = new; - jeb->last_node = new; - - jeb->free_size -= len; - c->free_size -= len; - if (ref_obsolete(new)) { - jeb->dirty_size += len; - c->dirty_size += len; - } else { - jeb->used_size += len; - c->used_size += len; - } - - if (!jeb->free_size && !jeb->dirty_size && !ISDIRTY(jeb->wasted_size)) { - /* If it lives on the dirty_list, jffs2_reserve_space will put it there */ - D1(printk(KERN_DEBUG "Adding full erase block at 0x%08x to clean_list (free 0x%08x, dirty 0x%08x, used 0x%08x\n", - jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size)); - if (jffs2_wbuf_dirty(c)) { - /* Flush the last write in the block if it's outstanding */ - spin_unlock(&c->erase_completion_lock); - jffs2_flush_wbuf_pad(c); - spin_lock(&c->erase_completion_lock); - } - - list_add_tail(&jeb->list, &c->clean_list); - c->nextblock = NULL; - } - jffs2_dbg_acct_sanity_check_nolock(c,jeb); - jffs2_dbg_acct_paranoia_check_nolock(c, jeb); - - spin_unlock(&c->erase_completion_lock); - - return 0; -} - - -void jffs2_complete_reservation(struct jffs2_sb_info *c) -{ - D1(printk(KERN_DEBUG "jffs2_complete_reservation()\n")); - jffs2_garbage_collect_trigger(c); - up(&c->alloc_sem); -} - -static inline int on_list(struct list_head *obj, struct list_head *head) -{ - struct list_head *this; - - list_for_each(this, head) { - if (this == obj) { - D1(printk("%p is on list at %p\n", obj, head)); - return 1; - - } - } - return 0; -} - -void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref) -{ - struct jffs2_eraseblock *jeb; - int blocknr; - struct jffs2_unknown_node n; - int ret, addedsize; - size_t retlen; - - if(!ref) { - printk(KERN_NOTICE "EEEEEK. jffs2_mark_node_obsolete called with NULL node\n"); - return; - } - if (ref_obsolete(ref)) { - D1(printk(KERN_DEBUG "jffs2_mark_node_obsolete called with already obsolete node at 0x%08x\n", ref_offset(ref))); - return; - } - blocknr = ref->flash_offset / c->sector_size; - if (blocknr >= c->nr_blocks) { - printk(KERN_NOTICE "raw node at 0x%08x is off the end of device!\n", ref->flash_offset); - BUG(); - } - jeb = &c->blocks[blocknr]; - - if (jffs2_can_mark_obsolete(c) && !jffs2_is_readonly(c) && - !(c->flags & (JFFS2_SB_FLAG_SCANNING | JFFS2_SB_FLAG_BUILDING))) { - /* Hm. This may confuse static lock analysis. If any of the above - three conditions is false, we're going to return from this - function without actually obliterating any nodes or freeing - any jffs2_raw_node_refs. So we don't need to stop erases from - happening, or protect against people holding an obsolete - jffs2_raw_node_ref without the erase_completion_lock. */ - down(&c->erase_free_sem); - } - - spin_lock(&c->erase_completion_lock); - - if (ref_flags(ref) == REF_UNCHECKED) { - D1(if (unlikely(jeb->unchecked_size < ref_totlen(c, jeb, ref))) { - printk(KERN_NOTICE "raw unchecked node of size 0x%08x freed from erase block %d at 0x%08x, but unchecked_size was already 0x%08x\n", - ref_totlen(c, jeb, ref), blocknr, ref->flash_offset, jeb->used_size); - BUG(); - }) - D1(printk(KERN_DEBUG "Obsoleting previously unchecked node at 0x%08x of len %x: ", ref_offset(ref), ref_totlen(c, jeb, ref))); - jeb->unchecked_size -= ref_totlen(c, jeb, ref); - c->unchecked_size -= ref_totlen(c, jeb, ref); - } else { - D1(if (unlikely(jeb->used_size < ref_totlen(c, jeb, ref))) { - printk(KERN_NOTICE "raw node of size 0x%08x freed from erase block %d at 0x%08x, but used_size was already 0x%08x\n", - ref_totlen(c, jeb, ref), blocknr, ref->flash_offset, jeb->used_size); - BUG(); - }) - D1(printk(KERN_DEBUG "Obsoleting node at 0x%08x of len %#x: ", ref_offset(ref), ref_totlen(c, jeb, ref))); - jeb->used_size -= ref_totlen(c, jeb, ref); - c->used_size -= ref_totlen(c, jeb, ref); - } - - // Take care, that wasted size is taken into concern - if ((jeb->dirty_size || ISDIRTY(jeb->wasted_size + ref_totlen(c, jeb, ref))) && jeb != c->nextblock) { - D1(printk(KERN_DEBUG "Dirtying\n")); - addedsize = ref_totlen(c, jeb, ref); - jeb->dirty_size += ref_totlen(c, jeb, ref); - c->dirty_size += ref_totlen(c, jeb, ref); - - /* Convert wasted space to dirty, if not a bad block */ - if (jeb->wasted_size) { - if (on_list(&jeb->list, &c->bad_used_list)) { - D1(printk(KERN_DEBUG "Leaving block at %08x on the bad_used_list\n", - jeb->offset)); - addedsize = 0; /* To fool the refiling code later */ - } else { - D1(printk(KERN_DEBUG "Converting %d bytes of wasted space to dirty in block at %08x\n", - jeb->wasted_size, jeb->offset)); - addedsize += jeb->wasted_size; - jeb->dirty_size += jeb->wasted_size; - c->dirty_size += jeb->wasted_size; - c->wasted_size -= jeb->wasted_size; - jeb->wasted_size = 0; - } - } - } else { - D1(printk(KERN_DEBUG "Wasting\n")); - addedsize = 0; - jeb->wasted_size += ref_totlen(c, jeb, ref); - c->wasted_size += ref_totlen(c, jeb, ref); - } - ref->flash_offset = ref_offset(ref) | REF_OBSOLETE; - - jffs2_dbg_acct_sanity_check_nolock(c, jeb); - jffs2_dbg_acct_paranoia_check_nolock(c, jeb); - - if (c->flags & JFFS2_SB_FLAG_SCANNING) { - /* Flash scanning is in progress. Don't muck about with the block - lists because they're not ready yet, and don't actually - obliterate nodes that look obsolete. If they weren't - marked obsolete on the flash at the time they _became_ - obsolete, there was probably a reason for that. */ - spin_unlock(&c->erase_completion_lock); - /* We didn't lock the erase_free_sem */ - return; - } - - if (jeb == c->nextblock) { - D2(printk(KERN_DEBUG "Not moving nextblock 0x%08x to dirty/erase_pending list\n", jeb->offset)); - } else if (!jeb->used_size && !jeb->unchecked_size) { - if (jeb == c->gcblock) { - D1(printk(KERN_DEBUG "gcblock at 0x%08x completely dirtied. Clearing gcblock...\n", jeb->offset)); - c->gcblock = NULL; - } else { - D1(printk(KERN_DEBUG "Eraseblock at 0x%08x completely dirtied. Removing from (dirty?) list...\n", jeb->offset)); - list_del(&jeb->list); - } - if (jffs2_wbuf_dirty(c)) { - D1(printk(KERN_DEBUG "...and adding to erasable_pending_wbuf_list\n")); - list_add_tail(&jeb->list, &c->erasable_pending_wbuf_list); - } else { - if (jiffies & 127) { - /* Most of the time, we just erase it immediately. Otherwise we - spend ages scanning it on mount, etc. */ - D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n")); - list_add_tail(&jeb->list, &c->erase_pending_list); - c->nr_erasing_blocks++; - jffs2_erase_pending_trigger(c); - } else { - /* Sometimes, however, we leave it elsewhere so it doesn't get - immediately reused, and we spread the load a bit. */ - D1(printk(KERN_DEBUG "...and adding to erasable_list\n")); - list_add_tail(&jeb->list, &c->erasable_list); - } - } - D1(printk(KERN_DEBUG "Done OK\n")); - } else if (jeb == c->gcblock) { - D2(printk(KERN_DEBUG "Not moving gcblock 0x%08x to dirty_list\n", jeb->offset)); - } else if (ISDIRTY(jeb->dirty_size) && !ISDIRTY(jeb->dirty_size - addedsize)) { - D1(printk(KERN_DEBUG "Eraseblock at 0x%08x is freshly dirtied. Removing from clean list...\n", jeb->offset)); - list_del(&jeb->list); - D1(printk(KERN_DEBUG "...and adding to dirty_list\n")); - list_add_tail(&jeb->list, &c->dirty_list); - } else if (VERYDIRTY(c, jeb->dirty_size) && - !VERYDIRTY(c, jeb->dirty_size - addedsize)) { - D1(printk(KERN_DEBUG "Eraseblock at 0x%08x is now very dirty. Removing from dirty list...\n", jeb->offset)); - list_del(&jeb->list); - D1(printk(KERN_DEBUG "...and adding to very_dirty_list\n")); - list_add_tail(&jeb->list, &c->very_dirty_list); - } else { - D1(printk(KERN_DEBUG "Eraseblock at 0x%08x not moved anywhere. (free 0x%08x, dirty 0x%08x, used 0x%08x)\n", - jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size)); - } - - spin_unlock(&c->erase_completion_lock); - - if (!jffs2_can_mark_obsolete(c) || jffs2_is_readonly(c) || - (c->flags & JFFS2_SB_FLAG_BUILDING)) { - /* We didn't lock the erase_free_sem */ - return; - } - - /* The erase_free_sem is locked, and has been since before we marked the node obsolete - and potentially put its eraseblock onto the erase_pending_list. Thus, we know that - the block hasn't _already_ been erased, and that 'ref' itself hasn't been freed yet - by jffs2_free_all_node_refs() in erase.c. Which is nice. */ - - D1(printk(KERN_DEBUG "obliterating obsoleted node at 0x%08x\n", ref_offset(ref))); - ret = jffs2_flash_read(c, ref_offset(ref), sizeof(n), &retlen, (unsigned char *)&n); - if (ret) { - printk(KERN_WARNING "Read error reading from obsoleted node at 0x%08x: %d\n", ref_offset(ref), ret); - goto out_erase_sem; - } - if (retlen != sizeof(n)) { - printk(KERN_WARNING "Short read from obsoleted node at 0x%08x: %zd\n", ref_offset(ref), retlen); - goto out_erase_sem; - } - if (PAD(je32_to_cpu(n.totlen)) != PAD(ref_totlen(c, jeb, ref))) { - printk(KERN_WARNING "Node totlen on flash (0x%08x) != totlen from node ref (0x%08x)\n", je32_to_cpu(n.totlen), ref_totlen(c, jeb, ref)); - goto out_erase_sem; - } - if (!(je16_to_cpu(n.nodetype) & JFFS2_NODE_ACCURATE)) { - D1(printk(KERN_DEBUG "Node at 0x%08x was already marked obsolete (nodetype 0x%04x)\n", ref_offset(ref), je16_to_cpu(n.nodetype))); - goto out_erase_sem; - } - /* XXX FIXME: This is ugly now */ - n.nodetype = cpu_to_je16(je16_to_cpu(n.nodetype) & ~JFFS2_NODE_ACCURATE); - ret = jffs2_flash_write(c, ref_offset(ref), sizeof(n), &retlen, (unsigned char *)&n); - if (ret) { - printk(KERN_WARNING "Write error in obliterating obsoleted node at 0x%08x: %d\n", ref_offset(ref), ret); - goto out_erase_sem; - } - if (retlen != sizeof(n)) { - printk(KERN_WARNING "Short write in obliterating obsoleted node at 0x%08x: %zd\n", ref_offset(ref), retlen); - goto out_erase_sem; - } - - /* Nodes which have been marked obsolete no longer need to be - associated with any inode. Remove them from the per-inode list. - - Note we can't do this for NAND at the moment because we need - obsolete dirent nodes to stay on the lists, because of the - horridness in jffs2_garbage_collect_deletion_dirent(). Also - because we delete the inocache, and on NAND we need that to - stay around until all the nodes are actually erased, in order - to stop us from giving the same inode number to another newly - created inode. */ - if (ref->next_in_ino) { - struct jffs2_inode_cache *ic; - struct jffs2_raw_node_ref **p; - - spin_lock(&c->erase_completion_lock); - - ic = jffs2_raw_ref_to_ic(ref); - for (p = &ic->nodes; (*p) != ref; p = &((*p)->next_in_ino)) - ; - - *p = ref->next_in_ino; - ref->next_in_ino = NULL; - - if (ic->nodes == (void *)ic && ic->nlink == 0) - jffs2_del_ino_cache(c, ic); - - spin_unlock(&c->erase_completion_lock); - } - - - /* Merge with the next node in the physical list, if there is one - and if it's also obsolete and if it doesn't belong to any inode */ - if (ref->next_phys && ref_obsolete(ref->next_phys) && - !ref->next_phys->next_in_ino) { - struct jffs2_raw_node_ref *n = ref->next_phys; - - spin_lock(&c->erase_completion_lock); - - ref->__totlen += n->__totlen; - ref->next_phys = n->next_phys; - if (jeb->last_node == n) jeb->last_node = ref; - if (jeb->gc_node == n) { - /* gc will be happy continuing gc on this node */ - jeb->gc_node=ref; - } - spin_unlock(&c->erase_completion_lock); - - jffs2_free_raw_node_ref(n); - } - - /* Also merge with the previous node in the list, if there is one - and that one is obsolete */ - if (ref != jeb->first_node ) { - struct jffs2_raw_node_ref *p = jeb->first_node; - - spin_lock(&c->erase_completion_lock); - - while (p->next_phys != ref) - p = p->next_phys; - - if (ref_obsolete(p) && !ref->next_in_ino) { - p->__totlen += ref->__totlen; - if (jeb->last_node == ref) { - jeb->last_node = p; - } - if (jeb->gc_node == ref) { - /* gc will be happy continuing gc on this node */ - jeb->gc_node=p; - } - p->next_phys = ref->next_phys; - jffs2_free_raw_node_ref(ref); - } - spin_unlock(&c->erase_completion_lock); - } - out_erase_sem: - up(&c->erase_free_sem); -} - -int jffs2_thread_should_wake(struct jffs2_sb_info *c) -{ - int ret = 0; - uint32_t dirty; - - if (c->unchecked_size) { - D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): unchecked_size %d, checked_ino #%d\n", - c->unchecked_size, c->checked_ino)); - return 1; - } - - /* dirty_size contains blocks on erase_pending_list - * those blocks are counted in c->nr_erasing_blocks. - * If one block is actually erased, it is not longer counted as dirty_space - * but it is counted in c->nr_erasing_blocks, so we add it and subtract it - * with c->nr_erasing_blocks * c->sector_size again. - * Blocks on erasable_list are counted as dirty_size, but not in c->nr_erasing_blocks - * This helps us to force gc and pick eventually a clean block to spread the load. - */ - dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks * c->sector_size; - - if (c->nr_free_blocks + c->nr_erasing_blocks < c->resv_blocks_gctrigger && - (dirty > c->nospc_dirty_size)) - ret = 1; - - D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): nr_free_blocks %d, nr_erasing_blocks %d, dirty_size 0x%x: %s\n", - c->nr_free_blocks, c->nr_erasing_blocks, c->dirty_size, ret?"yes":"no")); - - return ret; -} diff --git a/components/dfs/filesystems/jffs2/src/os-ecos.h b/components/dfs/filesystems/jffs2/src/os-ecos.h deleted file mode 100644 index b6d2a0e8c8..0000000000 --- a/components/dfs/filesystems/jffs2/src/os-ecos.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2002-2003 Free Software Foundation, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: os-ecos.h,v 1.24 2005/02/09 09:23:55 pavlov Exp $ - * - */ - -#ifndef __JFFS2_OS_ECOS_H__ -#define __JFFS2_OS_ECOS_H__ -#include "jffs2_config.h" -#include -#define printf rt_kprintf - -//#include -//#include -//#include -#include -#include -#include - -//#include -//#include -//#include - -//#include // tracing macros -//#include // assertion macros - -//#if defined (__GNUC__) -//#include -//#elif defined (MSVC) -//#else -//#endif - -#include "port/sys/stat.h"//#include -//#include -//#include -//#include //fixme - -//#include - -struct dirent -{ -#ifdef CYGPKG_FILEIO_DIRENT_DTYPE - - mode_t d_type; // Only supported with FATFS, RAMFS, ROMFS, - // and JFFS2. - // d_type is not part of POSIX so - // should be used with caution. -#endif - char d_name[JFFS2_NAME_MAX+1]; -}; - - -//#include -#include - -#include //prife - -//#include -//#include - -//#include - -#include -#include -#include - -//#define printf diag_printf //prife - -struct _inode; -struct super_block; - -struct iovec { - void *iov_base; - ssize_t iov_len; -}; - -static inline unsigned int full_name_hash(const unsigned char * name, unsigned int len) { - - unsigned hash = 0; - while (len--) { - hash = (hash << 4) | (hash >> 28); - hash ^= *(name++); - } - return hash; -} - -#ifdef CYGOPT_FS_JFFS2_WRITE -#define jffs2_is_readonly(c) (0) -#else -#define jffs2_is_readonly(c) (1) -#endif - -/* NAND flash not currently supported on eCos */ -#define jffs2_can_mark_obsolete(c) (1) - -#define JFFS2_INODE_INFO(i) (&(i)->jffs2_i) -#define OFNI_EDONI_2SFFJ(f) ((struct _inode *) ( ((char *)f) - ((char *)(&((struct _inode *)NULL)->jffs2_i)) ) ) - -#define JFFS2_F_I_SIZE(f) (OFNI_EDONI_2SFFJ(f)->i_size) -#define JFFS2_F_I_MODE(f) (OFNI_EDONI_2SFFJ(f)->i_mode) -#define JFFS2_F_I_UID(f) (OFNI_EDONI_2SFFJ(f)->i_uid) -#define JFFS2_F_I_GID(f) (OFNI_EDONI_2SFFJ(f)->i_gid) -#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime) -#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime) -#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime) - -/* FIXME: eCos doesn't hav a concept of device major/minor numbers */ -#define JFFS2_F_I_RDEV_MIN(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)&0xff) -#define JFFS2_F_I_RDEV_MAJ(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)>>8) - -#define get_seconds jffs2_get_timestamp - -struct _inode { - cyg_uint32 i_ino; - - int i_count; - mode_t i_mode; - nlink_t i_nlink; // Could we dispense with this? - uid_t i_uid; - gid_t i_gid; - time_t i_atime; - time_t i_mtime; - time_t i_ctime; -// union { - unsigned short i_rdev; // For devices only - struct _inode * i_parent; // For directories only - off_t i_size; // For files only -// }; - struct super_block * i_sb; - - struct jffs2_inode_info jffs2_i; - - struct _inode * i_cache_prev; // We need doubly-linked? - struct _inode * i_cache_next; -}; - -#define JFFS2_SB_INFO(sb) (&(sb)->jffs2_sb) -#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->jffs2_sb)) ) ) - -struct super_block { - struct jffs2_sb_info jffs2_sb; - struct _inode * s_root; - unsigned long s_mount_count; - cyg_io_handle_t s_dev; - -//#ifdef CYGOPT_FS_JFFS2_GCTHREAD -// cyg_mutex_t s_lock; // Lock the inode cache -// cyg_flag_t s_gc_thread_flags; // Communication with the gcthread -// cyg_handle_t s_gc_thread_handle; -// cyg_thread s_gc_thread; -//#if (CYGNUM_JFFS2_GC_THREAD_STACK_SIZE >= CYGNUM_HAL_STACK_SIZE_MINIMUM) -// char s_gc_thread_stack[CYGNUM_JFFS2_GC_THREAD_STACK_SIZE]; -//#else -// char s_gc_thread_stack[CYGNUM_HAL_STACK_SIZE_MINIMUM]; -//#endif -// cyg_mtab_entry *mte; -//#endif - -#ifdef CYGOPT_FS_JFFS2_GCTHREAD - struct rt_mutex s_lock; // Lock the inode cache - struct rt_event s_gc_thread_flags; // Communication with the gcthread - //void (*s_gc_thread_handle)(void *parameter); - struct rt_thread s_gc_thread; -//#if (CYGNUM_JFFS2_GC_THREAD_STACK_SIZE >= CYGNUM_HAL_STACK_SIZE_MINIMUM) -// char s_gc_thread_stack[CYGNUM_JFFS2_GC_THREAD_STACK_SIZE]; -//#else -// char s_gc_thread_stack[CYGNUM_HAL_STACK_SIZE_MINIMUM]; -//#endif - #define CYGNUM_JFFS2_GC_THREAD_STACK_SIZE (1024*4) - char s_gc_thread_stack[CYGNUM_JFFS2_GC_THREAD_STACK_SIZE]; - - cyg_mtab_entry *mte; -#endif - -}; - -#define sleep_on_spinunlock(wq, sl) spin_unlock(sl) -#define EBADFD 32767 - -/* background.c */ -#ifdef CYGOPT_FS_JFFS2_GCTHREAD -void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); -void jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c); -void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); -#else -static inline void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) -{ - /* We don't have a GC thread in eCos (yet) */ -} -#endif - -/* fs-ecos.c */ -struct _inode *jffs2_new_inode (struct _inode *dir_i, int mode, struct jffs2_raw_inode *ri); -struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino); -void jffs2_iput(struct _inode * i); -void jffs2_gc_release_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); -struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, int inum, int nlink); -unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - unsigned long offset, unsigned long *priv); -void jffs2_gc_release_page(struct jffs2_sb_info *c, unsigned char *pg, unsigned long *priv); - -/* Avoid polluting eCos namespace with names not starting in jffs2_ */ -#define os_to_jffs2_mode(x) jffs2_from_os_mode(x) -uint32_t jffs2_from_os_mode(uint32_t osmode); -uint32_t jffs2_to_os_mode (uint32_t jmode); - - -/* flashio.c */ -int jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset, - const size_t size, size_t * return_size, unsigned char * write_buffer); -int jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset, - const size_t size, size_t * return_size, unsigned char * read_buffer); -int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs, - unsigned long count, loff_t to, size_t *retlen); -int jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); - -// dir-ecos.c -struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *name, int namelen); -int jffs2_create(struct _inode *dir_i, const unsigned char *d_name, int mode, struct _inode **new_i); -int jffs2_mkdir (struct _inode *dir_i, const unsigned char *d_name, int mode); -int jffs2_link (struct _inode *old_d_inode, struct _inode *dir_i, const unsigned char *d_name); -int jffs2_unlink(struct _inode *dir_i, struct _inode *d_inode, const unsigned char *d_name); -int jffs2_rmdir (struct _inode *dir_i, struct _inode *d_inode, const unsigned char *d_name); -int jffs2_rename (struct _inode *old_dir_i, struct _inode *d_inode, const unsigned char *old_d_name, - struct _inode *new_dir_i, const unsigned char *new_d_name); - -/* erase.c */ -static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c) -{ } - -#ifndef CONFIG_JFFS2_FS_WRITEBUFFER -#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) ) -#define jffs2_can_mark_obsolete(c) (1) -#define jffs2_cleanmarker_oob(c) (0) -#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO) - -#define jffs2_flush_wbuf_pad(c) (c=c) -#define jffs2_flush_wbuf_gc(c, i) ({ (void)(c), (void) i, 0; }) -#define jffs2_nand_read_failcnt(c,jeb) do { ; } while(0) -#define jffs2_write_nand_badblock(c,jeb,p) (0) -#define jffs2_flash_setup(c) (0) -#define jffs2_nand_flash_cleanup(c) do {} while(0) -#define jffs2_wbuf_dirty(c) (0) -#define jffs2_flash_writev(a,b,c,d,e,f) jffs2_flash_direct_writev(a,b,c,d,e) -#define jffs2_wbuf_timeout NULL -#define jffs2_wbuf_process NULL -#define jffs2_nor_ecc(c) (0) -#else -#error no nand yet -#endif - -#ifndef BUG_ON -#define BUG_ON(x) do { if (unlikely(x)) BUG(); } while(0) -#endif - -#define __init - -#endif /* __JFFS2_OS_ECOS_H__ */ diff --git a/components/dfs/filesystems/jffs2/src/os-rtthread.h b/components/dfs/filesystems/jffs2/src/os-rtthread.h deleted file mode 100644 index 95496c2e73..0000000000 --- a/components/dfs/filesystems/jffs2/src/os-rtthread.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2002-2003 Free Software Foundation, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: os-ecos.h,v 1.24 2005/02/09 09:23:55 pavlov Exp $ - * - */ - -#ifndef __JFFS2_OS_RTTHREAD_H__ -#define __JFFS2_OS_RTTHREAD_H__ -#include "jffs2_config.h" -#include -#define printf rt_kprintf - -//#include -//#include -//#include -#include -#include -#include - -//#include -//#include -//#include - -//#include // tracing macros -//#include // assertion macros - -//#if defined (__GNUC__) -//#include -//#elif defined (MSVC) -//#else -//#endif - -#include "os_sys_stat.h"//#include -//#include -//#include -//#include //fixme - -//#include -#define CYGPKG_FILEIO_DIRENT_DTYPE -struct dirent -{ -#ifdef CYGPKG_FILEIO_DIRENT_DTYPE - - mode_t d_type; // Only supported with FATFS, RAMFS, ROMFS, - // and JFFS2. - // d_type is not part of POSIX so - // should be used with caution. -#endif - char d_name[NAME_MAX+1]; -}; - -#include - -#include //prife - -//#include -//#include - -//#include - -#include -#include -#include - -//#define printf diag_printf //prife - -struct _inode; -struct super_block; - -struct iovec { - void *iov_base; - ssize_t iov_len; -}; - -static inline unsigned int full_name_hash(const unsigned char * name, unsigned int len) { - - unsigned hash = 0; - while (len--) { - hash = (hash << 4) | (hash >> 28); - hash ^= *(name++); - } - return hash; -} - -#ifdef CYGOPT_FS_JFFS2_WRITE -#define jffs2_is_readonly(c) (0) -#else -#define jffs2_is_readonly(c) (1) -#endif - -/* NAND flash not currently supported on eCos */ -#define jffs2_can_mark_obsolete(c) (1) - -#define JFFS2_INODE_INFO(i) (&(i)->jffs2_i) -#define OFNI_EDONI_2SFFJ(f) ((struct _inode *) ( ((char *)f) - ((char *)(&((struct _inode *)NULL)->jffs2_i)) ) ) - -#define JFFS2_F_I_SIZE(f) (OFNI_EDONI_2SFFJ(f)->i_size) -#define JFFS2_F_I_MODE(f) (OFNI_EDONI_2SFFJ(f)->i_mode) -#define JFFS2_F_I_UID(f) (OFNI_EDONI_2SFFJ(f)->i_uid) -#define JFFS2_F_I_GID(f) (OFNI_EDONI_2SFFJ(f)->i_gid) -#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime) -#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime) -#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime) - -/* FIXME: eCos doesn't hav a concept of device major/minor numbers */ -#define JFFS2_F_I_RDEV_MIN(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)&0xff) -#define JFFS2_F_I_RDEV_MAJ(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)>>8) - -#define get_seconds jffs2_get_timestamp - -struct _inode { - cyg_uint32 i_ino; - - int i_count; - mode_t i_mode; - nlink_t i_nlink; // Could we dispense with this? - uid_t i_uid; - gid_t i_gid; - time_t i_atime; - time_t i_mtime; - time_t i_ctime; -// union { - unsigned short i_rdev; // For devices only - struct _inode * i_parent; // For directories only - off_t i_size; // For files only -// }; - struct super_block * i_sb; - - struct jffs2_inode_info jffs2_i; - - struct _inode * i_cache_prev; // We need doubly-linked? - struct _inode * i_cache_next; -}; - -#define JFFS2_SB_INFO(sb) (&(sb)->jffs2_sb) -#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->jffs2_sb)) ) ) - -struct super_block { - struct jffs2_sb_info jffs2_sb; - struct _inode * s_root; - unsigned long s_mount_count; - cyg_io_handle_t s_dev; - -//#ifdef CYGOPT_FS_JFFS2_GCTHREAD -// cyg_mutex_t s_lock; // Lock the inode cache -// cyg_flag_t s_gc_thread_flags; // Communication with the gcthread -// cyg_handle_t s_gc_thread_handle; -// cyg_thread s_gc_thread; -//#if (CYGNUM_JFFS2_GC_THREAD_STACK_SIZE >= CYGNUM_HAL_STACK_SIZE_MINIMUM) -// char s_gc_thread_stack[CYGNUM_JFFS2_GC_THREAD_STACK_SIZE]; -//#else -// char s_gc_thread_stack[CYGNUM_HAL_STACK_SIZE_MINIMUM]; -//#endif -// cyg_mtab_entry *mte; -//#endif - -#ifdef CYGOPT_FS_JFFS2_GCTHREAD - struct rt_mutex s_lock; // Lock the inode cache - struct rt_event s_gc_thread_flags; // Communication with the gcthread - //void (*s_gc_thread_handle)(void *parameter); - struct rt_thread s_gc_thread; -//#if (CYGNUM_JFFS2_GC_THREAD_STACK_SIZE >= CYGNUM_HAL_STACK_SIZE_MINIMUM) -// char s_gc_thread_stack[CYGNUM_JFFS2_GC_THREAD_STACK_SIZE]; -//#else -// char s_gc_thread_stack[CYGNUM_HAL_STACK_SIZE_MINIMUM]; -//#endif - #define CYGNUM_JFFS2_GC_THREAD_STACK_SIZE (1024*4) - char s_gc_thread_stack[CYGNUM_JFFS2_GC_THREAD_STACK_SIZE]; - - cyg_mtab_entry *mte; -#endif - -}; - -#define sleep_on_spinunlock(wq, sl) spin_unlock(sl) -#define EBADFD 32767 - -/* background.c */ -#ifdef CYGOPT_FS_JFFS2_GCTHREAD -void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); -void jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c); -void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); -#else -static inline void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) -{ - /* We don't have a GC thread in eCos (yet) */ -} -#endif - -/* fs-ecos.c */ -struct _inode *jffs2_new_inode (struct _inode *dir_i, int mode, struct jffs2_raw_inode *ri); -struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino); -void jffs2_iput(struct _inode * i); -void jffs2_gc_release_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); -struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, int inum, int nlink); -unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - unsigned long offset, unsigned long *priv); -void jffs2_gc_release_page(struct jffs2_sb_info *c, unsigned char *pg, unsigned long *priv); - -/* Avoid polluting eCos namespace with names not starting in jffs2_ */ -#define os_to_jffs2_mode(x) jffs2_from_os_mode(x) -uint32_t jffs2_from_os_mode(uint32_t osmode); -uint32_t jffs2_to_os_mode (uint32_t jmode); - - -/* flashio.c */ -int jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset, - const size_t size, size_t * return_size, unsigned char * write_buffer); -int jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset, - const size_t size, size_t * return_size, unsigned char * read_buffer); -int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs, - unsigned long count, loff_t to, size_t *retlen); -int jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); - -// dir-ecos.c -struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *name, int namelen); -int jffs2_create(struct _inode *dir_i, const unsigned char *d_name, int mode, struct _inode **new_i); -int jffs2_mkdir (struct _inode *dir_i, const unsigned char *d_name, int mode); -int jffs2_link (struct _inode *old_d_inode, struct _inode *dir_i, const unsigned char *d_name); -int jffs2_unlink(struct _inode *dir_i, struct _inode *d_inode, const unsigned char *d_name); -int jffs2_rmdir (struct _inode *dir_i, struct _inode *d_inode, const unsigned char *d_name); -int jffs2_rename (struct _inode *old_dir_i, struct _inode *d_inode, const unsigned char *old_d_name, - struct _inode *new_dir_i, const unsigned char *new_d_name); - -/* erase.c */ -static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c) -{ } - -#ifndef CONFIG_JFFS2_FS_WRITEBUFFER -#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) ) -#define jffs2_can_mark_obsolete(c) (1) -#define jffs2_cleanmarker_oob(c) (0) -#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO) - -#define jffs2_flush_wbuf_pad(c) (c=c) -#define jffs2_flush_wbuf_gc(c, i) ({ (void)(c), (void) i, 0; }) -#define jffs2_nand_read_failcnt(c,jeb) do { ; } while(0) -#define jffs2_write_nand_badblock(c,jeb,p) (0) -#define jffs2_flash_setup(c) (0) -#define jffs2_nand_flash_cleanup(c) do {} while(0) -#define jffs2_wbuf_dirty(c) (0) -#define jffs2_flash_writev(a,b,c,d,e,f) jffs2_flash_direct_writev(a,b,c,d,e) -#define jffs2_wbuf_timeout NULL -#define jffs2_wbuf_process NULL -#define jffs2_nor_ecc(c) (0) -#else -#error no nand yet -#endif - -#ifndef BUG_ON -#define BUG_ON(x) do { if (unlikely(x)) BUG(); } while(0) -#endif - -#define __init - -#endif /* __JFFS2_OS_ECOS_H__ */ diff --git a/components/dfs/filesystems/jffs2/src/pushpull.h b/components/dfs/filesystems/jffs2/src/pushpull.h deleted file mode 100644 index 4e84ee38a8..0000000000 --- a/components/dfs/filesystems/jffs2/src/pushpull.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001, 2002 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: pushpull.h,v 1.10 2004/11/16 20:36:11 dwmw2 Exp $ - * - */ - -#ifndef __PUSHPULL_H__ -#define __PUSHPULL_H__ - -#include - -struct pushpull { - unsigned char *buf; - unsigned int buflen; - unsigned int ofs; - unsigned int reserve; -}; - - -static inline void init_pushpull(struct pushpull *pp, char *buf, unsigned buflen, unsigned ofs, unsigned reserve) -{ - pp->buf = (unsigned char *)buf; - pp->buflen = buflen; - pp->ofs = ofs; - pp->reserve = reserve; -} - -static inline int pushbit(struct pushpull *pp, int bit, int use_reserved) -{ - if (pp->ofs >= pp->buflen - (use_reserved?0:pp->reserve)) { - return -ENOSPC; - } - - if (bit) { - pp->buf[pp->ofs >> 3] |= (1<<(7-(pp->ofs &7))); - } - else { - pp->buf[pp->ofs >> 3] &= ~(1<<(7-(pp->ofs &7))); - } - pp->ofs++; - - return 0; -} - -static inline int pushedbits(struct pushpull *pp) -{ - return pp->ofs; -} - -static inline int pullbit(struct pushpull *pp) -{ - int bit; - - bit = (pp->buf[pp->ofs >> 3] >> (7-(pp->ofs & 7))) & 1; - - pp->ofs++; - return bit; -} - -static inline int pulledbits(struct pushpull *pp) -{ - return pp->ofs; -} - -#endif /* __PUSHPULL_H__ */ diff --git a/components/dfs/filesystems/jffs2/src/read.c b/components/dfs/filesystems/jffs2/src/read.c deleted file mode 100644 index a70edd9bc0..0000000000 --- a/components/dfs/filesystems/jffs2/src/read.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: read.c,v 1.41 2005/07/22 10:32:08 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include -#include "nodelist.h" -#include "compr.h" - -int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - struct jffs2_full_dnode *fd, unsigned char *buf, - int ofs, int len) -{ - struct jffs2_raw_inode *ri; - size_t readlen; - uint32_t crc; - unsigned char *decomprbuf = NULL; - unsigned char *readbuf = NULL; - int ret = 0,i=0; - - ri = jffs2_alloc_raw_inode(); - if (!ri) - return -ENOMEM; - - ret = jffs2_flash_read(c, ref_offset(fd->raw), sizeof(*ri), &readlen, (unsigned char *)ri); - if (ret) { - jffs2_free_raw_inode(ri); - printk(KERN_WARNING "Error reading node from 0x%08x: %d\n", ref_offset(fd->raw), ret); - return ret; - } - if (readlen != sizeof(*ri)) { - jffs2_free_raw_inode(ri); - printk(KERN_WARNING "Short read from 0x%08x: wanted 0x%zx bytes, got 0x%zx\n", - ref_offset(fd->raw), sizeof(*ri), readlen); - return -EIO; - } - crc = crc32(0, ri, sizeof(*ri)-8); - - D1(printk(KERN_DEBUG "Node read from %08x: node_crc %08x, calculated CRC %08x. dsize %x, csize %x, offset %x, buf %p\n", - ref_offset(fd->raw), je32_to_cpu(ri->node_crc), - crc, je32_to_cpu(ri->dsize), je32_to_cpu(ri->csize), - je32_to_cpu(ri->offset), buf)); - if (crc != je32_to_cpu(ri->node_crc)) { - printk(KERN_WARNING "Node CRC %08x != calculated CRC %08x for node at %08x\n", - je32_to_cpu(ri->node_crc), crc, ref_offset(fd->raw)); - ret = -EIO; - goto out_ri; - } - /* There was a bug where we wrote hole nodes out with csize/dsize - swapped. Deal with it */ - if (ri->compr == JFFS2_COMPR_ZERO && !je32_to_cpu(ri->dsize) && - je32_to_cpu(ri->csize)) { - ri->dsize = ri->csize; - ri->csize = cpu_to_je32(0); - } - - D1(if(ofs + len > je32_to_cpu(ri->dsize)) { - printk(KERN_WARNING "jffs2_read_dnode() asked for %d bytes at %d from %d-byte node\n", - len, ofs, je32_to_cpu(ri->dsize)); - ret = -EINVAL; - goto out_ri; - }); - - - if (ri->compr == JFFS2_COMPR_ZERO) { - memset(buf, 0, len); - goto out_ri; - } - - /* Cases: - Reading whole node and it's uncompressed - read directly to buffer provided, check CRC. - Reading whole node and it's compressed - read into comprbuf, check CRC and decompress to buffer provided - Reading partial node and it's uncompressed - read into readbuf, check CRC, and copy - Reading partial node and it's compressed - read into readbuf, check checksum, decompress to decomprbuf and copy - */ - if (ri->compr == JFFS2_COMPR_NONE && len == je32_to_cpu(ri->dsize)) { - readbuf = buf; - } else { - readbuf = kmalloc(je32_to_cpu(ri->csize), GFP_KERNEL); - if (!readbuf) { - ret = -ENOMEM; - goto out_ri; - } - } - if (ri->compr != JFFS2_COMPR_NONE) { - if (len < je32_to_cpu(ri->dsize)) { - decomprbuf = kmalloc(je32_to_cpu(ri->dsize), GFP_KERNEL); - if (!decomprbuf) { - ret = -ENOMEM; - goto out_readbuf; - } - } else { - decomprbuf = buf; - } - } else { - decomprbuf = readbuf; - } - - D2(printk(KERN_DEBUG "Read %d bytes to %p\n", je32_to_cpu(ri->csize), - readbuf)); - ret = jffs2_flash_read(c, (ref_offset(fd->raw)) + sizeof(*ri), - je32_to_cpu(ri->csize), &readlen, readbuf); - - if (!ret && readlen != je32_to_cpu(ri->csize)) - ret = -EIO; - if (ret) - goto out_decomprbuf; - - crc = crc32(0, readbuf, je32_to_cpu(ri->csize)); - if (crc != je32_to_cpu(ri->data_crc)) { - printk(KERN_WARNING "Data CRC %08x != calculated CRC %08x for node at %08x\n", - je32_to_cpu(ri->data_crc), crc, ref_offset(fd->raw)); - ret = -EIO; - goto out_decomprbuf; - } - D2(printk(KERN_DEBUG "Data CRC matches calculated CRC %08x\n", crc)); - if (ri->compr != JFFS2_COMPR_NONE) { - D2(printk(KERN_DEBUG "Decompress %d bytes from %p to %d bytes at %p\n", - je32_to_cpu(ri->csize), readbuf, je32_to_cpu(ri->dsize), decomprbuf)); - //add for debug -// for (i=0; icsize); i++) -// { -// printf("%02x ", readbuf[i]); -// if( (i+1) % 16 == 0) -// printf("\n"); -// } - //end debug - ret = jffs2_decompress(c, f, ri->compr | (ri->usercompr << 8), readbuf, decomprbuf, je32_to_cpu(ri->csize), je32_to_cpu(ri->dsize)); - if (ret) { - printk(KERN_WARNING "Error: jffs2_decompress returned %d\n", ret); - goto out_decomprbuf; - } - } - - if (len < je32_to_cpu(ri->dsize)) { - memcpy(buf, decomprbuf+ofs, len); - } - out_decomprbuf: - if(decomprbuf != buf && decomprbuf != readbuf) - kfree(decomprbuf); - out_readbuf: - if(readbuf != buf) - kfree(readbuf); - out_ri: - jffs2_free_raw_inode(ri); - - return ret; -} - -int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - unsigned char *buf, uint32_t offset, uint32_t len) -{ - uint32_t end = offset + len; - struct jffs2_node_frag *frag; - int ret; - - D1(printk(KERN_DEBUG "jffs2_read_inode_range: ino #%u, range 0x%08x-0x%08x\n", - f->inocache->ino, offset, offset+len)); - - frag = jffs2_lookup_node_frag(&f->fragtree, offset); - - /* XXX FIXME: Where a single physical node actually shows up in two - frags, we read it twice. Don't do that. */ - /* Now we're pointing at the first frag which overlaps our page */ - while(offset < end) { - D2(printk(KERN_DEBUG "jffs2_read_inode_range: offset %d, end %d\n", offset, end)); - if (unlikely(!frag || frag->ofs > offset)) { - uint32_t holesize = end - offset; - if (frag) { - D1(printk(KERN_NOTICE "Eep. Hole in ino #%u fraglist. frag->ofs = 0x%08x, offset = 0x%08x\n", f->inocache->ino, frag->ofs, offset)); - holesize = min(holesize, frag->ofs - offset); - } - D1(printk(KERN_DEBUG "Filling non-frag hole from %d-%d\n", offset, offset+holesize)); - memset(buf, 0, holesize); - buf += holesize; - offset += holesize; - continue; - } else if (unlikely(!frag->node)) { - uint32_t holeend = min(end, frag->ofs + frag->size); - D1(printk(KERN_DEBUG "Filling frag hole from %d-%d (frag 0x%x 0x%x)\n", offset, holeend, frag->ofs, frag->ofs + frag->size)); - memset(buf, 0, holeend - offset); - buf += holeend - offset; - offset = holeend; - frag = frag_next(frag); - continue; - } else { - uint32_t readlen; - uint32_t fragofs; /* offset within the frag to start reading */ - - fragofs = offset - frag->ofs; - readlen = min(frag->size - fragofs, end - offset); - D1(printk(KERN_DEBUG "Reading %d-%d from node at 0x%08x (%d)\n", - frag->ofs+fragofs, frag->ofs+fragofs+readlen, - ref_offset(frag->node->raw), ref_flags(frag->node->raw))); - ret = jffs2_read_dnode(c, f, frag->node, buf, fragofs + frag->ofs - frag->node->ofs, readlen); - D2(printk(KERN_DEBUG "node read done\n")); - if (ret) { - D1(printk(KERN_DEBUG"jffs2_read_inode_range error %d\n",ret)); - memset(buf, 0, readlen); - return ret; - } - buf += readlen; - offset += readlen; - frag = frag_next(frag); - D2(printk(KERN_DEBUG "node read was OK. Looping\n")); - } - } - return 0; -} - diff --git a/components/dfs/filesystems/jffs2/src/readinode.c b/components/dfs/filesystems/jffs2/src/readinode.c deleted file mode 100644 index ae1481fd23..0000000000 --- a/components/dfs/filesystems/jffs2/src/readinode.c +++ /dev/null @@ -1,895 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: readinode.c,v 1.132 2005/07/28 14:46:40 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "nodelist.h" - -void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size) -{ - struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size); - - JFFS2_DBG_FRAGTREE("truncating fragtree to 0x%08x bytes\n", size); - - /* We know frag->ofs <= size. That's what lookup does for us */ - if (frag && frag->ofs != size) { - if (frag->ofs+frag->size >= size) { - JFFS2_DBG_FRAGTREE2("truncating frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size); - frag->size = size - frag->ofs; - } - frag = frag_next(frag); - } - while (frag && frag->ofs >= size) { - struct jffs2_node_frag *next = frag_next(frag); - - JFFS2_DBG_FRAGTREE("removing frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size); - frag_erase(frag, list); - jffs2_obsolete_node_frag(c, frag); - frag = next; - } -} - -/* - * Put a new tmp_dnode_info into the temporaty RB-tree, keeping the list in - * order of increasing version. - */ -static void jffs2_add_tn_to_tree(struct jffs2_tmp_dnode_info *tn, struct rb_root *list) -{ - struct rb_node **p = &list->rb_node; - struct rb_node * parent = NULL; - struct jffs2_tmp_dnode_info *this; - - while (*p) { - parent = *p; - this = rb_entry(parent, struct jffs2_tmp_dnode_info, rb); - - /* There may actually be a collision here, but it doesn't - actually matter. As long as the two nodes with the same - version are together, it's all fine. */ - if (tn->version < this->version) - p = &(*p)->rb_left; - else - p = &(*p)->rb_right; - } - - rb_link_node(&tn->rb, parent, p); - rb_insert_color(&tn->rb, list); -} - -static void jffs2_free_tmp_dnode_info_list(struct rb_root *list) -{ - struct rb_node *this; - struct jffs2_tmp_dnode_info *tn; - - this = list->rb_node; - - /* Now at bottom of tree */ - while (this) { - if (this->rb_left) - this = this->rb_left; - else if (this->rb_right) - this = this->rb_right; - else { - tn = rb_entry(this, struct jffs2_tmp_dnode_info, rb); - jffs2_free_full_dnode(tn->fn); - jffs2_free_tmp_dnode_info(tn); - - this = this->rb_parent; - if (!this) - break; - - if (this->rb_left == &tn->rb) - this->rb_left = NULL; - else if (this->rb_right == &tn->rb) - this->rb_right = NULL; - else BUG(); - } - } - list->rb_node = NULL; -} - -static void jffs2_free_full_dirent_list(struct jffs2_full_dirent *fd) -{ - struct jffs2_full_dirent *next; - - while (fd) { - next = fd->next; - jffs2_free_full_dirent(fd); - fd = next; - } -} - -/* Returns first valid node after 'ref'. May return 'ref' */ -static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_ref *ref) -{ - while (ref && ref->next_in_ino) { - if (!ref_obsolete(ref)) - return ref; - JFFS2_DBG_NODEREF("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref)); - ref = ref->next_in_ino; - } - return NULL; -} - -/* - * Helper function for jffs2_get_inode_nodes(). - * It is called every time an directory entry node is found. - * - * Returns: 0 on succes; - * 1 if the node should be marked obsolete; - * negative error code on failure. - */ -static inline int -read_direntry(struct jffs2_sb_info *c, - struct jffs2_raw_node_ref *ref, - struct jffs2_raw_dirent *rd, - uint32_t read, - struct jffs2_full_dirent **fdp, - int32_t *latest_mctime, - uint32_t *mctime_ver) -{ - struct jffs2_full_dirent *fd; - - /* The direntry nodes are checked during the flash scanning */ - BUG_ON(ref_flags(ref) == REF_UNCHECKED); - /* Obsoleted. This cannot happen, surely? dwmw2 20020308 */ - BUG_ON(ref_obsolete(ref)); - - /* Sanity check */ - if (unlikely(PAD((rd->nsize + sizeof(*rd))) != PAD(je32_to_cpu(rd->totlen)))) { - JFFS2_ERROR("illegal nsize in node at %#08x: nsize %#02x, totlen %#04x\n", - ref_offset(ref), rd->nsize, je32_to_cpu(rd->totlen)); - return 1; - } - - fd = jffs2_alloc_full_dirent(rd->nsize + 1); - if (unlikely(!fd)) - return -ENOMEM; - - fd->raw = ref; - fd->version = je32_to_cpu(rd->version); - fd->ino = je32_to_cpu(rd->ino); - fd->type = rd->type; - - /* Pick out the mctime of the latest dirent */ - if(fd->version > *mctime_ver) { - *mctime_ver = fd->version; - *latest_mctime = je32_to_cpu(rd->mctime); - } - - /* - * Copy as much of the name as possible from the raw - * dirent we've already read from the flash. - */ - if (read > sizeof(*rd)) - memcpy(&fd->name[0], &rd->name[0], - min_t(uint32_t, rd->nsize, (read - sizeof(*rd)) )); - - /* Do we need to copy any more of the name directly from the flash? */ - if (rd->nsize + sizeof(*rd) > read) { - /* FIXME: point() */ - int err; - int already = read - sizeof(*rd); - - err = jffs2_flash_read(c, (ref_offset(ref)) + read, - rd->nsize - already, (size_t*)&read, &fd->name[already]); - if (unlikely(read != rd->nsize - already) && likely(!err)) - return -EIO; - - if (unlikely(err)) { - JFFS2_ERROR("read remainder of name: error %d\n", err); - jffs2_free_full_dirent(fd); - return -EIO; - } - } - - fd->nhash = full_name_hash(fd->name, rd->nsize); - fd->next = NULL; - fd->name[rd->nsize] = '\0'; - - /* - * Wheee. We now have a complete jffs2_full_dirent structure, with - * the name in it and everything. Link it into the list - */ - jffs2_add_fd_to_list(c, fd, fdp); - - return 0; -} - -/* - * Helper function for jffs2_get_inode_nodes(). - * It is called every time an inode node is found. - * - * Returns: 0 on succes; - * 1 if the node should be marked obsolete; - * negative error code on failure. - */ -static inline int -read_dnode(struct jffs2_sb_info *c, - struct jffs2_raw_node_ref *ref, - struct jffs2_raw_inode *rd, - uint32_t read, - struct rb_root *tnp, - int32_t *latest_mctime, - uint32_t *mctime_ver) -{ - struct jffs2_eraseblock *jeb; - struct jffs2_tmp_dnode_info *tn; - - /* Obsoleted. This cannot happen, surely? dwmw2 20020308 */ - BUG_ON(ref_obsolete(ref)); - - /* If we've never checked the CRCs on this node, check them now */ - if (ref_flags(ref) == REF_UNCHECKED) { - uint32_t crc, len; - - crc = crc32(0, rd, sizeof(*rd) - 8); - if (unlikely(crc != je32_to_cpu(rd->node_crc))) { - JFFS2_NOTICE("header CRC failed on node at %#08x: read %#08x, calculated %#08x\n", - ref_offset(ref), je32_to_cpu(rd->node_crc), crc); - return 1; - } - - /* Sanity checks */ - if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) || - unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) { - JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref)); - jffs2_dbg_dump_node(c, ref_offset(ref)); - return 1; - } - - if (rd->compr != JFFS2_COMPR_ZERO && je32_to_cpu(rd->csize)) { - unsigned char *buf = NULL; - uint32_t pointed = 0; - int err; -#ifndef __ECOS - if (c->mtd->point) { - err = c->mtd->point (c->mtd, ref_offset(ref) + sizeof(*rd), je32_to_cpu(rd->csize), - &read, &buf); - if (unlikely(read < je32_to_cpu(rd->csize)) && likely(!err)) { - JFFS2_ERROR("MTD point returned len too short: 0x%zx\n", read); - c->mtd->unpoint(c->mtd, buf, ref_offset(ref) + sizeof(*rd), - je32_to_cpu(rd->csize)); - } else if (unlikely(err)){ - JFFS2_ERROR("MTD point failed %d\n", err); - } else - pointed = 1; /* succefully pointed to device */ - } -#endif - if(!pointed){ - buf = kmalloc(je32_to_cpu(rd->csize), GFP_KERNEL); - if (!buf) - return -ENOMEM; - - err = jffs2_flash_read(c, ref_offset(ref) + sizeof(*rd), je32_to_cpu(rd->csize), - (size_t*)&read, buf); - if (unlikely(read != je32_to_cpu(rd->csize)) && likely(!err)) - err = -EIO; - if (err) { - kfree(buf); - return err; - } - } - crc = crc32(0, buf, je32_to_cpu(rd->csize)); - if(!pointed) - kfree(buf); -#ifndef __ECOS - else - c->mtd->unpoint(c->mtd, buf, ref_offset(ref) + sizeof(*rd), je32_to_cpu(rd->csize)); -#endif - - if (crc != je32_to_cpu(rd->data_crc)) { - JFFS2_NOTICE("data CRC failed on node at %#08x: read %#08x, calculated %#08x\n", - ref_offset(ref), je32_to_cpu(rd->data_crc), crc); - return 1; - } - - } - - /* Mark the node as having been checked and fix the accounting accordingly */ - jeb = &c->blocks[ref->flash_offset / c->sector_size]; - len = ref_totlen(c, jeb, ref); - - spin_lock(&c->erase_completion_lock); - jeb->used_size += len; - jeb->unchecked_size -= len; - c->used_size += len; - c->unchecked_size -= len; - - /* If node covers at least a whole page, or if it starts at the - beginning of a page and runs to the end of the file, or if - it's a hole node, mark it REF_PRISTINE, else REF_NORMAL. - - If it's actually overlapped, it'll get made NORMAL (or OBSOLETE) - when the overlapping node(s) get added to the tree anyway. - */ - if ((je32_to_cpu(rd->dsize) >= PAGE_CACHE_SIZE) || - ( ((je32_to_cpu(rd->offset) & (PAGE_CACHE_SIZE-1))==0) && - (je32_to_cpu(rd->dsize) + je32_to_cpu(rd->offset) == je32_to_cpu(rd->isize)))) { - JFFS2_DBG_READINODE("marking node at %#08x REF_PRISTINE\n", ref_offset(ref)); - ref->flash_offset = ref_offset(ref) | REF_PRISTINE; - } else { - JFFS2_DBG_READINODE("marking node at %#08x REF_NORMAL\n", ref_offset(ref)); - ref->flash_offset = ref_offset(ref) | REF_NORMAL; - } - spin_unlock(&c->erase_completion_lock); - } - - tn = jffs2_alloc_tmp_dnode_info(); - if (!tn) { - JFFS2_ERROR("alloc tn failed\n"); - return -ENOMEM; - } - - tn->fn = jffs2_alloc_full_dnode(); - if (!tn->fn) { - JFFS2_ERROR("alloc fn failed\n"); - jffs2_free_tmp_dnode_info(tn); - return -ENOMEM; - } - - tn->version = je32_to_cpu(rd->version); - tn->fn->ofs = je32_to_cpu(rd->offset); - tn->fn->raw = ref; - - /* There was a bug where we wrote hole nodes out with - csize/dsize swapped. Deal with it */ - if (rd->compr == JFFS2_COMPR_ZERO && !je32_to_cpu(rd->dsize) && je32_to_cpu(rd->csize)) - tn->fn->size = je32_to_cpu(rd->csize); - else // normal case... - tn->fn->size = je32_to_cpu(rd->dsize); - - JFFS2_DBG_READINODE("dnode @%08x: ver %u, offset %#04x, dsize %#04x\n", - ref_offset(ref), je32_to_cpu(rd->version), je32_to_cpu(rd->offset), je32_to_cpu(rd->dsize)); - - jffs2_add_tn_to_tree(tn, tnp); - - return 0; -} - -/* - * Helper function for jffs2_get_inode_nodes(). - * It is called every time an unknown node is found. - * - * Returns: 0 on succes; - * 1 if the node should be marked obsolete; - * negative error code on failure. - */ -static inline int -read_unknown(struct jffs2_sb_info *c, - struct jffs2_raw_node_ref *ref, - struct jffs2_unknown_node *un, - uint32_t read) -{ - /* We don't mark unknown nodes as REF_UNCHECKED */ - BUG_ON(ref_flags(ref) == REF_UNCHECKED); - - un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype)); - - if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) { - /* Hmmm. This should have been caught at scan time. */ - JFFS2_NOTICE("node header CRC failed at %#08x. But it must have been OK earlier.\n", ref_offset(ref)); - jffs2_dbg_dump_node(c, ref_offset(ref)); - return 1; - } else { - switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) { - - case JFFS2_FEATURE_INCOMPAT: - JFFS2_ERROR("unknown INCOMPAT nodetype %#04X at %#08x\n", - je16_to_cpu(un->nodetype), ref_offset(ref)); - /* EEP */ - BUG(); - break; - - case JFFS2_FEATURE_ROCOMPAT: - JFFS2_ERROR("unknown ROCOMPAT nodetype %#04X at %#08x\n", - je16_to_cpu(un->nodetype), ref_offset(ref)); - BUG_ON(!(c->flags & JFFS2_SB_FLAG_RO)); - break; - - case JFFS2_FEATURE_RWCOMPAT_COPY: - JFFS2_NOTICE("unknown RWCOMPAT_COPY nodetype %#04X at %#08x\n", - je16_to_cpu(un->nodetype), ref_offset(ref)); - break; - - case JFFS2_FEATURE_RWCOMPAT_DELETE: - JFFS2_NOTICE("unknown RWCOMPAT_DELETE nodetype %#04X at %#08x\n", - je16_to_cpu(un->nodetype), ref_offset(ref)); - return 1; - } - } - - return 0; -} - -/* Get tmp_dnode_info and full_dirent for all non-obsolete nodes associated - with this ino, returning the former in order of version */ - -static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - struct rb_root *tnp, struct jffs2_full_dirent **fdp, - uint32_t *highest_version, uint32_t *latest_mctime, - uint32_t *mctime_ver) -{ - struct jffs2_raw_node_ref *ref, *valid_ref; - struct rb_root ret_tn = RB_ROOT; - struct jffs2_full_dirent *ret_fd = NULL; - union jffs2_node_union node; - size_t retlen; - int err; - - *mctime_ver = 0; - - JFFS2_DBG_READINODE("ino #%u\n", f->inocache->ino); - - spin_lock(&c->erase_completion_lock); - - valid_ref = jffs2_first_valid_node(f->inocache->nodes); - - if (!valid_ref && (f->inocache->ino != 1)) - JFFS2_WARNING("no valid nodes for ino #%u\n", f->inocache->ino); - - while (valid_ref) { - /* We can hold a pointer to a non-obsolete node without the spinlock, - but _obsolete_ nodes may disappear at any time, if the block - they're in gets erased. So if we mark 'ref' obsolete while we're - not holding the lock, it can go away immediately. For that reason, - we find the next valid node first, before processing 'ref'. - */ - ref = valid_ref; - valid_ref = jffs2_first_valid_node(ref->next_in_ino); - spin_unlock(&c->erase_completion_lock); - - cond_resched(); - - /* FIXME: point() */ - err = jffs2_flash_read(c, (ref_offset(ref)), - min_t(uint32_t, ref_totlen(c, NULL, ref), sizeof(node)), - &retlen, (void *)&node); - if (err) { - JFFS2_ERROR("error %d reading node at 0x%08x in get_inode_nodes()\n", err, ref_offset(ref)); - goto free_out; - } - - switch (je16_to_cpu(node.u.nodetype)) { - - case JFFS2_NODETYPE_DIRENT: - JFFS2_DBG_READINODE("node at %08x (%d) is a dirent node\n", ref_offset(ref), ref_flags(ref)); - - if (retlen < sizeof(node.d)) { - JFFS2_ERROR("short read dirent at %#08x\n", ref_offset(ref)); - err = -EIO; - goto free_out; - } - - err = read_direntry(c, ref, &node.d, retlen, &ret_fd, (int32_t *)latest_mctime, mctime_ver); - if (err == 1) { - jffs2_mark_node_obsolete(c, ref); - break; - } else if (unlikely(err)) - goto free_out; - - if (je32_to_cpu(node.d.version) > *highest_version) - *highest_version = je32_to_cpu(node.d.version); - - break; - - case JFFS2_NODETYPE_INODE: - JFFS2_DBG_READINODE("node at %08x (%d) is a data node\n", ref_offset(ref), ref_flags(ref)); - - if (retlen < sizeof(node.i)) { - JFFS2_ERROR("short read dnode at %#08x\n", ref_offset(ref)); - err = -EIO; - goto free_out; - } - - err = read_dnode(c, ref, &node.i, retlen, &ret_tn, (int32_t *)latest_mctime, mctime_ver); - if (err == 1) { - jffs2_mark_node_obsolete(c, ref); - break; - } else if (unlikely(err)) - goto free_out; - - if (je32_to_cpu(node.i.version) > *highest_version) - *highest_version = je32_to_cpu(node.i.version); - - JFFS2_DBG_READINODE("version %d, highest_version now %d\n", - je32_to_cpu(node.i.version), *highest_version); - - break; - - default: - /* Check we've managed to read at least the common node header */ - if (retlen < sizeof(struct jffs2_unknown_node)) { - JFFS2_ERROR("short read unknown node at %#08x\n", ref_offset(ref)); - return -EIO; - } - - err = read_unknown(c, ref, &node.u, retlen); - if (err == 1) { - jffs2_mark_node_obsolete(c, ref); - break; - } else if (unlikely(err)) - goto free_out; - - } - spin_lock(&c->erase_completion_lock); - - } - spin_unlock(&c->erase_completion_lock); - *tnp = ret_tn; - *fdp = ret_fd; - - return 0; - - free_out: - jffs2_free_tmp_dnode_info_list(&ret_tn); - jffs2_free_full_dirent_list(ret_fd); - return err; -} - -static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, - struct jffs2_inode_info *f, - struct jffs2_raw_inode *latest_node) -{ - struct jffs2_tmp_dnode_info *tn = NULL; - struct rb_root tn_list; - struct rb_node *rb, *repl_rb; - struct jffs2_full_dirent *fd_list; - struct jffs2_full_dnode *fn = NULL; - uint32_t crc; - uint32_t latest_mctime, mctime_ver; - uint32_t mdata_ver = 0; - size_t retlen; - int ret; - - JFFS2_DBG_READINODE("ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink); - - /* Grab all nodes relevant to this ino */ - ret = jffs2_get_inode_nodes(c, f, &tn_list, &fd_list, &f->highest_version, &latest_mctime, &mctime_ver); - - if (ret) { - JFFS2_ERROR("cannot read nodes for ino %u, returned error is %d\n", f->inocache->ino, ret); - if (f->inocache->state == INO_STATE_READING) - jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); - return ret; - } - f->dents = fd_list; - - rb = rb_first(&tn_list); - - while (rb) { - tn = rb_entry(rb, struct jffs2_tmp_dnode_info, rb); - fn = tn->fn; - - if (f->metadata) { - if (likely(tn->version >= mdata_ver)) { - JFFS2_DBG_READINODE("obsoleting old metadata at 0x%08x\n", ref_offset(f->metadata->raw)); - jffs2_mark_node_obsolete(c, f->metadata->raw); - jffs2_free_full_dnode(f->metadata); - f->metadata = NULL; - - mdata_ver = 0; - } else { - /* This should never happen. */ - JFFS2_ERROR("Er. New metadata at 0x%08x with ver %d is actually older than previous ver %d at 0x%08x\n", - ref_offset(fn->raw), tn->version, mdata_ver, ref_offset(f->metadata->raw)); - jffs2_mark_node_obsolete(c, fn->raw); - jffs2_free_full_dnode(fn); - /* Fill in latest_node from the metadata, not this one we're about to free... */ - fn = f->metadata; - goto next_tn; - } - } - - if (fn->size) { - jffs2_add_full_dnode_to_inode(c, f, fn); - } else { - /* Zero-sized node at end of version list. Just a metadata update */ - JFFS2_DBG_READINODE("metadata @%08x: ver %d\n", ref_offset(fn->raw), tn->version); - f->metadata = fn; - mdata_ver = tn->version; - } - next_tn: - BUG_ON(rb->rb_left); - if (rb->rb_parent && rb->rb_parent->rb_left == rb) { - /* We were then left-hand child of our parent. We need - to move our own right-hand child into our place. */ - repl_rb = rb->rb_right; - if (repl_rb) - repl_rb->rb_parent = rb->rb_parent; - } else - repl_rb = NULL; - - rb = rb_next(rb); - - /* Remove the spent tn from the tree; don't bother rebalancing - but put our right-hand child in our own place. */ - if (tn->rb.rb_parent) { - if (tn->rb.rb_parent->rb_left == &tn->rb) - tn->rb.rb_parent->rb_left = repl_rb; - else if (tn->rb.rb_parent->rb_right == &tn->rb) - tn->rb.rb_parent->rb_right = repl_rb; - else BUG(); - } else if (tn->rb.rb_right) - tn->rb.rb_right->rb_parent = NULL; - - jffs2_free_tmp_dnode_info(tn); - } - jffs2_dbg_fragtree_paranoia_check_nolock(f); - - if (!fn) { - /* No data nodes for this inode. */ - if (f->inocache->ino != 1) { - JFFS2_WARNING("no data nodes found for ino #%u\n", f->inocache->ino); - if (!fd_list) { - if (f->inocache->state == INO_STATE_READING) - jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); - return -EIO; - } - JFFS2_NOTICE("but it has children so we fake some modes for it\n"); - } - latest_node->mode = cpu_to_jemode(S_IFDIR|S_IRUGO|S_IWUSR|S_IXUGO); - latest_node->version = cpu_to_je32(0); - latest_node->atime = latest_node->ctime = latest_node->mtime = cpu_to_je32(0); - latest_node->isize = cpu_to_je32(0); - latest_node->gid = cpu_to_je16(0); - latest_node->uid = cpu_to_je16(0); - if (f->inocache->state == INO_STATE_READING) - jffs2_set_inocache_state(c, f->inocache, INO_STATE_PRESENT); - return 0; - } - - ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(*latest_node), &retlen, (void *)latest_node); - if (ret || retlen != sizeof(*latest_node)) { - JFFS2_ERROR("failed to read from flash: error %d, %zd of %zd bytes read\n", - ret, retlen, sizeof(*latest_node)); - /* FIXME: If this fails, there seems to be a memory leak. Find it. */ - up(&f->sem); - jffs2_do_clear_inode(c, f); - return ret?ret:-EIO; - } - - crc = crc32(0, latest_node, sizeof(*latest_node)-8); - if (crc != je32_to_cpu(latest_node->node_crc)) { - JFFS2_ERROR("CRC failed for read_inode of inode %u at physical location 0x%x\n", - f->inocache->ino, ref_offset(fn->raw)); - up(&f->sem); - jffs2_do_clear_inode(c, f); - return -EIO; - } - - switch(jemode_to_cpu(latest_node->mode) & S_IFMT) { - case S_IFDIR: - if (mctime_ver > je32_to_cpu(latest_node->version)) { - /* The times in the latest_node are actually older than - mctime in the latest dirent. Cheat. */ - latest_node->ctime = latest_node->mtime = cpu_to_je32(latest_mctime); - } - break; - - - case S_IFREG: - /* If it was a regular file, truncate it to the latest node's isize */ - jffs2_truncate_fragtree(c, &f->fragtree, je32_to_cpu(latest_node->isize)); - break; - -// case S_IFLNK: prife -// /* Hack to work around broken isize in old symlink code. -// Remove this when dwmw2 comes to his senses and stops -// symlinks from being an entirely gratuitous special -// case. */ -// if (!je32_to_cpu(latest_node->isize)) -// latest_node->isize = latest_node->dsize; -// -// if (f->inocache->state != INO_STATE_CHECKING) { -// /* Symlink's inode data is the target path. Read it and -// * keep in RAM to facilitate quick follow symlink -// * operation. */ -// f->target = kmalloc(je32_to_cpu(latest_node->csize) + 1, GFP_KERNEL); -// if (!f->target) { -// JFFS2_ERROR("can't allocate %d bytes of memory for the symlink target path cache\n", je32_to_cpu(latest_node->csize)); -// up(&f->sem); -// jffs2_do_clear_inode(c, f); -// return -ENOMEM; -// } -// -// ret = jffs2_flash_read(c, ref_offset(fn->raw) + sizeof(*latest_node), -// je32_to_cpu(latest_node->csize), &retlen, (char *)f->target); -// -// if (ret || retlen != je32_to_cpu(latest_node->csize)) { -// if (retlen != je32_to_cpu(latest_node->csize)) -// ret = -EIO; -// kfree(f->target); -// f->target = NULL; -// up(&f->sem); -// jffs2_do_clear_inode(c, f); -// return -ret; -// } -// -// f->target[je32_to_cpu(latest_node->csize)] = '\0'; -// JFFS2_DBG_READINODE("symlink's target '%s' cached\n", f->target); -// } -// -// /* fall through... */ - - case S_IFBLK: - case S_IFCHR: - /* Certain inode types should have only one data node, and it's - kept as the metadata node */ - if (f->metadata) { - JFFS2_ERROR("Argh. Special inode #%u with mode 0%o had metadata node\n", - f->inocache->ino, jemode_to_cpu(latest_node->mode)); - up(&f->sem); - jffs2_do_clear_inode(c, f); - return -EIO; - } - if (!frag_first(&f->fragtree)) { - JFFS2_ERROR("Argh. Special inode #%u with mode 0%o has no fragments\n", - f->inocache->ino, jemode_to_cpu(latest_node->mode)); - up(&f->sem); - jffs2_do_clear_inode(c, f); - return -EIO; - } - /* ASSERT: f->fraglist != NULL */ - if (frag_next(frag_first(&f->fragtree))) { - JFFS2_ERROR("Argh. Special inode #%u with mode 0x%x had more than one node\n", - f->inocache->ino, jemode_to_cpu(latest_node->mode)); - /* FIXME: Deal with it - check crc32, check for duplicate node, check times and discard the older one */ - up(&f->sem); - jffs2_do_clear_inode(c, f); - return -EIO; - } - /* OK. We're happy */ - f->metadata = frag_first(&f->fragtree)->node; - jffs2_free_node_frag(frag_first(&f->fragtree)); - f->fragtree.rb_node = NULL;//f->fragtree = RB_ROOT; // modify it for vs - break; - } - if (f->inocache->state == INO_STATE_READING) - jffs2_set_inocache_state(c, f->inocache, INO_STATE_PRESENT); - - return 0; -} - -/* Scan the list of all nodes present for this ino, build map of versions, etc. */ -int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - uint32_t ino, struct jffs2_raw_inode *latest_node) -{ - JFFS2_DBG_READINODE("read inode #%u\n", ino); - - retry_inocache: - spin_lock(&c->inocache_lock); - f->inocache = jffs2_get_ino_cache(c, ino); - - if (f->inocache) { - /* Check its state. We may need to wait before we can use it */ - switch(f->inocache->state) { - case INO_STATE_UNCHECKED: - case INO_STATE_CHECKEDABSENT: - f->inocache->state = INO_STATE_READING; - break; - - case INO_STATE_CHECKING: - case INO_STATE_GC: - /* If it's in either of these states, we need - to wait for whoever's got it to finish and - put it back. */ - JFFS2_DBG_READINODE("waiting for ino #%u in state %d\n", ino, f->inocache->state); - sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); - goto retry_inocache; - - case INO_STATE_READING: - case INO_STATE_PRESENT: - /* Eep. This should never happen. It can - happen if Linux calls read_inode() again - before clear_inode() has finished though. */ - JFFS2_ERROR("Eep. Trying to read_inode #%u when it's already in state %d!\n", ino, f->inocache->state); - /* Fail. That's probably better than allowing it to succeed */ - f->inocache = NULL; - break; - - default: - BUG(); - } - } - spin_unlock(&c->inocache_lock); - - if (!f->inocache && ino == 1) { - /* Special case - no root inode on medium */ - f->inocache = jffs2_alloc_inode_cache(); - if (!f->inocache) { - JFFS2_ERROR("cannot allocate inocache for root inode\n"); - return -ENOMEM; - } - JFFS2_DBG_READINODE("creating inocache for root inode\n"); - memset(f->inocache, 0, sizeof(struct jffs2_inode_cache)); - f->inocache->ino = f->inocache->nlink = 1; - f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; - f->inocache->state = INO_STATE_READING; - jffs2_add_ino_cache(c, f->inocache); - } - if (!f->inocache) { - JFFS2_ERROR("requestied to read an nonexistent ino %u\n", ino); - return -ENOENT; - } - - return jffs2_do_read_inode_internal(c, f, latest_node); -} - -int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) -{ - struct jffs2_raw_inode n; - struct jffs2_inode_info *f = kmalloc(sizeof(*f), GFP_KERNEL); - int ret; - - if (!f) - return -ENOMEM; - - memset(f, 0, sizeof(*f)); - init_MUTEX_LOCKED(&f->sem); - f->inocache = ic; - - ret = jffs2_do_read_inode_internal(c, f, &n); - if (!ret) { - up(&f->sem); - jffs2_do_clear_inode(c, f); - } - kfree (f); - return ret; -} - -void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f) -{ - struct jffs2_full_dirent *fd, *fds; - int deleted; - - down(&f->sem); - deleted = f->inocache && !f->inocache->nlink; - - if (f->inocache && f->inocache->state != INO_STATE_CHECKING) - jffs2_set_inocache_state(c, f->inocache, INO_STATE_CLEARING); - - if (f->metadata) { - if (deleted) - jffs2_mark_node_obsolete(c, f->metadata->raw); - jffs2_free_full_dnode(f->metadata); - } - - jffs2_kill_fragtree(&f->fragtree, deleted?c:NULL); - - if (f->target) { - kfree(f->target); - f->target = NULL; - } - - fds = f->dents; - while(fds) { - fd = fds; - fds = fd->next; - jffs2_free_full_dirent(fd); - } - - if (f->inocache && f->inocache->state != INO_STATE_CHECKING) { - jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); - if (f->inocache->nodes == (void *)f->inocache) - jffs2_del_ino_cache(c, f->inocache); - } - - up(&f->sem); -} diff --git a/components/dfs/filesystems/jffs2/src/scan.c b/components/dfs/filesystems/jffs2/src/scan.c deleted file mode 100644 index f67d122a12..0000000000 --- a/components/dfs/filesystems/jffs2/src/scan.c +++ /dev/null @@ -1,946 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: scan.c,v 1.121 2005/07/20 15:32:28 dedekind Exp $ - * - */ -#include -#include -#include -#include -#include -#include -#include -#include "nodelist.h" - -#define DEFAULT_EMPTY_SCAN_SIZE 1024 - -#if defined (__GNUC__) -#elif defined (MSVC) -#define typeof(x) uint32_t -#else -#endif - -#define DIRTY_SPACE(x) do { typeof(x) _x = (x); \ - c->free_size -= _x; c->dirty_size += _x; \ - jeb->free_size -= _x ; jeb->dirty_size += _x; \ - }while(0) -#define USED_SPACE(x) do { typeof(x) _x = (x); \ - c->free_size -= _x; c->used_size += _x; \ - jeb->free_size -= _x ; jeb->used_size += _x; \ - }while(0) -#define UNCHECKED_SPACE(x) do { typeof(x) _x = (x); \ - c->free_size -= _x; c->unchecked_size += _x; \ - jeb->free_size -= _x ; jeb->unchecked_size += _x; \ - }while(0) - -#if defined (__GNUC__) -#define noisy_printk(noise, args...) do { \ - if (*(noise)) { \ - printk(KERN_NOTICE args); \ - (*(noise))--; \ - if (!(*(noise))) { \ - printk(KERN_NOTICE "Further such events for this erase block will not be printed\n"); \ - } \ - } \ -} while(0) -#elif defined (MSVC) -#define noisy_printk(noise, ...) do { \ - if (*(noise)) { \ - printk(KERN_NOTICE ##__VA_ARGS__); \ - (*(noise))--; \ - if (!(*(noise))) { \ - printk(KERN_NOTICE "Further such events for this erase block will not be printed\n"); \ - } \ - } \ -} while(0) -#else -#endif - -static uint32_t pseudo_random; - -static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - unsigned char *buf, uint32_t buf_size); - -/* These helper functions _must_ increase ofs and also do the dirty/used space accounting. - * Returning an error will abort the mount - bad checksums etc. should just mark the space - * as dirty. - */ -static int jffs2_scan_inode_node(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_raw_inode *ri, uint32_t ofs); -static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_raw_dirent *rd, uint32_t ofs); - -#define BLK_STATE_ALLFF 0 -#define BLK_STATE_CLEAN 1 -#define BLK_STATE_PARTDIRTY 2 -#define BLK_STATE_CLEANMARKER 3 -#define BLK_STATE_ALLDIRTY 4 -#define BLK_STATE_BADBLOCK 5 - -static inline int min_free(struct jffs2_sb_info *c) -{ - uint32_t min = 2 * sizeof(struct jffs2_raw_inode); -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER - if (!jffs2_can_mark_obsolete(c) && min < c->wbuf_pagesize) - return c->wbuf_pagesize; -#endif - return min; - -} - -static inline uint32_t EMPTY_SCAN_SIZE(uint32_t sector_size) { - if (sector_size < DEFAULT_EMPTY_SCAN_SIZE) - return sector_size; - else - return DEFAULT_EMPTY_SCAN_SIZE; -} - -int jffs2_scan_medium(struct jffs2_sb_info *c) -{ - int i, ret; - uint32_t empty_blocks = 0, bad_blocks = 0; - unsigned char *flashbuf = NULL; - uint32_t buf_size = 0; -#ifndef __ECOS - size_t pointlen; - - if (c->mtd->point) { - ret = c->mtd->point (c->mtd, 0, c->mtd->size, &pointlen, &flashbuf); - if (!ret && pointlen < c->mtd->size) { - /* Don't muck about if it won't let us point to the whole flash */ - D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", pointlen)); - c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size); - flashbuf = NULL; - } - if (ret) - D1(printk(KERN_DEBUG "MTD point failed %d\n", ret)); - } -#endif - if (!flashbuf) { - /* For NAND it's quicker to read a whole eraseblock at a time, - apparently */ - if (jffs2_cleanmarker_oob(c)) - buf_size = c->sector_size; - else - buf_size = PAGE_SIZE; - - /* Respect kmalloc limitations */ - if (buf_size > 128*1024) - buf_size = 128*1024; - - D1(printk(KERN_DEBUG "Allocating readbuf of %d bytes\n", buf_size)); - flashbuf = kmalloc(buf_size, GFP_KERNEL); - if (!flashbuf) - return -ENOMEM; - } - - for (i=0; inr_blocks; i++) { - struct jffs2_eraseblock *jeb = &c->blocks[i]; - - ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset), buf_size); - - if (ret < 0) - goto out; - - jffs2_dbg_acct_paranoia_check_nolock(c, jeb); - - /* Now decide which list to put it on */ - switch(ret) { - case BLK_STATE_ALLFF: - /* - * Empty block. Since we can't be sure it - * was entirely erased, we just queue it for erase - * again. It will be marked as such when the erase - * is complete. Meanwhile we still count it as empty - * for later checks. - */ - empty_blocks++; - list_add(&jeb->list, &c->erase_pending_list); - c->nr_erasing_blocks++; - break; - - case BLK_STATE_CLEANMARKER: - /* Only a CLEANMARKER node is valid */ - if (!jeb->dirty_size) { - /* It's actually free */ - list_add(&jeb->list, &c->free_list); - c->nr_free_blocks++; - } else { - /* Dirt */ - D1(printk(KERN_DEBUG "Adding all-dirty block at 0x%08x to erase_pending_list\n", jeb->offset)); - list_add(&jeb->list, &c->erase_pending_list); - c->nr_erasing_blocks++; - } - break; - - case BLK_STATE_CLEAN: - /* Full (or almost full) of clean data. Clean list */ - list_add(&jeb->list, &c->clean_list); - break; - - case BLK_STATE_PARTDIRTY: - /* Some data, but not full. Dirty list. */ - /* We want to remember the block with most free space - and stick it in the 'nextblock' position to start writing to it. */ - if (jeb->free_size > min_free(c) && - (!c->nextblock || c->nextblock->free_size < jeb->free_size)) { - /* Better candidate for the next writes to go to */ - if (c->nextblock) { - c->nextblock->dirty_size += c->nextblock->free_size + c->nextblock->wasted_size; - c->dirty_size += c->nextblock->free_size + c->nextblock->wasted_size; - c->free_size -= c->nextblock->free_size; - c->wasted_size -= c->nextblock->wasted_size; - c->nextblock->free_size = c->nextblock->wasted_size = 0; - if (VERYDIRTY(c, c->nextblock->dirty_size)) { - list_add(&c->nextblock->list, &c->very_dirty_list); - } else { - list_add(&c->nextblock->list, &c->dirty_list); - } - } - c->nextblock = jeb; - } else { - jeb->dirty_size += jeb->free_size + jeb->wasted_size; - c->dirty_size += jeb->free_size + jeb->wasted_size; - c->free_size -= jeb->free_size; - c->wasted_size -= jeb->wasted_size; - jeb->free_size = jeb->wasted_size = 0; - if (VERYDIRTY(c, jeb->dirty_size)) { - list_add(&jeb->list, &c->very_dirty_list); - } else { - list_add(&jeb->list, &c->dirty_list); - } - } - break; - - case BLK_STATE_ALLDIRTY: - /* Nothing valid - not even a clean marker. Needs erasing. */ - /* For now we just put it on the erasing list. We'll start the erases later */ - D1(printk(KERN_NOTICE "JFFS2: Erase block at 0x%08x is not formatted. It will be erased\n", jeb->offset)); - list_add(&jeb->list, &c->erase_pending_list); - c->nr_erasing_blocks++; - break; - - case BLK_STATE_BADBLOCK: - D1(printk(KERN_NOTICE "JFFS2: Block at 0x%08x is bad\n", jeb->offset)); - list_add(&jeb->list, &c->bad_list); - c->bad_size += c->sector_size; - c->free_size -= c->sector_size; - bad_blocks++; - break; - default: - printk(KERN_WARNING "jffs2_scan_medium(): unknown block state\n"); - BUG(); - } - } - - /* Nextblock dirty is always seen as wasted, because we cannot recycle it now */ - if (c->nextblock && (c->nextblock->dirty_size)) { - c->nextblock->wasted_size += c->nextblock->dirty_size; - c->wasted_size += c->nextblock->dirty_size; - c->dirty_size -= c->nextblock->dirty_size; - c->nextblock->dirty_size = 0; - } -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER - if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) { - /* If we're going to start writing into a block which already - contains data, and the end of the data isn't page-aligned, - skip a little and align it. */ - - uint32_t skip = c->nextblock->free_size & (c->wbuf_pagesize-1); - - D1(printk(KERN_DEBUG "jffs2_scan_medium(): Skipping %d bytes in nextblock to ensure page alignment\n", - skip)); - c->nextblock->wasted_size += skip; - c->wasted_size += skip; - - c->nextblock->free_size -= skip; - c->free_size -= skip; - } -#endif - if (c->nr_erasing_blocks) { - if ( !c->used_size && ((c->nr_free_blocks+empty_blocks+bad_blocks)!= c->nr_blocks || bad_blocks == c->nr_blocks) ) { - printk(KERN_NOTICE "Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes\n"); - printk(KERN_NOTICE "empty_blocks %d, bad_blocks %d, c->nr_blocks %d\n",empty_blocks,bad_blocks,c->nr_blocks); - ret = -EIO; - goto out; - } - jffs2_erase_pending_trigger(c); - } - ret = 0; - out: - if (buf_size) - kfree(flashbuf); -#ifndef __ECOS - else - c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size); -#endif - return ret; -} - -static int jffs2_fill_scan_buf (struct jffs2_sb_info *c, unsigned char *buf, - uint32_t ofs, uint32_t len) -{ - int ret; - size_t retlen; - - ret = jffs2_flash_read(c, ofs, len, &retlen, buf); - if (ret) { - D1(printk(KERN_WARNING "mtd->read(0x%x bytes from 0x%x) returned %d\n", len, ofs, ret)); - return ret; - } - if (retlen < len) { - D1(printk(KERN_WARNING "Read at 0x%x gave only 0x%zx bytes\n", ofs, retlen)); - return -EIO; - } - D2(printk(KERN_DEBUG "Read 0x%x bytes from 0x%08x into buf\n", len, ofs)); - D2(printk(KERN_DEBUG "000: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", - buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9], buf[10], buf[11], buf[12], buf[13], buf[14], buf[15])); - return 0; -} - -static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - unsigned char *buf, uint32_t buf_size) { - struct jffs2_unknown_node *node; - struct jffs2_unknown_node crcnode; - uint32_t ofs, prevofs; - uint32_t hdr_crc, buf_ofs, buf_len; - int err; - int noise = 0; -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER - int cleanmarkerfound = 0; -#endif - - ofs = jeb->offset; - prevofs = jeb->offset - 1; - - D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs)); - -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER - if (jffs2_cleanmarker_oob(c)) { - int ret = jffs2_check_nand_cleanmarker(c, jeb); - D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n",ret)); - /* Even if it's not found, we still scan to see - if the block is empty. We use this information - to decide whether to erase it or not. */ - switch (ret) { - case 0: cleanmarkerfound = 1; break; - case 1: break; - case 2: return BLK_STATE_BADBLOCK; - case 3: return BLK_STATE_ALLDIRTY; /* Block has failed to erase min. once */ - default: return ret; - } - } -#endif - buf_ofs = jeb->offset; - - if (!buf_size) { - buf_len = c->sector_size; - } else { - buf_len = EMPTY_SCAN_SIZE(c->sector_size); - err = jffs2_fill_scan_buf(c, buf, buf_ofs, buf_len); - if (err) - return err; - } - - /* We temporarily use 'ofs' as a pointer into the buffer/jeb */ - ofs = 0; - - /* Scan only 4KiB of 0xFF before declaring it's empty */ - while(ofs < EMPTY_SCAN_SIZE(c->sector_size) && *(uint32_t *)(&buf[ofs]) == 0xFFFFFFFF) - ofs += 4; - - if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) { -#ifdef CONFIG_JFFS2_FS_WRITEBUFFER - if (jffs2_cleanmarker_oob(c)) { - /* scan oob, take care of cleanmarker */ - int ret = jffs2_check_oob_empty(c, jeb, cleanmarkerfound); - D2(printk(KERN_NOTICE "jffs2_check_oob_empty returned %d\n",ret)); - switch (ret) { - case 0: return cleanmarkerfound ? BLK_STATE_CLEANMARKER : BLK_STATE_ALLFF; - case 1: return BLK_STATE_ALLDIRTY; - default: return ret; - } - } -#endif - D1(printk(KERN_DEBUG "Block at 0x%08x is empty (erased)\n", jeb->offset)); - if (c->cleanmarker_size == 0) - return BLK_STATE_CLEANMARKER; /* don't bother with re-erase */ - else - return BLK_STATE_ALLFF; /* OK to erase if all blocks are like this */ - } - if (ofs) { - D1(printk(KERN_DEBUG "Free space at %08x ends at %08x\n", jeb->offset, - jeb->offset + ofs)); - DIRTY_SPACE(ofs); - } - - /* Now ofs is a complete physical flash offset as it always was... */ - ofs += jeb->offset; - - noise = 10; - -scan_more: - while(ofs < jeb->offset + c->sector_size) { - - jffs2_dbg_acct_paranoia_check_nolock(c, jeb); - - cond_resched(); - - if (ofs & 3) { - printk(KERN_WARNING "Eep. ofs 0x%08x not word-aligned!\n", ofs); - ofs = PAD(ofs); - continue; - } - if (ofs == prevofs) { - printk(KERN_WARNING "ofs 0x%08x has already been seen. Skipping\n", ofs); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - prevofs = ofs; - - if (jeb->offset + c->sector_size < ofs + sizeof(*node)) { - D1(printk(KERN_DEBUG "Fewer than %zd bytes left to end of block. (%x+%x<%x+%zx) Not reading\n", sizeof(struct jffs2_unknown_node), - jeb->offset, c->sector_size, ofs, sizeof(*node))); - DIRTY_SPACE((jeb->offset + c->sector_size)-ofs); - break; - } - - if (buf_ofs + buf_len < ofs + sizeof(*node)) { - buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); - D1(printk(KERN_DEBUG "Fewer than %zd bytes (node header) left to end of buf. Reading 0x%x at 0x%08x\n", - sizeof(struct jffs2_unknown_node), buf_len, ofs)); - err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); - if (err) - return err; - buf_ofs = ofs; - } - - node = (struct jffs2_unknown_node *)&buf[ofs-buf_ofs]; - - if (*(uint32_t *)(&buf[ofs-buf_ofs]) == 0xffffffff) { - uint32_t inbuf_ofs; - uint32_t empty_start; - - empty_start = ofs; - ofs += 4; - - D1(printk(KERN_DEBUG "Found empty flash at 0x%08x\n", ofs)); - more_empty: - inbuf_ofs = ofs - buf_ofs; - while (inbuf_ofs < buf_len) { - if (*(uint32_t *)(&buf[inbuf_ofs]) != 0xffffffff) { - printk(KERN_WARNING "Empty flash at 0x%08x ends at 0x%08x\n", - empty_start, ofs); - DIRTY_SPACE(ofs-empty_start); - goto scan_more; - } - - inbuf_ofs+=4; - ofs += 4; - } - /* Ran off end. */ - D1(printk(KERN_DEBUG "Empty flash to end of buffer at 0x%08x\n", ofs)); - - /* If we're only checking the beginning of a block with a cleanmarker, - bail now */ - if (buf_ofs == jeb->offset && jeb->used_size == PAD(c->cleanmarker_size) && - c->cleanmarker_size && !jeb->dirty_size && !jeb->first_node->next_phys) { - D1(printk(KERN_DEBUG "%d bytes at start of block seems clean... assuming all clean\n", EMPTY_SCAN_SIZE(c->sector_size))); - return BLK_STATE_CLEANMARKER; - } - - /* See how much more there is to read in this eraseblock... */ - buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); - if (!buf_len) { - /* No more to read. Break out of main loop without marking - this range of empty space as dirty (because it's not) */ - D1(printk(KERN_DEBUG "Empty flash at %08x runs to end of block. Treating as free_space\n", - empty_start)); - break; - } - D1(printk(KERN_DEBUG "Reading another 0x%x at 0x%08x\n", buf_len, ofs)); - err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); - if (err) - return err; - buf_ofs = ofs; - goto more_empty; - } - - if (ofs == jeb->offset && je16_to_cpu(node->magic) == KSAMTIB_CIGAM_2SFFJ) { - printk(KERN_WARNING "Magic bitmask is backwards at offset 0x%08x. Wrong endian filesystem?\n", ofs); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - if (je16_to_cpu(node->magic) == JFFS2_DIRTY_BITMASK) { - D1(printk(KERN_DEBUG "Dirty bitmask at 0x%08x\n", ofs)); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - if (je16_to_cpu(node->magic) == JFFS2_OLD_MAGIC_BITMASK) { - printk(KERN_WARNING "Old JFFS2 bitmask found at 0x%08x\n", ofs); - printk(KERN_WARNING "You cannot use older JFFS2 filesystems with newer kernels\n"); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - if (je16_to_cpu(node->magic) != JFFS2_MAGIC_BITMASK) { - /* OK. We're out of possibilities. Whinge and move on */ - noisy_printk(&noise, "jffs2_scan_eraseblock(): Magic bitmask 0x%04x not found at 0x%08x: 0x%04x instead\n", - JFFS2_MAGIC_BITMASK, ofs, - je16_to_cpu(node->magic)); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - /* We seem to have a node of sorts. Check the CRC */ - crcnode.magic = node->magic; - crcnode.nodetype = cpu_to_je16( je16_to_cpu(node->nodetype) | JFFS2_NODE_ACCURATE); - crcnode.totlen = node->totlen; - hdr_crc = crc32(0, &crcnode, sizeof(crcnode)-4); - - if (hdr_crc != je32_to_cpu(node->hdr_crc)) { - noisy_printk(&noise, "jffs2_scan_eraseblock(): Node at 0x%08x {0x%04x, 0x%04x, 0x%08x) has invalid CRC 0x%08x (calculated 0x%08x)\n", - ofs, je16_to_cpu(node->magic), - je16_to_cpu(node->nodetype), - je32_to_cpu(node->totlen), - je32_to_cpu(node->hdr_crc), - hdr_crc); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - - if (ofs + je32_to_cpu(node->totlen) > - jeb->offset + c->sector_size) { - /* Eep. Node goes over the end of the erase block. */ - printk(KERN_WARNING "Node at 0x%08x with length 0x%08x would run over the end of the erase block\n", - ofs, je32_to_cpu(node->totlen)); - printk(KERN_WARNING "Perhaps the file system was created with the wrong erase size?\n"); - DIRTY_SPACE(4); - ofs += 4; - continue; - } - - if (!(je16_to_cpu(node->nodetype) & JFFS2_NODE_ACCURATE)) { - /* Wheee. This is an obsoleted node */ - D2(printk(KERN_DEBUG "Node at 0x%08x is obsolete. Skipping\n", ofs)); - DIRTY_SPACE(PAD(je32_to_cpu(node->totlen))); - ofs += PAD(je32_to_cpu(node->totlen)); - continue; - } - - switch(je16_to_cpu(node->nodetype)) { - case JFFS2_NODETYPE_INODE: - if (buf_ofs + buf_len < ofs + sizeof(struct jffs2_raw_inode)) { - buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); - D1(printk(KERN_DEBUG "Fewer than %zd bytes (inode node) left to end of buf. Reading 0x%x at 0x%08x\n", - sizeof(struct jffs2_raw_inode), buf_len, ofs)); - err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); - if (err) - return err; - buf_ofs = ofs; - node = (void *)buf; - } - err = jffs2_scan_inode_node(c, jeb, (void *)node, ofs); - if (err) return err; - ofs += PAD(je32_to_cpu(node->totlen)); - break; - - case JFFS2_NODETYPE_DIRENT: - if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) { - buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); - D1(printk(KERN_DEBUG "Fewer than %d bytes (dirent node) left to end of buf. Reading 0x%x at 0x%08x\n", - je32_to_cpu(node->totlen), buf_len, ofs)); - err = jffs2_fill_scan_buf(c, buf, ofs, buf_len); - if (err) - return err; - buf_ofs = ofs; - node = (void *)buf; - } - err = jffs2_scan_dirent_node(c, jeb, (void *)node, ofs); - if (err) return err; - ofs += PAD(je32_to_cpu(node->totlen)); - break; - - case JFFS2_NODETYPE_CLEANMARKER: - D1(printk(KERN_DEBUG "CLEANMARKER node found at 0x%08x\n", ofs)); - if (je32_to_cpu(node->totlen) != c->cleanmarker_size) { - printk(KERN_NOTICE "CLEANMARKER node found at 0x%08x has totlen 0x%x != normal 0x%x\n", - ofs, je32_to_cpu(node->totlen), c->cleanmarker_size); - DIRTY_SPACE(PAD(sizeof(struct jffs2_unknown_node))); - ofs += PAD(sizeof(struct jffs2_unknown_node)); - } else if (jeb->first_node) { - printk(KERN_NOTICE "CLEANMARKER node found at 0x%08x, not first node in block (0x%08x)\n", ofs, jeb->offset); - DIRTY_SPACE(PAD(sizeof(struct jffs2_unknown_node))); - ofs += PAD(sizeof(struct jffs2_unknown_node)); - } else { - struct jffs2_raw_node_ref *marker_ref = jffs2_alloc_raw_node_ref(); - if (!marker_ref) { - printk(KERN_NOTICE "Failed to allocate node ref for clean marker\n"); - return -ENOMEM; - } - marker_ref->next_in_ino = NULL; - marker_ref->next_phys = NULL; - marker_ref->flash_offset = ofs | REF_NORMAL; - marker_ref->__totlen = c->cleanmarker_size; - jeb->first_node = jeb->last_node = marker_ref; - - USED_SPACE(PAD(c->cleanmarker_size)); - ofs += PAD(c->cleanmarker_size); - } - break; - - case JFFS2_NODETYPE_PADDING: - DIRTY_SPACE(PAD(je32_to_cpu(node->totlen))); - ofs += PAD(je32_to_cpu(node->totlen)); - break; - - default: - switch (je16_to_cpu(node->nodetype) & JFFS2_COMPAT_MASK) { - case JFFS2_FEATURE_ROCOMPAT: - printk(KERN_NOTICE "Read-only compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs); - c->flags |= JFFS2_SB_FLAG_RO; - if (!(jffs2_is_readonly(c))) - return -EROFS; - DIRTY_SPACE(PAD(je32_to_cpu(node->totlen))); - ofs += PAD(je32_to_cpu(node->totlen)); - break; - - case JFFS2_FEATURE_INCOMPAT: - printk(KERN_NOTICE "Incompatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs); - return -EINVAL; - - case JFFS2_FEATURE_RWCOMPAT_DELETE: - D1(printk(KERN_NOTICE "Unknown but compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs)); - DIRTY_SPACE(PAD(je32_to_cpu(node->totlen))); - ofs += PAD(je32_to_cpu(node->totlen)); - break; - - case JFFS2_FEATURE_RWCOMPAT_COPY: - D1(printk(KERN_NOTICE "Unknown but compatible feature node (0x%04x) found at offset 0x%08x\n", je16_to_cpu(node->nodetype), ofs)); - USED_SPACE(PAD(je32_to_cpu(node->totlen))); - ofs += PAD(je32_to_cpu(node->totlen)); - break; - } - } - } - - - D1(printk(KERN_DEBUG "Block at 0x%08x: free 0x%08x, dirty 0x%08x, unchecked 0x%08x, used 0x%08x\n", jeb->offset, - jeb->free_size, jeb->dirty_size, jeb->unchecked_size, jeb->used_size)); - - /* mark_node_obsolete can add to wasted !! */ - if (jeb->wasted_size) { - jeb->dirty_size += jeb->wasted_size; - c->dirty_size += jeb->wasted_size; - c->wasted_size -= jeb->wasted_size; - jeb->wasted_size = 0; - } - - if ((jeb->used_size + jeb->unchecked_size) == PAD(c->cleanmarker_size) && !jeb->dirty_size - && (!jeb->first_node || !jeb->first_node->next_phys) ) - return BLK_STATE_CLEANMARKER; - - /* move blocks with max 4 byte dirty space to cleanlist */ - else if (!ISDIRTY(c->sector_size - (jeb->used_size + jeb->unchecked_size))) { - c->dirty_size -= jeb->dirty_size; - c->wasted_size += jeb->dirty_size; - jeb->wasted_size += jeb->dirty_size; - jeb->dirty_size = 0; - return BLK_STATE_CLEAN; - } else if (jeb->used_size || jeb->unchecked_size) - return BLK_STATE_PARTDIRTY; - else - return BLK_STATE_ALLDIRTY; -} - -static struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino) -{ - struct jffs2_inode_cache *ic; - - ic = jffs2_get_ino_cache(c, ino); - if (ic) - return ic; - - if (ino > c->highest_ino) - c->highest_ino = ino; - - ic = jffs2_alloc_inode_cache(); - if (!ic) { - printk(KERN_NOTICE "jffs2_scan_make_inode_cache(): allocation of inode cache failed\n"); - return NULL; - } - memset(ic, 0, sizeof(*ic)); - - ic->ino = ino; - ic->nodes = (void *)ic; - jffs2_add_ino_cache(c, ic); - if (ino == 1) - ic->nlink = 1; - return ic; -} - -static int jffs2_scan_inode_node(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_raw_inode *ri, uint32_t ofs) -{ - struct jffs2_raw_node_ref *raw; - struct jffs2_inode_cache *ic; - uint32_t ino = je32_to_cpu(ri->ino); - - D1(printk(KERN_DEBUG "jffs2_scan_inode_node(): Node at 0x%08x\n", ofs)); - - /* We do very little here now. Just check the ino# to which we should attribute - this node; we can do all the CRC checking etc. later. There's a tradeoff here -- - we used to scan the flash once only, reading everything we want from it into - memory, then building all our in-core data structures and freeing the extra - information. Now we allow the first part of the mount to complete a lot quicker, - but we have to go _back_ to the flash in order to finish the CRC checking, etc. - Which means that the _full_ amount of time to get to proper write mode with GC - operational may actually be _longer_ than before. Sucks to be me. */ - - raw = jffs2_alloc_raw_node_ref(); - if (!raw) { - printk(KERN_NOTICE "jffs2_scan_inode_node(): allocation of node reference failed\n"); - return -ENOMEM; - } - - ic = jffs2_get_ino_cache(c, ino); - if (!ic) { - /* Inocache get failed. Either we read a bogus ino# or it's just genuinely the - first node we found for this inode. Do a CRC check to protect against the former - case */ - uint32_t crc = crc32(0, ri, sizeof(*ri)-8); - - if (crc != je32_to_cpu(ri->node_crc)) { - printk(KERN_NOTICE "jffs2_scan_inode_node(): CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ofs, je32_to_cpu(ri->node_crc), crc); - /* We believe totlen because the CRC on the node _header_ was OK, just the node itself failed. */ - DIRTY_SPACE(PAD(je32_to_cpu(ri->totlen))); - jffs2_free_raw_node_ref(raw); - return 0; - } - ic = jffs2_scan_make_ino_cache(c, ino); - if (!ic) { - jffs2_free_raw_node_ref(raw); - return -ENOMEM; - } - } - - /* Wheee. It worked */ - - raw->flash_offset = ofs | REF_UNCHECKED; - raw->__totlen = PAD(je32_to_cpu(ri->totlen)); - raw->next_phys = NULL; - raw->next_in_ino = ic->nodes; - - ic->nodes = raw; - if (!jeb->first_node) - jeb->first_node = raw; - if (jeb->last_node) - jeb->last_node->next_phys = raw; - jeb->last_node = raw; - - D1(printk(KERN_DEBUG "Node is ino #%u, version %d. Range 0x%x-0x%x\n", - je32_to_cpu(ri->ino), je32_to_cpu(ri->version), - je32_to_cpu(ri->offset), - je32_to_cpu(ri->offset)+je32_to_cpu(ri->dsize))); - - pseudo_random += je32_to_cpu(ri->version); - - UNCHECKED_SPACE(PAD(je32_to_cpu(ri->totlen))); - return 0; -} - -static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, - struct jffs2_raw_dirent *rd, uint32_t ofs) -{ - struct jffs2_raw_node_ref *raw; - struct jffs2_full_dirent *fd; - struct jffs2_inode_cache *ic; - uint32_t crc; - - D1(printk(KERN_DEBUG "jffs2_scan_dirent_node(): Node at 0x%08x\n", ofs)); - - /* We don't get here unless the node is still valid, so we don't have to - mask in the ACCURATE bit any more. */ - crc = crc32(0, rd, sizeof(*rd)-8); - - if (crc != je32_to_cpu(rd->node_crc)) { - printk(KERN_NOTICE "jffs2_scan_dirent_node(): Node CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ofs, je32_to_cpu(rd->node_crc), crc); - /* We believe totlen because the CRC on the node _header_ was OK, just the node itself failed. */ - DIRTY_SPACE(PAD(je32_to_cpu(rd->totlen))); - return 0; - } - - pseudo_random += je32_to_cpu(rd->version); - - fd = jffs2_alloc_full_dirent(rd->nsize+1); - if (!fd) { - return -ENOMEM; - } - memcpy(&fd->name, rd->name, rd->nsize); - fd->name[rd->nsize] = 0; - - crc = crc32(0, fd->name, rd->nsize); - if (crc != je32_to_cpu(rd->name_crc)) { - printk(KERN_NOTICE "jffs2_scan_dirent_node(): Name CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - ofs, je32_to_cpu(rd->name_crc), crc); - D1(printk(KERN_NOTICE "Name for which CRC failed is (now) '%s', ino #%d\n", fd->name, je32_to_cpu(rd->ino))); - jffs2_free_full_dirent(fd); - /* FIXME: Why do we believe totlen? */ - /* We believe totlen because the CRC on the node _header_ was OK, just the name failed. */ - DIRTY_SPACE(PAD(je32_to_cpu(rd->totlen))); - return 0; - } - raw = jffs2_alloc_raw_node_ref(); - if (!raw) { - jffs2_free_full_dirent(fd); - printk(KERN_NOTICE "jffs2_scan_dirent_node(): allocation of node reference failed\n"); - return -ENOMEM; - } - ic = jffs2_scan_make_ino_cache(c, je32_to_cpu(rd->pino)); - if (!ic) { - jffs2_free_full_dirent(fd); - jffs2_free_raw_node_ref(raw); - return -ENOMEM; - } - - raw->__totlen = PAD(je32_to_cpu(rd->totlen)); - raw->flash_offset = ofs | REF_PRISTINE; - raw->next_phys = NULL; - raw->next_in_ino = ic->nodes; - ic->nodes = raw; - if (!jeb->first_node) - jeb->first_node = raw; - if (jeb->last_node) - jeb->last_node->next_phys = raw; - jeb->last_node = raw; - - fd->raw = raw; - fd->next = NULL; - fd->version = je32_to_cpu(rd->version); - fd->ino = je32_to_cpu(rd->ino); - fd->nhash = full_name_hash(fd->name, rd->nsize); - fd->type = rd->type; - USED_SPACE(PAD(je32_to_cpu(rd->totlen))); - jffs2_add_fd_to_list(c, fd, &ic->scan_dents); - - return 0; -} - -static int count_list(struct list_head *l) -{ - uint32_t count = 0; - struct list_head *tmp; - - list_for_each(tmp, l) { - count++; - } - return count; -} - -/* Note: This breaks if list_empty(head). I don't care. You - might, if you copy this code and use it elsewhere :) */ -static void rotate_list(struct list_head *head, uint32_t count) -{ - struct list_head *n = head->next; - - list_del(head); - while(count--) { - n = n->next; - } - list_add(head, n); -} - -void jffs2_rotate_lists(struct jffs2_sb_info *c) -{ - uint32_t x; - uint32_t rotateby; - - x = count_list(&c->clean_list); - if (x) { - rotateby = pseudo_random % x; - D1(printk(KERN_DEBUG "Rotating clean_list by %d\n", rotateby)); - - rotate_list((&c->clean_list), rotateby); - - D1(printk(KERN_DEBUG "Erase block at front of clean_list is at %08x\n", - list_entry(c->clean_list.next, struct jffs2_eraseblock, list)->offset)); - } else { - D1(printk(KERN_DEBUG "Not rotating empty clean_list\n")); - } - - x = count_list(&c->very_dirty_list); - if (x) { - rotateby = pseudo_random % x; - D1(printk(KERN_DEBUG "Rotating very_dirty_list by %d\n", rotateby)); - - rotate_list((&c->very_dirty_list), rotateby); - - D1(printk(KERN_DEBUG "Erase block at front of very_dirty_list is at %08x\n", - list_entry(c->very_dirty_list.next, struct jffs2_eraseblock, list)->offset)); - } else { - D1(printk(KERN_DEBUG "Not rotating empty very_dirty_list\n")); - } - - x = count_list(&c->dirty_list); - if (x) { - rotateby = pseudo_random % x; - D1(printk(KERN_DEBUG "Rotating dirty_list by %d\n", rotateby)); - - rotate_list((&c->dirty_list), rotateby); - - D1(printk(KERN_DEBUG "Erase block at front of dirty_list is at %08x\n", - list_entry(c->dirty_list.next, struct jffs2_eraseblock, list)->offset)); - } else { - D1(printk(KERN_DEBUG "Not rotating empty dirty_list\n")); - } - - x = count_list(&c->erasable_list); - if (x) { - rotateby = pseudo_random % x; - D1(printk(KERN_DEBUG "Rotating erasable_list by %d\n", rotateby)); - - rotate_list((&c->erasable_list), rotateby); - - D1(printk(KERN_DEBUG "Erase block at front of erasable_list is at %08x\n", - list_entry(c->erasable_list.next, struct jffs2_eraseblock, list)->offset)); - } else { - D1(printk(KERN_DEBUG "Not rotating empty erasable_list\n")); - } - - if (c->nr_erasing_blocks) { - rotateby = pseudo_random % c->nr_erasing_blocks; - D1(printk(KERN_DEBUG "Rotating erase_pending_list by %d\n", rotateby)); - - rotate_list((&c->erase_pending_list), rotateby); - - D1(printk(KERN_DEBUG "Erase block at front of erase_pending_list is at %08x\n", - list_entry(c->erase_pending_list.next, struct jffs2_eraseblock, list)->offset)); - } else { - D1(printk(KERN_DEBUG "Not rotating empty erase_pending_list\n")); - } - - if (c->nr_free_blocks) { - rotateby = pseudo_random % c->nr_free_blocks; - D1(printk(KERN_DEBUG "Rotating free_list by %d\n", rotateby)); - - rotate_list((&c->free_list), rotateby); - - D1(printk(KERN_DEBUG "Erase block at front of free_list is at %08x\n", - list_entry(c->free_list.next, struct jffs2_eraseblock, list)->offset)); - } else { - D1(printk(KERN_DEBUG "Not rotating empty free_list\n")); - } -} diff --git a/components/dfs/filesystems/jffs2/src/write.c b/components/dfs/filesystems/jffs2/src/write.c deleted file mode 100644 index dcfc3a49c1..0000000000 --- a/components/dfs/filesystems/jffs2/src/write.c +++ /dev/null @@ -1,702 +0,0 @@ -/* - * JFFS2 -- Journalling Flash File System, Version 2. - * - * Copyright (C) 2001-2003 Red Hat, Inc. - * - * Created by David Woodhouse - * - * For licensing information, see the file 'LICENCE' in this directory. - * - * $Id: write.c,v 1.94 2005/07/20 15:50:51 dedekind Exp $ - * - */ - -#include -#include -#include -#include -#include -#include -#include "nodelist.h" -#include "compr.h" - - -int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri) -{ - struct jffs2_inode_cache *ic; - - ic = jffs2_alloc_inode_cache(); - if (!ic) { - return -ENOMEM; - } - - memset(ic, 0, sizeof(*ic)); - - f->inocache = ic; - f->inocache->nlink = 1; - f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; - f->inocache->state = INO_STATE_PRESENT; - - - jffs2_add_ino_cache(c, f->inocache); - D1(printk(KERN_DEBUG "jffs2_do_new_inode(): Assigned ino# %d\n", f->inocache->ino)); - ri->ino = cpu_to_je32(f->inocache->ino); - - ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri->totlen = cpu_to_je32(PAD(sizeof(*ri))); - ri->hdr_crc = cpu_to_je32(crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)); - ri->mode = cpu_to_jemode(mode); - - f->highest_version = 1; - ri->version = cpu_to_je32(f->highest_version); - - return 0; -} - -/* jffs2_write_dnode - given a raw_inode, allocate a full_dnode for it, - write it to the flash, link it into the existing inode/fragment list */ - -struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, uint32_t flash_ofs, int alloc_mode) - -{ - struct jffs2_raw_node_ref *raw; - struct jffs2_full_dnode *fn; - size_t retlen; - struct kvec vecs[2]; - int ret; - int retried = 0; - unsigned long cnt = 2; - - D1(if(je32_to_cpu(ri->hdr_crc) != crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)) { - printk(KERN_CRIT "Eep. CRC not correct in jffs2_write_dnode()\n"); - BUG(); - } - ); - vecs[0].iov_base = ri; - vecs[0].iov_len = sizeof(*ri); - vecs[1].iov_base = (unsigned char *)data; - vecs[1].iov_len = datalen; - - jffs2_dbg_prewrite_paranoia_check(c, flash_ofs, vecs[0].iov_len + vecs[1].iov_len); - - if (je32_to_cpu(ri->totlen) != sizeof(*ri) + datalen) { - printk(KERN_WARNING "jffs2_write_dnode: ri->totlen (0x%08x) != sizeof(*ri) (0x%08zx) + datalen (0x%08x)\n", je32_to_cpu(ri->totlen), sizeof(*ri), datalen); - } - raw = jffs2_alloc_raw_node_ref(); - if (!raw) - return ERR_PTR(-ENOMEM); - - fn = jffs2_alloc_full_dnode(); - if (!fn) { - jffs2_free_raw_node_ref(raw); - return ERR_PTR(-ENOMEM); - } - - fn->ofs = je32_to_cpu(ri->offset); - fn->size = je32_to_cpu(ri->dsize); - fn->frags = 0; - - /* check number of valid vecs */ - if (!datalen || !data) - cnt = 1; - retry: - fn->raw = raw; - - raw->flash_offset = flash_ofs; - raw->__totlen = PAD(sizeof(*ri)+datalen); - raw->next_phys = NULL; - - if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(ri->version) < f->highest_version)) { - BUG_ON(!retried); - D1(printk(KERN_DEBUG "jffs2_write_dnode : dnode_version %d, " - "highest version %d -> updating dnode\n", - je32_to_cpu(ri->version), f->highest_version)); - ri->version = cpu_to_je32(++f->highest_version); - ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); - } - - ret = jffs2_flash_writev(c, vecs, cnt, flash_ofs, &retlen, - (alloc_mode==ALLOC_GC)?0:f->inocache->ino); - - if (ret || (retlen != sizeof(*ri) + datalen)) { - printk(KERN_NOTICE "Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n", - sizeof(*ri)+datalen, flash_ofs, ret, retlen); - - /* Mark the space as dirtied */ - if (retlen) { - /* Doesn't belong to any inode */ - raw->next_in_ino = NULL; - - /* Don't change raw->size to match retlen. We may have - written the node header already, and only the data will - seem corrupted, in which case the scan would skip over - any node we write before the original intended end of - this node */ - raw->flash_offset |= REF_OBSOLETE; - jffs2_add_physical_node_ref(c, raw); - jffs2_mark_node_obsolete(c, raw); - } else { - printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", raw->flash_offset); - jffs2_free_raw_node_ref(raw); - } - if (!retried && alloc_mode != ALLOC_NORETRY && (raw = jffs2_alloc_raw_node_ref())) { - /* Try to reallocate space and retry */ - uint32_t dummy; - struct jffs2_eraseblock *jeb = &c->blocks[flash_ofs / c->sector_size]; - - retried = 1; - - D1(printk(KERN_DEBUG "Retrying failed write.\n")); - - jffs2_dbg_acct_sanity_check(c,jeb); - jffs2_dbg_acct_paranoia_check(c, jeb); - - if (alloc_mode == ALLOC_GC) { - ret = jffs2_reserve_space_gc(c, sizeof(*ri) + datalen, &flash_ofs, &dummy); - } else { - /* Locking pain */ - up(&f->sem); - jffs2_complete_reservation(c); - - ret = jffs2_reserve_space(c, sizeof(*ri) + datalen, &flash_ofs, &dummy, alloc_mode); - down(&f->sem); - } - - if (!ret) { - D1(printk(KERN_DEBUG "Allocated space at 0x%08x to retry failed write.\n", flash_ofs)); - - jffs2_dbg_acct_sanity_check(c,jeb); - jffs2_dbg_acct_paranoia_check(c, jeb); - - goto retry; - } - D1(printk(KERN_DEBUG "Failed to allocate space to retry failed write: %d!\n", ret)); - jffs2_free_raw_node_ref(raw); - } - /* Release the full_dnode which is now useless, and return */ - jffs2_free_full_dnode(fn); - return ERR_PTR(ret?ret:-EIO); - } - /* Mark the space used */ - /* If node covers at least a whole page, or if it starts at the - beginning of a page and runs to the end of the file, or if - it's a hole node, mark it REF_PRISTINE, else REF_NORMAL. - */ - if ((je32_to_cpu(ri->dsize) >= PAGE_CACHE_SIZE) || - ( ((je32_to_cpu(ri->offset)&(PAGE_CACHE_SIZE-1))==0) && - (je32_to_cpu(ri->dsize)+je32_to_cpu(ri->offset) == je32_to_cpu(ri->isize)))) { - raw->flash_offset |= REF_PRISTINE; - } else { - raw->flash_offset |= REF_NORMAL; - } - jffs2_add_physical_node_ref(c, raw); - - /* Link into per-inode list */ - spin_lock(&c->erase_completion_lock); - raw->next_in_ino = f->inocache->nodes; - f->inocache->nodes = raw; - spin_unlock(&c->erase_completion_lock); - - D1(printk(KERN_DEBUG "jffs2_write_dnode wrote node at 0x%08x(%d) with dsize 0x%x, csize 0x%x, node_crc 0x%08x, data_crc 0x%08x, totlen 0x%08x\n", - flash_ofs, ref_flags(raw), je32_to_cpu(ri->dsize), - je32_to_cpu(ri->csize), je32_to_cpu(ri->node_crc), - je32_to_cpu(ri->data_crc), je32_to_cpu(ri->totlen))); - - if (retried) { - jffs2_dbg_acct_sanity_check(c,NULL); - } - - return fn; -} - -struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, uint32_t flash_ofs, int alloc_mode) -{ - struct jffs2_raw_node_ref *raw; - struct jffs2_full_dirent *fd; - size_t retlen; - struct kvec vecs[2]; - int retried = 0; - int ret; - - D1(printk(KERN_DEBUG "jffs2_write_dirent(ino #%u, name at *0x%p \"%s\"->ino #%u, name_crc 0x%08x)\n", - je32_to_cpu(rd->pino), name, name, je32_to_cpu(rd->ino), - je32_to_cpu(rd->name_crc))); - - D1(if(je32_to_cpu(rd->hdr_crc) != crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)) { - printk(KERN_CRIT "Eep. CRC not correct in jffs2_write_dirent()\n"); - BUG(); - } - ); - - vecs[0].iov_base = rd; - vecs[0].iov_len = sizeof(*rd); - vecs[1].iov_base = (unsigned char *)name; - vecs[1].iov_len = namelen; - - jffs2_dbg_prewrite_paranoia_check(c, flash_ofs, vecs[0].iov_len + vecs[1].iov_len); - - raw = jffs2_alloc_raw_node_ref(); - - if (!raw) - return ERR_PTR(-ENOMEM); - - fd = jffs2_alloc_full_dirent(namelen+1); - if (!fd) { - jffs2_free_raw_node_ref(raw); - return ERR_PTR(-ENOMEM); - } - - fd->version = je32_to_cpu(rd->version); - fd->ino = je32_to_cpu(rd->ino); - fd->nhash = full_name_hash(name, strlen((const char *)name)); - fd->type = rd->type; - memcpy(fd->name, name, namelen); - fd->name[namelen]=0; - - retry: - fd->raw = raw; - - raw->flash_offset = flash_ofs; - raw->__totlen = PAD(sizeof(*rd)+namelen); - raw->next_phys = NULL; - - if ((alloc_mode!=ALLOC_GC) && (je32_to_cpu(rd->version) < f->highest_version)) { - BUG_ON(!retried); - D1(printk(KERN_DEBUG "jffs2_write_dirent : dirent_version %d, " - "highest version %d -> updating dirent\n", - je32_to_cpu(rd->version), f->highest_version)); - rd->version = cpu_to_je32(++f->highest_version); - fd->version = je32_to_cpu(rd->version); - rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); - } - - ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen, - (alloc_mode==ALLOC_GC)?0:je32_to_cpu(rd->pino)); - if (ret || (retlen != sizeof(*rd) + namelen)) { - printk(KERN_NOTICE "Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n", - sizeof(*rd)+namelen, flash_ofs, ret, retlen); - /* Mark the space as dirtied */ - if (retlen) { - raw->next_in_ino = NULL; - raw->flash_offset |= REF_OBSOLETE; - jffs2_add_physical_node_ref(c, raw); - jffs2_mark_node_obsolete(c, raw); - } else { - printk(KERN_NOTICE "Not marking the space at 0x%08x as dirty because the flash driver returned retlen zero\n", raw->flash_offset); - jffs2_free_raw_node_ref(raw); - } - if (!retried && (raw = jffs2_alloc_raw_node_ref())) { - /* Try to reallocate space and retry */ - uint32_t dummy; - struct jffs2_eraseblock *jeb = &c->blocks[flash_ofs / c->sector_size]; - - retried = 1; - - D1(printk(KERN_DEBUG "Retrying failed write.\n")); - - jffs2_dbg_acct_sanity_check(c,jeb); - jffs2_dbg_acct_paranoia_check(c, jeb); - - if (alloc_mode == ALLOC_GC) { - ret = jffs2_reserve_space_gc(c, sizeof(*rd) + namelen, &flash_ofs, &dummy); - } else { - /* Locking pain */ - up(&f->sem); - jffs2_complete_reservation(c); - - ret = jffs2_reserve_space(c, sizeof(*rd) + namelen, &flash_ofs, &dummy, alloc_mode); - down(&f->sem); - } - - if (!ret) { - D1(printk(KERN_DEBUG "Allocated space at 0x%08x to retry failed write.\n", flash_ofs)); - jffs2_dbg_acct_sanity_check(c,jeb); - jffs2_dbg_acct_paranoia_check(c, jeb); - goto retry; - } - D1(printk(KERN_DEBUG "Failed to allocate space to retry failed write: %d!\n", ret)); - jffs2_free_raw_node_ref(raw); - } - /* Release the full_dnode which is now useless, and return */ - jffs2_free_full_dirent(fd); - return ERR_PTR(ret?ret:-EIO); - } - /* Mark the space used */ - raw->flash_offset |= REF_PRISTINE; - jffs2_add_physical_node_ref(c, raw); - - spin_lock(&c->erase_completion_lock); - raw->next_in_ino = f->inocache->nodes; - f->inocache->nodes = raw; - spin_unlock(&c->erase_completion_lock); - - if (retried) { - jffs2_dbg_acct_sanity_check(c,NULL); - } - - return fd; -} - -/* The OS-specific code fills in the metadata in the jffs2_raw_inode for us, so that - we don't have to go digging in struct inode or its equivalent. It should set: - mode, uid, gid, (starting)isize, atime, ctime, mtime */ -int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, - struct jffs2_raw_inode *ri, unsigned char *buf, - uint32_t offset, uint32_t writelen, uint32_t *retlen) -{ - int ret = 0; - uint32_t writtenlen = 0; - - D1(printk(KERN_DEBUG "jffs2_write_inode_range(): Ino #%u, ofs 0x%x, len 0x%x\n", - f->inocache->ino, offset, writelen)); - - while(writelen) { - struct jffs2_full_dnode *fn; - unsigned char *comprbuf = NULL; - uint16_t comprtype = JFFS2_COMPR_NONE; - uint32_t phys_ofs, alloclen; - uint32_t datalen, cdatalen; - int retried = 0; - - retry: - D2(printk(KERN_DEBUG "jffs2_commit_write() loop: 0x%x to write to 0x%x\n", writelen, offset)); - - ret = jffs2_reserve_space(c, sizeof(*ri) + JFFS2_MIN_DATA_LEN, &phys_ofs, &alloclen, ALLOC_NORMAL); - if (ret) { - D1(printk(KERN_DEBUG "jffs2_reserve_space returned %d\n", ret)); - break; - } - down(&f->sem); - datalen = min_t(uint32_t, writelen, PAGE_CACHE_SIZE - (offset & (PAGE_CACHE_SIZE-1))); - cdatalen = min_t(uint32_t, alloclen - sizeof(*ri), datalen); - - comprtype = jffs2_compress(c, f, buf, &comprbuf, &datalen, &cdatalen); - - ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE); - ri->totlen = cpu_to_je32(sizeof(*ri) + cdatalen); - ri->hdr_crc = cpu_to_je32(crc32(0, ri, sizeof(struct jffs2_unknown_node)-4)); - - ri->ino = cpu_to_je32(f->inocache->ino); - ri->version = cpu_to_je32(++f->highest_version); - ri->isize = cpu_to_je32(max(je32_to_cpu(ri->isize), offset + datalen)); - ri->offset = cpu_to_je32(offset); - ri->csize = cpu_to_je32(cdatalen); - ri->dsize = cpu_to_je32(datalen); - ri->compr = comprtype & 0xff; - ri->usercompr = (comprtype >> 8 ) & 0xff; - ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); - ri->data_crc = cpu_to_je32(crc32(0, comprbuf, cdatalen)); - - fn = jffs2_write_dnode(c, f, ri, comprbuf, cdatalen, phys_ofs, ALLOC_NORETRY); - - jffs2_free_comprbuf(comprbuf, buf); - - if (IS_ERR(fn)) { - ret = PTR_ERR(fn); - up(&f->sem); - jffs2_complete_reservation(c); - if (!retried) { - /* Write error to be retried */ - retried = 1; - D1(printk(KERN_DEBUG "Retrying node write in jffs2_write_inode_range()\n")); - goto retry; - } - break; - } - ret = jffs2_add_full_dnode_to_inode(c, f, fn); - if (f->metadata) { - jffs2_mark_node_obsolete(c, f->metadata->raw); - jffs2_free_full_dnode(f->metadata); - f->metadata = NULL; - } - if (ret) { - /* Eep */ - D1(printk(KERN_DEBUG "Eep. add_full_dnode_to_inode() failed in commit_write, returned %d\n", ret)); - jffs2_mark_node_obsolete(c, fn->raw); - jffs2_free_full_dnode(fn); - - up(&f->sem); - jffs2_complete_reservation(c); - break; - } - up(&f->sem); - jffs2_complete_reservation(c); - if (!datalen) { - printk(KERN_WARNING "Eep. We didn't actually write any data in jffs2_write_inode_range()\n"); - ret = -EIO; - break; - } - D1(printk(KERN_DEBUG "increasing writtenlen by %d\n", datalen)); - writtenlen += datalen; - offset += datalen; - writelen -= datalen; - buf += datalen; - } - *retlen = writtenlen; - return ret; -} - -int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen) -{ - struct jffs2_raw_dirent *rd; - struct jffs2_full_dnode *fn; - struct jffs2_full_dirent *fd; - uint32_t alloclen, phys_ofs; - int ret; - - /* Try to reserve enough space for both node and dirent. - * Just the node will do for now, though - */ - ret = jffs2_reserve_space(c, sizeof(*ri), &phys_ofs, &alloclen, ALLOC_NORMAL); - D1(printk(KERN_DEBUG "jffs2_do_create(): reserved 0x%x bytes\n", alloclen)); - if (ret) { - up(&f->sem); - return ret; - } - - ri->data_crc = cpu_to_je32(0); - ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8)); - - fn = jffs2_write_dnode(c, f, ri, NULL, 0, phys_ofs, ALLOC_NORMAL); - - D1(printk(KERN_DEBUG "jffs2_do_create created file with mode 0x%x\n", - jemode_to_cpu(ri->mode))); - - if (IS_ERR(fn)) { - D1(printk(KERN_DEBUG "jffs2_write_dnode() failed\n")); - /* Eeek. Wave bye bye */ - up(&f->sem); - jffs2_complete_reservation(c); - return PTR_ERR(fn); - } - /* No data here. Only a metadata node, which will be - obsoleted by the first data write - */ - f->metadata = fn; - - up(&f->sem); - jffs2_complete_reservation(c); - ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_NORMAL); - - if (ret) { - /* Eep. */ - D1(printk(KERN_DEBUG "jffs2_reserve_space() for dirent failed\n")); - return ret; - } - - rd = jffs2_alloc_raw_dirent(); - if (!rd) { - /* Argh. Now we treat it like a normal delete */ - jffs2_complete_reservation(c); - return -ENOMEM; - } - - down(&dir_f->sem); - - rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); - rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); - rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); - - rd->pino = cpu_to_je32(dir_f->inocache->ino); - rd->version = cpu_to_je32(++dir_f->highest_version); - rd->ino = ri->ino; - rd->mctime = ri->ctime; - rd->nsize = namelen; - rd->type = DT_REG; - rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); - rd->name_crc = cpu_to_je32(crc32(0, name, namelen)); - - fd = jffs2_write_dirent(c, dir_f, rd, (const unsigned char *)name, namelen, phys_ofs, ALLOC_NORMAL); - - jffs2_free_raw_dirent(rd); - - if (IS_ERR(fd)) { - /* dirent failed to write. Delete the inode normally - as if it were the final unlink() */ - jffs2_complete_reservation(c); - up(&dir_f->sem); - return PTR_ERR(fd); - } - - /* Link the fd into the inode's list, obsoleting an old - one if necessary. */ - jffs2_add_fd_to_list(c, fd, &dir_f->dents); - - jffs2_complete_reservation(c); - up(&dir_f->sem); - - return 0; -} - - -int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, - const char *name, int namelen, struct jffs2_inode_info *dead_f) -{ - struct jffs2_raw_dirent *rd; - struct jffs2_full_dirent *fd; - uint32_t alloclen, phys_ofs; - int ret; - - if (1 /* alternative branch needs testing */ || - !jffs2_can_mark_obsolete(c)) { - /* We can't mark stuff obsolete on the medium. We need to write a deletion dirent */ - - rd = jffs2_alloc_raw_dirent(); - if (!rd) - return -ENOMEM; - - ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_DELETION); - if (ret) { - jffs2_free_raw_dirent(rd); - return ret; - } - - down(&dir_f->sem); - - /* Build a deletion node */ - rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); - rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); - rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); - - rd->pino = cpu_to_je32(dir_f->inocache->ino); - rd->version = cpu_to_je32(++dir_f->highest_version); - rd->ino = cpu_to_je32(0); - rd->mctime = cpu_to_je32(get_seconds()); - rd->nsize = namelen; - rd->type = DT_UNKNOWN; - rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); - rd->name_crc = cpu_to_je32(crc32(0, name, namelen)); - - fd = jffs2_write_dirent(c, dir_f, rd, (const unsigned char *)name, namelen, phys_ofs, ALLOC_DELETION); - - jffs2_free_raw_dirent(rd); - - if (IS_ERR(fd)) { - jffs2_complete_reservation(c); - up(&dir_f->sem); - return PTR_ERR(fd); - } - - /* File it. This will mark the old one obsolete. */ - jffs2_add_fd_to_list(c, fd, &dir_f->dents); - up(&dir_f->sem); - } else { - struct jffs2_full_dirent **prev = &dir_f->dents; - uint32_t nhash = full_name_hash((const unsigned char *)name, namelen); - - down(&dir_f->sem); - - while ((*prev) && (*prev)->nhash <= nhash) { - if ((*prev)->nhash == nhash && - !memcmp((*prev)->name, name, namelen) && - !(*prev)->name[namelen]) { - struct jffs2_full_dirent *this = *prev; - - D1(printk(KERN_DEBUG "Marking old dirent node (ino #%u) @%08x obsolete\n", - this->ino, ref_offset(this->raw))); - - *prev = this->next; - jffs2_mark_node_obsolete(c, (this->raw)); - jffs2_free_full_dirent(this); - break; - } - prev = &((*prev)->next); - } - up(&dir_f->sem); - } - - /* dead_f is NULL if this was a rename not a real unlink */ - /* Also catch the !f->inocache case, where there was a dirent - pointing to an inode which didn't exist. */ - if (dead_f && dead_f->inocache) { - - down(&dead_f->sem); - - if (S_ISDIR(OFNI_EDONI_2SFFJ(dead_f)->i_mode)) { - while (dead_f->dents) { - /* There can be only deleted ones */ - fd = dead_f->dents; - - dead_f->dents = fd->next; - - if (fd->ino) { - printk(KERN_WARNING "Deleting inode #%u with active dentry \"%s\"->ino #%u\n", - dead_f->inocache->ino, fd->name, fd->ino); - } else { - D1(printk(KERN_DEBUG "Removing deletion dirent for \"%s\" from dir ino #%u\n", - fd->name, dead_f->inocache->ino)); - } - jffs2_mark_node_obsolete(c, fd->raw); - jffs2_free_full_dirent(fd); - } - } - - dead_f->inocache->nlink--; - /* NB: Caller must set inode nlink if appropriate */ - up(&dead_f->sem); - } - - jffs2_complete_reservation(c); - - return 0; -} - - -int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen) -{ - struct jffs2_raw_dirent *rd; - struct jffs2_full_dirent *fd; - uint32_t alloclen, phys_ofs; - int ret; - - rd = jffs2_alloc_raw_dirent(); - if (!rd) - return -ENOMEM; - - ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_NORMAL); - if (ret) { - jffs2_free_raw_dirent(rd); - return ret; - } - - down(&dir_f->sem); - - /* Build a deletion node */ - rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); - rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT); - rd->totlen = cpu_to_je32(sizeof(*rd) + namelen); - rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4)); - - rd->pino = cpu_to_je32(dir_f->inocache->ino); - rd->version = cpu_to_je32(++dir_f->highest_version); - rd->ino = cpu_to_je32(ino); - rd->mctime = cpu_to_je32(get_seconds()); - rd->nsize = namelen; - - rd->type = type; - - rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8)); - rd->name_crc = cpu_to_je32(crc32(0, name, namelen)); - - fd = jffs2_write_dirent(c, dir_f, rd, (const unsigned char *)name, namelen, phys_ofs, ALLOC_NORMAL); - - jffs2_free_raw_dirent(rd); - - if (IS_ERR(fd)) { - jffs2_complete_reservation(c); - up(&dir_f->sem); - return PTR_ERR(fd); - } - - /* File it. This will mark the old one obsolete. */ - jffs2_add_fd_to_list(c, fd, &dir_f->dents); - - jffs2_complete_reservation(c); - up(&dir_f->sem); - - return 0; -} diff --git a/components/dfs/filesystems/uffs/AUTHORS b/components/dfs/filesystems/uffs/AUTHORS deleted file mode 100644 index adaedefb4f..0000000000 --- a/components/dfs/filesystems/uffs/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Ricky Zheng diff --git a/components/dfs/filesystems/uffs/CMakeLists.txt b/components/dfs/filesystems/uffs/CMakeLists.txt deleted file mode 100644 index cc36f060e1..0000000000 --- a/components/dfs/filesystems/uffs/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6 ) -PROJECT( uffs ) - -SET(CMAKE_CXX_FLAGS_VGL "-O0 -g") -SET(CMAKE_C_FLAGS_VGL "-O0 -g") - -SET(CMAKE_C_FLAGS_GCOV "-g -O0 -Wall -fprofile-arcs -ftest-coverage") -SET(CMAKE_CXX_FLAGS_GCOV "-g -O0 -Wall -fprofile-arcs -ftest-coverage") -SET(CMAKE_EXE_LINKER_FLAGS_GCOV "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov") - -IF (CMAKE_COMPILER_IS_GNUCC) -IF (APPLE) - SET(CMAKE_CXX_FLAGS "-fPIC -Wall -Werror -g -rdynamic") - SET(CMAKE_C_FLAGS "-fPIC -Wall -Werror -g -rdynamic") -ELSE () - SET(CMAKE_CXX_FLAGS "-fPIC -Wall -Werror -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-parameter-type -Woverride-init -Wtype-limits -Wuninitialized -g -rdynamic") - SET(CMAKE_C_FLAGS "-fPIC -Wall -Werror -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-parameter-type -Woverride-init -Wtype-limits -Wuninitialized -g -rdynamic") -ENDIF() -ENDIF() - -IF (UNIX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUNIX") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNIX") -ENDIF() - -ADD_SUBDIRECTORY( src ) - diff --git a/components/dfs/filesystems/uffs/COPYING b/components/dfs/filesystems/uffs/COPYING deleted file mode 100644 index d511905c16..0000000000 --- a/components/dfs/filesystems/uffs/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/components/dfs/filesystems/uffs/Doxyfile b/components/dfs/filesystems/uffs/Doxyfile deleted file mode 100644 index f46a4c0af1..0000000000 --- a/components/dfs/filesystems/uffs/Doxyfile +++ /dev/null @@ -1,275 +0,0 @@ -# Doxyfile 1.4.1-KDevelop - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = uffs-doc -PROJECT_NUMBER = 0.1 -OUTPUT_DIRECTORY = doc/doxygen-doc -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = ./ -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = YES -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = NO -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = YES -SORT_BY_SCOPE_NAME = YES -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ./src -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.C \ - *.H \ - *.tlh \ - *.diff \ - *.patch \ - *.moc \ - *.xpm \ - *.dox -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = uffs.tag -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/components/dfs/filesystems/uffs/README b/components/dfs/filesystems/uffs/README deleted file mode 100644 index 0828cf134c..0000000000 --- a/components/dfs/filesystems/uffs/README +++ /dev/null @@ -1,275 +0,0 @@ -UFFS: Ultra-low-cost Flash File System - -Project: http://uffs.sf.net/ -Blog: http://all-about-uffs.blogspot.com/ -Q/A: http://groups.google.com/group/uffs/ - -Author: Ricky Zheng - -INTRODUCTION ------------- - -UFFS is a nand flash file system designed for embedded system. - -UFFS have some unique and advanced features: - * Low cost: e.g. it needs only 41K bytes RAM for 64MB NAND flash (page size 2048). - - * Fast booting: it reads only a few spares from each block, typically - mounting a fully filled file system (Gbits) within one second. - - * Superb Reliability: - - The file system is designed for the embedded system which may - frequently lost power/reset without care. - - Journal file system, the file system will automatically rollback - to the last state when lost power on the middle of flash programing. - - When 'write' return without error, the data is guarenteed been - saved on flash. - - * Fast file create/read/write/seek. - * Bad-block tolerant, ECC enable and good ware-leveling. - * There is no garbage collection needed for UFFS. - * Support multiple NAND flash class in one system. - * Support bare flash hardware, no operating system needed. - * Support static memory allocation (works without 'malloc'). - * Fully simulated on PC (Windows/Linux) platform. - -Disadvantage: - * space inefficency for small files: UFFS use at least one - 'block'(the minial erase unit for NAND flash, e.g. 16K ) for a file. - * maximum supported blocks: 2^16 = 65535 - -Memory consuming example: - For page size = 512: - [VARY]Tree nodes: 16 * total_blocks - [CONST]Page Bufs: MAX_CACHED_BUFFERS(10) * (40 + pageSize(512)) = 5.4K - [CONST]Block Info caches: (24 + 14 * pages_per_block (32)) * MAX_CACHED_BLOCK_INFO (10) = 4.6K - - Example 1: 128M bytes NAND, 8192 blocks, total memory cost: - (16 * 8192)128K + 5.4K + 4.6K = 138K bytes. - - Example 2: 32M Bytes NAND, 2048 blocks, total memory cost: - (16 * 2048)32K + 5.4K + 4.6K = 42K bytes. - - Example 3: 16M bytes NAND, 1024 blocks, total memory cost: - (16 * 1024)16K + 5.4K + 4.6K = 26K bytes. - - For page size = 2048: - [VARY]Tree nodes: 16 * total_blocks - [CONST]Page Bufs: MAX_CACHED_BUFFERS(10) * (40 + pageSize(2048)) = 20.4K - [CONST]Block Info caches: (24 + 14 * pages_per_block (32)) * MAX_CACHED_BLOCK_INFO (10) = 4.6K - - Example 1: 512M bytes NAND, 8192 blocks, total memory cost: - (16 * 8192)128K + 20.4K + 4.6K = 153K bytes. - - Example 2: 128M Bytes NAND, 2048 blocks, total memory cost: - (16 * 2048)32K + 20.4K + 4.6K = 57K bytes. - - Example 3: 64M bytes NAND, 1024 blocks, total memory cost: - (16 * 1024)16K + 20.4K + 4.6K = 41K bytes. - - -BUILD SIMULATOR REQUIREMENT ---------------------------- -From V1.2.0, build uffs simulator requires 'cmake'. -'cmake' can be downloaded from: http://www.cmake.org/ - -or, under Debian/Ubuntu: - sudo apt-get install cmake - -BUILD SIMULATOR ON LINUX ------------------------- -1) create a 'build' dir: - -mkdir -p ~/build/uffs - -2) create Makefiles and build: - cd ~/build/uffs - cmake - make - -5) run simulator (interactive mode): - src/utils/mkuffs - - -BUILD SIMULATOR ON WINDOWS --------------------------- - -1) create a 'build' dir along with uffs source dir, - d:\build\uffs - -2) Create VC project files: - cd build\uffs - cmake - -3) Open uffs.dsw (or uffs.sln for VC > 6 ), compile & run. - - -LATEST SOURCE CODE ------------------- -You can get the latest source code from git repository: - git clone git://uffs.git.sourceforge.net/gitroot/uffs/uffs - - -CURRENT STATUS --------------- -UFFS 0.1.x is a working version on PC simulator, also has been ported to -uBase embedded OS as a 'real world' product for thousands of copies, -it works fine so far. - -UFFS 0.2.0 implementes full directory. - -UFFS 1.0.0 is the first stable release at sf.net. - -UFFS 1.1.0: support NAND flash with large page size (up to 2K). - -UFFS 1.1.1: bug fixes. a tool for making uffs disk image. - -UFFS 1.1.2: bug fixes. add more Flash Class. change Licence from GNU GPLv2 to GNU LGPLv2 - -UFFS 1.2.0: - - eliminate 'current path' and relatives. Now you should use absolute path in all - uffs APIs. For dir, the fullname should end with '/'. - - allow using static memory allocation, 'malloc' is no longer needed. - - using cmake for building simulator. - - bug fixes & minor changes. - -UFFS 1.2.1: - - improve bad block management - - bug fixes - - change Licence to modified GNU GPLv2. - -UFFS 1.3.0: - - improved flash interface - - support hardware ECC - - support user defined spare layout (for customized NAND flash controller) - - support 4K page size - - no partial page program required, support MLC NAND flash - - reduced buffer flushes by grouping buffers - - structual improvments and bug fixes - -UFFS v1.3.1: - - Tidy up three memory allocators: static, native and system. - - Fix bugs in flash interface example. - - Fix memory allocation bugs when using static memory allocator. - - Add flash driver interface 'WriteFullPage()'. - - Fix compilation errors for BlackFin DSP compiler. - -UFFS v1.3.2: - - Add POSIX like file system APIs. - - Bug fixes. - -UFFS v1.3.3: - - Change Flash Interface, simplify interface. - - Improved bad block handling. - - Better support for MLC NAND flash. - - Added hardware ECC and RS-ECC controller emulator. - - Bug fixes. - -UFFS v1.3.4 - - New UO_NOECC option for skipping ECC (fast reading). - - POSIX compliance uffs_seek(). - - Improved unclean page detection (add new 'seal' byte in spare area). - - Optional page data CRC. - - Bug fixes. - - Other improvements. - -LICENCE -------- - From v1.2.1, UFFS is released under a modified GNU GPLv2. (the same as eCos Licence) - The full licence text can be found in the header of source files: - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. - - -TESTING UFFS WITH SQLITE3 REGRESSION TEST CASES ------------------------------------------------ -UFFS can be tested with sqlite3 regression test cases (on Linux). - -1) install tcl8.5-dev on host PC: - apt-get install tcl8.5 tcl8.5-dev - - # make sure your Linux is using tcl8.5 as the default tclsh: - sudo update-alternatives --config tclsh - (select "tclsh8.5" from the list.) - -2) build uffs: - mkdir -p ~/build/uffs - cd ~/build/uffs - cmake - -3) build sqlite3: - cd /src/test/sqlite3/sqlite-src-3070900 - ./configure # create some build support files - git checkout -f Makefile config.h # restore modified Makefile and config.h - make test # start build 'testfixture' program. - - # now you'll see something like: - Connect: Connection refused - Assert (uffs_ret == ret && ret == bak_ret) fail at /home/.../src/test/api_test/os_uffs.c:os_unlink:329: unlink("/home/.../src/test/sqlite3/sqlite-src-3070900/./test.db-journal"), unix return 0, uffs return -1, bak return -1 - make: *** [test] Error 1 - -4) run test cases: - Open two terminals. - on termional A: - cd ~/build/uffs - src/utils/mkuffs -t 1024 - - #on uffs simulator command line, enter: - format / - apisrv - - on terminal B: - cd /src/test/sqlite3/sqlite-src-3070900 - ./test-uffs.sh - - Note: if you want to run mkuffs on another PC, for example, a Windows PC, you need to specify the IP address in test-uffs.sh. - - The test will take 1~4 hours, depends on how fast your Linux box is. - - -ACKNOWLEDGMENT ---------------- -Special thanks for your contributions to: -(list in no particular order) - -* Chen Jun -* Michail -* Sjpu -* RobertGray -* Dongbo -* Cag -* Sergey -* Chris Conrad -* Vladimir -* Thien Pham -* Emmanuel Blot -* Michael -* Mick D -* Paul -* Rogerz - - diff --git a/components/dfs/filesystems/uffs/SConscript b/components/dfs/filesystems/uffs/SConscript deleted file mode 100644 index 53f7713fc2..0000000000 --- a/components/dfs/filesystems/uffs/SConscript +++ /dev/null @@ -1,38 +0,0 @@ -# RT-Thread building script for component - -from building import * - -cwd = GetCurrentDir() - -src = Glob('*.c') - -uffs = Split(''' -src/uffs/uffs_badblock.c -src/uffs/uffs_blockinfo.c -src/uffs/uffs_buf.c -src/uffs/uffs_debug.c -src/uffs/uffs_device.c -src/uffs/uffs_ecc.c -src/uffs/uffs_crc.c -src/uffs/uffs_fd.c -src/uffs/uffs_find.c -src/uffs/uffs_flash.c -src/uffs/uffs_fs.c -src/uffs/uffs_init.c -src/uffs/uffs_mem.c -src/uffs/uffs_mtb.c -src/uffs/uffs_pool.c -src/uffs/uffs_public.c -src/uffs/uffs_tree.c -src/uffs/uffs_utils.c -src/uffs/uffs_version.c - -''') - -src = src + uffs - -CPPPATH = [cwd, cwd + '/src/inc'] - -group = DefineGroup('Filesystem', src , depend = ['RT_USING_DFS', 'RT_USING_DFS_UFFS'], CPPPATH = CPPPATH) - -Return('group') diff --git a/components/dfs/filesystems/uffs/TODO b/components/dfs/filesystems/uffs/TODO deleted file mode 100644 index bf6b4fb66a..0000000000 --- a/components/dfs/filesystems/uffs/TODO +++ /dev/null @@ -1,5 +0,0 @@ -TODO list for v1.3: - -* New API: int uffs_SkipObject(uffs_Object *obj, int size); -* Introduce buffer group -* Interface to Linux MTD diff --git a/components/dfs/filesystems/uffs/dfs_uffs.c b/components/dfs/filesystems/uffs/dfs_uffs.c deleted file mode 100644 index fb8caf9dd7..0000000000 --- a/components/dfs/filesystems/uffs/dfs_uffs.c +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2011-10-22 prife the first version - * 2012-03-28 prife use mtd device interface - * 2012-04-05 prife update uffs with official repo and use uffs_UnMount/Mount - * 2017-04-12 lizhen9880 fix the f_bsize and f_blocks issue in function dfs_uffs_statfs - */ - -#include - -#include -#include -#include - -#include "dfs_uffs.h" - -#include "uffs/uffs_fd.h" /* posix file api is here */ -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_mem.h" -#include "uffs/uffs_utils.h" - -/* - * RT-Thread DFS Interface for uffs - */ -#define UFFS_DEVICE_MAX 2 /* the max partions on a nand deivce*/ -#define UFFS_MOUNT_PATH_MAX 128 /* the mount point max length */ -#define FILE_PATH_MAX 256 /* the longest file path */ - -struct _nand_dev -{ - struct rt_mtd_nand_device *dev; - struct uffs_StorageAttrSt storage; - uffs_Device uffs_dev; - uffs_MountTable mount_table; - char mount_path[UFFS_MOUNT_PATH_MAX]; - void *data; /* when uffs use static buf, it will save ptr here */ -}; -/* make sure the following struct var had been initilased to 0! */ -static struct _nand_dev nand_part[UFFS_DEVICE_MAX] = {0}; - -static int uffs_result_to_dfs(int result) -{ - int status = -1; - - result = result < 0 ? -result : result; - switch (result) - { - case UENOERR:/** no error */ - break; - case UEACCES:/** Tried to open read-only file for writing, or files sharing mode - does not allow specified operations, or given path is directory */ - status = -EINVAL; - break;/* no suitable */ - case UEEXIST: /** _O_CREAT and _O_EXCL flags specified, but filename already exists */ - status = -EEXIST; - break; - case UEINVAL: /** Invalid oflag or pmode argument */ - status = -EINVAL; - break; - case UEMFILE: /** No more file handles available(too many open files) */ - status = -1; - break; - case UENOENT: /** file or path not found */ - status = -ENOENT; - break; - case UETIME: /** can't set file time */ - status = -1; - break; - case UEBADF: /** invalid file handle */ - status = -EBADF; - break; - case UENOMEM:/** no enough memory */ - status = -ENOSPC; - break; - case UEIOERR: /** I/O error from lower level flash operation */ - status = -EIO; - break; - case UENOTDIR: /** Not a directory */ - status = -ENOTDIR; - break; - case UEISDIR: /** Is a directory */ - status = -EISDIR; - break; - case UEUNKNOWN_ERR: - default: - status = -1; - break; /* unknown error! */ - } - - return status; -} - -static URET _device_init(uffs_Device *dev) -{ - dev->attr->_private = NULL; // hook nand_chip data structure to attr->_private - dev->ops = (struct uffs_FlashOpsSt *)&nand_ops; - - return U_SUCC; -} - -static URET _device_release(uffs_Device *dev) -{ - return U_SUCC; -} - -static int init_uffs_fs( - struct _nand_dev *nand_part) -{ - uffs_MountTable *mtb; - struct rt_mtd_nand_device *nand; - struct uffs_StorageAttrSt *flash_storage; - - mtb = &nand_part->mount_table; - nand = nand_part->dev; - flash_storage = &nand_part->storage; - - /* setup nand storage attributes */ - uffs_setup_storage(flash_storage, nand); - - /* register mount table */ - if (mtb->dev) - { - /* set memory allocator for uffs */ -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 - uffs_MemSetupSystemAllocator(&mtb->dev->mem); -#endif - /* setup device init/release entry */ - mtb->dev->Init = _device_init; - mtb->dev->Release = _device_release; - mtb->dev->attr = flash_storage; - - uffs_RegisterMountTable(mtb); - } - /* mount uffs partion on nand device */ - return uffs_Mount(nand_part->mount_path) == U_SUCC ? 0 : -1; -} - -static int dfs_uffs_mount( - struct dfs_filesystem *fs, - unsigned long rwflag, - const void *data) -{ - rt_base_t index; - uffs_MountTable *mount_part; - struct rt_mtd_nand_device *dev; - - RT_ASSERT(rt_strlen(fs->path) < (UFFS_MOUNT_PATH_MAX - 1)); - dev = RT_MTD_NAND_DEVICE(fs->dev_id); - - /*1. find a empty entry in partition table */ - for (index = 0; index < UFFS_DEVICE_MAX ; index ++) - { - if (nand_part[index].dev == RT_NULL) - break; - } - if (index == UFFS_DEVICE_MAX) - return -ENOENT; - - /*2. fill partition structure */ - nand_part[index].dev = dev; - - /* make a right mount path for uffs, end with '/' */ - rt_snprintf(nand_part[index].mount_path, UFFS_MOUNT_PATH_MAX, "%s/", fs->path); - if (nand_part[index].mount_path[1] == '/') - nand_part[index].mount_path[1] = 0; - - mount_part = &(nand_part[index].mount_table); - mount_part->mount = nand_part[index].mount_path; - mount_part->dev = &(nand_part[index].uffs_dev); - rt_memset(mount_part->dev, 0, sizeof(uffs_Device));//in order to make uffs happy. - mount_part->dev->_private = dev; /* save dev_id into uffs */ - mount_part->start_block = dev->block_start; - mount_part->end_block = dev->block_end; - /*3. mount uffs */ - if (init_uffs_fs(&nand_part[index]) < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - return 0; -} - -static int dfs_uffs_unmount(struct dfs_filesystem *fs) -{ - rt_base_t index; - int result; - - /* find the device index and then unmount it */ - for (index = 0; index < UFFS_DEVICE_MAX; index++) - { - if (nand_part[index].dev == RT_MTD_NAND_DEVICE(fs->dev_id)) - { - nand_part[index].dev = RT_NULL; - result = uffs_UnMount(nand_part[index].mount_path); - if (result != U_SUCC) - break; - - result = uffs_UnRegisterMountTable(& nand_part[index].mount_table); - return (result == U_SUCC) ? RT_EOK : -1; - } - } - return -ENOENT; -} - -static int dfs_uffs_mkfs(rt_device_t dev_id) -{ - rt_base_t index; - rt_uint32_t block; - struct rt_mtd_nand_device *mtd; - - /*1. find the device index */ - for (index = 0; index < UFFS_DEVICE_MAX; index++) - { - if (nand_part[index].dev == (struct rt_mtd_nand_device *)dev_id) - break; - } - - if (index == UFFS_DEVICE_MAX) - { - /* can't find device driver */ - return -ENOENT; - } - - /*2. then unmount the partition */ - uffs_UnMount(nand_part[index].mount_path); - mtd = nand_part[index].dev; - - /*3. erase all blocks on the partition */ - block = mtd->block_start; - for (; block <= mtd->block_end; block++) - { - rt_mtd_nand_erase_block(mtd, block); -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - if (rt_mtd_nand_check_block(mtd, block) != RT_EOK) - { - rt_kprintf("found bad block %d\n", block); - rt_mtd_nand_mark_badblock(mtd, block); - } -#endif - } - - /*4. remount it */ - if (init_uffs_fs(&nand_part[index]) < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - return RT_EOK; -} - -static int dfs_uffs_statfs(struct dfs_filesystem *fs, - struct statfs *buf) -{ - rt_base_t index; - struct rt_mtd_nand_device *mtd = RT_MTD_NAND_DEVICE(fs->dev_id); - - RT_ASSERT(mtd != RT_NULL); - - /* find the device index */ - for (index = 0; index < UFFS_DEVICE_MAX; index++) - { - if (nand_part[index].dev == (void *)mtd) - break; - } - if (index == UFFS_DEVICE_MAX) - return -ENOENT; - - buf->f_bsize = mtd->page_size * mtd->pages_per_block; - buf->f_blocks = (mtd->block_end - mtd->block_start + 1); - buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev) / buf->f_bsize ; - - return 0; -} - -static int dfs_uffs_open(struct dfs_fd *file) -{ - int fd; - int oflag, mode; - char *file_path; - - oflag = file->flags; - if (oflag & O_DIRECTORY) /* operations about dir */ - { - uffs_DIR *dir; - - if (oflag & O_CREAT) /* create a dir*/ - { - if (uffs_mkdir(file->path) < 0) - return uffs_result_to_dfs(uffs_get_error()); - } - /* open dir */ - file_path = rt_malloc(FILE_PATH_MAX); - if (file_path == RT_NULL) - return -ENOMEM; - - if (file->path[0] == '/' && !(file->path[1] == 0)) - rt_snprintf(file_path, FILE_PATH_MAX, "%s/", file->path); - else - { - file_path[0] = '/'; - file_path[1] = 0; - } - - dir = uffs_opendir(file_path); - - if (dir == RT_NULL) - { - rt_free(file_path); - return uffs_result_to_dfs(uffs_get_error()); - } - /* save this pointer,will used by dfs_uffs_getdents*/ - file->data = dir; - rt_free(file_path); - return RT_EOK; - } - /* regular file operations */ - /* int uffs_open(const char *name, int oflag, ...); what is this? - * uffs_open can open dir!! **/ - mode = 0; - if (oflag & O_RDONLY) mode |= UO_RDONLY; - if (oflag & O_WRONLY) mode |= UO_WRONLY; - if (oflag & O_RDWR) mode |= UO_RDWR; - /* Opens the file, if it is existing. If not, a new file is created. */ - if (oflag & O_CREAT) mode |= UO_CREATE; - /* Creates a new file. If the file is existing, it is truncated and overwritten. */ - if (oflag & O_TRUNC) mode |= UO_TRUNC; - /* Creates a new file. The function fails if the file is already existing. */ - if (oflag & O_EXCL) mode |= UO_EXCL; - - fd = uffs_open(file->path, mode); - if (fd < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - - /* save this pointer, it will be used when calling read(), write(), - * flush(), seek(), and will be free when calling close()*/ - - file->data = (void *)fd; - file->pos = uffs_seek(fd, 0, USEEK_CUR); - file->size = uffs_seek(fd, 0, USEEK_END); - uffs_seek(fd, file->pos, USEEK_SET); - - if (oflag & O_APPEND) - { - file->pos = uffs_seek(fd, 0, USEEK_END); - } - return 0; -} - -static int dfs_uffs_close(struct dfs_fd *file) -{ - int oflag; - int fd; - - oflag = file->flags; - if (oflag & O_DIRECTORY) - { - /* operations about dir */ - if (uffs_closedir((uffs_DIR *)(file->data)) < 0) - return uffs_result_to_dfs(uffs_get_error()); - - return 0; - } - /* regular file operations */ - fd = (int)(file->data); - - if (uffs_close(fd) == 0) - return 0; - - return uffs_result_to_dfs(uffs_get_error()); -} - -static int dfs_uffs_ioctl(struct dfs_fd *file, int cmd, void *args) -{ - return -ENOSYS; -} - -static int dfs_uffs_read(struct dfs_fd *file, void *buf, size_t len) -{ - int fd; - int char_read; - - fd = (int)(file->data); - char_read = uffs_read(fd, buf, len); - if (char_read < 0) - return uffs_result_to_dfs(uffs_get_error()); - - /* update position */ - file->pos = uffs_seek(fd, 0, USEEK_CUR); - return char_read; -} - -static int dfs_uffs_write(struct dfs_fd *file, - const void *buf, - size_t len) -{ - int fd; - int char_write; - - fd = (int)(file->data); - - char_write = uffs_write(fd, buf, len); - if (char_write < 0) - return uffs_result_to_dfs(uffs_get_error()); - - /* update position */ - file->pos = uffs_seek(fd, 0, USEEK_CUR); - return char_write; -} - -static int dfs_uffs_flush(struct dfs_fd *file) -{ - int fd; - int result; - - fd = (int)(file->data); - - result = uffs_flush(fd); - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - return 0; -} - -int uffs_seekdir(uffs_DIR *dir, long offset) -{ - int i = 0; - - while (i < offset) - { - if (uffs_readdir(dir) == RT_NULL) - return -1; - i++; - } - return 0; -} - - -static int dfs_uffs_seek(struct dfs_fd *file, - rt_off_t offset) -{ - int result; - - /* set offset as current offset */ - if (file->type == FT_DIRECTORY) - { - uffs_rewinddir((uffs_DIR *)(file->data)); - result = uffs_seekdir((uffs_DIR *)(file->data), offset / sizeof(struct dirent)); - if (result >= 0) - { - file->pos = offset; - return offset; - } - } - else if (file->type == FT_REGULAR) - { - result = uffs_seek((int)(file->data), offset, USEEK_SET); - if (result >= 0) - return offset; - } - - return uffs_result_to_dfs(uffs_get_error()); -} - -/* return the size of struct dirent*/ -static int dfs_uffs_getdents( - struct dfs_fd *file, - struct dirent *dirp, - uint32_t count) -{ - rt_uint32_t index; - char *file_path; - struct dirent *d; - uffs_DIR *dir; - struct uffs_dirent *uffs_d; - - dir = (uffs_DIR *)(file->data); - RT_ASSERT(dir != RT_NULL); - - /* round count, count is always 1 */ - count = (count / sizeof(struct dirent)) * sizeof(struct dirent); - if (count == 0) return -EINVAL; - - /* allocate file name */ - file_path = rt_malloc(FILE_PATH_MAX); - if (file_path == RT_NULL) - return -ENOMEM; - - index = 0; - /* usually, the while loop should only be looped only once! */ - while (1) - { - struct uffs_stat s; - - d = dirp + index; - - uffs_d = uffs_readdir(dir); - if (uffs_d == RT_NULL) - { - rt_free(file_path); - return (uffs_result_to_dfs(uffs_get_error())); - } - - if (file->path[0] == '/' && !(file->path[1] == 0)) - rt_snprintf(file_path, FILE_PATH_MAX, "%s/%s", file->path, uffs_d->d_name); - else - rt_strncpy(file_path, uffs_d->d_name, FILE_PATH_MAX); - - uffs_stat(file_path, &s); - switch (s.st_mode & US_IFMT) /* file type mark */ - { - case US_IFREG: /* directory */ - d->d_type = DT_REG; - break; - case US_IFDIR: /* regular file */ - d->d_type = DT_DIR; - break; - case US_IFLNK: /* symbolic link */ - case US_IREAD: /* read permission */ - case US_IWRITE:/* write permission */ - default: - d->d_type = DT_UNKNOWN; - break; - } - - /* write the rest args of struct dirent* dirp */ - d->d_namlen = rt_strlen(uffs_d->d_name); - d->d_reclen = (rt_uint16_t)sizeof(struct dirent); - rt_strncpy(d->d_name, uffs_d->d_name, rt_strlen(uffs_d->d_name) + 1); - - index ++; - if (index * sizeof(struct dirent) >= count) - break; - } - - /* free file name buf */ - rt_free(file_path); - - if (index == 0) - return uffs_result_to_dfs(uffs_get_error()); - - file->pos += index * sizeof(struct dirent); - - return index * sizeof(struct dirent); -} - -static int dfs_uffs_unlink(struct dfs_filesystem *fs, const char *path) -{ - int result; - struct uffs_stat s; - - /* judge file type, dir is to be delete by uffs_rmdir, others by uffs_remove */ - if (uffs_lstat(path, &s) < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - - switch (s.st_mode & US_IFMT) - { - case US_IFREG: - result = uffs_remove(path); - break; - case US_IFDIR: - result = uffs_rmdir(path); - break; - default: - /* unknown file type */ - return -1; - } - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - - return 0; -} - -static int dfs_uffs_rename( - struct dfs_filesystem *fs, - const char *oldpath, - const char *newpath) -{ - int result; - - result = uffs_rename(oldpath, newpath); - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - - return 0; -} - -static int dfs_uffs_stat(struct dfs_filesystem *fs, const char *path, struct stat *st) -{ - int result; - struct uffs_stat s; - - result = uffs_stat(path, &s); - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - - /* convert uffs stat to dfs stat structure */ - /* FIXME, these field may not be the same */ - st->st_dev = 0; - st->st_mode = s.st_mode; - st->st_size = s.st_size; - st->st_mtime = s.st_mtime; - - return 0; -} - -static const struct dfs_file_ops dfs_uffs_fops = -{ - dfs_uffs_open, - dfs_uffs_close, - dfs_uffs_ioctl, - dfs_uffs_read, - dfs_uffs_write, - dfs_uffs_flush, - dfs_uffs_seek, - dfs_uffs_getdents, -}; - -static const struct dfs_filesystem_ops dfs_uffs_ops = -{ - "uffs", /* file system type: uffs */ -#if RTTHREAD_VERSION >= 10100 - DFS_FS_FLAG_FULLPATH, -#else -#error "uffs can only work with rtthread whose version should >= 1.01\n" -#endif - &dfs_uffs_fops, - - dfs_uffs_mount, - dfs_uffs_unmount, - dfs_uffs_mkfs, - dfs_uffs_statfs, - - dfs_uffs_unlink, - dfs_uffs_stat, - dfs_uffs_rename, -}; - -int dfs_uffs_init(void) -{ - /* register uffs file system */ - dfs_register(&dfs_uffs_ops); - - if (uffs_InitObjectBuf() == U_SUCC) - { - if (uffs_DirEntryBufInit() == U_SUCC) - { - uffs_InitGlobalFsLock(); - return RT_EOK; - } - } - return -RT_ERROR; -} -INIT_COMPONENT_EXPORT(dfs_uffs_init); - diff --git a/components/dfs/filesystems/uffs/dfs_uffs.h b/components/dfs/filesystems/uffs/dfs_uffs.h deleted file mode 100644 index 72f0ee9240..0000000000 --- a/components/dfs/filesystems/uffs/dfs_uffs.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-03-30 prife the first version - */ - -#ifndef DFS_UFFS_H_ -#define DFS_UFFS_H_ - -#include "uffs_config.h" -#include "uffs/uffs_public.h" - -/* the UFFS ECC mode opitons */ -#ifndef RT_UFFS_ECC_MODE -#define RT_UFFS_ECC_MODE 1 -#endif - -/* - * RT_UFFS_ECC_MODE: - * 0, Do not use ECC - * 1, UFFS calculate the ECC - * 2, Flash driver(or by hardware) calculate the ECC - * 3, Hardware calculate the ECC and automatically write to spare. - */ -#if RT_UFFS_ECC_MODE == 0 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE -#elif RT_UFFS_ECC_MODE == 1 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT -#elif RT_UFFS_ECC_MODE == 2 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW -#elif RT_UFFS_ECC_MODE == 3 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO -#endif - -/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO */ -/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT */ -/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE */ - -/* enable this ,you need provide a mark_badblock/check_block funciton */ -/* #define RT_UFFS_USE_CHECK_MARK_FUNCITON */ - -#if RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT /* let uffs do soft ecc */ -#define RT_CONFIG_UFFS_LAYOUT UFFS_LAYOUT_UFFS /* UFFS_LAYOUT_FLASH */ - -#elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO /* nand driver make ecc and do ecc correct */ -#define RT_CONFIG_UFFS_LAYOUT UFFS_LAYOUT_FLASH - -#elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_NONE -#define RT_CONFIG_UFFS_LAYOUT UFFS_LAYOUT_UFFS /* UFFS_LAYOUT_FLASH */ - -#else -#error "uffs under rt-thread do not support this ECC mode" -#endif /* RT_CONFIG_UFFS_ECC_MODE */ - -#if (!CONFIG_USE_STATIC_MEMORY_ALLOCATOR) && (CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR) -#define RT_UFFS_MEMORY_ALLOCATOR 1 /* use system memory allocator */ -#elif (CONFIG_USE_STATIC_MEMORY_ALLOCATOR) && (!CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR) -#define RT_UFFS_MEMORY_ALLOCATOR 0 /* use static memory allocator */ -#else -#error "UFFS: CONFIG_USE_STATIC_MEMORY_ALLOCATOR ,CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR are invalid!" -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR > 0 -#error "dfs_uffs only support CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR" -#endif - -#if defined(CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME) -#error "dfs_uffs not support CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME" -#endif - -#if (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO) && (RT_CONFIG_UFFS_LAYOUT != UFFS_LAYOUT_FLASH) -#error "when use UFFS_ECC_HW_AUTO, you must use UFFS_LAYOUT_FLASH" - -#elif (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT) && (RT_CONFIG_UFFS_LAYOUT != UFFS_LAYOUT_UFFS) -#warning "when use UFFS_ECC_SOFT, it is recommended to use UFFS_LAYOUT_UFFS" -#endif - -extern const uffs_FlashOps nand_ops; - -extern void uffs_setup_storage( - struct uffs_StorageAttrSt *attr, - struct rt_mtd_nand_device *nand); - -extern int dfs_uffs_init(void); -#endif /* DFS_UFFS_H_ */ diff --git a/components/dfs/filesystems/uffs/doc/Understanding-UFFS.odp b/components/dfs/filesystems/uffs/doc/Understanding-UFFS.odp deleted file mode 100644 index b39f4d0f32..0000000000 Binary files a/components/dfs/filesystems/uffs/doc/Understanding-UFFS.odp and /dev/null differ diff --git a/components/dfs/filesystems/uffs/doc/Understanding-UFFS.pdf b/components/dfs/filesystems/uffs/doc/Understanding-UFFS.pdf deleted file mode 100644 index 02926c8e18..0000000000 Binary files a/components/dfs/filesystems/uffs/doc/Understanding-UFFS.pdf and /dev/null differ diff --git a/components/dfs/filesystems/uffs/doc/uffs-serial-num-relationship.JPG b/components/dfs/filesystems/uffs/doc/uffs-serial-num-relationship.JPG deleted file mode 100644 index 2cdbbcd2b2..0000000000 Binary files a/components/dfs/filesystems/uffs/doc/uffs-serial-num-relationship.JPG and /dev/null differ diff --git a/components/dfs/filesystems/uffs/src/CMakeLists.txt b/components/dfs/filesystems/uffs/src/CMakeLists.txt deleted file mode 100644 index 7d744d16ee..0000000000 --- a/components/dfs/filesystems/uffs/src/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -ADD_SUBDIRECTORY(emu) -ADD_SUBDIRECTORY(uffs) -ADD_SUBDIRECTORY(utils) -ADD_SUBDIRECTORY(example) -ADD_SUBDIRECTORY(platform) -ADD_SUBDIRECTORY(test/api_test) -ADD_SUBDIRECTORY(test/clients) diff --git a/components/dfs/filesystems/uffs/src/emu/CMakeLists.txt b/components/dfs/filesystems/uffs/src/emu/CMakeLists.txt deleted file mode 100644 index f70deff7a2..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -SET (libemu_SRCS - cmdline.c - cmdline.h - helper_cmds.c - uffs_fileem.c - uffs_fileem_share.c - uffs_fileem_wrap.c - uffs_fileem_ecc_soft.c - uffs_fileem_ecc_hw.c - uffs_fileem_ecc_hw_auto.c - uffs_fileem.h - test_cmds.c - ) - -IF (UNIX) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/posix) -ENDIF() -IF (WIN32) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/win32) -ENDIF() -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/inc) -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/test/api_test) -ADD_LIBRARY(emu STATIC ${libemu_SRCS} ) - diff --git a/components/dfs/filesystems/uffs/src/emu/cmdline.c b/components/dfs/filesystems/uffs/src/emu/cmdline.c deleted file mode 100644 index 9774a11ca1..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/cmdline.c +++ /dev/null @@ -1,643 +0,0 @@ -/* -This file is part of UFFS, the Ultra-low-cost Flash File System. - -Copyright (C) 2005-2009 Ricky Zheng - -UFFS is free software; you can redistribute it and/or modify it under -the GNU Library General Public License as published by the Free Software -Foundation; either version 2 of the License, or (at your option) any -later version. - -UFFS is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -or GNU Library General Public License, as applicable, for more details. - -You should have received a copy of the GNU General Public License -and GNU Library General Public License along with UFFS; if not, write -to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. - -As a special exception, if other files instantiate templates or use -macros or inline functions from this file, or you compile this file -and link it with other works to produce a work based on this file, -this file does not by itself cause the resulting work to be covered -by the GNU General Public License. However the source code for this -file must still be made available in accordance with section (3) of -the GNU General Public License v2. - -This exception does not invalidate any other reasons why a work based -on this file might be covered by the GNU General Public License. -*/ - -/** -* \file cmdline.c -* \brief command line test interface -* \author Ricky Zheng, created in 22th Feb, 2007 -*/ - -#include -#include -//#include -#include "uffs_config.h" -#include "cmdline.h" -#include "uffs/uffs_fs.h" - -#define PROMPT "UFFS>" - -#define PFX "cli : " -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -#define MAX_CLI_ARGS_BUF_LEN 120 -#define MAX_CLI_ARGS_NUM 20 -#define MAX_CLI_ENV_NUM 11 // '?', '0' - '9' - - -struct cli_arg { - int argc; - char *argv[MAX_CLI_ARGS_NUM]; - char _buf[MAX_CLI_ARGS_BUF_LEN]; -}; - -static BOOL m_exit = FALSE; -static BOOL m_abort = FALSE; -static struct cli_commandset *m_cmdset_head = NULL; - -// Note: last command return code stored in env 0. -static int m_cli_envs[MAX_CLI_ENV_NUM] = {0}; // cli environment variables - -static const struct cli_command * cli_find(const char *cmd); -static int cmd_help(int argc, char *argv[]); - - -#define FOR_EACH_CLI_CMD(set, cmd) \ - for (set = m_cmdset_head; set && set->cmds; set = set->next) \ - for (cmd = set->cmds; cmd && cmd->handler; cmd++) - - -/*** filter out leading and tailing spaces, discard comments - * return pointer to start of new command line - */ -static char * cli_process_line(char *p) -{ - char *s; - char *x; - - if (!p) - return NULL; - - // skip leading spaces - while (p && (*p == ' ' || *p == '\t')) - p++; - - for (s = x = p; *p; x++, p++) { - switch(*p) { - case '\\': - p++; - if (*p) { - switch(*p) { - case 'n': - *x = '\n'; - break; - case 'r': - *x = '\r'; - break; - case 't': - *x = '\t'; - break; - case 'b': - *x = '\b'; - break; - default: - if (*p >= '0' && *p <= '9') - *x = *p - '0'; - else - *x = *p; - break; - } - } - break; - default: - if (*p == '\r' || *p == '\n' || *p == '#') *p = '\0'; - *x = *p; - break; - } - - if (*p == 0) - break; - } - - // trim tailing spaces - p--; - while (p > s && (*p == ' ' || *p == '\t')) - *p-- = '\0'; - - return s; -} - -static int cli_env_to_idx(char env) -{ - int idx = -1; - - if (env >= '0' && env <= '9') { - idx = env - '0' + 1; - } - else if (env == '?') { - idx = 0; - } - - return idx; -} - -int cli_env_set(char env, int val) -{ - int idx = cli_env_to_idx(env); - - if (idx >= 0) { - m_cli_envs[idx] = val; - return 0; - } - else - return -1; -} - -int cli_env_get(char env) -{ - int idx = cli_env_to_idx(env); - - return idx >= 0 ? m_cli_envs[idx] : 0; -} - -/** exec command times: - * exec [...] - */ -static int cmd_exec(int argc, char *argv[]) -{ - int n = 0; - const struct cli_command *cmd; - - CHK_ARGC(3, 0); - - if (sscanf(argv[1], "%d", &n) != 1) - return CLI_INVALID_ARG; - if (n <= 0) - return CLI_INVALID_ARG; - - cmd = cli_find(argv[2]); - if (cmd == NULL) { - MSG("Unknown command '%s'\n", argv[2]); - return -1; - } - else { - argv += 2; - while (n-- >= 0) { - if (cmd->handler(argc - 2, argv) != 0) - return -1; - } - } - - return 0; -} - -/** - * test expression - * test - * for example: - * test 1 > 0 ==> return 0 - * test 1 <= 0 ==> return -1 - */ -static int cmd_test(int argc, char *argv[]) -{ - int a, b; - char *op; - BOOL tst = FALSE; - - CHK_ARGC(4, 4); - - if (sscanf(argv[1], "%d", &a) != 1 || - sscanf(argv[3], "%d", &b) != 1) - { - return CLI_INVALID_ARG; - } - - op = argv[2]; - if (!strcmp(op, ">")) { - tst = (a > b); - } - else if (!strcmp(op, "<")) { - tst = (a < b); - } - else if (!strcmp(op, "==")) { - tst = (a == b); - } - else if (!strcmp(op, ">=")) { - tst = (a >= b); - } - else if (!strcmp(op, "<=")) { - tst = (a <= b); - } - else if (!strcmp(op, "!=")) { - tst = (a != b); - } - else { - return CLI_INVALID_ARG; - } - - return tst ? 0 : -1; -} - -/** if last command failed (return != 0), run - * ! - */ -static int cmd_failed(int argc, char *argv[]) -{ - const struct cli_command *cmd; - - CHK_ARGC(2, 0); - - cmd = cli_find(argv[1]); - if (cmd == NULL) { - MSG("Unknown command '%s'\n", argv[1]); - return -1; - } - else { - argv++; - return (cli_env_get('?') == 0 ? 0 : cmd->handler(argc - 1, argv)); - } -} - -/** print messages - * echo [ ...] - */ -static int cmd_echo(int argc, char *argv[]) -{ - int i; - - for (i = 1; i < argc; i++) { - MSG("%s%s", i > 1 ? " " : "", argv[i]); - } - MSG("\n"); - - return 0; -} - -/** set cli environment variable - * set - */ -static int cmd_set(int argc, char *argv[]) -{ - int val; - int ret = -1; - - CHK_ARGC(3, 0); - - if (sscanf(argv[2], "%d", &val) == 1) { - ret = cli_env_set(argv[1][0], val); - } - - return ret; -} - -/** evaluation the expresstion, result to $1 - * evl - */ -static int cmd_evl(int argc, char *argv[]) -{ - int val1, val2, result = 0; - int ret = -1; - - CHK_ARGC(4, 4); - - if (sscanf(argv[1], "%d", &val1) == 1 && - sscanf(argv[3], "%d", &val2) == 1) { - ret = 0; - switch(argv[2][0]) { - case '+': - result = val1 + val2; - break; - case '-': - result = val1 - val2; - break; - case '*': - result = val1 * val2; - break; - case '/': - if (val2 == 0) - ret = -1; - else - result = val1 / val2; - break; - case '%': - if (val2 == 0) - ret = -1; - else - result = val1 % val2; - break; - default: - ret = CLI_INVALID_ARG; - break; - } - } - - if (ret == 0) - ret = cli_env_set('1', result); - - return ret; -} - -static int cmd_exit(int argc, char *argv[]) -{ - m_exit = TRUE; - return 0; -} - -/** Abort current script - * abort [...] - */ -static int cmd_abort(int argc, char *argv[]) -{ - if (argc > 1) { - cmd_echo(argc, argv); - } - - m_abort = TRUE; - - return 0; -} - -/** run local file system's script - * script - */ -static int cmd_script(int argc, char *argv[]) -{ - char line_buf[256]; - char *p; - FILE *fp; - const char *name; - int ret = 0; - static int stack = 0; - - CHK_ARGC(2, 0); - - if (stack++ == 0) - m_abort = FALSE; - - name = argv[1]; - fp = fopen(name, "r"); - - if (fp) { - memset(line_buf, 0, sizeof(line_buf)); - while (!m_abort && fgets(line_buf, sizeof(line_buf) - 1, fp)) { - p = line_buf + sizeof(line_buf) - 1; - while (*p == 0 && p > line_buf) - p--; - while ((*p == '\r' || *p == '\n') && p > line_buf) { - *p-- = 0; - } - p = cli_process_line(line_buf); - if (*p) - ret = cli_interpret(p); - memset(line_buf, 0, sizeof(line_buf)); - } - fclose(fp); - } - else { - MSG("Can't open host script file '%s' for read\n", name); - ret = -1; - } - - stack--; - - return ret; -} - - - -static const struct cli_command default_cmds[] = -{ - { cmd_help, "help|?", "[]", "show commands or help on one command" }, - { cmd_exit, "exit", NULL, "exit command line" }, - { cmd_exec, "*", " [...]>", "run times" }, - { cmd_failed, "!", " [...]", "run if last command failed" }, - { cmd_echo, "echo", "[...]", "print messages" }, - { cmd_set, "set", " ", "set env variable" }, - { cmd_evl, "evl", " ", "evaluation expresstion" }, - { cmd_test, "test", " ", "test expression: " }, - { cmd_script, "script", "", "run host script " }, - { cmd_abort, "abort", NULL, "abort from the running script" }, - { NULL, NULL, NULL, NULL } -}; - -static struct cli_commandset default_cmdset = { - default_cmds, -}; - -static BOOL match_cmd(const char *src, int start, int end, const char *des) -{ - while (src[start] == ' ' && start < end) - start++; - - while (src[end] == ' ' && start < end) - end--; - - if ((int)strlen(des) == (end - start + 1)) { - if (memcmp(src + start, des, end - start + 1) == 0) { - return TRUE; - } - } - - return FALSE; -} - -static BOOL check_cmd(const char *cmds, const char *cmd) -{ - int start, end; - - for (start = end = 0; cmds[end] != 0 && cmds[end] != '|'; end++); - - while (end > start) { - if (match_cmd(cmds, start, end - 1, cmd) == TRUE) - return TRUE; - if (cmds[end] == 0) - break; - if (cmds[end] == '|') { - end++; - for (start = end; cmds[end] != 0 && cmds[end] != '|'; end++); - } - } - - return FALSE; -} - -static const struct cli_command * cli_find(const char *cmd) -{ - struct cli_commandset *work; - const struct cli_command *s; - - FOR_EACH_CLI_CMD(work, s) { - if (check_cmd(s->cmd, cmd) == TRUE) - return s; - } - - return NULL; -} - -static void show_cmd_usage(const struct cli_command *cmd) -{ - MSG("%s: %s\n", cmd->cmd, cmd->descr); - MSG("Usage: %s %s\n", cmd->cmd, cmd->args ? cmd->args : ""); -} - -static int cmd_help(int argc, char *argv[]) -{ - const struct cli_command *cmd; - struct cli_commandset *cmdset; - int i, n; - - if (argc < 2) { - MSG("Available commands:\n"); - n = 0; - FOR_EACH_CLI_CMD(cmdset, cmd) { - MSG("%s", cmd->cmd); - for (i = strlen(cmd->cmd); i%10; i++, MSG(" ")); - if ((++n % 5) == 0) MSG("\n"); - } - MSG("\n"); - } - else { - cmd = cli_find(argv[1]); - if (cmd == NULL) { - MSG("No such command\n"); - return -1; - } - else { - show_cmd_usage(cmd); - } - } - - return 0; -} - -static void cli_parse_args(const char *cmd, struct cli_arg *arg) -{ - char *p; - int val; - - if (arg) { - arg->argc = 0; - if (cmd) { - p = arg->_buf; - while (*cmd && arg->argc < MAX_CLI_ARGS_NUM && (p - arg->_buf < MAX_CLI_ARGS_BUF_LEN)) { - while(*cmd && (*cmd == ' ' || *cmd == '\t')) - cmd++; - - arg->argv[arg->argc] = p; - while (*cmd && (*cmd != ' ' && *cmd != '\t') && (p - arg->_buf < MAX_CLI_ARGS_BUF_LEN)) { - if (*cmd == '$') { - // command env replacement - cmd++; - val = cli_env_get(*cmd++); - if (p - arg->_buf < MAX_CLI_ARGS_BUF_LEN - 12) { // 12 is long enough for 32bit 'int' - p += sprintf(p, "%d", val & 0xFFFFFFFF); - } - } - else - *p++ = *cmd++; - } - *p++ = '\0'; - - if (*(arg->argv[arg->argc]) == '\0') - break; - arg->argc++; - } - } - } -} - -int cli_interpret(const char *line) -{ - struct cli_arg arg = {0}; - const struct cli_command *cmd; - int ret = -1; - - cli_parse_args(line, &arg); - - if (arg.argc > 0) { - cmd = cli_find(arg.argv[0]); - if (cmd == NULL) { - MSG("Unknown command '%s'\n", arg.argv[0]); - } - else { - ret = cmd->handler(arg.argc, arg.argv); - if (ret == CLI_INVALID_ARG) { - MSG("\n"); - show_cmd_usage(cmd); - } - } - } - - cli_env_set('?', ret); // $? = last command return code - - return ret; -} - -void cli_add_commandset(struct cli_commandset *set) -{ - if (set) { - set->next = m_cmdset_head; - m_cmdset_head = set; - } -} - -void cli_main_entry() -{ - char line[80]; - int linelen = 0; - char *p; - - MSG("$ "); - cli_add_commandset(&default_cmdset); - - while (!m_exit) { - char ch; - if (linelen >= sizeof(line)) - continue; - ch = getc(stdin); - switch (ch) { - case 8: - case 127: - if (linelen > 0) { - --linelen; - MSG("\x08 \x08"); - } - break; - - case '\r': - case '\n': - //MSG("\r\n"); - if (linelen > 0) { - line[linelen] = 0; - p = cli_process_line(line); - if (*p) - cli_interpret(p); - linelen = 0; - } - MSG("$ "); - break; - - case 21: - while (linelen > 0) { - --linelen; - MSG("\x08 \x08"); - } - break; - - default: - if (ch >= ' ' && ch < 127 && linelen < sizeof(line) - 1) { - line[linelen++] = ch; - //MSG("%c", ch); - } - } - } -} diff --git a/components/dfs/filesystems/uffs/src/emu/cmdline.h b/components/dfs/filesystems/uffs/src/emu/cmdline.h deleted file mode 100644 index 284d68eaea..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/cmdline.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - - -#ifndef _UFFS_CLI_H_ -#define _UFFS_CLI_H_ - -#ifndef BOOL -#define BOOL int -#endif - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#define CLI_INVALID_ARG -100 - -typedef int command_t(int argc, char *argv[]); - -struct cli_command { - command_t *handler; - const char *cmd; - const char *args; - const char *descr; -}; - -struct cli_commandset { - const struct cli_command *cmds; - struct cli_commandset *next; -}; - -void cli_add_commandset(struct cli_commandset *set); -int cli_interpret(const char *line); -int cli_env_get(char env); -int cli_env_set(char env, int val); -void cli_main_entry(); - -#define u_assert(x) \ - ((x) ? TRUE : \ - (uffs_PerrorRaw(UFFS_MSG_NORMAL, \ - "Assert failed at %s:%s:%d: '%s' is not true.\n", \ - __FILE__, __FUNCTION__, __LINE__, #x), FALSE)) - - -#define CHK_ARGC(min, max) \ - if (argc < min || (max > 0 && argc > max)) \ - return CLI_INVALID_ARG - -#endif - - diff --git a/components/dfs/filesystems/uffs/src/emu/helper_cmds.c b/components/dfs/filesystems/uffs/src/emu/helper_cmds.c deleted file mode 100644 index 1526c441ca..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/helper_cmds.c +++ /dev/null @@ -1,694 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file helper_cmds.c - * \brief helper commands for test uffs - * \author Ricky Zheng - */ -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_find.h" -#include "cmdline.h" -#include "uffs/uffs_fd.h" -#include "uffs/uffs_mtb.h" -#include "uffs_fileem.h" - -#define PFX "cmd : " - -#define MAX_PATH_LENGTH 128 - -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -/** format [] */ -static int cmd_format(int argc, char *argv[]) -{ - URET ret; - const char *mount = "/"; - uffs_Device *dev; - UBOOL force = U_FALSE; - - if (argc > 1) { - mount = argv[1]; - if (argc > 2 && strcmp(argv[2], "-f") == 0) - force = U_TRUE; - } - MSGLN("Formating %s ... ", mount); - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point."); - return -1; - } - else { - ret = uffs_FormatDevice(dev, force); - if (ret != U_SUCC) { - MSGLN("Format fail."); - return -1; - } - else { - MSGLN("Format succ."); - } - uffs_PutDevice(dev); - } - - return 0; -} - -/** mkf */ -static int cmd_mkf(int argc, char *argv[]) -{ - int fd; - const char *name; - int oflags = UO_RDWR | UO_CREATE; - - CHK_ARGC(2, 2); - - name = argv[1]; - fd = uffs_open(name, oflags); - if (fd < 0) { - MSGLN("Create %s fail, err: %d", name, uffs_get_error()); - return -1; - } - else { - MSGLN("Create %s succ.", name); - uffs_close(fd); - } - - return 0; -} - -/** mkdir */ -static int cmd_mkdir(int argc, char *argv[]) -{ - const char *name; - - CHK_ARGC(2, 0); - - name = argv[1]; - - if (uffs_mkdir(name) < 0) { - MSGLN("Create %s fail, err: %d", name, uffs_get_error()); - return -1; - } - else { - MSGLN("Create %s succ.", name); - } - - return 0; -} - - -static int CountObjectUnder(const char *dir) -{ - int count = 0; - uffs_DIR *dirp; - - dirp = uffs_opendir(dir); - if (dirp) { - while (uffs_readdir(dirp) != NULL) - count++; - uffs_closedir(dirp); - } - return count; -} - -static int cmd_pwd(int argc, char *argv[]) -{ - MSGLN("not supported."); - return 0; -} - -static int cmd_cd(int argc, char *argv[]) -{ - MSGLN("Not supported"); - return 0; -} - -/** ls [] */ -static int cmd_ls(int argc, char *argv[]) -{ - uffs_DIR *dirp; - struct uffs_dirent *ent; - struct uffs_stat stat_buf; - int count = 0; - char buf[MAX_PATH_LENGTH+2]; - const char *name = "/"; - char *sub; - int ret = 0; - - CHK_ARGC(1, 2); - - if (argc > 1) - name = argv[1]; - - dirp = uffs_opendir(name); - if (dirp == NULL) { - MSGLN("Can't open '%s' for list", name); - ret = -1; - } - else { - MSG("------name-----------size---------serial-----" TENDSTR); - ent = uffs_readdir(dirp); - while (ent) { - MSG("%9s", ent->d_name); - strcpy(buf, name); - sub = buf; - if (name[strlen(name)-1] != '/') - sub = strcat(buf, "/"); - sub = strcat(sub, ent->d_name); - if (ent->d_type & FILE_ATTR_DIR) { - sub = strcat(sub, "/"); - MSG("/ \t<%8d>", CountObjectUnder(sub)); - } - else { - uffs_stat(sub, &stat_buf); - MSG(" \t %8d ", stat_buf.st_size); - } - MSG("\t%6d" TENDSTR, ent->d_ino); - count++; - ent = uffs_readdir(dirp); - } - - uffs_closedir(dirp); - - MSG("Total: %d objects." TENDSTR, count); - } - - return ret; -} - -/** rm */ -static int cmd_rm(int argc, char *argv[]) -{ - const char *name = NULL; - int ret = 0; - struct uffs_stat st; - - CHK_ARGC(2, 2); - - name = argv[1]; - - ret = uffs_stat(name, &st); - if (ret < 0) { - MSGLN("Can't stat '%s'", name); - return ret; - } - - if (st.st_mode & US_IFDIR) { - ret = uffs_rmdir(name); - } - else { - ret = uffs_remove(name); - } - - if (ret == 0) - MSGLN("Delete '%s' succ.", name); - else - MSGLN("Delete '%s' fail!", name); - - return ret; -} - -/** ren|mv */ -static int cmd_ren(int argc, char *argv[]) -{ - const char *oldname; - const char *newname; - int ret; - - CHK_ARGC(3, 3); - - oldname = argv[1]; - newname = argv[2]; - - if ((ret = uffs_rename(oldname, newname)) == 0) { - MSGLN("Rename from '%s' to '%s' succ.", oldname, newname); - } - else { - MSGLN("Rename from '%s' to '%s' fail!", oldname, newname); - } - - return ret; -} - -static void dump_msg_to_stdout(struct uffs_DeviceSt *dev, const char *fmt, ...) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - va_list args; - - va_start(args, fmt); - //vprintf(fmt, args); - if (emu && emu->dump_fp) - vfprintf(emu->dump_fp, fmt, args); - va_end(args); -} - -/** dump [] */ -static int cmd_dump(int argc, char *argv[]) -{ - uffs_Device *dev; - uffs_FileEmu *emu; - const char *mount = "/"; - const char *dump_file = "dump.txt"; - - if (argc > 1) { - mount = argv[1]; - if (argc > 2) - dump_file = argv[2]; - } - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point %s", mount); - return -1; - } - - emu = (uffs_FileEmu *)(dev->attr->_private); - emu->dump_fp = fopen(dump_file, "w"); - - uffs_DumpDevice(dev, dump_msg_to_stdout); - - if (emu->dump_fp) - fclose(emu->dump_fp); - - uffs_PutDevice(dev); - - return 0; -} - -/** st [] */ -static int cmd_st(int argc, char *argv[]) -{ - uffs_Device *dev; - const char *mount = "/"; - uffs_FlashStat *s; - TreeNode *node; - - if (argc > 1) { - mount = argv[1]; - } - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point %s", mount); - return -1; - } - - s = &(dev->st); - - MSG("----------- basic info -----------" TENDSTR); - MSG("TreeNode size: %d" TENDSTR, sizeof(TreeNode)); - MSG("TagStore size: %d" TENDSTR, sizeof(struct uffs_TagStoreSt)); - MSG("MaxCachedBlockInfo: %d" TENDSTR, dev->cfg.bc_caches); - MSG("MaxPageBuffers: %d" TENDSTR, dev->cfg.page_buffers); - MSG("MaxDirtyPagesPerBlock: %d" TENDSTR, dev->cfg.dirty_pages); - MSG("MaxPathLength: %d" TENDSTR, MAX_PATH_LENGTH); - MSG("MaxObjectHandles: %d" TENDSTR, MAX_OBJECT_HANDLE); - MSG("FreeObjectHandles: %d" TENDSTR, uffs_GetFreeObjectHandlers()); - MSG("MaxDirHandles: %d" TENDSTR, MAX_DIR_HANDLE); - MSG("FreeDirHandles: %d" TENDSTR, uffs_PoolGetFreeCount(uffs_DirEntryBufGetPool())); - - MSG("----------- statistics for '%s' -----------" TENDSTR, mount); - MSG("Device Ref: %d" TENDSTR, dev->ref_count); - MSG("Block Erased: %d" TENDSTR, s->block_erase_count); - MSG("Write Page: %d" TENDSTR, s->page_write_count); - MSG("Write Spare: %d" TENDSTR, s->spare_write_count); - MSG("Read Page: %d" TENDSTR, s->page_read_count - s->page_header_read_count); - MSG("Read Header: %d" TENDSTR, s->page_header_read_count); - MSG("Read Spare: %d" TENDSTR, s->spare_read_count); - MSG("I/O Read: %lu" TENDSTR, s->io_read); - MSG("I/O Write: %lu" TENDSTR, s->io_write); - - MSG("--------- partition info for '%s' ---------" TENDSTR, mount); - MSG("Space total: %d" TENDSTR, uffs_GetDeviceTotal(dev)); - MSG("Space used: %d" TENDSTR, uffs_GetDeviceUsed(dev)); - MSG("Space free: %d" TENDSTR, uffs_GetDeviceFree(dev)); - MSG("Page Size: %d" TENDSTR, dev->attr->page_data_size); - MSG("Spare Size: %d" TENDSTR, dev->attr->spare_size); - MSG("Pages Per Block: %d" TENDSTR, dev->attr->pages_per_block); - MSG("Block size: %d" TENDSTR, dev->attr->page_data_size * dev->attr->pages_per_block); - MSG("Total blocks: %d of %d" TENDSTR, (dev->par.end - dev->par.start + 1), dev->attr->total_blocks); - if (dev->tree.bad) { - MSG("Bad blocks: "); - node = dev->tree.bad; - while(node) { - MSG("%d, ", node->u.list.block); - node = node->u.list.next; - } - MSG(TENDSTR); - } - - uffs_PutDevice(dev); - - return 0; - -} - -/** cp */ -static int cmd_cp(int argc, char *argv[]) -{ - const char *src; - const char *des; - char buf[100]; - int fd1 = -1, fd2 = -1; - int len; - BOOL src_local = FALSE, des_local = FALSE; - FILE *fp1 = NULL, *fp2 = NULL; - int ret = -1; - - CHK_ARGC(3, 3); - - src = argv[1]; - des = argv[2]; - - if (memcmp(src, "::", 2) == 0) { - src += 2; - src_local = TRUE; - } - if (memcmp(des, "::", 2) == 0) { - des += 2; - des_local = TRUE; - } - - if (src_local) { - if ((fp1 = fopen(src, "rb")) == NULL) { - MSGLN("Can't open %s for copy.", src); - goto fail_ext; - } - } - else { - if ((fd1 = uffs_open(src, UO_RDONLY)) < 0) { - MSGLN("Can't open %s for copy.", src); - goto fail_ext; - } - } - - if (des_local) { - if ((fp2 = fopen(des, "wb")) == NULL) { - MSGLN("Can't open %s for copy.", des); - goto fail_ext; - } - } - else { - if ((fd2 = uffs_open(des, UO_RDWR|UO_CREATE|UO_TRUNC)) < 0) { - MSGLN("Can't open %s for copy.", des); - goto fail_ext; - } - } - - ret = 0; - while ( (src_local ? (feof(fp1) == 0) : (uffs_eof(fd1) == 0)) ) { - ret = -1; - if (src_local) { - len = fread(buf, 1, sizeof(buf), fp1); - } - else { - len = uffs_read(fd1, buf, sizeof(buf)); - } - if (len == 0) { - ret = -1; - break; - } - if (len < 0) { - MSGLN("read file %s fail ?", src); - break; - } - if (des_local) { - if ((int)fwrite(buf, 1, len, fp2) != len) { - MSGLN("write file %s fail ? ", des); - break; - } - } - else { - if (uffs_write(fd2, buf, len) != len) { - MSGLN("write file %s fail ? ", des); - break; - } - } - ret = 0; - } - -fail_ext: - if (fd1 > 0) - uffs_close(fd1); - if (fd2 > 0) - uffs_close(fd2); - if (fp1) - fclose(fp1); - if (fp2) - fclose(fp2); - - return ret; -} - -/** cat [] [] */ -static int cmd_cat(int argc, char *argv[]) -{ - int fd; - const char *name = NULL; - char buf[100]; - int start = 0, size = 0, printed = 0, n, len; - int ret = -1; - - CHK_ARGC(2, 4); - - name = argv[1]; - - if ((fd = uffs_open(name, UO_RDONLY)) < 0) { - MSGLN("Can't open %s", name); - goto fail; - } - - if (argc > 2) { - start = strtol(argv[2], NULL, 10); - if (argc > 3) size = strtol(argv[3], NULL, 10); - } - - if (start >= 0) - uffs_seek(fd, start, USEEK_SET); - else - uffs_seek(fd, -start, USEEK_END); - - while (uffs_eof(fd) == 0) { - len = uffs_read(fd, buf, sizeof(buf) - 1); - if (len == 0) - break; - if (len > 0) { - if (size == 0 || printed < size) { - n = (size == 0 ? len : (size - printed > len ? len : size - printed)); - buf[n] = 0; - MSG("%s", buf); - printed += n; - } - else { - break; - } - } - } - MSG(TENDSTR); - uffs_close(fd); - - ret = 0; -fail: - - return ret; -} - -/** mount partition or show mounted partitions - * mount [] - */ -static int cmd_mount(int argc, char *argv[]) -{ - uffs_MountTable *tab; - const char *mount = NULL; - - if (argc == 1) { - tab = uffs_MtbGetMounted(); - while (tab) { - MSG(" %s : (%d) ~ (%d)\n", tab->mount, tab->start_block, tab->end_block); - tab = tab->next; - } - } - else { - mount = argv[1]; - if (uffs_Mount(mount) < 0) { - MSGLN("Can't mount %s", mount); - return -1; - } - } - return 0; -} - -/** unmount parition or show unmounted partitions - * umount [] - */ -static int cmd_unmount(int argc, char *argv[]) -{ - uffs_MountTable *tab; - const char *mount = NULL; - - if (argc == 1) { - tab = uffs_MtbGetUnMounted(); - while (tab) { - MSG(" %s : (%d) ~ (%d)\n", tab->mount, tab->start_block, tab->end_block); - tab = tab->next; - } - } - else { - mount = argv[1]; - if (uffs_UnMount(mount) < 0) { - MSGLN("Can't unmount %s", mount); - return -1; - } - } - - return 0; -} - -/** inspect buffers - * inspb [] - */ -static int cmd_inspb(int argc, char *argv[]) -{ - uffs_Device *dev; - const char *mount = "/"; - - CHK_ARGC(1, 2); - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point %s", mount); - return -1; - } - uffs_BufInspect(dev); - uffs_PutDevice(dev); - - return 0; - -} - -/** print block wear-leveling information - * wl [] - */ -static int cmd_wl(int argc, char *argv[]) -{ - const char *mount = "/"; - uffs_Device *dev; - struct uffs_PartitionSt *par; - uffs_FileEmu *emu; - int i, max; - u32 n; - -#define NUM_PER_LINE 10 - - CHK_ARGC(1, 2); - - if (argc > 1) { - mount = argv[1]; - } - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point %s", mount); - return -1; - } - - par = &dev->par; - emu = (uffs_FileEmu *)(dev->attr->_private); - max = -1; - - for (i = 0; i < par->end - par->start; i++) { - if ((i % NUM_PER_LINE) == 0) { - MSG("%04d:", i + par->start); - } - n = i + par->start; - max = (max == -1 ? n : - (emu->em_monitor_block[n] > emu->em_monitor_block[max] ? n : max) - ); - MSG(" %4d", emu->em_monitor_block[n]); - if (uffs_TreeFindBadNodeByBlock(dev, n)) - MSG("%c", 'x'); - else if (uffs_TreeFindErasedNodeByBlock(dev, n)) - MSG("%c", ' '); - else - MSG("%c", '.'); - if (((i + 1) % NUM_PER_LINE) == 0) - MSG("\n"); - } - MSG("\n"); - MSG("Total blocks %d, peak erase count %d at block %d\n", - par->end - par->start, max == -1 ? 0 : emu->em_monitor_block[max], max); - - uffs_PutDevice(dev); - - return 0; -} - -static const struct cli_command helper_cmds[] = -{ - { cmd_format, "format", "[]", "Format device" }, - { cmd_mkf, "mkfile", "", "create a new file" }, - { cmd_mkdir, "mkdir", "", "create a new directory" }, - { cmd_rm, "rm", "", "delete file/directory" }, - { cmd_ren, "mv|ren", " ", "rename file/directory" }, - { cmd_ls, "ls", "", "list dirs and files" }, - { cmd_st, "info|st", "", "show statistic infomation" }, - { cmd_cp, "cp", " ", "copy files. the local file name start with '::'" }, - { cmd_cat, "cat", "", "show file content" }, - { cmd_pwd, "pwd", NULL, "show current dir" }, - { cmd_cd, "cd", "", "change current dir" }, - { cmd_mount, "mount", "[]", "mount partition or list mounted partitions" }, - { cmd_unmount, "umount", "[]", "unmount partition" }, - { cmd_dump, "dump", "[]", "dump file system", }, - { cmd_wl, "wl", "[]", "show block wear-leveling info", }, - { cmd_inspb, "inspb", "[]", "inspect buffer", }, - { NULL, NULL, NULL, NULL } -}; - -static struct cli_commandset helper_cmdset = { - helper_cmds, -}; - -struct cli_commandset * get_helper_cmds() -{ - return &helper_cmdset; -}; diff --git a/components/dfs/filesystems/uffs/src/emu/test_cmds.c b/components/dfs/filesystems/uffs/src/emu/test_cmds.c deleted file mode 100644 index a4bc1eca41..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/test_cmds.c +++ /dev/null @@ -1,1186 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file test_cmds.c - * \brief commands for test uffs - * \author Ricky Zheng - */ -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_fd.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_find.h" -#include "uffs/uffs_badblock.h" -#include "cmdline.h" -#include "api_test.h" - -#define PFX "test: " - -#define MAX_TEST_BUF_LEN 8192 - -#define SEQ_INIT 10 -#define SEQ_MOD_LEN 120 - -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - - -static void memcp_seq(void *des, int size, int start_pos) -{ - int i; - u8 *p = (u8 *)des; - - for (i = 0; i < size; i++, p++) { - *p = (start_pos + SEQ_INIT + i) % SEQ_MOD_LEN; - } -} - -static UBOOL check_entry_exist(const char *name) -{ - struct uffs_stat sb; - - return uffs_stat(name, &sb) < 0 ? U_FALSE : U_TRUE; -} - -static URET do_write_test_file(int fd, int size) -{ - long pos; - unsigned char buf[100]; - int len; - - while (size > 0) { - pos = uffs_seek(fd, 0, USEEK_CUR); - len = (size > sizeof(buf) ? sizeof(buf) : size); - memcp_seq(buf, len, pos); - if (uffs_write(fd, buf, len) != len) { - MSGLN("Write file failed, size %d at %d", len, pos); - return U_FAIL; - } - size -= len; - } - - return U_SUCC; -} - -static URET test_write_file(const char *file_name, int pos, int size) -{ - int ret = U_FAIL; - int fd = -1; - - if ((fd = uffs_open(file_name, UO_RDWR|UO_CREATE)) < 0) { - MSGLN("Can't open file %s for write.", file_name); - goto test_exit; - } - - if (uffs_seek(fd, pos, USEEK_SET) != pos) { - MSGLN("Can't seek file %s at pos %d", file_name, pos); - goto test_failed; - } - - if (do_write_test_file(fd, size) == U_FAIL) { - MSGLN("Write file %s failed.", file_name); - goto test_failed; - } - ret = U_SUCC; - -test_failed: - uffs_close(fd); - -test_exit: - - return ret; -} - - -static URET test_verify_file(const char *file_name, UBOOL noecc) -{ - int fd; - int ret = U_FAIL; - unsigned char buf[100]; - int i, pos, len; - u8 x; - - if ((fd = uffs_open(file_name, (noecc ? UO_RDONLY|UO_NOECC : UO_RDONLY))) < 0) { - MSGLN("Can't open file %s for read.", file_name); - goto test_exit; - } - - pos = 0; - while (!uffs_eof(fd)) { - len = uffs_read(fd, buf, sizeof(buf)); - if (len <= 0) - goto test_failed; - for (i = 0; i < len; i++) { - x = (SEQ_INIT + pos + i) % SEQ_MOD_LEN; - if (buf[i] != x) { - MSGLN("Verify file %s failed at: %d, expect 0x%02x but got 0x%02x", file_name, pos + i, x, buf[i]); - goto test_failed; - } - } - pos += len; - } - - if (pos != uffs_seek(fd, 0, USEEK_END)) { - MSGLN("Verify file %s failed. invalid file length.", file_name); - goto test_failed; - } - - MSGLN("Verify file %s succ.", file_name); - ret = U_SUCC; - -test_failed: - uffs_close(fd); - -test_exit: - - return ret; -} - -static URET test_append_file(const char *file_name, int size) -{ - int ret = U_FAIL; - int fd = -1; - - if ((fd = uffs_open(file_name, UO_RDWR|UO_APPEND|UO_CREATE)) < 0) { - MSGLN("Can't open file %s for append.", file_name); - goto test_exit; - } - - uffs_seek(fd, 0, USEEK_END); - - if (do_write_test_file(fd, size) == U_FAIL) { - MSGLN("Write file %s failed.", file_name); - goto test_failed; - } - ret = U_SUCC; - -test_failed: - uffs_close(fd); - -test_exit: - - return ret; -} - - -/* test create file, write file and read back */ -static int cmd_t1(int argc, char *argv[]) -{ - int fd; - URET ret; - char buf[100]; - const char *name; - - if (argc < 2) { - return CLI_INVALID_ARG; - } - - name = argv[1]; - - fd = uffs_open(name, UO_RDWR|UO_CREATE|UO_TRUNC); - if (fd < 0) { - MSGLN("Can't open %s", name); - goto fail; - } - - sprintf(buf, "123456789ABCDEF"); - ret = uffs_write(fd, buf, strlen(buf)); - MSGLN("write %d bytes to file, content: %s", ret, buf); - - ret = uffs_seek(fd, 3, USEEK_SET); - MSGLN("new file position: %d", ret); - - memset(buf, 0, sizeof(buf)); - ret = uffs_read(fd, buf, 5); - MSGLN("read %d bytes, content: %s", ret, buf); - - uffs_close(fd); - - return 0; -fail: - - return -1; -} - - -static URET DoTest2(void) -{ - int fd = -1; - URET ret = U_FAIL; - char buf[100], buf_1[100]; - - fd = uffs_open("/abc/", UO_RDWR|UO_DIR); - if (fd < 0) { - MSGLN("Can't open dir abc, err: %d", uffs_get_error()); - MSGLN("Try to create a new one..."); - fd = uffs_open("/abc/", UO_RDWR|UO_CREATE|UO_DIR); - if (fd < 0) { - MSGLN("Can't create new dir /abc/"); - goto exit_test; - } - else { - uffs_close(fd); - } - } - else { - uffs_close(fd); - } - - fd = uffs_open("/abc/test.txt", UO_RDWR|UO_CREATE); - if (fd < 0) { - MSGLN("Can't open /abc/test.txt"); - goto exit_test; - } - - sprintf(buf, "123456789ABCDEF"); - ret = uffs_write(fd, buf, strlen(buf)); - MSGLN("write %d bytes to file, content: %s", ret, buf); - - ret = uffs_seek(fd, 3, USEEK_SET); - MSGLN("new file position: %d", ret); - - memset(buf_1, 0, sizeof(buf_1)); - ret = uffs_read(fd, buf_1, 5); - MSGLN("read %d bytes, content: %s", ret, buf_1); - - if (memcmp(buf + 3, buf_1, 5) != 0) { - ret = U_FAIL; - } - else { - ret = U_SUCC; - } - - uffs_close(fd); - -exit_test: - - return ret; -} - - -static int cmd_t2(int argc, char *argv[]) -{ - URET ret; - MSGLN("Test return: %s !", (ret = DoTest2()) == U_SUCC ? "succ" : "failed"); - - return (ret == U_SUCC) ? 0 : -1; -} - - -static int cmd_VerifyFile(int argc, char *argv[]) -{ - const char *name; - UBOOL noecc = U_FALSE; - - if (argc < 2) { - return CLI_INVALID_ARG; - } - - name = argv[1]; - if (argc > 2 && strcmp(argv[2], "noecc") == 0) { - noecc = U_TRUE; - } - - MSGLN("Check file %s ... ", name); - if (test_verify_file(name, noecc) != U_SUCC) { - MSGLN("Verify file %s failed.", name); - return -1; - } - - return 0; -} - -/* Test file append and 'random' write */ -static int cmd_t3(int argc, char *argv[]) -{ - const char *name; - int i; - UBOOL noecc = U_FALSE; - int write_test_seq[] = { 20, 10, 500, 40, 1140, 900, 329, 4560, 352, 1100 }; - - if (argc < 2) { - return CLI_INVALID_ARG; - } - - name = argv[1]; - if (argv[2] && strcmp(argv[2], "noecc") == 0) { - noecc = U_TRUE; - } - - if (check_entry_exist(name)) { - MSGLN("Check file %s ... ", name); - if (test_verify_file(name, noecc) != U_SUCC) { - MSGLN("Verify file %s failed.", name); - return -1; - } - } - - MSGLN("Test append file %s ...", name); - for (i = 1; i < 500; i += 29) { - if (test_append_file(name, i) != U_SUCC) { - MSGLN("Append file %s test failed at %d !", name, i); - return -1; - } - } - - MSGLN("Check file %s ... ", name); - if (test_verify_file(name, noecc) != U_SUCC) { - MSGLN("Verify file %s failed.", name); - return -1; - } - - MSGLN("Test write file ..."); - for (i = 0; i < sizeof(write_test_seq) / sizeof(int) - 1; i++) { - if (test_write_file(name, write_test_seq[i], write_test_seq[i+1]) != U_SUCC) { - MSGLN("Test write file failed !"); - return -1; - } - } - - MSGLN("Check file %s ... ", name); - if (test_verify_file(name, noecc) != U_SUCC) { - MSGLN("Verify file %s failed.", name); - return -1; - } - - MSGLN("Test succ !"); - - return 0; -} - -/* open two files and test write */ -static int cmd_t4(int argc, char *argv[]) -{ - int fd1 = -1, fd2 = -1; - - MSGLN("open /a ..."); - if ((fd1 = uffs_open("/a", UO_RDWR | UO_CREATE)) < 0) { - MSGLN("Can't open /a"); - goto fail_exit; - } - - MSGLN("open /b ..."); - if ((fd2 = uffs_open("/b", UO_RDWR | UO_CREATE)) < 0) { - MSGLN("Can't open /b"); - uffs_close(fd1); - goto fail_exit; - } - - MSGLN("write (1) to /a ..."); - uffs_write(fd1, "Hello,", 6); - MSGLN("write (1) to /b ..."); - uffs_write(fd2, "Hello,", 6); - MSGLN("write (2) to /a ..."); - uffs_write(fd1, "World.", 6); - MSGLN("write (2) to /b ..."); - uffs_write(fd2, "World.", 6); - MSGLN("close /a ..."); - uffs_close(fd1); - MSGLN("close /b ..."); - uffs_close(fd2); - - return 0; - -fail_exit: - return -1; -} - -/* test appending file */ -static int cmd_t5(int argc, char *argv[]) -{ - int fd = -1; - URET ret; - char buf[100]; - const char *name; - - if (argc < 2) { - return CLI_INVALID_ARG; - } - - name = argv[1]; - - fd = uffs_open(name, UO_RDWR|UO_APPEND); - if (fd < 0) { - MSGLN("Can't open %s", name); - goto fail; - } - - sprintf(buf, "append test..."); - ret = uffs_write(fd, buf, strlen(buf)); - if (ret != strlen(buf)) { - MSGLN("write file failed, %d/%d", ret, strlen(buf)); - ret = -1; - } - else { - MSGLN("write %d bytes to file, content: %s", ret, buf); - ret = 0; - } - - uffs_close(fd); - - return ret; -fail: - return -1; -} - - -/* usage: t_pgrw - * - * This test case test page read/write - */ -static int cmd_TestPageReadWrite(int argc, char *argv[]) -{ - TreeNode *node = NULL; - uffs_Device *dev; - uffs_Tags local_tag; - uffs_Tags *tag = &local_tag; - int ret; - u16 block; - u16 page; - uffs_Buf *buf = NULL; - - u32 i; - int rc = -1; - - dev = uffs_GetDeviceFromMountPoint("/"); - if (!dev) - goto ext; - - buf = uffs_BufClone(dev, NULL); - if (!buf) - goto ext; - - node = uffs_TreeGetErasedNode(dev); - if (!node) { - MSGLN("no free block ?"); - goto ext; - } - - for (i = 0; i < dev->com.pg_data_size; i++) { - buf->data[i] = i & 0xFF; - } - - block = node->u.list.block; - page = 1; - - TAG_DIRTY_BIT(tag) = TAG_DIRTY; - TAG_VALID_BIT(tag) = TAG_VALID; - TAG_DATA_LEN(tag) = dev->com.pg_data_size; - TAG_TYPE(tag) = UFFS_TYPE_DATA; - TAG_PAGE_ID(tag) = 3; - TAG_PARENT(tag) = 100; - TAG_SERIAL(tag) = 10; - TAG_BLOCK_TS(tag) = 1; - SEAL_TAG(tag); - - ret = uffs_FlashWritePageCombine(dev, block, page, buf, tag); - if (UFFS_FLASH_HAVE_ERR(ret)) { - MSGLN("Write page error: %d", ret); - goto ext; - } - - ret = uffs_FlashReadPage(dev, block, page, buf, U_FALSE); - if (UFFS_FLASH_HAVE_ERR(ret)) { - MSGLN("Read page error: %d", ret); - goto ext; - } - - for (i = 0; i < dev->com.pg_data_size; i++) { - if (buf->data[i] != (i & 0xFF)) { - MSGLN("Data verify fail at: %d", i); - goto ext; - } - } - - ret = uffs_FlashReadPageTag(dev, block, page, tag); - if (UFFS_FLASH_HAVE_ERR(ret)) { - MSGLN("Read tag (page spare) error: %d", ret); - goto ext; - } - - // verify tag: - if (!TAG_IS_SEALED(tag)) { - MSGLN("not sealed ? Tag verify fail!"); - goto ext; - } - - if (!TAG_IS_DIRTY(tag)) { - MSGLN("not dirty ? Tag verify fail!"); - goto ext; - } - - if (!TAG_IS_VALID(tag)) { - MSGLN("not valid ? Tag verify fail!"); - goto ext; - } - - if (TAG_DATA_LEN(tag) != dev->com.pg_data_size || - TAG_TYPE(tag) != UFFS_TYPE_DATA || - TAG_PAGE_ID(tag) != 3 || - TAG_PARENT(tag) != 100 || - TAG_SERIAL(tag) != 10 || - TAG_BLOCK_TS(tag) != 1) { - - MSGLN("Tag verify fail!"); - goto ext; - } - - MSGLN("Page read/write test succ."); - rc = 0; - -ext: - if (node) { - uffs_FlashEraseBlock(dev, node->u.list.block); - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, node); - else - uffs_TreeInsertToErasedListTail(dev, node); - } - - if (dev) - uffs_PutDevice(dev); - - if (buf) - uffs_BufFreeClone(dev, buf); - - return rc; -} - -/* t_format : test format partition */ -static int cmd_TestFormat(int argc, char *argv[]) -{ - URET ret; - const char *mount = "/"; - uffs_Device *dev; - UBOOL force = U_FALSE; - const char *test_file = "/a.txt"; - int fd; - int rc = -1; - - if (argc > 1) { - mount = argv[1]; - if (argc > 2 && strcmp(argv[2], "-f") == 0) - force = U_TRUE; - } - - fd = uffs_open(test_file, UO_RDWR | UO_CREATE); - if (fd < 0) { - MSGLN("can't create test file %s", test_file); - goto ext; - } - - MSGLN("Formating %s ... ", mount); - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point."); - goto ext; - } - else { - ret = uffs_FormatDevice(dev, force); - if (ret != U_SUCC) { - MSGLN("Format fail."); - } - else { - MSGLN("Format succ."); - rc = 0; - } - uffs_PutDevice(dev); - } - - uffs_close(fd); // this should fail on signature check ! -ext: - return rc; -} - - - -/** - * usage: t_pfs - * - * for example: t_pfs /x/ 100 - * - * This test case performs: - * 1) create files under , write full file name as file content - * 2) list files under , check files are all listed once - * 3) check file content aganist file name - * 4) delete files on success - */ -static int cmd_TestPopulateFiles(int argc, char *argv[]) -{ - const char *start = "/"; - int count = 80; - int i, fd, num; - char name[128]; - char buf[128]; - uffs_DIR *dirp; - struct uffs_dirent *ent; - unsigned long bitmap[50] = {0}; // one bit per file, maximu 32*50 = 1600 files - UBOOL succ = U_TRUE; - -#define SBIT(n) bitmap[(n)/(sizeof(bitmap[0]) * 8)] |= (1 << ((n) % (sizeof(bitmap[0]) * 8))) -#define GBIT(n) (bitmap[(n)/(sizeof(bitmap[0]) * 8)] & (1 << ((n) % (sizeof(bitmap[0]) * 8)))) - - if (argc > 1) { - start = argv[1]; - if (argc > 2) { - count = strtol(argv[2], NULL, 10); - } - } - - if (count > sizeof(bitmap) * 8) - count = sizeof(bitmap) * 8; - - for (i = 0, fd = -1; i < count; i++) { - sprintf(name, "%sFile%03d", start, i); - fd = uffs_open(name, UO_RDWR|UO_CREATE|UO_TRUNC); - if (fd < 0) { - MSGLN("Create file %s failed", name); - break; - } - if (uffs_write(fd, name, strlen(name)) != strlen(name)) { // write full path name to file - MSGLN("Write to file %s failed", name); - uffs_close(fd); - break; - } - uffs_close(fd); - } - - if (i < count) { - // not success, need to clean up - for (; i >= 0; i--) { - sprintf(name, "%sFile%03d", start, i); - if (uffs_remove(name) < 0) - MSGLN("Delete file %s failed", name); - } - succ = U_FALSE; - goto ext; - } - - MSGLN("%d files created.", count); - - // list files - dirp = uffs_opendir(start); - if (dirp == NULL) { - MSGLN("Can't open dir %s !", start); - succ = U_FALSE; - goto ext; - } - ent = uffs_readdir(dirp); - while (ent && succ) { - - if (!(ent->d_type & FILE_ATTR_DIR) && // not a dir - ent->d_namelen == strlen("File000") && // check file name length - memcmp(ent->d_name, "File", strlen("File")) == 0) { // file name start with "File" - - MSGLN("List entry %s", ent->d_name); - - num = strtol(ent->d_name + 4, NULL, 10); - if (GBIT(num)) { - // file already listed ? - MSGLN("File %d listed twice !", ent->d_name); - succ = U_FALSE; - break; - } - SBIT(num); - - // check file content - sprintf(name, "%s%s", start, ent->d_name); - fd = uffs_open(name, UO_RDONLY); - if (fd < 0) { - MSGLN("Open file %d for read failed !", name); - } - else { - memset(buf, 0, sizeof(buf)); - num = uffs_read(fd, buf, sizeof(buf)); - if (num != strlen(name)) { - MSGLN("%s Read data length expect %d but got %d !", name, strlen(name), num); - succ = U_FALSE; - } - else { - if (memcmp(name, buf, num) != 0) { - MSGLN("File %s have wrong content '%s' !", name, buf); - succ = U_FALSE; - } - } - uffs_close(fd); - } - } - ent = uffs_readdir(dirp); - } - uffs_closedir(dirp); - - // check absent files - for (i = 0; i < count; i++) { - if (GBIT(i) == 0) { - sprintf(name, "%sFile%03d", start, i); - MSGLN("File %s not listed !", name); - succ = U_FALSE; - } - } - - // delete files if pass the test - for (i = 0; succ && i < count; i++) { - sprintf(name, "%sFile%03d", start, i); - if (uffs_remove(name) < 0) { - MSGLN("Delete file %s failed", name); - succ = U_FALSE; - } - } - -ext: - MSGLN("Populate files test %s !", succ ? "SUCC" : "FAILED"); - return succ ? 0 : -1; - -} - -/** - * Open with , save fd to $1 - * - * t_open - */ -static int cmd_topen(int argc, char *argv[]) -{ - int fd; - const char *name; - char *p; - int oflag = 0; - - CHK_ARGC(3, 3); - - name = argv[2]; - p = argv[1]; - while(*p) { - switch(*p++) { - case 'a': - oflag |= UO_APPEND; - break; - case 'c': - oflag |= UO_CREATE; - break; - case 't': - oflag |= UO_TRUNC; - break; - case 'w': - oflag |= UO_RDWR; - break; - case 'r': - oflag |= UO_RDONLY; - break; - } - } - - fd = uffs_open(name, oflag); - - if (fd >= 0) { - cli_env_set('1', fd); - return 0; - } - else { - return -1; - } -} - -/** - * seek file pointer - * t_seek [] - * if success, $1 = file position after seek - */ -static int cmd_tseek(int argc, char *argv[]) -{ - int origin = USEEK_SET; - int offset; - int fd; - int ret; - - CHK_ARGC(3, 4); - - if (sscanf(argv[1], "%d", &fd) != 1 || - sscanf(argv[2], "%d", &offset) != 1) - { - return CLI_INVALID_ARG; - } - - if (argc > 3) { - switch(argv[3][0]) { - case 's': - origin = USEEK_SET; - break; - case 'c': - origin = USEEK_CUR; - break; - case 'e': - origin = USEEK_END; - break; - default: - return CLI_INVALID_ARG; - } - } - - ret = uffs_seek(fd, offset, origin); - if (ret >= 0) { - cli_env_set('1', ret); - return 0; - } - else { - return -1; - } -} - -/** - * close file - * t_close - */ -static int cmd_tclose(int argc, char *argv[]) -{ - int fd; - - CHK_ARGC(2, 2); - - if (sscanf(argv[1], "%d", &fd) == 1) { - return uffs_close(fd); - } - else - return -1; -} - -/** - * write file - * t_write [..] - */ -static int cmd_twrite(int argc, char *argv[]) -{ - int fd; - int i, len = 0; - int ret = 0; - - CHK_ARGC(3, 0); - if (sscanf(argv[1], "%d", &fd) != 1) { - return -1; - } - else { - for (i = 2; i < argc; i++) { - len = strlen(argv[i]); - if (uffs_write(fd, argv[i], len) != len) { - ret = -1; - break; - } - } - } - - if (ret == 0) - cli_env_set('1', len); - - return ret; -} - -/** - * read and check seq file - * t_check_seq - */ -static int cmd_tcheck_seq(int argc, char *argv[]) -{ - int fd; - int len, size; - int ret = 0, r_ret = 0; - long pos; - u8 buf[MAX_TEST_BUF_LEN]; - int i; - u8 x; - - CHK_ARGC(3, 3); - - if (sscanf(argv[1], "%d", &fd) != 1) { - return -1; - } - - if (sscanf(argv[2], "%d", &len) != 1) { - return -1; - } - - pos = uffs_tell(fd); - while (len > 0) { - size = (len > sizeof(buf) ? sizeof(buf) : len); - if ((r_ret = uffs_read(fd, buf, size)) < 0) { - MSGLN("Read fail! fd = %d, size = %d, pos = %ld", fd, size, pos); - ret = -1; - break; - } - - // check seq - for (i = 0; i < r_ret; i++) { - x = (pos + SEQ_INIT + i) % SEQ_MOD_LEN; - if (buf[i] != x) { - MSGLN("Check fail! fd = %d, pos = %ld (expect 0x%02x but 0x%02x)\n", fd, pos + i, x, buf[i]); - ret = -1; - break; - } - } - - if (ret < 0) - break; - - len -= r_ret; - pos += r_ret; - } - - return ret; -} - - - -/** - * write random seq to file - * t_write_seq - */ -static int cmd_twrite_seq(int argc, char *argv[]) -{ - int fd; - int len = 0, size = 0; - long pos = 0; - int ret = 0, w_ret = 0; - u8 buf[MAX_TEST_BUF_LEN]; - - CHK_ARGC(3, 3); - if (sscanf(argv[1], "%d", &fd) != 1) { - return -1; - } - - if (sscanf(argv[2], "%d", &len) != 1) { - return -1; - } - - pos = uffs_tell(fd); - while (len > 0) { - size = (len < sizeof(buf) ? len : sizeof(buf)); - memcp_seq(buf, size, pos); - if ((w_ret = uffs_write(fd, buf, size)) < 0) { - MSGLN("write fail! fd = %d, size = %d, pos = %ld", fd, size, pos); - ret = -1; - break; - } - pos += w_ret; - len -= w_ret; - } - - if (ret == 0) - cli_env_set('1', len); - - return ret; -} - - -/** - * read and check file - * t_read - */ -static int cmd_tread(int argc, char *argv[]) -{ - int fd; - int len, n; - int ret = 0; - char buf[64]; - char *p; - - CHK_ARGC(3, 3); - - if (sscanf(argv[1], "%d", &fd) != 1) { - return -1; - } - else { - len = strlen(argv[2]); - n = 0; - p = argv[2]; - while (n < len) { - n = (len > sizeof(buf) ? sizeof(buf) : len); - if (uffs_read(fd, buf, n) != n || - memcmp(buf, p, n) != 0) { - ret = -1; - break; - } - len -= n; - p += n; - } - } - - return ret; -} - - -static void do_dump_page(uffs_Device *dev, uffs_Buf *buf) -{ - int i, j; - const int line = 16; - struct uffs_MiniHeaderSt *header = (struct uffs_MiniHeaderSt *)buf->header; - MSG(" header.status = %d\n", header->status); - if (header->status != 0xFF) { - for (i = 0; i < 64; i += line) { - MSG(" "); - for (j = 0; j < line; j++) - MSG("%02X ", buf->header[i+j]); - MSG("\n"); - } - MSG("\n"); - } -} - -static void do_dump_tag(uffs_Device *dev, uffs_Tags *tag) -{ - MSG(" tag sealed: %s\n", TAG_IS_SEALED(tag) ? "yes" : "no"); - if (TAG_IS_GOOD(tag)) { - if (TAG_IS_DIRTY(tag)) { - MSG(" block_ts = %d\n", tag->s.block_ts); - MSG(" type = %d\n", tag->s.type); - MSG(" dirty = %d\n", tag->s.dirty); - MSG(" page_id = %d\n", tag->s.page_id); - MSG(" serial = %d\n", tag->s.serial); - MSG(" parent = %d\n", tag->s.parent); - MSG(" data_len = %d\n", tag->s.data_len); - } - else { - MSG(" tag is GOOD but NOT DIRTY !!!???\n"); - } - } - else if (TAG_IS_SEALED(tag)) { - MSG(" tag is INVALID\n"); - } -} - -static void do_dump_device(uffs_Device *dev) -{ - URET ret; - int block, page; - uffs_Tags tag; - uffs_Buf *buf; - - buf = uffs_BufClone(dev, NULL); - if (buf == NULL) { - MSGLN("Can't clone buf"); - return; - } - - for (block = dev->par.start; block <= dev->par.end; block++) { - MSG("---- block %d ----\n", block); - for (page = 0; page < dev->attr->pages_per_block; page++) { - MSG(" == page %d ==\n", page); - ret = uffs_FlashReadPage(dev, block, page, buf, U_FALSE); - if (UFFS_FLASH_HAVE_ERR(ret)) { - MSG(" !!! Read page failed, ret = %d !!!\n", ret); - } - else { - do_dump_page(dev, buf); - if (buf->header[0] != 0xFF) { - ret = uffs_FlashReadPageTag(dev, block, page, &tag); - if (UFFS_FLASH_HAVE_ERR(ret)) { - MSG(" !!! Read TAG failed, ret = %d !!!\n", ret); - } - else { - do_dump_tag(dev, &tag); - } - } - } - } - } - uffs_BufFreeClone(dev, buf); -} - -static int cmd_dump(int argc, char *argv[]) -{ - const char *mount = "/"; - uffs_Device *dev; - - if (argc > 1) { - mount = argv[1]; - } - - MSGLN("Dumping %s ... ", mount); - - dev = uffs_GetDeviceFromMountPoint(mount); - if (dev == NULL) { - MSGLN("Can't get device from mount point."); - } - else { - do_dump_device(dev); - uffs_PutDevice(dev); - } - - return 0; -} - -static int cmd_apisrv(int argc, char *argv[]) -{ - return api_server_start(); -} - -static const struct cli_command test_cmds[] = -{ - { cmd_t1, "t1", "", "test 1" }, - { cmd_t2, "t2", NULL, "test 2" }, - { cmd_t3, "t3", " []", "test 3" }, - { cmd_t4, "t4", NULL, "test 4" }, - { cmd_t5, "t5", "", "test 5" }, - { cmd_TestPageReadWrite, "t_pgrw", NULL, "test page read/write" }, - { cmd_TestFormat, "t_format", NULL, "test format file system" }, - { cmd_TestPopulateFiles, "t_pfs", "[ []]", "test populate files under " }, - { cmd_VerifyFile, "t_vf", " []", "verify file" }, - - { cmd_topen, "t_open", " ", "open file, fd save to $1", }, - { cmd_tread, "t_read", " ", "read and check against ", }, - { cmd_tcheck_seq, "t_check_seq", " ", "read seq file and check", }, - { cmd_twrite, "t_write", " [...]", "write ", }, - { cmd_twrite_seq, "t_write_seq", " ", "write seq file ", }, - { cmd_tseek, "t_seek", " []", "seek file pointer to from ", }, - { cmd_tclose, "t_close", "", "close ", }, - { cmd_dump, "dump", "", "dump ", }, - - { cmd_apisrv, "apisrv", NULL, "start API test server", }, - - { NULL, NULL, NULL, NULL } -}; - -static struct cli_commandset test_cmdset = { - test_cmds, -}; - -struct cli_commandset * get_test_cmds() -{ - return &test_cmdset; -}; - - - diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem.c b/components/dfs/filesystems/uffs/src/emu/uffs_fileem.c deleted file mode 100644 index 1f66cdf846..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem.c - * \brief emulate uffs file system - * \author Ricky Zheng, created 9th May, 2005 - */ - - -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs_fileem.h" - -#define PFX "femu: " -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - - -static struct uffs_StorageAttrSt g_femu_storage = {0}; - -static struct uffs_FileEmuSt g_femu_private = {0}; - - -struct uffs_StorageAttrSt * femu_GetStorage() -{ - return &g_femu_storage; -} - -struct uffs_FileEmuSt *femu_GetPrivate() -{ - return &g_femu_private; -} - -URET femu_InitDevice(uffs_Device *dev) -{ - uffs_FileEmu *emu = femu_GetPrivate(); - - // setup device storage attr and private data structure. - // all femu partition share one storage attribute - - dev->attr = femu_GetStorage(); - dev->attr->_private = (void *) emu; - - // setup flash driver operations, according to the ecc option. - switch(dev->attr->ecc_opt) { - case UFFS_ECC_NONE: - case UFFS_ECC_SOFT: - dev->ops = &g_femu_ops_ecc_soft; - break; - case UFFS_ECC_HW: - dev->ops = &g_femu_ops_ecc_hw; - break; - case UFFS_ECC_HW_AUTO: - dev->ops = &g_femu_ops_ecc_hw_auto; - break; - default: - break; - } - -#ifdef UFFS_FEMU_ENABLE_INJECTION - // setup wrap functions, for inject ECC errors, etc. - // check wrap_inited so that multiple devices can share the same driver - if (!emu->wrap_inited) { - femu_setup_wrapper_functions(dev); - emu->wrap_inited = U_TRUE; - } -#endif - - return U_SUCC; -} - -/* Nothing to do here */ -URET femu_ReleaseDevice(uffs_Device *dev) -{ - return U_SUCC; -} - - -///////////////////////////////////////////////////////////////////////////////// diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem.h b/components/dfs/filesystems/uffs/src/emu/uffs_fileem.h deleted file mode 100644 index 8be7f3e838..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem.h - * \brief Emulate NAND flash with host file. - * \author Ricky Zheng - */ - -#ifndef _UFFS_FILEEM_H_ -#define _UFFS_FILEEM_H_ - -#include "uffs/uffs_device.h" - -#define UFFS_FEMU_FILE_NAME "uffsemfile.bin" - -#define UFFS_FEMU_MAX_BLOCKS (1024 * 16) // maximum 16K blocks - -#define UFFS_FEMU_ENABLE_INJECTION // enable bad block & ecc error injection - -extern struct uffs_FlashOpsSt g_femu_ops_ecc_soft; // for software ECC or no ECC. -extern struct uffs_FlashOpsSt g_femu_ops_ecc_hw; // for hardware ECC -extern struct uffs_FlashOpsSt g_femu_ops_ecc_hw_auto; // for auto hardware ECC - -#define PAGE_DATA_WRITE_COUNT_LIMIT 1 -#define PAGE_SPARE_WRITE_COUNT_LIMIT 1 - -typedef struct uffs_FileEmuSt { - int initCount; - FILE *fp; - FILE *dump_fp; - u8 *em_monitor_page; // page write monitor - u8 * em_monitor_spare; // spare write monitor - u32 *em_monitor_block; // block erease monitor - const char *emu_filename; -#ifdef UFFS_FEMU_ENABLE_INJECTION - struct uffs_FlashOpsSt ops_orig; - UBOOL wrap_inited; -#endif -} uffs_FileEmu; - -/* file emulator device init/release entry */ -URET femu_InitDevice(uffs_Device *dev); -URET femu_ReleaseDevice(uffs_Device *dev); - -struct uffs_StorageAttrSt * femu_GetStorage(void); -struct uffs_FileEmuSt * femu_GetPrivate(void); - -#ifdef UFFS_FEMU_ENABLE_INJECTION -void femu_setup_wrapper_functions(uffs_Device *dev); -#endif - -/* internal used functions, shared by all ecc option implementations */ -int femu_InitFlash(uffs_Device *dev); -int femu_ReleaseFlash(uffs_Device *dev); -int femu_EraseBlock(uffs_Device *dev, u32 blockNumber); - -#endif - diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw.c b/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw.c deleted file mode 100644 index c7781ebe66..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2010 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem_ecc_hw.c - * \brief emulate uffs file system for hardware ECC. - * - * In this emulator, we call 'uffs_FlashMakeSpare()' to do the layout job - * and call 'uffs_EccMake()' to calculate ECC. - * - * \author Ricky Zheng @ Oct, 2010 - */ - -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs_fileem.h" -#include "uffs/uffs_ecc.h" - -#define PFX "femu: " -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -static int femu_hw_WritePageWithLayout(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *ecc, const uffs_TagStore *ts) -{ - int written; - int abs_page; - int full_page_size; - uffs_FileEmu *emu; - struct uffs_StorageAttrSt *attr = dev->attr; - u8 spare[UFFS_MAX_SPARE_SIZE]; - u8 ecc_buf[UFFS_MAX_ECC_SIZE]; - int spare_len; - - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (!emu || !(emu->fp)) { - goto err; - } - - abs_page = attr->pages_per_block * block + page; - full_page_size = attr->page_data_size + attr->spare_size; - - if (data && data_len > 0) { - if (data_len > attr->page_data_size) - goto err; - - emu->em_monitor_page[abs_page]++; - if (emu->em_monitor_page[abs_page] > PAGE_DATA_WRITE_COUNT_LIMIT) { - MSG("Warrning: block %d page %d exceed it's maximum write time!", block, page); - goto err; - } - - fseek(emu->fp, abs_page * full_page_size, SEEK_SET); - - written = fwrite(data, 1, data_len, emu->fp); - - if (written != data_len) { - MSG("write page I/O error ?"); - goto err; - } - - dev->st.page_write_count++; - dev->st.io_write += written; - - } - - if (ts) { - - emu->em_monitor_spare[abs_page]++; - if (emu->em_monitor_spare[abs_page] > PAGE_SPARE_WRITE_COUNT_LIMIT) { - MSG("Warrning: block %d page %d (spare) exceed it's maximum write time!", block, page); - goto err; - } - - if (!uffs_Assert(data != NULL, "BUG: Write spare without data ?")) - goto err; - - uffs_EccMake(data, data_len, ecc_buf); - uffs_FlashMakeSpare(dev, ts, ecc_buf, spare); - spare_len = dev->mem.spare_data_size; - - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size, SEEK_SET); - written = fwrite(spare, 1, spare_len, emu->fp); - if (written != spare_len) { - MSG("write spare I/O error ?"); - goto err; - } - - dev->st.spare_write_count++; - dev->st.io_write += written; - } - - if (data == NULL && ts == NULL) { - // mark bad block - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size + attr->block_status_offs, SEEK_SET); - written = fwrite("\0", 1, 1, emu->fp); - if (written != 1) { - MSG("write bad block mark I/O error ?"); - goto err; - } - dev->st.io_write++; - } - - fflush(emu->fp); - return UFFS_FLASH_NO_ERR; -err: - fflush(emu->fp); - return UFFS_FLASH_IO_ERR; -} - - -static URET femu_hw_ReadPageWithLayout(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc, - uffs_TagStore *ts, u8 *ecc_store) -{ - int nread; - uffs_FileEmu *emu; - int abs_page; - int full_page_size; - struct uffs_StorageAttrSt *attr = dev->attr; - unsigned char status; - u8 spare[UFFS_MAX_SPARE_SIZE]; - int spare_len; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (!emu || !(emu->fp)) { - goto err; - } - - abs_page = attr->pages_per_block * block + page; - full_page_size = attr->page_data_size + attr->spare_size; - - if (data && data_len > 0) { - if (data_len > attr->page_data_size) - goto err; - - fseek(emu->fp, abs_page * full_page_size, SEEK_SET); - nread = fread(data, 1, data_len, emu->fp); - - if (nread != data_len) { - MSG("read page I/O error ?"); - goto err; - } - dev->st.io_read += nread; - dev->st.page_read_count++; - - if (ecc) { - // calculate ECC for data - uffs_EccMake(data, data_len, ecc); - } - } - - if (ts) { - - spare_len = dev->mem.spare_data_size; - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size, SEEK_SET); - nread = fread(spare, 1, spare_len, emu->fp); - - if (nread != spare_len) { - MSG("read page spare I/O error ?"); - goto err; - } - - // unload ts and ecc from spare - uffs_FlashUnloadSpare(dev, spare, ts, ecc_store); - - dev->st.io_read += nread; - dev->st.spare_read_count++; - } - - if (data == NULL && ts == NULL) { - // read bad block mark - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size + attr->block_status_offs, SEEK_SET); - nread = fread(&status, 1, 1, emu->fp); - - if (nread != 1) { - MSG("read badblock mark I/O error ?"); - goto err; - } - dev->st.io_read++; - - return status == 0xFF ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; - } - - return UFFS_FLASH_NO_ERR; -err: - return UFFS_FLASH_IO_ERR; -} - - -uffs_FlashOps g_femu_ops_ecc_hw = { - femu_InitFlash, // InitFlash() - femu_ReleaseFlash, // ReleaseFlash() - NULL, // ReadPage() - femu_hw_ReadPageWithLayout, // ReadPageWithLayout() - NULL, // WritePage() - femu_hw_WritePageWithLayout,// WritePageWithLayout() - NULL, // IsBadBlock(), let UFFS take care of it. - NULL, // MarkBadBlock(), let UFFS take care of it. - femu_EraseBlock, // EraseBlock() -}; diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw_auto.c b/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw_auto.c deleted file mode 100644 index 31fbb28c95..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_hw_auto.c +++ /dev/null @@ -1,356 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2010 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem_ecc_hw_auto.c - * - * \brief Emulate uffs file system for auto hardware ECC or RS error collection. - * - * This emulator emulate LPC32x0 MLC NAND controller which generate 10 bytes - * Reed-Solomon error correction code (RS-ECC) for every 518 bytes data. - * - * For small page MLC have 16 bytes spare area leves only 6 bytes for 'meta-data', - * no enough room for UFFS's 8 bytes tag and bad block mark. For this reason, - * we adjust page data/spare boundary to 508/20. - * - * This emulator does not calculate real RS-ECC code, instead, we use software ECC - * to calculate 6 bytes ECC code, so this solution does not have the same error - * correcting cabability of RS-ECC. - * - * Note: the MLC controller strictly require sequencial access to serial data buffer. - * - * \author Ricky Zheng @ Oct, 2010 - */ - -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_ecc.h" -#include "uffs_fileem.h" - -#define PFX "femu: " -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -#define RS_ECC_SIZE 10 -#define PAGE_DATA_SIZE 508 -#define PAGE_SPARE_SIZE 20 -#define PAGE_FULL_SIZE (PAGE_DATA_SIZE + PAGE_SPARE_SIZE) -static u8 g_sdata_buf[PAGE_FULL_SIZE]; // emulating LPC32x0's 528-bytes serial data buffer - -static int g_sdata_buf_pointer = 0; - -static void start_sdata_access() -{ - g_sdata_buf_pointer = 0; -} - -static void feed_sdata(const u8 *data, int len) -{ - if (!uffs_Assert(g_sdata_buf_pointer + len <= sizeof(g_sdata_buf), "BUG: Serial Data Buffer overflow !!")) - return; - - if (data) - memcpy(g_sdata_buf + g_sdata_buf_pointer, data, len); - g_sdata_buf_pointer += len; -} - -static void feed_sdata_constant(u8 val, int num) -{ - if (!uffs_Assert(g_sdata_buf_pointer + num <= sizeof(g_sdata_buf), "BUG: Serial Data Buffer overflow !!")) - return; - - memset(g_sdata_buf + g_sdata_buf_pointer, val, num); - g_sdata_buf_pointer += num; -} - -static void drain_sdata(u8 *data, int len) -{ - if (!uffs_Assert( (int)sizeof(g_sdata_buf) - g_sdata_buf_pointer >= len, "BUG: Serial Data Buffer overdrain !!")) - return; - - if (data) - memcpy(data, g_sdata_buf + g_sdata_buf_pointer, len); - g_sdata_buf_pointer += len; -} - -static int load_sdata(uffs_Device *dev, int block, int page) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - int abs_page; - struct uffs_StorageAttrSt *attr = dev->attr; - int nread; - int ret; - u8 ecc_buf[RS_ECC_SIZE]; - u8 *ecc_store; - - abs_page = attr->pages_per_block * block + page; - - fseek(emu->fp, abs_page * PAGE_FULL_SIZE, SEEK_SET); - nread = fread(g_sdata_buf, 1, PAGE_FULL_SIZE, emu->fp); - g_sdata_buf_pointer = 0; - - ret = ((nread == PAGE_FULL_SIZE) ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR); - - if (ret == UFFS_FLASH_NO_ERR) { - - // Perform ECC check & correction - // In the real world, this is done by MLC controller hardware - memset(ecc_buf, 0xFF, RS_ECC_SIZE); - uffs_EccMake(g_sdata_buf, attr->page_data_size, ecc_buf); - - ecc_store = g_sdata_buf + PAGE_FULL_SIZE - RS_ECC_SIZE; - - ret = uffs_EccCorrect(g_sdata_buf, attr->page_data_size, ecc_store, ecc_buf); - - ret = (ret < 0 ? UFFS_FLASH_ECC_FAIL : - (ret > 0 ? UFFS_FLASH_ECC_OK : UFFS_FLASH_NO_ERR)); - - } - - return ret; -} - -static int program_sdata(uffs_Device *dev, int block, int page) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - int abs_page; - struct uffs_StorageAttrSt *attr = dev->attr; - u8 ecc_buf[RS_ECC_SIZE]; - int writtern = 0; - - // In the real world, MLC controller will generate RS-ECC code in serial data buffer - // and might start auto programing NAND flash. Here, we use software ECC to emulate RS-ECC. - memset(ecc_buf, 0xFF, sizeof(ecc_buf)); - uffs_EccMake(g_sdata_buf, attr->page_data_size, ecc_buf); - feed_sdata(ecc_buf, RS_ECC_SIZE); - - if (!uffs_Assert(g_sdata_buf_pointer == PAGE_FULL_SIZE, "Serial Data Buffer is not fully filled !!")) - goto ext; - - abs_page = attr->pages_per_block * block + page; - - fseek(emu->fp, abs_page * PAGE_FULL_SIZE, SEEK_SET); - writtern = fwrite(g_sdata_buf, 1, PAGE_FULL_SIZE, emu->fp); -ext: - return (writtern == PAGE_FULL_SIZE) ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR; -} - - -static int femu_hw_auto_InitFlash(uffs_Device *dev) -{ - struct uffs_StorageAttrSt *attr = dev->attr; - - // now this is a good chance to adjust page data/spare boundary - if (attr->page_data_size + attr->spare_size != PAGE_FULL_SIZE) { - MSGLN("This emulator emulates only for page size %d bytes !", PAGE_FULL_SIZE); - return -1; - } - if (attr->spare_size < PAGE_SPARE_SIZE) { - attr->page_data_size -= (PAGE_SPARE_SIZE - attr->spare_size); - attr->spare_size = PAGE_SPARE_SIZE; - MSGLN("Adjust page data/spare boundary to %d/%d", attr->page_data_size, attr->spare_size); - } - - // and fix ECC size - attr->ecc_size = RS_ECC_SIZE; - MSGLN("Adjust ECC size to %d bytes", attr->ecc_size); - - return femu_InitFlash(dev); -} - - -static int femu_hw_auto_WritePageWithLayout(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *ecc, const uffs_TagStore *ts) -{ - int abs_page; - uffs_FileEmu *emu; - struct uffs_StorageAttrSt *attr = dev->attr; - u8 spare[PAGE_SPARE_SIZE]; - int ret = UFFS_FLASH_IO_ERR; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (!emu || !(emu->fp)) { - goto err; - } - - abs_page = attr->pages_per_block * block + page; - - start_sdata_access(); - - dev->st.page_write_count++; - dev->st.spare_write_count++; - dev->st.io_write += PAGE_FULL_SIZE; - - if (data || ts) { - // normal page write - if (data && data_len > 0) { - if (data_len > attr->page_data_size) - goto err; - - emu->em_monitor_page[abs_page]++; - if (emu->em_monitor_page[abs_page] > PAGE_DATA_WRITE_COUNT_LIMIT) { - MSGLN("Warrning: block %d page %d exceed it's maximum write time!", block, page); - goto err; - } - - // Copy data to serial data buffer - feed_sdata(data, data_len); - - // Pad the rest data as 0xFF - feed_sdata_constant(0xFF, attr->page_data_size - data_len); - - } - else { - // We still need to feed data to serial data buffer to make MLC controller happy - // The current UFFS won't write ts only, so we'll never run to here. - feed_sdata_constant(0xFF, attr->page_data_size); - } - - if (ts) { - - emu->em_monitor_spare[abs_page]++; - if (emu->em_monitor_spare[abs_page] > PAGE_SPARE_WRITE_COUNT_LIMIT) { - MSGLN("Warrning: block %d page %d (spare) exceed it's maximum write time!", block, page); - goto err; - } - - memset(spare, 0xFF, sizeof(spare)); - uffs_FlashMakeSpare(dev, ts, NULL, spare); // do not pack ECC, as MLC controller will - // automatically write RS-ECC to the latest 10 bytes. - - // feed spare data to serial data buffer - feed_sdata(spare, PAGE_SPARE_SIZE - RS_ECC_SIZE); - } - } - else { - // mark bad block - - // feed data to serial data buffer to make MLC controller happy - feed_sdata_constant(0xFF, attr->page_data_size); - - memset(spare, 0xFF, sizeof(spare)); - spare[attr->block_status_offs] = 0; - - // feed spare data to serial data buffer - feed_sdata(spare, PAGE_SPARE_SIZE - RS_ECC_SIZE); - - dev->st.io_write++; - } - - // now, program serial data buffer to NAND flash - ret = program_sdata(dev, block, page); - - fflush(emu->fp); - return ret; -err: - fflush(emu->fp); - return ret; -} - - -static URET femu_hw_auto_ReadPageWithLayout(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc, - uffs_TagStore *ts, u8 *ecc_store) -{ - uffs_FileEmu *emu; - int abs_page; - struct uffs_StorageAttrSt *attr = dev->attr; - unsigned char status; - u8 spare[PAGE_SPARE_SIZE]; - int ret = UFFS_FLASH_IO_ERR; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (!emu || !(emu->fp)) { - goto ext; - } - - abs_page = attr->pages_per_block * block + page; - - // now load full page to serial data buffer - ret = load_sdata(dev, block, page); - if (ret != UFFS_FLASH_NO_ERR) - goto ext; - - start_sdata_access(); - - dev->st.io_read += PAGE_FULL_SIZE; - dev->st.page_read_count++; - dev->st.spare_read_count++; - - if (data || ts) { - - if (data && data_len > 0) { - if (data_len > attr->page_data_size) - goto ext; - - drain_sdata(data, data_len); - } - - if (ts) { - if (g_sdata_buf_pointer < attr->page_data_size) - drain_sdata(NULL, attr->page_data_size - g_sdata_buf_pointer); - - drain_sdata(spare, PAGE_SPARE_SIZE - RS_ECC_SIZE); - - // unload ts from spare - uffs_FlashUnloadSpare(dev, spare, ts, NULL); - } - } - else { - // read bad block mark - drain_sdata(NULL, attr->page_data_size + attr->block_status_offs - 1); - drain_sdata(&status, 1); - - ret = (status == 0xFF ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK); - } - -ext: - return ret; -} - - -uffs_FlashOps g_femu_ops_ecc_hw_auto = { - femu_hw_auto_InitFlash, // InitFlash() - femu_ReleaseFlash, // ReleaseFlash() - NULL, // ReadPage() - femu_hw_auto_ReadPageWithLayout, // ReadPageWithLayout() - NULL, // WritePage() - femu_hw_auto_WritePageWithLayout, // WritePageWithLayout() - NULL, // IsBadBlock(), let UFFS take care of it. - NULL, // MarkBadBlock(), let UFFS take care of it. - femu_EraseBlock, // EraseBlock() -}; diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_soft.c b/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_soft.c deleted file mode 100644 index 0a24c1cf3b..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_ecc_soft.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2010 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem_ecc_soft.c - * \brief emulate uffs file system for software ECC - * \author Ricky Zheng @ Oct, 2010 - */ - -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_flash.h" -#include "uffs_fileem.h" - -#define PFX "femu: " -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -static int femu_WritePage(uffs_Device *dev, u32 block, u32 page_num, - const u8 *data, int data_len, const u8 *spare, int spare_len) -{ - int written; - int abs_page; - int full_page_size; - uffs_FileEmu *emu; - struct uffs_StorageAttrSt *attr = dev->attr; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (!emu || !(emu->fp)) { - goto err; - } - - abs_page = attr->pages_per_block * block + page_num; - full_page_size = attr->page_data_size + attr->spare_size; - - if (data && data_len > 0) { - if (data_len > attr->page_data_size) - goto err; - - emu->em_monitor_page[abs_page]++; - if (emu->em_monitor_page[abs_page] > PAGE_DATA_WRITE_COUNT_LIMIT) { - MSGLN("Warrning: block %d page %d exceed it's maximum write time!", block, page_num); - goto err; - } - - fseek(emu->fp, abs_page * full_page_size, SEEK_SET); - - written = fwrite(data, 1, data_len, emu->fp); - - if (written != data_len) { - MSGLN("write page I/O error ?"); - goto err; - } - - dev->st.page_write_count++; - dev->st.io_write += written; - } - - if (spare && spare_len > 0) { - if (spare_len > attr->spare_size) - goto err; - - emu->em_monitor_spare[abs_page]++; - if (emu->em_monitor_spare[abs_page] > PAGE_SPARE_WRITE_COUNT_LIMIT) { - MSGLN("Warrning: block %d page %d (spare) exceed it's maximum write time!", block, page_num); - goto err; - } - - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size, SEEK_SET); - written = fwrite(spare, 1, spare_len, emu->fp); - if (written != spare_len) { - MSGLN("write spare I/O error ?"); - goto err; - } - - dev->st.spare_write_count++; - dev->st.io_write += written; - } - - if (data == NULL && spare == NULL) { - // mark bad block - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size + attr->block_status_offs, SEEK_SET); - written = fwrite("\0", 1, 1, emu->fp); - if (written != 1) { - MSGLN("write bad block mark I/O error ?"); - goto err; - } - dev->st.io_write++; - } - - fflush(emu->fp); - return UFFS_FLASH_NO_ERR; -err: - fflush(emu->fp); - return UFFS_FLASH_IO_ERR; -} - - -static URET femu_ReadPage(uffs_Device *dev, u32 block, u32 page_num, u8 *data, int data_len, u8 *ecc, - u8 *spare, int spare_len) -{ - int nread; - uffs_FileEmu *emu; - int abs_page; - int full_page_size; - struct uffs_StorageAttrSt *attr = dev->attr; - unsigned char status; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (!emu || !(emu->fp)) { - goto err; - } - - abs_page = attr->pages_per_block * block + page_num; - full_page_size = attr->page_data_size + attr->spare_size; - - if (data && data_len > 0) { - if (data_len > attr->page_data_size) - goto err; - - fseek(emu->fp, abs_page * full_page_size, SEEK_SET); - nread = fread(data, 1, data_len, emu->fp); - - if (nread != data_len) { - MSGLN("read page I/O error ?"); - goto err; - } - dev->st.io_read += nread; - dev->st.page_read_count++; - } - - if (spare && spare_len > 0) { - if (spare_len > attr->spare_size) - goto err; - - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size, SEEK_SET); - nread = fread(spare, 1, spare_len, emu->fp); - - if (nread != spare_len) { - MSGLN("read page spare I/O error ?"); - goto err; - } - dev->st.io_read += nread; - dev->st.spare_read_count++; - } - - if (data == NULL && spare == NULL) { - // read bad block mark - fseek(emu->fp, abs_page * full_page_size + attr->page_data_size + attr->block_status_offs, SEEK_SET); - nread = fread(&status, 1, 1, emu->fp); - - if (nread != 1) { - MSGLN("read badblock mark I/O error ?"); - goto err; - } - dev->st.io_read++; - - return status == 0xFF ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; - } - - return UFFS_FLASH_NO_ERR; -err: - return UFFS_FLASH_IO_ERR; -} - - -uffs_FlashOps g_femu_ops_ecc_soft = { - femu_InitFlash, // InitFlash() - femu_ReleaseFlash, // ReleaseFlash() - femu_ReadPage, // ReadPage() - NULL, // ReadPageWithLayout - femu_WritePage, // WritePage() - NULL, // WritePageWithLayout - NULL, // IsBadBlock(), let UFFS take care of it. - NULL, // MarkBadBlock(), let UFFS take care of it. - femu_EraseBlock, // EraseBlock() -}; diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_share.c b/components/dfs/filesystems/uffs/src/emu/uffs_fileem_share.c deleted file mode 100644 index 6bd759bb82..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_share.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem_share.c - * \brief emulate uffs file system, shared functions - * \author Ricky Zheng, created Nov, 2010 - */ - - -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs_fileem.h" - -#define PFX "femu: " - -/****************************************************************/ -/* Shared flash driver functions: */ -/* */ -/* femu_InitFlash(), femu_ReleaseFlash(), femu_EraseBlock() */ -/* */ -/****************************************************************/ - -static u8 g_page_buf[UFFS_MAX_PAGE_SIZE + UFFS_MAX_SPARE_SIZE]; - -/* - * Create emulator disk, initialise monitors, inject manufacture bad blocks, etc. - * - */ -int femu_InitFlash(uffs_Device *dev) -{ - int i; - int fSize; - int written; - u8 * p = g_page_buf; - uffs_FileEmu *emu; - - struct uffs_StorageAttrSt *attr = dev->attr; - - int full_page_size = attr->page_data_size + attr->spare_size; - int total_pages = attr->total_blocks * attr->pages_per_block; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - if (emu->initCount > 0) { - emu->initCount++; - return 0; - } - - if (emu->emu_filename == NULL) - emu->emu_filename = UFFS_FEMU_FILE_NAME; - - uffs_Perror(UFFS_MSG_NORMAL, "femu device init."); - - emu->em_monitor_page = (u8 *) malloc(sizeof(emu->em_monitor_page[0]) * total_pages); - if (!emu->em_monitor_page) - return -1; - emu->em_monitor_spare = (u8 *) malloc(sizeof(emu->em_monitor_spare[0]) * total_pages); - if (!emu->em_monitor_spare) - return -1; - - emu->em_monitor_block = (u32 *) malloc(sizeof(emu->em_monitor_block[0]) * attr->total_blocks); - if (!emu->em_monitor_block) - return -1; - - //clear monitor - memset(emu->em_monitor_page, 0, sizeof(emu->em_monitor_page[0]) * total_pages); - memset(emu->em_monitor_spare, 0, sizeof(emu->em_monitor_spare[0]) * total_pages); - memset(emu->em_monitor_block, 0, sizeof(emu->em_monitor_block[0]) * attr->total_blocks); - - emu->fp = fopen(emu->emu_filename, "rb"); - if (emu->fp == NULL) { - emu->fp = fopen(emu->emu_filename, "ab+"); - if (emu->fp == NULL) { - printf(PFX"Failed to create uffs emulation file."); - return -1; - } - - fseek(emu->fp, 0, SEEK_END); - fSize = ftell(emu->fp); - - if (fSize < total_pages * full_page_size) { - printf("Creating uffs emulation file\n"); - fseek(emu->fp, 0, SEEK_SET); - memset(p, 0xff, full_page_size); - for (i = 0; i < total_pages; i++) { - written = fwrite(p, 1, full_page_size, emu->fp); - if (written != full_page_size) { - printf("Write failed\n"); - fclose(emu->fp); - emu->fp = NULL; - return -1; - } - } - } - } - - fflush(emu->fp); - fclose(emu->fp); - - emu->fp = fopen(emu->emu_filename, "rb+"); - if (emu->fp == NULL) { - printf(PFX"Can't open emulation file.\n"); - return -1; - } - - emu->initCount++; - - return 0; -} - -/* - * Release resources - */ -int femu_ReleaseFlash(uffs_Device *dev) -{ - uffs_FileEmu *emu; - - emu = (uffs_FileEmu *)(dev->attr->_private); - - emu->initCount--; - - if (emu->initCount == 0) { - - uffs_Perror(UFFS_MSG_NORMAL, "femu device release."); - - if (emu->fp) { - fclose(emu->fp); - emu->fp = NULL; - } - - if (emu->em_monitor_page) - free(emu->em_monitor_page); - if (emu->em_monitor_spare) - free(emu->em_monitor_spare); - if (emu->em_monitor_block) - free(emu->em_monitor_block); - emu->em_monitor_page = NULL; - emu->em_monitor_spare = NULL; - emu->em_monitor_block = NULL; - } - - return 0; -} - -int femu_EraseBlock(uffs_Device *dev, u32 blockNumber) -{ - - int i; - u8 * pg = g_page_buf; - int pg_size, pgd_size, sp_size, blks, blk_pgs, blk_size; - uffs_FileEmu *emu; - emu = (uffs_FileEmu *)(dev->attr->_private); - if (!emu || !(emu->fp)) - goto err; - - pg_size = dev->attr->page_data_size + dev->attr->spare_size; - pgd_size = dev->attr->page_data_size; - sp_size = dev->attr->spare_size; - blk_pgs = dev->attr->pages_per_block; - blks = dev->attr->total_blocks; - blk_size = dev->attr->page_data_size * dev->attr->pages_per_block; - - printf("femu: erase block %d\n", blockNumber); - - if ((int)blockNumber >= blks) { - printf("Attempt to erase non-existant block %d\n",blockNumber); - goto err; - } - else { - - //clear this block monitors - memset(emu->em_monitor_page + (blockNumber * blk_pgs), - 0, - blk_pgs * sizeof(u8)); - memset(emu->em_monitor_spare + (blockNumber * blk_pgs), - 0, - blk_pgs * sizeof(u8)); - - emu->em_monitor_block[blockNumber]++; - - memset(pg, 0xff, (pgd_size + sp_size)); - - fseek(emu->fp, blockNumber * blk_pgs * (pgd_size + sp_size), SEEK_SET); - - for (i = 0; i < blk_pgs; i++) { - fwrite(pg, 1, (pgd_size + sp_size), emu->fp); - } - - fflush(emu->fp); - dev->st.block_erase_count++; - } - - return UFFS_FLASH_NO_ERR; -err: - return UFFS_FLASH_IO_ERR; - -} - diff --git a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_wrap.c b/components/dfs/filesystems/uffs/src/emu/uffs_fileem_wrap.c deleted file mode 100644 index 9893aa2eda..0000000000 --- a/components/dfs/filesystems/uffs/src/emu/uffs_fileem_wrap.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fileem_wrap.c - * - * \brief file emulator wrapper functions for injecting bad blocks or ECC errors. - * - * \author Ricky Zheng, created Nov, 2010 - */ - -#include -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs_fileem.h" - -#define PFX "femu: " -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -// #define UFFS_FEMU_SHOW_FLASH_IO - -#ifdef UFFS_FEMU_ENABLE_INJECTION - -struct uffs_FileEmuBitFlip { - int block; - int page; - int offset; - u8 mask; -}; - -/* simulate bad blocks */ -#define FILEEMU_STOCK_BAD_BLOCKS {5, 180} // bad block come from manufacture -#define FILEEMU_ERASE_BAD_BLOCKS {100, 150} // new bad block discovered when erasing - -/* simulating bit flip */ -#define FILEEMU_WRITE_BIT_FLIP \ - { \ - {20, 2, 10, 1 << 4}, /* block 20, page 2, offset 10, bit 4 */ \ - {24, 4, -3, 1 << 2}, /* block 24, page 4, spare offset 3, bit 2*/ \ - {60, 1, 5, 1 << 3}, /* block 60, page 1, offset 5, bit 3 */ \ - {66, 1, 15, 1 << 7}, /* block 66, page 1, offset 300, bit 7 */ \ - {80, 2, 2, 1 << 1}, /* block 80, page 2, offset 2, bit 1 */ \ - {88, 2, 100, 1 << 5}, /* block 88, page 2, offset 100, bit 5 */ \ - } - - -static int femu_InitFlash_wrap(uffs_Device *dev); - -static int femu_ReadPage_wrap(uffs_Device *dev, u32 block, u32 page, u8 *data, int data_len, u8 *ecc, - u8 *spare, int spare_len); -static int femu_ReadPageWithLayout_wrap(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc, - uffs_TagStore *ts, u8 *ecc_store); -static int femu_WritePage_wrap(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *spare, int spare_len); -static int femu_WritePageWithLayout_wrap(uffs_Device *dev, u32 block, u32 page, const u8* data, int data_len, const u8 *ecc, - const uffs_TagStore *ts); -static int femu_EraseBlock_wrap(uffs_Device *dev, u32 blockNumber); - - -///////////////////////////////////////////////////////////////////////////////// - -void femu_setup_wrapper_functions(uffs_Device *dev) -{ - uffs_FileEmu *emu; - emu = (uffs_FileEmu *)(dev->attr->_private); - - // setup wrap functions, for inject ECC errors, etc. - - memcpy(&emu->ops_orig, dev->ops, sizeof(struct uffs_FlashOpsSt)); - - if (dev->ops->InitFlash) - dev->ops->InitFlash = femu_InitFlash_wrap; - if (dev->ops->EraseBlock) - dev->ops->EraseBlock = femu_EraseBlock_wrap; - if (dev->ops->ReadPage) - dev->ops->ReadPage = femu_ReadPage_wrap; - if (dev->ops->ReadPageWithLayout) - dev->ops->ReadPageWithLayout = femu_ReadPageWithLayout_wrap; - if (dev->ops->WritePage) - dev->ops->WritePage = femu_WritePage_wrap; - if (dev->ops->WritePageWithLayout) - dev->ops->WritePageWithLayout = femu_WritePageWithLayout_wrap; -} - -static int femu_InitFlash_wrap(uffs_Device *dev) -{ - int ret; - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - -#ifdef FILEEMU_STOCK_BAD_BLOCKS - u32 bad_blocks[] = FILEEMU_STOCK_BAD_BLOCKS; - int j; - u8 x = 0; - struct uffs_StorageAttrSt *attr = dev->attr; - int full_page_size = attr->page_data_size + attr->spare_size; - int blk_size = full_page_size * attr->pages_per_block; -#endif - - if (emu->initCount == 0) { - ret = emu->ops_orig.InitFlash(dev); -#ifdef FILEEMU_STOCK_BAD_BLOCKS - if (ret >= 0) { - for (j = 0; j < ARRAY_SIZE(bad_blocks); j++) { - if (bad_blocks[j] < dev->attr->total_blocks) { - printf(" --- manufacture bad block %d ---\n", bad_blocks[j]); - fseek(emu->fp, bad_blocks[j] * blk_size + attr->page_data_size + dev->attr->block_status_offs, SEEK_SET); - fwrite(&x, 1, 1, emu->fp); - } - } - } -#endif - } - else { - ret = emu->ops_orig.InitFlash(dev); - } - - return ret; -} - -static int femu_ReadPage_wrap(uffs_Device *dev, u32 block, u32 page, u8 *data, int data_len, u8 *ecc, - u8 *spare, int spare_len) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - -#ifdef UFFS_FEMU_SHOW_FLASH_IO - if (data || spare) { - MSG(PFX " Read block %d page %d", block, page); - if (data) - MSG(" DATA[%d]", data_len); - if (spare) - MSG(" SPARE[%d]", spare_len); - MSG(TENDSTR); - } -#endif - return emu->ops_orig.ReadPage(dev, block, page, data, data_len, ecc, spare, spare_len); -} - -static int femu_ReadPageWithLayout_wrap(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc, - uffs_TagStore *ts, u8 *ecc_store) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - -#ifdef UFFS_FEMU_SHOW_FLASH_IO - if (data || ts) { - MSG(PFX " Read block %d page %d", block, page); - if (data) - MSG(" DATA[%d]", data_len); - if (ts) - MSG(" TS"); - MSG(TENDSTR); - } -#endif - return emu->ops_orig.ReadPageWithLayout(dev, block, page, data, data_len, ecc, ts, ecc_store); -} - - -////////////////////// wraper functions /////////////////////////// - -static void InjectBitFlip(uffs_Device *dev, u32 block, u32 page) -{ -#ifdef FILEEMU_WRITE_BIT_FLIP - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - struct uffs_FileEmuBitFlip flips[] = FILEEMU_WRITE_BIT_FLIP; - struct uffs_FileEmuBitFlip *x; - u8 buf[UFFS_MAX_PAGE_SIZE + UFFS_MAX_SPARE_SIZE]; - u8 *data = buf; - u8 *spare = buf + dev->attr->page_data_size; - int full_page_size = dev->attr->page_data_size + dev->attr->spare_size; - int blk_size = full_page_size * dev->attr->pages_per_block; - int page_offset = block * blk_size + full_page_size * page; - - int i; - u8 *p; - - fseek(emu->fp, page_offset, SEEK_SET); - fread(buf, 1, full_page_size, emu->fp); - - p = NULL; - for (i = 0; i < ARRAY_SIZE(flips); i++) { - x = &flips[i]; - if (x->block == block && x->page == page) { - if (x->offset >= 0) { - printf(" --- Inject data bit flip at block%d, page%d, offset%d, mask%d --- \n", block, page, x->offset, x->mask); - p = (u8 *)(data + x->offset); - } - else { - printf(" --- Inject spare bit flip at block%d, page%d, offset%d, mask%d --- \n", block, page, -x->offset, x->mask); - p = (u8 *)(spare - x->offset); - } - *p = (*p & ~x->mask) | (~(*p & x->mask) & x->mask); - } - } - - if (p) { - fseek(emu->fp, page_offset, SEEK_SET); - fwrite(buf, 1, full_page_size, emu->fp); - } -#endif -} - -static int femu_WritePage_wrap(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *spare, int spare_len) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - int ret; - -#ifdef UFFS_FEMU_SHOW_FLASH_IO - if (data || spare) { - MSG(PFX " Write block %d page %d", block, page); - if (data) - MSG(" DATA[%d]", data_len); - if (spare) - MSG(" SPARE[%d]", spare_len); - MSG(TENDSTR); - } -#endif - - ret = emu->ops_orig.WritePage(dev, block, page, data, data_len, spare, spare_len); - - InjectBitFlip(dev, block, page); - - return ret; -} - -static int femu_WritePageWithLayout_wrap(uffs_Device *dev, u32 block, u32 page, const u8* data, int data_len, const u8 *ecc, - const uffs_TagStore *ts) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - int ret; - -#ifdef UFFS_FEMU_SHOW_FLASH_IO - if (data || ts) { - MSG(PFX " Write block %d page %d", block, page); - if (data) - MSG(" DATA[%d]", data_len); - if (ts) - MSG(" TS"); - MSG(TENDSTR); - } -#endif - - ret = emu->ops_orig.WritePageWithLayout(dev, block, page, data, data_len, ecc, ts); - - InjectBitFlip(dev, block, page); - - return ret; -} - - -static int femu_EraseBlock_wrap(uffs_Device *dev, u32 blockNumber) -{ - uffs_FileEmu *emu = (uffs_FileEmu *)(dev->attr->_private); - -#ifdef FILEEMU_ERASE_BAD_BLOCKS - int blocks[] = FILEEMU_ERASE_BAD_BLOCKS; - int i; - URET ret; - ret = emu->ops_orig.EraseBlock(dev, blockNumber); - - for (i = 0; i < ARRAY_SIZE(blocks); i++) { - if (blockNumber == blocks[i]) { - printf(" --- Inject bad block%d when erasing --- \n", blockNumber); - ret = UFFS_FLASH_BAD_BLK; - } - } - - return ret; - -#else - - return emu->ops_orig.EraseBlock(dev, blockNumber); - -#endif -} - -#endif // UFFS_FEMU_ENABLE_INJECTION - -///////////////////////////////////////////////////////////////////////////////// diff --git a/components/dfs/filesystems/uffs/src/example/CMakeLists.txt b/components/dfs/filesystems/uffs/src/example/CMakeLists.txt deleted file mode 100644 index 18cb307157..0000000000 --- a/components/dfs/filesystems/uffs/src/example/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -IF (UNIX) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/posix) -ENDIF() -IF (WIN32) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/win32) -ENDIF() -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/inc) -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/emu) - -LINK_DIRECTORIES(${uffs_BINARY_DIR}/src/emu) -LINK_DIRECTORIES(${uffs_BINARY_DIR}/src/uffs) - -SET(static_mem_SRCS static-mem-allocate.c) -SET(flash_if_SRCS flash-interface-example.c) -ADD_EXECUTABLE(static-mem-example ${static_mem_SRCS}) -ADD_EXECUTABLE(flash-if-example ${flash_if_SRCS}) -TARGET_LINK_LIBRARIES(static-mem-example emu uffs emu platform apitest_server) -TARGET_LINK_LIBRARIES(flash-if-example emu uffs emu platform) -IF (UNIX) - TARGET_LINK_LIBRARIES(static-mem-example pthread) -ENDIF () - diff --git a/components/dfs/filesystems/uffs/src/example/flash-interface-example.c b/components/dfs/filesystems/uffs/src/example/flash-interface-example.c deleted file mode 100644 index ff26beb281..0000000000 --- a/components/dfs/filesystems/uffs/src/example/flash-interface-example.c +++ /dev/null @@ -1,434 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ -/** - * \file flash-interface-example.c - * \brief example for using flash driver and multiple partitions, with static memory allocator. - * \author Ricky Zheng, created at 27 Nov, 2007 - */ - -#include -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_flash.h" -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_fs.h" - -#define PFX "ndrv: " - -struct my_nand_chip { - void *IOR_ADDR; - void *IOW_ADDR; - UBOOL inited; - // ... -}; - -/* - * Standard NAND flash commands - */ -#define NAND_CMD_READ0 0 -#define NAND_CMD_READ1 1 -#define NAND_CMD_RNDOUT 5 -#define NAND_CMD_PAGEPROG 0x10 -#define NAND_CMD_READOOB 0x50 -#define NAND_CMD_ERASE1 0x60 -#define NAND_CMD_STATUS 0x70 -#define NAND_CMD_STATUS_MULTI 0x71 -#define NAND_CMD_SEQIN 0x80 -#define NAND_CMD_RNDIN 0x85 -#define NAND_CMD_READID 0x90 -#define NAND_CMD_ERASE2 0xd0 -#define NAND_CMD_RESET 0xff - - -/* impelent the following functions for your NAND flash */ -#define CHIP_SET_CLE(chip) { chip = chip; } -#define CHIP_CLR_CLE(chip) {} -#define CHIP_SET_ALE(chip) {} -#define CHIP_CLR_ALE(chip) {} -#define CHIP_SET_NCS(chip) {} -#define CHIP_CLR_NCS(chip) {} -#define CHIP_BUSY(chip) {} -#define CHIP_READY(chip) {} -#define WRITE_COMMAND(chip, cmd) {} -#define WRITE_DATA_ADDR(chip, block, page, offset) {} -#define WRITE_ERASE_ADDR(chip, block) {} -#define WRITE_DATA(chip, data, len) {} -#define READ_DATA(chip, data, len) {} - -#define PARSE_STATUS(v) (UFFS_FLASH_NO_ERR) // parse status to UFFS_FLASH_NO_ERR or UFFS_FLASH_BAD_BLK - - - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR == 0 -int main() -{ - uffs_Perror(UFFS_MSG_NORMAL, "This example need CONFIG_USE_STATIC_MEMORY_ALLOCATOR = 1"); - return 0; -} -#else - - -static int nand_read_page(uffs_Device *dev, u32 block, u32 page, u8 *data, int data_len, u8 *ecc, - u8 *spare, int spare_len) -{ - u8 val = 0; - int ret = UFFS_FLASH_NO_ERR; - struct my_nand_chip *chip = (struct my_nand_chip *) dev->attr->_private; - - CHIP_CLR_NCS(chip); - if (data && data_len > 0) { - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_READ0); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_DATA_ADDR(chip, block, page, 0); - CHIP_CLR_ALE(chip); - READ_DATA(chip, data, data_len); - - // for now, we return all 0xFF to pass UFFS mount, you should remove this at your driver - memset(data, 0xFF, data_len); - } - - if (spare && spare_len > 0) { - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_READOOB); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_DATA_ADDR(chip, block, page, dev->attr->page_data_size); - CHIP_CLR_ALE(chip); - READ_DATA(chip, spare, spare_len); - - // for now, we return all 0xFF to pass UFFS mount, you should remove this at your driver - memset(spare, 0xFF, spare_len); - } - - if (data == NULL && spare == NULL) { - // read bad block mark - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_READOOB); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_DATA_ADDR(chip, block, page, dev->attr->page_data_size + attr->block_status_offs); - CHIP_CLR_ALE(chip); - READ_DATA(chip, &val, 1); - ret = (val == 0xFF ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK); - - // for now, we return UFFS_FLASH_NO_ERR to pass UFFS mount, you should remove this at your driver - ret = UFFS_FLASH_NO_ERR; - } - - CHIP_SET_NCS(chip); - - return ret; -} - -static int nand_write_page(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *spare, int spare_len) -{ - u8 val = 0; - int ret = UFFS_FLASH_NO_ERR; - UBOOL fall_through = FALSE; - struct my_nand_chip *chip = (struct my_nand_chip *) dev->attr->_private; - - CHIP_CLR_NCS(chip); - - if (data && data_len > 0) { - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_READ0); - WRITE_COMMAND(chip, NAND_CMD_SEQIN); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_DATA_ADDR(chip, block, page, 0); - CHIP_CLR_ALE(chip); - CHIP_BUSY(chip); - WRITE_DATA(chip, data, data_len); - if (data_len == dev->attr->page_data_size) - fall_through = U_TRUE; - else { - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_PAGEPROG); - WRITE_COMMAND(chip, NAND_CMD_STATUS); - CHIP_CLR_CLE(chip); - CHIP_READY(chip); - READ_DATA(chip, &val, 1); - ret = PARSE_STATUS(val); - } - } - - if (ret != UFFS_FLASH_NO_ERR) - goto ext; - - if (spare && spare_len > 0) { - if (!fall_through) { - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_READOOB); - WRITE_COMMAND(chip, NAND_CMD_SEQIN); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_DATA_ADDR(chip, block, page, dev->attr->page_data_size); - CHIP_CLR_ALE(chip); - CHIP_BUSY(chip); - } - WRITE_DATA(chip, spare, spare_len); - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_PAGEPROG); - WRITE_COMMAND(chip, NAND_CMD_STATUS); - CHIP_CLR_CLE(chip); - CHIP_READY(chip); - READ_DATA(chip, &val, 1); - ret = PARSE_STATUS(val); - } - - if (data == NULL && spare == NULL) { - // mark bad block - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_READOOB); - WRITE_COMMAND(chip, NAND_CMD_SEQIN); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_DATA_ADDR(chip, block, page, dev->attr->page_data_size + attr->block_status_offs); - CHIP_CLR_ALE(chip); - CHIP_BUSY(chip); - val = 0; - WRITE_DATA(chip, &val, 1); - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_PAGEPROG); - WRITE_COMMAND(chip, NAND_CMD_STATUS); - CHIP_CLR_CLE(chip); - CHIP_READY(chip); - READ_DATA(chip, &val, 1); - ret = PARSE_STATUS(val); - } - -ext: - CHIP_SET_NCS(chip); - - return ret; -} - -static int nand_erase_block(uffs_Device *dev, u32 block) -{ - u8 val = 0; - struct my_nand_chip *chip = (struct my_nand_chip *) dev->attr->_private; - - CHIP_CLR_NCS(chip); - - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_ERASE1); - CHIP_CLR_CLE(chip); - CHIP_SET_ALE(chip); - WRITE_ERASE_ADDR(chip, blcok); - CHIP_CLR_ALE(chip); - CHIP_SET_CLE(chip); - WRITE_COMMAND(chip, NAND_CMD_ERASE2); - WRITE_COMMAND(chip, NAND_CMD_STATUS); - CHIP_CLR_CLE(chip); - CHIP_READY(chip); - READ_DATA(chip, &val, 1); - - CHIP_SET_NCS(chip); - - val = val; // just for eliminating warning - - return PARSE_STATUS(val); -} - - -static int nand_init_flash(uffs_Device *dev) -{ - // initialize your hardware here ... - struct my_nand_chip *chip = (struct my_nand_chip *) dev->attr->_private; - - if (!chip->inited) { - // setup chip I/O address, setup NAND flash controller ... etc. - // chip->IOR_ADDR = 0xF0000000 - // chip->IOW_ADDR = 0xF0000000 - chip->inited = U_TRUE; - } - return 0; -} - -static int nand_release_flash(uffs_Device *dev) -{ - // release your hardware here - struct my_nand_chip *chip = (struct my_nand_chip *) dev->attr->_private; - - chip = chip; - - return 0; -} - -static uffs_FlashOps g_my_nand_ops = { - nand_init_flash, // InitFlash() - nand_release_flash, // ReleaseFlash() - nand_read_page, // ReadPage() - NULL, // ReadPageWithLayout - nand_write_page, // WritePage() - NULL, // WritePageWithLayout - NULL, // IsBadBlock(), let UFFS take care of it. - NULL, // MarkBadBlock(), let UFFS take care of it. - nand_erase_block, // EraseBlock() -}; - -///////////////////////////////////////////////////////////////////////////////// - -// change these parameters to fit your nand flash specification - -#define TOTAL_BLOCKS 1024 -#define PAGE_DATA_SIZE 512 -#define PAGE_SPARE_SIZE 16 -#define PAGES_PER_BLOCK 32 -#define PAGE_SIZE (PAGE_DATA_SIZE + PAGE_SPARE_SIZE) -#define BLOCK_DATA_SIZE (PAGE_DATA_SIZE * PAGES_PER_BLOCK) - -#define NR_PARTITION 2 /* total partitions */ -#define PAR_1_BLOCKS 100 /* partition 1 */ -#define PAR_2_BLOCKS (TOTAL_BLOCKS - PAR_1_BLOCKS) /* partition 2 */ - -struct my_nand_chip g_nand_chip = {0}; -static struct uffs_StorageAttrSt g_my_flash_storage = {0}; - -/* define mount table */ -static uffs_Device demo_device_1 = {0}; -static uffs_Device demo_device_2 = {0}; - -static uffs_MountTable demo_mount_table[] = { - { &demo_device_1, 0, PAR_1_BLOCKS - 1, "/data/" }, - { &demo_device_2, PAR_1_BLOCKS, PAR_1_BLOCKS + PAR_2_BLOCKS - 1, "/" }, - { NULL, 0, 0, NULL } -}; - -/* static alloc the memory for each partition */ -static int static_buffer_par1[UFFS_STATIC_BUFF_SIZE(PAGES_PER_BLOCK, PAGE_SIZE, PAR_1_BLOCKS) / sizeof(int)]; -static int static_buffer_par2[UFFS_STATIC_BUFF_SIZE(PAGES_PER_BLOCK, PAGE_SIZE, PAR_2_BLOCKS) / sizeof(int)];; - -static void init_nand_chip(struct my_nand_chip *chip) -{ - // init chip IO address, etc. -} - -static void setup_flash_storage(struct uffs_StorageAttrSt *attr) -{ - memset(attr, 0, sizeof(struct uffs_StorageAttrSt)); - - // setup NAND flash attributes. - attr->total_blocks = TOTAL_BLOCKS; /* total blocks */ - attr->page_data_size = PAGE_DATA_SIZE; /* page data size */ - attr->pages_per_block = PAGES_PER_BLOCK; /* pages per block */ - attr->spare_size = PAGE_SPARE_SIZE; /* page spare size */ - attr->block_status_offs = 4; /* block status offset is 5th byte in spare */ - attr->ecc_opt = UFFS_ECC_SOFT; /* ecc option */ - attr->layout_opt = UFFS_LAYOUT_UFFS; /* let UFFS do the spare layout */ -} - -static URET my_InitDevice(uffs_Device *dev) -{ - dev->attr = &g_my_flash_storage; // NAND flash attributes - dev->attr->_private = (void *) &g_nand_chip;// hook nand_chip data structure to attr->_private - dev->ops = &g_my_nand_ops; // NAND driver - - init_nand_chip(&g_nand_chip); - - return U_SUCC; -} - -static URET my_ReleaseDevice(uffs_Device *dev) -{ - return U_SUCC; -} - - -static int my_init_filesystem(void) -{ - uffs_MountTable *mtbl = &(demo_mount_table[0]); - - /* setup nand storage attributes */ - setup_flash_storage(&g_my_flash_storage); - - /* setup memory allocator */ - uffs_MemSetupStaticAllocator(&demo_device_1.mem, static_buffer_par1, sizeof(static_buffer_par1)); - uffs_MemSetupStaticAllocator(&demo_device_2.mem, static_buffer_par2, sizeof(static_buffer_par2)); - - /* register mount table */ - while(mtbl->dev) { - // setup device init/release entry - mtbl->dev->Init = my_InitDevice; - mtbl->dev->Release = my_ReleaseDevice; - uffs_RegisterMountTable(mtbl); - mtbl++; - } - - // mount partitions - for (mtbl = &(demo_mount_table[0]); mtbl->mount != NULL; mtbl++) { - uffs_Mount(mtbl->mount); - } - - return uffs_InitFileSystemObjects() == U_SUCC ? 0 : -1; -} - -static int my_release_filesystem(void) -{ - uffs_MountTable *mtb; - int ret = 0; - - // unmount parttions - for (mtb = &(demo_mount_table[0]); ret == 0 && mtb->mount != NULL; mtb++) { - ret = uffs_UnMount(mtb->mount); - } - - // release objects - if (ret == 0) - ret = (uffs_ReleaseFileSystemObjects() == U_SUCC ? 0 : -1); - - return ret; -} - -/* application entry */ -int main() -{ - uffs_SetupDebugOutput(); // setup debug output as early as possible - - my_init_filesystem(); - - // ... my application codes .... - // read/write/create/delete files ... - - my_release_filesystem(); - - return 0; -} - -#endif - - -///////////////////////////////////////////////////////////////////////////////// diff --git a/components/dfs/filesystems/uffs/src/example/static-mem-allocate.c b/components/dfs/filesystems/uffs/src/example/static-mem-allocate.c deleted file mode 100644 index 59aff8e63d..0000000000 --- a/components/dfs/filesystems/uffs/src/example/static-mem-allocate.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file static-mem-allocate.c - * \brief demostrate how to use static memory allocation. This example use - * file emulated NAND flash, one partition only. - * \author Ricky Zheng - */ - -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_mtb.h" -#include "cmdline.h" -#include "uffs_fileem.h" - -#define PFX "sexp: " - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR == 0 -int main() -{ - uffs_Perror(UFFS_MSG_NORMAL, "This example need CONFIG_USE_STATIC_MEMORY_ALLOCATOR = 1"); - return 0; -} -#else - -extern struct cli_commandset * get_helper_cmds(void); -extern struct cli_commandset * get_test_cmds(void); - -#define PAGE_DATA_SIZE 512 -#define PAGE_SPARE_SIZE 16 -#define PAGES_PER_BLOCK 32 -#define TOTAL_BLOCKS 128 - -#define PAGE_SIZE (PAGE_DATA_SIZE + PAGE_SPARE_SIZE) -#define BLOCK_DATA_SIZE (PAGES_PER_BLOCK * PAGE_DATA_SIZE) -#define TOTAL_DATA_SIZE (TOTAL_BLOCKS * BLOCK_DATA_SIZE) -#define BLOCK_SIZE (PAGES_PER_BLOCK * PAGE_SIZE) -#define TOTAL_SIZE (BLOCK_SIZE * TOTAL_BLOCKS) - -#define MAX_MOUNT_TABLES 10 -#define MAX_MOUNT_POINT_NAME 32 - -static uffs_Device demo_device = {0}; -static struct uffs_MountTableEntrySt demo_mount = { - &demo_device, - 0, /* start from block 0 */ - -1, /* use whole chip */ - "/", /* mount point */ - NULL -}; - -/* static alloc the memory */ -static int static_buffer_pool[UFFS_STATIC_BUFF_SIZE(PAGES_PER_BLOCK, PAGE_SIZE, TOTAL_BLOCKS) / sizeof(int)]; - - -static void setup_storage(struct uffs_StorageAttrSt *attr) -{ - attr->total_blocks = TOTAL_BLOCKS; /* total blocks */ - attr->page_data_size = PAGE_DATA_SIZE; /* page data size */ - attr->spare_size = PAGE_SPARE_SIZE; /* page spare size */ - attr->pages_per_block = PAGES_PER_BLOCK; /* pages per block */ - attr->block_status_offs = 4; /* block status offset is 5th byte in spare */ - attr->ecc_opt = UFFS_ECC_SOFT; /* use UFFS software ecc */ - attr->layout_opt = UFFS_LAYOUT_UFFS; /* let UFFS do the spare layout */ -} - -static void setup_device(uffs_Device *dev) -{ - // using file emulator device - dev->Init = femu_InitDevice; - dev->Release = femu_ReleaseDevice; - dev->attr = femu_GetStorage(); -} - -static int init_uffs_fs(void) -{ - struct uffs_MountTableEntrySt *mtbl = &demo_mount; - - /* setup flash storage attributes */ - setup_storage(femu_GetStorage()); - - /* setup memory allocator */ - uffs_MemSetupStaticAllocator(&mtbl->dev->mem, static_buffer_pool, sizeof(static_buffer_pool)); - - /* setup device: init, release, attr */ - setup_device(mtbl->dev); - - /* register mount table */ - uffs_RegisterMountTable(mtbl); - - /* mount it */ - uffs_Mount("/"); - - return uffs_InitFileSystemObjects() == U_SUCC ? 0 : -1; -} - -static int release_uffs_fs(void) -{ - uffs_UnMount("/"); - - return uffs_ReleaseFileSystemObjects(); -} - -int main(int argc, char *argv[]) -{ - int ret; - - uffs_SetupDebugOutput(); // setup debug output as early as possible - - ret = init_uffs_fs(); - - if (ret != 0) { - printf ("Init file system fail: %d\n", ret); - return -1; - } - - cli_add_commandset(get_helper_cmds()); - cli_add_commandset(get_test_cmds()); - cli_main_entry(); - - release_uffs_fs(); - - return 0; -} - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs.h deleted file mode 100644 index 12121cd1ab..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ -/** - * \file uffs.h - * \brief uffs basic defines - * \author Ricky Zheng - */ - -#ifndef _UFFS_H_ -#define _UFFS_H_ - -#ifdef __cplusplus -extern "C"{ -#endif - -#define UO_RDONLY 0x0000 /** read only */ -#define UO_WRONLY 0x0001 /** write only */ -#define UO_RDWR 0x0002 /** read and write */ -#define UO_APPEND 0x0008 /** append */ - -#define UO_BINARY 0x0000 /** no used in uffs */ - -#define UO_CREATE 0x0100 -#define UO_TRUNC 0x0200 -#define UO_EXCL 0x0400 - -#define UO_NOECC 0x0800 /** skip ECC when reading file data from media */ - - -#define UO_DIR 0x1000 /** open a directory */ - - - -#define UENOERR 0 /** no error */ -#define UEACCES 1 /** Tried to open read-only file - for writing, or files sharing mode - does not allow specified operations, - or given path is directory */ - -#define UEEXIST 2 /** _O_CREAT and _O_EXCL flags specified, - but filename already exists */ -#define UEINVAL 3 /** Invalid oflag or pmode argument */ -#define UEMFILE 4 /** No more file handles available - (too many open files) */ -#define UENOENT 5 /** file or path not found */ -#define UETIME 6 /** can't set file time */ -#define UEBADF 9 /** invalid file handle */ -#define UENOMEM 10 /** no enough memory */ -#define UEIOERR 11 /** I/O error from lower level flash operation */ -#define UENOTDIR 12 /** Not a directory */ -#define UEISDIR 13 /** Is a directory */ - -#define UEUNKNOWN_ERR 100 /** unknown error */ - - - -#define _SEEK_CUR 0 /** seek from current position */ -#define _SEEK_SET 1 /** seek from beginning of file */ -#define _SEEK_END 2 /** seek from end of file */ - -#define USEEK_CUR _SEEK_CUR -#define USEEK_SET _SEEK_SET -#define USEEK_END _SEEK_END - - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_badblock.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_badblock.h deleted file mode 100644 index b44bbb8170..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_badblock.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ -/** - * \file uffs_badblock.h - * \brief bad block management - * \author Ricky Zheng - */ - -#ifndef _UFFS_BADBLOCK_H_ -#define _UFFS_BADBLOCK_H_ - -#include "uffs/uffs_public.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -#define HAVE_BADBLOCK(dev) (dev->bad.block != UFFS_INVALID_BLOCK) - -/** initialize bad block management data structures for uffs device */ -void uffs_BadBlockInit(uffs_Device *dev); - -/** processing bad block: erase bad block, - mark it as 'bad' and put it to bad block list */ -void uffs_BadBlockProcess(uffs_Device *dev, TreeNode *node); - -/** processing bad block: erase bad block, - mark it as 'bad' and put it to suspend block list */ -void uffs_BadBlockProcessSuspend(uffs_Device *dev, TreeNode *node); - -/** try to recover data from a new discovered bad block */ -void uffs_BadBlockRecover(uffs_Device *dev); - -/** put a new block to the bad block waiting list */ -void uffs_BadBlockAdd(uffs_Device *dev, int block); - - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_blockinfo.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_blockinfo.h deleted file mode 100644 index dfd3a9be7c..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_blockinfo.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ -/** - * \file uffs_blockinfo.h - * \brief data structure for operating block information - * \author Ricky Zheng - */ - -#ifndef _UFFS_BLOCKINFO_H_ -#define _UFFS_BLOCKINFO_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif -/** - * \struct uffs_PageSpareSt - * \brief this structure is for storing uffs tag and more. - */ -struct uffs_PageSpareSt { - uffs_Tags tag; //!< page tag - int expired:1; -}; - -/** - * \struct uffs_BlockInfoSt - * \brief block information data. Block info is frequently accessed, - UFFS use a cache system to speed up block info access. - */ -struct uffs_BlockInfoSt { - struct uffs_BlockInfoSt *next; - struct uffs_BlockInfoSt *prev; - u16 block; //!< block number - struct uffs_PageSpareSt *spares; //!< page spare info array - int expired_count; //!< how many pages expired in this block ? - int ref_count; //!< reference counter, it's safe to reuse this block memory when the counter is 0. -}; - -/** get tag from block info */ -#define GET_TAG(bc, page) (&(bc)->spares[page].tag) - - -/** initialize block info caches */ -URET uffs_BlockInfoInitCache(uffs_Device *dev, int maxCachedBlocks); - -/** release block info caches */ -URET uffs_BlockInfoReleaseCache(uffs_Device *dev); - -/** load page spare to block info cache */ -URET uffs_BlockInfoLoad(uffs_Device *dev, uffs_BlockInfo *work, int page); - -/** find block info cache */ -uffs_BlockInfo * uffs_BlockInfoFindInCache(uffs_Device *dev, int block); - -/** get block info cache, load it on demand */ -uffs_BlockInfo * uffs_BlockInfoGet(uffs_Device *dev, int block); - -/** put info cache back to pool, should be called with #uffs_BlockInfoGet in pairs. */ -void uffs_BlockInfoPut(uffs_Device *dev, uffs_BlockInfo *p); - -/** explicitly expire a block info cache */ -void uffs_BlockInfoExpire(uffs_Device *dev, uffs_BlockInfo *p, int page); - -/** no one hold any block info cache ? safe to release block info caches */ -UBOOL uffs_BlockInfoIsAllFree(uffs_Device *dev); - -/** explicitly expire all block info caches */ -void uffs_BlockInfoExpireAll(uffs_Device *dev); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_buf.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_buf.h deleted file mode 100644 index b5c99f6d5e..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_buf.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_buf.h - * \brief page buffers - * \author Ricky Zheng - */ - -#ifndef UFFS_BUF_H -#define UFFS_BUF_H - -#include "uffs/uffs_types.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_tree.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#define CLONE_BUF_MARK 0xffff //!< set uffs_BufSt::ref_count to this for a 'cloned' buffer - -/** for uffs_BufSt::mark */ -#define UFFS_BUF_EMPTY 0 //!< buffer is empty -#define UFFS_BUF_VALID 1 //!< buffer is holding valid data -#define UFFS_BUF_DIRTY 2 //!< buffer data is modified - -/** for uffs_BufSt::ext_mark */ -#define UFFS_BUF_EXT_MARK_TRUNC_TAIL 1 //!< the last page of file (when truncating a file) - -/** uffs page buffer */ -struct uffs_BufSt{ - struct uffs_BufSt *next; //!< link to next buffer - struct uffs_BufSt *prev; //!< link to previous buffer - struct uffs_BufSt *next_dirty; //!< link to next dirty buffer - struct uffs_BufSt *prev_dirty; //!< link to previous dirty buffer - u8 type; //!< #UFFS_TYPE_DIR or #UFFS_TYPE_FILE or #UFFS_TYPE_DATA - u8 ext_mark; //!< extension mark. - u16 parent; //!< parent serial - u16 serial; //!< serial - u16 page_id; //!< page id - u16 mark; //!< #UFFS_BUF_EMPTY or #UFFS_BUF_VALID, or #UFFS_BUF_DIRTY ? - u16 ref_count; //!< reference counter, or #CLONE_BUF_MARK for a cloned buffer - u16 data_len; //!< length of data - u16 check_sum; //!< checksum field - u8 * data; //!< data buffer - u8 * header; //!< header -}; - -#define uffs_BufIsFree(buf) (buf->ref_count == 0 ? U_TRUE : U_FALSE) - -/** initialize page buffers */ -URET uffs_BufInit(struct uffs_DeviceSt *dev, int buf_max, int dirty_buf_max); - -/** release page buffers */ -URET uffs_BufReleaseAll(struct uffs_DeviceSt *dev); - -/** find the page buffer, move to link list head if found */ -uffs_Buf * uffs_BufGet(struct uffs_DeviceSt *dev, u16 parent, u16 serial, u16 page_id); -uffs_Buf *uffs_BufGetEx(struct uffs_DeviceSt *dev, u8 type, TreeNode *node, u16 page_id, int oflag); - -/** alloc a new page buffer */ -uffs_Buf *uffs_BufNew(struct uffs_DeviceSt *dev, u8 type, u16 parent, u16 serial, u16 page_id); - -/** find the page buffer (not affect the reference counter) */ -uffs_Buf * uffs_BufFind(uffs_Device *dev, u16 parent, u16 serial, u16 page_id); - -/** find the page buffer from #start (not affect the reference counter) */ -uffs_Buf * uffs_BufFindFrom(uffs_Device *dev, uffs_Buf *start, - u16 parent, u16 serial, u16 page_id); - -/** put page buffer back to pool, called in pair with #uffs_Get,#uffs_GetEx or #uffs_BufNew */ -URET uffs_BufPut(uffs_Device *dev, uffs_Buf *buf); - -/** increase buffer references */ -void uffs_BufIncRef(uffs_Buf *buf); - -/** decrease buffer references */ -void uffs_BufDecRef(uffs_Buf *buf); - -/** write data to a page buffer */ -URET uffs_BufWrite(struct uffs_DeviceSt *dev, uffs_Buf *buf, void *data, u32 ofs, u32 len); - -/** read data from a page buffer */ -URET uffs_BufRead(struct uffs_DeviceSt *dev, uffs_Buf *buf, void *data, u32 ofs, u32 len); - -/** mark buffer as #UFFS_BUF_EMPTY if ref_count == 0, and discard all data it holds */ -void uffs_BufMarkEmpty(uffs_Device *dev, uffs_Buf *buf); - -/** if there is no free dirty group slot, flush the most dirty group */ -URET uffs_BufFlush(struct uffs_DeviceSt *dev); -URET uffs_BufFlushEx(struct uffs_DeviceSt *dev, UBOOL force_block_recover); - -/** flush dirty group */ -URET uffs_BufFlushGroup(struct uffs_DeviceSt *dev, u16 parent, u16 serial); -URET uffs_BufFlushGroupEx(struct uffs_DeviceSt *dev, u16 parent, u16 serial, UBOOL force_block_recover); - -/** find free dirty group slot */ -int uffs_BufFindFreeGroupSlot(struct uffs_DeviceSt *dev); - -/** find the dirty group slot */ -int uffs_BufFindGroupSlot(struct uffs_DeviceSt *dev, u16 parent, u16 serial); - -/** lock dirty group */ -URET uffs_BufLockGroup(struct uffs_DeviceSt *dev, int slot); - -/** unlock dirty group */ -URET uffs_BufUnLockGroup(struct uffs_DeviceSt *dev, int slot); - -/** flush most dirty group */ -URET uffs_BufFlushMostDirtyGroup(struct uffs_DeviceSt *dev); - -/** flush all groups under the same parent number */ -URET uffs_BufFlushGroupMatchParent(struct uffs_DeviceSt *dev, u16 parent); - -/** flush all page buffers */ -URET uffs_BufFlushAll(struct uffs_DeviceSt *dev); - -/** no one holding any page buffer ? safe to release page buffers */ -UBOOL uffs_BufIsAllFree(struct uffs_DeviceSt *dev); - -/** are all page buffer marked with #UFFS_BUF_EMPTY ? */ -UBOOL uffs_BufIsAllEmpty(struct uffs_DeviceSt *dev); - -/** mark all page buffer as #UFFS_BUF_EMPTY */ -URET uffs_BufSetAllEmpty(struct uffs_DeviceSt *dev); - -/** clone a page buffer */ -uffs_Buf * uffs_BufClone(struct uffs_DeviceSt *dev, uffs_Buf *buf); - -/** release a cloned page buffer, call in pair with #uffs_BufClone */ -URET uffs_BufFreeClone(uffs_Device *dev, uffs_Buf *buf); - -/** load physical storage data to page buffer */ -URET uffs_BufLoadPhyData(uffs_Device *dev, uffs_Buf *buf, u32 block, u32 page); - -/** load physical storage data to page buffer withouth checking ECC */ -URET uffs_LoadPhyDataToBufEccUnCare(uffs_Device *dev, uffs_Buf *buf, u32 block, u32 page); - -/** showing page buffers info, for debug only */ -void uffs_BufInspect(uffs_Device *dev); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_core.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_core.h deleted file mode 100644 index 1f18007f0f..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_core.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_CORE_H_ -#define _UFFS_CORE_H_ - -#ifdef __cplusplus -extern "C"{ -#endif - -/** \typedef uffs_Device */ -typedef struct uffs_DeviceSt uffs_Device; -/** \typedef uffs_FlashOps */ -typedef struct uffs_FlashOpsSt uffs_FlashOps; - -typedef struct uffs_BlockInfoSt uffs_BlockInfo; -typedef struct uffs_PageSpareSt uffs_PageSpare; -typedef struct uffs_TagsSt uffs_Tags; //!< UFFS page tags -typedef struct uffs_TagStoreSt uffs_TagStore; //!< UFFS page tags physical store structure - -typedef struct uffs_BufSt uffs_Buf; - - -#ifdef __cplusplus -} -#endif - - - -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_crc.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_crc.h deleted file mode 100644 index a31bb21c91..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_crc.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_crc.h - * \author Ricky Zheng, created 23 Nov, 2011 - */ - -#ifndef _UFFS_CRC_H_ -#define _UFFS_CRC_H_ - -#include "uffs/uffs_types.h" - -u16 uffs_crc16update(const void *data, int length, u16 crc); -u16 uffs_crc16sum(const void *data, int length); - -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_device.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_device.h deleted file mode 100644 index 22614528a3..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_device.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_device.h - * \brief uffs device structures definition - * \author Ricky Zheng - */ - -#ifndef UFFS_DEVICE_H -#define UFFS_DEVICE_H - -#include "uffs/uffs_types.h" -#include "uffs/uffs_buf.h" -#include "uffs/uffs_blockinfo.h" -#include "uffs/uffs_pool.h" -#include "uffs/uffs_tree.h" -#include "uffs/uffs_mem.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_flash.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * \def MAX_DIRTY_BUF_GROUPS - */ -#define MAX_DIRTY_BUF_GROUPS 3 - - -/** - * \struct uffs_BlockInfoCacheSt - * \brief block information structure, used to manager block information caches - */ -struct uffs_BlockInfoCacheSt { - uffs_BlockInfo *head; //!< buffer head of block info(spares) - uffs_BlockInfo *tail; //!< buffer tail - void *mem_pool; //!< internal memory pool, used for release whole buffer -}; - -/** - * \struct uffs_PartitionSt - * \brief partition basic information - */ -struct uffs_PartitionSt { - u16 start; //!< start block number of partition - u16 end; //!< end block number of partition -}; - -/** - * \struct uffs_LockSt - * \brief lock stuffs - */ -struct uffs_LockSt { - OSSEM sem; - int task_id; - int counter; -}; - -/** - * \struct uffs_DirtyGroupSt - * \brief manager dirty page buffers - */ -struct uffs_DirtyGroupSt { - int count; //!< dirty buffers count - int lock; //!< dirty group lock (0: unlocked, >0: locked) - uffs_Buf *dirty; //!< dirty buffer list -}; - -/** - * \struct uffs_PageBufDescSt - * \brief uffs page buffers descriptor - */ -struct uffs_PageBufDescSt { - uffs_Buf *head; //!< head of buffers - uffs_Buf *tail; //!< tail of buffers - struct uffs_DirtyGroupSt dirtyGroup[MAX_DIRTY_BUF_GROUPS]; //!< dirty buffer groups - int buf_max; //!< maximum buffers - int dirty_buf_max; //!< maximum dirty buffer allowed - void *pool; //!< memory pool for buffers -}; - - -/** - * \struct uffs_PageCommInfoSt - * \brief common data for device, should be initialised at early - * \note it is possible that pg_size is smaller than physical page size, but normally they are the same. - * \note page data layout: [HEADER] + [DATA] - */ -struct uffs_PageCommInfoSt { - u16 pg_data_size; //!< page data size - u16 header_size; //!< header size - u16 pg_size; //!< page size -}; - -/** - * \struct uffs_NewBadBlockSt - * \brief holding new discovered bad block - */ -struct uffs_NewBadBlockSt { - u16 block; //!< bad block, FIX ME to process more than one bad block -}; - -/** - * \struct uffs_FlashStatSt - * \typedef uffs_FlashStat - * \brief statistic data of flash read/write/erase activities - */ -typedef struct uffs_FlashStatSt { - int block_erase_count; - int page_write_count; - int page_read_count; - int page_header_read_count; - int spare_write_count; - int spare_read_count; - unsigned long io_read; - unsigned long io_write; -} uffs_FlashStat; - - -/** - * \struct uffs_ConfigSt - * \typedef uffs_Config - * \brief uffs config parameters - */ -typedef struct uffs_ConfigSt { - int bc_caches; - int page_buffers; - int dirty_pages; - int dirty_groups; - int reserved_free_blocks; -} uffs_Config; - - -/** - * \struct uffs_DeviceSt - * \brief The core data structure of UFFS, all information needed by manipulate UFFS object - * \note one partition corresponding one uffs device. - */ -struct uffs_DeviceSt { - URET (*Init)(uffs_Device *dev); //!< low level initialisation - URET (*Release)(uffs_Device *dev); //!< low level release - void *_private; //!< private data for device - - struct uffs_StorageAttrSt *attr; //!< storage attribute - struct uffs_PartitionSt par; //!< partition information - struct uffs_FlashOpsSt *ops; //!< flash operations - struct uffs_BlockInfoCacheSt bc; //!< block info cache - struct uffs_LockSt lock; //!< lock data structure - struct uffs_PageBufDescSt buf; //!< page buffers - struct uffs_PageCommInfoSt com; //!< common information - struct uffs_TreeSt tree; //!< tree list of block - struct uffs_NewBadBlockSt bad; //!< new discovered bad block - struct uffs_FlashStatSt st; //!< statistic (counters) - struct uffs_memAllocatorSt mem; //!< uffs memory allocator - struct uffs_ConfigSt cfg; //!< uffs config - u32 ref_count; //!< device reference count - int dev_num; //!< device number (partition number) -}; - - -/** create the lock for uffs device */ -void uffs_DeviceInitLock(uffs_Device *dev); - -/** delete the lock of uffs device */ -void uffs_DeviceReleaseLock(uffs_Device *dev); - -/** lock uffs device */ -void uffs_DeviceLock(uffs_Device *dev); - -/** unlock uffs device */ -void uffs_DeviceUnLock(uffs_Device *dev); - - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_ecc.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_ecc.h deleted file mode 100644 index 18fbd92a38..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_ecc.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_ecc.h - * \brief file handle operations - * \author Ricky Zheng, created 8th Jun, 2005 - */ - -#ifndef _UFFS_ECC_H_ -#define _UFFS_ECC_H_ - -#include - -#include "uffs/uffs_fs.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - - -#define MAX_ECC_LENGTH 24 //!< 2K page ecc length is 24 bytes. - -/** - * calculate ECC - * \return length of generated ECC. (3 bytes ECC per 256 data) - */ -int uffs_EccMake(const void *data, int data_len, void *ecc); - -/** - * correct data by ECC. - * - * return: 0 -- no error - * -1 -- can not be corrected - * >0 -- how many bits are corrected - */ -int uffs_EccCorrect(void *data, int data_len, void *read_ecc, const void *test_ecc); - - -/** - * generate 12 bit ecc for maximum 8 bytes data - */ -u16 uffs_EccMake8(const void *data, int data_len); - -/** - * correct maximum 8 bytes data from 12 bits ECC - * - * return: 0 -- no error - * -1 -- can not be corrected - * >0 -- how many bits are corrected - */ -int uffs_EccCorrect8(void *data, u16 read_ecc, u16 test_ecc, int errtop); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_fd.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_fd.h deleted file mode 100644 index c5d8159074..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_fd.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fd.h - * \brief PISIX like file operations - * \author Ricky Zheng, created 8th Jun, 2005 - */ - -#ifndef _UFFS_FD_H_ -#define _UFFS_FD_H_ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include "uffs/uffs.h" - -/** - * \brief definitions for uffs_stat::st_mode - */ -#define US_IFMT 0xF000 /* file type make */ -#define US_IFREG 0x8000 /* regular */ -#define US_IFLNK 0xA000 /* symbolic link */ -#define US_IFDIR 0x4000 /* directory */ -#define US_IREAD 0000400 /* read permission */ -#define US_IWRITE 0000200 /* write permission */ - -#define US_IRWXU 00700 /* RWX owner */ -#define US_IRUSR 00400 /* R owner */ -#define US_IWUSR 00200 /* W owner */ -#define US_IXUSR 00100 /* X owner */ -#define US_IRWXG 00070 /* RWX group */ -#define US_IRGRP 00040 /* R group */ -#define US_IWGRP 00020 /* W group */ -#define US_IXGRP 00010 /* X group */ -#define US_IRWXO 00007 /* RWX other */ -#define US_IROTH 00004 /* R other */ -#define US_IWOTH 00002 /* W other */ -#define US_IXOTH 00001 /* X other */ - -/** - * \brief POSIX dirent - */ -struct uffs_dirent { - int d_ino; /* inode number (serial number of this object) */ - int d_off; /* offset to this dirent */ - unsigned short int d_reclen; /* length of this uffs_dirent */ - unsigned short int d_namelen; /* length of this d_name */ - unsigned char d_type; /* type of this record */ - char d_name[256]; /* name of this object */ -}; - -struct uffs_dirSt; -typedef struct uffs_dirSt uffs_DIR; - -/** - * \brief POSIX stat - */ -struct uffs_stat { - int st_dev; /* ID of device containing file */ - int st_ino; /* inode number */ - int st_mode; /* protection */ - int st_nlink; /* number of hard links */ - int st_uid; /* user ID of owner */ - int st_gid; /* group ID of owner */ - int st_rdev; /* device ID (if special file) */ - long st_size; /* total size, in bytes */ - int st_blksize; /* blocksize for filesystem I/O */ - int st_blocks; /* number of blocks allocated */ - unsigned int st_atime; /* time of last access */ - unsigned int st_mtime; /* time of last modification */ - unsigned int st_ctime; /* time of last status change */ -}; - -/* POSIX complaint file system APIs */ - -int uffs_open(const char *name, int oflag, ...); -int uffs_close(int fd); -int uffs_read(int fd, void *data, int len); -int uffs_write(int fd, const void *data, int len); -long uffs_seek(int fd, long offset, int origin); -long uffs_tell(int fd); -int uffs_eof(int fd); -int uffs_flush(int fd); -int uffs_rename(const char *old_name, const char *new_name); -int uffs_remove(const char *name); -int uffs_ftruncate(int fd, long remain); - -int uffs_mkdir(const char *name, ...); -int uffs_rmdir(const char *name); - -int uffs_stat(const char *name, struct uffs_stat *buf); -int uffs_lstat(const char *name, struct uffs_stat *buf); -int uffs_fstat(int fd, struct uffs_stat *buf); - -int uffs_closedir(uffs_DIR *dirp); -uffs_DIR * uffs_opendir(const char *path); -struct uffs_dirent * uffs_readdir(uffs_DIR *dirp); - -void uffs_rewinddir(uffs_DIR *dirp); - - -int uffs_get_error(void); -int uffs_set_error(int err); - -int uffs_version(void); -int uffs_format(const char *mount_point); - -long uffs_space_total(const char *mount_point); -long uffs_space_used(const char *mount_point); -long uffs_space_free(const char *mount_point); - -void uffs_flush_all(const char *mount_point); - -#ifdef __cplusplus -} -#endif -#endif - - - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_find.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_find.h deleted file mode 100644 index 3408cf33c6..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_find.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_find.h - * \brief find objects under dir - * \author Ricky Zheng - */ - -#ifndef _UFFS_FIND_H_ -#define _UFFS_FIND_H_ - -#include "uffs/uffs_fs.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -typedef struct uffs_FindInfoSt { - uffs_Device *dev; //!< the device to be searched - u16 serial; //!< the dir serial number - int step; //!< step: 0 - working on dir entries, - // 1 - working on file entries, - // 2 - stoped. - int hash; //!< hash entry, internal used - TreeNode *work; //!< working node, internal used. - int pos; //!< current position -} uffs_FindInfo; - - -URET uffs_GetObjectInfo(uffs_Object *obj, uffs_ObjectInfo *info, int *err); -URET uffs_FindObjectOpen(uffs_FindInfo *find_handle, uffs_Object *dir); -URET uffs_FindObjectOpenEx(uffs_FindInfo *f, uffs_Device *dev, int dir); -URET uffs_FindObjectFirst(uffs_ObjectInfo *info, uffs_FindInfo *find_handle); -URET uffs_FindObjectNext(uffs_ObjectInfo *info, uffs_FindInfo *find_handle); -URET uffs_FindObjectRewind(uffs_FindInfo *find_handle); -URET uffs_FindObjectClose(uffs_FindInfo * find_handle); - - -#ifdef __cplusplus -} -#endif - - -#endif - - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_flash.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_flash.h deleted file mode 100644 index 844d8ea231..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_flash.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_public.h - * \brief flash interface for UFFS - * \author Ricky Zheng - */ - -#ifndef _UFFS_FLASH_H_ -#define _UFFS_FLASH_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_fs.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/** ECC options (uffs_StorageAttrSt.ecc_opt) */ -#define UFFS_ECC_NONE 0 //!< do not use ECC -#define UFFS_ECC_SOFT 1 //!< UFFS calculate the ECC -#define UFFS_ECC_HW 2 //!< Flash driver(or by hardware) calculate the ECC -#define UFFS_ECC_HW_AUTO 3 //!< Hardware calculate the ECC and automatically write to spare. - -#define UFFS_ECC_OPTION_STRING \ - { "none", "soft", "hw", "auto" } // index is the ecc option value. - -/** spare layout options (uffs_StorageAttrSt.layout_opt) */ -#define UFFS_LAYOUT_UFFS 0 //!< do layout by dev->attr information -#define UFFS_LAYOUT_FLASH 1 //!< flash driver do the layout - -#define UFFS_SPARE_LAYOUT_SIZE 16 //!< maximum spare layout array size, 2 segments - -/** flash operation return code */ -#define UFFS_FLASH_NO_ERR 0 //!< no error -#define UFFS_FLASH_ECC_OK 1 //!< bit-flip found, but corrected by ECC -#define UFFS_FLASH_NOT_SEALED 2 //!< page spare area is not sealed properly (only for ReadPageWithLayout()) -#define UFFS_FLASH_IO_ERR -1 //!< I/O error -#define UFFS_FLASH_ECC_FAIL -2 //!< ECC failed -#define UFFS_FLASH_BAD_BLK -3 //!< bad block -#define UFFS_FLASH_CRC_ERR -4 //!< CRC failed -#define UFFS_FLASH_UNKNOWN_ERR -100 //!< unkown error? - -#define UFFS_FLASH_HAVE_ERR(e) ((e) < 0) - -#if defined(CONFIG_BAD_BLOCK_POLICY_STRICT) -# define UFFS_FLASH_IS_BAD_BLOCK(e) \ - ((e) == UFFS_FLASH_ECC_FAIL || (e) == UFFS_FLASH_ECC_OK || (e) == UFFS_FLASH_BAD_BLK || (e) == UFFS_FLASH_CRC_ERR) -#else -# define UFFS_FLASH_IS_BAD_BLOCK(e) \ - ((e) == UFFS_FLASH_ECC_FAIL || (e) == UFFS_FLASH_BAD_BLK || (e) == UFFS_FLASH_CRC_ERR) -#endif - - -/** defines for page info (data length and data sum) */ -#define UFFS_PAGE_INFO_CLEAN 0xFFFFFFFF -#define UFFS_PAGE_INFO_IOERR 0xDEADFFFF -#define UFFS_PAGE_GET_LEN(info) (info & 0xFFFF) -#define UFFS_PAGE_GET_DSUM(info) (info >> 16) -#define UFFS_PAGE_MAKE_INFO(d_len, d_sum) ((d_sum << 16) | d_len) - -/** - * \struct uffs_StorageAttrSt - * \brief uffs device storage attribute, provide by nand specific file - */ -struct uffs_StorageAttrSt { - u32 total_blocks; //!< total blocks in this chip - u16 page_data_size; //!< page data size (physical page data size, e.g. 512) - u16 pages_per_block; //!< pages per block - u8 spare_size; //!< page spare size (physical page spare size, e.g. 16) - u8 block_status_offs; //!< block status byte offset in spare - int ecc_opt; //!< ecc option ( #UFFS_ECC_[NONE|SOFT|HW|HW_AUTO] ) - int layout_opt; //!< layout option (#UFFS_LAYOUT_UFFS or #UFFS_LAYOUT_FLASH) - int ecc_size; //!< ecc size in bytes - const u8 *ecc_layout; //!< page data ECC layout: [ofs1, size1, ofs2, size2, ..., 0xFF, 0] - const u8 *data_layout; //!< spare data layout: [ofs1, size1, ofs2, size2, ..., 0xFF, 0] - u8 _uffs_ecc_layout[UFFS_SPARE_LAYOUT_SIZE]; //!< uffs spare ecc layout - u8 _uffs_data_layout[UFFS_SPARE_LAYOUT_SIZE]; //!< uffs spare data layout - void *_private; //!< private data for storage attribute -}; - - -/** - * \struct uffs_FlashOpsSt - * \brief low level flash operations, should be implement in flash driver - */ -struct uffs_FlashOpsSt { - /** - * Initilize flash driver, called once when UFFS initilize partition - * - * \return 0 if no error, return -1 when failed. - * - * \note This function is optional. - */ - int (*InitFlash)(uffs_Device *dev); - - /** - * Release flash driver, called once when UFFS unmount partition - * - * \return 0 if no error, return -1 when failed. - * - * \note This function is optional. - */ - int (*ReleaseFlash)(uffs_Device *dev); - - /** - * Read a full nand page, UFFS do the layout. - * - * \param[out] ecc ecc of page data - * if ecc_opt is UFFS_ECC_HW, flash driver must calculate and return ecc of data(if ecc != NULL). - * if ecc_opt is UFFS_ECC_HW_AUTO, flash driver do ecc correction before return data and flash driver do not need to return ecc. - * if ecc_opt is UFFS_ECC_NONE or UFFS_ECC_SOFT, flash driver do not need to calculate data ecc and return ecc. - * - * \return #UFFS_FLASH_NO_ERR: success and/or has no flip bits. - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_ECC_FAIL: page data has flip bits and ecc correct failed (when ecc_opt == UFFS_ECC_HW_AUTO) - * #UFFS_FLASH_ECC_OK: page data has flip bits and corrected by ecc (when ecc_opt == UFFS_ECC_HW_AUTO) - * #UFFS_FLASH_BAD_BLK: if the block is a bad block (e.g., the bad block mark byte is not 0xFF). - * - * \note if data is NULL, do not return data; if spare is NULL, do not return spare; if both data and spare are all NULL, - * then read bad block mark and return UFFS_FLASH_BAD_BLK if bad block mark is not 0xFF. - * - * \note pad 0xFF for calculating ECC if len < page_data_size - */ - int (*ReadPage)(uffs_Device *dev, u32 block, u32 page, u8 *data, int data_len, u8 *ecc, - u8 *spare, int spare_len); - - /** - * Read a full nand page, driver do the layout. - * - * \param[out] ecc ecc of page data - * if ecc_opt is UFFS_ECC_HW, flash driver must calculate and return ecc of data(if ecc != NULL). - * if ecc_opt is UFFS_ECC_HW_AUTO, flash driver do ecc correction before return data and flash driver do not need to return ecc. - * if ecc_opt is UFFS_ECC_NONE or UFFS_ECC_SOFT, flash driver do not need calculate data ecc and return ecc. - * - * \param[out] ecc_store ecc store on spare area - * if ecc_opt is UFFS_ECC_NONE or UFFS_ECC_HW_AUTO, do not need to return ecc_store. - * - * \note flash driver must provide this function if layout_opt is UFFS_LAYOUT_FLASH. - * UFFS will use this function (if exist) prio to 'ReadPageSpare()' - * - * \return #UFFS_FLASH_NO_ERR: success - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_ECC_FAIL: page data has flip bits and ecc correct failed (when ecc_opt == UFFS_ECC_HW_AUTO) - * #UFFS_FLASH_ECC_OK: page data has flip bits and corrected by ecc (when ecc_opt == UFFS_ECC_HW_AUTO) - * #UFFS_FLASH_BAD_BLK: if the block is a bad block (e.g., the bad block mark byte is not 0xFF) - * #UFFS_FLASH_NOT_SEALED: if the page spare is not sealed properly - * - * \note if data is NULL, do not return data; if ts is NULL, do not read tag; if both data and ts are NULL, - * then read bad block mark and return UFFS_FLASH_BAD_BLK if bad block mark is not 0xFF. - * - * \note flash driver DO NOT need to do ecc correction for tag, - * UFFS will take care of tag ecc. - */ - int (*ReadPageWithLayout)(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc, - uffs_TagStore *ts, u8 *ecc_store); - - /** - * Write a full page, UFFS do the layout for spare area. - * - * \note If you have ecc_opt UFFS_ECC_HW or UFFS_ECC_HW_AUTO, you MUST implement WritePageWithLayout(). - * Implement WritePage() function if you have ecc_opt UFFS_ECC_NONE or UFFS_ECC_SOFT and - * WritePageWithLayout() is not implemented. - * - * \note If data == NULL && spare == NULL, driver should mark this block as a 'bad block'. - * - * \return #UFFS_FLASH_NO_ERR: success - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_BAD_BLK: a bad block detected. - */ - int (*WritePage)(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *spare, int spare_len); - - /** - * Write full page, flash driver do the layout for spare area. - * - * \note if layout_opt is UFFS_LAYOUT_FLASH or ecc_opt is UFFS_ECC_HW/UFFS_ECC_HW_AUTO, flash driver MUST implement - * this function. UFFS will use this function (if provided) prio to 'WritePage()' - * - * \param[in] ecc ecc of data. if ecc_opt is UFFS_ECC_SOFT and this function is implemented, - * UFFS will calculate page data ecc and pass it to WritePageWithLayout(). - * if ecc_opt is UFFS_ECC_NONE/UFFS_ECC_HW/UFFS_ECC_HW_AUTO, UFFS pass ecc = NULL. - * - * \note If data == NULL && ts == NULL, driver should mark this block as a 'bad block'. - * - * \return #UFFS_FLASH_NO_ERR: success - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_BAD_BLK: a bad block detected. - */ - int (*WritePageWithLayout)(uffs_Device *dev, u32 block, u32 page, - const u8 *data, int data_len, const u8 *ecc, const uffs_TagStore *ts); - - /** - * Check block status. - * - * \note flash driver may maintain a bad block table to speed up bad block checking or - * it will require one or two read spare I/O to check block status. - * - * \note if this function is not implented by driver, UFFS check the block_status byte in spare. - * - * \return 1 if it's a bad block, 0 if it's not. - */ - int (*IsBadBlock)(uffs_Device *dev, u32 block); - - /** - * Mark a new bad block. - * - * \note if this function is not implemented, UFFS mark bad block by call 'WritePage()/WritePageWithLayout()' - * with: data == NULL && spare == NULL && ts == NULL. - * - * \return 0 if success, otherwise return -1. - */ - int (*MarkBadBlock)(uffs_Device *dev, u32 block); - - /** - * Erase a block, driver MUST implement this function. - * - * \return #UFFS_FLASH_NO_ERR: success - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_BAD_BLK: a bad block detected. - */ - int (*EraseBlock)(uffs_Device *dev, u32 block); -}; - -/** make spare from tag store and ecc */ -void uffs_FlashMakeSpare(uffs_Device *dev, const uffs_TagStore *ts, const u8 *ecc, u8* spare); - -/** unload tag and ecc from spare */ -void uffs_FlashUnloadSpare(uffs_Device *dev, const u8 *spare, struct uffs_TagStoreSt *ts, u8 *ecc); - -/** read page spare and fill to tag */ -int uffs_FlashReadPageTag(uffs_Device *dev, int block, int page, uffs_Tags *tag); - -/** read page data to page buf and do ECC correct */ -int uffs_FlashReadPage(uffs_Device *dev, int block, int page, uffs_Buf *buf, UBOOL skip_ecc); - -/** write page data and spare */ -int uffs_FlashWritePageCombine(uffs_Device *dev, int block, int page, uffs_Buf *buf, uffs_Tags *tag); - -/** Mark this block as bad block */ -int uffs_FlashMarkBadBlock(uffs_Device *dev, int block); - -/** Is this block a bad block ? */ -UBOOL uffs_FlashIsBadBlock(uffs_Device *dev, int block); - -/** Erase flash block */ -int uffs_FlashEraseBlock(uffs_Device *dev, int block); - -/* mark a clean page as 'dirty' (and 'invalid') */ -int uffs_FlashMarkDirtyPage(uffs_Device *dev, uffs_BlockInfo *bc, int page); - -/* check if the block pages are all clean */ -URET uffs_FlashCheckErasedBlock(uffs_Device *dev, int block); - -/** - * get page head info - * - * \return #UFFS_PAGE_INFO_IOERR if I/O error, otherwise return page info - */ -u32 uffs_FlashGetPageInfo(uffs_Device *dev, int block, int page); - -/** load uffs_FileInfo from flash storage */ -URET uffs_FlashReadFileinfoPhy(uffs_Device *dev, int block, int page, uffs_FileInfo *info); - -/** - * Initialize UFFS flash interface - */ -URET uffs_FlashInterfaceInit(uffs_Device *dev); - -/** - * Release UFFS flash interface - */ -URET uffs_FlashInterfaceRelease(uffs_Device *dev); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_fs.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_fs.h deleted file mode 100644 index 7bda09052e..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_fs.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fs.h - * \brief uffs basic file operations - * \author Ricky Zheng - */ - -#ifndef _UFFS_FS_H_ -#define _UFFS_FS_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** file object */ -struct uffs_ObjectSt { - /******* objects manager ********/ - int dev_lock_count; - int dev_get_count; - - /******** init level 0 ********/ - const char * name; //!< pointer to the start of name, for open or create - u32 name_len; //!< name length - u16 sum; //!< sum of name - uffs_Device *dev; //!< uffs device - u32 oflag; - u8 type; - u16 head_pages; //!< data pages on file head block - u16 parent; - - /******* init level 1 ********/ - TreeNode *node; //!< file entry node in tree - u16 serial; - - /******* output ******/ - int err; //!< error number - - /******* current *******/ - u32 pos; //!< current position in file - - /***** others *******/ - UBOOL attr_loaded; //!< attributes loaded ? - UBOOL open_succ; //!< U_TRUE or U_FALSE - -}; - -typedef struct uffs_ObjectSt uffs_Object; - - - -#define uffs_GetObjectErr(obj) ((obj)->err) -#define uffs_ClearObjectErr(obj) do { (obj)->err = UENOERR; } while (0) - -uffs_Pool * uffs_GetObjectPool(void); - -URET uffs_InitObjectBuf(void); -URET uffs_ReleaseObjectBuf(void); -int uffs_PutAllObjectBuf(uffs_Device *dev); -uffs_Object * uffs_GetObject(void); -void uffs_PutObject(uffs_Object *obj); -int uffs_GetObjectIndex(uffs_Object *obj); -uffs_Object * uffs_GetObjectByIndex(int idx); - - -/** - * Re-initialize an object. - * should call this function if you want to re-use an object. - */ -URET uffs_ReInitObject(uffs_Object *obj); - -URET uffs_ParseObject(uffs_Object *obj, const char *name); - -URET uffs_CreateObjectEx(uffs_Object *obj, uffs_Device *dev, - int dir, const char *name, int name_len, int oflag); -URET uffs_OpenObjectEx(uffs_Object *obj, uffs_Device *dev, - int dir, const char *name, int name_len, int oflag); - -URET uffs_OpenObject(uffs_Object *obj, const char *fullname, int oflag); -URET uffs_TruncateObject(uffs_Object *obj, u32 remain); -URET uffs_CreateObject(uffs_Object *obj, const char *fullname, int oflag); - -URET uffs_CloseObject(uffs_Object *obj); -int uffs_WriteObject(uffs_Object *obj, const void *data, int len); -int uffs_ReadObject(uffs_Object *obj, void *data, int len); -long uffs_SeekObject(uffs_Object *obj, long offset, int origin); -int uffs_GetCurOffset(uffs_Object *obj); -int uffs_EndOfFile(uffs_Object *obj); -URET uffs_FlushObject(uffs_Object *obj); - -URET uffs_RenameObject(const char *old_name, const char *new_name, int *err); -URET uffs_DeleteObject(const char * name, int *err); - -int uffs_GetFreeObjectHandlers(void); - - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_mem.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_mem.h deleted file mode 100644 index ad9a38f458..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_mem.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_MEM_H_ -#define _UFFS_MEM_H_ - -#include "uffs/uffs_device.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** uffs memory allocator */ -typedef struct uffs_memAllocatorSt { - URET (*init)(struct uffs_DeviceSt *dev); //!< init memory allocator, setup buffer sizes - URET (*release)(struct uffs_DeviceSt *dev); //!< release memory allocator (for dynamic memory allocation) - - void * (*malloc)(struct uffs_DeviceSt *dev, unsigned int size); //!< allocate memory (for dynamic memory allocation) - URET (*free)(struct uffs_DeviceSt *dev, void *p); //!< free memory (for dynamic memory allocation) - - void * blockinfo_pool_buf; //!< block info cache buffers - void * pagebuf_pool_buf; //!< page buffers - void * tree_nodes_pool_buf; //!< tree nodes buffer - void * spare_pool_buf; //!< spare buffers - - int blockinfo_pool_size; //!< block info cache buffers size - int pagebuf_pool_size; //!< page buffers size - int tree_nodes_pool_size; //!< tree nodes buffer size - int spare_pool_size; //!< spare buffer pool size - - uffs_Pool tree_pool; - uffs_Pool spare_pool; - - int spare_data_size; //!< spare size consumed by UFFS, - //!< calculated by UFFS according to the layout information. - - /* for static memory allocator */ - char *buf_start; - int buf_size; - int pos; - - -} uffs_MemAllocator; - -void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator); -void uffs_MemSetupStaticAllocator(uffs_MemAllocator *allocator, void *pool, int size); - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_mtb.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_mtb.h deleted file mode 100644 index 41259e57e9..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_mtb.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_mtb.h - * \brief mount table related stuff - * \author Ricky Zheng - */ - -#ifndef _UFFS_MTB_H_ -#define _UFFS_MTB_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -typedef struct uffs_MountTableEntrySt { - uffs_Device *dev; // UFFS 'device' - core internal data structure for partition - int start_block; // partition start block - int end_block; // partition end block ( if < 0, reserve space form the end of storage) - const char *mount; // mount point - struct uffs_MountTableEntrySt *prev; - struct uffs_MountTableEntrySt *next; -} uffs_MountTable; - -/** Register mount entry, will be put at 'unmounted' list */ -int uffs_RegisterMountTable(uffs_MountTable *mtb); - -/** Remove mount entry from the list */ -int uffs_UnRegisterMountTable(uffs_MountTable *mtb); - -/** mount partition */ -int uffs_Mount(const char *mount); - -/** unmount parttion */ -int uffs_UnMount(const char *mount); - -/** get mounted entry list */ -uffs_MountTable * uffs_MtbGetMounted(void); - -/** get unmounted entry list */ -uffs_MountTable * uffs_MtbGetUnMounted(void); - -/** get matched mount point from absolute path */ -int uffs_GetMatchedMountPointSize(const char *path); - -/** get uffs device from mount point */ -uffs_Device * uffs_GetDeviceFromMountPoint(const char *mount); - -/** get uffs device from mount point */ -uffs_Device * uffs_GetDeviceFromMountPointEx(const char *mount, int len); - -/** get mount point name from uffs device */ -const char * uffs_GetDeviceMountPoint(uffs_Device *dev); - -/** down crease uffs device references by uffs_GetDeviceXXX() */ -void uffs_PutDevice(uffs_Device *dev); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_os.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_os.h deleted file mode 100644 index b75e77bcc9..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_os.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_OS_H_ -#define _UFFS_OS_H_ - -#include -#define RT_THREAD -#if !defined(RT_THREAD) -#include -#endif - -#ifdef __cplusplus -extern "C"{ -#endif - -#define UFFS_TASK_ID_NOT_EXIST -1 - -typedef void * OSSEM; -#define OSSEM_NOT_INITED (NULL) - -#if !defined(RT_THREAD) -struct uffs_DebugMsgOutputSt { - void (*output)(const char *msg); - void (*vprintf)(const char *fmt, va_list args); -}; - -void uffs_SetupDebugOutput(void); -#endif - -/* OS specific functions */ -int uffs_SemCreate(OSSEM *sem); -int uffs_SemWait(OSSEM sem); -int uffs_SemSignal(OSSEM sem); -int uffs_SemDelete(OSSEM *sem); - -int uffs_OSGetTaskId(void); //get current task id -unsigned int uffs_GetCurDateTime(void); - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_pool.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_pool.h deleted file mode 100644 index 78826fc246..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_pool.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_pool.h - * \brief Fast fixed size memory pool management. - * \author Ricky Zheng, Simon Kallweit - */ - -#ifndef _UFFS_POOL_H_ -#define _UFFS_POOL_H_ - - -#include "uffs/uffs_types.h" -#include "uffs/uffs_os.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * \struct uffs_PoolEntrySt - * \brief Helper type for free buffer entries. - */ -typedef struct uffs_PoolEntrySt { - struct uffs_PoolEntrySt *next; -} uffs_PoolEntry; - -/** - * \struct uffs_PoolSt - * \brief Memory pool. - */ -typedef struct uffs_PoolSt { - u8 *mem; //!< memory pool - u32 buf_size; //!< size of a buffer - u32 num_bufs; //!< number of buffers in the pool - uffs_PoolEntry *free_list; //!< linked list of free buffers - OSSEM sem; //!< buffer lock -} uffs_Pool; - -URET uffs_PoolInit(uffs_Pool *pool, void *mem, u32 mem_size, u32 buf_size, u32 num_bufs); -URET uffs_PoolRelease(uffs_Pool *pool); - -UBOOL uffs_PoolVerify(uffs_Pool *pool, void *p); - -void *uffs_PoolGet(uffs_Pool *pool); -void *uffs_PoolGetLocked(uffs_Pool *pool); - -int uffs_PoolPut(uffs_Pool *pool, void *p); -int uffs_PoolPutLocked(uffs_Pool *pool, void *p); - -void *uffs_PoolGetBufByIndex(uffs_Pool *pool, u32 index); -u32 uffs_PoolGetIndex(uffs_Pool *pool, void *p); -UBOOL uffs_PoolCheckFreeList(uffs_Pool *pool, void *p); - -void * uffs_PoolFindNextAllocated(uffs_Pool *pool, void *from); - -int uffs_PoolGetFreeCount(uffs_Pool *pool); -int uffs_PoolPutAll(uffs_Pool *pool); - -#ifdef __cplusplus -} -#endif - -#endif // _UFFS_POOL_H_ diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_public.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_public.h deleted file mode 100644 index 9c22004898..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_public.h +++ /dev/null @@ -1,336 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_public.h - * \brief public data structures for uffs - * \author Ricky Zheng - */ - -#ifndef _UFFS_PUBLIC_H_ -#define _UFFS_PUBLIC_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs.h" -#include "uffs/uffs_pool.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#ifndef ARRAY_SIZE -# define ARRAY_SIZE(ar) (sizeof(ar) / sizeof(ar[0])) -#endif - -#ifndef offsetof -# define offsetof(T, x) ((size_t) &((T *)0)->x) -#endif -#ifndef container_of -#define container_of(p, T, x) ((T *)((char *)(p) - offsetof(T,x))) -#endif - -/** - * \def MAX_FILENAME_LENGTH - * \note Be careful: it's part of the physical format (see: uffs_FileInfoSt.name) - * !!DO NOT CHANGE IT AFTER FILE SYSTEM IS FORMATED!! - */ -#define MAX_FILENAME_LENGTH 128 - -/** \note 8-bits attr goes to uffs_dirent::d_type */ -#define FILE_ATTR_DIR (1 << 7) //!< attribute for directory -#define FILE_ATTR_WRITE (1 << 0) //!< writable - - -/** - * \structure uffs_FileInfoSt - * \brief file/dir entry info in physical storage format - */ -struct uffs_FileInfoSt { - u32 attr; //!< file/dir attribute - u32 create_time; - u32 last_modify; - u32 access; - u32 reserved; - u32 name_len; //!< length of file/dir name - char name[MAX_FILENAME_LENGTH]; -}; //6*4 + sizeof(name) = 24 + 128 = 152 Bytes -typedef struct uffs_FileInfoSt uffs_FileInfo; - -/** - * \struct uffs_ObjectInfoSt - * \brief object info - */ -typedef struct uffs_ObjectInfoSt { - uffs_FileInfo info; - u32 len; //!< length of file - u16 serial; //!< object serial num -} uffs_ObjectInfo; - - -/** - * \struct uffs_TagStoreSt - * \brief uffs tag, 8 bytes, will be store in page spare area. - */ -struct uffs_TagStoreSt { - u32 dirty:1; //!< 0: dirty, 1: clear - u32 valid:1; //!< 0: valid, 1: invalid - u32 type:2; //!< block type: #UFFS_TYPE_DIR, #UFFS_TYPE_FILE, #UFFS_TYPE_DATA - u32 block_ts:2; //!< time stamp of block; - u32 data_len:12; //!< length of page data - u32 serial:14; //!< serial number - - u32 parent:10; //!< parent's serial number - u32 page_id:6; //!< page id - u32 reserved:4; //!< reserved, for UFFS2 - u32 tag_ecc:12; //!< tag ECC -}; - -#define TAG_ECC_DEFAULT (0xFFF) //!< 12-bit '1' - - -/** - * \struct uffs_TagsSt - */ -struct uffs_TagsSt { - struct uffs_TagStoreSt s; /* store must be the first member */ - - /** data_sum for file or dir name */ - u16 data_sum; - - /** internal used */ - u8 seal_byte; //!< seal byte. -}; - -/** - * \struct uffs_MiniHeaderSt - * \brief the mini header resides on the head of page data - */ -struct uffs_MiniHeaderSt { - u8 status; - u8 reserved; - u16 crc; -}; - - -/** uffs_TagsSt.dirty */ -#define TAG_VALID 0 -#define TAG_INVALID 1 - -/** uffs_TagsSt.valid */ -#define TAG_DIRTY 0 -#define TAG_CLEAR 1 - -#define TAG_IS_DIRTY(tag) (*((u32 *) &((tag)->s)) != 0xFFFFFFFF) // tag is dirty if first 4 bytes not all 0xFF -#define TAG_IS_VALID(tag) ((tag)->s.valid == TAG_VALID) -#define TAG_IS_SEALED(tag) ((tag)->seal_byte != 0xFF) - -#define TAG_IS_GOOD(tag) (TAG_IS_SEALED(tag) && TAG_IS_VALID(tag)) - -#define TAG_VALID_BIT(tag) (tag)->s.valid -#define TAG_DIRTY_BIT(tag) (tag)->s.dirty -#define TAG_SERIAL(tag) (tag)->s.serial -#define TAG_PARENT(tag) (tag)->s.parent -#define TAG_PAGE_ID(tag) (tag)->s.page_id -#define TAG_DATA_LEN(tag) (tag)->s.data_len -#define TAG_TYPE(tag) (tag)->s.type -#define TAG_BLOCK_TS(tag) (tag)->s.block_ts -#define SEAL_TAG(tag) (tag)->seal_byte = 0 - -int uffs_GetFirstBlockTimeStamp(void); -int uffs_GetNextBlockTimeStamp(int prev); -UBOOL uffs_IsSrcNewerThanObj(int src, int obj); - - -#include "uffs_device.h" - - - -/********************************** debug & error *************************************/ -#define UFFS_MSG_NOISY -1 -#define UFFS_MSG_NORMAL 0 -#define UFFS_MSG_SERIOUS 1 -#define UFFS_MSG_DEAD 2 -#define UFFS_MSG_NOMSG 100 - -#define TENDSTR "\n" - -#if !defined(RT_THREAD) -struct uffs_DebugMsgOutputSt; -URET uffs_InitDebugMessageOutput(struct uffs_DebugMsgOutputSt *ops, int msg_level); -void uffs_DebugSetMessageLevel(int msg_level); - -void uffs_DebugMessage(int level, const char *prefix, const char *suffix, const char *errFmt, ...); -void uffs_AssertCall(const char *file, int line, const char *msg, ...); -#else - -#define UFFS_DBG_LEVEL UFFS_MSG_NORMAL - -#ifdef CONFIG_ENABLE_UFFS_DEBUG_MSG -#define uffs_DebugMessage(level, prefix, suffix, errFmt, ...) do { \ - if (level >= UFFS_DBG_LEVEL) \ - rt_kprintf(prefix errFmt suffix, ##__VA_ARGS__); \ -} while(0) - -#define uffs_AssertCall(file, line, msg, ...) \ - rt_kprintf("ASSERT %s:%d - :" msg "\n", (const char *)file, (int)line, ##__VA_ARGS__) -#else -#define uffs_DebugMessage(level, prefix, suffix, errFmt, ...) -#define uffs_AssertCall(file, line, msg, ...) -#endif //CONFIG_ENABLE_UFFS_DEBUG_MSG -#endif //RT_THREAD - -#ifdef _COMPILER_DO_NOT_SUPPORT_MACRO_VALIST_REPLACE_ -/* For those compilers do not support valist parameter replace in macro define */ -void uffs_Perror(int level, const char *fmt, ...); -void uffs_PerrorRaw(int level, const char *fmt, ...); -UBOOL uffs_Assert(UBOOL expr, const char *fmt, ...); -#else - -#if !defined(RT_THREAD) -#define uffs_Perror(level, fmt, ... ) \ - uffs_DebugMessage(level, PFX, TENDSTR, fmt, ## __VA_ARGS__) - -#define uffs_PerrorRaw(level, fmt, ... ) \ - uffs_DebugMessage(level, NULL, NULL, fmt, ## __VA_ARGS__) - -#else - -#ifdef CONFIG_ENABLE_UFFS_DEBUG_MSG - -#define uffs_Perror(level, fmt, ... ) do{\ - if (level >= UFFS_DBG_LEVEL) \ - rt_kprintf(PFX fmt TENDSTR, ##__VA_ARGS__); \ -} while(0) - -#define uffs_PerrorRaw(level, fmt, ... ) do{\ - if (level >= UFFS_DBG_LEVEL) \ - rt_kprintf(fmt, ##__VA_ARGS__); \ -} while(0) -#else -#define uffs_Perror(level, fmt, ... ) -#define uffs_PerrorRaw(level, fmt, ... ) -#endif // CONFIG_ENABLE_UFFS_DEBUG_MSG -#endif // RT_THREAD - -#define uffs_Assert(expr, msg, ...) \ - ((expr) ? U_TRUE : (uffs_AssertCall(__FILE__, __LINE__, msg, ## __VA_ARGS__), U_FALSE)) - -#endif //_COMPILER_DO_NOT_SUPPORT_MACRO_VALIST_REPLACE_ - -#define uffs_Panic() \ - do { \ - uffs_AssertCall(__FILE__, __LINE__, "Bam !!\n"); \ - while(1); \ - } while(0) - -/********************************** NAND **********************************************/ -//NAND flash specific file must implement these interface -URET uffs_LoadPageSpare(uffs_Device *dev, int block, int page, uffs_Tags *tag); -URET uffs_WritePageSpare(uffs_Device *dev, int block, int page, uffs_Tags *tag); -URET uffs_MakePageValid(uffs_Device *dev, int block, int page, uffs_Tags *tag); -UBOOL uffs_IsBlockBad(uffs_Device *dev, uffs_BlockInfo *bc); - -/********************************** Public defines *****************************/ -/** - * \def UFFS_ALL_PAGES - * \brief UFFS_ALL_PAGES if this value presented, that means the objects are all pages in the block - */ -#define UFFS_ALL_PAGES (0xffff) - -/** - * \def UFFS_INVALID_PAGE - * \brief macro for invalid page number - */ -#define UFFS_INVALID_PAGE (0xfffe) - -/** - * \def UFFS_INVALID_BLOCK - * \brief macro for invalid block number - */ -#define UFFS_INVALID_BLOCK (0xfffe) - - -URET uffs_NewBlock(uffs_Device *dev, u16 block, uffs_Tags *tag, uffs_Buf *buf); -URET uffs_BlockRecover(uffs_Device *dev, uffs_BlockInfo *old, u16 newBlock); -URET uffs_PageRecover(uffs_Device *dev, - uffs_BlockInfo *bc, - u16 oldPage, - u16 newPage, - uffs_Buf *buf); -int uffs_FindFreePageInBlock(uffs_Device *dev, uffs_BlockInfo *bc); -u16 uffs_FindBestPageInBlock(uffs_Device *dev, uffs_BlockInfo *bc, u16 page); -u16 uffs_FindFirstFreePage(uffs_Device *dev, uffs_BlockInfo *bc, u16 pageFrom); -u16 uffs_FindPageInBlockWithPageId(uffs_Device *dev, uffs_BlockInfo *bc, u16 page_id); - -u8 uffs_MakeSum8(const void *p, int len); -u16 uffs_MakeSum16(const void *p, int len); -URET uffs_CreateNewFile(uffs_Device *dev, u16 parent, u16 serial, uffs_BlockInfo *bc, uffs_FileInfo *fi); - -int uffs_GetBlockFileDataLength(uffs_Device *dev, uffs_BlockInfo *bc, u8 type); -UBOOL uffs_IsPageErased(uffs_Device *dev, uffs_BlockInfo *bc, u16 page); -int uffs_GetFreePagesCount(uffs_Device *dev, uffs_BlockInfo *bc); -UBOOL uffs_IsDataBlockReguFull(uffs_Device *dev, uffs_BlockInfo *bc); -UBOOL uffs_IsThisBlockUsed(uffs_Device *dev, uffs_BlockInfo *bc); - -int uffs_GetBlockTimeStamp(uffs_Device *dev, uffs_BlockInfo *bc); - -int uffs_GetDeviceUsed(uffs_Device *dev); -int uffs_GetDeviceFree(uffs_Device *dev); -int uffs_GetDeviceTotal(uffs_Device *dev); - -URET uffs_LoadMiniHeader(uffs_Device *dev, int block, u16 page, struct uffs_MiniHeaderSt *header); - - -/* some functions from uffs_fd.c */ -void uffs_FdSignatureIncrease(void); -URET uffs_DirEntryBufInit(void); -URET uffs_DirEntryBufRelease(void); -uffs_Pool * uffs_DirEntryBufGetPool(void); -int uffs_DirEntryBufPutAll(uffs_Device *dev); - - -/************************************************************************/ -/* init functions */ -/************************************************************************/ -URET uffs_InitDevice(uffs_Device *dev); -URET uffs_ReleaseDevice(uffs_Device *dev); - -URET uffs_InitFileSystemObjects(void); -URET uffs_ReleaseFileSystemObjects(void); - - -#ifdef __cplusplus -} -#endif -#endif // _UFFS_PUBLIC_H_ - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_tree.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_tree.h deleted file mode 100644 index 6a505a839f..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_tree.h +++ /dev/null @@ -1,237 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_TREE_H_ -#define _UFFS_TREE_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs_pool.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif - -#define UFFS_TYPE_DIR 0 -#define UFFS_TYPE_FILE 1 -#define UFFS_TYPE_DATA 2 -#define UFFS_TYPE_RESV 3 -#define UFFS_TYPE_INVALID 0xFF - -struct uffs_NodeTypeNameMapSt { - int type; - const char *name; -}; - -#define UFFS_TYPE_NAME_MAP { \ - {UFFS_TYPE_DIR, "DIR"}, \ - {UFFS_TYPE_FILE, "FILE"}, \ - {UFFS_TYPE_DATA, "DATA"}, \ - {UFFS_TYPE_RESV, "RESV"}, \ - {UFFS_TYPE_INVALID, "INVALID"} \ -} - -struct BlockListSt { /* 12 bytes */ - struct uffs_TreeNodeSt * next; - struct uffs_TreeNodeSt * prev; - u16 block; - union { - u16 serial; /* for suspended block list */ - u8 need_check; /* for erased block list */ - } u; -}; - -struct DirhSt { /* 8 bytes */ - u16 checksum; /* check sum of dir name */ - u16 block; - u16 parent; - u16 serial; -}; - - -struct FilehSt { /* 12 bytes */ - u16 block; - u16 checksum; /* check sum of file name */ - u16 parent; - u16 serial; - u32 len; /* file length total */ -}; - -struct FdataSt { /* 10 bytes */ - u16 block; - u16 parent; - u32 len; /* file data length on this block */ - u16 serial; -}; - -//UFFS TreeNode (14 or 16 bytes) -typedef struct uffs_TreeNodeSt { - union { - struct BlockListSt list; - struct DirhSt dir; - struct FilehSt file; - struct FdataSt data; - } u; - u16 hash_next; - u16 hash_prev; -} TreeNode; - - -//TODO: UFFS2 Tree structures -/* -struct FdataSt { - u32 len; -}; - -struct filebSt { - u16 bls; //how many blocks this file contents ... - u8 offs; //the offset of this file header on FILE block - u8 sum; //short sum of file name -}; - -//Extra data structure for storing file length information -struct FilehSt { - u32 len; -}; - -//UFFS2 TreeNode (12 bytes) -typedef struct uffs_TreeNodeSt { - u16 nextIdx; - u16 block; - u16 parent; - u16 serial; - union { - struct FilehSt h; - struct filedSt file; - struct data; - } u; -} TreeNode; - -*/ - - -#define EMPTY_NODE 0xffff //!< special index num of empty node. - -#define ROOT_DIR_SERIAL 0 //!< serial num of root dir -#define MAX_UFFS_FSN 0x3ff //!< maximum dir|file serial number (uffs_TagStore#parent: 10 bits) -#define MAX_UFFS_FDN 0x3fff //!< maximum file data block serial numbers (uffs_TagStore#serial: 14 bits) -#define PARENT_OF_ROOT 0xfffd //!< parent of ROOT ? kidding me ... -#define INVALID_UFFS_SERIAL 0xffff //!< invalid serial num - -#define DIR_NODE_HASH_MASK 0x1f -#define DIR_NODE_ENTRY_LEN (DIR_NODE_HASH_MASK + 1) - -#define FILE_NODE_HASH_MASK 0x3f -#define FILE_NODE_ENTRY_LEN (FILE_NODE_HASH_MASK + 1) - -#define DATA_NODE_HASH_MASK 0x1ff -#define DATA_NODE_ENTRY_LEN (DATA_NODE_HASH_MASK + 1) -#define FROM_IDX(idx, pool) ((TreeNode *)uffs_PoolGetBufByIndex(pool, idx)) -#define TO_IDX(p, pool) ((u16)uffs_PoolGetIndex(pool, (void *) p)) - - -#define GET_FILE_HASH(serial) (serial & FILE_NODE_HASH_MASK) -#define GET_DIR_HASH(serial) (serial & DIR_NODE_HASH_MASK) -#define GET_DATA_HASH(parent, serial) ((parent + serial) & DATA_NODE_HASH_MASK) - - -struct uffs_TreeSt { - TreeNode *erased; //!< erased block list head - TreeNode *erased_tail; //!< erased block list tail - TreeNode *suspend; //!< suspended block list - int erased_count; //!< erased block counter - TreeNode *bad; //!< bad block list - int bad_count; //!< bad block count - u16 dir_entry[DIR_NODE_ENTRY_LEN]; - u16 file_entry[FILE_NODE_ENTRY_LEN]; - u16 data_entry[DATA_NODE_ENTRY_LEN]; - u16 max_serial; -}; - - -URET uffs_TreeInit(uffs_Device *dev); -URET uffs_TreeRelease(uffs_Device *dev); -URET uffs_BuildTree(uffs_Device *dev); -u16 uffs_FindFreeFsnSerial(uffs_Device *dev); -TreeNode * uffs_TreeFindFileNode(uffs_Device *dev, u16 serial); -TreeNode * uffs_TreeFindFileNodeWithParent(uffs_Device *dev, u16 parent); -TreeNode * uffs_TreeFindDirNode(uffs_Device *dev, u16 serial); -TreeNode * uffs_TreeFindDirNodeWithParent(uffs_Device *dev, u16 parent); -TreeNode * uffs_TreeFindFileNodeByName(uffs_Device *dev, const char *name, u32 len, u16 sum, u16 parent); -TreeNode * uffs_TreeFindDirNodeByName(uffs_Device *dev, const char *name, u32 len, u16 sum, u16 parent); -TreeNode * uffs_TreeFindDataNode(uffs_Device *dev, u16 parent, u16 serial); - - -TreeNode * uffs_TreeFindDirNodeByBlock(uffs_Device *dev, u16 block); -TreeNode * uffs_TreeFindFileNodeByBlock(uffs_Device *dev, u16 block); -TreeNode * uffs_TreeFindDataNodeByBlock(uffs_Device *dev, u16 block); -TreeNode * uffs_TreeFindErasedNodeByBlock(uffs_Device *dev, u16 block); -TreeNode * uffs_TreeFindBadNodeByBlock(uffs_Device *dev, u16 block); - -void uffs_TreeSuspendAdd(uffs_Device *dev, TreeNode *node); -TreeNode * uffs_TreeFindSuspendNode(uffs_Device *dev, u16 serial); -void uffs_TreeRemoveSuspendNode(uffs_Device *dev, TreeNode *node); - -#define SEARCH_REGION_DIR 1 -#define SEARCH_REGION_FILE 2 -#define SEARCH_REGION_DATA 4 -#define SEARCH_REGION_BAD 8 -#define SEARCH_REGION_ERASED 16 -TreeNode * uffs_TreeFindNodeByBlock(uffs_Device *dev, u16 block, int *region); - - - -UBOOL uffs_TreeCompareFileName(uffs_Device *dev, const char *name, u32 len, u16 sum, TreeNode *node, int type); - -TreeNode * uffs_TreeGetErasedNode(uffs_Device *dev); - -void uffs_InsertNodeToTree(uffs_Device *dev, u8 type, TreeNode *node); -void uffs_InsertToErasedListHead(uffs_Device *dev, TreeNode *node); -void uffs_TreeInsertToErasedListTail(uffs_Device *dev, TreeNode *node); -void uffs_TreeInsertToErasedListTailEx(uffs_Device *dev, TreeNode *node, int need_check); -void uffs_TreeInsertToBadBlockList(uffs_Device *dev, TreeNode *node); - -void uffs_BreakFromEntry(uffs_Device *dev, u8 type, TreeNode *node); - -void uffs_TreeSetNodeBlock(u8 type, TreeNode *node, u16 block); - - -#ifdef __cplusplus -} -#endif - - - -#endif - - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_types.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_types.h deleted file mode 100644 index c81b37970b..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_types.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_TYPES_H_ -#define _UFFS_TYPES_H_ - -#ifdef __CDT_PARSER__ -#undef __cplusplus -#endif - -#ifdef __cplusplus -extern "C"{ -#endif - -#ifdef _UBASE_ -#include -#endif - -/** - * \file uffs_types.h - * \brief basic types used on uffs - * \author Ricky Zheng - */ - -/* basic types */ - -/** \typedef i8 - * \brief 8 bit integer - */ -typedef char i8; - -/** \typedef u8 - * \brief 8 bit unsigned integer - */ -typedef unsigned char u8; - -/** \typedef i16 - * \brief 16 bit integer - */ -typedef short int i16; - - -/** \typedef u16 - * \brief 16 bit unsigned integer - */ -typedef unsigned short int u16; - - -/** \typedef i32 - * \brief 32 bit integer - */ -typedef int i32; - -/** \typedef u32 - * \brief 32 bit unsigned integer - */ -typedef unsigned int u32; - - -#ifndef _UBASE_ - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/* boolean type */ - -/** \typedef UBOOL - * \brief boolean type for uffs, the value would be: #U_TRUE or #U_FALSE - */ -typedef int UBOOL; - -/** \def U_TRUE - * \brief boolean true for uffs - */ -#define U_TRUE (TRUE) - - -/** \def U_FALSE - * \brief boolean false for uffs - */ -#define U_FALSE (FALSE) - - -/** \typedef URET - * \brief return type for uffs, should be #U_FAIL or #U_SUCC - */ -typedef int URET; - -/** \def U_FAIL - * \brief indicator of fail - */ -#define U_FAIL -1 - -/** \def U_SUCC - * \brief indicator of successful - */ -#define U_SUCC 0 - -/** \def IS_SUCC(ret) - * \brief is it successful ? - */ -#define IS_SUCC(ret) (ret >= 0 ? U_TRUE : U_FALSE) - - -/** \def IS_FAIL(ret) - * \brief is it fail ? - */ -#define IS_FAIL(ret) (ret < 0 ? U_TRUE : U_FALSE) - -#ifndef NULL -/** \def NULL - * \brief zero for pointer - */ -#define NULL 0 -#endif - -#endif // _UBASE_ - - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_utils.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_utils.h deleted file mode 100644 index ae03cb4ab1..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_UTILS_H_ -#define _UFFS_UTILS_H_ - -#include "uffs/uffs_types.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_core.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -//get UFFS disk version, if fail, return 0 -int uffs_GetUFFSVersion(struct uffs_DeviceSt *dev); - -void uffs_InitGlobalFsLock(void); -void uffs_ReleaseGlobalFsLock(void); -void uffs_GlobalFsLockLock(void); -void uffs_GlobalFsLockUnlock(void); - -URET uffs_FormatDevice(uffs_Device *dev, UBOOL force); - -#ifdef __cplusplus -} -#endif - -typedef void dump_msg_cb(struct uffs_DeviceSt *dev, const char *fmt, ...); - -void uffs_DumpDevice(struct uffs_DeviceSt *dev, dump_msg_cb *dump); - -#endif - diff --git a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_version.h b/components/dfs/filesystems/uffs/src/inc/uffs/uffs_version.h deleted file mode 100644 index 9ea3154205..0000000000 --- a/components/dfs/filesystems/uffs/src/inc/uffs/uffs_version.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -#ifndef _UFFS_VERSION_H_ -#define _UFFS_VERSION_H_ - -#ifdef __cplusplus -extern "C"{ -#endif - - -#define UFFS_VERSION 0x01030400 //"01.03.0400" - -const char * uffs_Version2Str(int ver); -int uffs_GetVersion(void); -int uffs_GetMainVersion(int ver); -int uffs_GetMinorVersion(int ver); -int uffs_GetTrivialVersion(int ver); - -#ifdef __cplusplus -} -#endif - - -#endif - diff --git a/components/dfs/filesystems/uffs/src/platform/CMakeLists.txt b/components/dfs/filesystems/uffs/src/platform/CMakeLists.txt deleted file mode 100644 index dd33c737e5..0000000000 --- a/components/dfs/filesystems/uffs/src/platform/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -IF (UNIX) - SET (libplatform_SRCS posix/uffs_os.c posix/uffs_config.h) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/posix) -ENDIF() - -IF (WIN32) - SET (libplatform_SRCS win32/uffs_os.c win32/uffs_config.h) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/win32) -ENDIF() - -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/inc) -ADD_LIBRARY(platform STATIC ${libplatform_SRCS} ) - diff --git a/components/dfs/filesystems/uffs/src/platform/posix/uffs_config.h b/components/dfs/filesystems/uffs/src/platform/posix/uffs_config.h deleted file mode 100644 index 2f0b6992bb..0000000000 --- a/components/dfs/filesystems/uffs/src/platform/posix/uffs_config.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_config.h - * \brief basic configuration of uffs - * \author Ricky Zheng - */ - -#ifndef _UFFS_CONFIG_H_ -#define _UFFS_CONFIG_H_ - -/** - * \def UFFS_MAX_PAGE_SIZE - * \note maximum page size UFFS support - */ -#define UFFS_MAX_PAGE_SIZE 2048 - -/** - * \def UFFS_MAX_SPARE_SIZE - */ -#define UFFS_MAX_SPARE_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 8) - -/** - * \def UFFS_MAX_ECC_SIZE - */ -#define UFFS_MAX_ECC_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 5) - -/** - * \def MAX_CACHED_BLOCK_INFO - * \note uffs cache the block info for opened directories and files, - * a practical value is 5 ~ MAX_OBJECT_HANDLE - */ -#define MAX_CACHED_BLOCK_INFO 50 - -/** - * \def MAX_PAGE_BUFFERS - * \note the bigger value will bring better read/write performance. - * but few writing performance will be improved when this - * value is become larger than 'max pages per block' - */ -#define MAX_PAGE_BUFFERS 40 - - -/** - * \def CLONE_BUFFER_THRESHOLD - * \note reserve buffers for clone. 1 or 2 should be enough. - */ -#define CLONE_BUFFERS_THRESHOLD 2 - -/** - * \def MAX_SPARE_BUFFERS - * \note spare buffers are used for lower level flash operations, - * 5 should be enough. - */ -#define MAX_SPARE_BUFFERS 5 - - -/** - * \def MAX_DIRTY_PAGES_IN_A_BLOCK - * \note this value should be between '2' and the lesser of - * 'max pages per block' and (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1). - * - * the smaller the value the frequently the buffer will be flushed. - */ -#define MAX_DIRTY_PAGES_IN_A_BLOCK 32 - -/** - * \def MAX_DIRTY_BUF_GROUPS - */ -#define MAX_DIRTY_BUF_GROUPS 3 - -/** - * \def CONFIG_ENABLE_UFFS_DEBUG_MSG - * \note Enable debug message output. You must call uffs_InitDebugMessageOutput() - * to initialize debug apart from enable debug feature. - */ -#define CONFIG_ENABLE_UFFS_DEBUG_MSG - -/** - * \def CONFIG_USE_GLOBAL_FS_LOCK - * \note use global lock instead of per-device lock. - * this is required if you use fd APIs in multi-thread environment. - */ -#define CONFIG_USE_GLOBAL_FS_LOCK - - -/** - * \def CONFIG_USE_PER_DEVICE_LOCK - * \note use per-device lock. - * this is required if you use fs APIs in multi-thread environment. - */ -//#define CONFIG_USE_PER_DEVICE_LOCK - - - -/** - * \def CONFIG_USE_STATIC_MEMORY_ALLOCATOR - * \note uffs will use static memory allocator if this is defined. - * to use static memory allocator, you need to provide memory - * buffer when creating uffs_Device. - * - * use UFFS_STATIC_BUFF_SIZE() to calculate memory buffer size. - */ -#define CONFIG_USE_STATIC_MEMORY_ALLOCATOR 0 - -/** - * \def CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR - * \note using system platform's 'malloc' and 'free'. - */ -#define CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR 1 - - - -/** - * \def CONFIG_FLUSH_BUF_AFTER_WRITE - * \note UFFS will write all data directly into flash in - * each 'write' call if you enable this option. - * (which means lesser data lost when power failure but - * poorer writing performance). - * It's not recommended to open this define for normal applications. - */ -#define CONFIG_FLUSH_BUF_AFTER_WRITE - - -/** - * \def CONFIG_UFFS_AUTO_LAYOUT_MTD_COMP - * \note Use Linux MTD compatiable spare placement for UFFS_LAYOUT_AUTO, - * only valid for page data size 512 or 2048. - */ -//#define CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME - - -/** - * \def MAX_OBJECT_HANDLE - * maximum number of object handle - */ -#define MAX_OBJECT_HANDLE 50 -#define FD_SIGNATURE_SHIFT 6 - - -/** - * \def MAX_DIR_HANDLE - * maximum number of uffs_DIR - */ -#define MAX_DIR_HANDLE 10 - -/** - * \def MINIMUN_ERASED_BLOCK - * UFFS will not allow appending or creating new files when the free/erased block - * is lower then MINIMUN_ERASED_BLOCK. - */ -#define MINIMUN_ERASED_BLOCK 2 - -/** - * \def CONFIG_CHANGE_MODIFY_TIME - * \note If defined, closing a file which is opened for writing/appending will - * update the file's modify time as well. Disable this feature will save a - * lot of writing activities if you frequently open files for write and close it. - */ -//#define CONFIG_CHANGE_MODIFY_TIME - - -/** - * \def CONFIG_ENABLE_BAD_BLOCK_VERIFY - * \note allow erase and verify block marked as 'bad' when format UFFS partition. - * it's not recommended for most NAND flash. - */ -#define CONFIG_ENABLE_BAD_BLOCK_VERIFY - -/** - * \def CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - * \note erase block again before mark bad block - */ -//#define CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - -/** - * \def CONFIG_PAGE_WRITE_VERIFY - * \note verify page data after write, for extra safe data storage. - */ -#define CONFIG_PAGE_WRITE_VERIFY - -/** - * \def CONFIG_BAD_BLOCK_POLICY_STRICT - * \note If this is enabled, UFFS will report the block as 'bad' if any bit-flips found; - * otherwise, UFFS report bad block only when ECC failed or reported - * by low level flash driver. - * - * \note Enable this will ensure your data always be stored on completely good blocks. - */ -#define CONFIG_BAD_BLOCK_POLICY_STRICT - - -/** - * \def CONFIG_ENABLE_PAGE_DATA_CRC - * \note If this is enabled, UFFS save page data CRC16 sum in mini header, - * it provides extra protection for data integrity. - */ -#define CONFIG_ENABLE_PAGE_DATA_CRC - - -/** micros for calculating buffer sizes */ - -/** - * \def UFFS_BLOCK_INFO_BUFFER_SIZE - * \brief calculate memory bytes for block info caches - */ -#define UFFS_BLOCK_INFO_BUFFER_SIZE(n_pages_per_block) \ - ( \ - ( \ - sizeof(uffs_BlockInfo) + \ - sizeof(uffs_PageSpare) * n_pages_per_block \ - ) * MAX_CACHED_BLOCK_INFO \ - ) - -/** - * \def UFFS_PAGE_BUFFER_SIZE - * \brief calculate memory bytes for page buffers - */ -#define UFFS_PAGE_BUFFER_SIZE(n_page_size) \ - ( \ - ( \ - sizeof(uffs_Buf) + n_page_size \ - ) * MAX_PAGE_BUFFERS \ - ) - -/** - * \def UFFS_TREE_BUFFER_SIZE - * \brief calculate memory bytes for tree nodes - */ -#define UFFS_TREE_BUFFER_SIZE(n_blocks) (sizeof(TreeNode) * n_blocks) - - -#define UFFS_SPARE_BUFFER_SIZE (MAX_SPARE_BUFFERS * UFFS_MAX_SPARE_SIZE) - - -/** - * \def UFFS_STATIC_BUFF_SIZE - * \brief calculate total memory usage of uffs system - */ -#define UFFS_STATIC_BUFF_SIZE(n_pages_per_block, n_page_size, n_blocks) \ - ( \ - UFFS_BLOCK_INFO_BUFFER_SIZE(n_pages_per_block) + \ - UFFS_PAGE_BUFFER_SIZE(n_page_size) + \ - UFFS_TREE_BUFFER_SIZE(n_blocks) + \ - UFFS_SPARE_BUFFER_SIZE \ - ) - - - -/* config check */ -#if (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD) < 3 -#error "MAX_PAGE_BUFFERS is too small" -#endif - -#if (MAX_DIRTY_PAGES_IN_A_BLOCK < 2) -#error "MAX_DIRTY_PAGES_IN_A_BLOCK should >= 2" -#endif - -#if (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1 < MAX_DIRTY_PAGES_IN_A_BLOCK) -#error "MAX_DIRTY_PAGES_IN_A_BLOCK should < (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD)" -#endif - -#if defined(CONFIG_PAGE_WRITE_VERIFY) && (CLONE_BUFFERS_THRESHOLD < 2) -#error "CLONE_BUFFERS_THRESHOLD should >= 2 when CONFIG_PAGE_WRITE_VERIFY is enabled." -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR + CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 1 -#error "Please enable ONLY one memory allocator" -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR + CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR == 0 -#error "Please enable ONE of memory allocators" -#endif - -#if defined(CONFIG_USE_GLOBAL_FS_LOCK) && defined(CONFIG_USE_PER_DEVICE_LOCK) -#error "enable either CONFIG_USE_GLOBAL_FS_LOCK or CONFIG_USE_PER_DEVICE_LOCK, not both" -#endif - -#if (MAX_OBJECT_HANDLE > (1 << FD_SIGNATURE_SHIFT)) -#error "Please increase FD_SIGNATURE_SHIFT !" -#endif - -#ifdef WIN32 -# pragma warning(disable : 4996) -# pragma warning(disable : 4244) -# pragma warning(disable : 4214) -# pragma warning(disable : 4127) -# pragma warning(disable : 4389) -# pragma warning(disable : 4100) -#endif - -#endif diff --git a/components/dfs/filesystems/uffs/src/platform/posix/uffs_os.c b/components/dfs/filesystems/uffs/src/platform/posix/uffs_os.c deleted file mode 100644 index 170c457ad4..0000000000 --- a/components/dfs/filesystems/uffs/src/platform/posix/uffs_os.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_os_posix.c - * \brief Emulation on POSIX host. This is just a dumb implementation, does not really create semaphores. - * \author Ricky Zheng - */ - -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include -#include -#include -#include -#include - -#define PFX "os : " - -int uffs_SemCreate(OSSEM *sem) -{ - pthread_mutex_t *mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); - int ret = -1; - - if (mutex) { - ret = pthread_mutex_init(mutex, NULL /* default attr */); - if (ret == 0) { - *sem = (OSSEM *)mutex; - } - else { - free(mutex); - } - } - - return ret; -} - -int uffs_SemWait(OSSEM sem) -{ - return pthread_mutex_lock((pthread_mutex_t *)sem); -} - -int uffs_SemSignal(OSSEM sem) -{ - return pthread_mutex_unlock((pthread_mutex_t *)sem);; -} - -int uffs_SemDelete(OSSEM *sem) -{ - pthread_mutex_t *mutex = (pthread_mutex_t *) (*sem); - int ret = -1; - - if (mutex) { - ret = pthread_mutex_destroy(mutex); - if (ret == 0) { - free(mutex); - *sem = 0; - } - } - return ret; -} - -int uffs_OSGetTaskId(void) -{ - //TODO: ... return current task ID ... - return 0; -} - -unsigned int uffs_GetCurDateTime(void) -{ - // FIXME: return system time, please modify this for your platform ! - // or just return 0 if you don't care about file time. - time_t tvalue; - - tvalue = time(NULL); - - return (unsigned int)tvalue; -} - -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 -static void * sys_malloc(struct uffs_DeviceSt *dev, unsigned int size) -{ - dev = dev; - uffs_Perror(UFFS_MSG_NORMAL, "system memory alloc %d bytes", size); - return malloc(size); -} - -static URET sys_free(struct uffs_DeviceSt *dev, void *p) -{ - dev = dev; - free(p); - return U_SUCC; -} - -void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator) -{ - allocator->malloc = sys_malloc; - allocator->free = sys_free; -} -#endif - - -/* debug message output throught 'printf' */ -static void output_dbg_msg(const char *msg); -static struct uffs_DebugMsgOutputSt m_dbg_ops = { - output_dbg_msg, - NULL, -}; - -static void output_dbg_msg(const char *msg) -{ - printf("%s", msg); -} - -void uffs_SetupDebugOutput(void) -{ - uffs_InitDebugMessageOutput(&m_dbg_ops, UFFS_MSG_NOISY); -} diff --git a/components/dfs/filesystems/uffs/src/platform/win32/uffs_config.h b/components/dfs/filesystems/uffs/src/platform/win32/uffs_config.h deleted file mode 100644 index 3f9daa9cd4..0000000000 --- a/components/dfs/filesystems/uffs/src/platform/win32/uffs_config.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_config.h - * \brief basic configuration of uffs - * \author Ricky Zheng - */ - -#ifndef _UFFS_CONFIG_H_ -#define _UFFS_CONFIG_H_ - -/** - * \def UFFS_MAX_PAGE_SIZE - * \note maximum page size UFFS support - */ -#define UFFS_MAX_PAGE_SIZE 2048 - -/** - * \def UFFS_MAX_SPARE_SIZE - */ -#define UFFS_MAX_SPARE_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 8) - -/** - * \def UFFS_MAX_ECC_SIZE - */ -#define UFFS_MAX_ECC_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 5) - -/** - * \def MAX_CACHED_BLOCK_INFO - * \note uffs cache the block info for opened directories and files, - * a practical value is 5 ~ MAX_OBJECT_HANDLE - */ -#define MAX_CACHED_BLOCK_INFO 50 - -/** - * \def MAX_PAGE_BUFFERS - * \note the bigger value will bring better read/write performance. - * but few writing performance will be improved when this - * value is become larger than 'max pages per block' - */ -#define MAX_PAGE_BUFFERS 40 - - -/** - * \def CLONE_BUFFER_THRESHOLD - * \note reserve buffers for clone. 1 or 2 should be enough. - */ -#define CLONE_BUFFERS_THRESHOLD 2 - -/** - * \def MAX_SPARE_BUFFERS - * \note spare buffers are used for lower level flash operations, - * 5 should be enough. - */ -#define MAX_SPARE_BUFFERS 5 - - -/** - * \def MAX_DIRTY_PAGES_IN_A_BLOCK - * \note this value should be between '2' and the lesser of - * 'max pages per block' and (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1). - * - * the smaller the value the frequently the buffer will be flushed. - */ -#define MAX_DIRTY_PAGES_IN_A_BLOCK 32 - -/** - * \def CONFIG_ENABLE_UFFS_DEBUG_MSG - * \note Enable debug message output. You must call uffs_InitDebugMessageOutput() - * to initialize debug apart from enable debug feature. - */ -#define CONFIG_ENABLE_UFFS_DEBUG_MSG - -/** - * \def CONFIG_USE_GLOBAL_FS_LOCK - * \note use global lock instead of per-device lock. - * this is required if you use fd APIs in multi-thread environment. - */ -#define CONFIG_USE_GLOBAL_FS_LOCK - - -/** - * \def CONFIG_USE_PER_DEVICE_LOCK - * \note use per-device lock. - * this is required if you use fs APIs in multi-thread environment. - */ -//#define CONFIG_USE_PER_DEVICE_LOCK - - - -/** - * \def CONFIG_USE_STATIC_MEMORY_ALLOCATOR - * \note uffs will use static memory allocator if this is defined. - * to use static memory allocator, you need to provide memory - * buffer when creating uffs_Device. - * - * use UFFS_STATIC_BUFF_SIZE() to calculate memory buffer size. - */ -#define CONFIG_USE_STATIC_MEMORY_ALLOCATOR 0 - -/** - * \def CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR - * \note using system platform's 'malloc' and 'free'. - */ -#define CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR 1 - - - -/** - * \def CONFIG_FLUSH_BUF_AFTER_WRITE - * \note UFFS will write all data directly into flash in - * each 'write' call if you enable this option. - * (which means lesser data lost when power failure but - * poorer writing performance). - * It's not recommended to open this define for normal applications. - */ -//#define CONFIG_FLUSH_BUF_AFTER_WRITE - - -/** - * \def CONFIG_UFFS_AUTO_LAYOUT_MTD_COMP - * \note Use Linux MTD compatiable spare placement for UFFS_LAYOUT_AUTO, - * only valid for page data size 512 or 2048. - */ -//#define CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME - - -/** - * \def MAX_OBJECT_HANDLE - * maximum number of object handle - */ -#define MAX_OBJECT_HANDLE 50 -#define FD_SIGNATURE_SHIFT 6 - - -/** - * \def MAX_DIR_HANDLE - * maximum number of uffs_DIR - */ -#define MAX_DIR_HANDLE 10 - -/** - * \def MINIMUN_ERASED_BLOCK - * UFFS will not allow appending or creating new files when the free/erased block - * is lower then MINIMUN_ERASED_BLOCK. - */ -#define MINIMUN_ERASED_BLOCK 2 - -/** - * \def CONFIG_CHANGE_MODIFY_TIME - * \note If defined, closing a file which is opened for writing/appending will - * update the file's modify time as well. Disable this feature will save a - * lot of writing activities if you frequently open files for write and close it. - */ -//#define CONFIG_CHANGE_MODIFY_TIME - - -/** - * \def CONFIG_ENABLE_BAD_BLOCK_VERIFY - * \note allow erase and verify block marked as 'bad' when format UFFS partition. - * it's not recommended for most NAND flash. - */ -#define CONFIG_ENABLE_BAD_BLOCK_VERIFY - -/** - * \def CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - * \note erase block again before mark bad block - */ -//#define CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - -/** - * \def CONFIG_PAGE_WRITE_VERIFY - * \note verify page data after write, for extra safe data storage. - */ -#define CONFIG_PAGE_WRITE_VERIFY - -/** - * \def CONFIG_BAD_BLOCK_POLICY_STRICT - * \note If this is enabled, UFFS will report the block as 'bad' if any bit-flips found; - * otherwise, UFFS report bad block only when ECC failed or reported - * by low level flash driver. - * - * \note Enable this will ensure your data always be stored on completely good blocks. - */ -#define CONFIG_BAD_BLOCK_POLICY_STRICT - - -/** - * \def CONFIG_ENABLE_PAGE_DATA_CRC - * \note If this is enabled, UFFS save page data CRC16 sum in mini header, - * it provides extra protection for data integrity. - */ -//#define CONFIG_ENABLE_PAGE_DATA_CRC - - -/** micros for calculating buffer sizes */ - -/** - * \def UFFS_BLOCK_INFO_BUFFER_SIZE - * \brief calculate memory bytes for block info caches - */ -#define UFFS_BLOCK_INFO_BUFFER_SIZE(n_pages_per_block) \ - ( \ - ( \ - sizeof(uffs_BlockInfo) + \ - sizeof(uffs_PageSpare) * n_pages_per_block \ - ) * MAX_CACHED_BLOCK_INFO \ - ) - -/** - * \def UFFS_PAGE_BUFFER_SIZE - * \brief calculate memory bytes for page buffers - */ -#define UFFS_PAGE_BUFFER_SIZE(n_page_size) \ - ( \ - ( \ - sizeof(uffs_Buf) + n_page_size \ - ) * MAX_PAGE_BUFFERS \ - ) - -/** - * \def UFFS_TREE_BUFFER_SIZE - * \brief calculate memory bytes for tree nodes - */ -#define UFFS_TREE_BUFFER_SIZE(n_blocks) (sizeof(TreeNode) * n_blocks) - - -#define UFFS_SPARE_BUFFER_SIZE (MAX_SPARE_BUFFERS * UFFS_MAX_SPARE_SIZE) - - -/** - * \def UFFS_STATIC_BUFF_SIZE - * \brief calculate total memory usage of uffs system - */ -#define UFFS_STATIC_BUFF_SIZE(n_pages_per_block, n_page_size, n_blocks) \ - ( \ - UFFS_BLOCK_INFO_BUFFER_SIZE(n_pages_per_block) + \ - UFFS_PAGE_BUFFER_SIZE(n_page_size) + \ - UFFS_TREE_BUFFER_SIZE(n_blocks) + \ - UFFS_SPARE_BUFFER_SIZE \ - ) - - - -/* config check */ -#if (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD) < 3 -#error "MAX_PAGE_BUFFERS is too small" -#endif - -#if (MAX_DIRTY_PAGES_IN_A_BLOCK < 2) -#error "MAX_DIRTY_PAGES_IN_A_BLOCK should >= 2" -#endif - -#if (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1 < MAX_DIRTY_PAGES_IN_A_BLOCK) -#error "MAX_DIRTY_PAGES_IN_A_BLOCK should < (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD)" -#endif - -#if defined(CONFIG_PAGE_WRITE_VERIFY) && (CLONE_BUFFERS_THRESHOLD < 2) -#error "CLONE_BUFFERS_THRESHOLD should >= 2 when CONFIG_PAGE_WRITE_VERIFY is enabled." -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR + CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 1 -#error "Please enable ONLY one memory allocator" -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR + CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR == 0 -#error "Please enable ONE of memory allocators" -#endif - -#if defined(CONFIG_USE_GLOBAL_FS_LOCK) && defined(CONFIG_USE_PER_DEVICE_LOCK) -#error "enable either CONFIG_USE_GLOBAL_FS_LOCK or CONFIG_USE_PER_DEVICE_LOCK, not both" -#endif - -#if (MAX_OBJECT_HANDLE > (1 << FD_SIGNATURE_SHIFT)) -#error "Please increase FD_SIGNATURE_SHIFT !" -#endif - -#ifdef WIN32 -# pragma warning(disable : 4996) -# pragma warning(disable : 4244) -# pragma warning(disable : 4214) -# pragma warning(disable : 4127) -# pragma warning(disable : 4389) -# pragma warning(disable : 4100) -#endif - -#endif diff --git a/components/dfs/filesystems/uffs/src/platform/win32/uffs_os.c b/components/dfs/filesystems/uffs/src/platform/win32/uffs_os.c deleted file mode 100644 index d05c44abb9..0000000000 --- a/components/dfs/filesystems/uffs/src/platform/win32/uffs_os.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_os.c - * \brief Emulation on win32 host - * \author Ricky Zheng - */ - -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include -#include -#include -#include -#include - -#define PFX "os : " - -int uffs_SemCreate(OSSEM *sem) -{ - HANDLE mutex = CreateMutex( - NULL, // default security attributes - FALSE, // initially not owned - NULL); // unnamed mutex - - if (mutex == NULL) { - printf("Create mutex failed !\n"); - return -1; - } - else { - *sem = (OSSEM)mutex; - } - - return 0; -} - -int uffs_SemWait(OSSEM sem) -{ - DWORD result; - - result = WaitForSingleObject( - (HANDLE)sem, // handle to mutex - INFINITE); // no time-out interval - - return result == WAIT_ABANDONED ? -1 : 0; -} - -int uffs_SemSignal(OSSEM sem) -{ - return ReleaseMutex((HANDLE)sem) ? 0 : -1; -} - -int uffs_SemDelete(OSSEM *sem) -{ - if (CloseHandle((HANDLE)(*sem))) { - *sem = 0; - return 0; - } - else - return -1; -} - -int uffs_OSGetTaskId(void) -{ - return 0; -} - -unsigned int uffs_GetCurDateTime(void) -{ - // FIXME: return system time, please modify this for your platform ! - // or just return 0 if you don't care about file time. - time_t tvalue; - - tvalue = time(NULL); - - return (unsigned int)tvalue; -} - -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 -static void * sys_malloc(struct uffs_DeviceSt *dev, unsigned int size) -{ - dev = dev; - uffs_Perror(UFFS_MSG_NORMAL, "system memory alloc %d bytes", size); - return malloc(size); -} - -static URET sys_free(struct uffs_DeviceSt *dev, void *p) -{ - dev = dev; - free(p); - return U_SUCC; -} - -void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator) -{ - allocator->malloc = sys_malloc; - allocator->free = sys_free; -} -#endif - - -/* debug message output throught 'printf' */ -static void output_dbg_msg(const char *msg); -static struct uffs_DebugMsgOutputSt m_dbg_ops = { - output_dbg_msg, - NULL, -}; - -static void output_dbg_msg(const char *msg) -{ - printf("%s", msg); -} - -void uffs_SetupDebugOutput(void) -{ - uffs_InitDebugMessageOutput(&m_dbg_ops, UFFS_MSG_NOISY); -} diff --git a/components/dfs/filesystems/uffs/src/uffs/CMakeLists.txt b/components/dfs/filesystems/uffs/src/uffs/CMakeLists.txt deleted file mode 100644 index 24b726b8cb..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -SET (libuffs_SRCS - uffs_badblock.c - uffs_blockinfo.c - uffs_buf.c - uffs_debug.c - uffs_device.c - uffs_ecc.c - uffs_fd.c - uffs_fs.c - uffs_init.c - uffs_mem.c - uffs_pool.c - uffs_public.c - uffs_tree.c - uffs_utils.c - uffs_mtb.c - uffs_find.c - uffs_flash.c - uffs_version.c - uffs_crc.c - ) - -SET (HDR ${uffs_SOURCE_DIR}/src/inc/uffs) - -SET (libuffs_HEADS - ${HDR}/uffs.h - ${HDR}/uffs_badblock.h - ${HDR}/uffs_blockinfo.h - ${HDR}/uffs_buf.h - ${HDR}/uffs_core.h - ${HDR}/uffs_device.h - ${HDR}/uffs_ecc.h - ${HDR}/uffs_fd.h - ${HDR}/uffs_fs.h - ${HDR}/uffs_mem.h - ${HDR}/uffs_os.h - ${HDR}/uffs_pool.h - ${HDR}/uffs_public.h - ${HDR}/uffs_tree.h - ${HDR}/uffs_types.h - ${HDR}/uffs_utils.h - ${HDR}/uffs_mtb.h - ${HDR}/uffs_find.h - ${HDR}/uffs_flash.h - ${HDR}/uffs_version.h - ${HDR}/uffs_crc.h - ) - -IF (UNIX) -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/posix) -ENDIF() - -IF (WIN32) -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/win32) -ENDIF() - -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/inc) - -ADD_LIBRARY( uffs STATIC ${libuffs_SRCS} ${libuffs_HEADS} ) diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_badblock.c b/components/dfs/filesystems/uffs/src/uffs/uffs_badblock.c deleted file mode 100644 index 6145b9e547..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_badblock.c +++ /dev/null @@ -1,249 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_badblock.c - * \brief bad block checking and recovering - * \author Ricky Zheng, created in 13th Jun, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_ecc.h" -#include "uffs/uffs_badblock.h" -#include - -#define PFX "bbl : " - -void uffs_BadBlockInit(uffs_Device *dev) -{ - dev->bad.block = UFFS_INVALID_BLOCK; -} - - -/** - * \brief process bad block: erase bad block, mark it as 'bad' - * and put the node to bad block list. - * \param[in] dev uffs device - * \param[in] node bad block tree node - * (before the block turn 'bad', it must belong to something ...) - */ -void uffs_BadBlockProcess(uffs_Device *dev, TreeNode *node) -{ - if (HAVE_BADBLOCK(dev)) { - // mark the bad block - uffs_FlashMarkBadBlock(dev, dev->bad.block); - - // and put it into bad block list - if (node != NULL) - uffs_TreeInsertToBadBlockList(dev, node); - - //clear bad block mark. - dev->bad.block = UFFS_INVALID_BLOCK; - - } -} - -/** - * \brief process bad block and put the node in 'suspend' list. - * \param[in] dev uffs device - * \param[in] node bad block tree node - */ -void uffs_BadBlockProcessSuspend(uffs_Device *dev, TreeNode *node) -{ - if (HAVE_BADBLOCK(dev)) { - // mark the bad block - uffs_FlashMarkBadBlock(dev, dev->bad.block); - - // and put it into bad block list - if (node != NULL) - uffs_TreeSuspendAdd(dev, node); - - //clear bad block mark. - dev->bad.block = UFFS_INVALID_BLOCK; - } -} - -/** - * \brief recover bad block - * \param[in] dev uffs device - */ -void uffs_BadBlockRecover(uffs_Device *dev) -{ - TreeNode *good, *bad; - uffs_Buf *buf; - u16 i; - u16 page; - uffs_BlockInfo *bc = NULL; - uffs_Tags *tag; - uffs_Tags newTag; - UBOOL succRecov; - UBOOL goodBlockIsDirty = U_FALSE; - int ret; - int region; - u8 type; - - if (dev->bad.block == UFFS_INVALID_BLOCK) - return; - - // pick up an erased good block - good = uffs_TreeGetErasedNode(dev); - if (good == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "no free block to replace bad block!"); - return; - } - - //recover block - bc = uffs_BlockInfoGet(dev, dev->bad.block); - - if (bc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get bad block info"); - return; - } - - succRecov = U_TRUE; - for (i = 0; i < dev->attr->pages_per_block; i++) { - page = uffs_FindPageInBlockWithPageId(dev, bc, i); - if (page == UFFS_INVALID_PAGE) { - break; //end of last valid page, normal break - } - page = uffs_FindBestPageInBlock(dev, bc, page); - if (page == UFFS_INVALID_PAGE) { - // got an invalid page ? it's bad block anyway ... - uffs_Perror(UFFS_MSG_SERIOUS, "bad block recover (block %d) not finished", bc->block); - break; - } - tag = GET_TAG(bc, page); - buf = uffs_BufClone(dev, NULL); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Can't clone a new buf!"); - succRecov = U_FALSE; - break; - } - //NOTE: since this is a bad block, we can't guarantee the data is ECC ok, - // so just load data even ECC is not OK. - ret = uffs_LoadPhyDataToBufEccUnCare(dev, buf, bc->block, page); - if (ret == U_FAIL) { - uffs_Perror(UFFS_MSG_SERIOUS, "I/O error ?"); - uffs_BufFreeClone(dev, buf); - succRecov = U_FALSE; - break; - } - buf->data_len = TAG_DATA_LEN(tag); - if (buf->data_len > dev->com.pg_data_size) { - uffs_Perror(UFFS_MSG_NOISY, "data length over flow!!!"); - buf->data_len = dev->com.pg_data_size; - } - - buf->parent = TAG_PARENT(tag); - buf->serial = TAG_SERIAL(tag); - buf->type = TAG_TYPE(tag); - buf->page_id = TAG_PAGE_ID(tag); - - // new tag copied from old tag, and increase time-stamp. - newTag = *tag; - TAG_BLOCK_TS(&newTag) = uffs_GetNextBlockTimeStamp(TAG_BLOCK_TS(tag)); - - ret = uffs_FlashWritePageCombine(dev, good->u.list.block, i, buf, &newTag); - - goodBlockIsDirty = U_TRUE; - uffs_BufFreeClone(dev, buf); - - if (ret == UFFS_FLASH_IO_ERR) { - uffs_Perror(UFFS_MSG_NORMAL, "I/O error ?"); - succRecov = U_FALSE; - break; - } - } - - - if (succRecov == U_TRUE) { - // successful recover bad block, so need to mark bad block, - // and replace with good one - - region = SEARCH_REGION_DIR|SEARCH_REGION_FILE|SEARCH_REGION_DATA; - bad = uffs_TreeFindNodeByBlock(dev, dev->bad.block, ®ion); - if (bad != NULL) { - switch (region) { - case SEARCH_REGION_DIR: - bad->u.dir.block = good->u.list.block; - type = UFFS_TYPE_DIR; - break; - case SEARCH_REGION_FILE: - bad->u.file.block = good->u.list.block; - type = UFFS_TYPE_FILE; - break; - case SEARCH_REGION_DATA: - bad->u.data.block = good->u.list.block; - type = UFFS_TYPE_DATA; - } - - //from now, the 'bad' is actually good block :))) - uffs_Perror(UFFS_MSG_NOISY, - "new bad block %d found, and replaced by %d, type %d!", - dev->bad.block, good->u.list.block, type); - uffs_BlockInfoExpire(dev, bc, UFFS_ALL_PAGES); - //we reuse the 'good' node as bad block node, and process the bad block. - good->u.list.block = dev->bad.block; - uffs_BadBlockProcess(dev, good); - } - else { - uffs_Perror(UFFS_MSG_SERIOUS, - "can't find the reported bad block(%d) in the tree???", - dev->bad.block); - if (goodBlockIsDirty == U_TRUE) - dev->ops->EraseBlock(dev, good->u.list.block); - uffs_TreeInsertToErasedListTail(dev, good); - } - } - else { - if (goodBlockIsDirty == U_TRUE) - dev->ops->EraseBlock(dev, good->u.list.block); - uffs_TreeInsertToErasedListTail(dev, good); //put back to erased list - } - - uffs_BlockInfoPut(dev, bc); - -} - - -/** put a new block to the bad block waiting list */ -void uffs_BadBlockAdd(uffs_Device *dev, int block) -{ - if (dev->bad.block == block) - return; - - if (dev->bad.block != UFFS_INVALID_BLOCK) - uffs_Perror(UFFS_MSG_SERIOUS, "Can't add more then one bad block !"); - else - dev->bad.block = block; -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_blockinfo.c b/components/dfs/filesystems/uffs/src/uffs/uffs_blockinfo.c deleted file mode 100644 index f80bc6113e..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_blockinfo.c +++ /dev/null @@ -1,413 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_blockinfo.c - * \brief block information cache system manipulations - * \author Ricky Zheng, created 10th May, 2005 - */ - -#include "uffs_config.h" -#include "uffs/uffs_blockinfo.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_os.h" - -#include - -#define PFX "bc : " - -#define UFFS_CLONE_BLOCK_INFO_NEXT ((uffs_BlockInfo *)(-2)) - -/** - * \brief before block info cache is enable, - * this function should be called to initialize it - * - * \param[in] dev uffs device - * \param[in] maxCachedBlocks maximum cache buffers to be allocated - * \return result of initialization - * \retval U_SUCC successful - * \retval U_FAIL failed - */ -URET uffs_BlockInfoInitCache(uffs_Device *dev, int maxCachedBlocks) -{ - uffs_BlockInfo * blockInfos = NULL; - uffs_PageSpare * pageSpares = NULL; - void * buf = NULL; - uffs_BlockInfo *work = NULL; - int size, i, j; - - if (dev->bc.head != NULL) { - uffs_Perror(UFFS_MSG_NOISY, - "block info cache has been inited already, " - "now release it first."); - uffs_BlockInfoReleaseCache(dev); - } - - size = ( - sizeof(uffs_BlockInfo) + - sizeof(uffs_PageSpare) * dev->attr->pages_per_block - ) * maxCachedBlocks; - - if (dev->mem.blockinfo_pool_size == 0) { - if (dev->mem.malloc) { - dev->mem.blockinfo_pool_buf = dev->mem.malloc(dev, size); - if (dev->mem.blockinfo_pool_buf) - dev->mem.blockinfo_pool_size = size; - } - } - if (size > dev->mem.blockinfo_pool_size) { - uffs_Perror(UFFS_MSG_DEAD, - "Block cache buffer require %d but only %d available.", - size, dev->mem.blockinfo_pool_size); - return U_FAIL; - } - - uffs_Perror(UFFS_MSG_NOISY, "alloc info cache %d bytes.", size); - - buf = dev->mem.blockinfo_pool_buf; - - memset(buf, 0, size); - - dev->bc.mem_pool = buf; - - size = 0; - blockInfos = (uffs_BlockInfo *)buf; - size += sizeof(uffs_BlockInfo) * maxCachedBlocks; - - pageSpares = (uffs_PageSpare *)((char *)buf + size); - - //initialize block info - work = &(blockInfos[0]); - dev->bc.head = work; - work->ref_count = 0; - work->prev = NULL; - work->next = &(blockInfos[1]); - work->block = UFFS_INVALID_BLOCK; - - for (i = 0; i < maxCachedBlocks - 2; i++) { - work = &(blockInfos[i+1]); - work->prev = &(blockInfos[i]); - work->next = &(blockInfos[i+2]); - work->ref_count = 0; - work->block = UFFS_INVALID_BLOCK; - } - //the last node - work = &(blockInfos[i+1]); - work->prev = &(blockInfos[i]); - work->next = NULL; - work->block = UFFS_INVALID_BLOCK; - work->ref_count = 0; - dev->bc.tail = work; - - //initialize spares - work = dev->bc.head; - for (i = 0; i < maxCachedBlocks; i++) { - work->spares = &(pageSpares[i*dev->attr->pages_per_block]); - for (j = 0; j < dev->attr->pages_per_block; j++) { - work->spares[j].expired = 1; - } - work->expired_count = dev->attr->pages_per_block; - work = work->next; - } - return U_SUCC; -} - -/** - * \brief release all allocated memory of block info cache, - * this function should be called when unmount file system - * \param[in] dev uffs device - */ -URET uffs_BlockInfoReleaseCache(uffs_Device *dev) -{ - uffs_BlockInfo *work; - - if (dev->bc.head) { - for (work = dev->bc.head; work != NULL; work = work->next) { - if (work->ref_count != 0) { - uffs_Perror(UFFS_MSG_SERIOUS, - "There have refed block info cache, release cache fail."); - return U_FAIL; - } - } - if (dev->mem.free) { - dev->mem.free(dev, dev->bc.mem_pool); - dev->mem.blockinfo_pool_size = 0; - } - } - - dev->bc.head = dev->bc.tail = NULL; - dev->bc.mem_pool = NULL; - - return U_SUCC; -} - -static void _BreakBcFromList(uffs_Device *dev, uffs_BlockInfo *bc) -{ - if (bc->prev) - bc->prev->next = bc->next; - - if (bc->next) - bc->next->prev = bc->prev; - - if (dev->bc.head == bc) - dev->bc.head = bc->next; - - if (dev->bc.tail == bc) - dev->bc.tail = bc->prev; -} - -static void _InsertToBcListTail(uffs_Device *dev, uffs_BlockInfo *bc) -{ - bc->next = NULL; - bc->prev = dev->bc.tail; - bc->prev->next = bc; - dev->bc.tail = bc; -} - -static void _MoveBcToTail(uffs_Device *dev, uffs_BlockInfo *bc) -{ - _BreakBcFromList(dev, bc); - _InsertToBcListTail(dev, bc); -} - - -/** - * \brief load page spare data to given block info structure - * with given page number - * \param[in] dev uffs device - * \param[in] work given block info to be filled with - * \param[in] page given page number to be read from, - * if #UFFS_ALL_PAGES is presented, it will read - * all pages, otherwise it will read only one given page. - * \return load result - * \retval U_SUCC successful - * \retval U_FAIL fail to load - * \note work->block must be set before load block info - */ -URET uffs_BlockInfoLoad(uffs_Device *dev, uffs_BlockInfo *work, int page) -{ - int i, ret; - uffs_PageSpare *spare; - - if (page == UFFS_ALL_PAGES) { - for (i = 0; i < dev->attr->pages_per_block; i++) { - spare = &(work->spares[i]); - if (spare->expired == 0) - continue; - - ret = uffs_FlashReadPageTag(dev, work->block, i, - &(spare->tag)); - if (UFFS_FLASH_HAVE_ERR(ret)) { - uffs_Perror(UFFS_MSG_SERIOUS, - "load block %d page %d spare fail.", - work->block, i); - return U_FAIL; - } - spare->expired = 0; - work->expired_count--; - } - } - else { - if (page < 0 || page >= dev->attr->pages_per_block) { - uffs_Perror(UFFS_MSG_SERIOUS, "page out of range !"); - return U_FAIL; - } - spare = &(work->spares[page]); - if (spare->expired != 0) { - ret = uffs_FlashReadPageTag(dev, work->block, page, - &(spare->tag)); - if (UFFS_FLASH_HAVE_ERR(ret)) { - uffs_Perror(UFFS_MSG_SERIOUS, - "load block %d page %d spare fail.", - work->block, page); - return U_FAIL; - } - spare->expired = 0; - work->expired_count--; - } - } - return U_SUCC; -} - - -/** - * \brief find a block cache with given block number - * \param[in] dev uffs device - * \param[in] block block number - * \return found block cache - * \retval NULL cache not found - * \retval non-NULL found cache pointer - */ -uffs_BlockInfo * uffs_BlockInfoFindInCache(uffs_Device *dev, int block) -{ - uffs_BlockInfo *work; - - //search cached block - for (work = dev->bc.head; work != NULL; work = work->next) { - if (work->block == block) { - work->ref_count++; - return work; - } - } - return NULL; -} - - -/** - * \brief Find a cached block in cache pool, - * if the cached block exist then return the pointer, - * if the block does not cached already, find a non-used cache. - * if all of cached are used out, return NULL. - * \param[in] dev uffs device - * \param[in] block block number to be found - * \return found block cache buffer - * \retval NULL caches used out - * \retval non-NULL buffer pointer of given block - */ -uffs_BlockInfo * uffs_BlockInfoGet(uffs_Device *dev, int block) -{ - uffs_BlockInfo *work; - int i; - - //search cached block - if ((work = uffs_BlockInfoFindInCache(dev, block)) != NULL) { - _MoveBcToTail(dev, work); - return work; - } - - //can't find block from cache, need to find a free(unlocked) cache - for (work = dev->bc.head; work != NULL; work = work->next) { - if(work->ref_count == 0) break; - } - if (work == NULL) { - //caches used out ! - uffs_Perror(UFFS_MSG_SERIOUS, "insufficient block info cache"); - return NULL; - } - - work->block = block; - work->expired_count = dev->attr->pages_per_block; - for (i = 0; i < dev->attr->pages_per_block; i++) { - work->spares[i].expired = 1; - - // TODO: init tag - } - - work->ref_count = 1; - - _MoveBcToTail(dev, work); - - return work; -} - -/** - * \brief put block info buffer back to pool, - * should be called with #uffs_BlockInfoGet in pairs. - * \param[in] dev uffs device - * \param[in] p pointer of block info buffer - */ -void uffs_BlockInfoPut(uffs_Device *dev, uffs_BlockInfo *p) -{ - dev = dev; - if (p) - { - if (p->ref_count == 0) { - uffs_Perror(UFFS_MSG_SERIOUS, - "Put an unused block info cache back ?"); - } - else { - p->ref_count--; - } - } -} - - -/** - * \brief make the given pages expired in given block info buffer - * \param[in] dev uffs device - * \param[in] p pointer of block info buffer - * \param[in] page given page number. - * if #UFFS_ALL_PAGES presented, all pages in the block should be made expired. - */ -void uffs_BlockInfoExpire(uffs_Device *dev, uffs_BlockInfo *p, int page) -{ - int i; - uffs_PageSpare *spare; - - if (page == UFFS_ALL_PAGES) { - for (i = 0; i < dev->attr->pages_per_block; i++) { - spare = &(p->spares[i]); - if (spare->expired == 0) { - spare->expired = 1; - p->expired_count++; - } - } - } - else { - if (page >= 0 && page < dev->attr->pages_per_block) { - spare = &(p->spares[page]); - if (spare->expired == 0) { - spare->expired = 1; - p->expired_count++; - } - } - } -} - -/** - * Is all blcok info cache free (not referenced) ? - */ -UBOOL uffs_BlockInfoIsAllFree(uffs_Device *dev) -{ - uffs_BlockInfo *work; - - work = dev->bc.head; - while (work) { - if (work->ref_count != 0) - return U_FALSE; - work = work->next; - } - - return U_TRUE; -} - -void uffs_BlockInfoExpireAll(uffs_Device *dev) -{ - uffs_BlockInfo *bc; - - bc = dev->bc.head; - while (bc) { - uffs_BlockInfoExpire(dev, bc, UFFS_ALL_PAGES); - bc = bc->next; - } - return; -} diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_buf.c b/components/dfs/filesystems/uffs/src/uffs/uffs_buf.c deleted file mode 100644 index fd646aa73e..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_buf.c +++ /dev/null @@ -1,1799 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ -/** - * \file uffs_buf.c - * \brief uffs page buffers manipulations - * \author Ricky Zheng - * \note Created in 11th May, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_types.h" -#include "uffs/uffs_buf.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_pool.h" -#include "uffs/uffs_ecc.h" -#include "uffs/uffs_badblock.h" -#include - -#define PFX "pbuf: " - - -URET _BufFlush(struct uffs_DeviceSt *dev, UBOOL force_block_recover, int slot); - - -/** - * \brief inspect (print) uffs page buffers. - * \param[in] dev uffs device to be inspected. - */ -void uffs_BufInspect(uffs_Device *dev) -{ - struct uffs_PageBufDescSt *pb = &dev->buf; - uffs_Buf *buf; - - uffs_PerrorRaw(UFFS_MSG_NORMAL, - "------------- page buffer inspect ---------" TENDSTR); - uffs_PerrorRaw(UFFS_MSG_NORMAL, "all buffers: " TENDSTR); - for (buf = pb->head; buf; buf = buf->next) { - if (buf->mark != 0) { - uffs_PerrorRaw(UFFS_MSG_NORMAL, - "\tF:%04x S:%04x P:%02d R:%02d D:%03d M:%c EM:%d" TENDSTR, - buf->parent, buf->serial, - buf->page_id, buf->ref_count, - buf->data_len, buf->mark == UFFS_BUF_VALID ? 'V' : 'D', - buf->ext_mark); - } - } - uffs_PerrorRaw(UFFS_MSG_NORMAL, - "--------------------------------------------" TENDSTR); -} - -/** - * \brief initialize page buffers for device - * in UFFS, each device has one buffer pool - * \param[in] dev uffs device - * \param[in] buf_max maximum buffer number, normally use #MAX_PAGE_BUFFERS - * \param[in] dirty_buf_max maximum dirty buffer allowed, - * if the dirty buffer over this number, - * than need to be flush to flash - */ -URET uffs_BufInit(uffs_Device *dev, int buf_max, int dirty_buf_max) -{ - void *pool; - u8 *data; - uffs_Buf *buf; - int size; - int i, slot; - - if (!dev) - return U_FAIL; - - //init device common parameters, which are needed by page buffers - dev->com.pg_size = dev->attr->page_data_size; // we use the whole page. - dev->com.header_size = sizeof(struct uffs_MiniHeaderSt); // mini header - dev->com.pg_data_size = dev->com.pg_size - dev->com.header_size; - - if (dev->buf.pool != NULL) { - uffs_Perror(UFFS_MSG_NORMAL, - "buf.pool is not NULL, buf already inited ?"); - return U_FAIL; - } - - size = (sizeof(uffs_Buf) + dev->com.pg_size) * buf_max; - if (dev->mem.pagebuf_pool_size == 0) { - if (dev->mem.malloc) { - dev->mem.pagebuf_pool_buf = dev->mem.malloc(dev, size); - if (dev->mem.pagebuf_pool_buf) - dev->mem.pagebuf_pool_size = size; - } - } - if (size > dev->mem.pagebuf_pool_size) { - uffs_Perror(UFFS_MSG_DEAD, - "page buffers require %d but only %d available.", - size, dev->mem.pagebuf_pool_size); - return U_FAIL; - } - pool = dev->mem.pagebuf_pool_buf; - - uffs_Perror(UFFS_MSG_NOISY, "alloc %d bytes.", size); - dev->buf.pool = pool; - - for (i = 0; i < buf_max; i++) { - buf = (uffs_Buf *)((u8 *)pool + (sizeof(uffs_Buf) * i)); - memset(buf, 0, sizeof(uffs_Buf)); - data = (u8 *)pool + (sizeof(uffs_Buf) * buf_max) + (dev->com.pg_size * i); - buf->header = data; - buf->data = data + dev->com.header_size; - buf->mark = UFFS_BUF_EMPTY; - memset(buf->header, 0, dev->com.pg_size); - if (i == 0) { - buf->prev = NULL; - dev->buf.head = buf; - } - else { - buf->prev = (uffs_Buf *)((u8 *)buf - sizeof(uffs_Buf)); - } - - if (i == (buf_max - 1)) { - buf->next = NULL; - dev->buf.tail = buf; - } - else { - buf->next = (uffs_Buf *)((u8 *)buf + sizeof(uffs_Buf)); - } - } - - dev->buf.buf_max = buf_max; - dev->buf.dirty_buf_max = (dirty_buf_max > dev->attr->pages_per_block ? - dev->attr->pages_per_block : dirty_buf_max); - - for (slot = 0; slot < dev->cfg.dirty_groups; slot++) { - dev->buf.dirtyGroup[slot].dirty = NULL; - dev->buf.dirtyGroup[slot].count = 0; - } - return U_SUCC; -} - -/** - * \brief flush all buffers - */ -URET uffs_BufFlushAll(struct uffs_DeviceSt *dev) -{ - int slot; - for (slot = 0; slot < dev->cfg.dirty_groups; slot++) { - if(_BufFlush(dev, FALSE, slot) != U_SUCC) { - uffs_Perror(UFFS_MSG_NORMAL, - "fail to flush buffer(slot %d)", slot); - return U_FAIL; - } - } - return U_SUCC; -} - -/** - * \brief release all page buffer, this function should be called - when unmounting a uffs device - * \param[in] dev uffs device - * \note if there are page buffers in used, it may cause fail to release - */ -URET uffs_BufReleaseAll(uffs_Device *dev) -{ - uffs_Buf *p; - - if (!dev) - return U_FAIL; - - //now release all buffer - p = dev->buf.head; - while (p) { - if (p->ref_count != 0) { - uffs_Perror(UFFS_MSG_NORMAL, PFX - "can't release buffers, parent:%d, serial:%d, \ - page_id:%d still in used.\n", - p->parent, p->serial, p->page_id); - return U_FAIL; - } - p = p->next; - } - - if (uffs_BufFlushAll(dev) != U_SUCC) { - uffs_Perror(UFFS_MSG_NORMAL, - "can't release buf, fail to flush buffer"); - return U_FAIL; - } - - if (dev->mem.free) { - dev->mem.free(dev, dev->buf.pool); - dev->mem.pagebuf_pool_size = 0; - } - - dev->buf.pool = NULL; - dev->buf.head = dev->buf.tail = NULL; - - return U_SUCC; -} - - -static void _BreakFromBufList(uffs_Device *dev, uffs_Buf *buf) -{ - if(buf->next) - buf->next->prev = buf->prev; - - if(buf->prev) - buf->prev->next = buf->next; - - if(dev->buf.head == buf) - dev->buf.head = buf->next; - - if(dev->buf.tail == buf) - dev->buf.tail = buf->prev; - -} - -static void _LinkToBufListHead(uffs_Device *dev, uffs_Buf *buf) -{ - if (buf == dev->buf.head) - return; - - buf->prev = NULL; - buf->next = dev->buf.head; - - if (dev->buf.head) - dev->buf.head->prev = buf; - - if (dev->buf.tail == NULL) - dev->buf.tail = buf; - - dev->buf.head = buf; -} - -static void _LinkToBufListTail(uffs_Device *dev, uffs_Buf *buf) -{ - if (dev->buf.tail == buf) - return; - - buf->prev = dev->buf.tail; - buf->next = NULL; - - if (dev->buf.tail) - dev->buf.tail->next = buf; - - if (dev->buf.head == NULL) - dev->buf.head = buf; - - dev->buf.tail = buf; -} - -//move a node which linked in the list to the head of list -static void _MoveNodeToHead(uffs_Device *dev, uffs_Buf *p) -{ - if (p == dev->buf.head) - return; - - //break from list - _BreakFromBufList(dev, p); - - //link to head - _LinkToBufListHead(dev, p); -} - -// check if the buf is already in dirty list -static UBOOL _IsBufInInDirtyList(uffs_Device *dev, int slot, uffs_Buf *buf) -{ - uffs_Buf *work; - work = dev->buf.dirtyGroup[slot].dirty; - while (work) { - if (work == buf) - return U_TRUE; - work = work->next_dirty; - } - - return U_FALSE; -} - -static void _LinkToDirtyList(uffs_Device *dev, int slot, uffs_Buf *buf) -{ - - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "Try to insert a NULL node into dirty list ?"); - return; - } - - buf->mark = UFFS_BUF_DIRTY; - buf->prev_dirty = NULL; - buf->next_dirty = dev->buf.dirtyGroup[slot].dirty; - - if (dev->buf.dirtyGroup[slot].dirty) - dev->buf.dirtyGroup[slot].dirty->prev_dirty = buf; - - dev->buf.dirtyGroup[slot].dirty = buf; - dev->buf.dirtyGroup[slot].count++; -} - -static int CountFreeBuf(uffs_Device *dev) -{ - int count = 0; - - uffs_Buf *buf = dev->buf.head; - - while (buf) { - - if (buf->ref_count == 0 && - buf->mark != UFFS_BUF_DIRTY) - count++; - - buf = buf->next; - } - - return count; -} - -static uffs_Buf * _FindFreeBufEx(uffs_Device *dev, int clone) -{ - uffs_Buf *buf; - - if (!clone && CountFreeBuf(dev) <= CLONE_BUFFERS_THRESHOLD) - return NULL; - -#if 0 - buf = dev->buf.head; - while (buf) { - - if (buf->ref_count == 0 && - buf->mark != UFFS_BUF_DIRTY) - return buf; - - buf = buf->next; - } -#else - buf = dev->buf.tail; - while (buf) { - - if(buf->ref_count == 0 && - buf->mark != UFFS_BUF_DIRTY) - return buf; - - buf = buf->prev; - } -#endif - - return buf; -} - -static uffs_Buf * _FindFreeBuf(uffs_Device *dev) -{ - return _FindFreeBufEx(dev, 0); -} - - -/** - * load psychical page data into buf and do ecc check - * \param[in] dev uffs device - * \param[in] buf buf to be load in - * \param[in] block psychical block number - * \param[in] page psychical page number - * \return return U_SUCC if no error, - * return U_FAIL if I/O error or ecc check fail - */ -URET uffs_BufLoadPhyData(uffs_Device *dev, uffs_Buf *buf, u32 block, u32 page) -{ - int ret; - - ret = uffs_FlashReadPage(dev, block, page, buf, U_FALSE); - - if (UFFS_FLASH_HAVE_ERR(ret)) { - buf->mark = UFFS_BUF_EMPTY; - return U_FAIL; - } - else { - buf->mark = UFFS_BUF_VALID; - return U_SUCC; - } -} - -/** - * \brief load psychical page data into buf and ignore ECC result - * - * \param[in] dev uffs device - * \param[in] buf buf to be load in - * \param[in] block psychical block number - * \param[in] page psychical page number - * - * \return return U_SUCC if no error, return U_FAIL if I/O error - * \note this function should be only used when doing bad block recover. - */ -URET uffs_LoadPhyDataToBufEccUnCare(uffs_Device *dev, - uffs_Buf *buf, u32 block, u32 page) -{ - int ret; - - ret = uffs_FlashReadPage(dev, block, page, buf, U_TRUE); - - if (ret == UFFS_FLASH_IO_ERR) { - buf->mark = UFFS_BUF_EMPTY; - return U_FAIL; - } - else { - buf->mark = UFFS_BUF_VALID; - return U_SUCC; - } -} - -/** - * find a buffer in the pool - * \param[in] dev uffs device - * \param[in] start buf to search from - * \param[in] parent parent serial num - * \param[in] serial serial num - * \param[in] page_id page_id (if page_id == UFFS_ALL_PAGES then any page would match) - * \return return found buffer, return NULL if buffer not found - */ -uffs_Buf * uffs_BufFindFrom(uffs_Device *dev, uffs_Buf *start, - u16 parent, u16 serial, u16 page_id) -{ - uffs_Buf *p = start; - - while (p) { - if( p->parent == parent && - p->serial == serial && - (page_id == UFFS_ALL_PAGES || p->page_id == page_id) && - p->mark != UFFS_BUF_EMPTY) - { - //they have match one - return p; - } - p = p->next; - } - - return NULL; //buffer not found -} - -/** - * find a buffer in the pool - * \param[in] dev uffs device - * \param[in] parent parent serial num - * \param[in] serial serial num - * \param[in] page_id page_id (if page_id == UFFS_ALL_PAGES then any page would match) - * \return return found buffer, return NULL if buffer not found - */ -uffs_Buf * uffs_BufFind(uffs_Device *dev, - u16 parent, u16 serial, u16 page_id) -{ - uffs_Buf *p = dev->buf.head; - - return uffs_BufFindFrom(dev, p, parent, serial, page_id); -} - - -static uffs_Buf * _FindBufInDirtyList(uffs_Buf *dirty, u16 page_id) -{ - while(dirty) { - if (dirty->page_id == page_id) - return dirty; - dirty = dirty->next_dirty; - } - return NULL; -} - -static URET _BreakFromDirty(uffs_Device *dev, uffs_Buf *dirtyBuf) -{ - int slot = -1; - - if (dirtyBuf->mark != UFFS_BUF_DIRTY) { - uffs_Perror(UFFS_MSG_NORMAL, - "try to break a non-dirty buf from dirty list ?"); - return U_FAIL; - } - - slot = uffs_BufFindGroupSlot(dev, dirtyBuf->parent, dirtyBuf->serial); - if (slot < 0) { - uffs_Perror(UFFS_MSG_NORMAL, "no dirty list exit ?"); - return U_FAIL; - } - - // break from the link - if (dirtyBuf->next_dirty) { - dirtyBuf->next_dirty->prev_dirty = dirtyBuf->prev_dirty; - } - - if (dirtyBuf->prev_dirty) { - dirtyBuf->prev_dirty->next_dirty = dirtyBuf->next_dirty; - } - - // check if it's the link head ... - if (dev->buf.dirtyGroup[slot].dirty == dirtyBuf) { - dev->buf.dirtyGroup[slot].dirty = dirtyBuf->next_dirty; - } - - dirtyBuf->next_dirty = dirtyBuf->prev_dirty = NULL; // clear dirty link - - dev->buf.dirtyGroup[slot].count--; - - return U_SUCC; -} - -static u16 _GetDirOrFileNameSum(uffs_Device *dev, uffs_Buf *buf) -{ - u16 data_sum = 0; //default: 0 - uffs_FileInfo *fi; - - dev = dev; - //FIXME: We use the same schema for both dir and file. - if (buf->type == UFFS_TYPE_FILE || buf->type == UFFS_TYPE_DIR) { - if (buf->page_id == 0) { - fi = (uffs_FileInfo *)(buf->data); - data_sum = uffs_MakeSum16(fi->name, fi->name_len); - } - } - - return data_sum; -} - - -static URET _CheckDirtyList(uffs_Buf *dirty) -{ - u16 parent; - u16 serial; - - if (dirty == NULL) { - return U_SUCC; - } - - parent = dirty->parent; - serial = dirty->serial; - dirty = dirty->next_dirty; - - while (dirty) { - if (parent != dirty->parent || - serial != dirty->serial) { - uffs_Perror(UFFS_MSG_SERIOUS, - "parent or serial in dirty pages buffer are not the same ?"); - return U_FAIL; - } - if (dirty->mark != UFFS_BUF_DIRTY) { - uffs_Perror(UFFS_MSG_SERIOUS, - "non-dirty page buffer in dirty buffer list ?"); - return U_FAIL; - } - dirty = dirty->next_dirty; - } - return U_SUCC; -} - -/** find a page in dirty list, which has minimum page_id */ -uffs_Buf * _FindMinimunPageIdFromDirtyList(uffs_Buf *dirtyList) -{ - uffs_Buf * work = dirtyList; - uffs_Buf * buf = dirtyList; - - if (buf) { - work = work->next_dirty; - while (work) { - if (work->page_id < buf->page_id) - buf = work; - work = work->next_dirty; - } - - uffs_Assert(buf->mark == UFFS_BUF_DIRTY, - "buf (serial = %d, parent = %d, page_id = %d, type = %d) in dirty list but mark is 0x%x ?", - buf->serial, buf->parent, buf->page_id, buf->type, buf->mark); - } - - return buf; -} - - -/** - * \brief flush buffer with block recover - * - * Scenario: - * 1. get a free (erased) block --> newNode
- * 2. copy from old block ---> oldNode, or copy from dirty list,
- * sorted by page_id, to new block. Skips the invalid pages when copy pages.
- * 3. erased old block. set new info to oldNode, set newNode->block = old block,
- * and put newNode to erased list.
- * \note IT'S IMPORTANT TO KEEP OLD NODE IN THE LIST, - * so you don't need to update the obj->node :-) - */ -static URET uffs_BufFlush_Exist_With_BlockCover( - uffs_Device *dev, - int slot, //!< dirty group slot - TreeNode *node, //!< old data node on tree - uffs_BlockInfo *bc //!< old data block info - ) -{ - u16 i; - u8 type, timeStamp; - u16 page, parent, serial; - uffs_Buf *buf; - TreeNode *newNode; - uffs_BlockInfo *newBc; - uffs_Tags *tag, *oldTag; - int x; - u16 newBlock; - UBOOL succRecover; //U_TRUE: recover successful, erase old block, - //U_FALSE: fail to recover, erase new block - UBOOL flash_op_err; - u16 data_sum = 0xFFFF; - - UBOOL useCloneBuf; - - type = dev->buf.dirtyGroup[slot].dirty->type; - parent = dev->buf.dirtyGroup[slot].dirty->parent; - serial = dev->buf.dirtyGroup[slot].dirty->serial; - -retry: - uffs_BlockInfoLoad(dev, bc, UFFS_ALL_PAGES); - - flash_op_err = UFFS_FLASH_NO_ERR; - succRecover = U_FALSE; - - newNode = uffs_TreeGetErasedNode(dev); - if (newNode == NULL) { - uffs_Perror(UFFS_MSG_NOISY, "no enough erased block!"); - goto ext; - } - newBlock = newNode->u.list.block; - newBc = uffs_BlockInfoGet(dev, newBlock); - if (newBc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "get block info fail!"); - uffs_InsertToErasedListHead(dev, newNode); //put node back to erased list - //because it doesn't use, so put to head - goto ext; - } - - //uffs_Perror(UFFS_MSG_NOISY, "flush buffer with block cover to %d", newBlock); - -#if 0 - // this assert seems not necessary ... - if (!uffs_Assert(newBc->expired_count == dev->attr->pages_per_block, - "We have block cache for erased block ? expired_count = %d, block = %d\n", - newBc->expired_count, newBc->block)) { - uffs_BlockInfoExpire(dev, newBc, UFFS_ALL_PAGES); - } -#endif - - uffs_BlockInfoLoad(dev, newBc, UFFS_ALL_PAGES); - timeStamp = uffs_GetNextBlockTimeStamp(uffs_GetBlockTimeStamp(dev, bc)); - -// uffs_Perror(UFFS_MSG_NOISY, "Flush buffers with Block Recover, from %d to %d", -// bc->block, newBc->block); - - for (i = 0; i < dev->attr->pages_per_block; i++) { - tag = GET_TAG(newBc, i); - TAG_DIRTY_BIT(tag) = TAG_DIRTY; - TAG_VALID_BIT(tag) = TAG_VALID; - TAG_BLOCK_TS(tag) = timeStamp; - TAG_PARENT(tag) = parent; - TAG_SERIAL(tag) = serial; - TAG_TYPE(tag) = type; - TAG_PAGE_ID(tag) = (u8)(i & 0xFF); // now, page_id = page. - // FIX ME!! if more than 256 pages in a block - - SEAL_TAG(tag); - - buf = _FindBufInDirtyList(dev->buf.dirtyGroup[slot].dirty, i); - if (buf != NULL) { - if (i == 0) - data_sum = _GetDirOrFileNameSum(dev, buf); - - TAG_DATA_LEN(tag) = buf->data_len; - - if (buf->data_len == 0 || (buf->ext_mark & UFFS_BUF_EXT_MARK_TRUNC_TAIL)) { // this only happen when truncating a file - - // when truncating a file, the last dirty buf will be - // set as UFFS_BUF_EXT_MARK_TAIL. so that we don't do page recovery - // for the rest pages in the block. (file is ended at this page) - - if (!uffs_Assert((buf->ext_mark & UFFS_BUF_EXT_MARK_TRUNC_TAIL) != 0, - "buf->data == 0 but not the last page of truncating ? block = %d, page_id = %d", - bc->block, i)) { - - // We can't do more about it for now ... - } - - if (buf->data_len > 0) { - flash_op_err = uffs_FlashWritePageCombine(dev, newBlock, i, buf, tag); - } - else { - // data_len == 0, no I/O needed. - flash_op_err = UFFS_FLASH_NO_ERR; - } - succRecover = U_TRUE; - break; - } - else - flash_op_err = uffs_FlashWritePageCombine(dev, newBlock, i, buf, tag); - - if (flash_op_err != UFFS_FLASH_NO_ERR) { - if (flash_op_err == UFFS_FLASH_BAD_BLK) { - uffs_Perror(UFFS_MSG_NORMAL, - "new bad block %d discovered.", newBlock); - break; - } - else if (flash_op_err == UFFS_FLASH_IO_ERR) { - uffs_Perror(UFFS_MSG_NORMAL, - "writing to block %d page %d, I/O error ?", - (int)newBlock, (int)i); - break; - } - else { - uffs_Perror(UFFS_MSG_SERIOUS, "Unhandled flash op result: %d", flash_op_err); - break; - } - } - } - else { - page = uffs_FindPageInBlockWithPageId(dev, bc, i); - if (page == UFFS_INVALID_PAGE) { - succRecover = U_TRUE; - break; //end of last page, normal break - } - page = uffs_FindBestPageInBlock(dev, bc, page); - - if (!uffs_Assert(page != UFFS_INVALID_PAGE, "got an invalid page ?\n")) - break; - - oldTag = GET_TAG(bc, page); - - // First, try to find existing cached buffer. - // Note: do not call uffs_BufGetEx() as it may trigger buf flush and result in infinite loop - buf = uffs_BufGet(dev, parent, serial, i); - - if (buf == NULL) { // no cached page buffer, use clone buffer. - useCloneBuf = U_TRUE; - buf = uffs_BufClone(dev, NULL); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Can't clone a new buf!"); - break; - } - x = uffs_BufLoadPhyData(dev, buf, bc->block, page); - if (x == U_FAIL) { - if (HAVE_BADBLOCK(dev) && dev->bad.block == bc->block) { - // the old block is a bad block, we'll process it later. - uffs_Perror(UFFS_MSG_SERIOUS, - "the old block %d is a bad block, \ - but ignore it for now.", - bc->block); - } - else { - uffs_Perror(UFFS_MSG_SERIOUS, "I/O error ?"); - uffs_BufFreeClone(dev, buf); - flash_op_err = UFFS_FLASH_IO_ERR; - break; - } - } - - buf->type = type; - buf->parent = parent; - buf->serial = serial; - buf->page_id = TAG_PAGE_ID(oldTag); - buf->data_len = TAG_DATA_LEN(oldTag); - - } - else { - useCloneBuf = U_FALSE; - - uffs_Assert(buf->page_id == TAG_PAGE_ID(oldTag), "buf->page_id = %d, tag page id: %d", buf->page_id, TAG_PAGE_ID(oldTag)); - uffs_Assert(buf->data_len == TAG_DATA_LEN(oldTag), "buf->data_len = %d, tag data len: %d", buf->data_len, TAG_DATA_LEN(oldTag)); - } - - if (buf->data_len > dev->com.pg_data_size) { - uffs_Perror(UFFS_MSG_NOISY, "data length over flow, truncated !"); - buf->data_len = dev->com.pg_data_size; - } - - if (!uffs_Assert(buf->data_len != 0, "data_len == 0 ? block %d, page %d, serial %d, parent %d", - bc->block, page, buf->serial, buf->parent)) { - // this could be some error on flash ? we can't do more about it for now ... - } - - TAG_DATA_LEN(tag) = buf->data_len; - - if (i == 0) - data_sum = _GetDirOrFileNameSum(dev, buf); - - flash_op_err = uffs_FlashWritePageCombine(dev, newBlock, i, buf, tag); - - if (buf) { - if (useCloneBuf) - uffs_BufFreeClone(dev, buf); - else - uffs_BufPut(dev, buf); - } - - if (flash_op_err == UFFS_FLASH_BAD_BLK) { - uffs_Perror(UFFS_MSG_NORMAL, - "new bad block %d discovered.", newBlock); - break; - } - else if (flash_op_err == UFFS_FLASH_IO_ERR) { - uffs_Perror(UFFS_MSG_NORMAL, "I/O error ?", newBlock); - break; - } - } - } //end of for - - if (i == dev->attr->pages_per_block) - succRecover = U_TRUE; - else { - // expire last page info cache in case the 'tag' is not written. - uffs_BlockInfoExpire(dev, newBc, i); - } - - if (flash_op_err == UFFS_FLASH_BAD_BLK) { - uffs_BlockInfoExpire(dev, newBc, UFFS_ALL_PAGES); - uffs_BlockInfoPut(dev, newBc); - if (newNode->u.list.block == dev->bad.block) { - // the recovered block is a BAD block (buy me a lotto, please :-), we need to - // deal with it immediately (mark it as 'bad' and put into bad block list). - uffs_BadBlockProcess(dev, newNode); - } - - uffs_Perror(UFFS_MSG_NORMAL, "Retry block cover ..."); - - goto retry; // retry on a new erased block ... - } - - if (succRecover == U_TRUE) { - // now it's time to clean the dirty buffers - for (i = 0; i < dev->attr->pages_per_block; i++) { - buf = _FindBufInDirtyList(dev->buf.dirtyGroup[slot].dirty, i); - if (buf) { - if (_BreakFromDirty(dev, buf) == U_SUCC) { - buf->mark = UFFS_BUF_VALID; - buf->ext_mark &= ~UFFS_BUF_EXT_MARK_TRUNC_TAIL; - _MoveNodeToHead(dev, buf); - } - } - } - - // swap the old block node and new block node. - // it's important that we 'swap' the block and keep the node unchanged - // so that allowing someone hold the node pointer unawared. - switch (type) { - case UFFS_TYPE_DIR: - node->u.dir.parent = parent; - node->u.dir.serial = serial; - node->u.dir.block = newBlock; - node->u.dir.checksum = data_sum; - break; - case UFFS_TYPE_FILE: - node->u.file.parent = parent; - node->u.file.serial = serial; - node->u.file.block = newBlock; - node->u.file.checksum = data_sum; - break; - case UFFS_TYPE_DATA: - node->u.data.parent = parent; - node->u.data.serial = serial; - node->u.data.block = newBlock; - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "UNKNOW TYPE"); - break; - } - - newNode->u.list.block = bc->block; - - // if the recovered block is a bad block, it's time to process it. - if (HAVE_BADBLOCK(dev) && dev->bad.block == newNode->u.list.block) { - //uffs_Perror(UFFS_MSG_SERIOUS, "Still have bad block ?"); - uffs_BadBlockProcess(dev, newNode); - } - else { - // erase recovered block, put it back to erased block list. - if (uffs_IsThisBlockUsed(dev, bc)) { - uffs_FlashEraseBlock(dev, bc->block); - } - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, newNode); - else - uffs_TreeInsertToErasedListTail(dev, newNode); - } - } - else { - - uffs_BlockInfoExpire(dev, bc, UFFS_ALL_PAGES); // FIXME: this might not be necessary ... - - uffs_FlashEraseBlock(dev, newBlock); - newNode->u.list.block = newBlock; - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, newNode); - else - uffs_TreeInsertToErasedListTail(dev, newNode); - } - - if (dev->buf.dirtyGroup[slot].dirty != NULL || - dev->buf.dirtyGroup[slot].count != 0) { - uffs_Perror(UFFS_MSG_NORMAL, "still have dirty buffer ?"); - } - - uffs_BlockInfoPut(dev, newBc); - -ext: - return (succRecover == U_TRUE ? U_SUCC : U_FAIL); - -} - - - -/** - * \brief flush buffer to a new block which is not registered in tree - * - * Scenario: - * 1. get a new block - * 2. write pages in dirty list to new block, sorted by page_id - * 3. insert new block to tree - */ -static URET _BufFlush_NewBlock(uffs_Device *dev, int slot) -{ - u8 type; - TreeNode *node; - uffs_BlockInfo *bc; - URET ret; - - ret = U_FAIL; - - node = uffs_TreeGetErasedNode(dev); - if (node == NULL) { - uffs_Perror(UFFS_MSG_NOISY, "no erased block!"); - goto ext; - } - bc = uffs_BlockInfoGet(dev, node->u.list.block); - if (bc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "get block info fail!"); - uffs_InsertToErasedListHead(dev, node); //put node back to erased list - goto ext; - } - - type = dev->buf.dirtyGroup[slot].dirty->type; - - ret = uffs_BufFlush_Exist_With_BlockCover(dev, slot, node, bc); - - if (ret == U_SUCC) - uffs_InsertNodeToTree(dev, type, node); - else { - uffs_FlashEraseBlock(dev, bc->block); - uffs_TreeInsertToErasedListTail(dev, node); - } - - uffs_BlockInfoPut(dev, bc); -ext: - return ret; -} - - -/** - * \brief flush buffer to a block with enough free pages - * - * pages in dirty list must be sorted by page_id to write to flash - */ -static -URET - uffs_BufFlush_Exist_With_Enough_FreePage( - uffs_Device *dev, - int slot, //!< dirty group slot - TreeNode *node, //!< tree node - uffs_BlockInfo *bc //!< block info (Source, also destination) - ) -{ - u16 page; - uffs_Buf *buf; - uffs_Tags *tag; - URET ret = U_FAIL; - int x; - -// uffs_Perror(UFFS_MSG_NOISY, -// "Flush buffers with Enough Free Page to block %d", -// bc->block); - - for (page = 1; // page 0 won't be a free page, so we start from 1. - page < dev->attr->pages_per_block && - dev->buf.dirtyGroup[slot].count > 0; //still has dirty pages? - page++) { - - // locate to the free page (make sure the page is a erased page, so an unclean page won't sneak in) - for (; page < dev->attr->pages_per_block; page++) { - if (uffs_IsPageErased(dev, bc, page)) - break; - } - - if (!uffs_Assert(page < dev->attr->pages_per_block, "no free page? buf flush not finished.")) - break; - - buf = _FindMinimunPageIdFromDirtyList(dev->buf.dirtyGroup[slot].dirty); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "count > 0, but no dirty pages in list ?"); - goto ext; - } - - //write the dirty page (id: buf->page_id) to page (free page) - tag = GET_TAG(bc, page); - TAG_DIRTY_BIT(tag) = TAG_DIRTY; - TAG_VALID_BIT(tag) = TAG_VALID; - TAG_BLOCK_TS(tag) = uffs_GetBlockTimeStamp(dev, bc); - TAG_DATA_LEN(tag) = buf->data_len; - TAG_TYPE(tag) = buf->type; - TAG_PARENT(tag) = buf->parent; - TAG_SERIAL(tag) = buf->serial; - TAG_PAGE_ID(tag) = (u8)(buf->page_id); - - SEAL_TAG(tag); - - x = uffs_FlashWritePageCombine(dev, bc->block, page, buf, tag); - if (x == UFFS_FLASH_IO_ERR) { - uffs_Perror(UFFS_MSG_NORMAL, "I/O error <1>?"); - goto ext; - } - else if (x == UFFS_FLASH_BAD_BLK) { - uffs_Perror(UFFS_MSG_NORMAL, "Bad blcok found, start block cover ..."); - ret = uffs_BufFlush_Exist_With_BlockCover(dev, slot, node, bc); - goto ext; - } - else { - if(_BreakFromDirty(dev, buf) == U_SUCC) { - buf->mark = UFFS_BUF_VALID; - _MoveNodeToHead(dev, buf); - } - } - } //end of for - - if (dev->buf.dirtyGroup[slot].dirty != NULL || - dev->buf.dirtyGroup[slot].count != 0) { - uffs_Perror(UFFS_MSG_NORMAL, "still has dirty buffer ?"); - } - else { - ret = U_SUCC; - } - -ext: - return ret; -} - - -URET _BufFlush(struct uffs_DeviceSt *dev, - UBOOL force_block_recover, int slot) -{ - uffs_Buf *dirty; - TreeNode *node; - uffs_BlockInfo *bc; - u16 n; - URET ret; - u8 type; - u16 parent; - u16 serial; - int block; - - if (dev->buf.dirtyGroup[slot].count == 0) { - return U_SUCC; - } - - dirty = dev->buf.dirtyGroup[slot].dirty; - - if (_CheckDirtyList(dirty) == U_FAIL) - return U_FAIL; - - type = dirty->type; - parent = dirty->parent; - serial = dirty->serial; - - switch (type) { - case UFFS_TYPE_DIR: - node = uffs_TreeFindDirNode(dev, serial); - break; - case UFFS_TYPE_FILE: - node = uffs_TreeFindFileNode(dev, serial); - break; - case UFFS_TYPE_DATA: - node = uffs_TreeFindDataNode(dev, parent, serial); - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "unknown type"); - return U_FAIL; - } - - if (node == NULL) { - //not found in the tree, need to generate a new block - ret = _BufFlush_NewBlock(dev, slot); - } - else { - switch (type) { - case UFFS_TYPE_DIR: - block = node->u.dir.block; - break; - case UFFS_TYPE_FILE: - block = node->u.file.block; - break; - case UFFS_TYPE_DATA: - block = node->u.data.block; - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "unknown type."); - return U_FAIL; - } - bc = uffs_BlockInfoGet(dev, block); - if(bc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "get block info fail."); - return U_FAIL; - } - - ret = uffs_BlockInfoLoad(dev, bc, UFFS_ALL_PAGES); - if (ret == U_SUCC) { - - n = uffs_GetFreePagesCount(dev, bc); - - if (n >= dev->buf.dirtyGroup[slot].count && !force_block_recover) { - //The free pages are enough for the dirty pages - ret = uffs_BufFlush_Exist_With_Enough_FreePage(dev, slot, node, bc); - } - else { - ret = uffs_BufFlush_Exist_With_BlockCover(dev, slot, node, bc); - } - } - uffs_BlockInfoPut(dev, bc); - } - - return ret; -} - -static int _FindMostDirtyGroup(struct uffs_DeviceSt *dev) -{ - int i, slot = -1; - int max_count = 0; - - for (i = 0; i < dev->cfg.dirty_groups; i++) { - if (dev->buf.dirtyGroup[i].dirty && - dev->buf.dirtyGroup[i].lock == 0) { - if (dev->buf.dirtyGroup[i].count > max_count) { - max_count = dev->buf.dirtyGroup[i].count; - slot = i; - } - } - } - - return slot; -} - -/** lock dirty group */ -URET uffs_BufLockGroup(struct uffs_DeviceSt *dev, int slot) -{ - URET ret = U_FAIL; - if (slot >= 0 && slot < dev->cfg.dirty_groups) { - dev->buf.dirtyGroup[slot].lock++; - ret = U_SUCC; - } - return ret; -} - -/** unlock dirty group */ -URET uffs_BufUnLockGroup(struct uffs_DeviceSt *dev, int slot) -{ - URET ret = U_FAIL; - - if (slot >= 0 && slot < dev->cfg.dirty_groups) { - if (dev->buf.dirtyGroup[slot].lock > 0) - dev->buf.dirtyGroup[slot].lock--; - else { - uffs_Perror(UFFS_MSG_SERIOUS, "Try to unlock an unlocked group ?"); - } - ret = U_SUCC; - } - return ret; -} - - -/** - * flush buffers to flash. - * this will flush all dirty groups. - * \param[in] dev uffs device - */ -URET uffs_BufFlush(struct uffs_DeviceSt *dev) -{ - int slot; - - slot = uffs_BufFindFreeGroupSlot(dev); - if (slot >= 0) - return U_SUCC; // do nothing if there is free slot - else - return uffs_BufFlushMostDirtyGroup(dev); -} - -/** - * flush most dirty group - * \param[in] dev uffs device - */ -URET uffs_BufFlushMostDirtyGroup(struct uffs_DeviceSt *dev) -{ - int slot; - - slot = _FindMostDirtyGroup(dev); - if (slot >= 0) { - return _BufFlush(dev, U_FALSE, slot); - } - return U_SUCC; -} - -/** - * flush buffers to flash - * this will pick up a most dirty group, - * and flush it if there is no free dirty group slot. - * - * \param[in] dev uffs device - * \param[in] force_block_recover #U_TRUE: force a block recover - * even there are enough free pages - */ -URET uffs_BufFlushEx(struct uffs_DeviceSt *dev, UBOOL force_block_recover) -{ - int slot; - - slot = uffs_BufFindFreeGroupSlot(dev); - if (slot >= 0) { - return U_SUCC; //there is free slot, do nothing. - } - else { - slot = _FindMostDirtyGroup(dev); - return _BufFlush(dev, force_block_recover, slot); - } -} - -/** - * flush buffer group with given parent/serial num. - * - * \param[in] dev uffs device - * \param[in] parent parent num of the group - * \param[in] serial serial num of the group - */ -URET uffs_BufFlushGroup(struct uffs_DeviceSt *dev, u16 parent, u16 serial) -{ - int slot; - - slot = uffs_BufFindGroupSlot(dev, parent, serial); - if (slot >= 0) { - return _BufFlush(dev, U_FALSE, slot); - } - - return U_SUCC; -} - -/** - * flush buffer group with given parent/serial num - * and force_block_recover indicator. - * - * \param[in] dev uffs device - * \param[in] parent parent num of the group - * \param[in] serial serial num of group - * \param[in] force_block_recover indicator - */ -URET uffs_BufFlushGroupEx(struct uffs_DeviceSt *dev, - u16 parent, u16 serial, UBOOL force_block_recover) -{ - int slot; - - slot = uffs_BufFindGroupSlot(dev, parent, serial); - if (slot >= 0) { - return _BufFlush(dev, force_block_recover, slot); - } - - return U_SUCC; -} - - -/** - * flush buffer group/groups which match given parent num. - * - * \param[in] dev uffs device - * \param[in] parent parent num of the group - * \param[in] serial serial num of group - * \param[in] force_block_recover indicator - */ -URET uffs_BufFlushGroupMatchParent(struct uffs_DeviceSt *dev, u16 parent) -{ - int slot; - uffs_Buf *buf; - URET ret = U_SUCC; - - for (slot = 0; slot < dev->cfg.dirty_groups && ret == U_SUCC; slot++) { - if (dev->buf.dirtyGroup[slot].dirty) { - buf = dev->buf.dirtyGroup[slot].dirty; - if (buf->parent == parent) { - ret = _BufFlush(dev, U_FALSE, slot); - } - } - } - - return ret; -} - -/** - * find a free dirty group slot - * - * \param[in] dev uffs device - * \return slot index (0 to MAX_DIRTY_BUF_GROUPS - 1) if found one, - * otherwise return -1. - */ -int uffs_BufFindFreeGroupSlot(struct uffs_DeviceSt *dev) -{ - int i, slot = -1; - - for (i = 0; i < dev->cfg.dirty_groups; i++) { - if (dev->buf.dirtyGroup[i].dirty == NULL) { - slot = i; - break; - } - } - return slot; -} - -/** - * find a dirty group slot with given parent/serial num. - * - * \param[in] dev uffs device - * \param[in] parent parent num of the group - * \param[in] serial serial num of group - * \return slot index (0 to MAX_DIRTY_BUF_GROUPS - 1) if found one, - * otherwise return -1. - */ -int uffs_BufFindGroupSlot(struct uffs_DeviceSt *dev, u16 parent, u16 serial) -{ - uffs_Buf *buf; - int i, slot = -1; - - for (i = 0; i < dev->cfg.dirty_groups; i++) { - if (dev->buf.dirtyGroup[i].dirty) { - buf = dev->buf.dirtyGroup[i].dirty; - if (buf->parent == parent && buf->serial == serial) { - slot = i; - break; - } - } - } - return slot; -} - -/** - * \brief get a page buffer - * \param[in] dev uffs device - * \param[in] parent parent serial num - * \param[in] serial serial num - * \param[in] page_id page_id - * \return return the buffer found in buffer list, if not found, return NULL. - */ -uffs_Buf * uffs_BufGet(struct uffs_DeviceSt *dev, - u16 parent, u16 serial, u16 page_id) -{ - uffs_Buf *p; - - //first, check whether the buffer exist in buf list ? - p = uffs_BufFind(dev, parent, serial, page_id); - - if (p) { - p->ref_count++; - _MoveNodeToHead(dev, p); - } - - return p; -} - -/** - * New generate a buffer - */ -uffs_Buf *uffs_BufNew(struct uffs_DeviceSt *dev, - u8 type, u16 parent, u16 serial, u16 page_id) -{ - uffs_Buf *buf; - - buf = uffs_BufGet(dev, parent, serial, page_id); - if (buf) { - if (buf->ref_count > 1) { - uffs_Perror(UFFS_MSG_SERIOUS, "When create new buf, \ - an exist buffer has ref count %d, possibly bug!", - buf->ref_count); - } - else { - buf->data_len = 0; - } - _MoveNodeToHead(dev, buf); - return buf; - } - - buf = _FindFreeBuf(dev); - if (buf == NULL) { - uffs_BufFlushMostDirtyGroup(dev); - buf = _FindFreeBuf(dev); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "no free page buf!"); - return NULL; - } - } - - buf->mark = UFFS_BUF_EMPTY; - buf->type = type; - buf->parent = parent; - buf->serial = serial; - buf->page_id = page_id; - buf->data_len = 0; - buf->ref_count++; - memset(buf->data, 0xff, dev->com.pg_data_size); - - _MoveNodeToHead(dev, buf); - - return buf; -} - - - -/** - * get a page buffer - * \param[in] dev uffs device - * \param[in] type dir, file or data ? - * \param[in] node node on the tree - * \param[in] page_id page_id - * \param[in] oflag the open flag of current file/dir object - * \return return the buffer if found in buffer list, if not found in - * buffer list, it will get a free buffer, and load data from flash. - * return NULL if not free buffer. - */ -uffs_Buf *uffs_BufGetEx(struct uffs_DeviceSt *dev, - u8 type, TreeNode *node, u16 page_id, int oflag) -{ - uffs_Buf *buf; - u16 parent, serial, block, page; - uffs_BlockInfo *bc; - - switch (type) { - case UFFS_TYPE_DIR: - parent = node->u.dir.parent; - serial = node->u.dir.serial; - block = node->u.dir.block; - break; - case UFFS_TYPE_FILE: - parent = node->u.file.parent; - serial = node->u.file.serial; - block = node->u.file.block; - break; - case UFFS_TYPE_DATA: - parent = node->u.data.parent; - serial = node->u.data.serial; - block = node->u.data.block; - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "unknown type"); - return NULL; - } - - buf = uffs_BufFind(dev, parent, serial, page_id); - if (buf) { - buf->ref_count++; - return buf; - } - - buf = _FindFreeBuf(dev); - if (buf == NULL) { - uffs_BufFlushMostDirtyGroup(dev); - buf = _FindFreeBuf(dev); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "no free page buf!"); - return NULL; - } - - /* Note: if uffs_BufFlushMostDirtyGroup() flush the same block as we'll write to, - * the block will be changed to a new one! (and the content of 'node' is changed). - * So here we need to update block number from the new 'node'. - */ - switch (type) { - case UFFS_TYPE_DIR: - block = node->u.dir.block; - break; - case UFFS_TYPE_FILE: - block = node->u.file.block; - break; - case UFFS_TYPE_DATA: - block = node->u.data.block; - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "unknown type"); - return NULL; - } - } - - bc = uffs_BlockInfoGet(dev, block); - if (bc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Can't get block info!"); - return NULL; - } - - page = uffs_FindPageInBlockWithPageId(dev, bc, page_id); - if (page == UFFS_INVALID_PAGE) { - uffs_BlockInfoPut(dev, bc); - uffs_Perror(UFFS_MSG_SERIOUS, "can't find right page ? block %d page_id %d", bc->block, page_id); - return NULL; - } - page = uffs_FindBestPageInBlock(dev, bc, page); - if (!uffs_Assert(page != UFFS_INVALID_PAGE, "got an invalid page?\n")) - return NULL; - - uffs_BlockInfoPut(dev, bc); - - buf->mark = UFFS_BUF_EMPTY; - buf->type = type; - buf->parent = parent; - buf->serial = serial; - buf->page_id = page_id; - - if (UFFS_FLASH_HAVE_ERR(uffs_FlashReadPage(dev, block, page, buf, oflag & UO_NOECC ? U_TRUE : U_FALSE))) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't load page from flash !"); - return NULL; - } - - buf->data_len = TAG_DATA_LEN(GET_TAG(bc, page)); - buf->mark = UFFS_BUF_VALID; - buf->ref_count++; - - _MoveNodeToHead(dev, buf); - - return buf; - -} - -/** - * \brief Put back a page buffer, make reference count decrease by one - * \param[in] dev uffs device - * \param[in] buf buffer to be put back - */ -URET uffs_BufPut(uffs_Device *dev, uffs_Buf *buf) -{ - URET ret = U_FAIL; - - dev = dev; - if (buf == NULL) { - uffs_Perror(UFFS_MSG_NORMAL, "Can't put an NULL buffer!"); - } - else if (buf->ref_count == 0) { - uffs_Perror(UFFS_MSG_NORMAL, "Putting an unused page buffer ? "); - } - else if (buf->ref_count == CLONE_BUF_MARK) { - uffs_Perror(UFFS_MSG_NORMAL, "Putting an cloned page buffer ? "); - ret = uffs_BufFreeClone(dev, buf); - } - else { - buf->ref_count--; - ret = U_SUCC; - } - - return ret; -} - - -/** - * \brief clone from an exist buffer. - allocate memory for new buffer, and copy data from original buffer if - original buffer is not NULL. - * \param[in] dev uffs device - * \param[in] buf page buffer to be clone from. - * if NULL presented here, data copy will not be processed - * \return return the cloned page buffer, all data copied from source - * \note the cloned buffer is not linked in page buffer list in uffs device, - * so you should use #uffs_BufFreeClone instead of #uffs_BufPut - * when you put back or release buffer - */ -uffs_Buf * uffs_BufClone(uffs_Device *dev, uffs_Buf *buf) -{ - uffs_Buf *p; - - p = _FindFreeBufEx(dev, 1); - if (p == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "no enough free pages for clone! " \ - "Please increase Clone Buffer Count threshold."); - } - else { - _BreakFromBufList(dev, p); - - if (buf) { - p->parent = buf->parent; - p->type = buf->type; - p->serial = buf->serial; - p->page_id = buf->page_id; - - p->data_len = buf->data_len; - //athough the valid data length is .data_len, - //but we still need copy the whole buffer, include header - memcpy(p->header, buf->header, dev->com.pg_size); - } - p->next = p->prev = NULL; // the cloned one is not linked to device buffer - p->next_dirty = p->prev_dirty = NULL; - p->ref_count = CLONE_BUF_MARK; // CLONE_BUF_MARK indicates that - // this is an cloned buffer - } - - return p; -} - -/** - * \brief release cloned buffer - * \param[in] dev uffs device - * \param[in] buf cloned buffer - */ -URET uffs_BufFreeClone(uffs_Device *dev, uffs_Buf *buf) -{ - dev = dev; //make compiler happy - if (!buf) - return U_FAIL; - - if (buf->ref_count != CLONE_BUF_MARK) { - /* a cloned buffer must have a ref_count of CLONE_BUF_MARK */ - uffs_Perror(UFFS_MSG_SERIOUS, - "Try to release a non-cloned page buffer ?"); - return U_FAIL; - } - - buf->ref_count = 0; - buf->mark = UFFS_BUF_EMPTY; - _LinkToBufListTail(dev, buf); - - return U_SUCC; -} - - - -UBOOL uffs_BufIsAllFree(struct uffs_DeviceSt *dev) -{ - uffs_Buf *buf = dev->buf.head; - - while (buf) { - if(buf->ref_count != 0) return U_FALSE; - buf = buf->next; - } - - return U_TRUE; -} - -UBOOL uffs_BufIsAllEmpty(struct uffs_DeviceSt *dev) -{ - uffs_Buf *buf = dev->buf.head; - - while (buf) { - if(buf->mark != UFFS_BUF_EMPTY) return U_FALSE; - buf = buf->next; - } - - return U_TRUE; -} - - -URET uffs_BufSetAllEmpty(struct uffs_DeviceSt *dev) -{ - uffs_Buf *buf = dev->buf.head; - - while (buf) { - buf->mark = UFFS_BUF_EMPTY; - buf = buf->next; - } - return U_SUCC; -} - - -void uffs_BufIncRef(uffs_Buf *buf) -{ - buf->ref_count++; -} - -void uffs_BufDecRef(uffs_Buf *buf) -{ - if (buf->ref_count > 0) - buf->ref_count--; -} - -/** mark buffer as #UFFS_BUF_EMPTY if ref_count == 0, - and discard all data it holds */ -void uffs_BufMarkEmpty(uffs_Device *dev, uffs_Buf *buf) -{ - if (buf->mark != UFFS_BUF_EMPTY) { - if (buf->ref_count == 0) { - if (buf->mark == UFFS_BUF_DIRTY) - _BreakFromDirty(dev, buf); - buf->mark = UFFS_BUF_EMPTY; - } - } -} - -#if 0 -static UBOOL _IsBufInDirtyList(struct uffs_DeviceSt *dev, uffs_Buf *buf) -{ - uffs_Buf *p = dev->buf.dirtyGroup[slot].dirty; - - while (p) { - if(p == buf) return U_TRUE; - p = p->next_dirty; - } - - return U_FALSE; -} -#endif - -URET uffs_BufWrite(struct uffs_DeviceSt *dev, - uffs_Buf *buf, void *data, u32 ofs, u32 len) -{ - int slot; - - if(ofs + len > dev->com.pg_data_size) { - uffs_Perror(UFFS_MSG_SERIOUS, - "data length out of range! %d+%d", ofs, len); - return U_FAIL; - } - - slot = uffs_BufFindGroupSlot(dev, buf->parent, buf->serial); - - if (slot < 0) { - // need to take a free slot - slot = uffs_BufFindFreeGroupSlot(dev); - if (slot < 0) { - // no free slot ? flush buffer - if (uffs_BufFlushMostDirtyGroup(dev) != U_SUCC) - return U_FAIL; - - slot = uffs_BufFindFreeGroupSlot(dev); - if (slot < 0) { - // still no free slot ?? - uffs_Perror(UFFS_MSG_SERIOUS, "no free slot ?"); - return U_FAIL; - } - } - } - - if (data) - memcpy(buf->data + ofs, data, len); - else - memset(buf->data + ofs, 0, len); // if data == NULL, then fill all '\0'. - - if (ofs + len > buf->data_len) - buf->data_len = ofs + len; - - if (_IsBufInInDirtyList(dev, slot, buf) == U_FALSE) { - _LinkToDirtyList(dev, slot, buf); - } - - if (dev->buf.dirtyGroup[slot].count >= dev->buf.dirty_buf_max) { - if (uffs_BufFlushGroup(dev, buf->parent, buf->serial) != U_SUCC) { - return U_FAIL; - } - } - - return U_SUCC; -} - -URET uffs_BufRead(struct uffs_DeviceSt *dev, - uffs_Buf *buf, void *data, u32 ofs, u32 len) -{ - u32 readSize; - u32 pg_data_size = dev->com.pg_data_size; - - readSize = (ofs >= pg_data_size ? - 0 : (ofs + len >= pg_data_size ? pg_data_size - ofs : len) - ); - - if (readSize > 0) - memcpy(data, buf->data + ofs, readSize); - - return U_SUCC; -} - - - - - - - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_crc.c b/components/dfs/filesystems/uffs/src/uffs/uffs_crc.c deleted file mode 100644 index 0ef95bf7f1..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_crc.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ -/** - * \file uffs_crc.c - * \brief simple CRC functions - * \author Ricky Zheng - * \note Created in 23 Nov, 2011 - */ - -#include "uffs/uffs_crc.h" - -/* CRC16 Table */ -static const u16 CRC16_TBL[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 -}; - -#define CRC16(v, x) v = ((v) >> 8) ^ CRC16_TBL[((v) ^ (x)) & 0x00ff] - -u16 uffs_crc16update(const void *data, int length, u16 crc) -{ - int i; - const u8 *p = (const u8 *)data; - for (i = 0; i < length; i++, p++) { - CRC16(crc, *p); - } - - return crc; -} - -u16 uffs_crc16sum(const void *data, int length) -{ - return uffs_crc16update(data, length, 0xFFFF); -} diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_debug.c b/components/dfs/filesystems/uffs/src/uffs/uffs_debug.c deleted file mode 100644 index 5f6c1558e4..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_debug.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_debug.c - * \brief output debug messages - * \author Ricky Zheng, created 10th May, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" - -#if !defined(RT_THREAD) -#include -#include -#include - -#define MAX_DEBUG_MSG_LINE_LENGTH 128 - -static struct uffs_DebugMsgOutputSt * m_ops = NULL; -static int m_msg_level = UFFS_MSG_NORMAL; - -static void uffs_vprintf(const char *fmt, va_list args) -{ - char line_buf[MAX_DEBUG_MSG_LINE_LENGTH]; - - if (m_ops && m_ops->output) { -#ifdef _COMPILER_CLIB_DO_NOT_HAVE_VSNPRINTF_ - vsprintf(line_buf, fmt, args); -#else - vsnprintf(line_buf, MAX_DEBUG_MSG_LINE_LENGTH, fmt, args); -#endif - m_ops->output(line_buf); - } -} - -/** - * \brief Initialize debug message output functions - */ -URET uffs_InitDebugMessageOutput(struct uffs_DebugMsgOutputSt *ops, int msg_level) -{ - m_ops = ops; - - if (m_ops == NULL || m_ops->output == NULL) { - m_ops = NULL; - return U_FAIL; - } - else if (m_ops->vprintf == NULL) - m_ops->vprintf = uffs_vprintf; - - m_msg_level = msg_level; - - return U_SUCC; -} - -void uffs_DebugSetMessageLevel(int msg_level) -{ - m_msg_level = msg_level; -} -#endif - -#ifdef CONFIG_ENABLE_UFFS_DEBUG_MSG - -/** - * \brief The main debug message output function - */ -#if !defined(RT_THREAD) -void uffs_DebugMessage(int level, const char *prefix, - const char *suffix, const char *errFmt, ...) -{ - va_list arg; - - if (m_ops && level >= m_msg_level) { - if (prefix) - m_ops->output(prefix); - - va_start(arg, errFmt); - m_ops->vprintf(errFmt, arg); - va_end(arg); - - if (suffix) - m_ops->output(suffix); - } -} - -/** - * \brief Called when an assert occurred. - * This method is called when an assert occurred and should stop the - * application from running, as this there is a severe error condition. - * \param[in] file Source filename - * \param[in] line Source line of code - * \param[in] msg Assert message - */ -void uffs_AssertCall(const char *file, int line, const char *msg, ...) -{ - va_list args; - char buf[32]; - - if (m_ops && m_msg_level < UFFS_MSG_NOMSG) { - m_ops->output("ASSERT "); - m_ops->output(file); - sprintf(buf, ":%d - :", line); - m_ops->output(buf); - va_start(args, msg); - m_ops->vprintf(msg, args); - va_end(args); - m_ops->output(TENDSTR); - } -} -#endif - -#ifdef _COMPILER_DO_NOT_SUPPORT_MACRO_VALIST_REPLACE_ -void uffs_Perror(int level, const char *fmt, ...) -{ - va_list args; - if (m_ops && level >= m_msg_level) { - va_start(args, fmt); - m_ops->vprintf(fmt, args); - va_end(args); - m_ops->output(TENDSTR); - } -} - -void uffs_PerrorRaw(int level, const char *fmt, ...) -{ - va_list args; - if (m_ops && level >= m_msg_level) { - va_start(args, fmt); - m_ops->vprintf(fmt, args); - va_end(args); - } -} - -UBOOL uffs_Assert(UBOOL expr, const char *fmt, ...) -{ - va_list args; - if (m_ops && !expr && m_msg_level < UFFS_MSG_NOMSG) { - m_ops->output("ASSERT FAILED: "); - va_start(args, fmt); - m_ops->vprintf(fmt, args); - va_end(args); - m_ops->output(TENDSTR); - } - return expr ? U_TRUE : U_FALSE; -} -#endif - -#else - -void uffs_DebugMessage(int level, const char *prefix, const char *suffix, const char *errFmt, ...) {}; -void uffs_AssertCall(const char *file, int line, const char *msg, ...) {}; - -#ifdef _COMPILER_DO_NOT_SUPPORT_MACRO_VALIST_REPLACE_ -void uffs_Perror(int level, const char *fmt, ...) {} -void uffs_PerrorRaw(int level, const char *fmt, ...) {} -UBOOL uffs_Assert(UBOOL expr, const char *fmt, ...) { return expr ? U_TRUE : U_FALSE; } -#endif - -#endif diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_device.c b/components/dfs/filesystems/uffs/src/uffs/uffs_device.c deleted file mode 100644 index 7b6a14de81..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_device.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_device.c - * \brief uffs device operation - * \author Ricky Zheng, created 10th May, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_mtb.h" -#include - -#define PFX "dev : " - - -#ifdef CONFIG_USE_PER_DEVICE_LOCK -void uffs_DeviceInitLock(uffs_Device *dev) -{ - uffs_SemCreate(&dev->lock.sem); - dev->lock.task_id = UFFS_TASK_ID_NOT_EXIST; - dev->lock.counter = 0; -} - -void uffs_DeviceReleaseLock(uffs_Device *dev) -{ - uffs_SemDelete(&dev->lock.sem); -} - -void uffs_DeviceLock(uffs_Device *dev) -{ - uffs_SemWait(dev->lock.sem); - - if (dev->lock.counter != 0) { - uffs_Perror(UFFS_MSG_NORMAL, - "Lock device, counter %d NOT zero?!", dev->lock.counter); - } - - dev->lock.counter++; -} - -void uffs_DeviceUnLock(uffs_Device *dev) -{ - dev->lock.counter--; - - if (dev->lock.counter != 0) { - uffs_Perror(UFFS_MSG_NORMAL, - "Unlock device, counter %d NOT zero?!", dev->lock.counter); - } - - uffs_SemSignal(dev->lock.sem); -} - -#else - -/* dummy stubs */ -void uffs_DeviceInitLock(uffs_Device *dev) {} -void uffs_DeviceReleaseLock(uffs_Device *dev) {} -void uffs_DeviceLock(uffs_Device *dev) {} -void uffs_DeviceUnLock(uffs_Device *dev) {} - -#endif diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_ecc.c b/components/dfs/filesystems/uffs/src/uffs/uffs_ecc.c deleted file mode 100644 index 3d10c2d3f0..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_ecc.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_ecc.c - * \brief ecc maker and correct - * \author Ricky Zheng, created in 12th Jun, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_fs.h" -#include - -#define PFX "ecc : " - -static const u8 bits_tbl[256] = { - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, -}; - -static const u8 line_parity_tbl[16] = { - 0x00, 0x02, 0x08, 0x0a, 0x20, 0x22, 0x28, 0x2a, - 0x80, 0x82, 0x88, 0x8a, 0xa0, 0xa2, 0xa8, 0xaa -}; - -static const u8 line_parity_prime_tbl[16] = { - 0x00, 0x01, 0x04, 0x05, 0x10, 0x11, 0x14, 0x15, - 0x40, 0x41, 0x44, 0x45, 0x50, 0x51, 0x54, 0x55 -}; - -static const u8 column_parity_tbl[256] = { - 0x00, 0x55, 0x59, 0x0c, 0x65, 0x30, 0x3c, 0x69, - 0x69, 0x3c, 0x30, 0x65, 0x0c, 0x59, 0x55, 0x00, - 0x95, 0xc0, 0xcc, 0x99, 0xf0, 0xa5, 0xa9, 0xfc, - 0xfc, 0xa9, 0xa5, 0xf0, 0x99, 0xcc, 0xc0, 0x95, - 0x99, 0xcc, 0xc0, 0x95, 0xfc, 0xa9, 0xa5, 0xf0, - 0xf0, 0xa5, 0xa9, 0xfc, 0x95, 0xc0, 0xcc, 0x99, - 0x0c, 0x59, 0x55, 0x00, 0x69, 0x3c, 0x30, 0x65, - 0x65, 0x30, 0x3c, 0x69, 0x00, 0x55, 0x59, 0x0c, - 0xa5, 0xf0, 0xfc, 0xa9, 0xc0, 0x95, 0x99, 0xcc, - 0xcc, 0x99, 0x95, 0xc0, 0xa9, 0xfc, 0xf0, 0xa5, - 0x30, 0x65, 0x69, 0x3c, 0x55, 0x00, 0x0c, 0x59, - 0x59, 0x0c, 0x00, 0x55, 0x3c, 0x69, 0x65, 0x30, - 0x3c, 0x69, 0x65, 0x30, 0x59, 0x0c, 0x00, 0x55, - 0x55, 0x00, 0x0c, 0x59, 0x30, 0x65, 0x69, 0x3c, - 0xa9, 0xfc, 0xf0, 0xa5, 0xcc, 0x99, 0x95, 0xc0, - 0xc0, 0x95, 0x99, 0xcc, 0xa5, 0xf0, 0xfc, 0xa9, - 0xa9, 0xfc, 0xf0, 0xa5, 0xcc, 0x99, 0x95, 0xc0, - 0xc0, 0x95, 0x99, 0xcc, 0xa5, 0xf0, 0xfc, 0xa9, - 0x3c, 0x69, 0x65, 0x30, 0x59, 0x0c, 0x00, 0x55, - 0x55, 0x00, 0x0c, 0x59, 0x30, 0x65, 0x69, 0x3c, - 0x30, 0x65, 0x69, 0x3c, 0x55, 0x00, 0x0c, 0x59, - 0x59, 0x0c, 0x00, 0x55, 0x3c, 0x69, 0x65, 0x30, - 0xa5, 0xf0, 0xfc, 0xa9, 0xc0, 0x95, 0x99, 0xcc, - 0xcc, 0x99, 0x95, 0xc0, 0xa9, 0xfc, 0xf0, 0xa5, - 0x0c, 0x59, 0x55, 0x00, 0x69, 0x3c, 0x30, 0x65, - 0x65, 0x30, 0x3c, 0x69, 0x00, 0x55, 0x59, 0x0c, - 0x99, 0xcc, 0xc0, 0x95, 0xfc, 0xa9, 0xa5, 0xf0, - 0xf0, 0xa5, 0xa9, 0xfc, 0x95, 0xc0, 0xcc, 0x99, - 0x95, 0xc0, 0xcc, 0x99, 0xf0, 0xa5, 0xa9, 0xfc, - 0xfc, 0xa9, 0xa5, 0xf0, 0x99, 0xcc, 0xc0, 0x95, - 0x00, 0x55, 0x59, 0x0c, 0x65, 0x30, 0x3c, 0x69, - 0x69, 0x3c, 0x30, 0x65, 0x0c, 0x59, 0x55, 0x00, -}; - -/** - * calculate 3 bytes ECC for 256 bytes data. - * - * \param[in] data input data - * \param[out] ecc output ecc - * \param[in] length of data in bytes - */ -static void uffs_EccMakeChunk256(const void *data, void *ecc, u16 len) -{ - u8 *pecc = (u8 *)ecc; - const u8 *p = (const u8 *)data; - u8 b, col_parity = 0, line_parity = 0, line_parity_prime = 0; - u16 i; - - for (i = 0; i < len; i++) { - b = column_parity_tbl[*p++]; - col_parity ^= b; - if (b & 0x01) { // odd number of bits in the byte - line_parity ^= i; - line_parity_prime ^= ~i; - } - } - - // ECC layout: - // Byte[0] P64 | P64' | P32 | P32' | P16 | P16' | P8 | P8' - // Byte[1] P1024 | P1024' | P512 | P512' | P256 | P256' | P128 | P128' - // Byte[2] P4 | P4' | P2 | P2' | P1 | P1' | 1 | 1 - pecc[0] = ~(line_parity_tbl[line_parity & 0xf] | - line_parity_prime_tbl[line_parity_prime & 0xf]); - pecc[1] = ~(line_parity_tbl[line_parity >> 4] | - line_parity_prime_tbl[line_parity_prime >> 4]); - pecc[2] = (~col_parity) | 0x03; - -} - - -/** - * calculate ECC. (3 bytes ECC per 256 data) - * - * \param[in] data input data - * \param[in] data_len length of data in byte - * \param[out] ecc output ecc - * - * \return length of ECC in byte. (3 bytes ECC per 256 data) - */ -int uffs_EccMake(const void *data, int data_len, void *ecc) -{ - const u8 *p_data = (const u8 *)data; - u8 *p_ecc = (u8 *)ecc; - int len; - - if (data == NULL || ecc == NULL) - return 0; - - while (data_len > 0) { - len = data_len > 256 ? 256 : data_len; - uffs_EccMakeChunk256(p_data, p_ecc, len); - data_len -= len; - p_data += len; - p_ecc += 3; - } - - return p_ecc - (u8 *)ecc; -} - -/** - * perform ECC error correct for 256 bytes data chunk. - * - * \param[in|out] data input data to be corrected - * \param[in] read_ecc 3 bytes ECC read from storage - * \param[in] test_ecc 3 bytes ECC calculated from data - * \param[in] errtop top position of error - * - * \return: 0 -- no error - * -1 -- can not be corrected - * >0 -- how many bits corrected - */ -static int uffs_EccCorrectChunk256(void *data, void *read_ecc, - const void *test_ecc, int errtop) -{ - u8 d0, d1, d2; /* deltas */ - u8 *p = (u8 *)data; - u8 *pread_ecc = (u8 *)read_ecc, *ptest_ecc = (u8 *)test_ecc; - - d0 = pread_ecc[0] ^ ptest_ecc[0]; - d1 = pread_ecc[1] ^ ptest_ecc[1]; - d2 = pread_ecc[2] ^ ptest_ecc[2]; - - if ((d0 | d1 | d2) == 0) - return 0; - - if( ((d0 ^ (d0 >> 1)) & 0x55) == 0x55 && - ((d1 ^ (d1 >> 1)) & 0x55) == 0x55 && - ((d2 ^ (d2 >> 1)) & 0x54) == 0x54) - { - // Single bit (recoverable) error in data - - u8 b; - u8 bit; - - bit = b = 0; - - if(d1 & 0x80) b |= 0x80; - if(d1 & 0x20) b |= 0x40; - if(d1 & 0x08) b |= 0x20; - if(d1 & 0x02) b |= 0x10; - if(d0 & 0x80) b |= 0x08; - if(d0 & 0x20) b |= 0x04; - if(d0 & 0x08) b |= 0x02; - if(d0 & 0x02) b |= 0x01; - - if(d2 & 0x80) bit |= 0x04; - if(d2 & 0x20) bit |= 0x02; - if(d2 & 0x08) bit |= 0x01; - - if (b >= errtop) return -1; - - p[b] ^= (1 << bit); - - return 1; - } - - if ((bits_tbl[d0] + bits_tbl[d1] + bits_tbl[d2]) == 1) { - // error in ecc, no action need - return 1; - } - - // Unrecoverable error - return -1; -} - -/** - * perform ECC error correct - * - * \param[in|out] data input data to be corrected - * \param[in] data_len length of data in byte - * \param[in] read_ecc ECC read from storage - * \param[in] test_ecc ECC calculated from data - * - * \return: 0 -- no error - * -1 -- can not be corrected - * >0 -- how many bits corrected - */ - -int uffs_EccCorrect(void *data, int data_len, - void *read_ecc, const void *test_ecc) -{ - u8 *p_data = (u8 *)data; - u8 *p_read_ecc = (u8 *)read_ecc; - u8 *p_test_ecc = (u8 *)test_ecc; - int total = 0, ret, len; - - if (data == NULL || read_ecc == NULL || test_ecc == NULL) - return -1; - - while (data_len > 0) { - len = (data_len > 256 ? 256 : data_len); - ret = uffs_EccCorrectChunk256(p_data, p_read_ecc, p_test_ecc, len); - if (ret < 0) { - total = ret; - break; - } - else - total += ret; - - p_data += len; - p_read_ecc += 3; - p_test_ecc += 3; - data_len -= len; - } - - return total; - -} - -/** - * generate 12 bit ecc for 8 bytes data. - * (use 0xFF padding if the data length is less then 8 bytes) - * - * \param[in] data input data - * \param[in] data_len length of data in byte - * - * \return 12 bits ECC data (lower 12 bits). - */ -u16 uffs_EccMake8(void *data, int data_len) -{ - u8 *p = (u8 *)data; - u8 b, col_parity = 0, line_parity = 0, line_parity_prime = 0; - u8 i; - u16 ecc = 0; - - - data_len = (data_len > 8 ? 8 : data_len); - - for (i = 0; i < data_len; i++) { - b = column_parity_tbl[*p++]; - col_parity ^= b; - if (b & 0x01) { // odd number of bits in the byte - line_parity ^= i; - line_parity_prime ^= ~i; - } - } - - // ECC layout: - // row: (1) | (1) | P32 | P32' | P16 | P16' | P8 | P8' - // column: P4 | P4' | P2 | P2' | P1 | P1' | (1) | (1) - // 12-bit ecc: P32 | P32' | P16 | P16' | P8 | P8' | P4 | P4' | P2 | P2' | P1 | P1' | - ecc = (~( - line_parity_tbl[line_parity & 0xf] | - line_parity_prime_tbl[line_parity_prime & 0xf] - )) << 6; - ecc |= (((~col_parity) >> 2) & 0x3f); - - return ecc & 0xfff; -} - -/** - * correct 8 bytes data from 12 bits ECC - * - * \param[in|out] data input data - * \param[in] read_ecc ecc read from storage - * \param[in] test_ecc ecc calculated from data - * \param[in] errtop top position of error. - * - * \return: 0 -- no error - * -1 -- can not be corrected - * >0 -- how many bits corrected - */ -int uffs_EccCorrect8(void *data, u16 read_ecc, u16 test_ecc, int errtop) -{ - u8 d0, d1; /* deltas */ - u8 *p = (u8 *)data; - - read_ecc &= 0xfff; - test_ecc &= 0xfff; - - d0 = (read_ecc >> 6) ^ (test_ecc >> 6); - d1 = (read_ecc & 0x3f) ^ (test_ecc & 0x3f); - - if ((d0 | d1) == 0) - return 0; - - if( ((d0 ^ (d0 >> 1)) & 0x15) == 0x15 && - ((d1 ^ (d1 >> 1)) & 0x15) == 0x15) - { - // Single bit (recoverable) error in data - - u8 b; - u8 bit; - - bit = b = 0; - - if(d0 & 0x20) b |= 0x04; - if(d0 & 0x08) b |= 0x02; - if(d0 & 0x02) b |= 0x01; - - if(d1 & 0x20) bit |= 0x04; - if(d1 & 0x08) bit |= 0x02; - if(d1 & 0x02) bit |= 0x01; - - if (b >= (u8)errtop) return -1; - if (bit >= 8) return -1; - - p[b] ^= (1 << bit); - - return 1; - } - - if ((bits_tbl[d0] + bits_tbl[d1]) == 1) { - // error in ecc, no action need - return 1; - } - - // Unrecoverable error - return -1; -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_fd.c b/components/dfs/filesystems/uffs/src/uffs/uffs_fd.c deleted file mode 100644 index bbc1bb880d..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_fd.c +++ /dev/null @@ -1,746 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fd.c - * \brief POSIX like, hight level file operations - * \author Ricky Zheng, created 8th Jun, 2005 - */ - -#include -#include "uffs_config.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_fd.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_version.h" -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_find.h" - -#define PFX "fd : " - -/** - * \brief POSIX DIR - */ -struct uffs_dirSt { - struct uffs_ObjectSt *obj; /* dir object */ - struct uffs_FindInfoSt f; /* find info */ - struct uffs_ObjectInfoSt info; /* object info */ - struct uffs_dirent dirent; /* dir entry */ -}; - - -#define FD_OFFSET 3 //!< just make file handler more like POSIX (0, 1, 2 for stdin/stdout/stderr) - -#define OBJ2FD(obj) \ - ( \ - ( \ - uffs_PoolGetIndex(uffs_GetObjectPool(), obj) | \ - (_fd_signature << FD_SIGNATURE_SHIFT) \ - ) \ - + FD_OFFSET \ - ) - -/** - * check #fd signature, convert #fd to #obj - * if success, hold global file system lock, otherwise return with #ret - */ -#define CHK_OBJ_LOCK(fd, obj, ret) \ - do { \ - uffs_GlobalFsLockLock(); \ - fd -= FD_OFFSET; \ - if ( (fd >> FD_SIGNATURE_SHIFT) != _fd_signature ) { \ - uffs_set_error(-UEBADF); \ - uffs_Perror(UFFS_MSG_NOISY, "invalid fd: %d (sig: %d, expect: %d)", \ - fd + FD_OFFSET, fd >> FD_SIGNATURE_SHIFT, _fd_signature); \ - uffs_GlobalFsLockUnlock(); \ - return (ret); \ - } \ - fd = fd & ((1 << FD_SIGNATURE_SHIFT) - 1); \ - obj = (uffs_Object *)uffs_PoolGetBufByIndex(uffs_GetObjectPool(), fd); \ - if ((obj) == NULL || \ - uffs_PoolVerify(uffs_GetObjectPool(), (obj)) == U_FALSE || \ - uffs_PoolCheckFreeList(uffs_GetObjectPool(), (obj)) == U_TRUE) { \ - uffs_set_error(-UEBADF); \ - uffs_Perror(UFFS_MSG_NOISY, "invalid obj"); \ - uffs_GlobalFsLockUnlock(); \ - return (ret); \ - } \ - } while(0) - -/** - * check #dirp signature, - * if success, hold global file system lock, - * otherwise return with #ret - */ -#define CHK_DIR_LOCK(dirp, ret) \ - do { \ - uffs_GlobalFsLockLock(); \ - if ((dirp) == NULL || \ - uffs_PoolVerify(&_dir_pool, (dirp)) == U_FALSE || \ - uffs_PoolCheckFreeList(&_dir_pool, (dirp)) == U_TRUE) { \ - uffs_set_error(-UEBADF); \ - uffs_Perror(UFFS_MSG_NOISY, "invalid dirp"); \ - uffs_GlobalFsLockUnlock(); \ - return (ret); \ - } \ - } while(0) - -/** - * check #dirp signature, - * if success, hold global file system lock, - * otherwise return void - */ -#define CHK_DIR_VOID_LOCK(dirp) \ - do { \ - uffs_GlobalFsLockLock(); \ - if ((dirp) == NULL || \ - uffs_PoolVerify(&_dir_pool, (dirp)) == U_FALSE || \ - uffs_PoolCheckFreeList(&_dir_pool, (dirp)) == U_TRUE) { \ - uffs_set_error(-UEBADF); \ - uffs_Perror(UFFS_MSG_NOISY, "invalid dirp"); \ - uffs_GlobalFsLockUnlock(); \ - return; \ - } \ - } while(0) - - -static int _dir_pool_data[sizeof(uffs_DIR) * MAX_DIR_HANDLE / sizeof(int)]; -static uffs_Pool _dir_pool; -static int _uffs_errno = 0; - - -// -// What is fd signature ? fd signature is for detecting file system get formated by other party. -// A thread open a file, read()...sleep()...write()...sleep()... -// B thread format UFFS partition, increase fd signature. -// A thread ...sleep()...read() --> Opps, fd signature changed ! read() return error(expected). -// -#define MAX_FD_SIGNATURE_ROUND (100) -static int _fd_signature = 0; - -// -// only get called when formating UFFS partition -// -void uffs_FdSignatureIncrease(void) -{ - if (_fd_signature++ > MAX_FD_SIGNATURE_ROUND) - _fd_signature = 0; -} - -/** - * initialise uffs_DIR buffers, called by UFFS internal - */ -URET uffs_DirEntryBufInit(void) -{ - return uffs_PoolInit(&_dir_pool, _dir_pool_data, - sizeof(_dir_pool_data), - sizeof(uffs_DIR), MAX_DIR_HANDLE); -} - -/** - * Release uffs_DIR buffers, called by UFFS internal - */ -URET uffs_DirEntryBufRelease(void) -{ - return uffs_PoolRelease(&_dir_pool); -} - -/** - * Put all dir entry buf match dev - */ -int uffs_DirEntryBufPutAll(uffs_Device *dev) -{ - int count = 0; - uffs_DIR *dirp = NULL; - - do { - dirp = (uffs_DIR *) uffs_PoolFindNextAllocated(&_dir_pool, dirp); - if (dirp && dirp->obj && dirp->obj->dev && - dirp->obj->dev->dev_num == dev->dev_num) { - uffs_PoolPut(&_dir_pool, dirp); - count++; - } - } while (dirp); - - return count; -} - - -uffs_Pool * uffs_DirEntryBufGetPool(void) -{ - return &_dir_pool; -} - -static uffs_DIR * GetDirEntry(void) -{ - uffs_DIR *dirp = (uffs_DIR *) uffs_PoolGet(&_dir_pool); - - if (dirp) - memset(dirp, 0, sizeof(uffs_DIR)); - - return dirp; -} - -static void PutDirEntry(uffs_DIR *p) -{ - uffs_PoolPut(&_dir_pool, p); -} - - -/** get global errno - */ -int uffs_get_error(void) -{ - return _uffs_errno; -} - -/** set global errno - */ -int uffs_set_error(int err) -{ - return (_uffs_errno = err); -} - -/* POSIX compliant file system APIs */ - -int uffs_open(const char *name, int oflag, ...) -{ - uffs_Object *obj; - int ret = 0; - - uffs_GlobalFsLockLock(); - - obj = uffs_GetObject(); - if (obj == NULL) { - uffs_set_error(-UEMFILE); - ret = -1; - } - else { - if (uffs_OpenObject(obj, name, oflag) == U_FAIL) { - uffs_set_error(-uffs_GetObjectErr(obj)); - uffs_PutObject(obj); - ret = -1; - } - else { - ret = OBJ2FD(obj); - } - } - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_close(int fd) -{ - int ret = 0; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - - uffs_ClearObjectErr(obj); - if (uffs_CloseObject(obj) == U_FAIL) { - uffs_set_error(-uffs_GetObjectErr(obj)); - ret = -1; - } - else { - uffs_PutObject(obj); - ret = 0; - } - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_read(int fd, void *data, int len) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = uffs_ReadObject(obj, data, len); - uffs_set_error(-uffs_GetObjectErr(obj)); - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_write(int fd, const void *data, int len) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = uffs_WriteObject(obj, data, len); - uffs_set_error(-uffs_GetObjectErr(obj)); - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -long uffs_seek(int fd, long offset, int origin) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = uffs_SeekObject(obj, offset, origin); - uffs_set_error(-uffs_GetObjectErr(obj)); - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -long uffs_tell(int fd) -{ - long ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = (long) uffs_GetCurOffset(obj); - uffs_set_error(-uffs_GetObjectErr(obj)); - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_eof(int fd) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = uffs_EndOfFile(obj); - uffs_set_error(-uffs_GetObjectErr(obj)); - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_flush(int fd) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = (uffs_FlushObject(obj) == U_SUCC) ? 0 : -1; - uffs_set_error(-uffs_GetObjectErr(obj)); - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_rename(const char *old_name, const char *new_name) -{ - int err = 0; - int ret = 0; - - uffs_GlobalFsLockLock(); - ret = (uffs_RenameObject(old_name, new_name, &err) == U_SUCC) ? 0 : -1; - uffs_set_error(-err); - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_remove(const char *name) -{ - int err = 0; - int ret = 0; - struct uffs_stat st; - - if (uffs_stat(name, &st) < 0) { - err = UENOENT; - ret = -1; - } - else if (st.st_mode & US_IFDIR) { - err = UEISDIR; - ret = -1; - } - else { - uffs_GlobalFsLockLock(); - if (uffs_DeleteObject(name, &err) == U_SUCC) { - ret = 0; - } - else { - ret = -1; - } - uffs_GlobalFsLockUnlock(); - } - - uffs_set_error(-err); - return ret; -} - -int uffs_ftruncate(int fd, long remain) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - uffs_ClearObjectErr(obj); - ret = (uffs_TruncateObject(obj, remain) == U_SUCC) ? 0 : -1; - uffs_set_error(-uffs_GetObjectErr(obj)); - uffs_GlobalFsLockUnlock(); - - return ret; -} - -static int do_stat(uffs_Object *obj, struct uffs_stat *buf) -{ - uffs_ObjectInfo info; - int ret = 0; - int err = 0; - - if (uffs_GetObjectInfo(obj, &info, &err) == U_FAIL) { - ret = -1; - } - else { - buf->st_dev = obj->dev->dev_num; - buf->st_ino = info.serial; - buf->st_nlink = 0; - buf->st_uid = 0; - buf->st_gid = 0; - buf->st_rdev = 0; - buf->st_size = info.len; - buf->st_blksize = obj->dev->com.pg_data_size; - buf->st_blocks = 0; - buf->st_atime = info.info.last_modify; - buf->st_mtime = info.info.last_modify; - buf->st_ctime = info.info.create_time; - buf->st_mode = (info.info.attr & FILE_ATTR_DIR ? US_IFDIR : US_IFREG); - if (info.info.attr & FILE_ATTR_WRITE) - buf->st_mode |= US_IRWXU; - } - - uffs_set_error(-err); - return ret; -} - -int uffs_stat(const char *name, struct uffs_stat *buf) -{ - uffs_Object *obj; - int ret = 0; - int err = 0; - URET result; - - uffs_GlobalFsLockLock(); - - obj = uffs_GetObject(); - if (obj) { - if (*name && name[strlen(name) - 1] == '/') { - result = uffs_OpenObject(obj, name, UO_RDONLY | UO_DIR); - } - else { - if ((result = uffs_OpenObject(obj, name, UO_RDONLY)) != U_SUCC) // try file - result = uffs_OpenObject(obj, name, UO_RDONLY | UO_DIR); // then try dir - } - if (result == U_SUCC) { - ret = do_stat(obj, buf); - uffs_CloseObject(obj); - } - else { - err = uffs_GetObjectErr(obj); - ret = -1; - } - uffs_PutObject(obj); - } - else { - err = UENOMEM; - ret = -1; - } - - uffs_set_error(-err); - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_lstat(const char *name, struct uffs_stat *buf) -{ - return uffs_stat(name, buf); -} - -int uffs_fstat(int fd, struct uffs_stat *buf) -{ - int ret; - uffs_Object *obj; - - CHK_OBJ_LOCK(fd, obj, -1); - - ret = do_stat(obj, buf); - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_closedir(uffs_DIR *dirp) -{ - CHK_DIR_LOCK(dirp, -1); - - uffs_FindObjectClose(&dirp->f); - if (dirp->obj) { - uffs_CloseObject(dirp->obj); - uffs_PutObject(dirp->obj); - } - PutDirEntry(dirp); - uffs_GlobalFsLockUnlock(); - - return 0; -} - -uffs_DIR * uffs_opendir(const char *path) -{ - int err = 0; - uffs_DIR *ret = NULL; - uffs_DIR *dirp; - - uffs_GlobalFsLockLock(); - - dirp = GetDirEntry(); - - if (dirp) { - dirp->obj = uffs_GetObject(); - if (dirp->obj) { - if (uffs_OpenObject(dirp->obj, path, UO_RDONLY | UO_DIR) == U_SUCC) { - if (uffs_FindObjectOpen(&dirp->f, dirp->obj) == U_SUCC) { - ret = dirp; - goto ext; - } - else { - uffs_CloseObject(dirp->obj); - } - } - else { - err = uffs_GetObjectErr(dirp->obj); - } - uffs_PutObject(dirp->obj); - dirp->obj = NULL; - } - else { - err = UEMFILE; - } - PutDirEntry(dirp); - } - else { - err = UEMFILE; - } -ext: - uffs_set_error(-err); - uffs_GlobalFsLockUnlock(); - - return ret; -} - -struct uffs_dirent * uffs_readdir(uffs_DIR *dirp) -{ - struct uffs_dirent *ent = NULL; - - CHK_DIR_LOCK(dirp, NULL); - - if (uffs_FindObjectNext(&dirp->info, &dirp->f) == U_SUCC) { - ent = &dirp->dirent; - ent->d_ino = dirp->info.serial; - ent->d_namelen = dirp->info.info.name_len < (sizeof(ent->d_name) - 1) ? dirp->info.info.name_len : (sizeof(ent->d_name) - 1); - memcpy(ent->d_name, dirp->info.info.name, ent->d_namelen); - ent->d_name[ent->d_namelen] = '\0'; - ent->d_off = dirp->f.pos; - ent->d_reclen = sizeof(struct uffs_dirent); - ent->d_type = dirp->info.info.attr; - } - uffs_GlobalFsLockUnlock(); - - return ent; -} - -void uffs_rewinddir(uffs_DIR *dirp) -{ - CHK_DIR_VOID_LOCK(dirp); - - uffs_FindObjectRewind(&dirp->f); - - uffs_GlobalFsLockUnlock(); -} - - -int uffs_mkdir(const char *name, ...) -{ - uffs_Object *obj; - int ret = 0; - int err = 0; - - uffs_GlobalFsLockLock(); - - obj = uffs_GetObject(); - if (obj) { - if (uffs_CreateObject(obj, name, UO_CREATE|UO_DIR) != U_SUCC) { - err = obj->err; - ret = -1; - } - else { - uffs_CloseObject(obj); - ret = 0; - } - uffs_PutObject(obj); - } - else { - err = UEMFILE; - ret = -1; - } - - uffs_set_error(-err); - uffs_GlobalFsLockUnlock(); - - return ret; -} - -int uffs_rmdir(const char *name) -{ - int err = 0; - int ret = 0; - struct uffs_stat st; - - if (uffs_stat(name, &st) < 0) { - err = UENOENT; - ret = -1; - } - else if ((st.st_mode & US_IFDIR) == 0) { - err = UENOTDIR; - ret = -1; - } - else { - uffs_GlobalFsLockLock(); - if (uffs_DeleteObject(name, &err) == U_SUCC) { - ret = 0; - } - else { - ret = -1; - } - uffs_GlobalFsLockUnlock(); - } - uffs_set_error(-err); - return ret; -} - -int uffs_version(void) -{ - return uffs_GetVersion(); -} - -int uffs_format(const char *mount_point) -{ - uffs_Device *dev = NULL; - URET ret = U_FAIL; - - dev = uffs_GetDeviceFromMountPoint(mount_point); - if (dev) { - uffs_GlobalFsLockLock(); - ret = uffs_FormatDevice(dev, U_TRUE); - uffs_GlobalFsLockUnlock(); - } - - return ret == U_SUCC ? 0 : -1; -} - -long uffs_space_total(const char *mount_point) -{ - uffs_Device *dev = NULL; - long ret = -1L; - - dev = uffs_GetDeviceFromMountPoint(mount_point); - if (dev) { - uffs_GlobalFsLockLock(); - ret = (long) uffs_GetDeviceTotal(dev); - uffs_GlobalFsLockUnlock(); - } - - return ret; -} - -long uffs_space_used(const char *mount_point) -{ - uffs_Device *dev = NULL; - long ret = -1L; - - dev = uffs_GetDeviceFromMountPoint(mount_point); - if (dev) { - uffs_GlobalFsLockLock(); - ret = (long) uffs_GetDeviceUsed(dev); - uffs_GlobalFsLockUnlock(); - } - - return ret; -} - -long uffs_space_free(const char *mount_point) -{ - uffs_Device *dev = NULL; - long ret = -1L; - - dev = uffs_GetDeviceFromMountPoint(mount_point); - if (dev) { - uffs_GlobalFsLockLock(); - ret = (long) uffs_GetDeviceFree(dev); - uffs_GlobalFsLockUnlock(); - } - - return ret; -} - - -void uffs_flush_all(const char *mount_point) -{ - uffs_Device *dev = NULL; - - dev = uffs_GetDeviceFromMountPoint(mount_point); - if (dev) { - uffs_GlobalFsLockLock(); - uffs_BufFlushAll(dev); - uffs_PutDevice(dev); - uffs_GlobalFsLockUnlock(); - } -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_find.c b/components/dfs/filesystems/uffs/src/uffs/uffs_find.c deleted file mode 100644 index e79da042f7..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_find.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_find.c - * \brief find objects under dir - * \author Ricky Zheng, created 13th July, 2009 - */ - -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_find.h" - -#define TPOOL(dev) &((dev)->mem.tree_pool) - -static void ResetFindInfo(uffs_FindInfo *f) -{ - f->hash = 0; - f->work = NULL; - f->step = 0; - f->pos = 0; -} - -static URET _LoadObjectInfo(uffs_Device *dev, - TreeNode *node, - uffs_ObjectInfo *info, - int type, - int *err) -{ - uffs_Buf *buf; - - buf = uffs_BufGetEx(dev, (u8)type, node, 0, 0); - - if (buf == NULL) { - if (err) - *err = UENOMEM; - return U_FAIL; - } - - memcpy(&(info->info), buf->data, sizeof(uffs_FileInfo)); - - if (type == UFFS_TYPE_DIR) { - info->len = 0; - info->serial = node->u.dir.serial; - } - else { - info->len = node->u.file.len; - info->serial = node->u.file.serial; - } - - uffs_BufPut(dev, buf); - - return U_SUCC; -} - -/** - * get object information - * - * \param[in] obj the object to be revealed - * \param[out] info object information will be loaded to info - * \param[out] err return error code if failed - * - * \return U_SUCC or U_FAIL - * - * \node the obj should be openned before call this function. - */ -URET uffs_GetObjectInfo(uffs_Object *obj, uffs_ObjectInfo *info, int *err) -{ - uffs_Device *dev = obj->dev; - URET ret = U_FAIL; - - uffs_DeviceLock(dev); - - if (obj && dev && info) { - if (obj->parent == PARENT_OF_ROOT) { - // this is ROOT. UFFS does not physically has root, just fake it ... - memset(info, 0, sizeof(uffs_ObjectInfo)); - info->serial = obj->serial; - info->info.attr |= (FILE_ATTR_DIR | FILE_ATTR_WRITE); - if (err) - *err = UENOERR; - ret = U_SUCC; - } - else - ret = _LoadObjectInfo(dev, obj->node, info, obj->type, err); - } - else { - if (err) - *err = UEINVAL; - } - - uffs_DeviceUnLock(dev); - - return ret; -} - - -/** - * Open a FindInfo for finding objects under dir - * - * \param[out] f uffs_FindInfo structure - * \param[in] dir an openned dir object (openned by uffs_OpenObject() ). - * - * \return U_SUCC if success, U_FAIL if invalid param or the dir - * is not been openned. - */ -URET uffs_FindObjectOpen(uffs_FindInfo *f, uffs_Object *dir) -{ - if (f == NULL || dir == NULL || - dir->dev == NULL || dir->open_succ != U_TRUE) - return U_FAIL; - - f->dev = dir->dev; - f->serial = dir->serial; - ResetFindInfo(f); - - return U_SUCC; -} - -/** - * Open a FindInfo for finding objects under dir - * - * \param[out] f uffs_FindInfo structure - * \param[in] dev uffs device - * \param[in] dir serial number of the dir to be searched - * - * \return U_SUCC if success, U_FAIL if invalid param or the dir - * serial number is not valid. - */ -URET uffs_FindObjectOpenEx(uffs_FindInfo *f, uffs_Device *dev, int dir) -{ - TreeNode *node; - - if (f == NULL || dev == NULL) - return U_FAIL; - - node = uffs_TreeFindDirNode(dev, dir); - - if (node == NULL) - return U_FAIL; - - f->serial = dir; - f->dev = dev; - ResetFindInfo(f); - - return U_SUCC; -} - - -static URET do_FindObject(uffs_FindInfo *f, uffs_ObjectInfo *info, u16 x) -{ - URET ret = U_SUCC; - TreeNode *node; - uffs_Device *dev = f->dev; - - if (f->step == 0) { //!< working on dirs - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.dir.parent == f->serial) { - f->work = node; - f->pos++; - if (info) - ret = _LoadObjectInfo(dev, node, info, UFFS_TYPE_DIR, NULL); - goto ext; - } - x = node->hash_next; - } - - f->hash++; //come to next hash entry - - for (; f->hash < DIR_NODE_ENTRY_LEN; f->hash++) { - x = dev->tree.dir_entry[f->hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.dir.parent == f->serial) { - f->work = node; - f->pos++; - if (info) - ret = _LoadObjectInfo(dev, node, info, UFFS_TYPE_DIR, NULL); - goto ext; - } - x = node->hash_next; - } - } - - //no subdirs, then lookup files .. - f->step++; - f->hash = 0; - x = dev->tree.file_entry[f->hash]; - } - - if (f->step == 1) { - - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.file.parent == f->serial) { - f->work = node; - f->pos++; - if (info) - ret = _LoadObjectInfo(dev, node, info, UFFS_TYPE_FILE, NULL); - goto ext; - } - x = node->hash_next; - } - - f->hash++; //come to next hash entry - - for (; f->hash < FILE_NODE_ENTRY_LEN; f->hash++) { - x = dev->tree.file_entry[f->hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.file.parent == f->serial) { - f->work = node; - f->pos++; - if (info) - ret = _LoadObjectInfo(dev, node, info, UFFS_TYPE_FILE, NULL); - goto ext; - } - x = node->hash_next; - } - } - - //no any files, stopped. - f->step++; - } - - ret = U_FAIL; -ext: - - return ret; - -} - - -/** - * Find the first object - * - * \param[out] info the object information will be filled to info. - * if info is NULL, then skip this object. - * \param[in] f uffs_FindInfo structure, openned by uffs_FindObjectOpen(). - * - * \return U_SUCC if an object is found, U_FAIL if no object is found. - */ -URET uffs_FindObjectFirst(uffs_ObjectInfo * info, uffs_FindInfo * f) -{ - uffs_Device *dev = f->dev; - URET ret = U_SUCC; - - uffs_DeviceLock(dev); - ResetFindInfo(f); - ret = do_FindObject(f, info, dev->tree.dir_entry[0]); - uffs_DeviceUnLock(dev); - - return ret; -} - -/** - * Find the next object. - * - * \param[out] info the object information will be filled to info. - * if info is NULL, then skip this object. - * \param[in] f uffs_FindInfo structure, openned by uffs_FindObjectOpen(). - * - * \return U_SUCC if an object is found, U_FAIL if no object is found. - * - * \note uffs_FindObjectFirst() should be called before uffs_FindObjectNext(). - */ -URET uffs_FindObjectNext(uffs_ObjectInfo *info, uffs_FindInfo * f) -{ - uffs_Device *dev = f->dev; - URET ret = U_SUCC; - - if (dev == NULL || f->step > 1) - return U_FAIL; - - if (f->work == NULL) - return uffs_FindObjectFirst(info, f); - - uffs_DeviceLock(dev); - ret = do_FindObject(f, info, f->work->hash_next); - uffs_DeviceUnLock(dev); - - return ret; -} - -/** - * Rewind a find object process. - * - * \note After rewind, you can call uffs_FindObjectFirst() to - * start find object process. - */ -URET uffs_FindObjectRewind(uffs_FindInfo *f) -{ - if (f == NULL) - return U_FAIL; - - ResetFindInfo(f); - - return U_SUCC; -} - -/** - * Close Find Object. - * - * \param[in] f uffs_FindInfo structure, openned by uffs_FindObjectOpen(). - * - * \return U_SUCC if success, U_FAIL if invalid param. - */ -URET uffs_FindObjectClose(uffs_FindInfo * f) -{ - if (f == NULL) - return U_FAIL; - - f->dev = NULL; - ResetFindInfo(f); - - return U_SUCC; -} - -/** - * Count objects - * - * \param[in] f uffs_FindInfo structure, openned by uffs_FindObjectOpen(). - * - * \return object counts - * \note after call this function, you need to call - * uffs_FindObjectRewind() to start finding process. - */ -int uffs_FindObjectCount(uffs_FindInfo *f) -{ - if (uffs_FindObjectFirst(NULL, f) == U_SUCC) { - while (uffs_FindObjectNext(NULL, f) == U_SUCC) { }; - } - return f->pos; -} - -/** - * Return current finding position - * - * \param[in] f uffs_FindInfo structure, openned by uffs_FindObjectOpen(). - * - * \return current finding position - */ -int uffs_FindObjectTell(uffs_FindInfo *f) -{ - return f->pos; -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_flash.c b/components/dfs/filesystems/uffs/src/uffs/uffs_flash.c deleted file mode 100644 index be4f4246dc..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_flash.c +++ /dev/null @@ -1,1034 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_flash.c - * \brief UFFS flash interface - * \author Ricky Zheng, created 17th July, 2009 - */ -#include "uffs_config.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_ecc.h" -#include "uffs/uffs_flash.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_badblock.h" -#include "uffs/uffs_crc.h" -#include - -#define PFX "flsh: " - -#define SPOOL(dev) &((dev)->mem.spare_pool) -#define HEADER(buf) ((struct uffs_MiniHeaderSt *)(buf)->header) - -#define ECC_SIZE(dev) ((dev)->attr->ecc_size) -#define NOMINAL_ECC_SIZE(dev) (3 * ((((dev)->attr->page_data_size - 1) / 256) + 1)) - -#define TAG_STORE_SIZE (sizeof(struct uffs_TagStoreSt)) - -#define SEAL_BYTE(dev, spare) spare[(dev)->mem.spare_data_size - 1] // seal byte is the last byte of spare data - -#if defined(CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME) -/** Linux MTD spare layout for 512 and 2K page size */ -static const u8 MTD512_LAYOUT_ECC[] = {0, 4, 6, 2, 0xFF, 0}; -static const u8 MTD512_LAYOUT_DATA[] = {8, 8, 0xFF, 0}; -static const u8 MTD2K_LAYOUT_ECC[] = {40, 24, 0xFF, 0}; -static const u8 MTD2K_LAYOUT_DATA[] = {2, 38, 0xFF, 0}; -#endif - -static void TagMakeEcc(struct uffs_TagStoreSt *ts) -{ - ts->tag_ecc = 0xFFF; - ts->tag_ecc = uffs_EccMake8(ts, sizeof(struct uffs_TagStoreSt)); -} - -static int TagEccCorrect(struct uffs_TagStoreSt *ts) -{ - u16 ecc_store, ecc_read; - int ret; - - ecc_store = ts->tag_ecc; - ts->tag_ecc = 0xFFF; - ecc_read = uffs_EccMake8(ts, sizeof(struct uffs_TagStoreSt)); - ret = uffs_EccCorrect8(ts, ecc_read, ecc_store, sizeof(struct uffs_TagStoreSt)); - ts->tag_ecc = ecc_store; // restore tag ecc - - return ret; - -} - -/** setup UFFS spare data & ecc layout */ -static void InitSpareLayout(uffs_Device *dev) -{ - u8 s; // status byte offset - u8 *p; - - s = dev->attr->block_status_offs; - - if (s < TAG_STORE_SIZE) { /* status byte is within 0 ~ TAG_STORE_SIZE-1 */ - - /* spare data layout */ - p = dev->attr->_uffs_data_layout; - if (s > 0) { - *p++ = 0; - *p++ = s; - } - *p++ = s + 1; - *p++ = TAG_STORE_SIZE - s; - *p++ = 0xFF; - *p++ = 0; - - /* spare ecc layout */ - p = dev->attr->_uffs_ecc_layout; - if (dev->attr->ecc_opt != UFFS_ECC_NONE) { - *p++ = TAG_STORE_SIZE + 1; - *p++ = ECC_SIZE(dev); - } - *p++ = 0xFF; - *p++ = 0; - } - else { /* status byte > TAG_STORE_SIZE-1 */ - - /* spare data layout */ - p = dev->attr->_uffs_data_layout; - *p++ = 0; - *p++ = TAG_STORE_SIZE; - *p++ = 0xFF; - *p++ = 0; - - /* spare ecc layout */ - p = dev->attr->_uffs_ecc_layout; - if (dev->attr->ecc_opt != UFFS_ECC_NONE) { - if (s < TAG_STORE_SIZE + ECC_SIZE(dev)) { - if (s > TAG_STORE_SIZE) { - *p++ = TAG_STORE_SIZE; - *p++ = s - TAG_STORE_SIZE; - } - *p++ = s + 1; - *p++ = TAG_STORE_SIZE + ECC_SIZE(dev) - s; - } - else { - *p++ = TAG_STORE_SIZE; - *p++ = ECC_SIZE(dev); - } - } - *p++ = 0xFF; - *p++ = 0; - } - - dev->attr->data_layout = dev->attr->_uffs_data_layout; - dev->attr->ecc_layout = dev->attr->_uffs_ecc_layout; -} - -static int CalculateSpareDataSize(uffs_Device *dev) -{ - const u8 *p; - int ecc_last = 0, tag_last = 0; - int ecc_size, tag_size; - int n; - - ecc_size = (dev->attr->ecc_opt == UFFS_ECC_NONE ? 0 : ECC_SIZE(dev)); - - p = dev->attr->ecc_layout; - if (p) { - while (*p != 0xFF && ecc_size > 0) { - n = (p[1] > ecc_size ? ecc_size : p[1]); - ecc_last = p[0] + n; - ecc_size -= n; - p += 2; - } - } - - tag_size = TAG_STORE_SIZE; - p = dev->attr->data_layout; - if (p) { - while (*p != 0xFF && tag_size > 0) { - n = (p[1] > tag_size ? tag_size : p[1]); - tag_last = p[0] + n; - tag_size -= n; - p += 2; - } - } - - n = (ecc_last > tag_last ? ecc_last : tag_last); - n = (n > dev->attr->block_status_offs + 1 ? - n : dev->attr->block_status_offs + 1); - - return n + 1; // plus one seal byte. -} - - -/** - * Initialize UFFS flash interface - */ -URET uffs_FlashInterfaceInit(uffs_Device *dev) -{ - URET ret = U_FAIL; - struct uffs_StorageAttrSt *attr = dev->attr; - uffs_Pool *pool = SPOOL(dev); - - if (dev->mem.spare_pool_size == 0) { - if (dev->mem.malloc) { - dev->mem.spare_pool_buf = dev->mem.malloc(dev, UFFS_SPARE_BUFFER_SIZE); - if (dev->mem.spare_pool_buf) - dev->mem.spare_pool_size = UFFS_SPARE_BUFFER_SIZE; - } - } - - if (UFFS_SPARE_BUFFER_SIZE > dev->mem.spare_pool_size) { - uffs_Perror(UFFS_MSG_DEAD, - "Spare buffer require %d but only %d available.", - UFFS_SPARE_BUFFER_SIZE, dev->mem.spare_pool_size); - memset(pool, 0, sizeof(uffs_Pool)); - goto ext; - } - - uffs_Perror(UFFS_MSG_NOISY, - "alloc spare buffers %d bytes.", - UFFS_SPARE_BUFFER_SIZE); - uffs_PoolInit(pool, dev->mem.spare_pool_buf, - dev->mem.spare_pool_size, - UFFS_MAX_SPARE_SIZE, MAX_SPARE_BUFFERS); - - // init flash driver - if (dev->ops->InitFlash) { - if (dev->ops->InitFlash(dev) < 0) - goto ext; - } - - if (dev->ops->WritePage == NULL && dev->ops->WritePageWithLayout == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Flash driver must provide 'WritePage' or 'WritePageWithLayout' function!"); - goto ext; - } - - if (dev->ops->ReadPage == NULL && dev->ops->ReadPageWithLayout == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Flash driver must provide 'ReadPage' or 'ReadPageWithLayout' function!"); - goto ext; - } - - if (dev->attr->layout_opt == UFFS_LAYOUT_UFFS) { - /* sanity check */ - - if (dev->attr->ecc_size == 0 && dev->attr->ecc_opt != UFFS_ECC_NONE) { - dev->attr->ecc_size = NOMINAL_ECC_SIZE(dev); - } - - uffs_Perror(UFFS_MSG_NORMAL, "ECC size %d", dev->attr->ecc_size); - - if ((dev->attr->data_layout && !dev->attr->ecc_layout) || - (!dev->attr->data_layout && dev->attr->ecc_layout)) { - uffs_Perror(UFFS_MSG_SERIOUS, - "Please setup data_layout and ecc_layout, " - "or leave them all NULL !"); - goto ext; - } - - if (!attr->data_layout && !attr->ecc_layout) { -#if defined(CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME) - switch(attr->page_data_size) { - case 512: - attr->ecc_layout = MTD512_LAYOUT_ECC; - attr->data_layout = MTD512_LAYOUT_DATA; - break; - case 2048: - attr->ecc_layout = MTD2K_LAYOUT_ECC; - attr->data_layout = MTD2K_LAYOUT_DATA; - break; - default: - InitSpareLayout(dev); - break; - } -#else - InitSpareLayout(dev); -#endif - } - } - else if (dev->attr->layout_opt == UFFS_LAYOUT_FLASH) { - if (dev->ops->WritePageWithLayout == NULL || dev->ops->ReadPageWithLayout == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "When using UFFS_LAYOUT_FLASH option, " - "flash driver must provide 'WritePageWithLayout' and 'ReadPageWithLayout' function!"); - goto ext; - } - } - else { - uffs_Perror(UFFS_MSG_SERIOUS, "Invalid layout_opt: %d", dev->attr->layout_opt); - goto ext; - } - - if (dev->ops->EraseBlock == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Flash driver MUST implement 'EraseBlock()' function !"); - goto ext; - } - - dev->mem.spare_data_size = CalculateSpareDataSize(dev); - uffs_Perror(UFFS_MSG_NORMAL, "UFFS consume spare data size %d", dev->mem.spare_data_size); - - if (dev->mem.spare_data_size > dev->attr->spare_size) { - uffs_Perror(UFFS_MSG_SERIOUS, "NAND spare(%dB) can't hold UFFS spare data(%dB) !", - dev->attr->spare_size, dev->mem.spare_data_size); - goto ext; - } - - ret = U_SUCC; -ext: - return ret; -} - -/** - * Release UFFS flash interface - */ -URET uffs_FlashInterfaceRelease(uffs_Device *dev) -{ - uffs_Pool *pool; - - pool = SPOOL(dev); - if (pool->mem && dev->mem.free) { - dev->mem.free(dev, pool->mem); - pool->mem = NULL; - dev->mem.spare_pool_size = 0; - } - uffs_PoolRelease(pool); - memset(pool, 0, sizeof(uffs_Pool)); - - // release flash driver - if (dev->ops->ReleaseFlash) { - if (dev->ops->ReleaseFlash(dev) < 0) - return U_FAIL; - } - - return U_SUCC; -} - -/** - * unload spare to tag and ecc. - */ -void uffs_FlashUnloadSpare(uffs_Device *dev, - const u8 *spare, struct uffs_TagStoreSt *ts, u8 *ecc) -{ - u8 *p_tag = (u8 *)ts; - int tag_size = TAG_STORE_SIZE; - int ecc_size = dev->attr->ecc_size; - int n; - const u8 *p; - - // unload ecc - p = dev->attr->ecc_layout; - if (p && ecc) { - while (*p != 0xFF && ecc_size > 0) { - n = (p[1] > ecc_size ? ecc_size : p[1]); - memcpy(ecc, spare + p[0], n); - ecc_size -= n; - ecc += n; - p += 2; - } - } - - // unload tag - if (ts) { - p = dev->attr->data_layout; - while (*p != 0xFF && tag_size > 0) { - n = (p[1] > tag_size ? tag_size : p[1]); - memcpy(p_tag, spare + p[0], n); - tag_size -= n; - p_tag += n; - p += 2; - } - } -} - -/** - * Read tag from page spare - * - * \param[in] dev uffs device - * \param[in] block flash block num - * \param[in] page flash page num - * \param[out] tag tag to be filled - * - * \return #UFFS_FLASH_NO_ERR: success and/or has no flip bits. - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_ECC_FAIL: spare data has flip bits and ecc correct failed. - * #UFFS_FLASH_ECC_OK: spare data has flip bits and corrected by ecc. -*/ -int uffs_FlashReadPageTag(uffs_Device *dev, - int block, int page, uffs_Tags *tag) -{ - uffs_FlashOps *ops = dev->ops; - u8 * spare_buf; - int ret = UFFS_FLASH_UNKNOWN_ERR; - int tmp_ret; - UBOOL is_bad = U_FALSE; - - spare_buf = (u8 *) uffs_PoolGet(SPOOL(dev)); - if (spare_buf == NULL) - goto ext; - - if (ops->ReadPageWithLayout) { - ret = ops->ReadPageWithLayout(dev, block, page, NULL, 0, NULL, tag ? &tag->s : NULL, NULL); - if (tag) - tag->seal_byte = (ret == UFFS_FLASH_NOT_SEALED ? 0xFF : 0); - } - else { - ret = ops->ReadPage(dev, block, page, NULL, 0, NULL, - spare_buf, dev->mem.spare_data_size); - - if (tag) { - tag->seal_byte = SEAL_BYTE(dev, spare_buf); - - if (!UFFS_FLASH_HAVE_ERR(ret)) - uffs_FlashUnloadSpare(dev, spare_buf, &tag->s, NULL); - } - } - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - - if (UFFS_FLASH_HAVE_ERR(ret)) - goto ext; - - if (tag) { - if (!TAG_IS_SEALED(tag)) // not sealed ? don't try tag ECC correction - goto ext; - - if (!TAG_IS_VALID(tag)) { - if (dev->attr->ecc_opt != UFFS_ECC_NONE) { - /* - * There could be a special case if: - * a) tag is sealed (so we are here), and - * b) s.valid == 1 and this bit is a 'bad' bit, and - * c) after tag ECC (corrected by tag ECC) s.valid == 0. - * - * So we need to try tag ECC (don't treat it as bad block if ECC failed) - */ - - struct uffs_TagStoreSt s; - - memcpy(&s, &tag->s, sizeof(s)); - tmp_ret = TagEccCorrect(&s); - - if (tmp_ret <= 0 || !TAG_IS_VALID(tag)) // can not corrected by ECC. - goto ext; - } - else { - goto ext; - } - } - - // do tag ecc correction - if (dev->attr->ecc_opt != UFFS_ECC_NONE) { - ret = TagEccCorrect(&tag->s); - ret = (ret < 0 ? UFFS_FLASH_ECC_FAIL : - (ret > 0 ? UFFS_FLASH_ECC_OK : UFFS_FLASH_NO_ERR)); - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - - if (UFFS_FLASH_HAVE_ERR(ret)) - goto ext; - } - } - -ext: - if (is_bad) { - uffs_BadBlockAdd(dev, block); - uffs_Perror(UFFS_MSG_NORMAL, - "A new bad block (%d) is detected.", block); - } - - if (spare_buf) - uffs_PoolPut(SPOOL(dev), spare_buf); - - return ret; -} - -/** - * Read page data to buf (do ECC error correction if needed) - * \param[in] dev uffs device - * \param[in] block flash block num - * \param[in] page flash page num of the block - * \param[out] buf holding the read out data - * \param[in] skip_ecc skip ecc when reading data from flash - * - * \return #UFFS_FLASH_NO_ERR: success and/or has no flip bits. - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_ECC_FAIL: spare data has flip bits and ecc correct failed. - * #UFFS_FLASH_ECC_OK: spare data has flip bits and corrected by ecc. - * #UFFS_FLASH_CRC_ERR: CRC verification failed. - * #UFFS_FLASH_UNKNOWN_ERR: - * - * \note if skip_ecc is U_TRUE, skip CRC as well. - */ -int uffs_FlashReadPage(uffs_Device *dev, int block, int page, uffs_Buf *buf, UBOOL skip_ecc) -{ - uffs_FlashOps *ops = dev->ops; - struct uffs_StorageAttrSt *attr = dev->attr; - int size = dev->com.pg_size; - u8 ecc_buf[UFFS_MAX_ECC_SIZE]; - u8 ecc_store[UFFS_MAX_ECC_SIZE]; - UBOOL is_bad = U_FALSE; -#ifdef CONFIG_ENABLE_PAGE_DATA_CRC - UBOOL crc_ok = U_TRUE; -#endif - u8 * spare; - - int ret = UFFS_FLASH_UNKNOWN_ERR; - - spare = (u8 *) uffs_PoolGet(SPOOL(dev)); - if (spare == NULL) - goto ext; - - if (ops->ReadPageWithLayout) { - if (skip_ecc) - ret = ops->ReadPageWithLayout(dev, block, page, buf->header, size, NULL, NULL, NULL); - else - ret = ops->ReadPageWithLayout(dev, block, page, buf->header, size, ecc_buf, NULL, ecc_store); - } - else { - if (skip_ecc) - ret = ops->ReadPage(dev, block, page, buf->header, size, NULL, NULL, 0); - else - ret = ops->ReadPage(dev, block, page, buf->header, size, ecc_buf, spare, dev->mem.spare_data_size); - } - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - - if (UFFS_FLASH_HAVE_ERR(ret)) - goto ext; - -#ifdef CONFIG_ENABLE_PAGE_DATA_CRC - if (!skip_ecc) { - crc_ok = (HEADER(buf)->crc == uffs_crc16sum(buf->data, size - sizeof(struct uffs_MiniHeaderSt)) ? U_TRUE : U_FALSE); - - if (crc_ok) - goto ext; // CRC is matched, no need to do ECC correction. - else { - if (dev->attr->ecc_opt == UFFS_ECC_NONE || dev->attr->ecc_opt == UFFS_ECC_HW_AUTO) { - // ECC is not enabled or ecc correction already done, error return immediately, - // otherwise, we try CRC check again after ecc correction. - ret = UFFS_FLASH_CRC_ERR; - goto ext; - } - } - } -#endif - - // make ECC for UFFS_ECC_SOFT - if (attr->ecc_opt == UFFS_ECC_SOFT && !skip_ecc) - uffs_EccMake(buf->header, size, ecc_buf); - - // unload ecc_store if driver doesn't do the layout - if (ops->ReadPageWithLayout == NULL) { - if (!skip_ecc && (attr->ecc_opt == UFFS_ECC_SOFT || attr->ecc_opt == UFFS_ECC_HW)) - uffs_FlashUnloadSpare(dev, spare, NULL, ecc_store); - } - - // check page data ecc - if (!skip_ecc && (dev->attr->ecc_opt == UFFS_ECC_SOFT || dev->attr->ecc_opt == UFFS_ECC_HW)) { - - ret = uffs_EccCorrect(buf->header, size, ecc_store, ecc_buf); - ret = (ret < 0 ? UFFS_FLASH_ECC_FAIL : - (ret > 0 ? UFFS_FLASH_ECC_OK : UFFS_FLASH_NO_ERR)); - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - - if (UFFS_FLASH_HAVE_ERR(ret)) - goto ext; - } - -#ifdef CONFIG_ENABLE_PAGE_DATA_CRC - if (!skip_ecc && !UFFS_FLASH_HAVE_ERR(ret)) { - // Everything seems ok, do CRC check again. - if (HEADER(buf)->crc == uffs_crc16sum(buf->data, size - sizeof(struct uffs_MiniHeaderSt))) { - ret = UFFS_FLASH_CRC_ERR; - goto ext; - } - } -#endif - -ext: - switch(ret) { - case UFFS_FLASH_IO_ERR: - uffs_Perror(UFFS_MSG_NORMAL, "Read block %d page %d I/O error", block, page); - break; - case UFFS_FLASH_ECC_FAIL: - uffs_Perror(UFFS_MSG_NORMAL, "Read block %d page %d ECC failed", block, page); - ret = UFFS_FLASH_BAD_BLK; // treat ECC FAIL as BAD BLOCK - is_bad = U_TRUE; - break; - case UFFS_FLASH_ECC_OK: - uffs_Perror(UFFS_MSG_NORMAL, "Read block %d page %d bit flip corrected by ECC", block, page); - break; - case UFFS_FLASH_BAD_BLK: - uffs_Perror(UFFS_MSG_NORMAL, "Read block %d page %d BAD BLOCK found", block, page); - break; - case UFFS_FLASH_UNKNOWN_ERR: - uffs_Perror(UFFS_MSG_NORMAL, "Read block %d page %d UNKNOWN error!", block, page); - break; - case UFFS_FLASH_CRC_ERR: - uffs_Perror(UFFS_MSG_NORMAL, "Read block %d page %d CRC failed", block, page); - break; - default: - break; - } - - if (is_bad) - uffs_BadBlockAdd(dev, block); - - if (spare) - uffs_PoolPut(SPOOL(dev), spare); - - - return ret; -} - -/** - * make spare from tag and ecc - * - * \param[in] dev uffs dev - * \param[in] ts uffs tag store, NULL if don't pack tag store - * \param[in] ecc ecc of data, NULL if don't pack ecc - * \param[out] spare output buffer - * \note spare buffer size: dev->mem.spare_data_size, - * all unpacked bytes will be inited 0xFF - */ -void uffs_FlashMakeSpare(uffs_Device *dev, - const uffs_TagStore *ts, const u8 *ecc, u8* spare) -{ - u8 *p_ts = (u8 *)ts; - int ts_size = TAG_STORE_SIZE; - int ecc_size = ECC_SIZE(dev); - int n; - const u8 *p; - - if (!uffs_Assert(spare != NULL, "invalid param")) - return; - - memset(spare, 0xFF, dev->mem.spare_data_size); // initialize as 0xFF. - SEAL_BYTE(dev, spare) = 0; // set seal byte = 0. - - // load ecc - p = dev->attr->ecc_layout; - if (p && ecc) { - while (*p != 0xFF && ecc_size > 0) { - n = (p[1] > ecc_size ? ecc_size : p[1]); - memcpy(spare + p[0], ecc, n); - ecc_size -= n; - ecc += n; - p += 2; - } - } - - p = dev->attr->data_layout; - while (*p != 0xFF && ts_size > 0) { - n = (p[1] > ts_size ? ts_size : p[1]); - memcpy(spare + p[0], p_ts, n); - ts_size -= n; - p_ts += n; - p += 2; - } - - uffs_Assert(SEAL_BYTE(dev, spare) == 0, "Make spare fail!"); -} - -/** - * write the whole page, include data and tag - * - * \param[in] dev uffs device - * \param[in] block - * \param[in] page - * \param[in] buf contains data to be wrote - * \param[in] tag tag to be wrote - * - * \return #UFFS_FLASH_NO_ERR: success. - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_BAD_BLK: a new bad block detected. - */ -int uffs_FlashWritePageCombine(uffs_Device *dev, - int block, int page, - uffs_Buf *buf, uffs_Tags *tag) -{ - uffs_FlashOps *ops = dev->ops; - int size = dev->com.pg_size; - u8 ecc_buf[UFFS_MAX_ECC_SIZE]; - u8 *ecc = NULL; - u8 *spare; - struct uffs_MiniHeaderSt *header; - int ret = UFFS_FLASH_UNKNOWN_ERR; - UBOOL is_bad = U_FALSE; - uffs_Buf *verify_buf; -#ifdef CONFIG_PAGE_WRITE_VERIFY - uffs_Tags chk_tag; -#endif - - spare = (u8 *) uffs_PoolGet(SPOOL(dev)); - if (spare == NULL) - goto ext; - - // setup header - header = HEADER(buf); - memset(header, 0xFF, sizeof(struct uffs_MiniHeaderSt)); - header->status = 0; -#ifdef CONFIG_ENABLE_PAGE_DATA_CRC - header->crc = uffs_crc16sum(buf->data, size - sizeof(struct uffs_MiniHeaderSt)); -#endif - - // setup tag - TAG_DIRTY_BIT(tag) = TAG_DIRTY; //!< set dirty bit - TAG_VALID_BIT(tag) = TAG_VALID; //!< set valid bit - SEAL_TAG(tag); //!< seal tag (the real seal byte will be set in uffs_FlashMakeSpare()) - - if (dev->attr->ecc_opt != UFFS_ECC_NONE) - TagMakeEcc(&tag->s); - else - tag->s.tag_ecc = TAG_ECC_DEFAULT; - - if (dev->attr->ecc_opt == UFFS_ECC_SOFT) { - uffs_EccMake(buf->header, size, ecc_buf); - ecc = ecc_buf; - } - else if (dev->attr->ecc_opt == UFFS_ECC_HW) { - ecc = ecc_buf; - } - - if (ops->WritePageWithLayout) { - ret = ops->WritePageWithLayout(dev, block, page, - buf->header, size, ecc, &tag->s); - } - else { - - if (!uffs_Assert(!(dev->attr->layout_opt == UFFS_LAYOUT_FLASH || - dev->attr->ecc_opt == UFFS_ECC_HW || - dev->attr->ecc_opt == UFFS_ECC_HW_AUTO), "WritePageWithLayout() not implemented ?")) { - ret = UFFS_FLASH_IO_ERR; - goto ext; - } - - uffs_FlashMakeSpare(dev, &tag->s, ecc, spare); - - ret = ops->WritePage(dev, block, page, buf->header, size, spare, dev->mem.spare_data_size); - - } - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - - if (UFFS_FLASH_HAVE_ERR(ret)) - goto ext; - -#ifdef CONFIG_PAGE_WRITE_VERIFY - verify_buf = uffs_BufClone(dev, NULL); - if (verify_buf) { - ret = uffs_FlashReadPage(dev, block, page, verify_buf, U_FALSE); - if (!UFFS_FLASH_HAVE_ERR(ret)) { - if (memcmp(buf->header, verify_buf->header, size) != 0) { - uffs_Perror(UFFS_MSG_NORMAL, - "Page write verify failed (block %d page %d)", - block, page); - ret = UFFS_FLASH_BAD_BLK; - } - } - - uffs_BufFreeClone(dev, verify_buf); - } - else { - uffs_Perror(UFFS_MSG_SERIOUS, "Insufficient buf, clone buf failed."); - } - - ret = uffs_FlashReadPageTag(dev, block, page, &chk_tag); - if (UFFS_FLASH_HAVE_ERR(ret)) - goto ext; - - if (memcmp(&tag->s, &chk_tag.s, sizeof(uffs_TagStore)) != 0) { - uffs_Perror(UFFS_MSG_NORMAL, "Page tag write verify failed (block %d page %d)", - block, page); - ret = UFFS_FLASH_BAD_BLK; - } - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - -#endif -ext: - if (is_bad) - uffs_BadBlockAdd(dev, block); - - if (spare) - uffs_PoolPut(SPOOL(dev), spare); - - return ret; -} - -/** - * mark a clean page tag as 'dirty' and 'invalid'. - * - * \param[in] dev uffs device - * \param[in] bc block info - * \param[in] page - * - * \return #UFFS_FLASH_NO_ERR: success. - * #UFFS_FLASH_IO_ERR: I/O error, expect retry ? - * #UFFS_FLASH_BAD_BLK: a new bad block detected. - */ -int uffs_FlashMarkDirtyPage(uffs_Device *dev, uffs_BlockInfo *bc, int page) -{ - u8 *spare; - uffs_FlashOps *ops = dev->ops; - UBOOL is_bad = U_FALSE; - int ret = UFFS_FLASH_UNKNOWN_ERR; - int block = bc->block; - uffs_Tags *tag = GET_TAG(bc, page); - struct uffs_TagStoreSt *ts = &tag->s; - - spare = (u8 *) uffs_PoolGet(SPOOL(dev)); - if (spare == NULL) - goto ext; - - memset(ts, 0xFF, sizeof(struct uffs_TagStoreSt)); - ts->dirty = TAG_DIRTY; // set only 'dirty' bit, leave 'valid' bit to 1 (invalid). - - if (dev->attr->ecc_opt != UFFS_ECC_NONE) - TagMakeEcc(ts); - - if (ops->WritePageWithLayout) { - ret = ops->WritePageWithLayout(dev, block, page, NULL, 0, NULL, ts); - } - else { - uffs_FlashMakeSpare(dev, ts, NULL, spare); - ret = ops->WritePage(dev, block, page, NULL, 0, spare, dev->mem.spare_data_size); - } - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - is_bad = U_TRUE; - -ext: - if (is_bad) - uffs_BadBlockAdd(dev, block); - - if (spare) - uffs_PoolPut(SPOOL(dev), spare); - - return ret; -} - -/** Mark this block as bad block */ -URET uffs_FlashMarkBadBlock(uffs_Device *dev, int block) -{ - int ret; - uffs_BlockInfo *bc; - - uffs_Perror(UFFS_MSG_NORMAL, "Mark bad block: %d", block); - - bc = uffs_BlockInfoGet(dev, block); - if (bc) { - uffs_BlockInfoExpire(dev, bc, UFFS_ALL_PAGES); // expire this block, just in case it's been cached before - uffs_BlockInfoPut(dev, bc); - } - - if (dev->ops->MarkBadBlock) - return dev->ops->MarkBadBlock(dev, block) == 0 ? U_SUCC : U_FAIL; - -#ifdef CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - ret = dev->ops->EraseBlock(dev, block); - if (ret != UFFS_FLASH_IO_ERR) { - // note: even EraseBlock return UFFS_FLASH_BAD_BLK, - // we still process it ... not recommended for most NAND flash. -#endif - if (dev->ops->WritePageWithLayout) - ret = dev->ops->WritePageWithLayout(dev, block, 0, NULL, 0, NULL, NULL); - else - ret = dev->ops->WritePage(dev, block, 0, NULL, 0, NULL, 0); - -#ifdef CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - } -#endif - - return ret == UFFS_FLASH_NO_ERR ? U_SUCC : U_FAIL; -} - -/** Is this block a bad block ? */ -UBOOL uffs_FlashIsBadBlock(uffs_Device *dev, int block) -{ - struct uffs_FlashOpsSt *ops = dev->ops; - UBOOL ret = U_FALSE; - - if (ops->IsBadBlock) { - /* if flash driver provide 'IsBadBlock' function, call it */ - ret = (ops->IsBadBlock(dev, block) == 0 ? U_FALSE : U_TRUE); - } - else { - /* otherwise we call ReadPage[WithLayout]() to get bad block status byte */ - /* check the first page */ - if (ops->ReadPageWithLayout) { - ret = (ops->ReadPageWithLayout(dev, block, 0, NULL, 0, NULL, NULL, NULL) - == UFFS_FLASH_BAD_BLK ? U_TRUE : U_FALSE); - } - else { - ret = (ops->ReadPage(dev, block, 0, NULL, 0, NULL, NULL, 0) - == UFFS_FLASH_BAD_BLK ? U_TRUE : U_FALSE); - } - - if (ret == U_FALSE) { - /* check the second page */ - if (ops->ReadPageWithLayout) { - ret = (ops->ReadPageWithLayout(dev, block, 0, NULL, 0, NULL, NULL, NULL) - == UFFS_FLASH_BAD_BLK ? U_TRUE : U_FALSE); - } - else { - ret = (ops->ReadPage(dev, block, 0, NULL, 0, NULL, NULL, 0) - == UFFS_FLASH_BAD_BLK ? U_TRUE : U_FALSE); - } - } - } - - //uffs_Perror(UFFS_MSG_NOISY, "Block %d is %s", block, ret ? "BAD" : "GOOD"); - - return ret; -} - -/** Erase flash block */ -URET uffs_FlashEraseBlock(uffs_Device *dev, int block) -{ - int ret; - uffs_BlockInfo *bc; - - ret = dev->ops->EraseBlock(dev, block); - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - uffs_BadBlockAdd(dev, block); - - bc = uffs_BlockInfoGet(dev, block); - if (bc) { - uffs_BlockInfoExpire(dev, bc, UFFS_ALL_PAGES); - uffs_BlockInfoPut(dev, bc); - } - return UFFS_FLASH_HAVE_ERR(ret) ? U_FAIL : U_SUCC; -} - -/** - * Check the block by reading all pages. - * - * \return U_SUCC - all pages are clean, - * U_FAIL - block is not clean - */ -URET uffs_FlashCheckErasedBlock(uffs_Device *dev, int block) -{ - u8 *spare = NULL; - uffs_FlashOps *ops = dev->ops; - int ret = U_SUCC; - int page; - int flash_ret; - u8 ecc_store[UFFS_MAX_ECC_SIZE]; - uffs_TagStore ts; - uffs_Buf *buf = NULL; - int size = dev->com.pg_size; - int i; - u8 *p; - - spare = (u8 *) uffs_PoolGet(SPOOL(dev)); - - if (spare == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Can't allocate spare buf."); - goto ext; - } - - buf = uffs_BufClone(dev, NULL); - - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "Can't clone buf."); - goto ext; - } - - for (page = 0; page < dev->attr->pages_per_block; page++) { - if (ops->ReadPageWithLayout) { - - flash_ret = ops->ReadPageWithLayout(dev, block, page, buf->header, size, NULL, &ts, ecc_store); - - if (flash_ret != UFFS_FLASH_IO_ERR) { - // check page tag, should be all 0xFF - for (i = 0, p = (u8 *)(&ts); i < sizeof(ts); i++, p++) { - if (*p != 0xFF) { - ret = U_FAIL; - goto ext; - } - } - - // for hw or soft ecc, check stored ecc, should be all 0xFF - if (dev->attr->ecc_opt == UFFS_ECC_HW || - dev->attr->ecc_opt == UFFS_ECC_SOFT) - { - for (i = 0, p = ecc_store; i < ECC_SIZE(dev); i++, p++) { - if (*p != 0xFF) { - ret = U_FAIL; - goto ext; - } - } - } - } - } - else { - - flash_ret = ops->ReadPage(dev, block, page, buf->header, size, NULL, spare, dev->attr->spare_size); - if (flash_ret != UFFS_FLASH_IO_ERR) { - // check spare data, should be all 0xFF - for (i = 0, p = spare; i < dev->attr->spare_size; i++, p++) { - if (*p != 0xFF) { - ret = U_FAIL; - goto ext; - } - } - } - } - - if (flash_ret != UFFS_FLASH_IO_ERR) { - // check page data, should be all 0xFF - for (i = 0, p = buf->header; i < size; i++, p++) { - if (*p != 0xFF) { - ret = U_FAIL; - goto ext; - } - } - } - - } - - -ext: - if (spare) - uffs_PoolPut(SPOOL(dev), spare); - - if (buf) - uffs_BufFreeClone(dev, buf); - - - return ret; -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_fs.c b/components/dfs/filesystems/uffs/src/uffs/uffs_fs.c deleted file mode 100644 index d467c3ec97..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_fs.c +++ /dev/null @@ -1,1944 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_fs.c - * \brief basic file operations - * \author Ricky Zheng, created 12th May, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_pool.h" -#include "uffs/uffs_ecc.h" -#include "uffs/uffs_badblock.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_utils.h" -#include -#include - -#define PFX "fs : " - -#define GET_OBJ_NODE_SERIAL(obj) \ - ( \ - (obj)->type == UFFS_TYPE_DIR ? \ - (obj)->node->u.dir.serial : (obj)->node->u.file.serial \ - ) - -#define GET_OBJ_NODE_FATHER(obj) \ - ( \ - (obj)->type == UFFS_TYPE_DIR ? \ - (obj)->node->u.dir.parent : (obj)->node->u.file.parent \ - ) - -#define GET_SERIAL_FROM_OBJECT(obj) \ - ((obj)->node ? GET_OBJ_NODE_SERIAL(obj) : obj->serial) - -#define GET_FATHER_FROM_OBJECT(obj) \ - ((obj)->node ? GET_OBJ_NODE_FATHER(obj) : obj->parent) - - -#define GET_BLOCK_FROM_NODE(obj) \ - ( \ - (obj)->type == UFFS_TYPE_DIR ? \ - (obj)->node->u.dir.block : (obj)->node->u.file.block \ - ) - -typedef enum { - eDRY_RUN = 0, - eREAL_RUN, -} RunOptionE; - - -static void do_ReleaseObjectResource(uffs_Object *obj); -static URET do_TruncateObject(uffs_Object *obj, u32 remain, RunOptionE run_opt); - - -static int _object_data[(sizeof(struct uffs_ObjectSt) * MAX_OBJECT_HANDLE) / sizeof(int)]; - -static uffs_Pool _object_pool; - - -uffs_Pool * uffs_GetObjectPool(void) -{ - return &_object_pool; -} - -/** - * initialise object buffers, called by UFFS internal - */ -URET uffs_InitObjectBuf(void) -{ - return uffs_PoolInit(&_object_pool, _object_data, sizeof(_object_data), - sizeof(uffs_Object), MAX_OBJECT_HANDLE); -} - -/** - * Release object buffers, called by UFFS internal - */ -URET uffs_ReleaseObjectBuf(void) -{ - return uffs_PoolRelease(&_object_pool); -} - -/** - * Get free object handlers - */ -int uffs_GetFreeObjectHandlers(void) -{ - int count = 0; - - uffs_GlobalFsLockLock(); - count = uffs_PoolGetFreeCount(&_object_pool); - uffs_GlobalFsLockUnlock(); - - return count; -} - -/** - * Put all object which match dev - */ -int uffs_PutAllObjectBuf(uffs_Device *dev) -{ - int count = 0; - uffs_Object * obj = NULL; - - do { - obj = (uffs_Object *) uffs_PoolFindNextAllocated(&_object_pool, (void *)obj); - if (obj && obj->dev && obj->dev->dev_num == dev->dev_num) { - uffs_PutObject(obj); - count++; - } - } while (obj); - - return count; -} - -/** - * alloc a new object structure - * \return the new object - */ -uffs_Object * uffs_GetObject(void) -{ - uffs_Object * obj; - - obj = (uffs_Object *) uffs_PoolGet(&_object_pool); - if (obj) { - memset(obj, 0, sizeof(uffs_Object)); - obj->attr_loaded = U_FALSE; - obj->open_succ = U_FALSE; - } - - return obj; -} - -/** - * re-initialize an object. - * - * \return U_SUCC or U_FAIL if the object is openned. - */ -URET uffs_ReInitObject(uffs_Object *obj) -{ - if (obj == NULL) - return U_FAIL; - - if (obj->open_succ == U_TRUE) - return U_FAIL; // can't re-init an openned object. - - memset(obj, 0, sizeof(uffs_Object)); - obj->attr_loaded = U_FALSE; - obj->open_succ = U_FALSE; - - return U_SUCC; -} - -/** - * put the object struct back to system - */ -void uffs_PutObject(uffs_Object *obj) -{ - if (obj) - uffs_PoolPut(&_object_pool, obj); -} - -/** - * \return the internal index num of object - */ -int uffs_GetObjectIndex(uffs_Object *obj) -{ - return uffs_PoolGetIndex(&_object_pool, obj); -} - -/** - * \return the object by the internal index - */ -uffs_Object * uffs_GetObjectByIndex(int idx) -{ - return (uffs_Object *) uffs_PoolGetBufByIndex(&_object_pool, idx); -} - -#ifdef CONFIG_PER_DEVICE_LOCK -static void uffs_ObjectDevLock(uffs_Object *obj) -{ - if (obj) { - if (obj->dev) { - uffs_DeviceLock(obj->dev); - obj->dev_lock_count++; - } - } -} - -static void uffs_ObjectDevUnLock(uffs_Object *obj) -{ - if (obj) { - if (obj->dev) { - obj->dev_lock_count--; - uffs_DeviceUnLock(obj->dev); - } - } -} -#else -#define uffs_ObjectDevLock(obj) do { } while (0) -#define uffs_ObjectDevUnLock(obj) do { } while (0) - -#endif - - - -/** - * create a new object and open it if success - */ -URET uffs_CreateObject(uffs_Object *obj, const char *fullname, int oflag) -{ - URET ret = U_FAIL; - - oflag |= UO_CREATE; - - if (uffs_ParseObject(obj, fullname) == U_SUCC) - uffs_CreateObjectEx(obj, obj->dev, obj->parent, - obj->name, obj->name_len, oflag); - - if (obj->err == UENOERR) { - ret = U_SUCC; - } - else { - if (obj->dev) { - uffs_PutDevice(obj->dev); - obj->dev = NULL; - } - ret = U_FAIL; - } - - return ret; -} - - - -/** - * return the dir length from a path. - * for example, path = "abc/def/xyz", return 8 ("abc/def/") - */ -static int GetDirLengthFromPath(const char *path, int path_len) -{ - const char *p = path; - - if (path_len > 0) { - if (path[path_len - 1] == '/') - path_len--; // skip the last '/' - - p = path + path_len - 1; - while (p > path && *p != '/') - p--; - } - - return p - path; -} - -/** - * Create an object under the given dir. - * - * \param[in|out] obj to be created, obj is returned from uffs_GetObject() - * \param[in] dev uffs device - * \param[in] dir object parent dir serial NO. - * \param[in] name point to the object name - * \param[in] name_len object name length - * \param[in] oflag open flag. UO_DIR should be passed for an dir object. - * - * \return U_SUCC or U_FAIL (error code in obj->err). - */ -URET uffs_CreateObjectEx(uffs_Object *obj, uffs_Device *dev, - int dir, const char *name, int name_len, int oflag) -{ - uffs_Buf *buf = NULL; - uffs_FileInfo fi; - TreeNode *node; - - obj->dev = dev; - obj->parent = dir; - obj->type = (oflag & UO_DIR ? UFFS_TYPE_DIR : UFFS_TYPE_FILE); - obj->name = name; - obj->name_len = name_len; - - if (obj->type == UFFS_TYPE_DIR) { - if (name[obj->name_len - 1] == '/') // get rid of ending '/' for dir - obj->name_len--; - } - else { - if (name[obj->name_len - 1] == '/') { // file name can't end with '/' - obj->err = UENOENT; - goto ext; - } - } - - if (obj->name_len == 0) { // empty name ? - obj->err = UENOENT; - goto ext; - } - - obj->sum = uffs_MakeSum16(obj->name, obj->name_len); - - uffs_ObjectDevLock(obj); - - if (obj->type == UFFS_TYPE_DIR) { - //find out whether have file with the same name - node = uffs_TreeFindFileNodeByName(obj->dev, obj->name, - obj->name_len, obj->sum, - obj->parent); - if (node != NULL) { - obj->err = UEEXIST; // we can't create a dir has the - // same name with exist file. - goto ext_1; - } - obj->node = uffs_TreeFindDirNodeByName(obj->dev, obj->name, - obj->name_len, obj->sum, - obj->parent); - if (obj->node != NULL) { - obj->err = UEEXIST; // we can't create a dir already exist. - goto ext_1; - } - } - else { - //find out whether have dir with the same name - node = uffs_TreeFindDirNodeByName(obj->dev, obj->name, - obj->name_len, obj->sum, - obj->parent); - if (node != NULL) { - obj->err = UEEXIST; - goto ext_1; - } - obj->node = uffs_TreeFindFileNodeByName(obj->dev, obj->name, - obj->name_len, obj->sum, - obj->parent); - if (obj->node) { - /* file already exist, truncate it to zero length */ - obj->serial = GET_OBJ_NODE_SERIAL(obj); - obj->open_succ = U_TRUE; // set open_succ to U_TRUE before - // call do_TruncateObject() - if (do_TruncateObject(obj, 0, eDRY_RUN) == U_SUCC) - do_TruncateObject(obj, 0, eREAL_RUN); - goto ext_1; - } - } - - /* dir|file does not exist, create a new one */ - obj->serial = uffs_FindFreeFsnSerial(obj->dev); - if (obj->serial == INVALID_UFFS_SERIAL) { - uffs_Perror(UFFS_MSG_SERIOUS, "No free serial num!"); - obj->err = UENOMEM; - goto ext_1; - } - - if (obj->dev->tree.erased_count < obj->dev->cfg.reserved_free_blocks) { - uffs_Perror(UFFS_MSG_NOISY, - "insufficient block in create obj"); - obj->err = UENOMEM; - goto ext_1; - } - - buf = uffs_BufNew(obj->dev, obj->type, obj->parent, obj->serial, 0); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "Can't create new buffer when create obj!"); - goto ext_1; - } - - memset(&fi, 0, sizeof(uffs_FileInfo)); - fi.name_len = obj->name_len < sizeof(fi.name) ? obj->name_len : sizeof(fi.name) - 1; - memcpy(fi.name, obj->name, fi.name_len); - fi.name[fi.name_len] = '\0'; - - fi.access = 0; - fi.attr |= FILE_ATTR_WRITE; - - if (obj->type == UFFS_TYPE_DIR) - fi.attr |= FILE_ATTR_DIR; - - fi.create_time = fi.last_modify = uffs_GetCurDateTime(); - - uffs_BufWrite(obj->dev, buf, &fi, 0, sizeof(uffs_FileInfo)); - uffs_BufPut(obj->dev, buf); - - // flush buffer immediately, - // so that the new node will be inserted into the tree - uffs_BufFlushGroup(obj->dev, obj->parent, obj->serial); - - // update obj->node: after buf flushed, - // the NEW node can be found in the tree - if (obj->type == UFFS_TYPE_DIR) - obj->node = uffs_TreeFindDirNode(obj->dev, obj->serial); - else - obj->node = uffs_TreeFindFileNode(obj->dev, obj->serial); - - if (obj->node == NULL) { - uffs_Perror(UFFS_MSG_NOISY, "Can't find the node in the tree ?"); - obj->err = UEIOERR; - goto ext_1; - } - - if (obj->type == UFFS_TYPE_FILE) - obj->node->u.file.len = 0; //init the length to 0 - - if (HAVE_BADBLOCK(obj->dev)) - uffs_BadBlockRecover(obj->dev); - - obj->open_succ = U_TRUE; - -ext_1: - uffs_ObjectDevUnLock(obj); -ext: - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - -/** - * Open object under the given dir. - * - * \param[in|out] obj to be open, obj is returned from uffs_GetObject() - * \param[in] dev uffs device - * \param[in] dir object parent dir serial NO. - * \param[in] name point to the object name - * \param[in] name_len object name length - * \param[in] oflag open flag. UO_DIR should be passed for an dir object. - * - * \return U_SUCC or U_FAIL (error code in obj->err). - */ -URET uffs_OpenObjectEx(uffs_Object *obj, uffs_Device *dev, - int dir, const char *name, int name_len, int oflag) -{ - - obj->err = UENOERR; - obj->open_succ = U_FALSE; - - if (dev == NULL) { - obj->err = UEINVAL; - goto ext; - } - - if ((oflag & (UO_WRONLY | UO_RDWR)) == (UO_WRONLY | UO_RDWR)) { - /* UO_WRONLY and UO_RDWR can't appear together */ - uffs_Perror(UFFS_MSG_NOISY, - "UO_WRONLY and UO_RDWR can't appear together"); - obj->err = UEINVAL; - goto ext; - } - - obj->oflag = oflag; - obj->parent = dir; - obj->type = (oflag & UO_DIR ? UFFS_TYPE_DIR : UFFS_TYPE_FILE); - obj->pos = 0; - obj->dev = dev; - obj->name = name; - obj->name_len = name_len; - - // adjust the name length - if (obj->type == UFFS_TYPE_DIR) { - if (obj->name_len > 0 && name[obj->name_len - 1] == '/') - obj->name_len--; // truncate the ending '/' for dir - } - - obj->sum = (obj->name_len > 0 ? uffs_MakeSum16(name, obj->name_len) : 0); - obj->head_pages = obj->dev->attr->pages_per_block - 1; - - if (obj->type == UFFS_TYPE_DIR) { - if (obj->name_len == 0) { - if (dir != PARENT_OF_ROOT) { - uffs_Perror(UFFS_MSG_SERIOUS, "Bad parent for root dir!"); - obj->err = UEINVAL; - } - else { - obj->serial = ROOT_DIR_SERIAL; - } - goto ext; - } - } - else { - if (obj->name_len == 0 || name[obj->name_len - 1] == '/') { - uffs_Perror(UFFS_MSG_SERIOUS, "Bad file name."); - obj->err = UEINVAL; - } - } - - - uffs_ObjectDevLock(obj); - - if (obj->type == UFFS_TYPE_DIR) { - obj->node = uffs_TreeFindDirNodeByName(obj->dev, obj->name, - obj->name_len, obj->sum, - obj->parent); - } - else { - obj->node = uffs_TreeFindFileNodeByName(obj->dev, obj->name, - obj->name_len, obj->sum, - obj->parent); - } - - if (obj->node == NULL) { // dir or file not exist - if (obj->oflag & UO_CREATE) { // expect to create a new one - uffs_ObjectDevUnLock(obj); - if (obj->name == NULL || obj->name_len == 0) - obj->err = UEEXIST; - else - uffs_CreateObjectEx(obj, dev, dir, obj->name, obj->name_len, oflag); - goto ext; - } - else { - obj->err = UENOENT; - goto ext_1; - } - } - - if ((obj->oflag & (UO_CREATE | UO_EXCL)) == (UO_CREATE | UO_EXCL)){ - obj->err = UEEXIST; - goto ext_1; - } - - obj->serial = GET_OBJ_NODE_SERIAL(obj); - obj->open_succ = U_TRUE; - - if (obj->oflag & UO_TRUNC) - if (do_TruncateObject(obj, 0, eDRY_RUN) == U_SUCC) { - //NOTE: obj->err will be set in do_TruncateObject() if failed. - do_TruncateObject(obj, 0, eREAL_RUN); - } - -ext_1: - uffs_ObjectDevUnLock(obj); -ext: - obj->open_succ = (obj->err == UENOERR ? U_TRUE : U_FALSE); - - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - - -/** - * Parse the full path name, initialize obj. - * - * \param[out] obj object to be initialize. - * \param[in] name full path name. - * - * \return U_SUCC if the name is parsed correctly, - * U_FAIL if failed, and obj->err is set. - * - * \note the following fields in obj will be initialized: - * obj->dev - * obj->parent - * obj->name - * obj->name_len - */ -URET uffs_ParseObject(uffs_Object *obj, const char *name) -{ - int len, m_len, d_len; - uffs_Device *dev; - const char *start, *p, *dname; - u16 dir; - TreeNode *node; - u16 sum; - - if (uffs_ReInitObject(obj) == U_FAIL) - return U_FAIL; - - len = strlen(name); - m_len = uffs_GetMatchedMountPointSize(name); - dev = uffs_GetDeviceFromMountPointEx(name, m_len); - - if (dev) { - start = name + m_len; - d_len = GetDirLengthFromPath(start, len - m_len); - p = start; - obj->dev = dev; - if (m_len == len) { - obj->parent = PARENT_OF_ROOT; - obj->name = NULL; - obj->name_len = 0; - } - else { - dir = ROOT_DIR_SERIAL; - dname = start; - while (p - start < d_len) { - while (*p != '/') p++; - sum = uffs_MakeSum16(dname, p - dname); - node = uffs_TreeFindDirNodeByName(dev, dname, p - dname, sum, dir); - if (node == NULL) { - obj->err = UENOENT; - break; - } - else { - dir = node->u.dir.serial; - p++; // skip the '/' - dname = p; - } - } - obj->parent = dir; - obj->name = start + (d_len > 0 ? d_len + 1 : 0); - obj->name_len = len - (d_len > 0 ? d_len + 1 : 0) - m_len; - } - - if (obj->err != UENOERR) { - uffs_PutDevice(obj->dev); - obj->dev = NULL; - } - } - else { - obj->err = UENOENT; - } - - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - - -static void do_ReleaseObjectResource(uffs_Object *obj) -{ - if (obj) { - if (obj->dev) { - if (HAVE_BADBLOCK(obj->dev)) - uffs_BadBlockRecover(obj->dev); - if (obj->dev_lock_count > 0) { - uffs_ObjectDevUnLock(obj); - } - uffs_PutDevice(obj->dev); - obj->dev = NULL; - obj->open_succ = U_FALSE; - } - } -} - -/** - * Open a UFFS object - * - * \param[in|out] obj the object to be open - * \param[in] name the full name of the object - * \param[in] oflag open flag - * - * \return U_SUCC if object is opened successfully, - * U_FAIL if failed, error code will be set to obj->err. - */ -URET uffs_OpenObject(uffs_Object *obj, const char *name, int oflag) -{ - URET ret; - - if (obj == NULL) - return U_FAIL; - - if ((ret = uffs_ParseObject(obj, name)) == U_SUCC) { - ret = uffs_OpenObjectEx(obj, obj->dev, obj->parent, - obj->name, obj->name_len, oflag); - } - if (ret != U_SUCC) - do_ReleaseObjectResource(obj); - - return ret; -} - -static URET do_FlushObject(uffs_Object *obj) -{ - uffs_Device *dev; - URET ret = U_SUCC; - TreeNode *node = NULL; - - dev = obj->dev; - if (obj->node) { - node = obj->node; - if (obj->type == UFFS_TYPE_DIR) - ret = uffs_BufFlushGroup(dev, obj->node->u.dir.parent, - obj->node->u.dir.serial); - else { - ret = ( - uffs_BufFlushGroupMatchParent(dev, obj->node->u.file.serial) == U_SUCC && - uffs_BufFlushGroup(dev, obj->node->u.file.parent, obj->node->u.file.serial) == U_SUCC - ) ? U_SUCC : U_FAIL; - } - uffs_Assert(node == obj->node, "obj->node change!\n"); - } - - return ret; -} - -/** - * Flush object data. - * - * \param[in] obj object to be flushed - * \return U_SUCC or U_FAIL (error code in obj->err). - */ -URET uffs_FlushObject(uffs_Object *obj) -{ - if(obj->dev == NULL || obj->open_succ != U_TRUE) { - obj->err = UEBADF; - goto ext; - } - - uffs_ObjectDevLock(obj); - - if (do_FlushObject(obj) != U_SUCC) - obj->err = UEIOERR; - - uffs_ObjectDevUnLock(obj); - -ext: - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - -/** - * Close an openned object. - * - * \param[in] obj object to be closed - * \return U_SUCC or U_FAIL (error code in obj->err). - */ -URET uffs_CloseObject(uffs_Object *obj) -{ -#ifdef CONFIG_CHANGE_MODIFY_TIME - uffs_Device *dev; - uffs_Buf *buf; - uffs_FileInfo fi; -#endif - - if(obj->dev == NULL || obj->open_succ != U_TRUE) { - obj->err = UEBADF; - goto ext; - } - - - uffs_ObjectDevLock(obj); - - if (obj->oflag & (UO_WRONLY|UO_RDWR|UO_APPEND|UO_CREATE|UO_TRUNC)) { - -#ifdef CONFIG_CHANGE_MODIFY_TIME - dev = obj->dev; - if (obj->node) { - //need to change the last modify time stamp - if (obj->type == UFFS_TYPE_DIR) - buf = uffs_BufGetEx(dev, UFFS_TYPE_DIR, obj->node, 0, obj->oflag); - else - buf = uffs_BufGetEx(dev, UFFS_TYPE_FILE, obj->node, 0, obj->oflag); - - if(buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get file header"); - do_FlushObject(obj); - uffs_ObjectDevUnLock(obj); - goto ext; - } - uffs_BufRead(dev, buf, &fi, 0, sizeof(uffs_FileInfo)); - fi.last_modify = uffs_GetCurDateTime(); - uffs_BufWrite(dev, buf, &fi, 0, sizeof(uffs_FileInfo)); - uffs_BufPut(dev, buf); - } -#endif - do_FlushObject(obj); - } - - uffs_ObjectDevUnLock(obj); - -ext: - do_ReleaseObjectResource(obj); - - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - -static u16 GetFdnByOfs(uffs_Object *obj, u32 ofs) -{ - uffs_Device *dev = obj->dev; - - if (ofs < (u32)(obj->head_pages * dev->com.pg_data_size)) { - return 0; - } - else { - ofs -= obj->head_pages * dev->com.pg_data_size; - return (ofs / (dev->com.pg_data_size * dev->attr->pages_per_block)) + 1; - } -} - - -static u32 GetStartOfDataBlock(uffs_Object *obj, u16 fdn) -{ - if (fdn == 0) { - return 0; - } - else { - return (obj->head_pages * obj->dev->com.pg_data_size) + - (fdn - 1) * (obj->dev->com.pg_data_size * - obj->dev->attr->pages_per_block); - } -} - - -static int do_WriteNewBlock(uffs_Object *obj, - const void *data, u32 len, - u16 parent, - u16 serial) -{ - uffs_Device *dev = obj->dev; - u16 page_id; - int wroteSize = 0; - int size; - uffs_Buf *buf; - URET ret; - - for (page_id = 0; page_id < dev->attr->pages_per_block; page_id++) { - size = (len - wroteSize) > dev->com.pg_data_size ? - dev->com.pg_data_size : len - wroteSize; - if (size <= 0) - break; - - buf = uffs_BufNew(dev, UFFS_TYPE_DATA, parent, serial, page_id); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't create a new page ?"); - break; - } - // Note: if data == NULL, we will fill '\0' - ret = uffs_BufWrite(dev, buf, data == NULL ? NULL : (u8 *)data + wroteSize, 0, size); - uffs_BufPut(dev, buf); - - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "write data fail!"); - break; - } - wroteSize += size; - obj->node->u.file.len += size; - } - - return wroteSize; -} - -static int do_WriteInternalBlock(uffs_Object *obj, - TreeNode *node, - u16 fdn, - const void *data, - u32 len, - u32 blockOfs) -{ - uffs_Device *dev = obj->dev; - u16 maxPageID; - u16 page_id; - u32 size; - u32 pageOfs; - u32 wroteSize = 0; - URET ret; - uffs_Buf *buf; - u32 block_start; - u8 type; - u16 parent, serial; - - block_start = GetStartOfDataBlock(obj, fdn); - - if (fdn == 0) { - type = UFFS_TYPE_FILE; - parent = node->u.file.parent; - serial = node->u.file.serial; - } - else { - type = UFFS_TYPE_DATA; - parent = node->u.data.parent; - serial = fdn; - } - - if (fdn == 0) - maxPageID = obj->head_pages; - else - maxPageID = dev->attr->pages_per_block - 1; - - - while (wroteSize < len) { - page_id = blockOfs / dev->com.pg_data_size; - if (fdn == 0) - page_id++; //in file header, page_id start from 1, not 0. - if (page_id > maxPageID) - break; - - pageOfs = blockOfs % dev->com.pg_data_size; - size = (len - wroteSize + pageOfs) > dev->com.pg_data_size ? - (dev->com.pg_data_size - pageOfs) : (len - wroteSize); - - if ((obj->node->u.file.len % dev->com.pg_data_size) == 0 && - (blockOfs + block_start) == obj->node->u.file.len) { - - buf = uffs_BufNew(dev, type, parent, serial, page_id); - - if(buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can create a new buf!"); - break; - } - } - else { - buf = uffs_BufGetEx(dev, type, node, page_id, obj->oflag); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get buffer ?"); - break; - } - } - - // Note: if data == NULL, then we will fill '\0' - ret = uffs_BufWrite(dev, buf, data == NULL ? NULL : (u8 *)data + wroteSize, pageOfs, size); - - uffs_BufPut(dev, buf); - - if (ret == U_FAIL) { - uffs_Perror(UFFS_MSG_SERIOUS, "write inter data fail!"); - break; - } - - wroteSize += size; - blockOfs += size; - - if (block_start + blockOfs > obj->node->u.file.len) - obj->node->u.file.len = block_start + blockOfs; - - } - - return wroteSize; -} - - -/** - * write data to obj, return remain data (0 if all data been written). - */ -static int do_WriteObject(uffs_Object *obj, const void *data, int len) -{ - uffs_Device *dev = obj->dev; - TreeNode *fnode = obj->node; - int remain = len; - u16 fdn; - u32 write_start; - TreeNode *dnode; - u32 size; - - while (remain > 0) { - write_start = obj->pos + len - remain; - if (write_start > fnode->u.file.len) { - uffs_Perror(UFFS_MSG_SERIOUS, "write point out of file ?"); - break; - } - - fdn = GetFdnByOfs(obj, write_start); - - if (write_start == fnode->u.file.len && fdn > 0 && - write_start == GetStartOfDataBlock(obj, fdn)) { - if (dev->tree.erased_count < dev->cfg.reserved_free_blocks) { - uffs_Perror(UFFS_MSG_NOISY, "insufficient block in write obj, new block"); - break; - } - size = do_WriteNewBlock(obj, data ? (u8 *)data + len - remain : NULL, - remain, fnode->u.file.serial, fdn); - - // - // Flush the new block buffers immediately, so that the new data node will be - // created and put in the tree. - // - // But before do that, we need to make sure the previous - // data block (if exist) been flushed first. - // - if (fdn > 1) { - uffs_BufFlushGroup(dev, fnode->u.file.serial, fdn - 1); - } - else { - uffs_BufFlushGroup(dev, fnode->u.file.parent, fnode->u.file.serial); - } - // Now flush the new block. - uffs_BufFlushGroup(dev, fnode->u.file.serial, fdn); - - if (size == 0) - break; - - remain -= size; - } - else { - - if(fdn == 0) - dnode = obj->node; - else - dnode = uffs_TreeFindDataNode(dev, fnode->u.file.serial, fdn); - - if(dnode == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't find data node in tree ?"); - obj->err = UEUNKNOWN_ERR; - break; - } - size = do_WriteInternalBlock(obj, dnode, fdn, - data ? (u8 *)data + len - remain : NULL, remain, - write_start - GetStartOfDataBlock(obj, fdn)); -#ifdef CONFIG_FLUSH_BUF_AFTER_WRITE - if (fdn == 0) - uffs_BufFlushGroup(dev, fnode->u.file.parent, fnode->u.file.serial); - else - uffs_BufFlushGroup(dev, fnode->u.file.serial, fdn); -#endif - if (size == 0) - break; - - remain -= size; - } - } - - uffs_Assert(fnode == obj->node, "obj->node change!\n"); - - return remain; -} - - -/** - * write data to obj, from obj->pos - * - * \param[in] obj file obj - * \param[in] data data pointer - * \param[in] len length of data to be write - * - * \return bytes wrote to obj - */ -int uffs_WriteObject(uffs_Object *obj, const void *data, int len) -{ - uffs_Device *dev = obj->dev; - TreeNode *fnode = NULL; - int remain; - u32 pos; - int wrote = 0; - - if (obj == NULL) - return 0; - - if (obj->dev == NULL || obj->open_succ != U_TRUE) { - obj->err = UEBADF; - return 0; - } - - if (obj->type == UFFS_TYPE_DIR) { - uffs_Perror(UFFS_MSG_NOISY, "Can't write to an dir object!"); - obj->err = UEACCES; - return 0; - } - - if (obj->oflag == UO_RDONLY) { - obj->err = UEACCES; // can't write to 'read only' mode opened file - return 0; - } - - fnode = obj->node; - - uffs_ObjectDevLock(obj); - - if (obj->oflag & UO_APPEND) - obj->pos = fnode->u.file.len; - else { - if (obj->pos > fnode->u.file.len) { - // current pos pass over the end of file, need to fill the gap with '\0' - pos = obj->pos; // save desired pos - obj->pos = fnode->u.file.len; // filling gap from the end of the file. - remain = do_WriteObject(obj, NULL, pos - fnode->u.file.len); // Write filling bytes. Note: the filling data does not count as 'wrote' in this write operation. - obj->pos = pos - remain; - if (remain > 0) // fail to fill the gap ? stop. - goto ext; - } - } - - remain = do_WriteObject(obj, data, len); - wrote = len - remain; - obj->pos += wrote; - -ext: - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockRecover(dev); - - uffs_ObjectDevUnLock(obj); - - uffs_Assert(fnode == obj->node, "obj->node change!\n"); - - return wrote; -} - -/** - * read data from obj - * - * \param[in] obj uffs object - * \param[out] data output data buffer - * \param[in] len required length of data to be read from object->pos - * - * \return return bytes of data have been read - */ -int uffs_ReadObject(uffs_Object *obj, void *data, int len) -{ - uffs_Device *dev = obj->dev; - TreeNode *fnode = NULL; - u32 remain = len; - u16 fdn; - u32 read_start; - TreeNode *dnode; - u32 size; - uffs_Buf *buf; - u32 blockOfs; - u16 page_id; - u8 type; - u32 pageOfs; - - if (obj == NULL) - return 0; - - fnode = obj->node; - - if (obj->dev == NULL || obj->open_succ == U_FALSE) { - obj->err = UEBADF; - return 0; - } - - if (obj->type == UFFS_TYPE_DIR) { - uffs_Perror(UFFS_MSG_NOISY, "Can't read data from a dir object!"); - obj->err = UEBADF; - return 0; - } - - if (obj->pos > fnode->u.file.len) { - return 0; //can't read file out of range - } - - if (obj->oflag & UO_WRONLY) { - obj->err = UEACCES; - return 0; - } - - uffs_ObjectDevLock(obj); - - while (remain > 0) { - read_start = obj->pos + len - remain; - if (read_start >= fnode->u.file.len) { - //uffs_Perror(UFFS_MSG_NOISY, "read point out of file ?"); - break; - } - - fdn = GetFdnByOfs(obj, read_start); - if (fdn == 0) { - dnode = obj->node; - type = UFFS_TYPE_FILE; - } - else { - type = UFFS_TYPE_DATA; - dnode = uffs_TreeFindDataNode(dev, fnode->u.file.serial, fdn); - if (dnode == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get data node in entry!"); - obj->err = UEUNKNOWN_ERR; - break; - } - } - - blockOfs = GetStartOfDataBlock(obj, fdn); - page_id = (read_start - blockOfs) / dev->com.pg_data_size; - - if (fdn == 0) { - /** - * fdn == 0: this means that the reading is start from the first block, - * since the page 0 is for file attr, so we move to the next page ID. - */ - page_id++; - } - - buf = uffs_BufGetEx(dev, type, dnode, (u16)page_id, obj->oflag); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get buffer when read obj."); - obj->err = UEIOERR; - break; - } - - pageOfs = read_start % dev->com.pg_data_size; - if (pageOfs >= buf->data_len) { - //uffs_Perror(UFFS_MSG_NOISY, "read data out of page range ?"); - uffs_BufPut(dev, buf); - break; - } - size = (remain + pageOfs > buf->data_len ? buf->data_len - pageOfs : remain); - - uffs_BufRead(dev, buf, (u8 *)data + len - remain, pageOfs, size); - uffs_BufPut(dev, buf); - - remain -= size; - } - - obj->pos += (len - remain); - - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockRecover(dev); - - uffs_ObjectDevUnLock(obj); - - uffs_Assert(fnode == obj->node, "obj->node change!\n"); - - return len - remain; -} - -/** - * move the file pointer - * - * \param[in] obj uffs object - * \param[in] offset offset from origin - * \param[in] origin the origin position, one of: - * #USEEK_CUR, #USEEK_SET or #USEEK_END - * - * \return the new file pointer position if success, - * or -1 if the new position would be negative. - */ -long uffs_SeekObject(uffs_Object *obj, long offset, int origin) -{ - if (obj->type == UFFS_TYPE_DIR) { - uffs_Perror(UFFS_MSG_NOISY, "Can't seek a dir object!"); - obj->err = UEACCES; - } - else { - uffs_ObjectDevLock(obj); - switch (origin) { - case USEEK_CUR: - if ((long)obj->pos + offset < 0) { - obj->err = UEINVAL; - } - else { - obj->pos += offset; - } - break; - case USEEK_SET: - if (offset < 0) { - obj->err = UEINVAL; - } - else { - obj->pos = offset; - } - break; - case USEEK_END: - if ((long)obj->node->u.file.len + offset < 0) { - obj->err = UEINVAL; - } - else { - obj->pos = obj->node->u.file.len + offset; - } - break; - } - uffs_ObjectDevUnLock(obj); - } - - return (obj->err == UENOERR ? (long)obj->pos : -1); -} - -/** - * get current file pointer - * - * \param[in] obj uffs object - * - * \return return the file pointer position if the obj is valid, - * return -1 if obj is invalid. - */ -int uffs_GetCurOffset(uffs_Object *obj) -{ - if (obj) { - if (obj->dev && obj->open_succ == U_TRUE) - return obj->pos; - } - return -1; -} - -/** - * check whether the file pointer is at the end of file - * - * \param[in] obj uffs object - * - * \return return 1 if file pointer is at the end of file, - * return -1 if error occur, else return 0. - */ -int uffs_EndOfFile(uffs_Object *obj) -{ - if (obj) { - if (obj->dev && obj->type == UFFS_TYPE_FILE && obj->open_succ == U_TRUE) { - if (obj->pos >= obj->node->u.file.len) { - return 1; - } - else { - return 0; - } - } - } - - return -1; -} - -// -// To trancate the file, this is the last block to be trancated. -// We need to discard one or more pages within this block, hence requires 'block recover'. -// -static URET do_TruncateInternalWithBlockRecover(uffs_Object *obj, - u16 fdn, u32 remain, RunOptionE run_opt) -{ - uffs_Device *dev = obj->dev; - TreeNode *fnode = obj->node; - u16 page_id, max_page_id; - TreeNode *node; - uffs_Buf *buf = NULL; - u8 type; - u32 block_start; - u16 parent, serial; - int slot; - uffs_BlockInfo *bc = NULL; - int block = -1; - - if (fdn == 0) { - node = fnode; - type = UFFS_TYPE_FILE; - max_page_id = obj->head_pages; - block_start = 0; - parent = node->u.file.parent; - serial = node->u.file.serial; - block = node->u.file.block; - } - else { - node = uffs_TreeFindDataNode(dev, fnode->u.file.serial, fdn); - if (node == NULL) { - obj->err = UEIOERR; - uffs_Perror(UFFS_MSG_SERIOUS, - "can't find data node when truncate obj"); - goto ext; - } - block = node->u.data.block; - type = UFFS_TYPE_DATA; - max_page_id = dev->attr->pages_per_block - 1; - block_start = obj->head_pages * dev->com.pg_data_size + - (fdn - 1) * dev->com.pg_data_size * - dev->attr->pages_per_block; - parent = node->u.data.parent; - serial = node->u.data.serial; - } - - if (run_opt == eDRY_RUN) { - // checking the buffer. this is the main reason why we need the 'dry run' mode. - for (page_id = 0; page_id <= max_page_id; page_id++) { - buf = uffs_BufFind(dev, parent, serial, page_id); - if (buf) { - //!< ok, the buffer was loaded before ... - if (uffs_BufIsFree(buf) == U_FALSE) { - obj->err = UEEXIST; - break; //!< and someone is still holding the buffer, - // can't truncate it !!! - } - } - } - buf = NULL; - goto ext; - } - - // find the last page *after* truncate - for (page_id = (fdn == 0 ? 1 : 0); page_id <= max_page_id; page_id++) { - if (block_start + (page_id + 1) * dev->com.pg_data_size >= remain) - break; - } - - if (!uffs_Assert(page_id <= max_page_id, "fdn = %d, block_start = %d, remain = %d\n", fdn, block_start, remain)) { - obj->err = UEUNKNOWN_ERR; - goto ext; - } - - // flush buffer before performing block recovery - uffs_BufFlushGroup(dev, parent, serial); - - // load the last page - buf = uffs_BufGetEx(dev, type, node, page_id, obj->oflag); - if (buf == NULL) { - obj->err = UENOMEM; - uffs_Perror(UFFS_MSG_SERIOUS, "Can't get buf"); - goto ext; - } - - uffs_BufWrite(dev, buf, NULL, 0, 0); // just make this buf dirty - - // lock the group - slot = uffs_BufFindGroupSlot(dev, parent, serial); - uffs_BufLockGroup(dev, slot); - - if (remain == 0) // remain == 0: means discard all data in this block. - buf->data_len = 0; - else { - remain = (remain % dev->com.pg_data_size); - // remain == 0: means that we need to keep all data in this page. - buf->data_len = (remain == 0 ? dev->com.pg_data_size : remain); - } - - /* mark this buf as UFFS_BUF_EXT_MARK_TRUNC_TAIL, when flushing - dirty buffers, UFFS will not do page recover for pages after - this buf page id (because this file is ended at this page) */ - buf->ext_mark |= UFFS_BUF_EXT_MARK_TRUNC_TAIL; - - uffs_BufPut(dev, buf); - - // invalidate the rest page buf - page_id++; - for (; page_id <= max_page_id; page_id++) { - buf = uffs_BufFind(dev, parent, serial, page_id); - if (buf) - uffs_BufMarkEmpty(dev, buf); - } - - // flush dirty buffer immediately, forcing block recovery. - uffs_BufFlushGroupEx(dev, parent, serial, U_TRUE); - - // unlock the group - uffs_BufUnLockGroup(dev, slot); - - // Invalidate block info cache for the 'old' block - bc = uffs_BlockInfoGet(dev, block); - if (bc) { - uffs_BlockInfoExpire(dev, bc, UFFS_ALL_PAGES); - uffs_BlockInfoPut(dev, bc); - } - -ext: - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - -/** - * truncate an object - * - * \param[in] obj object to be truncated - * \param[in] remain data bytes to be remained in this object - * - * \return U_SUCC or U_FAIL (error code in obj->err) - */ -URET uffs_TruncateObject(uffs_Object *obj, u32 remain) -{ - uffs_ObjectDevLock(obj); - if (do_TruncateObject(obj, remain, eDRY_RUN) == U_SUCC) - do_TruncateObject(obj, remain, eREAL_RUN); - uffs_ObjectDevUnLock(obj); - - uffs_FlushObject(obj); - - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - -/** truncate obj without lock device */ -static URET do_TruncateObject(uffs_Object *obj, u32 remain, RunOptionE run_opt) -{ - uffs_Device *dev = obj->dev; - TreeNode *fnode = obj->node; - u16 fdn; - u32 flen; - u32 block_start; - TreeNode *node; - uffs_BlockInfo *bc; - uffs_Buf *buf; - u16 page; - int pos; - - pos = obj->pos; // save current file position - - if (obj->dev == NULL || obj->open_succ == U_FALSE || fnode == NULL) { - obj->err = UEBADF; - goto ext; - } - - /* can't truncate a dir */ - /* TODO: delete files under dir ? */ - if (obj->type == UFFS_TYPE_DIR) { - obj->err = UEEXIST; - goto ext; - } - - if (remain >= fnode->u.file.len) { - goto ext; //!< nothing to do ... - } - - flen = fnode->u.file.len; - - if (flen < remain) { - // file is shorter than 'reamin', fill the gap with '\0' - if (run_opt == eREAL_RUN) { - obj->pos = flen; // move file pointer to the end - if (do_WriteObject(obj, NULL, remain - flen) > 0) { // fill '\0' ... - uffs_Perror(UFFS_MSG_SERIOUS, "Write object not finished. expect %d but only %d wrote.", - remain - flen, fnode->u.file.len - flen); - obj->err = UEIOERR; // likely be an I/O error. - } - flen = obj->node->u.file.len; - } - } - else { - while (flen > remain) { - fdn = GetFdnByOfs(obj, flen - 1); - - //uffs_BufFlushGroup(dev, obj->serial, fdn); //!< flush the buffer - - block_start = GetStartOfDataBlock(obj, fdn); - if (remain <= block_start && fdn > 0) { - node = uffs_TreeFindDataNode(dev, obj->serial, fdn); - if (node == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "can't find data node when trancate obj."); - obj->err = UEIOERR; - goto ext; - } - bc = uffs_BlockInfoGet(dev, node->u.data.block); - if (bc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "can't get block info when trancate obj."); - obj->err = UEIOERR; - goto ext; - } - - for (page = 0; page < dev->attr->pages_per_block; page++) { - buf = uffs_BufFind(dev, fnode->u.file.serial, fdn, page); - if (buf) { - //!< ok, the buffer was loaded before ... - if (uffs_BufIsFree(buf) == U_FALSE) { - uffs_BlockInfoPut(dev, bc); - goto ext; //!< and someone is still holding the buffer, - // can't truncate it !!! - } - else if (run_opt == eREAL_RUN) - uffs_BufMarkEmpty(dev, buf); //!< discard the buffer - } - } - - if (run_opt == eREAL_RUN) { - uffs_BreakFromEntry(dev, UFFS_TYPE_DATA, node); - uffs_FlashEraseBlock(dev, bc->block); - node->u.list.block = bc->block; - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, node); - else - uffs_TreeInsertToErasedListTail(dev, node); - - fnode->u.file.len = block_start; - } - - flen = block_start; - uffs_BlockInfoPut(dev, bc); - } - else { - if (do_TruncateInternalWithBlockRecover(obj, fdn, - remain, run_opt) == U_SUCC) { - if (run_opt == eREAL_RUN) - fnode->u.file.len = remain; - flen = remain; - } - } - } - } - - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockRecover(dev); -ext: - obj->pos = pos; // keep file pointer offset not changed. - - uffs_Assert(fnode == obj->node, "obj->node change!\n"); - - return (obj->err == UENOERR ? U_SUCC : U_FAIL); - -} - -/** - * \brief check if there are anyone holding buf of this obj. - * If no one holding the buffers, expire the buffer. - * \return - * 0 : no one holding any buf of this obj - * >0 : the ref_count of buf which refer to this obj. - */ -int _CheckObjBufRef(uffs_Object *obj) -{ - uffs_Device *dev = obj->dev; - uffs_Buf *buf; - TreeNode *node = obj->node; - u16 parent, serial, last_serial; - - // check the DIR or FILE block - for (buf = uffs_BufFind(dev, obj->parent, obj->serial, UFFS_ALL_PAGES); - buf != NULL; - buf = uffs_BufFindFrom(dev, buf->next, obj->parent, obj->serial, UFFS_ALL_PAGES)) - { - if (buf->ref_count > 0) { - // oops ... - uffs_Perror(UFFS_MSG_SERIOUS, "someone still hold buf parent = %d, serial = %d, ref_count", - obj->parent, obj->serial, buf->ref_count); - - return buf->ref_count; - } - else { - buf->mark = UFFS_BUF_EMPTY; - } - } - - if (buf == NULL || buf->ref_count == 0) { - // check the DATA block - if (obj->type == UFFS_TYPE_FILE && node->u.file.len > 0) { - - parent = obj->serial; - last_serial = GetFdnByOfs(obj, node->u.file.len - 1); - for (serial = 1; serial <= last_serial; serial++) { - - for (buf = uffs_BufFind(dev, parent, serial, UFFS_ALL_PAGES); - buf != NULL; - buf = uffs_BufFindFrom(dev, buf->next, parent, serial, UFFS_ALL_PAGES)) - { - if (buf->ref_count != 0) { - // oops ... - uffs_Perror(UFFS_MSG_SERIOUS, "someone still hold buf parent = %d, serial = %d, ref_count", - parent, serial, buf->ref_count); - - return buf->ref_count; - } - else { - buf->mark = UFFS_BUF_EMPTY; - } - } - } - } - } - - return 0; -} - - - -/** - * \brief delete uffs object - * - * \param[in] name full name of object - * \param[out] err return error code - * - * \return U_SUCC if object is deleted successfully. - * return U_FAIL if error happen, error code is set to *err. - */ -URET uffs_DeleteObject(const char * name, int *err) -{ - uffs_Object *obj, *work; - TreeNode *node, *d_node; - uffs_Device *dev = NULL; - u16 block; - u16 serial, parent, last_serial; - UBOOL bad = U_FALSE; - URET ret = U_FAIL; - - obj = uffs_GetObject(); - if (obj == NULL) { - if (err) - *err = UEMFILE; - goto ext_unlock; - } - - if (uffs_OpenObject(obj, name, UO_RDWR|UO_DIR) == U_FAIL) { - if (uffs_OpenObject(obj, name, UO_RDWR) == U_FAIL) { - if (err) - *err = UENOENT; - goto ext_unlock; - } - } - - dev = obj->dev; - - // working throught object pool see if the object is opened ... - uffs_ObjectDevLock(obj); - work = NULL; - while ((work = (uffs_Object *)uffs_PoolFindNextAllocated(&_object_pool, work)) != NULL) { - if (work != obj && - work->dev && - work->dev == obj->dev && - work->node && - work->node == obj->node) { - // this object is opened, can't delete it. - if (err) - *err = UEACCES; - goto ext_lock; - } - } - - if (obj->type == UFFS_TYPE_DIR) { - // if the dir is not empty, can't delete it. - node = uffs_TreeFindDirNodeWithParent(dev, obj->serial); - if (node != NULL) { - if (err) - *err = UEACCES; - goto ext_lock; //have sub dirs ? - } - - node = uffs_TreeFindFileNodeWithParent(dev, obj->serial); - if (node != NULL) { - if (err) - *err = UEACCES; - goto ext_lock; //have sub files ? - } - } - - // before erase the block, we need to take care of the buffer ... - uffs_BufFlushAll(dev); - - if (_CheckObjBufRef(obj) > 0) { - if (err) - *err = UEACCES; - goto ext_lock; - } - - node = obj->node; - - // ok, now we are safe to erase DIR/FILE block :-) - block = GET_BLOCK_FROM_NODE(obj); - parent = obj->serial; - last_serial = (obj->type == UFFS_TYPE_FILE && node->u.file.len > 0 ? GetFdnByOfs(obj, node->u.file.len - 1) : 0); - - uffs_BreakFromEntry(dev, obj->type, node); - uffs_FlashEraseBlock(dev, block); - node->u.list.block = block; - node->u.list.u.serial = obj->serial; - - // From now on, the object is gone physically, - // but we need to 'suspend' this node so that no one will re-use - // the serial number during deleting the reset part of object. - - if (HAVE_BADBLOCK(dev)) { - uffs_BadBlockProcessSuspend(dev, node); - bad = U_TRUE; // will be put into 'bad' list later - } - else { - uffs_TreeSuspendAdd(dev, node); - bad = U_FALSE; // will be put into erased list later - } - - // now erase DATA blocks - if (obj->type == UFFS_TYPE_FILE && last_serial > 0) { - for (serial = 1; serial <= last_serial; serial++) { - - uffs_ObjectDevUnLock(obj); - ; // yield CPU to improve responsive when deleting large file. - uffs_ObjectDevLock(obj); - - d_node = uffs_TreeFindDataNode(dev, parent, serial); - if (uffs_Assert(d_node != NULL, "Can't find DATA node parent = %d, serial = %d\n", parent, serial)) { - uffs_BreakFromEntry(dev, UFFS_TYPE_DATA, d_node); - block = d_node->u.data.block; - uffs_FlashEraseBlock(dev, block); - d_node->u.list.block = block; - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, d_node); - else - uffs_TreeInsertToErasedListTail(dev, d_node); - } - } - } - - // now process the suspend node - uffs_TreeRemoveSuspendNode(dev, node); - if (bad) - uffs_TreeInsertToBadBlockList(dev, node); - else - uffs_TreeInsertToErasedListTail(dev, node); - - ret = U_SUCC; - -ext_lock: - uffs_ObjectDevUnLock(obj); -ext_unlock: - do_ReleaseObjectResource(obj); - - uffs_PutObject(obj); - - return ret; -} - -/** - * Remove object under a new parent, change object name. - * - * \param[in|out] obj - * \param[in] new_parent new parent's serial number - * \param[in] new_name new name of the object. - * if new_name == NULL, keep the old name. - * \param[in] name_len new name length. - * - * \return U_SUCC or U_FAIL (obj->err for the reason) - */ -URET uffs_MoveObjectEx(uffs_Object *obj, - int new_parent, const char *new_name, int name_len) -{ - uffs_Buf *buf; - uffs_FileInfo fi; - uffs_Device *dev = obj->dev; - TreeNode *node = obj->node; - - if (dev == NULL || node == NULL || obj->open_succ != U_TRUE) { - obj->err = UEBADF; - goto ext; - } - - uffs_ObjectDevLock(obj); - - obj->parent = new_parent; - - if (name_len > 0) { - - buf = uffs_BufGetEx(dev, obj->type, node, 0, obj->oflag); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get buf when rename!"); - obj->err = UEIOERR; - goto ext_1; - } - - memcpy(&fi, buf->data, sizeof(uffs_FileInfo)); - - if (new_name[name_len-1] == '/') - name_len--; - - memcpy(fi.name, new_name, name_len); - fi.name[name_len] = 0; - fi.name_len = name_len; - fi.last_modify = uffs_GetCurDateTime(); - - buf->parent = new_parent; // !! need to manually change the 'parent' !! - uffs_BufWrite(dev, buf, &fi, 0, sizeof(uffs_FileInfo)); - uffs_BufPut(dev, buf); - - // !! force a block recover so that all old tag will be expired !! - // This is important so we only need to check - // the first spare when mount UFFS :) - uffs_BufFlushGroupEx(dev, obj->parent, obj->serial, U_TRUE); - - obj->name = new_name; - obj->name_len = name_len; - obj->sum = uffs_MakeSum16(fi.name, fi.name_len); - } - - //update the check sum and new parent of tree node - if (obj->type == UFFS_TYPE_DIR) { - obj->node->u.dir.checksum = obj->sum; - obj->node->u.dir.parent = new_parent; - } - else { - obj->node->u.file.checksum = obj->sum; - obj->node->u.file.parent = new_parent; - } - -ext_1: - uffs_ObjectDevUnLock(obj); -ext: - - return (obj->err == UENOERR ? U_SUCC : U_FAIL); -} - -/** - * \brief rename(move) file or dir. - * \return U_SUCC if success, otherwise return U_FAIL and set error code to *err. - * \note rename/move file between different mount point is not allowed. - */ -URET uffs_RenameObject(const char *old_name, const char *new_name, int *err) -{ - uffs_Object *obj = NULL, *new_obj = NULL; - URET ret = U_FAIL; - int oflag; - - obj = uffs_GetObject(); - new_obj = uffs_GetObject(); - - if (obj == NULL || new_obj == NULL) { - if (err) - *err = UEINVAL; - goto ext; - } - - oflag = UO_RDONLY; - if (uffs_OpenObject(new_obj, new_name, oflag) == U_SUCC) { - uffs_CloseObject(new_obj); - uffs_Perror(UFFS_MSG_NOISY, "new object already exist!"); - if (err) - *err = UEEXIST; - goto ext; - } - oflag |= UO_DIR; - if (uffs_OpenObject(new_obj, new_name, oflag) == U_SUCC) { - uffs_CloseObject(new_obj); - uffs_Perror(UFFS_MSG_NOISY, "new object already exist!"); - if (err) - *err = UEEXIST; - goto ext; - } - - if (uffs_ParseObject(new_obj, new_name) != U_SUCC) { - uffs_Perror(UFFS_MSG_NOISY, "parse new name fail !"); - if (err) - *err = UENOENT; - goto ext; - } - - if (new_obj->name_len == 0) { - uffs_Perror(UFFS_MSG_NOISY, "invalid new name"); - if (err) - *err = UEINVAL; - goto ext; - } - - oflag = UO_RDONLY; - if (uffs_OpenObject(obj, old_name, oflag) != U_SUCC) { - oflag |= UO_DIR; - if (uffs_OpenObject(obj, old_name, oflag) != U_SUCC) { - uffs_Perror(UFFS_MSG_NOISY, "Can't open old object !"); - if (err) - *err = UEACCES; - goto ext; - } - } - - if (obj->dev != new_obj->dev) { - uffs_Perror(UFFS_MSG_NOISY, - "Can't move object between different mount point"); - if (err) - *err = UEACCES; - } - else { - ret = uffs_MoveObjectEx(obj, new_obj->parent, - new_obj->name, new_obj->name_len); - if (ret == U_FAIL && err) - *err = obj->err; - } - - uffs_CloseObject(obj); - -ext: - if (obj) uffs_PutObject(obj); - if (new_obj) { - do_ReleaseObjectResource(new_obj); - uffs_PutObject(new_obj); - } - - return ret; -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_init.c b/components/dfs/filesystems/uffs/src/uffs/uffs_init.c deleted file mode 100644 index bc0a5ca893..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_init.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_init.c - * \brief initialize uffs file system device - * \author Ricky Zheng, created 12th May, 2005 - */ - -#include "uffs_config.h" -#include "uffs/uffs_types.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_tree.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_badblock.h" -#include "uffs/uffs_utils.h" -#include - -#define PFX "init: " - -static URET uffs_InitDeviceConfig(uffs_Device *dev) -{ - if (dev->cfg.dirty_groups == 0) - dev->cfg.dirty_groups = MAX_DIRTY_BUF_GROUPS; - - if (!uffs_Assert(dev->cfg.dirty_groups >= 1 && dev->cfg.dirty_groups <= MAX_DIRTY_BUF_GROUPS, - "invalid config: dirty_groups = %d\n", dev->cfg.dirty_groups)) - return U_FAIL; - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR > 0 - dev->cfg.bc_caches = MAX_CACHED_BLOCK_INFO; - dev->cfg.page_buffers = MAX_PAGE_BUFFERS; - dev->cfg.dirty_pages = MAX_DIRTY_PAGES_IN_A_BLOCK; - dev->cfg.reserved_free_blocks = MINIMUN_ERASED_BLOCK; -#else - if (dev->cfg.bc_caches == 0) - dev->cfg.bc_caches = MAX_CACHED_BLOCK_INFO; - if (dev->cfg.page_buffers == 0) - dev->cfg.page_buffers = MAX_PAGE_BUFFERS; - if (dev->cfg.dirty_pages == 0) - dev->cfg.dirty_pages = MAX_DIRTY_PAGES_IN_A_BLOCK; - if (dev->cfg.reserved_free_blocks == 0) - dev->cfg.reserved_free_blocks = MINIMUN_ERASED_BLOCK; - - if (!uffs_Assert(dev->cfg.page_buffers - CLONE_BUFFERS_THRESHOLD >= 3, "invalid config: page_buffers = %d\n", dev->cfg.page_buffers)) - return U_FAIL; - -#endif - return U_SUCC; -} - -URET uffs_InitDevice(uffs_Device *dev) -{ - URET ret; - - ret = uffs_InitDeviceConfig(dev); - if (ret != U_SUCC) - return U_FAIL; - - if (dev->mem.init) { - if (dev->mem.init(dev) != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "Init memory allocator fail."); - return U_FAIL; - } - } - - memset(&(dev->st), 0, sizeof(uffs_FlashStat)); - - uffs_DeviceInitLock(dev); - uffs_BadBlockInit(dev); - - - if (uffs_FlashInterfaceInit(dev) != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "Can't initialize flash interface !"); - goto fail; - } - - uffs_Perror(UFFS_MSG_NOISY, "init page buf"); - ret = uffs_BufInit(dev, dev->cfg.page_buffers, dev->cfg.dirty_pages); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_DEAD, "Initialize page buffers fail"); - goto fail; - } - uffs_Perror(UFFS_MSG_NOISY, "init block info cache"); - ret = uffs_BlockInfoInitCache(dev, dev->cfg.bc_caches); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_DEAD, "Initialize block info fail"); - goto fail; - } - - ret = uffs_TreeInit(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to init tree buffers"); - goto fail; - } - - ret = uffs_BuildTree(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to build tree"); - goto fail; - } - - return U_SUCC; - -fail: - uffs_DeviceReleaseLock(dev); - - return U_FAIL; -} - -URET uffs_ReleaseDevice(uffs_Device *dev) -{ - URET ret; - - ret = uffs_BlockInfoReleaseCache(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to release block info."); - goto ext; - } - - ret = uffs_BufReleaseAll(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to release page buffers"); - goto ext; - } - - ret = uffs_TreeRelease(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to release tree buffers!"); - goto ext; - } - - ret = uffs_FlashInterfaceRelease(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to release tree buffers!"); - goto ext; - } - - if (dev->mem.release) - ret = dev->mem.release(dev); - - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "fail to release memory allocator!"); - } - - uffs_DeviceReleaseLock(dev); - -ext: - return ret; - -} - -URET uffs_InitFileSystemObjects(void) -{ - if (uffs_InitObjectBuf() == U_SUCC) { - if (uffs_DirEntryBufInit() == U_SUCC) { - uffs_InitGlobalFsLock(); - return U_SUCC; - } - } - - return U_FAIL; -} - -URET uffs_ReleaseFileSystemObjects(void) -{ - if (uffs_ReleaseObjectBuf() == U_SUCC) { - if (uffs_DirEntryBufRelease() == U_SUCC) { - uffs_ReleaseGlobalFsLock(); - return U_SUCC; - } - } - - return U_FAIL; -} diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_mem.c b/components/dfs/filesystems/uffs/src/uffs/uffs_mem.c deleted file mode 100644 index 9763cd7c43..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_mem.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_mem.c - * \brief uffs static memory allocator - * \author Ricky Zheng, created 23th Feb, 2007 - */ - -#include -#include "uffs_config.h" -#include "uffs/uffs_types.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_mem.h" - -#define PFX "mem : " - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR > 0 -static void * static_malloc(struct uffs_DeviceSt *dev, unsigned int size) -{ - struct uffs_memAllocatorSt *mem = &dev->mem; - void *p = NULL; - - size += (size % sizeof(long) ? sizeof(long) - (size % sizeof(long)) : 0); - - if (mem->buf_size - mem->pos < (int)size) { - uffs_Perror(UFFS_MSG_SERIOUS, - "Memory alloc failed! (alloc %d, free %d)", - size, mem->buf_size - mem->pos); - } - else { - p = mem->buf_start + mem->pos; - mem->pos += size; - uffs_Perror(UFFS_MSG_NOISY, - "0x%p: Allocated %d, free %d", - p, size, mem->buf_size - mem->pos); - } - - return p; -} - -void uffs_MemSetupStaticAllocator(uffs_MemAllocator *allocator, - void *pool, int size) -{ - allocator->buf_start = (char *)pool; - allocator->buf_size = size; - allocator->pos = 0; - allocator->malloc = static_malloc; - allocator->free = NULL; //never free memory for static memory allocator - - uffs_Perror(UFFS_MSG_NOISY, - "System static memory: %d bytes", allocator->buf_size); - -} - -#endif - - - - - - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_mtb.c b/components/dfs/filesystems/uffs/src/uffs/uffs_mtb.c deleted file mode 100644 index ca7f197249..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_mtb.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_mtb.c - * \brief mount table operations - * \author Ricky Zheng, created 11th July, 2009 - */ -#include "uffs_config.h" -#include "uffs/uffs_types.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_tree.h" -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_fd.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_fs.h" -#include - -#define PFX "mtb : " - -static struct uffs_MountTableEntrySt *m_head = NULL; // list of mounted entries -static struct uffs_MountTableEntrySt *m_free_head = NULL; // list of unmounted entries - -/** Return mounted entries header */ -uffs_MountTable * uffs_MtbGetMounted(void) -{ - return m_head; -} - -/** Return unmounted entries header */ -uffs_MountTable * uffs_MtbGetUnMounted(void) -{ - return m_free_head; -} - -/** - * \brief Register mount table - * \param mtb mount table entry - * \return 0 succ - * -1 failed (e.g. already registered and mounted) - */ -int uffs_RegisterMountTable(uffs_MountTable *mtb) -{ - uffs_MountTable *work = NULL; - static int dev_num = 0; - - if (mtb == NULL) - return -1; - - for (work = m_head; work; work = work->next) { - if (work == mtb) - return -1; // already mounted ? - } - - for (work = m_free_head; work; work = work->next) { - if (work == mtb) - return 0; // already registered. - } - - /* replace the free head */ - if (m_free_head) - m_free_head->prev = mtb; - mtb->prev = NULL; - mtb->next = m_free_head; - m_free_head = mtb; - - mtb->dev->dev_num = ++dev_num; - - return 0; -} - -/** - * \brief Remove mount entry from the table - * \param mtb mount table entry - * \return 0 removed succ - * -1 entry in used or not in the 'unmounted' list - */ -int uffs_UnRegisterMountTable(uffs_MountTable *mtb) -{ - uffs_MountTable *work = NULL; - - if (mtb == NULL) - return -1; - - for (work = m_head; work; work = work->next) { - if (work == mtb) - return -1; // in the mounted list ? busy, return - } - - for (work = m_free_head; work; work = work->next) { - if (work == mtb) { - // found, remove it from the list - if (work->next) - work->next->prev = work->prev; - if (work->prev) - work->prev->next = work->next; - if (work == m_free_head) - m_free_head = work->next; - - break; - } - } - - return work ? 0 : -1; -} - -static uffs_MountTable * uffs_GetMountTableByMountPoint(const char *mount, uffs_MountTable *head) -{ - uffs_MountTable *work = NULL; - - for (work = head; work; work = work->next) { - if (strcmp(work->mount, mount) == 0) - break; - } - return work; -} - -/** - * \brief mount partition - * \param[in] mount partition mount point - * \return 0 succ - * <0 fail - * - * \note use uffs_RegisterMountTable() register mount entry before you can mount it. - * mount point should ended with '/', e.g. '/sys/' - */ -int uffs_Mount(const char *mount) -{ - uffs_MountTable *mtb; - - if (uffs_GetMountTableByMountPoint(mount, m_head) != NULL) { - uffs_Perror(UFFS_MSG_NOISY, "'%s' already mounted", mount); - return -1; // already mounted ? - } - - mtb = uffs_GetMountTableByMountPoint(mount, m_free_head); - if (mtb == NULL) { - uffs_Perror(UFFS_MSG_NOISY, "'%s' not registered", mount); - return -1; // not registered ? - } - - uffs_Perror(UFFS_MSG_NOISY, - "init device for mount point %s ...", - mtb->mount); - - mtb->dev->par.start = mtb->start_block; - if (mtb->end_block < 0) { - mtb->dev->par.end = - mtb->dev->attr->total_blocks + mtb->end_block; - } - else { - mtb->dev->par.end = mtb->end_block; - } - - if (mtb->dev->Init(mtb->dev) == U_FAIL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "init device for mount point %s fail", - mtb->mount); - return -1; - } - - uffs_Perror(UFFS_MSG_NOISY, "mount partiton: %d,%d", - mtb->dev->par.start, mtb->dev->par.end); - - if (uffs_InitDevice(mtb->dev) != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "init device fail !"); - return -1; - } - - /* now break it from unmounted list */ - if (mtb->prev) - mtb->prev->next = mtb->next; - if (mtb->next) - mtb->next->prev = mtb->prev; - if (m_free_head == mtb) - m_free_head = mtb->next; - - /* link to mounted list */ - mtb->prev = NULL; - mtb->next = m_head; - if (m_head) - m_head->prev = mtb; - m_head = mtb; - - return 0; -} - -/** - * \brief unmount parttion - * \param[in] mount partition mount point - * \return 0 succ - * <0 fail - */ -int uffs_UnMount(const char *mount) -{ - uffs_MountTable *mtb = uffs_GetMountTableByMountPoint(mount, m_head); - - if (mtb == NULL) { - uffs_Perror(UFFS_MSG_NOISY, "'%s' not mounted ?", mount); - return -1; // not mounted ? - } - - if (uffs_GetMountTableByMountPoint(mount, m_free_head) != NULL) { - uffs_Perror(UFFS_MSG_NOISY, "'%s' already unmounted ?", mount); - return -1; // already unmounted ? - } - - if (mtb->dev->ref_count != 0) { - uffs_Perror(UFFS_MSG_NORMAL, "Can't unmount '%s' - busy", mount); - return -1; - } - - if (uffs_ReleaseDevice(mtb->dev) == U_FAIL) { - uffs_Perror(UFFS_MSG_NORMAL, "Can't release device for mount point '%s'", mount); - return -1; - } - - mtb->dev->Release(mtb->dev); - - // break from mounted list - if (mtb->prev) - mtb->prev->next = mtb->next; - if (mtb->next) - mtb->next->prev = mtb->prev; - if (mtb == m_head) - m_head = mtb->next; - - // put to unmounted list - mtb->prev = NULL; - mtb->next = m_free_head; - if (m_free_head) - m_free_head->prev = mtb; - m_free_head = mtb; - - return 0; -} - -/** - * find the matched mount point from a given full absolute path. - * - * \param[in] path full path - * \return the length of mount point. - */ -int uffs_GetMatchedMountPointSize(const char *path) -{ - int pos; - uffs_Device *dev; - - if (path[0] != '/') - return 0; - - pos = strlen(path); - - while (pos > 0) { - if ((dev = uffs_GetDeviceFromMountPointEx(path, pos)) != NULL ) { - uffs_PutDevice(dev); - return pos; - } - else { - if (path[pos-1] == '/') - pos--; - //back forward search the next '/' - for (; pos > 0 && path[pos-1] != '/'; pos--) - ; - } - } - - return pos; -} - -/** - * get device from mount point. - * - * \param[in] mount mount point name. - * \return NULL if mount point is not found. - */ -uffs_Device * uffs_GetDeviceFromMountPoint(const char *mount) -{ - uffs_MountTable *mtb = uffs_GetMountTableByMountPoint(mount, m_head); - - if (mtb) { - mtb->dev->ref_count++; - return mtb->dev; - } - - return NULL; -} - -/** - * get device from mount point. - * - * \param[in] mount mount point name. - * \param[in] len mount point name length. - * \return NULL if mount point is not found. - */ -uffs_Device * uffs_GetDeviceFromMountPointEx(const char *mount, int len) -{ - uffs_MountTable *work = NULL; - - for (work = m_head; work; work = work->next) { - if (strlen(work->mount) == len && - strncmp(mount, work->mount, len) == 0) { - work->dev->ref_count++; - return work->dev; - } - } - - return NULL; -} - - -/** - * return mount point from device - * - * \param[in] dev uffs device - * \return NULL if mount point is not found, - * otherwise return mount point name in mount table. - */ -const char * uffs_GetDeviceMountPoint(uffs_Device *dev) -{ - uffs_MountTable *work = NULL; - - for (work = m_head; work; work = work->next) { - if (work->dev == dev) { - return work->mount; - } - } - - return NULL; -} - -void uffs_PutDevice(uffs_Device *dev) -{ - dev->ref_count--; -} - - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_pool.c b/components/dfs/filesystems/uffs/src/uffs/uffs_pool.c deleted file mode 100644 index 22adc53f30..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_pool.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_pool.c - * \brief Fast fixed size memory pool management. - * \author Ricky Zheng, Simon Kallweit - */ - -#include "uffs_config.h" -#include "uffs/uffs_types.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_pool.h" - -/* - - usage: - - #define BUF_SIZE 32 - #define NUM_BUFS 1024 - - static int pool_mem[NUM_BUFS * BUF_SIZE / sizeof(int)]; - static uffs_Pool pool; - - uffs_PoolInit(&pool, pool_mem, sizeof(pool_mem), BUF_SIZE, NUM_BUFS); - - void * p; - p = uffs_PoolGet(&pool); - ... - uffs_PoolPut(p, &pool); - - notice: - - uffs_PoolInit will assert when NUM_BUFS is not at least 1, or BUF_SIZE is - not aligned to the platforms pointer size. - -*/ - - -/** - * \brief Initializes the memory pool. - * \param[in] pool memory pool - * \param[in] mem pool memory - * \param[in] mem_size size of pool memory - * \param[in] buf_size size of a single buffer - * \param[in] num_bufs number of buffers - * \return Returns U_SUCC if successful. - */ -URET uffs_PoolInit(uffs_Pool *pool, - void *mem, u32 mem_size, u32 buf_size, u32 num_bufs) -{ - unsigned int i; - uffs_PoolEntry *e1, *e2; - - if (!uffs_Assert(pool != NULL, "pool missing") || - !uffs_Assert(mem != NULL, "pool memory missing") || - !uffs_Assert(num_bufs > 0, "not enough buffers") || - !uffs_Assert(buf_size % sizeof(void *) == 0, - "buffer size not aligned to pointer size") || - !uffs_Assert(mem_size == num_bufs * buf_size, - "pool memory size is wrong")) - { - return U_FAIL; - } - - pool->mem = (u8 *)mem; - pool->buf_size = buf_size; - pool->num_bufs = num_bufs; - - uffs_SemCreate(&pool->sem); - uffs_SemWait(pool->sem); - - // Initialize the free_list - e1 = e2 = pool->free_list = (uffs_PoolEntry *) pool->mem; - for (i = 1; i < pool->num_bufs; i++) { - e2 = (uffs_PoolEntry *) (pool->mem + i * pool->buf_size); - e1->next = e2; - e1 = e2; - } - e2->next = NULL; - - uffs_SemSignal(pool->sem); - - return U_SUCC; -} - -/** - * \brief verify pointer validity aganist memory pool - * \return U_TRUE if valid, U_FALSE if invalid. - */ -UBOOL uffs_PoolVerify(uffs_Pool *pool, void *p) -{ - return p && - (u8 *)p >= pool->mem && - (u8 *)p < pool->mem + (pool->buf_size * pool->num_bufs) && - (((u8 *)p - pool->mem) % pool->buf_size) == 0 ? U_TRUE : U_FALSE; -} - -/** - * \brief Releases the memory pool. - * \param[in] pool memory pool - * \return Returns U_SUCC if successful. - */ -URET uffs_PoolRelease(uffs_Pool *pool) -{ - if (!uffs_Assert(pool != NULL, "pool missing")) - return U_FAIL; - - uffs_SemDelete(&pool->sem); - - return U_SUCC; -} - -/** - * \brief Get a buffer from the memory pool. - * \param[in] pool memory pool - * \return Returns a pointer to the buffer or NULL if none is available. - */ -void *uffs_PoolGet(uffs_Pool *pool) -{ - uffs_PoolEntry *e; - - if (!uffs_Assert(pool != NULL, "pool missing")) - return NULL; - - e = pool->free_list; - if (e) - pool->free_list = e->next; - - return e; -} - -/** - * \brief Get a buffer from the memory pool. - * This version is locked and should be used when multiple threads access the - * same memory pool. - * \param[in] pool memory pool - * \return Returns a pointer to the buffer or NULL if none is available. - */ -void *uffs_PoolGetLocked(uffs_Pool *pool) -{ - uffs_PoolEntry *e; - - if (!uffs_Assert(pool != NULL, "pool missing")) - return NULL; - - uffs_SemWait(pool->sem); - e = pool->free_list; - if (e) - pool->free_list = e->next; - uffs_SemSignal(pool->sem); - - return e; -} - -/** - * \brief Puts a buffer back to the memory pool. - * \param[in] pool memory pool - * \param[in] p buffer to put back - * \return Returns 0 if successful. - */ -int uffs_PoolPut(uffs_Pool *pool, void *p) -{ - uffs_PoolEntry *e = (uffs_PoolEntry *)p; - - if (!uffs_Assert(pool != NULL, "pool missing")) - return -1; - - if (e) { - e->next = pool->free_list; - pool->free_list = e; - return 0; - } - - return -1; -} - -/** - * \brief Puts a buffer back to the memory pool. - * This version is locked and should be used when multiple threads access the - * same memory pool. - * \param[in] pool memory pool - * \param[in] p buffer to put back - * \return Returns 0 if successful. - */ -int uffs_PoolPutLocked(uffs_Pool *pool, void *p) -{ - uffs_PoolEntry *e = (uffs_PoolEntry *)p; - - if (!uffs_Assert(pool != NULL, "pool missing")) - return -1; - - if (e) { - uffs_SemWait(pool->sem); - e->next = pool->free_list; - pool->free_list = e; - uffs_SemSignal(pool->sem); - return 0; - } - - return -1; -} - -/** - * \brief Gets a buffer by index (offset). - * This method returns a buffer from the memory pool by index. - * \param[in] pool memory pool - * \param[in] index index - * \return Returns a pointer to the buffer. - */ -void *uffs_PoolGetBufByIndex(uffs_Pool *pool, u32 index) -{ - if (!uffs_Assert(pool != NULL, "pool missing") || - !uffs_Assert(index < pool->num_bufs, - "index(%d) out of range(max %d)", index, pool->num_bufs)) - { - return NULL; - } - - return (u8 *) pool->mem + index * pool->buf_size; -} - -/** - * \brief Gets the index (offset) of a buffer. - * This method returns the index of a buffer from the memory pool. - * \param[in] pool memory pool - * \param[in] p buffer to get index from - * \return Returns the index of the buffer. - */ -u32 uffs_PoolGetIndex(uffs_Pool *pool, void *p) -{ - if (!uffs_Assert(pool != NULL, "pool missing") || - !uffs_Assert(p >= (void *) pool->mem && - p < (void *) (pool->mem + pool->num_bufs * pool->buf_size), - "pointer out of range")) - { - uffs_Panic(); - } - - return ((u8 *) p - pool->mem) / pool->buf_size; -} - -/** - * \brief Check given buffer in free list - * \return U_TRUE if it's in free list, U_FALSE if not. - */ -UBOOL uffs_PoolCheckFreeList(uffs_Pool *pool, void *p) -{ - uffs_PoolEntry *e; - for (e = pool->free_list; e; e = e->next) { - if ((void *)e == p) - return U_TRUE; - } - return U_FALSE; -} - -/** - * \brief this is more efficient version for small nodes number memory pool (< 32) - */ -static void * FindNextAllocatedInSmallPool(uffs_Pool *pool, void *from) -{ - u32 map = 0; - uffs_PoolEntry *e; - u32 i; - - for (e = pool->free_list; e; e = e->next) - map |= (1 << uffs_PoolGetIndex(pool, e)); - - for (i = uffs_PoolGetIndex(pool, from); - (map & (1 << i)) && i < 32 && i < pool->num_bufs; - i++); - - return i < 32 && i < pool->num_bufs ? - uffs_PoolGetBufByIndex(pool, i) : NULL; -} - - -/** - * \brief Find next allocated memory block - * - * \param[in] pool memory pool - * \param[in] from search start address, if NULL, from pool->mem - * - * \return next allocated memory block, NULL if not found. - * - * \note This is NOT efficient, don't do it on a pool with large free nodes ! - */ -void * uffs_PoolFindNextAllocated(uffs_Pool *pool, void *from) -{ - uffs_PoolEntry *e = NULL; - u8 *p = (u8 *)from; - - if (p == NULL) - p = pool->mem; - else - p += pool->buf_size; - - if (pool->num_bufs < 32) - return FindNextAllocatedInSmallPool(pool, p); - - // work through the free list, stop if not in free list, - // otherwise move to next entry and search free list again. - - if (pool->free_list) { - while (uffs_PoolVerify(pool, p)) { - e = pool->free_list; - while (e) { - if (p == (u8 *)e) { - p += pool->buf_size; // in free list, move to next entry - break; - } - e = e->next; - } - if (e == NULL) // not in free_list, gotcha - break; - } - } - - return uffs_PoolVerify(pool, p) ? p : NULL ; -} - -/** - * \brief get free memory block count - */ -int uffs_PoolGetFreeCount(uffs_Pool *pool) -{ - int count = 0; - uffs_PoolEntry *e; - - e = pool->free_list; - while (e) { - count++; - e = e->next; - } - - return count; -} - -/** - * \brief put all memory block back, return how many memory blocks were put back - */ -int uffs_PoolPutAll(uffs_Pool *pool) -{ - void *p = NULL; - int count = 0; - - do { - p = uffs_PoolFindNextAllocated(pool, p); - if (p) { - uffs_PoolPut(pool, p); - count++; - } - } while (p); - - return count; -} diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_public.c b/components/dfs/filesystems/uffs/src/uffs/uffs_public.c deleted file mode 100644 index 348b7892d3..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_public.c +++ /dev/null @@ -1,448 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_public.c - * \brief public and miscellaneous functions - * \author Ricky Zheng, created 10th May, 2005 - */ - -#include "uffs_config.h" -#include "uffs/uffs_types.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_crc.h" - -#include - -#define PFX "pub : " - - -int uffs_GetFirstBlockTimeStamp(void) -{ - return 0; -} - -int uffs_GetNextBlockTimeStamp(int prev) -{ - return (prev + 1) % 3; -} - -UBOOL uffs_IsSrcNewerThanObj(int src, int obj) -{ - switch (src - obj) { - case 0: - uffs_Perror(UFFS_MSG_SERIOUS, - "the two block have the same time stamp ?"); - break; - case 1: - case -2: - return U_TRUE; - case -1: - case 2: - return U_FALSE; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "time stamp out of range !"); - break; - } - - return U_FALSE; -} - - -/** - * \brief given a page, search the block to find - * a better page with the same page id - * - * \param[in] dev uffs device - * \param[in] bc block info - * \param[in] page page number to be compared with - * - * \return the better page number, could be the same with the given page. - * if the given page does not have good tag, return UFFS_INVALID_PAGE. - */ -u16 uffs_FindBestPageInBlock(uffs_Device *dev, uffs_BlockInfo *bc, u16 page) -{ - int i; - uffs_Tags *tag, *tag_old; - - if (!uffs_Assert(page != UFFS_INVALID_PAGE, "invalid param !")) - return page; // just in case ... - - uffs_BlockInfoLoad(dev, bc, page); // load old page - tag_old = GET_TAG(bc, page); - - if (!uffs_Assert(TAG_IS_GOOD(tag_old), "try to find a invalid page ?")) - return UFFS_INVALID_PAGE; - - if (page == dev->attr->pages_per_block - 1) // already the last page ? - return page; - - for (i = dev->attr->pages_per_block - 1; i > page; i--) { - uffs_BlockInfoLoad(dev, bc, i); - tag = GET_TAG(bc, i); - if (TAG_IS_GOOD(tag) && - TAG_PAGE_ID(tag) == TAG_PAGE_ID(tag_old) && - TAG_PARENT(tag) == TAG_PARENT(tag_old) && - TAG_SERIAL(tag) == TAG_SERIAL(tag_old)) - { - break; - } - } - - return i; -} - -/** - * \brief find a valid page with given page_id - * \param[in] dev uffs device - * \param[in] bc block info - * \param[in] page_id page_id to be find - * \return the valid page number which has given page_id - * \retval >=0 page number - * \retval UFFS_INVALID_PAGE page not found - */ -u16 uffs_FindPageInBlockWithPageId(uffs_Device *dev, - uffs_BlockInfo *bc, u16 page_id) -{ - u16 page; - uffs_Tags *tag; - - //Indeed, the page which has page_id, should ahead of page_id ... - for (page = page_id; page < dev->attr->pages_per_block; page++) { - uffs_BlockInfoLoad(dev, bc, page); - tag = &(bc->spares[page].tag); - if (TAG_IS_GOOD(tag) && TAG_PAGE_ID(tag) == page_id) - return page; - } - - return UFFS_INVALID_PAGE; -} - -/** - * Are all the pages in the block used ? - */ -UBOOL uffs_IsBlockPagesFullUsed(uffs_Device *dev, uffs_BlockInfo *bc) -{ - uffs_Tags *tag; - - // if the last page is dirty, then the whole block is full - uffs_BlockInfoLoad(dev, bc, dev->attr->pages_per_block - 1); - tag = GET_TAG(bc, dev->attr->pages_per_block - 1); - - return TAG_IS_GOOD(tag) ? U_TRUE : U_FALSE; -} - -/** - * Is this block used ? - * \param[in] dev uffs device - * \param[in] bc block info - * \retval U_TRUE block is used - * \retval U_FALSE block is free - */ -UBOOL uffs_IsThisBlockUsed(uffs_Device *dev, uffs_BlockInfo *bc) -{ - uffs_Tags *tag; - - // if the first page is dirty, then this block is used. - uffs_BlockInfoLoad(dev, bc, 0); - tag = GET_TAG(bc, 0); - - return TAG_IS_DIRTY(tag) ? U_TRUE : U_FALSE; -} - -/** - * get block time stamp from a exist block - * \param[in] dev uffs device - * \param[in] bc block info - */ -int uffs_GetBlockTimeStamp(uffs_Device *dev, uffs_BlockInfo *bc) -{ - if(uffs_IsThisBlockUsed(dev, bc) == U_FALSE) - return uffs_GetFirstBlockTimeStamp(); - else{ - uffs_BlockInfoLoad(dev, bc, 0); - return TAG_BLOCK_TS(GET_TAG(bc, 0)); - } - -} - -/** - * find first free page from 'pageFrom' - * \param[in] dev uffs device - * \param[in] bc block info - * \param[in] pageFrom search from this page - * \return return first free page number from 'pageFrom' - * \retval UFFS_INVALID_PAGE no free page found - * \retval >=0 the first free page number - */ -u16 uffs_FindFirstFreePage(uffs_Device *dev, - uffs_BlockInfo *bc, u16 pageFrom) -{ - u16 i; - - for (i = pageFrom; i < dev->attr->pages_per_block; i++) { - uffs_BlockInfoLoad(dev, bc, i); - if (uffs_IsPageErased(dev, bc, i) == U_TRUE) - return i; - } - - return UFFS_INVALID_PAGE; //free page not found -} - - -/** - * calculate sum of data, 8bit version - * \param[in] p data pointer - * \param[in] len length of data - * \return return sum of data, 8bit - */ -u8 uffs_MakeSum8(const void *p, int len) -{ - return uffs_crc16sum(p, len) & 0xFF; -} - -/** - * calculate sum of datam, 16bit version - * \param[in] p data pointer - * \param[in] len length of data - * \return return sum of data, 16bit - */ -u16 uffs_MakeSum16(const void *p, int len) -{ - return uffs_crc16sum(p, len); -} - -/** - * create a new file on a free block - * \param[in] dev uffs device - * \param[in] parent parent dir serial num - * \param[in] serial serial num of this new file - * \param[in] bc block information - * \param[in] fi file information - * \note parent, serial, bc must be provided before, - * and all information in fi should be filled well before. - */ -URET uffs_CreateNewFile(uffs_Device *dev, - u16 parent, u16 serial, - uffs_BlockInfo *bc, uffs_FileInfo *fi) -{ - uffs_Tags *tag; - uffs_Buf *buf; - - uffs_BlockInfoLoad(dev, bc, 0); - - tag = GET_TAG(bc, 0); - TAG_PARENT(tag) = parent; - TAG_SERIAL(tag) = serial; - TAG_DATA_LEN(tag) = sizeof(uffs_FileInfo); - - buf = uffs_BufGet(dev, parent, serial, 0); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "get buf fail."); - return U_FAIL; - } - - memcpy(buf->data, fi, TAG_DATA_LEN(tag)); - buf->data_len = TAG_DATA_LEN(tag); - - return uffs_BufPut(dev, buf); -} - - -/** - * \brief calculate data length of a file block - * \param[in] dev uffs device - * \param[in] bc block info - */ -int uffs_GetBlockFileDataLength(uffs_Device *dev, uffs_BlockInfo *bc, u8 type) -{ - u16 page_id; - u16 i; - uffs_Tags *tag; - int size = 0; - u16 page; - u16 lastPage = dev->attr->pages_per_block - 1; - - uffs_BlockInfoLoad(dev, bc, lastPage); - tag = GET_TAG(bc, lastPage); - - if (TAG_IS_GOOD(tag)) { - // First try the last page. - // if it's the full loaded file/data block, then we have a quick path. - if (type == UFFS_TYPE_FILE) { - if (TAG_PAGE_ID(tag) == (lastPage - 1)) { - size = dev->com.pg_data_size * (dev->attr->pages_per_block - 2) + TAG_DATA_LEN(tag); - return size; - } - } - if (type == UFFS_TYPE_DATA) { - if (TAG_PAGE_ID(tag) == lastPage) { - size = dev->com.pg_data_size * (dev->attr->pages_per_block - 1) + TAG_DATA_LEN(tag); - return size; - } - } - } - - // ok, it's not the full loaded file/data block, - // need to read all spares.... - uffs_BlockInfoLoad(dev, bc, UFFS_ALL_PAGES); - tag = GET_TAG(bc, 0); - if (uffs_Assert(TAG_IS_GOOD(tag), "block %d page 0 does not have good tag ?", bc->block)) { - if (TAG_TYPE(tag) == UFFS_TYPE_FILE) { - page_id = 1; //In file header block, file data page_id from 1 - i = 1; //search from page 1 - } - else { - page_id = 0; //in normal file data block, page_id from 0 - i = 0; //in normal file data block, search from page 0 - } - for (; i < dev->attr->pages_per_block; i++) { - tag = GET_TAG(bc, i); - if (TAG_IS_GOOD(tag)) { - if (page_id == TAG_PAGE_ID(tag)) { - page = uffs_FindBestPageInBlock(dev, bc, i); - if (uffs_Assert(page != UFFS_INVALID_PAGE, "got an invalid page ?")) { - size += TAG_DATA_LEN(GET_TAG(bc, page)); - page_id++; - } - } - } - } - } - - return size; -} - -/** - * get free pages number - * \param[in] dev uffs device - * \param[in] bc block info - */ -int uffs_GetFreePagesCount(uffs_Device *dev, uffs_BlockInfo *bc) -{ - int count = 0; - int i; - - // search from the last page ... to first page - for (i = dev->attr->pages_per_block - 1; i >= 0; i--) { - uffs_BlockInfoLoad(dev, bc, i); - if (uffs_IsPageErased(dev, bc, (u16)i) == U_TRUE) { - count++; - } - else { - if (TAG_IS_GOOD(GET_TAG(bc, i))) // it won't be any free page if we see a good tag. - break; - } - } - - return count; -} -/** - * \brief Is the block erased ? - * \param[in] dev uffs device - * \param[in] bc block info - * \param[in] page page number to be check - * \retval U_TRUE block is erased, ready to use - * \retval U_FALSE block is dirty, maybe use by file - */ -UBOOL uffs_IsPageErased(uffs_Device *dev, uffs_BlockInfo *bc, u16 page) -{ - uffs_Tags *tag; - - uffs_BlockInfoLoad(dev, bc, page); - tag = GET_TAG(bc, page); - - if (!TAG_IS_SEALED(tag) && - !TAG_IS_DIRTY(tag) && - !TAG_IS_VALID(tag)) { - return U_TRUE; - } - - return U_FALSE; -} - -/** - * get partition used (bytes) - */ -int uffs_GetDeviceUsed(uffs_Device *dev) -{ - return (dev->par.end - dev->par.start + 1 - - dev->tree.bad_count - dev->tree.erased_count - ) * - dev->attr->page_data_size * - dev->attr->pages_per_block; -} - -/** - * get partition free (bytes) - */ -int uffs_GetDeviceFree(uffs_Device *dev) -{ - return dev->tree.erased_count * - dev->attr->page_data_size * - dev->attr->pages_per_block; -} - -/** - * get partition total size (bytes) - */ -int uffs_GetDeviceTotal(uffs_Device *dev) -{ - return (dev->par.end - dev->par.start + 1) * - dev->attr->page_data_size * - dev->attr->pages_per_block; -} - -/** - * load mini hader from flash - */ -URET uffs_LoadMiniHeader(uffs_Device *dev, - int block, u16 page, struct uffs_MiniHeaderSt *header) -{ - int ret; - struct uffs_FlashOpsSt *ops = dev->ops; - - if (ops->ReadPageWithLayout) { - ret = ops->ReadPageWithLayout(dev, block, page, (u8 *)header, - sizeof(struct uffs_MiniHeaderSt), NULL, NULL, NULL); - } - else { - ret = ops->ReadPage(dev, block, page, (u8 *)header, sizeof(struct uffs_MiniHeaderSt), NULL, NULL, 0); - } - - dev->st.page_header_read_count++; - - return UFFS_FLASH_HAVE_ERR(ret) ? U_FAIL : U_SUCC; -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_tree.c b/components/dfs/filesystems/uffs/src/uffs/uffs_tree.c deleted file mode 100644 index 7e51a9275f..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_tree.c +++ /dev/null @@ -1,1278 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_tree.c - * \brief seting up uffs tree data structure - * \author Ricky Zheng, created 13th May, 2005 - */ - -#include "uffs_config.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_pool.h" -#include "uffs/uffs_flash.h" -#include "uffs/uffs_badblock.h" - -#include - -#define TPOOL(dev) &(dev->mem.tree_pool) - -#define PFX "tree: " - -static void uffs_InsertToFileEntry(uffs_Device *dev, TreeNode *node); -static void uffs_InsertToDirEntry(uffs_Device *dev, TreeNode *node); -static void uffs_InsertToDataEntry(uffs_Device *dev, TreeNode *node); - -static TreeNode * uffs_TreeGetErasedNodeNoCheck(uffs_Device *dev); - - -struct BlockTypeStatSt { - int dir; - int file; - int data; -}; - -/** - * \brief initialize tree buffers - * \param[in] dev uffs device - */ -URET uffs_TreeInit(uffs_Device *dev) -{ - int size; - int num; - uffs_Pool *pool; - int i; - - size = sizeof(TreeNode); - num = dev->par.end - dev->par.start + 1; - - pool = &(dev->mem.tree_pool); - - if (dev->mem.tree_nodes_pool_size == 0) { - if (dev->mem.malloc) { - dev->mem.tree_nodes_pool_buf = dev->mem.malloc(dev, size * num); - if (dev->mem.tree_nodes_pool_buf) - dev->mem.tree_nodes_pool_size = size * num; - } - } - if (size * num > dev->mem.tree_nodes_pool_size) { - uffs_Perror(UFFS_MSG_DEAD, - "Tree buffer require %d but only %d available.", - size * num, dev->mem.tree_nodes_pool_size); - memset(pool, 0, sizeof(uffs_Pool)); - return U_FAIL; - } - uffs_Perror(UFFS_MSG_NOISY, "alloc tree nodes %d bytes.", size * num); - - uffs_PoolInit(pool, dev->mem.tree_nodes_pool_buf, - dev->mem.tree_nodes_pool_size, size, num); - - dev->tree.erased = NULL; - dev->tree.erased_tail = NULL; - dev->tree.erased_count = 0; - dev->tree.bad = NULL; - dev->tree.bad_count = 0; - - for (i = 0; i < DIR_NODE_ENTRY_LEN; i++) { - dev->tree.dir_entry[i] = EMPTY_NODE; - } - - for (i = 0; i < FILE_NODE_ENTRY_LEN; i++) { - dev->tree.file_entry[i] = EMPTY_NODE; - } - - for (i = 0; i < DATA_NODE_ENTRY_LEN; i++) { - dev->tree.data_entry[i] = EMPTY_NODE; - } - - dev->tree.max_serial = ROOT_DIR_SERIAL; - - return U_SUCC; -} -/** - * \brief release tree buffers, call this function when unmount - * \param[in] dev uffs device - */ -URET uffs_TreeRelease(uffs_Device *dev) -{ - uffs_Pool *pool; - - pool = &(dev->mem.tree_pool); - if (pool->mem && dev->mem.free) { - dev->mem.free(dev, pool->mem); - pool->mem = NULL; - dev->mem.tree_nodes_pool_size = 0; - } - uffs_PoolRelease(pool); - memset(pool, 0, sizeof(uffs_Pool)); - - return U_SUCC; -} - -static u16 _GetBlockFromNode(u8 type, TreeNode *node) -{ - switch (type) { - case UFFS_TYPE_DIR: - return node->u.dir.block; - case UFFS_TYPE_FILE: - return node->u.file.block; - case UFFS_TYPE_DATA: - return node->u.data.block; - } - uffs_Perror(UFFS_MSG_SERIOUS, "unkown type, X-block"); - return UFFS_INVALID_BLOCK; -} - -#if 0 -static u16 _GetParentFromNode(u8 type, TreeNode *node) -{ - switch (type) { - case UFFS_TYPE_DIR: - return node->u.dir.parent; - case UFFS_TYPE_FILE: - return node->u.file.parent; - case UFFS_TYPE_DATA: - return node->u.data.parent; - } - uffs_Perror(UFFS_MSG_SERIOUS, "unkown type, X-parent"); - return INVALID_UFFS_SERIAL; -} - - -static u16 _GetSerialFromNode(u8 type, TreeNode *node) -{ - switch (type) { - case UFFS_TYPE_DIR: - return node->u.dir.serial; - case UFFS_TYPE_FILE: - return node->u.file.serial; - case UFFS_TYPE_DATA: - return node->u.data.serial; - } - uffs_Perror(UFFS_MSG_SERIOUS, "unkown type, X-serial"); - return INVALID_UFFS_SERIAL; -} -#endif - -/** - * insert a TreeNode *node to tree - * \param[in] dev uffs device - * \param[in] type type of node - * \param[in] node node to be insert to - */ -void uffs_InsertNodeToTree(uffs_Device *dev, u8 type, TreeNode *node) -{ - switch (type) { - case UFFS_TYPE_DIR: - uffs_InsertToDirEntry(dev, node); - break; - case UFFS_TYPE_FILE: - uffs_InsertToFileEntry(dev, node); - break; - case UFFS_TYPE_DATA: - uffs_InsertToDataEntry(dev, node); - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, - "unkown type, can't insert to tree"); - break; - } -} - -/** - * find a node from tree - * \param[in] dev uffs device - * \param[in] type type of node - * \param[in] parent parent serial num - * \param[in] serial serial num - */ -TreeNode * uffs_FindFromTree(uffs_Device *dev, - u8 type, u16 parent, u16 serial) -{ - switch (type) { - case UFFS_TYPE_DIR: - return uffs_TreeFindDirNode(dev, serial); - case UFFS_TYPE_FILE: - return uffs_TreeFindFileNode(dev, serial); - case UFFS_TYPE_DATA: - return uffs_TreeFindDataNode(dev, parent, serial); - } - uffs_Perror(UFFS_MSG_SERIOUS, - "unkown type, can't find node"); - return NULL; -} - - - -static URET _BuildValidTreeNode(uffs_Device *dev, - TreeNode *node, //!< empty node - uffs_BlockInfo *bc, - struct BlockTypeStatSt *st) -{ - uffs_Tags *tag; - TreeNode *node_alt; - u16 block, parent, serial, block_alt, block_save; - uffs_BlockInfo *bc_alt; - u8 type; - int page; - UBOOL needToInsertToTree = U_FALSE; - uffs_Buf *buf = NULL; - uffs_FileInfo *info; - u16 data_sum = 0; - - // check the first page on the block ... - uffs_BlockInfoLoad(dev, bc, 0); - - tag = GET_TAG(bc, 0); //get first page's tag - - if (!TAG_IS_DIRTY(tag)) { - // should never go here ... unless mark dirty page failed ? - uffs_Perror(UFFS_MSG_NORMAL, - "First page is clean in a non-erased block ?"); - return U_FAIL; - } - - if (!TAG_IS_VALID(tag)) { - //first page is invalid ? should be erased now! - uffs_Perror(UFFS_MSG_NORMAL, - "first page in block %d is invalid, will be erased now!", - bc->block); - goto process_invalid_block; - } - - block = bc->block; - parent = TAG_PARENT(tag); - serial = TAG_SERIAL(tag); - type = TAG_TYPE(tag); - - // check if there is an 'alternative block' - // (node which has the same serial number) in tree ? - node_alt = uffs_FindFromTree(dev, type, parent, serial); - - if (node_alt != NULL) { - //find a alternate node ! need to check the timestamp ! - - block_alt = _GetBlockFromNode(type, node_alt); - - uffs_Perror(UFFS_MSG_NORMAL, - "Process unclean block (%d vs %d)", block, block_alt); - - if (block_alt == INVALID_UFFS_SERIAL) { - uffs_Perror(UFFS_MSG_SERIOUS, "invalid block ?"); - return U_FAIL; - } - - bc_alt = uffs_BlockInfoGet(dev, block_alt); - if (bc_alt == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get block info "); - return U_FAIL; - } - uffs_BlockInfoLoad(dev, bc_alt, 0); - if (uffs_IsSrcNewerThanObj ( - TAG_BLOCK_TS(tag), - TAG_BLOCK_TS(GET_TAG(bc_alt, 0))) == U_TRUE) { - - //the node is newer than node_alt, so keep node_alt, and erase node - uffs_FlashEraseBlock(dev, block); - node->u.list.block = block; - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, node); - else - uffs_TreeInsertToErasedListTail(dev, node); - - uffs_BlockInfoPut(dev, bc_alt); //put back bc_alt before we return. - return U_SUCC; - } - else { - //the node is older than node_alt, so keep node, and erase node_alt - //we use node as erased node to insert to erased list - - block_save = _GetBlockFromNode(type, node_alt); - uffs_FlashEraseBlock(dev, block_save); - node->u.list.block = block_save; - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, node); - else - uffs_TreeInsertToErasedListTail(dev, node); - - //put back bc_alt because we don't need it anymore. - uffs_BlockInfoPut(dev, bc_alt); - - //use node_alt to store new informations in following - node = node_alt; - - needToInsertToTree = U_FALSE; - } - } - else { - needToInsertToTree = U_TRUE; - } - - if (type == UFFS_TYPE_DIR || type == UFFS_TYPE_FILE) { - buf = uffs_BufClone(dev, NULL); - if (buf == NULL) - return U_FAIL; - uffs_BlockInfoLoad(dev, bc, UFFS_ALL_PAGES); - page = uffs_FindPageInBlockWithPageId(dev, bc, 0); - if (page == UFFS_INVALID_PAGE) { - uffs_BufFreeClone(dev, buf); - uffs_Perror(UFFS_MSG_SERIOUS, - "Can't find any valid page for page_id=0 ? invalid block !" - "this might be caused by the tag layout change.\n"); - goto process_invalid_block; - } - page = uffs_FindBestPageInBlock(dev, bc, page); - uffs_FlashReadPage(dev, block, page, buf, U_FALSE); - info = (uffs_FileInfo *) (buf->data); - data_sum = uffs_MakeSum16(info->name, info->name_len); - uffs_BufFreeClone(dev, buf); - } - - switch (type) { - case UFFS_TYPE_DIR: - node->u.dir.block = bc->block; - node->u.dir.checksum = data_sum; - node->u.dir.parent = TAG_PARENT(tag); - node->u.dir.serial = TAG_SERIAL(tag); - st->dir++; - break; - case UFFS_TYPE_FILE: - node->u.file.block = bc->block; - node->u.file.checksum = data_sum; - node->u.file.parent = TAG_PARENT(tag); - node->u.file.serial = TAG_SERIAL(tag); - node->u.file.len = uffs_GetBlockFileDataLength(dev, bc, UFFS_TYPE_FILE); - st->file++; - break; - case UFFS_TYPE_DATA: - node->u.data.block = bc->block; - node->u.data.parent = TAG_PARENT(tag); - node->u.data.serial = TAG_SERIAL(tag); - node->u.data.len = uffs_GetBlockFileDataLength(dev, bc, UFFS_TYPE_DATA); - st->data++; - break; - } - - if (needToInsertToTree == U_TRUE) { - uffs_InsertNodeToTree(dev, type, node); - } - - return U_SUCC; - -process_invalid_block: - /* erase the invalid block */ - uffs_FlashEraseBlock(dev, bc->block); - - node->u.list.block = bc->block; - - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, node); - else - uffs_TreeInsertToErasedListTail(dev, node); - - return U_SUCC; -} - - -static URET _ScanAndFixUnCleanPage(uffs_Device *dev, uffs_BlockInfo *bc) -{ - int page; - uffs_Tags *tag; - struct uffs_MiniHeaderSt header; - - /* in most case, the valid block contents fewer free page, - so it's better scan from the last page ... to page 1. - note: scanning page 0 is not necessary, will check it later. - - The worse case: read (pages_per_block - 1) * (mini header + spares) ! - most case: read one spare. - */ - for (page = dev->attr->pages_per_block - 1; page > 0; page--) { - uffs_BlockInfoLoad(dev, bc, page); - tag = GET_TAG(bc, page); - - if (TAG_IS_SEALED(tag)) - break; // tag sealed, no unclean page in this block. - - if (TAG_IS_DIRTY(tag) || TAG_IS_VALID(tag)) { // tag not sealed but dirty/valid ? - uffs_Perror(UFFS_MSG_NORMAL, - "unclean page found, block %d page %d", - bc->block, page); - - // ok, an unclean page found. - // This unclean page can be identified by tag. - // We can leave it as it is, but performing a block recover would be good ? - // There won't be another unclean page in this block ... stop here. - break; - } - - // now we have a clean tag (all 0xFF ?). Need to check mini header to see if it's an unclean page. - if (uffs_LoadMiniHeader(dev, bc->block, page, &header) == U_FAIL) - return U_FAIL; - - if (header.status != 0xFF) { - // page data is dirty? this is an unclean page and we should explicitly mark tag as 'dirty and invalid'. - // This writing does not violate "no partial program" claim, because we are writing to a clean page spare. - uffs_Perror(UFFS_MSG_NORMAL, - "unclean page found, block %d page %d, mark it.", - bc->block, page); - uffs_FlashMarkDirtyPage(dev, bc, page); - } - } - - return U_SUCC; -} - - -static URET _BuildTreeStepOne(uffs_Device *dev) -{ - int block_lt; - uffs_BlockInfo *bc = NULL; - TreeNode *node; - struct uffs_TreeSt *tree; - uffs_Pool *pool; - struct uffs_MiniHeaderSt header; - URET ret = U_SUCC; - struct BlockTypeStatSt st = {0, 0, 0}; - - tree = &(dev->tree); - pool = TPOOL(dev); - - tree->bad = NULL; - tree->bad_count = 0; - tree->erased = NULL; - tree->erased_tail = NULL; - tree->erased_count = 0; - - uffs_Perror(UFFS_MSG_NOISY, "build tree step one"); - -// printf("s:%d e:%d\n", dev->par.start, dev->par.end); - for (block_lt = dev->par.start; block_lt <= dev->par.end; block_lt++) { - bc = uffs_BlockInfoGet(dev, block_lt); - if (bc == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "step one:fail to get block info"); - ret = U_FAIL; - break; - } - node = (TreeNode *)uffs_PoolGet(pool); - if (node == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "insufficient tree node!"); - ret = U_FAIL; - break; - } - - // Need to check bad block at first ! - if (uffs_FlashIsBadBlock(dev, block_lt) == U_TRUE) { - node->u.list.block = block_lt; - uffs_TreeInsertToBadBlockList(dev, node); - uffs_Perror(UFFS_MSG_NORMAL, "found bad block %d", block_lt); - } - else if (uffs_IsPageErased(dev, bc, 0) == U_TRUE) { //@ read one spare: 0 - // page 0 tag shows it's an erased block, we need to check the mini header status to make sure it is clean. - if (uffs_LoadMiniHeader(dev, block_lt, 0, &header) == U_FAIL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "I/O error when reading mini header !" - "block %d page %d", - block_lt, 0); - ret = U_FAIL; - break; - } - - if (header.status != 0xFF) { - // page 0 tag is clean but page data is dirty ??? - // this block should be erased immediately ! - uffs_FlashEraseBlock(dev, block_lt); - } - node->u.list.block = block_lt; - if (HAVE_BADBLOCK(dev)) { - uffs_Perror(UFFS_MSG_NORMAL, - "New bad block (%d) discovered.", block_lt); - uffs_BadBlockProcess(dev, node); - } - else { - // page 0 is clean does not means all pages in this block are clean, - // need to check this block later before use it. - uffs_TreeInsertToErasedListTailEx(dev, node, 1); - } - } - else { - - // this block have valid data page(s). - - ret = _ScanAndFixUnCleanPage(dev, bc); - if (ret == U_FAIL) - break; - - ret = _BuildValidTreeNode(dev, node, bc, &st); - if (ret == U_FAIL) - break; - - } - uffs_BlockInfoPut(dev, bc); - } //end of for - - if(ret == U_FAIL) - uffs_BlockInfoPut(dev, bc); - - uffs_Perror(UFFS_MSG_NORMAL, - "DIR %d, FILE %d, DATA %d", st.dir, st.file, st.data); - - return ret; -} - -static URET _BuildTreeStepTwo(uffs_Device *dev) -{ - //Randomise the start point of erased block to implement wear levelling - u32 startCount = 0; - u32 endPoint; - TreeNode *node; - - uffs_Perror(UFFS_MSG_NOISY, "build tree step two"); - - endPoint = uffs_GetCurDateTime() % (dev->tree.erased_count + 1); - while (startCount < endPoint) { - node = uffs_TreeGetErasedNodeNoCheck(dev); - if (node == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "No erased block ?"); - return U_FAIL; - } - uffs_TreeInsertToErasedListTailEx(dev, node, -1); - startCount++; - } - - return U_SUCC; -} - -TreeNode * uffs_TreeFindFileNode(uffs_Device *dev, u16 serial) -{ - int hash; - u16 x; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - - hash = serial & FILE_NODE_HASH_MASK; - x = tree->file_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.file.serial == serial) { - return node; - } - else { - x = node->hash_next; - } - } - return NULL; -} - -/** add a node into suspend list */ -void uffs_TreeSuspendAdd(uffs_Device *dev, TreeNode *node) -{ - node->u.list.next = dev->tree.suspend; - node->u.list.prev = NULL; - - if (dev->tree.suspend) - dev->tree.suspend->u.list.prev = node; - dev->tree.suspend = node; -} - -/** search suspend list */ -TreeNode * uffs_TreeFindSuspendNode(uffs_Device *dev, u16 serial) -{ - TreeNode *node = dev->tree.suspend; - while (node) { - if (node->u.list.u.serial == serial) - break; - - node = node->u.list.next; - } - - return node; -} - -/** remove a node from suspend list */ -void uffs_TreeRemoveSuspendNode(uffs_Device *dev, TreeNode *node) -{ - if (node->u.list.prev) - node->u.list.prev->u.list.next = node->u.list.next; - if (node->u.list.next) - node->u.list.next->u.list.prev = node->u.list.prev; - if (node == dev->tree.suspend) - dev->tree.suspend = NULL; -} - -TreeNode * uffs_TreeFindFileNodeWithParent(uffs_Device *dev, u16 parent) -{ - int hash; - u16 x; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - - for (hash = 0; hash < FILE_NODE_ENTRY_LEN; hash++) { - x = tree->file_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.file.parent == parent) { - return node; - } - else { - x = node->hash_next; - } - } - } - - return NULL; -} - -TreeNode * uffs_TreeFindDirNode(uffs_Device *dev, u16 serial) -{ - int hash; - u16 x; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - - hash = serial & DIR_NODE_HASH_MASK; - x = tree->dir_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.dir.serial == serial) { - return node; - } - else { - x = node->hash_next; - } - } - return NULL; -} - -TreeNode * uffs_TreeFindDirNodeWithParent(uffs_Device *dev, u16 parent) -{ - int hash; - u16 x; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - - for (hash = 0; hash < DIR_NODE_ENTRY_LEN; hash++) { - x = tree->dir_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.dir.parent == parent) { - return node; - } - else { - x = node->hash_next; - } - } - } - - return NULL; -} - -TreeNode * uffs_TreeFindFileNodeByName(uffs_Device *dev, - const char *name, - u32 len, - u16 sum, u16 parent) -{ - int i; - u16 x; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - - for (i = 0; i < FILE_NODE_ENTRY_LEN; i++) { - x = tree->file_entry[i]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.file.checksum == sum && node->u.file.parent == parent) { - //read file name from flash, and compare... - if (uffs_TreeCompareFileName(dev, name, len, sum, - node, UFFS_TYPE_FILE) == U_TRUE) { - //Got it! - return node; - } - } - x = node->hash_next; - } - } - - return NULL; -} - -TreeNode * uffs_TreeFindDataNode(uffs_Device *dev, u16 parent, u16 serial) -{ - int hash; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - u16 x; - - hash = GET_DATA_HASH(parent, serial); - x = tree->data_entry[hash]; - while(x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - - if(node->u.data.parent == parent && - node->u.data.serial == serial) - return node; - - x = node->hash_next; - } - - return NULL; -} - -TreeNode * uffs_TreeFindDirNodeByBlock(uffs_Device *dev, u16 block) -{ - int hash; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - u16 x; - - for (hash = 0; hash < DIR_NODE_ENTRY_LEN; hash++) { - x = tree->dir_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.dir.block == block) - return node; - x = node->hash_next; - } - } - - return NULL; -} - -TreeNode * uffs_TreeFindErasedNodeByBlock(uffs_Device *dev, u16 block) -{ - TreeNode *node; - node = dev->tree.erased; - - while (node) { - if (node->u.list.block == block) - return node; - node = node->u.list.next; - } - - return NULL; -} - -TreeNode * uffs_TreeFindBadNodeByBlock(uffs_Device *dev, u16 block) -{ - TreeNode *node; - node = dev->tree.bad; - - while (node) { - if (node->u.list.block == block) - return node; - node = node->u.list.next; - } - - return NULL; -} - -TreeNode * uffs_TreeFindFileNodeByBlock(uffs_Device *dev, u16 block) -{ - int hash; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - u16 x; - - for (hash = 0; hash < FILE_NODE_ENTRY_LEN; hash++) { - x = tree->file_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.file.block == block) - return node; - x = node->hash_next; - } - } - - return NULL; -} - -TreeNode * uffs_TreeFindDataNodeByBlock(uffs_Device *dev, u16 block) -{ - int hash; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - u16 x; - - for (hash = 0; hash < DATA_NODE_ENTRY_LEN; hash++) { - x = tree->data_entry[hash]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.data.block == block) - return node; - x = node->hash_next; - } - } - - return NULL; -} - -TreeNode * uffs_TreeFindNodeByBlock(uffs_Device *dev, u16 block, int *region) -{ - TreeNode *node = NULL; - - if (*region & SEARCH_REGION_DATA) { - node = uffs_TreeFindDataNodeByBlock(dev, block); - if (node) { - *region &= SEARCH_REGION_DATA; - return node; - } - } - if (*region & SEARCH_REGION_FILE) { - node = uffs_TreeFindFileNodeByBlock(dev, block); - if (node) { - *region &= SEARCH_REGION_FILE; - return node; - } - } - if (*region & SEARCH_REGION_DIR) { - node = uffs_TreeFindDirNodeByBlock(dev, block); - if (node) { - *region &= SEARCH_REGION_DIR; - return node; - } - } - if (*region & SEARCH_REGION_ERASED) { - node = uffs_TreeFindErasedNodeByBlock(dev, block); - if (node) { - *region &= SEARCH_REGION_ERASED; - return node; - } - } - if (*region & SEARCH_REGION_BAD) { - node = uffs_TreeFindBadNodeByBlock(dev, block); - if (node) { - *region &= SEARCH_REGION_BAD; - return node; - } - } - - return node; -} - -TreeNode * uffs_TreeFindDirNodeByName(uffs_Device *dev, - const char *name, u32 len, - u16 sum, u16 parent) -{ - int i; - u16 x; - TreeNode *node; - struct uffs_TreeSt *tree = &(dev->tree); - - for (i = 0; i < DIR_NODE_ENTRY_LEN; i++) { - x = tree->dir_entry[i]; - while (x != EMPTY_NODE) { - node = FROM_IDX(x, TPOOL(dev)); - if (node->u.dir.checksum == sum && - node->u.dir.parent == parent) { - //read file name from flash, and compare... - if (uffs_TreeCompareFileName(dev, name, len, sum, - node, UFFS_TYPE_DIR) == U_TRUE) { - //Got it! - return node; - } - } - x = node->hash_next; - } - } - - return NULL; - -} - -UBOOL uffs_CompareFileName(const char *src, int src_len, const char *des) -{ - while (src_len-- > 0) { - if(*src++ != *des++) - return U_FALSE; - } - - return U_TRUE; -} - -/** compare [name] with tree [node] represented object name by loading - uffs_FileInfo from storage */ -UBOOL uffs_TreeCompareFileName(uffs_Device *dev, - const char *name, u32 len, u16 sum, - TreeNode *node, int type) -{ - UBOOL matched = U_FALSE; - uffs_FileInfo *fi; - uffs_Buf *buf; - u16 data_sum; - - buf = uffs_BufGetEx(dev, type, node, 0, 0); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, "can't get buf !\n "); - goto ext; - } - fi = (uffs_FileInfo *)(buf->data); - data_sum = uffs_MakeSum16(fi->name, fi->name_len); - - if (data_sum != sum) { - uffs_Perror(UFFS_MSG_NORMAL, - "the obj's sum in storage is different with given sum!"); - goto ext; - } - - if (fi->name_len == len) { - if(uffs_CompareFileName(fi->name, fi->name_len, name) == U_TRUE) { - matched = U_TRUE; - } - } -ext: - if (buf) - uffs_BufPut(dev, buf); - - return matched; -} - - -/* calculate file length, etc */ -static URET _BuildTreeStepThree(uffs_Device *dev) -{ - int i; - u16 x; - TreeNode *work; - TreeNode *node; - struct uffs_TreeSt *tree; - uffs_Pool *pool; - u16 blockSave; - - TreeNode *cache = NULL; - u16 cacheSerial = INVALID_UFFS_SERIAL; - - tree = &(dev->tree); - pool = TPOOL(dev); - - uffs_Perror(UFFS_MSG_NOISY, "build tree step three"); - - for (i = 0; i < DATA_NODE_ENTRY_LEN; i++) { - x = tree->data_entry[i]; - while (x != EMPTY_NODE) { - work = FROM_IDX(x, pool); - if (work->u.data.parent == cacheSerial) { - node = cache; - } - else { - node = uffs_TreeFindFileNode(dev, work->u.data.parent); - cache = node; - cacheSerial = work->u.data.parent; - } - if (node == NULL) { - x = work->hash_next; - //this data block does not belong to any file ? - //should be erased. - uffs_Perror(UFFS_MSG_NORMAL, - "find a orphan data block:%d, " - "parent:%d, serial:%d, will be erased!", - work->u.data.block, - work->u.data.parent, work->u.data.serial); - - uffs_BreakFromEntry(dev, UFFS_TYPE_DATA, work); - blockSave = work->u.data.block; - work->u.list.block = blockSave; - uffs_FlashEraseBlock(dev, blockSave); - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, work); - else - uffs_TreeInsertToErasedListTail(dev, work); - } - else { - node->u.file.len += work->u.data.len; - x = work->hash_next; - } - } - } - - return U_SUCC; -} - -/** - * \brief build tree structure from flash - * \param[in] dev uffs device - */ -URET uffs_BuildTree(uffs_Device *dev) -{ - URET ret; - - /***** step one: scan all page spares, classify DIR/FILE/DATA nodes, - check bad blocks/uncompleted(conflicted) blocks as well *****/ - - /* if the disk is big and full filled of data this step could be - the most time consuming .... */ - - ret = _BuildTreeStepOne(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "build tree step one fail!"); - return ret; - } - - /***** step two: randomize the erased blocks, for ware-leveling purpose *****/ - /* this step is very fast :) */ - ret = _BuildTreeStepTwo(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "build tree step two fail!"); - return ret; - } - - /***** step three: check DATA nodes, find orphan nodes and erase them *****/ - /* if there are a lot of files and disk is fully filled, this step - could be very time consuming ... */ - ret = _BuildTreeStepThree(dev); - if (ret != U_SUCC) { - uffs_Perror(UFFS_MSG_SERIOUS, "build tree step three fail!"); - return ret; - } - - return U_SUCC; -} - -/** - * find a free file or dir serial NO - * \param[in] dev uffs device - * \return if no free serial found, return #INVALID_UFFS_SERIAL - */ -u16 uffs_FindFreeFsnSerial(uffs_Device *dev) -{ - u16 i; - TreeNode *node; - - //TODO!! Do we need a faster serial number generating method? - // it depends on how often creating files or directories - - for (i = ROOT_DIR_SERIAL + 1; i < MAX_UFFS_FSN; i++) { - node = uffs_TreeFindDirNode(dev, i); - if (node == NULL) { - node = uffs_TreeFindFileNode(dev, i); - if (node == NULL) { - node = uffs_TreeFindSuspendNode(dev, i); - if (node == NULL) - return i; - } - } - } - - return INVALID_UFFS_SERIAL; -} - -static TreeNode * uffs_TreeGetErasedNodeNoCheck(uffs_Device *dev) -{ - TreeNode *node = NULL; - if (dev->tree.erased) { - node = dev->tree.erased; - dev->tree.erased->u.list.prev = NULL; - dev->tree.erased = dev->tree.erased->u.list.next; - if(dev->tree.erased == NULL) - dev->tree.erased_tail = NULL; - dev->tree.erased_count--; - } - - return node; -} - -TreeNode * uffs_TreeGetErasedNode(uffs_Device *dev) -{ - TreeNode *node = uffs_TreeGetErasedNodeNoCheck(dev); - u16 block; - - if (node && node->u.list.u.need_check) { - block = node->u.list.block; - if (uffs_FlashCheckErasedBlock(dev, block) != U_SUCC) { - // Hmm, this block is not fully erased ? erase it immediately. - uffs_FlashEraseBlock(dev, block); - node->u.list.u.need_check = 0; - } - } - return node; -} - -static void _InsertToEntry(uffs_Device *dev, u16 *entry, - int hash, TreeNode *node) -{ - node->hash_next = entry[hash]; - node->hash_prev = EMPTY_NODE; - if (entry[hash] != EMPTY_NODE) { - FROM_IDX(entry[hash], TPOOL(dev))->hash_prev = TO_IDX(node, TPOOL(dev)); - } - entry[hash] = TO_IDX(node, TPOOL(dev)); -} - - -/** - * break the node from entry - */ -void uffs_BreakFromEntry(uffs_Device *dev, u8 type, TreeNode *node) -{ - u16 *entry; - int hash; - TreeNode *work; - - switch (type) { - case UFFS_TYPE_DIR: - hash = GET_DIR_HASH(node->u.dir.serial); - entry = &(dev->tree.dir_entry[hash]); - break; - case UFFS_TYPE_FILE: - hash = GET_FILE_HASH(node->u.file.serial); - entry = &(dev->tree.file_entry[hash]); - break; - case UFFS_TYPE_DATA: - hash = GET_DATA_HASH(node->u.data.parent, node->u.data.serial); - entry = &(dev->tree.data_entry[hash]); - break; - default: - uffs_Perror(UFFS_MSG_SERIOUS, "unknown type when break..."); - return; - } - - if (node->hash_prev != EMPTY_NODE) { - work = FROM_IDX(node->hash_prev, &(dev->mem.tree_pool)); - work->hash_next = node->hash_next; - } - if (node->hash_next != EMPTY_NODE) { - work = FROM_IDX(node->hash_next, &(dev->mem.tree_pool)); - work->hash_prev = node->hash_prev; - } - - if (*entry == TO_IDX(node, &(dev->mem.tree_pool))) { - *entry = node->hash_next; - } -} - -static void uffs_InsertToFileEntry(uffs_Device *dev, TreeNode *node) -{ - _InsertToEntry(dev, dev->tree.file_entry, - GET_FILE_HASH(node->u.file.serial), - node); -} - -static void uffs_InsertToDirEntry(uffs_Device *dev, TreeNode *node) -{ - _InsertToEntry(dev, dev->tree.dir_entry, - GET_DIR_HASH(node->u.dir.serial), - node); -} - -static void uffs_InsertToDataEntry(uffs_Device *dev, TreeNode *node) -{ - _InsertToEntry(dev, dev->tree.data_entry, - GET_DATA_HASH(node->u.data.parent, node->u.data.serial), - node); -} - -void uffs_InsertToErasedListHead(uffs_Device *dev, TreeNode *node) -{ - struct uffs_TreeSt *tree; - tree = &(dev->tree); - - node->u.list.next = tree->erased; - node->u.list.prev = NULL; - - if (tree->erased) { - tree->erased->u.list.prev = node; - } - - tree->erased = node; - if (node->u.list.next == tree->erased_tail) { - tree->erased_tail = node; - } - tree->erased_count++; -} - -/** - * insert node to erased list. - * \param need_check: 0 - no need to check later - * 1 - need to check later - * < 0 - keep 'node->u.list.need_check' value - */ -void uffs_TreeInsertToErasedListTailEx(uffs_Device *dev, TreeNode *node, int need_check) -{ - struct uffs_TreeSt *tree; - tree = &(dev->tree); - - if (need_check >= 0) - node->u.list.u.need_check = need_check; - - node->u.list.next = NULL; - node->u.list.prev = tree->erased_tail; - if (tree->erased_tail) { - tree->erased_tail->u.list.next = node; - } - - tree->erased_tail = node; - if(tree->erased == NULL) { - tree->erased = node; - } - tree->erased_count++; -} - -void uffs_TreeInsertToErasedListTail(uffs_Device *dev, TreeNode *node) -{ - // this function is called after the block is erased, so don't need to check. - uffs_TreeInsertToErasedListTailEx(dev, node, 0); -} - -void uffs_TreeInsertToBadBlockList(uffs_Device *dev, TreeNode *node) -{ - struct uffs_TreeSt *tree; - - tree = &(dev->tree); - node->u.list.prev = NULL; - node->u.list.next = tree->bad; - - if (tree->bad) { - tree->bad->u.list.prev = node; - } - - tree->bad = node; - tree->bad_count++; -} - -/** - * set tree node block value - */ -void uffs_TreeSetNodeBlock(u8 type, TreeNode *node, u16 block) -{ - switch (type) { - case UFFS_TYPE_FILE: - node->u.file.block = block; - break; - case UFFS_TYPE_DIR: - node->u.dir.block = block; - break; - case UFFS_TYPE_DATA: - node->u.data.block = block; - break; - } -} - diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_utils.c b/components/dfs/filesystems/uffs/src/uffs/uffs_utils.c deleted file mode 100644 index bf3ea3b6d1..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_utils.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_utils.c - * \brief utilities of uffs - * \author Ricky Zheng, created 12th May, 2005 - */ -#include "uffs_config.h" -#include "uffs/uffs_device.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_version.h" -#include "uffs/uffs_badblock.h" -#include "uffs/uffs_fd.h" -#include "uffs/uffs_fs.h" - -#include -#include - -#define PFX "util: " - -#define SPOOL(dev) &((dev)->mem.spare_pool) - -#ifdef CONFIG_USE_GLOBAL_FS_LOCK -static OSSEM _global_lock = OSSEM_NOT_INITED; - -/* global file system lock */ -void uffs_InitGlobalFsLock(void) -{ - uffs_SemCreate(&_global_lock); -} - -void uffs_ReleaseGlobalFsLock(void) -{ - uffs_SemDelete(&_global_lock); -} - -void uffs_GlobalFsLockLock(void) -{ - uffs_SemWait(_global_lock); -} - -void uffs_GlobalFsLockUnlock(void) -{ - uffs_SemSignal(_global_lock); -} - -#else - -void uffs_InitGlobalFsLock(void) {} -void uffs_ReleaseGlobalFsLock(void) {} -void uffs_GlobalFsLockLock(void) {} -void uffs_GlobalFsLockUnlock(void) {} - -#endif - - -#ifdef CONFIG_ENABLE_BAD_BLOCK_VERIFY -static void _ForceFormatAndCheckBlock(uffs_Device *dev, int block) -{ - int i, j; - uffs_Buf *buf = NULL; - UBOOL bad = U_TRUE; - URET ret; - struct uffs_FlashOpsSt *ops = dev->ops; - struct uffs_TagStoreSt ts; - u8 *spare = NULL; - - buf = uffs_BufClone(dev, NULL); - if (buf == NULL) { - uffs_Perror(UFFS_MSG_SERIOUS, - "Alloc page buffer fail ! Format stoped."); - goto ext; - } - - spare = (u8 *)uffs_PoolGet(SPOOL(dev)); - if (spare == NULL) - goto ext; - - //step 1: Erase, fully fill with 0x0, and check - ret = uffs_FlashEraseBlock(dev, block); - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - - memset(buf->header, 0, dev->com.pg_size); - memset(&ts, 0, sizeof(ts)); - memset(spare, 0, dev->attr->spare_size); - - for (i = 0; i < dev->attr->pages_per_block; i++) { - if (ops->WritePageWithLayout) - ret = ops->WritePageWithLayout(dev, block, i, buf->header, dev->com.pg_size, NULL, &ts); - else - ret = ops->WritePage(dev, block, i, buf->header, dev->com.pg_size, spare, dev->attr->spare_size); - - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - } - for (i = 0; i < dev->attr->pages_per_block; i++) { - memset(buf->header, 0xFF, dev->com.pg_size); - memset(&ts, 0xFF, sizeof(ts)); - memset(spare, 0xFF, dev->attr->spare_size); - - if (ops->ReadPageWithLayout) { - ret = ops->ReadPageWithLayout(dev, block, i, buf->header, dev->com.pg_size, NULL, &ts, NULL); - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - for (j = 0; j < dev->com.pg_size; j++) - if (buf->header[j] != 0) - goto bad_out; - for (j = 0; j < sizeof(ts); j++) - if (((u8 *)&ts)[j] != 0) - goto bad_out; - } - else { - ret = ops->ReadPage(dev, block, i, buf->header, dev->com.pg_size, NULL, spare, dev->attr->spare_size); - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - for (j = 0; j < dev->com.pg_size; j++) - if (buf->header[j] != 0) - goto bad_out; - for (j = 0; j < dev->attr->spare_size; j++) - if (spare[j] != 0) - goto bad_out; - } - } - - //step 2: Erase, and check - ret = uffs_FlashEraseBlock(dev, block); - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - - for (i = 0; i < dev->attr->pages_per_block; i++) { - memset(buf->header, 0, dev->com.pg_size); - memset(&ts, 0, sizeof(ts)); - memset(spare, 0, dev->attr->spare_size); - - if (ops->ReadPageWithLayout) { - ret = ops->ReadPageWithLayout(dev, block, i, buf->header, dev->com.pg_size, NULL, &ts, NULL); - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - for (j = 0; j < dev->com.pg_size; j++) - if (buf->header[j] != 0xFF) - goto bad_out; - for (j = 0; j < sizeof(ts); j++) - if (((u8 *)&ts)[j] != 0xFF) - goto bad_out; - } - else { - ret = ops->ReadPage(dev, block, i, buf->header, dev->com.pg_size, NULL, spare, dev->attr->spare_size); - if (UFFS_FLASH_IS_BAD_BLOCK(ret)) - goto bad_out; - for (j = 0; j < dev->com.pg_size; j++) - if (buf->header[j] != 0xFF) - goto bad_out; - for (j = 0; j < dev->attr->spare_size; j++) - if (spare[j] != 0xFF) - goto bad_out; - } - } - - // format succ - bad = U_FALSE; - -bad_out: - if (bad == U_TRUE) - uffs_FlashMarkBadBlock(dev, block); -ext: - if (buf) - uffs_BufFreeClone(dev, buf); - - if (spare) - uffs_PoolPut(SPOOL(dev), spare); - - return; -} -#endif - - - -URET uffs_FormatDevice(uffs_Device *dev, UBOOL force) -{ - u16 i, slot; - URET ret = U_SUCC; - - if (dev == NULL) - return U_FAIL; - - if (dev->ops == NULL) - return U_FAIL; - - uffs_GlobalFsLockLock(); - - ret = uffs_BufFlushAll(dev); - - if (dev->ref_count > 1 && !force) { - uffs_Perror(UFFS_MSG_NORMAL, - "can't format when dev->ref_count = %d", - dev->ref_count); - ret = U_FAIL; - } - - if (ret == U_SUCC && force) { - uffs_DirEntryBufPutAll(dev); - uffs_PutAllObjectBuf(dev); - uffs_FdSignatureIncrease(); - } - - if (ret == U_SUCC && - uffs_BufIsAllFree(dev) == U_FALSE && - !force) - { - uffs_Perror(UFFS_MSG_NORMAL, "some page still in used!"); - ret = U_FAIL; - } - - if (!force) { - for (slot = 0; ret == U_SUCC && slot < dev->cfg.dirty_groups; slot++) { - if (dev->buf.dirtyGroup[slot].count > 0) { - uffs_Perror(UFFS_MSG_SERIOUS, "there still have dirty pages!"); - ret = U_FAIL; - } - } - } - - if (ret == U_SUCC) - uffs_BufSetAllEmpty(dev); - - - if (ret == U_SUCC && uffs_BlockInfoIsAllFree(dev) == U_FALSE && !force) { - uffs_Perror(UFFS_MSG_NORMAL, - "there still have block info cache ? fail to format"); - ret = U_FAIL; - } - - if (ret == U_SUCC) - uffs_BlockInfoExpireAll(dev); - - for (i = dev->par.start; ret == U_SUCC && i <= dev->par.end; i++) { - if (uffs_FlashIsBadBlock(dev, i) == U_FALSE) { - uffs_FlashEraseBlock(dev, i); - if (HAVE_BADBLOCK(dev)) - uffs_BadBlockProcess(dev, NULL); - } - else { -#ifdef CONFIG_ENABLE_BAD_BLOCK_VERIFY - _ForceFormatAndCheckBlock(dev, i); -#endif - } - } - - if (ret == U_SUCC && uffs_TreeRelease(dev) == U_FAIL) { - ret = U_FAIL; - } - - if (ret == U_SUCC && uffs_TreeInit(dev) == U_FAIL) { - ret = U_FAIL; - } - - if (ret == U_SUCC && uffs_BuildTree(dev) == U_FAIL) { - ret = U_FAIL; - } - - uffs_GlobalFsLockUnlock(); - - return ret; -} - -static const char * GetTagName(struct uffs_TagStoreSt *s) -{ - const char *name = "UNKNOWN"; - struct uffs_NodeTypeNameMapSt maps[] = UFFS_TYPE_NAME_MAP; - int i; - - for (i = 0; i < ARRAY_SIZE(maps); i++) { - if (s->type == maps[i].type) - name = maps[i].name; - } - - return name; -} - -static void DumpBufHex(struct uffs_DeviceSt *dev, const u8* buf, int len, dump_msg_cb *dump) -{ - int i; - for (i = 0; i < len; i++) - dump(dev, "%02X ", buf[i]); -} - -// return -1 if do not need to read next tag -static int DumpTag(struct uffs_DeviceSt *dev, int block, int page, uffs_Tags *tag, dump_msg_cb *dump) -{ - struct uffs_TagStoreSt *s = &tag->s; - struct uffs_MiniHeaderSt header; - URET ret; - - if (!TAG_IS_DIRTY(tag)) { - // is a clean page ? - ret = uffs_LoadMiniHeader(dev, block, page, &header); - if (ret == U_FAIL) { - dump(dev, "Fail to load mini header from page 0\n"); - } - else { - if (header.status == 0xFF) - dump(dev, "page %d CLEAN\n", page); - else { - dump(dev, "page %d NOT clean ! header: ", page); - DumpBufHex(dev, (u8 *)&header, sizeof(header), dump); - dump(dev, ", tag: "); - DumpBufHex(dev, (u8 *)s, sizeof(struct uffs_TagStoreSt), dump); - dump(dev, "\n"); - } - } - return -1; - } - - dump(dev, " - page %2d/%2d %s %d/%d len%4d\n", page, s->page_id, GetTagName(s), s->serial, s->parent, s->data_len); - - return 0; -} - -static void DumpBlock(struct uffs_DeviceSt *dev, int block, dump_msg_cb *dump) -{ - int i; - struct uffs_StorageAttrSt *attr = dev->attr; - uffs_Tags tag; - URET ret; - - dump(dev, "--- Block %d ---\n", block); - - if (uffs_FlashIsBadBlock(dev, block)) { - dump(dev, "Bad block\n\n"); - return; - } - - for (i = 0; i < attr->pages_per_block; i++) { - - memset(&tag, 0xFF, sizeof(tag)); - ret = uffs_FlashReadPageTag(dev, block, i, &tag); - - if (ret == UFFS_FLASH_IO_ERR) { - dump(dev, "page %d tag I/O error\n", i); - continue; - } - else if (ret == UFFS_FLASH_ECC_FAIL) { - dump(dev, "page %d tag ECC error\n", i); - continue; - } - else if (ret == UFFS_FLASH_NO_ERR || ret == UFFS_FLASH_ECC_OK) { - if (ret == UFFS_FLASH_ECC_OK) - dump(dev, "page %d tag has bit flip, corrected by ECC\n", i); - - if (DumpTag(dev, block, i, &tag, dump) == 0) - continue; - else - break; - } - else { - dump(dev, "read page %d tag return unexpected: %d\n", i, ret); - continue; - } - } - dump(dev, "\n"); -} - -void uffs_DumpDevice(struct uffs_DeviceSt *dev, dump_msg_cb *dump) -{ - int i; - for (i = dev->par.start; i <= dev->par.end; i++) { - DumpBlock(dev, i, dump); - } -} diff --git a/components/dfs/filesystems/uffs/src/uffs/uffs_version.c b/components/dfs/filesystems/uffs/src/uffs/uffs_version.c deleted file mode 100644 index e6cd98e3f3..0000000000 --- a/components/dfs/filesystems/uffs/src/uffs/uffs_version.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_version.c - * \brief uffs version information - * \author Ricky Zheng, created 8th May, 2005 - */ - -#include "uffs_config.h" -#include "uffs/uffs_version.h" - -#include -#define PFX "ver : " - - -static char version_buf[16]; - -const char * uffs_Version2Str(int ver) -{ - sprintf(version_buf, "%1d.%02d.%04d", - (ver & 0xff000000) >> 24, (ver & 0xff0000) >> 16, (ver & 0xffff)); - return version_buf; -} - -int uffs_GetVersion(void) -{ - return UFFS_VERSION; -} - -int uffs_GetMainVersion(int ver) -{ - return (ver & 0xff000000) >> 24; -} - -int uffs_GetMinorVersion(int ver) -{ - return (ver & 0xff0000) >> 16; -} - -int uffs_GetTrivialVersion(int ver) -{ - return (ver & 0xff00) >> 8; -} \ No newline at end of file diff --git a/components/dfs/filesystems/uffs/src/utils/CMakeLists.txt b/components/dfs/filesystems/uffs/src/utils/CMakeLists.txt deleted file mode 100644 index 37660d6f47..0000000000 --- a/components/dfs/filesystems/uffs/src/utils/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -IF (UNIX) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/posix) -ENDIF() -IF (WIN32) - INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/platform/win32) -ENDIF() -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/inc) -INCLUDE_DIRECTORIES(${uffs_SOURCE_DIR}/src/emu) - -LINK_DIRECTORIES(${uffs_BINARY_DIR}/src/emu) -LINK_DIRECTORIES(${uffs_BINARY_DIR}/src/uffs) - -SET(mkuffs_SRCS mkuffs.c) -ADD_EXECUTABLE(mkuffs ${mkuffs_SRCS}) -TARGET_LINK_LIBRARIES(mkuffs emu uffs emu platform apitest_server) -IF (UNIX) - TARGET_LINK_LIBRARIES(mkuffs pthread) -ENDIF () - - diff --git a/components/dfs/filesystems/uffs/src/utils/mkuffs.c b/components/dfs/filesystems/uffs/src/utils/mkuffs.c deleted file mode 100644 index 3f92069fe2..0000000000 --- a/components/dfs/filesystems/uffs/src/utils/mkuffs.c +++ /dev/null @@ -1,493 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_test.c - * \brief uffs test main entry - * \author Ricky Zheng - */ - -#include -#include -#include -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -#include "uffs/uffs_fs.h" -#include "uffs/uffs_utils.h" -#include "uffs/uffs_core.h" -#include "uffs/uffs_mtb.h" - -#include "cmdline.h" -#include "uffs_fileem.h" - -#define PFX NULL -#define MSG(msg,...) uffs_PerrorRaw(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) -#define MSGLN(msg,...) uffs_Perror(UFFS_MSG_NORMAL, msg, ## __VA_ARGS__) - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR > 0 -int main() -{ - MSGLN("Static memory allocator is not supported."); - return 0; -} -#else - -extern struct cli_commandset * get_helper_cmds(void); -extern struct cli_commandset * get_test_cmds(void); -extern void femu_init_uffs_device(uffs_Device *dev); - -static int conf_command_line_mode = 0; -static int conf_verbose_mode = 0; - -static int conf_exec_script = 0; -static char script_command[256]; - -#define DEFAULT_EMU_FILENAME "uffsemfile.bin" -const char * conf_emu_filename = DEFAULT_EMU_FILENAME; - - -/* default basic parameters of the NAND device */ -#define PAGES_PER_BLOCK_DEFAULT 32 -#define PAGE_DATA_SIZE_DEFAULT 512 -#define PAGE_SPARE_SIZE_DEFAULT 16 -#define STATUS_BYTE_OFFSET_DEFAULT 5 -#define TOTAL_BLOCKS_DEFAULT 128 -#define ECC_OPTION_DEFAULT UFFS_ECC_SOFT -//#define ECC_OPTION_DEFAULT UFFS_ECC_HW -//#define ECC_OPTION_DEFAULT UFFS_ECC_HW_AUTO - -#define MAX_MOUNT_TABLES 10 -#define MAX_MOUNT_POINT_NAME 32 - -static int conf_pages_per_block = PAGES_PER_BLOCK_DEFAULT; -static int conf_page_data_size = PAGE_DATA_SIZE_DEFAULT; -static int conf_page_spare_size = PAGE_SPARE_SIZE_DEFAULT; -static int conf_status_byte_offset = STATUS_BYTE_OFFSET_DEFAULT; -static int conf_total_blocks = TOTAL_BLOCKS_DEFAULT; -static int conf_ecc_option = ECC_OPTION_DEFAULT; -static int conf_ecc_size = 0; // 0 - Let UFFS choose the size - -static const char *g_ecc_option_strings[] = UFFS_ECC_OPTION_STRING; - -static struct uffs_MountTableEntrySt conf_mounts[MAX_MOUNT_TABLES] = {{0}}; -static uffs_Device conf_devices[MAX_MOUNT_TABLES] = {{0}}; -static char mount_point_name[MAX_MOUNT_TABLES][MAX_MOUNT_POINT_NAME] = {{0}}; - -static void setup_storage(struct uffs_StorageAttrSt *attr) -{ - attr->total_blocks = conf_total_blocks; /* total blocks */ - attr->page_data_size = conf_page_data_size; /* page data size */ - attr->spare_size = conf_page_spare_size; /* page spare size */ - attr->pages_per_block = conf_pages_per_block; /* pages per block */ - - attr->block_status_offs = conf_status_byte_offset; /* block status offset is 5th byte in spare */ - attr->ecc_opt = conf_ecc_option; /* ECC option */ - attr->ecc_size = conf_ecc_size; /* ECC size */ - attr->layout_opt = UFFS_LAYOUT_UFFS; /* let UFFS handle layout */ -} - - -static void setup_device(uffs_Device *dev) -{ - dev->Init = femu_InitDevice; - dev->Release = femu_ReleaseDevice; - dev->attr = femu_GetStorage(); -} - -static void setup_emu_private(uffs_FileEmu *emu) -{ - memset(emu, 0, sizeof(uffs_FileEmu)); - emu->emu_filename = conf_emu_filename; -} - -static int init_uffs_fs(void) -{ - static int bIsFileSystemInited = 0; - struct uffs_MountTableEntrySt *mtbl = &(conf_mounts[0]); - struct uffs_ConfigSt cfg = { - 0, // bc_caches - default - 0, // page_buffers - default - 0, // dirty_pages - default - 0, // dirty_groups - default - 0, // reserved_free_blocks - default - }; - - if (bIsFileSystemInited) - return -4; - - bIsFileSystemInited = 1; - - while (mtbl->dev) { - - memcpy(&mtbl->dev->cfg, &cfg, sizeof(struct uffs_ConfigSt)); - -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 - uffs_MemSetupSystemAllocator(&mtbl->dev->mem); -#endif - setup_device(mtbl->dev); - uffs_RegisterMountTable(mtbl); - mtbl++; - } - - // mount partitions - for (mtbl = &(conf_mounts[0]); mtbl->mount != NULL; mtbl++) { - uffs_Mount(mtbl->mount); - } - - return uffs_InitFileSystemObjects() == U_SUCC ? 0 : -1; -} - -static int release_uffs_fs(void) -{ - int ret = 0; - uffs_MountTable *mtb; - - for (mtb = &(conf_mounts[0]); ret == 0 && mtb->mount != NULL; mtb++) { - uffs_UnMount(mtb->mount); - } - - if (ret == 0) - ret = (uffs_ReleaseFileSystemObjects() == U_SUCC ? 0 : -1); - - return ret; -} - -/* mount point arg: /sys/,100,-1 */ -static int parse_mount_point(char *arg, int m_idx) -{ - int start = 0, end = -1; - char *p = arg; - struct uffs_MountTableEntrySt *mtbl = &(conf_mounts[m_idx]); - - while(*p && *p != ',' && *p != ' ' && *p != '\t') - p++; - - if (*p == 0 || p == arg) - return -1; - - mtbl->mount = &(mount_point_name[m_idx][0]); - memcpy((char *)mtbl->mount, arg, p - arg); - ((char *)(mtbl->mount))[p - arg] = 0; - - p++; - arg = p; - while(*p && *p != ',' && *p != ' ' && *p != '\t') - p++; - - if (p != arg) { - if (sscanf(arg, "%i", &start) < 1) - return -1; - p++; - arg = p; - - while(*p && *p != ',' && *p != ' ' && *p != '\t') - p++; - - if (p != arg) { - if (sscanf(arg, "%i", &end) < 1) - return -1; - } - } - mtbl->start_block = start; - mtbl->end_block = end; - mtbl->dev = &(conf_devices[m_idx]); - - return 0; -} - -static int parse_options(int argc, char *argv[]) -{ - int iarg; - int usage = 0; - int m_idx = 0; - static char em_file[128]; - int i; - - for (iarg = 1; iarg < argc && !usage; iarg++) { - const char *arg = argv[iarg]; - - if (arg[0] == '-') { - if (!strcmp(arg, "-h") || !strcmp(arg, "--help")) { - usage++; - } - else if (!strcmp(arg, "-f") || !strcmp(arg, "--file")) { - if (++iarg >= argc) - usage++; - else { - strcpy(em_file, argv[iarg]); - conf_emu_filename = (const char *)em_file; - } - } - else if (!strcmp(arg, "-c") || !strcmp(arg, "--command-line")) { - conf_command_line_mode = 1; - } - else if (!strcmp(arg, "-p") || !strcmp(arg, "--page-size")) { - if (++iarg >= argc) - usage++; - else if (sscanf(argv[iarg], "%i", &conf_page_data_size) < 1) - usage++; - if (conf_page_data_size <= 0 || conf_page_data_size > UFFS_MAX_PAGE_SIZE) { - MSGLN("ERROR: Invalid page data size"); - usage++; - } - } - else if (!strcmp(arg, "-s") || !strcmp(arg, "--spare-size")) { - if (++iarg >= argc) - usage++; - else if (sscanf(argv[iarg], "%i", &conf_page_spare_size) < 1) - usage++; - if (conf_page_spare_size < sizeof(struct uffs_TagStoreSt) + 1 || - (conf_page_spare_size % 4) != 0 || conf_page_spare_size > UFFS_MAX_SPARE_SIZE) { - MSGLN("ERROR: Invalid spare size"); - usage++; - } - } - else if (!strcmp(arg, "-o") || !strcmp(arg, "--status-offset")) { - if (++iarg >= argc) - usage++; - else if (sscanf(argv[iarg], "%i", &conf_status_byte_offset) < 1) - usage++; - if (conf_status_byte_offset < 0) - usage++; - } - else if (!strcmp(arg, "-b") || !strcmp(arg, "--block-pages")) { - if (++iarg >= argc) - usage++; - else if (sscanf(argv[iarg], "%i", &conf_pages_per_block) < 1) - usage++; - if (conf_pages_per_block < 2) - usage++; - } - else if (!strcmp(arg, "-t") || !strcmp(arg, "--total-blocks")) { - if (++iarg >= argc) - usage++; - else if (sscanf(argv[iarg], "%i", &conf_total_blocks) < 1) - usage++; - if (conf_total_blocks < 2) - usage++; - } - else if (!strcmp(arg, "-v") || !strcmp(arg, "--verbose")) { - conf_verbose_mode++; - } - else if (!strcmp(arg, "-m") || !strcmp(arg, "--mount")) { - if (++iarg > argc) - usage++; - else if (parse_mount_point(argv[iarg], m_idx) < 0) - usage++; - m_idx++; - } - else if (!strcmp(arg, "-e") || !strcmp(arg, "--exec")) { - if (++iarg > argc) - usage++; - else { - sprintf(script_command, "script %s", argv[iarg]); - conf_exec_script = 1; - } - } - else if (!strcmp(arg, "-x") || !strcmp(arg, "--ecc-option")) { - if (++iarg > argc) - usage++; - else { - for (i = 0; i < ARRAY_SIZE(g_ecc_option_strings); i++) { - if (!strcmp(argv[iarg], g_ecc_option_strings[i])) { - conf_ecc_option = i; - break; - } - } - if (i == ARRAY_SIZE(g_ecc_option_strings)) { - MSGLN("ERROR: Invalid ECC option"); - usage++; - } - } - } - else if (!strcmp(arg, "-z") || !strcmp(arg, "--ecc-size")) { - if (++iarg >= argc) - usage++; - else if (sscanf(argv[iarg], "%i", &conf_ecc_size) < 1) - usage++; - if (conf_ecc_size < 0 || conf_ecc_size > UFFS_MAX_ECC_SIZE) { - MSGLN("ERROR: Invalid ecc size"); - usage++; - } - } - else { - MSGLN("Unknown option: %s, try %s --help", arg, argv[0]); - return -1; - } - } - else { - MSGLN("Unexpected parameter: %s, try %s --help", arg, argv[0]); - return -1; - } - } - - if (usage) { - MSGLN("Usage: %s [options]", argv[0]); - MSGLN(" -h --help show usage"); - MSGLN(" -c --command-line command line mode"); - MSGLN(" -v --verbose verbose mode"); - MSGLN(" -f --file uffs image file"); - MSGLN(" -p --page-size page data size, default=%d", PAGE_DATA_SIZE_DEFAULT); - MSGLN(" -s --spare-size page spare size, default=%d", PAGE_SPARE_SIZE_DEFAULT); - MSGLN(" -o --status-offset status byte offset, default=%d", STATUS_BYTE_OFFSET_DEFAULT); - MSGLN(" -b --block-pages pages per block, default=%d", PAGES_PER_BLOCK_DEFAULT); - MSGLN(" -t --total-blocks total blocks"); - MSGLN(" -m --mount , for example: -m /,0,-1"); - MSGLN(" -x --ecc-option ECC option, default=%s", g_ecc_option_strings[ECC_OPTION_DEFAULT]); - MSGLN(" -z --ecc-size ECC size, default=0 (auto)"); - MSGLN(" -e --exec execute a script file"); - MSGLN(""); - - return -1; - } - - if (m_idx == 0) { - // if not given mount information, use default ('/' for whole partition) - parse_mount_point("/,0,-1", 0); - } - - return 0; -} - - -static void print_mount_points(void) -{ - struct uffs_MountTableEntrySt *m; - - m = &(conf_mounts[0]); - while (m->dev) { - MSGLN ("Mount point: %s, start: %d, end: %d", m->mount, m->start_block, m->end_block); - m++; - } -} - -static void print_params(void) -{ - MSGLN("Parameters summary:"); - MSGLN(" uffs image file: %s", conf_emu_filename); - MSGLN(" page size: %d", conf_page_data_size); - MSGLN(" page spare size: %d", conf_page_spare_size); - MSGLN(" pages per block: %d", conf_pages_per_block); - MSGLN(" total blocks: %d", conf_total_blocks); - MSGLN(" ecc option: %d (%s)", conf_ecc_option, g_ecc_option_strings[conf_ecc_option]); - MSGLN(" ecc size: %d%s", conf_ecc_size, conf_ecc_size == 0 ? " (auto)" : ""); - MSGLN(" bad block status offset: %d", conf_status_byte_offset); - MSGLN(""); -} - -#ifdef UNIX -#include -#include -void crash_handler(int sig) -{ - void *array[10]; - size_t size; - - // get void*'s for all entries on the stack - size = backtrace(array, 10); - - // print out all the frames to stderr - fprintf(stderr, "Error: signal %d:\n", sig); - backtrace_symbols_fd(array, size, 2); - exit(1); -} -#endif - -int main(int argc, char *argv[]) -{ - int ret; - -#ifdef UNIX - signal(SIGSEGV, crash_handler); -#endif - - uffs_SetupDebugOutput(); // setup debug output as early as possible - - if (parse_options(argc, argv) < 0) { - return -1; - } - - if (conf_verbose_mode) { - #if 1 - MSGLN("Internal data structure size:"); - MSGLN(" TreeNode: %d", sizeof(TreeNode)); - MSGLN(" struct BlockListSt: %d", sizeof(struct BlockListSt)); - MSGLN(" struct DirhSt: %d", sizeof(struct DirhSt)); - MSGLN(" struct FilehSt: %d", sizeof(struct FilehSt)); - MSGLN(" struct FdataSt: %d", sizeof(struct FdataSt)); - MSGLN(" struct uffs_TagStoreSt: %d", sizeof(struct uffs_TagStoreSt)); - MSGLN(" uffs_Buf: %d", sizeof(uffs_Buf)); - MSGLN(" struct uffs_BlockInfoSt: %d", sizeof(struct uffs_BlockInfoSt)); - MSGLN(""); - #endif - print_params(); - print_mount_points(); - } - - // setup file emulator storage with parameters from command line - setup_storage(femu_GetStorage()); - - // setup file emulator private data - setup_emu_private(femu_GetPrivate()); - - ret = init_uffs_fs(); - if (ret != 0) { - MSGLN ("Init file system fail: %d", ret); - return -1; - } - - cli_add_commandset(get_helper_cmds()); - cli_add_commandset(get_test_cmds()); - if (conf_command_line_mode) { - if (conf_exec_script) { - cli_interpret(script_command); - } - cli_main_entry(); - } - else { - if (conf_exec_script) { - cli_interpret(script_command); - } - else { - cli_main_entry(); - } - } - - release_uffs_fs(); - - return 0; -} -#endif - - - diff --git a/components/dfs/filesystems/uffs/tools/chomp_uffs_perror.rb b/components/dfs/filesystems/uffs/tools/chomp_uffs_perror.rb deleted file mode 100644 index e8b9460ae5..0000000000 --- a/components/dfs/filesystems/uffs/tools/chomp_uffs_perror.rb +++ /dev/null @@ -1,25 +0,0 @@ -#usage: -# find . -name "*.c" | xargs /usr/bin/ruby path/to/chomp_uffs_perror.rb -# - -ARGV.each do |file| - lines = [] - count = 0 - File.open(file).each_line do |line| - if line =~ /^(.*uffs_Perror.+)PFX(\s*".+)$/ - lines << ($1 + $2) - count += 1 - #puts ($1 + $2) - else - lines << line - end - end - if count > 0 - f = File.open(file, "w") - lines.each do |s| - f.puts s - end - f.close - puts "Fix file #{file}, modified lines: #{count}" - end -end diff --git a/components/dfs/filesystems/uffs/tools/format_code.rb b/components/dfs/filesystems/uffs/tools/format_code.rb deleted file mode 100644 index 7847db236a..0000000000 --- a/components/dfs/filesystems/uffs/tools/format_code.rb +++ /dev/null @@ -1,24 +0,0 @@ -#usage: -# find . -name "*.c" | xargs /usr/bin/ruby path/to/format_code.rb -# - -ARGV.each do |file| - lines = [] - count = 0 - File.open(file).each_line do |line| - if line =~ /^(.*)\s$/ - lines << $1.dup - count += 1 - else - lines << line - end - end - if count > 0 - f = File.open(file, "w") - lines.each do |s| - f.puts s - end - f.close - puts "Fix file #{file}, modified lines: #{count}" - end -end diff --git a/components/dfs/filesystems/uffs/tools/make_package.sh b/components/dfs/filesystems/uffs/tools/make_package.sh deleted file mode 100644 index a78c3fa2fd..0000000000 --- a/components/dfs/filesystems/uffs/tools/make_package.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -git ls-tree --name-only --full-name -r $1 | xargs tar -jcvf uffs-$1.tar.bz2 \ No newline at end of file diff --git a/components/dfs/filesystems/uffs/uffs_config.h b/components/dfs/filesystems/uffs/uffs_config.h deleted file mode 100644 index 2f0b6992bb..0000000000 --- a/components/dfs/filesystems/uffs/uffs_config.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_config.h - * \brief basic configuration of uffs - * \author Ricky Zheng - */ - -#ifndef _UFFS_CONFIG_H_ -#define _UFFS_CONFIG_H_ - -/** - * \def UFFS_MAX_PAGE_SIZE - * \note maximum page size UFFS support - */ -#define UFFS_MAX_PAGE_SIZE 2048 - -/** - * \def UFFS_MAX_SPARE_SIZE - */ -#define UFFS_MAX_SPARE_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 8) - -/** - * \def UFFS_MAX_ECC_SIZE - */ -#define UFFS_MAX_ECC_SIZE ((UFFS_MAX_PAGE_SIZE / 256) * 5) - -/** - * \def MAX_CACHED_BLOCK_INFO - * \note uffs cache the block info for opened directories and files, - * a practical value is 5 ~ MAX_OBJECT_HANDLE - */ -#define MAX_CACHED_BLOCK_INFO 50 - -/** - * \def MAX_PAGE_BUFFERS - * \note the bigger value will bring better read/write performance. - * but few writing performance will be improved when this - * value is become larger than 'max pages per block' - */ -#define MAX_PAGE_BUFFERS 40 - - -/** - * \def CLONE_BUFFER_THRESHOLD - * \note reserve buffers for clone. 1 or 2 should be enough. - */ -#define CLONE_BUFFERS_THRESHOLD 2 - -/** - * \def MAX_SPARE_BUFFERS - * \note spare buffers are used for lower level flash operations, - * 5 should be enough. - */ -#define MAX_SPARE_BUFFERS 5 - - -/** - * \def MAX_DIRTY_PAGES_IN_A_BLOCK - * \note this value should be between '2' and the lesser of - * 'max pages per block' and (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1). - * - * the smaller the value the frequently the buffer will be flushed. - */ -#define MAX_DIRTY_PAGES_IN_A_BLOCK 32 - -/** - * \def MAX_DIRTY_BUF_GROUPS - */ -#define MAX_DIRTY_BUF_GROUPS 3 - -/** - * \def CONFIG_ENABLE_UFFS_DEBUG_MSG - * \note Enable debug message output. You must call uffs_InitDebugMessageOutput() - * to initialize debug apart from enable debug feature. - */ -#define CONFIG_ENABLE_UFFS_DEBUG_MSG - -/** - * \def CONFIG_USE_GLOBAL_FS_LOCK - * \note use global lock instead of per-device lock. - * this is required if you use fd APIs in multi-thread environment. - */ -#define CONFIG_USE_GLOBAL_FS_LOCK - - -/** - * \def CONFIG_USE_PER_DEVICE_LOCK - * \note use per-device lock. - * this is required if you use fs APIs in multi-thread environment. - */ -//#define CONFIG_USE_PER_DEVICE_LOCK - - - -/** - * \def CONFIG_USE_STATIC_MEMORY_ALLOCATOR - * \note uffs will use static memory allocator if this is defined. - * to use static memory allocator, you need to provide memory - * buffer when creating uffs_Device. - * - * use UFFS_STATIC_BUFF_SIZE() to calculate memory buffer size. - */ -#define CONFIG_USE_STATIC_MEMORY_ALLOCATOR 0 - -/** - * \def CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR - * \note using system platform's 'malloc' and 'free'. - */ -#define CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR 1 - - - -/** - * \def CONFIG_FLUSH_BUF_AFTER_WRITE - * \note UFFS will write all data directly into flash in - * each 'write' call if you enable this option. - * (which means lesser data lost when power failure but - * poorer writing performance). - * It's not recommended to open this define for normal applications. - */ -#define CONFIG_FLUSH_BUF_AFTER_WRITE - - -/** - * \def CONFIG_UFFS_AUTO_LAYOUT_MTD_COMP - * \note Use Linux MTD compatiable spare placement for UFFS_LAYOUT_AUTO, - * only valid for page data size 512 or 2048. - */ -//#define CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME - - -/** - * \def MAX_OBJECT_HANDLE - * maximum number of object handle - */ -#define MAX_OBJECT_HANDLE 50 -#define FD_SIGNATURE_SHIFT 6 - - -/** - * \def MAX_DIR_HANDLE - * maximum number of uffs_DIR - */ -#define MAX_DIR_HANDLE 10 - -/** - * \def MINIMUN_ERASED_BLOCK - * UFFS will not allow appending or creating new files when the free/erased block - * is lower then MINIMUN_ERASED_BLOCK. - */ -#define MINIMUN_ERASED_BLOCK 2 - -/** - * \def CONFIG_CHANGE_MODIFY_TIME - * \note If defined, closing a file which is opened for writing/appending will - * update the file's modify time as well. Disable this feature will save a - * lot of writing activities if you frequently open files for write and close it. - */ -//#define CONFIG_CHANGE_MODIFY_TIME - - -/** - * \def CONFIG_ENABLE_BAD_BLOCK_VERIFY - * \note allow erase and verify block marked as 'bad' when format UFFS partition. - * it's not recommended for most NAND flash. - */ -#define CONFIG_ENABLE_BAD_BLOCK_VERIFY - -/** - * \def CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - * \note erase block again before mark bad block - */ -//#define CONFIG_ERASE_BLOCK_BEFORE_MARK_BAD - -/** - * \def CONFIG_PAGE_WRITE_VERIFY - * \note verify page data after write, for extra safe data storage. - */ -#define CONFIG_PAGE_WRITE_VERIFY - -/** - * \def CONFIG_BAD_BLOCK_POLICY_STRICT - * \note If this is enabled, UFFS will report the block as 'bad' if any bit-flips found; - * otherwise, UFFS report bad block only when ECC failed or reported - * by low level flash driver. - * - * \note Enable this will ensure your data always be stored on completely good blocks. - */ -#define CONFIG_BAD_BLOCK_POLICY_STRICT - - -/** - * \def CONFIG_ENABLE_PAGE_DATA_CRC - * \note If this is enabled, UFFS save page data CRC16 sum in mini header, - * it provides extra protection for data integrity. - */ -#define CONFIG_ENABLE_PAGE_DATA_CRC - - -/** micros for calculating buffer sizes */ - -/** - * \def UFFS_BLOCK_INFO_BUFFER_SIZE - * \brief calculate memory bytes for block info caches - */ -#define UFFS_BLOCK_INFO_BUFFER_SIZE(n_pages_per_block) \ - ( \ - ( \ - sizeof(uffs_BlockInfo) + \ - sizeof(uffs_PageSpare) * n_pages_per_block \ - ) * MAX_CACHED_BLOCK_INFO \ - ) - -/** - * \def UFFS_PAGE_BUFFER_SIZE - * \brief calculate memory bytes for page buffers - */ -#define UFFS_PAGE_BUFFER_SIZE(n_page_size) \ - ( \ - ( \ - sizeof(uffs_Buf) + n_page_size \ - ) * MAX_PAGE_BUFFERS \ - ) - -/** - * \def UFFS_TREE_BUFFER_SIZE - * \brief calculate memory bytes for tree nodes - */ -#define UFFS_TREE_BUFFER_SIZE(n_blocks) (sizeof(TreeNode) * n_blocks) - - -#define UFFS_SPARE_BUFFER_SIZE (MAX_SPARE_BUFFERS * UFFS_MAX_SPARE_SIZE) - - -/** - * \def UFFS_STATIC_BUFF_SIZE - * \brief calculate total memory usage of uffs system - */ -#define UFFS_STATIC_BUFF_SIZE(n_pages_per_block, n_page_size, n_blocks) \ - ( \ - UFFS_BLOCK_INFO_BUFFER_SIZE(n_pages_per_block) + \ - UFFS_PAGE_BUFFER_SIZE(n_page_size) + \ - UFFS_TREE_BUFFER_SIZE(n_blocks) + \ - UFFS_SPARE_BUFFER_SIZE \ - ) - - - -/* config check */ -#if (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD) < 3 -#error "MAX_PAGE_BUFFERS is too small" -#endif - -#if (MAX_DIRTY_PAGES_IN_A_BLOCK < 2) -#error "MAX_DIRTY_PAGES_IN_A_BLOCK should >= 2" -#endif - -#if (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD - 1 < MAX_DIRTY_PAGES_IN_A_BLOCK) -#error "MAX_DIRTY_PAGES_IN_A_BLOCK should < (MAX_PAGE_BUFFERS - CLONE_BUFFERS_THRESHOLD)" -#endif - -#if defined(CONFIG_PAGE_WRITE_VERIFY) && (CLONE_BUFFERS_THRESHOLD < 2) -#error "CLONE_BUFFERS_THRESHOLD should >= 2 when CONFIG_PAGE_WRITE_VERIFY is enabled." -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR + CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 1 -#error "Please enable ONLY one memory allocator" -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR + CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR == 0 -#error "Please enable ONE of memory allocators" -#endif - -#if defined(CONFIG_USE_GLOBAL_FS_LOCK) && defined(CONFIG_USE_PER_DEVICE_LOCK) -#error "enable either CONFIG_USE_GLOBAL_FS_LOCK or CONFIG_USE_PER_DEVICE_LOCK, not both" -#endif - -#if (MAX_OBJECT_HANDLE > (1 << FD_SIGNATURE_SHIFT)) -#error "Please increase FD_SIGNATURE_SHIFT !" -#endif - -#ifdef WIN32 -# pragma warning(disable : 4996) -# pragma warning(disable : 4244) -# pragma warning(disable : 4214) -# pragma warning(disable : 4127) -# pragma warning(disable : 4389) -# pragma warning(disable : 4100) -#endif - -#endif diff --git a/components/dfs/filesystems/uffs/uffs_nandif.c b/components/dfs/filesystems/uffs/uffs_nandif.c deleted file mode 100644 index 00e1bee8d5..0000000000 --- a/components/dfs/filesystems/uffs/uffs_nandif.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * RT-Thread Device Interface for uffs - */ - -#include -#include -#include "dfs_uffs.h" - -static int nand_init_flash(uffs_Device *dev) -{ - return UFFS_FLASH_NO_ERR; -} - -static int nand_release_flash(uffs_Device *dev) -{ - return UFFS_FLASH_NO_ERR; -} -static int nand_erase_block(uffs_Device *dev, unsigned block) -{ - int res; - - res = rt_mtd_nand_erase_block(RT_MTD_NAND_DEVICE(dev->_private), block); - - return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR; -} - -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) -static int nand_check_block(uffs_Device *dev, unsigned block) -{ - int res; - - res = rt_mtd_nand_check_block(RT_MTD_NAND_DEVICE(dev->_private), block); - - return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; -} - -static int nand_mark_badblock(uffs_Device *dev, unsigned block) -{ - int res; - - res = rt_mtd_nand_mark_badblock(RT_MTD_NAND_DEVICE(dev->_private), block); - - return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR; -} -#endif - -#if (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_NONE) || (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT) -static int nand_read_page(uffs_Device *dev, - u32 block, - u32 page, - u8 *data, - int data_len, - u8 *ecc, - rt_uint8_t *spare, - int spare_len) -{ - int res; - - page = block * dev->attr->pages_per_block + page; - if (data == NULL && spare == NULL) - { -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - RT_ASSERT(0); //should not be here -#else - /* check block status: bad or good */ - rt_uint8_t spare[UFFS_MAX_SPARE_SIZE]; - - rt_memset(spare, 0, UFFS_MAX_SPARE_SIZE); - - rt_mtd_nand_read(RT_MTD_NAND_DEVICE(dev->_private), - page, RT_NULL, 0, - spare, dev->attr->spare_size);//dev->mem.spare_data_size - - res = spare[dev->attr->block_status_offs] == 0xFF ? - UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; - - return res; -#endif - } - - rt_mtd_nand_read(RT_MTD_NAND_DEVICE(dev->_private), - page, data, data_len, spare, spare_len); - - return UFFS_FLASH_NO_ERR; -} - -static int nand_write_page(uffs_Device *dev, - u32 block, - u32 page, - const u8 *data, - int data_len, - const u8 *spare, - int spare_len) -{ - int res; - - RT_ASSERT(UFFS_MAX_SPARE_SIZE >= dev->attr->spare_size); - - page = block * dev->attr->pages_per_block + page; - - if (data == NULL && spare == NULL) - { -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - RT_ASSERT(0); //should not be here -#else - /* mark bad block */ - rt_uint8_t spare[UFFS_MAX_SPARE_SIZE]; - - rt_memset(spare, 0xFF, UFFS_MAX_SPARE_SIZE); - spare[dev->attr->block_status_offs] = 0x00; - - res = rt_mtd_nand_write(RT_MTD_NAND_DEVICE(dev->_private), - page, RT_NULL, 0, - spare, dev->attr->spare_size);//dev->mem.spare_data_size - if (res != RT_EOK) - goto __error; -#endif - } - - res = rt_mtd_nand_write(RT_MTD_NAND_DEVICE(dev->_private), - page, data, data_len, spare, spare_len); - if (res != RT_EOK) - goto __error; - - return UFFS_FLASH_NO_ERR; - -__error: - return UFFS_FLASH_IO_ERR; -} - -const uffs_FlashOps nand_ops = -{ - nand_init_flash, /* InitFlash() */ - nand_release_flash, /* ReleaseFlash() */ - nand_read_page, /* ReadPage() */ - NULL, /* ReadPageWithLayout */ - nand_write_page, /* WritePage() */ - NULL, /* WritePageWithLayout */ -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - nand_check_block, - nand_mark_badblock, -#else - NULL, /* IsBadBlock(), let UFFS take care of it. */ - NULL, /* MarkBadBlock(), let UFFS take care of it. */ -#endif - nand_erase_block, /* EraseBlock() */ -}; - -void uffs_setup_storage(struct uffs_StorageAttrSt *attr, - struct rt_mtd_nand_device *nand) -{ - rt_memset(attr, 0, sizeof(struct uffs_StorageAttrSt)); - -// attr->total_blocks = nand->end_block - nand->start_block + 1;/* no use */ - attr->page_data_size = nand->page_size; /* page data size */ - attr->pages_per_block = nand->pages_per_block; /* pages per block */ - attr->spare_size = nand->oob_size; /* page spare size */ - attr->ecc_opt = RT_CONFIG_UFFS_ECC_MODE; /* ecc option */ - attr->ecc_size = 0; /* ecc size is 0 , the uffs will calculate the ecc size*/ - attr->block_status_offs = attr->ecc_size; /* indicate block bad or good, offset in spare */ - attr->layout_opt = RT_CONFIG_UFFS_LAYOUT; /* let UFFS do the spare layout */ -} - -#elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO -static int WritePageWithLayout(uffs_Device *dev, - u32 block, - u32 page, - const u8 *data, - int data_len, - const u8 *ecc, //NULL - const uffs_TagStore *ts) -{ - int res; - int spare_len; - rt_uint8_t spare[UFFS_MAX_SPARE_SIZE]; - - RT_ASSERT(UFFS_MAX_SPARE_SIZE >= dev->attr->spare_size); - - page = block * dev->attr->pages_per_block + page; - spare_len = dev->mem.spare_data_size; - - if (data == NULL && ts == NULL) - { -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - RT_ASSERT(0); //should not be here -#else - /* mark bad block */ - rt_memset(spare, 0xFF, UFFS_MAX_SPARE_SIZE); - spare[dev->attr->block_status_offs] = 0x00; - - res = rt_mtd_nand_write(RT_MTD_NAND_DEVICE(dev->_private), - page, RT_NULL, 0, - spare, dev->attr->spare_size);//dev->mem.spare_data_size - if (res != RT_EOK) - goto __error; - - dev->st.io_write++; - return UFFS_FLASH_NO_ERR; -#endif - } - - if (data != NULL && data_len != 0) - { - RT_ASSERT(data_len == dev->attr->page_data_size); - - dev->st.page_write_count++; - dev->st.io_write += data_len; - } - - if (ts != RT_NULL) - { - uffs_FlashMakeSpare(dev, ts, RT_NULL, (u8 *)spare); - dev->st.spare_write_count++; - dev->st.io_write += spare_len; - } - - res = rt_mtd_nand_write(RT_MTD_NAND_DEVICE(dev->_private), - page, data, data_len, spare, spare_len); - if (res != RT_EOK) - goto __error; - - return UFFS_FLASH_NO_ERR; - -__error: - return UFFS_FLASH_IO_ERR; -} - -static URET ReadPageWithLayout(uffs_Device *dev, - u32 block, - u32 page, - u8 *data, - int data_len, - u8 *ecc, //NULL - uffs_TagStore *ts, - u8 *ecc_store) //NULL -{ - int res = UFFS_FLASH_NO_ERR; - int spare_len; - rt_uint8_t spare[UFFS_MAX_SPARE_SIZE]; - - RT_ASSERT(UFFS_MAX_SPARE_SIZE >= dev->attr->spare_size); - - page = block * dev->attr->pages_per_block + page; - spare_len = dev->mem.spare_data_size; - - if (data == RT_NULL && ts == RT_NULL) - { -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - RT_ASSERT(0); //should not be here -#else - /* check block good or bad */ - - rt_mtd_nand_read(RT_MTD_NAND_DEVICE(dev->_private), - page, RT_NULL, 0, - spare, dev->attr->spare_size);//dev->mem.spare_data_size - - dev->st.io_read++; - - res = spare[dev->attr->block_status_offs] == 0xFF ? - UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; - return res; -#endif - } - - if (data != RT_NULL) - { - dev->st.io_read += data_len; - dev->st.page_read_count++; - } - - res = rt_mtd_nand_read(RT_MTD_NAND_DEVICE(dev->_private), - page, data, data_len, spare, spare_len); - if (res == 0) - res = UFFS_FLASH_NO_ERR; - else if (res == -1) - { - //TODO ecc correct, add code to use hardware do ecc correct - res = UFFS_FLASH_ECC_OK; - } - else - res = UFFS_FLASH_ECC_FAIL; - - if (ts != RT_NULL) - { - // unload ts and ecc from spare, you can modify it if you like - uffs_FlashUnloadSpare(dev, (const u8 *)spare, ts, RT_NULL); - - if ((spare[spare_len - 1] == 0xFF) && (res == UFFS_FLASH_NO_ERR)) - res = UFFS_FLASH_NOT_SEALED; - - dev->st.io_read += spare_len; - dev->st.spare_read_count++; - } - - return res; -} - -const uffs_FlashOps nand_ops = -{ - nand_init_flash, /* InitFlash() */ - nand_release_flash, /* ReleaseFlash() */ - NULL, /* ReadPage() */ - ReadPageWithLayout, /* ReadPageWithLayout */ - NULL, /* WritePage() */ - WritePageWithLayout,/* WritePageWithLayout */ - -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - nand_check_block, - nand_mark_badblock, -#else - NULL, /* IsBadBlock(), let UFFS take care of it. */ - NULL, /* MarkBadBlock(), let UFFS take care of it. */ -#endif - nand_erase_block, /* EraseBlock() */ -}; - -static rt_uint8_t hw_flash_data_layout[UFFS_SPARE_LAYOUT_SIZE] = -{ - 0x05, 0x08, 0xFF, 0x00 -}; - -static rt_uint8_t hw_flash_ecc_layout[UFFS_SPARE_LAYOUT_SIZE] = -{ - 0x00, 0x04, 0xFF, 0x00 -}; - -RT_WEAK void uffs_setup_storage(struct uffs_StorageAttrSt *attr, - struct rt_mtd_nand_device *nand) -{ - rt_memset(attr, 0, sizeof(struct uffs_StorageAttrSt)); - -// attr->total_blocks = nand->end_block - nand->start_block + 1;/* no use */ - attr->page_data_size = nand->page_size; /* page data size */ - attr->pages_per_block = nand->pages_per_block; /* pages per block */ - attr->spare_size = nand->oob_size; /* page spare size */ - attr->ecc_opt = RT_CONFIG_UFFS_ECC_MODE; /* ecc option */ - attr->ecc_size = nand->oob_size-nand->oob_free; /* ecc size */ - attr->block_status_offs = attr->ecc_size; /* indicate block bad or good, offset in spare */ - attr->layout_opt = RT_CONFIG_UFFS_LAYOUT; /* let UFFS do the spare layout */ - - /* calculate the ecc layout array */ - hw_flash_data_layout[0] = attr->ecc_size + 1; /* ecc size + 1byte block status */ - hw_flash_data_layout[1] = 0x08; - hw_flash_data_layout[2] = 0xFF; - hw_flash_data_layout[3] = 0x00; - - hw_flash_ecc_layout[0] = 0; - hw_flash_ecc_layout[1] = attr->ecc_size; - hw_flash_ecc_layout[2] = 0xFF; - hw_flash_ecc_layout[3] = 0x00; - - /* initialize _uffs_data_layout and _uffs_ecc_layout */ - rt_memcpy(attr->_uffs_data_layout, hw_flash_data_layout, UFFS_SPARE_LAYOUT_SIZE); - rt_memcpy(attr->_uffs_ecc_layout, hw_flash_ecc_layout, UFFS_SPARE_LAYOUT_SIZE); - - attr->data_layout = attr->_uffs_data_layout; - attr->ecc_layout = attr->_uffs_ecc_layout; -} -#endif diff --git a/components/dfs/filesystems/uffs/uffs_rtthread.c b/components/dfs/filesystems/uffs/uffs_rtthread.c deleted file mode 100644 index bad456f04c..0000000000 --- a/components/dfs/filesystems/uffs/uffs_rtthread.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_os_posix.c - * \brief Emulation on POSIX host. This is just a dumb implementation, does not really create semaphores. - * \author Ricky Zheng - */ - -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -//#include - -#define PFX "os : " - -int uffs_SemCreate(OSSEM *sem) -{ - static int count = 0; - char name [RT_NAME_MAX+1]; - struct rt_mutex *mutex = RT_NULL; - - rt_snprintf(name, sizeof(name), "usem%d", count++); - mutex = rt_mutex_create(name, RT_IPC_FLAG_FIFO); - if (mutex != RT_NULL) - { - *sem = (OSSEM *)mutex; - return 0; - } - uffs_Perror(UFFS_MSG_SERIOUS, "can't get a semphore"); - return -1; -} - -int uffs_SemWait(OSSEM sem) -{ - return rt_mutex_take((struct rt_mutex *)sem, RT_WAITING_FOREVER); -} - -int uffs_SemSignal(OSSEM sem) -{ - return rt_mutex_release((struct rt_mutex *)sem); -} - -int uffs_SemDelete(OSSEM *sem) -{ - int ret = -1; - - if (sem) { - ret = rt_mutex_delete((struct rt_mutex *)(*sem)); - if (ret == RT_EOK) { - *sem = 0; - } - } - return ret; -} - -int uffs_OSGetTaskId(void) -{ - //TODO: ... return current task ID ... - return 0; -} - -unsigned int uffs_GetCurDateTime(void) -{ - // FIXME: return system time, please modify this for your platform ! - // or just return 0 if you don't care about file time. -#if 0 - time_t tvalue; - - tvalue = time(NULL); - - return (unsigned int)tvalue; -#endif - return 0; -} - -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 -static void * sys_malloc(struct uffs_DeviceSt *dev, unsigned int size) -{ - dev = dev; - uffs_Perror(UFFS_MSG_NORMAL, "system memory alloc %d bytes", size); - return rt_malloc(size); -} - -static URET sys_free(struct uffs_DeviceSt *dev, void *p) -{ - dev = dev; - rt_free(p); - return U_SUCC; -} - -void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator) -{ - allocator->malloc = sys_malloc; - allocator->free = sys_free; -} -#endif - -#if !defined(RT_THREAD) -/* debug message output throught 'printf' */ -static void output_dbg_msg(const char *msg); -static struct uffs_DebugMsgOutputSt m_dbg_ops = { - output_dbg_msg, - NULL, -}; - -static void output_dbg_msg(const char *msg) -{ - rt_kprintf("%s", msg); -} - -void uffs_SetupDebugOutput(void) -{ - uffs_InitDebugMessageOutput(&m_dbg_ops, UFFS_MSG_NOISY); -} -#else - -void uffs_SetupDebugOutput(void) -{ -} -#endif -- cgit v1.3.1 From 1b189ca7fba92a5b612563f6d063728542d54882 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 11 Mar 2021 18:20:09 +0800 Subject: update board.h --- bsp/bluetrum/ab32vg1-ab-prougen/board/board.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h index a4ad7daed4..5af2e2c7de 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h +++ b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h @@ -12,7 +12,8 @@ #define BOARD_H__ #include -#include "ab32vgx.h" -#include "drv_gpio.h" +#include +#include +#include #endif -- cgit v1.3.1 From eb894e88f1c9e0fd7af1ed611605f4afc91e3245 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 11 Mar 2021 18:22:41 +0800 Subject: update --- bsp/bluetrum/ab32vg1-ab-prougen/board/board.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h index 5af2e2c7de..35f499b3ba 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h +++ b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h @@ -13,7 +13,12 @@ #include #include +#ifdef RT_USING_PIN #include +#endif +#ifdef RT_USING_WDT #include +#endif + #endif -- cgit v1.3.1 From 2e99d2855b00355589d1dff1c22b16b7422834ce Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Fri, 12 Mar 2021 00:03:36 +0800 Subject: [gd32][drivers] auto formatted --- bsp/gd32103c-eval/drivers/drv_gpio.h | 2 +- bsp/gd32303e-eval/drivers/board.c | 2 +- bsp/gd32303e-eval/drivers/board.h | 2 +- bsp/gd32303e-eval/drivers/drv_gpio.c | 12 +- bsp/gd32303e-eval/drivers/drv_i2c.c | 8 +- bsp/gd32303e-eval/drivers/drv_spi.c | 16 +- bsp/gd32303e-eval/drivers/drv_spi_flash.c | 2 +- bsp/gd32303e-eval/drivers/drv_usart.c | 16 +- bsp/gd32303e-eval/drivers/gd32f303e_eval.c | 14 +- bsp/gd32303e-eval/drivers/gd32f303e_eval.h | 16 +- bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.c | 32 +-- bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.h | 2 +- bsp/gd32450z-eval/drivers/board.h | 2 +- bsp/gd32450z-eval/drivers/drv_enet.c | 72 +++--- bsp/gd32450z-eval/drivers/drv_exmc_sdram.c | 44 ++-- bsp/gd32450z-eval/drivers/drv_lcd.c | 108 ++++----- bsp/gd32450z-eval/drivers/drv_spi.c | 56 ++--- bsp/gd32450z-eval/drivers/drv_spi.h | 4 +- bsp/gd32450z-eval/drivers/drv_spi_flash.c | 32 +-- bsp/gd32450z-eval/drivers/drv_usart.c | 24 +- bsp/gd32450z-eval/drivers/gd32f450z_eval.h | 14 +- bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.c | 142 ++++++------ bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.h | 8 +- bsp/gd32450z-eval/drivers/synopsys_emac.h | 290 ++++++++++++------------- bsp/gd32e230k-start/applications/main.c | 2 +- bsp/gd32e230k-start/drivers/board.c | 4 +- bsp/gd32e230k-start/drivers/board.h | 4 +- bsp/gd32e230k-start/drivers/drv_gpio.c | 46 ++-- bsp/gd32e230k-start/drivers/drv_gpio.h | 2 +- bsp/gd32e230k-start/drivers/drv_i2c.c | 10 +- bsp/gd32e230k-start/drivers/drv_i2c.h | 2 +- bsp/gd32e230k-start/drivers/drv_spi.c | 12 +- bsp/gd32e230k-start/drivers/drv_spi.h | 2 +- bsp/gd32e230k-start/drivers/drv_usart.c | 18 +- bsp/gd32e230k-start/drivers/drv_usart.h | 2 +- bsp/gd32e230k-start/drivers/gd32e230_libopt.h | 32 +-- bsp/gd32vf103v-eval/applications/main.c | 2 +- bsp/gd32vf103v-eval/board/board.c | 2 +- bsp/gd32vf103v-eval/board/board.h | 2 +- bsp/gd32vf103v-eval/board/gd32vf103_libopt.h | 30 +-- bsp/gd32vf103v-eval/drivers/drv_gpio.c | 12 +- bsp/gd32vf103v-eval/drivers/drv_gpio.h | 4 +- bsp/gd32vf103v-eval/drivers/drv_usart.c | 4 +- 43 files changed, 556 insertions(+), 556 deletions(-) diff --git a/bsp/gd32103c-eval/drivers/drv_gpio.h b/bsp/gd32103c-eval/drivers/drv_gpio.h index 1240cc4cb2..34d30d63d4 100644 --- a/bsp/gd32103c-eval/drivers/drv_gpio.h +++ b/bsp/gd32103c-eval/drivers/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32303e-eval/drivers/board.c b/bsp/gd32303e-eval/drivers/board.c index 9ca024ec48..d4091d32dc 100644 --- a/bsp/gd32303e-eval/drivers/board.c +++ b/bsp/gd32303e-eval/drivers/board.c @@ -79,7 +79,7 @@ void rt_hw_board_init() rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif -#ifdef RT_USING_HEAP +#ifdef RT_USING_HEAP rt_system_heap_init((void*)HEAP_BEGIN, (void*)HEAP_END); #endif } diff --git a/bsp/gd32303e-eval/drivers/board.h b/bsp/gd32303e-eval/drivers/board.h index 5e1f15cd5d..4e97fce727 100644 --- a/bsp/gd32303e-eval/drivers/board.h +++ b/bsp/gd32303e-eval/drivers/board.h @@ -19,7 +19,7 @@ #include // Internal SRAM memory size[Kbytes] <8-64> -// Default: 64 +// Default: 64 #ifdef __ICCARM__ // Use *.icf ram symbal, to avoid hardcode. extern char __ICFEDIT_region_RAM_end__; diff --git a/bsp/gd32303e-eval/drivers/drv_gpio.c b/bsp/gd32303e-eval/drivers/drv_gpio.c index b7285513d3..700a11d3df 100644 --- a/bsp/gd32303e-eval/drivers/drv_gpio.c +++ b/bsp/gd32303e-eval/drivers/drv_gpio.c @@ -261,7 +261,7 @@ void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) /* GPIO Periph clock enable */ rcu_periph_clock_enable(index->clk); pin_mode = GPIO_MODE_OUT_PP; - + switch(mode) { case PIN_MODE_OUTPUT: @@ -442,7 +442,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ return RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; - + switch (pin_irq_hdr_tab[hdr_index].mode) { case PIN_IRQ_MODE_RISING: @@ -463,14 +463,14 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ /* enable and set interrupt priority */ nvic_irq_enable(irqmap->irqno, 5U, 0U); - + /* connect EXTI line to GPIO pin */ gpio_exti_source_select(index->port_src, index->pin_src); /* configure EXTI line */ exti_init((exti_line_enum)(index->pin), EXTI_INTERRUPT, trigger_mode); exti_interrupt_flag_clear((exti_line_enum)(index->pin)); - + rt_hw_interrupt_enable(level); } else if (enabled == PIN_IRQ_DISABLE) @@ -505,7 +505,7 @@ int rt_hw_pin_init(void) int result; result = rt_device_pin_register("pin", &_gd32_pin_ops, RT_NULL); - + return result; } INIT_BOARD_EXPORT(rt_hw_pin_init); @@ -524,7 +524,7 @@ void GD32_GPIO_EXTI_IRQHandler(rt_int8_t exti_line) { pin_irq_hdr(exti_line); exti_interrupt_flag_clear((exti_line_enum)(1 << exti_line)); - } + } } void EXTI0_IRQHandler(void) { diff --git a/bsp/gd32303e-eval/drivers/drv_i2c.c b/bsp/gd32303e-eval/drivers/drv_i2c.c index 059b211c01..0cca20e1d0 100644 --- a/bsp/gd32303e-eval/drivers/drv_i2c.c +++ b/bsp/gd32303e-eval/drivers/drv_i2c.c @@ -168,7 +168,7 @@ static int gd32_i2c_read(rt_uint32_t i2c_periph, rt_uint16_t slave_address, rt_u *p_buffer = i2c_data_receive(i2c_periph); /* point to the next location where the byte read will be saved */ - p_buffer++; + p_buffer++; /* decrement the read bytes counter */ data_byte--; @@ -277,7 +277,7 @@ static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg } } } - + ret = i; out: @@ -287,7 +287,7 @@ out: } static const struct rt_i2c_bus_device_ops i2c_ops = -{ +{ gd32_i2c_xfer, RT_NULL, RT_NULL @@ -324,7 +324,7 @@ int rt_hw_i2c_init(void) i2c_device.priv = (void *)&_i2c_bit_ops; rt_i2c_bit_add_bus(&i2c_device, I2C_BUS_NAME); - } + } #else /* register hardware I2C */ diff --git a/bsp/gd32303e-eval/drivers/drv_spi.c b/bsp/gd32303e-eval/drivers/drv_spi.c index e5df557ae8..78ff99d423 100644 --- a/bsp/gd32303e-eval/drivers/drv_spi.c +++ b/bsp/gd32303e-eval/drivers/drv_spi.c @@ -119,7 +119,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat spi_init_struct.prescale = SPI_PSC_256; } } /* baudrate */ - + switch(configuration->mode & RT_SPI_MODE_3) { case RT_SPI_MODE_0: @@ -135,7 +135,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; break; } - + /* MSB or LSB */ if(configuration->mode & RT_SPI_MSB) { @@ -145,7 +145,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat { spi_init_struct.endian = SPI_ENDIAN_LSB; } - + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; spi_init_struct.device_mode = SPI_MASTER; spi_init_struct.nss = SPI_NSS_SOFT; @@ -181,7 +181,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes const rt_uint8_t * send_ptr = message->send_buf; rt_uint8_t * recv_ptr = message->recv_buf; rt_uint32_t size = message->length; - + DEBUG_PRINTF("spi poll transfer start: %d\n", size); while(size--) @@ -192,7 +192,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes { data = *send_ptr++; } - + // Todo: replace register read/write by gd32f3 lib //Wait until the transmit buffer is empty while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE)); @@ -267,8 +267,8 @@ int gd32_hw_spi_init(void) rcu_periph_clock_enable(RCU_SPI0); /* SPI0_SCK(PA5), SPI0_MISO(PA6) and SPI0_MOSI(PA7) GPIO pin configuration */ gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_5 | GPIO_PIN_7); - gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); - + gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_6); + #endif #ifdef RT_USING_SPI1 static struct rt_spi_bus spi_bus1; @@ -287,7 +287,7 @@ int gd32_hw_spi_init(void) static struct rt_spi_bus spi_bus2; spi_bus2.parent.user_data = (void *)SPI2; - result = rt_spi_bus_register(&spi_bus2, "spi2", &gd32_spi_ops); + result = rt_spi_bus_register(&spi_bus2, "spi2", &gd32_spi_ops); rcu_periph_clock_enable(RCU_SPI2); rcu_periph_clock_enable(RCU_GPIOB); diff --git a/bsp/gd32303e-eval/drivers/drv_spi_flash.c b/bsp/gd32303e-eval/drivers/drv_spi_flash.c index 54e6be30ef..d4a3dafc1b 100644 --- a/bsp/gd32303e-eval/drivers/drv_spi_flash.c +++ b/bsp/gd32303e-eval/drivers/drv_spi_flash.c @@ -30,7 +30,7 @@ static int rt_hw_gd25q40_init(void) static rt_base_t gd25q_cs_pin; /* SPI设备CS片选引脚 */ gd25q_cs_pin = GD25Q_SPI_CS_PIN; - + rt_pin_mode(GD25Q_SPI_CS_PIN, GPIO_MODE_OUT_PP); res = rt_spi_bus_attach_device(&spi_dev_gd25q, SPI_DEVICE_NAME, SPI_BUS_NAME, (void*)gd25q_cs_pin); diff --git a/bsp/gd32303e-eval/drivers/drv_usart.c b/bsp/gd32303e-eval/drivers/drv_usart.c index 436f86fcb6..33430a5a31 100644 --- a/bsp/gd32303e-eval/drivers/drv_usart.c +++ b/bsp/gd32303e-eval/drivers/drv_usart.c @@ -44,7 +44,7 @@ struct gd32_uart uint32_t tx_port; uint16_t tx_pin; uint32_t rx_port; - uint16_t rx_pin; + uint16_t rx_pin; struct rt_serial_device * serial; char *device_name; @@ -143,7 +143,7 @@ static const struct gd32_uart uarts[] = { "uart0", }, #endif - + #ifdef RT_USING_USART1 { USART1, // uart peripheral index @@ -155,7 +155,7 @@ static const struct gd32_uart uarts[] = { "uart1", }, #endif - + #ifdef RT_USING_USART2 { USART2, // uart peripheral index @@ -167,7 +167,7 @@ static const struct gd32_uart uarts[] = { "uart2", }, #endif - + #ifdef RT_USING_UART3 { UART3, // uart peripheral index @@ -179,7 +179,7 @@ static const struct gd32_uart uarts[] = { "uart3", }, #endif - + #ifdef RT_USING_UART4 { UART4, // uart peripheral index @@ -228,9 +228,9 @@ static rt_err_t gd32_configure(struct rt_serial_device *serial, struct serial_co RT_ASSERT(cfg != RT_NULL); uart = (struct gd32_uart *)serial->parent.user_data; - + gd32_uart_gpio_init(uart); - + usart_baudrate_set(uart->uart_periph, cfg->baud_rate); switch (cfg->data_bits) @@ -310,7 +310,7 @@ static int gd32_putc(struct rt_serial_device *serial, char ch) usart_data_transmit(uart->uart_periph, ch); while((usart_flag_get(uart->uart_periph, USART_FLAG_TC) == RESET)); - + return 1; } diff --git a/bsp/gd32303e-eval/drivers/gd32f303e_eval.c b/bsp/gd32303e-eval/drivers/gd32f303e_eval.c index 0829f0bf00..c8982455a2 100644 --- a/bsp/gd32303e-eval/drivers/gd32f303e_eval.c +++ b/bsp/gd32303e-eval/drivers/gd32f303e_eval.c @@ -23,15 +23,15 @@ static uint32_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN, EVAL_COM2_RX_PIN}; static uint32_t COM_GPIO_PORT[COMn] = {EVAL_COM1_GPIO_PORT, EVAL_COM2_GPIO_PORT}; static rcu_periph_enum COM_GPIO_CLK[COMn] = {EVAL_COM1_GPIO_CLK, EVAL_COM2_GPIO_CLK}; -static rcu_periph_enum GPIO_CLK[LEDn] = {LED2_GPIO_CLK, LED3_GPIO_CLK, +static rcu_periph_enum GPIO_CLK[LEDn] = {LED2_GPIO_CLK, LED3_GPIO_CLK, LED4_GPIO_CLK, LED5_GPIO_CLK}; -static uint32_t KEY_PORT[KEYn] = {WAKEUP_KEY_GPIO_PORT, +static uint32_t KEY_PORT[KEYn] = {WAKEUP_KEY_GPIO_PORT, TAMPER_KEY_GPIO_PORT, USER_KEY1_GPIO_PORT, USER_KEY2_GPIO_PORT}; static uint32_t KEY_PIN[KEYn] = {WAKEUP_KEY_PIN, TAMPER_KEY_PIN,USER_KEY1_PIN,USER_KEY2_PIN}; -static rcu_periph_enum KEY_CLK[KEYn] = {WAKEUP_KEY_GPIO_CLK, +static rcu_periph_enum KEY_CLK[KEYn] = {WAKEUP_KEY_GPIO_CLK, TAMPER_KEY_GPIO_CLK, USER_KEY1_GPIO_CLK, USER_KEY2_GPIO_CLK}; @@ -47,7 +47,7 @@ static uint8_t KEY_PIN_SOURCE[KEYn] = {WAKEUP_KEY_EXTI_PIN_SOURCE, TAMPER_KEY_EXTI_PIN_SOURCE, USER_KEY1_EXTI_PIN_SOURCE, USER_KEY2_EXTI_PIN_SOURCE}; -static uint8_t KEY_IRQn[KEYn] = {WAKEUP_KEY_EXTI_IRQn, +static uint8_t KEY_IRQn[KEYn] = {WAKEUP_KEY_EXTI_IRQn, TAMPER_KEY_EXTI_IRQn, USER_KEY1_EXTI_IRQn, USER_KEY2_EXTI_IRQn}; @@ -66,7 +66,7 @@ void gd_eval_led_init (led_typedef_enum lednum) { /* enable the led clock */ rcu_periph_clock_enable(GPIO_CLK[lednum]); - /* configure led GPIO port */ + /* configure led GPIO port */ gpio_init(GPIO_PORT[lednum], GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN[lednum]); GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; @@ -114,7 +114,7 @@ void gd_eval_led_off(led_typedef_enum lednum) */ void gd_eval_led_toggle(led_typedef_enum lednum) { - gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum], + gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum], (bit_status)(1-gpio_input_bit_get(GPIO_PORT[lednum], GPIO_PIN[lednum]))); } @@ -184,7 +184,7 @@ void gd_eval_com_init(uint32_t com) }else if(EVAL_COM2 == com){ com_id = 1U; } - + /* enable GPIO clock */ rcu_periph_clock_enable(COM_GPIO_CLK[com_id]); diff --git a/bsp/gd32303e-eval/drivers/gd32f303e_eval.h b/bsp/gd32303e-eval/drivers/gd32f303e_eval.h index e841fb00f4..932102cbd7 100644 --- a/bsp/gd32303e-eval/drivers/gd32f303e_eval.h +++ b/bsp/gd32303e-eval/drivers/gd32f303e_eval.h @@ -17,9 +17,9 @@ #endif #include "gd32f30x.h" - + /* exported types */ -typedef enum +typedef enum { LED2 = 0, LED3 = 1, @@ -27,7 +27,7 @@ typedef enum LED5 = 3 } led_typedef_enum; -typedef enum +typedef enum { KEY_WAKEUP = 0, KEY_TAMPER = 1, @@ -35,7 +35,7 @@ typedef enum KEY_USER2 = 3 } key_typedef_enum; -typedef enum +typedef enum { KEY_MODE_GPIO = 0, KEY_MODE_EXTI = 1 @@ -47,15 +47,15 @@ typedef enum #define LED2_PIN GPIO_PIN_0 #define LED2_GPIO_PORT GPIOF #define LED2_GPIO_CLK RCU_GPIOF - + #define LED3_PIN GPIO_PIN_1 #define LED3_GPIO_PORT GPIOF #define LED3_GPIO_CLK RCU_GPIOF - + #define LED4_PIN GPIO_PIN_2 #define LED4_GPIO_PORT GPIOF #define LED4_GPIO_CLK RCU_GPIOF - + #define LED5_PIN GPIO_PIN_3 #define LED5_GPIO_PORT GPIOF #define LED5_GPIO_CLK RCU_GPIOF @@ -85,7 +85,7 @@ typedef enum #define WAKEUP_KEY_EXTI_LINE EXTI_0 #define WAKEUP_KEY_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOA #define WAKEUP_KEY_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_0 -#define WAKEUP_KEY_EXTI_IRQn EXTI0_IRQn +#define WAKEUP_KEY_EXTI_IRQn EXTI0_IRQn /* tamper push-button */ #define TAMPER_KEY_PIN GPIO_PIN_13 diff --git a/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.c b/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.c index 228feafdf8..3ca126e87e 100644 --- a/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.c +++ b/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.c @@ -15,7 +15,7 @@ /*! \brief lcd peripheral initialize - \param[in] none + \param[in] none \param[out] none \retval none */ @@ -37,15 +37,15 @@ void exmc_lcd_init(void) gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1| GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15); - /* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9), + /* PE7(EXMC_D4), PE8(EXMC_D5), PE9(EXMC_D6), PE10(EXMC_D7), PE11(EXMC_D8), PE12(EXMC_D9), PE13(EXMC_D10), PE14(EXMC_D11), PE15(EXMC_D12) */ - gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | - GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | + gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_7 | GPIO_PIN_8 | GPIO_PIN_9 | + GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); - /* configure PE2(EXMC_A23) */ + /* configure PE2(EXMC_A23) */ gpio_init(GPIOE, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_2); - + /* configure NOE and NWE */ gpio_init(GPIOD, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_4 | GPIO_PIN_5); @@ -106,7 +106,7 @@ uint16_t lcd_register_read(uint8_t register_id) { uint16_t data; *(__IO uint16_t *) (BANK0_LCD_C)= register_id; - data = *(__IO uint16_t *) (BANK0_LCD_D); + data = *(__IO uint16_t *) (BANK0_LCD_D); return data; } @@ -154,13 +154,13 @@ void lcd_gram_write(uint16_t rgb_code) uint16_t lcd_gram_read(void) { uint16_t data; - + /* write GRAM register (R22h) */ *(__IO uint16_t *) (BANK0_LCD_C) = 0x0022; /* dummy read (invalid data) */ - *(__IO uint16_t *) (BANK0_LCD_D); + *(__IO uint16_t *) (BANK0_LCD_D); - data = *(__IO uint16_t *) (BANK0_LCD_D); + data = *(__IO uint16_t *) (BANK0_LCD_D); return data; } @@ -219,7 +219,7 @@ void lcd_init(void) }else{ return; } - + for(i=50000;i>0;i--); } @@ -277,16 +277,16 @@ void lcd_point_set(uint16_t x,uint16_t y,uint16_t point) \param[in] x: the row-coordinate \param[in] y: the column-coordinate \param[out] none - \retval GRAM value of point + \retval GRAM value of point */ uint16_t lcd_point_get(uint16_t x,uint16_t y) { uint16_t data; - + if ((x > 240)||(y > 320)){ return 0; } - + lcd_cursor_set(x,y); data = lcd_gram_read(); @@ -410,7 +410,7 @@ void lcd_picture_draw(uint16_t start_x,uint16_t start_y,uint16_t end_x,uint16_t y = start_y; total = (end_x - start_x + 1) * (end_y - start_y + 1); - + for(i = 0; i < total; i ++){ /* set point according to the specified position and color */ lcd_point_set(x,y,*picturepointer++); @@ -441,7 +441,7 @@ void lcd_char_display(uint16_t x,uint16_t y,uint8_t c,char_format_struct c_forma uint16_t i = 0, j = 0; uint8_t temp_char = 0; uint16_t temp_char_16 = 0; - + if(CHAR_FONT_8_16 == c_format.font){ /* 8x16 ASCII */ for (i = 0; i < 16; i++) { temp_char = ascii_8x16[((c - 0x20) * 16) + i]; diff --git a/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.h b/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.h index 800a02c8c5..db76bc17d5 100644 --- a/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.h +++ b/bsp/gd32303e-eval/drivers/gd32f303e_lcd_eval.h @@ -155,7 +155,7 @@ /* char format struct definitions */ typedef struct -{ +{ uint16_t font; /*!< the type of font */ uint16_t direction; /*!< the direction of char */ uint16_t char_color; /*!< the color of char */ diff --git a/bsp/gd32450z-eval/drivers/board.h b/bsp/gd32450z-eval/drivers/board.h index d6384ae820..49e9bf56c4 100644 --- a/bsp/gd32450z-eval/drivers/board.h +++ b/bsp/gd32450z-eval/drivers/board.h @@ -22,7 +22,7 @@ #define EXT_SDRAM_END (EXT_SDRAM_BEGIN + (32U * 1024 * 1024)) /* the end address of external SDRAM */ // Internal SRAM memory size[Kbytes] <8-64> -// Default: 64 +// Default: 64 #ifdef __ICCARM__ // Use *.icf ram symbal, to avoid hardcode. extern char __ICFEDIT_region_RAM_end__; diff --git a/bsp/gd32450z-eval/drivers/drv_enet.c b/bsp/gd32450z-eval/drivers/drv_enet.c index b1bf632f54..66a6f9d516 100644 --- a/bsp/gd32450z-eval/drivers/drv_enet.c +++ b/bsp/gd32450z-eval/drivers/drv_enet.c @@ -35,16 +35,16 @@ //#define EMAC_TX_DUMP #ifdef EMAC_DEBUG -#define EMAC_TRACE rt_kprintf +#define EMAC_TRACE rt_kprintf #else #define EMAC_TRACE(...) #endif -#define EMAC_RXBUFNB 4 -#define EMAC_TXBUFNB 2 +#define EMAC_RXBUFNB 4 +#define EMAC_TXBUFNB 2 -#define EMAC_PHY_AUTO 0 -#define EMAC_PHY_10MBIT 1 +#define EMAC_PHY_AUTO 0 +#define EMAC_PHY_10MBIT 1 #define EMAC_PHY_100MBIT 2 #define MAX_ADDR_LEN 6 @@ -55,14 +55,14 @@ struct gd32_emac rt_uint8_t phy_mode; /* interface address info. */ - rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* hw address */ + rt_uint8_t dev_addr[MAX_ADDR_LEN]; /* hw address */ struct rt_synopsys_eth * ETHERNET_MAC; IRQn_Type ETHER_MAC_IRQ; - + EMAC_DMADESCTypeDef *DMATxDescToSet; EMAC_DMADESCTypeDef *DMARxDescToGet; - + #pragma pack(4) EMAC_DMADESCTypeDef DMARxDscrTab[EMAC_RXBUFNB]; #pragma pack(4) @@ -71,7 +71,7 @@ struct gd32_emac rt_uint8_t Rx_Buff[EMAC_RXBUFNB][EMAC_MAX_PACKET_SIZE]; #pragma pack(4) rt_uint8_t Tx_Buff[EMAC_TXBUFNB][EMAC_MAX_PACKET_SIZE]; - + struct rt_semaphore tx_buf_free; }; @@ -548,14 +548,14 @@ static void enet_gpio_config(void) rcu_periph_clock_enable(RCU_GPIOG); rcu_periph_clock_enable(RCU_GPIOH); rcu_periph_clock_enable(RCU_GPIOI); - + gpio_af_set(GPIOA, GPIO_AF_0, GPIO_PIN_8); gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_8); gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_8); - + /* enable SYSCFG clock */ rcu_periph_clock_enable(RCU_SYSCFG); - + /* choose DIV2 to get 50MHz from 200MHz on CKOUT0 pin (PA8) to clock the PHY */ rcu_ckout0_config(RCU_CKOUT0SRC_PLLP, RCU_CKOUT0_DIV4); syscfg_enet_phy_interface_config(SYSCFG_ENET_PHY_RMII); @@ -563,31 +563,31 @@ static void enet_gpio_config(void) /* PA1: ETH_RMII_REF_CLK */ gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_1); gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_1); - + /* PA2: ETH_MDIO */ gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_2); gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_2); - + /* PA7: ETH_RMII_CRS_DV */ gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_7); - gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_7); - + gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_7); + gpio_af_set(GPIOA, GPIO_AF_11, GPIO_PIN_1); gpio_af_set(GPIOA, GPIO_AF_11, GPIO_PIN_2); gpio_af_set(GPIOA, GPIO_AF_11, GPIO_PIN_7); - + /* PB11: ETH_RMII_TX_EN */ gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_11); gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_11); - + /* PB12: ETH_RMII_TXD0 */ gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_12); gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_12); - + /* PB13: ETH_RMII_TXD1 */ gpio_mode_set(GPIOB, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_13); - gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_13); - + gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_13); + gpio_af_set(GPIOB, GPIO_AF_11, GPIO_PIN_11); gpio_af_set(GPIOB, GPIO_AF_11, GPIO_PIN_12); gpio_af_set(GPIOB, GPIO_AF_11, GPIO_PIN_13); @@ -599,11 +599,11 @@ static void enet_gpio_config(void) /* PC4: ETH_RMII_RXD0 */ gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4); gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_4); - + /* PC5: ETH_RMII_RXD1 */ gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_5); - gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_5); - + gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ,GPIO_PIN_5); + gpio_af_set(GPIOC, GPIO_AF_11, GPIO_PIN_1); gpio_af_set(GPIOC, GPIO_AF_11, GPIO_PIN_4); gpio_af_set(GPIOC, GPIO_AF_11, GPIO_PIN_5); @@ -613,17 +613,17 @@ static void enet_gpio_config(void) int rt_hw_gd32_eth_init(void) { rt_kprintf("rt_gd32_eth_init...\n"); - + /* enable ethernet clock */ rcu_periph_clock_enable(RCU_ENET); rcu_periph_clock_enable(RCU_ENETTX); rcu_periph_clock_enable(RCU_ENETRX); - + nvic_configuration(); - + /* configure the GPIO ports for ethernet pins */ enet_gpio_config(); - + /* set autonegotiation mode */ gd32_emac_device0.phy_mode = EMAC_PHY_AUTO; gd32_emac_device0.ETHERNET_MAC = ETHERNET_MAC0; @@ -638,16 +638,16 @@ int rt_hw_gd32_eth_init(void) gd32_emac_device0.dev_addr[4] = 0x34; gd32_emac_device0.dev_addr[5] = 0x56; - gd32_emac_device0.parent.parent.init = gd32_emac_init; - gd32_emac_device0.parent.parent.open = gd32_emac_open; - gd32_emac_device0.parent.parent.close = gd32_emac_close; - gd32_emac_device0.parent.parent.read = gd32_emac_read; - gd32_emac_device0.parent.parent.write = gd32_emac_write; - gd32_emac_device0.parent.parent.control = gd32_emac_control; + gd32_emac_device0.parent.parent.init = gd32_emac_init; + gd32_emac_device0.parent.parent.open = gd32_emac_open; + gd32_emac_device0.parent.parent.close = gd32_emac_close; + gd32_emac_device0.parent.parent.read = gd32_emac_read; + gd32_emac_device0.parent.parent.write = gd32_emac_write; + gd32_emac_device0.parent.parent.control = gd32_emac_control; gd32_emac_device0.parent.parent.user_data = RT_NULL; - gd32_emac_device0.parent.eth_rx = gd32_emac_rx; - gd32_emac_device0.parent.eth_tx = gd32_emac_tx; + gd32_emac_device0.parent.eth_rx = gd32_emac_rx; + gd32_emac_device0.parent.eth_tx = gd32_emac_tx; /* init tx buffer free semaphore */ rt_sem_init(&gd32_emac_device0.tx_buf_free, "tx_buf0", EMAC_TXBUFNB, RT_IPC_FLAG_FIFO); diff --git a/bsp/gd32450z-eval/drivers/drv_exmc_sdram.c b/bsp/gd32450z-eval/drivers/drv_exmc_sdram.c index 41355987b5..3fe8866dfb 100644 --- a/bsp/gd32450z-eval/drivers/drv_exmc_sdram.c +++ b/bsp/gd32450z-eval/drivers/drv_exmc_sdram.c @@ -47,7 +47,7 @@ static void delay_1ms(volatile uint32_t count) /*! \brief sdram peripheral initialize - \param[in] sdram_device: specifie the SDRAM device + \param[in] sdram_device: specifie the SDRAM device \param[out] none \retval none */ @@ -71,7 +71,7 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) rcu_periph_clock_enable(RCU_GPIOH); /* common GPIO configuration */ - /* SDNWE(PC0),SDNE0(PC2),SDCKE0(PC3) pin configuration */ + /* SDNWE(PC0),SDNE0(PC2),SDCKE0(PC3) pin configuration */ gpio_af_set(GPIOC, GPIO_AF_12, GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3); gpio_mode_set(GPIOC, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3); gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3); @@ -107,11 +107,11 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); /* A10(PG0),A11(PG1),A12(PG2),A14(PG4),A15(PG5),SDCLK(PG8),NCAS(PG15) pin configuration */ - gpio_af_set(GPIOG, GPIO_AF_12, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | + gpio_af_set(GPIOG, GPIO_AF_12, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_15); - gpio_mode_set(GPIOG, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | + gpio_mode_set(GPIOG, GPIO_MODE_AF, GPIO_PUPD_PULLUP, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_15); - gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | + gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_8 | GPIO_PIN_15); /* specify which SDRAM to read and write */ @@ -126,7 +126,7 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) /* LMRD: 2 clock cycles */ sdram_timing_init_struct.load_mode_register_delay = 2; /* XSRD: min = 67ns */ - sdram_timing_init_struct.exit_selfrefresh_delay = 7; + sdram_timing_init_struct.exit_selfrefresh_delay = 7; /* RASD: min=42ns , max=120k (ns) */ sdram_timing_init_struct.row_address_select_delay = 5; /* ARFD: min=60ns */ @@ -144,9 +144,9 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) sdram_init_struct.row_address_width = EXMC_SDRAM_ROW_ADDRESS_13; sdram_init_struct.data_width = EXMC_SDRAM_DATABUS_WIDTH_16B; sdram_init_struct.internal_bank_number = EXMC_SDRAM_4_INTER_BANK; - sdram_init_struct.cas_latency = EXMC_CAS_LATENCY_3_SDCLK; + sdram_init_struct.cas_latency = EXMC_CAS_LATENCY_3_SDCLK; sdram_init_struct.write_protection = DISABLE; - sdram_init_struct.sdclock_config = EXMC_SDCLK_PERIODS_2_HCLK; + sdram_init_struct.sdclock_config = EXMC_SDCLK_PERIODS_2_HCLK; sdram_init_struct.brust_read_switch = ENABLE; sdram_init_struct.pipeline_read_delay = EXMC_PIPELINE_DELAY_1_HCLK; sdram_init_struct.timing = &sdram_timing_init_struct; @@ -158,7 +158,7 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) sdram_command_init_struct.bank_select = bank_select; sdram_command_init_struct.auto_refresh_number = EXMC_SDRAM_AUTO_REFLESH_1_SDCLK; sdram_command_init_struct.mode_register_content = 0; - /* wait until the SDRAM controller is ready */ + /* wait until the SDRAM controller is ready */ while((exmc_flag_get(sdram_device, EXMC_SDRAM_FLAG_NREADY) != RESET) && (timeout > 0)){ timeout--; } @@ -174,7 +174,7 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) sdram_command_init_struct.auto_refresh_number = EXMC_SDRAM_AUTO_REFLESH_1_SDCLK; sdram_command_init_struct.mode_register_content = 0; /* wait until the SDRAM controller is ready */ - timeout = SDRAM_TIMEOUT; + timeout = SDRAM_TIMEOUT; while((exmc_flag_get(sdram_device, EXMC_SDRAM_FLAG_NREADY) != RESET) && (timeout > 0)){ timeout--; } @@ -186,8 +186,8 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) sdram_command_init_struct.bank_select = bank_select; sdram_command_init_struct.auto_refresh_number = EXMC_SDRAM_AUTO_REFLESH_8_SDCLK; sdram_command_init_struct.mode_register_content = 0; - /* wait until the SDRAM controller is ready */ - timeout = SDRAM_TIMEOUT; + /* wait until the SDRAM controller is ready */ + timeout = SDRAM_TIMEOUT; while((exmc_flag_get(sdram_device, EXMC_SDRAM_FLAG_NREADY) != RESET) && (timeout > 0)){ timeout--; } @@ -207,8 +207,8 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) sdram_command_init_struct.auto_refresh_number = EXMC_SDRAM_AUTO_REFLESH_1_SDCLK; sdram_command_init_struct.mode_register_content = command_content; - /* wait until the SDRAM controller is ready */ - timeout = SDRAM_TIMEOUT; + /* wait until the SDRAM controller is ready */ + timeout = SDRAM_TIMEOUT; while((exmc_flag_get(sdram_device, EXMC_SDRAM_FLAG_NREADY) != RESET) && (timeout > 0)){ timeout--; } @@ -221,8 +221,8 @@ void exmc_synchronous_dynamic_ram_init(uint32_t sdram_device) /* (7.81 us * SDCLK_Freq) - 20 */ exmc_sdram_refresh_count_set(761); - /* wait until the SDRAM controller is ready */ - timeout = SDRAM_TIMEOUT; + /* wait until the SDRAM controller is ready */ + timeout = SDRAM_TIMEOUT; while((exmc_flag_get(sdram_device, EXMC_SDRAM_FLAG_NREADY) != RESET) && (timeout > 0)){ timeout--; } @@ -258,20 +258,20 @@ void fill_buffer(uint8_t *pbuffer, uint16_t buffer_lengh, uint16_t offset) void sdram_writebuffer_8(uint32_t sdram_device,uint8_t* pbuffer, uint32_t writeaddr, uint32_t numbytetowrite) { uint32_t temp_addr; - + /* Select the base address according to EXMC_Bank */ if(sdram_device == EXMC_SDRAM_DEVICE0){ temp_addr = SDRAM_DEVICE0_ADDR; }else{ temp_addr = SDRAM_DEVICE1_ADDR; } - + /* While there is data to write */ for(; numbytetowrite != 0; numbytetowrite--) { /* Transfer data to the memory */ *(uint8_t *) (temp_addr + writeaddr) = *pbuffer++; - /* Increment the address*/ + /* Increment the address*/ writeaddr += 1; } } @@ -288,19 +288,19 @@ void sdram_writebuffer_8(uint32_t sdram_device,uint8_t* pbuffer, uint32_t writea void sdram_readbuffer_8(uint32_t sdram_device,uint8_t* pbuffer, uint32_t readaddr, uint32_t numbytetoread) { uint32_t temp_addr; - + /* select the base address according to EXMC_Bank */ if(sdram_device == EXMC_SDRAM_DEVICE0){ temp_addr = SDRAM_DEVICE0_ADDR; }else{ temp_addr = SDRAM_DEVICE1_ADDR; } - + /* while there is data to read */ for(; numbytetoread != 0; numbytetoread--){ /* read a byte from the memory */ *pbuffer++ = *(uint8_t*) (temp_addr + readaddr); - + /* increment the address */ readaddr += 1; } diff --git a/bsp/gd32450z-eval/drivers/drv_lcd.c b/bsp/gd32450z-eval/drivers/drv_lcd.c index 50d5c685c5..8f9e65c266 100644 --- a/bsp/gd32450z-eval/drivers/drv_lcd.c +++ b/bsp/gd32450z-eval/drivers/drv_lcd.c @@ -41,7 +41,7 @@ static struct rt_device_graphic_info _lcd_info; static struct rt_device lcd; /*! - \brief configure TLI GPIO + \brief configure TLI GPIO \param[in] none \param[out] none \retval none @@ -57,34 +57,34 @@ static void tli_gpio_config(void) rcu_periph_clock_enable(RCU_GPIOG); /* configure HSYNC(PC6), VSYNC(PA4), PCLK(PG7), DE(PF10) */ - /* configure LCD_R7(PG6), LCD_R6(PA8), LCD_R5(PA12), LCD_R4(PA11), LCD_R3(PB0), + /* configure LCD_R7(PG6), LCD_R6(PA8), LCD_R5(PA12), LCD_R4(PA11), LCD_R3(PB0), LCD_G7(PD3), LCD_G6(PC7), LCD_G5(PB11), LCD_G4(PB10), LCD_G3(PG10), LCD_G2(PA6), LCD_B7(PB9), LCD_B6(PB8), LCD_B5(PA3), LCD_B4(PG12), LCD_B3(PG11) */ - gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_3); + gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_3); gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_4); - gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_6); - gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_12); - gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_11); - gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_8); - - gpio_af_set(GPIOB,GPIO_AF_9,GPIO_PIN_0); - gpio_af_set(GPIOB,GPIO_AF_14,GPIO_PIN_10); + gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_6); + gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_12); + gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_11); + gpio_af_set(GPIOA,GPIO_AF_14,GPIO_PIN_8); + + gpio_af_set(GPIOB,GPIO_AF_9,GPIO_PIN_0); + gpio_af_set(GPIOB,GPIO_AF_14,GPIO_PIN_10); //gpio_af_set(GPIOB,GPIO_AF_14,GPIO_PIN_11); - gpio_af_set(GPIOB,GPIO_AF_14,GPIO_PIN_8); + gpio_af_set(GPIOB,GPIO_AF_14,GPIO_PIN_8); gpio_af_set(GPIOB,GPIO_AF_14,GPIO_PIN_9); - - gpio_af_set(GPIOC,GPIO_AF_14,GPIO_PIN_6); + + gpio_af_set(GPIOC,GPIO_AF_14,GPIO_PIN_6); gpio_af_set(GPIOC,GPIO_AF_14,GPIO_PIN_7); - - gpio_af_set(GPIOD,GPIO_AF_14,GPIO_PIN_3); - gpio_af_set(GPIOF,GPIO_AF_14,GPIO_PIN_10); - - gpio_af_set(GPIOG,GPIO_AF_14,GPIO_PIN_6); + gpio_af_set(GPIOD,GPIO_AF_14,GPIO_PIN_3); + + gpio_af_set(GPIOF,GPIO_AF_14,GPIO_PIN_10); + + gpio_af_set(GPIOG,GPIO_AF_14,GPIO_PIN_6); gpio_af_set(GPIOG,GPIO_AF_14,GPIO_PIN_7); gpio_af_set(GPIOG,GPIO_AF_9,GPIO_PIN_10); - gpio_af_set(GPIOG,GPIO_AF_14,GPIO_PIN_11); - gpio_af_set(GPIOG,GPIO_AF_9,GPIO_PIN_12); + gpio_af_set(GPIOG,GPIO_AF_14,GPIO_PIN_11); + gpio_af_set(GPIOG,GPIO_AF_9,GPIO_PIN_12); gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_4|GPIO_PIN_3|GPIO_PIN_6 |GPIO_PIN_8|GPIO_PIN_11|GPIO_PIN_12); @@ -123,15 +123,15 @@ static void lcd_config(void) lcd_ctrl_line_config(); lcd_disable(); lcd_enable(); - + /* configure the GPIO of TLI */ tli_gpio_config(); /* configure the LCD_SPI */ - lcd_spi_config(); + lcd_spi_config(); /* power on the LCD */ //lcd_power_on(); - lcd_power_on3(); //New Version 3.5" TFT RGB Hardware needs use this initilize funtion ---By xufei 2016.10.21 + lcd_power_on3(); //New Version 3.5" TFT RGB Hardware needs use this initilize funtion ---By xufei 2016.10.21 } /*! @@ -144,7 +144,7 @@ static void tli_config(void) { tli_parameter_struct tli_init_struct; tli_layer_parameter_struct tli_layer_init_struct; - + rcu_periph_clock_enable(RCU_TLI); /* configure the PLLSAI clock to generate lcd clock */ @@ -156,52 +156,52 @@ static void tli_config(void) if(ERROR == rcu_osci_stab_wait(RCU_PLLSAI_CK)){ while(1); } - + /* TLI initialization */ tli_init_struct.signalpolarity_hs = TLI_HSYN_ACTLIVE_LOW; tli_init_struct.signalpolarity_vs = TLI_VSYN_ACTLIVE_LOW; tli_init_struct.signalpolarity_de = TLI_DE_ACTLIVE_LOW; tli_init_struct.signalpolarity_pixelck = TLI_PIXEL_CLOCK_TLI; - + /* LCD display timing configuration */ tli_init_struct.synpsz_hpsz = LCD_480_320_HSYNC; tli_init_struct.synpsz_vpsz = LCD_480_320_VSYNC; - tli_init_struct.backpsz_hbpsz = LCD_480_320_HSYNC + LCD_480_320_HBP; - tli_init_struct.backpsz_vbpsz = LCD_480_320_VSYNC + LCD_480_320_VBP; + tli_init_struct.backpsz_hbpsz = LCD_480_320_HSYNC + LCD_480_320_HBP; + tli_init_struct.backpsz_vbpsz = LCD_480_320_VSYNC + LCD_480_320_VBP; tli_init_struct.activesz_hasz = RT_HW_LCD_WIDTH + LCD_480_320_HSYNC + LCD_480_320_HBP; tli_init_struct.activesz_vasz = RT_HW_LCD_HEIGHT + LCD_480_320_VSYNC + LCD_480_320_VBP; - tli_init_struct.totalsz_htsz = RT_HW_LCD_WIDTH + LCD_480_320_HSYNC + LCD_480_320_HBP + LCD_480_320_HFP; + tli_init_struct.totalsz_htsz = RT_HW_LCD_WIDTH + LCD_480_320_HSYNC + LCD_480_320_HBP + LCD_480_320_HFP; tli_init_struct.totalsz_vtsz = RT_HW_LCD_HEIGHT + LCD_480_320_VSYNC + LCD_480_320_VBP + LCD_480_320_VFP; - + /* LCD background color configure*/ tli_init_struct.backcolor_red = 0x00; tli_init_struct.backcolor_green = 0x00; - tli_init_struct.backcolor_blue = 0x00; + tli_init_struct.backcolor_blue = 0x00; tli_init(&tli_init_struct); - + lcd_framebuffer = rt_malloc(sizeof(rt_uint16_t) * RT_HW_LCD_HEIGHT * RT_HW_LCD_WIDTH); RT_ASSERT(lcd_framebuffer != NULL); rt_memset(lcd_framebuffer, 0, sizeof(rt_uint16_t) * RT_HW_LCD_WIDTH * RT_HW_LCD_HEIGHT); /* TLI layer0 configuration */ tli_layer_init_struct.layer_window_leftpos = tli_init_struct.backpsz_hbpsz + 1; - tli_layer_init_struct.layer_window_rightpos = tli_init_struct.backpsz_hbpsz + RT_HW_LCD_WIDTH; + tli_layer_init_struct.layer_window_rightpos = tli_init_struct.backpsz_hbpsz + RT_HW_LCD_WIDTH; tli_layer_init_struct.layer_window_toppos = tli_init_struct.backpsz_vbpsz + 1; tli_layer_init_struct.layer_window_bottompos = tli_init_struct.backpsz_vbpsz + RT_HW_LCD_HEIGHT; - + tli_layer_init_struct.layer_ppf = LAYER_PPF_RGB565; tli_layer_init_struct.layer_sa = 0xFF; - tli_layer_init_struct.layer_default_blue = 0x00; - tli_layer_init_struct.layer_default_green = 0x00; - tli_layer_init_struct.layer_default_red = 0x00; + tli_layer_init_struct.layer_default_blue = 0x00; + tli_layer_init_struct.layer_default_green = 0x00; + tli_layer_init_struct.layer_default_red = 0x00; tli_layer_init_struct.layer_default_alpha = 0x00; - tli_layer_init_struct.layer_acf1 = LAYER_ACF1_PASA; + tli_layer_init_struct.layer_acf1 = LAYER_ACF1_PASA; tli_layer_init_struct.layer_acf2 = LAYER_ACF2_PASA; - tli_layer_init_struct.layer_frame_bufaddr = (uint32_t)lcd_framebuffer; - tli_layer_init_struct.layer_frame_line_length = ((RT_HW_LCD_WIDTH * 2) + 3); + tli_layer_init_struct.layer_frame_bufaddr = (uint32_t)lcd_framebuffer; + tli_layer_init_struct.layer_frame_line_length = ((RT_HW_LCD_WIDTH * 2) + 3); tli_layer_init_struct.layer_frame_buf_stride_offset = (RT_HW_LCD_WIDTH * 2); - tli_layer_init_struct.layer_frame_total_line_number = RT_HW_LCD_HEIGHT; - + tli_layer_init_struct.layer_frame_total_line_number = RT_HW_LCD_HEIGHT; + tli_layer_init(LAYER0, &tli_layer_init_struct); } @@ -210,21 +210,21 @@ static rt_err_t rt_lcd_control(rt_device_t dev, int cmd, void *args) switch (cmd) { case RTGRAPHIC_CTRL_RECT_UPDATE: - { + { memcpy((void *)lcd_framebuffer, _rt_framebuffer, sizeof(rt_uint16_t)*RT_HW_LCD_HEIGHT * RT_HW_LCD_WIDTH); } break; - + case RTGRAPHIC_CTRL_POWERON: break; - + case RTGRAPHIC_CTRL_POWEROFF: break; - + case RTGRAPHIC_CTRL_GET_INFO: memcpy(args, &_lcd_info, sizeof(_lcd_info)); break; - + case RTGRAPHIC_CTRL_SET_MODE: break; } @@ -235,21 +235,21 @@ static rt_err_t rt_lcd_control(rt_device_t dev, int cmd, void *args) int gd32_hw_lcd_init(void) { _rt_framebuffer = rt_malloc_align(sizeof(rt_uint16_t) * RT_HW_LCD_WIDTH * RT_HW_LCD_HEIGHT, 32); - if (_rt_framebuffer == RT_NULL) + if (_rt_framebuffer == RT_NULL) return -1; /* no memory yet */ - + lcd_config(); tli_config(); - tli_layer_enable(LAYER0); + tli_layer_enable(LAYER0); tli_reload_config(TLI_FRAME_BLANK_RELOAD_EN); tli_enable(); - + _lcd_info.bits_per_pixel = LCD_BITS_PER_PIXEL; _lcd_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565; _lcd_info.framebuffer = (void *)_rt_framebuffer; _lcd_info.width = RT_HW_LCD_WIDTH; _lcd_info.height = RT_HW_LCD_HEIGHT; - + lcd.type = RT_Device_Class_Graphic; lcd.init = NULL; lcd.open = NULL; @@ -258,10 +258,10 @@ int gd32_hw_lcd_init(void) lcd.write = NULL; lcd.control = rt_lcd_control; lcd.user_data = (void *)&_lcd_info; - + /* register lcd device to RT-Thread */ rt_device_register(&lcd, "lcd", RT_DEVICE_FLAG_RDWR); - + return 0; } INIT_DEVICE_EXPORT(gd32_hw_lcd_init); diff --git a/bsp/gd32450z-eval/drivers/drv_spi.c b/bsp/gd32450z-eval/drivers/drv_spi.c index f4e56e1a8c..a1fc143cf2 100644 --- a/bsp/gd32450z-eval/drivers/drv_spi.c +++ b/bsp/gd32450z-eval/drivers/drv_spi.c @@ -11,7 +11,7 @@ * Date Author Notes * 2017-06-05 tanek first implementation. */ - + #include "drv_spi.h" #include @@ -32,7 +32,7 @@ #ifdef DEBUG #define DEBUG_PRINTF(...) rt_kprintf(__VA_ARGS__) #else -#define DEBUG_PRINTF(...) +#define DEBUG_PRINTF(...) #endif /* private rt-thread spi ops function */ @@ -48,16 +48,16 @@ static struct rt_spi_ops gd32_spi_ops = static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configuration* configuration) { - struct rt_spi_bus * spi_bus = (struct rt_spi_bus *)device->bus; + struct rt_spi_bus * spi_bus = (struct rt_spi_bus *)device->bus; struct gd32f4_spi *f4_spi = (struct gd32f4_spi *)spi_bus->parent.user_data; - + spi_parameter_struct spi_init_struct; uint32_t spi_periph = f4_spi->spi_periph; - RT_ASSERT(device != RT_NULL); - RT_ASSERT(configuration != RT_NULL); + RT_ASSERT(device != RT_NULL); + RT_ASSERT(configuration != RT_NULL); /* data_width */ if(configuration->data_width <= 8) @@ -129,7 +129,7 @@ static rt_err_t configure(struct rt_spi_device* device, spi_init_struct.prescale = SPI_PSC_256; } } /* baudrate */ - + switch(configuration->mode & RT_SPI_MODE_3) { case RT_SPI_MODE_0: @@ -137,15 +137,15 @@ static rt_err_t configure(struct rt_spi_device* device, break; case RT_SPI_MODE_1: spi_init_struct.clock_polarity_phase = SPI_CK_PL_LOW_PH_2EDGE; - break; + break; case RT_SPI_MODE_2: spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_1EDGE; - break; + break; case RT_SPI_MODE_3: spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; break; } - + /* MSB or LSB */ if(configuration->mode & RT_SPI_MSB) { @@ -155,18 +155,18 @@ static rt_err_t configure(struct rt_spi_device* device, { spi_init_struct.endian = SPI_ENDIAN_LSB; } - + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; spi_init_struct.device_mode = SPI_MASTER; spi_init_struct.nss = SPI_NSS_SOFT; - + spi_crc_off(spi_periph); /* init SPI */ spi_init(spi_periph, &spi_init_struct); /* Enable SPI_MASTER */ - spi_enable(spi_periph); - + spi_enable(spi_periph); + return RT_EOK; }; @@ -178,9 +178,9 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes struct gd32_spi_cs * gd32_spi_cs = device->parent.user_data; uint32_t spi_periph = f4_spi->spi_periph; - RT_ASSERT(device != NULL); - RT_ASSERT(message != NULL); - + RT_ASSERT(device != NULL); + RT_ASSERT(message != NULL); + /* take CS */ if(message->cs_take) { @@ -194,7 +194,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes const rt_uint8_t * send_ptr = message->send_buf; rt_uint8_t * recv_ptr = message->recv_buf; rt_uint32_t size = message->length; - + DEBUG_PRINTF("spi poll transfer start: %d\n", size); while(size--) @@ -205,12 +205,12 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes { data = *send_ptr++; } - + // Todo: replace register read/write by gd32f4 lib //Wait until the transmit buffer is empty while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE)); // Send the byte - spi_i2s_data_transmit(spi_periph, data); + spi_i2s_data_transmit(spi_periph, data); //Wait until a data is received while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_RBNE)); @@ -242,7 +242,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes //Wait until the transmit buffer is empty while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE)); // Send the byte - spi_i2s_data_transmit(spi_periph, data); + spi_i2s_data_transmit(spi_periph, data); //Wait until a data is received while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_RBNE)); @@ -260,7 +260,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes /* release CS */ if(message->cs_release) { - gpio_bit_set(gd32_spi_cs->GPIOx, gd32_spi_cs->GPIO_Pin); + gpio_bit_set(gd32_spi_cs->GPIOx, gd32_spi_cs->GPIO_Pin); DEBUG_PRINTF("spi release cs\n"); } @@ -274,7 +274,7 @@ static const struct gd32f4_spi spis[] = { #ifdef RT_USING_SPI0 {SPI0, RCU_SPI0, &spi_bus[0]}, #endif - + #ifdef RT_USING_SPI1 {SPI1, RCU_SPI1, &spi_bus[1]}, #endif @@ -286,11 +286,11 @@ static const struct gd32f4_spi spis[] = { #ifdef RT_USING_SPI3 {SPI3, RCU_SPI3, &spi_bus[3]}, #endif - + #ifdef RT_USING_SPI4 {SPI4, RCU_SPI4, &spi_bus[4]}, #endif - + #ifdef RT_USING_SPI5 {SPI5, RCU_SPI5, &spi_bus[5]}, #endif @@ -310,9 +310,9 @@ rt_err_t gd32_spi_bus_register(uint32_t spi_periph, const char * spi_bus_name) { int i; - + RT_ASSERT(spi_bus_name != RT_NULL); - + for (i = 0; i < ARR_LEN(spis); i++) { if (spi_periph == spis[i].spi_periph) @@ -323,7 +323,7 @@ rt_err_t gd32_spi_bus_register(uint32_t spi_periph, return RT_EOK; } } - + return RT_ERROR; } #endif diff --git a/bsp/gd32450z-eval/drivers/drv_spi.h b/bsp/gd32450z-eval/drivers/drv_spi.h index c97cbba880..692da41cbe 100644 --- a/bsp/gd32450z-eval/drivers/drv_spi.h +++ b/bsp/gd32450z-eval/drivers/drv_spi.h @@ -36,7 +36,7 @@ struct gd32_spi_cs /* public function */ rt_err_t gd32_spi_bus_register(uint32_t spi_periph, - //struct gd32_spi_bus * gd32_spi, - const char * spi_bus_name); + //struct gd32_spi_bus * gd32_spi, + const char * spi_bus_name); #endif // gd32F20X_40X_SPI_H_INCLUDED diff --git a/bsp/gd32450z-eval/drivers/drv_spi_flash.c b/bsp/gd32450z-eval/drivers/drv_spi_flash.c index 9b60753472..1731d1499b 100644 --- a/bsp/gd32450z-eval/drivers/drv_spi_flash.c +++ b/bsp/gd32450z-eval/drivers/drv_spi_flash.c @@ -32,8 +32,8 @@ static int rt_hw_spi5_init(void) { /* register spi bus */ { - rt_err_t result; - + rt_err_t result; + rcu_periph_clock_enable(RCU_GPIOG); rcu_periph_clock_enable(RCU_SPI5); @@ -42,36 +42,36 @@ static int rt_hw_spi5_init(void) gpio_mode_set(GPIOG, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10|GPIO_PIN_11| GPIO_PIN_12|GPIO_PIN_13| GPIO_PIN_14); gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_200MHZ, GPIO_PIN_10|GPIO_PIN_11| GPIO_PIN_12|GPIO_PIN_13| GPIO_PIN_14); - result = gd32_spi_bus_register(SPI5, SPI_BUS_NAME); + result = gd32_spi_bus_register(SPI5, SPI_BUS_NAME); if (result != RT_EOK) - { - return result; - } + { + return result; + } } /* attach cs */ { static struct rt_spi_device spi_device; static struct gd32_spi_cs spi_cs; - rt_err_t result; - + rt_err_t result; + spi_cs.GPIOx = GPIOG; spi_cs.GPIO_Pin = GPIO_PIN_9; - + /* SPI5_CS(PG9) GPIO pin configuration */ gpio_mode_set(GPIOG, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_9); gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); - + gpio_bit_set(GPIOG,GPIO_PIN_9); result = rt_spi_bus_attach_device(&spi_device, SPI_FLASH_DEVICE_NAME, SPI_BUS_NAME, (void*)&spi_cs); - if (result != RT_EOK) - { - return result; - } + if (result != RT_EOK) + { + return result; + } } - return RT_EOK; + return RT_EOK; } INIT_DEVICE_EXPORT(rt_hw_spi5_init); @@ -83,7 +83,7 @@ static int rt_hw_spi_flash_with_sfud_init(void) return RT_ERROR; }; - return RT_EOK; + return RT_EOK; } INIT_COMPONENT_EXPORT(rt_hw_spi_flash_with_sfud_init) #endif diff --git a/bsp/gd32450z-eval/drivers/drv_usart.c b/bsp/gd32450z-eval/drivers/drv_usart.c index 2b0b9c84b0..226c6fd121 100644 --- a/bsp/gd32450z-eval/drivers/drv_usart.c +++ b/bsp/gd32450z-eval/drivers/drv_usart.c @@ -37,7 +37,7 @@ struct gd32_uart { uint32_t uart_periph; //Todo: 3bits - IRQn_Type irqn; //Todo: 7bits + IRQn_Type irqn; //Todo: 7bits rcu_periph_enum per_clk; //Todo: 5bits rcu_periph_enum tx_gpio_clk; //Todo: 5bits rcu_periph_enum rx_gpio_clk; //Todo: 5bits @@ -48,7 +48,7 @@ struct gd32_uart uint16_t rx_af; //Todo: 4bits uint16_t rx_pin; //Todo: 4bits - struct rt_serial_device * serial; + struct rt_serial_device * serial; char *device_name; }; @@ -193,7 +193,7 @@ static const struct gd32_uart uarts[] = { "uart0", }, #endif - + #ifdef BSP_USING_UART1 { USART1, // uart peripheral index @@ -205,7 +205,7 @@ static const struct gd32_uart uarts[] = { "uart1", }, #endif - + #ifdef BSP_USING_UART2 { USART2, // uart peripheral index @@ -217,7 +217,7 @@ static const struct gd32_uart uarts[] = { "uart2", }, #endif - + #ifdef BSP_USING_UART3 { UART3, // uart peripheral index @@ -229,7 +229,7 @@ static const struct gd32_uart uarts[] = { "uart3", }, #endif - + #ifdef BSP_USING_UART4 { UART4, // uart peripheral index @@ -253,7 +253,7 @@ static const struct gd32_uart uarts[] = { "uart5", }, #endif - + #ifdef BSP_USING_UART6 { UART6, // uart peripheral index @@ -309,7 +309,7 @@ void gd32_uart_gpio_init(struct gd32_uart *uart) /* configure USART Rx as alternate function push-pull */ gpio_mode_set(uart->rx_port, GPIO_MODE_AF, GPIO_PUPD_PULLUP, uart->rx_pin); gpio_output_options_set(uart->rx_port, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, uart->rx_pin); - + NVIC_SetPriority(uart->irqn, 0); NVIC_EnableIRQ(uart->irqn); } @@ -322,9 +322,9 @@ static rt_err_t gd32_configure(struct rt_serial_device *serial, struct serial_co RT_ASSERT(cfg != RT_NULL); uart = (struct gd32_uart *)serial->parent.user_data; - + gd32_uart_gpio_init(uart); - + usart_baudrate_set(uart->uart_periph, cfg->baud_rate); switch (cfg->data_bits) @@ -404,7 +404,7 @@ static int gd32_putc(struct rt_serial_device *serial, char ch) usart_data_transmit(uart->uart_periph, ch); while((usart_flag_get(uart->uart_periph, USART_FLAG_TC) == RESET)); - + return 1; } @@ -456,7 +456,7 @@ int gd32_hw_usart_init(void) struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; int i; - + for (i = 0; i < sizeof(uarts) / sizeof(uarts[0]); i++) { uarts[i].serial->ops = &gd32_uart_ops; diff --git a/bsp/gd32450z-eval/drivers/gd32f450z_eval.h b/bsp/gd32450z-eval/drivers/gd32f450z_eval.h index 73ea9baaa4..6eb91aee01 100644 --- a/bsp/gd32450z-eval/drivers/gd32f450z_eval.h +++ b/bsp/gd32450z-eval/drivers/gd32f450z_eval.h @@ -17,23 +17,23 @@ #endif #include "gd32f4xx.h" - + /* exported types */ -typedef enum +typedef enum { LED1 = 0, LED2 = 1, LED3 = 2 } led_typedef_enum; -typedef enum +typedef enum { KEY_WAKEUP = 0, KEY_TAMPER = 1, KEY_USER = 2 } key_typedef_enum; -typedef enum +typedef enum { KEY_MODE_GPIO = 0, KEY_MODE_EXTI = 1 @@ -45,11 +45,11 @@ typedef enum #define LED1_PIN GPIO_PIN_4 #define LED1_GPIO_PORT GPIOD #define LED1_GPIO_CLK RCU_GPIOD - + #define LED2_PIN GPIO_PIN_5 #define LED2_GPIO_PORT GPIOD #define LED2_GPIO_CLK RCU_GPIOD - + #define LED3_PIN GPIO_PIN_3 #define LED3_GPIO_PORT GPIOG #define LED3_GPIO_CLK RCU_GPIOG @@ -83,7 +83,7 @@ typedef enum #define WAKEUP_KEY_EXTI_LINE EXTI_0 #define WAKEUP_KEY_EXTI_PORT_SOURCE EXTI_SOURCE_GPIOA #define WAKEUP_KEY_EXTI_PIN_SOURCE EXTI_SOURCE_PIN0 -#define WAKEUP_KEY_EXTI_IRQn EXTI0_IRQn +#define WAKEUP_KEY_EXTI_IRQn EXTI0_IRQn /* user push-button */ #define USER_KEY_PIN GPIO_PIN_14 diff --git a/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.c b/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.c index 8a309a1a75..b71005b6dd 100644 --- a/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.c +++ b/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.c @@ -108,8 +108,8 @@ void lcd_spi_config(void) gpio_mode_set(GPIOG, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_13|GPIO_PIN_14); gpio_output_options_set(GPIOG, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13|GPIO_PIN_14); spi_i2s_deinit(SPI5); - - if(0 == (SPI_CTL0(LCD_SPI) & SPI_CTL0_SPIEN)){ + + if(0 == (SPI_CTL0(LCD_SPI) & SPI_CTL0_SPIEN)){ spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; spi_init_struct.device_mode = SPI_MASTER; spi_init_struct.frame_size = SPI_FRAMESIZE_8BIT; @@ -155,7 +155,7 @@ void lcd_data_write(uint8_t value) /* set LCD_RS to send data */ lcd_ctrl_line_set(LCD_RS_GPIO_PORT, LCD_RS_PIN); - /* reset LCD control line and send data */ + /* reset LCD control line and send data */ lcd_disable(); while(RESET == spi_i2s_flag_get(LCD_SPI, SPI_FLAG_TBE)) ; @@ -228,80 +228,80 @@ void lcd_power_on(void) } /** * @brief New Version 3.5" TFT RGB Hardware needs add this initilize funtion ---By xufei 2016.10.21 - Modified by GAO HAIYANG, test pass, 17, Nov, 2016 + Modified by GAO HAIYANG, test pass, 17, Nov, 2016 * @param None * @retval None */ void lcd_power_on3(void) { - lcd_command_write(0xC0);//power control1 command/w/ - lcd_data_write(0x0A); // P-Gamma level//4.1875v - lcd_data_write(0x0A); // N-Gamma level - lcd_command_write(0xC1); // BT & VC Setting//power contrl2 command/w/ - lcd_data_write(0x41); - lcd_data_write(0x07); // VCI1 = 2.5V - lcd_command_write(0xC2); // DC1.DC0 Setting//power control3 for normal mode - lcd_data_write(0x33); - lcd_command_write(0xC5);//VCOM control - lcd_data_write(0x00); //NV memory is not programmed - lcd_data_write(0x42); // VCM Setting - lcd_data_write(0x80); // VCM Register Enable - lcd_command_write(0xB0); //interface mode control //Polarity Setting - lcd_data_write(0x02); - lcd_command_write(0xB1);//frame rate control for normal mode - lcd_data_write(0xB0); // Frame Rate Setting//70 frame per second//no division for internal clocks - lcd_data_write(0x11);//17 clocks per line period for idle mode at cpu interface - lcd_command_write(0xB4);//dispaly inversion control - lcd_data_write(0x00); // disable Z-inversion , column inversion - lcd_command_write(0xB6); //display function control// RM.DM Setting - lcd_data_write(0x70);////0xF0 - lcd_data_write(0x02);//direction of gate scan: G1->G480 one by one, source scan: S1->S960, scan cycle if interval scan in non-display area - lcd_data_write(0x3B); // number of lines to drive LCD: 8*(0x3C) = 480 - lcd_command_write(0xB7); // Entry Mode - lcd_data_write(0x07); // disable low voltage detection, normal display, - lcd_command_write(0xF0); // Enter ENG , must be set before gamma setting - lcd_data_write(0x36); - lcd_data_write(0xA5); - lcd_data_write(0xD3); - lcd_command_write(0xE5); // Open gamma function , must be set before gamma setting - lcd_data_write(0x80); - lcd_command_write(0xE5); // Page 1 - lcd_data_write(0x01); - lcd_command_write(0XB3); // WEMODE=0(Page 1) , pixels over window setting will be ignored.//frame rate control in partial mode/full colors - lcd_data_write(0x00); - lcd_command_write(0xE5); // Page 0 - lcd_data_write(0x00); - lcd_command_write(0xF0); // Exit ENG , must be set before gamma setting - lcd_data_write(0x36); - lcd_data_write(0xA5); - lcd_data_write(0x53); - lcd_command_write(0xE0); // Gamma setting - //y fine adjustment register for positive polarity - lcd_data_write(0x00); - lcd_data_write(0x35); - lcd_data_write(0x33); - //y gradient adjustment register for positive polarity - lcd_data_write(0x00); - //y amplitude adjustment register for positive polarity - lcd_data_write(0x00); - lcd_data_write(0x00); - //y fine adjustment register for negative polarity - lcd_data_write(0x00); - lcd_data_write(0x35); - lcd_data_write(0x33); - //y gradient adjustment register for negative polarity - lcd_data_write(0x00); - //y amplitude adjustment register for negative polarity - lcd_data_write(0x00); - lcd_data_write(0x00); - lcd_command_write(0x36); // memory data access control // - lcd_data_write(0x48);// - lcd_command_write(0x3A); // interface pixel format setting - lcd_data_write(0x55);//16-bits - lcd_command_write(0x11); // Exit sleep mode - lcd_command_write(0x29); // Display on + lcd_command_write(0xC0);//power control1 command/w/ + lcd_data_write(0x0A); // P-Gamma level//4.1875v + lcd_data_write(0x0A); // N-Gamma level + lcd_command_write(0xC1); // BT & VC Setting//power contrl2 command/w/ + lcd_data_write(0x41); + lcd_data_write(0x07); // VCI1 = 2.5V + lcd_command_write(0xC2); // DC1.DC0 Setting//power control3 for normal mode + lcd_data_write(0x33); + lcd_command_write(0xC5);//VCOM control + lcd_data_write(0x00); //NV memory is not programmed + lcd_data_write(0x42); // VCM Setting + lcd_data_write(0x80); // VCM Register Enable + lcd_command_write(0xB0); //interface mode control //Polarity Setting + lcd_data_write(0x02); + lcd_command_write(0xB1);//frame rate control for normal mode + lcd_data_write(0xB0); // Frame Rate Setting//70 frame per second//no division for internal clocks + lcd_data_write(0x11);//17 clocks per line period for idle mode at cpu interface + lcd_command_write(0xB4);//dispaly inversion control + lcd_data_write(0x00); // disable Z-inversion , column inversion + lcd_command_write(0xB6); //display function control// RM.DM Setting + lcd_data_write(0x70);////0xF0 + lcd_data_write(0x02);//direction of gate scan: G1->G480 one by one, source scan: S1->S960, scan cycle if interval scan in non-display area + lcd_data_write(0x3B); // number of lines to drive LCD: 8*(0x3C) = 480 + lcd_command_write(0xB7); // Entry Mode + lcd_data_write(0x07); // disable low voltage detection, normal display, + lcd_command_write(0xF0); // Enter ENG , must be set before gamma setting + lcd_data_write(0x36); + lcd_data_write(0xA5); + lcd_data_write(0xD3); + lcd_command_write(0xE5); // Open gamma function , must be set before gamma setting + lcd_data_write(0x80); + lcd_command_write(0xE5); // Page 1 + lcd_data_write(0x01); + lcd_command_write(0XB3); // WEMODE=0(Page 1) , pixels over window setting will be ignored.//frame rate control in partial mode/full colors + lcd_data_write(0x00); + lcd_command_write(0xE5); // Page 0 + lcd_data_write(0x00); + lcd_command_write(0xF0); // Exit ENG , must be set before gamma setting + lcd_data_write(0x36); + lcd_data_write(0xA5); + lcd_data_write(0x53); + lcd_command_write(0xE0); // Gamma setting + //y fine adjustment register for positive polarity + lcd_data_write(0x00); + lcd_data_write(0x35); + lcd_data_write(0x33); + //y gradient adjustment register for positive polarity + lcd_data_write(0x00); + //y amplitude adjustment register for positive polarity + lcd_data_write(0x00); + lcd_data_write(0x00); + //y fine adjustment register for negative polarity + lcd_data_write(0x00); + lcd_data_write(0x35); + lcd_data_write(0x33); + //y gradient adjustment register for negative polarity + lcd_data_write(0x00); + //y amplitude adjustment register for negative polarity + lcd_data_write(0x00); + lcd_data_write(0x00); + lcd_command_write(0x36); // memory data access control // + lcd_data_write(0x48);// + lcd_command_write(0x3A); // interface pixel format setting + lcd_data_write(0x55);//16-bits + lcd_command_write(0x11); // Exit sleep mode + lcd_command_write(0x29); // Display on - delay(10); + delay(10); } /*! \brief insert a delay time diff --git a/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.h b/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.h index 815925a170..00b7f51cb2 100644 --- a/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.h +++ b/bsp/gd32450z-eval/drivers/gd32f450z_lcd_eval.h @@ -13,10 +13,10 @@ #define GD32F450Z_LCD_EVAL_H #include "gd32f450z_eval.h" - + #define LCD_CS_PIN GPIO_PIN_11 #define LCD_CS_GPIO_PORT GPIOD -#define LCD_CS_GPIO_CLK RCU_GPIOD +#define LCD_CS_GPIO_CLK RCU_GPIOD #define LCD_RS_PIN GPIO_PIN_3 #define LCD_RS_GPIO_PORT GPIOE @@ -28,7 +28,7 @@ #define LCD_SPI_MOSI_PIN GPIO_PIN_14 #define LCD_SPI_MOSI_GPIO_PORT GPIOG -#define LCD_SPI_MOSI_GPIO_CLK RCU_GPIOG +#define LCD_SPI_MOSI_GPIO_CLK RCU_GPIOG #define LCD_SPI SPI5 #define LCD_SPI_CLK RCU_SPI5 @@ -52,4 +52,4 @@ void lcd_data_write(uint8_t value); /* configure the LCD based on the power on sequence */ void lcd_power_on(void); void lcd_power_on3(void); -#endif /* GD32F450Z_LCD_EVAL_H */ +#endif /* GD32F450Z_LCD_EVAL_H */ diff --git a/bsp/gd32450z-eval/drivers/synopsys_emac.h b/bsp/gd32450z-eval/drivers/synopsys_emac.h index cb0d62122f..1610f19540 100644 --- a/bsp/gd32450z-eval/drivers/synopsys_emac.h +++ b/bsp/gd32450z-eval/drivers/synopsys_emac.h @@ -22,7 +22,7 @@ #define __SYNOPSYS_EMAC_H__ #include - + /******************************************************************************/ /* Ethernet MAC Registers bits definitions */ @@ -48,8 +48,8 @@ #define EMAC_MACCR_RD ((rt_uint32_t)0x00000200) /* Retry disable */ #define EMAC_MACCR_APCS ((rt_uint32_t)0x00000080) /* Automatic Pad/CRC stripping */ #define EMAC_MACCR_BL ((rt_uint32_t)0x00000060) /* Back-off limit: random integer number (r) of slot time delays before rescheduling - a transmission attempt during retries after a collision: 0 =< r <2^k */ -#define EMAC_MACCR_BL_10 ((rt_uint32_t)0x00000000) /* k = min (n, 10) */ + a transmission attempt during retries after a collision: 0 =< r <2^k */ +#define EMAC_MACCR_BL_10 ((rt_uint32_t)0x00000000) /* k = min (n, 10) */ #define EMAC_MACCR_BL_8 ((rt_uint32_t)0x00000020) /* k = min (n, 8) */ #define EMAC_MACCR_BL_4 ((rt_uint32_t)0x00000040) /* k = min (n, 4) */ #define EMAC_MACCR_BL_1 ((rt_uint32_t)0x00000060) /* k = min (n, 1) */ @@ -60,45 +60,45 @@ /* Bit definition for Ethernet MAC Frame Filter Register */ #define EMAC_MACFFR_RA ((rt_uint32_t)0x80000000) /* Receive all */ #define EMAC_MACFFR_HPF ((rt_uint32_t)0x00000400) /* Hash or perfect filter */ -#define EMAC_MACFFR_SAF ((rt_uint32_t)0x00000200) /* Source address filter enable */ +#define EMAC_MACFFR_SAF ((rt_uint32_t)0x00000200) /* Source address filter enable */ #define EMAC_MACFFR_SAIF ((rt_uint32_t)0x00000100) /* SA inverse filtering */ #define EMAC_MACFFR_PCF ((rt_uint32_t)0x000000C0) /* Pass control frames: 3 cases */ #define EMAC_MACFFR_PCF_BlockAll ((rt_uint32_t)0x00000040) /* MAC filters all control frames from reaching the application */ #define EMAC_MACFFR_PCF_ForwardAll ((rt_uint32_t)0x00000080) /* MAC forwards all control frames to application even if they fail the Address Filter */ #define EMAC_MACFFR_PCF_ForwardPassedAddrFilter ((rt_uint32_t)0x000000C0) /* MAC forwards control frames that pass the Address Filter. */ #define EMAC_MACFFR_BFD ((rt_uint32_t)0x00000020) /* Broadcast frame disable */ -#define EMAC_MACFFR_PAM ((rt_uint32_t)0x00000010) /* Pass all mutlicast */ +#define EMAC_MACFFR_PAM ((rt_uint32_t)0x00000010) /* Pass all mutlicast */ #define EMAC_MACFFR_DAIF ((rt_uint32_t)0x00000008) /* DA Inverse filtering */ -#define EMAC_MACFFR_HM ((rt_uint32_t)0x00000004) /* Hash multicast */ -#define EMAC_MACFFR_HU ((rt_uint32_t)0x00000002) /* Hash unicast */ -#define EMAC_MACFFR_PM ((rt_uint32_t)0x00000001) /* Promiscuous mode */ +#define EMAC_MACFFR_HM ((rt_uint32_t)0x00000004) /* Hash multicast */ +#define EMAC_MACFFR_HU ((rt_uint32_t)0x00000002) /* Hash unicast */ +#define EMAC_MACFFR_PM ((rt_uint32_t)0x00000001) /* Promiscuous mode */ /* Bit definition for Ethernet MAC Hash Table High Register */ -#define EMAC_MACHTHR_HTH ((rt_uint32_t)0xFFFFFFFF) /* Hash table high */ +#define EMAC_MACHTHR_HTH ((rt_uint32_t)0xFFFFFFFF) /* Hash table high */ /* Bit definition for Ethernet MAC Hash Table Low Register */ -#define EMAC_MACHTLR_HTL ((rt_uint32_t)0xFFFFFFFF) /* Hash table low */ +#define EMAC_MACHTLR_HTL ((rt_uint32_t)0xFFFFFFFF) /* Hash table low */ /* Bit definition for Ethernet MAC MII Address Register */ -#define EMAC_MACMIIAR_PA ((rt_uint32_t)0x0000F800) /* Physical layer address */ -#define EMAC_MACMIIAR_MR ((rt_uint32_t)0x000007C0) /* MII register in the selected PHY */ -#define EMAC_MACMIIAR_CR ((rt_uint32_t)0x0000001C) /* CR clock range: 6 cases */ +#define EMAC_MACMIIAR_PA ((rt_uint32_t)0x0000F800) /* Physical layer address */ +#define EMAC_MACMIIAR_MR ((rt_uint32_t)0x000007C0) /* MII register in the selected PHY */ +#define EMAC_MACMIIAR_CR ((rt_uint32_t)0x0000001C) /* CR clock range: 6 cases */ #define EMAC_MACMIIAR_CR_Div42 ((rt_uint32_t)0x00000000) /* HCLK:60-100 MHz; MDC clock= HCLK/42 */ #define EMAC_MACMIIAR_CR_Div62 ((rt_uint32_t)0x00000004) /* HCLK:100-150 MHz; MDC clock= HCLK/62 */ #define EMAC_MACMIIAR_CR_Div16 ((rt_uint32_t)0x00000008) /* HCLK:20-35 MHz; MDC clock= HCLK/16 */ #define EMAC_MACMIIAR_CR_Div26 ((rt_uint32_t)0x0000000C) /* HCLK:35-60 MHz; MDC clock= HCLK/26 */ #define EMAC_MACMIIAR_CR_Div102 ((rt_uint32_t)0x00000010) /* HCLK:150-250 MHz; MDC clock= HCLK/102 */ #define EMAC_MACMIIAR_CR_Div122 ((rt_uint32_t)0x00000014) /* HCLK:250-300 MHz; MDC clock= HCLK/122*/ -#define EMAC_MACMIIAR_MW ((rt_uint32_t)0x00000002) /* MII write */ -#define EMAC_MACMIIAR_MB ((rt_uint32_t)0x00000001) /* MII busy */ +#define EMAC_MACMIIAR_MW ((rt_uint32_t)0x00000002) /* MII write */ +#define EMAC_MACMIIAR_MB ((rt_uint32_t)0x00000001) /* MII busy */ /* Bit definition for Ethernet MAC MII Data Register */ -#define EMAC_MACMIIDR_MD ((rt_uint32_t)0x0000FFFF) /* MII data: read/write data from/to PHY */ +#define EMAC_MACMIIDR_MD ((rt_uint32_t)0x0000FFFF) /* MII data: read/write data from/to PHY */ /* Bit definition for Ethernet MAC Flow Control Register */ -#define EMAC_MACFCR_PT ((rt_uint32_t)0xFFFF0000) /* Pause time */ -#define EMAC_MACFCR_ZQPD ((rt_uint32_t)0x00000080) /* Zero-quanta pause disable */ -#define EMAC_MACFCR_PLT ((rt_uint32_t)0x00000030) /* Pause low threshold: 4 cases */ +#define EMAC_MACFCR_PT ((rt_uint32_t)0xFFFF0000) /* Pause time */ +#define EMAC_MACFCR_ZQPD ((rt_uint32_t)0x00000080) /* Zero-quanta pause disable */ +#define EMAC_MACFCR_PLT ((rt_uint32_t)0x00000030) /* Pause low threshold: 4 cases */ #define EMAC_MACFCR_PLT_Minus4 ((rt_uint32_t)0x00000000) /* Pause time minus 4 slot times */ #define EMAC_MACFCR_PLT_Minus28 ((rt_uint32_t)0x00000010) /* Pause time minus 28 slot times */ #define EMAC_MACFCR_PLT_Minus144 ((rt_uint32_t)0x00000020) /* Pause time minus 144 slot times */ @@ -441,7 +441,7 @@ #define EMAC_DMACHRBAR_HRBAP ((rt_uint32_t)0xFFFFFFFF) /* Host receive buffer address pointer */ //typedef enum { -// RESET = 0, SET = !RESET +// RESET = 0, SET = !RESET //} FlagStatus, ITStatus; //typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; @@ -450,165 +450,165 @@ */ typedef struct { - /** - * MAC - */ - rt_uint32_t EMAC_AutoNegotiation; /* Selects or not the AutoNegotiation mode for the external PHY - The AutoNegotiation allows an automatic setting of the Speed (10/100Mbps) - and the mode (half/full-duplex). - This parameter can be a value of @ref EMAC_AutoNegotiation */ + /** + * MAC + */ + rt_uint32_t EMAC_AutoNegotiation; /* Selects or not the AutoNegotiation mode for the external PHY + The AutoNegotiation allows an automatic setting of the Speed (10/100Mbps) + and the mode (half/full-duplex). + This parameter can be a value of @ref EMAC_AutoNegotiation */ - rt_uint32_t EMAC_Watchdog; /* Selects or not the Watchdog timer - When enabled, the MAC allows no more then 2048 bytes to be received. - When disabled, the MAC can receive up to 16384 bytes. - This parameter can be a value of @ref EMAC_watchdog */ + rt_uint32_t EMAC_Watchdog; /* Selects or not the Watchdog timer + When enabled, the MAC allows no more then 2048 bytes to be received. + When disabled, the MAC can receive up to 16384 bytes. + This parameter can be a value of @ref EMAC_watchdog */ - rt_uint32_t EMAC_Jabber; /* Selects or not Jabber timer - When enabled, the MAC allows no more then 2048 bytes to be sent. - When disabled, the MAC can send up to 16384 bytes. - This parameter can be a value of @ref EMAC_Jabber */ + rt_uint32_t EMAC_Jabber; /* Selects or not Jabber timer + When enabled, the MAC allows no more then 2048 bytes to be sent. + When disabled, the MAC can send up to 16384 bytes. + This parameter can be a value of @ref EMAC_Jabber */ - rt_uint32_t EMAC_InterFrameGap; /* Selects the minimum IFG between frames during transmission - This parameter can be a value of @ref EMAC_Inter_Frame_Gap */ + rt_uint32_t EMAC_InterFrameGap; /* Selects the minimum IFG between frames during transmission + This parameter can be a value of @ref EMAC_Inter_Frame_Gap */ - rt_uint32_t EMAC_CarrierSense; /* Selects or not the Carrier Sense - This parameter can be a value of @ref EMAC_Carrier_Sense */ + rt_uint32_t EMAC_CarrierSense; /* Selects or not the Carrier Sense + This parameter can be a value of @ref EMAC_Carrier_Sense */ - rt_uint32_t EMAC_Speed; /* Sets the Ethernet speed: 10/100 Mbps - This parameter can be a value of @ref EMAC_Speed */ + rt_uint32_t EMAC_Speed; /* Sets the Ethernet speed: 10/100 Mbps + This parameter can be a value of @ref EMAC_Speed */ - rt_uint32_t EMAC_ReceiveOwn; /* Selects or not the ReceiveOwn - ReceiveOwn allows the reception of frames when the TX_EN signal is asserted - in Half-Duplex mode - This parameter can be a value of @ref EMAC_Receive_Own */ + rt_uint32_t EMAC_ReceiveOwn; /* Selects or not the ReceiveOwn + ReceiveOwn allows the reception of frames when the TX_EN signal is asserted + in Half-Duplex mode + This parameter can be a value of @ref EMAC_Receive_Own */ - rt_uint32_t EMAC_LoopbackMode; /* Selects or not the internal MAC MII Loopback mode - This parameter can be a value of @ref EMAC_Loop_Back_Mode */ + rt_uint32_t EMAC_LoopbackMode; /* Selects or not the internal MAC MII Loopback mode + This parameter can be a value of @ref EMAC_Loop_Back_Mode */ - rt_uint32_t EMAC_Mode; /* Selects the MAC duplex mode: Half-Duplex or Full-Duplex mode - This parameter can be a value of @ref EMAC_Duplex_Mode */ + rt_uint32_t EMAC_Mode; /* Selects the MAC duplex mode: Half-Duplex or Full-Duplex mode + This parameter can be a value of @ref EMAC_Duplex_Mode */ - rt_uint32_t EMAC_ChecksumOffload; /* Selects or not the IPv4 checksum checking for received frame payloads' TCP/UDP/ICMP headers. - This parameter can be a value of @ref EMAC_Checksum_Offload */ + rt_uint32_t EMAC_ChecksumOffload; /* Selects or not the IPv4 checksum checking for received frame payloads' TCP/UDP/ICMP headers. + This parameter can be a value of @ref EMAC_Checksum_Offload */ - rt_uint32_t EMAC_RetryTransmission; /* Selects or not the MAC attempt retries transmission, based on the settings of BL, - when a colision occurs (Half-Duplex mode) - This parameter can be a value of @ref EMAC_Retry_Transmission */ + rt_uint32_t EMAC_RetryTransmission; /* Selects or not the MAC attempt retries transmission, based on the settings of BL, + when a colision occurs (Half-Duplex mode) + This parameter can be a value of @ref EMAC_Retry_Transmission */ - rt_uint32_t EMAC_AutomaticPadCRCStrip; /* Selects or not the Automatic MAC Pad/CRC Stripping - This parameter can be a value of @ref EMAC_Automatic_Pad_CRC_Strip */ + rt_uint32_t EMAC_AutomaticPadCRCStrip; /* Selects or not the Automatic MAC Pad/CRC Stripping + This parameter can be a value of @ref EMAC_Automatic_Pad_CRC_Strip */ - rt_uint32_t EMAC_BackOffLimit; /* Selects the BackOff limit value - This parameter can be a value of @ref EMAC_Back_Off_Limit */ + rt_uint32_t EMAC_BackOffLimit; /* Selects the BackOff limit value + This parameter can be a value of @ref EMAC_Back_Off_Limit */ - rt_uint32_t EMAC_DeferralCheck; /* Selects or not the deferral check function (Half-Duplex mode) - This parameter can be a value of @ref EMAC_Deferral_Check */ + rt_uint32_t EMAC_DeferralCheck; /* Selects or not the deferral check function (Half-Duplex mode) + This parameter can be a value of @ref EMAC_Deferral_Check */ - rt_uint32_t EMAC_ReceiveAll; /* Selects or not all frames reception by the MAC (No fitering) - This parameter can be a value of @ref EMAC_Receive_All */ + rt_uint32_t EMAC_ReceiveAll; /* Selects or not all frames reception by the MAC (No fitering) + This parameter can be a value of @ref EMAC_Receive_All */ - rt_uint32_t EMAC_SourceAddrFilter; /* Selects the Source Address Filter mode - This parameter can be a value of @ref EMAC_Source_Addr_Filter */ + rt_uint32_t EMAC_SourceAddrFilter; /* Selects the Source Address Filter mode + This parameter can be a value of @ref EMAC_Source_Addr_Filter */ - rt_uint32_t EMAC_PassControlFrames; /* Sets the forwarding mode of the control frames (including unicast and multicast PAUSE frames) - This parameter can be a value of @ref EMAC_Pass_Control_Frames */ + rt_uint32_t EMAC_PassControlFrames; /* Sets the forwarding mode of the control frames (including unicast and multicast PAUSE frames) + This parameter can be a value of @ref EMAC_Pass_Control_Frames */ - rt_uint32_t EMAC_BroadcastFramesReception; /* Selects or not the reception of Broadcast Frames - This parameter can be a value of @ref EMAC_Broadcast_Frames_Reception */ + rt_uint32_t EMAC_BroadcastFramesReception; /* Selects or not the reception of Broadcast Frames + This parameter can be a value of @ref EMAC_Broadcast_Frames_Reception */ - rt_uint32_t EMAC_DestinationAddrFilter; /* Sets the destination filter mode for both unicast and multicast frames - This parameter can be a value of @ref EMAC_Destination_Addr_Filter */ + rt_uint32_t EMAC_DestinationAddrFilter; /* Sets the destination filter mode for both unicast and multicast frames + This parameter can be a value of @ref EMAC_Destination_Addr_Filter */ - rt_uint32_t EMAC_PromiscuousMode; /* Selects or not the Promiscuous Mode - This parameter can be a value of @ref EMAC_Promiscuous_Mode */ + rt_uint32_t EMAC_PromiscuousMode; /* Selects or not the Promiscuous Mode + This parameter can be a value of @ref EMAC_Promiscuous_Mode */ - rt_uint32_t EMAC_MulticastFramesFilter; /* Selects the Multicast Frames filter mode: None/HashTableFilter/PerfectFilter/PerfectHashTableFilter - This parameter can be a value of @ref EMAC_Multicast_Frames_Filter */ + rt_uint32_t EMAC_MulticastFramesFilter; /* Selects the Multicast Frames filter mode: None/HashTableFilter/PerfectFilter/PerfectHashTableFilter + This parameter can be a value of @ref EMAC_Multicast_Frames_Filter */ - rt_uint32_t EMAC_UnicastFramesFilter; /* Selects the Unicast Frames filter mode: HashTableFilter/PerfectFilter/PerfectHashTableFilter - This parameter can be a value of @ref EMAC_Unicast_Frames_Filter */ + rt_uint32_t EMAC_UnicastFramesFilter; /* Selects the Unicast Frames filter mode: HashTableFilter/PerfectFilter/PerfectHashTableFilter + This parameter can be a value of @ref EMAC_Unicast_Frames_Filter */ - rt_uint32_t EMAC_HashTableHigh; /* This field holds the higher 32 bits of Hash table. */ + rt_uint32_t EMAC_HashTableHigh; /* This field holds the higher 32 bits of Hash table. */ - rt_uint32_t EMAC_HashTableLow; /* This field holds the lower 32 bits of Hash table. */ + rt_uint32_t EMAC_HashTableLow; /* This field holds the lower 32 bits of Hash table. */ - rt_uint32_t EMAC_PauseTime; /* This field holds the value to be used in the Pause Time field in the - transmit control frame */ + rt_uint32_t EMAC_PauseTime; /* This field holds the value to be used in the Pause Time field in the + transmit control frame */ - rt_uint32_t EMAC_ZeroQuantaPause; /* Selects or not the automatic generation of Zero-Quanta Pause Control frames - This parameter can be a value of @ref EMAC_Zero_Quanta_Pause */ + rt_uint32_t EMAC_ZeroQuantaPause; /* Selects or not the automatic generation of Zero-Quanta Pause Control frames + This parameter can be a value of @ref EMAC_Zero_Quanta_Pause */ - rt_uint32_t EMAC_PauseLowThreshold; /* This field configures the threshold of the PAUSE to be checked for - automatic retransmission of PAUSE Frame - This parameter can be a value of @ref EMAC_Pause_Low_Threshold */ + rt_uint32_t EMAC_PauseLowThreshold; /* This field configures the threshold of the PAUSE to be checked for + automatic retransmission of PAUSE Frame + This parameter can be a value of @ref EMAC_Pause_Low_Threshold */ - rt_uint32_t EMAC_UnicastPauseFrameDetect; /* Selects or not the MAC detection of the Pause frames (with MAC Address0 - unicast address and unique multicast address) - This parameter can be a value of @ref EMAC_Unicast_Pause_Frame_Detect */ + rt_uint32_t EMAC_UnicastPauseFrameDetect; /* Selects or not the MAC detection of the Pause frames (with MAC Address0 + unicast address and unique multicast address) + This parameter can be a value of @ref EMAC_Unicast_Pause_Frame_Detect */ - rt_uint32_t EMAC_ReceiveFlowControl; /* Enables or disables the MAC to decode the received Pause frame and - disable its transmitter for a specified time (Pause Time) - This parameter can be a value of @ref EMAC_Receive_Flow_Control */ + rt_uint32_t EMAC_ReceiveFlowControl; /* Enables or disables the MAC to decode the received Pause frame and + disable its transmitter for a specified time (Pause Time) + This parameter can be a value of @ref EMAC_Receive_Flow_Control */ - rt_uint32_t EMAC_TransmitFlowControl; /* Enables or disables the MAC to transmit Pause frames (Full-Duplex mode) - or the MAC back-pressure operation (Half-Duplex mode) - This parameter can be a value of @ref EMAC_Transmit_Flow_Control */ + rt_uint32_t EMAC_TransmitFlowControl; /* Enables or disables the MAC to transmit Pause frames (Full-Duplex mode) + or the MAC back-pressure operation (Half-Duplex mode) + This parameter can be a value of @ref EMAC_Transmit_Flow_Control */ - rt_uint32_t EMAC_VLANTagComparison; /* Selects the 12-bit VLAN identifier or the complete 16-bit VLAN tag for - comparison and filtering - This parameter can be a value of @ref EMAC_VLAN_Tag_Comparison */ + rt_uint32_t EMAC_VLANTagComparison; /* Selects the 12-bit VLAN identifier or the complete 16-bit VLAN tag for + comparison and filtering + This parameter can be a value of @ref EMAC_VLAN_Tag_Comparison */ - rt_uint32_t EMAC_VLANTagIdentifier; /* Holds the VLAN tag identifier for receive frames */ + rt_uint32_t EMAC_VLANTagIdentifier; /* Holds the VLAN tag identifier for receive frames */ - /** - * DMA - */ + /** + * DMA + */ - rt_uint32_t EMAC_DropTCPIPChecksumErrorFrame; /* Selects or not the Dropping of TCP/IP Checksum Error Frames - This parameter can be a value of @ref EMAC_Drop_TCP_IP_Checksum_Error_Frame */ + rt_uint32_t EMAC_DropTCPIPChecksumErrorFrame; /* Selects or not the Dropping of TCP/IP Checksum Error Frames + This parameter can be a value of @ref EMAC_Drop_TCP_IP_Checksum_Error_Frame */ - rt_uint32_t EMAC_ReceiveStoreForward; /* Enables or disables the Receive store and forward mode - This parameter can be a value of @ref EMAC_Receive_Store_Forward */ + rt_uint32_t EMAC_ReceiveStoreForward; /* Enables or disables the Receive store and forward mode + This parameter can be a value of @ref EMAC_Receive_Store_Forward */ - rt_uint32_t EMAC_FlushReceivedFrame; /* Enables or disables the flushing of received frames - This parameter can be a value of @ref EMAC_Flush_Received_Frame */ + rt_uint32_t EMAC_FlushReceivedFrame; /* Enables or disables the flushing of received frames + This parameter can be a value of @ref EMAC_Flush_Received_Frame */ - rt_uint32_t EMAC_TransmitStoreForward; /* Enables or disables Transmit store and forward mode - This parameter can be a value of @ref EMAC_Transmit_Store_Forward */ + rt_uint32_t EMAC_TransmitStoreForward; /* Enables or disables Transmit store and forward mode + This parameter can be a value of @ref EMAC_Transmit_Store_Forward */ - rt_uint32_t EMAC_TransmitThresholdControl; /* Selects or not the Transmit Threshold Control - This parameter can be a value of @ref EMAC_Transmit_Threshold_Control */ + rt_uint32_t EMAC_TransmitThresholdControl; /* Selects or not the Transmit Threshold Control + This parameter can be a value of @ref EMAC_Transmit_Threshold_Control */ - rt_uint32_t EMAC_ForwardErrorFrames; /* Selects or not the forward to the DMA of erroneous frames - This parameter can be a value of @ref EMAC_Forward_Error_Frames */ + rt_uint32_t EMAC_ForwardErrorFrames; /* Selects or not the forward to the DMA of erroneous frames + This parameter can be a value of @ref EMAC_Forward_Error_Frames */ - rt_uint32_t EMAC_ForwardUndersizedGoodFrames; /* Enables or disables the Rx FIFO to forward Undersized frames (frames with no Error - and length less than 64 bytes) including pad-bytes and CRC) - This parameter can be a value of @ref EMAC_Forward_Undersized_Good_Frames */ + rt_uint32_t EMAC_ForwardUndersizedGoodFrames; /* Enables or disables the Rx FIFO to forward Undersized frames (frames with no Error + and length less than 64 bytes) including pad-bytes and CRC) + This parameter can be a value of @ref EMAC_Forward_Undersized_Good_Frames */ - rt_uint32_t EMAC_ReceiveThresholdControl; /* Selects the threshold level of the Receive FIFO - This parameter can be a value of @ref EMAC_Receive_Threshold_Control */ + rt_uint32_t EMAC_ReceiveThresholdControl; /* Selects the threshold level of the Receive FIFO + This parameter can be a value of @ref EMAC_Receive_Threshold_Control */ - rt_uint32_t EMAC_SecondFrameOperate; /* Selects or not the Operate on second frame mode, which allows the DMA to process a second - frame of Transmit data even before obtaining the status for the first frame. - This parameter can be a value of @ref EMAC_Second_Frame_Operate */ + rt_uint32_t EMAC_SecondFrameOperate; /* Selects or not the Operate on second frame mode, which allows the DMA to process a second + frame of Transmit data even before obtaining the status for the first frame. + This parameter can be a value of @ref EMAC_Second_Frame_Operate */ - rt_uint32_t EMAC_AddressAlignedBeats; /* Enables or disables the Address Aligned Beats - This parameter can be a value of @ref EMAC_Address_Aligned_Beats */ + rt_uint32_t EMAC_AddressAlignedBeats; /* Enables or disables the Address Aligned Beats + This parameter can be a value of @ref EMAC_Address_Aligned_Beats */ - rt_uint32_t EMAC_FixedBurst; /* Enables or disables the AHB Master interface fixed burst transfers - This parameter can be a value of @ref EMAC_Fixed_Burst */ + rt_uint32_t EMAC_FixedBurst; /* Enables or disables the AHB Master interface fixed burst transfers + This parameter can be a value of @ref EMAC_Fixed_Burst */ - rt_uint32_t EMAC_RxDMABurstLength; /* Indicates the maximum number of beats to be transferred in one Rx DMA transaction - This parameter can be a value of @ref EMAC_Rx_DMA_Burst_Length */ + rt_uint32_t EMAC_RxDMABurstLength; /* Indicates the maximum number of beats to be transferred in one Rx DMA transaction + This parameter can be a value of @ref EMAC_Rx_DMA_Burst_Length */ - rt_uint32_t EMAC_TxDMABurstLength; /* Indicates sthe maximum number of beats to be transferred in one Tx DMA transaction - This parameter can be a value of @ref EMAC_Tx_DMA_Burst_Length */ + rt_uint32_t EMAC_TxDMABurstLength; /* Indicates sthe maximum number of beats to be transferred in one Tx DMA transaction + This parameter can be a value of @ref EMAC_Tx_DMA_Burst_Length */ - rt_uint32_t EMAC_DescriptorSkipLength; /* Specifies the number of word to skip between two unchained int (Ring mode) */ + rt_uint32_t EMAC_DescriptorSkipLength; /* Specifies the number of word to skip between two unchained int (Ring mode) */ - rt_uint32_t EMAC_DMAArbitration; /* Selects the DMA Tx/Rx arbitration - This parameter can be a value of @ref EMAC_DMA_Arbitration */ + rt_uint32_t EMAC_DMAArbitration; /* Selects the DMA Tx/Rx arbitration + This parameter can be a value of @ref EMAC_DMA_Arbitration */ } EMAC_InitTypeDef; /**--------------------------------------------------------------------------**/ @@ -622,10 +622,10 @@ typedef struct */ typedef struct { - rt_uint32_t Status; /* Status */ - rt_uint32_t ControlBufferSize; /* Control and Buffer1, Buffer2 lengths */ - rt_uint32_t Buffer1Addr; /* Buffer1 address pointer */ - rt_uint32_t Buffer2NextDescAddr; /* Buffer2 or next descriptor address pointer */ + rt_uint32_t Status; /* Status */ + rt_uint32_t ControlBufferSize; /* Control and Buffer1, Buffer2 lengths */ + rt_uint32_t Buffer1Addr; /* Buffer1 address pointer */ + rt_uint32_t Buffer2NextDescAddr; /* Buffer2 or next descriptor address pointer */ } EMAC_DMADESCTypeDef; /**--------------------------------------------------------------------------**/ @@ -634,14 +634,14 @@ typedef struct */ /**--------------------------------------------------------------------------**/ -#define EMAC_MAX_PACKET_SIZE 1520 /* EMAC_HEADER + EMAC_EXTRA + MAX_EMAC_PAYLOAD + EMAC_CRC */ -#define EMAC_HEADER 14 /* 6 byte Dest addr, 6 byte Src addr, 2 byte length/type */ -#define EMAC_CRC 4 /* Ethernet CRC */ -#define EMAC_EXTRA 2 /* Extra bytes in some cases */ -#define VLAN_TAG 4 /* optional 802.1q VLAN Tag */ -#define MIN_EMAC_PAYLOAD 46 /* Minimum Ethernet payload size */ -#define MAX_EMAC_PAYLOAD 1500 /* Maximum Ethernet payload size */ -#define JUMBO_FRAME_PAYLOAD 9000 /* Jumbo frame payload size */ +#define EMAC_MAX_PACKET_SIZE 1520 /* EMAC_HEADER + EMAC_EXTRA + MAX_EMAC_PAYLOAD + EMAC_CRC */ +#define EMAC_HEADER 14 /* 6 byte Dest addr, 6 byte Src addr, 2 byte length/type */ +#define EMAC_CRC 4 /* Ethernet CRC */ +#define EMAC_EXTRA 2 /* Extra bytes in some cases */ +#define VLAN_TAG 4 /* optional 802.1q VLAN Tag */ +#define MIN_EMAC_PAYLOAD 46 /* Minimum Ethernet payload size */ +#define MAX_EMAC_PAYLOAD 1500 /* Maximum Ethernet payload size */ +#define JUMBO_FRAME_PAYLOAD 9000 /* Jumbo frame payload size */ /**--------------------------------------------------------------------------**/ /** @@ -1098,7 +1098,7 @@ struct rt_synopsys_eth volatile rt_uint32_t FCR; volatile rt_uint32_t VTR; rt_uint8_t RESERVED0[8]; - + volatile rt_uint32_t RWFFR; volatile rt_uint32_t PMTR; volatile rt_uint32_t LPICSR; diff --git a/bsp/gd32e230k-start/applications/main.c b/bsp/gd32e230k-start/applications/main.c index cabddf36d6..999becd329 100644 --- a/bsp/gd32e230k-start/applications/main.c +++ b/bsp/gd32e230k-start/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32e230k-start/drivers/board.c b/bsp/gd32e230k-start/drivers/board.c index ea91fd7eb8..5910ec4124 100644 --- a/bsp/gd32e230k-start/drivers/board.c +++ b/bsp/gd32e230k-start/drivers/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -75,7 +75,7 @@ void rt_hw_board_init() rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif -#ifdef RT_USING_HEAP +#ifdef RT_USING_HEAP rt_system_heap_init((void*)HEAP_BEGIN, (void*)HEAP_END); #endif } diff --git a/bsp/gd32e230k-start/drivers/board.h b/bsp/gd32e230k-start/drivers/board.h index abc8743562..7d491aeaa8 100644 --- a/bsp/gd32e230k-start/drivers/board.h +++ b/bsp/gd32e230k-start/drivers/board.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,7 +15,7 @@ #include // Internal SRAM memory size[Kbytes] <8-64> -// Default: 64 +// Default: 64 #ifdef __ICCARM__ // Use *.icf ram symbal, to avoid hardcode. extern char __ICFEDIT_region_RAM_end__; diff --git a/bsp/gd32e230k-start/drivers/drv_gpio.c b/bsp/gd32e230k-start/drivers/drv_gpio.c index 4176798cfd..752f1489d7 100644 --- a/bsp/gd32e230k-start/drivers/drv_gpio.c +++ b/bsp/gd32e230k-start/drivers/drv_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -29,8 +29,8 @@ struct pin_index rcu_periph_enum clk; rt_uint32_t gpio_periph; rt_uint32_t pin; - rt_uint32_t port_src; - rt_uint32_t pin_src; + rt_uint32_t port_src; + rt_uint32_t pin_src; }; static const struct pin_index pins[] = @@ -38,8 +38,8 @@ static const struct pin_index pins[] = __GD32_PIN_DEFAULT, __GD32_PIN(2, F, 0), __GD32_PIN(3, F, 1), - __GD32_PIN_DEFAULT, - __GD32_PIN_DEFAULT, + __GD32_PIN_DEFAULT, + __GD32_PIN_DEFAULT, __GD32_PIN(6, A, 0), __GD32_PIN(7, A, 1), __GD32_PIN(8, A, 2), @@ -51,7 +51,7 @@ static const struct pin_index pins[] = __GD32_PIN(14, B, 0), __GD32_PIN(15, B, 1), __GD32_PIN(16, B, 2), - __GD32_PIN_DEFAULT, + __GD32_PIN_DEFAULT, __GD32_PIN(18, A, 8), __GD32_PIN(19, A, 9), __GD32_PIN(20, A, 10), @@ -136,8 +136,8 @@ void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) { const struct pin_index *index; rt_uint32_t pin_mode; - rt_uint32_t otype; - rt_uint32_t pull_up_down; + rt_uint32_t otype; + rt_uint32_t pull_up_down; index = get_pin(pin); if (index == RT_NULL) { @@ -147,9 +147,9 @@ void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) /* GPIO Periph clock enable */ rcu_periph_clock_enable(index->clk); pin_mode = GPIO_MODE_OUTPUT; - otype = GPIO_OTYPE_PP; - pull_up_down = GPIO_PUPD_NONE; - + otype = GPIO_OTYPE_PP; + pull_up_down = GPIO_PUPD_NONE; + switch(mode) { case PIN_MODE_OUTPUT: @@ -157,7 +157,7 @@ void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) break; case PIN_MODE_OUTPUT_OD: /* output setting: od. */ - otype = GPIO_OTYPE_OD; + otype = GPIO_OTYPE_OD; break; case PIN_MODE_INPUT: /* input setting: not pull. */ @@ -166,20 +166,20 @@ void gd32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) case PIN_MODE_INPUT_PULLUP: /* input setting: pull up. */ pin_mode = GPIO_MODE_INPUT; - pull_up_down = GPIO_PUPD_PULLUP; + pull_up_down = GPIO_PUPD_PULLUP; break; case PIN_MODE_INPUT_PULLDOWN: /* input setting: pull down. */ - pin_mode = GPIO_MODE_INPUT; - pull_up_down = GPIO_PUPD_PULLDOWN; + pin_mode = GPIO_MODE_INPUT; + pull_up_down = GPIO_PUPD_PULLDOWN; break; default: break; } - gpio_mode_set(index->gpio_periph, pin_mode, pull_up_down, index->pin); + gpio_mode_set(index->gpio_periph, pin_mode, pull_up_down, index->pin); gpio_output_options_set(index->gpio_periph, otype, GPIO_OSPEED_50MHZ, index->pin); - + } void gd32_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value) @@ -333,7 +333,7 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ return RT_EINVAL; } irqmap = &pin_irq_map[hdr_index]; - + switch (pin_irq_hdr_tab[hdr_index].mode) { case PIN_IRQ_MODE_RISING: @@ -354,14 +354,14 @@ rt_err_t gd32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_ /* enable and set interrupt priority */ nvic_irq_enable(irqmap->irqno, 5U); - + /* connect EXTI line to GPIO pin */ - syscfg_exti_line_config(index->port_src, index->pin_src); + syscfg_exti_line_config(index->port_src, index->pin_src); /* configure EXTI line */ exti_init((exti_line_enum)(index->pin), EXTI_INTERRUPT, trigger_mode); exti_interrupt_flag_clear((exti_line_enum)(index->pin)); - + rt_hw_interrupt_enable(level); } else if (enabled == PIN_IRQ_DISABLE) @@ -396,7 +396,7 @@ int rt_hw_pin_init(void) int result; result = rt_device_pin_register("pin", &_gd32_pin_ops, RT_NULL); - + return result; } INIT_BOARD_EXPORT(rt_hw_pin_init); @@ -415,7 +415,7 @@ void GD32_GPIO_EXTI_IRQHandler(rt_int8_t exti_line) { pin_irq_hdr(exti_line); exti_interrupt_flag_clear((exti_line_enum)(1 << exti_line)); - } + } } void EXTI0_IRQHandler(void) { diff --git a/bsp/gd32e230k-start/drivers/drv_gpio.h b/bsp/gd32e230k-start/drivers/drv_gpio.h index 3c758b2713..ae9bda7dce 100644 --- a/bsp/gd32e230k-start/drivers/drv_gpio.h +++ b/bsp/gd32e230k-start/drivers/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32e230k-start/drivers/drv_i2c.c b/bsp/gd32e230k-start/drivers/drv_i2c.c index 57f49e4633..62cd4eb973 100644 --- a/bsp/gd32e230k-start/drivers/drv_i2c.c +++ b/bsp/gd32e230k-start/drivers/drv_i2c.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -155,7 +155,7 @@ static int gd32_i2c_read(rt_uint32_t i2c_periph, rt_uint16_t slave_address, rt_u *p_buffer = i2c_data_receive(i2c_periph); /* point to the next location where the byte read will be saved */ - p_buffer++; + p_buffer++; /* decrement the read bytes counter */ data_byte--; @@ -264,7 +264,7 @@ static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg } } } - + ret = i; out: @@ -274,7 +274,7 @@ out: } static const struct rt_i2c_bus_device_ops i2c_ops = -{ +{ gd32_i2c_xfer, RT_NULL, RT_NULL @@ -311,7 +311,7 @@ int rt_hw_i2c_init(void) i2c_device.priv = (void *)&_i2c_bit_ops; rt_i2c_bit_add_bus(&i2c_device, I2C_BUS_NAME); - } + } #else /* register hardware I2C */ diff --git a/bsp/gd32e230k-start/drivers/drv_i2c.h b/bsp/gd32e230k-start/drivers/drv_i2c.h index 6e7de45260..c4b321594c 100644 --- a/bsp/gd32e230k-start/drivers/drv_i2c.h +++ b/bsp/gd32e230k-start/drivers/drv_i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32e230k-start/drivers/drv_spi.c b/bsp/gd32e230k-start/drivers/drv_spi.c index 706756d3de..8efc2a4664 100644 --- a/bsp/gd32e230k-start/drivers/drv_spi.c +++ b/bsp/gd32e230k-start/drivers/drv_spi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -115,7 +115,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat spi_init_struct.prescale = SPI_PSC_256; } } /* baudrate */ - + switch(configuration->mode & RT_SPI_MODE_3) { case RT_SPI_MODE_0: @@ -131,7 +131,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat spi_init_struct.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; break; } - + /* MSB or LSB */ if(configuration->mode & RT_SPI_MSB) { @@ -141,7 +141,7 @@ static rt_err_t configure(struct rt_spi_device* device, struct rt_spi_configurat { spi_init_struct.endian = SPI_ENDIAN_LSB; } - + spi_init_struct.trans_mode = SPI_TRANSMODE_FULLDUPLEX; spi_init_struct.device_mode = SPI_MASTER; spi_init_struct.nss = SPI_NSS_SOFT; @@ -177,7 +177,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes const rt_uint8_t * send_ptr = message->send_buf; rt_uint8_t * recv_ptr = message->recv_buf; rt_uint32_t size = message->length; - + DEBUG_PRINTF("spi poll transfer start: %d\n", size); while(size--) @@ -188,7 +188,7 @@ static rt_uint32_t xfer(struct rt_spi_device* device, struct rt_spi_message* mes { data = *send_ptr++; } - + // Todo: replace register read/write by gd32f3 lib //Wait until the transmit buffer is empty while(RESET == spi_i2s_flag_get(spi_periph, SPI_FLAG_TBE)); diff --git a/bsp/gd32e230k-start/drivers/drv_spi.h b/bsp/gd32e230k-start/drivers/drv_spi.h index 01bafb9964..ba8e55916a 100644 --- a/bsp/gd32e230k-start/drivers/drv_spi.h +++ b/bsp/gd32e230k-start/drivers/drv_spi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32e230k-start/drivers/drv_usart.c b/bsp/gd32e230k-start/drivers/drv_usart.c index bf1f6b68a7..204ffa1ca1 100644 --- a/bsp/gd32e230k-start/drivers/drv_usart.c +++ b/bsp/gd32e230k-start/drivers/drv_usart.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -41,7 +41,7 @@ struct gd32_uart uint16_t tx_pin; uint32_t rx_port; uint32_t rx_af; - uint16_t rx_pin; + uint16_t rx_pin; struct rt_serial_device * serial; char *device_name; @@ -93,7 +93,7 @@ static const struct gd32_uart uarts[] = { "uart0", }, #endif - + #ifdef RT_USING_USART1 { USART1, // uart peripheral index @@ -122,18 +122,18 @@ void gd32_uart_gpio_init(struct gd32_uart *uart) /* enable USART clock */ rcu_periph_clock_enable(uart->tx_gpio_clk); rcu_periph_clock_enable(uart->rx_gpio_clk); - rcu_periph_clock_enable(uart->per_clk); + rcu_periph_clock_enable(uart->per_clk); /* connect port to USARTx_Tx */ gpio_af_set(uart->tx_port, uart->tx_af, uart->tx_pin); gpio_mode_set(uart->tx_port, GPIO_MODE_AF, GPIO_PUPD_NONE, uart->tx_pin); gpio_output_options_set(uart->tx_port, GPIO_OTYPE_PP, GPIO_OSPEED_10MHZ, uart->tx_pin); - + /* connect port to USARTx_Rx */ gpio_af_set(uart->rx_port, uart->rx_af, uart->rx_pin); gpio_mode_set(uart->rx_port, GPIO_MODE_AF, GPIO_PUPD_NONE, uart->rx_pin); gpio_output_options_set(uart->rx_port, GPIO_OTYPE_PP, GPIO_OSPEED_10MHZ, uart->rx_pin); - + NVIC_SetPriority(uart->irqn, 0); NVIC_EnableIRQ(uart->irqn); } @@ -146,9 +146,9 @@ static rt_err_t gd32_configure(struct rt_serial_device *serial, struct serial_co RT_ASSERT(cfg != RT_NULL); uart = (struct gd32_uart *)serial->parent.user_data; - + gd32_uart_gpio_init(uart); - + usart_baudrate_set(uart->uart_periph, cfg->baud_rate); switch (cfg->data_bits) @@ -228,7 +228,7 @@ static int gd32_putc(struct rt_serial_device *serial, char ch) usart_data_transmit(uart->uart_periph, ch); while((usart_flag_get(uart->uart_periph, USART_FLAG_TC) == RESET)); - + return 1; } diff --git a/bsp/gd32e230k-start/drivers/drv_usart.h b/bsp/gd32e230k-start/drivers/drv_usart.h index 0fb15bee6f..4059092706 100644 --- a/bsp/gd32e230k-start/drivers/drv_usart.h +++ b/bsp/gd32e230k-start/drivers/drv_usart.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32e230k-start/drivers/gd32e230_libopt.h b/bsp/gd32e230k-start/drivers/gd32e230_libopt.h index 61010d794f..767e929d8f 100644 --- a/bsp/gd32e230k-start/drivers/gd32e230_libopt.h +++ b/bsp/gd32e230k-start/drivers/gd32e230_libopt.h @@ -1,7 +1,7 @@ /*! \file gd32e230_libopt.h \brief library optional for gd32e230 - + \version 2018-06-19, V1.0.0, firmware for GD32E230 */ @@ -10,27 +10,27 @@ All rights reserved. - Redistribution and use in source and binary forms, with or without modification, + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ diff --git a/bsp/gd32vf103v-eval/applications/main.c b/bsp/gd32vf103v-eval/applications/main.c index c411937c18..9d7d2edafe 100644 --- a/bsp/gd32vf103v-eval/applications/main.c +++ b/bsp/gd32vf103v-eval/applications/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32vf103v-eval/board/board.c b/bsp/gd32vf103v-eval/board/board.c index de2907c79b..5df6fa722f 100644 --- a/bsp/gd32vf103v-eval/board/board.c +++ b/bsp/gd32vf103v-eval/board/board.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32vf103v-eval/board/board.h b/bsp/gd32vf103v-eval/board/board.h index 422634fc38..860d71698b 100644 --- a/bsp/gd32vf103v-eval/board/board.h +++ b/bsp/gd32vf103v-eval/board/board.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/gd32vf103v-eval/board/gd32vf103_libopt.h b/bsp/gd32vf103v-eval/board/gd32vf103_libopt.h index ca292d2659..58ef886900 100644 --- a/bsp/gd32vf103v-eval/board/gd32vf103_libopt.h +++ b/bsp/gd32vf103v-eval/board/gd32vf103_libopt.h @@ -8,27 +8,27 @@ /* Copyright (c) 2019, GigaDevice Semiconductor Inc. - Redistribution and use in source and binary forms, with or without modification, + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ diff --git a/bsp/gd32vf103v-eval/drivers/drv_gpio.c b/bsp/gd32vf103v-eval/drivers/drv_gpio.c index 95393cd4f2..ca56bf54a2 100644 --- a/bsp/gd32vf103v-eval/drivers/drv_gpio.c +++ b/bsp/gd32vf103v-eval/drivers/drv_gpio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,7 +15,7 @@ #define EXTI_(x) BIT(x) -static const struct pin_index pins[] = +static const struct pin_index pins[] = { #if defined(GPIOA) __GD32VF_PIN(0 , A, 0 ), @@ -126,7 +126,7 @@ static const struct pin_irq_map pin_irq_map[] = {GPIO_PIN_12, EXTI10_15_IRQn}, {GPIO_PIN_13, EXTI10_15_IRQn}, {GPIO_PIN_14, EXTI10_15_IRQn}, - {GPIO_PIN_15, EXTI10_15_IRQn}, + {GPIO_PIN_15, EXTI10_15_IRQn}, }; static struct rt_pin_irq_hdr pin_irq_hdr_tab[] = @@ -406,11 +406,11 @@ static rt_err_t gd32vf_pin_irq_enable(struct rt_device *device, rt_base_t pin, gpio_bit_reset(index->gpio_periph, index->pin); pin_irq_enable_mask &= ~irqmap->pinbit; - + eclic_irq_disable(irqmap->irqno); exti_interrupt_flag_clear(EXTI_(index->pin)); - - rt_hw_interrupt_enable(level); + + rt_hw_interrupt_enable(level); } else { diff --git a/bsp/gd32vf103v-eval/drivers/drv_gpio.h b/bsp/gd32vf103v-eval/drivers/drv_gpio.h index ccb8ea92a3..af1094e97d 100644 --- a/bsp/gd32vf103v-eval/drivers/drv_gpio.h +++ b/bsp/gd32vf103v-eval/drivers/drv_gpio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -38,4 +38,4 @@ int rt_hw_gpio_init(void); #endif /* __DRV_GPIO__H__ */ -/******************* end of file *******************/ \ No newline at end of file +/******************* end of file *******************/ diff --git a/bsp/gd32vf103v-eval/drivers/drv_usart.c b/bsp/gd32vf103v-eval/drivers/drv_usart.c index 9a15eca933..313440329c 100644 --- a/bsp/gd32vf103v-eval/drivers/drv_usart.c +++ b/bsp/gd32vf103v-eval/drivers/drv_usart.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -15,7 +15,7 @@ #if !defined(BSP_USING_UART0) && !defined(BSP_USING_UART1) && !defined(BSP_USING_UART2) \ && !defined(BSP_USING_UART3) && !defined(BSP_USING_UART4) && !defined(BSP_USING_UART5) #error "Please define at least one BSP_USING_UARTx" - /* this driver can be disabled at menuconfig ¡ú RT-Thread Components ¡ú Device Drivers */ + /* this driver can be disabled at menuconfig → RT-Thread Components → Device Drivers */ #endif struct gd32_usart { -- cgit v1.3.1 From c20c2b6d5ee1b0ed0dd373b00276de93cd60d230 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Fri, 12 Mar 2021 00:09:55 +0800 Subject: [w60x][drivers] auto formatted --- bsp/w60x/drivers/board.c | 16 ++++---- bsp/w60x/drivers/drv_crypto.c | 86 ++++++++++++++++++++--------------------- bsp/w60x/drivers/drv_rtc.c | 2 +- bsp/w60x/drivers/drv_soft_i2c.c | 6 +-- bsp/w60x/drivers/drv_soft_i2c.h | 2 +- bsp/w60x/drivers/drv_standby.c | 4 +- bsp/w60x/drivers/drv_uart.c | 2 +- bsp/w60x/drivers/pin_config.h | 2 +- bsp/w60x/oneshot/oneshot.c | 42 ++++++++++---------- bsp/w60x/oneshot/oneshot.h | 6 +-- bsp/w60x/oneshot/oneshot_demo.c | 2 +- 11 files changed, 85 insertions(+), 85 deletions(-) diff --git a/bsp/w60x/drivers/board.c b/bsp/w60x/drivers/board.c index e4e2ccde47..188c698ba9 100644 --- a/bsp/w60x/drivers/board.c +++ b/bsp/w60x/drivers/board.c @@ -98,14 +98,14 @@ void disp_version_info(void) void wm_gpio_config(void) { - /* must call first */ - wm_gpio_af_disable(); - - /*MASTER SPI configuratioin*/ - wm_spi_cs_config(WM_IO_PA_02); - wm_spi_ck_config(WM_IO_PA_11); - wm_spi_di_config(WM_IO_PA_03); - wm_spi_do_config(WM_IO_PA_09); + /* must call first */ + wm_gpio_af_disable(); + + /*MASTER SPI configuratioin*/ + wm_spi_cs_config(WM_IO_PA_02); + wm_spi_ck_config(WM_IO_PA_11); + wm_spi_di_config(WM_IO_PA_03); + wm_spi_do_config(WM_IO_PA_09); } static int wm_infsl_init(void) diff --git a/bsp/w60x/drivers/drv_crypto.c b/bsp/w60x/drivers/drv_crypto.c index 4335e42b50..1e0db82cde 100644 --- a/bsp/w60x/drivers/drv_crypto.c +++ b/bsp/w60x/drivers/drv_crypto.c @@ -465,25 +465,25 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx, const struct hw_bignum_mpi *b, const struct hw_bignum_mpi *c) { - pstm_int pa, pb, pm, pres; + pstm_int pa, pb, pm, pres; u32 * buff_a = NULL; - u32 * buff_b = NULL; - u32 * buff_m = NULL; - int err = -1; + u32 * buff_b = NULL; + u32 * buff_m = NULL; + int err = -1; void *buff; int buff_len; pstm_init(NULL, &pres); buff_a = tls_mem_alloc(a->total); - if(buff_a == NULL) - goto out; - buff_b = tls_mem_alloc(b->total); - if(buff_b == NULL) - goto out; - buff_m = tls_mem_alloc(c->total); - if(buff_m == NULL) - goto out; + if(buff_a == NULL) + goto out; + buff_b = tls_mem_alloc(b->total); + if(buff_b == NULL) + goto out; + buff_m = tls_mem_alloc(c->total); + if(buff_m == NULL) + goto out; memset(buff_a, 0, a->total); memset(buff_b, 0, b->total); @@ -494,29 +494,29 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx, memcpy(buff_m, c->p, c->total); pstm_reverse((unsigned char *)buff_a, a->total); - pstm_reverse((unsigned char *)buff_b, b->total); - pstm_reverse((unsigned char *)buff_m, c->total); + pstm_reverse((unsigned char *)buff_b, b->total); + pstm_reverse((unsigned char *)buff_m, c->total); // *((volatile unsigned int *)0x40000710) = *((volatile unsigned int *)0x40000710) | (0x1 << 28); - if ((err = pstm_init_for_read_unsigned_bin(NULL, &pa, a->total)) != PS_SUCCESS){ - goto out; - } - if ((err = pstm_read_unsigned_bin(&pa, (unsigned char *)buff_a, a->total)) != PS_SUCCESS) { - goto out; - } - if ((err = pstm_init_for_read_unsigned_bin(NULL, &pb, b->total)) != PS_SUCCESS){ - goto out; - } - if ((err = pstm_read_unsigned_bin(&pb, (unsigned char *)buff_b, b->total)) != PS_SUCCESS) { - goto out; - } - if ((err = pstm_init_for_read_unsigned_bin(NULL, &pm, c->total)) != PS_SUCCESS){ - goto out; - } - if ((err = pstm_read_unsigned_bin(&pm, (unsigned char *)buff_m, c->total)) != PS_SUCCESS) { - goto out; - } + if ((err = pstm_init_for_read_unsigned_bin(NULL, &pa, a->total)) != PS_SUCCESS){ + goto out; + } + if ((err = pstm_read_unsigned_bin(&pa, (unsigned char *)buff_a, a->total)) != PS_SUCCESS) { + goto out; + } + if ((err = pstm_init_for_read_unsigned_bin(NULL, &pb, b->total)) != PS_SUCCESS){ + goto out; + } + if ((err = pstm_read_unsigned_bin(&pb, (unsigned char *)buff_b, b->total)) != PS_SUCCESS) { + goto out; + } + if ((err = pstm_init_for_read_unsigned_bin(NULL, &pm, c->total)) != PS_SUCCESS){ + goto out; + } + if ((err = pstm_read_unsigned_bin(&pm, (unsigned char *)buff_m, c->total)) != PS_SUCCESS) { + goto out; + } tls_crypto_exptmod(&pa, &pb, &pm, &pres); buff_len = pstm_unsigned_bin_size(&pres); @@ -528,16 +528,16 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx, out: if(buff_a) - tls_mem_free(buff_a); - if(buff_b) - tls_mem_free(buff_b); - if(buff_m) - tls_mem_free(buff_m); + tls_mem_free(buff_a); + if(buff_b) + tls_mem_free(buff_b); + if(buff_m) + tls_mem_free(buff_m); - pstm_clear(&pa); - pstm_clear(&pb); - pstm_clear(&pm); - pstm_clear(&pres); + pstm_clear(&pa); + pstm_clear(&pb); + pstm_clear(&pm); + pstm_clear(&pres); if (a->sign < 0) { @@ -583,7 +583,7 @@ static const struct hwcrypto_crc_ops crc_ops = .update = _crc_update, }; -static const struct hwcrypto_bignum_ops bignum_ops = +static const struct hwcrypto_bignum_ops bignum_ops = { .add = RT_NULL, .sub = RT_NULL, @@ -722,7 +722,7 @@ int wm_hw_crypto_device_init(void) _crypto_dev.dev.ops = &_ops; _crypto_dev.dev.id = 0; - rt_memcpy(&_crypto_dev.dev.id, wpa_supplicant_get_mac(), + rt_memcpy(&_crypto_dev.dev.id, wpa_supplicant_get_mac(), sizeof(_crypto_dev.dev.id) > 6 ? 6 : sizeof(_crypto_dev.dev.id)); _crypto_dev.dev.user_data = &_crypto_dev; diff --git a/bsp/w60x/drivers/drv_rtc.c b/bsp/w60x/drivers/drv_rtc.c index fa0aee498c..38da5aec58 100644 --- a/bsp/w60x/drivers/drv_rtc.c +++ b/bsp/w60x/drivers/drv_rtc.c @@ -172,7 +172,7 @@ static rt_size_t wm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, } #ifdef RT_USING_DEVICE_OPS -const static struct rt_device_ops _ops = +const static struct rt_device_ops _ops = { .init = wm_rtc_init, .open = wm_rtc_open, diff --git a/bsp/w60x/drivers/drv_soft_i2c.c b/bsp/w60x/drivers/drv_soft_i2c.c index b2e0b5b508..1e44d52662 100644 --- a/bsp/w60x/drivers/drv_soft_i2c.c +++ b/bsp/w60x/drivers/drv_soft_i2c.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -198,8 +198,8 @@ int rt_soft_i2c_init(void) w60x_i2c_bus_unlock(&soft_i2c_config[i]); LOG_D("software simulation %s init done, pin scl: %d, pin sda %d", - soft_i2c_config[i].bus_name, - soft_i2c_config[i].scl, + soft_i2c_config[i].bus_name, + soft_i2c_config[i].scl, soft_i2c_config[i].sda); } diff --git a/bsp/w60x/drivers/drv_soft_i2c.h b/bsp/w60x/drivers/drv_soft_i2c.h index ee50abea71..9901a5958f 100644 --- a/bsp/w60x/drivers/drv_soft_i2c.h +++ b/bsp/w60x/drivers/drv_soft_i2c.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/drivers/drv_standby.c b/bsp/w60x/drivers/drv_standby.c index 1c3de4bc3a..dfe699bf32 100644 --- a/bsp/w60x/drivers/drv_standby.c +++ b/bsp/w60x/drivers/drv_standby.c @@ -33,7 +33,7 @@ extern void standby_idr(void); #if (1 == GCC_COMPILE) void wm_pm_standby(void) { - __asm volatile ( + __asm volatile ( " cpsid i \n" /* disable irq*/ " dsb \n" " ldr r0, =0X499 \n" @@ -76,7 +76,7 @@ void sys_start_standby(int ms) { return; } - tls_irq_enable(PMU_GPIO_WAKEUP_INT); //Open interrupt by default to clear the interrupt flag for IO wake-up + tls_irq_enable(PMU_GPIO_WAKEUP_INT); //Open interrupt by default to clear the interrupt flag for IO wake-up val = tls_reg_read32(HR_PMU_PS_CR); val |= 0x01; tls_reg_write32(HR_PMU_PS_CR, val); diff --git a/bsp/w60x/drivers/drv_uart.c b/bsp/w60x/drivers/drv_uart.c index 6a3c4c40fc..e2c0f0d192 100644 --- a/bsp/w60x/drivers/drv_uart.c +++ b/bsp/w60x/drivers/drv_uart.c @@ -208,7 +208,7 @@ static int wm_uart_flow_ctrl_set(TLS_UART_REGS_T *UARTx, TLS_UART_FLOW_CTRL_MODE case TLS_UART_FLOW_CTRL_HARDWARE: UARTx->UR_FC = (1UL << 0) | (6UL << 2); - break; + break; default: break; diff --git a/bsp/w60x/drivers/pin_config.h b/bsp/w60x/drivers/pin_config.h index cf1eb774c3..c704fafb22 100644 --- a/bsp/w60x/drivers/pin_config.h +++ b/bsp/w60x/drivers/pin_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2019, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * diff --git a/bsp/w60x/oneshot/oneshot.c b/bsp/w60x/oneshot/oneshot.c index ee60a0b907..21beeeb90d 100644 --- a/bsp/w60x/oneshot/oneshot.c +++ b/bsp/w60x/oneshot/oneshot.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -16,37 +16,37 @@ /* start oneshot */ int wm_oneshot_start(WM_ONESHOT_MODE mode, wm_oneshot_callback callback) { - tls_wifi_oneshot_callback_register(callback); - if(mode == WM_UDP) - { - tls_wifi_set_oneshot_config_mode(0); - } + tls_wifi_oneshot_callback_register(callback); + if(mode == WM_UDP) + { + tls_wifi_set_oneshot_config_mode(0); + } else if (mode == WM_APSOCKET) { tls_wifi_set_oneshot_config_mode(1); - } - else if(mode == WM_APWEB) - { - tls_wifi_set_oneshot_config_mode(2); - } - else - { - return -1; - } - tls_wifi_set_oneshot_flag(1); - return 0; + } + else if(mode == WM_APWEB) + { + tls_wifi_set_oneshot_config_mode(2); + } + else + { + return -1; + } + tls_wifi_set_oneshot_flag(1); + return 0; } /* stop oneshot */ int wm_oneshot_stop(void) { - tls_wifi_oneshot_callback_delete(); - tls_wifi_set_oneshot_flag(0); - return 0; + tls_wifi_oneshot_callback_delete(); + tls_wifi_set_oneshot_flag(0); + return 0; } /* get status */ int wm_oneshot_get(void) { - return tls_wifi_get_oneshot_flag(); + return tls_wifi_get_oneshot_flag(); } diff --git a/bsp/w60x/oneshot/oneshot.h b/bsp/w60x/oneshot/oneshot.h index f9bd638c1a..26f25d0735 100644 --- a/bsp/w60x/oneshot/oneshot.h +++ b/bsp/w60x/oneshot/oneshot.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -12,9 +12,9 @@ #define DRV_ONESHOT_H__ typedef enum{ - WM_UDP, + WM_UDP, WM_APSOCKET, - WM_APWEB + WM_APWEB }WM_ONESHOT_MODE; diff --git a/bsp/w60x/oneshot/oneshot_demo.c b/bsp/w60x/oneshot/oneshot_demo.c index 7012b5af5b..b40e121f16 100644 --- a/bsp/w60x/oneshot/oneshot_demo.c +++ b/bsp/w60x/oneshot/oneshot_demo.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * -- cgit v1.3.1 From f3fbbf84777ab0a7a58be38ef4f8c959dd6c0d54 Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Fri, 12 Mar 2021 10:09:34 +0800 Subject: Delete dfs_uffs.c --- components/dfs/filesystems/uffs/dfs_uffs.c | 660 ----------------------------- 1 file changed, 660 deletions(-) delete mode 100644 components/dfs/filesystems/uffs/dfs_uffs.c diff --git a/components/dfs/filesystems/uffs/dfs_uffs.c b/components/dfs/filesystems/uffs/dfs_uffs.c deleted file mode 100644 index 1ccd715800..0000000000 --- a/components/dfs/filesystems/uffs/dfs_uffs.c +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2011-10-22 prife the first version - * 2012-03-28 prife use mtd device interface - * 2012-04-05 prife update uffs with official repo and use uffs_UnMount/Mount - * 2017-04-12 lizhen9880 fix the f_bsize and f_blocks issue in function dfs_uffs_statfs - */ - -#include - -#include -#include -#include - -#include "dfs_uffs.h" - -#include "uffs/uffs_fd.h" /* posix file api is here */ -#include "uffs/uffs_mtb.h" -#include "uffs/uffs_mem.h" -#include "uffs/uffs_utils.h" - -/* - * RT-Thread DFS Interface for uffs - */ -#define UFFS_DEVICE_MAX 2 /* the max partions on a nand deivce*/ -#define UFFS_MOUNT_PATH_MAX 128 /* the mount point max length */ -#define FILE_PATH_MAX 256 /* the longest file path */ - -struct _nand_dev -{ - struct rt_mtd_nand_device *dev; - struct uffs_StorageAttrSt storage; - uffs_Device uffs_dev; - uffs_MountTable mount_table; - char mount_path[UFFS_MOUNT_PATH_MAX]; - void *data; /* when uffs use static buf, it will save ptr here */ -}; -/* make sure the following struct var had been initilased to 0! */ -static struct _nand_dev nand_part[UFFS_DEVICE_MAX] = {0}; - -static int uffs_result_to_dfs(int result) -{ - int status = -1; - - result = result < 0 ? -result : result; - switch (result) - { - case UENOERR:/** no error */ - break; - case UEACCES:/** Tried to open read-only file for writing, or files sharing mode - does not allow specified operations, or given path is directory */ - status = -EINVAL; - break;/* no suitable */ - case UEEXIST: /** _O_CREAT and _O_EXCL flags specified, but filename already exists */ - status = -EEXIST; - break; - case UEINVAL: /** Invalid oflag or pmode argument */ - status = -EINVAL; - break; - case UEMFILE: /** No more file handles available(too many open files) */ - status = -1; - break; - case UENOENT: /** file or path not found */ - status = -ENOENT; - break; - case UETIME: /** can't set file time */ - status = -1; - break; - case UEBADF: /** invalid file handle */ - status = -EBADF; - break; - case UENOMEM:/** no enough memory */ - status = -ENOSPC; - break; - case UEIOERR: /** I/O error from lower level flash operation */ - status = -EIO; - break; - case UENOTDIR: /** Not a directory */ - status = -ENOTDIR; - break; - case UEISDIR: /** Is a directory */ - status = -EISDIR; - break; - case UEUNKNOWN_ERR: - default: - status = -1; - break; /* unknown error! */ - } - - return status; -} - -static URET _device_init(uffs_Device *dev) -{ - dev->attr->_private = NULL; // hook nand_chip data structure to attr->_private - dev->ops = (struct uffs_FlashOpsSt *)&nand_ops; - - return U_SUCC; -} - -static URET _device_release(uffs_Device *dev) -{ - return U_SUCC; -} - -static int init_uffs_fs( - struct _nand_dev *nand_part) -{ - uffs_MountTable *mtb; - struct rt_mtd_nand_device *nand; - struct uffs_StorageAttrSt *flash_storage; - - mtb = &nand_part->mount_table; - nand = nand_part->dev; - flash_storage = &nand_part->storage; - - /* setup nand storage attributes */ - uffs_setup_storage(flash_storage, nand); - - /* register mount table */ - if (mtb->dev) - { - /* set memory allocator for uffs */ -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 - uffs_MemSetupSystemAllocator(&mtb->dev->mem); -#endif - /* setup device init/release entry */ - mtb->dev->Init = _device_init; - mtb->dev->Release = _device_release; - mtb->dev->attr = flash_storage; - - uffs_RegisterMountTable(mtb); - } - /* mount uffs partion on nand device */ - return uffs_Mount(nand_part->mount_path) == U_SUCC ? 0 : -1; -} - -static int dfs_uffs_mount( - struct dfs_filesystem *fs, - unsigned long rwflag, - const void *data) -{ - rt_base_t index; - uffs_MountTable *mount_part; - struct rt_mtd_nand_device *dev; - - RT_ASSERT(rt_strlen(fs->path) < (UFFS_MOUNT_PATH_MAX - 1)); - dev = RT_MTD_NAND_DEVICE(fs->dev_id); - - /*1. find a empty entry in partition table */ - for (index = 0; index < UFFS_DEVICE_MAX ; index ++) - { - if (nand_part[index].dev == RT_NULL) - break; - } - if (index == UFFS_DEVICE_MAX) - return -ENOENT; - - /*2. fill partition structure */ - nand_part[index].dev = dev; - - /* make a right mount path for uffs, end with '/' */ - rt_snprintf(nand_part[index].mount_path, UFFS_MOUNT_PATH_MAX, "%s/", fs->path); - if (nand_part[index].mount_path[1] == '/') - nand_part[index].mount_path[1] = 0; - - mount_part = &(nand_part[index].mount_table); - mount_part->mount = nand_part[index].mount_path; - mount_part->dev = &(nand_part[index].uffs_dev); - rt_memset(mount_part->dev, 0, sizeof(uffs_Device));//in order to make uffs happy. - mount_part->dev->_private = dev; /* save dev_id into uffs */ - mount_part->start_block = dev->block_start; - mount_part->end_block = dev->block_end; - /*3. mount uffs */ - if (init_uffs_fs(&nand_part[index]) < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - return 0; -} - -static int dfs_uffs_unmount(struct dfs_filesystem *fs) -{ - rt_base_t index; - int result; - - /* find the device index and then unmount it */ - for (index = 0; index < UFFS_DEVICE_MAX; index++) - { - if (nand_part[index].dev == RT_MTD_NAND_DEVICE(fs->dev_id)) - { - nand_part[index].dev = RT_NULL; - result = uffs_UnMount(nand_part[index].mount_path); - if (result != U_SUCC) - break; - - result = uffs_UnRegisterMountTable(& nand_part[index].mount_table); - return (result == U_SUCC) ? RT_EOK : -1; - } - } - return -ENOENT; -} - -static int dfs_uffs_mkfs(rt_device_t dev_id) -{ - rt_base_t index; - rt_uint32_t block; - struct rt_mtd_nand_device *mtd; - - /*1. find the device index */ - for (index = 0; index < UFFS_DEVICE_MAX; index++) - { - if (nand_part[index].dev == (struct rt_mtd_nand_device *)dev_id) - break; - } - - if (index == UFFS_DEVICE_MAX) - { - /* can't find device driver */ - return -ENOENT; - } - - /*2. then unmount the partition */ - uffs_UnMount(nand_part[index].mount_path); - mtd = nand_part[index].dev; - - /*3. erase all blocks on the partition */ - block = mtd->block_start; - for (; block <= mtd->block_end; block++) - { - rt_mtd_nand_erase_block(mtd, block); -#if defined(RT_UFFS_USE_CHECK_MARK_FUNCITON) - if (rt_mtd_nand_check_block(mtd, block) != RT_EOK) - { - rt_kprintf("found bad block %d\n", block); - rt_mtd_nand_mark_badblock(mtd, block); - } -#endif - } - - /*4. remount it */ - if (init_uffs_fs(&nand_part[index]) < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - return RT_EOK; -} - -static int dfs_uffs_statfs(struct dfs_filesystem *fs, - struct statfs *buf) -{ - rt_base_t index; - struct rt_mtd_nand_device *mtd = RT_MTD_NAND_DEVICE(fs->dev_id); - - RT_ASSERT(mtd != RT_NULL); - - /* find the device index */ - for (index = 0; index < UFFS_DEVICE_MAX; index++) - { - if (nand_part[index].dev == (void *)mtd) - break; - } - if (index == UFFS_DEVICE_MAX) - return -ENOENT; - - buf->f_bsize = mtd->page_size * mtd->pages_per_block; - buf->f_blocks = (mtd->block_end - mtd->block_start + 1); - buf->f_bfree = uffs_GetDeviceFree(&nand_part[index].uffs_dev) / buf->f_bsize ; - - return 0; -} - -static int dfs_uffs_open(struct dfs_fd *file) -{ - int fd; - int oflag, mode; - char *file_path; - - oflag = file->flags; - if (oflag & O_DIRECTORY) /* operations about dir */ - { - uffs_DIR *dir; - - if (oflag & O_CREAT) /* create a dir*/ - { - if (uffs_mkdir(file->path) < 0) - return uffs_result_to_dfs(uffs_get_error()); - } - /* open dir */ - file_path = rt_malloc(FILE_PATH_MAX); - if (file_path == RT_NULL) - return -ENOMEM; - - if (file->path[0] == '/' && !(file->path[1] == 0)) - rt_snprintf(file_path, FILE_PATH_MAX, "%s/", file->path); - else - { - file_path[0] = '/'; - file_path[1] = 0; - } - - dir = uffs_opendir(file_path); - - if (dir == RT_NULL) - { - rt_free(file_path); - return uffs_result_to_dfs(uffs_get_error()); - } - /* save this pointer,will used by dfs_uffs_getdents*/ - file->data = dir; - rt_free(file_path); - return RT_EOK; - } - /* regular file operations */ - /* int uffs_open(const char *name, int oflag, ...); what is this? - * uffs_open can open dir!! **/ - mode = 0; - if (oflag & O_RDONLY) mode |= UO_RDONLY; - if (oflag & O_WRONLY) mode |= UO_WRONLY; - if (oflag & O_RDWR) mode |= UO_RDWR; - /* Opens the file, if it is existing. If not, a new file is created. */ - if (oflag & O_CREAT) mode |= UO_CREATE; - /* Creates a new file. If the file is existing, it is truncated and overwritten. */ - if (oflag & O_TRUNC) mode |= UO_TRUNC; - /* Creates a new file. The function fails if the file is already existing. */ - if (oflag & O_EXCL) mode |= UO_EXCL; - - fd = uffs_open(file->path, mode); - if (fd < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - - /* save this pointer, it will be used when calling read(), write(), - * flush(), seek(), and will be free when calling close()*/ - - file->data = (void *)fd; - file->pos = uffs_seek(fd, 0, USEEK_CUR); - file->size = uffs_seek(fd, 0, USEEK_END); - uffs_seek(fd, file->pos, USEEK_SET); - - if (oflag & O_APPEND) - { - file->pos = uffs_seek(fd, 0, USEEK_END); - } - return 0; -} - -static int dfs_uffs_close(struct dfs_fd *file) -{ - int oflag; - int fd; - - oflag = file->flags; - if (oflag & O_DIRECTORY) - { - /* operations about dir */ - if (uffs_closedir((uffs_DIR *)(file->data)) < 0) - return uffs_result_to_dfs(uffs_get_error()); - - return 0; - } - /* regular file operations */ - fd = (int)(file->data); - - if (uffs_close(fd) == 0) - return 0; - - return uffs_result_to_dfs(uffs_get_error()); -} - -static int dfs_uffs_ioctl(struct dfs_fd *file, int cmd, void *args) -{ - return -ENOSYS; -} - -static int dfs_uffs_read(struct dfs_fd *file, void *buf, size_t len) -{ - int fd; - int char_read; - - fd = (int)(file->data); - char_read = uffs_read(fd, buf, len); - if (char_read < 0) - return uffs_result_to_dfs(uffs_get_error()); - - /* update position */ - file->pos = uffs_seek(fd, 0, USEEK_CUR); - return char_read; -} - -static int dfs_uffs_write(struct dfs_fd *file, - const void *buf, - size_t len) -{ - int fd; - int char_write; - - fd = (int)(file->data); - - char_write = uffs_write(fd, buf, len); - if (char_write < 0) - return uffs_result_to_dfs(uffs_get_error()); - - /* update position */ - file->pos = uffs_seek(fd, 0, USEEK_CUR); - return char_write; -} - -static int dfs_uffs_flush(struct dfs_fd *file) -{ - int fd; - int result; - - fd = (int)(file->data); - - result = uffs_flush(fd); - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - return 0; -} - -int uffs_seekdir(uffs_DIR *dir, long offset) -{ - int i = 0; - - while (i < offset) - { - if (uffs_readdir(dir) == RT_NULL) - return -1; - i++; - } - return 0; -} - - -static int dfs_uffs_seek(struct dfs_fd *file, - rt_off_t offset) -{ - int result; - - /* set offset as current offset */ - if (file->type == FT_DIRECTORY) - { - uffs_rewinddir((uffs_DIR *)(file->data)); - result = uffs_seekdir((uffs_DIR *)(file->data), offset / sizeof(struct dirent)); - if (result >= 0) - { - file->pos = offset; - return offset; - } - } - else if (file->type == FT_REGULAR) - { - result = uffs_seek((int)(file->data), offset, USEEK_SET); - if (result >= 0) - return offset; - } - - return uffs_result_to_dfs(uffs_get_error()); -} - -/* return the size of struct dirent*/ -static int dfs_uffs_getdents( - struct dfs_fd *file, - struct dirent *dirp, - uint32_t count) -{ - rt_uint32_t index; - char *file_path; - struct dirent *d; - uffs_DIR *dir; - struct uffs_dirent *uffs_d; - - dir = (uffs_DIR *)(file->data); - RT_ASSERT(dir != RT_NULL); - - /* round count, count is always 1 */ - count = (count / sizeof(struct dirent)) * sizeof(struct dirent); - if (count == 0) return -EINVAL; - - /* allocate file name */ - file_path = rt_malloc(FILE_PATH_MAX); - if (file_path == RT_NULL) - return -ENOMEM; - - index = 0; - /* usually, the while loop should only be looped only once! */ - while (1) - { - struct uffs_stat s; - - d = dirp + index; - - uffs_d = uffs_readdir(dir); - if (uffs_d == RT_NULL) - { - rt_free(file_path); - return (uffs_result_to_dfs(uffs_get_error())); - } - - if (file->path[0] == '/' && !(file->path[1] == 0)) - rt_snprintf(file_path, FILE_PATH_MAX, "%s/%s", file->path, uffs_d->d_name); - else - rt_strncpy(file_path, uffs_d->d_name, FILE_PATH_MAX); - - uffs_stat(file_path, &s); - switch (s.st_mode & US_IFMT) /* file type mark */ - { - case US_IFREG: /* directory */ - d->d_type = DT_REG; - break; - case US_IFDIR: /* regular file */ - d->d_type = DT_DIR; - break; - case US_IFLNK: /* symbolic link */ - case US_IREAD: /* read permission */ - case US_IWRITE:/* write permission */ - default: - d->d_type = DT_UNKNOWN; - break; - } - - /* write the rest args of struct dirent* dirp */ - d->d_namlen = rt_strlen(uffs_d->d_name); - d->d_reclen = (rt_uint16_t)sizeof(struct dirent); - rt_strncpy(d->d_name, uffs_d->d_name, rt_strlen(uffs_d->d_name) + 1); - - index ++; - if (index * sizeof(struct dirent) >= count) - break; - } - - /* free file name buf */ - rt_free(file_path); - - if (index == 0) - return uffs_result_to_dfs(uffs_get_error()); - - file->pos += index * sizeof(struct dirent); - - return index * sizeof(struct dirent); -} - -static int dfs_uffs_unlink(struct dfs_filesystem *fs, const char *path) -{ - int result; - struct uffs_stat s; - - /* judge file type, dir is to be delete by uffs_rmdir, others by uffs_remove */ - if (uffs_lstat(path, &s) < 0) - { - return uffs_result_to_dfs(uffs_get_error()); - } - - switch (s.st_mode & US_IFMT) - { - case US_IFREG: - result = uffs_remove(path); - break; - case US_IFDIR: - result = uffs_rmdir(path); - break; - default: - /* unknown file type */ - return -1; - } - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - - return 0; -} - -static int dfs_uffs_rename( - struct dfs_filesystem *fs, - const char *oldpath, - const char *newpath) -{ - int result; - - result = uffs_rename(oldpath, newpath); - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - - return 0; -} - -static int dfs_uffs_stat(struct dfs_filesystem *fs, const char *path, struct stat *st) -{ - int result; - struct uffs_stat s; - - result = uffs_stat(path, &s); - if (result < 0) - return uffs_result_to_dfs(uffs_get_error()); - - /* convert uffs stat to dfs stat structure */ - /* FIXME, these field may not be the same */ - st->st_dev = 0; - st->st_mode = s.st_mode; - st->st_size = s.st_size; - st->st_mtime = s.st_mtime; - - return 0; -} - -static const struct dfs_file_ops dfs_uffs_fops = -{ - dfs_uffs_open, - dfs_uffs_close, - dfs_uffs_ioctl, - dfs_uffs_read, - dfs_uffs_write, - dfs_uffs_flush, - dfs_uffs_seek, - dfs_uffs_getdents, -}; - -static const struct dfs_filesystem_ops dfs_uffs_ops = -{ - "uffs", /* file system type: uffs */ -#if RTTHREAD_VERSION >= 10100 - DFS_FS_FLAG_FULLPATH, -#else -#error "uffs can only work with rtthread whose version should >= 1.01\n" -#endif - &dfs_uffs_fops, - - dfs_uffs_mount, - dfs_uffs_unmount, - dfs_uffs_mkfs, - dfs_uffs_statfs, - - dfs_uffs_unlink, - dfs_uffs_stat, - dfs_uffs_rename, -}; - -int dfs_uffs_init(void) -{ - /* register uffs file system */ - dfs_register(&dfs_uffs_ops); - - if (uffs_InitObjectBuf() == U_SUCC) - { - if (uffs_DirEntryBufInit() == U_SUCC) - { - uffs_InitGlobalFsLock(); - return RT_EOK; - } - } - return -RT_ERROR; -} -INIT_COMPONENT_EXPORT(dfs_uffs_init); - -- cgit v1.3.1 From 40a087fc8d50546a3d057360d37a2b0c02c56d76 Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Fri, 12 Mar 2021 10:09:47 +0800 Subject: Delete uffs_rtthread.c --- components/dfs/filesystems/uffs/uffs_rtthread.c | 158 ------------------------ 1 file changed, 158 deletions(-) delete mode 100644 components/dfs/filesystems/uffs/uffs_rtthread.c diff --git a/components/dfs/filesystems/uffs/uffs_rtthread.c b/components/dfs/filesystems/uffs/uffs_rtthread.c deleted file mode 100644 index 406ad35b2f..0000000000 --- a/components/dfs/filesystems/uffs/uffs_rtthread.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -/* - This file is part of UFFS, the Ultra-low-cost Flash File System. - - Copyright (C) 2005-2009 Ricky Zheng - - UFFS is free software; you can redistribute it and/or modify it under - the GNU Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version. - - UFFS is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - or GNU Library General Public License, as applicable, for more details. - - You should have received a copy of the GNU General Public License - and GNU Library General Public License along with UFFS; if not, write - to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, if other files instantiate templates or use - macros or inline functions from this file, or you compile this file - and link it with other works to produce a work based on this file, - this file does not by itself cause the resulting work to be covered - by the GNU General Public License. However the source code for this - file must still be made available in accordance with section (3) of - the GNU General Public License v2. - - This exception does not invalidate any other reasons why a work based - on this file might be covered by the GNU General Public License. -*/ - -/** - * \file uffs_os_posix.c - * \brief Emulation on POSIX host. This is just a dumb implementation, does not really create semaphores. - * \author Ricky Zheng - */ - -#include "uffs_config.h" -#include "uffs/uffs_os.h" -#include "uffs/uffs_public.h" -//#include - -#define PFX "os : " - -int uffs_SemCreate(OSSEM *sem) -{ - static int count = 0; - char name [RT_NAME_MAX+1]; - struct rt_mutex *mutex = RT_NULL; - - rt_snprintf(name, sizeof(name), "usem%d", count++); - mutex = rt_mutex_create(name, RT_IPC_FLAG_FIFO); - if (mutex != RT_NULL) - { - *sem = (OSSEM *)mutex; - return 0; - } - uffs_Perror(UFFS_MSG_SERIOUS, "can't get a semphore"); - return -1; -} - -int uffs_SemWait(OSSEM sem) -{ - return rt_mutex_take((struct rt_mutex *)sem, RT_WAITING_FOREVER); -} - -int uffs_SemSignal(OSSEM sem) -{ - return rt_mutex_release((struct rt_mutex *)sem); -} - -int uffs_SemDelete(OSSEM *sem) -{ - int ret = -1; - - if (sem) { - ret = rt_mutex_delete((struct rt_mutex *)(*sem)); - if (ret == RT_EOK) { - *sem = 0; - } - } - return ret; -} - -int uffs_OSGetTaskId(void) -{ - //TODO: ... return current task ID ... - return 0; -} - -unsigned int uffs_GetCurDateTime(void) -{ - // FIXME: return system time, please modify this for your platform ! - // or just return 0 if you don't care about file time. -#if 0 - time_t tvalue; - - tvalue = time(NULL); - - return (unsigned int)tvalue; -#endif - return 0; -} - -#if CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR > 0 -static void * sys_malloc(struct uffs_DeviceSt *dev, unsigned int size) -{ - dev = dev; - uffs_Perror(UFFS_MSG_NORMAL, "system memory alloc %d bytes", size); - return rt_malloc(size); -} - -static URET sys_free(struct uffs_DeviceSt *dev, void *p) -{ - dev = dev; - rt_free(p); - return U_SUCC; -} - -void uffs_MemSetupSystemAllocator(uffs_MemAllocator *allocator) -{ - allocator->malloc = sys_malloc; - allocator->free = sys_free; -} -#endif - -#if !defined(RT_THREAD) -/* debug message output throught 'printf' */ -static void output_dbg_msg(const char *msg); -static struct uffs_DebugMsgOutputSt m_dbg_ops = { - output_dbg_msg, - NULL, -}; - -static void output_dbg_msg(const char *msg) -{ - rt_kprintf("%s", msg); -} - -void uffs_SetupDebugOutput(void) -{ - uffs_InitDebugMessageOutput(&m_dbg_ops, UFFS_MSG_NOISY); -} -#else - -void uffs_SetupDebugOutput(void) -{ -} -#endif -- cgit v1.3.1 From c6b6b77716eec7a44cbad7f47a2e3a7beb01603e Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Fri, 12 Mar 2021 10:09:56 +0800 Subject: Delete dfs_uffs.h --- components/dfs/filesystems/uffs/dfs_uffs.h | 89 ------------------------------ 1 file changed, 89 deletions(-) delete mode 100644 components/dfs/filesystems/uffs/dfs_uffs.h diff --git a/components/dfs/filesystems/uffs/dfs_uffs.h b/components/dfs/filesystems/uffs/dfs_uffs.h deleted file mode 100644 index 8e08e069e1..0000000000 --- a/components/dfs/filesystems/uffs/dfs_uffs.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-03-30 prife the first version - */ - -#ifndef DFS_UFFS_H_ -#define DFS_UFFS_H_ - -#include "uffs_config.h" -#include "uffs/uffs_public.h" - -/* the UFFS ECC mode opitons */ -#ifndef RT_UFFS_ECC_MODE -#define RT_UFFS_ECC_MODE 1 -#endif - -/* - * RT_UFFS_ECC_MODE: - * 0, Do not use ECC - * 1, UFFS calculate the ECC - * 2, Flash driver(or by hardware) calculate the ECC - * 3, Hardware calculate the ECC and automatically write to spare. - */ -#if RT_UFFS_ECC_MODE == 0 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE -#elif RT_UFFS_ECC_MODE == 1 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT -#elif RT_UFFS_ECC_MODE == 2 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW -#elif RT_UFFS_ECC_MODE == 3 -#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO -#endif - -/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO */ -/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_SOFT */ -/* #define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_NONE */ - -/* enable this ,you need provide a mark_badblock/check_block funciton */ -/* #define RT_UFFS_USE_CHECK_MARK_FUNCITON */ - -#if RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT /* let uffs do soft ecc */ -#define RT_CONFIG_UFFS_LAYOUT UFFS_LAYOUT_UFFS /* UFFS_LAYOUT_FLASH */ - -#elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO /* nand driver make ecc and do ecc correct */ -#define RT_CONFIG_UFFS_LAYOUT UFFS_LAYOUT_FLASH - -#elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_NONE -#define RT_CONFIG_UFFS_LAYOUT UFFS_LAYOUT_UFFS /* UFFS_LAYOUT_FLASH */ - -#else -#error "uffs under rt-thread do not support this ECC mode" -#endif /* RT_CONFIG_UFFS_ECC_MODE */ - -#if (!CONFIG_USE_STATIC_MEMORY_ALLOCATOR) && (CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR) -#define RT_UFFS_MEMORY_ALLOCATOR 1 /* use system memory allocator */ -#elif (CONFIG_USE_STATIC_MEMORY_ALLOCATOR) && (!CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR) -#define RT_UFFS_MEMORY_ALLOCATOR 0 /* use static memory allocator */ -#else -#error "UFFS: CONFIG_USE_STATIC_MEMORY_ALLOCATOR ,CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR are invalid!" -#endif - -#if CONFIG_USE_STATIC_MEMORY_ALLOCATOR > 0 -#error "dfs_uffs only support CONFIG_USE_SYSTEM_MEMORY_ALLOCATOR" -#endif - -#if defined(CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME) -#error "dfs_uffs not support CONFIG_UFFS_AUTO_LAYOUT_USE_MTD_SCHEME" -#endif - -#if (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO) && (RT_CONFIG_UFFS_LAYOUT != UFFS_LAYOUT_FLASH) -#error "when use UFFS_ECC_HW_AUTO, you must use UFFS_LAYOUT_FLASH" - -#elif (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT) && (RT_CONFIG_UFFS_LAYOUT != UFFS_LAYOUT_UFFS) -#warning "when use UFFS_ECC_SOFT, it is recommended to use UFFS_LAYOUT_UFFS" -#endif - -extern const uffs_FlashOps nand_ops; - -extern void uffs_setup_storage( - struct uffs_StorageAttrSt *attr, - struct rt_mtd_nand_device *nand); - -extern int dfs_uffs_init(void); -#endif /* DFS_UFFS_H_ */ -- cgit v1.3.1 From 5dfe7a8f68940a9bfd51afcdbdb31b3fbf8f9c62 Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Fri, 12 Mar 2021 10:10:21 +0800 Subject: Delete dfs_jffs2.c --- components/dfs/filesystems/jffs2/dfs_jffs2.c | 687 --------------------------- 1 file changed, 687 deletions(-) delete mode 100644 components/dfs/filesystems/jffs2/dfs_jffs2.c diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.c b/components/dfs/filesystems/jffs2/dfs_jffs2.c deleted file mode 100644 index c9e032a413..0000000000 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.c +++ /dev/null @@ -1,687 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2012-1-7 prife the first version - */ - -#include -#include - -#include "cyg/infra/cyg_type.h" -#include "cyg/fileio/fileio.h" -#include "port/codes.h" -#include "port/fcntl.h" -#undef mode_t - -#include -#include - -#include "dfs_jffs2.h" -#include "jffs2_config.h" -#include "porting.h" -#include - -#if DEVICE_PART_MAX > 1 - #error "support only one jffs2 partition on a flash device!" -#endif - -/* make sure the following struct var had been initilased to 0! */ -struct device_part -{ - struct cyg_mtab_entry * mte; - struct rt_mtd_nor_device *dev; -}; -static struct device_part device_partition[DEVICE_PART_MAX] = {0}; -static struct rt_mutex jffs2_lock; - -#define jffs2_mount jffs2_fste.mount -#define jffs2_umount jffs2_fste.umount -#define jffs2_open jffs2_fste.open -#define jffs2_file_unlink jffs2_fste.unlink -#define jffs2_mkdir jffs2_fste.mkdir -#define jffs2_rmdir jffs2_fste.rmdir -#define jffs2_rename jffs2_fste.rename -#define jffs2_link jffs2_fste.link -#define jffs2_opendir jffs2_fste.opendir -#define jffs2_chdir jffs2_fste.chdir -#define jffs2_ops_stat jffs2_fste.stat -#define jffs2_getinfo jffs2_fste.getinfo -#define jffs2_setinfo jffs2_fste.setinfo - -#define jffs2_file_read jffs2_fileops.fo_read -#define jffs2_file_write jffs2_fileops.fo_write -#define jffs2_file_lseek jffs2_fileops.fo_lseek -#define jffs2_file_ioctl jffs2_fileops.fo_ioctl -#define jffs2_file_select jffs2_fileops.fo_select -#define jffs2_file_fsync jffs2_fileops.fo_fsync -#define jffs2_file_colse jffs2_fileops.fo_close -#define jffs2_file_fstat jffs2_fileops.fo_fstat -#define jffs2_file_getinfo jffs2_fileops.fo_getinfo -#define jffs2_file_setinfo jffs2_fileops.fo_setinfo - -#define jffs2_dir_read jffs2_dirops.fo_read -//#define jffs2_dir_write jffs2_dirops.fo_write -#define jffs2_dir_lseek jffs2_dirops.fo_lseek -//#define jffs2_dir_ioctl jffs2_dirops.fo_ioctl -#define jffs2_dir_select jffs2_dirops.fo_select -//#define jffs2_dir_fsync jffs2_dirops.fo_fsync -#define jffs2_dir_colse jffs2_dirops.fo_close -//#define jffs2_dir_fstat jffs2_dirops.fo_fstat -//#define jffs2_dir_getinfo jffs2_dirops.fo_getinfo -//#define jffs2_dir_setinfo jffs2_dirops.fo_setinfo - -/* - * RT-Thread Device Interface for jffs2 - */ - -/* these code is in src/flashio.c */ -static int jffs2_result_to_dfs(int result) -{ - if (result < 0) return result; - if (result > 0) return -result; - - return 0; -} - -/* - * RT-Thread DFS Interface for jffs2 - */ -static int dfs_jffs2_mount(struct dfs_filesystem* fs, - unsigned long rwflag, - const void* data) -{ - unsigned index; - struct cyg_mtab_entry * mte; - int result; - - /* find a empty entry in partition table */ - for (index = 0; index < DEVICE_PART_MAX; index ++) - { - if (device_partition[index].dev == RT_NULL) - break; - } - if (index == DEVICE_PART_MAX) - return -ENOSPC; - - mte = rt_malloc(sizeof(struct cyg_mtab_entry)); - if (mte == RT_NULL) - return -ENOMEM; - - mte->name = fs->path; - mte->fsname = "jffs2"; - mte->devname = NULL; - /* note that, i use mte->data to store rtt's device - * while, in jffs2_mount, mte->data will be copy into - * s_dev in struct super_block, and mte->data will be - * filled with jffs2_sb(see the source of jffs2_mount. - */ - mte->data = (CYG_ADDRWORD)fs->dev_id; - - device_partition[index].dev = RT_MTD_NOR_DEVICE(fs->dev_id); - /* after jffs2_mount, mte->data will not be dev_id any more */ - result = jffs2_mount(NULL, mte); - if (result != 0) - { - device_partition[index].dev = NULL; - return jffs2_result_to_dfs(result); - } - - /* save this pointer */ - device_partition[index].mte = mte; - return 0; -} - -static int _find_fs(struct cyg_mtab_entry ** mte, rt_device_t dev_id) -{ - unsigned index; - - /* find device index */ - for (index = 0; index < DEVICE_PART_MAX; index++) - { - if (device_partition[index].dev == RT_MTD_NOR_DEVICE(dev_id)) - { - *mte = device_partition[index].mte; - return 0; - } - } - - rt_kprintf("error, could not found the fs!"); - return -1; -} - -static int dfs_jffs2_unmount(struct dfs_filesystem* fs) -{ - int result; - unsigned index; - - /* find device index, then umount it */ - for (index = 0; index < DEVICE_PART_MAX; index++) - { - if (device_partition[index].dev == RT_MTD_NOR_DEVICE(fs->dev_id)) - { - result = jffs2_umount(device_partition[index].mte); - if (result) return jffs2_result_to_dfs(result); - - rt_free(device_partition[index].mte); - device_partition[index].dev = NULL; - device_partition[index].mte = NULL; - return RT_EOK; - } - } - - return -ENOENT; -} - -static int dfs_jffs2_mkfs(rt_device_t dev_id) -{ - /* just erase all blocks on this nand partition */ - return -ENOSYS; -} - -static int dfs_jffs2_statfs(struct dfs_filesystem* fs, - struct statfs *buf) -{ - /* since the limit of unsigned long, so the max size of flash device is 4G */ - struct cyg_mtab_entry * mte; - struct jffs2_fs_info info; - int result; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - RT_ASSERT(mte->data != 0); - - jffs2_get_info_from_sb((void *)mte->data, &info); - buf->f_bsize = info.sector_size; - buf->f_blocks = info.nr_blocks; - buf->f_bfree = info.free_size / info.sector_size; - - return 0; -} - -static const char jffs2_root_path[] = "."; - -static int dfs_jffs2_open(struct dfs_fd* file) -{ - int result; - int oflag, mode; - const char * name; - cyg_file * jffs2_file; - struct dfs_filesystem *fs; - struct cyg_mtab_entry * mte; - - oflag = file->flags; - fs = (struct dfs_filesystem *)file->data; - RT_ASSERT(fs != RT_NULL); - - jffs2_file = rt_malloc(sizeof(cyg_file)); - if (jffs2_file == RT_NULL) - return -ENOMEM; - - /* just escape '/' provided by dfs code */ - name = file->path; - if ((name[0] == '/') && (name[1] == 0)) - name = jffs2_root_path; - else /* name[0] still will be '/' */ - name ++; - - result = _find_fs(&mte, fs->dev_id); - if (result) - { - rt_free(jffs2_file); - return -ENOENT; - } - - /* set mount table */ - jffs2_file->f_mte = mte; - - if (oflag & O_DIRECTORY) /* operations about dir */ - { - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - if (oflag & O_CREAT) /* create a dir*/ - { - /* fixme, should test file->path can end with '/' */ - result = jffs2_mkdir(mte, mte->root, name); - if (result) - { - rt_mutex_release(&jffs2_lock); - rt_free(jffs2_file); - return jffs2_result_to_dfs(result); - } - } - - /* open dir */ - result = jffs2_opendir(mte, mte->root, name, jffs2_file); - rt_mutex_release(&jffs2_lock); - if (result) - { - rt_free(jffs2_file); - return jffs2_result_to_dfs(result); - } -#ifdef CONFIG_JFFS2_NO_RELATIVEDIR - jffs2_file->f_offset = 2; -#endif - /* save this pointer, it will be used by dfs_jffs2_getdents*/ - file->data = jffs2_file; - return 0; - } - /* regular file operations */ - mode = JFFS2_O_RDONLY; - if (oflag & O_WRONLY) mode |= JFFS2_O_WRONLY; - if (oflag & O_RDWR) mode |= JFFS2_O_RDWR; - /* Opens the file, if it is existing. If not, a new file is created. */ - if (oflag & O_CREAT) mode |= JFFS2_O_CREAT; - /* Creates a new file. If the file is existing, it is truncated and overwritten. */ - if (oflag & O_TRUNC) mode |= JFFS2_O_TRUNC; - /* Creates a new file. The function fails if the file is already existing. */ - if (oflag & O_EXCL) mode |= JFFS2_O_EXCL; - - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_open(mte, 0, name, mode, jffs2_file); - if (result != 0) - { - rt_mutex_release(&jffs2_lock); - rt_free(jffs2_file); - return jffs2_result_to_dfs(result); - } - - /* save this pointer, it will be used when calling read(), write(), - flush(), lessk(), and will be rt_free when calling close()*/ - file->data = jffs2_file; - file->pos = jffs2_file->f_offset; - file->size = 0; - jffs2_file_lseek(jffs2_file, (off_t *)(&(file->size)), SEEK_END); - jffs2_file->f_offset = (off_t)file->pos; - rt_mutex_release(&jffs2_lock); - - if (oflag & O_APPEND) - { - file->pos = file->size; - jffs2_file->f_offset = file->size; - } - - return 0; -} - -static int dfs_jffs2_close(struct dfs_fd* file) -{ - int result; - cyg_file * jffs2_file; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - - if (file->flags & O_DIRECTORY) /* operations about dir */ - { - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_dir_colse(jffs2_file); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - rt_free(jffs2_file); - return 0; - } - /* regular file operations */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_colse(jffs2_file); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - /* release memory */ - rt_free(jffs2_file); - return 0; -} - -static int dfs_jffs2_ioctl(struct dfs_fd* file, int cmd, void* args) -{ - return -ENOSYS; -} - -static int dfs_jffs2_read(struct dfs_fd* file, void* buf, size_t len) -{ - cyg_file * jffs2_file; - struct CYG_UIO_TAG uio_s; - struct CYG_IOVEC_TAG iovec; - int char_read; - int result; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - uio_s.uio_iov = &iovec; - uio_s.uio_iov->iov_base = buf; - uio_s.uio_iov->iov_len = len; - uio_s.uio_iovcnt = 1; //must be 1 - //uio_s.uio_offset //not used... - uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in jffs2; - - char_read = jffs2_file->f_offset; /* the current offset */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_read(jffs2_file, &uio_s); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - /* update position */ - file->pos = jffs2_file->f_offset; - char_read = jffs2_file->f_offset - char_read; - return char_read; -} - -static int dfs_jffs2_write(struct dfs_fd* file, - const void* buf, - size_t len) -{ - cyg_file * jffs2_file; - struct CYG_UIO_TAG uio_s; - struct CYG_IOVEC_TAG iovec; - int char_write; - int result; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - uio_s.uio_iov = &iovec; - uio_s.uio_iov->iov_base = (void *)buf; - uio_s.uio_iov->iov_len = len; - uio_s.uio_iovcnt = 1; //must be 1 - //uio_s.uio_offset //not used... - uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in jffs2; - - char_write = jffs2_file->f_offset; - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_write(jffs2_file, &uio_s); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - /* update position */ - file->pos = jffs2_file->f_offset; - char_write = jffs2_file->f_offset - char_write; - return char_write; -} - -static int dfs_jffs2_flush(struct dfs_fd* file) -{ - /* infact, jffs2 not support, jffs2_fo_sync just return ok */ - return -ENOSYS; -} - -/* fixme warning: the offset is rt_off_t, so maybe the size of a file is must <= 2G*/ -static int dfs_jffs2_lseek(struct dfs_fd* file, - rt_off_t offset) -{ - cyg_file * jffs2_file; - int result; - - RT_ASSERT(file->data != NULL); - jffs2_file = (cyg_file *)(file->data); - - /* set offset as current offset */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_file_lseek(jffs2_file, &offset, SEEK_SET); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - /* update file position */ - file->pos = offset; - return offset; -} - -/* return the size of struct dirent*/ -static int dfs_jffs2_getdents(struct dfs_fd* file, - struct dirent* dirp, - rt_uint32_t count) -{ - cyg_file * jffs2_file; - struct CYG_UIO_TAG uio_s; - struct CYG_IOVEC_TAG iovec; - struct jffs2_dirent jffs2_d; - struct dirent * d; - rt_uint32_t index; -#if !defined (CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE) - struct jffs2_stat s; - cyg_mtab_entry * mte; - char * fullname; -#endif - int result; - - RT_ASSERT(file->data != RT_NULL); - jffs2_file = (cyg_file*)(file->data); - mte = jffs2_file->f_mte; - - //set jffs2_d - memset(&jffs2_d, 0, sizeof(struct jffs2_dirent)); - //set CYG_UIO_TAG uio_s - uio_s.uio_iov = &iovec; - uio_s.uio_iov->iov_base = &jffs2_d; - uio_s.uio_iov->iov_len = sizeof(struct jffs2_dirent);; - uio_s.uio_iovcnt = 1; //must be 1 - uio_s.uio_offset = 0;//not used... - uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in jffs2; - - /* make integer count, usually count is 1 */ - count = (count / sizeof(struct dirent)) * sizeof(struct dirent); - if (count == 0) return -EINVAL; - - index = 0; - /* usually, the while loop should only be looped only once! */ - while (1) - { - d = dirp + index; - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_dir_read(jffs2_file, &uio_s); - rt_mutex_release(&jffs2_lock); - /* if met a error or all entry are read over, break while*/ - if (result || jffs2_d.d_name[0] == 0) - break; - -#if defined (CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE) - switch(jffs2_d.d_type & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: d->d_type = DT_REG; break; - case JFFS2_S_IFDIR: d->d_type = DT_DIR; break; - default: d->d_type = DT_UNKNOWN; break; - } -#else - fullname = rt_malloc(FILE_PATH_MAX); - if(fullname == RT_NULL) - return -ENOMEM; - - /* make a right entry */ - if ((file->path[0] == '/') ) - { - if (file->path[1] == 0) - strcpy(fullname, jffs2_d.d_name); - else - rt_sprintf(fullname, "%s/%s", file->path+1, jffs2_d.d_name); - } - else - rt_sprintf(fullname, "%s/%s", file->path, jffs2_d.d_name); - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_porting_stat(mte, mte->root, fullname, (void *)&s); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - - rt_free(fullname); - /* convert to dfs stat structure */ - switch(s.st_mode & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: d->d_type = DT_REG; break; - case JFFS2_S_IFDIR: d->d_type = DT_DIR; break; - default: d->d_type = DT_UNKNOWN; break; - } -#endif - /* write the rest fields of struct dirent* dirp */ - d->d_namlen = rt_strlen(jffs2_d.d_name); - d->d_reclen = (rt_uint16_t)sizeof(struct dirent); - rt_strncpy(d->d_name, jffs2_d.d_name, d->d_namlen + 1); - - index ++; - if (index * sizeof(struct dirent) >= count) - break; - } - if (result) - return jffs2_result_to_dfs(result); - return index * sizeof(struct dirent); -} - -static int dfs_jffs2_unlink(struct dfs_filesystem* fs, const char* path) -{ - int result; - struct jffs2_stat s; - cyg_mtab_entry * mte; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - /* deal path */ - if (path[0] == '/') - path++; - - /* judge file type, dir is to be delete by rmdir, others by unlink */ - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_porting_stat(mte, mte->root, path, (void *)&s); - if (result) - { - rt_mutex_release(&jffs2_lock); - return jffs2_result_to_dfs(result); - } - - switch(s.st_mode & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: - result = jffs2_file_unlink(mte, mte->root, path); - break; - case JFFS2_S_IFDIR: - result = jffs2_rmdir(mte, mte->root, path); - break; - default: - /* unknown file type */ - rt_mutex_release(&jffs2_lock); - return -1; - } - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - return 0; -} - -static int dfs_jffs2_rename(struct dfs_filesystem* fs, - const char* oldpath, - const char* newpath) -{ - int result; - cyg_mtab_entry * mte; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - if (*oldpath == '/') - oldpath += 1; - if (*newpath == '/') - newpath += 1; - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_rename(mte, mte->root, oldpath, mte->root, newpath); - rt_mutex_release(&jffs2_lock); - if (result) - return jffs2_result_to_dfs(result); - return 0; -} - -static int dfs_jffs2_stat(struct dfs_filesystem* fs, const char *path, struct stat *st) -{ - int result; - struct jffs2_stat s; - cyg_mtab_entry * mte; - - /* deal the path for jffs2 */ - RT_ASSERT(!((path[0] == '/') && (path[1] == 0))); - - if (path[0] == '/') - path++; - - result = _find_fs(&mte, fs->dev_id); - if (result) - return -ENOENT; - - rt_mutex_take(&jffs2_lock, RT_WAITING_FOREVER); - result = jffs2_porting_stat(mte, mte->root, path, (void *)&s); - rt_mutex_release(&jffs2_lock); - - if (result) - return jffs2_result_to_dfs(result); - /* convert to dfs stat structure */ - switch(s.st_mode & JFFS2_S_IFMT) - { - case JFFS2_S_IFREG: - st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | - S_IWUSR | S_IWGRP | S_IWOTH; - break; - - case JFFS2_S_IFDIR: - st->st_mode = S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH; - break; - - default: - st->st_mode = DT_UNKNOWN; //fixme - break; - } - - st->st_dev = 0; - st->st_size = s.st_size; - st->st_mtime = s.st_mtime; - - return 0; -} - -static const struct dfs_file_ops _jffs2_fops = -{ - dfs_jffs2_open, - dfs_jffs2_close, - dfs_jffs2_ioctl, - dfs_jffs2_read, - dfs_jffs2_write, - dfs_jffs2_flush, - dfs_jffs2_lseek, - dfs_jffs2_getdents, -}; - -static const struct dfs_filesystem_ops _jffs2_ops = -{ - "jffs2", - DFS_FS_FLAG_DEFAULT, - &_jffs2_fops, - - dfs_jffs2_mount, - dfs_jffs2_unmount, - dfs_jffs2_mkfs, - dfs_jffs2_statfs, - - dfs_jffs2_unlink, - dfs_jffs2_stat, - dfs_jffs2_rename, -}; - -int dfs_jffs2_init(void) -{ - /* register fatfs file system */ - dfs_register(&_jffs2_ops); - - /* initialize mutex */ - if (rt_mutex_init(&jffs2_lock, "jffs2lock", RT_IPC_FLAG_FIFO) != RT_EOK) - { - rt_kprintf("init jffs2 lock mutex failed\n"); - } - rt_kprintf("init jffs2 lock mutex okay\n"); - return 0; -} -INIT_COMPONENT_EXPORT(dfs_jffs2_init); -- cgit v1.3.1 From cd4cf46f3bd2cb8251da9657100663242b17ca32 Mon Sep 17 00:00:00 2001 From: Meco Jianting Man <920369182@qq.com> Date: Fri, 12 Mar 2021 10:10:31 +0800 Subject: Delete dfs_jffs2.h --- components/dfs/filesystems/jffs2/dfs_jffs2.h | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 components/dfs/filesystems/jffs2/dfs_jffs2.h diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.h b/components/dfs/filesystems/jffs2/dfs_jffs2.h deleted file mode 100644 index ccb8ad7993..0000000000 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef __DFS_JFFS2_H__ -#define __DFS_JFFS2_H__ - -int dfs_jffs2_init(void); - -#endif -- cgit v1.3.1 From ed97957e323eb894b8bbf2944215d598f6e5df76 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Fri, 12 Mar 2021 10:22:45 +0800 Subject: [x86][drivers] auto formatted --- bsp/x86/drivers/console.c | 20 +- bsp/x86/drivers/dma.h | 2 +- bsp/x86/drivers/floppy.c | 14 +- bsp/x86/drivers/include/bsp.h | 176 ++++++------- bsp/x86/drivers/include/grub.h | 8 +- bsp/x86/drivers/include/i386.h | 6 +- bsp/x86/drivers/keyboard.c | 576 ++++++++++++++++++++--------------------- bsp/x86/drivers/keyboard.h | 186 ++++++------- bsp/x86/drivers/keymap.h | 392 ++++++++++++++-------------- bsp/x86/drivers/serial.c | 24 +- bsp/x86/src/hello.c | 26 +- 11 files changed, 715 insertions(+), 715 deletions(-) diff --git a/bsp/x86/drivers/console.c b/bsp/x86/drivers/console.c index b783872bae..4fe1daeeed 100644 --- a/bsp/x86/drivers/console.c +++ b/bsp/x86/drivers/console.c @@ -87,7 +87,7 @@ static void rt_cga_putc(int c) break; case '\n': crt_pos += CRT_COLS; - /* cascade */ + /* cascade */ case '\r': crt_pos -= (crt_pos % CRT_COLS); break; @@ -99,7 +99,7 @@ static void rt_cga_putc(int c) rt_console_putc(' '); break; default: - crt_buf[crt_pos++] = c; /* write the character */ + crt_buf[crt_pos++] = c; /* write the character */ break; } @@ -289,14 +289,14 @@ int rt_hw_console_init(void) rt_hw_interrupt_install(INTUART0_RX, rt_console_isr, RT_NULL, "COM1"); rt_hw_interrupt_umask(INTUART0_RX); - console_device.type = RT_Device_Class_Char; + console_device.type = RT_Device_Class_Char; console_device.rx_indicate = RT_NULL; console_device.tx_complete = RT_NULL; - console_device.init = rt_console_init; - console_device.open = rt_console_open; - console_device.close = rt_console_close; - console_device.read = rt_console_read; - console_device.write = rt_console_write; + console_device.init = rt_console_init; + console_device.open = rt_console_open; + console_device.close = rt_console_close; + console_device.read = rt_console_read; + console_device.write = rt_console_write; console_device.control = rt_console_control; console_device.user_data = RT_NULL; @@ -316,8 +316,8 @@ INIT_DEVICE_EXPORT(rt_hw_console_init); * @param str the displayed string * * Modified: - * caoxl 2009-10-14 - * the name is change to rt_hw_console_output in the v0.3.0 + * caoxl 2009-10-14 + * the name is change to rt_hw_console_output in the v0.3.0 * */ void rt_hw_console_output(const char* str) diff --git a/bsp/x86/drivers/dma.h b/bsp/x86/drivers/dma.h index 3e5e9b08d1..9b87a309bb 100644 --- a/bsp/x86/drivers/dma.h +++ b/bsp/x86/drivers/dma.h @@ -101,7 +101,7 @@ static __inline__ void ClearDmaFF(unsigned int dmanr) OUTB(0, DMA2_CLEAR_FF_REG); } -/* +/* * 清空DMA 晶体计数器 */ static __inline__ void SetDmaMode(unsigned int dmanr, char mode) diff --git a/bsp/x86/drivers/floppy.c b/bsp/x86/drivers/floppy.c index f4675b9194..c144eb02eb 100644 --- a/bsp/x86/drivers/floppy.c +++ b/bsp/x86/drivers/floppy.c @@ -31,7 +31,7 @@ typedef rt_int32_t s32; static u8 floppy_buffer[512]; /* 软盘高速缓冲区地å�€æŒ‡é’ˆ */ -#define MAX_REPLIES 7 +#define MAX_REPLIES 7 static u8 floppy_reply_buffer[MAX_REPLIES]; /* 软驱回应缓冲区 */ #define ST0 (floppy_reply_buffer[0]) /* 软驱回应0å�·å­—节 */ #define ST1 (floppy_reply_buffer[1]) /* 软驱回应1å�·å­—节 */ @@ -114,7 +114,7 @@ u32 floppy_get_info(void) u8 CmType, FdType; floppy_sendbyte(0x10); - i = floppy_getbyte(); + i = floppy_getbyte(); switch (i) { @@ -180,7 +180,7 @@ void floppy_motorOff( void ) void floppy_setmode(void) -{ +{ floppy_sendbyte (FD_SPECIFY); floppy_sendbyte (0xcf); floppy_sendbyte (0x06); @@ -197,7 +197,7 @@ void block_to_hts(u32 block, u32 *head, u32 *track, u32 *sector ) void floppy_setupDMA(void) -{ +{ u32 eflags; _local_irq_save(eflags); DisableDma(2); @@ -235,7 +235,7 @@ void floppy_read_cmd(u32 blk) floppy_sendbyte (18); //floppy_sendbyte (sector+secs-1); /* Last sector in track:here are sectors count */ floppy_sendbyte (0x1B); - floppy_sendbyte (0xff); + floppy_sendbyte (0xff); return; } @@ -282,12 +282,12 @@ static rt_size_t rt_floppy_read(rt_device_t device, rt_off_t position, void *buf { panic("ST0 %d ST1 %d ST2 %d\n",ST0,ST1,ST2); } - + rt_memcpy(buffer, floppy_buffer, 512); floppy_motorOff(); io_delay(); - + position += 1; size -= 1; } diff --git a/bsp/x86/drivers/include/bsp.h b/bsp/x86/drivers/include/bsp.h index 93e409dbfa..fecb884ee8 100644 --- a/bsp/x86/drivers/include/bsp.h +++ b/bsp/x86/drivers/include/bsp.h @@ -15,127 +15,127 @@ #ifdef __cplusplus extern "C" { #endif - + /*******************************************************************/ /* Timer Register */ /*******************************************************************/ -#define TIMER_CNTR0 (IO_TIMER1 + 0) /* timer 0 counter port */ -#define TIMER_CNTR1 (IO_TIMER1 + 1) /* timer 1 counter port */ -#define TIMER_CNTR2 (IO_TIMER1 + 2) /* timer 2 counter port */ -#define TIMER_MODE (IO_TIMER1 + 3) /* timer mode port */ -#define TIMER_SEL0 0x00 /* select counter 0 */ -#define TIMER_SEL1 0x40 /* select counter 1 */ -#define TIMER_INTTC 0x00 /* mode 0, intr on terminal cnt */ -#define TIMER_ONESHOT 0x02 /* mode 1, one shot */ -#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */ -#define TIMER_SQWAVE 0x06 /* mode 3, square wave */ -#define TIMER_SWSTROBE 0x08 /* mode 4, s/w triggered strobe */ -#define TIMER_HWSTROBE 0x0a /* mode 5, h/w triggered strobe */ -#define TIMER_LATCH 0x00 /* latch counter for reading */ -#define TIMER_LSB 0x10 /* r/w counter LSB */ -#define TIMER_MSB 0x20 /* r/w counter MSB */ -#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */ -#define TIMER_BCD 0x01 /* count in BCD */ - -#define TIMER_FREQ 1193182 -#define TIMER_DIV(x) ((TIMER_FREQ+(x)/2)/(x)) - -#define IO_TIMER1 0x040 /* 8253 Timer #1 */ +#define TIMER_CNTR0 (IO_TIMER1 + 0) /* timer 0 counter port */ +#define TIMER_CNTR1 (IO_TIMER1 + 1) /* timer 1 counter port */ +#define TIMER_CNTR2 (IO_TIMER1 + 2) /* timer 2 counter port */ +#define TIMER_MODE (IO_TIMER1 + 3) /* timer mode port */ +#define TIMER_SEL0 0x00 /* select counter 0 */ +#define TIMER_SEL1 0x40 /* select counter 1 */ +#define TIMER_INTTC 0x00 /* mode 0, intr on terminal cnt */ +#define TIMER_ONESHOT 0x02 /* mode 1, one shot */ +#define TIMER_RATEGEN 0x04 /* mode 2, rate generator */ +#define TIMER_SQWAVE 0x06 /* mode 3, square wave */ +#define TIMER_SWSTROBE 0x08 /* mode 4, s/w triggered strobe */ +#define TIMER_HWSTROBE 0x0a /* mode 5, h/w triggered strobe */ +#define TIMER_LATCH 0x00 /* latch counter for reading */ +#define TIMER_LSB 0x10 /* r/w counter LSB */ +#define TIMER_MSB 0x20 /* r/w counter MSB */ +#define TIMER_16BIT 0x30 /* r/w counter 16 bits, LSB first */ +#define TIMER_BCD 0x01 /* count in BCD */ + +#define TIMER_FREQ 1193182 +#define TIMER_DIV(x) ((TIMER_FREQ+(x)/2)/(x)) + +#define IO_TIMER1 0x040 /* 8253 Timer #1 */ /*******************************************************************/ /* Interrupt Controller */ /*******************************************************************/ /* these are processor defined */ -#define T_DIVIDE 0 /* divide error */ -#define T_DEBUG 1 /* debug exception */ -#define T_NMI 2 /* non-maskable interrupt */ -#define T_BRKPT 3 /* breakpoint */ -#define T_OFLOW 4 /* overflow */ -#define T_BOUND 5 /* bounds check */ -#define T_ILLOP 6 /* illegal opcode */ -#define T_DEVICE 7 /* device not available */ -#define T_DBLFLT 8 /* double fault */ +#define T_DIVIDE 0 /* divide error */ +#define T_DEBUG 1 /* debug exception */ +#define T_NMI 2 /* non-maskable interrupt */ +#define T_BRKPT 3 /* breakpoint */ +#define T_OFLOW 4 /* overflow */ +#define T_BOUND 5 /* bounds check */ +#define T_ILLOP 6 /* illegal opcode */ +#define T_DEVICE 7 /* device not available */ +#define T_DBLFLT 8 /* double fault */ /* 9 is reserved */ -#define T_TSS 10 /* invalid task switch segment */ -#define T_SEGNP 11 /* segment not present */ -#define T_STACK 12 /* stack exception */ -#define T_GPFLT 13 /* genernal protection fault */ -#define T_PGFLT 14 /* page fault */ +#define T_TSS 10 /* invalid task switch segment */ +#define T_SEGNP 11 /* segment not present */ +#define T_STACK 12 /* stack exception */ +#define T_GPFLT 13 /* genernal protection fault */ +#define T_PGFLT 14 /* page fault */ /* 15 is reserved */ -#define T_FPERR 16 /* floating point error */ -#define T_ALIGN 17 /* aligment check */ -#define T_MCHK 18 /* machine check */ -#define T_DEFAULT 500 /* catchall */ - -#define INTTIMER0 0 -#define INTKEYBOARD 1 -#define INTUART0_RX 4 -#define CLOCK_IRQ 0 -#define KEYBOARD_IRQ 1 -#define CASCADE_IRQ 2 /* cascade enable for 2nd AT controller */ -#define ETHER_IRQ 3 /* default ethernet interrupt vector */ -#define SECONDARY_IRQ 3 /* RS232 interrupt vector for port 2 */ -#define RS232_IRQ 4 /* RS232 interrupt vector for port 1 */ -#define XT_WINI_IRQ 5 /* xt winchester */ -#define FLOPPY_IRQ 6 /* floppy disk */ -#define PRINTER_IRQ 7 -#define AT_WINI_IRQ 14 /* at winchester */ +#define T_FPERR 16 /* floating point error */ +#define T_ALIGN 17 /* aligment check */ +#define T_MCHK 18 /* machine check */ +#define T_DEFAULT 500 /* catchall */ + +#define INTTIMER0 0 +#define INTKEYBOARD 1 +#define INTUART0_RX 4 +#define CLOCK_IRQ 0 +#define KEYBOARD_IRQ 1 +#define CASCADE_IRQ 2 /* cascade enable for 2nd AT controller */ +#define ETHER_IRQ 3 /* default ethernet interrupt vector */ +#define SECONDARY_IRQ 3 /* RS232 interrupt vector for port 2 */ +#define RS232_IRQ 4 /* RS232 interrupt vector for port 1 */ +#define XT_WINI_IRQ 5 /* xt winchester */ +#define FLOPPY_IRQ 6 /* floppy disk */ +#define PRINTER_IRQ 7 +#define AT_WINI_IRQ 14 /* at winchester */ /* I/O Addresses of the two 8259A programmable interrupt controllers */ -#define IO_PIC1 0x20 /* Master(IRQs 0-7) */ -#define IO_PIC2 0xa0 /* Slave(IRQs 8-15) */ -#define IRQ_SLAVE 0x2 /* IRQ at which slave connects to master */ -#define IRQ_OFFSET 0x20 /* IRQ 0 corresponds to int IRQ_OFFSET */ +#define IO_PIC1 0x20 /* Master(IRQs 0-7) */ +#define IO_PIC2 0xa0 /* Slave(IRQs 8-15) */ +#define IRQ_SLAVE 0x2 /* IRQ at which slave connects to master */ +#define IRQ_OFFSET 0x20 /* IRQ 0 corresponds to int IRQ_OFFSET */ -#define MAX_HANDLERS 16 /*max number of isr handler*/ +#define MAX_HANDLERS 16 /*max number of isr handler*/ /*******************************************************************/ /* CRT Register */ /*******************************************************************/ -#define MONO_BASE 0x3b4 -#define MONO_BUF 0xb0000 -#define CGA_BASE 0x3d4 -#define CGA_BUF 0xb8000 +#define MONO_BASE 0x3b4 +#define MONO_BUF 0xb0000 +#define CGA_BASE 0x3d4 +#define CGA_BUF 0xb8000 -#define CRT_ROWS 25 -#define CRT_COLS 80 -#define CRT_SIZE (CRT_ROWS * CRT_COLS) +#define CRT_ROWS 25 +#define CRT_COLS 80 +#define CRT_SIZE (CRT_ROWS * CRT_COLS) /*******************************************************************/ /* Keyboard Register */ /*******************************************************************/ -#define KBSTATP 0x64 /* kbd controller status port(I) */ -#define KBS_DIB 0x01 /* kbd data in buffer */ -#define KBDATAP 0x60 /* kbd data port(I) */ +#define KBSTATP 0x64 /* kbd controller status port(I) */ +#define KBS_DIB 0x01 /* kbd data in buffer */ +#define KBDATAP 0x60 /* kbd data port(I) */ /* AT keyboard */ /* 8042 ports */ -#define KB_DATA 0x60 /* I/O port for keyboard data - * Read : Read Output Buffer +#define KB_DATA 0x60 /* I/O port for keyboard data + * Read : Read Output Buffer * Write: Write Input Buffer(8042 Data&8048 Command) */ -#define KB_CMD 0x64 /* I/O port for keyboard command +#define KB_CMD 0x64 /* I/O port for keyboard command * Read : Read Status Register * Write: Write Input Buffer(8042 Command) */ -#define LED_CODE 0xED -#define KB_ACK 0xFA +#define LED_CODE 0xED +#define KB_ACK 0xFA /*******************************************************************/ /* Serial Register */ /*******************************************************************/ /*Serial I/O code */ -#define COM1 0x3F8 -#define COMSTATUS 5 -#define COMDATA 0x01 -#define COMREAD 0 -#define COMWRITE 0 +#define COM1 0x3F8 +#define COMSTATUS 5 +#define COMDATA 0x01 +#define COMREAD 0 +#define COMWRITE 0 /* Bits definition of the Line Status Register (LSR)*/ -#define DR 0x01 /* Data Ready */ -#define OE 0x02 /* Overrun Error */ -#define PE 0x04 /* Parity Error */ -#define FE 0x08 /* Framing Error */ -#define BI 0x10 /* Break Interrupt */ -#define THRE 0x20 /* Transmitter Holding Register Empty */ -#define TEMT 0x40 /* Transmitter Empty */ -#define ERFIFO 0x80 /* Error receive Fifo */ +#define DR 0x01 /* Data Ready */ +#define OE 0x02 /* Overrun Error */ +#define PE 0x04 /* Parity Error */ +#define FE 0x08 /* Framing Error */ +#define BI 0x10 /* Break Interrupt */ +#define THRE 0x20 /* Transmitter Holding Register Empty */ +#define TEMT 0x40 /* Transmitter Empty */ +#define ERFIFO 0x80 /* Error receive Fifo */ #ifdef __cplusplus } diff --git a/bsp/x86/drivers/include/grub.h b/bsp/x86/drivers/include/grub.h index d5a84a48da..96d4533c3f 100644 --- a/bsp/x86/drivers/include/grub.h +++ b/bsp/x86/drivers/include/grub.h @@ -5,7 +5,7 @@ * * Change Logs: * Date Author Notes - * 2006-10-09 Bernard the grub related definitions + * 2006-10-09 Bernard the grub related definitions * (multiboot) */ @@ -13,13 +13,13 @@ #define __GRUB_H__ /* the magic number for the multiboot header. */ -#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 +#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 /* the flags for the multiboot header. */ -#define MULTIBOOT_HEADER_FLAGS 0x00000003 +#define MULTIBOOT_HEADER_FLAGS 0x00000003 /* the magic number passed by a multiboot-compliant boot loader. */ -#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 +#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 #ifndef __ASM__ /* the multiboot header. */ diff --git a/bsp/x86/drivers/include/i386.h b/bsp/x86/drivers/include/i386.h index bde4a95c3b..7d002393e7 100644 --- a/bsp/x86/drivers/include/i386.h +++ b/bsp/x86/drivers/include/i386.h @@ -44,9 +44,9 @@ static __inline unsigned int inl(int port) static __inline void insl(int port, void *addr, int cnt) { - __asm __volatile("cld\n\trepne\n\tinsl" : - "=D" (addr), "=c" (cnt) : - "d" (port), "0" (addr), "1" (cnt) : + __asm __volatile("cld\n\trepne\n\tinsl" : + "=D" (addr), "=c" (cnt) : + "d" (port), "0" (addr), "1" (cnt) : "memory", "cc"); } diff --git a/bsp/x86/drivers/keyboard.c b/bsp/x86/drivers/keyboard.c index b4ae626261..4890db380b 100644 --- a/bsp/x86/drivers/keyboard.c +++ b/bsp/x86/drivers/keyboard.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,290 +19,290 @@ #define FALSE RT_FALSE #define TRUE RT_TRUE #define PRIVATE static -#define PUBLIC +#define PUBLIC #define t_bool rt_bool_t #define t_8 rt_uint8_t #define t_32 rt_uint32_t -PRIVATE KB_INPUT kb_in; -PRIVATE t_bool code_with_E0 = FALSE; -PRIVATE t_bool shift_l; /* l shift state */ -PRIVATE t_bool shift_r; /* r shift state */ -PRIVATE t_bool alt_l; /* l alt state */ -PRIVATE t_bool alt_r; /* r left state */ -PRIVATE t_bool ctrl_l; /* l ctrl state */ -PRIVATE t_bool ctrl_r; /* l ctrl state */ -PRIVATE t_bool caps_lock; /* Caps Lock */ -PRIVATE t_bool num_lock; /* Num Lock */ -PRIVATE t_bool scroll_lock; /* Scroll Lock */ -PRIVATE int column = 0; /* keyrow[column] is one value of keymap */ - -PRIVATE t_8 get_byte_from_kb_buf(); -PRIVATE void set_leds(); -PRIVATE void kb_wait(); -PRIVATE void kb_ack(); +PRIVATE KB_INPUT kb_in; +PRIVATE t_bool code_with_E0 = FALSE; +PRIVATE t_bool shift_l; /* l shift state */ +PRIVATE t_bool shift_r; /* r shift state */ +PRIVATE t_bool alt_l; /* l alt state */ +PRIVATE t_bool alt_r; /* r left state */ +PRIVATE t_bool ctrl_l; /* l ctrl state */ +PRIVATE t_bool ctrl_r; /* l ctrl state */ +PRIVATE t_bool caps_lock; /* Caps Lock */ +PRIVATE t_bool num_lock; /* Num Lock */ +PRIVATE t_bool scroll_lock; /* Scroll Lock */ +PRIVATE int column = 0; /* keyrow[column] is one value of keymap */ + +PRIVATE t_8 get_byte_from_kb_buf(); +PRIVATE void set_leds(); +PRIVATE void kb_wait(); +PRIVATE void kb_ack(); PUBLIC void init_keyboard() { - kb_in.count = 0; - kb_in.p_head = kb_in.p_tail = kb_in.buf; + kb_in.count = 0; + kb_in.p_head = kb_in.p_tail = kb_in.buf; - caps_lock = 0; - num_lock = 1; - scroll_lock = 0; + caps_lock = 0; + num_lock = 1; + scroll_lock = 0; - set_leds(); + set_leds(); } PUBLIC rt_bool_t keyboard_read(rt_uint32_t *pkey) { - t_8 scan_code; - t_bool make; /* TRUE : make */ - /* FALSE: break */ - t_32 key = 0; - t_32* keyrow; - - if(kb_in.count > 0){ - code_with_E0 = FALSE; - scan_code = get_byte_from_kb_buf(); - - /* start scan */ - if (scan_code == 0xE1) { - int i; - static const t_8 pausebreak_scan_code[] = {0xE1, 0x1D, 0x45, 0xE1, 0x9D, 0xC5}; - t_bool is_pausebreak = TRUE; - for(i=1;i<6;i++){ - if (get_byte_from_kb_buf() != pausebreak_scan_code[i]) { - is_pausebreak = FALSE; - break; - } - } - if (is_pausebreak) { - key = PAUSEBREAK; - } - } - else if (scan_code == 0xE0) { - code_with_E0 = TRUE; - scan_code = get_byte_from_kb_buf(); - - /* PrintScreen pressed */ - if (scan_code == 0x2A) { - code_with_E0 = FALSE; - if ((scan_code = get_byte_from_kb_buf()) == 0xE0) { - code_with_E0 = TRUE; - if ((scan_code = get_byte_from_kb_buf()) == 0x37) { - key = PRINTSCREEN; - make = TRUE; - } - } - } - /* PrintScreen released */ - else if (scan_code == 0xB7) { - code_with_E0 = FALSE; - if ((scan_code = get_byte_from_kb_buf()) == 0xE0) { - code_with_E0 = TRUE; - if ((scan_code = get_byte_from_kb_buf()) == 0xAA) { - key = PRINTSCREEN; - make = FALSE; - } - } - } - } /* if is not PrintScreen, scan_code is the one after 0xE0 */ - if ((key != PAUSEBREAK) && (key != PRINTSCREEN)) { - /* is Make Code or Break Code */ - make = (scan_code & FLAG_BREAK ? FALSE : TRUE); - - keyrow = &keymap[(scan_code & 0x7F) * MAP_COLS]; - - column = 0; - - t_bool caps = shift_l || shift_r; - if (caps_lock) { - if ((keyrow[0] >= 'a') && (keyrow[0] <= 'z')){ - caps = !caps; - } - } - if (caps) { - column = 1; - } - - if (code_with_E0) { - column = 2; - } - - key = keyrow[column]; - - switch(key) { - case SHIFT_L: - shift_l = make; - break; - case SHIFT_R: - shift_r = make; - break; - case CTRL_L: - ctrl_l = make; - break; - case CTRL_R: - ctrl_r = make; - break; - case ALT_L: - alt_l = make; - break; - case ALT_R: - alt_l = make; - break; - case CAPS_LOCK: - if (make) { - caps_lock = !caps_lock; - set_leds(); - } - break; - case NUM_LOCK: - if (make) { - num_lock = !num_lock; - set_leds(); - } - break; - case SCROLL_LOCK: - if (make) { - scroll_lock = !scroll_lock; - set_leds(); - } - break; - default: - break; - } - } - - if(make){ /* ignore Break Code */ - t_bool pad = FALSE; - - /* handle the small pad first */ - if ((key >= PAD_SLASH) && (key <= PAD_9)) { - pad = TRUE; - switch(key) { /* '/', '*', '-', '+', and 'Enter' in num pad */ - case PAD_SLASH: - key = '/'; - break; - case PAD_STAR: - key = '*'; - break; - case PAD_MINUS: - key = '-'; - break; - case PAD_PLUS: - key = '+'; - break; - case PAD_ENTER: - key = ENTER; - break; - default: /* keys whose value depends on the NumLock */ - if (num_lock) { /* '0' ~ '9' and '.' in num pad */ - if ((key >= PAD_0) && (key <= PAD_9)) { - key = key - PAD_0 + '0'; - } - else if (key == PAD_DOT) { - key = '.'; - } - } - else{ - switch(key) { - case PAD_HOME: - key = HOME; - break; - case PAD_END: - key = END; - break; - case PAD_PAGEUP: - key = PAGEUP; - break; - case PAD_PAGEDOWN: - key = PAGEDOWN; - break; - case PAD_INS: - key = INSERT; - break; - case PAD_UP: - key = UP; - break; - case PAD_DOWN: - key = DOWN; - break; - case PAD_LEFT: - key = LEFT; - break; - case PAD_RIGHT: - key = RIGHT; - break; - case PAD_DOT: - key = DELETE; - break; - default: - break; - } - } - break; - } - } - key |= shift_l ? FLAG_SHIFT_L : 0; - key |= shift_r ? FLAG_SHIFT_R : 0; - key |= ctrl_l ? FLAG_CTRL_L : 0; - key |= ctrl_r ? FLAG_CTRL_R : 0; - key |= alt_l ? FLAG_ALT_L : 0; - key |= alt_r ? FLAG_ALT_R : 0; - key |= pad ? FLAG_PAD : 0; - - *pkey = key; - return TRUE; - } - } - - return FALSE; + t_8 scan_code; + t_bool make; /* TRUE : make */ + /* FALSE: break */ + t_32 key = 0; + t_32* keyrow; + + if(kb_in.count > 0){ + code_with_E0 = FALSE; + scan_code = get_byte_from_kb_buf(); + + /* start scan */ + if (scan_code == 0xE1) { + int i; + static const t_8 pausebreak_scan_code[] = {0xE1, 0x1D, 0x45, 0xE1, 0x9D, 0xC5}; + t_bool is_pausebreak = TRUE; + for(i=1;i<6;i++){ + if (get_byte_from_kb_buf() != pausebreak_scan_code[i]) { + is_pausebreak = FALSE; + break; + } + } + if (is_pausebreak) { + key = PAUSEBREAK; + } + } + else if (scan_code == 0xE0) { + code_with_E0 = TRUE; + scan_code = get_byte_from_kb_buf(); + + /* PrintScreen pressed */ + if (scan_code == 0x2A) { + code_with_E0 = FALSE; + if ((scan_code = get_byte_from_kb_buf()) == 0xE0) { + code_with_E0 = TRUE; + if ((scan_code = get_byte_from_kb_buf()) == 0x37) { + key = PRINTSCREEN; + make = TRUE; + } + } + } + /* PrintScreen released */ + else if (scan_code == 0xB7) { + code_with_E0 = FALSE; + if ((scan_code = get_byte_from_kb_buf()) == 0xE0) { + code_with_E0 = TRUE; + if ((scan_code = get_byte_from_kb_buf()) == 0xAA) { + key = PRINTSCREEN; + make = FALSE; + } + } + } + } /* if is not PrintScreen, scan_code is the one after 0xE0 */ + if ((key != PAUSEBREAK) && (key != PRINTSCREEN)) { + /* is Make Code or Break Code */ + make = (scan_code & FLAG_BREAK ? FALSE : TRUE); + + keyrow = &keymap[(scan_code & 0x7F) * MAP_COLS]; + + column = 0; + + t_bool caps = shift_l || shift_r; + if (caps_lock) { + if ((keyrow[0] >= 'a') && (keyrow[0] <= 'z')){ + caps = !caps; + } + } + if (caps) { + column = 1; + } + + if (code_with_E0) { + column = 2; + } + + key = keyrow[column]; + + switch(key) { + case SHIFT_L: + shift_l = make; + break; + case SHIFT_R: + shift_r = make; + break; + case CTRL_L: + ctrl_l = make; + break; + case CTRL_R: + ctrl_r = make; + break; + case ALT_L: + alt_l = make; + break; + case ALT_R: + alt_l = make; + break; + case CAPS_LOCK: + if (make) { + caps_lock = !caps_lock; + set_leds(); + } + break; + case NUM_LOCK: + if (make) { + num_lock = !num_lock; + set_leds(); + } + break; + case SCROLL_LOCK: + if (make) { + scroll_lock = !scroll_lock; + set_leds(); + } + break; + default: + break; + } + } + + if(make){ /* ignore Break Code */ + t_bool pad = FALSE; + + /* handle the small pad first */ + if ((key >= PAD_SLASH) && (key <= PAD_9)) { + pad = TRUE; + switch(key) { /* '/', '*', '-', '+', and 'Enter' in num pad */ + case PAD_SLASH: + key = '/'; + break; + case PAD_STAR: + key = '*'; + break; + case PAD_MINUS: + key = '-'; + break; + case PAD_PLUS: + key = '+'; + break; + case PAD_ENTER: + key = ENTER; + break; + default: /* keys whose value depends on the NumLock */ + if (num_lock) { /* '0' ~ '9' and '.' in num pad */ + if ((key >= PAD_0) && (key <= PAD_9)) { + key = key - PAD_0 + '0'; + } + else if (key == PAD_DOT) { + key = '.'; + } + } + else{ + switch(key) { + case PAD_HOME: + key = HOME; + break; + case PAD_END: + key = END; + break; + case PAD_PAGEUP: + key = PAGEUP; + break; + case PAD_PAGEDOWN: + key = PAGEDOWN; + break; + case PAD_INS: + key = INSERT; + break; + case PAD_UP: + key = UP; + break; + case PAD_DOWN: + key = DOWN; + break; + case PAD_LEFT: + key = LEFT; + break; + case PAD_RIGHT: + key = RIGHT; + break; + case PAD_DOT: + key = DELETE; + break; + default: + break; + } + } + break; + } + } + key |= shift_l ? FLAG_SHIFT_L : 0; + key |= shift_r ? FLAG_SHIFT_R : 0; + key |= ctrl_l ? FLAG_CTRL_L : 0; + key |= ctrl_r ? FLAG_CTRL_R : 0; + key |= alt_l ? FLAG_ALT_L : 0; + key |= alt_r ? FLAG_ALT_R : 0; + key |= pad ? FLAG_PAD : 0; + + *pkey = key; + return TRUE; + } + } + + return FALSE; } PRIVATE t_8 get_byte_from_kb_buf() { - t_8 scan_code; + t_8 scan_code; - RT_ASSERT(kb_in.count>0); - scan_code = *(kb_in.p_tail); - kb_in.p_tail++; - if (kb_in.p_tail == kb_in.buf + KB_IN_BYTES) { - kb_in.p_tail = kb_in.buf; - } - kb_in.count--; + RT_ASSERT(kb_in.count>0); + scan_code = *(kb_in.p_tail); + kb_in.p_tail++; + if (kb_in.p_tail == kb_in.buf + KB_IN_BYTES) { + kb_in.p_tail = kb_in.buf; + } + kb_in.count--; - return scan_code; + return scan_code; } PRIVATE void kb_wait() /* wait inpit cache of 8042 */ { - t_8 kb_stat; + t_8 kb_stat; - do { - kb_stat = inb(KB_CMD); - } while (kb_stat & 0x02); + do { + kb_stat = inb(KB_CMD); + } while (kb_stat & 0x02); } PRIVATE void kb_ack() { - t_8 kb_read; + t_8 kb_read; - do { - kb_read = inb(KB_DATA); - } while (kb_read != KB_ACK); + do { + kb_read = inb(KB_DATA); + } while (kb_read != KB_ACK); } PRIVATE void set_leds() { - t_8 leds = (caps_lock << 2) | (num_lock << 1) | scroll_lock; + t_8 leds = (caps_lock << 2) | (num_lock << 1) | scroll_lock; - kb_wait(); - outb(KB_DATA, LED_CODE); - kb_ack(); + kb_wait(); + outb(KB_DATA, LED_CODE); + kb_ack(); - kb_wait(); - outb(KB_DATA, leds); - kb_ack(); + kb_wait(); + outb(KB_DATA, leds); + kb_ack(); } /** @@ -312,51 +312,51 @@ PRIVATE void set_leds() void rt_keyboard_isr(void) { - rt_uint8_t data; + rt_uint8_t data; - if ((inb(KBSTATP) & KBS_DIB) == 0) - return ; + if ((inb(KBSTATP) & KBS_DIB) == 0) + return ; - data = inb(KBDATAP); + data = inb(KBDATAP); - if (kb_in.count < KB_IN_BYTES) { - *(kb_in.p_head) = data; - kb_in.p_head++; - if (kb_in.p_head == kb_in.buf + KB_IN_BYTES) { - kb_in.p_head = kb_in.buf; - } - kb_in.count++; - } + if (kb_in.count < KB_IN_BYTES) { + *(kb_in.p_head) = data; + kb_in.p_head++; + if (kb_in.p_head == kb_in.buf + KB_IN_BYTES) { + kb_in.p_head = kb_in.buf; + } + kb_in.count++; + } } /* generally, this should be called in task level for all key inpit support, but here only support a key that is composed of 2 bytes */ rt_bool_t rt_keyboard_getc(char* c) { - if(kb_in.count>=2) - { - rt_uint32_t key = 0; - rt_bool_t rv=keyboard_read(&key); - - switch(key) - { - case TAB: - *c = '\t'; - break; - case ENTER: - *c = '\n'; - break; - case BACKSPACE: - *c = '\b'; - break; - default: - *c = key; - break; - } - - return rv; - } - - return RT_FALSE; + if(kb_in.count>=2) + { + rt_uint32_t key = 0; + rt_bool_t rv=keyboard_read(&key); + + switch(key) + { + case TAB: + *c = '\t'; + break; + case ENTER: + *c = '\n'; + break; + case BACKSPACE: + *c = '\b'; + break; + default: + *c = key; + break; + } + + return rv; + } + + return RT_FALSE; } /*@}*/ diff --git a/bsp/x86/drivers/keyboard.h b/bsp/x86/drivers/keyboard.h index 437d9dfc9f..3fec24c4e8 100644 --- a/bsp/x86/drivers/keyboard.h +++ b/bsp/x86/drivers/keyboard.h @@ -12,115 +12,115 @@ Forrest Yu, 2005 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -#ifndef _TINIX_KEYBOARD_H_ -#define _TINIX_KEYBOARD_H_ +#ifndef _TINIX_KEYBOARD_H_ +#define _TINIX_KEYBOARD_H_ /************************************************************************/ /* Macros Declaration */ /************************************************************************/ -#define KB_IN_BYTES 32 /* size of keyboard input buffer */ -#define MAP_COLS 3 /* Number of columns in keymap */ -#define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */ - -#define FLAG_BREAK 0x0080 /* Break Code */ -#define FLAG_EXT 0x0100 /* Normal function keys */ -#define FLAG_SHIFT_L 0x0200 /* Shift key */ -#define FLAG_SHIFT_R 0x0400 /* Shift key */ -#define FLAG_CTRL_L 0x0800 /* Control key */ -#define FLAG_CTRL_R 0x1000 /* Control key */ -#define FLAG_ALT_L 0x2000 /* Alternate key */ -#define FLAG_ALT_R 0x4000 /* Alternate key */ -#define FLAG_PAD 0x8000 /* keys in num pad */ - -#define MASK_RAW 0x01FF /* raw key value = code passed to tty & MASK_RAW - the value can be found either in the keymap column 0 - or in the list below */ +#define KB_IN_BYTES 32 /* size of keyboard input buffer */ +#define MAP_COLS 3 /* Number of columns in keymap */ +#define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */ + +#define FLAG_BREAK 0x0080 /* Break Code */ +#define FLAG_EXT 0x0100 /* Normal function keys */ +#define FLAG_SHIFT_L 0x0200 /* Shift key */ +#define FLAG_SHIFT_R 0x0400 /* Shift key */ +#define FLAG_CTRL_L 0x0800 /* Control key */ +#define FLAG_CTRL_R 0x1000 /* Control key */ +#define FLAG_ALT_L 0x2000 /* Alternate key */ +#define FLAG_ALT_R 0x4000 /* Alternate key */ +#define FLAG_PAD 0x8000 /* keys in num pad */ + +#define MASK_RAW 0x01FF /* raw key value = code passed to tty & MASK_RAW + the value can be found either in the keymap column 0 + or in the list below */ /* Special keys */ -#define ESC (0x01 + FLAG_EXT) /* Esc */ -#define TAB (0x02 + FLAG_EXT) /* Tab */ -#define ENTER (0x03 + FLAG_EXT) /* Enter */ -#define BACKSPACE (0x04 + FLAG_EXT) /* BackSpace */ +#define ESC (0x01 + FLAG_EXT) /* Esc */ +#define TAB (0x02 + FLAG_EXT) /* Tab */ +#define ENTER (0x03 + FLAG_EXT) /* Enter */ +#define BACKSPACE (0x04 + FLAG_EXT) /* BackSpace */ -#define GUI_L (0x05 + FLAG_EXT) /* L GUI */ -#define GUI_R (0x06 + FLAG_EXT) /* R GUI */ -#define APPS (0x07 + FLAG_EXT) /* APPS */ +#define GUI_L (0x05 + FLAG_EXT) /* L GUI */ +#define GUI_R (0x06 + FLAG_EXT) /* R GUI */ +#define APPS (0x07 + FLAG_EXT) /* APPS */ /* Shift, Ctrl, Alt */ -#define SHIFT_L (0x08 + FLAG_EXT) /* L Shift */ -#define SHIFT_R (0x09 + FLAG_EXT) /* R Shift */ -#define CTRL_L (0x0A + FLAG_EXT) /* L Ctrl */ -#define CTRL_R (0x0B + FLAG_EXT) /* R Ctrl */ -#define ALT_L (0x0C + FLAG_EXT) /* L Alt */ -#define ALT_R (0x0D + FLAG_EXT) /* R Alt */ +#define SHIFT_L (0x08 + FLAG_EXT) /* L Shift */ +#define SHIFT_R (0x09 + FLAG_EXT) /* R Shift */ +#define CTRL_L (0x0A + FLAG_EXT) /* L Ctrl */ +#define CTRL_R (0x0B + FLAG_EXT) /* R Ctrl */ +#define ALT_L (0x0C + FLAG_EXT) /* L Alt */ +#define ALT_R (0x0D + FLAG_EXT) /* R Alt */ /* Lock keys */ -#define CAPS_LOCK (0x0E + FLAG_EXT) /* Caps Lock */ -#define NUM_LOCK (0x0F + FLAG_EXT) /* Number Lock */ -#define SCROLL_LOCK (0x10 + FLAG_EXT) /* Scroll Lock */ +#define CAPS_LOCK (0x0E + FLAG_EXT) /* Caps Lock */ +#define NUM_LOCK (0x0F + FLAG_EXT) /* Number Lock */ +#define SCROLL_LOCK (0x10 + FLAG_EXT) /* Scroll Lock */ /* Function keys */ -#define F1 (0x11 + FLAG_EXT) /* F1 */ -#define F2 (0x12 + FLAG_EXT) /* F2 */ -#define F3 (0x13 + FLAG_EXT) /* F3 */ -#define F4 (0x14 + FLAG_EXT) /* F4 */ -#define F5 (0x15 + FLAG_EXT) /* F5 */ -#define F6 (0x16 + FLAG_EXT) /* F6 */ -#define F7 (0x17 + FLAG_EXT) /* F7 */ -#define F8 (0x18 + FLAG_EXT) /* F8 */ -#define F9 (0x19 + FLAG_EXT) /* F9 */ -#define F10 (0x1A + FLAG_EXT) /* F10 */ -#define F11 (0x1B + FLAG_EXT) /* F11 */ -#define F12 (0x1C + FLAG_EXT) /* F12 */ +#define F1 (0x11 + FLAG_EXT) /* F1 */ +#define F2 (0x12 + FLAG_EXT) /* F2 */ +#define F3 (0x13 + FLAG_EXT) /* F3 */ +#define F4 (0x14 + FLAG_EXT) /* F4 */ +#define F5 (0x15 + FLAG_EXT) /* F5 */ +#define F6 (0x16 + FLAG_EXT) /* F6 */ +#define F7 (0x17 + FLAG_EXT) /* F7 */ +#define F8 (0x18 + FLAG_EXT) /* F8 */ +#define F9 (0x19 + FLAG_EXT) /* F9 */ +#define F10 (0x1A + FLAG_EXT) /* F10 */ +#define F11 (0x1B + FLAG_EXT) /* F11 */ +#define F12 (0x1C + FLAG_EXT) /* F12 */ /* Control Pad */ -#define PRINTSCREEN (0x1D + FLAG_EXT) /* Print Screen */ -#define PAUSEBREAK (0x1E + FLAG_EXT) /* Pause/Break */ -#define INSERT (0x1F + FLAG_EXT) /* Insert */ -#define DELETE (0x20 + FLAG_EXT) /* Delete */ -#define HOME (0x21 + FLAG_EXT) /* Home */ -#define END (0x22 + FLAG_EXT) /* End */ -#define PAGEUP (0x23 + FLAG_EXT) /* Page Up */ -#define PAGEDOWN (0x24 + FLAG_EXT) /* Page Down */ -#define UP (0x25 + FLAG_EXT) /* Up */ -#define DOWN (0x26 + FLAG_EXT) /* Down */ -#define LEFT (0x27 + FLAG_EXT) /* Left */ -#define RIGHT (0x28 + FLAG_EXT) /* Right */ +#define PRINTSCREEN (0x1D + FLAG_EXT) /* Print Screen */ +#define PAUSEBREAK (0x1E + FLAG_EXT) /* Pause/Break */ +#define INSERT (0x1F + FLAG_EXT) /* Insert */ +#define DELETE (0x20 + FLAG_EXT) /* Delete */ +#define HOME (0x21 + FLAG_EXT) /* Home */ +#define END (0x22 + FLAG_EXT) /* End */ +#define PAGEUP (0x23 + FLAG_EXT) /* Page Up */ +#define PAGEDOWN (0x24 + FLAG_EXT) /* Page Down */ +#define UP (0x25 + FLAG_EXT) /* Up */ +#define DOWN (0x26 + FLAG_EXT) /* Down */ +#define LEFT (0x27 + FLAG_EXT) /* Left */ +#define RIGHT (0x28 + FLAG_EXT) /* Right */ /* ACPI keys */ -#define POWER (0x29 + FLAG_EXT) /* Power */ -#define SLEEP (0x2A + FLAG_EXT) /* Sleep */ -#define WAKE (0x2B + FLAG_EXT) /* Wake Up */ +#define POWER (0x29 + FLAG_EXT) /* Power */ +#define SLEEP (0x2A + FLAG_EXT) /* Sleep */ +#define WAKE (0x2B + FLAG_EXT) /* Wake Up */ /* Num Pad */ -#define PAD_SLASH (0x2C + FLAG_EXT) /* / */ -#define PAD_STAR (0x2D + FLAG_EXT) /* * */ -#define PAD_MINUS (0x2E + FLAG_EXT) /* - */ -#define PAD_PLUS (0x2F + FLAG_EXT) /* + */ -#define PAD_ENTER (0x30 + FLAG_EXT) /* Enter */ -#define PAD_DOT (0x31 + FLAG_EXT) /* . */ -#define PAD_0 (0x32 + FLAG_EXT) /* 0 */ -#define PAD_1 (0x33 + FLAG_EXT) /* 1 */ -#define PAD_2 (0x34 + FLAG_EXT) /* 2 */ -#define PAD_3 (0x35 + FLAG_EXT) /* 3 */ -#define PAD_4 (0x36 + FLAG_EXT) /* 4 */ -#define PAD_5 (0x37 + FLAG_EXT) /* 5 */ -#define PAD_6 (0x38 + FLAG_EXT) /* 6 */ -#define PAD_7 (0x39 + FLAG_EXT) /* 7 */ -#define PAD_8 (0x3A + FLAG_EXT) /* 8 */ -#define PAD_9 (0x3B + FLAG_EXT) /* 9 */ -#define PAD_UP PAD_8 /* Up */ -#define PAD_DOWN PAD_2 /* Down */ -#define PAD_LEFT PAD_4 /* Left */ -#define PAD_RIGHT PAD_6 /* Right */ -#define PAD_HOME PAD_7 /* Home */ -#define PAD_END PAD_1 /* End */ -#define PAD_PAGEUP PAD_9 /* Page Up */ -#define PAD_PAGEDOWN PAD_3 /* Page Down */ -#define PAD_INS PAD_0 /* Ins */ -#define PAD_MID PAD_5 /* Middle key */ -#define PAD_DEL PAD_DOT /* Del */ +#define PAD_SLASH (0x2C + FLAG_EXT) /* / */ +#define PAD_STAR (0x2D + FLAG_EXT) /* * */ +#define PAD_MINUS (0x2E + FLAG_EXT) /* - */ +#define PAD_PLUS (0x2F + FLAG_EXT) /* + */ +#define PAD_ENTER (0x30 + FLAG_EXT) /* Enter */ +#define PAD_DOT (0x31 + FLAG_EXT) /* . */ +#define PAD_0 (0x32 + FLAG_EXT) /* 0 */ +#define PAD_1 (0x33 + FLAG_EXT) /* 1 */ +#define PAD_2 (0x34 + FLAG_EXT) /* 2 */ +#define PAD_3 (0x35 + FLAG_EXT) /* 3 */ +#define PAD_4 (0x36 + FLAG_EXT) /* 4 */ +#define PAD_5 (0x37 + FLAG_EXT) /* 5 */ +#define PAD_6 (0x38 + FLAG_EXT) /* 6 */ +#define PAD_7 (0x39 + FLAG_EXT) /* 7 */ +#define PAD_8 (0x3A + FLAG_EXT) /* 8 */ +#define PAD_9 (0x3B + FLAG_EXT) /* 9 */ +#define PAD_UP PAD_8 /* Up */ +#define PAD_DOWN PAD_2 /* Down */ +#define PAD_LEFT PAD_4 /* Left */ +#define PAD_RIGHT PAD_6 /* Right */ +#define PAD_HOME PAD_7 /* Home */ +#define PAD_END PAD_1 /* End */ +#define PAD_PAGEUP PAD_9 /* Page Up */ +#define PAD_PAGEDOWN PAD_3 /* Page Down */ +#define PAD_INS PAD_0 /* Ins */ +#define PAD_MID PAD_5 /* Middle key */ +#define PAD_DEL PAD_DOT /* Del */ /************************************************************************/ @@ -128,10 +128,10 @@ /************************************************************************/ /* Keyboard structure, 1 per console. */ typedef struct s_kb { - char* p_head; /* input cache pointer */ - char* p_tail; /* read cache pointer */ - int count; - char buf[KB_IN_BYTES]; + char* p_head; /* input cache pointer */ + char* p_tail; /* read cache pointer */ + int count; + char buf[KB_IN_BYTES]; }KB_INPUT; diff --git a/bsp/x86/drivers/keymap.h b/bsp/x86/drivers/keymap.h index aa9880e295..e141fa0d6e 100644 --- a/bsp/x86/drivers/keymap.h +++ b/bsp/x86/drivers/keymap.h @@ -17,227 +17,227 @@ /* It should be and can only be included by keyboard.c! */ /********************************************************************/ -#ifndef _TINIX_KEYMAP_H_ -#define _TINIX_KEYMAP_H_ +#ifndef _TINIX_KEYMAP_H_ +#define _TINIX_KEYMAP_H_ /* Keymap for US MF-2 keyboard. */ rt_uint32_t keymap[NR_SCAN_CODES * MAP_COLS] = { -/* scan-code !Shift Shift E0 XX */ +/* scan-code !Shift Shift E0 XX */ /* ==================================================================== */ -/* 0x00 - none */ 0, 0, 0, -/* 0x01 - ESC */ ESC, ESC, 0, -/* 0x02 - '1' */ '1', '!', 0, -/* 0x03 - '2' */ '2', '@', 0, -/* 0x04 - '3' */ '3', '#', 0, -/* 0x05 - '4' */ '4', '$', 0, -/* 0x06 - '5' */ '5', '%', 0, -/* 0x07 - '6' */ '6', '^', 0, -/* 0x08 - '7' */ '7', '&', 0, -/* 0x09 - '8' */ '8', '*', 0, -/* 0x0A - '9' */ '9', '(', 0, -/* 0x0B - '0' */ '0', ')', 0, -/* 0x0C - '-' */ '-', '_', 0, -/* 0x0D - '=' */ '=', '+', 0, -/* 0x0E - BS */ BACKSPACE, BACKSPACE, 0, -/* 0x0F - TAB */ TAB, TAB, 0, -/* 0x10 - 'q' */ 'q', 'Q', 0, -/* 0x11 - 'w' */ 'w', 'W', 0, -/* 0x12 - 'e' */ 'e', 'E', 0, -/* 0x13 - 'r' */ 'r', 'R', 0, -/* 0x14 - 't' */ 't', 'T', 0, -/* 0x15 - 'y' */ 'y', 'Y', 0, -/* 0x16 - 'u' */ 'u', 'U', 0, -/* 0x17 - 'i' */ 'i', 'I', 0, -/* 0x18 - 'o' */ 'o', 'O', 0, -/* 0x19 - 'p' */ 'p', 'P', 0, -/* 0x1A - '[' */ '[', '{', 0, -/* 0x1B - ']' */ ']', '}', 0, -/* 0x1C - CR/LF */ ENTER, ENTER, PAD_ENTER, -/* 0x1D - l. Ctrl */ CTRL_L, CTRL_L, CTRL_R, -/* 0x1E - 'a' */ 'a', 'A', 0, -/* 0x1F - 's' */ 's', 'S', 0, -/* 0x20 - 'd' */ 'd', 'D', 0, -/* 0x21 - 'f' */ 'f', 'F', 0, -/* 0x22 - 'g' */ 'g', 'G', 0, -/* 0x23 - 'h' */ 'h', 'H', 0, -/* 0x24 - 'j' */ 'j', 'J', 0, -/* 0x25 - 'k' */ 'k', 'K', 0, -/* 0x26 - 'l' */ 'l', 'L', 0, -/* 0x27 - ';' */ ';', ':', 0, -/* 0x28 - '\'' */ '\'', '"', 0, -/* 0x29 - '`' */ '`', '~', 0, -/* 0x2A - l. SHIFT */ SHIFT_L, SHIFT_L, 0, -/* 0x2B - '\' */ '\\', '|', 0, -/* 0x2C - 'z' */ 'z', 'Z', 0, -/* 0x2D - 'x' */ 'x', 'X', 0, -/* 0x2E - 'c' */ 'c', 'C', 0, -/* 0x2F - 'v' */ 'v', 'V', 0, -/* 0x30 - 'b' */ 'b', 'B', 0, -/* 0x31 - 'n' */ 'n', 'N', 0, -/* 0x32 - 'm' */ 'm', 'M', 0, -/* 0x33 - ',' */ ',', '<', 0, -/* 0x34 - '.' */ '.', '>', 0, -/* 0x35 - '/' */ '/', '?', PAD_SLASH, -/* 0x36 - r. SHIFT */ SHIFT_R, SHIFT_R, 0, -/* 0x37 - '*' */ '*', '*', 0, -/* 0x38 - ALT */ ALT_L, ALT_L, ALT_R, -/* 0x39 - ' ' */ ' ', ' ', 0, -/* 0x3A - CapsLock */ CAPS_LOCK, CAPS_LOCK, 0, -/* 0x3B - F1 */ F1, F1, 0, -/* 0x3C - F2 */ F2, F2, 0, -/* 0x3D - F3 */ F3, F3, 0, -/* 0x3E - F4 */ F4, F4, 0, -/* 0x3F - F5 */ F5, F5, 0, -/* 0x40 - F6 */ F6, F6, 0, -/* 0x41 - F7 */ F7, F7, 0, -/* 0x42 - F8 */ F8, F8, 0, -/* 0x43 - F9 */ F9, F9, 0, -/* 0x44 - F10 */ F10, F10, 0, -/* 0x45 - NumLock */ NUM_LOCK, NUM_LOCK, 0, -/* 0x46 - ScrLock */ SCROLL_LOCK, SCROLL_LOCK, 0, -/* 0x47 - Home */ PAD_HOME, '7', HOME, -/* 0x48 - CurUp */ PAD_UP, '8', UP, -/* 0x49 - PgUp */ PAD_PAGEUP, '9', PAGEUP, -/* 0x4A - '-' */ PAD_MINUS, '-', 0, -/* 0x4B - Left */ PAD_LEFT, '4', LEFT, -/* 0x4C - MID */ PAD_MID, '5', 0, -/* 0x4D - Right */ PAD_RIGHT, '6', RIGHT, -/* 0x4E - '+' */ PAD_PLUS, '+', 0, -/* 0x4F - End */ PAD_END, '1', END, -/* 0x50 - Down */ PAD_DOWN, '2', DOWN, -/* 0x51 - PgDown */ PAD_PAGEDOWN, '3', PAGEDOWN, -/* 0x52 - Insert */ PAD_INS, '0', INSERT, -/* 0x53 - Delete */ PAD_DOT, '.', DELETE, -/* 0x54 - Enter */ 0, 0, 0, -/* 0x55 - ??? */ 0, 0, 0, -/* 0x56 - ??? */ 0, 0, 0, -/* 0x57 - F11 */ F11, F11, 0, -/* 0x58 - F12 */ F12, F12, 0, -/* 0x59 - ??? */ 0, 0, 0, -/* 0x5A - ??? */ 0, 0, 0, -/* 0x5B - ??? */ 0, 0, GUI_L, -/* 0x5C - ??? */ 0, 0, GUI_R, -/* 0x5D - ??? */ 0, 0, APPS, -/* 0x5E - ??? */ 0, 0, 0, -/* 0x5F - ??? */ 0, 0, 0, -/* 0x60 - ??? */ 0, 0, 0, -/* 0x61 - ??? */ 0, 0, 0, -/* 0x62 - ??? */ 0, 0, 0, -/* 0x63 - ??? */ 0, 0, 0, -/* 0x64 - ??? */ 0, 0, 0, -/* 0x65 - ??? */ 0, 0, 0, -/* 0x66 - ??? */ 0, 0, 0, -/* 0x67 - ??? */ 0, 0, 0, -/* 0x68 - ??? */ 0, 0, 0, -/* 0x69 - ??? */ 0, 0, 0, -/* 0x6A - ??? */ 0, 0, 0, -/* 0x6B - ??? */ 0, 0, 0, -/* 0x6C - ??? */ 0, 0, 0, -/* 0x6D - ??? */ 0, 0, 0, -/* 0x6E - ??? */ 0, 0, 0, -/* 0x6F - ??? */ 0, 0, 0, -/* 0x70 - ??? */ 0, 0, 0, -/* 0x71 - ??? */ 0, 0, 0, -/* 0x72 - ??? */ 0, 0, 0, -/* 0x73 - ??? */ 0, 0, 0, -/* 0x74 - ??? */ 0, 0, 0, -/* 0x75 - ??? */ 0, 0, 0, -/* 0x76 - ??? */ 0, 0, 0, -/* 0x77 - ??? */ 0, 0, 0, -/* 0x78 - ??? */ 0, 0, 0, -/* 0x78 - ??? */ 0, 0, 0, -/* 0x7A - ??? */ 0, 0, 0, -/* 0x7B - ??? */ 0, 0, 0, -/* 0x7C - ??? */ 0, 0, 0, -/* 0x7D - ??? */ 0, 0, 0, -/* 0x7E - ??? */ 0, 0, 0, -/* 0x7F - ??? */ 0, 0, 0 +/* 0x00 - none */ 0, 0, 0, +/* 0x01 - ESC */ ESC, ESC, 0, +/* 0x02 - '1' */ '1', '!', 0, +/* 0x03 - '2' */ '2', '@', 0, +/* 0x04 - '3' */ '3', '#', 0, +/* 0x05 - '4' */ '4', '$', 0, +/* 0x06 - '5' */ '5', '%', 0, +/* 0x07 - '6' */ '6', '^', 0, +/* 0x08 - '7' */ '7', '&', 0, +/* 0x09 - '8' */ '8', '*', 0, +/* 0x0A - '9' */ '9', '(', 0, +/* 0x0B - '0' */ '0', ')', 0, +/* 0x0C - '-' */ '-', '_', 0, +/* 0x0D - '=' */ '=', '+', 0, +/* 0x0E - BS */ BACKSPACE, BACKSPACE, 0, +/* 0x0F - TAB */ TAB, TAB, 0, +/* 0x10 - 'q' */ 'q', 'Q', 0, +/* 0x11 - 'w' */ 'w', 'W', 0, +/* 0x12 - 'e' */ 'e', 'E', 0, +/* 0x13 - 'r' */ 'r', 'R', 0, +/* 0x14 - 't' */ 't', 'T', 0, +/* 0x15 - 'y' */ 'y', 'Y', 0, +/* 0x16 - 'u' */ 'u', 'U', 0, +/* 0x17 - 'i' */ 'i', 'I', 0, +/* 0x18 - 'o' */ 'o', 'O', 0, +/* 0x19 - 'p' */ 'p', 'P', 0, +/* 0x1A - '[' */ '[', '{', 0, +/* 0x1B - ']' */ ']', '}', 0, +/* 0x1C - CR/LF */ ENTER, ENTER, PAD_ENTER, +/* 0x1D - l. Ctrl */ CTRL_L, CTRL_L, CTRL_R, +/* 0x1E - 'a' */ 'a', 'A', 0, +/* 0x1F - 's' */ 's', 'S', 0, +/* 0x20 - 'd' */ 'd', 'D', 0, +/* 0x21 - 'f' */ 'f', 'F', 0, +/* 0x22 - 'g' */ 'g', 'G', 0, +/* 0x23 - 'h' */ 'h', 'H', 0, +/* 0x24 - 'j' */ 'j', 'J', 0, +/* 0x25 - 'k' */ 'k', 'K', 0, +/* 0x26 - 'l' */ 'l', 'L', 0, +/* 0x27 - ';' */ ';', ':', 0, +/* 0x28 - '\'' */ '\'', '"', 0, +/* 0x29 - '`' */ '`', '~', 0, +/* 0x2A - l. SHIFT */ SHIFT_L, SHIFT_L, 0, +/* 0x2B - '\' */ '\\', '|', 0, +/* 0x2C - 'z' */ 'z', 'Z', 0, +/* 0x2D - 'x' */ 'x', 'X', 0, +/* 0x2E - 'c' */ 'c', 'C', 0, +/* 0x2F - 'v' */ 'v', 'V', 0, +/* 0x30 - 'b' */ 'b', 'B', 0, +/* 0x31 - 'n' */ 'n', 'N', 0, +/* 0x32 - 'm' */ 'm', 'M', 0, +/* 0x33 - ',' */ ',', '<', 0, +/* 0x34 - '.' */ '.', '>', 0, +/* 0x35 - '/' */ '/', '?', PAD_SLASH, +/* 0x36 - r. SHIFT */ SHIFT_R, SHIFT_R, 0, +/* 0x37 - '*' */ '*', '*', 0, +/* 0x38 - ALT */ ALT_L, ALT_L, ALT_R, +/* 0x39 - ' ' */ ' ', ' ', 0, +/* 0x3A - CapsLock */ CAPS_LOCK, CAPS_LOCK, 0, +/* 0x3B - F1 */ F1, F1, 0, +/* 0x3C - F2 */ F2, F2, 0, +/* 0x3D - F3 */ F3, F3, 0, +/* 0x3E - F4 */ F4, F4, 0, +/* 0x3F - F5 */ F5, F5, 0, +/* 0x40 - F6 */ F6, F6, 0, +/* 0x41 - F7 */ F7, F7, 0, +/* 0x42 - F8 */ F8, F8, 0, +/* 0x43 - F9 */ F9, F9, 0, +/* 0x44 - F10 */ F10, F10, 0, +/* 0x45 - NumLock */ NUM_LOCK, NUM_LOCK, 0, +/* 0x46 - ScrLock */ SCROLL_LOCK, SCROLL_LOCK, 0, +/* 0x47 - Home */ PAD_HOME, '7', HOME, +/* 0x48 - CurUp */ PAD_UP, '8', UP, +/* 0x49 - PgUp */ PAD_PAGEUP, '9', PAGEUP, +/* 0x4A - '-' */ PAD_MINUS, '-', 0, +/* 0x4B - Left */ PAD_LEFT, '4', LEFT, +/* 0x4C - MID */ PAD_MID, '5', 0, +/* 0x4D - Right */ PAD_RIGHT, '6', RIGHT, +/* 0x4E - '+' */ PAD_PLUS, '+', 0, +/* 0x4F - End */ PAD_END, '1', END, +/* 0x50 - Down */ PAD_DOWN, '2', DOWN, +/* 0x51 - PgDown */ PAD_PAGEDOWN, '3', PAGEDOWN, +/* 0x52 - Insert */ PAD_INS, '0', INSERT, +/* 0x53 - Delete */ PAD_DOT, '.', DELETE, +/* 0x54 - Enter */ 0, 0, 0, +/* 0x55 - ??? */ 0, 0, 0, +/* 0x56 - ??? */ 0, 0, 0, +/* 0x57 - F11 */ F11, F11, 0, +/* 0x58 - F12 */ F12, F12, 0, +/* 0x59 - ??? */ 0, 0, 0, +/* 0x5A - ??? */ 0, 0, 0, +/* 0x5B - ??? */ 0, 0, GUI_L, +/* 0x5C - ??? */ 0, 0, GUI_R, +/* 0x5D - ??? */ 0, 0, APPS, +/* 0x5E - ??? */ 0, 0, 0, +/* 0x5F - ??? */ 0, 0, 0, +/* 0x60 - ??? */ 0, 0, 0, +/* 0x61 - ??? */ 0, 0, 0, +/* 0x62 - ??? */ 0, 0, 0, +/* 0x63 - ??? */ 0, 0, 0, +/* 0x64 - ??? */ 0, 0, 0, +/* 0x65 - ??? */ 0, 0, 0, +/* 0x66 - ??? */ 0, 0, 0, +/* 0x67 - ??? */ 0, 0, 0, +/* 0x68 - ??? */ 0, 0, 0, +/* 0x69 - ??? */ 0, 0, 0, +/* 0x6A - ??? */ 0, 0, 0, +/* 0x6B - ??? */ 0, 0, 0, +/* 0x6C - ??? */ 0, 0, 0, +/* 0x6D - ??? */ 0, 0, 0, +/* 0x6E - ??? */ 0, 0, 0, +/* 0x6F - ??? */ 0, 0, 0, +/* 0x70 - ??? */ 0, 0, 0, +/* 0x71 - ??? */ 0, 0, 0, +/* 0x72 - ??? */ 0, 0, 0, +/* 0x73 - ??? */ 0, 0, 0, +/* 0x74 - ??? */ 0, 0, 0, +/* 0x75 - ??? */ 0, 0, 0, +/* 0x76 - ??? */ 0, 0, 0, +/* 0x77 - ??? */ 0, 0, 0, +/* 0x78 - ??? */ 0, 0, 0, +/* 0x78 - ??? */ 0, 0, 0, +/* 0x7A - ??? */ 0, 0, 0, +/* 0x7B - ??? */ 0, 0, 0, +/* 0x7C - ??? */ 0, 0, 0, +/* 0x7D - ??? */ 0, 0, 0, +/* 0x7E - ??? */ 0, 0, 0, +/* 0x7F - ??? */ 0, 0, 0 }; /*====================================================================================* - Appendix: Scan code set 1 + Appendix: Scan code set 1 *====================================================================================* -KEY MAKE BREAK ----- KEY MAKE BREAK ----- KEY MAKE BREAK +KEY MAKE BREAK ----- KEY MAKE BREAK ----- KEY MAKE BREAK -------------------------------------------------------------------------------------- -A 1E 9E 9 0A 8A [ 1A 9A -B 30 B0 ` 29 89 INSERT E0,52 E0,D2 -C 2E AE - 0C 8C HOME E0,47 E0,C7 -D 20 A0 = 0D 8D PG UP E0,49 E0,C9 -E 12 92 \ 2B AB DELETE E0,53 E0,D3 -F 21 A1 BKSP 0E 8E END E0,4F E0,CF -G 22 A2 SPACE 39 B9 PG DN E0,51 E0,D1 -H 23 A3 TAB 0F 8F U ARROW E0,48 E0,C8 -I 17 97 CAPS 3A BA L ARROW E0,4B E0,CB -J 24 A4 L SHFT 2A AA D ARROW E0,50 E0,D0 -K 25 A5 L CTRL 1D 9D R ARROW E0,4D E0,CD -L 26 A6 L GUI E0,5B E0,DB NUM 45 C5 -M 32 B2 L ALT 38 B8 KP / E0,35 E0,B5 -N 31 B1 R SHFT 36 B6 KP * 37 B7 -O 18 98 R CTRL E0,1D E0,9D KP - 4A CA -P 19 99 R GUI E0,5C E0,DC KP + 4E CE -Q 10 19 R ALT E0,38 E0,B8 KP EN E0,1C E0,9C -R 13 93 APPS E0,5D E0,DD KP . 53 D3 -S 1F 9F ENTER 1C 9C KP 0 52 D2 -T 14 94 ESC 01 81 KP 1 4F CF -U 16 96 F1 3B BB KP 2 50 D0 -V 2F AF F2 3C BC KP 3 51 D1 -W 11 91 F3 3D BD KP 4 4B CB -X 2D AD F4 3E BE KP 5 4C CC -Y 15 95 F5 3F BF KP 6 4D CD -Z 2C AC F6 40 C0 KP 7 47 C7 -0 0B 8B F7 41 C1 KP 8 48 C8 -1 02 82 F8 42 C2 KP 9 49 C9 -2 03 83 F9 43 C3 ] 1B 9B -3 04 84 F10 44 C4 ; 27 A7 -4 05 85 F11 57 D7 ' 28 A8 -5 06 86 F12 58 D8 , 33 B3 - -6 07 87 PRTSCRN E0,2A E0,B7 . 34 B4 - E0,37 E0,AA - -7 08 88 SCROLL 46 C6 / 35 B5 - -8 09 89 PAUSE E1,1D,45 -NONE- - E1,9D,C5 +A 1E 9E 9 0A 8A [ 1A 9A +B 30 B0 ` 29 89 INSERT E0,52 E0,D2 +C 2E AE - 0C 8C HOME E0,47 E0,C7 +D 20 A0 = 0D 8D PG UP E0,49 E0,C9 +E 12 92 \ 2B AB DELETE E0,53 E0,D3 +F 21 A1 BKSP 0E 8E END E0,4F E0,CF +G 22 A2 SPACE 39 B9 PG DN E0,51 E0,D1 +H 23 A3 TAB 0F 8F U ARROW E0,48 E0,C8 +I 17 97 CAPS 3A BA L ARROW E0,4B E0,CB +J 24 A4 L SHFT 2A AA D ARROW E0,50 E0,D0 +K 25 A5 L CTRL 1D 9D R ARROW E0,4D E0,CD +L 26 A6 L GUI E0,5B E0,DB NUM 45 C5 +M 32 B2 L ALT 38 B8 KP / E0,35 E0,B5 +N 31 B1 R SHFT 36 B6 KP * 37 B7 +O 18 98 R CTRL E0,1D E0,9D KP - 4A CA +P 19 99 R GUI E0,5C E0,DC KP + 4E CE +Q 10 19 R ALT E0,38 E0,B8 KP EN E0,1C E0,9C +R 13 93 APPS E0,5D E0,DD KP . 53 D3 +S 1F 9F ENTER 1C 9C KP 0 52 D2 +T 14 94 ESC 01 81 KP 1 4F CF +U 16 96 F1 3B BB KP 2 50 D0 +V 2F AF F2 3C BC KP 3 51 D1 +W 11 91 F3 3D BD KP 4 4B CB +X 2D AD F4 3E BE KP 5 4C CC +Y 15 95 F5 3F BF KP 6 4D CD +Z 2C AC F6 40 C0 KP 7 47 C7 +0 0B 8B F7 41 C1 KP 8 48 C8 +1 02 82 F8 42 C2 KP 9 49 C9 +2 03 83 F9 43 C3 ] 1B 9B +3 04 84 F10 44 C4 ; 27 A7 +4 05 85 F11 57 D7 ' 28 A8 +5 06 86 F12 58 D8 , 33 B3 + +6 07 87 PRTSCRN E0,2A E0,B7 . 34 B4 + E0,37 E0,AA + +7 08 88 SCROLL 46 C6 / 35 B5 + +8 09 89 PAUSE E1,1D,45 -NONE- + E1,9D,C5 ----------------- ACPI Scan Codes: ------------------------------------------- -Key Make Code Break Code +Key Make Code Break Code ------------------------------------------- -Power E0, 5E E0, DE -Sleep E0, 5F E0, DF -Wake E0, 63 E0, E3 +Power E0, 5E E0, DE +Sleep E0, 5F E0, DF +Wake E0, 63 E0, E3 ------------------------------- Windows Multimedia Scan Codes: ------------------------------------------- -Key Make Code Break Code +Key Make Code Break Code ------------------------------------------- -Next Track E0, 19 E0, 99 -Previous Track E0, 10 E0, 90 -Stop E0, 24 E0, A4 -Play/Pause E0, 22 E0, A2 -Mute E0, 20 E0, A0 -Volume Up E0, 30 E0, B0 -Volume Down E0, 2E E0, AE -Media Select E0, 6D E0, ED -E-Mail E0, 6C E0, EC -Calculator E0, 21 E0, A1 -My Computer E0, 6B E0, EB -WWW Search E0, 65 E0, E5 -WWW Home E0, 32 E0, B2 -WWW Back E0, 6A E0, EA -WWW Forward E0, 69 E0, E9 -WWW Stop E0, 68 E0, E8 -WWW Refresh E0, 67 E0, E7 -WWW Favorites E0, 66 E0, E6 +Next Track E0, 19 E0, 99 +Previous Track E0, 10 E0, 90 +Stop E0, 24 E0, A4 +Play/Pause E0, 22 E0, A2 +Mute E0, 20 E0, A0 +Volume Up E0, 30 E0, B0 +Volume Down E0, 2E E0, AE +Media Select E0, 6D E0, ED +E-Mail E0, 6C E0, EC +Calculator E0, 21 E0, A1 +My Computer E0, 6B E0, EB +WWW Search E0, 65 E0, E5 +WWW Home E0, 32 E0, B2 +WWW Back E0, 6A E0, EA +WWW Forward E0, 69 E0, E9 +WWW Stop E0, 68 E0, E8 +WWW Refresh E0, 67 E0, E7 +WWW Favorites E0, 66 E0, E6 *=====================================================================================*/ diff --git a/bsp/x86/drivers/serial.c b/bsp/x86/drivers/serial.c index 64830135fc..58cc9dee90 100644 --- a/bsp/x86/drivers/serial.c +++ b/bsp/x86/drivers/serial.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2018, RT-Thread Development Team + * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -24,17 +24,17 @@ */ void rt_serial_init(void) { - outb(COM1+3,0x80); /* set DLAB of line control reg */ - outb(COM1,0x0c); /* LS of divisor (48 -> 2400 bps */ - outb(COM1+1,0x00); /* MS of divisor */ - outb(COM1+3,0x03); /* reset DLAB */ - outb(COM1+4,0x0b); /* set DTR,RTS, OUT_2 */ - outb(COM1+1,0x0d); /* enable all intrs but writes */ - inb(COM1); /* read data port to reset things (?) */ + outb(COM1+3,0x80); /* set DLAB of line control reg */ + outb(COM1,0x0c); /* LS of divisor (48 -> 2400 bps */ + outb(COM1+1,0x00); /* MS of divisor */ + outb(COM1+3,0x03); /* reset DLAB */ + outb(COM1+4,0x0b); /* set DTR,RTS, OUT_2 */ + outb(COM1+1,0x0d); /* enable all intrs but writes */ + inb(COM1); /* read data port to reset things (?) */ } /** - * This function read a character from serial without interrupt enable mode + * This function read a character from serial without interrupt enable mode * * @return the read char */ @@ -53,13 +53,13 @@ char rt_serial_getc(void) void rt_serial_putc(const char c) { int val; - + while(1) { - if ((val = inb(COM1+COMSTATUS)) & THRE) + if ((val = inb(COM1+COMSTATUS)) & THRE) break; } - + outb(COM1+COMWRITE, c&0xff); } diff --git a/bsp/x86/src/hello.c b/bsp/x86/src/hello.c index a075f18ef1..b4018617b5 100644 --- a/bsp/x86/src/hello.c +++ b/bsp/x86/src/hello.c @@ -9,28 +9,28 @@ extern void rt_kprintf(const char* fmt,...); int add(int a, int b) { - return a+b; + return a+b; } int main(int argc, char* argv[]) { - int i; - char str[32] = "Hello World\n"; + int i; + char str[32] = "Hello World\n"; - for(i=0; i Date: Fri, 12 Mar 2021 10:36:50 +0800 Subject: [uip] remove uip --- components/net/uip/README | 13 - components/net/uip/apps/README | 2 - components/net/uip/apps/dhcpc/Makefile.dhcpc | 1 - components/net/uip/apps/dhcpc/dhcpc.c | 356 - components/net/uip/apps/dhcpc/dhcpc.h | 68 - .../net/uip/apps/hello-world/Makefile.hello-world | 1 - components/net/uip/apps/hello-world/hello-world.c | 115 - components/net/uip/apps/hello-world/hello-world.h | 53 - components/net/uip/apps/resolv/Makefile.resolv | 1 - components/net/uip/apps/resolv/resolv.c | 464 - components/net/uip/apps/resolv/resolv.h | 75 - components/net/uip/apps/smtp/Makefile.smtp | 1 - components/net/uip/apps/smtp/makestrings | 40 - components/net/uip/apps/smtp/smtp-strings | 11 - components/net/uip/apps/smtp/smtp-strings.c | 70 - components/net/uip/apps/smtp/smtp-strings.h | 46 - components/net/uip/apps/smtp/smtp.c | 262 - components/net/uip/apps/smtp/smtp.h | 103 - components/net/uip/apps/telnetd/Makefile.telnetd | 1 - components/net/uip/apps/telnetd/telnetd.c | 350 - components/net/uip/apps/telnetd/telnetd.h | 63 - components/net/uip/apps/telnetd/uip_shell.c | 123 - components/net/uip/apps/telnetd/uip_shell.h | 104 - .../net/uip/apps/webclient/Makefile.webclient | 1 - components/net/uip/apps/webclient/makestrings | 40 - .../net/uip/apps/webclient/webclient-strings | 31 - .../net/uip/apps/webclient/webclient-strings.c | 93 - .../net/uip/apps/webclient/webclient-strings.h | 31 - components/net/uip/apps/webclient/webclient.c | 439 - components/net/uip/apps/webclient/webclient.h | 228 - .../net/uip/apps/webserver/Makefile.webserver | 1 - components/net/uip/apps/webserver/http-strings | 35 - components/net/uip/apps/webserver/http-strings.c | 102 - components/net/uip/apps/webserver/http-strings.h | 34 - components/net/uip/apps/webserver/httpd-cgi.c | 203 - components/net/uip/apps/webserver/httpd-cgi.h | 84 - components/net/uip/apps/webserver/httpd-fs.c | 132 - components/net/uip/apps/webserver/httpd-fs.h | 57 - .../net/uip/apps/webserver/httpd-fs/404.html | 8 - .../net/uip/apps/webserver/httpd-fs/fade.png | Bin 196 -> 0 bytes .../net/uip/apps/webserver/httpd-fs/files.shtml | 35 - .../net/uip/apps/webserver/httpd-fs/footer.html | 2 - .../net/uip/apps/webserver/httpd-fs/header.html | 18 - .../net/uip/apps/webserver/httpd-fs/index.html | 29 - .../uip/apps/webserver/httpd-fs/processes.shtml | 5 - .../net/uip/apps/webserver/httpd-fs/stats.shtml | 31 - .../net/uip/apps/webserver/httpd-fs/style.css | 92 - .../net/uip/apps/webserver/httpd-fs/tcp.shtml | 5 - components/net/uip/apps/webserver/httpd-fsdata.c | 607 - components/net/uip/apps/webserver/httpd-fsdata.h | 64 - components/net/uip/apps/webserver/httpd.c | 338 - components/net/uip/apps/webserver/httpd.h | 62 - components/net/uip/apps/webserver/makefsdata | 78 - components/net/uip/apps/webserver/makestrings | 40 - components/net/uip/apps/webserver/webserver.h | 49 - components/net/uip/doc/Doxyfile | 279 - components/net/uip/doc/Makefile | 7 - components/net/uip/doc/README | 12 - components/net/uip/doc/doxygen.sty | 62 - components/net/uip/doc/example-mainloop-with-arp.c | 86 - .../net/uip/doc/example-mainloop-without-arp.c | 62 - components/net/uip/doc/examples.txt | 34 - components/net/uip/doc/header.tex | 53 - components/net/uip/doc/html/a00036.html | 120 - components/net/uip/doc/html/a00037.html | 72 - components/net/uip/doc/html/a00038.html | 282 - components/net/uip/doc/html/a00039.html | 123 - components/net/uip/doc/html/a00040.html | 459 - components/net/uip/doc/html/a00041.html | 248 - components/net/uip/doc/html/a00042.html | 106 - components/net/uip/doc/html/a00043.html | 82 - components/net/uip/doc/html/a00044.html | 370 - components/net/uip/doc/html/a00045.html | 83 - components/net/uip/doc/html/a00046.html | 484 - components/net/uip/doc/html/a00047.html | 95 - components/net/uip/doc/html/a00048.html | 376 - components/net/uip/doc/html/a00049.html | 88 - components/net/uip/doc/html/a00050.html | 177 - components/net/uip/doc/html/a00051.html | 138 - components/net/uip/doc/html/a00077.html | 78 - components/net/uip/doc/html/a00078.html | 51 - components/net/uip/doc/html/a00079.html | 45 - components/net/uip/doc/html/a00080.html | 69 - components/net/uip/doc/html/a00081.html | 51 - components/net/uip/doc/html/a00082.html | 73 - components/net/uip/doc/html/a00083.html | 45 - components/net/uip/doc/html/a00084.html | 45 - components/net/uip/doc/html/a00085.html | 69 - components/net/uip/doc/html/a00086.html | 54 - components/net/uip/doc/html/a00087.html | 52 - components/net/uip/doc/html/a00088.html | 103 - components/net/uip/doc/html/a00089.html | 44 - components/net/uip/doc/html/a00090.html | 50 - components/net/uip/doc/html/a00091.html | 84 - components/net/uip/doc/html/a00092.html | 39 - components/net/uip/doc/html/a00093.html | 143 - components/net/uip/doc/html/a00094.html | 99 - components/net/uip/doc/html/a00095.html | 64 - components/net/uip/doc/html/a00096.html | 81 - components/net/uip/doc/html/a00097.html | 75 - components/net/uip/doc/html/a00100.html | 48 - components/net/uip/doc/html/a00101.html | 54 - components/net/uip/doc/html/a00102.html | 119 - components/net/uip/doc/html/a00103.html | 84 - components/net/uip/doc/html/a00104.html | 78 - components/net/uip/doc/html/a00105.html | 82 - components/net/uip/doc/html/a00107.html | 268 - components/net/uip/doc/html/a00110.html | 107 - components/net/uip/doc/html/a00111.html | 96 - components/net/uip/doc/html/a00112.html | 49 - components/net/uip/doc/html/a00113.html | 51 - components/net/uip/doc/html/a00114.html | 79 - components/net/uip/doc/html/a00120.html | 50 - components/net/uip/doc/html/a00121.html | 61 - components/net/uip/doc/html/a00123.html | 57 - components/net/uip/doc/html/a00124.html | 59 - components/net/uip/doc/html/a00125.html | 39 - components/net/uip/doc/html/a00127.html | 99 - components/net/uip/doc/html/a00128.html | 101 - components/net/uip/doc/html/a00129.html | 53 - components/net/uip/doc/html/a00130.html | 56 - components/net/uip/doc/html/a00131.html | 63 - components/net/uip/doc/html/a00132.html | 58 - components/net/uip/doc/html/a00134.html | 42 - components/net/uip/doc/html/a00135.html | 215 - components/net/uip/doc/html/a00136.html | 400 - components/net/uip/doc/html/a00137.html | 52 - components/net/uip/doc/html/a00138.html | 70 - components/net/uip/doc/html/a00139.html | 77 - components/net/uip/doc/html/a00140.html | 143 - components/net/uip/doc/html/a00141.html | 83 - components/net/uip/doc/html/a00142.html | 690 - components/net/uip/doc/html/a00143.html | 54 - components/net/uip/doc/html/a00144.html | 328 - components/net/uip/doc/html/a00145.html | 106 - components/net/uip/doc/html/a00146.html | 383 - components/net/uip/doc/html/a00147.html | 1046 - components/net/uip/doc/html/a00148.html | 634 - components/net/uip/doc/html/a00149.html | 68 - components/net/uip/doc/html/a00150.html | 1248 - components/net/uip/doc/html/a00151.html | 221 - components/net/uip/doc/html/a00152.html | 205 - components/net/uip/doc/html/a00153.html | 1059 - components/net/uip/doc/html/a00154.html | 79 - components/net/uip/doc/html/a00155.html | 82 - components/net/uip/doc/html/a00156.html | 237 - components/net/uip/doc/html/a00157.html | 108 - components/net/uip/doc/html/a00158.html | 693 - components/net/uip/doc/html/a00159.html | 251 - components/net/uip/doc/html/a00160.html | 284 - components/net/uip/doc/html/a00161.html | 257 - components/net/uip/doc/html/a00162.html | 56 - components/net/uip/doc/html/a00163.html | 533 - components/net/uip/doc/html/a00164.html | 172 - components/net/uip/doc/html/a00168.html | 381 - components/net/uip/doc/html/a00169.html | 93 - components/net/uip/doc/html/a00170.html | 125 - components/net/uip/doc/html/a00171.html | 77 - components/net/uip/doc/html/a00172.html | 489 - components/net/uip/doc/html/a00173.html | 100 - components/net/uip/doc/html/a00174.html | 287 - components/net/uip/doc/html/a00175.html | 128 - components/net/uip/doc/html/a00176.html | 148 - components/net/uip/doc/html/a00177.html | 129 - components/net/uip/doc/html/a00178.html | 375 - components/net/uip/doc/html/a00179.html | 88 - components/net/uip/doc/html/a00180.html | 464 - components/net/uip/doc/html/a00181.html | 253 - components/net/uip/doc/html/a00182.html | 228 - components/net/uip/doc/html/a00183.html | 109 - components/net/uip/doc/html/a00184.html | 363 - components/net/uip/doc/html/a00185.html | 87 - components/net/uip/doc/html/a00186.html | 129 - components/net/uip/doc/html/a00187.html | 167 - components/net/uip/doc/html/a00188.html | 113 - components/net/uip/doc/html/a00189.html | 108 - components/net/uip/doc/html/a00190.html | 101 - components/net/uip/doc/html/a00191.html | 156 - components/net/uip/doc/html/a00192.html | 363 - components/net/uip/doc/html/a00193.html | 405 - components/net/uip/doc/html/a00194.html | 348 - components/net/uip/doc/html/a00195.html | 152 - components/net/uip/doc/html/a00196.html | 111 - components/net/uip/doc/html/a00197.html | 183 - components/net/uip/doc/html/a00198.html | 86 - components/net/uip/doc/html/a00199.html | 161 - components/net/uip/doc/html/a00200.html | 121 - components/net/uip/doc/html/a00201.html | 1922 - components/net/uip/doc/html/a00202.html | 1626 - components/net/uip/doc/html/a00203.html | 163 - components/net/uip/doc/html/a00204.html | 448 - components/net/uip/doc/html/a00205.html | 169 - components/net/uip/doc/html/a00206.html | 564 - components/net/uip/doc/html/a00207.html | 182 - components/net/uip/doc/html/annotated.html | 50 - components/net/uip/doc/html/classes.html | 38 - components/net/uip/doc/html/doxygen.css | 310 - components/net/uip/doc/html/doxygen.png | Bin 1281 -> 0 bytes components/net/uip/doc/html/examples.html | 38 - components/net/uip/doc/html/files.html | 67 - components/net/uip/doc/html/ftv2blank.png | Bin 174 -> 0 bytes components/net/uip/doc/html/ftv2doc.png | Bin 255 -> 0 bytes components/net/uip/doc/html/ftv2folderclosed.png | Bin 259 -> 0 bytes components/net/uip/doc/html/ftv2folderopen.png | Bin 261 -> 0 bytes components/net/uip/doc/html/ftv2lastnode.png | Bin 233 -> 0 bytes components/net/uip/doc/html/ftv2link.png | Bin 358 -> 0 bytes components/net/uip/doc/html/ftv2mlastnode.png | Bin 160 -> 0 bytes components/net/uip/doc/html/ftv2mnode.png | Bin 194 -> 0 bytes components/net/uip/doc/html/ftv2node.png | Bin 235 -> 0 bytes components/net/uip/doc/html/ftv2plastnode.png | Bin 165 -> 0 bytes components/net/uip/doc/html/ftv2pnode.png | Bin 200 -> 0 bytes components/net/uip/doc/html/ftv2vertline.png | Bin 229 -> 0 bytes components/net/uip/doc/html/functions.html | 217 - components/net/uip/doc/html/functions_vars.html | 217 - components/net/uip/doc/html/globals.html | 62 - components/net/uip/doc/html/globals_0x61.html | 64 - components/net/uip/doc/html/globals_0x62.html | 62 - components/net/uip/doc/html/globals_0x64.html | 73 - components/net/uip/doc/html/globals_0x65.html | 62 - components/net/uip/doc/html/globals_0x66.html | 62 - components/net/uip/doc/html/globals_0x68.html | 73 - components/net/uip/doc/html/globals_0x69.html | 84 - components/net/uip/doc/html/globals_0x6c.html | 66 - components/net/uip/doc/html/globals_0x6d.html | 69 - components/net/uip/doc/html/globals_0x6e.html | 63 - components/net/uip/doc/html/globals_0x70.html | 95 - components/net/uip/doc/html/globals_0x72.html | 69 - components/net/uip/doc/html/globals_0x73.html | 81 - components/net/uip/doc/html/globals_0x74.html | 76 - components/net/uip/doc/html/globals_0x75.html | 237 - components/net/uip/doc/html/globals_0x77.html | 80 - components/net/uip/doc/html/globals_defs.html | 62 - components/net/uip/doc/html/globals_defs_0x61.html | 64 - components/net/uip/doc/html/globals_defs_0x62.html | 62 - components/net/uip/doc/html/globals_defs_0x64.html | 73 - components/net/uip/doc/html/globals_defs_0x65.html | 62 - components/net/uip/doc/html/globals_defs_0x66.html | 62 - components/net/uip/doc/html/globals_defs_0x68.html | 67 - components/net/uip/doc/html/globals_defs_0x69.html | 84 - components/net/uip/doc/html/globals_defs_0x6c.html | 65 - components/net/uip/doc/html/globals_defs_0x6d.html | 66 - components/net/uip/doc/html/globals_defs_0x6e.html | 63 - components/net/uip/doc/html/globals_defs_0x70.html | 93 - components/net/uip/doc/html/globals_defs_0x72.html | 62 - components/net/uip/doc/html/globals_defs_0x73.html | 70 - components/net/uip/doc/html/globals_defs_0x74.html | 72 - components/net/uip/doc/html/globals_defs_0x75.html | 188 - components/net/uip/doc/html/globals_defs_0x77.html | 67 - components/net/uip/doc/html/globals_func.html | 136 - components/net/uip/doc/html/globals_type.html | 47 - components/net/uip/doc/html/globals_vars.html | 55 - components/net/uip/doc/html/hierarchy.html | 50 - components/net/uip/doc/html/index.hhc | 192 - components/net/uip/doc/html/index.hhk | 450 - components/net/uip/doc/html/index.hhp | 197 - components/net/uip/doc/html/index.html | 8 - components/net/uip/doc/html/main.html | 421 - components/net/uip/doc/html/modules.html | 51 - components/net/uip/doc/html/tab_b.gif | Bin 35 -> 0 bytes components/net/uip/doc/html/tab_l.gif | Bin 706 -> 0 bytes components/net/uip/doc/html/tab_r.gif | Bin 2585 -> 0 bytes components/net/uip/doc/html/tabs.css | 102 - components/net/uip/doc/html/tree.html | 223 - components/net/uip/doc/mobisys2003.pdf | Bin 87513 -> 0 bytes components/net/uip/doc/pt-doc.txt | 173 - components/net/uip/doc/sicslogo.pdf | Bin 4547 -> 0 bytes components/net/uip/doc/uip-code-style.c | 118 - components/net/uip/doc/uip-code-style.txt | 3 - components/net/uip/doc/uip-doc.txt | 1180 - components/net/uip/doc/uip-refman.pdf | 39280 ------------------- components/net/uip/lib/memb.c | 104 - components/net/uip/lib/memb.h | 142 - components/net/uip/rt-thread/clock-arch.c | 50 - components/net/uip/rt-thread/clock-arch.h | 40 - components/net/uip/rt-thread/readme.txt | 12 - components/net/uip/rt-thread/uIPmain.c | 127 - components/net/uip/rt-thread/uip-conf.h | 167 - components/net/uip/rt-thread/uip_addr.h | 8 - components/net/uip/rt-thread/uip_arch.c | 143 - components/net/uip/rt-thread/uip_eth.h | 35 - components/net/uip/rt-thread/uip_etharp.c | 58 - components/net/uip/rt-thread/uip_etharp.h | 15 - components/net/uip/rt-thread/uip_ethernetif.c | 313 - components/net/uip/rt-thread/uip_ethernetif.h | 31 - components/net/uip/rt-thread/uip_ipaddr.h | 20 - components/net/uip/rt-thread/uip_netif.c | 53 - components/net/uip/rt-thread/uip_netif.h | 269 - components/net/uip/rt-thread/uip_pbuf.c | 50 - components/net/uip/rt-thread/uip_pbuf.h | 87 - components/net/uip/rt-thread/uip_tcpip.c | 41 - components/net/uip/uip-1.0-changelog.txt | 98 - components/net/uip/unix/Makefile | 44 - components/net/uip/unix/clock-arch.c | 55 - components/net/uip/unix/clock-arch.h | 40 - components/net/uip/unix/main.c | 218 - components/net/uip/unix/tapdev.c | 152 - components/net/uip/unix/tapdev.h | 45 - components/net/uip/unix/uip-conf.h | 157 - 298 files changed, 82855 deletions(-) delete mode 100644 components/net/uip/README delete mode 100644 components/net/uip/apps/README delete mode 100644 components/net/uip/apps/dhcpc/Makefile.dhcpc delete mode 100644 components/net/uip/apps/dhcpc/dhcpc.c delete mode 100644 components/net/uip/apps/dhcpc/dhcpc.h delete mode 100644 components/net/uip/apps/hello-world/Makefile.hello-world delete mode 100644 components/net/uip/apps/hello-world/hello-world.c delete mode 100644 components/net/uip/apps/hello-world/hello-world.h delete mode 100644 components/net/uip/apps/resolv/Makefile.resolv delete mode 100644 components/net/uip/apps/resolv/resolv.c delete mode 100644 components/net/uip/apps/resolv/resolv.h delete mode 100644 components/net/uip/apps/smtp/Makefile.smtp delete mode 100644 components/net/uip/apps/smtp/makestrings delete mode 100644 components/net/uip/apps/smtp/smtp-strings delete mode 100644 components/net/uip/apps/smtp/smtp-strings.c delete mode 100644 components/net/uip/apps/smtp/smtp-strings.h delete mode 100644 components/net/uip/apps/smtp/smtp.c delete mode 100644 components/net/uip/apps/smtp/smtp.h delete mode 100644 components/net/uip/apps/telnetd/Makefile.telnetd delete mode 100644 components/net/uip/apps/telnetd/telnetd.c delete mode 100644 components/net/uip/apps/telnetd/telnetd.h delete mode 100644 components/net/uip/apps/telnetd/uip_shell.c delete mode 100644 components/net/uip/apps/telnetd/uip_shell.h delete mode 100644 components/net/uip/apps/webclient/Makefile.webclient delete mode 100644 components/net/uip/apps/webclient/makestrings delete mode 100644 components/net/uip/apps/webclient/webclient-strings delete mode 100644 components/net/uip/apps/webclient/webclient-strings.c delete mode 100644 components/net/uip/apps/webclient/webclient-strings.h delete mode 100644 components/net/uip/apps/webclient/webclient.c delete mode 100644 components/net/uip/apps/webclient/webclient.h delete mode 100644 components/net/uip/apps/webserver/Makefile.webserver delete mode 100644 components/net/uip/apps/webserver/http-strings delete mode 100644 components/net/uip/apps/webserver/http-strings.c delete mode 100644 components/net/uip/apps/webserver/http-strings.h delete mode 100644 components/net/uip/apps/webserver/httpd-cgi.c delete mode 100644 components/net/uip/apps/webserver/httpd-cgi.h delete mode 100644 components/net/uip/apps/webserver/httpd-fs.c delete mode 100644 components/net/uip/apps/webserver/httpd-fs.h delete mode 100644 components/net/uip/apps/webserver/httpd-fs/404.html delete mode 100644 components/net/uip/apps/webserver/httpd-fs/fade.png delete mode 100644 components/net/uip/apps/webserver/httpd-fs/files.shtml delete mode 100644 components/net/uip/apps/webserver/httpd-fs/footer.html delete mode 100644 components/net/uip/apps/webserver/httpd-fs/header.html delete mode 100644 components/net/uip/apps/webserver/httpd-fs/index.html delete mode 100644 components/net/uip/apps/webserver/httpd-fs/processes.shtml delete mode 100644 components/net/uip/apps/webserver/httpd-fs/stats.shtml delete mode 100644 components/net/uip/apps/webserver/httpd-fs/style.css delete mode 100644 components/net/uip/apps/webserver/httpd-fs/tcp.shtml delete mode 100644 components/net/uip/apps/webserver/httpd-fsdata.c delete mode 100644 components/net/uip/apps/webserver/httpd-fsdata.h delete mode 100644 components/net/uip/apps/webserver/httpd.c delete mode 100644 components/net/uip/apps/webserver/httpd.h delete mode 100644 components/net/uip/apps/webserver/makefsdata delete mode 100644 components/net/uip/apps/webserver/makestrings delete mode 100644 components/net/uip/apps/webserver/webserver.h delete mode 100644 components/net/uip/doc/Doxyfile delete mode 100644 components/net/uip/doc/Makefile delete mode 100644 components/net/uip/doc/README delete mode 100644 components/net/uip/doc/doxygen.sty delete mode 100644 components/net/uip/doc/example-mainloop-with-arp.c delete mode 100644 components/net/uip/doc/example-mainloop-without-arp.c delete mode 100644 components/net/uip/doc/examples.txt delete mode 100644 components/net/uip/doc/header.tex delete mode 100644 components/net/uip/doc/html/a00036.html delete mode 100644 components/net/uip/doc/html/a00037.html delete mode 100644 components/net/uip/doc/html/a00038.html delete mode 100644 components/net/uip/doc/html/a00039.html delete mode 100644 components/net/uip/doc/html/a00040.html delete mode 100644 components/net/uip/doc/html/a00041.html delete mode 100644 components/net/uip/doc/html/a00042.html delete mode 100644 components/net/uip/doc/html/a00043.html delete mode 100644 components/net/uip/doc/html/a00044.html delete mode 100644 components/net/uip/doc/html/a00045.html delete mode 100644 components/net/uip/doc/html/a00046.html delete mode 100644 components/net/uip/doc/html/a00047.html delete mode 100644 components/net/uip/doc/html/a00048.html delete mode 100644 components/net/uip/doc/html/a00049.html delete mode 100644 components/net/uip/doc/html/a00050.html delete mode 100644 components/net/uip/doc/html/a00051.html delete mode 100644 components/net/uip/doc/html/a00077.html delete mode 100644 components/net/uip/doc/html/a00078.html delete mode 100644 components/net/uip/doc/html/a00079.html delete mode 100644 components/net/uip/doc/html/a00080.html delete mode 100644 components/net/uip/doc/html/a00081.html delete mode 100644 components/net/uip/doc/html/a00082.html delete mode 100644 components/net/uip/doc/html/a00083.html delete mode 100644 components/net/uip/doc/html/a00084.html delete mode 100644 components/net/uip/doc/html/a00085.html delete mode 100644 components/net/uip/doc/html/a00086.html delete mode 100644 components/net/uip/doc/html/a00087.html delete mode 100644 components/net/uip/doc/html/a00088.html delete mode 100644 components/net/uip/doc/html/a00089.html delete mode 100644 components/net/uip/doc/html/a00090.html delete mode 100644 components/net/uip/doc/html/a00091.html delete mode 100644 components/net/uip/doc/html/a00092.html delete mode 100644 components/net/uip/doc/html/a00093.html delete mode 100644 components/net/uip/doc/html/a00094.html delete mode 100644 components/net/uip/doc/html/a00095.html delete mode 100644 components/net/uip/doc/html/a00096.html delete mode 100644 components/net/uip/doc/html/a00097.html delete mode 100644 components/net/uip/doc/html/a00100.html delete mode 100644 components/net/uip/doc/html/a00101.html delete mode 100644 components/net/uip/doc/html/a00102.html delete mode 100644 components/net/uip/doc/html/a00103.html delete mode 100644 components/net/uip/doc/html/a00104.html delete mode 100644 components/net/uip/doc/html/a00105.html delete mode 100644 components/net/uip/doc/html/a00107.html delete mode 100644 components/net/uip/doc/html/a00110.html delete mode 100644 components/net/uip/doc/html/a00111.html delete mode 100644 components/net/uip/doc/html/a00112.html delete mode 100644 components/net/uip/doc/html/a00113.html delete mode 100644 components/net/uip/doc/html/a00114.html delete mode 100644 components/net/uip/doc/html/a00120.html delete mode 100644 components/net/uip/doc/html/a00121.html delete mode 100644 components/net/uip/doc/html/a00123.html delete mode 100644 components/net/uip/doc/html/a00124.html delete mode 100644 components/net/uip/doc/html/a00125.html delete mode 100644 components/net/uip/doc/html/a00127.html delete mode 100644 components/net/uip/doc/html/a00128.html delete mode 100644 components/net/uip/doc/html/a00129.html delete mode 100644 components/net/uip/doc/html/a00130.html delete mode 100644 components/net/uip/doc/html/a00131.html delete mode 100644 components/net/uip/doc/html/a00132.html delete mode 100644 components/net/uip/doc/html/a00134.html delete mode 100644 components/net/uip/doc/html/a00135.html delete mode 100644 components/net/uip/doc/html/a00136.html delete mode 100644 components/net/uip/doc/html/a00137.html delete mode 100644 components/net/uip/doc/html/a00138.html delete mode 100644 components/net/uip/doc/html/a00139.html delete mode 100644 components/net/uip/doc/html/a00140.html delete mode 100644 components/net/uip/doc/html/a00141.html delete mode 100644 components/net/uip/doc/html/a00142.html delete mode 100644 components/net/uip/doc/html/a00143.html delete mode 100644 components/net/uip/doc/html/a00144.html delete mode 100644 components/net/uip/doc/html/a00145.html delete mode 100644 components/net/uip/doc/html/a00146.html delete mode 100644 components/net/uip/doc/html/a00147.html delete mode 100644 components/net/uip/doc/html/a00148.html delete mode 100644 components/net/uip/doc/html/a00149.html delete mode 100644 components/net/uip/doc/html/a00150.html delete mode 100644 components/net/uip/doc/html/a00151.html delete mode 100644 components/net/uip/doc/html/a00152.html delete mode 100644 components/net/uip/doc/html/a00153.html delete mode 100644 components/net/uip/doc/html/a00154.html delete mode 100644 components/net/uip/doc/html/a00155.html delete mode 100644 components/net/uip/doc/html/a00156.html delete mode 100644 components/net/uip/doc/html/a00157.html delete mode 100644 components/net/uip/doc/html/a00158.html delete mode 100644 components/net/uip/doc/html/a00159.html delete mode 100644 components/net/uip/doc/html/a00160.html delete mode 100644 components/net/uip/doc/html/a00161.html delete mode 100644 components/net/uip/doc/html/a00162.html delete mode 100644 components/net/uip/doc/html/a00163.html delete mode 100644 components/net/uip/doc/html/a00164.html delete mode 100644 components/net/uip/doc/html/a00168.html delete mode 100644 components/net/uip/doc/html/a00169.html delete mode 100644 components/net/uip/doc/html/a00170.html delete mode 100644 components/net/uip/doc/html/a00171.html delete mode 100644 components/net/uip/doc/html/a00172.html delete mode 100644 components/net/uip/doc/html/a00173.html delete mode 100644 components/net/uip/doc/html/a00174.html delete mode 100644 components/net/uip/doc/html/a00175.html delete mode 100644 components/net/uip/doc/html/a00176.html delete mode 100644 components/net/uip/doc/html/a00177.html delete mode 100644 components/net/uip/doc/html/a00178.html delete mode 100644 components/net/uip/doc/html/a00179.html delete mode 100644 components/net/uip/doc/html/a00180.html delete mode 100644 components/net/uip/doc/html/a00181.html delete mode 100644 components/net/uip/doc/html/a00182.html delete mode 100644 components/net/uip/doc/html/a00183.html delete mode 100644 components/net/uip/doc/html/a00184.html delete mode 100644 components/net/uip/doc/html/a00185.html delete mode 100644 components/net/uip/doc/html/a00186.html delete mode 100644 components/net/uip/doc/html/a00187.html delete mode 100644 components/net/uip/doc/html/a00188.html delete mode 100644 components/net/uip/doc/html/a00189.html delete mode 100644 components/net/uip/doc/html/a00190.html delete mode 100644 components/net/uip/doc/html/a00191.html delete mode 100644 components/net/uip/doc/html/a00192.html delete mode 100644 components/net/uip/doc/html/a00193.html delete mode 100644 components/net/uip/doc/html/a00194.html delete mode 100644 components/net/uip/doc/html/a00195.html delete mode 100644 components/net/uip/doc/html/a00196.html delete mode 100644 components/net/uip/doc/html/a00197.html delete mode 100644 components/net/uip/doc/html/a00198.html delete mode 100644 components/net/uip/doc/html/a00199.html delete mode 100644 components/net/uip/doc/html/a00200.html delete mode 100644 components/net/uip/doc/html/a00201.html delete mode 100644 components/net/uip/doc/html/a00202.html delete mode 100644 components/net/uip/doc/html/a00203.html delete mode 100644 components/net/uip/doc/html/a00204.html delete mode 100644 components/net/uip/doc/html/a00205.html delete mode 100644 components/net/uip/doc/html/a00206.html delete mode 100644 components/net/uip/doc/html/a00207.html delete mode 100644 components/net/uip/doc/html/annotated.html delete mode 100644 components/net/uip/doc/html/classes.html delete mode 100644 components/net/uip/doc/html/doxygen.css delete mode 100644 components/net/uip/doc/html/doxygen.png delete mode 100644 components/net/uip/doc/html/examples.html delete mode 100644 components/net/uip/doc/html/files.html delete mode 100644 components/net/uip/doc/html/ftv2blank.png delete mode 100644 components/net/uip/doc/html/ftv2doc.png delete mode 100644 components/net/uip/doc/html/ftv2folderclosed.png delete mode 100644 components/net/uip/doc/html/ftv2folderopen.png delete mode 100644 components/net/uip/doc/html/ftv2lastnode.png delete mode 100644 components/net/uip/doc/html/ftv2link.png delete mode 100644 components/net/uip/doc/html/ftv2mlastnode.png delete mode 100644 components/net/uip/doc/html/ftv2mnode.png delete mode 100644 components/net/uip/doc/html/ftv2node.png delete mode 100644 components/net/uip/doc/html/ftv2plastnode.png delete mode 100644 components/net/uip/doc/html/ftv2pnode.png delete mode 100644 components/net/uip/doc/html/ftv2vertline.png delete mode 100644 components/net/uip/doc/html/functions.html delete mode 100644 components/net/uip/doc/html/functions_vars.html delete mode 100644 components/net/uip/doc/html/globals.html delete mode 100644 components/net/uip/doc/html/globals_0x61.html delete mode 100644 components/net/uip/doc/html/globals_0x62.html delete mode 100644 components/net/uip/doc/html/globals_0x64.html delete mode 100644 components/net/uip/doc/html/globals_0x65.html delete mode 100644 components/net/uip/doc/html/globals_0x66.html delete mode 100644 components/net/uip/doc/html/globals_0x68.html delete mode 100644 components/net/uip/doc/html/globals_0x69.html delete mode 100644 components/net/uip/doc/html/globals_0x6c.html delete mode 100644 components/net/uip/doc/html/globals_0x6d.html delete mode 100644 components/net/uip/doc/html/globals_0x6e.html delete mode 100644 components/net/uip/doc/html/globals_0x70.html delete mode 100644 components/net/uip/doc/html/globals_0x72.html delete mode 100644 components/net/uip/doc/html/globals_0x73.html delete mode 100644 components/net/uip/doc/html/globals_0x74.html delete mode 100644 components/net/uip/doc/html/globals_0x75.html delete mode 100644 components/net/uip/doc/html/globals_0x77.html delete mode 100644 components/net/uip/doc/html/globals_defs.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x61.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x62.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x64.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x65.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x66.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x68.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x69.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x6c.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x6d.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x6e.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x70.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x72.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x73.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x74.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x75.html delete mode 100644 components/net/uip/doc/html/globals_defs_0x77.html delete mode 100644 components/net/uip/doc/html/globals_func.html delete mode 100644 components/net/uip/doc/html/globals_type.html delete mode 100644 components/net/uip/doc/html/globals_vars.html delete mode 100644 components/net/uip/doc/html/hierarchy.html delete mode 100644 components/net/uip/doc/html/index.hhc delete mode 100644 components/net/uip/doc/html/index.hhk delete mode 100644 components/net/uip/doc/html/index.hhp delete mode 100644 components/net/uip/doc/html/index.html delete mode 100644 components/net/uip/doc/html/main.html delete mode 100644 components/net/uip/doc/html/modules.html delete mode 100644 components/net/uip/doc/html/tab_b.gif delete mode 100644 components/net/uip/doc/html/tab_l.gif delete mode 100644 components/net/uip/doc/html/tab_r.gif delete mode 100644 components/net/uip/doc/html/tabs.css delete mode 100644 components/net/uip/doc/html/tree.html delete mode 100644 components/net/uip/doc/mobisys2003.pdf delete mode 100644 components/net/uip/doc/pt-doc.txt delete mode 100644 components/net/uip/doc/sicslogo.pdf delete mode 100644 components/net/uip/doc/uip-code-style.c delete mode 100644 components/net/uip/doc/uip-code-style.txt delete mode 100644 components/net/uip/doc/uip-doc.txt delete mode 100644 components/net/uip/doc/uip-refman.pdf delete mode 100644 components/net/uip/lib/memb.c delete mode 100644 components/net/uip/lib/memb.h delete mode 100644 components/net/uip/rt-thread/clock-arch.c delete mode 100644 components/net/uip/rt-thread/clock-arch.h delete mode 100644 components/net/uip/rt-thread/readme.txt delete mode 100644 components/net/uip/rt-thread/uIPmain.c delete mode 100644 components/net/uip/rt-thread/uip-conf.h delete mode 100644 components/net/uip/rt-thread/uip_addr.h delete mode 100644 components/net/uip/rt-thread/uip_arch.c delete mode 100644 components/net/uip/rt-thread/uip_eth.h delete mode 100644 components/net/uip/rt-thread/uip_etharp.c delete mode 100644 components/net/uip/rt-thread/uip_etharp.h delete mode 100644 components/net/uip/rt-thread/uip_ethernetif.c delete mode 100644 components/net/uip/rt-thread/uip_ethernetif.h delete mode 100644 components/net/uip/rt-thread/uip_ipaddr.h delete mode 100644 components/net/uip/rt-thread/uip_netif.c delete mode 100644 components/net/uip/rt-thread/uip_netif.h delete mode 100644 components/net/uip/rt-thread/uip_pbuf.c delete mode 100644 components/net/uip/rt-thread/uip_pbuf.h delete mode 100644 components/net/uip/rt-thread/uip_tcpip.c delete mode 100644 components/net/uip/uip-1.0-changelog.txt delete mode 100644 components/net/uip/unix/Makefile delete mode 100644 components/net/uip/unix/clock-arch.c delete mode 100644 components/net/uip/unix/clock-arch.h delete mode 100644 components/net/uip/unix/main.c delete mode 100644 components/net/uip/unix/tapdev.c delete mode 100644 components/net/uip/unix/tapdev.h delete mode 100644 components/net/uip/unix/uip-conf.h diff --git a/components/net/uip/README b/components/net/uip/README deleted file mode 100644 index b501538678..0000000000 --- a/components/net/uip/README +++ /dev/null @@ -1,13 +0,0 @@ -uIP is a very small implementation of the TCP/IP stack that is written -by Adam Dunkels . More information can be obtained -at the uIP homepage at http://www.sics.se/~adam/uip/. - -This is version $Name: uip-1-0 $. - -The directory structure look as follows: - -apps/ - Example applications -doc/ - Documentation -lib/ - Library code used by some applications -uip/ - uIP TCP/IP stack code -unix/ - uIP as a user space process under FreeBSD or Linux diff --git a/components/net/uip/apps/README b/components/net/uip/apps/README deleted file mode 100644 index 0096c4e4fd..0000000000 --- a/components/net/uip/apps/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains a few example applications. They are not all -heavily tested, however. diff --git a/components/net/uip/apps/dhcpc/Makefile.dhcpc b/components/net/uip/apps/dhcpc/Makefile.dhcpc deleted file mode 100644 index f84c84ff46..0000000000 --- a/components/net/uip/apps/dhcpc/Makefile.dhcpc +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += dhcpc.c timer.c diff --git a/components/net/uip/apps/dhcpc/dhcpc.c b/components/net/uip/apps/dhcpc/dhcpc.c deleted file mode 100644 index ac738e7e24..0000000000 --- a/components/net/uip/apps/dhcpc/dhcpc.c +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * @(#)$Id: dhcpc.c,v 1.2 2006/06/11 21:46:37 adam Exp $ - */ - -#include -#include - -#include "uip.h" -#include "dhcpc.h" -#include "timer.h" -#include "pt.h" - -#define STATE_INITIAL 0 -#define STATE_SENDING 1 -#define STATE_OFFER_RECEIVED 2 -#define STATE_CONFIG_RECEIVED 3 - -static struct dhcpc_state s; - -struct dhcp_msg { - u8_t op, htype, hlen, hops; - u8_t xid[4]; - u16_t secs, flags; - u8_t ciaddr[4]; - u8_t yiaddr[4]; - u8_t siaddr[4]; - u8_t giaddr[4]; - u8_t chaddr[16]; -#ifndef UIP_CONF_DHCP_LIGHT - u8_t sname[64]; - u8_t file[128]; -#endif - u8_t options[312]; -}; - -#define BOOTP_BROADCAST 0x8000 - -#define DHCP_REQUEST 1 -#define DHCP_REPLY 2 -#define DHCP_HTYPE_ETHERNET 1 -#define DHCP_HLEN_ETHERNET 6 -#define DHCP_MSG_LEN 236 - -#define DHCPC_SERVER_PORT 67 -#define DHCPC_CLIENT_PORT 68 - -#define DHCPDISCOVER 1 -#define DHCPOFFER 2 -#define DHCPREQUEST 3 -#define DHCPDECLINE 4 -#define DHCPACK 5 -#define DHCPNAK 6 -#define DHCPRELEASE 7 - -#define DHCP_OPTION_SUBNET_MASK 1 -#define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_DNS_SERVER 6 -#define DHCP_OPTION_REQ_IPADDR 50 -#define DHCP_OPTION_LEASE_TIME 51 -#define DHCP_OPTION_MSG_TYPE 53 -#define DHCP_OPTION_SERVER_ID 54 -#define DHCP_OPTION_REQ_LIST 55 -#define DHCP_OPTION_END 255 - -static const u8_t xid[4] = {0xad, 0xde, 0x12, 0x23}; -static const u8_t magic_cookie[4] = {99, 130, 83, 99}; -/*---------------------------------------------------------------------------*/ -static u8_t * -add_msg_type(u8_t *optptr, u8_t type) -{ - *optptr++ = DHCP_OPTION_MSG_TYPE; - *optptr++ = 1; - *optptr++ = type; - return optptr; -} -/*---------------------------------------------------------------------------*/ -static u8_t * -add_server_id(u8_t *optptr) -{ - *optptr++ = DHCP_OPTION_SERVER_ID; - *optptr++ = 4; - memcpy(optptr, s.serverid, 4); - return optptr + 4; -} -/*---------------------------------------------------------------------------*/ -static u8_t * -add_req_ipaddr(u8_t *optptr) -{ - *optptr++ = DHCP_OPTION_REQ_IPADDR; - *optptr++ = 4; - memcpy(optptr, s.ipaddr, 4); - return optptr + 4; -} -/*---------------------------------------------------------------------------*/ -static u8_t * -add_req_options(u8_t *optptr) -{ - *optptr++ = DHCP_OPTION_REQ_LIST; - *optptr++ = 3; - *optptr++ = DHCP_OPTION_SUBNET_MASK; - *optptr++ = DHCP_OPTION_ROUTER; - *optptr++ = DHCP_OPTION_DNS_SERVER; - return optptr; -} -/*---------------------------------------------------------------------------*/ -static u8_t * -add_end(u8_t *optptr) -{ - *optptr++ = DHCP_OPTION_END; - return optptr; -} -/*---------------------------------------------------------------------------*/ -static void -create_msg(register struct dhcp_msg *m) -{ - m->op = DHCP_REQUEST; - m->htype = DHCP_HTYPE_ETHERNET; - m->hlen = s.mac_len; - m->hops = 0; - memcpy(m->xid, xid, sizeof(m->xid)); - m->secs = 0; - m->flags = HTONS(BOOTP_BROADCAST); /* Broadcast bit. */ - /* uip_ipaddr_copy(m->ciaddr, uip_hostaddr);*/ - memcpy(m->ciaddr, uip_hostaddr, sizeof(m->ciaddr)); - memset(m->yiaddr, 0, sizeof(m->yiaddr)); - memset(m->siaddr, 0, sizeof(m->siaddr)); - memset(m->giaddr, 0, sizeof(m->giaddr)); - memcpy(m->chaddr, s.mac_addr, s.mac_len); - memset(&m->chaddr[s.mac_len], 0, sizeof(m->chaddr) - s.mac_len); -#ifndef UIP_CONF_DHCP_LIGHT - memset(m->sname, 0, sizeof(m->sname)); - memset(m->file, 0, sizeof(m->file)); -#endif - - memcpy(m->options, magic_cookie, sizeof(magic_cookie)); -} -/*---------------------------------------------------------------------------*/ -static void -send_discover(void) -{ - u8_t *end; - struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata; - - create_msg(m); - - end = add_msg_type(&m->options[4], DHCPDISCOVER); - end = add_req_options(end); - end = add_end(end); - - uip_send(uip_appdata, end - (u8_t *)uip_appdata); -} -/*---------------------------------------------------------------------------*/ -static void -send_request(void) -{ - u8_t *end; - struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata; - - create_msg(m); - - end = add_msg_type(&m->options[4], DHCPREQUEST); - end = add_server_id(end); - end = add_req_ipaddr(end); - end = add_end(end); - - uip_send(uip_appdata, end - (u8_t *)uip_appdata); -} -/*---------------------------------------------------------------------------*/ -static u8_t -parse_options(u8_t *optptr, int len) -{ - u8_t *end = optptr + len; - u8_t type = 0; - - while(optptr < end) { - switch(*optptr) { - case DHCP_OPTION_SUBNET_MASK: - memcpy(s.netmask, optptr + 2, 4); - break; - case DHCP_OPTION_ROUTER: - memcpy(s.default_router, optptr + 2, 4); - break; - case DHCP_OPTION_DNS_SERVER: - memcpy(s.dnsaddr, optptr + 2, 4); - break; - case DHCP_OPTION_MSG_TYPE: - type = *(optptr + 2); - break; - case DHCP_OPTION_SERVER_ID: - memcpy(s.serverid, optptr + 2, 4); - break; - case DHCP_OPTION_LEASE_TIME: - memcpy(s.lease_time, optptr + 2, 4); - break; - case DHCP_OPTION_END: - return type; - } - - optptr += optptr[1] + 2; - } - return type; -} -/*---------------------------------------------------------------------------*/ -static u8_t -parse_msg(void) -{ - struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata; - - if(m->op == DHCP_REPLY && - memcmp(m->xid, xid, sizeof(xid)) == 0 && - memcmp(m->chaddr, s.mac_addr, s.mac_len) == 0) { - memcpy(s.ipaddr, m->yiaddr, 4); - return parse_options(&m->options[4], uip_datalen()); - } - return 0; -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(handle_dhcp(void)) -{ - PT_BEGIN(&s.pt); - - /* try_again:*/ - s.state = STATE_SENDING; - s.ticks = CLOCK_SECOND; - - do { - send_discover(); - timer_set(&s.timer, s.ticks); - PT_WAIT_UNTIL(&s.pt, uip_newdata() || timer_expired(&s.timer)); - - if(uip_newdata() && parse_msg() == DHCPOFFER) { - s.state = STATE_OFFER_RECEIVED; - break; - } - - if(s.ticks < CLOCK_SECOND * 60) { - s.ticks *= 2; - } - } while(s.state != STATE_OFFER_RECEIVED); - - s.ticks = CLOCK_SECOND; - - do { - send_request(); - timer_set(&s.timer, s.ticks); - PT_WAIT_UNTIL(&s.pt, uip_newdata() || timer_expired(&s.timer)); - - if(uip_newdata() && parse_msg() == DHCPACK) { - s.state = STATE_CONFIG_RECEIVED; - break; - } - - if(s.ticks <= CLOCK_SECOND * 10) { - s.ticks += CLOCK_SECOND; - } else { - PT_RESTART(&s.pt); - } - } while(s.state != STATE_CONFIG_RECEIVED); - -#if 0 - printf("Got IP address %d.%d.%d.%d\n", - uip_ipaddr1(s.ipaddr), uip_ipaddr2(s.ipaddr), - uip_ipaddr3(s.ipaddr), uip_ipaddr4(s.ipaddr)); - printf("Got netmask %d.%d.%d.%d\n", - uip_ipaddr1(s.netmask), uip_ipaddr2(s.netmask), - uip_ipaddr3(s.netmask), uip_ipaddr4(s.netmask)); - printf("Got DNS server %d.%d.%d.%d\n", - uip_ipaddr1(s.dnsaddr), uip_ipaddr2(s.dnsaddr), - uip_ipaddr3(s.dnsaddr), uip_ipaddr4(s.dnsaddr)); - printf("Got default router %d.%d.%d.%d\n", - uip_ipaddr1(s.default_router), uip_ipaddr2(s.default_router), - uip_ipaddr3(s.default_router), uip_ipaddr4(s.default_router)); - printf("Lease expires in %ld seconds\n", - ntohs(s.lease_time[0])*65536ul + ntohs(s.lease_time[1])); -#endif - - dhcpc_configured(&s); - - /* timer_stop(&s.timer);*/ - - /* - * PT_END restarts the thread so we do this instead. Eventually we - * should reacquire expired leases here. - */ - while(1) { - PT_YIELD(&s.pt); - } - - PT_END(&s.pt); -} -/*---------------------------------------------------------------------------*/ -void -dhcpc_init(const void *mac_addr, int mac_len) -{ - uip_ipaddr_t addr; - - s.mac_addr = mac_addr; - s.mac_len = mac_len; - - s.state = STATE_INITIAL; - uip_ipaddr(addr, 255,255,255,255); - s.conn = uip_udp_new(&addr, HTONS(DHCPC_SERVER_PORT)); - if(s.conn != NULL) { - uip_udp_bind(s.conn, HTONS(DHCPC_CLIENT_PORT)); - } - PT_INIT(&s.pt); -} -/*---------------------------------------------------------------------------*/ -void -dhcpc_appcall(void) -{ - handle_dhcp(); -} -/*---------------------------------------------------------------------------*/ -void -dhcpc_request(void) -{ - u16_t ipaddr[2]; - - if(s.state == STATE_INITIAL) { - uip_ipaddr(ipaddr, 0,0,0,0); - uip_sethostaddr(ipaddr); - /* handle_dhcp(PROCESS_EVENT_NONE, NULL);*/ - } -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/apps/dhcpc/dhcpc.h b/components/net/uip/apps/dhcpc/dhcpc.h deleted file mode 100644 index c6550ec586..0000000000 --- a/components/net/uip/apps/dhcpc/dhcpc.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * @(#)$Id: dhcpc.h,v 1.3 2006/06/11 21:46:37 adam Exp $ - */ -#ifndef __DHCPC_H__ -#define __DHCPC_H__ - -#include "timer.h" -#include "pt.h" - -struct dhcpc_state { - struct pt pt; - char state; - struct uip_udp_conn *conn; - struct timer timer; - u16_t ticks; - const void *mac_addr; - int mac_len; - - u8_t serverid[4]; - - u16_t lease_time[2]; - u16_t ipaddr[2]; - u16_t netmask[2]; - u16_t dnsaddr[2]; - u16_t default_router[2]; -}; - -void dhcpc_init(const void *mac_addr, int mac_len); -void dhcpc_request(void); - -void dhcpc_appcall(void); - -void dhcpc_configured(const struct dhcpc_state *s); - -typedef struct dhcpc_state uip_udp_appstate_t; -#define UIP_UDP_APPCALL dhcpc_appcall - - -#endif /* __DHCPC_H__ */ diff --git a/components/net/uip/apps/hello-world/Makefile.hello-world b/components/net/uip/apps/hello-world/Makefile.hello-world deleted file mode 100644 index e34aaf51ab..0000000000 --- a/components/net/uip/apps/hello-world/Makefile.hello-world +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += hello-world.c diff --git a/components/net/uip/apps/hello-world/hello-world.c b/components/net/uip/apps/hello-world/hello-world.c deleted file mode 100644 index b7f329e745..0000000000 --- a/components/net/uip/apps/hello-world/hello-world.c +++ /dev/null @@ -1,115 +0,0 @@ -/** - * \addtogroup helloworld - * @{ - */ - -/** - * \file - * An example of how to write uIP applications - * with protosockets. - * \author - * Adam Dunkels - */ - -/* - * This is a short example of how to write uIP applications using - * protosockets. - */ - -/* - * We define the application state (struct hello_world_state) in the - * hello-world.h file, so we need to include it here. We also include - * uip.h (since this cannot be included in hello-world.h) and - * , since we use the memcpy() function in the code. - */ -#include "hello-world.h" -#include "uip.h" -#include - -/* - * Declaration of the protosocket function that handles the connection - * (defined at the end of the code). - */ -static int handle_connection(struct hello_world_state *s); -static int rt_show_info(struct hello_world_state *s); -/*---------------------------------------------------------------------------*/ -/* - * The initialization function. We must explicitly call this function - * from the system initialization code, some time after uip_init() is - * called. - */ -void -hello_world_init(void) -{ - /* We start to listen for connections on TCP port 1000. */ - uip_listen(HTONS(1000)); -} -/*---------------------------------------------------------------------------*/ -/* - * In hello-world.h we have defined the UIP_APPCALL macro to - * hello_world_appcall so that this funcion is uIP's application - * function. This function is called whenever an uIP event occurs - * (e.g. when a new connection is established, new data arrives, sent - * data is acknowledged, data needs to be retransmitted, etc.). - */ -void -hello_world_appcall(void) -{ - /* - * The uip_conn structure has a field called "appstate" that holds - * the application state of the connection. We make a pointer to - * this to access it easier. - */ - struct hello_world_state *s = &(uip_conn->appstate); - - /* - * If a new connection was just established, we should initialize - * the protosocket in our applications' state structure. - */ - if(uip_connected()) { - PSOCK_INIT(&s->p, s->inputbuffer, sizeof(s->inputbuffer)); - rt_show_info(s); - } - - /* - * Finally, we run the protosocket function that actually handles - * the communication. We pass it a pointer to the application state - * of the current connection. - */ - handle_connection(s); -} -/*---------------------------------------------------------------------------*/ -/* - * This is the protosocket function that handles the communication. A - * protosocket function must always return an int, but must never - * explicitly return - all return statements are hidden in the PSOCK - * macros. - */ -static int rt_show_info(struct hello_world_state *s) -{ - PSOCK_BEGIN(&s->p); - PSOCK_SEND_STR(&s->p,"RT-Thread RTOS"); - PSOCK_READTO(&s->p, '\n'); - PSOCK_END(&s->p); - -} -static int -handle_connection(struct hello_world_state *s) -{ - int i; - for (i=0;iname[i] = 0; - s->inputbuffer[i] = 0; - } - PSOCK_BEGIN(&s->p); - //PSOCK_SEND_STR(&s->p, "Hello. What is your name?\n"); - PSOCK_READTO(&s->p, '\n'); - strncpy(s->name, s->inputbuffer, sizeof(s->name)); - //PSOCK_SEND_STR(&s->p, "Hello "); - PSOCK_SEND_STR(&s->p, s->name); - //PSOCK_CLOSE(&s->p); - - PSOCK_END(&s->p); -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/apps/hello-world/hello-world.h b/components/net/uip/apps/hello-world/hello-world.h deleted file mode 100644 index 4f2e6d93e9..0000000000 --- a/components/net/uip/apps/hello-world/hello-world.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * \addtogroup apps - * @{ - */ - -/** - * \defgroup helloworld Hello, world - * @{ - * - * A small example showing how to write applications with - * \ref psock "protosockets". - */ - -/** - * \file - * Header file for an example of how to write uIP applications - * with protosockets. - * \author - * Adam Dunkels - */ - -#ifndef __HELLO_WORLD_H__ -#define __HELLO_WORLD_H__ - -/* Since this file will be included by uip.h, we cannot include uip.h - here. But we might need to include uipopt.h if we need the u8_t and - u16_t datatypes. */ -#include "uipopt.h" - -#include "psock.h" - -/* Next, we define the uip_tcp_appstate_t datatype. This is the state - of our application, and the memory required for this state is - allocated together with each TCP connection. One application state - for each TCP connection. */ -#define BUF_SIZE 200 -typedef struct hello_world_state { - struct psock p; - char inputbuffer[BUF_SIZE]; - char name[BUF_SIZE]; -} uip_tcp_appstate_t; - -/* Finally we define the application function to be called by uIP. */ -void hello_world_appcall(void); -#ifndef UIP_APPCALL -#define UIP_APPCALL hello_world_appcall -#endif /* UIP_APPCALL */ - -void hello_world_init(void); - -#endif /* __HELLO_WORLD_H__ */ -/** @} */ -/** @} */ diff --git a/components/net/uip/apps/resolv/Makefile.resolv b/components/net/uip/apps/resolv/Makefile.resolv deleted file mode 100644 index 94c37d8c86..0000000000 --- a/components/net/uip/apps/resolv/Makefile.resolv +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += resolv.c diff --git a/components/net/uip/apps/resolv/resolv.c b/components/net/uip/apps/resolv/resolv.c deleted file mode 100644 index 8afbca6c55..0000000000 --- a/components/net/uip/apps/resolv/resolv.c +++ /dev/null @@ -1,464 +0,0 @@ -/** - * \addtogroup apps - * @{ - */ - -/** - * \defgroup resolv DNS resolver - * @{ - * - * The uIP DNS resolver functions are used to lookup a hostname and - * map it to a numerical IP address. It maintains a list of resolved - * hostnames that can be queried with the resolv_lookup() - * function. New hostnames can be resolved using the resolv_query() - * function. - * - * When a hostname has been resolved (or found to be non-existant), - * the resolver code calls a callback function called resolv_found() - * that must be implemented by the module that uses the resolver. - */ - -/** - * \file - * DNS host name to IP address resolver. - * \author Adam Dunkels - * - * This file implements a DNS host name to IP address resolver. - */ - -/* - * Copyright (c) 2002-2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: resolv.c,v 1.5 2006/06/11 21:46:37 adam Exp $ - * - */ - -#include "resolv.h" -#include "uip.h" - -#include - -#ifndef NULL -#define NULL (void *)0 -#endif /* NULL */ - -/** \internal The maximum number of retries when asking for a name. */ -#define MAX_RETRIES 8 - -/** \internal The DNS message header. */ -struct dns_hdr { - u16_t id; - u8_t flags1, flags2; -#define DNS_FLAG1_RESPONSE 0x80 -#define DNS_FLAG1_OPCODE_STATUS 0x10 -#define DNS_FLAG1_OPCODE_INVERSE 0x08 -#define DNS_FLAG1_OPCODE_STANDARD 0x00 -#define DNS_FLAG1_AUTHORATIVE 0x04 -#define DNS_FLAG1_TRUNC 0x02 -#define DNS_FLAG1_RD 0x01 -#define DNS_FLAG2_RA 0x80 -#define DNS_FLAG2_ERR_MASK 0x0f -#define DNS_FLAG2_ERR_NONE 0x00 -#define DNS_FLAG2_ERR_NAME 0x03 - u16_t numquestions; - u16_t numanswers; - u16_t numauthrr; - u16_t numextrarr; -}; - -/** \internal The DNS answer message structure. */ -struct dns_answer { - /* DNS answer record starts with either a domain name or a pointer - to a name already present somewhere in the packet. */ - u16_t type; - u16_t class; - u16_t ttl[2]; - u16_t len; - uip_ipaddr_t ipaddr; -}; - -struct namemap { -#define STATE_UNUSED 0 -#define STATE_NEW 1 -#define STATE_ASKING 2 -#define STATE_DONE 3 -#define STATE_ERROR 4 - u8_t state; - u8_t tmr; - u8_t retries; - u8_t seqno; - u8_t err; - char name[32]; - uip_ipaddr_t ipaddr; -}; - -#ifndef UIP_CONF_RESOLV_ENTRIES -#define RESOLV_ENTRIES 4 -#else /* UIP_CONF_RESOLV_ENTRIES */ -#define RESOLV_ENTRIES UIP_CONF_RESOLV_ENTRIES -#endif /* UIP_CONF_RESOLV_ENTRIES */ - - -static struct namemap names[RESOLV_ENTRIES]; - -static u8_t seqno; - -static struct uip_udp_conn *resolv_conn = NULL; - - -/*---------------------------------------------------------------------------*/ -/** \internal - * Walk through a compact encoded DNS name and return the end of it. - * - * \return The end of the name. - */ -/*---------------------------------------------------------------------------*/ -static unsigned char * -parse_name(unsigned char *query) -{ - unsigned char n; - - do { - n = *query++; - - while(n > 0) { - /* printf("%c", *query);*/ - ++query; - --n; - }; - /* printf(".");*/ - } while(*query != 0); - /* printf("\n");*/ - return query + 1; -} -/*---------------------------------------------------------------------------*/ -/** \internal - * Runs through the list of names to see if there are any that have - * not yet been queried and, if so, sends out a query. - */ -/*---------------------------------------------------------------------------*/ -static void -check_entries(void) -{ - register struct dns_hdr *hdr; - char *query, *nptr, *nameptr; - static u8_t i; - static u8_t n; - register struct namemap *namemapptr; - - for(i = 0; i < RESOLV_ENTRIES; ++i) { - namemapptr = &names[i]; - if(namemapptr->state == STATE_NEW || - namemapptr->state == STATE_ASKING) { - if(namemapptr->state == STATE_ASKING) { - if(--namemapptr->tmr == 0) { - if(++namemapptr->retries == MAX_RETRIES) { - namemapptr->state = STATE_ERROR; - resolv_found(namemapptr->name, NULL); - continue; - } - namemapptr->tmr = namemapptr->retries; - } else { - /* printf("Timer %d\n", namemapptr->tmr);*/ - /* Its timer has not run out, so we move on to next - entry. */ - continue; - } - } else { - namemapptr->state = STATE_ASKING; - namemapptr->tmr = 1; - namemapptr->retries = 0; - } - hdr = (struct dns_hdr *)uip_appdata; - memset(hdr, 0, sizeof(struct dns_hdr)); - hdr->id = htons(i); - hdr->flags1 = DNS_FLAG1_RD; - hdr->numquestions = HTONS(1); - query = (char *)uip_appdata + 12; - nameptr = namemapptr->name; - --nameptr; - /* Convert hostname into suitable query format. */ - do { - ++nameptr; - nptr = query; - ++query; - for(n = 0; *nameptr != '.' && *nameptr != 0; ++nameptr) { - *query = *nameptr; - ++query; - ++n; - } - *nptr = n; - } while(*nameptr != 0); - { - static unsigned char endquery[] = - {0,0,1,0,1}; - memcpy(query, endquery, 5); - } - uip_udp_send((unsigned char)(query + 5 - (char *)uip_appdata)); - break; - } - } -} -/*---------------------------------------------------------------------------*/ -/** \internal - * Called when new UDP data arrives. - */ -/*---------------------------------------------------------------------------*/ -static void -newdata(void) -{ - char *nameptr; - struct dns_answer *ans; - struct dns_hdr *hdr; - static u8_t nquestions, nanswers; - static u8_t i; - register struct namemap *namemapptr; - - hdr = (struct dns_hdr *)uip_appdata; - /* printf("ID %d\n", htons(hdr->id)); - printf("Query %d\n", hdr->flags1 & DNS_FLAG1_RESPONSE); - printf("Error %d\n", hdr->flags2 & DNS_FLAG2_ERR_MASK); - printf("Num questions %d, answers %d, authrr %d, extrarr %d\n", - htons(hdr->numquestions), - htons(hdr->numanswers), - htons(hdr->numauthrr), - htons(hdr->numextrarr)); - */ - - /* The ID in the DNS header should be our entry into the name - table. */ - i = htons(hdr->id); - namemapptr = &names[i]; - if(i < RESOLV_ENTRIES && - namemapptr->state == STATE_ASKING) { - - /* This entry is now finished. */ - namemapptr->state = STATE_DONE; - namemapptr->err = hdr->flags2 & DNS_FLAG2_ERR_MASK; - - /* Check for error. If so, call callback to inform. */ - if(namemapptr->err != 0) { - namemapptr->state = STATE_ERROR; - resolv_found(namemapptr->name, NULL); - return; - } - - /* We only care about the question(s) and the answers. The authrr - and the extrarr are simply discarded. */ - nquestions = htons(hdr->numquestions); - nanswers = htons(hdr->numanswers); - - /* Skip the name in the question. XXX: This should really be - checked agains the name in the question, to be sure that they - match. */ - nameptr = parse_name((char *)uip_appdata + 12) + 4; - - while(nanswers > 0) { - /* The first byte in the answer resource record determines if it - is a compressed record or a normal one. */ - if(*nameptr & 0xc0) { - /* Compressed name. */ - nameptr +=2; - /* printf("Compressed anwser\n");*/ - } else { - /* Not compressed name. */ - nameptr = parse_name((char *)nameptr); - } - - ans = (struct dns_answer *)nameptr; - /* printf("Answer: type %x, class %x, ttl %x, length %x\n", - htons(ans->type), htons(ans->class), (htons(ans->ttl[0]) - << 16) | htons(ans->ttl[1]), htons(ans->len));*/ - - /* Check for IP address type and Internet class. Others are - discarded. */ - if(ans->type == HTONS(1) && - ans->class == HTONS(1) && - ans->len == HTONS(4)) { - /* printf("IP address %d.%d.%d.%d\n", - htons(ans->ipaddr[0]) >> 8, - htons(ans->ipaddr[0]) & 0xff, - htons(ans->ipaddr[1]) >> 8, - htons(ans->ipaddr[1]) & 0xff);*/ - /* XXX: we should really check that this IP address is the one - we want. */ - namemapptr->ipaddr[0] = ans->ipaddr[0]; - namemapptr->ipaddr[1] = ans->ipaddr[1]; - - resolv_found(namemapptr->name, namemapptr->ipaddr); - return; - } else { - nameptr = nameptr + 10 + htons(ans->len); - } - --nanswers; - } - } - -} -/*---------------------------------------------------------------------------*/ -/** \internal - * The main UDP function. - */ -/*---------------------------------------------------------------------------*/ -void -resolv_appcall(void) -{ - if(uip_udp_conn->rport == HTONS(53)) { - if(uip_poll()) { - check_entries(); - } - if(uip_newdata()) { - newdata(); - } - } -} -/*---------------------------------------------------------------------------*/ -/** - * Queues a name so that a question for the name will be sent out. - * - * \param name The hostname that is to be queried. - */ -/*---------------------------------------------------------------------------*/ -void -resolv_query(char *name) -{ - static u8_t i; - static u8_t lseq, lseqi; - register struct namemap *nameptr; - - lseq = lseqi = 0; - - for(i = 0; i < RESOLV_ENTRIES; ++i) { - nameptr = &names[i]; - if(nameptr->state == STATE_UNUSED) { - break; - } - if(seqno - nameptr->seqno > lseq) { - lseq = seqno - nameptr->seqno; - lseqi = i; - } - } - - if(i == RESOLV_ENTRIES) { - i = lseqi; - nameptr = &names[i]; - } - - /* printf("Using entry %d\n", i);*/ - - strcpy(nameptr->name, name); - nameptr->state = STATE_NEW; - nameptr->seqno = seqno; - ++seqno; -} -/*---------------------------------------------------------------------------*/ -/** - * Look up a hostname in the array of known hostnames. - * - * \note This function only looks in the internal array of known - * hostnames, it does not send out a query for the hostname if none - * was found. The function resolv_query() can be used to send a query - * for a hostname. - * - * \return A pointer to a 4-byte representation of the hostname's IP - * address, or NULL if the hostname was not found in the array of - * hostnames. - */ -/*---------------------------------------------------------------------------*/ -u16_t * -resolv_lookup(char *name) -{ - static u8_t i; - struct namemap *nameptr; - - /* Walk through the list to see if the name is in there. If it is - not, we return NULL. */ - for(i = 0; i < RESOLV_ENTRIES; ++i) { - nameptr = &names[i]; - if(nameptr->state == STATE_DONE && - strcmp(name, nameptr->name) == 0) { - return nameptr->ipaddr; - } - } - return NULL; -} -/*---------------------------------------------------------------------------*/ -/** - * Obtain the currently configured DNS server. - * - * \return A pointer to a 4-byte representation of the IP address of - * the currently configured DNS server or NULL if no DNS server has - * been configured. - */ -/*---------------------------------------------------------------------------*/ -u16_t * -resolv_getserver(void) -{ - if(resolv_conn == NULL) { - return NULL; - } - return resolv_conn->ripaddr; -} -/*---------------------------------------------------------------------------*/ -/** - * Configure which DNS server to use for queries. - * - * \param dnsserver A pointer to a 4-byte representation of the IP - * address of the DNS server to be configured. - */ -/*---------------------------------------------------------------------------*/ -void -resolv_conf(u16_t *dnsserver) -{ - if(resolv_conn != NULL) { - uip_udp_remove(resolv_conn); - } - - resolv_conn = uip_udp_new(dnsserver, HTONS(53)); -} -/*---------------------------------------------------------------------------*/ -/** - * Initalize the resolver. - */ -/*---------------------------------------------------------------------------*/ -void -resolv_init(void) -{ - static u8_t i; - - for(i = 0; i < RESOLV_ENTRIES; ++i) { - names[i].state = STATE_DONE; - } - -} -/*---------------------------------------------------------------------------*/ - -/** @} */ -/** @} */ diff --git a/components/net/uip/apps/resolv/resolv.h b/components/net/uip/apps/resolv/resolv.h deleted file mode 100644 index abab34e127..0000000000 --- a/components/net/uip/apps/resolv/resolv.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * \addtogroup resolv - * @{ - */ -/** - * \file - * DNS resolver code header file. - * \author Adam Dunkels - */ - -/* - * Copyright (c) 2002-2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: resolv.h,v 1.4 2006/06/11 21:46:37 adam Exp $ - * - */ -#ifndef __RESOLV_H__ -#define __RESOLV_H__ - -typedef int uip_udp_appstate_t; -void resolv_appcall(void); -#define UIP_UDP_APPCALL resolv_appcall - -#include "uipopt.h" - -/** - * Callback function which is called when a hostname is found. - * - * This function must be implemented by the module that uses the DNS - * resolver. It is called when a hostname is found, or when a hostname - * was not found. - * - * \param name A pointer to the name that was looked up. \param - * ipaddr A pointer to a 4-byte array containing the IP address of the - * hostname, or NULL if the hostname could not be found. - */ -void resolv_found(char *name, u16_t *ipaddr); - -/* Functions. */ -void resolv_conf(u16_t *dnsserver); -u16_t *resolv_getserver(void); -void resolv_init(void); -u16_t *resolv_lookup(char *name); -void resolv_query(char *name); - -#endif /* __RESOLV_H__ */ - -/** @} */ diff --git a/components/net/uip/apps/smtp/Makefile.smtp b/components/net/uip/apps/smtp/Makefile.smtp deleted file mode 100644 index 8b3a5aa45c..0000000000 --- a/components/net/uip/apps/smtp/Makefile.smtp +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += smtp.c smtp-strings.c memb.c diff --git a/components/net/uip/apps/smtp/makestrings b/components/net/uip/apps/smtp/makestrings deleted file mode 100644 index bea18a6c34..0000000000 --- a/components/net/uip/apps/smtp/makestrings +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/perl - - -sub stringify { - my $name = shift(@_); - open(OUTPUTC, "> $name.c"); - open(OUTPUTH, "> $name.h"); - - open(FILE, "$name"); - - while() { - if(/(.+) "(.+)"/) { - $var = $1; - $data = $2; - - $datan = $data; - $datan =~ s/\\r/\r/g; - $datan =~ s/\\n/\n/g; - $datan =~ s/\\01/\01/g; - $datan =~ s/\\0/\0/g; - - printf(OUTPUTC "const char $var\[%d] = \n", length($datan) + 1); - printf(OUTPUTC "/* \"$data\" */\n"); - printf(OUTPUTC "{"); - for($j = 0; $j < length($datan); $j++) { - printf(OUTPUTC "%#02x, ", unpack("C", substr($datan, $j, 1))); - } - printf(OUTPUTC "};\n"); - - printf(OUTPUTH "extern const char $var\[%d];\n", length($datan) + 1); - - } - } - close(OUTPUTC); - close(OUTPUTH); -} -stringify("smtp-strings"); - -exit 0; - diff --git a/components/net/uip/apps/smtp/smtp-strings b/components/net/uip/apps/smtp/smtp-strings deleted file mode 100644 index 27f639c2eb..0000000000 --- a/components/net/uip/apps/smtp/smtp-strings +++ /dev/null @@ -1,11 +0,0 @@ -smtp_220 "220" -smtp_helo "HELO " -smtp_mail_from "MAIL FROM: " -smtp_rcpt_to "RCPT TO: " -smtp_data "DATA\r\n" -smtp_to "To: " -smtp_from "From: " -smtp_subject "Subject: " -smtp_quit "QUIT\r\n" -smtp_crnl "\r\n" -smtp_crnlperiodcrnl "\r\n.\r\n" \ No newline at end of file diff --git a/components/net/uip/apps/smtp/smtp-strings.c b/components/net/uip/apps/smtp/smtp-strings.c deleted file mode 100644 index f3981a17bf..0000000000 --- a/components/net/uip/apps/smtp/smtp-strings.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2004, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels - * - * $Id: smtp-strings.c,v 1.3 2006/06/11 21:46:37 adam Exp $ - */ -const char smtp_220[4] = -/* "220" */ -{0x32, 0x32, 0x30, }; -const char smtp_helo[6] = -/* "HELO " */ -{0x48, 0x45, 0x4c, 0x4f, 0x20, }; -const char smtp_mail_from[12] = -/* "MAIL FROM: " */ -{0x4d, 0x41, 0x49, 0x4c, 0x20, 0x46, 0x52, 0x4f, 0x4d, 0x3a, 0x20, }; -const char smtp_rcpt_to[10] = -/* "RCPT TO: " */ -{0x52, 0x43, 0x50, 0x54, 0x20, 0x54, 0x4f, 0x3a, 0x20, }; -const char smtp_data[7] = -/* "DATA\r\n" */ -{0x44, 0x41, 0x54, 0x41, 0xd, 0xa, }; -const char smtp_to[5] = -/* "To: " */ -{0x54, 0x6f, 0x3a, 0x20, }; -const char smtp_cc[5] = -/* "Cc: " */ -{0x43, 0x63, 0x3a, 0x20, }; -const char smtp_from[7] = -/* "From: " */ -{0x46, 0x72, 0x6f, 0x6d, 0x3a, 0x20, }; -const char smtp_subject[10] = -/* "Subject: " */ -{0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, }; -const char smtp_quit[7] = -/* "QUIT\r\n" */ -{0x51, 0x55, 0x49, 0x54, 0xd, 0xa, }; -const char smtp_crnl[3] = -/* "\r\n" */ -{0xd, 0xa, }; -const char smtp_crnlperiodcrnl[6] = -/* "\r\n.\r\n" */ -{0xd, 0xa, 0x2e, 0xd, 0xa, }; diff --git a/components/net/uip/apps/smtp/smtp-strings.h b/components/net/uip/apps/smtp/smtp-strings.h deleted file mode 100644 index f5ae68c894..0000000000 --- a/components/net/uip/apps/smtp/smtp-strings.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2004, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels - * - * $Id: smtp-strings.h,v 1.3 2006/06/11 21:46:37 adam Exp $ - */ -extern const char smtp_220[4]; -extern const char smtp_helo[6]; -extern const char smtp_mail_from[12]; -extern const char smtp_rcpt_to[10]; -extern const char smtp_data[7]; -extern const char smtp_to[5]; -extern const char smtp_cc[5]; -extern const char smtp_from[7]; -extern const char smtp_subject[10]; -extern const char smtp_quit[7]; -extern const char smtp_crnl[3]; -extern const char smtp_crnlperiodcrnl[6]; diff --git a/components/net/uip/apps/smtp/smtp.c b/components/net/uip/apps/smtp/smtp.c deleted file mode 100644 index a860006ad0..0000000000 --- a/components/net/uip/apps/smtp/smtp.c +++ /dev/null @@ -1,262 +0,0 @@ -/** - * \addtogroup apps - * @{ - */ - -/** - * \defgroup smtp SMTP E-mail sender - * @{ - * - * The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is - * the standard way of sending and transfering e-mail on the - * Internet. This simple example implementation is intended as an - * example of how to implement protocols in uIP, and is able to send - * out e-mail but has not been extensively tested. - */ - -/** - * \file - * SMTP example implementation - * \author Adam Dunkels - */ - -/* - * Copyright (c) 2004, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * Author: Adam Dunkels - * - * $Id: smtp.c,v 1.4 2006/06/11 21:46:37 adam Exp $ - */ -#include "smtp.h" - -#include "smtp-strings.h" -#include "psock.h" -#include "uip.h" - -#include - -static struct smtp_state s; - -static char *localhostname; -static uip_ipaddr_t smtpserver; - -#define ISO_nl 0x0a -#define ISO_cr 0x0d - -#define ISO_period 0x2e - -#define ISO_2 0x32 -#define ISO_3 0x33 -#define ISO_4 0x34 -#define ISO_5 0x35 - - -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(smtp_thread(void)) -{ - PSOCK_BEGIN(&s.psock); - - PSOCK_READTO(&s.psock, ISO_nl); - - if(strncmp(s.inputbuffer, smtp_220, 3) != 0) { - PSOCK_CLOSE(&s.psock); - smtp_done(2); - PSOCK_EXIT(&s.psock); - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_helo); - PSOCK_SEND_STR(&s.psock, localhostname); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - PSOCK_READTO(&s.psock, ISO_nl); - - if(s.inputbuffer[0] != ISO_2) { - PSOCK_CLOSE(&s.psock); - smtp_done(3); - PSOCK_EXIT(&s.psock); - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_mail_from); - PSOCK_SEND_STR(&s.psock, s.from); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - PSOCK_READTO(&s.psock, ISO_nl); - - if(s.inputbuffer[0] != ISO_2) { - PSOCK_CLOSE(&s.psock); - smtp_done(4); - PSOCK_EXIT(&s.psock); - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_rcpt_to); - PSOCK_SEND_STR(&s.psock, s.to); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - PSOCK_READTO(&s.psock, ISO_nl); - - if(s.inputbuffer[0] != ISO_2) { - PSOCK_CLOSE(&s.psock); - smtp_done(5); - PSOCK_EXIT(&s.psock); - } - - if(s.cc != 0) { - PSOCK_SEND_STR(&s.psock, (char *)smtp_rcpt_to); - PSOCK_SEND_STR(&s.psock, s.cc); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - PSOCK_READTO(&s.psock, ISO_nl); - - if(s.inputbuffer[0] != ISO_2) { - PSOCK_CLOSE(&s.psock); - smtp_done(6); - PSOCK_EXIT(&s.psock); - } - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_data); - - PSOCK_READTO(&s.psock, ISO_nl); - - if(s.inputbuffer[0] != ISO_3) { - PSOCK_CLOSE(&s.psock); - smtp_done(7); - PSOCK_EXIT(&s.psock); - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_to); - PSOCK_SEND_STR(&s.psock, s.to); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - if(s.cc != 0) { - PSOCK_SEND_STR(&s.psock, (char *)smtp_cc); - PSOCK_SEND_STR(&s.psock, s.cc); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_from); - PSOCK_SEND_STR(&s.psock, s.from); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - PSOCK_SEND_STR(&s.psock, (char *)smtp_subject); - PSOCK_SEND_STR(&s.psock, s.subject); - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl); - - PSOCK_SEND(&s.psock, s.msg, s.msglen); - - PSOCK_SEND_STR(&s.psock, (char *)smtp_crnlperiodcrnl); - - PSOCK_READTO(&s.psock, ISO_nl); - if(s.inputbuffer[0] != ISO_2) { - PSOCK_CLOSE(&s.psock); - smtp_done(8); - PSOCK_EXIT(&s.psock); - } - - PSOCK_SEND_STR(&s.psock, (char *)smtp_quit); - smtp_done(SMTP_ERR_OK); - PSOCK_END(&s.psock); -} -/*---------------------------------------------------------------------------*/ -void -smtp_appcall(void) -{ - if(uip_closed()) { - s.connected = 0; - return; - } - if(uip_aborted() || uip_timedout()) { - s.connected = 0; - smtp_done(1); - return; - } - smtp_thread(); -} -/*---------------------------------------------------------------------------*/ -/** - * Specificy an SMTP server and hostname. - * - * This function is used to configure the SMTP module with an SMTP - * server and the hostname of the host. - * - * \param lhostname The hostname of the uIP host. - * - * \param server A pointer to a 4-byte array representing the IP - * address of the SMTP server to be configured. - */ -void -smtp_configure(char *lhostname, void *server) -{ - localhostname = lhostname; - uip_ipaddr_copy(smtpserver, server); -} -/*---------------------------------------------------------------------------*/ -/** - * Send an e-mail. - * - * \param to The e-mail address of the receiver of the e-mail. - * \param cc The e-mail address of the CC: receivers of the e-mail. - * \param from The e-mail address of the sender of the e-mail. - * \param subject The subject of the e-mail. - * \param msg The actual e-mail message. - * \param msglen The length of the e-mail message. - */ -unsigned char -smtp_send(char *to, char *cc, char *from, - char *subject, char *msg, u16_t msglen) -{ - struct uip_conn *conn; - - conn = uip_connect(smtpserver, HTONS(25)); - if(conn == NULL) { - return 0; - } - s.connected = 1; - s.to = to; - s.cc = cc; - s.from = from; - s.subject = subject; - s.msg = msg; - s.msglen = msglen; - - PSOCK_INIT(&s.psock, s.inputbuffer, sizeof(s.inputbuffer)); - - return 1; -} -/*---------------------------------------------------------------------------*/ -void -smtp_init(void) -{ - s.connected = 0; -} -/*---------------------------------------------------------------------------*/ -/** @} */ -/** @} */ diff --git a/components/net/uip/apps/smtp/smtp.h b/components/net/uip/apps/smtp/smtp.h deleted file mode 100644 index 44d0766e10..0000000000 --- a/components/net/uip/apps/smtp/smtp.h +++ /dev/null @@ -1,103 +0,0 @@ - -/** - * \addtogroup smtp - * @{ - */ - - -/** - * \file - * SMTP header file - * \author Adam Dunkels - */ - -/* - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: smtp.h,v 1.4 2006/06/11 21:46:37 adam Exp $ - * - */ -#ifndef __SMTP_H__ -#define __SMTP_H__ - -#include "uipopt.h" - -/** - * Error number that signifies a non-error condition. - */ -#define SMTP_ERR_OK 0 - -/** - * Callback function that is called when an e-mail transmission is - * done. - * - * This function must be implemented by the module that uses the SMTP - * module. - * - * \param error The number of the error if an error occured, or - * SMTP_ERR_OK. - */ -void smtp_done(unsigned char error); - -void smtp_init(void); - -/* Functions. */ -void smtp_configure(char *localhostname, u16_t *smtpserver); -unsigned char smtp_send(char *to, char *from, - char *subject, char *msg, - u16_t msglen); -#define SMTP_SEND(to, cc, from, subject, msg) \ - smtp_send(to, cc, from, subject, msg, strlen(msg)) - -void smtp_appcall(void); - -struct smtp_state { - u8_t state; - char *to; - char *from; - char *subject; - char *msg; - u16_t msglen; - - u16_t sentlen, textlen; - u16_t sendptr; - -}; - - -#ifndef UIP_APPCALL -#define UIP_APPCALL smtp_appcall -#endif -typedef struct smtp_state uip_tcp_appstate_t; - - -#endif /* __SMTP_H__ */ - -/** @} */ diff --git a/components/net/uip/apps/telnetd/Makefile.telnetd b/components/net/uip/apps/telnetd/Makefile.telnetd deleted file mode 100644 index afb1b593c8..0000000000 --- a/components/net/uip/apps/telnetd/Makefile.telnetd +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += telnetd.c shell.c memb.c diff --git a/components/net/uip/apps/telnetd/telnetd.c b/components/net/uip/apps/telnetd/telnetd.c deleted file mode 100644 index 7a5ae858d7..0000000000 --- a/components/net/uip/apps/telnetd/telnetd.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (c) 2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: telnetd.c,v 1.2 2006/06/07 09:43:54 adam Exp $ - * - */ - -#include "uip.h" -#include "telnetd.h" -#include "memb.h" -#include "shell.h" - -#include - -#define ISO_nl 0x0a -#define ISO_cr 0x0d - -struct telnetd_line { - char line[TELNETD_CONF_LINELEN]; -}; -MEMB(linemem, struct telnetd_line, TELNETD_CONF_NUMLINES); - -#define STATE_NORMAL 0 -#define STATE_IAC 1 -#define STATE_WILL 2 -#define STATE_WONT 3 -#define STATE_DO 4 -#define STATE_DONT 5 -#define STATE_CLOSE 6 - -static struct telnetd_state s; - -#define TELNET_IAC 255 -#define TELNET_WILL 251 -#define TELNET_WONT 252 -#define TELNET_DO 253 -#define TELNET_DONT 254 -/*---------------------------------------------------------------------------*/ -static char * -alloc_line(void) -{ - return memb_alloc(&linemem); -} -/*---------------------------------------------------------------------------*/ -static void -dealloc_line(char *line) -{ - memb_free(&linemem, line); -} -/*---------------------------------------------------------------------------*/ -void -shell_quit(char *str) -{ - s.state = STATE_CLOSE; -} -/*---------------------------------------------------------------------------*/ -static void -sendline(char *line) -{ - static unsigned int i; - - for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) { - if(s.lines[i] == NULL) { - s.lines[i] = line; - break; - } - } - if(i == TELNETD_CONF_NUMLINES) { - dealloc_line(line); - } -} -/*---------------------------------------------------------------------------*/ -void -shell_prompt(char *str) -{ - char *line; - line = alloc_line(); - if(line != NULL) { - strncpy(line, str, TELNETD_CONF_LINELEN); - /* petsciiconv_toascii(line, TELNETD_CONF_LINELEN);*/ - sendline(line); - } -} -/*---------------------------------------------------------------------------*/ -void -shell_output(char *str1, char *str2) -{ - static unsigned len; - char *line; - - line = alloc_line(); - if(line != NULL) { - len = strlen(str1); - strncpy(line, str1, TELNETD_CONF_LINELEN); - if(len < TELNETD_CONF_LINELEN) { - strncpy(line + len, str2, TELNETD_CONF_LINELEN - len); - } - len = strlen(line); - if(len < TELNETD_CONF_LINELEN - 2) { - line[len] = ISO_cr; - line[len+1] = ISO_nl; - line[len+2] = 0; - } - /* petsciiconv_toascii(line, TELNETD_CONF_LINELEN);*/ - sendline(line); - } -} -/*---------------------------------------------------------------------------*/ -void -telnetd_init(void) -{ - uip_listen(HTONS(23)); - memb_init(&linemem); - shell_init(); -} -/*---------------------------------------------------------------------------*/ -static void -acked(void) -{ - static unsigned int i; - - while(s.numsent > 0) { - dealloc_line(s.lines[0]); - for(i = 1; i < TELNETD_CONF_NUMLINES; ++i) { - s.lines[i - 1] = s.lines[i]; - } - s.lines[TELNETD_CONF_NUMLINES - 1] = NULL; - --s.numsent; - } -} -/*---------------------------------------------------------------------------*/ -static void -senddata(void) -{ - static char *bufptr, *lineptr; - static int buflen, linelen; - - bufptr = uip_appdata; - buflen = 0; - for(s.numsent = 0; s.numsent < TELNETD_CONF_NUMLINES && - s.lines[s.numsent] != NULL ; ++s.numsent) { - lineptr = s.lines[s.numsent]; - linelen = strlen(lineptr); - if(linelen > TELNETD_CONF_LINELEN) { - linelen = TELNETD_CONF_LINELEN; - } - if(buflen + linelen < uip_mss()) { - memcpy(bufptr, lineptr, linelen); - bufptr += linelen; - buflen += linelen; - } else { - break; - } - } - uip_send(uip_appdata, buflen); -} -/*---------------------------------------------------------------------------*/ -static void -closed(void) -{ - static unsigned int i; - - for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) { - if(s.lines[i] != NULL) { - dealloc_line(s.lines[i]); - } - } -} -/*---------------------------------------------------------------------------*/ -static void -get_char(u8_t c) -{ - if(c == ISO_cr) { - return; - } - - s.buf[(int)s.bufptr] = c; - if(s.buf[(int)s.bufptr] == ISO_nl || - s.bufptr == sizeof(s.buf) - 1) { - if(s.bufptr > 0) { - s.buf[(int)s.bufptr] = 0; - /* petsciiconv_topetscii(s.buf, TELNETD_CONF_LINELEN);*/ - } - shell_input(s.buf); - s.bufptr = 0; - } else { - ++s.bufptr; - } -} -/*---------------------------------------------------------------------------*/ -static void -sendopt(u8_t option, u8_t value) -{ - char *line; - line = alloc_line(); - if(line != NULL) { - line[0] = TELNET_IAC; - line[1] = option; - line[2] = value; - line[3] = 0; - sendline(line); - } -} -/*---------------------------------------------------------------------------*/ -static void -newdata(void) -{ - u16_t len; - u8_t c; - char *dataptr; - - - len = uip_datalen(); - dataptr = (char *)uip_appdata; - - while(len > 0 && s.bufptr < sizeof(s.buf)) { - c = *dataptr; - ++dataptr; - --len; - switch(s.state) { - case STATE_IAC: - if(c == TELNET_IAC) { - get_char(c); - s.state = STATE_NORMAL; - } else { - switch(c) { - case TELNET_WILL: - s.state = STATE_WILL; - break; - case TELNET_WONT: - s.state = STATE_WONT; - break; - case TELNET_DO: - s.state = STATE_DO; - break; - case TELNET_DONT: - s.state = STATE_DONT; - break; - default: - s.state = STATE_NORMAL; - break; - } - } - break; - case STATE_WILL: - /* Reply with a DONT */ - sendopt(TELNET_DONT, c); - s.state = STATE_NORMAL; - break; - - case STATE_WONT: - /* Reply with a DONT */ - sendopt(TELNET_DONT, c); - s.state = STATE_NORMAL; - break; - case STATE_DO: - /* Reply with a WONT */ - sendopt(TELNET_WONT, c); - s.state = STATE_NORMAL; - break; - case STATE_DONT: - /* Reply with a WONT */ - sendopt(TELNET_WONT, c); - s.state = STATE_NORMAL; - break; - case STATE_NORMAL: - if(c == TELNET_IAC) { - s.state = STATE_IAC; - } else { - get_char(c); - } - break; - } - - - } - -} -/*---------------------------------------------------------------------------*/ -void -telnetd_appcall(void) -{ - static unsigned int i; - if(uip_connected()) { - /* tcp_markconn(uip_conn, &s);*/ - for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) { - s.lines[i] = NULL; - } - s.bufptr = 0; - s.state = STATE_NORMAL; - - shell_start(); - } - - if(s.state == STATE_CLOSE) { - s.state = STATE_NORMAL; - uip_close(); - return; - } - - if(uip_closed() || - uip_aborted() || - uip_timedout()) { - closed(); - } - - if(uip_acked()) { - acked(); - } - - if(uip_newdata()) { - newdata(); - } - - if(uip_rexmit() || - uip_newdata() || - uip_acked() || - uip_connected() || - uip_poll()) { - senddata(); - } -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/apps/telnetd/telnetd.h b/components/net/uip/apps/telnetd/telnetd.h deleted file mode 100644 index 2ee8acdb2d..0000000000 --- a/components/net/uip/apps/telnetd/telnetd.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: telnetd.h,v 1.2 2006/06/07 09:43:54 adam Exp $ - * - */ -#ifndef __TELNETD_H__ -#define __TELNETD_H__ - -#include "uipopt.h" - -void telnetd_appcall(void); - -#ifndef TELNETD_CONF_LINELEN -#define TELNETD_CONF_LINELEN 40 -#endif -#ifndef TELNETD_CONF_NUMLINES -#define TELNETD_CONF_NUMLINES 16 -#endif - -struct telnetd_state { - char *lines[TELNETD_CONF_NUMLINES]; - char buf[TELNETD_CONF_LINELEN]; - char bufptr; - u8_t numsent; - u8_t state; -}; - -typedef struct telnetd_state uip_tcp_appstate_t; - -#ifndef UIP_APPCALL -#define UIP_APPCALL telnetd_appcall -#endif - -#endif /* __TELNETD_H__ */ diff --git a/components/net/uip/apps/telnetd/uip_shell.c b/components/net/uip/apps/telnetd/uip_shell.c deleted file mode 100644 index 0c43ae8e40..0000000000 --- a/components/net/uip/apps/telnetd/uip_shell.c +++ /dev/null @@ -1,123 +0,0 @@ - /* - * Copyright (c) 2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: shell.c,v 1.1 2006/06/07 09:43:54 adam Exp $ - * - */ - -#include "uip_shell.h" - -#include - -struct ptentry { - char *commandstr; - void (* pfunc)(char *str); -}; - -#define SHELL_PROMPT "uIP 1.0> " - -/*---------------------------------------------------------------------------*/ -static void -parse(register char *str, struct ptentry *t) -{ - struct ptentry *p; - for(p = t; p->commandstr != NULL; ++p) { - if(strncmp(p->commandstr, str, strlen(p->commandstr)) == 0) { - break; - } - } - - p->pfunc(str); -} -/*---------------------------------------------------------------------------*/ -static void -inttostr(register char *str, unsigned int i) -{ - str[0] = '0' + i / 100; - if(str[0] == '0') { - str[0] = ' '; - } - str[1] = '0' + (i / 10) % 10; - if(str[0] == ' ' && str[1] == '0') { - str[1] = ' '; - } - str[2] = '0' + i % 10; - str[3] = ' '; - str[4] = 0; -} -/*---------------------------------------------------------------------------*/ -static void -help(char *str) -{ - shell_output("Available commands:", ""); - shell_output("stats - show network statistics", ""); - shell_output("conn - show TCP connections", ""); - shell_output("help, ? - show help", ""); - shell_output("exit - exit shell", ""); -} -/*---------------------------------------------------------------------------*/ -static void -unknown(char *str) -{ - if(strlen(str) > 0) { - shell_output("Unknown command: ", str); - } -} -/*---------------------------------------------------------------------------*/ -static struct ptentry parsetab[] = - {{"stats", help}, - {"conn", help}, - {"help", help}, - {"exit", shell_quit}, - {"?", help}, - - /* Default action */ - {NULL, unknown}}; -/*---------------------------------------------------------------------------*/ -void -shell_init(void) -{ -} -/*---------------------------------------------------------------------------*/ -void -shell_start(void) -{ - shell_output("uIP command shell", ""); - shell_output("Type '?' and return for help", ""); - shell_prompt(SHELL_PROMPT); -} -/*---------------------------------------------------------------------------*/ -void -shell_input(char *cmd) -{ - parse(cmd, parsetab); - shell_prompt(SHELL_PROMPT); -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/apps/telnetd/uip_shell.h b/components/net/uip/apps/telnetd/uip_shell.h deleted file mode 100644 index b57d7be293..0000000000 --- a/components/net/uip/apps/telnetd/uip_shell.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * \file - * Interface for the Contiki shell. - * \author Adam Dunkels - * - * Some of the functions declared in this file must be implemented as - * a shell back-end in the architecture specific files of a Contiki - * port. - */ - - -/* - * Copyright (c) 2003, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the Contiki desktop OS. - * - * $Id: shell.h,v 1.1 2006/06/07 09:43:54 adam Exp $ - * - */ -#ifndef __SHELL_H__ -#define __SHELL_H__ - -/** - * Initialize the shell. - * - * Called when the shell front-end process starts. This function may - * be used to start listening for signals. - */ -void shell_init(void); - -/** - * Start the shell back-end. - * - * Called by the front-end when a new shell is started. - */ -void shell_start(void); - -/** - * Process a shell command. - * - * This function will be called by the shell GUI / telnet server whan - * a command has been entered that should be processed by the shell - * back-end. - * - * \param command The command to be processed. - */ -void shell_input(char *command); - -/** - * Quit the shell. - * - */ -void shell_quit(char *); - - -/** - * Print a string to the shell window. - * - * This function is implemented by the shell GUI / telnet server and - * can be called by the shell back-end to output a string in the - * shell window. The string is automatically appended with a linebreak. - * - * \param str1 The first half of the string to be output. - * \param str2 The second half of the string to be output. - */ -void shell_output(char *str1, char *str2); - -/** - * Print a prompt to the shell window. - * - * This function can be used by the shell back-end to print out a - * prompt to the shell window. - * - * \param prompt The prompt to be printed. - * - */ -void shell_prompt(char *prompt); - -#endif /* __SHELL_H__ */ diff --git a/components/net/uip/apps/webclient/Makefile.webclient b/components/net/uip/apps/webclient/Makefile.webclient deleted file mode 100644 index e6e7f0828a..0000000000 --- a/components/net/uip/apps/webclient/Makefile.webclient +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += webclient-strings.c webclient.c diff --git a/components/net/uip/apps/webclient/makestrings b/components/net/uip/apps/webclient/makestrings deleted file mode 100644 index 6dec075dd3..0000000000 --- a/components/net/uip/apps/webclient/makestrings +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/perl - - -sub stringify { - my $name = shift(@_); - open(OUTPUTC, "> $name.c"); - open(OUTPUTH, "> $name.h"); - - open(FILE, "$name"); - - while() { - if(/(.+) "(.+)"/) { - $var = $1; - $data = $2; - - $datan = $data; - $datan =~ s/\\r/\r/g; - $datan =~ s/\\n/\n/g; - $datan =~ s/\\01/\01/g; - $datan =~ s/\\0/\0/g; - - printf(OUTPUTC "const char $var\[%d] = \n", length($datan) + 1); - printf(OUTPUTC "/* \"$data\" */\n"); - printf(OUTPUTC "{"); - for($j = 0; $j < length($datan); $j++) { - printf(OUTPUTC "%#02x, ", unpack("C", substr($datan, $j, 1))); - } - printf(OUTPUTC "0 };\n"); - - printf(OUTPUTH "extern const char $var\[%d];\n", length($datan) + 1); - - } - } - close(OUTPUTC); - close(OUTPUTH); -} -stringify("webclient-strings"); - -exit 0; - diff --git a/components/net/uip/apps/webclient/webclient-strings b/components/net/uip/apps/webclient/webclient-strings deleted file mode 100644 index a331397238..0000000000 --- a/components/net/uip/apps/webclient/webclient-strings +++ /dev/null @@ -1,31 +0,0 @@ -http_http "http://" -http_200 "200 " -http_301 "301 " -http_302 "302 " -http_get "GET " -http_10 "HTTP/1.0" -http_11 "HTTP/1.1" -http_content_type "content-type: " -http_texthtml "text/html" -http_location "location: " -http_host "host: " -http_crnl "\r\n" -http_index_html "/index.html" -http_404_html "/404.html" -http_content_type_html "Content-type: text/html\r\n\r\n" -http_content_type_css "Content-type: text/css\r\n\r\n" -http_content_type_text "Content-type: text/text\r\n\r\n" -http_content_type_png "Content-type: image/png\r\n\r\n" -http_content_type_gif "Content-type: image/gif\r\n\r\n" -http_content_type_jpg "Content-type: image/jpeg\r\n\r\n" -http_content_type_binary "Content-type: application/octet-stream\r\n\r\n" -http_html ".html" -http_shtml ".shtml" -http_htm ".htm" -http_css ".css" -http_png ".png" -http_gif ".gif" -http_jpg ".jpg" -http_text ".text" -http_txt ".txt" -http_user_agent_fields "Connection: close\r\nUser-Agent: uIP/1.0 (; http://www.sics.se/~adam/uip/)\r\n\r\n" diff --git a/components/net/uip/apps/webclient/webclient-strings.c b/components/net/uip/apps/webclient/webclient-strings.c deleted file mode 100644 index 94723308e5..0000000000 --- a/components/net/uip/apps/webclient/webclient-strings.c +++ /dev/null @@ -1,93 +0,0 @@ -const char http_http[8] = -/* "http://" */ -{0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0 }; -const char http_200[5] = -/* "200 " */ -{0x32, 0x30, 0x30, 0x20, 0 }; -const char http_301[5] = -/* "301 " */ -{0x33, 0x30, 0x31, 0x20, 0 }; -const char http_302[5] = -/* "302 " */ -{0x33, 0x30, 0x32, 0x20, 0 }; -const char http_get[5] = -/* "GET " */ -{0x47, 0x45, 0x54, 0x20, 0 }; -const char http_10[9] = -/* "HTTP/1.0" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0 }; -const char http_11[9] = -/* "HTTP/1.1" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, 0 }; -const char http_content_type[15] = -/* "content-type: " */ -{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0 }; -const char http_texthtml[10] = -/* "text/html" */ -{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0 }; -const char http_location[11] = -/* "location: " */ -{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0 }; -const char http_host[7] = -/* "host: " */ -{0x68, 0x6f, 0x73, 0x74, 0x3a, 0x20, 0 }; -const char http_crnl[3] = -/* "\r\n" */ -{0xd, 0xa, 0 }; -const char http_index_html[12] = -/* "/index.html" */ -{0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0 }; -const char http_404_html[10] = -/* "/404.html" */ -{0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0 }; -const char http_content_type_html[28] = -/* "Content-type: text/html\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_content_type_css [27] = -/* "Content-type: text/css\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_content_type_text[28] = -/* "Content-type: text/text\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x65, 0x78, 0x74, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_content_type_png [28] = -/* "Content-type: image/png\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_content_type_gif [28] = -/* "Content-type: image/gif\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_content_type_jpg [29] = -/* "Content-type: image/jpeg\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x65, 0x67, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_content_type_binary[43] = -/* "Content-type: application/octet-stream\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xd, 0xa, 0xd, 0xa, 0 }; -const char http_html[6] = -/* ".html" */ -{0x2e, 0x68, 0x74, 0x6d, 0x6c, 0 }; -const char http_shtml[7] = -/* ".shtml" */ -{0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0 }; -const char http_htm[5] = -/* ".htm" */ -{0x2e, 0x68, 0x74, 0x6d, 0 }; -const char http_css[5] = -/* ".css" */ -{0x2e, 0x63, 0x73, 0x73, 0 }; -const char http_png[5] = -/* ".png" */ -{0x2e, 0x70, 0x6e, 0x67, 0 }; -const char http_gif[5] = -/* ".gif" */ -{0x2e, 0x67, 0x69, 0x66, 0 }; -const char http_jpg[5] = -/* ".jpg" */ -{0x2e, 0x6a, 0x70, 0x67, 0 }; -const char http_text[6] = -/* ".text" */ -{0x2e, 0x74, 0x65, 0x78, 0x74, 0 }; -const char http_txt[5] = -/* ".txt" */ -{0x2e, 0x74, 0x78, 0x74, 0 }; -const char http_user_agent_fields[77] = -/* "Connection: close\r\nUser-Agent: uIP/1.0 (; http://www.sics.se/~adam/uip/)\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x28, 0x3b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x7e, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69, 0x70, 0x2f, 0x29, 0xd, 0xa, 0xd, 0xa, 0 }; diff --git a/components/net/uip/apps/webclient/webclient-strings.h b/components/net/uip/apps/webclient/webclient-strings.h deleted file mode 100644 index 9e3ec93472..0000000000 --- a/components/net/uip/apps/webclient/webclient-strings.h +++ /dev/null @@ -1,31 +0,0 @@ -extern const char http_http[8]; -extern const char http_200[5]; -extern const char http_301[5]; -extern const char http_302[5]; -extern const char http_get[5]; -extern const char http_10[9]; -extern const char http_11[9]; -extern const char http_content_type[15]; -extern const char http_texthtml[10]; -extern const char http_location[11]; -extern const char http_host[7]; -extern const char http_crnl[3]; -extern const char http_index_html[12]; -extern const char http_404_html[10]; -extern const char http_content_type_html[28]; -extern const char http_content_type_css [27]; -extern const char http_content_type_text[28]; -extern const char http_content_type_png [28]; -extern const char http_content_type_gif [28]; -extern const char http_content_type_jpg [29]; -extern const char http_content_type_binary[43]; -extern const char http_html[6]; -extern const char http_shtml[7]; -extern const char http_htm[5]; -extern const char http_css[5]; -extern const char http_png[5]; -extern const char http_gif[5]; -extern const char http_jpg[5]; -extern const char http_text[6]; -extern const char http_txt[5]; -extern const char http_user_agent_fields[77]; diff --git a/components/net/uip/apps/webclient/webclient.c b/components/net/uip/apps/webclient/webclient.c deleted file mode 100644 index 746c008c33..0000000000 --- a/components/net/uip/apps/webclient/webclient.c +++ /dev/null @@ -1,439 +0,0 @@ -/** - * \addtogroup apps - * @{ - */ - -/** - * \defgroup webclient Web client - * @{ - * - * This example shows a HTTP client that is able to download web pages - * and files from web servers. It requires a number of callback - * functions to be implemented by the module that utilizes the code: - * webclient_datahandler(), webclient_connected(), - * webclient_timedout(), webclient_aborted(), webclient_closed(). - */ - -/** - * \file - * Implementation of the HTTP client. - * \author Adam Dunkels - */ - -/* - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: webclient.c,v 1.2 2006/06/11 21:46:37 adam Exp $ - * - */ - -#include "uip.h" -#include "uiplib.h" -#include "webclient.h" -#include "resolv.h" - -#include - -#define WEBCLIENT_TIMEOUT 100 - -#define WEBCLIENT_STATE_STATUSLINE 0 -#define WEBCLIENT_STATE_HEADERS 1 -#define WEBCLIENT_STATE_DATA 2 -#define WEBCLIENT_STATE_CLOSE 3 - -#define HTTPFLAG_NONE 0 -#define HTTPFLAG_OK 1 -#define HTTPFLAG_MOVED 2 -#define HTTPFLAG_ERROR 3 - - -#define ISO_nl 0x0a -#define ISO_cr 0x0d -#define ISO_space 0x20 - - -static struct webclient_state s; - -/*-----------------------------------------------------------------------------------*/ -char * -webclient_mimetype(void) -{ - return s.mimetype; -} -/*-----------------------------------------------------------------------------------*/ -char * -webclient_filename(void) -{ - return s.file; -} -/*-----------------------------------------------------------------------------------*/ -char * -webclient_hostname(void) -{ - return s.host; -} -/*-----------------------------------------------------------------------------------*/ -unsigned short -webclient_port(void) -{ - return s.port; -} -/*-----------------------------------------------------------------------------------*/ -void -webclient_init(void) -{ - -} -/*-----------------------------------------------------------------------------------*/ -static void -init_connection(void) -{ - s.state = WEBCLIENT_STATE_STATUSLINE; - - s.getrequestleft = sizeof(http_get) - 1 + 1 + - sizeof(http_10) - 1 + - sizeof(http_crnl) - 1 + - sizeof(http_host) - 1 + - sizeof(http_crnl) - 1 + - strlen(http_user_agent_fields) + - strlen(s.file) + strlen(s.host); - s.getrequestptr = 0; - - s.httpheaderlineptr = 0; -} -/*-----------------------------------------------------------------------------------*/ -void -webclient_close(void) -{ - s.state = WEBCLIENT_STATE_CLOSE; -} -/*-----------------------------------------------------------------------------------*/ -unsigned char -webclient_get(char *host, u16_t port, char *file) -{ - struct uip_conn *conn; - uip_ipaddr_t *ipaddr; - static uip_ipaddr_t addr; - - /* First check if the host is an IP address. */ - ipaddr = &addr; - if(uiplib_ipaddrconv(host, (unsigned char *)addr) == 0) { - ipaddr = (uip_ipaddr_t *)resolv_lookup(host); - - if(ipaddr == NULL) { - return 0; - } - } - - conn = uip_connect(ipaddr, htons(port)); - - if(conn == NULL) { - return 0; - } - - s.port = port; - strncpy(s.file, file, sizeof(s.file)); - strncpy(s.host, host, sizeof(s.host)); - - init_connection(); - return 1; -} -/*-----------------------------------------------------------------------------------*/ -static unsigned char * -copy_string(unsigned char *dest, - const unsigned char *src, unsigned char len) -{ - strncpy(dest, src, len); - return dest + len; -} -/*-----------------------------------------------------------------------------------*/ -static void -senddata(void) -{ - u16_t len; - char *getrequest; - char *cptr; - - if(s.getrequestleft > 0) { - cptr = getrequest = (char *)uip_appdata; - - cptr = copy_string(cptr, http_get, sizeof(http_get) - 1); - cptr = copy_string(cptr, s.file, strlen(s.file)); - *cptr++ = ISO_space; - cptr = copy_string(cptr, http_10, sizeof(http_10) - 1); - - cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1); - - cptr = copy_string(cptr, http_host, sizeof(http_host) - 1); - cptr = copy_string(cptr, s.host, strlen(s.host)); - cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1); - - cptr = copy_string(cptr, http_user_agent_fields, - strlen(http_user_agent_fields)); - - len = s.getrequestleft > uip_mss()? - uip_mss(): - s.getrequestleft; - uip_send(&(getrequest[s.getrequestptr]), len); - } -} -/*-----------------------------------------------------------------------------------*/ -static void -acked(void) -{ - u16_t len; - - if(s.getrequestleft > 0) { - len = s.getrequestleft > uip_mss()? - uip_mss(): - s.getrequestleft; - s.getrequestleft -= len; - s.getrequestptr += len; - } -} -/*-----------------------------------------------------------------------------------*/ -static u16_t -parse_statusline(u16_t len) -{ - char *cptr; - - while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) { - s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata; - ++((char *)uip_appdata); - --len; - if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) { - - if((strncmp(s.httpheaderline, http_10, - sizeof(http_10) - 1) == 0) || - (strncmp(s.httpheaderline, http_11, - sizeof(http_11) - 1) == 0)) { - cptr = &(s.httpheaderline[9]); - s.httpflag = HTTPFLAG_NONE; - if(strncmp(cptr, http_200, sizeof(http_200) - 1) == 0) { - /* 200 OK */ - s.httpflag = HTTPFLAG_OK; - } else if(strncmp(cptr, http_301, sizeof(http_301) - 1) == 0 || - strncmp(cptr, http_302, sizeof(http_302) - 1) == 0) { - /* 301 Moved permanently or 302 Found. Location: header line - will contain thw new location. */ - s.httpflag = HTTPFLAG_MOVED; - } else { - s.httpheaderline[s.httpheaderlineptr - 1] = 0; - } - } else { - uip_abort(); - webclient_aborted(); - return 0; - } - - /* We're done parsing the status line, so we reset the pointer - and start parsing the HTTP headers.*/ - s.httpheaderlineptr = 0; - s.state = WEBCLIENT_STATE_HEADERS; - break; - } else { - ++s.httpheaderlineptr; - } - } - return len; -} -/*-----------------------------------------------------------------------------------*/ -static char -casecmp(char *str1, const char *str2, char len) -{ - static char c; - - while(len > 0) { - c = *str1; - /* Force lower-case characters. */ - if(c & 0x40) { - c |= 0x20; - } - if(*str2 != c) { - return 1; - } - ++str1; - ++str2; - --len; - } - return 0; -} -/*-----------------------------------------------------------------------------------*/ -static u16_t -parse_headers(u16_t len) -{ - char *cptr; - static unsigned char i; - - while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) { - s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata; - ++((char *)uip_appdata); - --len; - if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) { - /* We have an entire HTTP header line in s.httpheaderline, so - we parse it. */ - if(s.httpheaderline[0] == ISO_cr) { - /* This was the last header line (i.e., and empty "\r\n"), so - we are done with the headers and proceed with the actual - data. */ - s.state = WEBCLIENT_STATE_DATA; - return len; - } - - s.httpheaderline[s.httpheaderlineptr - 1] = 0; - /* Check for specific HTTP header fields. */ - if(casecmp(s.httpheaderline, http_content_type, - sizeof(http_content_type) - 1) == 0) { - /* Found Content-type field. */ - cptr = strchr(s.httpheaderline, ';'); - if(cptr != NULL) { - *cptr = 0; - } - strncpy(s.mimetype, s.httpheaderline + - sizeof(http_content_type) - 1, sizeof(s.mimetype)); - } else if(casecmp(s.httpheaderline, http_location, - sizeof(http_location) - 1) == 0) { - cptr = s.httpheaderline + - sizeof(http_location) - 1; - - if(strncmp(cptr, http_http, 7) == 0) { - cptr += 7; - for(i = 0; i < s.httpheaderlineptr - 7; ++i) { - if(*cptr == 0 || - *cptr == '/' || - *cptr == ' ' || - *cptr == ':') { - s.host[i] = 0; - break; - } - s.host[i] = *cptr; - ++cptr; - } - } - strncpy(s.file, cptr, sizeof(s.file)); - /* s.file[s.httpheaderlineptr - i] = 0;*/ - } - - - /* We're done parsing, so we reset the pointer and start the - next line. */ - s.httpheaderlineptr = 0; - } else { - ++s.httpheaderlineptr; - } - } - return len; -} -/*-----------------------------------------------------------------------------------*/ -static void -newdata(void) -{ - u16_t len; - - len = uip_datalen(); - - if(s.state == WEBCLIENT_STATE_STATUSLINE) { - len = parse_statusline(len); - } - - if(s.state == WEBCLIENT_STATE_HEADERS && len > 0) { - len = parse_headers(len); - } - - if(len > 0 && s.state == WEBCLIENT_STATE_DATA && - s.httpflag != HTTPFLAG_MOVED) { - webclient_datahandler((char *)uip_appdata, len); - } -} -/*-----------------------------------------------------------------------------------*/ -void -webclient_appcall(void) -{ - if(uip_connected()) { - s.timer = 0; - s.state = WEBCLIENT_STATE_STATUSLINE; - senddata(); - webclient_connected(); - return; - } - - if(s.state == WEBCLIENT_STATE_CLOSE) { - webclient_closed(); - uip_abort(); - return; - } - - if(uip_aborted()) { - webclient_aborted(); - } - if(uip_timedout()) { - webclient_timedout(); - } - - - if(uip_acked()) { - s.timer = 0; - acked(); - } - if(uip_newdata()) { - s.timer = 0; - newdata(); - } - if(uip_rexmit() || - uip_newdata() || - uip_acked()) { - senddata(); - } else if(uip_poll()) { - ++s.timer; - if(s.timer == WEBCLIENT_TIMEOUT) { - webclient_timedout(); - uip_abort(); - return; - } - /* senddata();*/ - } - - if(uip_closed()) { - if(s.httpflag != HTTPFLAG_MOVED) { - /* Send NULL data to signal EOF. */ - webclient_datahandler(NULL, 0); - } else { - if(resolv_lookup(s.host) == NULL) { - resolv_query(s.host); - } - webclient_get(s.host, s.port, s.file); - } - } -} -/*-----------------------------------------------------------------------------------*/ - -/** @} */ -/** @} */ diff --git a/components/net/uip/apps/webclient/webclient.h b/components/net/uip/apps/webclient/webclient.h deleted file mode 100644 index 44cb95caf8..0000000000 --- a/components/net/uip/apps/webclient/webclient.h +++ /dev/null @@ -1,228 +0,0 @@ -/** - * \addtogroup webclient - * @{ - */ - -/** - * \file - * Header file for the HTTP client. - * \author Adam Dunkels - */ - -/* - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: webclient.h,v 1.2 2006/06/11 21:46:37 adam Exp $ - * - */ -#ifndef __WEBCLIENT_H__ -#define __WEBCLIENT_H__ - - -#include "webclient-strings.h" -#include "uipopt.h" - -#define WEBCLIENT_CONF_MAX_URLLEN 100 - -struct webclient_state { - u8_t timer; - u8_t state; - u8_t httpflag; - - u16_t port; - char host[40]; - char file[WEBCLIENT_CONF_MAX_URLLEN]; - u16_t getrequestptr; - u16_t getrequestleft; - - char httpheaderline[200]; - u16_t httpheaderlineptr; - - char mimetype[32]; -}; - -typedef struct webclient_state uip_tcp_appstate_t; -#define UIP_APPCALL webclient_appcall - -/** - * Callback function that is called from the webclient code when HTTP - * data has been received. - * - * This function must be implemented by the module that uses the - * webclient code. The function is called from the webclient module - * when HTTP data has been received. The function is not called when - * HTTP headers are received, only for the actual data. - * - * \note This function is called many times, repetedly, when data is - * being received, and not once when all data has been received. - * - * \param data A pointer to the data that has been received. - * \param len The length of the data that has been received. - */ -void webclient_datahandler(char *data, u16_t len); - -/** - * Callback function that is called from the webclient code when the - * HTTP connection has been connected to the web server. - * - * This function must be implemented by the module that uses the - * webclient code. - */ -void webclient_connected(void); - -/** - * Callback function that is called from the webclient code if the - * HTTP connection to the web server has timed out. - * - * This function must be implemented by the module that uses the - * webclient code. - */ -void webclient_timedout(void); - -/** - * Callback function that is called from the webclient code if the - * HTTP connection to the web server has been aborted by the web - * server. - * - * This function must be implemented by the module that uses the - * webclient code. - */ -void webclient_aborted(void); - -/** - * Callback function that is called from the webclient code when the - * HTTP connection to the web server has been closed. - * - * This function must be implemented by the module that uses the - * webclient code. - */ -void webclient_closed(void); - - - -/** - * Initialize the webclient module. - */ -void webclient_init(void); - -/** - * Open an HTTP connection to a web server and ask for a file using - * the GET method. - * - * This function opens an HTTP connection to the specified web server - * and requests the specified file using the GET method. When the HTTP - * connection has been connected, the webclient_connected() callback - * function is called and when the HTTP data arrives the - * webclient_datahandler() callback function is called. - * - * The callback function webclient_timedout() is called if the web - * server could not be contacted, and the webclient_aborted() callback - * function is called if the HTTP connection is aborted by the web - * server. - * - * When the HTTP request has been completed and the HTTP connection is - * closed, the webclient_closed() callback function will be called. - * - * \note If the function is passed a host name, it must already be in - * the resolver cache in order for the function to connect to the web - * server. It is therefore up to the calling module to implement the - * resolver calls and the signal handler used for reporting a resolv - * query answer. - * - * \param host A pointer to a string containing either a host name or - * a numerical IP address in dotted decimal notation (e.g., 192.168.23.1). - * - * \param port The port number to which to connect, in host byte order. - * - * \param file A pointer to the name of the file to get. - * - * \retval 0 if the host name could not be found in the cache, or - * if a TCP connection could not be created. - * - * \retval 1 if the connection was initiated. - */ -unsigned char webclient_get(char *host, u16_t port, char *file); - -/** - * Close the currently open HTTP connection. - */ -void webclient_close(void); -void webclient_appcall(void); - -/** - * Obtain the MIME type of the current HTTP data stream. - * - * \return A pointer to a string contaning the MIME type. The string - * may be empty if no MIME type was reported by the web server. - */ -char *webclient_mimetype(void); - -/** - * Obtain the filename of the current HTTP data stream. - * - * The filename of an HTTP request may be changed by the web server, - * and may therefore not be the same as when the original GET request - * was made with webclient_get(). This function is used for obtaining - * the current filename. - * - * \return A pointer to the current filename. - */ -char *webclient_filename(void); - -/** - * Obtain the hostname of the current HTTP data stream. - * - * The hostname of the web server of an HTTP request may be changed - * by the web server, and may therefore not be the same as when the - * original GET request was made with webclient_get(). This function - * is used for obtaining the current hostname. - * - * \return A pointer to the current hostname. - */ -char *webclient_hostname(void); - -/** - * Obtain the port number of the current HTTP data stream. - * - * The port number of an HTTP request may be changed by the web - * server, and may therefore not be the same as when the original GET - * request was made with webclient_get(). This function is used for - * obtaining the current port number. - * - * \return The port number of the current HTTP data stream, in host byte order. - */ -unsigned short webclient_port(void); - - - -#endif /* __WEBCLIENT_H__ */ - -/** @} */ diff --git a/components/net/uip/apps/webserver/Makefile.webserver b/components/net/uip/apps/webserver/Makefile.webserver deleted file mode 100644 index 7d3e086955..0000000000 --- a/components/net/uip/apps/webserver/Makefile.webserver +++ /dev/null @@ -1 +0,0 @@ -APP_SOURCES += httpd.c http-strings.c httpd-fs.c httpd-cgi.c diff --git a/components/net/uip/apps/webserver/http-strings b/components/net/uip/apps/webserver/http-strings deleted file mode 100644 index d0b9121be8..0000000000 --- a/components/net/uip/apps/webserver/http-strings +++ /dev/null @@ -1,35 +0,0 @@ -http_http "http://" -http_200 "200 " -http_301 "301 " -http_302 "302 " -http_get "GET " -http_10 "HTTP/1.0" -http_11 "HTTP/1.1" -http_content_type "content-type: " -http_texthtml "text/html" -http_location "location: " -http_host "host: " -http_crnl "\r\n" -http_index_html "/index.html" -http_404_html "/404.html" -http_referer "Referer:" -http_header_200 "HTTP/1.0 200 OK\r\nServer: uIP/1.0 http://www.sics.se/~adam/uip/\r\nConnection: close\r\n" -http_header_404 "HTTP/1.0 404 Not found\r\nServer: uIP/1.0 http://www.sics.se/~adam/uip/\r\nConnection: close\r\n" -http_content_type_plain "Content-type: text/plain\r\n\r\n" -http_content_type_html "Content-type: text/html\r\n\r\n" -http_content_type_css "Content-type: text/css\r\n\r\n" -http_content_type_text "Content-type: text/text\r\n\r\n" -http_content_type_png "Content-type: image/png\r\n\r\n" -http_content_type_gif "Content-type: image/gif\r\n\r\n" -http_content_type_jpg "Content-type: image/jpeg\r\n\r\n" -http_content_type_binary "Content-type: application/octet-stream\r\n\r\n" -http_html ".html" -http_shtml ".shtml" -http_htm ".htm" -http_css ".css" -http_png ".png" -http_gif ".gif" -http_jpg ".jpg" -http_text ".txt" -http_txt ".txt" - diff --git a/components/net/uip/apps/webserver/http-strings.c b/components/net/uip/apps/webserver/http-strings.c deleted file mode 100644 index 0d822baf7e..0000000000 --- a/components/net/uip/apps/webserver/http-strings.c +++ /dev/null @@ -1,102 +0,0 @@ -const char http_http[8] = -/* "http://" */ -{0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, }; -const char http_200[5] = -/* "200 " */ -{0x32, 0x30, 0x30, 0x20, }; -const char http_301[5] = -/* "301 " */ -{0x33, 0x30, 0x31, 0x20, }; -const char http_302[5] = -/* "302 " */ -{0x33, 0x30, 0x32, 0x20, }; -const char http_get[5] = -/* "GET " */ -{0x47, 0x45, 0x54, 0x20, }; -const char http_10[9] = -/* "HTTP/1.0" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, }; -const char http_11[9] = -/* "HTTP/1.1" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31, }; -const char http_content_type[15] = -/* "content-type: " */ -{0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, }; -const char http_texthtml[10] = -/* "text/html" */ -{0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, }; -const char http_location[11] = -/* "location: " */ -{0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, }; -const char http_host[7] = -/* "host: " */ -{0x68, 0x6f, 0x73, 0x74, 0x3a, 0x20, }; -const char http_crnl[3] = -/* "\r\n" */ -{0xd, 0xa, }; -const char http_index_html[12] = -/* "/index.html" */ -{0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, }; -const char http_404_html[10] = -/* "/404.html" */ -{0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, }; -const char http_referer[9] = -/* "Referer:" */ -{0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x3a, }; -const char http_header_200[84] = -/* "HTTP/1.0 200 OK\r\nServer: uIP/1.0 http://www.sics.se/~adam/uip/\r\nConnection: close\r\n" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x7e, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69, 0x70, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; -const char http_header_404[91] = -/* "HTTP/1.0 404 Not found\r\nServer: uIP/1.0 http://www.sics.se/~adam/uip/\r\nConnection: close\r\n" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x7e, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69, 0x70, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; -const char http_content_type_plain[29] = -/* "Content-type: text/plain\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_html[28] = -/* "Content-type: text/html\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_css [27] = -/* "Content-type: text/css\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_text[28] = -/* "Content-type: text/text\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x74, 0x65, 0x78, 0x74, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_png [28] = -/* "Content-type: image/png\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_gif [28] = -/* "Content-type: image/gif\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_jpg [29] = -/* "Content-type: image/jpeg\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x65, 0x67, 0xd, 0xa, 0xd, 0xa, }; -const char http_content_type_binary[43] = -/* "Content-type: application/octet-stream\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xd, 0xa, 0xd, 0xa, }; -const char http_html[6] = -/* ".html" */ -{0x2e, 0x68, 0x74, 0x6d, 0x6c, }; -const char http_shtml[7] = -/* ".shtml" */ -{0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, }; -const char http_htm[5] = -/* ".htm" */ -{0x2e, 0x68, 0x74, 0x6d, }; -const char http_css[5] = -/* ".css" */ -{0x2e, 0x63, 0x73, 0x73, }; -const char http_png[5] = -/* ".png" */ -{0x2e, 0x70, 0x6e, 0x67, }; -const char http_gif[5] = -/* ".gif" */ -{0x2e, 0x67, 0x69, 0x66, }; -const char http_jpg[5] = -/* ".jpg" */ -{0x2e, 0x6a, 0x70, 0x67, }; -const char http_text[5] = -/* ".txt" */ -{0x2e, 0x74, 0x78, 0x74, }; -const char http_txt[5] = -/* ".txt" */ -{0x2e, 0x74, 0x78, 0x74, }; diff --git a/components/net/uip/apps/webserver/http-strings.h b/components/net/uip/apps/webserver/http-strings.h deleted file mode 100644 index f121dd73a8..0000000000 --- a/components/net/uip/apps/webserver/http-strings.h +++ /dev/null @@ -1,34 +0,0 @@ -extern const char http_http[8]; -extern const char http_200[5]; -extern const char http_301[5]; -extern const char http_302[5]; -extern const char http_get[5]; -extern const char http_10[9]; -extern const char http_11[9]; -extern const char http_content_type[15]; -extern const char http_texthtml[10]; -extern const char http_location[11]; -extern const char http_host[7]; -extern const char http_crnl[3]; -extern const char http_index_html[12]; -extern const char http_404_html[10]; -extern const char http_referer[9]; -extern const char http_header_200[84]; -extern const char http_header_404[91]; -extern const char http_content_type_plain[29]; -extern const char http_content_type_html[28]; -extern const char http_content_type_css [27]; -extern const char http_content_type_text[28]; -extern const char http_content_type_png [28]; -extern const char http_content_type_gif [28]; -extern const char http_content_type_jpg [29]; -extern const char http_content_type_binary[43]; -extern const char http_html[6]; -extern const char http_shtml[7]; -extern const char http_htm[5]; -extern const char http_css[5]; -extern const char http_png[5]; -extern const char http_gif[5]; -extern const char http_jpg[5]; -extern const char http_text[5]; -extern const char http_txt[5]; diff --git a/components/net/uip/apps/webserver/httpd-cgi.c b/components/net/uip/apps/webserver/httpd-cgi.c deleted file mode 100644 index 62570359fb..0000000000 --- a/components/net/uip/apps/webserver/httpd-cgi.c +++ /dev/null @@ -1,203 +0,0 @@ -/** - * \addtogroup httpd - * @{ - */ - -/** - * \file - * Web server script interface - * \author - * Adam Dunkels - * - */ - -/* - * Copyright (c) 2001-2006, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: httpd-cgi.c,v 1.2 2006/06/11 21:46:37 adam Exp $ - * - */ - -#include "uip.h" -#include "psock.h" -#include "httpd.h" -#include "httpd-cgi.h" -#include "httpd-fs.h" - -#include -#include - -HTTPD_CGI_CALL(file, "file-stats", file_stats); -HTTPD_CGI_CALL(tcp, "tcp-connections", tcp_stats); -HTTPD_CGI_CALL(net, "net-stats", net_stats); - -static const struct httpd_cgi_call *calls[] = { &file, &tcp, &net, NULL }; - -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(nullfunction(struct httpd_state *s, char *ptr)) -{ - PSOCK_BEGIN(&s->sout); - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -httpd_cgifunction -httpd_cgi(char *name) -{ - const struct httpd_cgi_call **f; - - /* Find the matching name in the table, return the function. */ - for(f = calls; *f != NULL; ++f) { - if(strncmp((*f)->name, name, strlen((*f)->name)) == 0) { - return (*f)->function; - } - } - return nullfunction; -} -/*---------------------------------------------------------------------------*/ -static unsigned short -generate_file_stats(void *arg) -{ - char *f = (char *)arg; - return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f)); -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(file_stats(struct httpd_state *s, char *ptr)) -{ - PSOCK_BEGIN(&s->sout); - - PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1); - - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -static const char closed[] = /* "CLOSED",*/ -{0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0}; -static const char syn_rcvd[] = /* "SYN-RCVD",*/ -{0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56, - 0x44, 0}; -static const char syn_sent[] = /* "SYN-SENT",*/ -{0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e, - 0x54, 0}; -static const char established[] = /* "ESTABLISHED",*/ -{0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48, - 0x45, 0x44, 0}; -static const char fin_wait_1[] = /* "FIN-WAIT-1",*/ -{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49, - 0x54, 0x2d, 0x31, 0}; -static const char fin_wait_2[] = /* "FIN-WAIT-2",*/ -{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49, - 0x54, 0x2d, 0x32, 0}; -static const char closing[] = /* "CLOSING",*/ -{0x43, 0x4c, 0x4f, 0x53, 0x49, - 0x4e, 0x47, 0}; -static const char time_wait[] = /* "TIME-WAIT,"*/ -{0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41, - 0x49, 0x54, 0}; -static const char last_ack[] = /* "LAST-ACK"*/ -{0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43, - 0x4b, 0}; - -static const char *states[] = { - closed, - syn_rcvd, - syn_sent, - established, - fin_wait_1, - fin_wait_2, - closing, - time_wait, - last_ack}; - - -static unsigned short -generate_tcp_stats(void *arg) -{ - struct uip_conn *conn; - struct httpd_state *s = (struct httpd_state *)arg; - - conn = &uip_conns[s->count]; - return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, - "%d%u.%u.%u.%u:%u%s%u%u%c %c\r\n", - htons(conn->lport), - htons(conn->ripaddr[0]) >> 8, - htons(conn->ripaddr[0]) & 0xff, - htons(conn->ripaddr[1]) >> 8, - htons(conn->ripaddr[1]) & 0xff, - htons(conn->rport), - states[conn->tcpstateflags & UIP_TS_MASK], - conn->nrtx, - conn->timer, - (uip_outstanding(conn))? '*':' ', - (uip_stopped(conn))? '!':' '); -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr)) -{ - - PSOCK_BEGIN(&s->sout); - - for(s->count = 0; s->count < UIP_CONNS; ++s->count) { - if((uip_conns[s->count].tcpstateflags & UIP_TS_MASK) != UIP_CLOSED) { - PSOCK_GENERATOR_SEND(&s->sout, generate_tcp_stats, s); - } - } - - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -static unsigned short -generate_net_stats(void *arg) -{ - struct httpd_state *s = (struct httpd_state *)arg; - return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, - "%5u\n", ((uip_stats_t *)&uip_stat)[s->count]); -} - -static -PT_THREAD(net_stats(struct httpd_state *s, char *ptr)) -{ - PSOCK_BEGIN(&s->sout); - -#if UIP_STATISTICS - - for(s->count = 0; s->count < sizeof(uip_stat) / sizeof(uip_stats_t); - ++s->count) { - PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s); - } - -#endif /* UIP_STATISTICS */ - - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -/** @} */ diff --git a/components/net/uip/apps/webserver/httpd-cgi.h b/components/net/uip/apps/webserver/httpd-cgi.h deleted file mode 100644 index e6ba51e73e..0000000000 --- a/components/net/uip/apps/webserver/httpd-cgi.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * \addtogroup httpd - * @{ - */ - -/** - * \file - * Web server script interface header file - * \author - * Adam Dunkels - * - */ - - - -/* - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: httpd-cgi.h,v 1.2 2006/06/11 21:46:38 adam Exp $ - * - */ - -#ifndef __HTTPD_CGI_H__ -#define __HTTPD_CGI_H__ - -#include "psock.h" -#include "httpd.h" - -typedef PT_THREAD((* httpd_cgifunction)(struct httpd_state *, char *)); - -httpd_cgifunction httpd_cgi(char *name); - -struct httpd_cgi_call { - const char *name; - const httpd_cgifunction function; -}; - -/** - * \brief HTTPD CGI function declaration - * \param name The C variable name of the function - * \param str The string name of the function, used in the script file - * \param function A pointer to the function that implements it - * - * This macro is used for declaring a HTTPD CGI - * function. This function is then added to the list of - * HTTPD CGI functions with the httpd_cgi_add() function. - * - * \hideinitializer - */ -#define HTTPD_CGI_CALL(name, str, function) \ -static PT_THREAD(function(struct httpd_state *, char *)); \ -static const struct httpd_cgi_call name = {str, function} - -void httpd_cgi_init(void); -#endif /* __HTTPD_CGI_H__ */ - -/** @} */ diff --git a/components/net/uip/apps/webserver/httpd-fs.c b/components/net/uip/apps/webserver/httpd-fs.c deleted file mode 100644 index 21185e87c7..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - * $Id: httpd-fs.c,v 1.1 2006/06/07 09:13:08 adam Exp $ - */ - -#include "httpd.h" -#include "httpd-fs.h" -#include "httpd-fsdata.h" - -#ifndef NULL -#define NULL 0 -#endif /* NULL */ - -#include "httpd-fsdata.c" - -#if HTTPD_FS_STATISTICS -static u16_t count[HTTPD_FS_NUMFILES]; -#endif /* HTTPD_FS_STATISTICS */ - -/*-----------------------------------------------------------------------------------*/ -static u8_t -httpd_fs_strcmp(const char *str1, const char *str2) -{ - u8_t i; - i = 0; - loop: - - if(str2[i] == 0 || - str1[i] == '\r' || - str1[i] == '\n') { - return 0; - } - - if(str1[i] != str2[i]) { - return 1; - } - - - ++i; - goto loop; -} -/*-----------------------------------------------------------------------------------*/ -int -httpd_fs_open(const char *name, struct httpd_fs_file *file) -{ -#if HTTPD_FS_STATISTICS - u16_t i = 0; -#endif /* HTTPD_FS_STATISTICS */ - struct httpd_fsdata_file_noconst *f; - - for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; - f != NULL; - f = (struct httpd_fsdata_file_noconst *)f->next) { - - if(httpd_fs_strcmp(name, f->name) == 0) { - file->data = f->data; - file->len = f->len; -#if HTTPD_FS_STATISTICS - ++count[i]; -#endif /* HTTPD_FS_STATISTICS */ - return 1; - } -#if HTTPD_FS_STATISTICS - ++i; -#endif /* HTTPD_FS_STATISTICS */ - - } - return 0; -} -/*-----------------------------------------------------------------------------------*/ -void -httpd_fs_init(void) -{ -#if HTTPD_FS_STATISTICS - u16_t i; - for(i = 0; i < HTTPD_FS_NUMFILES; i++) { - count[i] = 0; - } -#endif /* HTTPD_FS_STATISTICS */ -} -/*-----------------------------------------------------------------------------------*/ -#if HTTPD_FS_STATISTICS -u16_t httpd_fs_count -(char *name) -{ - struct httpd_fsdata_file_noconst *f; - u16_t i; - - i = 0; - for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; - f != NULL; - f = (struct httpd_fsdata_file_noconst *)f->next) { - - if(httpd_fs_strcmp(name, f->name) == 0) { - return count[i]; - } - ++i; - } - return 0; -} -#endif /* HTTPD_FS_STATISTICS */ -/*-----------------------------------------------------------------------------------*/ diff --git a/components/net/uip/apps/webserver/httpd-fs.h b/components/net/uip/apps/webserver/httpd-fs.h deleted file mode 100644 index d80ed3dff0..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - * $Id: httpd-fs.h,v 1.1 2006/06/07 09:13:08 adam Exp $ - */ -#ifndef __HTTPD_FS_H__ -#define __HTTPD_FS_H__ - -#define HTTPD_FS_STATISTICS 1 - -struct httpd_fs_file { - char *data; - int len; -}; - -/* file must be allocated by caller and will be filled in - by the function. */ -int httpd_fs_open(const char *name, struct httpd_fs_file *file); - -#ifdef HTTPD_FS_STATISTICS -#if HTTPD_FS_STATISTICS == 1 -u16_t httpd_fs_count(char *name); -#endif /* HTTPD_FS_STATISTICS */ -#endif /* HTTPD_FS_STATISTICS */ - -void httpd_fs_init(void); - -#endif /* __HTTPD_FS_H__ */ diff --git a/components/net/uip/apps/webserver/httpd-fs/404.html b/components/net/uip/apps/webserver/httpd-fs/404.html deleted file mode 100644 index a17711d02e..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/404.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/net/uip/apps/webserver/httpd-fs/fade.png b/components/net/uip/apps/webserver/httpd-fs/fade.png deleted file mode 100644 index a9e69f75de..0000000000 Binary files a/components/net/uip/apps/webserver/httpd-fs/fade.png and /dev/null differ diff --git a/components/net/uip/apps/webserver/httpd-fs/files.shtml b/components/net/uip/apps/webserver/httpd-fs/files.shtml deleted file mode 100644 index 811e230322..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/files.shtml +++ /dev/null @@ -1,35 +0,0 @@ -%!: /header.html -

File statistics

-
- - - - - - - - - - - - - - - -
/index.html%! file-stats /index.html -
/files.shtml%! file-stats /files.shtml -
/tcp.shtml%! file-stats /tcp.shtml -
/stats.shtml%! file-stats /stats.shtml -
/style.css%! file-stats /style.css -
/404.html%! file-stats /404.html -
/fade.png%! file-stats /fade.png -
-
-%!: /footer.html diff --git a/components/net/uip/apps/webserver/httpd-fs/footer.html b/components/net/uip/apps/webserver/httpd-fs/footer.html deleted file mode 100644 index 1fd5f4f290..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/footer.html +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/components/net/uip/apps/webserver/httpd-fs/header.html b/components/net/uip/apps/webserver/httpd-fs/header.html deleted file mode 100644 index 7b1a1fe7ee..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/header.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Welcome to the uIP web server! - - - - - - -
diff --git a/components/net/uip/apps/webserver/httpd-fs/index.html b/components/net/uip/apps/webserver/httpd-fs/index.html deleted file mode 100644 index 27cbc93f5a..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - Welcome to the uIP web server! - - - - - - -
-

- These web pages are served by a small web server running on top of - the uIP embedded TCP/IP - stack. -

-

- Click on the links above for web server statistics. -

- - - diff --git a/components/net/uip/apps/webserver/httpd-fs/processes.shtml b/components/net/uip/apps/webserver/httpd-fs/processes.shtml deleted file mode 100644 index 2f93e35902..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/processes.shtml +++ /dev/null @@ -1,5 +0,0 @@ -%!: /header.html -

System processes


- -%! processes -%!: /footer.html \ No newline at end of file diff --git a/components/net/uip/apps/webserver/httpd-fs/stats.shtml b/components/net/uip/apps/webserver/httpd-fs/stats.shtml deleted file mode 100644 index c63ed4afd7..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/stats.shtml +++ /dev/null @@ -1,31 +0,0 @@ -%!: /header.html -

Network statistics

-
-
IDNamePriorityPoll handlerEvent handlerProcstate
-
-IP           Packets received
-             Packets sent
-	     Packets dropped
-IP errors    IP version/header length
-             IP length, high byte
-             IP length, low byte
-             IP fragments
-             Header checksum
-             Wrong protocol
-ICMP	     Packets received
-             Packets sent
-             Packets dropped
-             Type errors
-TCP          Packets received
-             Packets sent
-             Packets dropped
-             Checksum errors
-             Data packets without ACKs
-             Resets
-             Retransmissions
-	     No connection avaliable
-	     Connection attempts to closed ports
-
%! net-stats
-
- -%!: /footer.html diff --git a/components/net/uip/apps/webserver/httpd-fs/style.css b/components/net/uip/apps/webserver/httpd-fs/style.css deleted file mode 100644 index ba6df7f157..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/style.css +++ /dev/null @@ -1,92 +0,0 @@ -h1 -{ - text-align: center; - font-size:14pt; - font-family:arial,helvetica; - font-weight:bold; - padding:10px; -} - -body -{ - - background-color: #fffeec; - color:black; - - font-size:8pt; - font-family:arial,helvetica; -} - -.menu -{ - margin: 4px; - width:60%; - - padding:2px; - - border: solid 1px; - background-color: #fffcd2; - text-align:left; - - font-size:9pt; - font-family:arial,helvetica; -} - -div.menubox -{ - width: 25%; - border: 0; - float: left; -text-align: center; -} - -.contentblock -{ - margin: 4px; - width:60%; - - padding:2px; - - border: 1px dotted; - background-color: white; - - font-size:8pt; - font-family:arial,helvetica; - -} - -p.intro -{ - margin-left:20px; - margin-right:20px; - - font-size:10pt; -/* font-weight:bold; */ - font-family:arial,helvetica; -} - -p.clink -{ - font-size:12pt; - font-family:courier,monospace; - text-align:center; -} - -p.clink9 -{ - font-size:9pt; - font-family:courier,monospace; - text-align:center; -} - - -p -{ - padding-left:10px; -} - -p.right -{ - text-align:right; -} - diff --git a/components/net/uip/apps/webserver/httpd-fs/tcp.shtml b/components/net/uip/apps/webserver/httpd-fs/tcp.shtml deleted file mode 100644 index 4c4bffe97f..0000000000 --- a/components/net/uip/apps/webserver/httpd-fs/tcp.shtml +++ /dev/null @@ -1,5 +0,0 @@ -%!: /header.html -

Current connections


- -%! tcp-connections -%!: /footer.html \ No newline at end of file diff --git a/components/net/uip/apps/webserver/httpd-fsdata.c b/components/net/uip/apps/webserver/httpd-fsdata.c deleted file mode 100644 index 491095ec30..0000000000 --- a/components/net/uip/apps/webserver/httpd-fsdata.c +++ /dev/null @@ -1,607 +0,0 @@ -static const unsigned char data_processes_shtml[] = { - /* /processes.shtml */ - 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3c, 0x68, 0x31, - 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x3c, 0x2f, 0x68, - 0x31, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, - 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e, 0xa, 0x3c, 0x74, 0x72, - 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x49, 0x44, 0x3c, 0x2f, 0x74, - 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4e, 0x61, 0x6d, 0x65, - 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x50, - 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3c, 0x2f, 0x74, - 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x50, 0x6f, 0x6c, 0x6c, - 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x3c, 0x2f, - 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x50, - 0x72, 0x6f, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3c, 0x2f, - 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x25, - 0x21, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, - 0x73, 0xa, 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x66, 0x6f, 0x6f, - 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0}; - -static const unsigned char data_404_html[] = { - /* /404.html */ - 0x2f, 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, 0x20, 0x20, 0x3c, - 0x62, 0x6f, 0x64, 0x79, 0x20, 0x62, 0x67, 0x63, 0x6f, 0x6c, - 0x6f, 0x72, 0x3d, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65, 0x22, - 0x3e, 0xa, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x63, 0x65, 0x6e, - 0x74, 0x65, 0x72, 0x3e, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x3c, 0x68, 0x31, 0x3e, 0x34, 0x30, 0x34, 0x20, 0x2d, - 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, - 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x3c, 0x2f, 0x68, 0x31, 0x3e, - 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x68, 0x33, - 0x3e, 0x47, 0x6f, 0x20, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, - 0x66, 0x3d, 0x22, 0x2f, 0x22, 0x3e, 0x68, 0x65, 0x72, 0x65, - 0x3c, 0x2f, 0x61, 0x3e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, - 0x61, 0x64, 0x2e, 0x3c, 0x2f, 0x68, 0x33, 0x3e, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, - 0x72, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x2f, 0x62, 0x6f, 0x64, - 0x79, 0x3e, 0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, -0}; - -static const unsigned char data_files_shtml[] = { - /* /files.shtml */ - 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3c, 0x68, 0x31, - 0x3e, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x3c, 0x2f, 0x68, 0x31, - 0x3e, 0xa, 0x3c, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3e, - 0xa, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x3d, 0x22, 0x33, 0x30, 0x30, 0x22, 0x3e, - 0xa, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, - 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x22, - 0x3e, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, - 0x6d, 0x6c, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, - 0x3e, 0xa, 0x3c, 0x74, 0x64, 0x3e, 0x25, 0x21, 0x20, 0x66, - 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, - 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, - 0x6c, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, - 0x3e, 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, 0x72, 0x63, 0x3d, - 0x22, 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, 0x70, 0x6e, 0x67, - 0x22, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x31, - 0x30, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x25, 0x21, - 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, - 0x73, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, - 0x74, 0x6d, 0x6c, 0xa, 0x3e, 0x20, 0x3c, 0x2f, 0x74, 0x64, - 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x3c, 0x74, 0x72, - 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, - 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, - 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x2f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, - 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0xa, - 0x3c, 0x74, 0x64, 0x3e, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, - 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, - 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, - 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, 0x72, 0x63, 0x3d, 0x22, - 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, 0x70, 0x6e, 0x67, 0x22, - 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x31, 0x30, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x25, 0x21, 0x20, - 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x20, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, - 0x74, 0x6d, 0x6c, 0xa, 0x3e, 0x20, 0x3c, 0x2f, 0x74, 0x64, - 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x3c, 0x74, 0x72, - 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, - 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x74, 0x63, 0x70, 0x2e, 0x73, - 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x2f, 0x74, 0x63, 0x70, - 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x3c, 0x2f, 0x61, 0x3e, - 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0xa, 0x3c, 0x74, 0x64, 0x3e, - 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, - 0x61, 0x74, 0x73, 0x20, 0x2f, 0x74, 0x63, 0x70, 0x2e, 0x73, - 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e, - 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, - 0x72, 0x63, 0x3d, 0x22, 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, - 0x70, 0x6e, 0x67, 0x22, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x3d, 0x31, 0x30, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x3d, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, - 0x74, 0x61, 0x74, 0x73, 0x20, 0x2f, 0x74, 0x63, 0x70, 0x2e, - 0x73, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3e, 0x20, 0x3c, 0x2f, - 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x3c, - 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, - 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x73, 0x68, 0x74, - 0x6d, 0x6c, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, - 0x3e, 0xa, 0x3c, 0x74, 0x64, 0x3e, 0x25, 0x21, 0x20, 0x66, - 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x73, 0x68, 0x74, - 0x6d, 0x6c, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, - 0x64, 0x3e, 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, 0x72, 0x63, - 0x3d, 0x22, 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, 0x70, 0x6e, - 0x67, 0x22, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, - 0x31, 0x30, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x25, - 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x20, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, - 0x73, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3e, 0x20, 0x3c, 0x2f, - 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x3c, - 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, - 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x73, 0x74, 0x79, - 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x2f, 0x73, - 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x3c, 0x2f, - 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0xa, 0x3c, 0x74, - 0x64, 0x3e, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, - 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2f, 0x73, 0x74, 0x79, - 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0xa, 0x3c, 0x2f, 0x74, - 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x69, 0x6d, 0x67, - 0x20, 0x73, 0x72, 0x63, 0x3d, 0x22, 0x2f, 0x66, 0x61, 0x64, - 0x65, 0x2e, 0x70, 0x6e, 0x67, 0x22, 0x20, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x3d, 0x31, 0x30, 0x20, 0x77, 0x69, 0x64, - 0x74, 0x68, 0x3d, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, - 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2f, 0x73, 0x74, - 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0xa, 0x3e, 0x20, - 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, - 0xa, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, - 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x34, - 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x2f, - 0x34, 0x30, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3c, 0x2f, - 0x61, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0xa, 0x3c, 0x74, - 0x64, 0x3e, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, - 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2f, 0x34, 0x30, 0x34, - 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3c, 0x2f, 0x74, 0x64, - 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x69, 0x6d, 0x67, 0x20, - 0x73, 0x72, 0x63, 0x3d, 0x22, 0x2f, 0x66, 0x61, 0x64, 0x65, - 0x2e, 0x70, 0x6e, 0x67, 0x22, 0x20, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x3d, 0x31, 0x30, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, - 0x73, 0x74, 0x61, 0x74, 0x73, 0x20, 0x2f, 0x34, 0x30, 0x34, - 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3e, 0x20, 0x3c, 0x2f, - 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x3c, - 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x61, 0x20, - 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x66, 0x61, 0x64, - 0x65, 0x2e, 0x70, 0x6e, 0x67, 0x22, 0x3e, 0x2f, 0x66, 0x61, - 0x64, 0x65, 0x2e, 0x70, 0x6e, 0x67, 0x3c, 0x2f, 0x61, 0x3e, - 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0xa, 0x3c, 0x74, 0x64, 0x3e, - 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, - 0x61, 0x74, 0x73, 0x20, 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, - 0x70, 0x6e, 0x67, 0xa, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, - 0x74, 0x64, 0x3e, 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, 0x72, - 0x63, 0x3d, 0x22, 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, 0x70, - 0x6e, 0x67, 0x22, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x3d, 0x31, 0x30, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, - 0x25, 0x21, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2d, 0x73, 0x74, - 0x61, 0x74, 0x73, 0x20, 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, - 0x70, 0x6e, 0x67, 0xa, 0x3e, 0x20, 0x3c, 0x2f, 0x74, 0x64, - 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x3c, 0x2f, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x3e, 0xa, 0x3c, 0x2f, 0x63, 0x65, - 0x6e, 0x74, 0x65, 0x72, 0x3e, 0xa, 0x25, 0x21, 0x3a, 0x20, - 0x2f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, - 0x6d, 0x6c, 0xa, 0}; - -static const unsigned char data_footer_html[] = { - /* /footer.html */ - 0x2f, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x20, 0x20, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0xa, - 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0}; - -static const unsigned char data_header_html[] = { - /* /header.html */ - 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, - 0x48, 0x54, 0x4d, 0x4c, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, - 0x43, 0x20, 0x22, 0x2d, 0x2f, 0x2f, 0x57, 0x33, 0x43, 0x2f, - 0x2f, 0x44, 0x54, 0x44, 0x20, 0x48, 0x54, 0x4d, 0x4c, 0x20, - 0x34, 0x2e, 0x30, 0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2f, 0x2f, 0x45, - 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, - 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72, - 0x67, 0x2f, 0x54, 0x52, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x34, - 0x2f, 0x6c, 0x6f, 0x6f, 0x73, 0x65, 0x2e, 0x64, 0x74, 0x64, - 0x22, 0x3e, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, - 0x20, 0x20, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x3c, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, - 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x6f, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x49, 0x50, 0x20, 0x77, - 0x65, 0x62, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x21, - 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x3c, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x72, - 0x65, 0x6c, 0x3d, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, - 0x68, 0x65, 0x65, 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, - 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, - 0x22, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x73, 0x74, - 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x20, - 0x20, 0xa, 0x20, 0x20, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, - 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, - 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23, - 0x66, 0x66, 0x66, 0x65, 0x65, 0x63, 0x22, 0x20, 0x74, 0x65, - 0x78, 0x74, 0x3d, 0x22, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x22, - 0x3e, 0xa, 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, 0x6e, - 0x75, 0x22, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, - 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, - 0x6e, 0x75, 0x62, 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x61, 0x20, - 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x22, 0x3e, 0x46, - 0x72, 0x6f, 0x6e, 0x74, 0x20, 0x70, 0x61, 0x67, 0x65, 0x3c, - 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0xa, - 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, 0x6e, 0x75, 0x62, 0x6f, - 0x78, 0x22, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, - 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, - 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x46, 0x69, 0x6c, 0x65, 0x20, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, - 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, - 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, 0x6e, 0x75, 0x62, - 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, - 0x66, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x73, - 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, - 0x74, 0x69, 0x63, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, - 0x64, 0x69, 0x76, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, - 0x76, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, - 0x65, 0x6e, 0x75, 0x62, 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x61, - 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x74, 0x63, 0x70, - 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0xa, 0x20, 0x20, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3c, - 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0xa, - 0x20, 0x20, 0x3c, 0x62, 0x72, 0x3e, 0xa, 0x20, 0x20, 0x3c, - 0x2f, 0x64, 0x69, 0x76, 0x3e, 0xa, 0x20, 0x20, 0xa, 0x20, - 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x3d, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3e, 0xa, 0}; - -static const unsigned char data_index_html[] = { - /* /index.html */ - 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, - 0x48, 0x54, 0x4d, 0x4c, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, - 0x43, 0x20, 0x22, 0x2d, 0x2f, 0x2f, 0x57, 0x33, 0x43, 0x2f, - 0x2f, 0x44, 0x54, 0x44, 0x20, 0x48, 0x54, 0x4d, 0x4c, 0x20, - 0x34, 0x2e, 0x30, 0x31, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2f, 0x2f, 0x45, - 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, - 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72, - 0x67, 0x2f, 0x54, 0x52, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x34, - 0x2f, 0x6c, 0x6f, 0x6f, 0x73, 0x65, 0x2e, 0x64, 0x74, 0x64, - 0x22, 0x3e, 0xa, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0xa, - 0x20, 0x20, 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x3c, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, - 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x6f, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x49, 0x50, 0x20, 0x77, - 0x65, 0x62, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x21, - 0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3e, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x3c, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x72, - 0x65, 0x6c, 0x3d, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, - 0x68, 0x65, 0x65, 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, - 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, - 0x22, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x73, 0x74, - 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x20, - 0x20, 0xa, 0x20, 0x20, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, - 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x20, - 0x62, 0x67, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23, - 0x66, 0x66, 0x66, 0x65, 0x65, 0x63, 0x22, 0x20, 0x74, 0x65, - 0x78, 0x74, 0x3d, 0x22, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x22, - 0x3e, 0xa, 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, 0x6e, - 0x75, 0x22, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, - 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, - 0x6e, 0x75, 0x62, 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x61, 0x20, - 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x2f, 0x22, 0x3e, 0x46, - 0x72, 0x6f, 0x6e, 0x74, 0x20, 0x70, 0x61, 0x67, 0x65, 0x3c, - 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0xa, - 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, 0x6e, 0x75, 0x62, 0x6f, - 0x78, 0x22, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, - 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x68, - 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x46, 0x69, 0x6c, 0x65, 0x20, - 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, - 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, - 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, 0x65, 0x6e, 0x75, 0x62, - 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, - 0x66, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x73, - 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, - 0x74, 0x69, 0x63, 0x73, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x2f, - 0x64, 0x69, 0x76, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x64, 0x69, - 0x76, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x6d, - 0x65, 0x6e, 0x75, 0x62, 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x61, - 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x74, 0x63, 0x70, - 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0xa, 0x20, 0x20, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3c, - 0x2f, 0x61, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0xa, - 0x20, 0x20, 0x3c, 0x62, 0x72, 0x3e, 0xa, 0x20, 0x20, 0x3c, - 0x2f, 0x64, 0x69, 0x76, 0x3e, 0xa, 0xa, 0x20, 0x20, 0x3c, - 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, - 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x22, 0x3e, 0xa, 0x20, 0x20, 0x3c, 0x70, - 0x3e, 0xa, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, - 0x77, 0x65, 0x62, 0x20, 0x70, 0x61, 0x67, 0x65, 0x73, 0x20, - 0x61, 0x72, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x73, 0x6d, 0x61, 0x6c, - 0x6c, 0x20, 0x77, 0x65, 0x62, 0x20, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, - 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x70, 0x20, 0x6f, 0x66, - 0xa, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x3c, 0x61, 0x20, - 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70, - 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, - 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x7e, 0x61, 0x64, 0x61, 0x6d, - 0x2f, 0x75, 0x69, 0x70, 0x2f, 0x22, 0x3e, 0x75, 0x49, 0x50, - 0x20, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, - 0x54, 0x43, 0x50, 0x2f, 0x49, 0x50, 0xa, 0x20, 0x20, 0x73, - 0x74, 0x61, 0x63, 0x6b, 0x3c, 0x2f, 0x61, 0x3e, 0x2e, 0xa, - 0x20, 0x20, 0x3c, 0x2f, 0x70, 0x3e, 0xa, 0x20, 0x20, 0x3c, - 0x70, 0x3e, 0xa, 0x20, 0x20, 0x43, 0x6c, 0x69, 0x63, 0x6b, - 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, - 0x6e, 0x6b, 0x73, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x77, 0x65, 0x62, 0x20, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0xa, 0x20, 0x20, 0x3c, - 0x2f, 0x70, 0x3e, 0xa, 0xa, 0x20, 0x20, 0x3c, 0x2f, 0x62, - 0x6f, 0x64, 0x79, 0x3e, 0xa, 0x3c, 0x2f, 0x68, 0x74, 0x6d, - 0x6c, 0x3e, 0xa, 0}; - -static const unsigned char data_style_css[] = { - /* /style.css */ - 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0, - 0x68, 0x31, 0x20, 0xa, 0x7b, 0xa, 0x20, 0x20, 0x74, 0x65, - 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, - 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0xa, 0x20, 0x20, - 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, - 0x31, 0x34, 0x70, 0x74, 0x3b, 0xa, 0x20, 0x20, 0x66, 0x6f, - 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, - 0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76, - 0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0xa, 0x20, 0x20, 0x66, - 0x6f, 0x6e, 0x74, 0x2d, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x3a, 0x62, 0x6f, 0x6c, 0x64, 0x3b, 0xa, 0x20, 0x20, 0x70, - 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x30, 0x70, - 0x78, 0x3b, 0x20, 0xa, 0x7d, 0xa, 0xa, 0x62, 0x6f, 0x64, - 0x79, 0xa, 0x7b, 0xa, 0xa, 0x20, 0x20, 0x62, 0x61, 0x63, - 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6f, - 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x65, - 0x65, 0x63, 0x3b, 0xa, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, - 0x72, 0x3a, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0xa, 0xa, - 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, - 0x65, 0x3a, 0x38, 0x70, 0x74, 0x3b, 0xa, 0x20, 0x20, 0x66, - 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, - 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, - 0x76, 0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0xa, 0x7d, 0xa, - 0xa, 0x2e, 0x6d, 0x65, 0x6e, 0x75, 0xa, 0x7b, 0xa, 0x20, - 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x34, - 0x70, 0x78, 0x3b, 0xa, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3a, 0x36, 0x30, 0x25, 0x3b, 0xa, 0xa, 0x20, 0x20, - 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x32, 0x70, - 0x78, 0x3b, 0xa, 0x9, 0xa, 0x20, 0x20, 0x62, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x3a, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, - 0x20, 0x31, 0x70, 0x78, 0x3b, 0xa, 0x20, 0x20, 0x62, 0x61, - 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, - 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, - 0x63, 0x64, 0x32, 0x3b, 0xa, 0x20, 0x20, 0x74, 0x65, 0x78, - 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x6c, 0x65, - 0x66, 0x74, 0x3b, 0xa, 0x20, 0x20, 0xa, 0x20, 0x20, 0x66, - 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x39, - 0x70, 0x74, 0x3b, 0xa, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, - 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, - 0x69, 0x61, 0x6c, 0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, - 0x69, 0x63, 0x61, 0x3b, 0x20, 0x20, 0xa, 0x7d, 0xa, 0xa, - 0x64, 0x69, 0x76, 0x2e, 0x6d, 0x65, 0x6e, 0x75, 0x62, 0x6f, - 0x78, 0xa, 0x7b, 0xa, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3a, 0x20, 0x32, 0x35, 0x25, 0x3b, 0xa, 0x20, 0x20, - 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x30, 0x3b, - 0xa, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x20, - 0x6c, 0x65, 0x66, 0x74, 0x3b, 0xa, 0x74, 0x65, 0x78, 0x74, - 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x63, 0x65, - 0x6e, 0x74, 0x65, 0x72, 0x3b, 0xa, 0x7d, 0xa, 0xa, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0xa, 0x7b, 0x20, 0x20, 0xa, 0x20, 0x20, 0x6d, - 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x34, 0x70, 0x78, - 0x3b, 0xa, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, - 0x36, 0x30, 0x25, 0x3b, 0xa, 0xa, 0x20, 0x20, 0x70, 0x61, - 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x32, 0x70, 0x78, 0x3b, - 0xa, 0xa, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x64, 0x6f, 0x74, 0x74, - 0x65, 0x64, 0x3b, 0xa, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, - 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6f, 0x6c, - 0x6f, 0x72, 0x3a, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3b, - 0xa, 0xa, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, - 0x69, 0x7a, 0x65, 0x3a, 0x38, 0x70, 0x74, 0x3b, 0xa, 0x20, - 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, - 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x68, - 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61, 0x3b, 0x20, - 0x20, 0xa, 0xa, 0x7d, 0xa, 0xa, 0x70, 0x2e, 0x69, 0x6e, - 0x74, 0x72, 0x6f, 0xa, 0x7b, 0xa, 0x20, 0x20, 0x6d, 0x61, - 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a, - 0x32, 0x30, 0x70, 0x78, 0x3b, 0xa, 0x20, 0x20, 0x6d, 0x61, - 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, - 0x3a, 0x32, 0x30, 0x70, 0x78, 0x3b, 0xa, 0xa, 0x20, 0x20, - 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, - 0x31, 0x30, 0x70, 0x74, 0x3b, 0xa, 0x2f, 0x2a, 0x20, 0x20, - 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x77, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x3a, 0x62, 0x6f, 0x6c, 0x64, 0x3b, 0x20, 0x2a, 0x2f, - 0xa, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, - 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x61, 0x72, 0x69, 0x61, 0x6c, - 0x2c, 0x68, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61, - 0x3b, 0x20, 0x20, 0xa, 0x7d, 0xa, 0xa, 0x70, 0x2e, 0x63, - 0x6c, 0x69, 0x6e, 0x6b, 0xa, 0x7b, 0xa, 0x20, 0x20, 0x66, - 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x31, - 0x32, 0x70, 0x74, 0x3b, 0xa, 0x20, 0x20, 0x66, 0x6f, 0x6e, - 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x63, - 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x2c, 0x6d, 0x6f, 0x6e, - 0x6f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3b, 0x20, 0x20, 0xa, - 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, - 0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, - 0xa, 0x7d, 0xa, 0xa, 0x70, 0x2e, 0x63, 0x6c, 0x69, 0x6e, - 0x6b, 0x39, 0xa, 0x7b, 0xa, 0x20, 0x20, 0x66, 0x6f, 0x6e, - 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x39, 0x70, 0x74, - 0x3b, 0xa, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, - 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x63, 0x6f, 0x75, 0x72, - 0x69, 0x65, 0x72, 0x2c, 0x6d, 0x6f, 0x6e, 0x6f, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x3b, 0x20, 0x20, 0xa, 0x20, 0x20, 0x74, - 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, - 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0xa, 0x7d, 0xa, - 0xa, 0xa, 0x70, 0xa, 0x7b, 0xa, 0x20, 0x20, 0x70, 0x61, - 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x6c, 0x65, 0x66, 0x74, - 0x3a, 0x31, 0x30, 0x70, 0x78, 0x3b, 0xa, 0x7d, 0xa, 0xa, - 0x70, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0xa, 0x7b, 0xa, - 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, - 0x67, 0x6e, 0x3a, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x20, - 0xa, 0x7d, 0xa, 0xa, 0}; - -static const unsigned char data_tcp_shtml[] = { - /* /tcp.shtml */ - 0x2f, 0x74, 0x63, 0x70, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3c, 0x68, 0x31, - 0x3e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x3c, 0x2f, 0x68, 0x31, 0x3e, 0x3c, 0x62, 0x72, 0x3e, 0x3c, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, - 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e, 0xa, - 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4c, 0x6f, - 0x63, 0x61, 0x6c, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, - 0x68, 0x3e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3c, 0x2f, - 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, - 0x3e, 0x52, 0x65, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3c, 0x2f, 0x74, 0x68, - 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x54, 0x69, 0x6d, 0x65, 0x72, - 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x46, - 0x6c, 0x61, 0x67, 0x73, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, - 0x2f, 0x74, 0x72, 0x3e, 0xa, 0x25, 0x21, 0x20, 0x74, 0x63, - 0x70, 0x2d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0xa, 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x66, - 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, -0}; - -static const unsigned char data_fade_png[] = { - /* /fade.png */ - 0x2f, 0x66, 0x61, 0x64, 0x65, 0x2e, 0x70, 0x6e, 0x67, 0, - 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 00, 00, - 00, 0xd, 0x49, 0x48, 0x44, 0x52, 00, 00, 00, 0x4, - 00, 00, 00, 0xa, 0x8, 0x2, 00, 00, 00, 0x1c, - 0x99, 0x68, 0x59, 00, 00, 00, 0x9, 0x70, 0x48, 0x59, - 0x73, 00, 00, 0xb, 0x13, 00, 00, 0xb, 0x13, 0x1, - 00, 0x9a, 0x9c, 0x18, 00, 00, 00, 0x7, 0x74, 0x49, - 0x4d, 0x45, 0x7, 0xd6, 0x6, 0x8, 0x14, 0x1b, 0x39, 0xaf, - 0x5b, 0xc0, 0xe3, 00, 00, 00, 0x1d, 0x74, 0x45, 0x58, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 00, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, - 0x68, 0x20, 0x54, 0x68, 0x65, 0x20, 0x47, 0x49, 0x4d, 0x50, - 0xef, 0x64, 0x25, 0x6e, 00, 00, 00, 0x3a, 0x49, 0x44, - 0x41, 0x54, 0x8, 0xd7, 0x75, 0x8c, 0x31, 0x12, 00, 0x10, - 0x10, 0xc4, 0x2e, 0x37, 0x9e, 0x40, 0x65, 0xfd, 0xff, 0x83, - 0xf4, 0xa, 0x1c, 0x8d, 0x54, 0x9b, 0xc9, 0xcc, 0x9a, 0x3d, - 0x90, 0x73, 0x71, 0x67, 0x91, 0xd4, 0x74, 0x36, 0xa9, 0x55, - 0x1, 0xf8, 0x29, 0x58, 0xc8, 0xbf, 0x48, 0xc4, 0x81, 0x74, - 0xb, 0xa3, 0xf, 0x7c, 0xdb, 0x4, 0xe8, 0x40, 0x5, 0xdf, - 0xa1, 0xf3, 0xfc, 0x73, 00, 00, 00, 00, 0x49, 0x45, - 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0}; - -static const unsigned char data_stats_shtml[] = { - /* /stats.shtml */ - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x73, 0x68, 0x74, 0x6d, 0x6c, 0, - 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0xa, 0x3c, 0x68, 0x31, - 0x3e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x3c, - 0x2f, 0x68, 0x31, 0x3e, 0xa, 0x3c, 0x63, 0x65, 0x6e, 0x74, - 0x65, 0x72, 0x3e, 0xa, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x33, 0x30, - 0x30, 0x22, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3d, - 0x22, 0x30, 0x22, 0x3e, 0xa, 0x3c, 0x74, 0x72, 0x3e, 0x3c, - 0x74, 0x64, 0x3e, 0x3c, 0x70, 0x72, 0x65, 0x3e, 0xa, 0x49, - 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, - 0x73, 0x65, 0x6e, 0x74, 0xa, 0x9, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x64, - 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0xa, 0x49, 0x50, 0x20, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x20, 0x20, 0x20, 0x20, - 0x49, 0x50, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x50, - 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x20, 0x68, - 0x69, 0x67, 0x68, 0x20, 0x62, 0x79, 0x74, 0x65, 0xa, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x49, 0x50, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x2c, 0x20, 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x79, 0x74, - 0x65, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x50, 0x20, 0x66, 0x72, - 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0xa, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0xa, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x20, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0xa, 0x49, 0x43, 0x4d, 0x50, 0x9, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x20, 0x73, 0x65, 0x6e, 0x74, 0xa, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x64, - 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0xa, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x54, 0x79, 0x70, 0x65, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x73, 0xa, 0x54, 0x43, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x64, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x20, 0x73, 0x65, 0x6e, 0x74, 0xa, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x20, 0x64, - 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0xa, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x20, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x73, 0xa, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, - 0x61, 0x74, 0x61, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, - 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, - 0x41, 0x43, 0x4b, 0x73, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x73, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x65, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0xa, 0x9, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x4e, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x76, 0x61, 0x6c, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0xa, 0x9, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x20, - 0x74, 0x6f, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x20, - 0x70, 0x6f, 0x72, 0x74, 0x73, 0xa, 0x3c, 0x2f, 0x70, 0x72, - 0x65, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, - 0x3e, 0x3c, 0x70, 0x72, 0x65, 0x3e, 0x25, 0x21, 0x20, 0x6e, - 0x65, 0x74, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x73, 0xa, 0x3c, - 0x2f, 0x70, 0x72, 0x65, 0x3e, 0x3c, 0x2f, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x3e, 0xa, 0x3c, 0x2f, 0x63, 0x65, 0x6e, 0x74, - 0x65, 0x72, 0x3e, 0xa, 0x25, 0x21, 0x3a, 0x20, 0x2f, 0x66, - 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x2e, 0x68, 0x74, 0x6d, 0x6c, - 0xa, 0}; - -const struct httpd_fsdata_file file_processes_shtml[] = {{NULL, data_processes_shtml, data_processes_shtml + 17, sizeof(data_processes_shtml) - 17}}; - -const struct httpd_fsdata_file file_404_html[] = {{file_processes_shtml, data_404_html, data_404_html + 10, sizeof(data_404_html) - 10}}; - -const struct httpd_fsdata_file file_files_shtml[] = {{file_404_html, data_files_shtml, data_files_shtml + 13, sizeof(data_files_shtml) - 13}}; - -const struct httpd_fsdata_file file_footer_html[] = {{file_files_shtml, data_footer_html, data_footer_html + 13, sizeof(data_footer_html) - 13}}; - -const struct httpd_fsdata_file file_header_html[] = {{file_footer_html, data_header_html, data_header_html + 13, sizeof(data_header_html) - 13}}; - -const struct httpd_fsdata_file file_index_html[] = {{file_header_html, data_index_html, data_index_html + 12, sizeof(data_index_html) - 12}}; - -const struct httpd_fsdata_file file_style_css[] = {{file_index_html, data_style_css, data_style_css + 11, sizeof(data_style_css) - 11}}; - -const struct httpd_fsdata_file file_tcp_shtml[] = {{file_style_css, data_tcp_shtml, data_tcp_shtml + 11, sizeof(data_tcp_shtml) - 11}}; - -const struct httpd_fsdata_file file_fade_png[] = {{file_tcp_shtml, data_fade_png, data_fade_png + 10, sizeof(data_fade_png) - 10}}; - -const struct httpd_fsdata_file file_stats_shtml[] = {{file_fade_png, data_stats_shtml, data_stats_shtml + 13, sizeof(data_stats_shtml) - 13}}; - -#define HTTPD_FS_ROOT file_stats_shtml - -#define HTTPD_FS_NUMFILES 10 diff --git a/components/net/uip/apps/webserver/httpd-fsdata.h b/components/net/uip/apps/webserver/httpd-fsdata.h deleted file mode 100644 index 0ad2d6e785..0000000000 --- a/components/net/uip/apps/webserver/httpd-fsdata.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - * $Id: httpd-fsdata.h,v 1.1 2006/06/07 09:13:08 adam Exp $ - */ -#ifndef __HTTPD_FSDATA_H__ -#define __HTTPD_FSDATA_H__ - -#include "uip.h" - -struct httpd_fsdata_file { - const struct httpd_fsdata_file *next; - const char *name; - const char *data; - const int len; -#ifdef HTTPD_FS_STATISTICS -#if HTTPD_FS_STATISTICS == 1 - u16_t count; -#endif /* HTTPD_FS_STATISTICS */ -#endif /* HTTPD_FS_STATISTICS */ -}; - -struct httpd_fsdata_file_noconst { - struct httpd_fsdata_file *next; - char *name; - char *data; - int len; -#ifdef HTTPD_FS_STATISTICS -#if HTTPD_FS_STATISTICS == 1 - u16_t count; -#endif /* HTTPD_FS_STATISTICS */ -#endif /* HTTPD_FS_STATISTICS */ -}; - -#endif /* __HTTPD_FSDATA_H__ */ diff --git a/components/net/uip/apps/webserver/httpd.c b/components/net/uip/apps/webserver/httpd.c deleted file mode 100644 index 937e138252..0000000000 --- a/components/net/uip/apps/webserver/httpd.c +++ /dev/null @@ -1,338 +0,0 @@ -/** - * \addtogroup apps - * @{ - */ - -/** - * \defgroup httpd Web server - * @{ - * The uIP web server is a very simplistic implementation of an HTTP - * server. It can serve web pages and files from a read-only ROM - * filesystem, and provides a very small scripting language. - - */ - -/** - * \file - * Web server - * \author - * Adam Dunkels - */ - - -/* - * Copyright (c) 2004, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * Author: Adam Dunkels - * - * $Id: httpd.c,v 1.2 2006/06/11 21:46:38 adam Exp $ - */ - -#include "uip.h" -#include "httpd.h" -#include "httpd-fs.h" -#include "httpd-cgi.h" -#include "http-strings.h" - -#include - -#define STATE_WAITING 0 -#define STATE_OUTPUT 1 - -#define ISO_nl 0x0a -#define ISO_space 0x20 -#define ISO_bang 0x21 -#define ISO_percent 0x25 -#define ISO_period 0x2e -#define ISO_slash 0x2f -#define ISO_colon 0x3a - - -/*---------------------------------------------------------------------------*/ -static unsigned short -generate_part_of_file(void *state) -{ - struct httpd_state *s = (struct httpd_state *)state; - - if(s->file.len > uip_mss()) { - s->len = uip_mss(); - } else { - s->len = s->file.len; - } - memcpy(uip_appdata, s->file.data, s->len); - - return s->len; -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(send_file(struct httpd_state *s)) -{ - PSOCK_BEGIN(&s->sout); - - do { - PSOCK_GENERATOR_SEND(&s->sout, generate_part_of_file, s); - s->file.len -= s->len; - s->file.data += s->len; - } while(s->file.len > 0); - - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(send_part_of_file(struct httpd_state *s)) -{ - PSOCK_BEGIN(&s->sout); - - PSOCK_SEND(&s->sout, s->file.data, s->len); - - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -static void -next_scriptstate(struct httpd_state *s) -{ - char *p; - p = strchr(s->scriptptr, ISO_nl) + 1; - s->scriptlen -= (unsigned short)(p - s->scriptptr); - s->scriptptr = p; -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(handle_script(struct httpd_state *s)) -{ - char *ptr; - - PT_BEGIN(&s->scriptpt); - - - while(s->file.len > 0) { - - /* Check if we should start executing a script. */ - if(*s->file.data == ISO_percent && - *(s->file.data + 1) == ISO_bang) { - s->scriptptr = s->file.data + 3; - s->scriptlen = s->file.len - 3; - if(*(s->scriptptr - 1) == ISO_colon) { - httpd_fs_open(s->scriptptr + 1, &s->file); - PT_WAIT_THREAD(&s->scriptpt, send_file(s)); - } else { - PT_WAIT_THREAD(&s->scriptpt, - httpd_cgi(s->scriptptr)(s, s->scriptptr)); - } - next_scriptstate(s); - - /* The script is over, so we reset the pointers and continue - sending the rest of the file. */ - s->file.data = s->scriptptr; - s->file.len = s->scriptlen; - } else { - /* See if we find the start of script marker in the block of HTML - to be sent. */ - - if(s->file.len > uip_mss()) { - s->len = uip_mss(); - } else { - s->len = s->file.len; - } - - if(*s->file.data == ISO_percent) { - ptr = strchr(s->file.data + 1, ISO_percent); - } else { - ptr = strchr(s->file.data, ISO_percent); - } - if(ptr != NULL && - ptr != s->file.data) { - s->len = (int)(ptr - s->file.data); - if(s->len >= uip_mss()) { - s->len = uip_mss(); - } - } - PT_WAIT_THREAD(&s->scriptpt, send_part_of_file(s)); - s->file.data += s->len; - s->file.len -= s->len; - - } - } - - PT_END(&s->scriptpt); -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr)) -{ - char *ptr; - - PSOCK_BEGIN(&s->sout); - - PSOCK_SEND_STR(&s->sout, statushdr); - - ptr = strrchr(s->filename, ISO_period); - if(ptr == NULL) { - PSOCK_SEND_STR(&s->sout, http_content_type_binary); - } else if(strncmp(http_html, ptr, 5) == 0 || - strncmp(http_shtml, ptr, 6) == 0) { - PSOCK_SEND_STR(&s->sout, http_content_type_html); - } else if(strncmp(http_css, ptr, 4) == 0) { - PSOCK_SEND_STR(&s->sout, http_content_type_css); - } else if(strncmp(http_png, ptr, 4) == 0) { - PSOCK_SEND_STR(&s->sout, http_content_type_png); - } else if(strncmp(http_gif, ptr, 4) == 0) { - PSOCK_SEND_STR(&s->sout, http_content_type_gif); - } else if(strncmp(http_jpg, ptr, 4) == 0) { - PSOCK_SEND_STR(&s->sout, http_content_type_jpg); - } else { - PSOCK_SEND_STR(&s->sout, http_content_type_plain); - } - PSOCK_END(&s->sout); -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(handle_output(struct httpd_state *s)) -{ - char *ptr; - - PT_BEGIN(&s->outputpt); - - if(!httpd_fs_open(s->filename, &s->file)) { - httpd_fs_open(http_404_html, &s->file); - strcpy(s->filename, http_404_html); - PT_WAIT_THREAD(&s->outputpt, - send_headers(s, - http_header_404)); - PT_WAIT_THREAD(&s->outputpt, - send_file(s)); - } else { - PT_WAIT_THREAD(&s->outputpt, - send_headers(s, - http_header_200)); - ptr = strchr(s->filename, ISO_period); - if(ptr != NULL && strncmp(ptr, http_shtml, 6) == 0) { - PT_INIT(&s->scriptpt); - PT_WAIT_THREAD(&s->outputpt, handle_script(s)); - } else { - PT_WAIT_THREAD(&s->outputpt, - send_file(s)); - } - } - PSOCK_CLOSE(&s->sout); - PT_END(&s->outputpt); -} -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(handle_input(struct httpd_state *s)) -{ - PSOCK_BEGIN(&s->sin); - - PSOCK_READTO(&s->sin, ISO_space); - - - if(strncmp(s->inputbuf, http_get, 4) != 0) { - PSOCK_CLOSE_EXIT(&s->sin); - } - PSOCK_READTO(&s->sin, ISO_space); - - if(s->inputbuf[0] != ISO_slash) { - PSOCK_CLOSE_EXIT(&s->sin); - } - - if(s->inputbuf[1] == ISO_space) { - strncpy(s->filename, http_index_html, sizeof(s->filename)); - } else { - s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0; - strncpy(s->filename, &s->inputbuf[0], sizeof(s->filename)); - } - - /* httpd_log_file(uip_conn->ripaddr, s->filename);*/ - - s->state = STATE_OUTPUT; - - while(1) { - PSOCK_READTO(&s->sin, ISO_nl); - - if(strncmp(s->inputbuf, http_referer, 8) == 0) { - s->inputbuf[PSOCK_DATALEN(&s->sin) - 2] = 0; - /* httpd_log(&s->inputbuf[9]);*/ - } - } - - PSOCK_END(&s->sin); -} -/*---------------------------------------------------------------------------*/ -static void -handle_connection(struct httpd_state *s) -{ - handle_input(s); - if(s->state == STATE_OUTPUT) { - handle_output(s); - } -} -/*---------------------------------------------------------------------------*/ -void -httpd_appcall(void) -{ - struct httpd_state *s = (struct httpd_state *)&(uip_conn->appstate); - - if(uip_closed() || uip_aborted() || uip_timedout()) { - } else if(uip_connected()) { - PSOCK_INIT(&s->sin, s->inputbuf, sizeof(s->inputbuf) - 1); - PSOCK_INIT(&s->sout, s->inputbuf, sizeof(s->inputbuf) - 1); - PT_INIT(&s->outputpt); - s->state = STATE_WAITING; - /* timer_set(&s->timer, CLOCK_SECOND * 100);*/ - s->timer = 0; - handle_connection(s); - } else if(s != NULL) { - if(uip_poll()) { - ++s->timer; - if(s->timer >= 20) { - uip_abort(); - } - } else { - s->timer = 0; - } - handle_connection(s); - } else { - uip_abort(); - } -} -/*---------------------------------------------------------------------------*/ -/** - * \brief Initialize the web server - * - * This function initializes the web server and should be - * called at system boot-up. - */ -void -httpd_init(void) -{ - uip_listen(HTONS(80)); -} -/*---------------------------------------------------------------------------*/ -/** @} */ diff --git a/components/net/uip/apps/webserver/httpd.h b/components/net/uip/apps/webserver/httpd.h deleted file mode 100644 index 270d49debd..0000000000 --- a/components/net/uip/apps/webserver/httpd.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: httpd.h,v 1.2 2006/06/11 21:46:38 adam Exp $ - * - */ - -#ifndef __HTTPD_H__ -#define __HTTPD_H__ - -#include "psock.h" -#include "httpd-fs.h" - -struct httpd_state { - unsigned char timer; - struct psock sin, sout; - struct pt outputpt, scriptpt; - char inputbuf[50]; - char filename[20]; - char state; - struct httpd_fs_file file; - int len; - char *scriptptr; - int scriptlen; - - unsigned short count; -}; - -void httpd_init(void); -void httpd_appcall(void); - -void httpd_log(char *msg); -void httpd_log_file(u16_t *requester, char *file); - -#endif /* __HTTPD_H__ */ diff --git a/components/net/uip/apps/webserver/makefsdata b/components/net/uip/apps/webserver/makefsdata deleted file mode 100644 index b2109abdb7..0000000000 --- a/components/net/uip/apps/webserver/makefsdata +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/perl - -open(OUTPUT, "> httpd-fsdata.c"); - -chdir("httpd-fs"); - -opendir(DIR, "."); -@files = grep { !/^\./ && !/(CVS|~)/ } readdir(DIR); -closedir(DIR); - -foreach $file (@files) { - - if(-d $file && $file !~ /^\./) { - print "Processing directory $file\n"; - opendir(DIR, $file); - @newfiles = grep { !/^\./ && !/(CVS|~)/ } readdir(DIR); - closedir(DIR); - printf "Adding files @newfiles\n"; - @files = (@files, map { $_ = "$file/$_" } @newfiles); - next; - } -} - -foreach $file (@files) { - if(-f $file) { - - print "Adding file $file\n"; - - open(FILE, $file) || die "Could not open file $file\n"; - - $file =~ s-^-/-; - $fvar = $file; - $fvar =~ s-/-_-g; - $fvar =~ s-\.-_-g; - # for AVR, add PROGMEM here - print(OUTPUT "static const unsigned char data".$fvar."[] = {\n"); - print(OUTPUT "\t/* $file */\n\t"); - for($j = 0; $j < length($file); $j++) { - printf(OUTPUT "%#02x, ", unpack("C", substr($file, $j, 1))); - } - printf(OUTPUT "0,\n"); - - - $i = 0; - while(read(FILE, $data, 1)) { - if($i == 0) { - print(OUTPUT "\t"); - } - printf(OUTPUT "%#02x, ", unpack("C", $data)); - $i++; - if($i == 10) { - print(OUTPUT "\n"); - $i = 0; - } - } - print(OUTPUT "0};\n\n"); - close(FILE); - push(@fvars, $fvar); - push(@pfiles, $file); - } -} - -for($i = 0; $i < @fvars; $i++) { - $file = $pfiles[$i]; - $fvar = $fvars[$i]; - - if($i == 0) { - $prevfile = "NULL"; - } else { - $prevfile = "file" . $fvars[$i - 1]; - } - print(OUTPUT "const struct httpd_fsdata_file file".$fvar."[] = {{$prevfile, data$fvar, "); - print(OUTPUT "data$fvar + ". (length($file) + 1) .", "); - print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n"); -} - -print(OUTPUT "#define HTTPD_FS_ROOT file$fvars[$i - 1]\n\n"); -print(OUTPUT "#define HTTPD_FS_NUMFILES $i\n"); diff --git a/components/net/uip/apps/webserver/makestrings b/components/net/uip/apps/webserver/makestrings deleted file mode 100644 index 20f0e24294..0000000000 --- a/components/net/uip/apps/webserver/makestrings +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/perl - - -sub stringify { - my $name = shift(@_); - open(OUTPUTC, "> $name.c"); - open(OUTPUTH, "> $name.h"); - - open(FILE, "$name"); - - while() { - if(/(.+) "(.+)"/) { - $var = $1; - $data = $2; - - $datan = $data; - $datan =~ s/\\r/\r/g; - $datan =~ s/\\n/\n/g; - $datan =~ s/\\01/\01/g; - $datan =~ s/\\0/\0/g; - - printf(OUTPUTC "const char $var\[%d] = \n", length($datan) + 1); - printf(OUTPUTC "/* \"$data\" */\n"); - printf(OUTPUTC "{"); - for($j = 0; $j < length($datan); $j++) { - printf(OUTPUTC "%#02x, ", unpack("C", substr($datan, $j, 1))); - } - printf(OUTPUTC "};\n"); - - printf(OUTPUTH "extern const char $var\[%d];\n", length($datan) + 1); - - } - } - close(OUTPUTC); - close(OUTPUTH); -} -stringify("http-strings"); - -exit 0; - diff --git a/components/net/uip/apps/webserver/webserver.h b/components/net/uip/apps/webserver/webserver.h deleted file mode 100644 index 48753e690d..0000000000 --- a/components/net/uip/apps/webserver/webserver.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: webserver.h,v 1.2 2006/06/11 21:46:38 adam Exp $ - * - */ -#ifndef __WEBSERVER_H__ -#define __WEBSERVER_H__ - -#include "httpd.h" - -typedef struct httpd_state uip_tcp_appstate_t; -/* UIP_APPCALL: the name of the application function. This function - must return void and take no arguments (i.e., C type "void - appfunc(void)"). */ -#ifndef UIP_APPCALL -#define UIP_APPCALL httpd_appcall -#endif - - -#endif /* __WEBSERVER_H__ */ diff --git a/components/net/uip/doc/Doxyfile b/components/net/uip/doc/Doxyfile deleted file mode 100644 index 8c6223d524..0000000000 --- a/components/net/uip/doc/Doxyfile +++ /dev/null @@ -1,279 +0,0 @@ -# Doxyfile 1.4.6 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "uIP 1.0" -PROJECT_NUMBER = -OUTPUT_DIRECTORY = . -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = ../ \ - ../../ -STRIP_FROM_INC_PATH = -SHORT_NAMES = YES -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = YES -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = NO -GENERATE_DEPRECATEDLIST= NO -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = NO -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = uip-doc.txt \ - pt-doc.txt \ - examples.txt \ - uip-code-style.txt \ - ../uip/uip.h \ - ../uip/uip.c \ - ../uip/uip_arch.h \ - ../uip/uip_arp.h \ - ../uip/uip_arp.c \ - ../unix/uip-conf.h \ - ../uip/uipopt.h \ - ../uip/uip-split.h \ - ../uip/uip-split.c \ - ../uip/uip-neighbor.h \ - ../uip/uip-neighbor.c \ - ../uip/pt.h \ - ../uip/lc.h \ - ../uip/lc-switch.h \ - ../uip/lc-addrlabels.h \ - ../uip/timer.h \ - ../uip/timer.c \ - ../uip/clock.h \ - ../uip/psock.h \ - ../uip/psock.c \ - ../lib/memb.c \ - ../lib/memb.h \ - ../apps/resolv/resolv.h \ - ../apps/resolv/resolv.c \ - ../apps/dhcpc/dhcpc.h \ - ../apps/dhcpc/dhcpc.c \ - ../apps/smtp/smtp.h \ - ../apps/smtp/smtp.c \ - ../apps/telnetd/telnetd.h \ - ../apps/telnetd/telnetd.c \ - ../apps/telnetd/shell.h \ - ../apps/telnetd/shell.c \ - ../apps/hello-world/hello-world.h \ - ../apps/hello-world/hello-world.c \ - ../apps/webclient/webclient.h \ - ../apps/webclient/webclient.c \ - ../apps/webserver/httpd.h \ - ../apps/webserver/httpd-cgi.h \ - ../apps/webserver/httpd-cgi.c \ - ../apps/webserver/httpd.c -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = . ../apps/hello-world ../apps/smtp \ - ../apps/telnetd ../apps/resolv ../apps/webclient \ - ../apps/webserver ../unix ../apps/dhcpc -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = NO -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -USE_HTAGS = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = YES -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = YES -BINARY_TOC = YES -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = header.tex -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = UIP_UDP -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = NO -CLASS_GRAPH = NO -COLLABORATION_GRAPH = NO -GROUP_GRAPHS = NO -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = NO -INCLUDED_BY_GRAPH = NO -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = NO -DIRECTORY_GRAPH = NO -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/components/net/uip/doc/Makefile b/components/net/uip/doc/Makefile deleted file mode 100644 index 249018aa43..0000000000 --- a/components/net/uip/doc/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: htmldoc pdfdoc - -htmldoc: - doxygen Doxyfile - -pdfdoc: htmldoc - cd latex; make refman.pdf && mv refman.pdf ../uip-refman.pdf diff --git a/components/net/uip/doc/README b/components/net/uip/doc/README deleted file mode 100644 index 3a65aef96b..0000000000 --- a/components/net/uip/doc/README +++ /dev/null @@ -1,12 +0,0 @@ -The files in this directory comprise the uIP documentation. The files -are: - -html/ The uIP reference manual in HTML format. - -uip-refman.pdf The uIP reference manual in a printable PDF version. - -mobisys2003.pdf Conference paper about uIP from the First - International Conference on Mobile Systems, - Applications and Services (MobiSys), San - Francisco, May 2003. - diff --git a/components/net/uip/doc/doxygen.sty b/components/net/uip/doc/doxygen.sty deleted file mode 100644 index 15e4f66613..0000000000 --- a/components/net/uip/doc/doxygen.sty +++ /dev/null @@ -1,62 +0,0 @@ -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{doxygen} -\RequirePackage{calc} -\RequirePackage{array} -\pagestyle{fancyplain} -\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} -\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} -\lhead[\fancyplain{}{\bfseries\thepage}] - {\fancyplain{}{\bfseries\rightmark}} -\rhead[\fancyplain{}{\bfseries\leftmark}] - {\fancyplain{}{\bfseries\thepage}} -\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Wed Jun 7 11:37:14 2006 for uIP 1.0-rc0 by doxygen\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Wed Jun 7 11:37:14 2006 for uIP 1.0-rc0 by doxygen}} -\cfoot{} -\newenvironment{CompactList} -{\begin{list}{}{ - \setlength{\leftmargin}{0.5cm} - \setlength{\itemsep}{0pt} - \setlength{\parsep}{0pt} - \setlength{\topsep}{0pt} - \renewcommand{\makelabel}{}}} -{\end{list}} -\newenvironment{CompactItemize} -{ - \begin{itemize} - \setlength{\itemsep}{-3pt} - \setlength{\parsep}{0pt} - \setlength{\topsep}{0pt} - \setlength{\partopsep}{0pt} -} -{\end{itemize}} -\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} -\newlength{\tmplength} -\newenvironment{TabularC}[1] -{ -\setlength{\tmplength} - {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} - \par\begin{tabular*}{\linewidth} - {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} -} -{\end{tabular*}\par} -\newcommand{\entrylabel}[1]{ - {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\\}}} -\newenvironment{Desc} -{\begin{list}{} - { - \settowidth{\labelwidth}{40pt} - \setlength{\leftmargin}{\labelwidth} - \setlength{\parsep}{0pt} - \setlength{\itemsep}{-4pt} - \renewcommand{\makelabel}{\entrylabel} - } -} -{\end{list}} -\newenvironment{Indent} - {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} - \item[]\ignorespaces} - {\unskip\end{list}} -\setlength{\parindent}{0cm} -\setlength{\parskip}{0.2cm} -\addtocounter{secnumdepth}{1} -\sloppy -\usepackage[T1]{fontenc} diff --git a/components/net/uip/doc/example-mainloop-with-arp.c b/components/net/uip/doc/example-mainloop-with-arp.c deleted file mode 100644 index 7ed72c538b..0000000000 --- a/components/net/uip/doc/example-mainloop-with-arp.c +++ /dev/null @@ -1,86 +0,0 @@ -#include "uip.h" -#include "uip_arp.h" -#include "network-device.h" -#include "httpd.h" -#include "timer.h" - -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) - -/*---------------------------------------------------------------------------*/ -int -main(void) -{ - int i; - uip_ipaddr_t ipaddr; - struct timer periodic_timer, arp_timer; - - timer_set(&periodic_timer, CLOCK_SECOND / 2); - timer_set(&arp_timer, CLOCK_SECOND * 10); - - network_device_init(); - uip_init(); - - uip_ipaddr(ipaddr, 192,168,0,2); - uip_sethostaddr(ipaddr); - - httpd_init(); - - while(1) { - uip_len = network_device_read(); - if(uip_len > 0) { - if(BUF->type == htons(UIP_ETHTYPE_IP)) { - uip_arp_ipin(); - uip_input(); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - uip_arp_out(); - network_device_send(); - } - } else if(BUF->type == htons(UIP_ETHTYPE_ARP)) { - uip_arp_arpin(); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - network_device_send(); - } - } - - } else if(timer_expired(&periodic_timer)) { - timer_reset(&periodic_timer); - for(i = 0; i < UIP_CONNS; i++) { - uip_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - uip_arp_out(); - network_device_send(); - } - } - -#if UIP_UDP - for(i = 0; i < UIP_UDP_CONNS; i++) { - uip_udp_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - uip_arp_out(); - network_device_send(); - } - } -#endif /* UIP_UDP */ - - /* Call the ARP timer function every 10 seconds. */ - if(timer_expired(&arp_timer)) { - timer_reset(&arp_timer); - uip_arp_timer(); - } - } - } - return 0; -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/doc/example-mainloop-without-arp.c b/components/net/uip/doc/example-mainloop-without-arp.c deleted file mode 100644 index 85800e3ae4..0000000000 --- a/components/net/uip/doc/example-mainloop-without-arp.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "uip.h" -#include "uip_arp.h" -#include "network-device.h" -#include "httpd.h" -#include "timer.h" - -/*---------------------------------------------------------------------------*/ -int -main(void) -{ - int i; - uip_ipaddr_t ipaddr; - struct timer periodic_timer; - - timer_set(&periodic_timer, CLOCK_SECOND / 2); - - network_device_init(); - uip_init(); - - uip_ipaddr(ipaddr, 192,168,0,2); - uip_sethostaddr(ipaddr); - - httpd_init(); - - while(1) { - uip_len = network_device_read(); - if(uip_len > 0) { - uip_input(); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - network_device_send(); - } - } else if(timer_expired(&periodic_timer)) { - timer_reset(&periodic_timer); - for(i = 0; i < UIP_CONNS; i++) { - uip_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - network_device_send(); - } - } - -#if UIP_UDP - for(i = 0; i < UIP_UDP_CONNS; i++) { - uip_udp_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - network_device_send(); - } - } -#endif /* UIP_UDP */ - } - } - return 0; -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/doc/examples.txt b/components/net/uip/doc/examples.txt deleted file mode 100644 index 31edddc381..0000000000 --- a/components/net/uip/doc/examples.txt +++ /dev/null @@ -1,34 +0,0 @@ -/** -\defgroup apps Applications -@{ - -The uIP distribution contains a number of example applications that -can be either used directory or studied when learning to develop -applications for uIP. - -*/ - -/** \example hello-world.c */ -/** \example hello-world.h */ - -/** \example smtp.c */ -/** \example smtp.h */ - -/** \example webclient.c */ -/** \example webclient.h */ - -/** \example example-mainloop-with-arp.c */ -/** \example example-mainloop-without-arp.c */ - -/** \example telnetd.c */ -/** \example telnetd.h */ - -/** \example resolv.c */ -/** \example resolv.h */ - -/** \example dhcpc.c */ -/** \example dhcpc.h */ - -/** \example uip-conf.h */ - -/** @} */ diff --git a/components/net/uip/doc/header.tex b/components/net/uip/doc/header.tex deleted file mode 100644 index ce91c30f28..0000000000 --- a/components/net/uip/doc/header.tex +++ /dev/null @@ -1,53 +0,0 @@ -\documentclass[a4paper]{book} -\usepackage{a4wide} -\usepackage{makeidx} -\usepackage{fancyhdr} -\usepackage{graphicx} -\usepackage{multicol} -\usepackage{float} -\usepackage{textcomp} -\usepackage{alltt} -\usepackage{times} -\ifx\pdfoutput\undefined -\usepackage[ps2pdf, - pagebackref=true, - colorlinks=true, - linkcolor=blue - ]{hyperref} -\usepackage{pspicture} -\else -\usepackage[pdftex, - pagebackref=true, - colorlinks=true, - linkcolor=blue - ]{hyperref} -\fi -\usepackage{doxygen} -\makeindex -\setcounter{tocdepth}{1} -\renewcommand{\footrulewidth}{0.4pt} -\begin{document} -\begin{titlepage} -\vspace*{5cm} -\begin{center} -{\Huge The uIP Embedded TCP/IP Stack}\\ -\vspace*{1cm} -{\LARGE The uIP 1.0 Reference Manual}\\ -\vspace*{3cm} -{\Large June 2006}\\ -\vspace*{2cm} -\includegraphics[width=6cm]{../sicslogo.pdf}\\ -\vspace*{1cm} -{\Large Adam Dunkels}\\ -{\Large \texttt{adam@sics.se}}\\ -\vspace*{1cm} -{\LARGE Swedish Institute of Computer Science}\\ -\vspace*{0.5cm} - -\end{center} -\end{titlepage} -\clearemptydoublepage -\pagenumbering{roman} -\tableofcontents -\clearemptydoublepage -\pagenumbering{arabic} diff --git a/components/net/uip/doc/html/a00036.html b/components/net/uip/doc/html/a00036.html deleted file mode 100644 index 9ee3cf2840..0000000000 --- a/components/net/uip/doc/html/a00036.html +++ /dev/null @@ -1,120 +0,0 @@ - - -uIP 1.0: hello-world.c - - - - - -

hello-world.c

00001 /**
-00002  * \addtogroup helloworld
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  *         An example of how to write uIP applications
-00009  *         with protosockets.
-00010  * \author
-00011  *         Adam Dunkels <adam@sics.se>
-00012  */
-00013 
-00014 /*
-00015  * This is a short example of how to write uIP applications using
-00016  * protosockets.
-00017  */
-00018 
-00019 /*
-00020  * We define the application state (struct hello_world_state) in the
-00021  * hello-world.h file, so we need to include it here. We also include
-00022  * uip.h (since this cannot be included in hello-world.h) and
-00023  * <string.h>, since we use the memcpy() function in the code.
-00024  */
-00025 #include "hello-world.h"
-00026 #include "uip.h"
-00027 #include <string.h>
-00028 
-00029 /*
-00030  * Declaration of the protosocket function that handles the connection
-00031  * (defined at the end of the code).
-00032  */
-00033 static int handle_connection(struct hello_world_state *s);
-00034 /*---------------------------------------------------------------------------*/
-00035 /*
-00036  * The initialization function. We must explicitly call this function
-00037  * from the system initialization code, some time after uip_init() is
-00038  * called.
-00039  */
-00040 void
-00041 hello_world_init(void)
-00042 {
-00043   /* We start to listen for connections on TCP port 1000. */
-00044   uip_listen(HTONS(1000));
-00045 }
-00046 /*---------------------------------------------------------------------------*/
-00047 /*
-00048  * In hello-world.h we have defined the UIP_APPCALL macro to
-00049  * hello_world_appcall so that this funcion is uIP's application
-00050  * function. This function is called whenever an uIP event occurs
-00051  * (e.g. when a new connection is established, new data arrives, sent
-00052  * data is acknowledged, data needs to be retransmitted, etc.).
-00053  */
-00054 void
-00055 hello_world_appcall(void)
-00056 {
-00057   /*
-00058    * The uip_conn structure has a field called "appstate" that holds
-00059    * the application state of the connection. We make a pointer to
-00060    * this to access it easier.
-00061    */
-00062   struct hello_world_state *s = &(uip_conn->appstate);
-00063 
-00064   /*
-00065    * If a new connection was just established, we should initialize
-00066    * the protosocket in our applications' state structure.
-00067    */
-00068   if(uip_connected()) {
-00069     PSOCK_INIT(&s->p, s->inputbuffer, sizeof(s->inputbuffer));
-00070   }
-00071 
-00072   /*
-00073    * Finally, we run the protosocket function that actually handles
-00074    * the communication. We pass it a pointer to the application state
-00075    * of the current connection.
-00076    */
-00077   handle_connection(s);
-00078 }
-00079 /*---------------------------------------------------------------------------*/
-00080 /*
-00081  * This is the protosocket function that handles the communication. A
-00082  * protosocket function must always return an int, but must never
-00083  * explicitly return - all return statements are hidden in the PSOCK
-00084  * macros.
-00085  */
-00086 static int
-00087 handle_connection(struct hello_world_state *s)
-00088 {
-00089   PSOCK_BEGIN(&s->p);
-00090 
-00091   PSOCK_SEND_STR(&s->p, "Hello. What is your name?\n");
-00092   PSOCK_READTO(&s->p, '\n');
-00093   strncpy(s->name, s->inputbuffer, sizeof(s->name));
-00094   PSOCK_SEND_STR(&s->p, "Hello ");
-00095   PSOCK_SEND_STR(&s->p, s->name);
-00096   PSOCK_CLOSE(&s->p);
-00097   
-00098   PSOCK_END(&s->p);
-00099 }
-00100 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00037.html b/components/net/uip/doc/html/a00037.html deleted file mode 100644 index 13d709be48..0000000000 --- a/components/net/uip/doc/html/a00037.html +++ /dev/null @@ -1,72 +0,0 @@ - - -uIP 1.0: hello-world.h - - - - - -

hello-world.h

00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup helloworld Hello, world
-00008  * @{
-00009  *
-00010  * A small example showing how to write applications with
-00011  * \ref psock "protosockets".
-00012  */
-00013 
-00014 /**
-00015  * \file
-00016  *         Header file for an example of how to write uIP applications
-00017  *         with protosockets.
-00018  * \author
-00019  *         Adam Dunkels <adam@sics.se>
-00020  */
-00021 
-00022 #ifndef __HELLO_WORLD_H__
-00023 #define __HELLO_WORLD_H__
-00024 
-00025 /* Since this file will be included by uip.h, we cannot include uip.h
-00026    here. But we might need to include uipopt.h if we need the u8_t and
-00027    u16_t datatypes. */
-00028 #include "uipopt.h"
-00029 
-00030 #include "psock.h"
-00031 
-00032 /* Next, we define the uip_tcp_appstate_t datatype. This is the state
-00033    of our application, and the memory required for this state is
-00034    allocated together with each TCP connection. One application state
-00035    for each TCP connection. */
-00036 typedef struct hello_world_state {
-00037   struct psock p;
-00038   char inputbuffer[10];
-00039   char name[40];
-00040 } uip_tcp_appstate_t;
-00041 
-00042 /* Finally we define the application function to be called by uIP. */
-00043 void hello_world_appcall(void);
-00044 #ifndef UIP_APPCALL
-00045 #define UIP_APPCALL hello_world_appcall
-00046 #endif /* UIP_APPCALL */
-00047 
-00048 void hello_world_init(void);
-00049 
-00050 #endif /* __HELLO_WORLD_H__ */
-00051 /** @} */
-00052 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00038.html b/components/net/uip/doc/html/a00038.html deleted file mode 100644 index f62a2738bc..0000000000 --- a/components/net/uip/doc/html/a00038.html +++ /dev/null @@ -1,282 +0,0 @@ - - -uIP 1.0: smtp.c - - - - - -

smtp.c

00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup smtp SMTP E-mail sender
-00008  * @{
-00009  *
-00010  * The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is
-00011  * the standard way of sending and transfering e-mail on the
-00012  * Internet. This simple example implementation is intended as an
-00013  * example of how to implement protocols in uIP, and is able to send
-00014  * out e-mail but has not been extensively tested.
-00015  */
-00016 
-00017 /**
-00018  * \file
-00019  * SMTP example implementation
-00020  * \author Adam Dunkels <adam@dunkels.com>
-00021  */
-00022 
-00023 /*
-00024  * Copyright (c) 2004, Adam Dunkels.
-00025  * All rights reserved.
-00026  *
-00027  * Redistribution and use in source and binary forms, with or without
-00028  * modification, are permitted provided that the following conditions
-00029  * are met:
-00030  * 1. Redistributions of source code must retain the above copyright
-00031  *    notice, this list of conditions and the following disclaimer.
-00032  * 2. Redistributions in binary form must reproduce the above copyright
-00033  *    notice, this list of conditions and the following disclaimer in the
-00034  *    documentation and/or other materials provided with the distribution.
-00035  * 3. Neither the name of the Institute nor the names of its contributors
-00036  *    may be used to endorse or promote products derived from this software
-00037  *    without specific prior written permission.
-00038  *
-00039  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00040  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00041  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00042  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00043  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00044  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00045  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00046  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00047  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00048  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00049  * SUCH DAMAGE.
-00050  *
-00051  * This file is part of the uIP TCP/IP stack.
-00052  *
-00053  * Author: Adam Dunkels <adam@sics.se>
-00054  *
-00055  * $Id: smtp.c,v 1.4 2006/06/11 21:46:37 adam Exp $
-00056  */
-00057 #include "smtp.h"
-00058 
-00059 #include "smtp-strings.h"
-00060 #include "psock.h"
-00061 #include "uip.h"
-00062 
-00063 #include <string.h>
-00064 
-00065 static struct smtp_state s;
-00066 
-00067 static char *localhostname;
-00068 static uip_ipaddr_t smtpserver;
-00069 
-00070 #define ISO_nl 0x0a
-00071 #define ISO_cr 0x0d
-00072 
-00073 #define ISO_period 0x2e
-00074 
-00075 #define ISO_2  0x32
-00076 #define ISO_3  0x33
-00077 #define ISO_4  0x34
-00078 #define ISO_5  0x35
-00079 
-00080 
-00081 /*---------------------------------------------------------------------------*/
-00082 static
-00083 PT_THREAD(smtp_thread(void))
-00084 {
-00085   PSOCK_BEGIN(&s.psock);
-00086 
-00087   PSOCK_READTO(&s.psock, ISO_nl);
-00088    
-00089   if(strncmp(s.inputbuffer, smtp_220, 3) != 0) {
-00090     PSOCK_CLOSE(&s.psock);
-00091     smtp_done(2);
-00092     PSOCK_EXIT(&s.psock);
-00093   }
-00094   
-00095   PSOCK_SEND_STR(&s.psock, (char *)smtp_helo);
-00096   PSOCK_SEND_STR(&s.psock, localhostname);
-00097   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00098 
-00099   PSOCK_READTO(&s.psock, ISO_nl);
-00100   
-00101   if(s.inputbuffer[0] != ISO_2) {
-00102     PSOCK_CLOSE(&s.psock);
-00103     smtp_done(3);
-00104     PSOCK_EXIT(&s.psock);
-00105   }
-00106 
-00107   PSOCK_SEND_STR(&s.psock, (char *)smtp_mail_from);
-00108   PSOCK_SEND_STR(&s.psock, s.from);
-00109   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00110 
-00111   PSOCK_READTO(&s.psock, ISO_nl);
-00112   
-00113   if(s.inputbuffer[0] != ISO_2) {
-00114     PSOCK_CLOSE(&s.psock);
-00115     smtp_done(4);
-00116     PSOCK_EXIT(&s.psock);
-00117   }
-00118 
-00119   PSOCK_SEND_STR(&s.psock, (char *)smtp_rcpt_to);
-00120   PSOCK_SEND_STR(&s.psock, s.to);
-00121   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00122 
-00123   PSOCK_READTO(&s.psock, ISO_nl);
-00124   
-00125   if(s.inputbuffer[0] != ISO_2) {
-00126     PSOCK_CLOSE(&s.psock);
-00127     smtp_done(5);
-00128     PSOCK_EXIT(&s.psock);
-00129   }
-00130   
-00131   if(s.cc != 0) {
-00132     PSOCK_SEND_STR(&s.psock, (char *)smtp_rcpt_to);
-00133     PSOCK_SEND_STR(&s.psock, s.cc);
-00134     PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00135 
-00136     PSOCK_READTO(&s.psock, ISO_nl);
-00137   
-00138     if(s.inputbuffer[0] != ISO_2) {
-00139       PSOCK_CLOSE(&s.psock);
-00140       smtp_done(6);
-00141       PSOCK_EXIT(&s.psock);
-00142     }
-00143   }
-00144   
-00145   PSOCK_SEND_STR(&s.psock, (char *)smtp_data);
-00146   
-00147   PSOCK_READTO(&s.psock, ISO_nl);
-00148   
-00149   if(s.inputbuffer[0] != ISO_3) {
-00150     PSOCK_CLOSE(&s.psock);
-00151     smtp_done(7);
-00152     PSOCK_EXIT(&s.psock);
-00153   }
-00154 
-00155   PSOCK_SEND_STR(&s.psock, (char *)smtp_to);
-00156   PSOCK_SEND_STR(&s.psock, s.to);
-00157   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00158   
-00159   if(s.cc != 0) {
-00160     PSOCK_SEND_STR(&s.psock, (char *)smtp_cc);
-00161     PSOCK_SEND_STR(&s.psock, s.cc);
-00162     PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00163   }
-00164   
-00165   PSOCK_SEND_STR(&s.psock, (char *)smtp_from);
-00166   PSOCK_SEND_STR(&s.psock, s.from);
-00167   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00168   
-00169   PSOCK_SEND_STR(&s.psock, (char *)smtp_subject);
-00170   PSOCK_SEND_STR(&s.psock, s.subject);
-00171   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00172 
-00173   PSOCK_SEND(&s.psock, s.msg, s.msglen);
-00174   
-00175   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnlperiodcrnl);
-00176 
-00177   PSOCK_READTO(&s.psock, ISO_nl);
-00178   if(s.inputbuffer[0] != ISO_2) {
-00179     PSOCK_CLOSE(&s.psock);
-00180     smtp_done(8);
-00181     PSOCK_EXIT(&s.psock);
-00182   }
-00183 
-00184   PSOCK_SEND_STR(&s.psock, (char *)smtp_quit);
-00185   smtp_done(SMTP_ERR_OK);
-00186   PSOCK_END(&s.psock);
-00187 }
-00188 /*---------------------------------------------------------------------------*/
-00189 void
-00190 smtp_appcall(void)
-00191 {
-00192   if(uip_closed()) {
-00193     s.connected = 0;
-00194     return;
-00195   }
-00196   if(uip_aborted() || uip_timedout()) {
-00197     s.connected = 0;
-00198     smtp_done(1);
-00199     return;
-00200   }
-00201   smtp_thread();
-00202 }
-00203 /*---------------------------------------------------------------------------*/
-00204 /**
-00205  * Specificy an SMTP server and hostname.
-00206  *
-00207  * This function is used to configure the SMTP module with an SMTP
-00208  * server and the hostname of the host.
-00209  *
-00210  * \param lhostname The hostname of the uIP host.
-00211  *
-00212  * \param server A pointer to a 4-byte array representing the IP
-00213  * address of the SMTP server to be configured.
-00214  */
-00215 void
-00216 smtp_configure(char *lhostname, void *server)
-00217 {
-00218   localhostname = lhostname;
-00219   uip_ipaddr_copy(smtpserver, server);
-00220 }
-00221 /*---------------------------------------------------------------------------*/
-00222 /**
-00223  * Send an e-mail.
-00224  *
-00225  * \param to The e-mail address of the receiver of the e-mail.
-00226  * \param cc The e-mail address of the CC: receivers of the e-mail.
-00227  * \param from The e-mail address of the sender of the e-mail.
-00228  * \param subject The subject of the e-mail.
-00229  * \param msg The actual e-mail message.
-00230  * \param msglen The length of the e-mail message.
-00231  */
-00232 unsigned char
-00233 smtp_send(char *to, char *cc, char *from,
-00234           char *subject, char *msg, u16_t msglen)
-00235 {
-00236   struct uip_conn *conn;
-00237 
-00238   conn = uip_connect(smtpserver, HTONS(25));
-00239   if(conn == NULL) {
-00240     return 0;
-00241   }
-00242   s.connected = 1;
-00243   s.to = to;
-00244   s.cc = cc;
-00245   s.from = from;
-00246   s.subject = subject;
-00247   s.msg = msg;
-00248   s.msglen = msglen;
-00249 
-00250   PSOCK_INIT(&s.psock, s.inputbuffer, sizeof(s.inputbuffer));
-00251   
-00252   return 1;
-00253 }
-00254 /*---------------------------------------------------------------------------*/
-00255 void
-00256 smtp_init(void)
-00257 {
-00258   s.connected = 0;
-00259 }
-00260 /*---------------------------------------------------------------------------*/
-00261 /** @} */
-00262 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00039.html b/components/net/uip/doc/html/a00039.html deleted file mode 100644 index fb02d5ad46..0000000000 --- a/components/net/uip/doc/html/a00039.html +++ /dev/null @@ -1,123 +0,0 @@ - - -uIP 1.0: smtp.h - - - - - -

smtp.h

00001 
-00002 /**
-00003  * \addtogroup smtp
-00004  * @{
-00005  */
-00006 
-00007 
-00008 /**
-00009  * \file
-00010  * SMTP header file
-00011  * \author Adam Dunkels <adam@dunkels.com>
-00012  */
-00013 
-00014 /*
-00015  * Copyright (c) 2002, Adam Dunkels.
-00016  * All rights reserved.
-00017  *
-00018  * Redistribution and use in source and binary forms, with or without
-00019  * modification, are permitted provided that the following conditions
-00020  * are met:
-00021  * 1. Redistributions of source code must retain the above copyright
-00022  *    notice, this list of conditions and the following disclaimer.
-00023  * 2. Redistributions in binary form must reproduce the above copyright
-00024  *    notice, this list of conditions and the following disclaimer in the
-00025  *    documentation and/or other materials provided with the distribution.
-00026  * 3. The name of the author may not be used to endorse or promote
-00027  *    products derived from this software without specific prior
-00028  *    written permission.
-00029  *
-00030  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00031  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00032  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00033  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00034  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00035  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00036  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00037  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00038  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00039  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00040  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00041  *
-00042  * This file is part of the uIP TCP/IP stack.
-00043  *
-00044  * $Id: smtp.h,v 1.4 2006/06/11 21:46:37 adam Exp $
-00045  *
-00046  */
-00047 #ifndef __SMTP_H__
-00048 #define __SMTP_H__
-00049 
-00050 #include "uipopt.h"
-00051 
-00052 /**
-00053  * Error number that signifies a non-error condition.
-00054  */
-00055 #define SMTP_ERR_OK 0
-00056 
-00057 /**
-00058  * Callback function that is called when an e-mail transmission is
-00059  * done.
-00060  *
-00061  * This function must be implemented by the module that uses the SMTP
-00062  * module.
-00063  *
-00064  * \param error The number of the error if an error occured, or
-00065  * SMTP_ERR_OK.
-00066  */
-00067 void smtp_done(unsigned char error);
-00068 
-00069 void smtp_init(void);
-00070 
-00071 /* Functions. */
-00072 void smtp_configure(char *localhostname, u16_t *smtpserver);
-00073 unsigned char smtp_send(char *to, char *from,
-00074                         char *subject, char *msg,
-00075                         u16_t msglen);
-00076 #define SMTP_SEND(to, cc, from, subject, msg) \
-00077         smtp_send(to, cc, from, subject, msg, strlen(msg))
-00078 
-00079 void smtp_appcall(void);
-00080 
-00081 struct smtp_state {
-00082   u8_t state;
-00083   char *to;
-00084   char *from;
-00085   char *subject;
-00086   char *msg;
-00087   u16_t msglen;
-00088   
-00089   u16_t sentlen, textlen;
-00090   u16_t sendptr;
-00091 
-00092 };
-00093 
-00094 
-00095 #ifndef UIP_APPCALL
-00096 #define UIP_APPCALL     smtp_appcall
-00097 #endif
-00098 typedef struct smtp_state uip_tcp_appstate_t;
-00099 
-00100 
-00101 #endif /* __SMTP_H__ */
-00102 
-00103 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00040.html b/components/net/uip/doc/html/a00040.html deleted file mode 100644 index 1b1f55425a..0000000000 --- a/components/net/uip/doc/html/a00040.html +++ /dev/null @@ -1,459 +0,0 @@ - - -uIP 1.0: webclient.c - - - - - -

webclient.c

00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup webclient Web client
-00008  * @{
-00009  *
-00010  * This example shows a HTTP client that is able to download web pages
-00011  * and files from web servers. It requires a number of callback
-00012  * functions to be implemented by the module that utilizes the code:
-00013  * webclient_datahandler(), webclient_connected(),
-00014  * webclient_timedout(), webclient_aborted(), webclient_closed().
-00015  */
-00016 
-00017 /**
-00018  * \file
-00019  * Implementation of the HTTP client.
-00020  * \author Adam Dunkels <adam@dunkels.com>
-00021  */
-00022 
-00023 /*
-00024  * Copyright (c) 2002, Adam Dunkels.
-00025  * All rights reserved.
-00026  *
-00027  * Redistribution and use in source and binary forms, with or without
-00028  * modification, are permitted provided that the following conditions
-00029  * are met:
-00030  * 1. Redistributions of source code must retain the above copyright
-00031  *    notice, this list of conditions and the following disclaimer.
-00032  * 2. Redistributions in binary form must reproduce the above
-00033  *    copyright notice, this list of conditions and the following
-00034  *    disclaimer in the documentation and/or other materials provided
-00035  *    with the distribution.
-00036  * 3. The name of the author may not be used to endorse or promote
-00037  *    products derived from this software without specific prior
-00038  *    written permission.
-00039  *
-00040  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00041  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00042  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00043  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00044  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00045  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00046  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00047  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00048  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00049  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00050  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00051  *
-00052  * This file is part of the uIP TCP/IP stack.
-00053  *
-00054  * $Id: webclient.c,v 1.2 2006/06/11 21:46:37 adam Exp $
-00055  *
-00056  */
-00057 
-00058 #include "uip.h"
-00059 #include "uiplib.h"
-00060 #include "webclient.h"
-00061 #include "resolv.h"
-00062 
-00063 #include <string.h>
-00064 
-00065 #define WEBCLIENT_TIMEOUT 100
-00066 
-00067 #define WEBCLIENT_STATE_STATUSLINE 0
-00068 #define WEBCLIENT_STATE_HEADERS    1
-00069 #define WEBCLIENT_STATE_DATA       2
-00070 #define WEBCLIENT_STATE_CLOSE      3
-00071 
-00072 #define HTTPFLAG_NONE   0
-00073 #define HTTPFLAG_OK     1
-00074 #define HTTPFLAG_MOVED  2
-00075 #define HTTPFLAG_ERROR  3
-00076 
-00077 
-00078 #define ISO_nl       0x0a
-00079 #define ISO_cr       0x0d
-00080 #define ISO_space    0x20
-00081 
-00082 
-00083 static struct webclient_state s;
-00084 
-00085 /*-----------------------------------------------------------------------------------*/
-00086 char *
-00087 webclient_mimetype(void)
-00088 {
-00089   return s.mimetype;
-00090 }
-00091 /*-----------------------------------------------------------------------------------*/
-00092 char *
-00093 webclient_filename(void)
-00094 {
-00095   return s.file;
-00096 }
-00097 /*-----------------------------------------------------------------------------------*/
-00098 char *
-00099 webclient_hostname(void)
-00100 {
-00101   return s.host;
-00102 }
-00103 /*-----------------------------------------------------------------------------------*/
-00104 unsigned short
-00105 webclient_port(void)
-00106 {
-00107   return s.port;
-00108 }
-00109 /*-----------------------------------------------------------------------------------*/
-00110 void
-00111 webclient_init(void)
-00112 {
-00113 
-00114 }
-00115 /*-----------------------------------------------------------------------------------*/
-00116 static void
-00117 init_connection(void)
-00118 {
-00119   s.state = WEBCLIENT_STATE_STATUSLINE;
-00120 
-00121   s.getrequestleft = sizeof(http_get) - 1 + 1 +
-00122     sizeof(http_10) - 1 +
-00123     sizeof(http_crnl) - 1 +
-00124     sizeof(http_host) - 1 +
-00125     sizeof(http_crnl) - 1 +
-00126     strlen(http_user_agent_fields) +
-00127     strlen(s.file) + strlen(s.host);
-00128   s.getrequestptr = 0;
-00129 
-00130   s.httpheaderlineptr = 0;
-00131 }
-00132 /*-----------------------------------------------------------------------------------*/
-00133 void
-00134 webclient_close(void)
-00135 {
-00136   s.state = WEBCLIENT_STATE_CLOSE;
-00137 }
-00138 /*-----------------------------------------------------------------------------------*/
-00139 unsigned char
-00140 webclient_get(char *host, u16_t port, char *file)
-00141 {
-00142   struct uip_conn *conn;
-00143   uip_ipaddr_t *ipaddr;
-00144   static uip_ipaddr_t addr;
-00145   
-00146   /* First check if the host is an IP address. */
-00147   ipaddr = &addr;
-00148   if(uiplib_ipaddrconv(host, (unsigned char *)addr) == 0) {
-00149     ipaddr = (uip_ipaddr_t *)resolv_lookup(host);
-00150     
-00151     if(ipaddr == NULL) {
-00152       return 0;
-00153     }
-00154   }
-00155   
-00156   conn = uip_connect(ipaddr, htons(port));
-00157   
-00158   if(conn == NULL) {
-00159     return 0;
-00160   }
-00161   
-00162   s.port = port;
-00163   strncpy(s.file, file, sizeof(s.file));
-00164   strncpy(s.host, host, sizeof(s.host));
-00165   
-00166   init_connection();
-00167   return 1;
-00168 }
-00169 /*-----------------------------------------------------------------------------------*/
-00170 static unsigned char *
-00171 copy_string(unsigned char *dest,
-00172             const unsigned char *src, unsigned char len)
-00173 {
-00174   strncpy(dest, src, len);
-00175   return dest + len;
-00176 }
-00177 /*-----------------------------------------------------------------------------------*/
-00178 static void
-00179 senddata(void)
-00180 {
-00181   u16_t len;
-00182   char *getrequest;
-00183   char *cptr;
-00184   
-00185   if(s.getrequestleft > 0) {
-00186     cptr = getrequest = (char *)uip_appdata;
-00187 
-00188     cptr = copy_string(cptr, http_get, sizeof(http_get) - 1);
-00189     cptr = copy_string(cptr, s.file, strlen(s.file));
-00190     *cptr++ = ISO_space;
-00191     cptr = copy_string(cptr, http_10, sizeof(http_10) - 1);
-00192 
-00193     cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1);
-00194     
-00195     cptr = copy_string(cptr, http_host, sizeof(http_host) - 1);
-00196     cptr = copy_string(cptr, s.host, strlen(s.host));
-00197     cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1);
-00198 
-00199     cptr = copy_string(cptr, http_user_agent_fields,
-00200                        strlen(http_user_agent_fields));
-00201     
-00202     len = s.getrequestleft > uip_mss()?
-00203       uip_mss():
-00204       s.getrequestleft;
-00205     uip_send(&(getrequest[s.getrequestptr]), len);
-00206   }
-00207 }
-00208 /*-----------------------------------------------------------------------------------*/
-00209 static void
-00210 acked(void)
-00211 {
-00212   u16_t len;
-00213   
-00214   if(s.getrequestleft > 0) {
-00215     len = s.getrequestleft > uip_mss()?
-00216       uip_mss():
-00217       s.getrequestleft;
-00218     s.getrequestleft -= len;
-00219     s.getrequestptr += len;
-00220   }
-00221 }
-00222 /*-----------------------------------------------------------------------------------*/
-00223 static u16_t
-00224 parse_statusline(u16_t len)
-00225 {
-00226   char *cptr;
-00227   
-00228   while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) {
-00229     s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata;
-00230     ++((char *)uip_appdata);
-00231     --len;
-00232     if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) {
-00233 
-00234       if((strncmp(s.httpheaderline, http_10,
-00235                   sizeof(http_10) - 1) == 0) ||
-00236          (strncmp(s.httpheaderline, http_11,
-00237                   sizeof(http_11) - 1) == 0)) {
-00238         cptr = &(s.httpheaderline[9]);
-00239         s.httpflag = HTTPFLAG_NONE;
-00240         if(strncmp(cptr, http_200, sizeof(http_200) - 1) == 0) {
-00241           /* 200 OK */
-00242           s.httpflag = HTTPFLAG_OK;
-00243         } else if(strncmp(cptr, http_301, sizeof(http_301) - 1) == 0 ||
-00244                   strncmp(cptr, http_302, sizeof(http_302) - 1) == 0) {
-00245           /* 301 Moved permanently or 302 Found. Location: header line
-00246              will contain thw new location. */
-00247           s.httpflag = HTTPFLAG_MOVED;
-00248         } else {
-00249           s.httpheaderline[s.httpheaderlineptr - 1] = 0;
-00250         }
-00251       } else {
-00252         uip_abort();
-00253         webclient_aborted();
-00254         return 0;
-00255       }
-00256       
-00257       /* We're done parsing the status line, so we reset the pointer
-00258          and start parsing the HTTP headers.*/
-00259       s.httpheaderlineptr = 0;
-00260       s.state = WEBCLIENT_STATE_HEADERS;
-00261       break;
-00262     } else {
-00263       ++s.httpheaderlineptr;
-00264     }
-00265   }
-00266   return len;
-00267 }
-00268 /*-----------------------------------------------------------------------------------*/
-00269 static char
-00270 casecmp(char *str1, const char *str2, char len)
-00271 {
-00272   static char c;
-00273   
-00274   while(len > 0) {
-00275     c = *str1;
-00276     /* Force lower-case characters. */
-00277     if(c & 0x40) {
-00278       c |= 0x20;
-00279     }
-00280     if(*str2 != c) {
-00281       return 1;
-00282     }
-00283     ++str1;
-00284     ++str2;
-00285     --len;
-00286   }
-00287   return 0;
-00288 }
-00289 /*-----------------------------------------------------------------------------------*/
-00290 static u16_t
-00291 parse_headers(u16_t len)
-00292 {
-00293   char *cptr;
-00294   static unsigned char i;
-00295   
-00296   while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) {
-00297     s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata;
-00298     ++((char *)uip_appdata);
-00299     --len;
-00300     if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) {
-00301       /* We have an entire HTTP header line in s.httpheaderline, so
-00302          we parse it. */
-00303       if(s.httpheaderline[0] == ISO_cr) {
-00304         /* This was the last header line (i.e., and empty "\r\n"), so
-00305            we are done with the headers and proceed with the actual
-00306            data. */
-00307         s.state = WEBCLIENT_STATE_DATA;
-00308         return len;
-00309       }
-00310 
-00311       s.httpheaderline[s.httpheaderlineptr - 1] = 0;
-00312       /* Check for specific HTTP header fields. */
-00313       if(casecmp(s.httpheaderline, http_content_type,
-00314                      sizeof(http_content_type) - 1) == 0) {
-00315         /* Found Content-type field. */
-00316         cptr = strchr(s.httpheaderline, ';');
-00317         if(cptr != NULL) {
-00318           *cptr = 0;
-00319         }
-00320         strncpy(s.mimetype, s.httpheaderline +
-00321                 sizeof(http_content_type) - 1, sizeof(s.mimetype));
-00322       } else if(casecmp(s.httpheaderline, http_location,
-00323                             sizeof(http_location) - 1) == 0) {
-00324         cptr = s.httpheaderline +
-00325           sizeof(http_location) - 1;
-00326         
-00327         if(strncmp(cptr, http_http, 7) == 0) {
-00328           cptr += 7;
-00329           for(i = 0; i < s.httpheaderlineptr - 7; ++i) {
-00330             if(*cptr == 0 ||
-00331                *cptr == '/' ||
-00332                *cptr == ' ' ||
-00333                *cptr == ':') {
-00334               s.host[i] = 0;
-00335               break;
-00336             }
-00337             s.host[i] = *cptr;
-00338             ++cptr;
-00339           }
-00340         }
-00341         strncpy(s.file, cptr, sizeof(s.file));
-00342         /*      s.file[s.httpheaderlineptr - i] = 0;*/
-00343       }
-00344 
-00345 
-00346       /* We're done parsing, so we reset the pointer and start the
-00347          next line. */
-00348       s.httpheaderlineptr = 0;
-00349     } else {
-00350       ++s.httpheaderlineptr;
-00351     }
-00352   }
-00353   return len;
-00354 }
-00355 /*-----------------------------------------------------------------------------------*/
-00356 static void
-00357 newdata(void)
-00358 {
-00359   u16_t len;
-00360 
-00361   len = uip_datalen();
-00362 
-00363   if(s.state == WEBCLIENT_STATE_STATUSLINE) {
-00364     len = parse_statusline(len);
-00365   }
-00366   
-00367   if(s.state == WEBCLIENT_STATE_HEADERS && len > 0) {
-00368     len = parse_headers(len);
-00369   }
-00370 
-00371   if(len > 0 && s.state == WEBCLIENT_STATE_DATA &&
-00372      s.httpflag != HTTPFLAG_MOVED) {
-00373     webclient_datahandler((char *)uip_appdata, len);
-00374   }
-00375 }
-00376 /*-----------------------------------------------------------------------------------*/
-00377 void
-00378 webclient_appcall(void)
-00379 {
-00380   if(uip_connected()) {
-00381     s.timer = 0;
-00382     s.state = WEBCLIENT_STATE_STATUSLINE;
-00383     senddata();
-00384     webclient_connected();
-00385     return;
-00386   }
-00387 
-00388   if(s.state == WEBCLIENT_STATE_CLOSE) {
-00389     webclient_closed();
-00390     uip_abort();
-00391     return;
-00392   }
-00393 
-00394   if(uip_aborted()) {
-00395     webclient_aborted();
-00396   }
-00397   if(uip_timedout()) {
-00398     webclient_timedout();
-00399   }
-00400 
-00401   
-00402   if(uip_acked()) {
-00403     s.timer = 0;
-00404     acked();
-00405   }
-00406   if(uip_newdata()) {
-00407     s.timer = 0;
-00408     newdata();
-00409   }
-00410   if(uip_rexmit() ||
-00411      uip_newdata() ||
-00412      uip_acked()) {
-00413     senddata();
-00414   } else if(uip_poll()) {
-00415     ++s.timer;
-00416     if(s.timer == WEBCLIENT_TIMEOUT) {
-00417       webclient_timedout();
-00418       uip_abort();
-00419       return;
-00420     }
-00421         /*    senddata();*/
-00422   }
-00423 
-00424   if(uip_closed()) {
-00425     if(s.httpflag != HTTPFLAG_MOVED) {
-00426       /* Send NULL data to signal EOF. */
-00427       webclient_datahandler(NULL, 0);
-00428     } else {
-00429       if(resolv_lookup(s.host) == NULL) {
-00430         resolv_query(s.host);
-00431       }
-00432       webclient_get(s.host, s.port, s.file);
-00433     }
-00434   }
-00435 }
-00436 /*-----------------------------------------------------------------------------------*/
-00437 
-00438 /** @} */
-00439 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00041.html b/components/net/uip/doc/html/a00041.html deleted file mode 100644 index f1f93ea8e3..0000000000 --- a/components/net/uip/doc/html/a00041.html +++ /dev/null @@ -1,248 +0,0 @@ - - -uIP 1.0: webclient.h - - - - - -

webclient.h

00001 /**
-00002  * \addtogroup webclient
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  * Header file for the HTTP client.
-00009  * \author Adam Dunkels <adam@dunkels.com>
-00010  */
-00011 
-00012 /*
-00013  * Copyright (c) 2002, Adam Dunkels.
-00014  * All rights reserved.
-00015  *
-00016  * Redistribution and use in source and binary forms, with or without
-00017  * modification, are permitted provided that the following conditions
-00018  * are met:
-00019  * 1. Redistributions of source code must retain the above copyright
-00020  *    notice, this list of conditions and the following disclaimer.
-00021  * 2. Redistributions in binary form must reproduce the above
-00022  *    copyright notice, this list of conditions and the following
-00023  *    disclaimer in the documentation and/or other materials provided
-00024  *    with the distribution.
-00025  * 3. The name of the author may not be used to endorse or promote
-00026  *    products derived from this software without specific prior
-00027  *    written permission.
-00028  *
-00029  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00030  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00031  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00032  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00033  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00034  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00035  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00036  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00037  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00038  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00039  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00040  *
-00041  * This file is part of the uIP TCP/IP stack.
-00042  *
-00043  * $Id: webclient.h,v 1.2 2006/06/11 21:46:37 adam Exp $
-00044  *
-00045  */
-00046 #ifndef __WEBCLIENT_H__
-00047 #define __WEBCLIENT_H__
-00048 
-00049 
-00050 #include "webclient-strings.h"
-00051 #include "uipopt.h"
-00052 
-00053 #define WEBCLIENT_CONF_MAX_URLLEN 100
-00054 
-00055 struct webclient_state {
-00056   u8_t timer;
-00057   u8_t state;
-00058   u8_t httpflag;
-00059 
-00060   u16_t port;
-00061   char host[40];
-00062   char file[WEBCLIENT_CONF_MAX_URLLEN];
-00063   u16_t getrequestptr;
-00064   u16_t getrequestleft;
-00065   
-00066   char httpheaderline[200];
-00067   u16_t httpheaderlineptr;
-00068 
-00069   char mimetype[32];
-00070 };
-00071 
-00072 typedef struct webclient_state uip_tcp_appstate_t;
-00073 #define UIP_APPCALL webclient_appcall
-00074 
-00075 /**
-00076  * Callback function that is called from the webclient code when HTTP
-00077  * data has been received.
-00078  *
-00079  * This function must be implemented by the module that uses the
-00080  * webclient code. The function is called from the webclient module
-00081  * when HTTP data has been received. The function is not called when
-00082  * HTTP headers are received, only for the actual data.
-00083  *
-00084  * \note This function is called many times, repetedly, when data is
-00085  * being received, and not once when all data has been received.
-00086  *
-00087  * \param data A pointer to the data that has been received.
-00088  * \param len The length of the data that has been received.
-00089  */
-00090 void webclient_datahandler(char *data, u16_t len);
-00091 
-00092 /**
-00093  * Callback function that is called from the webclient code when the
-00094  * HTTP connection has been connected to the web server.
-00095  *
-00096  * This function must be implemented by the module that uses the
-00097  * webclient code.
-00098  */
-00099 void webclient_connected(void);
-00100 
-00101 /**
-00102  * Callback function that is called from the webclient code if the
-00103  * HTTP connection to the web server has timed out.
-00104  *
-00105  * This function must be implemented by the module that uses the
-00106  * webclient code.
-00107  */
-00108 void webclient_timedout(void);
-00109 
-00110 /**
-00111  * Callback function that is called from the webclient code if the
-00112  * HTTP connection to the web server has been aborted by the web
-00113  * server.
-00114  *
-00115  * This function must be implemented by the module that uses the
-00116  * webclient code.
-00117  */
-00118 void webclient_aborted(void);
-00119 
-00120 /**
-00121  * Callback function that is called from the webclient code when the
-00122  * HTTP connection to the web server has been closed.
-00123  *
-00124  * This function must be implemented by the module that uses the
-00125  * webclient code.
-00126  */
-00127 void webclient_closed(void);
-00128 
-00129 
-00130 
-00131 /**
-00132  * Initialize the webclient module.
-00133  */
-00134 void webclient_init(void);
-00135 
-00136 /**
-00137  * Open an HTTP connection to a web server and ask for a file using
-00138  * the GET method.
-00139  *
-00140  * This function opens an HTTP connection to the specified web server
-00141  * and requests the specified file using the GET method. When the HTTP
-00142  * connection has been connected, the webclient_connected() callback
-00143  * function is called and when the HTTP data arrives the
-00144  * webclient_datahandler() callback function is called.
-00145  *
-00146  * The callback function webclient_timedout() is called if the web
-00147  * server could not be contacted, and the webclient_aborted() callback
-00148  * function is called if the HTTP connection is aborted by the web
-00149  * server.
-00150  *
-00151  * When the HTTP request has been completed and the HTTP connection is
-00152  * closed, the webclient_closed() callback function will be called.
-00153  *
-00154  * \note If the function is passed a host name, it must already be in
-00155  * the resolver cache in order for the function to connect to the web
-00156  * server. It is therefore up to the calling module to implement the
-00157  * resolver calls and the signal handler used for reporting a resolv
-00158  * query answer.
-00159  *
-00160  * \param host A pointer to a string containing either a host name or
-00161  * a numerical IP address in dotted decimal notation (e.g., 192.168.23.1).
-00162  *
-00163  * \param port The port number to which to connect, in host byte order.
-00164  *
-00165  * \param file A pointer to the name of the file to get.
-00166  *
-00167  * \retval 0 if the host name could not be found in the cache, or
-00168  * if a TCP connection could not be created.
-00169  *
-00170  * \retval 1 if the connection was initiated.
-00171  */
-00172 unsigned char webclient_get(char *host, u16_t port, char *file);
-00173 
-00174 /**
-00175  * Close the currently open HTTP connection.
-00176  */
-00177 void webclient_close(void);
-00178 void webclient_appcall(void);
-00179 
-00180 /**
-00181  * Obtain the MIME type of the current HTTP data stream.
-00182  *
-00183  * \return A pointer to a string contaning the MIME type. The string
-00184  * may be empty if no MIME type was reported by the web server.
-00185  */
-00186 char *webclient_mimetype(void);
-00187 
-00188 /**
-00189  * Obtain the filename of the current HTTP data stream.
-00190  *
-00191  * The filename of an HTTP request may be changed by the web server,
-00192  * and may therefore not be the same as when the original GET request
-00193  * was made with webclient_get(). This function is used for obtaining
-00194  * the current filename.
-00195  *
-00196  * \return A pointer to the current filename.
-00197  */
-00198 char *webclient_filename(void);
-00199 
-00200 /**
-00201  * Obtain the hostname of the current HTTP data stream.
-00202  *
-00203  * The hostname of the web server of an HTTP request may be changed
-00204  * by the web server, and may therefore not be the same as when the
-00205  * original GET request was made with webclient_get(). This function
-00206  * is used for obtaining the current hostname.
-00207  *
-00208  * \return A pointer to the current hostname.
-00209  */
-00210 char *webclient_hostname(void);
-00211 
-00212 /**
-00213  * Obtain the port number of the current HTTP data stream.
-00214  *
-00215  * The port number of an HTTP request may be changed by the web
-00216  * server, and may therefore not be the same as when the original GET
-00217  * request was made with webclient_get(). This function is used for
-00218  * obtaining the current port number.
-00219  *
-00220  * \return The port number of the current HTTP data stream, in host byte order.
-00221  */
-00222 unsigned short webclient_port(void);
-00223 
-00224 
-00225 
-00226 #endif /* __WEBCLIENT_H__ */
-00227 
-00228 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00042.html b/components/net/uip/doc/html/a00042.html deleted file mode 100644 index ecff751f80..0000000000 --- a/components/net/uip/doc/html/a00042.html +++ /dev/null @@ -1,106 +0,0 @@ - - -uIP 1.0: example-mainloop-with-arp.c - - - - - -

example-mainloop-with-arp.c

00001 #include "uip.h"
-00002 #include "uip_arp.h"
-00003 #include "network-device.h"
-00004 #include "httpd.h"
-00005 #include "timer.h"
-00006 
-00007 #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
-00008 
-00009 /*---------------------------------------------------------------------------*/
-00010 int
-00011 main(void)
-00012 {
-00013   int i;
-00014   uip_ipaddr_t ipaddr;
-00015   struct timer periodic_timer, arp_timer;
-00016   
-00017   timer_set(&periodic_timer, CLOCK_SECOND / 2);
-00018   timer_set(&arp_timer, CLOCK_SECOND * 10);
-00019   
-00020   network_device_init();
-00021   uip_init();
-00022 
-00023   uip_ipaddr(ipaddr, 192,168,0,2);
-00024   uip_sethostaddr(ipaddr);
-00025 
-00026   httpd_init();
-00027   
-00028   while(1) {
-00029     uip_len = network_device_read();
-00030     if(uip_len > 0) {
-00031       if(BUF->type == htons(UIP_ETHTYPE_IP)) {
-00032         uip_arp_ipin();
-00033         uip_input();
-00034         /* If the above function invocation resulted in data that
-00035            should be sent out on the network, the global variable
-00036            uip_len is set to a value > 0. */
-00037         if(uip_len > 0) {
-00038           uip_arp_out();
-00039           network_device_send();
-00040         }
-00041       } else if(BUF->type == htons(UIP_ETHTYPE_ARP)) {
-00042         uip_arp_arpin();
-00043         /* If the above function invocation resulted in data that
-00044            should be sent out on the network, the global variable
-00045            uip_len is set to a value > 0. */
-00046         if(uip_len > 0) {
-00047           network_device_send();
-00048         }
-00049       }
-00050 
-00051     } else if(timer_expired(&periodic_timer)) {
-00052       timer_reset(&periodic_timer);
-00053       for(i = 0; i < UIP_CONNS; i++) {
-00054         uip_periodic(i);
-00055         /* If the above function invocation resulted in data that
-00056            should be sent out on the network, the global variable
-00057            uip_len is set to a value > 0. */
-00058         if(uip_len > 0) {
-00059           uip_arp_out();
-00060           network_device_send();
-00061         }
-00062       }
-00063 
-00064 #if UIP_UDP
-00065       for(i = 0; i < UIP_UDP_CONNS; i++) {
-00066         uip_udp_periodic(i);
-00067         /* If the above function invocation resulted in data that
-00068            should be sent out on the network, the global variable
-00069            uip_len is set to a value > 0. */
-00070         if(uip_len > 0) {
-00071           uip_arp_out();
-00072           network_device_send();
-00073         }
-00074       }
-00075 #endif /* UIP_UDP */
-00076       
-00077       /* Call the ARP timer function every 10 seconds. */
-00078       if(timer_expired(&arp_timer)) {
-00079         timer_reset(&arp_timer);
-00080         uip_arp_timer();
-00081       }
-00082     }
-00083   }
-00084   return 0;
-00085 }
-00086 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00043.html b/components/net/uip/doc/html/a00043.html deleted file mode 100644 index be8d85ccf1..0000000000 --- a/components/net/uip/doc/html/a00043.html +++ /dev/null @@ -1,82 +0,0 @@ - - -uIP 1.0: example-mainloop-without-arp.c - - - - - -

example-mainloop-without-arp.c

00001 #include "uip.h"
-00002 #include "uip_arp.h"
-00003 #include "network-device.h"
-00004 #include "httpd.h"
-00005 #include "timer.h"
-00006 
-00007 /*---------------------------------------------------------------------------*/
-00008 int
-00009 main(void)
-00010 {
-00011   int i;
-00012   uip_ipaddr_t ipaddr;
-00013   struct timer periodic_timer;
-00014   
-00015   timer_set(&periodic_timer, CLOCK_SECOND / 2);
-00016   
-00017   network_device_init();
-00018   uip_init();
-00019 
-00020   uip_ipaddr(ipaddr, 192,168,0,2);
-00021   uip_sethostaddr(ipaddr);
-00022 
-00023   httpd_init();
-00024   
-00025   while(1) {
-00026     uip_len = network_device_read();
-00027     if(uip_len > 0) {
-00028       uip_input();
-00029       /* If the above function invocation resulted in data that
-00030          should be sent out on the network, the global variable
-00031          uip_len is set to a value > 0. */
-00032       if(uip_len > 0) {
-00033         network_device_send();
-00034       }
-00035     } else if(timer_expired(&periodic_timer)) {
-00036       timer_reset(&periodic_timer);
-00037       for(i = 0; i < UIP_CONNS; i++) {
-00038         uip_periodic(i);
-00039         /* If the above function invocation resulted in data that
-00040            should be sent out on the network, the global variable
-00041            uip_len is set to a value > 0. */
-00042         if(uip_len > 0) {
-00043           network_device_send();
-00044         }
-00045       }
-00046 
-00047 #if UIP_UDP
-00048       for(i = 0; i < UIP_UDP_CONNS; i++) {
-00049         uip_udp_periodic(i);
-00050         /* If the above function invocation resulted in data that
-00051            should be sent out on the network, the global variable
-00052            uip_len is set to a value > 0. */
-00053         if(uip_len > 0) {
-00054           network_device_send();
-00055         }
-00056       }
-00057 #endif /* UIP_UDP */
-00058     }
-00059   }
-00060   return 0;
-00061 }
-00062 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00044.html b/components/net/uip/doc/html/a00044.html deleted file mode 100644 index 63af613811..0000000000 --- a/components/net/uip/doc/html/a00044.html +++ /dev/null @@ -1,370 +0,0 @@ - - -uIP 1.0: telnetd.c - - - - - -

telnetd.c

00001 /*
-00002  * Copyright (c) 2003, Adam Dunkels.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. The name of the author may not be used to endorse or promote
-00014  *    products derived from this software without specific prior
-00015  *    written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00018  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00021  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00023  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00025  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00026  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * $Id: telnetd.c,v 1.2 2006/06/07 09:43:54 adam Exp $
-00032  *
-00033  */
-00034 
-00035 #include "uip.h"
-00036 #include "telnetd.h"
-00037 #include "memb.h"
-00038 #include "shell.h"
-00039 
-00040 #include <string.h>
-00041 
-00042 #define ISO_nl       0x0a
-00043 #define ISO_cr       0x0d
-00044 
-00045 struct telnetd_line {
-00046   char line[TELNETD_CONF_LINELEN];
-00047 };
-00048 MEMB(linemem, struct telnetd_line, TELNETD_CONF_NUMLINES);
-00049 
-00050 #define STATE_NORMAL 0
-00051 #define STATE_IAC    1
-00052 #define STATE_WILL   2
-00053 #define STATE_WONT   3
-00054 #define STATE_DO     4
-00055 #define STATE_DONT   5
-00056 #define STATE_CLOSE  6
-00057 
-00058 static struct telnetd_state s;
-00059 
-00060 #define TELNET_IAC   255
-00061 #define TELNET_WILL  251
-00062 #define TELNET_WONT  252
-00063 #define TELNET_DO    253
-00064 #define TELNET_DONT  254
-00065 /*---------------------------------------------------------------------------*/
-00066 static char *
-00067 alloc_line(void)
-00068 {
-00069   return memb_alloc(&linemem);
-00070 }
-00071 /*---------------------------------------------------------------------------*/
-00072 static void
-00073 dealloc_line(char *line)
-00074 {
-00075   memb_free(&linemem, line);
-00076 }
-00077 /*---------------------------------------------------------------------------*/
-00078 void
-00079 shell_quit(char *str)
-00080 {
-00081   s.state = STATE_CLOSE;
-00082 }
-00083 /*---------------------------------------------------------------------------*/
-00084 static void
-00085 sendline(char *line)
-00086 {
-00087   static unsigned int i;
-00088   
-00089   for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) {
-00090     if(s.lines[i] == NULL) {
-00091       s.lines[i] = line;
-00092       break;
-00093     }
-00094   }
-00095   if(i == TELNETD_CONF_NUMLINES) {
-00096     dealloc_line(line);
-00097   }
-00098 }
-00099 /*---------------------------------------------------------------------------*/
-00100 void
-00101 shell_prompt(char *str)
-00102 {
-00103   char *line;
-00104   line = alloc_line();
-00105   if(line != NULL) {
-00106     strncpy(line, str, TELNETD_CONF_LINELEN);
-00107     /*    petsciiconv_toascii(line, TELNETD_CONF_LINELEN);*/
-00108     sendline(line);
-00109   }
-00110 }
-00111 /*---------------------------------------------------------------------------*/
-00112 void
-00113 shell_output(char *str1, char *str2)
-00114 {
-00115   static unsigned len;
-00116   char *line;
-00117 
-00118   line = alloc_line();
-00119   if(line != NULL) {
-00120     len = strlen(str1);
-00121     strncpy(line, str1, TELNETD_CONF_LINELEN);
-00122     if(len < TELNETD_CONF_LINELEN) {
-00123       strncpy(line + len, str2, TELNETD_CONF_LINELEN - len);
-00124     }
-00125     len = strlen(line);
-00126     if(len < TELNETD_CONF_LINELEN - 2) {
-00127       line[len] = ISO_cr;
-00128       line[len+1] = ISO_nl;
-00129       line[len+2] = 0;
-00130     }
-00131     /*    petsciiconv_toascii(line, TELNETD_CONF_LINELEN);*/
-00132     sendline(line);
-00133   }
-00134 }
-00135 /*---------------------------------------------------------------------------*/
-00136 void
-00137 telnetd_init(void)
-00138 {
-00139   uip_listen(HTONS(23));
-00140   memb_init(&linemem);
-00141   shell_init();
-00142 }
-00143 /*---------------------------------------------------------------------------*/
-00144 static void
-00145 acked(void)
-00146 {
-00147   static unsigned int i;
-00148   
-00149   while(s.numsent > 0) {
-00150     dealloc_line(s.lines[0]);
-00151     for(i = 1; i < TELNETD_CONF_NUMLINES; ++i) {
-00152       s.lines[i - 1] = s.lines[i];
-00153     }
-00154     s.lines[TELNETD_CONF_NUMLINES - 1] = NULL;
-00155     --s.numsent;
-00156   }
-00157 }
-00158 /*---------------------------------------------------------------------------*/
-00159 static void
-00160 senddata(void)
-00161 {
-00162   static char *bufptr, *lineptr;
-00163   static int buflen, linelen;
-00164   
-00165   bufptr = uip_appdata;
-00166   buflen = 0;
-00167   for(s.numsent = 0; s.numsent < TELNETD_CONF_NUMLINES &&
-00168         s.lines[s.numsent] != NULL ; ++s.numsent) {
-00169     lineptr = s.lines[s.numsent];
-00170     linelen = strlen(lineptr);
-00171     if(linelen > TELNETD_CONF_LINELEN) {
-00172       linelen = TELNETD_CONF_LINELEN;
-00173     }
-00174     if(buflen + linelen < uip_mss()) {
-00175       memcpy(bufptr, lineptr, linelen);
-00176       bufptr += linelen;
-00177       buflen += linelen;
-00178     } else {
-00179       break;
-00180     }
-00181   }
-00182   uip_send(uip_appdata, buflen);
-00183 }
-00184 /*---------------------------------------------------------------------------*/
-00185 static void
-00186 closed(void)
-00187 {
-00188   static unsigned int i;
-00189   
-00190   for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) {
-00191     if(s.lines[i] != NULL) {
-00192       dealloc_line(s.lines[i]);
-00193     }
-00194   }
-00195 }
-00196 /*---------------------------------------------------------------------------*/
-00197 static void
-00198 get_char(u8_t c)
-00199 {
-00200   if(c == ISO_cr) {
-00201     return;
-00202   }
-00203   
-00204   s.buf[(int)s.bufptr] = c;
-00205   if(s.buf[(int)s.bufptr] == ISO_nl ||
-00206      s.bufptr == sizeof(s.buf) - 1) {
-00207     if(s.bufptr > 0) {
-00208       s.buf[(int)s.bufptr] = 0;
-00209       /*      petsciiconv_topetscii(s.buf, TELNETD_CONF_LINELEN);*/
-00210     }
-00211     shell_input(s.buf);
-00212     s.bufptr = 0;
-00213   } else {
-00214     ++s.bufptr;
-00215   }
-00216 }
-00217 /*---------------------------------------------------------------------------*/
-00218 static void
-00219 sendopt(u8_t option, u8_t value)
-00220 {
-00221   char *line;
-00222   line = alloc_line();
-00223   if(line != NULL) {
-00224     line[0] = TELNET_IAC;
-00225     line[1] = option;
-00226     line[2] = value;
-00227     line[3] = 0;
-00228     sendline(line);
-00229   }
-00230 }
-00231 /*---------------------------------------------------------------------------*/
-00232 static void
-00233 newdata(void)
-00234 {
-00235   u16_t len;
-00236   u8_t c;
-00237   char *dataptr;
-00238     
-00239   
-00240   len = uip_datalen();
-00241   dataptr = (char *)uip_appdata;
-00242   
-00243   while(len > 0 && s.bufptr < sizeof(s.buf)) {
-00244     c = *dataptr;
-00245     ++dataptr;
-00246     --len;
-00247     switch(s.state) {
-00248     case STATE_IAC:
-00249       if(c == TELNET_IAC) {
-00250         get_char(c);
-00251         s.state = STATE_NORMAL;
-00252       } else {
-00253         switch(c) {
-00254         case TELNET_WILL:
-00255           s.state = STATE_WILL;
-00256           break;
-00257         case TELNET_WONT:
-00258           s.state = STATE_WONT;
-00259           break;
-00260         case TELNET_DO:
-00261           s.state = STATE_DO;
-00262           break;
-00263         case TELNET_DONT:
-00264           s.state = STATE_DONT;
-00265           break;
-00266         default:
-00267           s.state = STATE_NORMAL;
-00268           break;
-00269         }
-00270       }
-00271       break;
-00272     case STATE_WILL:
-00273       /* Reply with a DONT */
-00274       sendopt(TELNET_DONT, c);
-00275       s.state = STATE_NORMAL;
-00276       break;
-00277       
-00278     case STATE_WONT:
-00279       /* Reply with a DONT */
-00280       sendopt(TELNET_DONT, c);
-00281       s.state = STATE_NORMAL;
-00282       break;
-00283     case STATE_DO:
-00284       /* Reply with a WONT */
-00285       sendopt(TELNET_WONT, c);
-00286       s.state = STATE_NORMAL;
-00287       break;
-00288     case STATE_DONT:
-00289       /* Reply with a WONT */
-00290       sendopt(TELNET_WONT, c);
-00291       s.state = STATE_NORMAL;
-00292       break;
-00293     case STATE_NORMAL:
-00294       if(c == TELNET_IAC) {
-00295         s.state = STATE_IAC;
-00296       } else {
-00297         get_char(c);
-00298       }
-00299       break;
-00300     }
-00301 
-00302     
-00303   }
-00304   
-00305 }
-00306 /*---------------------------------------------------------------------------*/
-00307 void
-00308 telnetd_appcall(void)
-00309 {
-00310   static unsigned int i;
-00311   if(uip_connected()) {
-00312     /*    tcp_markconn(uip_conn, &s);*/
-00313     for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) {
-00314       s.lines[i] = NULL;
-00315     }
-00316     s.bufptr = 0;
-00317     s.state = STATE_NORMAL;
-00318 
-00319     shell_start();
-00320   }
-00321 
-00322   if(s.state == STATE_CLOSE) {
-00323     s.state = STATE_NORMAL;
-00324     uip_close();
-00325     return;
-00326   }
-00327   
-00328   if(uip_closed() ||
-00329      uip_aborted() ||
-00330      uip_timedout()) {
-00331     closed();
-00332   }
-00333   
-00334   if(uip_acked()) {
-00335     acked();
-00336   }
-00337   
-00338   if(uip_newdata()) {
-00339     newdata();
-00340   }
-00341   
-00342   if(uip_rexmit() ||
-00343      uip_newdata() ||
-00344      uip_acked() ||
-00345      uip_connected() ||
-00346      uip_poll()) {
-00347     senddata();
-00348   }
-00349 }
-00350 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00045.html b/components/net/uip/doc/html/a00045.html deleted file mode 100644 index 7ed6df9020..0000000000 --- a/components/net/uip/doc/html/a00045.html +++ /dev/null @@ -1,83 +0,0 @@ - - -uIP 1.0: telnetd.h - - - - - -

telnetd.h

00001 /*
-00002  * Copyright (c) 2003, Adam Dunkels.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above
-00011  *    copyright notice, this list of conditions and the following
-00012  *    disclaimer in the documentation and/or other materials provided
-00013  *    with the distribution.
-00014  * 3. The name of the author may not be used to endorse or promote
-00015  *    products derived from this software without specific prior
-00016  *    written permission.
-00017  *
-00018  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00019  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00020  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00021  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00022  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00024  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00025  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00026  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00027  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00028  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00029  *
-00030  * This file is part of the uIP TCP/IP stack
-00031  *
-00032  * $Id: telnetd.h,v 1.2 2006/06/07 09:43:54 adam Exp $
-00033  *
-00034  */
-00035 #ifndef __TELNETD_H__
-00036 #define __TELNETD_H__
-00037 
-00038 #include "uipopt.h"
-00039 
-00040 void telnetd_appcall(void);
-00041 
-00042 #ifndef TELNETD_CONF_LINELEN
-00043 #define TELNETD_CONF_LINELEN 40
-00044 #endif
-00045 #ifndef TELNETD_CONF_NUMLINES
-00046 #define TELNETD_CONF_NUMLINES 16
-00047 #endif
-00048 
-00049 struct telnetd_state {
-00050   char *lines[TELNETD_CONF_NUMLINES];
-00051   char buf[TELNETD_CONF_LINELEN];
-00052   char bufptr;
-00053   u8_t numsent;
-00054   u8_t state;
-00055 };
-00056 
-00057 typedef struct telnetd_state uip_tcp_appstate_t;
-00058 
-00059 #ifndef UIP_APPCALL
-00060 #define UIP_APPCALL     telnetd_appcall
-00061 #endif
-00062 
-00063 #endif /* __TELNETD_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00046.html b/components/net/uip/doc/html/a00046.html deleted file mode 100644 index 9e877ea147..0000000000 --- a/components/net/uip/doc/html/a00046.html +++ /dev/null @@ -1,484 +0,0 @@ - - -uIP 1.0: resolv.c - - - - - -

resolv.c

00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup resolv DNS resolver
-00008  * @{
-00009  *
-00010  * The uIP DNS resolver functions are used to lookup a hostname and
-00011  * map it to a numerical IP address. It maintains a list of resolved
-00012  * hostnames that can be queried with the resolv_lookup()
-00013  * function. New hostnames can be resolved using the resolv_query()
-00014  * function.
-00015  *
-00016  * When a hostname has been resolved (or found to be non-existant),
-00017  * the resolver code calls a callback function called resolv_found()
-00018  * that must be implemented by the module that uses the resolver.
-00019  */
-00020 
-00021 /**
-00022  * \file
-00023  * DNS host name to IP address resolver.
-00024  * \author Adam Dunkels <adam@dunkels.com>
-00025  *
-00026  * This file implements a DNS host name to IP address resolver.
-00027  */
-00028 
-00029 /*
-00030  * Copyright (c) 2002-2003, Adam Dunkels.
-00031  * All rights reserved.
-00032  *
-00033  * Redistribution and use in source and binary forms, with or without
-00034  * modification, are permitted provided that the following conditions
-00035  * are met:
-00036  * 1. Redistributions of source code must retain the above copyright
-00037  *    notice, this list of conditions and the following disclaimer.
-00038  * 2. Redistributions in binary form must reproduce the above copyright
-00039  *    notice, this list of conditions and the following disclaimer in the
-00040  *    documentation and/or other materials provided with the distribution.
-00041  * 3. The name of the author may not be used to endorse or promote
-00042  *    products derived from this software without specific prior
-00043  *    written permission.
-00044  *
-00045  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00046  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00047  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00048  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00049  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00050  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00051  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00052  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00053  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00054  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00055  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00056  *
-00057  * This file is part of the uIP TCP/IP stack.
-00058  *
-00059  * $Id: resolv.c,v 1.5 2006/06/11 21:46:37 adam Exp $
-00060  *
-00061  */
-00062 
-00063 #include "resolv.h"
-00064 #include "uip.h"
-00065 
-00066 #include <string.h>
-00067 
-00068 #ifndef NULL
-00069 #define NULL (void *)0
-00070 #endif /* NULL */
-00071 
-00072 /** \internal The maximum number of retries when asking for a name. */
-00073 #define MAX_RETRIES 8
-00074 
-00075 /** \internal The DNS message header. */
-00076 struct dns_hdr {
-00077   u16_t id;
-00078   u8_t flags1, flags2;
-00079 #define DNS_FLAG1_RESPONSE        0x80
-00080 #define DNS_FLAG1_OPCODE_STATUS   0x10
-00081 #define DNS_FLAG1_OPCODE_INVERSE  0x08
-00082 #define DNS_FLAG1_OPCODE_STANDARD 0x00
-00083 #define DNS_FLAG1_AUTHORATIVE     0x04
-00084 #define DNS_FLAG1_TRUNC           0x02
-00085 #define DNS_FLAG1_RD              0x01
-00086 #define DNS_FLAG2_RA              0x80
-00087 #define DNS_FLAG2_ERR_MASK        0x0f
-00088 #define DNS_FLAG2_ERR_NONE        0x00
-00089 #define DNS_FLAG2_ERR_NAME        0x03
-00090   u16_t numquestions;
-00091   u16_t numanswers;
-00092   u16_t numauthrr;
-00093   u16_t numextrarr;
-00094 };
-00095 
-00096 /** \internal The DNS answer message structure. */
-00097 struct dns_answer {
-00098   /* DNS answer record starts with either a domain name or a pointer
-00099      to a name already present somewhere in the packet. */
-00100   u16_t type;
-00101   u16_t class;
-00102   u16_t ttl[2];
-00103   u16_t len;
-00104   uip_ipaddr_t ipaddr;
-00105 };
-00106 
-00107 struct namemap {
-00108 #define STATE_UNUSED 0
-00109 #define STATE_NEW    1
-00110 #define STATE_ASKING 2
-00111 #define STATE_DONE   3
-00112 #define STATE_ERROR  4
-00113   u8_t state;
-00114   u8_t tmr;
-00115   u8_t retries;
-00116   u8_t seqno;
-00117   u8_t err;
-00118   char name[32];
-00119   uip_ipaddr_t ipaddr;
-00120 };
-00121 
-00122 #ifndef UIP_CONF_RESOLV_ENTRIES
-00123 #define RESOLV_ENTRIES 4
-00124 #else /* UIP_CONF_RESOLV_ENTRIES */
-00125 #define RESOLV_ENTRIES UIP_CONF_RESOLV_ENTRIES
-00126 #endif /* UIP_CONF_RESOLV_ENTRIES */
-00127 
-00128 
-00129 static struct namemap names[RESOLV_ENTRIES];
-00130 
-00131 static u8_t seqno;
-00132 
-00133 static struct uip_udp_conn *resolv_conn = NULL;
-00134 
-00135 
-00136 /*---------------------------------------------------------------------------*/
-00137 /** \internal
-00138  * Walk through a compact encoded DNS name and return the end of it.
-00139  *
-00140  * \return The end of the name.
-00141  */
-00142 /*---------------------------------------------------------------------------*/
-00143 static unsigned char *
-00144 parse_name(unsigned char *query)
-00145 {
-00146   unsigned char n;
-00147 
-00148   do {
-00149     n = *query++;
-00150     
-00151     while(n > 0) {
-00152       /*      printf("%c", *query);*/
-00153       ++query;
-00154       --n;
-00155     };
-00156     /*    printf(".");*/
-00157   } while(*query != 0);
-00158   /*  printf("\n");*/
-00159   return query + 1;
-00160 }
-00161 /*---------------------------------------------------------------------------*/
-00162 /** \internal
-00163  * Runs through the list of names to see if there are any that have
-00164  * not yet been queried and, if so, sends out a query.
-00165  */
-00166 /*---------------------------------------------------------------------------*/
-00167 static void
-00168 check_entries(void)
-00169 {
-00170   register struct dns_hdr *hdr;
-00171   char *query, *nptr, *nameptr;
-00172   static u8_t i;
-00173   static u8_t n;
-00174   register struct namemap *namemapptr;
-00175   
-00176   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00177     namemapptr = &names[i];
-00178     if(namemapptr->state == STATE_NEW ||
-00179        namemapptr->state == STATE_ASKING) {
-00180       if(namemapptr->state == STATE_ASKING) {
-00181         if(--namemapptr->tmr == 0) {
-00182           if(++namemapptr->retries == MAX_RETRIES) {
-00183             namemapptr->state = STATE_ERROR;
-00184             resolv_found(namemapptr->name, NULL);
-00185             continue;
-00186           }
-00187           namemapptr->tmr = namemapptr->retries;
-00188         } else {
-00189           /*      printf("Timer %d\n", namemapptr->tmr);*/
-00190           /* Its timer has not run out, so we move on to next
-00191              entry. */
-00192           continue;
-00193         }
-00194       } else {
-00195         namemapptr->state = STATE_ASKING;
-00196         namemapptr->tmr = 1;
-00197         namemapptr->retries = 0;
-00198       }
-00199       hdr = (struct dns_hdr *)uip_appdata;
-00200       memset(hdr, 0, sizeof(struct dns_hdr));
-00201       hdr->id = htons(i);
-00202       hdr->flags1 = DNS_FLAG1_RD;
-00203       hdr->numquestions = HTONS(1);
-00204       query = (char *)uip_appdata + 12;
-00205       nameptr = namemapptr->name;
-00206       --nameptr;
-00207       /* Convert hostname into suitable query format. */
-00208       do {
-00209         ++nameptr;
-00210         nptr = query;
-00211         ++query;
-00212         for(n = 0; *nameptr != '.' && *nameptr != 0; ++nameptr) {
-00213           *query = *nameptr;
-00214           ++query;
-00215           ++n;
-00216         }
-00217         *nptr = n;
-00218       } while(*nameptr != 0);
-00219       {
-00220         static unsigned char endquery[] =
-00221           {0,0,1,0,1};
-00222         memcpy(query, endquery, 5);
-00223       }
-00224       uip_udp_send((unsigned char)(query + 5 - (char *)uip_appdata));
-00225       break;
-00226     }
-00227   }
-00228 }
-00229 /*---------------------------------------------------------------------------*/
-00230 /** \internal
-00231  * Called when new UDP data arrives.
-00232  */
-00233 /*---------------------------------------------------------------------------*/
-00234 static void
-00235 newdata(void)
-00236 {
-00237   char *nameptr;
-00238   struct dns_answer *ans;
-00239   struct dns_hdr *hdr;
-00240   static u8_t nquestions, nanswers;
-00241   static u8_t i;
-00242   register struct namemap *namemapptr;
-00243   
-00244   hdr = (struct dns_hdr *)uip_appdata;
-00245   /*  printf("ID %d\n", htons(hdr->id));
-00246       printf("Query %d\n", hdr->flags1 & DNS_FLAG1_RESPONSE);
-00247       printf("Error %d\n", hdr->flags2 & DNS_FLAG2_ERR_MASK);
-00248       printf("Num questions %d, answers %d, authrr %d, extrarr %d\n",
-00249       htons(hdr->numquestions),
-00250       htons(hdr->numanswers),
-00251       htons(hdr->numauthrr),
-00252       htons(hdr->numextrarr));
-00253   */
-00254 
-00255   /* The ID in the DNS header should be our entry into the name
-00256      table. */
-00257   i = htons(hdr->id);
-00258   namemapptr = &names[i];
-00259   if(i < RESOLV_ENTRIES &&
-00260      namemapptr->state == STATE_ASKING) {
-00261 
-00262     /* This entry is now finished. */
-00263     namemapptr->state = STATE_DONE;
-00264     namemapptr->err = hdr->flags2 & DNS_FLAG2_ERR_MASK;
-00265 
-00266     /* Check for error. If so, call callback to inform. */
-00267     if(namemapptr->err != 0) {
-00268       namemapptr->state = STATE_ERROR;
-00269       resolv_found(namemapptr->name, NULL);
-00270       return;
-00271     }
-00272 
-00273     /* We only care about the question(s) and the answers. The authrr
-00274        and the extrarr are simply discarded. */
-00275     nquestions = htons(hdr->numquestions);
-00276     nanswers = htons(hdr->numanswers);
-00277 
-00278     /* Skip the name in the question. XXX: This should really be
-00279        checked agains the name in the question, to be sure that they
-00280        match. */
-00281     nameptr = parse_name((char *)uip_appdata + 12) + 4;
-00282 
-00283     while(nanswers > 0) {
-00284       /* The first byte in the answer resource record determines if it
-00285          is a compressed record or a normal one. */
-00286       if(*nameptr & 0xc0) {
-00287         /* Compressed name. */
-00288         nameptr +=2;
-00289         /*      printf("Compressed anwser\n");*/
-00290       } else {
-00291         /* Not compressed name. */
-00292         nameptr = parse_name((char *)nameptr);
-00293       }
-00294 
-00295       ans = (struct dns_answer *)nameptr;
-00296       /*      printf("Answer: type %x, class %x, ttl %x, length %x\n",
-00297              htons(ans->type), htons(ans->class), (htons(ans->ttl[0])
-00298              << 16) | htons(ans->ttl[1]), htons(ans->len));*/
-00299 
-00300       /* Check for IP address type and Internet class. Others are
-00301          discarded. */
-00302       if(ans->type == HTONS(1) &&
-00303          ans->class == HTONS(1) &&
-00304          ans->len == HTONS(4)) {
-00305         /*      printf("IP address %d.%d.%d.%d\n",
-00306                htons(ans->ipaddr[0]) >> 8,
-00307                htons(ans->ipaddr[0]) & 0xff,
-00308                htons(ans->ipaddr[1]) >> 8,
-00309                htons(ans->ipaddr[1]) & 0xff);*/
-00310         /* XXX: we should really check that this IP address is the one
-00311            we want. */
-00312         namemapptr->ipaddr[0] = ans->ipaddr[0];
-00313         namemapptr->ipaddr[1] = ans->ipaddr[1];
-00314         
-00315         resolv_found(namemapptr->name, namemapptr->ipaddr);
-00316         return;
-00317       } else {
-00318         nameptr = nameptr + 10 + htons(ans->len);
-00319       }
-00320       --nanswers;
-00321     }
-00322   }
-00323 
-00324 }
-00325 /*---------------------------------------------------------------------------*/
-00326 /** \internal
-00327  * The main UDP function.
-00328  */
-00329 /*---------------------------------------------------------------------------*/
-00330 void
-00331 resolv_appcall(void)
-00332 {
-00333   if(uip_udp_conn->rport == HTONS(53)) {
-00334     if(uip_poll()) {
-00335       check_entries();
-00336     }
-00337     if(uip_newdata()) {
-00338       newdata();
-00339     }
-00340   }
-00341 }
-00342 /*---------------------------------------------------------------------------*/
-00343 /**
-00344  * Queues a name so that a question for the name will be sent out.
-00345  *
-00346  * \param name The hostname that is to be queried.
-00347  */
-00348 /*---------------------------------------------------------------------------*/
-00349 void
-00350 resolv_query(char *name)
-00351 {
-00352   static u8_t i;
-00353   static u8_t lseq, lseqi;
-00354   register struct namemap *nameptr;
-00355       
-00356   lseq = lseqi = 0;
-00357   
-00358   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00359     nameptr = &names[i];
-00360     if(nameptr->state == STATE_UNUSED) {
-00361       break;
-00362     }
-00363     if(seqno - nameptr->seqno > lseq) {
-00364       lseq = seqno - nameptr->seqno;
-00365       lseqi = i;
-00366     }
-00367   }
-00368 
-00369   if(i == RESOLV_ENTRIES) {
-00370     i = lseqi;
-00371     nameptr = &names[i];
-00372   }
-00373 
-00374   /*  printf("Using entry %d\n", i);*/
-00375 
-00376   strcpy(nameptr->name, name);
-00377   nameptr->state = STATE_NEW;
-00378   nameptr->seqno = seqno;
-00379   ++seqno;
-00380 }
-00381 /*---------------------------------------------------------------------------*/
-00382 /**
-00383  * Look up a hostname in the array of known hostnames.
-00384  *
-00385  * \note This function only looks in the internal array of known
-00386  * hostnames, it does not send out a query for the hostname if none
-00387  * was found. The function resolv_query() can be used to send a query
-00388  * for a hostname.
-00389  *
-00390  * \return A pointer to a 4-byte representation of the hostname's IP
-00391  * address, or NULL if the hostname was not found in the array of
-00392  * hostnames.
-00393  */
-00394 /*---------------------------------------------------------------------------*/
-00395 u16_t *
-00396 resolv_lookup(char *name)
-00397 {
-00398   static u8_t i;
-00399   struct namemap *nameptr;
-00400   
-00401   /* Walk through the list to see if the name is in there. If it is
-00402      not, we return NULL. */
-00403   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00404     nameptr = &names[i];
-00405     if(nameptr->state == STATE_DONE &&
-00406        strcmp(name, nameptr->name) == 0) {
-00407       return nameptr->ipaddr;
-00408     }
-00409   }
-00410   return NULL;
-00411 }
-00412 /*---------------------------------------------------------------------------*/
-00413 /**
-00414  * Obtain the currently configured DNS server.
-00415  *
-00416  * \return A pointer to a 4-byte representation of the IP address of
-00417  * the currently configured DNS server or NULL if no DNS server has
-00418  * been configured.
-00419  */
-00420 /*---------------------------------------------------------------------------*/
-00421 u16_t *
-00422 resolv_getserver(void)
-00423 {
-00424   if(resolv_conn == NULL) {
-00425     return NULL;
-00426   }
-00427   return resolv_conn->ripaddr;
-00428 }
-00429 /*---------------------------------------------------------------------------*/
-00430 /**
-00431  * Configure which DNS server to use for queries.
-00432  *
-00433  * \param dnsserver A pointer to a 4-byte representation of the IP
-00434  * address of the DNS server to be configured.
-00435  */
-00436 /*---------------------------------------------------------------------------*/
-00437 void
-00438 resolv_conf(u16_t *dnsserver)
-00439 {
-00440   if(resolv_conn != NULL) {
-00441     uip_udp_remove(resolv_conn);
-00442   }
-00443   
-00444   resolv_conn = uip_udp_new(dnsserver, HTONS(53));
-00445 }
-00446 /*---------------------------------------------------------------------------*/
-00447 /**
-00448  * Initalize the resolver.
-00449  */
-00450 /*---------------------------------------------------------------------------*/
-00451 void
-00452 resolv_init(void)
-00453 {
-00454   static u8_t i;
-00455   
-00456   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00457     names[i].state = STATE_DONE;
-00458   }
-00459 
-00460 }
-00461 /*---------------------------------------------------------------------------*/
-00462 
-00463 /** @} */
-00464 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00047.html b/components/net/uip/doc/html/a00047.html deleted file mode 100644 index 76d0ccc9c5..0000000000 --- a/components/net/uip/doc/html/a00047.html +++ /dev/null @@ -1,95 +0,0 @@ - - -uIP 1.0: resolv.h - - - - - -

resolv.h

00001 /**
-00002  * \addtogroup resolv
-00003  * @{
-00004  */
-00005 /**
-00006  * \file
-00007  * DNS resolver code header file.
-00008  * \author Adam Dunkels <adam@dunkels.com>
-00009  */
-00010 
-00011 /*
-00012  * Copyright (c) 2002-2003, Adam Dunkels.
-00013  * All rights reserved.
-00014  *
-00015  * Redistribution and use in source and binary forms, with or without
-00016  * modification, are permitted provided that the following conditions
-00017  * are met:
-00018  * 1. Redistributions of source code must retain the above copyright
-00019  *    notice, this list of conditions and the following disclaimer.
-00020  * 2. Redistributions in binary form must reproduce the above copyright
-00021  *    notice, this list of conditions and the following disclaimer in the
-00022  *    documentation and/or other materials provided with the distribution.
-00023  * 3. The name of the author may not be used to endorse or promote
-00024  *    products derived from this software without specific prior
-00025  *    written permission.
-00026  *
-00027  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00028  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00029  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00030  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00031  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00032  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00033  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00035  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00036  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00037  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00038  *
-00039  * This file is part of the uIP TCP/IP stack.
-00040  *
-00041  * $Id: resolv.h,v 1.4 2006/06/11 21:46:37 adam Exp $
-00042  *
-00043  */
-00044 #ifndef __RESOLV_H__
-00045 #define __RESOLV_H__
-00046 
-00047 typedef int uip_udp_appstate_t;
-00048 void resolv_appcall(void);
-00049 #define UIP_UDP_APPCALL resolv_appcall
-00050 
-00051 #include "uipopt.h"
-00052 
-00053 /**
-00054  * Callback function which is called when a hostname is found.
-00055  *
-00056  * This function must be implemented by the module that uses the DNS
-00057  * resolver. It is called when a hostname is found, or when a hostname
-00058  * was not found.
-00059  *
-00060  * \param name A pointer to the name that was looked up.  \param
-00061  * ipaddr A pointer to a 4-byte array containing the IP address of the
-00062  * hostname, or NULL if the hostname could not be found.
-00063  */
-00064 void resolv_found(char *name, u16_t *ipaddr);
-00065 
-00066 /* Functions. */
-00067 void resolv_conf(u16_t *dnsserver);
-00068 u16_t *resolv_getserver(void);
-00069 void resolv_init(void);
-00070 u16_t *resolv_lookup(char *name);
-00071 void resolv_query(char *name);
-00072 
-00073 #endif /* __RESOLV_H__ */
-00074 
-00075 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00048.html b/components/net/uip/doc/html/a00048.html deleted file mode 100644 index d19bf13535..0000000000 --- a/components/net/uip/doc/html/a00048.html +++ /dev/null @@ -1,376 +0,0 @@ - - -uIP 1.0: dhcpc.c - - - - - -

dhcpc.c

00001 /*
-00002  * Copyright (c) 2005, Swedish Institute of Computer Science
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * @(#)$Id: dhcpc.c,v 1.2 2006/06/11 21:46:37 adam Exp $
-00032  */
-00033 
-00034 #include <stdio.h>
-00035 #include <string.h>
-00036 
-00037 #include "uip.h"
-00038 #include "dhcpc.h"
-00039 #include "timer.h"
-00040 #include "pt.h"
-00041 
-00042 #define STATE_INITIAL         0
-00043 #define STATE_SENDING         1
-00044 #define STATE_OFFER_RECEIVED  2
-00045 #define STATE_CONFIG_RECEIVED 3
-00046 
-00047 static struct dhcpc_state s;
-00048 
-00049 struct dhcp_msg {
-00050   u8_t op, htype, hlen, hops;
-00051   u8_t xid[4];
-00052   u16_t secs, flags;
-00053   u8_t ciaddr[4];
-00054   u8_t yiaddr[4];
-00055   u8_t siaddr[4];
-00056   u8_t giaddr[4];
-00057   u8_t chaddr[16];
-00058 #ifndef UIP_CONF_DHCP_LIGHT
-00059   u8_t sname[64];
-00060   u8_t file[128];
-00061 #endif
-00062   u8_t options[312];
-00063 };
-00064 
-00065 #define BOOTP_BROADCAST 0x8000
-00066 
-00067 #define DHCP_REQUEST        1
-00068 #define DHCP_REPLY          2
-00069 #define DHCP_HTYPE_ETHERNET 1
-00070 #define DHCP_HLEN_ETHERNET  6
-00071 #define DHCP_MSG_LEN      236
-00072 
-00073 #define DHCPC_SERVER_PORT  67
-00074 #define DHCPC_CLIENT_PORT  68
-00075 
-00076 #define DHCPDISCOVER  1
-00077 #define DHCPOFFER     2
-00078 #define DHCPREQUEST   3
-00079 #define DHCPDECLINE   4
-00080 #define DHCPACK       5
-00081 #define DHCPNAK       6
-00082 #define DHCPRELEASE   7
-00083 
-00084 #define DHCP_OPTION_SUBNET_MASK   1
-00085 #define DHCP_OPTION_ROUTER        3
-00086 #define DHCP_OPTION_DNS_SERVER    6
-00087 #define DHCP_OPTION_REQ_IPADDR   50
-00088 #define DHCP_OPTION_LEASE_TIME   51
-00089 #define DHCP_OPTION_MSG_TYPE     53
-00090 #define DHCP_OPTION_SERVER_ID    54
-00091 #define DHCP_OPTION_REQ_LIST     55
-00092 #define DHCP_OPTION_END         255
-00093 
-00094 static const u8_t xid[4] = {0xad, 0xde, 0x12, 0x23};
-00095 static const u8_t magic_cookie[4] = {99, 130, 83, 99};
-00096 /*---------------------------------------------------------------------------*/
-00097 static u8_t *
-00098 add_msg_type(u8_t *optptr, u8_t type)
-00099 {
-00100   *optptr++ = DHCP_OPTION_MSG_TYPE;
-00101   *optptr++ = 1;
-00102   *optptr++ = type;
-00103   return optptr;
-00104 }
-00105 /*---------------------------------------------------------------------------*/
-00106 static u8_t *
-00107 add_server_id(u8_t *optptr)
-00108 {
-00109   *optptr++ = DHCP_OPTION_SERVER_ID;
-00110   *optptr++ = 4;
-00111   memcpy(optptr, s.serverid, 4);
-00112   return optptr + 4;
-00113 }
-00114 /*---------------------------------------------------------------------------*/
-00115 static u8_t *
-00116 add_req_ipaddr(u8_t *optptr)
-00117 {
-00118   *optptr++ = DHCP_OPTION_REQ_IPADDR;
-00119   *optptr++ = 4;
-00120   memcpy(optptr, s.ipaddr, 4);
-00121   return optptr + 4;
-00122 }
-00123 /*---------------------------------------------------------------------------*/
-00124 static u8_t *
-00125 add_req_options(u8_t *optptr)
-00126 {
-00127   *optptr++ = DHCP_OPTION_REQ_LIST;
-00128   *optptr++ = 3;
-00129   *optptr++ = DHCP_OPTION_SUBNET_MASK;
-00130   *optptr++ = DHCP_OPTION_ROUTER;
-00131   *optptr++ = DHCP_OPTION_DNS_SERVER;
-00132   return optptr;
-00133 }
-00134 /*---------------------------------------------------------------------------*/
-00135 static u8_t *
-00136 add_end(u8_t *optptr)
-00137 {
-00138   *optptr++ = DHCP_OPTION_END;
-00139   return optptr;
-00140 }
-00141 /*---------------------------------------------------------------------------*/
-00142 static void
-00143 create_msg(register struct dhcp_msg *m)
-00144 {
-00145   m->op = DHCP_REQUEST;
-00146   m->htype = DHCP_HTYPE_ETHERNET;
-00147   m->hlen = s.mac_len;
-00148   m->hops = 0;
-00149   memcpy(m->xid, xid, sizeof(m->xid));
-00150   m->secs = 0;
-00151   m->flags = HTONS(BOOTP_BROADCAST); /*  Broadcast bit. */
-00152   /*  uip_ipaddr_copy(m->ciaddr, uip_hostaddr);*/
-00153   memcpy(m->ciaddr, uip_hostaddr, sizeof(m->ciaddr));
-00154   memset(m->yiaddr, 0, sizeof(m->yiaddr));
-00155   memset(m->siaddr, 0, sizeof(m->siaddr));
-00156   memset(m->giaddr, 0, sizeof(m->giaddr));
-00157   memcpy(m->chaddr, s.mac_addr, s.mac_len);
-00158   memset(&m->chaddr[s.mac_len], 0, sizeof(m->chaddr) - s.mac_len);
-00159 #ifndef UIP_CONF_DHCP_LIGHT
-00160   memset(m->sname, 0, sizeof(m->sname));
-00161   memset(m->file, 0, sizeof(m->file));
-00162 #endif
-00163 
-00164   memcpy(m->options, magic_cookie, sizeof(magic_cookie));
-00165 }
-00166 /*---------------------------------------------------------------------------*/
-00167 static void
-00168 send_discover(void)
-00169 {
-00170   u8_t *end;
-00171   struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
-00172 
-00173   create_msg(m);
-00174 
-00175   end = add_msg_type(&m->options[4], DHCPDISCOVER);
-00176   end = add_req_options(end);
-00177   end = add_end(end);
-00178 
-00179   uip_send(uip_appdata, end - (u8_t *)uip_appdata);
-00180 }
-00181 /*---------------------------------------------------------------------------*/
-00182 static void
-00183 send_request(void)
-00184 {
-00185   u8_t *end;
-00186   struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
-00187 
-00188   create_msg(m);
-00189   
-00190   end = add_msg_type(&m->options[4], DHCPREQUEST);
-00191   end = add_server_id(end);
-00192   end = add_req_ipaddr(end);
-00193   end = add_end(end);
-00194   
-00195   uip_send(uip_appdata, end - (u8_t *)uip_appdata);
-00196 }
-00197 /*---------------------------------------------------------------------------*/
-00198 static u8_t
-00199 parse_options(u8_t *optptr, int len)
-00200 {
-00201   u8_t *end = optptr + len;
-00202   u8_t type = 0;
-00203 
-00204   while(optptr < end) {
-00205     switch(*optptr) {
-00206     case DHCP_OPTION_SUBNET_MASK:
-00207       memcpy(s.netmask, optptr + 2, 4);
-00208       break;
-00209     case DHCP_OPTION_ROUTER:
-00210       memcpy(s.default_router, optptr + 2, 4);
-00211       break;
-00212     case DHCP_OPTION_DNS_SERVER:
-00213       memcpy(s.dnsaddr, optptr + 2, 4);
-00214       break;
-00215     case DHCP_OPTION_MSG_TYPE:
-00216       type = *(optptr + 2);
-00217       break;
-00218     case DHCP_OPTION_SERVER_ID:
-00219       memcpy(s.serverid, optptr + 2, 4);
-00220       break;
-00221     case DHCP_OPTION_LEASE_TIME:
-00222       memcpy(s.lease_time, optptr + 2, 4);
-00223       break;
-00224     case DHCP_OPTION_END:
-00225       return type;
-00226     }
-00227 
-00228     optptr += optptr[1] + 2;
-00229   }
-00230   return type;
-00231 }
-00232 /*---------------------------------------------------------------------------*/
-00233 static u8_t
-00234 parse_msg(void)
-00235 {
-00236   struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
-00237   
-00238   if(m->op == DHCP_REPLY &&
-00239      memcmp(m->xid, xid, sizeof(xid)) == 0 &&
-00240      memcmp(m->chaddr, s.mac_addr, s.mac_len) == 0) {
-00241     memcpy(s.ipaddr, m->yiaddr, 4);
-00242     return parse_options(&m->options[4], uip_datalen());
-00243   }
-00244   return 0;
-00245 }
-00246 /*---------------------------------------------------------------------------*/
-00247 static
-00248 PT_THREAD(handle_dhcp(void))
-00249 {
-00250   PT_BEGIN(&s.pt);
-00251   
-00252   /* try_again:*/
-00253   s.state = STATE_SENDING;
-00254   s.ticks = CLOCK_SECOND;
-00255 
-00256   do {
-00257     send_discover();
-00258     timer_set(&s.timer, s.ticks);
-00259     PT_WAIT_UNTIL(&s.pt, uip_newdata() || timer_expired(&s.timer));
-00260 
-00261     if(uip_newdata() && parse_msg() == DHCPOFFER) {
-00262       s.state = STATE_OFFER_RECEIVED;
-00263       break;
-00264     }
-00265 
-00266     if(s.ticks < CLOCK_SECOND * 60) {
-00267       s.ticks *= 2;
-00268     }
-00269   } while(s.state != STATE_OFFER_RECEIVED);
-00270   
-00271   s.ticks = CLOCK_SECOND;
-00272 
-00273   do {
-00274     send_request();
-00275     timer_set(&s.timer, s.ticks);
-00276     PT_WAIT_UNTIL(&s.pt, uip_newdata() || timer_expired(&s.timer));
-00277 
-00278     if(uip_newdata() && parse_msg() == DHCPACK) {
-00279       s.state = STATE_CONFIG_RECEIVED;
-00280       break;
-00281     }
-00282 
-00283     if(s.ticks <= CLOCK_SECOND * 10) {
-00284       s.ticks += CLOCK_SECOND;
-00285     } else {
-00286       PT_RESTART(&s.pt);
-00287     }
-00288   } while(s.state != STATE_CONFIG_RECEIVED);
-00289   
-00290 #if 0
-00291   printf("Got IP address %d.%d.%d.%d\n",
-00292          uip_ipaddr1(s.ipaddr), uip_ipaddr2(s.ipaddr),
-00293          uip_ipaddr3(s.ipaddr), uip_ipaddr4(s.ipaddr));
-00294   printf("Got netmask %d.%d.%d.%d\n",
-00295          uip_ipaddr1(s.netmask), uip_ipaddr2(s.netmask),
-00296          uip_ipaddr3(s.netmask), uip_ipaddr4(s.netmask));
-00297   printf("Got DNS server %d.%d.%d.%d\n",
-00298          uip_ipaddr1(s.dnsaddr), uip_ipaddr2(s.dnsaddr),
-00299          uip_ipaddr3(s.dnsaddr), uip_ipaddr4(s.dnsaddr));
-00300   printf("Got default router %d.%d.%d.%d\n",
-00301          uip_ipaddr1(s.default_router), uip_ipaddr2(s.default_router),
-00302          uip_ipaddr3(s.default_router), uip_ipaddr4(s.default_router));
-00303   printf("Lease expires in %ld seconds\n",
-00304          ntohs(s.lease_time[0])*65536ul + ntohs(s.lease_time[1]));
-00305 #endif
-00306 
-00307   dhcpc_configured(&s);
-00308   
-00309   /*  timer_stop(&s.timer);*/
-00310 
-00311   /*
-00312    * PT_END restarts the thread so we do this instead. Eventually we
-00313    * should reacquire expired leases here.
-00314    */
-00315   while(1) {
-00316     PT_YIELD(&s.pt);
-00317   }
-00318 
-00319   PT_END(&s.pt);
-00320 }
-00321 /*---------------------------------------------------------------------------*/
-00322 void
-00323 dhcpc_init(const void *mac_addr, int mac_len)
-00324 {
-00325   uip_ipaddr_t addr;
-00326   
-00327   s.mac_addr = mac_addr;
-00328   s.mac_len  = mac_len;
-00329 
-00330   s.state = STATE_INITIAL;
-00331   uip_ipaddr(addr, 255,255,255,255);
-00332   s.conn = uip_udp_new(&addr, HTONS(DHCPC_SERVER_PORT));
-00333   if(s.conn != NULL) {
-00334     uip_udp_bind(s.conn, HTONS(DHCPC_CLIENT_PORT));
-00335   }
-00336   PT_INIT(&s.pt);
-00337 }
-00338 /*---------------------------------------------------------------------------*/
-00339 void
-00340 dhcpc_appcall(void)
-00341 {
-00342   handle_dhcp();
-00343 }
-00344 /*---------------------------------------------------------------------------*/
-00345 void
-00346 dhcpc_request(void)
-00347 {
-00348   u16_t ipaddr[2];
-00349   
-00350   if(s.state == STATE_INITIAL) {
-00351     uip_ipaddr(ipaddr, 0,0,0,0);
-00352     uip_sethostaddr(ipaddr);
-00353     /*    handle_dhcp(PROCESS_EVENT_NONE, NULL);*/
-00354   }
-00355 }
-00356 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00049.html b/components/net/uip/doc/html/a00049.html deleted file mode 100644 index 5b5a7c0368..0000000000 --- a/components/net/uip/doc/html/a00049.html +++ /dev/null @@ -1,88 +0,0 @@ - - -uIP 1.0: dhcpc.h - - - - - -

dhcpc.h

00001 /*
-00002  * Copyright (c) 2005, Swedish Institute of Computer Science
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * @(#)$Id: dhcpc.h,v 1.3 2006/06/11 21:46:37 adam Exp $
-00032  */
-00033 #ifndef __DHCPC_H__
-00034 #define __DHCPC_H__
-00035 
-00036 #include "timer.h"
-00037 #include "pt.h"
-00038 
-00039 struct dhcpc_state {
-00040   struct pt pt;
-00041   char state;
-00042   struct uip_udp_conn *conn;
-00043   struct timer timer;
-00044   u16_t ticks;
-00045   const void *mac_addr;
-00046   int mac_len;
-00047   
-00048   u8_t serverid[4];
-00049 
-00050   u16_t lease_time[2];
-00051   u16_t ipaddr[2];
-00052   u16_t netmask[2];
-00053   u16_t dnsaddr[2];
-00054   u16_t default_router[2];
-00055 };
-00056 
-00057 void dhcpc_init(const void *mac_addr, int mac_len);
-00058 void dhcpc_request(void);
-00059 
-00060 void dhcpc_appcall(void);
-00061 
-00062 void dhcpc_configured(const struct dhcpc_state *s);
-00063 
-00064 typedef struct dhcpc_state uip_udp_appstate_t;
-00065 #define UIP_UDP_APPCALL dhcpc_appcall
-00066 
-00067 
-00068 #endif /* __DHCPC_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00050.html b/components/net/uip/doc/html/a00050.html deleted file mode 100644 index ddfa65690d..0000000000 --- a/components/net/uip/doc/html/a00050.html +++ /dev/null @@ -1,177 +0,0 @@ - - -uIP 1.0: uip-conf.h - - - - - -

uip-conf.h

00001 /**
-00002  * \addtogroup uipopt
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \name Project-specific configuration options
-00008  * @{
-00009  *
-00010  * uIP has a number of configuration options that can be overridden
-00011  * for each project. These are kept in a project-specific uip-conf.h
-00012  * file and all configuration names have the prefix UIP_CONF.
-00013  */
-00014 
-00015 /*
-00016  * Copyright (c) 2006, Swedish Institute of Computer Science.
-00017  * All rights reserved.
-00018  *
-00019  * Redistribution and use in source and binary forms, with or without
-00020  * modification, are permitted provided that the following conditions
-00021  * are met:
-00022  * 1. Redistributions of source code must retain the above copyright
-00023  *    notice, this list of conditions and the following disclaimer.
-00024  * 2. Redistributions in binary form must reproduce the above copyright
-00025  *    notice, this list of conditions and the following disclaimer in the
-00026  *    documentation and/or other materials provided with the distribution.
-00027  * 3. Neither the name of the Institute nor the names of its contributors
-00028  *    may be used to endorse or promote products derived from this software
-00029  *    without specific prior written permission.
-00030  *
-00031  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00032  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00033  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00034  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00035  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00036  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00037  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00038  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00039  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00040  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00041  * SUCH DAMAGE.
-00042  *
-00043  * This file is part of the uIP TCP/IP stack
-00044  *
-00045  * $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
-00046  */
-00047 
-00048 /**
-00049  * \file
-00050  *         An example uIP configuration file
-00051  * \author
-00052  *         Adam Dunkels <adam@sics.se>
-00053  */
-00054 
-00055 #ifndef __UIP_CONF_H__
-00056 #define __UIP_CONF_H__
-00057 
-00058 #include <inttypes.h>
-00059 
-00060 /**
-00061  * 8 bit datatype
-00062  *
-00063  * This typedef defines the 8-bit type used throughout uIP.
-00064  *
-00065  * \hideinitializer
-00066  */
-00067 typedef uint8_t u8_t;
-00068 
-00069 /**
-00070  * 16 bit datatype
-00071  *
-00072  * This typedef defines the 16-bit type used throughout uIP.
-00073  *
-00074  * \hideinitializer
-00075  */
-00076 typedef uint16_t u16_t;
-00077 
-00078 /**
-00079  * Statistics datatype
-00080  *
-00081  * This typedef defines the dataype used for keeping statistics in
-00082  * uIP.
-00083  *
-00084  * \hideinitializer
-00085  */
-00086 typedef unsigned short uip_stats_t;
-00087 
-00088 /**
-00089  * Maximum number of TCP connections.
-00090  *
-00091  * \hideinitializer
-00092  */
-00093 #define UIP_CONF_MAX_CONNECTIONS 40
-00094 
-00095 /**
-00096  * Maximum number of listening TCP ports.
-00097  *
-00098  * \hideinitializer
-00099  */
-00100 #define UIP_CONF_MAX_LISTENPORTS 40
-00101 
-00102 /**
-00103  * uIP buffer size.
-00104  *
-00105  * \hideinitializer
-00106  */
-00107 #define UIP_CONF_BUFFER_SIZE     420
-00108 
-00109 /**
-00110  * CPU byte order.
-00111  *
-00112  * \hideinitializer
-00113  */
-00114 #define UIP_CONF_BYTE_ORDER      LITTLE_ENDIAN
-00115 
-00116 /**
-00117  * Logging on or off
-00118  *
-00119  * \hideinitializer
-00120  */
-00121 #define UIP_CONF_LOGGING         1
-00122 
-00123 /**
-00124  * UDP support on or off
-00125  *
-00126  * \hideinitializer
-00127  */
-00128 #define UIP_CONF_UDP             0
-00129 
-00130 /**
-00131  * UDP checksums on or off
-00132  *
-00133  * \hideinitializer
-00134  */
-00135 #define UIP_CONF_UDP_CHECKSUMS   1
-00136 
-00137 /**
-00138  * uIP statistics on or off
-00139  *
-00140  * \hideinitializer
-00141  */
-00142 #define UIP_CONF_STATISTICS      1
-00143 
-00144 /* Here we include the header file for the application(s) we use in
-00145    our project. */
-00146 /*#include "smtp.h"*/
-00147 /*#include "hello-world.h"*/
-00148 /*#include "telnetd.h"*/
-00149 #include "webserver.h"
-00150 /*#include "dhcpc.h"*/
-00151 /*#include "resolv.h"*/
-00152 /*#include "webclient.h"*/
-00153 
-00154 #endif /* __UIP_CONF_H__ */
-00155 
-00156 /** @} */
-00157 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00051.html b/components/net/uip/doc/html/a00051.html deleted file mode 100644 index e9197ffefa..0000000000 --- a/components/net/uip/doc/html/a00051.html +++ /dev/null @@ -1,138 +0,0 @@ - - -uIP 1.0: uip-code-style.c - - - - - -

uip-code-style.c

00001 /* This is the official code style of uIP. */
-00002 
-00003 /**
-00004  * \defgroup codestyle Coding style
-00005  *
-00006  * This is how a Doxygen module is documented - start with a \defgroup
-00007  * Doxygen keyword at the beginning of the file to define a module,
-00008  * and use the \addtogroup Doxygen keyword in all other files that
-00009  * belong to the same module. Typically, the \defgroup is placed in
-00010  * the .h file and \addtogroup in the .c file.
-00011  *
-00012  * @{
-00013  */
-00014 
-00015 /**
-00016  * \file
-00017  *         A brief description of what this file is.
-00018  * \author
-00019  *         Adam Dunkels <adam@sics.se>
-00020  *
-00021  *         Every file that is part of a documented module has to have
-00022  *         a \file block, else it will not show up in the Doxygen
-00023  *         "Modules" * section.
-00024  */
-00025 
-00026 /* Single line comments look like this. */
-00027 
-00028 /*
-00029  * Multi-line comments look like this. Comments should prefferably be
-00030  * full sentences, filled to look like real paragraphs.
-00031  */
-00032 
-00033 #include "uip.h"
-00034 
-00035 /*
-00036  * Make sure that non-global variables are all maked with the static
-00037  * keyword. This keeps the size of the symbol table down.
-00038  */
-00039 static int flag;
-00040 
-00041 /*
-00042  * All variables and functions that are visible outside of the file
-00043  * should have the module name prepended to them. This makes it easy
-00044  * to know where to look for function and variable definitions.
-00045  *
-00046  * Put dividers (a single-line comment consisting only of dashes)
-00047  * between functions.
-00048  */
-00049 /*---------------------------------------------------------------------------*/
-00050 /**
-00051  * \brief      Use Doxygen documentation for functions.
-00052  * \param c    Briefly describe all parameters.
-00053  * \return     Briefly describe the return value.
-00054  * \retval 0   Functions that return a few specified values
-00055  * \retval 1   can use the \retval keyword instead of \return.
-00056  *
-00057  *             Put a longer description of what the function does
-00058  *             after the preamble of Doxygen keywords.
-00059  *
-00060  *             This template should always be used to document
-00061  *             functions. The text following the introduction is used
-00062  *             as the function's documentation.
-00063  *
-00064  *             Function prototypes have the return type on one line,
-00065  *             the name and arguments on one line (with no space
-00066  *             between the name and the first parenthesis), followed
-00067  *             by a single curly bracket on its own line.
-00068  */
-00069 void
-00070 code_style_example_function(void)
-00071 {
-00072   /*
-00073    * Local variables should always be declared at the start of the
-00074    * function.
-00075    */
-00076   int i;                   /* Use short variable names for loop
-00077                               counters. */
-00078 
-00079   /*
-00080    * There should be no space between keywords and the first
-00081    * parenthesis. There should be spaces around binary operators, no
-00082    * spaces between a unary operator and its operand.
-00083    *
-00084    * Curly brackets following for(), if(), do, and case() statements
-00085    * should follow the statement on the same line.
-00086    */
-00087   for(i = 0; i < 10; ++i) {
-00088     /*
-00089      * Always use full blocks (curly brackets) after if(), for(), and
-00090      * while() statements, even though the statement is a single line
-00091      * of code. This makes the code easier to read and modifications
-00092      * are less error prone.
-00093      */
-00094     if(i == c) {
-00095       return c;           /* No parentesis around return values. */
-00096     } else {              /* The else keyword is placed inbetween
-00097                              curly brackers, always on its own line. */
-00098       c++;
-00099     }
-00100   }
-00101 }
-00102 /*---------------------------------------------------------------------------*/
-00103 /*
-00104  * Static (non-global) functions do not need Doxygen comments. The
-00105  * name should not be prepended with the module name - doing so would
-00106  * create confusion.
-00107  */
-00108 static void
-00109 an_example_function(void)
-00110 {
-00111   
-00112 }
-00113 /*---------------------------------------------------------------------------*/
-00114 
-00115 /* The following stuff ends the \defgroup block at the beginning of
-00116    the file: */
-00117 
-00118 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00077.html b/components/net/uip/doc/html/a00077.html deleted file mode 100644 index 824f439133..0000000000 --- a/components/net/uip/doc/html/a00077.html +++ /dev/null @@ -1,78 +0,0 @@ - - -uIP 1.0: dhcpc_state Struct Reference - - - - - - -

dhcpc_state Struct Reference


Detailed Description

-
Examples:
- -

-dhcpc.c, and dhcpc.h.

-

- -

-Definition at line 39 of file dhcpc.h.

LocalRemoteStateRetransmissionsTimerFlags
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-pt pt
-char state
-uip_udp_conn * conn
-timer timer
-u16_t ticks
-const void * mac_addr
-int mac_len
-u8_t serverid [4]
-u16_t lease_time [2]
-u16_t ipaddr [2]
-u16_t netmask [2]
-u16_t dnsaddr [2]
-u16_t default_router [2]
-
Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00078.html b/components/net/uip/doc/html/a00078.html deleted file mode 100644 index ef60451c24..0000000000 --- a/components/net/uip/doc/html/a00078.html +++ /dev/null @@ -1,51 +0,0 @@ - - -uIP 1.0: hello_world_state Struct Reference - - - - - - -

hello_world_state Struct Reference
- -[Hello, world] -


Detailed Description

-
Examples:
- -

-hello-world.c, and hello-world.h.

-

- -

-Definition at line 36 of file hello-world.h. - - - - - - - - -

Data Fields

-psock p
-char inputbuffer [10]
-char name [40]
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00079.html b/components/net/uip/doc/html/a00079.html deleted file mode 100644 index 2701b54928..0000000000 --- a/components/net/uip/doc/html/a00079.html +++ /dev/null @@ -1,45 +0,0 @@ - - -uIP 1.0: httpd_cgi_call Struct Reference - - - - - - -

httpd_cgi_call Struct Reference
- -[Web server] -


Detailed Description

- -

- -

-Definition at line 60 of file httpd-cgi.h. - - - - - - -

Data Fields

-const char * name
-const httpd_cgifunction function
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00080.html b/components/net/uip/doc/html/a00080.html deleted file mode 100644 index 737ea1318d..0000000000 --- a/components/net/uip/doc/html/a00080.html +++ /dev/null @@ -1,69 +0,0 @@ - - -uIP 1.0: httpd_state Struct Reference - - - - - - -

httpd_state Struct Reference


Detailed Description

- -

- -

-Definition at line 41 of file httpd.h. - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-unsigned char timer
-psock sin sout
-pt outputpt scriptpt
-char inputbuf [50]
-char filename [20]
-char state
-httpd_fs_file file
-int len
-char * scriptptr
-int scriptlen
-unsigned short count
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00081.html b/components/net/uip/doc/html/a00081.html deleted file mode 100644 index 821207bf72..0000000000 --- a/components/net/uip/doc/html/a00081.html +++ /dev/null @@ -1,51 +0,0 @@ - - -uIP 1.0: memb_blocks Struct Reference - - - - - - -

memb_blocks Struct Reference
- -[Memory block management functions] -


Detailed Description

- -

- -

-Definition at line 105 of file memb.h. - - - - - - - - - - -

Data Fields

-unsigned short size
-unsigned short num
-char * count
-void * mem
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00082.html b/components/net/uip/doc/html/a00082.html deleted file mode 100644 index 0da540dd5d..0000000000 --- a/components/net/uip/doc/html/a00082.html +++ /dev/null @@ -1,73 +0,0 @@ - - -uIP 1.0: psock Struct Reference - - - - - - -

psock Struct Reference
- -[Protosockets library] -

#include <psock.h> -

-


Detailed Description

-The representation of a protosocket. -

-The protosocket structrure is an opaque structure with no user-visible elements.

Examples:
- -

-hello-world.h.

-

- -

-Definition at line 106 of file psock.h. - - - - - - - - - - - - - - - - - - - - -

Data Fields

-pt pt psockpt
-const u8_t * sendptr
-u8_t * readptr
-char * bufptr
-u16_t sendlen
-u16_t readlen
-psock_buf buf
-unsigned int bufsize
-unsigned char state
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00083.html b/components/net/uip/doc/html/a00083.html deleted file mode 100644 index 2cfc033483..0000000000 --- a/components/net/uip/doc/html/a00083.html +++ /dev/null @@ -1,45 +0,0 @@ - - -uIP 1.0: psock_buf Struct Reference - - - - - - -

psock_buf Struct Reference
- -[Protosockets library] -


Detailed Description

- -

- -

-Definition at line 95 of file psock.h. - - - - - - -

Data Fields

-u8_t * ptr
-unsigned short left
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00084.html b/components/net/uip/doc/html/a00084.html deleted file mode 100644 index 7a7741fdff..0000000000 --- a/components/net/uip/doc/html/a00084.html +++ /dev/null @@ -1,45 +0,0 @@ - - -uIP 1.0: pt Struct Reference - - - - - - -

pt Struct Reference
- -[Protothreads] -


Detailed Description

-
Examples:
- -

-dhcpc.h.

-

- -

-Definition at line 54 of file pt.h. - - - - -

Data Fields

-lc_t lc
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00085.html b/components/net/uip/doc/html/a00085.html deleted file mode 100644 index 4226e0ecbc..0000000000 --- a/components/net/uip/doc/html/a00085.html +++ /dev/null @@ -1,69 +0,0 @@ - - -uIP 1.0: smtp_state Struct Reference - - - - - - -

smtp_state Struct Reference
- -[SMTP E-mail sender] -


Detailed Description

-
Examples:
- -

-hello-world.h, smtp.c, and smtp.h.

-

- -

-Definition at line 81 of file smtp.h. - - - - - - - - - - - - - - - - - - - - -

Data Fields

-u8_t state
-char * to
-char * from
-char * subject
-char * msg
-u16_t msglen
-u16_t sentlen
-u16_t textlen
-u16_t sendptr
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00086.html b/components/net/uip/doc/html/a00086.html deleted file mode 100644 index 1611163d6f..0000000000 --- a/components/net/uip/doc/html/a00086.html +++ /dev/null @@ -1,54 +0,0 @@ - - -uIP 1.0: telnetd_state Struct Reference - - - - - - -

telnetd_state Struct Reference


Detailed Description

-
Examples:
- -

-telnetd.c, and telnetd.h.

-

- -

-Definition at line 49 of file telnetd.h. - - - - - - - - - - - - -

Data Fields

-char * lines [TELNETD_CONF_NUMLINES]
-char buf [TELNETD_CONF_LINELEN]
-char bufptr
-u8_t numsent
-u8_t state
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00087.html b/components/net/uip/doc/html/a00087.html deleted file mode 100644 index 3b2fec3c87..0000000000 --- a/components/net/uip/doc/html/a00087.html +++ /dev/null @@ -1,52 +0,0 @@ - - -uIP 1.0: timer Struct Reference - - - - - - -

timer Struct Reference
- -[Timer library] -

#include <timer.h> -

-


Detailed Description

-A timer. -

-This structure is used for declaring a timer. The timer must be set with timer_set() before it can be used.

Examples:
- -

-dhcpc.h, example-mainloop-with-arp.c, example-mainloop-without-arp.c, and webclient.h.

-

- -

-Definition at line 74 of file timer.h. - - - - - - -

Data Fields

-clock_time_t start
-clock_time_t interval
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00088.html b/components/net/uip/doc/html/a00088.html deleted file mode 100644 index 7ca46ae6a4..0000000000 --- a/components/net/uip/doc/html/a00088.html +++ /dev/null @@ -1,103 +0,0 @@ - - -uIP 1.0: uip_conn Struct Reference - - - - - - -

uip_conn Struct Reference
- -[The uIP TCP/IP stack] -

#include <uip.h> -

-


Detailed Description

-Representation of a uIP TCP connection. -

-The uip_conn structure is used for identifying a connection. All but one field in the structure are to be considered read-only by an application. The only exception is the appstate field whos purpose is to let the application store application-specific state (e.g., file pointers) for the connection. The type of this field is configured in the "uipopt.h" header file. -

- -

-Definition at line 1153 of file uip.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-uip_ipaddr_t ripaddr
 The IP address of the remote host.
-u16_t lport
 The local TCP port, in network byte order.
-u16_t rport
 The local remote TCP port, in network byte order.
-u8_t rcv_nxt [4]
 The sequence number that we expect to receive next.
-u8_t snd_nxt [4]
 The sequence number that was last sent by us.
-u16_t len
 Length of the data that was previously sent.
-u16_t mss
 Current maximum segment size for the connection.
-u16_t initialmss
 Initial maximum segment size for the connection.
-u8_t sa
 Retransmission time-out calculation state variable.
-u8_t sv
 Retransmission time-out calculation state variable.
-u8_t rto
 Retransmission time-out.
-u8_t tcpstateflags
 TCP state and flags.
-u8_t timer
 The retransmission timer.
-u8_t nrtx
 The number of retransmissions for the last segment sent.
-uip_tcp_appstate_t appstate
 The application state.
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00089.html b/components/net/uip/doc/html/a00089.html deleted file mode 100644 index d935ccddff..0000000000 --- a/components/net/uip/doc/html/a00089.html +++ /dev/null @@ -1,44 +0,0 @@ - - -uIP 1.0: uip_eth_addr Struct Reference - - - - - - -

uip_eth_addr Struct Reference
- -[The uIP TCP/IP stack] -

#include <uip.h> -

-


Detailed Description

-Representation of a 48-bit Ethernet address. -

- -

-Definition at line 1542 of file uip.h. - - - - -

Data Fields

-u8_t addr [6]
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00090.html b/components/net/uip/doc/html/a00090.html deleted file mode 100644 index ee37ca5099..0000000000 --- a/components/net/uip/doc/html/a00090.html +++ /dev/null @@ -1,50 +0,0 @@ - - -uIP 1.0: uip_eth_hdr Struct Reference - - - - - - -

uip_eth_hdr Struct Reference
- -[uIP Address Resolution Protocol] -

#include <uip_arp.h> -

-


Detailed Description

-The Ethernet header. -

- -

-Definition at line 63 of file uip_arp.h. - - - - - - - - -

Data Fields

-uip_eth_addr dest
-uip_eth_addr src
-u16_t type
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00091.html b/components/net/uip/doc/html/a00091.html deleted file mode 100644 index 63a2a523c5..0000000000 --- a/components/net/uip/doc/html/a00091.html +++ /dev/null @@ -1,84 +0,0 @@ - - -uIP 1.0: uip_icmpip_hdr Struct Reference - - - - - - -

uip_icmpip_hdr Struct Reference
- -[The uIP TCP/IP stack] -


Detailed Description

- -

- -

-Definition at line 1423 of file uip.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-u8_t vhl
-u8_t tos
-u8_t len [2]
-u8_t ipid [2]
-u8_t ipoffset [2]
-u8_t ttl
-u8_t proto
-u16_t ipchksum
-u16_t srcipaddr [2]
-u16_t destipaddr [2]
-u8_t type
-u8_t icode
-u16_t icmpchksum
-u16_t id
-u16_t seqno
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00092.html b/components/net/uip/doc/html/a00092.html deleted file mode 100644 index 93c00c2a85..0000000000 --- a/components/net/uip/doc/html/a00092.html +++ /dev/null @@ -1,39 +0,0 @@ - - -uIP 1.0: uip_neighbor_addr Struct Reference - - - - - - -

uip_neighbor_addr Struct Reference


Detailed Description

- -

- -

-Definition at line 47 of file uip-neighbor.h. - - - - -

Data Fields

-uip_eth_addr addr
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00093.html b/components/net/uip/doc/html/a00093.html deleted file mode 100644 index 2d3a91a40b..0000000000 --- a/components/net/uip/doc/html/a00093.html +++ /dev/null @@ -1,143 +0,0 @@ - - -uIP 1.0: uip_stats Struct Reference - - - - - - -

uip_stats Struct Reference
- -[The uIP TCP/IP stack] -

#include <uip.h> -

-


Detailed Description

-The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. -

- -

-Definition at line 1232 of file uip.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-struct {
   uip_stats_t   drop
 Number of dropped packets at the IP layer.
   uip_stats_t   recv
 Number of received packets at the IP layer.
   uip_stats_t   sent
 Number of sent packets at the IP layer.
   uip_stats_t   vhlerr
 Number of packets dropped due to wrong IP version or header length.
   uip_stats_t   hblenerr
 Number of packets dropped due to wrong IP length, high byte.
   uip_stats_t   lblenerr
 Number of packets dropped due to wrong IP length, low byte.
   uip_stats_t   fragerr
 Number of packets dropped since they were IP fragments.
   uip_stats_t   chkerr
 Number of packets dropped due to IP checksum errors.
   uip_stats_t   protoerr
 Number of packets dropped since they were neither ICMP, UDP nor TCP.
} ip
 IP statistics.
-struct {
   uip_stats_t   drop
 Number of dropped ICMP packets.
   uip_stats_t   recv
 Number of received ICMP packets.
   uip_stats_t   sent
 Number of sent ICMP packets.
   uip_stats_t   typeerr
 Number of ICMP packets with a wrong type.
} icmp
 ICMP statistics.
-struct {
   uip_stats_t   drop
 Number of dropped TCP segments.
   uip_stats_t   recv
 Number of recived TCP segments.
   uip_stats_t   sent
 Number of sent TCP segments.
   uip_stats_t   chkerr
 Number of TCP segments with a bad checksum.
   uip_stats_t   ackerr
 Number of TCP segments with a bad ACK number.
   uip_stats_t   rst
 Number of recevied TCP RST (reset) segments.
   uip_stats_t   rexmit
 Number of retransmitted TCP segments.
   uip_stats_t   syndrop
 Number of dropped SYNs due to too few connections was avaliable.
   uip_stats_t   synrst
 Number of SYNs for closed ports, triggering a RST.
} tcp
 TCP statistics.
-struct {
   uip_stats_t   drop
 Number of dropped UDP segments.
   uip_stats_t   recv
 Number of recived UDP segments.
   uip_stats_t   sent
 Number of sent UDP segments.
   uip_stats_t   chkerr
 Number of UDP segments with a bad checksum.
} udp
 UDP statistics.
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00094.html b/components/net/uip/doc/html/a00094.html deleted file mode 100644 index 7d21f8c66f..0000000000 --- a/components/net/uip/doc/html/a00094.html +++ /dev/null @@ -1,99 +0,0 @@ - - -uIP 1.0: uip_tcpip_hdr Struct Reference - - - - - - -

uip_tcpip_hdr Struct Reference
- -[The uIP TCP/IP stack] -


Detailed Description

- -

- -

-Definition at line 1386 of file uip.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-u8_t vhl
-u8_t tos
-u8_t len [2]
-u8_t ipid [2]
-u8_t ipoffset [2]
-u8_t ttl
-u8_t proto
-u16_t ipchksum
-u16_t srcipaddr [2]
-u16_t destipaddr [2]
-u16_t srcport
-u16_t destport
-u8_t seqno [4]
-u8_t ackno [4]
-u8_t tcpoffset
-u8_t flags
-u8_t wnd [2]
-u16_t tcpchksum
-u8_t urgp [2]
-u8_t optdata [4]
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00095.html b/components/net/uip/doc/html/a00095.html deleted file mode 100644 index f61d8975aa..0000000000 --- a/components/net/uip/doc/html/a00095.html +++ /dev/null @@ -1,64 +0,0 @@ - - -uIP 1.0: uip_udp_conn Struct Reference - - - - - - -

uip_udp_conn Struct Reference
- -[The uIP TCP/IP stack] -

#include <uip.h> -

-


Detailed Description

-Representation of a uIP UDP connection.
Examples:
- -

-dhcpc.h, and resolv.c.

-

- -

-Definition at line 1210 of file uip.h. - - - - - - - - - - - - - - - - - -

Data Fields

-uip_ipaddr_t ripaddr
 The IP address of the remote peer.
-u16_t lport
 The local port number in network byte order.
-u16_t rport
 The remote port number in network byte order.
-u8_t ttl
 Default time-to-live.
-uip_udp_appstate_t appstate
 The application state.
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00096.html b/components/net/uip/doc/html/a00096.html deleted file mode 100644 index 48d6bf35cd..0000000000 --- a/components/net/uip/doc/html/a00096.html +++ /dev/null @@ -1,81 +0,0 @@ - - -uIP 1.0: uip_udpip_hdr Struct Reference - - - - - - -

uip_udpip_hdr Struct Reference
- -[The uIP TCP/IP stack] -


Detailed Description

- -

- -

-Definition at line 1460 of file uip.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-u8_t vhl
-u8_t tos
-u8_t len [2]
-u8_t ipid [2]
-u8_t ipoffset [2]
-u8_t ttl
-u8_t proto
-u16_t ipchksum
-u16_t srcipaddr [2]
-u16_t destipaddr [2]
-u16_t srcport
-u16_t destport
-u16_t udplen
-u16_t udpchksum
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00097.html b/components/net/uip/doc/html/a00097.html deleted file mode 100644 index da7b8527f6..0000000000 --- a/components/net/uip/doc/html/a00097.html +++ /dev/null @@ -1,75 +0,0 @@ - - -uIP 1.0: webclient_state Struct Reference - - - - - - -

webclient_state Struct Reference
- -[Web client] -


Detailed Description

-
Examples:
- -

-webclient.c, and webclient.h.

-

- -

-Definition at line 55 of file webclient.h. - - - - - - - - - - - - - - - - - - - - - - - - -

Data Fields

-u8_t timer
-u8_t state
-u8_t httpflag
-u16_t port
-char host [40]
-char file [WEBCLIENT_CONF_MAX_URLLEN]
-u16_t getrequestptr
-u16_t getrequestleft
-char httpheaderline [200]
-u16_t httpheaderlineptr
-char mimetype [32]
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00100.html b/components/net/uip/doc/html/a00100.html deleted file mode 100644 index 8291183fb6..0000000000 --- a/components/net/uip/doc/html/a00100.html +++ /dev/null @@ -1,48 +0,0 @@ - - -uIP 1.0: apps/hello-world/hello-world.c File Reference - - - - - - -

apps/hello-world/hello-world.c File Reference


Detailed Description

-An example of how to write uIP applications with protosockets. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file hello-world.c. -

-#include "hello-world.h"
-#include "uip.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - -

Functions

-void hello_world_init (void)
-void hello_world_appcall (void)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00101.html b/components/net/uip/doc/html/a00101.html deleted file mode 100644 index f4761b8430..0000000000 --- a/components/net/uip/doc/html/a00101.html +++ /dev/null @@ -1,54 +0,0 @@ - - -uIP 1.0: apps/hello-world/hello-world.h File Reference - - - - - - -

apps/hello-world/hello-world.h File Reference


Detailed Description

-Header file for an example of how to write uIP applications with protosockets. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file hello-world.h. -

-#include "uipopt.h"
-#include "psock.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - -

Data Structures

struct  hello_world_state

Defines

-#define UIP_APPCALL   hello_world_appcall

Functions

-void hello_world_appcall (void)
-void hello_world_init (void)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00102.html b/components/net/uip/doc/html/a00102.html deleted file mode 100644 index 1f4e3fa792..0000000000 --- a/components/net/uip/doc/html/a00102.html +++ /dev/null @@ -1,119 +0,0 @@ - - -uIP 1.0: apps/resolv/resolv.c File Reference - - - - - - -

apps/resolv/resolv.c File Reference


Detailed Description

-DNS host name to IP address resolver. -

-

Author:
Adam Dunkels <adam@dunkels.com>
-This file implements a DNS host name to IP address resolver. -

-Definition in file resolv.c. -

-#include "resolv.h"
-#include "uip.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define NULL   (void *)0
-#define MAX_RETRIES   8
-#define DNS_FLAG1_RESPONSE   0x80
-#define DNS_FLAG1_OPCODE_STATUS   0x10
-#define DNS_FLAG1_OPCODE_INVERSE   0x08
-#define DNS_FLAG1_OPCODE_STANDARD   0x00
-#define DNS_FLAG1_AUTHORATIVE   0x04
-#define DNS_FLAG1_TRUNC   0x02
-#define DNS_FLAG1_RD   0x01
-#define DNS_FLAG2_RA   0x80
-#define DNS_FLAG2_ERR_MASK   0x0f
-#define DNS_FLAG2_ERR_NONE   0x00
-#define DNS_FLAG2_ERR_NAME   0x03
-#define STATE_UNUSED   0
-#define STATE_NEW   1
-#define STATE_ASKING   2
-#define STATE_DONE   3
-#define STATE_ERROR   4
-#define RESOLV_ENTRIES   4

Functions

-void resolv_appcall (void)
void resolv_query (char *name)
 Queues a name so that a question for the name will be sent out.
u16_t * resolv_lookup (char *name)
 Look up a hostname in the array of known hostnames.
u16_t * resolv_getserver (void)
 Obtain the currently configured DNS server.
void resolv_conf (u16_t *dnsserver)
 Configure which DNS server to use for queries.
-void resolv_init (void)
 Initalize the resolver.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00103.html b/components/net/uip/doc/html/a00103.html deleted file mode 100644 index cf6a03ad9c..0000000000 --- a/components/net/uip/doc/html/a00103.html +++ /dev/null @@ -1,84 +0,0 @@ - - -uIP 1.0: apps/resolv/resolv.h File Reference - - - - - - -

apps/resolv/resolv.h File Reference


Detailed Description

-DNS resolver code header file. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file resolv.h. -

-#include "uipopt.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Appication specific configurations

An uIP application is implemented using a single application function that is called by uIP whenever a TCP/IP event occurs. The name of this function must be registered with uIP at compile time using the UIP_APPCALL definition.

-uIP applications can store the application state within the uip_conn structure by specifying the type of the application structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.

-The file containing the definitions must be included in the uipopt.h file.

-The following example illustrates how this can look.

void httpd_appcall(void);
-#define UIP_APPCALL     httpd_appcall
-
-struct httpd_state {
-  u8_t state;
-  u16_t count;
-  char *dataptr;
-  char *script;
-};
-typedef struct httpd_state uip_tcp_appstate_t
-


typedef int uip_udp_appstate_t
 The type of the application state that is to be stored in the uip_conn structure.

Defines

-#define UIP_UDP_APPCALL   resolv_appcall

Functions

-void resolv_appcall (void)
void resolv_found (char *name, u16_t *ipaddr)
 Callback function which is called when a hostname is found.
void resolv_conf (u16_t *dnsserver)
 Configure which DNS server to use for queries.
u16_t * resolv_getserver (void)
 Obtain the currently configured DNS server.
-void resolv_init (void)
 Initalize the resolver.
u16_t * resolv_lookup (char *name)
 Look up a hostname in the array of known hostnames.
void resolv_query (char *name)
 Queues a name so that a question for the name will be sent out.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00104.html b/components/net/uip/doc/html/a00104.html deleted file mode 100644 index b769a45c73..0000000000 --- a/components/net/uip/doc/html/a00104.html +++ /dev/null @@ -1,78 +0,0 @@ - - -uIP 1.0: apps/smtp/smtp.c File Reference - - - - - - -

apps/smtp/smtp.c File Reference


Detailed Description

-SMTP example implementation. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file smtp.c. -

-#include "smtp.h"
-#include "smtp-strings.h"
-#include "psock.h"
-#include "uip.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define ISO_nl   0x0a
-#define ISO_cr   0x0d
-#define ISO_period   0x2e
-#define ISO_2   0x32
-#define ISO_3   0x33
-#define ISO_4   0x34
-#define ISO_5   0x35

Functions

-void smtp_appcall (void)
void smtp_configure (char *lhostname, void *server)
 Specificy an SMTP server and hostname.
unsigned char smtp_send (char *to, char *cc, char *from, char *subject, char *msg, u16_t msglen)
 Send an e-mail.
-void smtp_init (void)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00105.html b/components/net/uip/doc/html/a00105.html deleted file mode 100644 index 4a8d15b8dc..0000000000 --- a/components/net/uip/doc/html/a00105.html +++ /dev/null @@ -1,82 +0,0 @@ - - -uIP 1.0: apps/smtp/smtp.h File Reference - - - - - - -

apps/smtp/smtp.h File Reference


Detailed Description

-SMTP header file. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file smtp.h. -

-#include "uipopt.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  smtp_state

Appication specific configurations

An uIP application is implemented using a single application function that is called by uIP whenever a TCP/IP event occurs. The name of this function must be registered with uIP at compile time using the UIP_APPCALL definition.

-uIP applications can store the application state within the uip_conn structure by specifying the type of the application structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.

-The file containing the definitions must be included in the uipopt.h file.

-The following example illustrates how this can look.

void httpd_appcall(void);
-#define UIP_APPCALL     httpd_appcall
-
-struct httpd_state {
-  u8_t state;
-  u16_t count;
-  char *dataptr;
-  char *script;
-};
-typedef struct httpd_state uip_tcp_appstate_t
-


-#define UIP_APPCALL   smtp_appcall
 The name of the application function that uIP should call in response to TCP/IP events.
typedef smtp_state uip_tcp_appstate_t
 The type of the application state that is to be stored in the uip_conn structure.

Defines

-#define SMTP_ERR_OK   0
 Error number that signifies a non-error condition.
-#define SMTP_SEND(to, cc, from, subject, msg)   smtp_send(to, cc, from, subject, msg, strlen(msg))

Functions

void smtp_done (unsigned char error)
 Callback function that is called when an e-mail transmission is done.
-void smtp_init (void)
-void smtp_appcall (void)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00107.html b/components/net/uip/doc/html/a00107.html deleted file mode 100644 index 74d281601e..0000000000 --- a/components/net/uip/doc/html/a00107.html +++ /dev/null @@ -1,268 +0,0 @@ - - -uIP 1.0: apps/telnetd/shell.h File Reference - - - - - - -

apps/telnetd/shell.h File Reference


Detailed Description

-Interface for the Contiki shell. -

-

Author:
Adam Dunkels <adam@dunkels.com>
-Some of the functions declared in this file must be implemented as a shell back-end in the architecture specific files of a Contiki port. -

-Definition in file shell.h. -

- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - -

Functions

void shell_init (void)
 Initialize the shell.
void shell_start (void)
 Start the shell back-end.
void shell_input (char *command)
 Process a shell command.
-void shell_quit (char *)
 Quit the shell.
void shell_output (char *str1, char *str2)
 Print a string to the shell window.
void shell_prompt (char *prompt)
 Print a prompt to the shell window.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void shell_init ( void   ) 
-
- - - - - -
-   - - -

-Initialize the shell. -

-Called when the shell front-end process starts. This function may be used to start listening for signals.

Examples:
-telnetd.c.
-

-Definition at line 105 of file shell.c. -

-References shell_init(). -

-Referenced by shell_init().

-

- - - - -
- - - - - - - - - -
void shell_input ( char *  command  ) 
-
- - - - - -
-   - - -

-Process a shell command. -

-This function will be called by the shell GUI / telnet server whan a command has been entered that should be processed by the shell back-end.

-

Parameters:
- - -
command The command to be processed.
-
-
Examples:
-telnetd.c.
-

-Definition at line 118 of file shell.c. -

-References shell_input(). -

-Referenced by shell_input().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void shell_output ( char *  str1,
char *  str2
) 
-
- - - - - -
-   - - -

-Print a string to the shell window. -

-This function is implemented by the shell GUI / telnet server and can be called by the shell back-end to output a string in the shell window. The string is automatically appended with a linebreak.

-

Parameters:
- - - -
str1 The first half of the string to be output.
str2 The second half of the string to be output.
-
-
Examples:
-telnetd.c.
-

-Definition at line 113 of file telnetd.c. -

-References ISO_cr, ISO_nl, and NULL.

-

- - - - -
- - - - - - - - - -
void shell_prompt ( char *  prompt  ) 
-
- - - - - -
-   - - -

-Print a prompt to the shell window. -

-This function can be used by the shell back-end to print out a prompt to the shell window.

-

Parameters:
- - -
prompt The prompt to be printed.
-
-
Examples:
-telnetd.c.
-

-Definition at line 101 of file telnetd.c. -

-References NULL.

-

- - - - -
- - - - - - - - - -
void shell_start ( void   ) 
-
- - - - - -
-   - - -

-Start the shell back-end. -

-Called by the front-end when a new shell is started.

Examples:
-telnetd.c.
-

-Definition at line 110 of file shell.c. -

-References shell_start(). -

-Referenced by shell_start().

-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00110.html b/components/net/uip/doc/html/a00110.html deleted file mode 100644 index 509e8130f2..0000000000 --- a/components/net/uip/doc/html/a00110.html +++ /dev/null @@ -1,107 +0,0 @@ - - -uIP 1.0: apps/webclient/webclient.c File Reference - - - - - - -

apps/webclient/webclient.c File Reference


Detailed Description

-Implementation of the HTTP client. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file webclient.c. -

-#include "uip.h"
-#include "uiplib.h"
-#include "webclient.h"
-#include "resolv.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define WEBCLIENT_TIMEOUT   100
-#define WEBCLIENT_STATE_STATUSLINE   0
-#define WEBCLIENT_STATE_HEADERS   1
-#define WEBCLIENT_STATE_DATA   2
-#define WEBCLIENT_STATE_CLOSE   3
-#define HTTPFLAG_NONE   0
-#define HTTPFLAG_OK   1
-#define HTTPFLAG_MOVED   2
-#define HTTPFLAG_ERROR   3
-#define ISO_nl   0x0a
-#define ISO_cr   0x0d
-#define ISO_space   0x20

Functions

char * webclient_mimetype (void)
 Obtain the MIME type of the current HTTP data stream.
char * webclient_filename (void)
 Obtain the filename of the current HTTP data stream.
char * webclient_hostname (void)
 Obtain the hostname of the current HTTP data stream.
unsigned short webclient_port (void)
 Obtain the port number of the current HTTP data stream.
-void webclient_init (void)
 Initialize the webclient module.
-void webclient_close (void)
 Close the currently open HTTP connection.
unsigned char webclient_get (char *host, u16_t port, char *file)
 Open an HTTP connection to a web server and ask for a file using the GET method.
-void webclient_appcall (void)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00111.html b/components/net/uip/doc/html/a00111.html deleted file mode 100644 index 454dbfab0d..0000000000 --- a/components/net/uip/doc/html/a00111.html +++ /dev/null @@ -1,96 +0,0 @@ - - -uIP 1.0: apps/webclient/webclient.h File Reference - - - - - - -

apps/webclient/webclient.h File Reference


Detailed Description

-Header file for the HTTP client. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file webclient.h. -

-#include "webclient-strings.h"
-#include "uipopt.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  webclient_state

Defines

-#define WEBCLIENT_CONF_MAX_URLLEN   100
-#define UIP_APPCALL   webclient_appcall

Typedefs

-typedef webclient_state uip_tcp_appstate_t

Functions

void webclient_datahandler (char *data, u16_t len)
 Callback function that is called from the webclient code when HTTP data has been received.
void webclient_connected (void)
 Callback function that is called from the webclient code when the HTTP connection has been connected to the web server.
void webclient_timedout (void)
 Callback function that is called from the webclient code if the HTTP connection to the web server has timed out.
void webclient_aborted (void)
 Callback function that is called from the webclient code if the HTTP connection to the web server has been aborted by the web server.
void webclient_closed (void)
 Callback function that is called from the webclient code when the HTTP connection to the web server has been closed.
-void webclient_init (void)
 Initialize the webclient module.
unsigned char webclient_get (char *host, u16_t port, char *file)
 Open an HTTP connection to a web server and ask for a file using the GET method.
-void webclient_close (void)
 Close the currently open HTTP connection.
-void webclient_appcall (void)
char * webclient_mimetype (void)
 Obtain the MIME type of the current HTTP data stream.
char * webclient_filename (void)
 Obtain the filename of the current HTTP data stream.
char * webclient_hostname (void)
 Obtain the hostname of the current HTTP data stream.
unsigned short webclient_port (void)
 Obtain the port number of the current HTTP data stream.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00112.html b/components/net/uip/doc/html/a00112.html deleted file mode 100644 index 213268557c..0000000000 --- a/components/net/uip/doc/html/a00112.html +++ /dev/null @@ -1,49 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd-cgi.c File Reference - - - - - - -

apps/webserver/httpd-cgi.c File Reference


Detailed Description

-Web server script interface. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file httpd-cgi.c. -

-#include "uip.h"
-#include "psock.h"
-#include "httpd.h"
-#include "httpd-cgi.h"
-#include "httpd-fs.h"
-#include <stdio.h>
-#include <string.h>
- -

-Go to the source code of this file. - - - - -

Functions

-httpd_cgifunction httpd_cgi (char *name)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00113.html b/components/net/uip/doc/html/a00113.html deleted file mode 100644 index 62dbfa62fa..0000000000 --- a/components/net/uip/doc/html/a00113.html +++ /dev/null @@ -1,51 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd-cgi.h File Reference - - - - - - -

apps/webserver/httpd-cgi.h File Reference


Detailed Description

-Web server script interface header file. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file httpd-cgi.h. -

-#include "psock.h"
-#include "httpd.h"
- -

-Go to the source code of this file. - - - - - - - - - - - -

Data Structures

struct  httpd_cgi_call

Defines

#define HTTPD_CGI_CALL(name, str, function)
 HTTPD CGI function declaration.

Functions

-httpd_cgifunction httpd_cgi (char *name)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00114.html b/components/net/uip/doc/html/a00114.html deleted file mode 100644 index 62d611fec1..0000000000 --- a/components/net/uip/doc/html/a00114.html +++ /dev/null @@ -1,79 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd.c File Reference - - - - - - -

apps/webserver/httpd.c File Reference


Detailed Description

-Web server. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file httpd.c. -

-#include "uip.h"
-#include "httpd.h"
-#include "httpd-fs.h"
-#include "httpd-cgi.h"
-#include "http-strings.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define STATE_WAITING   0
-#define STATE_OUTPUT   1
-#define ISO_nl   0x0a
-#define ISO_space   0x20
-#define ISO_bang   0x21
-#define ISO_percent   0x25
-#define ISO_period   0x2e
-#define ISO_slash   0x2f
-#define ISO_colon   0x3a

Functions

-void httpd_appcall (void)
void httpd_init (void)
 Initialize the web server.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00120.html b/components/net/uip/doc/html/a00120.html deleted file mode 100644 index 3043a5d44c..0000000000 --- a/components/net/uip/doc/html/a00120.html +++ /dev/null @@ -1,50 +0,0 @@ - - -uIP 1.0: lib/memb.c File Reference - - - - - - -

lib/memb.c File Reference


Detailed Description

-Memory block allocation routines. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file memb.c. -

-#include <string.h>
-#include "memb.h"
- -

-Go to the source code of this file. - - - - - - - - - - - -

Functions

void memb_init (struct memb_blocks *m)
 Initialize a memory block that was declared with MEMB().
void * memb_alloc (struct memb_blocks *m)
 Allocate a memory block from a block of memory declared with MEMB().
char memb_free (struct memb_blocks *m, void *ptr)
 Deallocate a memory block from a memory block previously declared with MEMB().
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00121.html b/components/net/uip/doc/html/a00121.html deleted file mode 100644 index fd04d55929..0000000000 --- a/components/net/uip/doc/html/a00121.html +++ /dev/null @@ -1,61 +0,0 @@ - - -uIP 1.0: lib/memb.h File Reference - - - - - - -

lib/memb.h File Reference


Detailed Description

-Memory block allocation routines. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file memb.h. -

- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  memb_blocks

Defines

-#define MEMB_CONCAT2(s1, s2)   s1##s2
-#define MEMB_CONCAT(s1, s2)   MEMB_CONCAT2(s1, s2)
#define MEMB(name, structure, num)
 Declare a memory block.

Functions

void memb_init (struct memb_blocks *m)
 Initialize a memory block that was declared with MEMB().
void * memb_alloc (struct memb_blocks *m)
 Allocate a memory block from a block of memory declared with MEMB().
char memb_free (struct memb_blocks *m, void *ptr)
 Deallocate a memory block from a memory block previously declared with MEMB().
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00123.html b/components/net/uip/doc/html/a00123.html deleted file mode 100644 index 6cbb1a8baa..0000000000 --- a/components/net/uip/doc/html/a00123.html +++ /dev/null @@ -1,57 +0,0 @@ - - -uIP 1.0: uip/lc-addrlabels.h File Reference - - - - - - -

uip/lc-addrlabels.h File Reference


Detailed Description

-Implementation of local continuations based on the "Labels as values" feature of gcc. -

-

Author:
Adam Dunkels <adam@sics.se>
-This implementation of local continuations is based on a special feature of the GCC C compiler called "labels as values". This feature allows assigning pointers with the address of the code corresponding to a particular C label.

-For more information, see the GCC documentation: http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

-Thanks to dividuum for finding the nice local scope label implementation. -

-Definition in file lc-addrlabels.h. -

- -

-Go to the source code of this file. - - - - - - - - - - - - - -

Defines

-#define LC_INIT(s)   s = NULL
-#define LC_RESUME(s)
-#define LC_SET(s)   do { ({ __label__ resume; resume: (s) = &&resume; }); }while(0)
-#define LC_END(s)

Typedefs

-typedef void * lc_t
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00124.html b/components/net/uip/doc/html/a00124.html deleted file mode 100644 index a338d450bd..0000000000 --- a/components/net/uip/doc/html/a00124.html +++ /dev/null @@ -1,59 +0,0 @@ - - -uIP 1.0: uip/lc-switch.h File Reference - - - - - - -

uip/lc-switch.h File Reference


Detailed Description

-Implementation of local continuations based on switch() statment. -

-

Author:
Adam Dunkels <adam@sics.se>
-This implementation of local continuations uses the C switch() statement to resume execution of a function somewhere inside the function's body. The implementation is based on the fact that switch() statements are able to jump directly into the bodies of control structures such as if() or while() statmenets.

-This implementation borrows heavily from Simon Tatham's coroutines implementation in C: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html -

-Definition in file lc-switch.h. -

- -

-Go to the source code of this file. - - - - - - - - - - - - - - - -

Defines

-#define __LC_SWTICH_H__
-#define LC_INIT(s)   s = 0;
-#define LC_RESUME(s)   switch(s) { case 0:
-#define LC_SET(s)   s = __LINE__; case __LINE__:
-#define LC_END(s)   }

Typedefs

-typedef unsigned short lc_t
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00125.html b/components/net/uip/doc/html/a00125.html deleted file mode 100644 index ddcb20b9b0..0000000000 --- a/components/net/uip/doc/html/a00125.html +++ /dev/null @@ -1,39 +0,0 @@ - - -uIP 1.0: uip/lc.h File Reference - - - - - - -

uip/lc.h File Reference


Detailed Description

-Local continuations. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file lc.h. -

-#include "lc-switch.h"
- -

-Go to the source code of this file. - -
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00127.html b/components/net/uip/doc/html/a00127.html deleted file mode 100644 index c4cf552797..0000000000 --- a/components/net/uip/doc/html/a00127.html +++ /dev/null @@ -1,99 +0,0 @@ - - -uIP 1.0: uip/psock.h File Reference - - - - - - -

uip/psock.h File Reference


Detailed Description

-Protosocket library header file. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file psock.h. -

-#include "uipopt.h"
-#include "pt.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  psock_buf
struct  psock
 The representation of a protosocket. More...

Defines

#define PSOCK_INIT(psock, buffer, buffersize)
 Initialize a protosocket.
#define PSOCK_BEGIN(psock)
 Start the protosocket protothread in a function.
#define PSOCK_SEND(psock, data, datalen)
 Send data.
#define PSOCK_SEND_STR(psock, str)
 Send a null-terminated string.
#define PSOCK_GENERATOR_SEND(psock, generator, arg)
 Generate data with a function and send it.
#define PSOCK_CLOSE(psock)
 Close a protosocket.
#define PSOCK_READBUF(psock)
 Read data until the buffer is full.
#define PSOCK_READTO(psock, c)
 Read data up to a specified character.
#define PSOCK_DATALEN(psock)
 The length of the data that was previously read.
#define PSOCK_EXIT(psock)
 Exit the protosocket's protothread.
#define PSOCK_CLOSE_EXIT(psock)
 Close a protosocket and exit the protosocket's protothread.
#define PSOCK_END(psock)
 Declare the end of a protosocket's protothread.
#define PSOCK_NEWDATA(psock)
 Check if new data has arrived on a protosocket.
#define PSOCK_WAIT_UNTIL(psock, condition)
 Wait until a condition is true.
-#define PSOCK_WAIT_THREAD(psock, condition)   PT_WAIT_THREAD(&((psock)->pt), (condition))

Functions

-u16_t psock_datalen (struct psock *psock)
-char psock_newdata (struct psock *s)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00128.html b/components/net/uip/doc/html/a00128.html deleted file mode 100644 index 087b668489..0000000000 --- a/components/net/uip/doc/html/a00128.html +++ /dev/null @@ -1,101 +0,0 @@ - - -uIP 1.0: uip/pt.h File Reference - - - - - - -

uip/pt.h File Reference


Detailed Description

-Protothreads implementation. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file pt.h. -

-#include "lc.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  pt

Initialization

#define PT_INIT(pt)
 Initialize a protothread.

Declaration and definition

#define PT_THREAD(name_args)
 Declaration of a protothread.
#define PT_BEGIN(pt)
 Declare the start of a protothread inside the C function implementing the protothread.
#define PT_END(pt)
 Declare the end of a protothread.

Blocked wait

#define PT_WAIT_UNTIL(pt, condition)
 Block and wait until condition is true.
#define PT_WAIT_WHILE(pt, cond)
 Block and wait while condition is true.

Hierarchical protothreads

#define PT_WAIT_THREAD(pt, thread)
 Block and wait until a child protothread completes.
#define PT_SPAWN(pt, child, thread)
 Spawn a child protothread and wait until it exits.

Exiting and restarting

#define PT_RESTART(pt)
 Restart the protothread.
#define PT_EXIT(pt)
 Exit the protothread.

Calling a protothread

#define PT_SCHEDULE(f)
 Schedule a protothread.

Yielding from a protothread

#define PT_YIELD(pt)
 Yield from the current protothread.
#define PT_YIELD_UNTIL(pt, cond)
 Yield from the protothread until a condition occurs.

Defines

-#define PT_WAITING   0
-#define PT_EXITED   1
-#define PT_ENDED   2
-#define PT_YIELDED   3
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00129.html b/components/net/uip/doc/html/a00129.html deleted file mode 100644 index 2d89eba3bd..0000000000 --- a/components/net/uip/doc/html/a00129.html +++ /dev/null @@ -1,53 +0,0 @@ - - -uIP 1.0: uip/timer.c File Reference - - - - - - -

uip/timer.c File Reference


Detailed Description

-Timer library implementation. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file timer.c. -

-#include "clock.h"
-#include "timer.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - -

Functions

void timer_set (struct timer *t, clock_time_t interval)
 Set a timer.
void timer_reset (struct timer *t)
 Reset the timer with the same interval.
void timer_restart (struct timer *t)
 Restart the timer from the current point in time.
int timer_expired (struct timer *t)
 Check if a timer has expired.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00130.html b/components/net/uip/doc/html/a00130.html deleted file mode 100644 index 95da033871..0000000000 --- a/components/net/uip/doc/html/a00130.html +++ /dev/null @@ -1,56 +0,0 @@ - - -uIP 1.0: uip/timer.h File Reference - - - - - - -

uip/timer.h File Reference


Detailed Description

-Timer library header file. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file timer.h. -

-#include "clock.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - -

Data Structures

struct  timer
 A timer. More...

Functions

void timer_set (struct timer *t, clock_time_t interval)
 Set a timer.
void timer_reset (struct timer *t)
 Reset the timer with the same interval.
void timer_restart (struct timer *t)
 Restart the timer from the current point in time.
int timer_expired (struct timer *t)
 Check if a timer has expired.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00131.html b/components/net/uip/doc/html/a00131.html deleted file mode 100644 index 8370948415..0000000000 --- a/components/net/uip/doc/html/a00131.html +++ /dev/null @@ -1,63 +0,0 @@ - - -uIP 1.0: uip/uip-neighbor.c File Reference - - - - - - -

uip/uip-neighbor.c File Reference


Detailed Description

-Database of link-local neighbors, used by IPv6 code and to be used by a future ARP code rewrite. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file uip-neighbor.c. -

-#include "uip-neighbor.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - -

Defines

-#define MAX_TIME   128
-#define ENTRIES   8

Functions

-void uip_neighbor_init (void)
-void uip_neighbor_periodic (void)
-void uip_neighbor_add (uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr)
-void uip_neighbor_update (uip_ipaddr_t ipaddr)
-uip_neighbor_addr * uip_neighbor_lookup (uip_ipaddr_t ipaddr)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00132.html b/components/net/uip/doc/html/a00132.html deleted file mode 100644 index dc5b6496f9..0000000000 --- a/components/net/uip/doc/html/a00132.html +++ /dev/null @@ -1,58 +0,0 @@ - - -uIP 1.0: uip/uip-neighbor.h File Reference - - - - - - -

uip/uip-neighbor.h File Reference


Detailed Description

-Header file for database of link-local neighbors, used by IPv6 code and to be used by future ARP code. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file uip-neighbor.h. -

-#include "uip.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - -

Data Structures

struct  uip_neighbor_addr

Functions

-void uip_neighbor_init (void)
-void uip_neighbor_add (uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr)
-void uip_neighbor_update (uip_ipaddr_t ipaddr)
-uip_neighbor_addr * uip_neighbor_lookup (uip_ipaddr_t ipaddr)
-void uip_neighbor_periodic (void)
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00134.html b/components/net/uip/doc/html/a00134.html deleted file mode 100644 index 179ad8ff99..0000000000 --- a/components/net/uip/doc/html/a00134.html +++ /dev/null @@ -1,42 +0,0 @@ - - -uIP 1.0: uip/uip-split.h File Reference - - - - - - -

uip/uip-split.h File Reference


Detailed Description

-Module for splitting outbound TCP segments in two to avoid the delayed ACK throughput degradation. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file uip-split.h. -

- -

-Go to the source code of this file. - - - - - -

Functions

void uip_split_output (void)
 Handle outgoing packets.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00135.html b/components/net/uip/doc/html/a00135.html deleted file mode 100644 index 8cbccdcc94..0000000000 --- a/components/net/uip/doc/html/a00135.html +++ /dev/null @@ -1,215 +0,0 @@ - - -uIP 1.0: uip/uip.c File Reference - - - - - - -

uip/uip.c File Reference


Detailed Description

-The uIP TCP/IP stack code. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file uip.c. -

-#include "uip.h"
-#include "uipopt.h"
-#include "uip_arch.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define DEBUG_PRINTF()
-#define TCP_FIN   0x01
-#define TCP_SYN   0x02
-#define TCP_RST   0x04
-#define TCP_PSH   0x08
-#define TCP_ACK   0x10
-#define TCP_URG   0x20
-#define TCP_CTL   0x3f
-#define TCP_OPT_END   0
-#define TCP_OPT_NOOP   1
-#define TCP_OPT_MSS   2
-#define TCP_OPT_MSS_LEN   4
-#define ICMP_ECHO_REPLY   0
-#define ICMP_ECHO   8
-#define ICMP6_ECHO_REPLY   129
-#define ICMP6_ECHO   128
-#define ICMP6_NEIGHBOR_SOLICITATION   135
-#define ICMP6_NEIGHBOR_ADVERTISEMENT   136
-#define ICMP6_FLAG_S   (1 << 6)
-#define ICMP6_OPTION_SOURCE_LINK_ADDRESS   1
-#define ICMP6_OPTION_TARGET_LINK_ADDRESS   2
-#define BUF   ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
-#define FBUF   ((struct uip_tcpip_hdr *)&uip_reassbuf[0])
-#define ICMPBUF   ((struct uip_icmpip_hdr *)&uip_buf[UIP_LLH_LEN])
-#define UDPBUF   ((struct uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])
-#define UIP_STAT(s)
-#define UIP_LOG(m)

Functions

void uip_setipid (u16_t id)
 uIP initialization function.
void uip_add32 (u8_t *op32, u16_t op16)
 Carry out a 32-bit addition.
u16_t uip_chksum (u16_t *buf, u16_t len)
 Calculate the Internet checksum over a buffer.
u16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
u16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
void uip_init (void)
 uIP initialization function.
uip_conn * uip_connect (uip_ipaddr_t *ripaddr, u16_t rport)
 Connect to a remote host using TCP.
uip_udp_conn * uip_udp_new (uip_ipaddr_t *ripaddr, u16_t rport)
 Set up a new UDP connection.
void uip_unlisten (u16_t port)
 Stop listening to the specified port.
void uip_listen (u16_t port)
 Start listening to the specified port.
-void uip_process (u8_t flag)
u16_t htons (u16_t val)
 Convert 16-bit quantity from host byte order to network byte order.
void uip_send (const void *data, int len)
 Send data on the current connection.

Variables

-uip_ipaddr_t uip_hostaddr
-uip_ipaddr_t uip_draddr
-uip_ipaddr_t uip_netmask
-uip_eth_addr uip_ethaddr = {{0,0,0,0,0,0}}
u8_t uip_buf [UIP_BUFSIZE+2]
 The uIP packet buffer.
void * uip_appdata
 Pointer to the application data in the packet buffer.
-void * uip_sappdata
u16_t uip_len
 The length of the packet in the uip_buf buffer.
-u16_t uip_slen
-u8_t uip_flags
uip_conn * uip_conn
 Pointer to the current TCP connection.
-uip_conn uip_conns [UIP_CONNS]
-u16_t uip_listenports [UIP_LISTENPORTS]
-uip_udp_conn * uip_udp_conn
 The current UDP connection.
-uip_udp_conn uip_udp_conns [UIP_UDP_CONNS]
-u8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00136.html b/components/net/uip/doc/html/a00136.html deleted file mode 100644 index 341701bce6..0000000000 --- a/components/net/uip/doc/html/a00136.html +++ /dev/null @@ -1,400 +0,0 @@ - - -uIP 1.0: uip/uip.h File Reference - - - - - - -

uip/uip.h File Reference


Detailed Description

-Header file for the uIP TCP/IP stack. -

-

Author:
Adam Dunkels <adam@dunkels.com>
-The uIP TCP/IP stack header file contains definitions for a number of C macros that are used by uIP programs as well as internal uIP structures, TCP/IP header structures and function declarations. -

-Definition in file uip.h. -

-#include "uipopt.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  uip_conn
 Representation of a uIP TCP connection. More...
struct  uip_udp_conn
 Representation of a uIP UDP connection. More...
struct  uip_stats
 The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. More...
struct  uip_tcpip_hdr
struct  uip_icmpip_hdr
struct  uip_udpip_hdr
struct  uip_eth_addr
 Representation of a 48-bit Ethernet address. More...

Defines

#define uip_sethostaddr(addr)
 Set the IP address of this host.
#define uip_gethostaddr(addr)
 Get the IP address of this host.
#define uip_setdraddr(addr)
 Set the default router's IP address.
#define uip_setnetmask(addr)
 Set the netmask.
#define uip_getdraddr(addr)
 Get the default router's IP address.
#define uip_getnetmask(addr)
 Get the netmask.
#define uip_input()
 Process an incoming packet.
#define uip_periodic(conn)
 Periodic processing for a connection identified by its number.
-#define uip_conn_active(conn)   (uip_conns[conn].tcpstateflags != UIP_CLOSED)
#define uip_periodic_conn(conn)
 Perform periodic processing for a connection identified by a pointer to its structure.
#define uip_poll_conn(conn)
 Reuqest that a particular connection should be polled.
#define uip_udp_periodic(conn)
 Periodic processing for a UDP connection identified by its number.
#define uip_udp_periodic_conn(conn)
 Periodic processing for a UDP connection identified by a pointer to its structure.
-#define uip_outstanding(conn)   ((conn)->len)
#define uip_datalen()
 The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer.
#define uip_urgdatalen()
 The length of any out-of-band data (urgent data) that has arrived on the connection.
#define uip_close()
 Close the current connection.
#define uip_abort()
 Abort the current connection.
#define uip_stop()
 Tell the sending host to stop sending data.
-#define uip_stopped(conn)
 Find out if the current connection has been previously stopped with uip_stop().
#define uip_restart()
 Restart the current connection, if is has previously been stopped with uip_stop().
#define uip_udpconnection()
 Is the current connection a UDP connection?
#define uip_newdata()
 Is new incoming data available?
#define uip_acked()
 Has previously sent data been acknowledged?
#define uip_connected()
 Has the connection just been connected?
#define uip_closed()
 Has the connection been closed by the other end?
#define uip_aborted()
 Has the connection been aborted by the other end?
#define uip_timedout()
 Has the connection timed out?
#define uip_rexmit()
 Do we need to retransmit previously data?
#define uip_poll()
 Is the connection being polled by uIP?
-#define uip_initialmss()
 Get the initial maxium segment size (MSS) of the current connection.
#define uip_mss()
 Get the current maxium segment size that can be sent on the current connection.
#define uip_udp_remove(conn)
 Removed a UDP connection.
#define uip_udp_bind(conn, port)
 Bind a UDP connection to a local port.
#define uip_udp_send(len)
 Send a UDP datagram of length len on the current connection.
#define uip_ipaddr(addr, addr0, addr1, addr2, addr3)
 Construct an IP address from four bytes.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
 Construct an IPv6 address from eight 16-bit words.
#define uip_ipaddr_copy(dest, src)
 Copy an IP address to another IP address.
#define uip_ipaddr_cmp(addr1, addr2)
 Compare two IP addresses.
#define uip_ipaddr_maskcmp(addr1, addr2, mask)
 Compare two IP addresses with netmasks.
#define uip_ipaddr_mask(dest, src, mask)
 Mask out the network part of an IP address.
#define uip_ipaddr1(addr)
 Pick the first octet of an IP address.
#define uip_ipaddr2(addr)
 Pick the second octet of an IP address.
#define uip_ipaddr3(addr)
 Pick the third octet of an IP address.
#define uip_ipaddr4(addr)
 Pick the fourth octet of an IP address.
#define HTONS(n)
 Convert 16-bit quantity from host byte order to network byte order.
-#define ntohs   htons
-#define UIP_ACKDATA   1
-#define UIP_NEWDATA   2
-#define UIP_REXMIT   4
-#define UIP_POLL   8
-#define UIP_CLOSE   16
-#define UIP_ABORT   32
-#define UIP_CONNECTED   64
-#define UIP_TIMEDOUT   128
-#define UIP_DATA   1
-#define UIP_TIMER   2
-#define UIP_POLL_REQUEST   3
-#define UIP_UDP_SEND_CONN   4
-#define UIP_UDP_TIMER   5
-#define UIP_CLOSED   0
-#define UIP_SYN_RCVD   1
-#define UIP_SYN_SENT   2
-#define UIP_ESTABLISHED   3
-#define UIP_FIN_WAIT_1   4
-#define UIP_FIN_WAIT_2   5
-#define UIP_CLOSING   6
-#define UIP_TIME_WAIT   7
-#define UIP_LAST_ACK   8
-#define UIP_TS_MASK   15
-#define UIP_STOPPED   16
#define UIP_APPDATA_SIZE
 The buffer size available for user data in the uip_buf buffer.
-#define UIP_PROTO_ICMP   1
-#define UIP_PROTO_TCP   6
-#define UIP_PROTO_UDP   17
-#define UIP_PROTO_ICMP6   58
-#define UIP_IPH_LEN   20
-#define UIP_UDPH_LEN   8
-#define UIP_TCPH_LEN   20
-#define UIP_IPUDPH_LEN   (UIP_UDPH_LEN + UIP_IPH_LEN)
-#define UIP_IPTCPH_LEN   (UIP_TCPH_LEN + UIP_IPH_LEN)
-#define UIP_TCPIP_HLEN   UIP_IPTCPH_LEN

Typedefs

-typedef u16_t uip_ip4addr_t [2]
 Repressentation of an IP address.
-typedef u16_t uip_ip6addr_t [8]
-typedef uip_ip4addr_t uip_ipaddr_t

Functions

void uip_init (void)
 uIP initialization function.
void uip_setipid (u16_t id)
 uIP initialization function.
void uip_listen (u16_t port)
 Start listening to the specified port.
void uip_unlisten (u16_t port)
 Stop listening to the specified port.
uip_conn * uip_connect (uip_ipaddr_t *ripaddr, u16_t port)
 Connect to a remote host using TCP.
void uip_send (const void *data, int len)
 Send data on the current connection.
uip_udp_conn * uip_udp_new (uip_ipaddr_t *ripaddr, u16_t rport)
 Set up a new UDP connection.
u16_t htons (u16_t val)
 Convert 16-bit quantity from host byte order to network byte order.
-void uip_process (u8_t flag)
u16_t uip_chksum (u16_t *buf, u16_t len)
 Calculate the Internet checksum over a buffer.
u16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
u16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
u16_t uip_udpchksum (void)
 Calculate the UDP checksum of the packet in uip_buf and uip_appdata.

Variables

u8_t uip_buf [UIP_BUFSIZE+2]
 The uIP packet buffer.
void * uip_appdata
 Pointer to the application data in the packet buffer.
u16_t uip_len
 The length of the packet in the uip_buf buffer.
uip_conn * uip_conn
 Pointer to the current TCP connection.
-uip_conn uip_conns [UIP_CONNS]
-u8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
-uip_udp_conn * uip_udp_conn
 The current UDP connection.
-uip_udp_conn uip_udp_conns [UIP_UDP_CONNS]
uip_stats uip_stat
 The uIP TCP/IP statistics.
-u8_t uip_flags
-uip_ipaddr_t uip_hostaddr
-uip_ipaddr_t uip_netmask
-uip_ipaddr_t uip_draddr
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00137.html b/components/net/uip/doc/html/a00137.html deleted file mode 100644 index 1293889369..0000000000 --- a/components/net/uip/doc/html/a00137.html +++ /dev/null @@ -1,52 +0,0 @@ - - -uIP 1.0: uip/uip_arch.h File Reference - - - - - - -

uip/uip_arch.h File Reference


Detailed Description

-Declarations of architecture specific functions. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file uip_arch.h. -

-#include "uip.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - -

Functions

void uip_add32 (u8_t *op32, u16_t op16)
 Carry out a 32-bit addition.
u16_t uip_chksum (u16_t *buf, u16_t len)
 Calculate the Internet checksum over a buffer.
u16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
u16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00138.html b/components/net/uip/doc/html/a00138.html deleted file mode 100644 index b7845d551f..0000000000 --- a/components/net/uip/doc/html/a00138.html +++ /dev/null @@ -1,70 +0,0 @@ - - -uIP 1.0: uip/uip_arp.c File Reference - - - - - - -

uip/uip_arp.c File Reference


Detailed Description

-Implementation of the ARP Address Resolution Protocol. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file uip_arp.c. -

-#include "uip_arp.h"
-#include <string.h>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define ARP_REQUEST   1
-#define ARP_REPLY   2
-#define ARP_HWTYPE_ETH   1
-#define BUF   ((struct arp_hdr *)&uip_buf[0])
-#define IPBUF   ((struct ethip_hdr *)&uip_buf[0])

Functions

-void uip_arp_init (void)
 Initialize the ARP module.
void uip_arp_timer (void)
 Periodic ARP processing function.
void uip_arp_arpin (void)
 ARP processing for incoming ARP packets.
void uip_arp_out (void)
 Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00139.html b/components/net/uip/doc/html/a00139.html deleted file mode 100644 index 00cb3b75c0..0000000000 --- a/components/net/uip/doc/html/a00139.html +++ /dev/null @@ -1,77 +0,0 @@ - - -uIP 1.0: uip/uip_arp.h File Reference - - - - - - -

uip/uip_arp.h File Reference


Detailed Description

-Macros and definitions for the ARP module. -

-

Author:
Adam Dunkels <adam@dunkels.com>
- -

-Definition in file uip_arp.h. -

-#include "uip.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

struct  uip_eth_hdr
 The Ethernet header. More...

Defines

-#define UIP_ETHTYPE_ARP   0x0806
-#define UIP_ETHTYPE_IP   0x0800
-#define UIP_ETHTYPE_IP6   0x86dd
-#define uip_arp_ipin()
#define uip_setethaddr(eaddr)
 Specifiy the Ethernet MAC address.

Functions

-void uip_arp_init (void)
 Initialize the ARP module.
void uip_arp_arpin (void)
 ARP processing for incoming ARP packets.
void uip_arp_out (void)
 Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request.
void uip_arp_timer (void)
 Periodic ARP processing function.

Variables

-uip_eth_addr uip_ethaddr
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00140.html b/components/net/uip/doc/html/a00140.html deleted file mode 100644 index a413b00447..0000000000 --- a/components/net/uip/doc/html/a00140.html +++ /dev/null @@ -1,143 +0,0 @@ - - -uIP 1.0: uip/uipopt.h File Reference - - - - - - -

uip/uipopt.h File Reference


Detailed Description

-Configuration options for uIP. -

-

Author:
Adam Dunkels <adam@dunkels.com>
-This file is used for tweaking various configuration options for uIP. You should make a copy of this file into one of your project's directories instead of editing this example "uipopt.h" file that comes with the uIP distribution. -

-Definition in file uipopt.h. -

-#include "uip-conf.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Static configuration options

These configuration options can be used for setting the IP address settings statically, but only if UIP_FIXEDADDR is set to 1. The configuration options for a specific node includes IP address, netmask and default router as well as the Ethernet address. The netmask, default router and Ethernet address are appliciable only if uIP should be run over Ethernet.

-All of these should be changed to suit your project.

#define UIP_FIXEDADDR
 Determines if uIP should use a fixed IP address or not.
#define UIP_PINGADDRCONF
 Ping IP address asignment.
#define UIP_FIXEDETHADDR
 Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not.

IP configuration options

#define UIP_TTL   64
 The IP TTL (time to live) of IP packets sent by uIP.
#define UIP_REASSEMBLY
 Turn on support for IP packet reassembly.
-#define UIP_REASS_MAXAGE   40
 The maximum time an IP fragment should wait in the reassembly buffer before it is dropped.

UDP configuration options

-#define UIP_UDP
 Toggles wether UDP support should be compiled in or not.
#define UIP_UDP_CHECKSUMS
 Toggles if UDP checksums should be used or not.
-#define UIP_UDP_CONNS
 The maximum amount of concurrent UDP connections.

TCP configuration options

#define UIP_ACTIVE_OPEN
 Determines if support for opening connections from uIP should be compiled in.
#define UIP_CONNS
 The maximum number of simultaneously open TCP connections.
#define UIP_LISTENPORTS
 The maximum number of simultaneously listening TCP ports.
#define UIP_URGDATA
 Determines if support for TCP urgent data notification should be compiled in.
#define UIP_RTO   3
 The initial retransmission timeout counted in timer pulses.
#define UIP_MAXRTX   8
 The maximum number of times a segment should be retransmitted before the connection should be aborted.
#define UIP_MAXSYNRTX   5
 The maximum number of times a SYN segment should be retransmitted before a connection request should be deemed to have been unsuccessful.
#define UIP_TCP_MSS   (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
 The TCP maximum segment size.
#define UIP_RECEIVE_WINDOW
 The size of the advertised receiver's window.
#define UIP_TIME_WAIT_TIMEOUT   120
 How long a connection should stay in the TIME_WAIT state.

ARP configuration options

#define UIP_ARPTAB_SIZE
 The size of the ARP table.
#define UIP_ARP_MAXAGE   120
 The maxium age of ARP table entries measured in 10ths of seconds.

General configuration options

#define UIP_BUFSIZE
 The size of the uIP packet buffer.
#define UIP_STATISTICS
 Determines if statistics support should be compiled in.
#define UIP_LOGGING
 Determines if logging of certain events should be compiled in.
#define UIP_BROADCAST
 Broadcast support.
#define UIP_LLH_LEN
 The link level header length.
void uip_log (char *msg)
 Print out a uIP log message.

CPU architecture configuration

The CPU architecture configuration is where the endianess of the CPU on which uIP is to be run is specified. Most CPUs today are little endian, and the most notable exception are the Motorolas which are big endian. The BYTE_ORDER macro should be changed to reflect the CPU architecture on which uIP is to be run.

#define UIP_BYTE_ORDER
 The byte order of the CPU architecture on which uIP is to be run.

Defines

-#define UIP_LITTLE_ENDIAN   3412
-#define UIP_BIG_ENDIAN   1234
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00141.html b/components/net/uip/doc/html/a00141.html deleted file mode 100644 index 4b0e595872..0000000000 --- a/components/net/uip/doc/html/a00141.html +++ /dev/null @@ -1,83 +0,0 @@ - - -uIP 1.0: unix/uip-conf.h File Reference - - - - - - -

unix/uip-conf.h File Reference


Detailed Description

-An example uIP configuration file. -

-

Author:
Adam Dunkels <adam@sics.se>
- -

-Definition in file uip-conf.h. -

-#include <inttypes.h>
-#include "webserver.h"
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Project-specific configuration options

uIP has a number of configuration options that can be overridden for each project. These are kept in a project-specific uip-conf.h file and all configuration names have the prefix UIP_CONF.

-#define UIP_CONF_MAX_CONNECTIONS
 Maximum number of TCP connections.
-#define UIP_CONF_MAX_LISTENPORTS
 Maximum number of listening TCP ports.
-#define UIP_CONF_BUFFER_SIZE
 uIP buffer size.
-#define UIP_CONF_BYTE_ORDER
 CPU byte order.
-#define UIP_CONF_LOGGING
 Logging on or off.
-#define UIP_CONF_UDP
 UDP support on or off.
-#define UIP_CONF_UDP_CHECKSUMS
 UDP checksums on or off.
-#define UIP_CONF_STATISTICS
 uIP statistics on or off
typedef uint8_t u8_t
 8 bit datatype
typedef uint16_t u16_t
 16 bit datatype
typedef unsigned short uip_stats_t
 Statistics datatype.
-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00142.html b/components/net/uip/doc/html/a00142.html deleted file mode 100644 index c2db21d3c4..0000000000 --- a/components/net/uip/doc/html/a00142.html +++ /dev/null @@ -1,690 +0,0 @@ - - -uIP 1.0: Protothreads - - - - - -

Protothreads


Detailed Description

-Protothreads are a type of lightweight stackless threads designed for severly memory constrained systems such as deeply embedded systems or sensor network nodes. -

-Protothreads provides linear code execution for event-driven systems implemented in C. Protothreads can be used with or without an RTOS.

-Protothreads are a extremely lightweight, stackless type of threads that provides a blocking context on top of an event-driven system, without the overhead of per-thread stacks. The purpose of protothreads is to implement sequential flow of control without complex state machines or full multi-threading. Protothreads provides conditional blocking inside C functions.

-The advantage of protothreads over a purely event-driven approach is that protothreads provides a sequential code structure that allows for blocking functions. In purely event-driven systems, blocking must be implemented by manually breaking the function into two pieces - one for the piece of code before the blocking call and one for the code after the blocking call. This makes it hard to use control structures such as if() conditionals and while() loops.

-The advantage of protothreads over ordinary threads is that a protothread do not require a separate stack. In memory constrained systems, the overhead of allocating multiple stacks can consume large amounts of the available memory. In contrast, each protothread only requires between two and twelve bytes of state, depending on the architecture.

-

Note:
Because protothreads do not save the stack context across a blocking call, local variables are not preserved when the protothread blocks. This means that local variables should be used with utmost care - if in doubt, do not use local variables inside a protothread!
-Main features:

-

    -
  • No machine specific code - the protothreads library is pure C
-

-

    -
  • Does not use error-prone functions such as longjmp()
-

-

    -
  • Very small RAM overhead - only two bytes per protothread
-

-

    -
  • Can be used with or without an OS
-

-

    -
  • Provides blocking wait without full multi-threading or stack-switching
-

-Examples applications:

-

    -
  • Memory constrained systems
-

-

    -
  • Event-driven protocol stacks
-

-

    -
  • Deeply embedded systems
-

-

    -
  • Sensor network nodes
-

-The protothreads API consists of four basic operations: initialization: PT_INIT(), execution: PT_BEGIN(), conditional blocking: PT_WAIT_UNTIL() and exit: PT_END(). On top of these, two convenience functions are built: reversed condition blocking: PT_WAIT_WHILE() and protothread blocking: PT_WAIT_THREAD().

-

See also:
Protothreads API documentation
-The protothreads library is released under a BSD-style license that allows for both non-commercial and commercial usage. The only requirement is that credit is given.

-Authors

-The protothreads library was written by Adam Dunkels <adam@sics.se> with support from Oliver Schmidt <ol.sc@web.de>.

-Protothreads

-Protothreads are a extremely lightweight, stackless threads that provides a blocking context on top of an event-driven system, without the overhead of per-thread stacks. The purpose of protothreads is to implement sequential flow of control without using complex state machines or full multi-threading. Protothreads provides conditional blocking inside a C function.

-In memory constrained systems, such as deeply embedded systems, traditional multi-threading may have a too large memory overhead. In traditional multi-threading, each thread requires its own stack, that typically is over-provisioned. The stacks may use large parts of the available memory.

-The main advantage of protothreads over ordinary threads is that protothreads are very lightweight: a protothread does not require its own stack. Rather, all protothreads run on the same stack and context switching is done by stack rewinding. This is advantageous in memory constrained systems, where a stack for a thread might use a large part of the available memory. A protothread only requires only two bytes of memory per protothread. Moreover, protothreads are implemented in pure C and do not require any machine-specific assembler code.

-A protothread runs within a single C function and cannot span over other functions. A protothread may call normal C functions, but cannot block inside a called function. Blocking inside nested function calls is instead made by spawning a separate protothread for each potentially blocking function. The advantage of this approach is that blocking is explicit: the programmer knows exactly which functions that block that which functions the never blocks.

-Protothreads are similar to asymmetric co-routines. The main difference is that co-routines uses a separate stack for each co-routine, whereas protothreads are stackless. The most similar mechanism to protothreads are Python generators. These are also stackless constructs, but have a different purpose. Protothreads provides blocking contexts inside a C function, whereas Python generators provide multiple exit points from a generator function.

-Local variables

-
Note:
Because protothreads do not save the stack context across a blocking call, local variables are not preserved when the protothread blocks. This means that local variables should be used with utmost care - if in doubt, do not use local variables inside a protothread!
-

-Scheduling

-A protothread is driven by repeated calls to the function in which the protothread is running. Each time the function is called, the protothread will run until it blocks or exits. Thus the scheduling of protothreads is done by the application that uses protothreads.

-Implementation

-Protothreads are implemented using local continuations. A local continuation represents the current state of execution at a particular place in the program, but does not provide any call history or local variables. A local continuation can be set in a specific function to capture the state of the function. After a local continuation has been set can be resumed in order to restore the state of the function at the point where the local continuation was set.

-Local continuations can be implemented in a variety of ways:

-

    -
  1. by using machine specific assembler code,
  2. by using standard C constructs, or
  3. by using compiler extensions.
-

-The first way works by saving and restoring the processor state, except for stack pointers, and requires between 16 and 32 bytes of memory per protothread. The exact amount of memory required depends on the architecture.

-The standard C implementation requires only two bytes of state per protothread and utilizes the C switch() statement in a non-obvious way that is similar to Duff's device. This implementation does, however, impose a slight restriction to the code that uses protothreads in that the code cannot use switch() statements itself.

-Certain compilers has C extensions that can be used to implement protothreads. GCC supports label pointers that can be used for this purpose. With this implementation, protothreads require 4 bytes of RAM per protothread. -

- - - - - - - -

-

- - - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  pt.h
 Protothreads implementation.

Modules

 Local continuations
 Local continuations form the basis for implementing protothreads.

Data Structures

struct  pt

Initialization

#define PT_INIT(pt)
 Initialize a protothread.

Declaration and definition

#define PT_THREAD(name_args)
 Declaration of a protothread.
#define PT_BEGIN(pt)
 Declare the start of a protothread inside the C function implementing the protothread.
#define PT_END(pt)
 Declare the end of a protothread.

Blocked wait

#define PT_WAIT_UNTIL(pt, condition)
 Block and wait until condition is true.
#define PT_WAIT_WHILE(pt, cond)
 Block and wait while condition is true.

Hierarchical protothreads

#define PT_WAIT_THREAD(pt, thread)
 Block and wait until a child protothread completes.
#define PT_SPAWN(pt, child, thread)
 Spawn a child protothread and wait until it exits.

Exiting and restarting

#define PT_RESTART(pt)
 Restart the protothread.
#define PT_EXIT(pt)
 Exit the protothread.

Calling a protothread

#define PT_SCHEDULE(f)
 Schedule a protothread.

Yielding from a protothread

#define PT_YIELD(pt)
 Yield from the current protothread.
#define PT_YIELD_UNTIL(pt, cond)
 Yield from the protothread until a condition occurs.

Defines

-#define PT_WAITING   0
-#define PT_EXITED   1
-#define PT_ENDED   2
-#define PT_YIELDED   3
-


Define Documentation

-

- - - - -
- - - - - - - - - -
#define PT_BEGIN ( pt   ) 
-
- - - - - -
-   - - -

-Declare the start of a protothread inside the C function implementing the protothread. -

-This macro is used to declare the starting point of a protothread. It should be placed at the start of the function in which the protothread runs. All C statements above the PT_BEGIN() invokation will be executed each time the protothread is scheduled.

-

Parameters:
- - -
pt A pointer to the protothread control structure.
-
-
Examples:
-dhcpc.c.
-

-Definition at line 115 of file pt.h.

-

- - - - -
- - - - - - - - - -
#define PT_END ( pt   ) 
-
- - - - - -
-   - - -

-Declare the end of a protothread. -

-This macro is used for declaring that a protothread ends. It must always be used together with a matching PT_BEGIN() macro.

-

Parameters:
- - -
pt A pointer to the protothread control structure.
-
-
Examples:
-dhcpc.c.
-

-Definition at line 127 of file pt.h.

-

- - - - -
- - - - - - - - - -
#define PT_EXIT ( pt   ) 
-
- - - - - -
-   - - -

-Exit the protothread. -

-This macro causes the protothread to exit. If the protothread was spawned by another protothread, the parent protothread will become unblocked and can continue to run.

-

Parameters:
- - -
pt A pointer to the protothread control structure.
-
- -

-Definition at line 246 of file pt.h.

-

- - - - -
- - - - - - - - - -
#define PT_INIT ( pt   ) 
-
- - - - - -
-   - - -

-Initialize a protothread. -

-Initializes a protothread. Initialization must be done prior to starting to execute the protothread.

-

Parameters:
- - -
pt A pointer to the protothread control structure.
-
-
See also:
PT_SPAWN()
-
Examples:
-dhcpc.c.
-

-Definition at line 80 of file pt.h. -

-Referenced by httpd_appcall().

-

- - - - -
- - - - - - - - - -
#define PT_RESTART ( pt   ) 
-
- - - - - -
-   - - -

-Restart the protothread. -

-This macro will block and cause the running protothread to restart its execution at the place of the PT_BEGIN() call.

-

Parameters:
- - -
pt A pointer to the protothread control structure.
-
-
Examples:
-dhcpc.c.
-

-Definition at line 229 of file pt.h.

-

- - - - -
- - - - - - - - - -
#define PT_SCHEDULE ( f   ) 
-
- - - - - -
-   - - -

-Schedule a protothread. -

-This function shedules a protothread. The return value of the function is non-zero if the protothread is running or zero if the protothread has exited.

-

Parameters:
- - -
f The call to the C function implementing the protothread to be scheduled
-
- -

-Definition at line 271 of file pt.h.

-

- - - - -
- - - - - - - - - - - - - - - -
#define PT_SPAWN ( pt,
child,
thread   ) 
-
- - - - - -
-   - - -

-Spawn a child protothread and wait until it exits. -

-This macro spawns a child protothread and waits until it exits. The macro can only be used within a protothread.

-

Parameters:
- - - - -
pt A pointer to the protothread control structure.
child A pointer to the child protothread's control structure.
thread The child protothread with arguments
-
- -

-Definition at line 206 of file pt.h.

-

- - - - -
- - - - - - - - - -
#define PT_THREAD ( name_args   ) 
-
- - - - - -
-   - - -

-Declaration of a protothread. -

-This macro is used to declare a protothread. All protothreads must be declared with this macro.

-

Parameters:
- - -
name_args The name and arguments of the C function implementing the protothread.
-
-
Examples:
-dhcpc.c, and smtp.c.
-

-Definition at line 100 of file pt.h.

-

- - - - -
- - - - - - - - - - - - -
#define PT_WAIT_THREAD ( pt,
thread   ) 
-
- - - - - -
-   - - -

-Block and wait until a child protothread completes. -

-This macro schedules a child protothread. The current protothread will block until the child protothread completes.

-

Note:
The child protothread must be manually initialized with the PT_INIT() function before this function is used.
-
Parameters:
- - - -
pt A pointer to the protothread control structure.
thread The child protothread with arguments
-
-
See also:
PT_SPAWN()
- -

-Definition at line 192 of file pt.h.

-

- - - - -
- - - - - - - - - - - - -
#define PT_WAIT_UNTIL ( pt,
condition   ) 
-
- - - - - -
-   - - -

-Block and wait until condition is true. -

-This macro blocks the protothread until the specified condition is true.

-

Parameters:
- - - -
pt A pointer to the protothread control structure.
condition The condition.
-
-
Examples:
-dhcpc.c.
-

-Definition at line 148 of file pt.h.

-

- - - - -
- - - - - - - - - - - - -
#define PT_WAIT_WHILE ( pt,
cond   ) 
-
- - - - - -
-   - - -

-Block and wait while condition is true. -

-This function blocks and waits while condition is true. See PT_WAIT_UNTIL().

-

Parameters:
- - - -
pt A pointer to the protothread control structure.
cond The condition.
-
- -

-Definition at line 167 of file pt.h.

-

- - - - -
- - - - - - - - - -
#define PT_YIELD ( pt   ) 
-
- - - - - -
-   - - -

-Yield from the current protothread. -

-This function will yield the protothread, thereby allowing other processing to take place in the system.

-

Parameters:
- - -
pt A pointer to the protothread control structure.
-
-
Examples:
-dhcpc.c.
-

-Definition at line 290 of file pt.h.

-

- - - - -
- - - - - - - - - - - - -
#define PT_YIELD_UNTIL ( pt,
cond   ) 
-
- - - - - -
-   - - -

-Yield from the protothread until a condition occurs. -

-

Parameters:
- - - -
pt A pointer to the protothread control structure.
cond The condition.
-
-This function will yield the protothread, until the specified condition evaluates to true. -

-Definition at line 310 of file pt.h.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00143.html b/components/net/uip/doc/html/a00143.html deleted file mode 100644 index 28224e0732..0000000000 --- a/components/net/uip/doc/html/a00143.html +++ /dev/null @@ -1,54 +0,0 @@ - - -uIP 1.0: Applications - - - - - -

Applications


Detailed Description

-The uIP distribution contains a number of example applications that can be either used directory or studied when learning to develop applications for uIP. -

- -

- - - - - - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - -

-


Modules

 DNS resolver
 The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address.
 SMTP E-mail sender
 The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is the standard way of sending and transfering e-mail on the Internet.
 Hello, world
 A small example showing how to write applications with protosockets.
 Web client
 This example shows a HTTP client that is able to download web pages and files from web servers.
 Web server
 The uIP web server is a very simplistic implementation of an HTTP server.
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00144.html b/components/net/uip/doc/html/a00144.html deleted file mode 100644 index 5cca5bb290..0000000000 --- a/components/net/uip/doc/html/a00144.html +++ /dev/null @@ -1,328 +0,0 @@ - - -uIP 1.0: uIP configuration functions - - - - - -

uIP configuration functions
- -[The uIP TCP/IP stack] -


Detailed Description

-The uIP configuration functions are used for setting run-time parameters in uIP such as IP addresses. -

- -

- - - - - - - - - - - - - - - - - - - - - - - - -

Defines

#define uip_sethostaddr(addr)
 Set the IP address of this host.
#define uip_gethostaddr(addr)
 Get the IP address of this host.
#define uip_setdraddr(addr)
 Set the default router's IP address.
#define uip_setnetmask(addr)
 Set the netmask.
#define uip_getdraddr(addr)
 Get the default router's IP address.
#define uip_getnetmask(addr)
 Get the netmask.
#define uip_setethaddr(eaddr)
 Specifiy the Ethernet MAC address.
-


Define Documentation

-

- - - - -
- - - - - - - - - -
#define uip_getdraddr ( addr   ) 
-
- - - - - -
-   - - -

-Get the default router's IP address. -

-

Parameters:
- - -
addr A pointer to a uip_ipaddr_t variable that will be filled in with the IP address of the default router.
-
- -

-Definition at line 161 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_gethostaddr ( addr   ) 
-
- - - - - -
-   - - -

-Get the IP address of this host. -

-The IP address is represented as a 4-byte array where the first octet of the IP address is put in the first member of the 4-byte array.

-Example:

 uip_ipaddr_t hostaddr;
-
- uip_gethostaddr(&hostaddr);
-
Parameters:
- - -
addr A pointer to a uip_ipaddr_t variable that will be filled in with the currently configured IP address.
-
- -

-Definition at line 126 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_getnetmask ( addr   ) 
-
- - - - - -
-   - - -

-Get the netmask. -

-

Parameters:
- - -
addr A pointer to a uip_ipaddr_t variable that will be filled in with the value of the netmask.
-
- -

-Definition at line 171 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_setdraddr ( addr   ) 
-
- - - - - -
-   - - -

-Set the default router's IP address. -

-

Parameters:
- - -
addr A pointer to a uip_ipaddr_t variable containing the IP address of the default router.
-
-
See also:
uip_ipaddr()
- -

-Definition at line 138 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_setethaddr ( eaddr   ) 
-
- - - - - -
-   - - -

-Specifiy the Ethernet MAC address. -

-The ARP code needs to know the MAC address of the Ethernet card in order to be able to respond to ARP queries and to generate working Ethernet headers.

-

Note:
This macro only specifies the Ethernet MAC address to the ARP code. It cannot be used to change the MAC address of the Ethernet card.
-
Parameters:
- - -
eaddr A pointer to a struct uip_eth_addr containing the Ethernet MAC address of the Ethernet card.
-
- -

-Definition at line 134 of file uip_arp.h.

-

- - - - -
- - - - - - - - - -
#define uip_sethostaddr ( addr   ) 
-
- - - - - -
-   - - -

-Set the IP address of this host. -

-The IP address is represented as a 4-byte array where the first octet of the IP address is put in the first member of the 4-byte array.

-Example:

 uip_ipaddr_t addr;
-
- uip_ipaddr(&addr, 192,168,1,2);
- uip_sethostaddr(&addr);
-
Parameters:
- - -
addr A pointer to an IP address of type uip_ipaddr_t;
-
-
See also:
uip_ipaddr()
-
Examples:
-dhcpc.c, example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 106 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_setnetmask ( addr   ) 
-
- - - - - -
-   - - -

-Set the netmask. -

-

Parameters:
- - -
addr A pointer to a uip_ipaddr_t variable containing the IP address of the netmask.
-
-
See also:
uip_ipaddr()
- -

-Definition at line 150 of file uip.h.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00145.html b/components/net/uip/doc/html/a00145.html deleted file mode 100644 index d087f911b8..0000000000 --- a/components/net/uip/doc/html/a00145.html +++ /dev/null @@ -1,106 +0,0 @@ - - -uIP 1.0: uIP initialization functions - - - - - -

uIP initialization functions
- -[The uIP TCP/IP stack] -


Detailed Description

-The uIP initialization functions are used for booting uIP. -

- -

- - - - - - - - - -

Functions

void uip_init (void)
 uIP initialization function.
void uip_setipid (u16_t id)
 uIP initialization function.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void uip_init ( void   ) 
-
- - - - - -
-   - - -

-uIP initialization function. -

-This function should be called at boot up to initilize the uIP TCP/IP stack.

Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 379 of file uip.c. -

-References UIP_LISTENPORTS.

-

- - - - -
- - - - - - - - - -
void uip_setipid ( u16_t  id  ) 
-
- - - - - -
-   - - -

-uIP initialization function. -

-This function may be used at boot time to set the initial ip_id. -

-Definition at line 181 of file uip.c.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00146.html b/components/net/uip/doc/html/a00146.html deleted file mode 100644 index 33a3b5dd84..0000000000 --- a/components/net/uip/doc/html/a00146.html +++ /dev/null @@ -1,383 +0,0 @@ - - -uIP 1.0: uIP device driver functions - - - - - -

uIP device driver functions
- -[The uIP TCP/IP stack] -


Detailed Description

-These functions are used by a network device driver for interacting with uIP. -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

#define uip_input()
 Process an incoming packet.
#define uip_periodic(conn)
 Periodic processing for a connection identified by its number.
-#define uip_conn_active(conn)   (uip_conns[conn].tcpstateflags != UIP_CLOSED)
#define uip_periodic_conn(conn)
 Perform periodic processing for a connection identified by a pointer to its structure.
#define uip_poll_conn(conn)
 Reuqest that a particular connection should be polled.
#define uip_udp_periodic(conn)
 Periodic processing for a UDP connection identified by its number.
#define uip_udp_periodic_conn(conn)
 Periodic processing for a UDP connection identified by a pointer to its structure.

Variables

u8_t uip_buf [UIP_BUFSIZE+2]
 The uIP packet buffer.
-


Define Documentation

-

- - - - -
- - - - -  - - - - -
#define uip_input (   ) 
-
- - - - - -
-   - - -

-Process an incoming packet. -

-This function should be called when the device driver has received a packet from the network. The packet from the device driver must be present in the uip_buf buffer, and the length of the packet should be placed in the uip_len variable.

-When the function returns, there may be an outbound packet placed in the uip_buf packet buffer. If so, the uip_len variable is set to the length of the packet. If no packet is to be sent out, the uip_len variable is set to 0.

-The usual way of calling the function is presented by the source code below.

  uip_len = devicedriver_poll();
-  if(uip_len > 0) {
-    uip_input();
-    if(uip_len > 0) {
-      devicedriver_send();
-    }
-  }
-

-

Note:
If you are writing a uIP device driver that needs ARP (Address Resolution Protocol), e.g., when running uIP over Ethernet, you will need to call the uIP ARP code before calling this function:
  #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
-  uip_len = ethernet_devicedrver_poll();
-  if(uip_len > 0) {
-    if(BUF->type == HTONS(UIP_ETHTYPE_IP)) {
-      uip_arp_ipin();
-      uip_input();
-      if(uip_len > 0) {
-        uip_arp_out();
-        ethernet_devicedriver_send();
-      }
-    } else if(BUF->type == HTONS(UIP_ETHTYPE_ARP)) {
-      uip_arp_arpin();
-      if(uip_len > 0) {
-        ethernet_devicedriver_send();
-      }
-    }
-
-
Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 257 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_periodic ( conn   ) 
-
- - - - - -
-   - - -

-Periodic processing for a connection identified by its number. -

-This function does the necessary periodic processing (timers, polling) for a uIP TCP conneciton, and should be called when the periodic uIP timer goes off. It should be called for every connection, regardless of whether they are open of closed.

-When the function returns, it may have an outbound packet waiting for service in the uIP packet buffer, and if so the uip_len variable is set to a value larger than zero. The device driver should be called to send out the packet.

-The ususal way of calling the function is through a for() loop like this:

  for(i = 0; i < UIP_CONNS; ++i) {
-    uip_periodic(i);
-    if(uip_len > 0) {
-      devicedriver_send();
-    }
-  }
-

-

Note:
If you are writing a uIP device driver that needs ARP (Address Resolution Protocol), e.g., when running uIP over Ethernet, you will need to call the uip_arp_out() function before calling the device driver:
  for(i = 0; i < UIP_CONNS; ++i) {
-    uip_periodic(i);
-    if(uip_len > 0) {
-      uip_arp_out();
-      ethernet_devicedriver_send();
-    }
-  }
-
-
Parameters:
- - -
conn The number of the connection which is to be periodically polled.
-
-
Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 301 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_periodic_conn ( conn   ) 
-
- - - - - -
-   - - -

-Perform periodic processing for a connection identified by a pointer to its structure. -

-Same as uip_periodic() but takes a pointer to the actual uip_conn struct instead of an integer as its argument. This function can be used to force periodic processing of a specific connection.

-

Parameters:
- - -
conn A pointer to the uip_conn struct for the connection to be processed.
-
- -

-Definition at line 323 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_poll_conn ( conn   ) 
-
- - - - - -
-   - - -

-Reuqest that a particular connection should be polled. -

-Similar to uip_periodic_conn() but does not perform any timer processing. The application is polled for new data.

-

Parameters:
- - -
conn A pointer to the uip_conn struct for the connection to be processed.
-
- -

-Definition at line 337 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_udp_periodic ( conn   ) 
-
- - - - - -
-   - - -

-Periodic processing for a UDP connection identified by its number. -

-This function is essentially the same as uip_periodic(), but for UDP connections. It is called in a similar fashion as the uip_periodic() function:

  for(i = 0; i < UIP_UDP_CONNS; i++) {
-    uip_udp_periodic(i);
-    if(uip_len > 0) {
-      devicedriver_send();
-    }
-  }
-

-

Note:
As for the uip_periodic() function, special care has to be taken when using uIP together with ARP and Ethernet:
  for(i = 0; i < UIP_UDP_CONNS; i++) {
-    uip_udp_periodic(i);
-    if(uip_len > 0) {
-      uip_arp_out();
-      ethernet_devicedriver_send();
-    }
-  }
-
-
Parameters:
- - -
conn The number of the UDP connection to be processed.
-
-
Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 373 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_udp_periodic_conn ( conn   ) 
-
- - - - - -
-   - - -

-Periodic processing for a UDP connection identified by a pointer to its structure. -

-Same as uip_udp_periodic() but takes a pointer to the actual uip_conn struct instead of an integer as its argument. This function can be used to force periodic processing of a specific connection.

-

Parameters:
- - -
conn A pointer to the uip_udp_conn struct for the connection to be processed.
-
- -

-Definition at line 390 of file uip.h.

-


Variable Documentation

-

- - - - -
- - - - -
u8_t uip_buf[UIP_BUFSIZE+2]
-
- - - - - -
-   - - -

-The uIP packet buffer. -

-The uip_buf array is used to hold incoming and outgoing packets. The device driver should place incoming data into this buffer. When sending data, the device driver should read the link level headers and the TCP/IP headers from this buffer. The size of the link level headers is configured by the UIP_LLH_LEN define.

-

Note:
The application data need not be placed in this buffer, so the device driver must read it from the place pointed to by the uip_appdata pointer as illustrated by the following example:
 void
- devicedriver_send(void)
- {
-    hwsend(&uip_buf[0], UIP_LLH_LEN);
-    if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) {
-      hwsend(&uip_buf[UIP_LLH_LEN], uip_len - UIP_LLH_LEN);
-    } else {
-      hwsend(&uip_buf[UIP_LLH_LEN], UIP_TCPIP_HLEN);
-      hwsend(uip_appdata, uip_len - UIP_TCPIP_HLEN - UIP_LLH_LEN);
-    }
- }
-
- -

-Definition at line 139 of file uip.c. -

-Referenced by uip_process().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00147.html b/components/net/uip/doc/html/a00147.html deleted file mode 100644 index 8e7f247bb2..0000000000 --- a/components/net/uip/doc/html/a00147.html +++ /dev/null @@ -1,1046 +0,0 @@ - - -uIP 1.0: uIP application functions - - - - - -

uIP application functions
- -[The uIP TCP/IP stack] -


Detailed Description

-Functions used by an application running of top of uIP. -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

-#define uip_outstanding(conn)   ((conn)->len)
#define uip_datalen()
 The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer.
#define uip_urgdatalen()
 The length of any out-of-band data (urgent data) that has arrived on the connection.
#define uip_close()
 Close the current connection.
#define uip_abort()
 Abort the current connection.
#define uip_stop()
 Tell the sending host to stop sending data.
-#define uip_stopped(conn)
 Find out if the current connection has been previously stopped with uip_stop().
#define uip_restart()
 Restart the current connection, if is has previously been stopped with uip_stop().
#define uip_udpconnection()
 Is the current connection a UDP connection?
#define uip_newdata()
 Is new incoming data available?
#define uip_acked()
 Has previously sent data been acknowledged?
#define uip_connected()
 Has the connection just been connected?
#define uip_closed()
 Has the connection been closed by the other end?
#define uip_aborted()
 Has the connection been aborted by the other end?
#define uip_timedout()
 Has the connection timed out?
#define uip_rexmit()
 Do we need to retransmit previously data?
#define uip_poll()
 Is the connection being polled by uIP?
-#define uip_initialmss()
 Get the initial maxium segment size (MSS) of the current connection.
#define uip_mss()
 Get the current maxium segment size that can be sent on the current connection.
#define uip_udp_remove(conn)
 Removed a UDP connection.
#define uip_udp_bind(conn, port)
 Bind a UDP connection to a local port.
#define uip_udp_send(len)
 Send a UDP datagram of length len on the current connection.

Functions

void uip_listen (u16_t port)
 Start listening to the specified port.
void uip_unlisten (u16_t port)
 Stop listening to the specified port.
uip_conn * uip_connect (uip_ipaddr_t *ripaddr, u16_t port)
 Connect to a remote host using TCP.
void uip_send (const void *data, int len)
 Send data on the current connection.
uip_udp_conn * uip_udp_new (uip_ipaddr_t *ripaddr, u16_t rport)
 Set up a new UDP connection.
-


Define Documentation

-

- - - - -
- - - - -  - - - - -
#define uip_abort (   ) 
-
- - - - - -
-   - - -

-Abort the current connection. -

-This function will abort (reset) the current connection, and is usually used when an error has occured that prevents using the uip_close() function.

Examples:
-webclient.c.
-

-Definition at line 581 of file uip.h. -

-Referenced by httpd_appcall(), and webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_aborted (   ) 
-
- - - - - -
-   - - -

-Has the connection been aborted by the other end? -

-Non-zero if the current connection has been aborted (reset) by the remote host.

Examples:
-smtp.c, telnetd.c, and webclient.c.
-

-Definition at line 680 of file uip.h. -

-Referenced by httpd_appcall(), smtp_appcall(), and webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_acked (   ) 
-
- - - - - -
-   - - -

-Has previously sent data been acknowledged? -

-Will reduce to non-zero if the previously sent data has been acknowledged by the remote host. This means that the application can send new data.

Examples:
-telnetd.c, and webclient.c.
-

-Definition at line 648 of file uip.h. -

-Referenced by webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_close (   ) 
-
- - - - - -
-   - - -

-Close the current connection. -

-This function will close the current connection in a nice way.

Examples:
-telnetd.c.
-

-Definition at line 570 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_closed (   ) 
-
- - - - - -
-   - - -

-Has the connection been closed by the other end? -

-Is non-zero if the connection has been closed by the remote host. The application may then do the necessary clean-ups.

Examples:
-smtp.c, telnetd.c, and webclient.c.
-

-Definition at line 670 of file uip.h. -

-Referenced by httpd_appcall(), smtp_appcall(), and webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_connected (   ) 
-
- - - - - -
-   - - -

-Has the connection just been connected? -

-Reduces to non-zero if the current connection has been connected to a remote host. This will happen both if the connection has been actively opened (with uip_connect()) or passively opened (with uip_listen()).

Examples:
-hello-world.c, telnetd.c, and webclient.c.
-

-Definition at line 660 of file uip.h. -

-Referenced by hello_world_appcall(), httpd_appcall(), and webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_datalen (   ) 
-
- - - - - -
-   - - -

-The length of any incoming data that is currently avaliable (if avaliable) in the uip_appdata buffer. -

-The test function uip_data() must first be used to check if there is any data available at all.

Examples:
-dhcpc.c, telnetd.c, and webclient.c.
-

-Definition at line 550 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_mss (   ) 
-
- - - - - -
-   - - -

-Get the current maxium segment size that can be sent on the current connection. -

-The current maxiumum segment size that can be sent on the connection is computed from the receiver's window and the MSS of the connection (which also is available by calling uip_initialmss()).

Examples:
-telnetd.c, and webclient.c.
-

-Definition at line 737 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_newdata (   ) 
-
- - - - - -
-   - - -

-Is new incoming data available? -

-Will reduce to non-zero if there is new data for the application present at the uip_appdata pointer. The size of the data is avaliable through the uip_len variable.

Examples:
-dhcpc.c, resolv.c, telnetd.c, and webclient.c.
-

-Definition at line 637 of file uip.h. -

-Referenced by psock_newdata(), resolv_appcall(), and webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_poll (   ) 
-
- - - - - -
-   - - -

-Is the connection being polled by uIP? -

-Is non-zero if the reason the application is invoked is that the current connection has been idle for a while and should be polled.

-The polling event can be used for sending data without having to wait for the remote host to send data.

Examples:
-resolv.c, telnetd.c, and webclient.c.
-

-Definition at line 716 of file uip.h. -

-Referenced by httpd_appcall(), resolv_appcall(), and webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_restart (   ) 
-
- - - - - -
-   - - -

-Restart the current connection, if is has previously been stopped with uip_stop(). -

-This function will open the receiver's window again so that we start receiving data for the current connection. -

-Definition at line 610 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_rexmit (   ) 
-
- - - - - -
-   - - -

-Do we need to retransmit previously data? -

-Reduces to non-zero if the previously sent data has been lost in the network, and the application should retransmit it. The application should send the exact same data as it did the last time, using the uip_send() function.

Examples:
-telnetd.c, and webclient.c.
-

-Definition at line 702 of file uip.h. -

-Referenced by webclient_appcall().

-

- - - - -
- - - - -  - - - - -
#define uip_stop (   ) 
-
- - - - - -
-   - - -

-Tell the sending host to stop sending data. -

-This function will close our receiver's window so that we stop receiving data for the current connection. -

-Definition at line 591 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_timedout (   ) 
-
- - - - - -
-   - - -

-Has the connection timed out? -

-Non-zero if the current connection has been aborted due to too many retransmissions.

Examples:
-smtp.c, telnetd.c, and webclient.c.
-

-Definition at line 690 of file uip.h. -

-Referenced by httpd_appcall(), smtp_appcall(), and webclient_appcall().

-

- - - - -
- - - - - - - - - - - - -
#define uip_udp_bind ( conn,
port   ) 
-
- - - - - -
-   - - -

-Bind a UDP connection to a local port. -

-

Parameters:
- - - -
conn A pointer to the uip_udp_conn structure for the connection.
port The local port number, in network byte order.
-
-
Examples:
-dhcpc.c.
-

-Definition at line 787 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_udp_remove ( conn   ) 
-
- - - - - -
-   - - -

-Removed a UDP connection. -

-

Parameters:
- - -
conn A pointer to the uip_udp_conn structure for the connection.
-
-
Examples:
-resolv.c.
-

-Definition at line 775 of file uip.h. -

-Referenced by resolv_conf().

-

- - - - -
- - - - - - - - - -
#define uip_udp_send ( len   ) 
-
- - - - - -
-   - - -

-Send a UDP datagram of length len on the current connection. -

-This function can only be called in response to a UDP event (poll or newdata). The data must be present in the uip_buf buffer, at the place pointed to by the uip_appdata pointer.

-

Parameters:
- - -
len The length of the data in the uip_buf buffer.
-
-
Examples:
-resolv.c.
-

-Definition at line 800 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_udpconnection (   ) 
-
- - - - - -
-   - - -

-Is the current connection a UDP connection? -

-This function checks whether the current connection is a UDP connection. -

-Definition at line 626 of file uip.h.

-

- - - - -
- - - - -  - - - - -
#define uip_urgdatalen (   ) 
-
- - - - - -
-   - - -

-The length of any out-of-band data (urgent data) that has arrived on the connection. -

-

Note:
The configuration parameter UIP_URGDATA must be set for this function to be enabled.
- -

-Definition at line 561 of file uip.h.

-


Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - -
struct uip_conn* uip_connect ( uip_ipaddr_t *  ripaddr,
u16_t  port
) 
-
- - - - - -
-   - - -

-Connect to a remote host using TCP. -

-This function is used to start a new connection to the specified port on the specied host. It allocates a new connection identifier, sets the connection to the SYN_SENT state and sets the retransmission timer to 0. This will cause a TCP SYN segment to be sent out the next time this connection is periodically processed, which usually is done within 0.5 seconds after the call to uip_connect().

-

Note:
This function is avaliable only if support for active open has been configured by defining UIP_ACTIVE_OPEN to 1 in uipopt.h.

-Since this function requires the port number to be in network byte order, a conversion using HTONS() or htons() is necessary.

-
 uip_ipaddr_t ipaddr;
-
- uip_ipaddr(&ipaddr, 192,168,1,2);
- uip_connect(&ipaddr, HTONS(80));
-

-

Parameters:
- - - -
ripaddr The IP address of the remote hot.
port A 16-bit port number in network byte order.
-
-
Returns:
A pointer to the uIP connection identifier for the new connection, or NULL if no connection could be allocated.
-
Examples:
-smtp.c, and webclient.c.
-

-Definition at line 407 of file uip.c. -

-References htons(), uip_conn::lport, uip_conn::tcpstateflags, UIP_CLOSED, uip_conn, UIP_CONNS, and uip_conns. -

-Referenced by smtp_send(), and webclient_get().

-

- - - - -
- - - - - - - - - -
void uip_listen ( u16_t  port  ) 
-
- - - - - -
-   - - -

-Start listening to the specified port. -

-

Note:
Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.
-
 uip_listen(HTONS(80));
-

-

Parameters:
- - -
port A 16-bit port number in network byte order.
-
-
Examples:
-hello-world.c, and telnetd.c.
-

-Definition at line 529 of file uip.c. -

-References UIP_LISTENPORTS. -

-Referenced by hello_world_init(), and httpd_init().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void uip_send ( const void *  data,
int  len
) 
-
- - - - - -
-   - - -

-Send data on the current connection. -

-This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.

-The amount of data that actually is sent out after a call to this funcion is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function uip_mss() can be used to query uIP for the amount of data that actually will be sent.

-

Note:
This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the uip_rexmit() event being set. The application will then have to resend the data using this function.
-
Parameters:
- - - -
data A pointer to the data which is to be sent.
len The maximum amount of data bytes to be sent.
-
-
Examples:
-dhcpc.c, telnetd.c, and webclient.c.
-

-Definition at line 1888 of file uip.c. -

-References uip_sappdata, and uip_slen.

-

- - - - -
- - - - - - - - - - - - - - - - - - -
struct uip_udp_conn* uip_udp_new ( uip_ipaddr_t *  ripaddr,
u16_t  rport
) 
-
- - - - - -
-   - - -

-Set up a new UDP connection. -

-This function sets up a new UDP connection. The function will automatically allocate an unused local port for the new connection. However, another port can be chosen by using the uip_udp_bind() call, after the uip_udp_new() function has been called.

-Example:

 uip_ipaddr_t addr;
- struct uip_udp_conn *c;
- 
- uip_ipaddr(&addr, 192,168,2,1);
- c = uip_udp_new(&addr, HTONS(12345));
- if(c != NULL) {
-   uip_udp_bind(c, HTONS(12344));
- }
-
Parameters:
- - - -
ripaddr The IP address of the remote host.
rport The remote port number in network byte order.
-
-
Returns:
The uip_udp_conn structure for the new connection or NULL if no connection could be allocated.
-
Examples:
-dhcpc.c, and resolv.c.
-

-Definition at line 473 of file uip.c. -

-References htons(), uip_udp_conn::lport, uip_udp_conn, UIP_UDP_CONNS, and uip_udp_conns. -

-Referenced by resolv_conf().

-

- - - - -
- - - - - - - - - -
void uip_unlisten ( u16_t  port  ) 
-
- - - - - -
-   - - -

-Stop listening to the specified port. -

-

Note:
Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.
-

-

Parameters:
- - -
port A 16-bit port number in network byte order.
-
- -

-Definition at line 518 of file uip.c. -

-References UIP_LISTENPORTS.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00148.html b/components/net/uip/doc/html/a00148.html deleted file mode 100644 index 16158a41af..0000000000 --- a/components/net/uip/doc/html/a00148.html +++ /dev/null @@ -1,634 +0,0 @@ - - -uIP 1.0: uIP conversion functions - - - - - -

uIP conversion functions
- -[The uIP TCP/IP stack] -


Detailed Description

-These functions can be used for converting between different data formats used by uIP. -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Defines

#define uip_ipaddr(addr, addr0, addr1, addr2, addr3)
 Construct an IP address from four bytes.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
 Construct an IPv6 address from eight 16-bit words.
#define uip_ipaddr_copy(dest, src)
 Copy an IP address to another IP address.
#define uip_ipaddr_cmp(addr1, addr2)
 Compare two IP addresses.
#define uip_ipaddr_maskcmp(addr1, addr2, mask)
 Compare two IP addresses with netmasks.
#define uip_ipaddr_mask(dest, src, mask)
 Mask out the network part of an IP address.
#define uip_ipaddr1(addr)
 Pick the first octet of an IP address.
#define uip_ipaddr2(addr)
 Pick the second octet of an IP address.
#define uip_ipaddr3(addr)
 Pick the third octet of an IP address.
#define uip_ipaddr4(addr)
 Pick the fourth octet of an IP address.
#define HTONS(n)
 Convert 16-bit quantity from host byte order to network byte order.
-#define ntohs   htons

Functions

u16_t htons (u16_t val)
 Convert 16-bit quantity from host byte order to network byte order.
-


Define Documentation

-

- - - - -
- - - - - - - - - -
#define HTONS ( n   ) 
-
- - - - - -
-   - - -

-Convert 16-bit quantity from host byte order to network byte order. -

-This macro is primarily used for converting constants from host byte order to network byte order. For converting variables to network byte order, use the htons() function instead.

Examples:
-dhcpc.c, hello-world.c, resolv.c, smtp.c, and telnetd.c.
-

-Definition at line 1070 of file uip.h. -

-Referenced by hello_world_init(), htons(), httpd_init(), resolv_appcall(), resolv_conf(), smtp_send(), uip_arp_arpin(), and uip_process().

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#define uip_ip6addr ( addr,
addr0,
addr1,
addr2,
addr3,
addr4,
addr5,
addr6,
addr7   ) 
-
- - - - - -
-   - - -

-Construct an IPv6 address from eight 16-bit words. -

-This function constructs an IPv6 address. -

-Definition at line 852 of file uip.h.

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - -
#define uip_ipaddr ( addr,
addr0,
addr1,
addr2,
addr3   ) 
-
- - - - - -
-   - - -

-Construct an IP address from four bytes. -

-This function constructs an IP address of the type that uIP handles internally from four bytes. The function is handy for specifying IP addresses to use with e.g. the uip_connect() function.

-Example:

 uip_ipaddr_t ipaddr;
- struct uip_conn *c;
- 
- uip_ipaddr(&ipaddr, 192,168,1,2);
- c = uip_connect(&ipaddr, HTONS(80));
-

-

Parameters:
- - - - - - -
addr A pointer to a uip_ipaddr_t variable that will be filled in with the IP address.
addr0 The first octet of the IP address.
addr1 The second octet of the IP address.
addr2 The third octet of the IP address.
addr3 The forth octet of the IP address.
-
-
Examples:
-dhcpc.c, example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 840 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_ipaddr1 ( addr   ) 
-
- - - - - -
-   - - -

-Pick the first octet of an IP address. -

-Picks out the first octet of an IP address.

-Example:

 uip_ipaddr_t ipaddr;
- u8_t octet;
-
- uip_ipaddr(&ipaddr, 1,2,3,4);
- octet = uip_ipaddr1(&ipaddr);
-

-In the example above, the variable "octet" will contain the value 1.

Examples:
-dhcpc.c.
-

-Definition at line 995 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_ipaddr2 ( addr   ) 
-
- - - - - -
-   - - -

-Pick the second octet of an IP address. -

-Picks out the second octet of an IP address.

-Example:

 uip_ipaddr_t ipaddr;
- u8_t octet;
-
- uip_ipaddr(&ipaddr, 1,2,3,4);
- octet = uip_ipaddr2(&ipaddr);
-

-In the example above, the variable "octet" will contain the value 2.

Examples:
-dhcpc.c.
-

-Definition at line 1015 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_ipaddr3 ( addr   ) 
-
- - - - - -
-   - - -

-Pick the third octet of an IP address. -

-Picks out the third octet of an IP address.

-Example:

 uip_ipaddr_t ipaddr;
- u8_t octet;
-
- uip_ipaddr(&ipaddr, 1,2,3,4);
- octet = uip_ipaddr3(&ipaddr);
-

-In the example above, the variable "octet" will contain the value 3.

Examples:
-dhcpc.c.
-

-Definition at line 1035 of file uip.h.

-

- - - - -
- - - - - - - - - -
#define uip_ipaddr4 ( addr   ) 
-
- - - - - -
-   - - -

-Pick the fourth octet of an IP address. -

-Picks out the fourth octet of an IP address.

-Example:

 uip_ipaddr_t ipaddr;
- u8_t octet;
-
- uip_ipaddr(&ipaddr, 1,2,3,4);
- octet = uip_ipaddr4(&ipaddr);
-

-In the example above, the variable "octet" will contain the value 4.

Examples:
-dhcpc.c.
-

-Definition at line 1055 of file uip.h.

-

- - - - -
- - - - - - - - - - - - -
#define uip_ipaddr_cmp ( addr1,
addr2   ) 
-
- - - - - -
-   - - -

-Compare two IP addresses. -

-Compares two IP addresses.

-Example:

 uip_ipaddr_t ipaddr1, ipaddr2;
-
- uip_ipaddr(&ipaddr1, 192,16,1,2);
- if(uip_ipaddr_cmp(&ipaddr2, &ipaddr1)) {
-    printf("They are the same");
- }
-

-

Parameters:
- - - -
addr1 The first IP address.
addr2 The second IP address.
-
- -

-Definition at line 911 of file uip.h. -

-Referenced by uip_arp_arpin(), uip_arp_out(), and uip_process().

-

- - - - -
- - - - - - - - - - - - -
#define uip_ipaddr_copy ( dest,
src   ) 
-
- - - - - -
-   - - -

-Copy an IP address to another IP address. -

-Copies an IP address from one place to another.

-Example:

 uip_ipaddr_t ipaddr1, ipaddr2;
-
- uip_ipaddr(&ipaddr1, 192,16,1,2);
- uip_ipaddr_copy(&ipaddr2, &ipaddr1);
-

-

Parameters:
- - - -
dest The destination for the copy.
src The source from where to copy.
-
-
Examples:
-smtp.c.
-

-Definition at line 882 of file uip.h. -

-Referenced by smtp_configure(), uip_arp_out(), and uip_process().

-

- - - - -
- - - - - - - - - - - - - - - -
#define uip_ipaddr_mask ( dest,
src,
mask   ) 
-
- - - - - -
-   - - -

-Mask out the network part of an IP address. -

-Masks out the network part of an IP address, given the address and the netmask.

-Example:

 uip_ipaddr_t ipaddr1, ipaddr2, netmask;
-
- uip_ipaddr(&ipaddr1, 192,16,1,2);
- uip_ipaddr(&netmask, 255,255,255,0);
- uip_ipaddr_mask(&ipaddr2, &ipaddr1, &netmask);
-

-In the example above, the variable "ipaddr2" will contain the IP address 192.168.1.0.

-

Parameters:
- - - - -
dest Where the result is to be placed.
src The IP address.
mask The netmask.
-
- -

-Definition at line 972 of file uip.h.

-

- - - - -
- - - - - - - - - - - - - - - -
#define uip_ipaddr_maskcmp ( addr1,
addr2,
mask   ) 
-
- - - - - -
-   - - -

-Compare two IP addresses with netmasks. -

-Compares two IP addresses with netmasks. The masks are used to mask out the bits that are to be compared.

-Example:

 uip_ipaddr_t ipaddr1, ipaddr2, mask;
-
- uip_ipaddr(&mask, 255,255,255,0);
- uip_ipaddr(&ipaddr1, 192,16,1,2);
- uip_ipaddr(&ipaddr2, 192,16,1,3);
- if(uip_ipaddr_maskcmp(&ipaddr1, &ipaddr2, &mask)) {
-    printf("They are the same");
- }
-

-

Parameters:
- - - - -
addr1 The first IP address.
addr2 The second IP address.
mask The netmask.
-
- -

-Definition at line 941 of file uip.h. -

-Referenced by uip_arp_out().

-


Function Documentation

-

- - - - -
- - - - - - - - - -
u16_t htons ( u16_t  val  ) 
-
- - - - - -
-   - - -

-Convert 16-bit quantity from host byte order to network byte order. -

-This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the HTONS() macro instead.

Examples:
-example-mainloop-with-arp.c, resolv.c, and webclient.c.
-

-Definition at line 1882 of file uip.c. -

-References HTONS. -

-Referenced by uip_chksum(), uip_connect(), uip_ipchksum(), uip_udp_new(), and webclient_get().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00149.html b/components/net/uip/doc/html/a00149.html deleted file mode 100644 index ad39b08344..0000000000 --- a/components/net/uip/doc/html/a00149.html +++ /dev/null @@ -1,68 +0,0 @@ - - -uIP 1.0: Variables used in uIP device drivers - - - - - -

Variables used in uIP device drivers
- -[The uIP TCP/IP stack] -


Detailed Description

-uIP has a few global variables that are used in device drivers for uIP. -

- -

- - - - - - -

Variables

u16_t uip_len
 The length of the packet in the uip_buf buffer.
-


Variable Documentation

-

- - - - -
- - - - -
u16_t uip_len
-
- - - - - -
-   - - -

-The length of the packet in the uip_buf buffer. -

-The global variable uip_len holds the length of the packet in the uip_buf buffer.

-When the network device driver calls the uIP input function, uip_len should be set to the length of the packet in the uip_buf buffer.

-When sending packets, the device driver should use the contents of the uip_len variable to determine the length of the outgoing packet.

Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 155 of file uip.c. -

-Referenced by uip_arp_arpin(), uip_process(), and uip_split_output().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00150.html b/components/net/uip/doc/html/a00150.html deleted file mode 100644 index 56806e01f6..0000000000 --- a/components/net/uip/doc/html/a00150.html +++ /dev/null @@ -1,1248 +0,0 @@ - - -uIP 1.0: The uIP TCP/IP stack - - - - - -

The uIP TCP/IP stack


Detailed Description

-uIP is an implementation of the TCP/IP protocol stack intended for small 8-bit and 16-bit microcontrollers. -

-uIP provides the necessary protocols for Internet communication, with a very small code footprint and RAM requirements - the uIP code size is on the order of a few kilobytes and RAM usage is on the order of a few hundred bytes. -

- - - - - - - -

-

- - - -

-

- - - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  uip.h
 Header file for the uIP TCP/IP stack.
file  uip.c
 The uIP TCP/IP stack code.

Modules

 uIP configuration functions
 The uIP configuration functions are used for setting run-time parameters in uIP such as IP addresses.
 uIP initialization functions
 The uIP initialization functions are used for booting uIP.
 uIP device driver functions
 These functions are used by a network device driver for interacting with uIP.
 uIP application functions
 Functions used by an application running of top of uIP.
 uIP conversion functions
 These functions can be used for converting between different data formats used by uIP.
 Variables used in uIP device drivers
 uIP has a few global variables that are used in device drivers for uIP.
 uIP Address Resolution Protocol
 The Address Resolution Protocol ARP is used for mapping between IP addresses and link level addresses such as the Ethernet MAC addresses.
 uIP TCP throughput booster hack
 The basic uIP TCP implementation only allows each TCP connection to have a single TCP segment in flight at any given time.
 Architecture specific uIP functions
 The functions in the architecture specific module implement the IP check sum and 32-bit additions.

Data Structures

struct  uip_conn
 Representation of a uIP TCP connection. More...
struct  uip_udp_conn
 Representation of a uIP UDP connection. More...
struct  uip_stats
 The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. More...
struct  uip_tcpip_hdr
struct  uip_icmpip_hdr
struct  uip_udpip_hdr
struct  uip_eth_addr
 Representation of a 48-bit Ethernet address. More...

Defines

-#define UIP_ACKDATA   1
-#define UIP_NEWDATA   2
-#define UIP_REXMIT   4
-#define UIP_POLL   8
-#define UIP_CLOSE   16
-#define UIP_ABORT   32
-#define UIP_CONNECTED   64
-#define UIP_TIMEDOUT   128
-#define UIP_DATA   1
-#define UIP_TIMER   2
-#define UIP_POLL_REQUEST   3
-#define UIP_UDP_SEND_CONN   4
-#define UIP_UDP_TIMER   5
-#define UIP_CLOSED   0
-#define UIP_SYN_RCVD   1
-#define UIP_SYN_SENT   2
-#define UIP_ESTABLISHED   3
-#define UIP_FIN_WAIT_1   4
-#define UIP_FIN_WAIT_2   5
-#define UIP_CLOSING   6
-#define UIP_TIME_WAIT   7
-#define UIP_LAST_ACK   8
-#define UIP_TS_MASK   15
-#define UIP_STOPPED   16
#define UIP_APPDATA_SIZE
 The buffer size available for user data in the uip_buf buffer.
-#define UIP_PROTO_ICMP   1
-#define UIP_PROTO_TCP   6
-#define UIP_PROTO_UDP   17
-#define UIP_PROTO_ICMP6   58
-#define UIP_IPH_LEN   20
-#define UIP_UDPH_LEN   8
-#define UIP_TCPH_LEN   20
-#define UIP_IPUDPH_LEN   (UIP_UDPH_LEN + UIP_IPH_LEN)
-#define UIP_IPTCPH_LEN   (UIP_TCPH_LEN + UIP_IPH_LEN)
-#define UIP_TCPIP_HLEN   UIP_IPTCPH_LEN
-#define TCP_FIN   0x01
-#define TCP_SYN   0x02
-#define TCP_RST   0x04
-#define TCP_PSH   0x08
-#define TCP_ACK   0x10
-#define TCP_URG   0x20
-#define TCP_CTL   0x3f
-#define TCP_OPT_END   0
-#define TCP_OPT_NOOP   1
-#define TCP_OPT_MSS   2
-#define TCP_OPT_MSS_LEN   4
-#define ICMP_ECHO_REPLY   0
-#define ICMP_ECHO   8
-#define ICMP6_ECHO_REPLY   129
-#define ICMP6_ECHO   128
-#define ICMP6_NEIGHBOR_SOLICITATION   135
-#define ICMP6_NEIGHBOR_ADVERTISEMENT   136
-#define ICMP6_FLAG_S   (1 << 6)
-#define ICMP6_OPTION_SOURCE_LINK_ADDRESS   1
-#define ICMP6_OPTION_TARGET_LINK_ADDRESS   2
-#define BUF   ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
-#define FBUF   ((struct uip_tcpip_hdr *)&uip_reassbuf[0])
-#define ICMPBUF   ((struct uip_icmpip_hdr *)&uip_buf[UIP_LLH_LEN])
-#define UDPBUF   ((struct uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])
-#define UIP_STAT(s)
-#define UIP_LOG(m)

Typedefs

-typedef u16_t uip_ip4addr_t [2]
 Repressentation of an IP address.
-typedef u16_t uip_ip6addr_t [8]
-typedef uip_ip4addr_t uip_ipaddr_t

Functions

-void uip_process (u8_t flag)
u16_t uip_chksum (u16_t *buf, u16_t len)
 Calculate the Internet checksum over a buffer.
u16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
u16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
u16_t uip_udpchksum (void)
 Calculate the UDP checksum of the packet in uip_buf and uip_appdata.
void uip_setipid (u16_t id)
 uIP initialization function.
void uip_add32 (u8_t *op32, u16_t op16)
 Carry out a 32-bit addition.
void uip_init (void)
 uIP initialization function.
uip_conn * uip_connect (uip_ipaddr_t *ripaddr, u16_t rport)
 Connect to a remote host using TCP.
uip_udp_conn * uip_udp_new (uip_ipaddr_t *ripaddr, u16_t rport)
 Set up a new UDP connection.
void uip_unlisten (u16_t port)
 Stop listening to the specified port.
void uip_listen (u16_t port)
 Start listening to the specified port.
u16_t htons (u16_t val)
 Convert 16-bit quantity from host byte order to network byte order.
void uip_send (const void *data, int len)
 Send data on the current connection.

Variables

void * uip_appdata
 Pointer to the application data in the packet buffer.
uip_conn * uip_conn
 Pointer to the current TCP connection.
-uip_conn uip_conns [UIP_CONNS]
-uip_udp_conn * uip_udp_conn
 The current UDP connection.
-uip_udp_conn uip_udp_conns [UIP_UDP_CONNS]
uip_stats uip_stat
 The uIP TCP/IP statistics.
-u8_t uip_flags
-uip_ipaddr_t uip_hostaddr
-uip_ipaddr_t uip_netmask
-uip_ipaddr_t uip_draddr
-uip_ipaddr_t uip_hostaddr
-uip_ipaddr_t uip_draddr
-uip_ipaddr_t uip_netmask
-uip_eth_addr uip_ethaddr = {{0,0,0,0,0,0}}
u8_t uip_buf [UIP_BUFSIZE+2]
 The uIP packet buffer.
void * uip_appdata
 Pointer to the application data in the packet buffer.
-void * uip_sappdata
u16_t uip_len
 The length of the packet in the uip_buf buffer.
-u16_t uip_slen
-u8_t uip_flags
uip_conn * uip_conn
 Pointer to the current TCP connection.
-uip_conn uip_conns [UIP_CONNS]
-u16_t uip_listenports [UIP_LISTENPORTS]
-uip_udp_conn * uip_udp_conn
 The current UDP connection.
-uip_udp_conn uip_udp_conns [UIP_UDP_CONNS]
-u8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
-


Define Documentation

-

- - - - -
- - - - -
#define UIP_APPDATA_SIZE
-
- - - - - -
-   - - -

-The buffer size available for user data in the uip_buf buffer. -

-This macro holds the available size for user data in the uip_buf buffer. The macro is intended to be used for checking bounds of available user data.

-Example:

 snprintf(uip_appdata, UIP_APPDATA_SIZE, "%u\n", i);
-
-

-Definition at line 1506 of file uip.h.

-


Function Documentation

-

- - - - -
- - - - - - - - - -
u16_t htons ( u16_t  val  ) 
-
- - - - - -
-   - - -

-Convert 16-bit quantity from host byte order to network byte order. -

-This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the HTONS() macro instead. -

-Definition at line 1882 of file uip.c. -

-References HTONS. -

-Referenced by uip_chksum(), uip_connect(), uip_ipchksum(), uip_udp_new(), and webclient_get().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void uip_add32 ( u8_t *  op32,
u16_t  op16
) 
-
- - - - - -
-   - - -

-Carry out a 32-bit addition. -

-Because not all architectures for which uIP is intended has native 32-bit arithmetic, uIP uses an external C function for doing the required 32-bit additions in the TCP protocol processing. This function should add the two arguments and place the result in the global variable uip_acc32.

-

Note:
The 32-bit integer pointed to by the op32 parameter and the result in the uip_acc32 variable are in network byte order (big endian).
-
Parameters:
- - - -
op32 A pointer to a 4-byte array representing a 32-bit integer in network byte order (big endian).
op16 A 16-bit integer in host byte order.
-
- -

-Definition at line 249 of file uip.c. -

-Referenced by uip_split_output().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
u16_t uip_chksum ( u16_t *  buf,
u16_t  len
) 
-
- - - - - -
-   - - -

-Calculate the Internet checksum over a buffer. -

-The Internet checksum is the one's complement of the one's complement sum of all 16-bit words in the buffer.

-See RFC1071.

-

Parameters:
- - - -
buf A pointer to the buffer over which the checksum is to be computed.
len The length of the buffer over which the checksum is to be computed.
-
-
Returns:
The Internet checksum of the buffer.
- -

-Definition at line 311 of file uip.c. -

-References htons().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
struct uip_conn* uip_connect ( uip_ipaddr_t *  ripaddr,
u16_t  port
) 
-
- - - - - -
-   - - -

-Connect to a remote host using TCP. -

-This function is used to start a new connection to the specified port on the specied host. It allocates a new connection identifier, sets the connection to the SYN_SENT state and sets the retransmission timer to 0. This will cause a TCP SYN segment to be sent out the next time this connection is periodically processed, which usually is done within 0.5 seconds after the call to uip_connect().

-

Note:
This function is avaliable only if support for active open has been configured by defining UIP_ACTIVE_OPEN to 1 in uipopt.h.

-Since this function requires the port number to be in network byte order, a conversion using HTONS() or htons() is necessary.

-
 uip_ipaddr_t ipaddr;
-
- uip_ipaddr(&ipaddr, 192,168,1,2);
- uip_connect(&ipaddr, HTONS(80));
-

-

Parameters:
- - - -
ripaddr The IP address of the remote hot.
port A 16-bit port number in network byte order.
-
-
Returns:
A pointer to the uIP connection identifier for the new connection, or NULL if no connection could be allocated.
- -

-Definition at line 407 of file uip.c. -

-References htons(), uip_conn::lport, uip_conn::tcpstateflags, UIP_CLOSED, uip_conn, uip_conns, and UIP_CONNS. -

-Referenced by smtp_send(), and webclient_get().

-

- - - - -
- - - - - - - - - -
void uip_init ( void   ) 
-
- - - - - -
-   - - -

-uIP initialization function. -

-This function should be called at boot up to initilize the uIP TCP/IP stack. -

-Definition at line 379 of file uip.c. -

-References UIP_LISTENPORTS.

-

- - - - -
- - - - - - - - - -
u16_t uip_ipchksum ( void   ) 
-
- - - - - -
-   - - -

-Calculate the IP header checksum of the packet header in uip_buf. -

-The IP header checksum is the Internet checksum of the 20 bytes of the IP header.

-

Returns:
The IP header checksum of the IP header in the uip_buf buffer.
- -

-Definition at line 318 of file uip.c. -

-References DEBUG_PRINTF, htons(), UIP_IPH_LEN, and UIP_LLH_LEN. -

-Referenced by uip_process(), and uip_split_output().

-

- - - - -
- - - - - - - - - -
void uip_listen ( u16_t  port  ) 
-
- - - - - -
-   - - -

-Start listening to the specified port. -

-

Note:
Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.
-
 uip_listen(HTONS(80));
-

-

Parameters:
- - -
port A 16-bit port number in network byte order.
-
- -

-Definition at line 529 of file uip.c. -

-References UIP_LISTENPORTS. -

-Referenced by hello_world_init(), and httpd_init().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void uip_send ( const void *  data,
int  len
) 
-
- - - - - -
-   - - -

-Send data on the current connection. -

-This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.

-The amount of data that actually is sent out after a call to this funcion is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function uip_mss() can be used to query uIP for the amount of data that actually will be sent.

-

Note:
This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the uip_rexmit() event being set. The application will then have to resend the data using this function.
-
Parameters:
- - - -
data A pointer to the data which is to be sent.
len The maximum amount of data bytes to be sent.
-
- -

-Definition at line 1888 of file uip.c. -

-References uip_sappdata, and uip_slen.

-

- - - - -
- - - - - - - - - -
void uip_setipid ( u16_t  id  ) 
-
- - - - - -
-   - - -

-uIP initialization function. -

-This function may be used at boot time to set the initial ip_id. -

-Definition at line 181 of file uip.c.

-

- - - - -
- - - - - - - - - -
u16_t uip_tcpchksum ( void   ) 
-
- - - - - -
-   - - -

-Calculate the TCP checksum of the packet in uip_buf and uip_appdata. -

-The TCP checksum is the Internet checksum of data contents of the TCP segment, and a pseudo-header as defined in RFC793.

-

Returns:
The TCP checksum of the TCP segment in uip_buf and pointed to by uip_appdata.
- -

-Definition at line 364 of file uip.c. -

-References UIP_PROTO_TCP. -

-Referenced by uip_split_output().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
struct uip_udp_conn* uip_udp_new ( uip_ipaddr_t *  ripaddr,
u16_t  rport
) 
-
- - - - - -
-   - - -

-Set up a new UDP connection. -

-This function sets up a new UDP connection. The function will automatically allocate an unused local port for the new connection. However, another port can be chosen by using the uip_udp_bind() call, after the uip_udp_new() function has been called.

-Example:

 uip_ipaddr_t addr;
- struct uip_udp_conn *c;
- 
- uip_ipaddr(&addr, 192,168,2,1);
- c = uip_udp_new(&addr, HTONS(12345));
- if(c != NULL) {
-   uip_udp_bind(c, HTONS(12344));
- }
-
Parameters:
- - - -
ripaddr The IP address of the remote host.
rport The remote port number in network byte order.
-
-
Returns:
The uip_udp_conn structure for the new connection or NULL if no connection could be allocated.
- -

-Definition at line 473 of file uip.c. -

-References htons(), uip_udp_conn::lport, uip_udp_conn, uip_udp_conns, and UIP_UDP_CONNS. -

-Referenced by resolv_conf().

-

- - - - -
- - - - - - - - - -
u16_t uip_udpchksum ( void   ) 
-
- - - - - -
-   - - -

-Calculate the UDP checksum of the packet in uip_buf and uip_appdata. -

-The UDP checksum is the Internet checksum of data contents of the UDP segment, and a pseudo-header as defined in RFC768.

-

Returns:
The UDP checksum of the UDP segment in uip_buf and pointed to by uip_appdata.
- -

-Referenced by uip_process().

-

- - - - -
- - - - - - - - - -
void uip_unlisten ( u16_t  port  ) 
-
- - - - - -
-   - - -

-Stop listening to the specified port. -

-

Note:
Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.
-

-

Parameters:
- - -
port A 16-bit port number in network byte order.
-
- -

-Definition at line 518 of file uip.c. -

-References UIP_LISTENPORTS.

-


Variable Documentation

-

- - - - -
- - - - -
void* uip_appdata
-
- - - - - -
-   - - -

-Pointer to the application data in the packet buffer. -

-This pointer points to the application data when the application is called. If the application wishes to send data, the application may use this space to write the data into before calling uip_send(). -

-Definition at line 143 of file uip.c. -

-Referenced by uip_process(), and uip_split_output().

-

- - - - -
- - - - -
void* uip_appdata
-
- - - - - -
-   - - -

-Pointer to the application data in the packet buffer. -

-This pointer points to the application data when the application is called. If the application wishes to send data, the application may use this space to write the data into before calling uip_send().

Examples:
-dhcpc.c, resolv.c, telnetd.c, and webclient.c.
-

-Definition at line 143 of file uip.c. -

-Referenced by uip_process(), and uip_split_output().

-

- - - - -
- - - - -
u8_t uip_buf[UIP_BUFSIZE+2]
-
- - - - - -
-   - - -

-The uIP packet buffer. -

-The uip_buf array is used to hold incoming and outgoing packets. The device driver should place incoming data into this buffer. When sending data, the device driver should read the link level headers and the TCP/IP headers from this buffer. The size of the link level headers is configured by the UIP_LLH_LEN define.

-

Note:
The application data need not be placed in this buffer, so the device driver must read it from the place pointed to by the uip_appdata pointer as illustrated by the following example:
 void
- devicedriver_send(void)
- {
-    hwsend(&uip_buf[0], UIP_LLH_LEN);
-    if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) {
-      hwsend(&uip_buf[UIP_LLH_LEN], uip_len - UIP_LLH_LEN);
-    } else {
-      hwsend(&uip_buf[UIP_LLH_LEN], UIP_TCPIP_HLEN);
-      hwsend(uip_appdata, uip_len - UIP_TCPIP_HLEN - UIP_LLH_LEN);
-    }
- }
-
- -

-Definition at line 139 of file uip.c. -

-Referenced by uip_process().

-

- - - - -
- - - - -
struct uip_conn* uip_conn
-
- - - - - -
-   - - -

-Pointer to the current TCP connection. -

-The uip_conn pointer can be used to access the current TCP connection. -

-Definition at line 163 of file uip.c. -

-Referenced by uip_connect().

-

- - - - -
- - - - -
struct uip_conn* uip_conn
-
- - - - - -
-   - - -

-Pointer to the current TCP connection. -

-The uip_conn pointer can be used to access the current TCP connection.

Examples:
-hello-world.c, smtp.c, and webclient.c.
-

-Definition at line 163 of file uip.c. -

-Referenced by uip_connect().

-

- - - - -
- - - - -
u16_t uip_len
-
- - - - - -
-   - - -

-The length of the packet in the uip_buf buffer. -

-The global variable uip_len holds the length of the packet in the uip_buf buffer.

-When the network device driver calls the uIP input function, uip_len should be set to the length of the packet in the uip_buf buffer.

-When sending packets, the device driver should use the contents of the uip_len variable to determine the length of the outgoing packet. -

-Definition at line 155 of file uip.c. -

-Referenced by uip_arp_arpin(), uip_process(), and uip_split_output().

-

- - - - -
- - - - -
struct uip_stats uip_stat
-
- - - - - -
-   - - -

-The uIP TCP/IP statistics. -

-This is the variable in which the uIP TCP/IP statistics are gathered. -

-Referenced by uip_process().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00151.html b/components/net/uip/doc/html/a00151.html deleted file mode 100644 index aa144cf2d0..0000000000 --- a/components/net/uip/doc/html/a00151.html +++ /dev/null @@ -1,221 +0,0 @@ - - -uIP 1.0: Architecture specific uIP functions - - - - - -

Architecture specific uIP functions
- -[The uIP TCP/IP stack] -


Detailed Description

-The functions in the architecture specific module implement the IP check sum and 32-bit additions. -

-The IP checksum calculation is the most computationally expensive operation in the TCP/IP stack and it therefore pays off to implement this in efficient assembler. The purpose of the uip-arch module is to let the checksum functions to be implemented in architecture specific assembler. -

- - - - - - - -

-

- - - - - - - - - - - - - - - - -

Files

file  uip_arch.h
 Declarations of architecture specific functions.

Functions

void uip_add32 (u8_t *op32, u16_t op16)
 Carry out a 32-bit addition.
u16_t uip_chksum (u16_t *buf, u16_t len)
 Calculate the Internet checksum over a buffer.
u16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
u16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.

Variables

-u8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
-


Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void uip_add32 ( u8_t *  op32,
u16_t  op16
) 
-
- - - - - -
-   - - -

-Carry out a 32-bit addition. -

-Because not all architectures for which uIP is intended has native 32-bit arithmetic, uIP uses an external C function for doing the required 32-bit additions in the TCP protocol processing. This function should add the two arguments and place the result in the global variable uip_acc32.

-

Note:
The 32-bit integer pointed to by the op32 parameter and the result in the uip_acc32 variable are in network byte order (big endian).
-
Parameters:
- - - -
op32 A pointer to a 4-byte array representing a 32-bit integer in network byte order (big endian).
op16 A 16-bit integer in host byte order.
-
- -

-Definition at line 249 of file uip.c. -

-Referenced by uip_split_output().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
u16_t uip_chksum ( u16_t *  buf,
u16_t  len
) 
-
- - - - - -
-   - - -

-Calculate the Internet checksum over a buffer. -

-The Internet checksum is the one's complement of the one's complement sum of all 16-bit words in the buffer.

-See RFC1071.

-

Note:
This function is not called in the current version of uIP, but future versions might make use of it.
-
Parameters:
- - - -
buf A pointer to the buffer over which the checksum is to be computed.
len The length of the buffer over which the checksum is to be computed.
-
-
Returns:
The Internet checksum of the buffer.
-
-

- - - - -
- - - - - - - - - -
u16_t uip_ipchksum ( void   ) 
-
- - - - - -
-   - - -

-Calculate the IP header checksum of the packet header in uip_buf. -

-The IP header checksum is the Internet checksum of the 20 bytes of the IP header.

-

Returns:
The IP header checksum of the IP header in the uip_buf buffer.
-
-

- - - - -
- - - - - - - - - -
u16_t uip_tcpchksum ( void   ) 
-
- - - - - -
-   - - -

-Calculate the TCP checksum of the packet in uip_buf and uip_appdata. -

-The TCP checksum is the Internet checksum of data contents of the TCP segment, and a pseudo-header as defined in RFC793.

-

Note:
The uip_appdata pointer that points to the packet data may point anywhere in memory, so it is not possible to simply calculate the Internet checksum of the contents of the uip_buf buffer.
-
Returns:
The TCP checksum of the TCP segment in uip_buf and pointed to by uip_appdata.
-
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00152.html b/components/net/uip/doc/html/a00152.html deleted file mode 100644 index b44513c477..0000000000 --- a/components/net/uip/doc/html/a00152.html +++ /dev/null @@ -1,205 +0,0 @@ - - -uIP 1.0: uIP Address Resolution Protocol - - - - - -

uIP Address Resolution Protocol
- -[The uIP TCP/IP stack] -


Detailed Description

-The Address Resolution Protocol ARP is used for mapping between IP addresses and link level addresses such as the Ethernet MAC addresses. -

-ARP uses broadcast queries to ask for the link level address of a known IP address and the host which is configured with the IP address for which the query was meant, will respond with its link level address.

-

Note:
This ARP implementation only supports Ethernet.
- -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  uip_arp.h
 Macros and definitions for the ARP module.
file  uip_arp.c
 Implementation of the ARP Address Resolution Protocol.

Data Structures

struct  uip_eth_hdr
 The Ethernet header. More...

Defines

-#define UIP_ETHTYPE_ARP   0x0806
-#define UIP_ETHTYPE_IP   0x0800
-#define UIP_ETHTYPE_IP6   0x86dd
-#define uip_arp_ipin()
-#define ARP_REQUEST   1
-#define ARP_REPLY   2
-#define ARP_HWTYPE_ETH   1
-#define BUF   ((struct arp_hdr *)&uip_buf[0])
-#define IPBUF   ((struct ethip_hdr *)&uip_buf[0])

Functions

-void uip_arp_init (void)
 Initialize the ARP module.
void uip_arp_arpin (void)
 ARP processing for incoming ARP packets.
void uip_arp_out (void)
 Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request.
void uip_arp_timer (void)
 Periodic ARP processing function.

Variables

-uip_eth_addr uip_ethaddr
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void uip_arp_arpin ( void   ) 
-
- - - - - -
-   - - -

-ARP processing for incoming ARP packets. -

-This function should be called by the device driver when an ARP packet has been received. The function will act differently depending on the ARP packet type: if it is a reply for a request that we previously sent out, the ARP cache will be filled in with the values from the ARP reply. If the incoming ARP packet is an ARP request for our IP address, an ARP reply packet is created and put into the uip_buf[] buffer.

-When the function returns, the value of the global variable uip_len indicates whether the device driver should send out a packet or not. If uip_len is zero, no packet should be sent. If uip_len is non-zero, it contains the length of the outbound packet that is present in the uip_buf[] buffer.

-This function expects an ARP packet with a prepended Ethernet header in the uip_buf[] buffer, and the length of the packet in the global variable uip_len.

Examples:
-example-mainloop-with-arp.c.
-

-Definition at line 278 of file uip_arp.c. -

-References uip_eth_addr::addr, ARP_REPLY, ARP_REQUEST, BUF, HTONS, uip_ethaddr, UIP_ETHTYPE_ARP, uip_hostaddr, uip_ipaddr_cmp, and uip_len.

-

- - - - -
- - - - - - - - - -
void uip_arp_out ( void   ) 
-
- - - - - -
-   - - -

-Prepend Ethernet header to an outbound IP packet and see if we need to send out an ARP request. -

-This function should be called before sending out an IP packet. The function checks the destination IP address of the IP packet to see what Ethernet MAC address that should be used as a destination MAC address on the Ethernet.

-If the destination IP address is in the local network (determined by logical ANDing of netmask and our IP address), the function checks the ARP cache to see if an entry for the destination IP address is found. If so, an Ethernet header is prepended and the function returns. If no ARP cache entry is found for the destination IP address, the packet in the uip_buf[] is replaced by an ARP request packet for the IP address. The IP packet is dropped and it is assumed that they higher level protocols (e.g., TCP) eventually will retransmit the dropped packet.

-If the destination IP address is not on the local network, the IP address of the default router is used instead.

-When the function returns, a packet is present in the uip_buf[] buffer, and the length of the packet is in the global variable uip_len.

Examples:
-example-mainloop-with-arp.c.
-

-Definition at line 354 of file uip_arp.c. -

-References uip_eth_addr::addr, IPBUF, UIP_ARPTAB_SIZE, uip_draddr, uip_hostaddr, uip_ipaddr_cmp, uip_ipaddr_copy, and uip_ipaddr_maskcmp.

-

- - - - -
- - - - - - - - - -
void uip_arp_timer ( void   ) 
-
- - - - - -
-   - - -

-Periodic ARP processing function. -

-This function performs periodic timer processing in the ARP module and should be called at regular intervals. The recommended interval is 10 seconds between the calls.

Examples:
-example-mainloop-with-arp.c.
-

-Definition at line 142 of file uip_arp.c. -

-References UIP_ARP_MAXAGE, and UIP_ARPTAB_SIZE.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00153.html b/components/net/uip/doc/html/a00153.html deleted file mode 100644 index e303995319..0000000000 --- a/components/net/uip/doc/html/a00153.html +++ /dev/null @@ -1,1059 +0,0 @@ - - -uIP 1.0: Configuration options for uIP - - - - - -

Configuration options for uIP


Detailed Description

-uIP is configured using the per-project configuration file uipopt.h. -

-This file contains all compile-time options for uIP and should be tweaked to match each specific project. The uIP distribution contains a documented example "uipopt.h" that can be copied and modified for each project.

-

Note:
Most of the configuration options in the uipopt.h should not be changed, but rather the per-project uip-conf.h file.
- -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  uip-conf.h
 An example uIP configuration file.
file  uipopt.h
 Configuration options for uIP.

Project-specific configuration options

uIP has a number of configuration options that can be overridden for each project. These are kept in a project-specific uip-conf.h file and all configuration names have the prefix UIP_CONF.

-#define UIP_CONF_MAX_CONNECTIONS
 Maximum number of TCP connections.
-#define UIP_CONF_MAX_LISTENPORTS
 Maximum number of listening TCP ports.
-#define UIP_CONF_BUFFER_SIZE
 uIP buffer size.
-#define UIP_CONF_BYTE_ORDER
 CPU byte order.
-#define UIP_CONF_LOGGING
 Logging on or off.
-#define UIP_CONF_UDP
 UDP support on or off.
-#define UIP_CONF_UDP_CHECKSUMS
 UDP checksums on or off.
-#define UIP_CONF_STATISTICS
 uIP statistics on or off
typedef uint8_t u8_t
 8 bit datatype
typedef uint16_t u16_t
 16 bit datatype
typedef unsigned short uip_stats_t
 Statistics datatype.

Static configuration options

These configuration options can be used for setting the IP address settings statically, but only if UIP_FIXEDADDR is set to 1. The configuration options for a specific node includes IP address, netmask and default router as well as the Ethernet address. The netmask, default router and Ethernet address are appliciable only if uIP should be run over Ethernet.

-All of these should be changed to suit your project.

#define UIP_FIXEDADDR
 Determines if uIP should use a fixed IP address or not.
#define UIP_PINGADDRCONF
 Ping IP address asignment.
#define UIP_FIXEDETHADDR
 Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not.

IP configuration options

#define UIP_TTL   64
 The IP TTL (time to live) of IP packets sent by uIP.
#define UIP_REASSEMBLY
 Turn on support for IP packet reassembly.
-#define UIP_REASS_MAXAGE   40
 The maximum time an IP fragment should wait in the reassembly buffer before it is dropped.

UDP configuration options

-#define UIP_UDP
 Toggles wether UDP support should be compiled in or not.
#define UIP_UDP_CHECKSUMS
 Toggles if UDP checksums should be used or not.
-#define UIP_UDP_CONNS
 The maximum amount of concurrent UDP connections.

TCP configuration options

#define UIP_ACTIVE_OPEN
 Determines if support for opening connections from uIP should be compiled in.
#define UIP_CONNS
 The maximum number of simultaneously open TCP connections.
#define UIP_LISTENPORTS
 The maximum number of simultaneously listening TCP ports.
#define UIP_URGDATA
 Determines if support for TCP urgent data notification should be compiled in.
#define UIP_RTO   3
 The initial retransmission timeout counted in timer pulses.
#define UIP_MAXRTX   8
 The maximum number of times a segment should be retransmitted before the connection should be aborted.
#define UIP_MAXSYNRTX   5
 The maximum number of times a SYN segment should be retransmitted before a connection request should be deemed to have been unsuccessful.
#define UIP_TCP_MSS   (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
 The TCP maximum segment size.
#define UIP_RECEIVE_WINDOW
 The size of the advertised receiver's window.
#define UIP_TIME_WAIT_TIMEOUT   120
 How long a connection should stay in the TIME_WAIT state.

ARP configuration options

#define UIP_ARPTAB_SIZE
 The size of the ARP table.
#define UIP_ARP_MAXAGE   120
 The maxium age of ARP table entries measured in 10ths of seconds.

General configuration options

#define UIP_BUFSIZE
 The size of the uIP packet buffer.
#define UIP_STATISTICS
 Determines if statistics support should be compiled in.
#define UIP_LOGGING
 Determines if logging of certain events should be compiled in.
#define UIP_BROADCAST
 Broadcast support.
#define UIP_LLH_LEN
 The link level header length.
void uip_log (char *msg)
 Print out a uIP log message.

CPU architecture configuration

The CPU architecture configuration is where the endianess of the CPU on which uIP is to be run is specified. Most CPUs today are little endian, and the most notable exception are the Motorolas which are big endian. The BYTE_ORDER macro should be changed to reflect the CPU architecture on which uIP is to be run.

#define UIP_BYTE_ORDER
 The byte order of the CPU architecture on which uIP is to be run.

Appication specific configurations

An uIP application is implemented using a single application function that is called by uIP whenever a TCP/IP event occurs. The name of this function must be registered with uIP at compile time using the UIP_APPCALL definition.

-uIP applications can store the application state within the uip_conn structure by specifying the type of the application structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.

-The file containing the definitions must be included in the uipopt.h file.

-The following example illustrates how this can look.

void httpd_appcall(void);
-#define UIP_APPCALL     httpd_appcall
-
-struct httpd_state {
-  u8_t state;
-  u16_t count;
-  char *dataptr;
-  char *script;
-};
-typedef struct httpd_state uip_tcp_appstate_t
-


-#define UIP_APPCALL   smtp_appcall
 The name of the application function that uIP should call in response to TCP/IP events.
typedef smtp_state uip_tcp_appstate_t
 The type of the application state that is to be stored in the uip_conn structure.
typedef int uip_udp_appstate_t
 The type of the application state that is to be stored in the uip_conn structure.

Defines

-#define UIP_LITTLE_ENDIAN   3412
-#define UIP_BIG_ENDIAN   1234
-


Define Documentation

-

- - - - -
- - - - -
#define UIP_ACTIVE_OPEN
-
- - - - - -
-   - - -

-Determines if support for opening connections from uIP should be compiled in. -

-If the applications that are running on top of uIP for this project do not need to open outgoing TCP connections, this configration option can be turned off to reduce the code size of uIP. -

-Definition at line 233 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_ARP_MAXAGE   120
-
- - - - - -
-   - - -

-The maxium age of ARP table entries measured in 10ths of seconds. -

-An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD default). -

-Definition at line 358 of file uipopt.h. -

-Referenced by uip_arp_timer().

-

- - - - -
- - - - -
#define UIP_ARPTAB_SIZE
-
- - - - - -
-   - - -

-The size of the ARP table. -

-This option should be set to a larger value if this uIP node will have many connections from the local network. -

-Definition at line 349 of file uipopt.h. -

-Referenced by uip_arp_init(), uip_arp_out(), and uip_arp_timer().

-

- - - - -
- - - - -
#define UIP_BROADCAST
-
- - - - - -
-   - - -

-Broadcast support. -

-This flag configures IP broadcast support. This is useful only together with UDP. -

-Definition at line 423 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_BUFSIZE
-
- - - - - -
-   - - -

-The size of the uIP packet buffer. -

-The uIP packet buffer should not be smaller than 60 bytes, and does not need to be larger than 1500 bytes. Lower size results in lower TCP throughput, larger size results in higher TCP throughput. -

-Definition at line 379 of file uipopt.h. -

-Referenced by uip_split_output().

-

- - - - -
- - - - -
#define UIP_BYTE_ORDER
-
- - - - - -
-   - - -

-The byte order of the CPU architecture on which uIP is to be run. -

-This option can be either BIG_ENDIAN (Motorola byte order) or LITTLE_ENDIAN (Intel byte order). -

-Definition at line 475 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_CONNS
-
- - - - - -
-   - - -

-The maximum number of simultaneously open TCP connections. -

-Since the TCP connections are statically allocated, turning this configuration knob down results in less RAM used. Each TCP connection requires approximatly 30 bytes of memory.

Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 245 of file uipopt.h. -

-Referenced by uip_connect().

-

- - - - -
- - - - -
#define UIP_FIXEDADDR
-
- - - - - -
-   - - -

-Determines if uIP should use a fixed IP address or not. -

-If uIP should use a fixed IP address, the settings are set in the uipopt.h file. If not, the macros uip_sethostaddr(), uip_setdraddr() and uip_setnetmask() should be used instead. -

-Definition at line 97 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_FIXEDETHADDR
-
- - - - - -
-   - - -

-Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not. -

-If this configuration option is 0, the macro uip_setethaddr() can be used to specify the Ethernet address at run-time. -

-Definition at line 127 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_LISTENPORTS
-
- - - - - -
-   - - -

-The maximum number of simultaneously listening TCP ports. -

-Each listening TCP port requires 2 bytes of memory. -

-Definition at line 259 of file uipopt.h. -

-Referenced by uip_init(), uip_listen(), and uip_unlisten().

-

- - - - -
- - - - -
#define UIP_LLH_LEN
-
- - - - - -
-   - - -

-The link level header length. -

-This is the offset into the uip_buf where the IP header can be found. For Ethernet, this should be set to 14. For SLIP, this should be set to 0. -

-Definition at line 448 of file uipopt.h. -

-Referenced by uip_ipchksum(), uip_process(), and uip_split_output().

-

- - - - -
- - - - -
#define UIP_LOGGING
-
- - - - - -
-   - - -

-Determines if logging of certain events should be compiled in. -

-This is useful mostly for debugging. The function uip_log() must be implemented to suit the architecture of the project, if logging is turned on. -

-Definition at line 408 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_MAXRTX   8
-
- - - - - -
-   - - -

-The maximum number of times a segment should be retransmitted before the connection should be aborted. -

-This should not be changed. -

-Definition at line 288 of file uipopt.h. -

-Referenced by uip_process().

-

- - - - -
- - - - -
#define UIP_MAXSYNRTX   5
-
- - - - - -
-   - - -

-The maximum number of times a SYN segment should be retransmitted before a connection request should be deemed to have been unsuccessful. -

-This should not need to be changed. -

-Definition at line 297 of file uipopt.h. -

-Referenced by uip_process().

-

- - - - -
- - - - -
#define UIP_PINGADDRCONF
-
- - - - - -
-   - - -

-Ping IP address asignment. -

-uIP uses a "ping" packets for setting its own IP address if this option is set. If so, uIP will start with an empty IP address and the destination IP address of the first incoming "ping" (ICMP echo) packet will be used for setting the hosts IP address.

-

Note:
This works only if UIP_FIXEDADDR is 0.
- -

-Definition at line 114 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_REASSEMBLY
-
- - - - - -
-   - - -

-Turn on support for IP packet reassembly. -

-uIP supports reassembly of fragmented IP packets. This features requires an additonal amount of RAM to hold the reassembly buffer and the reassembly code size is approximately 700 bytes. The reassembly buffer is of the same size as the uip_buf buffer (configured by UIP_BUFSIZE).

-

Note:
IP packet reassembly is not heavily tested.
- -

-Definition at line 156 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_RECEIVE_WINDOW
-
- - - - - -
-   - - -

-The size of the advertised receiver's window. -

-Should be set low (i.e., to the size of the uip_buf buffer) is the application is slow to process incoming data, or high (32768 bytes) if the application processes data quickly. -

-Definition at line 317 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_RTO   3
-
- - - - - -
-   - - -

-The initial retransmission timeout counted in timer pulses. -

-This should not be changed. -

-Definition at line 280 of file uipopt.h. -

-Referenced by uip_process().

-

- - - - -
- - - - -
#define UIP_STATISTICS
-
- - - - - -
-   - - -

-Determines if statistics support should be compiled in. -

-The statistics is useful for debugging and to show the user. -

-Definition at line 393 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_TCP_MSS   (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
-
- - - - - -
-   - - -

-The TCP maximum segment size. -

-This is should not be to set to more than UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN. -

-Definition at line 305 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_TIME_WAIT_TIMEOUT   120
-
- - - - - -
-   - - -

-How long a connection should stay in the TIME_WAIT state. -

-This configiration option has no real implication, and it should be left untouched. -

-Definition at line 328 of file uipopt.h. -

-Referenced by uip_process().

-

- - - - -
- - - - -
#define UIP_TTL   64
-
- - - - - -
-   - - -

-The IP TTL (time to live) of IP packets sent by uIP. -

-This should normally not be changed. -

-Definition at line 141 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_UDP_CHECKSUMS
-
- - - - - -
-   - - -

-Toggles if UDP checksums should be used or not. -

-

Note:
Support for UDP checksums is currently not included in uIP, so this option has no function.
- -

-Definition at line 195 of file uipopt.h.

-

- - - - -
- - - - -
#define UIP_URGDATA
-
- - - - - -
-   - - -

-Determines if support for TCP urgent data notification should be compiled in. -

-Urgent data (out-of-band data) is a rarely used TCP feature that very seldom would be required. -

-Definition at line 273 of file uipopt.h.

-


Typedef Documentation

-

- - - - -
- - - - -
typedef uint16_t u16_t
-
- - - - - -
-   - - -

-16 bit datatype -

-This typedef defines the 16-bit type used throughout uIP.

Examples:
-dhcpc.c, dhcpc.h, resolv.c, resolv.h, smtp.c, smtp.h, telnetd.c, and uip-conf.h.
-

-Definition at line 76 of file uip-conf.h.

-

- - - - -
- - - - -
typedef uint8_t u8_t
-
- - - - - -
-   - - -

-8 bit datatype -

-This typedef defines the 8-bit type used throughout uIP.

Examples:
-dhcpc.c, dhcpc.h, resolv.c, smtp.h, telnetd.c, telnetd.h, and uip-conf.h.
-

-Definition at line 67 of file uip-conf.h.

-

- - - - -
- - - - -
typedef unsigned short uip_stats_t
-
- - - - - -
-   - - -

-Statistics datatype. -

-This typedef defines the dataype used for keeping statistics in uIP. -

-Definition at line 86 of file uip-conf.h.

-

- - - - -
- - - - -
typedef uip_tcp_appstate_t
-
- - - - - -
-   - - -

-The type of the application state that is to be stored in the uip_conn structure. -

-This usually is typedef:ed to a struct holding application state information.

Examples:
-smtp.h, telnetd.h, and webclient.h.
-

-Definition at line 98 of file smtp.h.

-

- - - - -
- - - - -
typedef uip_udp_appstate_t
-
- - - - - -
-   - - -

-The type of the application state that is to be stored in the uip_conn structure. -

-This usually is typedef:ed to a struct holding application state information.

Examples:
-dhcpc.h.
-

-Definition at line 47 of file resolv.h.

-


Function Documentation

-

- - - - -
- - - - - - - - - -
void uip_log ( char *  msg  ) 
-
- - - - - -
-   - - -

-Print out a uIP log message. -

-This function must be implemented by the module that uses uIP, and is called by uIP whenever a log message is generated.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00154.html b/components/net/uip/doc/html/a00154.html deleted file mode 100644 index 8c2a7bf27b..0000000000 --- a/components/net/uip/doc/html/a00154.html +++ /dev/null @@ -1,79 +0,0 @@ - - -uIP 1.0: uIP TCP throughput booster hack - - - - - -

uIP TCP throughput booster hack
- -[The uIP TCP/IP stack] -


Detailed Description

-The basic uIP TCP implementation only allows each TCP connection to have a single TCP segment in flight at any given time. -

-Because of the delayed ACK algorithm employed by most TCP receivers, uIP's limit on the amount of in-flight TCP segments seriously reduces the maximum achievable throughput for sending data from uIP.

-The uip-split module is a hack which tries to remedy this situation. By splitting maximum sized outgoing TCP segments into two, the delayed ACK algorithm is not invoked at TCP receivers. This improves the throughput when sending data from uIP by orders of magnitude.

-The uip-split module uses the uip-fw module (uIP IP packet forwarding) for sending packets. Therefore, the uip-fw module must be set up with the appropriate network interfaces for this module to work. -

- - - - - - - -

-

- - - -

Files

file  uip-split.h
 Module for splitting outbound TCP segments in two to avoid the delayed ACK throughput degradation.

Functions

void uip_split_output (void)
 Handle outgoing packets.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void uip_split_output ( void   ) 
-
- - - - - -
-   - - -

-Handle outgoing packets. -

-This function inspects an outgoing packet in the uip_buf buffer and sends it out using the uip_fw_output() function. If the packet is a full-sized TCP segment it will be split into two segments and transmitted separately. This function should be called instead of the actual device driver output function, or the uip_fw_output() function.

-The headers of the outgoing packet is assumed to be in the uip_buf buffer and the payload is assumed to be wherever uip_appdata points. The length of the outgoing packet is assumed to be in the uip_len variable. -

-Definition at line 49 of file uip-split.c. -

-References BUF, uip_acc32, uip_add32(), uip_appdata, UIP_BUFSIZE, uip_ipchksum(), UIP_IPH_LEN, uip_len, UIP_LLH_LEN, UIP_PROTO_TCP, uip_tcpchksum(), and UIP_TCPIP_HLEN.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00155.html b/components/net/uip/doc/html/a00155.html deleted file mode 100644 index 157811a53c..0000000000 --- a/components/net/uip/doc/html/a00155.html +++ /dev/null @@ -1,82 +0,0 @@ - - -uIP 1.0: Local continuations - - - - - -

Local continuations
- -[Protothreads] -


Detailed Description

-Local continuations form the basis for implementing protothreads. -

-A local continuation can be set in a specific function to capture the state of the function. After a local continuation has been set can be resumed in order to restore the state of the function at the point where the local continuation was set. -

- - - - - - - -

-

- - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - -

Files

file  lc.h
 Local continuations.
file  lc-switch.h
 Implementation of local continuations based on switch() statment.
file  lc-addrlabels.h
 Implementation of local continuations based on the "Labels as values" feature of gcc.

Defines

-#define __LC_SWTICH_H__
-#define LC_INIT(s)   s = 0;
-#define LC_RESUME(s)   switch(s) { case 0:
-#define LC_SET(s)   s = __LINE__; case __LINE__:
-#define LC_END(s)   }
-#define LC_INIT(s)   s = NULL
-#define LC_RESUME(s)
-#define LC_SET(s)   do { ({ __label__ resume; resume: (s) = &&resume; }); }while(0)
-#define LC_END(s)

Typedefs

-typedef unsigned short lc_t
-typedef void * lc_t
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00156.html b/components/net/uip/doc/html/a00156.html deleted file mode 100644 index 9df0786dfd..0000000000 --- a/components/net/uip/doc/html/a00156.html +++ /dev/null @@ -1,237 +0,0 @@ - - -uIP 1.0: Timer library - - - - - -

Timer library


Detailed Description

-The timer library provides functions for setting, resetting and restarting timers, and for checking if a timer has expired. -

-An application must "manually" check if its timers have expired; this is not done automatically.

-A timer is declared as a struct timer and all access to the timer is made by a pointer to the declared timer.

-

Note:
The timer library uses the Clock library to measure time. Intervals should be specified in the format used by the clock library.
- -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - -

Files

file  timer.h
 Timer library header file.
file  timer.c
 Timer library implementation.

Data Structures

struct  timer
 A timer. More...

Functions

void timer_set (struct timer *t, clock_time_t interval)
 Set a timer.
void timer_reset (struct timer *t)
 Reset the timer with the same interval.
void timer_restart (struct timer *t)
 Restart the timer from the current point in time.
int timer_expired (struct timer *t)
 Check if a timer has expired.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
int timer_expired ( struct timer *  t  ) 
-
- - - - - -
-   - - -

-Check if a timer has expired. -

-This function tests if a timer has expired and returns true or false depending on its status.

-

Parameters:
- - -
t A pointer to the timer
-
-
Returns:
Non-zero if the timer has expired, zero otherwise.
-
Examples:
-dhcpc.c, example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 121 of file timer.c. -

-References clock_time(), interval, and start.

-

- - - - -
- - - - - - - - - -
void timer_reset ( struct timer *  t  ) 
-
- - - - - -
-   - - -

-Reset the timer with the same interval. -

-This function resets the timer with the same interval that was given to the timer_set() function. The start point of the interval is the exact time that the timer last expired. Therefore, this function will cause the timer to be stable over time, unlike the timer_rester() function.

-

Parameters:
- - -
t A pointer to the timer.
-
-
See also:
timer_restart()
-
Examples:
-example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 84 of file timer.c. -

-References interval, and start.

-

- - - - -
- - - - - - - - - -
void timer_restart ( struct timer *  t  ) 
-
- - - - - -
-   - - -

-Restart the timer from the current point in time. -

-This function restarts a timer with the same interval that was given to the timer_set() function. The timer will start at the current time.

-

Note:
A periodic timer will drift if this function is used to reset it. For preioric timers, use the timer_reset() function instead.
-
Parameters:
- - -
t A pointer to the timer.
-
-
See also:
timer_reset()
- -

-Definition at line 104 of file timer.c. -

-References clock_time(), and start.

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void timer_set ( struct timer *  t,
clock_time_t  interval
) 
-
- - - - - -
-   - - -

-Set a timer. -

-This function is used to set a timer for a time sometime in the future. The function timer_expired() will evaluate to true after the timer has expired.

-

Parameters:
- - - -
t A pointer to the timer
interval The interval before the timer expires.
-
-
Examples:
-dhcpc.c, example-mainloop-with-arp.c, and example-mainloop-without-arp.c.
-

-Definition at line 64 of file timer.c. -

-References clock_time(), interval, and start.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00157.html b/components/net/uip/doc/html/a00157.html deleted file mode 100644 index a89ac8d5a1..0000000000 --- a/components/net/uip/doc/html/a00157.html +++ /dev/null @@ -1,108 +0,0 @@ - - -uIP 1.0: Clock interface - - - - - -

Clock interface


Detailed Description

-The clock interface is the interface between the timer library and the platform specific clock functionality. -

-The clock interface must be implemented for each platform that uses the timer library.

-The clock interface does only one this: it measures time. The clock interface provides a macro, CLOCK_SECOND, which corresponds to one second of system time.

-

See also:
Timer library
- -

- - - - - - - - - - - - - -

Defines

-#define CLOCK_SECOND
 A second, measured in system clock time.

Functions

void clock_init (void)
 Initialize the clock library.
clock_time_t clock_time (void)
 Get the current clock time.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void clock_init ( void   ) 
-
- - - - - -
-   - - -

-Initialize the clock library. -

-This function initializes the clock library and should be called from the main() function of the system.

-

- - - - -
- - - - - - - - - -
clock_time_t clock_time ( void   ) 
-
- - - - - -
-   - - -

-Get the current clock time. -

-This function returns the current system clock time.

-

Returns:
The current clock time, measured in system ticks.
- -

-Referenced by timer_expired(), timer_restart(), and timer_set().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00158.html b/components/net/uip/doc/html/a00158.html deleted file mode 100644 index 4d56cceeab..0000000000 --- a/components/net/uip/doc/html/a00158.html +++ /dev/null @@ -1,693 +0,0 @@ - - -uIP 1.0: Protosockets library - - - - - -

Protosockets library


Detailed Description

-The protosocket library provides an interface to the uIP stack that is similar to the traditional BSD socket interface. -

-Unlike programs written for the ordinary uIP event-driven interface, programs written with the protosocket library are executed in a sequential fashion and does not have to be implemented as explicit state machines.

-Protosockets only work with TCP connections.

-The protosocket library uses Protothreads protothreads to provide sequential control flow. This makes the protosockets lightweight in terms of memory, but also means that protosockets inherits the functional limitations of protothreads. Each protosocket lives only within a single function. Automatic variables (stack variables) are not retained across a protosocket library function call.

-

Note:
Because the protosocket library uses protothreads, local variables will not always be saved across a call to a protosocket library function. It is therefore advised that local variables are used with extreme care.
-The protosocket library provides functions for sending data without having to deal with retransmissions and acknowledgements, as well as functions for reading data without having to deal with data being split across more than one TCP segment.

-Because each protosocket runs as a protothread, the protosocket has to be started with a call to PSOCK_BEGIN() at the start of the function in which the protosocket is used. Similarly, the protosocket protothread can be terminated by a call to PSOCK_EXIT(). -

- - - - - - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  psock.h
 Protosocket library header file.

Data Structures

struct  psock_buf
struct  psock
 The representation of a protosocket. More...

Defines

#define PSOCK_INIT(psock, buffer, buffersize)
 Initialize a protosocket.
#define PSOCK_BEGIN(psock)
 Start the protosocket protothread in a function.
#define PSOCK_SEND(psock, data, datalen)
 Send data.
#define PSOCK_SEND_STR(psock, str)
 Send a null-terminated string.
#define PSOCK_GENERATOR_SEND(psock, generator, arg)
 Generate data with a function and send it.
#define PSOCK_CLOSE(psock)
 Close a protosocket.
#define PSOCK_READBUF(psock)
 Read data until the buffer is full.
#define PSOCK_READTO(psock, c)
 Read data up to a specified character.
#define PSOCK_DATALEN(psock)
 The length of the data that was previously read.
#define PSOCK_EXIT(psock)
 Exit the protosocket's protothread.
#define PSOCK_CLOSE_EXIT(psock)
 Close a protosocket and exit the protosocket's protothread.
#define PSOCK_END(psock)
 Declare the end of a protosocket's protothread.
#define PSOCK_NEWDATA(psock)
 Check if new data has arrived on a protosocket.
#define PSOCK_WAIT_UNTIL(psock, condition)
 Wait until a condition is true.
-#define PSOCK_WAIT_THREAD(psock, condition)   PT_WAIT_THREAD(&((psock)->pt), (condition))

Functions

-u16_t psock_datalen (struct psock *psock)
-char psock_newdata (struct psock *s)
-


Define Documentation

-

- - - - -
- - - - - - - - - -
#define PSOCK_BEGIN ( psock   ) 
-
- - - - - -
-   - - -

-Start the protosocket protothread in a function. -

-This macro starts the protothread associated with the protosocket and must come before other protosocket calls in the function it is used.

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket to be started.
-
-
Examples:
-hello-world.c, and smtp.c.
-

-Definition at line 158 of file psock.h.

-

- - - - -
- - - - - - - - - -
#define PSOCK_CLOSE ( psock   ) 
-
- - - - - -
-   - - -

-Close a protosocket. -

-This macro closes a protosocket and can only be called from within the protothread in which the protosocket lives.

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket that is to be closed.
-
-
Examples:
-hello-world.c, and smtp.c.
-

-Definition at line 235 of file psock.h.

-

- - - - -
- - - - - - - - - -
#define PSOCK_CLOSE_EXIT ( psock   ) 
-
- - - - - -
-   - - -

-Close a protosocket and exit the protosocket's protothread. -

-This macro closes a protosocket and exits the protosocket's protothread.

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket.
-
- -

-Definition at line 308 of file psock.h.

-

- - - - -
- - - - - - - - - -
#define PSOCK_DATALEN ( psock   ) 
-
- - - - - -
-   - - -

-The length of the data that was previously read. -

-This macro returns the length of the data that was previously read using PSOCK_READTO() or PSOCK_READ().

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket holding the data.
-
- -

-Definition at line 281 of file psock.h.

-

- - - - -
- - - - - - - - - -
#define PSOCK_END ( psock   ) 
-
- - - - - -
-   - - -

-Declare the end of a protosocket's protothread. -

-This macro is used for declaring that the protosocket's protothread ends. It must always be used together with a matching PSOCK_BEGIN() macro.

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket.
-
-
Examples:
-hello-world.c, and smtp.c.
-

-Definition at line 325 of file psock.h.

-

- - - - -
- - - - - - - - - -
#define PSOCK_EXIT ( psock   ) 
-
- - - - - -
-   - - -

-Exit the protosocket's protothread. -

-This macro terminates the protothread of the protosocket and should almost always be used in conjunction with PSOCK_CLOSE().

-

See also:
PSOCK_CLOSE_EXIT()
-
Parameters:
- - -
psock (struct psock *) A pointer to the protosocket.
-
-
Examples:
-smtp.c.
-

-Definition at line 297 of file psock.h.

-

- - - - -
- - - - - - - - - - - - - - - -
#define PSOCK_GENERATOR_SEND ( psock,
generator,
arg   ) 
-
- - - - - -
-   - - -

-Generate data with a function and send it. -

-

Parameters:
- - - - -
psock Pointer to the protosocket.
generator Pointer to the generator function
arg Argument to the generator function
-
-This function generates data and sends it over the protosocket. This can be used to dynamically generate data for a transmission, instead of generating the data in a buffer beforehand. This function reduces the need for buffer memory. The generator function is implemented by the application, and a pointer to the function is given as an argument with the call to PSOCK_GENERATOR_SEND().

-The generator function should place the generated data directly in the uip_appdata buffer, and return the length of the generated data. The generator function is called by the protosocket layer when the data first is sent, and once for every retransmission that is needed. -

-Definition at line 219 of file psock.h.

-

- - - - -
- - - - - - - - - - - - - - - -
#define PSOCK_INIT ( psock,
buffer,
buffersize   ) 
-
- - - - - -
-   - - -

-Initialize a protosocket. -

-This macro initializes a protosocket and must be called before the protosocket is used. The initialization also specifies the input buffer for the protosocket.

-

Parameters:
- - - - -
psock (struct psock *) A pointer to the protosocket to be initialized
buffer (char *) A pointer to the input buffer for the protosocket.
buffersize (unsigned int) The size of the input buffer.
-
-
Examples:
-hello-world.c, and smtp.c.
-

-Definition at line 144 of file psock.h. -

-Referenced by hello_world_appcall(), httpd_appcall(), and smtp_send().

-

- - - - -
- - - - - - - - - -
#define PSOCK_NEWDATA ( psock   ) 
-
- - - - - -
-   - - -

-Check if new data has arrived on a protosocket. -

-This macro is used in conjunction with the PSOCK_WAIT_UNTIL() macro to check if data has arrived on a protosocket.

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket.
-
- -

-Definition at line 339 of file psock.h.

-

- - - - -
- - - - - - - - - -
#define PSOCK_READBUF ( psock   ) 
-
- - - - - -
-   - - -

-Read data until the buffer is full. -

-This macro will block waiting for data and read the data into the input buffer specified with the call to PSOCK_INIT(). Data is read until the buffer is full..

-

Parameters:
- - -
psock (struct psock *) A pointer to the protosocket from which data should be read.
-
- -

-Definition at line 250 of file psock.h.

-

- - - - -
- - - - - - - - - - - - -
#define PSOCK_READTO ( psock,
c   ) 
-
- - - - - -
-   - - -

-Read data up to a specified character. -

-This macro will block waiting for data and read the data into the input buffer specified with the call to PSOCK_INIT(). Data is only read until the specifieed character appears in the data stream.

-

Parameters:
- - - -
psock (struct psock *) A pointer to the protosocket from which data should be read.
c (char) The character at which to stop reading.
-
-
Examples:
-hello-world.c, and smtp.c.
-

-Definition at line 268 of file psock.h.

-

- - - - -
- - - - - - - - - - - - - - - -
#define PSOCK_SEND ( psock,
data,
datalen   ) 
-
- - - - - -
-   - - -

-Send data. -

-This macro sends data over a protosocket. The protosocket protothread blocks until all data has been sent and is known to have been received by the remote end of the TCP connection.

-

Parameters:
- - - - -
psock (struct psock *) A pointer to the protosocket over which data is to be sent.
data (char *) A pointer to the data that is to be sent.
datalen (unsigned int) The length of the data that is to be sent.
-
-
Examples:
-smtp.c.
-

-Definition at line 178 of file psock.h.

-

- - - - -
- - - - - - - - - - - - -
#define PSOCK_SEND_STR ( psock,
str   ) 
-
- - - - - -
-   - - -

-Send a null-terminated string. -

-

Parameters:
- - - -
psock Pointer to the protosocket.
str The string to be sent.
-
-This function sends a null-terminated string over the protosocket.
Examples:
-hello-world.c, and smtp.c.
-

-Definition at line 191 of file psock.h.

-

- - - - -
- - - - - - - - - - - - -
#define PSOCK_WAIT_UNTIL ( psock,
condition   ) 
-
- - - - - -
-   - - -

-Wait until a condition is true. -

-This macro blocks the protothread until the specified condition is true. The macro PSOCK_NEWDATA() can be used to check if new data arrives when the protosocket is waiting.

-Typically, this macro is used as follows:

-

 PT_THREAD(thread(struct psock *s, struct timer *t))
- {
-   PSOCK_BEGIN(s);
-
-   PSOCK_WAIT_UNTIL(s, PSOCK_NEWADATA(s) || timer_expired(t));
-   
-   if(PSOCK_NEWDATA(s)) {
-     PSOCK_READTO(s, '\n');
-   } else {
-     handle_timed_out(s);
-   }
-   
-   PSOCK_END(s);
- }
-

-

Parameters:
- - - -
psock (struct psock *) A pointer to the protosocket.
condition The condition to wait for.
-
- -

-Definition at line 372 of file psock.h.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00159.html b/components/net/uip/doc/html/a00159.html deleted file mode 100644 index 3564fa91a1..0000000000 --- a/components/net/uip/doc/html/a00159.html +++ /dev/null @@ -1,251 +0,0 @@ - - -uIP 1.0: Memory block management functions - - - - - -

Memory block management functions


Detailed Description

-The memory block allocation routines provide a simple yet powerful set of functions for managing a set of memory blocks of fixed size. -

-A set of memory blocks is statically declared with the MEMB() macro. Memory blocks are allocated from the declared memory by the memb_alloc() function, and are deallocated with the memb_free() function.

-

Note:
Because of namespace clashes only one MEMB() can be declared per C module, and the name scope of a MEMB() memory block is local to each C module.
-The following example shows how to declare and use a memory block called "cmem" which has 8 chunks of memory with each memory chunk being 20 bytes large. -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - -

Files

file  memb.c
 Memory block allocation routines.
file  memb.h
 Memory block allocation routines.

Data Structures

struct  memb_blocks

Defines

-#define MEMB_CONCAT2(s1, s2)   s1##s2
-#define MEMB_CONCAT(s1, s2)   MEMB_CONCAT2(s1, s2)
#define MEMB(name, structure, num)
 Declare a memory block.

Functions

void memb_init (struct memb_blocks *m)
 Initialize a memory block that was declared with MEMB().
void * memb_alloc (struct memb_blocks *m)
 Allocate a memory block from a block of memory declared with MEMB().
char memb_free (struct memb_blocks *m, void *ptr)
 Deallocate a memory block from a memory block previously declared with MEMB().
-


Define Documentation

-

- - - - -
- - - - - - - - - - - - - - - -
#define MEMB ( name,
structure,
num   ) 
-
- - - - - -
-   - - -

-Value:

static char MEMB_CONCAT(name,_memb_count)[num]; \
-        static structure MEMB_CONCAT(name,_memb_mem)[num]; \
-        static struct memb_blocks name = {sizeof(structure), num, \
-                                          MEMB_CONCAT(name,_memb_count), \
-                                          (void *)MEMB_CONCAT(name,_memb_mem)}
-
Declare a memory block. -

-This macro is used to staticall declare a block of memory that can be used by the block allocation functions. The macro statically declares a C array with a size that matches the specified number of blocks and their individual sizes.

-Example:

MEMB(connections, sizeof(struct connection), 16);
-

-

Parameters:
- - - - -
name The name of the memory block (later used with memb_init(), memb_alloc() and memb_free()).
size The size of each memory chunk, in bytes.
num The total number of memory chunks in the block.
-
-
Examples:
-telnetd.c.
-

-Definition at line 98 of file memb.h.

-


Function Documentation

-

- - - - -
- - - - - - - - - -
void * memb_alloc ( struct memb_blocks *  m  ) 
-
- - - - - -
-   - - -

-Allocate a memory block from a block of memory declared with MEMB(). -

-

Parameters:
- - -
m A memory block previosly declared with MEMB().
-
-
Examples:
-telnetd.c.
-

-Definition at line 59 of file memb.c. -

-References memb_blocks::count, memb_blocks::mem, memb_blocks::num, and memb_blocks::size.

-

- - - - -
- - - - - - - - - - - - - - - - - - -
char memb_free ( struct memb_blocks *  m,
void *  ptr
) 
-
- - - - - -
-   - - -

-Deallocate a memory block from a memory block previously declared with MEMB(). -

-

Parameters:
- - - -
m m A memory block previosly declared with MEMB().
ptr A pointer to the memory block that is to be deallocated.
-
-
Returns:
The new reference count for the memory block (should be 0 if successfully deallocated) or -1 if the pointer "ptr" did not point to a legal memory block.
-
Examples:
-telnetd.c.
-

-Definition at line 79 of file memb.c. -

-References memb_blocks::count, memb_blocks::mem, and memb_blocks::size.

-

- - - - -
- - - - - - - - - -
void memb_init ( struct memb_blocks *  m  ) 
-
- - - - - -
-   - - -

-Initialize a memory block that was declared with MEMB(). -

-

Parameters:
- - -
m A memory block previosly declared with MEMB().
-
-
Examples:
-telnetd.c.
-

-Definition at line 52 of file memb.c. -

-References memb_blocks::count, memb_blocks::mem, memb_blocks::num, and memb_blocks::size.

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00160.html b/components/net/uip/doc/html/a00160.html deleted file mode 100644 index ffd42f9d8a..0000000000 --- a/components/net/uip/doc/html/a00160.html +++ /dev/null @@ -1,284 +0,0 @@ - - -uIP 1.0: DNS resolver - - - - - -

DNS resolver
- -[Applications] -


Detailed Description

-The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address. -

-It maintains a list of resolved hostnames that can be queried with the resolv_lookup() function. New hostnames can be resolved using the resolv_query() function.

-When a hostname has been resolved (or found to be non-existant), the resolver code calls a callback function called resolv_found() that must be implemented by the module that uses the resolver. -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  resolv.h
 DNS resolver code header file.
file  resolv.c
 DNS host name to IP address resolver.

Defines

-#define UIP_UDP_APPCALL   resolv_appcall
-#define NULL   (void *)0
-#define MAX_RETRIES   8
-#define RESOLV_ENTRIES   4

Functions

-void resolv_appcall (void)
void resolv_found (char *name, u16_t *ipaddr)
 Callback function which is called when a hostname is found.
void resolv_conf (u16_t *dnsserver)
 Configure which DNS server to use for queries.
u16_t * resolv_getserver (void)
 Obtain the currently configured DNS server.
-void resolv_init (void)
 Initalize the resolver.
u16_t * resolv_lookup (char *name)
 Look up a hostname in the array of known hostnames.
void resolv_query (char *name)
 Queues a name so that a question for the name will be sent out.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void resolv_conf ( u16_t *  dnsserver  ) 
-
- - - - - -
-   - - -

-Configure which DNS server to use for queries. -

-

Parameters:
- - -
dnsserver A pointer to a 4-byte representation of the IP address of the DNS server to be configured.
-
-
Examples:
-resolv.c, and resolv.h.
-

-Definition at line 438 of file resolv.c. -

-References HTONS, NULL, uip_udp_new(), and uip_udp_remove.

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void resolv_found ( char *  name,
u16_t *  ipaddr
) 
-
- - - - - -
-   - - -

-Callback function which is called when a hostname is found. -

-This function must be implemented by the module that uses the DNS resolver. It is called when a hostname is found, or when a hostname was not found.

-

Parameters:
- - - -
name A pointer to the name that was looked up.
ipaddr A pointer to a 4-byte array containing the IP address of the hostname, or NULL if the hostname could not be found.
-
-
Examples:
-resolv.c, and resolv.h.
-

- - - - -
- - - - - - - - - -
u16_t * resolv_getserver ( void   ) 
-
- - - - - -
-   - - -

-Obtain the currently configured DNS server. -

-

Returns:
A pointer to a 4-byte representation of the IP address of the currently configured DNS server or NULL if no DNS server has been configured.
-
Examples:
-resolv.c, and resolv.h.
-

-Definition at line 422 of file resolv.c. -

-References NULL, and uip_udp_conn::ripaddr.

-

- - - - -
- - - - - - - - - -
u16_t * resolv_lookup ( char *  name  ) 
-
- - - - - -
-   - - -

-Look up a hostname in the array of known hostnames. -

-

Note:
This function only looks in the internal array of known hostnames, it does not send out a query for the hostname if none was found. The function resolv_query() can be used to send a query for a hostname.
-
Returns:
A pointer to a 4-byte representation of the hostname's IP address, or NULL if the hostname was not found in the array of hostnames.
-
Examples:
-resolv.c, resolv.h, and webclient.c.
-

-Definition at line 396 of file resolv.c. -

-References RESOLV_ENTRIES, and STATE_DONE. -

-Referenced by webclient_appcall(), and webclient_get().

-

- - - - -
- - - - - - - - - -
void resolv_query ( char *  name  ) 
-
- - - - - -
-   - - -

-Queues a name so that a question for the name will be sent out. -

-

Parameters:
- - -
name The hostname that is to be queried.
-
-
Examples:
-resolv.c, resolv.h, and webclient.c.
-

-Definition at line 350 of file resolv.c. -

-References RESOLV_ENTRIES, and STATE_UNUSED. -

-Referenced by webclient_appcall().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00161.html b/components/net/uip/doc/html/a00161.html deleted file mode 100644 index 16d6fbb919..0000000000 --- a/components/net/uip/doc/html/a00161.html +++ /dev/null @@ -1,257 +0,0 @@ - - -uIP 1.0: SMTP E-mail sender - - - - - -

SMTP E-mail sender
- -[Applications] -


Detailed Description

-The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is the standard way of sending and transfering e-mail on the Internet. -

-This simple example implementation is intended as an example of how to implement protocols in uIP, and is able to send out e-mail but has not been extensively tested. -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  smtp.h
 SMTP header file.
file  smtp.c
 SMTP example implementation.

Data Structures

struct  smtp_state

Defines

-#define SMTP_ERR_OK   0
 Error number that signifies a non-error condition.
-#define SMTP_SEND(to, cc, from, subject, msg)   smtp_send(to, cc, from, subject, msg, strlen(msg))
-#define ISO_nl   0x0a
-#define ISO_cr   0x0d
-#define ISO_period   0x2e
-#define ISO_2   0x32
-#define ISO_3   0x33
-#define ISO_4   0x34
-#define ISO_5   0x35

Functions

void smtp_done (unsigned char error)
 Callback function that is called when an e-mail transmission is done.
-void smtp_init (void)
-void smtp_appcall (void)
void smtp_configure (char *lhostname, void *server)
 Specificy an SMTP server and hostname.
unsigned char smtp_send (char *to, char *cc, char *from, char *subject, char *msg, u16_t msglen)
 Send an e-mail.
-


Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void smtp_configure ( char *  lhostname,
void *  server
) 
-
- - - - - -
-   - - -

-Specificy an SMTP server and hostname. -

-This function is used to configure the SMTP module with an SMTP server and the hostname of the host.

-

Parameters:
- - - -
lhostname The hostname of the uIP host.
server A pointer to a 4-byte array representing the IP address of the SMTP server to be configured.
-
- -

-Definition at line 216 of file smtp.c. -

-References uip_ipaddr_copy.

-

- - - - -
- - - - - - - - - -
void smtp_done ( unsigned char  error  ) 
-
- - - - - -
-   - - -

-Callback function that is called when an e-mail transmission is done. -

-This function must be implemented by the module that uses the SMTP module.

-

Parameters:
- - -
error The number of the error if an error occured, or SMTP_ERR_OK.
-
-
Examples:
-smtp.c, and smtp.h.
-

-Referenced by smtp_appcall().

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char smtp_send ( char *  to,
char *  cc,
char *  from,
char *  subject,
char *  msg,
u16_t  msglen
) 
-
- - - - - -
-   - - -

-Send an e-mail. -

-

Parameters:
- - - - - - - -
to The e-mail address of the receiver of the e-mail.
cc The e-mail address of the CC: receivers of the e-mail.
from The e-mail address of the sender of the e-mail.
subject The subject of the e-mail.
msg The actual e-mail message.
msglen The length of the e-mail message.
-
- -

-Definition at line 233 of file smtp.c. -

-References smtp_state::from, HTONS, smtp_state::msg, smtp_state::msglen, NULL, PSOCK_INIT, smtp_state::subject, smtp_state::to, and uip_connect().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00162.html b/components/net/uip/doc/html/a00162.html deleted file mode 100644 index 8fada3bd13..0000000000 --- a/components/net/uip/doc/html/a00162.html +++ /dev/null @@ -1,56 +0,0 @@ - - -uIP 1.0: Hello, world - - - - - -

Hello, world
- -[Applications] -


Detailed Description

-A small example showing how to write applications with protosockets. -

- -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - -

Files

file  hello-world.h
 Header file for an example of how to write uIP applications with protosockets.
file  hello-world.c
 An example of how to write uIP applications with protosockets.

Data Structures

struct  hello_world_state

Defines

-#define UIP_APPCALL   hello_world_appcall

Functions

-void hello_world_appcall (void)
-void hello_world_init (void)
-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00163.html b/components/net/uip/doc/html/a00163.html deleted file mode 100644 index 96515e2f4a..0000000000 --- a/components/net/uip/doc/html/a00163.html +++ /dev/null @@ -1,533 +0,0 @@ - - -uIP 1.0: Web client - - - - - -

Web client
- -[Applications] -


Detailed Description

-This example shows a HTTP client that is able to download web pages and files from web servers. -

-It requires a number of callback functions to be implemented by the module that utilizes the code: webclient_datahandler(), webclient_connected(), webclient_timedout(), webclient_aborted(), webclient_closed(). -

- - - - - - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  webclient.h
 Header file for the HTTP client.
file  webclient.c
 Implementation of the HTTP client.

Data Structures

struct  webclient_state

Defines

-#define WEBCLIENT_CONF_MAX_URLLEN   100
-#define UIP_APPCALL   webclient_appcall
-#define WEBCLIENT_TIMEOUT   100
-#define WEBCLIENT_STATE_STATUSLINE   0
-#define WEBCLIENT_STATE_HEADERS   1
-#define WEBCLIENT_STATE_DATA   2
-#define WEBCLIENT_STATE_CLOSE   3
-#define HTTPFLAG_NONE   0
-#define HTTPFLAG_OK   1
-#define HTTPFLAG_MOVED   2
-#define HTTPFLAG_ERROR   3
-#define ISO_nl   0x0a
-#define ISO_cr   0x0d
-#define ISO_space   0x20

Typedefs

-typedef webclient_state uip_tcp_appstate_t

Functions

void webclient_datahandler (char *data, u16_t len)
 Callback function that is called from the webclient code when HTTP data has been received.
void webclient_connected (void)
 Callback function that is called from the webclient code when the HTTP connection has been connected to the web server.
void webclient_timedout (void)
 Callback function that is called from the webclient code if the HTTP connection to the web server has timed out.
void webclient_aborted (void)
 Callback function that is called from the webclient code if the HTTP connection to the web server has been aborted by the web server.
void webclient_closed (void)
 Callback function that is called from the webclient code when the HTTP connection to the web server has been closed.
-void webclient_init (void)
 Initialize the webclient module.
unsigned char webclient_get (char *host, u16_t port, char *file)
 Open an HTTP connection to a web server and ask for a file using the GET method.
-void webclient_close (void)
 Close the currently open HTTP connection.
-void webclient_appcall (void)
char * webclient_mimetype (void)
 Obtain the MIME type of the current HTTP data stream.
char * webclient_filename (void)
 Obtain the filename of the current HTTP data stream.
char * webclient_hostname (void)
 Obtain the hostname of the current HTTP data stream.
unsigned short webclient_port (void)
 Obtain the port number of the current HTTP data stream.
-


Function Documentation

-

- - - - -
- - - - - - - - - -
void webclient_aborted ( void   ) 
-
- - - - - -
-   - - -

-Callback function that is called from the webclient code if the HTTP connection to the web server has been aborted by the web server. -

-This function must be implemented by the module that uses the webclient code.

Examples:
-webclient.c, and webclient.h.
-

-Referenced by webclient_appcall().

-

- - - - -
- - - - - - - - - -
void webclient_closed ( void   ) 
-
- - - - - -
-   - - -

-Callback function that is called from the webclient code when the HTTP connection to the web server has been closed. -

-This function must be implemented by the module that uses the webclient code.

Examples:
-webclient.c, and webclient.h.
-

-Referenced by webclient_appcall().

-

- - - - -
- - - - - - - - - -
void webclient_connected ( void   ) 
-
- - - - - -
-   - - -

-Callback function that is called from the webclient code when the HTTP connection has been connected to the web server. -

-This function must be implemented by the module that uses the webclient code.

Examples:
-webclient.c, and webclient.h.
-

-Referenced by webclient_appcall().

-

- - - - -
- - - - - - - - - - - - - - - - - - -
void webclient_datahandler ( char *  data,
u16_t  len
) 
-
- - - - - -
-   - - -

-Callback function that is called from the webclient code when HTTP data has been received. -

-This function must be implemented by the module that uses the webclient code. The function is called from the webclient module when HTTP data has been received. The function is not called when HTTP headers are received, only for the actual data.

-

Note:
This function is called many times, repetedly, when data is being received, and not once when all data has been received.
-
Parameters:
- - - -
data A pointer to the data that has been received.
len The length of the data that has been received.
-
-
Examples:
-webclient.c, and webclient.h.
-

-Referenced by webclient_appcall().

-

- - - - -
- - - - - - - - - -
char * webclient_filename ( void   ) 
-
- - - - - -
-   - - -

-Obtain the filename of the current HTTP data stream. -

-The filename of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with webclient_get(). This function is used for obtaining the current filename.

-

Returns:
A pointer to the current filename.
-
Examples:
-webclient.c, and webclient.h.
-

-Definition at line 93 of file webclient.c. -

-References webclient_state::file.

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
unsigned char webclient_get ( char *  host,
u16_t  port,
char *  file
) 
-
- - - - - -
-   - - -

-Open an HTTP connection to a web server and ask for a file using the GET method. -

-This function opens an HTTP connection to the specified web server and requests the specified file using the GET method. When the HTTP connection has been connected, the webclient_connected() callback function is called and when the HTTP data arrives the webclient_datahandler() callback function is called.

-The callback function webclient_timedout() is called if the web server could not be contacted, and the webclient_aborted() callback function is called if the HTTP connection is aborted by the web server.

-When the HTTP request has been completed and the HTTP connection is closed, the webclient_closed() callback function will be called.

-

Note:
If the function is passed a host name, it must already be in the resolver cache in order for the function to connect to the web server. It is therefore up to the calling module to implement the resolver calls and the signal handler used for reporting a resolv query answer.
-
Parameters:
- - - - -
host A pointer to a string containing either a host name or a numerical IP address in dotted decimal notation (e.g., 192.168.23.1).
port The port number to which to connect, in host byte order.
file A pointer to the name of the file to get.
-
-
Return values:
- - - -
0 if the host name could not be found in the cache, or if a TCP connection could not be created.
1 if the connection was initiated.
-
-
Examples:
-webclient.c, and webclient.h.
-

-Definition at line 140 of file webclient.c. -

-References webclient_state::file, webclient_state::host, htons(), NULL, webclient_state::port, resolv_lookup(), and uip_connect(). -

-Referenced by webclient_appcall().

-

- - - - -
- - - - - - - - - -
char * webclient_hostname ( void   ) 
-
- - - - - -
-   - - -

-Obtain the hostname of the current HTTP data stream. -

-The hostname of the web server of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with webclient_get(). This function is used for obtaining the current hostname.

-

Returns:
A pointer to the current hostname.
-
Examples:
-webclient.c, and webclient.h.
-

-Definition at line 99 of file webclient.c. -

-References webclient_state::host.

-

- - - - -
- - - - - - - - - -
char * webclient_mimetype ( void   ) 
-
- - - - - -
-   - - -

-Obtain the MIME type of the current HTTP data stream. -

-

Returns:
A pointer to a string contaning the MIME type. The string may be empty if no MIME type was reported by the web server.
-
Examples:
-webclient.c, and webclient.h.
-

-Definition at line 87 of file webclient.c. -

-References webclient_state::mimetype.

-

- - - - -
- - - - - - - - - -
unsigned short webclient_port ( void   ) 
-
- - - - - -
-   - - -

-Obtain the port number of the current HTTP data stream. -

-The port number of an HTTP request may be changed by the web server, and may therefore not be the same as when the original GET request was made with webclient_get(). This function is used for obtaining the current port number.

-

Returns:
The port number of the current HTTP data stream, in host byte order.
-
Examples:
-webclient.c, and webclient.h.
-

-Definition at line 105 of file webclient.c. -

-References webclient_state::port.

-

- - - - -
- - - - - - - - - -
void webclient_timedout ( void   ) 
-
- - - - - -
-   - - -

-Callback function that is called from the webclient code if the HTTP connection to the web server has timed out. -

-This function must be implemented by the module that uses the webclient code.

Examples:
-webclient.c, and webclient.h.
-

-Referenced by webclient_appcall().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00164.html b/components/net/uip/doc/html/a00164.html deleted file mode 100644 index 67c80c7012..0000000000 --- a/components/net/uip/doc/html/a00164.html +++ /dev/null @@ -1,172 +0,0 @@ - - -uIP 1.0: Web server - - - - - -

Web server
- -[Applications] -


Detailed Description

-The uIP web server is a very simplistic implementation of an HTTP server. -

-It can serve web pages and files from a read-only ROM filesystem, and provides a very small scripting language. -

- - - - - - - -

-

- - - -

-

- - - -

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Files

file  httpd-cgi.h
 Web server script interface header file.
file  httpd-cgi.c
 Web server script interface.
file  httpd.c
 Web server.

Data Structures

struct  httpd_cgi_call

Defines

#define HTTPD_CGI_CALL(name, str, function)
 HTTPD CGI function declaration.
-#define STATE_WAITING   0
-#define STATE_OUTPUT   1
-#define ISO_nl   0x0a
-#define ISO_space   0x20
-#define ISO_bang   0x21
-#define ISO_percent   0x25
-#define ISO_period   0x2e
-#define ISO_slash   0x2f
-#define ISO_colon   0x3a

Functions

-httpd_cgifunction httpd_cgi (char *name)
-void httpd_appcall (void)
void httpd_init (void)
 Initialize the web server.
-


Define Documentation

-

- - - - -
- - - - - - - - - - - - - - - -
#define HTTPD_CGI_CALL ( name,
str,
function   ) 
-
- - - - - -
-   - - -

-HTTPD CGI function declaration. -

-

Parameters:
- - - - -
name The C variable name of the function
str The string name of the function, used in the script file
function A pointer to the function that implements it
-
-This macro is used for declaring a HTTPD CGI function. This function is then added to the list of HTTPD CGI functions with the httpd_cgi_add() function. -

-Definition at line 77 of file httpd-cgi.h.

-


Function Documentation

-

- - - - -
- - - - - - - - - -
void httpd_init ( void   ) 
-
- - - - - -
-   - - -

-Initialize the web server. -

-This function initializes the web server and should be called at system boot-up. -

-Definition at line 333 of file httpd.c. -

-References HTONS, and uip_listen().

-


Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00168.html b/components/net/uip/doc/html/a00168.html deleted file mode 100644 index 955e16759a..0000000000 --- a/components/net/uip/doc/html/a00168.html +++ /dev/null @@ -1,381 +0,0 @@ - - -uIP 1.0: apps/dhcpc/dhcpc.c Source File - - - - - - -

apps/dhcpc/dhcpc.c

00001 /*
-00002  * Copyright (c) 2005, Swedish Institute of Computer Science
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * @(#)$Id: dhcpc.c,v 1.2 2006/06/11 21:46:37 adam Exp $
-00032  */
-00033 
-00034 #include <stdio.h>
-00035 #include <string.h>
-00036 
-00037 #include "uip.h"
-00038 #include "dhcpc.h"
-00039 #include "timer.h"
-00040 #include "pt.h"
-00041 
-00042 #define STATE_INITIAL         0
-00043 #define STATE_SENDING         1
-00044 #define STATE_OFFER_RECEIVED  2
-00045 #define STATE_CONFIG_RECEIVED 3
-00046 
-00047 static struct dhcpc_state s;
-00048 
-00049 struct dhcp_msg {
-00050   u8_t op, htype, hlen, hops;
-00051   u8_t xid[4];
-00052   u16_t secs, flags;
-00053   u8_t ciaddr[4];
-00054   u8_t yiaddr[4];
-00055   u8_t siaddr[4];
-00056   u8_t giaddr[4];
-00057   u8_t chaddr[16];
-00058 #ifndef UIP_CONF_DHCP_LIGHT
-00059   u8_t sname[64];
-00060   u8_t file[128];
-00061 #endif
-00062   u8_t options[312];
-00063 };
-00064 
-00065 #define BOOTP_BROADCAST 0x8000
-00066 
-00067 #define DHCP_REQUEST        1
-00068 #define DHCP_REPLY          2
-00069 #define DHCP_HTYPE_ETHERNET 1
-00070 #define DHCP_HLEN_ETHERNET  6
-00071 #define DHCP_MSG_LEN      236
-00072 
-00073 #define DHCPC_SERVER_PORT  67
-00074 #define DHCPC_CLIENT_PORT  68
-00075 
-00076 #define DHCPDISCOVER  1
-00077 #define DHCPOFFER     2
-00078 #define DHCPREQUEST   3
-00079 #define DHCPDECLINE   4
-00080 #define DHCPACK       5
-00081 #define DHCPNAK       6
-00082 #define DHCPRELEASE   7
-00083 
-00084 #define DHCP_OPTION_SUBNET_MASK   1
-00085 #define DHCP_OPTION_ROUTER        3
-00086 #define DHCP_OPTION_DNS_SERVER    6
-00087 #define DHCP_OPTION_REQ_IPADDR   50
-00088 #define DHCP_OPTION_LEASE_TIME   51
-00089 #define DHCP_OPTION_MSG_TYPE     53
-00090 #define DHCP_OPTION_SERVER_ID    54
-00091 #define DHCP_OPTION_REQ_LIST     55
-00092 #define DHCP_OPTION_END         255
-00093 
-00094 static const u8_t xid[4] = {0xad, 0xde, 0x12, 0x23};
-00095 static const u8_t magic_cookie[4] = {99, 130, 83, 99};
-00096 /*---------------------------------------------------------------------------*/
-00097 static u8_t *
-00098 add_msg_type(u8_t *optptr, u8_t type)
-00099 {
-00100   *optptr++ = DHCP_OPTION_MSG_TYPE;
-00101   *optptr++ = 1;
-00102   *optptr++ = type;
-00103   return optptr;
-00104 }
-00105 /*---------------------------------------------------------------------------*/
-00106 static u8_t *
-00107 add_server_id(u8_t *optptr)
-00108 {
-00109   *optptr++ = DHCP_OPTION_SERVER_ID;
-00110   *optptr++ = 4;
-00111   memcpy(optptr, s.serverid, 4);
-00112   return optptr + 4;
-00113 }
-00114 /*---------------------------------------------------------------------------*/
-00115 static u8_t *
-00116 add_req_ipaddr(u8_t *optptr)
-00117 {
-00118   *optptr++ = DHCP_OPTION_REQ_IPADDR;
-00119   *optptr++ = 4;
-00120   memcpy(optptr, s.ipaddr, 4);
-00121   return optptr + 4;
-00122 }
-00123 /*---------------------------------------------------------------------------*/
-00124 static u8_t *
-00125 add_req_options(u8_t *optptr)
-00126 {
-00127   *optptr++ = DHCP_OPTION_REQ_LIST;
-00128   *optptr++ = 3;
-00129   *optptr++ = DHCP_OPTION_SUBNET_MASK;
-00130   *optptr++ = DHCP_OPTION_ROUTER;
-00131   *optptr++ = DHCP_OPTION_DNS_SERVER;
-00132   return optptr;
-00133 }
-00134 /*---------------------------------------------------------------------------*/
-00135 static u8_t *
-00136 add_end(u8_t *optptr)
-00137 {
-00138   *optptr++ = DHCP_OPTION_END;
-00139   return optptr;
-00140 }
-00141 /*---------------------------------------------------------------------------*/
-00142 static void
-00143 create_msg(register struct dhcp_msg *m)
-00144 {
-00145   m->op = DHCP_REQUEST;
-00146   m->htype = DHCP_HTYPE_ETHERNET;
-00147   m->hlen = s.mac_len;
-00148   m->hops = 0;
-00149   memcpy(m->xid, xid, sizeof(m->xid));
-00150   m->secs = 0;
-00151   m->flags = HTONS(BOOTP_BROADCAST); /*  Broadcast bit. */
-00152   /*  uip_ipaddr_copy(m->ciaddr, uip_hostaddr);*/
-00153   memcpy(m->ciaddr, uip_hostaddr, sizeof(m->ciaddr));
-00154   memset(m->yiaddr, 0, sizeof(m->yiaddr));
-00155   memset(m->siaddr, 0, sizeof(m->siaddr));
-00156   memset(m->giaddr, 0, sizeof(m->giaddr));
-00157   memcpy(m->chaddr, s.mac_addr, s.mac_len);
-00158   memset(&m->chaddr[s.mac_len], 0, sizeof(m->chaddr) - s.mac_len);
-00159 #ifndef UIP_CONF_DHCP_LIGHT
-00160   memset(m->sname, 0, sizeof(m->sname));
-00161   memset(m->file, 0, sizeof(m->file));
-00162 #endif
-00163 
-00164   memcpy(m->options, magic_cookie, sizeof(magic_cookie));
-00165 }
-00166 /*---------------------------------------------------------------------------*/
-00167 static void
-00168 send_discover(void)
-00169 {
-00170   u8_t *end;
-00171   struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
-00172 
-00173   create_msg(m);
-00174 
-00175   end = add_msg_type(&m->options[4], DHCPDISCOVER);
-00176   end = add_req_options(end);
-00177   end = add_end(end);
-00178 
-00179   uip_send(uip_appdata, end - (u8_t *)uip_appdata);
-00180 }
-00181 /*---------------------------------------------------------------------------*/
-00182 static void
-00183 send_request(void)
-00184 {
-00185   u8_t *end;
-00186   struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
-00187 
-00188   create_msg(m);
-00189   
-00190   end = add_msg_type(&m->options[4], DHCPREQUEST);
-00191   end = add_server_id(end);
-00192   end = add_req_ipaddr(end);
-00193   end = add_end(end);
-00194   
-00195   uip_send(uip_appdata, end - (u8_t *)uip_appdata);
-00196 }
-00197 /*---------------------------------------------------------------------------*/
-00198 static u8_t
-00199 parse_options(u8_t *optptr, int len)
-00200 {
-00201   u8_t *end = optptr + len;
-00202   u8_t type = 0;
-00203 
-00204   while(optptr < end) {
-00205     switch(*optptr) {
-00206     case DHCP_OPTION_SUBNET_MASK:
-00207       memcpy(s.netmask, optptr + 2, 4);
-00208       break;
-00209     case DHCP_OPTION_ROUTER:
-00210       memcpy(s.default_router, optptr + 2, 4);
-00211       break;
-00212     case DHCP_OPTION_DNS_SERVER:
-00213       memcpy(s.dnsaddr, optptr + 2, 4);
-00214       break;
-00215     case DHCP_OPTION_MSG_TYPE:
-00216       type = *(optptr + 2);
-00217       break;
-00218     case DHCP_OPTION_SERVER_ID:
-00219       memcpy(s.serverid, optptr + 2, 4);
-00220       break;
-00221     case DHCP_OPTION_LEASE_TIME:
-00222       memcpy(s.lease_time, optptr + 2, 4);
-00223       break;
-00224     case DHCP_OPTION_END:
-00225       return type;
-00226     }
-00227 
-00228     optptr += optptr[1] + 2;
-00229   }
-00230   return type;
-00231 }
-00232 /*---------------------------------------------------------------------------*/
-00233 static u8_t
-00234 parse_msg(void)
-00235 {
-00236   struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
-00237   
-00238   if(m->op == DHCP_REPLY &&
-00239      memcmp(m->xid, xid, sizeof(xid)) == 0 &&
-00240      memcmp(m->chaddr, s.mac_addr, s.mac_len) == 0) {
-00241     memcpy(s.ipaddr, m->yiaddr, 4);
-00242     return parse_options(&m->options[4], uip_datalen());
-00243   }
-00244   return 0;
-00245 }
-00246 /*---------------------------------------------------------------------------*/
-00247 static
-00248 PT_THREAD(handle_dhcp(void))
-00249 {
-00250   PT_BEGIN(&s.pt);
-00251   
-00252   /* try_again:*/
-00253   s.state = STATE_SENDING;
-00254   s.ticks = CLOCK_SECOND;
-00255 
-00256   do {
-00257     send_discover();
-00258     timer_set(&s.timer, s.ticks);
-00259     PT_WAIT_UNTIL(&s.pt, uip_newdata() || timer_expired(&s.timer));
-00260 
-00261     if(uip_newdata() && parse_msg() == DHCPOFFER) {
-00262       s.state = STATE_OFFER_RECEIVED;
-00263       break;
-00264     }
-00265 
-00266     if(s.ticks < CLOCK_SECOND * 60) {
-00267       s.ticks *= 2;
-00268     }
-00269   } while(s.state != STATE_OFFER_RECEIVED);
-00270   
-00271   s.ticks = CLOCK_SECOND;
-00272 
-00273   do {
-00274     send_request();
-00275     timer_set(&s.timer, s.ticks);
-00276     PT_WAIT_UNTIL(&s.pt, uip_newdata() || timer_expired(&s.timer));
-00277 
-00278     if(uip_newdata() && parse_msg() == DHCPACK) {
-00279       s.state = STATE_CONFIG_RECEIVED;
-00280       break;
-00281     }
-00282 
-00283     if(s.ticks <= CLOCK_SECOND * 10) {
-00284       s.ticks += CLOCK_SECOND;
-00285     } else {
-00286       PT_RESTART(&s.pt);
-00287     }
-00288   } while(s.state != STATE_CONFIG_RECEIVED);
-00289   
-00290 #if 0
-00291   printf("Got IP address %d.%d.%d.%d\n",
-00292          uip_ipaddr1(s.ipaddr), uip_ipaddr2(s.ipaddr),
-00293          uip_ipaddr3(s.ipaddr), uip_ipaddr4(s.ipaddr));
-00294   printf("Got netmask %d.%d.%d.%d\n",
-00295          uip_ipaddr1(s.netmask), uip_ipaddr2(s.netmask),
-00296          uip_ipaddr3(s.netmask), uip_ipaddr4(s.netmask));
-00297   printf("Got DNS server %d.%d.%d.%d\n",
-00298          uip_ipaddr1(s.dnsaddr), uip_ipaddr2(s.dnsaddr),
-00299          uip_ipaddr3(s.dnsaddr), uip_ipaddr4(s.dnsaddr));
-00300   printf("Got default router %d.%d.%d.%d\n",
-00301          uip_ipaddr1(s.default_router), uip_ipaddr2(s.default_router),
-00302          uip_ipaddr3(s.default_router), uip_ipaddr4(s.default_router));
-00303   printf("Lease expires in %ld seconds\n",
-00304          ntohs(s.lease_time[0])*65536ul + ntohs(s.lease_time[1]));
-00305 #endif
-00306 
-00307   dhcpc_configured(&s);
-00308   
-00309   /*  timer_stop(&s.timer);*/
-00310 
-00311   /*
-00312    * PT_END restarts the thread so we do this instead. Eventually we
-00313    * should reacquire expired leases here.
-00314    */
-00315   while(1) {
-00316     PT_YIELD(&s.pt);
-00317   }
-00318 
-00319   PT_END(&s.pt);
-00320 }
-00321 /*---------------------------------------------------------------------------*/
-00322 void
-00323 dhcpc_init(const void *mac_addr, int mac_len)
-00324 {
-00325   uip_ipaddr_t addr;
-00326   
-00327   s.mac_addr = mac_addr;
-00328   s.mac_len  = mac_len;
-00329 
-00330   s.state = STATE_INITIAL;
-00331   uip_ipaddr(addr, 255,255,255,255);
-00332   s.conn = uip_udp_new(&addr, HTONS(DHCPC_SERVER_PORT));
-00333   if(s.conn != NULL) {
-00334     uip_udp_bind(s.conn, HTONS(DHCPC_CLIENT_PORT));
-00335   }
-00336   PT_INIT(&s.pt);
-00337 }
-00338 /*---------------------------------------------------------------------------*/
-00339 void
-00340 dhcpc_appcall(void)
-00341 {
-00342   handle_dhcp();
-00343 }
-00344 /*---------------------------------------------------------------------------*/
-00345 void
-00346 dhcpc_request(void)
-00347 {
-00348   u16_t ipaddr[2];
-00349   
-00350   if(s.state == STATE_INITIAL) {
-00351     uip_ipaddr(ipaddr, 0,0,0,0);
-00352     uip_sethostaddr(ipaddr);
-00353     /*    handle_dhcp(PROCESS_EVENT_NONE, NULL);*/
-00354   }
-00355 }
-00356 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00169.html b/components/net/uip/doc/html/a00169.html deleted file mode 100644 index c3ed91306c..0000000000 --- a/components/net/uip/doc/html/a00169.html +++ /dev/null @@ -1,93 +0,0 @@ - - -uIP 1.0: apps/dhcpc/dhcpc.h Source File - - - - - - -

apps/dhcpc/dhcpc.h

00001 /*
-00002  * Copyright (c) 2005, Swedish Institute of Computer Science
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * @(#)$Id: dhcpc.h,v 1.3 2006/06/11 21:46:37 adam Exp $
-00032  */
-00033 #ifndef __DHCPC_H__
-00034 #define __DHCPC_H__
-00035 
-00036 #include "timer.h"
-00037 #include "pt.h"
-00038 
-00039 struct dhcpc_state {
-00040   struct pt pt;
-00041   char state;
-00042   struct uip_udp_conn *conn;
-00043   struct timer timer;
-00044   u16_t ticks;
-00045   const void *mac_addr;
-00046   int mac_len;
-00047   
-00048   u8_t serverid[4];
-00049 
-00050   u16_t lease_time[2];
-00051   u16_t ipaddr[2];
-00052   u16_t netmask[2];
-00053   u16_t dnsaddr[2];
-00054   u16_t default_router[2];
-00055 };
-00056 
-00057 void dhcpc_init(const void *mac_addr, int mac_len);
-00058 void dhcpc_request(void);
-00059 
-00060 void dhcpc_appcall(void);
-00061 
-00062 void dhcpc_configured(const struct dhcpc_state *s);
-00063 
-00064 typedef struct dhcpc_state uip_udp_appstate_t;
-00065 #define UIP_UDP_APPCALL dhcpc_appcall
-00066 
-00067 
-00068 #endif /* __DHCPC_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00170.html b/components/net/uip/doc/html/a00170.html deleted file mode 100644 index 20a39c092d..0000000000 --- a/components/net/uip/doc/html/a00170.html +++ /dev/null @@ -1,125 +0,0 @@ - - -uIP 1.0: apps/hello-world/hello-world.c Source File - - - - - - -

apps/hello-world/hello-world.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup helloworld
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  *         An example of how to write uIP applications
-00009  *         with protosockets.
-00010  * \author
-00011  *         Adam Dunkels <adam@sics.se>
-00012  */
-00013 
-00014 /*
-00015  * This is a short example of how to write uIP applications using
-00016  * protosockets.
-00017  */
-00018 
-00019 /*
-00020  * We define the application state (struct hello_world_state) in the
-00021  * hello-world.h file, so we need to include it here. We also include
-00022  * uip.h (since this cannot be included in hello-world.h) and
-00023  * <string.h>, since we use the memcpy() function in the code.
-00024  */
-00025 #include "hello-world.h"
-00026 #include "uip.h"
-00027 #include <string.h>
-00028 
-00029 /*
-00030  * Declaration of the protosocket function that handles the connection
-00031  * (defined at the end of the code).
-00032  */
-00033 static int handle_connection(struct hello_world_state *s);
-00034 /*---------------------------------------------------------------------------*/
-00035 /*
-00036  * The initialization function. We must explicitly call this function
-00037  * from the system initialization code, some time after uip_init() is
-00038  * called.
-00039  */
-00040 void
-00041 hello_world_init(void)
-00042 {
-00043   /* We start to listen for connections on TCP port 1000. */
-00044   uip_listen(HTONS(1000));
-00045 }
-00046 /*---------------------------------------------------------------------------*/
-00047 /*
-00048  * In hello-world.h we have defined the UIP_APPCALL macro to
-00049  * hello_world_appcall so that this funcion is uIP's application
-00050  * function. This function is called whenever an uIP event occurs
-00051  * (e.g. when a new connection is established, new data arrives, sent
-00052  * data is acknowledged, data needs to be retransmitted, etc.).
-00053  */
-00054 void
-00055 hello_world_appcall(void)
-00056 {
-00057   /*
-00058    * The uip_conn structure has a field called "appstate" that holds
-00059    * the application state of the connection. We make a pointer to
-00060    * this to access it easier.
-00061    */
-00062   struct hello_world_state *s = &(uip_conn->appstate);
-00063 
-00064   /*
-00065    * If a new connection was just established, we should initialize
-00066    * the protosocket in our applications' state structure.
-00067    */
-00068   if(uip_connected()) {
-00069     PSOCK_INIT(&s->p, s->inputbuffer, sizeof(s->inputbuffer));
-00070   }
-00071 
-00072   /*
-00073    * Finally, we run the protosocket function that actually handles
-00074    * the communication. We pass it a pointer to the application state
-00075    * of the current connection.
-00076    */
-00077   handle_connection(s);
-00078 }
-00079 /*---------------------------------------------------------------------------*/
-00080 /*
-00081  * This is the protosocket function that handles the communication. A
-00082  * protosocket function must always return an int, but must never
-00083  * explicitly return - all return statements are hidden in the PSOCK
-00084  * macros.
-00085  */
-00086 static int
-00087 handle_connection(struct hello_world_state *s)
-00088 {
-00089   PSOCK_BEGIN(&s->p);
-00090 
-00091   PSOCK_SEND_STR(&s->p, "Hello. What is your name?\n");
-00092   PSOCK_READTO(&s->p, '\n');
-00093   strncpy(s->name, s->inputbuffer, sizeof(s->name));
-00094   PSOCK_SEND_STR(&s->p, "Hello ");
-00095   PSOCK_SEND_STR(&s->p, s->name);
-00096   PSOCK_CLOSE(&s->p);
-00097   
-00098   PSOCK_END(&s->p);
-00099 }
-00100 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00171.html b/components/net/uip/doc/html/a00171.html deleted file mode 100644 index 768f61b64b..0000000000 --- a/components/net/uip/doc/html/a00171.html +++ /dev/null @@ -1,77 +0,0 @@ - - -uIP 1.0: apps/hello-world/hello-world.h Source File - - - - - - -

apps/hello-world/hello-world.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup helloworld Hello, world
-00008  * @{
-00009  *
-00010  * A small example showing how to write applications with
-00011  * \ref psock "protosockets".
-00012  */
-00013 
-00014 /**
-00015  * \file
-00016  *         Header file for an example of how to write uIP applications
-00017  *         with protosockets.
-00018  * \author
-00019  *         Adam Dunkels <adam@sics.se>
-00020  */
-00021 
-00022 #ifndef __HELLO_WORLD_H__
-00023 #define __HELLO_WORLD_H__
-00024 
-00025 /* Since this file will be included by uip.h, we cannot include uip.h
-00026    here. But we might need to include uipopt.h if we need the u8_t and
-00027    u16_t datatypes. */
-00028 #include "uipopt.h"
-00029 
-00030 #include "psock.h"
-00031 
-00032 /* Next, we define the uip_tcp_appstate_t datatype. This is the state
-00033    of our application, and the memory required for this state is
-00034    allocated together with each TCP connection. One application state
-00035    for each TCP connection. */
-00036 typedef struct hello_world_state {
-00037   struct psock p;
-00038   char inputbuffer[10];
-00039   char name[40];
-00040 } uip_tcp_appstate_t;
-00041 
-00042 /* Finally we define the application function to be called by uIP. */
-00043 void hello_world_appcall(void);
-00044 #ifndef UIP_APPCALL
-00045 #define UIP_APPCALL hello_world_appcall
-00046 #endif /* UIP_APPCALL */
-00047 
-00048 void hello_world_init(void);
-00049 
-00050 #endif /* __HELLO_WORLD_H__ */
-00051 /** @} */
-00052 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00172.html b/components/net/uip/doc/html/a00172.html deleted file mode 100644 index 1bf08f6dc3..0000000000 --- a/components/net/uip/doc/html/a00172.html +++ /dev/null @@ -1,489 +0,0 @@ - - -uIP 1.0: apps/resolv/resolv.c Source File - - - - - - -

apps/resolv/resolv.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup resolv DNS resolver
-00008  * @{
-00009  *
-00010  * The uIP DNS resolver functions are used to lookup a hostname and
-00011  * map it to a numerical IP address. It maintains a list of resolved
-00012  * hostnames that can be queried with the resolv_lookup()
-00013  * function. New hostnames can be resolved using the resolv_query()
-00014  * function.
-00015  *
-00016  * When a hostname has been resolved (or found to be non-existant),
-00017  * the resolver code calls a callback function called resolv_found()
-00018  * that must be implemented by the module that uses the resolver.
-00019  */
-00020 
-00021 /**
-00022  * \file
-00023  * DNS host name to IP address resolver.
-00024  * \author Adam Dunkels <adam@dunkels.com>
-00025  *
-00026  * This file implements a DNS host name to IP address resolver.
-00027  */
-00028 
-00029 /*
-00030  * Copyright (c) 2002-2003, Adam Dunkels.
-00031  * All rights reserved.
-00032  *
-00033  * Redistribution and use in source and binary forms, with or without
-00034  * modification, are permitted provided that the following conditions
-00035  * are met:
-00036  * 1. Redistributions of source code must retain the above copyright
-00037  *    notice, this list of conditions and the following disclaimer.
-00038  * 2. Redistributions in binary form must reproduce the above copyright
-00039  *    notice, this list of conditions and the following disclaimer in the
-00040  *    documentation and/or other materials provided with the distribution.
-00041  * 3. The name of the author may not be used to endorse or promote
-00042  *    products derived from this software without specific prior
-00043  *    written permission.
-00044  *
-00045  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00046  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00047  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00048  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00049  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00050  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00051  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00052  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00053  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00054  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00055  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00056  *
-00057  * This file is part of the uIP TCP/IP stack.
-00058  *
-00059  * $Id: resolv.c,v 1.5 2006/06/11 21:46:37 adam Exp $
-00060  *
-00061  */
-00062 
-00063 #include "resolv.h"
-00064 #include "uip.h"
-00065 
-00066 #include <string.h>
-00067 
-00068 #ifndef NULL
-00069 #define NULL (void *)0
-00070 #endif /* NULL */
-00071 
-00072 /** \internal The maximum number of retries when asking for a name. */
-00073 #define MAX_RETRIES 8
-00074 
-00075 /** \internal The DNS message header. */
-00076 struct dns_hdr {
-00077   u16_t id;
-00078   u8_t flags1, flags2;
-00079 #define DNS_FLAG1_RESPONSE        0x80
-00080 #define DNS_FLAG1_OPCODE_STATUS   0x10
-00081 #define DNS_FLAG1_OPCODE_INVERSE  0x08
-00082 #define DNS_FLAG1_OPCODE_STANDARD 0x00
-00083 #define DNS_FLAG1_AUTHORATIVE     0x04
-00084 #define DNS_FLAG1_TRUNC           0x02
-00085 #define DNS_FLAG1_RD              0x01
-00086 #define DNS_FLAG2_RA              0x80
-00087 #define DNS_FLAG2_ERR_MASK        0x0f
-00088 #define DNS_FLAG2_ERR_NONE        0x00
-00089 #define DNS_FLAG2_ERR_NAME        0x03
-00090   u16_t numquestions;
-00091   u16_t numanswers;
-00092   u16_t numauthrr;
-00093   u16_t numextrarr;
-00094 };
-00095 
-00096 /** \internal The DNS answer message structure. */
-00097 struct dns_answer {
-00098   /* DNS answer record starts with either a domain name or a pointer
-00099      to a name already present somewhere in the packet. */
-00100   u16_t type;
-00101   u16_t class;
-00102   u16_t ttl[2];
-00103   u16_t len;
-00104   uip_ipaddr_t ipaddr;
-00105 };
-00106 
-00107 struct namemap {
-00108 #define STATE_UNUSED 0
-00109 #define STATE_NEW    1
-00110 #define STATE_ASKING 2
-00111 #define STATE_DONE   3
-00112 #define STATE_ERROR  4
-00113   u8_t state;
-00114   u8_t tmr;
-00115   u8_t retries;
-00116   u8_t seqno;
-00117   u8_t err;
-00118   char name[32];
-00119   uip_ipaddr_t ipaddr;
-00120 };
-00121 
-00122 #ifndef UIP_CONF_RESOLV_ENTRIES
-00123 #define RESOLV_ENTRIES 4
-00124 #else /* UIP_CONF_RESOLV_ENTRIES */
-00125 #define RESOLV_ENTRIES UIP_CONF_RESOLV_ENTRIES
-00126 #endif /* UIP_CONF_RESOLV_ENTRIES */
-00127 
-00128 
-00129 static struct namemap names[RESOLV_ENTRIES];
-00130 
-00131 static u8_t seqno;
-00132 
-00133 static struct uip_udp_conn *resolv_conn = NULL;
-00134 
-00135 
-00136 /*---------------------------------------------------------------------------*/
-00137 /** \internal
-00138  * Walk through a compact encoded DNS name and return the end of it.
-00139  *
-00140  * \return The end of the name.
-00141  */
-00142 /*---------------------------------------------------------------------------*/
-00143 static unsigned char *
-00144 parse_name(unsigned char *query)
-00145 {
-00146   unsigned char n;
-00147 
-00148   do {
-00149     n = *query++;
-00150     
-00151     while(n > 0) {
-00152       /*      printf("%c", *query);*/
-00153       ++query;
-00154       --n;
-00155     };
-00156     /*    printf(".");*/
-00157   } while(*query != 0);
-00158   /*  printf("\n");*/
-00159   return query + 1;
-00160 }
-00161 /*---------------------------------------------------------------------------*/
-00162 /** \internal
-00163  * Runs through the list of names to see if there are any that have
-00164  * not yet been queried and, if so, sends out a query.
-00165  */
-00166 /*---------------------------------------------------------------------------*/
-00167 static void
-00168 check_entries(void)
-00169 {
-00170   register struct dns_hdr *hdr;
-00171   char *query, *nptr, *nameptr;
-00172   static u8_t i;
-00173   static u8_t n;
-00174   register struct namemap *namemapptr;
-00175   
-00176   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00177     namemapptr = &names[i];
-00178     if(namemapptr->state == STATE_NEW ||
-00179        namemapptr->state == STATE_ASKING) {
-00180       if(namemapptr->state == STATE_ASKING) {
-00181         if(--namemapptr->tmr == 0) {
-00182           if(++namemapptr->retries == MAX_RETRIES) {
-00183             namemapptr->state = STATE_ERROR;
-00184             resolv_found(namemapptr->name, NULL);
-00185             continue;
-00186           }
-00187           namemapptr->tmr = namemapptr->retries;
-00188         } else {
-00189           /*      printf("Timer %d\n", namemapptr->tmr);*/
-00190           /* Its timer has not run out, so we move on to next
-00191              entry. */
-00192           continue;
-00193         }
-00194       } else {
-00195         namemapptr->state = STATE_ASKING;
-00196         namemapptr->tmr = 1;
-00197         namemapptr->retries = 0;
-00198       }
-00199       hdr = (struct dns_hdr *)uip_appdata;
-00200       memset(hdr, 0, sizeof(struct dns_hdr));
-00201       hdr->id = htons(i);
-00202       hdr->flags1 = DNS_FLAG1_RD;
-00203       hdr->numquestions = HTONS(1);
-00204       query = (char *)uip_appdata + 12;
-00205       nameptr = namemapptr->name;
-00206       --nameptr;
-00207       /* Convert hostname into suitable query format. */
-00208       do {
-00209         ++nameptr;
-00210         nptr = query;
-00211         ++query;
-00212         for(n = 0; *nameptr != '.' && *nameptr != 0; ++nameptr) {
-00213           *query = *nameptr;
-00214           ++query;
-00215           ++n;
-00216         }
-00217         *nptr = n;
-00218       } while(*nameptr != 0);
-00219       {
-00220         static unsigned char endquery[] =
-00221           {0,0,1,0,1};
-00222         memcpy(query, endquery, 5);
-00223       }
-00224       uip_udp_send((unsigned char)(query + 5 - (char *)uip_appdata));
-00225       break;
-00226     }
-00227   }
-00228 }
-00229 /*---------------------------------------------------------------------------*/
-00230 /** \internal
-00231  * Called when new UDP data arrives.
-00232  */
-00233 /*---------------------------------------------------------------------------*/
-00234 static void
-00235 newdata(void)
-00236 {
-00237   char *nameptr;
-00238   struct dns_answer *ans;
-00239   struct dns_hdr *hdr;
-00240   static u8_t nquestions, nanswers;
-00241   static u8_t i;
-00242   register struct namemap *namemapptr;
-00243   
-00244   hdr = (struct dns_hdr *)uip_appdata;
-00245   /*  printf("ID %d\n", htons(hdr->id));
-00246       printf("Query %d\n", hdr->flags1 & DNS_FLAG1_RESPONSE);
-00247       printf("Error %d\n", hdr->flags2 & DNS_FLAG2_ERR_MASK);
-00248       printf("Num questions %d, answers %d, authrr %d, extrarr %d\n",
-00249       htons(hdr->numquestions),
-00250       htons(hdr->numanswers),
-00251       htons(hdr->numauthrr),
-00252       htons(hdr->numextrarr));
-00253   */
-00254 
-00255   /* The ID in the DNS header should be our entry into the name
-00256      table. */
-00257   i = htons(hdr->id);
-00258   namemapptr = &names[i];
-00259   if(i < RESOLV_ENTRIES &&
-00260      namemapptr->state == STATE_ASKING) {
-00261 
-00262     /* This entry is now finished. */
-00263     namemapptr->state = STATE_DONE;
-00264     namemapptr->err = hdr->flags2 & DNS_FLAG2_ERR_MASK;
-00265 
-00266     /* Check for error. If so, call callback to inform. */
-00267     if(namemapptr->err != 0) {
-00268       namemapptr->state = STATE_ERROR;
-00269       resolv_found(namemapptr->name, NULL);
-00270       return;
-00271     }
-00272 
-00273     /* We only care about the question(s) and the answers. The authrr
-00274        and the extrarr are simply discarded. */
-00275     nquestions = htons(hdr->numquestions);
-00276     nanswers = htons(hdr->numanswers);
-00277 
-00278     /* Skip the name in the question. XXX: This should really be
-00279        checked agains the name in the question, to be sure that they
-00280        match. */
-00281     nameptr = parse_name((char *)uip_appdata + 12) + 4;
-00282 
-00283     while(nanswers > 0) {
-00284       /* The first byte in the answer resource record determines if it
-00285          is a compressed record or a normal one. */
-00286       if(*nameptr & 0xc0) {
-00287         /* Compressed name. */
-00288         nameptr +=2;
-00289         /*      printf("Compressed anwser\n");*/
-00290       } else {
-00291         /* Not compressed name. */
-00292         nameptr = parse_name((char *)nameptr);
-00293       }
-00294 
-00295       ans = (struct dns_answer *)nameptr;
-00296       /*      printf("Answer: type %x, class %x, ttl %x, length %x\n",
-00297              htons(ans->type), htons(ans->class), (htons(ans->ttl[0])
-00298              << 16) | htons(ans->ttl[1]), htons(ans->len));*/
-00299 
-00300       /* Check for IP address type and Internet class. Others are
-00301          discarded. */
-00302       if(ans->type == HTONS(1) &&
-00303          ans->class == HTONS(1) &&
-00304          ans->len == HTONS(4)) {
-00305         /*      printf("IP address %d.%d.%d.%d\n",
-00306                htons(ans->ipaddr[0]) >> 8,
-00307                htons(ans->ipaddr[0]) & 0xff,
-00308                htons(ans->ipaddr[1]) >> 8,
-00309                htons(ans->ipaddr[1]) & 0xff);*/
-00310         /* XXX: we should really check that this IP address is the one
-00311            we want. */
-00312         namemapptr->ipaddr[0] = ans->ipaddr[0];
-00313         namemapptr->ipaddr[1] = ans->ipaddr[1];
-00314         
-00315         resolv_found(namemapptr->name, namemapptr->ipaddr);
-00316         return;
-00317       } else {
-00318         nameptr = nameptr + 10 + htons(ans->len);
-00319       }
-00320       --nanswers;
-00321     }
-00322   }
-00323 
-00324 }
-00325 /*---------------------------------------------------------------------------*/
-00326 /** \internal
-00327  * The main UDP function.
-00328  */
-00329 /*---------------------------------------------------------------------------*/
-00330 void
-00331 resolv_appcall(void)
-00332 {
-00333   if(uip_udp_conn->rport == HTONS(53)) {
-00334     if(uip_poll()) {
-00335       check_entries();
-00336     }
-00337     if(uip_newdata()) {
-00338       newdata();
-00339     }
-00340   }
-00341 }
-00342 /*---------------------------------------------------------------------------*/
-00343 /**
-00344  * Queues a name so that a question for the name will be sent out.
-00345  *
-00346  * \param name The hostname that is to be queried.
-00347  */
-00348 /*---------------------------------------------------------------------------*/
-00349 void
-00350 resolv_query(char *name)
-00351 {
-00352   static u8_t i;
-00353   static u8_t lseq, lseqi;
-00354   register struct namemap *nameptr;
-00355       
-00356   lseq = lseqi = 0;
-00357   
-00358   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00359     nameptr = &names[i];
-00360     if(nameptr->state == STATE_UNUSED) {
-00361       break;
-00362     }
-00363     if(seqno - nameptr->seqno > lseq) {
-00364       lseq = seqno - nameptr->seqno;
-00365       lseqi = i;
-00366     }
-00367   }
-00368 
-00369   if(i == RESOLV_ENTRIES) {
-00370     i = lseqi;
-00371     nameptr = &names[i];
-00372   }
-00373 
-00374   /*  printf("Using entry %d\n", i);*/
-00375 
-00376   strcpy(nameptr->name, name);
-00377   nameptr->state = STATE_NEW;
-00378   nameptr->seqno = seqno;
-00379   ++seqno;
-00380 }
-00381 /*---------------------------------------------------------------------------*/
-00382 /**
-00383  * Look up a hostname in the array of known hostnames.
-00384  *
-00385  * \note This function only looks in the internal array of known
-00386  * hostnames, it does not send out a query for the hostname if none
-00387  * was found. The function resolv_query() can be used to send a query
-00388  * for a hostname.
-00389  *
-00390  * \return A pointer to a 4-byte representation of the hostname's IP
-00391  * address, or NULL if the hostname was not found in the array of
-00392  * hostnames.
-00393  */
-00394 /*---------------------------------------------------------------------------*/
-00395 u16_t *
-00396 resolv_lookup(char *name)
-00397 {
-00398   static u8_t i;
-00399   struct namemap *nameptr;
-00400   
-00401   /* Walk through the list to see if the name is in there. If it is
-00402      not, we return NULL. */
-00403   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00404     nameptr = &names[i];
-00405     if(nameptr->state == STATE_DONE &&
-00406        strcmp(name, nameptr->name) == 0) {
-00407       return nameptr->ipaddr;
-00408     }
-00409   }
-00410   return NULL;
-00411 }
-00412 /*---------------------------------------------------------------------------*/
-00413 /**
-00414  * Obtain the currently configured DNS server.
-00415  *
-00416  * \return A pointer to a 4-byte representation of the IP address of
-00417  * the currently configured DNS server or NULL if no DNS server has
-00418  * been configured.
-00419  */
-00420 /*---------------------------------------------------------------------------*/
-00421 u16_t *
-00422 resolv_getserver(void)
-00423 {
-00424   if(resolv_conn == NULL) {
-00425     return NULL;
-00426   }
-00427   return resolv_conn->ripaddr;
-00428 }
-00429 /*---------------------------------------------------------------------------*/
-00430 /**
-00431  * Configure which DNS server to use for queries.
-00432  *
-00433  * \param dnsserver A pointer to a 4-byte representation of the IP
-00434  * address of the DNS server to be configured.
-00435  */
-00436 /*---------------------------------------------------------------------------*/
-00437 void
-00438 resolv_conf(u16_t *dnsserver)
-00439 {
-00440   if(resolv_conn != NULL) {
-00441     uip_udp_remove(resolv_conn);
-00442   }
-00443   
-00444   resolv_conn = uip_udp_new(dnsserver, HTONS(53));
-00445 }
-00446 /*---------------------------------------------------------------------------*/
-00447 /**
-00448  * Initalize the resolver.
-00449  */
-00450 /*---------------------------------------------------------------------------*/
-00451 void
-00452 resolv_init(void)
-00453 {
-00454   static u8_t i;
-00455   
-00456   for(i = 0; i < RESOLV_ENTRIES; ++i) {
-00457     names[i].state = STATE_DONE;
-00458   }
-00459 
-00460 }
-00461 /*---------------------------------------------------------------------------*/
-00462 
-00463 /** @} */
-00464 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00173.html b/components/net/uip/doc/html/a00173.html deleted file mode 100644 index 1b9f8dfb22..0000000000 --- a/components/net/uip/doc/html/a00173.html +++ /dev/null @@ -1,100 +0,0 @@ - - -uIP 1.0: apps/resolv/resolv.h Source File - - - - - - -

apps/resolv/resolv.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup resolv
-00003  * @{
-00004  */
-00005 /**
-00006  * \file
-00007  * DNS resolver code header file.
-00008  * \author Adam Dunkels <adam@dunkels.com>
-00009  */
-00010 
-00011 /*
-00012  * Copyright (c) 2002-2003, Adam Dunkels.
-00013  * All rights reserved.
-00014  *
-00015  * Redistribution and use in source and binary forms, with or without
-00016  * modification, are permitted provided that the following conditions
-00017  * are met:
-00018  * 1. Redistributions of source code must retain the above copyright
-00019  *    notice, this list of conditions and the following disclaimer.
-00020  * 2. Redistributions in binary form must reproduce the above copyright
-00021  *    notice, this list of conditions and the following disclaimer in the
-00022  *    documentation and/or other materials provided with the distribution.
-00023  * 3. The name of the author may not be used to endorse or promote
-00024  *    products derived from this software without specific prior
-00025  *    written permission.
-00026  *
-00027  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00028  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00029  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00030  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00031  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00032  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00033  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00035  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00036  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00037  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00038  *
-00039  * This file is part of the uIP TCP/IP stack.
-00040  *
-00041  * $Id: resolv.h,v 1.4 2006/06/11 21:46:37 adam Exp $
-00042  *
-00043  */
-00044 #ifndef __RESOLV_H__
-00045 #define __RESOLV_H__
-00046 
-00047 typedef int uip_udp_appstate_t;
-00048 void resolv_appcall(void);
-00049 #define UIP_UDP_APPCALL resolv_appcall
-00050 
-00051 #include "uipopt.h"
-00052 
-00053 /**
-00054  * Callback function which is called when a hostname is found.
-00055  *
-00056  * This function must be implemented by the module that uses the DNS
-00057  * resolver. It is called when a hostname is found, or when a hostname
-00058  * was not found.
-00059  *
-00060  * \param name A pointer to the name that was looked up.  \param
-00061  * ipaddr A pointer to a 4-byte array containing the IP address of the
-00062  * hostname, or NULL if the hostname could not be found.
-00063  */
-00064 void resolv_found(char *name, u16_t *ipaddr);
-00065 
-00066 /* Functions. */
-00067 void resolv_conf(u16_t *dnsserver);
-00068 u16_t *resolv_getserver(void);
-00069 void resolv_init(void);
-00070 u16_t *resolv_lookup(char *name);
-00071 void resolv_query(char *name);
-00072 
-00073 #endif /* __RESOLV_H__ */
-00074 
-00075 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00174.html b/components/net/uip/doc/html/a00174.html deleted file mode 100644 index c535c4aec3..0000000000 --- a/components/net/uip/doc/html/a00174.html +++ /dev/null @@ -1,287 +0,0 @@ - - -uIP 1.0: apps/smtp/smtp.c Source File - - - - - - -

apps/smtp/smtp.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup smtp SMTP E-mail sender
-00008  * @{
-00009  *
-00010  * The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is
-00011  * the standard way of sending and transfering e-mail on the
-00012  * Internet. This simple example implementation is intended as an
-00013  * example of how to implement protocols in uIP, and is able to send
-00014  * out e-mail but has not been extensively tested.
-00015  */
-00016 
-00017 /**
-00018  * \file
-00019  * SMTP example implementation
-00020  * \author Adam Dunkels <adam@dunkels.com>
-00021  */
-00022 
-00023 /*
-00024  * Copyright (c) 2004, Adam Dunkels.
-00025  * All rights reserved.
-00026  *
-00027  * Redistribution and use in source and binary forms, with or without
-00028  * modification, are permitted provided that the following conditions
-00029  * are met:
-00030  * 1. Redistributions of source code must retain the above copyright
-00031  *    notice, this list of conditions and the following disclaimer.
-00032  * 2. Redistributions in binary form must reproduce the above copyright
-00033  *    notice, this list of conditions and the following disclaimer in the
-00034  *    documentation and/or other materials provided with the distribution.
-00035  * 3. Neither the name of the Institute nor the names of its contributors
-00036  *    may be used to endorse or promote products derived from this software
-00037  *    without specific prior written permission.
-00038  *
-00039  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00040  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00041  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00042  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00043  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00044  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00045  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00046  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00047  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00048  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00049  * SUCH DAMAGE.
-00050  *
-00051  * This file is part of the uIP TCP/IP stack.
-00052  *
-00053  * Author: Adam Dunkels <adam@sics.se>
-00054  *
-00055  * $Id: smtp.c,v 1.4 2006/06/11 21:46:37 adam Exp $
-00056  */
-00057 #include "smtp.h"
-00058 
-00059 #include "smtp-strings.h"
-00060 #include "psock.h"
-00061 #include "uip.h"
-00062 
-00063 #include <string.h>
-00064 
-00065 static struct smtp_state s;
-00066 
-00067 static char *localhostname;
-00068 static uip_ipaddr_t smtpserver;
-00069 
-00070 #define ISO_nl 0x0a
-00071 #define ISO_cr 0x0d
-00072 
-00073 #define ISO_period 0x2e
-00074 
-00075 #define ISO_2  0x32
-00076 #define ISO_3  0x33
-00077 #define ISO_4  0x34
-00078 #define ISO_5  0x35
-00079 
-00080 
-00081 /*---------------------------------------------------------------------------*/
-00082 static
-00083 PT_THREAD(smtp_thread(void))
-00084 {
-00085   PSOCK_BEGIN(&s.psock);
-00086 
-00087   PSOCK_READTO(&s.psock, ISO_nl);
-00088    
-00089   if(strncmp(s.inputbuffer, smtp_220, 3) != 0) {
-00090     PSOCK_CLOSE(&s.psock);
-00091     smtp_done(2);
-00092     PSOCK_EXIT(&s.psock);
-00093   }
-00094   
-00095   PSOCK_SEND_STR(&s.psock, (char *)smtp_helo);
-00096   PSOCK_SEND_STR(&s.psock, localhostname);
-00097   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00098 
-00099   PSOCK_READTO(&s.psock, ISO_nl);
-00100   
-00101   if(s.inputbuffer[0] != ISO_2) {
-00102     PSOCK_CLOSE(&s.psock);
-00103     smtp_done(3);
-00104     PSOCK_EXIT(&s.psock);
-00105   }
-00106 
-00107   PSOCK_SEND_STR(&s.psock, (char *)smtp_mail_from);
-00108   PSOCK_SEND_STR(&s.psock, s.from);
-00109   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00110 
-00111   PSOCK_READTO(&s.psock, ISO_nl);
-00112   
-00113   if(s.inputbuffer[0] != ISO_2) {
-00114     PSOCK_CLOSE(&s.psock);
-00115     smtp_done(4);
-00116     PSOCK_EXIT(&s.psock);
-00117   }
-00118 
-00119   PSOCK_SEND_STR(&s.psock, (char *)smtp_rcpt_to);
-00120   PSOCK_SEND_STR(&s.psock, s.to);
-00121   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00122 
-00123   PSOCK_READTO(&s.psock, ISO_nl);
-00124   
-00125   if(s.inputbuffer[0] != ISO_2) {
-00126     PSOCK_CLOSE(&s.psock);
-00127     smtp_done(5);
-00128     PSOCK_EXIT(&s.psock);
-00129   }
-00130   
-00131   if(s.cc != 0) {
-00132     PSOCK_SEND_STR(&s.psock, (char *)smtp_rcpt_to);
-00133     PSOCK_SEND_STR(&s.psock, s.cc);
-00134     PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00135 
-00136     PSOCK_READTO(&s.psock, ISO_nl);
-00137   
-00138     if(s.inputbuffer[0] != ISO_2) {
-00139       PSOCK_CLOSE(&s.psock);
-00140       smtp_done(6);
-00141       PSOCK_EXIT(&s.psock);
-00142     }
-00143   }
-00144   
-00145   PSOCK_SEND_STR(&s.psock, (char *)smtp_data);
-00146   
-00147   PSOCK_READTO(&s.psock, ISO_nl);
-00148   
-00149   if(s.inputbuffer[0] != ISO_3) {
-00150     PSOCK_CLOSE(&s.psock);
-00151     smtp_done(7);
-00152     PSOCK_EXIT(&s.psock);
-00153   }
-00154 
-00155   PSOCK_SEND_STR(&s.psock, (char *)smtp_to);
-00156   PSOCK_SEND_STR(&s.psock, s.to);
-00157   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00158   
-00159   if(s.cc != 0) {
-00160     PSOCK_SEND_STR(&s.psock, (char *)smtp_cc);
-00161     PSOCK_SEND_STR(&s.psock, s.cc);
-00162     PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00163   }
-00164   
-00165   PSOCK_SEND_STR(&s.psock, (char *)smtp_from);
-00166   PSOCK_SEND_STR(&s.psock, s.from);
-00167   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00168   
-00169   PSOCK_SEND_STR(&s.psock, (char *)smtp_subject);
-00170   PSOCK_SEND_STR(&s.psock, s.subject);
-00171   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnl);
-00172 
-00173   PSOCK_SEND(&s.psock, s.msg, s.msglen);
-00174   
-00175   PSOCK_SEND_STR(&s.psock, (char *)smtp_crnlperiodcrnl);
-00176 
-00177   PSOCK_READTO(&s.psock, ISO_nl);
-00178   if(s.inputbuffer[0] != ISO_2) {
-00179     PSOCK_CLOSE(&s.psock);
-00180     smtp_done(8);
-00181     PSOCK_EXIT(&s.psock);
-00182   }
-00183 
-00184   PSOCK_SEND_STR(&s.psock, (char *)smtp_quit);
-00185   smtp_done(SMTP_ERR_OK);
-00186   PSOCK_END(&s.psock);
-00187 }
-00188 /*---------------------------------------------------------------------------*/
-00189 void
-00190 smtp_appcall(void)
-00191 {
-00192   if(uip_closed()) {
-00193     s.connected = 0;
-00194     return;
-00195   }
-00196   if(uip_aborted() || uip_timedout()) {
-00197     s.connected = 0;
-00198     smtp_done(1);
-00199     return;
-00200   }
-00201   smtp_thread();
-00202 }
-00203 /*---------------------------------------------------------------------------*/
-00204 /**
-00205  * Specificy an SMTP server and hostname.
-00206  *
-00207  * This function is used to configure the SMTP module with an SMTP
-00208  * server and the hostname of the host.
-00209  *
-00210  * \param lhostname The hostname of the uIP host.
-00211  *
-00212  * \param server A pointer to a 4-byte array representing the IP
-00213  * address of the SMTP server to be configured.
-00214  */
-00215 void
-00216 smtp_configure(char *lhostname, void *server)
-00217 {
-00218   localhostname = lhostname;
-00219   uip_ipaddr_copy(smtpserver, server);
-00220 }
-00221 /*---------------------------------------------------------------------------*/
-00222 /**
-00223  * Send an e-mail.
-00224  *
-00225  * \param to The e-mail address of the receiver of the e-mail.
-00226  * \param cc The e-mail address of the CC: receivers of the e-mail.
-00227  * \param from The e-mail address of the sender of the e-mail.
-00228  * \param subject The subject of the e-mail.
-00229  * \param msg The actual e-mail message.
-00230  * \param msglen The length of the e-mail message.
-00231  */
-00232 unsigned char
-00233 smtp_send(char *to, char *cc, char *from,
-00234           char *subject, char *msg, u16_t msglen)
-00235 {
-00236   struct uip_conn *conn;
-00237 
-00238   conn = uip_connect(smtpserver, HTONS(25));
-00239   if(conn == NULL) {
-00240     return 0;
-00241   }
-00242   s.connected = 1;
-00243   s.to = to;
-00244   s.cc = cc;
-00245   s.from = from;
-00246   s.subject = subject;
-00247   s.msg = msg;
-00248   s.msglen = msglen;
-00249 
-00250   PSOCK_INIT(&s.psock, s.inputbuffer, sizeof(s.inputbuffer));
-00251   
-00252   return 1;
-00253 }
-00254 /*---------------------------------------------------------------------------*/
-00255 void
-00256 smtp_init(void)
-00257 {
-00258   s.connected = 0;
-00259 }
-00260 /*---------------------------------------------------------------------------*/
-00261 /** @} */
-00262 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00175.html b/components/net/uip/doc/html/a00175.html deleted file mode 100644 index 98342be7af..0000000000 --- a/components/net/uip/doc/html/a00175.html +++ /dev/null @@ -1,128 +0,0 @@ - - -uIP 1.0: apps/smtp/smtp.h Source File - - - - - - -

apps/smtp/smtp.h

Go to the documentation of this file.
00001 
-00002 /**
-00003  * \addtogroup smtp
-00004  * @{
-00005  */
-00006 
-00007 
-00008 /**
-00009  * \file
-00010  * SMTP header file
-00011  * \author Adam Dunkels <adam@dunkels.com>
-00012  */
-00013 
-00014 /*
-00015  * Copyright (c) 2002, Adam Dunkels.
-00016  * All rights reserved.
-00017  *
-00018  * Redistribution and use in source and binary forms, with or without
-00019  * modification, are permitted provided that the following conditions
-00020  * are met:
-00021  * 1. Redistributions of source code must retain the above copyright
-00022  *    notice, this list of conditions and the following disclaimer.
-00023  * 2. Redistributions in binary form must reproduce the above copyright
-00024  *    notice, this list of conditions and the following disclaimer in the
-00025  *    documentation and/or other materials provided with the distribution.
-00026  * 3. The name of the author may not be used to endorse or promote
-00027  *    products derived from this software without specific prior
-00028  *    written permission.
-00029  *
-00030  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00031  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00032  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00033  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00034  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00035  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00036  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00037  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00038  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00039  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00040  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00041  *
-00042  * This file is part of the uIP TCP/IP stack.
-00043  *
-00044  * $Id: smtp.h,v 1.4 2006/06/11 21:46:37 adam Exp $
-00045  *
-00046  */
-00047 #ifndef __SMTP_H__
-00048 #define __SMTP_H__
-00049 
-00050 #include "uipopt.h"
-00051 
-00052 /**
-00053  * Error number that signifies a non-error condition.
-00054  */
-00055 #define SMTP_ERR_OK 0
-00056 
-00057 /**
-00058  * Callback function that is called when an e-mail transmission is
-00059  * done.
-00060  *
-00061  * This function must be implemented by the module that uses the SMTP
-00062  * module.
-00063  *
-00064  * \param error The number of the error if an error occured, or
-00065  * SMTP_ERR_OK.
-00066  */
-00067 void smtp_done(unsigned char error);
-00068 
-00069 void smtp_init(void);
-00070 
-00071 /* Functions. */
-00072 void smtp_configure(char *localhostname, u16_t *smtpserver);
-00073 unsigned char smtp_send(char *to, char *from,
-00074                         char *subject, char *msg,
-00075                         u16_t msglen);
-00076 #define SMTP_SEND(to, cc, from, subject, msg) \
-00077         smtp_send(to, cc, from, subject, msg, strlen(msg))
-00078 
-00079 void smtp_appcall(void);
-00080 
-00081 struct smtp_state {
-00082   u8_t state;
-00083   char *to;
-00084   char *from;
-00085   char *subject;
-00086   char *msg;
-00087   u16_t msglen;
-00088   
-00089   u16_t sentlen, textlen;
-00090   u16_t sendptr;
-00091 
-00092 };
-00093 
-00094 
-00095 #ifndef UIP_APPCALL
-00096 #define UIP_APPCALL     smtp_appcall
-00097 #endif
-00098 typedef struct smtp_state uip_tcp_appstate_t;
-00099 
-00100 
-00101 #endif /* __SMTP_H__ */
-00102 
-00103 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00176.html b/components/net/uip/doc/html/a00176.html deleted file mode 100644 index 100bf7aa62..0000000000 --- a/components/net/uip/doc/html/a00176.html +++ /dev/null @@ -1,148 +0,0 @@ - - -uIP 1.0: apps/telnetd/shell.c Source File - - - - - - -

apps/telnetd/shell.c

00001  /*
-00002  * Copyright (c) 2003, Adam Dunkels.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. The name of the author may not be used to endorse or promote
-00014  *    products derived from this software without specific prior
-00015  *    written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00018  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00021  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00023  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00025  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00026  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack.
-00030  *
-00031  * $Id: shell.c,v 1.1 2006/06/07 09:43:54 adam Exp $
-00032  *
-00033  */
-00034 
-00035 #include "shell.h"
-00036 
-00037 #include <string.h>
-00038 
-00039 struct ptentry {
-00040   char *commandstr;
-00041   void (* pfunc)(char *str);
-00042 };
-00043 
-00044 #define SHELL_PROMPT "uIP 1.0> "
-00045 
-00046 /*---------------------------------------------------------------------------*/
-00047 static void
-00048 parse(register char *str, struct ptentry *t)
-00049 {
-00050   struct ptentry *p;
-00051   for(p = t; p->commandstr != NULL; ++p) {
-00052     if(strncmp(p->commandstr, str, strlen(p->commandstr)) == 0) {
-00053       break;
-00054     }
-00055   }
-00056 
-00057   p->pfunc(str);
-00058 }
-00059 /*---------------------------------------------------------------------------*/
-00060 static void
-00061 inttostr(register char *str, unsigned int i)
-00062 {
-00063   str[0] = '0' + i / 100;
-00064   if(str[0] == '0') {
-00065     str[0] = ' ';
-00066   }
-00067   str[1] = '0' + (i / 10) % 10;
-00068   if(str[0] == ' ' && str[1] == '0') {
-00069     str[1] = ' ';
-00070   }
-00071   str[2] = '0' + i % 10;
-00072   str[3] = ' ';
-00073   str[4] = 0;
-00074 }
-00075 /*---------------------------------------------------------------------------*/
-00076 static void
-00077 help(char *str)
-00078 {
-00079   shell_output("Available commands:", "");
-00080   shell_output("stats   - show network statistics", "");
-00081   shell_output("conn    - show TCP connections", "");
-00082   shell_output("help, ? - show help", "");
-00083   shell_output("exit    - exit shell", "");
-00084 }
-00085 /*---------------------------------------------------------------------------*/
-00086 static void
-00087 unknown(char *str)
-00088 {
-00089   if(strlen(str) > 0) {
-00090     shell_output("Unknown command: ", str);
-00091   }
-00092 }
-00093 /*---------------------------------------------------------------------------*/
-00094 static struct ptentry parsetab[] =
-00095   {{"stats", help},
-00096    {"conn", help},
-00097    {"help", help},
-00098    {"exit", shell_quit},
-00099    {"?", help},
-00100 
-00101    /* Default action */
-00102    {NULL, unknown}};
-00103 /*---------------------------------------------------------------------------*/
-00104 void
-00105 shell_init(void)
-00106 {
-00107 }
-00108 /*---------------------------------------------------------------------------*/
-00109 void
-00110 shell_start(void)
-00111 {
-00112   shell_output("uIP command shell", "");
-00113   shell_output("Type '?' and return for help", "");
-00114   shell_prompt(SHELL_PROMPT);
-00115 }
-00116 /*---------------------------------------------------------------------------*/
-00117 void
-00118 shell_input(char *cmd)
-00119 {
-00120   parse(cmd, parsetab);
-00121   shell_prompt(SHELL_PROMPT);
-00122 }
-00123 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00177.html b/components/net/uip/doc/html/a00177.html deleted file mode 100644 index 2126707f18..0000000000 --- a/components/net/uip/doc/html/a00177.html +++ /dev/null @@ -1,129 +0,0 @@ - - -uIP 1.0: apps/telnetd/shell.h Source File - - - - - - -

apps/telnetd/shell.h

Go to the documentation of this file.
00001 /**
-00002  * \file
-00003  * Interface for the Contiki shell.
-00004  * \author Adam Dunkels <adam@dunkels.com>
-00005  *
-00006  * Some of the functions declared in this file must be implemented as
-00007  * a shell back-end in the architecture specific files of a Contiki
-00008  * port.
-00009  */
-00010 
-00011 
-00012 /*
-00013  * Copyright (c) 2003, Adam Dunkels.
-00014  * All rights reserved.
-00015  *
-00016  * Redistribution and use in source and binary forms, with or without
-00017  * modification, are permitted provided that the following conditions
-00018  * are met:
-00019  * 1. Redistributions of source code must retain the above copyright
-00020  *    notice, this list of conditions and the following disclaimer.
-00021  * 2. Redistributions in binary form must reproduce the above copyright
-00022  *    notice, this list of conditions and the following disclaimer in the
-00023  *    documentation and/or other materials provided with the distribution.
-00024  * 3. The name of the author may not be used to endorse or promote
-00025  *    products derived from this software without specific prior
-00026  *    written permission.
-00027  *
-00028  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00029  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00030  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00031  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00032  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00033  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00034  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00035  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00036  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00037  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00038  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00039  *
-00040  * This file is part of the Contiki desktop OS.
-00041  *
-00042  * $Id: shell.h,v 1.1 2006/06/07 09:43:54 adam Exp $
-00043  *
-00044  */
-00045 #ifndef __SHELL_H__
-00046 #define __SHELL_H__
-00047 
-00048 /**
-00049  * Initialize the shell.
-00050  *
-00051  * Called when the shell front-end process starts. This function may
-00052  * be used to start listening for signals.
-00053  */
-00054 void shell_init(void);
-00055 
-00056 /**
-00057  * Start the shell back-end.
-00058  *
-00059  * Called by the front-end when a new shell is started.
-00060  */
-00061 void shell_start(void);
-00062 
-00063 /**
-00064  * Process a shell command.
-00065  *
-00066  * This function will be called by the shell GUI / telnet server whan
-00067  * a command has been entered that should be processed by the shell
-00068  * back-end.
-00069  *
-00070  * \param command The command to be processed.
-00071  */
-00072 void shell_input(char *command);
-00073 
-00074 /**
-00075  * Quit the shell.
-00076  *
-00077  */
-00078 void shell_quit(char *);
-00079 
-00080 
-00081 /**
-00082  * Print a string to the shell window.
-00083  *
-00084  * This function is implemented by the shell GUI / telnet server and
-00085  * can be called by the shell back-end to output a string in the
-00086  * shell window. The string is automatically appended with a linebreak.
-00087  *
-00088  * \param str1 The first half of the string to be output.
-00089  * \param str2 The second half of the string to be output.
-00090  */
-00091 void shell_output(char *str1, char *str2);
-00092 
-00093 /**
-00094  * Print a prompt to the shell window.
-00095  *
-00096  * This function can be used by the shell back-end to print out a
-00097  * prompt to the shell window.
-00098  *
-00099  * \param prompt The prompt to be printed.
-00100  *
-00101  */
-00102 void shell_prompt(char *prompt);
-00103 
-00104 #endif /* __SHELL_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00178.html b/components/net/uip/doc/html/a00178.html deleted file mode 100644 index 9b19f4e723..0000000000 --- a/components/net/uip/doc/html/a00178.html +++ /dev/null @@ -1,375 +0,0 @@ - - -uIP 1.0: apps/telnetd/telnetd.c Source File - - - - - - -

apps/telnetd/telnetd.c

00001 /*
-00002  * Copyright (c) 2003, Adam Dunkels.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. The name of the author may not be used to endorse or promote
-00014  *    products derived from this software without specific prior
-00015  *    written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00018  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00021  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00023  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00025  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00026  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * $Id: telnetd.c,v 1.2 2006/06/07 09:43:54 adam Exp $
-00032  *
-00033  */
-00034 
-00035 #include "uip.h"
-00036 #include "telnetd.h"
-00037 #include "memb.h"
-00038 #include "shell.h"
-00039 
-00040 #include <string.h>
-00041 
-00042 #define ISO_nl       0x0a
-00043 #define ISO_cr       0x0d
-00044 
-00045 struct telnetd_line {
-00046   char line[TELNETD_CONF_LINELEN];
-00047 };
-00048 MEMB(linemem, struct telnetd_line, TELNETD_CONF_NUMLINES);
-00049 
-00050 #define STATE_NORMAL 0
-00051 #define STATE_IAC    1
-00052 #define STATE_WILL   2
-00053 #define STATE_WONT   3
-00054 #define STATE_DO     4
-00055 #define STATE_DONT   5
-00056 #define STATE_CLOSE  6
-00057 
-00058 static struct telnetd_state s;
-00059 
-00060 #define TELNET_IAC   255
-00061 #define TELNET_WILL  251
-00062 #define TELNET_WONT  252
-00063 #define TELNET_DO    253
-00064 #define TELNET_DONT  254
-00065 /*---------------------------------------------------------------------------*/
-00066 static char *
-00067 alloc_line(void)
-00068 {
-00069   return memb_alloc(&linemem);
-00070 }
-00071 /*---------------------------------------------------------------------------*/
-00072 static void
-00073 dealloc_line(char *line)
-00074 {
-00075   memb_free(&linemem, line);
-00076 }
-00077 /*---------------------------------------------------------------------------*/
-00078 void
-00079 shell_quit(char *str)
-00080 {
-00081   s.state = STATE_CLOSE;
-00082 }
-00083 /*---------------------------------------------------------------------------*/
-00084 static void
-00085 sendline(char *line)
-00086 {
-00087   static unsigned int i;
-00088   
-00089   for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) {
-00090     if(s.lines[i] == NULL) {
-00091       s.lines[i] = line;
-00092       break;
-00093     }
-00094   }
-00095   if(i == TELNETD_CONF_NUMLINES) {
-00096     dealloc_line(line);
-00097   }
-00098 }
-00099 /*---------------------------------------------------------------------------*/
-00100 void
-00101 shell_prompt(char *str)
-00102 {
-00103   char *line;
-00104   line = alloc_line();
-00105   if(line != NULL) {
-00106     strncpy(line, str, TELNETD_CONF_LINELEN);
-00107     /*    petsciiconv_toascii(line, TELNETD_CONF_LINELEN);*/
-00108     sendline(line);
-00109   }
-00110 }
-00111 /*---------------------------------------------------------------------------*/
-00112 void
-00113 shell_output(char *str1, char *str2)
-00114 {
-00115   static unsigned len;
-00116   char *line;
-00117 
-00118   line = alloc_line();
-00119   if(line != NULL) {
-00120     len = strlen(str1);
-00121     strncpy(line, str1, TELNETD_CONF_LINELEN);
-00122     if(len < TELNETD_CONF_LINELEN) {
-00123       strncpy(line + len, str2, TELNETD_CONF_LINELEN - len);
-00124     }
-00125     len = strlen(line);
-00126     if(len < TELNETD_CONF_LINELEN - 2) {
-00127       line[len] = ISO_cr;
-00128       line[len+1] = ISO_nl;
-00129       line[len+2] = 0;
-00130     }
-00131     /*    petsciiconv_toascii(line, TELNETD_CONF_LINELEN);*/
-00132     sendline(line);
-00133   }
-00134 }
-00135 /*---------------------------------------------------------------------------*/
-00136 void
-00137 telnetd_init(void)
-00138 {
-00139   uip_listen(HTONS(23));
-00140   memb_init(&linemem);
-00141   shell_init();
-00142 }
-00143 /*---------------------------------------------------------------------------*/
-00144 static void
-00145 acked(void)
-00146 {
-00147   static unsigned int i;
-00148   
-00149   while(s.numsent > 0) {
-00150     dealloc_line(s.lines[0]);
-00151     for(i = 1; i < TELNETD_CONF_NUMLINES; ++i) {
-00152       s.lines[i - 1] = s.lines[i];
-00153     }
-00154     s.lines[TELNETD_CONF_NUMLINES - 1] = NULL;
-00155     --s.numsent;
-00156   }
-00157 }
-00158 /*---------------------------------------------------------------------------*/
-00159 static void
-00160 senddata(void)
-00161 {
-00162   static char *bufptr, *lineptr;
-00163   static int buflen, linelen;
-00164   
-00165   bufptr = uip_appdata;
-00166   buflen = 0;
-00167   for(s.numsent = 0; s.numsent < TELNETD_CONF_NUMLINES &&
-00168         s.lines[s.numsent] != NULL ; ++s.numsent) {
-00169     lineptr = s.lines[s.numsent];
-00170     linelen = strlen(lineptr);
-00171     if(linelen > TELNETD_CONF_LINELEN) {
-00172       linelen = TELNETD_CONF_LINELEN;
-00173     }
-00174     if(buflen + linelen < uip_mss()) {
-00175       memcpy(bufptr, lineptr, linelen);
-00176       bufptr += linelen;
-00177       buflen += linelen;
-00178     } else {
-00179       break;
-00180     }
-00181   }
-00182   uip_send(uip_appdata, buflen);
-00183 }
-00184 /*---------------------------------------------------------------------------*/
-00185 static void
-00186 closed(void)
-00187 {
-00188   static unsigned int i;
-00189   
-00190   for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) {
-00191     if(s.lines[i] != NULL) {
-00192       dealloc_line(s.lines[i]);
-00193     }
-00194   }
-00195 }
-00196 /*---------------------------------------------------------------------------*/
-00197 static void
-00198 get_char(u8_t c)
-00199 {
-00200   if(c == ISO_cr) {
-00201     return;
-00202   }
-00203   
-00204   s.buf[(int)s.bufptr] = c;
-00205   if(s.buf[(int)s.bufptr] == ISO_nl ||
-00206      s.bufptr == sizeof(s.buf) - 1) {
-00207     if(s.bufptr > 0) {
-00208       s.buf[(int)s.bufptr] = 0;
-00209       /*      petsciiconv_topetscii(s.buf, TELNETD_CONF_LINELEN);*/
-00210     }
-00211     shell_input(s.buf);
-00212     s.bufptr = 0;
-00213   } else {
-00214     ++s.bufptr;
-00215   }
-00216 }
-00217 /*---------------------------------------------------------------------------*/
-00218 static void
-00219 sendopt(u8_t option, u8_t value)
-00220 {
-00221   char *line;
-00222   line = alloc_line();
-00223   if(line != NULL) {
-00224     line[0] = TELNET_IAC;
-00225     line[1] = option;
-00226     line[2] = value;
-00227     line[3] = 0;
-00228     sendline(line);
-00229   }
-00230 }
-00231 /*---------------------------------------------------------------------------*/
-00232 static void
-00233 newdata(void)
-00234 {
-00235   u16_t len;
-00236   u8_t c;
-00237   char *dataptr;
-00238     
-00239   
-00240   len = uip_datalen();
-00241   dataptr = (char *)uip_appdata;
-00242   
-00243   while(len > 0 && s.bufptr < sizeof(s.buf)) {
-00244     c = *dataptr;
-00245     ++dataptr;
-00246     --len;
-00247     switch(s.state) {
-00248     case STATE_IAC:
-00249       if(c == TELNET_IAC) {
-00250         get_char(c);
-00251         s.state = STATE_NORMAL;
-00252       } else {
-00253         switch(c) {
-00254         case TELNET_WILL:
-00255           s.state = STATE_WILL;
-00256           break;
-00257         case TELNET_WONT:
-00258           s.state = STATE_WONT;
-00259           break;
-00260         case TELNET_DO:
-00261           s.state = STATE_DO;
-00262           break;
-00263         case TELNET_DONT:
-00264           s.state = STATE_DONT;
-00265           break;
-00266         default:
-00267           s.state = STATE_NORMAL;
-00268           break;
-00269         }
-00270       }
-00271       break;
-00272     case STATE_WILL:
-00273       /* Reply with a DONT */
-00274       sendopt(TELNET_DONT, c);
-00275       s.state = STATE_NORMAL;
-00276       break;
-00277       
-00278     case STATE_WONT:
-00279       /* Reply with a DONT */
-00280       sendopt(TELNET_DONT, c);
-00281       s.state = STATE_NORMAL;
-00282       break;
-00283     case STATE_DO:
-00284       /* Reply with a WONT */
-00285       sendopt(TELNET_WONT, c);
-00286       s.state = STATE_NORMAL;
-00287       break;
-00288     case STATE_DONT:
-00289       /* Reply with a WONT */
-00290       sendopt(TELNET_WONT, c);
-00291       s.state = STATE_NORMAL;
-00292       break;
-00293     case STATE_NORMAL:
-00294       if(c == TELNET_IAC) {
-00295         s.state = STATE_IAC;
-00296       } else {
-00297         get_char(c);
-00298       }
-00299       break;
-00300     }
-00301 
-00302     
-00303   }
-00304   
-00305 }
-00306 /*---------------------------------------------------------------------------*/
-00307 void
-00308 telnetd_appcall(void)
-00309 {
-00310   static unsigned int i;
-00311   if(uip_connected()) {
-00312     /*    tcp_markconn(uip_conn, &s);*/
-00313     for(i = 0; i < TELNETD_CONF_NUMLINES; ++i) {
-00314       s.lines[i] = NULL;
-00315     }
-00316     s.bufptr = 0;
-00317     s.state = STATE_NORMAL;
-00318 
-00319     shell_start();
-00320   }
-00321 
-00322   if(s.state == STATE_CLOSE) {
-00323     s.state = STATE_NORMAL;
-00324     uip_close();
-00325     return;
-00326   }
-00327   
-00328   if(uip_closed() ||
-00329      uip_aborted() ||
-00330      uip_timedout()) {
-00331     closed();
-00332   }
-00333   
-00334   if(uip_acked()) {
-00335     acked();
-00336   }
-00337   
-00338   if(uip_newdata()) {
-00339     newdata();
-00340   }
-00341   
-00342   if(uip_rexmit() ||
-00343      uip_newdata() ||
-00344      uip_acked() ||
-00345      uip_connected() ||
-00346      uip_poll()) {
-00347     senddata();
-00348   }
-00349 }
-00350 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00179.html b/components/net/uip/doc/html/a00179.html deleted file mode 100644 index 139d6f07f8..0000000000 --- a/components/net/uip/doc/html/a00179.html +++ /dev/null @@ -1,88 +0,0 @@ - - -uIP 1.0: apps/telnetd/telnetd.h Source File - - - - - - -

apps/telnetd/telnetd.h

00001 /*
-00002  * Copyright (c) 2003, Adam Dunkels.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above
-00011  *    copyright notice, this list of conditions and the following
-00012  *    disclaimer in the documentation and/or other materials provided
-00013  *    with the distribution.
-00014  * 3. The name of the author may not be used to endorse or promote
-00015  *    products derived from this software without specific prior
-00016  *    written permission.
-00017  *
-00018  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00019  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00020  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00021  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00022  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00024  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00025  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00026  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00027  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00028  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00029  *
-00030  * This file is part of the uIP TCP/IP stack
-00031  *
-00032  * $Id: telnetd.h,v 1.2 2006/06/07 09:43:54 adam Exp $
-00033  *
-00034  */
-00035 #ifndef __TELNETD_H__
-00036 #define __TELNETD_H__
-00037 
-00038 #include "uipopt.h"
-00039 
-00040 void telnetd_appcall(void);
-00041 
-00042 #ifndef TELNETD_CONF_LINELEN
-00043 #define TELNETD_CONF_LINELEN 40
-00044 #endif
-00045 #ifndef TELNETD_CONF_NUMLINES
-00046 #define TELNETD_CONF_NUMLINES 16
-00047 #endif
-00048 
-00049 struct telnetd_state {
-00050   char *lines[TELNETD_CONF_NUMLINES];
-00051   char buf[TELNETD_CONF_LINELEN];
-00052   char bufptr;
-00053   u8_t numsent;
-00054   u8_t state;
-00055 };
-00056 
-00057 typedef struct telnetd_state uip_tcp_appstate_t;
-00058 
-00059 #ifndef UIP_APPCALL
-00060 #define UIP_APPCALL     telnetd_appcall
-00061 #endif
-00062 
-00063 #endif /* __TELNETD_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00180.html b/components/net/uip/doc/html/a00180.html deleted file mode 100644 index 6f1abbc686..0000000000 --- a/components/net/uip/doc/html/a00180.html +++ /dev/null @@ -1,464 +0,0 @@ - - -uIP 1.0: apps/webclient/webclient.c Source File - - - - - - -

apps/webclient/webclient.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup webclient Web client
-00008  * @{
-00009  *
-00010  * This example shows a HTTP client that is able to download web pages
-00011  * and files from web servers. It requires a number of callback
-00012  * functions to be implemented by the module that utilizes the code:
-00013  * webclient_datahandler(), webclient_connected(),
-00014  * webclient_timedout(), webclient_aborted(), webclient_closed().
-00015  */
-00016 
-00017 /**
-00018  * \file
-00019  * Implementation of the HTTP client.
-00020  * \author Adam Dunkels <adam@dunkels.com>
-00021  */
-00022 
-00023 /*
-00024  * Copyright (c) 2002, Adam Dunkels.
-00025  * All rights reserved.
-00026  *
-00027  * Redistribution and use in source and binary forms, with or without
-00028  * modification, are permitted provided that the following conditions
-00029  * are met:
-00030  * 1. Redistributions of source code must retain the above copyright
-00031  *    notice, this list of conditions and the following disclaimer.
-00032  * 2. Redistributions in binary form must reproduce the above
-00033  *    copyright notice, this list of conditions and the following
-00034  *    disclaimer in the documentation and/or other materials provided
-00035  *    with the distribution.
-00036  * 3. The name of the author may not be used to endorse or promote
-00037  *    products derived from this software without specific prior
-00038  *    written permission.
-00039  *
-00040  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00041  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00042  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00043  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00044  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00045  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00046  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00047  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00048  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00049  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00050  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00051  *
-00052  * This file is part of the uIP TCP/IP stack.
-00053  *
-00054  * $Id: webclient.c,v 1.2 2006/06/11 21:46:37 adam Exp $
-00055  *
-00056  */
-00057 
-00058 #include "uip.h"
-00059 #include "uiplib.h"
-00060 #include "webclient.h"
-00061 #include "resolv.h"
-00062 
-00063 #include <string.h>
-00064 
-00065 #define WEBCLIENT_TIMEOUT 100
-00066 
-00067 #define WEBCLIENT_STATE_STATUSLINE 0
-00068 #define WEBCLIENT_STATE_HEADERS    1
-00069 #define WEBCLIENT_STATE_DATA       2
-00070 #define WEBCLIENT_STATE_CLOSE      3
-00071 
-00072 #define HTTPFLAG_NONE   0
-00073 #define HTTPFLAG_OK     1
-00074 #define HTTPFLAG_MOVED  2
-00075 #define HTTPFLAG_ERROR  3
-00076 
-00077 
-00078 #define ISO_nl       0x0a
-00079 #define ISO_cr       0x0d
-00080 #define ISO_space    0x20
-00081 
-00082 
-00083 static struct webclient_state s;
-00084 
-00085 /*-----------------------------------------------------------------------------------*/
-00086 char *
-00087 webclient_mimetype(void)
-00088 {
-00089   return s.mimetype;
-00090 }
-00091 /*-----------------------------------------------------------------------------------*/
-00092 char *
-00093 webclient_filename(void)
-00094 {
-00095   return s.file;
-00096 }
-00097 /*-----------------------------------------------------------------------------------*/
-00098 char *
-00099 webclient_hostname(void)
-00100 {
-00101   return s.host;
-00102 }
-00103 /*-----------------------------------------------------------------------------------*/
-00104 unsigned short
-00105 webclient_port(void)
-00106 {
-00107   return s.port;
-00108 }
-00109 /*-----------------------------------------------------------------------------------*/
-00110 void
-00111 webclient_init(void)
-00112 {
-00113 
-00114 }
-00115 /*-----------------------------------------------------------------------------------*/
-00116 static void
-00117 init_connection(void)
-00118 {
-00119   s.state = WEBCLIENT_STATE_STATUSLINE;
-00120 
-00121   s.getrequestleft = sizeof(http_get) - 1 + 1 +
-00122     sizeof(http_10) - 1 +
-00123     sizeof(http_crnl) - 1 +
-00124     sizeof(http_host) - 1 +
-00125     sizeof(http_crnl) - 1 +
-00126     strlen(http_user_agent_fields) +
-00127     strlen(s.file) + strlen(s.host);
-00128   s.getrequestptr = 0;
-00129 
-00130   s.httpheaderlineptr = 0;
-00131 }
-00132 /*-----------------------------------------------------------------------------------*/
-00133 void
-00134 webclient_close(void)
-00135 {
-00136   s.state = WEBCLIENT_STATE_CLOSE;
-00137 }
-00138 /*-----------------------------------------------------------------------------------*/
-00139 unsigned char
-00140 webclient_get(char *host, u16_t port, char *file)
-00141 {
-00142   struct uip_conn *conn;
-00143   uip_ipaddr_t *ipaddr;
-00144   static uip_ipaddr_t addr;
-00145   
-00146   /* First check if the host is an IP address. */
-00147   ipaddr = &addr;
-00148   if(uiplib_ipaddrconv(host, (unsigned char *)addr) == 0) {
-00149     ipaddr = (uip_ipaddr_t *)resolv_lookup(host);
-00150     
-00151     if(ipaddr == NULL) {
-00152       return 0;
-00153     }
-00154   }
-00155   
-00156   conn = uip_connect(ipaddr, htons(port));
-00157   
-00158   if(conn == NULL) {
-00159     return 0;
-00160   }
-00161   
-00162   s.port = port;
-00163   strncpy(s.file, file, sizeof(s.file));
-00164   strncpy(s.host, host, sizeof(s.host));
-00165   
-00166   init_connection();
-00167   return 1;
-00168 }
-00169 /*-----------------------------------------------------------------------------------*/
-00170 static unsigned char *
-00171 copy_string(unsigned char *dest,
-00172             const unsigned char *src, unsigned char len)
-00173 {
-00174   strncpy(dest, src, len);
-00175   return dest + len;
-00176 }
-00177 /*-----------------------------------------------------------------------------------*/
-00178 static void
-00179 senddata(void)
-00180 {
-00181   u16_t len;
-00182   char *getrequest;
-00183   char *cptr;
-00184   
-00185   if(s.getrequestleft > 0) {
-00186     cptr = getrequest = (char *)uip_appdata;
-00187 
-00188     cptr = copy_string(cptr, http_get, sizeof(http_get) - 1);
-00189     cptr = copy_string(cptr, s.file, strlen(s.file));
-00190     *cptr++ = ISO_space;
-00191     cptr = copy_string(cptr, http_10, sizeof(http_10) - 1);
-00192 
-00193     cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1);
-00194     
-00195     cptr = copy_string(cptr, http_host, sizeof(http_host) - 1);
-00196     cptr = copy_string(cptr, s.host, strlen(s.host));
-00197     cptr = copy_string(cptr, http_crnl, sizeof(http_crnl) - 1);
-00198 
-00199     cptr = copy_string(cptr, http_user_agent_fields,
-00200                        strlen(http_user_agent_fields));
-00201     
-00202     len = s.getrequestleft > uip_mss()?
-00203       uip_mss():
-00204       s.getrequestleft;
-00205     uip_send(&(getrequest[s.getrequestptr]), len);
-00206   }
-00207 }
-00208 /*-----------------------------------------------------------------------------------*/
-00209 static void
-00210 acked(void)
-00211 {
-00212   u16_t len;
-00213   
-00214   if(s.getrequestleft > 0) {
-00215     len = s.getrequestleft > uip_mss()?
-00216       uip_mss():
-00217       s.getrequestleft;
-00218     s.getrequestleft -= len;
-00219     s.getrequestptr += len;
-00220   }
-00221 }
-00222 /*-----------------------------------------------------------------------------------*/
-00223 static u16_t
-00224 parse_statusline(u16_t len)
-00225 {
-00226   char *cptr;
-00227   
-00228   while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) {
-00229     s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata;
-00230     ++((char *)uip_appdata);
-00231     --len;
-00232     if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) {
-00233 
-00234       if((strncmp(s.httpheaderline, http_10,
-00235                   sizeof(http_10) - 1) == 0) ||
-00236          (strncmp(s.httpheaderline, http_11,
-00237                   sizeof(http_11) - 1) == 0)) {
-00238         cptr = &(s.httpheaderline[9]);
-00239         s.httpflag = HTTPFLAG_NONE;
-00240         if(strncmp(cptr, http_200, sizeof(http_200) - 1) == 0) {
-00241           /* 200 OK */
-00242           s.httpflag = HTTPFLAG_OK;
-00243         } else if(strncmp(cptr, http_301, sizeof(http_301) - 1) == 0 ||
-00244                   strncmp(cptr, http_302, sizeof(http_302) - 1) == 0) {
-00245           /* 301 Moved permanently or 302 Found. Location: header line
-00246              will contain thw new location. */
-00247           s.httpflag = HTTPFLAG_MOVED;
-00248         } else {
-00249           s.httpheaderline[s.httpheaderlineptr - 1] = 0;
-00250         }
-00251       } else {
-00252         uip_abort();
-00253         webclient_aborted();
-00254         return 0;
-00255       }
-00256       
-00257       /* We're done parsing the status line, so we reset the pointer
-00258          and start parsing the HTTP headers.*/
-00259       s.httpheaderlineptr = 0;
-00260       s.state = WEBCLIENT_STATE_HEADERS;
-00261       break;
-00262     } else {
-00263       ++s.httpheaderlineptr;
-00264     }
-00265   }
-00266   return len;
-00267 }
-00268 /*-----------------------------------------------------------------------------------*/
-00269 static char
-00270 casecmp(char *str1, const char *str2, char len)
-00271 {
-00272   static char c;
-00273   
-00274   while(len > 0) {
-00275     c = *str1;
-00276     /* Force lower-case characters. */
-00277     if(c & 0x40) {
-00278       c |= 0x20;
-00279     }
-00280     if(*str2 != c) {
-00281       return 1;
-00282     }
-00283     ++str1;
-00284     ++str2;
-00285     --len;
-00286   }
-00287   return 0;
-00288 }
-00289 /*-----------------------------------------------------------------------------------*/
-00290 static u16_t
-00291 parse_headers(u16_t len)
-00292 {
-00293   char *cptr;
-00294   static unsigned char i;
-00295   
-00296   while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) {
-00297     s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata;
-00298     ++((char *)uip_appdata);
-00299     --len;
-00300     if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) {
-00301       /* We have an entire HTTP header line in s.httpheaderline, so
-00302          we parse it. */
-00303       if(s.httpheaderline[0] == ISO_cr) {
-00304         /* This was the last header line (i.e., and empty "\r\n"), so
-00305            we are done with the headers and proceed with the actual
-00306            data. */
-00307         s.state = WEBCLIENT_STATE_DATA;
-00308         return len;
-00309       }
-00310 
-00311       s.httpheaderline[s.httpheaderlineptr - 1] = 0;
-00312       /* Check for specific HTTP header fields. */
-00313       if(casecmp(s.httpheaderline, http_content_type,
-00314                      sizeof(http_content_type) - 1) == 0) {
-00315         /* Found Content-type field. */
-00316         cptr = strchr(s.httpheaderline, ';');
-00317         if(cptr != NULL) {
-00318           *cptr = 0;
-00319         }
-00320         strncpy(s.mimetype, s.httpheaderline +
-00321                 sizeof(http_content_type) - 1, sizeof(s.mimetype));
-00322       } else if(casecmp(s.httpheaderline, http_location,
-00323                             sizeof(http_location) - 1) == 0) {
-00324         cptr = s.httpheaderline +
-00325           sizeof(http_location) - 1;
-00326         
-00327         if(strncmp(cptr, http_http, 7) == 0) {
-00328           cptr += 7;
-00329           for(i = 0; i < s.httpheaderlineptr - 7; ++i) {
-00330             if(*cptr == 0 ||
-00331                *cptr == '/' ||
-00332                *cptr == ' ' ||
-00333                *cptr == ':') {
-00334               s.host[i] = 0;
-00335               break;
-00336             }
-00337             s.host[i] = *cptr;
-00338             ++cptr;
-00339           }
-00340         }
-00341         strncpy(s.file, cptr, sizeof(s.file));
-00342         /*      s.file[s.httpheaderlineptr - i] = 0;*/
-00343       }
-00344 
-00345 
-00346       /* We're done parsing, so we reset the pointer and start the
-00347          next line. */
-00348       s.httpheaderlineptr = 0;
-00349     } else {
-00350       ++s.httpheaderlineptr;
-00351     }
-00352   }
-00353   return len;
-00354 }
-00355 /*-----------------------------------------------------------------------------------*/
-00356 static void
-00357 newdata(void)
-00358 {
-00359   u16_t len;
-00360 
-00361   len = uip_datalen();
-00362 
-00363   if(s.state == WEBCLIENT_STATE_STATUSLINE) {
-00364     len = parse_statusline(len);
-00365   }
-00366   
-00367   if(s.state == WEBCLIENT_STATE_HEADERS && len > 0) {
-00368     len = parse_headers(len);
-00369   }
-00370 
-00371   if(len > 0 && s.state == WEBCLIENT_STATE_DATA &&
-00372      s.httpflag != HTTPFLAG_MOVED) {
-00373     webclient_datahandler((char *)uip_appdata, len);
-00374   }
-00375 }
-00376 /*-----------------------------------------------------------------------------------*/
-00377 void
-00378 webclient_appcall(void)
-00379 {
-00380   if(uip_connected()) {
-00381     s.timer = 0;
-00382     s.state = WEBCLIENT_STATE_STATUSLINE;
-00383     senddata();
-00384     webclient_connected();
-00385     return;
-00386   }
-00387 
-00388   if(s.state == WEBCLIENT_STATE_CLOSE) {
-00389     webclient_closed();
-00390     uip_abort();
-00391     return;
-00392   }
-00393 
-00394   if(uip_aborted()) {
-00395     webclient_aborted();
-00396   }
-00397   if(uip_timedout()) {
-00398     webclient_timedout();
-00399   }
-00400 
-00401   
-00402   if(uip_acked()) {
-00403     s.timer = 0;
-00404     acked();
-00405   }
-00406   if(uip_newdata()) {
-00407     s.timer = 0;
-00408     newdata();
-00409   }
-00410   if(uip_rexmit() ||
-00411      uip_newdata() ||
-00412      uip_acked()) {
-00413     senddata();
-00414   } else if(uip_poll()) {
-00415     ++s.timer;
-00416     if(s.timer == WEBCLIENT_TIMEOUT) {
-00417       webclient_timedout();
-00418       uip_abort();
-00419       return;
-00420     }
-00421         /*    senddata();*/
-00422   }
-00423 
-00424   if(uip_closed()) {
-00425     if(s.httpflag != HTTPFLAG_MOVED) {
-00426       /* Send NULL data to signal EOF. */
-00427       webclient_datahandler(NULL, 0);
-00428     } else {
-00429       if(resolv_lookup(s.host) == NULL) {
-00430         resolv_query(s.host);
-00431       }
-00432       webclient_get(s.host, s.port, s.file);
-00433     }
-00434   }
-00435 }
-00436 /*-----------------------------------------------------------------------------------*/
-00437 
-00438 /** @} */
-00439 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00181.html b/components/net/uip/doc/html/a00181.html deleted file mode 100644 index 4407232c44..0000000000 --- a/components/net/uip/doc/html/a00181.html +++ /dev/null @@ -1,253 +0,0 @@ - - -uIP 1.0: apps/webclient/webclient.h Source File - - - - - - -

apps/webclient/webclient.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup webclient
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  * Header file for the HTTP client.
-00009  * \author Adam Dunkels <adam@dunkels.com>
-00010  */
-00011 
-00012 /*
-00013  * Copyright (c) 2002, Adam Dunkels.
-00014  * All rights reserved.
-00015  *
-00016  * Redistribution and use in source and binary forms, with or without
-00017  * modification, are permitted provided that the following conditions
-00018  * are met:
-00019  * 1. Redistributions of source code must retain the above copyright
-00020  *    notice, this list of conditions and the following disclaimer.
-00021  * 2. Redistributions in binary form must reproduce the above
-00022  *    copyright notice, this list of conditions and the following
-00023  *    disclaimer in the documentation and/or other materials provided
-00024  *    with the distribution.
-00025  * 3. The name of the author may not be used to endorse or promote
-00026  *    products derived from this software without specific prior
-00027  *    written permission.
-00028  *
-00029  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00030  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00031  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00032  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00033  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00034  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00035  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00036  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00037  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00038  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00039  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00040  *
-00041  * This file is part of the uIP TCP/IP stack.
-00042  *
-00043  * $Id: webclient.h,v 1.2 2006/06/11 21:46:37 adam Exp $
-00044  *
-00045  */
-00046 #ifndef __WEBCLIENT_H__
-00047 #define __WEBCLIENT_H__
-00048 
-00049 
-00050 #include "webclient-strings.h"
-00051 #include "uipopt.h"
-00052 
-00053 #define WEBCLIENT_CONF_MAX_URLLEN 100
-00054 
-00055 struct webclient_state {
-00056   u8_t timer;
-00057   u8_t state;
-00058   u8_t httpflag;
-00059 
-00060   u16_t port;
-00061   char host[40];
-00062   char file[WEBCLIENT_CONF_MAX_URLLEN];
-00063   u16_t getrequestptr;
-00064   u16_t getrequestleft;
-00065   
-00066   char httpheaderline[200];
-00067   u16_t httpheaderlineptr;
-00068 
-00069   char mimetype[32];
-00070 };
-00071 
-00072 typedef struct webclient_state uip_tcp_appstate_t;
-00073 #define UIP_APPCALL webclient_appcall
-00074 
-00075 /**
-00076  * Callback function that is called from the webclient code when HTTP
-00077  * data has been received.
-00078  *
-00079  * This function must be implemented by the module that uses the
-00080  * webclient code. The function is called from the webclient module
-00081  * when HTTP data has been received. The function is not called when
-00082  * HTTP headers are received, only for the actual data.
-00083  *
-00084  * \note This function is called many times, repetedly, when data is
-00085  * being received, and not once when all data has been received.
-00086  *
-00087  * \param data A pointer to the data that has been received.
-00088  * \param len The length of the data that has been received.
-00089  */
-00090 void webclient_datahandler(char *data, u16_t len);
-00091 
-00092 /**
-00093  * Callback function that is called from the webclient code when the
-00094  * HTTP connection has been connected to the web server.
-00095  *
-00096  * This function must be implemented by the module that uses the
-00097  * webclient code.
-00098  */
-00099 void webclient_connected(void);
-00100 
-00101 /**
-00102  * Callback function that is called from the webclient code if the
-00103  * HTTP connection to the web server has timed out.
-00104  *
-00105  * This function must be implemented by the module that uses the
-00106  * webclient code.
-00107  */
-00108 void webclient_timedout(void);
-00109 
-00110 /**
-00111  * Callback function that is called from the webclient code if the
-00112  * HTTP connection to the web server has been aborted by the web
-00113  * server.
-00114  *
-00115  * This function must be implemented by the module that uses the
-00116  * webclient code.
-00117  */
-00118 void webclient_aborted(void);
-00119 
-00120 /**
-00121  * Callback function that is called from the webclient code when the
-00122  * HTTP connection to the web server has been closed.
-00123  *
-00124  * This function must be implemented by the module that uses the
-00125  * webclient code.
-00126  */
-00127 void webclient_closed(void);
-00128 
-00129 
-00130 
-00131 /**
-00132  * Initialize the webclient module.
-00133  */
-00134 void webclient_init(void);
-00135 
-00136 /**
-00137  * Open an HTTP connection to a web server and ask for a file using
-00138  * the GET method.
-00139  *
-00140  * This function opens an HTTP connection to the specified web server
-00141  * and requests the specified file using the GET method. When the HTTP
-00142  * connection has been connected, the webclient_connected() callback
-00143  * function is called and when the HTTP data arrives the
-00144  * webclient_datahandler() callback function is called.
-00145  *
-00146  * The callback function webclient_timedout() is called if the web
-00147  * server could not be contacted, and the webclient_aborted() callback
-00148  * function is called if the HTTP connection is aborted by the web
-00149  * server.
-00150  *
-00151  * When the HTTP request has been completed and the HTTP connection is
-00152  * closed, the webclient_closed() callback function will be called.
-00153  *
-00154  * \note If the function is passed a host name, it must already be in
-00155  * the resolver cache in order for the function to connect to the web
-00156  * server. It is therefore up to the calling module to implement the
-00157  * resolver calls and the signal handler used for reporting a resolv
-00158  * query answer.
-00159  *
-00160  * \param host A pointer to a string containing either a host name or
-00161  * a numerical IP address in dotted decimal notation (e.g., 192.168.23.1).
-00162  *
-00163  * \param port The port number to which to connect, in host byte order.
-00164  *
-00165  * \param file A pointer to the name of the file to get.
-00166  *
-00167  * \retval 0 if the host name could not be found in the cache, or
-00168  * if a TCP connection could not be created.
-00169  *
-00170  * \retval 1 if the connection was initiated.
-00171  */
-00172 unsigned char webclient_get(char *host, u16_t port, char *file);
-00173 
-00174 /**
-00175  * Close the currently open HTTP connection.
-00176  */
-00177 void webclient_close(void);
-00178 void webclient_appcall(void);
-00179 
-00180 /**
-00181  * Obtain the MIME type of the current HTTP data stream.
-00182  *
-00183  * \return A pointer to a string contaning the MIME type. The string
-00184  * may be empty if no MIME type was reported by the web server.
-00185  */
-00186 char *webclient_mimetype(void);
-00187 
-00188 /**
-00189  * Obtain the filename of the current HTTP data stream.
-00190  *
-00191  * The filename of an HTTP request may be changed by the web server,
-00192  * and may therefore not be the same as when the original GET request
-00193  * was made with webclient_get(). This function is used for obtaining
-00194  * the current filename.
-00195  *
-00196  * \return A pointer to the current filename.
-00197  */
-00198 char *webclient_filename(void);
-00199 
-00200 /**
-00201  * Obtain the hostname of the current HTTP data stream.
-00202  *
-00203  * The hostname of the web server of an HTTP request may be changed
-00204  * by the web server, and may therefore not be the same as when the
-00205  * original GET request was made with webclient_get(). This function
-00206  * is used for obtaining the current hostname.
-00207  *
-00208  * \return A pointer to the current hostname.
-00209  */
-00210 char *webclient_hostname(void);
-00211 
-00212 /**
-00213  * Obtain the port number of the current HTTP data stream.
-00214  *
-00215  * The port number of an HTTP request may be changed by the web
-00216  * server, and may therefore not be the same as when the original GET
-00217  * request was made with webclient_get(). This function is used for
-00218  * obtaining the current port number.
-00219  *
-00220  * \return The port number of the current HTTP data stream, in host byte order.
-00221  */
-00222 unsigned short webclient_port(void);
-00223 
-00224 
-00225 
-00226 #endif /* __WEBCLIENT_H__ */
-00227 
-00228 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00182.html b/components/net/uip/doc/html/a00182.html deleted file mode 100644 index cb9d145797..0000000000 --- a/components/net/uip/doc/html/a00182.html +++ /dev/null @@ -1,228 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd-cgi.c Source File - - - - - - -

apps/webserver/httpd-cgi.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup httpd
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  *         Web server script interface
-00009  * \author
-00010  *         Adam Dunkels <adam@sics.se>
-00011  *
-00012  */
-00013 
-00014 /*
-00015  * Copyright (c) 2001-2006, Adam Dunkels.
-00016  * All rights reserved.
-00017  *
-00018  * Redistribution and use in source and binary forms, with or without
-00019  * modification, are permitted provided that the following conditions
-00020  * are met:
-00021  * 1. Redistributions of source code must retain the above copyright
-00022  *    notice, this list of conditions and the following disclaimer.
-00023  * 2. Redistributions in binary form must reproduce the above copyright
-00024  *    notice, this list of conditions and the following disclaimer in the
-00025  *    documentation and/or other materials provided with the distribution.
-00026  * 3. The name of the author may not be used to endorse or promote
-00027  *    products derived from this software without specific prior
-00028  *    written permission.
-00029  *
-00030  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00031  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00032  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00033  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00034  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00035  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00036  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00037  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00038  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00039  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00040  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00041  *
-00042  * This file is part of the uIP TCP/IP stack.
-00043  *
-00044  * $Id: httpd-cgi.c,v 1.2 2006/06/11 21:46:37 adam Exp $
-00045  *
-00046  */
-00047 
-00048 #include "uip.h"
-00049 #include "psock.h"
-00050 #include "httpd.h"
-00051 #include "httpd-cgi.h"
-00052 #include "httpd-fs.h"
-00053 
-00054 #include <stdio.h>
-00055 #include <string.h>
-00056 
-00057 HTTPD_CGI_CALL(file, "file-stats", file_stats);
-00058 HTTPD_CGI_CALL(tcp, "tcp-connections", tcp_stats);
-00059 HTTPD_CGI_CALL(net, "net-stats", net_stats);
-00060 
-00061 static const struct httpd_cgi_call *calls[] = { &file, &tcp, &net, NULL };
-00062 
-00063 /*---------------------------------------------------------------------------*/
-00064 static
-00065 PT_THREAD(nullfunction(struct httpd_state *s, char *ptr))
-00066 {
-00067   PSOCK_BEGIN(&s->sout);
-00068   PSOCK_END(&s->sout);
-00069 }
-00070 /*---------------------------------------------------------------------------*/
-00071 httpd_cgifunction
-00072 httpd_cgi(char *name)
-00073 {
-00074   const struct httpd_cgi_call **f;
-00075 
-00076   /* Find the matching name in the table, return the function. */
-00077   for(f = calls; *f != NULL; ++f) {
-00078     if(strncmp((*f)->name, name, strlen((*f)->name)) == 0) {
-00079       return (*f)->function;
-00080     }
-00081   }
-00082   return nullfunction;
-00083 }
-00084 /*---------------------------------------------------------------------------*/
-00085 static unsigned short
-00086 generate_file_stats(void *arg)
-00087 {
-00088   char *f = (char *)arg;
-00089   return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f));
-00090 }
-00091 /*---------------------------------------------------------------------------*/
-00092 static
-00093 PT_THREAD(file_stats(struct httpd_state *s, char *ptr))
-00094 {
-00095   PSOCK_BEGIN(&s->sout);
-00096 
-00097   PSOCK_GENERATOR_SEND(&s->sout, generate_file_stats, strchr(ptr, ' ') + 1);
-00098   
-00099   PSOCK_END(&s->sout);
-00100 }
-00101 /*---------------------------------------------------------------------------*/
-00102 static const char closed[] =   /*  "CLOSED",*/
-00103 {0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
-00104 static const char syn_rcvd[] = /*  "SYN-RCVD",*/
-00105 {0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56,
-00106  0x44,  0};
-00107 static const char syn_sent[] = /*  "SYN-SENT",*/
-00108 {0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e,
-00109  0x54,  0};
-00110 static const char established[] = /*  "ESTABLISHED",*/
-00111 {0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48,
-00112  0x45, 0x44, 0};
-00113 static const char fin_wait_1[] = /*  "FIN-WAIT-1",*/
-00114 {0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
-00115  0x54, 0x2d, 0x31, 0};
-00116 static const char fin_wait_2[] = /*  "FIN-WAIT-2",*/
-00117 {0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49,
-00118  0x54, 0x2d, 0x32, 0};
-00119 static const char closing[] = /*  "CLOSING",*/
-00120 {0x43, 0x4c, 0x4f, 0x53, 0x49,
-00121  0x4e, 0x47, 0};
-00122 static const char time_wait[] = /*  "TIME-WAIT,"*/
-00123 {0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41,
-00124  0x49, 0x54, 0};
-00125 static const char last_ack[] = /*  "LAST-ACK"*/
-00126 {0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43,
-00127  0x4b, 0};
-00128 
-00129 static const char *states[] = {
-00130   closed,
-00131   syn_rcvd,
-00132   syn_sent,
-00133   established,
-00134   fin_wait_1,
-00135   fin_wait_2,
-00136   closing,
-00137   time_wait,
-00138   last_ack};
-00139   
-00140 
-00141 static unsigned short
-00142 generate_tcp_stats(void *arg)
-00143 {
-00144   struct uip_conn *conn;
-00145   struct httpd_state *s = (struct httpd_state *)arg;
-00146     
-00147   conn = &uip_conns[s->count];
-00148   return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
-00149                  "<tr><td>%d</td><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
-00150                  htons(conn->lport),
-00151                  htons(conn->ripaddr[0]) >> 8,
-00152                  htons(conn->ripaddr[0]) & 0xff,
-00153                  htons(conn->ripaddr[1]) >> 8,
-00154                  htons(conn->ripaddr[1]) & 0xff,
-00155                  htons(conn->rport),
-00156                  states[conn->tcpstateflags & UIP_TS_MASK],
-00157                  conn->nrtx,
-00158                  conn->timer,
-00159                  (uip_outstanding(conn))? '*':' ',
-00160                  (uip_stopped(conn))? '!':' ');
-00161 }
-00162 /*---------------------------------------------------------------------------*/
-00163 static
-00164 PT_THREAD(tcp_stats(struct httpd_state *s, char *ptr))
-00165 {
-00166   
-00167   PSOCK_BEGIN(&s->sout);
-00168 
-00169   for(s->count = 0; s->count < UIP_CONNS; ++s->count) {
-00170     if((uip_conns[s->count].tcpstateflags & UIP_TS_MASK) != UIP_CLOSED) {
-00171       PSOCK_GENERATOR_SEND(&s->sout, generate_tcp_stats, s);
-00172     }
-00173   }
-00174 
-00175   PSOCK_END(&s->sout);
-00176 }
-00177 /*---------------------------------------------------------------------------*/
-00178 static unsigned short
-00179 generate_net_stats(void *arg)
-00180 {
-00181   struct httpd_state *s = (struct httpd_state *)arg;
-00182   return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE,
-00183                   "%5u\n", ((uip_stats_t *)&uip_stat)[s->count]);
-00184 }
-00185 
-00186 static
-00187 PT_THREAD(net_stats(struct httpd_state *s, char *ptr))
-00188 {
-00189   PSOCK_BEGIN(&s->sout);
-00190 
-00191 #if UIP_STATISTICS
-00192 
-00193   for(s->count = 0; s->count < sizeof(uip_stat) / sizeof(uip_stats_t);
-00194       ++s->count) {
-00195     PSOCK_GENERATOR_SEND(&s->sout, generate_net_stats, s);
-00196   }
-00197   
-00198 #endif /* UIP_STATISTICS */
-00199   
-00200   PSOCK_END(&s->sout);
-00201 }
-00202 /*---------------------------------------------------------------------------*/
-00203 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00183.html b/components/net/uip/doc/html/a00183.html deleted file mode 100644 index 0c753470ba..0000000000 --- a/components/net/uip/doc/html/a00183.html +++ /dev/null @@ -1,109 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd-cgi.h Source File - - - - - - -

apps/webserver/httpd-cgi.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup httpd
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  *         Web server script interface header file
-00009  * \author
-00010  *         Adam Dunkels <adam@sics.se>
-00011  *
-00012  */
-00013 
-00014 
-00015 
-00016 /*
-00017  * Copyright (c) 2001, Adam Dunkels.
-00018  * All rights reserved.
-00019  *
-00020  * Redistribution and use in source and binary forms, with or without
-00021  * modification, are permitted provided that the following conditions
-00022  * are met:
-00023  * 1. Redistributions of source code must retain the above copyright
-00024  *    notice, this list of conditions and the following disclaimer.
-00025  * 2. Redistributions in binary form must reproduce the above copyright
-00026  *    notice, this list of conditions and the following disclaimer in the
-00027  *    documentation and/or other materials provided with the distribution.
-00028  * 3. The name of the author may not be used to endorse or promote
-00029  *    products derived from this software without specific prior
-00030  *    written permission.
-00031  *
-00032  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00033  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00034  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00035  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00036  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00037  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00038  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00039  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00040  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00041  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00042  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00043  *
-00044  * This file is part of the uIP TCP/IP stack.
-00045  *
-00046  * $Id: httpd-cgi.h,v 1.2 2006/06/11 21:46:38 adam Exp $
-00047  *
-00048  */
-00049 
-00050 #ifndef __HTTPD_CGI_H__
-00051 #define __HTTPD_CGI_H__
-00052 
-00053 #include "psock.h"
-00054 #include "httpd.h"
-00055 
-00056 typedef PT_THREAD((* httpd_cgifunction)(struct httpd_state *, char *));
-00057 
-00058 httpd_cgifunction httpd_cgi(char *name);
-00059 
-00060 struct httpd_cgi_call {
-00061   const char *name;
-00062   const httpd_cgifunction function;
-00063 };
-00064 
-00065 /**
-00066  * \brief      HTTPD CGI function declaration
-00067  * \param name The C variable name of the function
-00068  * \param str  The string name of the function, used in the script file
-00069  * \param function A pointer to the function that implements it
-00070  *
-00071  *             This macro is used for declaring a HTTPD CGI
-00072  *             function. This function is then added to the list of
-00073  *             HTTPD CGI functions with the httpd_cgi_add() function.
-00074  *
-00075  * \hideinitializer
-00076  */
-00077 #define HTTPD_CGI_CALL(name, str, function) \
-00078 static PT_THREAD(function(struct httpd_state *, char *)); \
-00079 static const struct httpd_cgi_call name = {str, function}
-00080 
-00081 void httpd_cgi_init(void);
-00082 #endif /* __HTTPD_CGI_H__ */
-00083 
-00084 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00184.html b/components/net/uip/doc/html/a00184.html deleted file mode 100644 index f49fd5669d..0000000000 --- a/components/net/uip/doc/html/a00184.html +++ /dev/null @@ -1,363 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd.c Source File - - - - - - -

apps/webserver/httpd.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup apps
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup httpd Web server
-00008  * @{
-00009  * The uIP web server is a very simplistic implementation of an HTTP
-00010  * server. It can serve web pages and files from a read-only ROM
-00011  * filesystem, and provides a very small scripting language.
-00012 
-00013  */
-00014 
-00015 /**
-00016  * \file
-00017  *         Web server
-00018  * \author
-00019  *         Adam Dunkels <adam@sics.se>
-00020  */
-00021 
-00022 
-00023 /*
-00024  * Copyright (c) 2004, Adam Dunkels.
-00025  * All rights reserved.
-00026  *
-00027  * Redistribution and use in source and binary forms, with or without
-00028  * modification, are permitted provided that the following conditions
-00029  * are met:
-00030  * 1. Redistributions of source code must retain the above copyright
-00031  *    notice, this list of conditions and the following disclaimer.
-00032  * 2. Redistributions in binary form must reproduce the above copyright
-00033  *    notice, this list of conditions and the following disclaimer in the
-00034  *    documentation and/or other materials provided with the distribution.
-00035  * 3. Neither the name of the Institute nor the names of its contributors
-00036  *    may be used to endorse or promote products derived from this software
-00037  *    without specific prior written permission.
-00038  *
-00039  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00040  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00041  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00042  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00043  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00044  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00045  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00046  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00047  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00048  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00049  * SUCH DAMAGE.
-00050  *
-00051  * This file is part of the uIP TCP/IP stack.
-00052  *
-00053  * Author: Adam Dunkels <adam@sics.se>
-00054  *
-00055  * $Id: httpd.c,v 1.2 2006/06/11 21:46:38 adam Exp $
-00056  */
-00057 
-00058 #include "uip.h"
-00059 #include "httpd.h"
-00060 #include "httpd-fs.h"
-00061 #include "httpd-cgi.h"
-00062 #include "http-strings.h"
-00063 
-00064 #include <string.h>
-00065 
-00066 #define STATE_WAITING 0
-00067 #define STATE_OUTPUT  1
-00068 
-00069 #define ISO_nl      0x0a
-00070 #define ISO_space   0x20
-00071 #define ISO_bang    0x21
-00072 #define ISO_percent 0x25
-00073 #define ISO_period  0x2e
-00074 #define ISO_slash   0x2f
-00075 #define ISO_colon   0x3a
-00076 
-00077 
-00078 /*---------------------------------------------------------------------------*/
-00079 static unsigned short
-00080 generate_part_of_file(void *state)
-00081 {
-00082   struct httpd_state *s = (struct httpd_state *)state;
-00083 
-00084   if(s->file.len > uip_mss()) {
-00085     s->len = uip_mss();
-00086   } else {
-00087     s->len = s->file.len;
-00088   }
-00089   memcpy(uip_appdata, s->file.data, s->len);
-00090   
-00091   return s->len;
-00092 }
-00093 /*---------------------------------------------------------------------------*/
-00094 static
-00095 PT_THREAD(send_file(struct httpd_state *s))
-00096 {
-00097   PSOCK_BEGIN(&s->sout);
-00098   
-00099   do {
-00100     PSOCK_GENERATOR_SEND(&s->sout, generate_part_of_file, s);
-00101     s->file.len -= s->len;
-00102     s->file.data += s->len;
-00103   } while(s->file.len > 0);
-00104       
-00105   PSOCK_END(&s->sout);
-00106 }
-00107 /*---------------------------------------------------------------------------*/
-00108 static
-00109 PT_THREAD(send_part_of_file(struct httpd_state *s))
-00110 {
-00111   PSOCK_BEGIN(&s->sout);
-00112 
-00113   PSOCK_SEND(&s->sout, s->file.data, s->len);
-00114   
-00115   PSOCK_END(&s->sout);
-00116 }
-00117 /*---------------------------------------------------------------------------*/
-00118 static void
-00119 next_scriptstate(struct httpd_state *s)
-00120 {
-00121   char *p;
-00122   p = strchr(s->scriptptr, ISO_nl) + 1;
-00123   s->scriptlen -= (unsigned short)(p - s->scriptptr);
-00124   s->scriptptr = p;
-00125 }
-00126 /*---------------------------------------------------------------------------*/
-00127 static
-00128 PT_THREAD(handle_script(struct httpd_state *s))
-00129 {
-00130   char *ptr;
-00131   
-00132   PT_BEGIN(&s->scriptpt);
-00133 
-00134 
-00135   while(s->file.len > 0) {
-00136 
-00137     /* Check if we should start executing a script. */
-00138     if(*s->file.data == ISO_percent &&
-00139        *(s->file.data + 1) == ISO_bang) {
-00140       s->scriptptr = s->file.data + 3;
-00141       s->scriptlen = s->file.len - 3;
-00142       if(*(s->scriptptr - 1) == ISO_colon) {
-00143         httpd_fs_open(s->scriptptr + 1, &s->file);
-00144         PT_WAIT_THREAD(&s->scriptpt, send_file(s));
-00145       } else {
-00146         PT_WAIT_THREAD(&s->scriptpt,
-00147                        httpd_cgi(s->scriptptr)(s, s->scriptptr));
-00148       }
-00149       next_scriptstate(s);
-00150       
-00151       /* The script is over, so we reset the pointers and continue
-00152          sending the rest of the file. */
-00153       s->file.data = s->scriptptr;
-00154       s->file.len = s->scriptlen;
-00155     } else {
-00156       /* See if we find the start of script marker in the block of HTML
-00157          to be sent. */
-00158 
-00159       if(s->file.len > uip_mss()) {
-00160         s->len = uip_mss();
-00161       } else {
-00162         s->len = s->file.len;
-00163       }
-00164 
-00165       if(*s->file.data == ISO_percent) {
-00166         ptr = strchr(s->file.data + 1, ISO_percent);
-00167       } else {
-00168         ptr = strchr(s->file.data, ISO_percent);
-00169       }
-00170       if(ptr != NULL &&
-00171          ptr != s->file.data) {
-00172         s->len = (int)(ptr - s->file.data);
-00173         if(s->len >= uip_mss()) {
-00174           s->len = uip_mss();
-00175         }
-00176       }
-00177       PT_WAIT_THREAD(&s->scriptpt, send_part_of_file(s));
-00178       s->file.data += s->len;
-00179       s->file.len -= s->len;
-00180       
-00181     }
-00182   }
-00183   
-00184   PT_END(&s->scriptpt);
-00185 }
-00186 /*---------------------------------------------------------------------------*/
-00187 static
-00188 PT_THREAD(send_headers(struct httpd_state *s, const char *statushdr))
-00189 {
-00190   char *ptr;
-00191 
-00192   PSOCK_BEGIN(&s->sout);
-00193 
-00194   PSOCK_SEND_STR(&s->sout, statushdr);
-00195 
-00196   ptr = strrchr(s->filename, ISO_period);
-00197   if(ptr == NULL) {
-00198     PSOCK_SEND_STR(&s->sout, http_content_type_binary);
-00199   } else if(strncmp(http_html, ptr, 5) == 0 ||
-00200             strncmp(http_shtml, ptr, 6) == 0) {
-00201     PSOCK_SEND_STR(&s->sout, http_content_type_html);
-00202   } else if(strncmp(http_css, ptr, 4) == 0) {
-00203     PSOCK_SEND_STR(&s->sout, http_content_type_css);
-00204   } else if(strncmp(http_png, ptr, 4) == 0) {
-00205     PSOCK_SEND_STR(&s->sout, http_content_type_png);
-00206   } else if(strncmp(http_gif, ptr, 4) == 0) {
-00207     PSOCK_SEND_STR(&s->sout, http_content_type_gif);
-00208   } else if(strncmp(http_jpg, ptr, 4) == 0) {
-00209     PSOCK_SEND_STR(&s->sout, http_content_type_jpg);
-00210   } else {
-00211     PSOCK_SEND_STR(&s->sout, http_content_type_plain);
-00212   }
-00213   PSOCK_END(&s->sout);
-00214 }
-00215 /*---------------------------------------------------------------------------*/
-00216 static
-00217 PT_THREAD(handle_output(struct httpd_state *s))
-00218 {
-00219   char *ptr;
-00220   
-00221   PT_BEGIN(&s->outputpt);
-00222  
-00223   if(!httpd_fs_open(s->filename, &s->file)) {
-00224     httpd_fs_open(http_404_html, &s->file);
-00225     strcpy(s->filename, http_404_html);
-00226     PT_WAIT_THREAD(&s->outputpt,
-00227                    send_headers(s,
-00228                    http_header_404));
-00229     PT_WAIT_THREAD(&s->outputpt,
-00230                    send_file(s));
-00231   } else {
-00232     PT_WAIT_THREAD(&s->outputpt,
-00233                    send_headers(s,
-00234                    http_header_200));
-00235     ptr = strchr(s->filename, ISO_period);
-00236     if(ptr != NULL && strncmp(ptr, http_shtml, 6) == 0) {
-00237       PT_INIT(&s->scriptpt);
-00238       PT_WAIT_THREAD(&s->outputpt, handle_script(s));
-00239     } else {
-00240       PT_WAIT_THREAD(&s->outputpt,
-00241                      send_file(s));
-00242     }
-00243   }
-00244   PSOCK_CLOSE(&s->sout);
-00245   PT_END(&s->outputpt);
-00246 }
-00247 /*---------------------------------------------------------------------------*/
-00248 static
-00249 PT_THREAD(handle_input(struct httpd_state *s))
-00250 {
-00251   PSOCK_BEGIN(&s->sin);
-00252 
-00253   PSOCK_READTO(&s->sin, ISO_space);
-00254 
-00255   
-00256   if(strncmp(s->inputbuf, http_get, 4) != 0) {
-00257     PSOCK_CLOSE_EXIT(&s->sin);
-00258   }
-00259   PSOCK_READTO(&s->sin, ISO_space);
-00260 
-00261   if(s->inputbuf[0] != ISO_slash) {
-00262     PSOCK_CLOSE_EXIT(&s->sin);
-00263   }
-00264 
-00265   if(s->inputbuf[1] == ISO_space) {
-00266     strncpy(s->filename, http_index_html, sizeof(s->filename));
-00267   } else {
-00268     s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0;
-00269     strncpy(s->filename, &s->inputbuf[0], sizeof(s->filename));
-00270   }
-00271 
-00272   /*  httpd_log_file(uip_conn->ripaddr, s->filename);*/
-00273   
-00274   s->state = STATE_OUTPUT;
-00275 
-00276   while(1) {
-00277     PSOCK_READTO(&s->sin, ISO_nl);
-00278 
-00279     if(strncmp(s->inputbuf, http_referer, 8) == 0) {
-00280       s->inputbuf[PSOCK_DATALEN(&s->sin) - 2] = 0;
-00281       /*      httpd_log(&s->inputbuf[9]);*/
-00282     }
-00283   }
-00284   
-00285   PSOCK_END(&s->sin);
-00286 }
-00287 /*---------------------------------------------------------------------------*/
-00288 static void
-00289 handle_connection(struct httpd_state *s)
-00290 {
-00291   handle_input(s);
-00292   if(s->state == STATE_OUTPUT) {
-00293     handle_output(s);
-00294   }
-00295 }
-00296 /*---------------------------------------------------------------------------*/
-00297 void
-00298 httpd_appcall(void)
-00299 {
-00300   struct httpd_state *s = (struct httpd_state *)&(uip_conn->appstate);
-00301 
-00302   if(uip_closed() || uip_aborted() || uip_timedout()) {
-00303   } else if(uip_connected()) {
-00304     PSOCK_INIT(&s->sin, s->inputbuf, sizeof(s->inputbuf) - 1);
-00305     PSOCK_INIT(&s->sout, s->inputbuf, sizeof(s->inputbuf) - 1);
-00306     PT_INIT(&s->outputpt);
-00307     s->state = STATE_WAITING;
-00308     /*    timer_set(&s->timer, CLOCK_SECOND * 100);*/
-00309     s->timer = 0;
-00310     handle_connection(s);
-00311   } else if(s != NULL) {
-00312     if(uip_poll()) {
-00313       ++s->timer;
-00314       if(s->timer >= 20) {
-00315         uip_abort();
-00316       }
-00317     } else {
-00318       s->timer = 0;
-00319     }
-00320     handle_connection(s);
-00321   } else {
-00322     uip_abort();
-00323   }
-00324 }
-00325 /*---------------------------------------------------------------------------*/
-00326 /**
-00327  * \brief      Initialize the web server
-00328  *
-00329  *             This function initializes the web server and should be
-00330  *             called at system boot-up.
-00331  */
-00332 void
-00333 httpd_init(void)
-00334 {
-00335   uip_listen(HTONS(80));
-00336 }
-00337 /*---------------------------------------------------------------------------*/
-00338 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00185.html b/components/net/uip/doc/html/a00185.html deleted file mode 100644 index 7dea1e4df8..0000000000 --- a/components/net/uip/doc/html/a00185.html +++ /dev/null @@ -1,87 +0,0 @@ - - -uIP 1.0: apps/webserver/httpd.h Source File - - - - - - -

apps/webserver/httpd.h

00001 /*
-00002  * Copyright (c) 2001-2005, Adam Dunkels.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. The name of the author may not be used to endorse or promote
-00014  *    products derived from this software without specific prior
-00015  *    written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00018  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00021  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00023  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00025  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00026  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack.
-00030  *
-00031  * $Id: httpd.h,v 1.2 2006/06/11 21:46:38 adam Exp $
-00032  *
-00033  */
-00034 
-00035 #ifndef __HTTPD_H__
-00036 #define __HTTPD_H__
-00037 
-00038 #include "psock.h"
-00039 #include "httpd-fs.h"
-00040 
-00041 struct httpd_state {
-00042   unsigned char timer;
-00043   struct psock sin, sout;
-00044   struct pt outputpt, scriptpt;
-00045   char inputbuf[50];
-00046   char filename[20];
-00047   char state;
-00048   struct httpd_fs_file file;
-00049   int len;
-00050   char *scriptptr;
-00051   int scriptlen;
-00052   
-00053   unsigned short count;
-00054 };
-00055 
-00056 void httpd_init(void);
-00057 void httpd_appcall(void);
-00058 
-00059 void httpd_log(char *msg);
-00060 void httpd_log_file(u16_t *requester, char *file);
-00061 
-00062 #endif /* __HTTPD_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00186.html b/components/net/uip/doc/html/a00186.html deleted file mode 100644 index b56304029c..0000000000 --- a/components/net/uip/doc/html/a00186.html +++ /dev/null @@ -1,129 +0,0 @@ - - -uIP 1.0: lib/memb.c Source File - - - - - - -

lib/memb.c

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: memb.c,v 1.1 2006/06/12 08:21:43 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \addtogroup memb
-00038  * @{
-00039  */
-00040 
-00041  /**
-00042  * \file
-00043  * Memory block allocation routines.
-00044  * \author Adam Dunkels <adam@sics.se>
-00045  */
-00046 #include <string.h>
-00047 
-00048 #include "memb.h"
-00049 
-00050 /*---------------------------------------------------------------------------*/
-00051 void
-00052 memb_init(struct memb_blocks *m)
-00053 {
-00054   memset(m->count, 0, m->num);
-00055   memset(m->mem, 0, m->size * m->num);
-00056 }
-00057 /*---------------------------------------------------------------------------*/
-00058 void *
-00059 memb_alloc(struct memb_blocks *m)
-00060 {
-00061   int i;
-00062 
-00063   for(i = 0; i < m->num; ++i) {
-00064     if(m->count[i] == 0) {
-00065       /* If this block was unused, we increase the reference count to
-00066          indicate that it now is used and return a pointer to the
-00067          memory block. */
-00068       ++(m->count[i]);
-00069       return (void *)((char *)m->mem + (i * m->size));
-00070     }
-00071   }
-00072 
-00073   /* No free block was found, so we return NULL to indicate failure to
-00074      allocate block. */
-00075   return NULL;
-00076 }
-00077 /*---------------------------------------------------------------------------*/
-00078 char
-00079 memb_free(struct memb_blocks *m, void *ptr)
-00080 {
-00081   int i;
-00082   char *ptr2;
-00083 
-00084   /* Walk through the list of blocks and try to find the block to
-00085      which the pointer "ptr" points to. */
-00086   ptr2 = (char *)m->mem;
-00087   for(i = 0; i < m->num; ++i) {
-00088     
-00089     if(ptr2 == (char *)ptr) {
-00090       /* We've found to block to which "ptr" points so we decrease the
-00091          reference count and return the new value of it. */
-00092       if(m->count[i] > 0) {
-00093         /* Make sure that we don't deallocate free memory. */
-00094         --(m->count[i]);
-00095       }
-00096       return m->count[i];
-00097     }
-00098     ptr2 += m->size;
-00099   }
-00100   return -1;
-00101 }
-00102 /*---------------------------------------------------------------------------*/
-00103 
-00104 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00187.html b/components/net/uip/doc/html/a00187.html deleted file mode 100644 index cd6de30693..0000000000 --- a/components/net/uip/doc/html/a00187.html +++ /dev/null @@ -1,167 +0,0 @@ - - -uIP 1.0: lib/memb.h Source File - - - - - - -

lib/memb.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: memb.h,v 1.1 2006/06/12 08:21:43 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \defgroup memb Memory block management functions
-00038  *
-00039  * The memory block allocation routines provide a simple yet powerful
-00040  * set of functions for managing a set of memory blocks of fixed
-00041  * size. A set of memory blocks is statically declared with the
-00042  * MEMB() macro. Memory blocks are allocated from the declared
-00043  * memory by the memb_alloc() function, and are deallocated with the
-00044  * memb_free() function.
-00045  *
-00046  * \note Because of namespace clashes only one MEMB() can be
-00047  * declared per C module, and the name scope of a MEMB() memory
-00048  * block is local to each C module.
-00049  *
-00050  * The following example shows how to declare and use a memory block
-00051  * called "cmem" which has 8 chunks of memory with each memory chunk
-00052  * being 20 bytes large.
-00053  *
-00054  * @{
-00055  */
-00056 
-00057 
-00058 /**
-00059  * \file
-00060  *         Memory block allocation routines.
-00061  * \author
-00062  *         Adam Dunkels <adam@sics.se>
-00063  *
-00064  */
-00065 
-00066 #ifndef __MEMB_H__
-00067 #define __MEMB_H__
-00068 
-00069 /*
-00070  * Here we define a C preprocessing macro for concatenating to
-00071  * strings. We need use two macros in order to allow concatenation of
-00072  * two #defined macros.
-00073  */
-00074 #define MEMB_CONCAT2(s1, s2) s1##s2
-00075 #define MEMB_CONCAT(s1, s2) MEMB_CONCAT2(s1, s2)
-00076 
-00077 /**
-00078  * Declare a memory block.
-00079  *
-00080  * This macro is used to staticall declare a block of memory that can
-00081  * be used by the block allocation functions. The macro statically
-00082  * declares a C array with a size that matches the specified number of
-00083  * blocks and their individual sizes.
-00084  *
-00085  * Example:
-00086  \code
-00087 MEMB(connections, sizeof(struct connection), 16);
-00088  \endcode
-00089  *
-00090  * \param name The name of the memory block (later used with
-00091  * memb_init(), memb_alloc() and memb_free()).
-00092  *
-00093  * \param size The size of each memory chunk, in bytes.
-00094  *
-00095  * \param num The total number of memory chunks in the block.
-00096  *
-00097  */
-00098 #define MEMB(name, structure, num) \
-00099         static char MEMB_CONCAT(name,_memb_count)[num]; \
-00100         static structure MEMB_CONCAT(name,_memb_mem)[num]; \
-00101         static struct memb_blocks name = {sizeof(structure), num, \
-00102                                           MEMB_CONCAT(name,_memb_count), \
-00103                                           (void *)MEMB_CONCAT(name,_memb_mem)}
-00104 
-00105 struct memb_blocks {
-00106   unsigned short size;
-00107   unsigned short num;
-00108   char *count;
-00109   void *mem;
-00110 };
-00111 
-00112 /**
-00113  * Initialize a memory block that was declared with MEMB().
-00114  *
-00115  * \param m A memory block previosly declared with MEMB().
-00116  */
-00117 void  memb_init(struct memb_blocks *m);
-00118 
-00119 /**
-00120  * Allocate a memory block from a block of memory declared with MEMB().
-00121  *
-00122  * \param m A memory block previosly declared with MEMB().
-00123  */
-00124 void *memb_alloc(struct memb_blocks *m);
-00125 
-00126 /**
-00127  * Deallocate a memory block from a memory block previously declared
-00128  * with MEMB().
-00129  *
-00130  * \param m m A memory block previosly declared with MEMB().
-00131  *
-00132  * \param ptr A pointer to the memory block that is to be deallocated.
-00133  *
-00134  * \return The new reference count for the memory block (should be 0
-00135  * if successfully deallocated) or -1 if the pointer "ptr" did not
-00136  * point to a legal memory block.
-00137  */
-00138 char  memb_free(struct memb_blocks *m, void *ptr);
-00139 
-00140 /** @} */
-00141 
-00142 #endif /* __MEMB_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00188.html b/components/net/uip/doc/html/a00188.html deleted file mode 100644 index 383bcb3b39..0000000000 --- a/components/net/uip/doc/html/a00188.html +++ /dev/null @@ -1,113 +0,0 @@ - - -uIP 1.0: uip/clock.h Source File - - - - - - -

uip/clock.h

00001 /**
-00002  * \defgroup clock Clock interface
-00003  *
-00004  * The clock interface is the interface between the \ref timer "timer library"
-00005  * and the platform specific clock functionality. The clock
-00006  * interface must be implemented for each platform that uses the \ref
-00007  * timer "timer library".
-00008  *
-00009  * The clock interface does only one this: it measures time. The clock
-00010  * interface provides a macro, CLOCK_SECOND, which corresponds to one
-00011  * second of system time.
-00012  *
-00013  * \sa \ref timer "Timer library"
-00014  *
-00015  * @{
-00016  */
-00017 
-00018 /*
-00019  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00020  * All rights reserved.
-00021  *
-00022  * Redistribution and use in source and binary forms, with or without
-00023  * modification, are permitted provided that the following conditions
-00024  * are met:
-00025  * 1. Redistributions of source code must retain the above copyright
-00026  *    notice, this list of conditions and the following disclaimer.
-00027  * 2. Redistributions in binary form must reproduce the above copyright
-00028  *    notice, this list of conditions and the following disclaimer in the
-00029  *    documentation and/or other materials provided with the distribution.
-00030  * 3. Neither the name of the Institute nor the names of its contributors
-00031  *    may be used to endorse or promote products derived from this software
-00032  *    without specific prior written permission.
-00033  *
-00034  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00035  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00036  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00037  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00038  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00039  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00040  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00041  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00042  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00043  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00044  * SUCH DAMAGE.
-00045  *
-00046  * This file is part of the uIP TCP/IP stack
-00047  *
-00048  * Author: Adam Dunkels <adam@sics.se>
-00049  *
-00050  * $Id: clock.h,v 1.3 2006/06/11 21:46:39 adam Exp $
-00051  */
-00052 #ifndef __CLOCK_H__
-00053 #define __CLOCK_H__
-00054 
-00055 #include "clock-arch.h"
-00056 
-00057 /**
-00058  * Initialize the clock library.
-00059  *
-00060  * This function initializes the clock library and should be called
-00061  * from the main() function of the system.
-00062  *
-00063  */
-00064 void clock_init(void);
-00065 
-00066 /**
-00067  * Get the current clock time.
-00068  *
-00069  * This function returns the current system clock time.
-00070  *
-00071  * \return The current clock time, measured in system ticks.
-00072  */
-00073 clock_time_t clock_time(void);
-00074 
-00075 /**
-00076  * A second, measured in system clock time.
-00077  *
-00078  * \hideinitializer
-00079  */
-00080 #ifdef CLOCK_CONF_SECOND
-00081 #define CLOCK_SECOND CLOCK_CONF_SECOND
-00082 #else
-00083 #define CLOCK_SECOND (clock_time_t)32
-00084 #endif
-00085 
-00086 #endif /* __CLOCK_H__ */
-00087 
-00088 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00189.html b/components/net/uip/doc/html/a00189.html deleted file mode 100644 index 16727d2975..0000000000 --- a/components/net/uip/doc/html/a00189.html +++ /dev/null @@ -1,108 +0,0 @@ - - -uIP 1.0: uip/lc-addrlabels.h Source File - - - - - - -

uip/lc-addrlabels.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: lc-addrlabels.h,v 1.3 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \addtogroup lc
-00038  * @{
-00039  */
-00040 
-00041 /**
-00042  * \file
-00043  * Implementation of local continuations based on the "Labels as
-00044  * values" feature of gcc
-00045  * \author
-00046  * Adam Dunkels <adam@sics.se>
-00047  *
-00048  * This implementation of local continuations is based on a special
-00049  * feature of the GCC C compiler called "labels as values". This
-00050  * feature allows assigning pointers with the address of the code
-00051  * corresponding to a particular C label.
-00052  *
-00053  * For more information, see the GCC documentation:
-00054  * http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
-00055  *
-00056  * Thanks to dividuum for finding the nice local scope label
-00057  * implementation.
-00058  */
-00059 
-00060 #ifndef __LC_ADDRLABELS_H__
-00061 #define __LC_ADDRLABELS_H__
-00062 
-00063 /** \hideinitializer */
-00064 typedef void * lc_t;
-00065 
-00066 #define LC_INIT(s) s = NULL
-00067 
-00068 
-00069 #define LC_RESUME(s)                            \
-00070   do {                                          \
-00071     if(s != NULL) {                             \
-00072       goto *s;                                  \
-00073     }                                           \
-00074   } while(0)
-00075 
-00076 #define LC_SET(s)                               \
-00077   do { ({ __label__ resume; resume: (s) = &&resume; }); }while(0)
-00078 
-00079 #define LC_END(s)
-00080 
-00081 #endif /* __LC_ADDRLABELS_H__ */
-00082 
-00083 /**  @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00190.html b/components/net/uip/doc/html/a00190.html deleted file mode 100644 index 5ce94dfad7..0000000000 --- a/components/net/uip/doc/html/a00190.html +++ /dev/null @@ -1,101 +0,0 @@ - - -uIP 1.0: uip/lc-switch.h Source File - - - - - - -

uip/lc-switch.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: lc-switch.h,v 1.2 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \addtogroup lc
-00038  * @{
-00039  */
-00040 
-00041 /**
-00042  * \file
-00043  * Implementation of local continuations based on switch() statment
-00044  * \author Adam Dunkels <adam@sics.se>
-00045  *
-00046  * This implementation of local continuations uses the C switch()
-00047  * statement to resume execution of a function somewhere inside the
-00048  * function's body. The implementation is based on the fact that
-00049  * switch() statements are able to jump directly into the bodies of
-00050  * control structures such as if() or while() statmenets.
-00051  *
-00052  * This implementation borrows heavily from Simon Tatham's coroutines
-00053  * implementation in C:
-00054  * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
-00055  */
-00056 
-00057 #ifndef __LC_SWITCH_H__
-00058 #define __LC_SWTICH_H__
-00059 
-00060 /* WARNING! lc implementation using switch() does not work if an
-00061    LC_SET() is done within another switch() statement! */
-00062 
-00063 /** \hideinitializer */
-00064 typedef unsigned short lc_t;
-00065 
-00066 #define LC_INIT(s) s = 0;
-00067 
-00068 #define LC_RESUME(s) switch(s) { case 0:
-00069 
-00070 #define LC_SET(s) s = __LINE__; case __LINE__:
-00071 
-00072 #define LC_END(s) }
-00073 
-00074 #endif /* __LC_SWITCH_H__ */
-00075 
-00076 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00191.html b/components/net/uip/doc/html/a00191.html deleted file mode 100644 index 9b0f676710..0000000000 --- a/components/net/uip/doc/html/a00191.html +++ /dev/null @@ -1,156 +0,0 @@ - - -uIP 1.0: uip/lc.h Source File - - - - - - -

uip/lc.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: lc.h,v 1.2 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \addtogroup pt
-00038  * @{
-00039  */
-00040 
-00041 /**
-00042  * \defgroup lc Local continuations
-00043  * @{
-00044  *
-00045  * Local continuations form the basis for implementing protothreads. A
-00046  * local continuation can be <i>set</i> in a specific function to
-00047  * capture the state of the function. After a local continuation has
-00048  * been set can be <i>resumed</i> in order to restore the state of the
-00049  * function at the point where the local continuation was set.
-00050  *
-00051  *
-00052  */
-00053 
-00054 /**
-00055  * \file lc.h
-00056  * Local continuations
-00057  * \author
-00058  * Adam Dunkels <adam@sics.se>
-00059  *
-00060  */
-00061 
-00062 #ifdef DOXYGEN
-00063 /**
-00064  * Initialize a local continuation.
-00065  *
-00066  * This operation initializes the local continuation, thereby
-00067  * unsetting any previously set continuation state.
-00068  *
-00069  * \hideinitializer
-00070  */
-00071 #define LC_INIT(lc)
-00072 
-00073 /**
-00074  * Set a local continuation.
-00075  *
-00076  * The set operation saves the state of the function at the point
-00077  * where the operation is executed. As far as the set operation is
-00078  * concerned, the state of the function does <b>not</b> include the
-00079  * call-stack or local (automatic) variables, but only the program
-00080  * counter and such CPU registers that needs to be saved.
-00081  *
-00082  * \hideinitializer
-00083  */
-00084 #define LC_SET(lc)
-00085 
-00086 /**
-00087  * Resume a local continuation.
-00088  *
-00089  * The resume operation resumes a previously set local continuation, thus
-00090  * restoring the state in which the function was when the local
-00091  * continuation was set. If the local continuation has not been
-00092  * previously set, the resume operation does nothing.
-00093  *
-00094  * \hideinitializer
-00095  */
-00096 #define LC_RESUME(lc)
-00097 
-00098 /**
-00099  * Mark the end of local continuation usage.
-00100  *
-00101  * The end operation signifies that local continuations should not be
-00102  * used any more in the function. This operation is not needed for
-00103  * most implementations of local continuation, but is required by a
-00104  * few implementations.
-00105  *
-00106  * \hideinitializer
-00107  */
-00108 #define LC_END(lc)
-00109 
-00110 /**
-00111  * \var typedef lc_t;
-00112  *
-00113  * The local continuation type.
-00114  *
-00115  * \hideinitializer
-00116  */
-00117 #endif /* DOXYGEN */
-00118 
-00119 #ifndef __LC_H__
-00120 #define __LC_H__
-00121 
-00122 #ifdef LC_CONF_INCLUDE
-00123 #include LC_CONF_INCLUDE
-00124 #else
-00125 #include "lc-switch.h"
-00126 #endif /* LC_CONF_INCLUDE */
-00127 
-00128 #endif /* __LC_H__ */
-00129 
-00130 /** @} */
-00131 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00192.html b/components/net/uip/doc/html/a00192.html deleted file mode 100644 index 13543d50bd..0000000000 --- a/components/net/uip/doc/html/a00192.html +++ /dev/null @@ -1,363 +0,0 @@ - - -uIP 1.0: uip/psock.c Source File - - - - - - -

uip/psock.c

00001 /*
-00002  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: psock.c,v 1.2 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 #include <stdio.h>
-00037 #include <string.h>
-00038 
-00039 #include "uipopt.h"
-00040 #include "psock.h"
-00041 #include "uip.h"
-00042 
-00043 #define STATE_NONE 0
-00044 #define STATE_ACKED 1
-00045 #define STATE_READ 2
-00046 #define STATE_BLOCKED_NEWDATA 3
-00047 #define STATE_BLOCKED_CLOSE 4
-00048 #define STATE_BLOCKED_SEND 5
-00049 #define STATE_DATA_SENT 6
-00050 
-00051 /*
-00052  * Return value of the buffering functions that indicates that a
-00053  * buffer was not filled by incoming data.
-00054  *
-00055  */
-00056 #define BUF_NOT_FULL 0
-00057 #define BUF_NOT_FOUND 0
-00058 
-00059 /*
-00060  * Return value of the buffering functions that indicates that a
-00061  * buffer was completely filled by incoming data.
-00062  *
-00063  */
-00064 #define BUF_FULL 1
-00065 
-00066 /*
-00067  * Return value of the buffering functions that indicates that an
-00068  * end-marker byte was found.
-00069  *
-00070  */
-00071 #define BUF_FOUND 2
-00072 
-00073 /*---------------------------------------------------------------------------*/
-00074 static void
-00075 buf_setup(struct psock_buf *buf,
-00076           u8_t *bufptr, u16_t bufsize)
-00077 {
-00078   buf->ptr = bufptr;
-00079   buf->left = bufsize;
-00080 }
-00081 /*---------------------------------------------------------------------------*/
-00082 static u8_t
-00083 buf_bufdata(struct psock_buf *buf, u16_t len,
-00084             u8_t **dataptr, u16_t *datalen)
-00085 {
-00086   if(*datalen < buf->left) {
-00087     memcpy(buf->ptr, *dataptr, *datalen);
-00088     buf->ptr += *datalen;
-00089     buf->left -= *datalen;
-00090     *dataptr += *datalen;
-00091     *datalen = 0;
-00092     return BUF_NOT_FULL;
-00093   } else if(*datalen == buf->left) {
-00094     memcpy(buf->ptr, *dataptr, *datalen);
-00095     buf->ptr += *datalen;
-00096     buf->left = 0;
-00097     *dataptr += *datalen;
-00098     *datalen = 0;
-00099     return BUF_FULL;
-00100   } else {
-00101     memcpy(buf->ptr, *dataptr, buf->left);
-00102     buf->ptr += buf->left;
-00103     *datalen -= buf->left;
-00104     *dataptr += buf->left;
-00105     buf->left = 0;
-00106     return BUF_FULL;
-00107   }
-00108 }
-00109 /*---------------------------------------------------------------------------*/
-00110 static u8_t
-00111 buf_bufto(register struct psock_buf *buf, u8_t endmarker,
-00112           register u8_t **dataptr, register u16_t *datalen)
-00113 {
-00114   u8_t c;
-00115   while(buf->left > 0 && *datalen > 0) {
-00116     c = *buf->ptr = **dataptr;
-00117     ++*dataptr;
-00118     ++buf->ptr;
-00119     --*datalen;
-00120     --buf->left;
-00121     
-00122     if(c == endmarker) {
-00123       return BUF_FOUND;
-00124     }
-00125   }
-00126 
-00127   if(*datalen == 0) {
-00128     return BUF_NOT_FOUND;
-00129   }
-00130 
-00131   while(*datalen > 0) {
-00132     c = **dataptr;
-00133     --*datalen;
-00134     ++*dataptr;
-00135     
-00136     if(c == endmarker) {
-00137       return BUF_FOUND | BUF_FULL;
-00138     }
-00139   }
-00140   
-00141   return BUF_FULL;
-00142 }
-00143 /*---------------------------------------------------------------------------*/
-00144 static char
-00145 send_data(register struct psock *s)
-00146 {
-00147   if(s->state != STATE_DATA_SENT || uip_rexmit()) {
-00148     if(s->sendlen > uip_mss()) {
-00149       uip_send(s->sendptr, uip_mss());
-00150     } else {
-00151       uip_send(s->sendptr, s->sendlen);
-00152     }
-00153     s->state = STATE_DATA_SENT;
-00154     return 1;
-00155   }
-00156   return 0;
-00157 }
-00158 /*---------------------------------------------------------------------------*/
-00159 static char
-00160 data_acked(register struct psock *s)
-00161 {
-00162   if(s->state == STATE_DATA_SENT && uip_acked()) {
-00163     if(s->sendlen > uip_mss()) {
-00164       s->sendlen -= uip_mss();
-00165       s->sendptr += uip_mss();
-00166     } else {
-00167       s->sendptr += s->sendlen;
-00168       s->sendlen = 0;
-00169     }
-00170     s->state = STATE_ACKED;
-00171     return 1;
-00172   }
-00173   return 0;
-00174 }
-00175 /*---------------------------------------------------------------------------*/
-00176 PT_THREAD(psock_send(register struct psock *s, const char *buf,
-00177                      unsigned int len))
-00178 {
-00179   PT_BEGIN(&s->psockpt);
-00180 
-00181   /* If there is no data to send, we exit immediately. */
-00182   if(len == 0) {
-00183     PT_EXIT(&s->psockpt);
-00184   }
-00185 
-00186   /* Save the length of and a pointer to the data that is to be
-00187      sent. */
-00188   s->sendptr = buf;
-00189   s->sendlen = len;
-00190 
-00191   s->state = STATE_NONE;
-00192 
-00193   /* We loop here until all data is sent. The s->sendlen variable is
-00194      updated by the data_sent() function. */
-00195   while(s->sendlen > 0) {
-00196 
-00197     /*
-00198      * The condition for this PT_WAIT_UNTIL is a little tricky: the
-00199      * protothread will wait here until all data has been acknowledged
-00200      * (data_acked() returns true) and until all data has been sent
-00201      * (send_data() returns true). The two functions data_acked() and
-00202      * send_data() must be called in succession to ensure that all
-00203      * data is sent. Therefore the & operator is used instead of the
-00204      * && operator, which would cause only the data_acked() function
-00205      * to be called when it returns false.
-00206      */
-00207     PT_WAIT_UNTIL(&s->psockpt, data_acked(s) & send_data(s));
-00208   }
-00209 
-00210   s->state = STATE_NONE;
-00211   
-00212   PT_END(&s->psockpt);
-00213 }
-00214 /*---------------------------------------------------------------------------*/
-00215 PT_THREAD(psock_generator_send(register struct psock *s,
-00216                                unsigned short (*generate)(void *), void *arg))
-00217 {
-00218   PT_BEGIN(&s->psockpt);
-00219 
-00220   /* Ensure that there is a generator function to call. */
-00221   if(generate == NULL) {
-00222     PT_EXIT(&s->psockpt);
-00223   }
-00224 
-00225   /* Call the generator function to generate the data in the
-00226      uip_appdata buffer. */
-00227   s->sendlen = generate(arg);
-00228   s->sendptr = uip_appdata;
-00229 
-00230   s->state = STATE_NONE;  
-00231   do {
-00232     /* Call the generator function again if we are called to perform a
-00233        retransmission. */
-00234     if(uip_rexmit()) {
-00235       generate(arg);
-00236     }
-00237     /* Wait until all data is sent and acknowledged. */
-00238     PT_WAIT_UNTIL(&s->psockpt, data_acked(s) & send_data(s));
-00239   } while(s->sendlen > 0);
-00240   
-00241   s->state = STATE_NONE;
-00242   
-00243   PT_END(&s->psockpt);
-00244 }
-00245 /*---------------------------------------------------------------------------*/
-00246 u16_t
-00247 psock_datalen(struct psock *psock)
-00248 {
-00249   return psock->bufsize - psock->buf.left;
-00250 }
-00251 /*---------------------------------------------------------------------------*/
-00252 char
-00253 psock_newdata(struct psock *s)
-00254 {
-00255   if(s->readlen > 0) {
-00256     /* There is data in the uip_appdata buffer that has not yet been
-00257        read with the PSOCK_READ functions. */
-00258     return 1;
-00259   } else if(s->state == STATE_READ) {
-00260     /* All data in uip_appdata buffer already consumed. */
-00261     s->state = STATE_BLOCKED_NEWDATA;
-00262     return 0;
-00263   } else if(uip_newdata()) {
-00264     /* There is new data that has not been consumed. */
-00265     return 1;
-00266   } else {
-00267     /* There is no new data. */
-00268     return 0;
-00269   }
-00270 }
-00271 /*---------------------------------------------------------------------------*/
-00272 PT_THREAD(psock_readto(register struct psock *psock, unsigned char c))
-00273 {
-00274   PT_BEGIN(&psock->psockpt);
-00275 
-00276   buf_setup(&psock->buf, psock->bufptr, psock->bufsize);
-00277   
-00278   /* XXX: Should add buf_checkmarker() before do{} loop, if
-00279      incoming data has been handled while waiting for a write. */
-00280 
-00281   do {
-00282     if(psock->readlen == 0) {
-00283       PT_WAIT_UNTIL(&psock->psockpt, psock_newdata(psock));
-00284       psock->state = STATE_READ;
-00285       psock->readptr = (u8_t *)uip_appdata;
-00286       psock->readlen = uip_datalen();
-00287     }
-00288   } while((buf_bufto(&psock->buf, c,
-00289                      &psock->readptr,
-00290                      &psock->readlen) & BUF_FOUND) == 0);
-00291   
-00292   if(psock_datalen(psock) == 0) {
-00293     psock->state = STATE_NONE;
-00294     PT_RESTART(&psock->psockpt);
-00295   }
-00296   PT_END(&psock->psockpt);
-00297 }
-00298 /*---------------------------------------------------------------------------*/
-00299 PT_THREAD(psock_readbuf(register struct psock *psock))
-00300 {
-00301   PT_BEGIN(&psock->psockpt);
-00302 
-00303   buf_setup(&psock->buf, psock->bufptr, psock->bufsize);
-00304   
-00305   /* XXX: Should add buf_checkmarker() before do{} loop, if
-00306      incoming data has been handled while waiting for a write. */
-00307 
-00308   do {
-00309     if(psock->readlen == 0) {
-00310       PT_WAIT_UNTIL(&psock->psockpt, psock_newdata(psock));
-00311       printf("Waited for newdata\n");
-00312       psock->state = STATE_READ;
-00313       psock->readptr = (u8_t *)uip_appdata;
-00314       psock->readlen = uip_datalen();
-00315     }
-00316   } while(buf_bufdata(&psock->buf, psock->bufsize,
-00317                          &psock->readptr,
-00318                          &psock->readlen) != BUF_FULL);
-00319 
-00320   if(psock_datalen(psock) == 0) {
-00321     psock->state = STATE_NONE;
-00322     PT_RESTART(&psock->psockpt);
-00323   }
-00324   PT_END(&psock->psockpt);
-00325 }
-00326 /*---------------------------------------------------------------------------*/
-00327 void
-00328 psock_init(register struct psock *psock, char *buffer, unsigned int buffersize)
-00329 {
-00330   psock->state = STATE_NONE;
-00331   psock->readlen = 0;
-00332   psock->bufptr = buffer;
-00333   psock->bufsize = buffersize;
-00334   buf_setup(&psock->buf, buffer, buffersize);
-00335   PT_INIT(&psock->pt);
-00336   PT_INIT(&psock->psockpt);
-00337 }
-00338 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00193.html b/components/net/uip/doc/html/a00193.html deleted file mode 100644 index b0ea40f91d..0000000000 --- a/components/net/uip/doc/html/a00193.html +++ /dev/null @@ -1,405 +0,0 @@ - - -uIP 1.0: uip/psock.h Source File - - - - - - -

uip/psock.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: psock.h,v 1.3 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \defgroup psock Protosockets library
-00038  * @{
-00039  *
-00040  * The protosocket library provides an interface to the uIP stack that is
-00041  * similar to the traditional BSD socket interface. Unlike programs
-00042  * written for the ordinary uIP event-driven interface, programs
-00043  * written with the protosocket library are executed in a sequential
-00044  * fashion and does not have to be implemented as explicit state
-00045  * machines.
-00046  *
-00047  * Protosockets only work with TCP connections.
-00048  *
-00049  * The protosocket library uses \ref pt protothreads to provide
-00050  * sequential control flow. This makes the protosockets lightweight in
-00051  * terms of memory, but also means that protosockets inherits the
-00052  * functional limitations of protothreads. Each protosocket lives only
-00053  * within a single function. Automatic variables (stack variables) are
-00054  * not retained across a protosocket library function call.
-00055  *
-00056  * \note Because the protosocket library uses protothreads, local
-00057  * variables will not always be saved across a call to a protosocket
-00058  * library function. It is therefore advised that local variables are
-00059  * used with extreme care.
-00060  *
-00061  * The protosocket library provides functions for sending data without
-00062  * having to deal with retransmissions and acknowledgements, as well
-00063  * as functions for reading data without having to deal with data
-00064  * being split across more than one TCP segment.
-00065  *
-00066  * Because each protosocket runs as a protothread, the protosocket has to be
-00067  * started with a call to PSOCK_BEGIN() at the start of the function
-00068  * in which the protosocket is used. Similarly, the protosocket protothread can
-00069  * be terminated by a call to PSOCK_EXIT().
-00070  *
-00071  */
-00072 
-00073 /**
-00074  * \file
-00075  * Protosocket library header file
-00076  * \author
-00077  * Adam Dunkels <adam@sics.se>
-00078  *
-00079  */
-00080 
-00081 #ifndef __PSOCK_H__
-00082 #define __PSOCK_H__
-00083 
-00084 #include "uipopt.h"
-00085 #include "pt.h"
-00086 
-00087  /*
-00088  * The structure that holds the state of a buffer.
-00089  *
-00090  * This structure holds the state of a uIP buffer. The structure has
-00091  * no user-visible elements, but is used through the functions
-00092  * provided by the library.
-00093  *
-00094  */
-00095 struct psock_buf {
-00096   u8_t *ptr;
-00097   unsigned short left;
-00098 };
-00099 
-00100 /**
-00101  * The representation of a protosocket.
-00102  *
-00103  * The protosocket structrure is an opaque structure with no user-visible
-00104  * elements.
-00105  */
-00106 struct psock {
-00107   struct pt pt, psockpt; /* Protothreads - one that's using the psock
-00108                             functions, and one that runs inside the
-00109                             psock functions. */
-00110   const u8_t *sendptr;   /* Pointer to the next data to be sent. */
-00111   u8_t *readptr;         /* Pointer to the next data to be read. */
-00112   
-00113   char *bufptr;          /* Pointer to the buffer used for buffering
-00114                             incoming data. */
-00115   
-00116   u16_t sendlen;         /* The number of bytes left to be sent. */
-00117   u16_t readlen;         /* The number of bytes left to be read. */
-00118 
-00119   struct psock_buf buf;  /* The structure holding the state of the
-00120                             input buffer. */
-00121   unsigned int bufsize;  /* The size of the input buffer. */
-00122   
-00123   unsigned char state;   /* The state of the protosocket. */
-00124 };
-00125 
-00126 void psock_init(struct psock *psock, char *buffer, unsigned int buffersize);
-00127 /**
-00128  * Initialize a protosocket.
-00129  *
-00130  * This macro initializes a protosocket and must be called before the
-00131  * protosocket is used. The initialization also specifies the input buffer
-00132  * for the protosocket.
-00133  *
-00134  * \param psock (struct psock *) A pointer to the protosocket to be
-00135  * initialized
-00136  *
-00137  * \param buffer (char *) A pointer to the input buffer for the
-00138  * protosocket.
-00139  *
-00140  * \param buffersize (unsigned int) The size of the input buffer.
-00141  *
-00142  * \hideinitializer
-00143  */
-00144 #define PSOCK_INIT(psock, buffer, buffersize) \
-00145   psock_init(psock, buffer, buffersize)
-00146 
-00147 /**
-00148  * Start the protosocket protothread in a function.
-00149  *
-00150  * This macro starts the protothread associated with the protosocket and
-00151  * must come before other protosocket calls in the function it is used.
-00152  *
-00153  * \param psock (struct psock *) A pointer to the protosocket to be
-00154  * started.
-00155  *
-00156  * \hideinitializer
-00157  */
-00158 #define PSOCK_BEGIN(psock) PT_BEGIN(&((psock)->pt))
-00159 
-00160 PT_THREAD(psock_send(struct psock *psock, const char *buf, unsigned int len));
-00161 /**
-00162  * Send data.
-00163  *
-00164  * This macro sends data over a protosocket. The protosocket protothread blocks
-00165  * until all data has been sent and is known to have been received by
-00166  * the remote end of the TCP connection.
-00167  *
-00168  * \param psock (struct psock *) A pointer to the protosocket over which
-00169  * data is to be sent.
-00170  *
-00171  * \param data (char *) A pointer to the data that is to be sent.
-00172  *
-00173  * \param datalen (unsigned int) The length of the data that is to be
-00174  * sent.
-00175  *
-00176  * \hideinitializer
-00177  */
-00178 #define PSOCK_SEND(psock, data, datalen)                \
-00179     PT_WAIT_THREAD(&((psock)->pt), psock_send(psock, data, datalen))
-00180 
-00181 /**
-00182  * \brief      Send a null-terminated string.
-00183  * \param psock Pointer to the protosocket.
-00184  * \param str  The string to be sent.
-00185  *
-00186  *             This function sends a null-terminated string over the
-00187  *             protosocket.
-00188  *
-00189  * \hideinitializer
-00190  */
-00191 #define PSOCK_SEND_STR(psock, str)                      \
-00192     PT_WAIT_THREAD(&((psock)->pt), psock_send(psock, str, strlen(str)))
-00193 
-00194 PT_THREAD(psock_generator_send(struct psock *psock,
-00195                                 unsigned short (*f)(void *), void *arg));
-00196 
-00197 /**
-00198  * \brief      Generate data with a function and send it
-00199  * \param psock Pointer to the protosocket.
-00200  * \param generator Pointer to the generator function
-00201  * \param arg   Argument to the generator function
-00202  *
-00203  *             This function generates data and sends it over the
-00204  *             protosocket. This can be used to dynamically generate
-00205  *             data for a transmission, instead of generating the data
-00206  *             in a buffer beforehand. This function reduces the need for
-00207  *             buffer memory. The generator function is implemented by
-00208  *             the application, and a pointer to the function is given
-00209  *             as an argument with the call to PSOCK_GENERATOR_SEND().
-00210  *
-00211  *             The generator function should place the generated data
-00212  *             directly in the uip_appdata buffer, and return the
-00213  *             length of the generated data. The generator function is
-00214  *             called by the protosocket layer when the data first is
-00215  *             sent, and once for every retransmission that is needed.
-00216  *
-00217  * \hideinitializer
-00218  */
-00219 #define PSOCK_GENERATOR_SEND(psock, generator, arg)     \
-00220     PT_WAIT_THREAD(&((psock)->pt),                                      \
-00221                    psock_generator_send(psock, generator, arg))
-00222 
-00223 
-00224 /**
-00225  * Close a protosocket.
-00226  *
-00227  * This macro closes a protosocket and can only be called from within the
-00228  * protothread in which the protosocket lives.
-00229  *
-00230  * \param psock (struct psock *) A pointer to the protosocket that is to
-00231  * be closed.
-00232  *
-00233  * \hideinitializer
-00234  */
-00235 #define PSOCK_CLOSE(psock) uip_close()
-00236 
-00237 PT_THREAD(psock_readbuf(struct psock *psock));
-00238 /**
-00239  * Read data until the buffer is full.
-00240  *
-00241  * This macro will block waiting for data and read the data into the
-00242  * input buffer specified with the call to PSOCK_INIT(). Data is read
-00243  * until the buffer is full..
-00244  *
-00245  * \param psock (struct psock *) A pointer to the protosocket from which
-00246  * data should be read.
-00247  *
-00248  * \hideinitializer
-00249  */
-00250 #define PSOCK_READBUF(psock)                            \
-00251   PT_WAIT_THREAD(&((psock)->pt), psock_readbuf(psock))
-00252 
-00253 PT_THREAD(psock_readto(struct psock *psock, unsigned char c));
-00254 /**
-00255  * Read data up to a specified character.
-00256  *
-00257  * This macro will block waiting for data and read the data into the
-00258  * input buffer specified with the call to PSOCK_INIT(). Data is only
-00259  * read until the specifieed character appears in the data stream.
-00260  *
-00261  * \param psock (struct psock *) A pointer to the protosocket from which
-00262  * data should be read.
-00263  *
-00264  * \param c (char) The character at which to stop reading.
-00265  *
-00266  * \hideinitializer
-00267  */
-00268 #define PSOCK_READTO(psock, c)                          \
-00269   PT_WAIT_THREAD(&((psock)->pt), psock_readto(psock, c))
-00270 
-00271 /**
-00272  * The length of the data that was previously read.
-00273  *
-00274  * This macro returns the length of the data that was previously read
-00275  * using PSOCK_READTO() or PSOCK_READ().
-00276  *
-00277  * \param psock (struct psock *) A pointer to the protosocket holding the data.
-00278  *
-00279  * \hideinitializer
-00280  */
-00281 #define PSOCK_DATALEN(psock) psock_datalen(psock)
-00282 
-00283 u16_t psock_datalen(struct psock *psock);
-00284 
-00285 /**
-00286  * Exit the protosocket's protothread.
-00287  *
-00288  * This macro terminates the protothread of the protosocket and should
-00289  * almost always be used in conjunction with PSOCK_CLOSE().
-00290  *
-00291  * \sa PSOCK_CLOSE_EXIT()
-00292  *
-00293  * \param psock (struct psock *) A pointer to the protosocket.
-00294  *
-00295  * \hideinitializer
-00296  */
-00297 #define PSOCK_EXIT(psock) PT_EXIT(&((psock)->pt))
-00298 
-00299 /**
-00300  * Close a protosocket and exit the protosocket's protothread.
-00301  *
-00302  * This macro closes a protosocket and exits the protosocket's protothread.
-00303  *
-00304  * \param psock (struct psock *) A pointer to the protosocket.
-00305  *
-00306  * \hideinitializer
-00307  */
-00308 #define PSOCK_CLOSE_EXIT(psock)         \
-00309   do {                                          \
-00310     PSOCK_CLOSE(psock);                 \
-00311     PSOCK_EXIT(psock);                  \
-00312   } while(0)
-00313 
-00314 /**
-00315  * Declare the end of a protosocket's protothread.
-00316  *
-00317  * This macro is used for declaring that the protosocket's protothread
-00318  * ends. It must always be used together with a matching PSOCK_BEGIN()
-00319  * macro.
-00320  *
-00321  * \param psock (struct psock *) A pointer to the protosocket.
-00322  *
-00323  * \hideinitializer
-00324  */
-00325 #define PSOCK_END(psock) PT_END(&((psock)->pt))
-00326 
-00327 char psock_newdata(struct psock *s);
-00328 
-00329 /**
-00330  * Check if new data has arrived on a protosocket.
-00331  *
-00332  * This macro is used in conjunction with the PSOCK_WAIT_UNTIL()
-00333  * macro to check if data has arrived on a protosocket.
-00334  *
-00335  * \param psock (struct psock *) A pointer to the protosocket.
-00336  *
-00337  * \hideinitializer
-00338  */
-00339 #define PSOCK_NEWDATA(psock) psock_newdata(psock)
-00340 
-00341 /**
-00342  * Wait until a condition is true.
-00343  *
-00344  * This macro blocks the protothread until the specified condition is
-00345  * true. The macro PSOCK_NEWDATA() can be used to check if new data
-00346  * arrives when the protosocket is waiting.
-00347  *
-00348  * Typically, this macro is used as follows:
-00349  *
-00350  \code
-00351  PT_THREAD(thread(struct psock *s, struct timer *t))
-00352  {
-00353    PSOCK_BEGIN(s);
-00354 
-00355    PSOCK_WAIT_UNTIL(s, PSOCK_NEWADATA(s) || timer_expired(t));
-00356    
-00357    if(PSOCK_NEWDATA(s)) {
-00358      PSOCK_READTO(s, '\n');
-00359    } else {
-00360      handle_timed_out(s);
-00361    }
-00362    
-00363    PSOCK_END(s);
-00364  }
-00365  \endcode
-00366  *
-00367  * \param psock (struct psock *) A pointer to the protosocket.
-00368  * \param condition The condition to wait for.
-00369  *
-00370  * \hideinitializer
-00371  */
-00372 #define PSOCK_WAIT_UNTIL(psock, condition)    \
-00373   PT_WAIT_UNTIL(&((psock)->pt), (condition));
-00374 
-00375 #define PSOCK_WAIT_THREAD(psock, condition)   \
-00376   PT_WAIT_THREAD(&((psock)->pt), (condition))
-00377 
-00378 #endif /* __PSOCK_H__ */
-00379 
-00380 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00194.html b/components/net/uip/doc/html/a00194.html deleted file mode 100644 index 5e303b897e..0000000000 --- a/components/net/uip/doc/html/a00194.html +++ /dev/null @@ -1,348 +0,0 @@ - - -uIP 1.0: uip/pt.h Source File - - - - - - -

uip/pt.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: pt.h,v 1.2 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 /**
-00037  * \addtogroup pt
-00038  * @{
-00039  */
-00040 
-00041 /**
-00042  * \file
-00043  * Protothreads implementation.
-00044  * \author
-00045  * Adam Dunkels <adam@sics.se>
-00046  *
-00047  */
-00048 
-00049 #ifndef __PT_H__
-00050 #define __PT_H__
-00051 
-00052 #include "lc.h"
-00053 
-00054 struct pt {
-00055   lc_t lc;
-00056 };
-00057 
-00058 #define PT_WAITING 0
-00059 #define PT_EXITED  1
-00060 #define PT_ENDED   2
-00061 #define PT_YIELDED 3
-00062 
-00063 /**
-00064  * \name Initialization
-00065  * @{
-00066  */
-00067 
-00068 /**
-00069  * Initialize a protothread.
-00070  *
-00071  * Initializes a protothread. Initialization must be done prior to
-00072  * starting to execute the protothread.
-00073  *
-00074  * \param pt A pointer to the protothread control structure.
-00075  *
-00076  * \sa PT_SPAWN()
-00077  *
-00078  * \hideinitializer
-00079  */
-00080 #define PT_INIT(pt)   LC_INIT((pt)->lc)
-00081 
-00082 /** @} */
-00083 
-00084 /**
-00085  * \name Declaration and definition
-00086  * @{
-00087  */
-00088 
-00089 /**
-00090  * Declaration of a protothread.
-00091  *
-00092  * This macro is used to declare a protothread. All protothreads must
-00093  * be declared with this macro.
-00094  *
-00095  * \param name_args The name and arguments of the C function
-00096  * implementing the protothread.
-00097  *
-00098  * \hideinitializer
-00099  */
-00100 #define PT_THREAD(name_args) char name_args
-00101 
-00102 /**
-00103  * Declare the start of a protothread inside the C function
-00104  * implementing the protothread.
-00105  *
-00106  * This macro is used to declare the starting point of a
-00107  * protothread. It should be placed at the start of the function in
-00108  * which the protothread runs. All C statements above the PT_BEGIN()
-00109  * invokation will be executed each time the protothread is scheduled.
-00110  *
-00111  * \param pt A pointer to the protothread control structure.
-00112  *
-00113  * \hideinitializer
-00114  */
-00115 #define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc)
-00116 
-00117 /**
-00118  * Declare the end of a protothread.
-00119  *
-00120  * This macro is used for declaring that a protothread ends. It must
-00121  * always be used together with a matching PT_BEGIN() macro.
-00122  *
-00123  * \param pt A pointer to the protothread control structure.
-00124  *
-00125  * \hideinitializer
-00126  */
-00127 #define PT_END(pt) LC_END((pt)->lc); PT_YIELD_FLAG = 0; \
-00128                    PT_INIT(pt); return PT_ENDED; }
-00129 
-00130 /** @} */
-00131 
-00132 /**
-00133  * \name Blocked wait
-00134  * @{
-00135  */
-00136 
-00137 /**
-00138  * Block and wait until condition is true.
-00139  *
-00140  * This macro blocks the protothread until the specified condition is
-00141  * true.
-00142  *
-00143  * \param pt A pointer to the protothread control structure.
-00144  * \param condition The condition.
-00145  *
-00146  * \hideinitializer
-00147  */
-00148 #define PT_WAIT_UNTIL(pt, condition)            \
-00149   do {                                          \
-00150     LC_SET((pt)->lc);                           \
-00151     if(!(condition)) {                          \
-00152       return PT_WAITING;                        \
-00153     }                                           \
-00154   } while(0)
-00155 
-00156 /**
-00157  * Block and wait while condition is true.
-00158  *
-00159  * This function blocks and waits while condition is true. See
-00160  * PT_WAIT_UNTIL().
-00161  *
-00162  * \param pt A pointer to the protothread control structure.
-00163  * \param cond The condition.
-00164  *
-00165  * \hideinitializer
-00166  */
-00167 #define PT_WAIT_WHILE(pt, cond)  PT_WAIT_UNTIL((pt), !(cond))
-00168 
-00169 /** @} */
-00170 
-00171 /**
-00172  * \name Hierarchical protothreads
-00173  * @{
-00174  */
-00175 
-00176 /**
-00177  * Block and wait until a child protothread completes.
-00178  *
-00179  * This macro schedules a child protothread. The current protothread
-00180  * will block until the child protothread completes.
-00181  *
-00182  * \note The child protothread must be manually initialized with the
-00183  * PT_INIT() function before this function is used.
-00184  *
-00185  * \param pt A pointer to the protothread control structure.
-00186  * \param thread The child protothread with arguments
-00187  *
-00188  * \sa PT_SPAWN()
-00189  *
-00190  * \hideinitializer
-00191  */
-00192 #define PT_WAIT_THREAD(pt, thread) PT_WAIT_WHILE((pt), PT_SCHEDULE(thread))
-00193 
-00194 /**
-00195  * Spawn a child protothread and wait until it exits.
-00196  *
-00197  * This macro spawns a child protothread and waits until it exits. The
-00198  * macro can only be used within a protothread.
-00199  *
-00200  * \param pt A pointer to the protothread control structure.
-00201  * \param child A pointer to the child protothread's control structure.
-00202  * \param thread The child protothread with arguments
-00203  *
-00204  * \hideinitializer
-00205  */
-00206 #define PT_SPAWN(pt, child, thread)             \
-00207   do {                                          \
-00208     PT_INIT((child));                           \
-00209     PT_WAIT_THREAD((pt), (thread));             \
-00210   } while(0)
-00211 
-00212 /** @} */
-00213 
-00214 /**
-00215  * \name Exiting and restarting
-00216  * @{
-00217  */
-00218 
-00219 /**
-00220  * Restart the protothread.
-00221  *
-00222  * This macro will block and cause the running protothread to restart
-00223  * its execution at the place of the PT_BEGIN() call.
-00224  *
-00225  * \param pt A pointer to the protothread control structure.
-00226  *
-00227  * \hideinitializer
-00228  */
-00229 #define PT_RESTART(pt)                          \
-00230   do {                                          \
-00231     PT_INIT(pt);                                \
-00232     return PT_WAITING;                  \
-00233   } while(0)
-00234 
-00235 /**
-00236  * Exit the protothread.
-00237  *
-00238  * This macro causes the protothread to exit. If the protothread was
-00239  * spawned by another protothread, the parent protothread will become
-00240  * unblocked and can continue to run.
-00241  *
-00242  * \param pt A pointer to the protothread control structure.
-00243  *
-00244  * \hideinitializer
-00245  */
-00246 #define PT_EXIT(pt)                             \
-00247   do {                                          \
-00248     PT_INIT(pt);                                \
-00249     return PT_EXITED;                   \
-00250   } while(0)
-00251 
-00252 /** @} */
-00253 
-00254 /**
-00255  * \name Calling a protothread
-00256  * @{
-00257  */
-00258 
-00259 /**
-00260  * Schedule a protothread.
-00261  *
-00262  * This function shedules a protothread. The return value of the
-00263  * function is non-zero if the protothread is running or zero if the
-00264  * protothread has exited.
-00265  *
-00266  * \param f The call to the C function implementing the protothread to
-00267  * be scheduled
-00268  *
-00269  * \hideinitializer
-00270  */
-00271 #define PT_SCHEDULE(f) ((f) == PT_WAITING)
-00272 
-00273 /** @} */
-00274 
-00275 /**
-00276  * \name Yielding from a protothread
-00277  * @{
-00278  */
-00279 
-00280 /**
-00281  * Yield from the current protothread.
-00282  *
-00283  * This function will yield the protothread, thereby allowing other
-00284  * processing to take place in the system.
-00285  *
-00286  * \param pt A pointer to the protothread control structure.
-00287  *
-00288  * \hideinitializer
-00289  */
-00290 #define PT_YIELD(pt)                            \
-00291   do {                                          \
-00292     PT_YIELD_FLAG = 0;                          \
-00293     LC_SET((pt)->lc);                           \
-00294     if(PT_YIELD_FLAG == 0) {                    \
-00295       return PT_YIELDED;                        \
-00296     }                                           \
-00297   } while(0)
-00298 
-00299 /**
-00300  * \brief      Yield from the protothread until a condition occurs.
-00301  * \param pt   A pointer to the protothread control structure.
-00302  * \param cond The condition.
-00303  *
-00304  *             This function will yield the protothread, until the
-00305  *             specified condition evaluates to true.
-00306  *
-00307  *
-00308  * \hideinitializer
-00309  */
-00310 #define PT_YIELD_UNTIL(pt, cond)                \
-00311   do {                                          \
-00312     PT_YIELD_FLAG = 0;                          \
-00313     LC_SET((pt)->lc);                           \
-00314     if((PT_YIELD_FLAG == 0) || !(cond)) {       \
-00315       return PT_YIELDED;                        \
-00316     }                                           \
-00317   } while(0)
-00318 
-00319 /** @} */
-00320 
-00321 #endif /* __PT_H__ */
-00322 
-00323 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00195.html b/components/net/uip/doc/html/a00195.html deleted file mode 100644 index fa2e608e8a..0000000000 --- a/components/net/uip/doc/html/a00195.html +++ /dev/null @@ -1,152 +0,0 @@ - - -uIP 1.0: uip/timer.c Source File - - - - - - -

uip/timer.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup timer
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \file
-00008  * Timer library implementation.
-00009  * \author
-00010  * Adam Dunkels <adam@sics.se>
-00011  */
-00012 
-00013 /*
-00014  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00015  * All rights reserved.
-00016  *
-00017  * Redistribution and use in source and binary forms, with or without
-00018  * modification, are permitted provided that the following conditions
-00019  * are met:
-00020  * 1. Redistributions of source code must retain the above copyright
-00021  *    notice, this list of conditions and the following disclaimer.
-00022  * 2. Redistributions in binary form must reproduce the above copyright
-00023  *    notice, this list of conditions and the following disclaimer in the
-00024  *    documentation and/or other materials provided with the distribution.
-00025  * 3. Neither the name of the Institute nor the names of its contributors
-00026  *    may be used to endorse or promote products derived from this software
-00027  *    without specific prior written permission.
-00028  *
-00029  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00030  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00031  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00032  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00033  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00034  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00035  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00036  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00037  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00038  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00039  * SUCH DAMAGE.
-00040  *
-00041  * This file is part of the uIP TCP/IP stack
-00042  *
-00043  * Author: Adam Dunkels <adam@sics.se>
-00044  *
-00045  * $Id: timer.c,v 1.2 2006/06/12 08:00:30 adam Exp $
-00046  */
-00047 
-00048 #include "clock.h"
-00049 #include "timer.h"
-00050 
-00051 /*---------------------------------------------------------------------------*/
-00052 /**
-00053  * Set a timer.
-00054  *
-00055  * This function is used to set a timer for a time sometime in the
-00056  * future. The function timer_expired() will evaluate to true after
-00057  * the timer has expired.
-00058  *
-00059  * \param t A pointer to the timer
-00060  * \param interval The interval before the timer expires.
-00061  *
-00062  */
-00063 void
-00064 timer_set(struct timer *t, clock_time_t interval)
-00065 {
-00066   t->interval = interval;
-00067   t->start = clock_time();
-00068 }
-00069 /*---------------------------------------------------------------------------*/
-00070 /**
-00071  * Reset the timer with the same interval.
-00072  *
-00073  * This function resets the timer with the same interval that was
-00074  * given to the timer_set() function. The start point of the interval
-00075  * is the exact time that the timer last expired. Therefore, this
-00076  * function will cause the timer to be stable over time, unlike the
-00077  * timer_rester() function.
-00078  *
-00079  * \param t A pointer to the timer.
-00080  *
-00081  * \sa timer_restart()
-00082  */
-00083 void
-00084 timer_reset(struct timer *t)
-00085 {
-00086   t->start += t->interval;
-00087 }
-00088 /*---------------------------------------------------------------------------*/
-00089 /**
-00090  * Restart the timer from the current point in time
-00091  *
-00092  * This function restarts a timer with the same interval that was
-00093  * given to the timer_set() function. The timer will start at the
-00094  * current time.
-00095  *
-00096  * \note A periodic timer will drift if this function is used to reset
-00097  * it. For preioric timers, use the timer_reset() function instead.
-00098  *
-00099  * \param t A pointer to the timer.
-00100  *
-00101  * \sa timer_reset()
-00102  */
-00103 void
-00104 timer_restart(struct timer *t)
-00105 {
-00106   t->start = clock_time();
-00107 }
-00108 /*---------------------------------------------------------------------------*/
-00109 /**
-00110  * Check if a timer has expired.
-00111  *
-00112  * This function tests if a timer has expired and returns true or
-00113  * false depending on its status.
-00114  *
-00115  * \param t A pointer to the timer
-00116  *
-00117  * \return Non-zero if the timer has expired, zero otherwise.
-00118  *
-00119  */
-00120 int
-00121 timer_expired(struct timer *t)
-00122 {
-00123   return (clock_time_t)(clock_time() - t->start) >= (clock_time_t)t->interval;
-00124 }
-00125 /*---------------------------------------------------------------------------*/
-00126 
-00127 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00196.html b/components/net/uip/doc/html/a00196.html deleted file mode 100644 index c72141b725..0000000000 --- a/components/net/uip/doc/html/a00196.html +++ /dev/null @@ -1,111 +0,0 @@ - - -uIP 1.0: uip/timer.h Source File - - - - - - -

uip/timer.h

Go to the documentation of this file.
00001 /**
-00002  * \defgroup timer Timer library
-00003  *
-00004  * The timer library provides functions for setting, resetting and
-00005  * restarting timers, and for checking if a timer has expired. An
-00006  * application must "manually" check if its timers have expired; this
-00007  * is not done automatically.
-00008  *
-00009  * A timer is declared as a \c struct \c timer and all access to the
-00010  * timer is made by a pointer to the declared timer.
-00011  *
-00012  * \note The timer library uses the \ref clock "Clock library" to
-00013  * measure time. Intervals should be specified in the format used by
-00014  * the clock library.
-00015  *
-00016  * @{
-00017  */
-00018 
-00019 
-00020 /**
-00021  * \file
-00022  * Timer library header file.
-00023  * \author
-00024  * Adam Dunkels <adam@sics.se>
-00025  */
-00026 
-00027 /*
-00028  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00029  * All rights reserved.
-00030  *
-00031  * Redistribution and use in source and binary forms, with or without
-00032  * modification, are permitted provided that the following conditions
-00033  * are met:
-00034  * 1. Redistributions of source code must retain the above copyright
-00035  *    notice, this list of conditions and the following disclaimer.
-00036  * 2. Redistributions in binary form must reproduce the above copyright
-00037  *    notice, this list of conditions and the following disclaimer in the
-00038  *    documentation and/or other materials provided with the distribution.
-00039  * 3. Neither the name of the Institute nor the names of its contributors
-00040  *    may be used to endorse or promote products derived from this software
-00041  *    without specific prior written permission.
-00042  *
-00043  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00044  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00045  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00046  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00047  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00048  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00049  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00050  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00051  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00052  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00053  * SUCH DAMAGE.
-00054  *
-00055  * This file is part of the uIP TCP/IP stack
-00056  *
-00057  * Author: Adam Dunkels <adam@sics.se>
-00058  *
-00059  * $Id: timer.h,v 1.3 2006/06/11 21:46:39 adam Exp $
-00060  */
-00061 #ifndef __TIMER_H__
-00062 #define __TIMER_H__
-00063 
-00064 #include "clock.h"
-00065 
-00066 /**
-00067  * A timer.
-00068  *
-00069  * This structure is used for declaring a timer. The timer must be set
-00070  * with timer_set() before it can be used.
-00071  *
-00072  * \hideinitializer
-00073  */
-00074 struct timer {
-00075   clock_time_t start;
-00076   clock_time_t interval;
-00077 };
-00078 
-00079 void timer_set(struct timer *t, clock_time_t interval);
-00080 void timer_reset(struct timer *t);
-00081 void timer_restart(struct timer *t);
-00082 int timer_expired(struct timer *t);
-00083 
-00084 #endif /* __TIMER_H__ */
-00085 
-00086 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00197.html b/components/net/uip/doc/html/a00197.html deleted file mode 100644 index d8f85aa30f..0000000000 --- a/components/net/uip/doc/html/a00197.html +++ /dev/null @@ -1,183 +0,0 @@ - - -uIP 1.0: uip/uip-neighbor.c Source File - - - - - - -

uip/uip-neighbor.c

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2006, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * $Id: uip-neighbor.c,v 1.2 2006/06/12 08:00:30 adam Exp $
-00032  */
-00033 
-00034 /**
-00035  * \file
-00036  *         Database of link-local neighbors, used by IPv6 code and
-00037  *         to be used by a future ARP code rewrite.
-00038  * \author
-00039  *         Adam Dunkels <adam@sics.se>
-00040  */
-00041 
-00042 #include "uip-neighbor.h"
-00043 
-00044 #include <string.h>
-00045 
-00046 #define MAX_TIME 128
-00047 
-00048 #ifdef UIP_NEIGHBOR_CONF_ENTRIES
-00049 #define ENTRIES UIP_NEIGHBOR_CONF_ENTRIES
-00050 #else /* UIP_NEIGHBOR_CONF_ENTRIES */
-00051 #define ENTRIES 8
-00052 #endif /* UIP_NEIGHBOR_CONF_ENTRIES */
-00053 
-00054 struct neighbor_entry {
-00055   uip_ipaddr_t ipaddr;
-00056   struct uip_neighbor_addr addr;
-00057   u8_t time;
-00058 };
-00059 static struct neighbor_entry entries[ENTRIES];
-00060 
-00061 /*---------------------------------------------------------------------------*/
-00062 void
-00063 uip_neighbor_init(void)
-00064 {
-00065   int i;
-00066 
-00067   for(i = 0; i < ENTRIES; ++i) {
-00068     entries[i].time = MAX_TIME;
-00069   }
-00070 }
-00071 /*---------------------------------------------------------------------------*/
-00072 void
-00073 uip_neighbor_periodic(void)
-00074 {
-00075   int i;
-00076 
-00077   for(i = 0; i < ENTRIES; ++i) {
-00078     if(entries[i].time < MAX_TIME) {
-00079       entries[i].time++;
-00080     }
-00081   }
-00082 }
-00083 /*---------------------------------------------------------------------------*/
-00084 void
-00085 uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr)
-00086 {
-00087   int i, oldest;
-00088   u8_t oldest_time;
-00089 
-00090   printf("Adding neighbor with link address %02x:%02x:%02x:%02x:%02x:%02x\n",
-00091          addr->addr.addr[0], addr->addr.addr[1], addr->addr.addr[2], addr->addr.addr[3],
-00092          addr->addr.addr[4], addr->addr.addr[5]);
-00093   
-00094   /* Find the first unused entry or the oldest used entry. */
-00095   oldest_time = 0;
-00096   oldest = 0;
-00097   for(i = 0; i < ENTRIES; ++i) {
-00098     if(entries[i].time == MAX_TIME) {
-00099       oldest = i;
-00100       break;
-00101     }
-00102     if(uip_ipaddr_cmp(entries[i].ipaddr, addr)) {
-00103       oldest = i;
-00104       break;
-00105     }
-00106     if(entries[i].time > oldest_time) {
-00107       oldest = i;
-00108       oldest_time = entries[i].time;
-00109     }
-00110   }
-00111 
-00112   /* Use the oldest or first free entry (either pointed to by the
-00113      "oldest" variable). */
-00114   entries[oldest].time = 0;
-00115   uip_ipaddr_copy(entries[oldest].ipaddr, ipaddr);
-00116   memcpy(&entries[oldest].addr, addr, sizeof(struct uip_neighbor_addr));
-00117 }
-00118 /*---------------------------------------------------------------------------*/
-00119 static struct neighbor_entry *
-00120 find_entry(uip_ipaddr_t ipaddr)
-00121 {
-00122   int i;
-00123   
-00124   for(i = 0; i < ENTRIES; ++i) {
-00125     if(uip_ipaddr_cmp(entries[i].ipaddr, ipaddr)) {
-00126       return &entries[i];
-00127     }
-00128   }
-00129   return NULL;
-00130 }
-00131 /*---------------------------------------------------------------------------*/
-00132 void
-00133 uip_neighbor_update(uip_ipaddr_t ipaddr)
-00134 {
-00135   struct neighbor_entry *e;
-00136 
-00137   e = find_entry(ipaddr);
-00138   if(e != NULL) {
-00139     e->time = 0;
-00140   }
-00141 }
-00142 /*---------------------------------------------------------------------------*/
-00143 struct uip_neighbor_addr *
-00144 uip_neighbor_lookup(uip_ipaddr_t ipaddr)
-00145 {
-00146   struct neighbor_entry *e;
-00147 
-00148   e = find_entry(ipaddr);
-00149   if(e != NULL) {
-00150     /*    printf("Lookup neighbor with link address %02x:%02x:%02x:%02x:%02x:%02x\n",
-00151            e->addr.addr.addr[0], e->addr.addr.addr[1], e->addr.addr.addr[2], e->addr.addr.addr[3],
-00152            e->addr.addr.addr[4], e->addr.addr.addr[5]);*/
-00153 
-00154     return &e->addr;
-00155   }
-00156   return NULL;
-00157 }
-00158 /*---------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00198.html b/components/net/uip/doc/html/a00198.html deleted file mode 100644 index ce7cb56de7..0000000000 --- a/components/net/uip/doc/html/a00198.html +++ /dev/null @@ -1,86 +0,0 @@ - - -uIP 1.0: uip/uip-neighbor.h Source File - - - - - - -

uip/uip-neighbor.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2006, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * $Id: uip-neighbor.h,v 1.2 2006/06/12 08:00:30 adam Exp $
-00032  */
-00033 
-00034 /**
-00035  * \file
-00036  *         Header file for database of link-local neighbors, used by
-00037  *         IPv6 code and to be used by future ARP code.
-00038  * \author
-00039  *         Adam Dunkels <adam@sics.se>
-00040  */
-00041 
-00042 #ifndef __UIP_NEIGHBOR_H__
-00043 #define __UIP_NEIGHBOR_H__
-00044 
-00045 #include "uip.h"
-00046 
-00047 struct uip_neighbor_addr {
-00048 #if UIP_NEIGHBOR_CONF_ADDRTYPE
-00049   UIP_NEIGHBOR_CONF_ADDRTYPE addr;
-00050 #else
-00051   struct uip_eth_addr addr;
-00052 #endif
-00053 };
-00054 
-00055 void uip_neighbor_init(void);
-00056 void uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr);
-00057 void uip_neighbor_update(uip_ipaddr_t ipaddr);
-00058 struct uip_neighbor_addr *uip_neighbor_lookup(uip_ipaddr_t ipaddr);
-00059 void uip_neighbor_periodic(void);
-00060 
-00061 #endif /* __UIP-NEIGHBOR_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00199.html b/components/net/uip/doc/html/a00199.html deleted file mode 100644 index f33889b582..0000000000 --- a/components/net/uip/doc/html/a00199.html +++ /dev/null @@ -1,161 +0,0 @@ - - -uIP 1.0: uip/uip-split.c Source File - - - - - - -

uip/uip-split.c

00001 /*
-00002  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: uip-split.c,v 1.2 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 
-00036 #include <string.h>
-00037 
-00038 #include "uip-split.h"
-00039 #include "uip.h"
-00040 #include "uip-fw.h"
-00041 #include "uip_arch.h"
-00042 
-00043 
-00044 
-00045 #define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
-00046 
-00047 /*-----------------------------------------------------------------------------*/
-00048 void
-00049 uip_split_output(void)
-00050 {
-00051   u16_t tcplen, len1, len2;
-00052 
-00053   /* We only try to split maximum sized TCP segments. */
-00054   if(BUF->proto == UIP_PROTO_TCP &&
-00055      uip_len == UIP_BUFSIZE - UIP_LLH_LEN) {
-00056 
-00057     tcplen = uip_len - UIP_TCPIP_HLEN;
-00058     /* Split the segment in two. If the original packet length was
-00059        odd, we make the second packet one byte larger. */
-00060     len1 = len2 = tcplen / 2;
-00061     if(len1 + len2 < tcplen) {
-00062       ++len2;
-00063     }
-00064 
-00065     /* Create the first packet. This is done by altering the length
-00066        field of the IP header and updating the checksums. */
-00067     uip_len = len1 + UIP_TCPIP_HLEN;
-00068 #if UIP_CONF_IPV6
-00069     /* For IPv6, the IP length field does not include the IPv6 IP header
-00070        length. */
-00071     BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
-00072     BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
-00073 #else /* UIP_CONF_IPV6 */
-00074     BUF->len[0] = uip_len >> 8;
-00075     BUF->len[1] = uip_len & 0xff;
-00076 #endif /* UIP_CONF_IPV6 */
-00077     
-00078     /* Recalculate the TCP checksum. */
-00079     BUF->tcpchksum = 0;
-00080     BUF->tcpchksum = ~(uip_tcpchksum());
-00081 
-00082 #if !UIP_CONF_IPV6
-00083     /* Recalculate the IP checksum. */
-00084     BUF->ipchksum = 0;
-00085     BUF->ipchksum = ~(uip_ipchksum());
-00086 #endif /* UIP_CONF_IPV6 */
-00087     
-00088     /* Transmit the first packet. */
-00089     /*    uip_fw_output();*/
-00090     tcpip_output();
-00091 
-00092     /* Now, create the second packet. To do this, it is not enough to
-00093        just alter the length field, but we must also update the TCP
-00094        sequence number and point the uip_appdata to a new place in
-00095        memory. This place is detemined by the length of the first
-00096        packet (len1). */
-00097     uip_len = len2 + UIP_TCPIP_HLEN;
-00098 #if UIP_CONF_IPV6
-00099     /* For IPv6, the IP length field does not include the IPv6 IP header
-00100        length. */
-00101     BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
-00102     BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
-00103 #else /* UIP_CONF_IPV6 */
-00104     BUF->len[0] = uip_len >> 8;
-00105     BUF->len[1] = uip_len & 0xff;
-00106 #endif /* UIP_CONF_IPV6 */
-00107     
-00108     /*    uip_appdata += len1;*/
-00109     memcpy(uip_appdata, (u8_t *)uip_appdata + len1, len2);
-00110 
-00111     uip_add32(BUF->seqno, len1);
-00112     BUF->seqno[0] = uip_acc32[0];
-00113     BUF->seqno[1] = uip_acc32[1];
-00114     BUF->seqno[2] = uip_acc32[2];
-00115     BUF->seqno[3] = uip_acc32[3];
-00116     
-00117     /* Recalculate the TCP checksum. */
-00118     BUF->tcpchksum = 0;
-00119     BUF->tcpchksum = ~(uip_tcpchksum());
-00120 
-00121 #if !UIP_CONF_IPV6
-00122     /* Recalculate the IP checksum. */
-00123     BUF->ipchksum = 0;
-00124     BUF->ipchksum = ~(uip_ipchksum());
-00125 #endif /* UIP_CONF_IPV6 */
-00126 
-00127     /* Transmit the second packet. */
-00128     /*    uip_fw_output();*/
-00129     tcpip_output();
-00130   } else {
-00131     /*    uip_fw_output();*/
-00132     tcpip_output();
-00133   }
-00134      
-00135 }
-00136 /*-----------------------------------------------------------------------------*/
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00200.html b/components/net/uip/doc/html/a00200.html deleted file mode 100644 index 9371423f38..0000000000 --- a/components/net/uip/doc/html/a00200.html +++ /dev/null @@ -1,121 +0,0 @@ - - -uIP 1.0: uip/uip-split.h Source File - - - - - - -

uip/uip-split.h

Go to the documentation of this file.
00001 /*
-00002  * Copyright (c) 2004, Swedish Institute of Computer Science.
-00003  * All rights reserved.
-00004  *
-00005  * Redistribution and use in source and binary forms, with or without
-00006  * modification, are permitted provided that the following conditions
-00007  * are met:
-00008  * 1. Redistributions of source code must retain the above copyright
-00009  *    notice, this list of conditions and the following disclaimer.
-00010  * 2. Redistributions in binary form must reproduce the above copyright
-00011  *    notice, this list of conditions and the following disclaimer in the
-00012  *    documentation and/or other materials provided with the distribution.
-00013  * 3. Neither the name of the Institute nor the names of its contributors
-00014  *    may be used to endorse or promote products derived from this software
-00015  *    without specific prior written permission.
-00016  *
-00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00027  * SUCH DAMAGE.
-00028  *
-00029  * This file is part of the uIP TCP/IP stack
-00030  *
-00031  * Author: Adam Dunkels <adam@sics.se>
-00032  *
-00033  * $Id: uip-split.h,v 1.2 2006/06/12 08:00:30 adam Exp $
-00034  */
-00035 /**
-00036  * \addtogroup uip
-00037  * @{
-00038  */
-00039 
-00040 /**
-00041  * \defgroup uipsplit uIP TCP throughput booster hack
-00042  * @{
-00043  *
-00044  * The basic uIP TCP implementation only allows each TCP connection to
-00045  * have a single TCP segment in flight at any given time. Because of
-00046  * the delayed ACK algorithm employed by most TCP receivers, uIP's
-00047  * limit on the amount of in-flight TCP segments seriously reduces the
-00048  * maximum achievable throughput for sending data from uIP.
-00049  *
-00050  * The uip-split module is a hack which tries to remedy this
-00051  * situation. By splitting maximum sized outgoing TCP segments into
-00052  * two, the delayed ACK algorithm is not invoked at TCP
-00053  * receivers. This improves the throughput when sending data from uIP
-00054  * by orders of magnitude.
-00055  *
-00056  * The uip-split module uses the uip-fw module (uIP IP packet
-00057  * forwarding) for sending packets. Therefore, the uip-fw module must
-00058  * be set up with the appropriate network interfaces for this module
-00059  * to work.
-00060  */
-00061 
-00062 
-00063 /**
-00064  * \file
-00065  * Module for splitting outbound TCP segments in two to avoid the
-00066  * delayed ACK throughput degradation.
-00067  * \author
-00068  * Adam Dunkels <adam@sics.se>
-00069  *
-00070  */
-00071 
-00072 #ifndef __UIP_SPLIT_H__
-00073 #define __UIP_SPLIT_H__
-00074 
-00075 /**
-00076  * Handle outgoing packets.
-00077  *
-00078  * This function inspects an outgoing packet in the uip_buf buffer and
-00079  * sends it out using the uip_fw_output() function. If the packet is a
-00080  * full-sized TCP segment it will be split into two segments and
-00081  * transmitted separately. This function should be called instead of
-00082  * the actual device driver output function, or the uip_fw_output()
-00083  * function.
-00084  *
-00085  * The headers of the outgoing packet is assumed to be in the uip_buf
-00086  * buffer and the payload is assumed to be wherever uip_appdata
-00087  * points. The length of the outgoing packet is assumed to be in the
-00088  * uip_len variable.
-00089  *
-00090  */
-00091 void uip_split_output(void);
-00092 
-00093 #endif /* __UIP_SPLIT_H__ */
-00094 
-00095 /** @} */
-00096 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00201.html b/components/net/uip/doc/html/a00201.html deleted file mode 100644 index bf6878fb74..0000000000 --- a/components/net/uip/doc/html/a00201.html +++ /dev/null @@ -1,1922 +0,0 @@ - - -uIP 1.0: uip/uip.c Source File - - - - - - -

uip/uip.c

Go to the documentation of this file.
00001 #define DEBUG_PRINTF(...) /*printf(__VA_ARGS__)*/
-00002 
-00003 /**
-00004  * \defgroup uip The uIP TCP/IP stack
-00005  * @{
-00006  *
-00007  * uIP is an implementation of the TCP/IP protocol stack intended for
-00008  * small 8-bit and 16-bit microcontrollers.
-00009  *
-00010  * uIP provides the necessary protocols for Internet communication,
-00011  * with a very small code footprint and RAM requirements - the uIP
-00012  * code size is on the order of a few kilobytes and RAM usage is on
-00013  * the order of a few hundred bytes.
-00014  */
-00015 
-00016 /**
-00017  * \file
-00018  * The uIP TCP/IP stack code.
-00019  * \author Adam Dunkels <adam@dunkels.com>
-00020  */
-00021 
-00022 /*
-00023  * Copyright (c) 2001-2003, Adam Dunkels.
-00024  * All rights reserved.
-00025  *
-00026  * Redistribution and use in source and binary forms, with or without
-00027  * modification, are permitted provided that the following conditions
-00028  * are met:
-00029  * 1. Redistributions of source code must retain the above copyright
-00030  *    notice, this list of conditions and the following disclaimer.
-00031  * 2. Redistributions in binary form must reproduce the above copyright
-00032  *    notice, this list of conditions and the following disclaimer in the
-00033  *    documentation and/or other materials provided with the distribution.
-00034  * 3. The name of the author may not be used to endorse or promote
-00035  *    products derived from this software without specific prior
-00036  *    written permission.
-00037  *
-00038  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00039  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00040  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00041  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00042  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00043  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00044  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00045  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00046  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00047  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00048  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00049  *
-00050  * This file is part of the uIP TCP/IP stack.
-00051  *
-00052  * $Id: uip.c,v 1.65 2006/06/11 21:46:39 adam Exp $
-00053  *
-00054  */
-00055 
-00056 /*
-00057  * uIP is a small implementation of the IP, UDP and TCP protocols (as
-00058  * well as some basic ICMP stuff). The implementation couples the IP,
-00059  * UDP, TCP and the application layers very tightly. To keep the size
-00060  * of the compiled code down, this code frequently uses the goto
-00061  * statement. While it would be possible to break the uip_process()
-00062  * function into many smaller functions, this would increase the code
-00063  * size because of the overhead of parameter passing and the fact that
-00064  * the optimier would not be as efficient.
-00065  *
-00066  * The principle is that we have a small buffer, called the uip_buf,
-00067  * in which the device driver puts an incoming packet. The TCP/IP
-00068  * stack parses the headers in the packet, and calls the
-00069  * application. If the remote host has sent data to the application,
-00070  * this data is present in the uip_buf and the application read the
-00071  * data from there. It is up to the application to put this data into
-00072  * a byte stream if needed. The application will not be fed with data
-00073  * that is out of sequence.
-00074  *
-00075  * If the application whishes to send data to the peer, it should put
-00076  * its data into the uip_buf. The uip_appdata pointer points to the
-00077  * first available byte. The TCP/IP stack will calculate the
-00078  * checksums, and fill in the necessary header fields and finally send
-00079  * the packet back to the peer.
-00080 */
-00081 
-00082 #include "uip.h"
-00083 #include "uipopt.h"
-00084 #include "uip_arch.h"
-00085 
-00086 #if UIP_CONF_IPV6
-00087 #include "uip-neighbor.h"
-00088 #endif /* UIP_CONF_IPV6 */
-00089 
-00090 #include <string.h>
-00091 
-00092 /*---------------------------------------------------------------------------*/
-00093 /* Variable definitions. */
-00094 
-00095 
-00096 /* The IP address of this host. If it is defined to be fixed (by
-00097    setting UIP_FIXEDADDR to 1 in uipopt.h), the address is set
-00098    here. Otherwise, the address */
-00099 #if UIP_FIXEDADDR > 0
-00100 const uip_ipaddr_t uip_hostaddr =
-00101   {HTONS((UIP_IPADDR0 << 8) | UIP_IPADDR1),
-00102    HTONS((UIP_IPADDR2 << 8) | UIP_IPADDR3)};
-00103 const uip_ipaddr_t uip_draddr =
-00104   {HTONS((UIP_DRIPADDR0 << 8) | UIP_DRIPADDR1),
-00105    HTONS((UIP_DRIPADDR2 << 8) | UIP_DRIPADDR3)};
-00106 const uip_ipaddr_t uip_netmask =
-00107   {HTONS((UIP_NETMASK0 << 8) | UIP_NETMASK1),
-00108    HTONS((UIP_NETMASK2 << 8) | UIP_NETMASK3)};
-00109 #else
-00110 uip_ipaddr_t uip_hostaddr, uip_draddr, uip_netmask;
-00111 #endif /* UIP_FIXEDADDR */
-00112 
-00113 static const uip_ipaddr_t all_ones_addr =
-00114 #if UIP_CONF_IPV6
-00115   {0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff};
-00116 #else /* UIP_CONF_IPV6 */
-00117   {0xffff,0xffff};
-00118 #endif /* UIP_CONF_IPV6 */
-00119 static const uip_ipaddr_t all_zeroes_addr =
-00120 #if UIP_CONF_IPV6
-00121   {0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000};
-00122 #else /* UIP_CONF_IPV6 */
-00123   {0x0000,0x0000};
-00124 #endif /* UIP_CONF_IPV6 */
-00125 
-00126 
-00127 #if UIP_FIXEDETHADDR
-00128 const struct uip_eth_addr uip_ethaddr = {{UIP_ETHADDR0,
-00129                                           UIP_ETHADDR1,
-00130                                           UIP_ETHADDR2,
-00131                                           UIP_ETHADDR3,
-00132                                           UIP_ETHADDR4,
-00133                                           UIP_ETHADDR5}};
-00134 #else
-00135 struct uip_eth_addr uip_ethaddr = {{0,0,0,0,0,0}};
-00136 #endif
-00137 
-00138 #ifndef UIP_CONF_EXTERNAL_BUFFER
-00139 u8_t uip_buf[UIP_BUFSIZE + 2];   /* The packet buffer that contains
-00140                                     incoming packets. */
-00141 #endif /* UIP_CONF_EXTERNAL_BUFFER */
-00142 
-00143 void *uip_appdata;               /* The uip_appdata pointer points to
-00144                                     application data. */
-00145 void *uip_sappdata;              /* The uip_appdata pointer points to
-00146                                     the application data which is to
-00147                                     be sent. */
-00148 #if UIP_URGDATA > 0
-00149 void *uip_urgdata;               /* The uip_urgdata pointer points to
-00150                                     urgent data (out-of-band data), if
-00151                                     present. */
-00152 u16_t uip_urglen, uip_surglen;
-00153 #endif /* UIP_URGDATA > 0 */
-00154 
-00155 u16_t uip_len, uip_slen;
-00156                              /* The uip_len is either 8 or 16 bits,
-00157                                 depending on the maximum packet
-00158                                 size. */
-00159 
-00160 u8_t uip_flags;     /* The uip_flags variable is used for
-00161                                 communication between the TCP/IP stack
-00162                                 and the application program. */
-00163 struct uip_conn *uip_conn;   /* uip_conn always points to the current
-00164                                 connection. */
-00165 
-00166 struct uip_conn uip_conns[UIP_CONNS];
-00167                              /* The uip_conns array holds all TCP
-00168                                 connections. */
-00169 u16_t uip_listenports[UIP_LISTENPORTS];
-00170                              /* The uip_listenports list all currently
-00171                                 listning ports. */
-00172 #if UIP_UDP
-00173 struct uip_udp_conn *uip_udp_conn;
-00174 struct uip_udp_conn uip_udp_conns[UIP_UDP_CONNS];
-00175 #endif /* UIP_UDP */
-00176 
-00177 static u16_t ipid;           /* Ths ipid variable is an increasing
-00178                                 number that is used for the IP ID
-00179                                 field. */
-00180 
-00181 void uip_setipid(u16_t id) { ipid = id; }
-00182 
-00183 static u8_t iss[4];          /* The iss variable is used for the TCP
-00184                                 initial sequence number. */
-00185 
-00186 #if UIP_ACTIVE_OPEN
-00187 static u16_t lastport;       /* Keeps track of the last port used for
-00188                                 a new connection. */
-00189 #endif /* UIP_ACTIVE_OPEN */
-00190 
-00191 /* Temporary variables. */
-00192 u8_t uip_acc32[4];
-00193 static u8_t c, opt;
-00194 static u16_t tmp16;
-00195 
-00196 /* Structures and definitions. */
-00197 #define TCP_FIN 0x01
-00198 #define TCP_SYN 0x02
-00199 #define TCP_RST 0x04
-00200 #define TCP_PSH 0x08
-00201 #define TCP_ACK 0x10
-00202 #define TCP_URG 0x20
-00203 #define TCP_CTL 0x3f
-00204 
-00205 #define TCP_OPT_END     0   /* End of TCP options list */
-00206 #define TCP_OPT_NOOP    1   /* "No-operation" TCP option */
-00207 #define TCP_OPT_MSS     2   /* Maximum segment size TCP option */
-00208 
-00209 #define TCP_OPT_MSS_LEN 4   /* Length of TCP MSS option. */
-00210 
-00211 #define ICMP_ECHO_REPLY 0
-00212 #define ICMP_ECHO       8
-00213 
-00214 #define ICMP6_ECHO_REPLY             129
-00215 #define ICMP6_ECHO                   128
-00216 #define ICMP6_NEIGHBOR_SOLICITATION  135
-00217 #define ICMP6_NEIGHBOR_ADVERTISEMENT 136
-00218 
-00219 #define ICMP6_FLAG_S (1 << 6)
-00220 
-00221 #define ICMP6_OPTION_SOURCE_LINK_ADDRESS 1
-00222 #define ICMP6_OPTION_TARGET_LINK_ADDRESS 2
-00223 
-00224 
-00225 /* Macros. */
-00226 #define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
-00227 #define FBUF ((struct uip_tcpip_hdr *)&uip_reassbuf[0])
-00228 #define ICMPBUF ((struct uip_icmpip_hdr *)&uip_buf[UIP_LLH_LEN])
-00229 #define UDPBUF ((struct uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])
-00230 
-00231 
-00232 #if UIP_STATISTICS == 1
-00233 struct uip_stats uip_stat;
-00234 #define UIP_STAT(s) s
-00235 #else
-00236 #define UIP_STAT(s)
-00237 #endif /* UIP_STATISTICS == 1 */
-00238 
-00239 #if UIP_LOGGING == 1
-00240 #include <stdio.h>
-00241 void uip_log(char *msg);
-00242 #define UIP_LOG(m) uip_log(m)
-00243 #else
-00244 #define UIP_LOG(m)
-00245 #endif /* UIP_LOGGING == 1 */
-00246 
-00247 #if ! UIP_ARCH_ADD32
-00248 void
-00249 uip_add32(u8_t *op32, u16_t op16)
-00250 {
-00251   uip_acc32[3] = op32[3] + (op16 & 0xff);
-00252   uip_acc32[2] = op32[2] + (op16 >> 8);
-00253   uip_acc32[1] = op32[1];
-00254   uip_acc32[0] = op32[0];
-00255   
-00256   if(uip_acc32[2] < (op16 >> 8)) {
-00257     ++uip_acc32[1];
-00258     if(uip_acc32[1] == 0) {
-00259       ++uip_acc32[0];
-00260     }
-00261   }
-00262   
-00263   
-00264   if(uip_acc32[3] < (op16 & 0xff)) {
-00265     ++uip_acc32[2];
-00266     if(uip_acc32[2] == 0) {
-00267       ++uip_acc32[1];
-00268       if(uip_acc32[1] == 0) {
-00269         ++uip_acc32[0];
-00270       }
-00271     }
-00272   }
-00273 }
-00274 
-00275 #endif /* UIP_ARCH_ADD32 */
-00276 
-00277 #if ! UIP_ARCH_CHKSUM
-00278 /*---------------------------------------------------------------------------*/
-00279 static u16_t
-00280 chksum(u16_t sum, const u8_t *data, u16_t len)
-00281 {
-00282   u16_t t;
-00283   const u8_t *dataptr;
-00284   const u8_t *last_byte;
-00285 
-00286   dataptr = data;
-00287   last_byte = data + len - 1;
-00288   
-00289   while(dataptr < last_byte) {  /* At least two more bytes */
-00290     t = (dataptr[0] << 8) + dataptr[1];
-00291     sum += t;
-00292     if(sum < t) {
-00293       sum++;            /* carry */
-00294     }
-00295     dataptr += 2;
-00296   }
-00297   
-00298   if(dataptr == last_byte) {
-00299     t = (dataptr[0] << 8) + 0;
-00300     sum += t;
-00301     if(sum < t) {
-00302       sum++;            /* carry */
-00303     }
-00304   }
-00305 
-00306   /* Return sum in host byte order. */
-00307   return sum;
-00308 }
-00309 /*---------------------------------------------------------------------------*/
-00310 u16_t
-00311 uip_chksum(u16_t *data, u16_t len)
-00312 {
-00313   return htons(chksum(0, (u8_t *)data, len));
-00314 }
-00315 /*---------------------------------------------------------------------------*/
-00316 #ifndef UIP_ARCH_IPCHKSUM
-00317 u16_t
-00318 uip_ipchksum(void)
-00319 {
-00320   u16_t sum;
-00321 
-00322   sum = chksum(0, &uip_buf[UIP_LLH_LEN], UIP_IPH_LEN);
-00323   DEBUG_PRINTF("uip_ipchksum: sum 0x%04x\n", sum);
-00324   return (sum == 0) ? 0xffff : htons(sum);
-00325 }
-00326 #endif
-00327 /*---------------------------------------------------------------------------*/
-00328 static u16_t
-00329 upper_layer_chksum(u8_t proto)
-00330 {
-00331   u16_t upper_layer_len;
-00332   u16_t sum;
-00333   
-00334 #if UIP_CONF_IPV6
-00335   upper_layer_len = (((u16_t)(BUF->len[0]) << 8) + BUF->len[1]);
-00336 #else /* UIP_CONF_IPV6 */
-00337   upper_layer_len = (((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;
-00338 #endif /* UIP_CONF_IPV6 */
-00339   
-00340   /* First sum pseudoheader. */
-00341   
-00342   /* IP protocol and length fields. This addition cannot carry. */
-00343   sum = upper_layer_len + proto;
-00344   /* Sum IP source and destination addresses. */
-00345   sum = chksum(sum, (u8_t *)&BUF->srcipaddr[0], 2 * sizeof(uip_ipaddr_t));
-00346 
-00347   /* Sum TCP header and data. */
-00348   sum = chksum(sum, &uip_buf[UIP_IPH_LEN + UIP_LLH_LEN],
-00349                upper_layer_len);
-00350     
-00351   return (sum == 0) ? 0xffff : htons(sum);
-00352 }
-00353 /*---------------------------------------------------------------------------*/
-00354 #if UIP_CONF_IPV6
-00355 u16_t
-00356 uip_icmp6chksum(void)
-00357 {
-00358   return upper_layer_chksum(UIP_PROTO_ICMP6);
-00359   
-00360 }
-00361 #endif /* UIP_CONF_IPV6 */
-00362 /*---------------------------------------------------------------------------*/
-00363 u16_t
-00364 uip_tcpchksum(void)
-00365 {
-00366   return upper_layer_chksum(UIP_PROTO_TCP);
-00367 }
-00368 /*---------------------------------------------------------------------------*/
-00369 #if UIP_UDP_CHECKSUMS
-00370 u16_t
-00371 uip_udpchksum(void)
-00372 {
-00373   return upper_layer_chksum(UIP_PROTO_UDP);
-00374 }
-00375 #endif /* UIP_UDP_CHECKSUMS */
-00376 #endif /* UIP_ARCH_CHKSUM */
-00377 /*---------------------------------------------------------------------------*/
-00378 void
-00379 uip_init(void)
-00380 {
-00381   for(c = 0; c < UIP_LISTENPORTS; ++c) {
-00382     uip_listenports[c] = 0;
-00383   }
-00384   for(c = 0; c < UIP_CONNS; ++c) {
-00385     uip_conns[c].tcpstateflags = UIP_CLOSED;
-00386   }
-00387 #if UIP_ACTIVE_OPEN
-00388   lastport = 1024;
-00389 #endif /* UIP_ACTIVE_OPEN */
-00390 
-00391 #if UIP_UDP
-00392   for(c = 0; c < UIP_UDP_CONNS; ++c) {
-00393     uip_udp_conns[c].lport = 0;
-00394   }
-00395 #endif /* UIP_UDP */
-00396   
-00397 
-00398   /* IPv4 initialization. */
-00399 #if UIP_FIXEDADDR == 0
-00400   /*  uip_hostaddr[0] = uip_hostaddr[1] = 0;*/
-00401 #endif /* UIP_FIXEDADDR */
-00402 
-00403 }
-00404 /*---------------------------------------------------------------------------*/
-00405 #if UIP_ACTIVE_OPEN
-00406 struct uip_conn *
-00407 uip_connect(uip_ipaddr_t *ripaddr, u16_t rport)
-00408 {
-00409   register struct uip_conn *conn, *cconn;
-00410   
-00411   /* Find an unused local port. */
-00412  again:
-00413   ++lastport;
-00414 
-00415   if(lastport >= 32000) {
-00416     lastport = 4096;
-00417   }
-00418 
-00419   /* Check if this port is already in use, and if so try to find
-00420      another one. */
-00421   for(c = 0; c < UIP_CONNS; ++c) {
-00422     conn = &uip_conns[c];
-00423     if(conn->tcpstateflags != UIP_CLOSED &&
-00424        conn->lport == htons(lastport)) {
-00425       goto again;
-00426     }
-00427   }
-00428 
-00429   conn = 0;
-00430   for(c = 0; c < UIP_CONNS; ++c) {
-00431     cconn = &uip_conns[c];
-00432     if(cconn->tcpstateflags == UIP_CLOSED) {
-00433       conn = cconn;
-00434       break;
-00435     }
-00436     if(cconn->tcpstateflags == UIP_TIME_WAIT) {
-00437       if(conn == 0 ||
-00438          cconn->timer > conn->timer) {
-00439         conn = cconn;
-00440       }
-00441     }
-00442   }
-00443 
-00444   if(conn == 0) {
-00445     return 0;
-00446   }
-00447   
-00448   conn->tcpstateflags = UIP_SYN_SENT;
-00449 
-00450   conn->snd_nxt[0] = iss[0];
-00451   conn->snd_nxt[1] = iss[1];
-00452   conn->snd_nxt[2] = iss[2];
-00453   conn->snd_nxt[3] = iss[3];
-00454 
-00455   conn->initialmss = conn->mss = UIP_TCP_MSS;
-00456   
-00457   conn->len = 1;   /* TCP length of the SYN is one. */
-00458   conn->nrtx = 0;
-00459   conn->timer = 1; /* Send the SYN next time around. */
-00460   conn->rto = UIP_RTO;
-00461   conn->sa = 0;
-00462   conn->sv = 16;   /* Initial value of the RTT variance. */
-00463   conn->lport = htons(lastport);
-00464   conn->rport = rport;
-00465   uip_ipaddr_copy(&conn->ripaddr, ripaddr);
-00466   
-00467   return conn;
-00468 }
-00469 #endif /* UIP_ACTIVE_OPEN */
-00470 /*---------------------------------------------------------------------------*/
-00471 #if UIP_UDP
-00472 struct uip_udp_conn *
-00473 uip_udp_new(uip_ipaddr_t *ripaddr, u16_t rport)
-00474 {
-00475   register struct uip_udp_conn *conn;
-00476   
-00477   /* Find an unused local port. */
-00478  again:
-00479   ++lastport;
-00480 
-00481   if(lastport >= 32000) {
-00482     lastport = 4096;
-00483   }
-00484   
-00485   for(c = 0; c < UIP_UDP_CONNS; ++c) {
-00486     if(uip_udp_conns[c].lport == htons(lastport)) {
-00487       goto again;
-00488     }
-00489   }
-00490 
-00491 
-00492   conn = 0;
-00493   for(c = 0; c < UIP_UDP_CONNS; ++c) {
-00494     if(uip_udp_conns[c].lport == 0) {
-00495       conn = &uip_udp_conns[c];
-00496       break;
-00497     }
-00498   }
-00499 
-00500   if(conn == 0) {
-00501     return 0;
-00502   }
-00503   
-00504   conn->lport = HTONS(lastport);
-00505   conn->rport = rport;
-00506   if(ripaddr == NULL) {
-00507     memset(conn->ripaddr, 0, sizeof(uip_ipaddr_t));
-00508   } else {
-00509     uip_ipaddr_copy(&conn->ripaddr, ripaddr);
-00510   }
-00511   conn->ttl = UIP_TTL;
-00512   
-00513   return conn;
-00514 }
-00515 #endif /* UIP_UDP */
-00516 /*---------------------------------------------------------------------------*/
-00517 void
-00518 uip_unlisten(u16_t port)
-00519 {
-00520   for(c = 0; c < UIP_LISTENPORTS; ++c) {
-00521     if(uip_listenports[c] == port) {
-00522       uip_listenports[c] = 0;
-00523       return;
-00524     }
-00525   }
-00526 }
-00527 /*---------------------------------------------------------------------------*/
-00528 void
-00529 uip_listen(u16_t port)
-00530 {
-00531   for(c = 0; c < UIP_LISTENPORTS; ++c) {
-00532     if(uip_listenports[c] == 0) {
-00533       uip_listenports[c] = port;
-00534       return;
-00535     }
-00536   }
-00537 }
-00538 /*---------------------------------------------------------------------------*/
-00539 /* XXX: IP fragment reassembly: not well-tested. */
-00540 
-00541 #if UIP_REASSEMBLY && !UIP_CONF_IPV6
-00542 #define UIP_REASS_BUFSIZE (UIP_BUFSIZE - UIP_LLH_LEN)
-00543 static u8_t uip_reassbuf[UIP_REASS_BUFSIZE];
-00544 static u8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
-00545 static const u8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f,
-00546                                     0x0f, 0x07, 0x03, 0x01};
-00547 static u16_t uip_reasslen;
-00548 static u8_t uip_reassflags;
-00549 #define UIP_REASS_FLAG_LASTFRAG 0x01
-00550 static u8_t uip_reasstmr;
-00551 
-00552 #define IP_MF   0x20
-00553 
-00554 static u8_t
-00555 uip_reass(void)
-00556 {
-00557   u16_t offset, len;
-00558   u16_t i;
-00559 
-00560   /* If ip_reasstmr is zero, no packet is present in the buffer, so we
-00561      write the IP header of the fragment into the reassembly
-00562      buffer. The timer is updated with the maximum age. */
-00563   if(uip_reasstmr == 0) {
-00564     memcpy(uip_reassbuf, &BUF->vhl, UIP_IPH_LEN);
-00565     uip_reasstmr = UIP_REASS_MAXAGE;
-00566     uip_reassflags = 0;
-00567     /* Clear the bitmap. */
-00568     memset(uip_reassbitmap, 0, sizeof(uip_reassbitmap));
-00569   }
-00570 
-00571   /* Check if the incoming fragment matches the one currently present
-00572      in the reasembly buffer. If so, we proceed with copying the
-00573      fragment into the buffer. */
-00574   if(BUF->srcipaddr[0] == FBUF->srcipaddr[0] &&
-00575      BUF->srcipaddr[1] == FBUF->srcipaddr[1] &&
-00576      BUF->destipaddr[0] == FBUF->destipaddr[0] &&
-00577      BUF->destipaddr[1] == FBUF->destipaddr[1] &&
-00578      BUF->ipid[0] == FBUF->ipid[0] &&
-00579      BUF->ipid[1] == FBUF->ipid[1]) {
-00580 
-00581     len = (BUF->len[0] << 8) + BUF->len[1] - (BUF->vhl & 0x0f) * 4;
-00582     offset = (((BUF->ipoffset[0] & 0x3f) << 8) + BUF->ipoffset[1]) * 8;
-00583 
-00584     /* If the offset or the offset + fragment length overflows the
-00585        reassembly buffer, we discard the entire packet. */
-00586     if(offset > UIP_REASS_BUFSIZE ||
-00587        offset + len > UIP_REASS_BUFSIZE) {
-00588       uip_reasstmr = 0;
-00589       goto nullreturn;
-00590     }
-00591 
-00592     /* Copy the fragment into the reassembly buffer, at the right
-00593        offset. */
-00594     memcpy(&uip_reassbuf[UIP_IPH_LEN + offset],
-00595            (char *)BUF + (int)((BUF->vhl & 0x0f) * 4),
-00596            len);
-00597       
-00598     /* Update the bitmap. */
-00599     if(offset / (8 * 8) == (offset + len) / (8 * 8)) {
-00600       /* If the two endpoints are in the same byte, we only update
-00601          that byte. */
-00602              
-00603       uip_reassbitmap[offset / (8 * 8)] |=
-00604              bitmap_bits[(offset / 8 ) & 7] &
-00605              ~bitmap_bits[((offset + len) / 8 ) & 7];
-00606     } else {
-00607       /* If the two endpoints are in different bytes, we update the
-00608          bytes in the endpoints and fill the stuff inbetween with
-00609          0xff. */
-00610       uip_reassbitmap[offset / (8 * 8)] |=
-00611         bitmap_bits[(offset / 8 ) & 7];
-00612       for(i = 1 + offset / (8 * 8); i < (offset + len) / (8 * 8); ++i) {
-00613         uip_reassbitmap[i] = 0xff;
-00614       }
-00615       uip_reassbitmap[(offset + len) / (8 * 8)] |=
-00616         ~bitmap_bits[((offset + len) / 8 ) & 7];
-00617     }
-00618     
-00619     /* If this fragment has the More Fragments flag set to zero, we
-00620        know that this is the last fragment, so we can calculate the
-00621        size of the entire packet. We also set the
-00622        IP_REASS_FLAG_LASTFRAG flag to indicate that we have received
-00623        the final fragment. */
-00624 
-00625     if((BUF->ipoffset[0] & IP_MF) == 0) {
-00626       uip_reassflags |= UIP_REASS_FLAG_LASTFRAG;
-00627       uip_reasslen = offset + len;
-00628     }
-00629     
-00630     /* Finally, we check if we have a full packet in the buffer. We do
-00631        this by checking if we have the last fragment and if all bits
-00632        in the bitmap are set. */
-00633     if(uip_reassflags & UIP_REASS_FLAG_LASTFRAG) {
-00634       /* Check all bytes up to and including all but the last byte in
-00635          the bitmap. */
-00636       for(i = 0; i < uip_reasslen / (8 * 8) - 1; ++i) {
-00637         if(uip_reassbitmap[i] != 0xff) {
-00638           goto nullreturn;
-00639         }
-00640       }
-00641       /* Check the last byte in the bitmap. It should contain just the
-00642          right amount of bits. */
-00643       if(uip_reassbitmap[uip_reasslen / (8 * 8)] !=
-00644          (u8_t)~bitmap_bits[uip_reasslen / 8 & 7]) {
-00645         goto nullreturn;
-00646       }
-00647 
-00648       /* If we have come this far, we have a full packet in the
-00649          buffer, so we allocate a pbuf and copy the packet into it. We
-00650          also reset the timer. */
-00651       uip_reasstmr = 0;
-00652       memcpy(BUF, FBUF, uip_reasslen);
-00653 
-00654       /* Pretend to be a "normal" (i.e., not fragmented) IP packet
-00655          from now on. */
-00656       BUF->ipoffset[0] = BUF->ipoffset[1] = 0;
-00657       BUF->len[0] = uip_reasslen >> 8;
-00658       BUF->len[1] = uip_reasslen & 0xff;
-00659       BUF->ipchksum = 0;
-00660       BUF->ipchksum = ~(uip_ipchksum());
-00661 
-00662       return uip_reasslen;
-00663     }
-00664   }
-00665 
-00666  nullreturn:
-00667   return 0;
-00668 }
-00669 #endif /* UIP_REASSEMBLY */
-00670 /*---------------------------------------------------------------------------*/
-00671 static void
-00672 uip_add_rcv_nxt(u16_t n)
-00673 {
-00674   uip_add32(uip_conn->rcv_nxt, n);
-00675   uip_conn->rcv_nxt[0] = uip_acc32[0];
-00676   uip_conn->rcv_nxt[1] = uip_acc32[1];
-00677   uip_conn->rcv_nxt[2] = uip_acc32[2];
-00678   uip_conn->rcv_nxt[3] = uip_acc32[3];
-00679 }
-00680 /*---------------------------------------------------------------------------*/
-00681 void
-00682 uip_process(u8_t flag)
-00683 {
-00684   register struct uip_conn *uip_connr = uip_conn;
-00685 
-00686 #if UIP_UDP
-00687   if(flag == UIP_UDP_SEND_CONN) {
-00688     goto udp_send;
-00689   }
-00690 #endif /* UIP_UDP */
-00691   
-00692   uip_sappdata = uip_appdata = &uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN];
-00693 
-00694   /* Check if we were invoked because of a poll request for a
-00695      particular connection. */
-00696   if(flag == UIP_POLL_REQUEST) {
-00697     if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED &&
-00698        !uip_outstanding(uip_connr)) {
-00699         uip_flags = UIP_POLL;
-00700         UIP_APPCALL();
-00701         goto appsend;
-00702     }
-00703     goto drop;
-00704     
-00705     /* Check if we were invoked because of the perodic timer fireing. */
-00706   } else if(flag == UIP_TIMER) {
-00707 #if UIP_REASSEMBLY
-00708     if(uip_reasstmr != 0) {
-00709       --uip_reasstmr;
-00710     }
-00711 #endif /* UIP_REASSEMBLY */
-00712     /* Increase the initial sequence number. */
-00713     if(++iss[3] == 0) {
-00714       if(++iss[2] == 0) {
-00715         if(++iss[1] == 0) {
-00716           ++iss[0];
-00717         }
-00718       }
-00719     }
-00720 
-00721     /* Reset the length variables. */
-00722     uip_len = 0;
-00723     uip_slen = 0;
-00724 
-00725     /* Check if the connection is in a state in which we simply wait
-00726        for the connection to time out. If so, we increase the
-00727        connection's timer and remove the connection if it times
-00728        out. */
-00729     if(uip_connr->tcpstateflags == UIP_TIME_WAIT ||
-00730        uip_connr->tcpstateflags == UIP_FIN_WAIT_2) {
-00731       ++(uip_connr->timer);
-00732       if(uip_connr->timer == UIP_TIME_WAIT_TIMEOUT) {
-00733         uip_connr->tcpstateflags = UIP_CLOSED;
-00734       }
-00735     } else if(uip_connr->tcpstateflags != UIP_CLOSED) {
-00736       /* If the connection has outstanding data, we increase the
-00737          connection's timer and see if it has reached the RTO value
-00738          in which case we retransmit. */
-00739       if(uip_outstanding(uip_connr)) {
-00740         if(uip_connr->timer-- == 0) {
-00741           if(uip_connr->nrtx == UIP_MAXRTX ||
-00742              ((uip_connr->tcpstateflags == UIP_SYN_SENT ||
-00743                uip_connr->tcpstateflags == UIP_SYN_RCVD) &&
-00744               uip_connr->nrtx == UIP_MAXSYNRTX)) {
-00745             uip_connr->tcpstateflags = UIP_CLOSED;
-00746 
-00747             /* We call UIP_APPCALL() with uip_flags set to
-00748                UIP_TIMEDOUT to inform the application that the
-00749                connection has timed out. */
-00750             uip_flags = UIP_TIMEDOUT;
-00751             UIP_APPCALL();
-00752 
-00753             /* We also send a reset packet to the remote host. */
-00754             BUF->flags = TCP_RST | TCP_ACK;
-00755             goto tcp_send_nodata;
-00756           }
-00757 
-00758           /* Exponential backoff. */
-00759           uip_connr->timer = UIP_RTO << (uip_connr->nrtx > 4?
-00760                                          4:
-00761                                          uip_connr->nrtx);
-00762           ++(uip_connr->nrtx);
-00763           
-00764           /* Ok, so we need to retransmit. We do this differently
-00765              depending on which state we are in. In ESTABLISHED, we
-00766              call upon the application so that it may prepare the
-00767              data for the retransmit. In SYN_RCVD, we resend the
-00768              SYNACK that we sent earlier and in LAST_ACK we have to
-00769              retransmit our FINACK. */
-00770           UIP_STAT(++uip_stat.tcp.rexmit);
-00771           switch(uip_connr->tcpstateflags & UIP_TS_MASK) {
-00772           case UIP_SYN_RCVD:
-00773             /* In the SYN_RCVD state, we should retransmit our
-00774                SYNACK. */
-00775             goto tcp_send_synack;
-00776             
-00777 #if UIP_ACTIVE_OPEN
-00778           case UIP_SYN_SENT:
-00779             /* In the SYN_SENT state, we retransmit out SYN. */
-00780             BUF->flags = 0;
-00781             goto tcp_send_syn;
-00782 #endif /* UIP_ACTIVE_OPEN */
-00783             
-00784           case UIP_ESTABLISHED:
-00785             /* In the ESTABLISHED state, we call upon the application
-00786                to do the actual retransmit after which we jump into
-00787                the code for sending out the packet (the apprexmit
-00788                label). */
-00789             uip_flags = UIP_REXMIT;
-00790             UIP_APPCALL();
-00791             goto apprexmit;
-00792             
-00793           case UIP_FIN_WAIT_1:
-00794           case UIP_CLOSING:
-00795           case UIP_LAST_ACK:
-00796             /* In all these states we should retransmit a FINACK. */
-00797             goto tcp_send_finack;
-00798             
-00799           }
-00800         }
-00801       } else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED) {
-00802         /* If there was no need for a retransmission, we poll the
-00803            application for new data. */
-00804         uip_flags = UIP_POLL;
-00805         UIP_APPCALL();
-00806         goto appsend;
-00807       }
-00808     }
-00809     goto drop;
-00810   }
-00811 #if UIP_UDP
-00812   if(flag == UIP_UDP_TIMER) {
-00813     if(uip_udp_conn->lport != 0) {
-00814       uip_conn = NULL;
-00815       uip_sappdata = uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN];
-00816       uip_len = uip_slen = 0;
-00817       uip_flags = UIP_POLL;
-00818       UIP_UDP_APPCALL();
-00819       goto udp_send;
-00820     } else {
-00821       goto drop;
-00822     }
-00823   }
-00824 #endif
-00825 
-00826   /* This is where the input processing starts. */
-00827   UIP_STAT(++uip_stat.ip.recv);
-00828 
-00829   /* Start of IP input header processing code. */
-00830   
-00831 #if UIP_CONF_IPV6
-00832   /* Check validity of the IP header. */
-00833   if((BUF->vtc & 0xf0) != 0x60)  { /* IP version and header length. */
-00834     UIP_STAT(++uip_stat.ip.drop);
-00835     UIP_STAT(++uip_stat.ip.vhlerr);
-00836     UIP_LOG("ipv6: invalid version.");
-00837     goto drop;
-00838   }
-00839 #else /* UIP_CONF_IPV6 */
-00840   /* Check validity of the IP header. */
-00841   if(BUF->vhl != 0x45)  { /* IP version and header length. */
-00842     UIP_STAT(++uip_stat.ip.drop);
-00843     UIP_STAT(++uip_stat.ip.vhlerr);
-00844     UIP_LOG("ip: invalid version or header length.");
-00845     goto drop;
-00846   }
-00847 #endif /* UIP_CONF_IPV6 */
-00848   
-00849   /* Check the size of the packet. If the size reported to us in
-00850      uip_len is smaller the size reported in the IP header, we assume
-00851      that the packet has been corrupted in transit. If the size of
-00852      uip_len is larger than the size reported in the IP packet header,
-00853      the packet has been padded and we set uip_len to the correct
-00854      value.. */
-00855 
-00856   if((BUF->len[0] << 8) + BUF->len[1] <= uip_len) {
-00857     uip_len = (BUF->len[0] << 8) + BUF->len[1];
-00858 #if UIP_CONF_IPV6
-00859     uip_len += 40; /* The length reported in the IPv6 header is the
-00860                       length of the payload that follows the
-00861                       header. However, uIP uses the uip_len variable
-00862                       for holding the size of the entire packet,
-00863                       including the IP header. For IPv4 this is not a
-00864                       problem as the length field in the IPv4 header
-00865                       contains the length of the entire packet. But
-00866                       for IPv6 we need to add the size of the IPv6
-00867                       header (40 bytes). */
-00868 #endif /* UIP_CONF_IPV6 */
-00869   } else {
-00870     UIP_LOG("ip: packet shorter than reported in IP header.");
-00871     goto drop;
-00872   }
-00873 
-00874 #if !UIP_CONF_IPV6
-00875   /* Check the fragment flag. */
-00876   if((BUF->ipoffset[0] & 0x3f) != 0 ||
-00877      BUF->ipoffset[1] != 0) {
-00878 #if UIP_REASSEMBLY
-00879     uip_len = uip_reass();
-00880     if(uip_len == 0) {
-00881       goto drop;
-00882     }
-00883 #else /* UIP_REASSEMBLY */
-00884     UIP_STAT(++uip_stat.ip.drop);
-00885     UIP_STAT(++uip_stat.ip.fragerr);
-00886     UIP_LOG("ip: fragment dropped.");
-00887     goto drop;
-00888 #endif /* UIP_REASSEMBLY */
-00889   }
-00890 #endif /* UIP_CONF_IPV6 */
-00891 
-00892   if(uip_ipaddr_cmp(uip_hostaddr, all_zeroes_addr)) {
-00893     /* If we are configured to use ping IP address configuration and
-00894        hasn't been assigned an IP address yet, we accept all ICMP
-00895        packets. */
-00896 #if UIP_PINGADDRCONF && !UIP_CONF_IPV6
-00897     if(BUF->proto == UIP_PROTO_ICMP) {
-00898       UIP_LOG("ip: possible ping config packet received.");
-00899       goto icmp_input;
-00900     } else {
-00901       UIP_LOG("ip: packet dropped since no address assigned.");
-00902       goto drop;
-00903     }
-00904 #endif /* UIP_PINGADDRCONF */
-00905 
-00906   } else {
-00907     /* If IP broadcast support is configured, we check for a broadcast
-00908        UDP packet, which may be destined to us. */
-00909 #if UIP_BROADCAST
-00910     DEBUG_PRINTF("UDP IP checksum 0x%04x\n", uip_ipchksum());
-00911     if(BUF->proto == UIP_PROTO_UDP &&
-00912        uip_ipaddr_cmp(BUF->destipaddr, all_ones_addr)
-00913        /*&&
-00914          uip_ipchksum() == 0xffff*/) {
-00915       goto udp_input;
-00916     }
-00917 #endif /* UIP_BROADCAST */
-00918     
-00919     /* Check if the packet is destined for our IP address. */
-00920 #if !UIP_CONF_IPV6
-00921     if(!uip_ipaddr_cmp(BUF->destipaddr, uip_hostaddr)) {
-00922       UIP_STAT(++uip_stat.ip.drop);
-00923       goto drop;
-00924     }
-00925 #else /* UIP_CONF_IPV6 */
-00926     /* For IPv6, packet reception is a little trickier as we need to
-00927        make sure that we listen to certain multicast addresses (all
-00928        hosts multicast address, and the solicited-node multicast
-00929        address) as well. However, we will cheat here and accept all
-00930        multicast packets that are sent to the ff02::/16 addresses. */
-00931     if(!uip_ipaddr_cmp(BUF->destipaddr, uip_hostaddr) &&
-00932        BUF->destipaddr[0] != HTONS(0xff02)) {
-00933       UIP_STAT(++uip_stat.ip.drop);
-00934       goto drop;
-00935     }
-00936 #endif /* UIP_CONF_IPV6 */
-00937   }
-00938 
-00939 #if !UIP_CONF_IPV6
-00940   if(uip_ipchksum() != 0xffff) { /* Compute and check the IP header
-00941                                     checksum. */
-00942     UIP_STAT(++uip_stat.ip.drop);
-00943     UIP_STAT(++uip_stat.ip.chkerr);
-00944     UIP_LOG("ip: bad checksum.");
-00945     goto drop;
-00946   }
-00947 #endif /* UIP_CONF_IPV6 */
-00948 
-00949   if(BUF->proto == UIP_PROTO_TCP) { /* Check for TCP packet. If so,
-00950                                        proceed with TCP input
-00951                                        processing. */
-00952     goto tcp_input;
-00953   }
-00954 
-00955 #if UIP_UDP
-00956   if(BUF->proto == UIP_PROTO_UDP) {
-00957     goto udp_input;
-00958   }
-00959 #endif /* UIP_UDP */
-00960 
-00961 #if !UIP_CONF_IPV6
-00962   /* ICMPv4 processing code follows. */
-00963   if(BUF->proto != UIP_PROTO_ICMP) { /* We only allow ICMP packets from
-00964                                         here. */
-00965     UIP_STAT(++uip_stat.ip.drop);
-00966     UIP_STAT(++uip_stat.ip.protoerr);
-00967     UIP_LOG("ip: neither tcp nor icmp.");
-00968     goto drop;
-00969   }
-00970 
-00971 #if UIP_PINGADDRCONF
-00972  icmp_input:
-00973 #endif /* UIP_PINGADDRCONF */
-00974   UIP_STAT(++uip_stat.icmp.recv);
-00975 
-00976   /* ICMP echo (i.e., ping) processing. This is simple, we only change
-00977      the ICMP type from ECHO to ECHO_REPLY and adjust the ICMP
-00978      checksum before we return the packet. */
-00979   if(ICMPBUF->type != ICMP_ECHO) {
-00980     UIP_STAT(++uip_stat.icmp.drop);
-00981     UIP_STAT(++uip_stat.icmp.typeerr);
-00982     UIP_LOG("icmp: not icmp echo.");
-00983     goto drop;
-00984   }
-00985 
-00986   /* If we are configured to use ping IP address assignment, we use
-00987      the destination IP address of this ping packet and assign it to
-00988      ourself. */
-00989 #if UIP_PINGADDRCONF
-00990   if((uip_hostaddr[0] | uip_hostaddr[1]) == 0) {
-00991     uip_hostaddr[0] = BUF->destipaddr[0];
-00992     uip_hostaddr[1] = BUF->destipaddr[1];
-00993   }
-00994 #endif /* UIP_PINGADDRCONF */
-00995 
-00996   ICMPBUF->type = ICMP_ECHO_REPLY;
-00997 
-00998   if(ICMPBUF->icmpchksum >= HTONS(0xffff - (ICMP_ECHO << 8))) {
-00999     ICMPBUF->icmpchksum += HTONS(ICMP_ECHO << 8) + 1;
-01000   } else {
-01001     ICMPBUF->icmpchksum += HTONS(ICMP_ECHO << 8);
-01002   }
-01003 
-01004   /* Swap IP addresses. */
-01005   uip_ipaddr_copy(BUF->destipaddr, BUF->srcipaddr);
-01006   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
-01007 
-01008   UIP_STAT(++uip_stat.icmp.sent);
-01009   goto send;
-01010 
-01011   /* End of IPv4 input header processing code. */
-01012 #else /* !UIP_CONF_IPV6 */
-01013 
-01014   /* This is IPv6 ICMPv6 processing code. */
-01015   DEBUG_PRINTF("icmp6_input: length %d\n", uip_len);
-01016 
-01017   if(BUF->proto != UIP_PROTO_ICMP6) { /* We only allow ICMPv6 packets from
-01018                                          here. */
-01019     UIP_STAT(++uip_stat.ip.drop);
-01020     UIP_STAT(++uip_stat.ip.protoerr);
-01021     UIP_LOG("ip: neither tcp nor icmp6.");
-01022     goto drop;
-01023   }
-01024 
-01025   UIP_STAT(++uip_stat.icmp.recv);
-01026 
-01027   /* If we get a neighbor solicitation for our address we should send
-01028      a neighbor advertisement message back. */
-01029   if(ICMPBUF->type == ICMP6_NEIGHBOR_SOLICITATION) {
-01030     if(uip_ipaddr_cmp(ICMPBUF->icmp6data, uip_hostaddr)) {
-01031 
-01032       if(ICMPBUF->options[0] == ICMP6_OPTION_SOURCE_LINK_ADDRESS) {
-01033         /* Save the sender's address in our neighbor list. */
-01034         uip_neighbor_add(ICMPBUF->srcipaddr, &(ICMPBUF->options[2]));
-01035       }
-01036       
-01037       /* We should now send a neighbor advertisement back to where the
-01038          neighbor solicication came from. */
-01039       ICMPBUF->type = ICMP6_NEIGHBOR_ADVERTISEMENT;
-01040       ICMPBUF->flags = ICMP6_FLAG_S; /* Solicited flag. */
-01041       
-01042       ICMPBUF->reserved1 = ICMPBUF->reserved2 = ICMPBUF->reserved3 = 0;
-01043       
-01044       uip_ipaddr_copy(ICMPBUF->destipaddr, ICMPBUF->srcipaddr);
-01045       uip_ipaddr_copy(ICMPBUF->srcipaddr, uip_hostaddr);
-01046       ICMPBUF->options[0] = ICMP6_OPTION_TARGET_LINK_ADDRESS;
-01047       ICMPBUF->options[1] = 1;  /* Options length, 1 = 8 bytes. */
-01048       memcpy(&(ICMPBUF->options[2]), &uip_ethaddr, sizeof(uip_ethaddr));
-01049       ICMPBUF->icmpchksum = 0;
-01050       ICMPBUF->icmpchksum = ~uip_icmp6chksum();
-01051       goto send;
-01052       
-01053     }
-01054     goto drop;
-01055   } else if(ICMPBUF->type == ICMP6_ECHO) {
-01056     /* ICMP echo (i.e., ping) processing. This is simple, we only
-01057        change the ICMP type from ECHO to ECHO_REPLY and update the
-01058        ICMP checksum before we return the packet. */
-01059 
-01060     ICMPBUF->type = ICMP6_ECHO_REPLY;
-01061     
-01062     uip_ipaddr_copy(BUF->destipaddr, BUF->srcipaddr);
-01063     uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
-01064     ICMPBUF->icmpchksum = 0;
-01065     ICMPBUF->icmpchksum = ~uip_icmp6chksum();
-01066     
-01067     UIP_STAT(++uip_stat.icmp.sent);
-01068     goto send;
-01069   } else {
-01070     DEBUG_PRINTF("Unknown icmp6 message type %d\n", ICMPBUF->type);
-01071     UIP_STAT(++uip_stat.icmp.drop);
-01072     UIP_STAT(++uip_stat.icmp.typeerr);
-01073     UIP_LOG("icmp: unknown ICMP message.");
-01074     goto drop;
-01075   }
-01076 
-01077   /* End of IPv6 ICMP processing. */
-01078   
-01079 #endif /* !UIP_CONF_IPV6 */
-01080 
-01081 #if UIP_UDP
-01082   /* UDP input processing. */
-01083  udp_input:
-01084   /* UDP processing is really just a hack. We don't do anything to the
-01085      UDP/IP headers, but let the UDP application do all the hard
-01086      work. If the application sets uip_slen, it has a packet to
-01087      send. */
-01088 #if UIP_UDP_CHECKSUMS
-01089   uip_len = uip_len - UIP_IPUDPH_LEN;
-01090   uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN];
-01091   if(UDPBUF->udpchksum != 0 && uip_udpchksum() != 0xffff) {
-01092     UIP_STAT(++uip_stat.udp.drop);
-01093     UIP_STAT(++uip_stat.udp.chkerr);
-01094     UIP_LOG("udp: bad checksum.");
-01095     goto drop;
-01096   }
-01097 #else /* UIP_UDP_CHECKSUMS */
-01098   uip_len = uip_len - UIP_IPUDPH_LEN;
-01099 #endif /* UIP_UDP_CHECKSUMS */
-01100 
-01101   /* Demultiplex this UDP packet between the UDP "connections". */
-01102   for(uip_udp_conn = &uip_udp_conns[0];
-01103       uip_udp_conn < &uip_udp_conns[UIP_UDP_CONNS];
-01104       ++uip_udp_conn) {
-01105     /* If the local UDP port is non-zero, the connection is considered
-01106        to be used. If so, the local port number is checked against the
-01107        destination port number in the received packet. If the two port
-01108        numbers match, the remote port number is checked if the
-01109        connection is bound to a remote port. Finally, if the
-01110        connection is bound to a remote IP address, the source IP
-01111        address of the packet is checked. */
-01112     if(uip_udp_conn->lport != 0 &&
-01113        UDPBUF->destport == uip_udp_conn->lport &&
-01114        (uip_udp_conn->rport == 0 ||
-01115         UDPBUF->srcport == uip_udp_conn->rport) &&
-01116        (uip_ipaddr_cmp(uip_udp_conn->ripaddr, all_zeroes_addr) ||
-01117         uip_ipaddr_cmp(uip_udp_conn->ripaddr, all_ones_addr) ||
-01118         uip_ipaddr_cmp(BUF->srcipaddr, uip_udp_conn->ripaddr))) {
-01119       goto udp_found;
-01120     }
-01121   }
-01122   UIP_LOG("udp: no matching connection found");
-01123   goto drop;
-01124   
-01125  udp_found:
-01126   uip_conn = NULL;
-01127   uip_flags = UIP_NEWDATA;
-01128   uip_sappdata = uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN];
-01129   uip_slen = 0;
-01130   UIP_UDP_APPCALL();
-01131  udp_send:
-01132   if(uip_slen == 0) {
-01133     goto drop;
-01134   }
-01135   uip_len = uip_slen + UIP_IPUDPH_LEN;
-01136 
-01137 #if UIP_CONF_IPV6
-01138   /* For IPv6, the IP length field does not include the IPv6 IP header
-01139      length. */
-01140   BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
-01141   BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
-01142 #else /* UIP_CONF_IPV6 */
-01143   BUF->len[0] = (uip_len >> 8);
-01144   BUF->len[1] = (uip_len & 0xff);
-01145 #endif /* UIP_CONF_IPV6 */
-01146 
-01147   BUF->ttl = uip_udp_conn->ttl;
-01148   BUF->proto = UIP_PROTO_UDP;
-01149 
-01150   UDPBUF->udplen = HTONS(uip_slen + UIP_UDPH_LEN);
-01151   UDPBUF->udpchksum = 0;
-01152 
-01153   BUF->srcport  = uip_udp_conn->lport;
-01154   BUF->destport = uip_udp_conn->rport;
-01155 
-01156   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
-01157   uip_ipaddr_copy(BUF->destipaddr, uip_udp_conn->ripaddr);
-01158    
-01159   uip_appdata = &uip_buf[UIP_LLH_LEN + UIP_IPTCPH_LEN];
-01160 
-01161 #if UIP_UDP_CHECKSUMS
-01162   /* Calculate UDP checksum. */
-01163   UDPBUF->udpchksum = ~(uip_udpchksum());
-01164   if(UDPBUF->udpchksum == 0) {
-01165     UDPBUF->udpchksum = 0xffff;
-01166   }
-01167 #endif /* UIP_UDP_CHECKSUMS */
-01168   
-01169   goto ip_send_nolen;
-01170 #endif /* UIP_UDP */
-01171   
-01172   /* TCP input processing. */
-01173  tcp_input:
-01174   UIP_STAT(++uip_stat.tcp.recv);
-01175 
-01176   /* Start of TCP input header processing code. */
-01177   
-01178   if(uip_tcpchksum() != 0xffff) {   /* Compute and check the TCP
-01179                                        checksum. */
-01180     UIP_STAT(++uip_stat.tcp.drop);
-01181     UIP_STAT(++uip_stat.tcp.chkerr);
-01182     UIP_LOG("tcp: bad checksum.");
-01183     goto drop;
-01184   }
-01185   
-01186   
-01187   /* Demultiplex this segment. */
-01188   /* First check any active connections. */
-01189   for(uip_connr = &uip_conns[0]; uip_connr <= &uip_conns[UIP_CONNS - 1];
-01190       ++uip_connr) {
-01191     if(uip_connr->tcpstateflags != UIP_CLOSED &&
-01192        BUF->destport == uip_connr->lport &&
-01193        BUF->srcport == uip_connr->rport &&
-01194        uip_ipaddr_cmp(BUF->srcipaddr, uip_connr->ripaddr)) {
-01195       goto found;
-01196     }
-01197   }
-01198 
-01199   /* If we didn't find and active connection that expected the packet,
-01200      either this packet is an old duplicate, or this is a SYN packet
-01201      destined for a connection in LISTEN. If the SYN flag isn't set,
-01202      it is an old packet and we send a RST. */
-01203   if((BUF->flags & TCP_CTL) != TCP_SYN) {
-01204     goto reset;
-01205   }
-01206   
-01207   tmp16 = BUF->destport;
-01208   /* Next, check listening connections. */
-01209   for(c = 0; c < UIP_LISTENPORTS; ++c) {
-01210     if(tmp16 == uip_listenports[c])
-01211       goto found_listen;
-01212   }
-01213   
-01214   /* No matching connection found, so we send a RST packet. */
-01215   UIP_STAT(++uip_stat.tcp.synrst);
-01216  reset:
-01217 
-01218   /* We do not send resets in response to resets. */
-01219   if(BUF->flags & TCP_RST) {
-01220     goto drop;
-01221   }
-01222 
-01223   UIP_STAT(++uip_stat.tcp.rst);
-01224   
-01225   BUF->flags = TCP_RST | TCP_ACK;
-01226   uip_len = UIP_IPTCPH_LEN;
-01227   BUF->tcpoffset = 5 << 4;
-01228 
-01229   /* Flip the seqno and ackno fields in the TCP header. */
-01230   c = BUF->seqno[3];
-01231   BUF->seqno[3] = BUF->ackno[3];
-01232   BUF->ackno[3] = c;
-01233   
-01234   c = BUF->seqno[2];
-01235   BUF->seqno[2] = BUF->ackno[2];
-01236   BUF->ackno[2] = c;
-01237   
-01238   c = BUF->seqno[1];
-01239   BUF->seqno[1] = BUF->ackno[1];
-01240   BUF->ackno[1] = c;
-01241   
-01242   c = BUF->seqno[0];
-01243   BUF->seqno[0] = BUF->ackno[0];
-01244   BUF->ackno[0] = c;
-01245 
-01246   /* We also have to increase the sequence number we are
-01247      acknowledging. If the least significant byte overflowed, we need
-01248      to propagate the carry to the other bytes as well. */
-01249   if(++BUF->ackno[3] == 0) {
-01250     if(++BUF->ackno[2] == 0) {
-01251       if(++BUF->ackno[1] == 0) {
-01252         ++BUF->ackno[0];
-01253       }
-01254     }
-01255   }
-01256  
-01257   /* Swap port numbers. */
-01258   tmp16 = BUF->srcport;
-01259   BUF->srcport = BUF->destport;
-01260   BUF->destport = tmp16;
-01261   
-01262   /* Swap IP addresses. */
-01263   uip_ipaddr_copy(BUF->destipaddr, BUF->srcipaddr);
-01264   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
-01265   
-01266   /* And send out the RST packet! */
-01267   goto tcp_send_noconn;
-01268 
-01269   /* This label will be jumped to if we matched the incoming packet
-01270      with a connection in LISTEN. In that case, we should create a new
-01271      connection and send a SYNACK in return. */
-01272  found_listen:
-01273   /* First we check if there are any connections avaliable. Unused
-01274      connections are kept in the same table as used connections, but
-01275      unused ones have the tcpstate set to CLOSED. Also, connections in
-01276      TIME_WAIT are kept track of and we'll use the oldest one if no
-01277      CLOSED connections are found. Thanks to Eddie C. Dost for a very
-01278      nice algorithm for the TIME_WAIT search. */
-01279   uip_connr = 0;
-01280   for(c = 0; c < UIP_CONNS; ++c) {
-01281     if(uip_conns[c].tcpstateflags == UIP_CLOSED) {
-01282       uip_connr = &uip_conns[c];
-01283       break;
-01284     }
-01285     if(uip_conns[c].tcpstateflags == UIP_TIME_WAIT) {
-01286       if(uip_connr == 0 ||
-01287          uip_conns[c].timer > uip_connr->timer) {
-01288         uip_connr = &uip_conns[c];
-01289       }
-01290     }
-01291   }
-01292 
-01293   if(uip_connr == 0) {
-01294     /* All connections are used already, we drop packet and hope that
-01295        the remote end will retransmit the packet at a time when we
-01296        have more spare connections. */
-01297     UIP_STAT(++uip_stat.tcp.syndrop);
-01298     UIP_LOG("tcp: found no unused connections.");
-01299     goto drop;
-01300   }
-01301   uip_conn = uip_connr;
-01302   
-01303   /* Fill in the necessary fields for the new connection. */
-01304   uip_connr->rto = uip_connr->timer = UIP_RTO;
-01305   uip_connr->sa = 0;
-01306   uip_connr->sv = 4;
-01307   uip_connr->nrtx = 0;
-01308   uip_connr->lport = BUF->destport;
-01309   uip_connr->rport = BUF->srcport;
-01310   uip_ipaddr_copy(uip_connr->ripaddr, BUF->srcipaddr);
-01311   uip_connr->tcpstateflags = UIP_SYN_RCVD;
-01312 
-01313   uip_connr->snd_nxt[0] = iss[0];
-01314   uip_connr->snd_nxt[1] = iss[1];
-01315   uip_connr->snd_nxt[2] = iss[2];
-01316   uip_connr->snd_nxt[3] = iss[3];
-01317   uip_connr->len = 1;
-01318 
-01319   /* rcv_nxt should be the seqno from the incoming packet + 1. */
-01320   uip_connr->rcv_nxt[3] = BUF->seqno[3];
-01321   uip_connr->rcv_nxt[2] = BUF->seqno[2];
-01322   uip_connr->rcv_nxt[1] = BUF->seqno[1];
-01323   uip_connr->rcv_nxt[0] = BUF->seqno[0];
-01324   uip_add_rcv_nxt(1);
-01325 
-01326   /* Parse the TCP MSS option, if present. */
-01327   if((BUF->tcpoffset & 0xf0) > 0x50) {
-01328     for(c = 0; c < ((BUF->tcpoffset >> 4) - 5) << 2 ;) {
-01329       opt = uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + c];
-01330       if(opt == TCP_OPT_END) {
-01331         /* End of options. */
-01332         break;
-01333       } else if(opt == TCP_OPT_NOOP) {
-01334         ++c;
-01335         /* NOP option. */
-01336       } else if(opt == TCP_OPT_MSS &&
-01337                 uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == TCP_OPT_MSS_LEN) {
-01338         /* An MSS option with the right option length. */
-01339         tmp16 = ((u16_t)uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) |
-01340           (u16_t)uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + c];
-01341         uip_connr->initialmss = uip_connr->mss =
-01342           tmp16 > UIP_TCP_MSS? UIP_TCP_MSS: tmp16;
-01343         
-01344         /* And we are done processing options. */
-01345         break;
-01346       } else {
-01347         /* All other options have a length field, so that we easily
-01348            can skip past them. */
-01349         if(uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == 0) {
-01350           /* If the length field is zero, the options are malformed
-01351              and we don't process them further. */
-01352           break;
-01353         }
-01354         c += uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c];
-01355       }
-01356     }
-01357   }
-01358   
-01359   /* Our response will be a SYNACK. */
-01360 #if UIP_ACTIVE_OPEN
-01361  tcp_send_synack:
-01362   BUF->flags = TCP_ACK;
-01363   
-01364  tcp_send_syn:
-01365   BUF->flags |= TCP_SYN;
-01366 #else /* UIP_ACTIVE_OPEN */
-01367  tcp_send_synack:
-01368   BUF->flags = TCP_SYN | TCP_ACK;
-01369 #endif /* UIP_ACTIVE_OPEN */
-01370   
-01371   /* We send out the TCP Maximum Segment Size option with our
-01372      SYNACK. */
-01373   BUF->optdata[0] = TCP_OPT_MSS;
-01374   BUF->optdata[1] = TCP_OPT_MSS_LEN;
-01375   BUF->optdata[2] = (UIP_TCP_MSS) / 256;
-01376   BUF->optdata[3] = (UIP_TCP_MSS) & 255;
-01377   uip_len = UIP_IPTCPH_LEN + TCP_OPT_MSS_LEN;
-01378   BUF->tcpoffset = ((UIP_TCPH_LEN + TCP_OPT_MSS_LEN) / 4) << 4;
-01379   goto tcp_send;
-01380 
-01381   /* This label will be jumped to if we found an active connection. */
-01382  found:
-01383   uip_conn = uip_connr;
-01384   uip_flags = 0;
-01385   /* We do a very naive form of TCP reset processing; we just accept
-01386      any RST and kill our connection. We should in fact check if the
-01387      sequence number of this reset is wihtin our advertised window
-01388      before we accept the reset. */
-01389   if(BUF->flags & TCP_RST) {
-01390     uip_connr->tcpstateflags = UIP_CLOSED;
-01391     UIP_LOG("tcp: got reset, aborting connection.");
-01392     uip_flags = UIP_ABORT;
-01393     UIP_APPCALL();
-01394     goto drop;
-01395   }
-01396   /* Calculated the length of the data, if the application has sent
-01397      any data to us. */
-01398   c = (BUF->tcpoffset >> 4) << 2;
-01399   /* uip_len will contain the length of the actual TCP data. This is
-01400      calculated by subtracing the length of the TCP header (in
-01401      c) and the length of the IP header (20 bytes). */
-01402   uip_len = uip_len - c - UIP_IPH_LEN;
-01403 
-01404   /* First, check if the sequence number of the incoming packet is
-01405      what we're expecting next. If not, we send out an ACK with the
-01406      correct numbers in. */
-01407   if(!(((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) &&
-01408        ((BUF->flags & TCP_CTL) == (TCP_SYN | TCP_ACK)))) {
-01409     if((uip_len > 0 || ((BUF->flags & (TCP_SYN | TCP_FIN)) != 0)) &&
-01410        (BUF->seqno[0] != uip_connr->rcv_nxt[0] ||
-01411         BUF->seqno[1] != uip_connr->rcv_nxt[1] ||
-01412         BUF->seqno[2] != uip_connr->rcv_nxt[2] ||
-01413         BUF->seqno[3] != uip_connr->rcv_nxt[3])) {
-01414       goto tcp_send_ack;
-01415     }
-01416   }
-01417 
-01418   /* Next, check if the incoming segment acknowledges any outstanding
-01419      data. If so, we update the sequence number, reset the length of
-01420      the outstanding data, calculate RTT estimations, and reset the
-01421      retransmission timer. */
-01422   if((BUF->flags & TCP_ACK) && uip_outstanding(uip_connr)) {
-01423     uip_add32(uip_connr->snd_nxt, uip_connr->len);
-01424 
-01425     if(BUF->ackno[0] == uip_acc32[0] &&
-01426        BUF->ackno[1] == uip_acc32[1] &&
-01427        BUF->ackno[2] == uip_acc32[2] &&
-01428        BUF->ackno[3] == uip_acc32[3]) {
-01429       /* Update sequence number. */
-01430       uip_connr->snd_nxt[0] = uip_acc32[0];
-01431       uip_connr->snd_nxt[1] = uip_acc32[1];
-01432       uip_connr->snd_nxt[2] = uip_acc32[2];
-01433       uip_connr->snd_nxt[3] = uip_acc32[3];
-01434         
-01435 
-01436       /* Do RTT estimation, unless we have done retransmissions. */
-01437       if(uip_connr->nrtx == 0) {
-01438         signed char m;
-01439         m = uip_connr->rto - uip_connr->timer;
-01440         /* This is taken directly from VJs original code in his paper */
-01441         m = m - (uip_connr->sa >> 3);
-01442         uip_connr->sa += m;
-01443         if(m < 0) {
-01444           m = -m;
-01445         }
-01446         m = m - (uip_connr->sv >> 2);
-01447         uip_connr->sv += m;
-01448         uip_connr->rto = (uip_connr->sa >> 3) + uip_connr->sv;
-01449 
-01450       }
-01451       /* Set the acknowledged flag. */
-01452       uip_flags = UIP_ACKDATA;
-01453       /* Reset the retransmission timer. */
-01454       uip_connr->timer = uip_connr->rto;
-01455 
-01456       /* Reset length of outstanding data. */
-01457       uip_connr->len = 0;
-01458     }
-01459     
-01460   }
-01461 
-01462   /* Do different things depending on in what state the connection is. */
-01463   switch(uip_connr->tcpstateflags & UIP_TS_MASK) {
-01464     /* CLOSED and LISTEN are not handled here. CLOSE_WAIT is not
-01465         implemented, since we force the application to close when the
-01466         peer sends a FIN (hence the application goes directly from
-01467         ESTABLISHED to LAST_ACK). */
-01468   case UIP_SYN_RCVD:
-01469     /* In SYN_RCVD we have sent out a SYNACK in response to a SYN, and
-01470        we are waiting for an ACK that acknowledges the data we sent
-01471        out the last time. Therefore, we want to have the UIP_ACKDATA
-01472        flag set. If so, we enter the ESTABLISHED state. */
-01473     if(uip_flags & UIP_ACKDATA) {
-01474       uip_connr->tcpstateflags = UIP_ESTABLISHED;
-01475       uip_flags = UIP_CONNECTED;
-01476       uip_connr->len = 0;
-01477       if(uip_len > 0) {
-01478         uip_flags |= UIP_NEWDATA;
-01479         uip_add_rcv_nxt(uip_len);
-01480       }
-01481       uip_slen = 0;
-01482       UIP_APPCALL();
-01483       goto appsend;
-01484     }
-01485     goto drop;
-01486 #if UIP_ACTIVE_OPEN
-01487   case UIP_SYN_SENT:
-01488     /* In SYN_SENT, we wait for a SYNACK that is sent in response to
-01489        our SYN. The rcv_nxt is set to sequence number in the SYNACK
-01490        plus one, and we send an ACK. We move into the ESTABLISHED
-01491        state. */
-01492     if((uip_flags & UIP_ACKDATA) &&
-01493        (BUF->flags & TCP_CTL) == (TCP_SYN | TCP_ACK)) {
-01494 
-01495       /* Parse the TCP MSS option, if present. */
-01496       if((BUF->tcpoffset & 0xf0) > 0x50) {
-01497         for(c = 0; c < ((BUF->tcpoffset >> 4) - 5) << 2 ;) {
-01498           opt = uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + c];
-01499           if(opt == TCP_OPT_END) {
-01500             /* End of options. */
-01501             break;
-01502           } else if(opt == TCP_OPT_NOOP) {
-01503             ++c;
-01504             /* NOP option. */
-01505           } else if(opt == TCP_OPT_MSS &&
-01506                     uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == TCP_OPT_MSS_LEN) {
-01507             /* An MSS option with the right option length. */
-01508             tmp16 = (uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) |
-01509               uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 3 + c];
-01510             uip_connr->initialmss =
-01511               uip_connr->mss = tmp16 > UIP_TCP_MSS? UIP_TCP_MSS: tmp16;
-01512 
-01513             /* And we are done processing options. */
-01514             break;
-01515           } else {
-01516             /* All other options have a length field, so that we easily
-01517                can skip past them. */
-01518             if(uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == 0) {
-01519               /* If the length field is zero, the options are malformed
-01520                  and we don't process them further. */
-01521               break;
-01522             }
-01523             c += uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c];
-01524           }
-01525         }
-01526       }
-01527       uip_connr->tcpstateflags = UIP_ESTABLISHED;
-01528       uip_connr->rcv_nxt[0] = BUF->seqno[0];
-01529       uip_connr->rcv_nxt[1] = BUF->seqno[1];
-01530       uip_connr->rcv_nxt[2] = BUF->seqno[2];
-01531       uip_connr->rcv_nxt[3] = BUF->seqno[3];
-01532       uip_add_rcv_nxt(1);
-01533       uip_flags = UIP_CONNECTED | UIP_NEWDATA;
-01534       uip_connr->len = 0;
-01535       uip_len = 0;
-01536       uip_slen = 0;
-01537       UIP_APPCALL();
-01538       goto appsend;
-01539     }
-01540     /* Inform the application that the connection failed */
-01541     uip_flags = UIP_ABORT;
-01542     UIP_APPCALL();
-01543     /* The connection is closed after we send the RST */
-01544     uip_conn->tcpstateflags = UIP_CLOSED;
-01545     goto reset;
-01546 #endif /* UIP_ACTIVE_OPEN */
-01547     
-01548   case UIP_ESTABLISHED:
-01549     /* In the ESTABLISHED state, we call upon the application to feed
-01550     data into the uip_buf. If the UIP_ACKDATA flag is set, the
-01551     application should put new data into the buffer, otherwise we are
-01552     retransmitting an old segment, and the application should put that
-01553     data into the buffer.
-01554 
-01555     If the incoming packet is a FIN, we should close the connection on
-01556     this side as well, and we send out a FIN and enter the LAST_ACK
-01557     state. We require that there is no outstanding data; otherwise the
-01558     sequence numbers will be screwed up. */
-01559 
-01560     if(BUF->flags & TCP_FIN && !(uip_connr->tcpstateflags & UIP_STOPPED)) {
-01561       if(uip_outstanding(uip_connr)) {
-01562         goto drop;
-01563       }
-01564       uip_add_rcv_nxt(1 + uip_len);
-01565       uip_flags |= UIP_CLOSE;
-01566       if(uip_len > 0) {
-01567         uip_flags |= UIP_NEWDATA;
-01568       }
-01569       UIP_APPCALL();
-01570       uip_connr->len = 1;
-01571       uip_connr->tcpstateflags = UIP_LAST_ACK;
-01572       uip_connr->nrtx = 0;
-01573     tcp_send_finack:
-01574       BUF->flags = TCP_FIN | TCP_ACK;
-01575       goto tcp_send_nodata;
-01576     }
-01577 
-01578     /* Check the URG flag. If this is set, the segment carries urgent
-01579        data that we must pass to the application. */
-01580     if((BUF->flags & TCP_URG) != 0) {
-01581 #if UIP_URGDATA > 0
-01582       uip_urglen = (BUF->urgp[0] << 8) | BUF->urgp[1];
-01583       if(uip_urglen > uip_len) {
-01584         /* There is more urgent data in the next segment to come. */
-01585         uip_urglen = uip_len;
-01586       }
-01587       uip_add_rcv_nxt(uip_urglen);
-01588       uip_len -= uip_urglen;
-01589       uip_urgdata = uip_appdata;
-01590       uip_appdata += uip_urglen;
-01591     } else {
-01592       uip_urglen = 0;
-01593 #else /* UIP_URGDATA > 0 */
-01594       uip_appdata = ((char *)uip_appdata) + ((BUF->urgp[0] << 8) | BUF->urgp[1]);
-01595       uip_len -= (BUF->urgp[0] << 8) | BUF->urgp[1];
-01596 #endif /* UIP_URGDATA > 0 */
-01597     }
-01598 
-01599     /* If uip_len > 0 we have TCP data in the packet, and we flag this
-01600        by setting the UIP_NEWDATA flag and update the sequence number
-01601        we acknowledge. If the application has stopped the dataflow
-01602        using uip_stop(), we must not accept any data packets from the
-01603        remote host. */
-01604     if(uip_len > 0 && !(uip_connr->tcpstateflags & UIP_STOPPED)) {
-01605       uip_flags |= UIP_NEWDATA;
-01606       uip_add_rcv_nxt(uip_len);
-01607     }
-01608 
-01609     /* Check if the available buffer space advertised by the other end
-01610        is smaller than the initial MSS for this connection. If so, we
-01611        set the current MSS to the window size to ensure that the
-01612        application does not send more data than the other end can
-01613        handle.
-01614 
-01615        If the remote host advertises a zero window, we set the MSS to
-01616        the initial MSS so that the application will send an entire MSS
-01617        of data. This data will not be acknowledged by the receiver,
-01618        and the application will retransmit it. This is called the
-01619        "persistent timer" and uses the retransmission mechanim.
-01620     */
-01621     tmp16 = ((u16_t)BUF->wnd[0] << 8) + (u16_t)BUF->wnd[1];
-01622     if(tmp16 > uip_connr->initialmss ||
-01623        tmp16 == 0) {
-01624       tmp16 = uip_connr->initialmss;
-01625     }
-01626     uip_connr->mss = tmp16;
-01627 
-01628     /* If this packet constitutes an ACK for outstanding data (flagged
-01629        by the UIP_ACKDATA flag, we should call the application since it
-01630        might want to send more data. If the incoming packet had data
-01631        from the peer (as flagged by the UIP_NEWDATA flag), the
-01632        application must also be notified.
-01633 
-01634        When the application is called, the global variable uip_len
-01635        contains the length of the incoming data. The application can
-01636        access the incoming data through the global pointer
-01637        uip_appdata, which usually points UIP_IPTCPH_LEN + UIP_LLH_LEN
-01638        bytes into the uip_buf array.
-01639 
-01640        If the application wishes to send any data, this data should be
-01641        put into the uip_appdata and the length of the data should be
-01642        put into uip_len. If the application don't have any data to
-01643        send, uip_len must be set to 0. */
-01644     if(uip_flags & (UIP_NEWDATA | UIP_ACKDATA)) {
-01645       uip_slen = 0;
-01646       UIP_APPCALL();
-01647 
-01648     appsend:
-01649       
-01650       if(uip_flags & UIP_ABORT) {
-01651         uip_slen = 0;
-01652         uip_connr->tcpstateflags = UIP_CLOSED;
-01653         BUF->flags = TCP_RST | TCP_ACK;
-01654         goto tcp_send_nodata;
-01655       }
-01656 
-01657       if(uip_flags & UIP_CLOSE) {
-01658         uip_slen = 0;
-01659         uip_connr->len = 1;
-01660         uip_connr->tcpstateflags = UIP_FIN_WAIT_1;
-01661         uip_connr->nrtx = 0;
-01662         BUF->flags = TCP_FIN | TCP_ACK;
-01663         goto tcp_send_nodata;
-01664       }
-01665 
-01666       /* If uip_slen > 0, the application has data to be sent. */
-01667       if(uip_slen > 0) {
-01668 
-01669         /* If the connection has acknowledged data, the contents of
-01670            the ->len variable should be discarded. */
-01671         if((uip_flags & UIP_ACKDATA) != 0) {
-01672           uip_connr->len = 0;
-01673         }
-01674 
-01675         /* If the ->len variable is non-zero the connection has
-01676            already data in transit and cannot send anymore right
-01677            now. */
-01678         if(uip_connr->len == 0) {
-01679 
-01680           /* The application cannot send more than what is allowed by
-01681              the mss (the minumum of the MSS and the available
-01682              window). */
-01683           if(uip_slen > uip_connr->mss) {
-01684             uip_slen = uip_connr->mss;
-01685           }
-01686 
-01687           /* Remember how much data we send out now so that we know
-01688              when everything has been acknowledged. */
-01689           uip_connr->len = uip_slen;
-01690         } else {
-01691 
-01692           /* If the application already had unacknowledged data, we
-01693              make sure that the application does not send (i.e.,
-01694              retransmit) out more than it previously sent out. */
-01695           uip_slen = uip_connr->len;
-01696         }
-01697       }
-01698       uip_connr->nrtx = 0;
-01699     apprexmit:
-01700       uip_appdata = uip_sappdata;
-01701       
-01702       /* If the application has data to be sent, or if the incoming
-01703          packet had new data in it, we must send out a packet. */
-01704       if(uip_slen > 0 && uip_connr->len > 0) {
-01705         /* Add the length of the IP and TCP headers. */
-01706         uip_len = uip_connr->len + UIP_TCPIP_HLEN;
-01707         /* We always set the ACK flag in response packets. */
-01708         BUF->flags = TCP_ACK | TCP_PSH;
-01709         /* Send the packet. */
-01710         goto tcp_send_noopts;
-01711       }
-01712       /* If there is no data to send, just send out a pure ACK if
-01713          there is newdata. */
-01714       if(uip_flags & UIP_NEWDATA) {
-01715         uip_len = UIP_TCPIP_HLEN;
-01716         BUF->flags = TCP_ACK;
-01717         goto tcp_send_noopts;
-01718       }
-01719     }
-01720     goto drop;
-01721   case UIP_LAST_ACK:
-01722     /* We can close this connection if the peer has acknowledged our
-01723        FIN. This is indicated by the UIP_ACKDATA flag. */
-01724     if(uip_flags & UIP_ACKDATA) {
-01725       uip_connr->tcpstateflags = UIP_CLOSED;
-01726       uip_flags = UIP_CLOSE;
-01727       UIP_APPCALL();
-01728     }
-01729     break;
-01730     
-01731   case UIP_FIN_WAIT_1:
-01732     /* The application has closed the connection, but the remote host
-01733        hasn't closed its end yet. Thus we do nothing but wait for a
-01734        FIN from the other side. */
-01735     if(uip_len > 0) {
-01736       uip_add_rcv_nxt(uip_len);
-01737     }
-01738     if(BUF->flags & TCP_FIN) {
-01739       if(uip_flags & UIP_ACKDATA) {
-01740         uip_connr->tcpstateflags = UIP_TIME_WAIT;
-01741         uip_connr->timer = 0;
-01742         uip_connr->len = 0;
-01743       } else {
-01744         uip_connr->tcpstateflags = UIP_CLOSING;
-01745       }
-01746       uip_add_rcv_nxt(1);
-01747       uip_flags = UIP_CLOSE;
-01748       UIP_APPCALL();
-01749       goto tcp_send_ack;
-01750     } else if(uip_flags & UIP_ACKDATA) {
-01751       uip_connr->tcpstateflags = UIP_FIN_WAIT_2;
-01752       uip_connr->len = 0;
-01753       goto drop;
-01754     }
-01755     if(uip_len > 0) {
-01756       goto tcp_send_ack;
-01757     }
-01758     goto drop;
-01759       
-01760   case UIP_FIN_WAIT_2:
-01761     if(uip_len > 0) {
-01762       uip_add_rcv_nxt(uip_len);
-01763     }
-01764     if(BUF->flags & TCP_FIN) {
-01765       uip_connr->tcpstateflags = UIP_TIME_WAIT;
-01766       uip_connr->timer = 0;
-01767       uip_add_rcv_nxt(1);
-01768       uip_flags = UIP_CLOSE;
-01769       UIP_APPCALL();
-01770       goto tcp_send_ack;
-01771     }
-01772     if(uip_len > 0) {
-01773       goto tcp_send_ack;
-01774     }
-01775     goto drop;
-01776 
-01777   case UIP_TIME_WAIT:
-01778     goto tcp_send_ack;
-01779     
-01780   case UIP_CLOSING:
-01781     if(uip_flags & UIP_ACKDATA) {
-01782       uip_connr->tcpstateflags = UIP_TIME_WAIT;
-01783       uip_connr->timer = 0;
-01784     }
-01785   }
-01786   goto drop;
-01787   
-01788 
-01789   /* We jump here when we are ready to send the packet, and just want
-01790      to set the appropriate TCP sequence numbers in the TCP header. */
-01791  tcp_send_ack:
-01792   BUF->flags = TCP_ACK;
-01793  tcp_send_nodata:
-01794   uip_len = UIP_IPTCPH_LEN;
-01795  tcp_send_noopts:
-01796   BUF->tcpoffset = (UIP_TCPH_LEN / 4) << 4;
-01797  tcp_send:
-01798   /* We're done with the input processing. We are now ready to send a
-01799      reply. Our job is to fill in all the fields of the TCP and IP
-01800      headers before calculating the checksum and finally send the
-01801      packet. */
-01802   BUF->ackno[0] = uip_connr->rcv_nxt[0];
-01803   BUF->ackno[1] = uip_connr->rcv_nxt[1];
-01804   BUF->ackno[2] = uip_connr->rcv_nxt[2];
-01805   BUF->ackno[3] = uip_connr->rcv_nxt[3];
-01806   
-01807   BUF->seqno[0] = uip_connr->snd_nxt[0];
-01808   BUF->seqno[1] = uip_connr->snd_nxt[1];
-01809   BUF->seqno[2] = uip_connr->snd_nxt[2];
-01810   BUF->seqno[3] = uip_connr->snd_nxt[3];
-01811 
-01812   BUF->proto = UIP_PROTO_TCP;
-01813   
-01814   BUF->srcport  = uip_connr->lport;
-01815   BUF->destport = uip_connr->rport;
-01816 
-01817   uip_ipaddr_copy(BUF->srcipaddr, uip_hostaddr);
-01818   uip_ipaddr_copy(BUF->destipaddr, uip_connr->ripaddr);
-01819 
-01820   if(uip_connr->tcpstateflags & UIP_STOPPED) {
-01821     /* If the connection has issued uip_stop(), we advertise a zero
-01822        window so that the remote host will stop sending data. */
-01823     BUF->wnd[0] = BUF->wnd[1] = 0;
-01824   } else {
-01825     BUF->wnd[0] = ((UIP_RECEIVE_WINDOW) >> 8);
-01826     BUF->wnd[1] = ((UIP_RECEIVE_WINDOW) & 0xff);
-01827   }
-01828 
-01829  tcp_send_noconn:
-01830   BUF->ttl = UIP_TTL;
-01831 #if UIP_CONF_IPV6
-01832   /* For IPv6, the IP length field does not include the IPv6 IP header
-01833      length. */
-01834   BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8);
-01835   BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff);
-01836 #else /* UIP_CONF_IPV6 */
-01837   BUF->len[0] = (uip_len >> 8);
-01838   BUF->len[1] = (uip_len & 0xff);
-01839 #endif /* UIP_CONF_IPV6 */
-01840 
-01841   BUF->urgp[0] = BUF->urgp[1] = 0;
-01842   
-01843   /* Calculate TCP checksum. */
-01844   BUF->tcpchksum = 0;
-01845   BUF->tcpchksum = ~(uip_tcpchksum());
-01846   
-01847  ip_send_nolen:
-01848 
-01849 #if UIP_CONF_IPV6
-01850   BUF->vtc = 0x60;
-01851   BUF->tcflow = 0x00;
-01852   BUF->flow = 0x00;
-01853 #else /* UIP_CONF_IPV6 */
-01854   BUF->vhl = 0x45;
-01855   BUF->tos = 0;
-01856   BUF->ipoffset[0] = BUF->ipoffset[1] = 0;
-01857   ++ipid;
-01858   BUF->ipid[0] = ipid >> 8;
-01859   BUF->ipid[1] = ipid & 0xff;
-01860   /* Calculate IP checksum. */
-01861   BUF->ipchksum = 0;
-01862   BUF->ipchksum = ~(uip_ipchksum());
-01863   DEBUG_PRINTF("uip ip_send_nolen: chkecum 0x%04x\n", uip_ipchksum());
-01864 #endif /* UIP_CONF_IPV6 */
-01865    
-01866   UIP_STAT(++uip_stat.tcp.sent);
-01867  send:
-01868   DEBUG_PRINTF("Sending packet with length %d (%d)\n", uip_len,
-01869                (BUF->len[0] << 8) | BUF->len[1]);
-01870   
-01871   UIP_STAT(++uip_stat.ip.sent);
-01872   /* Return and let the caller do the actual transmission. */
-01873   uip_flags = 0;
-01874   return;
-01875  drop:
-01876   uip_len = 0;
-01877   uip_flags = 0;
-01878   return;
-01879 }
-01880 /*---------------------------------------------------------------------------*/
-01881 u16_t
-01882 htons(u16_t val)
-01883 {
-01884   return HTONS(val);
-01885 }
-01886 /*---------------------------------------------------------------------------*/
-01887 void
-01888 uip_send(const void *data, int len)
-01889 {
-01890   if(len > 0) {
-01891     uip_slen = len;
-01892     if(data != uip_sappdata) {
-01893       memcpy(uip_sappdata, (data), uip_slen);
-01894     }
-01895   }
-01896 }
-01897 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00202.html b/components/net/uip/doc/html/a00202.html deleted file mode 100644 index ff2306c0bc..0000000000 --- a/components/net/uip/doc/html/a00202.html +++ /dev/null @@ -1,1626 +0,0 @@ - - -uIP 1.0: uip/uip.h Source File - - - - - - -

uip/uip.h

Go to the documentation of this file.
00001 
-00002 /**
-00003  * \addtogroup uip
-00004  * @{
-00005  */
-00006 
-00007 /**
-00008  * \file
-00009  * Header file for the uIP TCP/IP stack.
-00010  * \author Adam Dunkels <adam@dunkels.com>
-00011  *
-00012  * The uIP TCP/IP stack header file contains definitions for a number
-00013  * of C macros that are used by uIP programs as well as internal uIP
-00014  * structures, TCP/IP header structures and function declarations.
-00015  *
-00016  */
-00017 
-00018 
-00019 /*
-00020  * Copyright (c) 2001-2003, Adam Dunkels.
-00021  * All rights reserved.
-00022  *
-00023  * Redistribution and use in source and binary forms, with or without
-00024  * modification, are permitted provided that the following conditions
-00025  * are met:
-00026  * 1. Redistributions of source code must retain the above copyright
-00027  *    notice, this list of conditions and the following disclaimer.
-00028  * 2. Redistributions in binary form must reproduce the above copyright
-00029  *    notice, this list of conditions and the following disclaimer in the
-00030  *    documentation and/or other materials provided with the distribution.
-00031  * 3. The name of the author may not be used to endorse or promote
-00032  *    products derived from this software without specific prior
-00033  *    written permission.
-00034  *
-00035  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00036  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00037  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00038  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00039  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00040  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00041  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00042  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00043  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00044  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00045  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00046  *
-00047  * This file is part of the uIP TCP/IP stack.
-00048  *
-00049  * $Id: uip.h,v 1.40 2006/06/08 07:12:07 adam Exp $
-00050  *
-00051  */
-00052 
-00053 #ifndef __UIP_H__
-00054 #define __UIP_H__
-00055 
-00056 #include "uipopt.h"
-00057 
-00058 /**
-00059  * Repressentation of an IP address.
-00060  *
-00061  */
-00062 typedef u16_t uip_ip4addr_t[2];
-00063 typedef u16_t uip_ip6addr_t[8];
-00064 #if UIP_CONF_IPV6
-00065 typedef uip_ip6addr_t uip_ipaddr_t;
-00066 #else /* UIP_CONF_IPV6 */
-00067 typedef uip_ip4addr_t uip_ipaddr_t;
-00068 #endif /* UIP_CONF_IPV6 */
-00069 
-00070 /*---------------------------------------------------------------------------*/
-00071 /* First, the functions that should be called from the
-00072  * system. Initialization, the periodic timer and incoming packets are
-00073  * handled by the following three functions.
-00074  */
-00075 
-00076 /**
-00077  * \defgroup uipconffunc uIP configuration functions
-00078  * @{
-00079  *
-00080  * The uIP configuration functions are used for setting run-time
-00081  * parameters in uIP such as IP addresses.
-00082  */
-00083 
-00084 /**
-00085  * Set the IP address of this host.
-00086  *
-00087  * The IP address is represented as a 4-byte array where the first
-00088  * octet of the IP address is put in the first member of the 4-byte
-00089  * array.
-00090  *
-00091  * Example:
-00092  \code
-00093 
-00094  uip_ipaddr_t addr;
-00095 
-00096  uip_ipaddr(&addr, 192,168,1,2);
-00097  uip_sethostaddr(&addr);
-00098  
-00099  \endcode
-00100  * \param addr A pointer to an IP address of type uip_ipaddr_t;
-00101  *
-00102  * \sa uip_ipaddr()
-00103  *
-00104  * \hideinitializer
-00105  */
-00106 #define uip_sethostaddr(addr) uip_ipaddr_copy(uip_hostaddr, (addr))
-00107 
-00108 /**
-00109  * Get the IP address of this host.
-00110  *
-00111  * The IP address is represented as a 4-byte array where the first
-00112  * octet of the IP address is put in the first member of the 4-byte
-00113  * array.
-00114  *
-00115  * Example:
-00116  \code
-00117  uip_ipaddr_t hostaddr;
-00118 
-00119  uip_gethostaddr(&hostaddr);
-00120  \endcode
-00121  * \param addr A pointer to a uip_ipaddr_t variable that will be
-00122  * filled in with the currently configured IP address.
-00123  *
-00124  * \hideinitializer
-00125  */
-00126 #define uip_gethostaddr(addr) uip_ipaddr_copy((addr), uip_hostaddr)
-00127 
-00128 /**
-00129  * Set the default router's IP address.
-00130  *
-00131  * \param addr A pointer to a uip_ipaddr_t variable containing the IP
-00132  * address of the default router.
-00133  *
-00134  * \sa uip_ipaddr()
-00135  *
-00136  * \hideinitializer
-00137  */
-00138 #define uip_setdraddr(addr) uip_ipaddr_copy(uip_draddr, (addr))
-00139 
-00140 /**
-00141  * Set the netmask.
-00142  *
-00143  * \param addr A pointer to a uip_ipaddr_t variable containing the IP
-00144  * address of the netmask.
-00145  *
-00146  * \sa uip_ipaddr()
-00147  *
-00148  * \hideinitializer
-00149  */
-00150 #define uip_setnetmask(addr) uip_ipaddr_copy(uip_netmask, (addr))
-00151 
-00152 
-00153 /**
-00154  * Get the default router's IP address.
-00155  *
-00156  * \param addr A pointer to a uip_ipaddr_t variable that will be
-00157  * filled in with the IP address of the default router.
-00158  *
-00159  * \hideinitializer
-00160  */
-00161 #define uip_getdraddr(addr) uip_ipaddr_copy((addr), uip_draddr)
-00162 
-00163 /**
-00164  * Get the netmask.
-00165  *
-00166  * \param addr A pointer to a uip_ipaddr_t variable that will be
-00167  * filled in with the value of the netmask.
-00168  *
-00169  * \hideinitializer
-00170  */
-00171 #define uip_getnetmask(addr) uip_ipaddr_copy((addr), uip_netmask)
-00172 
-00173 /** @} */
-00174 
-00175 /**
-00176  * \defgroup uipinit uIP initialization functions
-00177  * @{
-00178  *
-00179  * The uIP initialization functions are used for booting uIP.
-00180  */
-00181 
-00182 /**
-00183  * uIP initialization function.
-00184  *
-00185  * This function should be called at boot up to initilize the uIP
-00186  * TCP/IP stack.
-00187  */
-00188 void uip_init(void);
-00189 
-00190 /**
-00191  * uIP initialization function.
-00192  *
-00193  * This function may be used at boot time to set the initial ip_id.
-00194  */
-00195 void uip_setipid(u16_t id);
-00196 
-00197 /** @} */
-00198 
-00199 /**
-00200  * \defgroup uipdevfunc uIP device driver functions
-00201  * @{
-00202  *
-00203  * These functions are used by a network device driver for interacting
-00204  * with uIP.
-00205  */
-00206 
-00207 /**
-00208  * Process an incoming packet.
-00209  *
-00210  * This function should be called when the device driver has received
-00211  * a packet from the network. The packet from the device driver must
-00212  * be present in the uip_buf buffer, and the length of the packet
-00213  * should be placed in the uip_len variable.
-00214  *
-00215  * When the function returns, there may be an outbound packet placed
-00216  * in the uip_buf packet buffer. If so, the uip_len variable is set to
-00217  * the length of the packet. If no packet is to be sent out, the
-00218  * uip_len variable is set to 0.
-00219  *
-00220  * The usual way of calling the function is presented by the source
-00221  * code below.
-00222  \code
-00223   uip_len = devicedriver_poll();
-00224   if(uip_len > 0) {
-00225     uip_input();
-00226     if(uip_len > 0) {
-00227       devicedriver_send();
-00228     }
-00229   }
-00230  \endcode
-00231  *
-00232  * \note If you are writing a uIP device driver that needs ARP
-00233  * (Address Resolution Protocol), e.g., when running uIP over
-00234  * Ethernet, you will need to call the uIP ARP code before calling
-00235  * this function:
-00236  \code
-00237   #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
-00238   uip_len = ethernet_devicedrver_poll();
-00239   if(uip_len > 0) {
-00240     if(BUF->type == HTONS(UIP_ETHTYPE_IP)) {
-00241       uip_arp_ipin();
-00242       uip_input();
-00243       if(uip_len > 0) {
-00244         uip_arp_out();
-00245         ethernet_devicedriver_send();
-00246       }
-00247     } else if(BUF->type == HTONS(UIP_ETHTYPE_ARP)) {
-00248       uip_arp_arpin();
-00249       if(uip_len > 0) {
-00250         ethernet_devicedriver_send();
-00251       }
-00252     }
-00253  \endcode
-00254  *
-00255  * \hideinitializer
-00256  */
-00257 #define uip_input()        uip_process(UIP_DATA)
-00258 
-00259 /**
-00260  * Periodic processing for a connection identified by its number.
-00261  *
-00262  * This function does the necessary periodic processing (timers,
-00263  * polling) for a uIP TCP conneciton, and should be called when the
-00264  * periodic uIP timer goes off. It should be called for every
-00265  * connection, regardless of whether they are open of closed.
-00266  *
-00267  * When the function returns, it may have an outbound packet waiting
-00268  * for service in the uIP packet buffer, and if so the uip_len
-00269  * variable is set to a value larger than zero. The device driver
-00270  * should be called to send out the packet.
-00271  *
-00272  * The ususal way of calling the function is through a for() loop like
-00273  * this:
-00274  \code
-00275   for(i = 0; i < UIP_CONNS; ++i) {
-00276     uip_periodic(i);
-00277     if(uip_len > 0) {
-00278       devicedriver_send();
-00279     }
-00280   }
-00281  \endcode
-00282  *
-00283  * \note If you are writing a uIP device driver that needs ARP
-00284  * (Address Resolution Protocol), e.g., when running uIP over
-00285  * Ethernet, you will need to call the uip_arp_out() function before
-00286  * calling the device driver:
-00287  \code
-00288   for(i = 0; i < UIP_CONNS; ++i) {
-00289     uip_periodic(i);
-00290     if(uip_len > 0) {
-00291       uip_arp_out();
-00292       ethernet_devicedriver_send();
-00293     }
-00294   }
-00295  \endcode
-00296  *
-00297  * \param conn The number of the connection which is to be periodically polled.
-00298  *
-00299  * \hideinitializer
-00300  */
-00301 #define uip_periodic(conn) do { uip_conn = &uip_conns[conn]; \
-00302                                 uip_process(UIP_TIMER); } while (0)
-00303 
-00304 /**
-00305  *
-00306  *
-00307  */
-00308 #define uip_conn_active(conn) (uip_conns[conn].tcpstateflags != UIP_CLOSED)
-00309 
-00310 /**
-00311  * Perform periodic processing for a connection identified by a pointer
-00312  * to its structure.
-00313  *
-00314  * Same as uip_periodic() but takes a pointer to the actual uip_conn
-00315  * struct instead of an integer as its argument. This function can be
-00316  * used to force periodic processing of a specific connection.
-00317  *
-00318  * \param conn A pointer to the uip_conn struct for the connection to
-00319  * be processed.
-00320  *
-00321  * \hideinitializer
-00322  */
-00323 #define uip_periodic_conn(conn) do { uip_conn = conn; \
-00324                                      uip_process(UIP_TIMER); } while (0)
-00325 
-00326 /**
-00327  * Reuqest that a particular connection should be polled.
-00328  *
-00329  * Similar to uip_periodic_conn() but does not perform any timer
-00330  * processing. The application is polled for new data.
-00331  *
-00332  * \param conn A pointer to the uip_conn struct for the connection to
-00333  * be processed.
-00334  *
-00335  * \hideinitializer
-00336  */
-00337 #define uip_poll_conn(conn) do { uip_conn = conn; \
-00338                                  uip_process(UIP_POLL_REQUEST); } while (0)
-00339 
-00340 
-00341 #if UIP_UDP
-00342 /**
-00343  * Periodic processing for a UDP connection identified by its number.
-00344  *
-00345  * This function is essentially the same as uip_periodic(), but for
-00346  * UDP connections. It is called in a similar fashion as the
-00347  * uip_periodic() function:
-00348  \code
-00349   for(i = 0; i < UIP_UDP_CONNS; i++) {
-00350     uip_udp_periodic(i);
-00351     if(uip_len > 0) {
-00352       devicedriver_send();
-00353     }
-00354   }
-00355  \endcode
-00356  *
-00357  * \note As for the uip_periodic() function, special care has to be
-00358  * taken when using uIP together with ARP and Ethernet:
-00359  \code
-00360   for(i = 0; i < UIP_UDP_CONNS; i++) {
-00361     uip_udp_periodic(i);
-00362     if(uip_len > 0) {
-00363       uip_arp_out();
-00364       ethernet_devicedriver_send();
-00365     }
-00366   }
-00367  \endcode
-00368  *
-00369  * \param conn The number of the UDP connection to be processed.
-00370  *
-00371  * \hideinitializer
-00372  */
-00373 #define uip_udp_periodic(conn) do { uip_udp_conn = &uip_udp_conns[conn]; \
-00374                                 uip_process(UIP_UDP_TIMER); } while (0)
-00375 
-00376 /**
-00377  * Periodic processing for a UDP connection identified by a pointer to
-00378  * its structure.
-00379  *
-00380  * Same as uip_udp_periodic() but takes a pointer to the actual
-00381  * uip_conn struct instead of an integer as its argument. This
-00382  * function can be used to force periodic processing of a specific
-00383  * connection.
-00384  *
-00385  * \param conn A pointer to the uip_udp_conn struct for the connection
-00386  * to be processed.
-00387  *
-00388  * \hideinitializer
-00389  */
-00390 #define uip_udp_periodic_conn(conn) do { uip_udp_conn = conn; \
-00391                                          uip_process(UIP_UDP_TIMER); } while (0)
-00392 
-00393 
-00394 #endif /* UIP_UDP */
-00395 
-00396 /**
-00397  * The uIP packet buffer.
-00398  *
-00399  * The uip_buf array is used to hold incoming and outgoing
-00400  * packets. The device driver should place incoming data into this
-00401  * buffer. When sending data, the device driver should read the link
-00402  * level headers and the TCP/IP headers from this buffer. The size of
-00403  * the link level headers is configured by the UIP_LLH_LEN define.
-00404  *
-00405  * \note The application data need not be placed in this buffer, so
-00406  * the device driver must read it from the place pointed to by the
-00407  * uip_appdata pointer as illustrated by the following example:
-00408  \code
-00409  void
-00410  devicedriver_send(void)
-00411  {
-00412     hwsend(&uip_buf[0], UIP_LLH_LEN);
-00413     if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) {
-00414       hwsend(&uip_buf[UIP_LLH_LEN], uip_len - UIP_LLH_LEN);
-00415     } else {
-00416       hwsend(&uip_buf[UIP_LLH_LEN], UIP_TCPIP_HLEN);
-00417       hwsend(uip_appdata, uip_len - UIP_TCPIP_HLEN - UIP_LLH_LEN);
-00418     }
-00419  }
-00420  \endcode
-00421  */
-00422 extern u8_t uip_buf[UIP_BUFSIZE+2];
-00423 
-00424 /** @} */
-00425 
-00426 /*---------------------------------------------------------------------------*/
-00427 /* Functions that are used by the uIP application program. Opening and
-00428  * closing connections, sending and receiving data, etc. is all
-00429  * handled by the functions below.
-00430 */
-00431 /**
-00432  * \defgroup uipappfunc uIP application functions
-00433  * @{
-00434  *
-00435  * Functions used by an application running of top of uIP.
-00436  */
-00437 
-00438 /**
-00439  * Start listening to the specified port.
-00440  *
-00441  * \note Since this function expects the port number in network byte
-00442  * order, a conversion using HTONS() or htons() is necessary.
-00443  *
-00444  \code
-00445  uip_listen(HTONS(80));
-00446  \endcode
-00447  *
-00448  * \param port A 16-bit port number in network byte order.
-00449  */
-00450 void uip_listen(u16_t port);
-00451 
-00452 /**
-00453  * Stop listening to the specified port.
-00454  *
-00455  * \note Since this function expects the port number in network byte
-00456  * order, a conversion using HTONS() or htons() is necessary.
-00457  *
-00458  \code
-00459  uip_unlisten(HTONS(80));
-00460  \endcode
-00461  *
-00462  * \param port A 16-bit port number in network byte order.
-00463  */
-00464 void uip_unlisten(u16_t port);
-00465 
-00466 /**
-00467  * Connect to a remote host using TCP.
-00468  *
-00469  * This function is used to start a new connection to the specified
-00470  * port on the specied host. It allocates a new connection identifier,
-00471  * sets the connection to the SYN_SENT state and sets the
-00472  * retransmission timer to 0. This will cause a TCP SYN segment to be
-00473  * sent out the next time this connection is periodically processed,
-00474  * which usually is done within 0.5 seconds after the call to
-00475  * uip_connect().
-00476  *
-00477  * \note This function is avaliable only if support for active open
-00478  * has been configured by defining UIP_ACTIVE_OPEN to 1 in uipopt.h.
-00479  *
-00480  * \note Since this function requires the port number to be in network
-00481  * byte order, a conversion using HTONS() or htons() is necessary.
-00482  *
-00483  \code
-00484  uip_ipaddr_t ipaddr;
-00485 
-00486  uip_ipaddr(&ipaddr, 192,168,1,2);
-00487  uip_connect(&ipaddr, HTONS(80));
-00488  \endcode
-00489  *
-00490  * \param ripaddr The IP address of the remote hot.
-00491  *
-00492  * \param port A 16-bit port number in network byte order.
-00493  *
-00494  * \return A pointer to the uIP connection identifier for the new connection,
-00495  * or NULL if no connection could be allocated.
-00496  *
-00497  */
-00498 struct uip_conn *uip_connect(uip_ipaddr_t *ripaddr, u16_t port);
-00499 
-00500 
-00501 
-00502 /**
-00503  * \internal
-00504  *
-00505  * Check if a connection has outstanding (i.e., unacknowledged) data.
-00506  *
-00507  * \param conn A pointer to the uip_conn structure for the connection.
-00508  *
-00509  * \hideinitializer
-00510  */
-00511 #define uip_outstanding(conn) ((conn)->len)
-00512 
-00513 /**
-00514  * Send data on the current connection.
-00515  *
-00516  * This function is used to send out a single segment of TCP
-00517  * data. Only applications that have been invoked by uIP for event
-00518  * processing can send data.
-00519  *
-00520  * The amount of data that actually is sent out after a call to this
-00521  * funcion is determined by the maximum amount of data TCP allows. uIP
-00522  * will automatically crop the data so that only the appropriate
-00523  * amount of data is sent. The function uip_mss() can be used to query
-00524  * uIP for the amount of data that actually will be sent.
-00525  *
-00526  * \note This function does not guarantee that the sent data will
-00527  * arrive at the destination. If the data is lost in the network, the
-00528  * application will be invoked with the uip_rexmit() event being
-00529  * set. The application will then have to resend the data using this
-00530  * function.
-00531  *
-00532  * \param data A pointer to the data which is to be sent.
-00533  *
-00534  * \param len The maximum amount of data bytes to be sent.
-00535  *
-00536  * \hideinitializer
-00537  */
-00538 void uip_send(const void *data, int len);
-00539 
-00540 /**
-00541  * The length of any incoming data that is currently avaliable (if avaliable)
-00542  * in the uip_appdata buffer.
-00543  *
-00544  * The test function uip_data() must first be used to check if there
-00545  * is any data available at all.
-00546  *
-00547  * \hideinitializer
-00548  */
-00549 /*void uip_datalen(void);*/
-00550 #define uip_datalen()       uip_len
-00551 
-00552 /**
-00553  * The length of any out-of-band data (urgent data) that has arrived
-00554  * on the connection.
-00555  *
-00556  * \note The configuration parameter UIP_URGDATA must be set for this
-00557  * function to be enabled.
-00558  *
-00559  * \hideinitializer
-00560  */
-00561 #define uip_urgdatalen()    uip_urglen
-00562 
-00563 /**
-00564  * Close the current connection.
-00565  *
-00566  * This function will close the current connection in a nice way.
-00567  *
-00568  * \hideinitializer
-00569  */
-00570 #define uip_close()         (uip_flags = UIP_CLOSE)
-00571 
-00572 /**
-00573  * Abort the current connection.
-00574  *
-00575  * This function will abort (reset) the current connection, and is
-00576  * usually used when an error has occured that prevents using the
-00577  * uip_close() function.
-00578  *
-00579  * \hideinitializer
-00580  */
-00581 #define uip_abort()         (uip_flags = UIP_ABORT)
-00582 
-00583 /**
-00584  * Tell the sending host to stop sending data.
-00585  *
-00586  * This function will close our receiver's window so that we stop
-00587  * receiving data for the current connection.
-00588  *
-00589  * \hideinitializer
-00590  */
-00591 #define uip_stop()          (uip_conn->tcpstateflags |= UIP_STOPPED)
-00592 
-00593 /**
-00594  * Find out if the current connection has been previously stopped with
-00595  * uip_stop().
-00596  *
-00597  * \hideinitializer
-00598  */
-00599 #define uip_stopped(conn)   ((conn)->tcpstateflags & UIP_STOPPED)
-00600 
-00601 /**
-00602  * Restart the current connection, if is has previously been stopped
-00603  * with uip_stop().
-00604  *
-00605  * This function will open the receiver's window again so that we
-00606  * start receiving data for the current connection.
-00607  *
-00608  * \hideinitializer
-00609  */
-00610 #define uip_restart()         do { uip_flags |= UIP_NEWDATA; \
-00611                                    uip_conn->tcpstateflags &= ~UIP_STOPPED; \
-00612                               } while(0)
-00613 
-00614 
-00615 /* uIP tests that can be made to determine in what state the current
-00616    connection is, and what the application function should do. */
-00617 
-00618 /**
-00619  * Is the current connection a UDP connection?
-00620  *
-00621  * This function checks whether the current connection is a UDP connection.
-00622  *
-00623  * \hideinitializer
-00624  *
-00625  */
-00626 #define uip_udpconnection() (uip_conn == NULL)
-00627 
-00628 /**
-00629  * Is new incoming data available?
-00630  *
-00631  * Will reduce to non-zero if there is new data for the application
-00632  * present at the uip_appdata pointer. The size of the data is
-00633  * avaliable through the uip_len variable.
-00634  *
-00635  * \hideinitializer
-00636  */
-00637 #define uip_newdata()   (uip_flags & UIP_NEWDATA)
-00638 
-00639 /**
-00640  * Has previously sent data been acknowledged?
-00641  *
-00642  * Will reduce to non-zero if the previously sent data has been
-00643  * acknowledged by the remote host. This means that the application
-00644  * can send new data.
-00645  *
-00646  * \hideinitializer
-00647  */
-00648 #define uip_acked()   (uip_flags & UIP_ACKDATA)
-00649 
-00650 /**
-00651  * Has the connection just been connected?
-00652  *
-00653  * Reduces to non-zero if the current connection has been connected to
-00654  * a remote host. This will happen both if the connection has been
-00655  * actively opened (with uip_connect()) or passively opened (with
-00656  * uip_listen()).
-00657  *
-00658  * \hideinitializer
-00659  */
-00660 #define uip_connected() (uip_flags & UIP_CONNECTED)
-00661 
-00662 /**
-00663  * Has the connection been closed by the other end?
-00664  *
-00665  * Is non-zero if the connection has been closed by the remote
-00666  * host. The application may then do the necessary clean-ups.
-00667  *
-00668  * \hideinitializer
-00669  */
-00670 #define uip_closed()    (uip_flags & UIP_CLOSE)
-00671 
-00672 /**
-00673  * Has the connection been aborted by the other end?
-00674  *
-00675  * Non-zero if the current connection has been aborted (reset) by the
-00676  * remote host.
-00677  *
-00678  * \hideinitializer
-00679  */
-00680 #define uip_aborted()    (uip_flags & UIP_ABORT)
-00681 
-00682 /**
-00683  * Has the connection timed out?
-00684  *
-00685  * Non-zero if the current connection has been aborted due to too many
-00686  * retransmissions.
-00687  *
-00688  * \hideinitializer
-00689  */
-00690 #define uip_timedout()    (uip_flags & UIP_TIMEDOUT)
-00691 
-00692 /**
-00693  * Do we need to retransmit previously data?
-00694  *
-00695  * Reduces to non-zero if the previously sent data has been lost in
-00696  * the network, and the application should retransmit it. The
-00697  * application should send the exact same data as it did the last
-00698  * time, using the uip_send() function.
-00699  *
-00700  * \hideinitializer
-00701  */
-00702 #define uip_rexmit()     (uip_flags & UIP_REXMIT)
-00703 
-00704 /**
-00705  * Is the connection being polled by uIP?
-00706  *
-00707  * Is non-zero if the reason the application is invoked is that the
-00708  * current connection has been idle for a while and should be
-00709  * polled.
-00710  *
-00711  * The polling event can be used for sending data without having to
-00712  * wait for the remote host to send data.
-00713  *
-00714  * \hideinitializer
-00715  */
-00716 #define uip_poll()       (uip_flags & UIP_POLL)
-00717 
-00718 /**
-00719  * Get the initial maxium segment size (MSS) of the current
-00720  * connection.
-00721  *
-00722  * \hideinitializer
-00723  */
-00724 #define uip_initialmss()             (uip_conn->initialmss)
-00725 
-00726 /**
-00727  * Get the current maxium segment size that can be sent on the current
-00728  * connection.
-00729  *
-00730  * The current maxiumum segment size that can be sent on the
-00731  * connection is computed from the receiver's window and the MSS of
-00732  * the connection (which also is available by calling
-00733  * uip_initialmss()).
-00734  *
-00735  * \hideinitializer
-00736  */
-00737 #define uip_mss()             (uip_conn->mss)
-00738 
-00739 /**
-00740  * Set up a new UDP connection.
-00741  *
-00742  * This function sets up a new UDP connection. The function will
-00743  * automatically allocate an unused local port for the new
-00744  * connection. However, another port can be chosen by using the
-00745  * uip_udp_bind() call, after the uip_udp_new() function has been
-00746  * called.
-00747  *
-00748  * Example:
-00749  \code
-00750  uip_ipaddr_t addr;
-00751  struct uip_udp_conn *c;
-00752  
-00753  uip_ipaddr(&addr, 192,168,2,1);
-00754  c = uip_udp_new(&addr, HTONS(12345));
-00755  if(c != NULL) {
-00756    uip_udp_bind(c, HTONS(12344));
-00757  }
-00758  \endcode
-00759  * \param ripaddr The IP address of the remote host.
-00760  *
-00761  * \param rport The remote port number in network byte order.
-00762  *
-00763  * \return The uip_udp_conn structure for the new connection or NULL
-00764  * if no connection could be allocated.
-00765  */
-00766 struct uip_udp_conn *uip_udp_new(uip_ipaddr_t *ripaddr, u16_t rport);
-00767 
-00768 /**
-00769  * Removed a UDP connection.
-00770  *
-00771  * \param conn A pointer to the uip_udp_conn structure for the connection.
-00772  *
-00773  * \hideinitializer
-00774  */
-00775 #define uip_udp_remove(conn) (conn)->lport = 0
-00776 
-00777 /**
-00778  * Bind a UDP connection to a local port.
-00779  *
-00780  * \param conn A pointer to the uip_udp_conn structure for the
-00781  * connection.
-00782  *
-00783  * \param port The local port number, in network byte order.
-00784  *
-00785  * \hideinitializer
-00786  */
-00787 #define uip_udp_bind(conn, port) (conn)->lport = port
-00788 
-00789 /**
-00790  * Send a UDP datagram of length len on the current connection.
-00791  *
-00792  * This function can only be called in response to a UDP event (poll
-00793  * or newdata). The data must be present in the uip_buf buffer, at the
-00794  * place pointed to by the uip_appdata pointer.
-00795  *
-00796  * \param len The length of the data in the uip_buf buffer.
-00797  *
-00798  * \hideinitializer
-00799  */
-00800 #define uip_udp_send(len) uip_send((char *)uip_appdata, len)
-00801 
-00802 /** @} */
-00803 
-00804 /* uIP convenience and converting functions. */
-00805 
-00806 /**
-00807  * \defgroup uipconvfunc uIP conversion functions
-00808  * @{
-00809  *
-00810  * These functions can be used for converting between different data
-00811  * formats used by uIP.
-00812  */
-00813  
-00814 /**
-00815  * Construct an IP address from four bytes.
-00816  *
-00817  * This function constructs an IP address of the type that uIP handles
-00818  * internally from four bytes. The function is handy for specifying IP
-00819  * addresses to use with e.g. the uip_connect() function.
-00820  *
-00821  * Example:
-00822  \code
-00823  uip_ipaddr_t ipaddr;
-00824  struct uip_conn *c;
-00825  
-00826  uip_ipaddr(&ipaddr, 192,168,1,2);
-00827  c = uip_connect(&ipaddr, HTONS(80));
-00828  \endcode
-00829  *
-00830  * \param addr A pointer to a uip_ipaddr_t variable that will be
-00831  * filled in with the IP address.
-00832  *
-00833  * \param addr0 The first octet of the IP address.
-00834  * \param addr1 The second octet of the IP address.
-00835  * \param addr2 The third octet of the IP address.
-00836  * \param addr3 The forth octet of the IP address.
-00837  *
-00838  * \hideinitializer
-00839  */
-00840 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \
-00841                      ((u16_t *)(addr))[0] = HTONS(((addr0) << 8) | (addr1)); \
-00842                      ((u16_t *)(addr))[1] = HTONS(((addr2) << 8) | (addr3)); \
-00843                   } while(0)
-00844 
-00845 /**
-00846  * Construct an IPv6 address from eight 16-bit words.
-00847  *
-00848  * This function constructs an IPv6 address.
-00849  *
-00850  * \hideinitializer
-00851  */
-00852 #define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \
-00853                      ((u16_t *)(addr))[0] = HTONS((addr0)); \
-00854                      ((u16_t *)(addr))[1] = HTONS((addr1)); \
-00855                      ((u16_t *)(addr))[2] = HTONS((addr2)); \
-00856                      ((u16_t *)(addr))[3] = HTONS((addr3)); \
-00857                      ((u16_t *)(addr))[4] = HTONS((addr4)); \
-00858                      ((u16_t *)(addr))[5] = HTONS((addr5)); \
-00859                      ((u16_t *)(addr))[6] = HTONS((addr6)); \
-00860                      ((u16_t *)(addr))[7] = HTONS((addr7)); \
-00861                   } while(0)
-00862 
-00863 /**
-00864  * Copy an IP address to another IP address.
-00865  *
-00866  * Copies an IP address from one place to another.
-00867  *
-00868  * Example:
-00869  \code
-00870  uip_ipaddr_t ipaddr1, ipaddr2;
-00871 
-00872  uip_ipaddr(&ipaddr1, 192,16,1,2);
-00873  uip_ipaddr_copy(&ipaddr2, &ipaddr1);
-00874  \endcode
-00875  *
-00876  * \param dest The destination for the copy.
-00877  * \param src The source from where to copy.
-00878  *
-00879  * \hideinitializer
-00880  */
-00881 #if !UIP_CONF_IPV6
-00882 #define uip_ipaddr_copy(dest, src) do { \
-00883                      ((u16_t *)dest)[0] = ((u16_t *)src)[0]; \
-00884                      ((u16_t *)dest)[1] = ((u16_t *)src)[1]; \
-00885                   } while(0)
-00886 #else /* !UIP_CONF_IPV6 */
-00887 #define uip_ipaddr_copy(dest, src) memcpy(dest, src, sizeof(uip_ip6addr_t))
-00888 #endif /* !UIP_CONF_IPV6 */
-00889 
-00890 /**
-00891  * Compare two IP addresses
-00892  *
-00893  * Compares two IP addresses.
-00894  *
-00895  * Example:
-00896  \code
-00897  uip_ipaddr_t ipaddr1, ipaddr2;
-00898 
-00899  uip_ipaddr(&ipaddr1, 192,16,1,2);
-00900  if(uip_ipaddr_cmp(&ipaddr2, &ipaddr1)) {
-00901     printf("They are the same");
-00902  }
-00903  \endcode
-00904  *
-00905  * \param addr1 The first IP address.
-00906  * \param addr2 The second IP address.
-00907  *
-00908  * \hideinitializer
-00909  */
-00910 #if !UIP_CONF_IPV6
-00911 #define uip_ipaddr_cmp(addr1, addr2) (((u16_t *)addr1)[0] == ((u16_t *)addr2)[0] && \
-00912                                       ((u16_t *)addr1)[1] == ((u16_t *)addr2)[1])
-00913 #else /* !UIP_CONF_IPV6 */
-00914 #define uip_ipaddr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0)
-00915 #endif /* !UIP_CONF_IPV6 */
-00916 
-00917 /**
-00918  * Compare two IP addresses with netmasks
-00919  *
-00920  * Compares two IP addresses with netmasks. The masks are used to mask
-00921  * out the bits that are to be compared.
-00922  *
-00923  * Example:
-00924  \code
-00925  uip_ipaddr_t ipaddr1, ipaddr2, mask;
-00926 
-00927  uip_ipaddr(&mask, 255,255,255,0);
-00928  uip_ipaddr(&ipaddr1, 192,16,1,2);
-00929  uip_ipaddr(&ipaddr2, 192,16,1,3);
-00930  if(uip_ipaddr_maskcmp(&ipaddr1, &ipaddr2, &mask)) {
-00931     printf("They are the same");
-00932  }
-00933  \endcode
-00934  *
-00935  * \param addr1 The first IP address.
-00936  * \param addr2 The second IP address.
-00937  * \param mask The netmask.
-00938  *
-00939  * \hideinitializer
-00940  */
-00941 #define uip_ipaddr_maskcmp(addr1, addr2, mask) \
-00942                           (((((u16_t *)addr1)[0] & ((u16_t *)mask)[0]) == \
-00943                             (((u16_t *)addr2)[0] & ((u16_t *)mask)[0])) && \
-00944                            ((((u16_t *)addr1)[1] & ((u16_t *)mask)[1]) == \
-00945                             (((u16_t *)addr2)[1] & ((u16_t *)mask)[1])))
-00946 
-00947 
-00948 /**
-00949  * Mask out the network part of an IP address.
-00950  *
-00951  * Masks out the network part of an IP address, given the address and
-00952  * the netmask.
-00953  *
-00954  * Example:
-00955  \code
-00956  uip_ipaddr_t ipaddr1, ipaddr2, netmask;
-00957 
-00958  uip_ipaddr(&ipaddr1, 192,16,1,2);
-00959  uip_ipaddr(&netmask, 255,255,255,0);
-00960  uip_ipaddr_mask(&ipaddr2, &ipaddr1, &netmask);
-00961  \endcode
-00962  *
-00963  * In the example above, the variable "ipaddr2" will contain the IP
-00964  * address 192.168.1.0.
-00965  *
-00966  * \param dest Where the result is to be placed.
-00967  * \param src The IP address.
-00968  * \param mask The netmask.
-00969  *
-00970  * \hideinitializer
-00971  */
-00972 #define uip_ipaddr_mask(dest, src, mask) do { \
-00973                      ((u16_t *)dest)[0] = ((u16_t *)src)[0] & ((u16_t *)mask)[0]; \
-00974                      ((u16_t *)dest)[1] = ((u16_t *)src)[1] & ((u16_t *)mask)[1]; \
-00975                   } while(0)
-00976 
-00977 /**
-00978  * Pick the first octet of an IP address.
-00979  *
-00980  * Picks out the first octet of an IP address.
-00981  *
-00982  * Example:
-00983  \code
-00984  uip_ipaddr_t ipaddr;
-00985  u8_t octet;
-00986 
-00987  uip_ipaddr(&ipaddr, 1,2,3,4);
-00988  octet = uip_ipaddr1(&ipaddr);
-00989  \endcode
-00990  *
-00991  * In the example above, the variable "octet" will contain the value 1.
-00992  *
-00993  * \hideinitializer
-00994  */
-00995 #define uip_ipaddr1(addr) (htons(((u16_t *)(addr))[0]) >> 8)
-00996 
-00997 /**
-00998  * Pick the second octet of an IP address.
-00999  *
-01000  * Picks out the second octet of an IP address.
-01001  *
-01002  * Example:
-01003  \code
-01004  uip_ipaddr_t ipaddr;
-01005  u8_t octet;
-01006 
-01007  uip_ipaddr(&ipaddr, 1,2,3,4);
-01008  octet = uip_ipaddr2(&ipaddr);
-01009  \endcode
-01010  *
-01011  * In the example above, the variable "octet" will contain the value 2.
-01012  *
-01013  * \hideinitializer
-01014  */
-01015 #define uip_ipaddr2(addr) (htons(((u16_t *)(addr))[0]) & 0xff)
-01016 
-01017 /**
-01018  * Pick the third octet of an IP address.
-01019  *
-01020  * Picks out the third octet of an IP address.
-01021  *
-01022  * Example:
-01023  \code
-01024  uip_ipaddr_t ipaddr;
-01025  u8_t octet;
-01026 
-01027  uip_ipaddr(&ipaddr, 1,2,3,4);
-01028  octet = uip_ipaddr3(&ipaddr);
-01029  \endcode
-01030  *
-01031  * In the example above, the variable "octet" will contain the value 3.
-01032  *
-01033  * \hideinitializer
-01034  */
-01035 #define uip_ipaddr3(addr) (htons(((u16_t *)(addr))[1]) >> 8)
-01036 
-01037 /**
-01038  * Pick the fourth octet of an IP address.
-01039  *
-01040  * Picks out the fourth octet of an IP address.
-01041  *
-01042  * Example:
-01043  \code
-01044  uip_ipaddr_t ipaddr;
-01045  u8_t octet;
-01046 
-01047  uip_ipaddr(&ipaddr, 1,2,3,4);
-01048  octet = uip_ipaddr4(&ipaddr);
-01049  \endcode
-01050  *
-01051  * In the example above, the variable "octet" will contain the value 4.
-01052  *
-01053  * \hideinitializer
-01054  */
-01055 #define uip_ipaddr4(addr) (htons(((u16_t *)(addr))[1]) & 0xff)
-01056 
-01057 /**
-01058  * Convert 16-bit quantity from host byte order to network byte order.
-01059  *
-01060  * This macro is primarily used for converting constants from host
-01061  * byte order to network byte order. For converting variables to
-01062  * network byte order, use the htons() function instead.
-01063  *
-01064  * \hideinitializer
-01065  */
-01066 #ifndef HTONS
-01067 #   if UIP_BYTE_ORDER == UIP_BIG_ENDIAN
-01068 #      define HTONS(n) (n)
-01069 #   else /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */
-01070 #      define HTONS(n) (u16_t)((((u16_t) (n)) << 8) | (((u16_t) (n)) >> 8))
-01071 #   endif /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */
-01072 #else
-01073 #error "HTONS already defined!"
-01074 #endif /* HTONS */
-01075 
-01076 /**
-01077  * Convert 16-bit quantity from host byte order to network byte order.
-01078  *
-01079  * This function is primarily used for converting variables from host
-01080  * byte order to network byte order. For converting constants to
-01081  * network byte order, use the HTONS() macro instead.
-01082  */
-01083 #ifndef htons
-01084 u16_t htons(u16_t val);
-01085 #endif /* htons */
-01086 #ifndef ntohs
-01087 #define ntohs htons
-01088 #endif
-01089 
-01090 /** @} */
-01091 
-01092 /**
-01093  * Pointer to the application data in the packet buffer.
-01094  *
-01095  * This pointer points to the application data when the application is
-01096  * called. If the application wishes to send data, the application may
-01097  * use this space to write the data into before calling uip_send().
-01098  */
-01099 extern void *uip_appdata;
-01100 
-01101 #if UIP_URGDATA > 0
-01102 /* u8_t *uip_urgdata:
-01103  *
-01104  * This pointer points to any urgent data that has been received. Only
-01105  * present if compiled with support for urgent data (UIP_URGDATA).
-01106  */
-01107 extern void *uip_urgdata;
-01108 #endif /* UIP_URGDATA > 0 */
-01109 
-01110 
-01111 /**
-01112  * \defgroup uipdrivervars Variables used in uIP device drivers
-01113  * @{
-01114  *
-01115  * uIP has a few global variables that are used in device drivers for
-01116  * uIP.
-01117  */
-01118 
-01119 /**
-01120  * The length of the packet in the uip_buf buffer.
-01121  *
-01122  * The global variable uip_len holds the length of the packet in the
-01123  * uip_buf buffer.
-01124  *
-01125  * When the network device driver calls the uIP input function,
-01126  * uip_len should be set to the length of the packet in the uip_buf
-01127  * buffer.
-01128  *
-01129  * When sending packets, the device driver should use the contents of
-01130  * the uip_len variable to determine the length of the outgoing
-01131  * packet.
-01132  *
-01133  */
-01134 extern u16_t uip_len;
-01135 
-01136 /** @} */
-01137 
-01138 #if UIP_URGDATA > 0
-01139 extern u16_t uip_urglen, uip_surglen;
-01140 #endif /* UIP_URGDATA > 0 */
-01141 
-01142 
-01143 /**
-01144  * Representation of a uIP TCP connection.
-01145  *
-01146  * The uip_conn structure is used for identifying a connection. All
-01147  * but one field in the structure are to be considered read-only by an
-01148  * application. The only exception is the appstate field whos purpose
-01149  * is to let the application store application-specific state (e.g.,
-01150  * file pointers) for the connection. The type of this field is
-01151  * configured in the "uipopt.h" header file.
-01152  */
-01153 struct uip_conn {
-01154   uip_ipaddr_t ripaddr;   /**< The IP address of the remote host. */
-01155   
-01156   u16_t lport;        /**< The local TCP port, in network byte order. */
-01157   u16_t rport;        /**< The local remote TCP port, in network byte
-01158                          order. */
-01159   
-01160   u8_t rcv_nxt[4];    /**< The sequence number that we expect to
-01161                          receive next. */
-01162   u8_t snd_nxt[4];    /**< The sequence number that was last sent by
-01163                          us. */
-01164   u16_t len;          /**< Length of the data that was previously sent. */
-01165   u16_t mss;          /**< Current maximum segment size for the
-01166                          connection. */
-01167   u16_t initialmss;   /**< Initial maximum segment size for the
-01168                          connection. */
-01169   u8_t sa;            /**< Retransmission time-out calculation state
-01170                          variable. */
-01171   u8_t sv;            /**< Retransmission time-out calculation state
-01172                          variable. */
-01173   u8_t rto;           /**< Retransmission time-out. */
-01174   u8_t tcpstateflags; /**< TCP state and flags. */
-01175   u8_t timer;         /**< The retransmission timer. */
-01176   u8_t nrtx;          /**< The number of retransmissions for the last
-01177                          segment sent. */
-01178 
-01179   /** The application state. */
-01180   uip_tcp_appstate_t appstate;
-01181 };
-01182 
-01183 
-01184 /**
-01185  * Pointer to the current TCP connection.
-01186  *
-01187  * The uip_conn pointer can be used to access the current TCP
-01188  * connection.
-01189  */
-01190 extern struct uip_conn *uip_conn;
-01191 /* The array containing all uIP connections. */
-01192 extern struct uip_conn uip_conns[UIP_CONNS];
-01193 /**
-01194  * \addtogroup uiparch
-01195  * @{
-01196  */
-01197 
-01198 /**
-01199  * 4-byte array used for the 32-bit sequence number calculations.
-01200  */
-01201 extern u8_t uip_acc32[4];
-01202 
-01203 /** @} */
-01204 
-01205 
-01206 #if UIP_UDP
-01207 /**
-01208  * Representation of a uIP UDP connection.
-01209  */
-01210 struct uip_udp_conn {
-01211   uip_ipaddr_t ripaddr;   /**< The IP address of the remote peer. */
-01212   u16_t lport;        /**< The local port number in network byte order. */
-01213   u16_t rport;        /**< The remote port number in network byte order. */
-01214   u8_t  ttl;          /**< Default time-to-live. */
-01215 
-01216   /** The application state. */
-01217   uip_udp_appstate_t appstate;
-01218 };
-01219 
-01220 /**
-01221  * The current UDP connection.
-01222  */
-01223 extern struct uip_udp_conn *uip_udp_conn;
-01224 extern struct uip_udp_conn uip_udp_conns[UIP_UDP_CONNS];
-01225 #endif /* UIP_UDP */
-01226 
-01227 /**
-01228  * The structure holding the TCP/IP statistics that are gathered if
-01229  * UIP_STATISTICS is set to 1.
-01230  *
-01231  */
-01232 struct uip_stats {
-01233   struct {
-01234     uip_stats_t drop;     /**< Number of dropped packets at the IP
-01235                              layer. */
-01236     uip_stats_t recv;     /**< Number of received packets at the IP
-01237                              layer. */
-01238     uip_stats_t sent;     /**< Number of sent packets at the IP
-01239                              layer. */
-01240     uip_stats_t vhlerr;   /**< Number of packets dropped due to wrong
-01241                              IP version or header length. */
-01242     uip_stats_t hblenerr; /**< Number of packets dropped due to wrong
-01243                              IP length, high byte. */
-01244     uip_stats_t lblenerr; /**< Number of packets dropped due to wrong
-01245                              IP length, low byte. */
-01246     uip_stats_t fragerr;  /**< Number of packets dropped since they
-01247                              were IP fragments. */
-01248     uip_stats_t chkerr;   /**< Number of packets dropped due to IP
-01249                              checksum errors. */
-01250     uip_stats_t protoerr; /**< Number of packets dropped since they
-01251                              were neither ICMP, UDP nor TCP. */
-01252   } ip;                   /**< IP statistics. */
-01253   struct {
-01254     uip_stats_t drop;     /**< Number of dropped ICMP packets. */
-01255     uip_stats_t recv;     /**< Number of received ICMP packets. */
-01256     uip_stats_t sent;     /**< Number of sent ICMP packets. */
-01257     uip_stats_t typeerr;  /**< Number of ICMP packets with a wrong
-01258                              type. */
-01259   } icmp;                 /**< ICMP statistics. */
-01260   struct {
-01261     uip_stats_t drop;     /**< Number of dropped TCP segments. */
-01262     uip_stats_t recv;     /**< Number of recived TCP segments. */
-01263     uip_stats_t sent;     /**< Number of sent TCP segments. */
-01264     uip_stats_t chkerr;   /**< Number of TCP segments with a bad
-01265                              checksum. */
-01266     uip_stats_t ackerr;   /**< Number of TCP segments with a bad ACK
-01267                              number. */
-01268     uip_stats_t rst;      /**< Number of recevied TCP RST (reset) segments. */
-01269     uip_stats_t rexmit;   /**< Number of retransmitted TCP segments. */
-01270     uip_stats_t syndrop;  /**< Number of dropped SYNs due to too few
-01271                              connections was avaliable. */
-01272     uip_stats_t synrst;   /**< Number of SYNs for closed ports,
-01273                              triggering a RST. */
-01274   } tcp;                  /**< TCP statistics. */
-01275 #if UIP_UDP
-01276   struct {
-01277     uip_stats_t drop;     /**< Number of dropped UDP segments. */
-01278     uip_stats_t recv;     /**< Number of recived UDP segments. */
-01279     uip_stats_t sent;     /**< Number of sent UDP segments. */
-01280     uip_stats_t chkerr;   /**< Number of UDP segments with a bad
-01281                              checksum. */
-01282   } udp;                  /**< UDP statistics. */
-01283 #endif /* UIP_UDP */
-01284 };
-01285 
-01286 /**
-01287  * The uIP TCP/IP statistics.
-01288  *
-01289  * This is the variable in which the uIP TCP/IP statistics are gathered.
-01290  */
-01291 extern struct uip_stats uip_stat;
-01292 
-01293 
-01294 /*---------------------------------------------------------------------------*/
-01295 /* All the stuff below this point is internal to uIP and should not be
-01296  * used directly by an application or by a device driver.
-01297  */
-01298 /*---------------------------------------------------------------------------*/
-01299 /* u8_t uip_flags:
-01300  *
-01301  * When the application is called, uip_flags will contain the flags
-01302  * that are defined in this file. Please read below for more
-01303  * infomation.
-01304  */
-01305 extern u8_t uip_flags;
-01306 
-01307 /* The following flags may be set in the global variable uip_flags
-01308    before calling the application callback. The UIP_ACKDATA,
-01309    UIP_NEWDATA, and UIP_CLOSE flags may both be set at the same time,
-01310    whereas the others are mutualy exclusive. Note that these flags
-01311    should *NOT* be accessed directly, but only through the uIP
-01312    functions/macros. */
-01313 
-01314 #define UIP_ACKDATA   1     /* Signifies that the outstanding data was
-01315                                acked and the application should send
-01316                                out new data instead of retransmitting
-01317                                the last data. */
-01318 #define UIP_NEWDATA   2     /* Flags the fact that the peer has sent
-01319                                us new data. */
-01320 #define UIP_REXMIT    4     /* Tells the application to retransmit the
-01321                                data that was last sent. */
-01322 #define UIP_POLL      8     /* Used for polling the application, to
-01323                                check if the application has data that
-01324                                it wants to send. */
-01325 #define UIP_CLOSE     16    /* The remote host has closed the
-01326                                connection, thus the connection has
-01327                                gone away. Or the application signals
-01328                                that it wants to close the
-01329                                connection. */
-01330 #define UIP_ABORT     32    /* The remote host has aborted the
-01331                                connection, thus the connection has
-01332                                gone away. Or the application signals
-01333                                that it wants to abort the
-01334                                connection. */
-01335 #define UIP_CONNECTED 64    /* We have got a connection from a remote
-01336                                host and have set up a new connection
-01337                                for it, or an active connection has
-01338                                been successfully established. */
-01339 
-01340 #define UIP_TIMEDOUT  128   /* The connection has been aborted due to
-01341                                too many retransmissions. */
-01342 
-01343 /* uip_process(flag):
-01344  *
-01345  * The actual uIP function which does all the work.
-01346  */
-01347 void uip_process(u8_t flag);
-01348 
-01349 /* The following flags are passed as an argument to the uip_process()
-01350    function. They are used to distinguish between the two cases where
-01351    uip_process() is called. It can be called either because we have
-01352    incoming data that should be processed, or because the periodic
-01353    timer has fired. These values are never used directly, but only in
-01354    the macrose defined in this file. */
-01355  
-01356 #define UIP_DATA          1     /* Tells uIP that there is incoming
-01357                                    data in the uip_buf buffer. The
-01358                                    length of the data is stored in the
-01359                                    global variable uip_len. */
-01360 #define UIP_TIMER         2     /* Tells uIP that the periodic timer
-01361                                    has fired. */
-01362 #define UIP_POLL_REQUEST  3     /* Tells uIP that a connection should
-01363                                    be polled. */
-01364 #define UIP_UDP_SEND_CONN 4     /* Tells uIP that a UDP datagram
-01365                                    should be constructed in the
-01366                                    uip_buf buffer. */
-01367 #if UIP_UDP
-01368 #define UIP_UDP_TIMER     5
-01369 #endif /* UIP_UDP */
-01370 
-01371 /* The TCP states used in the uip_conn->tcpstateflags. */
-01372 #define UIP_CLOSED      0
-01373 #define UIP_SYN_RCVD    1
-01374 #define UIP_SYN_SENT    2
-01375 #define UIP_ESTABLISHED 3
-01376 #define UIP_FIN_WAIT_1  4
-01377 #define UIP_FIN_WAIT_2  5
-01378 #define UIP_CLOSING     6
-01379 #define UIP_TIME_WAIT   7
-01380 #define UIP_LAST_ACK    8
-01381 #define UIP_TS_MASK     15
-01382   
-01383 #define UIP_STOPPED      16
-01384 
-01385 /* The TCP and IP headers. */
-01386 struct uip_tcpip_hdr {
-01387 #if UIP_CONF_IPV6
-01388   /* IPv6 header. */
-01389   u8_t vtc,
-01390     tcflow;
-01391   u16_t flow;
-01392   u8_t len[2];
-01393   u8_t proto, ttl;
-01394   uip_ip6addr_t srcipaddr, destipaddr;
-01395 #else /* UIP_CONF_IPV6 */
-01396   /* IPv4 header. */
-01397   u8_t vhl,
-01398     tos,
-01399     len[2],
-01400     ipid[2],
-01401     ipoffset[2],
-01402     ttl,
-01403     proto;
-01404   u16_t ipchksum;
-01405   u16_t srcipaddr[2],
-01406     destipaddr[2];
-01407 #endif /* UIP_CONF_IPV6 */
-01408   
-01409   /* TCP header. */
-01410   u16_t srcport,
-01411     destport;
-01412   u8_t seqno[4],
-01413     ackno[4],
-01414     tcpoffset,
-01415     flags,
-01416     wnd[2];
-01417   u16_t tcpchksum;
-01418   u8_t urgp[2];
-01419   u8_t optdata[4];
-01420 };
-01421 
-01422 /* The ICMP and IP headers. */
-01423 struct uip_icmpip_hdr {
-01424 #if UIP_CONF_IPV6
-01425   /* IPv6 header. */
-01426   u8_t vtc,
-01427     tcf;
-01428   u16_t flow;
-01429   u8_t len[2];
-01430   u8_t proto, ttl;
-01431   uip_ip6addr_t srcipaddr, destipaddr;
-01432 #else /* UIP_CONF_IPV6 */
-01433   /* IPv4 header. */
-01434   u8_t vhl,
-01435     tos,
-01436     len[2],
-01437     ipid[2],
-01438     ipoffset[2],
-01439     ttl,
-01440     proto;
-01441   u16_t ipchksum;
-01442   u16_t srcipaddr[2],
-01443     destipaddr[2];
-01444 #endif /* UIP_CONF_IPV6 */
-01445   
-01446   /* ICMP (echo) header. */
-01447   u8_t type, icode;
-01448   u16_t icmpchksum;
-01449 #if !UIP_CONF_IPV6
-01450   u16_t id, seqno;
-01451 #else /* !UIP_CONF_IPV6 */
-01452   u8_t flags, reserved1, reserved2, reserved3;
-01453   u8_t icmp6data[16];
-01454   u8_t options[1];
-01455 #endif /* !UIP_CONF_IPV6 */
-01456 };
-01457 
-01458 
-01459 /* The UDP and IP headers. */
-01460 struct uip_udpip_hdr {
-01461 #if UIP_CONF_IPV6
-01462   /* IPv6 header. */
-01463   u8_t vtc,
-01464     tcf;
-01465   u16_t flow;
-01466   u8_t len[2];
-01467   u8_t proto, ttl;
-01468   uip_ip6addr_t srcipaddr, destipaddr;
-01469 #else /* UIP_CONF_IPV6 */
-01470   /* IP header. */
-01471   u8_t vhl,
-01472     tos,
-01473     len[2],
-01474     ipid[2],
-01475     ipoffset[2],
-01476     ttl,
-01477     proto;
-01478   u16_t ipchksum;
-01479   u16_t srcipaddr[2],
-01480     destipaddr[2];
-01481 #endif /* UIP_CONF_IPV6 */
-01482   
-01483   /* UDP header. */
-01484   u16_t srcport,
-01485     destport;
-01486   u16_t udplen;
-01487   u16_t udpchksum;
-01488 };
-01489 
-01490 
-01491 
-01492 /**
-01493  * The buffer size available for user data in the \ref uip_buf buffer.
-01494  *
-01495  * This macro holds the available size for user data in the \ref
-01496  * uip_buf buffer. The macro is intended to be used for checking
-01497  * bounds of available user data.
-01498  *
-01499  * Example:
-01500  \code
-01501  snprintf(uip_appdata, UIP_APPDATA_SIZE, "%u\n", i);
-01502  \endcode
-01503  *
-01504  * \hideinitializer
-01505  */
-01506 #define UIP_APPDATA_SIZE (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
-01507 
-01508 
-01509 #define UIP_PROTO_ICMP  1
-01510 #define UIP_PROTO_TCP   6
-01511 #define UIP_PROTO_UDP   17
-01512 #define UIP_PROTO_ICMP6 58
-01513 
-01514 /* Header sizes. */
-01515 #if UIP_CONF_IPV6
-01516 #define UIP_IPH_LEN    40
-01517 #else /* UIP_CONF_IPV6 */
-01518 #define UIP_IPH_LEN    20    /* Size of IP header */
-01519 #endif /* UIP_CONF_IPV6 */
-01520 #define UIP_UDPH_LEN    8    /* Size of UDP header */
-01521 #define UIP_TCPH_LEN   20    /* Size of TCP header */
-01522 #define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN)    /* Size of IP +
-01523                                                           UDP
-01524                                                           header */
-01525 #define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN)    /* Size of IP +
-01526                                                           TCP
-01527                                                           header */
-01528 #define UIP_TCPIP_HLEN UIP_IPTCPH_LEN
-01529 
-01530 
-01531 #if UIP_FIXEDADDR
-01532 extern const uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
-01533 #else /* UIP_FIXEDADDR */
-01534 extern uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
-01535 #endif /* UIP_FIXEDADDR */
-01536 
-01537 
-01538 
-01539 /**
-01540  * Representation of a 48-bit Ethernet address.
-01541  */
-01542 struct uip_eth_addr {
-01543   u8_t addr[6];
-01544 };
-01545 
-01546 /**
-01547  * Calculate the Internet checksum over a buffer.
-01548  *
-01549  * The Internet checksum is the one's complement of the one's
-01550  * complement sum of all 16-bit words in the buffer.
-01551  *
-01552  * See RFC1071.
-01553  *
-01554  * \param buf A pointer to the buffer over which the checksum is to be
-01555  * computed.
-01556  *
-01557  * \param len The length of the buffer over which the checksum is to
-01558  * be computed.
-01559  *
-01560  * \return The Internet checksum of the buffer.
-01561  */
-01562 u16_t uip_chksum(u16_t *buf, u16_t len);
-01563 
-01564 /**
-01565  * Calculate the IP header checksum of the packet header in uip_buf.
-01566  *
-01567  * The IP header checksum is the Internet checksum of the 20 bytes of
-01568  * the IP header.
-01569  *
-01570  * \return The IP header checksum of the IP header in the uip_buf
-01571  * buffer.
-01572  */
-01573 u16_t uip_ipchksum(void);
-01574 
-01575 /**
-01576  * Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
-01577  *
-01578  * The TCP checksum is the Internet checksum of data contents of the
-01579  * TCP segment, and a pseudo-header as defined in RFC793.
-01580  *
-01581  * \return The TCP checksum of the TCP segment in uip_buf and pointed
-01582  * to by uip_appdata.
-01583  */
-01584 u16_t uip_tcpchksum(void);
-01585 
-01586 /**
-01587  * Calculate the UDP checksum of the packet in uip_buf and uip_appdata.
-01588  *
-01589  * The UDP checksum is the Internet checksum of data contents of the
-01590  * UDP segment, and a pseudo-header as defined in RFC768.
-01591  *
-01592  * \return The UDP checksum of the UDP segment in uip_buf and pointed
-01593  * to by uip_appdata.
-01594  */
-01595 u16_t uip_udpchksum(void);
-01596 
-01597 
-01598 #endif /* __UIP_H__ */
-01599 
-01600 
-01601 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00203.html b/components/net/uip/doc/html/a00203.html deleted file mode 100644 index acdd37f1de..0000000000 --- a/components/net/uip/doc/html/a00203.html +++ /dev/null @@ -1,163 +0,0 @@ - - -uIP 1.0: uip/uip_arch.h Source File - - - - - - -

uip/uip_arch.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup uip
-00003  * {@
-00004  */
-00005 
-00006 /**
-00007  * \defgroup uiparch Architecture specific uIP functions
-00008  * @{
-00009  *
-00010  * The functions in the architecture specific module implement the IP
-00011  * check sum and 32-bit additions.
-00012  *
-00013  * The IP checksum calculation is the most computationally expensive
-00014  * operation in the TCP/IP stack and it therefore pays off to
-00015  * implement this in efficient assembler. The purpose of the uip-arch
-00016  * module is to let the checksum functions to be implemented in
-00017  * architecture specific assembler.
-00018  *
-00019  */
-00020 
-00021 /**
-00022  * \file
-00023  * Declarations of architecture specific functions.
-00024  * \author Adam Dunkels <adam@dunkels.com>
-00025  */
-00026 
-00027 /*
-00028  * Copyright (c) 2001, Adam Dunkels.
-00029  * All rights reserved.
-00030  *
-00031  * Redistribution and use in source and binary forms, with or without
-00032  * modification, are permitted provided that the following conditions
-00033  * are met:
-00034  * 1. Redistributions of source code must retain the above copyright
-00035  *    notice, this list of conditions and the following disclaimer.
-00036  * 2. Redistributions in binary form must reproduce the above copyright
-00037  *    notice, this list of conditions and the following disclaimer in the
-00038  *    documentation and/or other materials provided with the distribution.
-00039  * 3. The name of the author may not be used to endorse or promote
-00040  *    products derived from this software without specific prior
-00041  *    written permission.
-00042  *
-00043  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00044  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00045  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00046  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00047  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00048  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00049  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00050  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00051  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00052  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00053  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00054  *
-00055  * This file is part of the uIP TCP/IP stack.
-00056  *
-00057  * $Id: uip_arch.h,v 1.2 2006/06/07 09:15:19 adam Exp $
-00058  *
-00059  */
-00060 
-00061 #ifndef __UIP_ARCH_H__
-00062 #define __UIP_ARCH_H__
-00063 
-00064 #include "uip.h"
-00065 
-00066 /**
-00067  * Carry out a 32-bit addition.
-00068  *
-00069  * Because not all architectures for which uIP is intended has native
-00070  * 32-bit arithmetic, uIP uses an external C function for doing the
-00071  * required 32-bit additions in the TCP protocol processing. This
-00072  * function should add the two arguments and place the result in the
-00073  * global variable uip_acc32.
-00074  *
-00075  * \note The 32-bit integer pointed to by the op32 parameter and the
-00076  * result in the uip_acc32 variable are in network byte order (big
-00077  * endian).
-00078  *
-00079  * \param op32 A pointer to a 4-byte array representing a 32-bit
-00080  * integer in network byte order (big endian).
-00081  *
-00082  * \param op16 A 16-bit integer in host byte order.
-00083  */
-00084 void uip_add32(u8_t *op32, u16_t op16);
-00085 
-00086 /**
-00087  * Calculate the Internet checksum over a buffer.
-00088  *
-00089  * The Internet checksum is the one's complement of the one's
-00090  * complement sum of all 16-bit words in the buffer.
-00091  *
-00092  * See RFC1071.
-00093  *
-00094  * \note This function is not called in the current version of uIP,
-00095  * but future versions might make use of it.
-00096  *
-00097  * \param buf A pointer to the buffer over which the checksum is to be
-00098  * computed.
-00099  *
-00100  * \param len The length of the buffer over which the checksum is to
-00101  * be computed.
-00102  *
-00103  * \return The Internet checksum of the buffer.
-00104  */
-00105 u16_t uip_chksum(u16_t *buf, u16_t len);
-00106 
-00107 /**
-00108  * Calculate the IP header checksum of the packet header in uip_buf.
-00109  *
-00110  * The IP header checksum is the Internet checksum of the 20 bytes of
-00111  * the IP header.
-00112  *
-00113  * \return The IP header checksum of the IP header in the uip_buf
-00114  * buffer.
-00115  */
-00116 u16_t uip_ipchksum(void);
-00117 
-00118 /**
-00119  * Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
-00120  *
-00121  * The TCP checksum is the Internet checksum of data contents of the
-00122  * TCP segment, and a pseudo-header as defined in RFC793.
-00123  *
-00124  * \note The uip_appdata pointer that points to the packet data may
-00125  * point anywhere in memory, so it is not possible to simply calculate
-00126  * the Internet checksum of the contents of the uip_buf buffer.
-00127  *
-00128  * \return The TCP checksum of the TCP segment in uip_buf and pointed
-00129  * to by uip_appdata.
-00130  */
-00131 u16_t uip_tcpchksum(void);
-00132 
-00133 u16_t uip_udpchksum(void);
-00134 
-00135 /** @} */
-00136 /** @} */
-00137 
-00138 #endif /* __UIP_ARCH_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00204.html b/components/net/uip/doc/html/a00204.html deleted file mode 100644 index def45e93bb..0000000000 --- a/components/net/uip/doc/html/a00204.html +++ /dev/null @@ -1,448 +0,0 @@ - - -uIP 1.0: uip/uip_arp.c Source File - - - - - - -

uip/uip_arp.c

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup uip
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \defgroup uiparp uIP Address Resolution Protocol
-00008  * @{
-00009  *
-00010  * The Address Resolution Protocol ARP is used for mapping between IP
-00011  * addresses and link level addresses such as the Ethernet MAC
-00012  * addresses. ARP uses broadcast queries to ask for the link level
-00013  * address of a known IP address and the host which is configured with
-00014  * the IP address for which the query was meant, will respond with its
-00015  * link level address.
-00016  *
-00017  * \note This ARP implementation only supports Ethernet.
-00018  */
-00019  
-00020 /**
-00021  * \file
-00022  * Implementation of the ARP Address Resolution Protocol.
-00023  * \author Adam Dunkels <adam@dunkels.com>
-00024  *
-00025  */
-00026 
-00027 /*
-00028  * Copyright (c) 2001-2003, Adam Dunkels.
-00029  * All rights reserved.
-00030  *
-00031  * Redistribution and use in source and binary forms, with or without
-00032  * modification, are permitted provided that the following conditions
-00033  * are met:
-00034  * 1. Redistributions of source code must retain the above copyright
-00035  *    notice, this list of conditions and the following disclaimer.
-00036  * 2. Redistributions in binary form must reproduce the above copyright
-00037  *    notice, this list of conditions and the following disclaimer in the
-00038  *    documentation and/or other materials provided with the distribution.
-00039  * 3. The name of the author may not be used to endorse or promote
-00040  *    products derived from this software without specific prior
-00041  *    written permission.
-00042  *
-00043  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00044  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00045  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00046  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00047  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00048  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00049  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00050  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00051  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00052  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00053  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00054  *
-00055  * This file is part of the uIP TCP/IP stack.
-00056  *
-00057  * $Id: uip_arp.c,v 1.8 2006/06/02 23:36:21 adam Exp $
-00058  *
-00059  */
-00060 
-00061 
-00062 #include "uip_arp.h"
-00063 
-00064 #include <string.h>
-00065 
-00066 struct arp_hdr {
-00067   struct uip_eth_hdr ethhdr;
-00068   u16_t hwtype;
-00069   u16_t protocol;
-00070   u8_t hwlen;
-00071   u8_t protolen;
-00072   u16_t opcode;
-00073   struct uip_eth_addr shwaddr;
-00074   u16_t sipaddr[2];
-00075   struct uip_eth_addr dhwaddr;
-00076   u16_t dipaddr[2];
-00077 };
-00078 
-00079 struct ethip_hdr {
-00080   struct uip_eth_hdr ethhdr;
-00081   /* IP header. */
-00082   u8_t vhl,
-00083     tos,
-00084     len[2],
-00085     ipid[2],
-00086     ipoffset[2],
-00087     ttl,
-00088     proto;
-00089   u16_t ipchksum;
-00090   u16_t srcipaddr[2],
-00091     destipaddr[2];
-00092 };
-00093 
-00094 #define ARP_REQUEST 1
-00095 #define ARP_REPLY   2
-00096 
-00097 #define ARP_HWTYPE_ETH 1
-00098 
-00099 struct arp_entry {
-00100   u16_t ipaddr[2];
-00101   struct uip_eth_addr ethaddr;
-00102   u8_t time;
-00103 };
-00104 
-00105 static const struct uip_eth_addr broadcast_ethaddr =
-00106   {{0xff,0xff,0xff,0xff,0xff,0xff}};
-00107 static const u16_t broadcast_ipaddr[2] = {0xffff,0xffff};
-00108 
-00109 static struct arp_entry arp_table[UIP_ARPTAB_SIZE];
-00110 static u16_t ipaddr[2];
-00111 static u8_t i, c;
-00112 
-00113 static u8_t arptime;
-00114 static u8_t tmpage;
-00115 
-00116 #define BUF   ((struct arp_hdr *)&uip_buf[0])
-00117 #define IPBUF ((struct ethip_hdr *)&uip_buf[0])
-00118 /*-----------------------------------------------------------------------------------*/
-00119 /**
-00120  * Initialize the ARP module.
-00121  *
-00122  */
-00123 /*-----------------------------------------------------------------------------------*/
-00124 void
-00125 uip_arp_init(void)
-00126 {
-00127   for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
-00128     memset(arp_table[i].ipaddr, 0, 4);
-00129   }
-00130 }
-00131 /*-----------------------------------------------------------------------------------*/
-00132 /**
-00133  * Periodic ARP processing function.
-00134  *
-00135  * This function performs periodic timer processing in the ARP module
-00136  * and should be called at regular intervals. The recommended interval
-00137  * is 10 seconds between the calls.
-00138  *
-00139  */
-00140 /*-----------------------------------------------------------------------------------*/
-00141 void
-00142 uip_arp_timer(void)
-00143 {
-00144   struct arp_entry *tabptr;
-00145   
-00146   ++arptime;
-00147   for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
-00148     tabptr = &arp_table[i];
-00149     if((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 &&
-00150        arptime - tabptr->time >= UIP_ARP_MAXAGE) {
-00151       memset(tabptr->ipaddr, 0, 4);
-00152     }
-00153   }
-00154 
-00155 }
-00156 /*-----------------------------------------------------------------------------------*/
-00157 static void
-00158 uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr)
-00159 {
-00160   register struct arp_entry *tabptr;
-00161   /* Walk through the ARP mapping table and try to find an entry to
-00162      update. If none is found, the IP -> MAC address mapping is
-00163      inserted in the ARP table. */
-00164   for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
-00165 
-00166     tabptr = &arp_table[i];
-00167     /* Only check those entries that are actually in use. */
-00168     if(tabptr->ipaddr[0] != 0 &&
-00169        tabptr->ipaddr[1] != 0) {
-00170 
-00171       /* Check if the source IP address of the incoming packet matches
-00172          the IP address in this ARP table entry. */
-00173       if(ipaddr[0] == tabptr->ipaddr[0] &&
-00174          ipaddr[1] == tabptr->ipaddr[1]) {
-00175          
-00176         /* An old entry found, update this and return. */
-00177         memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
-00178         tabptr->time = arptime;
-00179 
-00180         return;
-00181       }
-00182     }
-00183   }
-00184 
-00185   /* If we get here, no existing ARP table entry was found, so we
-00186      create one. */
-00187 
-00188   /* First, we try to find an unused entry in the ARP table. */
-00189   for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
-00190     tabptr = &arp_table[i];
-00191     if(tabptr->ipaddr[0] == 0 &&
-00192        tabptr->ipaddr[1] == 0) {
-00193       break;
-00194     }
-00195   }
-00196 
-00197   /* If no unused entry is found, we try to find the oldest entry and
-00198      throw it away. */
-00199   if(i == UIP_ARPTAB_SIZE) {
-00200     tmpage = 0;
-00201     c = 0;
-00202     for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
-00203       tabptr = &arp_table[i];
-00204       if(arptime - tabptr->time > tmpage) {
-00205         tmpage = arptime - tabptr->time;
-00206         c = i;
-00207       }
-00208     }
-00209     i = c;
-00210     tabptr = &arp_table[i];
-00211   }
-00212 
-00213   /* Now, i is the ARP table entry which we will fill with the new
-00214      information. */
-00215   memcpy(tabptr->ipaddr, ipaddr, 4);
-00216   memcpy(tabptr->ethaddr.addr, ethaddr->addr, 6);
-00217   tabptr->time = arptime;
-00218 }
-00219 /*-----------------------------------------------------------------------------------*/
-00220 /**
-00221  * ARP processing for incoming IP packets
-00222  *
-00223  * This function should be called by the device driver when an IP
-00224  * packet has been received. The function will check if the address is
-00225  * in the ARP cache, and if so the ARP cache entry will be
-00226  * refreshed. If no ARP cache entry was found, a new one is created.
-00227  *
-00228  * This function expects an IP packet with a prepended Ethernet header
-00229  * in the uip_buf[] buffer, and the length of the packet in the global
-00230  * variable uip_len.
-00231  */
-00232 /*-----------------------------------------------------------------------------------*/
-00233 #if 0
-00234 void
-00235 uip_arp_ipin(void)
-00236 {
-00237   uip_len -= sizeof(struct uip_eth_hdr);
-00238         
-00239   /* Only insert/update an entry if the source IP address of the
-00240      incoming IP packet comes from a host on the local network. */
-00241   if((IPBUF->srcipaddr[0] & uip_netmask[0]) !=
-00242      (uip_hostaddr[0] & uip_netmask[0])) {
-00243     return;
-00244   }
-00245   if((IPBUF->srcipaddr[1] & uip_netmask[1]) !=
-00246      (uip_hostaddr[1] & uip_netmask[1])) {
-00247     return;
-00248   }
-00249   uip_arp_update(IPBUF->srcipaddr, &(IPBUF->ethhdr.src));
-00250   
-00251   return;
-00252 }
-00253 #endif /* 0 */
-00254 /*-----------------------------------------------------------------------------------*/
-00255 /**
-00256  * ARP processing for incoming ARP packets.
-00257  *
-00258  * This function should be called by the device driver when an ARP
-00259  * packet has been received. The function will act differently
-00260  * depending on the ARP packet type: if it is a reply for a request
-00261  * that we previously sent out, the ARP cache will be filled in with
-00262  * the values from the ARP reply. If the incoming ARP packet is an ARP
-00263  * request for our IP address, an ARP reply packet is created and put
-00264  * into the uip_buf[] buffer.
-00265  *
-00266  * When the function returns, the value of the global variable uip_len
-00267  * indicates whether the device driver should send out a packet or
-00268  * not. If uip_len is zero, no packet should be sent. If uip_len is
-00269  * non-zero, it contains the length of the outbound packet that is
-00270  * present in the uip_buf[] buffer.
-00271  *
-00272  * This function expects an ARP packet with a prepended Ethernet
-00273  * header in the uip_buf[] buffer, and the length of the packet in the
-00274  * global variable uip_len.
-00275  */
-00276 /*-----------------------------------------------------------------------------------*/
-00277 void
-00278 uip_arp_arpin(void)
-00279 {
-00280   
-00281   if(uip_len < sizeof(struct arp_hdr)) {
-00282     uip_len = 0;
-00283     return;
-00284   }
-00285   uip_len = 0;
-00286   
-00287   switch(BUF->opcode) {
-00288   case HTONS(ARP_REQUEST):
-00289     /* ARP request. If it asked for our address, we send out a
-00290        reply. */
-00291     if(uip_ipaddr_cmp(BUF->dipaddr, uip_hostaddr)) {
-00292       /* First, we register the one who made the request in our ARP
-00293          table, since it is likely that we will do more communication
-00294          with this host in the future. */
-00295       uip_arp_update(BUF->sipaddr, &BUF->shwaddr);
-00296       
-00297       /* The reply opcode is 2. */
-00298       BUF->opcode = HTONS(2);
-00299 
-00300       memcpy(BUF->dhwaddr.addr, BUF->shwaddr.addr, 6);
-00301       memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
-00302       memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
-00303       memcpy(BUF->ethhdr.dest.addr, BUF->dhwaddr.addr, 6);
-00304       
-00305       BUF->dipaddr[0] = BUF->sipaddr[0];
-00306       BUF->dipaddr[1] = BUF->sipaddr[1];
-00307       BUF->sipaddr[0] = uip_hostaddr[0];
-00308       BUF->sipaddr[1] = uip_hostaddr[1];
-00309 
-00310       BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
-00311       uip_len = sizeof(struct arp_hdr);
-00312     }
-00313     break;
-00314   case HTONS(ARP_REPLY):
-00315     /* ARP reply. We insert or update the ARP table if it was meant
-00316        for us. */
-00317     if(uip_ipaddr_cmp(BUF->dipaddr, uip_hostaddr)) {
-00318       uip_arp_update(BUF->sipaddr, &BUF->shwaddr);
-00319     }
-00320     break;
-00321   }
-00322 
-00323   return;
-00324 }
-00325 /*-----------------------------------------------------------------------------------*/
-00326 /**
-00327  * Prepend Ethernet header to an outbound IP packet and see if we need
-00328  * to send out an ARP request.
-00329  *
-00330  * This function should be called before sending out an IP packet. The
-00331  * function checks the destination IP address of the IP packet to see
-00332  * what Ethernet MAC address that should be used as a destination MAC
-00333  * address on the Ethernet.
-00334  *
-00335  * If the destination IP address is in the local network (determined
-00336  * by logical ANDing of netmask and our IP address), the function
-00337  * checks the ARP cache to see if an entry for the destination IP
-00338  * address is found. If so, an Ethernet header is prepended and the
-00339  * function returns. If no ARP cache entry is found for the
-00340  * destination IP address, the packet in the uip_buf[] is replaced by
-00341  * an ARP request packet for the IP address. The IP packet is dropped
-00342  * and it is assumed that they higher level protocols (e.g., TCP)
-00343  * eventually will retransmit the dropped packet.
-00344  *
-00345  * If the destination IP address is not on the local network, the IP
-00346  * address of the default router is used instead.
-00347  *
-00348  * When the function returns, a packet is present in the uip_buf[]
-00349  * buffer, and the length of the packet is in the global variable
-00350  * uip_len.
-00351  */
-00352 /*-----------------------------------------------------------------------------------*/
-00353 void
-00354 uip_arp_out(void)
-00355 {
-00356   struct arp_entry *tabptr;
-00357   
-00358   /* Find the destination IP address in the ARP table and construct
-00359      the Ethernet header. If the destination IP addres isn't on the
-00360      local network, we use the default router's IP address instead.
-00361 
-00362      If not ARP table entry is found, we overwrite the original IP
-00363      packet with an ARP request for the IP address. */
-00364 
-00365   /* First check if destination is a local broadcast. */
-00366   if(uip_ipaddr_cmp(IPBUF->destipaddr, broadcast_ipaddr)) {
-00367     memcpy(IPBUF->ethhdr.dest.addr, broadcast_ethaddr.addr, 6);
-00368   } else {
-00369     /* Check if the destination address is on the local network. */
-00370     if(!uip_ipaddr_maskcmp(IPBUF->destipaddr, uip_hostaddr, uip_netmask)) {
-00371       /* Destination address was not on the local network, so we need to
-00372          use the default router's IP address instead of the destination
-00373          address when determining the MAC address. */
-00374       uip_ipaddr_copy(ipaddr, uip_draddr);
-00375     } else {
-00376       /* Else, we use the destination IP address. */
-00377       uip_ipaddr_copy(ipaddr, IPBUF->destipaddr);
-00378     }
-00379       
-00380     for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
-00381       tabptr = &arp_table[i];
-00382       if(uip_ipaddr_cmp(ipaddr, tabptr->ipaddr)) {
-00383         break;
-00384       }
-00385     }
-00386 
-00387     if(i == UIP_ARPTAB_SIZE) {
-00388       /* The destination address was not in our ARP table, so we
-00389          overwrite the IP packet with an ARP request. */
-00390 
-00391       memset(BUF->ethhdr.dest.addr, 0xff, 6);
-00392       memset(BUF->dhwaddr.addr, 0x00, 6);
-00393       memcpy(BUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
-00394       memcpy(BUF->shwaddr.addr, uip_ethaddr.addr, 6);
-00395     
-00396       uip_ipaddr_copy(BUF->dipaddr, ipaddr);
-00397       uip_ipaddr_copy(BUF->sipaddr, uip_hostaddr);
-00398       BUF->opcode = HTONS(ARP_REQUEST); /* ARP request. */
-00399       BUF->hwtype = HTONS(ARP_HWTYPE_ETH);
-00400       BUF->protocol = HTONS(UIP_ETHTYPE_IP);
-00401       BUF->hwlen = 6;
-00402       BUF->protolen = 4;
-00403       BUF->ethhdr.type = HTONS(UIP_ETHTYPE_ARP);
-00404 
-00405       uip_appdata = &uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN];
-00406     
-00407       uip_len = sizeof(struct arp_hdr);
-00408       return;
-00409     }
-00410 
-00411     /* Build an ethernet header. */
-00412     memcpy(IPBUF->ethhdr.dest.addr, tabptr->ethaddr.addr, 6);
-00413   }
-00414   memcpy(IPBUF->ethhdr.src.addr, uip_ethaddr.addr, 6);
-00415   
-00416   IPBUF->ethhdr.type = HTONS(UIP_ETHTYPE_IP);
-00417 
-00418   uip_len += sizeof(struct uip_eth_hdr);
-00419 }
-00420 /*-----------------------------------------------------------------------------------*/
-00421 
-00422 /** @} */
-00423 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00205.html b/components/net/uip/doc/html/a00205.html deleted file mode 100644 index 9d4feea8fc..0000000000 --- a/components/net/uip/doc/html/a00205.html +++ /dev/null @@ -1,169 +0,0 @@ - - -uIP 1.0: uip/uip_arp.h Source File - - - - - - -

uip/uip_arp.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup uip
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \addtogroup uiparp
-00008  * @{
-00009  */
-00010  
-00011 /**
-00012  * \file
-00013  * Macros and definitions for the ARP module.
-00014  * \author Adam Dunkels <adam@dunkels.com>
-00015  */
-00016   
-00017 
-00018 /*
-00019  * Copyright (c) 2001-2003, Adam Dunkels.
-00020  * All rights reserved.
-00021  *
-00022  * Redistribution and use in source and binary forms, with or without
-00023  * modification, are permitted provided that the following conditions
-00024  * are met:
-00025  * 1. Redistributions of source code must retain the above copyright
-00026  *    notice, this list of conditions and the following disclaimer.
-00027  * 2. Redistributions in binary form must reproduce the above copyright
-00028  *    notice, this list of conditions and the following disclaimer in the
-00029  *    documentation and/or other materials provided with the distribution.
-00030  * 3. The name of the author may not be used to endorse or promote
-00031  *    products derived from this software without specific prior
-00032  *    written permission.
-00033  *
-00034  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00035  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00036  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00037  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00038  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00039  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00040  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00041  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00042  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00043  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00044  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00045  *
-00046  * This file is part of the uIP TCP/IP stack.
-00047  *
-00048  * $Id: uip_arp.h,v 1.5 2006/06/11 21:46:39 adam Exp $
-00049  *
-00050  */
-00051 
-00052 #ifndef __UIP_ARP_H__
-00053 #define __UIP_ARP_H__
-00054 
-00055 #include "uip.h"
-00056 
-00057 
-00058 extern struct uip_eth_addr uip_ethaddr;
-00059 
-00060 /**
-00061  * The Ethernet header.
-00062  */
-00063 struct uip_eth_hdr {
-00064   struct uip_eth_addr dest;
-00065   struct uip_eth_addr src;
-00066   u16_t type;
-00067 };
-00068 
-00069 #define UIP_ETHTYPE_ARP 0x0806
-00070 #define UIP_ETHTYPE_IP  0x0800
-00071 #define UIP_ETHTYPE_IP6 0x86dd
-00072 
-00073 
-00074 /* The uip_arp_init() function must be called before any of the other
-00075    ARP functions. */
-00076 void uip_arp_init(void);
-00077 
-00078 /* The uip_arp_ipin() function should be called whenever an IP packet
-00079    arrives from the Ethernet. This function refreshes the ARP table or
-00080    inserts a new mapping if none exists. The function assumes that an
-00081    IP packet with an Ethernet header is present in the uip_buf buffer
-00082    and that the length of the packet is in the uip_len variable. */
-00083 /*void uip_arp_ipin(void);*/
-00084 #define uip_arp_ipin()
-00085 
-00086 /* The uip_arp_arpin() should be called when an ARP packet is received
-00087    by the Ethernet driver. This function also assumes that the
-00088    Ethernet frame is present in the uip_buf buffer. When the
-00089    uip_arp_arpin() function returns, the contents of the uip_buf
-00090    buffer should be sent out on the Ethernet if the uip_len variable
-00091    is > 0. */
-00092 void uip_arp_arpin(void);
-00093 
-00094 /* The uip_arp_out() function should be called when an IP packet
-00095    should be sent out on the Ethernet. This function creates an
-00096    Ethernet header before the IP header in the uip_buf buffer. The
-00097    Ethernet header will have the correct Ethernet MAC destination
-00098    address filled in if an ARP table entry for the destination IP
-00099    address (or the IP address of the default router) is present. If no
-00100    such table entry is found, the IP packet is overwritten with an ARP
-00101    request and we rely on TCP to retransmit the packet that was
-00102    overwritten. In any case, the uip_len variable holds the length of
-00103    the Ethernet frame that should be transmitted. */
-00104 void uip_arp_out(void);
-00105 
-00106 /* The uip_arp_timer() function should be called every ten seconds. It
-00107    is responsible for flushing old entries in the ARP table. */
-00108 void uip_arp_timer(void);
-00109 
-00110 /** @} */
-00111 
-00112 /**
-00113  * \addtogroup uipconffunc
-00114  * @{
-00115  */
-00116 
-00117 
-00118 /**
-00119  * Specifiy the Ethernet MAC address.
-00120  *
-00121  * The ARP code needs to know the MAC address of the Ethernet card in
-00122  * order to be able to respond to ARP queries and to generate working
-00123  * Ethernet headers.
-00124  *
-00125  * \note This macro only specifies the Ethernet MAC address to the ARP
-00126  * code. It cannot be used to change the MAC address of the Ethernet
-00127  * card.
-00128  *
-00129  * \param eaddr A pointer to a struct uip_eth_addr containing the
-00130  * Ethernet MAC address of the Ethernet card.
-00131  *
-00132  * \hideinitializer
-00133  */
-00134 #define uip_setethaddr(eaddr) do {uip_ethaddr.addr[0] = eaddr.addr[0]; \
-00135                               uip_ethaddr.addr[1] = eaddr.addr[1];\
-00136                               uip_ethaddr.addr[2] = eaddr.addr[2];\
-00137                               uip_ethaddr.addr[3] = eaddr.addr[3];\
-00138                               uip_ethaddr.addr[4] = eaddr.addr[4];\
-00139                               uip_ethaddr.addr[5] = eaddr.addr[5];} while(0)
-00140 
-00141 /** @} */
-00142 /** @} */
-00143 
-00144 #endif /* __UIP_ARP_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00206.html b/components/net/uip/doc/html/a00206.html deleted file mode 100644 index 3272565d24..0000000000 --- a/components/net/uip/doc/html/a00206.html +++ /dev/null @@ -1,564 +0,0 @@ - - -uIP 1.0: uip/uipopt.h Source File - - - - - - -

uip/uipopt.h

Go to the documentation of this file.
00001 /**
-00002  * \defgroup uipopt Configuration options for uIP
-00003  * @{
-00004  *
-00005  * uIP is configured using the per-project configuration file
-00006  * uipopt.h. This file contains all compile-time options for uIP and
-00007  * should be tweaked to match each specific project. The uIP
-00008  * distribution contains a documented example "uipopt.h" that can be
-00009  * copied and modified for each project.
-00010  *
-00011  * \note Most of the configuration options in the uipopt.h should not
-00012  * be changed, but rather the per-project uip-conf.h file.
-00013  */
-00014 
-00015 /**
-00016  * \file
-00017  * Configuration options for uIP.
-00018  * \author Adam Dunkels <adam@dunkels.com>
-00019  *
-00020  * This file is used for tweaking various configuration options for
-00021  * uIP. You should make a copy of this file into one of your project's
-00022  * directories instead of editing this example "uipopt.h" file that
-00023  * comes with the uIP distribution.
-00024  */
-00025 
-00026 /*
-00027  * Copyright (c) 2001-2003, Adam Dunkels.
-00028  * All rights reserved.
-00029  *
-00030  * Redistribution and use in source and binary forms, with or without
-00031  * modification, are permitted provided that the following conditions
-00032  * are met:
-00033  * 1. Redistributions of source code must retain the above copyright
-00034  *    notice, this list of conditions and the following disclaimer.
-00035  * 2. Redistributions in binary form must reproduce the above copyright
-00036  *    notice, this list of conditions and the following disclaimer in the
-00037  *    documentation and/or other materials provided with the distribution.
-00038  * 3. The name of the author may not be used to endorse or promote
-00039  *    products derived from this software without specific prior
-00040  *    written permission.
-00041  *
-00042  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-00043  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-00044  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00045  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-00046  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00047  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-00048  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-00049  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-00050  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-00051  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-00052  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-00053  *
-00054  * This file is part of the uIP TCP/IP stack.
-00055  *
-00056  * $Id: uipopt.h,v 1.4 2006/06/12 08:00:31 adam Exp $
-00057  *
-00058  */
-00059 
-00060 #ifndef __UIPOPT_H__
-00061 #define __UIPOPT_H__
-00062 
-00063 #ifndef UIP_LITTLE_ENDIAN
-00064 #define UIP_LITTLE_ENDIAN  3412
-00065 #endif /* UIP_LITTLE_ENDIAN */
-00066 #ifndef UIP_BIG_ENDIAN
-00067 #define UIP_BIG_ENDIAN     1234
-00068 #endif /* UIP_BIG_ENDIAN */
-00069 
-00070 #include "uip-conf.h"
-00071 
-00072 /*------------------------------------------------------------------------------*/
-00073 
-00074 /**
-00075  * \name Static configuration options
-00076  * @{
-00077  *
-00078  * These configuration options can be used for setting the IP address
-00079  * settings statically, but only if UIP_FIXEDADDR is set to 1. The
-00080  * configuration options for a specific node includes IP address,
-00081  * netmask and default router as well as the Ethernet address. The
-00082  * netmask, default router and Ethernet address are appliciable only
-00083  * if uIP should be run over Ethernet.
-00084  *
-00085  * All of these should be changed to suit your project.
-00086 */
-00087 
-00088 /**
-00089  * Determines if uIP should use a fixed IP address or not.
-00090  *
-00091  * If uIP should use a fixed IP address, the settings are set in the
-00092  * uipopt.h file. If not, the macros uip_sethostaddr(),
-00093  * uip_setdraddr() and uip_setnetmask() should be used instead.
-00094  *
-00095  * \hideinitializer
-00096  */
-00097 #define UIP_FIXEDADDR    0
-00098 
-00099 /**
-00100  * Ping IP address asignment.
-00101  *
-00102  * uIP uses a "ping" packets for setting its own IP address if this
-00103  * option is set. If so, uIP will start with an empty IP address and
-00104  * the destination IP address of the first incoming "ping" (ICMP echo)
-00105  * packet will be used for setting the hosts IP address.
-00106  *
-00107  * \note This works only if UIP_FIXEDADDR is 0.
-00108  *
-00109  * \hideinitializer
-00110  */
-00111 #ifdef UIP_CONF_PINGADDRCONF
-00112 #define UIP_PINGADDRCONF UIP_CONF_PINGADDRCONF
-00113 #else /* UIP_CONF_PINGADDRCONF */
-00114 #define UIP_PINGADDRCONF 0
-00115 #endif /* UIP_CONF_PINGADDRCONF */
-00116 
-00117 
-00118 /**
-00119  * Specifies if the uIP ARP module should be compiled with a fixed
-00120  * Ethernet MAC address or not.
-00121  *
-00122  * If this configuration option is 0, the macro uip_setethaddr() can
-00123  * be used to specify the Ethernet address at run-time.
-00124  *
-00125  * \hideinitializer
-00126  */
-00127 #define UIP_FIXEDETHADDR 0
-00128 
-00129 /** @} */
-00130 /*------------------------------------------------------------------------------*/
-00131 /**
-00132  * \name IP configuration options
-00133  * @{
-00134  *
-00135  */
-00136 /**
-00137  * The IP TTL (time to live) of IP packets sent by uIP.
-00138  *
-00139  * This should normally not be changed.
-00140  */
-00141 #define UIP_TTL         64
-00142 
-00143 /**
-00144  * Turn on support for IP packet reassembly.
-00145  *
-00146  * uIP supports reassembly of fragmented IP packets. This features
-00147  * requires an additonal amount of RAM to hold the reassembly buffer
-00148  * and the reassembly code size is approximately 700 bytes.  The
-00149  * reassembly buffer is of the same size as the uip_buf buffer
-00150  * (configured by UIP_BUFSIZE).
-00151  *
-00152  * \note IP packet reassembly is not heavily tested.
-00153  *
-00154  * \hideinitializer
-00155  */
-00156 #define UIP_REASSEMBLY 0
-00157 
-00158 /**
-00159  * The maximum time an IP fragment should wait in the reassembly
-00160  * buffer before it is dropped.
-00161  *
-00162  */
-00163 #define UIP_REASS_MAXAGE 40
-00164 
-00165 /** @} */
-00166 
-00167 /*------------------------------------------------------------------------------*/
-00168 /**
-00169  * \name UDP configuration options
-00170  * @{
-00171  */
-00172 
-00173 /**
-00174  * Toggles wether UDP support should be compiled in or not.
-00175  *
-00176  * \hideinitializer
-00177  */
-00178 #ifdef UIP_CONF_UDP
-00179 #define UIP_UDP UIP_CONF_UDP
-00180 #else /* UIP_CONF_UDP */
-00181 #define UIP_UDP           0
-00182 #endif /* UIP_CONF_UDP */
-00183 
-00184 /**
-00185  * Toggles if UDP checksums should be used or not.
-00186  *
-00187  * \note Support for UDP checksums is currently not included in uIP,
-00188  * so this option has no function.
-00189  *
-00190  * \hideinitializer
-00191  */
-00192 #ifdef UIP_CONF_UDP_CHECKSUMS
-00193 #define UIP_UDP_CHECKSUMS UIP_CONF_UDP_CHECKSUMS
-00194 #else
-00195 #define UIP_UDP_CHECKSUMS 0
-00196 #endif
-00197 
-00198 /**
-00199  * The maximum amount of concurrent UDP connections.
-00200  *
-00201  * \hideinitializer
-00202  */
-00203 #ifdef UIP_CONF_UDP_CONNS
-00204 #define UIP_UDP_CONNS UIP_CONF_UDP_CONNS
-00205 #else /* UIP_CONF_UDP_CONNS */
-00206 #define UIP_UDP_CONNS    10
-00207 #endif /* UIP_CONF_UDP_CONNS */
-00208 
-00209 /**
-00210  * The name of the function that should be called when UDP datagrams arrive.
-00211  *
-00212  * \hideinitializer
-00213  */
-00214 
-00215 
-00216 /** @} */
-00217 /*------------------------------------------------------------------------------*/
-00218 /**
-00219  * \name TCP configuration options
-00220  * @{
-00221  */
-00222 
-00223 /**
-00224  * Determines if support for opening connections from uIP should be
-00225  * compiled in.
-00226  *
-00227  * If the applications that are running on top of uIP for this project
-00228  * do not need to open outgoing TCP connections, this configration
-00229  * option can be turned off to reduce the code size of uIP.
-00230  *
-00231  * \hideinitializer
-00232  */
-00233 #define UIP_ACTIVE_OPEN 1
-00234 
-00235 /**
-00236  * The maximum number of simultaneously open TCP connections.
-00237  *
-00238  * Since the TCP connections are statically allocated, turning this
-00239  * configuration knob down results in less RAM used. Each TCP
-00240  * connection requires approximatly 30 bytes of memory.
-00241  *
-00242  * \hideinitializer
-00243  */
-00244 #ifndef UIP_CONF_MAX_CONNECTIONS
-00245 #define UIP_CONNS       10
-00246 #else /* UIP_CONF_MAX_CONNECTIONS */
-00247 #define UIP_CONNS UIP_CONF_MAX_CONNECTIONS
-00248 #endif /* UIP_CONF_MAX_CONNECTIONS */
-00249 
-00250 
-00251 /**
-00252  * The maximum number of simultaneously listening TCP ports.
-00253  *
-00254  * Each listening TCP port requires 2 bytes of memory.
-00255  *
-00256  * \hideinitializer
-00257  */
-00258 #ifndef UIP_CONF_MAX_LISTENPORTS
-00259 #define UIP_LISTENPORTS 20
-00260 #else /* UIP_CONF_MAX_LISTENPORTS */
-00261 #define UIP_LISTENPORTS UIP_CONF_MAX_LISTENPORTS
-00262 #endif /* UIP_CONF_MAX_LISTENPORTS */
-00263 
-00264 /**
-00265  * Determines if support for TCP urgent data notification should be
-00266  * compiled in.
-00267  *
-00268  * Urgent data (out-of-band data) is a rarely used TCP feature that
-00269  * very seldom would be required.
-00270  *
-00271  * \hideinitializer
-00272  */
-00273 #define UIP_URGDATA      0
-00274 
-00275 /**
-00276  * The initial retransmission timeout counted in timer pulses.
-00277  *
-00278  * This should not be changed.
-00279  */
-00280 #define UIP_RTO         3
-00281 
-00282 /**
-00283  * The maximum number of times a segment should be retransmitted
-00284  * before the connection should be aborted.
-00285  *
-00286  * This should not be changed.
-00287  */
-00288 #define UIP_MAXRTX      8
-00289 
-00290 /**
-00291  * The maximum number of times a SYN segment should be retransmitted
-00292  * before a connection request should be deemed to have been
-00293  * unsuccessful.
-00294  *
-00295  * This should not need to be changed.
-00296  */
-00297 #define UIP_MAXSYNRTX      5
-00298 
-00299 /**
-00300  * The TCP maximum segment size.
-00301  *
-00302  * This is should not be to set to more than
-00303  * UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN.
-00304  */
-00305 #define UIP_TCP_MSS     (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
-00306 
-00307 /**
-00308  * The size of the advertised receiver's window.
-00309  *
-00310  * Should be set low (i.e., to the size of the uip_buf buffer) is the
-00311  * application is slow to process incoming data, or high (32768 bytes)
-00312  * if the application processes data quickly.
-00313  *
-00314  * \hideinitializer
-00315  */
-00316 #ifndef UIP_CONF_RECEIVE_WINDOW
-00317 #define UIP_RECEIVE_WINDOW UIP_TCP_MSS
-00318 #else
-00319 #define UIP_RECEIVE_WINDOW UIP_CONF_RECEIVE_WINDOW
-00320 #endif
-00321 
-00322 /**
-00323  * How long a connection should stay in the TIME_WAIT state.
-00324  *
-00325  * This configiration option has no real implication, and it should be
-00326  * left untouched.
-00327  */
-00328 #define UIP_TIME_WAIT_TIMEOUT 120
-00329 
-00330 
-00331 /** @} */
-00332 /*------------------------------------------------------------------------------*/
-00333 /**
-00334  * \name ARP configuration options
-00335  * @{
-00336  */
-00337 
-00338 /**
-00339  * The size of the ARP table.
-00340  *
-00341  * This option should be set to a larger value if this uIP node will
-00342  * have many connections from the local network.
-00343  *
-00344  * \hideinitializer
-00345  */
-00346 #ifdef UIP_CONF_ARPTAB_SIZE
-00347 #define UIP_ARPTAB_SIZE UIP_CONF_ARPTAB_SIZE
-00348 #else
-00349 #define UIP_ARPTAB_SIZE 8
-00350 #endif
-00351 
-00352 /**
-00353  * The maxium age of ARP table entries measured in 10ths of seconds.
-00354  *
-00355  * An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD
-00356  * default).
-00357  */
-00358 #define UIP_ARP_MAXAGE 120
-00359 
-00360 /** @} */
-00361 
-00362 /*------------------------------------------------------------------------------*/
-00363 
-00364 /**
-00365  * \name General configuration options
-00366  * @{
-00367  */
-00368 
-00369 /**
-00370  * The size of the uIP packet buffer.
-00371  *
-00372  * The uIP packet buffer should not be smaller than 60 bytes, and does
-00373  * not need to be larger than 1500 bytes. Lower size results in lower
-00374  * TCP throughput, larger size results in higher TCP throughput.
-00375  *
-00376  * \hideinitializer
-00377  */
-00378 #ifndef UIP_CONF_BUFFER_SIZE
-00379 #define UIP_BUFSIZE     400
-00380 #else /* UIP_CONF_BUFFER_SIZE */
-00381 #define UIP_BUFSIZE UIP_CONF_BUFFER_SIZE
-00382 #endif /* UIP_CONF_BUFFER_SIZE */
-00383 
-00384 
-00385 /**
-00386  * Determines if statistics support should be compiled in.
-00387  *
-00388  * The statistics is useful for debugging and to show the user.
-00389  *
-00390  * \hideinitializer
-00391  */
-00392 #ifndef UIP_CONF_STATISTICS
-00393 #define UIP_STATISTICS  0
-00394 #else /* UIP_CONF_STATISTICS */
-00395 #define UIP_STATISTICS UIP_CONF_STATISTICS
-00396 #endif /* UIP_CONF_STATISTICS */
-00397 
-00398 /**
-00399  * Determines if logging of certain events should be compiled in.
-00400  *
-00401  * This is useful mostly for debugging. The function uip_log()
-00402  * must be implemented to suit the architecture of the project, if
-00403  * logging is turned on.
-00404  *
-00405  * \hideinitializer
-00406  */
-00407 #ifndef UIP_CONF_LOGGING
-00408 #define UIP_LOGGING     0
-00409 #else /* UIP_CONF_LOGGING */
-00410 #define UIP_LOGGING     UIP_CONF_LOGGING
-00411 #endif /* UIP_CONF_LOGGING */
-00412 
-00413 /**
-00414  * Broadcast support.
-00415  *
-00416  * This flag configures IP broadcast support. This is useful only
-00417  * together with UDP.
-00418  *
-00419  * \hideinitializer
-00420  *
-00421  */
-00422 #ifndef UIP_CONF_BROADCAST
-00423 #define UIP_BROADCAST 0
-00424 #else /* UIP_CONF_BROADCAST */
-00425 #define UIP_BROADCAST UIP_CONF_BROADCAST
-00426 #endif /* UIP_CONF_BROADCAST */
-00427 
-00428 /**
-00429  * Print out a uIP log message.
-00430  *
-00431  * This function must be implemented by the module that uses uIP, and
-00432  * is called by uIP whenever a log message is generated.
-00433  */
-00434 void uip_log(char *msg);
-00435 
-00436 /**
-00437  * The link level header length.
-00438  *
-00439  * This is the offset into the uip_buf where the IP header can be
-00440  * found. For Ethernet, this should be set to 14. For SLIP, this
-00441  * should be set to 0.
-00442  *
-00443  * \hideinitializer
-00444  */
-00445 #ifdef UIP_CONF_LLH_LEN
-00446 #define UIP_LLH_LEN UIP_CONF_LLH_LEN
-00447 #else /* UIP_CONF_LLH_LEN */
-00448 #define UIP_LLH_LEN     14
-00449 #endif /* UIP_CONF_LLH_LEN */
-00450 
-00451 /** @} */
-00452 /*------------------------------------------------------------------------------*/
-00453 /**
-00454  * \name CPU architecture configuration
-00455  * @{
-00456  *
-00457  * The CPU architecture configuration is where the endianess of the
-00458  * CPU on which uIP is to be run is specified. Most CPUs today are
-00459  * little endian, and the most notable exception are the Motorolas
-00460  * which are big endian. The BYTE_ORDER macro should be changed to
-00461  * reflect the CPU architecture on which uIP is to be run.
-00462  */
-00463 
-00464 /**
-00465  * The byte order of the CPU architecture on which uIP is to be run.
-00466  *
-00467  * This option can be either BIG_ENDIAN (Motorola byte order) or
-00468  * LITTLE_ENDIAN (Intel byte order).
-00469  *
-00470  * \hideinitializer
-00471  */
-00472 #ifdef UIP_CONF_BYTE_ORDER
-00473 #define UIP_BYTE_ORDER     UIP_CONF_BYTE_ORDER
-00474 #else /* UIP_CONF_BYTE_ORDER */
-00475 #define UIP_BYTE_ORDER     UIP_LITTLE_ENDIAN
-00476 #endif /* UIP_CONF_BYTE_ORDER */
-00477 
-00478 /** @} */
-00479 /*------------------------------------------------------------------------------*/
-00480 
-00481 /**
-00482  * \name Appication specific configurations
-00483  * @{
-00484  *
-00485  * An uIP application is implemented using a single application
-00486  * function that is called by uIP whenever a TCP/IP event occurs. The
-00487  * name of this function must be registered with uIP at compile time
-00488  * using the UIP_APPCALL definition.
-00489  *
-00490  * uIP applications can store the application state within the
-00491  * uip_conn structure by specifying the type of the application
-00492  * structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t.
-00493  *
-00494  * The file containing the definitions must be included in the
-00495  * uipopt.h file.
-00496  *
-00497  * The following example illustrates how this can look.
-00498  \code
-00499 
-00500 void httpd_appcall(void);
-00501 #define UIP_APPCALL     httpd_appcall
-00502 
-00503 struct httpd_state {
-00504   u8_t state;
-00505   u16_t count;
-00506   char *dataptr;
-00507   char *script;
-00508 };
-00509 typedef struct httpd_state uip_tcp_appstate_t
-00510  \endcode
-00511  */
-00512 
-00513 /**
-00514  * \var #define UIP_APPCALL
-00515  *
-00516  * The name of the application function that uIP should call in
-00517  * response to TCP/IP events.
-00518  *
-00519  */
-00520 
-00521 /**
-00522  * \var typedef uip_tcp_appstate_t
-00523  *
-00524  * The type of the application state that is to be stored in the
-00525  * uip_conn structure. This usually is typedef:ed to a struct holding
-00526  * application state information.
-00527  */
-00528 
-00529 /**
-00530  * \var typedef uip_udp_appstate_t
-00531  *
-00532  * The type of the application state that is to be stored in the
-00533  * uip_conn structure. This usually is typedef:ed to a struct holding
-00534  * application state information.
-00535  */
-00536 /** @} */
-00537 /** @} */
-00538 
-00539 #endif /* __UIPOPT_H__ */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/a00207.html b/components/net/uip/doc/html/a00207.html deleted file mode 100644 index 937d9a6de3..0000000000 --- a/components/net/uip/doc/html/a00207.html +++ /dev/null @@ -1,182 +0,0 @@ - - -uIP 1.0: unix/uip-conf.h Source File - - - - - - -

unix/uip-conf.h

Go to the documentation of this file.
00001 /**
-00002  * \addtogroup uipopt
-00003  * @{
-00004  */
-00005 
-00006 /**
-00007  * \name Project-specific configuration options
-00008  * @{
-00009  *
-00010  * uIP has a number of configuration options that can be overridden
-00011  * for each project. These are kept in a project-specific uip-conf.h
-00012  * file and all configuration names have the prefix UIP_CONF.
-00013  */
-00014 
-00015 /*
-00016  * Copyright (c) 2006, Swedish Institute of Computer Science.
-00017  * All rights reserved.
-00018  *
-00019  * Redistribution and use in source and binary forms, with or without
-00020  * modification, are permitted provided that the following conditions
-00021  * are met:
-00022  * 1. Redistributions of source code must retain the above copyright
-00023  *    notice, this list of conditions and the following disclaimer.
-00024  * 2. Redistributions in binary form must reproduce the above copyright
-00025  *    notice, this list of conditions and the following disclaimer in the
-00026  *    documentation and/or other materials provided with the distribution.
-00027  * 3. Neither the name of the Institute nor the names of its contributors
-00028  *    may be used to endorse or promote products derived from this software
-00029  *    without specific prior written permission.
-00030  *
-00031  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-00032  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-00033  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-00034  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-00035  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-00036  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-00037  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-00038  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-00039  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-00040  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-00041  * SUCH DAMAGE.
-00042  *
-00043  * This file is part of the uIP TCP/IP stack
-00044  *
-00045  * $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
-00046  */
-00047 
-00048 /**
-00049  * \file
-00050  *         An example uIP configuration file
-00051  * \author
-00052  *         Adam Dunkels <adam@sics.se>
-00053  */
-00054 
-00055 #ifndef __UIP_CONF_H__
-00056 #define __UIP_CONF_H__
-00057 
-00058 #include <inttypes.h>
-00059 
-00060 /**
-00061  * 8 bit datatype
-00062  *
-00063  * This typedef defines the 8-bit type used throughout uIP.
-00064  *
-00065  * \hideinitializer
-00066  */
-00067 typedef uint8_t u8_t;
-00068 
-00069 /**
-00070  * 16 bit datatype
-00071  *
-00072  * This typedef defines the 16-bit type used throughout uIP.
-00073  *
-00074  * \hideinitializer
-00075  */
-00076 typedef uint16_t u16_t;
-00077 
-00078 /**
-00079  * Statistics datatype
-00080  *
-00081  * This typedef defines the dataype used for keeping statistics in
-00082  * uIP.
-00083  *
-00084  * \hideinitializer
-00085  */
-00086 typedef unsigned short uip_stats_t;
-00087 
-00088 /**
-00089  * Maximum number of TCP connections.
-00090  *
-00091  * \hideinitializer
-00092  */
-00093 #define UIP_CONF_MAX_CONNECTIONS 40
-00094 
-00095 /**
-00096  * Maximum number of listening TCP ports.
-00097  *
-00098  * \hideinitializer
-00099  */
-00100 #define UIP_CONF_MAX_LISTENPORTS 40
-00101 
-00102 /**
-00103  * uIP buffer size.
-00104  *
-00105  * \hideinitializer
-00106  */
-00107 #define UIP_CONF_BUFFER_SIZE     420
-00108 
-00109 /**
-00110  * CPU byte order.
-00111  *
-00112  * \hideinitializer
-00113  */
-00114 #define UIP_CONF_BYTE_ORDER      LITTLE_ENDIAN
-00115 
-00116 /**
-00117  * Logging on or off
-00118  *
-00119  * \hideinitializer
-00120  */
-00121 #define UIP_CONF_LOGGING         1
-00122 
-00123 /**
-00124  * UDP support on or off
-00125  *
-00126  * \hideinitializer
-00127  */
-00128 #define UIP_CONF_UDP             0
-00129 
-00130 /**
-00131  * UDP checksums on or off
-00132  *
-00133  * \hideinitializer
-00134  */
-00135 #define UIP_CONF_UDP_CHECKSUMS   1
-00136 
-00137 /**
-00138  * uIP statistics on or off
-00139  *
-00140  * \hideinitializer
-00141  */
-00142 #define UIP_CONF_STATISTICS      1
-00143 
-00144 /* Here we include the header file for the application(s) we use in
-00145    our project. */
-00146 /*#include "smtp.h"*/
-00147 /*#include "hello-world.h"*/
-00148 /*#include "telnetd.h"*/
-00149 #include "webserver.h"
-00150 /*#include "dhcpc.h"*/
-00151 /*#include "resolv.h"*/
-00152 /*#include "webclient.h"*/
-00153 
-00154 #endif /* __UIP_CONF_H__ */
-00155 
-00156 /** @} */
-00157 /** @} */
-

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/annotated.html b/components/net/uip/doc/html/annotated.html deleted file mode 100644 index e64936120c..0000000000 --- a/components/net/uip/doc/html/annotated.html +++ /dev/null @@ -1,50 +0,0 @@ - - -uIP 1.0: Data Structures - - - - - - -

uIP 1.0 Data Structures

Here are the data structures with brief descriptions: - - - - - - - - - - - - - - - - - - - - - -
dhcpc_state
hello_world_state
httpd_cgi_call
httpd_state
memb_blocks
psockThe representation of a protosocket
psock_buf
pt
smtp_state
telnetd_state
timerA timer
uip_connRepresentation of a uIP TCP connection
uip_eth_addrRepresentation of a 48-bit Ethernet address
uip_eth_hdrThe Ethernet header
uip_icmpip_hdr
uip_neighbor_addr
uip_statsThe structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1
uip_tcpip_hdr
uip_udp_connRepresentation of a uIP UDP connection
uip_udpip_hdr
webclient_state
-
Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/classes.html b/components/net/uip/doc/html/classes.html deleted file mode 100644 index 7a937cb61a..0000000000 --- a/components/net/uip/doc/html/classes.html +++ /dev/null @@ -1,38 +0,0 @@ - - -uIP 1.0: Alphabetical List - - - - - - -

uIP 1.0 Data Structure Index

D | H | M | P | S | T | U | W

- -
  D  
-
  M  
-
  S  
-
uip_conn   uip_tcpip_hdr   
dhcpc_state   memb_blocks   smtp_state   uip_eth_addr   uip_udp_conn   
  H  
-
  P  
-
  T  
-
uip_eth_hdr   uip_udpip_hdr   
hello_world_state   psock   telnetd_state   uip_icmpip_hdr   
  W  
-
httpd_cgi_call   psock_buf   timer   uip_neighbor_addr   webclient_state   
httpd_state   pt   
  U  
-
uip_stats   

D | H | M | P | S | T | U | W

-


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/doxygen.css b/components/net/uip/doc/html/doxygen.css deleted file mode 100644 index 05615b2e61..0000000000 --- a/components/net/uip/doc/html/doxygen.css +++ /dev/null @@ -1,310 +0,0 @@ -BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { - font-family: Geneva, Arial, Helvetica, sans-serif; -} -BODY,TD { - font-size: 90%; -} -H1 { - text-align: center; - font-size: 160%; -} -H2 { - font-size: 120%; -} -H3 { - font-size: 100%; -} -CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.nav { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.navtab { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -TD.navtab { - font-size: 70%; -} -A.qindex { - text-decoration: none; - font-weight: bold; - color: #1A419D; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; - color: #1A419D -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - border: 1px double #9295C2; -} -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} -A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} -A.codeRef:link { font-weight: normal; color: #0000FF} -A.codeRef:visited { font-weight: normal; color: #0000FF} -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -.fragment { - font-family: Fixed, monospace; - font-size: 95%; -} -PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: #F4F4FB; font-weight: bold; } -TD.mdPrefix { - background-color: #F4F4FB; - color: #606060; - font-size: 80%; -} -TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } -TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; -} -DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} -TD.indexkey { - background-color: #e8eef2; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #e8eef2; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #008000 } -SPAN.keywordtype { color: #604020 } -SPAN.keywordflow { color: #e08000 } -SPAN.comment { color: #800000 } -SPAN.preprocessor { color: #806020 } -SPAN.stringliteral { color: #002080 } -SPAN.charliteral { color: #008080 } -.mdTable { - border: 1px solid #868686; - background-color: #F4F4FB; -} -.mdRow { - padding: 8px 10px; -} -.mdescLeft { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplParams { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - color: #606060; - background-color: #FAFAFA; - font-size: 80%; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -TD.tiny { font-size: 75%; -} -a { - color: #1A41A8; -} -a:visited { - color: #2A3798; -} -.dirtab { padding: 4px; - border-collapse: collapse; - border: 1px solid #84b0c7; -} -TH.dirtab { background: #e8eef2; - font-weight: bold; -} -HR { height: 1px; - border: none; - border-top: 1px solid black; -} - diff --git a/components/net/uip/doc/html/doxygen.png b/components/net/uip/doc/html/doxygen.png deleted file mode 100644 index f0a274bbaf..0000000000 Binary files a/components/net/uip/doc/html/doxygen.png and /dev/null differ diff --git a/components/net/uip/doc/html/examples.html b/components/net/uip/doc/html/examples.html deleted file mode 100644 index d51b041538..0000000000 --- a/components/net/uip/doc/html/examples.html +++ /dev/null @@ -1,38 +0,0 @@ - - -uIP 1.0: Examples - - - - - -

uIP 1.0 Examples

Here is a list of all examples: -
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/files.html b/components/net/uip/doc/html/files.html deleted file mode 100644 index 45982f989b..0000000000 --- a/components/net/uip/doc/html/files.html +++ /dev/null @@ -1,67 +0,0 @@ - - -uIP 1.0: File Index - - - - - - -

uIP 1.0 File List

Here is a list of all documented files with brief descriptions: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apps/dhcpc/dhcpc.c [code]
apps/dhcpc/dhcpc.h [code]
apps/hello-world/hello-world.c [code]An example of how to write uIP applications with protosockets
apps/hello-world/hello-world.h [code]Header file for an example of how to write uIP applications with protosockets
apps/resolv/resolv.c [code]DNS host name to IP address resolver
apps/resolv/resolv.h [code]DNS resolver code header file
apps/smtp/smtp.c [code]SMTP example implementation
apps/smtp/smtp.h [code]SMTP header file
apps/telnetd/shell.c [code]
apps/telnetd/shell.h [code]Interface for the Contiki shell
apps/telnetd/telnetd.c [code]
apps/telnetd/telnetd.h [code]
apps/webclient/webclient.c [code]Implementation of the HTTP client
apps/webclient/webclient.h [code]Header file for the HTTP client
apps/webserver/httpd-cgi.c [code]Web server script interface
apps/webserver/httpd-cgi.h [code]Web server script interface header file
apps/webserver/httpd.c [code]Web server
apps/webserver/httpd.h [code]
lib/memb.c [code]Memory block allocation routines
lib/memb.h [code]Memory block allocation routines
uip/clock.h [code]
uip/lc-addrlabels.h [code]Implementation of local continuations based on the "Labels as values" feature of gcc
uip/lc-switch.h [code]Implementation of local continuations based on switch() statment
uip/lc.h [code]Local continuations
uip/psock.c [code]
uip/psock.h [code]Protosocket library header file
uip/pt.h [code]Protothreads implementation
uip/timer.c [code]Timer library implementation
uip/timer.h [code]Timer library header file
uip/uip-neighbor.c [code]Database of link-local neighbors, used by IPv6 code and to be used by a future ARP code rewrite
uip/uip-neighbor.h [code]Header file for database of link-local neighbors, used by IPv6 code and to be used by future ARP code
uip/uip-split.c [code]
uip/uip-split.h [code]Module for splitting outbound TCP segments in two to avoid the delayed ACK throughput degradation
uip/uip.c [code]The uIP TCP/IP stack code
uip/uip.h [code]Header file for the uIP TCP/IP stack
uip/uip_arch.h [code]Declarations of architecture specific functions
uip/uip_arp.c [code]Implementation of the ARP Address Resolution Protocol
uip/uip_arp.h [code]Macros and definitions for the ARP module
uip/uipopt.h [code]Configuration options for uIP
unix/uip-conf.h [code]An example uIP configuration file
-
Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/ftv2blank.png b/components/net/uip/doc/html/ftv2blank.png deleted file mode 100644 index 493c3c0b61..0000000000 Binary files a/components/net/uip/doc/html/ftv2blank.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2doc.png b/components/net/uip/doc/html/ftv2doc.png deleted file mode 100644 index f72999f921..0000000000 Binary files a/components/net/uip/doc/html/ftv2doc.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2folderclosed.png b/components/net/uip/doc/html/ftv2folderclosed.png deleted file mode 100644 index d6d063440c..0000000000 Binary files a/components/net/uip/doc/html/ftv2folderclosed.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2folderopen.png b/components/net/uip/doc/html/ftv2folderopen.png deleted file mode 100644 index bbe2c913cf..0000000000 Binary files a/components/net/uip/doc/html/ftv2folderopen.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2lastnode.png b/components/net/uip/doc/html/ftv2lastnode.png deleted file mode 100644 index e7b9ba90cb..0000000000 Binary files a/components/net/uip/doc/html/ftv2lastnode.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2link.png b/components/net/uip/doc/html/ftv2link.png deleted file mode 100644 index 14f3fed003..0000000000 Binary files a/components/net/uip/doc/html/ftv2link.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2mlastnode.png b/components/net/uip/doc/html/ftv2mlastnode.png deleted file mode 100644 index 09ceb6adb0..0000000000 Binary files a/components/net/uip/doc/html/ftv2mlastnode.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2mnode.png b/components/net/uip/doc/html/ftv2mnode.png deleted file mode 100644 index 3254c05112..0000000000 Binary files a/components/net/uip/doc/html/ftv2mnode.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2node.png b/components/net/uip/doc/html/ftv2node.png deleted file mode 100644 index c9f06a57f4..0000000000 Binary files a/components/net/uip/doc/html/ftv2node.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2plastnode.png b/components/net/uip/doc/html/ftv2plastnode.png deleted file mode 100644 index 0b07e00913..0000000000 Binary files a/components/net/uip/doc/html/ftv2plastnode.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2pnode.png b/components/net/uip/doc/html/ftv2pnode.png deleted file mode 100644 index 2001b797ba..0000000000 Binary files a/components/net/uip/doc/html/ftv2pnode.png and /dev/null differ diff --git a/components/net/uip/doc/html/ftv2vertline.png b/components/net/uip/doc/html/ftv2vertline.png deleted file mode 100644 index b330f3a33c..0000000000 Binary files a/components/net/uip/doc/html/ftv2vertline.png and /dev/null differ diff --git a/components/net/uip/doc/html/functions.html b/components/net/uip/doc/html/functions.html deleted file mode 100644 index ab3e8e7a4d..0000000000 --- a/components/net/uip/doc/html/functions.html +++ /dev/null @@ -1,217 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - -
- -
-
- -
- -

-Here is a list of all documented struct and union fields with links to the struct/union documentation for each field: -

-

- a -

-

- b -

-

- c -

-

- d -

-

- f -

-

- g -

-

- h -

-

- i -

-

- l -

-

- m -

-

- n -

-

- o -

-

- p -

-

- r -

-

- s -

-

- t -

-

- u -

-

- v -

-

- w -

-
Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/functions_vars.html b/components/net/uip/doc/html/functions_vars.html deleted file mode 100644 index 466d78ad72..0000000000 --- a/components/net/uip/doc/html/functions_vars.html +++ /dev/null @@ -1,217 +0,0 @@ - - -uIP 1.0: Data Fields - Variables - - - - - - -
- -
-
- -
- -

-  -

-

- a -

-

- b -

-

- c -

-

- d -

-

- f -

-

- g -

-

- h -

-

- i -

-

- l -

-

- m -

-

- n -

-

- o -

-

- p -

-

- r -

-

- s -

-

- t -

-

- u -

-

- v -

-

- w -

-
Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals.html b/components/net/uip/doc/html/globals.html deleted file mode 100644 index 31796bf327..0000000000 --- a/components/net/uip/doc/html/globals.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- _ -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x61.html b/components/net/uip/doc/html/globals_0x61.html deleted file mode 100644 index 15a80fa9d4..0000000000 --- a/components/net/uip/doc/html/globals_0x61.html +++ /dev/null @@ -1,64 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- a -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x62.html b/components/net/uip/doc/html/globals_0x62.html deleted file mode 100644 index a5c8798304..0000000000 --- a/components/net/uip/doc/html/globals_0x62.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- b -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x64.html b/components/net/uip/doc/html/globals_0x64.html deleted file mode 100644 index b676eee78b..0000000000 --- a/components/net/uip/doc/html/globals_0x64.html +++ /dev/null @@ -1,73 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- d -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x65.html b/components/net/uip/doc/html/globals_0x65.html deleted file mode 100644 index c47f60d475..0000000000 --- a/components/net/uip/doc/html/globals_0x65.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- e -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x66.html b/components/net/uip/doc/html/globals_0x66.html deleted file mode 100644 index cc2bf8abe6..0000000000 --- a/components/net/uip/doc/html/globals_0x66.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- f -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x68.html b/components/net/uip/doc/html/globals_0x68.html deleted file mode 100644 index d01ae961aa..0000000000 --- a/components/net/uip/doc/html/globals_0x68.html +++ /dev/null @@ -1,73 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- h -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x69.html b/components/net/uip/doc/html/globals_0x69.html deleted file mode 100644 index fe4560810e..0000000000 --- a/components/net/uip/doc/html/globals_0x69.html +++ /dev/null @@ -1,84 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- i -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x6c.html b/components/net/uip/doc/html/globals_0x6c.html deleted file mode 100644 index eaeb84dda4..0000000000 --- a/components/net/uip/doc/html/globals_0x6c.html +++ /dev/null @@ -1,66 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- l -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x6d.html b/components/net/uip/doc/html/globals_0x6d.html deleted file mode 100644 index c3f3c121e0..0000000000 --- a/components/net/uip/doc/html/globals_0x6d.html +++ /dev/null @@ -1,69 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- m -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x6e.html b/components/net/uip/doc/html/globals_0x6e.html deleted file mode 100644 index 324dbb39d1..0000000000 --- a/components/net/uip/doc/html/globals_0x6e.html +++ /dev/null @@ -1,63 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- n -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x70.html b/components/net/uip/doc/html/globals_0x70.html deleted file mode 100644 index cf5972cffd..0000000000 --- a/components/net/uip/doc/html/globals_0x70.html +++ /dev/null @@ -1,95 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- p -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x72.html b/components/net/uip/doc/html/globals_0x72.html deleted file mode 100644 index ba708eb70c..0000000000 --- a/components/net/uip/doc/html/globals_0x72.html +++ /dev/null @@ -1,69 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- r -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x73.html b/components/net/uip/doc/html/globals_0x73.html deleted file mode 100644 index 19f8c41be5..0000000000 --- a/components/net/uip/doc/html/globals_0x73.html +++ /dev/null @@ -1,81 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- s -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x74.html b/components/net/uip/doc/html/globals_0x74.html deleted file mode 100644 index af197ed9c8..0000000000 --- a/components/net/uip/doc/html/globals_0x74.html +++ /dev/null @@ -1,76 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- t -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x75.html b/components/net/uip/doc/html/globals_0x75.html deleted file mode 100644 index 1f487bc9dd..0000000000 --- a/components/net/uip/doc/html/globals_0x75.html +++ /dev/null @@ -1,237 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- u -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_0x77.html b/components/net/uip/doc/html/globals_0x77.html deleted file mode 100644 index 8b56378734..0000000000 --- a/components/net/uip/doc/html/globals_0x77.html +++ /dev/null @@ -1,80 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: -

-

- w -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs.html b/components/net/uip/doc/html/globals_defs.html deleted file mode 100644 index 8bcd1937b1..0000000000 --- a/components/net/uip/doc/html/globals_defs.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- _ -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x61.html b/components/net/uip/doc/html/globals_defs_0x61.html deleted file mode 100644 index 82c84b8eac..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x61.html +++ /dev/null @@ -1,64 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- a -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x62.html b/components/net/uip/doc/html/globals_defs_0x62.html deleted file mode 100644 index c41b24b12f..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x62.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- b -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x64.html b/components/net/uip/doc/html/globals_defs_0x64.html deleted file mode 100644 index ff1fcbdb04..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x64.html +++ /dev/null @@ -1,73 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- d -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x65.html b/components/net/uip/doc/html/globals_defs_0x65.html deleted file mode 100644 index b08aab4547..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x65.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- e -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x66.html b/components/net/uip/doc/html/globals_defs_0x66.html deleted file mode 100644 index 1bd4a6e1c6..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x66.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- f -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x68.html b/components/net/uip/doc/html/globals_defs_0x68.html deleted file mode 100644 index 8c1a772d93..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x68.html +++ /dev/null @@ -1,67 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- h -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x69.html b/components/net/uip/doc/html/globals_defs_0x69.html deleted file mode 100644 index 7478ca0f78..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x69.html +++ /dev/null @@ -1,84 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- i -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x6c.html b/components/net/uip/doc/html/globals_defs_0x6c.html deleted file mode 100644 index 14730df9b4..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x6c.html +++ /dev/null @@ -1,65 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- l -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x6d.html b/components/net/uip/doc/html/globals_defs_0x6d.html deleted file mode 100644 index ccb1969544..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x6d.html +++ /dev/null @@ -1,66 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- m -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x6e.html b/components/net/uip/doc/html/globals_defs_0x6e.html deleted file mode 100644 index 5244c1d62f..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x6e.html +++ /dev/null @@ -1,63 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- n -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x70.html b/components/net/uip/doc/html/globals_defs_0x70.html deleted file mode 100644 index abd98a950e..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x70.html +++ /dev/null @@ -1,93 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- p -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x72.html b/components/net/uip/doc/html/globals_defs_0x72.html deleted file mode 100644 index a80c5cb376..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x72.html +++ /dev/null @@ -1,62 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- r -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x73.html b/components/net/uip/doc/html/globals_defs_0x73.html deleted file mode 100644 index f334e9ebfe..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x73.html +++ /dev/null @@ -1,70 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- s -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x74.html b/components/net/uip/doc/html/globals_defs_0x74.html deleted file mode 100644 index 8224ebfffb..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x74.html +++ /dev/null @@ -1,72 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- t -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x75.html b/components/net/uip/doc/html/globals_defs_0x75.html deleted file mode 100644 index 8f0ec88a4e..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x75.html +++ /dev/null @@ -1,188 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- u -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_defs_0x77.html b/components/net/uip/doc/html/globals_defs_0x77.html deleted file mode 100644 index 9f19416bb3..0000000000 --- a/components/net/uip/doc/html/globals_defs_0x77.html +++ /dev/null @@ -1,67 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- w -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_func.html b/components/net/uip/doc/html/globals_func.html deleted file mode 100644 index 49f1393d89..0000000000 --- a/components/net/uip/doc/html/globals_func.html +++ /dev/null @@ -1,136 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -
- -
- -

-  -

-

- h -

-

- m -

-

- p -

-

- r -

-

- s -

-

- t -

-

- u -

-

- w -

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_type.html b/components/net/uip/doc/html/globals_type.html deleted file mode 100644 index 084f32df4f..0000000000 --- a/components/net/uip/doc/html/globals_type.html +++ /dev/null @@ -1,47 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -  -

-

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/globals_vars.html b/components/net/uip/doc/html/globals_vars.html deleted file mode 100644 index beddb50898..0000000000 --- a/components/net/uip/doc/html/globals_vars.html +++ /dev/null @@ -1,55 +0,0 @@ - - -uIP 1.0: Data Fields - - - - - - - -  -

-

-
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/hierarchy.html b/components/net/uip/doc/html/hierarchy.html deleted file mode 100644 index 4b3ba986bd..0000000000 --- a/components/net/uip/doc/html/hierarchy.html +++ /dev/null @@ -1,50 +0,0 @@ - - -uIP 1.0: Hierarchical Index - - - - - - -

uIP 1.0 Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: -
Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/index.hhc b/components/net/uip/doc/html/index.hhc deleted file mode 100644 index be5830e649..0000000000 --- a/components/net/uip/doc/html/index.hhc +++ /dev/null @@ -1,192 +0,0 @@ - - - - - -
    -
  • -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
  • -
      -
    • -
        -
      • -
          -
        -
      -
    • -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      -
    • -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      • -
          -
        -
      -
    • -
        -
      -
    • -
        -
      -
    • -
        -
      -
    • -
        -
      -
    • -
        -
      -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
diff --git a/components/net/uip/doc/html/index.hhk b/components/net/uip/doc/html/index.hhk deleted file mode 100644 index ac1b196f93..0000000000 --- a/components/net/uip/doc/html/index.hhk +++ /dev/null @@ -1,450 +0,0 @@ - - - - - -
    -
  • -
      -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
      -
    • -
    • -
    -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
      -
    • -
    • -
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
diff --git a/components/net/uip/doc/html/index.hhp b/components/net/uip/doc/html/index.hhp deleted file mode 100644 index d7d07254a7..0000000000 --- a/components/net/uip/doc/html/index.hhp +++ /dev/null @@ -1,197 +0,0 @@ -[OPTIONS] -Compatibility=1.1 -Full-text search=Yes -Contents file=index.hhc -Default Window=main -Default topic=main.html -Index file=index.hhk -Language=0x409 English (United States) -Binary TOC=YES -Create CHI file=YES -Title=uIP 1.0 - -[WINDOWS] -main="uIP 1.0","index.hhc","index.hhk","main.html","main.html",,,,,0x23520,,0x387e,,,,,,,,0 - -[FILES] -main.html -files.html -a00048.html -a00049.html -a00042.html -a00043.html -a00036.html -a00037.html -a00046.html -a00047.html -a00038.html -a00039.html -a00044.html -a00045.html -a00051.html -a00050.html -a00040.html -a00041.html -a00168.html -a00169.html -a00170.html -a00171.html -a00172.html -a00173.html -a00174.html -a00175.html -a00176.html -a00177.html -a00178.html -a00179.html -a00180.html -a00181.html -a00182.html -a00183.html -a00184.html -a00185.html -a00186.html -a00187.html -a00188.html -a00189.html -a00190.html -a00191.html -a00192.html -a00193.html -a00194.html -a00195.html -a00196.html -a00197.html -a00198.html -a00199.html -a00200.html -a00201.html -a00202.html -a00203.html -a00204.html -a00205.html -a00206.html -a00207.html -a00100.html -a00101.html -a00102.html -a00103.html -a00104.html -a00105.html -a00107.html -a00110.html -a00111.html -a00112.html -a00113.html -a00114.html -a00120.html -a00121.html -a00123.html -a00124.html -a00125.html -a00127.html -a00128.html -a00129.html -a00130.html -a00131.html -a00132.html -a00134.html -a00135.html -a00136.html -a00137.html -a00138.html -a00139.html -a00140.html -a00141.html -annotated.html -classes.html -hierarchy.html -functions.html -functions_vars.html -a00077.html -a00078.html -a00079.html -a00080.html -a00081.html -a00082.html -a00083.html -a00084.html -a00085.html -a00086.html -a00087.html -a00088.html -a00089.html -a00090.html -a00091.html -a00092.html -a00093.html -a00094.html -a00095.html -a00096.html -a00097.html -a00142.html -a00143.html -a00144.html -a00145.html -a00146.html -a00147.html -a00148.html -a00149.html -a00150.html -a00151.html -a00152.html -a00153.html -a00154.html -a00155.html -a00156.html -a00157.html -a00158.html -a00159.html -a00160.html -a00161.html -a00162.html -a00163.html -a00164.html -modules.html -examples.html -globals.html -globals_0x61.html -globals_0x62.html -globals_0x64.html -globals_0x65.html -globals_0x66.html -globals_0x68.html -globals_0x69.html -globals_0x6c.html -globals_0x6d.html -globals_0x6e.html -globals_0x70.html -globals_0x72.html -globals_0x73.html -globals_0x74.html -globals_0x75.html -globals_0x77.html -globals_func.html -globals_vars.html -globals_type.html -globals_defs.html -globals_defs_0x61.html -globals_defs_0x62.html -globals_defs_0x64.html -globals_defs_0x65.html -globals_defs_0x66.html -globals_defs_0x68.html -globals_defs_0x69.html -globals_defs_0x6c.html -globals_defs_0x6d.html -globals_defs_0x6e.html -globals_defs_0x70.html -globals_defs_0x72.html -globals_defs_0x73.html -globals_defs_0x74.html -globals_defs_0x75.html -globals_defs_0x77.html -tabs.css -tab_b.gif -tab_l.gif -tab_r.gif diff --git a/components/net/uip/doc/html/index.html b/components/net/uip/doc/html/index.html deleted file mode 100644 index b4bd6701de..0000000000 --- a/components/net/uip/doc/html/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - -uIP 1.0 - - - - - diff --git a/components/net/uip/doc/html/main.html b/components/net/uip/doc/html/main.html deleted file mode 100644 index ab1b46ae63..0000000000 --- a/components/net/uip/doc/html/main.html +++ /dev/null @@ -1,421 +0,0 @@ - - -uIP 1.0: The uIP TCP/IP stack - - - - - -

The uIP TCP/IP stack

-

-

Author:
Adam Dunkels, http://www.sics.se/~adam/
-The uIP TCP/IP stack is intended to make it possible to communicate using the TCP/IP protocol suite even on small 8-bit micro-controllers. Despite being small and simple, uIP do not require their peers to have complex, full-size stacks, but can communicate with peers running a similarly light-weight stack. The code size is on the order of a few kilobytes and RAM usage can be configured to be as low as a few hundred bytes.

-uIP can be found at the uIP web page: http://www.sics.se/~adam/uip/

-

See also:
Application programs

-Compile-time configuration options

-Run-time configuration functions

-Initialization functions

-Device driver interface and variables used by device drivers

-uIP functions called from application programs (see below) and the protosockets API and their underlying protothreads

-

-Introduction

-With the success of the Internet, the TCP/IP protocol suite has become a global standard for communication. TCP/IP is the underlying protocol used for web page transfers, e-mail transmissions, file transfers, and peer-to-peer networking over the Internet. For embedded systems, being able to run native TCP/IP makes it possible to connect the system directly to an intranet or even the global Internet. Embedded devices with full TCP/IP support will be first-class network citizens, thus being able to fully communicate with other hosts in the network.

-Traditional TCP/IP implementations have required far too much resources both in terms of code size and memory usage to be useful in small 8 or 16-bit systems. Code size of a few hundred kilobytes and RAM requirements of several hundreds of kilobytes have made it impossible to fit the full TCP/IP stack into systems with a few tens of kilobytes of RAM and room for less than 100 kilobytes of code.

-The uIP implementation is designed to have only the absolute minimal set of features needed for a full TCP/IP stack. It can only handle a single network interface and contains the IP, ICMP, UDP and TCP protocols. uIP is written in the C programming language.

-Many other TCP/IP implementations for small systems assume that the embedded device always will communicate with a full-scale TCP/IP implementation running on a workstation-class machine. Under this assumption, it is possible to remove certain TCP/IP mechanisms that are very rarely used in such situations. Many of those mechanisms are essential, however, if the embedded device is to communicate with another equally limited device, e.g., when running distributed peer-to-peer services and protocols. uIP is designed to be RFC compliant in order to let the embedded devices to act as first-class network citizens. The uIP TCP/IP implementation that is not tailored for any specific application.

-TCP/IP Communication

-The full TCP/IP suite consists of numerous protocols, ranging from low level protocols such as ARP which translates IP addresses to MAC addresses, to application level protocols such as SMTP that is used to transfer e-mail. The uIP is mostly concerned with the TCP and IP protocols and upper layer protocols will be referred to as "the application". Lower layer protocols are often implemented in hardware or firmware and will be referred to as "the network device" that are controlled by the network device driver.

-TCP provides a reliable byte stream to the upper layer protocols. It breaks the byte stream into appropriately sized segments and each segment is sent in its own IP packet. The IP packets are sent out on the network by the network device driver. If the destination is not on the physically connected network, the IP packet is forwarded onto another network by a router that is situated between the two networks. If the maximum packet size of the other network is smaller than the size of the IP packet, the packet is fragmented into smaller packets by the router. If possible, the size of the TCP segments are chosen so that fragmentation is minimized. The final recipient of the packet will have to reassemble any fragmented IP packets before they can be passed to higher layers.

-The formal requirements for the protocols in the TCP/IP stack is specified in a number of RFC documents published by the Internet Engineering Task Force, IETF. Each of the protocols in the stack is defined in one more RFC documents and RFC1122 collects all requirements and updates the previous RFCs.

-The RFC1122 requirements can be divided into two categories; those that deal with the host to host communication and those that deal with communication between the application and the networking stack. An example of the first kind is "A TCP MUST be able to receive a TCP option in any segment" and an example of the second kind is "There MUST be a mechanism for reporting soft TCP error conditions to the application." A TCP/IP implementation that violates requirements of the first kind may not be able to communicate with other TCP/IP implementations and may even lead to network failures. Violation of the second kind of requirements will only affect the communication within the system and will not affect host-to-host communication.

-In uIP, all RFC requirements that affect host-to-host communication are implemented. However, in order to reduce code size, we have removed certain mechanisms in the interface between the application and the stack, such as the soft error reporting mechanism and dynamically configurable type-of-service bits for TCP connections. Since there are only very few applications that make use of those features they can be removed without loss of generality.

-Main Control Loop

-The uIP stack can be run either as a task in a multitasking system, or as the main program in a singletasking system. In both cases, the main control loop does two things repeatedly:

-

    -
  • Check if a packet has arrived from the network.
  • Check if a periodic timeout has occurred.
-

-If a packet has arrived, the input handler function, uip_input(), should be invoked by the main control loop. The input handler function will never block, but will return at once. When it returns, the stack or the application for which the incoming packet was intended may have produced one or more reply packets which should be sent out. If so, the network device driver should be called to send out these packets.

-Periodic timeouts are used to drive TCP mechanisms that depend on timers, such as delayed acknowledgments, retransmissions and round-trip time estimations. When the main control loop infers that the periodic timer should fire, it should invoke the timer handler function uip_periodic(). Because the TCP/IP stack may perform retransmissions when dealing with a timer event, the network device driver should called to send out the packets that may have been produced.

-Architecture Specific Functions

-uIP requires a few functions to be implemented specifically for the architecture on which uIP is intended to run. These functions should be hand-tuned for the particular architecture, but generic C implementations are given as part of the uIP distribution.

-Checksum Calculation

-The TCP and IP protocols implement a checksum that covers the data and header portions of the TCP and IP packets. Since the calculation of this checksum is made over all bytes in every packet being sent and received it is important that the function that calculates the checksum is efficient. Most often, this means that the checksum calculation must be fine-tuned for the particular architecture on which the uIP stack runs.

-While uIP includes a generic checksum function, it also leaves it open for an architecture specific implementation of the two functions uip_ipchksum() and uip_tcpchksum(). The checksum calculations in those functions can be written in highly optimized assembler rather than generic C code.

-32-bit Arithmetic

-The TCP protocol uses 32-bit sequence numbers, and a TCP implementation will have to do a number of 32-bit additions as part of the normal protocol processing. Since 32-bit arithmetic is not natively available on many of the platforms for which uIP is intended, uIP leaves the 32-bit additions to be implemented by the architecture specific module and does not make use of any 32-bit arithmetic in the main code base.

-While uIP implements a generic 32-bit addition, there is support for having an architecture specific implementation of the uip_add32() function.

-Memory Management

-In the architectures for which uIP is intended, RAM is the most scarce resource. With only a few kilobytes of RAM available for the TCP/IP stack to use, mechanisms used in traditional TCP/IP cannot be directly applied.

-The uIP stack does not use explicit dynamic memory allocation. Instead, it uses a single global buffer for holding packets and has a fixed table for holding connection state. The global packet buffer is large enough to contain one packet of maximum size. When a packet arrives from the network, the device driver places it in the global buffer and calls the TCP/IP stack. If the packet contains data, the TCP/IP stack will notify the corresponding application. Because the data in the buffer will be overwritten by the next incoming packet, the application will either have to act immediately on the data or copy the data into a secondary buffer for later processing. The packet buffer will not be overwritten by new packets before the application has processed the data. Packets that arrive when the application is processing the data must be queued, either by the network device or by the device driver. Most single-chip Ethernet controllers have on-chip buffers that are large enough to contain at least 4 maximum sized Ethernet frames. Devices that are handled by the processor, such as RS-232 ports, can copy incoming bytes to a separate buffer during application processing. If the buffers are full, the incoming packet is dropped. This will cause performance degradation, but only when multiple connections are running in parallel. This is because uIP advertises a very small receiver window, which means that only a single TCP segment will be in the network per connection.

-In uIP, the same global packet buffer that is used for incoming packets is also used for the TCP/IP headers of outgoing data. If the application sends dynamic data, it may use the parts of the global packet buffer that are not used for headers as a temporary storage buffer. To send the data, the application passes a pointer to the data as well as the length of the data to the stack. The TCP/IP headers are written into the global buffer and once the headers have been produced, the device driver sends the headers and the application data out on the network. The data is not queued for retransmissions. Instead, the application will have to reproduce the data if a retransmission is necessary.

-The total amount of memory usage for uIP depends heavily on the applications of the particular device in which the implementations are to be run. The memory configuration determines both the amount of traffic the system should be able to handle and the maximum amount of simultaneous connections. A device that will be sending large e-mails while at the same time running a web server with highly dynamic web pages and multiple simultaneous clients, will require more RAM than a simple Telnet server. It is possible to run the uIP implementation with as little as 200 bytes of RAM, but such a configuration will provide extremely low throughput and will only allow a small number of simultaneous connections.

-Application Program Interface (API)

-The Application Program Interface (API) defines the way the application program interacts with the TCP/IP stack. The most commonly used API for TCP/IP is the BSD socket API which is used in most Unix systems and has heavily influenced the Microsoft Windows WinSock API. Because the socket API uses stop-and-wait semantics, it requires support from an underlying multitasking operating system. Since the overhead of task management, context switching and allocation of stack space for the tasks might be too high in the intended uIP target architectures, the BSD socket interface is not suitable for our purposes.

-uIP provides two APIs to programmers: protosockets, a BSD socket-like API without the overhead of full multi-threading, and a "raw" event-based API that is nore low-level than protosockets but uses less memory.

-

See also:
Protosockets library

-Protothreads

-

-The uIP raw API

-The "raw" uIP API uses an event driven interface where the application is invoked in response to certain events. An application running on top of uIP is implemented as a C function that is called by uIP in response to certain events. uIP calls the application when data is received, when data has been successfully delivered to the other end of the connection, when a new connection has been set up, or when data has to be retransmitted. The application is also periodically polled for new data. The application program provides only one callback function; it is up to the application to deal with mapping different network services to different ports and connections. Because the application is able to act on incoming data and connection requests as soon as the TCP/IP stack receives the packet, low response times can be achieved even in low-end systems.

-uIP is different from other TCP/IP stacks in that it requires help from the application when doing retransmissions. Other TCP/IP stacks buffer the transmitted data in memory until the data is known to be successfully delivered to the remote end of the connection. If the data needs to be retransmitted, the stack takes care of the retransmission without notifying the application. With this approach, the data has to be buffered in memory while waiting for an acknowledgment even if the application might be able to quickly regenerate the data if a retransmission has to be made.

-In order to reduce memory usage, uIP utilizes the fact that the application may be able to regenerate sent data and lets the application take part in retransmissions. uIP does not keep track of packet contents after they have been sent by the device driver, and uIP requires that the application takes an active part in performing the retransmission. When uIP decides that a segment should be retransmitted, it calls the application with a flag set indicating that a retransmission is required. The application checks the retransmission flag and produces the same data that was previously sent. From the application's standpoint, performing a retransmission is not different from how the data originally was sent. Therefore the application can be written in such a way that the same code is used both for sending data and retransmitting data. Also, it is important to note that even though the actual retransmission operation is carried out by the application, it is the responsibility of the stack to know when the retransmission should be made. Thus the complexity of the application does not necessarily increase because it takes an active part in doing retransmissions.

-Application Events

-The application must be implemented as a C function, UIP_APPCALL(), that uIP calls whenever an event occurs. Each event has a corresponding test function that is used to distinguish between different events. The functions are implemented as C macros that will evaluate to either zero or non-zero. Note that certain events can happen in conjunction with each other (i.e., new data can arrive at the same time as data is acknowledged).

-The Connection Pointer

-When the application is called by uIP, the global variable uip_conn is set to point to the uip_conn structure for the connection that currently is handled, and is called the "current connection". The fields in the uip_conn structure for the current connection can be used, e.g., to distinguish between different services, or to check to which IP address the connection is connected. One typical use would be to inspect the uip_conn->lport (the local TCP port number) to decide which service the connection should provide. For instance, an application might decide to act as an HTTP server if the value of uip_conn->lport is equal to 80 and act as a TELNET server if the value is 23.

-Receiving Data

-If the uIP test function uip_newdata() is non-zero, the remote host of the connection has sent new data. The uip_appdata pointer point to the actual data. The size of the data is obtained through the uIP function uip_datalen(). The data is not buffered by uIP, but will be overwritten after the application function returns, and the application will therefor have to either act directly on the incoming data, or by itself copy the incoming data into a buffer for later processing.

-Sending Data

-When sending data, uIP adjusts the length of the data sent by the application according to the available buffer space and the current TCP window advertised by the receiver. The amount of buffer space is dictated by the memory configuration. It is therefore possible that all data sent from the application does not arrive at the receiver, and the application may use the uip_mss() function to see how much data that actually will be sent by the stack.

-The application sends data by using the uIP function uip_send(). The uip_send() function takes two arguments; a pointer to the data to be sent and the length of the data. If the application needs RAM space for producing the actual data that should be sent, the packet buffer (pointed to by the uip_appdata pointer) can be used for this purpose.

-The application can send only one chunk of data at a time on a connection and it is not possible to call uip_send() more than once per application invocation; only the data from the last call will be sent.

-Retransmitting Data

-Retransmissions are driven by the periodic TCP timer. Every time the periodic timer is invoked, the retransmission timer for each connection is decremented. If the timer reaches zero, a retransmission should be made. As uIP does not keep track of packet contents after they have been sent by the device driver, uIP requires that the application takes an active part in performing the retransmission. When uIP decides that a segment should be retransmitted, the application function is called with the uip_rexmit() flag set, indicating that a retransmission is required.

-The application must check the uip_rexmit() flag and produce the same data that was previously sent. From the application's standpoint, performing a retransmission is not different from how the data originally was sent. Therefor, the application can be written in such a way that the same code is used both for sending data and retransmitting data. Also, it is important to note that even though the actual retransmission operation is carried out by the application, it is the responsibility of the stack to know when the retransmission should be made. Thus the complexity of the application does not necessarily increase because it takes an active part in doing retransmissions.

-Closing Connections

-The application closes the current connection by calling the uip_close() during an application call. This will cause the connection to be cleanly closed. In order to indicate a fatal error, the application might want to abort the connection and does so by calling the uip_abort() function.

-If the connection has been closed by the remote end, the test function uip_closed() is true. The application may then do any necessary cleanups.

-Reporting Errors

-There are two fatal errors that can happen to a connection, either that the connection was aborted by the remote host, or that the connection retransmitted the last data too many times and has been aborted. uIP reports this by calling the application function. The application can use the two test functions uip_aborted() and uip_timedout() to test for those error conditions.

-Polling

-When a connection is idle, uIP polls the application every time the periodic timer fires. The application uses the test function uip_poll() to check if it is being polled by uIP.

-The polling event has two purposes. The first is to let the application periodically know that a connection is idle, which allows the application to close connections that have been idle for too long. The other purpose is to let the application send new data that has been produced. The application can only send data when invoked by uIP, and therefore the poll event is the only way to send data on an otherwise idle connection.

-Listening Ports

-uIP maintains a list of listening TCP ports. A new port is opened for listening with the uip_listen() function. When a connection request arrives on a listening port, uIP creates a new connection and calls the application function. The test function uip_connected() is true if the application was invoked because a new connection was created.

-The application can check the lport field in the uip_conn structure to check to which port the new connection was connected.

-Opening Connections

-New connections can be opened from within uIP by the function uip_connect(). This function allocates a new connection and sets a flag in the connection state which will open a TCP connection to the specified IP address and port the next time the connection is polled by uIP. The uip_connect() function returns a pointer to the uip_conn structure for the new connection. If there are no free connection slots, the function returns NULL.

-The function uip_ipaddr() may be used to pack an IP address into the two element 16-bit array used by uIP to represent IP addresses.

-Two examples of usage are shown below. The first example shows how to open a connection to TCP port 8080 of the remote end of the current connection. If there are not enough TCP connection slots to allow a new connection to be opened, the uip_connect() function returns NULL and the current connection is aborted by uip_abort().

-

void connect_example1_app(void) {
-   if(uip_connect(uip_conn->ripaddr, HTONS(8080)) == NULL) {
-      uip_abort();
-   }
-}   
-

-The second example shows how to open a new connection to a specific IP address. No error checks are made in this example.

-

void connect_example2(void) {
-   u16_t ipaddr[2];
-
-   uip_ipaddr(ipaddr, 192,168,0,1);
-   uip_connect(ipaddr, HTONS(8080));
-}
-

-Examples

-This section presents a number of very simple uIP applications. The uIP code distribution contains several more complex applications.

-A Very Simple Application

-This first example shows a very simple application. The application listens for incoming connections on port 1234. When a connection has been established, the application replies to all data sent to it by saying "ok"

-The implementation of this application is shown below. The application is initialized with the function called example1_init() and the uIP callback function is called example1_app(). For this application, the configuration variable UIP_APPCALL should be defined to be example1_app().

-

void example1_init(void) {
-   uip_listen(HTONS(1234));
-}
-
-void example1_app(void) {
-   if(uip_newdata() || uip_rexmit()) {
-      uip_send("ok\n", 3);
-   }
-}
-

-The initialization function calls the uIP function uip_listen() to register a listening port. The actual application function example1_app() uses the test functions uip_newdata() and uip_rexmit() to determine why it was called. If the application was called because the remote end has sent it data, it responds with an "ok". If the application function was called because data was lost in the network and has to be retransmitted, it also sends an "ok". Note that this example actually shows a complete uIP application. It is not required for an application to deal with all types of events such as uip_connected() or uip_timedout().

-A More Advanced Application

-This second example is slightly more advanced than the previous one, and shows how the application state field in the uip_conn structure is used.

-This application is similar to the first application in that it listens to a port for incoming connections and responds to data sent to it with a single "ok". The big difference is that this application prints out a welcoming "Welcome!" message when the connection has been established.

-This seemingly small change of operation makes a big difference in how the application is implemented. The reason for the increase in complexity is that if data should be lost in the network, the application must know what data to retransmit. If the "Welcome!" message was lost, the application must retransmit the welcome and if one of the "ok" messages is lost, the application must send a new "ok".

-The application knows that as long as the "Welcome!" message has not been acknowledged by the remote host, it might have been dropped in the network. But once the remote host has sent an acknowledgment back, the application can be sure that the welcome has been received and knows that any lost data must be an "ok" message. Thus the application can be in either of two states: either in the WELCOME-SENT state where the "Welcome!" has been sent but not acknowledged, or in the WELCOME-ACKED state where the "Welcome!" has been acknowledged.

-When a remote host connects to the application, the application sends the "Welcome!" message and sets it's state to WELCOME-SENT. When the welcome message is acknowledged, the application moves to the WELCOME-ACKED state. If the application receives any new data from the remote host, it responds by sending an "ok" back.

-If the application is requested to retransmit the last message, it looks at in which state the application is. If the application is in the WELCOME-SENT state, it sends a "Welcome!" message since it knows that the previous welcome message hasn't been acknowledged. If the application is in the WELCOME-ACKED state, it knows that the last message was an "ok" message and sends such a message.

-The implementation of this application is seen below. This configuration settings for the application is follows after its implementation.

-

struct example2_state {
-   enum {WELCOME_SENT, WELCOME_ACKED} state;
-};
-
-void example2_init(void) {
-   uip_listen(HTONS(2345));
-}
-
-void example2_app(void) {
-   struct example2_state *s;
-
-   s = (struct example2_state *)uip_conn->appstate;
-   
-   if(uip_connected()) {
-      s->state = WELCOME_SENT;
-      uip_send("Welcome!\n", 9);
-      return;
-   } 
-
-   if(uip_acked() && s->state == WELCOME_SENT) {
-      s->state = WELCOME_ACKED;
-   }
-
-   if(uip_newdata()) {
-      uip_send("ok\n", 3);
-   }
-
-   if(uip_rexmit()) {
-      switch(s->state) {
-      case WELCOME_SENT:
-         uip_send("Welcome!\n", 9);
-         break;
-      case WELCOME_ACKED:
-         uip_send("ok\n", 3);
-         break;
-      }
-   }
-}
-

-The configuration for the application:

-

#define UIP_APPCALL       example2_app
-#define UIP_APPSTATE_SIZE sizeof(struct example2_state)
-

-Differentiating Between Applications

-If the system should run multiple applications, one technique to differentiate between them is to use the TCP port number of either the remote end or the local end of the connection. The example below shows how the two examples above can be combined into one application.

-

void example3_init(void) {
-   example1_init();
-   example2_init();   
-}
-
-void example3_app(void) {
-   switch(uip_conn->lport) {
-   case HTONS(1234):
-      example1_app();
-      break;
-   case HTONS(2345):
-      example2_app();
-      break;
-   }
-}
-

-Utilizing TCP Flow Control

-This example shows a simple application that connects to a host, sends an HTTP request for a file and downloads it to a slow device such a disk drive. This shows how to use the flow control functions of uIP.

-

void example4_init(void) {
-   u16_t ipaddr[2];
-   uip_ipaddr(ipaddr, 192,168,0,1);
-   uip_connect(ipaddr, HTONS(80));
-}
-
-void example4_app(void) {
-   if(uip_connected() || uip_rexmit()) {
-      uip_send("GET /file HTTP/1.0\r\nServer:192.186.0.1\r\n\r\n",
-               48);
-      return;
-   }
-
-   if(uip_newdata()) {
-      device_enqueue(uip_appdata, uip_datalen());
-      if(device_queue_full()) {
-         uip_stop();
-      }
-   }
-
-   if(uip_poll() && uip_stopped()) {
-      if(!device_queue_full()) {
-         uip_restart();
-      }
-   }
-}
-

-When the connection has been established, an HTTP request is sent to the server. Since this is the only data that is sent, the application knows that if it needs to retransmit any data, it is that request that should be retransmitted. It is therefore possible to combine these two events as is done in the example.

-When the application receives new data from the remote host, it sends this data to the device by using the function device_enqueue(). It is important to note that this example assumes that this function copies the data into its own buffers. The data in the uip_appdata buffer will be overwritten by the next incoming packet.

-If the device's queue is full, the application stops the data from the remote host by calling the uIP function uip_stop(). The application can then be sure that it will not receive any new data until uip_restart() is called. The application polling event is used to check if the device's queue is no longer full and if so, the data flow is restarted with uip_restart().

-A Simple Web Server

-This example shows a very simple file server application that listens to two ports and uses the port number to determine which file to send. If the files are properly formatted, this simple application can be used as a web server with static pages. The implementation follows.

-

struct example5_state {
-   char *dataptr;
-   unsigned int dataleft;
-};
-
-void example5_init(void) {
-   uip_listen(HTONS(80));
-   uip_listen(HTONS(81));
-}
-
-void example5_app(void) {
-   struct example5_state *s;
-   s = (struct example5_state)uip_conn->appstate;
-   
-   if(uip_connected()) {
-      switch(uip_conn->lport) {
-      case HTONS(80):
-         s->dataptr = data_port_80;
-         s->dataleft = datalen_port_80;
-         break;
-      case HTONS(81):
-         s->dataptr = data_port_81;
-         s->dataleft = datalen_port_81;
-         break;
-      }
-      uip_send(s->dataptr, s->dataleft);
-      return;      
-   }
-
-   if(uip_acked()) {
-      if(s->dataleft < uip_mss()) {
-         uip_close();
-         return;
-      }
-      s->dataptr += uip_conn->len;
-      s->dataleft -= uip_conn->len;
-      uip_send(s->dataptr, s->dataleft);      
-   }
-}
-

-The application state consists of a pointer to the data that should be sent and the size of the data that is left to send. When a remote host connects to the application, the local port number is used to determine which file to send. The first chunk of data is sent using uip_send(). uIP makes sure that no more than MSS bytes of data is actually sent, even though s->dataleft may be larger than the MSS.

-The application is driven by incoming acknowledgments. When data has been acknowledged, new data can be sent. If there is no more data to send, the connection is closed using uip_close().

-Structured Application Program Design

-When writing larger programs using uIP it is useful to be able to utilize the uIP API in a structured way. The following example provides a structured design that has showed itself to be useful for writing larger protocol implementations than the previous examples showed here. The program is divided into an uIP event handler function that calls seven application handler functions that process new data, act on acknowledged data, send new data, deal with connection establishment or closure events and handle errors. The functions are called newdata(), acked(), senddata(), connected(), closed(), aborted(), and timedout(), and needs to be written specifically for the protocol that is being implemented.

-The uIP event handler function is shown below.

-

void example6_app(void) {
-  if(uip_aborted()) {
-    aborted();
-  }
-  if(uip_timedout()) {
-    timedout();
-  }
-  if(uip_closed()) {
-    closed();
-  }
-  if(uip_connected()) {
-    connected();
-  }
-  if(uip_acked()) {
-    acked();
-  }
-  if(uip_newdata()) {
-    newdata();
-  }
-  if(uip_rexmit() ||
-     uip_newdata() ||
-     uip_acked() ||
-     uip_connected() ||
-     uip_poll()) {
-    senddata();
-  }
-}
-

-The function starts with dealing with any error conditions that might have happened by checking if uip_aborted() or uip_timedout() are true. If so, the appropriate error function is called. Also, if the connection has been closed, the closed() function is called to the it deal with the event.

-Next, the function checks if the connection has just been established by checking if uip_connected() is true. The connected() function is called and is supposed to do whatever needs to be done when the connection is established, such as intializing the application state for the connection. Since it may be the case that data should be sent out, the senddata() function is called to deal with the outgoing data.

-The following very simple application serves as an example of how the application handler functions might look. This application simply waits for any data to arrive on the connection, and responds to the data by sending out the message "Hello world!". To illustrate how to develop an application state machine, this message is sent in two parts, first the "Hello" part and then the "world!" part.

-

#define STATE_WAITING 0
-#define STATE_HELLO   1
-#define STATE_WORLD   2
-
-struct example6_state {
-  u8_t state;
-  char *textptr;
-  int  textlen;
-};
-
-static void aborted(void) {}
-static void timedout(void) {}
-static void closed(void) {}
-
-static void connected(void) {
-  struct example6_state *s = (struct example6_state *)uip_conn->appstate;
-
-  s->state   = STATE_WAITING;
-  s->textlen = 0;
-}
-
-static void newdata(void) {
-  struct example6_state *s = (struct example6_state *)uip_conn->appstate;
-
-  if(s->state == STATE_WAITING) {
-    s->state   = STATE_HELLO;
-    s->textptr = "Hello ";
-    s->textlen = 6;
-  }
-}
-
-static void acked(void) {
-  struct example6_state *s = (struct example6_state *)uip_conn->appstate;
-  
-  s->textlen -= uip_conn->len;
-  s->textptr += uip_conn->len;
-  if(s->textlen == 0) {
-    switch(s->state) {
-    case STATE_HELLO:
-      s->state   = STATE_WORLD;
-      s->textptr = "world!\n";
-      s->textlen = 7;
-      break;
-    case STATE_WORLD:
-      uip_close();
-      break;
-    }
-  }
-}
-
-static void senddata(void) {
-  struct example6_state *s = (struct example6_state *)uip_conn->appstate;
-
-  if(s->textlen > 0) {
-    uip_send(s->textptr, s->textlen);
-  }
-}
-

-The application state consists of a "state" variable, a "textptr" pointer to a text message and the "textlen" length of the text message. The "state" variable can be either "STATE_WAITING", meaning that the application is waiting for data to arrive from the network, "STATE_HELLO", in which the application is sending the "Hello" part of the message, or "STATE_WORLD", in which the application is sending the "world!" message.

-The application does not handle errors or connection closing events, and therefore the aborted(), timedout() and closed() functions are implemented as empty functions.

-The connected() function will be called when a connection has been established, and in this case sets the "state" variable to be "STATE_WAITING" and the "textlen" variable to be zero, indicating that there is no message to be sent out.

-When new data arrives from the network, the newdata() function will be called by the event handler function. The newdata() function will check if the connection is in the "STATE_WAITING" state, and if so switches to the "STATE_HELLO" state and registers a 6 byte long "Hello " message with the connection. This message will later be sent out by the senddata() function.

-The acked() function is called whenever data that previously was sent has been acknowleged by the receiving host. This acked() function first reduces the amount of data that is left to send, by subtracting the length of the previously sent data (obtained from "uip_conn->len") from the "textlen" variable, and also adjusts the "textptr" pointer accordingly. It then checks if the "textlen" variable now is zero, which indicates that all data now has been successfully received, and if so changes application state. If the application was in the "STATE_HELLO" state, it switches state to "STATE_WORLD" and sets up a 7 byte "world!\n" message to be sent. If the application was in the "STATE_WORLD" state, it closes the connection.

-Finally, the senddata() function takes care of actually sending the data that is to be sent. It is called by the event handler function when new data has been received, when data has been acknowledged, when a new connection has been established, when the connection is polled because of inactivity, or when a retransmission should be made. The purpose of the senddata() function is to optionally format the data that is to be sent, and to call the uip_send() function to actually send out the data. In this particular example, the function simply calls uip_send() with the appropriate arguments if data is to be sent, after checking if data should be sent out or not as indicated by the "textlen" variable.

-It is important to note that the senddata() function never should affect the application state; this should only be done in the acked() and newdata() functions.

-Protocol Implementations

-The protocols in the TCP/IP protocol suite are designed in a layered fashion where each protocol performs a specific function and the interactions between the protocol layers are strictly defined. While the layered approach is a good way to design protocols, it is not always the best way to implement them. In uIP, the protocol implementations are tightly coupled in order to save code space.

-This section gives detailed information on the specific protocol implementations in uIP.

-IP --- Internet Protocol

-When incoming packets are processed by uIP, the IP layer is the first protocol that examines the packet. The IP layer does a few simple checks such as if the destination IP address of the incoming packet matches any of the local IP address and verifies the IP header checksum. Since there are no IP options that are strictly required and because they are very uncommon, any IP options in received packets are dropped.

-IP Fragment Reassembly

-IP fragment reassembly is implemented using a separate buffer that holds the packet to be reassembled. An incoming fragment is copied into the right place in the buffer and a bit map is used to keep track of which fragments have been received. Because the first byte of an IP fragment is aligned on an 8-byte boundary, the bit map requires a small amount of memory. When all fragments have been reassembled, the resulting IP packet is passed to the transport layer. If all fragments have not been received within a specified time frame, the packet is dropped.

-The current implementation only has a single buffer for holding packets to be reassembled, and therefore does not support simultaneous reassembly of more than one packet. Since fragmented packets are uncommon, this ought to be a reasonable decision. Extending the implementation to support multiple buffers would be straightforward, however.

-Broadcasts and Multicasts

-IP has the ability to broadcast and multicast packets on the local network. Such packets are addressed to special broadcast and multicast addresses. Broadcast is used heavily in many UDP based protocols such as the Microsoft Windows file-sharing SMB protocol. Multicast is primarily used in protocols used for multimedia distribution such as RTP. TCP is a point-to-point protocol and does not use broadcast or multicast packets. uIP current supports broadcast packets as well as sending multicast packets. Joining multicast groups (IGMP) and receiving non-local multicast packets is not currently supported.

-ICMP --- Internet Control Message Protocol

-The ICMP protocol is used for reporting soft error conditions and for querying host parameters. Its main use is, however, the echo mechanism which is used by the "ping" program.

-The ICMP implementation in uIP is very simple as itis restricted to only implement ICMP echo messages. Replies to echo messages are constructed by simply swapping the source and destination IP addresses of incoming echo requests and rewriting the ICMP header with the Echo-Reply message type. The ICMP checksum is adjusted using standard techniques (see RFC1624).

-Since only the ICMP echo message is implemented, there is no support for Path MTU discovery or ICMP redirect messages. Neither of these is strictly required for interoperability; they are performance enhancement mechanisms.

-TCP --- Transmission Control Protocol

-The TCP implementation in uIP is driven by incoming packets and timer events. Incoming packets are parsed by TCP and if the packet contains data that is to be delivered to the application, the application is invoked by the means of the application function call. If the incoming packet acknowledges previously sent data, the connection state is updated and the application is informed, allowing it to send out new data.

-Listening Connections

-TCP allows a connection to listen for incoming connection requests. In uIP, a listening connection is identified by the 16-bit port number and incoming connection requests are checked against the list of listening connections. This list of listening connections is dynamic and can be altered by the applications in the system.

-Sliding Window

-Most TCP implementations use a sliding window mechanism for sending data. Multiple data segments are sent in succession without waiting for an acknowledgment for each segment.

-The sliding window algorithm uses a lot of 32-bit operations and because 32-bit arithmetic is fairly expensive on most 8-bit CPUs, uIP does not implement it. Also, uIP does not buffer sent packets and a sliding window implementation that does not buffer sent packets will have to be supported by a complex application layer. Instead, uIP allows only a single TCP segment per connection to be unacknowledged at any given time.

-It is important to note that even though most TCP implementations use the sliding window algorithm, it is not required by the TCP specifications. Removing the sliding window mechanism does not affect interoperability in any way.

-Round-Trip Time Estimation

-TCP continuously estimates the current Round-Trip Time (RTT) of every active connection in order to find a suitable value for the retransmission time-out.

-The RTT estimation in uIP is implemented using TCP's periodic timer. Each time the periodic timer fires, it increments a counter for each connection that has unacknowledged data in the network. When an acknowledgment is received, the current value of the counter is used as a sample of the RTT. The sample is used together with Van Jacobson's standard TCP RTT estimation function to calculate an estimate of the RTT. Karn's algorithm is used to ensure that retransmissions do not skew the estimates.

-Retransmissions

-Retransmissions are driven by the periodic TCP timer. Every time the periodic timer is invoked, the retransmission timer for each connection is decremented. If the timer reaches zero, a retransmission should be made.

-As uIP does not keep track of packet contents after they have been sent by the device driver, uIP requires that the application takes an active part in performing the retransmission. When uIP decides that a segment should be retransmitted, it calls the application with a flag set indicating that a retransmission is required. The application checks the retransmission flag and produces the same data that was previously sent. From the application's standpoint, performing a retransmission is not different from how the data originally was sent. Therefore the application can be written in such a way that the same code is used both for sending data and retransmitting data. Also, it is important to note that even though the actual retransmission operation is carried out by the application, it is the responsibility of the stack to know when the retransmission should be made. Thus the complexity of the application does not necessarily increase because it takes an active part in doing retransmissions.

-Flow Control

-The purpose of TCP's flow control mechanisms is to allow communication between hosts with wildly varying memory dimensions. In each TCP segment, the sender of the segment indicates its available buffer space. A TCP sender must not send more data than the buffer space indicated by the receiver.

-In uIP, the application cannot send more data than the receiving host can buffer. And application cannot send more data than the amount of bytes it is allowed to send by the receiving host. If the remote host cannot accept any data at all, the stack initiates the zero window probing mechanism.

-Congestion Control

-The congestion control mechanisms limit the number of simultaneous TCP segments in the network. The algorithms used for congestion control are designed to be simple to implement and require only a few lines of code.

-Since uIP only handles one in-flight TCP segment per connection, the amount of simultaneous segments cannot be further limited, thus the congestion control mechanisms are not needed.

-Urgent Data

-TCP's urgent data mechanism provides an application-to-application notification mechanism, which can be used by an application to mark parts of the data stream as being more urgent than the normal stream. It is up to the receiving application to interpret the meaning of the urgent data.

-In many TCP implementations, including the BSD implementation, the urgent data feature increases the complexity of the implementation because it requires an asynchronous notification mechanism in an otherwise synchronous API. As uIP already use an asynchronous event based API, the implementation of the urgent data feature does not lead to increased complexity.

-Performance

-In TCP/IP implementations for high-end systems, processing time is dominated by the checksum calculation loop, the operation of copying packet data and context switching. Operating systems for high-end systems often have multiple protection domains for protecting kernel data from user processes and user processes from each other. Because the TCP/IP stack is run in the kernel, data has to be copied between the kernel space and the address space of the user processes and a context switch has to be performed once the data has been copied. Performance can be enhanced by combining the copy operation with the checksum calculation. Because high-end systems usually have numerous active connections, packet demultiplexing is also an expensive operation.

-A small embedded device does not have the necessary processing power to have multiple protection domains and the power to run a multitasking operating system. Therefore there is no need to copy data between the TCP/IP stack and the application program. With an event based API there is no context switch between the TCP/IP stack and the applications.

-In such limited systems, the TCP/IP processing overhead is dominated by the copying of packet data from the network device to host memory, and checksum calculation. Apart from the checksum calculation and copying, the TCP processing done for an incoming packet involves only updating a few counters and flags before handing the data over to the application. Thus an estimate of the CPU overhead of our TCP/IP implementations can be obtained by calculating the amount of CPU cycles needed for the checksum calculation and copying of a maximum sized packet.

-The Impact of Delayed Acknowledgments

-Most TCP receivers implement the delayed acknowledgment algorithm for reducing the number of pure acknowledgment packets sent. A TCP receiver using this algorithm will only send acknowledgments for every other received segment. If no segment is received within a specific time-frame, an acknowledgment is sent. The time-frame can be as high as 500 ms but typically is 200 ms.

-A TCP sender such as uIP that only handles a single outstanding TCP segment will interact poorly with the delayed acknowledgment algorithm. Because the receiver only receives a single segment at a time, it will wait as much as 500 ms before an acknowledgment is sent. This means that the maximum possible throughput is severely limited by the 500 ms idle time.

-Thus the maximum throughput equation when sending data from uIP will be $p = s / (t + t_d)$ where $s$ is the segment size and $t_d$ is the delayed acknowledgment timeout, which typically is between 200 and 500 ms. With a segment size of 1000 bytes, a round-trip time of 40 ms and a delayed acknowledgment timeout of 200 ms, the maximum throughput will be 4166 bytes per second. With the delayed acknowledgment algorithm disabled at the receiver, the maximum throughput would be 25000 bytes per second.

-It should be noted, however, that since small systems running uIP are not very likely to have large amounts of data to send, the delayed acknowledgmen t throughput degradation of uIP need not be very severe. Small amounts of data sent by such a system will not span more than a single TCP segment, and would therefore not be affected by the throughput degradation anyway.

-The maximum throughput when uIP acts as a receiver is not affected by the delayed acknowledgment throughput degradation.


Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/modules.html b/components/net/uip/doc/html/modules.html deleted file mode 100644 index 254612a4d5..0000000000 --- a/components/net/uip/doc/html/modules.html +++ /dev/null @@ -1,51 +0,0 @@ - - -uIP 1.0: Module Index - - - - - -

uIP 1.0 Modules

Here is a list of all modules: -
Generated on Mon Jun 12 10:23:02 2006 for uIP 1.0 by  - -doxygen 1.4.6
- - diff --git a/components/net/uip/doc/html/tab_b.gif b/components/net/uip/doc/html/tab_b.gif deleted file mode 100644 index 0d623483ff..0000000000 Binary files a/components/net/uip/doc/html/tab_b.gif and /dev/null differ diff --git a/components/net/uip/doc/html/tab_l.gif b/components/net/uip/doc/html/tab_l.gif deleted file mode 100644 index 9b1e6337c9..0000000000 Binary files a/components/net/uip/doc/html/tab_l.gif and /dev/null differ diff --git a/components/net/uip/doc/html/tab_r.gif b/components/net/uip/doc/html/tab_r.gif deleted file mode 100644 index ce9dd9f533..0000000000 Binary files a/components/net/uip/doc/html/tab_r.gif and /dev/null differ diff --git a/components/net/uip/doc/html/tabs.css b/components/net/uip/doc/html/tabs.css deleted file mode 100644 index a61552a67a..0000000000 --- a/components/net/uip/doc/html/tabs.css +++ /dev/null @@ -1,102 +0,0 @@ -/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ - -DIV.tabs -{ - float : left; - width : 100%; - background : url("tab_b.gif") repeat-x bottom; - margin-bottom : 4px; -} - -DIV.tabs UL -{ - margin : 0px; - padding-left : 10px; - list-style : none; -} - -DIV.tabs LI, DIV.tabs FORM -{ - display : inline; - margin : 0px; - padding : 0px; -} - -DIV.tabs FORM -{ - float : right; -} - -DIV.tabs A -{ - float : left; - background : url("tab_r.gif") no-repeat right top; - border-bottom : 1px solid #84B0C7; - font-size : x-small; - font-weight : bold; - text-decoration : none; -} - -DIV.tabs A:hover -{ - background-position: 100% -150px; -} - -DIV.tabs A:link, DIV.tabs A:visited, -DIV.tabs A:active, DIV.tabs A:hover -{ - color: #1A419D; -} - -DIV.tabs SPAN -{ - float : left; - display : block; - background : url("tab_l.gif") no-repeat left top; - padding : 5px 9px; - white-space : nowrap; -} - -DIV.tabs INPUT -{ - float : right; - display : inline; - font-size : 1em; -} - -DIV.tabs TD -{ - font-size : x-small; - font-weight : bold; - text-decoration : none; -} - - - -/* Commented Backslash Hack hides rule from IE5-Mac \*/ -DIV.tabs SPAN {float : none;} -/* End IE5-Mac hack */ - -DIV.tabs A:hover SPAN -{ - background-position: 0% -150px; -} - -DIV.tabs LI#current A -{ - background-position: 100% -150px; - border-width : 0px; -} - -DIV.tabs LI#current SPAN -{ - background-position: 0% -150px; - padding-bottom : 6px; -} - -DIV.nav -{ - background : none; - border : none; - border-bottom : 1px solid #84B0C7; -} diff --git a/components/net/uip/doc/html/tree.html b/components/net/uip/doc/html/tree.html deleted file mode 100644 index ba4787fc69..0000000000 --- a/components/net/uip/doc/html/tree.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - TreeView - - - - - -
-

uIP 1.0

-
-

o*The uIP TCP/IP stack

-

o+File List

- -

o+Data Structures

- -

o+Class Hierarchy

- -

o*Data Fields

-

o+Modules

- -

o+Examples

- -

\*Globals

-
-
- - diff --git a/components/net/uip/doc/mobisys2003.pdf b/components/net/uip/doc/mobisys2003.pdf deleted file mode 100644 index f5e7425d19..0000000000 Binary files a/components/net/uip/doc/mobisys2003.pdf and /dev/null differ diff --git a/components/net/uip/doc/pt-doc.txt b/components/net/uip/doc/pt-doc.txt deleted file mode 100644 index b26c651cfa..0000000000 --- a/components/net/uip/doc/pt-doc.txt +++ /dev/null @@ -1,173 +0,0 @@ -/** -\defgroup pt Protothreads - -Protothreads are a type of lightweight stackless threads designed for -severly memory constrained systems such as deeply embedded systems or -sensor network nodes. Protothreads provides linear code execution for -event-driven systems implemented in C. Protothreads can be used with -or without an RTOS. - -Protothreads are a extremely lightweight, stackless type of threads -that provides a blocking context on top of an event-driven system, -without the overhead of per-thread stacks. The purpose of protothreads -is to implement sequential flow of control without complex state -machines or full multi-threading. Protothreads provides conditional -blocking inside C functions. - -The advantage of protothreads over a purely event-driven approach is -that protothreads provides a sequential code structure that allows for -blocking functions. In purely event-driven systems, blocking must be -implemented by manually breaking the function into two pieces - one -for the piece of code before the blocking call and one for the code -after the blocking call. This makes it hard to use control structures -such as if() conditionals and while() loops. - -The advantage of protothreads over ordinary threads is that a -protothread do not require a separate stack. In memory constrained -systems, the overhead of allocating multiple stacks can consume large -amounts of the available memory. In contrast, each protothread only -requires between two and twelve bytes of state, depending on the -architecture. - -\note Because protothreads do not save the stack context across a -blocking call, local variables are not preserved when the -protothread blocks. This means that local variables should be used -with utmost care - if in doubt, do not use local variables inside a -protothread! - - -Main features: - - - No machine specific code - the protothreads library is pure C - - - Does not use error-prone functions such as longjmp() - - - Very small RAM overhead - only two bytes per protothread - - - Can be used with or without an OS - - - Provides blocking wait without full multi-threading or - stack-switching - -Examples applications: - - - Memory constrained systems - - - Event-driven protocol stacks - - - Deeply embedded systems - - - Sensor network nodes - -The protothreads API consists of four basic operations: -initialization: PT_INIT(), execution: PT_BEGIN(), conditional -blocking: PT_WAIT_UNTIL() and exit: PT_END(). On top of these, two -convenience functions are built: reversed condition blocking: -PT_WAIT_WHILE() and protothread blocking: PT_WAIT_THREAD(). - -\sa \ref pt "Protothreads API documentation" - -The protothreads library is released under a BSD-style license that -allows for both non-commercial and commercial usage. The only -requirement is that credit is given. - -\section authors Authors - -The protothreads library was written by Adam Dunkels -with support from Oliver Schmidt . - -\section pt-desc Protothreads - -Protothreads are a extremely lightweight, stackless threads that -provides a blocking context on top of an event-driven system, without -the overhead of per-thread stacks. The purpose of protothreads is to -implement sequential flow of control without using complex state -machines or full multi-threading. Protothreads provides conditional -blocking inside a C function. - -In memory constrained systems, such as deeply embedded systems, -traditional multi-threading may have a too large memory overhead. In -traditional multi-threading, each thread requires its own stack, that -typically is over-provisioned. The stacks may use large parts of the -available memory. - -The main advantage of protothreads over ordinary threads is that -protothreads are very lightweight: a protothread does not require its -own stack. Rather, all protothreads run on the same stack and context -switching is done by stack rewinding. This is advantageous in memory -constrained systems, where a stack for a thread might use a large part -of the available memory. A protothread only requires only two bytes of -memory per protothread. Moreover, protothreads are implemented in pure -C and do not require any machine-specific assembler code. - -A protothread runs within a single C function and cannot span over -other functions. A protothread may call normal C functions, but cannot -block inside a called function. Blocking inside nested function calls -is instead made by spawning a separate protothread for each -potentially blocking function. The advantage of this approach is that -blocking is explicit: the programmer knows exactly which functions -that block that which functions the never blocks. - -Protothreads are similar to asymmetric co-routines. The main -difference is that co-routines uses a separate stack for each -co-routine, whereas protothreads are stackless. The most similar -mechanism to protothreads are Python generators. These are also -stackless constructs, but have a different purpose. Protothreads -provides blocking contexts inside a C function, whereas Python -generators provide multiple exit points from a generator function. - -\section pt-autovars Local variables - -\note -Because protothreads do not save the stack context across a blocking -call, local variables are not preserved when the protothread -blocks. This means that local variables should be used with utmost -care - if in doubt, do not use local variables inside a protothread! - -\section pt-scheduling Scheduling - -A protothread is driven by repeated calls to the function in which the -protothread is running. Each time the function is called, the -protothread will run until it blocks or exits. Thus the scheduling of -protothreads is done by the application that uses protothreads. - -\section pt-impl Implementation - -Protothreads are implemented using \ref lc "local continuations". A -local continuation represents the current state of execution at a -particular place in the program, but does not provide any call history -or local variables. A local continuation can be set in a specific -function to capture the state of the function. After a local -continuation has been set can be resumed in order to restore the state -of the function at the point where the local continuation was set. - - -Local continuations can be implemented in a variety of ways: - - -# by using machine specific assembler code, - -# by using standard C constructs, or - -# by using compiler extensions. - -The first way works by saving and restoring the processor state, -except for stack pointers, and requires between 16 and 32 bytes of -memory per protothread. The exact amount of memory required depends on -the architecture. - -The standard C implementation requires only two bytes of state per -protothread and utilizes the C switch() statement in a non-obvious way -that is similar to Duff's device. This implementation does, however, -impose a slight restriction to the code that uses protothreads in that -the code cannot use switch() statements itself. - -Certain compilers has C extensions that can be used to implement -protothreads. GCC supports label pointers that can be used for this -purpose. With this implementation, protothreads require 4 bytes of RAM -per protothread. - -@{ - - -*/ - -/** @} */ - diff --git a/components/net/uip/doc/sicslogo.pdf b/components/net/uip/doc/sicslogo.pdf deleted file mode 100644 index 239a1bff68..0000000000 Binary files a/components/net/uip/doc/sicslogo.pdf and /dev/null differ diff --git a/components/net/uip/doc/uip-code-style.c b/components/net/uip/doc/uip-code-style.c deleted file mode 100644 index b62c5b1008..0000000000 --- a/components/net/uip/doc/uip-code-style.c +++ /dev/null @@ -1,118 +0,0 @@ -/* This is the official code style of uIP. */ - -/** - * \defgroup codestyle Coding style - * - * This is how a Doxygen module is documented - start with a \defgroup - * Doxygen keyword at the beginning of the file to define a module, - * and use the \addtogroup Doxygen keyword in all other files that - * belong to the same module. Typically, the \defgroup is placed in - * the .h file and \addtogroup in the .c file. - * - * @{ - */ - -/** - * \file - * A brief description of what this file is. - * \author - * Adam Dunkels - * - * Every file that is part of a documented module has to have - * a \file block, else it will not show up in the Doxygen - * "Modules" * section. - */ - -/* Single line comments look like this. */ - -/* - * Multi-line comments look like this. Comments should prefferably be - * full sentences, filled to look like real paragraphs. - */ - -#include "uip.h" - -/* - * Make sure that non-global variables are all maked with the static - * keyword. This keeps the size of the symbol table down. - */ -static int flag; - -/* - * All variables and functions that are visible outside of the file - * should have the module name prepended to them. This makes it easy - * to know where to look for function and variable definitions. - * - * Put dividers (a single-line comment consisting only of dashes) - * between functions. - */ -/*---------------------------------------------------------------------------*/ -/** - * \brief Use Doxygen documentation for functions. - * \param c Briefly describe all parameters. - * \return Briefly describe the return value. - * \retval 0 Functions that return a few specified values - * \retval 1 can use the \retval keyword instead of \return. - * - * Put a longer description of what the function does - * after the preamble of Doxygen keywords. - * - * This template should always be used to document - * functions. The text following the introduction is used - * as the function's documentation. - * - * Function prototypes have the return type on one line, - * the name and arguments on one line (with no space - * between the name and the first parenthesis), followed - * by a single curly bracket on its own line. - */ -void -code_style_example_function(void) -{ - /* - * Local variables should always be declared at the start of the - * function. - */ - int i; /* Use short variable names for loop - counters. */ - - /* - * There should be no space between keywords and the first - * parenthesis. There should be spaces around binary operators, no - * spaces between a unary operator and its operand. - * - * Curly brackets following for(), if(), do, and case() statements - * should follow the statement on the same line. - */ - for(i = 0; i < 10; ++i) { - /* - * Always use full blocks (curly brackets) after if(), for(), and - * while() statements, even though the statement is a single line - * of code. This makes the code easier to read and modifications - * are less error prone. - */ - if(i == c) { - return c; /* No parentesis around return values. */ - } else { /* The else keyword is placed inbetween - curly brackers, always on its own line. */ - c++; - } - } -} -/*---------------------------------------------------------------------------*/ -/* - * Static (non-global) functions do not need Doxygen comments. The - * name should not be prepended with the module name - doing so would - * create confusion. - */ -static void -an_example_function(void) -{ - -} -/*---------------------------------------------------------------------------*/ - -/* The following stuff ends the \defgroup block at the beginning of - the file: */ - -/** @} */ diff --git a/components/net/uip/doc/uip-code-style.txt b/components/net/uip/doc/uip-code-style.txt deleted file mode 100644 index db6a632273..0000000000 --- a/components/net/uip/doc/uip-code-style.txt +++ /dev/null @@ -1,3 +0,0 @@ -/** - \example uip-code-style.c - */ diff --git a/components/net/uip/doc/uip-doc.txt b/components/net/uip/doc/uip-doc.txt deleted file mode 100644 index 894b1bc13a..0000000000 --- a/components/net/uip/doc/uip-doc.txt +++ /dev/null @@ -1,1180 +0,0 @@ - - -/** -\mainpage The uIP TCP/IP stack -\author Adam Dunkels, http://www.sics.se/~adam/ - -The uIP TCP/IP stack is intended to make it possible to communicate -using the TCP/IP protocol suite even on small 8-bit -micro-controllers. Despite being small and simple, uIP do not require -their peers to have complex, full-size stacks, but can communicate -with peers running a similarly light-weight stack. The code size is on -the order of a few kilobytes and RAM usage can be configured to be as -low as a few hundred bytes. - -uIP can be found at the uIP web page: http://www.sics.se/~adam/uip/ - -\sa \ref apps "Application programs" -\sa \ref uipopt "Compile-time configuration options" -\sa \ref uipconffunc "Run-time configuration functions" -\sa \ref uipinit "Initialization functions" -\sa \ref uipdevfunc "Device driver interface" and - \ref uipdrivervars "variables used by device drivers" -\sa \ref uipappfunc "uIP functions called from application programs" -(see below) and the \ref psock "protosockets API" and their underlying -\ref pt "protothreads" - -\section uIPIntroduction Introduction - -With the success of the Internet, the TCP/IP protocol suite has become -a global standard for communication. TCP/IP is the underlying protocol -used for web page transfers, e-mail transmissions, file transfers, and -peer-to-peer networking over the Internet. For embedded systems, being -able to run native TCP/IP makes it possible to connect the system -directly to an intranet or even the global Internet. Embedded devices -with full TCP/IP support will be first-class network citizens, thus -being able to fully communicate with other hosts in the network. - -Traditional TCP/IP implementations have required far too much -resources both in terms of code size and memory usage to be useful in -small 8 or 16-bit systems. Code size of a few hundred kilobytes and -RAM requirements of several hundreds of kilobytes have made it -impossible to fit the full TCP/IP stack into systems with a few tens -of kilobytes of RAM and room for less than 100 kilobytes of -code. - -The uIP implementation is designed to have only the absolute minimal -set of features needed for a full TCP/IP stack. It can only handle a -single network interface and contains the IP, ICMP, UDP and TCP -protocols. uIP is written in the C programming language. - -Many other TCP/IP implementations for small systems assume that the -embedded device always will communicate with a full-scale TCP/IP -implementation running on a workstation-class machine. Under this -assumption, it is possible to remove certain TCP/IP mechanisms that -are very rarely used in such situations. Many of those mechanisms are -essential, however, if the embedded device is to communicate with -another equally limited device, e.g., when running distributed -peer-to-peer services and protocols. uIP is designed to be RFC -compliant in order to let the embedded devices to act as first-class -network citizens. The uIP TCP/IP implementation that is not tailored -for any specific application. - - -\section tcpip TCP/IP Communication - -The full TCP/IP suite consists of numerous protocols, ranging from low -level protocols such as ARP which translates IP addresses to MAC -addresses, to application level protocols such as SMTP that is used to -transfer e-mail. The uIP is mostly concerned with the TCP and IP -protocols and upper layer protocols will be referred to as "the -application". Lower layer protocols are often implemented in hardware -or firmware and will be referred to as "the network device" that are -controlled by the network device driver. - -TCP provides a reliable byte stream to the upper layer protocols. It -breaks the byte stream into appropriately sized segments and each -segment is sent in its own IP packet. The IP packets are sent out on -the network by the network device driver. If the destination is not on -the physically connected network, the IP packet is forwarded onto -another network by a router that is situated between the two -networks. If the maximum packet size of the other network is smaller -than the size of the IP packet, the packet is fragmented into smaller -packets by the router. If possible, the size of the TCP segments are -chosen so that fragmentation is minimized. The final recipient of the -packet will have to reassemble any fragmented IP packets before they -can be passed to higher layers. - -The formal requirements for the protocols in the TCP/IP stack is -specified in a number of RFC documents published by the Internet -Engineering Task Force, IETF. Each of the protocols in the stack is -defined in one more RFC documents and RFC1122 collects -all requirements and updates the previous RFCs. - -The RFC1122 requirements can be divided into two categories; those -that deal with the host to host communication and those that deal with -communication between the application and the networking stack. An -example of the first kind is "A TCP MUST be able to receive a TCP -option in any segment" and an example of the second kind is "There -MUST be a mechanism for reporting soft TCP error conditions to the -application." A TCP/IP implementation that violates requirements of -the first kind may not be able to communicate with other TCP/IP -implementations and may even lead to network failures. Violation of -the second kind of requirements will only affect the communication -within the system and will not affect host-to-host communication. - -In uIP, all RFC requirements that affect host-to-host communication -are implemented. However, in order to reduce code size, we have -removed certain mechanisms in the interface between the application -and the stack, such as the soft error reporting mechanism and -dynamically configurable type-of-service bits for TCP -connections. Since there are only very few applications that make use -of those features they can be removed without loss of generality. - -\section mainloop Main Control Loop - -The uIP stack can be run either as a task in a multitasking system, or -as the main program in a singletasking system. In both cases, the main -control loop does two things repeatedly: - - - Check if a packet has arrived from the network. - - Check if a periodic timeout has occurred. - -If a packet has arrived, the input handler function, uip_input(), -should be invoked by the main control loop. The input handler function -will never block, but will return at once. When it returns, the stack -or the application for which the incoming packet was intended may have -produced one or more reply packets which should be sent out. If so, -the network device driver should be called to send out these packets. - -Periodic timeouts are used to drive TCP mechanisms that depend on -timers, such as delayed acknowledgments, retransmissions and -round-trip time estimations. When the main control loop infers that -the periodic timer should fire, it should invoke the timer handler -function uip_periodic(). Because the TCP/IP stack may perform -retransmissions when dealing with a timer event, the network device -driver should called to send out the packets that may have been produced. - -\section arch Architecture Specific Functions - -uIP requires a few functions to be implemented specifically for the -architecture on which uIP is intended to run. These functions should -be hand-tuned for the particular architecture, but generic C -implementations are given as part of the uIP distribution. - -\subsection checksums Checksum Calculation - -The TCP and IP protocols implement a checksum that covers the data and -header portions of the TCP and IP packets. Since the calculation of -this checksum is made over all bytes in every packet being sent and -received it is important that the function that calculates the -checksum is efficient. Most often, this means that the checksum -calculation must be fine-tuned for the particular architecture on -which the uIP stack runs. - -While uIP includes a generic checksum function, it also leaves it open -for an architecture specific implementation of the two functions -uip_ipchksum() and uip_tcpchksum(). The checksum calculations in those -functions can be written in highly optimized assembler rather than -generic C code. - -\subsection longarith 32-bit Arithmetic - -The TCP protocol uses 32-bit sequence numbers, and a TCP -implementation will have to do a number of 32-bit additions as part of -the normal protocol processing. Since 32-bit arithmetic is not -natively available on many of the platforms for which uIP is intended, -uIP leaves the 32-bit additions to be implemented by the architecture -specific module and does not make use of any 32-bit arithmetic in the -main code base. - -While uIP implements a generic 32-bit addition, there is support for -having an architecture specific implementation of the uip_add32() -function. - - -\section memory Memory Management - -In the architectures for which uIP is intended, RAM is the most -scarce resource. With only a few kilobytes of RAM available for the -TCP/IP stack to use, mechanisms used in traditional TCP/IP cannot be -directly applied. - - -The uIP stack does not use explicit dynamic memory -allocation. Instead, it uses a single global buffer for holding -packets and has a fixed table for holding connection state. The global -packet buffer is large enough to contain one packet of maximum -size. When a packet arrives from the network, the device driver places -it in the global buffer and calls the TCP/IP stack. If the packet -contains data, the TCP/IP stack will notify the corresponding -application. Because the data in the buffer will be overwritten by the -next incoming packet, the application will either have to act -immediately on the data or copy the data into a secondary buffer for -later processing. The packet buffer will not be overwritten by new -packets before the application has processed the data. Packets that -arrive when the application is processing the data must be queued, -either by the network device or by the device driver. Most single-chip -Ethernet controllers have on-chip buffers that are large enough to -contain at least 4 maximum sized Ethernet frames. Devices that are -handled by the processor, such as RS-232 ports, can copy incoming -bytes to a separate buffer during application processing. If the -buffers are full, the incoming packet is dropped. This will cause -performance degradation, but only when multiple connections are -running in parallel. This is because uIP advertises a very small -receiver window, which means that only a single TCP segment will be in -the network per connection. - -In uIP, the same global packet buffer that is used for incoming -packets is also used for the TCP/IP headers of outgoing data. If the -application sends dynamic data, it may use the parts of the global -packet buffer that are not used for headers as a temporary storage -buffer. To send the data, the application passes a pointer to the data -as well as the length of the data to the stack. The TCP/IP headers are -written into the global buffer and once the headers have been -produced, the device driver sends the headers and the application data -out on the network. The data is not queued for -retransmissions. Instead, the application will have to reproduce the -data if a retransmission is necessary. - -The total amount of memory usage for uIP depends heavily on the -applications of the particular device in which the implementations are -to be run. The memory configuration determines both the amount of -traffic the system should be able to handle and the maximum amount of -simultaneous connections. A device that will be sending large e-mails -while at the same time running a web server with highly dynamic web -pages and multiple simultaneous clients, will require more RAM than a -simple Telnet server. It is possible to run the uIP implementation -with as little as 200 bytes of RAM, but such a configuration will -provide extremely low throughput and will only allow a small number of -simultaneous connections. - -\section api Application Program Interface (API) - - -The Application Program Interface (API) defines the way the -application program interacts with the TCP/IP stack. The most commonly -used API for TCP/IP is the BSD socket API which is used in most Unix -systems and has heavily influenced the Microsoft Windows WinSock -API. Because the socket API uses stop-and-wait semantics, it requires -support from an underlying multitasking operating system. Since the -overhead of task management, context switching and allocation of stack -space for the tasks might be too high in the intended uIP target -architectures, the BSD socket interface is not suitable for our -purposes. - -uIP provides two APIs to programmers: protosockets, a BSD socket-like -API without the overhead of full multi-threading, and a "raw" -event-based API that is nore low-level than protosockets but uses less -memory. - -\sa \ref psock -\sa \ref pt - - -\subsection rawapi The uIP raw API - -The "raw" uIP API uses an event driven interface where the application is -invoked in response to certain events. An application running on top -of uIP is implemented as a C function that is called by uIP in -response to certain events. uIP calls the application when data is -received, when data has been successfully delivered to the other end -of the connection, when a new connection has been set up, or when data -has to be retransmitted. The application is also periodically polled -for new data. The application program provides only one callback -function; it is up to the application to deal with mapping different -network services to different ports and connections. Because the -application is able to act on incoming data and connection requests as -soon as the TCP/IP stack receives the packet, low response times can -be achieved even in low-end systems. - -uIP is different from other TCP/IP stacks in that it requires help -from the application when doing retransmissions. Other TCP/IP stacks -buffer the transmitted data in memory until the data is known to be -successfully delivered to the remote end of the connection. If the -data needs to be retransmitted, the stack takes care of the -retransmission without notifying the application. With this approach, -the data has to be buffered in memory while waiting for an -acknowledgment even if the application might be able to quickly -regenerate the data if a retransmission has to be made. - -In order to reduce memory usage, uIP utilizes the fact that the -application may be able to regenerate sent data and lets the -application take part in retransmissions. uIP does not keep track of -packet contents after they have been sent by the device driver, and -uIP requires that the application takes an active part in performing -the retransmission. When uIP decides that a segment should be -retransmitted, it calls the application with a flag set indicating -that a retransmission is required. The application checks the -retransmission flag and produces the same data that was previously -sent. From the application's standpoint, performing a retransmission -is not different from how the data originally was sent. Therefore the -application can be written in such a way that the same code is used -both for sending data and retransmitting data. Also, it is important -to note that even though the actual retransmission operation is -carried out by the application, it is the responsibility of the stack -to know when the retransmission should be made. Thus the complexity of -the application does not necessarily increase because it takes an -active part in doing retransmissions. - -\subsubsection appevents Application Events - -The application must be implemented as a C function, UIP_APPCALL(), -that uIP calls whenever an event occurs. Each event has a corresponding -test function that is used to distinguish between different -events. The functions are implemented as C macros that will evaluate -to either zero or non-zero. Note that certain events can happen in -conjunction with each other (i.e., new data can arrive at the same -time as data is acknowledged). - -\subsubsection connstate The Connection Pointer - -When the application is called by uIP, the global variable uip_conn is -set to point to the uip_conn structure for the connection that -currently is handled, and is called the "current connection". The -fields in the uip_conn structure for the current connection can be -used, e.g., to distinguish between different services, or to check to -which IP address the connection is connected. One typical use would be -to inspect the uip_conn->lport (the local TCP port number) to decide -which service the connection should provide. For instance, an -application might decide to act as an HTTP server if the value of -uip_conn->lport is equal to 80 and act as a TELNET server if the value -is 23. - -\subsubsection recvdata Receiving Data - -If the uIP test function uip_newdata() is non-zero, the remote host of -the connection has sent new data. The uip_appdata pointer point to the -actual data. The size of the data is obtained through the uIP function -uip_datalen(). The data is not buffered by uIP, but will be -overwritten after the application function returns, and the -application will therefor have to either act directly on the incoming -data, or by itself copy the incoming data into a buffer for later -processing. - -\subsubsection senddata Sending Data - -When sending data, uIP adjusts the length of the data sent by the -application according to the available buffer space and the current -TCP window advertised by the receiver. The amount of buffer space is -dictated by the memory configuration. It is therefore possible that -all data sent from the application does not arrive at the receiver, -and the application may use the uip_mss() function to see how much -data that actually will be sent by the stack. - -The application sends data by using the uIP function uip_send(). The -uip_send() function takes two arguments; a pointer to the data to be -sent and the length of the data. If the application needs RAM space -for producing the actual data that should be sent, the packet buffer -(pointed to by the uip_appdata pointer) can be used for this purpose. - -The application can send only one chunk of data at a time on a -connection and it is not possible to call uip_send() more than once -per application invocation; only the data from the last call will be -sent. - -\subsubsection rexmitdata Retransmitting Data - -Retransmissions are driven by the periodic TCP timer. Every time the -periodic timer is invoked, the retransmission timer for each -connection is decremented. If the timer reaches zero, a retransmission -should be made. As uIP does not keep track of packet contents after they have -been sent by the device driver, uIP requires that the -application takes an active part in performing the -retransmission. When uIP decides that a segment should be -retransmitted, the application function is called with the -uip_rexmit() flag set, indicating that a retransmission is -required. - -The application must check the uip_rexmit() flag and produce the same -data that was previously sent. From the application's standpoint, -performing a retransmission is not different from how the data -originally was sent. Therefor, the application can be written in such -a way that the same code is used both for sending data and -retransmitting data. Also, it is important to note that even though -the actual retransmission operation is carried out by the application, -it is the responsibility of the stack to know when the retransmission -should be made. Thus the complexity of the application does not -necessarily increase because it takes an active part in doing -retransmissions. - -\subsubsection closing Closing Connections - -The application closes the current connection by calling the -uip_close() during an application call. This will cause the connection -to be cleanly closed. In order to indicate a fatal error, the -application might want to abort the connection and does so by calling -the uip_abort() function. - -If the connection has been closed by the remote end, the test function -uip_closed() is true. The application may then do any necessary -cleanups. - -\subsubsection errors Reporting Errors - -There are two fatal errors that can happen to a connection, either -that the connection was aborted by the remote host, or that the -connection retransmitted the last data too many times and has been -aborted. uIP reports this by calling the application function. The -application can use the two test functions uip_aborted() and -uip_timedout() to test for those error conditions. - -\subsubsection polling Polling - -When a connection is idle, uIP polls the application every time the -periodic timer fires. The application uses the test function -uip_poll() to check if it is being polled by uIP. - -The polling event has two purposes. The first is to let the -application periodically know that a connection is idle, which allows -the application to close connections that have been idle for too -long. The other purpose is to let the application send new data that -has been produced. The application can only send data when invoked by -uIP, and therefore the poll event is the only way to send data on an -otherwise idle connection. - -\subsubsection listen Listening Ports - -uIP maintains a list of listening TCP ports. A new port is opened for -listening with the uip_listen() function. When a connection request -arrives on a listening port, uIP creates a new connection and calls -the application function. The test function uip_connected() is true if -the application was invoked because a new connection was created. - -The application can check the lport field in the uip_conn structure to -check to which port the new connection was connected. - -\subsubsection connect Opening Connections - -New connections can be opened from within -uIP by the function uip_connect(). This function -allocates a new connection and sets a flag in the connection state -which will open a TCP connection to the specified IP address and port -the next time the connection is polled by uIP. The uip_connect() -function returns -a pointer to the uip_conn structure for the new -connection. If there are no free connection slots, the function -returns NULL. - -The function uip_ipaddr() may be used to pack an IP address into the -two element 16-bit array used by uIP to represent IP addresses. - -Two examples of usage are shown below. The first example shows how to -open a connection to TCP port 8080 of the remote end of the current -connection. If there are not enough TCP connection slots to allow a -new connection to be opened, the uip_connect() function returns NULL -and the current connection is aborted by uip_abort(). - -\code -void connect_example1_app(void) { - if(uip_connect(uip_conn->ripaddr, HTONS(8080)) == NULL) { - uip_abort(); - } -} -\endcode - -The second example shows how to open a new connection to a specific IP -address. No error checks are made in this example. - -\code -void connect_example2(void) { - u16_t ipaddr[2]; - - uip_ipaddr(ipaddr, 192,168,0,1); - uip_connect(ipaddr, HTONS(8080)); -} -\endcode - -\section examples Examples - -This section presents a number of very simple uIP applications. The -uIP code distribution contains several more complex applications. - -\subsection example1 A Very Simple Application - -This first example shows a very simple application. The application -listens for incoming connections on port 1234. When a connection has -been established, the application replies to all data sent to it by -saying "ok" - -The implementation of this application is shown below. The application -is initialized with the function called example1_init() and the uIP -callback function is called example1_app(). For this application, the -configuration variable UIP_APPCALL should be defined to be -example1_app(). - -\code -void example1_init(void) { - uip_listen(HTONS(1234)); -} - -void example1_app(void) { - if(uip_newdata() || uip_rexmit()) { - uip_send("ok\n", 3); - } -} -\endcode - -The initialization function calls the uIP function uip_listen() to -register a listening port. The actual application function -example1_app() uses the test functions uip_newdata() and uip_rexmit() -to determine why it was called. If the application was called because -the remote end has sent it data, it responds with an "ok". If the -application function was called because data was lost in the network -and has to be retransmitted, it also sends an "ok". Note that this -example actually shows a complete uIP application. It is not required -for an application to deal with all types of events such as -uip_connected() or uip_timedout(). - -\subsection example2 A More Advanced Application - -This second example is slightly more advanced than the previous one, -and shows how the application state field in the uip_conn structure is -used. - -This application is similar to the first application in that it -listens to a port for incoming connections and responds to data sent -to it with a single "ok". The big difference is that this application -prints out a welcoming "Welcome!" message when the connection has been -established. - -This seemingly small change of operation makes a big difference in how -the application is implemented. The reason for the increase in -complexity is that if data should be lost in the network, the -application must know what data to retransmit. If the "Welcome!" -message was lost, the application must retransmit the welcome and if -one of the "ok" messages is lost, the application must send a new -"ok". - -The application knows that as long as the "Welcome!" message has not -been acknowledged by the remote host, it might have been dropped in -the network. But once the remote host has sent an acknowledgment -back, the application can be sure that the welcome has been received -and knows that any lost data must be an "ok" message. Thus the -application can be in either of two states: either in the WELCOME-SENT -state where the "Welcome!" has been sent but not acknowledged, or in -the WELCOME-ACKED state where the "Welcome!" has been acknowledged. - -When a remote host connects to the application, the application sends -the "Welcome!" message and sets it's state to WELCOME-SENT. When the -welcome message is acknowledged, the application moves to the -WELCOME-ACKED state. If the application receives any new data from the -remote host, it responds by sending an "ok" back. - -If the application is requested to retransmit the last message, it -looks at in which state the application is. If the application is in -the WELCOME-SENT state, it sends a "Welcome!" message since it -knows that the previous welcome message hasn't been acknowledged. If -the application is in the WELCOME-ACKED state, it knows that the last -message was an "ok" message and sends such a message. - -The implementation of this application is seen below. This -configuration settings for the application is follows after its -implementation. - -\code -struct example2_state { - enum {WELCOME_SENT, WELCOME_ACKED} state; -}; - -void example2_init(void) { - uip_listen(HTONS(2345)); -} - -void example2_app(void) { - struct example2_state *s; - - s = (struct example2_state *)uip_conn->appstate; - - if(uip_connected()) { - s->state = WELCOME_SENT; - uip_send("Welcome!\n", 9); - return; - } - - if(uip_acked() && s->state == WELCOME_SENT) { - s->state = WELCOME_ACKED; - } - - if(uip_newdata()) { - uip_send("ok\n", 3); - } - - if(uip_rexmit()) { - switch(s->state) { - case WELCOME_SENT: - uip_send("Welcome!\n", 9); - break; - case WELCOME_ACKED: - uip_send("ok\n", 3); - break; - } - } -} -\endcode - -The configuration for the application: - -\code -#define UIP_APPCALL example2_app -#define UIP_APPSTATE_SIZE sizeof(struct example2_state) -\endcode - -\subsection example3 Differentiating Between Applications - -If the system should run multiple applications, one technique to -differentiate between them is to use the TCP port number of either the -remote end or the local end of the connection. The example below shows -how the two examples above can be combined into one application. - -\code -void example3_init(void) { - example1_init(); - example2_init(); -} - -void example3_app(void) { - switch(uip_conn->lport) { - case HTONS(1234): - example1_app(); - break; - case HTONS(2345): - example2_app(); - break; - } -} -\endcode - -\subsection example4 Utilizing TCP Flow Control - -This example shows a simple application that connects to a host, sends -an HTTP request for a file and downloads it to a slow device such a -disk drive. This shows how to use the flow control functions of uIP. - -\code -void example4_init(void) { - u16_t ipaddr[2]; - uip_ipaddr(ipaddr, 192,168,0,1); - uip_connect(ipaddr, HTONS(80)); -} - -void example4_app(void) { - if(uip_connected() || uip_rexmit()) { - uip_send("GET /file HTTP/1.0\r\nServer:192.186.0.1\r\n\r\n", - 48); - return; - } - - if(uip_newdata()) { - device_enqueue(uip_appdata, uip_datalen()); - if(device_queue_full()) { - uip_stop(); - } - } - - if(uip_poll() && uip_stopped()) { - if(!device_queue_full()) { - uip_restart(); - } - } -} -\endcode - -When the connection has been established, an HTTP request is sent to -the server. Since this is the only data that is sent, the application -knows that if it needs to retransmit any data, it is that request that -should be retransmitted. It is therefore possible to combine these two -events as is done in the example. - -When the application receives new data from the remote host, it sends -this data to the device by using the function device_enqueue(). It is -important to note that this example assumes that this function copies -the data into its own buffers. The data in the uip_appdata buffer will -be overwritten by the next incoming packet. - -If the device's queue is full, the application stops the data from the -remote host by calling the uIP function uip_stop(). The application -can then be sure that it will not receive any new data until -uip_restart() is called. The application polling event is used to -check if the device's queue is no longer full and if so, the data flow -is restarted with uip_restart(). - -\subsection example5 A Simple Web Server - -This example shows a very simple file server application that listens -to two ports and uses the port number to determine which file to -send. If the files are properly formatted, this simple application can -be used as a web server with static pages. The implementation follows. - -\code -struct example5_state { - char *dataptr; - unsigned int dataleft; -}; - -void example5_init(void) { - uip_listen(HTONS(80)); - uip_listen(HTONS(81)); -} - -void example5_app(void) { - struct example5_state *s; - s = (struct example5_state)uip_conn->appstate; - - if(uip_connected()) { - switch(uip_conn->lport) { - case HTONS(80): - s->dataptr = data_port_80; - s->dataleft = datalen_port_80; - break; - case HTONS(81): - s->dataptr = data_port_81; - s->dataleft = datalen_port_81; - break; - } - uip_send(s->dataptr, s->dataleft); - return; - } - - if(uip_acked()) { - if(s->dataleft < uip_mss()) { - uip_close(); - return; - } - s->dataptr += uip_conn->len; - s->dataleft -= uip_conn->len; - uip_send(s->dataptr, s->dataleft); - } -} -\endcode - -The application state consists of a pointer to the data that should be -sent and the size of the data that is left to send. When a remote host -connects to the application, the local port number is used to -determine which file to send. The first chunk of data is sent using -uip_send(). uIP makes sure that no more than MSS bytes of data is -actually sent, even though s->dataleft may be larger than the MSS. - -The application is driven by incoming acknowledgments. When data has -been acknowledged, new data can be sent. If there is no more data to -send, the connection is closed using uip_close(). - -\subsection example6 Structured Application Program Design - -When writing larger programs using uIP it is useful to be able to -utilize the uIP API in a structured way. The following example -provides a structured design that has showed itself to be useful for -writing larger protocol implementations than the previous examples -showed here. The program is divided into an uIP event handler function -that calls seven application handler functions that process new data, -act on acknowledged data, send new data, deal with connection -establishment or closure events and handle errors. The functions are -called newdata(), acked(), senddata(), connected(), closed(), -aborted(), and timedout(), and needs to be written specifically for -the protocol that is being implemented. - -The uIP event handler function is shown below. - -\code -void example6_app(void) { - if(uip_aborted()) { - aborted(); - } - if(uip_timedout()) { - timedout(); - } - if(uip_closed()) { - closed(); - } - if(uip_connected()) { - connected(); - } - if(uip_acked()) { - acked(); - } - if(uip_newdata()) { - newdata(); - } - if(uip_rexmit() || - uip_newdata() || - uip_acked() || - uip_connected() || - uip_poll()) { - senddata(); - } -} -\endcode - -The function starts with dealing with any error conditions that might -have happened by checking if uip_aborted() or uip_timedout() are -true. If so, the appropriate error function is called. Also, if the -connection has been closed, the closed() function is called to the it -deal with the event. - -Next, the function checks if the connection has just been established -by checking if uip_connected() is true. The connected() function is -called and is supposed to do whatever needs to be done when the -connection is established, such as intializing the application state -for the connection. Since it may be the case that data should be sent -out, the senddata() function is called to deal with the outgoing data. - -The following very simple application serves as an example of how the -application handler functions might look. This application simply -waits for any data to arrive on the connection, and responds to the -data by sending out the message "Hello world!". To illustrate how to -develop an application state machine, this message is sent in two -parts, first the "Hello" part and then the "world!" part. - -\code -#define STATE_WAITING 0 -#define STATE_HELLO 1 -#define STATE_WORLD 2 - -struct example6_state { - u8_t state; - char *textptr; - int textlen; -}; - -static void aborted(void) {} -static void timedout(void) {} -static void closed(void) {} - -static void connected(void) { - struct example6_state *s = (struct example6_state *)uip_conn->appstate; - - s->state = STATE_WAITING; - s->textlen = 0; -} - -static void newdata(void) { - struct example6_state *s = (struct example6_state *)uip_conn->appstate; - - if(s->state == STATE_WAITING) { - s->state = STATE_HELLO; - s->textptr = "Hello "; - s->textlen = 6; - } -} - -static void acked(void) { - struct example6_state *s = (struct example6_state *)uip_conn->appstate; - - s->textlen -= uip_conn->len; - s->textptr += uip_conn->len; - if(s->textlen == 0) { - switch(s->state) { - case STATE_HELLO: - s->state = STATE_WORLD; - s->textptr = "world!\n"; - s->textlen = 7; - break; - case STATE_WORLD: - uip_close(); - break; - } - } -} - -static void senddata(void) { - struct example6_state *s = (struct example6_state *)uip_conn->appstate; - - if(s->textlen > 0) { - uip_send(s->textptr, s->textlen); - } -} -\endcode - -The application state consists of a "state" variable, a "textptr" -pointer to a text message and the "textlen" length of the text -message. The "state" variable can be either "STATE_WAITING", meaning -that the application is waiting for data to arrive from the network, -"STATE_HELLO", in which the application is sending the "Hello" part of -the message, or "STATE_WORLD", in which the application is sending the -"world!" message. - -The application does not handle errors or connection closing events, -and therefore the aborted(), timedout() and closed() functions are -implemented as empty functions. - -The connected() function will be called when a connection has been -established, and in this case sets the "state" variable to be -"STATE_WAITING" and the "textlen" variable to be zero, indicating that -there is no message to be sent out. - -When new data arrives from the network, the newdata() function will be -called by the event handler function. The newdata() function will -check if the connection is in the "STATE_WAITING" state, and if so -switches to the "STATE_HELLO" state and registers a 6 byte long "Hello -" message with the connection. This message will later be sent out by -the senddata() function. - -The acked() function is called whenever data that previously was sent -has been acknowleged by the receiving host. This acked() function -first reduces the amount of data that is left to send, by subtracting -the length of the previously sent data (obtained from "uip_conn->len") -from the "textlen" variable, and also adjusts the "textptr" pointer -accordingly. It then checks if the "textlen" variable now is zero, -which indicates that all data now has been successfully received, and -if so changes application state. If the application was in the -"STATE_HELLO" state, it switches state to "STATE_WORLD" and sets up a -7 byte "world!\n" message to be sent. If the application was in the -"STATE_WORLD" state, it closes the connection. - -Finally, the senddata() function takes care of actually sending the -data that is to be sent. It is called by the event handler function -when new data has been received, when data has been acknowledged, when -a new connection has been established, when the connection is polled -because of inactivity, or when a retransmission should be made. The -purpose of the senddata() function is to optionally format the data -that is to be sent, and to call the uip_send() function to actually -send out the data. In this particular example, the function simply -calls uip_send() with the appropriate arguments if data is to be sent, -after checking if data should be sent out or not as indicated by the -"textlen" variable. - -It is important to note that the senddata() function never should -affect the application state; this should only be done in the acked() -and newdata() functions. - -\section protoimpl Protocol Implementations - -The protocols in the TCP/IP protocol suite are designed in a layered -fashion where each protocol performs a specific function and the -interactions between the protocol layers are strictly defined. While -the layered approach is a good way to design protocols, it is not -always the best way to implement them. In uIP, the protocol -implementations are tightly coupled in order to save code space. - -This section gives detailed information on the specific protocol -implementations in uIP. - -\subsection ip IP --- Internet Protocol - -When incoming packets are processed by uIP, the IP layer is the first -protocol that examines the packet. The IP layer does a few simple -checks such as if the destination IP address of the incoming packet -matches any of the local IP address and verifies the IP header -checksum. Since there are no IP options that are strictly required and -because they are very uncommon, any IP options in received packets are -dropped. - -\subsubsection ipreass IP Fragment Reassembly - -IP fragment reassembly is implemented using a separate buffer that -holds the packet to be reassembled. An incoming fragment is copied -into the right place in the buffer and a bit map is used to keep track -of which fragments have been received. Because the first byte of an IP -fragment is aligned on an 8-byte boundary, the bit map requires a -small amount of memory. When all fragments have been reassembled, the -resulting IP packet is passed to the transport layer. If all fragments -have not been received within a specified time frame, the packet is -dropped. - -The current implementation only has a single buffer for holding -packets to be reassembled, and therefore does not support simultaneous -reassembly of more than one packet. Since fragmented packets are -uncommon, this ought to be a reasonable decision. Extending the -implementation to support multiple buffers would be straightforward, -however. - -\subsubsection ipbroadcast Broadcasts and Multicasts - -IP has the ability to broadcast and multicast packets on the local -network. Such packets are addressed to special broadcast and multicast -addresses. Broadcast is used heavily in many UDP based protocols such -as the Microsoft Windows file-sharing SMB protocol. Multicast is -primarily used in protocols used for multimedia distribution such as -RTP. TCP is a point-to-point protocol and does not use broadcast or -multicast packets. uIP current supports broadcast packets as well as -sending multicast packets. Joining multicast groups (IGMP) and -receiving non-local multicast packets is not currently supported. - -\subsection icmp ICMP --- Internet Control Message Protocol - -The ICMP protocol is used for reporting soft error conditions and for -querying host parameters. Its main use is, however, the echo mechanism -which is used by the "ping" program. - -The ICMP implementation in uIP is very simple as itis restricted to -only implement ICMP echo messages. Replies to echo messages are -constructed by simply swapping the source and destination IP addresses -of incoming echo requests and rewriting the ICMP header with the -Echo-Reply message type. The ICMP checksum is adjusted using standard -techniques (see RFC1624). - -Since only the ICMP echo message is implemented, there is no support -for Path MTU discovery or ICMP redirect messages. Neither of these is -strictly required for interoperability; they are performance -enhancement mechanisms. - -\subsection tcp TCP --- Transmission Control Protocol - -The TCP implementation in uIP is driven by incoming packets and timer -events. Incoming packets are parsed by TCP and if the packet contains -data that is to be delivered to the application, the application is -invoked by the means of the application function call. If the incoming -packet acknowledges previously sent data, the connection state is -updated and the application is informed, allowing it to send out new -data. - -\subsubsection listeb Listening Connections - -TCP allows a connection to listen for incoming connection requests. In -uIP, a listening connection is identified by the 16-bit port number -and incoming connection requests are checked against the list of -listening connections. This list of listening connections is dynamic -and can be altered by the applications in the system. - -\subsubsection slidingwindow Sliding Window - -Most TCP implementations use a sliding window mechanism for sending -data. Multiple data segments are sent in succession without waiting -for an acknowledgment for each segment. - -The sliding window algorithm uses a lot of 32-bit operations and -because 32-bit arithmetic is fairly expensive on most 8-bit CPUs, uIP -does not implement it. Also, uIP does not buffer sent packets and a -sliding window implementation that does not buffer sent packets will have -to be supported by a complex application layer. Instead, uIP allows -only a single TCP segment per connection to be unacknowledged at any -given time. - -It is important to note that even though most TCP implementations use -the sliding window algorithm, it is not required by the TCP -specifications. Removing the sliding window mechanism does not affect -interoperability in any way. - -\subsubsection rttest Round-Trip Time Estimation - -TCP continuously estimates the current Round-Trip Time (RTT) of every -active connection in order to find a suitable value for the -retransmission time-out. - -The RTT estimation in uIP is implemented using TCP's periodic -timer. Each time the periodic timer fires, it increments a counter for -each connection that has unacknowledged data in the network. When an -acknowledgment is received, the current value of the counter is used -as a sample of the RTT. The sample is used together with Van -Jacobson's standard TCP RTT estimation function to calculate an -estimate of the RTT. Karn's algorithm is used to ensure that -retransmissions do not skew the estimates. - -\subsubsection rexmit Retransmissions - -Retransmissions are driven by the periodic TCP timer. Every time the -periodic timer is invoked, the retransmission timer for each -connection is decremented. If the timer reaches zero, a retransmission -should be made. - -As uIP does not keep track of packet contents after they have -been sent by the device driver, uIP requires that the -application takes an active part in performing the -retransmission. When uIP decides that a segment should be -retransmitted, it calls the application with a flag set indicating -that a retransmission is required. The application checks the -retransmission flag and produces the same data that was previously -sent. From the application's standpoint, performing a retransmission -is not different from how the data originally was sent. Therefore the -application can be written in such a way that the same code is used -both for sending data and retransmitting data. Also, it is important -to note that even though the actual retransmission operation is -carried out by the application, it is the responsibility of the stack -to know when the retransmission should be made. Thus the complexity of -the application does not necessarily increase because it takes an -active part in doing retransmissions. - -\subsubsection flowcontrol Flow Control - -The purpose of TCP's flow control mechanisms is to allow communication -between hosts with wildly varying memory dimensions. In each TCP -segment, the sender of the segment indicates its available buffer -space. A TCP sender must not send more data than the buffer space -indicated by the receiver. - -In uIP, the application cannot send more data than the receiving host -can buffer. And application cannot send more data than the amount of -bytes it is allowed to send by the receiving host. If the remote host -cannot accept any data at all, the stack initiates the zero window -probing mechanism. - -\subsubsection congestioncontrol Congestion Control - -The congestion control mechanisms limit the number of simultaneous TCP -segments in the network. The algorithms used for congestion control -are designed to be simple to implement and require only a few lines of -code. - -Since uIP only handles one in-flight TCP segment per connection, -the amount of simultaneous segments cannot be further limited, thus -the congestion control mechanisms are not needed. - -\subsubsection urgdata Urgent Data - -TCP's urgent data mechanism provides an application-to-application -notification mechanism, which can be used by an application to mark -parts of the data stream as being more urgent than the normal -stream. It is up to the receiving application to interpret the meaning -of the urgent data. - -In many TCP implementations, including the BSD implementation, the -urgent data feature increases the complexity of the implementation -because it requires an asynchronous notification mechanism in an -otherwise synchronous API. As uIP already use an asynchronous event -based API, the implementation of the urgent data feature does not lead -to increased complexity. - -\section performance Performance - -In TCP/IP implementations for high-end systems, processing time is -dominated by the checksum calculation loop, the operation of copying -packet data and context switching. Operating systems for high-end -systems often have multiple protection domains for protecting kernel -data from user processes and user processes from each other. Because -the TCP/IP stack is run in the kernel, data has to be copied between -the kernel space and the address space of the user processes and a -context switch has to be performed once the data has been -copied. Performance can be enhanced by combining the copy operation -with the checksum calculation. Because high-end systems usually have -numerous active connections, packet demultiplexing is also an -expensive operation. - -A small embedded device does not have the necessary processing power -to have multiple protection domains and the power to run a -multitasking operating system. Therefore there is no need to copy -data between the TCP/IP stack and the application program. With an -event based API there is no context switch between the TCP/IP stack -and the applications. - -In such limited systems, the TCP/IP processing overhead is dominated -by the copying of packet data from the network device to host memory, -and checksum calculation. Apart from the checksum calculation and -copying, the TCP processing done for an incoming packet involves only -updating a few counters and flags before handing the data over to the -application. Thus an estimate of the CPU overhead of our TCP/IP -implementations can be obtained by calculating the amount of CPU -cycles needed for the checksum calculation and copying of a maximum -sized packet. - -\subsection delack The Impact of Delayed Acknowledgments - -Most TCP receivers implement the delayed acknowledgment algorithm for -reducing the number of pure acknowledgment packets sent. A TCP -receiver using this algorithm will only send acknowledgments for every -other received segment. If no segment is received within a specific -time-frame, an acknowledgment is sent. The time-frame can be as high -as 500 ms but typically is 200 ms. - -A TCP sender such as uIP that only handles a single outstanding TCP -segment will interact poorly with the delayed acknowledgment -algorithm. Because the receiver only receives a single segment at a -time, it will wait as much as 500 ms before an acknowledgment is -sent. This means that the maximum possible throughput is severely -limited by the 500 ms idle time. - -Thus the maximum throughput equation when sending data from uIP will -be $p = s / (t + t_d)$ where $s$ is the segment size and $t_d$ is the -delayed acknowledgment timeout, which typically is between 200 and -500 ms. With a segment size of 1000 bytes, a round-trip time of 40 ms -and a delayed acknowledgment timeout of 200 ms, the maximum -throughput will be 4166 bytes per second. With the delayed acknowledgment -algorithm disabled at the receiver, the maximum throughput would be -25000 bytes per second. - -It should be noted, however, that since small systems running uIP are -not very likely to have large amounts of data to send, the delayed -acknowledgmen t throughput degradation of uIP need not be very -severe. Small amounts of data sent by such a system will not span more -than a single TCP segment, and would therefore not be affected by the -throughput degradation anyway. - -The maximum throughput when uIP acts as a receiver is not affected by -the delayed acknowledgment throughput degradation. - - - -*/ - - -/** @} */ - diff --git a/components/net/uip/doc/uip-refman.pdf b/components/net/uip/doc/uip-refman.pdf deleted file mode 100644 index 8dc8005986..0000000000 --- a/components/net/uip/doc/uip-refman.pdf +++ /dev/null @@ -1,39280 +0,0 @@ -%PDF-1.4 -5 0 obj -<< /S /GoTo /D (chapter.1) >> -endobj -8 0 obj -(The uIP TCP/IP stack ) -endobj -9 0 obj -<< /S /GoTo /D (section.1.1) >> -endobj -12 0 obj -(Introduction) -endobj -13 0 obj -<< /S /GoTo /D (section.1.2) >> -endobj -16 0 obj -(TCP/IP Communication) -endobj -17 0 obj -<< /S /GoTo /D (section.1.3) >> -endobj -20 0 obj -(Main Control Loop) -endobj -21 0 obj -<< /S /GoTo /D (section.1.4) >> -endobj -24 0 obj -(Architecture Specific Functions) -endobj -25 0 obj -<< /S /GoTo /D (section.1.5) >> -endobj -28 0 obj -(Memory Management) -endobj -29 0 obj -<< /S /GoTo /D (section.1.6) >> -endobj -32 0 obj -(Application Program Interface \(API\)) -endobj -33 0 obj -<< /S /GoTo /D (section.1.7) >> -endobj -36 0 obj -(Examples) -endobj -37 0 obj -<< /S /GoTo /D (section.1.8) >> -endobj -40 0 obj -(Protocol Implementations) -endobj -41 0 obj -<< /S /GoTo /D (section.1.9) >> -endobj -44 0 obj -(Performance) -endobj -45 0 obj -<< /S /GoTo /D (chapter.2) >> -endobj -48 0 obj -(uIP 1.0 Module Index) -endobj -49 0 obj -<< /S /GoTo /D (section.2.1) >> -endobj -52 0 obj -(uIP 1.0 Modules) -endobj -53 0 obj -<< /S /GoTo /D (chapter.3) >> -endobj -56 0 obj -(uIP 1.0 Hierarchical Index) -endobj -57 0 obj -<< /S /GoTo /D (section.3.1) >> -endobj -60 0 obj -(uIP 1.0 Class Hierarchy) -endobj -61 0 obj -<< /S /GoTo /D (chapter.4) >> -endobj -64 0 obj -(uIP 1.0 Data Structure Index) -endobj -65 0 obj -<< /S /GoTo /D (section.4.1) >> -endobj -68 0 obj -(uIP 1.0 Data Structures) -endobj -69 0 obj -<< /S /GoTo /D (chapter.5) >> -endobj -72 0 obj -(uIP 1.0 File Index) -endobj -73 0 obj -<< /S /GoTo /D (section.5.1) >> -endobj -76 0 obj -(uIP 1.0 File List) -endobj -77 0 obj -<< /S /GoTo /D (chapter.6) >> -endobj -80 0 obj -(uIP 1.0 Module Documentation) -endobj -81 0 obj -<< /S /GoTo /D (section.6.1) >> -endobj -84 0 obj -(Protothreads) -endobj -85 0 obj -<< /S /GoTo /D (section.6.2) >> -endobj -88 0 obj -(Applications) -endobj -89 0 obj -<< /S /GoTo /D (section.6.3) >> -endobj -92 0 obj -(uIP configuration functions) -endobj -93 0 obj -<< /S /GoTo /D (section.6.4) >> -endobj -96 0 obj -(uIP initialization functions) -endobj -97 0 obj -<< /S /GoTo /D (section.6.5) >> -endobj -100 0 obj -(uIP device driver functions) -endobj -101 0 obj -<< /S /GoTo /D (section.6.6) >> -endobj -104 0 obj -(uIP application functions) -endobj -105 0 obj -<< /S /GoTo /D (section.6.7) >> -endobj -108 0 obj -(uIP conversion functions) -endobj -109 0 obj -<< /S /GoTo /D (section.6.8) >> -endobj -112 0 obj -(Variables used in uIP device drivers) -endobj -113 0 obj -<< /S /GoTo /D (section.6.9) >> -endobj -116 0 obj -(The uIP TCP/IP stack) -endobj -117 0 obj -<< /S /GoTo /D (section.6.10) >> -endobj -120 0 obj -(Architecture specific uIP functions) -endobj -121 0 obj -<< /S /GoTo /D (section.6.11) >> -endobj -124 0 obj -(uIP Address Resolution Protocol) -endobj -125 0 obj -<< /S /GoTo /D (section.6.12) >> -endobj -128 0 obj -(Configuration options for uIP) -endobj -129 0 obj -<< /S /GoTo /D (section.6.13) >> -endobj -132 0 obj -(uIP TCP throughput booster hack) -endobj -133 0 obj -<< /S /GoTo /D (section.6.14) >> -endobj -136 0 obj -(Local continuations) -endobj -137 0 obj -<< /S /GoTo /D (section.6.15) >> -endobj -140 0 obj -(Timer library) -endobj -141 0 obj -<< /S /GoTo /D (section.6.16) >> -endobj -144 0 obj -(Clock interface) -endobj -145 0 obj -<< /S /GoTo /D (section.6.17) >> -endobj -148 0 obj -(Protosockets library) -endobj -149 0 obj -<< /S /GoTo /D (section.6.18) >> -endobj -152 0 obj -(Memory block management functions) -endobj -153 0 obj -<< /S /GoTo /D (section.6.19) >> -endobj -156 0 obj -(DNS resolver) -endobj -157 0 obj -<< /S /GoTo /D (section.6.20) >> -endobj -160 0 obj -(SMTP E-mail sender) -endobj -161 0 obj -<< /S /GoTo /D (section.6.21) >> -endobj -164 0 obj -(Telnet server) -endobj -165 0 obj -<< /S /GoTo /D (section.6.22) >> -endobj -168 0 obj -(Hello, world) -endobj -169 0 obj -<< /S /GoTo /D (section.6.23) >> -endobj -172 0 obj -(Web client) -endobj -173 0 obj -<< /S /GoTo /D (section.6.24) >> -endobj -176 0 obj -(Web server) -endobj -177 0 obj -<< /S /GoTo /D (chapter.7) >> -endobj -180 0 obj -(uIP 1.0 Data Structure Documentation) -endobj -181 0 obj -<< /S /GoTo /D (section.7.1) >> -endobj -184 0 obj -(dhcpc\137state Struct Reference) -endobj -185 0 obj -<< /S /GoTo /D (section.7.2) >> -endobj -188 0 obj -(hello\137world\137state Struct Reference) -endobj -189 0 obj -<< /S /GoTo /D (section.7.3) >> -endobj -192 0 obj -(httpd\137cgi\137call Struct Reference) -endobj -193 0 obj -<< /S /GoTo /D (section.7.4) >> -endobj -196 0 obj -(httpd\137state Struct Reference) -endobj -197 0 obj -<< /S /GoTo /D (section.7.5) >> -endobj -200 0 obj -(memb\137blocks Struct Reference) -endobj -201 0 obj -<< /S /GoTo /D (section.7.6) >> -endobj -204 0 obj -(psock Struct Reference) -endobj -205 0 obj -<< /S /GoTo /D (section.7.7) >> -endobj -208 0 obj -(psock\137buf Struct Reference) -endobj -209 0 obj -<< /S /GoTo /D (section.7.8) >> -endobj -212 0 obj -(pt Struct Reference) -endobj -213 0 obj -<< /S /GoTo /D (section.7.9) >> -endobj -216 0 obj -(smtp\137state Struct Reference) -endobj -217 0 obj -<< /S /GoTo /D (section.7.10) >> -endobj -220 0 obj -(telnetd\137state Struct Reference) -endobj -221 0 obj -<< /S /GoTo /D (section.7.11) >> -endobj -224 0 obj -(timer Struct Reference) -endobj -225 0 obj -<< /S /GoTo /D (section.7.12) >> -endobj -228 0 obj -(uip\137conn Struct Reference) -endobj -229 0 obj -<< /S /GoTo /D (section.7.13) >> -endobj -232 0 obj -(uip\137eth\137addr Struct Reference) -endobj -233 0 obj -<< /S /GoTo /D (section.7.14) >> -endobj -236 0 obj -(uip\137eth\137hdr Struct Reference) -endobj -237 0 obj -<< /S /GoTo /D (section.7.15) >> -endobj -240 0 obj -(uip\137icmpip\137hdr Struct Reference) -endobj -241 0 obj -<< /S /GoTo /D (section.7.16) >> -endobj -244 0 obj -(uip\137neighbor\137addr Struct Reference) -endobj -245 0 obj -<< /S /GoTo /D (section.7.17) >> -endobj -248 0 obj -(uip\137stats Struct Reference) -endobj -249 0 obj -<< /S /GoTo /D (section.7.18) >> -endobj -252 0 obj -(uip\137tcpip\137hdr Struct Reference) -endobj -253 0 obj -<< /S /GoTo /D (section.7.19) >> -endobj -256 0 obj -(uip\137udp\137conn Struct Reference) -endobj -257 0 obj -<< /S /GoTo /D (section.7.20) >> -endobj -260 0 obj -(uip\137udpip\137hdr Struct Reference) -endobj -261 0 obj -<< /S /GoTo /D (section.7.21) >> -endobj -264 0 obj -(webclient\137state Struct Reference) -endobj -265 0 obj -<< /S /GoTo /D (chapter.8) >> -endobj -268 0 obj -(uIP 1.0 File Documentation) -endobj -269 0 obj -<< /S /GoTo /D (section.8.1) >> -endobj -272 0 obj -(apps/hello-world/hello-world.c File Reference) -endobj -273 0 obj -<< /S /GoTo /D (section.8.2) >> -endobj -276 0 obj -(apps/hello-world/hello-world.h File Reference) -endobj -277 0 obj -<< /S /GoTo /D (section.8.3) >> -endobj -280 0 obj -(apps/resolv/resolv.c File Reference) -endobj -281 0 obj -<< /S /GoTo /D (section.8.4) >> -endobj -284 0 obj -(apps/resolv/resolv.h File Reference) -endobj -285 0 obj -<< /S /GoTo /D (section.8.5) >> -endobj -288 0 obj -(apps/smtp/smtp.c File Reference) -endobj -289 0 obj -<< /S /GoTo /D (section.8.6) >> -endobj -292 0 obj -(apps/smtp/smtp.h File Reference) -endobj -293 0 obj -<< /S /GoTo /D (section.8.7) >> -endobj -296 0 obj -(apps/telnetd/shell.c File Reference) -endobj -297 0 obj -<< /S /GoTo /D (section.8.8) >> -endobj -300 0 obj -(apps/telnetd/shell.h File Reference) -endobj -301 0 obj -<< /S /GoTo /D (section.8.9) >> -endobj -304 0 obj -(apps/telnetd/telnetd.c File Reference) -endobj -305 0 obj -<< /S /GoTo /D (section.8.10) >> -endobj -308 0 obj -(apps/telnetd/telnetd.h File Reference) -endobj -309 0 obj -<< /S /GoTo /D (section.8.11) >> -endobj -312 0 obj -(apps/webclient/webclient.c File Reference) -endobj -313 0 obj -<< /S /GoTo /D (section.8.12) >> -endobj -316 0 obj -(apps/webclient/webclient.h File Reference) -endobj -317 0 obj -<< /S /GoTo /D (section.8.13) >> -endobj -320 0 obj -(apps/webserver/httpd-cgi.c File Reference) -endobj -321 0 obj -<< /S /GoTo /D (section.8.14) >> -endobj -324 0 obj -(apps/webserver/httpd-cgi.h File Reference) -endobj -325 0 obj -<< /S /GoTo /D (section.8.15) >> -endobj -328 0 obj -(apps/webserver/httpd.c File Reference) -endobj -329 0 obj -<< /S /GoTo /D (section.8.16) >> -endobj -332 0 obj -(lib/memb.c File Reference) -endobj -333 0 obj -<< /S /GoTo /D (section.8.17) >> -endobj -336 0 obj -(lib/memb.h File Reference) -endobj -337 0 obj -<< /S /GoTo /D (section.8.18) >> -endobj -340 0 obj -(uip/lc-addrlabels.h File Reference) -endobj -341 0 obj -<< /S /GoTo /D (section.8.19) >> -endobj -344 0 obj -(uip/lc-switch.h File Reference) -endobj -345 0 obj -<< /S /GoTo /D (section.8.20) >> -endobj -348 0 obj -(uip/lc.h File Reference) -endobj -349 0 obj -<< /S /GoTo /D (section.8.21) >> -endobj -352 0 obj -(uip/psock.h File Reference) -endobj -353 0 obj -<< /S /GoTo /D (section.8.22) >> -endobj -356 0 obj -(uip/pt.h File Reference) -endobj -357 0 obj -<< /S /GoTo /D (section.8.23) >> -endobj -360 0 obj -(uip/timer.c File Reference) -endobj -361 0 obj -<< /S /GoTo /D (section.8.24) >> -endobj -364 0 obj -(uip/timer.h File Reference) -endobj -365 0 obj -<< /S /GoTo /D (section.8.25) >> -endobj -368 0 obj -(uip/uip-neighbor.c File Reference) -endobj -369 0 obj -<< /S /GoTo /D (section.8.26) >> -endobj -372 0 obj -(uip/uip-neighbor.h File Reference) -endobj -373 0 obj -<< /S /GoTo /D (section.8.27) >> -endobj -376 0 obj -(uip/uip-split.h File Reference) -endobj -377 0 obj -<< /S /GoTo /D (section.8.28) >> -endobj -380 0 obj -(uip/uip.c File Reference) -endobj -381 0 obj -<< /S /GoTo /D (section.8.29) >> -endobj -384 0 obj -(uip/uip.h File Reference) -endobj -385 0 obj -<< /S /GoTo /D (section.8.30) >> -endobj -388 0 obj -(uip/uip\137arch.h File Reference) -endobj -389 0 obj -<< /S /GoTo /D (section.8.31) >> -endobj -392 0 obj -(uip/uip\137arp.c File Reference) -endobj -393 0 obj -<< /S /GoTo /D (section.8.32) >> -endobj -396 0 obj -(uip/uip\137arp.h File Reference) -endobj -397 0 obj -<< /S /GoTo /D (section.8.33) >> -endobj -400 0 obj -(uip/uipopt.h File Reference) -endobj -401 0 obj -<< /S /GoTo /D (section.8.34) >> -endobj -404 0 obj -(unix/uip-conf.h File Reference) -endobj -405 0 obj -<< /S /GoTo /D (chapter.9) >> -endobj -408 0 obj -(uIP 1.0 Example Documentation) -endobj -409 0 obj -<< /S /GoTo /D (section.9.1) >> -endobj -412 0 obj -(dhcpc.c) -endobj -413 0 obj -<< /S /GoTo /D (section.9.2) >> -endobj -416 0 obj -(dhcpc.h) -endobj -417 0 obj -<< /S /GoTo /D (section.9.3) >> -endobj -420 0 obj -(example-mainloop-with-arp.c) -endobj -421 0 obj -<< /S /GoTo /D (section.9.4) >> -endobj -424 0 obj -(example-mainloop-without-arp.c) -endobj -425 0 obj -<< /S /GoTo /D (section.9.5) >> -endobj -428 0 obj -(hello-world.c) -endobj -429 0 obj -<< /S /GoTo /D (section.9.6) >> -endobj -432 0 obj -(hello-world.h) -endobj -433 0 obj -<< /S /GoTo /D (section.9.7) >> -endobj -436 0 obj -(resolv.c) -endobj -437 0 obj -<< /S /GoTo /D (section.9.8) >> -endobj -440 0 obj -(resolv.h) -endobj -441 0 obj -<< /S /GoTo /D (section.9.9) >> -endobj -444 0 obj -(smtp.c) -endobj -445 0 obj -<< /S /GoTo /D (section.9.10) >> -endobj -448 0 obj -(smtp.h) -endobj -449 0 obj -<< /S /GoTo /D (section.9.11) >> -endobj -452 0 obj -(telnetd.c) -endobj -453 0 obj -<< /S /GoTo /D (section.9.12) >> -endobj -456 0 obj -(telnetd.h) -endobj -457 0 obj -<< /S /GoTo /D (section.9.13) >> -endobj -460 0 obj -(uip-code-style.c) -endobj -461 0 obj -<< /S /GoTo /D (section.9.14) >> -endobj -464 0 obj -(uip-conf.h) -endobj -465 0 obj -<< /S /GoTo /D (section.9.15) >> -endobj -468 0 obj -(webclient.c) -endobj -469 0 obj -<< /S /GoTo /D (section.9.16) >> -endobj -472 0 obj -(webclient.h) -endobj -473 0 obj -<< /S /GoTo /D [474 0 R /Fit ] >> -endobj -477 0 obj << -/Length 382 -/Filter /FlateDecode ->> -stream -xÚ�RMOÜ@ ½çWø¸{ˆ×ö|ß @«Eª%7ÔCšÌ–$[ÈFýû�|°D”JÕÆc¿÷Æó< ”C pÆaPÚBÕd?SúKÆsY‹Jû…\y…¼…\H!‹×KØ_p–€�XCnŒFOVø§"Û|NWˆFçC±V©ìÅÁ WÔ÷«â!®s1´ê·7SpÕüˆuëéT\Ül^+wDzz\/®Giv(lô m �¤†5¡"¶ÿf¤)øwñ%¶Õ øZ¶}ùô¦«1y&ƒ®³hI9ȃÅ´…¯ûv& -‘hÙUqòCØ¢¶dA±ÇÀf0ž!5HâGÌ"LµçsNl¶ Ãå!»ÍàöÍå“l¾Ð}5yѱ�Jâ<ÚdùØòy]6SË—}û¸fZŧn~°]Òs�ÚÛaªŒÁ˜iDebŸuûªÃ.~ä~îûwþßýŽõ¾{˜®Ý¶Ýqì�³q‡Ý´_š_)ù2�·Ú�Cyçèð‘Y»ÿûÇwõ¬Ùendstream -endobj -474 0 obj << -/Type /Page -/Contents 477 0 R -/Resources 476 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 486 0 R ->> endobj -475 0 obj << -/Type /XObject -/Subtype /Form -/FormType 1 -/PTEX.FileName (../sicslogo.pdf) -/PTEX.PageNumber 1 -/PTEX.InfoDict 487 0 R -/Matrix [1.00000000 0.00000000 0.00000000 1.00000000 0.00000000 0.00000000] -/BBox [0.00000000 0.00000000 242.00000000 58.00000000] -/Resources << -/ProcSet [ /PDF ] -/ExtGState << -/R4 488 0 R ->>>> -/Length 489 0 R -/Filter /FlateDecode ->> -stream -xœ}ZYŽ3Í�|×)t‚šÜ—cØWhØÿ Ð߃=÷L²ÔRÃè‡VäÊäžÌú×3]ù™øwþýyüëñ?oÏ¿þÿ‘Ÿÿ÷HÖûü÷?ÿ|¤kôýüë‘KNW혔FmsŒg.i<ûךýŒå¸¾ö•dz®|åúüƒ†V¯Yž-õ+•gîy\}=[nWéÏÜ0|üzä6òÕçÝ�Ù½av¹jXW½– ? e^ÃGªÇvT°TÏl8³„ôra ¢£\«:äÂ\±Þý)qÇœ7¹�ëØ×@o]WÑÒ§¡äyÍùüÆ|ì:p^¬Û6 /dKž` ÏA¾U‡˜ßVô÷R¯4cö�%�)}ðh×Þ¤¦’Œ‚=f Xg¿æ!N ­n²¤a“úlÑ8'oqm‹žÞÞ Ÿg›àfJ¸€Û7 ¶†#ío(A%‰ô4¯^ž‹%Œ% S”’0¦’}›²†’lðƒlÎUJ²)Ucþ$÷¼Òvˆm'ŽVFôOò[în<4Xv>Tž† -bø3—¸Çvn–^!†ï6®9îþÕ)úÑ@©JÊ"µ�1�7Ô�Yä&cŠm·Û¼ - j¸¹Ýâÿ±Ýjù -œ'Ô¸ö¥óòwÙP@ F¨`“§¦´ÎìÃ’h ¨Ìk¬»ŸìZ¤äZOg~Á¿bø! -±”>¯Ún+.%çkm·â -Ä"³Ò’1|·ÛŠK.›ªý˜- +vV fÅ¥Lp~¸; ;ö3äÚLád© %˄ܒKÚã - §µ¥bfÈ%Õ ž„f\d9·"5V™™‚¢~Û0&�9ãî„þ•zO5è6Ølç«.·a‡aÃÞpl¸¤ Š�‘Ú‘K˜0¤ƒwïåaVذ‰¶ß6ì /6œ ÌLW_&£ÄzþŽ}ƒðÌù cÈfAjÙÞ%«ê‡[¥ãv¸Á°)�´†ZÖÕÈQMî›|ùi°'pÓûWí÷ô€÷òÞp¶×ìy÷ƒø/�aç¯Ô¸d˜Ê�k8&ÇN0êÛF¢+ÿllÇVž[l"p{<ÇÞ/èë1våi¼w-.Ñ {°ÀNšÇÜMnÒNaJ çË�ЉÚa–Ê‘ hdK™1‘$´åˆ$ ·D/,˜ö\©_Ú$û\Ô1 =»¬•ààlæ Š˜Î�Ý0u/žÁ‚+êãÀIk!W Š À1ä#çŽ\æ×j .7fôÃv'ãXSaÁ¥‘ñ’åAFü®÷f8cí" ÊdíRžæ÷0ŒE‰€qšîøû1aË…3äÇ€Ià~éïØ†‘6 -:÷”ê€6½6ôA 4 „—ÙÜ"úqÖú‚âê÷øULY¢®Œ$Ýã_�¤C.óÍP[h(‰hCAþ õÃÙ�¡Ž -xo¸ÊqÝãßqÖbÐï€+nZ aê„…˜´Oíd”¾cRšu–ÍÈ~eÃI¦~eÃ1®À©%YÙÿ9‚Cm4¥À‰‘oC’ÊK1 ‹2`g*×ÙPÇyÙœÔüeÃó ‘Sdc‚¤™ï)ÿ'{X�H ý™chëfæbÄ~rݹ~ÅÆ§áû�qŠ»�&Od3K϶²yºœ Sá߀Šäe.'è‘F¾]"lcý±b¾œ\@÷rÑ`n.'È - ÷ñs�£ lž¤U…8sf¢…Á}h©\&úyëw˜LÇßEƒ;<4t&èÇãa¹BOdn Î}†ÏÃî˼°õ‚kTBy½@îö¢Áü^NÉÖ2ÇÐ=_4×–Esy7l]¨0áüDK®w?o_Ëýà’ëv ·Ì¥ì[‹‘œM¼+S4Àâu×Iл<>qLH£3•þl Âî×) Mä˦ 1Å ÿh¸­ ÕJnVêœÙ#¨ÅŒ SºgŽß!¹éS°HCò‰E+8¦tßqô�ßñ<)¥$9oܳ¶£~ŒFoù úÚ 94“7l"auŒdÖ4$þŽTt]¾`,L¿Ñ×£Ãstv楕rY’™Ç�¸åýìH.™·Ábz:Œ<–€Ib@[Ò“»ãNw�Ô\ï퉩åý!dñ|›86£0¤T˜X&µ“©lE¤¯ oȽ„¹Ðu¸)ï�"»Bwú�`öʲÃÑ!ãã®\ 5s D·=MÄìB.]øÓÝí2ÚŽ^üC*U±–qñ!7–D~H“òˆC¤h,Þ!ÿ</VÛñw`׈‘%ÍìãûÖÍú»‚ù~ïØÇƒ"ªÒÞÿjCi¸ný‡ì‰{k+÷2Ž�Ì™n?ps+&}`'Ó÷{Ç7Ù«HWj-'µ;RYدåDª -¦øRJ6Vt"ùk¦â°Gˆ?S ùÁ$Déo=åÃU¦ú‚™'bµ)Cƒ1±r2y¯ô÷¢÷3£w<™rtÑ�äöìè )_VAÂ0F‚Nµ[�Ö²Eu•^\nhÇj\ 2à>[ �:¶ÆöPe–äàüÄÆañ|ËŽB ÖÔõ+¤âØ¥¾èSË'Žñ¼ã}@—¹ïöŽoØ]— gÃ8ÆË‚Ž› ->ÀMÞö VÆõ{ðÌÕ®L=iÞ±Ÿ�e ß°Sï´¾ãû4H :︵)@ý¹èi˜ÙŠ8C!™�Ê-*¥JòÀÞ?TzˆÙÚê~Šª4{˜–õ{uƒJ©lwï?´êïé_Ì�w“Jûa—iýP:eZì6Úm¢ f1G?Ìjj2K Ý'1L/ûÔÌîÙÎ1nï­�y0kp²Ô×ó'Ñ_ž=åË ×ðú¢dÑÀËŽg)œñŽ™Èõ×  ÔK§x%›¿4¸mÆ¢ $˪>öË’Ä Ç†P“§¨pá|ã™,†%²ù ‹[Ûa§U?KWN|KœC±PÞ;qVcùJš3àµÊt„;:uë…Çš¬î Ò?à¡�9J =�¡èĈë1^åèætÓw ÃR¦Až‹iÑPÄëo=_I±� ¬˜‘³Þ@øê¹!L®úîätVò9U°4 -èëq ½ñrK®ÒTKsd‰…DÌÊWÍMÏÚË#W�ŒÖàO/¸ÂO[¦mÓ¡2ë­âŸAŠqœÔ ÛΕJÇLËx.F(“|ÑÜ�ç –Mtñ^>Èò’­’ÅAÐÌbeÃEŸRpf!ÃT³`nÆ ©!–7^öІ}*90.}¦�‹ÕÓò -Àðg.‘všIýq.]ï„»›¦÷óŠˆkOhº{—É}iáÈž°¿ŽÁ4¨üœö­¹­uç…ˆ¯RBÁÅd2añ™¨Oß%‰Ê�„t7G<_¿¿áìdŸ-«¸(O9ø;0̨YÕA�W²öËøw̬à.Z¼C‘§úM—�¼ã¥—ßo#õ �–>måD',0˜g+#ëi�âbÞ]_pô—ßñRI›ã“†ã•Õ>¬ºqôïß±¯Ïx8¤Úa'Š»ÍmzT®áÖWÝLôÇX+í'ïgpkqäÖâØ¬S‡>ó1ƒÐÒmÞö¢�åœN?\¿•3‹�¿KŠÇd›Áð*JÍh°˜¿ÏÅûRÛ·Ùèáì¶*$EÊÓŽÝtɳœÌO‘úqTvR|lGo€³E/˜s>‚jœJö÷Û|¢á¶xó)ësó@\ë¼ †}Dƒ„"4¿âùhp“ˆ) Ç*Tj©Ð�Œí¿a·‹ ú£!ŒåoøûëŒÎendstream -endobj -487 0 obj -<< -/Producer (GNU Ghostscript 7.07) -/Creator (GNU Ghostscript 707 \(epswrite\)) -/CreationDate (2005/02/23 12:39:03) ->> -endobj -488 0 obj -<< -/Type /ExtGState -/Name /R4 -/TR /Identity -/OPM 1 -/SM 0.02 ->> -endobj -489 0 obj -3714 -endobj -478 0 obj << -/D [474 0 R /XYZ 90 757.9346 null] ->> endobj -479 0 obj << -/D [474 0 R /XYZ 90 739.9346 null] ->> endobj -476 0 obj << -/Font << /F23 482 0 R /F26 485 0 R >> -/XObject << /Im1 475 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -492 0 obj << -/Length 59 -/Filter /FlateDecode ->> -stream -xÚ3T0BCKsSs=Kc3…ä\.…t °;—!TÚÄÈHc‘ÐÉèšY˜é™[˜¥È ^endstream -endobj -491 0 obj << -/Type /Page -/Contents 492 0 R -/Resources 490 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 486 0 R ->> endobj -493 0 obj << -/D [491 0 R /XYZ 90 757.9346 null] ->> endobj -490 0 obj << -/ProcSet [ /PDF ] ->> endobj -496 0 obj << -/Length 1823 -/Filter /FlateDecode ->> -stream -xÚí[MsÛ6½ûWð(„àûã˜:IëN2ãi}kzàÈŠ­©%yh©“ô× -$À…ÌÞjNŠ­çÝçÅ{à. “Û¤0¸PB!ø,Ö»+\<Øoÿ|EÚ·9eö5ñÆJV¬ÂýéîêÝ'j -ʑҊwß\pÉ9’˜Èâîþ�ÅõaÜì�/Ë?ï~½úx׳8¡$b\˜&—ûfõоû[�Õ"W!Ô'5ÈH*ÛœÀå$ËÁ/î7Ëxqº¹mþsw}ûÎÿÿåX®ÿÒ¢˜ ���¢Ceˆ ¬&Z é ’Ì‘á¼B#!T® ¾ -ñMr$�¢Ö¹Q]ûëßì�Õáþ´>nûˆ�Rˆû«ô ªÐ¡rD4ED„Ñ´\ »FóËØË`MÎZ‚Ö¤CeÖ$Ž–T¦s<˜�»8B:1Ø-@_¬\Ž‘’&§\�j”K[å†&¾>ìv§ýv]¦dLí¾ÄWE˜.6³GeXQ*‘ÑV³6ûÚ„ -h,tÍUš&µ 囪MJí:“œ6=ªÑ&kµù¥Üî½2ÝûÔ|ñùpxŽ5Â>¤)„‰GM‹Êð¢„"Ì1ë›7RH¬Pݱ‚u�£�‹Ê7U¬VİœX=ª+oÅú¾Z?n�›õñTµ�ÒïÏ›õö+ÆtÝ|ýé´¯„¨}£‚#ÌX:)^�Êð¤B"Û?Š>Ñ·(I¨š�$ÁjÆÑ\5YR’P¾‰’äZ!ŽEF’ª‘¤ðûçfw¨~4âûRîˇÍÎN‘úˆDRqR„¹bõyT†% BiŸÓ¼g¦ -ü,P¸àq´Q�‚ù¦ -T$InlêP�@¥ß3ŸŸŸ|»Y«ô¶:‹¹µü�â…–&/¸4q4·4*)^(ßTñ2ÛßñܨԡñêV¼vã<Ö~BºqBvÏú2Ýo2‚°2²SÆ{¥Ge˜QæF~ûTéQ{óÊd¶YW .q‡Ê”8ŽV¯~z_…N•¦mþ¨È Fª‘¦ñÒ´ñCµ+÷ö!�j¤„TE˜ q4Ú¢r<üÑh�ȼoNR.‡×¤CeÖ$ŽV‹C&• %t)+ª]ÿJ/¸ã`¶ÕÕ¶ß½ãèÍ CsÇÑ]mØ�¯›÷§§�ïGï7ß# …˜–¢3Æö¨ ±Îè=zÄŒ]r0…–X]jä?näUצ»ä«NÜ1†Œ1b@/ªI‹Ê±²µÃÆ6í=Z³u/~�«p~Á«GK+ÓLøZ#s;. -!Æ�Üd;öŽù—í¦*«%Ñ‹õ£9ŸKS¢µ#à9tú@¤E­Bdé�(½·d”!-•¼ØÒ°´GÕU,}ýT¾¼„%[?.ÅâG|D­yñ�ntÔ¢2,ýmP�åì⾋¡B. GK‹±v1”ð•.¦F .)uqhÎ Æ\ü¡<–íáú±:¹³vçhèùLIatRHµEe˜võëñ¥lÌÌT)wjÊ/5sˆ7s‡ª‹˜9.Wü°¦ÛQV‹ר@-*CÑ;¹GqvrÏÉ`¡ÏN† GK+Ñ9LøZ'sƒ¨4tÜÉàøˆQ'ÚÂmµÆH¹ 5Ì·�•¡u.VHŽŠQÛ2‚¸&ôbÛxÀ¶UW°í¹6Ÿ·/Ǹ»¦Èîmë¥r-’5eÃi}Ø»ÏS=œªà3ßF?VÅ$ÒZÓ"H�xÚ´ ˜ åªt�á,F °�¡ÂF±jI¦7M ÛTQ2·¬™qÛƒQò¡(·ûíq[>mÿ¹L“v^§º'$Ù``vgEôÞü¥T×ó�XØ(V}Ê‚“вMU$±‹Ï2§¹Ô(R y¿YR±ø{ë?5u_mëo,‰Xlª¬Bb†é"`’�h ‚ùž5žwM °Á® 6ŠUk4yŒ e›¨Qãþþ*3µ˜F¡r¨ÐrøÁ¿q9Úa3û{œ“&Ook ȬûœJ@mî*›­(îyׄŠ;ŒTë1ÙX©šÃ ;aÌ/úcÊ_ßkÿendstream -endobj -495 0 obj << -/Type /Page -/Contents 496 0 R -/Resources 494 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 486 0 R -/Annots [ 501 0 R 502 0 R 503 0 R 504 0 R 505 0 R 506 0 R 507 0 R 508 0 R 509 0 R 510 0 R 511 0 R 512 0 R 513 0 R 514 0 R 515 0 R 516 0 R 517 0 R 518 0 R 519 0 R 520 0 R 521 0 R 522 0 R 523 0 R 524 0 R 525 0 R ] ->> endobj -501 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 575.2302 202.806 584.2064] -/Subtype /Link -/A << /S /GoTo /D (chapter.1) >> ->> endobj -502 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 557.4621 178.1091 566.3087] -/Subtype /Link -/A << /S /GoTo /D (section.1.1) >> ->> endobj -503 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 539.6741 225.451 548.5207] -/Subtype /Link -/A << /S /GoTo /D (section.1.2) >> ->> endobj -504 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 519.8288 206.3431 530.7327] -/Subtype /Link -/A << /S /GoTo /D (section.1.3) >> ->> endobj -505 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 502.0408 255.0296 512.9447] -/Subtype /Link -/A << /S /GoTo /D (section.1.4) >> ->> endobj -506 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 484.2528 217.6704 495.1567] -/Subtype /Link -/A << /S /GoTo /D (section.1.5) >> ->> endobj -507 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 466.4648 275.6622 477.3687] -/Subtype /Link -/A << /S /GoTo /D (section.1.6) >> ->> endobj -508 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 448.6768 168.1465 459.5807] -/Subtype /Link -/A << /S /GoTo /D (section.1.7) >> ->> endobj -509 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 430.8888 232.0759 441.7927] -/Subtype /Link -/A << /S /GoTo /D (section.1.8) >> ->> endobj -510 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 415.0385 179.7529 424.0048] -/Subtype /Link -/A << /S /GoTo /D (section.1.9) >> ->> endobj -511 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 386.733 198.3827 395.7092] -/Subtype /Link -/A << /S /GoTo /D (chapter.2) >> ->> endobj -512 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 368.8453 194.9958 377.8116] -/Subtype /Link -/A << /S /GoTo /D (section.2.1) >> ->> endobj -513 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 340.5398 219.2242 349.516] -/Subtype /Link -/A << /S /GoTo /D (chapter.3) >> ->> endobj -514 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 320.7145 223.9867 331.6184] -/Subtype /Link -/A << /S /GoTo /D (section.3.1) >> ->> endobj -515 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 294.3466 229.456 303.3229] -/Subtype /Link -/A << /S /GoTo /D (chapter.4) >> ->> endobj -516 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 276.5786 221.8247 285.4252] -/Subtype /Link -/A << /S /GoTo /D (section.4.1) >> ->> endobj -517 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 248.1535 181.7751 257.1297] -/Subtype /Link -/A << /S /GoTo /D (chapter.5) >> ->> endobj -518 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 230.3854 193.6207 239.2321] -/Subtype /Link -/A << /S /GoTo /D (section.5.1) >> ->> endobj -519 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 201.9603 239.3289 210.9365] -/Subtype /Link -/A << /S /GoTo /D (chapter.6) >> ->> endobj -520 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 184.1922 179.2149 193.0389] -/Subtype /Link -/A << /S /GoTo /D (section.6.1) >> ->> endobj -521 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 164.347 179.7727 175.2509] -/Subtype /Link -/A << /S /GoTo /D (section.6.2) >> ->> endobj -522 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 146.559 237.8845 157.4629] -/Subtype /Link -/A << /S /GoTo /D (section.6.3) >> ->> endobj -523 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 130.8282 235.1242 139.6749] -/Subtype /Link -/A << /S /GoTo /D (section.6.4) >> ->> endobj -524 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 113.0402 236.3901 121.8869] -/Subtype /Link -/A << /S /GoTo /D (section.6.5) >> ->> endobj -525 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 93.195 229.0275 104.0989] -/Subtype /Link -/A << /S /GoTo /D (section.6.6) >> ->> endobj -500 0 obj << -/D [495 0 R /XYZ 90 604.4538 null] ->> endobj -494 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -528 0 obj << -/Length 2844 -/Filter /FlateDecode ->> -stream -xÚíœKsÛÈÇïú8ŠUáì¼{ÛØÎ&®ØqÖªä°ÙRQ$$±B‘ - }˜Á` ÷ˆØ›ÉÒA¤øWw£ñCÏM� -ÛR\)¡�a\V˧+\=Ø?ÿxEüÇsûù<üùæê»¿PSd$•ÕÍ}gA$(¡ÕÍêçëõzöËÍûŠI�ˆ‘ÖJûÇ7ÿøxóîãÍçö£«w7Á¾w/˜$­õÿ]ýü ®V6Œ÷W1£Eõ›}ƒ­%C«§+NYÿfsõùêŸÁŽû û‡ÜQp¬²šSåâîDíGû¯ù)’Ì‘áÜ9µÇ©èpà,:ð^Õ‹Úã”HÍì¿ |}üÛ§ÙœÚËÝvÆñõ¯3"®ëýamßv¿?n—�}wx™J%2Tè*òžQÁ1RÆÂŒ‚D³¹Àø|~½È¯À a¦˜ß ‚ó›Øjó+Dâ’ÀÞŸD!eÌ«ñ$ëÆÓ‹žÚãù¯!äz±_/î6õÁy<Ô+÷jí ¯ê׿®—µ¿_wðP'+Œ¨°qD¦÷"ø8¨2ˆjEFò-ƒÉÁ¬œµÄVwúILÀÛLýj2¥áÈz'0šAåØ4žÍ›Çú~7o>}׿>4‹åàˆ°‡‹Y;N‰ëU…ø(1HJÇž[Ù|«`ÂXá„§Ö:"hWÐáÄB*•DB‰®½ÊáJ°Í�ò‡ýòqÝÔËæ¸÷Üžëåú?Óå Ž¿>æK‰¸’²Š#IùíU…€©"HAÇŸŽPþ"Áü¥ÖÚü)žÅr8¹| -�”’…‰gPy‰ã1ÐöÃjµ¯~pÿ©>ì6Ç&L??íwÍn¹Û$$¶F…�XÆ1¤$öªB¨TÚ‹•36Žõœ&™`‡Y&œÆÔZ¤Ì 9œ $ÇvòZšjzU’: ßì¶m1|8î»gW]]Üí‡JùH.Ú¢7ÏòèEóX•Á‘»H4réù®€ÀœFp‚IM­upš,œ�ÃÉpRf'°ºg¯òp²ÕÒÎ1Ý‹æq¿;><>÷þn·;4µô17ù”ÄÆËM’¼½ª¯/™/>«)%”Æh Ó˜ZkÓ¨óTB'S‰…�§^ ²Wy*¹£òï»åbö�šõö¸ÈϱDŠ’ÈN½^UŠÚ• æí**Žê¼×=¥ - -å=ª `ÞSkmÞ Î² -9œ¸üZ!¡qÕ ò¨ -‡êÍŒ‰ëõS_ 7ë»ýbÿåeèDÛÂ�ud%P•BÒIÊõ8¦ ¨§Ò žŒ�^ød¤Ö:z³{M Ã©•VHƒ”]ïðíU_é'§›�Ñý®§æïg_/–u -°FÚèÈN`¯*eÂÆ®äGQ]X}õ< Ã> ©µŽÜì:t8™\A�ÑTÈuª@®räv+øCK¯%¶n`ý¥ØFFí -)ËO¼jË€‰Â(´ °°PÞ#`Á¼§Ö:`³÷›@‡“�eÍJÀö*¬vÀ~¨Ÿv–L·¨ÊîÓb»x¨ŸêmSÚ$Uö”ÒTq™ÛJ^U–j;)ÚŒ£ý¶èãÆ�f0a½¨�¯ÄV›.‚³{ô°¿©ì‰˜æªÀžSöŒcïíÇÏŽ®}»êï[¦c7ûcÛ%8#úÚw -¾Ý-�íΗkŒIú - âX˜*%ÓWàU…ˆû<ŽÂ&4Òú«’i‚#äµWz¬ÿúµT]Òñ-¿«Çåóòö`óPǹê[×îë}½MïÉPÎí!aó"Ö¤7È« -!†æ QŒg{í‚9 ×.œÒÄÖW˜k¯]ØßÄá‡I†£…FÊ rPRåc»¸ k€Óñ”1ÜE‘¹~½ªlhêE{$BéH³—Ør$f'B°¿iKRf'WÂ-€Ø«ˆ¬±ižW·Ë‡õír±ÙœB °¥�²Èp¾™×« -QR!‘VDŒÃ<ÃÊ%sàÌebËñ˜Ý‘†ýM­Œvª¤/4M•’�€<}¸ÆHµÍà±ïÌpíU…‡á:Žñ|‡k(§”`J[Êl›9ìo*”ØÃD¡-¨”ÂCùT?ÝÝv÷•'•HŠ QªŠ}gJ¤WBJdãÒ%s ÌebËѨ²4‚þ¦ ÙÔP;!•ƒÊÁ(=ŒÏ‡Ðßð: )FTbYÅ^3ßúöªBpÝ·Ã5'ãè.{1¢`¢¢pž[Ñì ;ØßÄ‚I·SUUh} *Ǩн½›Q|}¼?…UfW,”ê*öž²Ú« -ARN�¡J�£<{:¡Ôt‚™Ml9:³_�€ýM, v0L—àìUÎþÏÍ)DZ[JjUÅ.3Ý�^Uˆ,t7ŽB»ìó´Bih³žØêheÙ}^ØßÔZj –b¦ÐÛT×þ™‡§æùô3H¶�ó±ëL!õªB„aA4 -ñ|™„r:0 ¦4±å˜Ì~µö7±‚Úùžá¸„d¯ò{ê¾m¬ézq¦,ÓbJ“*öžY¦{U!Ȱ"Ey†8BÉps™Ør8f[paSK$fˆpRhc *Ï£ïk†/‰½ŽCbƒäZV±×L+£W‚–Dqt—a|Ä(”è�Q0ω-Çhö–ìo"£D Ä8-4•gÔ7×Ï·ËÝv{Ò Î6vV;Î â^Uˆ/¬†Fž;˜`j˜pf[Ìì Øß´±œH…g%.{•ç’ \ÖÍãíbµ:©„Ú)¡082›ʽªcÊGAž!�P2Á\&¶�Ù­vØßÔ2iOºâ¼ÐšTG>ÆññD²ÇRÅ®³OriE…ÃbgáùH(¥’`J[Éì~;ìob�dvèã¢Dd¯òDŠ�ÈõòéÙþ:J‰‘l7…b÷™& ¯*DÞ2 -óœ@„²8€&1±å@ÌîªÃþ¦ÖFÂm©+¬rz‘çPnëõÃãÝnòh­(Òí}þÈæë­^Gžš‡ùm“$mÊÙKK»ìv9èl"uFÚÒ¡ ý“NÔC§èÚ]ž“î{3Š8,æ-^3DÀ’%ŠíÜ,@R‹PN_ØéHäÙ­pÈS×ð,Åù®`ë�H!ÿГ׻^imÿ…Ä­N¦’ȨvZ{_1jÿ‘KZ)Ò^3n×êÇz[ïMÿÀéþ©€úïÛfÿ£Ó®Î»ßø{ʾ§¾±Ú–ôO hŸE?BpÜ�}÷¥o¶þýËC½Í?Ù…eéÿYpùÁendstream -endobj -527 0 obj << -/Type /Page -/Contents 528 0 R -/Resources 526 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 486 0 R -/Annots [ 529 0 R 530 0 R 531 0 R 532 0 R 533 0 R 534 0 R 535 0 R 536 0 R 537 0 R 538 0 R 539 0 R 540 0 R 541 0 R 542 0 R 543 0 R 544 0 R 545 0 R 546 0 R 547 0 R 548 0 R 549 0 R 550 0 R 551 0 R 552 0 R 553 0 R 554 0 R 555 0 R 556 0 R 557 0 R 558 0 R 559 0 R 560 0 R 561 0 R 562 0 R 563 0 R 564 0 R ] ->> endobj -529 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 728.8762 227.9221 737.7228] -/Subtype /Link -/A << /S /GoTo /D (section.6.7) >> ->> endobj -530 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 711.0772 271.2488 719.9239] -/Subtype /Link -/A << /S /GoTo /D (section.6.8) >> ->> endobj -531 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 693.1587 216.0265 702.1249] -/Subtype /Link -/A << /S /GoTo /D (section.6.9) >> ->> endobj -532 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 673.422 267.4728 684.326] -/Subtype /Link -/A << /S /GoTo /D (section.6.10) >> ->> endobj -533 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 657.6804 259.752 666.527] -/Subtype /Link -/A << /S /GoTo /D (section.6.11) >> ->> endobj -534 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 637.8241 246.4723 648.7281] -/Subtype /Link -/A << /S /GoTo /D (section.6.12) >> ->> endobj -535 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 620.0252 262.7911 630.9292] -/Subtype /Link -/A << /S /GoTo /D (section.6.13) >> ->> endobj -536 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 604.164 207.7177 613.1302] -/Subtype /Link -/A << /S /GoTo /D (section.6.14) >> ->> endobj -537 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 584.4273 181.9047 595.3313] -/Subtype /Link -/A << /S /GoTo /D (section.6.15) >> ->> endobj -538 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 568.5661 189.8946 577.5323] -/Subtype /Link -/A << /S /GoTo /D (section.6.16) >> ->> endobj -539 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 548.8294 208.7238 559.7334] -/Subtype /Link -/A << /S /GoTo /D (section.6.17) >> ->> endobj -540 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 531.0305 280.7632 541.9344] -/Subtype /Link -/A << /S /GoTo /D (section.6.18) >> ->> endobj -541 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 515.1692 183.21 524.1355] -/Subtype /Link -/A << /S /GoTo /D (section.6.19) >> ->> endobj -542 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 497.4899 212.9779 506.3366] -/Subtype /Link -/A << /S /GoTo /D (section.6.20) >> ->> endobj -543 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 479.691 180.2909 488.5376] -/Subtype /Link -/A << /S /GoTo /D (section.6.21) >> ->> endobj -544 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 460.552 179.1154 470.7387] -/Subtype /Link -/A << /S /GoTo /D (section.6.22) >> ->> endobj -545 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 444.0931 171.4939 452.9397] -/Subtype /Link -/A << /S /GoTo /D (section.6.23) >> ->> endobj -546 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 426.2941 173.5465 435.1408] -/Subtype /Link -/A << /S /GoTo /D (section.6.24) >> ->> endobj -547 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 397.8143 270.4022 406.7905] -/Subtype /Link -/A << /S /GoTo /D (chapter.7) >> ->> endobj -548 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 377.978 245.0472 388.882] -/Subtype /Link -/A << /S /GoTo /D (section.7.1) >> ->> endobj -549 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 361.1553 269.3059 371.083] -/Subtype /Link -/A << /S /GoTo /D (section.7.2) >> ->> endobj -550 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 342.3801 255.0196 353.2841] -/Subtype /Link -/A << /S /GoTo /D (section.7.3) >> ->> endobj -551 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 324.5812 241.7395 335.4851] -/Subtype /Link -/A << /S /GoTo /D (section.7.4) >> ->> endobj -552 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 307.7585 253.914 317.6862] -/Subtype /Link -/A << /S /GoTo /D (section.7.5) >> ->> endobj -553 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 288.9833 221.2568 299.8872] -/Subtype /Link -/A << /S /GoTo /D (section.7.6) >> ->> endobj -554 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 271.1844 239.3191 282.0883] -/Subtype /Link -/A << /S /GoTo /D (section.7.7) >> ->> endobj -555 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 253.3854 205.765 264.2894] -/Subtype /Link -/A << /S /GoTo /D (section.7.8) >> ->> endobj -556 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 235.5865 240.6335 246.4904] -/Subtype /Link -/A << /S /GoTo /D (section.7.9) >> ->> endobj -557 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 218.7638 248.3744 228.6915] -/Subtype /Link -/A << /S /GoTo /D (section.7.10) >> ->> endobj -558 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 202.0459 219.0448 210.8925] -/Subtype /Link -/A << /S /GoTo /D (section.7.11) >> ->> endobj -559 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 182.1897 235.0949 193.0936] -/Subtype /Link -/A << /S /GoTo /D (section.7.12) >> ->> endobj -560 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 164.3907 250.5866 175.2947] -/Subtype /Link -/A << /S /GoTo /D (section.7.13) >> ->> endobj -561 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 146.5918 246.1633 157.4957] -/Subtype /Link -/A << /S /GoTo /D (section.7.14) >> ->> endobj -562 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 128.7928 261.6649 139.6968] -/Subtype /Link -/A << /S /GoTo /D (section.7.15) >> ->> endobj -563 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 110.9939 273.8294 121.8978] -/Subtype /Link -/A << /S /GoTo /D (section.7.16) >> ->> endobj -564 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 93.195 233.4407 104.0989] -/Subtype /Link -/A << /S /GoTo /D (section.7.17) >> ->> endobj -526 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -567 0 obj << -/Length 2549 -/Filter /FlateDecode ->> -stream -xÚíœ]s㶆ïý+xi_Æ÷G.Ó&™îLÓ6ë»LfÇ–¸+MeË•älóï  -ð�É^ÅÜÙÙµl½{Ϋ×¢Hlÿ�ÆàF … ã²Y?^áæ‹ýñOWÄ?½²Ï¯RÁ÷wW·?RÓd$•ÍÝ羂$HPB›»Í¯×ùÇÏw?ü|÷ñæ·» 'IC„-Ö=·Ûíº_ýp:x‚IÒÕÿÏÕ¯¿áfc�|¸Âˆ-š¯öŒˆ1´y¼â” ßì¯>^ý+ÔqOôÿ¡ô:8Ö Ù¬¨rÎ{Q÷Ôñ‹×ü’È æÈpn_;µ¯TÑøÒYòÒÕ ê^¢BD߬„À×/»çOçõ³ýw»9Þ¬¨ýÑÇóñe}v�i?·ÇöiÝ^&BE†(Ý$½³×D°C*$ÒÊæŸZDÖÆïòËE”ܸß:”ä �ƒ¼¬ÔåH8½l(ƒ› …”1o¦�PD«PèEžB)|Ù<Zžž&AȦÌ4Ië„^Œ&!�d„ -ò²’ƒ�!„š� Ôo¦PŽ˜âÆ0¨‡�8œ1 -$µ’MÚ½@¢WULRiŸåŒ�].B0Å@!bVËqÈKÂýæ�†RI$”¨q8¨<‡Äqøµ}XïwíÓùÓé|n'‘¨‘1\4iÿ‰^U±éI¼ð¹$¡#‰`ˆY-G¢(’ö³eWT#.ªv+bÉ5"DÐWWÄAвëA‚m/û§CŒ ìü¸Û{ÿzX¿ƒ$·ÏŽÌÿ‰@(”x‚™dµ^¡©?Á~s×$ö—'ˆâÜ•Ã�NÁm; 7%»ã41UÄ­WU¼GÜRóbÜ P"n`&Y-‡›.âö›·òv5£ˆ®ÐTŽ6–ÒvlO‡ýïþË�׆3*⚪&µ‘σªâ–*‚t7Œì.aåÆH„ÓËj9M‰D¸ßÌ�OØåŒ!FTPTE£¸�€¢uͱjR½ªâ6¢˜Ú]ŠP|E0½¬V�¢ EÁ~3Ea¡¸Fâ r$Š”ÄÓãù¹ÿgÊ`hϳˆV¢IÛÏÆzUÅe8Ù\ÐÙ˜b 1«å@,îOÁý掉œ F‰¬�8¨‰²Lâv‰Š‹¤ðk$öªŠË°C5²¹$¡#‰`ˆY-Gbq‡ -î7—DÊ� v“èT‰*%ñÜîŸÚóæöÔ��LZ$ -Äf±xyföªU*ƒfæÔê"0„â‹‚éeµ†²ˆ!Øo.†X EY ÃAå0Ô¯c¸�„¡¡š5©…"†½ªâ4b˜Z]†P|C0½¬–ð¸I÷›‰!×Êþš¹†1 *‡¡)aè¿NCRÚ¤&rUÅ+UQ­ÈØì»&Ì-Ç–Õr÷mà~óNQ¸Âvµ)j*¿)íß¹,8a$TÙ•iR½ªâ5˜š}ßB¹EÁزZÀâv Üoî(¨]eJS!pPyIB`xã2>š2 {â�‰iR#9…ƒªâ—a‚¶�G†ß pPD80¡¬VœÄEàÀ~s�cÜ®'k#^/R�7Zám¨gT÷fªŽ-ʼyÕ*•A¼¥†ß oPD‘70¡¬–ã­x�Üo.oDÚ…cm|ó"�ãvj�¿ßqÝo·çóófµþ²›8Äc‰•â׋`øÄñ»á È'âÅsYÉÁVÜ^›Íd�ÙöÆþŠ`Ø‚ÊÓÆß@Ûvmª`S3EÜzUÅsàmdú½FˆƒÊj9抗úÀýæ�B0Mì€EjÌ *Ïœ€™›2ºil a¤I�ä¼ ªŠ_ª;.í72ü>ÏÀÀ"}`^Y-G_q'î7wÈ“ 1F+D*�Ÿtøíw·�íãà Ǔ®7` q†u“6Ï‘T�”{^¯ôØä;¾ ümpBÑF8Ád³ZÎâþÜoæÐȶh…ÍAåÙT6·“Ø4Zë&m^d³WU@‘ö-@êU{ÞÑÈÞ7FGŒB9GFÁ˜³ZŽÑâžÜoîHJ¸]½VNx‘¿± !úéþ8ñ J‰„°ëå¤uar÷"Ø`œÛ‡Ë4òåyY©§Ñ”çu¨ÙL�´ X]¹ÖÒ‰É%‹“æuN�P8Ô,“è5«(@LÜ-–C Í€!æEaqÚ†:õ·öˆb\|‹Û†D -ùÝ}º¿+ îîoÆF÷ݳs§ê–Åî6Ù¤;PÜfÖOíS{¼?·GæÁß›÷ïÃÝeÂ/þ›îs9ýWüeßQó@û‚¤{ôù†Šëƒ¿«j~—Á‡?†{ þ÷�/íSùv±ÎZ’ÏÿSq˜endstream -endobj -566 0 obj << -/Type /Page -/Contents 567 0 R -/Resources 565 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 486 0 R -/Annots [ 569 0 R 570 0 R 571 0 R 572 0 R 573 0 R 574 0 R 575 0 R 576 0 R 577 0 R 578 0 R 579 0 R 580 0 R 581 0 R 582 0 R 583 0 R 584 0 R 585 0 R 586 0 R 587 0 R 588 0 R 589 0 R 590 0 R 591 0 R 592 0 R 593 0 R 594 0 R 595 0 R 596 0 R 597 0 R 598 0 R 599 0 R 600 0 R 601 0 R 602 0 R 603 0 R 604 0 R ] ->> endobj -569 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 726.8189 253.9141 737.7228] -/Subtype /Link -/A << /S /GoTo /D (section.7.18) >> ->> endobj -570 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 709.0199 255.0202 719.9239] -/Subtype /Link -/A << /S /GoTo /D (section.7.19) >> ->> endobj -571 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 691.221 256.6839 702.1249] -/Subtype /Link -/A << /S /GoTo /D (section.7.20) >> ->> endobj -572 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 674.3983 259.9907 684.326] -/Subtype /Link -/A << /S /GoTo /D (section.7.21) >> ->> endobj -573 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 646.9995 222.7212 655.9757] -/Subtype /Link -/A << /S /GoTo /D (chapter.8) >> ->> endobj -574 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 627.1632 313.2008 638.0671] -/Subtype /Link -/A << /S /GoTo /D (section.8.1) >> ->> endobj -575 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 609.3643 313.7588 620.2682] -/Subtype /Link -/A << /S /GoTo /D (section.8.2) >> ->> endobj -576 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 591.5653 268.479 602.4693] -/Subtype /Link -/A << /S /GoTo /D (section.8.3) >> ->> endobj -577 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 573.7664 269.0369 584.6703] -/Subtype /Link -/A << /S /GoTo /D (section.8.4) >> ->> endobj -578 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 555.9674 259.1837 566.8714] -/Subtype /Link -/A << /S /GoTo /D (section.8.5) >> ->> endobj -579 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 538.1685 259.7417 549.0724] -/Subtype /Link -/A << /S /GoTo /D (section.8.6) >> ->> endobj -580 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 520.3696 266.3666 531.2735] -/Subtype /Link -/A << /S /GoTo /D (section.8.7) >> ->> endobj -581 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 502.5706 266.9246 513.4746] -/Subtype /Link -/A << /S /GoTo /D (section.8.8) >> ->> endobj -582 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 484.7717 274.6654 495.6756] -/Subtype /Link -/A << /S /GoTo /D (section.8.9) >> ->> endobj -583 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 466.9727 275.2234 477.8767] -/Subtype /Link -/A << /S /GoTo /D (section.8.10) >> ->> endobj -584 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 449.1738 297.8981 460.0777] -/Subtype /Link -/A << /S /GoTo /D (section.8.11) >> ->> endobj -585 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 431.3749 298.4561 442.2788] -/Subtype /Link -/A << /S /GoTo /D (section.8.12) >> ->> endobj -586 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 413.5759 297.1911 424.4798] -/Subtype /Link -/A << /S /GoTo /D (section.8.13) >> ->> endobj -587 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 395.777 297.7491 406.6809] -/Subtype /Link -/A << /S /GoTo /D (section.8.14) >> ->> endobj -588 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 377.978 281.6994 388.882] -/Subtype /Link -/A << /S /GoTo /D (section.8.15) >> ->> endobj -589 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 362.2364 234.4271 371.083] -/Subtype /Link -/A << /S /GoTo /D (section.8.16) >> ->> endobj -590 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 344.4374 234.985 353.2841] -/Subtype /Link -/A << /S /GoTo /D (section.8.17) >> ->> endobj -591 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 324.5812 264.1452 335.4851] -/Subtype /Link -/A << /S /GoTo /D (section.8.18) >> ->> endobj -592 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 306.7823 249.2113 317.6862] -/Subtype /Link -/A << /S /GoTo /D (section.8.19) >> ->> endobj -593 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 288.9833 219.8818 299.8872] -/Subtype /Link -/A << /S /GoTo /D (section.8.20) >> ->> endobj -594 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 271.1844 235.9316 282.0883] -/Subtype /Link -/A << /S /GoTo /D (section.8.21) >> ->> endobj -595 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 253.3854 220.4398 264.2894] -/Subtype /Link -/A << /S /GoTo /D (section.8.22) >> ->> endobj -596 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 235.5865 232.6138 246.4904] -/Subtype /Link -/A << /S /GoTo /D (section.8.23) >> ->> endobj -597 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 217.7875 233.1718 228.6915] -/Subtype /Link -/A << /S /GoTo /D (section.8.24) >> ->> endobj -598 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 199.9886 263.0497 210.8925] -/Subtype /Link -/A << /S /GoTo /D (section.8.25) >> ->> endobj -599 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 182.1897 263.6077 193.0936] -/Subtype /Link -/A << /S /GoTo /D (section.8.26) >> ->> endobj -600 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 164.3907 245.9038 175.2947] -/Subtype /Link -/A << /S /GoTo /D (section.8.27) >> ->> endobj -601 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 146.5918 224.8631 157.4957] -/Subtype /Link -/A << /S /GoTo /D (section.8.28) >> ->> endobj -602 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 128.7928 225.4211 139.6968] -/Subtype /Link -/A << /S /GoTo /D (section.8.29) >> ->> endobj -603 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 110.9939 247.5479 121.8978] -/Subtype /Link -/A << /S /GoTo /D (section.8.30) >> ->> endobj -604 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 93.195 242.5666 104.0989] -/Subtype /Link -/A << /S /GoTo /D (section.8.31) >> ->> endobj -568 0 obj << -/D [566 0 R /XYZ 90 757.9346 null] ->> endobj -565 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -607 0 obj << -/Length 1649 -/Filter /FlateDecode ->> -stream -xÚí›]oÛ6†ïý+x_˜ã7Å^nk‹X·µ¾+Š!u”Ú€c{®Ó´ÿ~¤HI”I&šwÓA`;~uÎ+žGü�Šˆý¡È¤¥Æ† …w‚>Û?¿žÐðõÌ~?‹?Ï'?½blSh~ÛDPKFšß|¸ZM)¹ú:ý8ƒ¸ª05ÊFr_üòÇÛùË·ó÷î«ÉËy—#X�\Q—áŸÉ‡�ÝX+o&sSIô`?É0t7Œ·Ö“÷“¿º8þ‹æ€Ü™Ra"š1í½7"÷Õþsм‹ä”l„°gÏì¹jÖŸ<�N¾Uµ"wžæl:“’\ݯv?Ùß¿¯÷;¼œÎ˜ýÓ«ÕºöïÞÕ·õ¾Þ,êãö`‚aÊ*Ž¢ÌÉÙt"Øƶˆ-Al[w„üÈ/G-*Œ/=Ô ­nÏãH®9©aÇ %…«×±H5VÌòóX)Ã\hU€±Uù€Æíîð¹ÆTjgNa ¢‚?&(6LWCƒ?>�(¡–í©[6‰å¹äY.Á|#ÁTF`Íx¡—ìTLÀܬ¾92g‹íæö)lJ‚³—Xœ=…³UL2©p¥©º|~<‚�Ùñ·eËó¨r<ÂùlX7`ËJPt¥l?Ä;9QéÎ�™Z~mKÜÿö§�bâß¼üv}·kñûu»¸¿«7‡ëÃj»IÇjŽ9(Μ«½¨à¯k´Ø$5ú8gw5Ù±]RZ=ú�ôÀ5Úªš&ÂÔ5’m…›åb·À‹Ä‹¬°TL™9j€NUò`Ïœ;±˜x6Äÿ{YCê/k°>I¬„6—5˜o8ÌðG#Ì)®*- ·*�0 ¼L¶”3¢Q<ƒpP•ç†ó�XJ¬/<ÓíT`68íŒÃBhƒâð„ƒªä¢ƒ8¶qAó,Cê!ë“Äj æÙMmp¾±s{5…;À�*@Üïj›-¶7õìËáûºÎtƆÚõ¨Ö(Î’²ÜªJfŒÆÄ(5ts!ôѼBEèyk�Äò¼æg `¾±¼2·Í¸4û ¢@«ˆimv¹%}®Á¤â EÑ3]n*f“234rs$´PIzjÁŠ$±<·&Ë-˜odoË+i»OÅap;UWƒ›v¸¶“$v.ƒâpƒªä£w`äç8pÁ’tàÂIb5àŠl‡ çs[£8åØ˜üÖ‚pþ‘Çèÿ^j60WöÊûƒ6ÚÍÉo·£‚5É�¦ö5lò]oêýõ¡¾ñ›•·ÿú{ûæ�Û£s>¸…_óJ^0þ‚…ÝÎŒåßÝN™¼Úîý‡t[ô§ïíŽèoß?×›ü?xkQ+ý 6û® -endstream -endobj -606 0 obj << -/Type /Page -/Contents 607 0 R -/Resources 605 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 486 0 R -/Annots [ 609 0 R 610 0 R 611 0 R 612 0 R 613 0 R 614 0 R 615 0 R 616 0 R 617 0 R 618 0 R 619 0 R 620 0 R 621 0 R 622 0 R 623 0 R 624 0 R 625 0 R 626 0 R 627 0 R 628 0 R ] ->> endobj -609 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 726.8189 243.1246 737.7228] -/Subtype /Link -/A << /S /GoTo /D (section.8.32) >> ->> endobj -610 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 709.1945 238.1532 720.0984] -/Subtype /Link -/A << /S /GoTo /D (section.8.33) >> ->> endobj -611 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 691.5701 251.4234 702.4741] -/Subtype /Link -/A << /S /GoTo /D (section.8.34) >> ->> endobj -612 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 664.1176 244.3102 674.9967] -/Subtype /Link -/A << /S /GoTo /D (chapter.9) >> ->> endobj -613 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 646.3587 159.559 657.2627] -/Subtype /Link -/A << /S /GoTo /D (section.9.1) >> ->> endobj -614 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 628.7344 160.117 639.6383] -/Subtype /Link -/A << /S /GoTo /D (section.9.2) >> ->> endobj -615 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 611.11 247.3986 622.0139] -/Subtype /Link -/A << /S /GoTo /D (section.9.3) >> ->> endobj -616 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 593.4856 260.1307 604.3896] -/Subtype /Link -/A << /S /GoTo /D (section.9.4) >> ->> endobj -617 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 577.799 182.1539 586.7652] -/Subtype /Link -/A << /S /GoTo /D (section.9.5) >> ->> endobj -618 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 560.1746 182.7119 569.1408] -/Subtype /Link -/A << /S /GoTo /D (section.9.6) >> ->> endobj -619 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 542.5502 159.4692 551.5165] -/Subtype /Link -/A << /S /GoTo /D (section.9.7) >> ->> endobj -620 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 524.9258 160.0272 533.8921] -/Subtype /Link -/A << /S /GoTo /D (section.9.8) >> ->> endobj -621 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 505.3638 155.1453 516.2677] -/Subtype /Link -/A << /S /GoTo /D (section.9.9) >> ->> endobj -622 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 487.7394 155.7033 498.6434] -/Subtype /Link -/A << /S /GoTo /D (section.9.10) >> ->> endobj -623 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 472.0527 162.8862 481.019] -/Subtype /Link -/A << /S /GoTo /D (section.9.11) >> ->> endobj -624 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 454.4284 163.4442 463.3946] -/Subtype /Link -/A << /S /GoTo /D (section.9.12) >> ->> endobj -625 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 434.8663 192.7639 445.7703] -/Subtype /Link -/A << /S /GoTo /D (section.9.13) >> ->> endobj -626 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 417.242 170.0795 428.1459] -/Subtype /Link -/A << /S /GoTo /D (section.9.14) >> ->> endobj -627 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 401.5553 174.5026 410.5215] -/Subtype /Link -/A << /S /GoTo /D (section.9.15) >> ->> endobj -628 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.9477 383.9309 175.0605 392.8971] -/Subtype /Link -/A << /S /GoTo /D (section.9.16) >> ->> endobj -608 0 obj << -/D [606 0 R /XYZ 90 757.9346 null] ->> endobj -605 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -631 0 obj << -/Length 2360 -/Filter /FlateDecode ->> -stream -xÚµ]�Û¸ñ=¿Â�6iù%‰º·4¹+Ò†ݢMd‰¶…Õ‡+J·Ýüú›áP²li×A€"@L ‡óÍáÌ,ß0øÇ7)Û$Q¦RÅ›¼~Ç6Gÿõ÷ÛJHø]Ù".7Áüè_ß=ü&Ò�`a‹hóx@â±JÃHËÍcñïíÇSvîM· DĶ|÷ŸÇ¿Ñ&:áx€Ý(TZ(wàñdyøü…�¿<ŒkÛgùRy÷ëã$—ŽBÆu²‰„Uœ¤«²�HÁk”? ÓXÄ(�NCÆ$ÐR,DC Hv(Nj»_nYs&ÂD -þ6ï k…¹œ1ç, .£ 5ǾÈjÒþÓÐ<í8ۚʾ_H’ˆ0–it# m?mÆÕßgR�'V¤ŠçR-(£T§¾?ÿòððüüÚ2·¡5ä]®æg¹ £D!O<ô�Iæc`δVàÂÉ@݇[í¤�¡Ž˜|ÛÎÖ;CŒªT‡ZéyÌIécNŠKÌ�bÎ�KK ²éMS˜‚ }KÐ:#ïxœžvÏ­µå¾òPÂÛ¼­ë¡)ó¬YÛ²9zœߎÍ9wmßæmEìPŽgÍNDÛ?v<Úš-‡wŠó0�"áôk›ØnO�UpZòt«ƒ= -ˆÐºÌ»6ÈÛ¦ïÚª2� wpÓÓí'cÏŽ"í�ÏQñ™adžnÕÎxŽÀ5yNCS µ¥�˜á´“„±P”y§7€üü=´j„ˬ§ß~ñr<›=-Πê"w �ƒ¼£¤ “ênÆœNó#ËŒ¹¤üɘzž1‡ò¼ÈšŠ§¡©¾Ñð6kJjÎq•B¢�õÛï§Le˜Äqüöû©X&éNÀ²íëoèœò¢( S vòu Bº£ßúzõÒútEÌÕ—vBs/íù\a*([m�q�]VÛ…È)˜ -¡7EtòXˆK°ÿ°ìš£GÔ=ÙG4WhA2,+ôeí�}¹Ä3�Ú3® -ÁVñXn欗uŒ¡fB_ÒðkC$F@ÿŽF#jôuhîisš|](ß"¥6s¾Ku$¨#Yô˜q~O� ÕùÜ”}™Uå÷‘ŸCy"˜H6sN R¨Quú3¦¢0Uѽ2tBCù?Q•QæÞ!EW^Ê_àc]Ô°Êr³¦“f,Ý̹/�2bÝR0Д߉ÏÜm(p ×P‹¶¯Zi¿'À‚. -ðÚ$ëÊ *>ëŸ#küKµñ¦{Ó”‹`@,åoÛMÈ$”Iò3Á �Cš²ä^0šž=ÌJÏ">¡œ‚ºÐi‹[][4»Ê«°õZ^i2!Ó ³UUG¬`޶â!%•2u-ú71ë$do|Pî…m¼üXOÜz"Ñ`dÉoä{ÕÈþI—tQRWïÛ6§®¢·$Ö‡/Ÿ"—&bâm³MXw„QоÇú¶¥E=ä'ZuƶCGƒÃû¶÷N~fsD¤gà8·YQÍÛ‚1Å4Š’­�Ý¥=‰›ž•%B�¯fE¾ö&"ÔYáWnh8SZ@¸ b€ãõè=ÈM¬æï€¦{k?VuÄ8¾’�¼Yý0‡ÂÈ�—\ó4ÙÜ4ÏY:º€ÍÁnþ娌ó£®mëq¨äû˜ŠžWwqÆÉ¼áoÆx¼¹R³é²T~.…‹ë;„Ó”æ} -{[7vS~ªØ­KÎ]²�þ-AP¶·m5ôþ«.›²v~‡‹‰Ö;ÐïÁdýÐ9�K|´L1²tFpäü7zo%ò.¾äÓŒ3†´ô¹' aá%…ز €Ž:ž„„H ~“GpÝN:Í1# ƒùÊÆØÇß‚D®à{ÿõñ÷«ï~ú⹎Z¬EÞXrà•vÃÒq¤XŽÑØ•}ošW²ìÇ«ñQMO5ÆUÖÈ?ámŠ’ƒJQ%?ö¹?.+Ûæendstream -endobj -630 0 obj << -/Type /Page -/Contents 631 0 R -/Resources 629 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 648 0 R -/Annots [ 633 0 R 637 0 R 638 0 R 639 0 R 640 0 R 641 0 R 642 0 R 643 0 R 644 0 R 645 0 R 646 0 R ] ->> endobj -633 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [171.6432 525.9374 324.8465 548.2835] -/Subtype/Link/A<> ->> endobj -637 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [243.7125 430.2503 420.8261 441.1542] -/Subtype/Link/A<> ->> endobj -638 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 390.6135 195.8719 413.5822] -/Subtype /Link -/A << /S /GoTo /D (a00143) >> ->> endobj -639 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 378.6583 251.5126 389.5623] -/Subtype /Link -/A << /S /GoTo /D (a00153) >> ->> endobj -640 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 366.7032 241.5402 377.6071] -/Subtype /Link -/A << /S /GoTo /D (a00144) >> ->> endobj -641 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 356.8053 199.199 365.6519] -/Subtype /Link -/A << /S /GoTo /D (a00145) >> ->> endobj -642 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 342.7928 199.7971 353.6968] -/Subtype /Link -/A << /S /GoTo /D (a00146) >> ->> endobj -643 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [217.1719 342.7928 346.0872 353.6968] -/Subtype /Link -/A << /S /GoTo /D (a00149) >> ->> endobj -644 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 330.8377 297.0202 341.7416] -/Subtype /Link -/A << /S /GoTo /D (a00147) >> ->> endobj -645 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [377.3768 330.8377 448.1464 341.7416] -/Subtype /Link -/A << /S /GoTo /D (a00158) >> ->> endobj -646 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.6908 318.8825 181.4861 329.7864] -/Subtype /Link -/A << /S /GoTo /D (a00142) >> ->> endobj -6 0 obj << -/D [630 0 R /XYZ 90 739.9346 null] ->> endobj -632 0 obj << -/D [630 0 R /XYZ 90 553.9527 null] ->> endobj -647 0 obj << -/D [630 0 R /XYZ 90 307.8837 null] ->> endobj -10 0 obj << -/D [630 0 R /XYZ 90 301.139 null] ->> endobj -629 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -660 0 obj << -/Length 3153 -/Filter /FlateDecode ->> -stream -xÚ¥ZY�ÛF~Ÿ_1ð“D -o‘Ù'¯×Î:ˆo<Ù—$Õ5ÌC&©8³¿~¿:š—éñ‹†Íªêêêêêº(ÿÞߟy÷‡ø°ÏÂ(¹/ª;ïþàï|Eï€ßM þþp÷ý› »ÏöY$÷gæ�øû8ðƒû‡Óo›`» ƒ L6³Ý±·¹½}/ƒ‡Wï¿wã®Ï‹�Û?~º{ý0,§ÒÄaâÓbŸî~ûû?AªŸî¼}˜¥ñýg¼x{?Ë‚ûê. -B÷RÞ}¸û×ÀGïmSwBpn”²«ò²ÔáS×›ª“Yy×Ý*#ˆþ’÷n¤ SÍédNB|2Û Þüi ÅæåÖ÷6Ÿé_þ¤+~¶n�¢©v¤bìzçûû,Že7Õ­¶EÞƒGe ï/2Êåq¾•å®+òR Üil·þf¶M··º¶õ£¼8 ²céšöc'vE‰- ªÊ‹‹­Í~»K¼Ãæ×úDj%D±Ýšä¬¬+±ùŽ¡óžÌ Oâˆ-_›®³G–о‘gkª†ÎïOúg„²0mŸÛZ†-Q™â’×`ˆ�*W9"Ì[�.¬Ú']ðòI0·ŽN‹…RîÝ­¸®³ý-_œ‰Ï;c“�""?šZ[oš3=#ÑtF@ND¶! X*B˜®ÃÁؼ„z‚,Ü\²—Ïb5"ñ6ò6Œ�ø0Ï2Qì�8ŒöÆ3{ÖvJÞ6!ؘÖ®v—&ƒMºá.Ðö²lSÚÊö¼0ãzt¾°³ÜóÐß|¾˜Z¨kã)¶ë[{Üp4Ê'Û\ Öd×7;3igZbÝÉ[^;â¶é›¢)Yýq¬þ -ë6x2�}¬ùŒ½@L Ï#Ù…n~yóJP͵´yÝË+ÛžM+FR7µ4JÇ@ƒñˆÎ)§ÅÂOçæ…ÎÍ;yþîyAÛõÃ-mmzwU4ÛÛÿ2·C|ÞmÛÅå'˜z-ÂvòÄa+*·eÓò©àM|!£}S$¸šÂ’Ø…"¯Ð[ÁüY@Ž7~´‡¯È5CÞˆäÍB–×ß#âøž7—óÕ`˜$¦p™úw0 Ò}”¤ÙdÓAÀ¾OF£g÷q�m¯®),®“7¾›xÖpámsë„|0¨ïÄ·yý(ö -ä¹m*™TÊåÔ—ÉU 6ò*^„Xä -yùË{|¾ØbõÚõXº+q;Éþ†}Ü:>�Zò -fkøÝKò¯8Ð`Ô+Dþô|dÖBt¢™ˆN¯êia…|x÷ ¢¨oŒ}8 ê@E®¯mêÌ—:‚3ÙU9]�r/CŽ¡Aì7JÅ*¨š®g¯Qh¬øJb !z7ç/ñ¿Ãì\F<¼^�Peþ$Ã/¨9:¯\;òÁ¶b°3¹1xc?{8ȉãý…ˆ‡Ñä^ÐÎáÎVgßÊ'ˆ§2ÐÜV™4çž}*†ÃÅ–¥%xâ’·'I0†YÊ•]M5àV½¾Þ|ÍI0:ªw™ì3Û⻯D÷I®dê¼0†ˆK÷#b€ÓíÛ¦,ûã“#ý6W}oí4f"*ŒÎò°O‚(¿AFâC÷Ð0'öDwŠ ¹<�Øœ?‹!HoŽ eòJÆ´{~^©–DC=Eš<�SA†ËÜ Éœ>v n¥x¶’­ÝZ°Ÿ¶¹¶¾wbÅ ;„6…q“ööHÖÑ D“³Sš Àv!gRÀ86b° -åë…ç• - -ý=Ùušê�^¥pâ´f¹VsS1eß;.Ó³_±Y¶•Ôѧ‡…­3OŠ’U[ÙEÈ>Þžg¬hf×ÛÚ…Îô ùT¢3Ui�¦\/[DÊW]2&€`ݵ)ä¢Îåã¼.'³Â@2*lmÇ,DÂ¥Š^fÉÿh‘í…�c—,U,+�¨�PØ íPÓ$ê‡�å$Xħ©àeØ %nÛ4KøËËd9²ý0 EµÓ Uþ—­nÕš%Ov¿ Ã[¶Œ(|ÓS/Èi8ÏšB-1h:rŽ -»«<–ì“Åá7œžå¶q6R,eu‹žÛüÑyg†×ë±qŽòûù=a§ OÑy'9(5Ù(½ÒT­£H>/'ÈæhÔœ¼$`ÍÜ]d®>Á  ¦V²Æ1`ÁÈmrHÚV-ö\ÙUü_´@=D*!©ÎK¡j‘W^­x„ô uT:^ì©®é]ƒTJ1�ŠW-ò}lO¤ÕHÏK]pR©Í‰Þåú¥Ó…� ìhpÝÌj%x1“ì¸Èëy༒‹°y±�r71æ€Ñ­G+ !ÝôеØÑ§›m�;-ÁÊ@Ãå<œýøˆ'™w �¡Sú!ùƒ�A.dÏG_3êXë(œšâ&­Äõv,mw‘öˆÚwàà-Y^/à×”†£Ô\&»M)çø(è7¤ö¦åÚ3²ÍÛ×oˆ`/į%Ô�P²~gúÌ2õH¶7Ãé$P�TY³­ŠäªR€›zÕ&ªÆ¥6ªo¢-©N�ï�K„à Š�Æ%aË3ŸL¿]OR.Ìò¥k«1OjYæ9#;ÄAÑrE@İAwTú“DQ+Áçà’B�Ñ€'öâ`šÖšîo.^Jsä0øâhØÈÓüþà<@˜ d}³„|£q&•¢k-L†Þ Á´žIB]žÐÚb¬˜Õ¥Œ ÌV6ó* dºÖ„d¡¤÷–¨¥­Öõ/‰��z‰t÷WNé¾8Jùêi -ykZ××PÈ‹—òdOƒw¿~x�ÑQ9HÂËLy›I–¤dÂx`Ô\u»[}–^&‘å…CŸº•[lÖ×ͺV �A:u Û«–¢x¾€5sÇX·M_·ˆüþØ�“WvŸ„n͵i{9Z Õ– tÃ>²ÅVˆ}JêNVûÆ,àzéËbÇѬIBª€£|)òÅ[­ôñºlØ„ñ`¢ÀâB»îàóKJxVW¹uÉmªú¸ÊŸĉ,AŽNP2…µ(×H®:ï f±»ª”a¸Ža<Œ¿l³¨Í¼X$¡Ù“¦D-¨ÒäJäŸç±œ9ÿµå­5Ü Œ¢Í¿·‰·a5IÖžqGökg¤Á`R4ÑHÒR2NçÓ U÷_GŸœË@@]K¶#;ÓFΦèå}XfáJDº³õ‚N¾6(3‘fº’–³…VvGΑº©ê$9¶LÖ_„iͽ­¥)L�6þ�¼JJc�e,¢÷£Ù‰õlÿñR�4þRÉØŸ´5¸¹oþù|K\E–6íÚ)“C‹È¡�n…‘�Es2¥ô˜RæC@+0hžKÊÔé׈“ò>GD鬿Oïw5�׈± -ÃÈ”pF´[õUã S ¤ èD;Ž¡öŸB—;S‘ÃÎŒ@êÃh8qxD3ñ‹„ÛüôTçÕPІ܌#¿òxk%pðJOW³kÎ;íÙËÌ£tBù¬¶Ö¼~õÞ¹®‘ÝG•(Ù|°5³É¸kÕÛän ØñË{ãš´@M´Ù¹R[Šr<’ã å­3ƒ¯PBIP€;›¼'3ëšî“Üœ�è¸ÚPûÂt¤¹æ7½•eÓi†&™´·y4µióÒöOÛDÛXßl©‡ÚR—ÛÚ5Ôë¾ÝR�Öò禹þ¯�u?Ón,.ÆP6‹§€>Ø€±êû1fÛóùs"=zÉ×1²õ QÝÊÞV �–"ÏGŸñ8¡O¤q9ptÖLSsÇ ™ücKݲ•:0.�[a­øfO«}è·®nk8žq)'ÍôYf] Ö¦¥;FhWóü!²`f!:—Î_ 5TʧV¾¨û~ºO¢0üê÷ý)Á—_Â}/ÙGa�|h«¿A¼\Ë÷0 %Ûó+TßZö™yI2_÷ÕÅÚ²µjß¹«‹'Õ<ÕÄ®—œ·Óþœû%_a¾ÒÞ¯¨1Kp]Ò¯*qD?£B%ú¦ŸYkTß³+:åMV|Fu(‰›“Õïo½­ÌàN-6Eq£~ýšjþÞ�«? �Þö~'ÿ×Ï9XÁ)¦øa0ýJ²ÏaJû L$gæD¡ ÿÈŽ¯wGî>W¾sƒŸÈ núâkÅì{?á�'o�ç%j0dBîûåðiÔß{ó/ ÿhþz‚Ã]*‰~q²¢¥ÿè„‹endstream -endobj -659 0 obj << -/Type /Page -/Contents 660 0 R -/Resources 658 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 648 0 R ->> endobj -661 0 obj << -/D [659 0 R /XYZ 406.9776 658.2409 null] ->> endobj -14 0 obj << -/D [659 0 R /XYZ 90 637.7268 null] ->> endobj -662 0 obj << -/D [659 0 R /XYZ 230.4521 230.3912 null] ->> endobj -18 0 obj << -/D [659 0 R /XYZ 90 209.8771 null] ->> endobj -658 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -665 0 obj << -/Length 3063 -/Filter /FlateDecode ->> -stream -xÚ¥]�¤6ò}~E?2Ò4á³�¼%{—h#­”KFÊC�pO£܇áfç~ýÕ—ÁÐÌNt§Õªír¹\U.×øŠà�¥™_ÄÉéPuwÁáÀ?Þ…²|„õ£‹ðýãÝ7?DÅ¡ð‹St:<ž‰Â)ôÓ(Œ�õï^è'÷Ç( ¼ï†û0÷ªK3ªjœh¢xå׫ªš?‚ ªxþÃÔWc£{Ó,H#/¾ÿóñ§»¿?Î|›i| -‘‹Ýýþgp¨�ÝŸî?.òôð“À‹":twIÛI{÷ëÝ?f:¼@ö¤MÃxOÜx#nÓŒ¥ýx¾?Ƨ“Wòϵ¬>߇�§FœgÞ¥4²> Í}”zÿ¾SOÕ-Ro¼(^núë4òðRöu«žœE3[…ÄAä‡9Èg™!qpex”_Áfô£ƒ+Ü Uqj®ÿ$þþÒþ‡7¼$™DA¶æe£Úé¶´�Ñ–¹è©­Y1OŠÜô÷IZ�O³æ-Â+ÿÎ*îJÀ¥Q¥ûqÐ-Šqû³|…¡_¤)ŸØj}õïÁ"ï‘€ñ6÷¡j¸?†^U˜9W{UŒüÒ´-Ã{µÜ» >µºúŒBÅ©÷„¬OBpÙ5(x2B«”UÝWJ˜úí¢d±Ý †¨&"5€ÍˆI˜z ‰ƒµ¤„%©W^¯mS•,ΰ�/—¦ºðP°Ñ`+Ý5ý3ƒ]³§8AÓÇIÓ�ª¯ñ^pÖ•¯<¸”(9ëE¨ ºž*‹¨{3p�zÈ ®íëöd³–.$é,ëàd¬õàøI‘QýÈ#=�>ª) Mkú�,3 z5’`zøÌ€š¯¶©¡vßøðö±UÙ¶J`£žY©gVæƒ�ìpÄôg93ÿ% Éù³]7èOáQŒ`©M§€�a@IšƒÁdè\|š!+žyéñÃϼ֩ -L¼1�‘=4EÚ¥®Ì/@É^ðT8r@ôŽgËæZµå+ŸÀês¯ñÜPÄóqÏ0;¸¢ÆÆ=”½éc$L…WAî zêëã84W^@Fx¤ ŒÉ¤AmǨ8ÉÃ!,ºVØÎŽAÖ1Ð]�šþ ‚1²¨`Ù_xW«ûû#�  ábp�ûEÂô‚··n�qøP,„g/„g/´õÑàN£S”Niä§Y˜½0,þÑݰã¯oèÚ�aÕòfÔÈO~”æÉ†£mذXïñqC ù KϼïUUNf­ÂÍü›�?‹îÙMâG†ÂíÞ(ˆޱC+O¬]ÂssLà/le0ªUÙ²›Ìbpïã…Á%ì-ĉýH�Èš,®=l\y†‰V„7§Ç…Ÿ¤a¾¤�aüoù#Ów ÈG�Ï�2v”ÝxNCýkjex†÷Þ™Ôú°³“•”Ô¿äÄ·é®­B'Ez…3sÊ~¼p7éOf‰„ùOX±± -†3—�‘ÖʬìÜÛ0õ`ïIL) Y{®„(SH4*ØÇ©'긅x.ìýäZcSMm9ðÜ•Ž \ÒÜø¬zxü#àŸY]å|S[8JÁ}>;Æ,&TkŠƒ�Øç�•²Ò0 7‚�p‡9fgOc³C#L kv~(†÷ᢪÏfê˜Ú‡²EÑ­SÝ1/ “Læ‘™±1¥`ðQðF]é–J½:ÿT sÜE¸F¥È37vUά˱\ -I–*kÎDà`=XK€«ÏÙ½âx'”!ÿq�­S‘c’Ãs„dPñ"ç�Á ά5ZÁómG‹Œ¸ÁB;`Xv8¢2¤¤ì8Àä~T‚ß}7Ë~Ýr*»yb\âÄ�hî;ÁAUÊ-Ø@59'Ûôkä·C¥–tyyfï)·Ï=Ï�ª€ÁÁêG™Íçæ�¢=H�‘r. °ŽŠ�ï“6BNŸÁ?–h¹çxu}¸ÜMFv<Éd¦W³ã­ã€¥9KY9XØ8?À°ô­ósYšn¢s„Nn›Ç$Òo—¦%wË>€]¶SM*†YÉ?ìœ dW.è·Y×–æÜ.¸VÔé[¹_”å~˜åñŠ—Mæ7ã|�ƒ<ð3tâò¤W`*E‘üEá-ö×�ÞдÂ�Õ;ÒǧÔÍ�¾&ýŒóU¶”$ç�ãØF¢•CIs÷a6£FÌj¼hH8óÍìᮺ©±ýºª}šq´ñº‘ßKó|i%EÔWÈw›ÿØÊ·4FuO­-”‡ z˜óKÙ¿¤Šåd]«¿Ó#‰éqt|jFÛ˜„<¼S#—l% C.Îá6~ó Ê -Êùóå€H.U_ÉÖ~Ꞥ2Îmlp¹!¼Î�Æ !$¿É¯±:Ðü[ë=>�Çà*vüÉ¢ ম'+(%+±iÖNžÐCõS¶ë\fžU -Ê ì“=£Bª*¹.¯Ž]®€³ c‰ BJXÂ/[fG¤€—M[‚íì%*ZJ¯l6¿rÕCrd‰­©bï -¯+9)ÙØcc‘&‘`HFìᯤát•Á²~܃ÃHVêvJ±'A]׸ðúvÏŸÐ:ª`iSuPyµÛv˜j­ä‹¾±Ž›Û ˜JÛ¾“M²U¦ë·´¾ÈåÝÏ,JwEž­xŒÒ¨Ý6– â© âi´èÄðBÉ?ŽcˆŽâYÅ:è·bKÓÆ(PR½�ƒ“ŸQ¸ædž-Ò׈‚Ü/ò(_q`#Én?´'[6}�T\ù'ÕéALñSÙ—Ï\>½[úÄ+ˆmW%^—â†×Øâ¥[" È~`ÍõIèýòݧõºPÀ㣤F¦‚ÃäX8LOµò±*ù ;}Üб@¾.fwØKK`Ÿ›Vsí³×·9sõÍüäÅŽ·¤õm}ïtÂ`“͵ iMä (Ö á¼°íäBÞ=îJ~~"6´!e`‡3w°X‡Rklwý}’�¶Ñ6ßçÏ2©T q:W c‡@:�ÐŒbˆBOö¿u4²T¿öe‡®—;±.\€zSó¸«S˜€ ™*jÔF–yÍBZN+`À‰´rÜ3ÜêáÜ’ Rî¬v¿ÆÐÝÄx#ÝÖ\­B�·ê¿á*yrB£ï‹5qŽ.é‹­X>ò½ãÚ>íJ÷½²®`´8ÒW¦8pbÅ ¯m„"X#\aáæà«÷dU½žžÉì365øÅ< 0}þ¯ yœ“¥ÇØ+øÒt”Ù¶�Ì’žTj›ü1÷õv¬¿ÆžÝ 7ÖC8}ׇ�óXu`ãlÛ�݉�pTl(©˜NÊÝ‹Ô~†Áb.é­fÆ7l2šÍfûÖpL¯ÍvÓGjqu‡HŒÕ.ô°�„&ž‡_!½w£öó%åqÍù•Çò-›Wø¾«îÅúä|tD› Š¥W¿ÚÊ­-‘ÆÜ¥-laäI°ÜfÒ\¨Ð·Ø-—=;ˆqOÀå«gGŽø}3 XY}K�ãÐ2Kªá2Çëœ!ø¿¬F4]§êž$†0Åù¬Ðª—„l¥¯ÈÖ뛈À´0ºg¨F�=Ô%ÇØâFÁ“¬©ð°…%CNÿ!QB÷GUhf«Ðbýß *ÅŒ$--¤¶Ì÷¯�„É~“«ÃŒ%sæ�Çi±—yáßt„~˜d»µx)ExJOÿמÐÒä°%Œ#÷ïhN~‘ŹýÃa/áGÌoËÑË6üd?¡2&™„‘üßFñ·QÀ³(N<"=ëaÓ'}A|’lêoúË+äÕ[õà_Åìèç¿=î|!endstream -endobj -664 0 obj << -/Type /Page -/Contents 665 0 R -/Resources 663 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 648 0 R -/Annots [ 666 0 R 667 0 R 671 0 R 672 0 R 675 0 R ] ->> endobj -666 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [301.193 726.8189 348.017 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00146_ga4360412ee9350fba725f98a137169fe) >> ->> endobj -667 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [328.2665 649.4187 387.2547 660.3226] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -671 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [214.0892 410.0069 279.1746 420.9108] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2addf34c7d457c1a7899a7e2171ef1e9) >> ->> endobj -672 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [296.7031 410.0069 366.2118 420.9108] -/Subtype /Link -/A << /S /GoTo /D (a00150_g85b65e38aa74eba18979156f97a94a87) >> ->> endobj -675 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [156.7987 273.8799 207.4884 284.7838] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6832e4d2d046536b6472f7ac92340f68) >> ->> endobj -668 0 obj << -/D [664 0 R /XYZ 271.0497 628.6614 null] ->> endobj -22 0 obj << -/D [664 0 R /XYZ 90 610.6547 null] ->> endobj -669 0 obj << -/D [664 0 R /XYZ 247.6771 537.3319 null] ->> endobj -670 0 obj << -/D [664 0 R /XYZ 90 520.446 null] ->> endobj -673 0 obj << -/D [664 0 R /XYZ 418.9827 401.2048 null] ->> endobj -674 0 obj << -/D [664 0 R /XYZ 90 384.319 null] ->> endobj -676 0 obj << -/D [664 0 R /XYZ 244.6786 277.033 null] ->> endobj -26 0 obj << -/D [664 0 R /XYZ 90 259.0263 null] ->> endobj -663 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -684 0 obj << -/Length 3355 -/Filter /FlateDecode ->> -stream -xÚ¥Û®Û6òý|…Ñ'ˆUQweŸ’¦[¤@€lÎYìCÛY¢m!’èèғӯ߹Q[IXøAäp8œÎ�¤Õ΃ŸÚeÞ.‰7 ÂxW4Þî à_” `ü°Dxûôðã?ýl—¹YìÇ»§Qˆ•ùÊß=•¿9áþø~;O½?ø‘çŒï?rãé§�?Úv?äÅçýO¿>üü4-'ÜDA¬p±/¿ýáíJàê×Ï ²4Ú=CÇsU–ù»æ!ôÛ©þ5Ñáš°%T¤‚-©‚©|è&,T~½ÖU‘•i‘ý̹ä=7®�)tß뺱ç ,tæ”ù�» Š q>îUèäÅ^9Ÿ÷ÊsôÐ[Ü|`ä¼ëª½9îUä�ç‹–µ˜&L¸ã¢Z3Qµçå á‚ç6c/‹5ª4qPÊÍ¢ˆ%ü2êQ—¯€c•9º -´½Ø9¾ð—h^ä´zxF9L÷™GJM¼W… ˜oÍ\#ÂÄ¥ÔÝ>ŠÐX˜$΃Ì┩ևâR]yÎÏȰÀÃ…i‡ÎÔµîz¾ä{ß³zÜÓ´­Ð9"îxBNB!”] ¼vE3¨Î»½J�³tukÆóE° ã"#yÕ2� À<�÷Ò ­É¿VÍØ0¬¯þB³ÁæRªÐ9uy£{Ò…rÞMJ[2¸M±�2»è -k2È,“M°†™M¶›zí·ïôcqa´¼çï§Çƒø2ÃtC/˜EÞ2Ba®h/ŒRµ…iÈüpìø2 ³8Àúºüéõ5ïòAXYëŸ1ʱC:[·¶~?^X=:šç;ïO8�ˆ¬€q·Á$=!Úi¬kËÔ¥ÊåG¡�ÍÚÀÉt®Í1¯º2¹(¼óı‰#”kpÈÉÒÂ’<“•<”W÷æ›4„×p‘¹#ç¢ó�icû 9`ê˜q8ñ¢tJ…ÿn<4½uê6¬-{™÷ÒæMUÌDÈY}§Ôä/ÜWKg²`àƒP±p3�YA3ö ÛdñðmÀ tcÈÛ¡;öìëÐdM!Œ ¥¾Ê®C6›¯j™J<₼òj¿ûõ¢ƒebUŒXÉÊ - ˃>$Á ÝIöÃÉa¡Dh êÀ|:­f6Z'¦C}¡ü°�Ëh¬Bª[~÷<ÿ�Š ¦ã�Í"Ú< ñKm ¼ˆÇz™BTÝ·-+òxhTVŽÅ`Ñ&JRÎÔ�Üj9ÀX˜ïyR¾ÈÁkQö È\{Nå�Ô:|è#Úü¹wFXÃiRLb¨…?«R˜§ÒúëÐÓ°Ï6ZKQO†=\:<6_iùÙ�¼É’=)éi°^Í•@- ŠËcsd“ó¾éeÞÚË€AººR¡„±�·<Àoè»i˜q(Wn¼?(N¡opñõm‹ç|$—2pT“ØñK¦S^HøÝ‹¼7ßÃGÉbË%XËOÝ8Œ³9m¨,qÞ,—QY -ËÈ8ÊK`&¦ep|¹ á”·�Â%v‡‹ RÇyÍ×ë%¸¯v½Ô¡*0/¡Åö·š/؆UÛzÍÏB‰öxãAW9>“á8ÒÈ\jeh�,ŒÀy S�@ò/ÏF(h¼}{~ÇíÞ,Ê÷%)›¸ÆüÅ‚xà[³öï¶ú*)5ôß®{÷—d·™Ï×°Á¨¡T\IÀ™ó¡*:Ó›ÓÀÝÿì©8•co¿>¢Ty\n½µòÑ•üŒÏ�‘ë{DÌõ¬6ó;Y�§ŒsMÞB•@᥸S"¯x!ÄC§Î4 ¦x -�±…Ê´~á|‘Hòþ³@ÇÀqÌÏ"°Æ1ª¦Êy¬¸ÊNì†GÀXønÖ¯ Ž„…°•@Nn!»`8¥s7E·A"ãö`ÜÅE[bãQL±gvûd¢Í7Öê¯âô±=+Ûã–ðÐ `ª�î-‚1 À É ª�‰l˜z%èµ¼¹Ol’·!µyx#ìÖ+v%:½}|'ari4‘Ç.?‡˜Uõk§a�¶™!òŽÒ¸Ž$@Ýo^„0¿| ²D.®å�ÁÃ`½l¦ š8ë¼–›«Î f–€¤Œ}N™È/e<Ô·ƒ=$ö(²™q¸¹a¿³5& €Q¼0ܲ>²ñ$8˜ö„<){.ó˜9O9?t9~þ�»z>éµÃá˜KxòmSöšg -‚ -öƒ*hIz<Ô 25#KmH·Êâñ¹ HÎ9Œ º=ð,hÒÈõTšìü8v“0 6ŸW,Òa‰uÿp”f.K •¤nâ©òQÛ*»îÍëÛå•ç»Ià«ï®ºYªBhÒBº³ }Zp©¼ÄM,»Áæ2oOxòùñ^µÀt]é>ç–í4q£„ÿ®Ú’ÌMã,š=ÿâ?Üá�›d�ÿwü[´‰¶ØþŽÝ(u½$Ü-éÞqk‘6V‡Ë:=¤ù ¼0Kl�å*©²î_»\*>t‚í -Œ+öGo|4X¸V€FMÖS¡›9=D´Œ³r?yzXÞ¾È3ÇMpÄ™Ïm_ZËÀª¨¢y=#C`ñÒ\ΰ­”–0!R_¡<Úö¹¤Ð='m›ãxxŒ¡({ƒÔÒ[>’lqý�׆„’@'°ÂRa;Yò‰ÝTÞ…` çîOÜ;�m!k¥ö=“¦ v�¯ B�¢VkmŠ7ëƒÞe ­>¨s§¼YfBTX³_¾ê·b�²�«Ð²÷�Šƒ,|oÞ(èŠ*7§p%LW}ЂSÞaªØ<•º^Þñ‘v‚€7>�ªF^`¡I·¼Ãí -üi>ßà£Id™Ä¡œ?­–cÔ�ûÄ>6˜}lõô kŒW!i„‹™4Ëo loQ)xð;]° =šÅ 'ö]¬»V&ñ# Ð˶ `¬LYáξĈaEr׎�YVèÈ£Ã÷—²GŸ ÖµJM¯pPJšV39:RUˆ`ë ÿØBPùŒàJæ�Wþ²väA7l¥‚�ax¡ˆ>‡!¬lvh—•½ºæ ãËÇ« óû yJ†‰´|oéàá×Ð Jà‡\È l}iÑ|,!ji¬ò#yVŒäb iÚ•á¨É� u~IFÆØÔ±-¿ÿ‡çNEgÝS>†^.ßÞØq ‘çp5Ÿ5M*üì.ÜΚß�^qàž¯+hòÃpRÕØùôzŽ�£ŒåP°/ÂYùwßVìRnH¨íUŠœ^Ý­ÿÕ(W…ÉæŸ|<Ȱ*Žâÿë/7ôO¡¦¨u)»Y¤˜¼&âÅ‹e…ûE·x´G{ÕòÁ6~E¹Gé(_¾Þk?xí{Üó=/–s ªÃžM¦šB¹‚x”Ë¥wæëËY··JÂmhé¿Ô¦ë2endstream -endobj -683 0 obj << -/Type /Page -/Contents 684 0 R -/Resources 682 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 648 0 R -/Annots [ 686 0 R 687 0 R ] ->> endobj -686 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 263.5952 188.5792 286.564] -/Subtype /Link -/A << /S /GoTo /D (a00158) >> ->> endobj -687 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 253.6974 159.0703 262.544] -/Subtype /Link -/A << /S /GoTo /D (a00142) >> ->> endobj -685 0 obj << -/D [683 0 R /XYZ 412.7165 467.575 null] ->> endobj -30 0 obj << -/D [683 0 R /XYZ 90 446.1709 null] ->> endobj -688 0 obj << -/D [683 0 R /XYZ 90 242.3602 null] ->> endobj -689 0 obj << -/D [683 0 R /XYZ 90 236.5671 null] ->> endobj -682 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -692 0 obj << -/Length 3453 -/Filter /FlateDecode ->> -stream -xÚ¥k�ã¶ñûþ -£_*±"‘zæC�ëå’n�¦ÛÄE>¤A K\[9YrôÈfóë;/Ê’¬½] 8à̇3ä¼)ãÁ?“z›8ŒÝTÑ&?ßy›#€¿¾óezó»)Âß÷wŸ¥ÒMꦑŠ6ûG¢ùn¨|µÙ?9¾mw*ôœw[:—KUæY_65Ú­Ÿ8ͱÍÎ ¸¯{Ó>f¹á?ÿë…Þ»‡{øñDAà„ÛŸ÷ßÜ}Ø�L Ï¡Ž|dé·»Ÿ~ö6ðþÍ�çê4 7Oð‡çúiª6ç»@iûGu÷ÃÝ¿G:â!<šÖÔ=‚Rç±mÎ<Ùô'Óòpÿþás»¶ë³ü£¬/k^ÔŸ²^ òۚ߆²5‚w2ÕeI¨ó ›ÞžNFèMY-Áž3ˆ¾ó}7 C©o³º;—]«;w» •vþ%Œ+ÿÊ8ŒGÆa|Ø*Ϭðó„!˜š}o -YŸñˆ†ß³97í3�‡º/+YiILVÈŽëw{}#Œ˜5©º!ÏM×=U›¨(r -S•¸þ÷­:p]ƒ‘ ýâÆ8h�±^Ʀ¬æq�•7umr�Çê�ŽÖò>±wUlõ -S%OgGw¨*ŠN¥ £­eB$°«®Ìm1tŠ»�0ŠXry…Ë>yO<.ï ùÉP´WVkxõÌ­Hd™ÆÓgÕñ Ilô/ƒYO`ÐegÃbº4Iê#öí�¥ úÚ †tZ—„Ñ)ÖÎWœ]‰‡S�þº CG6‡¨ZH‹zŠXÉT¡VÔ-cbKŒ0JL¼HÌ…X$ƒ’l °N„<2iåÁ)—DzÎ*.šK?Já…µ6 Js›y&|®‡Û§µï:N9ÊÆ ¦M'†d `.ž&ª[— ¾AåMax’4 CGA ‡¦²žcòLë0ÌKÜÃmkY211Aã”Õ6�œwU× á%!ÊЭ‰Yž/M WN±HKXQxgF §ô2#H0h†ãÉâÉpZCV1ÂM\†ùæ‚¡jü“NP!KkK:ÄdÏóÝÉR¿^#…]å[ÑK"ØŒ4À(Õ] :•ˆÍý3ORÚؤ4°)%ÃÙìˆÿâÊa¶æFF˜�b ¹lKÚÕÎièTòæ|©È·þ!ìQ4\ s6Ê–¥%GZ‘ÉÑÀ`šŸµ%¥ù˜8Õyk²ÎØ”(ÏûG)k¦ésèI¢xŒÆÁˆéZ$ÕônófQ:ƒh:‚Ê4Žlåìú.Ô½¾ç½P>ø�xÃ\€Éé99º~�ÆDnoï~~R¤pC×ó”½��£©  drCÿ¼gèãPç¬{‹’\{±›øaº b�"V1WÔ8ÕçûIm=âï¦ n ì[º(Ùî~y÷ððþÝ·ßb¿€šK†âÔ�£0Z0´(ñG¬×ظ¡†l|Ƈ".N‰“å]%Ð\o›iöÄ'+Æ2õ+lË`é–­©æ7y>´˜_Aà|Èȧáb=�8÷‡•XXWËö/>fzÓ ²½S�³0°¨â§q®áߢìÐëewbÔƒéŸ(©äÙY˜»a±s×+k�ì�ùA:Þ -|®¡8ÓñÄ{þóœåm# FOeUñ¼ðÿeÕ µ•¸9œ-¹§�°?M+ÐF uSïŠþ ·ï8:„Ñd£Ü@)WSž¹ôØ%ú†xU— ¥ãaÀN6õ¯ã¥ €S?ºvÙî ÑJ׸˜±$¾ÃºöÄ4%ƒ˜n‰‘f–V#¬ç_Î0âÜ (ôåÙ" óWšëAu^S›íóÍîO‰ûÛ[?ÿ~ì¥HëLÐ@üW} $ø� ¡�¿ô†Jb%§æìþ^øE‹ö}ŸMÝV?VÍ�¢<Y©Ú’ªÓ¥ò7 ½d£#å†^ðª_´ø»é‚‡tC—ú�åål=Ýp†n -µæ‚‹¥3´X¯í&®ÖI<ß›OQI%ø’A(‡’é9�qÁb 7 -µ~ëA�ø¯0{K÷SÄ¡ëÀÿôA�X¯í' ‰¾šïÝõí9bËi7ö^ifBœG6•ŽâIKÑN�ë�DtµÜÉŒù"|‚d¹’¶¡’Ì9’ôéYm¿n’8ZË-ÿ‚ž/Òb”€eœ2U![a¬¾’Zj -‚E)è�ç†A½v³‚¾›â¯î’ª½W.¤w�'dfõôÊ�û^êê( U Ó X½ók7E»eË÷•ë�…\©Íïœiy»ã®_5ynC²Ü«q�. ¥x�åóðLËlxŽnž$Ô™=��™k$‰æ'‰å?:ä@bhˆ}WÊIDyüfE‰GÇó’¹sù0Š€úŽLqÿŸjYÓ?_ÀiWŒ%9»ô¤ÖiqJ¢Bµ»ê8†�Ý>�ÇáÃ÷çácš•üm%ÂÄn€óó¡ÂòK3~¹’:Íwª†™øþýî¨õp>˜VÞ¸ñ‹çÞÃìi&ž½Áå-¼ù)&“NÌ] ƒñ±B5Wà)ç+ü›n6ÁjÛ¹ùŒ/X$šÇpê‹-Ú¡JÇc‡[GWvµ$RˆŸË$¥g: ýc¿`Š3&Â0CÍlmkU@°Yša8•©þÔ½ißóôR¹–7ßn/Œšß¸n×ò ÄYÈyŠtìµ!þ‚KXdè¶å.mùý‡o¿û°çñLèI,g§Bã¼�RúÍ™“–Ìé{(zK4ŒßÇZôKÌØ^M–è‘JÙT _ÞÈŽÂÕ€ÆjaéEÏ…º(Ø(•º�Š‚W¼üˆ¿›.Xñ§7t­Ÿ—4“Ñ—Š@>Ø®L-\ûˆõ -+*ð\Àˆæ¬pãT�5:Q_Ïp|0œSÃǨX§íƒ&fÖ \Â)%=z�y=‚m³K2eRJ?gJ‰gV,M4­9!cã ÆìLKüж•¥'­,\÷ $ €ù®üSFl¢Áuéu76¯ÀiXpõ…Åm¥}6ÝSúðÁ‹Šfã¾òcªqõÖlbŠÿr61b½%›@!+S¿¤}>ØVàEñFy¡úëßWŒH» ÖŠ,iáþt6)Óãû JåÐm# +¯§š_}pvZå ˜�e¥TÐ*•ç ˆ·ZØ™]ÛÄ€�=ŠZ�/é2~xÓvƒ¢è¡­;y$A?ËîÕÊì]ÛÆ‡›‡W=úF¨Îðùó×4R�%?R´Q«([°BJ¥ÜÔ‹ÈTÖycß–ø Ÿ8O»�(•¾3•Ä­¼¹ 7~~‰Ö‹O•ÜX´ï·X~Y�0yÕöœ*ë- Rì}Âo ��Ææû›C×ÙÄìbüCNH‡Jžñµ«øuè¨bŸçpvt¤&Œét:) ¦Þóˆ^,§Hó�OûyÓ^y¡/Bf X30ì–•-Þ?ýÙÁ݈Ó]øs%?‘ÌÀ¾#äšÉ”s?€>•u16Òñ ·êKn¯éΔTK�|Ò7„äÕåo$Øæ‘йx·„½0ÀnyN®~¸4 Œò)Äø¬£ŒtcÈ€‘„<ñûØŒ‘EÛ_�mmÛþzÙáZù|ÌÕ�W=²Jîcïõÿù²Œ>›ƒÌEûZM¿š‹Ü4Ö‰ýrL˜ÀóþZ¾`(Øèl¯ëŸvð J2Ⱦ’_ï ¥¿PždŠž'ÞÑÍ[—À±]A<È[È—ÍÏGs`ñ³·•óù©{òendstream -endobj -691 0 obj << -/Type /Page -/Contents 692 0 R -/Resources 690 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 648 0 R -/Annots [ 696 0 R 699 0 R 700 0 R 701 0 R 702 0 R 708 0 R 709 0 R 710 0 R ] ->> endobj -696 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [306.8197 468.5196 380.7619 479.4236] -/Subtype /Link -/A << /S /GoTo /D (a00153_g41aa744caa46913b3b3aedb2a4e78546) >> ->> endobj -699 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [317.8545 359.3516 356.9278 370.2556] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -700 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [437.6571 359.3516 476.7304 370.2556] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -701 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [490.9727 347.3965 513.9963 358.3004] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -702 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 335.4413 110.3636 346.3452] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -708 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.7312 226.2733 239.0183 237.1772] -/Subtype /Link -/A << /S /GoTo /D (a00147_g26a14b8dae3f861830af9e7cf1e03725) >> ->> endobj -709 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [490.9727 214.3181 513.9963 225.2221] -/Subtype /Link -/A << /S /GoTo /D (a00147_g1a1bc437c09ddef238abab41d77c3177) >> ->> endobj -710 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 202.3629 126.403 213.2669] -/Subtype /Link -/A << /S /GoTo /D (a00147_g1a1bc437c09ddef238abab41d77c3177) >> ->> endobj -693 0 obj << -/D [691 0 R /XYZ 90 757.9346 null] ->> endobj -694 0 obj << -/D [691 0 R /XYZ 489.8655 533.0201 null] ->> endobj -695 0 obj << -/D [691 0 R /XYZ 90 512.29 null] ->> endobj -697 0 obj << -/D [691 0 R /XYZ 153.1029 423.8521 null] ->> endobj -698 0 obj << -/D [691 0 R /XYZ 90 403.122 null] ->> endobj -706 0 obj << -/D [691 0 R /XYZ 243.1544 290.7737 null] ->> endobj -707 0 obj << -/D [691 0 R /XYZ 90 272.1009 null] ->> endobj -711 0 obj << -/D [691 0 R /XYZ 239.7767 181.6057 null] ->> endobj -712 0 obj << -/D [691 0 R /XYZ 90 160.8756 null] ->> endobj -690 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -719 0 obj << -/Length 3312 -/Filter /FlateDecode ->> -stream -xÚ¥ZÝoã6Ï_á·S€µÊ‰’Ú§^»-¶@�½^€{h‹ƒb)±°¶äJrÓô¯¿ù¢¾,Ç‹…)r8‡3¿FoüÓ›Lm’8 3¹Íîx§6ÏÐýã�–á-Œo§ÿ|¸ûê“m²0sÆmžˆƒÓal´Ù<¿î~k�±.xØ—÷[«àüé37¾ûü•ow}¾ûrÿûÃOw†åDšØ:�‹ýq÷ëïjS€T?Ý©Ðfi¼y�ê,3›ã]d¬ÿ8Üýûî_  k›Šµ]Û•]ìÊÀg›Ê{”Ú=ïÉm¹+«{Þë8(ÛûHx(¯‹± òÓéPíò¾jj&9æ¯S&},ËšÇ<`t}X@ K2¨j'»™Yؘ'¤´§-´å窥]ÚÔ‡%j•ܘ_b™°”\º!ÎMVæ¾SÞ -»J¨À$Á:Ž|§¦ËÌÏÏC¹à?ûRæñ‰Àr`0Uq)n¾f¤é÷ùÈÚÓÉkuÂǯݸpß“õã±�^Ä(œ5ÁFš£þ¢¢pS^*B!л’dÙ4 ÓLe›Ø¤aƒÿ½&=ýv:aL^ðõ¡¢%üÛ» -)m -ÞÐè…LKHé©nHE*4N§sI~SÊæÏr%acÁ( -R.ãÇXæÎ,Ôg[*�xpqÍ1²t~ŒÌ¹x#…Z;Öã™â‰FxQÒ…Ön5IÀla¿Q–†iªn&ÉB¾�Ò¯$ÉK®ï?<ãâ0¶‘YH´8¼�ê– ´•fsAƳœ„ -c´[ŽŠ¢F—¥%Ñ›nA.ª¥Ì!ïøãÔŠãjÎÅ~í$^oM–?`Ì'£Ð Ë4?ìþØ;a"̇ù ��@&]„jÉfs׃SÙ�^ZS*Ö”x§ŸEå�¶xâd@%é´^�Œ’yüе­ž«Ú— ÒA+ÞX4`�€±¶%FRqáÆ‡D½ôÉ:cèŒ�G¡xiÑŸIg%¿×2 • IòÊ}þ |•'Èy¦Ä -écŸ—ù×lØã¥øq"TV4|‚›–›ec2éÔó$“úŒÍ*|{è(Ð[CðGIü=žšZº)Ý�_87”Ö Ö}å x5Dƒç½o—ÜÒ5³b0Þ€yų +�g—·mEêILМ{np=F{d3+Ôáþ’„÷# �ÌH -úp²z¬U/|pL‰¸ÈÉ} ÿ~©ã„/O猗˜ÉÜÀLVÙàwŽaSäR0ÕsÇý˜í…f×Ov`$2%elHÇD‹Z%Ž0âÂ!N½æã»²ëò¶:—ªИw²Îc¹ËÏ�ð«dΤÐ2Â}RVv(�…“NDš!˜+«[Ë-”$6›dN²ŠïM70ûn€ÄÝͬ‚“f¼¸3}áÅ–´Ko±±;·ì¨ècšë Ê7Èg$ŒŸºÄ*Ö…*i¬ƒHž‚t7°Š§ßN'¬`• ¾>ÜÑ^®–S¦�Î¥Y–…è–iª(Kæ"çvÐ 9JH£ëë`fFýa*¦ñíAüÄ.á<3*IM©ªÂ5ø±³È�¦E?~(sÎ�étD¹’JƒO5w6máK@~²`+a!Ež'ò÷=—£"ÈÚ1¾Œµ¦x_ ãX=ï¥îÄ1Œk-+l¨=6þ )ûl—HSþ~•Þºf^,Ô3Z‚Ÿ4 “$ÛØ( -ãÛ/B½��¯@ Oo›´¥«¶i£ÐaAa&ÉÒ6=ÑÛX›„*Óf&�O;B±²Hhfð–2ç(»¢rØøŠ²!³TbNÒ;+Á@dæH¡ ýÃb¸/}æê#\/ã"ЦqX=r·\ˆ§ßN'¬èè‚ïÌ…¼Q=OCå€|.ÏEõ\¨nH 7s)*Ñqßž©¬ Õø4¹xºá¤Ç -—yÑ<cˆCþâ U5ÄFcÐUœOï�LÉPïB 5\¶�-Uö›ö]¡‰ª[�®s™K%ã#öNœ~’Ó鄎ÐöríWaät¢Ê ‡\hsþÀe¬Rm*i)7a%ØbQäU“üƒxâ}FËÇ -‰jÈØ/k$|Iì› -«Ñër—_ÚŒ°f¾´�´\ËÄ–Ô±q°i¸qN›º«ãˆh„Ï>—¾Ô4Æ{#t–\~´l -OœÀ¼õ¥{h‘€ßÑ÷jë»L<ìÄ1AèK}†½B(Š•7è)ÓñI ?Ø©LXw·8NÁEÛtAéø–ãè·Ó +÷ù‚ïÌù_w+øÀ?—eí/Þ^€Ò€íá(æ\ׂÎI­Á /ÜÀ&çŽ5ñ•Ò‰\¬›½ì+þÛàp`Þòãë Ø^¼2Ê>ðáå Îbºv'4RT¾|w‰'ï.( ÷‰Š92ãØ¡©ŸC~|ˆ€ñ½±æ×nZ%„áMÂúž —åÓ¸^Ä�¸.EÇØíÃ�Ü€œ/Ö H2ñ—Ë$# -“w÷ÙÊãbTFZÛØåsâºÉX¤€½Ô:Ë…B£o¿°øÉ5¨ÇGä±®‰ãÍð\,Ÿ–ÇdT¾Q’—ÊÇþÓT*\û+B f=›PàQ´‹Ýÿõ†ôg)LÑÖLÿ,ÒÄ+ôwn01rfÏãDzÆb¥?¿ÙŸ}ã'ÔçY>´‘_õµ±_Å_F)'!OÀGÜáo,u¨æGü}ó×ësY¯A¤-ýª'endstream -endobj -718 0 obj << -/Type /Page -/Contents 719 0 R -/Resources 717 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 648 0 R -/Annots [ 721 0 R 722 0 R 723 0 R 724 0 R 727 0 R 728 0 R 731 0 R 732 0 R 733 0 R 736 0 R 737 0 R 740 0 R ] ->> endobj -721 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [278.2206 726.8189 320.0632 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00147_gb5fecbc62edd128012cea0f47b57ab9f) >> ->> endobj -722 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [302.4389 697.2393 347.0412 708.1433] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -723 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.3885 697.2393 413.9909 708.1433] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -724 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 631.7943 133.6061 642.6982] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -727 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.8947 525.3067 439.0984 536.2106] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -728 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [214.3267 495.7271 266.5304 506.6311] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -731 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [335.0564 365.3292 381.8703 376.2332] -/Subtype /Link -/A << /S /GoTo /D (a00147_g61db1dcb7c760e4dd5d60bf4e5576dca) >> ->> endobj -732 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [288.7827 341.4189 335.5968 352.3228] -/Subtype /Link -/A << /S /GoTo /D (a00147_g88d2ccf7cd821f89d9a8df7e3948b56c) >> ->> endobj -733 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [367.2687 323.7945 419.0639 334.6984] -/Subtype /Link -/A << /S /GoTo /D (a00147_gef6c4140c632b6a406779342cf3b6eb6) >> ->> endobj -736 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [457.7775 229.2621 513.9963 240.166] -/Subtype /Link -/A << /S /GoTo /D (a00147_gfbd5fc486dfdf6bf6fc9db52b1f418c4) >> ->> endobj -737 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [105.8804 217.3069 167.6481 228.2108] -/Subtype /Link -/A << /S /GoTo /D (a00147_g7b2ac4b18bd2ac3912fe67b3b17158c3) >> ->> endobj -740 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [175.3388 146.6848 217.1815 157.5888] -/Subtype /Link -/A << /S /GoTo /D (a00147_g58bb90796c1cdad3aac2ecf44d87b20e) >> ->> endobj -720 0 obj << -/D [718 0 R /XYZ 90 757.9346 null] ->> endobj -725 0 obj << -/D [718 0 R /XYZ 479.8239 634.9474 null] ->> endobj -726 0 obj << -/D [718 0 R /XYZ 90 616.451 null] ->> endobj -729 0 obj << -/D [718 0 R /XYZ 207.8864 427.1492 null] ->> endobj -730 0 obj << -/D [718 0 R /XYZ 90 408.6528 null] ->> endobj -734 0 obj << -/D [718 0 R /XYZ 237.0374 314.9924 null] ->> endobj -735 0 obj << -/D [718 0 R /XYZ 90 296.496 null] ->> endobj -738 0 obj << -/D [718 0 R /XYZ 299.1932 220.46 null] ->> endobj -739 0 obj << -/D [718 0 R /XYZ 90 201.9636 null] ->> endobj -741 0 obj << -/D [718 0 R /XYZ 507.9991 96.348 null] ->> endobj -717 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -753 0 obj << -/Length 2416 -/Filter /FlateDecode ->> -stream -xÚ¥Ym�ã¶þ¾¿ÂÈ'X«|ÕK)�¦išÃå’öÜöÃåpÐÚÚµp¶åHröEÿ{g8C‰’µë-ŠÅBäp8Î<œÒr!àO.r±HmçÚ$‹ÍáF,€üÃ�äጯB†?­oþð•/ò8OT²Xß; ‰Œ­’j±Þ¾�dœ.WÊŠèûÏÅá´/Ûå‡õë…‘Y,d–‚TdJ‘xóýº_ˆõ°:‘¸Ìo7ï?ˆÅôy}#b�gvñËÌôLÏk¡ël¢EÕ²iš3©ºgŠ·Zhlg¼Ç¥àC:ªÐ¯ŽK# \>á˜;·0ó®ÜçÖ‹¡Ïpò¡8ÝV¦¬"»S:i½–bi÷~OãD‚ÿšð!Ç*#aSøÆ®Ü|¢&£ID{ -@HûUUî·Ô©ŽãÔ/©Šm -±2±26Ƈï'�Òó¯Â 3>º�Beª…yœX£'ZLàÑs]Y[ƒÍ­…„6Z»dlºsÖíêK;2éq‡á{³£Þ`ÓÎ{%8ïòÂõJñ꣓aŠQÊPŠÁ�¶ìZ&€.ˆä4òÓŒ˜¶]hŽâ©�Õ~ODÄÄH:F3’ð$K�èS¹©\LbM<3ù®Øn›²u[Èý®r_ViáååhÈâŸ;êuÕ�éÄ ÅD£œÒƒ“µß—,×¾ˆd)%z §®/£¤¶p’¤± k±HÇ_C.ó¯Â sÈ�Ê})r%Û&™*4…®çº¢†‘*N´Ðc5¬‚‘šbçÑ»†,uª¡¤.†­b!£”ç�`gS�”°˜2 kTýPö_)Q˜}òÏ”(S©Ïå ‘C“Nt˜˜±çº¶4XÏb•:Z;È;hº°E\c8Ú6Ä-ƨI~¼ïÙ½ˆÂ7ŽlÜû¦dŠŸùË9Hí¾îÚÛÉš�o¡ç}ëü˜ð&Fóí?Þ¼yºRQ:yº5®…r7@ø¦É5/3û*äŸ1õTª÷ruÂòÔ±‘¹†Ë«Î&ÚLýí¹®)‘ÛØBÜkq(¾�E\*Õ6‚ÂqKw€r*°ä@ŠK»Ú…Cê÷:p¸xBç­Ü¹:‚©å¾<”ÇŽFd²º«:€«ŽWbXÜE;T‡C/¬þÌ�€‰hBâ¡ë„/+X¶óhXf"êULUDašß#Åݱá{n‹‡’š„gh´»Ú…#uïÊ=õ—‰u©4Mo0ˆÉ¤q· ñ2cI¼(÷¨Ó±nœÎRªèS5Î#¥9h¸D4“¶2‘ ¼¡ñ |ÉaÐhÊCÝq»t mŽksn25vÂ`,‡boxBáǺóÂëóÃŽÚ¤ðHõ],`a5KÚ{#�6F`Ãh­‡¥µÉÄA„_„;ŽSåG[3{ãÐÜ!!š GI¤×®¦=ÿ*œ0sã¸�ûÂ\ªà¸gI2Uhz7õ\×Ô€+²ÌÒ‰C¼ESõ¹í…¡•È®àq&ݱ-{\ ujøŠ¶¼â¸”º°º³§Îþ4jgJ& cR˜¤®ÆeÏ¿ -'ÌÄÄ ¹Þ N¡'s -W;£ÕD�i`ö\×”¸�FÅødÑÌÒÓ¨Qîªã‡Ø‹µ=ó*䦥“¬’ -ɯ˜=.ú{]�Ñgö�%Å)ùîöhäp&q\ÿv>…ê6Øg›ÄÐýµºGî ž}wõdž2ß-‰ùëúç·ï�CJVøæú"î^²î…ï^qú˜áýÏ•¡™+j§*K†ZBK¼ÆÀž¶Ô…v-“0´ãxÚ±ãb‘ô7ä.ˆ0D09¾­ ³zÞþ®²¡>¦>ürꃠlE½å¥Ê¦ÁŠç»§V ôL¦8Û’Ž¤»�Y¼ÒTü*ìôI¨BE[iò—A5äž…jÏð,TÕÿÓ³L>vÄDˆ|¯>¼êM‘AmžÏk#ðÊ\ÝÊ$»·rÀ›¸ep ®cÿÕudæý~šPħÒÚáÇ÷þº2ç Š!!Îγ&GWV<ŠÕ‡�L~>Ü• ‘\�4z«n¾°˜Š ã__pöðBˆÐÔ"çÉäž ë€-“¶ÜGª;|â­È‹¾lsß?ן¿<”WküQuÆ>ÿƒk~vendstream -endobj -752 0 obj << -/Type /Page -/Contents 753 0 R -/Resources 751 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 770 0 R -/Annots [ 756 0 R 757 0 R 758 0 R 761 0 R 762 0 R 763 0 R 764 0 R 765 0 R 766 0 R ] ->> endobj -756 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [428.3065 701.7853 476.2361 712.6892] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -757 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [196.5367 677.8749 263.2659 688.7789] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdb971fb1525d0c5002f52125b05f3218) >> ->> endobj -758 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [271.5773 648.2954 310.6506 659.1993] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -761 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [351.7077 575.6896 409.0322 586.5935] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -762 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.0182 551.7792 411.3428 562.6832] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -763 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9277 539.8241 153.001 550.728] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -764 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.3947 510.2445 194.1901 521.1485] -/Subtype /Link -/A << /S /GoTo /D (a00148_g87f0b54ade0d159fba495089128a4932) >> ->> endobj -765 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [237.5384 456.7547 294.863 467.6586] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -766 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.8254 444.7995 180.6394 455.7034] -/Subtype /Link -/A << /S /GoTo /D (a00147_g88d2ccf7cd821f89d9a8df7e3948b56c) >> ->> endobj -754 0 obj << -/D [752 0 R /XYZ 90 757.9346 null] ->> endobj -755 0 obj << -/D [752 0 R /XYZ 90 739.9346 null] ->> endobj -759 0 obj << -/D [752 0 R /XYZ 150.7616 639.4933 null] ->> endobj -760 0 obj << -/D [752 0 R /XYZ 90 621.4011 null] ->> endobj -767 0 obj << -/D [752 0 R /XYZ 90 253.0714 null] ->> endobj -34 0 obj << -/D [752 0 R /XYZ 90 246.2021 null] ->> endobj -768 0 obj << -/D [752 0 R /XYZ 200.2554 182.9016 null] ->> endobj -769 0 obj << -/D [752 0 R /XYZ 90 162.752 null] ->> endobj -751 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -777 0 obj << -/Length 2990 -/Filter /FlateDecode ->> -stream -xÚ¥]sÛ6òÝ¿B——J3K$H¦Onšö’KÒÜÅ7yh:Z‚,N$Ò%©8¾kÿûíb$R±gn<‹ÝÅb¿°$!ü‰E.Ò$ r«Åæx.nüË…àá5Œ¯]„¯.¾ÿ9Êy�«H-®v†ƒA‰hqµým™­Ö2ФZ^íõj%áòôò5®ž¿ûÞ¶Û®Ø|^ý~õêâÅU?K“H%p²?.~û=\lAªWa ó,YÜA' DžG‹ãEIÛ9\¼¿øgχ ÁÜ¢!çV%½UEÐMiQf-2–Ëòx{ÐG]uEWÖÁê}»}ÙR«¸½=”Å´ûz%Ë;_ëõW*Y«u’åÃTg™”UÙ•Å¡ü�Þà®ìöV&Þ�ª�¡ â×By’Ðb6Åá`Haf½Éòk�«Ÿ�ñÇ0 á_ÐpQ11††1&6�Ë5ÚÐôúùLÏH)ÀY‰¥�L�'ƒåÙ¹på2YþŒÃuc'$&‰«‡§¸¸Ø3·®ºú†ÑÍ©a¥¡Ÿ}AýMY\ØÿýòݧËwïž_¾~Í®¸¯O‡-µ¯i«‘U¥ÜÕãáó+ñ<:K‚PdéBe"Y»þ8ñK‹¼v±É7Õ¼5 ûf�€ëþR— ¦ -A,ß’8DÖÄáÿ­‰8·� ¶ƒXʼnaq*o?ʶÓRýýê×·ï±!"#9þÿ`ˆ×sÔõÖÈ‚’áXO�•©Ü!6JVé»mуk"áŸÒýõ8¸îcÜê - ŸÔŸ? -WOž•|ÔrÏy©ô)èåÙ�J" ÆÖ[GaqˆµÔì,%SÕó¸(‹0›X$id¹â¼ŽCÍ ãüËqºíL3â”ïÔqŒæ=yd”"¾<žë÷XH!eÄ$… OÐIcâòåiRЇD,«êÞÖMIG†b0G±éNÅ�Û”rÖdè(æ9Gن͔e®Ñ w.5àh¾<µº%<²(6tÛ�µ†2P±\$ -)ñ&µèkF—>WkÐJ›Mis¾D*„Ý3UžH¾U-ÖC’(d!lã#Qpóñ§…¼*•>Zÿ!&|­.È¥ÜôâËKDiš[=Ö’Ä2Dœ'cIŒƒƒ‡l5xö±¬Øuîö«dyOžUvä­°Aƒ‘·Þ­D¸,Ðõ”ä Η/w$T^Ý©xŽ–Ú×zS€C{ô�>Ö·uŨ{KI·£VÉ_t³§ØL{P£ÛÛºÚ2 •7F´Š¾�±Ÿs%€YŒ\ãÅxÁš:Kƒ¡~iЖ†Z Yá.þ¡¶�[2»~ÚJwµn>³3Þ[jkÒk&it×U Ž5S§·¨’<³fí×)(4-’Çõiô‡¤‘v ¤Ë·d vû¢³­’ œTEC”÷Ìš‹Õ–‰hS#¾eKÛŽŠæ¹_ò|v¶ªf@£ÿ8•�Ñ4ôvPñÍX²àúml@§Ûj“­¡Åþ�Èu÷·&ÏB«s*Ù`-_pÅà�<Öž6–r&çÆAÇÖ"D¦&]Æ_»sY×çkS Ô¯•Þ€éÏ'Ý,H3¡<‘&I—±$ÅŒ ‘ d�qÎ� 7ŠìÑŠ°øÍ?ákÑ•G½­Oç3n,‚LªüÛzè±�cÊ å¸’Ë½Wî`m‰å i:„s¯ÁAD«µ¡x¼$zzX ˜Þåö‹IÕÆ(.Ñמ/±ÂÌ—�G˜AÁQLðD~Ëe�t(oöE²\ëFA±¥KbŽŒ”7l¤Û†‚¥¬OÌ®®4æ#8{Q"s޲ŒÁ=bÀœü½©àà<{xÃã–¶§°ÒÆ:ô\Û ™B„ÌnCãÛÞØã¯]‚©Lùºa9‘"�‘ áIáy`�õÐÜiÀ‰.ÏÝvÍ òqÃ>Tr΂]iK{ß:c2˜(P`ÇQdè¥NÐ$öòXІ€˜OÍלð¡�–hpg›á!Œi½`”’¿Tc·.W³i` njíjž·¬`'19âqî3Å/MLÅŸ¿ñ •�ÌiÅ/mÐØ¢òBæy?fă/_’@Ë¢Âä6Øæ-3M¾ØuyÃÜËúöN7†¹Z H ¦eac��(·Mi¶„´f¥˜‰‚;}°ZA[?ù°Ê`çB˜þÛ‚uÛ7ìw{턊i š¤>æîÂâÂ�£¸sí­'…s.å¨S£4&�ä½GÚaadiÃH‘ÓÂê[Ý_½@÷X|Ƭg6bÀ*jÔŠý^­+, Œf\2õ�Pr›š:N((™{1ç®Éq:çA½Û袵º1ΈÀ^{à•ˆÀ¸FøRÍcrmÙÝ;ñhHMa…�A¸\„Öäf `\5Ú,çNU#èÂŽO]ÃÚ¤:žÚnΉ>WVuRBõN*%3±ß¡æÄ+8(¬±~6&€Æ÷@ì=а·1vpmxG—(Ë!ö¢ÉO- 䔼ý¬gƒ‚uDû�Õ6Öw•z½:1¨G1ÓŽ3)K;¢™W2‹ÚN]XsYåɼ`’Žã)៫ÂÞN-�³#){Ö  IHÛÒHg™M2ÀŽI69@oùPå­ú€ 7vv8òÜÐ�N,¯ï½iø,7c”=›:ŠxÈ–G,9¨¹/VQÈÕ6Ahj<À\ÀD­o±u‹Ro ‰6—ÌîE£sxhœÉå�'ž¢¦\ìbÛ“§‘ ¦-,%5 ˆ÷†03‡ ói³ÇÜRñ–Ûø‰ÍC‰_Ø$�éÀ"ùŠR'ïܲ϶.‚†ãÒöl P›¡ñ¼Ñåp`ÙÒ8û¾yŽaK˜² ÛL#mF˜ug#çÜÁ�™�™ÛØ1‡:|Ô1%¡´Gléç%™±*`ĨBòñú¶`s10­2õM�Ø>ÃÙb‡€sñ0o¶üðâõó_ß¼X¿ñöÊ¡�Í ÀÅ\ó){‘šN#É0È–ßW@ë]úÔ…@ý@BG‘ÂOü7æ7áÊ80½ #zc˜ÐÆ7„9½†ƒIþ€¡áXp4Úð–‹»å -˜ä(2ùøA -é„•ˆœ°f¬¾Ãë’Ž¹V€‘i -[ÇyJeª°IFøo傎8Pr¿ÇœÆÕŒ-¬{OHÆÕZ:eï”ìK“3Zg<ëô#ܾºµF_RŽ(ÎÝp�°ÑO~¨0óCS/õ$^MjÈZú¶dS”Œ£ „²w Xö¸oîXÓU–¾ë Ò‹ý¶ÂÆÜÄ3^´«‡‘Ú‹=íÃØz~´Ô³OðB$ø#÷ïbÏ>Á÷Ã]Íè½;úÄYáÛѺ:‡]ó†3?E[Ð%zê_3l¿õ<ýÃÜÏjD âtöí5\ä�P‰ú¿~qc~(”‰�‘û;!*“™¹î�€eµ¢ ¬¿è -¯ ì­¨=t½±�W¸S�¸#"þ†Ï"ù, -©…¡âÓ<:JÝx?:#ÚMè§úëý�ž\éá�‚f´ô?Ì´“+endstream -endobj -776 0 obj << -/Type /Page -/Contents 777 0 R -/Resources 775 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 770 0 R -/Annots [ 779 0 R 780 0 R 781 0 R 782 0 R 783 0 R 786 0 R ] ->> endobj -779 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [281.2378 575.7435 329.1674 586.6474] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -780 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [302.6467 563.7883 361.9339 574.6922] -/Subtype /Link -/A << /S /GoTo /D (a00147_g26a14b8dae3f861830af9e7cf1e03725) >> ->> endobj -781 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [380.0705 563.7883 432.2742 574.6922] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -782 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [303.0487 515.9676 369.7779 526.8716] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdb971fb1525d0c5002f52125b05f3218) >> ->> endobj -783 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [381.0655 515.9676 442.8332 526.8716] -/Subtype /Link -/A << /S /GoTo /D (a00147_g7b2ac4b18bd2ac3912fe67b3b17158c3) >> ->> endobj -786 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1141 445.5872 173.1874 456.4911] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -778 0 obj << -/D [776 0 R /XYZ 90 757.9346 null] ->> endobj -784 0 obj << -/D [776 0 R /XYZ 444.3276 519.1207 null] ->> endobj -785 0 obj << -/D [776 0 R /XYZ 90 502.5047 null] ->> endobj -775 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -789 0 obj << -/Length 1132 -/Filter /FlateDecode ->> -stream -xÚ­W{oÛ6ÿߟBë€B.fŽQ+à&^—,m=ÄC�5E Ët,DW�:YÑï¾£HÙ²­Äv2Žø¸;ÞýîEÃ1]F£“ÁÅE·gÑ­Ђr÷åx0†ð:ûg¨KAø¯Hg�—æ*x´žAò8§[fCÂXNÝýëB'§ál&².qM‘!˜Ü(Dߊb)„|Ð¥Ü\Cœ?à? *¹­jÎÙ¬ÛcÄV’ƒüzk¬Ç󴌦jœ•‰ÄeT„`‹š5šC�2FÍ4Ñ{…æIøµ¬§©úNÙTÌQ¦èíImˆVGëæ›Üe.Ö×U¦†PFäɰð,s‘f…q3)ã‰ÈÔj:Sk"~½¦¢™ˆÓBh‚dª96©¸¥�©5Mĵ؆(ݱeY:S$O—pS…ƒZ˜ˆ(•€,•(½šå›Ö‘ʺùв™UŲK°™ªIC~®“n’ʵoò_�®¾Ž˜É*ã „öTͤÐÒ*gne.z(s)T‡:îa™Û¤nÍÜAë-�}uÔŒdÅøP5ݹœþ·Jvô­rÕôÖ—²HFõ¡½ou9&p;–LýýÐhŸßívnæ{§Ï=|_'Û~#D,§õ©†¡`›ÛÏz>Uï=X£ÍçTx‡¹õóH+!•|'í³Nº‹¾¯ç2�K=!TqŸ²>ÅjMÌÖ½WŠºÿ–g#M�4áä^}OÓ»û¨º[ðÈ·] >ÿ™?Çüendstream -endobj -788 0 obj << -/Type /Page -/Contents 789 0 R -/Resources 787 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 770 0 R ->> endobj -790 0 obj << -/D [788 0 R /XYZ 90 757.9346 null] ->> endobj -791 0 obj << -/D [788 0 R /XYZ 90 329.3658 null] ->> endobj -792 0 obj << -/D [788 0 R /XYZ 90 323.8457 null] ->> endobj -793 0 obj << -/D [788 0 R /XYZ 90 84.5604 null] ->> endobj -787 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -796 0 obj << -/Length 2120 -/Filter /FlateDecode ->> -stream -xÚ­Ù’·ñ�_ÁøÁ&SäÀÜòSìØ²T•DÉÒåIµ5$Á%JC =‡¨MœO7˜‹³Ú];µU;@£Ñè» Ÿ3øãó”Íã0öR?ˆæ»ÓŒÍïüjÆíòÖ×}„ï6³?Štžzi$¢ùæ`(DÜ óÍþÝ‚³åÚç±-6G¹\‹�-š×oi°ùþí 7®êl÷qùaóföæ=ϲúÇÓ~�½ûÀæ{`ëÍŒy~š„ó L˜ÇÓTÌO³@øn’ÏnfÿléЂÙ0%UÈýi±8÷Ò0N.bÆV,/ö‚åš3Æ?×*WÿVú®•Š?æÅ’³Å…fߺ.—‘’¿�*vaÀឯ^ý°!ü…qD:ؼ}Á=öžûA‰ÿô�,?Éò%èÖãIäAÞëÖºÑW+sfà{ÌO¢Á™AÒÓäB)ë¦ÔÏTu§(-/û¬Îž£†½Äо•²K#!0Zu -Æi.uŸô”S/–¨!y{hòüÙ†©‹³Ûó¨6~‡¢ÎEÇñóõ×�¬xú¹ó¶/3õHÿé ^BŠÏÊúÿ!ûÃK…0ñDÀcƒòËQbñ6 ãÀ •6˜³Š[ép‘ïm®ª£Üc5ó*a‚¹£®„ÁDYƒb -cÿØ -âÍÔ’r†�Í×Ðâ,n”ÞI‡èˆ¸o»µÐùý° -RvF7†"‘0[žqd -TBœ¬pÛò0,ìmUGÀGÝU±!•ƒýâÜ.*'„F Ýœ¶$ÿUŸTØZ&kYžÚÎôrTæ™ -VZA\‹ÕÚ7×FEŒð]×ZZè¹,βÌmùƒ.ù”a+½r›ÛW.²vÖ¼ªÃTBF™k&å¬ÙîÌ)9/Î%¶pèÞskµ³Í{v'«ö Î5 È× 2“ãÇH’Ûç¾êÁç2 /LÓèiÏe}ìÉç²åªê²ÙÕƒ—¢ð%‘�]—wÇŒÿ5REîzðeŽ=il?üs�ñäÏ r�Âèý&`šº¶p_ôßü#ð?A;° -p¬ ,¯¤–eÖVç¹sƒ7��pa¿ì¥ð_ -F3Ýú;úzQŽ~ážEtýí_‹Ï÷wòªÅŸ-&´ô?¹¶‘£endstream -endobj -795 0 obj << -/Type /Page -/Contents 796 0 R -/Resources 794 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 770 0 R -/Annots [ 799 0 R 800 0 R 801 0 R ] ->> endobj -799 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 292.733 131.9523 303.6369] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -800 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [425.6978 292.733 476.9349 303.6369] -/Subtype /Link -/A << /S /GoTo /D (a00147_g81ac47cee1c18f6aa479044069db7ca3) >> ->> endobj -801 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [155.1347 268.8226 206.3718 279.7266] -/Subtype /Link -/A << /S /GoTo /D (a00147_g81ac47cee1c18f6aa479044069db7ca3) >> ->> endobj -797 0 obj << -/D [795 0 R /XYZ 90 757.9346 null] ->> endobj -798 0 obj << -/D [795 0 R /XYZ 90 739.9346 null] ->> endobj -802 0 obj << -/D [795 0 R /XYZ 207.8662 271.9757 null] ->> endobj -803 0 obj << -/D [795 0 R /XYZ 90 254.2666 null] ->> endobj -794 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -808 0 obj << -/Length 1875 -/Filter /FlateDecode ->> -stream -xÚ¥ÙŽÛ6ðÝ_¡G¹]©$e]I³@Фi¤M» ô! ²DÛÂÊ’«#›m‘ï ‡”%Y{$�Dçæ\&·ü¸3+ôC7öV�•îÌÚøÕ‚ëcÎ�!Â/—‹Ÿ~±»q ër£8ÜõÖeöÞæn¸t„Ïì—Ÿ“ý¡�ÍòãåkÅ=—yá -¸*$ŽÐÅËË^’VÄ÷ŽrþY¼ÿȬ z³`®G¾uæò8Ö~±žÙ‹‹ÅŸ=:PsöøÜ›3(°2n `_Hö|QúƒxäÆ`9Â>Uy¶tÆlIFúWÉáð�ù OàËéô?EËW.àLw€Täдu—¶M›´’H˜ï -æû lY…Šæò¤F‚[xóT8œ�ÖQhA>’ŒgôAï�Šwùá*­ÊÒ9‹ôéŒò r2¸2m%ZÍ�ÁýÖk¥nò6Ý Y8çÅ¡ªÛ)1‘¥I#éô·Ë?~¿@úHÉ|r·$çÒu-“ks#3ÍÁ¿×þíFðo1âË ^e#KG�ÏHæ@´uNf-Û®.#t6“ôúë‚�HOœô3}�å¾i¾†¡Šå¢j¤!ú>+ï €Ÿ•ÔÙ#ËG…€óXʯ¿Í{¬¹ûj¯7h& ƒÜгB¹ÜIì%܆ZTäiÒæUI*•j f4yÓ6´«6Ô}Úª¼leM›¶Ò_Ã�0 ¤ÕœwUWd´^kMÊlÄ|‘ÿ+‡¢`Ÿk=Õ•˜xænìûÔnŒŽè{wéx\Ø虜Zs«å¾2Ö益%Et%nî°u೉ E•&…ñW­-»ýÚ8Ž”†¨id6fŸIðî>/µ�›]žîæÌúÀ˜(R¤iÃÞDoe.:Tx5YÙé®+¯iI¾ {—FZ§¨¿›´ËËít®4L:»CKõ l¨±�ê­Æùk0 ôøÎ�€¦„a¤žò�f�*m<º^0Ñe2¢hœäO9¡tåLÏî^¿#×ì“ë%‡&o<ÕÕÚË&#»¬4j58+ ööâ‚ëÛV�qŽðH9º[®Äš”3wÃúxIÒ¶KŠâVg -ÜÔ-åRøö§%÷m -mb«n»Óˆ•Îs_¸žCM�ç3Õ#tÃUj„cÝC–ûD+±61ŸÔKÙ[ -q֛͎iö»º|Ìe‘Ã*t±T'Oãê„´¿Y�� EØú¿¡�—iµÇ€%é5\àÞ2ÛîÁS ܦïE:û7å_\í-`-é0œ0�8Ú[ùv©<}3`0“œ©1Ý8oJf¿Þô^©åøv)vX;Ãh«žSv6ñ«.Tº–ù©Þ™™J3“Ë^ÌàF[žï¹A‰r¹Çw†3¹tÂw¶�OÕYy¾ëáб:“tî±P┥4…ylõ¶±ðf Ï•Ëà£ÿy¹Áþ@‡¾PC~§bÜøô9†Â¸‘2û�B©¶u²'À ÙäÛòŽÞŒm<¦¬×])ì›:oU ãf”W°?ÔŠwC;ºVXúºJ,oõ·Ç‘›® µ -£8 À„o².äø¤kó‚:0—ÐõºçÿüÝk-@ë›Ð§Ñ.RîA3°VB™|òú4K¨Gű½©Š‚RMC=ƒ §ÿR³ô)ÏTõ¦.ŽN#©14PånµÖeV*ÁqÓˆ’dÐó¶‘ÅF£Wô]k™Æq(fSÕ\N<¼œAç¶J+äàAÏGc°©`iHU’VXü<TTÌóªÓHghÈÐ -Üc-ÁòæëÎ�0(Z¸&̨~‚5%LsÉ5Šà=�Œ¡ðvtªðÀ©eV¨¸„ͦ+M Âxà0  -›I—Ðx½‹g3e -¶¥²Ñlû’Œ¬˜XE„Í’`†÷ ¤;s÷¥êßne9uN}3þùè&òendstream -endobj -807 0 obj << -/Type /Page -/Contents 808 0 R -/Resources 806 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 770 0 R -/Annots [ 810 0 R 811 0 R ] ->> endobj -810 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [283.7538 392.0799 328.3562 402.9838] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -811 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [389.5337 350.5452 436.3476 361.4491] -/Subtype /Link -/A << /S /GoTo /D (a00147_g61db1dcb7c760e4dd5d60bf4e5576dca) >> ->> endobj -809 0 obj << -/D [807 0 R /XYZ 90 757.9346 null] ->> endobj -812 0 obj << -/D [807 0 R /XYZ 437.842 353.6982 null] ->> endobj -813 0 obj << -/D [807 0 R /XYZ 90 337.096 null] ->> endobj -806 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R /F11 705 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -816 0 obj << -/Length 1829 -/Filter /FlateDecode ->> -stream -xÚÅ]sÔ6ðý~…K_|lôaùƒ ÌЖB -n†`ç¬Ä.Ž}µ}$iéïJ+ßÉ>_. �Ì�¥ÕîjµßR¨Cà�: q"ù Bgy>#΀ŸÍ¨Yö`ݳ~^ÌüÆ'ñ“�…ÎâTs©/eÎ"ûàR6÷8�xè.r9÷˜ îúø ¿¼yÐ�Û.]~™Z¼˜=]lö3âRµÛ_³Ÿˆ“�X/fÄçI,œ ˜Ÿ& sÎgãý¤œ½›ý±áƒ š`êT‚ò©c…@"Bõ±_„u"G�ðhÅéG"ȺX}^ÖU%—�Ì~Týæ^Hˆû�:“£©èÏÂ@hêš#�éM þ«WȶÝôv«�øwÝ´’YÚ¥·ØvDq×�yy^t=ÜóÛ7MBì7d6!뀆ì`ÔswdžðWuYîS™øQ<¾•Uv�yÆIwVÀ™¹£  -…j Ì8tO×Õ²+êJÍ„ŠÈ¦kqå¢èr„f2-‹êlÝ´šSá^!ŽlšºA8h(+Ï—º<ípå¼8ËÍ0O猸_‰hyºZÉJf¸~re˜årùÅl.À'Æé"H(œ1q„à>‰DŒÁ®Vš3ƒòÖ -ûݳñ1ômmípí­é»ÆÂWÌ éIÝØ~1’”²Ð”EލO™Î¶,ÏFÛ•�BR¢H¶AS"€ Æ»N�wÝ«  þ¡ýwøö*êŠs™Õën¯ ¯Æ -Èõzè±ÈÁóƒ8Š‘6ʧÂÀíšµô¡ îŸ"¨­ï«A n©‘„ ~×Ô«¦H;CÕû2 ­ð€YÑ"Å2-K™ÆOJÃ2Rî©× ë OøŠ�öJQÚ�ßäi‹õðDÊ -G˲nev']_DºÍ; -f ³ÂpB y=bStøUa�#Ó6’œ3a³êü>·ÑÈYÀµØ¯¤Z½ì””,0”4²%‚™ŽßÇZ=4Þ¢ZêÑsÔ þ\·ŽŒN€JBr:)‹6×SKWÖ˜"p“qŠ ‰ÏIZ?¡‡rD�ïÙIb‡ïþ1)|@ã1i¬C‚Ä¡ÏH )Œ.1´ûñÄ üÏÔáN”6Ö�SwS% -“Ø7^ã´Òƒ`³Ø®W+宦Ô¦”˜ïE®¢�…ÊÅTÀ!m%eÖ NdOXIDºÈeÕ–¡à}˜‘áù´D\ؤ|–G ã2ǵÔàUW@±ûÝ êàz®EY,Sã¯\—Ëά�êŒÁû8à¶P*Qá¾+ª¥YÓ!ÈçéNÌ‚¡†Ì‘¶�.Ÿ0R}Áð€hé6¯×eÖçÓ[CØâRñ8‘Œ›ŒÛ¦’k3ìwV£þ*l3J�åu4Í•e­²Í…‰áÄä�æ -¿-ÎW¥Aš­l»5ý·Ï:I¥[õ)~sÜ'&#Å»üspìRû§ÕhÈì�í̄ǕuýŒˆŽ©™D#Ö‰9׎/攸i¡{/˜¢7Á`ÛcÁDÛ_óÒ†PËMSl5Âzöx&lñ¾º—«À¦‘í -š5³iÏtCØï«T;åwàFÚfò?˜] 8’+ȹlÛôL"ôÞs©Ì¬ôaë¦Ì~¸Zœº‹y \-ʲ£#KQn ¥»�™UŸÊz…‹ÊæúkkZa›8ÕB¥Ë¼¨¤ÒDÀ@V°Î„7¢Û‘° ©ÂÄH‡'ÁÉJµÎ&Ò>š¶EêàÞGhD¬Æ$–®¶tþ¸žÄÂ'ò:‡® náÜ.';e¥Gölì‰ë/Ù²S:ù1“§…JÂêþònñdñôóû'Ç‹ãWÏD&.@4ÏŸ¾|ùzîÑ ôf$ï_¿}ù«!asÅ~í¡öC(qP¡4…ÄX?›�î§Ã‹Ò:þlÈ4öÑ„8Ë<Õ=µÃ¸ŸPÀÆ>O¼ü¤Wô%úÚ-¼“—ݪkÌÝ�Å~˜01¼Ü*W‚~•hÜRVGûosG“G÷^¢ì_ë"ÑuQ@ëº9uÁžæa·ïwf²íT÷±8x–A32â²kÏð�#èÇ" ý¡±a´Ç†o‘Í#ü(!qW72*’}Ümæê,}£è=†|eùŸ ¶ÇZLKIÞcãÑ: M„á”û™q°ÁqÈÑõ�7²�õÆrÐ>âö¹>ƾ×>ñ´}â;Ú_«¶VÒ²MYéÏf×ÙZ§Ïk, ig ˜¾îêñ-<$<ä!×>ãÎTý‹Û^ÏawˆlñÿD6½ah�Ÿ¹©Oƒhòùƒ€h(Âïz×/÷1�PÎì‡ûJ<�U‰ç Õói/Š:À3YIÕ}™¦¤¿üÞ^¨¦km&ê©_ÉCÆ2‚3¨k¡¹S¨6M7³ö?¨oõ¾¿Ö—Wg²+I=ÒOhé?{¡O›endstream -endobj -815 0 obj << -/Type /Page -/Contents 816 0 R -/Resources 814 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 770 0 R -/Annots [ 818 0 R 819 0 R 820 0 R 821 0 R ] ->> endobj -818 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [490.9727 549.9227 513.9963 560.8266] -/Subtype /Link -/A << /S /GoTo /D (a00147_gfbd5fc486dfdf6bf6fc9db52b1f418c4) >> ->> endobj -819 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 537.9675 127.509 548.8715] -/Subtype /Link -/A << /S /GoTo /D (a00147_gfbd5fc486dfdf6bf6fc9db52b1f418c4) >> ->> endobj -820 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0815 537.9675 200.8491 548.8715] -/Subtype /Link -/A << /S /GoTo /D (a00147_g7b2ac4b18bd2ac3912fe67b3b17158c3) >> ->> endobj -821 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [418.3117 508.388 485.0409 519.2919] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdb971fb1525d0c5002f52125b05f3218) >> ->> endobj -817 0 obj << -/D [815 0 R /XYZ 90 757.9346 null] ->> endobj -814 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -824 0 obj << -/Length 2698 -/Filter /FlateDecode ->> -stream -xÚ¥k“Û¶ñûý -EŸ¨Öb €Owâwâ8çq›6ÖL>Ä�Â�XS¤JP>_3ùïÝÅ.øïìIG,ö…ž‰U?±Ê‚U%~¦ÂxU¯‚Õ€__ ^ÞÂúvŒð·ÝÕ_¾—Ù*ó³Xƫݭå ?’B®vû_<á'›­ŒïÕçüxª´Ùüº{³ -…ò•„ÀÕ")„^½Úõ’X‘HÅåüçê—_ƒÕzsø*K£Õ=L_d™\¯B©Ü¤ºzwõ¯ž-X‚¥ýDB-m(^$ „ÝPæGq(V‰ ü(•Qa³}ÑéÏ]¥ëÍ6oû-}ÏåéCÑÔõö,ýÕn,–ùaFcÂS×ÁŸ¿–°¼}DÁ\î·LÀ¢ áo–Ø*-§¢ïË®80Óå�žM%¹Ñ´ún÷r÷êï޾ýñùÀ]Ì7fyn¶"EÅÆ”?ÿøÓÛï¾ÆLµ¾oÚjÿÍ{¡ÂzýÝ`ú$K¸7­Î?ÒÂvAïù.­®�îÒSÕ4�µù�øûhE>º²DbDêgoÖ`î² Ý?5åžFF×û}Þå¨ Bcvt]{.:BÒ¥ñ:L¤AäË ŠA8R˜Zš?QûI*Åj7“±Îöî2󅈲Ǹ�™ã^†@ÉO'ˆ--Cå§©Us°ÑrÔ¼øú AqhÒðÖglëžïà -àÄ!á¨Q…SV`qQÝÀ?HƒýVegÞÔàxÃ!XÄ”¦34knñ+¼œ¦k‹¸¦É§�Œ¼¼-ó›JÃ6”P=0‘g7Èȧ¦¬;ÝÒ¤kXž26ÍŽÚ˜üN³ÜzÏ8N÷ž7ØjÝû²ð³ˆw ð»îÈ™$õáKÔ8DÁŒEù›m¢"6€‡]Âd¼K‚yMƒèø·Lûn·É”÷r#„ð0 l„ ¼—×»ë¼^ƒ•B™€Ø¼.ë;§ZÞ JNö#ì~&‡%³Ø+ ~ï~#À„egYáÂmÓÒ£–pÐÒÉÛ¶Ä�|ÂíkFo›#�¬y½Ö�åÚ´ñDƒôb?6u¯y±d�îeq˜±êÕÞ”Þ ý¡a`�I”;k¬ÐUÕ¬irÊÛŽFöTÇx|ލU„Ê3õåQæä5#¢úˆÈêOXNChuü^hº°›5*ÏšZ–ÞÓvâÇ�f†°”"��4ö�64ª›ŽˆˆŠñuÛ6-#Ø£‡/&4]8‰‡%† ¨;V�èÛb¸ŠN¬Á‡t?eµn°¼ðôÞ•*¦ìÊ£Þ7çÎ�—LAÜÁ¶Öõv{®­ª†¦¹�ƒ©ý:j&ÎCOÝÃŒvfÓpdÓ,pö˜HÎjšÝ—UE£G–W•Ž«Íxù„gO~°êYj‡©!…ÜT¥9èý3Îu5³+¥;”Æ 3,ÖèθÕÅdЧ&³Ô$£ŒÂ=æmÄÁÓÙˆPø€2>ïxža¿RÒuÛ [Ä6¸·^l½.8ñˆ–ñíÞá[7K^Ó×\`Ò`|[Xˆ •H?T©äø¨"(ô³T¸Кwç -Šuw•$~(.Ü}¡±ÂSmì)Œ+Êô°Fõ§À7© ú“fŠ‚ÁöHÜ�nfÆh©€Ž:½ïË:¯(í¥.r7¸p¡"tÔú`¥È)Çšö‚#ºb†èÝÙ -èYòÝ/Q©¾Â)®�‚/*¢§â€&Ž E]ÏP])Å1äøg&‰a:ïÔw‰8mftÁQß ã„Õ††ÑF<‚(âq´ß*Q#VŽ:uÔɈz\¡÷wSê¥<¹Q¯Ž“I»qVÂK�Ñ쎕J§^Ä õŸ’Ùœ¶¶eYägÃö䱯ÚJűë rœ}^ˆâ‘°|é°Z Õ¹6ÇÒîš„g͹ÚÓØ|�ùÞ¦¾ t-˜ðNçöԞؚ ßέ.4w÷g‚û3A!®¤×œp �ð7ý#5d#Þ®[äËKM“á‡~Yºá×$ôl{ÕMÜUwÀAמ‡fÿÏÈ ô®D˜ù©J2úwWÚ;Fùiô?‹Cߎñé¿–qN¼à:‚uUÂÄW¡ÊfºÌþéé±¾¤Bø2ÉT‡ñËÃ`¡!ϰ-­#nñ‡w5ºÄ‚¿„f׎ÉÁ -¾‘•ŹÊ["§þ”?£J bVê2³ÈtâE03øƒ:¥Òž¡™LdÀ$‰ÕJ¨ÄOS™~áðzüí˜àÒt—|¿êøTèGi,gÚÌ�Ïa}A «*MåT¾ã¥b°”ƶ9AÓFšÏv#RïîŒ/X†pl?”öñ•r„¦Üá§œRáâHB+”ßRà PÛHR§4À�3d—ú:¬².ß<}}lø†I�ŒÑ¸¬SG¹äšyÑ‹O_Š+öõä®â[_Óv¹»Ñ…G¡.š†ë_pÔR”ãÒnÌ®¢€Ð›–ó[\¾ÕÅ”w8ktPý3ds&GB{^Ð,ÔÕÃR]s&ß7µ~¤OZºdFÁðjºüÊtñü9ÿ¿[øà‹ÿ»àá"Žâÿë¯pûç} -$BÉñ÷1­JÝ÷¬Zâµ®u;8’ë!ÿîoð˜Î<’¿Ás©žË€f2bÞ:šÄùìùúŸŒíS/ý®ùüpG ÇØ<ø?ý‚}þj�endstream -endobj -823 0 obj << -/Type /Page -/Contents 824 0 R -/Resources 822 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 829 0 R -/Annots [ 826 0 R 827 0 R ] ->> endobj -826 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [203.7378 146.6848 248.3401 157.5888] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -827 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [190.9801 134.7297 235.5824 145.6336] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -825 0 obj << -/D [823 0 R /XYZ 90 757.9346 null] ->> endobj -828 0 obj << -/D [823 0 R /XYZ 279.4381 96.348 null] ->> endobj -822 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -832 0 obj << -/Length 2726 -/Filter /FlateDecode ->> -stream -xڥ˒Ü6î>_Ñ•“ºÊÝÑû‘œÖŽíWÍÖ¬=)âØgšë–(‹RÆó÷  ^#;®MõA‚ˆÙÁ·_°+ü]–dÇ"ŠÓ]Y_ù»@¿½ -xúó‡9ÁË»«Ÿß„Å®8i˜îîî-‡48&aîîª?¼ Þ¢ ‹Rïî,÷‡0ñ½áú–w¯nvcÓ‹òóþÏ»wW¯ïÆýXœ$JÜíËÕú» -Äzwå£"Ov�øÇ (Â]}‡‘.W®þ3ò¡ »`K«$ˆ¶Õ -â#`B§Wjf¬Ö1ßß÷½Ûnäžîu©/¤ÊuÝ^d-›^ôJ7•nÑÌH`Å0?y�[fd™8ôÚŽøO5„îi>˜ 6£%È ªg"Ñ1·JõÐÈŠ µ<æ'èsO²£éÀ»ß¾'Ì$¦ÙdztŒ¤(ÏDµÜ´•ݽîj«!êÇ"I«î‘Åžie©>ù~X|?4eO{$šŠ¤! TÓËN”d8‹9ÉþQÊfE7 « Ó“ú¸uß©²¿<TI”¬qÌCïãY]䊩3ÈB:oÑÂŽd†¤Ä½ŠÈ* àƒÖ!­ŸÝkúÒ9ÁxÂ/@ ?ñTOxâ{�f„¸ +æÇ“$h�61ý77fÎÇe5hÃù]³‚Ax/&ÆJÏŒ n­Vnm‘dmôêáLÆ ÔÐV¼®¡¯î*Ù1±æ ûÐ÷þÚ‰'ÝÊŠG¦¥<ŽbeÇ4Œ#Å»éœ €µfÆó•ì…š ‚Þ*¦îÛŸÇ=gÞ -ðÀiç,zäp‡äá,iã=JŽq�%.yN.ÿ} -ÌӆjÑÈž0‹³�MâcRð©}®ô�ݸ�Ì�b0ÚHm€}TýY1… µc4Š«jù —­å‹UµÐ?áXYeÊ©£‹gåü¨ºŽ=/Yõ[ì³�Íl0:Û:�SújÌg*ë¨ô~Dˆ¹‹rK¯2{ÎY+ç¬Ô+w(¸°ZR¬†Àv³°q’¸–fhùˆP5ø’h¤˜n‘ºáЭ¾ÖTllþmh¤FÍû¤C†®ZãœsªbÉºŠ¹« l¹ä:ÿ’ZwQ•Œ̓ëknP šø¡r%¹=Èj0'uQýc5}OïÉ4¶LB²Ü„_Þ Jì î®Í„!ÜGÈŽÝg<È ð>ئy“õ‡8 ¦tûZmÅÍà  ²aÖ±[<?-XüÌ_ˆ�xæmP€_.—Y‡…UT¦m®Í” -ƒ §0õáD=5Û€ýý·[BŸ-ÍüÙÛÌF˜ðí¡Hèöß4¢ìžx7ªì´Ñ÷=�÷1n\‘‹1=æÛ‹<˜³è(9ÁµüÃÍKšt{Û[|<ù Í*ã¨T «mþ�›|®h–lÌŒ`ãPl¦Œ c³Ö®e¥0¬ÃÈ«¶ën¡Ø7’`#iˆîýŠå�»Û©»W·4PL#l5ôn‡^ì€qÓu1t® hʨ8²çl«ƒ˜¹¿ -lè5w¸ Í\o:IN“85–¡(Š\æ145ß)Zû=Ì[ÀÄ£ÄZ=Ç ��ià¿ç˜äY³¬U±O�ZÎ.ŸüÄ¿~{s ß`•o¦€\ P�nâaâ¯ù>»÷¸bÎ5Íw–r8¶ÕüBôýg—'¯_ÝüÀCÈ+Ýô”PYÞˆ~ñ ÿŸgî9R·u>§@<5¾©‹#˜ç"C¢–ÜDd‡6LÈ®s4¥†³v7L â¶!u\2ïË÷Uf’BÅ1̯aµÝ�íê ïºgµP›÷¥ñr¬Ìwêd�u³&Ë3?ÅÕ0�25�tMYœ9ÛËçÓŠÍO-¨ñÓøföòãåξ(gÎæqú¼É‹3~÷Îø�‚˜�³K>@ãSP¦‹ó -ƒ}[ î”;Às‰´³gÒxô˜`«À¨&ÿ2›�Pïe{QÒå{~ìåµ€qk¹.tüv ~‚ ,Ìœ8_[uø%×P;Ò¶\ wU2=t%ó"Ÿäòi -t‰§ -Ihè)¿{ÝÆëiE™½�IC™-çDlÑÖ·:Õ�k¨]€©Æ¥ˆ.„ _Ã.´àÁµ‹dKõÔJL‚YD.3rÞH…îµj鬢úï`zç°î±ƒþgÂÛ)Oô l£PË)yÉ^ýþÍ«\éæ­ÅµÚ©ïœjþ²ÀAf¯ª.]Íð�™éuÆÞ9#÷Ò6Ñùö¡ ¿Ó5ßF4?ZÜbh43ò¼¹û�ÐP²K�S³ÐAy»™�ÑAчjÑ“0SØîûßR¡x4G·p+°MB)ÿ—ßÙÛ@³·=€XnþÃG·²ã6öWDóW¾Ô]T`ÿã$ØðÔ3Ûw—ñ]mLnÈ뿃cg›xúP?‚4IÿÑ¿�ö_Ó–Q8ÿw1=Y”ciŠBXˆ4:QPü·²‘øW-ÿ¬¸qƒwh �� ä¯ÿKýú…¾ŸÒÈÞŽt·ú68úËŒþ›þúô ›µ‘ðÒ +ýf1endstream -endobj -831 0 obj << -/Type /Page -/Contents 832 0 R -/Resources 830 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 829 0 R ->> endobj -833 0 obj << -/D [831 0 R /XYZ 90 757.9346 null] ->> endobj -38 0 obj << -/D [831 0 R /XYZ 90 739.9346 null] ->> endobj -834 0 obj << -/D [831 0 R /XYZ 437.7219 648.3003 null] ->> endobj -835 0 obj << -/D [831 0 R /XYZ 90 630.343 null] ->> endobj -836 0 obj << -/D [831 0 R /XYZ 498.8037 552.4222 null] ->> endobj -837 0 obj << -/D [831 0 R /XYZ 90 534.4648 null] ->> endobj -838 0 obj << -/D [831 0 R /XYZ 231.09 381.1364 null] ->> endobj -839 0 obj << -/D [831 0 R /XYZ 90 363.179 null] ->> endobj -840 0 obj << -/D [831 0 R /XYZ 464.8599 263.3404 null] ->> endobj -841 0 obj << -/D [831 0 R /XYZ 90 245.383 null] ->> endobj -842 0 obj << -/D [831 0 R /XYZ 164.1609 96.348 null] ->> endobj -830 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -845 0 obj << -/Length 2718 -/Filter /FlateDecode ->> -stream -xÚ¥YK“㶾ϯ˜[¨ª‘B‚oßœÍÚ5›lÕf­Ä¯ I¬¥H™�+¿>ý jèõV¥¦jt�F£ûë<úð<æþc§»<Œ’Çâòà?ž€üãC ì-ð·î€¿íþúƒÊó]ž¨äq$ I°‹U ÷å/^°Ë6[ûÞ‡nd^;´E[3åùr­ÍÅ4ƒª¶é�˜eyìñæ×ý»‡·ûiYÑ*“ýíá—_ýÇ´{÷àïÂ<‹_ ãï‚ìªûú¶¶­|¶ådö'ön¶ Ðà`#úa¿�|Ç+L$»ÃD>r N–ÖuæUͱí.¦”%aã¬>í�ˆ^t–¸¶±ÂÛqàI íîeÖ'±˜/c1T»8Êœøß‚ÿ¬úÁ4¼&ǹì·ÿZTgÕÌY4ëŽVÏbOóÇ5Ã� ½¦5™6`¢sº+S;óÛhz -Ö4ˆ X™ŒH�÷´X·ž÷„ƒ–²â?rï¡úäûŠü@�ü¾ì€ˆòÉö€‡‚íkÛI«/Bh3Úä‘»›ün7з»‘I�È/Φ˜# 9§ ü\î4Ár le3ŽTš:ë£CĨ3¹!ðX¶0V™² ¼?šÏ;¹¼5úRÜaßÇáºá�rêA  ‰7þr„ wŽ�~ c«Æ Jhô7ÐîòÍ®®ÄÕª«rrôŸ1}UMÙ¢½_þ<ƒ½oÉL� Þ -«Wµæ®ÞpCó ~Zh/´ D,ô/¦8ë¦ê/<–bééÓ$k€ìÔ{?ÖC‹Î ;Ñÿ„ºô,êUºZ€ìßµ‹Â8‰þ¥Î¼¼ qt5LVc çä»@ÝË$~htq–•f%w“né.QQ8×*Š“Aga²¡æÔv ã…»`î^ü©[BÍ�½¡â Åv{5ÝtX8‡R˜)4ŸÜÝ Mk™�|ú•Ì<²eºúÆ}ÚÛïWÓlWÍî¤h,Á*½ »P2Yˆo>ü»Ç¬�g\ -!»l W›^ÓÊŒÉÿ˜^�Y·‘J¼ïë¾]NϦé¹�žyÌäã5;"~!³Ÿ¤- - d±­€£e¨œÒÊvÝ3 1Ìîk½ —ʹ¬¶H5dÞ«†LV ¹NæœbÚKU×<î¬q²µ5-Õ2ç`DÒxEô&� ¤� h_øÜÆÃãd>ÁÓv ˜¦¬ž…^­o i{x~ -0JSrÏ}{á"Sb¿mȃ2Åf ÁUš8´i€ç„s®|`á²>�‘T+��úcsW•¢‡‚8É«…ÑiYsC }»�}Æ£I9<Â4Ä ëFÈtð…6Bá㇡fYÙ¯Ogns|`‹‹ –½„]äRðòdÃÃ&AêÂ#SEžV.s¥†_öKh`Þ®(‘a�'‘¼„VýÕTJHVŸHÂÔûh.-nô ëçóÔYÛx™&°ï¤ \OÆULK¬Ãzåé—°ïPÕÕp[fëâß6 :ò7æW{™üØŽM¹åûcuµ·IŠIÜo{ð šo+.UèÓݨjF.à‰bX !Zhë9v‡HLÚ„±h¢6Ðcm ÷É�ý�0è~Í€‰”6p çR%Ëjˆ³޳rsü…bTX½íJ -QT¯µËù -0tå|´MÅÕ µØê .¥ëÑÜ%Ô© -êÌðꚎº…ô½¤| ‡âO6�e�)µiÀ—p ó%\nžôµqÇÕ)Œè¥À¥+ï_üd(¸ZÕ–˜3qß¼S¸“½¥’ÀrxÆ`u[›º¢hÌÎP–¤Ô‡_´~Ñ[ec*ÒˆÀ46d6U&ÙÝ!fÓ­8g-’ÖqÔ·5X&'ŸÙw†w³�¢©í>SN¼ŸÏFéfÕÖŠ)q*:àÛ™Â8HÉ%³WMàÏþ× K~�)g°k»ÂÈ�˜Žz'-AÒ®;'QÁ,ÊúþŽ){Ë’yk DÑ›Ù%‡öd@fÇt,D™þºâQÅ ôwºh}ÛXÃp+oJÝ•AcÍ×ü0�Öµ ÃT†‰Œl°âžw�Èü‡îf•éº?×±ÆBkÄX@7ýØûzX ~™\Ê.ñQ¸N²å³‹†~æCæ# ówKÿ)’ßOÙ�\z•zý¶4ʬʢTPòÀ†dYbÈ2¶eK‹-àešO B9 ­¼r=ñ à¤LgV‹ü;4Nc+›Œ:ÐÔI—�Øç;uâ•F@Ì”;~°x>Š<¾1/w(�2!tþ iþiŽ[b¿V«‡úª.×Üö ÎqÑåz�÷½…C®gýé^Ø{…ï±ÕÌU@¢Ãj�šŒþòñ3ãÇO‹ÙÇ •p¿Rš»…=òÆâ©½·øüºàÂp)€…LZø[‡‡-IDöØ*oõ•H"0´@ -�åäþAóözá7ò}U>(|>q¶pÅgA¹ý;Ë,O’"›QBI×(ܧ*íÚ³ºš?îMbÅÄ5ÈMæÎ…†ARNÀ }î3ý�s.í‘ÆÉÁµÅ)!y‡ú$ÎhDÔ¼4«9YyZ8_q媷<.ÌwkgÆÉ(Nî4‹S~pë™9ØQ¯ëªdÖ8¶Ï\@¼vm9f9?Å”'’¤8 &w"vÏCï^§i@Oï#4¹÷C×^Ö��ÈhC˜ÂxOszÉ8#^[¨üéy9_úUÌ·xÐàõf3ÉE©M#pC¯ìU\ÞwRó<½ÎÄ鬙Ý:dÊ®:U øÉ�9ÖkÞÇ[Wy‚gÖPÅùV®ŸÞ¡ŸÈ[£/o�ð}éÐQ…XÉ· uQ€Œ’{ŽH§ÓqבCôñí³”Ù¾’£qÍv±Œï8qzºƒYa­Ð#R™[�ºæÉ¯ÜøÓãÙ¤ÈÊOžÁ.ˆÒÕßa}(‚$Nþ¯_CéÇÜ ¦¡ríLvyföÇNQ-ý£iPk[TÙ{Ò{Ûx‡f¥(ùúß©ð;åsOù~"w04¤½‡1àâè� <Èúïíï·“iî̓?Õ®ØçùVüendstream -endobj -844 0 obj << -/Type /Page -/Contents 845 0 R -/Resources 843 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 829 0 R ->> endobj -846 0 obj << -/D [844 0 R /XYZ 90 757.9346 null] ->> endobj -847 0 obj << -/D [844 0 R /XYZ 90 739.9346 null] ->> endobj -848 0 obj << -/D [844 0 R /XYZ 513 669.6866 null] ->> endobj -849 0 obj << -/D [844 0 R /XYZ 90 652.6059 null] ->> endobj -850 0 obj << -/D [844 0 R /XYZ 145.0727 576.8531 null] ->> endobj -851 0 obj << -/D [844 0 R /XYZ 90 559.7724 null] ->> endobj -852 0 obj << -/D [844 0 R /XYZ 199.2294 400.9501 null] ->> endobj -853 0 obj << -/D [844 0 R /XYZ 90 383.8694 null] ->> endobj -854 0 obj << -/D [844 0 R /XYZ 437.8115 266.5818 null] ->> endobj -855 0 obj << -/D [844 0 R /XYZ 90 249.5011 null] ->> endobj -843 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -858 0 obj << -/Length 2680 -/Filter /FlateDecode ->> -stream -xÚ¥YK“㶾ϯÐ-TÕH&>Dßf½±k¶*•Mí¤rp| Ḧ5$!ó±cù×§_àk¸±+)4  Ñýu7ì|ø»Ôß%QrLuïòúÎß½ù§»@†0~˜3|xºûîG•îÒc«x÷ôLâà©@힊Ÿ½ Þt�èØ{º˜ýAE¾7<~æÆÓŸ¿sí®Ïò×ý/OŸîþú4®'Û‰tàj¿Þýü‹¿+`[Ÿîü£NOÑî :þ1HSµ«ïB¥]§ºûr÷�QЄ­SE�Þ:–^KA7áSåYÛ–¦€­'ʳCÏ�ó ¿�×ÓI��]¯U™g}i›{¤$^)¬eÇß‘µ5ÝÕ6]y.«²9öyÅÄJbšåïkc÷*òÞxÆÛÅ4ï÷mÖtuÙu° ‘s±CU ¶A‡ 8¦QÄ;Ã,ík¯Þ^V˜ãþÆ'¸º¡czô‹ðä¶¾VfDÞo´eí+Ú2ñ1ÓB¾â¶ÌÖ ¯Y۳ɕ  [6/Ü\*«;¢€•�ƒ8•:ÅlßÇÓQ£ý!ð}ßû±²¸«7–öƒmúvœ<[‰ ½¤ÂcE) "÷ÐÉÉ»íÕÒqÁ^HŸ@WùË>м޻ÿö}íîû9®«ÐœÚä—¬)»Z˜Kù¢ÉàxVU˹u=4Óélú7cf¿Ø® oeq­ª€ÛZè7 s|EÑY{c�jÛ©m{ãvQÖ¦ÕÂ}…ÞcÃ&Ë/Ü‚“r£#Óz� =:�ŽÄ¦i¨)LËmr­æƒã<&”M�§CS¡n/�l¯|ÙnYeçJ柑<<#ýÙ0¡îšåè®úa„2Á1·5h×C'¦F¦î†e悇EÖgÜê/YãZ2¸Ú Áõ� óÙD(!Ð|z ®5sˆmè8ž)9Æ* éL�ä@ �sÞ=vOÎ�“µ'��8ðIN…T>¶øT,#“9£´i[d&È…f6JæÆêì´õCxRÞ/w’]!V¹��ÜÆ6LS¶‰6ÉÛÔÚm“ ˆÖÕ¼ÐBj; !‘<ÍãF–„$Â"Í`ŽýѱŒ,CÓÂxA‹%Öš€1Ô4Šïñù{m{3ñm™§»¼ÿ,ÏÍÕµ´�ÛÚè27\U÷+ëqñ† ­ìKq¢9Ë例Üz[cô¯­=�À:bÒŸ†ÔX @ôÅt|½ÿ¨b`ÌçR Ž€‰ƒsÀÄÁª¬9NÏBy3Ôgò¿1.^WÖCÕg�±ƒÌdÀ¡ „dˆ¢Í$1€¨×¿a°°í+bIÑn7î3«^l ÈKÛÓ�±°`¨z¶-“ÇÓóãÁ`F@�ÂtåKã&SÔ³ÃÍ’Â9ÑÜ‘&$ͼ€Þš_‡²•‰¶©n²ž�3�ÊlÀh6¼‘´š[Ì36 é ¤õ)e¤ü¢q9ÜXQ¹ðo—4Œ�åË¥gÝ6a W¼Nl€² ‘$MÑ,yqþ?f6jué+ÉÝùãYÜæyhaÁs²7SŒÞ7¬�,_ùÀt½s×’Y™‹+ã¢�1…)þ´ç%âyÿlÑ<_øöAÌG„Œ?v¹Y¦¢NÞ@¾ÊB°/x«Òiß<p�jüZF¦«Ó<ôz{XF"ç,áÒÕD;MÂñJCÈW.%&8„áeÃùf"ç]Q,Á4ò8&Çˈä%ð­³ö•Y0¹ì˜Èæ»KŒFÄÕô�ÝÖ"TØÏF°23ƒh¡|ù¸5ížMhd[˜k0¦0òl²~ ¬…H�ÒñX¿n6©u�¤RN#ðËêHÃÕ~xp¬x°C¡¾‚¹OË éi¤ÙÝšüÒچð®=i3w#©n² ÛþrØ2Ó¾•´“Ò�Å:Qê=|~<òÐCÇ_©íSZ  â&T'�Í7]oFÌ”¤’a霉+ÒB÷Ld½ACôÆj¨0u§�Åê„}ãT[6(Àì®™+C—ïŒXZÁ©Ö^À¶P8l^\z,ù6ou+AÍ08‚£¦‚¼© îgLzMKY/ú6ÆÀmЬU4¹ŠÒ㋊VjíÌ@Ž^ D8-rwëzS“…B1äìDÀÛCÕÆ|”饰uÙpÙ�dÊj•ó6Ï/&톚ÉyVåæuUcÞz•µW -ÀcÕ -€ =cá�ޝšnR<„€»9?ôÜwÅGÄ) ’0fòµô<Ò½•`3}~)XW$¡÷w^ÎI­p‡5óFÍmUã �»í©††æEjMz” -&%å[*[Ð80g!Lge#¢xqh #rq­z|ê¶1÷]9SZ[s ¼¯—Á‹5"•uã8¶ÞJ&~·Ê"ܨ”ë@³”Æpi¦ýÀû0B—³ä_úÐÖ¤¨Pò -¤vh„ÐÈDyfÂötD„€1…@öK&È�p–9` ü¦‰>a¦¬LĤÛmÕú“iÐé]Îî -Û¿¹Æ'¼úA:�’¯ÿ½Òß+Ÿ{Ê÷c)8U_ý¹ýå›üGûÛ *޵’ðÏÇ -ý¸¯ äendstream -endobj -857 0 obj << -/Type /Page -/Contents 858 0 R -/Resources 856 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 829 0 R ->> endobj -859 0 obj << -/D [857 0 R /XYZ 90 757.9346 null] ->> endobj -860 0 obj << -/D [857 0 R /XYZ 207.8864 706.0616 null] ->> endobj -861 0 obj << -/D [857 0 R /XYZ 90 687.3006 null] ->> endobj -862 0 obj << -/D [857 0 R /XYZ 429.0947 581.6321 null] ->> endobj -863 0 obj << -/D [857 0 R /XYZ 90 562.871 null] ->> endobj -864 0 obj << -/D [857 0 R /XYZ 416.2232 469.1577 null] ->> endobj -865 0 obj << -/D [857 0 R /XYZ 90 450.3967 null] ->> endobj -866 0 obj << -/D [857 0 R /XYZ 318.9393 332.7731 null] ->> endobj -42 0 obj << -/D [857 0 R /XYZ 90 312.8912 null] ->> endobj -856 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -869 0 obj << -/Length 1859 -/Filter /FlateDecode ->> -stream -xÚ¥XY�Û6~÷¯ðCd4«ˆ:Wú�£ 6@€Ù¢IPÐm ÑáèÈÆýõ�‹:¼ - X,8ç g>ެ¶ü©mêm“(qÓ Œ·Yµñ¶G`¿Ù(Y¾�õ›¹ÀËûͳßýt›ºiìÇÛûiˆ•ùÊßÞç妻?òœ÷;ßsL{Øù‘Ó´•®3³û|ÿvªÀõ‚$$Ÿ wóÛýhT|Š‚X¡É¯›�Ÿ½m¾½Ýxn�ÞFÛ˜x®JS[mB?°“róaóǨ‡hÃZh‘ -Öb ®bóašphºÎw7Aê9YsÞ)Ϲõñéî&ôc§?^ºõž‰sÛd¦ë@çÊÉ›ZDMË„®y©¨³¦Aب³/¨Ýô—E^6µ»ƒÃ¿uîOƒ˜¢ƒ€Ñt}Qé^v4‡+¯ÞÿùØÜÉèœý²òÍЮE 7óì.G¥‘STçÒT¦îÉŸŽ™º�ÄÞðØì{]Ô&îÅŠí”SfC)'ŽÇÓ’yžT¢0öˆìƒÔM9H–tI0µ>øÓ&wô5qc? É×èŸo«Ã§ËåÔ œnÈNÌÕ�ÃÝ{^êOºg–<%@!ÔB¡€u�b¥É¡ïúñ9˜ŒËÄN;¤ -|{PðÜ4­5‡÷¸–dTe~êO•‹“õ2ògù®¬ž v^šL�(µ­Õ�?V…º^ïD=öˆ^¤+Êô YÌH»ÀƒàWÓKǃêDÐEÏ3º$+¾¶‡2'ðRÊdŒ/4 -Õ2®að Ùcñå6„l¶ÌÊèºcÝ’žÅN\µONÎ ô4ûÒ¬ßYÛ ÇÓÙ&óTA³76·Ë¢*zû,ì…ÙÛ -{T&E^Ίoµ -¸¡ðU"j€˜ž;âÎüƒ¹ù:Ø'f'#Vƒ*L¸ÉAêÐ6¤(æ¢= ¬@íÅà“3�¿Š*žñðÉ‹<±ý‹¸ôwLõdt¡µz:áÝZöH—p›Ø6à›ÎKÔ ñ¬þé~”ƒ¾R#ªy¬8z›íšqmÊxµ’²ŸW—ØŠ[©\[��«ÄºgñSѳø ” õægAÞÍŸߨÄù@ǽ–¢rP‘±”÷äaLo óèÙA=¶È±"t}L ȇ‰8‰Ëgjø€UÑ Œ<Ȉz©Ã¶ @s&s{*Ò 3ñ"ÓCzÃZ~àWî‘=™7œô;ËÁd?~R¯+ëñч$}¤rOrÙAýƒ§$ gˆ“b%‘<©¸Â-'ÐvBÙ‘‡Ç�j(Dˆâ%éEœÈÁ8Ù¸á=¦‘½ŸÁ´ÿ8wí'*åª0YýÕ̃/YGñÿúõŠ~z»…-*ð翼Ånš·ö×)qcxcjè±Çë·úÎo1¤A&Ê—Ñ{îÏ}oü̈™’_íxÂåŠÒ®·Ì­×Í÷Ëîøêx𧵕óùÝlÞendstream -endobj -868 0 obj << -/Type /Page -/Contents 869 0 R -/Resources 867 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 829 0 R ->> endobj -870 0 obj << -/D [868 0 R /XYZ 90 757.9346 null] ->> endobj -871 0 obj << -/D [868 0 R /XYZ 299.5322 694.1065 null] ->> endobj -872 0 obj << -/D [868 0 R /XYZ 90 677.3793 null] ->> endobj -867 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -875 0 obj << -/Length 280 -/Filter /FlateDecode ->> -stream -xÚ¥Q=oÂ0Ýý+<&CŒïŸmÆ~¡FªDUoˆ�’@¥–D¥ –_'N"„Ø�‡{çwŸï€Ëð€;É�6©œøzÇ$߆Ο�Üy6yBÇ�p„Äý¦«@ 4r_.°i¦À(JüG•f¨er|žGàïç“ÿVëÏté öèÇ~ý8Z´Ý¾Ùb)yÆ*˜ÊY̓#8‡|ÇrTƒóÅÞØëX']µ­Z:#KÂXs-@†ý€´¹i†N;R@©séH8£l+�Â�˜rÁêô›Uuµ_ª2ÊÔÔѾ  HA'ÇÞì­œ¢š¢ŒJImRÔI³¿8ˆ>ðýíCówÚVõå54¨q´3•þ}¸xjendstream -endobj -874 0 obj << -/Type /Page -/Contents 875 0 R -/Resources 873 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 829 0 R ->> endobj -876 0 obj << -/D [874 0 R /XYZ 90 757.9346 null] ->> endobj -873 0 obj << -/Font << /F29 499 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -879 0 obj << -/Length 1608 -/Filter /FlateDecode ->> -stream -xÚí›M�Û6†ïû+|´�šá§Hö–¦i›¢)‰ÑÚ´²v-T¶’�6ýõ%õµ´9’¬F§ZÈÁ‚=Oæ}v†Ñd�Í?²Ðx!…Dšñ`íïðâɼýý©?æ”™Wàƒµ l±voýfs÷ê;ª£  b±y´Î®‘Pl±Ùþ¶|³ Ÿ�q¾ZS�—tõÇæÇêޤ’ÄÞ€�_�¸¢¼¼áôî¾2&Wï³í)�«ëw‡müwë…pd¡µ—€!.hPz¡ˆ¬ÖcÜ鯨½°…F:°·•N¨ýωÊÉq^mRT¯aõ’&űºÊëÒ´ºØWο¶ÞïÞnÚÜ"¡&k\ „•róëå¹5^;ÖU®Ýp æˆHF[Ÿ6èû<;fÇ]‡[4çb‰Vka1¿ø/\ë®Ï.ô˜!Ì$ƒõ³ùSmúÁý‹inëWÒó^2,½ »Š&’„™o% i.e?mŒ#ªib”ŽYnDÙ?7¾hÍl”?eQX³e‡cr8…Ç$;ö„â3ff0QN:G!Ňäòý[¹4¡C¸¤J ¤¤¸–ªª†YªLà šCE¬1³a¾~~N“¨!‰)=“4ms4WÆzÅôý[1Y2†0U%ã QÎõP%kÌl˜ßþü±ªcy\dé§K»p‘z.cƒÔ]è˵Bج¢\®À¬¹m@>Ï»U�`RFÐMAZz-eŒ˜+-‡(kÌlœßoêéÛõ>LêÖYÄfak`S8˜¹Ò=@9T¯Rž÷ -(F0¹(¢;Û[Á@5f6ÎÍJâeœâcƒRÞÖ.Æä\­¾�8G’QÄõJéy/‰#ðâ Œ`ª†%b¦Å טUûâ4;ªhûkEÌ.8O·&�bÞk~i¿tÔ[¯Šž÷ -6ÂF0lvÁ)§°µf6Î_WÊ”·‡z‡™&ñÁÔ9.gª¦!Εd qýRzÞ+â8DÁD •)†x Éq�™GœÛMi0ï&¢Î‘eu½rzÞKê(ØTá&šx°@#A ˜x´få2nWÏšÛ�õæÍý«æº8†ÑŸ3^ÃŽ®)‡«Ã¨)G¿€¾+`@AÎÀ&šr0!��lhÿÙš�=_‰²ÃïÓ§S^ŽÙª7O‡¨ߊ`ÑÖ#T7Ñ£F´ý -ùþËq8÷‡C˜jaÆ -ˆC 5fg %‡ä˜„iòÌ‘bìæªT'GNžÇqÔ+�ïß -ÄáÆ†0GŒ  `C�Z³3޶ñŠŠå§$ªá6OÊ7Úå×9WòGe�\9yÇU¯`¾ÿ’+r†0Õ2žh$±Ü86fg\…/Ï’<ˆ-æy×KN®Ç±Ô+’ï¿d |4‡0U�ÂÙ5ýJµÕå’iÅqS‘ -°ÛÝ⨗„�ã©O(Ï»J€�€ÀïŸ&jvˆRK5@Skf£üeEY†y>ØcHÕ¦¯ˆ·ÍjêbØßÍýZÈÛèrn²G‘Ô¯’ï¿ÜÎ�]a¢.GCŠÓ¡í\kvV›^o·y\Ô8}°O°O/¯<e©ix½\ ¹©‡N¯&¾«‰›ÂTuH¤”ÚÀµfgèlÞÔÇ]ž�žvϧúQâC–íáÍ]9�bÿïþÖÉ�“ßqüô -ãû·Â( ò†0?ÂÅèЪ¨5+ÏhåÑ.9ÆÑñÔ“-žã(±C¥è¢‡¹c%Ü9NfÇ‘Ó+‰ï¿¬<à8„‰fÝ” ¤:Ýך•‡Â¡Ñcö\R“åBœóy´}>ÚvÓ>j´Ý¯—ï¿Ä -.H`ÝX]S�^°2¥ S=ô¥5«NÂ0±LöMÃJ“‡<Ì?›2�&LtnÔ•ev½zúþ˳Êð a;r-v”",9®1+«YšÙ•Qµy3Ë¥G{$&´Û5%ٌڗ:G‘qÄõJéû/‰ƒû'ÂT…Ž`DHç …–¸Æ¬ý�Oa©3¤ÅÇâ¢Þq5c÷@s„Z¯‚¾ÿ4pR‡0hD+D¦@«Ìªü>Þg¨r/øRåöá!|Š÷åI¬Ë‡2‚ÞÒ9–&Y#�±8·uŸbq… <\~ýöלkB%–�?÷ü"”r(endstream -endobj -878 0 obj << -/Type /Page -/Contents 879 0 R -/Resources 877 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 905 0 R -/Annots [ 881 0 R 882 0 R 883 0 R 884 0 R 885 0 R 886 0 R 887 0 R 888 0 R 889 0 R 890 0 R 891 0 R 892 0 R 893 0 R 894 0 R 895 0 R 896 0 R 897 0 R 898 0 R 899 0 R 900 0 R 901 0 R 902 0 R 903 0 R 904 0 R ] ->> endobj -881 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 483.9922 513.9963 492.8388] -/Subtype /Link -/A << /S /GoTo /D (section.6.1) >> ->> endobj -882 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 469.9249 513.9963 478.8911] -/Subtype /Link -/A << /S /GoTo /D (section.6.14) >> ->> endobj -883 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 456.0968 513.9963 464.9434] -/Subtype /Link -/A << /S /GoTo /D (section.6.2) >> ->> endobj -884 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 442.1491 513.9963 450.9957] -/Subtype /Link -/A << /S /GoTo /D (section.6.19) >> ->> endobj -885 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 430.1939 513.9963 439.0406] -/Subtype /Link -/A << /S /GoTo /D (section.6.20) >> ->> endobj -886 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 418.2388 513.9963 427.0854] -/Subtype /Link -/A << /S /GoTo /D (section.6.21) >> ->> endobj -887 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 406.2836 513.9963 415.1302] -/Subtype /Link -/A << /S /GoTo /D (section.6.22) >> ->> endobj -888 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 394.428 513.9963 403.1751] -/Subtype /Link -/A << /S /GoTo /D (section.6.23) >> ->> endobj -889 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 382.3733 513.9963 391.2199] -/Subtype /Link -/A << /S /GoTo /D (section.6.24) >> ->> endobj -890 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 368.4256 513.9963 377.2722] -/Subtype /Link -/A << /S /GoTo /D (section.6.9) >> ->> endobj -891 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 354.4779 513.9963 363.3245] -/Subtype /Link -/A << /S /GoTo /D (section.6.3) >> ->> endobj -892 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 342.5227 513.9963 351.3693] -/Subtype /Link -/A << /S /GoTo /D (section.6.4) >> ->> endobj -893 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 330.6671 513.9963 339.4142] -/Subtype /Link -/A << /S /GoTo /D (section.6.5) >> ->> endobj -894 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 318.6124 513.9963 327.459] -/Subtype /Link -/A << /S /GoTo /D (section.6.6) >> ->> endobj -895 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 306.6572 513.9963 315.5038] -/Subtype /Link -/A << /S /GoTo /D (section.6.7) >> ->> endobj -896 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 294.702 513.9963 303.5487] -/Subtype /Link -/A << /S /GoTo /D (section.6.8) >> ->> endobj -897 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 282.7469 513.9963 291.5935] -/Subtype /Link -/A << /S /GoTo /D (section.6.11) >> ->> endobj -898 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 270.6721 513.9963 279.6383] -/Subtype /Link -/A << /S /GoTo /D (section.6.13) >> ->> endobj -899 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 258.8365 513.9963 267.6832] -/Subtype /Link -/A << /S /GoTo /D (section.6.10) >> ->> endobj -900 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 244.7692 513.9963 253.7355] -/Subtype /Link -/A << /S /GoTo /D (section.6.12) >> ->> endobj -901 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 232.8141 513.9963 241.7803] -/Subtype /Link -/A << /S /GoTo /D (section.6.15) >> ->> endobj -902 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 220.8589 513.9963 229.8251] -/Subtype /Link -/A << /S /GoTo /D (section.6.16) >> ->> endobj -903 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [502.0411 208.9037 513.9963 217.87] -/Subtype /Link -/A << /S /GoTo /D (section.6.17) >> ->> endobj -904 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 197.0682 513.9963 205.9148] -/Subtype /Link -/A << /S /GoTo /D (section.6.18) >> ->> endobj -880 0 obj << -/D [878 0 R /XYZ 90 757.9346 null] ->> endobj -46 0 obj << -/D [878 0 R /XYZ 90 739.9346 null] ->> endobj -50 0 obj << -/D [878 0 R /XYZ 90 553.9527 null] ->> endobj -877 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -908 0 obj << -/Length 276 -/Filter /FlateDecode ->> -stream -xÚ¥Q=OÃ0Ýý+<&CÌÝ9þꈀª‘�@d«:âviQÑþ{œØ�"è†<Ü;¿û|‡ÂCî€e„“¥æG|¾— ]¾˜Ü×ìî‰wÂiÒ¼Þ�4 -EH¼nÖA^HB Y¿zÉ R�¡€ž»¦?øˆWmãÏù¦®Øc=õKã(©qèöÉÖàM«b ¤³Š:GüÈJ’WçÀÞØëT'c­­ºÐV cÍ­û¡Væ_3ŒÚÙ�‚RÎ¥ÓÂié$…ÄR7¬Ñ£~KßúÓöË7Q¦®½J—@•£Êúä % ’ J2€Žh—“ʺStþÞãýíCw¾ì}ûû -å4ÚL¥kÆxdendstream -endobj -907 0 obj << -/Type /Page -/Contents 908 0 R -/Resources 906 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 905 0 R ->> endobj -909 0 obj << -/D [907 0 R /XYZ 90 757.9346 null] ->> endobj -906 0 obj << -/Font << /F29 499 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -912 0 obj << -/Length 1260 -/Filter /FlateDecode ->> -stream -xÚí›M�«6†÷ó+² RãúÛ¸Ë^õãvUUÙUU”î€J>”0º�_;â�=V=we�F rürà}°9Ъ?´�p!˜’P¾¨Opñ¬6ÿò„†Ÿ)&jéøaÅY¬ì¦?®Ÿ¾ÿˆ€sÌë/ZœS XIëýŸËOÍöÜ×—b…\’â¯õo¦¢H7€J—ZbzkðòùwŒ4+¿¶õe{)P¹¬š¶Úvfëçã¾þgÒC¨”ð Ç   ó›¨X!¡CùS·½^ç;)[¾Òd!�äZ릌õ±3£¼nÚ¡q{lêKÛo�Um6tíµ~B®§K_ïÍúåôòÜt¯gËïÌ–]�U~C“ãiX©N‡sW÷õB·Ý¹Ùîê^Ÿ‰îõ�æÓOëÉ#„@X¹CK`YÚ>Îüœ‚WV´ñÔ>n)@‚àISý¾©ÎÕæÚo{uÌBÈ%(VL�弘/¨|óô<ØGe {Ã=py"ÿ°|[ùm|ÔÖ."LSÐù{à!’�R0¢1’1üÔ„ÊQ¨K’à kc˜N³©»î´ùZ ¸<]ºýˆ“4í-Â,¢óÚ7S7�Q'dÎ RQÆ‘âHðe&LÊúþ¼ßTÏíF÷­êüá2s•¦;Os,lV;l¶‰3'lÎ RÁ¦nx0V÷?ØÆ°;lCGF8Êl}w–1QÜy �©;g©¸#`.Hˆ»1Lçy¨»Í®;U«;SNò}["Ò,+¢HóZ8S7¤ 'iÎ R‘† £i& ßò<_dÅJ"‘©J^€¿ñÌÇògµóðgûŠpéäÏ™A*þ„‰~CÔD߯Ö_TOs©ð!ÜÝ�‰ÂÎç磶�N:¡sí>sõ,Tǰu½êðÎT}k -¯¢8ôzâ�ì•sÛ‡(̼þÍÔ fη€Ý<€£¿Z!AAIÄ»¾�úe_°endstream -endobj -911 0 obj << -/Type /Page -/Contents 912 0 R -/Resources 910 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 905 0 R -/Annots [ 914 0 R 915 0 R 916 0 R 917 0 R 918 0 R 919 0 R 920 0 R 921 0 R 922 0 R 923 0 R 924 0 R 925 0 R 926 0 R 927 0 R 928 0 R 929 0 R 930 0 R 931 0 R 932 0 R 933 0 R 934 0 R ] ->> endobj -914 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 483.9922 513.9963 492.8388] -/Subtype /Link -/A << /S /GoTo /D (section.7.1) >> ->> endobj -915 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 472.1366 513.9963 480.8837] -/Subtype /Link -/A << /S /GoTo /D (section.7.2) >> ->> endobj -916 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 460.0819 513.9963 468.9285] -/Subtype /Link -/A << /S /GoTo /D (section.7.3) >> ->> endobj -917 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 448.1267 513.9963 456.9733] -/Subtype /Link -/A << /S /GoTo /D (section.7.4) >> ->> endobj -918 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 436.1715 513.9963 445.0182] -/Subtype /Link -/A << /S /GoTo /D (section.7.5) >> ->> endobj -919 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 424.2163 513.9963 433.063] -/Subtype /Link -/A << /S /GoTo /D (section.7.6) >> ->> endobj -920 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 412.1416 513.9963 421.1078] -/Subtype /Link -/A << /S /GoTo /D (section.7.7) >> ->> endobj -921 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 400.306 513.9963 409.1527] -/Subtype /Link -/A << /S /GoTo /D (section.7.8) >> ->> endobj -922 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 388.3508 513.9963 397.1975] -/Subtype /Link -/A << /S /GoTo /D (section.7.9) >> ->> endobj -923 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 376.3957 513.9963 385.2423] -/Subtype /Link -/A << /S /GoTo /D (section.7.10) >> ->> endobj -924 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 364.4405 513.9963 373.2872] -/Subtype /Link -/A << /S /GoTo /D (section.7.11) >> ->> endobj -925 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 352.4853 513.9963 361.332] -/Subtype /Link -/A << /S /GoTo /D (section.7.12) >> ->> endobj -926 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 340.5302 513.9963 349.3768] -/Subtype /Link -/A << /S /GoTo /D (section.7.13) >> ->> endobj -927 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 328.575 513.9963 337.4217] -/Subtype /Link -/A << /S /GoTo /D (section.7.14) >> ->> endobj -928 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 316.6198 513.9963 325.4665] -/Subtype /Link -/A << /S /GoTo /D (section.7.15) >> ->> endobj -929 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 304.5451 513.9963 313.5113] -/Subtype /Link -/A << /S /GoTo /D (section.7.16) >> ->> endobj -930 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 292.7095 513.9963 301.5561] -/Subtype /Link -/A << /S /GoTo /D (section.7.17) >> ->> endobj -931 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 280.8539 513.9963 289.601] -/Subtype /Link -/A << /S /GoTo /D (section.7.18) >> ->> endobj -932 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 268.7992 513.9963 277.6458] -/Subtype /Link -/A << /S /GoTo /D (section.7.19) >> ->> endobj -933 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 256.9435 513.9963 265.6906] -/Subtype /Link -/A << /S /GoTo /D (section.7.20) >> ->> endobj -934 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 244.8888 513.9963 253.7355] -/Subtype /Link -/A << /S /GoTo /D (section.7.21) >> ->> endobj -913 0 obj << -/D [911 0 R /XYZ 90 757.9346 null] ->> endobj -54 0 obj << -/D [911 0 R /XYZ 90 739.9346 null] ->> endobj -58 0 obj << -/D [911 0 R /XYZ 90 553.9527 null] ->> endobj -910 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -937 0 obj << -/Length 287 -/Filter /FlateDecode ->> -stream -xÚ¥QMOÃ0 ½çWäØl§ùÚc•�@ô6í0ÚnLÚZQ1±ý{Ò¦«*¶Êáù#¶ŸŸ‘ƒÈp£Œp2Õ¼80à[ž3Ò‰Ï'Ó÷9»{"Ç�pš4Ï7}�BÏËeD'ÀÚè¸x�R¡€`<ïªvÝÆh£âsW¬÷!º¨Ëê¯òŒ=æãä�˜’»¹_l¹^z‚!�UüÇ; Ð9â–’¼8{öÎÞÆ>!ÑÜÚ¯K'Úja¬¹õü¦¨•ù‡^EëKPÊ©ˆZ8#m'¢$_˜jâ=Ý+9¯j/×wU™š:àËÅÈbTÑqp�„É ‚€Ö&&5mp®/óqøÐœÎÛªþ{ …r¤6Qéìº{~endstream -endobj -936 0 obj << -/Type /Page -/Contents 937 0 R -/Resources 935 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 905 0 R ->> endobj -938 0 obj << -/D [936 0 R /XYZ 90 757.9346 null] ->> endobj -935 0 obj << -/Font << /F29 499 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -941 0 obj << -/Length 1873 -/Filter /FlateDecode ->> -stream -xÚí\MsÛ6½ûWð(„àû£·4I[÷”‰•SÛÑÈmq*K‰žôç$H -4V�¨œ¦åä Z||»ä¾ *$ÁöI N”PÈ0.“ÕÓ Ní×?ß�ê4§Ì~'f‚°dæ_úãüæÍOÔ$#)©Hæ¹ä Í’ùú·É»Íò�§ÇéŒ -<áÓ?濺 8RZ‘âlyâšòò‚çÛ�Lvï—ùÒÝåÇçUþ|œ=IÝW·»uúWCK8²žÑŠV2Ä•%-Gd:#ãþN-K 2²à)Yiqû±þ’+?–õA¾©Ö ë©bµŒåß_²|ãŽî�YúPÁÓÓê˜òl¿;ýPX¾ù0ožŽû|_:k+iî¾´$ÄjÃèÿª°�çßKØ� Ø�°5(lЃ¡…MbBÅt]¡Y/î§OžÂêÆ®U•>_7(b]Ä�h‡ê ÂPõJ„®Ø½ävi`À4€Ì�ØJ “hƒ§†•y�‡=Xë\Ñ€ñØBç*PÌ&%Hb%Ú6G_áƒÓ;5€HöÊ�ÎØìev0 fèÁÀéÁ´AœËX¨�÷szÊ—VÀ)c¯õi�I¢BŬ×+à–õQéWœ  8õÉ‚îÀì. ”°‘, ×Îe‹rCb� VÜOžnwi~©$8Œ‰Äg6Â*TÌ�zÜr`ÔõU2P¯ èŒXÀî2€‚z0ô< …•¢Œõ€X™ÙSz WÁQÌLâ3V¨˜a»Z–†Ë¶ábü¶Úq/}ð–µ’�zï[(]J r½R¢3”»K pgö`è” Mb�¡V¾À’«ýnFQÁŸ¨‹(f™3¤x‘¾å"'>ÅBÍ 0ówÕAánº:_àÒÈ(ñ]ŽæÀóí%ÝÎ'°;é‚{»°C×3VI…ïåV¨Z¸i¾Y,×ëpH¶^çvïѵLŠÑ"³}ã=µËõì>«z˜òMzÜÕÍÂëôtjµ7±ø·k5|š½¤Úõx_r;¡‚[O ù¡‡Xj�T8Öœi`¾R7�P)bÔrø¼€R+T̼­Î5amë­|[„›t¹n×"̰ÿqÄ —¾;ƒ°;…ƒÛK°CKœ(¤ìà“x «%ž­žöR¹T¨xÌgöW(f_1dmûc�üm;˜^Êï UÀî”î?Á ]„`�”ÄѦJ «•¿K³ÇÍýþ×"ÊRh-Ÿx¯²BÅœÐiÁYÛ‰QÛ¯<‹^‚ï NÀîî4Á <ÔSÃ�Æ"ÖCi`µà‹bø 3H£Ÿ5t²FÅŒsj…ÎLÛxSÌ0ªÎ?T(þ”“Í~»Îv�î\¾©¾µ«Æ7Å -Ò]`KõSž­N5h™;ÔòXq>NÅdYIéÚ�É܉Ϸwó©­�ÞN !“ùíÝüöÝ�;™•#™a;ƒ»u´Ê½‡ºÚÊ÷Õ9ü‚‹+=vvÌ×%1ÕÄJ¿zéì_w9‰T™Ä܃=xÖ¢Ò mb“V�ªS8_],ÖÊ÷ÜÎWt¼ µ^oøÖÇyé3�^Úï -×Kn§|p 4?ôìUþ´ÏÄÖâ ¬–þóúB˳|ÃÛ°Ä'¾ðk‹ŠÙ— IiLÛþk›žŸßw6=6ßÇÚz¤½ôÚùŒv§X°C{0´d¹°e>�­­˜'ÙK£µ-“xùÕ33 Ù -s ^\·‡áo©�Èô’~g¨v'}°Ã{0t™Â8Â4^§Ô°â~¾¤÷«mfGÊ ï,Øò‚ðbÅáqâ¯P1ñû.ŒÊþ6ñ‘é%þÎPìNüàï¶`^h¤øOÜ(©‰éõ¿ ü IÔÄendstream -endobj -940 0 obj << -/Type /Page -/Contents 941 0 R -/Resources 939 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 905 0 R -/Annots [ 943 0 R 944 0 R 945 0 R 946 0 R 947 0 R 948 0 R 949 0 R 950 0 R 951 0 R 952 0 R 953 0 R 954 0 R 955 0 R 956 0 R 957 0 R 958 0 R 959 0 R 960 0 R 961 0 R 962 0 R 963 0 R 964 0 R 965 0 R 966 0 R 967 0 R 968 0 R 969 0 R 970 0 R 971 0 R 972 0 R 973 0 R 974 0 R 975 0 R 976 0 R 977 0 R 978 0 R 979 0 R 980 0 R 981 0 R 982 0 R 983 0 R 984 0 R ] ->> endobj -943 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 481.9349 152.2025 492.8388] -/Subtype /Link -/A << /S /GoTo /D (a00077) >> ->> endobj -944 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 483.9922 513.9963 492.8388] -/Subtype /Link -/A << /S /GoTo /D (section.7.1) >> ->> endobj -945 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 470.956 176.4612 480.8837] -/Subtype /Link -/A << /S /GoTo /D (a00078) >> ->> endobj -946 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 472.1366 513.9963 480.8837] -/Subtype /Link -/A << /S /GoTo /D (section.7.2) >> ->> endobj -947 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 458.0246 162.175 468.9285] -/Subtype /Link -/A << /S /GoTo /D (a00079) >> ->> endobj -948 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 460.0819 513.9963 468.9285] -/Subtype /Link -/A << /S /GoTo /D (section.7.3) >> ->> endobj -949 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 446.0694 148.8948 456.9733] -/Subtype /Link -/A << /S /GoTo /D (a00080) >> ->> endobj -950 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 448.1267 513.9963 456.9733] -/Subtype /Link -/A << /S /GoTo /D (section.7.4) >> ->> endobj -951 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 435.0905 161.0693 445.0182] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -952 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 436.1715 513.9963 445.0182] -/Subtype /Link -/A << /S /GoTo /D (section.7.5) >> ->> endobj -953 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 422.1591 128.4121 433.063] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -954 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 424.2163 513.9963 433.063] -/Subtype /Link -/A << /S /GoTo /D (section.7.6) >> ->> endobj -955 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 410.2039 146.4744 421.1078] -/Subtype /Link -/A << /S /GoTo /D (a00083) >> ->> endobj -956 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 412.1416 513.9963 421.1078] -/Subtype /Link -/A << /S /GoTo /D (section.7.7) >> ->> endobj -957 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 398.2487 112.9203 409.1527] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -958 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 400.306 513.9963 409.1527] -/Subtype /Link -/A << /S /GoTo /D (section.7.8) >> ->> endobj -959 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 386.2936 147.7889 397.1975] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -960 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 388.3508 513.9963 397.1975] -/Subtype /Link -/A << /S /GoTo /D (section.7.9) >> ->> endobj -961 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 375.3146 155.5297 385.2423] -/Subtype /Link -/A << /S /GoTo /D (a00086) >> ->> endobj -962 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 376.3957 513.9963 385.2423] -/Subtype /Link -/A << /S /GoTo /D (section.7.10) >> ->> endobj -963 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 362.7568 126.2002 373.2872] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -964 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 364.4405 513.9963 373.2872] -/Subtype /Link -/A << /S /GoTo /D (section.7.11) >> ->> endobj -965 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 350.4281 142.2503 361.332] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -966 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 352.4853 513.9963 361.332] -/Subtype /Link -/A << /S /GoTo /D (section.7.12) >> ->> endobj -967 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 338.4729 157.7419 349.3768] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -968 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 340.5302 513.9963 349.3768] -/Subtype /Link -/A << /S /GoTo /D (section.7.13) >> ->> endobj -969 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 326.5177 153.3186 337.4217] -/Subtype /Link -/A << /S /GoTo /D (a00090) >> ->> endobj -970 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 328.575 513.9963 337.4217] -/Subtype /Link -/A << /S /GoTo /D (section.7.14) >> ->> endobj -971 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 314.5625 168.8202 325.4665] -/Subtype /Link -/A << /S /GoTo /D (a00091) >> ->> endobj -972 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 316.6198 513.9963 325.4665] -/Subtype /Link -/A << /S /GoTo /D (section.7.15) >> ->> endobj -973 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 302.6074 180.9847 313.5113] -/Subtype /Link -/A << /S /GoTo /D (a00092) >> ->> endobj -974 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 304.5451 513.9963 313.5113] -/Subtype /Link -/A << /S /GoTo /D (section.7.16) >> ->> endobj -975 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 290.6522 140.596 301.5561] -/Subtype /Link -/A << /S /GoTo /D (a00093) >> ->> endobj -976 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 280.7543 513.9963 289.601] -/Subtype /Link -/A << /S /GoTo /D (section.7.17) >> ->> endobj -977 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 266.7419 161.0694 277.6458] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -978 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 268.8987 513.9963 277.6458] -/Subtype /Link -/A << /S /GoTo /D (section.7.18) >> ->> endobj -979 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 254.7867 162.1755 265.6906] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -980 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 256.844 513.9963 265.6906] -/Subtype /Link -/A << /S /GoTo /D (section.7.19) >> ->> endobj -981 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 242.8315 163.8392 253.7355] -/Subtype /Link -/A << /S /GoTo /D (a00096) >> ->> endobj -982 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 244.9884 513.9963 253.7355] -/Subtype /Link -/A << /S /GoTo /D (section.7.20) >> ->> endobj -983 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [103.1769 231.8526 167.1461 241.7803] -/Subtype /Link -/A << /S /GoTo /D (a00097) >> ->> endobj -984 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 232.9337 513.9963 241.7803] -/Subtype /Link -/A << /S /GoTo /D (section.7.21) >> ->> endobj -942 0 obj << -/D [940 0 R /XYZ 90 757.9346 null] ->> endobj -62 0 obj << -/D [940 0 R /XYZ 90 739.9346 null] ->> endobj -66 0 obj << -/D [940 0 R /XYZ 90 553.9527 null] ->> endobj -939 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1007 0 obj << -/Length 287 -/Filter /FlateDecode ->> -stream -xÚ¥Q=oÂ0Ýý+<&CÜ»s|¶«¶¤J­È†( ,%Q£D…_‡µl•‡{÷éwïPBx(=Hk¬ò:g¹; -�‡ž ÓYÈg·�…xx!/½òL,‹ý0�QB’E¹N(O3òÀ˜ô‹· $¨ ‚§m·�hÕµý®ëÛ]RÅТ.«Sº)–⹘ŒüŒf¼|ÿ%Ö�e๠´wF~zOò(rÒWçS¬Äû4'&††{k^Ò;VÖÙ{F6ö_1]hA­oµdå­v-5…ÆœIZ Öò 輪«vÛUe”©©£}½‚eŠ&éGi´0#=£Qwàˆö)™¤i£ó÷@çñPÍé|¨êß×0¨'j7*ý”â} endstream -endobj -1006 0 obj << -/Type /Page -/Contents 1007 0 R -/Resources 1005 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 905 0 R ->> endobj -1008 0 obj << -/D [1006 0 R /XYZ 90 757.9346 null] ->> endobj -1005 0 obj << -/Font << /F29 499 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1011 0 obj << -/Length 3129 -/Filter /FlateDecode ->> -stream -xÚí\K�7¾ûW9ÍÍ÷c/Aö‘µÎÂHØÃf©m ÑHIc'ÿ~É&»Å&kÈžI¶g ¦Ý*V}]¬¯H›MfØþ#3ƒgJ(d—³åÍ <{ooÿó ?sÊì_à‡¹ l6�›þõêÅ˨™QŒ¤¤bvõÎ)—Ü ¡Ùìjõß‹¿­·§æp9§_ˆËÿ]ýË7àHiE\lõ -Ä5åmƒ»×o½0AØ_ü°Ù6þêõnÕüÖë Y4è� qAe«C r9'㢶7›ã)(c3ƒŒt­[]T#ÅI«êUs⛣ÿ»ð¶®u{µ~ØnýÅj¿¼»iv§fåÿÿ ÆtÛ„æ7§µ¿º>lšÐtÕ—‡Ííi³ßÿâ0½øÇUïvB"Ô:œkŽfƒNËú¨—žÇâ¾£âÇ$Øþª=ku�»¸½=¾\­—·Ë—½ŸÏm¸BÂ8KN´•BKÀƒœ#!‰ rèr.lO|ýsþ“t°À a¦ØÁgòuR@ÇÆ�”ks½ðÝw™UR1ÈŒ@Z k�PD˜%Ĉ¸Sž"Œµ¸ëÄwë¯q7aÜE=VŠ»¬cḋ;öž¸+|tÜ ƒ4¼w�Xwëf»ÝÏ?^›ËÛÕË,+;Ò¸Œ-øŸïƒÌO1¤N¾)Óë %h|†�áPª�Z%p¿ôR”aD¸áC¿`�¿ßùÁ©¹$ââ·ÅÍm7pvÞzIÅÅGÿŸÓ>Œo‡Í)Èõƒ¯õòv³\´Ã[: -Þö§ýq¿üÕ=ps:vC¦ éss£|ìBotÍ*~È´;7®ÀðTÂ˜Ž c›í&´Æ�Ø#Â8²0.ŒË�2½P¯ó0Öˆ©8Y© -Æ\�„ ãWÍbÕN@)31w-.ÞíÃÍÅÎÿƹ½Ñƹ•<ǹ½ÙƹýÛŹ½ôqnE’8wR.ÎíƒÏæZ#NŒv=�Œ_!øçBÑg4@qc6xõ|eÂNÖ僓Á¹Y!!Ÿ -4˜ - óS h”!I섦’ :±>šã~û!O‚"F£þñŽT«ƒá\Jq‘�_DS»€”&Á‘º¡“ª™×vñH•ÚwÄÿû¿îÆ©n©¶[Ü4Ã᪢V+‹90 ·é [¹zJ*Ê>·9\ª€/Gñ èÜL»g‚™"˜Š -6kr¥t� -�Øh*DzGQ¡Œ#ÕšPa�S�!;÷Ò ŽŒ -AªfÞRÁh!†öTÈ#{¹_J¬»�²/Yıoç;_ÒÚ¦�\À±£xQôt¦½åE>emy"˜h²ÈŒAŒWk<½XÏ‹ãÍé6g…�;1�å,V[¢E'_Ñéu8`tP6�p’bH=ÐIÕ,+iÝio ,;JüüãÕÛ{Ö7wé -xíL.&ãú \çwÑ -yt Ê.δ{.0ˆ 0‚‰Æ¦¢¸ZwêÅÆr!R;Ž e™Þž khÅFŒI1d\R5Ë– ÒàÄC.”Ç%žE]¬�hÀë£øRì†L»ç ù"˜Š/J ¬ªõ²^¬çË©ÙîšP`VÒ>‹5gUA¾%ÓÛRÆU ÕFšr‘€È¦TAªfÚN½˜�Ö M·œÙœŒJL)Õó+'÷� 8~mŠ=‘i÷´‘ m@SM¹¤]˜òj}®{m"ÍãhS†’é=ÓX‰Ä4 ˆŒ6AªfÚÒF+F†¦AÚ|;fàáD?9–~Å’¢ã3íž%`F0Õà"l‚ÅŠÔXÒ‰=€%‘æq,)CÉô:(4¼û„Œ%02ž©šqC�Lm·49�(Çæ”¢ôgPŠú¤œ>Š4Å^È´{Ò€õ^ÁTC ÓH*Z+øöb M¤yiÊP2½1iÖi¤vÞÀHÓJÕŒëTEÌÐø(Ö¨§=/»�5€×G±¦Ø ™vϰ6 #˜j¨¡ ¦kµá^¬gÍÇæz¹Ý4»SÎ)‘ÂJÏbÝ%Þtò50™^¦Çìõ[W0çäŽt�4UŒS‘æR �;Þ¼ -^Ý&ÿifb¯®º"�;¨‹Iñ…;à«Qá^ô^¦½ w‰ÁpLî¶9¶W•pïÄî‘îqá^“é†û -÷vXàÂÝ�QEã”ÿëÀøà�€d­áßó†¶ pß(ši÷   @SM“0ETáj¡·‹pž,ÐHIÌf±þ" ‚| P¦·}?ætº]Í—ï7PÒ·«n ¼PŸKú„54îXðŸK�/škxºä_GÛ!»SsxçÞPY,‡[‚âK™ŽŇ¢k3ížp!D0¨ÁV\² -‚0ú†cù7(ðaèÌpT X%8€QÁ UŒ;>H£äÐøåCeë\�Oý�ÛÆDÙ‘™výŠ~ÁTѯ,LkõØ^ìÁÑéýe@™Þ>ú�j“‘ˆ•‚H}ÑIÕLÛ.“\-WCÿSÎð?õÀ¹}uŠý�i÷Ô·2`-%¨´í¤®i{±u’Ã’#áÎwá(ºÁ# ·¿ùõÈFõ�FÜY…CyŸ‚‡4} -Ò(|t¶ )Æj%Î^ÌÁÛn®_B‡â¸�òÄúJÙ9ˆ×ì§Z�ù›ææú’cèMV®‘Ö"‘>{ª™1å²BlÛeç››ýá÷pfpë^ïŽî—QÁæ°¿;mvÍðrŸN.œ<*Ýži÷¹Ü0ƒL•‹9A˜Z³«#Ò7Šeû©Ö1ò‚?7ˆóöœoŒ"cF�ª·Ô0ŒÉ¡õ?H .ôÓ¡àåQÔ(º=Óî©n‹Á¦¢µq"E­âÙ‹µÇÈ7·Ð¼„;ß *Ì7–.dÀy 3ˆš¯GIÿœ‰LÔ�¥‰LÖëðD&îõ{&2%ƒ�žÈØ+ÆH­Ù‹ÅA9Ì×IÅÍ,VXLØA¾† ÓÛŽ˹;é²]\7Û#ô©]!bF0Ù §AªAÛ¤ ´B7œŒñNF_¸Ô½õ·–û�ÍÛwý�:{ëzql?«`»†¾Zo/¾yÓ>–ÿu|pg÷Û»æø�¿ñ®YÌý‘hhŠÚ†¦NÊMàÞ3Œ`¢¡‰†(¯Ÿz±jˆŽÊ™Þ�Ž7§åÈ’!) K€¤è¤j楫L™Ä|m˹Ëíé¤apó¼�\ƒÐÐ?ŒSë)ÚÞ³šo’-;©&™nA®Óe_eÚÛ˜Và3Œ`ª˜¶i›àjU¨«Çt¤p\L—dz}LÁ̸wŒJ¤OÞIÕì2‰4Ã|h×EÝ›bÀ†Móìg€}„½1Š?ÅîÉ´{þ€gò`Í ]…ߨj‰«½\¹u_ -¿¸ôu¹òç-Wâî,,Wò^—+ƒ^‡—+Eƒ�NêÂ%¯jy©«'õHḤ^F�é=G|ž×FL‘€H¾“ª™i�“‡wyýíðó݇߮‹®èTÞøeŠ?Õ8~T -/öD¦Ý§pð #ÁT)œs¤’ -[:±:["…ãØRF�émÙr‚§@Ú(• ¦@­TÍ.³ y­ÙÐnO•Óú`ùp¬�¢6D=�yàòQ$)öA¦Ý“|íF0Õ�Â(ªZëÅê$‰Ž#IA¦·­ïlnlÂà‡i¸BXÙéÖH¶k¤jæÝWP%åCóŽ+W—L\´0ò¥À*ž*Ow�âIÑÿ™vÏð- ÁT<¡q;¨ñ¤«ó$R8Ž'e™Þ!OÖO$uËê€'­Tͼ�¦Y 64_ãIåC˜?«5УTì˜L»'¸5#˜j6†5b˜U‹¬�X�@‘Âq*#Èôó]³y¿¾Þß7Þ(e—÷J&x²Ý– UCájFê!ŠöëO‹ÓÂUMÝ‚ÄWY™"–N»_ç¡ÔêîwX�ß^ιûtv[fu¿\ÿî[¼~ûAú;þ£Qîj±[ùÝÕZáðCל„æîÃÙÝ® ‘B w]ÞÝ�÷]¾ÿémúi*û“ûãùÓ¢a}ÅÌ3Ø`¹‡ôF"Ƽ;·ºŸðAÆÓÜî‡l'aë¾"o» -QŒù¨¯ÌÿÝýw}endstream -endobj -1010 0 obj << -/Type /Page -/Contents 1011 0 R -/Resources 1009 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1063 0 R -/Annots [ 1013 0 R 1014 0 R 1015 0 R 1016 0 R 1017 0 R 1018 0 R 1019 0 R 1020 0 R 1021 0 R 1022 0 R 1023 0 R 1024 0 R 1025 0 R 1026 0 R 1027 0 R 1028 0 R 1029 0 R 1030 0 R 1031 0 R 1032 0 R 1033 0 R 1034 0 R 1035 0 R 1036 0 R 1037 0 R 1038 0 R 1039 0 R 1040 0 R 1041 0 R 1042 0 R 1043 0 R 1044 0 R 1045 0 R 1046 0 R 1047 0 R 1048 0 R 1049 0 R 1050 0 R 1051 0 R 1052 0 R 1053 0 R 1054 0 R 1055 0 R 1056 0 R 1057 0 R 1058 0 R 1059 0 R 1060 0 R 1061 0 R 1062 0 R ] ->> endobj -1013 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.3629 456.6823 228.655 467.5862] -/Subtype /Link -/A << /S /GoTo /D (a00100) >> ->> endobj -1014 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 458.7396 513.9963 467.5862] -/Subtype /Link -/A << /S /GoTo /D (section.8.1) >> ->> endobj -1015 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.3629 444.5481 229.2129 455.4521] -/Subtype /Link -/A << /S /GoTo /D (a00101) >> ->> endobj -1016 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 434.6502 513.9963 443.4969] -/Subtype /Link -/A << /S /GoTo /D (section.8.2) >> ->> endobj -1017 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [151.3257 420.4588 183.9331 431.3628] -/Subtype /Link -/A << /S /GoTo /D (a00102) >> ->> endobj -1018 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 422.3965 513.9963 431.3628] -/Subtype /Link -/A << /S /GoTo /D (section.8.3) >> ->> endobj -1019 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [151.3257 408.3247 184.4911 419.2286] -/Subtype /Link -/A << /S /GoTo /D (a00103) >> ->> endobj -1020 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 410.382 513.9963 419.2286] -/Subtype /Link -/A << /S /GoTo /D (section.8.4) >> ->> endobj -1021 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.3543 396.1905 174.6379 407.0945] -/Subtype /Link -/A << /S /GoTo /D (a00104) >> ->> endobj -1022 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 398.2478 513.9963 407.0945] -/Subtype /Link -/A << /S /GoTo /D (section.8.5) >> ->> endobj -1023 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.3543 384.0564 175.1958 394.9603] -/Subtype /Link -/A << /S /GoTo /D (a00105) >> ->> endobj -1024 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 386.1137 513.9963 394.9603] -/Subtype /Link -/A << /S /GoTo /D (section.8.6) >> ->> endobj -1025 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.0952 371.9223 181.8208 382.8262] -/Subtype /Link -/A << /S /GoTo /D (a00106) >> ->> endobj -1026 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 373.9795 513.9963 382.8262] -/Subtype /Link -/A << /S /GoTo /D (section.8.7) >> ->> endobj -1027 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.0952 359.7881 182.3787 370.692] -/Subtype /Link -/A << /S /GoTo /D (a00107) >> ->> endobj -1028 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 361.8454 513.9963 370.692] -/Subtype /Link -/A << /S /GoTo /D (section.8.8) >> ->> endobj -1029 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.0952 347.654 190.1196 358.5579] -/Subtype /Link -/A << /S /GoTo /D (a00108) >> ->> endobj -1030 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 349.7113 513.9963 358.5579] -/Subtype /Link -/A << /S /GoTo /D (section.8.9) >> ->> endobj -1031 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.0952 335.5198 190.6776 346.4238] -/Subtype /Link -/A << /S /GoTo /D (a00109) >> ->> endobj -1032 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 337.4575 513.9963 346.4238] -/Subtype /Link -/A << /S /GoTo /D (section.8.10) >> ->> endobj -1033 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.7115 323.3857 213.3523 334.2896] -/Subtype /Link -/A << /S /GoTo /D (a00110) >> ->> endobj -1034 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 325.443 513.9963 334.2896] -/Subtype /Link -/A << /S /GoTo /D (section.8.11) >> ->> endobj -1035 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.7115 311.2516 213.9103 322.1555] -/Subtype /Link -/A << /S /GoTo /D (a00111) >> ->> endobj -1036 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 313.3088 513.9963 322.1555] -/Subtype /Link -/A << /S /GoTo /D (section.8.12) >> ->> endobj -1037 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.7641 299.1174 212.6453 310.0213] -/Subtype /Link -/A << /S /GoTo /D (a00112) >> ->> endobj -1038 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 301.1747 513.9963 310.0213] -/Subtype /Link -/A << /S /GoTo /D (section.8.13) >> ->> endobj -1039 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.7641 286.9833 213.2032 297.8872] -/Subtype /Link -/A << /S /GoTo /D (a00113) >> ->> endobj -1040 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 289.0405 513.9963 297.8872] -/Subtype /Link -/A << /S /GoTo /D (section.8.14) >> ->> endobj -1041 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.7641 274.8491 197.1536 285.7531] -/Subtype /Link -/A << /S /GoTo /D (a00114) >> ->> endobj -1042 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 276.9064 513.9963 285.7531] -/Subtype /Link -/A << /S /GoTo /D (section.8.15) >> ->> endobj -1043 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [116.4668 250.5808 149.8812 261.4848] -/Subtype /Link -/A << /S /GoTo /D (a00120) >> ->> endobj -1044 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 252.6381 513.9963 261.4848] -/Subtype /Link -/A << /S /GoTo /D (section.8.16) >> ->> endobj -1045 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [116.4668 238.4467 150.4392 249.3506] -/Subtype /Link -/A << /S /GoTo /D (a00121) >> ->> endobj -1046 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 240.504 513.9963 249.3506] -/Subtype /Link -/A << /S /GoTo /D (section.8.17) >> ->> endobj -1047 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 214.1784 179.5994 225.0823] -/Subtype /Link -/A << /S /GoTo /D (a00123) >> ->> endobj -1048 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 204.1609 513.9963 213.1272] -/Subtype /Link -/A << /S /GoTo /D (section.8.18) >> ->> endobj -1049 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 190.0891 164.6655 200.993] -/Subtype /Link -/A << /S /GoTo /D (a00124) >> ->> endobj -1050 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 192.1464 513.9963 200.993] -/Subtype /Link -/A << /S /GoTo /D (section.8.19) >> ->> endobj -1051 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 177.955 135.336 188.8589] -/Subtype /Link -/A << /S /GoTo /D (a00125) >> ->> endobj -1052 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 180.0123 513.9963 188.8589] -/Subtype /Link -/A << /S /GoTo /D (section.8.20) >> ->> endobj -1053 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 153.6867 151.3858 164.5906] -/Subtype /Link -/A << /S /GoTo /D (a00127) >> ->> endobj -1054 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 155.744 513.9963 164.5906] -/Subtype /Link -/A << /S /GoTo /D (section.8.21) >> ->> endobj -1055 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 141.5526 135.8939 152.4565] -/Subtype /Link -/A << /S /GoTo /D (a00128) >> ->> endobj -1056 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 143.6098 513.9963 152.4565] -/Subtype /Link -/A << /S /GoTo /D (section.8.22) >> ->> endobj -1057 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 129.4184 148.068 140.3223] -/Subtype /Link -/A << /S /GoTo /D (a00129) >> ->> endobj -1058 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 131.4757 513.9963 140.3223] -/Subtype /Link -/A << /S /GoTo /D (section.8.23) >> ->> endobj -1059 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 117.2843 148.6259 128.1882] -/Subtype /Link -/A << /S /GoTo /D (a00130) >> ->> endobj -1060 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 119.3415 513.9963 128.1882] -/Subtype /Link -/A << /S /GoTo /D (section.8.24) >> ->> endobj -1061 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 105.1501 178.5039 116.0541] -/Subtype /Link -/A << /S /GoTo /D (a00131) >> ->> endobj -1062 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 95.2522 513.9963 104.0989] -/Subtype /Link -/A << /S /GoTo /D (section.8.25) >> ->> endobj -1012 0 obj << -/D [1010 0 R /XYZ 90 757.9346 null] ->> endobj -70 0 obj << -/D [1010 0 R /XYZ 90 739.9346 null] ->> endobj -74 0 obj << -/D [1010 0 R /XYZ 90 553.9527 null] ->> endobj -1009 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1091 0 obj << -/Length 1559 -/Filter /FlateDecode ->> -stream -xÚåZ]oÛ6}÷¯Ð£ Ì,¿%õ¥ÈÒµK‡Yç·®Y±…:’gËmòïGФB‰Œ¨®A×fÉô彇—çè’”QÅŠRÅ,)¡<Êof0Úˆæ×3¤¿^Šï—¶ÁϫٳW8�R�rÌ£Õuë�#À0ÂÑjý~ŽùâÃêMDh gÒ‘l=]\.–˜Á9Pݼ*w…º»¨ÖÅ­ì4ûeÕEÖÀáHÆý{öþŒÖà›$MXôY|€¥)Žnfóa7ûcö{çG}Ñvð��¤ $1#ÑÇjH–•c��¦±È ˆñ}Jˆ•)@1Á‘±j3PîŸ ‰P -xLÓÈr§¾9l´É»^xm?ôªÃ/«¢Ül¯ê±9Ø:`â@ÎxÌ0Æ(!�€؇ð'dð×"[1ï$Ÿ!n9@’ùu­×Y“]eGÝ\_«Ö]Y}\îê<Û©Ïf$ÇŸÄg -ç§c±V=®î”ÅÅå'®Zòz]¨¶¬Z«›¦ÖÆEËÕ%ICR.3 RÆtÆ”OAÐÖ§¸^ŸšÓA“öì�&´v/îÄøÐb™ 2‹%ƒðǽÐ4}è»ih*ø 9ƒÄñ¤/Ÿ™lº-í~.�ïr^PœQ0D@ð ÜÍLO”;ä‚öˆ‡ônÌlÁž—ˆQlž‹B–Çý®l@®mmÇŒLÄø•í�Ϊou’IL"{�¹î¬/œ×ª±Ñ×l�áü“üW—ÚU³-T‡u±Ëî -Ýz¶åëü7U‡0"Ö¯CÍöPŸ6Ûý©Qef­�2Q*˺²kOã§"å//A<ÁIÙ}a ²û=\‚:«¶%Чw?‚ÇÒ},×·j5<¦{cÖ½åpšîÇ8~5UÙzH -FÑk£PXŠ@‚äÓÃ+õ¾ÚêuY·÷b~fî�M–ô¯à(Jþu±c¶g&éft^ïJ7È«/‚ÇÒ K€Ø"¤!ݳ°n,‡Ót3ŽÀñkt³õé&‰‡<º‘F¡°‹z*ö<½°½-Z+½E“»ŸZ76S…¥äÄ ~:Zñd~’VFçÂñ®´B½Zñ"hMÕ -å', iŘ…µb9œ¦•qŽ_�à¯ì�o}KK dCÎÒR[…¢s -h*V”½èR2/‹|—ÚåØQQ¿=¸W‰«lŠüþàà¸/òRê*7‡ -UnuTšøýqß“ÃIÜMªã½å~ê__yGMõwűÞ�î»]ê¦Îë�-„”òoEoOž&Ñ{4qŽwEoÿ2È‹à±è�E½�YðØÀ˜…ém9œFïqŽ_›Þ[½Y‚Ù†‡Þ­U(8‡:Ão ²üPk¾ªããv.ŸßUi=¶ÝÅQÇù}î`‘:¦ßíÇ“ÎI*ͯã]©{UàEðX Å�„T`ÌÂ*°NSÁ8ǯFPï}'g Ž pD ­B±¢¤[Šà¼®$á7§ƒý�ßûèßm ÌVš?Õ]³'å“„2:Žw%âŠÁ#• &€PÎB§M�YKÓª¼u•‚)àŒ[¦¥ûǯ9fÎëêÚ·‰HDÚú8œ­€¶ -Eç‰xH ‚K©œiu´g´·™\ „‘ûÄdﳕrð¹øjuø’> endobj -1093 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 726.8189 179.0619 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00132) >> ->> endobj -1094 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 716.8014 513.9963 725.7676] -/Subtype /Link -/A << /S /GoTo /D (section.8.26) >> ->> endobj -1095 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 690.9534 161.358 701.8573] -/Subtype /Link -/A << /S /GoTo /D (a00134) >> ->> endobj -1096 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 681.0555 513.9963 689.9021] -/Subtype /Link -/A << /S /GoTo /D (section.8.27) >> ->> endobj -1097 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 667.043 140.3173 677.947] -/Subtype /Link -/A << /S /GoTo /D (a00135) >> ->> endobj -1098 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 669.1003 513.9963 677.947] -/Subtype /Link -/A << /S /GoTo /D (section.8.28) >> ->> endobj -1099 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 655.0879 140.8753 665.9918] -/Subtype /Link -/A << /S /GoTo /D (a00136) >> ->> endobj -1100 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 657.1451 513.9963 665.9918] -/Subtype /Link -/A << /S /GoTo /D (section.8.29) >> ->> endobj -1101 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 643.1327 163.0021 654.0366] -/Subtype /Link -/A << /S /GoTo /D (a00137) >> ->> endobj -1102 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 645.0704 513.9963 654.0366] -/Subtype /Link -/A << /S /GoTo /D (section.8.30) >> ->> endobj -1103 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 631.1775 158.0208 642.0815] -/Subtype /Link -/A << /S /GoTo /D (a00138) >> ->> endobj -1104 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 633.1152 513.9963 642.0815] -/Subtype /Link -/A << /S /GoTo /D (section.8.31) >> ->> endobj -1105 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 619.2223 158.5788 630.1263] -/Subtype /Link -/A << /S /GoTo /D (a00139) >> ->> endobj -1106 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 621.16 513.9963 630.1263] -/Subtype /Link -/A << /S /GoTo /D (section.8.32) >> ->> endobj -1107 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [118.6786 607.2672 153.6074 618.1711] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -1108 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 609.2049 513.9963 618.1711] -/Subtype /Link -/A << /S /GoTo /D (section.8.33) >> ->> endobj -1109 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.6599 595.312 166.8776 606.2159] -/Subtype /Link -/A << /S /GoTo /D (a00141) >> ->> endobj -1110 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [497.0598 597.2497 513.9963 606.2159] -/Subtype /Link -/A << /S /GoTo /D (section.8.34) >> ->> endobj -1092 0 obj << -/D [1090 0 R /XYZ 90 757.9346 null] ->> endobj -1089 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1122 0 obj << -/Length 1862 -/Filter /FlateDecode ->> -stream -xÚ�XK“Û6¾ûWhoT•Åà{o‰�le«œ¸v§r‰s€HhĘ"¸$èÉüût£$%Ñò–ËC ÑèFè$vü»2Úåi–q’íªË›h÷ ä½¼œÈ¾ ‡TÄ»ÃzëOo¾ûI–;…Y&ÓÝÓ …gI¦E¼{ªÞ�Uoõ°?È4 -²ýOÿ¦ I˜¹À ÈMä�‰Û0ýü‘˜EÑàƒ©§VÓø½©¦‹î¬²�éfi" á@’¥eq˜¤2sÒ²Pì"Š¢àã°E`¬±g7Òª",ÓÔ �eXÊBz³ˆ÷Úª¦Õ5E�ÕÐô«ƒÄ;ؘ¡fƒ§*…óq ÍNëAæQ 4)+EsûÚk™-´ÍóÙ¾hüK £UÕçV�,a̵›çÎ� –Nfà-z/ÓàË^¤�ÚW"^ö"Ð3ð´2ÝhÕÌ»Ç×Ñê‹Cí˜Á;Æ©:“ùj¤o­uïÃX_Žº®=@^Œ›v�Qw£wÚ¾ì®}f‚3ÂYof2‰7ñK‚~0hÕ—¶ %¼:­Z­@�4rýå¨&wYŽÌÅÁ - Îê¡Y͉u±&Í¥o5z �„Žä¼ i~ÒJu[PÙ¥§ÑöÒØó5ZH1“eÄ;úþgŸEÁúð¯ÿ½+Ù+-ØÙp@Å` Ý]±ö¶·èR×î–æÞA�Õ9(|¯Tس²4º¹™Eë±5Õç¦{¦¸�ås°ØŽ%™þ/ -!ÔËÂÁ€ßLJtq`Mœä ”¸bÏštR -�3ƒÔ|VÕCâ’Qp CY(¢NzH“$x"9yÐOCoF/Ôo¿º¤4üµfË#fßâBåLÕâ\Ÿ¢(6hä ­»k:9˜–ˆ‹ÇÀ¤2(‘À±Âá­¦µ‹ªÎ0#-8‡êijYÐejmÖÃ��ÁqtãÝ&ÜÞ½Ë.uƒqçÌÂÚ "Ÿ±©9ÞÑç4unØÎr™Š@Õ_ Åà™�cŠà‘²¾gŽ&f�=§¯Ç©uö ZQ -î6qŸwý-Å÷€°bºÝÈtå±»@Ä&v77L•�M ¤TÛ’SŒ´â.,8;ò*”Û"ø¹#.o?ò|#¢ð” -1¤ÒäJƒ‡-É�ÌöÈ»1ÝÅ™ލ6ƒ�ª›ÀŠW¦x,Ö(P�ìÏO³¦ƒ"ª Dî]!̸p ’鼇ËZ¤ã&š‹X 1Þx ô²c#!­9�t¦\ä$PлšHN7R¨Ø$œw�Âõ HêDíyõ*Q"/HváW‚ó;ŸâE}FÃ�SÁŽÆù¬VŽáwg•>M$ÅâN,ÎÕõ�KóU¾9}ŠÒþ‹»¨önÝù*v†éš»5¦7KEs n = tâF>¦KºYÞ…®\Ç4ð˜R•r}M)Wå©äXuD«@QDXÉ%zmh¡3Ì8@¤6Ã|NGu¯Ê¥¥¤šnù†™ÌÒàâû­,¹é·`q‰*™yò}mÂÝÔ¦.î+hƒ�—Ýåë¾å½T¥XŸâC bèžiÒ*×;˜�I]ÌÔÙ‘5Ÿ6ÓÝ"E‘’oÓªcËd¶öƒ·&qBÆ—‚(º“V®äÝS ’2”ˆÛ -£ÓÅŠa+€@c\$‹Tý Âé>pñ×…4~¬qæú–^‘„e”e×zaè¹Çç—w¯«Þ²ò%¼žïù:ÛÝv±pcÍq ºŠÄÄ~æÆ}P ©'‡€ú* +†G€z¶oúHã -ÐÇzg@×zßï�÷Þ¬‡ÁÐ3pó`Ïí6c÷³Ikºç?/ýÜ'ÝXfaœ_…oY~3}ººàjô°­4þ¶ª½w›ñB2þ‚ñý.´÷-Îâ�Ü  gÎß�\ØÑýcnÝHÜ#™‹P$ùÿ÷[çßü?‘endstream -endobj -1121 0 obj << -/Type /Page -/Contents 1122 0 R -/Resources 1120 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1063 0 R ->> endobj -1123 0 obj << -/D [1121 0 R /XYZ 90 757.9346 null] ->> endobj -78 0 obj << -/D [1121 0 R /XYZ 90 739.9346 null] ->> endobj -657 0 obj << -/D [1121 0 R /XYZ 90 553.9527 null] ->> endobj -82 0 obj << -/D [1121 0 R /XYZ 90 553.9527 null] ->> endobj -1124 0 obj << -/D [1121 0 R /XYZ 90 520.1647 null] ->> endobj -1120 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1127 0 obj << -/Length 2807 -/Filter /FlateDecode ->> -stream -xÚ¥ÙŽÛFò}¾B� äöÉÃX,âc6o|¬­Eâ àPœÂ©�TƳ_¿U]ÝTó�d`aŒÙì®®ª®»‹â+ÿø*e«XÇa*U´ÊwWlõÓ?]q»Àzà¼Ú\ýíŸ"]¥a‰hµ¹7"jÁÅj³ým-’ë@$,fëÃíGj¶æ!£Á»f{¨ -¿iòî¨û¬/›úú÷ÍÛ«›Í@ײ¥eÄ‘êŸW¿ýÎV[`ïí ešèÕ¼°�§©Xí®”�ú|õï-˜ K§Ãå@Ät–“ÇpØXO/½Ós…J&jå P_„ÐÓqëBË•‡nFnº@”«0eQ4"ú:«I°wVÀ‡®ØÒè©ìiÔ´Ç™æÐÓ‹Ûøáó’˜y¢õiñxçäãÀ. èEOBçé"òé~l›k®×•Û¢³ÂªšükY?X±\sGÙ/éþPU4Úª¾ úǶȶÃN'Ø®Ïò¯A[óG\„C‚…Y^ÐÔâ$"^n¾e»}åøÈöûªÌ�/t/Ô©(Œ¸8­àŒ°‹j8Kñ¨† t�Ftß»¦}¦ƒçpà¾ÍÊÚk÷ÜõÅ®[’OÂ䌣zëç$`¡. à 9ïüg‰Ç÷ˆÞü…6‘/ضåµs¤w:þ¾mú&o*Ïœ–d¡Sª2=m>Ài `Åq–âQè:�Œè¾)Š}eí¡ØÝÛíecБ ‘àÉó×ÏßB]>ýrÞáÏÎîý\Ô�‹uћԴ_íDƒqêtÙð7Ì5Çkb÷æ�Û÷·›/L3øãSfKB!ÓxÂÌ4á;¨ ,̱! ?€XX².Ð_¿§Í‹’Q: -É¿W0üSS¬V,¯n~º}J.š³P³Tž—Ëu�…96’‹±Q%ÎÃTkªKÀ·%J)Ø–SîLjð7,Ôï̼ýùö—›“ÊÔ2LX’NøšjÓA]àFB�R©ˆÇÜ�yƒt¼Lee|J\ -³d}·¸ø ÎñÎÄeíDÆ£o(›Ÿ?ݼ<é\ÆP×H¹RiFŒ/ (ð âÖyÆ„bá„'1œ âOÌ’EŠ(ð¡æwù$ “€+V!ë©-Qì…2«ºf´á~KÁÏÒ‡â%á -†:ƒâ†K½Äæ¸|³p˜½ÜyE2lŠ lÏõ„LB)€ÀY PxƒÚSIBq)�5šé¤FÙª¼k3¼I‘¬K;ÙU‘™Ø‚o‡z[´4ÌîÕç7A×?W…ÑCi_úǬ·ÀUÕ`¬zêh×}c±Ü5Ø -ÀQÝÔAÞìvE›—˜šÍ6pS4}6MáG0ê,d„h qלÏÜ€kW·ş‡²-Pà4QZ}æÖ×Ûr²úà_†Œ™ë¹G¶@´*‰”a+ -y( te�^^#_p_o;»ÓW -3´b©§%¦*�™£J·Ý»òÔ–}�—4|¹{¦çËm¶#Ø7‡ú+‚•¥Ï¹¢%ŠÑ��¿ÏB0TõIaI IP‚¤å¯+7ú—ŽÝŽÀßBæùáx†Ù„càûG¨û»LgÊ‹ 6ñ”—i:pPsú£“ϱ!ý,èô̵L¬ˆ¨e…2îû}Óöôrß6Và*Ï\Z°¡�#ÐòÈz?ç�»rÛ/¨jؘéè”V¸”¡ÒJd -¸u]Ôʰ#ð·Ìµ2ÇŒ 4UØå?>wáv¦Á4¶±¦¼Lƒ”ƒšÓÛã Û)­@ U�7Ø1÷L�2àB`{˜;çÔƒsJëœÛkž¬É×pdüí´—&éB<—Ìff@ª•{ 5{pª*û§ÿÇòPHj¡TEgqŒÚ€ÉLtö:ƒ�cƒß Öë-UšÀªÏ` -ÕLÜÛíõR$õ -È¥þ\©ãaJÛÄë@ÂJo"m­‰S2üG*¤ìÕŸp‰Ç²5Š,DjÚHXTk±ÏþÐî›®˜lgQ3ñé7ô,±m,�ÎF|:¤x¡Œ!Äú ””�hÝPƒ'ʳ5Í.x9žv:ê­ ¤H—n‰¼ á.Ã>«é¢Â&ÓI�YÛ¬Åõq³“ãcÓ„Ьý¬O<¾ÅÎÇeݬ-“èñÚõ�ë÷…�8Œ„¢ v‹J—g¢RM¢°èz`Üôd1¤%LN¸gëh0ç5Ð`Ån¶;¯w -Xž÷²‘›Ì²ò˜¡%‘¥Y‚Kjï´ Ù33îýPÐëp*Om6$[2€å1c¸wÌòÏÁá3srÜà¬ƶÞèè­ì;GíÍ@ñ¡ "1T"ˆèy_æP.=/Ù�+M|î�s ÒÏÅvZ Ù¶-}.Èž‡ï14ðÅ„߬í�{W( ¶dÉÊ*»sßάd#½^4+*p’h—Ÿؾ%,P?ØE©`iR%ãC0M Z ÂÖ=`M…«™4±t!îd@jñxÁnØ:áËö5º3J�B9o‚´Æ"iêÄÙÍÀÁ`øb”šŠd´þ”�ˆ[ìü`9Ä€�Pæa¦=X�}í Ñ.Ûnš«.ü\±`[ÇoD�õ8™<·`O4Â"S(æpã5 žÊzˆe1(ÛmuÏ‘®›ƒ[­é9x%ŒÇ±F1?\(È #ËLFâeAGtÁàÚ¤MxôàoNcðºCÓиÁ©|oÀYôûDTFܹà ·ç �f -î„id6ˆÐÜPptŒˆ÷8?´’ðåî¹/º¥³Æ·ðÛ¸2ªxñ*Äà^Á#ý_¿1ØÂ¥ðfQ˜ÆpS5×kب"1°‚"þ©¨ñCšû†ÙÔîÇ/vð%|°/\Ø'{!ä a(#‹lýˆ’p_翨¹{v¿¦ùöüPÔó¯?rIJÿ¢Ô§endstream -endobj -1126 0 obj << -/Type /Page -/Contents 1127 0 R -/Resources 1125 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1063 0 R -/Annots [ 1129 0 R 1130 0 R 1131 0 R 1132 0 R 1133 0 R 1134 0 R 1135 0 R 1136 0 R 1139 0 R 1140 0 R ] ->> endobj -1129 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [364.0856 532.3134 409.2359 543.2173] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge6bae7dc0225468c8a5ac269df549892) >> ->> endobj -1130 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [455.8347 532.3134 511.5056 543.2173] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -1131 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [178.2535 520.3582 263.1547 531.2622] -/Subtype /Link -/A << /S /GoTo /D (a00142_g99e43010ec61327164466aa2d902de45) >> ->> endobj -1132 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [302.7829 520.3582 348.4913 531.2622] -/Subtype /Link -/A << /S /GoTo /D (a00142_g7b04a0035bef29d905496c23bae066d2) >> ->> endobj -1133 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [267.6923 508.4031 354.8052 519.307] -/Subtype /Link -/A << /S /GoTo /D (a00142_gad14bbbf092b90aa0a5a4f9169504a8d) >> ->> endobj -1134 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [462.2904 508.4031 513.9963 519.307] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2f8f70c30b9ee08a103fbd69a4365c4c) >> ->> endobj -1135 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 496.8215 138.0296 507.3518] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2f8f70c30b9ee08a103fbd69a4365c4c) >> ->> endobj -1136 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 461.075 239.3186 481.9864] -/Subtype /Link -/A << /S /GoTo /D (a00142) >> ->> endobj -1139 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [326.8799 360.3806 400.6034 371.2846] -/Subtype/Link/A<> ->> endobj -1140 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [132.4581 350.1928 206.1817 359.3294] -/Subtype/Link/A<> ->> endobj -1128 0 obj << -/D [1126 0 R /XYZ 90 757.9346 null] ->> endobj -1137 0 obj << -/D [1126 0 R /XYZ 341.7132 422.4291 null] ->> endobj -1138 0 obj << -/D [1126 0 R /XYZ 90 405.4028 null] ->> endobj -1141 0 obj << -/D [1126 0 R /XYZ 215.4248 351.5786 null] ->> endobj -1142 0 obj << -/D [1126 0 R /XYZ 90 336.3195 null] ->> endobj -1125 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1151 0 obj << -/Length 2493 -/Filter /FlateDecode ->> -stream -xڥ˒Ü6î>_Ñ{Zu•[+’zÎÍ™$®¸’-o2U{ˆsÐHìi•ÕRG¢<™|ý¨WkÚ‡-×X$ ˆÙbÀ?±Ë‚]%~¦ÂxWœï‚Ý3€?Ü F˜|÷x÷¯e¶Ëü,–ñîñh9ÄÂ�¤�»Çòw/öÅþ £ÀûÔíE굦5';ÒyÙïÿxü¸ …ò•„ È ¡w?<ŽRY©HÅeþy÷ûÁ®å>Þ¾ÊÒh÷“ÀY&wç»P*7©ï~»ûÏȇvÁÖÞ"¡¶6§V›“0MhoæTõûƒ -R/¿\º6/N4sPsÊ �žê¶øR5Ï8ËF¼Þ‹ÈûëRWEeî÷‡PưDø=wùù¬;šiÚ½Œ¼—ÅÒ¼0õ+^N•šÂTmÓ“´•3ÕÐúp BøYÑ–˜ ØŒ N­f8h4*ò@åd÷þÈ0ñc†–á§ŽŽÜ÷A†‰—wš}u®ê¼£‰iۿ¦MW4/ÚCצj4ð·ûy<ñús^54*«#êtÔ�n -ÆVVœ;„+ ½嬑¾ä]nôÒ2Ân¤79OªØ;¶¨´‚ýÛ#GÐÄûð<@™¼'ìeiXIF”e[ëžvñîqn{C´“�¬‹SÞTý™pÖlk çjå©DxŸ^Í©mp,½gÝhØnÛ¡ð8 Qx¯ 7.Èë¾%©ºhK�¼ÃtCazØuHïi/o0´ò”㌅™b~\L{ºKÛk«G´tš�ÝÀn‘ëתÄTá"À`zŠÃøªé�˜Æ¨E˜y4snþŽTÏ q£±`<‹–Ït ‚óP›êRóŒÄW†f—¶jL¿åVÇ®=Såôå,£Ð—͵£!ŽÈK)?V2t¹Ö÷�÷s[ä5±€î]•?�Ÿ­“kù�H“]”Æ>ü…›©ÑæT×¹?Íü2ù.ÊR? -El•úwkôýZª¤Ÿ()n‹©6äÎÓ²?*š¸¡àït‘Ö�³h�)[ú6-žQzýÒ]EÉû8œ¹ò¢k{æ™§™3⊼®1<”ðj:„~Å…VwzRiÓë!:;R°Ja³ º§HXW‘ÎwJ—œ±ÀA„Ûâ Î:·BŒu -FNAÀ¯lj‡ÚqÕDvºTæD£ÁØäµáíå=pÊ} з¡oÙOæ�sÁÁÂ�=MÔsç^¨I¼(ÖgA53Ê?¶ K–õ «xŠ8ž~+NºjÔTÅ@m€/un[@ÙHÏçò‰»*¼ã&ßµ`H[¶Ö/�ˆ’h/û+±Áù+M0„‰ -4! ¦ŒGCe«úào%û÷ØûŒkp¸4®…ä<°õ¾½64¨,"¡n à]TŸƒ@4Ÿ2Î09»‹:fE%1ŒùlìOa�›ú«C”eÞû£±7.Àäsõ72ÅÊS€ôdûý’¹Ö ²ÛA�ݨä�â|j8Ûè 9{£z]iïT!ç{¢ƒsÐ <ñjÞ’ä--p³ä `ºýÄÚö¢„³Íî„ÞØä¬Ò®ö �ÛXrâƒ�®.€”à~ÞæÀ«È,˜m9É.׬3È—õ^NÏíq®Ìk¿ñ| „~¤Ä›os‚­þRúa¤ÔÄ7&üë®ÖÈHÝ–7R}Kªý,ˆã¥TW•(ŸÛáêvåªÖåܰÐ-y3 Ý–:Zh.uÃB-M™wìQ£7N—WëI݆adùaœ†ofNpÃ0#ª¨Þ6ÌMy“a¾!Õf!uÃ0E{¾T£sð½FCÿ ¶ñ¹š1+DAH—ºG—>ÑÓºÞ¦ìÈ… aì¤í¾ôœß_‰†oY|U‡,Û”„ <7ÂÇ õªÐ}ßv¼Ÿ½«;} }aùǶ¾½¯¹l§;È,©–N‡…/ ×ç 8¸iMH0˱± ß_ßÿB8ŒäíwÚ)õ}ûýòÇjã�jlÃ�7}³Oè­úû¡‚ÈD(泔ћõ÷†¬©úÞ”èjï\"TÉZ_ÉT�/ “/d¾y÷©oK_ñ´§`üÓ•ì0òU$Å­ýFLÄ—A°Ù’Àá@çÅÿ×söSX"”œ¿,Ç~–¨Ôýð&|&Ô~| 7rwEp÷‘_Üà#ÆúÀ!ùÜKu/šÁ†b~aÇ ëžÛ‡Ÿ>1µ,Ÿ�¾oÿz}ÖÍÚ�ø«¡SmfŸÿQJ�êendstream -endobj -1150 0 obj << -/Type /Page -/Contents 1151 0 R -/Resources 1149 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1063 0 R -/Annots [ 1159 0 R 1164 0 R ] ->> endobj -1159 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [236.6531 419.6496 314.5786 430.5536] -/Subtype /Link -/A << /S /GoTo /D (a00155) >> ->> endobj -1164 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 93.195 146.3484 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00128) >> ->> endobj -1152 0 obj << -/D [1150 0 R /XYZ 90 757.9346 null] ->> endobj -1153 0 obj << -/D [1150 0 R /XYZ 194.5769 652.5717 null] ->> endobj -1154 0 obj << -/D [1150 0 R /XYZ 90 636.3994 null] ->> endobj -1155 0 obj << -/D [1150 0 R /XYZ 90 553.639 null] ->> endobj -1156 0 obj << -/D [1150 0 R /XYZ 90 546.5037 null] ->> endobj -1157 0 obj << -/D [1150 0 R /XYZ 275.1139 480.7842 null] ->> endobj -1158 0 obj << -/D [1150 0 R /XYZ 90 464.6119 null] ->> endobj -1160 0 obj << -/D [1150 0 R /XYZ 90 346.02 null] ->> endobj -1161 0 obj << -/D [1150 0 R /XYZ 90 327.3277 null] ->> endobj -1162 0 obj << -/D [1150 0 R /XYZ 90 308.6354 null] ->> endobj -1163 0 obj << -/D [1150 0 R /XYZ 90 111.5284 null] ->> endobj -1149 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1168 0 obj << -/Length 1828 -/Filter /FlateDecode ->> -stream -xÚ­ZMo7½ëWèE–ßËÍ-©ÝÄAb¤±Š’ P$Å*K®¼‚“þúÎ~�â.Eã>x¥}š7Î<¹ËÆþظ¤ãB¤R�·#:¾†¯_ŒXwû ÜâžÏF¿ýÁËqIJÍõxöµ± Qœññlùa"èô 7´ “ÃÅ[¸TtÂm/Þ얇ͪ½>Û-·«m5¯Ö»íôÓìÕè|æx;·”Ьfýgôá/Á½W#JDiÔø>PÂÊ’�oG’ ûa3ºýéì´7šœ�¤ŠaÆOxÑŽÇ`F Â4‡xp}Á]8ø¹–u8ܤEiÆUÇäí~*ÕdWíª›ýT“Õ|yßFa}{·Y¹0�a,gÁÀ*,ÓAm'Œ1R*Å»ÓFÂGªïÚY¹?1Zs"¹dÑÔð-“ðRƒQM¤0òh§¦ûȹ -Ç ¿âJ$ÁeÃ`>Û{õ7ûëîÖ;? €TkÔ;‹ëy÷z·˜oÚ¹Yì¶Õz{hf&ˆ+)Št„Œ&šBv‘¡JåMž–ÑÌh$½,étóÕ×Ýþ¶½ªnºâû2¿_ïRq½½n¿¹;‘¶ÑÕF«Ê"s”:’¢”´³r6¯æ­OWÕþ°¨û)3““9« …Ñ"š³> ‘³†æl’Ñ¡0^›�=Þûf´³(AA·úÌñаẋÀníÃ]ȹÇ�,�‘[Ô Öád+© ¥¦�ì‹íºZÏ7ëcKƒâ‚HÃSìRSlaø§½)Nóº)öyY®>RÊ·«0Êš - OŸe‹ÇÜì6KÔìóÅåÅ,pÂÂeY"°(Œ:°ÖDž*òj¢t¡²oñ¨C»‘/%à.2n‹ÂXkݸYLM5Dšç©©�N¬Ö«²nI˜G5?*ù²,HÁ -‘ç¤�>­R X¤i%µØÌ÷­´n—íEW0ëˆ:HÉãFDÕÁ$ÔÁÁPuH2ÕáµêÐãÅÕ¡Ož¡ˆ�ÝNf/ß�?;ºÁ)´AB°t  -!­Y}ØÎoWŸçͪ}Ÿ*É5œ›ÌœôЉÂq°cbN™šxɹûúø*bŠ-Ê´Ç�ÃŒnÅs»îšÖ�[žÙGs©ÄN’º¼öH3ÒÚgÎÉê¤C«]N??qqyº³§2=x Bˆ‡¶¢ëˆ#5E™;n ÇèVO/vœÊzl’#v 4e` [é„�eAæîŽ|t¢`Ì+غ Û ûj¾¯r ¸Û%mï×Ë¡�ß»­Ôa»8JB¸Ÿrø‘Q@î­Š<€Î�²Xcì`¨@ø -�ðZ‰èñâÑ'Ï Ä�Àn'ç—g§úb©†À¢0æÀZ¼/†™æJf�ÝâQ†vã}±)46ñ…±ÖPµ�%ü7™-§�N©……¥ÕbeÐÿ±ØÃîšpZÊLÿ=ôé–Y€ÜBÞ¶�ÉóÍnñ÷”�§�£óuu¢Cæ† ½VT&|@B& •‰$ãQ&^+=^\&úä2�¸Øídâý”q:yv1ûü×åìâu°ÊÂÞ�RjÒÁp(Ä‹ÐZL2xݼ֛ÏÌ88<êÁÐn¤»’P]2dÜ…±ÖjÖ_Ýáç²Ù¦$„k ‹¤,óJÐG'$ÄÁlN!þl\›rl®Ðl>w]Cw,[í«z�U®1êç´\B2I�m ¯wÏ`ªÞÓ¼®Þ}ÞŒzï‘çÔ{Ú�ÀnPïï_^¼>ëNkj:…xZ‹×»!Á$ª½A£ì}›±Jׄ›Z“’#¶(Œ3°6¨ôd‘ƒÃZçÌ"÷Щ"·°¼"¸YÛ‡��.r¨`^˜Ì‡*>út»ÐÀ²îðåzµo�T7k÷é®ù¦ëfê‡,õ³Ê°‡`šmÊø¼HhŠƒ¡š’dªÜÓÚa¿ZÕjóm]ÅE¡Îi²$¡nU)=9;t\µ´Û–G¿ÕÕèŠ�Ÿ0Áý^G×gH¦¢à´>©_œ‚ÿ]Çöbµ…†§²‡#¶{c/^Õ=tïþÓ§\<åÝ l0,Ý�õN9„»{u&|ÓíËwû–Û·ï׫à1¥‚5׺æEé?¡)pendstream -endobj -1167 0 obj << -/Type /Page -/Contents 1168 0 R -/Resources 1166 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1063 0 R -/Annots [ 1174 0 R 1176 0 R 1178 0 R 1179 0 R 1181 0 R 1182 0 R 1183 0 R 1184 0 R 1185 0 R 1187 0 R 1188 0 R 1189 0 R 1190 0 R 1192 0 R 1193 0 R 1194 0 R 1195 0 R ] ->> endobj -1174 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 661.3282 194.7663 670.1749] -/Subtype /Link -/A << /S /GoTo /D (a00155) >> ->> endobj -1176 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 576.9176 148.2809 586.6957] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1178 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 520.3286 184.2462 531.2325] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge6bae7dc0225468c8a5ac269df549892) >> ->> endobj -1179 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [185.5712 520.3286 195.3146 531.2325] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1181 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 437.9752 204.7293 448.8791] -/Subtype /Link -/A << /S /GoTo /D (a00142_g3d4c8bd4aada659eb34f5d2ffd3e7901) >> ->> endobj -1182 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 399.3979 194.7667 410.3018] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -1183 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [196.0917 399.3979 205.835 410.3018] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1184 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 360.8206 184.8042 371.7245] -/Subtype /Link -/A << /S /GoTo /D (a00142_g7b04a0035bef29d905496c23bae066d2) >> ->> endobj -1185 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [186.1292 360.8206 195.8725 371.7245] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1187 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 278.4673 223.997 289.3712] -/Subtype /Link -/A << /S /GoTo /D (a00142_g99e43010ec61327164466aa2d902de45) >> ->> endobj -1188 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [225.322 278.4673 235.0654 289.3712] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1189 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 239.89 226.2087 250.7939] -/Subtype /Link -/A << /S /GoTo /D (a00142_gad14bbbf092b90aa0a5a4f9169504a8d) >> ->> endobj -1190 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [227.5337 239.89 237.2771 250.7939] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1192 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 157.5366 234.5175 168.4405] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2f8f70c30b9ee08a103fbd69a4365c4c) >> ->> endobj -1193 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [235.8425 157.5366 245.5859 168.4405] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1194 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 118.9593 197.387 129.8632] -/Subtype /Link -/A << /S /GoTo /D (a00142_g9e97a0b4d5cc7764d8e19758f5da53ae) >> ->> endobj -1195 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.712 118.9593 208.4553 129.8632] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1169 0 obj << -/D [1167 0 R /XYZ 90 757.9346 null] ->> endobj -1173 0 obj << -/D [1167 0 R /XYZ 90 678.0824 null] ->> endobj -1175 0 obj << -/D [1167 0 R /XYZ 90 595.729 null] ->> endobj -1177 0 obj << -/D [1167 0 R /XYZ 90 539.14 null] ->> endobj -1180 0 obj << -/D [1167 0 R /XYZ 90 456.7866 null] ->> endobj -1186 0 obj << -/D [1167 0 R /XYZ 90 297.2787 null] ->> endobj -1191 0 obj << -/D [1167 0 R /XYZ 90 174.0645 null] ->> endobj -1166 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1200 0 obj << -/Length 2058 -/Filter /FlateDecode ->> -stream -xÚ­Zk¯Û6ýî_a`¿ØÀšË·È|Ks½Ù¤A6qÑm(¶ëÇ]?šôßw(‘4%J¤ú@€\Ù:š3Ãá)“)†dªñ´ÒŒËéú0ÁÓÏðõË ±·p¾YMþõoª§iIåtõ©¶ ”ÐéjóÓL"2_P�goÏs¢f§ë麭¯ªrs™ÿ²z5å„!Ì - æFÌ·“åʳZ§“ÄpþòÓ/xºç^M0bZ‰éø€ÑšNN™û°Ÿ¼Ÿü×ÛinÔôÅ&뎤… .: -ÁMp˯»ëîø¹ °¶æÊç”V„SªÆMÅ�Њ‡Þ¯çDÌ¶Õæ¶¯º“r´b„àƒFº û#ˆB\B×n<üѰïªýÆËæS£—ß×)ÍÙ ˆB@BD–Q’ñ.¢ ¯Q‹7/¢6ùe܈ìZýø¸|ý/4 ÁNMf†À¡rÜ‘µÁVKØÏáñÑ;|Öƒ®Ý�žê=UX§ãö¨ kl-·Àrè7åãÄ€%á=¼Ö££©‡Î‚»¾�›²q¼þñzÂ¥BL -ò·tÌÊM¡Š¬¢,¯èÀ`JÑi^¯è�w„¢[äc�v#²*úÃwoV�¯£ùMÌ -Ø&£2ÄÖ÷ºŒ ¦4;Ÿó ²; kèôÇ$·CeY»Ö ë?­zNÇMRâð0l–GJüNIÜ¢ÆK¼GÑÍ�ÛñºÛ·gÏîº;›�§5”‡9Á³Ëp €iA…"#C Ðý-ÓIiã{°*»ôtL€¨�cÕ)Æ Õi^Ÿê�wDª[äcR�v#²¶,{ºA¨/Z™1p¨ 9ÅwƾïtŸq¨l¸áî§RlQù 'è‚'I}~Òé ™Çd7éCתË훇¾Ôš3 EÒÁ;P†&€€å°ELûò -%Ÿ™ú>˜Ø�ʬƒåS›b r›æõÉ yGd·E>&½i7"»aߧؼ‘àšéA𨠻)ÑZ±Îà3CÚ]º„X,T$´äîÍ*æ0êûÕ¼é-NëÛveÝn8‹wn˜”#iO`j;æ-bm鞆æ­âêÃ7Ë—�oz›QØvp&Ù”Â^…Ð"ûâÅááñ+ÎØî@3J)Jx´Í5á•c�¬…›ÌNö`Çå­š‘„½iÓT­÷å¹ê4‰Á˓ӧÎ�MÓ:ú¶qw¼ì6Ýç_Øôv\ßûÇÝái_™$û#¡ )õVëÞÒävŠ’òf⬶» �Êõùd.ÉÌ}u»T›æêzjþn|PkHà[ÿúµþôtÚÕ›\¸¬Cdiï„Î,æ³G ¼lO·½åúhÍ?í˵ã/-®MÙà’àžœ…Öi‚µ#¦!Âú/ž}ÙîÖÛæ«æqÝMÜ9ߎИþ�Ξï÷ èEs ܸÖ#i¾.?žÌùá¯æ¿ên·3Y¨À\׳[“ìÎÍãáq‰íÚ*æeÛ·‰b°Ä0ÅhÇ›Žt<*ãÇ †B±¶0Þð@Ï{ú_yÏ×�Ð�v¸*3t_ëñ[ß®U}h ìÄZµùlªUUÖÉ3ó}w¨†g¾UÉÅJpÝïÆç-J L`­%ŠQ¼w h¢â¢ ÙÆ l±‚ÙÆßlòÊsy¨®Õùò,^Z)*%½ô,±{ó=\Ú TðÀÃ^„�¸ä,¾GõÄßZQ)Fœ Ùf}nscJDu¶;å2Ûåëù´wô|[_oçj8}P†U1ð«š{úT"}L"Eua_¤•¦Ò¦— †FGóË›LËâÒÕã!ëM«ƒ7ÛõÓ­#™2IH;¸ð¨udÍP7ëË‚;ÐË*Exœy”vÜï\{3«½0šGÜ[˜§+Ú¢¾Ÿ÷DxÑ�‰ò/ýŽ©n�<‹|8S$ÒSîgJÖ éËêX�Ëke§® ÷[wñÊ”¶›ý@¨ý‹ŸQöŒâæÅXÚe~NÅìdur{|kÑÈ?þæz¼¯¿}®ŽÝá1?²êŸßÏNOendstream -endobj -1199 0 obj << -/Type /Page -/Contents 1200 0 R -/Resources 1198 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1231 0 R -/Annots [ 1203 0 R 1204 0 R 1205 0 R 1206 0 R 1208 0 R 1210 0 R 1211 0 R 1212 0 R 1213 0 R 1216 0 R 1218 0 R 1220 0 R 1222 0 R 1225 0 R 1226 0 R 1230 0 R ] ->> endobj -1203 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 703.2457 207.0905 714.1497] -/Subtype /Link -/A << /S /GoTo /D (a00142_gcd3ac045f0a4ae63412e3b3d8780e8ab) >> ->> endobj -1204 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [208.4154 703.2457 218.1588 714.1497] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1205 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 663.1387 187.0159 674.0427] -/Subtype /Link -/A << /S /GoTo /D (a00142_g905451249dca72ce0385bf2a9ff178ee) >> ->> endobj -1206 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.3408 663.1387 198.0842 674.0427] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1208 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 577.8136 216.3557 588.3439] -/Subtype /Link -/A << /S /GoTo /D (a00142_gfa82b860a64b67d25ab3abc21811896f) >> ->> endobj -1210 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 491.7412 194.2089 502.6451] -/Subtype /Link -/A << /S /GoTo /D (a00142_g155cba6121323726d02c00284428fed6) >> ->> endobj -1211 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [195.5338 491.7412 205.2772 502.6451] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1212 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 451.6342 229.068 462.5382] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge3c821e3a388615528efda9d23c7d115) >> ->> endobj -1213 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [230.393 451.6342 240.1363 462.5382] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1216 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 366.9117 206.8414 376.8394] -/Subtype /Link -/A << /S /GoTo /D (a00142_g7b5319b5b65761a845fcd1500fde4cdc) >> ->> endobj -1218 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 353.3339 200.296 363.2616] -/Subtype /Link -/A << /S /GoTo /D (a00142_gcfae9053e5c107a1aed6b228c917d2ea) >> ->> endobj -1220 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 339.7562 198.0843 349.6838] -/Subtype /Link -/A << /S /GoTo /D (a00142_g9ff1e8936a8a26bff54c05f8a989b93b) >> ->> endobj -1222 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 326.1784 207.489 336.1061] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge469332907e0617d72d5e2dd4297119d) >> ->> endobj -1225 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [212.44 265.1092 223.2892 275.9883] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1226 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [344.7086 210.7642 400.3795 221.6682] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -1230 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 121.7215 139.4144 144.6902] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1201 0 obj << -/D [1199 0 R /XYZ 90 757.9346 null] ->> endobj -1202 0 obj << -/D [1199 0 R /XYZ 90 720.5385 null] ->> endobj -1207 0 obj << -/D [1199 0 R /XYZ 90 594.7328 null] ->> endobj -1209 0 obj << -/D [1199 0 R /XYZ 90 509.034 null] ->> endobj -1214 0 obj << -/D [1199 0 R /XYZ 90 385.5117 null] ->> endobj -1215 0 obj << -/D [1199 0 R /XYZ 90 385.5117 null] ->> endobj -1217 0 obj << -/D [1199 0 R /XYZ 90 370.8968 null] ->> endobj -1219 0 obj << -/D [1199 0 R /XYZ 90 357.319 null] ->> endobj -1221 0 obj << -/D [1199 0 R /XYZ 90 343.7412 null] ->> endobj -1223 0 obj << -/D [1199 0 R /XYZ 90 311.1951 null] ->> endobj -1144 0 obj << -/D [1199 0 R /XYZ 90 285.6088 null] ->> endobj -1224 0 obj << -/D [1199 0 R /XYZ 90 285.6088 null] ->> endobj -1146 0 obj << -/D [1199 0 R /XYZ 221.1768 96.348 null] ->> endobj -1198 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1240 0 obj << -/Length 1617 -/Filter /FlateDecode ->> -stream -xÚ½YmoÛ6þî_!`_l`âøª—~k‘¬p�Yb`Ú¢Pd&6&KžL#MýŽ"¥PïîZ "Š<ÞÉãóÜÉÄÃðG¼{¡QÌxेö¡ûí‚ØaÆ}WàÍfñÛï4öb4ð6•†€ A õ6Û�KFW>�pˆ—çõ 4^„Mã}±=gÒ´¯Šô|�¹JÔ¾ÈWŸ7ïכƮuK°€h«ÿ,>~ÆÞÜ{·ÀˆÅ‘ðžà#ÇÔ;,8eõK¶¸[üÑè1Õ„¡Õ Â.Y…×Ь.@…–H0ÆË_¶òÆ4·KºÙ|¹þpõ Ü]Å1‘FWå�)­È­ãW#î;ò}ßzZµ‡GÕ3N¢„Gmã�­h„fLvui“°b¢�‚,sd}Bk�”#AhTI_É4KJ»ejg2ßšFñ`ž‰yËBjWÊd‹´ ðÖ'! -(g•¶ÍnÉ€/IZº)–u×ù$·¦õP”fh[Yßç�¦_íeZ‰wì™~pì„V>l¹¶¢‡óIé$[¼|Òÿ’gkô^¶�‹¥*%,´4ýO{µk™<$*Ýi�ú— ŠÂ8œ‰}K]Qsn¬Æ�€Þ6Õ7×o×t°ÖÇçÚ&œ¡ ŒXǃNÐ4R3Ö ‡{ÄmªóB]Ñ@˜D¡°̆Q©ò]©~°F1˜�.�‘ ¿›ê°Êä •,O¯z ‡;2Jèo@-Ý÷DPwpˆBÂÄ‹Öá«Jˆ@<€Ðž\~#5°þÖ¶SŒ8AÛêk{±Š}®ª˜Ô×°è\Çö5€Ž´ÈUYdæå¤ÊsªÎ¥=>ƒ‚OŸž#4qx€81Ž Ò\MÇLNÛ„aŽâˆphN_¦æ¬úþ±¡#­¥´Û]zLQÚóöŸ“hÒ;¿š±ÛÕ¥íhôy­�Ây3Ê,ÞVµ¯xÖ@«2Ïl_3¡a}õ”š©� -í�Åw÷„tƒ£¤¡C�lœÿZo†¹Q  ‚…XY„ãYn´â¾#?Ä�­cÜÌÄuܸÆ{Üh…fLvuMsc­Ópchã{¯Æob‡¹C€Lˆšu3M€}lw¥‰ Þ¾ÓÕˆ•–+"–`h. b¹~˜›hÏê?=ÿ)—vôþÙ<“¼0¬§_¿BOD*õõzàŠ aóÈ r5‚BOûÌBнL‹ƒÝ¢s~ŸéßÚ)i“:�H“üÀöùY¶¯<ç£Æ�µD’is¥ÆQŒ‹Rd{#/¥ !&(¨çÉ05b34¹ü -ê¯�‚ZV:Y;ß }”? úø(ô­?ŒAE1‘Ç œ8¥ä‚º ’÷Ý Ã…A[ïxe†Tt씕Ԝ՞¶¹âÀhup­+Éößä…UïL;�Ïó\»F2y -›ÏW¨bžÛ"o¢p_t"ô¤’R™ -Âé5 ªÿÉô¬ä Šá Ê‚ :“4¹RãxÃ`wpŒÅwáÍ�xÓódo±¼™\þ Þô×?ˆ7-«ÿKÊKƒLNŸ+5~|4ŒPÌm -q'ëË��ŠñÓ›²ÿÝ©oßÍÁÜ·³5åÝÍ*¦°Ý1^þ9^[\Cç´Ç¾Þ�˜AšÇÀV8SR#Šã¹]åÊP]XJ¸J|C{oh-vI51å SN̘îi/(øÅ¬á Hµû-çV>HHþÒ:‰Ó‰¤~î”:n¿$ÇcšdYUÓ²¥åÛë»�Õ×·+Ž—Ã MG#Á<"4°`6Çе¼ïNàÊžÞ†f€€vÌw Ú -ÍÙìꚤgnuºì|++îûo -!M…B¨Íäu§ÉÝ«Î*k×}UýbúL}�ªçëêÞvI£Êê-kuç^�Lo›œ«¸Õã‰êØ8fIjíêÈ­›2Å=C�…€#Gˆa6÷9·‘÷Ý ý«Ø×kaÕ··7zœ‚iú;žŽ³‡^ 3‘¢–ñ_„†˜5†0Ï -iÓú>¢¡o÷€³|³1¨$�~è³~õÁ3‚)„µ¾S�„,ÒÞ2ÈhãŠv÷­Ìe™¨^jôz_7Þé9çõ'ûį({E-žQŒm¹ð°‚R¹N û?uÔØuU|}~”½8ô/»ô/^Þ×vendstream -endobj -1239 0 obj << -/Type /Page -/Contents 1240 0 R -/Resources 1238 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1231 0 R -/Annots [ 1243 0 R 1244 0 R 1245 0 R 1247 0 R 1249 0 R 1250 0 R 1251 0 R 1253 0 R 1254 0 R 1255 0 R ] ->> endobj -1243 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.3618 726.9533 212.211 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1244 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 673.1002 144.6746 683.6305] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -1245 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 596.8009 139.4144 619.7697] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1247 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.6892 535.7904 215.5384 546.6695] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1249 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.9195 382.4035 212.7687 393.2826] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1250 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 264.2062 165.0084 286.8014] -/Subtype /Link -/A << /S /GoTo /D (a00142_g9e97a0b4d5cc7764d8e19758f5da53ae) >> ->> endobj -1251 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 226.0566 139.4144 249.0253] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1253 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [226.089 147.4217 236.9382 158.3008] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1254 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [492.0786 105.1501 513.9963 116.0541] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -1255 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 93.5686 128.067 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -1241 0 obj << -/D [1239 0 R /XYZ 90 757.9346 null] ->> endobj -1242 0 obj << -/D [1239 0 R /XYZ 90 739.9346 null] ->> endobj -1233 0 obj << -/D [1239 0 R /XYZ 221.1768 571.8217 null] ->> endobj -1246 0 obj << -/D [1239 0 R /XYZ 90 554.2766 null] ->> endobj -1143 0 obj << -/D [1239 0 R /XYZ 221.1768 418.4348 null] ->> endobj -1248 0 obj << -/D [1239 0 R /XYZ 90 400.8896 null] ->> endobj -1232 0 obj << -/D [1239 0 R /XYZ 213.6651 183.453 null] ->> endobj -1252 0 obj << -/D [1239 0 R /XYZ 90 165.9078 null] ->> endobj -1238 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1258 0 obj << -/Length 1484 -/Filter /FlateDecode ->> -stream -xÚµXY�Û6~÷¯ЇÊ@Ìò¹oÛì6iÐÛÄE’ PdùlykÉ9úë;IY·ÖmŠV49šùæà7I€á�‘ˆ�f\Éa†ƒ L¿˜·¼€õE]àÇå쇟¨4Ò’Ê`¹.5H‚%4X®Þ†‘ù‚ ->œæD…ÇâXlËQ¯òùûå«€†0‹8X0/0ffg÷Ëʪ%˜$Ææ_³·ïq°p¯f1­Dð~`D´¦ÁaÆ)ó?ö³7³ß+=v¡|¡Ï7NÁ/EX°`)¢y¯”A(A„Ú¥§‚ˆ�sæ¥ks‚ÃøÒ"=å7m? ¦(b”uÕ@H%ÝEà ‚#&.Z ”Ç¢c�Ä%g½Ö/V½T�ÿ¬n•bĹ�M«·¶�» "`G÷ܦnõd‹ -ÄN$Ǭ8÷öG^œÎIq>¥¨í€ÏŒT`Z01ž¾ºÔpú¤¦ˆc�7èï¿Ä‡Ç}:˜82jš›â2E^®™™ÓÆ-½n¤Õ¥«!ëKk%f ®¶Éc‚’@¦'j࢒š2ÝÑfL—ù€]äu0Œ$‡B1kwé;Œi¶+vÇ̦1.ìs¿Ë\Ú)Õvp\Û§yeïk¢@ÛÒ@+O¸Ü¬‘‘'!9‡(b~·²f�އå‡7Ï_ÞßýñËý;,ðþ§’5UR�¨”ú›d›®ÎGÜ)Që6¼DÀ0åv£/·»|¾Ž ×ç,±^3…¹ÕåÖb;ÙP¶ZÃë©]:¥P陕þ4§"Œ÷g·d¢d¦ /[·$Ck? -³c¶ø;=ÝìÚκ—ds¯™•]^ùC�‚”þœÎY¶Ë6.?nãZµf´[OmámœÛA:'"ü²+ÒÕàþIhãÛ·&4¼{ÕˆC7º‚|IŸù!î%]ýÔë¥ Žu—x ô?2ê·—éúÝØ˜DBx`ªnoé“’Äûýå>·�K •Y5dwH³¢Êüp~½Æ�N w»feI�:\ŽøÓI!"߈¢aRx˜GZa8üó7C í QbAGa-ô‡Wò‹ú Ý:íêíoÍ”rD¨ä-û­©¤¦¬v´«Ï\‘lwûÕ3ŸnP JèÞdƒ2c³Ë?g Î,5”Oœ¹Áçr“î\œ¡ö\Éú)ÏùïF:<ÄIIz0Ì=·dhWUxÌL“�Hæ�{Õ2CÈîd‚#¡ÔÄѵ.5ÌžLJ$8“W±g€úì éçÏJlâè:êþåèÚõ¿÷èÚ°ú¿]/áâ’-à´Jh,dVÈ@OLîÊjo›¥ -@F£f½LÛlëHh>sTÝê“ÖO -ßÏ…óA¢�dDLŰ&6E/fx W�Õ�¤cì²Ý¸)KÏõÒ]•æF> Á8¼õG­Ú’·r΋æaɩ줱h"$}"ÁÁ'NÌu©aÒ'‘Fkvé÷Ù{$ý{¯3P\alòÁ¨VãQ¨¤zÂÐØ~ØNqÒ4^m?ƒ¢ubiîµF~‹ãõpÒáL­5�èôu©‘¤Ã½†¥'ÞrŒ™¾ú–£‹°÷–£{Ê-Çhl.·¦;ÚjÇd“þ¶u‰5›MëÃ!ðòS8:z ŽüP<öD@Á‘MFSðRS–;Új÷<Ú븶¡@xBCißÿDL�ö¸ƒ1‘Bþ§«áòb[Á+„5.tÁïˆ)¯í@O_¤Y -MÇ“¶w÷W?xe> Îî¡ÞõÊn(ö�Õ·Öµ¹Úñ×*矜4r‚¿ÚçÝñË×MšµÃ#ë‹Ï?ú„íendstream -endobj -1257 0 obj << -/Type /Page -/Contents 1258 0 R -/Resources 1256 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1231 0 R -/Annots [ 1260 0 R 1263 0 R 1265 0 R 1266 0 R ] ->> endobj -1260 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 677.3005 139.4144 700.2692] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1263 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [214.2734 447.0773 225.1226 457.9564] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1265 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 123.8393 139.4144 146.8081] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1266 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.2799 123.8393 187.5634 146.8081] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1259 0 obj << -/D [1257 0 R /XYZ 90 757.9346 null] ->> endobj -1234 0 obj << -/D [1257 0 R /XYZ 221.1768 649.8092 null] ->> endobj -1261 0 obj << -/D [1257 0 R /XYZ 90 628.496 null] ->> endobj -1197 0 obj << -/D [1257 0 R /XYZ 221.1768 486.8766 null] ->> endobj -1262 0 obj << -/D [1257 0 R /XYZ 90 465.5635 null] ->> endobj -1196 0 obj << -/D [1257 0 R /XYZ 221.1768 287.9871 null] ->> endobj -1264 0 obj << -/D [1257 0 R /XYZ 90 266.674 null] ->> endobj -1148 0 obj << -/D [1257 0 R /XYZ 221.1768 96.348 null] ->> endobj -1256 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1270 0 obj << -/Length 1720 -/Filter /FlateDecode ->> -stream -xÚ½Y[oÛ6~÷¯0°˜8^%ªo-’µ)º k=E[Ž­ÄBe+“d¤Ù¯ß¡x±.”£E‘‡ÐÒÇóž)2ÇðGæ1žG"B1ãá|³Ÿáù<~9#æuïƒ&àÅjöÇŸ4žÇ(i8_ÝÖB‚%t¾Ú~Z0¾ ¨Ä^¯ÞÂPàAXþÊ·Ç,Ñã‹|sÜ'‡j]¥ùaùeõzv¹r¼F-ÁB¢Xÿ�}ú‚ç[Pïõ #K1€‘8¦óýŒSfd³÷³¿�ý¢žà[� ì)Ë£ð3Ò« A_c¼øm›|ƘÌ’Þ®¾~XŠϯV_W¯Þ]>¿øŒî.Ž -�8–‘\«¦Þwò®¡¤ƒ |_ÑžT¥î}Õ#9¢¡àmòŽ]h‚²+KQþ®mQíŠ%‘‹d½¥Lf�ɉ, åˆñXO‘å›oZÄú°Õƒ‡%�_i¥Uš„þ·Ù¥™�Þy•7ðšwùþ>Kª¤DJXð¢�rV³­vi¹ ¡‹ýzSäzXnv‰òÓú Q$ê©!Qà Z< '1¨cQ€S÷púÁCšezt£—©ä›õ¨§•ã%s+ (BÛ«½¾æNK�0YŒ0±w§-(h¢ú;-á%f K@,cBjêë¼JžuY ¦(b”ŒÓ:”‡·é$G("Lœ¤é]SÇÀLK²ØA,.RÔ.À:V§Œ,öDzүnód}8®³ìQ?Mi•®³ô¿ÄLxH«�~¥6¤³@Æ!Η�†¯ÃO,µ/W-RÊÕõÕJ¥G-e¤D"¢›ìPS*ÄÉ(&mn�‡M�£kÛÜ$·y‘Xë¨èQO›0hY{*”†H(Bë±ÚmŽe²tVSDŽÆ�µ‰qVÌÁÖ�u)Ö{ˆ•¢v[Ÿ#îÛÓÂÒã¾æOÊ„ÀÞ‡�“F—ïPžõ·‚†bÄ9˜½ÅúÜ$È<=€L’Îm²NÓç¡*r“n˪8nªc‘ aóE!₱‰¨oÂÆÌfaj§ØbfPEdëe¶¨>sÛtàøPÕd›yeÍ3VhLÒPU©®|wuwS::0q1••›¨aG‡È‚Ôa²òûÄ(»ÎÊ|ÄÏGø9Š%á0Ïln›Õ8Z|МàiãzrZG!‰$ëðw{G‹šbíIkt��v¶õž 6�¡eÑÍ#9¿ytúg]ÊT.,ŽI§Wä�^QAL¯¨†uWNeÑ«•÷É&UN�lŸ¦�/‹p¬"?dzH5œE8aˆE\žU.} -Œäýž&þ¼ï`årtù§rÙ_¿·\¶XM¹d°G¥d¢\6a#fs0}0°îÔ%çPÚÂ(œ ·¨>yÛzªöp·ÉOÓj1èÂL`ñ�ƒ¨sá&jØ…YÃTWíËïku4qÞ1ê³k`_Co t0¥âv·¹ß M¿§‘àˆr\ÁÀ¡¦¨{ÒµNq�£� ‚1yzQäògEò„¢øáÕÕ›Kÿe -E¡Êÿ4&(”$š¼M1ø 9ÁWžºr‡îSº‰6ïBÅ ¦X{Ò:Eqø2ÅœU £M~´6N�’Øc-Ï£ LSm÷Ü î*8ô ªw‰°œºCsø 9ÁsîÉ5­ª§=ó5«CóY{MK¯Ž78Ô„6}i.r}™”BÇ’óñLÚD gRJÏL-|j3àS`¤ªõ4ñW5›hF—júë÷6-Ö_Ó �8BLF½@5b4‹²�@�”B$3Ž“ZP�´S` U’8n‘tàü|~Å £ŸUqè`ÅùxuùÆi©OŠXÖå6BLÕ‹š<¿'w Î€¹"8åvø»uÆ¢¦X{Òë`qaVj³¸|\ -±H{!r[äûND¸ËðNxœUNô�¹=žÈ|Aç><$Eróhï@²|I9ÜçQïÝÜMR–î•‹èõ7•ð,C¶Þ˜azèžáË*Ù#ß×+‚�¼ ¦­oEäÃVýaNœ!øš[ 11©KLä!uª(#¿LI±®ì‘ÓÚø/;x½$N«&à̵ÁÏ({FÍ7<ŠqhöIY67Æìì³{p‘¼KzÇõíÍc¥ÿ‚„vendstream -endobj -1269 0 obj << -/Type /Page -/Contents 1270 0 R -/Resources 1268 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1231 0 R -/Annots [ 1273 0 R 1274 0 R 1275 0 R 1277 0 R 1278 0 R 1280 0 R 1281 0 R 1283 0 R ] ->> endobj -1273 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [254.4125 726.9533 265.2617 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1274 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [344.4185 635.8929 389.5689 658.8616] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge6bae7dc0225468c8a5ac269df549892) >> ->> endobj -1275 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 536.6764 165.0084 559.2716] -/Subtype /Link -/A << /S /GoTo /D (a00142_g9e97a0b4d5cc7764d8e19758f5da53ae) >> ->> endobj -1277 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [248.3253 477.3718 259.1745 488.2509] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1278 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 347.5941 139.4144 370.5628] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1280 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [251.6528 288.663 262.502 299.5422] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1281 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [325.5441 246.9287 410.4453 257.459] -/Subtype /Link -/A << /S /GoTo /D (a00142_g99e43010ec61327164466aa2d902de45) >> ->> endobj -1283 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [216.8635 135.3029 227.7127 146.182] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1271 0 obj << -/D [1269 0 R /XYZ 90 757.9346 null] ->> endobj -1272 0 obj << -/D [1269 0 R /XYZ 90 739.9346 null] ->> endobj -1145 0 obj << -/D [1269 0 R /XYZ 221.1768 512.4758 null] ->> endobj -1276 0 obj << -/D [1269 0 R /XYZ 90 495.858 null] ->> endobj -1147 0 obj << -/D [1269 0 R /XYZ 221.1768 323.7671 null] ->> endobj -1279 0 obj << -/D [1269 0 R /XYZ 90 307.1492 null] ->> endobj -1235 0 obj << -/D [1269 0 R /XYZ 221.1768 170.4069 null] ->> endobj -1282 0 obj << -/D [1269 0 R /XYZ 90 153.7891 null] ->> endobj -1268 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1286 0 obj << -/Length 879 -/Filter /FlateDecode ->> -stream -xÚµVßOÛ0~Ï_i/­D=Ÿ&¼m‚!›º-{@€P—©Mº4ðßïÜ8iš¸-›4!a;>û»û¾»«Á§ø~H}-5 ¹P~¼ð¨ÿ„Ÿ/<°Û#ܵ >FÞûO,ôC*¦üèqsƒ"0?šÞ�áˆI:Cy™—³Í,™LWÃûèÊÀ åZ ‚9À¥ùê�G ªuJró—w{Oý):wåQÂÃ@úϸ Â�ù O0^/æÞwïksOµ±9àŠM0Œ+î�¸"„ÂiHB!ÐH ™›† $ƒò5Çà4›ÐÆC ƒI1Y$eR¬N»qeDsÆüöÕµ=Gë¾'8ÝzT \no5®,Ë:H"”àNô-jm刟·Q%BHµ‹ú¡J…ežfÈ@µ(s;λ[TI‚ R}ˆó¬,òyµX•Å:.×EBºÔʨ€ 4<,_Ûj¿|*4ábÞïÏ_&‹å<Ù+„&¹L’oöÌ—âÉn}Û‘ÕÊåð�»dmÌŒ‹ÓY¼ŒIÜs�D@pØÁQcu ºw›�Þè�UTß�Õ$‘h³u–ÜQʲ´Ló¬RqRVã<ͬê,¤Õ$¬Fsd^§DIf›û;2a7â K]èº×M€‘EJ瑩½d=Ü\ž_Ÿ=üø]^ßQI»41)°=0á+Ɖf!;¢Uc?jègSÿ^w 2Å !tð;25VÇP{·Ô“¦¦¦HXRÛòŽ@× ý6sðf(å Mæ¶(‹|q¬p×Y™Ú²�la[i�ÇñºXí­d‰?$ZËàp%·­öW²Ä 4‡¿èÃàÄßׇÁሻ7fGúðÁè·}¸¾³ï þ×>¼¥OHpé~I´hk™¢­63˜<êábÇQn§É1¢ð±‹Õä4‰\·=kÝn{Ñ,]ÙbYgñ6ëŸÓ¹%ñu[O.ÚOzeÔX­–Iœšî–L�•• ™ü6ÿ&óõ¤LV‘‹u%œi¡€Œ0!Þܪ9¼¥Uw_pø Ú© EÚAUBüóãnó4 ð -×šõËÔ:a"½H²¤@f,u¸ŸëÉÕ$R_-€Ù‘ž2~ÊlüŒRe6Lç¶’Ö—ckM¬áÏ×j<Ë_^Ÿ’¬K�ÄG§ƒŸ?qŒšjendstream -endobj -1285 0 obj << -/Type /Page -/Contents 1286 0 R -/Resources 1284 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1231 0 R -/Annots [ 1288 0 R 1290 0 R ] ->> endobj -1288 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 680.3578 139.4144 703.3265] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1290 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [253.3962 620.7106 264.2454 631.5897] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -1287 0 obj << -/D [1285 0 R /XYZ 90 757.9346 null] ->> endobj -1236 0 obj << -/D [1285 0 R /XYZ 221.1768 655.9239 null] ->> endobj -1289 0 obj << -/D [1285 0 R /XYZ 90 639.1968 null] ->> endobj -1284 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1293 0 obj << -/Length 1738 -/Filter /FlateDecode ->> -stream -xÚ­YKsÛ6¾ëWè(ÍT(ú–ÆÎk7�5í!Éxh‘²9¡H—¤ªøßwAôâ‘G’àbñíî·‹…HÆ~dœàqÌc”°HŒ«ßÃðÛ1¯gð~æ -ü1ýþ†&ã%‚Šñ|ÙkqJèxž}�01�Q‰cù™®K£8uíêGº‡´3ZS£þÎçE÷`5®ÛÞ"X'+š|ÑÕÍ“YÊ´Ý:+@ŒTfi_‘Þ¬ÍC^io”yÚTEu¯ŸºZ_³\yü?…5/ëG=¸‡F–ýR\ó�2A'"Ã"D¤ «ff{„‡ $eÌN¦‡+ ùㆎÀÛˆÉh«G-÷�R¾¿ÁŠ)œyWŒP"�´X¿S#ͽyõÅÁE€À "ˆÎÊí »¼¾Ñlò¶.µÃ›¸"ATP?Ü™Âc Y¦Š"Wæ@–àHºO NÛbæx,³ˆzÌ�Q8NäxÛæwªÎÖŠ)б·$7ÌX®«…ØTK˜ù­ÍIË»²®¬-Ýôå¡n»*]™)ief¬R#Vt»*Ì4Ƚ¼¶–úÑ"M³Ì`lÑ!+´S¸Äú�� ž“è$e¹�³c­T�°Žº³ùê‡fÅ\h7ŸæÆ�W³”T}ßæUv„´ p‡aêƒ<ZI!é39ËÂ2 QÖH Œe2žÜºðªûO½ên>å¨ ¹—VíR1W�~n¦ŸÔ]½¨�Ü7̱r\‰I[}ÍòoÓJÑY=Þ=éë—7¯%5¢…í4 åyJŸuJdzp“š©j¿PWåܾ<÷ËUÛj导ÎÁ>”ò܉PmŠ}g3÷}ÕåM•w§s€Dbè3^$ˆD”@LI`ÅÂYà(�¶L -M\¨UÄŽwûœØ%¤¾Àø“R-vÑvÅÂ*Úoÿ}ÒýèÒ2rŸý¿Ò�°˜£˜ÿª ¶ÂÃ?NÛ¿&€x,"�³B·GO -gÔB¥Ù±(4q &ÉI»bA{W¤BëZ~xHÉÈ"¨¡Tî­{:C¬|Á�ÞþàÒ÷žÙm äÈ/.ôŸjË}LXNñûb� - ¡LX¼‹äëüêãõÕüòöõŸ×on?¾¿¾úxuýý0öàÓuÌð1ÀŠ…à[Ña€Ý�îº~ì¬û+ ð#8Ð{š�Ý, -ð„DwP#Ün(c’$”§V*$GÝÙ{�šs¡­åía7Ä(4ØS‡¡18®,CЬ˜ m/ÀÕzÕiÝ(Ä-Ž™lÏ´^(\‰ŽbŠ® ‡×Qx~|ý膻èüö {~ˆý膻èö‚Ü_«x‚hLühÁKF -ê9”çc2àÀZœõµª§ aàD·7(‰™ì�o&ªÓDLàj }›WyÆe»ÿ«}²7T‹·6„š+¾ ì‚šsca:oõ�Åý‚²ûïîÉ~½ûùtŸ|·SÔ,4ÇKÿ…êAšendstream -endobj -1292 0 obj << -/Type /Page -/Contents 1293 0 R -/Resources 1291 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1231 0 R -/Annots [ 1297 0 R 1298 0 R 1299 0 R 1300 0 R 1301 0 R 1302 0 R 1303 0 R 1306 0 R 1308 0 R 1310 0 R 1311 0 R 1313 0 R 1314 0 R ] ->> endobj -1297 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 605.7915 170.2586 614.6381] -/Subtype /Link -/A << /S /GoTo /D (a00160) >> ->> endobj -1298 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 566.9372 200.0265 575.7838] -/Subtype /Link -/A << /S /GoTo /D (a00161) >> ->> endobj -1299 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 517.124 167.3395 525.9706] -/Subtype /Link -/A << /S /GoTo /D (a00162) >> ->> endobj -1300 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 476.9297 166.1639 487.1163] -/Subtype /Link -/A << /S /GoTo /D (a00163) >> ->> endobj -1301 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [332.9003 461.5917 379.5448 471.4969] -/Subtype /Link -/A << /S /GoTo /D (a00158) >> ->> endobj -1302 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 439.4154 158.5425 448.262] -/Subtype /Link -/A << /S /GoTo /D (a00164) >> ->> endobj -1303 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 400.5611 160.595 409.4077] -/Subtype /Link -/A << /S /GoTo /D (a00165) >> ->> endobj -1306 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 316.3067 204.5193 326.6527] -/Subtype /Link -/A << /S /GoTo /D (a00143_g54a466311575a727830a92a6c3621cb2) >> ->> endobj -1308 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 302.7973 215.5877 313.7013] -/Subtype /Link -/A << /S /GoTo /D (a00143_g5eced097547fd3fac4ba2a255493d921) >> ->> endobj -1310 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 290.8222 133.6164 300.7498] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -1311 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 290.8222 225.7693 300.7498] -/Subtype /Link -/A << /S /GoTo /D (a00143_gd85fc90c30d1fc37c63c4844be5fe09d) >> ->> endobj -1313 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 277.8707 133.6164 287.7984] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -1314 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 277.8707 210.2674 287.7984] -/Subtype /Link -/A << /S /GoTo /D (a00143_g41bf109b6a45328d5744c0a76563fb6c) >> ->> endobj -1294 0 obj << -/D [1292 0 R /XYZ 90 757.9346 null] ->> endobj -649 0 obj << -/D [1292 0 R /XYZ 90 739.9346 null] ->> endobj -86 0 obj << -/D [1292 0 R /XYZ 90 739.9346 null] ->> endobj -1295 0 obj << -/D [1292 0 R /XYZ 90 716.7484 null] ->> endobj -1296 0 obj << -/D [1292 0 R /XYZ 90 622.6841 null] ->> endobj -1304 0 obj << -/D [1292 0 R /XYZ 90 334.6987 null] ->> endobj -1305 0 obj << -/D [1292 0 R /XYZ 90 334.6987 null] ->> endobj -1307 0 obj << -/D [1292 0 R /XYZ 90 320.2917 null] ->> endobj -1309 0 obj << -/D [1292 0 R /XYZ 90 306.7824 null] ->> endobj -1312 0 obj << -/D [1292 0 R /XYZ 90 294.8072 null] ->> endobj -1291 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1324 0 obj << -/Length 1594 -/Filter /FlateDecode ->> -stream -xÚµ™M�Û6†ïþz¨}0Ë‘"÷–v·AH›½%A µ¹»BýUYn²ÿ¾C‘”)K&Õb ,R¯f†Ã‡I‘ Ã�d -g/�b¹ÈVÛΞ ú팸ÛK¸¿ ?ßÏ~ú•ªL!%¨Èî[ ‚ N Íîןæ±Å’rÎ~ïìØícMä„�·‘äj¨o$…6A ÆÓ M³6 Rœ·6!³ âàÞÙDÄY½ÕMYmôÚZ¹ÕÇU]Z³Ö òfhޏ¤6´ûgýoÓŲöO½×Ç}m/ŽºiªÝ“-ԧݲ©¶N}(ër«];3ÕîÂ÷ñ´zvœÄß)×ëZ�úˆ®å†#Æ)ou«M vú8‚ˆ å“«ø†Ûµaú†»Læg;ÆágJù¥/‚á)ÊYÜc§Jùº¢ï÷‡µkéÀy.PA ráÜܪŸœæ�0 ¯O…1°kÂ8U‡¯ÐíÏûccúé2 -m”DÉx&:U"„¡µ¶0ÇÆ7ü“aO0nh&0FJIºé+^†ê6 -Ž3 Qˆ¼M o\˜(¼ÌDñQ7ׯ«�ß+æÀ°­Ø?zeåjLúеعÂ3ÅⱻРƒÄôµ=Äy!/€;Qï³±ÜQ�íÀcìÐí¬£\ØôH?E�&Ø´LÆZßi¢Î/-M…™ÃK”`I¦Áª#0w2ÅÛÿf/²\Ñ×�™ $ -¥R8{YèÀ` é¸ßêÐï¬{Χ€c`7˜¯×õøl «3BH<�*ÀÐÚdÀ)A”ȉ|ŸÅ1¼�j|ª^ëÇò´qµõ"çóý Ö*?.rX˜\×!‡�M¹"¯y® ¥’ È;YòÐ`ò„_yÏoò¾ó �'ÂØ ßéf[ÿR.QA˜Œ'¢S%"Z›Jy. b´PÓ0ÕÎ;Ù8è.%WÉÍ Øþõ:àr�¤R©ÅF'KƒŒ�÷Û�ú�nÏùpãa ìK�k³3E‚ BpëT‰†Ö&s›è¹bâôªcÜzÙøòã•'è¶Ó9 Ö×á„+‘âÜËÒœcœÇývœ‡~'pÞs>…óx»çW'h·Í‹&â¼iŒG0´6t³€É‹b"è�:º—�ƒžš l¹”òUÈe‰â r;Y’ÜÐ`„Ü„_OnÏošÜ¾ó ä&ÂØ –°=Ÿ¢9bRðx":U"‚¡5O®N¡Ë`7'`[9 ÝPA·“µk‹ƒ^U¦G^.¾ƒ«zçÁ~ÿfÁðü—éS3ƒ ¢Prâ  ÕÝaìùp g„»³YwrJ»“SÇ“=9ݯN[½kÊàìT]?;m u‡°g6í™fø¿œh®�É’ëo¾�Ô�ß~îÍÇù|ü t�ZÉ&�# -)ùør×k–�hx‚/�ÌÀ¼­%a6æm|þx÷fر Ú7â~¤c�xth85fÑÍ;›&ޱI¨@œQm{'6¾7!0³ŸÍIÏéH=-æ‡}µƒÖ›‚˜7{[YÚ?ƒCu0Ñ}mlÍß Ê!cUù°Ñî‘çÒÝûVm6öêÁÝ3hmì?Ô¶ç­®y¶W¶¿–[hÏgZÚVô�‚ - ”á©%ǼOm;—TÂf€©ð`½:(�›ÊƒOé -µ¡ŸGzFãC‹1ĸ; °C‹F‡–?››:¸è„S­)'ZÆ"¼\Íóó'«QcÈüw†L¡rÿµ>@%L.¦[•»QÚ¿|ùðÒ8Ce]—/öòÌ£®¶ñ~L.êcc ûU£ýåã…0Ðáä30�Ú÷mõS)´u«·º¾L‘K¤o‚ýBdš > endobj -1328 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 613.307 210.8161 624.211] -/Subtype /Link -/A << /S /GoTo /D (a00144_g12b467f314489259dd718228d0827a51) >> ->> endobj -1329 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 573.4169 211.922 584.3208] -/Subtype /Link -/A << /S /GoTo /D (a00144_g20bc87e5c063c3f4b01547be6e5a0148) >> ->> endobj -1330 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 533.5268 202.5074 544.4307] -/Subtype /Link -/A << /S /GoTo /D (a00144_g41d37ea1e3bd24f7b51e9409aceaaa80) >> ->> endobj -1331 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 493.6367 209.7101 504.5406] -/Subtype /Link -/A << /S /GoTo /D (a00144_geb79c914cf137e6d27fd7583e5a66679) >> ->> endobj -1332 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 453.7466 203.6134 464.6505] -/Subtype /Link -/A << /S /GoTo /D (a00144_gd8e8bc9bc0e2ea4a24a8a024fd3a7f7c) >> ->> endobj -1333 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 413.8565 210.8161 424.7604] -/Subtype /Link -/A << /S /GoTo /D (a00144_g5323320b7316647042016f17c4e881be) >> ->> endobj -1334 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 373.9664 206.3828 384.8703] -/Subtype /Link -/A << /S /GoTo /D (a00144_g30e827f33eacff55ecb4d8fb5a11d5d1) >> ->> endobj -1325 0 obj << -/D [1323 0 R /XYZ 90 757.9346 null] ->> endobj -651 0 obj << -/D [1323 0 R /XYZ 90 739.9346 null] ->> endobj -90 0 obj << -/D [1323 0 R /XYZ 90 739.9346 null] ->> endobj -1326 0 obj << -/D [1323 0 R /XYZ 90 716.5154 null] ->> endobj -1327 0 obj << -/D [1323 0 R /XYZ 90 632.7749 null] ->> endobj -1335 0 obj << -/D [1323 0 R /XYZ 90 334.9631 null] ->> endobj -1336 0 obj << -/D [1323 0 R /XYZ 90 308.245 null] ->> endobj -1337 0 obj << -/D [1323 0 R /XYZ 90 308.245 null] ->> endobj -1338 0 obj << -/D [1323 0 R /XYZ 226.1581 201.4941 null] ->> endobj -1339 0 obj << -/D [1323 0 R /XYZ 90 183.6017 null] ->> endobj -1322 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1348 0 obj << -/Length 1499 -/Filter /FlateDecode ->> -stream -xÚ­X[oÛ6~÷¯0`“Ìñ.©}ÊÖ®h�]›·¶d‹q„Ú’+KKóïwx“eÝœ,Eˆ”Ï9üø}<4I€á� "¡„qlö láõ›qŸWð}Õ5øãzñû_4 ”H*ƒë[ãA$(¡Áuö9dñrEcá°yûš‡aÛx_fÍNÙö«rÓìUQ§u^˯×ﯯ۸.-Á$ÑQ¿/>ÅAé½[`Ä’X÷ÐÁˆ$ ö N™ïìŸÿ´~ì3`lvœÂÌb‚•nè u¬Ö±@˜ÄBaú=á!abðà(Š) ¼‘ƤÉ7ù!Ͳê¦^®$Æá]y¬uÿ¥ž9¸_‘%€«·ÞªÚ›|ÁÿÚé�—}´|b2ŠŽI2:×6û®Õp9ãaÌÀ—n°ˆ˜Œ>, Ó*Ý«ZUÇýøS1JG$ÒZ3´“ ÁŠ'¯:  >•@ÏÐZ� Àºq°™pr÷ -X‹“ðPæ`@¤.íËÔ>ÎWYü»¤pËÓ% ×Ë wÐPnð]ZÛq÷ùng[k÷í Æt·S™}›Þ®¾óc•}µiª -4´{pݲÐC·MeÆ‚¥‘ N²RÇ#2t[q7Ãå(†µ03|¥ôØ"7z45 Âs—N´€¡m”·öi2uaþèÎDèq -è ˜FX2H"†(b€%ü’Ù¸''šü…ª÷éñ›æ¾§½sÌÎà O,Mß(—°ÅÎ šRŒ� 1:¯—“Í´ZD$�}’Z†Ág´ÒËb\)Îè¢Nf¦}RIÞ£éD¼²�Ÿ"œB4“N‹ÛQˆè(díYät-§ h­U‡mVÐË ogtÑ]wëvרs¶Žòâ9rˆÈsä@;ràÓr8ª:«|%xŒ¬ßO5dêÖP³Ù¹/UÙÀRý¶"<Ú7¾dw÷‹1ápž !â ÒéZM‹‡ëãaüIâK`F>ƒLÆÔš]”Ð,' •ÑYÜŸ$$(ušy±íÑ ·Æ™ ‹æÊ4+GRFò+:V3¬ % -—]VéîXÎ�b&>·'=l¿é7ÕÖ}úxFG…‘4Ù(e¼ÙùAOkÕëô,W}¬%P g±j­.dçd€E ç�ß´Ì ý§lZbvÓ‚#¬GB=¾ˆ:¨M®½=ôùZUá7µ÷WKŽÃ?‡»•9LG@ɵõñƒFÖ–•þ“V`ߊR+é¾|,Ü„pºy’p“V½rUVY_Õ¾¾uª`i‡CœCYdçæz&~¦%Â�;¾7ªÊ•K+íÚªBUiíüßkm—Õ·vw8G÷ ¶ßI¡S™ øŸ×yÇhZæ4&ˆRn×þï²VÓêž zÚéQGUë­,Cr KÂ}º©JÛ, s¨fqxô„TÎÊ®44:˜AïD–t(ê²7ÐR‘%†Šh¹bX†o�›MZ¥k^€ƒæhÎ<Ú…sµ¹K‹­:¹¡Ãÿ¤,6”�^yÐ*�±¸°ô«™µgq&¢'þ±æèÐÏd¼ð·f:5Zùl%™G µ�à¼ò ”°¨ø•ÿXWͦî'GIŒ‰Y/¹É*×Ú_Hsè×W9ØÜoÆ`¢F2Áñ> endobj -1352 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 411.5145 158.5126 434.4833] -/Subtype /Link -/A << /S /GoTo /D (a00148_g87f0b54ade0d159fba495089128a4932) >> ->> endobj -1354 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [217.1221 221.3274 271.6871 244.2962] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -1349 0 obj << -/D [1347 0 R /XYZ 90 757.9346 null] ->> endobj -1344 0 obj << -/D [1347 0 R /XYZ 226.1581 652.2086 null] ->> endobj -1350 0 obj << -/D [1347 0 R /XYZ 90 635.97 null] ->> endobj -1342 0 obj << -/D [1347 0 R /XYZ 226.1581 538.4468 null] ->> endobj -1351 0 obj << -/D [1347 0 R /XYZ 90 522.2081 null] ->> endobj -1345 0 obj << -/D [1347 0 R /XYZ 226.1581 389.7944 null] ->> endobj -1353 0 obj << -/D [1347 0 R /XYZ 90 373.5557 null] ->> endobj -1341 0 obj << -/D [1347 0 R /XYZ 243.8616 199.6073 null] ->> endobj -1355 0 obj << -/D [1347 0 R /XYZ 90 183.3686 null] ->> endobj -1346 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1358 0 obj << -/Length 998 -/Filter /FlateDecode ->> -stream -xÚ¥W[¯Ú8~çWDZiñz|‹}úԪݪGZ©»å­­ªr *$,„¶çßwŒ��æU<`Çã™o>Ïņˆâ"C£D&Äp¡¢ånB£5~~;¿ãzÜxµ˜üõ73‘!F1-ÎÉ€E‹ÕÇ©"|3I§§wïÝ`YŸ(eëÓ!­ò²pNÅÒÎŽ8ÕŒË)7³Ï‹ûÉ›EcÜc“\�5ýÿäãg­ãý„n´Œ~à„0†E»‰`¼žl'&ÿ6zÜÂyØ‹‚¡{xÛ�õª%5�Ö’PÐ ²Â�ƒ„]HQnO(œI$Ñ ¢ZÈsÊ÷_ò}ºZ¾T³XQ:µãÖkTƒ&‰íJ~¢’þis· ›ƒÒs˜3\‚f³!B Ùl>fÕ¦xáÇ}æSªB×ÏØÃoœeK*p–Ü&}d}È<Œt{,G°/\¦Q·f¿Ö~é¿ÎAû�ÉGº¦��ûV[V@ñ0W #Â$*ŠyB7•È™2òŸˆ’Ô„7?ÓÝ~›²¢¥ó·™à%²–²øV›å~I–t\:ˆ.n„nØíë²vç‹‚cù6²kñºÏµø Û}­Öv69uçïҼؖå>þ‘W›8=ì‡\0ì|FàÁ†¸h„Âxº¾N¬¦5'šBòDRñ úZƒ¤”§jœ˜‰† /�PÒ@—…DÎ�/æ¬V�‰,1 íÚëÌ^7ŠürÙH+÷¿Í _€ªn‘µ[¶—2K6g ½4¦Ö"^1DR_ufê ³ {ó+g·U«±YµK�ßl%ª»°WÌ»Š™ \ð•Ö®6^›WC®}‘P¸ëÈõÕ–º^¤„{iáÏjàc |€d¼�7b7x�€K20ÚÀ;vƒ |ؘݗï3&‘·<ýZG^ƒ+Lž¼X÷Î6ÜüŸ™ÐÇp´¤ 0•~N×™v¯¢mV�Ø3»~�ªFê -|�*ˆfR?½êHú”ªÓ‘Œ^M)%Õo½�Î�<�[€w*ƒÂ*ÀuýÆó ¬«o³"÷\¶òÎxÿ©÷¶_œüX]qï¿cžFëü`¥<ôÞŒ@¼à×G÷ÿºüù¸ÎŠ>=ãj„Ÿ_×cNéendstream -endobj -1357 0 obj << -/Type /Page -/Contents 1358 0 R -/Resources 1356 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1340 0 R -/Annots [ 1360 0 R 1361 0 R 1362 0 R 1363 0 R 1365 0 R ] ->> endobj -1360 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 624.1462 158.5126 647.1149] -/Subtype /Link -/A << /S /GoTo /D (a00148_g87f0b54ade0d159fba495089128a4932) >> ->> endobj -1361 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 586.5419 139.4144 609.5106] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1362 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 586.5419 262.94 609.5106] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1363 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [282.8054 586.5419 416.0743 609.5106] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1365 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 429.2598 158.5126 452.2285] -/Subtype /Link -/A << /S /GoTo /D (a00148_g87f0b54ade0d159fba495089128a4932) >> ->> endobj -1359 0 obj << -/D [1357 0 R /XYZ 90 757.9346 null] ->> endobj -1343 0 obj << -/D [1357 0 R /XYZ 226.1581 562.108 null] ->> endobj -1364 0 obj << -/D [1357 0 R /XYZ 90 545.3808 null] ->> endobj -1356 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1370 0 obj << -/Length 1193 -/Filter /FlateDecode ->> -stream -xÚµXßsÛ6 ~÷_¡Gûnb þ™Ç.i/¹uËï©éå[It³-Ï–Ûfý@‰”eQ¶ÜÛvyiAÀø"Š%2!† Í–#½àÏGàÇø´�ï«M´`òh¶µêãhû £ÅµØë±“][@mˆ%?m±‘²‹a¨R‡v¿Nù<°�Ñ0²cÛ>Ú¼8™»6 -/?„"ÐkQìòõ£=ê…’(-Ì@¼Ô�m¥‰ ²cû�JꣀkO!!€…¤('ºS†=‡Q Çmé -‰¤‘F$JTH°xhbô^i…s²žÃ' C0ê4>PV‚8šÂ2Á°i¬îÓ)܈ ¦p[ተëSøÀî` -Ú>#…Pz} -o³2_÷A90˜Ÿ§ƒà¥†Ìk JËŽy›Å�]- ¥Î€—DÐÕ[ÔcPÀ “S™DŸv½‘0Ì[¤Ö×O—­Dr B°óʶ-}¢l±ÿ l¥ Tc¯%Ýtú}ÃÒ•`,£@Ó—™ë˾¥™]:3QÓ™[ŠšÿuuÅÕ}Õ“wµ«éèôXׇŒŸ}L1!ܼ�oÅêÝöµØ-º'7ÌÒE3”¤å~

¬ëÿeÑ‚‚HÜËe0˜L¾}ç×Û2�ý°-œ'"�ˆ�âIoæ{¡¸-N¨ÚØ‚C]vèm*ﯾ§Ëõ"Û^„©ÅHœ4�¦±Ð!NÀÌK€Ë>„‡-ÁÉ5bb69®aÆË4_-ŠbËË×8ݬÉ,` ¦“É@Ì©H¡6 é'—«€¦™Ði½kýhhù!�Þ“¡)vet8’7Ç7R¨BmU]føõã•0I¤õ|r™=PÊleøBó…´ÈW®@Pm½(ž=Pæ?˜�)Ȭ·’ï²çl“­f™«ç?®o¹¾Ÿ^ýzûÛÝDa½Ý“~–âÌvMÕb)v”¥|nˆ*lWÉ“³ˆ F¤¤C³‘�Û/„õê=Þ1‘•áº!¨'ÆNЮlÏïÀp=¢t0býJªQ½'ú˜;�¼Áí¤öÿ2ø2};¤ïýÇ]HÞe¾ÌéºCÜ™Û`Ú÷â9'Åq;'Å»—@@$½W#Œß0ê_ÝTc»ÆW€$¡Âï~Ì[ñ _´WŠuøc¶Ê6iéƒë½þä7–¦vnÌý§Œ_0w%‚É­ÜN˜ûoïðîäéÍÏßß^²àÆÄ^eôDé�endstream -endobj -1369 0 obj << -/Type /Page -/Contents 1370 0 R -/Resources 1368 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1340 0 R -/Annots [ 1374 0 R 1375 0 R 1376 0 R 1380 0 R 1381 0 R 1384 0 R ] ->> endobj -1374 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 615.6894 166.9111 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00145_gc48ed5f0d27721ef62a3ed02a5ad8d2e) >> ->> endobj -1375 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 576.8351 180.1912 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00145_g22f140b02c354dfebcc7ad481c3bcd68) >> ->> endobj -1376 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [184.0068 576.8351 208.6941 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1380 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 414.8106 227.254 437.7793] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1381 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 414.8106 380.3883 437.7793] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1384 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.8969 339.5315 225.6901 350.4107] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1371 0 obj << -/D [1369 0 R /XYZ 90 757.9346 null] ->> endobj -652 0 obj << -/D [1369 0 R /XYZ 90 739.9346 null] ->> endobj -94 0 obj << -/D [1369 0 R /XYZ 90 739.9346 null] ->> endobj -1372 0 obj << -/D [1369 0 R /XYZ 90 719.4886 null] ->> endobj -1373 0 obj << -/D [1369 0 R /XYZ 90 634.6393 null] ->> endobj -1377 0 obj << -/D [1369 0 R /XYZ 90 539.515 null] ->> endobj -1378 0 obj << -/D [1369 0 R /XYZ 90 513.03 null] ->> endobj -1379 0 obj << -/D [1369 0 R /XYZ 90 513.03 null] ->> endobj -1382 0 obj << -/D [1369 0 R /XYZ 224.9827 374.7449 null] ->> endobj -1383 0 obj << -/D [1369 0 R /XYZ 90 358.994 null] ->> endobj -1368 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1388 0 obj << -/Length 1934 -/Filter /FlateDecode ->> -stream -xÚ½Z[oÛ6~÷¯ð°k8^D‰*°—.m‘bò6Ý€¥A ÈJ"Ô–RYjÖ¿CñbêbQëÒ¡HmIÏùxx>^L–þ‘eŒ—�PÌ‚p™îxy·_/ˆ~|ÏO\À‹‹Å�¯h¼ŒQÒpyqÛZ â”ÐåÅær"¾>¡¯š³sõe“­ _}ÎÓL_WùšàÕgù_V©{·M‘ÖyYìáR„¬²¾ºx³xya¹hªœ…D2ù´¸¼ÂË P~³ÀˆÅ‚/á#Çt¹[”™‹íâÝâwkG=hŒõ˜6Þe ¸CMŸ)„ rºL0þê>CO• ‚bÎ[w,9µ.ÑNN³:É·ÙFY9Íöi•?HCÚsFÌÐEk­\Ügûlp¸L*}¿ÙÃ7_ô#õQdõ£d_Vmi¿‹ò†ì¸íb©¿äE�U x,îÔ�Ǽ¾?ä �GÇÂ"†Ã¸íÀiöcZdû‘äa€8âh»5¨n¤QÀDp°#~ ”÷} ­(gÓ-ÊçžÆ8 »~¿ßèžœ!ŠhDzÎå£êNcÞº4 ÞGc`WÒhò‡ë¼xhê ¬) =10(Ÿó�µ6ö˜cø#ÃøGˆ€y,PHiäº>qÑ-Ž—„AË䌣XŒJçÕ:à«2ÍöF&…Iç´ÜÙ\~HÒ5Å«�­¸kt”¯ˆP21ÍWÓ% ‰˜ñ£ÉÌ#²ÆÌ“ÌæMf×àD2{üšdîøõ's×ùŒdöÐØ5Éü�Uy¹ÉÓ“8BXDƒòùX3ùœ–E1™ÓPx„èÌœvÐS9m`mN¯…,A* -*}YnSÚ¾¸õÛ_òÎÚ‚¡°ÉŠ:—£Ú/y­µR4»¨öÕ>Ú]¨6¯žDŒ!̈ïýna~I8§$1í×JÂõ;Cçs$1Mc`×HBíµ,͇êÝ's;DLð&#bQ*Cku´ $ï ˜ Å1‰æ†Çâ}œvÝð ¦T¬ Š=1(Ÿó�5éüRz¾Buú°¯“Z¦ Kî´¶¾ûI}¾?;¿þù—ßÞ½<{©€(8‰a‚�˜��ùE3åÑÍ´_+×ï ÑtœÏÍ4��Ý~iÓc�”@ÔÂ`:å!1´6»˜`†¨\AÌ+&zª˜˜SL Zìt-ù†•E7x(ÛÅ„º¨Ë^ÕÙ×U“ÖMµfѪ]ƒ­=AL�ÙÓÔž °¤Œ}µÇ¼2r NÈÈã×Ȩã×/£®ó2òÐص2*·Ûq áÇÓq°(�¡µ¹‚?â„Í\c¸è Y˜dñ6k>eûZ§ó}Rw“=©ê4ŒÎÈ{ƒôä½›Ê{×ï8Ÿ“÷Ó4vMÞ7›ãK -±Ç„‘éPX”‡ÃÐÚìÔ‡ºE|fõpÑS©o`_¿yzþM×$ÁH�ðiê‹å‡úꂆE~}Xä´>\Ø„>:~ýúè:Ÿ¡��Ý1}Œ×‡€ Â|}2å!2´6W$L˜±‡3냋ž‰…ý¯"yâé‹0ô&3#ã í†ûa¤ÄX»•¢ö�ÿXÇt•Tyr³Ý f „ˆÅÇ÷‚]À”. Ì¯Ë � 6%ûdcTécgÕë²kÄõp—–QRL&ÙQÄ8ò³c‚…—�ÁuÙ�¨oä&is; rèŒóä Y”Ï}(gx¼çþR.”_ÈýÙ÷¯Þ�ýõòzu,oaI€g3óÖEO(ÚÂô)L»�¬e©£EÄêÖW²¨ P†‚x&g=®5 -/f.¢Ø=Q{ô¤+„:z*Óf¯“Ä9|Š�>µvì!֡بP˜ƒwÓÿØYÑ›ós6æÝMyi -wHƒ@DÞ6ö4L]&Õ±žT‹Ušlõ‘›X=ÞgYßëÇÝðxä0L¬îí­ÊÒÌy¬­&êãÀYYº­Ê]Ï™s‡Ö'Œq“R�Ö¦ÃíȪ�[ÜØâ=âÁq¾Ú5j}Âu48” l¯šäEϦ+vÕL_€a™Ë^=“B¶�²aÛn³âN� B‰»íîÆ&pÊ¡¶MRi§÷jº™f‘å$Ý6Ów?Kvº¤ŒfËŸzÔ‰1@:iC`X¡0ûgTiØ.ù¢¾Üè‰nQ6õMÙ¨�^ïˆéIû=ï»îÅxغs.Kõ #ÁêL7Ø—¦cÉrˆND;ÑQwZéÀç¾u5W€Š"|±C ßÛ¡tºÒ„êÏ-xP”}@ןr£cÙú/4¢){E/ÿ¢# cf?øÈÛÙ7ÉVŸjKƉžP©ôÅí«Ã¾’lò¹¹ƒ“vn× -«?7³­öeS™÷´Üdfå¿-eç×áÈŒLþZ� D£?ñÀð†…âþ§ßT´s*M`Æá–˜MG²êݺ$dð^gEV%¶Ÿ& ¿š/oäû§Ñ„êOüœ²ç«+Šq¨C)ûn&À¶¨ÂºÄÓòï/wÙ`)!ð1Ÿ˜x÷Nendstream -endobj -1387 0 obj << -/Type /Page -/Contents 1388 0 R -/Resources 1386 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1340 0 R -/Annots [ 1392 0 R 1393 0 R 1395 0 R 1396 0 R 1397 0 R 1398 0 R 1399 0 R 1400 0 R 1402 0 R 1403 0 R ] ->> endobj -1392 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 611.3557 185.9198 622.2597] -/Subtype /Link -/A << /S /GoTo /D (a00146_ga4360412ee9350fba725f98a137169fe) >> ->> endobj -1393 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 570.6172 198.084 581.5212] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -1395 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 529.8787 213.1775 540.7826] -/Subtype /Link -/A << /S /GoTo /D (a00146_gfd5ebb56a1bd1da9878aa886a2075e80) >> ->> endobj -1396 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [242.9955 529.8787 285.9441 540.7826] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf703683056d2bfa5c81fa157dcb20fe2) >> ->> endobj -1397 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 515.9852 222.4327 526.8891] -/Subtype /Link -/A << /S /GoTo /D (a00146_gbaf0bb2b6a4424b4eb69e45e457c2583) >> ->> endobj -1398 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 475.2467 205.2871 486.1506] -/Subtype /Link -/A << /S /GoTo /D (a00146_gf20aaf4292cb0d2a1b10bc0a568b51fa) >> ->> endobj -1399 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 434.5082 218.0093 445.4121] -/Subtype /Link -/A << /S /GoTo /D (a00146_g2c64c8c36bc84f9336f6a2184ea51883) >> ->> endobj -1400 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 393.7697 242.358 404.6736] -/Subtype /Link -/A << /S /GoTo /D (a00146_gf5c2ad5acf3cc23b8262e9ba6a15136b) >> ->> endobj -1402 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 306.5867 133.6164 317.4907] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -1403 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 306.5867 166.9014 317.4907] -/Subtype /Link -/A << /S /GoTo /D (a00146_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -1389 0 obj << -/D [1387 0 R /XYZ 90 757.9346 null] ->> endobj -653 0 obj << -/D [1387 0 R /XYZ 90 739.9346 null] ->> endobj -98 0 obj << -/D [1387 0 R /XYZ 90 739.9346 null] ->> endobj -1390 0 obj << -/D [1387 0 R /XYZ 90 719.0647 null] ->> endobj -1391 0 obj << -/D [1387 0 R /XYZ 90 631.2478 null] ->> endobj -1394 0 obj << -/D [1387 0 R /XYZ 90 549.9141 null] ->> endobj -1401 0 obj << -/D [1387 0 R /XYZ 90 326.4788 null] ->> endobj -1404 0 obj << -/D [1387 0 R /XYZ 90 266.2048 null] ->> endobj -677 0 obj << -/D [1387 0 R /XYZ 90 239.2959 null] ->> endobj -1405 0 obj << -/D [1387 0 R /XYZ 90 239.2959 null] ->> endobj -1386 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1414 0 obj << -/Length 1818 -/Filter /FlateDecode ->> -stream -xÚåX{�5ÿ?Ÿ"J(1~ìóJ+=èUâ8ÚTµÕi“u’{»a=ÄwgÆãÝì&›\K)B§œg=ã™ñx<þÙbÌáOŒC>ö]Ÿ…ÊñÆË›¯¡û»‘°ìðg]�¯ç£/¾•á8d¡'½ñ|e4x‚¹RÈñ<~5qät&îóI}q¤Ë'‚q"¾Ïã:ÕD?É—õ�Ϊ¨Jòlúfþlt>oíZ·\å ´úëèÕ>ŽÁ½g#ÎT¸ã[øàL„¡ߌ©š�tôbôc«‡fÀÐì 3 „Ï�À u¤¤—qø Ó÷å.Þ†û\˜x„Ìõ1n„0&u²½Nu6�yœOQë·ÉRÇEòV×Ûó…rwÚÐðÅ -6ƒNîòšˆ¨Àíá“Û"©’lm{©¡ D¬§Ò�`ÄIân:¦Â�è‚dªMT•i—D~õÜjÀåù*Ž ]–¤â¹.ó´6{Ñ\y•/sÌJñ9îho¢ÙšYòv£­\Qg³&›„`¡ëRÊgä¼Û)9º·ózΫ�.2]}NŸ n“4% -}'ªÊ©]F ïY é¡P[ÞB¯òBnU›¤$jUgKœø‰ ‚»÷”‡N&tÄ „>“¾ïí´b¼>‰õ*É4m³¯_~K„ÝE¼¬ŠzYQnQ]m®7qa/ P<€"& Ò9¾Q÷™a9Ì$Ìc×�Ëù)jXÔ«Wü�ÙÙf -O27äÎAáØ¯[Ú®Ùu³å?Fý£!(³ÇÕÝÖÆè‘õçéü‡ËÈyqu}>:ÿùêüúâ -Õ¾ciŒ -(�Û$;5�¡„6®ä§�Äÿo–\¹Ç¡ÅMKÞ÷�9l¾÷ :üNGýÃú±"uäpr$lgÇON]©ã‡“£$„±xþ[t³Muy¼>�2íÂáÄÞbmYÏ{ÕËžOžc­˜ 5Vursv%YšçÛÙmRmf°Æl¹ï¸”“®OÌZ©{\:Ô†.Ù3%ÊâëNÀTÍ=ëGCÓÊßçÇ�Þ“¡�}>å‡P°¥8�V꯵¡WŒò[�@«2 ‰ùD¿æ\f‰EÅŠÚÔQHAÀí©¾¢‡4Øv,Û{ù Û2Û÷cÇc.“ î ‚Ã>†ИÝé¸Þê"Éãd‰ûu™gYs\íM‘ã±À#0we‘šm‘/ä´Ç> ;¥)d™^îfšÄp'IБx,î,§²x!«o€`\×F‘�Ï<éЬæ,øXÐWœkÛOÀ…#ºAߢâŽ>·;Ïùžç TÉ�.JLm¹�3T �=37Nsã .bþ�%h¶I•gVnÃ)!Ó¸�ä¨ü,ÀYåJƒž0&HþCÊÌE¹ -�ŸŠ‰õ;Œu#‚N¹61@ -ÒëŠA Þ䢢^ë…?d×Ì ÝÁ»wV®]I˜›H[˜­·žº€ªãÔ ]ky¯ÂŒð¸Ø!Kj>jðc¾ÕY?é—i^êx0 ~¢I»ÜJ„�|ÀîBWu‘áb*åCv‘ÌMtGìM4…ÿ4Eê‰2�±Èk\8ìÝFË_¦q}ßâGd/ƪ‰pJ]Е{“žsÒ& rö.Ð�š– äp(­iB™ä;phc«&eNß”íÐÑžãØûõEE-RË6»8¥®¨£² -"ú¤i­©7� ߂ɚî; -ï;VõïºÈ!¯T‰¿±Òý“¸19mò!aÇ5É×õÄP -Áºì]Lv¡þHÒa4¬�Iï¶ÁZ8JÍ—Ô ìüæ‡ËË–ûàAòް³{¢$ÿå§!9€žÀ9�6»RÇѦPp -#¦»ÿ-ä¤ÙÝ øÐî †lÅþo! -d©ÈÑ ÁžÎ[ˆ#í[ˆ -|û‚ô‚V"lé-Äô@M؇‘Ђ"Á¦¸’÷ÀÜV~Ö0(ô¹½âZθÏÝ=‡p­•ºÏ _±PøNß�Î QišXµë@§�ì!@ìÁ]‚«°¿€ýœ:z­ø¨7ø†ÎÁiá¹Þ=d›‡ø†ˆn<±%U&°—„ãÉÖtü;�é"ª(Ûß7Ä3œQm?„´-?“êLÚ7{‡ž=D0 |>|Üopò“ü·»µ>xÒwá:¥¿�º endstream -endobj -1413 0 obj << -/Type /Page -/Contents 1414 0 R -/Resources 1412 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1340 0 R -/Annots [ 1416 0 R 1417 0 R 1419 0 R ] ->> endobj -1416 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 418.8948 227.254 441.8636] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1417 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 418.8948 380.3883 441.8636] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1419 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [314.29 105.1501 371.0667 116.0541] -/Subtype /Link -/A << /S /GoTo /D (a00152_g54b27e45df15e10a0eb1a3e3a91417d2) >> ->> endobj -1415 0 obj << -/D [1413 0 R /XYZ 90 757.9346 null] ->> endobj -678 0 obj << -/D [1413 0 R /XYZ 226.1581 392.748 null] ->> endobj -1418 0 obj << -/D [1413 0 R /XYZ 90 373.4515 null] ->> endobj -1412 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1423 0 obj << -/Length 1804 -/Filter /FlateDecode ->> -stream -xÚÍYmoÛ6þî_!`_ldâø*Jé6`[»¢ÖeMú©-Õba¶äJrÓ`ØßQ$e½YrÚ~D/<Þ=>Þ=w‰‡á�xö¤�(b<ðÖÛönáõó±Ã>Œûm�_¯?üN#/BQ@ïê¦Ö$(¡ÞUòv ±ò©ÀËý‹ s“¨ËOéZÙç"]¼ü¤ÿ©Â¼»Ùgë*ͳCNÈ’³Õû«—‹gW  U°€h$oßc/È/±(Þ=<`D¢ˆzÛ§Ì=l—‹¿=f ž0ö‹9Áˆ2ô|*Í�lI ¤ ¦H2JÁK|"éÁI�ó%&ÚI„HD¥„WVJ{ê&/Þa�Ó•`¼üÉ\ðsµo4—7/.®ûóÕ«K;zv–ÂTbþÑž‚×+†xÀEm`Ÿî®wªHó$]×–ôœ'µ4î¦7zX‹oTf”þlጚ¡3q±»Î÷•Vs̈ªîT‘©ê:Q: ->©âºTYÒ�å�˜ø·5B†#í0 Â$”^À’$�£‹ì„ü¶Ô0¶ÃaÌ@—(�$¬-^è¸�‹x«*U”ç}û6"È(€cñCF�ÚBB°„Q&Z5”užeû4„¨Ä´©°¶]Æ‘� »Ww6•³ýöƒKáüÆ\+7¨Ñ©:«Íóý]º¾3·iiessý`§¸h�7›û&ßlT‚Ž­²ˆÀ²éUnKM¬2QD™‰«gŸãín£&ÖwÊ4GQH8ÜÖcúMqk‡^wVß®êB6¶ú�X�PšV L§Ù&Ïwþ}ZÝù��hÝNi€¨�3>k¤f µiHß›E‹³d`�CÀÑ·~Ô5�üŽ�ÞI×G�{‡ÉjÂ̲ú�Ô ª¡6� -£¡SI(!õàSõcš¥‡|‰+sݤ™M†I7×ô”�Fwµ‰^| CG‡®@#ŠØ -¢Xý»ÄØ=(iJƵN`ÍÍöJ¬nÖÕM9 - m 7ªªÚ¶›Ìö©Èת,ÓìÖVüÜòF<Îi¢²*ÕØTbIâ¡3a—§YåÈÇIZYf)«b¿®ö…B®A (ç5ÎK`o�Ãd—Cåˆ3z<¢@ ‘œKb'ï·'Œ$ñ@ïX�v~î - â4=D}JwRs8BraLJ…Õ¯ŒSªøïº9Ӿįáðöàp-’›1ÃöÚ‘àíx3H+èè §:³‘ŸùC½Î™c5‘q†$´^Ól¤æls¡åz¶MÀ_¤YY©81ªsU;(sƒUMO·Æ•X‡ ¨ìM\¬H¸¼Ýo!gkÓ'EB[‡]!uý³Í¥8ëÖÕ}é’È% -¤ßZ�’§ŽjlÖ•;µ®³rÝOÛ£5šs‚`½èt�nK¯Ñ\0èÎ T'6`¢ ïıÙNlÒ‡Nlè�ÑN¬c÷— .Ô©Ù‡…ˆ‡ · é8·9ù9p½Sé=4òlÚ/NhÆ2e!‚ɮå&Û…æhc:èBM -ض¼À­�Çlʾ¦`ËVÁæzäGk“>¯Õþ£*+ç‡Þ•׸¨Òõ~ãN+¡—Ú$=ÇšõCÅ5�ÁeºMk]Œpíð~`Âfd àFÎ]'ï·'ŒgMWo¿è6Ž«¼”€¿Â0èÁꇪ“šCÁ!¡îU;`šÊ«=“äºèê»,·¯v®§b„é"¥ãÁº1Ý*ëÑk£•/05[4=ïvØP™…Ó/ÒÒ¨2‹eÞé1¡N-D[gL:A°Q±¼·Ÿoâ*>Êõ4vÄÀÏ“\ß–:Îõ4ŠP ‚àQ\?`‚ëHƹ¾›åúI¸~è�Q®ïØýR®ïB:�ëgÀ ôžÂõ“~i¸~ÚrÃõËÿ®gò[q½8Îõû¤»_8�î/µ{óôâ±û²fïe¿ - ±-¶k�¢V×ʰý(oõr€ ó ˆ5{ )Ͷ î†Û6*`û#…ý $7l„æ>08y¿=a$èzOݶ1 ‰Âƒ¨‡¨¿ëpR38†ÚìFhk÷¦½ª—Rûͬ!¼9¬a å�‹pù¢êú\q«×îS»±uº­ÜfB´­úpS“sywÈŽò8-q ÜÆáwHŒd8_é�¼ßž0BK½§®Åfâ ‡¨ÏQNjÕ;Ó€°.éçÇ -'á .ÙdÝj -h[zxÚÙïä�Ôœ6@ìtNÒ³³�ú õÍNºþO:E GOèô)‚>l"bjôX  ­ÉW�CÕgk!L!¬³é `YèŽÖ, ò¹ÊTWŽv]®ýán^êÖpoµW|NÙ9Åæ‰bX¾×�ãü樎 Üåô§ùç‡[5¨êâ{Ä?ÿ+� "endstream -endobj -1422 0 obj << -/Type /Page -/Contents 1423 0 R -/Resources 1421 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1437 0 R -/Annots [ 1425 0 R 1426 0 R 1428 0 R 1429 0 R 1430 0 R 1432 0 R 1433 0 R 1435 0 R 1436 0 R ] ->> endobj -1425 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 593.8152 227.254 616.7839] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1426 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 593.8152 380.3883 616.7839] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1428 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.4376 488.8567 182.4258 499.7606] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -1429 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [305.6958 488.8567 344.7692 499.7606] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1430 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.486 438.1531 236.5593 461.1218] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1432 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [132.348 333.1946 215.6849 344.0985] -/Subtype /Link -/A << /S /GoTo /D (a00146_gbaf0bb2b6a4424b4eb69e45e457c2583) >> ->> endobj -1433 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.486 284.5483 236.5593 307.517] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1435 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [250.4549 179.5898 309.4431 190.4937] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -1436 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.1787 167.6346 205.1669 178.5385] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -1424 0 obj << -/D [1422 0 R /XYZ 90 757.9346 null] ->> endobj -1407 0 obj << -/D [1422 0 R /XYZ 226.1581 568.2372 null] ->> endobj -1427 0 obj << -/D [1422 0 R /XYZ 90 549.794 null] ->> endobj -1408 0 obj << -/D [1422 0 R /XYZ 226.1581 412.5751 null] ->> endobj -1431 0 obj << -/D [1422 0 R /XYZ 90 394.1319 null] ->> endobj -1409 0 obj << -/D [1422 0 R /XYZ 226.1581 258.9703 null] ->> endobj -1434 0 obj << -/D [1422 0 R /XYZ 90 240.5271 null] ->> endobj -1421 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1440 0 obj << -/Length 2117 -/Filter /FlateDecode ->> -stream -xÚ­Y{�Û6ÿߟÂÀ‰Y>DJLÛÒfÛ&Hs{Íæ¸40´–¼jK®$'íúÝoø’õ ¥Mq6âc8óãp^¤ÉÃ?²”xñIŠåö¸ÀËþ~Aìôæ×]‚oî_|GåR")¨XÞí4A§„.ïÒ÷A®Ö4ÆÎ/o¡Éq@6�Ëô|ÈLûE¹=³¢Iš¼,Vî^-nîZ¹g‚(©¿.ÞÀËà½Z`ÄdÌ—Ÿ ƒ‘’.�‹�2×9,Þ.þÑò1z�ow!…�Å„-×L ˜ÈÐKs„I�"(A„pêWD,Æ,ZFŒ!Ø~¨µñ¦l²gÃÝLQÄ(]vŽÄ¶T¹¬#—àE„ñ 7%øy jf2Ø••jÄA³ÏF8B‰¨àPSÕƒ¥ù©‹ÈÑÏ!ñUˆÎùisʪ¼LóíϘcø#CD X‰Ù´fZªÑDQÔDZ;[esOA/! êS¶Í“ƒQÒ6©2£·}bØ”fêÞN4É/+‚ƒ¬0ÝO{ÓŠƒs�fÐX¾Rzù��â+K›7{Ózþ“%HŠTé@�6AL„°'B�äë�Z\dÍ5"K!Á¾9î)êš)A«Kn§„d„‰>8!EâÂU+¬¬Ôy嫵À8øÚ|ð—ækG¿2Ÿw/o7ï^Ün¾ýû›7oÅ“'ú¨uç¿z·qªè‚BòÖ:ÎißBrµîK½÷ˆó�šVKJûŠñß,,¯(:•T§Mynœú„dV÷›4û˜o³´Ê?fզΊ´¿jíñGg†Œgº'é¢ —й`Ó!¨Ku= 0ü ^K¼UæšTÉ1k²ª¾nI>–4B&ë J-™‚²-‹Q¨'4†È-ø´Z*�z¡‚/‰¢¸/÷no“Nq>Þko„v¹3߯M‚ᚆ‚™éa)Jó½·„§ªÜfu�¥èêa -Œb1—OºTדGÅÔšÏÍoÉñtȦŽqBt¨²]Í™8ïσЛyZ2í7+Âs}LòâP–§µ -}kp:´…|*åÑŒÎZªHcn -ÒSsn6Øö¤‡±Ê CéWUÓÒÏáñ�T „"¿vX$¡|™9ÖuK5ƒjÌM¡B&XÑØ1J!#=ù"ûcZäoHó=ä…õ±¾K©%®Îƒh‹öZÄÀ¾!Ú2ŠpÌ„$G‰X¦Fî…I/;l”‹ª0l¿Äòg}þ4D,”Ä„A»´çÂ&cCß”Ijw3± O¡fͶ,µQá÷ÞÊS™�‹1.räMmuS�·Í¹Ê�Ë8�r ÍI¼… ½Z3F¨>Fq2B˜B<9÷�Š9'vôëî��ø^KÇþ‚�!†CT£‚ÍRÍ`¡P *ŠûXîW, 1ŠqåW­ºZéj´Uº&)ÍœìZ™ q¨ð†®ÅTz�VhK?³‰1_§P_úc‘@"Œø´[ª9Ùàà2$ÙÆèŒ.ò¢n²$5RþªT¸ÉF‡¨£J¬ÌÐL4õ%Hh¶L5¾•T+ú>‡`ÐÝ>·&ïêmëOIÑO¦çÚ9’sðÅ­Ë´“NëÂ�õ<]É+ÏÜ]÷jž Fc>�§»T×ótH!Os}VÑå0Qt��ø‹®–l¶èšTÀ¥èkÀ[tõä>Ÿˆ‡¾Ë¨ŒQß>¤ëñÍÑÏ�ñíÆ7Ÿr(ç°"fÓÊi©fäSõzɾx瑽ÔÓ¢ŸW‚*„ñù‰[âG'îöZj2w7kAÚÌÍlÞþçJR°û<¹¿úÎ3.ºiZ3CÄ—ý—rÉ(GóÇd?M¿î.;¶ŽxÓŒK¹¤}« (”8š/°¡:âè]خɉ»Ș !!M�\·TsâGÜ”ø÷ê’ÿ�Šoï¾{ûòß7OèOõµ–NF÷tÛ‹Xû6xJ¶&¡[ãt£<ØAÔà<ðVJ†e=eè�¤ªU‘Qè ¤hLŠ�–ö$øî˃É‹my4V¨‚†‚ü¡´Ã¬²Vé “‹ü4SPÕ�á�V¹PiTG= ©¡¾wòN‡d› D»ýu~Ò¤QY Ç*'—¦Õ˜” --Ÿ’ÖTòà_æ5 -HÔ;…ÁÅMÝ�ˆ°AF�u�«þ¸bâ€C»ÒUƒÁa—@ ùEµ¢à�]ÖÌäè!õ™ŽÑkwíÝ··_€ ô¶nlä²PǪ<ºèè - -ïîMÍa­«Îÿ“]¹ä[̪5À C=ÑNDc hTü——ðˆ×¯ؼ¾ycÜíåjᦂ ãé£Ku½ð Œ¹œ}n&ÓB/EÆXª÷Òß’u[ÉétÈ·‰Ë:ÒY2´ŠÌ(Zec÷v•ö -;™Û…îÀåðÀC¬/ô‚uéH-ŸžQ«þШaìx®­tkÒJ¦qæÖaiÖ㢦°Ô®#ÓÐ��§“Ó Jœ­€ªJš«&¶+‡RíåS[þv^®Ÿ9�8 7ýø‘f—Ü÷>¬ç®JË<õ¼ŸzŸM­»GèÍ{-QÙBô_S÷ŸÜò¿êp޽Ǟ^^œ­ë}ÆkñW_�V›�'—qˆPðÿ–ñÌ›²b‡·ÛðžØ€ÿMYÓg‡:û¿€ïѧ¼ ¯Ž%ÏlçÂõÏîÔ”µSøÃ÷K!A$Œ¼¥õaê›?ý#¢þ4†%„õ~úƒb;b±¾vSX¨ :( -ê÷Y‘u<ÚUá?ºÆ+å¾gÛ!Ô~ñ3ÊžQ[–SŒ…uåúî¢0þaÕ…‹åo¿?d£ '̧¥ÿä -endstream -endobj -1439 0 obj << -/Type /Page -/Contents 1440 0 R -/Resources 1438 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1437 0 R -/Annots [ 1442 0 R 1443 0 R 1444 0 R 1446 0 R 1447 0 R 1448 0 R 1451 0 R 1452 0 R ] ->> endobj -1442 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [148.7083 717.9621 207.6966 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -1443 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 557.7163 227.254 580.685] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1444 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 557.7163 380.3883 580.685] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1446 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.0274 456.6895 204.9409 467.5935] -/Subtype /Link -/A << /S /GoTo /D (a00146_g2c64c8c36bc84f9336f6a2184ea51883) >> ->> endobj -1447 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [338.5705 456.6895 377.6438 467.5935] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1448 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.486 407.7474 256.4846 430.7161] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1451 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 322.487 147.1755 333.3661] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -1452 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [147.6736 322.487 182.6919 333.3661] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -1441 0 obj << -/D [1439 0 R /XYZ 90 757.9346 null] ->> endobj -1410 0 obj << -/D [1439 0 R /XYZ 226.1581 533.8997 null] ->> endobj -1445 0 obj << -/D [1439 0 R /XYZ 90 517.2837 null] ->> endobj -1449 0 obj << -/D [1439 0 R /XYZ 90 367.3148 null] ->> endobj -1411 0 obj << -/D [1439 0 R /XYZ 90 342.9866 null] ->> endobj -1450 0 obj << -/D [1439 0 R /XYZ 90 342.9866 null] ->> endobj -1438 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1456 0 obj << -/Length 362 -/Filter /FlateDecode ->> -stream -xÚ¥RËnÂ0¼û+|L¸»vì`Ž-*R¥>rTÑÄA‘ ¡áÑò÷µ±ƒ(Ê­Šœõx½«™ñ"û!Õ@S™2-Eó º²Ç‚!=°ùÁõ…ûŒÜ=rM5ÓŠ+š•ç -™äÈiVÌ"Åd<à¢ÃÓ‹ß&F«ÜÜV1Btt?Óú³òPçûª©wÄ(‘ñ"›’‡ìÂ%P•B¡còEf  …¥<%À„Júm0ÔšÓ I¸èÀš¼“×KŸ8ô)–(ú$‹ÉÜÂÔ+›9¯+Çß«Yî}\WuÐŒBûMSúèJÖ!y¨¶,gN¯¥0À”)ž$çÖo¦4­©sSø›Ÿ§KÅǶmr³ÛÍA‚]ÈúüB†IÚû²`õ ’ê_VžÇchKPðëéPÖ1ì¬ -$œž‰©M»Üwr:¿ž»ÍÔMÊ!ä!ˆ‹�8€ -3s5íÍ´!ƒ¿^�›ŸÓÊÔ·ö¸wîñç«C°âendstream -endobj -1455 0 obj << -/Type /Page -/Contents 1456 0 R -/Resources 1454 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1437 0 R ->> endobj -1457 0 obj << -/D [1455 0 R /XYZ 90 757.9346 null] ->> endobj -1454 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1460 0 obj << -/Length 2132 -/Filter /FlateDecode ->> -stream -xÚ­Z]oÛ6}÷¯ð°X8~‹ì˰-k·º.{j‹A±•Ô«#eþhÖ?RiJ´xÙÕÈC,ùøœË«s¯(RdŽÍ™k>n7«n퉻c½²G{;¬Ž� -DËgjé4᎑žñº:”›mµîTíW»Í£K�áaAÚ- Gœ˜“–æ¹—l{Ü;–ÛÏ}�õD°»c]oêûî ¹ëþšÇá ;XBÈM ‰q$0#m,×Õ;Œi]íÏ\UI”¹NRLš-tW#5Áq¦ø‰Ç -¾£TŒµ6¿¢‚¥= -Ò5†ÐXÊ¡î·ë~¤‘8—¨ ‰Û¯v÷=æM†ÃCaD¼6Œãæñ¯æxØÊzm¯ä(J°ñ·(Ò™ð( „˜­½XàUS׿?é cÏ Î¶¾1¦?QIS™˜I£o)¾9crBŒõˆm噯®ÂÌ‹iW€”« vUJ1pUZ×»*ÔÍpÕ@<ÇUé0"^çªuy(MÖ£@4CÔvžt -’�Øœ£Î]m‚ DLg#L1 ¥Ï\ˆ|¢Ûž+�ä�Í4Â…V'RÁ͇þNe2pø0ì‡eÝ÷ÕM½j|ÿ´ ë;è‡òÐ#úž¼:îvKV,Ì=oëšò§r»)oÝ-ÑŽys7úêTR›ÚQ÷x{‰L??‰Þ.©9{·$jqWíN ûl 3hi -2™À>„!¬‰š¬/!…ɦ–@}yX_!a¢¾]W_]¸¾†âõ„ñºú:î쥺Ÿ(3jÒÆ£édxEÌ–Uf#¥Ìm>¯ÌtªÌ,¿ÌÌýíª¹»º5·¸q¥Ù!Ûʺ_lËë„8Ï©?”}A–»Ýæ“›'5ãâ²7®ª�SM—³>”ì JHO—•H1Ρr0¸„ÂT ¥u} …º%4Ï)¡t¯+¡Õ¶ÙÇa(5aÈ�CAâ[Vå˜ r!0ɬœ�ª³üÜ}äÚÓM&߯£BzsU ©5lìa �C„�]gã�.lã¡x†��0"^gãò¶Ù&l,�8$±åؘ™Y‚γqˆNØØÃl?¶CÿzsI�ò"óÎ’SÈÅ»8 L¹8­ë]êf¸x žãât¯sñÞ®D&&sE€8¤±e™˜1Ä­ñòL S&v°v³ÔtQm·#ï«î‘¼›x4{çó¦ÿÚ¯³ €væ2msJ‘ X_ÆçÆyœjùÜÁ`Ÿ„)Ÿ§u½ÏCÝ ŸÄs|ž#â }þhfŽÑs±0ùâÈ‚CAò[´Ò2a¦íòåð±|Úî!:awk——\˜çѵŸœ÷O¨wù}|4¿­ªþÔc÷‹%‹O›æ¸wË.éíÁÓÆ<*Œ†Ïì]E35ÿ¤<HAÌú`ª÷Ø«&?5| ijÙ&›S 1%ÔE¦t¬Àˆj¦�&áa`“ MÐuMb  7‰¡xF“ˆx�9vÕþPž›ÔiĘ,€,8$±åÜ™ÈÜBdfƒЩá`6‚7ýà³ÛÁwÃâÍ|˜ê -§¾‘ÑRöq}8üDèñ@bÞ¬þ@’Ê^¹3ãÔ -ˆ!fK÷ΑISq™þÀ"B)¨?8ÜÂTHëúþêfô‡�xNH‡ñúÅ¿õcp7¯ýQ†ˆ 4� �‚ˆÙ²º‘¦²9Ïì:Õ%ÌFðÛþKç ýšßŸ×¯Çßÿ09 »­@„¸È„™jŠ0eÐF’‡�^ ^t�׺°×‡â^ˆx�×M T,žÚEÛhÒ\˜©Šé\éL8BÄ–ãtZHdî�™›I!:át �^·w°§ôÞQù©ÜlíÞϤ§©]ÃW˜_¤SA‘R -Úrïa›7 x:€¥<êfxz žãét¯_²[}l÷âÇ@U Që¥óàPP[–£Y�Œ?2÷mBtÊÑf#øš™í;1ãÙZ¹²{•ëæi[­»�›õ´ÝíÂ;—Ùh¡Pm´xl÷€0e÷´®·{¨›a÷�xŽÝÓaD¼~£¥»ÓÆv§˜›é¯™S$óàQ@1[ŽÝ‰VHJ�¹Ù¢v÷°�ÝÏlvÇÝòÞÉå>i“Ö¶å]h›(svB -Ž$QÐæ‹‡�Ö Öt�µº°µ‡âÖˆx{ˆësêJs$Á¡ õˆ-Ë×B#ÁXæîKˆNùÚÁò|¸¹ËÓà½Bÿ³Æ|Úu«:áw»n_\f2N˜@\1h—ÆÃ`»„)»§u½ÝCÝ »Äsìž#âì5ž[½æˆYc¦³àP�|Ä–åwÚ¾­›¹Q¢S~w°/õ»KÔ×Þ®Þ3­/2wÑ1-´ô Ðí'²„דŠÎé�"ìóP6ÃåÉFœÎá‡ÍCµ¶»‘ÅM–MÝaÒÊ#¦”¹íä^œ}À†•ôûÖÿû=÷Ö -w/xï±›'Ђ©v‘Ò±¯´»PlÄ/ªºÚ•‡ñ;P¯Ü‡—vRìíÿãg”=£ý+ýcÙ¿õnñ›Ýé}ñá»ÿ®~®›?ßÇ/»ÙWñÏdé?G†¯endstream -endobj -1459 0 obj << -/Type /Page -/Contents 1460 0 R -/Resources 1458 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1437 0 R -/Annots [ 1465 0 R 1466 0 R 1467 0 R 1468 0 R 1469 0 R 1470 0 R 1472 0 R 1473 0 R 1474 0 R 1475 0 R 1476 0 R 1477 0 R 1478 0 R 1479 0 R 1480 0 R 1481 0 R 1482 0 R ] ->> endobj -1465 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 615.0435 211.932 625.9474] -/Subtype /Link -/A << /S /GoTo /D (a00147_gef14e83c046e19ab9fe9d1bbcca276c2) >> ->> endobj -1466 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 601.9516 194.2086 612.8555] -/Subtype /Link -/A << /S /GoTo /D (a00147_g1a1bc437c09ddef238abab41d77c3177) >> ->> endobj -1467 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 562.8165 207.3095 573.7204] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8411c95a4d89367ad2d9d6bde1a3d537) >> ->> endobj -1468 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 523.6814 185.9097 534.5853] -/Subtype /Link -/A << /S /GoTo /D (a00147_g61db1dcb7c760e4dd5d60bf4e5576dca) >> ->> endobj -1469 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 484.5462 185.9099 495.4502] -/Subtype /Link -/A << /S /GoTo /D (a00147_g88d2ccf7cd821f89d9a8df7e3948b56c) >> ->> endobj -1470 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 445.4111 182.0444 456.315] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -1472 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 406.276 196.4303 417.1799] -/Subtype /Link -/A << /S /GoTo /D (a00147_g64a238a5c02640a7a4aef004163aeb47) >> ->> endobj -1473 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [371.6975 391.5148 410.5505 401.4201] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -1474 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 367.1408 190.333 378.0448] -/Subtype /Link -/A << /S /GoTo /D (a00147_g81ac47cee1c18f6aa479044069db7ca3) >> ->> endobj -1475 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [377.83 352.3797 416.683 362.2849] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -1476 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 328.0057 224.0965 338.9096] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga9de254b8aa308eb4aab17efdde622d2) >> ->> endobj -1477 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 288.8706 198.383 299.7745] -/Subtype /Link -/A << /S /GoTo /D (a00147_g26a14b8dae3f861830af9e7cf1e03725) >> ->> endobj -1478 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 249.7355 188.5699 260.6394] -/Subtype /Link -/A << /S /GoTo /D (a00147_gde6634974418e3240c212b9b16864368) >> ->> endobj -1479 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 210.6003 205.825 221.5043] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdb971fb1525d0c5002f52125b05f3218) >> ->> endobj -1480 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 171.4652 190.8911 182.3691] -/Subtype /Link -/A << /S /GoTo /D (a00147_gef6c4140c632b6a406779342cf3b6eb6) >> ->> endobj -1481 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 132.3301 195.3145 143.234] -/Subtype /Link -/A << /S /GoTo /D (a00147_gfbd5fc486dfdf6bf6fc9db52b1f418c4) >> ->> endobj -1482 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 93.195 200.8635 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00147_g7b2ac4b18bd2ac3912fe67b3b17158c3) >> ->> endobj -1461 0 obj << -/D [1459 0 R /XYZ 90 757.9346 null] ->> endobj -655 0 obj << -/D [1459 0 R /XYZ 90 739.9346 null] ->> endobj -102 0 obj << -/D [1459 0 R /XYZ 90 739.9346 null] ->> endobj -1462 0 obj << -/D [1459 0 R /XYZ 90 716.6852 null] ->> endobj -1463 0 obj << -/D [1459 0 R /XYZ 90 634.1338 null] ->> endobj -1464 0 obj << -/D [1459 0 R /XYZ 90 634.1338 null] ->> endobj -1471 0 obj << -/D [1459 0 R /XYZ 90 425.5097 null] ->> endobj -1458 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1488 0 obj << -/Length 2344 -/Filter /FlateDecode ->> -stream -xÚµ[ÛnãF}÷WØ ÷öý’—Å&Þd3@€ÙŒ÷) ŽÍ±è╨ñL¾~«Iv«É¦º8-“âaUuñœêb«Íþ±…£ £ qBêÅÃö†.žàãnXù®ß¦€oïoþú=w Gœæzqÿ±µ QœñÅýã/KMôê–+º<ýø®;¨^^6뇪YïwÝO»v„SÇŒ[J³úíþíÍ?î£ã>.%4ónÿsóËotññ½½¡D8«¯pB sŽ/¶7’‹p²¹yó¯h§»ÐÞ05€Óúå÷C½bjùy»n²(p‹Šòà¦ì{d©M7U~Ø%.hÇ$MÍ#mŠ.°6Â|wûŽ‘¯=iwuàhÓ_9¬„YÖÍÁg¨Ú}ŽÚÏ_º þãOëýé¸ùÒ}þX5ÕErk VJ_…ÜZÂ)W½# %xj°@qÄo ùÀ/Nó¡óDGÂÈ첿ì7›, -wJΑæ;³6‹ìŠ®ÌL®ŸÁ%ª÷(ïþG¬>¨×»§žÛ�¢ ƒ_âdw™Ö’îìuj¶æ–‰²ºGá¤>›+qºè4R:q:ƒÑ©ç9„.Æ0¶è¼Þ­›uµÙ�ã@8Ð0Èr -"¨ì>³5‹ÑL@câæ–ï]ât€ù~¨›«ûtt'Ûêóú´íŽ�õJÒåÓ¶Þõ·×ô÷øqüôþ};”®?ù8ÖÊéЕûpóY<äâè)'RÒ¯©õ5¡¬#Ò¬“‰0T©Á‚,¿A¿¸0†Îg( #³´1!о63$…¹Î¬ÍÑ…2’(ÉçÉ"TPÓ¢Èè;SÍsø^ÅY"Ü౿ÿ3bQZe¿ªë¿,E‰”ab 0\,‰Á’XÊ~£XR¿3Ä2p>G,å02»A,§Gÿ"°Ý·­ÿ/‹‰CéuRºrB" -‰$·´ãùRÔ�PDÛ¹¯)º¤ óQüÜæ�.?….¨ê~ýûîÝ|Js ™VשÿŒc8Zÿ §tb°Dé²ßHéÔï JœÏ¡t9ŒÌnJéëÝcÞqÿБ4Dâ?·–ùMh©M‰ÓÒibùÌî?P>šo}&ß{{Üfÿº)?„‹l—V«íU -¸4p�)¬€GÊöÔ`�íˆßÀö�_œíCç3ØŽ„‘ÙMÙÓò$Û57¼œ†ˆBüçÖÛ7u±jK¿Èªç¾ ¤èÇÌñ¾¾Dr¿(ãëùS·Œ³¶ùøSó�¯ØÖHietæªkŠËÐPRœR¼_‡– Ë`Ü~¸ßÇEæ|iY8¿ÐtaÃk,4a¨ÆŠÏCü� ü~ZqxëŒØLš15ò}Yb�E‘Ù Û¬� ${§�º�ä  0ïN¡—æ–ùµ”PÎÌìñ<Af·?Ó¿7SµÅ0­ÊC�(Ä1§ŠpjFCǦNaü]ÚÍYŠ.–k KSzÑw ˆ+ea¶ŒUâøR?¬ýŒ:Çâ¬)4pBÚkLšBù58TÏ= -—óÙ\IÍE§Q̉S\Ë©ã9R.†0¶çÊÝ)[I@€¼<þBœ[M´ - ’>©c¸ÉJ9wì޹Y½,b –6®<è*{åL]½€¯¨‚…&BÎm RtIÁÖ)xÿò0WŠ•ºŠ‚ẄºƒI8Àp 'ÇA– 8D¸4ŒEµžFç•æ»¤,Bà†³F#¼�¨Ü7“©o%‰4ðê1Ì ¥"ó«}7EÙÈïåÑ<6úÌn:zèsÅQ¢¥aåDâÞ¯¤0aÌ8y¥á HäÛÉ™ ˆx4‚±ÝøõÄKõøx˜¨9Úa„C2P¸vðö)Õ4FÁ¶Ô—àÀc]€~ ôÍ8FA-ôTÏÍVÄ#ÙÊí^,ÍBPb�B”Q˜c!ˆ°#¿XqæÎéØÌö*EŠs„ù¾ëE2µþнrm÷M_žŸ÷Çx:Æ"~ÿÝ»jy±Ls˜Š•רÒÜø•j¤F÷ ´BŸ�š¬¢ÇPw�h‹•z�Ñaý�lÙO­C0,•G0e¯pÍ×»4ÍÝr[ GšƒQ­�šø®ˆ¢%Bô¿xð&|»ØÄe‚¢f”%Z€—yšIÐ%ÍØp­£]Û¸Þ’—út&n’=Îh¯›Úÿîá3Û¥YÍß”æýTyÿ¼ö{ß ‹Û²ý]¾®7›îóª÷‡>¬C}¬›~7� NáÚÙ©?‰N}o`ô²j'dÀo§ã©Ú´ÛBÛ“º¿üúÜ~ÅàÝö¿ëÃaè.>WýÍûðÖݺ}adá úÖýÐáîÛú]sÌczö,}áÑ ç—GÐ.0 oÏð©÷ß¡Íøö»ÙëK»a8Lê´�Æ‘­w�¢sî3âÅŸ8šLíºg„Éé}?Ì2Ý}eÿ?oÈo; ·0ÁSéi⌰á -ú ºý:»úP5qs|ßÅýÞúÇ{êOïÓo¸ø†ÓîÌ¿Möyà Ѳ)ýFèp7çÝþó—§|ùSÁì1‘ŸÿU6§!endstream -endobj -1487 0 obj << -/Type /Page -/Contents 1488 0 R -/Resources 1486 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1437 0 R -/Annots [ 1490 0 R 1491 0 R 1493 0 R 1494 0 R 1495 0 R 1496 0 R 1497 0 R 1499 0 R 1500 0 R 1501 0 R 1502 0 R 1503 0 R 1504 0 R 1505 0 R 1506 0 R 1507 0 R 1508 0 R 1509 0 R 1510 0 R 1511 0 R 1514 0 R ] ->> endobj -1490 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 702.9069 191.2995 713.8109] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -1491 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 664.0494 180.9385 674.9534] -/Subtype /Link -/A << /S /GoTo /D (a00147_g58bb90796c1cdad3aac2ecf44d87b20e) >> ->> endobj -1493 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 625.1919 204.1906 636.0959] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga87feebc7cffd4d8300e776cf64e4fec) >> ->> endobj -1494 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 586.3344 180.9384 597.2384] -/Subtype /Link -/A << /S /GoTo /D (a00147_gb5fecbc62edd128012cea0f47b57ab9f) >> ->> endobj -1495 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 547.4769 214.9411 558.3809] -/Subtype /Link -/A << /S /GoTo /D (a00147_gf2dbaceb10c67783a115075b5b6d66df) >> ->> endobj -1496 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 508.6195 203.0756 519.5234] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga20812098a4663c8a9fc4ce8e95391b6) >> ->> endobj -1497 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 469.762 203.6235 480.6659] -/Subtype /Link -/A << /S /GoTo /D (a00147_ge5ab69d40013e6cf86ef1763c95d920e) >> ->> endobj -1499 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 386.9994 175.2098 397.9033] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -1500 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.0255 386.9994 203.7128 397.9033] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1501 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 348.1419 185.1725 359.0459] -/Subtype /Link -/A << /S /GoTo /D (a00147_gaa585784b0914cac1d37f07f85457008) >> ->> endobj -1502 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.9881 348.1419 213.6754 359.0459] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1503 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 309.2844 152.9837 320.1883] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1504 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 309.2844 211.6433 320.1883] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -1505 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.459 309.2844 268.3701 320.1883] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1506 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [307.2043 309.2844 331.8917 320.1883] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1507 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 270.4269 171.8826 281.3309] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -1508 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 231.5694 172.9089 242.4734] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1509 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 231.5694 236.859 242.4734] -/Subtype /Link -/A << /S /GoTo /D (a00147_g79c4110211247df3fb30b8cf1c4c02af) >> ->> endobj -1510 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [240.6746 231.5694 293.5858 242.4734] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1511 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [332.42 231.5694 357.1073 242.4734] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1514 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.5934 93.195 210.4073 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00147_g61db1dcb7c760e4dd5d60bf4e5576dca) >> ->> endobj -1489 0 obj << -/D [1487 0 R /XYZ 90 757.9346 null] ->> endobj -1492 0 obj << -/D [1487 0 R /XYZ 90 644.2869 null] ->> endobj -1498 0 obj << -/D [1487 0 R /XYZ 90 405.9509 null] ->> endobj -1512 0 obj << -/D [1487 0 R /XYZ 90 194.2442 null] ->> endobj -746 0 obj << -/D [1487 0 R /XYZ 90 167.7584 null] ->> endobj -1513 0 obj << -/D [1487 0 R /XYZ 90 167.7584 null] ->> endobj -1486 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1523 0 obj << -/Length 1357 -/Filter /FlateDecode ->> -stream -xÚ½YßoÛ6~÷_!`/6Psü)Ry°¥ëZ ÅÖØC[ŠÄÄFeɳä¹Þ_¿“HѲ$KrÒA Š<Þwwä}äÉÄÃðG¼{RH0î{Ñf†½Gè~5#vx ã˦ÀÏw³¥� À§¾w÷Pið ”Pï.þ0çj±¤ -K<ß¿þšÏ ¦ñ6‹÷‰6íÛ,ÚotZ„Å:KŸîÞÌ^Þ9\k–`>)Qÿž}ø„½Ì{3ÈJxxÁˆõ63NYý’Ìþœýáô˜�jBŸwœ‚gŠ0oÉ|¤HÀ{¥”@˜( � "h T€0fÒ“Œ!pŸWÑxù5Ül�ß´=$˜"É(õšJÛÐÜX‡ÍXÙ³{´Cï,‘$LôYÈ:9'VšxÐ÷Q²†•@QÇHÁ,�4r餯à;ÚJxT‚zK¿ÖcJqR�Ýê�Ót]m‘jׄ…y&ëÔî#¡ˆidæYN©7Ù~½E+ƒ™HäSnæ½~Ð;�F:6’÷Gó\Å6þn·Q˜$±ÀðO^XðÔ -»�µ+¨Ö¾`F�ª€}ä#ŠèV ãù±qñdïçð>Û:®UZ�ì\#åˆñÀDé·07³‹•Ueiª£SÔîµ®ãg”ŸûìæeÐÚ™¦NãŸúâö.K—ÿê]f¤Ömäý¢Zô›±ª ½`OéòN纨üî7q§7YaÛ«,/P{ÏÖÙ*¤�˜¤ÃݺœÐB)Ĩ¤zøê|îØ×›ÎµTi_¾)¶=‰Ì8øÂÅ`TœÐl[W û¢‹¨ÀY¡Î/»\‹�a·´–Ø…NR]Ä=^K`b"‡÷‚Anë2^;^hC)8¦º_‹�ÑÖ:Âß”c8˜Y0'4ŒÝÑÕ o"jײ·¯ðuìÍžÌÞef|bÄΈ=ú² À¬O¡öíN/¨˜ÿ³Îöyb�ÍÑÆav˜5ú’fåœC¢ãGÝÏæ-8�x’À΀[ã}¤M»ÈÌ3=ñ=¼U|_Ž®¬XÇ.è³vAËÚ-CýаB«m ?¶á—Z*Â_2¬æw«µÕ¸Ñaš;ç -„0Á+Võ~s§¬j²ŽÂÓŽŒÂÔÓî�´òèpŠìÅ#†“ùNˆÁ3¦)uù�á°•|ªÔ¤C† BW§ ¿â”éZØ{Ì8±aÒåI.ØptœÔxGÛïÂ=ÒǬ�~9µü˜½cÔ‹DÃapR#ð]mMö%µ’«Ù·*Ö¾ÙÝùù×b~™=£$Ëõtæü¥Ÿv9íõÑò >ìÓÆö`زT0Á^–ëu°<³Žì¬Cy,„Ç…/湆JHk†Å0×4¥.s UPí*!'rÍôÕ\Óµ°—kœØ4®ŒÎ‰kFÀ;ÚI&œŽkëS9é†3ån!F²ã;ÕŒF÷ÓKÆ×%&Í«¦æ*½FtœæÊ kI)R[RöMŸ�ONè´0HdÛw~öÄMxRa»â¬eX¤ó<Üû.QW�å~›_ÌZØÊH $k›R—³–p‰!S³vúê¬íZØ›µNlB%:šS):‚ÜÑ6\ŒžƒN¨FÇàÛz§Õ£Ã¾»‚t¼£mbI:5®&±££wjU:†SY: ßÕöm -S‰ÿ¯ÏŠÏ/LÛŸÎ ²èý �!rÄþ³¾ªW¿ -(˜BØÙ§3’©rQ…‰Ü§Î”26¯tªw¡ûÚWÇþmÝx³ b¾·/„Ú'¾¡ì†ÚÅ ûöVVi™=yº¿4Ôq¿Í¾uç÷AX_”þ5'Ùoendstream -endobj -1522 0 obj << -/Type /Page -/Contents 1523 0 R -/Resources 1521 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1437 0 R -/Annots [ 1525 0 R 1527 0 R 1528 0 R 1529 0 R 1531 0 R 1532 0 R 1534 0 R 1536 0 R 1537 0 R 1538 0 R ] ->> endobj -1525 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 720.0194 154.358 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1527 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 573.2189 135.0008 596.1877] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1528 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.9895 573.2189 174.014 596.1877] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1529 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.8794 573.2189 241.5202 596.1877] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1531 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 417.2379 142.7416 439.4893] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1532 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6071 417.2379 210.2478 439.4893] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1534 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 273.8347 142.7416 294.7461] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1536 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 132.7034 135.0008 155.6721] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1537 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.9895 132.7034 174.014 155.6721] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1538 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.8794 132.7034 241.5202 155.6721] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1524 0 obj << -/D [1522 0 R /XYZ 90 757.9346 null] ->> endobj -748 0 obj << -/D [1522 0 R /XYZ 314.6454 681.6068 null] ->> endobj -1526 0 obj << -/D [1522 0 R /XYZ 90 665.7144 null] ->> endobj -1485 0 obj << -/D [1522 0 R /XYZ 379.3917 536.8636 null] ->> endobj -1530 0 obj << -/D [1522 0 R /XYZ 90 520.9713 null] ->> endobj -745 0 obj << -/D [1522 0 R /XYZ 231.9163 380.1652 null] ->> endobj -1533 0 obj << -/D [1522 0 R /XYZ 90 364.2729 null] ->> endobj -747 0 obj << -/D [1522 0 R /XYZ 226.1581 253.0464 null] ->> endobj -1535 0 obj << -/D [1522 0 R /XYZ 90 237.1541 null] ->> endobj -772 0 obj << -/D [1522 0 R /XYZ 379.3917 96.348 null] ->> endobj -1521 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1543 0 obj << -/Length 1882 -/Filter /FlateDecode ->> -stream -xÚµYÛŽÛ6}÷WèCm fy—”—EÒ4¤É}H‚@+Ók5²äZrœäë;IYwz{ÁbaŠ<œ©93Ybø#Ë/ ˆq¹L ¼|€î b‡70¾i~¹[üü+�–Š$•Ë»]-A$(¡Ë»íû•Dr½¡¯Î/ߘF|2mk«_…ž5½³ì@²´ µR㜓qÝ1.Ëè;Î%b!¥·:¯Á{,ÊuîËÒ²Rù”÷à5CŒDtÞ} ÊgÅ@šs ê+Â$ –’cb9‚hÓF ÃP!ŒÈA¼•µÖç_ãÃ1S哾f‚Å(™UÍQÍùí!8@ab̶c\Ó&îU–›Ëš`8ZÙ%S�<0„áY'9�Ï„¾,mÁOC�Eç=•Ópx¯ö¾\­¾RY®ª‘…SŒ¦’ί¼Ay”¥™µηí” 0äôV'4xŸ¹ÚŽ‹ºO²¸eÄ RÇ#Ê=np(Ÿú�4­¾~35?:!T J"3øÌPxzeÛØrm–:b—›F±3¿zJve}´G]æ–„w -51 ÜöÍüÖ/Å§æ¥øô—ÄYæ˜Ýµ}U§Æì©šÕû]7¿÷�Èf%Q7+a‚Y+Ó ¦3�m\ÅY7ìNå9¤–xçÒ˜õ¼Ññhœk¢±Jó¤8¤ùƒyÒŠ\‚äö&µ)“ÍY2;1^S ”¼gi|ï¶HÛ˜î& –üjµ½ïôlØÚµ«Ñ�oVZ)—¸¹¤·ë¿Æyuï¡Ió´¯OלÏN*ÝA2 ¬~¯’ÏÖö]cûIu}Ôqíu--G¤ÙÕWÎÃpZ&�‡!’ð’ÏZ 4Ígâ–ˆr#ŸÍ(~4� ìe3‡Òöm÷É1¡0"NÂYë6 È£·/kœÂ8ƒ¢&]�Ókvp�î¾ÔYþÒÑ”3`ÛÙU;�Gs_ÖSGZ¼ÏŽ�\a .Aļ”GýPZ›‹ˆb¸HÞÌE þ+.Ц¹(W—NZí壗6T��kPœ*?ñìéuü±æ ¢¾ÛäB³¾ˆÕmfÒvèkÝÃÂS�¹ëQ›¹ë®Ò«`ÜÚÝ»ú–ÎL1=Ý;vè8ž”eB€Õ»� ¼[×âX¤yå -š á-a[“Z‡IŒçôpõÓHüoWcÕþTœö#µVæ.·Í¤S=i2&B*„¤€ð3Û¨é˜H!òHw_à�‰sª‡ŽÆÄvK)2ë›k-âQ=�6_�t•ÞPŽxÔäjõp°‹ìËZÂI©I8ì:¼‡óËw(Ÿþ�´ñå!+ƒ›—ïð^õ}¹ó÷‰„!L9¿öåQ>”æ¹Od…¡�·:¡ÁûìÈõ‘aˆ‘`,ô¸Á¡|êÒÚd9!�%Cy?ê�ß'Ë"ùüÉ’E›ÿì~™Wæÿ¿,$xš™�ÅUàí´> endobj -1546 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [281.2077 672.8902 338.5322 683.7941] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -1547 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [445.3859 672.8902 493.3155 683.7941] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -1548 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 638.3707 162.0093 660.6221] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -1549 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.9981 638.3707 201.0225 660.6221] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1550 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [220.8879 638.3707 268.5287 660.6221] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1552 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 485.4889 139.4144 508.4576] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1553 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 485.4889 178.4276 508.4576] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1554 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.2931 485.4889 245.9338 508.4576] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1556 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.8738 374.2304 451.9686 385.1343] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga87feebc7cffd4d8300e776cf64e4fec) >> ->> endobj -1557 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 339.7109 142.7416 361.9623] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1558 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6071 339.7109 210.2478 361.9623] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1560 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 192.4983 139.4144 215.467] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1561 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 192.4983 175.0106 215.467] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1562 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [177.9994 192.4983 214.0238 215.467] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1563 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [233.8893 192.4983 281.53 215.467] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1544 0 obj << -/D [1542 0 R /XYZ 90 757.9346 null] ->> endobj -1545 0 obj << -/D [1542 0 R /XYZ 90 739.9346 null] ->> endobj -716 0 obj << -/D [1542 0 R /XYZ 480.5514 597.9626 null] ->> endobj -1551 0 obj << -/D [1542 0 R /XYZ 90 581.3198 null] ->> endobj -742 0 obj << -/D [1542 0 R /XYZ 226.1581 463.4224 null] ->> endobj -1555 0 obj << -/D [1542 0 R /XYZ 90 446.7797 null] ->> endobj -715 0 obj << -/D [1542 0 R /XYZ 226.1581 316.9271 null] ->> endobj -1559 0 obj << -/D [1542 0 R /XYZ 90 300.2844 null] ->> endobj -750 0 obj << -/D [1542 0 R /XYZ 391.2972 152.8075 null] ->> endobj -1564 0 obj << -/D [1542 0 R /XYZ 90 136.1647 null] ->> endobj -1541 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1570 0 obj << -/Length 1722 -/Filter /FlateDecode ->> -stream -xÚ­YÛŽÛ6}÷WèCe fyE)/Фi¤hS¿%A •èµYruÉîöë;/–%Yò6Áb!Jž93‡4Ycø#ë¯(b~°NŽ+¼¾‡Ï¯WÄto¡Ûøu·úù7­#4XïöB@§„®wé�ãÍ–†X`¯}ó'49öºñ®LÛ\êöË2i�²hâ&+‹Í§ÝÛÕ«�ÓkÌâ, Jë?«Ÿð:óÞ®0bQÈ×ð‚‰"º>®|ÊìK¾ú{õ—ÃÑÝ€©Ùq¦¦ÇÓ£ð*ôìÞÔ`}zEYlÿ•U©ß²½~6©•Œk˜ÕåÇøtʳDÏW3`Y±ñ±÷uC±W~ÙìÉôR 9ÄÍXä%mUÉ ñŠx¦3)‹B&güClÆßIiU¦¹±f_VÆ,ýx8dÐë®Ù‚"Îõ”ã"Õ+VÊ67í;³Š§2ÏeŠÜ8�êûݸ]gª/:™¬¸W/�'7”ÃT ÷`íuºïÎ hëÎðE ŸjY¤#�›X~È0ÊàbåÁ¯N¬)��riœ5HíJøRÉcÙÕ‡²n.G+ͺ¥Ô¢áN 9Â$ë ðQ (™ÜgVhÛ—‡R!Œ`‰Ü(XçÆW�ññ”ËúÅP3Á Xsª}…ćf×§¾T÷¦ë}Ï@‚„ñ) ûÑà䜘2±’u™ÝÜCÉÈJ"FCÞANjIÿMéÿi¤Ôgˆáh¸*×§oå—Ô�p•úFæ…lÒ‰¹ �˜O‚…¹[©%å#4=÷.U�µG‘J‰ÁÍN°òKvŒp•ò.É3ˆé± ! ÐἜԂú1šR¯3Жp B9XGÐKùcZd&1*o5ú iÉä1AÝ(÷ú©†ØRÕf'tä8 ý^îe%‹DÚ´ø¤Ÿ‡¦9¥Ÿ!á'qžÄÃ?1K¥£åJ§K¶ÎŸCÁÎŽAâ«E> ÃÎ*Ȉ"B 4`Œ½Rí€ól>Wz²n⪱¸–]ÂR_UO3×N^ƒèä �®æë¹™édÆ›]!S~‰MãTéB�•m�?Ùš"ÍúÔMy:YŸª?ÜR,rÀ�p؇ [Û‰o{òã­5BUÓVîRöôýÔ7ÅÇ!â„Lln'4oÀ«·µ±—EV»6òömaK?‡jžå¹þ^ž´W#»fŠ�$2;×áêÇ çž�yÈŠ´T}Z6¾ßp(ž¢.-”!P$M�ÝQ^—b�2[™Ù•ß¾5½™´½ä!&ÍÂä&‰Æ-ñ|K|ßWt)®�Ù-a%"m~i#^? iw~SÚŒÑTqQ³æzð(ÿ2å�÷2m « T¡CTÏ3}eTGi׫–D5† -Ô·º[#ÕÒ‹©Z]8+ºêSÞ(ÕÊŠ*ÉŽŠ•ÕHŒ…:Û]È\päN­&�¼ôÂ+"ð²Á�04ÄSˆáÇ`U[ó:hé�(7…pxŒXÇGÓa¶/´ºüÕ)Ó*Òl’ǵßdG©ò`È€ÑêP0‚Ã"ÔCƒa†b)�9ùmÀD:Ẅ“¿–ÐÔ¡èÒ�©SÓ¼f85ù�¯"FE§Ó&§«ô™AŽ5bž>÷¥®Ógˆ,D©ÞHŸçT?›>�-œ¤ÏNlž?ú Ÿ³yï8©%å#´þ0`6Ô~Ý V~ÉŽîÄ¢œðy78©õc´>$ä¹üÓçñG–?~öÇ®W©!�™¯O»�ÀžÔt¢GüÎ'rÅëô±¹W³”Ž Aw†ßXŽØ'2Ø —PZŒî²­le¼Ædð€É`Ã]°ã.çŠ{¶uD]°£.ØR—eòû¿Y -�Èwc)þõõW…)-Ûgp”ß-o?O½פ:¦]�f’‰üq¾3ë –œ988œ ñ]Y5VgÚÊËý×”¦qŒ µ7žTª®»¾Z�‹àpÉýùzÔ—º^�„mÀppc=šSýìz4¶p²91eb}lNS9>LÇçó®qRKšGhÓ9 HDÈÃ�Òë·ò‹ê‡¸ 9 V\,l 'µ¤|„¶t‘ã£Ppq³¬ü’#ÜÅ‹Œ8eѼœÔ‚ú1ÚÅEŽyf!"ü= ñÜEŽŠ“o»ÆþäA m‹Éb08Ž<ø¦_Cº_sBBí§¬E‚…Ý …�~@�)Ê7¯e!«Ø¥Zëûw¶ñVå×Ö¼Ã~AÙ jƒblî×öªºÚB:þ…Èúýeùøt/‹©³É„—þÿºdœendstream -endobj -1569 0 obj << -/Type /Page -/Contents 1570 0 R -/Resources 1568 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1565 0 R -/Annots [ 1572 0 R 1573 0 R 1574 0 R 1576 0 R 1578 0 R 1579 0 R 1580 0 R 1583 0 R 1584 0 R 1585 0 R ] ->> endobj -1572 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 662.2363 139.3246 684.4878] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1573 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.3134 662.2363 178.3378 684.4878] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1574 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.2033 662.2363 245.844 684.4878] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1576 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [366.5599 561.3549 409.5084 572.2589] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -1578 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [469.3939 427.7347 513.9963 438.6387] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -1579 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 382.8338 142.7416 405.0853] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1580 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6071 382.8338 210.2478 405.0853] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1583 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 136.5223 135.0008 159.4911] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1584 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.9895 136.5223 174.014 159.4911] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1585 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.8794 136.5223 241.5202 159.4911] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1571 0 obj << -/D [1569 0 R /XYZ 90 757.9346 null] ->> endobj -805 0 obj << -/D [1569 0 R /XYZ 384.3631 621.3448 null] ->> endobj -1575 0 obj << -/D [1569 0 R /XYZ 90 604.3735 null] ->> endobj -744 0 obj << -/D [1569 0 R /XYZ 226.1581 517.3041 null] ->> endobj -1577 0 obj << -/D [1569 0 R /XYZ 90 500.3329 null] ->> endobj -804 0 obj << -/D [1569 0 R /XYZ 231.9163 341.9423 null] ->> endobj -1581 0 obj << -/D [1569 0 R /XYZ 90 324.971 null] ->> endobj -749 0 obj << -/D [1569 0 R /XYZ 226.1581 249.8568 null] ->> endobj -1582 0 obj << -/D [1569 0 R /XYZ 90 232.8855 null] ->> endobj -1516 0 obj << -/D [1569 0 R /XYZ 379.3917 96.348 null] ->> endobj -1568 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1588 0 obj << -/Length 1348 -/Filter /FlateDecode ->> -stream -xÚ­XÛŽÛ6}÷Wè‹ Ô,/¢DîKÑ`Ó  -¤‰û”�W¦×FdÉ•ålöï3I],™’»Åk‘ÎÎíP"†?HÄY—û<3Ûs–èÑ †’ÄrÎÉâËêÝìõª6lqqmößÙ§/8ؾw3Œ˜Îþ®õ˜…jÃÐñ8aSÎGa×ÇC¾XŒñü—�úŒ1Í”=óþøõ¼9~}Øg›Ï˜ã$ϲ_ÍÒ1/J˜ªN -&XËø˜r„–•‰W°ÙzÎüüso=©Õ©¤qd™wäÒ;£t¤ö[RžÚ'E"6µÿúÇúpL•¯ê=¦C$ áq$ý]ä²Á;1 q³KŽ JzÔ -~€ËZjÌtO›6]Å#X†N¤ƒà’Wk÷†BöM__ÛH÷ŽXbÛoͯޒ6¬ƒvÈ‹ì ã�n,lsWäç®bAÄ\r�bßõ?å˜l}}¨ör½—ÏÕ(“]ÍÔ0–ÚYŸ©m©ë™J‚X|I Ù÷tœ�á–S‹�’”÷ü Iõ0HR»ÿ•¤º�&�Ô¸žÞÉ$åuNCR~ûޤ:æ_BRuê2‰x8Òc[BžÄå…îî9Þb=†oî°=|ƒ ÖIi|…:åé÷Eô3Ød¡×7µÐˆñK]Ýk4ÜÜac>¥ÃênG€ÂiÚn·U…Ê×èžÍ¯ñ…Nâ­nŸºuNïб¿CŸ”y»HÕÄ–üQ]{£Ø¬Ëõ#ôÂîÑAñc¹«ŸíbvYçN^VÅ¥›V»½~Ûc¢~ùÓ#9OÖ™™Î³ôÙL=(3W¢´ò*Ìí­xõï�ÊÌV- f×fhcµ Ž~*x0¥ÝuÌÓÔHV5 ³Y%ù¤�`´d8¶×2XÖóæép>•]tG€bµWðÜ™ ’œ“ê̵£tܬ݌o;W<—–õÖcºNT»[oºÝÚ¥[Ǽp[è­&ï»Rx�—ð£·aµ¥®w,3$©ž»�k‡x¸¶‡d˜kk1 Eçq�j1 -CÎý篥нâëÐHtÍ6wüVM¹:«£Ö„kŸ Ô—<Þ¸RаÄÑH\[Rž¸²á�‹‰Lä3}3õrQ-6™Œ¼jØhÄ~OÛÿÁGã—Üøy›O„—OšÖí˜ÊÇ(&Þž¦‘ÁØíÿwY´¾Úm;•|³+O;¶‹[P8¥#ï"—h¦ œ4%X—_8 "a<˜|\O"½èãgõõVÀÂ:×Ìn½L¸�›„>ê•©b]“Œ;ï_îá�æÔ³jñewÔf+ÅØº¢êPîö\ &w™ë>ÿñüØïÍúËì€~¶ù:Óendstream -endobj -1587 0 obj << -/Type /Page -/Contents 1588 0 R -/Resources 1586 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1565 0 R -/Annots [ 1591 0 R 1592 0 R 1594 0 R 1595 0 R 1597 0 R ] ->> endobj -1591 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.486 661.9112 256.4846 684.8799] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1592 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 604.5791 139.4144 627.5478] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1594 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.486 476.2657 256.4846 499.2345] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1595 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 438.4462 139.3246 459.3576] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1597 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 220.9948 139.3246 241.9063] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1589 0 obj << -/D [1587 0 R /XYZ 90 757.9346 null] ->> endobj -1590 0 obj << -/D [1587 0 R /XYZ 90 739.9346 null] ->> endobj -1515 0 obj << -/D [1587 0 R /XYZ 226.1581 577.8727 null] ->> endobj -1593 0 obj << -/D [1587 0 R /XYZ 90 557.7368 null] ->> endobj -1517 0 obj << -/D [1587 0 R /XYZ 206.4623 392.0581 null] ->> endobj -1596 0 obj << -/D [1587 0 R /XYZ 90 371.9222 null] ->> endobj -1484 0 obj << -/D [1587 0 R /XYZ 226.1581 192.2311 null] ->> endobj -1598 0 obj << -/D [1587 0 R /XYZ 90 172.0952 null] ->> endobj -1483 0 obj << -/D [1587 0 R /XYZ 226.1581 96.348 null] ->> endobj -1586 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1601 0 obj << -/Length 2329 -/Filter /FlateDecode ->> -stream -xÚ¥koã6ò{~…� -ˆy|KÌ}êí¦Û]l³¹�·À¡-ÅRlálÉ•äfóïoø´^¶A`ŠÎ g†ó"™aø#3…g‘ˆ�b\ÎÖû+<ÛÀô‡+â–—°¾lü{uõÏŸ¨š)¤$•³Õ³Á ”ÐÙ*ým.èbIcáùñã= ž„íà—2=î2;~_®�û¬h’&/‹Å«OW·«@×±%˜$šêŸW¿ý�g)°÷é -#¦b1{�ŒˆRt¶¿â”ù�ÝÕÃÕ»`6Œ�Nö–ãQøŒìé$’ˆ¥Å’`ŒçÿH³ß1¦…;Ó1?<«ÁóMš4É.+~ÇÃ?Ñ̬…$K9’”Äójë�À®M³µãòÙþ&Å‚ˆù«›<6Ëòyù”©�дìH“Ó Äó ˆö´jX0_Í6qóÛ¤vÈ«*_P1ÿKÓÈNЉƒwl­Ë¢ÈÖZY¨¯­X Lâh&¥D1I�ÉÚ-ÛPCyÇ -aÌW£HQndsW6ÙMŸ*ÁEŒ’ËdÔݶ6ŽPD˜8aë(N¯½9VÖ^Íä!©’}Öd•ýüöñþñÛ×ïÏ\Bæ«…b04«ûcíÿäpÖ™›x.+/ìÜéäùX¬O„š²»3+’§]–EÀçpíW"2œ¿·†™Ÿ�x½ïro®B’®™é-»“-£-rv«f„ %u†Ë³p%˜»?uØ\ñž®Ã ˆNˆq¨ê¦:®›�ÒG—ñL€}©Ü½ÖKÕÆÁ|m«ßÃ/Û†f7Ä«9Ò÷YÛý€ ŪÇDßòÐ�2ámÊ}\š0(‚�,B wxƒ;yºû}F©ˆQL„x«¸ü„¸†x=Kù!IÓêq 8F@À è¢ÌÔ„ÐØ<¥ç¥ºR#ʉ­² Ž—aĹ�îzp †òè­¢ ð¢â5¢$rD†1CŠ -6!C5$Ü ‹%âDvéʪ‘ �»‰#áds& �öÂÔx¢V`{×6RïÉ\¼ª²=¸v�Jï �u^lìpõîÞxRëê°qv’rî¼³q—’·Ý¥s?{¬M4ƒ‘! +u“T��JìøB}/vùãºÛl„‰ú�­sí%=b#/öt`-œ0‡C ð›lþÑ3°Û•ë¤Éê?"ðã�kÜ.1ÇmsÇ ÇÈSð­–›JÇœk˜¦R‡•ÚVô ¿SŸ‹�TÀÃïnïVö ¤Ô¸“chЬUÖTIQïóº>aÎ÷:ä¥�¨{ÚÖ� ó—|·³£u³ÃÄþhõÀjí @–²Ù»ô†8‹".6j¿y’ÙºµÂlþî§�W`™¡] €Ïä!«ò2Í× ´W7S•ë¬ »;ÞË6_o½5ý.<÷ñ=-}~É�º ˜ Ÿ#©ÏÏžCŠqÊÆ+4£Ë�«�‘�˜ÏÆZ¢xÊSyøe{Ã0EâíÅ¡v²Ûa(b(—Ôc¨ï·<Ôlš�³I)×Å çñ头 u>)å@Z¼!#½H󔑉Žf¤ìto8dø'Ÿ§¿ül² 2yð!É.×Y¢�. m�ðÙþÖǃu^—Î@Ív@yªÜÞC战’�—ÍO�cíêôÌ“#äJ#ãÊõ·N�—cwåGí¼Þ­>þzûøåþö®(\†šr0Š¢QÂæ -‰XÉ©ÔÆÃ/Û†bâuV^´pÁbD ã=.z*PS´Ø‚iƒÈt‚¢”ê -ï!/ÖÚ'ðP=0Õ‡\ûé?�yeâ ÷..txqÜ?Ã�ܹ+5¸¼…Éš]Ø–ÕÿÀkã@Ê* ˆrj|7ìËГ֒ª:°c£{OŽúf1«gàŸÊ®ü²½a(Ñ!^-´ŸWºDþr÷pÎcéÆ@—“±ÎÁeÒ§ûK’‘²ÕRY ¼†v«PK°‰ŠÆ�/Ûð#ÔûX5ñmSõ¹3.QD¡ê2Ò÷^jŠ>X0v½ÓûðÑbgR½. å9뺙R°•w -ûó.¼ mù‘�ú«ÓÇ�Â"§ ËRBÕi¿þÜT ©´êÁjþ`‡×vQôšÈøš\S-Ù°]!.¹ “Ýý?¯œ-ÆF3ǨPCRM5YÚPçãØ.’‚ZÝÜëëí;õùà6ÆÀ… 7à¤S„„KÀzEZ‡p�о‹"ð@#"èÚ'C„ÃéýߺÔl€¥vÛ$! ë–/ :/3([ˆ d"!hƒ]’•kWlºPM“u@Cª]AQ…Tu]ª®©Eäò)wU›‹'úvûx"\ü07¾?DˆÂÇqÁP(Q%‹Ée›oC�·yª ËVÌÚü׬ÑíR(».üEê'å É�FƒĨ@tyár|å2å­Lù>ºê•§¾\�¹«ͤk&¶öŸJÜ­%™{ð»oŸ?Û‘Î5¦¢!k¾�»Ô!KIè|e›žW(ä2”N9±6Ô…rŠHìœØí÷dØe—´y�4G*&†!‡Žë€Ãq�{0Íb½oh=ômŽÃÅeѨ)Êl¶§åÒa[U XÒ>õ mU?Åǯ)޳§õ.ÛŠ�b¨u@n—Å &ȱµói�˜¾yüæ¾9ÇÑå¾ùº×®òÎæ9«2H×M–Ž»Ù˜Ö !M¸¹Ùijfyk¶YLwF·:“MíÖuiõîó—‡Û÷f‚„ íõ/wwnÙY@ÿÞú]õh·-°Ÿzîz`Ï�uV¤í£83³¯îÇMzhü=‚±Qû=€º÷€¿LôÈÓÓKÛ.¯›¬8ßü&J &8D0 $ÔTă/Ûð#/}¬gÛµ”(˜\öèÛ²‡ÒíDJ ‚d’u ÿ­~-áPn -wŸa\�Ô˜¼–phÆúš<ä?Ýv¨ËÐØc.�d+-Ž1pD¤�ë�×¼Sǰ…°N´��ÿ³Øt�@jP»ÐÀŠ>ꇬÈ*¨ºož¿øÁ'�Ý¡îßPvCÝ“6ÅXº';eýKÞðíÛ_—÷å÷×MVŒUœ#Rú?‰«cŒendstream -endobj -1600 0 obj << -/Type /Page -/Contents 1601 0 R -/Resources 1599 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1565 0 R -/Annots [ 1606 0 R 1607 0 R 1608 0 R 1609 0 R 1610 0 R 1611 0 R 1612 0 R 1613 0 R 1614 0 R 1616 0 R ] ->> endobj -1606 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7506 575.1408 195.0552 586.0299] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1607 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [257.8193 575.1408 315.7315 586.0299] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1608 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [359.1284 575.1408 384.9216 586.0299] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1609 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [317.5642 496.9047 374.8887 507.8087] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -1610 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.2809 446.4365 239.2097 457.3405] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -1611 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [472.3426 434.4814 513.9963 445.3853] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -1612 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [117.5067 422.5262 147.7231 433.4301] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -1613 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 227.0741 135.0008 250.0428] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1614 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.8662 227.0741 202.507 250.0428] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1616 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.3577 117.9412 220.1509 128.8303] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1602 0 obj << -/D [1600 0 R /XYZ 90 757.9346 null] ->> endobj -1603 0 obj << -/D [1600 0 R /XYZ 90 739.9346 null] ->> endobj -1604 0 obj << -/D [1600 0 R /XYZ 90 620.2512 null] ->> endobj -773 0 obj << -/D [1600 0 R /XYZ 90 595.6504 null] ->> endobj -1605 0 obj << -/D [1600 0 R /XYZ 90 595.6504 null] ->> endobj -771 0 obj << -/D [1600 0 R /XYZ 286.4315 154.5275 null] ->> endobj -1615 0 obj << -/D [1600 0 R /XYZ 90 136.4373 null] ->> endobj -1599 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F52 1229 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1621 0 obj << -/Length 2589 -/Filter /FlateDecode ->> -stream -xÚ­ZY“Û¸~Ÿ_¡G©ÊBp’„ó´‰�µ]‰=ñ(O»[S”ıX+‘ZŠÜñüûtã/‘ãJÊ5&6º›_h4Åþ±…¦‹XÅD -v§;ºøÓ?ß1÷x Ï×m‚¿mîþò®šèˆG‹Í“á1¢8ã‹Íþ—eD¢Õš+ºl>ÞÛAz>ó]Zçea'žšb‡w¸Õ,ÖK%V¿m>ݽßÁN/%"†bÿ¸ûå7ºØƒ~Ÿî(:Q‹g¸¡„iͧ;É…¿9Þ=Üý;ð±Ì‚±×“^-ab±I˜–£T‰"”%1 ÁaLñq$M(ñ"‚ИJÇç²ÎÞöߎQNbÁù¢Íp 6P�È-¹ŒÆ$fB]¹¡à‡¼Øe«µtYr€Zp�·óÙŠ©å÷s¶«ÝãúàVœËª¶£¢9m³Ê>Îݺ"«ŸWŒ.Ëêwû`ûR»…eµjI—oà^êej§w &ÿD�Yu 4—¼øÖGG‚;Å*’=tðQõÍÑ|mÑÓÏà4ä‹8}جX²üòùáWª(ü±¾:Š2"Y¬¦�¨f”PT’˜2ÞU¢¬†.â�J5aÑ �z}%ŸrK„’5Äá­WZˆüXt”è{©§™-"yÒ–Œ>‰Ù ÈvÙå’V/«H-I_{Q" ã²Æ·µMm•‰é¼IY`‚„³+OT§ÉÏ�ÇüRg¢ñaã<"1Ààß_oª&!Q1ª¦sG›êv&2R±Qéƒ,­ÒSVCÐÜÊ"lT�[Ù„�hN8â$� U1 ¡/ŸKrKüU¬#yÿŽpM…©ŽÔŸ¬‡°h½Ík;¶™Éø�ËL8Î ïK­Ì„63áÈf&5åbõ‰ÙŒ[Tv„èÖœÛè~ÿ==��Ù”'DKÜ¡$ _›†Ž&�@fÒ@v<–k‡ÝqOvU!yRØ('AòDs*ôy¡o\±Pì¢N’¸Òm ùœ}®¨D�Á…F^Ÿ³ˆh -¦ž|ÿ@5#{È …ÇĈñL 8Q<²>ô.û•R^ä×**uqpÌ çâŠkçëOöŠKŽî!ä7²³" ¦c1‰¸´%Ê×ì)«2¨\BþÏÇûÇ~|ؼÿ|ÿåë*¢ËÍÃôº½�5{5¾ô|é1­ýã¬|¨ëóè4¿8KthŒ½€�',±¯>‰ bá@M½:äû€Àã%ó�)”%‡b 5" ÞZž)IðCE¨ÂRuòfLdÌÉ>­Ó]™‰<Ïç�O]õ7yD'žß1+ÆØ™ä´²ÛwÏÓÖê !¡†Ä<,µõ´‡€‚ÑÔúŒs+Sâ`×T`] û4:ߨ+lL…ÉcÞª0ñÎÏ6ã$0ªK{u†€QÙÔv�º'P§�PaÅøídõ@â'{ÝüýÞð“q´üR_§ë‰Ã)PRÇá�®¸¯DíÌ6˼º®J‚òwtˆlÞò¹R>ïèá„óTº}([qåx{äÎU‰õ Ö¹ÉÔ}éá¬XVÞ•žÊâ!J:ÓáŒ}9C·«›ôˆ0à�©ú�ò’…µ�'|ªMU�C{ÙÁ:KŽ&²l-eŒjkö×=V%'H>{;¿}ñ˜ҧô{~jN]m6 ïØ}æ]gŒqq -T*Ñç ˜XjnÇ'ϹшӦ.O`ê�{ox¸«Ê³}hué0¿”vÆ�† -~¡#gè@À£ÊÓÚ­ï)<â.’j�>1®Ñ5µ¶†Ä¹ý=N+QH "_I5»Éyúu{ÁÈ.7àëkÝÓåfÙÏ¡¤—j L³óT3*p(ýÁ¡£® -6 ‘­CƧmSÌüÑdÕ‹{h"-ñ‘»£*ÎxËàØd‡$d5C–ºg×ÐÀ;ë?N¾Ýv¥S³ã¨Ö†7 -FÃ΃ÕÞdÁئº]0 -8‹P•èÙ¦›{-ó‡rGËÀ@ÖÊ㜶ó8ÜíKS0½,ÊÚN}kàdRÔYfoÐÜo 0¸¬˜Kƒ<˜„è9mªüš0Ý\må.ûìRçEj·žµ€]ýãSO�ã «¼öÇòâäæÅ•x$µ رàÑ5etÚVÝœ³u$cû…!xÎëÃ5¥ô Ó„'1Ø<¢ÜNÍÄz _· M:äëc½²�žÓµ”èK¤÷ëêÔs®@5§I$ˆÒpÎïhÒÛ�mföE“—³Ú$yæv=›…G,`¢•+Õ{ºÖ°ÝæÚÛå±®)íµÊ®o¨u®ePsÝ©íþ×nXÞÎ}$µžÉ-ª‰LÀ9¤l—&_ÛS`*7ô5o²vQÛmÀÀ#= @ A Û$÷¢PõväþäþP)ûó¾7戟ùîàJëK—z›…Êk˜Ô8ÛCBÎd×Õ€žªUÄwზJMËôD™½Š9éÈÜx||-fY~Ël¯bËäG€óîÍUL˜žkƒµ©nÇ8 ä ×›oŸL‰þáöÉPÃÑ}3�™Ø8ì둦 v=Y2­à:P͉p³ÇȾP `­UOèí7÷ôsâ|';&,†±`bæÝ=՜𷙞‘Ö°jñj<ýœ¾¨Çs¶Ýs ŽaãHJl�«iÕŒø!·vãH&?Ø8bI’ü?:G¦Ã»6&“~CÇ<ƒøê&ŽtMœK]5»aó^6–�îX¬I¢¢¹�D�~Ý^0Ì@C¾¾ˆjöçGlƒ [ƒpÄRq_“AkÐQ åwšMCnÝžSGÙvÏÉ«XdÏ××@×$Â/µòµ¨úÔ†|½Jù9Ýï«Ç�ý„ä°«16�Z šAM˜¸`7Q»Ù©«¬~#Ø -·ëÒñ,+’˜$‚F¯E2ÐÏ 9äk�dÑBÀ…D‚ñiÕPpÉðcÓ]Á•ÿðÓ78 “ÀÌtóÍQ™ô»�.5g—#üÇÓëqMèw÷?Òy¢}bØ_¬Ý¼‘×Ô^®R€ÊJ�Ù¶8dJW9õØ -x…¥½¾“‘p<–;Ó22wN“¦p­ ˜ÃçG;ôÀöûH¶Ã¡ÝA”kÕÒf;ŠJ/?ØYëp¾¿Ó”(�Oe¹ogÈÅ(ƒ­“±;”—ÌϽØ9rºôËÌý -OÍã¹OÔ�~Ý^0rvðmg·m^ìo�a¥Š ukÞÓ¨žjF©4‰´]=ÐÚZÛB½�†ÿ˜ :ærmàJ:T¥Í«›ê�éo~½WpŠâ°¦«H¿óT3J0%Pt5i‡9t_üyÁŸÃ¯lï -”Èrèį+îߎýˆÁ`ÜŠt�?#PÑÿôÛ ƒ|K˜è$ãÞO$þ·MN Ôõç¬È*ˆï}÷‹É¿üà†_ãnwWú–‹·œÚ;N©ûyÔÚÎ7_¡Ý�iïÊï/߆'G8Žàó_ðØÂrendstream -endobj -1620 0 obj << -/Type /Page -/Contents 1621 0 R -/Resources 1619 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1565 0 R -/Annots [ 1623 0 R 1624 0 R 1625 0 R 1626 0 R 1628 0 R 1629 0 R 1630 0 R 1631 0 R 1632 0 R 1634 0 R 1635 0 R 1636 0 R 1637 0 R 1638 0 R ] ->> endobj -1623 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [460.7601 717.9621 502.4137 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -1624 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 706.007 136.9336 716.9109] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -1625 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 607.5313 162.0093 629.7827] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -1626 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 607.5313 217.8992 629.7827] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1628 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.6109 416.392 236.4535 427.2959] -/Subtype /Link -/A << /S /GoTo /D (a00147_gb5fecbc62edd128012cea0f47b57ab9f) >> ->> endobj -1629 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [309.2914 356.9954 361.4951 367.8994] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -1630 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 254.0374 139.4144 277.0061] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1631 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 254.0374 178.4276 277.0061] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1632 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.2931 254.0374 245.9338 277.0061] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1634 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7506 176.8276 216.6541 187.7167] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1635 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [285.5252 176.8276 343.4374 187.7167] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1636 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.8343 176.8276 412.6275 187.7167] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1637 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [393.7656 122.7745 457.7454 133.6784] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga20812098a4663c8a9fc4ce8e95391b6) >> ->> endobj -1638 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 110.8193 151.6186 121.7233] -/Subtype /Link -/A << /S /GoTo /D (a00147_g79c4110211247df3fb30b8cf1c4c02af) >> ->> endobj -1622 0 obj << -/D [1620 0 R /XYZ 90 757.9346 null] ->> endobj -743 0 obj << -/D [1620 0 R /XYZ 350.0021 547.1921 null] ->> endobj -1627 0 obj << -/D [1620 0 R /XYZ 90 530.476 null] ->> endobj -1520 0 obj << -/D [1620 0 R /XYZ 247.4281 212.04 null] ->> endobj -1633 0 obj << -/D [1620 0 R /XYZ 90 195.3238 null] ->> endobj -1619 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R /F52 1229 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1641 0 obj << -/Length 1580 -/Filter /FlateDecode ->> -stream -xÚ­XmoÛ6þî_¡}ì!âø.)Ã>lK×tiÖ¸ŸÚ"pd9fKž,7 †ý÷݉¤¢w·C ¦È‡wLJÇã™Gá�yõ�HHíÅ»õî ûùŒÙaÆý&à×åìÇßyäE$Ò\{ËM%A3¢8ãÞrý~®äÂç! èüøò -šŠÎ¡¦ñG¾>nÓ¾Èãã.ÉÊU™æÙâãòÕìÙ²ÖkÍRB3Ôú÷ìýGê­Á¼W3JD*ï>(aQĽÝLrá>¶³ëÙŸµ3PMZ�ä°²� ÏÇ.¨�ê¡CE(  „Ãòþćö`z@YŇ$AÈ™ç@ÈÉ1ÝߤûÕz]Ü” _S:ÇöO¸jíGDj©*ä¡,ޱÅà¬ãzçYE�)¢%“žÏ`I2¬&üP�X��þØH÷¥XPÐ -I;×¶çUô{lœ�,âgL‡gð†Ø�‰±AþÜ62Kº²^,ß\^c'ãB*7&2Ý Ì -þÎJ¾|÷ú5N0_ÿˆZs�·i¶®¤ i—míþ€œ»>è¶[ƒopŽAª}¢‰ê’0"” -�%""l!j¼Z0p„bµKʤ8œwõ3ÊI 84 gH�î[¢xÃF0ð‡†¦Æz&ˆ�0MSà@ˆ¦b)“T´/ïm8p±ÍHó‘oÌoéPE²ËKÛ¾Ï%'�1"ÕpPkpõ„š¢Ê¢*¦öyQö´r  ÒbZ«õ´¶yÀSè–Öå•%U+;în“´ÓÌö%å:X^üe:nÝļXZ©9óy*Lû|5îó -ð!Õ&ò¼MÊc±`jž�:<›Ö^£Ô‹¡Ý«aŽÈÞæAX�tG+Žwò¶µ�~J}Wj3V¹ˆÞ2#„uQ~bñtJ9P‘N�ß²£'· -¯É!ß~ZhˆM}"JÂè tJ{W*'O)S%.*š³s‘| ”gé“w¯lìݦ™unˆöµ…S\º GŸÄÄå>, šKiCâ&)’,Nì¥w_æÙÌWÎêÙuà8?ßbä±]ï^^ݼ»¸ºùíÍååucc{øÃ´=îì>º«·'nœuÕüÎái‚Cô‘ææÒDAÔY¥óOÕ�”6mɶé¡L2ǘ¢ÝmçT)`÷¤d„ŸŒÏ5Üoàû1¢'µŠÏLßô.w.ÀQEG}Ç릧³•Pp &àB·tº|¢câh @<‚ª<Ø€š^ìCÞE„`h�$BF&©º.ó½sNä6Íîl¤Ï;ÿ°OâÝÔm6Z3›E®…šŽÍMÔxlR`O×%ä4ãqyRíS:Ð×;qkXÅT -~¾ð…@NR8€‚GóÍ1³·ö'˜­|žJ;\‘‡#&ÿ–˿p8µóZù˜ü ‡Lþ%)F]Ø´ùÊtÃÉÂÎO¨ -‚Ú‚ã7°ÃŽ„š;€"¦ÃÎ豨ñ'xêËEž^,,œÛ‚Ê9cÓ(³àV äôfÕ¨F( --nm#ò~}Roª†š‚†ò‹¯çæ„)gq0Ôß -ÌýKZ‘H¢cJï’¶¨Sà%ÍöþôàÒ4¸+«â±º&G«äßd¾èE£Ñp :“µ¡)©«í�¶JíA˨"J' -ê&j"ŒÀÍaïk -j6hÀT`éZ2\%Ö°fTo£GÔ7Ê X»¼€ÀO¡«¥õûÞ¦ýÛ´ü¦E"Øc~mV¤Xø-²"Lj^¿¼^>»¼zóv¡é|yM†^ a2,À)ÐÇ´)»ÿ÷ƒbõ Â&Zž©á´ˆwFp˜(5¯MÁÕ> endobj -1643 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [124.6997 570.6986 183.6983 593.6673] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1644 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 533.0943 139.4144 556.063] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1645 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.2799 533.0943 191.8873 556.063] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1647 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [205.4361 438.1884 231.2292 449.0774] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1648 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [460.7601 376.1104 502.4137 399.0792] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -1649 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 364.1553 136.9336 375.0592] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -1642 0 obj << -/D [1640 0 R /XYZ 90 757.9346 null] ->> endobj -1518 0 obj << -/D [1640 0 R /XYZ 206.4623 473.4116 null] ->> endobj -1646 0 obj << -/D [1640 0 R /XYZ 90 456.6845 null] ->> endobj -1639 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1652 0 obj << -/Length 1881 -/Filter /FlateDecode ->> -stream -xÚÕZËrÛ6Ýë+4Ó�W«6ÊMuXî7.��â^°a(·� Ef¾®UÚÊ.É…Ïꣿ<†ÛÝ~Xa+Ro¶wá‘ú±ªüó«Íí³Ûj_mkÿÓ¢^t¡îõaÈðñé$ BÈ �µˆ@XqÞTå¦z‡1ÝV‡3Ú�D!Lõ¸tc@Û§q£,gšŸâ8Âw”&:$Ø>Eƒ;TŽ×ÊÊ`)û¼?¬|MrnUA�»[û;�ù;N#àsi$q]ÇÍÇÍÃbµÚ'yhƒ´á&Ó•cO¢5��n¸­þ~lÅâ.qT&Q™FefŸ%iÇY?YKL�4˜Å)Ÿé¿|£›Ìžj›¹äMævÀÊèSP—ù/Öbõþ¸ô^6 ƒCS)¦fÕÁ»âÖÖQÌv÷Á0Ç}ðH]ÐX=„ÁH1ÂázøjfG/;°Œ¹C(…˜n€;:XÖq@ÀÞàŽoÞ}òwdÒHâžÜ!ÏÚÃp¤•ë#°*GŸDû¯öˆÊ<*‹¨,£²‚ì$$E˜+^f§ Ø©ƒ�vú*‹ UmîÖþY"¯?n|ùq×<´&º¿Pø~‡1…§:ç°Ë;, -9 æíó8¬G^â08�$nþù°Ü=¸µÔÓ0!jó'œ¸5:T&�4ZpÚª:ÔÞ‡ýô¥ˆc. -ý¡!?X뇇§Â™¥Þà®^WûQô¸ìjŒs!¿ÁzÔÜh„�ÉY ƒe-,�á èñæ-Ð'/°@&�$îÐ÷©úí0Ɉ‚¢Ce2H£ÅóLo2� À5EvXh€  ƒµ¸X´Òõ2Ü�JXAqE�ÆT^d|·ÂGÖ(&'îË‹; -‰æíÄóˆ»G^"n8�$î@Ü÷‹Ã§sg alŒ•É"�6*p_vi�Zç ¢e¡Ö#4¤õû­û¥Í¦^·¥mU»:`aÔex¢‘&,ë�Æ ,à�œP�"ÒýÇÌ%òsF=#þth6ïa&ÉÈîA0ëüª¦Tó˜!®„*Ô|„†4`.µW®=š\vG¿X·«—NÐváîo[gøû»ÛìŠhÔÌP$ˆÔ±SE2¨¬¢p€`Òà€˜4ï€s�à†Qû £h°þÝþæÆŠ}HèL2¤-zŒ„ÞÁ\¯7Ë+ŠgŸw=³wÛ�CP÷²®.!tAmK0}‘õc ª³J°¼Ô£€�ÖaÞNì1o�Ú{ä%r‡ÓHâöOǶÂIñ0}­XóÔхš�Ð�æ Ðü¡Zî¶«ËÊÝJ˜2l."wj ÒZÐŒÜ;XVîq@@îÞ ÷o^î}ò¹gÒHâöåÎFå·B'÷ }­TîTs$¸4er�Ñ€Ü; ÷z½iß>^TñT1$ôe2TbD9Í ->Àò‚�B‚‡y;ÁǼ‚ï‘—N#‰Û<<Ø -'ÁÃôI´bÁs×~…/ë#0$w�Ôî>i…饤n÷ò†_æÕ<¥ cXNê–—z’:ÌÛI=æ-�z�¼DêpI\—Æoó+¢gþñ&IÃ.²•`4Ó•#O¢¡oA•c�¨$…*?�!•{”ÿ ÕЍög>+}9.¶õ¦~:÷%j½ +z÷i×› �ÂËùðÆ¾·Ï=‡îMœk7@0LÉEf¢12BæìÑÁ²öˆöÈð{ôxóöè“Ø#“F×¥±­wëä” -‘1"L¦þ•#Vé¤þëzäpѵöðÞ‰šçñy¤Á‰B)’|diÖè"@º°¼.FÛÙš0[Ìt[PE.»N=qvG"?ÔIzL!‰ Ó£ˆ¬òéqŒ°¡$›^ÀõÒë:·¯*‚¤¶»°¿:TŽXr÷ŽdÐ.nÀMyâÚ�ïxÕ>›Á0îxÏl÷•,Wõ€Ê{WÙ%E�ø«;Ù¶ø Í6î?Ã¥›ˆ Ì7ìÿ1áiç�²�µ)Æg_hcÛD¶_›¿û€g36ÙÑÎnÿi|€S"ãÞ}ùó›®ÚO,/ªmµ_Ôádb8«ù*^ºÃ�GA¨ÿ�ŸQöŒâöÊVÈŸEiNB†Ó“ÝyP‚pÿØãÍ»j;lNwú4¤µÏ¿èKm.endstream -endobj -1651 0 obj << -/Type /Page -/Contents 1652 0 R -/Resources 1650 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1674 0 R -/Annots [ 1657 0 R 1658 0 R 1659 0 R 1660 0 R 1661 0 R 1662 0 R 1663 0 R 1664 0 R 1665 0 R 1666 0 R 1667 0 R 1669 0 R 1671 0 R 1672 0 R 1673 0 R ] ->> endobj -1657 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 613.8755 190.8912 624.7795] -/Subtype /Link -/A << /S /GoTo /D (a00148_g87f0b54ade0d159fba495089128a4932) >> ->> endobj -1658 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 574.2326 195.8725 585.1365] -/Subtype /Link -/A << /S /GoTo /D (a00148_g53fbda0e8c31d4882294c8dc3cb5f487) >> ->> endobj -1659 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 534.5897 215.1402 545.4936] -/Subtype /Link -/A << /S /GoTo /D (a00148_g769512993b7b27271909d6daa4748b60) >> ->> endobj -1660 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 494.9467 213.028 505.8507] -/Subtype /Link -/A << /S /GoTo /D (a00148_g210e629f7252e4bc8458cbdf260b3318) >> ->> endobj -1661 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 455.3038 234.0589 466.2077] -/Subtype /Link -/A << /S /GoTo /D (a00148_g6b16e0bac41821c1fbe0c267071642f0) >> ->> endobj -1662 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 415.6609 216.9034 426.5648] -/Subtype /Link -/A << /S /GoTo /D (a00148_g969d7fff37a979737da045e0d538a9bd) >> ->> endobj -1663 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 376.0179 195.8725 386.9219] -/Subtype /Link -/A << /S /GoTo /D (a00148_g22fa0681cd463191d7a01fe85d86996f) >> ->> endobj -1664 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 336.375 195.8725 347.2789] -/Subtype /Link -/A << /S /GoTo /D (a00148_gffcd2fbe181e2aaefbf970551c302af5) >> ->> endobj -1665 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 296.7321 195.8725 307.636] -/Subtype /Link -/A << /S /GoTo /D (a00148_ge23534479ead15af8ff08ace26a47fb5) >> ->> endobj -1666 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 257.0891 195.8725 267.9931] -/Subtype /Link -/A << /S /GoTo /D (a00148_g165b603ec150e26efec7be199c9c2901) >> ->> endobj -1667 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 217.8198 180.7494 228.3501] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -1669 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 179.8606 169.3122 188.7072] -/Subtype /Link -/A << /S /GoTo /D (a00148_g118e9d76568ab81ad97f138d4ea1ddd2) >> ->> endobj -1671 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 119.8657 138.5977 130.3961] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1672 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 119.8657 162.6772 130.3961] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -1673 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [166.4928 119.8657 191.1801 130.3961] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1653 0 obj << -/D [1651 0 R /XYZ 90 757.9346 null] ->> endobj -1654 0 obj << -/D [1651 0 R /XYZ 90 739.9346 null] ->> endobj -106 0 obj << -/D [1651 0 R /XYZ 90 739.9346 null] ->> endobj -1655 0 obj << -/D [1651 0 R /XYZ 90 719.3112 null] ->> endobj -1656 0 obj << -/D [1651 0 R /XYZ 90 633.2198 null] ->> endobj -1668 0 obj << -/D [1651 0 R /XYZ 90 197.2909 null] ->> endobj -1670 0 obj << -/D [1651 0 R /XYZ 90 138.8364 null] ->> endobj -1650 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1686 0 obj << -/Length 1900 -/Filter /FlateDecode ->> -stream -xÚ­Y[¯ã4~ﯨ„„Ztb|w¼ˆî°°ìö ÐQ6MO#Ú¤¤é.çß3Ží47é²hu¶v<™Ë7ãñŒC–þ‘¥ÆK%ÒŒËez\àå<þaAÜrëQ—àëÍâóï©^j¤%•ËÍ®á ”ÐåfûûJÈuDc¬ðêòÓ+ -¼"ÛÁÏåörÈìøÛ2½³¢Nê¼,Ön^.¾Û´r�Z‚Ib¤þ½øýO¼Ü‚z/1‹å{˜`D´¦Ëã‚Sæ'‡Å›Åo-»Ð¼²N6�¤… Þ> -æ*kžD -ÑuD0²?0¦Å-ƒ@’T€.Œ]!âX}²íñúq³&ñê×_Þü�.à?â²C«Ù7 •ãÕ»5«¬ªô2z›»ñß—¤¨óúÙÎvUy´£}yvoŸk§@Ym³ÊëÒþYý~MÌÒ_aj!VȨi# -IÊy£ØfŸŸ×ruLÒª4C±ò�NU~Lªüðl_ÎÙÖ.ìÊÊÒ¾]yñdIáù¹‹#k�Y°ö˜gVC3rö˜åº´�zö˜…!ucO$©Z}odƒ>Þ¸&:Hc\H;É»5+0,y{ÈÎ$ð{°s€Ã½»Ï†{„j†”ÁXr�$vû׬TOŽäu'Ö[ò¨Coã½T#®ÆÈ} X›Pô‘ØÕƒQ€ƒÇ´¯Ç`§µDÓÒ刳X÷¤ï.EÚ쩉¼ž%[4T#“X-%xG*¦ƒjx¢¨K5Îi±F3àE„±¶žþîŸäxg¾J&˜"NŠæHÇ„ÃpÚK+¤! »@µt-™Qq»OO)JG -²qO+µTs¢G܌臑PÎ 7i1zÛrO?'~Ä·‰Ðìp(#·­ÛZ"©õ ŽhN…!¯ ÃjŒù½´ô3ÒÇ|�ø*;—‡wk 9kd;eQ-Ø´ñ-Õœü·°ù Î7%åÝæ{úYñC¾FüùXŸ†K†„TrÆpO5'yÄÍÞ¤¥¤ØŽ¤C¶áTÜ�€§ŸÓcÄ×èQg8X‘ψF\(1 BK5#|ÌÍ·ç~D©gB¡¦"P»(Ùž'ª×†Q¯I½ç-‚\ïÙ± ÷l‰{¼Ì¦¼ü±NþH§MºlW^ªk‘<é!Æ»‚YÏC0OÜóF¤™·"aÒ` ¿¦Ð¶ƒç“íß0æ:Zx´‡½gëz˜äE�U¤…g§…ÕÞŒ¬ö0rÚG Ð7¨È >èŒ$ß±•Šó)KóÝsÛk 0ömñ>¯÷n' '£ 6Œ@Ρófpà)ÆÙ̹ÕÒGÝBGÇ�¯1ÔÄ xªÈÒúf‡!5R**4<Á<Õœ -²ž„& §†÷…?ÉbGÔ‹4×¼¸Õ{0bî,éêw»éR[5åŽM…IsïÀ‘Š)¹òô`Ù û!)aGÛÙ>„àü•\Ø’Èí6CåAnÈ”D‚0SîÂîäª!þ¬Yq";ÏSË9Љ©ù }#1ÒT”1ŽûÔ¬@¢é‘ñy Æ£!ýRKùe_C}n?nÜUHÜÄGË1äÊ4˜§gú¿.Õíþ�ÂAÊ•U÷•9%’*9f°Û'šÀ�üq£á©ÇŠÈ�6¯%3ª4‰z(Ÿ‚W�§ío©ô{<«œôå~e“Ç©l2^?É$Ãå±_„ø» ֽϗݳÎwȶ¾×&.›žÇ9Ýö…К‡ñ¸ú¡C6åOæý€ÇͶ‡nR°§ 8B"®ï Þì;pUþö®Lë¬îW ÿ.hë9¸:dSpy2¹ פà+\CÁ7àê -ná:g�b¶ÿ#Z$†”Éâ¹àê’M Õ’y´èM´¦·h�‡Ñê nѪ÷yõ¿‚%AœÐs`uȦÀòd,v¬IÁW°†‚o€Õ܂řÏQ–? mjx1}Šu©nŸbr8SXÝy‹9%úƒo1Ço1[²{n1'±¹ÞbΈq›¾Åì ½ãsFüˆ¯Ÿ™¯ÖAÑ1É‹CYž"søEÐÿ‡®·Ì¥:›‰––jF¥1·¹ë-†bLԽдôszŒøNBS^ê0:ð*Âj.^Zª­ÆÜ:÷^Œz&�L°TÐãó»®½†ßF "\¿´`ЙH!?ê³ióÙ7†W4ï�Ü"¡;a±ýP/rI[UŒÁ?dEV%µ¯Þ¼Õ?ûÁKãË›êoþ^Pö‚:(ÆîödgêFßñŽ?%¿}ö_]ÿy~ÊF�Í—ÝJÿÄ1,éendstream -endobj -1685 0 obj << -/Type /Page -/Contents 1686 0 R -/Resources 1684 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1674 0 R -/Annots [ 1690 0 R 1691 0 R 1692 0 R 1693 0 R 1694 0 R 1695 0 R 1698 0 R 1699 0 R 1700 0 R 1701 0 R ] ->> endobj -1690 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [292.7281 646.4529 322.9445 657.3568] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -1691 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 608.5208 139.4144 631.4895] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1692 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 608.5208 197.6953 631.4895] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -1693 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [200.6841 608.5208 233.2915 631.4895] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1694 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [236.2803 608.5208 264.5639 631.4895] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1695 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [284.4293 608.5208 320.4537 631.4895] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -1698 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [313.4498 360.5812 370.7743 371.4851] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -1699 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 124.2624 139.4144 147.2311] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1700 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 124.2624 262.94 147.2311] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1701 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [282.8054 124.2624 416.0743 147.2311] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1687 0 obj << -/D [1685 0 R /XYZ 90 757.9346 null] ->> endobj -1688 0 obj << -/D [1685 0 R /XYZ 90 739.9346 null] ->> endobj -1617 0 obj << -/D [1685 0 R /XYZ 90 722.0597 null] ->> endobj -1689 0 obj << -/D [1685 0 R /XYZ 90 722.0597 null] ->> endobj -1675 0 obj << -/D [1685 0 R /XYZ 288.1051 554.1796 null] ->> endobj -1696 0 obj << -/D [1685 0 R /XYZ 90 532.2319 null] ->> endobj -774 0 obj << -/D [1685 0 R /XYZ 226.1581 456.1224 null] ->> endobj -1697 0 obj << -/D [1685 0 R /XYZ 90 434.1746 null] ->> endobj -1680 0 obj << -/D [1685 0 R /XYZ 226.1581 96.348 null] ->> endobj -1684 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1704 0 obj << -/Length 866 -/Filter /FlateDecode ->> -stream -xÚÝW[OÛ0~ϯˆ˜„R©ñ||�™ö2ÁH“ØÖ7@(¤�F+-kRÿ~vì¤!M/lÝĦJ�OüùÜÏ|¬à+ìK.‘¢LøÉ�‡ý[ýúØ·êý° ø0ðÞ~$ÊWH "üÁM©Aâˆ?žÉ^H8æ'gv‘L'=†ƒ‡à �å™Ë÷7óIRh)×¢¢J\ö.§ÞÑ ¶ïÜãT€±þÝ;¿ÄþP»yêaDUÄýZÀ”"þ�Ç­„±÷Õû\ë±å�®(9ÐmÂ$Z”u”ˆ Ö c¼¦“Iê"Ïûx8œÁæØ,ôLpZ+mhÕÙ% Q¦¬Ö³,ùfU#§Ëè�å…¦I‘VËûŒ]2«dciž#c̨‰a´VŸ»ãóâ�b¥¡£Çøî~œ´Ëq„!’¾` NU³KE©Àam #|]*‰¡, C2"°ÐiXTàJ‡!t‰¬ô®òV!¦XlTaʨkDH‘¶:SÏ}»ìÛCÐ'}Úg¦À]Ú]& ò½}´ºc¿VlÏ·:$tá…D7`ëÏɤU¼´<°IwÕ¹žšWæ/í·Ð=ƒx–Å×|¯tsÏ -?²ñ¸žÜ"Î&�ÇÇs'ZUf®KB$ƒÎ™«ËÛD-Ï]¤ÆTëÒÓIˆ›×_ùRƒ&HR�®u¦R0½,÷̛٭ÛúÒp°D(ïò°Y¡WÃŒ‹ÃQrŸ dÉA!ÑzõÉô’6cÚŽdÈ*Dï)*ʽCKTYQ³pìæ|œUô¥>úæÈxÁmh„\£ªçTF "üÈ7ñ#Ù–a?æ©nÒáNXk-=îÄÝŠ¦ú‹ÇÙvìØD¯fÇõï°#ù/Ø‘¬dGªKœ‹õìØD­fG -àhKv\gúÅì¸ìa';Ö°mØqmnì¸Áô’¶]°#`Ø=ŠMôH›‹Q6û ì¸ 3Û‘#軹76À«©±½f™‘¾œ£×ÇŒuÝö“�s�ut ì°ÿòE°¼ÐFúPÒ¤T¡Û‚FÕEÏ9aRvœNÒY\¤Uw» >U‹S“©¹€Tq@èÁp7^“�é¬u?ä€×Oöy8}|ºM'íô˜[jG~~A§Äendstream -endobj -1703 0 obj << -/Type /Page -/Contents 1704 0 R -/Resources 1702 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1674 0 R -/Annots [ 1707 0 R 1709 0 R ] ->> endobj -1707 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 542.121 139.4144 565.0897] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1709 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 300.0025 139.4144 322.9712] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1705 0 obj << -/D [1703 0 R /XYZ 90 757.9346 null] ->> endobj -1706 0 obj << -/D [1703 0 R /XYZ 90 739.9346 null] ->> endobj -1681 0 obj << -/D [1703 0 R /XYZ 226.1581 519.9805 null] ->> endobj -1708 0 obj << -/D [1703 0 R /XYZ 90 503.321 null] ->> endobj -1682 0 obj << -/D [1703 0 R /XYZ 231.1394 277.862 null] ->> endobj -1710 0 obj << -/D [1703 0 R /XYZ 90 261.2026 null] ->> endobj -1702 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1713 0 obj << -/Length 1160 -/Filter /FlateDecode ->> -stream -xÚµXÛŽÛ6}÷W °›å]Ô}i7 ²@€4õ[,´2½j[ª,gcý÷ER–­‹�4E°)žÎ )“Ã?D8Eˆ"Æe�lF8x‚ׯGÄ Ï`|Öü:ýô;�‚E’Ê`¾¬$A‚ÌÆBMfTá�÷oÞASà1AØ6Þf‹ýZÛö]–ì7z[Æešm'Ÿæ÷£WóÚ®sK0IŒÕ¿G>á`îÝ�0b‘Á3t0"QDƒÍˆSæ;ëÑŸ£?j;PMèZ§°2EX0c)ñN”B (A„Ú!ŒY„Œ!X>¯¢ñêK¼É×zw{¾B‚) -¥A“ôÜ4·Þa;fÞOnè}ÃA‚C&ºÎjãeMlçŸÕÇÌ-o¢ -W{o¶g¹Ó"Æ6è.;�™yõÙü§§gèÏ*Æq‘Æ�~S¹yc;Ïézm[IJ›n;§¯÷®ËQ_šy›„FlX›¨~}äJ!©\P/ëã�éoÖǶ‡�úXîÑÇÁØõñ‚éÛ�ÑGñÃôQ]ÒLJd“{‰$Ó£´Ðëôò·l“Ç…c-Ÿ'œîÔ)Ý­Tnþî» .Iƒs]†\]'uMt¿ÔÕ¨!©#Óf�^-k~‰è”È)È[Ÿ´¥K3­�JGD‘ç54UR«·_+B©ä’žÐæEº-+ê›ùJ,¼Ê±iT*d»x£oŽ®Íº¨þéË -åR’]P¦&ª_™(Ücñç·) ¸ßJ] èS—mðè¶'pêP f\©‚ÞÖ¸tN†#P£:Bpª?ñHðSÃsP˜_ìÊþ{CGhÀ3¨nÐçÏ> endobj -1715 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 717.9621 139.4144 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1717 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 473.5762 139.4144 496.5449] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -1714 0 obj << -/D [1712 0 R /XYZ 90 757.9346 null] ->> endobj -1683 0 obj << -/D [1712 0 R /XYZ 231.1394 695.4109 null] ->> endobj -1716 0 obj << -/D [1712 0 R /XYZ 90 678.4366 null] ->> endobj -1677 0 obj << -/D [1712 0 R /XYZ 231.1394 451.025 null] ->> endobj -1718 0 obj << -/D [1712 0 R /XYZ 90 434.0507 null] ->> endobj -1676 0 obj << -/D [1712 0 R /XYZ 351.1686 188.4371 null] ->> endobj -1719 0 obj << -/D [1712 0 R /XYZ 90 171.4629 null] ->> endobj -1711 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1722 0 obj << -/Length 1393 -/Filter /FlateDecode ->> -stream -xÚµXÛŽÛ6}÷W[ °›å]Ôö­M$@€45Ї$Xhmy-Ô–\IÎfôß;¼ÉºYö¦)‚`y9œ3‡Ç"†$ˆpŠEŒË`µŸàà†_Mˆ›^Àü¢ øe9ùé7Š$•Árc,H‚%4X®?L% -g *ðôøú�m¬òlÆñôóŒàiR”)tÍøæ˜­*è•Ð�XNE4û´|3y¹¬ù�{‚I¢Ùÿž|ø„ƒ5¸ùf‚‹”¡ƒ‰"ì'œ2ßÙMþ˜ü^Û±fÁÐ.9…*‚…nè�5P=´B`(„!¤§¸È–‡˜˜¸p*JÒ±9¦‡»ô¯×Å]5[HŒ§¶GæÍýY‡¸D¡‚Ý^ú üc{‰èœÈ9™S˜$õòqÉE—y•ž6¨³áMÖšçà·,%Gœñp0Šu\š¨~¨aÌÀV(S‘ÝÞ;�qï“ -Rä¶ËO0E!£tÐ�ž#5ºï‰  OQH˜8YÕ®¬“²êñS†BÉÆ÷ïAûgMVªPÈ9k³.·‰½š>ÍâêtMòÂ6*�ÔázšI1EgBEÉ"ŠDþzÔ¢  ‘‡igËbÕ£%R*h=ªOÛ‰GJª¨M[ǨÌ�Åʵ7E¾·­ÇmR¸Á*¿"RuR¨X]Jêj$©)EX2ëïË/ñþ°KΦ3¥æº$qhš9=R<¸©÷­“t'4à!#;|בÔ;©¼pñj•‹×ÝÃOtJØSt pŸë!›*óú³Î¢¸Hã{¿q>Þ¸‡%Ýíj)[Åi—®“�¶áEDÂë…ðÙ—‡qŠ(‹äøËÓD�y˜à |�š¸NN‘AF´BÏ“a­PÃ.É©Ñý×rª¿ÿA9Õbý³¡ü1ÁÙw®À¤e[(Ü;ÌaÃÓp^T1*àY–áQÕ„�ÊÃ.‰ªqÚZTõh‡EU‹vy&‹Gb€#h°K² ‹�‡igôÕï'K„†�ŒózTŸ·'F¨b²Í»|´81Øg‹øÁw�8¹F�«¤ÁjÐÅÕ—RŽôÙâà×|ϰ¿:ö}Ì�¤ôűڶb7¬œ]XD"u2 ¿Õ�a=Ø0¬‡Ó™jÛºs²­¿ØóÒköV`˜åEb±ÇR‹;CãLZ™£BÌÔÖ¡ïÓÊ;µ�+;æLyÊ”=±²»X“n ’!®+ÚUº¡‰>¯jÔóuÕ¢áÛŸüï¡9Ú.×ËÙ¹åéF/¾]©Ñ"þŽ˜{b†¾Âã’¶hEšU†êRñÉÂMÖè†É-Ý(á¾9¹º2õÏÐ7/‚œêP¡Ãpu‰ò?}3Ÿõ,!Œ6U…„übÊÕsNh'_%YRÄ•ÿÑä ß[ßx£…ÕÑuˆ«}ßRvK±íQŒ¥ûÅ®õ–ÿ¨Q%�ÔþEö"ÿòôº¾AØP|þŠ‘ð×endstream -endobj -1721 0 obj << -/Type /Page -/Contents 1722 0 R -/Resources 1720 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1674 0 R -/Annots [ 1724 0 R ] ->> endobj -1724 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 606.9556 135.0008 629.9244] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -1723 0 obj << -/D [1721 0 R /XYZ 90 757.9346 null] ->> endobj -1679 0 obj << -/D [1721 0 R /XYZ 357.2656 564.4285 null] ->> endobj -1725 0 obj << -/D [1721 0 R /XYZ 90 546.998 null] ->> endobj -1678 0 obj << -/D [1721 0 R /XYZ 226.1581 281.678 null] ->> endobj -1726 0 obj << -/D [1721 0 R /XYZ 90 264.2476 null] ->> endobj -1720 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1729 0 obj << -/Length 1266 -/Filter /FlateDecode ->> -stream -xÚ¥XÛnÛ8}÷WèQ".ï󸛦»ºÛmýÖ�"˱[ruIš¿ß¡DÊ–([ AJΜ9sáÈÄÃðG<…½P„H1.½d¿ÀÞ#¼þ¸ f;€ýàTà÷Õâ·[ª<…”¤Ò[mZ ’ A õVëo¾ÄË€F8Ä~ó×gX -섻ŧbÝìÒn}S$Í>Íë¸ÎŠ|ùcu·ø°êíX‚I¢­þ\|û�½5À»[`ÄT$¼xÀˆ(E½ý‚Sfv‹¯‹{=ÝF{`Ê;NÁ³ˆ0/`EDñI©H L¢ˆ "è4‘B³Ð Cà>oÙø¼$Ø�ËxŸÖiY]�ý$˜¢�Qê�ª¶ ½´‹–G$‡($Lµj(ñz]ƒÐN& [© -Ø©a ‘+Á‡†W[òïÓ²ª»›VZUè 5€ DÂéöBÁ‰Ô%BŒ”僞çã’Õ##«gØ8±Ú“Q¥I‘¯ßÉ…„$£ŒG3dœŠ]`£ÓÀöqõ䨥 -1 N]¶k¥\»#>8¢“C»=!yZk ­óPšF6€P|Zô&Õ”gmÇè3É´Ër£EqÒ-ŠÍ1élÏi²Úv ¯‘IÊ»:ý’nÒ2Í“ÔDäáµ?q—‡û¢©¿c�៴çÛÚ')¡“|£Õ�wÐ%LD!bKˆÆþm“'GÄNÛuPD9b\‘£"ä–-°Â„Rž€æÄ£�t�Ñ[壑ù2‘‘N¸=ÌÕ«A4DÞ×`‚H,Fƹa¥æ †¤€+d`x[yeÃ(°!‚„'äí,Xù90ŽÞ³,P,¡Ðz)×ð 2)nï� Ïñn"Q…žÂ)Ð2:1�Ðiɵ­Š„!fÕ�zûÏK"ü´45Ddð�™õÏ&Îë¬6E°)‹}·Ú¶}?¼Ö¦¨Šr�–ݲ.úR~Ñ_Q>MK áO–áj›A¼ ýM_5úɾ=”Ù>.³Ý«~”~SézmÅ‹²[$Cײü±{ÿ¼¤.â,~Ø¥ÖDë–^unéUT¯Œ[ÚŒvK¿¸5%ݺBü[m0Ym§§jfà}UíÕ;¹]W¦YUf£†ž:NTSL¤˜'ôå%">S+½|pzÀmê®^í㟫%‰üþþj›æƒn -<†3ª›^jc!¢p0ìã¤4fÀl¯�{ÕNvpK#Å¥¼<þ�J�ÿÜ® -´>üŠ÷H¸ë³7ú%Ó\§–3mÍÞçÙԽߋiˆ©ÎÃf°�³|W‡à%«·Ü{(qòˆJDE8ÃY/5ÉÕ¦!]9F!®”©‘Íó¹kÄçŒ�µjÛ0»ç¥„Jv}‡ïœH88ƾ[©9ó޶Î÷n°�Ñpl=bÝ­ôV¬üG¯Æñ’>$» —¦ç=‰/çnÐK͘wµióf -„ð%T ¡¸xóH¢ˆ^“Ñ Ä†ƒ iÃ}'{÷ؘlŸªfoàÕÉF‘çiROìd‡³‡šõá|ƒKìe´Û¯ˆ>d÷�épZZÃLÀÃɰaˆ ‘Bþ¯¯îöWƒŽ6øV–H…,ꂹ¤=MæÇ4O˸¶\ÚØ~²‹;Ý©ó@Lt ¾¦ìšš(ÆÒÌ,šªÂÌ%î/6P7ů×ÇÔùýA6ÅÒ^oçVendstream -endobj -1728 0 obj << -/Type /Page -/Contents 1729 0 R -/Resources 1727 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1674 0 R -/Annots [ 1733 0 R 1734 0 R 1735 0 R 1736 0 R 1737 0 R 1738 0 R ] ->> endobj -1733 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 582.7574 152.1568 593.3475] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1734 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7156 582.7574 207.5088 593.3475] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1735 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [294.093 528.4053 335.7466 539.3093] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -1736 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 492.7935 227.254 515.7623] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1737 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [230.2428 492.7935 262.8502 515.7623] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -1738 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [282.7156 492.7935 330.3564 515.7623] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -1730 0 obj << -/D [1728 0 R /XYZ 90 757.9346 null] ->> endobj -1731 0 obj << -/D [1728 0 R /XYZ 90 627.2963 null] ->> endobj -1618 0 obj << -/D [1728 0 R /XYZ 90 602.9681 null] ->> endobj -1732 0 obj << -/D [1728 0 R /XYZ 90 602.9681 null] ->> endobj -1727 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1741 0 obj << -/Length 1212 -/Filter /FlateDecode ->> -stream -xÚÅWÛŽÛ6}÷WèÑV,‡7‰ûXlt�mj´Ù`!ËZ[ˆ,¹’¼›ü}‡"u³d»M[†m^†3‡‡3Ã!x?àiê2 š åŇõv8ü~nÚÇy(ðýzñÝL{šhÅ”·~i4( ’óÖÛ�KE•Ï$]þ¶Òl•i´É’Ê�ªdk[iîF~üÙ6¶É -äò5�×/ÓÐå«ùIJ³^(¥— -VŸÖ�‹wë¢Û�ä - À??Qo‹;y\PÂu(½7ìPZ3ï°Œ·�lñëâ—N��hÌ!�Ï3‚àk©`ÈL0`(ý·©@¬e ZÊÆ2ž’1ÌÂÎ2gû!©£4k�=$U\¦Ç:-r§‡ÎÒ¨1ÛÑVM‡h9Ô‘ý{IVL.ßlg—›(³íW3>Þh½�j·¸L.í}Û(oÙ "ìé«EÙ3Kr� -.„îÆÔO}GAHBÁäEï -Ø32TÁCÑë1FŸ“ç¶€š’üªEAtˆŽFíœ)wnêàÓiªÔMt­ÜÝ Ôs=�Ç¢(ˆ«ðš·á J¨fp^+7†—Ÿ³$ŸT&²tpýÄ#!�Á@´C™‰,ЀF®¯('¡ ü¥¤^ˆ(•hPbdÑ@‡^'fP®÷ÎUê®ÞÛvñÒú¼›Ð>"ΆÖUŸ,Nõ®°{yè$×c\S,h<®‘:êÙèo…ü¡Ô4ï„x™QxËžï»/ÑáˆõÑýô–a$àxC_3Ý-âvfÄK(.çŽK*'׉ˆMMlaú‡(ͳ¢8úoi½÷£òHâsàŒ)Âdpƒ³Nꤩ6éΕµùvb]`ý òÜúEj:ù[8&z¯Rƒ6Ï4¾tn«ßIÝ@5ÕfPÙx÷YØ*a’H-lõô�K)ö -ý�`ÂIò¸}bl¾ö) -É0ß4¢’âîú¹cYÄIU�͘ÃíDªc–ÖÏÈ*fãVŽÌ½G±œÁ샚"o ¤úGOÕæ]âàlå - d¶/QÂpò>É“2ª[JZÎj�ƃN®ÌýÓ{Æïµ=F©rÏ0“‡O1+Mè˜ï‡âË×Ý´”1ïè~þ•àÞ¦endstream -endobj -1740 0 obj << -/Type /Page -/Contents 1741 0 R -/Resources 1739 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1754 0 R -/Annots [ 1745 0 R 1746 0 R 1750 0 R 1751 0 R 1752 0 R 1753 0 R ] ->> endobj -1745 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 615.6894 138.5977 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1746 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 615.6894 170.976 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00149_g12a33f0c09711167bdf3dd7d7cf8c5a1) >> ->> endobj -1750 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 531.3846 152.1568 542.2638] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1751 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.6549 531.3846 186.2086 542.2638] -/Subtype /Link -/A << /S /GoTo /D (a00150_g12a33f0c09711167bdf3dd7d7cf8c5a1) >> ->> endobj -1752 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 394.5058 227.254 417.4746] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -1753 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 394.5058 380.3883 417.4746] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -1742 0 obj << -/D [1740 0 R /XYZ 90 757.9346 null] ->> endobj -654 0 obj << -/D [1740 0 R /XYZ 90 739.9346 null] ->> endobj -110 0 obj << -/D [1740 0 R /XYZ 90 739.9346 null] ->> endobj -1743 0 obj << -/D [1740 0 R /XYZ 90 719.4886 null] ->> endobj -1744 0 obj << -/D [1740 0 R /XYZ 90 634.6393 null] ->> endobj -1747 0 obj << -/D [1740 0 R /XYZ 90 578.3693 null] ->> endobj -1748 0 obj << -/D [1740 0 R /XYZ 90 551.8843 null] ->> endobj -1749 0 obj << -/D [1740 0 R /XYZ 90 551.8843 null] ->> endobj -1739 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1758 0 obj << -/Length 2127 -/Filter /FlateDecode ->> -stream -xÚ­ZK�ã6¾ûWø(1ç¹u2Iv 3ÛØK’ƒ,³m¡eÉ‘äîíùõ)>-¿Dnø Š*«Š_«H“)†™fxšˆeŒÇÓb3ÁÓtÿ>!öó¾Ï‡??M~ü�fÓ e1�§OÏšCL� „NŸ–F1�ÍiŠí>?BSàˆ l_›å®’¦ý©)vY÷y_6õìï§/“_Ÿü¼V,Áb¢fýgòçßxºñ¾L0bY*¦oð‚É2:ÝL8eüwò‡çc>èç´„�W�p=ÔéGAÝ·²Ùœ`Œ£§µÕÄëùôËã�®Ýõyñ¢Ô2üÊ„ÐüÀ Š˘㇈åøIöyYÉ¥5�슶Ü:ó60»bBÆØˆed "*;óÌkõŒ£r³­äÞÎú[ólž½Ö^phoÛ¦oЦ2û‰´&†YÝËz©Êç¦5�n“W•i¦óEÙ; –f‰÷�›²h�{Ý·MUɶCJ5¥ IPL9ß+K¯d™½–KÙ™-2hÕ²�]—·ïžRKmÉ´hªñ$nkÙ›AE³Ùìê²Ð¶øúÒ,z+ûµ¡ÍÍãUM) cìtSŠf)û¦ß¶` ;4ujè…&Z�o_AiN£Vþ³+[½ -�é™›‡Yh˜åƒ†™Cµºò»m•v�^¾á¨¦]ÊÖ6ŸÍ37�g9c¿©½”°ˆU³xïegzÌÒ�q×å«Û¦;PØ€07ÀÝO/ë]½l¤µè‚W0Ž€µÐœ~7èΑ$àæ<¹«†Æ™‡NCpŒ8Kùž�šì/æñ\Ã(*ØøŒž*4/Ä“ ÇñѼSˆ†Ç33ˆd4;žY}jW–æÛPG’ᄯvµr‹Ö'"ˆ™Œñqå9C$!$åâÃ{ÆRÀ ê\ÄAP ^H�§)Œ�¹B#N²têÉ”�ÿ‘¹A@ÈÍ­±�}0Ï(Ž^Ðé*©Àc�6®‚Õ€PØ .ï–‚¥ˆf„…èÈÂ0Càø¼�óx0ó5—ᄯC`q"ÏP’1®<§(&LÜŠ@Ê£4 !Б)!Ÿ®˜yÕ1ö�Ëp±˜eWÊ; öùÉ>ræx’‚a‰Ù¦À\™#%ôÖ¨GSŽR–ŠÄ<ÙxÔ+º—·U§¾l÷lqPJ;vY>ÏH=KBÕa˜îÎûܳÚäýE„!J†Ò$‹?¢1†¥fq£Ž, ÒÃûQ:.�‡éPºÿÍ!°•ù¢’'F>ÉÑÇ7ôS,‹1LȨžsuPÛ;¹Ì\@y%HÌŽìÀ-×®¾ØŸ6Ú¸ªšE^™öë¡múuÞ�îùÎdö÷}ýã]$Œ`Æ*é‡ ’* _ÁŽ,ŒàÃû<.�GðP:¿¤P!Buh^¾É®©vûýîÑÝG#ÐÙ#ÕcN`·�ùíᘑ$„PG¶/n²L«c ÞÙœá#•€à±�q¹kEñðíÑ|*í Kè1Wе�TÀDbèõ‘X}ùlTÚ¶K�ô+šª¬_LWeð-íÔ‡ƒÜ©>8=TIZ¯óÕ½?rýZæ†Eßð=ÌŽ~¹¥ò'©@„°©ÈHB! %¡ŠÌ“�dÈðn' Hçè¤8:Ë·ÍnµÞîz_ÿv½+@ÖöÖñÐSR”rÆG•ÿPÇþñO”ýDí_]@­Ø.®Ê³‡)ãáb\9ô©ùÿûJžüFýEʼn6°Ò¿]Á4endstream -endobj -1757 0 obj << -/Type /Page -/Contents 1758 0 R -/Resources 1756 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1754 0 R -/Annots [ 1763 0 R 1764 0 R 1766 0 R 1767 0 R 1768 0 R 1769 0 R 1770 0 R 1771 0 R 1772 0 R 1773 0 R 1774 0 R ] ->> endobj -1763 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 574.0416 151.3297 584.9456] -/Subtype /Link -/A << /S /GoTo /D (a00136) >> ->> endobj -1764 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 535.1382 150.7717 546.0421] -/Subtype /Link -/A << /S /GoTo /D (a00135) >> ->> endobj -1766 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 452.2677 224.9331 463.1716] -/Subtype /Link -/A << /S /GoTo /D (a00144) >> ->> endobj -1767 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 415.4215 222.1728 424.2682] -/Subtype /Link -/A << /S /GoTo /D (a00145) >> ->> endobj -1768 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 376.5181 223.4387 385.3647] -/Subtype /Link -/A << /S /GoTo /D (a00146) >> ->> endobj -1769 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 335.5574 216.0761 346.4613] -/Subtype /Link -/A << /S /GoTo /D (a00147) >> ->> endobj -1770 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 298.7112 214.9707 307.5579] -/Subtype /Link -/A << /S /GoTo /D (a00148) >> ->> endobj -1771 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 259.8078 258.2974 268.6544] -/Subtype /Link -/A << /S /GoTo /D (a00149) >> ->> endobj -1772 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 220.9044 246.8006 229.751] -/Subtype /Link -/A << /S /GoTo /D (a00152) >> ->> endobj -1773 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 168.9847 249.8397 179.8887] -/Subtype /Link -/A << /S /GoTo /D (a00154) >> ->> endobj -1774 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 119.1224 254.5214 130.0263] -/Subtype /Link -/A << /S /GoTo /D (a00151) >> ->> endobj -1759 0 obj << -/D [1757 0 R /XYZ 90 757.9346 null] ->> endobj -1760 0 obj << -/D [1757 0 R /XYZ 90 739.9346 null] ->> endobj -114 0 obj << -/D [1757 0 R /XYZ 90 739.9346 null] ->> endobj -1761 0 obj << -/D [1757 0 R /XYZ 90 719.4775 null] ->> endobj -1762 0 obj << -/D [1757 0 R /XYZ 90 593.0161 null] ->> endobj -1765 0 obj << -/D [1757 0 R /XYZ 90 471.2422 null] ->> endobj -1756 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1780 0 obj << -/Length 2922 -/Filter /FlateDecode ->> -stream -xÚ­œoSÉÆßó)T•7èsófïΑÏɹ$wW” ²Mň$—OŸ´3ôhF݃+å*#У~zû×»;-íJLxø'&Ÿ8ãØ ´�\ý¾Ç'ŸÂŸ_ï‰ñéƒðü¼Zì}÷ƒ&¬´“ÅǧV0#…œ,®Ù·l˜HÃ÷ŸW›�³óñ/GçߥÇëåÕ?¦Ško÷­šþ¶x³w²ÈÆc^FYmÿ¹÷Ëo|rò{³Ç™¼™ü;ü™9ù}OK•~ù²7ßû)ÇÙ<ñô‚Öæ¡ÚÛ'Œ‘ieØ^·Ù¾ãåz¹Ù„ùúþñjýx?~õÐÚî˜r©,lœ¨¬à–iåõsœèÿ«”fÛKðð*iî˜U”¯ÐlàÖ–¾O[[9«!@R~Ë9>uÿiÔ\À’žÊ¡Šsx¼ùzyuw{[eá,³B[|ûíÀ´ áÂöyg45Šå˜°2¾J2ùÌy>ñ!O«Ÿò �ÁÝà'Yó¼X}½Ÿ*ºbu»^®oîn7s÷qósYï›qãVWñ¬f¼IÈú°³éзhöcòB2ïC;ïj@k=³Æk¢³Œl@i@Â75`áK4`éÜÑ€DUÜÔ€�×;šp°áÀ×À¡AÝðÒ&4Š9¯¨UßÒ‚ï�_Ђ:´•Ôâ-èw·`<¶ŽýŒµ`’Ñ-b-ˆû愾T Î=-ˆçPÅM-Nžë‡ú R¶\ã°Ž…VÑ/í?a·f 0Éb¢ùüÿ�Γ±7ú|÷åúæöÓæ—un­Ö7뛫‡$Z®ÇÎ…�>-ë7¸Þüåflð÷³óËùbƧ³ùbv45cЇÕs}·ù)v÷<×,<þ¿uÍ ˜÷¤å³ŒlyiyÂ7µ|áK´|éÜÑòDUÜÔò뫯áÿÏ×÷õaׄrU©TEUäñÈ8Ï}<Ê2ˆÁÁ}3èKÁ)œ{àà9Tqœ›«ßwБ\1áµ%ª F½ëØÀ‘^°dMÄèྙô¥èÎ=tðª¸`Á²k×ñ,²TF½ë˜°¦Ç™,£á€€Ü7Ã�¾œÂ¹žC7ÁY­?_.¯[ld8ßX¢>lšÖê…gs£Â"€i²ìëIí>ÜŒ'Õ“xj¾M§Ø§�| -ð°ó$¦3æÈÙ&oP·çvŠÖ$~3¸¯~ sۜԵ㌋Aïlm(@Z;ËÈÖFŸ[›ðM­]øþézÜÒÊ\‡‚I'¶ÌwwwÒSiTqcqv8Õ|ÿèÇãøãp*„Ø_LnŸ& xY²ŠÈG -Ë„°¾ÌG´¸›ÐKÊî~‡ -0îIFsÇwÜ7s‡¾Ü óîxUÜÄýôäçæ†Y‹×f>ªˆ\¤ðá¨0”©Èr­Y(±Û�0äIF#ÇrÜ7#‡¾È óäxUÜ„üâä¯ïf‹zýgâÊâEÈ*Â]†¥ˆV°¤Ñ]·(+Á”ã»×*P€QN2š2æ(ã¾™2ôí \˜÷PÆÓ¨â&Êçgoß¶–*aí`‰$åæ9a`A£·o1»¼öâçç1£ŠŒØ¾¨iÆ L;èBç¸hÛQÚ£·gó“šíÀ,¾õI„;K.˜ç\ζȆã�åFìF Û$£ábŽ€.î›ñBß¾…y`<�*n^޽:»˜Z¾ß8Ló°…ÊàuÈ*"�8ôk¡e™€j��U8*8)ÕNÒP€�Î2’4êøLšðM¤ _štiÞAšH£Š›wæ³ÓÓ“£ÅÉqEZzƽ°x²ŠH@*†S)Ël댬ÜÀ¼BF,(ÀH'Ms¤qßLúv�.Ì{HãiTqéÅìÝÉñÙûz—sNz¼ YEøK)™´j«üB¶ÎËaõ†pd¨‚Œt’Ѥ1G@÷ͤ¡o鼇4žF7‘&'ª¸Ä†p|Æë‘TT"ñ�uŽâE"­)Z͸CF*(À€' sÀqß úv/Ì{€ãiTqá®}ÑzÓÖa‰$a×d2^$S˜7ÏÔZ01ðÝoÍC9ÉhȘ#€ŒûfÈзraÞO£Š 'ª0<ÿ4|ÿýɼ>Žk¹¹b-GVyÈ08{ë·ÊѺüJ…%€BhðÓ&|í—¦]šwÐ&Ò¨â&Úoç‹tµ`½g{&�7x)²ŠÈ!®À�¶rh}Ž%|˜ÑdÒ‚Œu’Ѭ1GÀ÷ͬ¡o뼇5žF7ïÙóËw‡ó[×€ -í,^…¬"쟮T^•ö¢u¢N1'�I -0ÎIFsÆgÜ7s†¾œ óÎxUÜž¾œÏþ~RÏ×.¦�$ê¢8ÂÈÞØ ´‰—ÿâÆ†,+nSü0 K�Ç�±g?®îÇoþ;>»ü×òæËò×ñ×�w£âñ!i¯óÜÜ>ߨ¸½ù+ %&0U„LÖÛVÇM7˜¤ÍÚJD Ç,×~+‘­Êfa¯ÄÀ¼� û­ŠÆÎØyë‡P¡Ã·úß|O±�2´�¢Æç,£wbÛ‰qß¼Cߎ�¸0ïÙ‰ñ4ª¸ù£è‹¸ ŸÅÿ6‡îËÙÑ»óÖdñ“f´&IDä"•`Ү̥õ¶w,²DÜ@€1O2š9æ˜ã¾™9ôí`^˜÷0ÇÓ¨âîf¿Œ¢B.™$^’$"R‰µðr«"­sõ`™Ò»wòç§Ü£ˆ„�x=£FhàHc†¶�Ѷbî¿ê¡`mÂ$b–¯W·«ûå:}�@ºÁñ]zðf*Ìþãø‹�ãOþ½TßK¾ùMrnÇõÁTšý¼FH_j Ø(üðÇæçñÝþø´ª¾J$~-Q£>ÿÚUßendstream -endobj -1779 0 obj << -/Type /Page -/Contents 1780 0 R -/Resources 1778 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1754 0 R -/Annots [ 1783 0 R 1784 0 R 1785 0 R 1786 0 R 1787 0 R 1788 0 R 1789 0 R 1792 0 R 1794 0 R 1796 0 R 1798 0 R 1800 0 R 1802 0 R 1804 0 R 1806 0 R 1808 0 R 1810 0 R 1812 0 R 1814 0 R 1816 0 R 1818 0 R 1820 0 R 1822 0 R 1824 0 R 1826 0 R 1828 0 R 1830 0 R 1832 0 R 1834 0 R 1836 0 R 1838 0 R 1839 0 R 1840 0 R 1842 0 R 1844 0 R 1846 0 R ] ->> endobj -1783 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 704.2225 177.6109 715.1264] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1784 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 665.5053 197.5362 676.4093] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1785 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 626.7882 175.9567 637.6921] -/Subtype /Link -/A << /S /GoTo /D (a00093) >> ->> endobj -1786 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 588.071 196.4301 598.975] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -1787 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 575.1882 204.1809 586.0921] -/Subtype /Link -/A << /S /GoTo /D (a00091) >> ->> endobj -1788 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 562.3053 199.1998 573.2093] -/Subtype /Link -/A << /S /GoTo /D (a00096) >> ->> endobj -1789 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 549.4225 193.1026 560.3264] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -1792 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 467.8426 214.6224 477.7703] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6bfa488f87f68a6f7f4a3efb9e45eaf8) >> ->> endobj -1794 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 454.9597 216.6746 464.8874] -/Subtype /Link -/A << /S /GoTo /D (a00150_g39ce739bd352d7e348e37395ce903e43) >> ->> endobj -1796 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 442.0769 206.9409 452.0045] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf848ce44c810492e7a35c2d23a429f45) >> ->> endobj -1798 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 429.194 193.6609 439.1217] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf0ed78fd2be24d849cdd5af75e3b2674) >> ->> endobj -1800 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 416.3111 200.3059 426.2388] -/Subtype /Link -/A << /S /GoTo /D (a00150_g57e6dc1d58a36d0ed53a3dd29ccc5798) >> ->> endobj -1802 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 403.4283 201.9198 413.356] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga4c4310e54f18541b09e1e251fe7b22d) >> ->> endobj -1804 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 390.5454 229.0778 400.4731] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf84316f469ce0726985c0702db49a989) >> ->> endobj -1806 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 377.6626 220.769 387.5903] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2d3ba4b14d6d2f6576f9b547800b7945) >> ->> endobj -1808 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 364.7797 193.9898 374.7074] -/Subtype /Link -/A << /S /GoTo /D (a00150_gabc40c09f49d15acb1b1a7f02bb3a807) >> ->> endobj -1810 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 351.8969 199.7479 361.8246] -/Subtype /Link -/A << /S /GoTo /D (a00150_g041aea91aa6ef84dcc6cac3c51db9b2f) >> ->> endobj -1812 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 338.4114 243.3742 348.9417] -/Subtype /Link -/A << /S /GoTo /D (a00150_gd605357e29affb0d3104294c90f09905) >> ->> endobj -1814 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 326.1312 252.8785 336.0588] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5c97ae587595b5444be80f5ecc1d3382) >> ->> endobj -1816 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 313.2483 224.6544 323.176] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf0ccbc3bb2a3ba1ebc255c7b3fcedd24) >> ->> endobj -1818 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 300.3655 207.4989 310.2931] -/Subtype /Link -/A << /S /GoTo /D (a00150_g28eda870cff3d8e3cf2949e6f57a502b) >> ->> endobj -1820 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 287.4826 221.3369 297.4103] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga5e3c856b86725125d19fccc34cd9eb5) >> ->> endobj -1822 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 274.5998 218.5673 284.5274] -/Subtype /Link -/A << /S /GoTo /D (a00150_g8af482dec973db57d8b3bd3f69461488) >> ->> endobj -1824 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 261.7169 234.7964 271.6446] -/Subtype /Link -/A << /S /GoTo /D (a00150_gae59b70658f28ee6e998eaaab05e423f) >> ->> endobj -1826 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 248.834 224.5549 258.7617] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga533c394b1fa0030205534befa31c525) >> ->> endobj -1828 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 235.9512 224.5549 245.8789] -/Subtype /Link -/A << /S /GoTo /D (a00150_g160128ab5d2ea3cc497b91ee4eb4ef99) >> ->> endobj -1830 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 223.0683 211.9222 232.996] -/Subtype /Link -/A << /S /GoTo /D (a00150_g64d9affc680a445d708234e70450477b) >> ->> endobj -1832 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 210.1855 222.8911 220.1132] -/Subtype /Link -/A << /S /GoTo /D (a00150_gfff0ed43201bf1e2020de1a0d6cac070) >> ->> endobj -1834 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 197.3026 219.2748 207.2303] -/Subtype /Link -/A << /S /GoTo /D (a00150_gd135fb0cfdfb2c212f0f51865a3640e4) >> ->> endobj -1836 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 184.4198 214.1439 194.3474] -/Subtype /Link -/A << /S /GoTo /D (a00150_g13dfcb4a5f920e108253ade527a66cc2) >> ->> endobj -1838 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 171.5369 211.7529 181.4646] -/Subtype /Link -/A << /S /GoTo /D (a00150_gde29ec025e6754afd8cc24c954a8dec8) >> ->> endobj -1839 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 158.6541 238.2734 168.5817] -/Subtype /Link -/A << /S /GoTo /D (a00150_ge0825474feee11b4e038bfe71757875f) >> ->> endobj -1840 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [289.3868 143.1256 318.6011 153.0309] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -1842 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 119.9369 229.7753 129.8646] -/Subtype /Link -/A << /S /GoTo /D (a00150_g359951eecd80541c2101f628a9da9146) >> ->> endobj -1844 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 107.0541 223.6882 116.9817] -/Subtype /Link -/A << /S /GoTo /D (a00150_g517c770991459cc62dc009c0d3875c6a) >> ->> endobj -1846 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 94.1712 225.3421 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf72d7b9a737707dcfb2c41fec2b6792e) >> ->> endobj -1781 0 obj << -/D [1779 0 R /XYZ 90 757.9346 null] ->> endobj -1782 0 obj << -/D [1779 0 R /XYZ 90 723.1038 null] ->> endobj -1790 0 obj << -/D [1779 0 R /XYZ 90 485.7477 null] ->> endobj -1791 0 obj << -/D [1779 0 R /XYZ 90 485.7477 null] ->> endobj -1793 0 obj << -/D [1779 0 R /XYZ 90 471.8276 null] ->> endobj -1795 0 obj << -/D [1779 0 R /XYZ 90 458.9448 null] ->> endobj -1797 0 obj << -/D [1779 0 R /XYZ 90 446.0619 null] ->> endobj -1799 0 obj << -/D [1779 0 R /XYZ 90 433.1791 null] ->> endobj -1801 0 obj << -/D [1779 0 R /XYZ 90 420.2962 null] ->> endobj -1803 0 obj << -/D [1779 0 R /XYZ 90 407.4134 null] ->> endobj -1805 0 obj << -/D [1779 0 R /XYZ 90 394.5305 null] ->> endobj -1807 0 obj << -/D [1779 0 R /XYZ 90 381.6476 null] ->> endobj -1809 0 obj << -/D [1779 0 R /XYZ 90 368.7648 null] ->> endobj -1811 0 obj << -/D [1779 0 R /XYZ 90 355.8819 null] ->> endobj -1813 0 obj << -/D [1779 0 R /XYZ 90 342.3964 null] ->> endobj -1815 0 obj << -/D [1779 0 R /XYZ 90 330.1162 null] ->> endobj -1817 0 obj << -/D [1779 0 R /XYZ 90 317.2334 null] ->> endobj -1819 0 obj << -/D [1779 0 R /XYZ 90 304.3505 null] ->> endobj -1821 0 obj << -/D [1779 0 R /XYZ 90 291.4677 null] ->> endobj -1823 0 obj << -/D [1779 0 R /XYZ 90 278.5848 null] ->> endobj -1825 0 obj << -/D [1779 0 R /XYZ 90 265.702 null] ->> endobj -1827 0 obj << -/D [1779 0 R /XYZ 90 252.8191 null] ->> endobj -1829 0 obj << -/D [1779 0 R /XYZ 90 239.9362 null] ->> endobj -1831 0 obj << -/D [1779 0 R /XYZ 90 227.0534 null] ->> endobj -1833 0 obj << -/D [1779 0 R /XYZ 90 214.1705 null] ->> endobj -1835 0 obj << -/D [1779 0 R /XYZ 90 201.2877 null] ->> endobj -1837 0 obj << -/D [1779 0 R /XYZ 90 188.4048 null] ->> endobj -1841 0 obj << -/D [1779 0 R /XYZ 90 137.9854 null] ->> endobj -1843 0 obj << -/D [1779 0 R /XYZ 90 123.922 null] ->> endobj -1845 0 obj << -/D [1779 0 R /XYZ 90 111.0391 null] ->> endobj -1778 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1850 0 obj << -/Length 3655 -/Filter /FlateDecode ->> -stream -xÚ­\ko\·ý®_±@�b…Ö ß� _Y¶•È–*ÉÇ\ieµeW�Ôù÷%w—Üáåå E,©{vιs†sI.÷Š�ÿ‹ÀÎ8”¶‹«O{|ñ>þßÏ÷Äöå'ñõ'ðÃÅÞ7ÏdX¬´‹‹›u+˜‘B..®ß,­Þ"=w|ùxt5|)ßüòòóõãÇÕæ÷§Ÿ¯?­nÞ=üúùvÿíÅ�{‡…w+Ë(+ëöÞ¼å‹ë(ïÇ=ÎTðfñßøg"¹ø´§¥Ê|Ü;ßûG‰³yaý†¹«K/?‘ns-ÝË—ñb�Ü]½W/¸eZy½È¨”‚_¤4Ó+<¾.�Z€p ]¤B³À­­Hÿr½ú…sy»j˜µeN:Q3§WîÞo!gPC†¦Q“†×G§—§gûš/OÒ?ûÂ/O.�^žÚ©*©s–ãù( \‹T–ISK1~®¦„�€`ú^fv†ÑncŒÀnœ·ø y ¯ÈGÇe4q³çG§/.�_5sÏ„±ÏBAôRpfõ”^ò9Ÿ¹bÁ»¾Í»×1—·(Úd„xŒ’‹é€Ã�yÄ`TÃ4j¶÷õÓŽ¿"0)u@P@8¹”‚¹Xùܶ�³�Û îi/ʸó—àÍW¼´Ã5ù€Å„Œ&n6ùâ gr¼;!ð4Á/%gÜ -WóÏbë<‹¹‘}£3:Ãh£1F`4Î[Œ†¼FWä#Fã2š¸»fÝÏ2B½°x" -ŠP �%_­ à†W=e=üÛæ¸—Dœ˜+ -kb¬Ðoí€E†ÑE�1‚¢ÀyKQ@Þ�¢¨ÈGŠ—ÑÄÝEwü˘2é<žˆ‚"¤â ¢1`[EÃ, -#é€E†ÑE�1‚¢ÀyKQ@Þ�¢¨ÈGŠ—ÑÄ·„øï ´(°D€¢@ìŠbª _–Év—Ú÷mÌö £mÇ�í8o±òØ^‘�ØŽËhâ&1Ý—ÏŽšl o#&h"EQ{ÏŒäjþ•ÏîXD\Å÷w]Ìå £]Æ�Ë8oqò¸\‘�¸ŒËhâf—Ïžq9¾‘Ç©:ž�Œ¢¨ƒd*˜I¢ËrÎe¡"&„¾Ë€¹œa´Ë#pç-.CÞ—+ò—qMÜìòÙùEë²O»%‚È@FQÔqïtšÐCê貞s™ÇÙ¿vºï2`.gí2Æ\Æy‹Ë�wÀåŠ|Äe\F7»|zþ¢ï2š��Ë8uqRG—çVèÆ;ÆM“ ¼ŽxœQ¤ÅÝÎaœ4 Ii+æ{q Ó¨ÙÜïÓVêÁO�Šh‰’¸þ "¸ƒb‚«Ššs«rãt\ÀKÄ]ÀìÍ0Ú_ŒŒó‡!ï€ÅùˆÇ¸Œ&nvùõÙóÖagÃÜÈ(Š:zl¸˜dž�Ý{16u\ô]Ìå £]Æ�Ë8oqò¸\‘�¸ŒËhâf—.Žçµ AÈ(Š:VƒôqY]Qó¯êfÎeí#Æõ·R!s9Ãh—1Fà2Î[\†¼.Wä#.ã2š¸Ùå“Ó‹ËÃWOÛ�To¶ÊâY((‚^ŠH¯µ¬ég³2Œ{Óß�Ìæ £mÆ�Í8o±òØ\‘�ØŒËhâB›_�œœ¶›#œùà-ž†‚"ø¥TLù kþ¹•²‘’ñ û{£€ùœa´Ï#ðç->CÞŸ+òŸqM\èóËóóv8«ô‰•ƳPP}Î’Û ýÜRÙļ -Îû"€Ùœa´Í#°ç-6CÞ›+ò›qM܉ͳ{à*¶X«ñDd!@jΌѮ0·ZÖÁF€ëïoBbt�‘F£Œ;£ ÞltÅK]“MÈhâ&é,ÊåáÁ‹“˳ÃÓãý˜ÿåÏsn;) žŽ‚"tHgdBNtÌݧµ�«°Ô*º~æw†Ñ~cŒÀoœ·ø yü®ÈGüÆe4q+¿Û³)å ž‚ "¨%7Ì:3ÉÀÜÖˆvœ )ûÛœ€Yœa´Å#°ç-CÞ‹+ò‹qMÜl±%Ç´Ž·a.=ž�‚"„È($®§M-DÈ0g¹qL(Þß0�Ìò £-Ç�å8o±òX^‘�XŽËhâÖ–Ï9³–HBAìë#gƆš]ÈÙ¡­u„ 7ëÝë˜Ë[m2B:8ºØjùý¾byqtÒLÑ×Ì*�æ%cpIŠG¯ã¯$ eæUfžž‚"t©¸3ƺZ—Pv®D:¼ªú¥€U@†Ñ€1‚ -ÀyK@Þ� -¨ÈG*—ÑÄÝUÀ³ãõÏ/ÏçN$ -/ žŠ‚"4¤ó©Ö)9±€›Íi„ož QÆœ&R$Ôwßm õE9¼[ˆíœYÒqÎ(,ïoÖ@V8FÆ -ç-…y -§")\FwW8qïñ®ñúìàðòøèÕO±‰<=;lwp”NgP�ÆSSP„&'�ÚûZÒœõ*ÈðýýX@¬/0Òz”qg=Á›­¯xiëkòë MÜÆúÍTáìùái?·Bàé)(B—Òé®!\­knO¹À„3ý©"`þgí?ÆüÇy‹ÿ�wÀÿŠ|Ä\F7Éø!.û–¯Ÿ5"¬eœkGd £(jë™0ŸùV‘þ»¸{¼zh?Ä Ìg‡Ó�ñ”–&nÒòøë—ˇ«/ñß×wÍ}Ó˜¸šqOFAµ„†÷Mo—:–ù$\ÍÜcåx¡¶·ÄtGük#ÎÅÉvpa4OOä©�›óô¯}É—�7s ‰$1h -Š o£%ú7élëññú`ëÛÎAÅ¢^õ·ù!ëFw Œt œ·t È;Ð%*ò‘.�Ëhâ&Ïzm fb¶ˆdÅ�X(m&©GÛDÚB”!®9óPð„–6.Ý&l\õ´R¦m"£Zu›°ŠYï¦u8Ú&’Ò»Õ»ûûíh}ûãŨ(ˆ÷·V!/F�ŒŒœ·ŒÈ;0^*ò‘ñ‚ËhâæYUoÈΔ¥’°QäqÆä�r“ÜãFê´ÕFQð„–6n0¿^}ê�ÖáÉ(¨VA=bbÒ¤qÓJü³7V [ññŠ)x"Qm\êÆªâ‚œ ƒg© (ú&Úð�U§GøþÇl€5Š £ÆÎ[ähùH£Àe4q×ßÕyÚíÞÄË žHBFQì>ÎÀã=m’|¼S¤ /Ýh& -žÐÒÆÍàñº×(œgÊHƒ'£ Zu£ðœy­Ä4ýF¡Ñx°Ìé‡ó”ñTžš¸T£�.M$ž¥‚"èÛhÃ�"¾Sòþæ>xk[Ý%:Ð$PÒÒ#é@‹€Ì#Õ0�š¿Ëw?Á™=Íž¾#„f!ƒÓX¹GÜ÷ŒNG.…êD ˜ÕF{�1³qÞâ6ä°»"ñ—ÑÄÍŽŸ<ŸýZŠT2Š¢n¢e«?e«×O+‚“NNÞD?Kèø–ü‘‹}§—¿Y]¯nîg -$NÇb!…~+€¤@ -Œ,”qW o.�Š÷as�myDŒ3f¤:6pJÂ4êº÷ {Ùn”Ùô®8À.]2/(þJˆsh¹&Õe\-/Mö¿èw××w—sÏHPÕ[zÏHPÒ3¼5ÿù¶­‹8Ûµr!µLS©HgÊc~ÑknÃ>r[½¾xw)á–ÈÏV_îö•[®îïËùÖ_Ãÿ|³ùùnûw~¸WJÓö ¬+[ &­q¸ì­j!ÓŽY¿KGpúÀŽkF�5k8ok�—kóÀXÃ%L£Œ5äÒÿøXÃÕ•±VÉ[�5K�5Ì!0ÖPe¬Aþ7þí\¿O»fž÷?¡�¬3Œ®AŒÔ Î[jòR5X1Ô .a•n¨éŒ¥ÓMÁºY‹ëƒ˜ÖXJeÁÍÈì¨4–¯%nTAÍðW³�XCi7™s±Ý˜~¼½J­vnò!tªWÛ/F@бÀÈbDwÅHðæb¬xKK¾Ï¿^7Üq6„0î~9f<¥¢‰›�þr÷ù*Þ³Ú ªd†KK$!£(zŸ>þQj’ü8A�›«ô5ÎÑd<©`w�?7ÓÓ;bñ¢W^Po:biDÖ“+çêÝûÎ2,Îßã˜Ñý�9À -=ÃèBGËÎ*áC.sJ]PÝüÝY9fÓ7u1yƒQ¤Ó A -R^ÆÕòâ8¹úðïûÇO�o­âžeÅ�¿³Z77H‚Ž™qrB‹|˜¾Å“ -¦q»æ¤ceŠKüÂ3¨¥­7ðDˆù‘Í…Ó;ýÛ�³¿·ÇÜ%óé—Á<‘ 6n?AÖ0£„ 2”Q±õ±ÝˆIŠ>®nçzH^nÉ™ A�­’ Y%XpðîãÕãÇwÛg?|Øþrtû°º»]=lþºÚfùau•ÌZ¢ÍB*m”ÿ¶ºÛ.Ÿ6?òV¨ðË›øRÚ#뮦RûRº>ÚN¬¦ú=5ØËSÇS7(º¡nqÿ�vº …4S  o¥}a¸‘¢Â2 - -[O+;m4⌎-²¯ïIÁàÌ!Öi* -hUl¡yÂÕ¹çºtÂyþ›è¾EÀeYX¤'ø¦£õ7ë³ÛBÇRÍR’òç«ÛÕ]^×Û!s›Ÿ¾ýåÇ4²·¹ýÉ¿•ê[¹}Ö¸äÜn~»Ù—fùy;ÞÚ‡’ÿë÷ü@ò¯¿¿_5�"7BÍeé¶~gŠendstream -endobj -1849 0 obj << -/Type /Page -/Contents 1850 0 R -/Resources 1848 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1754 0 R -/Annots [ 1853 0 R 1855 0 R 1857 0 R 1859 0 R 1861 0 R 1863 0 R 1865 0 R 1867 0 R 1869 0 R 1871 0 R 1873 0 R 1875 0 R 1877 0 R 1879 0 R 1881 0 R 1883 0 R 1885 0 R 1887 0 R 1889 0 R 1891 0 R 1893 0 R 1895 0 R 1897 0 R 1899 0 R 1901 0 R 1903 0 R 1905 0 R 1907 0 R 1908 0 R 1909 0 R 1911 0 R 1912 0 R 1914 0 R 1915 0 R 1916 0 R 1918 0 R 1919 0 R 1920 0 R 1922 0 R 1924 0 R 1927 0 R 1928 0 R 1930 0 R 1931 0 R 1932 0 R 1933 0 R 1936 0 R 1937 0 R 1938 0 R 1939 0 R 1940 0 R 1941 0 R 1942 0 R 1943 0 R ] ->> endobj -1853 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 727.7951 234.7566 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00150_gad0321f4c570f9983c6de81ece3ddc20) >> ->> endobj -1855 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 714.8027 209.1527 724.7304] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6bc12c6c7b56f73ce5d57abfdcdc6eb5) >> ->> endobj -1857 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 701.8102 220.2212 711.7379] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb948296aea6b6b3aa1f156799c4d479c) >> ->> endobj -1859 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 688.8178 218.5673 698.7454] -/Subtype /Link -/A << /S /GoTo /D (a00150_g17d111686f98e4c09db73a770ac3f1a4) >> ->> endobj -1861 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 675.2227 229.0778 685.753] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6f2b90c597ec23f39ec716ccec11233c) >> ->> endobj -1863 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 662.2302 227.424 672.7605] -/Subtype /Link -/A << /S /GoTo /D (a00150_g15f2617f7dc1713f9d10282125c6027b) >> ->> endobj -1865 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 649.8404 227.424 659.7681] -/Subtype /Link -/A << /S /GoTo /D (a00150_gee37386b2ab828787c05227eb109def7) >> ->> endobj -1867 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 636.848 187.0257 646.7756] -/Subtype /Link -/A << /S /GoTo /D (a00150_g88e60aa2cf23e1c65d630701db08c743) >> ->> endobj -1869 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 623.8555 190.9012 633.7832] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6020613f5062417d9811cfa837215c83) >> ->> endobj -1871 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 610.8631 189.2474 620.7907] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5ca559def464ef20d8b1f7d32f2f160d) >> ->> endobj -1873 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 597.8706 189.2474 607.7983] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1320fd0006a2f70138bc2d0018dda829) >> ->> endobj -1875 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 584.8781 191.6086 594.8058] -/Subtype /Link -/A << /S /GoTo /D (a00150_g44b3b1ab31a403ba28ec135adfcbefef) >> ->> endobj -1877 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 571.8857 192.007 581.8134] -/Subtype /Link -/A << /S /GoTo /D (a00150_gc84f499cba8a02fc0e306c10b2acabf0) >> ->> endobj -1879 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 558.8933 189.7953 568.8209] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1425d4a0c2760adb653a04c0fb137a8d) >> ->> endobj -1881 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 545.9008 215.2498 555.8285] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1215163245304bad20d6c5608ad75ab7) >> ->> endobj -1883 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 532.9083 221.8948 542.836] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9f1822e1d231235edacad691f3cb7bbb) >> ->> endobj -1885 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 519.9159 214.7117 529.8436] -/Subtype /Link -/A << /S /GoTo /D (a00150_g691688604655ea8943d15f14c60027d8) >> ->> endobj -1887 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 506.9234 239.0603 516.8511] -/Subtype /Link -/A << /S /GoTo /D (a00150_g12f3bf821224b8e7b48a57ed3cea15cf) >> ->> endobj -1889 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 493.931 239.7177 503.8587] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5c5b1834e497f53ad0ef947bbe9777fa) >> ->> endobj -1891 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 480.9385 204.1812 490.8662] -/Subtype /Link -/A << /S /GoTo /D (a00150_gd58231410d58e34b455328b888a9e73c) >> ->> endobj -1893 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 467.9461 244.6991 477.8738] -/Subtype /Link -/A << /S /GoTo /D (a00150_g207d17b633cd095120a74bc1f2257b17) >> ->> endobj -1895 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 454.9536 209.1625 464.8813] -/Subtype /Link -/A << /S /GoTo /D (a00150_g4cc3e223b63f27b546d62e9a258dba5a) >> ->> endobj -1897 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 441.9612 305.6302 451.8889] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1cea57e3ea526f210b1068e6dcf7b4f4) >> ->> endobj -1899 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 428.9687 321.0623 438.8964] -/Subtype /Link -/A << /S /GoTo /D (a00150_g62c03e0a308cc23929a80fe8d8f9dc1e) >> ->> endobj -1901 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 415.3736 218.1788 425.904] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1d3211dbbdfb22d6a47b60dddcf945e8) >> ->> endobj -1903 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 402.9838 341.9936 412.9115] -/Subtype /Link -/A << /S /GoTo /D (a00150_g42288d5c3cf4b10becefec657f441e54) >> ->> endobj -1905 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 389.9914 341.0573 399.9191] -/Subtype /Link -/A << /S /GoTo /D (a00150_g8387881de3a8bfd3c0d57b9d04ac9b7e) >> ->> endobj -1907 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 376.0227 167.0009 386.9266] -/Subtype /Link -/A << /S /GoTo /D (a00150_g24f52ac52d6e714cb04a5aa01be3bdd0) >> ->> endobj -1908 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.7613 376.0227 256.6538 386.9266] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -1909 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [273.2016 376.0227 305.9885 386.9266] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -1911 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 363.0302 172.5401 373.9342] -/Subtype /Link -/A << /S /GoTo /D (a00150_g96544dedc1cdc71ad2ad54bf1d5e5433) >> ->> endobj -1912 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.3005 363.0302 262.193 373.9342] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -1914 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 350.0378 191.3593 360.9417] -/Subtype /Link -/A << /S /GoTo /D (a00150_g4309376690872fa4beb4f025f5cc199b) >> ->> endobj -1915 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [223.1197 350.0378 288.763 360.9417] -/Subtype /Link -/A << /S /GoTo /D (a00091) >> ->> endobj -1916 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [305.3108 350.0378 338.0977 360.9417] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -1918 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 337.0453 186.9261 347.9492] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb9435261753469accec0c9bf8a5a2686) >> ->> endobj -1919 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [218.6865 337.0453 279.3487 347.9492] -/Subtype /Link -/A << /S /GoTo /D (a00096) >> ->> endobj -1920 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [295.8965 337.0453 328.6835 347.9492] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -1922 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 324.4265 191.6285 334.9568] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9c0814ed491fa452ec97910c0728d410) >> ->> endobj -1924 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 311.434 189.2275 321.9643] -/Subtype /Link -/A << /S /GoTo /D (a00150_g013c3a06a8b58589a77f4a3442f89c2a) >> ->> endobj -1927 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 254.0565 170.966 264.9604] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1928 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4642 254.0565 229.3566 264.9604] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20ceef9d0868d391c2f33041b02cb1f1) >> ->> endobj -1930 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 215.1201 170.966 226.0241] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1931 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4642 215.1201 229.3566 226.0241] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9ebb4dac683163840eab9c6c41ad61f7) >> ->> endobj -1932 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 202.1277 204.1712 213.0316] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20ceef9d0868d391c2f33041b02cb1f1) >> ->> endobj -1933 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.6693 202.1277 257.5805 213.0316] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1936 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 145.1237 183.4989 156.0277] -/Subtype /Link -/A << /S /GoTo /D (a00150_g266263ac78a1361a2b1d15741d3b0675) >> ->> endobj -1937 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [187.3145 145.1237 207.0205 156.0277] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -1938 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 132.1313 138.5977 143.0352] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1939 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 132.1313 189.7953 143.0352] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb6683dd83fe1c8de9a24086d4b69e907) >> ->> endobj -1940 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.6109 132.1313 218.2983 143.0352] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1941 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [241.84 132.1313 266.5273 143.0352] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1942 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 93.195 138.5977 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1943 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 93.195 197.5461 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2addf34c7d457c1a7899a7e2171ef1e9) >> ->> endobj -1851 0 obj << -/D [1849 0 R /XYZ 90 757.9346 null] ->> endobj -1852 0 obj << -/D [1849 0 R /XYZ 90 739.9346 null] ->> endobj -1854 0 obj << -/D [1849 0 R /XYZ 90 731.7802 null] ->> endobj -1856 0 obj << -/D [1849 0 R /XYZ 90 718.7877 null] ->> endobj -1858 0 obj << -/D [1849 0 R /XYZ 90 705.7953 null] ->> endobj -1860 0 obj << -/D [1849 0 R /XYZ 90 692.8028 null] ->> endobj -1862 0 obj << -/D [1849 0 R /XYZ 90 679.2077 null] ->> endobj -1864 0 obj << -/D [1849 0 R /XYZ 90 666.2153 null] ->> endobj -1866 0 obj << -/D [1849 0 R /XYZ 90 653.8255 null] ->> endobj -1868 0 obj << -/D [1849 0 R /XYZ 90 640.833 null] ->> endobj -1870 0 obj << -/D [1849 0 R /XYZ 90 627.8406 null] ->> endobj -1872 0 obj << -/D [1849 0 R /XYZ 90 614.8481 null] ->> endobj -1874 0 obj << -/D [1849 0 R /XYZ 90 601.8557 null] ->> endobj -1876 0 obj << -/D [1849 0 R /XYZ 90 588.8632 null] ->> endobj -1878 0 obj << -/D [1849 0 R /XYZ 90 575.8708 null] ->> endobj -1880 0 obj << -/D [1849 0 R /XYZ 90 562.8783 null] ->> endobj -1882 0 obj << -/D [1849 0 R /XYZ 90 549.8858 null] ->> endobj -1884 0 obj << -/D [1849 0 R /XYZ 90 536.8934 null] ->> endobj -1886 0 obj << -/D [1849 0 R /XYZ 90 523.901 null] ->> endobj -1888 0 obj << -/D [1849 0 R /XYZ 90 510.9085 null] ->> endobj -1890 0 obj << -/D [1849 0 R /XYZ 90 497.916 null] ->> endobj -1892 0 obj << -/D [1849 0 R /XYZ 90 484.9236 null] ->> endobj -1894 0 obj << -/D [1849 0 R /XYZ 90 471.9311 null] ->> endobj -1896 0 obj << -/D [1849 0 R /XYZ 90 458.9387 null] ->> endobj -1898 0 obj << -/D [1849 0 R /XYZ 90 445.9462 null] ->> endobj -1900 0 obj << -/D [1849 0 R /XYZ 90 432.9538 null] ->> endobj -1902 0 obj << -/D [1849 0 R /XYZ 90 419.3587 null] ->> endobj -1904 0 obj << -/D [1849 0 R /XYZ 90 406.9689 null] ->> endobj -1906 0 obj << -/D [1849 0 R /XYZ 90 393.9764 null] ->> endobj -1910 0 obj << -/D [1849 0 R /XYZ 90 380.0077 null] ->> endobj -1913 0 obj << -/D [1849 0 R /XYZ 90 367.0153 null] ->> endobj -1917 0 obj << -/D [1849 0 R /XYZ 90 354.0228 null] ->> endobj -1921 0 obj << -/D [1849 0 R /XYZ 90 341.0304 null] ->> endobj -1923 0 obj << -/D [1849 0 R /XYZ 90 328.4115 null] ->> endobj -1925 0 obj << -/D [1849 0 R /XYZ 90 270.7639 null] ->> endobj -1926 0 obj << -/D [1849 0 R /XYZ 90 270.7639 null] ->> endobj -1929 0 obj << -/D [1849 0 R /XYZ 90 234.2545 null] ->> endobj -1519 0 obj << -/D [1849 0 R /XYZ 90 219.1052 null] ->> endobj -1934 0 obj << -/D [1849 0 R /XYZ 90 164.1147 null] ->> endobj -1935 0 obj << -/D [1849 0 R /XYZ 90 164.1147 null] ->> endobj -1848 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -1947 0 obj << -/Length 2723 -/Filter /FlateDecode ->> -stream -xÚÍ[Û’·}߯à#Ye¸_ü9qYUq”híY¥¢H®ÄÒŠ¤¹CÉÊ×§Á€˜Á ›ÝT¥ô %yØ}ÐӧѸ�Í(üc3GgFâ„Ô³õç:ûoÿtú�—ðù2üåöæû¿q7sÄi®g·w šÅŸÝnÞÌ5q‹%Wt~ûqÛþqþùU÷΋W߇¿šÕúÓb)¨´z®ÕâííË›¿ÞFÇ/%4ónÿ¸yó–Î6Àïå %ÂY5û -/(aÎñÙçÉExqóúæŸÑNûÁå cÓT+ìlÉM; ”�5„iá0|Ãc<�Yøº–> >¤ÆÙY@ù ¼XݯÏ÷«¦‹HB¢ñq»ÚlOíßëSðÆzÁéüÓÃùsûîánðÕãªE,�o›ÜÌnßEw|÷Þ#ÏwÞ0F:ŒÊ0àÍ+‡ ‹ãÄr©¦S†j¬MRF$)ÃàS)¬œE˜�Ñœ|‹+1K =Jâ,ƒÇÜ~æß9}è>úWÊ��j�² ¸»3Óž0DS&‹ô8‘Žœž¤„:ÎPz×§O¹Y×/3 É)…L¼HsQN‘Z¸ÁÓ£Š~ñivØmào6•fÚ1" «TZŠ.H-ÂJZƒêód��‰êòÆj¿¹~²:7«f5)5m)‘Œ›g‘šÖP&­åˆÔ" •ZjðÉRCØ\�]Yj%z�–B/àúôà Ÿ7“RÄÈr—„¸çðì¸fðìj…¦81†ñJ¡%è’Ь$´_ü¿šdÄ2ê³�C@¬±˜ÐZ˜«Z@ŽyŒ¨e -+I(õ$W SßÓJ xŒEf7(åaÛìŽ#DŒƒvM:$…¹·Œh«î½R2¿VJ¡Ë© @À£ †v'+‡äÔò¨8ôˆBsFý$<:R g˜¡®²4$èRi°ËÀCc»ÛïšÝê~÷ïU³;tš¾;ï×þÕ´l¡>r¬rUªV9hÿ­Qˆj# Umj° ZÄoPmÏ/ªÚ¾ï -Õ",2»Aµ«ÍFð\³Ú7ˆ A@aÎAÛRK1ý¨faÒ±ÌV?à1™ÝËðí˜d¡asØÃ�¨Ü/ô-é¼ÎA©Ê GN…÷; yé¸$8ð˜ÃQðï2r$`„« OÄ#áÉíN—4¥ˆÒÖ ñ (̱²„*7ȌÑéRQS¬ªêŠZŠ.µkû�Óé[×Ü»>eÕþ'øòý.¼µÙìŠåMiI4Ö@µõM1Hbðú`x}K –ê[Ùo¬o©_¼¾õ|×Ô·2‹Ìn¨o~ZÊXhhh6Ê(Ì·¶DR5ð]Û¼+á‹(e•Éœ KÉ`OŸ¡ׄ²ç𢙀F,…[˜­Há€|Žlj¬”è);ŸbëÃ~Ÿ1„\€M.#*÷Ý›G˜’DÂ6ˆL7�ôS,*Ê~§GðØè3»éè·ë|¢€nUKÃʈ(Ä=÷Ÿ -c†È[Î ‰”ⵈx”ÁÐn¬0G˜N#S%¬åÅeV-F  �àÚ«A[£)Pj%N-Á…¤ó¬£Ôhftm´"‰Vnw²£‚뢔ˆÂ �ÄÀïéx85¥",�%B;[W„St¡GØ¥£èTÒî‡z-Åi!Ì|ûù¶W>:àùa·ÿpÝÓd¢°«/­!’aK½ÊB-�$ -Ò )Ô†êÔà“ 5Â.àz캽¼ñbm ¸ù]ÚËeDåþûÅ>•TˆAtÆŠµeÐwgÑ),w:<�Ìn�ývÁÕük¾¸PP`° DB� H~%†)2V°%#Úï&T!â1™]´`;@§�’Ü)B-åãi0V°EMÁ†ú&/r¯‹VÄ#ÑÊíNl¥ c¬¥ÂÜÂPSfúnñz­1ÚÉÊz� Kõ:À<…×a{ú|ìÕjóâl·Õ½ÔGKi‰eØ¢µ¶<ƒ -zæPxq¾š+¬ËNcÑMœ¢«ÀžãŠE`™ÂÐj,zûûÝC³Í˾õû˜þÙ”Æ@ˆs«‰ÖÚõƒ>ºÅ_²RÖŽ=À1÷«Ó8�[Ú¸ò #¨ì•3ù꥓xEµË™ÿR¥t¯à’r;ÔE¸Í¡SlûÐcš®xõpÜ®wP�ù¶;gò̧õ +X­<Ï¥ á é· -p3¸‚#²,áVÐpÏ/*â¾ï -#,2»AÇ*†™–‡‰A@aÞ�&†J>ˆý¨�)¡¦®Úñ<Æ ³[8_âÄ0­ÊC�(Ä1§ -Ölf0tLÎÂòv«·JÏ)º èk½:5ÿ I hè5ÅV}µ’†NÆX%0I.éÄà“WL»(ü”]ùrF‰Þ£/g ô®GïcsØ?Œmi M‰Þ2¢0ÇÚÏýl—Ñb añmø-l»ux”ÁÐîô“qþxX`C(̱óä{Ïñ¿r\Ýë�`ÄŠÊz� Kõ Àº­¿4ú² U�éë‘ÌçÕ¾Ù5ÝáÍ,¢Ôüðy¸¯òþ[Øk9\6_âUÊPQöÛæëáôi k›é­¿˜¢[žÔtXa 0¼°$K½BÙo,©_¼Wèù®éÊ,2»×Ë(û‘›(”X¿Æ,G  0ßF¿#Ý<ÔX †> endobj -1949 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 703.0355 138.5977 713.9394] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1950 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 703.0355 201.9695 713.9394] -/Subtype /Link -/A << /S /GoTo /D (a00150_g85b65e38aa74eba18979156f97a94a87) >> ->> endobj -1951 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 664.4351 138.5977 675.3391] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1952 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 664.4351 204.7393 675.3391] -/Subtype /Link -/A << /S /GoTo /D (a00150_g7023a34ba9e9d03b5fbedbcb32924453) >> ->> endobj -1953 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 625.8348 180.1912 636.7387] -/Subtype /Link -/A << /S /GoTo /D (a00150_g22f140b02c354dfebcc7ad481c3bcd68) >> ->> endobj -1954 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [184.0068 625.8348 208.6941 636.7387] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1955 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 587.2344 177.9699 598.1383] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6832e4d2d046536b6472f7ac92340f68) >> ->> endobj -1956 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7856 587.2344 201.4916 598.1383] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -1957 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [231.8776 587.2344 256.5649 598.1383] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1958 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 548.634 166.9111 559.538] -/Subtype /Link -/A << /S /GoTo /D (a00150_gc48ed5f0d27721ef62a3ed02a5ad8d2e) >> ->> endobj -1959 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 510.0337 152.9837 520.9376] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1960 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 510.0337 211.6433 520.9376] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9c24fba2cd8f7f62accb0a0d5bbe4dad) >> ->> endobj -1961 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.459 510.0337 268.3701 520.9376] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1962 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [307.2043 510.0337 331.8917 520.9376] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1963 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 471.4333 172.9089 482.3372] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1964 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 471.4333 236.859 482.3372] -/Subtype /Link -/A << /S /GoTo /D (a00150_g79c4110211247df3fb30b8cf1c4c02af) >> ->> endobj -1965 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [240.6746 471.4333 293.5858 482.3372] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -1966 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [332.42 471.4333 357.1073 482.3372] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1967 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 432.8329 185.1725 443.7369] -/Subtype /Link -/A << /S /GoTo /D (a00150_gaa585784b0914cac1d37f07f85457008) >> ->> endobj -1968 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.9881 432.8329 213.6754 443.7369] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1969 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 394.2326 175.2098 405.1365] -/Subtype /Link -/A << /S /GoTo /D (a00150_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -1970 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.0255 394.2326 203.7128 405.1365] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1971 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 356.0058 138.5977 366.5361] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1972 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 356.0058 162.6772 366.5361] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -1973 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [166.4928 356.0058 191.1801 366.5361] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -1974 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 317.0318 171.8826 327.9358] -/Subtype /Link -/A << /S /GoTo /D (a00150_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -1976 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 234.645 192.0768 245.5489] -/Subtype /Link -/A << /S /GoTo /D (a00150_g561b8eda32e059d4e7397f776268cc63) >> ->> endobj -1977 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 196.0446 152.9837 206.9486] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1978 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 196.0446 200.0271 206.9486] -/Subtype /Link -/A << /S /GoTo /D (a00150_g788ffac72342f6172343d7f8099cbe1a) >> ->> endobj -1979 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 157.4443 152.9837 168.3482] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -1980 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.4818 157.4443 196.4305 168.3482] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf703683056d2bfa5c81fa157dcb20fe2) >> ->> endobj -1982 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 144.6198 172.9089 155.5237] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1983 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 144.6198 239.8777 155.5237] -/Subtype /Link -/A << /S /GoTo /D (a00150_g210f227119fc972e6222c9cb452e15a9) >> ->> endobj -1985 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 106.0194 172.9089 116.9234] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -1986 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.4071 106.0194 236.281 116.9234] -/Subtype /Link -/A << /S /GoTo /D (a00150_geb533744817cf6695d75293369c2248b) >> ->> endobj -1987 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 93.195 151.3294 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00093) >> ->> endobj -1988 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [151.8276 93.195 185.3713 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9ee50a40597e67fce96541ab56c3b712) >> ->> endobj -1948 0 obj << -/D [1946 0 R /XYZ 90 757.9346 null] ->> endobj -1975 0 obj << -/D [1946 0 R /XYZ 90 253.468 null] ->> endobj -1406 0 obj << -/D [1946 0 R /XYZ 90 176.4106 null] ->> endobj -1981 0 obj << -/D [1946 0 R /XYZ 90 161.4293 null] ->> endobj -1984 0 obj << -/D [1946 0 R /XYZ 90 124.9858 null] ->> endobj -1945 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2003 0 obj << -/Length 2504 -/Filter /FlateDecode ->> -stream -xÚ­[ÙŽ7}ï¯ a"šûâÁ<8±ؘ8�¸ý2¶a¨%u·`µÔÑ’Ääß粊d³]J�Ý.U�"ï¹ ‰ (ü±�££ qBêÁôþ‚náö�,<ÃóqøþêâÉKîŽ8Íõàê¦jA3¢8ルÙû¡Ö£1·ÔÐáþÕ%\*:d„Ö?­gûå¼¾~¾žîïç«Ýd·X¯F¯^_¼¸JýZJhæ{ýíâýG:˜½×”gÕàø@ sŽî/$ñÃòâíÅ/©�úAõBßè$UÄ -;sS�'uÀŒÂ4{p½áÉŠ,¼®¥7ƒ‡Ô8;ˆ(o“«»0èd’«.ŸÄë­·Áv·˜nIÛ±OàU&N0ðc‚)Ë ƒæ†²G9E&'£šHaå Áü>p®ºÜà-®Ä o°Ý£$Î2Р~æïlnã_sê €Të"»ˆk°ÛÛO»;Á‰æÀØq"5evBƨ-²‹¸&»Å甊Éí¶CÒ0¢¥�(ɱ  ZX¾CÊjçã0óÌ~e¬¨lÞàÙÊØE\ƒ�·Ýâa2›mzÖ¼%–•ºÌR["˜rE–×ay·†0žm–œCþ‘T¢,AÙ€*kl 1¶oLã+kœ5x¾Æ8»¤qÎî8�–§kŒ³L·Y®æ»ûÉösGbHÎ\H‰’ûÂP¡ÊkI¨d²$q„•%Î<_bœ]’8gwœÄËÓ%ÆY&‰Û,g›Þ fœPÁ ʨ²ÂŠ&%˜ÂVV8kð|…qvIáœÝq -#,OWg™n³,'j„e;Qžei¡‰‚%‰#¬,qÖàùãì’Ä9»ã$FXž.1Î2IÜfY -b„ã)A H˸.)ae…³ÏWg—ÎÙ§0Âòt…q–Iá6Ëb%FHžR‰Aª�)Iae‰³Ï—g—$ÎÙyãÍwwŸú„iC¤q eyì’I{&° .±Œ¸>–ýQlˆ0JrœP…î}Ò§ŠµŒôïz]þ×_ô»ô÷÷ß={Ê)"¸6( ”`EÂz<Ù� -ì"®Á]kcìN^kØE\“8ÎõˆÓáþ¦/�9ª8.ZB•º÷©É©V÷ïß½ºüôýˆÑá»—o_ý÷Å?ùÇC;:Ê8¢Çm9åhdÏ)Áú7�&So›Ïžà|Wß‹Öbvx3ߌcûP -­—_cJ)I¬u¥EN‚•##k°Ç�Uê7ù|ÞïïÞFëÅÌ÷ýä%Ìþ³ùƒJ½T)‚’a…j<_¢Úi7Àäáa6ÙM:D#ÔR…[Ê -âL~ÇL#”<Ò?…#LÉ’{”'z9²Þ¦«8]刻uø?º- c¹˜ÖÛÃÕ�jPÕÕbÕžíÙÜæÔ û«È¬A�IÅKÛp Vví¬A̵ñ~“kçý~%×n<Ƶqª�v£koú6 NÁL±`ª€*KH)1Ô•vÙ¬,aÖàùug—„ÎÙí™î+܆hÊ$JïØÂ-Á_gEzפâ.ç«nÑö‡(0-ÃÂ*&ûÆÄœ¥ŽËYÒ‚�Œ°…¤•`�š -\owwõõúæˆlÔIYùTåä|%�$ ›û*ùJjJʧUtõ¬¹³=§a95ÜÏn'»9Î-ÂÜ|ëór#ˆUŠaô|a®0e9¥&Š»Òù^‚•Í<_Qœ]’4g‡®90v'¯9 -ì"®Éîˆó=Œäñç{Æl¬.*aee³ÏWg—”ÍÙyÛM׫nD(݉2'T·ïÆLæœDËZ–é›ÑhhQQÖêÙæøÒè;í¢£wP{„÷3lô0�·ÚÚS«Tª¨.U½;n®>Ýo6#a†óÕ.}¿!<�ñͧ~¸˜�ãRÇÌW)fÂÁÜQZ[ˆ‘+ÆHÞàÙ1R`q vÅÁ›c„”F\/Ãnþs -Ì-9JqœP¥Î�I`ÒÓè¼Úsùáç7oÞ~ìÙ¡ÆBåWˆ¿dÌ_"¬ì/H�§û Î.ùKΟaôNžèE\“žŸé/¶»ùêa½ÙmûrŸ`ŽáÊ%T�Lˆ¥�Ï*—ùÏ«·W/Þ\þüëHCºêw-!ÅÞÃÊžc®PeÏ9ÜÝ鎃RK~“QóºìgR ÌcãµHu:ocXºH*DÓ.}µæEÖ´írxì^{»ÕÒØ¹°ÄZ&ñ± F sòÄb,¤#`1U(Æ ÖX‚vjî»çÇ×\£bÚê¯Ss9HÊUé”#ÁÊ‘�5x~(àìR,äìŽ „屩´YdqYn»~«·Ò¢4Ç U À¡~£ZªD -n‡Ô_F‰¶Üö� €ùN„•}éñtßÁÙ%ßÉÙ¡«UŒÝɫջˆk²óÓ©à]·†Y¸Ò—,¡J�C½UÒ´Ló^<ã~Wš#ÏÃr4’8Ìw.Ç×_vñlR'SÃÉ—°·�Ïê«›õ¦µ´||½v;ÿm?_MÓÕþþ:®ˆ¦“åt¿¬+‹›ûÃk�‡‚ÊW‡¾ißú?D!µ¡J<6DXhêÛY£-ðÏ./Ÿ�„>95¼9:|öÉŸv†¦Åá¦SíŠ{�\U{�µqÿ‹êø§¿û‡“Årr1�´¹6Ø‘P;j¾È%Ì-ý$ÐÙB€%ü8¡''vÚ-AsÀ ¡m‹H;%GT¡{A)±Ü´ºoYV©zÙ%"À}Y×\Ê Èb †szx?™nü²4½[/gánpѧ Ü¢ÁKµ:p+¨WA¸ªÔP�:’¨‚@…™W¥óÑ„ç/ô˜§ÓnA!ýI¾°-"-uªÔ=Ä&7´Õ}Ÿ:c)MˆŒ\0Ú6K³*Cy†§×ódîYPX….Ç)M@—)j¦wóéçÅê6Dàz¿ªDÎ0Ä]3Üjw¢Ñ�êÀ~ñçäþa9Ú¶©U„2k #C-âÏî<Îѵeõ–þÕ* ñAB±°ªL(O`»zØ€�n>PE³3ðïFcM³Ö³«:S…Ûßücÿ� ¹ú&|^ÀÛì_=ilº„œ ³ 0æ�d�Ô“P&–‹˜.™¢ºicÿÎòñˆÜ‘¾ß>1Â|ñìq@ -´˜Vú¬ŸEU3/ðKó’¼¼èpÒîËáEYýò¨¦âGüã|5ßLv±VÆaÿ/^ûšºÿÓ§\<åá`œFƒTA�2zç§b×_bñúóËm÷ÈDÁ4®ÇJÿ -b©Íendstream -endobj -2002 0 obj << -/Type /Page -/Contents 2003 0 R -/Resources 2001 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 1754 0 R -/Annots [ 2006 0 R 2007 0 R 2009 0 R 2010 0 R 2012 0 R 2013 0 R 2015 0 R 2016 0 R 2017 0 R 2018 0 R 2019 0 R 2020 0 R 2021 0 R 2022 0 R 2024 0 R 2025 0 R 2026 0 R 2027 0 R 2028 0 R 2030 0 R 2031 0 R 2032 0 R 2034 0 R 2035 0 R 2036 0 R 2037 0 R 2038 0 R 2039 0 R 2040 0 R 2041 0 R 2043 0 R 2044 0 R 2045 0 R 2046 0 R 2047 0 R 2048 0 R 2050 0 R 2051 0 R 2054 0 R 2055 0 R ] ->> endobj -2006 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 702.117 133.6164 713.021] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2007 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 702.117 172.6397 713.021] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb4ef6b00924990e7a293f66715b6d1d1) >> ->> endobj -2009 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 688.3741 166.8215 699.278] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2010 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 688.3741 221.3367 699.278] -/Subtype /Link -/A << /S /GoTo /D (a00150_g7d3673f52f5846b6961d23b150decd54) >> ->> endobj -2012 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 674.6312 166.8215 685.5351] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2013 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 674.6312 220.2307 685.5351] -/Subtype /Link -/A << /S /GoTo /D (a00150_g3237be0d9ec457de0177689ee23c0d5c) >> ->> endobj -2015 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 660.8883 166.8215 671.7922] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2016 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 660.8883 213.028 671.7922] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20df5c82f2a15a508c19e505b5d9de2b) >> ->> endobj -2017 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 647.1453 166.8215 658.0493] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2018 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 647.1453 221.3367 658.0493] -/Subtype /Link -/A << /S /GoTo /D (a00150_g7d3673f52f5846b6961d23b150decd54) >> ->> endobj -2019 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 633.4024 166.8215 644.3063] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2020 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 633.4024 213.028 644.3063] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20df5c82f2a15a508c19e505b5d9de2b) >> ->> endobj -2021 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 619.6595 166.8215 630.5634] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2022 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 619.6595 220.2307 630.5634] -/Subtype /Link -/A << /S /GoTo /D (a00150_g3237be0d9ec457de0177689ee23c0d5c) >> ->> endobj -2024 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 605.9166 168.4754 616.8205] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -2025 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 605.9166 218.5572 616.8205] -/Subtype /Link -/A << /S /GoTo /D (a00150_g499bb98a0b4ae9a98553ede81317606d) >> ->> endobj -2026 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 592.1736 133.6164 603.0776] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2027 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 592.1736 166.9014 603.0776] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -2028 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 551.7363 192.0768 562.6403] -/Subtype /Link -/A << /S /GoTo /D (a00150_g561b8eda32e059d4e7397f776268cc63) >> ->> endobj -2030 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 511.2991 195.9522 522.203] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga05a3dde2048480fa3ab2a5961898d18) >> ->> endobj -2031 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 497.5561 138.5977 508.4601] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2032 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 497.5561 170.976 508.4601] -/Subtype /Link -/A << /S /GoTo /D (a00150_g12a33f0c09711167bdf3dd7d7cf8c5a1) >> ->> endobj -2034 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 457.1189 138.5977 468.0228] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2035 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 457.1189 174.8513 468.0228] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5b5615dc240daed20949c0fded2b4679) >> ->> endobj -2036 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 443.3759 133.6164 454.2799] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2037 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 443.3759 172.6397 454.2799] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb4ef6b00924990e7a293f66715b6d1d1) >> ->> endobj -2038 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 429.633 152.9837 440.537] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2039 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 429.633 200.0271 440.537] -/Subtype /Link -/A << /S /GoTo /D (a00150_g788ffac72342f6172343d7f8099cbe1a) >> ->> endobj -2040 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 389.1957 152.9837 400.0997] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2041 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.4818 389.1957 196.4305 400.0997] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf703683056d2bfa5c81fa157dcb20fe2) >> ->> endobj -2043 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 375.4528 138.5977 386.3567] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2044 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 375.4528 200.3154 386.3567] -/Subtype /Link -/A << /S /GoTo /D (a00150_g236d5c7872f59c8fe7b701c7252b976e) >> ->> endobj -2045 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 361.7099 172.9089 372.6138] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -2046 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 361.7099 239.8777 372.6138] -/Subtype /Link -/A << /S /GoTo /D (a00150_g210f227119fc972e6222c9cb452e15a9) >> ->> endobj -2047 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 321.2726 172.9089 332.1765] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -2048 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.4071 321.2726 236.281 332.1765] -/Subtype /Link -/A << /S /GoTo /D (a00150_geb533744817cf6695d75293369c2248b) >> ->> endobj -2050 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 307.5297 133.6164 318.4336] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2051 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 307.5297 177.0532 318.4336] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2a0cf5d86c58fab216414ce59bf1fea1) >> ->> endobj -2054 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [266.5461 195.4567 299.333 206.3606] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -2055 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [313.5331 177.8323 346.3201 188.7363] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -2004 0 obj << -/D [2002 0 R /XYZ 90 757.9346 null] ->> endobj -2005 0 obj << -/D [2002 0 R /XYZ 90 722.0018 null] ->> endobj -2008 0 obj << -/D [2002 0 R /XYZ 90 706.1021 null] ->> endobj -2011 0 obj << -/D [2002 0 R /XYZ 90 692.3592 null] ->> endobj -2014 0 obj << -/D [2002 0 R /XYZ 90 678.6162 null] ->> endobj -2023 0 obj << -/D [2002 0 R /XYZ 90 623.6445 null] ->> endobj -2029 0 obj << -/D [2002 0 R /XYZ 90 531.1839 null] ->> endobj -2033 0 obj << -/D [2002 0 R /XYZ 90 477.0037 null] ->> endobj -2042 0 obj << -/D [2002 0 R /XYZ 90 393.1808 null] ->> endobj -2049 0 obj << -/D [2002 0 R /XYZ 90 325.2577 null] ->> endobj -2052 0 obj << -/D [2002 0 R /XYZ 90 267.6373 null] ->> endobj -1847 0 obj << -/D [2002 0 R /XYZ 90 240.7961 null] ->> endobj -2053 0 obj << -/D [2002 0 R /XYZ 90 240.7961 null] ->> endobj -2001 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2058 0 obj << -/Length 2056 -/Filter /FlateDecode ->> -stream -xÚÅY[�Û¶~÷¯ð[m f9¤$Jyk7MÛíÉIö­-ZYk ‘%G–²Ýß¡x±¨«=ÀÁ>,E~ä ç>4¬)þÁ:¢ká q/X'§]púçèå®ïº€ïWß¿gÑ:"QÀ‚õýS{BÄgÀÖ÷û?6‰¶;æÓÍý1Uƒæ×�zæîã÷f|©ãäËvÇ©›@lÿºÿ°úéÞÖ|ù<Iöëê�¿èz�ü}XQ£Ð_?ã%El}ZyŒ›�|õyõ_{ŽZh7Œ]Ï>~?ù>3dx_aïGøv”ÒÍû¦Hê¬,Ô•Þ•IsJ‹:n§ðB=I¡(™GBáz�þÍ� Âý(Z êðy¤—KÕAc>u®`ñ»î†¡ž†çJ&ê >¨ßc¡';‹Z"ìsøhác]%·?©O,„Œ€Û¥`ðKÌ Î�”£A¶¤`QCÂh>WÂŒF„Rޓ·81`„Ç�€Ä x@ƒx´ŽòÂ3VÕ‚ïÐò<ºù¶“Vµ0»ÇL�¿6qQgõ‹úzªÊ“Ë‹F<¾ÔÚqËjŸVjX—ê‘ÖÏ[�K_ÆÑ¾¿!’[ií HÀ<¯eìþ˜¡º9ˆÍ“uùefÏUvŠ«,‘ŸÁ¦¹¤{ /+5HÜ«eÅAÍÛ2ƒ[ãÇ<5$ÚkÉ‘º–)FåH_K’‘×’SεÆÐíµ0\À潤�<™;š@�wãPJç1Üõ啲ijÞèzÑ 5Õ¾�F>¡aÄ×�O‰ð¾à*¿ënP®Ò5°á¹òŽ¿Üo!Üüç÷ÏÒk�ivÙáÜC4í³Ós‹Z`‚sA˜.§8©´ 3”lï•É¡#(´cyïÒ?)eEv Ô±¶ô<+´X! ™–ü“ J”å&�eg’ô¬Zqò)}J«´HR­Z+�Q°è½Ñ·=ÿ!9~¹4'#Ô7�…²(Ò¤YÉΓ›šýùñÜ[� Mü9}Lò ÓÕÃ!µ§“ñ´…ʈåuÒÓð[kÀÙþJ:Þï9› ìQH‚0*“p�‡K�ÝàwÝ #�}pnØÃ‘¸Ž*ñ)æ#—ƒ~\7¨!]ðº^8Ž0ú:tÑz¸¥“ñ„ ëåÅ4ûqÈ|®AoÌûŒpA½[Ågñ âž;�E€y`A~5$ìæE�z @¸„Ë3‹Â™JŒŒ†Ä…[mÝÅU¥Ý­l´ÿÇêg×ôˆÖÛŠQÿý1Mb‰aS”µÄy. sPrÌjôÕ¦RñTò’ƒçc–ÕP—ÃЦ>¹/+ê´Ø« ›c¬÷XGJVéDÍ]Y™òêã)­³ä�:ÇŒ<ê3âB-¥òŒ¿ë´*â\­Ü¹ L éšš™ šy›}©R™Pù§Té×&«Z¦E‡/qáE}f…‚Ø�بÁ¹*ë2)sµŽ_F/H -Ç U1´Œ8l]Že“kºHk,צõÐ Vë¶’ÁùÐÖè—^4<çqÒI±íµØäµÉ3½ÅC^>*YR§éÂ$áŒô½'Ĥ -hœ6!ããm‰íº¨¡Ó†mI‰gñòî¿—uúvu)–½œÁ’sîÆ…ÿ­¡XÙsT³€pÉ]»° YX7ÅŽjhž®ÕЀº? {ÒI©N7¥¶ÍÜyšö5ØWS¸¹æg^ôº’¹ˆ¿œó¬~Àúâܼ¾¤æ“/A �šº^‚ºf^‚,lù%Èeaò%h�°y r Ûîgºk`”±[ n…Å/p4áÔcó¢°¨!a·mÀ¾VD^O7´ �[†¶ö4Vsé•ádç€õu(]ûF jø’û§NË/D' -E° ?ƒÒuÛ†ˆb{r—pžãÏi&—šDE $Ü®!Oš<®û¥á¯2»`Ì×ï;Ç4¹Úo)C™~r‰QÖ O³/eíËSÔ!±n½‘kêÙ,Ò•.—Eú�¤-¿4‘‘îâÆûNµ�?½¿ÃÔ5]FA&˜7_FuQÓe”  {ÖWÕQc Ìdé'ãYÚÂzîî¦ÀŽ<+‹‚“¨Y@8Ç(è�ž+¥¬#ôt:á¶ûíìt�&ë½�>ÚeƒýÂt‰$_ô1ÀB‰Ô…Í ßÀ:áÄ<%žçû d jH¶'xŸx,]²ö‡3¤¨�n‘òÿ—¼u?�`,Xp¿jÚýÀG<¶°ºÂª›J^¢˜ó½9êµÈ�6²æÈ6Ê/èãZ ‚¦¡ Tvs�ÊþU�ªÛþÒæT£ýZ±zóĨ$) - d{ùo~ƒmDq 6]3À²WÈ÷¾§.ò?§EZŵ©°�„~3ƒÒ8ýú±è[Æß2ª‹{Jý—ÔHYõ~ŠBÝòý]ù÷Ëaèïòâùü–K$endstream -endobj -2057 0 obj << -/Type /Page -/Contents 2058 0 R -/Resources 2056 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2072 0 R -/Annots [ 2062 0 R 2063 0 R 2064 0 R 2066 0 R 2067 0 R 2069 0 R 2070 0 R 2071 0 R ] ->> endobj -2062 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 702.4242 152.1568 713.0144] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2063 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7156 702.4242 207.5088 713.0144] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2064 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [294.093 647.6032 335.7466 658.5071] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -2066 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.6856 560.3152 218.4975 571.2043] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2067 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [251.3742 560.3152 277.1673 571.2043] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2069 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 305.376 152.1568 316.2651] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2070 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [210.5073 305.376 236.3005 316.2651] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2071 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [262.8907 305.376 288.6839 316.2651] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2059 0 obj << -/D [2057 0 R /XYZ 90 757.9346 null] ->> endobj -2060 0 obj << -/D [2057 0 R /XYZ 90 739.9346 null] ->> endobj -1996 0 obj << -/D [2057 0 R /XYZ 90 722.6349 null] ->> endobj -2061 0 obj << -/D [2057 0 R /XYZ 90 722.6349 null] ->> endobj -681 0 obj << -/D [2057 0 R /XYZ 486.51 597.8832 null] ->> endobj -2065 0 obj << -/D [2057 0 R /XYZ 90 578.8113 null] ->> endobj -1944 0 obj << -/D [2057 0 R /XYZ 224.7534 342.944 null] ->> endobj -2068 0 obj << -/D [2057 0 R /XYZ 90 323.8721 null] ->> endobj -1992 0 obj << -/D [2057 0 R /XYZ 167.4587 96.348 null] ->> endobj -2056 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2075 0 obj << -/Length 2271 -/Filter /FlateDecode ->> -stream -xÚ­YYoãF~÷¯ÐÓB¬Nß$½O‰Ç™ñÀ‘½¶f�E4I[ÄH¤ÂcœÙ_¿ÕÅK”³»ÐûøºªºººŽ™aø‘Y€gžðPÀ¸œEû <{…á�ÄN/a~Ùü´¾øágÌH*gëMA$(¡³uüë\ú‹%õ±‡çõí4ž„Mã—<®w‰iÈ£zŸdUX¥y¶ø}ýùâfÝðµb &‰âúÇů¿ãY â}¾Àˆ¾˜½A#t¶¿à”¹Îîâéâ 3¡ŒíNöžíQèzvw(@ ñÅ’`ŒçeUÔQÕžŽ<.ýf¡f­fŠW yl ÑÀ—-üP�U%N�6Qž ôGްºô6ï0¶„·Ùö()®¿aÌÇž„âÀÁP�>îß°À})©ð‘O„x§¢ø´¢T�<é!Œãb38/F@³LÐIm5 iu1â!JOê ÖwõE«°ÂH7¢V†çBZÜå@z –O¹÷N%6ði%¨j%9¢=Ÿ¡€ -6­=píh„ùq";LyQ�h…H$±'¬VÀºˆ±N�!L˜ åˆñÀ�¼nf•›oh>E²Ï+뢶yiAu™f¯¦¹¾~XBæHñöK8qI9Ó”×Û´˜äó—:‹´gƒž˜»ÑºLbÓÒla¦¬Â¢2C¡ùdÉ‚Šù›™¶wÈ:.«¶‰(I”‚�QGXëKcš5¬Á ½9´X2Áæ·N€Ý.�Â*)[òˆF·]‚!Œ"ÛÒ1‚çi ÝHS,8c]2*çeR• EQ�þJµ/ZmOÿZmžnVkÓ-Uv"Ìb¡Z$Ufå>-Ë#åtÂâ¹Âhl3ö왿¥»�iE!œ˜i†æ£ŽT hF@ÄüUÅ23`,ŠÌŸp3yí [;—éźa�ÕŒ0´k0ã„<$EšÇi‡öÝŽy””`a—Ýí½½·mm�5×n¶ôð<Î3köo)pÏL#ae‚ľTJ§úúlí*%Hs£ÖGBb>“‚"ÂØ9åàËÞø(Öñµ=ª½À£BŽs i<†|ðF]iúË�ÎÈЧ¥d@}޾@˜øÞL‚ÄÒcÞ(GZ¶QCÏì Ђ¸ ©ïkŽ+ðYWƒ$SY”L³mP#|Û;%ØCWÚÀŽ—†¿åðTÏ�† Šçß” wiø¬’?5œgÊü4ðÅ|Ëú`<—¦•v9�T‹¿©[âÖËdj.Ü47G¯ÜÏk](?§Fž-£8Q™öãªÿåöa³ó?*Ïu½¾ýçÍæþáfÕ�Ä^šAÆE±@Ôó@ÙX‚ž\Ây:™qøe{ÁPíCºÖÊóC…¶)˜�(a¼'EïÈÔ9Þj�uƒÊT^AWyOi)‡À±sa,hÇB®œôuZè Ã�ÿ€†�[Ïêý³v/Üê¾Ï¥ý’Â$ÕÛ\y^|µ€ï•…äEÜDÊ©vܰ,C K*ÊFÚ{zäp­󃙀ôדg=Vƒ_¶ 5:¤«”öi½ƒ¼_=�òXªNéJ2VÈL³nî¯ð)ò±oÎ+/^CyUÌŽ°3Õ‹…/Ûøî}ªŠù¶Ê³òÔž ›£Pïté{/‡:ÇŸ`Ê^o÷.öA´€Àß�ïœôÞÊ\_¯– §½xmä�¼²ZLtY GåƒÓmPƒ"î&˜»îý½qS>dÑA«ø7Ó¼4«H@/‰ô/É%Ušm–ˆK.ÆÂdwý§µµE_ŸLCcT)CõÌÄtHk£N‡4Aàl|ßD–u½Ã"Ü'�k”§ƒÛ˜An I§9^ëÕfÀ=(õ&Uà@#*èÚ'C„« Òf¼vÉ•{IQb€¥šNþÒKÁºµK…NêŒC�%•ϘNÚ° ]5°v¹Ö᫊¯³l-hȵ«(( ”t]®?Úè,—Ï©-Ùl;bkÁ}uØ@U·¶¢õ–Yà[òíR0‰ÍkÒ”ahä«bN¦–æuUØ×Õoú‚¦q£åMš¥­çD7âñw}š×hE$…jäßáñÄ]†:õ¨Ó‚Y5l�ùÙüÔVÁN]ÎŒžóÜ=#ºÕ„$Iz޼‘u}ýðƒkƒD_GÏé=̼à¯Y0X°B*ƒ¹»}Z߬îp5×O“ç*[ç*‡qÁCL@ AU-á‘s5Sƒ_¶Œ<•èž|½$`—DbÑ¡ïXêcp¨“h�±NÕ¢íײ޿Ûz—Ò’²Flq®Ã]Tïªo0ÎF¶I»Pm“èÈr�,Àš”I5\ꢤ’üYUðõ˨u¬ßÏß]¡£È*ÎdŽûa)>FéSÙOO†©N4˜ïOGð6êt'¬;`ÁûCø$÷c ² â ì/È9ýu á虎aOÄv ®¿´´þ߇ZFüÿ‡£úpó“²î/7�·«õÏ ß<¨ ö¢°ók·Ÿ6w7«~0Ó.ïNOMù^”Tª²O²§â¤‚”‡]Zmòº:ÔÝPÙÿ?”¨Lqô_Z vA¤�ÿÓ_¥ú¯^–ÖIZÁº=æë·N - ¹¤�(j÷“,)T†e-sÿôÚÆgujÛ!Ô~ñeWîRSŒ¥�¯ÊŒò¢›¿��f?ä~M²±W’-ýÓÛ[ˆendstream -endobj -2074 0 obj << -/Type /Page -/Contents 2075 0 R -/Resources 2073 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2072 0 R -/Annots [ 2078 0 R 2079 0 R 2080 0 R 2081 0 R 2082 0 R 2083 0 R 2084 0 R 2087 0 R ] ->> endobj -2078 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7506 726.9434 195.0552 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2079 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [257.8193 726.9434 315.7315 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2080 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [359.1284 726.9434 384.9216 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2081 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [317.5642 648.9799 374.8887 659.8838] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -2082 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.2809 603.5654 239.2097 614.4693] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -2083 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [472.3426 591.6102 513.9963 602.5142] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -2084 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [117.5067 579.6551 147.7231 590.559] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -2087 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 227.4529 152.1568 238.332] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2076 0 obj << -/D [2074 0 R /XYZ 90 757.9346 null] ->> endobj -2077 0 obj << -/D [2074 0 R /XYZ 90 739.9346 null] ->> endobj -1991 0 obj << -/D [2074 0 R /XYZ 286.4315 370.591 null] ->> endobj -2085 0 obj << -/D [2074 0 R /XYZ 90 354.6099 null] ->> endobj -679 0 obj << -/D [2074 0 R /XYZ 224.9827 261.9201 null] ->> endobj -2086 0 obj << -/D [2074 0 R /XYZ 90 246.9153 null] ->> endobj -1995 0 obj << -/D [2074 0 R /XYZ 300.8374 96.348 null] ->> endobj -2073 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F52 1229 0 R /F23 482 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2090 0 obj << -/Length 2121 -/Filter /FlateDecode ->> -stream -xÚ­Y[�ã¶~ϯÈclT],[ÚóÔ{wÑîÎÙÉyj‹�“(3Æ&vêKg§¿þP×X¶“LÑb0ˆ,Q$ERI›Ì1ü‘¹ÄóŒgH²$�o�3<„égÄ-¯`}Õ'øf=ûê*çÉ”¦óõÞpH â”Ðùz÷ë"Er¹¢/ÖOʺwwnæÛ»¯ü¸ióíçåŠáD¤‹T._¿Ÿ}¿‚�^œ¥D‹ýcöëïx¾ýÞÏ0bRðù3<`D¤¤óã,¡Ì?f÷³ÿ>vÁl˜:'ì5ç£ð˜…ã!†²åŠ`Œ. ^TÅδ8=ЦU¥}þ s<<‘1žžF+½P?:ŠO=ý<õªG>VqÈSëÙ‘ô¡ -§D"Âᤑô�MÑH(§=¡””&œEROUm„LQŠ3ü5˜…8"Ö#Z‘D Ê©8Ä“4Ä÷m,�9­i‹òÑ>¶•ûõq֜Զø cªœ?´6hhÁ&"›§)Es9iO´êS� /$˜¯,A"%Ähü¡jÕÛ‘Û1E£äºØ@5!·o*‚3”ÆÏÜŒ©Šr ¦`LÛ¤h`Dåbߕ۶¨J;¯–„/¾€�Z·lŒ§WŒç̨ìŽUÛåÂí+UûlB½þl6/­ÛXÕ; Nðâ <'r‘Ûé-ˆLÌá U7Aƒ®ÑX'Éxš ¬sñZúvóÕvúi½$bññý¾Ÿ>ûêpLPB²äº³Õ %8NP†#%ªz"Þ©#Éqv <ýª¿áZ°x2-ÿ©­Êæ’€1cU†Ñê©n)ÀJàZGòu|ê;Zª­jš¼~Y¦|qù²ØHJ¢uåÒö¨­:€x€Q˜@w}=•�ËÝÚ&?­]tcýÿŸKªqA#ìŽô©.ã— ÑTZ¹Ó.¯ó£já]F”)® ËH“ÕC°²>¬Gòi‚.‰?‹uDç�"RÃ0IýÚFIW›¢=#º‹‡Rz\”>–z(¥',Jé‘E)îBl¾bNàŠAéB¤0¿S:{”…ÅK½-©§tŒ /9Ž{Ÿä1=¨P ­•uÉPJ“İþ¤öªV€Ï.ìÿ÷îîáçw÷ëï?Ü}ü´L¡6ºìcñ¾�?‘ý}R‡CõàN{Ø= µ¿ÍoIÛž&òÒ1kÕLÓ ‰ô :ÁÆÒùÅ–@âb Ô(/@3…DÐ8+R#‚$ýH2@j_"`f©¢èÌP…†%Ùåm>Uj˜øõ|Þøi'¸A�ƒ¥ðüPµM°3׿FáBáYB]Ý"\6V0šÚ˜)%˶«Á»Î<`)@C|“!´69�f´—Óõ“Ÿí$02•ü:GÀ¨êZ;ÈÝ -$a´*�£�VM¼·¿P®Û�>‚ô�¥‹�åáÅq:�Å6×z8Ú§ÜqxÊ—Ôç~;³QÊ«ëê ¨>ë€P»pZdÎm%é=4ûÊÝvµ¤Üñö–;Õ•Î"¡4ÜæÎÐMä„ÉfÚÈ�«N3Ôcm¨¨�ëôŒ=œ¡Û¶]~ÐfÐO¦ÎÊF…½�'Ü·¦ŽÒCû³…}–\»È²µ ¸qª­’z\wû�>;;¿yñÛœÒÇüKqìŽS ç!Äž‡øPÔ3ƹz -Tª´EŸpq"©µ¸^y.Œ¶@œwmuWoݹaq[W'»hu‰˜7•�qFÓ -”~£#':€€G]ä­Û?PxâHî& lƒ^·:4¥tý&Ì…ë1ÑzABç,“H`Á^Ñ|úUÃDöñõű¹XbQ(ž>RfØ‹yª*PÀgÀ‰4VÁ^°ÈÆYÆC„´3tª~q‹æ¦ Ó2×èï=6è ª²Ü­�¯†~²ñã䛬k:<­¦óª-t¬/”WŒ -5&»^^õ©.—W,Á�dE›vU치Ë�¬¼YÇ)îã8<í*S¹(«ÖN=vPÿ•­RöÑšúƒfI ÒàLOuYgÀts­•¸ìTÓenSÏŠAV·r¼a—×þP5NnQž‰£[kýÛ+Ët�HÓ3dô’Ès6Žd*_‚ç¢}:CÊÀ‘0�¨ÈÀç$….MÜzÑèWý c—Žùú»^ÛÞúx.¥F:¥%ʃX§Apª[š¤ q íK¤É 9jël”É‹—Uk@ž¸¬gQxÂæ¶RΑȉ1Œí’ë Ë÷^ÉÔêœxC­s.ƒºs¦¶ùÏäww."Õí3½õ¦Ou ¨~a#þ^Ÿ5%ÿ -4Œ™î³Y¿¦�û,HÐ^? š0@Ü‹Cta–Hî×¾»‚BÙ7U£×kgÿ=?Û'WY71õF…ÂkŒégS&P0§LÜ@×>Ù5z²^[Μp~C¬§‹ôªÆÒ"^vû‚ÌvZ>oöúųuwzË|€NÜßîT‰âßhUMK0¡v�f Lþê®Q^éÛâTì.¿9§#!¡#> endobj -2093 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.3577 726.9434 220.1509 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2094 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [460.7601 659.7528 502.4137 682.7215] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -2095 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 647.7976 136.9336 658.7016] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -2097 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.6109 376.6552 236.4535 387.5592] -/Subtype /Link -/A << /S /GoTo /D (a00147_gb5fecbc62edd128012cea0f47b57ab9f) >> ->> endobj -2098 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [309.2914 313.2651 361.4951 324.169] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -2100 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.8969 154.1071 225.6901 164.9862] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2091 0 obj << -/D [2089 0 R /XYZ 90 757.9346 null] ->> endobj -2092 0 obj << -/D [2089 0 R /XYZ 90 739.9346 null] ->> endobj -1997 0 obj << -/D [2089 0 R /XYZ 350.0021 514.5454 null] ->> endobj -2096 0 obj << -/D [2089 0 R /XYZ 90 491.9191 null] ->> endobj -1990 0 obj << -/D [2089 0 R /XYZ 247.4281 195.2196 null] ->> endobj -2099 0 obj << -/D [2089 0 R /XYZ 90 172.5933 null] ->> endobj -680 0 obj << -/D [2089 0 R /XYZ 225.6001 96.348 null] ->> endobj -2088 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2103 0 obj << -/Length 1978 -/Filter /FlateDecode ->> -stream -xÚ½YYoÜÈ~Ÿ_1y F�¦Ó'ÉÖ"/±÷°±k{íñÓîB HJ˜CNxØkùï[}qØ<¥$X›Í¯«ª««ë²ÅðG¶oC"Éx°MN¼}€éï7Ä~ÞÃ÷}ðÏÃæïßQ¹•H4Øî5…€ A ÝÒ_v!¾ÚÓ‡x×¾zC�wa3ø©LÛ<3ã—eÒž²¢‰›cY\ývx½ùöÐñµb Åõ_›_~ÃÛÄ{½ÁˆÉHl¿À FDJº=m8eî%ß|ØüÜÑ1ô‚©Ý ž²= -¯¡Ù]€$bˆà¡À„QÄ8¨À�5;õ¥z°�÷=Æ|ßÃ�™�¨*ZÜ6#þ"@„éól·­p ->×ãù¶IÎÉ㧺=™ü üùŠà]yLaL”L@ŠõHíKjO9ìDZ/â‘@˜Dá6à >i>´ï£ÆæI„1ZB �Ã@‹ó>kÚJm®¨oF¶‹) -%ËÜ;Ôû¾É¢�0q¡v9àgØX‡ë�ÉS­í\á¼íKSšçÝ×ST†¨Vw„ëF_šó;jïhÈ[þù±°2²€ûÒ«%ο” Œ�Û³¸Ïª¬H²Ú ?¾zwûîýÇ»·êßáŠD»··J„�Ý2‰t¼¹úœ›Û²mÎm£\„r Èú†¾�IF€$ë;Vr�AëMÕ&^N¢�Fd çŠh ùš›uø}Á”ÇÒu.¯MÏ·p{GŠR ŽM%Øl‡ó'¼ÇLMñ‡Ódz ŸŒ=‹ìËÅ'�d•ž1�žªµ¿¢µ1]'Òñ§i5ŽRŒƒð®ä¢Ö:ÔŠÖ ž IجÖÀNk­2òMè–aĹw=’_R OÔd‡_Ñä˜îl ç$@�e‹*ìPcÆžV €d†QŸqu.«fB;`¥<‚l=òÕ±ˆ( .æ�þà‚u{¶îÌ<À—Q±³Öûñ¥sÎpå²Dù¾I÷sxÔ™±Ý}[$ÖE2 -¾º±óš ŸŽöÑf ¸{b¢õ–AÚØ¡FAj@¡Æß¸«)¸ÐH›ˆhÌ0!ØJ�1iO Æä¡^ð7ýÅ2íÍ'ߨlƒ¥*Ý#’àM}yÔ¹þU ® O"é5 ¢kø¯Ž{JÄÄ ÿá )Á�Ö‡·o>¨IBŠÜÉ㽂Y±”ß|üñGmrúíßFH€¼µÃ[›Lqç>÷ý�ÿÌY‡Î8—‹”>j¾Hapá™æž¿SEe\ŧ .ùB�2%ÀB½2’Ä Á]½ÒÁ)Šßfˆ$«Ë*p  xwê#Â1ów…’kÞ(1²ºž)“ªìTº:¢Iƒæ•Æ`Îøçž²z°%e9˜—¯xŒ)hAl…±C�ûÊb ¬ŠY�ñaJ 6àªÜ¦=ÝéhÑ«‹¬ù¢{&Õ'W:¹…e¥jz!v³å9ÕQ‰ÒeËï£,Ÿ`DeÈŸ^ž/r¿œà˜ýdyÞÁœ"GçÎU®ó¥ž…¯±R]+ôHûÂteó´ÆŽüyès7¦­¬˜T°Ǽù’ -:£1O圭¥Ù;Z”Ó+’²Í]Ùn9¸ÖÅliå|vG‚‡ìÿÑ‘xlÊ¢vÎõ¥µàéæ&W·lâËÄT}=hϨ~Ô·/Þ¾yóáYí p„eþYQ½vgƒÎ¶Œ)\ ,äÓ{Æý Mã¶Þ5öE˜m¯0v}cŸ±9Šÿ±qLÇ—ºñÏk÷ûŠP7tQÕ‰oºN…gW×õǪ$óÀZ^xÚÆ±"vi÷¾7#¦~ãØÔ€©ùd)ù�ã‰Ô¥ñ �c8“¹ÈD(F¡�l92õQó‘IpHø3"Ó"÷Kd³ŸŒLÌ ñOµ±÷§7ŽÙjkö\•àckÏw v#p×Ãɪƒ²H`JÅÿú9]ùF°N¹oà%Cé^¨Ÿð€v¢¨]}ŸYwºqè'7x­tÝÚðµæ‰o(»¡öÇGŠq`C¬Š§.pŽ¥t{Yþþõ!eêGà -ýÍWìaendstream -endobj -2102 0 obj << -/Type /Page -/Contents 2103 0 R -/Resources 2101 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2072 0 R -/Annots [ 2106 0 R 2108 0 R 2109 0 R 2110 0 R 2111 0 R 2112 0 R 2113 0 R 2115 0 R ] ->> endobj -2106 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 726.9533 157.1381 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2108 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.7319 549.2408 221.6354 560.1299] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -2109 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [290.5065 549.2408 348.4187 560.1299] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -2110 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [391.8156 549.2408 417.6088 560.1299] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2111 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [393.7656 495.1877 457.7454 506.0916] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga20812098a4663c8a9fc4ce8e95391b6) >> ->> endobj -2112 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 483.2325 151.6186 494.1364] -/Subtype /Link -/A << /S /GoTo /D (a00147_g79c4110211247df3fb30b8cf1c4c02af) >> ->> endobj -2113 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [124.6997 295.1891 183.6983 318.1579] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -2115 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 204.0406 157.1381 214.9197] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2104 0 obj << -/D [2102 0 R /XYZ 90 757.9346 null] ->> endobj -2105 0 obj << -/D [2102 0 R /XYZ 90 739.9346 null] ->> endobj -1993 0 obj << -/D [2102 0 R /XYZ 224.7534 583.8924 null] ->> endobj -2107 0 obj << -/D [2102 0 R /XYZ 90 567.737 null] ->> endobj -1989 0 obj << -/D [2102 0 R /XYZ 206.4623 238.6822 null] ->> endobj -2114 0 obj << -/D [2102 0 R /XYZ 90 222.5267 null] ->> endobj -1994 0 obj << -/D [2102 0 R /XYZ 207.0201 96.348 null] ->> endobj -2101 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F52 1229 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2118 0 obj << -/Length 2118 -/Filter /FlateDecode ->> -stream -xÚÝZm�Û6þ¾¿Âm4fù¦¦Ÿ®—m³A.ÝfÝ; i°ÐÚô®P[r%9›Ü¯ïP|1%Ê’ïz@qE°0Eg‡Ï ¥�†d&ð,‰$�gëýž=B÷÷WÄ /a|é |»ºúú;*f‰˜Æ³Õ¶ÕQBg«Í‡yŒÄbI#<_=IÝ8ÞÜšž¿ß~mÛu“­],æiÈuþ ÆTšMQhPßi„0I“Y „A}`…–¾Tèù1])A˜�Ëàwe#_ö­LQÂ(7ë¤ìú®"|OXtÒÖz*/Öà -Æ”OòZTÌ·ÇbÝäe¡ûå‚DóÏà§Æ ·ÎS#íε­â¸�•ÎͼB6Ïm¼W¿ê�‡/�™XV�æxþž¹˜gº{ &y{J¢¹¬j‡àX« ìy‡�$QÌ{Þ9{0œü„ŸB½ÊO¯W ’Îxw§Ž¨ FN„Õ�Jøøf9© æpP€#; Ê* »©ÀJêŒûÀ‰/=ù±P1RÊøSSõ¹Õƒ0�bº8ú‘j…&¬³qšvŒ«ÈT§³�kY×YõeGóóÇ”1„Ó”ù(FŽ«'­Ñ+;aÒ:lDªÎ •j‰Òcnå’×+iëõ÷Í9p‘HOø‡øR#‚¸Ê�Þ­:lY•íe‡ç<› a•I‡Ñ]¨81ŸÒ;öAŸ12k„Öß H CWÇêßtŒ�xù�7'67‘cJµóÂF“ÇPªC3”ji†ŠL�Í–Ì\ÒŠ—XGå+©2G‘k®TӲƦ�Â(ŠHj4nmŽÇt']€ÖÚTN$A1åZõ{¹••n6�ÿÓÍíýÛ›»Õõ»ÛÞ/b¨Žî�Kš�ËEÛž5¨åênŠ�.…øÈ³kþU¹>îeÑdíÂŒ»YµU†H¿–içî³W¥‰]êÆ,†ˆ©ŽgΗH1E\V~éOF¨××ìpØdMT78†ø%IH¿¼±RæY·úã †]LS}$˼hlÔµ@Úåëì=-ÀN„:ÙƒªÁáÒØÃ‚Bøl4šoý@í…ѪÍé4V'ÁAúÁ hX&««Ž,aaÁÐó“,¦¤­Áu¶ÛÉ R<�ßl�1½Ñ›¦Tçõ“v¡!A_-‹�[Uãú +@/¦œ¹Ï¾˜CVK+kÓH î”Ý]y®òFötúûaå䶬̸Zâ@eÂV†ÀàJ<.ØDp;ù¥?!Œ®P¯ nå¨s©™CÖÅŠS»hzî¤&0„ÚK’Ü*ñcð–„«ÃbÉ�åïÓÍêP•ªV°n1ñ’Þ嫆�iîËcs86V ó £:ãžx�þOyÊ"”ˆ8½˜ý #<èÄ.åÁ.�³<šïñ d ÄyÿÙ<Èþ’ðûTîLO^¬Ë½þ´3tC7Äíciº™²V5 &'û© ~ÊÛ 4lª¼íЯ¿µLýT­½ÃNWk¾é3·c�©­Ö eJ>h 9iIE4ÿ—®iADUQ?<Ø“ĦT}>põÜ®”XàЮd¶±8Ì õÎ 'ó�<ÍÝéÁ'�—•¬ýêÏ5 -âÓD‡mUîûïàêñ>?Öù¿e—ò\l0«V3tuL[së²P„ùx¬úLè”¶/öÞ¾¾{ýÎÛš–åÙZ’à1¨=ÇkI_ê|-I(F4Jù¡FÍž^‡vkD'æmqöÊ­BjB«ltãÁÌjÏ…Ìݽ,7—¨Þ–ë�N4&óºsáSÆü°VÏý°†¾ý±6ÖMP+›¦Çœ§RÙ�HÕ×ÐM÷î‡a7ï³½‹tf£m·TUÖœ ²m¹Û•j-ÏîK¨þª×^^}N'ˆ¨ÛûÀfcØOGñúÒÞþW¨Yé†(äðD¥ó­B9ì{YHo‰¶dù‡m¼Që9šBÍ/~IÙKŠõÅ86þP¾(«^>!wý÷ªüüåQÁ§>†üó;‰'¼Cendstream -endobj -2117 0 obj << -/Type /Page -/Contents 2118 0 R -/Resources 2116 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2072 0 R -/Annots [ 2121 0 R 2122 0 R 2123 0 R 2126 0 R 2127 0 R 2129 0 R 2130 0 R 2131 0 R 2132 0 R 2133 0 R 2134 0 R 2136 0 R 2137 0 R ] ->> endobj -2121 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [210.4174 726.9434 236.2105 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2122 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [460.7601 665.9261 502.4137 688.8948] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -2123 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 653.9709 136.9336 664.8748] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -2126 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.0073 491.9593 207.708 502.8384] -/Subtype /Link -/A << /S /GoTo /D (a00150_g561b8eda32e059d4e7397f776268cc63) >> ->> endobj -2127 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [391.426 437.8962 436.0284 448.8001] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -2129 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.0073 370.7781 207.708 381.6572] -/Subtype /Link -/A << /S /GoTo /D (a00150_g561b8eda32e059d4e7397f776268cc63) >> ->> endobj -2130 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [391.426 316.715 436.0284 327.6189] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -2131 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 281.9517 139.4144 304.9205] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -2132 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 281.9517 175.0106 304.9205] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2133 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [177.9994 281.9517 214.0238 304.9205] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2134 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [233.8893 281.9517 281.53 304.9205] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -2136 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 207.7121 147.1755 218.5912] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2137 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [147.6736 207.7121 182.6919 218.5912] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -2119 0 obj << -/D [2117 0 R /XYZ 90 757.9346 null] ->> endobj -2120 0 obj << -/D [2117 0 R /XYZ 90 739.9346 null] ->> endobj -2124 0 obj << -/D [2117 0 R /XYZ 90 537.7634 null] ->> endobj -1998 0 obj << -/D [2117 0 R /XYZ 90 512.4589 null] ->> endobj -2125 0 obj << -/D [2117 0 R /XYZ 90 512.4589 null] ->> endobj -2128 0 obj << -/D [2117 0 R /XYZ 90 389.2643 null] ->> endobj -1453 0 obj << -/D [2117 0 R /XYZ 300.8374 242.7345 null] ->> endobj -2135 0 obj << -/D [2117 0 R /XYZ 90 226.1983 null] ->> endobj -2116 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2140 0 obj << -/Length 1602 -/Filter /FlateDecode ->> -stream -xÚÕY[oÛ6~÷¯ÐÓ`cË»Än{ÙÚµ Ú!ë<ì¡-EV¡ŠäYrÒbØß¡HʺEr»lÃP¤¦Èsç9ß!%âaøG<…½@H1.½øf�½-L?_»ìúß&ø~½xü#UžBJRé­¯j ’ A õÖ›·Ë€®|â//Ïa(ð’ l¯‹Í!KÌøin’¼Šª´ÈWï×g‹gëF¯5K0I´Ößoßcoæ�-0b*Þ<`D”¢ÞÍ‚Sæ²Å/‹Ÿ9f¡f󎌨 Bϧ�q¨E5 &˜¢€Q -¡à@�‘ð˜è€BWBxŽJGå¶H7ÚI�ä+Ä%õô&¹Mãd³Oo“ýE™ä›wX`M ¿d„þ�zŽpÛA;+×wŽý«Cº»¸<\½Åï­|‰ñò×—ç¯^½¸xõì'-÷›Áé•fÕœY’®o¿p›‰¯�óëÎáÿV°™76*$$Ÿ5±%ÛÛ±ÁŸpÀQñ§¡O²2yc†>Žï(K‹Šv»MTE3î¥~©§õÊX*ÔK�”¬U¥>µI µ‰(ÇAMù4y‡1ÍÓº몌*󛥹­S”WæW³¸"ïPŒ\HH€$å¼ý&¹JöIÉm(/?5»}'e©¦�DÖÞ6ª€4Æ „)‰À?ÄWPƒ¤²Úâª�DppzBHDCi‹Y/í·–æM»œ½ßfÜP®¶Hûù¹ˆâ Õ3¢�$–h¨™ð¶æ¾,­ÂÏúJ)fäTÏùŒã©S~CN¡�lè9ÞP�¨fݦš!ì„ÕZÏ‹4¯’½I¡ª°¿×6 ãÃRÍf.–�+“X§v/A�È5p÷÷ЇTxÊŠ�`.�¹ß¢ú2�:™>\ ,ëšÐOG4£˜CLuïÚ‘Œ#[ö—®žKW¯.ÈQ¬Kõ‹î «¿ 'aŽd�9Ö¸ÏÆqæpØ©ØÉ�Ó¢Ÿ@Gu -àt,¸oújG᦭u -mNó¹›I—û2O‚š)—�H3ÐÛN ‚R hø,ÐpÌàäÌøÉHÓf˜€š†ì$¬éZq/ØÌèvhÓÑýïÁMÛ³L&aà1 ˆpÔ1Gä·©†™*5²€È'íÕ³�ÑÍ.KÊ'Ã�­¯dR3‡=‚ÂÃ'lz@˜3°¿é5]CVŸI“,+ü»ÝgL…K†ö:#G4gB_–¶àÑP£@JAUtUÞG?«½/W«/oªÝˆ×ŠÂ±Cð·Õœæ�4ã¸Iå|3@.݈9;9 ýŒC¹ÚŽ»ä2ÎR(œa¨P(PDN‡¡¡šS?�¦ÕÛC‘N•3Ìþ�§9È# &”ò¨Â.^j.—½ßfiý¹5‚y1rö€¾%±è™ÐÝC}ëƒËÞ,Ö†¤ tÖµšuCRî²´ºG!?»U§] …û‰b§ßÛ WƆÌsYE�5#Ç {ÔµâËZ‡p.†òœ…ŽnÔÂÁ…©Ap9i¡ßP�èîõ%@Eº›p§xìÆÚš´¬Ò¸Dc_%ê»âèË-ÐýXÈ¿õÁ¢þà a´GÈ­€…ÚžýÊ×™¢]zžäÉ>ª\-¸b{íghö�Pû‹ŸPö„Úo3ciF5þû^Œš�8®Ðž?m‡]_À=`$J!%2endstream -endobj -2139 0 obj << -/Type /Page -/Contents 2140 0 R -/Resources 2138 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2072 0 R -/Annots [ 2143 0 R 2144 0 R 2145 0 R 2147 0 R 2148 0 R 2149 0 R 2150 0 R 2151 0 R 2152 0 R 2154 0 R 2155 0 R 2157 0 R 2158 0 R ] ->> endobj -2143 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7506 553.2679 195.0552 564.147] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2144 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [200.5347 553.2679 241.8394 564.147] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2145 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.9862 510.9639 146.0595 521.8678] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2147 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7506 442.6743 195.0552 453.5535] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2148 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [200.5347 442.6743 241.8394 453.5535] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2149 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.9862 400.3703 146.0595 411.2742] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2150 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 364.3227 162.0093 387.2914] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2151 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.9981 364.3227 193.2816 387.2914] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2152 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [213.1471 364.3227 260.7879 387.2914] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -2154 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.3636 287.6273 152.1568 298.5064] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2155 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.6549 287.6273 186.2086 298.5064] -/Subtype /Link -/A << /S /GoTo /D (a00150_g12a33f0c09711167bdf3dd7d7cf8c5a1) >> ->> endobj -2157 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7506 117.8746 193.9393 128.7537] -/Subtype /Link -/A << /S /GoTo /D (a00093) >> ->> endobj -2158 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.4374 117.8746 230.7508 128.7537] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9ee50a40597e67fce96541ab56c3b712) >> ->> endobj -2141 0 obj << -/D [2139 0 R /XYZ 90 757.9346 null] ->> endobj -1999 0 obj << -/D [2139 0 R /XYZ 207.0201 589.4618 null] ->> endobj -2142 0 obj << -/D [2139 0 R /XYZ 90 571.7541 null] ->> endobj -2146 0 obj << -/D [2139 0 R /XYZ 90 461.1605 null] ->> endobj -1755 0 obj << -/D [2139 0 R /XYZ 208.1261 323.8211 null] ->> endobj -2153 0 obj << -/D [2139 0 R /XYZ 90 306.1135 null] ->> endobj -2000 0 obj << -/D [2139 0 R /XYZ 368.3438 154.0685 null] ->> endobj -2156 0 obj << -/D [2139 0 R /XYZ 90 136.3608 null] ->> endobj -2138 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2161 0 obj << -/Length 368 -/Filter /FlateDecode ->> -stream -xÚ¥R[o‚0~ï¯è#†�ð1mz¼ ͪA/ëç—Í„–Y¸ÞO–wò”fQ:Èþ‹•:«ê,2½ÃÒdomÝZ×–IL®ôúxD2×m×zI6:–GIÜå¯ÏfJvx?”E”TÕTÿ@Ƹ®7zTsRÈ=C{G¾.ήÏH‹Çýžf³Dƒg–äIÖ=œÂùÔ+s„u40#é”ñ)£�Å(•�¶i¦(¼¡¿¹º+¾ÏÛ$ÒÓÜÈ??°}¼~endstream -endobj -2160 0 obj << -/Type /Page -/Contents 2161 0 R -/Resources 2159 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2163 0 R ->> endobj -2162 0 obj << -/D [2160 0 R /XYZ 90 757.9346 null] ->> endobj -2159 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2166 0 obj << -/Length 2324 -/Filter /FlateDecode ->> -stream -xÚ­ZY¯Û6~¿¿Â�6P³\%2oÓdRL€23ó’…,Ë×ÂÈ–+ËIï¿ïá&ÑÚèL -?XËáÙÏGRd…áGV -¯R‘"Åx²ÊOOxõ�~"îõÞoC‚ŸžŸ~|OÕJ!•Ðdõ|0‚%tõ¼ÿ´NùfK%Nñúö��p)ðš l/~©÷·ª°×ïêüv*ÎmÖ–õyóùùÃÓߟ;¹N-Á¢¥þþôé3^íA½O1%Åê+Ü`D”¢«Ó§ÌßTOÿyúWÇǾ0¦¬„M›G8‚'ÔÛGÁÜÔš— ÆŒñúo͆Èu~,Û"ooæÆÙv½yù+Æ4·÷�'·s®í½jƒ­$‚”F¸Z ¢²—„ˆ“õ®h³²*öÎwÅ5oÊ‹÷0bAD4­¿²|ž�ÅP¸¹-Ïö¿õﳦ³eÆŽS¿òt© -Àoj~,òÿ96·““pv0ºÝ•nd¶ß—F-¤mÑÚ“%”³^{†‰á«ÿ _ÃÑÜeU~«l™åUÿS«�~pª¯­£­O—›Í·¬ª^íÃbCÄú�Kq¾–*Ö_ô­Y_Š&äìþ;ÎÏo?þhµ¢ëk›ikõcc¤Ðvù ƒA0¼)µq1SëKöªãÁñº>höq[Û‡ÚËÐÒ9škGk5� <)Ì@¦Ò’ÁËìz-N»ªh6B¬‘V(q™#.·æR_�õÁ3vnåe«sÁÞu1×Ú\íà¿*Ú~ì„­}¬&òÏ0�ÿÝ0¡|–û�çåÀØéÚba®¸Qì=ÔÒutD - 3‡ C aåœ Î$ïùha¿R*†²Ö•.زĎ*&ðJá$ÈUÅH2T¡j(Y¿j^Í¿C<}L‡_­äÒo:~è8Ò#¥ˆ'8â�D ª$ S…UH4á®@í­H(‚)¨‡t�W4M¸ÑP§J®:2­é»"¯²F—$©)“ƒ–®sýºÃ{x0“�]¦£qÜ­ŠB$¹L´' î¦¨>¹uâf¦Ê!þûp–d8WàQ™²Ù  2¼#‹fø¢Ä>Ã#r}†ßÉý²¡¢r?Îq &D d/丣�i1âÛåø~Ïè8ÅX7°$âOž*(ήÇ�äJŠRIäÃæ{ú˜#¾Æ|ù[;Ô€bŒ€(üŽj,—ð@.Å@¨¡å˜M¬~ BFcCS_ýa¤ƒ²O™zÔ=}Ä=c¾Æ=$™ð�H$PÐËþñT1ÁB",Ô 3ê I ;Èq©½�ø…Ô �Ú‘i ÞfMóêpôæW{ó ÀY°ä‰‚V Ëš:E 䨒|ßD‚ H$†ož,ŽoáD“ŒÐ‚Ä -У[L»Cí&3Œ0XDcÂÕƒXá4®Ç+J¢êyº{õó£YŽpJêIkQÅ­'ŠÉVR_¥ƒÀM¡£âàhçîÅÎ[ïé£ ùΗ?$+t ˆ{¢±Ø{p$ -üCG†Ïƒ#sà¸Ó³çí0ÆG8Æö¨ƒ:úˆƒÆ|çë>Á‰xÈSÅ'€�àÎ{ÁUq^„G ,.ɃðP/Á£'³ðh{×bØAC Ôœ ‡ŽvÍYä:X}/Uo^�†'UP½q€W„�õ<¦Âr]IX0þ%˜J$" -˦z²8¦ ¿S—µë05Ô.‚© ê};¦.«×aê�z€©åeUU‚×°º å¶£ŠÉW�º‹AðWýâ{±ˆ0CL©Û¶�z©ˆ<Ùb¹m¨c‘í}™Ì”Òa0ô’Y -]b¾ -C6~_B¡+91_jLANpò—Tƒ& á4‰TZG­´�áwWZD;Ow§Ýr¥-©÷Í•QÏÓÝ«Anó™RÓ ´ntQÍmGQ€B^óú‡ûè=Xj,áH -òàŽBH½PjÙR©=¿ýøÝõ5US÷[Ʀ˾\öY›ÍWš`æ4ù êé]k+É™í§þ»Qt�5e¶›Þ;¤ -ÖkŒÌ×nH°P»Y´v—$~síF´ótwÚMµþºà„b²¨Ý£¥Ë"朘vžî^;�1y>½/ƒE¢–CÖQÅ„§fÒtàšOüó\–RIa�eiH½P©™η»×¶;Õ±›š®¿]ýöú¡n…6å×â÷[qÎÝ›óí´ëfÑþÈe~“¦ I’m ¨§+‘2}HI2FÝɘßìœ9UœVvgc!§î”틆$½ŸØ#ŽÙ×3·S½¤†ì$h§„!"£;Iž|Ð��TG\g·Ù(’¤â^üpúñD#¡÷}$øÅÌR¡Ð¾�„Hô´)âÐçö[lŽ&£<ѸÇP+‚ÈGçÉ#Žr�o0%ADP¾ì9O4’zç *!\œ‘;©z÷-ê?Ÿň‰>ö“õÿÙNë�S-,ýTäÙÍœü ²>×­½ÈªJ_л£¶«}ç`‚¬¿Ks&—î<Ûž¶êq%´¬ç½E²>fnìÊ0J‚ö,q+"íe¿*½´{õkŒ?^_ŠÑ7Kúc¢ /ý õ6oendstream -endobj -2165 0 obj << -/Type /Page -/Contents 2166 0 R -/Resources 2164 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2163 0 R -/Annots [ 2170 0 R 2172 0 R 2173 0 R 2174 0 R 2175 0 R 2176 0 R 2177 0 R 2178 0 R 2179 0 R 2180 0 R 2181 0 R 2182 0 R 2185 0 R 2186 0 R 2190 0 R 2191 0 R ] ->> endobj -2170 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 574.4454 173.4566 585.3494] -/Subtype /Link -/A << /S /GoTo /D (a00137) >> ->> endobj -2172 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 492.1342 177.9699 503.0381] -/Subtype /Link -/A << /S /GoTo /D (a00151_g6832e4d2d046536b6472f7ac92340f68) >> ->> endobj -2173 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7856 492.1342 201.4916 503.0381] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2174 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [231.8776 492.1342 256.5649 503.0381] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2175 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 453.586 138.5977 464.4899] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2176 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 453.586 189.7953 464.4899] -/Subtype /Link -/A << /S /GoTo /D (a00151_gb6683dd83fe1c8de9a24086d4b69e907) >> ->> endobj -2177 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.6109 453.586 218.2983 464.4899] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2178 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [241.84 453.586 266.5273 464.4899] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2179 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 415.0378 138.5977 425.9417] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2180 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 415.0378 197.5461 425.9417] -/Subtype /Link -/A << /S /GoTo /D (a00151_g2addf34c7d457c1a7899a7e2171ef1e9) >> ->> endobj -2181 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 376.4895 138.5977 387.3935] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2182 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 376.4895 201.9695 387.3935] -/Subtype /Link -/A << /S /GoTo /D (a00151_g85b65e38aa74eba18979156f97a94a87) >> ->> endobj -2185 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 294.1783 133.6164 305.0822] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2186 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 294.1783 177.0532 305.0822] -/Subtype /Link -/A << /S /GoTo /D (a00151_g2a0cf5d86c58fab216414ce59bf1fea1) >> ->> endobj -2190 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.6669 210.1544 223.4788 221.0435] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2191 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [256.3555 210.1544 282.1487 221.0435] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2167 0 obj << -/D [2165 0 R /XYZ 90 757.9346 null] ->> endobj -1777 0 obj << -/D [2165 0 R /XYZ 90 739.9346 null] ->> endobj -118 0 obj << -/D [2165 0 R /XYZ 90 739.9346 null] ->> endobj -2168 0 obj << -/D [2165 0 R /XYZ 90 716.7484 null] ->> endobj -2169 0 obj << -/D [2165 0 R /XYZ 90 593.2423 null] ->> endobj -2171 0 obj << -/D [2165 0 R /XYZ 90 510.9311 null] ->> endobj -2183 0 obj << -/D [2165 0 R /XYZ 90 312.9752 null] ->> endobj -2184 0 obj << -/D [2165 0 R /XYZ 90 312.9752 null] ->> endobj -2187 0 obj << -/D [2165 0 R /XYZ 90 257.149 null] ->> endobj -2188 0 obj << -/D [2165 0 R /XYZ 90 230.664 null] ->> endobj -2189 0 obj << -/D [2165 0 R /XYZ 90 230.664 null] ->> endobj -2164 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2197 0 obj << -/Length 1763 -/Filter /FlateDecode ->> -stream -xÚÅY[�ÓF~ϯÈ[³™ÎÝ6o -©]òy�Ù�Eb§¶Ýß3žKÆ×di«j¥õí›óŸû8d‰á�,¼ŒD„Æå2;,ðòn¿Yûx Ï×!à—Íâç×4Y&(‘T.7÷­I� „.7Û�+‰¾YS�W/ª¯²]Þ¨¬9µÊ<©�*Ë?aL3s}zûÞœÜŸŠ¬ÉË¢†K.²ŠÄÍçͻů¯’ÕX0I´B.>~ÆË-hþn�Kb±ü‘$¡ËÂSæ.ö‹‹?¼ó ]0öâœÂKÇ„-×L¢˜$| „I��(A„:n£8A³h1†p„yk¨÷7¯Ò*=¨FUõóþ{LQÄ(]†¢�E€d&^:É!Q�¯!w7‚í~$ª39ipÏúËÅ2fW›Ðá/™p wÚ„ äªF̛С†Ä«ÐŠŠHd—x¯Š1Û´EÒšF§¥Å„Õ -‚&BqB¤ö"$HBZôËtŸ�ö©+?ÍΞ¼Õ­ -¾¹Êv*;‡p©«Ù7ýÏU4ÛEœ÷¨X݇U¬Wd6š„‘$ aíÈãHô³¼6ÇÆ€ãUY¨Ÿ´H{?+ǽ:@/3׺Î=o‰b¿0Ýï͉«Ýú¡íw[+DWnGâ^Œ DÒ‰Þ ïÿAY#ß¾~ �kØÝ|$(6±2;D…¨é!J´ÝŠE/55:‘yZ�áec-ÙÃŒëµ_ÙնD{·(]Ä�;\rýÒgvªªÖ‘úÂbíe¹Ž§ÇcBÔŠ 8Ç£µ°Zò‡�Ò¯:\ã¬U—#o&�Çc˜ZåÄÁ;/DM;�'ŸDO˜€É¨3îh2>ayX¯\w§,‚˜€p˜µ�G�¡IT"ƘìRÏ Á>Pz 9Q½¾ïòl×±NÅsáéî -ŠÊ©Q[4í!¢>—BØœñ,è]ÃcĹhjHÛ3¼@`—vãLüÍ®›ÿ¿å}úÑMì¾ÎÉç13©Ç Ì'vçu«Ú¹Xsy7Í8¼G=Z:-¨cõÙÆ|Á ®!õ^U7§–Oï6ˆˆX8·³É¹�Åb0�\=·‡ fæv»<·wU˜œÛ/»¹½K s{~ìOîßÚy ßN YÒŠºnƲŸov*õ»ç =¦™éGÍp©k“Zsëøéñë:~Ÿ}?}Ÿw·õ¦§ƒ‹Ð±Œf:-ônf6§CÔtVÇ"ŽÉõY=Ë~Îë!ýhf{ØrÉ~ãóRÿZ]à“u�JÁÉ«ëB¸`¦.xØåºÐUa².\ vu¡K ¶l²ÿ¶0l^¾ÿ¡j0Rìþ¬ØžŸ¤Çã6mÒ™ÚÀ«œ*p³+ÓÇÆá‚‚Àã¸ÕŽšÍ -+^4u÷y3 ­Í3½[{fî˜7Ð'æp¬Õi[®}Øë'uwOfçÖ|,ëï%`ë%l²Ö�H"ÌÀ…³µ&DM×€¢$¶ßçw^³´ç"3ä-2vÞts†€¹áGhÆ9øBKô·ks®§¯öè„„‘§—�¥ô·f¿Þœ¦…vçã÷�ªìúv# ëêPV�7Rè]“rU[¦Ü -έzc8âÝcY×ù�û®é†Ä:‡½þ£ßH>ýG?Ñ‚¸{|m}�4ØÝðˆÆ"-@ÍD‹a`�¯oj³äA¼ ØÇãÍÁ:MíÚbæqAò_[ÖLo{[…Çñš×ÿYŒ@7oÞ’H!ÿÑ/fí��1,�FºO¢$b±û-Ð*¡-÷FªJýë¸Ï¿¹“wÚ<'{A¨=âç”=wÅXÚ:˪÷ƒ!A¸k£Wå_�Ãý¤ lÌ>\Œ¿Jendstream -endobj -2196 0 obj << -/Type /Page -/Contents 2197 0 R -/Resources 2195 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2163 0 R -/Annots [ 2200 0 R 2201 0 R 2202 0 R 2204 0 R 2206 0 R ] ->> endobj -2200 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 624.7403 157.1381 635.6294] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2201 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.4886 624.7403 241.2818 635.6294] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2202 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [267.872 624.7403 293.6652 635.6294] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2204 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 384.3441 157.1381 395.2232] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2206 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 262.609 157.1381 273.4881] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2198 0 obj << -/D [2196 0 R /XYZ 90 757.9346 null] ->> endobj -2192 0 obj << -/D [2196 0 R /XYZ 224.7534 659.9636 null] ->> endobj -2199 0 obj << -/D [2196 0 R /XYZ 90 643.2365 null] ->> endobj -2193 0 obj << -/D [2196 0 R /XYZ 90 419.4579 null] ->> endobj -2203 0 obj << -/D [2196 0 R /XYZ 90 404.8876 null] ->> endobj -2194 0 obj << -/D [2196 0 R /XYZ 90 295.6655 null] ->> endobj -2205 0 obj << -/D [2196 0 R /XYZ 90 281.0952 null] ->> endobj -2195 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2209 0 obj << -/Length 2273 -/Filter /FlateDecode ->> -stream -xÚ­Zk�Û6ý>¿ÂÀ Øaù~ä[»™´ šÅ4™bQ¤Á@±5c!˵åN²¿~/%Q¢D™T‘"D²Žî¹¼çð!Jd�áY¼PB!ø\¬Ÿ®ðâ~þñŠ´—¯áúµøáîê»WÔ, 2’ÊÅÝCA$(¡‹»Í‡¥’«kª±ÂËóë[8xInÞ–›ó.oŽ_–ëóS¾¯²ª(÷«�wo®nî:Þ6-Á$±¬\}øˆHïÍFÌh±x†Œˆ1tñtÅ)s'»«÷W¿tqš õ S­„M7�p¿P×> -ÍUMó$"duM0öÚ÷ýfs\½ÌO§æ‡wù©Ü�ë†Õç·õå²*×åÎ6µá ÈQs@‘-3¬ã@Žåe^eÅ.ß´UËOëcqp5ƒ@ÌÓÂÆ�Ì%nr½ÛÚZKU'Ø$'ƒäàüöØ&Ö@ßÝ6E ?Ÿjn)—å±ùé);Šýcsò)¯žó¼�õº½9kó6F¶ß4»bÿ¹=ÊWT,ÿ\±Ìwã› e¶-]… -§ózÛ” k‹\m['ÝÀÑqŸW­Ç¾_q¼üw‹u!QS!I9¯c6m5ضÑ5dùéXf›uvªš œócá®U+²,›Ãìô¹45±ëlà—¶‰öhÔD{_'\/Ú›ÓÏûÒâŸ÷Íi]Êñ-M!}ºmér}Þu‰àj1*!©›».÷¿cLÏGç¦ç¢ÚŽŠé<ÝÓ -×JÑsøwØ}m/¯H¯ÏSží«9¢Ý®9‚ ‡rðU{W[>–¯O -�‡ -&Z-„‘ˆÉ';»]û¨p<ÓaÌÔBb�¸ ².ÝÊ*1f%˜"Å(‰Óv¨ ^¿ï¬�"LôÑš.\´…iÌjKõtØåýÈYÿVîw­§óáP]5]×@S£Ží 5ã5ãˆrªjÆW0Øœ&ÆcÁ ‚]œ%¼ëS�ƒ61Í»(–éwJEXS¸‰ F×�¤0Š,å�z8kLË`ú fDk¯[È;?O$0Žj8‡ûìx@Û ©fÒD›.1ÒŠHÚ&õ`Òž¨“Bf±k³‚мwžÀ ÷[“Aš0÷`eô¢ƒÙ<ßfë㊋eÙZ)s�v“Ûî ë¾ñøÐ -�[Ÿš):1 -µnÒƒYÆd!âmi›B(LÅͪ`Ú†#É OùÐÁÒFôÆœçí¬8àMxqÀ<ÇŒñ‚¸¾סâÊÄÛvdDýE7r‰¥Æ:áÆfÓ|=5è=\2]½ c*º ³Ö®×=}ÉGŠ3³Uº[Föƒ-x“sl+Ú¬g^fUÖäò¾:ž×Õ¹]ANŒ¼ÜŽÓJó‹ž÷Ïw°¤ç£Œ½ç¼ÎóÞSÝÚÐó0ä1¦GÌÏ·øTA\çù¼ÚÞoÁ%ãD4¬u¢ÛÇ�¿êzXhl’®w°~,q·y¶ÉÁ/„\T™!H <Ó¼>zÚ¼ ž’`IÔš·™&Ýʘ•]‰‹nõ·v°¤[£Œ½[¼Î­Þ´“]8Hs ½]‘ùeÃ:|*� ®Mã××·÷7w?Ýýv{so¹Q2”IxÆÅ<^‰•H�2�´&£ð¬±œÒ›‚O¹<:ù€˜Þ–Ö;Æèéçíôöygè= Ÿ£w<� îXïסÜT -�‰¢C%2 TÛƒQ!j¹ñ”ÜðXdbÏ> &·ƒ¥åŽ1zrÇy;¹}ÞrÈçÈO#ˆÊ-Ãî ‹~Ah¼*‘e 1ë”A -ø‹–›Í„ÞÔXpâå’Þ> ¢wKêeìõNð:½¼i½‡ä3ôN¤ÄõÖÜ÷Å¡v>‰�y– •(ƒC¥øƒhÍs‡ÀðG¦äÖÌn\~¾ò1¹,-wŒÑ“;ÎÛÉíóÎ�{@>GîxAÜv›ñþÝÍ/voì×›÷wA÷&0P%ã•èP‰(�ák6LaRj…¦ê²Òýõ˜Ð-*­s„Γ9JÚ©ì‘ÎÙgž£q4‡qÔ^áÛŸAb¼ü-è„ð +AŠÓSÌaD è锺°^Ç£õÿP^Ó×ÁÒÇ=…ã¼�Ä>ï �äsDާÄu2ÿôßzš†ézjn%»´ -¯Q‰ (<¹rx -$0Ù�9‡'G®/ íbB;XZè£'tœ·Úç�!ô€|ŽÐñ4‚¸6�ê±úU¸%&aHå*Q‡JQK�¸ñëéÍ͸Ý'i¶^a­ÐîU|÷ -è} É‘bPDìöÙÄ[A(´&¬ÃòÏÀºÜ ª‰œ[ÝŸhb×->­(^ž‚D4ŒjJÆ ì@)òq,Ëý¼´òaa£#ó¡ˆõ#K÷££×�â¼]?òygô£ùœ~O#ˆ[ïÚÞ^êIŠÃÃ)IÕÀ¡RäJ!&è¨ô)¯¶Å¥®¤ìÓ¯áßÜ•¤°�W³ Üám 㦺’‘°R"^â•¢¢�zSðr‘byðvñ¼_7/ŽÂhå&±­é�,Ù£Œ}Lðº8àýÓªR›p§ÐpCîÈNw‹OeÄXÄåQFçq�1épŸu†¿£ü£˜¾·Ëóä8�%Vц;LœX $ì7�~©ž¶Ÿ?D¸šü>Ct"…ü¦�4k‹hû%£þ HxPVLÛĸŸØï1]*6óó}~Ì*÷-›{µÿÖ¼±cù¹=!´ý¿ ìm¿G¥Ë¶ÛØoÍ\× ?\ýôÕ}´úåëc >¶¦Uú?ü^aHendstream -endobj -2208 0 obj << -/Type /Page -/Contents 2209 0 R -/Resources 2207 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2163 0 R -/Annots [ 2213 0 R 2214 0 R 2216 0 R 2219 0 R 2221 0 R 2223 0 R 2225 0 R 2227 0 R 2229 0 R 2231 0 R 2233 0 R 2234 0 R 2236 0 R 2237 0 R 2240 0 R 2241 0 R 2242 0 R ] ->> endobj -2213 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 536.3999 169.0332 547.3038] -/Subtype /Link -/A << /S /GoTo /D (a00139) >> ->> endobj -2214 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 497.4963 168.4752 508.4002] -/Subtype /Link -/A << /S /GoTo /D (a00138) >> ->> endobj -2216 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 414.6253 188.6792 425.5293] -/Subtype /Link -/A << /S /GoTo /D (a00090) >> ->> endobj -2219 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 332.7306 237.3867 342.6583] -/Subtype /Link -/A << /S /GoTo /D (a00152_g3e1562e8a6de32268e5df92a52152f91) >> ->> endobj -2221 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 319.7545 226.8662 329.6822] -/Subtype /Link -/A << /S /GoTo /D (a00152_g03d140db75de3d3cdfbbab1c4fed8d8d) >> ->> endobj -2223 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 306.7784 231.8475 316.7061] -/Subtype /Link -/A << /S /GoTo /D (a00152_gbb558f3a9b1ec015e83c314aba694e35) >> ->> endobj -2225 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 292.8261 198.642 303.73] -/Subtype /Link -/A << /S /GoTo /D (a00152_g737337d6a51e31b236c8233d024138a8) >> ->> endobj -2227 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 280.2236 216.8139 290.7539] -/Subtype /Link -/A << /S /GoTo /D (a00152_g7a7c46ffaba30477b8c9e3e61bd2e106) >> ->> endobj -2229 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 267.8502 202.6371 277.7778] -/Subtype /Link -/A << /S /GoTo /D (a00152_g06ba7b414e718081998f2814090debf1) >> ->> endobj -2231 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 254.8741 237.9346 264.8017] -/Subtype /Link -/A << /S /GoTo /D (a00152_gbb56b549f7ab4d86e1cc39b8afc70d1e) >> ->> endobj -2233 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 240.9217 167.0009 251.8256] -/Subtype /Link -/A << /S /GoTo /D (a00152_g24f52ac52d6e714cb04a5aa01be3bdd0) >> ->> endobj -2234 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [248.2853 240.9217 281.0723 251.8256] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -2236 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 227.9456 175.8576 238.8496] -/Subtype /Link -/A << /S /GoTo /D (a00152_g9f2196e2705036869611962425e404bf) >> ->> endobj -2237 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [264.3448 227.9456 297.1318 238.8496] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -2240 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 171.0022 184.6146 181.9061] -/Subtype /Link -/A << /S /GoTo /D (a00152_g2d9d28afa353f662b9bb5234fc419f72) >> ->> endobj -2241 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 132.0986 191.7978 143.0025] -/Subtype /Link -/A << /S /GoTo /D (a00152_g902c4a360134096224bc2655f623aa5f) >> ->> endobj -2242 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 93.195 184.0569 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00152_g54b27e45df15e10a0eb1a3e3a91417d2) >> ->> endobj -2210 0 obj << -/D [2208 0 R /XYZ 90 757.9346 null] ->> endobj -1775 0 obj << -/D [2208 0 R /XYZ 90 739.9346 null] ->> endobj -122 0 obj << -/D [2208 0 R /XYZ 90 739.9346 null] ->> endobj -2211 0 obj << -/D [2208 0 R /XYZ 90 719.4775 null] ->> endobj -2212 0 obj << -/D [2208 0 R /XYZ 90 555.3745 null] ->> endobj -2215 0 obj << -/D [2208 0 R /XYZ 90 433.5999 null] ->> endobj -2217 0 obj << -/D [2208 0 R /XYZ 90 350.729 null] ->> endobj -2218 0 obj << -/D [2208 0 R /XYZ 90 350.729 null] ->> endobj -2220 0 obj << -/D [2208 0 R /XYZ 90 336.7157 null] ->> endobj -2222 0 obj << -/D [2208 0 R /XYZ 90 323.7396 null] ->> endobj -2224 0 obj << -/D [2208 0 R /XYZ 90 310.7635 null] ->> endobj -2226 0 obj << -/D [2208 0 R /XYZ 90 296.8112 null] ->> endobj -2228 0 obj << -/D [2208 0 R /XYZ 90 284.2087 null] ->> endobj -2230 0 obj << -/D [2208 0 R /XYZ 90 271.8352 null] ->> endobj -2232 0 obj << -/D [2208 0 R /XYZ 90 258.8591 null] ->> endobj -2235 0 obj << -/D [2208 0 R /XYZ 90 244.9068 null] ->> endobj -2238 0 obj << -/D [2208 0 R /XYZ 90 189.9768 null] ->> endobj -2239 0 obj << -/D [2208 0 R /XYZ 90 189.9768 null] ->> endobj -2207 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2246 0 obj << -/Length 2421 -/Filter /FlateDecode ->> -stream -xÚ½YÝ“Û6ß¿Â�òL¬)Qû–6›6™k»Ý¸wÓI3;Z™^kbK®,g³÷×@€%kíÜ]çÆ"AA|ü(‹Y?1Ë‚Y¢? £xV쮂Ù#�¸¼¼€õ…ËðÝòêooe6Ëü,–ñl¹6bá+)äl¹úèžó…T�w|wKƒ×«U3©§"ÜéC½=¶e]ÑüÖ,×m]Ô[¤(zI2ÿ´|u³ìŒa[U 4åÏ«�Ÿ‚Ù -l~øa–ªÙL_d™œí®"ÚÉöêÃÕ¯�Z0/Lm9 -”Ÿ†él!Ú¤ÃtÂ,‚ı'IpI";©`–Âëq„>°$Y:³\è(Øt˜xz¯«yá¦Ýè¦Ò-Í6:_醯mMÏœýUÛ‡úhß³nÞçÅ\Þç¹<+%·L­iP®éùÄóJëÕPË¡³ô ¿¾c]dûŸG}hýñ9YŸ$v-BqÞ�ì?‰DáËA§‹4íƒ0t‚P±…i4ëØÐÃH©N�ƒ·¤ -g®À‰ce®KzEägAõ~Ác¨ËՉP#ݸÔ<2Ï�k…å¿dʼn\´âXîïófß–;ˆ£±)™ðC©qÞ –ë’Yè§Q–�ܨÀºÆâ¥8‰³À—¡ü¶Ç.2¶2Nü(ÉÄY+¥eArÙÊ-�à¹d¥å›²rÊH 5NÅAvþð:® õã�Q©òUÆi† ×—s¹ ðÞrôR,¿©‹ãNWmnH`Ö¨wC¼ÈÈWQ9’|Á²¾`#Á2FÝÜ”$uÏ’ÕP¢‹A¢�œ6Òädà(ûjnyeUÔ»ŽÜóç÷·ƒIP Ž‹eD‚—›1F’RÏ…GÎÂaS·+?`óK¯È·[miÏDƒ.L„•žKå}) f^5¥!Ì…òLgž§�®h5g5d*zSia“háAkæmt¡™+¾!ÿ—Ö[‹º�Ú(€�>•[ÄJ1”‹5ÄÂ[AoakÝÀ™oŸiueyxŒ7€L»Ù ”�½°Ð>ïõ5F„€T¶Äj| óœ¦�Þ“6Áç‡FÙ%ƒXâ&gO¬|ß°�ëãÁ ð£nX˜ y…A�²í*¶aÃ9–Æ~�ÑSþÉÇ 3 -Zäk74êÄ}A[ò-LóuSïF,�FÚs¬<<3™zï ¬JzN7€�÷^F6Ö•Or�·:?ºIR›!Äòéôê%ÔÆ5H$Î7†æE£óÖ"Â=î-,+‹y£T°Í×?‰§Œs…^šHÖšä Mdhtof�n�M…Û Ó¬gêΉ¦õz$äq[?ä[——*QÐÞ-)†H†Ô(`ÃZƒtF>’ç3‚‰Xµµ& Ãi8†1&ÎÝ30ë =«@õBű‰*¤ô6Ã� -ŸÿÒM�®�¨«êi‰®˜lÏ7‰¯êjá¨(Û©-jè.euÅ{¤ô -Ìñ ‡·—q r‘pBŠ„© €YøQ¯Àóp¢¯5x®_÷ºhy9ç“GHºÙÖdÉ™¡1UW¯hÚßì�ÇÞìp¥dÑk@mI£íD�gŽ$¥ô´oODáÙS8)cÇÚ,Âñ0‹¬ÛAþ Jdˆ4™… Ü¢£!ªï°ŽeZ¸\§ŸR@óA²ÒÄTO§vó5ßí_Ÿ"Vé'¡gUÄ]Ƃߪ) ‡xšù:64‘Ș¹ØAvlëz¿ÀYÀ}Ì/Nð¡Œ}h|Öq]0éTšD 7J+¸Àµ¡Y|£±EVem -nËŠÏàÈ0�LWÕ.6„­MæÙ�6ˆ¤À"«²d误 b¦˜ŽÓÈä˜ðîïnnÿÑx¿ÏáR‡‹ø&,Âʯ¶¿Ý|XΓȮ|ghoñªÇ”—øMé—Ÿ?¼h©ûíÝíýbª°Ý,\þ~{soìÂ{ÕïtSZGŒ%—{$Þ»ý«Q÷tså�‡¡÷l€Ë‹¼û0óŸCïÛæ¯ýäôÿùÜä|júÖ2Þ÷¾˜{_Üá}\Ѐ£˜~°'ܦ®û±Ùí°ì›þ™PGNW3hÙèâ3ÛÔZ–Â7€ÐUÞ›‚'B�AÕxn,æÅ�1žƒ„ 5=�çqðd)Žœö³Ÿ^cà~Ï-ÄÕÕvot¾StWÂçñ ™’3NÜY¿-GÃDKêô™ó·kèä9ÂV–[õzÁ­°yáq§ru)ŠÛ\ÔKÙÖu9@<º}2¹Ô|&f×J·º OaÑ5Ѽ÷Xvo¾þù C}Å2Bi»üÀ’81”…ìêüÙc*c íeðXc8³1†ãŽ…òWù>„‹5=)#߭陳$€VÍ3«0 Wâàl‘ðŽ5ôÎeÈHïC…À Q è¸P/È©@@yPW� -³®ÁØÂÅR8%O -†ç8p#º;X!¡ê+€ŠY -É‚õ ­�k.uÂÞh]}®O&ŽÐ$¨”Î],Œ8Æ‘<È[) JÙ3Œ ¤û6>ñþ–& a†‘h±‚§Ò¹tŸê i?…#ƒ±¶É˜k-OìrPùSëð\5õ~oÎ*µí ÉèÃ�ÕÇ�åbÄŸ’“:=ÓlS>nè;KP¶¿qmiyßÐF,sUû�>¦MšxËïoM?4kÎËU{„Àø[AŠ ¦mòê°+'?=tªßÝ ù½\¯úNǹ”r.¥n.¥œK)^i`¹;9¶b!S_±pß‘è¹&…×§6­ñýü¸em t?ãtǪü†RZHÑ3·y©ì·%8™©ÜÛ¼T¡ù@Ä!‚àOKðt.}’‹v'Xœ^úäô- ¸ô:fõ÷"ÉÕÚý’A® !òßÝ–ð/Má‹(™ü÷5'bÿOÿvšRxE ¯Y±Ÿ%ajÿÁe#p'?èJ7ý7 Û¤²ƒ÷˜GGžÉÏàZ†×2àËBÄü© -]a?Wu Ÿží‡ê¯Ï�º»G‰pÊ?ÿ.´³ýendstream -endobj -2245 0 obj << -/Type /Page -/Contents 2246 0 R -/Resources 2244 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2163 0 R -/Annots [ 2248 0 R 2251 0 R 2252 0 R 2255 0 R ] ->> endobj -2248 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 702.4657 192.3555 713.3696] -/Subtype /Link -/A << /S /GoTo /D (a00152_g058a8e6025f67b021862281f1911fcef) >> ->> endobj -2251 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 617.6293 168.4754 628.5332] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -2252 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 617.6293 218.5572 628.5332] -/Subtype /Link -/A << /S /GoTo /D (a00152_g499bb98a0b4ae9a98553ede81317606d) >> ->> endobj -2255 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 372.6901 227.254 395.6588] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2247 0 obj << -/D [2245 0 R /XYZ 90 757.9346 null] ->> endobj -2249 0 obj << -/D [2245 0 R /XYZ 90 637.022 null] ->> endobj -2250 0 obj << -/D [2245 0 R /XYZ 90 637.022 null] ->> endobj -2253 0 obj << -/D [2245 0 R /XYZ 90 603.0588 null] ->> endobj -2243 0 obj << -/D [2245 0 R /XYZ 90 578.5313 null] ->> endobj -2254 0 obj << -/D [2245 0 R /XYZ 90 578.5313 null] ->> endobj -1420 0 obj << -/D [2245 0 R /XYZ 338.656 320.2263 null] ->> endobj -2256 0 obj << -/D [2245 0 R /XYZ 90 302.5028 null] ->> endobj -2244 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2260 0 obj << -/Length 858 -/Filter /FlateDecode ->> -stream -xÚ­Vmo›0þίà#HÃó»!ßZ­«Z©RÖfÒ´E œ�·Y×?ÛFë6mŠ”œ}ç»çÎwOŒ\¨>È� +˜¡ÜM -º{µ}í «”>˜\nœ—¯qäF ☻›�ñÀ`aw“~ðDè8„zÇ›µô€½pW¥Ç\öò«*9²ìâ.«JÿÓæÖ¹ÚŒq-,F8ÒQ¿:>A7UðnH2÷Q- @Q„Ý¡˜ ‹ÜypÞŒ~z…9°”Å*³7 „(¢‹V!…B#€ÃË…#!® ¨ô©©ÆÕ÷¸¨sÙ®æ"ˆ� »S§óдG{�ÞiöVu?ˆ ¶„�LŽv£™†(}ļfPÄY™WU> endobj -2262 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 717.9621 227.254 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2264 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 543.1103 227.254 566.079] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2261 0 obj << -/D [2259 0 R /XYZ 90 757.9346 null] ->> endobj -2257 0 obj << -/D [2259 0 R /XYZ 267.4535 665.9412 null] ->> endobj -2263 0 obj << -/D [2259 0 R /XYZ 90 649.2141 null] ->> endobj -2258 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2267 0 obj << -/Length 2057 -/Filter /FlateDecode ->> -stream -xÚ­šYs¹€ßù+X›²*Dp~óꊼ¶¤HTU’Ý-Õ˜‰ÌŠGÈaÖ›_ŸÆÎAT¬r•ˆ™één4>t7h’>†¤op_ … ã²?Yôpÿn_õˆ<‚磺À�ãÞ_.©éd$•ýñs©A$(¡ýñôç�D„GTàÁÙjù Æôe·ÉŠùjén®Öv¼uÏC*«�»Ø]ßÁ@*­Ê ê]Œ+G¼Ÿ‚IbÝøwïç_q -þ~êaÄŒýßá#b í/zœ²pñÚ{èý­Òã”/š® ìð| Gp‡† S˜¿ªÏ—`üM¦éôd„(õCÄ­zª÷úñÎó"›¿æS§à<ßN6óR¿WÄj cõX¯�Óã oͽ/“ÊÛ o·�/_ܰ˜ån°Î7CŠ£õfõ¯|R´_­MÔÞyÍÛ ÇL€Ó—J iföÑæÅËÜ×V ’Õ_pËPŸ]Wo9Éùâ�f/¸AX;M/Z«_I¥lw´YÛÈ…˜‹ „($)çåÃñ¬ »!LåâëYÂaä {} ·kXåQ1_xÁ=Dpñ\/¸%…;ÙrêÛÙj÷êÇ_s'Uüžg¿ äþA±rŸ‹¬˜ÌÜ0ÏÜH¶ë|2·>NÜ¿înr€”•øIYš{G´LçÛb3ÿj‰Ùy2àqmš “¹›ÓÕd·È—EéÜ·D ¾e‹õ«WúCXÌœ@1Ë -¯/óŠË)j°õÜéá>ps±š– \Ø´Ÿlc:n‡Ô§Z‡G „‰V}a$Ò˜ªƒì¡Q]ª›-5À�™êK¬ä]¾Yù‡¶U‚)RŒ’¸ÙJê€Ý:²+¤{mÖð—ÕBʬžÝg¹ïí ³ÅK©€¡½˜/÷¯´|§°/” ²åûÑM_É'fÑÕÝôc©•‰G°’JØf�†)á-ÛaÃÙ@,W>˜_C gÙò%Ÿþ®4ø]áATg�Y›1oçZ—O0GÒdæ<‚%zF³zòE‡ê‰ÍCåÒC~ƒ”é¿„³=PeÕ�¾ fëê‡8“ˆ3Í÷z¬±_(]¾m‘,n±’JÙ…m°”-»KaÐPÓ¶|”ÎJ>åCGok¥Ú~(‚`ÙE< "np¤[•ë@¸"ЦØF^«0�û<•¼ô ¬ŒîWbÖÓ�¾�çÂ*W�Y£îÛdÝ­ýpu×Ù¹$ SQ&TÜï>ì5ƒ�3È!�2ÆT‚ÁJ,É`]a„Á„ÝÀ`ÓnœÁ¦åLøÐÑË�D2„¥�ñù Óbò�rÅa IèÅÜ^9;ÆW³‰®7Ð�ØŽ3Ça~\cv¢Ç5éªïßçQ�S&%JgïÀI=(3õ¨Ñ5k�Ã$"­:ٷꌳÁ,ÛºAf? Âì_˪·ÊŠ ŸÝBmV…šsß8•²™^V(+gãüû'ßlæÓi¾t¯”!¶®1´£ª;‚:‰më·õ:²�¸&s]8óepýx«Õ‰Ûá²æÆ®±³ƒ²O>åe¶È=(³Ìf27½ö±f“ÛW¿¹«Çë»§³Û›Ë!”it (2 ­<r�%¤º@$!UbÉ„µ¸OH »!!5ìþiZN}ÙÍI\"Ei?ž“‚|Ê�Ž^ëFˆùÓ—�·ƒ›‹³ñõíÍC§—4 -ibd"$#)Ô[“Ð>s¢Iª+›æìÛ|±[xÚüŽ,÷÷³ûŸíËå(·;ñhŠbœ ¥!Ó¼CYdÐGh�MŠÂ –¦°¦0FaÜnEaÝî 6ŒŸBaÜ�ŽÞ…Ÿ¯Æ7w·÷C «x€Dè`‰°Ø“ ÖUÃ&N$:1£k[è‰Aì$_á8ž/«/u*0׫MACWG­7 IŽ2I�mHD*3VbI&ë -#L&ì&vÓL6�ŸÀdÂ�ŽÞ“?Ú‚úxyyqÿôpýÏ‹�’"­°N„Ú7Òoäѵ)«m¦Ã> endobj -2270 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [315.1536 672.5415 350.0824 683.4455] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -2271 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [274.7554 593.6496 309.6842 616.6183] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -2273 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 524.9361 172.3507 535.84] -/Subtype /Link -/A << /S /GoTo /D (a00141) >> ->> endobj -2274 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 486.1806 164.0618 497.0846] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -2277 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 365.4596 298.8158 375.3872] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3f6f1f6f98431f2d33ed30a30d2ccc35) >> ->> endobj -2279 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 326.7041 293.2467 336.6318] -/Subtype /Link -/A << /S /GoTo /D (a00153_g974c9b4bbe6b07cc1d64ac4fad278030) >> ->> endobj -2281 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 287.9486 263.8671 297.8763] -/Subtype /Link -/A << /S /GoTo /D (a00153_gcacc406c3bf7d0e00412e4c946252739) >> ->> endobj -2283 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 249.1931 265.0627 259.1208] -/Subtype /Link -/A << /S /GoTo /D (a00153_gca1240bba5dd57f8c7c27123c84a1f6d) >> ->> endobj -2285 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 210.4377 245.6755 220.3653] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3001114ddadc1f2ada5cc9a780e866fc) >> ->> endobj -2287 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 171.6822 220.231 181.6098] -/Subtype /Link -/A << /S /GoTo /D (a00153_g763f12007aad8cc0e483bf50f8a8d9b4) >> ->> endobj -2289 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 132.9267 286.1035 142.8544] -/Subtype /Link -/A << /S /GoTo /D (a00153_g9dd44616d41cef74d3beb51d8be5ecec) >> ->> endobj -2291 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 94.1712 253.6255 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00153_g529648ad3b0b327a43689b0f1779ff55) >> ->> endobj -2268 0 obj << -/D [2266 0 R /XYZ 90 757.9346 null] ->> endobj -650 0 obj << -/D [2266 0 R /XYZ 90 739.9346 null] ->> endobj -126 0 obj << -/D [2266 0 R /XYZ 90 739.9346 null] ->> endobj -2269 0 obj << -/D [2266 0 R /XYZ 90 716.7484 null] ->> endobj -2272 0 obj << -/D [2266 0 R /XYZ 90 543.8366 null] ->> endobj -2275 0 obj << -/D [2266 0 R /XYZ 90 420.1859 null] ->> endobj -2276 0 obj << -/D [2266 0 R /XYZ 90 381.3704 null] ->> endobj -2278 0 obj << -/D [2266 0 R /XYZ 90 344.7717 null] ->> endobj -2280 0 obj << -/D [2266 0 R /XYZ 90 306.0163 null] ->> endobj -2282 0 obj << -/D [2266 0 R /XYZ 90 267.2608 null] ->> endobj -2284 0 obj << -/D [2266 0 R /XYZ 90 228.5053 null] ->> endobj -2286 0 obj << -/D [2266 0 R /XYZ 90 189.7498 null] ->> endobj -2288 0 obj << -/D [2266 0 R /XYZ 90 150.9943 null] ->> endobj -2290 0 obj << -/D [2266 0 R /XYZ 90 112.2389 null] ->> endobj -2265 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2295 0 obj << -/Length 2082 -/Filter /FlateDecode ->> -stream -xÚ­Zmsã4þž_‘¾$3TèÝ2ßʵwÜAḆ`:nâ´†Ä ±C¯ÿž]Krì8±\èt¦–�Ç»«Õ³Ú]%lLá��c:ŽTDb!õx¾Ññ<~7bîã øü¢ øf6úê-�Ç1‰5×ãÙ²’ QœññlñÛÄÐé74¢“ýû�0Ttµƒ›Íb¿Jíøj3߯ӼLÊl“Oÿ˜}]Ïj½Î,%4C­�~ûƒŽ`Þ‡%"6jü7”°8æãõHráoV£ÛÑOµûAõ©ÙIªˆf|Á#;Ÿ¨f4"Lsð‡ÙG¼v‡¢c¯k‰î`ð!�b3ö(ôI퉧[”Ù¼°÷0s{ݹërÊÌdyì¯:b œ Öo§3“ "åùe…ÉGšG‡e�eeT)Œ×0œÈ®qðWbÜxÂ{ÒË$‰©Öm½åó6]¤Kë¤}–—æ®ìØÁ"Ʊ<²?Ú=8̧–Ÿ>dQGnµ¤§,ˆè÷„1D)ƒŠp èA¤Ó1%НúYç`ÖFcýuŸ•v°H€~àÉsôÒQL”¦æU襵&‚Y@½jX�^M�=ô -èõôjéíЋé«k8‰ x§mÈy~y|ȤŽÜŠ_§LàÀ+)Õï‹Æ„z)ÁlÓ (7öÊÈ -,†®°ˆ®#LÓÆÏ‰½Ûtžá;s+!ß,R§5Ÿ¯ö‹Ô½W¹ÁÔn€IJPœ§å:)þjÏÆI’£™ž`$3:Iö«Ò>ØmöeŠV0WØgOéjeGþ‰]\Ãh—§îe§&e�›8€u3:r[ÛåõìÛ“»%ÒІ‡\!"hñ€’/c�аÉ:¹ªaUqë‹©ãí²*fZûæå'7X7ŽùNæòÍz›­ü.ú”•�ç÷ØCES ^N�¼ùÛ®PÐÆp!z¬�>Ý ·ZØõžuGu ‡ŽÝhŸ ´& 'ÐjX0Ðz5- ×ZKo8ÐÚÊZÀŒŽ\h³Ù÷ÝCM(‹uÀR�gyŒò¶j-Ï‘�CPk·q¯î V�ríc;A \H)Zfë´]>¯²`­kâþåm2Ç~ï/l;ÒÒ…XÉÅóó!ü¡¼;ß{óˆ­_éК«˜H<´®aáHhì‹„~½u$4õˆ„–ò!‘ÐoFG®�„O×—··×7ß|‹I'¿v²Ž€%2ä ® â/Í:˜Ò˜ž\×°ŠÉS¥&û]Þþ–¤Øo·xVVÝ,ýnš¯®;­òCRéúÚZÕGSÔƒš2\j$kX˜¦ �}4í×[Ó´©wM[ʇдߌŽÜMïn.¹ÄnòÝu·:ŠÕ4àŽ°ƒË˜àUË IÏ„J±H d}ÝÇzkíßëäs¶Þ¯Ýn]ïÛIÞfür‡Ç- þa]oÌÍŠë)ñ$Y~T¶…†ÝÓ«>û¤?ŹO1Òëy�þüu7• -Š›mº8[,ÐÝ›�߯6ѧ‹.¦ ÝÆÆíoWÿ­ê‚¤E ¥âl7=A\ÂAÜ«ñĽ>ˆ[zÃAÜV> ˆftäú ÆõèT]ÑF<`(þŠà¥é…qxME¡VÚÁ„K/1ÇKˆ›êßÊ77O)¶v\óª•vÂýL–ïFpÑUlä«$hí…4¶:P�«a=LíÕèyÚÐfiSíŽöp$³ÁÏ»7ß^¿ùîöç›Ûî×]h¢LïüµÃÀòNO¯K˜Vúý|¥ZV Áođ08I´†‰âOCàÙÎwižÂè é·Â?ø€ißÛ3î®ôk.¾æî—:0-÷ÝîrÊUÍåîOz|pµùüü�v~È£ ž½i /ý ŒUéendstream -endobj -2294 0 obj << -/Type /Page -/Contents 2295 0 R -/Resources 2293 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2292 0 R -/Annots [ 2297 0 R 2298 0 R 2299 0 R 2301 0 R 2302 0 R 2303 0 R 2305 0 R 2306 0 R 2308 0 R 2311 0 R 2312 0 R ] ->> endobj -2297 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [177.0032 702.6096 196.7092 713.5135] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2298 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.9845 663.1573 206.6718 674.0613] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2299 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.1599 623.7051 252.3298 634.609] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -2301 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 459.7527 225.9098 469.6804] -/Subtype /Link -/A << /S /GoTo /D (a00153_g51195ea7cd5aa387a87f9d3b23905b62) >> ->> endobj -2302 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 420.3005 246.7912 430.2281] -/Subtype /Link -/A << /S /GoTo /D (a00153_g9069474ea570fd78c481aa164317dbaf) >> ->> endobj -2303 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 380.8482 245.6755 390.7759] -/Subtype /Link -/A << /S /GoTo /D (a00153_ge0f8cbeca9731af2171ffd37e79de893) >> ->> endobj -2305 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 296.6881 187.0159 306.6157] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb61381673de27f31848c5396bf0b338e) >> ->> endobj -2306 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 257.2358 233.6306 267.1635] -/Subtype /Link -/A << /S /GoTo /D (a00153_gf963fdea2b75d27ef31e92d1d01359ee) >> ->> endobj -2308 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 217.7836 248.0566 227.7113] -/Subtype /Link -/A << /S /GoTo /D (a00153_gc3882366feda1cb759ccbfe98327a7db) >> ->> endobj -2311 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 133.6234 188.6795 143.5511] -/Subtype /Link -/A << /S /GoTo /D (a00153_gdcf372ff9748996f7c05e9822a615384) >> ->> endobj -2312 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 94.1712 254.552 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00153_g92f3344ec8ca46893163399c89fafed5) >> ->> endobj -2296 0 obj << -/D [2294 0 R /XYZ 90 757.9346 null] ->> endobj -2300 0 obj << -/D [2294 0 R /XYZ 90 556.5104 null] ->> endobj -2304 0 obj << -/D [2294 0 R /XYZ 90 312.6772 null] ->> endobj -2307 0 obj << -/D [2294 0 R /XYZ 90 236.1996 null] ->> endobj -2309 0 obj << -/D [2294 0 R /XYZ 90 149.6126 null] ->> endobj -2310 0 obj << -/D [2294 0 R /XYZ 90 149.6126 null] ->> endobj -2293 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2322 0 obj << -/Length 2189 -/Filter /FlateDecode ->> -stream -xÚ­Z]sÛ¶}ׯÐL®ô`\|è›»‰3‰íÚÊmo?Æ#K´Í©D¹"Õ4÷×ßI@ (tãñŒEŠG»Ëå9‹@2ÆðGÆ�‘ ͸/Ö#<~„¯ß�Hsù®Ÿø€7³Ñ¿ z¬‘–TŽg•I� „ŽgË_':=¡OÞnòß0¦�»í¼Ì6yýåæÙõÉÔŠÉf[Ÿì.®á@&JM™þ>û0:Ÿ¹@š8“Ä„ñçè×ßñx ñ~aÄ´ã/p‚ÑšŽ×#N™=Y�nG?:;õ…êÇn—c�SãšÔ7è�:`‚D$…QHGB]~+ø¹ä&?.âD«±E™$ͦšN6S‚'�Õ¿UÚd${¨??Ÿ]׋)“§t1¥xòG±[7¸âi³[-ëãû´I`‘6ߨ”æ›fÒF�ˆ‹0¾Åæ CB`ÚOÈ—À GæQ„`‰8S|ì`&¿Q*ºÁÁ¯¨`cßà‘Ä7¨˜_‘ÆR¶ý~·L -ó´ãœK”Є87—¶� æÆÃâcatìš0>_\ßÁS¾{{uyy{ -¥�1š¨HàR)€®D Á‡ÒU*“>Ì"|u°Š°O ÉÖó¿³õn]ŸÌ×›]^6œk˜»Øä‹Ýv;eÉ$µ×ölÞäyº¨*@/1¡@0„¼m‹!H A›ê$93¹$õ}¼ÝGÒ_œºÅGBª•æ¤W>  ‹* èq¯€ˆ_«€–߸ÚÎ( FÇ®UÀé”Ã@1»øÏùÝÕõùeGŒ#•R³Õ:!œZ$©ƒ9b£N�,ÌÄ|––év�å‡õºØ=?o¶ ÝlýÝ<§y–?v¸ßÀ¶SÃßÚþzJûb³~ÎV¶¼gy¯x„f0ºQñ‚ªÞÏi‘@Ò9åN;X”Ó¾Á§#~-§[~ãœn;ÀéH»–ÓÇ+:®z¤H´¡šf/$²�Q­“‘˜ -ô|·¾O·í‚^ÀåU9ÏÓÍ®X}Ý»>ò j´´ ìäX¿JÏ!˜F‰ÆIŒ�g§g0Äΰ_ÇNßïv¶œag8ŒŽ]ËÎ�·³óËë«›©„§×å)£ˆ'"’ *#ì…}‡ À?®HŒ¦öí4]eEéU`ÇUSª,æQ¥é«ÔP®!�LÇú‹²Ô7`iįeiËoœ¥mçX £c×uÆ7ïÎLkp:%„˜éƒÃCªÂM`ÊE,%) #âËj*Wæ�2Ö8ØË›ÇÆ]Õ,WA×1/çåÜÍá2óT^ŸúM-O€Þ,y�� �¤Jb-‚ƒÅéí Ñ;ì×ÑÛ÷;€Þ-çCè£c×Ò».¾S¢&W�`”4±Ç2aQ±`Ç´ÔíX/78Йs5P#:¤ kô,ÏÊl¾ªOêéb¹5‹ó¼XgEáÈ^fk¨é¥e9L8÷$ß#Q=ïVEÚ_Ú9cˆ(ñ: ‡9‰d"Ö€8XœûžÁ÷Ã~÷}¿¸ßr>„ûá0:v-÷?�þ\ÓÿçnALjQEÉp¨H”P¤€ÿíT/5`š‡ul=ÌQßC‡¨oa{êóÄëe¸Ü÷2p¡êeàÓº¨ç5ªHÍhø¸®øÞ p|ߨ=PÑ”LÖYY«¥B™¡Ç '6œ}çÞø:bz~Xºìƒy'aüuz&S$¡¢k)–o0 ¬ˆ_+¬–߸°ÚÎ+FÇ®'¬Ûÿ^öi‹a7Éùp¨Hf–�ðƒG zÉȮ®èù耴l/­„yÒ‚'­„×҂הּàp^@ÎꃶÆà7•@EËúô¾ñѬ�Á¥–Æö.Z -K5äÏ]Z”�ëZr�?H¤i¡êebÛÞ-ÓtmǽrS>ÍÿJmhç㻼Ø-iQ<ìVýjåÊä먕*$&bjµ°¸Z=ƒ!µ†ý:µú~¨µå|ˆZÃatìZµBû÷éööب¹Pá,8TÄ=…‡ÇA)ÙǛޘ)Ççn/~9¯ÉsÒ,×›e‚�ïï>ž_v¾‡°áÿ{¸VH/ÁÀ/fx`é£CŠ·°Vé¦Q­‚¶–«å�ÿ¥F°ýšÀÜý*š J™Õ>Ñ„ƒE5á h"â×j¢å7®‰¶óšˆ„ѱë¦EçoÏÍVÀO—gWS&&?uä!"BÉHBÈøóÂ9?M(Ò‰Ž5u Œ¶yX¬µ"UÚKóå_é¶ÌÜöl]þi_ÿËð´Y/ø’åËÍ—) ½,¥XJñëôY”+Äë³,ÎRÏ`ˆ¥a¿Ž¥¾ß,m9ÂÒp»®r_|ŠN œӋYuzõyÖajB�Ô‰ -'Å¡"Ñ@×W%ÚÑ@½D�MÓØ*�c¾‡1ßÂŒó÷@Õz•ucXç‡[Ý媢œ=˜½»J^çUViuè2\¶)%§¸í£�ï›…Îx½ë}zóÏv‹ÁP˜°^åù€€ò,ª¼ Ç½ò"~­òZ~ãÊk; ¼H»n·øæº^ -~sW5-Gö.àDZlP¸KÅ_ºÉFx‚˜ð¨s\"6tpp+ç÷«0× “ˆ5û|ß\ü ¥Hq-c´°8=ƒ! -†ý: -ú~P°å|Ãatìz4íê½…wG(Lõç‚"1P–@ÊxÒŽ!PòÍ'ÃR䳇ñÙÂ:»qî% ÷ÛŘ]B?¾ÍìþÈ:�õæÇáŠ.ÁåSq°¿—B^ö/íjÐFláÚŽQŒ�.¬cxD -ùM/VúRØl‘R¤‘Ð62e_š$P«’ú¡¾KóF÷ú^“…Oöàƒ) ;›jsô=eߪ3¸!ÙûR¥A£xß ¿g›¿¿>¦ùa:TMš—Ÿÿ`,åendstream -endobj -2321 0 obj << -/Type /Page -/Contents 2322 0 R -/Resources 2320 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2292 0 R -/Annots [ 2325 0 R 2327 0 R 2328 0 R 2329 0 R 2330 0 R 2331 0 R 2332 0 R 2333 0 R 2334 0 R 2335 0 R 2336 0 R 2338 0 R 2339 0 R ] ->> endobj -2325 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 703.2861 227.424 713.2138] -/Subtype /Link -/A << /S /GoTo /D (a00153_g196379ceb1219a99f4495e41ccc9bbfb) >> ->> endobj -2327 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 617.7172 235.8724 627.6449] -/Subtype /Link -/A << /S /GoTo /D (a00153_gac0de06236b02659460445de30776e00) >> ->> endobj -2328 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 577.6656 202.5175 587.5932] -/Subtype /Link -/A << /S /GoTo /D (a00153_gf5fe83be78b78b9e7d9e7f1e34ab1cc5) >> ->> endobj -2329 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 537.6139 233.4713 547.5416] -/Subtype /Link -/A << /S /GoTo /D (a00153_g8f4ebd8ef6c0ea665ed351d87fec09fd) >> ->> endobj -2330 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 497.5622 215.0208 507.4899] -/Subtype /Link -/A << /S /GoTo /D (a00153_g51c1cd531ff0afb81620151f2248cd21) >> ->> endobj -2331 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 457.5105 187.9025 467.4382] -/Subtype /Link -/A << /S /GoTo /D (a00153_g15de27b044603284f68db05a378235a7) >> ->> endobj -2332 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 417.4589 211.3245 427.3866] -/Subtype /Link -/A << /S /GoTo /D (a00153_g67cf1e0d2324c93f332c1f020c0fe8b3) >> ->> endobj -2333 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 377.4072 231.2496 387.3349] -/Subtype /Link -/A << /S /GoTo /D (a00153_g24aa5bc36939cc9a0833e1df01478a7e) >> ->> endobj -2334 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 325.794 211.942 336.3243] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4910467b83a639f06739c82cd362037e) >> ->> endobj -2335 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 286.345 259.1549 296.2726] -/Subtype /Link -/A << /S /GoTo /D (a00153_g5b9dba2123705bce1ce95c3deca0bdad) >> ->> endobj -2336 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 246.2933 272.6941 256.221] -/Subtype /Link -/A << /S /GoTo /D (a00153_g2bc3b489923793759526a3181eb667fa) >> ->> endobj -2338 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 160.7244 233.1426 170.6521] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb1455b27c06532a399cf06d2c1d6d08d) >> ->> endobj -2339 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 120.6728 236.4303 130.6004] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3090117ef3ff5775b77cb1960e442d07) >> ->> endobj -2323 0 obj << -/D [2321 0 R /XYZ 90 757.9346 null] ->> endobj -2324 0 obj << -/D [2321 0 R /XYZ 90 722.0018 null] ->> endobj -2326 0 obj << -/D [2321 0 R /XYZ 90 634.0061 null] ->> endobj -2337 0 obj << -/D [2321 0 R /XYZ 90 177.0133 null] ->> endobj -2320 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2354 0 obj << -/Length 2254 -/Filter /FlateDecode ->> -stream -xÚ­Z[sÛ6~÷¯ÐL_¤�Á�dúäØŽ×§ñÆÊÃnÛñÐ-qB‘*/IÝÎþ÷= -iRÞz2�àÁ¹áù€&3 ÿÈ,À3Ox(`\Î¢í ž­aúꄘקðþÔ%x·L0~Ôc ¡È÷žE¦”>’�7LK5‰K‡Ý,Ç…ZTºB§AÙ‘|&Çu8äjy·\l~ÖìÎòúny}~×C&…°èyþ¸/CþK�)òSÀ´dJí‹¸Š‹m’Å¥ÆYbPYª]VIdæËz·Ë Ær“×éÊ3¶Aq»KÒØÌ&Ùóèä -rB¾<F 9…OMv @-åB²1ˆºr�ÀhGø1 W£Ç×ÂôæÓÕÕõÏW=hêUÐ÷‚/Ç&ˆpF§°iÉÆ°™æ*2®›ÿ’lÝ §Q\Tab’r¼ bþ Ê�ò5€‹9">g¯\Ĉf5Ü–l¸.ÃàNȵÀíÈ�nWøÀ�P£Ç·ÍøŸÏ?-˜˜Ÿ]œŸA¸íEWH÷œOùƒBÕèƒÌ—AXx°-‚ønÉ”ÖïŠó<\EaYu"é³0R Ðà5`&(’”S0³dÓ0sŽÁl\n 3Wî0ë?fãjôø¶ññæŸ÷7—?÷ã#AÜãdÊ �GÉKÁÅ<äA„™—%ë•i’}5#ñL§²‰ÃT‹æU¶®6ÏÃŽJäc"^vª|aDLÁÎ’MÃÎa8»q¹-ì\¹ßT]�'«žlÔˆº²ŸG�¥ŸÒ¢ÇWiQ'»û4_÷”€PÀ´ ã°TS¢¥‡|ù½ëx,p´ %ûÍ{Â�”B;Ì<�¢ 1ÓD®`Ž«4Ͷ\?òÆx0–Áq'Â!9–JI¿-’ÌÙ¼6ƒð ·²µCó°�Ë2lk‰æè<{>¸ï#B09Ry‡zøv�C€ÍÏo¿u ÕáE›¤Š£ªnâáK‡þNÀÉ£{x@öÑ�@?Ò0'æ-cóªw“¡È’R¿ü¾‰5Õ=ªš‹³UBAfHTÑÕyßÊÒÌ“$Úè©fÔœ«rýü`õ�å.Ž¥`¼jöE™ØzLü˜7I•yJn©GU¾ -ŸÔÐ{c=—&U•š±¶àGx€R"ÌVfÕÆ¼Þ¶,³¼ -ÚU -DñÎ\ø¸ÜÛµó*/ò44šÓÕÐÐúó‡díª1hUÖßý{yyÿéóÅåg×0*ò‘Bvfk[ÇV†°PY•Áž\68ˆsAÑœS<[ýÝã“”]öV6l¸úb>F\úäÙTáŒ¤Š–l2UŒJܧР¹6UtäNW(]áGT(jôø¶…ð‡E -£HL8‚ª”1éeE -ƒL#Ý~{8&·d4?×ðR„Y¸5#…'õ[m´b´£8™oë²Ò£‡X¿/šð¾NÊ -2ÞJ¿ûžT=2&@þ4ËÌ��‘’X¹­7u>ˆìêèžÝÞžŸÝÜèÝ6%QÊís�Ý×%¾³îf”z& -3=(!ëÄz¨��”ݽÓDaeˆ”eI¶_pp…Ö6£ ºý©~«¥?uô£YŸ¯­|ó½OALøˆùÐFuµ88‰-Õ”lI¦Lte—UQÛ¼¾P�m\¥Žä㓾YÚ;O;ãÞ&díÝâ=# äî.4·ª{‰MH4 -¯âÇ·íeV -�HÖÀQU´»žÍ^ÞÛ7[í ê•K0ˆ¨6+ä¥ûâR]šõå»5áT7 &Y”Ö«ý ÚžGZq!|è,„ªÚù$´ ý©»`Z‡| ´ò]…6}hAò ´:Zô e¨¦d èª|z [;pHC2¼�y -] UÓú_—›¡Š×Æ©i -n‡œ`ïB7z…uµÍu:(4}Nþµ—å|Ð�@ãN|ŠäÕÂjêeW® xjâ¯fA€„ä¤#´öïÍš†zH¯šHKåuV ÑØöŠ/èí1Í:\'ý4o8òT˜ræWaîªâ'õ1ʰ¿Í¶ŒŠdg´„òQe¬Ëõ¿C˜d}1âË�04ðÅ› ½Á?-À°Dêòÿþ¾ß´Pß2â|P$H@%óuD€…j4«Êþ#~e• Êíàƒ:uµy Ôüâ·”½¥æO(ÆÒœZuþòâ ælÿæÁ†ö‹ü�§uÜKoêO¼ô?«(Àlendstream -endobj -2353 0 obj << -/Type /Page -/Contents 2354 0 R -/Resources 2352 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2292 0 R -/Annots [ 2357 0 R 2358 0 R 2359 0 R 2360 0 R 2361 0 R 2362 0 R 2364 0 R 2366 0 R 2367 0 R ] ->> endobj -2357 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 705.2116 209.0629 715.1393] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3589822ecb9d9c4145209756396b8a6b) >> ->> endobj -2358 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 666.5202 222.0741 676.4479] -/Subtype /Link -/A << /S /GoTo /D (a00153_g5726142fec34f35fb9ea19e5a45975c6) >> ->> endobj -2359 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 627.8288 214.124 637.7565] -/Subtype /Link -/A << /S /GoTo /D (a00153_g21664b7441cfa37d280228d23316d609) >> ->> endobj -2360 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 589.1374 228.3406 599.0651] -/Subtype /Link -/A << /S /GoTo /D (a00153_g156dd2891a57035e4afdc4c2bc0b0ebf) >> ->> endobj -2361 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 550.446 212.4703 560.3737] -/Subtype /Link -/A << /S /GoTo /D (a00153_ge6f4a2453dbd8bc60e6a82774552366a) >> ->> endobj -2362 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 510.7784 166.3534 521.6823] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb58e1ceb7cb73ca2bcd73146b6c1b4e7) >> ->> endobj -2364 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 378.2912 233.5112 388.2189] -/Subtype /Link -/A << /S /GoTo /D (a00153_g285a80366aed9428f64282b8d13c918b) >> ->> endobj -2366 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.3051 251.4958 359.3784 262.3998] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2367 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [321.4596 221.9163 356.3884 232.8202] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -2355 0 obj << -/D [2353 0 R /XYZ 90 757.9346 null] ->> endobj -2356 0 obj << -/D [2353 0 R /XYZ 90 720.8203 null] ->> endobj -2363 0 obj << -/D [2353 0 R /XYZ 90 444.8446 null] ->> endobj -2365 0 obj << -/D [2353 0 R /XYZ 90 311.3811 null] ->> endobj -2352 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2377 0 obj << -/Length 1774 -/Filter /FlateDecode ->> -stream -xÚÍYK�Û6¾ûWèÅb†‘’rÛ]oÒd»ëE“ÀÐʲ­Ö–\=²ÙþúERÖÖœ´‡ÂQâhÞßÌP&†±NRuSÌïa!×»lòyñvt»¨Ñzr&ˆTã¯ÑÇÏØZ�¾oG1ÏåÖ3Ü`D<�Zû‘M™¹Ù�G?W|ÔFùÂ)såö”:ʸ³þ `½C�î`5w,�Í\Û2TÒ'Ÿ(åm‹†}Ê™Uc×W %6ò° ¡?¬Béþ8ìH¶r¨Cš’åNºÑ$u ù€m®R‡_æ÷Ë«ûû›«wïÚZ@¾ l·×þЍ_6û9£M§gûü°ô‡ÀßíºÎwÔràE!܆ðAPÄÓ:u©Ç– J»tÈÆŽç™J-ÛP¥wìïõ*Y«kn¶@É]Ô@².âàx—oý¼XdۤحԺ´¯\Eú…tœq˜gZBž¨ëâæþµáN ãeà@O¸ÕçD'à}Œ«ê Šõ, Š=œwT0,�ò±ÌKÄ ©1BD³:Æ£äUl'œ�oó_o—îoßkŽì,ÇY˜‡é>’ÅJ5Ý£²âpHRÝ�ÖæsHrã(Þè3Tù0¨9I“}Ï™Ðô­ ٢ݱk•EZªCTZ»Ôk.õð\Ý+aQë•™Ù*;¤ç�ýT¥E¬õƒ›²©Jºä hžJ;X(»€A¾�4ÓCšüF©›U¢®q¢Äa©vÉTó�(I‘o’J8jÕ¼4­ 4™×½2MÛ´ù@¡ê~ 2Gë¸éOhx±ñfR~½Z7†4\AØš=‚deæˆèïÖ€"D·"ÃêÝ-:jd•]d2‘2Öä(_ÙéM˜À´E§Ó�ΰ–¥ó�öäûÃýò§«ßÊ´¿»UÏ Åƒy_�g{ÿkTè´õ7-Gwí6ÿɨ`M#—}ègEÚžÀηY“SB\WÙÉ\¿ŠOØcãÊÃCÚ¥c—¦å§”Uk44è"7:~Â_?ÎÔ�è XZìrxNNêsI„w/Œp;Âu˜†q`œöôR½´ôS8¼Gû0•:Wú]”#¬7G¢y½|œÿ~{ynt‘QÁ§™'ݸ(!ÍľŒ{UE”Ï%‚å5 sµ)ã(øê²óÓ qÇ›0UÛ_$¸ý]¡_“µZ^Uí�ee“�âÝrõÉ/qrsëO(0ë½=”¸{Qw�z._Põ\IÐoì’Àß5ËÑå,–‰•¤~NÙÞ7ç”}QNE ؤԫæ”íÖŽ¯¾7#i=#íóyý0axüA‚üjvsõ¸ÌÉë4ñW�Ÿå�öÜ“wÚÌß4Û -T+½kzôÓÖSñ<23×" ×…þ¸›Ä»S�6!d‰žž£|«­��l%—'…M/m%í¿fà¨o;'ÿ1Áàf"¸øWÿÚ”Ó» ¯FëC�<‡¹æ_(­„´ö.ŒChêU«Ö&ÿdo% ÓB¨i%o({cê:ÅXœý—JR#ÜÀ,ùú² ;‡qNØ)ÿüøÞd+endstream -endobj -2376 0 obj << -/Type /Page -/Contents 2377 0 R -/Resources 2375 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2292 0 R -/Annots [ 2379 0 R 2380 0 R 2381 0 R 2382 0 R 2383 0 R 2384 0 R 2387 0 R 2389 0 R ] ->> endobj -2379 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 726.8189 213.038 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00153_g41aa744caa46913b3b3aedb2a4e78546) >> ->> endobj -2380 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 687.2449 190.8907 698.1489] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -2381 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [191.3888 687.2449 268.6482 698.1489] -/Subtype /Link -/A << /S /GoTo /D (a00153_g69646a81a922033c5281445a71f8ffed) >> ->> endobj -2382 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [336.7197 672.2644 372.0849 682.1696] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2383 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.2897 647.671 239.3189 658.575] -/Subtype /Link -/A << /S /GoTo /D (a00153_ga92afb113e122f860392bfbd385f842e) >> ->> endobj -2384 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [336.7197 632.6905 372.0849 642.5957] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2387 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 564.2011 245.6657 574.1288] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb6e04358481bd2057524fb874cfa472b) >> ->> endobj -2389 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 550.8899 229.0679 560.8176] -/Subtype /Link -/A << /S /GoTo /D (a00153_g6836f92f3692f3a4429eb599db40cbae) >> ->> endobj -2378 0 obj << -/D [2376 0 R /XYZ 90 757.9346 null] ->> endobj -713 0 obj << -/D [2376 0 R /XYZ 90 739.9346 null] ->> endobj -2385 0 obj << -/D [2376 0 R /XYZ 90 582.5346 null] ->> endobj -2386 0 obj << -/D [2376 0 R /XYZ 90 582.5346 null] ->> endobj -2388 0 obj << -/D [2376 0 R /XYZ 90 568.1862 null] ->> endobj -2390 0 obj << -/D [2376 0 R /XYZ 90 536.5063 null] ->> endobj -2340 0 obj << -/D [2376 0 R /XYZ 90 511.0399 null] ->> endobj -2391 0 obj << -/D [2376 0 R /XYZ 90 511.0399 null] ->> endobj -2351 0 obj << -/D [2376 0 R /XYZ 238.8902 421.844 null] ->> endobj -2392 0 obj << -/D [2376 0 R /XYZ 90 404.3073 null] ->> endobj -2350 0 obj << -/D [2376 0 R /XYZ 215.8768 311.4556 null] ->> endobj -2393 0 obj << -/D [2376 0 R /XYZ 90 293.9189 null] ->> endobj -2371 0 obj << -/D [2376 0 R /XYZ 352.8421 189.1121 null] ->> endobj -2394 0 obj << -/D [2376 0 R /XYZ 90 171.5754 null] ->> endobj -2368 0 obj << -/D [2376 0 R /XYZ 238.8902 96.348 null] ->> endobj -2375 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2399 0 obj << -/Length 1725 -/Filter /FlateDecode ->> -stream -xÚ­X[oÛ6~÷¯0°¨9’%±oiív.’4s\`[[ŠÍÄBuquA’ýúФ¢›-'+‚ÀynüÎ�$cø#cŽÇ.s·lg¼‰Fx|ÓGD/Ï`}V'x·ýþ�ò1GÜ¡Îx}WJpb”ÐñzûuâÙÓõ°‹'Åò -† OÂjp‘l‹P¨ñ<Ù‘ˆs?’xú}ýi´XWzµYÌrˆÔúsôõ;oÁ¼O#Œ,î±ñ|`D8§ãhdSË|„£ëÑŸ•µP2ôíŽë”íQøtÕîD(¢ˆMgc<ùm+¾aLc½§/Ë«›wSƒ×ËrW Ϊ‰8©�ᬷÞiÎ,øW�’;õ››¥ -ƽ¿ù!…‹\}ßN)¬ÞM)›Ü‰tÊØI�Rq‘Cm«®ƒA´%ˆ¶•sÙ.)­lj!,%‘Iùah(ó�«‘ƒ5ÙS.²7rlMüx«x¶‰ÈZâb!´†<©+ “ÐO§Ä›Üwu†ëZžwLgL9é<‘[yPÌulS‘až©� V¿a“zýþÊ8 MŠûݾÈßh†QƒrwÁýîˆÐ–¯ìÒò¹ -§ Ì‰’Á×Îd–Ë›‘"YLVÁ>Ùçh× +îñF¡ôT1Ýdû0Èo’"Ó¾a†áŸ À¼À–…°í4òÁ9’¯7ŸWóÅêé }«7™n ˆ�ÌxõEƒ”nvA.6y‘6 ßÃ.ØìZyhG© Ã:èÀ‹E| � @[9fãÇMvä•¿ß-?Þ,.ç˳Kã"†/’>–åGô £ô·Ùœaò·ÛTÖ²F„Ób/BKPiyZ%¸¯RYNJ•r૵†J9_2y•JH›˜Â/e‰<‡ª�i¢TKËä‰Y®—¥×SG‘v\2yئc 3äy.È›Š~Vgè‰ÐŽ\‰‚ ¢Ž ³–íì0TCº¹¼àYVS· -fh,ç•;À] 0=ÙÁ7i’µ-´A&wø©0òK;R5H73•Ê6ÖbT£TëàÖ]�bÁ$U§‰ØZ)·à¶H{ᬈf5ªžæÐ–¥ -qG£ƒ8gNSãáÎdȇt·¤|ƒmz Š=dûQ*¢ãVP‚Ǭ‰@_¢Ÿ=C= »%³@,òÈÏ~D€;Ȗ玣¢+¸‡<¥¬nF½hš[…<»™{e– kzÖ^|Ôçî¯<éó�ž²XÿqZK¹Þ‹M E´{J÷!äl¥Qí=©¼MíƒÐ(�ÇÑBÞàbó¾rq6µá’ùÊÞD]¦—7GwOùr¹ºNºúR -sXžÈ\GïÚÕÕ³ŠE6Äd%�Ó”ë ¥†¡ŸÕz²#·–P%�K&…Õ´©Ýr Õ€%–…¡’pÞ´D]º¦[�ŽN‰u¢f2GwOÆš®æY˜~v¦üÈuFÙZcã•ñ,"Ñû2pJºúKó�àà w¾¼^/.¯>¯dÜ®¯_ðÞòªKv@AR—ÛÆ…rŸ¤yÖ‹×óíóoß5”¾æÎ)ßn!xìþPÄ€ q˜ó¿˜ËrXH½Òó±#ï ^È¥�)ˆ�"©|%h¾V]˜Á'Y•ŠØD�þÅo©õ–êë7ÅØQ£òáÖ”¤î£»¹:̓ǧ{Ñyj—oà=(ýçžÛendstream -endobj -2398 0 obj << -/Type /Page -/Contents 2399 0 R -/Resources 2397 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2292 0 R -/Annots [ 2404 0 R 2405 0 R 2407 0 R 2408 0 R 2409 0 R 2410 0 R 2411 0 R 2413 0 R ] ->> endobj -2404 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 421.5214 227.254 444.4901] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2405 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 421.5214 380.3883 444.4901] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -2407 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.808 302.734 388.7368 313.638] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -2408 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [490.9727 302.734 513.9963 313.638] -/Subtype /Link -/A << /S /GoTo /D (a00144_g12b467f314489259dd718228d0827a51) >> ->> endobj -2409 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 290.7789 143.0105 301.6828] -/Subtype /Link -/A << /S /GoTo /D (a00144_g12b467f314489259dd718228d0827a51) >> ->> endobj -2410 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.9993 290.7789 209.4109 301.6828] -/Subtype /Link -/A << /S /GoTo /D (a00144_g41d37ea1e3bd24f7b51e9409aceaaa80) >> ->> endobj -2411 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [226.7857 290.7789 297.4 301.6828] -/Subtype /Link -/A << /S /GoTo /D (a00144_geb79c914cf137e6d27fd7583e5a66679) >> ->> endobj -2413 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [261.4335 197.9645 328.7205 208.8684] -/Subtype /Link -/A << /S /GoTo /D (a00144_g30e827f33eacff55ecb4d8fb5a11d5d1) >> ->> endobj -2400 0 obj << -/D [2398 0 R /XYZ 90 757.9346 null] ->> endobj -2401 0 obj << -/D [2398 0 R /XYZ 90 739.9346 null] ->> endobj -2374 0 obj << -/D [2398 0 R /XYZ 224.7534 640.6243 null] ->> endobj -2402 0 obj << -/D [2398 0 R /XYZ 90 623.0456 null] ->> endobj -2341 0 obj << -/D [2398 0 R /XYZ 238.8902 547.8099 null] ->> endobj -2403 0 obj << -/D [2398 0 R /XYZ 90 530.2312 null] ->> endobj -2314 0 obj << -/D [2398 0 R /XYZ 208.1261 381.0771 null] ->> endobj -2406 0 obj << -/D [2398 0 R /XYZ 90 363.4985 null] ->> endobj -2316 0 obj << -/D [2398 0 R /XYZ 233.9089 276.3076 null] ->> endobj -2412 0 obj << -/D [2398 0 R /XYZ 90 258.7289 null] ->> endobj -2342 0 obj << -/D [2398 0 R /XYZ 238.8902 171.5381 null] ->> endobj -2414 0 obj << -/D [2398 0 R /XYZ 90 153.9594 null] ->> endobj -2397 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2417 0 obj << -/Length 1471 -/Filter /FlateDecode ->> -stream -xÚÅXëoÛ6ÿî¿Bè¾È@­‘Ô;ߺ¼–"M³Ô:´E K´¥E¢\‰jšÿ~Ç—e)Šëa(† y<Ýï~÷°°…à[1²B?tb× ¬´š!käËÖÇ 8_ì3ü¶œýzAb+vâ€Ör-%Øñ &Ö2ûd&óñ‘}Z³Ï‘M×$¼¨™"Ö[±nÕf='¾]7jÓ]ÝÂ"£ÈŽüù—åÛÙùrgˆ¶Ów,Ìø:ûôYØûv†7Ž|ë6ÈÁqL¬jæ×lÊÙ‡Ù;9ê@¾0u]»S÷uG÷%° ÕuϨ¸#+ú&\=Ë‚Qµ"~¬/¿VOñJ©»b >qrG\¬XàÐ ˆçIéwtMÊRš)æÕÓî¥û”~F>‚üº'—EË)$,ë9:6䑚GQ;\ìÄqèí‚êãù#„ì_2um}‡?¯nﯯ¿¿>¿Ñ²Ü¡,â9®c)k™Ó�ƒôŠ - |›cߦ¥"å4ÉhcŽÙ†O;h™KØ6O®Äcálºn©ŽGÁx=bÞXÍ ¸e­�9¸{Ä$a9°ÛiÂÔb¥™ÖuÇ2gNsí q�Zsžó9¶sp›MaÑ0ÊeHÈ/t´yÝ•ÙPž¶ÌÐ6c¯¿?Æ÷•3÷t!ûÃ5ØŠ1¶uÔ§T ­Ù;Ç(ÈF“>àžý €oÓü¡íª �o›:¥m{åí¶,ø}ÝñmÇ�Bº;@:9€ô÷——W7—?Fúå´©ÀK: -…öNYo6Û ]–Ò†'…vñ^>0~ †i]m‹Ò8¯`‡r$Ò9»kéº+­ª[^>©õZ" 2ªÒBÚ °ö�§óVpu,•hÕh{ö"ÏòA;ADUXqÒl4ËÝ^­Ý±/öøŸ×ÛgRÅ•d¡«7&®cK\ˆ(�( •zÃsX»ëzr h¯º–+WÈ8€¿Šj[Ò -b%Cé´…gÛ\±p㾤Ió‚Ó”wPjD¸3Z‰Nm¥Åƒ›z  ÿ^{}L&ßA63¨¨Ç¨p�Ïktl^×>Ü—“êÝ›�wsÙË�ŠÛHPdWÉ÷¢ê*µa]µ’eÖÒlxò¢’9ËD=Z*’k#B&aŸ]p¸ÒrÊ›„µUÁU\åäˆ>æFZ3FSíH!|BV²ª�r°‰ sœÕ|”ìyÂ6ÏDMýŒ*=*Åÿ ÞA4|øëfÿX@@î�½p o4 %ŠêÔ~ˆ 8ÙÅe(€6F†<ÒÈèepä†~íh;;èé*ñM¼3 -%%öè<uYuƒª#Þ±¶KE, ¶O‚ä8ct¬í0òŽŸHþÏÈ6wÿeäÝBgsvvwúþæâLj»ÝU^3%&YÖ€QzÓ&�4y7ùƒÇ(@;nÅÊÀ„W[�ûJ‘¶Iú0Ç0ðVÊ&-N`€ãR¿ \‹¨ÅèðÈUið{«$ëZÕx((êG™¢H‡ÆïCã¿ZkJ ­ÚfoøcQ–Úž4Üy®µ²)xÓjËEãP9 ž½Óâ@Oq@Uõ$MÁÌ�È—Þ“ØÚM„¶‘雂Á¬¤¢;ã`Åæ£«Ów·J -MóZŽò¬w¾Ú« ‹ÕŠN�ãI ÔµÊwQôò¦®v9Îx˜‰|á(´0!NäFÑä4c˜û\ϬG±ƒ� ²`¬ cÛšÓ“±RŒˆŠ‘ä ÖׄÚý¬Á(tBìú½´a9z>®›‡ÖL,åÓpÈ™yqõñüLt‘žÃqGÿrÙ%Õ,Hàx1ŠŽ.PX4££ -Ôø£†>N~;AàøÁú^!?ÀDð -vÉ~HjZd¾Gh#Äm/)£MÂûáO=ß™Å[Ñ::½1_j0:!î AºZ#¼ø}Fp;hXŒÏêïOúì÷€ø˜2áŸU%©Áendstream -endobj -2416 0 obj << -/Type /Page -/Contents 2417 0 R -/Resources 2415 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2425 0 R -/Annots [ 2421 0 R ] ->> endobj -2421 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [293.1521 514.0489 332.2253 524.9528] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb58e1ceb7cb73ca2bcd73146b6c1b4e7) >> ->> endobj -2418 0 obj << -/D [2416 0 R /XYZ 90 757.9346 null] ->> endobj -2372 0 obj << -/D [2416 0 R /XYZ 319.1084 712.3476 null] ->> endobj -2419 0 obj << -/D [2416 0 R /XYZ 90 695.8178 null] ->> endobj -2370 0 obj << -/D [2416 0 R /XYZ 368.9116 591.1728 null] ->> endobj -2420 0 obj << -/D [2416 0 R /XYZ 90 574.643 null] ->> endobj -2345 0 obj << -/D [2416 0 R /XYZ 238.8902 487.6225 null] ->> endobj -2422 0 obj << -/D [2416 0 R /XYZ 90 471.0926 null] ->> endobj -2346 0 obj << -/D [2416 0 R /XYZ 207.0201 378.4029 null] ->> endobj -2423 0 obj << -/D [2416 0 R /XYZ 90 361.8731 null] ->> endobj -2315 0 obj << -/D [2416 0 R /XYZ 207.0201 257.2281 null] ->> endobj -2424 0 obj << -/D [2416 0 R /XYZ 90 240.6983 null] ->> endobj -2318 0 obj << -/D [2416 0 R /XYZ 238.8902 96.348 null] ->> endobj -2415 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2428 0 obj << -/Length 1383 -/Filter /FlateDecode ->> -stream -xÚ½XYoÓX~ϯˆ4cKÄs—رy+4@P 1ƒfU®}_á%x:¿~ÎÝÇ1iDѨRï~Öï,1ž"øÃÓMî èÜ›ÆùM·°ý|‚õñ Îgý OÂÉÏH0 œÀ#Þ4ÜH -v\‚É4L>X¾gψ�ÈjWo`ê" ;HM®Ë¤Í˜š_–q›³¢‰^ö§ðådv|µX.õ°àúeòáš& ÞË rhà»Óo°@2Í'sBÍ"›¬'vtÔ�|0¦�‹é9êX.”vžƒ‰C Jb„�õ[Â>"D -­Ô»Õ››·Ë‹õzyýäʈõ·Ð HÒI0)™;t(’¡=w­¶*…R�u»Û•U£›²RcÑ]¶1²˜¾P±¨®Y~›ÝÙžk9‚©`ƒŽGæT²‘Þ „ʵZõ^Êu¹#±6U´îa‰Ú7¯÷œkÇž¹$°Â”kZ5mÅjE¡b_Z®WÔŠ -=& oÊ"Êô2/ۢ鳦ÖÛ‹ëN쮫ìÔ”pŒ+-³DÍšÌN1:TnmðÛØÄ™*µ÷½ŠË„©YÍÿÕ3©šx½ÛUåwžG “×áù!Íí®aÂsßcè‡=â#º >¬$6j”rJ(D¹™I¹Ä,ª—Z¾»1T寋�ÈEqYÄnÁQ‰¾y·ïáÛwÏÖ«–p;ÃÀô]a1õÈÂYPŸ±°2—fý[Ç¡åBhÑÀñ|Ï•–yU6ìñ�+Fè|šmwk„o?þ0‚SLÝ=5ÁøŒÐ:pSQê )‹„©¿rsÐa£‚P„ ä5#žCi ”¼TIƒËÔ§ü©‰eܤìz‡xO²½·Ë]㤎N/Áaz¡µÂkq*c=]®þZÞ¼_½º|mÃæûSYK‘ Ó#L7J¾ÚصXÕðÚ€­b1ã”úèwÛu-mÒo¼HJqöm$‹Í%ÛuZ¶"ü ñ¬[¦ÆZº -&™~,ëÜaÎ#XR$³‡ØV‰WJn˜I¹ûG‡±$8Ä’ µ/±°éŠ4‘ñ8Ò~íݨd3Â@N‰Y­¯ð".s^lÕ*‰šèÑXê0¥ åÛtÕ”,<ß„3PË(ðzä•â•L{ApV3Èßñç%åS¼_cÿŒí9‚jŠ}ëµæ}Fñ5VáB Q•H›**êœ×u§ZÃsV¶Z¿XT-iÞ»¡�³k³ZÔ„£©r)#Ç`¹ŸMnµ‚ÿ/àHf¯óK> endobj -2429 0 obj << -/D [2427 0 R /XYZ 90 757.9346 null] ->> endobj -2430 0 obj << -/D [2427 0 R /XYZ 90 739.9346 null] ->> endobj -2348 0 obj << -/D [2427 0 R /XYZ 238.8902 601.3918 null] ->> endobj -2431 0 obj << -/D [2427 0 R /XYZ 90 584.8893 null] ->> endobj -2344 0 obj << -/D [2427 0 R /XYZ 238.8902 497.8687 null] ->> endobj -2432 0 obj << -/D [2427 0 R /XYZ 90 481.3661 null] ->> endobj -2369 0 obj << -/D [2427 0 R /XYZ 207.0201 388.6763 null] ->> endobj -2433 0 obj << -/D [2427 0 R /XYZ 90 372.1738 null] ->> endobj -2347 0 obj << -/D [2427 0 R /XYZ 238.8902 297.1084 null] ->> endobj -2434 0 obj << -/D [2427 0 R /XYZ 90 280.6058 null] ->> endobj -2349 0 obj << -/D [2427 0 R /XYZ 238.8902 205.5404 null] ->> endobj -2435 0 obj << -/D [2427 0 R /XYZ 90 189.0378 null] ->> endobj -2317 0 obj << -/D [2427 0 R /XYZ 207.0201 96.348 null] ->> endobj -2426 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2438 0 obj << -/Length 1725 -/Filter /FlateDecode ->> -stream -xÚµY]“Ú6}çW0Ó˜ ª>,YÊ[»›¦I›NšeŸ’Ìž€M��dÿ}¯°dŒ%,§ÙÎ>¬�¯Ï¹_º: 2ÆðGÆ -�c#Å"1^îGx¼��_Žˆy<ƒç³¶Á¯óÑÏ¿Q5VH *Æóõ AÄ)¡ãùêýD B§3Êñä&Ï>`L7U±(Ó<«?ÌúúX߬§”Oò¢¾©^½… K9‘ñôãüõèżqÄøÉ™ Ú�Fï?âñ -ü}=ˆ)ÉÇ_á#¢ïGeöf7ºýÝàÔN/øÂå„ ‰—Âm|ÁÄL0Æ“ŸV‰:Kê î_½}˜Ïÿ¬oD¤Ã<ÖƒÓ±HÕxó­yó” øß¼ýs\¦{ó¸Ìëÿ»TçðË”ð sb²¼¾9,–Ÿ§O’Òdþ˜de}õéñœ~BÈiµW$F‚FÌx•Ú·yµ[Õ×Y^ì»Ý£½³ˆÆÅåv‘m’U0:ÞÖYJÏ�±(m@6w$êD£_Ù™‡Uz€VB[dRª.SÊb<&%b×Ktûöáæ÷7ÜÝ¿¹ë+R�8ŸJðj³Ù%&+©ñplìÉòó±Ú{²fÓSó‰]�AÔm|É&2sIPL„ô¶­5šµ­ÜÖ• -aÌK1$Lÿþ•—Éó.)ÁÅŒ’~ÖÆÊCÛNÁ1> endobj -2445 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [203.2945 407.1106 229.0877 417.9898] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2446 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 333.1135 139.4144 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -2447 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 333.1135 175.6584 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -2448 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [178.6472 333.1135 211.2546 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2449 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [214.2434 333.1135 247.4088 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00047) >> ->> endobj -2450 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [250.3976 333.1135 278.6812 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2451 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [281.6699 333.1135 310.5115 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00039) >> ->> endobj -2452 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [313.5003 333.1135 349.5247 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2453 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.3901 333.1135 412.6078 356.0822] -/Subtype /Link -/A << /S /GoTo /D (a00050) >> ->> endobj -2455 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.3132 280.0189 219.125 290.8981] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -2456 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 206.0218 139.4144 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -2457 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 206.0218 175.6584 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -2458 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [178.6472 206.0218 211.2546 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2459 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [214.2434 206.0218 243.0849 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00039) >> ->> endobj -2460 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [246.0737 206.0218 282.0981 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2461 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [285.0869 206.0218 321.6693 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00045) >> ->> endobj -2462 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [341.5347 206.0218 384.7524 228.9905] -/Subtype /Link -/A << /S /GoTo /D (a00050) >> ->> endobj -2464 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [230.7012 152.9273 279.1888 163.8064] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -2439 0 obj << -/D [2437 0 R /XYZ 90 757.9346 null] ->> endobj -2440 0 obj << -/D [2437 0 R /XYZ 90 739.9346 null] ->> endobj -2319 0 obj << -/D [2437 0 R /XYZ 238.8902 670.3741 null] ->> endobj -2441 0 obj << -/D [2437 0 R /XYZ 90 654.4845 null] ->> endobj -2343 0 obj << -/D [2437 0 R /XYZ 238.8902 558.783 null] ->> endobj -2442 0 obj << -/D [2437 0 R /XYZ 90 542.8934 null] ->> endobj -2443 0 obj << -/D [2437 0 R /XYZ 90 451.9385 null] ->> endobj -1385 0 obj << -/D [2437 0 R /XYZ 90 425.3268 null] ->> endobj -2444 0 obj << -/D [2437 0 R /XYZ 90 425.3268 null] ->> endobj -1321 0 obj << -/D [2437 0 R /XYZ 242.1978 314.3947 null] ->> endobj -2454 0 obj << -/D [2437 0 R /XYZ 90 298.5051 null] ->> endobj -2313 0 obj << -/D [2437 0 R /XYZ 242.1978 187.303 null] ->> endobj -2463 0 obj << -/D [2437 0 R /XYZ 90 171.4134 null] ->> endobj -2395 0 obj << -/D [2437 0 R /XYZ 242.1978 96.348 null] ->> endobj -2436 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2472 0 obj << -/Length 1155 -/Filter /FlateDecode ->> -stream -xÚÍXK�Û6¾ûWèh1Ë7©=y  H[ßÒ`á•d[€,9zd³ÿ¾C‘”õZËA/�¦È�3ß|$gD‘Ã�!”P(d\Ñy…ƒ#tZ7¼…ñmðûnõÛG! -%•ÁîÐZ� Jh°‹¿¬µÞl©Æ -¯›?>CSà5AØ6þ,â&Klû}5ç$¯÷uZ䛯»ÇÕ‡]ç×ÑLãõÛêËWÄ@ïq… µ^à#†48¯8eþ![ý³ú«³cÚ sÑ Âî �£²ÑID(bˆo¶c¼®_/IœÆô‰”ˆ)ƺ©­s3Räï�¾íá§T&V ¡&½<ÕÑåi¹T eòT�ÉP®�‚yC2#%:Д©�’”êÖûîäVÓa[ÅÁõø!`–¥‘]æ¶£åéAûÚ¶ÒÊõöÿ9ñà¢Lb‡É¯¦GA2 -›L`}¥w[ò¿íO˜<µëE�Š|²m™Ðˆ0"G,FZw¨%ß›Q:ô]ÕeÕM™ ãVN9Ô–(hpæÆ ÚTÍ>Ë^G*Û}ûà•õªï½èƇmŸŠ,NóãòZ¦ù¡(Ïí £ÂD«@ -8=ZªY]ãõñ¨£* eS®ù/ZB;z÷–Ðþ„%töb ²x³„.øö%tà{©„ò_¹„ -àˆ Dy³„öQo—PA5ô)~g ½åú§Kè”ál í`†b|Š.Ñ\ …0àr[›µäzb­—@¹·ñ³ù“«·óg™TEö}#źŸE A¡Ô§Q(nº ñW��M]OnUÓ„LÍkSHz–q¶¾o0LÝŽ6G4+Žž¯ÀÑi_Z›°Ò=Á(E”ጛ³( E)Ä�¾…œ«ã 7"‘Ä�6½A¨¿:[Â!‹̇�|.ÓÜi^4õà$v×Ð.–sRUû£;ýxîÔ3¥×‡NXótnªÚ´Â6­šžÔœ£µÉ¦ãùÕþ·i»�ã®»f–MÓ¦·©çÁ0#„˜wóhÞQZ¬gAÖo£1�—S{‹ -³hb�”vêÞšP}p~ÝmàÃDv;%¤ ÍÝ "\Í~À°*D -ù¿.èí SÜz%3x�lËLä’vTL Ÿ> endobj -2475 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.377 726.9533 248.7336 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -2476 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.0545 702.4697 359.1278 713.3737] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2477 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 649.2336 135.5587 672.2023] -/Subtype /Link -/A << /S /GoTo /D (a00039) >> ->> endobj -2478 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5475 649.2336 175.1299 672.2023] -/Subtype /Link -/A << /S /GoTo /D (a00045) >> ->> endobj -2479 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.9953 649.2336 243.1941 672.2023] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -2481 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.377 591.5789 252.071 602.458] -/Subtype /Link -/A << /S /GoTo /D (a00153_ga92afb113e122f860392bfbd385f842e) >> ->> endobj -2482 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.0545 567.0953 359.1278 577.9993] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -2483 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 513.8592 139.9724 536.8279] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -2473 0 obj << -/D [2471 0 R /XYZ 90 757.9346 null] ->> endobj -2474 0 obj << -/D [2471 0 R /XYZ 90 739.9346 null] ->> endobj -2396 0 obj << -/D [2471 0 R /XYZ 227.8216 626.7922 null] ->> endobj -2480 0 obj << -/D [2471 0 R /XYZ 90 610.0651 null] ->> endobj -2484 0 obj << -/D [2471 0 R /XYZ 90 476.7479 null] ->> endobj -2373 0 obj << -/D [2471 0 R /XYZ 90 450.3624 null] ->> endobj -2485 0 obj << -/D [2471 0 R /XYZ 90 450.3624 null] ->> endobj -2470 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2489 0 obj << -/Length 2005 -/Filter /FlateDecode ->> -stream -xÚ�Û’Û¶îÝ_á·Ê3k’ºXê[Ó$ͦi›“º/§íìÈmk"K>ºÄÝ~}ÔÅÖîf:ž±H@\€r)à'—±Xn‚�{~¸LO ±<ø‡…äå5¬¯Ç¯¶‹ÿ¼Uñ2vãP…ËíÞP¥(©–Ûìw't¥·Z«@8ÝýGl¿çA{¬W2rªîp³žq±÷ŽQÿ� ©‰¾�sFOC�¶4ï7ÖKj<l‘„OQÃÁ'»�¢}e®5 ë»y}rÐõ2¢¬Œ8´U4º3Ûå*Γ3Øô\çIË€R³ÖŸ Ωë½9XMô�Αs%Љ1äÇ„Ü'² ç»2âTû²^3SòcìO–1cÊèã)aÕ÷" cÒŠRÁ5/)0'Þó{¬—øBQ‹0¼â+„*ô gÊ_sÆ¥úÀ8ŸÆ2Xü—d¸¡‹2ôáoÙ7’P =«‚ÐsÃÀW ëgF] ÂM"]åǃ¤�XF ièI¡›8Zöh(éO#—RËè&Æë kw�³Û¬×Þ8ëå¶6¸TS'M¾Tyvý}‹“ïVÝ·¶èóƒiÑ—³oÅ$ãôqã]¤(�]Žñ•Za÷ÕêBàþ¾–•7o»ÒfsqÅ1ÂÓq4Fx&Žz´ãèYŽC½À×ÆÑ„/å30ÛM$¶”Áïg"‰ñ_’â†.GÒƒqÇðBô†+i”ëyAô¼&z¬dPB¹^É€™Éj䜧üND®ûÁWúÝû¹hµh(É»¤Ìl´öu�™AªC ‡t÷„Œ^ŒM`ð•±1Æž� (à ;Šü¡ËRÜeÙ@á.«J»¡#²©j¦Ï’#J}ÇöÅ$9{…Üø„�’•äÄJO5sòemN4yÝãl9%‡Î~tJl°š3ômf-ÀÊ@Ç´ÃiIcöЗ/FSN=ìИݞVìêÆ=õ½Ð÷Ñuš‚‡e1X€'“îšž+S õý…5‡:³ºº.†ìÉ rÚÀ¥{��\äs½MK3œ› -¾ }ö]Q¬¹lÇ9ÕÀ@`Ú•âFþ^ò¢ ÑŽYpQ‰»¸| —NŒ1­ó‘}É Û:)è÷Z�Íu½�>'5TdТ…�ƒ­HY»nâ±]#HuǪ+2Z1•ÀRèã�»“ÑLßê„qLÙd€$…ž§ qFm^ž2¡¬·LÀ:öH”;Dß8£íˆÂa=kÁ3Sšï ;ëÙHÕóœ#†OÑyH<0¸4€'. óœ·%MAŸñÞŠ€;f`üæ­å8õ{Üø=’,³+QÎÉcQ%Ù˜³7欘³‡œgá‚-ÁÔ|Ç@Ý>´Ng8®i#LCg‹˜B—[ïÛ®©¯pžºS¸Xâ¢iuT0Ùö¢¯¨F�ÉCa»> endobj -2493 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 503.0404 171.8124 513.9444] -/Subtype /Link -/A << /S /GoTo /D (a00134) >> ->> endobj -2495 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 420.2854 201.2321 431.1893] -/Subtype /Link -/A << /S /GoTo /D (a00154_gb4b17aaf20d630f30919b19937b966a3) >> ->> endobj -2490 0 obj << -/D [2488 0 R /XYZ 90 757.9346 null] ->> endobj -1776 0 obj << -/D [2488 0 R /XYZ 90 739.9346 null] ->> endobj -130 0 obj << -/D [2488 0 R /XYZ 90 739.9346 null] ->> endobj -2491 0 obj << -/D [2488 0 R /XYZ 90 716.7484 null] ->> endobj -2492 0 obj << -/D [2488 0 R /XYZ 90 521.9904 null] ->> endobj -2494 0 obj << -/D [2488 0 R /XYZ 90 439.2353 null] ->> endobj -2496 0 obj << -/D [2488 0 R /XYZ 90 382.9653 null] ->> endobj -2497 0 obj << -/D [2488 0 R /XYZ 90 356.4803 null] ->> endobj -2498 0 obj << -/D [2488 0 R /XYZ 90 356.4803 null] ->> endobj -2487 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2501 0 obj << -/Length 1890 -/Filter /FlateDecode ->> -stream -xÚ­Z[oÛ6~÷¯06 °ÌñN1ź&mS¤ÁÖ¸ØC[Ž­Ä;³äfEÑÿ¾C‰”)K"U¬SäÑùÎå;$E‰ 1ü‘¡ÆC%ÒŒËáâa€‡÷Ðýz@ìðÆ'¾ÀÓÁo¯¨j¤%•Ãé]¡A$(¡ÃéòãHãñ„&XáÑáòOh -<"—�w»åa“–íóÝâð�nóy¾ÞmÇŸ§oÓ -ך%˜$õŸÁÇÏx¸óÞ0b:Ã'¸ÀˆhM‡N™»Ø nUzÊ�â†6ïaí‡:ÿ(¸«J÷$"|Íò� Jѹ² ÊU”ÚØ1¸æjžŸ ?îÖ[Û÷´J}Íe˜¤B˜ekaÚ´s·ìy<š[¦B¬PGQ1(£Ä–æ+(¢¬e&J!†UÒ9Áùå P#!–ˆ³„õ°O”ŠS,‚M‰ F¬¤b¸À~�¥<ÁÆoÒ2ЄP}Šl†ö÷Væ½oƒ“�ÙÐÐ[dn�V 8GJsö�Á¨1|ãÜ—i‰“Bæà‰�1ÉŽ&B…$`¢ä…‰0¯b¥“a%šQ3g%ŠPʘë°IÖ"B�ƒ„wŠ%ˆ &b„rbqBy -C„ -ãV„ªáFUCîC¨° ½%¡&ÙÓ:_¬Zx¥ Â)SáH Dý ¯(Ckã•3–^ºµÒ›«ŠÙ~7ÁÅV^·Ä» ŸÇDŒVŸ°ÀðOl?h7Ýd -�åO!+× ³u -“µ‹’ÕW kבµŽ&k¹Y#64ôZ²Î—Ëýf~›n²Â&À¡d8 A‰òÇËØ™µ/LØJì§¶ÚFþrUx_^¸eúË|sH³_ìî2�ÃÆ«Ø¯ÔAï‹N^sÅ�Ô’õ ‡']mÜ�»à6gÚ”.)"qžöl[·ÜìF9'ÝEâ „ŠÄ‰Å‹$„èI·*÷×¥õ´¹FK¤¨"'àÝuâäcf4ô3f³«—³›¿§—/ßÌÞÌf§ÆPغ)*U$ÜJŧ1Ì ¤¨ŠeȉÅ3ä) e(Œ[eÈÇí‘¡xŸ …Íhè-6I/g—×—Óæ O˜B$‘8©tC[9‘ œy+^ùó{ùƒŸ·”(Óð$Ä ë$€/ @%%@ñH€®#@ 7N€:xDÌhèµxqóáÝE£81‡šL’p *©xS[Š àIç7»:ÁRd©qÖF xäЉî~ÀóBÔpbqj„=j„q+jø¸=¨QïC�° ½–7-SEDp €“Š!7´E§XT.¯/f³ç§Äp­ü�a“àN~x!~8±8?Bˆ?¸?|Üü¨�÷áGØŒ†^Ë�‹ëó¶¥CxÀIÅ�ÚZøñ½-á‚"œ¨î|ÇCé¶Rñlà¼dA«\{ =Rí#÷ÉtІS­}öAß«-B÷TWt¸þpuÕ–vØîÐÔ�wO ”x'Ï|ÑK}·Ê½�Û#ù5ð>Ù›ÑÐÛs‹Š�·E‚7µÕIÐ’l*0§û‘Í%ۉœBô’Æ­’íãöHv ¼O²Ãf4ôöYôƒ8.úa䆶–r_îjû?3úÍ­óÅÁ "€ã>"ŒÜÐÖ˜\N�&ºRí½ašŽ}}L—é]Û)±w¯?¾@€•X”AÄ#?"¸Ž5ܼô³¬�Ã6[ßoÝq`¶Úíóæz�@]KrbS'm*ùˆuM½å!ì¬iekxŠG…Y©è‰å qªc H%Ï–§0”­0n•-·–­/cŠG»µ}G ï†S̽u‡ €µ½pQ‚èk»ËßÉÇìnèíÊ£9A—æp</m…ÀŠhBZ³m^¥)Ôÿúˆ¤ C·uü³f‰´2¯ï`)ƒÍ÷"ŠÀ¯’…k¯ÓmºŸç§gèï\ã­yós°„Ú_|FÙµßËPŒ¥=NS1rl4?¬¹ýê>ªù÷ë}ÚøœÆ|çâLó¢ôàÏÔ®endstream -endobj -2500 0 obj << -/Type /Page -/Contents 2501 0 R -/Resources 2499 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2425 0 R -/Annots [ 2505 0 R 2506 0 R 2507 0 R 2510 0 R 2512 0 R 2514 0 R 2516 0 R 2518 0 R 2519 0 R 2520 0 R 2521 0 R 2522 0 R 2525 0 R 2527 0 R ] ->> endobj -2505 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 576.2119 145.7904 585.0586] -/Subtype /Link -/A << /S /GoTo /D (a00125) >> ->> endobj -2506 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 537.3577 175.12 546.2043] -/Subtype /Link -/A << /S /GoTo /D (a00124) >> ->> endobj -2507 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 498.5034 190.0538 507.35] -/Subtype /Link -/A << /S /GoTo /D (a00123) >> ->> endobj -2510 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 414.6673 235.723 424.595] -/Subtype /Link -/A << /S /GoTo /D (a00155_g44311ecc30759ca38b4069182247bdae) >> ->> endobj -2512 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 401.1132 185.352 411.6435] -/Subtype /Link -/A << /S /GoTo /D (a00155_g2c1bb4fa6d7a6ff951a41c73fc721109) >> ->> endobj -2514 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 388.1618 205.845 398.6921] -/Subtype /Link -/A << /S /GoTo /D (a00155_g1ec8b8f4710dce1fa7fb87d3a31541ae) >> ->> endobj -2516 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 375.2103 183.1503 385.7407] -/Subtype /Link -/A << /S /GoTo /D (a00155_gd8eec328a4868d767f0c00c8d1c6cfc1) >> ->> endobj -2518 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 362.2589 185.91 372.7892] -/Subtype /Link -/A << /S /GoTo /D (a00155_gca51ceb2f5d855dfde55bcedf8d3b92d) >> ->> endobj -2519 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 349.3075 185.352 359.8378] -/Subtype /Link -/A << /S /GoTo /D (a00155_g2c1bb4fa6d7a6ff951a41c73fc721109) >> ->> endobj -2520 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 336.356 205.845 346.8864] -/Subtype /Link -/A << /S /GoTo /D (a00155_g1ec8b8f4710dce1fa7fb87d3a31541ae) >> ->> endobj -2521 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 323.4046 183.1503 333.9349] -/Subtype /Link -/A << /S /GoTo /D (a00155_gd8eec328a4868d767f0c00c8d1c6cfc1) >> ->> endobj -2522 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 310.4532 185.91 320.9835] -/Subtype /Link -/A << /S /GoTo /D (a00155_gca51ceb2f5d855dfde55bcedf8d3b92d) >> ->> endobj -2525 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.1599 253.2274 224.0961 264.1313] -/Subtype /Link -/A << /S /GoTo /D (a00155_g3983e0c026396d5c4506779d770007ba) >> ->> endobj -2527 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.7556 240.276 190.6918 251.1799] -/Subtype /Link -/A << /S /GoTo /D (a00155_g2bdc4b7b4038454a79f1b2a94a6d2a98) >> ->> endobj -2502 0 obj << -/D [2500 0 R /XYZ 90 757.9346 null] ->> endobj -1165 0 obj << -/D [2500 0 R /XYZ 90 739.9346 null] ->> endobj -134 0 obj << -/D [2500 0 R /XYZ 90 739.9346 null] ->> endobj -2503 0 obj << -/D [2500 0 R /XYZ 90 719.4886 null] ->> endobj -2504 0 obj << -/D [2500 0 R /XYZ 90 593.1046 null] ->> endobj -2508 0 obj << -/D [2500 0 R /XYZ 90 432.641 null] ->> endobj -2509 0 obj << -/D [2500 0 R /XYZ 90 432.641 null] ->> endobj -2511 0 obj << -/D [2500 0 R /XYZ 90 418.6523 null] ->> endobj -2513 0 obj << -/D [2500 0 R /XYZ 90 405.0983 null] ->> endobj -2515 0 obj << -/D [2500 0 R /XYZ 90 392.1468 null] ->> endobj -2517 0 obj << -/D [2500 0 R /XYZ 90 379.1954 null] ->> endobj -2523 0 obj << -/D [2500 0 R /XYZ 90 269.8939 null] ->> endobj -2524 0 obj << -/D [2500 0 R /XYZ 90 269.8939 null] ->> endobj -2526 0 obj << -/D [2500 0 R /XYZ 90 257.2125 null] ->> endobj -2499 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2530 0 obj << -/Length 1914 -/Filter /FlateDecode ->> -stream -xÚ­YÛŽÛ6}÷Wy²�,Ëû%}j»M�-Údß’ PlíZ¨/[YÞ&ß!EÑ”d“ -øÁºÍ Gg‡"™cø‘¹Ás%2ŒËùj7Ãó¸üjFüí¸~½›ýô’š¹AFR9¿»w$A‚:¿[¿_HDÄò† -¼¸[½¨veÝžn«ÏuQ]~¼{3ç„!Ì'öCìÕÙïwÁ±�K0I¬Ûgï?âùâ{3È-æÿÁ FÄ:ßÍ8eÝÉvönöw°ÓÞp\ž ìòøGp…v¤0^��`œ`kƒ #„³Ydâ2Ø@Ä[¹-›¢Ú–ëÖÈmy\ÕÕcSöÞ‹’ v¨@’HáìÜmJû”\4]"Dá®?Ö‡%‹§j]ÛÛ÷§ýÊ?¶€ûƒìX6MµxnÏÔ¢.ýy‹*öë×›¢>ßp~�þ!�ŠŒ®6å꟮îÛ«E³eŒ*ä -Fµ)Žm.Jû—Ǫ.×(’”3üeßâŠÇÇmµ*\ÎÜ…Ý騴GÏvÅþTl·_Ÿµç.¢ö° þï®L{¼)–/žlå(˜Ÿ=~Syt÷¿?x·ëÃÞ?VœšÃB[Ù –R,#áíHlpx�Æ›„ÿu¹Úµcœþjá¹!ãBÔHJ¡|I›ú´jb³c6)([†�¢}}ÖøvëV«òè=6ÿï(w9Ö]±ö7?[þiã^5œ>ª}Ó¡G–Âmb -¶�¥ìs¢õ&|úb¥Ða¢Õ\(Ž(5äb�w ›5Ö2mYš ª=Ëþ<4å‹¡W‚)RŒ’´Û€ºà7~+¤gkçê6êœjU7œœŽ®ª- ƒ)H˜¡˜"´·ê�yÅð™XÇvm¬¿m®®¢‡ñH�(3&�±€ÊE¡¬œjÓ�¢¥–ZìÊâxª£ì¡å dñÚ²ðiIAƒ¶>sÇÍá´]·ÇŸýÇÇrU}À˜–þFµ?§Ù€ÂAQ{ÂJ†¸¼OXx7^Ñ]-ˆŽïVƒ|®¢)£Ó…á¼aEÂã†c˜bykû%LÇ 3&7@s }m&�—X(gšŸíXg(cöÃST°´Ç€ÊùµŒÂPñ}¿�ÿíˆÕ„�:P3ô|•ÕŸ‹ad·¯:›Q B#¬9I§@`È€­û%Mº�/…ô7\)D9!T�çB•Ü… -ÍVFÏ̉… ³ß‹Ø Ëw0¡• Îþ¦O-¹ ¦] \JD5‘é€}¼ÐÌ(©´ƒ4@§¥r´ë`yÚES´Kû ´ëùÍЮçy -íÒ1Œìöi·Óšbj_P*p�IN¿•v f+ÁXŽvl -íªÝã¶Ü•ûÆug×éF R†O 4B‡†ý,š@9¦ ¢ -·ry[4EÍ;×�jÛ·_TP&¸]Éð«TŽ *X–ÊI�g*güvTîùõ-àˆÊº>¦žTöø\ #»g*C�À]Éezð¦ULå7’˜1 h’áp‡êzï®û_B®‹"ƒµ—Æ”LŒ$B_f)…¶”*¥ÛI=,ÌÆ´¤0Ùz]`£û Rv¨,'SîΔL;í;}²kªCµSÀ„ˆ¾ã#=<ÂÐjàã'XÜŽb€†Ò¢Óƒï@ÏГrMûž?`�/W$…U§ŠN~€§ƒY½ZŽ”B¥ ˜¿SC ‘W(ßÈ+�Þp-CÇìÂò^�&̯>›çQsüÉÆùɯ¥«¨i‡$’kÕ ­Ô´–Óª3F'„"ÀlŒïJR1Y2`i"`Ôé£ìÒ s _¦Î;X¾Ð#ƒ©JOû ¥ûÍ×zÏ÷”bOG1²{.w÷5k\ðÆ®ÍU& *ç^SX†26Hþõš'ÐøIM¦¦!à3qŒí^/{÷ERëtjì¸_øŒ!©Í�}‰Êï>þ6©¢&Æ­C&Nþ1:QÔfÝ¿uäè¯Ð›sGû_Õlw�Å®Œ¥©Ø^-3<ƒ -ü!åO$tX"þN}±ü,[þ±ÁDùgüvåßó›-ÿ¾ï 埉bd·Wþö£õ(x7š€4§ÓСrh�Ál�þ„… Sð™8Æv   „N'  ÆŽJ©¤&`ÂÔŸáÖzt¢Dè”t0/ŽW%à¾^r±8솟ñNu½dj‹Ûö‚ûÊÝ ÃÙJò; �þB3Á~Œ@@ó…¥Ê-N,/‘Á”@¤ý�ˆýÚT ÝR5¬äÀíumèð¹FvÏÚíêŒõf4[É$xP.»¡Àµä>¡0‰Ƨ¦"à3qŒí&ÔA B9I�? ÆŽê �„ ð½êÿ «‰âp§´Á£Ü®Æ¦\Ù‰l°cXŒ$"Ú²¸å“S†õÕº‡„qM&•=dŒb|qCÖˆÝôûž=r§!Ñ·?XºIdÓÝ8´�\µ¢þªÜ—uÑtÝ®ëÝÁ'B¨ÿÇ/({Aq{’^]íÊîàóxzý—G#Üß=¹=|ùúPî‡ù´ø]hQ~þH9¼endstream -endobj -2529 0 obj << -/Type /Page -/Contents 2530 0 R -/Resources 2528 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2549 0 R -/Annots [ 2534 0 R 2536 0 R 2537 0 R 2539 0 R 2541 0 R 2542 0 R 2543 0 R 2544 0 R 2545 0 R 2546 0 R 2547 0 R 2548 0 R ] ->> endobj -2534 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [213.9242 571.076 269.2362 594.0447] -/Subtype /Link -/A << /S /GoTo /D (a00157) >> ->> endobj -2536 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 493.9051 159.0804 502.7518] -/Subtype /Link -/A << /S /GoTo /D (a00130) >> ->> endobj -2537 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 449.4179 158.5224 458.2645] -/Subtype /Link -/A << /S /GoTo /D (a00129) >> ->> endobj -2539 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 353.4255 161.5608 362.2722] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2541 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 255.7495 172.9881 266.2798] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) >> ->> endobj -2542 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.4309 255.7495 224.4542 266.2798] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2543 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 211.2623 180.7289 221.7926] -/Subtype /Link -/A << /S /GoTo /D (a00156_gedaf3e48c2b04229b85455fb948468d6) >> ->> endobj -2544 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.1718 211.2623 232.195 221.7926] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2545 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 166.7751 186.816 177.3054] -/Subtype /Link -/A << /S /GoTo /D (a00156_gcb807bd57e5489b386b876af5c1f163a) >> ->> endobj -2546 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.2588 166.7751 238.2821 177.3054] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2547 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.9214 121.9143 184.6543 132.8182] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6d71dececfce707c668e6257aad5906e) >> ->> endobj -2548 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [213.0971 121.9143 236.1204 132.8182] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2531 0 obj << -/D [2529 0 R /XYZ 90 757.9346 null] ->> endobj -2532 0 obj << -/D [2529 0 R /XYZ 90 739.9346 null] ->> endobj -138 0 obj << -/D [2529 0 R /XYZ 90 739.9346 null] ->> endobj -2533 0 obj << -/D [2529 0 R /XYZ 90 715.481 null] ->> endobj -2535 0 obj << -/D [2529 0 R /XYZ 90 513.6142 null] ->> endobj -2538 0 obj << -/D [2529 0 R /XYZ 90 373.1347 null] ->> endobj -2540 0 obj << -/D [2529 0 R /XYZ 90 277.1423 null] ->> endobj -2528 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2557 0 obj << -/Length 2012 -/Filter /FlateDecode ->> -stream -xÚµZK“Û6 ¾ûWøhÏD,Ÿ"™[_É43餛½¥�ŒcÓ»šx%W–³I}A‘Ô‹zd“69˜6? ‚¤%k ÿÉZãµiÆÓõþa…×wðóËñÓ Ì']ÀO·«^P½ÖH§4]ßk )A‚º¾=¼ÛhºM¨Âo®¿½�¡À‚°¼.דqã_ŠýõÁäծʊ|û×í«Õ¯·�^o–`)±Zÿ^½û ¯`Þ«FL+±~„/­éúaÅ) _N«·«?9n¢^0¶;AØøöAZöGa»Òm/ED Ø"Áo^\ó}mþøŽžWRŽ×]IˆxYY^91Uö`Ê÷æó9+·DmÌÁýü'øR•×}5teI%× ”RªÜVíLyç!7�MxÒÅÇq�¤Z›kÛ"ý)C˜èt`ÀÀ× *ÖKxWo*� ˜öÿ‰1s.…¨´`‰8Ä;ÛF\N‘Lµðð ñÖÁ$D $‘!<¤Fÿ|oö�ë³£ûÜuä†÷»‹˜-2s@V‡ 6‘`?çµ´ÛûÌ#�½œ©Ì¥º|‹�Íý 4ÕµÌ= ²Ä²ÂK8n €OÿóÁœM~Èò;�òÆdÁ” äðõ‚†�?a)‘R8š?çJº¨8½”FR�i1dµ—ÞÔf–»S™òò|¨²IFɨ‘! :¶¤—CK$ ­Ô&›zÊ F\±ùÍÐÈæ»)Gàäó”³¾Ê�óÏ”‚úªðŸ÷¦›�š 6Q뚸t@3aÁ ŽvGáÆ&—M½|&&sºÛPDÊÙX$Ê*ÿ½È“LYôÉÀ“Çä™û¥PÀÊò1»˜Éìʲ˜¨b­;¨i7ŠT"Š¥®wòëçÝÃùdæ|8£š#­ Pâ…êÞøpÄÂq_˜5ñp¿?ïÑ>2�)ĉš70iPKª#iVõ³H)‡ÔZ ”Nï<à—ÔGr­z—3u€’‡]–ŸŠâœ„z†R‚ÙB‚xÒÅÇE ’Ú¤×{pA8tQ!‚¬dº¼¾1ÃBP 6ØYHKÚ7"DmÎ%„*8Úžn_¤¸_˜¸ÆÒeLMô¶PÁT]‚•.Jö‡~lì”M;ã!2”å½a}»j Χ„ýí´»ø½ž%œYÛKs,J• -l†õN«ì¤�]ù˜�¼UûÝõbZÃBê†ö¹)=2ûÁ4õïC(¸…5Æ¥XÙ_1¯ù)ûh3ÒŒ°÷p -À[MôÚ¬IšÇ$Ô¥d–æuQÓ4�Á@é4}R3fÀ sŽ,obØl3»ù¦‰‰7?ÚÄôT>¡‰±·ëdt8&¢ZÌ.j&:‚AU÷•ô­ñ6@7\ÌgFÿ“™xlæ(o`mi³™ Udª¼‘Ô"È»ywaDô ³Ï9TºàSœ"P—.ø”(õ•�MWè÷»3²pÜ�ö-ôÈ$l9kxÒ LŠ¥-Ð{®€ÊŠ¡öiŽðKvDr¿�ÞC2AµÖ¤A-XKëÐ{ª‚�§Ò{Å¿…ݳQvÿ’x¶LâkÞ°Dã9EÐÃZ>�Sв-¥ˆÇ'Ý#4>’;óØ²šÊt`BÔ{T¬x@ã[¸uzŠÿßǾ -XŠV�oý?Fä�eñ0˜Ý_KÈ–ªsó…´iWÏÑzÅ»´¾ù²ïçvî#ØCOëí�µ 0ð´FZ_ƒêãa6´¾ i½E­Øá¡W1 ¾³~ãXÑ%^ðIwÁÈñ�ä~%³'paÁ­Ö7'böµ`g ).Y߈.³'Ô3û&žÙû…=ÎëøqSú%j“À+Æ+šm«f¶Ü4UÃ-�¶TeßÙPÙ××.GIåÐD¤ßõ’½þ#h2a½N,EZÚÇqPã),ä)mL±{irSîªð*3¤Õë0xeç5ký'~NÙsêÿž€bœ†œT4o;ã?<øð%¼¢ÿüåÎäcGfÄKÿÅ)›*endstream -endobj -2556 0 obj << -/Type /Page -/Contents 2557 0 R -/Resources 2555 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2549 0 R -/Annots [ 2561 0 R 2562 0 R 2563 0 R 2564 0 R 2566 0 R 2567 0 R 2568 0 R 2569 0 R 2570 0 R 2572 0 R 2573 0 R 2574 0 R ] ->> endobj -2561 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [238.7907 702.6042 264.0158 713.4833] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2562 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 552.0997 139.4144 575.0684] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -2563 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 552.0997 262.94 575.0684] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2564 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [282.8054 552.0997 416.0743 575.0684] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -2566 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [233.7 476.8541 258.9251 487.4443] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2567 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [389.5998 434.4572 435.3076 445.3612] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) >> ->> endobj -2568 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 339.0297 166.2529 361.6249] -/Subtype /Link -/A << /S /GoTo /D (a00156_gcb807bd57e5489b386b876af5c1f163a) >> ->> endobj -2569 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 302.8975 227.254 325.8663] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2570 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [247.1194 302.8975 380.3883 325.8663] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -2572 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [241.9988 227.652 267.2239 238.2422] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2573 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.3063 185.2551 432.0141 196.159] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) >> ->> endobj -2574 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [460.5476 139.225 513.9963 162.1938] -/Subtype /Link -/A << /S /GoTo /D (a00156_gedaf3e48c2b04229b85455fb948468d6) >> ->> endobj -2558 0 obj << -/D [2556 0 R /XYZ 90 757.9346 null] ->> endobj -2559 0 obj << -/D [2556 0 R /XYZ 90 739.9346 null] ->> endobj -2554 0 obj << -/D [2556 0 R /XYZ 90 723.1038 null] ->> endobj -2560 0 obj << -/D [2556 0 R /XYZ 90 723.1038 null] ->> endobj -2552 0 obj << -/D [2556 0 R /XYZ 264.324 511.5135 null] ->> endobj -2565 0 obj << -/D [2556 0 R /XYZ 90 495.425 null] ->> endobj -2553 0 obj << -/D [2556 0 R /XYZ 208.4343 262.3114 null] ->> endobj -2571 0 obj << -/D [2556 0 R /XYZ 90 246.5665 null] ->> endobj -2555 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2577 0 obj << -/Length 1169 -/Filter /FlateDecode ->> -stream -xÚ½WÛŽÛ6}÷WèÑ"†Ã«¸o-’] @šõ[,´6½j[®,gwÿ¾C‘’u³œ¢@l,Ї3gfކ$DÿAdh¤¥&† ­ö3=ãëO3Ó1ÎÇmÀ¯ËÙûߘ‰ 1Š©h¹©,( ’‹–ë¯sE@.b&é|¹€džímᇻì©H‹·Å÷å}$€ʵ@'n�áîíìã²qxI®À¹ý{öõ;�ÖÈï~F 7‰Œ^p@ âýL0^v³‡ÙŸ�?Q- O0 -Å\‘ŒE%’PH4f‚�l<‰!ƒŠ4Çà4UhÖúðÓÝ)¿ë‡ ”͋ږûþ…§Hýœ{S<‡©/-–@5ÑÀåMÞ¢Ùà˜ãYºB=ödËoTRüƒYi(£&ÉÆ ê ¬°2u“xì7JÙ!+³ü2VÖÂ9„þ!ßø_·d&«RÎÉŠT"Cé‚&Š _‰/vc {Xٓǯvùê¯G·ªø]ð{Xû‡S™ee«Wi´ÌÊ ¿‰Zò„ä”Òù� ÃlÝ¢õˆi­Kz*‹óªì§—1E(K’H N45ìF½|Ü^0”åÐnSïaS zznPCÇø²åXÑXþŽ_¬÷Å™ V¡YèåHÆñ3QFÀ»~˓ؔ”IÂ’ìPÚâGº1ͱyI€¬…ßSkÌ–XàÃ'\„h겦} vÈ+ôr›¡ö8À|s>¬¼ÐÝÈ¿eóóÉ®ý›2÷¿•lÜCÞûvêÀ›¼L…EùÞ^FYpRnmXx.Ï…%‹XŽ”l�QO…NQB‘¢XM.õ U6ø¸½`øùí^º�]€œ¿³Â®¯õ"a„ëê=Výî@·¨TŸÛ!:T^²]¥4CÃ| @Œ Ó.˜ÄOÿKwç´¬›P~‹sÝ÷7e½V%¸È¤zܦ¡µ‚&ýhë }ЊMïRmÔõ]J*A€ƒï�Ÿ]ËJ‹…c‹Óµm -F w€=dÒù@›�¨�5_Ç9P">|  ¾³÷a£Ø�º.ñ8æU—è²[³«‰Áóããg¨V>.¨©tT¿ous׃…œv\ƒŽ»I[›4ÇË:nÏÀëÜ¿y²Ø{ìuI_”|ºªdüžˆâ §•ÜFM(k/•T¼?¾¦ûãÎNhxÊuuÔÿâ¨5d8zÔj`Žâz»:®ÈjXÒ„H¦ Æ ê–ë�5¿sö�âÞÌ�‘=§×#¯ñ·Üìúžé”Q(Þ§Ùa—çÇø%+·qZ‡ÁC1‚ßPKƒºAih­u–pg¾¾÷„“„‚þÙÔ4ø[<v'S“ŸËñììeTßÒKƒºÁjhͱòÇ<ìÖFð¾$ýÓvõœ×Ûêú¾»Ä»‰Ð£}“Fî#ÕºxV7ç—ïlÄŠÍ“úâH¸p?Ùƒ-ðˆ×9ý£~¸w9‡°úBtÇø£~Ä(Uþi㲑‡~|þýs@“|zó¿ò×·g;8óI¼mŽäçno¦endstream -endobj -2576 0 obj << -/Type /Page -/Contents 2577 0 R -/Resources 2575 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2549 0 R -/Annots [ 2579 0 R 2581 0 R 2582 0 R 2583 0 R 2584 0 R 2585 0 R ] ->> endobj -2579 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 718.3357 160.1659 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00156_gedaf3e48c2b04229b85455fb948468d6) >> ->> endobj -2581 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [225.0325 640.9795 250.2576 651.5696] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -2582 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [431.0264 598.5826 495.3943 609.4865] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6d71dececfce707c668e6257aad5906e) >> ->> endobj -2583 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 495.4786 139.4144 518.4473] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -2584 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.4032 495.4786 262.94 518.4473] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -2585 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [282.8054 495.4786 416.0743 518.4473] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -2578 0 obj << -/D [2576 0 R /XYZ 90 757.9346 null] ->> endobj -2551 0 obj << -/D [2576 0 R /XYZ 229.1564 675.9038 null] ->> endobj -2580 0 obj << -/D [2576 0 R /XYZ 90 659.5503 null] ->> endobj -2575 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2588 0 obj << -/Length 1530 -/Filter /FlateDecode ->> -stream -xÚ¥XKsÛ6¾ëWp¦i&Bñá[k'™¤MÓÆ¾%MA1Ç©’T÷×wA_"Õtt÷ùí `ø‘@ã@ …4ã2ˆ÷ |�ǯ¤~½†÷ë6à×»Åϯ¨4Ò’Êàn[I� Jhp·ù¸Ô|µ¦!Vxy|ó'\ -¼$»‹wÙæ¸3îú&‹�{“–Q™déêóÝÛÅË»Fom–`’X­/>~ÆÁÌ{»ÀˆéPßà#¢5 ö N™¿Ù-n5rÜ‹êƒ1ïaãîŽà õþQpW9÷$"rµ&ãåõ.‹Ÿœ3IZš|ÅÆ:â$¤…¨$@­ž$ R˸1e”ìÌ¦Ž‰)â<9øˆ€ ÖŠ´•cíÒNÎÝcɸoNJॵÅ=*Üéá#˜S~3&={é€|"RH%�Ôž+öUþ¥Æ|hŵÁ¯Û¸à¶=ÊµŽ•ÉÞäΖ]ò�Gùs߯0R’“ž=½ì6¨+cˆ -v­ˆÒM/p‡]Tn³|ï‰“OÓx�…í1�m£]R>¯¤X"ë€Í^­hM’”óÿ’Çý±(}¶jÐþ°3¶„<}À8wa¢øqÌæò1ªe SœM7ƒ´h)D Eˆ ’ÙLºüºýÁH r/K7gÐA¸Ô={zénP3V ¥Y+ê1î…L¦ˆë±m²*¨ð2KwÏîY–çdE–ÅÕjÍà›¤ÎÃÞDÅ1÷ŸÙP ¸På!ÏVD,¿&ŸÏÈa÷Qœg/Ü£ëßß_ÿv¿®<„&Ò´&ðìöåõû?njÜ·ÇÄó&Îr°ê�¥O“¬çOaâÌ—H¶­Ÿ=¥ñ\«|ée2“PBc†’�&ÒƒÖmÔpá 5˜AïÀ…œ¸ª½5µyѮȮúê @£dR?G:$.§IO°BŠ01ff›n ®�UŒZ1±œ%>‘¶ƒ±p:^ j4`­…–2!$´¸z¹1¶¥Àœáò+G˜qzvWÐŒy-g!?ɱ -?Q*†9±k£`ÓÔœ^X¹5–²«÷§Míé@9—HQEzÊÏ'ÝãçÌȵf¸:t%7Xb©@ÀL=""´mOà'gº� š‚½µû¨Ýjˆ!kÉÆÂî+ ,ó0kì/í2ÑîV+¦–~ÉIÒaåÛŽµ¢xùtj¶G¡aæ�yƒSŒð }i¡Ç9΃ØÔ1U¯Åcç‚ ªôyŽ·o`³ŸÔxâøŒ^ÏñŽÞ¯6äY²è>iBDO÷yŠ{üœ¹ÖŠjµºORXßúv(]ŠÈ™xÔœv¥`+Ei/öX`¸&çÇ™DŒ zãÚè‰êi`Ö’7�öÿ˜Þ&²W¶ñÛâ°Í_LÔ·íšü´ÅµÁ„B9~žÖà°I˜£µ‡ÍÓº%pŠÖÓzZ·õ:BÙr?¤”Ô´ìè?Om�Ÿ³d ·kÉ wfç†p: jF;µãa(zÚ/¥6Ó -ñ_¸0´ÑÔn`֒צìsú˜»E!-l`¡D¶˜/³ùïÿPƒPˆèfÚ¦õ´íƒ3'½ f3o“–¤frÿj÷á¶ßžvé®ïU÷.]¤“®sã<™ïOÝmb3Râþœâ§ýmÇÓ¤‘]Ì wÛg¿µ/³ãnÓ<ãh×Ylólß“¹�’Ôú_ù=b�ŸšÜæ�§€AÈ5WíøtvzC+ ß~0 ãìî0û©7à\š…Ü”Ç<-¦Ä÷·QOÌRvɤ ªtr–j£ÎÏRj ¢í -ýƒµ×ÖmZœŸ¤&µ7¨õ£3RëNÝèìL§v¥e?õ”OüèF¡ª½ÝÐ{Ï'%ù}Õ¿¾Pá©ý¢ý†å2ÊËÞ»ÓR*L@c'ž®Fϲ0‹H!ÿ×ahµö‡ð a�î)‘V0=Ú -ÚsOoŠ«ˆÔäQsÈäÙüÎ_¼µ¡9Ö7„ÖÿøŠ²+ZŸûRŒe]+*–þ˜jx@ìƒ~“}þbÇÂö¼v$JÿhäC4endstream -endobj -2587 0 obj << -/Type /Page -/Contents 2588 0 R -/Resources 2586 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2549 0 R -/Annots [ 2591 0 R 2592 0 R 2593 0 R 2596 0 R 2598 0 R 2599 0 R ] ->> endobj -2591 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [279.6865 672.5415 331.7604 683.4455] -/Subtype /Link -/A << /S /GoTo /D (a00156) >> ->> endobj -2592 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.9692 654.9172 432.0432 665.8211] -/Subtype /Link -/A << /S /GoTo /D (a00156) >> ->> endobj -2593 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 587.7333 161.7601 610.7021] -/Subtype /Link -/A << /S /GoTo /D (a00156) >> ->> endobj -2596 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 531.8574 226.3182 541.7851] -/Subtype /Link -/A << /S /GoTo /D (a00157_ge3ced0551b26c9b99cb45a86f34d100a) >> ->> endobj -2598 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 448.4997 175.7578 459.03] -/Subtype /Link -/A << /S /GoTo /D (a00157_g78ab77b57cf2e00089f0a3a22508524c) >> ->> endobj -2599 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.4252 409.6454 214.6911 420.1757] -/Subtype /Link -/A << /S /GoTo /D (a00157_ge5b7160f2e653725ba5e2024c3cb7bff) >> ->> endobj -2589 0 obj << -/D [2587 0 R /XYZ 90 757.9346 null] ->> endobj -2550 0 obj << -/D [2587 0 R /XYZ 90 739.9346 null] ->> endobj -142 0 obj << -/D [2587 0 R /XYZ 90 739.9346 null] ->> endobj -2590 0 obj << -/D [2587 0 R /XYZ 90 719.4886 null] ->> endobj -2594 0 obj << -/D [2587 0 R /XYZ 90 549.8311 null] ->> endobj -2595 0 obj << -/D [2587 0 R /XYZ 90 549.8311 null] ->> endobj -2597 0 obj << -/D [2587 0 R /XYZ 90 467.076 null] ->> endobj -2600 0 obj << -/D [2587 0 R /XYZ 90 371.9517 null] ->> endobj -2601 0 obj << -/D [2587 0 R /XYZ 90 345.4667 null] ->> endobj -2602 0 obj << -/D [2587 0 R /XYZ 90 345.4667 null] ->> endobj -2603 0 obj << -/D [2587 0 R /XYZ 499.0115 286.0122 null] ->> endobj -2604 0 obj << -/D [2587 0 R /XYZ 90 269.2851 null] ->> endobj -2586 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2607 0 obj << -/Length 2480 -/Filter /FlateDecode ->> -stream -xÚ­ZYoã8~ϯ0°/60æòuôÛö¤§‘^loï$,03(¶ -KIîLö×o‹”hI–¼hñøX«ŠEÆbÅáŸX%|éˆ%*W»ã _=ÃðÇa§·0¿õïnþüƒLV KB®ž …P0-…\=ì^‡LD›­Ô|ý¥Þˆx]µUSí¾n_gmC3EþX§õÛf«x”ëDo~}øtóá¡ãkÅÒ*Èõ÷›Ÿå«=ˆ÷é†3•Äzõ -ÎD’ÈÕñ&�ÊuŠ›û›tthÂ,˜ÒN 5­žŒH§Ÿu#_=Áù5ú�VDN°DkCì‰ÔdÜ“c¼ÍÚ4/²=¹Íš]�¿´yUZBÊ3;ÒA!¢ópÈ`U¯_ê3�p0éím¡×ßò}ÖÐHZÒ7/Û¬~Â…é.£•mES­£ºûB3M›;™¶–‚¥ØäǼHë 4Ú:Ýç¨WZâýý­]× *£’d:a”<“�uˆˆ…2 ⧲ȉÐSu}®ÓcC½×:oÛ¬¤ÎSUSƒÄ‚FUïó’Ì=RT!) ÖB“ee»Ý×¹×'Ä™\ßáX0Çù5oÖÃ];Sžv¸ßC¬Ó:£F†rüa„Ù�Zã:0š—FŸ&ûý²çÆÜÐ'Q›záJ³P­÷•ñ *«–‡t#¹Õ—FÌ~Â÷ÑöóãK‘��cŸ6¾p/E¾Ë-1pšÖ®:¦»C^fÍ`•QöK=VUY¼QëÇ«ú«í‘A¡õðýj쪲Ìvècͤ£˜xQQ4ŽìótN Ød�Ÿ¤à,I°ÒI̩ϤœªŸ-æG/Ñtø­¿€²�Õcº�5ÚC�¥û±$!gI<�c�æ,f‰w°H…á9±n¿µœË#4à»öaÚº²�_8WFÎë&Ôk¶Ù†‰€]È Ñ¼�6Àè‡[ee9  -—x”ä-òçCûšáÿ8QÀDçÑbª'ú³c ¢`¼&Ñú½üÔÒlZ4•Ã¥¥]j³\]`Ÿ—‡ ¼C[YŸNåÎæº‰”V@¢„˜@?ECp# ~}»£µÂdý"Æ›ãÓ̯°ã$·aŸ†H¬q´ÒR³P)5#´õQãj'N82ÐRP�ÄPV úŸ«6{7ä*¸–bžm‡šàë§à‹„Ò=5dü>Û¥�ž`—dH‡�±wÀ`ŸÒ cR´¢37ƒHP�^ÕÎD0àÎ7Þ ½æ…�4»ˆ @ ›’Ó7 {̈~ã�{ ·ÛlÚSÞ„›ˆÛ)é¤ÑмANyƒô½Aú~¬D´¾³S–0Q�ÁÁŸÑpºÿ–7ä}Ò…7R$à‚�Ì"·úd—ªîü‘öÄkk8§¢}‹™Ëp´ŸPö@}jçéTRS.½*Î"¼*Gœî ¡M}ƒãMVB]óL�}Ú¦4�BW˜ðpØòÌäx„gä -‰ÕÇ hkHŠÇ¼i ·‰¤z"ƽþZRÖ‡²öÙ �I¸! �L_3³Ûq?BŠlÄ£Z¬š¥z è«FPÄ’>8ÜéƒÃ¾>8i áF’xÌ:º T-“e˜Ÿ¤Ž•Ëhà<¥«Q²A)Ò§xFÝ'k�.ˆeAbr<¶& -y½®Oæ4‚V꾚âí Wm_ tpë©8×TÌÁÒxM…t¬‘z664iÝ á‘d:ñ*P�ÓµTuø­¿`œúÆtMMtÿ÷ïÿúÛ–‚IÅŽ”¿Uï?|¼ûŒG“9‚†éâŽG<‚+"g±Š§³³m=ÔDr†�Ð"éhGAKóÄîOȲÔ4UH?û§ çöûzÈ�7øTÆ»‰ úbJb^÷t+ºÒá<Ï…¬U­Vƒälýѹ>WpmjÝ)þøvv‚»dÎ'<¸Â†Bµð˜Å±Œ—ªh‡ßú &*ÙÝÞc>üóîá’OÈ(d°6È3¬¦jIŠ5”‚M= -lEìhªŒŽûC^Œ¯ _)-™àêò‹�˜ª%B¨8èé˜NJ=®að©B«yŽj‰¯X¡¨?ç˹,²gÅ„Õ�óE×èðK2ŒèšKÆ;Œ„€{SóÚkÅÂX‚¨œ>ÃLX*b"°‚òQ$½ãh¾‚;W.�ðfŠî€¨Í(lñlUÄxÈtUñ‚8«©m ,ôš�÷—ä�RŒI•ˆ+…÷Ð݃YïÌà€2‘ŒÇ!UÇ·t¾‚$÷m}Úµ'ól6éØ2LX ! .9¶˜qì¶èس{Ç^àëûŒoc´;v´‚3âœóŒc[ü’ #º�cÿFwÛ§‘(±9­â%³C–%.ï�™Âxiolyo<‚s{3Ï·ÛŸïÒÞœq¾foæeÑíöfœr Æ‰ rf•×p�þ“Ž  ïùg:ët°þ]¯ê­³úÀ•‚-lÍû4¸´O¦ª‹ÙGBN†ª®ÔÂCOg‘€édQöÉ0ÿ•“éFD -Ì7ãÒ>`Æ¥;Ø¢KÏrì]z�¯sé3¾Ú[MG̃�E2æ—½Úá—ÄÑí«¬»ÏwãjOáSG2o„µÀ}LÍ=D�ùB¯¹¾Vÿ¿(Á�îŨFŸ…¢C,¨îPKŒGÔ�ñw¶ü¶¹îÜOP|z¢Éÿ•M^‹l˜ ™!‰ôu1é£g2KCyïÊŸŠAŽÿ)yˆ f\Å )ÐÉiްËá®4‡z©lî`Ëáîœ ÷y¾]¸û|¯÷3æ×„û¼#º}¸››öøo$õ‚y+t¨öcjãv[G<¹Ö~Q‚!ÝËñ@Ñ$T¸ ºC-1Q³ª_Ž^ B^»v.r „|ïí3†v¾¼´ƒÉö@ÕCj_ -òò,òû·ÛKZAÀÈPˆÿG¨C‰ ‚xé`'Ôrœ[Ü|”÷ ™÷8.G¸ÏöŠøž`@³�íûŸo§nbÅÅœâf–ï�Òå VLQx�Îzž÷€æÌñ 8hgÕu˜y–JÞÁ�ÏÐ^³ÈÊ©Ç_£’zB -¬DHyä¿þÍŒ‰¸*á¿È&«�%¾m>ùB ³2«û@w+ø›k|·‡“íi¿ü�Tï$§žä<´Y ”Ê>]Ðo0ÍøùëâmõÇÛsV̓?è™°Ï¿]„¦Qendstream -endobj -2606 0 obj << -/Type /Page -/Contents 2607 0 R -/Resources 2605 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2549 0 R -/Annots [ 2610 0 R 2611 0 R 2612 0 R 2613 0 R 2615 0 R 2617 0 R 2618 0 R 2620 0 R 2621 0 R 2622 0 R 2623 0 R 2624 0 R 2625 0 R ] ->> endobj -2610 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.6232 595.7581 261.9762 606.662] -/Subtype /Link -/A << /S /GoTo /D (a00142) >> ->> endobj -2611 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [471.5956 429.6401 513.9963 440.544] -/Subtype /Link -/A << /S /GoTo /D (a00158_g84901a5aa60040e96d272a69977edd22) >> ->> endobj -2612 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 417.6849 128.067 428.5888] -/Subtype /Link -/A << /S /GoTo /D (a00158_g84901a5aa60040e96d272a69977edd22) >> ->> endobj -2613 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [208.8032 405.7297 277.2062 416.6337] -/Subtype /Link -/A << /S /GoTo /D (a00158_gfa11b2a1faf395ae2a6626e01c482d5d) >> ->> endobj -2615 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 348.9505 161.8402 359.8544] -/Subtype /Link -/A << /S /GoTo /D (a00127) >> ->> endobj -2617 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 266.3068 181.8351 277.2107] -/Subtype /Link -/A << /S /GoTo /D (a00083) >> ->> endobj -2618 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 253.3937 163.7728 264.2977] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2620 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 170.75 204.7292 181.6539] -/Subtype /Link -/A << /S /GoTo /D (a00158_g26ae707402e494f3895a9f012a93ea29) >> ->> endobj -2621 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [206.0542 170.75 231.2894 181.6539] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2622 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 131.9725 215.2497 142.8764] -/Subtype /Link -/A << /S /GoTo /D (a00158_g84901a5aa60040e96d272a69977edd22) >> ->> endobj -2623 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [216.5747 131.9725 241.8099 142.8764] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2624 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 93.195 210.8263 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00158_g70d236d1cf34b4e21836edda60247b70) >> ->> endobj -2625 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [212.1513 93.195 237.3865 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2608 0 obj << -/D [2606 0 R /XYZ 90 757.9346 null] ->> endobj -656 0 obj << -/D [2606 0 R /XYZ 90 739.9346 null] ->> endobj -146 0 obj << -/D [2606 0 R /XYZ 90 739.9346 null] ->> endobj -2609 0 obj << -/D [2606 0 R /XYZ 90 716.7484 null] ->> endobj -2614 0 obj << -/D [2606 0 R /XYZ 90 367.862 null] ->> endobj -2616 0 obj << -/D [2606 0 R /XYZ 90 285.2183 null] ->> endobj -2619 0 obj << -/D [2606 0 R /XYZ 90 189.6616 null] ->> endobj -2605 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2632 0 obj << -/Length 2761 -/Filter /FlateDecode ->> -stream -xÚµ[ï�Û6ý¾…îl Ëò7©~K²›\ré&·ë"´Eàxµ»F½vjËMóßßPiJ´8êݯüüÞp¤7R›Pø�M -:1Ê�BH=Y>žÑÉ=~uÆÚ¯Ïáûóð|~öÝK^L -Rh®'ó»šA3¢8ã“ùíOÓBÏ饆N¯ßÃGE§ŒÐæÃÛÛúl>_l—‡ÇrS-ªÕv3ûeþæìrtÛ°”ÐÌ©þvöÓ/tr á½9£DVM¾À”°¢à“Ç3É…ÿc}vsöïÀÓ|QÿàÔè$UÄ -;9ç¦OJÀŒÂ4‡|p½á!ŠN,ü\K—_RS؉G¹œÜ”›ÛfÔ·‹jAú£õ̆Áo™`ù0Ú('Š6Qœ>kT@dz&¢³Æà[)¬œ˜‹ógÎUüŠ+1‰ O$§EaºL’‚jÝÕýæ¶ü™R¾)q©‰á†õÄÝW»ûs‡áñX ¯ ãýÍ»ÿúxsyuññf~Ý�… A¨å&Ÿˆ€B"HÙê@MuáTAvÆæ àÑú¼.‚Ïûíò×$U-Áöù¡{&œ°9áoƒì«$� YDœPªÅ8§ÆèŒU¬ëÕEóÏæ°^ŸWåîqµYTåmsµ¹Ÿ15t³¶P÷¤‘ÂÍlÐÍZ[¢$ˆ› usL˜q3¢ëÝÜÑÅÝÜáf$Œ„÷èæW—W—×ÏfŒ±é|ÆìôÝumðä -7‚Xé®…\^ - (e4·q€cSðh}ÞAs J¡E~è…§l‘¹ïËM¹[TÛÝLRl±s§å>kz%ÁItäô£s¦÷0ß+˜s38ü8Q7Ÿ¾¬ª‡NA¸;l–uÓÒôåb -Ǫ. -Ò•}fž¦(J”‰³ÓEÁÃð¢æŠB^7…XwDQèˆ�) -ù0ÞcQxñöÝÍebE¦ˆ€© Ÿ…€BäS¶ÁÀ,ÑVÛ± x4‚>ïðü.œÚB"C÷(L8ak‡>lp¦Á”²ið�3¸‡9õëí¾ì¸ø3!5ÝV[HÈŒÓé¯3F§eƹ°V`L?‰q4šZ¬70Ô¸1aƸˆ®7nG7nW|„q‘0Þ£q¯/Ÿ]WÔ™/³—”0)Föß1:gq´øçÖßÛμ½ÿ\.WîªõKñ¥ëÛMû¾¬\‹½a³CÌJó$›l -z mŒÂÌîa¸Ù#œÙóºÁì±î³wÄǘ=FÂ{4û…[úey!¦ÏÞ^^¥ö³DrªòI ($š”mxFgÄ;6Žé÷Y3ž‡Óg©AÆíQ˜n†Îè”fÌÈn?–‚êaQµ‹ñÅ>´ïÂLKgúßWÛÃ~ýµ9Þ^Üú_ :»âIæz mŠa ëã µL˜±?¢ëíßÑÅíßa$Œ„÷hÿËÿ¼ž'—}½Ìu> …¨§lƒv‡´ZNG�?àÑú¼ÃŽw74·ÈÐ= -NØ0ÇK-Á|d£3Ž0§~ùǪêÙ{`þ73ì{�ê÷µÌñ4M¼„æÄH�5ñ†;"Ì;¯ŒëŽ0vG|Œ±óa$¼½�µÓöv;ŸÐõæSPH )Û ½!ZMߨ,<AŸwØÞº€Æ[idè… 'l¨½¹&®iï�³·‡ý©íµÞžyé¾úëKS„[ó4{wc)Öò^"Â\iÈë†ÒëŽ( ñ1¥!FÂÍù'îºQ˜" -ZäsPˆxÊ6<å·¹%Ç?àÑú¼™)Ÿ«C†îQ˜p†Õa-x‚Úq5!FgjB€9õ‹r¹^´]z×ÞáF™où‰í…1D&ÌØÑõ¶ïèâ¶ïŠ�°=FÂ{´ýÕå‡d±?´âÎæ$¬³ó±$\ÃË|E¨Rjl2  Ï›Yéƒ_ -Ë‘�{&œ°¡E@Q"˜b#‹@„Ϋƒ‡²µr³ß~S/Ü¿ô×ù~u¿ØíV¿û ¾p§ý»q'D�šæOS ë±²`Xð0¼ D„¹2�× e ÖQ:âcÊ@>Œ„÷X>Ìœ«g¯ç¼š¿~{ju Ý£˜Ù|HÊ–[XÊÄØT<AŸw¸J¨”ÈÈ[&Û犷ø·›Û•{n%[ÀB#— -1:W<ÌEóaVðé·üÑ}¼E/Ìî ¼jw(³�Û Êˆ(¨~’}}�ŒµB"60Ôæ1aÆæˆ®·yG7ks nìjg]îàX}ÖSŸÿÓÝÍ;µ± ÓËg# �@R¶A“+C`¥jÆf"àÑú¼Ã&·°V§¹ -NؼϵíùÉéûyrn\žþîþw*aRR(£Æ&,à‘¸SÞÁ„IÈ-wO'gP˜p·Fß½d2+ˆ‘; ‡ù[˜Qĸb667�…˜ðÖ¹©}+ vQäJ -(L5aó‰i¯&wyÀuîÂp ¨%ªp�‘0Yj›¼ãåvÌ(/& „;˜7›ÊuW€±¦‘yÙ>H¹?ñúçjâÀèu‰Ž¹íax‰Î(º[h0™S¬„ú�E -yÝ�é�ÉéfÂm)0™ �YPƒ‡'¡;(8CÃó¸NxµM?ºf}]&/ì°Âj�ÍŸ·€Â( -¢LröàRÜC°¬N=¨¡¸à=õìƒ5‰#åÍ>¨a´*ò ¨T¸S‚x}3C«~¨8¹„Iâ3s[‹Ç†žðfæ6Ý6UÈÐ= -N؆V±®JPK$™F.䪄‡áU"§5ryÝàÿXwébIì/‰’Üöt‡-îñX ïÑâÐIrXœ×ËòÄæ0I1, - ¡€+ŒŠ^r&׮ߓcSðH)oæ9éÖ,?|Je{g0á2Ó~cñþ4íç‡ÙβLCo®Ew–…ÑAó3ƒ‹“Òé…_+œ~³÷n'­'ná’ a-×qáQ“5k€ç—¯^_�^iS÷’•œ0¨�Ühƒ®´[üyüƒôýÓ”7s£¥í…�܇kQ˜pÂÖí);'Vžž5ÎèMµØ¥7¿š½­Î³ú`õ° ÏÉ­6'ßI©—Çî¼Á™Ò\Êöq›z­Ùôq±Üm›�{'Ýn´áCW,öɪ}ïM‡—a’ßtâu¿Û´�‡}{h¹}lñ©¼ÛîÚÏ V?«{‚È�Ä_à®D.Öë}7!oÝ×rüƒß?8ìËôN�{͘�ùÍÉ(œ?¦•þ¿Þ@®g!ëvDãúSL4)Ü.µ{cŠ»!ë×›P IÇ× ý¨~ðÞ¸½�Cûãí¿ô{.¾çíËÖ°ÞÑmf\=ß¶OD§oeúê«Á_ïÓÖNAá9‘¥ÿsÉ6Fendstream -endobj -2631 0 obj << -/Type /Page -/Contents 2632 0 R -/Resources 2630 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2549 0 R -/Annots [ 2634 0 R 2635 0 R 2636 0 R 2637 0 R 2638 0 R 2639 0 R 2640 0 R 2641 0 R 2642 0 R 2643 0 R 2644 0 R 2645 0 R 2646 0 R 2647 0 R 2648 0 R 2649 0 R 2650 0 R 2651 0 R 2652 0 R 2653 0 R 2654 0 R 2655 0 R 2657 0 R 2658 0 R 2659 0 R 2660 0 R 2663 0 R 2664 0 R 2665 0 R 2666 0 R 2668 0 R 2669 0 R 2672 0 R ] ->> endobj -2634 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 703.3528 234.079 714.2568] -/Subtype /Link -/A << /S /GoTo /D (a00158_gb0ad55aa96dd1d200cd0fc5a99f6a4f7) >> ->> endobj -2635 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [235.404 703.3528 260.6392 714.2568] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2636 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 665.3872 274.846 676.2911] -/Subtype /Link -/A << /S /GoTo /D (a00158_g10d9a9201cba1a6db623284c475c6cea) >> ->> endobj -2637 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [276.171 665.3872 301.4062 676.2911] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2638 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 627.4215 216.3655 638.3254] -/Subtype /Link -/A << /S /GoTo /D (a00158_g5d56800f82bfc7bbf53bb4a659589812) >> ->> endobj -2639 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [217.6905 627.4215 242.9257 638.3254] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2640 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 589.4558 231.2097 600.3597] -/Subtype /Link -/A << /S /GoTo /D (a00158_gd895ab98c54d9966ff554aa873151751) >> ->> endobj -2641 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [232.5347 589.4558 257.7699 600.3597] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2642 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 551.4901 225.0331 562.394] -/Subtype /Link -/A << /S /GoTo /D (a00158_gb5d9c0becf7cb32d0aaef466839dd92e) >> ->> endobj -2643 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [226.3581 551.4901 251.5933 562.394] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2644 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 513.5244 229.4168 524.4284] -/Subtype /Link -/A << /S /GoTo /D (a00158_g4ab2de595d36e9e55dd61f6ecd139162) >> ->> endobj -2645 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [230.7417 513.5244 255.9769 524.4284] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2646 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 475.5588 207.4989 486.4627] -/Subtype /Link -/A << /S /GoTo /D (a00158_gfa11b2a1faf395ae2a6626e01c482d5d) >> ->> endobj -2647 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [208.8238 475.5588 234.059 486.4627] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2648 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 437.5931 244.0317 448.497] -/Subtype /Link -/A << /S /GoTo /D (a00158_gc7cc1dba1819f7fcdaa9ff9eed5a08f4) >> ->> endobj -2649 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [245.3566 437.5931 270.5918 448.497] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2650 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 399.6274 205.2872 410.5313] -/Subtype /Link -/A << /S /GoTo /D (a00158_g4a264bb64ae706d53f572b1d9e4037a2) >> ->> endobj -2651 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [206.6122 399.6274 231.8474 410.5313] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2652 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 361.6617 232.7343 372.5656] -/Subtype /Link -/A << /S /GoTo /D (a00158_g55ce98ea4d6f22e9d5068b904d4d2447) >> ->> endobj -2653 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [234.0593 361.6617 259.2945 372.5656] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2654 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 323.696 244.4801 334.6] -/Subtype /Link -/A << /S /GoTo /D (a00158_g2ebfe5c8a7f3173714efdf2df74fc392) >> ->> endobj -2655 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [245.805 323.696 271.0402 334.6] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2657 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.8747 285.7303 255.1444 296.6343] -/Subtype /Link -/A << /S /GoTo /D (a00158_ga87ff36af81990e6ffe20d76d5e4606f) >> ->> endobj -2658 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [256.4694 285.7303 281.7046 296.6343] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2659 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [432.9613 285.7303 458.1965 296.6343] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2660 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [474.7532 285.7303 484.4966 296.6343] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -2663 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 217.7672 138.5977 228.6711] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2664 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 217.7672 198.084 228.6711] -/Subtype /Link -/A << /S /GoTo /D (a00158_g3178402dd725776415bf9745e7bf92ba) >> ->> endobj -2665 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [226.5269 217.7672 251.7621 228.6711] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2666 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [257.2416 217.7672 282.4768 228.6711] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2668 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 205.2601 196.7092 216.164] -/Subtype /Link -/A << /S /GoTo /D (a00158_g3b19f65e48079d8105be2a99b5b4b2ae) >> ->> endobj -2669 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [225.1521 205.2601 250.3873 216.164] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2672 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [239.0101 147.2581 265.361 158.1372] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2633 0 obj << -/D [2631 0 R /XYZ 90 757.9346 null] ->> endobj -2656 0 obj << -/D [2631 0 R /XYZ 90 304.3794 null] ->> endobj -2661 0 obj << -/D [2631 0 R /XYZ 90 236.2728 null] ->> endobj -2662 0 obj << -/D [2631 0 R /XYZ 90 236.2728 null] ->> endobj -2667 0 obj << -/D [2631 0 R /XYZ 90 221.7522 null] ->> endobj -2670 0 obj << -/D [2631 0 R /XYZ 90 192.0859 null] ->> endobj -2626 0 obj << -/D [2631 0 R /XYZ 90 167.7577 null] ->> endobj -2671 0 obj << -/D [2631 0 R /XYZ 90 167.7577 null] ->> endobj -2630 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2685 0 obj << -/Length 1701 -/Filter /FlateDecode ->> -stream -xÚÍYM�Û6½ûWè¡6P1ü¿rK²n°išl -¤A µµk#²•Jr7ûïKФ,‹”´›äø`šÎ<‡ï‘2Š ú HˆS$IX´ÞÏ`t«º_Î�}«çq×àùjöäw,# $Ã,ZÝ4#­6æ ¾ˆ1…ó«r�ªX^ 8ÏêÊ<Éw×eZÞ/b¹Læ’/>®^Í–«6®…E C:꿳a´Qð^Í RÐèNý€I‰£ý,ÁÄýÈgïgµ~̃f@hv V3ˆD1a@ ™­ ®�@ˆâp"„qBä0i²q¥ç�–é>«³²zÚŸ'‚p‚qÔuíx@Zk‰jž� ÈG„ž¼j(_Ô2h4Ÿ=A ‚8wV�4�npB� \œÿRXÕåq]› -øÒÔ„òäw”tFS:¨‰1: ‘˜Es6ŸÏ¬ëbwPÉ6?êÂ~o3û´<+Ès«kkTÕiYgÐÏ”«&³ñréZ — “*_ çÍd–_Óý—<,4ºÉK¢šÍ3ÝSÞÚGïÎÊÈ–G! •Qk¦!n³wň;¯Êš$5Ö/ò¢²éKƒDeêñ@Å1+¾Ú"‰çût]¦¹Ö®lwj¾<Òkž©ýc¤Ó(ù½ii"4�ò<³f7e±7­»]½ÝÙ1 ±¶1êm™¥ÖÞYÜmwëmȸÈÍ I©ÉH¾[`:ÿo�è<«™˜*µIÇãLܵfbšp�`üáFACÂ�HÂÂÝš=L¸G³pn? Aá> þ“ ÷ÖQÜ® -Ky³†•<‘¨ÝDÇë§k5R?¨9ƒ>TÉÇB?ZÉ}„A%oÍ¥ä£Ij•|Bß×Ôü<ô´’O€è{�Vòѹ·J>Öó5¬ääÁJŽ ýqJN&•üÓòïËUPιZX(e”$"“rîìãªz~‡å\¡ ¸¡¿XÎj*°çmLÎÕšY¯�’óSá7�LËÜ×]=Îy¿.(�W�GFnGŽÚÒ Z2¬¾WõíÀB¬K¨T|ÄÑ8ëv­†Y—p}ìÃøQª0¢Ú’°j·fSíÑ,œTÛOCPµÏ‚ÿ¬ªíH& ‘üî/~ßý…Ê.í%c´w± TMRÒùj!Õt_/ßù�ª¹h:%"(Ÿâ?gwhÈó;Ì\ΡìAè󟳚 -ìy½ÎçµË+·þyv¸­·çKÖÇ&­Óþ9®9ޤ-—dÍ%`W+}5Ñ}SŒG’–ñÔú•Y},¶ßV½-*ÕÙ R}öaâP5] *ÕwB¥º=TÊÀ\{tëXí·ý"œª�ƵªB¯*™(’Ö>îðw¿ï·aÁ¦~ß-Ÿ]¬ôØ·ºlÝúuQ%Š2˜~o{Žªÿ’ÔYM`I˜¾½qtŽ¥(MZ ¦ØìÍÙ�©½ñòÖ€ÔAéÐg)ŸrtŒ†…c¤nëäqÂ?¢}aÙpVS�±œDÃË@P3º‘î‹Þ¶È7z_ù2 )�8H ôãÒtLQ–o.‚ -‚Õ9«#$¢`Î&ÄÙÇÝ"÷ü+ˆZU,ëAè+ˆ³š -ìyUæ¼vä"[çi™õ> endobj -2687 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 680.7395 162.0093 703.7082] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2688 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 680.7395 210.1583 703.7082] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2690 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [240.6739 621.5426 267.0248 632.4217] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2691 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 495.0915 162.0093 518.0602] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2692 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 495.0915 210.1583 518.0602] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2694 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [270.0136 435.8946 296.3645 446.7737] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2696 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [253.4163 297.3671 279.7672 308.2462] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2697 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [374.6802 255.2592 460.6174 266.1631] -/Subtype /Link -/A << /S /GoTo /D (a00158_gb5d9c0becf7cb32d0aaef466839dd92e) >> ->> endobj -2699 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [227.9319 147.2581 254.2828 158.1372] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2700 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [155.6929 93.195 231.8468 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00158_g84901a5aa60040e96d272a69977edd22) >> ->> endobj -2686 0 obj << -/D [2684 0 R /XYZ 90 757.9346 null] ->> endobj -2675 0 obj << -/D [2684 0 R /XYZ 236.6686 656.6872 null] ->> endobj -2689 0 obj << -/D [2684 0 R /XYZ 90 640.0288 null] ->> endobj -2679 0 obj << -/D [2684 0 R /XYZ 236.6686 471.0392 null] ->> endobj -2693 0 obj << -/D [2684 0 R /XYZ 90 454.3808 null] ->> endobj -2678 0 obj << -/D [2684 0 R /XYZ 236.6686 332.5117 null] ->> endobj -2695 0 obj << -/D [2684 0 R /XYZ 90 315.8533 null] ->> endobj -2680 0 obj << -/D [2684 0 R /XYZ 236.6686 182.4027 null] ->> endobj -2698 0 obj << -/D [2684 0 R /XYZ 90 165.7442 null] ->> endobj -2683 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2704 0 obj << -/Length 2110 -/Filter /FlateDecode ->> -stream -xÚÕYÝ�Û6÷_a •�šå·¨¼åšm�´—ä²ûP WZ[këΖ|’ÜÔ÷×ßðK–DIÞEûrX`I“Ùápæ7CŠ,1ü‘e‚—±ˆQ¸\nŽ ¼ÜÁðÛqÓk˜_w þö°øþGš,”H*—O†ƒ$HPB—Û_£D­ÖTáGçwŸ +pD¶�¿—Ûó!³ý7åæ|ÌŠ&mò²Xýöð~q÷ÐÊuj &‰–úŸÅ¯¿áåÔ{¿Àˆ%J,¿ÂŒH’ÐåqÁ)ó?‹ûÅ?Z>vÂ,Û§°3EØrÍ$R$á£TJ LT † "è¸!T‚0fñ2f Áö¹±Æ§ÁQZ¥Ç¬ÉªúÕpŸS3J—]Ö^�@‘–:ÔºWMŽQL˜¸rÕªœêr£µùw ÃH )F•¸ -÷T#f`]áL ÅbÕþO,pÝTçMcO_+cùþGÂ;«C2VZ¨]…™%ê‰àöÐ<� –çkÇºÌ 0¶ýÑ”®Ý;·;UeSá`ЬACcøÃ–Š!Îd<ï]ªi��‰$Êè{÷Gz<²I_ ³¢ÍÖ9tÍœ©vnêsÏSœŒhÈÆ<¥%Ó*î³Ã¡\Õ*«ÃmU!à1œÀ¬‘<Ñ-†¼´ßÙÃJ‹m ZQ¤â¡‘¦ áÈo)1䪕¨�Í)Ü;Å "’ÎïÝÝðÒb�K‚æÄ±Œ’Ò�ë› B‚¹ÁLk"P‡¼pΨ°�òɶz‰G]wh�\Tu½�žQİ4’$"1¢H®À—0޾ÙZɎͧû�?üôåî—w:°*„\J -û’V'©¥_w„ñòõ¸`IÂ’� -ÃcòT·ÜZä Ñ ßs¥±˜p÷y3�Eß®„ˆêÎT³¯²tkýNDRÎ ·‡}®)9�Žé¦*mPï˜i“¹)+:nvÀ¸F@qUÅêð3�z_ž¦/¢ôp,kOpÐä(Ò‹úè8žëÌ­Î ÛnÊâ_çbãó½ÙA‰p)âkÞìƒh'QH¥B&HŸÅ§£Ý‘¯»ô#Ñ>äj2µqé~þx§}Ún{âŠ��:CÜóT·´¸µÑ?–�„v~Âä|BêRM'$Á9`‹²xsŸ9wLu9�•æä¿8+…jŽf¥–lp@-òŒ�…Ó•Bªy‹*�dPi¬Y  'æÍÊØ"V·ÌСЦ/¨üÀvÖ·*?2¢Éxå×’=¯òSb¤ò Í0Zùõ„ÿßU~.”arÃ#:TÓ¹Ad³gV~s¢_c¡†£1Ö’M—<„qØó¦i©nI¸uªîy¼´ê¡Iü×U=ñ\ÕóöîÃÝç׫DD+¢¢�Ÿ¿Üß}x3V18WÁH¼d p•TÝ8»–~Ý]zWÈw²b )(088GsKè€S§LßeEV¥MY­Ú–ÝT�D™•Ù­�ÞZ6ÎØÛ´ImÏ–©mž|Ñ^L§Î|/ŸŽnpOcL磻K5ÝŒ'ˆRÁ_„÷c -Ìà} É8Þ·dÏÃûY+\ñ>4Ã(Þ÷„úS |5%ˆª‰¼Ü1O‡lÎ<žLkxuסp#!»ä£Â=U(¼oQÊ¹ê Ÿ7ÏUµ¾£OZ D!ÕÞ²R‡lÎJžL+šV»@,lD"nˆõT¡Ø¾}P DS}±¯+ ª;ó4ør#™‡<ô—@ÜmI%]èPÊsÊܤƒèYL�ŽÆ”Ú›ë •+"¢ßõ?sŒ0b5’À»õ c+]E›´°+Ì% ZwI‚)³K­Ã¥H�ù&=.vÀë8ve² -ÃGOÚŒˆÔ¿›*-êc^×+Áv”Kà&V7æ¨)u¢Ô¤N@^ìì¸Ù�žðܱ¹Áé÷óqÿÎO+*¢§¬²S�¨�íÁp°kv×F·Öæzq•mÏ›ÌMiY#û*2mŽ`÷�@&Œ³cY]VRDZ&a 3³31\®À/£—nu5¦ýÌ {¼ØÖZ€ÄQz:à,oAaCÓ¤¶iKN³®¼®ïíÊ–8ý´•»›þ.×{²þä3Zí3Û5—öcâšÛ¨Ð.ÓÌðJ¤tq åÅ’“[2ž~Ý]0ò~ð½^Ô\™D ꤱ[‡Â‹Ó„T>Ø{ªŠ…Ü:5&£ž‰}Qá#ô¡ã¾ïàžïà¤} Ñ3§CºqkšÁbãQØ Êʆ�þ‘WÙ¦Ñq­)MLu—žóÓp8u@?pyŽumÅ(uNUÖœ«Ÿ‘P:dÅÎøŠ"¶4VÄãîj«Çµh�Y˜Zkè±.Ø*ÒÃOb}Zí{– 6AÔBFž–`ð�^,z‚/ï³b°Ä11U|U7cáä ºùnP -–ÅÆ…Å“OÙ5̪‹óy˜lòÙû»…ç¯Á(¾Âñç_LHò×]LÔÜÅä݇‰çXš ®D †D›Ü -~O¾îÐ�¼‰¹Î¼Å2¤8g}ùÁS¬#º!uÈ«s qñ¢cåz¹Öù³é'[/½{!y§O6=ÀºÞõc¬†z†Ë~˜ø÷YÝÍ[~n.µM!fÎ9�ŽçÚ =f¶õáfÇtÞµ}% ½BºæÐQ.¹Ç¼Žfiø:k£M?ºx;e›\{_VRP^œÎMÏìmºî…â³oú30APp�>Lá¥þB"äŸúBl¾p+XBXï¶'Që—<}ñ……\ÒV•î]µÅÿ�ÛuÞk 9»„º¿¢ìuÃ)ÆÒF›É'üjþxñ_Ìÿ¸�…Ϙ•þ?hrrendstream -endobj -2703 0 obj << -/Type /Page -/Contents 2704 0 R -/Resources 2702 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2701 0 R -/Annots [ 2706 0 R 2707 0 R 2709 0 R 2710 0 R 2711 0 R 2712 0 R 2714 0 R 2715 0 R 2717 0 R ] ->> endobj -2706 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 680.2836 162.0093 703.2523] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2707 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 680.2836 210.1583 703.2523] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2709 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [231.2593 620.4508 257.6102 631.3299] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2710 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [109.2077 566.739 186.4774 577.2694] -/Subtype /Link -/A << /S /GoTo /D (a00158_g5d56800f82bfc7bbf53bb4a659589812) >> ->> endobj -2711 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 529.4341 211.653 552.0292] -/Subtype /Link -/A << /S /GoTo /D (a00158_gc7cc1dba1819f7fcdaa9ff9eed5a08f4) >> ->> endobj -2712 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 454.077 135.0008 477.0457] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2714 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [301.5354 394.2442 327.8863 405.1233] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2715 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [282.6755 238.611 418.4257 249.5149] -/Subtype /Link -/A << /S /GoTo /D (a00158_g10d9a9201cba1a6db623284c475c6cea) >> ->> endobj -2717 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [228.4897 147.2803 254.8406 158.1595] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2705 0 obj << -/D [2703 0 R /XYZ 90 757.9346 null] ->> endobj -2627 0 obj << -/D [2703 0 R /XYZ 236.6686 655.7754 null] ->> endobj -2708 0 obj << -/D [2703 0 R /XYZ 90 638.937 null] ->> endobj -2674 0 obj << -/D [2703 0 R /XYZ 236.6686 429.5689 null] ->> endobj -2713 0 obj << -/D [2703 0 R /XYZ 90 412.7304 null] ->> endobj -2628 0 obj << -/D [2703 0 R /XYZ 236.6686 182.605 null] ->> endobj -2716 0 obj << -/D [2703 0 R /XYZ 90 165.7665 null] ->> endobj -2702 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2720 0 obj << -/Length 1889 -/Filter /FlateDecode ->> -stream -xÚåZÝoÛ6÷_!`/60³üžµMZ¤ÛÚ,uч®[޽)’'ËK³¿~G‰”%QNÖ‡bCQˆ–Nw?ÞïwC< ÿˆ§°'…DŠqß[ÞM°w ·ßLˆy<‡çóºÀËÅäÙkª<…”O}o±.4ø J¨·X}žúˆÈÙœ -<½Ìf$˜¦yºO—ÌžFù¾|oo²0{˜Í–ŠO•š}Y¼�œ/*»–`>ÑVÿœ|þ‚½À{;Áˆ©@x÷ð#¢õî&œ2û#ž|˜üZé)/tÍŽS˜Y@˜7g> -ˆâ�R�@˜A "DÐnG -a̤'CXb^xãRÏ;Ì»(�²ýóö< ¦H2J½ºj ÀRI»H`xDB°D’0qÔª¡ì ͆Q |Ñ âhÜJu¸�Õ�3�&ƒ¦ñß°Àû<;,ó2vEN�g¯ ¯½-òe �–oaV -5Lð2hVF�Rç £:Ý&àìòGžšë&2O³FB6¥nŒÐ6ÙæÛ0Þþ­z"F<‰!-º�e¥æu±¡HY1=¥›ÅÓÃZ¯žu3sCF‘(…•rQ´B&ÁëX5Qè�-7aÖ%J‘�êãQâO‹Ò6ÙLl¬3¨˜®­ü:͆ÊzÃæRŠó‘°ÕÅÂV‰u‡mä áàlÆè+å"i†N@ˆ o!Ñ¡;$ûím lšC°°^+ð£t}r„˜:îµ%ÒQ¬Ôp­Kõ×Qßgˆ@½Ñ:ÿÞí⨷€’AËU&Ïô�ìÖ<ºjDßDµ 댾Ó7Q§ó{ø4‹Whé@–ÄP¶}d…Æ ´ui?–á -·h²í¤~Gñ1m­Äþ.ß¹s‡ÇK:¨Ã„¤iÔžuœ´dî8ÒÆ`Ÿ§»£ó b÷/G %ed9Ö¤–#óõAì©'C¦}‚à"ì> endobj -2722 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 648.0568 162.0093 671.0255] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2723 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 648.0568 210.1583 671.0255] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2725 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [256.7339 570.3345 283.0848 581.2137] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2726 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [260.0953 528.1725 365.4795 539.0765] -/Subtype /Link -/A << /S /GoTo /D (a00158_g2ebfe5c8a7f3173714efdf2df74fc392) >> ->> endobj -2728 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [259.9318 418.3349 286.2827 429.2141] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2729 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 364.5914 154.6371 375.1217] -/Subtype /Link -/A << /S /GoTo /D (a00158_g26ae707402e494f3895a9f012a93ea29) >> ->> endobj -2731 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [254.3228 266.7089 280.6737 277.588] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2732 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 212.5917 154.6371 223.4957] -/Subtype /Link -/A << /S /GoTo /D (a00158_g26ae707402e494f3895a9f012a93ea29) >> ->> endobj -2733 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 120.9622 162.0093 143.9309] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2734 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 120.9622 210.1583 143.9309] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2721 0 obj << -/D [2719 0 R /XYZ 90 757.9346 null] ->> endobj -2681 0 obj << -/D [2719 0 R /XYZ 378.1965 605.8182 null] ->> endobj -2724 0 obj << -/D [2719 0 R /XYZ 90 588.8207 null] ->> endobj -2676 0 obj << -/D [2719 0 R /XYZ 236.6686 453.8186 null] ->> endobj -2727 0 obj << -/D [2719 0 R /XYZ 90 436.8211 null] ->> endobj -2677 0 obj << -/D [2719 0 R /XYZ 236.6686 302.1926 null] ->> endobj -2730 0 obj << -/D [2719 0 R /XYZ 90 285.1951 null] ->> endobj -2629 0 obj << -/D [2719 0 R /XYZ 236.6686 96.348 null] ->> endobj -2718 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2737 0 obj << -/Length 1898 -/Filter /FlateDecode ->> -stream -xÚµYÛnÛ6¾÷SØEí¡fy)©»J›´K·¦Yã!m(² •¥L–—ëÞ}?ER¢ŽN YüøŸO¤ˆƒáqìxÜCs…mgع…×ogD//a}i^­f/ÞÐÀ P ¨pV7A§„:«õ§9Áx±¤°Ï÷§çðÈñœ ¬Þçë}«çã<Úo㬠Ë$Ï_Vïf'«š±–‹3A$Û¿fŸ¾`g ò½›aÄŸ;÷ð#ÔÙÎ\ÊÌ�tv1û£¦£ª Cêq£…ŸžRO â!Š],AS<ÿiƘfZ©ó‹¯»º89;þŒ9îjEY€\×÷jŠ•Lr¥¸Õ��–t5|iáûö¨J9ïvyôµÇ_0äãûŽI æÏ%Éò¹2Á:,Cë1�30‘¢ fÑXO³¢.bn ¨\ÄÙºÙ�ä> °HP—U�Õ&ÙÉ#óm¹|ÄóìÓoåFõ”/Ÿÿ-ÿ‹ õ&Tè»"/óÊDÏã-–Ì£@8V¨Î²õ²Üq¸V/®S@ìÁ}V&©f‘¦m9ð|jÑ®ã8SO oY+GPÀ¹Ò?4êW:Â߯Y¾ |~Ÿ©Ÿe®þnÂÅZ7õFÓ†§"ŽâDnRËšàõƒ¦°‰ l›—ú¹¶z~ÓA­^ë,Žò,‹#™­¨X>G˜@ -E"H0Y´´QýÐò„1Zœ Bm…5`;;€/ò™ç·™Ëª²+‹}T*ŸÔiþâ q­Ýœ!áù’©Ú…Ù@º(ð¡ $iEóH“Γ¬¬ÒÆŠº:*ú"c§�nðæ~“D›&�Û‘mˆ^kš2%иk)Cœ`ت�K-Ø”K Lê^‰ÖåK9r©ð5¨>ߎ71r±OÛ|¥7£MX 8�R( Ìÿÿظ£Ü„å“6õypÐ1lÊ1f ¤Ÿi>"<8ÀYƒúŒÛžq".fmÆÒ3ûl—Üf¦z‚- ¯ŒA¸Ûr3R9ŸlbS1a˜‚.ë»ÓeÕF�—UîCd10´Tóä[¸½K㉂:ź -?§Ç˜Úµ²¡¨aRÄݶ¼CQ?\PÇåÓ¦©Q‡8÷¨IÎjöXº†È®êÒÇjêKªÙµr qpš˜Y�x~;0ä3ýV…m�ÎjÛS00аpykâd‡&Ϋ‹ÕÇÁ©SÍjÔáȺ�whì4ø¥½at´èŽž>ä¢à¼#Bwô4¨CŒ{Ô¬ñºãè¼újà$��S'k¶OÓ%Îm’…¥I ›d·£êrèê$ Ój£Æ3Ô�{žžu;ø 0QŒ{’ ãö¸ÁgÒ -ÍàÓ7ÃààÓb~þ#ÓÈx¯r�8>9ЫlØ”y ¬*TeÑcK|D™té$[ƒê³mFJ:\ëN¤ô@s�Ê¢hèbFìóoöYÔ”4s¤zTjŒM€�ö‘ɧB83ñéT²Qã©ÄO)÷Ùì¦Xÿp³ëK8Øìj˜q§i¾¼—Ê‹t=Ð÷°i#Ð!º´¬**O¡]Ö08ø^×Hã†ÐðCBt©Ž÷|ŠåAˆNën@ØöhY ŸM‚Ê`äñ ? Okø¢ÕðÝ©†¹ pü?:]]ýy¶:ý}°ï{PHY@€¤oÆäñ¾oðK{Ã@ûíÑíû c2“ŽŸÕ¨ŒûÔ¬ˆ�òl]yg¬ûSb¸ØÝÿráƒ+íKs‹ÓT¼šlg|/öqçnÊ»›²/Šˆ®‡C×IÖR ÚÝÅQ"½k�-ü4Ì”<2è›K,%@Ç#.%ˆqWF‡ �@°AQã—ö†~BõéV]»ŠÕ³“Ëã…+Ï¥„�ùj°ù‘ Xã)[>y#ÛmèÊvZ–ÃlJDù8 -³v?ÜïLï2�2ÚĽÊÅ:y!ßäµ[÷(…uµ¶3׿êmú‚Ä„OUá!êÌHÙ»á”Qùp—Daš>,7A^Ö�ÚD—E´Ñ*4í<‡vRiÑoz¦“R -i!›ë¶k£•á…ãÁ‘ ÒJÞEž}´FU1°ºZýúñ䨺Wñnßb lÝbU§q˜eÿ@,pUãþ¹ZÒ´­÷»çj»MªL¶q5‡9ž@+�£TíM8J-ÄaÑY �>‡ýS­Á‚›ìä¯NÞžžUŠI:¿Ô^õQ@ wÙªÙF…:QŽŽ�VG5µøý»¥ÛUüí.)âʆµØCì’ i2ЦÛж´¢ZI¿­>Ø’>û §åìYÃu9°ù_…�Ó]|€Í&�4¾’ª­¯ò}Ù±à0ñ1ÛêÏ.½ýÆ_¢ÙßýØD ßzƒßÀ°#Ç.žôªú�æÃÂZ§?¹Ãüª¹AÎýZ)êÛ8‹‹fÒ6]è½yx'‹Ð^ÿ�ߤª¿ø%e/©þäF1ºÈJ�ë±¼ÿmÎ|8ο=ÜöïÜdݰÒ�åendstream -endobj -2736 0 obj << -/Type /Page -/Contents 2737 0 R -/Resources 2735 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2701 0 R -/Annots [ 2740 0 R 2741 0 R 2743 0 R 2744 0 R 2745 0 R 2747 0 R 2748 0 R ] ->> endobj -2740 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [238.4524 726.9533 264.8033 737.8324] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2741 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 567.8253 135.0008 590.794] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2743 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [262.8109 509.031 289.1618 519.9102] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2744 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 370.1174 162.0093 393.0862] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -2745 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 370.1174 210.1583 393.0862] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2747 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [274.8955 313.1712 301.2464 324.0503] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -2748 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [420.3578 271.0632 513.9963 281.9672] -/Subtype /Link -/A << /S /GoTo /D (a00158_g55ce98ea4d6f22e9d5068b904d4d2447) >> ->> endobj -2738 0 obj << -/D [2736 0 R /XYZ 90 757.9346 null] ->> endobj -2739 0 obj << -/D [2736 0 R /XYZ 90 739.9346 null] ->> endobj -2673 0 obj << -/D [2736 0 R /XYZ 236.6686 544.1142 null] ->> endobj -2742 0 obj << -/D [2736 0 R /XYZ 90 527.5172 null] ->> endobj -2682 0 obj << -/D [2736 0 R /XYZ 236.6686 348.2544 null] ->> endobj -2746 0 obj << -/D [2736 0 R /XYZ 90 331.6573 null] ->> endobj -2735 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F52 1229 0 R /F14 636 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2751 0 obj << -/Length 564 -/Filter /FlateDecode ->> -stream -xÚ¥TMs›0½ó+t„Ê®¾å[;i2õLgÜ)·4bãÄRŒ'õ¿¯@†Bsép�„žö½Ý}p DKM-Ь�g÷û>°�ºýtøœE7wÌK­bŠdÛ.‚B*2’mbEQ')“¯êM\5Õ±Z¿&qÑýÎ~÷Tçõ9I90+bL³eô%»]’+liE�@6Nß2Ê­‘äÝ-€¢µŒ"Áx¿ØG?¢ï—8~£;0—ž`.5ƒœ¤\QƒVÌ¢Œ¤€F»J0¤ˆ’ÍWÂX -À5ÑœSÐ ºr¬ÚÄó:?MQç‰À¨æŒ‘aè^ÀDÈ=Uâ¦W%šjäòµ•òæúЪy�ˆà@�TrVÄ•¼GÍ”�ɹ¤†k3&ÿ ŽM}Z7Þo�)œ�›;ƒÓ’S¥MKêO÷ …ðMë1}ÌO!tµ+]±ý¢©ÂøR„ÝzäHú�Ž Ñ �•ç}s¥ÔG}¨Vïº*7»fW•f¡¨PZ}Ì܃&Ìã&H¤B;bÎú\%ŒjôÞyu:´­êDʸ+IUˆ—º#Ý]hãÝ®?¬DÊ›þ‚—�Škæ'ÕÖ�í‘}10}¡s·ßyGèÙG \ž¨¤ú¯‡¡{ÙŒ;‚|t�µš›þa "Úd¨ó¦Ø„tBÆßúÉ2AŸÂCÒ Æ üЍPۄɸ -=}]4 À§³o«ßççbbé¼?SŸ?*æI+endstream -endobj -2750 0 obj << -/Type /Page -/Contents 2751 0 R -/Resources 2749 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2701 0 R ->> endobj -2752 0 obj << -/D [2750 0 R /XYZ 90 757.9346 null] ->> endobj -2749 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2755 0 obj << -/Length 2441 -/Filter /FlateDecode ->> -stream -xÚµZ[�Û6~÷¯0šXsy¿ä­É4E¤»ÛÎ[SŠG36êˬew’þú=I™eR-² tû|¾ÃÃ�‡‡¢ÈÙ\vµ;¿;®/ûúp®ÎÛãaùëýûÙw÷±÷K0I,íg¿üŠçàßûFÌh1� Œˆ1t¾ŸqÊÂÅnöóì?�÷ ýÁXóaãí#ÁH¡½ÊµO"¢—+‚1´¦ÞO_\k>íŽëßÝé¾:TOµmš»~¼Ö¶��m¤³N�¢µñµÆ¹`�uD¼ý»ú\mwõƒ�WݬOÛç-0Ä¢n°vÀg)�—÷efûà#œá´ÚÁ¹‹<\ëÅéx9ouãž>ŸŽK"l¼•Êšíþyço}©Ï|\R±x©O�—�‡…GÇGgý�ööãñä�³‘Úžú$ѯ¡�¶e]¼ eûaÐwÞrÁñ#Æô³õ>Ä­ÙþY£Î’B’rëo�s‰·IÈwëÝo¬d×Á/îþC½ÞU§–ž¾lÏwÿ }0�5Ã)Íù\r‰°ÆÆ©Ò>:=yÌO‘>;ü*þ�iÜû©]ÛÀß}xó ÿ$ñ„S¤¥82TbçQŽUŸ}_­OG´„6ÈëH„ÂæOœCOÇ}ÛeЃ޶imŸ7>‰D±·#/Ö†?ŽôÅ )B¡ñŒ#8êB/tøUüƒ4©]/ØO¿µí»ÕT$1˜êû3èŒUòBR„ d™žaþÃE¥:ø�¹h#÷ÜðB!‡)˜QSCØá Χv»>žêúV¹”HpNòìP%'¤A˜q5A4$×a¢Õ\‰¸äã3M­bT:›j`Æ ˜±Fœ@,ó�ÇsýzÈ -ó,RŒ’W¾ZL³qˆÆ]ú+v.° wá4[¸ñ°Ê]_›Æ®M£ [�Ôþ'߬ô�;Ùl]ÃèbSyvíëÍåð{3Vc Åa¼N×PÅÏ[k>âµ^Pfãs‚_�–D/ž\lGêaHºTÙÞOÞAýÛŒ,¸†š�(usÑÆÒŒT¦ùÕŽ%ûH©HÓ,ü -¢•gìP%^˜Þ –rÀ %ë.I—„ÁІš!óíñð%»aŠ]r¼@ët¼ÂêNÀê.‹ ˯•m¡&½zr$\ -ÁO…¥W4 <×à©ä.µÀl¨Œž{˜ót¸êZR¼ðÂë­jàú´äbáW6(íYç‡ö%uÞcï0G4Äî¦ì8¸¯•(É.Àʲ‹ æd—çíd×ã-ȮǀR”}š¸tWÛa|ï[(–$Ó¹ ×»VîÞcÔ¿yÞ®ƒcÞW¾¥ 9—HAÕ< ¿ÝË_r#±*ÛßÞþëÇ·ß. !‹{š¬r¨„L$d>ªàDjÍen�â—ò m«lwN^½jèˆ(,M°¢ä¦b@F -¬(…,ãU -Þ …oY -}ò R(¸‘Ø“Bª -Ó/„¢C|H­e•�èt 9¢ 󌦷ëê�ÓI€•u’cŒt’çítóNÐI�|ŠNòn$vƒNLìv‘“o~@•xkAö½Aès_ -„ëÃe?º<÷%•ê/¬§Õ'1:SQu07uÙõî’©EÞX¤oqC¥u³Ž¢Ž|jå£ÇgW;δ4n‹à]¼u3* -ZžY Ä€ÜP °òPÉ1FC%ÏÛ •˜÷äãö!­ M ÖèsgJ(�/y‘ØíЍía›rJƒ®M!T¢Ö eÔ ð6=Ž‘k$(çSCÐá ~¤v u$•q»y•�B‡Jé¡zˆßšBe�‡aÀldw±]\q h]Ì¥ ¢›6ct&mt0Kÿèc[í¶NÈaÿ¢ò[±/Uïµ¹'ÞîÙ®Ó°¾´*»]×â KíßX3…”$£á½Ò{P‰}hË’ß̯DqRå_åõˆ}—D‰)U™¬˜cƒ™”Xà )±Ç§ÄáØÁ¶3~<„1Ó¯0(bš‰�ƒ™ -ÃãK®&vû[ŒéÚ“ É4-* JìÆî‡AŠíwÐíÔikVÅäÔ(tø‚©ÝRê„ɨ¤;†©3 Rú~÷à Â%'Ã0ÜN�lRê„ê‘2E&¦Î�K�Ö~ñàwx§&ÎG÷&kßÃ0c{³«ÐH³a»o'W/´<±ZL­#i4�ÿ•= Jô‰µ|veQ#ï«dWTkSÊ®Vή‘Á\vÍóvÙ5æ]o@ #ŦàTx³Åf‹/y�Øí}T�›ðS€šP%rMÇv™Ñ ûíœI0b\É©Aèð?R»ÅrÌχ¡C¥ôƒrS#Å4†aBÎôëÕÌ|ÌìGŠ æãœÑçó)›ŠáȰœ¸¨ŒÑ¹T`nñ[}�dœÁ?û¥uû!ßñÒìþZr6Ê>+Û^(ngç€/D#µ[ÊÏœAµ%Íx§\¿í ¨j-›Ÿ�„A3mk�B&‡ªpÌ; 2$Òí7ýíOYÛ•#ŒÆ¯/¤­Y´v%¾(Gåö­¾¯õéúUWØ£úNÞ[�\ü¡þˆ_Sö:lÞC³¤× ýl¡ýzSŒ}Þ¾¹»;~þòT'õÚ¯mƒkQ”þ÷µÈ7endstream -endobj -2754 0 obj << -/Type /Page -/Contents 2755 0 R -/Resources 2753 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2701 0 R -/Annots [ 2759 0 R 2760 0 R 2761 0 R 2762 0 R 2763 0 R 2765 0 R 2766 0 R 2768 0 R 2771 0 R 2773 0 R 2774 0 R 2776 0 R 2777 0 R 2778 0 R 2779 0 R 2780 0 R 2781 0 R 2782 0 R 2783 0 R 2784 0 R ] ->> endobj -2759 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [304.7882 642.9278 343.8612 653.8318] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2760 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.7163 630.9727 260.5985 641.8766] -/Subtype /Link -/A << /S /GoTo /D (a00159_gfe5e93119035e14cc485760a176249ba) >> ->> endobj -2761 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [413.5434 630.9727 467.5403 641.8766] -/Subtype /Link -/A << /S /GoTo /D (a00159_gceb952d27de8125d5146ac0bee325b8f) >> ->> endobj -2762 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [268.7434 593.3114 307.8165 616.2802] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2763 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [124.4207 581.3563 163.4938 592.2602] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2765 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 486.8218 162.5475 495.6685] -/Subtype /Link -/A << /S /GoTo /D (a00120) >> ->> endobj -2766 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 447.8916 163.1055 456.7383] -/Subtype /Link -/A << /S /GoTo /D (a00121) >> ->> endobj -2768 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 363.8772 196.4299 373.8049] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2771 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 306.282 227.9818 316.8123] -/Subtype /Link -/A << /S /GoTo /D (a00159_ga680bc3f3a1a8a6aec20fe729d138cb8) >> ->> endobj -2773 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 293.2926 223.0005 303.8229] -/Subtype /Link -/A << /S /GoTo /D (a00159_g720ac440c7b24bdd07c53ba146e36fb2) >> ->> endobj -2774 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 280.3032 178.1689 290.8335] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2776 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 197.3698 179.0853 207.9001] -/Subtype /Link -/A << /S /GoTo /D (a00159_gd58a6c7e62ae59bf7a016ded12ca2910) >> ->> endobj -2777 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.5282 197.3698 265.4205 207.9001] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2778 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [304.8984 182.3375 338.7573 192.2427] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2779 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 158.4396 192.6345 168.9699] -/Subtype /Link -/A << /S /GoTo /D (a00159_gfe5e93119035e14cc485760a176249ba) >> ->> endobj -2780 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [221.0774 158.4396 278.9697 168.9699] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2781 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.8358 143.4073 391.6946 153.3125] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2782 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 119.1358 180.9085 130.0397] -/Subtype /Link -/A << /S /GoTo /D (a00159_gceb952d27de8125d5146ac0bee325b8f) >> ->> endobj -2783 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.3513 119.1358 267.2437 130.0397] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2784 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [397.2067 104.4771 431.0655 114.3823] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2756 0 obj << -/D [2754 0 R /XYZ 90 757.9346 null] ->> endobj -2757 0 obj << -/D [2754 0 R /XYZ 90 739.9346 null] ->> endobj -150 0 obj << -/D [2754 0 R /XYZ 90 739.9346 null] ->> endobj -2758 0 obj << -/D [2754 0 R /XYZ 90 716.7313 null] ->> endobj -2764 0 obj << -/D [2754 0 R /XYZ 90 503.7525 null] ->> endobj -2767 0 obj << -/D [2754 0 R /XYZ 90 381.8888 null] ->> endobj -2769 0 obj << -/D [2754 0 R /XYZ 90 324.8962 null] ->> endobj -2770 0 obj << -/D [2754 0 R /XYZ 90 324.8962 null] ->> endobj -2772 0 obj << -/D [2754 0 R /XYZ 90 310.267 null] ->> endobj -2775 0 obj << -/D [2754 0 R /XYZ 90 215.9841 null] ->> endobj -2753 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2791 0 obj << -/Length 2035 -/Filter /FlateDecode ->> -stream -xÚµZY�Û6~÷¯0лX3¼%nч4GÑé‘.ú’�VÖÆFm9•å¤Û¢ÿ½Cñ°$Ò⦠-d)ñÓ\Î|¤Kæþ#s…ç™È�b\ÎËý ÏßÃëogÄN¯`~Õ|s3{ôœª¹BJR9¿¹ë$H‚%t~³~½�ˆäËxñ²Úš{3¾ÝÊ_Íp_ÔÅûj_Õ­y¾;Õe»=ÔGx¤™” ‚Ùòí͋ٳo‡5S0I´¿Í^¿Åó5˜ûb†S¹˜‚ŒˆRt¾ŸqÊÜÃnöóì'/ÇLtļ„ÅÝ%)!¨ó—‚ûÙÙ]D—+‚1^<­Þ`LëÊ8öôPž´›…öN{4Š„–rĸêKBÄÊúb=öòÙËoÞ`�ëb_]™WǶ9•í©Y’|áÞÕ§= ˆÖv–O:ù¿,]»Su=Žn.&y6—"G˜qÒ�M#^õÑ&Nr‘Ë0±aò­ý¨ÃP.W\+7EcFÚ«wO~øþÉãïÜ»}µ¿}WNu«]y .½ýÊÀ߯;×DJH ù‰¸„¥kp¡©RjàŸ‹J°/.ˆ7ãNL—ÞGóBK7£¯ÍŸ?�Û?ªÃ�ÖìíÒJ¯,þ´¿i&’"¡0ð€X]Mz ¿úxØ®»)š#©(h °xÞ¾ìf8ÊrJæ½÷Zt2„Ù g½ _Q H‰€‘@ì“÷´*wEc»°Ua\,�ó€dHRλ/o6[]&ƒ*R63t¯NÇjmF­�1kVìvú‘/Ö^/Ìæ�+L0<ÜYÑÎ-iS´fTµý¢«»½7òÛMå‡ÒT€îÙW»³]m!Ö?-AïlYïĽ™²^Íla^>±OMSXاm»1£ÂÊ�,4/¬Sðn_´åƈ"Ö|�üP•[]|:aRô¶j̸‹€\Êwêµy "¶ÍÐ1Sܶõz»¤bñq»>;[¿À ct™Ÿý^ì?ì.*A(Â<{X�ê�£eÊÍ»=¦Ó»<ÔueÖÉî©ñ¶•ÌãzÛ�HýðÕ%ãy�,Sñä­î£Â¦›+„1Y0Ìÿã’Àvj`g¶Us ‚G0…-;;f@`ˆG‡–À’ž-!8Caâ,U›ÒÕÀ±~†Ç9™€GE"Ð/- ±\ñ¡^³hn‹0¥Êä+¼iÝ”ßÞ0é6*¼ÖK»+Ú.ÍáÑînuiä ÓåŒ9òEO5ï-æUÏ+�OxÊÕ^uev[ou�Ç®½ÌÉ‚'BëQ)#iÚˆ«@iLJòÐ8|J} ×Ç +¦—‚À™R¢&ƒàQ +8P Ae>´Bº±Z!€¸eü¡aðø”�\†»¦ª.EAÀ~$ŠäÓQ𨄡4ÇÐåòä…åDÅ·÷¹¬ô`SeÅÁ:¦[ØX/¥HŠ,¡Ö‚B­Ã¢B¡ ±œµš¢b–uEþVE¹ ùK¹9Õ¿ZB¾­-§¹om³‹�C sh‰ õ`SAs°®ŸöaÌ$\o±Iµª•b}ücj¨ÖG­=´®ã{Ñ a¸ã0p­“sf…Ñ® -lövžèª=ÔDW¥ ȯ]}ËE¦úé„jŽTN8 §‹‚_¹ˆ…,ºÂ¦Ml«]]µkT&ríD°éèxTJy M+7X–•1$úÝvké¯fûöпۺƒ­Ê‡ù ¿ØU>7n—/Ðùósï(¬‘1” v>?3{z~niö??‰3ÿ¨y•=7=z«yþP2�1˜ºhn.FÒ3Ä3j!ç6æ¼õ„r´v”Cýgð!ƒ¢$0g‰òøUÿƒ0ÉC¹Þ.KéÇ}CŒ1¶‡†ŒÉ…C…êcú¯«?GnPБ‹F68÷Ñ7Ý0<ƒêò4¼ ylNe‰#¨½Ÿjû®7+bö|¶6OQöÈÄŠÑ.´D's‚99üªÿA„9rûgš(qÌ%Ês–�,¯­C¥ôÒ|�ˆ•l*a}q&§Kvu¹dÓLiÒøy¡˜Í7°$Þ|=Ìgí@9úF†M{ïQ÷‡„NK\È¡ÒÇ“ùü¡©ÌIüpÜ=8e),-%”�̾\�>á@(7™²Ðœ©JÄÏ�ÚYÓù -…D -¥ùÚCMä+gH{듦Sª?›b„F)†‡=ŒbLFçL1ÊiÿÅê£ÝDñ¯ª»ª©ê²:žá¶O^_w÷®W‘ xˆ½67½��õ:2¯Ï(NO ¹Ä¢OOÜ�æ6Ý »3¿TI~¡/P€«!¡„ð<µ¡-|ÕÇGØÅXj‚\PÅaß°±£ôñ¨Pû€\P%5§jÿ/¸…]¶ &9 õ: ˜àE�Ú&¢Ø-ŒhŠÒHðOvÕ¦GjžVÅ¿¡5ÉvqúŒ~ÁED™�0аYŠâ8üªÿA¤brSý‚S…(×)9°d|-äP ý¡´É–ùÈxâLzÆ\nÃŽ×ÌîsèM¨|‚ÜŒ¬ˆS š&6>ŸiÍØé(©¨ëRíÿ`6 ºŠØ}¹ :ô¤c™INÇX¡ËæDì> endobj -2795 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [324.7453 474.4264 376.5504 497.3951] -/Subtype /Link -/A << /S /GoTo /D (a00159_gd58a6c7e62ae59bf7a016ded12ca2910) >> ->> endobj -2796 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.3663 474.4264 437.2485 497.3951] -/Subtype /Link -/A << /S /GoTo /D (a00159_gfe5e93119035e14cc485760a176249ba) >> ->> endobj -2797 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [454.1911 474.4264 508.1881 497.3951] -/Subtype /Link -/A << /S /GoTo /D (a00159_gceb952d27de8125d5146ac0bee325b8f) >> ->> endobj -2798 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 410.341 142.7416 431.2524] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2801 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [244.1409 324.7746 304.8028 335.3648] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2802 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [348.807 300.0021 387.8801 310.906] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2803 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [285.2161 264.2545 324.2892 287.2232] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2804 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 230.5641 142.7416 251.4756] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2806 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [234.3477 153.4162 295.0096 164.3053] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2807 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [391.1676 128.9426 430.2407 139.8465] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2808 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [295.4576 93.195 334.5307 116.1637] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2792 0 obj << -/D [2790 0 R /XYZ 90 757.9346 null] ->> endobj -2793 0 obj << -/D [2790 0 R /XYZ 90 739.9346 null] ->> endobj -2785 0 obj << -/D [2790 0 R /XYZ 90 723.1038 null] ->> endobj -2794 0 obj << -/D [2790 0 R /XYZ 90 723.1038 null] ->> endobj -2799 0 obj << -/D [2790 0 R /XYZ 90 371.2512 null] ->> endobj -2786 0 obj << -/D [2790 0 R /XYZ 90 344.9853 null] ->> endobj -2800 0 obj << -/D [2790 0 R /XYZ 90 344.9853 null] ->> endobj -2787 0 obj << -/D [2790 0 R /XYZ 492.0776 188.3053 null] ->> endobj -2805 0 obj << -/D [2790 0 R /XYZ 90 172.6296 null] ->> endobj -2789 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F23 482 0 R /F52 1229 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2812 0 obj << -/Length 1157 -/Filter /FlateDecode ->> -stream -xÚÅW[oÛ6~÷¯úd3Ç»D¿µHV4@€®ó[[ ŠL'Âd)Ó¥iöë{(RŠdÊRŠ ô Jüx®ß!I€á!�ÂA(B¤—ArZáà~¿_7½…ùíðn¿úõ7ª…”¤2Ø[ ’ A ö‡Ïk‚ùfKa ^7>ÂPà5AØn‹C“i;¾*’æ¤ó:®Ó"ß|Ý߬®÷½bg—`’µ¯>ÅÁì»YaÄT$‚'øÀˆ(EƒÓŠSÖ}d«?V¿÷rìD»`Ê=N0¢2Œ°Øz4…"˜¢�Q -¡ àxHûH:ˆÁ! - A‡2áx¬ËsßQˆ1%ƒ�4_gòt‚G�”#FÉHå[ßÇ"Ík]Ú�ºpïý“>å³ßeEòW7×v”Vã•wnáAÇàãZйg‘@˜Da EL†á¤gh;Dù¼Š˜…Aˆ�‡4j]û¤ë¦Ü±Î«�V›%2¯½GM¨gSÉìaFÿÞ„�¼Îõ†Šõ“ý(õQ—:OÜ\R4ym‡Ç¢4bãnþtq7cw3ü‚®Š&;¸)Çö•í»j’DWÕ±É2'c��AìÏNë–Œ—+ j àRB8Ž™òûÆ¥:=ØA^ÔN�yÛT5¤å~#Öqv�a—éÂ)ŠpDè2@]¦‹…’±Ö±ëïñé1Ós\™QÍ‘Š‡a;gþ”÷nêÓˆQŽ)N3ªƒk�åº> Ä3‘rÁæ£Ó£–”{ÒŒò6#ÁVt2`‘eú•þ‚1ÍÓvs¶‰v‰ÏÒÜm¡²ïâhßfEö²¿Üm8^£õ” ‘¤œ»Bv%S½ÀÿlYRívmý21îwœ&æ«ôݪ;#(gŽn}“ˆDˆ!¶�Üa¼þ¶1%“¦àxçf]6I}ž jD2¡!☒žôøíp�Ïd_®±yà§gˆÂ�R¨å±!gLéQ¾z ù@½bˆªsõ�Zf;:òBÄáÐÁÖ‰À㎠ݟ,fHÍ-…lˆ¶ÄÍaÆ•ÕøÁp/Î ££}fñÜz2ÙŒ«î°J²¸Ô.µOiýà/’(2}ƒ€ -ÁP IìàÛÞ/7Oªñèöúö�¡S‡¡Œ28¿U46ã,…=h^¹'«/õ©ÍW`†8�Îê!êòæ+ˆ¡ ³gõÇ6e|Òp¶ÌlÁSÌÛž%Ó=Xë©9nÁÀPÉÙ¼÷=jÂýq†aVȱҷ³„},Ûâ[ZTÙóÏ�úl~fö,[[ü‚¾Ü×ðvŠùøu 힬Y¾rØ–"ÇÈ,_‡¨Ë|å!°E)ñÊfaNõO7 ¾…“ÍB{]³0�—faA¹'í?hýßš…Ñï¼yeqÑ -·êΕ­KJÛ3t傦î³NÞ01ŸH!ÿÕU·½«G°„°Q�,á00[²)4XÈ%íM1n½×¹.ÍõÁ¥'ïnênpcúúÆ}—D‚w”í¨»ÕSŒ¥ÍžV¸›„ýïBvU|¾×Þ¥_6¥É.Í?endstream -endobj -2811 0 obj << -/Type /Page -/Contents 2812 0 R -/Resources 2810 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2809 0 R -/Annots [ 2814 0 R 2816 0 R 2817 0 R 2818 0 R 2819 0 R ] ->> endobj -2814 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 641.7124 142.7416 662.6238] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2816 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [231.1396 562.6724 291.8015 573.2626] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -2817 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [285.903 537.8999 324.976 548.8038] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2818 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [285.2161 500.2956 324.2892 523.2643] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -2819 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 464.7486 142.7416 485.66] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2813 0 obj << -/D [2811 0 R /XYZ 90 757.9346 null] ->> endobj -2788 0 obj << -/D [2811 0 R /XYZ 407.944 597.5968 null] ->> endobj -2815 0 obj << -/D [2811 0 R /XYZ 90 581.5869 null] ->> endobj -2810 0 obj << -/Font << /F29 499 0 R /F52 1229 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2822 0 obj << -/Length 2497 -/Filter /FlateDecode ->> -stream -xÚ½Zm�Û6þ¾¿ÂÀ}±�šÇwIý–k¶E‚4Ý&›»Úb¡µ•µ¯¼µìns¿þ†IóE&uèâ^Ëg†3Ï ‡É Ã?2«ð¬ª—³Õãž=À㮈þy ¿/]À?n¯þþ=­fª$•³ÛϽI� „În׿Ì%"ÕbIž¿~ÿqøã° å¼éö»?Ï›Ãâ·Û·3ŽK„…5jÁB=½º¾µºµi‚I¢4ÿ~õËox¶ß^aĪRÌžá u�=^qÊÌ—ÝÕÇ«Ÿ­œá‡~ÀØ aãS$ÁjæHaÊ…;E‚qfŽƒ‚*!z1àK&R"­DŒ æXowÍZ»®éV‡íÓq»oµ æ¸äPާƒœÛM3Œ:½¹ =¯-Ê¢þÉçS»Rb»ák}0c;£û¸>wûý—Ó“† ›}wlëG=¤nõˆÇZöG_„Öž›ÃvUÆÊz½û:ÔÓæD -$)gýœÞ€$V½m� 2‡�nxR»m×Cð|ÿyxâÌu=übÌÕ#�›ZYÕíðè¾ü~‡adþ¼=n†ÇGðlÀJV2TQVÌ$PF–L“JýtxИ½,~é8æÆ4–«Ü0ÌénůX`øOB“8‡,‘\&<·¨Œ!\Ä…`¾!†6h±,�¿oTÌŸûÈ-!A‡KËuá8_»w¹ú㾉¨¹6ܶš@±ãÁ7HÂìg0TÐ’eoñKw@<ßX®ãxÅ‹¯—üN+‰¨€¢á[øÝ¢rvT%*¸ò»kÇÙォ)Ö �,¼ýkÓ(çÊ>9¨ôònênx|ß\à|øMMr~ý¼?µúqŸÉrHõ½Ý·ËF�ûò¯n�Ê/ߨŸx³½Ú¯õoPv�g«zr_¯¾hÕ0ߥ-�úR¨™´Su2aÑ‚ñ™$PWyYdèañKw@–X®C�ÞQ—èA*†x‰«À¢€•³£°þáÛ1”´¾Ÿº£Ÿ`Ûǧ]óØ´G“_÷_ÏÉ5ŒÙ¯O»Æ<4’`%è Q!æhluƒuL›¸dXžz¿‡U­YÛ”—Kv±íp#þÀqVò³¥ìWJ£>‚`E!g’-*§Ú‚ -KèŘ“jµ¯BÍ Nj|ΆH áÙD–@‰f˜Ò´fa -†Ä -ævÄa"ÐÁ(Š£çÞIàY ¶JÞÛ -}.ªrfaÊV§mbÅÐ6™E× -Õm4õÚ<Õ&š{~|C#¬ÖF†X ëEòZI‘#Ÿ�åÉçL‘/­×’ÏÓ›!Ÿ§y -ùÒ6Drò­bòaX´ $} %µä+'’S$‰S4/�ÏÀ<ò©eRw¨¶©5­«Û¤íFK¹LH^$E5q&.ÚnAÎÕHÉ…DBm™úI4*ìíhiåŒ!J -~‘Ý. Án ˲;©ñÌîŒ^ÃnOïßÖz¦‘r.¡O*H ü2Á >gF$W™ñéÍÍݧ×7w¯nn¾{õî]Ü�JTñ’¦=aQ(«T*ßÝtÔOOª‹;ì'K&/W5�Š»�åãžÒèÄ=­×ÆÝÕ;!îžò)qO›ÉUf¼ÿ›•²à™éTNoý~QzUWùÇ‚Âöv»º-Â=† F)×§'à(6rNn-É##�Šº—9sþ=E�Ê3&¡Î!LR©å‹£t]\ÍSØ’´!”ªløñÕ¿ï>\ß~xsý1ªjUUzþ”Ö •¼ª<ÝåHhì-pÐy±u‰àZX6ºI�çðfôšøzzóö•OˆpÆŒH®2ãÃõÇŸÞ-ÆóÞ]¿�5tHœÐ2í ‹Ê˜Ao0á›ÁÇw`\cý˜=ò¡lo%#—wa. EËS$¥Ñ¡HZ¯¥ˆ«×­—áÙ@E`cêëNž ôøœ‘Üü2­öû˜äÜ A9ý•€†�^pWޱs uJô²ärÔ@*ê–�zJ£õ´^uWo>êžî)QO[É O„"KÊq×]£NРœöR½‡àEà{ˆùjSÆ:( ªÆôNAm†¾‰ŠçˆKXt&zÓâ3ó‰å*NDÞ#¤Ú*¹S­«+öý"+Øo‰�Ä ÿ0íŸí“ÚŽùéÍÕ…äÓv~.:±‡µ0eÃwé©¢þÿÅÎðíy³]©Ó’�> ì¼³S iÚÄÛ3¤gôÅ=.­T2â8t¹¼ÖÐ’¨×}¹í‰…e«Ž+0Qu2zMÕñôf«Ž¯{BÕÉXÉuªÎjß~Ž‹4œ—'TN} iÊDè|(;cÅ®ИLu€Ág-å^.Z+^é©[T¬Ø/*hÌ» …bÝv]sÐçæ©zA¥TŸbZ½pщzaa}½Ø·ª{~8 ÇW£Ež‹)£ÍÁ«9;u�©ú—á�iw¹4�¨êN^â<–r‚Jµá͔˗G`¨Ñ1Ã\SrÖÙâZ7Ê\Ò¿Œ$7õH®Sµšã9=âf°*iGPÆ -µ¯.úzàû!Ý'[S /åÄätЩä40eÉO÷ÇzÛïÜV§Ã�«íq÷Õ¼ñ’x=ž¶É3iå -^V/ó’„bŠ.sgC–OJG`j½Nëµéæêͯמî)ëuÚŠH®Ãüm»�S¿Pw�É8Á rêKH}JŠÀù)OJ‰ -Æ'¾tÑ Ê[X¿êô;/fY%ãÓVRª6ux´Çàx"…üK·µûD…æ…FÝ«À"u)D_Æ&*ÔPlhÚæPÛKnÆM?š?ÞªtÒ_ÕŸø[ʾ¥xø’Ú¹êZ«q°½NMöoнÞÿùõ¡iCwª«äÆ4Ç?ÿYÚOaendstream -endobj -2821 0 obj << -/Type /Page -/Contents 2822 0 R -/Resources 2820 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2809 0 R -/Annots [ 2825 0 R 2826 0 R 2827 0 R 2829 0 R 2830 0 R 2833 0 R 2835 0 R 2837 0 R 2839 0 R 2842 0 R 2843 0 R 2844 0 R 2845 0 R 2846 0 R 2847 0 R 2848 0 R 2850 0 R 2851 0 R 2852 0 R 2853 0 R ] ->> endobj -2825 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [382.9274 654.5304 448.5608 665.4343] -/Subtype /Link -/A << /S /GoTo /D (a00160_g66d19181ad5fe8b8f7c84d1f1d46a2ec) >> ->> endobj -2826 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [236.6088 642.5752 297.2509 653.4791] -/Subtype /Link -/A << /S /GoTo /D (a00160_ge4dcbbe6c641d2e3b8537b479df5fc99) >> ->> endobj -2827 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.2771 612.9957 194.4771 623.8996] -/Subtype /Link -/A << /S /GoTo /D (a00160_g6d9751d534453425c7a5a215d1d4414c) >> ->> endobj -2829 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 556.6105 162.2985 565.4572] -/Subtype /Link -/A << /S /GoTo /D (a00103) >> ->> endobj -2830 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 516.8967 161.7405 525.7433] -/Subtype /Link -/A << /S /GoTo /D (a00102) >> ->> endobj -2833 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 430.0643 237.9445 440.9683] -/Subtype /Link -/A << /S /GoTo /D (a00160_g3d768e989e308144190ae1a5ddfa9726) >> ->> endobj -2835 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 417.0567 174.2837 427.587] -/Subtype /Link -/A << /S /GoTo /D (a00160_g070d2ce7b6bb7e5c05602aa8c308d0c4) >> ->> endobj -2837 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 404.2781 216.3555 414.2058] -/Subtype /Link -/A << /S /GoTo /D (a00160_gecf13b8dc783db2202ca5c34fe117fc3) >> ->> endobj -2839 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 390.8969 231.4091 400.8246] -/Subtype /Link -/A << /S /GoTo /D (a00160_g221d37ccde7e3fd0dd2c2eb0a6b15493) >> ->> endobj -2842 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 331.4782 194.0092 342.3822] -/Subtype /Link -/A << /S /GoTo /D (a00160_g7c5359305008e9183b18d6ab75f568bf) >> ->> endobj -2843 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 318.097 188.4803 329.001] -/Subtype /Link -/A << /S /GoTo /D (a00160_g6d9751d534453425c7a5a215d1d4414c) >> ->> endobj -2844 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [243.4737 318.097 268.161 329.001] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2845 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 278.7567 182.941 289.2871] -/Subtype /Link -/A << /S /GoTo /D (a00160_gdf916e0c752f5cda70d0bddb2be422ba) >> ->> endobj -2846 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [186.7567 278.7567 211.444 289.2871] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2847 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 238.6693 138.5977 249.5732] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2848 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5678 238.6693 214.2533 249.5732] -/Subtype /Link -/A << /S /GoTo /D (a00160_g3191066cf8f76bd00b6843b77c37068f) >> ->> endobj -2850 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 199.329 178.5273 209.8593] -/Subtype /Link -/A << /S /GoTo /D (a00160_gb50f78bbf36d912d69f6c1685d0b40e3) >> ->> endobj -2851 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 159.2415 138.5977 170.1454] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2852 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5678 159.2415 205.5661 170.1454] -/Subtype /Link -/A << /S /GoTo /D (a00160_g66d19181ad5fe8b8f7c84d1f1d46a2ec) >> ->> endobj -2853 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 119.5276 187.9223 130.4316] -/Subtype /Link -/A << /S /GoTo /D (a00160_ge4dcbbe6c641d2e3b8537b479df5fc99) >> ->> endobj -2823 0 obj << -/D [2821 0 R /XYZ 90 757.9346 null] ->> endobj -1315 0 obj << -/D [2821 0 R /XYZ 90 739.9346 null] ->> endobj -154 0 obj << -/D [2821 0 R /XYZ 90 739.9346 null] ->> endobj -2824 0 obj << -/D [2821 0 R /XYZ 90 719.2952 null] ->> endobj -2828 0 obj << -/D [2821 0 R /XYZ 90 573.933 null] ->> endobj -2831 0 obj << -/D [2821 0 R /XYZ 90 449.444 null] ->> endobj -2832 0 obj << -/D [2821 0 R /XYZ 90 449.444 null] ->> endobj -2834 0 obj << -/D [2821 0 R /XYZ 90 434.0494 null] ->> endobj -2836 0 obj << -/D [2821 0 R /XYZ 90 421.0417 null] ->> endobj -2838 0 obj << -/D [2821 0 R /XYZ 90 408.2632 null] ->> endobj -2840 0 obj << -/D [2821 0 R /XYZ 90 350.858 null] ->> endobj -2841 0 obj << -/D [2821 0 R /XYZ 90 350.858 null] ->> endobj -2849 0 obj << -/D [2821 0 R /XYZ 90 218.4785 null] ->> endobj -2820 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2861 0 obj << -/Length 1851 -/Filter /FlateDecode ->> -stream -xÚ­YKsÛ6¾ëWè(ÍD(Þ$}k›G“I“4qOIÆCI´¥‰L*Çÿ¾  ‚yšÑ� µÀ.ö�ï@æ~džày$"”0.ç›ûžßÁçW3bþ^Áÿ+Wà�ëÙo/i2OP"©œ_ß6#H‚%t~½ý¼ X.WúàEýú4^„uãïb[2Ý~^lêû,¯Òj_ä˯×of/®[ÅÆ.Á$Qj¿Ï>Åó-Ø÷f†Kb1€ŒH’ÐùýŒSf_³O³ÚqôM‡¾é ÂúçGJ„ v‚æéùIPƒèrE0Æ‹—u¾iÌïŸQÇUàKÊQSˆëÇ’àE±ßê±Ê%‰Ù©8ü¸Ùù­þø ÜõÅb4áó DâÄÄQýUÞ™�Δ[ù•Û!Œk8®²¹&ò¦ -L`�#}:ž62¡RÂ]¥Œ! š}¥_0fÚ�‘³p„8Ä7"ÛütÊJp¡Xde�ëY‚‡&6 -b„˜#´" F” æÇéÏ" è]]šÌ}Øí7;òwŸtÃÑÞ¼W…~Ö'Óé¶0ÿ|¯³rŸ�P׋±@˜ÄÑ\r‚˜HX+´r¥ÂàÅ ŸÁX‚!F ¡æñA%XZ¦÷Y••§«®~‚)Š%½†´Ò¡%^�¤QD˜8�Ú.Ï.Q,$÷D+Õã -7¨D³ˆûü®cq,öyÕ Yª|µ~¬LðÊìXf§¶´›o…)Êjg„ìj—n· |�šÌ˜µÜœÓn;œ,†“d"Y©‘d!Q)Hã ?Óûã!K“Õ%16žX‹Úäè±�õ&‘S&–Íò¸”b�6�•,†Õ+æãj¥¦ô£)ýÏL¸óm ]Å’u´ûÁÊOÙŒÛñÃ.°$QI°8î+5¥?Méo’SÓh‰aÕiþ|ž©$Î÷çºI+ý<ìs“éœÅ~±¨.‡¶ôÎQÖšFI0Áõòü1»ÍÊ,ßd¦âþºVÐùþÝ'Ÿwÿ¾}kšõþxSo�7 ˜ŠÅƒ‚SN =±2»/T…ê2EýˆÎ8’B\D§Sˆ~«ÔµÕ§ìØìRƒ[ .�Hi�k sXß{,¥É„GFèYáF‡i�CT)œ`V~åvèaÁ¸Ã,"áHpwLèò+*ö™DA‚{Š/ðßþ¨Öï>J¤–LP -(ƒ#.:"=Öéæ›¡ktØÄÞ¤ðij­ý;Ë=\Ú§ª ²×åV¥So}\ïJ\½ðv_ŸT%Rª¾ìÕŠ¯l£>¬õSƒ—êcù;ôªvM%ÃWà8§Ž F9h˜òÕ8' ˆ—+†ÉâµéjMkg m3cP‘êíŒíì,9Wárço -Ù2­ ×=4|ÈôÏ‹ªëÈ>¼å4†zLâq¼u¥†ñ–sŒ„Oâf}úG¸Y`H?7kÅÜćSŒ8ŽÉøü[©øp*‹akáé£d-{:GϤ_7އ¢ø¦ÞmùÔG4ìLH$™È¨2g':bcN´bþ*â»VÌä„f+jî¸ÀFòÄ׬܈…ãFxiÜÏT?Zf«>•eú¨›@8«tŸïó;Ó«q:æšØ*Ù–ØÂKƒÕg)Ñ—*BÂuÂg¿ºµê¡ùC‚$S“v«{SÔ‡m§@×Ù%…Ê$„O`:^¨®Ôp¡ÂîÁ†”]HŒÇT?™‡öãVìbb<ê 31žÐŒv!1öµ_@Œ'ìƽ˜�û¡%ÆúƒÑZbÜÉ)‡&µ‹dì1G† >r ©C§xY+¿r;„©Ž;Èˈã8I:&t=e¥BÅ>¡1Ô9¾â3/ó¬ty™CŸï² -6Ïj•o¶ E£-å¢gX‰»ììýZ­{¤ÙÔ%ì*ªÃc¸ÞÈ7g`E¢‚!"_‘\©á ¶é0IͨªKe@>²(�j?c]¨¾w¹iÅ,âÐØAiÄ��©~´ˆíà,Ä0�ÿ Œ5ä¨þ-äÀ‹–ŠÎRnŒÔ«#øbhh䶨¡Ì³A§>ZykQgâÔfg‰Ç:³dó¢ƒ -.'MèF»Ÿ|íàÓ„Á¸ãÓ¸Z|šÐŒökn(ý…7ÎAMp5•_]•†VÛeö¢Ó>ˆ©„ª; Ì/ÆT·Ã¦¶bÓ˜ê›0ˆ©�â~Lõ? SÕ¾©>NžGÅ¢Xôk�£†ïcœ®ßª-žÙÜ��ŒtÝnuœ|ýë»: ÌýÂËu HTåôÞna0šH!ÿ×Ues×cu_ãíG€&E,n.±(tä€úÖå�WYž•ieY‰-Ö¿mã�B«Ú¼S¯_QvEÍ­,ÅÍ�­ÚS5“ÚÂëÛõ£½èüùx——¶ê6µÇKÿÉësendstream -endobj -2860 0 obj << -/Type /Page -/Contents 2861 0 R -/Resources 2859 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2809 0 R -/Annots [ 2865 0 R 2866 0 R 2867 0 R 2869 0 R 2870 0 R 2871 0 R 2873 0 R 2874 0 R 2875 0 R 2877 0 R ] ->> endobj -2865 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [206.3331 702.4599 232.1263 713.05] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2866 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 599.8741 139.3246 622.1255] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2867 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.1901 599.8741 192.3555 622.1255] -/Subtype /Link -/A << /S /GoTo /D (a00047) >> ->> endobj -2869 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [269.7449 518.2645 295.538 529.1536] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2870 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 360.3144 139.3246 382.5658] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2871 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.1901 360.3144 192.3555 382.5658] -/Subtype /Link -/A << /S /GoTo /D (a00047) >> ->> endobj -2873 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 313.9634 157.1381 324.8426] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2874 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 199.7115 139.3246 221.9629] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2875 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.1901 199.7115 192.3555 221.9629] -/Subtype /Link -/A << /S /GoTo /D (a00047) >> ->> endobj -2877 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 118.1118 157.1381 128.9909] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2862 0 obj << -/D [2860 0 R /XYZ 90 757.9346 null] ->> endobj -2863 0 obj << -/D [2860 0 R /XYZ 90 739.9346 null] ->> endobj -2857 0 obj << -/D [2860 0 R /XYZ 90 722.6705 null] ->> endobj -2864 0 obj << -/D [2860 0 R /XYZ 90 722.6705 null] ->> endobj -2856 0 obj << -/D [2860 0 R /XYZ 358.4819 555.6542 null] ->> endobj -2868 0 obj << -/D [2860 0 R /XYZ 90 536.7606 null] ->> endobj -2858 0 obj << -/D [2860 0 R /XYZ 90 349.9037 null] ->> endobj -2872 0 obj << -/D [2860 0 R /XYZ 90 333.1669 null] ->> endobj -2854 0 obj << -/D [2860 0 R /XYZ 278.4221 155.4916 null] ->> endobj -2876 0 obj << -/D [2860 0 R /XYZ 90 136.598 null] ->> endobj -2859 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2880 0 obj << -/Length 1378 -/Filter /FlateDecode ->> -stream -xÚ­XÝs›8÷_ÁÛÁL­Ó' ¼õ&¾N3=·��{i;bË S)ÆMóßß -Iƾ»ŒÇH«ýÞý-Ã�x{‘ˆ�d<ôV�ìÝÃò» ±ÛSØŸ¶ þXN~ÿ“JO"ÒÐ[nj!A‚ê-×_üL©Àþå|anʀľÚÙÏ€`_•Á·å•ÇqŒ°AŒ>Ep¤W'³e#Ûª&XH´ä“/ß°·¯&1 ï0ˆ“Ô{œpÊÜC6YL>7|ÌF}`ÈBNÁº˜0oÊBÉ©b�0‰#p%ˆA‡�K„1‹¼ˆ1„#ÌkÛæE¥.ºÖLQÄ(õÚ {bª¹¬%܇"ÂÄž›¼|H·ÎüÍ._Ui‘ë'îyöbÖ³¢ø¾5‹in–ªå*UæIf–“²L^ìñ�Yúžþ³=øPl«XpÞü-Âßšµ÷Ÿ Q²^]f ¿ìÎo>|0ûu)HÞcß.ìKtU”©­ª+Æôïº5ÀÕ0„× à¶Ö®Mõ�?´& ž<ÿÕHü¡¿JAL�ýJŸ25üÑ\w·ãeÞ„~@ÃáqdûbBá£UOK#F¡9Œ:¨¡:%¿ÇMËÓÊbXv£rÜ|GJ|�oÇü‡ž&G<†Óãæ;ªSò{ÜŒù&m!¡»ÒeˆÇáÙ~pô§ôèñÕz<«»U–Bé÷³€r ‹ãxÜ Õ ñ}nZ|]š`ƒpL`ô±ib—ê+Æ4OmOÒÞªÌ5Ks[öL†‡E¯�dv³�â¨i( -l›Þ¨Rå«z€׳ÅÇЈ°ÿ÷íl¾¼~?[´âTß,–ô³·!Ä_În/?ÎgÖü�µ=wg›SãïÛäéi•d™Ú® =ὪQ-ªÓ€@0£0eò¨vE"€þ†Ôóm‘®»cï­ÃÍÚg¯’Ò0‡ÎÓ.�b=í™™¼Ë L<{*€ûÈ‘ÔóO_KJQ¨Ut|ÌdÑÉð €Üˆ¥N+HViúþç�Ú¹%æb§,¸Û \vX0p»O3´cÏâ9Í2%ÇünójW…êzbˆrj¢*C§ó:UëãAƒS«5´ÕHÐ`„eügbþ˜è�ù} 1¿!;óG´Çüò{ÜÆ1ÿPè˜B|�ïÙ˜?n~ƒù'ä÷¸�‰ùçú¡Áüzôøž‹ù£nØcþ¸ø>·WÁ|�ÿæóWÂü›ùÍbvù:¨�†>1D†<�=ý®,Âÿõõ©þ‚ÃÂÞi€"»hV mÕ;•«2©œQ.2¹›+ý¦»³„Ú+¾ ì‚ÚPQŒí ¶ÑhïêHM�ð¡Ç.‹_/÷ª÷D6䟃͙žendstream -endobj -2879 0 obj << -/Type /Page -/Contents 2880 0 R -/Resources 2878 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2809 0 R -/Annots [ 2882 0 R 2883 0 R 2884 0 R 2885 0 R 2887 0 R 2888 0 R 2889 0 R ] ->> endobj -2882 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [277.7877 706.007 338.4298 716.9109] -/Subtype /Link -/A << /S /GoTo /D (a00160_ge4dcbbe6c641d2e3b8537b479df5fc99) >> ->> endobj -2883 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 619.5604 139.3246 641.8119] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2884 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.3134 619.5604 175.4788 641.8119] -/Subtype /Link -/A << /S /GoTo /D (a00047) >> ->> endobj -2885 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [195.3443 619.5604 242.985 641.8119] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -2887 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 424.9723 139.3246 447.2237] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -2888 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.3134 424.9723 175.4788 447.2237] -/Subtype /Link -/A << /S /GoTo /D (a00047) >> ->> endobj -2889 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [195.3443 424.9723 242.985 447.2237] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -2881 0 obj << -/D [2879 0 R /XYZ 90 757.9346 null] ->> endobj -2855 0 obj << -/D [2879 0 R /XYZ 316.2991 559.1605 null] ->> endobj -2886 0 obj << -/D [2879 0 R /XYZ 90 542.4334 null] ->> endobj -2878 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2892 0 obj << -/Length 2408 -/Filter /FlateDecode ->> -stream -xÚ­ZMsã6½ûW¨j/rUŒÅ' ä¸Ojfk6Ù±o™”‹–hK»å%©ŒýïÓ $H€®Mù`Š|ì×è×h€È -ÃY)¼ÊEŽãÙjs¼Â«g¸ýó1�oàù�øÇýÕß?RµRHe4[Ý?u2‚%tu¿ýmM°¼¾¡ð^Ÿ?ý -—¯ ÂýÅ—Óö|(ûë§ÍùXVmÑîOÕõï÷Ÿ¯nï±ñK°ŒhÚÿ]ýö;^mÁ¿ÏW1%Åê;üÀˆ(EWÇ+N™ýq¸º»ú·³Ó?è^˜jž lº}„#¸Cm)´7ïÛ—! -�!ãõÝ—{ÓÀÛ›c±?ô×MYmËZ7¨·D�¢³±Ô†¨¼XBÄØúP¶`¡ÜšØ”ͦ޿ØÈ€!æ…\ÛÑþ©ÞÎý"Ê„Xßí�/‡îš¯¿tþè»÷×L¬ë¢jžÀ«îÙ¯õ©=mNæù7,°n ü'ý�¢éqÛòÆ´ÒNéÛ�oýí¯’Ô@÷Mÿ¿ÝÞ¦-ªmQ›W¾_¼.Þú§'�í«gÃUmu u›úH‘®M­q¸Ã鈔^„!(ÝÿŽT_|ªÚ²®Ê9S9Ê(ç&<ÚI*غ1ñ¡‚®Ëk"Ö¯…½ÁÖݳK>ö÷Ì‹{°¢nûW s·0¨À”n¨îN×TÇ »ÙžF<ýÏ£EÓ¿²76u×!„¬°T£(õÊ÷þA„m§êYú$4Á:·a¯)tOó`W3ÕÉÜy,Kâ¾mÐúf¯Ûò‡þYÞ YÙ´åͤ:cˆQ¥:G?Bj7}\ä -’Ï×Ð÷M¿#œ!Î$¿ØÑdß(c.‚uÇ,ÎèP)^( -gÙˆ: è0ffÐÉ©3ëGõ³Á|õ}°ø”�]íCsl_Ð.ðAdP¿d¢õ\!I2¦]@Jîƒ&B•#òFdü€+ë¥À+ ^f¼ó -Ε\9˜öòR8we¡‹ewmâ†Bùz6!8üÏYÜ5ã™NG%Õ|nq -@ÉS¹eaéÜò Ær+ÎërkÀ›È­ó’ÜŠûØu¹µ™Ê-Nq¢õ�[TÈw畈äy*µ j˜Y¥.q—ªŒG~>Å }(‘d¡‡ÚÍ.eÒŒK†¤”ý°ö¡h‹Þ›»¶>oÚs}Mäz²4ÂìZ%òÙôõ‘ôu°dúF/é›àµé;àmºÖ†é«`†Çäˆ9’¾Ÿò!°kÓ÷¦'mØ�$Àà…D,j‚=RRr!{ÑÍ4jRe�HŒñy•=@Le K«côTŽó:•}Þ¿Ù c@Î3”ÓœŒÈç…¶ø”�][n¿~}øåŸcG(�xå‚Ä£àP zèøp y0 Çs•…)†§Ë -‹Ž”>‹Ò¼·u}Ía–mFÓê||´#k»+ÌÌ®Ù?W{-Ri§ŽvêWÝ”C›LÓ£¥’é!ùKFc–Ø#½O'ºƒ%Ý7Iô¯Môo4ÑáM>"�&z‡O¹Øu‰~wû¯Ašc†2Ni<• ­õ3�Û“þ>át½Ù˜‹§út4—Íùñ?å¦5¿ŽÍsÿ�I™2¥>QÞoÄÞoëCYé×�áÎxX_á#Q†é|Úy€XÚYX:íbŒ^ÚÅy]Úù¼éú:$_P_nvµŸî~y¨�¹@C�À¢RÌyåB�€_q1%2ã€!l^dÙÂÒ"Ç=‘ã¼NdŸw�Èò%"ÇÝìZ‘7õ”Ⱦéãí7 ¯–XªQóAâí”Ä”†ÎÏ“|@Lb KKcô$Žó:‰}ÞÈ—Hw#°k%~)ëý)8�i%”'‚`Q)v%PŽÙˆ¿ÒrJh‚ÃļÐ &´…¥…Ž1zBÇy�Ð>ï¡äK„Ž»صBÓ°+S”3Åí·¨1ôy(Ó#büÊè„ÆTIÀDv|@DcKje¼hœàµxÓÉhœp#°k5f³ÇÛï4N[�Ä 1›ÒXêq;²|áb[XZ㣧qœ×iìó.Ðx@¾Dã¸�]«1Ÿ×8Úþ‹Æqb§±O ó)�s=pgóßt> ¦±…¥5Ž1zÇy�Æ>ï�äK4Ž»ص‹y�£í¿h'vûÄ ±˜Úɹ‘Ýmèô“´�çj£W¦V´(Qˆ(>?€û€XRXX:)bŒ^RÄy]Rø¼èEäÓ>œ Á”U"FÜ‘•KƒOyØu+—ÛÓDjæe,§‰XTŠ\Dh®F¡‡oìs¥×�ìæôfW˜%¢²®OõÔ—·]!¢’³…‹é>:²èå`Ú½ŸŠÃá±Øh�þÛ;õd’s¼ôe7K7ð†mÊ÷�Ýè,ªp—´­õfTQ5Ç}Ó8‹ÖN'Hl³ -Bˆ(O-ø-\Ó«Ï”‹Ô'¬ƒ%{�o0Òk¼¶× x“½fȽ ×$¼ìº^³¯öíT5Bå‰XTŠª)t‘qèá– ÃÌÒÉa¦Ì³ùOZ“ÜÂÒ’Ç=Éã¼NrŸ7-ù€{‰äq/»NòâåEwñp“G"ÌI–ˆ‚E¥øF‚Q6ŠþÕÌ�y>?<ú€˜ê–V=Æè©çuªû¼iÕÜKT�{ØuªoN•ž¾=Ÿëp”T’úX<•òA)Ĥ¢#@ùn\ìfP„ûËçæR,³‘Ï&ŽtA»$¼Õc»SÓVűü¡iü0�Œg)NÉãÌ`š²îOñDnÂaìÙÂ�ÛGGnë6/^ÊM·µyŽÀ—-|íªÝÂ*ìy&›øÐ sUªOìý%C/%`L&‡^ K÷HÏ`¬GÆy]�ôy½™åk›‘ãÑ�K:rb¾kxÊ›±ÕËŽ{YmÃmX�&y<•ঠ$£jDï‘™Ââ=²ß£¢j=c‘¨<{‡Å~³+bªÆ2mǶ»fó69C‚�w8éí¾Í[±,O4»m¼QJpž#œé"½,/>‘¡Ý®›�ì!˜òL¡> endobj -2896 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 575.9645 157.9746 586.8684] -/Subtype /Link -/A << /S /GoTo /D (a00105) >> ->> endobj -2897 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 539.0153 157.4166 549.9192] -/Subtype /Link -/A << /S /GoTo /D (a00104) >> ->> endobj -2899 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 459.0226 183.1495 468.8008] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -2902 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 404.9565 217.4713 414.8842] -/Subtype /Link -/A << /S /GoTo /D (a00161_g029256bc17a12e1e86781887e11c0c7d) >> ->> endobj -2904 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.6302 367.0311 204.6385 377.935] -/Subtype /Link -/A << /S /GoTo /D (a00161_gcff75c8c930abd6ff168e85373a4eb92) >> ->> endobj -2906 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 344.0533 176.5052 353.981] -/Subtype /Link -/A << /S /GoTo /D (a00161_g3212e70c55244608ac16316888c354f0) >> ->> endobj -2908 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 332.0544 176.4952 341.9821] -/Subtype /Link -/A << /S /GoTo /D (a00161_g6cda47c85ce1b58b501b44ac9cccc50e) >> ->> endobj -2910 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 319.0793 194.2087 329.9832] -/Subtype /Link -/A << /S /GoTo /D (a00161_gf7dd2757d1e766f65b01ba7c91c660a0) >> ->> endobj -2912 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 308.0567 173.7357 317.9843] -/Subtype /Link -/A << /S /GoTo /D (a00161_g34b924954ba5707d536df28d71a80d39) >> ->> endobj -2914 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 296.0578 173.7357 305.9855] -/Subtype /Link -/A << /S /GoTo /D (a00161_g9e97c58fe35f750ad192774be9408ac8) >> ->> endobj -2916 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 284.0589 173.7357 293.9866] -/Subtype /Link -/A << /S /GoTo /D (a00161_g28cf9765e4b57451af559ab988ad7160) >> ->> endobj -2918 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 272.06 173.7357 281.9877] -/Subtype /Link -/A << /S /GoTo /D (a00161_g17ccd786400fd08b941e11046df1668f) >> ->> endobj -2920 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 216.0414 179.6335 226.9453] -/Subtype /Link -/A << /S /GoTo /D (a00161_gb1fc692a2700b7a51517724364683f67) >> ->> endobj -2922 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 179.0922 173.556 189.9961] -/Subtype /Link -/A << /S /GoTo /D (a00161_g64807ba7c221ddf735572d05021539f2) >> ->> endobj -2924 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 167.0933 189.0379 177.9973] -/Subtype /Link -/A << /S /GoTo /D (a00161_gbc331f73107958428bf1c392ba19b6f4) >> ->> endobj -2925 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 155.0945 197.8948 165.9984] -/Subtype /Link -/A << /S /GoTo /D (a00161_g37e3103b9591790d484a450525739661) >> ->> endobj -2926 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4857 118.1453 216.0979 129.0492] -/Subtype /Link -/A << /S /GoTo /D (a00161_gf0349a8481565e80f55a751e2b408d6d) >> ->> endobj -2927 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [446.0722 118.1453 470.7595 129.0492] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2893 0 obj << -/D [2891 0 R /XYZ 90 757.9346 null] ->> endobj -1316 0 obj << -/D [2891 0 R /XYZ 90 739.9346 null] ->> endobj -158 0 obj << -/D [2891 0 R /XYZ 90 739.9346 null] ->> endobj -2894 0 obj << -/D [2891 0 R /XYZ 90 719.4886 null] ->> endobj -2895 0 obj << -/D [2891 0 R /XYZ 90 593.9619 null] ->> endobj -2898 0 obj << -/D [2891 0 R /XYZ 90 477.02 null] ->> endobj -2900 0 obj << -/D [2891 0 R /XYZ 90 421.9777 null] ->> endobj -2901 0 obj << -/D [2891 0 R /XYZ 90 421.9777 null] ->> endobj -2903 0 obj << -/D [2891 0 R /XYZ 90 385.1719 null] ->> endobj -2905 0 obj << -/D [2891 0 R /XYZ 90 361.2178 null] ->> endobj -2907 0 obj << -/D [2891 0 R /XYZ 90 348.0384 null] ->> endobj -2909 0 obj << -/D [2891 0 R /XYZ 90 336.0395 null] ->> endobj -2911 0 obj << -/D [2891 0 R /XYZ 90 323.0643 null] ->> endobj -2913 0 obj << -/D [2891 0 R /XYZ 90 312.0417 null] ->> endobj -2915 0 obj << -/D [2891 0 R /XYZ 90 300.0428 null] ->> endobj -2917 0 obj << -/D [2891 0 R /XYZ 90 288.044 null] ->> endobj -2919 0 obj << -/D [2891 0 R /XYZ 90 234.0388 null] ->> endobj -2921 0 obj << -/D [2891 0 R /XYZ 90 197.233 null] ->> endobj -2923 0 obj << -/D [2891 0 R /XYZ 90 183.0773 null] ->> endobj -2890 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2933 0 obj << -/Length 1783 -/Filter /FlateDecode ->> -stream -xÚµYMsÛ6½ëWè(ÍD(¾IøÖ:Nš¤I\[=%MÑ[‰TIª‰ÿ}"@EÆÎd|0E>âí¾v ™bø#S…§��b\NãÝO×pûõ„˜Ç x¾h~[N~yEÕT!%©œ.Ž#H‚%tº\}šIDñ|AžÝ¾_^×WW‹]”nëë2ÉVI×J 5#XÍ¿,ßN®– §1I0I4ã¿“O_ðt¦½�`ÄT(¦_áFD):ÝM8eöÇvr;ù³§~p|¡Ï3AX¿k„ %µ¾Qp58¹†è|A0ƳW‡,®Ò<«½z™Ç‡]’UÑñxÔQ d¤1®Ú#!bÆúoNð,OWF¡]µ¿‹óì3Æt}(æ$œ%õ“ÏXàx5á-"$b‚À¤ à]V£À“*@|©!ÛM^VY´KzÌåIª„A¾¨Ù+}v*�äì äeRÀpb–=ì TÀeØŒ&ˆ±hA%Jd`•%Gôí>‰S­\¬‡¬-�²îŒlñ„ߊ‚4¥ @ -Î�ƒ/7iYÜèÛ»‡21ÃTyýÿFÂj“tmÙå«ÃÖÜýšV›'ÛÜŒÙDôø+èyŒºË-“0˜‚¬óþµb1‹ÈÏ¡Bx‰…p�ë™~­'MT€QUR”]v‚) -%}ôž سÙg( L4cz³Ý±@@’àlЋñýgΈÑÖPõ”ù¾ØÞ\é$�\‡yØoæIŸlH ó—¤ÃÎ(â³v‹òÙ]™$N¤Ëþkíý>O³ÊNp»ˆ¢ú_Ü?VF®¨("³¸‹d_$PUª4[wDµšF«@Ê3ÒŸ_aÖ€ûÄ[Í«:A,¸qfA¡dÁѾ¼L4*KO "ªêÿÛ43CQ"]sô+6 è -€âÞt“<$E’ʼnM9éþ.Ýk¡dìõb{œK1Cý5BD”»V ¢çkÐ*ÏZ…ç�•é:³ îT†Ü©(”ÄV‚¤(òÞ Of8ÉðD…(T”»µó2Únï£øŸ¾D\m¬Ò6%Ç€¶6Ý$™›\“VcRQVîÒ²ôÒºÖ¡ 6Xv‡²rgNºÛoÝ X[î;³°]Nn@E)G -ÇÙŒÎC„’áŒÞ�Ïè\º¼'eôú�ŒÕµ£?aY”3·vBïÀé ó È÷ÞMT T¸¬M>Ï»{›'¼”RÛVGþ¡3åN�ò8֙ĴWö®ŽïÝÕÍÍÝÇwçCK`õ2¦FbÛB Ô ¡iŸ®¾Ez¦…u€š#B_ˆëgúN±6�nœ¨›pöXÈzÃnaÇ:uLŽ~�âàÃÒ4¨1fo´V¬û.¯‰�öh—ý¼?f‡7n£ÀƳ!„2¦€E�1{£ifSô”£UôšÂÔIpÇJí÷:ë2¢“ý`u -ÚÕ‰™êÔ*>’×Åçxu]o)ëŸC¤ D‚5¶G‘„ƒ�òïÛ SRà°µ3’áì %¨Û²ð;í¶(Ž{¡rü$Ƈ"ßõp¸¤â'q–‡û¿“¸êë 1‡ägñîÊuŸ«Iœ8{š_Æ �2ÎW[Ú¿h¿à§_\M ò®ò³‹D„Õ1ÁÛ¤”OìS"É ¸1h³MúN.¨B°úÅH«¦‚ã)‰»OìÕm·ÎV5r©jmÔùªF•DB<±eé3` gñ,éoZØ)§8ìDÀ¾ :ÊA÷T�ÿNÞ†´É¹�.kÓµ´Þá]Q‘ÄI:§bæìˆüN§?¤'I%Ì6X_#Ö6lHJ ;%KWJºÄt„Õ¢|ÖŽ” N:¬Ï�òòò¢_Óò¹¢ -¸ XŒ‰Ú‚ ‰jaízà6Õ�FY(Fx-ÊçíôV’² -]ÞgÈÚœ$?KB&¡Ô`6&a 6$¡…uÊ›[H$¤[1Âl@>±«!'ˆ’¹Ä�†Ö‚gJ)$äcÂ4 !YjP«öºÓ -ŠÅŸ�té:ëJ†[-ºFŠ(®ÑÖŸZ;˜WÑ:Ps*5vÒÖ† )aan­uçG€°`#ÄäóvæEXŸX:¼�(À¾¶çÌg¦‡¯Òt!Ì O>ëbì‡Ïº$f¦Ù¯¢*¹¸Ðy -úC©èì÷¥þDòñíþ�¹© ÊÜ�“™}*˜gþúãóòõíÇËwwo>¼YÎ^wƒG³Ž…H³ý²ã›•ö¢µ×1OªüEç˜^ÕÅy–ÞÙu?~hã‚ÞÏqBL¤�?ô]ìøM/„WtcÜê¡$tp,´Ÿ½ŒÚß×I–QsreãüÞ^¼ÕÅì`~jþã Ê.ì§@б9î|ÐåÏu4‡Þaw×ø2ÿö¸ö׈þh×£Ïÿ•‰«”endstream -endobj -2932 0 obj << -/Type /Page -/Contents 2933 0 R -/Resources 2931 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2942 0 R -/Annots [ 2938 0 R 2939 0 R 2941 0 R ] ->> endobj -2938 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 413.0808 135.0008 436.0496] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -2939 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.8662 413.0808 183.7077 436.0496] -/Subtype /Link -/A << /S /GoTo /D (a00039) >> ->> endobj -2941 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.345 341.4685 157.1381 352.3576] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -2934 0 obj << -/D [2932 0 R /XYZ 90 757.9346 null] ->> endobj -2935 0 obj << -/D [2932 0 R /XYZ 90 739.9346 null] ->> endobj -2929 0 obj << -/D [2932 0 R /XYZ 90 723.1038 null] ->> endobj -2936 0 obj << -/D [2932 0 R /XYZ 90 723.1038 null] ->> endobj -2928 0 obj << -/D [2932 0 R /XYZ 206.0041 564.8934 null] ->> endobj -2937 0 obj << -/D [2932 0 R /XYZ 90 548.1663 null] ->> endobj -2930 0 obj << -/D [2932 0 R /XYZ 212.5591 388.6469 null] ->> endobj -2940 0 obj << -/D [2932 0 R /XYZ 90 371.9198 null] ->> endobj -2931 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2945 0 obj << -/Length 2274 -/Filter /FlateDecode ->> -stream -xÚ­›]O$7†ïù­ä¦‘Çß¹X‰˜,#ÈÐQ.²b¡g‰šÝÌ¿ÏqUÙm—ÝÇN6i¦ÞöûÖyŽ�ÝT±…?láèÂ(Cœ�zqóe�.>Áÿ°Ç¦oÀ÷RÁ?V{ß½ånáˆÓ\/V‡4#Š3¾XÝþ²dŒîpx]¾ž\ÀKE—ŒÐñÅûÇÛ×ûõøúèñæõËúas½¹{|Øÿuõnïx�§\Jhæmÿ³÷˯tq ùÞíQ"œU‹ÿÁ”0çøâËžä"|q¿w¹÷cgüÆð†Úå)&ê×Ç$�ÿáá9\¯¯OÎö¥t¹Úw|¹¾XoÆ+zY?ï3ºü¯ÿ ^Â%�c1â”Æ‚jú¡¸ÝŽEÂhGëÍõÝýúvªÎúåæùî)ÔIÑý8>¡ÇY}žj+¾ÉcA$å#)µ$;r A,§nï-äx© ÑÌÍÔîVIc)ÓÔŒj"…•Ûq¼Ù¿8Ws/F}•”À£ªå 4ÕzæK)‡^œ; è#îæÎþ[ÏŸ&͇4Cз2ãú #¦[ò¹ˆ¡%1 ð¢ð3DA_À*aRM¥X†0èèM¡Æns*º°�SË!'ô'5Î.¢Ìç¼ü¼¾¿ßv“ïsÆÆVʱ�ÊI˜kšò0N””jgO) «‹�>Å{*Êš=•ˆôTÃ7ôTî‹÷TîÜÑS� ŸiOÝÔzŠiX¦Ñ(Mœ_GÿPO)m–7z*ÊþLOA0Dü5=%\œ´­ž -²vO%b=…ûÆžÊ|=•9÷ôž¡×gxñ¬*«0‘œ6._:•¡£XgKqh gL«¥‚lh©»/Oa{1DþÛøúóúúúkx=•“)¤Õ˜õmjÿšVƒuT:)Z­díVKÄZ ÷�­–ù6Z-sîi5=>›'â–3ß%h9¢ª‘ƒN`¹SyIkÀaiäN¹ÝÀ<ÈÚÀ1Ç8î�§¾À3óàxŒbÜøÙOï=óË’8¬ 2­\�ø¤já–îÃå9˜®—œÅ�ž0àAÖŽ9&Àqß<õíž™÷Çcãú?�\\^\¼9<=-0Ã�Jfñ*DUÞ[>«~øarýôts Ç¢ -tØ-qª‘Yž0èAÖ†Ž9&Ðqß=õ퀞™÷@Çcãú'—çWE±™QDQ몖³1þ@=+ý�^× Ã©Bû]îNȉƒdmȘc÷��SßÈ™ydøíØùû‹6ç„iañRDU#ç’h%Užá›ìa€átÆ’w N¬Ô¬¼úï•{ÞáÇ4Ѩø¦vû�ÿMŒ‘TO·³³±Í÷�\~}Zß®?Öî—q°�¤rwÃ%ßGú-¨ší†Ùm» 7 Í–šnÆ+,;ÍnTn‹ôÙ¨nøÏÆlß å Ñ!Ïa… ž?ž�SÓ ?ñ££,Íøz÷tµ¹yò¿db^mÊ;:Ž[œ’�DÎÓ�ƒsôÌeþ¯§W†þ³ð&Dzg˜&ÎÀD¦ ¼Ñ?¨bükÆ»õX?¬Ÿáú¦GIÂÃ7Ó‹wþî××é Æ§é÷\|ϧu ~z|õqŸ«åãóìù’øDÏ¿¿†§y~ûúi]<Çã° Ñ’*ý¥Øìòendstream -endobj -2944 0 obj << -/Type /Page -/Contents 2945 0 R -/Resources 2943 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2942 0 R -/Annots [ 2949 0 R 2950 0 R 2951 0 R 2952 0 R 2954 0 R 2957 0 R 2959 0 R 2961 0 R 2963 0 R 2965 0 R 2967 0 R 2969 0 R 2971 0 R 2973 0 R 2975 0 R 2977 0 R 2979 0 R 2981 0 R 2983 0 R 2985 0 R 2987 0 R 2989 0 R 2991 0 R 2994 0 R 2995 0 R ] ->> endobj -2949 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 618.5198 165.7154 627.3665] -/Subtype /Link -/A << /S /GoTo /D (a00109) >> ->> endobj -2950 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 580.4794 165.1575 589.326] -/Subtype /Link -/A << /S /GoTo /D (a00108) >> ->> endobj -2951 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 542.439 157.4166 551.2856] -/Subtype /Link -/A << /S /GoTo /D (a00107) >> ->> endobj -2952 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 504.3985 156.8586 513.2452] -/Subtype /Link -/A << /S /GoTo /D (a00106) >> ->> endobj -2954 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 421.7425 190.8904 431.6702] -/Subtype /Link -/A << /S /GoTo /D (a00086) >> ->> endobj -2957 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 365.6635 271.1301 375.5912] -/Subtype /Link -/A << /S /GoTo /D (a00162_g26440a35353cb457747a4cea372c62e9) >> ->> endobj -2959 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 353.119 280.5446 363.0467] -/Subtype /Link -/A << /S /GoTo /D (a00162_g30fe27cba3c14ae7f9a7f118144af43a) >> ->> endobj -2961 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 339.5983 213.038 350.5022] -/Subtype /Link -/A << /S /GoTo /D (a00162_ge28f6cb60e86088d8886d0f804b4f37c) >> ->> endobj -2963 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 328.03 176.5052 337.9577] -/Subtype /Link -/A << /S /GoTo /D (a00162_g3212e70c55244608ac16316888c354f0) >> ->> endobj -2965 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 315.4855 176.4952 325.4132] -/Subtype /Link -/A << /S /GoTo /D (a00162_g6cda47c85ce1b58b501b44ac9cccc50e) >> ->> endobj -2967 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 302.941 224.8339 312.8687] -/Subtype /Link -/A << /S /GoTo /D (a00162_ge429c985be88ed048f382511c9ff00de) >> ->> endobj -2969 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 290.3965 198.4231 300.3242] -/Subtype /Link -/A << /S /GoTo /D (a00162_g19709735f29dafeabb91e0882231f9f1) >> ->> endobj -2971 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 277.8521 206.5625 287.7797] -/Subtype /Link -/A << /S /GoTo /D (a00162_g7e904ab59f7ee134cf3218a8219e7e29) >> ->> endobj -2973 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 265.3075 211.4442 275.2352] -/Subtype /Link -/A << /S /GoTo /D (a00162_g5025948dd998f65a13a375a37aa5edf5) >> ->> endobj -2975 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 252.763 196.052 262.6907] -/Subtype /Link -/A << /S /GoTo /D (a00162_gbfc1d8d15852318927cda30e1bc0470a) >> ->> endobj -2977 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 240.2185 209.3322 250.1462] -/Subtype /Link -/A << /S /GoTo /D (a00162_gaaaaf66ea67900c36d01136d5bad1168) >> ->> endobj -2979 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 227.6741 213.2175 237.6017] -/Subtype /Link -/A << /S /GoTo /D (a00162_g57aca709a33690cd4fb73fe199fa1bdd) >> ->> endobj -2981 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 215.1295 207.0906 225.0572] -/Subtype /Link -/A << /S /GoTo /D (a00162_g8b600918f84783490fd791ce773175ab) >> ->> endobj -2983 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 202.585 215.23 212.5127] -/Subtype /Link -/A << /S /GoTo /D (a00162_g6b2d00412304e2d95e7b853cce5858b0) >> ->> endobj -2985 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 190.0406 220.1117 199.9682] -/Subtype /Link -/A << /S /GoTo /D (a00162_g3318dec654781e9d6d8ec873636660c6) >> ->> endobj -2987 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 177.496 204.7195 187.4237] -/Subtype /Link -/A << /S /GoTo /D (a00162_gf784a76fe619452eddf87e6376a4bf9d) >> ->> endobj -2989 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 164.9515 217.9996 174.8792] -/Subtype /Link -/A << /S /GoTo /D (a00162_g3a4852e2372e34e1c0142d1147fbe027) >> ->> endobj -2991 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 152.4071 223.1601 162.3347] -/Subtype /Link -/A << /S /GoTo /D (a00162_gaa60ca995565b799bb958c806e933665) >> ->> endobj -2994 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 95.3518 198.6315 106.2557] -/Subtype /Link -/A << /S /GoTo /D (a00086) >> ->> endobj -2995 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.1296 95.3518 276.389 106.2557] -/Subtype /Link -/A << /S /GoTo /D (a00162_g4647b76d0ef50a5305505041f5775a37) >> ->> endobj -2946 0 obj << -/D [2944 0 R /XYZ 90 757.9346 null] ->> endobj -1317 0 obj << -/D [2944 0 R /XYZ 90 739.9346 null] ->> endobj -162 0 obj << -/D [2944 0 R /XYZ 90 739.9346 null] ->> endobj -2947 0 obj << -/D [2944 0 R /XYZ 90 719.4886 null] ->> endobj -2948 0 obj << -/D [2944 0 R /XYZ 90 635.0055 null] ->> endobj -2953 0 obj << -/D [2944 0 R /XYZ 90 439.3093 null] ->> endobj -2955 0 obj << -/D [2944 0 R /XYZ 90 383.2303 null] ->> endobj -2956 0 obj << -/D [2944 0 R /XYZ 90 383.2303 null] ->> endobj -2958 0 obj << -/D [2944 0 R /XYZ 90 369.6486 null] ->> endobj -2960 0 obj << -/D [2944 0 R /XYZ 90 357.1041 null] ->> endobj -2962 0 obj << -/D [2944 0 R /XYZ 90 343.5833 null] ->> endobj -2964 0 obj << -/D [2944 0 R /XYZ 90 332.0151 null] ->> endobj -2966 0 obj << -/D [2944 0 R /XYZ 90 319.4706 null] ->> endobj -2968 0 obj << -/D [2944 0 R /XYZ 90 306.9261 null] ->> endobj -2970 0 obj << -/D [2944 0 R /XYZ 90 294.3816 null] ->> endobj -2972 0 obj << -/D [2944 0 R /XYZ 90 281.8371 null] ->> endobj -2974 0 obj << -/D [2944 0 R /XYZ 90 269.2926 null] ->> endobj -2976 0 obj << -/D [2944 0 R /XYZ 90 256.7481 null] ->> endobj -2978 0 obj << -/D [2944 0 R /XYZ 90 244.2036 null] ->> endobj -2980 0 obj << -/D [2944 0 R /XYZ 90 231.6591 null] ->> endobj -2982 0 obj << -/D [2944 0 R /XYZ 90 219.1146 null] ->> endobj -2984 0 obj << -/D [2944 0 R /XYZ 90 206.5701 null] ->> endobj -2986 0 obj << -/D [2944 0 R /XYZ 90 194.0256 null] ->> endobj -2988 0 obj << -/D [2944 0 R /XYZ 90 181.4811 null] ->> endobj -2990 0 obj << -/D [2944 0 R /XYZ 90 168.9366 null] ->> endobj -2992 0 obj << -/D [2944 0 R /XYZ 90 111.6113 null] ->> endobj -2993 0 obj << -/D [2944 0 R /XYZ 90 111.6113 null] ->> endobj -2943 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F11 705 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -2998 0 obj << -/Length 1852 -/Filter /FlateDecode ->> -stream -xÚ­ZÛŽÛ6}÷WøÑº ‡wå±Í¥ Rt“¸OI(^íÚ¨-o|é&ýú%R¦.&µè"@Ö–Žf†3g/2L)þƒiF§Zj’q¡¦Ëí„Nïðòë ¸ÛWxÿ*üº˜<{ŲiF2ÅÔtq[YP@$6]Ü|š)Â`~Å$�-æ››²8ÖßÅ~tö�ý?~Y¼� -j• -}ÙGÀ^�¼\4¸ø$W`ÝŸ|úB§7çÛ %<3rú€_(�,cÓíD0î¿l&'ï;õ�ê�¡aJàÃã ™”Ì”á¸u=ÎW§ry\ïÊÃPÈT# ¿œÒP»âAJ�*"¸g;ÖágÆd×P|ŠI÷Ø R~A�Œ*ÕöûÏœÑÙn}ÓóÍ ;¾í­ý�Ã|£ðøT=»6ŠcE¤›¯ùýý2ßlzÁd’hÃD"• -!3„i�PI}2ðóW:ÀÊÁŇ€HáX²ðQ�çÂ'üú·ü& ßö=¢ð‰(zvm‡U±Ù|ý~Z{qh�ZÃU"•ò®ÑT°Nî±æËU^©Õ³W ‚CiàÚi×gJy jYÅ|Êcú¤d(ôj€P.[ò4PÏ|¢«¡H:5èT‰j((STgælÔzoSX ñqU8E¶¹%CÒÍ(ÉEŒ ì2ñQ\•�/A|K?0#~ÜoCüÐošø-ßcˆ�¢g÷Lüûýn{ß§¾ÑDdH¾x<*åßàg#ºÙ -ês‡©‡mÁ Sht\èXx˜�áz¿.]äõŸûý\ÈY•àº1vC R|X—7»‡¹³Ë ÃáT˜G4Ld¦€Œ˜LèTÃxXºaƒ±†‰ûm&ô›n˜–ï1 �¢g÷Ü0»Óñþ4Ð0‚ Â³D<*åß(Û'Y'ûOÙ0‡ã~©™wÁ&ψT ~¤MmAŠ3_ÆFvàk@‡î? h]Þ=IïÉLà.�Óôž4ŒK­Î=*Ùy�¹HãÅ�ú¾ �&Û®åxD×ÅCèZ —åër`}fpÇE©Š�߃Îñ¦Îp‹ÙJzzA.UF40s¹Ô VkK;æ1¨vÜoSîÐoºÞ-ßc -�¢g÷,³ƒ׌P -&‘�JyÇ…;JG7÷‰š7z %á�ée1 Ñ5k`6’7˜�u¾Yÿ[V)¸8å~Ë—6Ì¿¯Šòæ2—‘`RgO³C8ƒƒÊR;Ä–ärh0Âå„_Ïå–ß$—Û¾Gp9EÏn¨ÄCë]�ÈD–H‚G¥Ü ÊÈŽûäzׂҠ˜¨Ùô[¾Ù.€‡UQ^–¦Ûý®q‘ÌD]7'’ eBŠjàr(¶.;\ ¶dÙ QÑe7š�•rÞ³f�×ôÂIÑÙ`œL^uïE�bÄ,;=ò¦Ì¥c€®?ìn=ÿ)Û´¼ìP¸6þ¡¸-öE¹ôdúæhn’l/Ù"Ã=ŠkMµ -{”E{ÔjÓ¤Ô¸¶¼è ÊœQš\Õ´Ôx FA‰ :'Ú�ºà®NöEK¨ -×ûÑÒÚU‡áV†ÙúY°õ•e #u`@E`öú¯7õµgÓ~S‰Ù–ö-eíe•—AÔ`C�ìJQõ}•|…‹ µÉàeeUÓ 0‚ÝisÓ ±Òú:;^ŒœžõH4¼H^ yy͉–ÔÄ5(D]Ö [SMkj^[.æû|[à #B4ä`6tè~ -‚6RÓÀ:Tm �!À@ÅSРrÐÉq¶“sèzáKâchM!½z^®ÇU€ä‰"�A‘IŠë ÷î*=OD?zšèÅ78KxÔ¸I"–˜ó÷ܵ58CbŒ£ö¨‚ÓÇ΢=C8¹øøûËwï¾^˜ :ûó�ë…=ât§¾ ŸÂ÷@­Ù£û£ ôàÏ8(&”Tÿë'Õ&ÍžÖg! É4.õÝ/$\v°¯‹²ØçG/d>�øo­ÄžÜ`î/}ÎøsæòË(UNöç WænéuzsíЄ¶UòÅîÇÏ»¢ì¦Çž· äç?⡽Eendstream -endobj -2997 0 obj << -/Type /Page -/Contents 2998 0 R -/Resources 2996 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2942 0 R -/Annots [ 3002 0 R 3004 0 R 3005 0 R 3006 0 R 3008 0 R 3009 0 R 3010 0 R 3011 0 R 3015 0 R 3018 0 R ] ->> endobj -3002 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 704.6952 196.7787 715.5991] -/Subtype /Link -/A << /S /GoTo /D (a00162_g52c3c5ab1b1aa0659b5e465f7fbcc409) >> ->> endobj -3004 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 692.285 175.2098 703.189] -/Subtype /Link -/A << /S /GoTo /D (a00162_g984c4a8b65a3cb35460b073a40568c25) >> ->> endobj -3005 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 654.5133 188.49 665.4173] -/Subtype /Link -/A << /S /GoTo /D (a00162_g123c95a7bb55143cabba92446ce8f513) >> ->> endobj -3006 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 616.7416 185.1725 627.6455] -/Subtype /Link -/A << /S /GoTo /D (a00162_gf11c966b0e4f4ecaa73deb14bfb6830f) >> ->> endobj -3008 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 579.3435 181.2968 589.8738] -/Subtype /Link -/A << /S /GoTo /D (a00162_g82ff99d50221f7c17df57dc6092ffc97) >> ->> endobj -3009 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 566.9333 172.998 577.4637] -/Subtype /Link -/A << /S /GoTo /D (a00162_g69b075ef7e4d7bcf5a903d3d75baac02) >> ->> endobj -3010 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 529.1616 176.8634 539.692] -/Subtype /Link -/A << /S /GoTo /D (a00162_gd1f18f739da7703628c3663209463a0d) >> ->> endobj -3011 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 491.0163 180.1912 501.9203] -/Subtype /Link -/A << /S /GoTo /D (a00162_g86beee1f69d05b16022dfb430470e9ce) >> ->> endobj -3015 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 334.2427 142.7416 355.1542] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -3018 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 137.7572 142.7416 158.6686] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -2999 0 obj << -/D [2997 0 R /XYZ 90 757.9346 null] ->> endobj -3000 0 obj << -/D [2997 0 R /XYZ 90 723.1038 null] ->> endobj -3001 0 obj << -/D [2997 0 R /XYZ 90 723.1038 null] ->> endobj -3003 0 obj << -/D [2997 0 R /XYZ 90 708.6802 null] ->> endobj -3007 0 obj << -/D [2997 0 R /XYZ 90 597.5219 null] ->> endobj -3012 0 obj << -/D [2997 0 R /XYZ 90 454.7247 null] ->> endobj -3013 0 obj << -/D [2997 0 R /XYZ 90 428.2397 null] ->> endobj -3014 0 obj << -/D [2997 0 R /XYZ 90 428.2397 null] ->> endobj -3016 0 obj << -/D [2997 0 R /XYZ 204.8181 294.2849 null] ->> endobj -3017 0 obj << -/D [2997 0 R /XYZ 90 278.0449 null] ->> endobj -3019 0 obj << -/D [2997 0 R /XYZ 295.0094 96.348 null] ->> endobj -2996 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F50 1172 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3024 0 obj << -/Length 1356 -/Filter /FlateDecode ->> -stream -xÚµXKsâ8¾ó+|4U‹¢ÖÃ�wB²I‘Ç&Ìif*e@jÀf�ÙLþýH–ll,RÉTÈr»¿îVÝ�ƒå8!v|î£�2Ï™®{Øy‘ÛW=0¯òý *ð÷¸wvIB'D¡GÍ[±b€ <Ò]¬ªRíÅŠÉ‚K°wuj›§a‰½ã”bõ$«Y@}„9…î”R–Ô+A˜Ê©!—]ÇvjQ9l1k="êäpd–ªJµ•õÒ£>œØOº ßÝOšZûI)vZ?éŒÎ¾ŸohûŒ~ô³úÉìËXÎ2EÇ8ÄøPSáM%W¹ï'…HK�Çõúþ´ÿ¸«¤Z#ûÅü“f­Ëó4‰³}5~]ˆ¸V{åÉæõ±è¹WL&#ì+¶U©v&�‡˜b{œÉ]ÐïfrÓB+“K±Ó˜Ü�=“�€7´Y™ÌÇhHÚ©œ'BƒÈÔJäêåÑéžþŽFÏ�jj¼¿}÷}æÚù¨›I��­ä0Õõ)<ËÿïÕû5‡Ws€€ùÖC,÷>tk—_;ò µT—#¤Ou–”È™<ÂÂåÙ•ˆEe…cř݋uY³‹‹s3¿øœÐsb.(ejx†ðŠÏIj¶ÆMfµ‹ä×Û‹hÜ_ª‹EK”~/² ]endstream -endobj -3023 0 obj << -/Type /Page -/Contents 3024 0 R -/Resources 3022 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2942 0 R -/Annots [ 3027 0 R 3029 0 R 3031 0 R ] ->> endobj -3027 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 583.7986 142.7416 604.7101] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -3029 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 371.5861 142.7416 392.4976] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -3031 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 198.9704 142.7416 219.8819] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -3025 0 obj << -/D [3023 0 R /XYZ 90 757.9346 null] ->> endobj -3026 0 obj << -/D [3023 0 R /XYZ 90 739.9346 null] ->> endobj -3020 0 obj << -/D [3023 0 R /XYZ 200.3847 522.0587 null] ->> endobj -3028 0 obj << -/D [3023 0 R /XYZ 90 505.3316 null] ->> endobj -3021 0 obj << -/D [3023 0 R /XYZ 273.161 309.8462 null] ->> endobj -3030 0 obj << -/D [3023 0 R /XYZ 90 293.119 null] ->> endobj -3022 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F52 1229 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3034 0 obj << -/Length 1133 -/Filter /FlateDecode ->> -stream -xÚÍXK�Û6¾ûWèÅj†3|ˆÌmÛm‹Ø6Î) ®­Ý5êµ\[î&ÿ¾C‰¢õ2µE/…/zŒæûfæ›!MH8ý ±N~ ~ªåCÑ)Ãá�dôëø�ÂM›áç‘ø*À¬R¥ Ê¡ó€æì‚�wr�ËÍ6[Wn®³ãê°Ù›|ç‰Fª�GÌV~®ªoŽOËí¶ºÌf ¦ß–Oûmæß=æ3TÓçÍî¡zàï«›"÷ä›Â°Üï·›ÕÒ8ú—›â±[– žêD§Ši[kǽ:FÞêãü¾nßË­{zíáòj˜I5­úÉ�Ô=ÅúªUi:ZÏŠO -�­yQàŠúŃq�³Q�7F>‚[ ¼�xùáÐó;$ðÕ�À%O µþ—WZ1.%Ž<˜•+ÒÿP¿J2nH/ ºaöç�OV´DQCCïõ²XV¼>‡Óª8f`¦ƒÃ_Ú”¡p±7š‘Þf£½E<÷ÆnÝ-Ücm¿7h5Ât�#½áíÇ8ôü†Þ¸ ½qw,–E¯]8Ív¥ãÉVDºõ—Z�Þ•­êŸ¹)±.¸¤�§‰Ôûü>Vno5^í\£ØQÐPëèkcYj–b -mäËÅ®ÍG8t½:ŸÞßÞ]ÝÞþ|õáC¿ÀHå�?ű‘âWÛIïÊŒ†ÓÊí·‡¶ƒ€ÞA{;xÚ­ªYÖ‰ ù­Ð˜‹*iDdÌFuE< e·VJ ÷o7�óͺ?È@u°#sÁÛ�±èù)X[8$4š,ñ„«*H«rÙIÈ®x�º†!¤œ©4—Ð0ˆ  6@ ±!€8n@w\-ì— ΢çwH›Ý¦·T!šóñl«H›ü1íTa¼ú)0�éàÿUNþA+ýŸŽ?Jú6—4ÍlJë©?Ýð$ç·Ù.;Ð:ê�#r¿Ÿûµ¾¸q 'þœøk¯‘WwȹökÜQCý×&ìî€yÃ?¾û3�üÛ÷‡l×M�;›ÈÏ?º:€endstream -endobj -3033 0 obj << -/Type /Page -/Contents 3034 0 R -/Resources 3032 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 2942 0 R -/Annots [ 3037 0 R 3039 0 R 3040 0 R 3042 0 R 3045 0 R 3048 0 R 3050 0 R ] ->> endobj -3037 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [318.3113 672.5415 370.5648 683.4455] -/Subtype /Link -/A << /S /GoTo /D (a00158) >> ->> endobj -3039 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 617.7467 184.9831 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00101) >> ->> endobj -3040 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 578.8924 184.4252 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00100) >> ->> endobj -3042 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 495.0563 211.8219 504.984] -/Subtype /Link -/A << /S /GoTo /D (a00078) >> ->> endobj -3045 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 437.2279 213.038 448.1318] -/Subtype /Link -/A << /S /GoTo /D (a00163_ge28f6cb60e86088d8886d0f804b4f37c) >> ->> endobj -3048 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 380.3757 217.7102 391.2796] -/Subtype /Link -/A << /S /GoTo /D (a00163_g03070adbf8faab0f34f87c1270964306) >> ->> endobj -3050 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 367.7979 202.2283 378.3282] -/Subtype /Link -/A << /S /GoTo /D (a00163_gb97849f0d3ea858eee790b69591e6427) >> ->> endobj -3035 0 obj << -/D [3033 0 R /XYZ 90 757.9346 null] ->> endobj -1318 0 obj << -/D [3033 0 R /XYZ 90 739.9346 null] ->> endobj -166 0 obj << -/D [3033 0 R /XYZ 90 739.9346 null] ->> endobj -3036 0 obj << -/D [3033 0 R /XYZ 90 717.1645 null] ->> endobj -3038 0 obj << -/D [3033 0 R /XYZ 90 634.6393 null] ->> endobj -3041 0 obj << -/D [3033 0 R /XYZ 90 513.03 null] ->> endobj -3043 0 obj << -/D [3033 0 R /XYZ 90 456.1778 null] ->> endobj -3044 0 obj << -/D [3033 0 R /XYZ 90 456.1778 null] ->> endobj -3046 0 obj << -/D [3033 0 R /XYZ 90 399.3256 null] ->> endobj -3047 0 obj << -/D [3033 0 R /XYZ 90 399.3256 null] ->> endobj -3049 0 obj << -/D [3033 0 R /XYZ 90 384.3607 null] ->> endobj -3032 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3053 0 obj << -/Length 2297 -/Filter /FlateDecode ->> -stream -xÚ¥Z]sÛº}÷¯ÐL_¤™Å7ˆ¼ùÆJâÔŽ][éíÌÍ�,1±¦²ä+KMÒ_ßIÀ @.Øv2Qæážƒ=K`)‚�(üc#KGFb…Ô£ÅÓ }ƒ?¿?aÍéS8~™�üå·#K¬æz4ûZEÐŒ(Îøh¶üm̘œœr¸†Ž7p¨è˜Z\m—‡uYŸo‡§r³ŸïWÛÍä÷ÙÇ“é,7º”ÐÌÑþqòÛït´}O(¶P£ïð…f-=�H.ü—õÉÝÉßBœúDuA×ðÝãc’À_¸ ‡ñšz|šp19e”Òñ¯­ÆåC=œÅzƒqã¨0b•ª@ -%Öƒ@Xâ¼ÜÏWërÙ¤¤|YìVÏ>!HD™†8\É”ªâÌW/õeå„©ñ�ùÓ³OíËãvÂÕø{s~^|˜ÍnZZ«ãýã¼9òáæ>Î~[.ëp›õvÞ(ýî‡ý<ÿVúë6ÍÉ/”òµÿë×Ýöéèš—r÷/'¹Ü½7N72fˆæRV#»ARéñ®üã°Ú¹@îÛ¼þØžÊ]}¼ýê>Íx1_¯æ‹ÖýzØ,\ -›ëÜ ÜçCY®\ž\ṬW'~6ÀÇñÔT© ½Ÿ°q•!÷å°_­Wÿö‚~±]–o:*XKAlÁe]zî�»oÍÙÛ£{,†Ö5(Ú÷X¸A&k ï—óýü¿.w_¨¢ðŸ a…&WÅ‘œ£;! 2RÒhNПRˉäjh -<GŸÄm'cþ°Ý!U!5¬Ú<•“FëÌ…Ô -.Ñvh.>K·�‹ÓjÂg}¸°Pl±Þ¾ôç‰qNhK¬pÀa=ìœH<ê4†uÜËI4§€t- §Â‡–(fY}·rkL:ë*­‰¤¦·�‰Îw¨¢pR2DqL_8WI2(\Ä•@é(C -݆¥Z·I«E4¡…N‚q{DÛ?¯zxFÀqÔVÍ�ÇD…ÑDèC°ÁkK˜ªZÚ-PG¦ ̥ఒ–P+Dªè¨p¥*ë¢�³Æ£sJ?”ó¥k ^{�¦õØî|�Sv·@$µµÖ¡DSŠ”¸èF3SD¸ö··â Ô &x®ä<,_sQ@¬èpÞPu-ÞLÙµ˜‡Ô®!‰Û®¼EZyŠcž]íÚäÿ²ô(t×Öª\éyXÕªúf²~Š©JËu¥ÿ[ÕI[­£z˜Þž[^gM¨<©L­¬–z­b­ân¿;,ö‡Ý„ãÎ)Tr7§²·¢cRÑ–­h”ñµ¢3¼¾¢[¼/ÕhÓŠ†¥D@óÖfF*ºÁç4$qÛëï TJr{q -ÐŒ*< Õ!áØyQX˜˜Y=?ž—î®ÞtZ-´ ‚RÑku @¬°¬Õ(ã«Õ^ou‹÷OËf¤ ¹ÔÄpÃŽÈûÝöøœŒ$®“ñëô—·—ÓO³û·×ŸÞÝ_�ýãþóíååôSÒÓÖQè›ÑœTFŒ`ͨm‹a”vÙ. ±Æ²~Û#f»‡åmÇ#ÛqÞ`{Ì;ÀöùÛqI\'ãóÅÍýÙÍÍÛ³ËËägÐÁJVàY¨ =‡,(Á�²=ïAÝS½6m}�u@a2aªÿgý€Õ�‡åëcŒêç uó¨ƒù�:Àe$qÑ:ø0=;ŸÞÞ¥?ýÁ3°äOM@e4qˈ¢-‰uXÏ M´•ýí{ @¬°¬õ(ã«õ^o}‹7o}›|€õI\Ôúó‰¤þ[}â¸àiTJšIR@eÔqC‰GâxWF„ý�} ÀŠÀÃòE€1FE€ó†"ˆyA‹|Hà2’¸h¼½¼¾Kf~n$1JK<1•QÄ�!\+]ÎC³@ïïíc漇å�Ç#çqÞà|Ì;ÀùùçqIÜê'ÆÙìæÝå™»×ßߺN—yÎ-)¬ÂSáA š—Ëòk×{6[ÀL"ûõè> endobj -3056 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 641.2029 187.822 651.7332] -/Subtype /Link -/A << /S /GoTo /D (a00164_gc4b119801e50cc1824498a1cdf9adc37) >> ->> endobj -3057 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [191.4287 641.2029 284.16 651.7332] -/Subtype /Link -/A << /S /GoTo /D (a00164_g6b942c1ef22f8cd1a726ef3364c9fbea) >> ->> endobj -3058 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [287.7667 641.2029 375.5365 651.7332] -/Subtype /Link -/A << /S /GoTo /D (a00164_g23705efb9077187881f094fc9be13bde) >> ->> endobj -3059 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.1432 641.2029 461.364 651.7332] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf11d9915ec12a8cdd9fdcbb5e8fcd5c7) >> ->> endobj -3060 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [464.9707 641.2029 513.9963 651.7332] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf8f12c820cc08da32aa62898bfc02db3) >> ->> endobj -3061 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 629.2477 123.0855 639.778] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf8f12c820cc08da32aa62898bfc02db3) >> ->> endobj -3063 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 565.3112 177.3318 574.1579] -/Subtype /Link -/A << /S /GoTo /D (a00111) >> ->> endobj -3064 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 521.7174 176.7738 530.5641] -/Subtype /Link -/A << /S /GoTo /D (a00110) >> ->> endobj -3066 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 426.7436 202.5067 436.6713] -/Subtype /Link -/A << /S /GoTo /D (a00097) >> ->> endobj -3069 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 361.1235 309.3265 371.0511] -/Subtype /Link -/A << /S /GoTo /D (a00164_g5a5bfd7e9060903893481db90645187b) >> ->> endobj -3071 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 344.826 213.038 355.73] -/Subtype /Link -/A << /S /GoTo /D (a00164_ge28f6cb60e86088d8886d0f804b4f37c) >> ->> endobj -3073 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 330.4811 255.0802 340.4088] -/Subtype /Link -/A << /S /GoTo /D (a00164_g31be289fd8ec3fe09b0088165d13976d) >> ->> endobj -3075 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 315.1599 302.4923 325.0876] -/Subtype /Link -/A << /S /GoTo /D (a00164_g8714af98a550f10dc814db92b08d1b0d) >> ->> endobj -3077 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 299.8388 290.1386 309.7664] -/Subtype /Link -/A << /S /GoTo /D (a00164_gc4357cec23abca29d2bb885803625a6a) >> ->> endobj -3079 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 284.5176 269.4366 294.4453] -/Subtype /Link -/A << /S /GoTo /D (a00164_g4d457c50e6f2cef57167c3804ce8bf7c) >> ->> endobj -3081 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 269.1964 275.7527 279.1241] -/Subtype /Link -/A << /S /GoTo /D (a00164_g863c94b0ed4a76997e53a3ccd5d0b6c3) >> ->> endobj -3083 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 253.8753 230.8912 263.8029] -/Subtype /Link -/A << /S /GoTo /D (a00164_g40fb1fb2d990ce04ae9bbee275627c03) >> ->> endobj -3085 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 238.5541 217.6111 248.4818] -/Subtype /Link -/A << /S /GoTo /D (a00164_gda99954e0f6905091885934e86c278cc) >> ->> endobj -3087 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 223.2329 239.2498 233.1606] -/Subtype /Link -/A << /S /GoTo /D (a00164_gd895686859ae7d178d31be04eb0a1a97) >> ->> endobj -3089 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 207.9117 236.0418 217.8394] -/Subtype /Link -/A << /S /GoTo /D (a00164_g38af81a4c9884ce89803fc3e52383112) >> ->> endobj -3091 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 192.5906 176.5052 202.5182] -/Subtype /Link -/A << /S /GoTo /D (a00164_g3212e70c55244608ac16316888c354f0) >> ->> endobj -3093 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 177.2694 176.4952 187.1971] -/Subtype /Link -/A << /S /GoTo /D (a00164_g6cda47c85ce1b58b501b44ac9cccc50e) >> ->> endobj -3095 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 160.9719 190.8811 171.8759] -/Subtype /Link -/A << /S /GoTo /D (a00164_g71e1b022f7b7fa3a154f19372b239935) >> ->> endobj -3098 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 95.3518 210.2479 106.2557] -/Subtype /Link -/A << /S /GoTo /D (a00097) >> ->> endobj -3099 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [210.746 95.3518 288.0054 106.2557] -/Subtype /Link -/A << /S /GoTo /D (a00164_gdc5aec3587b2c55b714a6c2f37b56cba) >> ->> endobj -3054 0 obj << -/D [3052 0 R /XYZ 90 757.9346 null] ->> endobj -1319 0 obj << -/D [3052 0 R /XYZ 90 739.9346 null] ->> endobj -170 0 obj << -/D [3052 0 R /XYZ 90 739.9346 null] ->> endobj -3055 0 obj << -/D [3052 0 R /XYZ 90 718.4222 null] ->> endobj -3062 0 obj << -/D [3052 0 R /XYZ 90 584.5736 null] ->> endobj -3065 0 obj << -/D [3052 0 R /XYZ 90 447.0871 null] ->> endobj -3067 0 obj << -/D [3052 0 R /XYZ 90 381.4669 null] ->> endobj -3068 0 obj << -/D [3052 0 R /XYZ 90 381.4669 null] ->> endobj -3070 0 obj << -/D [3052 0 R /XYZ 90 365.1085 null] ->> endobj -3072 0 obj << -/D [3052 0 R /XYZ 90 348.8111 null] ->> endobj -3074 0 obj << -/D [3052 0 R /XYZ 90 334.4662 null] ->> endobj -3076 0 obj << -/D [3052 0 R /XYZ 90 319.145 null] ->> endobj -3078 0 obj << -/D [3052 0 R /XYZ 90 303.8238 null] ->> endobj -3080 0 obj << -/D [3052 0 R /XYZ 90 288.5027 null] ->> endobj -3082 0 obj << -/D [3052 0 R /XYZ 90 273.1815 null] ->> endobj -3084 0 obj << -/D [3052 0 R /XYZ 90 257.8603 null] ->> endobj -3086 0 obj << -/D [3052 0 R /XYZ 90 242.5391 null] ->> endobj -3088 0 obj << -/D [3052 0 R /XYZ 90 227.218 null] ->> endobj -3090 0 obj << -/D [3052 0 R /XYZ 90 211.8968 null] ->> endobj -3092 0 obj << -/D [3052 0 R /XYZ 90 196.5756 null] ->> endobj -3094 0 obj << -/D [3052 0 R /XYZ 90 181.2544 null] ->> endobj -3096 0 obj << -/D [3052 0 R /XYZ 90 114.388 null] ->> endobj -3097 0 obj << -/D [3052 0 R /XYZ 90 114.388 null] ->> endobj -3051 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3107 0 obj << -/Length 2315 -/Filter /FlateDecode ->> -stream -xÚµ›Y�¹ÇßçSèq¬¹¼ÉÞÇdmÇŒ\ò°»04RÏHˆŽ‰oœOŸbóÙÉ…eøa¤Ö¿«ª‹õãÙ&3 ÿȬÁ3%j—³ÕþÏ^àòûâ~~¿¿‰Z<üøŽ6³5’ÊÙâ¹³ ”ÐÙbýË£D”ÍßP�ÿ5—â±}²_V»m{¸Ì[|œq¬=!Â\}x»^]P‚Ib|þçá—ßðl Á}|Àˆ5ZÌ~‡/‘¦¡³ý§ÌÙ=üóáïÁŽý¡»aìÙaãGj„ þé(<¬²÷îzX]¶ÇÃy,d¬�¹¼¨àV°4Òª× ÷ØÙåN³9ž/Ã�] ½.¡²6�A_zž�ÝÉ�]†’Xñ|ƒªà˜A=ã¸QŒßW˜ÿý�ÖT/�p0Ô×o”ƒ†îÚl—C‰¡¸râ«s]Ž—™þúê‡Éå¡j.m”™™ôòàÈ[žýBàxJn³Om?_ÏÛÃK¯¯{ÿváz¹ö²9fÆmí¾Ó.1k4¢¸¸KdÅ.6˜éá -~}—ø-ŽÛ©ïŠq»ÅÀîÈAU‚BÊ´nzA”jš–q…§Ó'ó± ×ô^VnúœÇ¨éó~CÓÇ~'†Wód&ûÃk§®{ÁM׆חÂØMkc¿…‘êëk;vn/4æùdU! -3 ÄŠôÚ¨¶dÌTåÒ%VçúA/ëæO—åöÐë?}øôÖ]2ù±=áóto9}”|¾XÍr?ÝWÂ|–juŸƒVš�ñ²20‘Á0y¿˜Øï€I‚«&æÀn -Œ�–ûd°Ù&£ùtU! -!izÍTÉ m„©§Ê¹C¬Î0d“ÌDÉù¾¼PÍ£ú>s ªÒ”—æAVä%6˜á¥à×ó’øýv^Òà*x)„9°›òb–Ýã´0³í¥òÉ -ªB”J³9Öo¤ZZ„2ÕD*i‰Ô9Z¼l’–�šïÌ -—ˆÉÒ:¢–7µ¼ÄŠ—•Y‰ æXÉû ¬Ä~ÓÝ´óæxnÑ*�«Ò½02ÛiN_ -h`7¥âu$jÎÖJñ¢‚Ê`ÂÅY/!Õ<@wSËC¤Îñàe“®û'¿)óý¸Àq‚kÇÈH=þ*2QI*txÑÑ9Ü�qx1Ù†öóquÝCðËî’Ýf‹ßÙ6”ÁèÆ]ª¬%Dœ­/sb—éÞúçä�×64IºW!=/î0Íl{Ñä � -�FÝA�Òà×çSw‚FýQMOÐ@áNÐÌýωRø¦£½ó3êÎÏb©Ý±£öüÌtBýkd Hο}Óü±óogW¸Ã‰Î’‚Vå ÅÆ¿�¾!°¿ž/þ Þ½ ºݵ¦•'ýºs�Þ‹­×s{.¿I€ÆÞp'ˆðñ—¦0´;‘B~Óûú]÷¯áÂ$j îu|„IÖûöО–!>WŸü‡�&ÙW÷…P÷ÿDÙOÛocéò=‡ö›±×Žw‚pšÝŸ�ÿýúb« N�ùÏ#ùù?ªvÿyendstream -endobj -3106 0 obj << -/Type /Page -/Contents 3107 0 R -/Resources 3105 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3130 0 R -/Annots [ 3110 0 R 3111 0 R 3112 0 R 3113 0 R 3114 0 R 3115 0 R 3117 0 R 3118 0 R 3119 0 R 3121 0 R 3123 0 R 3124 0 R 3125 0 R 3126 0 R 3127 0 R ] ->> endobj -3110 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 704.9751 226.0986 715.5054] -/Subtype /Link -/A << /S /GoTo /D (a00164_gc4b119801e50cc1824498a1cdf9adc37) >> ->> endobj -3111 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [276.1106 704.9751 300.7979 715.5054] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3112 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 667.016 220.0116 677.5464] -/Subtype /Link -/A << /S /GoTo /D (a00164_g6b942c1ef22f8cd1a726ef3364c9fbea) >> ->> endobj -3113 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 618.0981 215.05 628.6284] -/Subtype /Link -/A << /S /GoTo /D (a00164_g23705efb9077187881f094fc9be13bde) >> ->> endobj -3114 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 569.1801 209.501 579.7104] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf11d9915ec12a8cdd9fdcbb5e8fcd5c7) >> ->> endobj -3115 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 520.2621 205.0776 530.7925] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf8f12c820cc08da32aa62898bfc02db3) >> ->> endobj -3117 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 471.3442 192.9132 481.8745] -/Subtype /Link -/A << /S /GoTo /D (a00164_g3caacabb2fe1c71921e1a471719ccbd2) >> ->> endobj -3118 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [172.012 433.0115 229.8943 443.9154] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) >> ->> endobj -3119 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [279.9163 433.0115 304.6036 443.9154] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3121 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 395.426 200.0962 405.9563] -/Subtype /Link -/A << /S /GoTo /D (a00164_g1d34be506a61db90dd7829117efdf8cf) >> ->> endobj -3123 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 357.0933 208.3951 367.9973] -/Subtype /Link -/A << /S /GoTo /D (a00164_g9e6d2864f390a4ba1ac60dc65e2b9815) >> ->> endobj -3124 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 344.5895 226.5766 355.4935] -/Subtype /Link -/A << /S /GoTo /D (a00164_g4433d3af16ea083a81576d0f18ba57c9) >> ->> endobj -3125 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 307.0041 221.0375 317.5344] -/Subtype /Link -/A << /S /GoTo /D (a00164_g41e616d3fcc17e0aabfe8ab45ef0d30f) >> ->> endobj -3126 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 269.045 224.913 279.5753] -/Subtype /Link -/A << /S /GoTo /D (a00164_g0e0ea5f24b77f124ba33bcbc7ede5bfb) >> ->> endobj -3127 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 230.7123 236.5493 241.6163] -/Subtype /Link -/A << /S /GoTo /D (a00164_g2a939aa4fcffabbce1dc1f784a7e0ad3) >> ->> endobj -3108 0 obj << -/D [3106 0 R /XYZ 90 757.9346 null] ->> endobj -3109 0 obj << -/D [3106 0 R /XYZ 90 723.1038 null] ->> endobj -3116 0 obj << -/D [3106 0 R /XYZ 90 489.6163 null] ->> endobj -3120 0 obj << -/D [3106 0 R /XYZ 90 413.6981 null] ->> endobj -3122 0 obj << -/D [3106 0 R /XYZ 90 375.739 null] ->> endobj -3128 0 obj << -/D [3106 0 R /XYZ 90 194.2427 null] ->> endobj -3103 0 obj << -/D [3106 0 R /XYZ 90 167.7577 null] ->> endobj -3129 0 obj << -/D [3106 0 R /XYZ 90 167.7577 null] ->> endobj -3105 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3138 0 obj << -/Length 1587 -/Filter /FlateDecode ->> -stream -xÚÕYÛŽÛ6}÷WèÑ Ä,ï’ö­mÒ´R¤©ß’ ÐÚܵQ[ÚÊv“ü}‡7‰eI› Š 0EÍÎ�gÈI0ü#IŽ“T¤(g\&›ã'ÐýrAÜð -ÆW!à§õâ‡_hžä(—T&ë{cA$(¡ÉzûnIˆ¼YQx//¿½�¦ÀK‚°m¼®¶—ƒ²íçÕærTå¹8ï«òæÃúÕâź!v~ &‰¦ý{ñîN¶àß«F,ÏDò 0"yN“ã‚Sæ‹?4vì€yahzœÂÔ2Â’“(#9Dea’¥ J!‚G"ËÆ,MRÆN17áxñ¹8>Ôé¶?C‚)J¥Ih´OÍ­wØŽéžúÁ ½ $8E)abÈCxØà˜vñ“ºÛö� ´‰œ A -ÒQ'W jŠ>²¦éŸÙåP”Ûˆ=ˆ’¼Ï~= ?åGd·†]ß -8NE>†5A[ÓôH“˜7KS䜙Á·ê^ժܨ­ ÖÝûÛøü±x|܇Ã{,0ü'ÆZo}b³ÊeÎíÊ”ˆ2D½�åƒñòŸ‚—Õ~Û7¼9T'O«­{œfq$¬KB!º<7?ƒKwÅæ/ýzº¼¿”³ÙÍÓyWœmk²¿z– -°uuÔ­ pÊv5>9tµõ;ÕØt]¿®×o<¬,UH[u ™6k{Nª†É‰¥ªíó®8™œÀ”A¹p‰ºS– /mhPJ‘¤.aë��îL/�—ÓÙ¥ÐÉà^˃ÖÁ~n�ƒðN š>h ®'uê;Â&@¨¿”½– ÉË$¼u]ðD*ãD̼1ê' ^ìá à5°¹‚7ŸVð&è#k3¯Ë>Cð&üˆìμÑ0´‚7N[û��…‚ǦÏ -Æ×hé‹ãáþ‡'·¡eô~ÑÓX+z§l#ÜÓmEOXÑk±Â‹ž�¢ÏZÊLÉW ñÔ ‹­³S ¥Å6‘bÙÓ>þÿÐ>ª E*Ƶ/D]×>Nr$‰î›¥}cÔOÖ¾ØÃAík`sµo4>­öMÐGÖfj_—}†öMøÙ�«}£ahµoœ>¶6¢}ü{kŸÐ¾mq.v�œƒ=YõÛìŠÚ26ËÎ*Íð¶ƒEÁ9©E¥ˆ§¢­¸JÜ:Ån…ôòÁp†¨H×ë)Ë&–…C¯Bx¼{û65ñ…È�爜Q!�=úÞbhP1m'Œq$8ìññA•CQ1ŠÑw°ðèc*¢pß¼zèîkp«¡^£ÛC7nÝãºêvþìÏÚØ&Ø´lÁ1RïaµÚ¨ý K[?¶#µƒ1øÍ ´ÙÚ¡ûuíп�Ú¡!z›èãºnøÚ¡í¼u¯­P„sÔý¶vÀ™&wÔ�7ÞG»�K‚�$£Ì±PÚa�þÆ;hÛXj��¥î³±Ô-K=hc©»âX®Íœ»0¸ ïw¡·¬Î¶Ãç<äf–{à°SÅVÕ.ŸE­†Ó锽*N®î«º·–ŠÍùRÚ¥rµ@ÃaF×Âñú€®—gÊõß®¤�ÈïÕY]+Íd”´Ŭƒ%×£‚ãÏ­Èó¥ïm6 ô‹RGó‹9ï�êôÌŽÔêQÁR‡àJ±t}n Òm¼Àê�Ú—þÕ8S€Ð5ØŒ›e¡{*¨9}ËàœíòâÝ_éswúPž 4xš�ç9]Ï3xÄ·.½ÑÕ­¨‹#D¬>]ÏøýHæû~t”½É¼G…õ®CBÍ©ÌGçÞ€âÉw–ÈãŒvH´9x¬ö �~V½�Ø -u[¾&‘m(¥þcm–Oìž6D Êc7ˆ0q.Ä­GÅ´Ý0Úhg]Úµ�ð?œwNÝî¿S ›A¥þ[{6±%ÔÈž`r“™º˜�Qbs1áO¸˜Äþ ªd›{1�N{1™ �¬Í¼˜tÙg\L&üˆìν˜Œ†¡½˜ŒÓÇÖ/& 1"“Ù7\LúŸu"<üÚ„Á="…ü¦/>æ“U¯ÖùN“LYfNá  „KÚ¸¢çöR•ª.š?Døóòkßx¥7îÅ=ê~ñ-e·Ô}Ü¢KwôÑ[Ýâ¯`>nÏ«Ï_bupAˆÒ¿ì†z“endstream -endobj -3137 0 obj << -/Type /Page -/Contents 3138 0 R -/Resources 3136 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3130 0 R -/Annots [ 3140 0 R 3141 0 R 3143 0 R 3144 0 R 3146 0 R 3147 0 R 3149 0 R 3150 0 R 3151 0 R ] ->> endobj -3140 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 718.6794 154.358 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3141 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 718.6794 222.4221 740.9309] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3143 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 561.9505 154.358 584.202] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3144 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 561.9505 222.4221 584.202] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3146 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 405.2217 154.358 427.4731] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3147 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 405.2217 222.4221 427.4731] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3149 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [307.2537 340.6391 333.0469 351.2293] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3150 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 124.499 154.358 146.7505] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3151 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 124.499 222.4221 146.7505] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3139 0 obj << -/D [3137 0 R /XYZ 90 757.9346 null] ->> endobj -3104 0 obj << -/D [3137 0 R /XYZ 231.9163 693.5209 null] ->> endobj -3142 0 obj << -/D [3137 0 R /XYZ 90 672.2941 null] ->> endobj -3101 0 obj << -/D [3137 0 R /XYZ 231.9163 536.792 null] ->> endobj -3145 0 obj << -/D [3137 0 R /XYZ 90 515.5652 null] ->> endobj -3100 0 obj << -/D [3137 0 R /XYZ 231.9163 380.0631 null] ->> endobj -3148 0 obj << -/D [3137 0 R /XYZ 90 358.8364 null] ->> endobj -3133 0 obj << -/D [3137 0 R /XYZ 231.9163 96.348 null] ->> endobj -3136 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3154 0 obj << -/Length 2597 -/Filter /FlateDecode ->> -stream -xÚ­Ù’ã¶ñ}¾B�šªŒà¾%ñz³[޽q”òƒíÚâHœk%rLRïß§q‘/MŽš‡ÀFw£ïD6þÈ&Ã%Ê—›Ãåož`ùýñŸwð}üy÷Íw4Ûd(“Tnö�ƒ$HPB7ûã/[‰(»ßQ�·?ßK±-Üäp.‹ª»ÿmÿqñFXH `à Qfõîݾ§ê™LCó÷»_~Û#0÷ñ#–i±y� F$ËèærÇ) “óÝ?îþÞãq솹³ Â^s8 -S5œ Q$îwc8Ó)o ïß|Gx´Irà ñçûcæ€Ì -q@ê@^Š'žÏLÏE•_ -'µ_±Àÿº'x[—G�ˆEˆvŠ ©œ‡rÄxæ8ýñ¡ËËÊ!éN=¶{ý88\›ÆhÉNþºßr£cÞånÔvM‘_�U#XQHRÎ,ŽE¢³” -Ì-­·yåæ/Œšâ÷kÑvnrÉ¿ºÁCáàAºÕSqô‹þc¨¼XÂA[4 !0´æžãíXÌ ­ã+llŠÇºñÈ«º‹©Eˆ[Ãx8A™N¢y ߕؾœ -sÅýXª›ò©¬ò³[~ÿnï–‡ã™mF‹®Ž~ëKÙ�ÆæO3Œx&%•D˜3æ¬×|jž<ÌO‘÷ð»xƒ3æØR¦xSã{*:coÁÎb–˜`pÇ”¥‘CõP7™b3Œ ûÓì¨ôRz¼V‡®¬+'©ÒËÿÚZ›0ßëÆËß{Y= z1 -ÜQø‰™ù`¬h|f-`³V @k=Ð.†šÆ�!€‹¤9Ó–‘ŸŠîÚÓ­Ú·câS¤%ëÔ{¨ò±À VH&l†þŸœžë²êŠÆ‡‚z-$¼BZ"cH2’­K+†Z‘HhE,·ïþÈ/ÏçbETk¤9Ê4X>¾áJ½ f8œh–¸:L˜“‡tvC>=Ô-òl†ü§$ûÆÔ•@”dcêËbð·ø˜àMÅ0 m” NE¶.†êù)6G¬ó�P“¶3a?~[®JWŒ¸¼mŸËÊ›|ÆÒôè¬Þ�#�² ÷>ýy¦:íþsÛå]ñö­C†f*ÀÄL˜¢$®5¤¯5®U[>U6ô _yŒ@øІ…Ò„@ -�’ñIm±q¾69Õm7Ã,œ™HÁ<ЛI¾ QM7à4·ì-€ïbøi\˜`5´¯D~î&ôGXS5b`œ¯Ô”n"Æ$ -ÒTBø¹nf%#‘ÄJô’ô5UX¦f}½6¼)ÎPµ1°‡š¯­ü(•¢³³Ÿ‹à Õ¸ð;ÔUU_ Ù!ïmÏ—…C Ö‡ 7h¿¸�ËÕÃÖØ§®­KÝqÚqE .Ewª�³¾æ+­âJf5œÈÈýR¨9Uz$˜Û#iê?µmŸ‹CiØs¥§ -•¦JOi‘{_èyšË˜úCÃØ:©3�>ìvƉ�ì„fÛŸmùi–= õ‡3KñáÌüd -N3x(Â.RÁ2™ì‹¥Äy MK©² ‡úIku«þìáwñ†™²o‚7­?{Ö–ªPå"ÇR�yuuƒ® Â|ÄÎ!?Ÿò×D˜ö0I™Ï\aʵÝi5 kÎ4`à»øìÌ‚÷ý,ù¾ÊÀ7MyOÅÖÙWëçTƒ%t«1¸~LÑsC5~o˜QÍoªÃ)´cÇsÑ,*3¤¤q6Ö�ºÁ¨QNGìôª±Ò‰• ½2¯_0âь†ñI#|fÖã×NB+`t�-VêVíàwñ†™Úi‚7yW^Šc}]lɨԈkH)_ãR*@Ýà†* -©ÒVÂ�‘j�”1m3.Íÿ~`ÁÆG3ˆã£ÝU_Ï~“m·Í®‡ ûºêò†2Ÿ1̇£Ï𔈘 ò†ìÍmU :=gŒ+•wþù|9öer§f#VÆ|€ºÁq+¢³”™ÈÀMÊ f¥/(û(cÖÆ÷7Ë™;l÷§t{©ïŸKèB„ŠZ{žoòù{, “��`©¿1—ŒpŸŒÌZmZ:Ë�™:#˜G•¤6ìd çºuVDØœñp•*ÕS8R¦z\7¡~o˜ Q¼£dfùZ²&sõ˜24w7¹Î˜2Dl¤Æ‰kÆx^ÊóÙ«¼ˆÍh±‹gB›ŠW¬wñ1ÔrÏÀ'”<–Ëjh‚;øU²ÃeÇ”îloރ¬¯„:±„¤÷¹}Î[w¿ãÜý³�™‹[Ыmé—.×ð1?7E~üê&žHY�¨6E[Ÿ£ZY‚&§tÝÃW_7Ïñ=W;ÖÞ)œ³¸IXì�Êl<õrS0m?ømÁÁ¢‹S3½>/`5eëxƒùR¯ç"…,�¯_ì]R²1I@ÕÎÞÁ†¾¢�X¦)νmû%4!Êõ­GS˜–­ï5ò°jÉÛ1D«ækhaÚ—(úÍ9 Í´)4ùº“ÄP+N­äG—>ٻ⬭+š• ¯9VÜfÂIÒfönÓƒÅíBÚG­´^@5#�Ä]Í•¤Ä$¥kî&3ÝMÂĶj™óK˜¶]ãt c[N„+`˜¥1ÛÜ»1ŒüÓDf.î�êz)šò`í ¦>¹ÿùñFÒº‰õQØr¬;—Gaí}ÞvÙ,i �ú%”?ù�MR(Ðòw‚8�2�2DL®@ËúVÁ^r#<Æ`kz`ñeÆXÏ·Éz )Õ‰–†¥„ê>¸±%oG ƒ‡ñeôË©<œÒ%á¼ÃKWÕ¦´éÂ#— ¦s~<ÈU@cÊuvK®Øš\Xza“J#Î…¸A9@M)�d+‡B?¥üªÛý•·Àø†&ì{*ºåhH@ÃÙBß7DÃj9RFã¾°žIö=4?_מæ˜YÓ옫Í0Þ'ÉŒëuIôP3¢H”jŠl%IJtRñ?¨Ò÷]v±îҺﱾ†:y¶•È›à5i‹á“åþ/ ýÅÍFÝL±9h 3”eø¦ÿE`kZ -`ö×ËZZ%:hiLtAK1щ–ÆÒƒ­Ê®œPð"3¤ÌÃíªkÅPË®E4AŠKùÊ7µ5Òÿñ›Ú”ÃÙº½{í›Úª|†7µä'Ø^ù¦–RÅ›Ú >&x_û¦¶*†áMm�üÛÿåM�püß<ª±É£WÙÒ£èJ09ýjb¤ý¦¶§®®ÚД{øþùý÷o›ºÄou}ÂçÝ\_r®ë/×çoòr-ŸÃÝvY;]ÏDwTÏϦ7J°Œ8Eájöv -ƒš‰òúM•½cÓ°…0G‰2e~×ð3aNõ¾¨Š&ï‰ü- >šÔ~õBýü–²·ÔÛ ÅXúôe.ÉCnº~ðÉ*ÊTbßÖ|}*ª¹[—ùüòÐ9lendstream -endobj -3153 0 obj << -/Type /Page -/Contents 3154 0 R -/Resources 3152 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3130 0 R -/Annots [ 3157 0 R 3158 0 R 3159 0 R 3161 0 R 3162 0 R 3163 0 R 3164 0 R 3165 0 R 3166 0 R 3167 0 R 3168 0 R ] ->> endobj -3157 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [289.4951 672.8902 354.0124 683.7941] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) >> ->> endobj -3158 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 591.1961 154.358 613.4475] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3159 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 591.1961 222.4221 613.4475] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3161 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [309.2858 514.7873 335.0789 525.6764] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3162 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [384.6716 461.1078 477.4029 471.6381] -/Subtype /Link -/A << /S /GoTo /D (a00164_g6b942c1ef22f8cd1a726ef3364c9fbea) >> ->> endobj -3163 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [305.943 449.1526 404.7613 459.6829] -/Subtype /Link -/A << /S /GoTo /D (a00164_gc4b119801e50cc1824498a1cdf9adc37) >> ->> endobj -3164 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7094 431.5282 269.4792 442.0586] -/Subtype /Link -/A << /S /GoTo /D (a00164_g23705efb9077187881f094fc9be13bde) >> ->> endobj -3165 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [89.0037 419.1995 171.2245 430.1034] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf11d9915ec12a8cdd9fdcbb5e8fcd5c7) >> ->> endobj -3166 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [436.1989 401.5751 513.9963 412.479] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf8f12c820cc08da32aa62898bfc02db3) >> ->> endobj -3167 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 167.3556 154.358 189.6071] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3168 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 167.3556 222.4221 189.6071] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3155 0 obj << -/D [3153 0 R /XYZ 90 757.9346 null] ->> endobj -3156 0 obj << -/D [3153 0 R /XYZ 90 739.9346 null] ->> endobj -3131 0 obj << -/D [3153 0 R /XYZ 219.4825 549.7681 null] ->> endobj -3160 0 obj << -/D [3153 0 R /XYZ 90 534.2597 null] ->> endobj -3134 0 obj << -/D [3153 0 R /XYZ 231.9163 96.348 null] ->> endobj -3152 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F23 482 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3171 0 obj << -/Length 1552 -/Filter /FlateDecode ->> -stream -xÚµYKoÛ8¾ûWèè5Ë·¤Üv‘4ÛÁîv}k‹B±iG@,¥²¼iþýER¢–ÔM‚ÌÇp¾áÌp 0ü‘ ÆA(B3.ƒÍa�ƒ=,ß,ˆÝ^ÁþÊ'ø}½xÿ�ÆAŒbIe°ÞU$A‚¬·_–„D+ -gðòôñ/ -¼$›Ám¾==(3¾Ê7§ƒÊʤLóìâÛúÓâz][¹“DÃþX|ù†ƒ-È÷i�‹#<Á#Ç48,8enò°øgñwÍÇlT†®'›s? -ÓÐ\O"ÊEáÅŠ`Œ—›û¤Ð²¿ÿ@¸wHr-Œ†Ñg¾bÌ Q‹sˆ805$Oênó�‚6¾ßçÇ2KVI_±Àÿ^¼ÌÓ-Œ‰eÃ<6«� ¸ ˆ†!©þyW&if˜”÷–[›w¾ëloNE"˜ÉëµµÞ6)3:–…JH r¯Hˆ$å¼Â[WL÷1˜0°j0`.jVŽª€‹‰¥*Ú”IfæV -õ㤎¥Y>$ÏfõÎâ�²½ÚšÝ»çp/ßé۶f×rú`¡vy¡ê; atšåZˆXìXZX8š Ã(9šß§{•uˆò"ݧYò`f7×k3h®ÄOÚÖŽÇ!ÙÚ£Oiyß}"LD(Š™d(!‚×[ÅÞÒ|ö|½¦_ùŒÃûþÔçÛvн*µW:oôEâ” N"Ú©óèjª AúÜ´ èbŹK­–v§lS…�jfVåòtŸÐ6\1æàŒ-Í;ÛWP=”4Û�=çÔ¨{ãH L¢0�”"®åº°#ZùTýHÅðb£JÎϪ<Úq³ãeœ`DŒ’qôšjÞW7Á! -‰¶»#Óø¿<æiV*«²2‘®DDP(וOu^W"f(¤˜U²^ÿL�jDQcÐÅq<ñŒj5 H8¨Îš¬õŒÐ¦'¤`ÒÝ„~jª)ø7 ÿΘHǽ.:¼1Jâ.úy58ú)9z|Ûjè…5ª_=ñ¸jª ø>7CªÈ@˜cÂ0’‘õ¢+ùšf©�)Z]Ö³ÒÌ:|·S¨>áêÏÄ�LÉì‹ÞAŽÉ6êØ¡ÿ~„ZH]^ê„êàÃ$Š~%½Y%rHª|~|“Jäöãíµ]ª^T� ®Í*4>Õù@Ã9EK1?(�¢7A¹?Ej2”Yäe‘*(ëÅÄü€jªœ¦·69TÙ™�Zýê�1BuŒ‰5ÄÄrmØÔGšðÎnªÃcùl†éÎley›«3­ÞseM«¨2‰¸P�yQVX´*à|0œ¶uSÀ ±ša<[m[Jm[J¹kK©°Êƒ%¯-¥®-¥~× «M[J¹kKé™¶GšÀ… Á†0 -6Ñ–:ú•` -íñ�Ý–2¨K(‹iG¤Î«¯©¦éq³m)ÃÔµ¥ %¯-¥¶-…Õª-­VLªõ_7 UÜ ‘÷䰫÷žÇXf$0`âÐhfô©ÎgFˆ¹ˆaÁçWC£èM5Ô‡L{5Yó¯§W�6�¹˜¤«rW£”®b-¶SJçÊ6N(Ý£Qº�P‚†sË‘1è_.GúÛÅ‘Í-GFõÓ”#ð=n3Ë‘6úŒrdBŽß¹åȨšrd¾ÏíUz]‚ÅÖ#úÍ¢¡ÿþDx8XŸa¸3‘B¾èÃ@õe#‚#„µb�Dq¨+~ˆórIkQô}nT¦Š¤nWœÖnÝà“Žƒ';!Ôið’²Kj¿�PŒ¥í.¨þ¯°™ô?–¸^è*ÿù¼W½O$úÛÅ€–þ&/Âendstream -endobj -3170 0 obj << -/Type /Page -/Contents 3171 0 R -/Resources 3169 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3130 0 R -/Annots [ 3174 0 R 3175 0 R 3176 0 R 3178 0 R 3179 0 R 3181 0 R 3182 0 R 3183 0 R ] ->> endobj -3174 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.8972 671.9623 422.4145 682.8662] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) >> ->> endobj -3175 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 579.3293 154.358 601.5807] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3176 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 579.3293 222.4221 601.5807] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3178 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 375.5628 154.358 397.8143] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3179 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 375.5628 222.4221 397.8143] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3181 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [307.7182 234.8498 372.2355 245.7538] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) >> ->> endobj -3182 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 142.2168 154.358 164.4683] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3183 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 142.2168 222.4221 164.4683] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3172 0 obj << -/D [3170 0 R /XYZ 90 757.9346 null] ->> endobj -3173 0 obj << -/D [3170 0 R /XYZ 90 739.9346 null] ->> endobj -3132 0 obj << -/D [3170 0 R /XYZ 223.3579 533.4605 null] ->> endobj -3177 0 obj << -/D [3170 0 R /XYZ 90 513.0698 null] ->> endobj -3135 0 obj << -/D [3170 0 R /XYZ 246.6004 329.694 null] ->> endobj -3180 0 obj << -/D [3170 0 R /XYZ 90 308.3271 null] ->> endobj -3102 0 obj << -/D [3170 0 R /XYZ 222.8001 96.348 null] ->> endobj -3169 0 obj << -/Font << /F29 499 0 R /F14 636 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3186 0 obj << -/Length 675 -/Filter /FlateDecode ->> -stream -xÚ¥UMoœ0½ó+8‚T¦�sl›¦�T)M‘zH£Šou�v›ôßׯ@»ÍVª8ÀÌ<Ï›7Øcô‰yÐWÄ�E Šqéç•Gü;ã¾ðpG&ÍoRïõ{ª|JRé§ë>ƒD©Ÿ7�ʈ -| ¥ôÊù¶Ôõ.¼M/}N B‹GTÖë�§ëP”`-çOïæ–ø…)îÒ#ÀT"üc@¥¨_yœ²ÑØz_¼ÏSèÓ&�ý‹8jÌøIP@FH ~…H‚¦,œÄ½r*¿ïÊJÍ~çü߈ #Ò|£•kxØŒÇt™r`\9ž·Ùv»Êòad\Áz_绲©­•»M¶sþ²sžÜ u1`Û¦qÚ¹¦²œ™7…vˆrí<2 >¤éÕªk='mžAû¤.ÒéÖh3ÿ¹u�MÖõ?Ù(B%öŠúޏv˜¾À‰ARÎ{Hº±‚,âI°µª}74r¥Ý»¬î·º2ŠÆ”«ßîݗׯiŠýV�ÎlX¿ït·ÎšÓïRÓXnÇDÁ$ö%'ÀßL#(š£7T¢€fr -,‘q¯üü1³Šº³%3 -1£ø"5• 7Ÿ}ÌzÚ»!t=+I 12q¬ÂùVœpÌ–8õ òƒ"sROôgB�¢?Èfé_¹ß“ÕÅ{,€¢Z²ÿ½ #þTyŸ·a³,„RN…z¹ êýa6KïÎM„lLBÅ]ðZ¯u«ë|y(žÆRvog…�GvÁ±¹‹€<>zSJ!ÿk$÷Jb– £ó"ÍŒeÉ8r‡"¬ª ]ë6›Nú8>�—vøìéð&g”�Qâ,JˆKHEдÃ4øx5 �<ïØ»æñ÷�®—í±÷Å‘þü%®endstream -endobj -3185 0 obj << -/Type /Page -/Contents 3186 0 R -/Resources 3184 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3130 0 R -/Annots [ 3189 0 R 3190 0 R ] ->> endobj -3189 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 637.9957 154.358 660.2472] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3190 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 637.9957 222.4221 660.2472] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3187 0 obj << -/D [3185 0 R /XYZ 90 757.9346 null] ->> endobj -3188 0 obj << -/D [3185 0 R /XYZ 90 739.9346 null] ->> endobj -3184 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3193 0 obj << -/Length 2082 -/Filter /FlateDecode ->> -stream -xÚ­Z]�Û¶}÷¯0Ðèòò[bßÒ¦M7hšÜÆEÚb¡ØÚ]^{k{“l}‡IS¢4Tï-XKöÑœáœ#ŠÉæþØÜÐy¡ -b„ÔóõÃŒÎïàëW3æ~¾‚߯bÀ·«Ù~àfnˆÑ\ÏW·M͈âŒÏW›ßŒÓå‡kèâéú*º`„¶o›§]Ý¿<¬Ÿêý¹:oûå«×³ïW�Øå¥„f–öÏÙoÐùò{=£D˜RÍ?à %Ì>˜I.üÉnö~öß§ý¡¹`¨yЉáö1IàîÈ¡½EÛ>M¸\^1JéâÃR«Eý±mΩ>.]|²ÿàÚÓbÄ(Õ‚R -J¸R,"Ì…zYŸ«í®Þ¸ÒÔ§õqûè �DTqˆWêB™&ÎêÞ4”ûs”ä£l>ÍùöÔ~Ví‡ûíÙ�·�»íé¼];0œÖ�šï·.€;ÿqµz—P)µ 6m›(+ˆæR6‰^Ÿ—WBÒÅÚ^mÂ5íi“¶=x¬îêS{Xí¡$B˜Åï”ò�ÿööxxp¿·ǺÚ\ö»çöô—%ü{û¦=qW>ŸÎõÃ×ð•æ.ªe:lŸ¶›@Ø~\JÓ$úPívî°fZØÜJº«öwO�<“_‘’ƒå,ö‡­mNj{U*b8g£·c h훃QM¤(å%Ž%û�sÕçb®âJàŒ•ã…;ÆP­{¼Míf¸ 7}fûÓñÎa~‰sðø\I\›Ãýùü¸¹ZßmÉ}’H!ˆ*4^ e²PpÏQcªUÝÆtp§3Ut^B¢Z6‰BB SÎÌ&úaixÜ�|ò·më9wWîÏõñ¶Z»{þŒïa®ØÌÝ~]­Û¼”2ÄmƒkÐÞ¢÷¡„‚0%r>ô°¼£€˜qÞàÃoƇæ)>ÄsHâv}¸ò!e%^ �‡ÒÞ‡b¢í“Kªœ êp!ê6\¥fÿŽÝ¨"‚‚¡2vó°¼Ý¢€˜ÝpÞ`·oÆnæ)vÃsHâ» XÍŽª¸Î4_Á˜IKñ;=Y¢EÉ3n °1»1ÆÆM%‹R2ý£ÃØîòLcIÉá¾*Ú.øeuvc£÷çãÓúüÉ”‹Áç´d†0ąacbØËe¼6Ãë Ûá=5­M k`.Ê3bX‡Ïå�Ä †½�þñfmG[ý\Œ†kŒÌTÁ£2è /JA+u+|mïÙý ÒššR5ªt @”°¬Ò(ãEé ¯WºÃûÕÆµ4!—š¼`=òq±=>—Fצa'/o¾{u}óÝ‹Ÿ~êçÂ…U*É¥Wˆ€Êd�FkûhE÷ÕCýµëzÎG;ipg·Oûµ�õˆ�uDB -˜6Níc4Ò7X(R›Tª›Y{¶©×»êhÂÍ$m´Ó‚Öý;?ÁšA¤ÎÙÝÃòv�bvÇyƒÝcÞ vï�O±;žFצñ~µ4bñ¢y²­¾¿ù°dœ.^\¯®~•xŸ ÂJÊðªT&(»}€—ÝtèP/G›±çøó,`²{X^vŒ1’ç ²Ç¼dï�O‘O#‰; ûÛ_Wï~]%‚³& ÇëP™D8çDÂx¾›œèÝhmPð€`YÁQÆ‹à^/x‡7/x—|‚à™4’¸Í+®÷ooö騥PDÑÒd -àQ9æ¢ Æ˜^èZ ‰ ã_®‘±K ÀDö°¼Èc$2ÎDŽy'ˆÜ!Ÿ"2žF׋|z´“ß~0±)Ki25ð¨¹áDJuÉé>Ô{s-‰*y9®sÀtö°¼Îc¤3ÎtŽy'èÜ!Ÿ¢3žF×ëü±jßôve†�W2S�ÊqÛÙ0Ó=n�y°Ï†‰¹�1é¸Ì“ÙÃò2cŒ‘Ì8o�9æ� s‡|ŠÌxI\/óc}\×ûtl -–e¦ -•£70íÕ¥êÒƒÒjHiQÎ 9®tÀ”ö°¼Òc¤4ΔŽy'(Ý!Ÿ¢4žF7Rz{ؤB —™"xTŽÝ(RPÑc¡ë!¡a$¯¤ŸnÅLhË �1FBã¼Aè˜w‚Ðò)Bãi$qÃzW�n]æJà@9jC +DÑ¥•o‡T†²–2Ö¾üŽiìPy‰ºHa”4‘NÐ7fž"/šC?ªw}Ø¥{š�•±Ã/¬õ”a¶ƒ/»Ü3Ó/¢ZÙ…’:tw…×½ªz§ÈìvÁÇ7]ÄÄ–µÊxñD†×›¢ÃÞ܆—S‰20‚•Ôô’·‡ÇçÒIâvÒI_­€:…‘x-*CÎy ãsÊzPE×÷•ÛÂdçp ôÔ¯‰�ÍPßüÓbìûÉ¡W�Ö@B ½Î¸�"f ËcŒ „óżŸ–œ.Ûô±,͘êq# ŸË"‰{ñMõø8¸þý“…ΔÁ£r ÀÔ½Yë–¼ãK1&»5Q�> endobj -3197 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 582.769 174.5722 593.6729] -/Subtype /Link -/A << /S /GoTo /D (a00113) >> ->> endobj -3198 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 542.4621 174.0143 553.3661] -/Subtype /Link -/A << /S /GoTo /D (a00112) >> ->> endobj -3199 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.133 502.1553 158.5226 513.0592] -/Subtype /Link -/A << /S /GoTo /D (a00114) >> ->> endobj -3201 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 415.9868 197.5356 426.8907] -/Subtype /Link -/A << /S /GoTo /D (a00079) >> ->> endobj -3203 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 356.821 232.9533 367.3513] -/Subtype /Link -/A << /S /GoTo /D (a00165_g1dbc635a2924806f42d7e3273a6a69b5) >> ->> endobj -3205 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 317.1168 224.1764 327.0445] -/Subtype /Link -/A << /S /GoTo /D (a00165_g7d7920c1e51cc4eef80206ebd6fee3f4) >> ->> endobj -3207 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 303.4391 220.9585 313.3668] -/Subtype /Link -/A << /S /GoTo /D (a00165_g8a645f8831837320c4e0c704e871abcf) >> ->> endobj -3209 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 289.7614 176.5052 299.6891] -/Subtype /Link -/A << /S /GoTo /D (a00165_g3212e70c55244608ac16316888c354f0) >> ->> endobj -3211 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 275.1074 190.8811 286.0114] -/Subtype /Link -/A << /S /GoTo /D (a00165_g71e1b022f7b7fa3a154f19372b239935) >> ->> endobj -3213 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 261.4297 188.1217 272.3337] -/Subtype /Link -/A << /S /GoTo /D (a00165_ge3f8f7deae69854853b0c8ebb82c380d) >> ->> endobj -3215 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 247.752 198.0741 258.6559] -/Subtype /Link -/A << /S /GoTo /D (a00165_g79f9a50c2cccb967d38a2eeb45d2fd75) >> ->> endobj -3217 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 234.0743 194.2087 244.9782] -/Subtype /Link -/A << /S /GoTo /D (a00165_gf7dd2757d1e766f65b01ba7c91c660a0) >> ->> endobj -3219 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 221.3729 188.6793 231.3005] -/Subtype /Link -/A << /S /GoTo /D (a00165_g820fb27c50e7bb4ac6d9eae1b06630a5) >> ->> endobj -3221 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 207.6951 190.8912 217.6228] -/Subtype /Link -/A << /S /GoTo /D (a00165_g14e276fa8e765f774f4162619f1c8fc1) >> ->> endobj -3224 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [187.2447 147.1795 226.8757 158.0834] -/Subtype /Link -/A << /S /GoTo /D (a00165_ge6f849e94cf6e214be8ffa9a548ecfcd) >> ->> endobj -3226 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 133.5018 190.1438 144.4057] -/Subtype /Link -/A << /S /GoTo /D (a00165_g648ddfb2dde2cc55034e4e0ea41cb6d1) >> ->> endobj -3227 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 119.8241 174.6619 130.728] -/Subtype /Link -/A << /S /GoTo /D (a00165_gc364305cee969a0be43c071722b136e6) >> ->> endobj -3194 0 obj << -/D [3192 0 R /XYZ 90 757.9346 null] ->> endobj -1320 0 obj << -/D [3192 0 R /XYZ 90 739.9346 null] ->> endobj -174 0 obj << -/D [3192 0 R /XYZ 90 739.9346 null] ->> endobj -3195 0 obj << -/D [3192 0 R /XYZ 90 719.1618 null] ->> endobj -3196 0 obj << -/D [3192 0 R /XYZ 90 602.4452 null] ->> endobj -3200 0 obj << -/D [3192 0 R /XYZ 90 435.663 null] ->> endobj -3202 0 obj << -/D [3192 0 R /XYZ 90 376.1236 null] ->> endobj -3204 0 obj << -/D [3192 0 R /XYZ 90 335.9601 null] ->> endobj -3206 0 obj << -/D [3192 0 R /XYZ 90 321.1019 null] ->> endobj -3208 0 obj << -/D [3192 0 R /XYZ 90 307.4242 null] ->> endobj -3210 0 obj << -/D [3192 0 R /XYZ 90 293.7464 null] ->> endobj -3212 0 obj << -/D [3192 0 R /XYZ 90 279.0925 null] ->> endobj -3214 0 obj << -/D [3192 0 R /XYZ 90 265.4148 null] ->> endobj -3216 0 obj << -/D [3192 0 R /XYZ 90 251.7371 null] ->> endobj -3218 0 obj << -/D [3192 0 R /XYZ 90 238.0594 null] ->> endobj -3220 0 obj << -/D [3192 0 R /XYZ 90 225.3579 null] ->> endobj -3222 0 obj << -/D [3192 0 R /XYZ 90 166.8557 null] ->> endobj -3223 0 obj << -/D [3192 0 R /XYZ 90 166.8557 null] ->> endobj -3225 0 obj << -/D [3192 0 R /XYZ 90 151.1646 null] ->> endobj -3191 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3232 0 obj << -/Length 986 -/Filter /FlateDecode ->> -stream -xÚ¥VÛnÛ8}×WØ ¨¸¼ˆºä­MÚ4AÛÍnìC[ŠDÇdÉkÉM³_¿C‘”eII , X¼ çÌœ‡¸~ÄM±ó¥,ŒÜbë`÷–¯b¶ØÆï2ç÷4uS”F4r³u¯!"ˆSBݬüæEˆ†~@9öþö#î‰{=iÅÞ'Øû©þ`ø#»uCœ Ì#Rç%jÕyŸ èÆ8Î"¢°ÿq¾ýÀn FÞ:±4áî#L0"iJÝ­Rf'•óÕùsУ7úK>r–�$¥œSë%§ã£“ˆúÁ{Wâ;Æ´ÚÑ«¦8lEÝå�ljåÑ„/ β0kBÄèú­}Ç×ùV¼1”v{?¥ž™­u¡ AˆX¶KzØ^±>ÚO5èY)Š*ß÷^ i`Ž0Ib7 -9Ši/Òj…‚±Ô<’aÌ@ JHÚ›w§Òз¢ûöbŠO0E1£dÑ€™!ƒôÜîÑ‚cÆ�Z•)Šð>ò—¼LÀ µÀÀ84‰X’†§¸ÙÆäÀ¥þüô)Jd~_™�Þ²~Ô¬õ·³g†P>K$sœDËbDØHì%¬˜2\¥å–$ˆ2äa­Ôö”/Ê%Ô�.€—õÃÙ ™ÛshE©G²žH¶Å^î:=Vw³ϳJJˆ¾ÆêHì%V­˜òïÙˆ†ñ”ÒW°­Ôû”ÚÊm<Å~«�ß5²†ëhèižK9³œÊävW U[3ïúâpƒP$6祒 -©·Í‹½B‰g—Lˆ`´nözK×(nXÏõÇÖ6êÚ’Ö:ä ' -È'žQ<²f«õÙ¼,-rïµÞÔ{•l;½ÔgØ€®\Ä*¥Í ÎÍê¬!äQv› —›®Û•«âA®[Uý¾¨ŸF”M²¼Dò…JÚ'%ŽOo„Ié#n¸hƒ†§kô - õÑÛÅÌËõá$þg¿‚d¤ixû.¡‘å˜ nY‹9¶ç½v7Š’¼’ÿŠ Ñ�£öTrÕšpîMÈ ÇÉ9Ku9(oÏЮ£R×ÚMs¨ÌøÞœ*òª²ÅȆ¯}j;±5rMӇݢ�ç$cì• @Åbvý%Öb/êÂúù1óIâýñå뛉W¹[©‹!j›»h©µ#ÊÍbÛ‰!”$âÑÿêúúÞ5�#„ÑqëAÇÛÔ#”×¢ÐðXî-ƒŸíàV…ð`&„š/¾ ì‚b=£G&GÔsݘxnîŒ42‚÷Oöžüzz³ª®ZÒ~þµ»Ëendstream -endobj -3231 0 obj << -/Type /Page -/Contents 3232 0 R -/Resources 3230 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3238 0 R ->> endobj -3233 0 obj << -/D [3231 0 R /XYZ 90 757.9346 null] ->> endobj -3234 0 obj << -/D [3231 0 R /XYZ 90 739.9346 null] ->> endobj -3228 0 obj << -/D [3231 0 R /XYZ 90 723.1038 null] ->> endobj -3235 0 obj << -/D [3231 0 R /XYZ 90 723.1038 null] ->> endobj -3236 0 obj << -/D [3231 0 R /XYZ 90 539.9526 null] ->> endobj -3229 0 obj << -/D [3231 0 R /XYZ 90 515.6244 null] ->> endobj -3237 0 obj << -/D [3231 0 R /XYZ 90 515.6244 null] ->> endobj -3230 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F52 1229 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3241 0 obj << -/Length 284 -/Filter /FlateDecode ->> -stream -xÚ¥‘MkÃ0 †ïþ>&‡x’Ûq�c[Y`°±ÜJmã–A“°’°õßωÝhoý²¬?Bþ ·À�2ÂÊ\ó]Àüõ’a g>žÍ®uB`J¸÷½1œéB S˜{Àµ2ÿša‚Xø”rÎP kd12”äsMÜ ·FO —®u§Mïê€Ë3Š£(STɤhaArA7è ö)©¤;çv/Ûóe'¿çƒ»Ù†BymFé«F|endstream -endobj -3240 0 obj << -/Type /Page -/Contents 3241 0 R -/Resources 3239 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3238 0 R ->> endobj -3242 0 obj << -/D [3240 0 R /XYZ 90 757.9346 null] ->> endobj -3239 0 obj << -/Font << /F29 499 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3245 0 obj << -/Length 1390 -/Filter /FlateDecode ->> -stream -xÚ¥YMo"G½ûWp4Rèô÷Gމw£äm|ó®ÐÆëÑF0¬òóSÍL·f¦ÊÈòļ©÷¦Þë?1 |æŒcAi;[mïøì;|üç�è/k©àuäÂÂ5[”·þþx÷ëgf’3k¥™=>ÇâVf¼š=®Ÿîÿx©öm}˜/¤á÷nþíñïîÍœw"ÞÀ¡®aÚK}¾áô×?X0Þ½y¨Úª{÷o{8­ÚÓa.ü}Ý_|]�¶õ®­Úæu—Ë Í@¡ìË[Å´‘ö\Þ11_Îùýúeµ_-�pg]VïÞ©ŸëŽf·ªßÊ -ŒIee`Az™ÊæÂu[5›zÝ ¬�«C³Oòî>=æ~zøðn¦�`. -ëy-JTê;(°ñÁžg>0ÎÔòŠ9îÜYÕ§ÿªí~S»f\2§¤@©5 ^è…øÉá{éK!PpÇœPfL¡*f\†E‰gØj Py¦…Ç.2Š¢T‹Ô¿tU»õ€Ýr&�½fŸnAÂS:ußZð23Ê{¢ EQªEjI£…©ˆt°r»ð<Ô_9—»æœÜ®SýâØ4»~ɨн¾>w¯ñŽM­,6±z”fënõ¼­ðÏM½Y¯[{ŠòŽ)¡ôhB¬WÆÂg™V^¿Õ‰¼_¥4Ã¥—µQ(ãyi(ziÀ>¸µ¤º„»P·oÚ¤dÖ8ƒj“LC-Z›4Lè¸vm GiS’ùàî”îA@aˆ�¶pØÁ 7{mæ[¹áJ ‚4›T�®^ªÃ°š-ý%é´ NÐ_W�ôÝéuÍo É\ô¡m�é�0ÓFX{'7” F[QüøºÂÕeËJu§f¿<­÷ËÕënp$ ؃�U¹È¨!?Dºà4Wêª;pPx½`Þ º3Ý�„§:0¨{NíÈ“K8¤&Ÿ\ô(zk8sMTnŒÎMQðã¹ÁÕåÜ”êÚf[�,vÓ°Ãå�·dGË‹cÊy#ÀÕõ°wˆ3pžcâ¶і³š8[–&miQðã–âê²¥¥º“°Ë‘“Ì1Ë…Få½×RÍR�òîB^Û¬~‡¦zØ|„@å-l¢M…™Â«(SŒ6µ(ˆ�µ8o¶«ä…}ëØÏ ?çÆÎfÝM—»®V æ[„“»­…EË�¸ÒŠÌ÷=žR=¨l«Õ²Z¯Ã×ÄX=Š>©¡·–kO9™`´“EAÌIœ7;Yò6»‘áÖAd�½¢EØO ÔM¦lêáù‡Ÿ…ïÏø³»D.., ìä—’ #-) ~xÇ$Ô%Ü…º“_ŽŽþæTÝ»Ï@ˆ»àžT—pêŽõáç\˜ûúÐŒ|©wŒÃ~‰ª\dŧ¦ÑB]ò?éo#ß]åù7¦cR°˜$„ñö˜àêrLJuøÁŠÉ»ù`%ä%Ü…¼M]ëeœ™†ƒ¸Œ0ƒ›–Q»‡”)/ÙŸähJgÎðéý½`)I0:%ãí)ÁÕ唔ꈔ ònO ./§¤”×ìÇŽíxÈmq}‹Œ¢˜aPãÊ]1O$Ä8æÂÄNHÀ’`tBÆÛ‚«Ë )Õ AäÝž\^NH)oW·Ûêøcø+‚b28�;–Qµ3ñŸ%þ’z""Z3¯��ŽHÀ"’`tDÆÛ#‚«Ë)ÕAäÝ\^ŽH)o½;Žî"q†TÊâŽeEí4RËKꉈ(Á|˜øYð‘€E$Áèˆ Œ·GW—#Rª#"‚È»="¸¼‘RÞº~ž ~_�6íòðzjG~È ±é\âæe¥"x0&ÎÎ¥Šñ´@ÅÔê¾þ?ñÿªNƒendstream -endobj -3244 0 obj << -/Type /Page -/Contents 3245 0 R -/Resources 3243 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3238 0 R -/Annots [ 3248 0 R 3249 0 R 3252 0 R 3253 0 R 3255 0 R 3257 0 R 3258 0 R 3260 0 R 3261 0 R 3263 0 R 3264 0 R 3266 0 R 3268 0 R 3270 0 R 3271 0 R 3273 0 R 3274 0 R 3276 0 R 3277 0 R 3279 0 R 3280 0 R 3282 0 R 3283 0 R 3285 0 R 3286 0 R ] ->> endobj -3248 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 468.5995 139.4144 491.5682] -/Subtype /Link -/A << /S /GoTo /D (a00048) >> ->> endobj -3249 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.2799 468.5995 192.535 491.5682] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -3252 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 384.1603 123.6537 393.9384] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -3253 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [124.1518 384.1603 133.8952 393.9384] -/Subtype /Link -/A << /S /GoTo /D (a00077_31471b5e27bda51832d0fa49bd6d9b54) >> ->> endobj -3255 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 373.2662 153.8002 382.1128] -/Subtype /Link -/A << /S /GoTo /D (a00077_e0b137a3875ad12a99e5e3e0e177fd12) >> ->> endobj -3257 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 358.2574 172.9089 369.1614] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -3258 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 358.2574 202.2389 369.1614] -/Subtype /Link -/A << /S /GoTo /D (a00077_cfd36e02c7498d766ff802575e981612) >> ->> endobj -3260 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 347.3633 136.9336 356.2099] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -3261 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.4317 347.3633 160.455 356.2099] -/Subtype /Link -/A << /S /GoTo /D (a00077_e80af46ceef63eab3c786525370ae720) >> ->> endobj -3263 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 333.3308 138.5977 343.2585] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3264 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 333.3308 159.9074 343.2585] -/Subtype /Link -/A << /S /GoTo /D (a00077_e707c39412e09d3a47f0b3c5dad33725) >> ->> endobj -3266 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.9088 320.3794 206.1837 330.3071] -/Subtype /Link -/A << /S /GoTo /D (a00077_2391bb18db5f620e0e9fb848ae5ba5e9) >> ->> endobj -3268 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.9214 307.428 162.6669 317.3556] -/Subtype /Link -/A << /S /GoTo /D (a00077_5361ef75bfbdb469b5cc31f0060a2670) >> ->> endobj -3270 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 294.0582 133.6164 304.4042] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3271 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 294.0582 168.0469 304.4042] -/Subtype /Link -/A << /S /GoTo /D (a00077_564bab93ef6a268a5de2fab885c1d32a) >> ->> endobj -3273 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 281.1068 138.5977 291.4528] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3274 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 281.1068 183.6978 291.4528] -/Subtype /Link -/A << /S /GoTo /D (a00077_7a520a57d7d0541524f34a7685635597) >> ->> endobj -3276 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 267.5974 138.5977 278.5014] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3277 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 267.5974 166.5427 278.5014] -/Subtype /Link -/A << /S /GoTo /D (a00077_1d2f2751b0865045486c9aa59d0d0971) >> ->> endobj -3279 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 255.2039 138.5977 265.5499] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3280 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 255.2039 174.2934 265.5499] -/Subtype /Link -/A << /S /GoTo /D (a00077_20541305548441e5dcb2e1e7e6f300eb) >> ->> endobj -3282 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 242.2525 138.5977 252.5985] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3283 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 242.2525 172.6298 252.5985] -/Subtype /Link -/A << /S /GoTo /D (a00077_27df2817055bc099821d96eb60a40b34) >> ->> endobj -3285 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 229.301 138.5977 239.6471] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3286 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 229.301 197.4264 239.6471] -/Subtype /Link -/A << /S /GoTo /D (a00077_5e16ca335dfd7394527f602da879fca2) >> ->> endobj -3246 0 obj << -/D [3244 0 R /XYZ 90 757.9346 null] ->> endobj -178 0 obj << -/D [3244 0 R /XYZ 90 739.9346 null] ->> endobj -985 0 obj << -/D [3244 0 R /XYZ 90 553.9527 null] ->> endobj -182 0 obj << -/D [3244 0 R /XYZ 90 553.9527 null] ->> endobj -3247 0 obj << -/D [3244 0 R /XYZ 90 517.4245 null] ->> endobj -3250 0 obj << -/D [3244 0 R /XYZ 90 403.1102 null] ->> endobj -3251 0 obj << -/D [3244 0 R /XYZ 90 403.1102 null] ->> endobj -3254 0 obj << -/D [3244 0 R /XYZ 90 388.1454 null] ->> endobj -3256 0 obj << -/D [3244 0 R /XYZ 90 377.2512 null] ->> endobj -3259 0 obj << -/D [3244 0 R /XYZ 90 362.2425 null] ->> endobj -3262 0 obj << -/D [3244 0 R /XYZ 90 351.3484 null] ->> endobj -3265 0 obj << -/D [3244 0 R /XYZ 90 337.3159 null] ->> endobj -3267 0 obj << -/D [3244 0 R /XYZ 90 324.3645 null] ->> endobj -3269 0 obj << -/D [3244 0 R /XYZ 90 311.413 null] ->> endobj -3272 0 obj << -/D [3244 0 R /XYZ 90 298.0432 null] ->> endobj -3275 0 obj << -/D [3244 0 R /XYZ 90 285.0918 null] ->> endobj -3278 0 obj << -/D [3244 0 R /XYZ 90 271.5825 null] ->> endobj -3281 0 obj << -/D [3244 0 R /XYZ 90 259.1889 null] ->> endobj -3284 0 obj << -/D [3244 0 R /XYZ 90 246.2375 null] ->> endobj -3243 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3289 0 obj << -/Length 833 -/Filter /FlateDecode ->> -stream -xÚ¥VÉnÛ0½ë+t”�zʮʱȂ(Ð&¾9A ØtbT–]/Hò÷%µE¶d©@¡ƒ(q8ïÍ<92÷`³PK 1*œ­¾¸ß7–Óc7?n|›_¯)cˆ©p²È=(IHád>��ÄhLBHŒßº¡d+—É>)F÷ûía¶?lGh"[N®g‡•ÍöÉ~¹ÎF�“ÛàjR3)‰J®ÐóøLY8w„o<62|s 0Ž)\‚xõ‘÷Á¯ÚO1‘/èŠW"ï¸?TEL.ºX�ÆÈ‹^mš®ŸÞFÈ¢õ6�?í\(¶n1¾³ [Ä�ͬ�³@ˆ¥Ì\ν25` qi÷É2µó2cv7Û.7]ù2*í’¯Uw´•ѸiÕ–ØÄÀw¾ ÆQ笮ޓÕ&µ»‹SddšöB ˆ -7ÌçüŸíK9u× ˆLƒF.»òÃÚ®6ós=Ƶ0kQu—9Å{“T Q8õå|)tJ²y Ú}š¤ó‰(͇HœzíJÃë)â -4ÕŸ‡Új€CÛ›'ÔÅ!*'äŠÙ[éÒ>0FÙ2ßÇEÂÊRI—YY@\ïõ¢xûi9× -ÎTà¶{QUŸGÑõÒ¦ó]Ç�#�Å5?{26 º6¥Á�øôãqˆd»d|¹KÞ‹˜— .wRÅL©Av•Ý»Ín=ûÝ¢Ç  ˆû鈘éaz‚�ƒä -«cj-ZB‚"ì§5–¥ÑÉmwæœSsPFÆCbVfÃb6¶O•Êj·–©‰;{M¶m•HAæ÷¼•ýƒ–_Ï`™mûç±è°‘Œü•vJHˆÝ±8�ˆÊjˆ†ALécSd�]•«˜»ƒD�Ø ƒ>±+³a±ûb÷ãÖb7qûÅ>Âý±û´üzY²²-R’kú#¯¬†p¥…Ä�q§¢S]w¯ Ð� +s>QIõ_=b¾CŒ[‚œš‘r=7ž.'·Ð·ƒÏöÆfvë:¾²9«î²Õàv„2:”Hå›]¿ ²?&ÆÊ{./ªõ¶øh7ÒÏUÏüþñb[ÝŸoc;²ô²Š�Ùendstream -endobj -3288 0 obj << -/Type /Page -/Contents 3289 0 R -/Resources 3287 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3238 0 R -/Annots [ 3292 0 R 3293 0 R 3296 0 R 3297 0 R 3299 0 R 3301 0 R ] ->> endobj -3292 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 668.6407 162.0093 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00036) >> ->> endobj -3293 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.8747 668.6407 237.7248 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00037) >> ->> endobj -3296 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 583.4842 139.1456 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -3297 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.6437 583.4842 146.6175 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00078_a9825b5977b2d4dec66e6bd09e6ae6ea) >> ->> endobj -3299 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 570.5328 179.9123 581.4367] -/Subtype /Link -/A << /S /GoTo /D (a00078_4b1b1436b50ed7638aece35f41421196) >> ->> endobj -3301 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 558.1393 157.1179 568.4853] -/Subtype /Link -/A << /S /GoTo /D (a00078_4da86e9feb5e5835eb15163c2cb61116) >> ->> endobj -3290 0 obj << -/D [3288 0 R /XYZ 90 757.9346 null] ->> endobj -986 0 obj << -/D [3288 0 R /XYZ 90 739.9346 null] ->> endobj -186 0 obj << -/D [3288 0 R /XYZ 90 739.9346 null] ->> endobj -3291 0 obj << -/D [3288 0 R /XYZ 90 717.8172 null] ->> endobj -3294 0 obj << -/D [3288 0 R /XYZ 90 602.4342 null] ->> endobj -3295 0 obj << -/D [3288 0 R /XYZ 90 602.4342 null] ->> endobj -3298 0 obj << -/D [3288 0 R /XYZ 90 587.4693 null] ->> endobj -3300 0 obj << -/D [3288 0 R /XYZ 90 574.5178 null] ->> endobj -3287 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3305 0 obj << -/Length 594 -/Filter /FlateDecode ->> -stream -xÚ¥TËnÛ0¼ë+t”b¹|‰Ì1pÔ@�6ñ- U¦m²œÊ2Úü}I‘R˜È–Q:ˆ�áìì¹cóA¬pœñ )ÊD\ì"oÌòm~;5ûi¸^F_nˆŠR‚ˆx¹î N€ÄËÕC’!:K Çɶm_VÏŦ|.òªrk÷ms,Z7¾ÓkÝÌ@&º.´]R'@øìi¹ˆ¾. ^"§¬‚ßÑÃŽWFê"ˆ*Éã?f‚(Eâ]Äí'UtýxÜFwàT¦èéT�!³Bú\‰I= RŒÿ7W“ c¤8ï˜M™-1‘3Ï=×m^Vzå˜æúP4åK[îkÏC3,�•«Í\?bLê²CwÇs/¨*kíF»ÿ~íþöD¥ S“Ú¢3ª)C }=æy›»ƒ7¥®V‡N -�H2ÂÏ^¶àó,£’½ñظ�d|kÛrr:q@]Šk.�ÂB¼�[ì냯g±ÍW!`Á9fläYf‚u:1¦#�‚Û«ýQ§Ýj6s*îñ—�x­‚:ßé‘™!cè´7”1öÄ�˜#©à’uÙ¾7º)÷&ƒæAï†Ç»>ÖEÿ°B1Ä\ùLö^ÌY‹ø´¬«•uV39ˆLL׃{PÊͳÌe§`Øh0·C|ª™vVKs( ›¥0͑ʾWfäØÄnu­›¼íÛXß�¾÷ƒÅ xrô þ�¯½"¾CŒ…­g„'ûÆMŽß~x4òÀ_¯¾Wîÿ¾nô¨–¶Ó÷Ò‚úü�Q�àendstream -endobj -3304 0 obj << -/Type /Page -/Contents 3305 0 R -/Resources 3303 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3238 0 R -/Annots [ 3310 0 R 3312 0 R ] ->> endobj -3310 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.5401 617.7467 188.1115 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00079_9a84c69ec5a4705ccb1ca99fcd120add) >> ->> endobj -3312 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [210.7662 602.7379 245.9639 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00079_1513a9e88921750d2a611b518f6fc207) >> ->> endobj -3306 0 obj << -/D [3304 0 R /XYZ 90 757.9346 null] ->> endobj -987 0 obj << -/D [3304 0 R /XYZ 90 739.9346 null] ->> endobj -190 0 obj << -/D [3304 0 R /XYZ 90 739.9346 null] ->> endobj -3307 0 obj << -/D [3304 0 R /XYZ 90 716.7484 null] ->> endobj -3308 0 obj << -/D [3304 0 R /XYZ 90 634.6393 null] ->> endobj -3309 0 obj << -/D [3304 0 R /XYZ 90 634.6393 null] ->> endobj -3311 0 obj << -/D [3304 0 R /XYZ 90 621.7317 null] ->> endobj -3303 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3315 0 obj << -/Length 1204 -/Filter /FlateDecode ->> -stream -xÚ¥XÛnÛF}×WðQzÐfï—<®ƒ(Ð&zsŒ@‘(›¨M©…6ß!¹K-µÔŽ�ÀD‰‡sÎÌ™½pYAá�ŽFâ„ÔÅæmF‹gøùóŒùÛK¸¿ŒŸV³÷ÜŽ8Íu±Úu4#Š3^¬¶�sÆõbÉ¥Tl~þýO¸TtÎí/îÖͺ¿úÚÏ›æ|\0;/ýÍýæüVÖͺ©öõâiõ0ûm5(ñB•ЬÕñÏìñ‰[ü0£D8«Šá %Ì9^¼Í$áËëìëì¯!N£{`*_ÅÄtÂLø…‡Œ9Àô "KF)�¿4Íaûý ”q’ýõ—rWöÙÖ›²Í®ˈSª •n£r;„%̾+›uõZn}�ÊÓæXB• ŽˆühôZ]æ®üF)¯«Ý=¾ö‚^«ÚË”¬ÿÜïúÏö‰W¯Ë‰¼�Šˆ´¾sï«òu{š°P3K¬äêf¯Å€¾ôqnŒj"…•—8-ï7ÎÕ5£m)•È3(ŒÜwTë1ï¹>UÏupeó²>&*Œ ”Úkí­ã³Ç|‰õ<¦'‰Ûêiª·2•à$¡ÂauèAKÆÁ\–±‡*bÃÜñ(ÜœK¸k:(¸…±H±Šgiƒ�‘´Ãi¿ù;Ñ&,aÒeµ-Â*)ÑãrœªdfcJ£´3ÞÎ8Àîë¨ûþܤ=ʈÐ2Ÿ°õß òfƒ(á4Ò! m‘8à/÷¢.àFêiÅ8'Z•Õ¶P+WÐK–�YÁ¨ü§Üš«`¨Ž¹oçð˜Š$n×/Ý:3¡ÂQb$H¨Gá]c@‰……éšÃ»& -˜™õÞ¡bÞÉy–A%¹½â½íJÀc -’¸­‚ª†Öø±àt~Þ¥ý3Õ©@@aü†åÌUå}šXÛ•6°ˆhsÛå�s9Àp—sŒ‘ËyÞÁå˜7ïòˆ÷=.ç$q»Ì»MX½~+§<†±j�ü -coç)¯êþȧ=†U…BÔÛG€œÇ†{œcŒ<ÎóǼy�G¼ïñ8¯ ‰ÛͯݫB²àĶ»±lêÚƒð¹U2 G w$ -˜s$Ï;8óö/P»Ówÿ’4¾!F{%!³øy<&&‰{€‰K‰tÎæËà<ÝP+3±ås'Àpw¢€9wò¼ƒ;1oUOl…àM™}E{Û‘€Ç$q[0&`‹M³ù¼•Ⴥ)Âö~P¸—p9/²¤ƒi˜¹>ÜC.Ö-4‡ø¾EZ.N(ì6ÇÊnÛàˆÆë¨ñÞqâ¥@Ì™lu¬ÇàŽQN¸Á_8 ÷, -˜3-Ï;¸ófЈö=(/ ‰{ñdjÁrÂy\§©ì�¡³š´Žn±q4ÀPSâ€SÞ`ʈw|ŠszÙ›©Ž5Ö‡±ŒÌ1ŽÇc‚’¸ÝàÞŸ'úÄ�Ÿ\j¬µ”¬�é¤E$0­ô/�£v>ÃZ(˜àñ9©&ÎÛf'8<ؙ“IÓwàç².�°éñåg’„‹‡S`‰?6æþ“~äâ#÷gÈœRÝ_í\Í÷ÇþKzØüãg8WþïçsÚóíQo�UéTÝ·endstream -endobj -3314 0 obj << -/Type /Page -/Contents 3315 0 R -/Resources 3313 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3238 0 R -/Annots [ 3320 0 R 3322 0 R 3323 0 R 3325 0 R 3326 0 R 3328 0 R 3330 0 R 3332 0 R 3334 0 R 3336 0 R 3338 0 R 3340 0 R 3342 0 R ] ->> endobj -3320 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [172.012 615.6894 195.0353 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00080_c39694ece9526b84012f90f2bb00af9f) >> ->> endobj -3322 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 602.7379 139.1456 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -3323 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7605 602.7379 172.3606 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00080_9dd8edeece221c853a4c4516bf1b01c2) >> ->> endobj -3325 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 589.7865 123.6537 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -3326 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.8576 589.7865 191.7375 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00080_e261f08e1556287d241764fb2e99fc26) >> ->> endobj -3328 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 576.8351 169.103 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00080_4c6f843219271d25766ee5969e435d1a) >> ->> endobj -3330 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 564.4415 169.85 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00080_447eb700ea7a185e0f155934995d49e5) >> ->> endobj -3332 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 552.9895 153.8002 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00080_94fcc9f5c47f419040d849ce58beae35) >> ->> endobj -3334 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [166.7715 537.9808 181.4961 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00080_5e274a8f8b5fb2b3999c54fe27c76e46) >> ->> endobj -3336 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.9214 527.0866 141.0881 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00080_468c04fff28e784f93ebc3f0849211dd) >> ->> endobj -3338 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 512.0779 176.216 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00080_78f82878f3fd0e7401c7d7d3b3fefbef) >> ->> endobj -3340 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.9214 499.1265 163.2246 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00080_16a3a3056f44b7245ce085b937a269dd) >> ->> endobj -3342 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 486.175 198.9209 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00080_6df929b448ea98bc44d41f5e96237bda) >> ->> endobj -3316 0 obj << -/D [3314 0 R /XYZ 90 757.9346 null] ->> endobj -988 0 obj << -/D [3314 0 R /XYZ 90 739.9346 null] ->> endobj -194 0 obj << -/D [3314 0 R /XYZ 90 739.9346 null] ->> endobj -3317 0 obj << -/D [3314 0 R /XYZ 90 716.7484 null] ->> endobj -3318 0 obj << -/D [3314 0 R /XYZ 90 634.6393 null] ->> endobj -3319 0 obj << -/D [3314 0 R /XYZ 90 634.6393 null] ->> endobj -3321 0 obj << -/D [3314 0 R /XYZ 90 619.6744 null] ->> endobj -3324 0 obj << -/D [3314 0 R /XYZ 90 606.723 null] ->> endobj -3327 0 obj << -/D [3314 0 R /XYZ 90 593.7716 null] ->> endobj -3329 0 obj << -/D [3314 0 R /XYZ 90 580.8201 null] ->> endobj -3331 0 obj << -/D [3314 0 R /XYZ 90 568.4266 null] ->> endobj -3333 0 obj << -/D [3314 0 R /XYZ 90 556.9745 null] ->> endobj -3335 0 obj << -/D [3314 0 R /XYZ 90 541.9658 null] ->> endobj -3337 0 obj << -/D [3314 0 R /XYZ 90 531.0717 null] ->> endobj -3339 0 obj << -/D [3314 0 R /XYZ 90 516.063 null] ->> endobj -3341 0 obj << -/D [3314 0 R /XYZ 90 503.1115 null] ->> endobj -3313 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3345 0 obj << -/Length 714 -/Filter /FlateDecode ->> -stream -xÚ¥VÁrÛ ½ë+t´¦» äØq“if:Ó&¾%™ŽccGS[je¹múõE)IJE3,àñöí>c0?ŒÄψb©ˆ—»â�™¾ŠÐ-OÍúÔ¼ŸGï.©ŠQ‚Šx¾nN‘ÆóÕÝ$#<™R“�Þ=~}Ü–Ëo{;q[W‡em¿oôZW ʉ.–ÚL L³ Ò,y˜_Gæ½§�3�MøÑÝÄ+£ó:”äñ/3‚JÑx¥”uƒmt}éyìB»áTšÙé<1%f†v‰R“wæå‰oJÔdgi‘(Î[ZSà†•Êž– #žéz‘oõÊ2Íô~Yåßë¼,ólhh­ÊÒÌô=-òÝn_8AÛ¼Ðö Á9U®í³e«_ÜKR˜�'rF5K JWŒÙ¢^Ø}—¹Þ®ö'l(‰L)?{Ì|€-¿Ÿ‚ )“é O÷žR~ ¡)'gã{T(®9 -„x÷PìóMÑ9³*«z #ã$“™<’Ñ,U‡¹ñuø� o#hŸÿÑ - ÍT*„CM‘{qÄ àD* ùãPa{^èÆÜ Ú›ã}“7¾†±fTÍ1k£¦8솾0ÂCp gKzÖ® €)ð¥‡�ñ Gœ Äí¬ywù´¨ìubòÀŠfnY°âØ@\J `*�Ä�·¬Ã‡dx[™å¡a.<Žb¼>™…mËŒ -iný€m,l›G8fÛxÜÞ6?îÏ„šW"_�°ŽHUÀ:&?8j]‹Ið6 -Ì»54ÎAòñ -e4åÐÜ–pÒ^0ñQðì¿z‘Ö~i¶ c~¯!LoÁd×j 1-‘=ŽWºÐբîEÿÔ}\'È͵ç^uÚ½î”]P°# - ì×:¡|RVvpøøÙ¡‰>>»n£üý¼ÑÅq-›F©“æÕç/ø8endstream -endobj -3344 0 obj << -/Type /Page -/Contents 3345 0 R -/Resources 3343 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3357 0 R -/Annots [ 3350 0 R 3352 0 R 3354 0 R 3356 0 R ] ->> endobj -3350 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 615.6894 192.2756 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00081_b42c7af6114fde5d21206a2e18a7d3ee) >> ->> endobj -3352 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 602.7379 194.4975 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00081_164124d48fe85bc98d9a300382a5245d) >> ->> endobj -3354 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 591.8438 165.1479 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00081_5595902fd42d874e35a70206fad8f6d0) >> ->> endobj -3356 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 578.8924 163.3048 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00081_b5801722740492e69bcc73687476009f) >> ->> endobj -3346 0 obj << -/D [3344 0 R /XYZ 90 757.9346 null] ->> endobj -989 0 obj << -/D [3344 0 R /XYZ 90 739.9346 null] ->> endobj -198 0 obj << -/D [3344 0 R /XYZ 90 739.9346 null] ->> endobj -3347 0 obj << -/D [3344 0 R /XYZ 90 717.8172 null] ->> endobj -3348 0 obj << -/D [3344 0 R /XYZ 90 634.6393 null] ->> endobj -3349 0 obj << -/D [3344 0 R /XYZ 90 634.6393 null] ->> endobj -3351 0 obj << -/D [3344 0 R /XYZ 90 619.6744 null] ->> endobj -3353 0 obj << -/D [3344 0 R /XYZ 90 606.723 null] ->> endobj -3355 0 obj << -/D [3344 0 R /XYZ 90 595.8288 null] ->> endobj -3343 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3360 0 obj << -/Length 1383 -/Filter /FlateDecode ->> -stream -xÚ¥XM�Û6½ûWèÅ{Ëá—È è¡Ø$èÚdoI8¶vW¨Wv$¹Iúë3”H-eÉdÚÅV¶žgÞÌ{Q„Œâd†f…,ˆáBeÛÇÍîñë×+p·s¼Ÿ‡€ßnW?¿b&3Ä(¦²Û»>‚"°ìv÷n L_åL ëÓï⥤k t¸¸Þt›áêmל¶Ý©¹½.ÝÍÃöôXÖݦ«õÕ‡Û›ÕËÛ‘‰#*¹ËãóêÝší�ðÍŠn´Ì¾àJÀ–=®ãþÃ~õvõ×g¸Ñÿ`©^ |¹`¿a¾b† (†‚ ¢®r ”®�íaûwXÞpý¦¼+‡:ëmië€*è ¶˜Ù„²èãýTÕÛýiç�RrR�ôÀ_b¤ºp€žyX$€hÁÁá~u�°J FʾJ,‰cŸ(6… ú©Z®Þë²ÛTûrçä+ÛmS½x�Ÿi[h sûàDoÊcS¶£êýw‡»á¿³Ê±9t‡¾µ@×eGlt� mï <|Ùöj4§Æ�ªÖ%ð �›Ï§2ÄŽÐ/U÷0\Õ‡áÿ©E5]çÿTmõiïpå¾´Þmɹqµ$»—IC S\/Ú΃ò5_kÚJy‘)ÊÓWþòëæñ¸/Ûç‰AgÍ,ˆÑ ð²¿g¿iîÝ­7? h,àr‰`¨òˆa–âC¹ßò/V‘C³ß ŽœPµ¤ˆ3Í=(Eá<–e0x&/\&‰4Bö·®Ë÷”²ºz²ßƹf_ÕN\ jêLû¯¼[ediÑéây¯ªr¿k†œÄj@ü¥i–PDp-žâؼï“s{௘äÑŒ½=xÚ8 U*ÉÎã&ìŽÝŒcDÉBF¹1"0VšŠ BC’›Ç¥¸qF´Ñ&Í­Hsã’pmÒ}ó¸)7k¼‚J!˜CÜJ…aЭ /úMA4Š‘ðÛKú- 8_ä•Êë�4É»=Ôí‚`š†ÂNGDqø…Y\Ká¤?ÎH|f -P‰Ò=jž't�Wj¢8ãg-ÇÃ’€ -þÕ{|ªòY\Ëâ»c×ÌH‰)Ù�s£¸ìF�Ã0uÂ�–vcðÙÓ/ÁnôlÈnÑ08cíWŒ]>¢æy§†Áé@õYW– #‘šgy/Wîñ©Êgq-ƒ¦Ü,¦ ¸Ë Û´¸cr ´c”¶> endobj -3363 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 589.168 162.5673 610.0795] -/Subtype /Link -/A << /S /GoTo /D (a00037) >> ->> endobj -3366 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 504.6641 123.6537 515.568] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -3367 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [124.1518 504.6641 133.8952 515.568] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -3368 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.3933 504.6641 167.3794 515.568] -/Subtype /Link -/A << /S /GoTo /D (a00082_17aacf7c5e2046c1f3ab50faa1b2f7eb) >> ->> endobj -3370 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.4319 491.7126 157.1379 502.6166] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3371 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.108 491.7126 196.4302 502.6166] -/Subtype /Link -/A << /S /GoTo /D (a00082_31f25efccba9fd043047133d0d0ba5ab) >> ->> endobj -3373 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 478.7612 133.6164 489.6651] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3374 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.5865 478.7612 171.7929 489.6651] -/Subtype /Link -/A << /S /GoTo /D (a00082_b973f2e16c2883a8a0164d716cce5a31) >> ->> endobj -3376 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 465.8098 167.1604 476.7137] -/Subtype /Link -/A << /S /GoTo /D (a00082_c3d1bfbb1abde31973c015de97ce2f84) >> ->> endobj -3378 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 453.8346 138.5977 463.7623] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3379 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 453.8346 171.5239 463.7623] -/Subtype /Link -/A << /S /GoTo /D (a00082_19b82696bd84a803250cbf9812f2f125) >> ->> endobj -3381 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 440.8832 138.5977 450.8108] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3382 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 440.8832 170.4081 450.8108] -/Subtype /Link -/A << /S /GoTo /D (a00082_a408ca8630154ebd039f37a828399f7b) >> ->> endobj -3384 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 426.9555 157.2078 437.8594] -/Subtype /Link -/A << /S /GoTo /D (a00083) >> ->> endobj -3385 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.706 426.9555 172.7794 437.8594] -/Subtype /Link -/A << /S /GoTo /D (a00082_d6bd03239291629676e4c0286ebb650f) >> ->> endobj -3387 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.3868 414.004 195.9519 424.908] -/Subtype /Link -/A << /S /GoTo /D (a00082_a6bfaf327ce839ba70accd71014398d0) >> ->> endobj -3389 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [172.012 401.0526 192.2657 411.9565] -/Subtype /Link -/A << /S /GoTo /D (a00082_fda184638130452f3570966acc5b97f9) >> ->> endobj -3361 0 obj << -/D [3359 0 R /XYZ 90 757.9346 null] ->> endobj -990 0 obj << -/D [3359 0 R /XYZ 90 739.9346 null] ->> endobj -202 0 obj << -/D [3359 0 R /XYZ 90 739.9346 null] ->> endobj -3362 0 obj << -/D [3359 0 R /XYZ 90 685.9318 null] ->> endobj -3364 0 obj << -/D [3359 0 R /XYZ 90 523.614 null] ->> endobj -3365 0 obj << -/D [3359 0 R /XYZ 90 523.614 null] ->> endobj -3369 0 obj << -/D [3359 0 R /XYZ 90 508.6491 null] ->> endobj -3372 0 obj << -/D [3359 0 R /XYZ 90 495.6977 null] ->> endobj -3375 0 obj << -/D [3359 0 R /XYZ 90 482.7463 null] ->> endobj -3377 0 obj << -/D [3359 0 R /XYZ 90 469.7948 null] ->> endobj -3380 0 obj << -/D [3359 0 R /XYZ 90 457.8196 null] ->> endobj -3383 0 obj << -/D [3359 0 R /XYZ 90 444.8682 null] ->> endobj -3386 0 obj << -/D [3359 0 R /XYZ 90 430.9405 null] ->> endobj -3388 0 obj << -/D [3359 0 R /XYZ 90 417.9891 null] ->> endobj -3358 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3392 0 obj << -/Length 609 -/Filter /FlateDecode ->> -stream -xÚ¥UMoÚ@½ûWø¶3³ß9V4Q‘*µ ·$Š,Ä*1Ôµù÷]{×ÄÁ€UU¼oß¼73»` -þ‡©…TKÍ,*�¿&�®üòM‚q{ä÷GmÀçiòéšlj™U¤Òé²fPÈ$!¥ÓÅý@3=‘„Áv·™ÿ|z ö˰tWûyÆ·néŠ!š�ËçÎ/i¥Ôɧ“äËô !*”\a%àWrÿéÂ+�$À¸52ýí'ÀÐZJ_A¼™¬“»äÇ�'lÔN•ÈO;EÁü -5VÉ;×-§ð�V½¿@ŒÌJYû$W¼dÄ #õØ•³lí�iìvó"Û–Ù&�<¼UŠŠ¦RkÍØ=PžÕèúø, -Zg¹ #+ÃweW'Ö®U@öÂÎ(æ‚¡‰©ÏÊY8t�¹õbw¢ˆ - 3‚äÙ6kBòÛÞ܈wž*î‘<Ž…P¥Rò‹³ÆWÂ^µR¬âÖmKúê[PªW]ƒû nožÊŽ:NLàå|Pݸ(Úq¹dˆ`޲À;q1iHÅ=ï¼Á÷9ïðV -¶eÑ 9S{Œ«!ù^à Ý’‹}ÍQý½òN×-Fê zè�VÐ}¾ËVys}w/›¢ÛZ2m´ù¨á|ax�šcÖJÍÚ-»á�e ´¾˜1#éo½\œB��Jªÿz¦ëâÄ_�ö3¬ü³ËMó -#C¡UíéÆå®˜•MŠ›§î[3˜ Qú2„ RüÂñ+‚0#FË!ÉÁ¦“ý×ïÍ"ðù->Û?o+—§²úi¤µò󸢛 endstream -endobj -3391 0 obj << -/Type /Page -/Contents 3392 0 R -/Resources 3390 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3357 0 R -/Annots [ 3397 0 R 3398 0 R 3400 0 R ] ->> endobj -3397 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 615.6894 133.6164 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3398 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.5865 615.6894 154.6474 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00083_5e8637b1514d03eb3eb12dc9a502e27e) >> ->> endobj -3400 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 602.7379 190.0639 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00083_20fae11b540a561c622a0d74cb4b9f97) >> ->> endobj -3393 0 obj << -/D [3391 0 R /XYZ 90 757.9346 null] ->> endobj -991 0 obj << -/D [3391 0 R /XYZ 90 739.9346 null] ->> endobj -206 0 obj << -/D [3391 0 R /XYZ 90 739.9346 null] ->> endobj -3394 0 obj << -/D [3391 0 R /XYZ 90 716.7484 null] ->> endobj -3395 0 obj << -/D [3391 0 R /XYZ 90 634.6393 null] ->> endobj -3396 0 obj << -/D [3391 0 R /XYZ 90 634.6393 null] ->> endobj -3399 0 obj << -/D [3391 0 R /XYZ 90 619.6744 null] ->> endobj -3390 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3403 0 obj << -/Length 619 -/Filter /FlateDecode ->> -stream -xÚ¥UKoÛ0 ¾ûWøè¬‘z«Ç¡¬À€­Í­-ÏQ€óXê`í¿mÉ©[»ÉaðÁ”H‘©�¦@¦R£ sBê´\'�.hû&Á¨ÎIŸ÷ ¾N“/×Ü¥Ž9Íu:�·42Å‘§ÓÙC†&9—RavøöƒD2ÂeQAº¯÷‡²>ì'h3•Ûò°ö›º¨WÛÍäiz›\M�H"P%468þ$O�ÎðmL8«Ò¿´†Îñt�H.ºE•Ü'?�~‚¢=0–¯B1ž0JF;¼Ë˜SLHØ0;ɲ]ÝÏ-Èw~îC’›Ò7IoÈœR­7*pãŒÛ£7†Ñߥ¯‹Uåg±<þ¹Ü¯vcűŠZ“jC•6z<µÎ(ï[ ïÓ: È— šÕÕK±ÞUþùâcdÎŒàx2´d΢$±Õ5;ûETÝõ"fP¨1„¢‡ðhw4k Ζå®dË@aé¦ôi€ùÑê\è�·&4k‚¦¹ì|pâ© …»ô�|³jo­½Æ"£Zm"ï• ÿí<ü›UÔíj¶dŸÐFHF÷hóÖX×+_ÍžGÚGYÍ´0âÓ>ïŒU]3)¬|óÓÄ}ä\ 9ÑðY‰“[Nˆóœ ¾s õYt�Ý;tUù« £n³ -N£ãL:0çÑ NSÏ‚‹f° ©êh¾ {ú¦d4¢Q¥˜´ÎŒYEG­ô�Ê––Žþþ¬ÐDs@‰ N›©HÝ€Òè6±¿ñû¢îÆVÇûï�p;A•âyüÃ<>@i>á*ÛîÃbøžü~힎—×…ÌÅfšwÐzUúŠh�¡endstream -endobj -3402 0 obj << -/Type /Page -/Contents 3403 0 R -/Resources 3401 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3357 0 R -/Annots [ 3406 0 R 3409 0 R 3410 0 R ] ->> endobj -3406 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 667.9234 139.9724 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -3409 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 584.4605 130.8466 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00155_g3983e0c026396d5c4506779d770007ba) >> ->> endobj -3410 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.3447 584.4605 140.5301 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00084_c3fa0fa86689e3e7c039a16c16861dbe) >> ->> endobj -3404 0 obj << -/D [3402 0 R /XYZ 90 757.9346 null] ->> endobj -992 0 obj << -/D [3402 0 R /XYZ 90 739.9346 null] ->> endobj -210 0 obj << -/D [3402 0 R /XYZ 90 739.9346 null] ->> endobj -3405 0 obj << -/D [3402 0 R /XYZ 90 716.7484 null] ->> endobj -3407 0 obj << -/D [3402 0 R /XYZ 90 602.4342 null] ->> endobj -3408 0 obj << -/D [3402 0 R /XYZ 90 602.4342 null] ->> endobj -3401 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3413 0 obj << -/Length 1159 -/Filter /FlateDecode ->> -stream -xÚ­˜MoÛ8†ïþ::@Ååð[9.Ò`�ÝÖ·¶(\[I\ø#kËhúïw(’ -mÚ¤ƒ>X²^Ï<äK)BEñUC+-5i¸PÕl5¢Õ=þüqþq�ÏëXðçdôÇÖT iSÕä®� €H¬šÌ¿ŒQ{U3IÇ»U÷ø}×M»ÖÝî¶ûYç®?µwíö -̸]Ïìc-˜‡«o“ÛÑûÉ�ßãI®Àfÿoôå­æˆy;¢„7FV¿ð†hV­F‚ñp³}ý;Äqú?œj¥~º™ þÂB;6[GÍJ_ÒNlœ‹ -¤‘²�ŠÝkƒ23D%àãÞ´Ýt±lç.ÒM»›m�Ýb³>î$# £+¥�P­N71ˆêX•ºiB)ÇX†ÊA÷T«Çe»»>Î ”ÍdS ÒxÙ?³¿lïý£O PM4pyŠ�G„ƒn�Yćv¹ÜÔ¿®€Ž7Ûåœ<$¨vŒê]Ì ®µ¬Ð;ʋʦ1 ÆPV2-ÈʦE_¿AÉÓ ÖÆt{P§v(š(ìß,Þ¥;A mñ‚î-]¶ë´pb47Y¾Z{‘wUžw•û¬K®YÙÕ(àë]ÍÓ ®ÆtW3x/w5�7¸ãíÚuwÆVŽ36 hmíEÅÉ*I]|›dE[〯¶µ@tty[sx/¶µ€txø.rütÚZM¨¢* Yk/*[kχXñ¥b�•­�¾ÞÚ<Ý`mLW°6ƒ÷rkóxƒµ1ÎØùc·Mmmˆ`ø˜¬µÕ°\ŸÙ9Qd%õ«ZûÁ�[0œÇ'Œ -Ç®þí¶ Ûu»Å—`ÌIþ·vDïý 0ÿM¯¿fÔÝ1J•»º»br¼Ùº›ý_ÿx5ñ¿ýYêæé÷}:Eì)p@‹úçõÖendstream -endobj -3412 0 obj << -/Type /Page -/Contents 3413 0 R -/Resources 3411 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3357 0 R -/Annots [ 3416 0 R 3417 0 R 3418 0 R 3421 0 R 3422 0 R 3424 0 R 3426 0 R 3428 0 R 3430 0 R 3432 0 R 3433 0 R 3435 0 R 3436 0 R 3438 0 R 3439 0 R 3441 0 R 3442 0 R ] ->> endobj -3416 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 667.9234 162.5673 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00037) >> ->> endobj -3417 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.5561 667.9234 193.8396 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00038) >> ->> endobj -3418 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [213.7051 667.9234 242.5466 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00039) >> ->> endobj -3421 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 584.4605 133.6164 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3422 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 584.4605 154.3681 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00085_0bb4f34164e7207c2db26b77f23ccfff) >> ->> endobj -3424 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 572.5901 150.7619 581.4367] -/Subtype /Link -/A << /S /GoTo /D (a00085_3592a1f5ae100db2ed9c0810b41c7bc7) >> ->> endobj -3426 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 559.6386 162.3783 568.4853] -/Subtype /Link -/A << /S /GoTo /D (a00085_668cab7d54ff0a2fc2a2179ca06b0798) >> ->> endobj -3428 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 544.6299 171.2348 555.5339] -/Subtype /Link -/A << /S /GoTo /D (a00085_503c2994a4e52300516e2b820f0fc65b) >> ->> endobj -3430 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 531.6785 159.6186 542.5824] -/Subtype /Link -/A << /S /GoTo /D (a00085_04833004cec509a41c502429df308e35) >> ->> endobj -3432 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 518.7271 138.5977 529.631] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3433 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 518.7271 169.87 529.631] -/Subtype /Link -/A << /S /GoTo /D (a00085_a312da7b5f6441140721ec7e55f345a8) >> ->> endobj -3435 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 506.7519 138.5977 516.6796] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3436 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 506.7519 169.3121 516.6796] -/Subtype /Link -/A << /S /GoTo /D (a00085_68204df6bde3e3c27271ebde10579a57) >> ->> endobj -3438 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 493.8005 138.5977 503.7281] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3439 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 493.8005 168.0569 503.7281] -/Subtype /Link -/A << /S /GoTo /D (a00085_0560495c60c68d62617ff1f3d0c424a4) >> ->> endobj -3441 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 479.8728 138.5977 490.7767] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3442 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 479.8728 170.418 490.7767] -/Subtype /Link -/A << /S /GoTo /D (a00085_5ed2615cec9e633d90ac5968771976eb) >> ->> endobj -3414 0 obj << -/D [3412 0 R /XYZ 90 757.9346 null] ->> endobj -993 0 obj << -/D [3412 0 R /XYZ 90 739.9346 null] ->> endobj -214 0 obj << -/D [3412 0 R /XYZ 90 739.9346 null] ->> endobj -3415 0 obj << -/D [3412 0 R /XYZ 90 716.7484 null] ->> endobj -3419 0 obj << -/D [3412 0 R /XYZ 90 602.4342 null] ->> endobj -3420 0 obj << -/D [3412 0 R /XYZ 90 602.4342 null] ->> endobj -3423 0 obj << -/D [3412 0 R /XYZ 90 588.4455 null] ->> endobj -3425 0 obj << -/D [3412 0 R /XYZ 90 576.5751 null] ->> endobj -3427 0 obj << -/D [3412 0 R /XYZ 90 563.6237 null] ->> endobj -3429 0 obj << -/D [3412 0 R /XYZ 90 548.615 null] ->> endobj -3431 0 obj << -/D [3412 0 R /XYZ 90 535.6635 null] ->> endobj -3434 0 obj << -/D [3412 0 R /XYZ 90 522.7121 null] ->> endobj -3437 0 obj << -/D [3412 0 R /XYZ 90 510.7369 null] ->> endobj -3440 0 obj << -/D [3412 0 R /XYZ 90 497.7855 null] ->> endobj -3411 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3445 0 obj << -/Length 978 -/Filter /FlateDecode ->> -stream -xÚ¥WMs9½ó+æU‹Vß>î§ârØÝ˜=9.�Á¡ -Æ^j“Ÿ’Æ RR)hFOݯûuk$Raø‘ÊàJ … ã²Zl¸z†×ïÄO�a~þ˜ ~¿¡¦2ÈH*«ÙêhA$(¡Õlù0$ŒŽÆ”sA†‡÷ÃPà!AØ ®çíÜ�îÛÝaÑv#¢‡µŸ|Y¶uÓÎÛõK3zœÝ&³Ž‰'*˜$–ǃ‡G\-�ðí#f´¨þ‡Œˆ1´Ú8eáa3¸üÓÙqÇ}ñ -Âú&Á"¦�åVˆ@tcWõ~±[¿öeJ „‰V•T�v%ûã  qŒJÅÕaÌÀ–f3¢Ž´&_çÛ×M½¿:÷L0EŠQ’u͑фÃð8gßìžýÔLj Á -)ÂDC1ìpÌRôB EB‘¤¸`ùìt¨’óÄšuþ›“hÞ,ï’!‰Ù¹÷ËIø�Änœ„/ £¡5-$! JÎkÖ9²N­ŒÁ…æÕ®€®ëOÓf}¬^—+ß!›uãûF÷ÿ²rÿvÅÆÏu�¡ MÄ8‚âvMô¶åܬëÍrß³±-‘dŠ]Üc@_ JÄ™æov¬ßO”Š´AlwC½d=v¨’_Ø“ –òÔïâË|çÒ]«Ø¿°#]�¶…=�ë3r—‹3àK4»–�UzŸöFš1SÈO@•CW0ÊÅ©ã‡Ùän:™]?ýù×ôæiú÷ÓÉýc_Y(è*-Ì岈¹²°rYäó{Yñ€/1HìZŸG«´ì’”éBðUr-à‹IøYÒO5·‚ßM¦½’Ci)Ë/Jr’XYòœÇHò¼ßNòØo^ò¿?"yžAb7’üµMy�¤�£B6~éAcBa{'Y <”.îÏUåÍ\ïñ…•�/A‘µN¸ˆÚA?µ©nê“5ЏÁªL� h¬KÔ,¦Ö¶{8¡§û¶FZ1�c7VSjI3"KjXYÎÈà¯ë™g× ³Ë+ša÷ó’æÙušÆìÜm%iPøx*¢³ôÆÒƒÆÜž@u¯¦)Ô/]ÛŽ…¡a a,¾ªH¸†AMAlŒÂB{CƒS(|-\hïê¦ÞAtþÖŽ›ÂàvDÄðàõÿøŠ²+꯬céF«×�{Hï¶Ÿ¿…kì×oÏur-³7Ë@-ÊÒwÒÁL—endstream -endobj -3444 0 obj << -/Type /Page -/Contents 3445 0 R -/Resources 3443 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3357 0 R -/Annots [ 3448 0 R 3449 0 R 3452 0 R 3453 0 R 3454 0 R 3455 0 R 3456 0 R 3457 0 R 3458 0 R ] ->> endobj -3448 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 668.6407 142.7416 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00044) >> ->> endobj -3449 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6071 668.6407 199.1894 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00045) >> ->> endobj -3452 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 584.0421 161.8301 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00086_cca775e46d4405b7775b328f7694f7e7) >> ->> endobj -3453 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 571.0907 148.62 581.4367] -/Subtype /Link -/A << /S /GoTo /D (a00143_g54a466311575a727830a92a6c3621cb2) >> ->> endobj -3454 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 557.5814 159.6884 568.4853] -/Subtype /Link -/A << /S /GoTo /D (a00143_g5eced097547fd3fac4ba2a255493d921) >> ->> endobj -3455 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 545.6062 133.6164 555.5339] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3456 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 545.6062 169.87 555.5339] -/Subtype /Link -/A << /S /GoTo /D (a00143_gd85fc90c30d1fc37c63c4844be5fe09d) >> ->> endobj -3457 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 532.6548 133.6164 542.5824] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3458 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 532.6548 154.3681 542.5824] -/Subtype /Link -/A << /S /GoTo /D (a00143_g41bf109b6a45328d5744c0a76563fb6c) >> ->> endobj -3446 0 obj << -/D [3444 0 R /XYZ 90 757.9346 null] ->> endobj -994 0 obj << -/D [3444 0 R /XYZ 90 739.9346 null] ->> endobj -218 0 obj << -/D [3444 0 R /XYZ 90 739.9346 null] ->> endobj -3447 0 obj << -/D [3444 0 R /XYZ 90 717.8172 null] ->> endobj -3450 0 obj << -/D [3444 0 R /XYZ 90 602.4342 null] ->> endobj -3451 0 obj << -/D [3444 0 R /XYZ 90 602.4342 null] ->> endobj -3443 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3461 0 obj << -/Length 1040 -/Filter /FlateDecode ->> -stream -xÚ�WmoÛ6þî_!`_`âx|g0 Ø�¶X€[ëoM(2 “åL–—öß÷(Rš")V0�)òáÝsÏ�Ž$ÿ ±4ÑRË…JòÊ&�8ýaq9Åõtøm³úé=³‰%V1•lv­D2`Éfûy­ ÀUÊ$]7ÅÁÕaø©©ÏyÆÝ§Á¬]•;œ²ŒŠ5p~ões»z·é}Gj’+ðžÿY}þB“-R¼]Q­‘É3>Pֲ䰌wåêÓê¯ÞNXh7ÌE(�χ‚à ëbd²†”¾1F -ª�h¨*ó¥n þPTyyÞF$À)9ÑÖ`-ðç[šhat´|È~Æ�b‡ˆû%Â0�X)Û01$ŽBQT… f.é¾qMV”nâ¼q§¼.žšâXEƒ|¥ÑBkç×aYH¹&~‹�&Š Ñ‚6ûâ„8PëS«ç¹ö5zÝMŸO­sœÙë0µuy™ÕEõ³°<ðƒEfѲ ë]Îpx8Ÿš€~ˆ‹'ׄÁsÑìÇ%É•!J2™(&‰Ñ2¾3~©~Œ˜�ƒÚêñépC(°¡PS»}.ï‘ЕÿaLG#\i3¢3*ðµ@B`ÁKÆõKeŽÚQ«<«ÂÄCÌ�Ï ³3’P¬¡DZJ˜âf–\J‡¨i“1–Pê©QFؖٻ¯Ùá©t§ë±c@�æ .zÄ8¼œA øz—s‡âõ¸æ)n÷ùSN&eÜ`/Q— ¦=jÉõÄšwýãÄ©àø¢k1rúzä~ÉýÄ®wï®@®C‚ÒCVTåñø”úW*Íê'’�É1ň¤°P,=j�ÒÔÚ¬"Li"°µ¾Q�¾è|dõ¢Çs3¯žWDK+.+Ò£HM­EÚ†œUÛIga”(x{±ôøS»žÇ³{ÈËÂUÍôUJøº,C�Zr?±æÝ‡s(åº3‚ýµ’íâ�»£”UE{Ĺâ_• #-Âïq~ýŽÒ�O»=™;sé˳ö&k²°ñ}áÊíiæR$±Õ@ük÷µ!`®S)"¸ÿÙñ~ï“Ó>Š»˜ä—=ö¨%¿x¼XªÔK¿yyÌÿ¾÷"Ý7ÿÊÁ@Žü¿Þ±:ü“‰]ÏäÔdõ”‚QDj¥D� OZ+A¾ša1 -/}—3ÓÃ334x!3 ~»Ì¼ðû¦Ì¼ôÿ†Ì,0™ØõLŠªqõ¿WL®³rÂÄZ¢(^n•hQبð> æ`™€ -×£ÿýµÑæÙààlx—QxFû~>&ð>-t¸`}p•«³¦»Qw]æ�npë�Žs|é5ã׌†'F© -£�Wé?HοÿÑ$¾Åkûñë·GW�ÅôŸBµ�>ß±œ ¨endstream -endobj -3460 0 obj << -/Type /Page -/Contents 3461 0 R -/Resources 3459 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3474 0 R -/Annots [ 3464 0 R 3465 0 R 3466 0 R 3467 0 R 3468 0 R 3471 0 R 3473 0 R ] ->> endobj -3464 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [367.6562 622.7225 413.364 633.6264] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) >> ->> endobj -3465 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 587.1107 139.9724 610.0795] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -3466 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.9612 587.1107 263.4979 610.0795] -/Subtype /Link -/A << /S /GoTo /D (a00042) >> ->> endobj -3467 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [266.4867 587.1107 399.7556 610.0795] -/Subtype /Link -/A << /S /GoTo /D (a00043) >> ->> endobj -3468 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [419.6211 587.1107 467.8198 610.0795] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3471 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.4252 505.6403 187.573 515.568] -/Subtype /Link -/A << /S /GoTo /D (a00087_e8eb428c05bc1dee022246a3063d277c) >> ->> endobj -3473 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.4252 492.6889 200.6041 502.6166] -/Subtype /Link -/A << /S /GoTo /D (a00087_fe557d333c06cf65f52023f45f5b0a3a) >> ->> endobj -3462 0 obj << -/D [3460 0 R /XYZ 90 757.9346 null] ->> endobj -995 0 obj << -/D [3460 0 R /XYZ 90 739.9346 null] ->> endobj -222 0 obj << -/D [3460 0 R /XYZ 90 739.9346 null] ->> endobj -3463 0 obj << -/D [3460 0 R /XYZ 90 687.0765 null] ->> endobj -3469 0 obj << -/D [3460 0 R /XYZ 90 523.614 null] ->> endobj -3470 0 obj << -/D [3460 0 R /XYZ 90 523.614 null] ->> endobj -3472 0 obj << -/D [3460 0 R /XYZ 90 509.6254 null] ->> endobj -3459 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3477 0 obj << -/Length 2106 -/Filter /FlateDecode ->> -stream -xÚ½Z]oã6}÷¯0º/PqùM±( -´�mÑAØ�æmf0Pl%V–\IÎ$ûë÷RüˆÛd g‹<„�®Î¥Î%�h‘%†?²Ôx©„Bšq¹\oxy§]×�A6üt½øû/T/5Ò’ÊåõíA$(¡ËëÍÇaü*£œ ²Úÿö/h -¼"ÛÆ»b(lë�¡Û¯‡}wEòUé:Ûõ~[6C1Tmsõùúýâ×�‰#*˜$†ÇŸ‹�Ÿñr„ß/0b:˯p€Ñš.· N™?¨,þâØŽñ‚cù -ÂŽ'L8‚3ÔgLa”MX!B¯2‚1^í«Ý—uÛ4ÓmûCy[Ú\›uirƒ r2Š0Ì4G˜;óoU³®÷‡$d‚ )�C#ðû#±RUÍ�=QXètt3¡òÕ�um7W" ö mÜ->aLËzc/®{r¸w½S>Ð_xbCëbŽÏ -JÎ%“éA2@¥šÝ(-ÉV]Yl²¶©ŸÌ!_Ý<ÙÓEãþïvuµ.uf$ch˜®ç‹Ê+"V�ërç�f�ÌÿÁ¢¹ Ôƒ"ݵ!Asðõ¾í-h·ïvm_¾ÑÚÎn³l{°ze:&gKhÂpšÀPµftLsÒ—õ»r]k³Ì ù \¢;ô-d‹éH´v]»¶j†²ëBì™ñÁ›†MSÓù“挹á2�§�k�ÅØá~Lq¼©8€“³ÔÂs3¨»}ç'…ÊÕ¶½74¾�"iwºÿÆßã-;Û¶y­íw¥élªçÙ¢psk]5.4!‚Íg’00Û©›éð|Š{^¥~© ßþÈZ$Ìz U~rÑœŽÍ¦Öœ?Ç1÷ýD©8œ¿à**XôŽ霘%!1·A�¥L²ó¸;3·U»b³é¾ ,¥@yŠ%E¢¦YÊ1"t’¥ÇÍXv–âA­Î}pù8Ö9p�NA‡³5†¥AƵF�û³]x™MÉGš°ÒbX±—æWªQa~‰I3µ*û~®àP7¶{ÛÊÅ’âyލæ*ž�K€0XÓÉiÈ ‡b$¡åKjyðb-'Øy܌ݞÈ#"f0Ý`£ôF«4=ŽÖ”$éyÜŒ^½k»CzDEÀeÇèAÍ€ûÓô\ K !r�’°‡Í$\·ë¢~aÔLß΀¦¾¶ÝìÁÍ“—q;êÚ¬„�ÕiAƒç!o£f.K�^jö°´š'/Wsœ]Pó”]BÍzç«9N/¨yJ¯;®f�¸¡Æèe‚Â,¦‚šÉ+ÕL1Ê%g)5{Ø)5¿œqÿ�ê6Z‚¿‰À™–Hå,e=,)ðiÀ‹ž`çq3vûü˜¾)˜Cpl1v¯Õ73òÂy’�ÇÍØuë‡/ÍãQO$¸äQ‚Y@¥n n3Eæ·þÈ?Ÿ’Ë ’RËוÌ)™›•L_þ¹÷5l%ì·7ÞÏ÷Þ¤u½¥y“|„w~|m -µ¶.«Æ"O[¦0Rpð65cö–r�²8–®™IÀËk&Î.ÔÌ”]¼f"ìί™8»P3Sv}³9^3ôEi”`P©[Kð f?evëXÍpH^‰W–Ì38V1u~ÁîE .úÁ_Ö ~�q¯´ýéò` "ÏñLêtyx×Ò<å™,]“€——Gœ](�)»¸gŠÑ;Û3%èyÜŒ^]î!3$e|ì2Õ†9;Ó11ÌÍqÊ1˜¡ø{ÙÜ ÷'^V7a 刢wv²7ÛqU»ïë§g}ŸÔ3Õ1JÞÆ"Q¥Í�)‹`I=O^¬ç;�›±‹ë9Fïl='èy܌޶ïõ ÎG3%—ñ<ÉóÞg©äç"egÌPüyßY]úIv[> endobj -3480 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [107.8759 622.1864 146.9492 633.0904] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -3483 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 511.2147 166.8215 522.1186] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -3484 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 511.2147 198.084 522.1186] -/Subtype /Link -/A << /S /GoTo /D (a00088_79510aa86d3fa0a0fc6cfc49b1da7279) >> ->> endobj -3486 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 472.02 138.5977 482.924] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3487 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 472.02 159.9075 482.924] -/Subtype /Link -/A << /S /GoTo /D (a00088_0cd09beee671e7e9efb0b4aced10249e) >> ->> endobj -3489 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 432.8253 138.5977 443.7293] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3490 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 432.8253 160.4555 443.7293] -/Subtype /Link -/A << /S /GoTo /D (a00088_1df6aa054ef2fa634ac4c6f418228285) >> ->> endobj -3492 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 394.1886 133.6164 404.5346] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3493 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 394.1886 166.5427 404.5346] -/Subtype /Link -/A << /S /GoTo /D (a00088_70297b3e6d4eaae7bd828cb50bd1efe3) >> ->> endobj -3495 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 354.9939 133.6164 365.34] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3496 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 354.9939 167.6585 365.34] -/Subtype /Link -/A << /S /GoTo /D (a00088_8f6b08a5ba2a8d75ca7279e2056aa8c6) >> ->> endobj -3498 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 316.2176 138.5977 326.1453] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3499 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 316.2176 153.2625 326.1453] -/Subtype /Link -/A << /S /GoTo /D (a00088_0ef3ae2764714bf90620075c374c262e) >> ->> endobj -3501 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 277.0229 138.5977 286.9506] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3502 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 277.0229 156.5899 286.9506] -/Subtype /Link -/A << /S /GoTo /D (a00088_3347ef1b6e8581402445d1a0280c7a14) >> ->> endobj -3504 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 237.8283 138.5977 247.7559] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3505 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 237.8283 179.8421 247.7559] -/Subtype /Link -/A << /S /GoTo /D (a00088_db7a3fadb68df5fdd37e8b91a2c751ea) >> ->> endobj -3507 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 198.6336 133.6164 208.5613] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3508 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 198.6336 144.4057 208.5613] -/Subtype /Link -/A << /S /GoTo /D (a00088_ef661afb3aa82f0437d2ed8d3c20be76) >> ->> endobj -3510 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 159.4389 133.6164 169.3666] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3511 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 159.4389 144.9637 169.3666] -/Subtype /Link -/A << /S /GoTo /D (a00088_eb9fcbd3c9b0a795dcd63f33c323d65c) >> ->> endobj -3513 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 120.2443 133.6164 130.1719] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3514 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 120.2443 147.1754 130.1719] -/Subtype /Link -/A << /S /GoTo /D (a00088_e3aa9cc25e45b663e6aabc54c013019e) >> ->> endobj -3478 0 obj << -/D [3476 0 R /XYZ 90 757.9346 null] ->> endobj -714 0 obj << -/D [3476 0 R /XYZ 90 739.9346 null] ->> endobj -226 0 obj << -/D [3476 0 R /XYZ 90 739.9346 null] ->> endobj -3479 0 obj << -/D [3476 0 R /XYZ 90 685.4723 null] ->> endobj -3481 0 obj << -/D [3476 0 R /XYZ 90 530.3348 null] ->> endobj -3482 0 obj << -/D [3476 0 R /XYZ 90 530.3348 null] ->> endobj -3485 0 obj << -/D [3476 0 R /XYZ 90 491.2835 null] ->> endobj -3488 0 obj << -/D [3476 0 R /XYZ 90 452.0888 null] ->> endobj -3491 0 obj << -/D [3476 0 R /XYZ 90 412.8942 null] ->> endobj -3494 0 obj << -/D [3476 0 R /XYZ 90 373.6995 null] ->> endobj -3497 0 obj << -/D [3476 0 R /XYZ 90 334.5049 null] ->> endobj -3500 0 obj << -/D [3476 0 R /XYZ 90 295.3102 null] ->> endobj -3503 0 obj << -/D [3476 0 R /XYZ 90 256.1155 null] ->> endobj -3506 0 obj << -/D [3476 0 R /XYZ 90 216.9208 null] ->> endobj -3509 0 obj << -/D [3476 0 R /XYZ 90 177.7262 null] ->> endobj -3512 0 obj << -/D [3476 0 R /XYZ 90 138.5315 null] ->> endobj -3475 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3517 0 obj << -/Length 824 -/Filter /FlateDecode ->> -stream -xÚ­—KoÚ@€ïþ>šÛ™}oŽ}E�T©M¸%QDˆ¡HÁ¤Ø¨É¿ïàõºæµ¥âÀ®wX3ú¯1ú`ê 5Ê0'¤N'‹Ò]¾L°YÒú°ðq”|øÊ]ê˜Ó\§£i½ƒF¦8òtôt›†|0ä -²õüåa², -?»©VëIåÇ×ù4_ Ðfy1Éé’Q2jp?ºJ¾ŒÚÛ7tJhÜÜüwr{éQ^%À„³*ýC`èO‰ä"Lž“›äg»�_¨p(ÉÍ2Aø”ŽV�SΆÿ+‚èA3)¬LCÔ¦wœïe„@ë\‰´³Ýîí$s دm®¬fÍÒu -‘Aë>´ÖE[Û‡jMp¦9` �3éÀô£ ÅÁö¡…°.Z5y)«q•߈ñ¬Ü£´’ ­xŒrh ã 8�PîRvcöbÈXM±n[T©%T-kTºG¨MÔuôé‡÷¹öÃqñä5ÿ!›•lßO’�vlø�3§P”ö¡jÓchÖ«hwÃw;ÚCâ¶è¢–ÆèÎÖ´‡.ÄmÑUó5±]<¥JTQ¼¡$±Œ“çøI#mho#LÔP—¶aµ¢¿/Wa²¼¢®«ÈÑr1/Ëù²iÍ>DÌŽ™JåÖŠq”öUñWg\ Ùçjëwµ³áAWå©®š^ºÖÕ.]ÜÕÝù®ÆéZW»tŪzÝW• Õ £tC)˜sVž×Jµ0L “=½´ Û2µX/IÇz¼œÆì-ýâtÙDWa‹çqÙœ4Ê| ©/ò¢½PTGû1Õ�. þO?FÁ$øæs<„õ;ÞÙðýý8N×:Þ¥Ûèèñü0~ñ�èÆ;Øôe=ÕxGÿ-y/kˆÛb Œ»„T`ry”�êd©�»3OÊY&µÂíÛ°-í øy>WmWöø$üQ]•¥³1h~’® -Émep�ʉZéw²ké-ý„Ú^÷UAÓ³NØðª@=G]§~™ùŠrlL!ïïapµI~ÝLÂKÂüŒè¦ ¸ÊB#XkfÈšÀÇ7ÿýyùú6ˋ݊*úï´N}þÕ7Ä!endstream -endobj -3516 0 obj << -/Type /Page -/Contents 3517 0 R -/Resources 3515 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3474 0 R -/Annots [ 3520 0 R 3521 0 R 3523 0 R 3524 0 R 3526 0 R 3527 0 R 3529 0 R 3530 0 R ] ->> endobj -3520 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 726.8189 133.6164 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3521 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 726.8189 185.3615 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00088_a5f58074435cdc180f17de69651beebd) >> ->> endobj -3523 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 688.9408 133.6164 698.8685] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3524 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 688.9408 157.1377 698.8685] -/Subtype /Link -/A << /S /GoTo /D (a00088_2d9732cf5752d30bd11cb25dc7d0c8d3) >> ->> endobj -3526 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 650.0865 133.6164 660.0142] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3527 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 650.0865 152.1567 660.0142] -/Subtype /Link -/A << /S /GoTo /D (a00088_4289c59840b128f2f6526e9da2711d47) >> ->> endobj -3529 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 610.256 191.1698 621.1599] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -3530 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [191.6679 610.256 226.3075 621.1599] -/Subtype /Link -/A << /S /GoTo /D (a00088_97f9e1fda815bfb8b1f4577c355ade20) >> ->> endobj -3518 0 obj << -/D [3516 0 R /XYZ 90 757.9346 null] ->> endobj -3519 0 obj << -/D [3516 0 R /XYZ 90 739.9346 null] ->> endobj -3522 0 obj << -/D [3516 0 R /XYZ 90 707.0579 null] ->> endobj -3525 0 obj << -/D [3516 0 R /XYZ 90 668.2036 null] ->> endobj -3528 0 obj << -/D [3516 0 R /XYZ 90 629.3493 null] ->> endobj -3515 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3533 0 obj << -/Length 646 -/Filter /FlateDecode ->> -stream -xÚ¥UMoÛ0 ½ûWØÅ9X%õe©vú�°µ¹µAáÆJk u:ÇÆÖ?Ê–S'õšÃ�C$‘||�¢hŒ�~[ˆ3•1+¤Ž—ÏÄ�t|a0§dOÇ_çÑÉ·±eVsÏW‚F¦8òx^Ü&(ô,åR*LÚo?h© Aýâ,oò~uÓÔí²iëšÄãfÙ>»ªÉ›rSÍó«è|¾cˆ*¡ÑóøÝ. .ˆðULX£âß´†Öòø9’\ ›utýÜáô†.`J¯B1-%£>(æT€¬œ1³ iË—{×<ÝçEQ�eöëk·r½Þjé¼>Ö£JR©¹O¬²÷SY-×m<GžJ°ÌÒ9~žÀÊX&Mˆ{š€!Æd6x} 0¤™UªÓšZdRH§B24#É ƒè3×äåÚáÝvY—/Þ8�è i±Ã¹v/µÛجúÿÐ'Ò¤e(àyóäêÊ…�/²Ûn™Oã�1cšú®>sw¼*ß`óµ.«Ðn¨$ßOécÖÁÚÕŒM•ökñÖÒ¥[Û‰ÆUÚ2àBþó…�ú† AÓù†ãóÞq®s!PWâÃŒ’Yƒ¾w:›?©ƒézÄ ©ã-h}”Ýà·Ç®5÷Í;v‚Ó ~ÈŽ3i!;ÎN(†æ(»Áo�]÷>Ù)Î Ê�k—åUŠ  w³—÷V/¦æ2”Ùäü‚D­ô�¼®Å …ÐŒGš¦&Œg+8úé6Pñd/]åê¼öð�¾‹«ª¤  O ᔋSÆ=Ðýj5ã*Ù„¡øþ»ðð:|þ¼>ºwÃßOå‰*ýZendstream -endobj -3532 0 obj << -/Type /Page -/Contents 3533 0 R -/Resources 3531 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3474 0 R -/Annots [ 3538 0 R 3539 0 R ] ->> endobj -3538 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 566.4282 133.6164 576.7743] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3539 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 566.4282 153.8105 576.7743] -/Subtype /Link -/A << /S /GoTo /D (a00089_aacd5fa1806e0f0dd0bc96dd36507ad8) >> ->> endobj -3534 0 obj << -/D [3532 0 R /XYZ 90 757.9346 null] ->> endobj -996 0 obj << -/D [3532 0 R /XYZ 90 739.9346 null] ->> endobj -230 0 obj << -/D [3532 0 R /XYZ 90 739.9346 null] ->> endobj -3535 0 obj << -/D [3532 0 R /XYZ 90 685.9318 null] ->> endobj -3536 0 obj << -/D [3532 0 R /XYZ 90 584.8203 null] ->> endobj -3537 0 obj << -/D [3532 0 R /XYZ 90 584.8203 null] ->> endobj -3531 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3542 0 obj << -/Length 729 -/Filter /FlateDecode ->> -stream -xÚ¥VËnÛ0¼ë+ô"Ärùƒ¢‡ÂIÐÚÄ·$T‹¶8²+Ëhó÷]I”C?"%0|�HÎîÎìP&!¤øƒÐÐPKM *œ>4œãôun9ÆõØ|›Ÿ¯˜ 1Š©p2k2( ’ 'Ù}¤ ˆQÌ$�¶ùúÉV‹§EV¶wU¹�Víû­�ÙrId‹©Å)ŤހëÑãä&¸œì8‚’+¨ëÿ îi˜!Ñ›€nþÅ%` ŸÁx7XwÁ¯]žv¡ 8¥S?-ÁÖ)e(\ûB�Ò)Ey˜Wy ijº®ÔMÚOy1]n3‡ð�’mÔÑ¿œÈ¥‰‰v€šUZ®Éb0ÕW— -å1R6rc‰Ú%6† ‰'›€>¶Uš/mÖ*ÛÍ´Ì×U¾*\B~ ³n¦�&ÏdaÛ¨Ëja˺n-lša»¤ŒH�£ŽM¢‰ÛJY‘75š€Ô.óÂ%T¼}®fí³ŽXÚ×=Ùô„œ’L÷¥ŽÓ*mîr»Ì6'ö¦T†PÆÅ›�h÷”ß Šžˆ×> endobj -3547 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 565.8703 168.4754 576.7743] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -3548 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 565.8703 187.0156 576.7743] -/Subtype /Link -/A << /S /GoTo /D (a00090_b684c17bf48c8e3b3fcf97b06b4c6ee1) >> ->> endobj -3550 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 552.9189 168.4754 563.8228] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -3551 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 552.9189 182.5823 563.8228] -/Subtype /Link -/A << /S /GoTo /D (a00090_1abbbe7bc5d7d033c727691528b85b8d) >> ->> endobj -3553 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 539.9675 138.5977 550.8714] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3554 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 539.9675 158.2438 550.8714] -/Subtype /Link -/A << /S /GoTo /D (a00090_c9273cc1fcdaeeddc523ca9f34977e06) >> ->> endobj -3543 0 obj << -/D [3541 0 R /XYZ 90 757.9346 null] ->> endobj -997 0 obj << -/D [3541 0 R /XYZ 90 739.9346 null] ->> endobj -234 0 obj << -/D [3541 0 R /XYZ 90 739.9346 null] ->> endobj -3544 0 obj << -/D [3541 0 R /XYZ 90 685.9318 null] ->> endobj -3545 0 obj << -/D [3541 0 R /XYZ 90 584.8203 null] ->> endobj -3546 0 obj << -/D [3541 0 R /XYZ 90 584.8203 null] ->> endobj -3549 0 obj << -/D [3541 0 R /XYZ 90 569.8554 null] ->> endobj -3552 0 obj << -/D [3541 0 R /XYZ 90 556.904 null] ->> endobj -3540 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3557 0 obj << -/Length 1344 -/Filter /FlateDecode ->> -stream -xÚ­™_sâ6Åßù~$Vuõ_ûØIw§™éL»›·lf‡‚“xJ€Ó6ß¾2–„ˆí«õÐáƒ�¯~Ò9X2‚‚º–Zjb¹PÅòuF‹g÷õ§øÓ¥;_¦‚Ÿïg?}d¶°Ä*¦Šû§SD2`ÅýêaÜÜ”L ó㯿»CIç@hwp»hÝÑ—f\6Çý ˜yåOn—Ç×jÓ,šz»¹y¼¿›ýrI<¨ä -ZŽï³‡GZ¬ðÝŒn�,þq(kYñ:Œ‡ëٗٱNwâtÁP%ðრîzÌÜè®Ãš€¼)�R:?Ö»oõòuçÞ^Vû´£Ýñçê©êz¼YVm»Ò@¬”§Òn´ÛÊÌœKðÅo«fQ¯«•¬ê°Ü×»0T®OLië´À¶«s[}¥”mê“útù­ë�}p#ÓmŸº÷öšµ?ëzF^È2Œ�³Ãëj½: ø¨À#˜ \*èÆ?íPE7â\§m÷+cò}[@Û±”mQkœé´;×~³ö§>'\à`©RYº » ;šoM�Ž3¢”Ža©ÎÓq— &Ktt¿¬{pB·ç-n–ô¢˜Ë ŽRIŒ…œ¡^•÷ó\îz;Q´èf‚†›9Ž6ÝK-Z™ 5ÛCßIE4×X);‰·QŒÚ(­p«2>FYÖÈ´àÕNfè‚î‚õ£›lf†.è.èÖÕfè‡ÉŒ°(\U¹f…%ZËwƒòÀnÛR»ëŒ›™FÓ‘°tY>H‹ÓÓ�ÓÅt¤tx:ºééÀéb:RºzW¯zt’LànEU®]É P—íŽÄCiB¹ÒãñHX<‚,¤ÅéñÀébCttÍÛ®êOõÎG¥ð±+•e§¡á:ûÜeyK“‚×[ŠÓEKS:ÜR„nº¥8]´4¥«—ÛU5´|SÆ*¯]¾�DyO•[¼³ìCV”å=M -^ï)N=Méð›9†7ùfžÁ º ¼vWhdg�P7â(c Ô«òÖJJ„Î>my™ùkƒò±6)†Y›Òe¬Eð¦[‹ãEkS¼�?áÂæ Æö~óqÔuU²ì³V”åM -^ï(NMé2Ž"xÓÅñ¢£)Þ¡ú¾é?@»Ÿ'çB£x¥ö¢’«ö>-­§Ž”TWmdŸ¢aÜ%næJ7ª±§d>œ¹ Û=kížøÝ¼qêÛ§jSíMØFûÁ¿…ƒ»�ó£ÿ̿ӌ`~ŸQªº£Óÿ‹[¿ÑÝßíÿó-lìÿûöÜßÊh÷ÚZ2Jÿ¸™·(endstream -endobj -3556 0 obj << -/Type /Page -/Contents 3557 0 R -/Resources 3555 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3474 0 R -/Annots [ 3562 0 R 3563 0 R 3565 0 R 3566 0 R 3568 0 R 3569 0 R 3571 0 R 3572 0 R 3574 0 R 3575 0 R 3577 0 R 3578 0 R 3580 0 R 3581 0 R 3583 0 R 3584 0 R 3586 0 R 3587 0 R 3589 0 R 3590 0 R 3592 0 R 3593 0 R 3595 0 R 3596 0 R 3598 0 R 3599 0 R 3601 0 R 3602 0 R 3604 0 R 3605 0 R ] ->> endobj -3562 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 616.6656 133.6164 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3563 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 616.6656 148.8392 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00091_7d472d8b3c41618d39c93c4ca92fb3f4) >> ->> endobj -3565 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 603.7142 133.6164 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3566 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 603.7142 147.7332 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00091_a3f2d9cb20290019b2743e8df31a2f8b) >> ->> endobj -3568 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 590.3444 133.6164 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3569 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 590.3444 148.2812 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00091_b15853725b233d526b291db0347d4ecd) >> ->> endobj -3571 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 576.8351 133.6164 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3572 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 576.8351 151.6087 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00091_308463cc7b3d45d2dbcdcedd4cde9bb9) >> ->> endobj -3574 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 563.8836 133.6164 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3575 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 563.8836 166.2933 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00091_4619e69ec86a47f6abe945b39ec7f63a) >> ->> endobj -3577 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 551.9085 133.6164 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3578 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 551.9085 144.4155 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00091_55be3d5413ce49c5c4f5576def12d7ec) >> ->> endobj -3580 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 537.9808 133.6164 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3581 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 537.9808 157.138 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00091_55e7764a9f6ed05aaa98076b9f6770a5) >> ->> endobj -3583 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 525.0293 138.5977 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3584 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 525.0293 179.8327 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00091_babb9c2be394477af97f79507bcb4c86) >> ->> endobj -3586 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 512.0779 138.5977 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3587 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 512.0779 178.1589 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00091_0ec6a6cbcbfd191d393738c16d54e5e1) >> ->> endobj -3589 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 499.1265 138.5977 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3590 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 499.1265 182.5922 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00091_e27f4949613fe3c1de5a839af01d99dd) >> ->> endobj -3592 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 486.175 133.6164 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3593 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 486.175 153.2625 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00091_fa0fe6ca88f692d22af70ff007411252) >> ->> endobj -3595 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 474.1999 133.6164 484.1275] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3596 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 474.1999 157.6859 484.1275] -/Subtype /Link -/A << /S /GoTo /D (a00091_266ea23d75c83f15b915ce54100e51c5) >> ->> endobj -3598 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 460.2722 138.5977 471.1761] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3599 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 460.2722 192.0068 471.1761] -/Subtype /Link -/A << /S /GoTo /D (a00091_805f8fd5533a6d4b6793e0645005da4c) >> ->> endobj -3601 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 448.297 138.5977 458.2247] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3602 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 448.297 148.8392 458.2247] -/Subtype /Link -/A << /S /GoTo /D (a00091_a6d51f3fa5da9b7f9cd37ae69600c04a) >> ->> endobj -3604 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 434.3693 138.5977 445.2732] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3605 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 434.3693 164.331 445.2732] -/Subtype /Link -/A << /S /GoTo /D (a00091_967def494c68cfc8a08d5a6c4dbbc25d) >> ->> endobj -3558 0 obj << -/D [3556 0 R /XYZ 90 757.9346 null] ->> endobj -998 0 obj << -/D [3556 0 R /XYZ 90 739.9346 null] ->> endobj -238 0 obj << -/D [3556 0 R /XYZ 90 739.9346 null] ->> endobj -3559 0 obj << -/D [3556 0 R /XYZ 90 716.7484 null] ->> endobj -3560 0 obj << -/D [3556 0 R /XYZ 90 634.6393 null] ->> endobj -3561 0 obj << -/D [3556 0 R /XYZ 90 634.6393 null] ->> endobj -3564 0 obj << -/D [3556 0 R /XYZ 90 620.6507 null] ->> endobj -3567 0 obj << -/D [3556 0 R /XYZ 90 607.6992 null] ->> endobj -3570 0 obj << -/D [3556 0 R /XYZ 90 594.3295 null] ->> endobj -3573 0 obj << -/D [3556 0 R /XYZ 90 580.8201 null] ->> endobj -3576 0 obj << -/D [3556 0 R /XYZ 90 567.8687 null] ->> endobj -3579 0 obj << -/D [3556 0 R /XYZ 90 555.8935 null] ->> endobj -3582 0 obj << -/D [3556 0 R /XYZ 90 541.9658 null] ->> endobj -3585 0 obj << -/D [3556 0 R /XYZ 90 529.0144 null] ->> endobj -3588 0 obj << -/D [3556 0 R /XYZ 90 516.063 null] ->> endobj -3591 0 obj << -/D [3556 0 R /XYZ 90 503.1115 null] ->> endobj -3594 0 obj << -/D [3556 0 R /XYZ 90 490.1601 null] ->> endobj -3597 0 obj << -/D [3556 0 R /XYZ 90 478.1849 null] ->> endobj -3600 0 obj << -/D [3556 0 R /XYZ 90 464.2572 null] ->> endobj -3603 0 obj << -/D [3556 0 R /XYZ 90 452.2821 null] ->> endobj -3555 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3608 0 obj << -/Length 526 -/Filter /FlateDecode ->> -stream -xÚ¥TMOã0½çWø˜ê�ñ·9® -ˆJ+íBo€PhÜ6RIÙ�j—¿vì”P*±ÊÁö|<¿7ž ð DKM-Š,ž2 +o¾Ì0¹'Þ?|Ÿgß.˜%–ZÅ™/{…T2dd^Ýæš¢*&LB¾«ŸW¯Ö�Ûö¡¬ª6šoºv·èâþÚ-][ É]³pÞÄ™T9r[ÜÏgÙù|Ï#Ñ”\a`ñ;»½Ryº³ (·F’?þ­eä)Œ‡Mv“ýÚãDGŸpL­D~\. -ê-lÐ˼|=–‹_ÐëEFt¤VÊÝ—;€3ó†N1áO]WÖWE¨©{Y´õsWo›ÄG¯pgq¦î€5uݧ—‰Ñ¦n\Ü ×í2®!cãöO9¤RætM?`ÏE“j3-»2æ_ÔnS½yU…†Áä‡Í7ˆ¯1–‰ ¨àF¼á„{w!„²Jþé�‚Zã[¢/XÚUr]�x¡o J�d7ĽcÚÄuëØ!‡,•¦B[ü”%£Â‚>ÍR&Öœd9Ľcy”�ÑTiÎO¼Z -šHáwVØcQà  ’ú¿¦¹oãSÐ_7šVå§“›aX‘¢Ðªué×–Ý0BÃ,ü6³e¾Kdi…3ÆÏÄH¿·eÁd¾MC¾»ú™¢i -||MsºýûºrÍa-ïf 6ªÏ?f¾? endstream -endobj -3607 0 obj << -/Type /Page -/Contents 3608 0 R -/Resources 3606 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3615 0 R -/Annots [ 3613 0 R 3614 0 R ] ->> endobj -3613 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 615.6894 168.4754 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -3614 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 615.6894 188.6695 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00092_4dc3294d67d705f7248ef57e4259424f) >> ->> endobj -3609 0 obj << -/D [3607 0 R /XYZ 90 757.9346 null] ->> endobj -999 0 obj << -/D [3607 0 R /XYZ 90 739.9346 null] ->> endobj -242 0 obj << -/D [3607 0 R /XYZ 90 739.9346 null] ->> endobj -3610 0 obj << -/D [3607 0 R /XYZ 90 716.7484 null] ->> endobj -3611 0 obj << -/D [3607 0 R /XYZ 90 634.6393 null] ->> endobj -3612 0 obj << -/D [3607 0 R /XYZ 90 634.6393 null] ->> endobj -3606 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3618 0 obj << -/Length 1936 -/Filter /FlateDecode ->> -stream -xÚ½Z]oÛ6}÷¯0°˜X~Šd1 Ø’µH�Yã>µEáØŠ-̱3¤ †ý÷]Z$CEÅÔk‘‡Èñ½¼‡<‡——7"C ?d¨ñP -‰4ãùpv;ÀÃüùõ€Ø¯3ø> ~� ^¼¢z¨‘Îi>œÜGÈ ”ÐádþaD8g”sAF‡‹KxxD®ΧûiõtµßfûÃvLÔ¨°_nf‡Ûb½ŸîËÍzüiòfðÛÄ#±@ˉÁñ×àÃ'<œà7Œ˜Vbø>`D´¦ÃÛ§Ì}X ®øqª/Žmó„µO˜p¡nÆ@V–ˆÈqF0Æ£Cy÷yøwá«çwÅMQMv=+Ìä`Ôf0÷œrvœÁyñcº.�ó­â[¿U¹¶@e´zÚXÆge¿=’ƒÚÖ»EWU(¿q^•Åj¾kÙ"WÀ;‘�û84¨d²Cpd+þ8މû‘Rñ4ÁàEk�øô·Gà½úpÀNÓ8Ïë8vÁVú§d¥r €DޤÊíÖ6_mÖæ]ÅÙg¡C ”ƸvCU›üó¾ cn°×€ÔW‚"®±Ù�= %†l'ûA:»Èùvs×@§”É*Š.óV͸‡qAžŠ=üøÀ�q?Ü^Cž« ~¾s1ÚÜݹ½x7��)ý9&xT¸dé¶Žßñn·¯¦&sÂ^EÝÄ3Š”„ôœL|à#Þ™%_r*ñq�žø䶘Ý7‰‡¤¥¨Š¢Ë¼U3nñÃŽ&�¼oÇLŽŠYQÞCâ±`B§8ĈwfÉÄ×€œJ|¤'>¹ƒÊ©I|Ž„ÊU]æ­šqÛ‰çZ"L°ìdþˆå1Ε@Xˆô:D÷f©Œ×�œÈxHgWy¿\ÛmŸ†‹JÅ—y«fäÎ%CPñugùV¦©~(ê•Õ—ÊÂÕ{N ÷F $_Yml¸e1�»Ð«b½Ø/#R�{ á"ýTbRqfÉR©9U*q�^*!Èå5¬U‹X(†Ë£"Š0óVÍØbáî^ßI*• -~´ò(Ëêéúa_Œ‰ˆe&5×›dy1y8³dyÔ€œ*�8H/�äªSæbác3oÕŒÝ!*¯“ßY «Í—d}9’?㤠búpfÉú¨9Uq�^!È›ítÑzÔ@ÅÈ�̼U3t‡<@OÌ,ÔiòØ•¦Óâ †GV&EU™ÖUr³5j˜š1¦ µëSqÂÓÏ•Ð!" o–*Œ:�…ÑÒÙÕ@Ζ mÚH)¸Ä0fÞª½]LJÄÅÿ~´8ÌŒ–E5Æîp[ýÕLÏ P•$]ä ÌTº.‡˜.œY².j@NÕE¤×Eòn»ÙoZŠÀQFfÞª»C‚!aZžß%c¬‹Òt­rÎÞ^Ž #{¾¼?·RZ»ŠurV ––(lÛó­?˜Á¿M…QD¤Q‡£V³þ#ÉÚg¡C›ÂžŽk—ÍΑiw3LžÄJE2Wæ!GšcÖÖ Ú�‘œBÂQ.Xmã›[hÎ+„aÓõfa³ÜÜ”v|µk®y‹…P¤�ŽÎ*ÕILTOÕ›õvPßÑAíÁá:¨5iT¸"iRHj - ")Ì›¥¦°:�SXHgWí ÆÐÔFÜöôEóžÓA=f�¶ÌÖ}8Qa¢å,�ÙÀ!Ƭ3Kf¶äTfã =³!Èh‹4†.h‘6âv0Ë)Ô7ä9=Ò¯¡–™Fì3š ¡CŒZg–Lm È©ÔÆAzjC�Ñ&h ]ÐmÄí –À)%±Jh‚~ ¥Ø´XÅ3òpà£Ô™%SZr*¥q�žÒäþá®h½_@j„FfÞªº�Us!Áy¤ÍÙÉ¥­¡4´MîÖž„™�ï:ôƒ¤§$Ê´dK.C‡H1èÍŽÅàì¶y BV#˜?EðdíaIµyÛâyå P¢§tVÇbÐ3’P.ÅÕ;$‰å`÷‹1„QDIgqíÊAoÖ[†>£ìÁáÊÁŽ´r�PŒ¨€9¤¦¡Ð!’†¼Yjª91 õ€tv5�Ñr0†.(q;rV®-4½4WL{æŒyÿJçˆñô.Å£y„Qk”ÊgáD6£ðœU/ZþuãÊôcí)·’mø„¼”ŸôŠÚ1·(p!Á­˜ê!¤Qiú+7CB"æm4iþ#«ƒòµiáO÷NîgoÝÃsîÖîµ$û¿¤ì%µ¯çÁ´rÛ SáÿçÖ|�ïúÁ½²÷÷âh¼¬gÞ¢sЂUúÚšã^endstream -endobj -3617 0 obj << -/Type /Page -/Contents 3618 0 R -/Resources 3616 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3615 0 R -/Annots [ 3623 0 R 3624 0 R 3625 0 R 3626 0 R 3627 0 R 3628 0 R 3629 0 R 3630 0 R 3631 0 R 3632 0 R 3633 0 R 3634 0 R 3635 0 R 3636 0 R 3637 0 R 3638 0 R 3639 0 R 3640 0 R 3641 0 R 3643 0 R 3644 0 R 3645 0 R 3646 0 R 3647 0 R 3648 0 R 3649 0 R 3650 0 R 3651 0 R 3653 0 R 3654 0 R 3655 0 R 3656 0 R ] ->> endobj -3623 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 552.2037 169.0429 566.1514] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3624 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 552.2037 189.795 566.1514] -/Subtype /Link -/A << /S /GoTo /D (a00093_5d8996950cdf3d8130cc3ad340eb9dff) >> ->> endobj -3625 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 528.2933 169.0429 542.241] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3626 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 528.2933 188.6791 542.241] -/Subtype /Link -/A << /S /GoTo /D (a00093_7f7bb2145afba5df00c6e10ddefa8ae1) >> ->> endobj -3627 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 504.383 169.0429 518.3307] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3628 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 504.383 187.5831 518.3307] -/Subtype /Link -/A << /S /GoTo /D (a00093_dc69abadd5aa07c7d74f9292db2cd93c) >> ->> endobj -3629 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 480.4727 169.0429 494.4204] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3630 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 480.4727 195.3241 494.4204] -/Subtype /Link -/A << /S /GoTo /D (a00093_b93e351c3abba0c700b26b7b07e9527d) >> ->> endobj -3631 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 456.5623 169.0429 470.51] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3632 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 456.5623 204.7288 470.51] -/Subtype /Link -/A << /S /GoTo /D (a00093_0c816f34c0187f2154c91a18d3ad87c8) >> ->> endobj -3633 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 432.652 169.0429 446.5997] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3634 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 432.652 202.517 446.5997] -/Subtype /Link -/A << /S /GoTo /D (a00093_6157452bdc9921f44b2e22e4b5969258) >> ->> endobj -3635 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 408.7417 169.0429 422.6894] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3636 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 408.7417 198.6317 422.6894] -/Subtype /Link -/A << /S /GoTo /D (a00093_8082509468b2ac80ed7746aa1a5bc4f7) >> ->> endobj -3637 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 384.8313 169.0429 398.779] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3638 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 384.8313 196.8783 398.779] -/Subtype /Link -/A << /S /GoTo /D (a00093_7675e6b9adbddbd545d3aac8ca092fbb) >> ->> endobj -3639 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 360.921 169.0429 374.8687] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3640 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 360.921 203.6229 374.8687] -/Subtype /Link -/A << /S /GoTo /D (a00093_b4622e2599ff3a592db09219b2641682) >> ->> endobj -3641 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.183 337.0107 130.9264 350.9584] -/Subtype /Link -/A << /S /GoTo /D (a00093_1deb2899508216804823498a69378118) >> ->> endobj -3643 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 274.1638 169.0429 288.1115] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3644 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 274.1638 189.795 288.1115] -/Subtype /Link -/A << /S /GoTo /D (a00093_5d8996950cdf3d8130cc3ad340eb9dff) >> ->> endobj -3645 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 250.2534 169.0429 264.2011] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3646 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 250.2534 188.6791 264.2011] -/Subtype /Link -/A << /S /GoTo /D (a00093_7f7bb2145afba5df00c6e10ddefa8ae1) >> ->> endobj -3647 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 226.3431 169.0429 240.2908] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3648 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 226.3431 187.5831 240.2908] -/Subtype /Link -/A << /S /GoTo /D (a00093_dc69abadd5aa07c7d74f9292db2cd93c) >> ->> endobj -3649 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 202.4328 169.0429 216.3805] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3650 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 202.4328 199.7475 216.3805] -/Subtype /Link -/A << /S /GoTo /D (a00093_8da121d6e50992ec55778f9b2141552d) >> ->> endobj -3651 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.183 178.5224 143.1005 192.4701] -/Subtype /Link -/A << /S /GoTo /D (a00093_3983b45977630418d3038231aa8b68ed) >> ->> endobj -3653 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 115.6755 169.0429 129.6232] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3654 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 115.6755 189.795 129.6232] -/Subtype /Link -/A << /S /GoTo /D (a00093_5d8996950cdf3d8130cc3ad340eb9dff) >> ->> endobj -3655 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 91.7652 169.0429 105.7129] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3656 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 91.7652 188.6791 105.7129] -/Subtype /Link -/A << /S /GoTo /D (a00093_7f7bb2145afba5df00c6e10ddefa8ae1) >> ->> endobj -3619 0 obj << -/D [3617 0 R /XYZ 90 757.9346 null] ->> endobj -1000 0 obj << -/D [3617 0 R /XYZ 90 739.9346 null] ->> endobj -246 0 obj << -/D [3617 0 R /XYZ 90 739.9346 null] ->> endobj -3620 0 obj << -/D [3617 0 R /XYZ 90 685.8208 null] ->> endobj -3621 0 obj << -/D [3617 0 R /XYZ 90 584.5797 null] ->> endobj -3622 0 obj << -/D [3617 0 R /XYZ 90 584.5797 null] ->> endobj -3642 0 obj << -/D [3617 0 R /XYZ 90 306.6831 null] ->> endobj -3652 0 obj << -/D [3617 0 R /XYZ 90 148.1949 null] ->> endobj -3616 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3669 0 obj << -/Length 1396 -/Filter /FlateDecode ->> -stream -xÚ­™]oÛ6†ïý+tiÇï�ÞmíV,Ê-ñ.†¶(YqŒÆv&ÉIƒaÿ}G¦ÄP–D3ñà QÒKñߣ£#š$~$18QB!øL²Í'+8ü~BšÓ)œO}Á�óÉ÷?S“d$•ÉüæpI� „&óåÇ©BDÍR*ðt¿¾ÿRV‹ª´»WU±Ï*Û¾ÌoòbFô4ßf9R -Ó)ádöy~1ùiîÆoð“¤ýïÉÇÏ8YæÅ#f´Ha#b M6NY»s7¹šüá®cO: Ý¥ là6ön“0Ž4#&Q*{¯ö›k¸�Ã-ín춘15ͳõC¾´æo·�2Ÿq<]mòmU¢ã;%®/ KÑ©-h}ªX5šKÙéS¿ƒµ‡ùܽëÖàΚ/UD‚ŽKyÒ�1ЏÁ -š' ïÔiÈV×�,a¢ztZ"¡A¢K�ª?X",‰uõÀò;¥áˆ`)¢íô;ìt²X;» gÚy²Õu ³Û¯3‚§yQô�@ZSdL�ª?ú°©RSDêG{ÌÔA+í‘Çuuk[ »¹^4�s6#bz›g3Ч_Ëý&`½ªs‘Í\qÖ{BÖ·²hë; çZ†tÖû�‹,d=£œS§ê�>b½Ðˆrlþ_ë˜1<}û«ÝÙÚ«B¦�àQ-⓹ß!­,:: ç†@Ò…€Y”¹ÃÈFáR§ê;â=4ÃòÔ:¯ä‡uï5}y5·�OX`«-ó -vÈ‹ò>¥ˆ)Áã�÷:„œoeÑÎw@Îu> éœ÷!‹ÃDÛ¬ûŒF"L­¤?îˆõb…bvÂúª¨‰Û˜ªW–iÂhÄ¥ˆOî~‡€¿NëoäLO@¶ºdù´]»ûc@Š)’ *¯`êTý¡‡-ui‡Íxf_3.¦»ûûÖØ«¿>4™}¹Ïm£ÚµÛ¦qsˆÑÇæ ¿Ûnó¬Zï¶íaÑ4‹»õâúî ĆâHŸõý¡ØheѱÑ976Â�.6|Hˆ�¡Äoê ­T�/uªþÈ#¡!)ÆŒ'þçH¸Ù5§²»]ÙÊý®¨ÊïšÈ(Ö«ºdYÙºe½]uJ‚ú¡¸ �£‰nd¨€ #!ì—â¿ý`�âTÕ¦ -Œ$ç§_�>õ; Ëñuë᫬÷|ÖÓÆGÇÏ'|Î" !‘6¦ó÷à–)CŠÃx†i@”Ü"„•�ÌÐÊjÄçü A½.«u6�}›¡HiÉÃ4 h� |tyŠ ˆŸ±Oø0äLó¤UÕ¨Ÿ(}´ÆvïrÇhÖÆJ‚pd0<Ï>Dé-§ü3šŠ¸VH×s›Šü�Täd±©¨ rf*:Ùê:�Cï(¢5‚ó:H—:UÜáDÄ•[¹ŒGýùîEÅ— F5ñ‹ -~‡�«­,ÚÕȹ®†!�«>d‘g}W‚o¤K�ª?‚"L8‹_ù{©«#,L|Iéw¹ÚÊ¢]퀜ëjÒ¹êCWþBtÞÊ_oÜW©Fóˆ…¿—ºI$"\¿ ózBn¶²h7; 纆tnú� !Foá¯7úˆ§˜CÕÂÆóï •¯Zø;³øc†"Ê´ˆ.þü�âÏÉA²(þ 8¢Œõ• m‹?Wü1) n7§Š?'«Ÿ 9]ü1…«ÆqÅÕ î�V;D -yÖ?K‡RC¨ÿ™DF1ÝþAF l•�Ç÷ù6/nÙa·µÛßÚÆEfûf‡Ðf‹ßPö†b»G1–ÍwÌŒBÑD÷þ—f j„×Ovûn÷íi•o�g´^oѼùù“Àzendstream -endobj -3668 0 obj << -/Type /Page -/Contents 3669 0 R -/Resources 3667 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3615 0 R -/Annots [ 3671 0 R 3672 0 R 3673 0 R 3674 0 R 3675 0 R 3676 0 R 3677 0 R 3678 0 R 3679 0 R 3680 0 R 3681 0 R 3682 0 R 3683 0 R 3684 0 R 3685 0 R 3687 0 R 3688 0 R 3689 0 R 3690 0 R 3691 0 R 3692 0 R 3693 0 R 3694 0 R 3695 0 R ] ->> endobj -3671 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 713.4339 169.0429 727.3816] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3672 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 713.4339 187.5831 727.3816] -/Subtype /Link -/A << /S /GoTo /D (a00093_dc69abadd5aa07c7d74f9292db2cd93c) >> ->> endobj -3673 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 689.5236 169.0429 703.4713] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3674 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 689.5236 196.8783 703.4713] -/Subtype /Link -/A << /S /GoTo /D (a00093_7675e6b9adbddbd545d3aac8ca092fbb) >> ->> endobj -3675 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 665.6133 169.0429 679.561] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3676 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 665.6133 196.3204 679.561] -/Subtype /Link -/A << /S /GoTo /D (a00093_7a58d95f7f7827789ff52500e3d16c34) >> ->> endobj -3677 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 641.7029 169.0429 655.6506] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3678 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 641.7029 181.4959 655.6506] -/Subtype /Link -/A << /S /GoTo /D (a00093_b6e9a75167bdddd561373bc5b6ef501c) >> ->> endobj -3679 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 617.7926 169.0429 631.7403] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3680 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 617.7926 197.3963 631.7403] -/Subtype /Link -/A << /S /GoTo /D (a00093_3ad48284f7a91f78bb24096aad89056e) >> ->> endobj -3681 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 593.8823 169.0429 607.83] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3682 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 593.8823 203.633 607.83] -/Subtype /Link -/A << /S /GoTo /D (a00093_494ea6767a8a8fab7abe96b799d6c3b3) >> ->> endobj -3683 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 569.9719 169.0429 583.9196] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3684 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 569.9719 195.3339 583.9196] -/Subtype /Link -/A << /S /GoTo /D (a00093_e9205a565ea3c911a785fc4e87c91a58) >> ->> endobj -3685 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.183 546.0616 135.3497 560.0093] -/Subtype /Link -/A << /S /GoTo /D (a00093_e292b8977f6b81265bf14e1676face3e) >> ->> endobj -3687 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 483.297 169.0429 497.2446] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3688 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 483.297 189.795 497.2446] -/Subtype /Link -/A << /S /GoTo /D (a00093_5d8996950cdf3d8130cc3ad340eb9dff) >> ->> endobj -3689 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 459.3866 169.0429 473.3343] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3690 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 459.3866 188.6791 473.3343] -/Subtype /Link -/A << /S /GoTo /D (a00093_7f7bb2145afba5df00c6e10ddefa8ae1) >> ->> endobj -3691 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 435.4763 169.0429 449.424] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3692 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 435.4763 187.5831 449.424] -/Subtype /Link -/A << /S /GoTo /D (a00093_dc69abadd5aa07c7d74f9292db2cd93c) >> ->> endobj -3693 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [123.873 411.5659 169.0429 425.5136] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -3694 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.541 411.5659 196.8783 425.5136] -/Subtype /Link -/A << /S /GoTo /D (a00093_7675e6b9adbddbd545d3aac8ca092fbb) >> ->> endobj -3695 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.183 387.6556 138.1195 401.6033] -/Subtype /Link -/A << /S /GoTo /D (a00093_4f39f0fe6a820d260fe6cddf9ccaa832) >> ->> endobj -3670 0 obj << -/D [3668 0 R /XYZ 90 757.9346 null] ->> endobj -3686 0 obj << -/D [3668 0 R /XYZ 90 515.7752 null] ->> endobj -3667 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3703 0 obj << -/Length 1646 -/Filter /FlateDecode ->> -stream -xÚ­š_oÛ6Åßý)üè<ˆãåöqèZ¬À€­Í[ž­$FÛµåuýö£l‘¡béÞ -4²uÄûÏ‘DZ„)ÿ`êùÔj˼TfºxžðécøúýºÝUØ_å‚_o'¿¼~ê™7ÂLoN-`Z€˜Þ.ïf ÄM%”Ò0;þþgØÔ|ŒŸ7ÞΛùyëS³?.šãþܬîvnÇçzÓÌ›ÕvssûaòÛm"é@µ4Ðr|›ÜÝóé2˜p&½ÓÓïágམ>O”�ñÃzòiòWjç¼ãtÀÐùj�Ã' Š…oDœÿ¶Ç¬»½áÄØA–*pv�ñbð»U½^l4ᤜz4o¹àÜýù¹7LI§^Úië~B¿®¼íK-ÑŠŠy<çç}í7ûÇn×ÇŒ ‚ÿžCÒE]�îè¾4tR0#8 t‚)Ï-M'5àŽ¤‹ºÝ?Oë 8eÛý7Kw¢ -DÈ ŽrÍœÊÐNEûùÒÜõv¢hÉÍ 7s­ÜK-Y™¡5ÛÃ¥“†Yi1°JŸ%��jÔFíƒ@zCø˜d¤‘yƒW;IÐE]�õ£+6“ ‹ºÝºÞ ]˜Â)�ÂUIE•UžY«_uÊ�¸¸mkŽsáÉ4šŽL€¥#Êèt ËÓ�Ó¥tätx:ºòtàt)9Ýj·Z^ÐiÎ …»•TT]-p ýº#ñ0–qiìx<2�(£ã�T,�N—â‘Óáñ@èÊã�Ó¥xät«]È ={8Ô—”F3á-NY%U?ìµÎ¾ª?­wÁ½Ñ˜d,&QFÇ©Xœ.Å$§Ãc‚ЕǧK1Ééšf`ð'™�w]¥;=jPÀ@JO9e´£Yƒ×;ŠÓ%Gs:ÜQ„®ÜQœ.9šÓíöÛf{ù`0 X¯2�ˆÐk&¦N(ÊÓ(£=ͼÞSœ.yšÓÁ ™j™á P¼Ÿ5Uqƽ/êzx«Ýâéëáø|AhÃüLœ°r�ˆ¾V!Üò%5Q‹*ÚÕ—æ®7EKžfh„¥ãl厢lÉÐŒí°_¬vóåri¨eЉðUIDTÃ6£¥ìUy.sÁ„õã?æ,QFg©Xœ.¥#§#â�à•çÇKÉñ–õ¡‰ˆ¦½ö¸iIEUwíCþuç §D9Ϥp0š’\€¤$ÉÈ”`‹SBÐE]�O †Wœ/êzxá>²ÛîøaH®n˜=kȇ‚²†IKÎÜ’Œ65kðzSqºdjNG˜Šà•›Šã%Ss¼öÒtÕ -ð¬\'¢}5a/È©V’Ѿf ^ï+N—|ÍéÐ�9FW<0'袮Gw¨¿mæŽI-ŠW%UØp攂~á;5x3ל)+Ýx>2–�(£ó�T,ÏN—ò‘Óáù@èÊó�Ó¥|ätóÅ×á|øÓ] ³+©¨Â˜<ÝoòÂ#ù÷C-rÿÈX>¢ŒÎR±<8]ÊGN‡ç¡+ÏN—ò‘Ó5 ô'=Ϭà·Ív"úÙ Ó–Çu*ÚÙ—æ®7EK¾fh¸­ãh客hÉÔ¼×8—óÇË·vZ2�v[eN -ÚHf€œ·u²Ÿx™ž”ÿ‹—Yc˜™9î&BWn'N—üÌé¾o^Ê„‰•1 -…«’Š*«U¶Û~ÕáéšôŽƒL×rŽ$#Ã�U,Au=:|d�á�ì ¼¨ëá…[øÈïxN2¡½#<ëDäU/�fÈ)[’ÑÆf ^o,N—ŒÍéЫ£+¾ê º¨ëÓ�–u=î†îãíK °Š"ª²ÖÌ8ùª_F®ü0S´F�¿¬ÏX@¢ŒR±< 8] -HN‡¡+N—’ÓmwͲ]w1jSL)®pÃ’Š*mLôK�î-0Pvð§Cš£ÍUë,O)sá�àA¾Ž2ž¦S)Â�í’ʈÒ¾¯7õ~ÞÄeŽq½âqãà èÙ±û¢ûËßùFtkLçÝJÆÓ`yÛ-ļ\Œú÷�¸îôß�—KmÚ¥ ½ô•“âÊendstream -endobj -3702 0 obj << -/Type /Page -/Contents 3703 0 R -/Resources 3701 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3615 0 R -/Annots [ 3708 0 R 3709 0 R 3711 0 R 3712 0 R 3714 0 R 3715 0 R 3717 0 R 3718 0 R 3720 0 R 3721 0 R 3723 0 R 3724 0 R 3726 0 R 3727 0 R 3729 0 R 3730 0 R 3732 0 R 3733 0 R 3735 0 R 3736 0 R 3738 0 R 3739 0 R 3741 0 R 3742 0 R 3744 0 R 3745 0 R 3747 0 R 3748 0 R 3750 0 R 3751 0 R 3753 0 R 3754 0 R 3756 0 R 3757 0 R 3759 0 R 3760 0 R 3762 0 R 3763 0 R 3765 0 R 3766 0 R ] ->> endobj -3708 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 616.6656 133.6164 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3709 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 616.6656 148.8392 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00094_e1e60d56ea87dfa09230e25ca5ecf2fc) >> ->> endobj -3711 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 603.7142 133.6164 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3712 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 603.7142 147.7332 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00094_8cf0ca17b115ff2e3071b3fabcc43b53) >> ->> endobj -3714 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 590.3444 133.6164 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3715 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 590.3444 148.2812 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00094_e57281f5bef284bc9545834ef8ed4a96) >> ->> endobj -3717 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 576.8351 133.6164 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3718 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 576.8351 151.6087 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00094_7a59f0dad059786238d8ab604630e7f3) >> ->> endobj -3720 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 563.8836 133.6164 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3721 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 563.8836 166.2933 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00094_85d7f35662f7be20cd84e789a290dd4b) >> ->> endobj -3723 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 551.9085 133.6164 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3724 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 551.9085 144.4155 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00094_0f27e16ddcf7199d514968204966f559) >> ->> endobj -3726 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 537.9808 133.6164 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3727 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 537.9808 157.138 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00094_e45b31a0a277dd5325ad2a332358b21b) >> ->> endobj -3729 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 525.0293 138.5977 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3730 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 525.0293 179.8327 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00094_af7a8a5310ad945de38f5b3ac755ae7d) >> ->> endobj -3732 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 512.0779 138.5977 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3733 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 512.0779 178.1589 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00094_c8f124419a231f38bb6cdf5041757a27) >> ->> endobj -3735 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 499.1265 138.5977 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3736 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 499.1265 182.5922 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00094_8d4e08d051b35b1c710c3be5b8bbfa05) >> ->> endobj -3738 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 486.175 138.5977 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3739 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 486.175 168.7542 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00094_a81fff4836049cb3c018304d77337554) >> ->> endobj -3741 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 473.2236 138.5977 484.1275] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3742 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 473.2236 173.1875 484.1275] -/Subtype /Link -/A << /S /GoTo /D (a00094_025ffa46b799fa6952719c499a3ae17c) >> ->> endobj -3744 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 460.2722 133.6164 471.1761] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3745 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 460.2722 159.3497 471.1761] -/Subtype /Link -/A << /S /GoTo /D (a00094_2541fae506eb111ff1be2372e0919839) >> ->> endobj -3747 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 447.8787 133.6164 458.2247] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3748 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 447.8787 159.8977 458.2247] -/Subtype /Link -/A << /S /GoTo /D (a00094_71721395f1c7c42b8bcc111b339bea7c) >> ->> endobj -3750 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 434.3693 133.6164 445.2732] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3751 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 434.3693 170.7167 445.2732] -/Subtype /Link -/A << /S /GoTo /D (a00094_6af8a59d0ab8967aacea749d6e59ac90) >> ->> endobj -3753 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 421.4179 133.6164 432.3218] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3754 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 421.4179 154.9262 432.3218] -/Subtype /Link -/A << /S /GoTo /D (a00094_619d9755a5d4aaabdb2e5e6ea4c1e0bf) >> ->> endobj -3756 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 409.0244 133.6164 419.3704] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3757 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 409.0244 153.2627 419.3704] -/Subtype /Link -/A << /S /GoTo /D (a00094_7f0ab3fe3bcf1e3ed9f5950cb4474ec1) >> ->> endobj -3759 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 395.515 138.5977 406.419] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3760 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 395.515 184.256 406.419] -/Subtype /Link -/A << /S /GoTo /D (a00094_f4a1d8cfbe270393a2de02b0c743e474) >> ->> endobj -3762 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 382.5636 133.6164 393.4675] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3763 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 382.5636 154.1892 393.4675] -/Subtype /Link -/A << /S /GoTo /D (a00094_dc7001682017599549f57771f4cd1b9a) >> ->> endobj -3765 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 369.6122 133.6164 380.5161] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3766 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 369.6122 165.4367 380.5161] -/Subtype /Link -/A << /S /GoTo /D (a00094_dde3cf9a57445814d01b3c67da08afdb) >> ->> endobj -3704 0 obj << -/D [3702 0 R /XYZ 90 757.9346 null] ->> endobj -1001 0 obj << -/D [3702 0 R /XYZ 90 739.9346 null] ->> endobj -250 0 obj << -/D [3702 0 R /XYZ 90 739.9346 null] ->> endobj -3705 0 obj << -/D [3702 0 R /XYZ 90 716.7484 null] ->> endobj -3706 0 obj << -/D [3702 0 R /XYZ 90 634.6393 null] ->> endobj -3707 0 obj << -/D [3702 0 R /XYZ 90 634.6393 null] ->> endobj -3710 0 obj << -/D [3702 0 R /XYZ 90 620.6507 null] ->> endobj -3713 0 obj << -/D [3702 0 R /XYZ 90 607.6992 null] ->> endobj -3716 0 obj << -/D [3702 0 R /XYZ 90 594.3295 null] ->> endobj -3719 0 obj << -/D [3702 0 R /XYZ 90 580.8201 null] ->> endobj -3722 0 obj << -/D [3702 0 R /XYZ 90 567.8687 null] ->> endobj -3725 0 obj << -/D [3702 0 R /XYZ 90 555.8935 null] ->> endobj -3728 0 obj << -/D [3702 0 R /XYZ 90 541.9658 null] ->> endobj -3731 0 obj << -/D [3702 0 R /XYZ 90 529.0144 null] ->> endobj -3734 0 obj << -/D [3702 0 R /XYZ 90 516.063 null] ->> endobj -3737 0 obj << -/D [3702 0 R /XYZ 90 503.1115 null] ->> endobj -3740 0 obj << -/D [3702 0 R /XYZ 90 490.1601 null] ->> endobj -3743 0 obj << -/D [3702 0 R /XYZ 90 477.2087 null] ->> endobj -3746 0 obj << -/D [3702 0 R /XYZ 90 464.2572 null] ->> endobj -3749 0 obj << -/D [3702 0 R /XYZ 90 451.8637 null] ->> endobj -3752 0 obj << -/D [3702 0 R /XYZ 90 438.3544 null] ->> endobj -3755 0 obj << -/D [3702 0 R /XYZ 90 425.4029 null] ->> endobj -3758 0 obj << -/D [3702 0 R /XYZ 90 413.0094 null] ->> endobj -3761 0 obj << -/D [3702 0 R /XYZ 90 399.5001 null] ->> endobj -3764 0 obj << -/D [3702 0 R /XYZ 90 386.5486 null] ->> endobj -3701 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3769 0 obj << -/Length 1274 -/Filter /FlateDecode ->> -stream -xÚµ˜]oÛ6†ïý+ìÆfŽ‡ß †] i‹°¥ÞU[®Ì$ÂdÙ³å~üûJ”"YŠX/|aJzuøêá'$�Xšh©‰åB%évF“¼ýfáñŸ/»‚_W³Ÿ^3›XbSÉ꾊 €H,YmÞÍ5»X2Iç§lwÚìïÒ]QÔwÞ–‡SZÖå[wï 0sW¤ÎߌÍAðŇÕÍìÕªµJ®ÀøgöîM6èôfF ·F&Ÿñ‚b­–%Û™`¼¹Ègog¶qêÕ c‰Jà㙂 x‡5©2Ì\w3J/KóÃÀªÓ„ØÆÌW,u÷‡¬HóÓ&(:Jɉ¶©„?�ÄÒD £ƒm‘Ç‘0˜„1ÚÕ/! æ -ÄJY庴@6YrAÀtR&’¾vå:ËݦNòÚÓC¶/³]âñ³}CZ¨âܺýÁ]Q®+}`w_ÿ¯=¿ýQþº߸.õ/�sHŒ$M&ŠjḬ̀ÑO܈–]Õhc ¥caªFp^~õe½Ýçîxu^3PF4g0Yµ Ö€ÀbõÌß9<„G·ƒ€!4p9æ°Û˜­®•y‹›ÇtŸÖŸ»g�$VM\¶ªXÕƒh¾ê×+6ƒÚ%†‹óÚŸo‚Fó1ˆë} S»üÓBÉ9IN<ÐÈót3Q¬öóX¾ò -JÿC&‰´BVÏ®Ý{JY‘=ѾcCž®.Úï þ�ܵƒ)y$c=•ö»èõº =èuæòÍqd<•hM�ÏŽø]Á~ -‡#žâøzß3&‡�ßb’OÖXuï8[ªTÔ]£ë¹ót¶_o6‡»rȨ$&æ’�Qã.•!¤�ºlt=—‡Úâ]M¨ÑfúÙª­ zÀÜvECБ\ÀY ç=Š™é§)OÒ»¸R¢²‰3Å'ieÞæê1@Ù Ñ•i®çîxì\6ÊúñvW†ë½ó3"Àœ ™©� kqÒÇáz2��0ì@ £ˆô=dèVºðÅ@GÜ5ºž»¨’¹&Š‚˜´W‘¬ãö%Ôâij×èzöòýî0´'‘,Àuâ”=$—0–]ȱÐ@”Ÿ­§9ne=Žó]ºÎ˜ÞwU*NÛ�iUΨ]¸òóîðw}ññkCó®Â{E'-e„ø>H í6†t#‹#Ý ør¤§ÝµHwÝE�ž°w9ÒÓöZ¤»öãH["$Ò:eçÂü®áB¤9.-��T= ÃíÿI5\ŠQø>TSCp¦S1ªYœêNÀ—S=í®¥ºëîdÆ fD1l²)wß -5—€š¨»F×sW–ùÀœàD€�nº%W„É ‘ö¯YîwØzj›´²zñ|¿>å�ß2Ûºe¹[æÙ'·ù,–�pƒ¬i\Ź„8˜\ã˜À�€ÙÊ¢`vþ×ýb œŽºkÀì¹kÎ,Öûý÷ánSËü·�öú­˜ZéÏ¢Vƒ¬ç´qxî�1ƒëb˜´‡–â¢ÈKI•ƒS#µ‘õÆ_tœgiçp£ö?Í«À]ë#ø<¯L{ºùè|C±AqS£_t^VQoðè,ªp~S¾ZÓ‡vo\á˜e8j2ÿ½)ÜøôOE³Ù ÿôŠñ+6¾ŒRU—îLú ¨„6“T8tÚ}ùúàŠó6õ‡y�µNûü ‹Šøendstream -endobj -3768 0 obj << -/Type /Page -/Contents 3769 0 R -/Resources 3767 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3615 0 R -/Annots [ 3772 0 R 3773 0 R 3776 0 R 3777 0 R 3779 0 R 3780 0 R 3782 0 R 3783 0 R 3785 0 R 3786 0 R 3788 0 R 3789 0 R ] ->> endobj -3772 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 604.7351 139.9724 627.7038] -/Subtype /Link -/A << /S /GoTo /D (a00049) >> ->> endobj -3773 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.8378 604.7351 192.4453 627.7038] -/Subtype /Link -/A << /S /GoTo /D (a00046) >> ->> endobj -3776 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 522.2884 166.8215 533.1924] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -3777 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 522.2884 198.084 533.1924] -/Subtype /Link -/A << /S /GoTo /D (a00095_8a661a2d544100b82d0d14a1985083d5) >> ->> endobj -3779 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 483.4341 138.5977 494.3381] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3780 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 483.4341 159.9075 494.3381] -/Subtype /Link -/A << /S /GoTo /D (a00095_981392e295db4d024eea95805c51c371) >> ->> endobj -3782 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 444.5798 138.5977 455.4838] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3783 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 444.5798 160.4555 455.4838] -/Subtype /Link -/A << /S /GoTo /D (a00095_280a0c2a93544e597f92bbacf36ee1dc) >> ->> endobj -3785 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 406.7018 133.6164 416.6295] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3786 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 406.7018 144.4155 416.6295] -/Subtype /Link -/A << /S /GoTo /D (a00095_4da1d7815516cd2b5bda3a66fdf05198) >> ->> endobj -3788 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 366.8712 193.9395 377.7752] -/Subtype /Link -/A << /S /GoTo /D (a00153_ga92afb113e122f860392bfbd385f842e) >> ->> endobj -3789 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.4377 366.8712 229.0773 377.7752] -/Subtype /Link -/A << /S /GoTo /D (a00095_c8afa29e0aa5e789d6929b366d98ba56) >> ->> endobj -3770 0 obj << -/D [3768 0 R /XYZ 90 757.9346 null] ->> endobj -1002 0 obj << -/D [3768 0 R /XYZ 90 739.9346 null] ->> endobj -254 0 obj << -/D [3768 0 R /XYZ 90 739.9346 null] ->> endobj -3771 0 obj << -/D [3768 0 R /XYZ 90 685.9318 null] ->> endobj -3774 0 obj << -/D [3768 0 R /XYZ 90 541.2384 null] ->> endobj -3775 0 obj << -/D [3768 0 R /XYZ 90 541.2384 null] ->> endobj -3778 0 obj << -/D [3768 0 R /XYZ 90 502.5274 null] ->> endobj -3781 0 obj << -/D [3768 0 R /XYZ 90 463.6732 null] ->> endobj -3784 0 obj << -/D [3768 0 R /XYZ 90 424.8189 null] ->> endobj -3787 0 obj << -/D [3768 0 R /XYZ 90 385.9646 null] ->> endobj -3767 0 obj << -/Font << /F29 499 0 R /F26 485 0 R /F11 705 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3792 0 obj << -/Length 1294 -/Filter /FlateDecode ->> -stream -xÚ­™_oÛ6Åßý)ôè<ˆãåöqÈZ¬À€­Í[®¥$ÂÛ³åmýö£,’¡b鲂‡�l]þÈs$Q&ÔýƒÂÒBKM,ªX¿,hñä¾þ°ß\ºö2ü|·øé=³…%V1UÜ=ž+( ’+îªû%qS2!$,O¿þî%]¡ýÁíª]õGŸÛÃiÝž7`–µoÜ­O/õ¶]µÍn{óp÷qñË]$ñ ’+è8þZÜ?ТrÀ”pkdñ�û@ XËŠ—…`<|Ø,>/þˆuú†ó cã•ÀÇ ‚¸oX1s ûkÂÜè€Rº<5û¯§jïþ®é8ûãOõcÝx»®»ö•�X)Ï•Ýdw…™y­LÀ×¾­ÛU³©+?Wõq}höa¦\!žxÒÕéxm_ç¶þB)Û6gõùô•'Ú4[?ù ”÷h÷ØÿíÎÙøV70òL&�¹ `üd¼ü¾©7ÕqÄF†ÁädÞRA?ý騀*"¸¯uº~¿0&ßö´›KÉѱÆyNû¶î›Ã“oú”p�óßR¥²tA7 ;™¯ígD1 -(#ÂR�§ã’P“¥ ºÝßÏ› 8¡»v‹›%½¨æòˆ£Tc!g¨Wåý|-w½�(Zt3AÃÍœF›ï%Š­LÐÚÝñÒIE4×X){‰·QLÚ(­p«2>FYÖÈ´àÕNfè‚n@‡z‰ÑÍ63CtºM½»0™…+£*×­°DkùfRîÙÃÈm[jwžqO¦Ét$,A–OÒãütàt1)ž„n~:pº˜Ž”®Ù7Õ�¤D¸[Q•ëWr”ð߉x(M(Wz:‰‹G�åã�ô8?8]ŒGJ‡Ç¡›œ.Æ#¥kön!ÇäòñX_R*I˜Õ8eU¹þ]«6úMÿ1‘‚PãÜ›ŒI"Àbdù˜ =Î� Nc’Òá1AèæÇ§‹1IéÚvdñlj‹O])½(¿j@€s›s4ÈòŽ&¯w§‹Ž¦t¸£Ý|GqºèhJ·?ìÚÝåƒA Q¼RyQvA/™qï|Lä< ²¼§IÁë=Å颧)Ý Ô˜©š( -ÅûQS%Ô2ÈâݯٯŸÿ<ž^.µ{?ã -',�å¯Up·|ž{Q ª¼«¯å®7E‹ž&hK§Ùæ;вEC¶ãaÝìWUu¸4TèÎDøÊ(Êôì–mJr>èyâ¹LaÚNÿ˜ -°hY>H�óÃ�ÓÅt¤t™x xóó�ãÅ€¤xU}l'"b€H+-nZTåz7ÝCþí䌧DK830™’T€¤$ʲ)Ázœ�’ ]Ð èð”`x³S’Á ºž»�ìw‡‘¾[’Kƒ¦{Mö¡ ´"\gßÜ¢,ojRðzSqºhjJ—1Á›o*ŽMMñºKÔUÍXÀ'°4^”÷U¹%<˾jEYÞפàõ¾âtÑ×”.ã+‚7ßW/ú:À«öc?é¹k•e(_w±žEyW%%Bg_·¼Ìü€«Aù¿¸šÃ\Mé2®"xó]Åñ¢«¼jjmn¡ÌJ±´^TrÝÝ«ÕèOvÔQ€’ꪭÏs<Œ;Ž«¦[›ŠØóX Þí7v»œÚ½$º›Ìy|êm}Xµaç1l!þ>Þ€\žü`þ/}Çø;æ·¥ª?:ÿ$µó{£—ûÃß¾‡­à¿?]^*Ýîl@Kfé?w4[áendstream -endobj -3791 0 obj << -/Type /Page -/Contents 3792 0 R -/Resources 3790 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3615 0 R -/Annots [ 3797 0 R 3798 0 R 3800 0 R 3801 0 R 3803 0 R 3804 0 R 3806 0 R 3807 0 R 3809 0 R 3810 0 R 3812 0 R 3813 0 R 3815 0 R 3816 0 R 3818 0 R 3819 0 R 3821 0 R 3822 0 R 3824 0 R 3825 0 R 3827 0 R 3828 0 R 3830 0 R 3831 0 R 3833 0 R 3834 0 R 3836 0 R 3837 0 R ] ->> endobj -3797 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 616.6656 133.6164 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3798 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 616.6656 148.8392 626.5933] -/Subtype /Link -/A << /S /GoTo /D (a00096_f1684ad96b8acf54154688df3883b801) >> ->> endobj -3800 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 603.7142 133.6164 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3801 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 603.7142 147.7332 613.6419] -/Subtype /Link -/A << /S /GoTo /D (a00096_ed119a030ebd3bf7c30a12071c27d441) >> ->> endobj -3803 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 590.3444 133.6164 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3804 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 590.3444 148.2812 600.6904] -/Subtype /Link -/A << /S /GoTo /D (a00096_47140aa52cb9e6a2de38fdfc5da08df1) >> ->> endobj -3806 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 576.8351 133.6164 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3807 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 576.8351 151.6087 587.739] -/Subtype /Link -/A << /S /GoTo /D (a00096_569382bc53aa64c227e57efe88fe13ac) >> ->> endobj -3809 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 563.8836 133.6164 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3810 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 563.8836 166.2933 574.7876] -/Subtype /Link -/A << /S /GoTo /D (a00096_8587178a29882482be20c2822b402b96) >> ->> endobj -3812 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 551.9085 133.6164 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3813 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 551.9085 144.4155 561.8361] -/Subtype /Link -/A << /S /GoTo /D (a00096_6f8c65cfc8242197bcc3cb5b4735b16f) >> ->> endobj -3815 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 537.9808 133.6164 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3816 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 537.9808 157.138 548.8847] -/Subtype /Link -/A << /S /GoTo /D (a00096_51bbbe3099c10ef26119ddc2aa51e35e) >> ->> endobj -3818 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 525.0293 138.5977 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3819 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 525.0293 179.8327 535.9333] -/Subtype /Link -/A << /S /GoTo /D (a00096_f20186ef441ef5b600e8544a0f2d8d81) >> ->> endobj -3821 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 512.0779 138.5977 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3822 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 512.0779 178.1589 522.9818] -/Subtype /Link -/A << /S /GoTo /D (a00096_a80e8d0fc768525fa3bfb3d4e4cf260d) >> ->> endobj -3824 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 499.1265 138.5977 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3825 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 499.1265 182.5922 510.0304] -/Subtype /Link -/A << /S /GoTo /D (a00096_be2c98748e180c1747823cd2fb8ecf0e) >> ->> endobj -3827 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 486.175 138.5977 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3828 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 486.175 168.7542 497.079] -/Subtype /Link -/A << /S /GoTo /D (a00096_b20096ae4953caaa42f6bb2373c4494c) >> ->> endobj -3830 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 473.2236 138.5977 484.1275] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3831 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 473.2236 173.1875 484.1275] -/Subtype /Link -/A << /S /GoTo /D (a00096_e82f68cb91d8688a619d55d2a8572979) >> ->> endobj -3833 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 460.2722 138.5977 471.1761] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3834 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 460.2722 168.2065 471.1761] -/Subtype /Link -/A << /S /GoTo /D (a00096_c92d2f194f096e84791f95d7e8f0ba92) >> ->> endobj -3836 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 447.3207 138.5977 458.2247] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3837 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 447.3207 187.0258 458.2247] -/Subtype /Link -/A << /S /GoTo /D (a00096_858f970feb7462871c814953697a8ad7) >> ->> endobj -3793 0 obj << -/D [3791 0 R /XYZ 90 757.9346 null] ->> endobj -1003 0 obj << -/D [3791 0 R /XYZ 90 739.9346 null] ->> endobj -258 0 obj << -/D [3791 0 R /XYZ 90 739.9346 null] ->> endobj -3794 0 obj << -/D [3791 0 R /XYZ 90 716.7484 null] ->> endobj -3795 0 obj << -/D [3791 0 R /XYZ 90 634.6393 null] ->> endobj -3796 0 obj << -/D [3791 0 R /XYZ 90 634.6393 null] ->> endobj -3799 0 obj << -/D [3791 0 R /XYZ 90 620.6507 null] ->> endobj -3802 0 obj << -/D [3791 0 R /XYZ 90 607.6992 null] ->> endobj -3805 0 obj << -/D [3791 0 R /XYZ 90 594.3295 null] ->> endobj -3808 0 obj << -/D [3791 0 R /XYZ 90 580.8201 null] ->> endobj -3811 0 obj << -/D [3791 0 R /XYZ 90 567.8687 null] ->> endobj -3814 0 obj << -/D [3791 0 R /XYZ 90 555.8935 null] ->> endobj -3817 0 obj << -/D [3791 0 R /XYZ 90 541.9658 null] ->> endobj -3820 0 obj << -/D [3791 0 R /XYZ 90 529.0144 null] ->> endobj -3823 0 obj << -/D [3791 0 R /XYZ 90 516.063 null] ->> endobj -3826 0 obj << -/D [3791 0 R /XYZ 90 503.1115 null] ->> endobj -3829 0 obj << -/D [3791 0 R /XYZ 90 490.1601 null] ->> endobj -3832 0 obj << -/D [3791 0 R /XYZ 90 477.2087 null] ->> endobj -3835 0 obj << -/D [3791 0 R /XYZ 90 464.2572 null] ->> endobj -3790 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3840 0 obj << -/Length 1300 -/Filter /FlateDecode ->> -stream -xÚ­YÉnÛH½ë+x”�QOï‹o“Øb8ÎŒ£ (†¡H´-@[$ -‰ÿ~ŠKÓM‘ª–à�âòXïu¿ªb“d …KMŒ2Ä ©“É¢G“'8ü¡ÇªÓ8??¯¸KqšëdøXDÐŒ(Îx2œŽú†pv6àŠö¥?&óYºÌ¶Ù8K˃_²Ín’•Ûwécº9c¶Ÿ.'ùié,ï3©Îî‡×½Ëa­¢©„f¹†Ÿ½Ñ=M¦ öºG‰pV%¿`‡æO=É…ß™÷¾ôþ©ã”'Š ºÆª˜è,“Žp?Zƒ7á`¥'�†XÆfÄ)UĆ©ÎCsû›øèi6žÍÓiê"ÝN6³u6[-÷çÊ*B™5‰6ŒP£»GêAƒÕ¶Ö:B©€XV*˜)d]þ/Öót{¾ÏÌ('Fp†RKâ,“°YœË�lžªSw�@F 1L¨.…"PXãjX.±¶‚LZ"• �F‘ù©Q1úV´œþ�Ò¤ñrÚb7 -Luû쇧Áãc:Zq›Óð¼/„CjI®> 5*Bߎ–Ó“œÆ |%lË$ºH¿SÊ—³"ƒËÙªªd>[Vµ£Tù¿z,ÿó+æé^k!Ïä@) I ÅËRºgãò«Y:Ÿn;Œ²šhaÄÁ.ºQ)¬|�“ó~ç\µË$¯q%PÆ¢LD¼L 39ªuT�Ç5ÔíìCÖR'8Ñœ2T'ÒQW'aŒÚ¨:�k¨Ëf h—­òÕ„I¦p»t0íæ §Fm!7#žzXÜÓ àÛ=ÅÕÕž†êpOu§{Š««= Õ•wÆ®–l˜Eå tŠ{ª)܆¤ŠyZÂäžzäÿâi ó4T‡{Ѝ;ÝS\]íi¨î9ËÖÐšÅø©¥Q+¢”Æg\%(n¬„{½�öß -·õ5ÜÛ]E¥Õ¦ÒvLw™jˆ¦LbÚŽõTRBg1mj[¯6Ù�Æk0iUß5GX 7g+˜Žyéaq3ƒ€íÕœGÅxk£BÞÉó¸}€’Üîñ"Vác -Zq‹ -[m;ü€gEc#÷¨/´`-Y“v$é}×B {ÖR~ØÜ€™ëaqs1ÆÀ\œ·67äÅÍmðc.® ·y¹ªÝ×UÆ�t‘±{TŒY:«rÕd}»|÷þæãåíðáýçÛ«‡Oýûðõîææò¶ÓvjóGSsØö€ÙîaqÛÆÓ;4®®NŽP]¤G#òNoÒ¸¼ºK‡òžÒl“þÜ¥Ûl�µ“ØqsŽÏâ d/PÑŽ-�"ÎDŸ~jXÔÝ0à›Ý�¨ó¸†:Ü]LÞÉîFäy\CÞ«»óô±­ÓI"˜q¨N°·BÅíÍßððèƒP ‹ÛDzv„·6.äE{v“÷ˆžQЊ뗼ÏéxšnŠ·-oQ�Ùêœ�Š)§)wM#N;ïÍÒ@*‰ø0Ÿ=,î3ÂxzãêêlÕEÊ‘wzãòê2å5S¥£Qsèϰ¸Æ­c¬ÅëXÂx´KW¨¸»¯á°"FIk×R¼„CÒc*¥ß�šÓ/f‹4{Y·+×@¿tûöÇíAb£a©%Tƒx$xWÙX¥KÓ¹„§ž£õ›¾{©aá&xø¦_íCXÿY£‘ëü�.ÓÍ8óŸü;ÚO~ãúŒ©þ®Úa¼ú§ç\œsZîA‡ÒåÖãWýÕ¦ÜÙ}ü»B“ -øã¥ú¦±úýò”¶¾gäe:æç?ìê›Ãendstream -endobj -3839 0 obj << -/Type /Page -/Contents 3840 0 R -/Resources 3838 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3875 0 R -/Annots [ 3843 0 R 3844 0 R 3847 0 R 3848 0 R 3850 0 R 3851 0 R 3853 0 R 3854 0 R 3856 0 R 3857 0 R 3859 0 R 3861 0 R 3863 0 R 3864 0 R 3866 0 R 3867 0 R 3869 0 R 3871 0 R 3872 0 R 3874 0 R ] ->> endobj -3843 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [106.7172 668.6407 154.358 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00040) >> ->> endobj -3844 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.2234 668.6407 222.4221 690.8921] -/Subtype /Link -/A << /S /GoTo /D (a00041) >> ->> endobj -3847 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 584.4605 133.6164 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3848 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 584.4605 157.1377 594.3882] -/Subtype /Link -/A << /S /GoTo /D (a00097_5960d82e7aca2986b8509a0d87d6cbc8) >> ->> endobj -3850 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 571.509 133.6164 581.4367] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3851 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 571.509 154.3681 581.4367] -/Subtype /Link -/A << /S /GoTo /D (a00097_8ae6395641b7752dce47881e20cee970) >> ->> endobj -3853 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 557.5814 133.6164 568.4853] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -3854 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 557.5814 166.5525 568.4853] -/Subtype /Link -/A << /S /GoTo /D (a00097_6925d46b2819adb474a5f0036f02dd7d) >> ->> endobj -3856 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 544.6299 138.5977 555.5339] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3857 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 544.6299 157.138 555.5339] -/Subtype /Link -/A << /S /GoTo /D (a00097_7092781c50dcad50f473888585c85b83) >> ->> endobj -3859 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 532.2364 152.1466 542.5824] -/Subtype /Link -/A << /S /GoTo /D (a00097_a6487b9c1c773b32656065d0e19bf142) >> ->> endobj -3861 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 519.285 148.2711 529.631] -/Subtype /Link -/A << /S /GoTo /D (a00097_e87913860c6b05c6e6b060639b950098) >> ->> endobj -3863 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 505.7756 138.5977 516.6796] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3864 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 505.7756 193.1026 516.6796] -/Subtype /Link -/A << /S /GoTo /D (a00097_134ec55c3d5abaebfed4ff8edfedf1ea) >> ->> endobj -3866 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 492.8242 138.5977 503.7281] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3867 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 492.8242 195.3141 503.7281] -/Subtype /Link -/A << /S /GoTo /D (a00097_5a3116623c6a7da7c82db6c301ae0da3) >> ->> endobj -3869 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 479.8728 192.5346 490.7767] -/Subtype /Link -/A << /S /GoTo /D (a00097_606d2729bf411ade69044828403a72af) >> ->> endobj -3871 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 466.9213 138.5977 477.8253] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3872 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 466.9213 209.1522 477.8253] -/Subtype /Link -/A << /S /GoTo /D (a00097_2fca02673894f222b01ad2d3a4d7dd79) >> ->> endobj -3874 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 453.9699 175.3891 464.8738] -/Subtype /Link -/A << /S /GoTo /D (a00097_fb60f42593d305ea36d9b4303722696e) >> ->> endobj -3841 0 obj << -/D [3839 0 R /XYZ 90 757.9346 null] ->> endobj -1004 0 obj << -/D [3839 0 R /XYZ 90 739.9346 null] ->> endobj -262 0 obj << -/D [3839 0 R /XYZ 90 739.9346 null] ->> endobj -3842 0 obj << -/D [3839 0 R /XYZ 90 717.8172 null] ->> endobj -3845 0 obj << -/D [3839 0 R /XYZ 90 602.4342 null] ->> endobj -3846 0 obj << -/D [3839 0 R /XYZ 90 602.4342 null] ->> endobj -3849 0 obj << -/D [3839 0 R /XYZ 90 588.4455 null] ->> endobj -3852 0 obj << -/D [3839 0 R /XYZ 90 575.4941 null] ->> endobj -3855 0 obj << -/D [3839 0 R /XYZ 90 561.5664 null] ->> endobj -3858 0 obj << -/D [3839 0 R /XYZ 90 548.615 null] ->> endobj -3860 0 obj << -/D [3839 0 R /XYZ 90 536.2215 null] ->> endobj -3862 0 obj << -/D [3839 0 R /XYZ 90 523.27 null] ->> endobj -3865 0 obj << -/D [3839 0 R /XYZ 90 509.7607 null] ->> endobj -3868 0 obj << -/D [3839 0 R /XYZ 90 496.8093 null] ->> endobj -3870 0 obj << -/D [3839 0 R /XYZ 90 483.8578 null] ->> endobj -3873 0 obj << -/D [3839 0 R /XYZ 90 470.9064 null] ->> endobj -3838 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3878 0 obj << -/Length 293 -/Filter /FlateDecode ->> -stream -xÚ¥QMkÃ0 ½ûWø˜âYr,Û=Žme�ÁFs+=¤IZKÂBÂÖ?ç«ÚÛðAO~’xz.ýî$7Ú§bâyÅ$?ûï-ƒ™Ž<­ Söð‚Ž;ቧ§q�ÐÈÓb@La„q¬!è_ß=Ô2!'ð”uÙ„v]Ûç]߆`ƒr&›¼¯ÊºËºÏ¦ižӫ’Y¨VƒŽo¶?H^xÁ “B9«ù�O¤ç�W,Fµ$_lÇ>®s&bl¸·ï@GdIkîH¿9�6ÿÒ0ºj} (µ6•„3ʦ*ô�1!7࣡ÑÙmY—mÖ•Åd—÷hŒo HBÐA?'€s”TœýG)iB§uдSr{¨ãe¹Éïå\Þ\CƒºJ[¹ôðm€µendstream -endobj -3877 0 obj << -/Type /Page -/Contents 3878 0 R -/Resources 3876 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3875 0 R ->> endobj -3879 0 obj << -/D [3877 0 R /XYZ 90 757.9346 null] ->> endobj -3876 0 obj << -/Font << /F29 499 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3882 0 obj << -/Length 836 -/Filter /FlateDecode ->> -stream -xÚ�VMo›@½çW ôblöû£ª¢¦MSµ½T‘oM!Lb à¦?¿³,`ÌRùÀÚûæ½·3;ƒI€áCƒ%2ŒË Ù]àà~þzAºmN�u¢Wi‘¤G=‚Œ½5ÈPM{½Añ6mb ÚtÎÓ:©²ýÈ7 PZ£ŽÆÂ�–æ¦pAiHÄêo¼Û÷~Ê'÷Ü–!«W÷¥)ÝóµÊš7äŽ�gI›®ºCeÍÖ­öUÙ”u™¼Øó§M�¬±‹/ë¡ÜZ L´ -8ÓHIÉg¯DŠÆ¨þZO¨ ˜—ÀHQâÊsZ¯Í¶¬ÞOµ ¦H1J΋¨õq~ VH&Žl­ü&ÞuÕ9. yíªCÈ(ZRÄ™°=a£>xV•BÚ(9±ê¶_‚~õcd»�˜±-Ƕ=fk Ûë,©Q�N½Pè> endobj -3885 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 437.3806 250.6249 458.582] -/Subtype/Link/A<> ->> endobj -3886 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 410.0836 212.6587 418.9302] -/Subtype /Link -/A << /S /GoTo /D (a00171) >> ->> endobj -3888 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 298.6746 202.2283 309.205] -/Subtype /Link -/A << /S /GoTo /D (a00163_gb97849f0d3ea858eee790b69591e6427) >> ->> endobj -3889 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 285.3496 217.7102 296.2535] -/Subtype /Link -/A << /S /GoTo /D (a00163_g03070adbf8faab0f34f87c1270964306) >> ->> endobj -3883 0 obj << -/D [3881 0 R /XYZ 90 757.9346 null] ->> endobj -266 0 obj << -/D [3881 0 R /XYZ 90 739.9346 null] ->> endobj -1064 0 obj << -/D [3881 0 R /XYZ 90 553.9527 null] ->> endobj -270 0 obj << -/D [3881 0 R /XYZ 90 553.9527 null] ->> endobj -3884 0 obj << -/D [3881 0 R /XYZ 90 517.4245 null] ->> endobj -3887 0 obj << -/D [3881 0 R /XYZ 90 317.251 null] ->> endobj -3880 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3893 0 obj << -/Length 1119 -/Filter /FlateDecode ->> -stream -xÚ¥WßoÛ6~÷_!´/öƒYÞñ‡Ä`–-K׬²Ö{jŠ@“•X¨cy–Ü´ÿýŽ©È’, ü Êúxßǻ㑧†¡ -™RÉÓŒ�ô÷Û¸ÏKú¾l~^ÍÞ\£ 3u°z¨,h` -ƒÕúÓd´X¢AÎ�ïni¨ø¯×Ù6­GWyr|Jwe\fùnñyu3ûuÕÐ:UJh°¤ÿÌ>}æÁšÔÝÌ8&RÁ3½pÆ`ð4“(üËvöqögc§þPMZœ1¼:�ŒþA¿<¤Õ†õê"†‹%pÎçñ~_¼Ù¤Ûm¾|^Ÿç‡íºûÎ6ÝeHÒâyºKR»ìš˜Qªâ#[:Œ>Žñ*-c2´vL‹ä�í½ûÈŽhEÅš±‹0µ™ßÒxM¼ÕÄ;ÎÑËyÈÝŸñ®~¦ PóoñÓÞ#ò‡ú¹É¨æÏõK™×ÏçCV:\kòË6Kª°••ÎûC^æEž|±JË‚u)Æ! --"Æ ƒaó eÕOÌÈ0ÎÙRœq©TåˆË…ÕZnòÃE—8²P Œ“7¨öv€‡,¡^¬UôëøÉ…︫½°-êð´fkdR(JÞjÖ=©aÈ"êŽÔúó—À�~oÉö3dë¶ìže+ &Ù?YR°"íjAi˜ÆH�»­AõùOÞ·fùÈð%(o©TP>XäUjÓ{—UÛ¢rt¶;Iû®'UÄY 4p¦¸pêí§Ã£Ã|h‡ßã—í áïÙµêúå¡ëL@†ÈeGN×™5!¢oÍŠ`ΙúÄ™èMBH^•²‚¾ÎvÉö¸¦-®©þ¼:fû|_²Í+kÁ–˜+†°{»Ít Æ Éh ×Åé*.ã:FËÃ1)�u�,N“åÙ³ª Ú”šöU$_ìXþ;DÕ/¶ÓelPS¼t ®õ)oQ­¶Ç, |"ê0ŸÏH�ŸÒгÛdä}“‘÷Èý-Né¡ÒãÎhPBNÂOq’‘d -Û{v0àÒ^-dzoFÞÀ&>Êøð ^ðÞ×k·Ò¹Ô,Ä:äçcîñS2zv­Œ¿ÞÝÞ_ÞÞþrùþýPýá¢q/4¨ z$/(�ïwSŽ. I¼Ý -*KÎÂIÁ¸>î’ú~1�0\2m"8Ÿ0-ÀXÂxØtÂŒ1¶fœ·I˜6ï×’“²u¿F@u¸Gj„ÃO©èÙ�Øiîh{ã1ãiPR £ó¨ã�;®¸w -�a „J}¾�iF �M&À(ãKLðú8á�L€Sîÿ�*zv‡ £ûU/úÚ{ñ¨7Ô„ä‚ -†�(LG?2$çd´Òÿ«£¬2(¢) °}¼iêél%éi¢m½«ümºKt²ºÞÍßMÿðƒÛvÝ  {ò èZgä\»¦Ívb¾që÷Ø÷ö·ï�i¯·¶MþÉs‡ðendstream -endobj -3892 0 obj << -/Type /Page -/Contents 3893 0 R -/Resources 3891 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3875 0 R -/Annots [ 3896 0 R 3897 0 R 3899 0 R 3901 0 R 3903 0 R 3904 0 R ] ->> endobj -3896 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -3897 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 213.2166 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00172) >> ->> endobj -3899 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 516.2256 211.8219 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00078) >> ->> endobj -3901 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 458.3971 213.038 469.3011] -/Subtype /Link -/A << /S /GoTo /D (a00163_ge28f6cb60e86088d8886d0f804b4f37c) >> ->> endobj -3903 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 401.545 217.7102 412.4489] -/Subtype /Link -/A << /S /GoTo /D (a00163_g03070adbf8faab0f34f87c1270964306) >> ->> endobj -3904 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 388.9671 202.2283 399.4975] -/Subtype /Link -/A << /S /GoTo /D (a00163_gb97849f0d3ea858eee790b69591e6427) >> ->> endobj -3894 0 obj << -/D [3892 0 R /XYZ 90 757.9346 null] ->> endobj -1065 0 obj << -/D [3892 0 R /XYZ 90 739.9346 null] ->> endobj -274 0 obj << -/D [3892 0 R /XYZ 90 739.9346 null] ->> endobj -3895 0 obj << -/D [3892 0 R /XYZ 90 716.7484 null] ->> endobj -3898 0 obj << -/D [3892 0 R /XYZ 90 534.1992 null] ->> endobj -3900 0 obj << -/D [3892 0 R /XYZ 90 477.3471 null] ->> endobj -3902 0 obj << -/D [3892 0 R /XYZ 90 420.4949 null] ->> endobj -3891 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3908 0 obj << -/Length 2681 -/Filter /FlateDecode ->> -stream -xÚ½[]o7}÷¯ÚéÁ,?‡d°(Ö[+Y§‰œÊvv�¦0T[Ž�Ø’«�&ù÷½”†#rȹœ"‹E"Ygî9¼ç^’3¢Ø€Â?6°t •&VÈjpótDáϯŽXýñ1|~þuyôÃKn–ØŠWƒË»]„ŠÅ\Þþ:4DŒŽ¹¢ÃÙóóú‡Õˆ™á|½|ü3x9ÒtHnö¨—�óý«éün¾Ç,nÜŸ¤Õ�I;úíòõÑø²ÑTKV¢bNÑG¿þF· ýõ%Â5ø o(aÖòÁÓ‘ä¿y<º8ú¥‰³ÿ`wAn䊉üЙ$ðîÇÎ!::£ô[ÇÞ31b•Ú1� ‚êÆ\3Vs�Î73t»�t:_߬ž7ËEGfA.‰Tzætr±¿ê~¹Þì_-fOµ¦ÍrÿÿÙ»ÚÏÛÛÕ|½Þ¿YíÃÔt+5$m—Œ"”=¨„%Js–ͱ‡¨´ÄŒ%” -ˆ¥\�i±Ó~2ÛÍýrõ¢ÍÍ('Z@4”¼AeØÃœ1ª‰fB¢íèogOuÆ·‹O#F‡óÇõ>ãŒWWœH¡ ÒvWý#‘ª51VW-©û�? ü«ŸÙþŠŒì*”�Dvf ûŸ· Ô’›åS[d:ËX�æ4ü˜)Ìcf|H-'+½ƒ^Þ?Ô÷�Rî»åáéùqþ4_lêÏfµÿÛjvÍÂ4©¸”ûf™; ‹‡]kíu,"mmktiÅÍ@Y õ[gÒ}²úXC¦a9zøq€ÏTc;ª“V믔›ZÚ2Œ� JëXF»<¨@ÞŽåÈImgX|ÇÖÇ 3øýÃâæq{ ŽT0o}·WMî¿‹³-rØíÃslM{O ¢­‰z¯¥:[Âü³¬7«‡ÅGrŸ‰$¡—8õÀs34Ì'œqc’h^Wp]5óufƒŽÓ±þ¸•7ä&¦ -æ#qáÎU:!ÂUf!”±A•xa´´ªbÞïoë‘&䲂tÀŠ“w7‚Ç—d$q�ŒÉÕ›7é$+7Z†ïQ%^­ˆÖ¦Åû�*úçˆÓáòá¶. ΄å\Ö‰™IÒjØ£Í�v»X;‹&`Eãaå¢Áƒ¢Áy›¢ y{MDÞ§hpI\'ãíɯ§ãËéÙø"Y™"BÙBT�žÃÌe¤µ1½ÉÙ ;OJ+ÖmsÀlö°²Íc`3ÎÛØòö°9"ïc3.#‰[ow¯_¾9I:|ÅÀð‹wç“‹q⸻DÀäŽ&¤A”p;.Z ¡_L¶·¥ 0˜nÓfº‡•MÇÓqÞÆô�·‡éyÓqIÜÔôów?�ŸŽ¯/.GVÀ-clxy•6½� †4 OOƒ*èâzŠXý’ŸÞá6¯rõÒY++—Æ”ÎÛ”@ÈÛ£"ò>%€ËHâv–ÀÙäýxšé~ØÙ2* ž–UÐÃmE`¯Ü²ƒ~¡Ù))`“Ði}À¬÷°²õc`=ÎÛXòö°>"ïc=.#‰[êþÉ©ûóÉô´-QP‘ÏOƒ*>•ÂÆÂ ²íA¹d¼»VV®Œ1¨œ·©��·G Dä}j—‘ÄMkàÄÝà_]þû|ZOÿgïÓI@WÄFiÌ?©QU\["Ý~"þËŒÿÂ2BݱËÿ€øßÀŠþ£Œÿ ¼Þÿˆ·ìLÞÃÿ‚Œ$nêÿåÔ½¸šü”˜.)QZZ<# ª …ÃZO+¥b)à:ϹîžÕ)£»]˜ëVvc \Çy×CÞ®Gä}\Çe$q3›ýd’çÜùbžŠUÐÀùîñ¥‰5€Ý,gw%IUéîç>!³ÛÃÊvcŒ�Ý8ocwÈÛÃ�ݸŒ$nÛn~ s{§ÝX*»Q »C wuB1"uÕýÄ&`v{XÙnŒ1°çmìy{Ø‘÷±—‘ÄMíO§×oO.~NL¯(Š*jxòvœëp%­Á“Ò  -jx›6ئÇjÀx‘3Þ}ùCy÷“š€ïaeã1ÆÀxœ·1>äía|DÞÇx\F×ɈžË�¯¯&Wãüέ2 ÏGƒ*Ù-ånà Éu:·†hH_§á!1¼� G†x½áoÙ𘼇áIÜŒá“ñ·©€ÕYVx2TA§ -Öð0µNEn“Ó>Qœv0·=¬ì6Ƹ�ó6n‡¼=ÜŽÈû¸�ËHâf܆ÛÙäUú�¬¹6Ì\þ·UÂ9%ÚØ–�ÜM8לnº½„Ìp+Ž1†ã¼�á!oÃ#ò>†ã2’¸ÃOsû6jˆÊâÙhPœQbx;¹åÛmÜ­wÛ0»=¬l7ÆØ�ó6v‡¼=ìŽÈûØ�ËHâfì†�›ÛÂ�OÓDšJá)iP-îËw«5�µäž®r©ÜÙ2d˜çVöc <ÇyÏCÞžGä}<Çe$q�Œéøâü͈Q:|=žäÏPJ$ãÏFƒ*Èà‚C6„ŠeÈü™,Yc£3Y/·‹wŠ/w&Ëqs'½º*$ø)�*ÖFw(œÔWGHEŠˆ!–1w—†‡$´£%^ÏžŸof��‰ ·Z¬�€S ·°°S�?<ŽåNRåœÖîô±ê¾q˜×V6c ÜÆy»CÞ²ßwÃqIÜÀò?¶óÕ×ôjã«X! Uâ7& èç8ûàúÍýl•;€ÇÝ—µúoÀsg‡s¥ã΃³Š¬6FÄ'¤3®îÁÇ!z7EˆÝôÃá–PmÍ!¨SðËv¾�Çgœš×õ�æÍýlA ûëÃå»åÊãæíŸ /w¯~÷Aç‹:Ør»!�#—†-8>r?pA˜eÝ¿™PnÓK»êVî² `›qg°;\èßc%uM/†ê¶¬ºÞ¤�¨IE™Då7¨”8ªf&)¡–³VZhú ŠIMT%Y‹Ù ÔøÒГ¸Áð¸\~Ú>§;} —X‹§ AÀLOhEU;ÿÏî-¥5¼ç  ±ÀÜ‚7�È}?B:Ã&w?q84²ÿ!BÓã³ÕÊýšaöµnæ»ýÿŸËÏ‹8Àº»Ë¡¡”°âoty÷±[á¾WÛܣŠ=„ûæÇ¥yX( opD[ÐßmÖ|{G Áº;"íÑÜø ÛQƒÖþ8߬ç+ÿ[™Ì}WM�ÇàÜ=�–Z·2PÜÔiF@}ö‰0…ð¬Rú›~4¸+f—0!«Á®E»¯ îBNó«ùb¾šmüÏóü²üÖ¿xí2¹­ß0^ÿO_pñ‚Óý;NiU/æ#®†~AßúŸ21R¯ÛýtùåëÇù¢�÷‹ÆL~þ™`B&endstream -endobj -3907 0 obj << -/Type /Page -/Contents 3908 0 R -/Resources 3906 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3875 0 R -/Annots [ 3911 0 R 3912 0 R 3914 0 R 3915 0 R 3917 0 R 3919 0 R 3921 0 R 3923 0 R 3925 0 R 3927 0 R 3929 0 R 3931 0 R 3933 0 R 3935 0 R 3937 0 R 3939 0 R 3941 0 R 3943 0 R 3945 0 R 3947 0 R 3948 0 R 3950 0 R 3951 0 R 3952 0 R 3953 0 R 3954 0 R 3955 0 R ] ->> endobj -3911 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.1863 274.5352 659.3878] -/Subtype/Link/A<> ->> endobj -3912 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 592.9052 189.974 601.7519] -/Subtype /Link -/A << /S /GoTo /D (a00173) >> ->> endobj -3914 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 480.609 174.2837 491.1394] -/Subtype /Link -/A << /S /GoTo /D (a00160_g070d2ce7b6bb7e5c05602aa8c308d0c4) >> ->> endobj -3915 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 468.0205 216.3555 477.9481] -/Subtype /Link -/A << /S /GoTo /D (a00160_gecf13b8dc783db2202ca5c34fe117fc3) >> ->> endobj -3917 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 454.8292 258.0292 464.7569] -/Subtype /Link -/A << /S /GoTo /D (a00102_96eb4534b574ece96ed36806039f73d3) >> ->> endobj -3919 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 441.638 288.6444 451.5657] -/Subtype /Link -/A << /S /GoTo /D (a00102_4350350ce0d4595876743d4c0a720bcc) >> ->> endobj -3921 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 428.4468 295.1 438.3745] -/Subtype /Link -/A << /S /GoTo /D (a00102_e7250008b68d1909d54040515eef8ebb) >> ->> endobj -3923 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 415.2556 305.9495 425.1832] -/Subtype /Link -/A << /S /GoTo /D (a00102_6a327c0ffd40f69fbcd5f01f12e5745c) >> ->> endobj -3925 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 402.0643 277.9346 411.992] -/Subtype /Link -/A << /S /GoTo /D (a00102_dd685a0f8b5e76a2687cc0f306813bfb) >> ->> endobj -3927 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 388.8731 241.5711 398.8008] -/Subtype /Link -/A << /S /GoTo /D (a00102_2e52037249bb98d7bbecf42e275beb07) >> ->> endobj -3929 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 375.6819 222.0444 385.6096] -/Subtype /Link -/A << /S /GoTo /D (a00102_72d99b1623afa14bd58c667b748c2ddc) >> ->> endobj -3931 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 362.4907 222.0444 372.4183] -/Subtype /Link -/A << /S /GoTo /D (a00102_c72f8777ccc45ae274449ea7a9f3de04) >> ->> endobj -3933 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 349.2994 261.3467 359.2271] -/Subtype /Link -/A << /S /GoTo /D (a00102_9f6c329c04baba17fe0f5b2a6597d713) >> ->> endobj -3935 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 336.1082 260.231 346.0359] -/Subtype /Link -/A << /S /GoTo /D (a00102_6aaa9da3d0f8d4c0799516d46d939942) >> ->> endobj -3937 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 322.917 261.546 332.8447] -/Subtype /Link -/A << /S /GoTo /D (a00102_8ee5e2c8e517d6e4f2198057f81e93c6) >> ->> endobj -3939 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 309.7258 222.0643 319.6534] -/Subtype /Link -/A << /S /GoTo /D (a00102_ee60b8757bacab269b0ccd7c240bf01d) >> ->> endobj -3941 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 296.5345 204.3509 306.4622] -/Subtype /Link -/A << /S /GoTo /D (a00102_bf4401501f1389872141a78b63f325a3) >> ->> endobj -3943 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 283.3433 219.2947 293.271] -/Subtype /Link -/A << /S /GoTo /D (a00102_55735650f879293d9b7b5fda6753d147) >> ->> endobj -3945 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 270.1521 209.3322 280.0797] -/Subtype /Link -/A << /S /GoTo /D (a00102_876c82c946543cd70c141e41417138e0) >> ->> endobj -3947 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 256.9608 214.4828 266.8885] -/Subtype /Link -/A << /S /GoTo /D (a00102_7bf0c086c7c41c12cc63324327932d91) >> ->> endobj -3948 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 243.7696 231.4091 253.6973] -/Subtype /Link -/A << /S /GoTo /D (a00160_g221d37ccde7e3fd0dd2c2eb0a6b15493) >> ->> endobj -3950 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 185.0539 194.0092 195.9579] -/Subtype /Link -/A << /S /GoTo /D (a00160_g7c5359305008e9183b18d6ab75f568bf) >> ->> endobj -3951 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 171.8627 187.9223 182.7667] -/Subtype /Link -/A << /S /GoTo /D (a00160_ge4dcbbe6c641d2e3b8537b479df5fc99) >> ->> endobj -3952 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 132.5288 138.5977 143.4328] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3953 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5678 132.5288 205.5661 143.4328] -/Subtype /Link -/A << /S /GoTo /D (a00160_g66d19181ad5fe8b8f7c84d1f1d46a2ec) >> ->> endobj -3954 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 93.195 138.5977 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3955 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5678 93.195 214.2533 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00160_g3191066cf8f76bd00b6843b77c37068f) >> ->> endobj -3909 0 obj << -/D [3907 0 R /XYZ 90 757.9346 null] ->> endobj -1066 0 obj << -/D [3907 0 R /XYZ 90 739.9346 null] ->> endobj -278 0 obj << -/D [3907 0 R /XYZ 90 739.9346 null] ->> endobj -3910 0 obj << -/D [3907 0 R /XYZ 90 716.6405 null] ->> endobj -3913 0 obj << -/D [3907 0 R /XYZ 90 499.4252 null] ->> endobj -3916 0 obj << -/D [3907 0 R /XYZ 90 472.0055 null] ->> endobj -3918 0 obj << -/D [3907 0 R /XYZ 90 458.8143 null] ->> endobj -3920 0 obj << -/D [3907 0 R /XYZ 90 445.6231 null] ->> endobj -3922 0 obj << -/D [3907 0 R /XYZ 90 432.4318 null] ->> endobj -3924 0 obj << -/D [3907 0 R /XYZ 90 419.2406 null] ->> endobj -3926 0 obj << -/D [3907 0 R /XYZ 90 406.0494 null] ->> endobj -3928 0 obj << -/D [3907 0 R /XYZ 90 392.8582 null] ->> endobj -3930 0 obj << -/D [3907 0 R /XYZ 90 379.6669 null] ->> endobj -3932 0 obj << -/D [3907 0 R /XYZ 90 366.4757 null] ->> endobj -3934 0 obj << -/D [3907 0 R /XYZ 90 353.2845 null] ->> endobj -3936 0 obj << -/D [3907 0 R /XYZ 90 340.0933 null] ->> endobj -3938 0 obj << -/D [3907 0 R /XYZ 90 326.902 null] ->> endobj -3940 0 obj << -/D [3907 0 R /XYZ 90 313.7108 null] ->> endobj -3942 0 obj << -/D [3907 0 R /XYZ 90 300.5196 null] ->> endobj -3944 0 obj << -/D [3907 0 R /XYZ 90 287.3283 null] ->> endobj -3946 0 obj << -/D [3907 0 R /XYZ 90 274.1371 null] ->> endobj -3949 0 obj << -/D [3907 0 R /XYZ 90 204.2437 null] ->> endobj -3906 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3959 0 obj << -/Length 737 -/Filter /FlateDecode ->> -stream -xÚ­VMOã0½çWøØðÎŒ¿Žûi?é *m(‘J#Ò–ýõ;nì*mJSiW9ĉŸ=ož=ÏFü È@8ãd¦´“§ÄŒŸ'ºO¸ÿ¤ ø8J>œQ&2™Y²bô°žÁ¢4„$FÓëžPFÊ ê‹Ü40@ M㬘çMës9©ŸòÅj¼*ÊÅðvt™|mÂVFYôAŸ“ë[Sfw™€TYjÄ+€Ä,#ñ”hRñcž\%?7ó4ëû’Ó`dªRqB®I§ê€œDK,qòŽ6j)·Ú«�Ü .KEDyI¾ß¯ÆÅ¢É{õ˜ÔU5d‘Xƒù[øU.nhV7Ó Ô·«¦±Ì«—¼"â@î*Ù9äø¨ðp*!$™4ï/Oîqá7þQ6ïz=”¡ç¹Î«"_¾k 6e�4iú_¬ÁZ' œê±† ¬×Ú°†ž¸Ñ¶âöZÃvì#¬¡‡EgÞ–5‹¢S¼)ø¬Cì!¢úÂó:¡ÛŸ­! -qpë’d•>rë·Ð‡¶~„y&¬Àx^üÉwĦ¼H}‡œÕ(hsÔN6Îo{›íÓX6´ÆýÓ%c]¬¹B¥ÚW$Ëç?_.XE> endobj -3961 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 703.2821 182.941 713.8125] -/Subtype /Link -/A << /S /GoTo /D (a00160_gdf916e0c752f5cda70d0bddb2be422ba) >> ->> endobj -3962 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [186.7567 703.2821 211.444 713.8125] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3963 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 664.4278 178.5273 674.9582] -/Subtype /Link -/A << /S /GoTo /D (a00160_gb50f78bbf36d912d69f6c1685d0b40e3) >> ->> endobj -3960 0 obj << -/D [3958 0 R /XYZ 90 757.9346 null] ->> endobj -3957 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3966 0 obj << -/Length 2209 -/Filter /FlateDecode ->> -stream -xÚ¥Y[¯ÛÆ~ׯ⩨Ö{'éE]Ÿ:ˆ›§ÉÉSÐuDX‡RDÒ'FÑÿÞ™½PË‹H†ÄË·3³³³ßÌ,Ù’Â�-ºŒTD!õ2{^Ðå<þnÁÜë ¼ß„€¿?,^¿çÉ2!‰æzù°34#Š3¾|Øþ²Š‰\o¸¢«ôtª^Ÿ×,^åÕñð9¸\GtEöõ¾8äöêÇ|—[L™á#q¹bŠ­{ø°øÇCk“3Y ÍТß¿üF—[0ý‘Äjù7”°$áËç…äÂß?-þÓʱ/Ì€±™+&ƧÎ$�'ÜÏ�ƒ+¢`êŒÒ¯�;LØjb$QÊh‚e@E/st@K„V-ÌgÔz fôðîþµÆVÁ�Ò¨ã«c–5犬7*–«‡}n�eú쮎;û_ï­a¼c8[=7Um¯>æöý9GOEUçg;¶z)ê½½rSà«Ô ƒÍ~*N[]x½­79¨Î»³Kõó÷÷�oïïß½ýá»ÚÛ`S’v„‰6—F7‡m,FeŸdii/ªúxÎí%ê… Ý]; Jk™åe@o»�A!?ËDK>³ñ[ü&0ÜxC¹f‚Åéb¾X�4CJéZÑÛô-jN7ÔP”Câéè®ês“Õ�w†¬qnÉݳ˜�SáâËɹC,pÒ¸SÐ äî*àn4­Ñÿ(x›ïÞX•ø`Ÿ_ÞØ+tT��±øÁµ|¬]!Xn/€fzeùëÁ‹v´ïYÊœr¨? ÐÊ>²ÛǘŸûDbqÛM+£¡)\©x)µ&•Ñlh9ü&0Z}¹.´ 5CKAaСձbZ5§ŠØ8æ=ÝA)‡iØA:[»]ˆÝñp8"ͽ´þ7|ôGŠ|íœz8€Û!'änöv„wuá[R€‹Ãñøéj%)!hH áįW”!ÚGP¸›¬fªô€Óú|,¶67îëú´Åpļð+U_Á?ûÖÇeB¤–¶’yñ_”.«vxRо¬6¬c¨Ù“`+‡zááƒÿš�̵d¥MüèÆô˜] Ó“›²ÃdûôlsAF%X¡#cóòOæ�$ÒTð|›Öé©>ëB$&:áêëÅÚþÄI1áJëŽÔÿ�ÍÀ�÷Å„/GhhØA -Ɖb1¿Úô†€±6AC¥Ë‹³¥8WÃöÛ6è &5¶¨9½Ð|&üÕÑÛúÆ’Û`¾LSH)ºgÂõ:ÙÁçléKõɲKñƒ¦–ØPÏ8D0 -À˜qÌD�:Y×`¡­vmè'�šS ]¡Ttuû*Ãx3 a$‚Ìyãúèö¼æÒíÀÆæŠ)vœy5Â\PÂ$�®2D˜`ˆ6Ë“/ 1£×3DGï+W% {h ƒÒ°§ü:7xüœ¹¾»øùî’9Ô  d >í‰5c ®@Ò5Á¶ñažî ÌÑ ´­±öÞõgc‘ÂÌÁ‡J®FJ˜ˆ”6)“/‘2£×GJGïç5þƒ©¯|‘0¦zº¯ŠÇÏY1�;¾J[A°M›vƒÍéOQTô¼`jAç ¬ÇVÒ_Ääu~S«îaó«>¥1Xõi½íª‡zçW½£û–UŸ¶b 7XõT±CKâˆÈÐ]ã'l4§=Æ3{xÛõ=¬¹/h_¿g2¤ì "w® L*F½`F1Œ²<ëùó€ß¤„‚6Inõf‹Ÿ™ÏPî¥/è› 1S†S¥X�*îúE'D+Õâ ÿø³ñâ”n·ç±­ås9“ -•&·%þ=Qøµ0´áPËÇ4ÃÐÿäúÜöï^öE†µÉ¾[Ýù3D É8õMoUÛs¾pˆ‰è«%ŽÙ Ýã£áDý<9�vJ\'UÆg‹’6O:�À)Ò™ÖÛ’N¨wžt:ºo!�i+rÒ�Jx7ä¨ -$´­ÓNð¨9õ±Ä¯C}çëŒq]¤°*¹Ñ?kA_îuž`”HEÓSoQCÅ]ž€°M†qwOl˪ÊÏî@~’.à_P}+]è)ºð0CíwÛµŒqDûA�öM};ØTíqš{ó{“Ÿ‹¼ºÊ ‰&BÆ7W„S:Ú«Qp.ÓJÕ×rÃ.1 a‚‡ÝÔâtçîc84í2ÒÆ]ßåeާ�Ž)=©þË_|@·5î†q÷Oßpñ†S{ÒÎcx”è½f¿8 šÐî)õÝñ�/Où £ÅOùÞ´À?ÿ 8�Yendstream -endobj -3965 0 obj << -/Type /Page -/Contents 3966 0 R -/Resources 3964 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3984 0 R -/Annots [ 3969 0 R 3970 0 R 3972 0 R 3973 0 R 3974 0 R 3975 0 R 3977 0 R 3979 0 R 3980 0 R 3981 0 R 3982 0 R 3983 0 R ] ->> endobj -3969 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 639.4127 274.5352 660.6142] -/Subtype/Link/A<> ->> endobj -3970 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 612.7666 190.532 621.6133] -/Subtype /Link -/A << /S /GoTo /D (a00174) >> ->> endobj -3972 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.3051 493.1311 359.3784 504.0351] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -3973 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [321.4596 463.5516 356.3884 474.4555] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -3974 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [159.2897 309.3651 239.3189 320.2691] -/Subtype /Link -/A << /S /GoTo /D (a00153_ga92afb113e122f860392bfbd385f842e) >> ->> endobj -3975 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [336.7197 294.8746 372.0849 304.7798] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -3977 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 226.9876 237.9445 237.8916] -/Subtype /Link -/A << /S /GoTo /D (a00160_g3d768e989e308144190ae1a5ddfa9726) >> ->> endobj -3979 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 170.3828 194.0092 181.2867] -/Subtype /Link -/A << /S /GoTo /D (a00160_g7c5359305008e9183b18d6ab75f568bf) >> ->> endobj -3980 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 157.5616 188.4803 168.4655] -/Subtype /Link -/A << /S /GoTo /D (a00160_g6d9751d534453425c7a5a215d1d4414c) >> ->> endobj -3981 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [243.4737 157.5616 268.161 168.4655] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3982 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 119.3412 182.941 129.8716] -/Subtype /Link -/A << /S /GoTo /D (a00160_gdf916e0c752f5cda70d0bddb2be422ba) >> ->> endobj -3983 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [186.7567 119.3412 211.444 129.8716] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3967 0 obj << -/D [3965 0 R /XYZ 90 757.9346 null] ->> endobj -1067 0 obj << -/D [3965 0 R /XYZ 90 739.9346 null] ->> endobj -282 0 obj << -/D [3965 0 R /XYZ 90 739.9346 null] ->> endobj -3968 0 obj << -/D [3965 0 R /XYZ 90 716.7484 null] ->> endobj -3971 0 obj << -/D [3965 0 R /XYZ 90 553.0164 null] ->> endobj -3976 0 obj << -/D [3965 0 R /XYZ 90 245.8074 null] ->> endobj -3978 0 obj << -/D [3965 0 R /XYZ 90 189.2026 null] ->> endobj -3964 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3988 0 obj << -/Length 969 -/Filter /FlateDecode ->> -stream -xÚ½WMoÛF½óWð(´Ý™ýâæX¤ b´I“è–mÓ²™l(Ò®ûë3üXzIZK ø±O3oçq¸súAlyl”aVH_ÝE<ÞÑí×ôËZßø€ß·Ño¯ÐÆ–Y�:ÞÞ´40…€ñöúÓ -®7hQ˜Uýæo:U|Œw'¯ö‡¬;{Y\ÕwY^¥Õ¾Èן·ÑÛ!mÏJ MÒoѧÏ<¾&vgÂ&*~  ÎÀZŒï"‰Â]¢�Ñû!N·Ðþá¹âšå š®”“Õ#Õjð©xá\3);T£À?ˆjZpZG%b/Ü4�d6"Ü­5wÊ]¿ôÁ#@@®õ5ó©Õ ¿T3nÂ0ÍA†¸mÐ,+Ýó²JθE ¹˜%•ô|µ„qÒÓE;øBÑÓ¨Mú2;‡û/»¬:fåýÔ*+§tCe‚8L˜‚bF3Q@ñû5òU±¿¦s˜·‡a 16ôgމŸ~þ$zìÆ·4�¢¡e«eçÆ&CȆƻË*Ýç�«ÛÞ‰WuY®É­dÆÃc«Èé™á®î®{˾ýØ�42’„°b'+á’qm!\J_ ³Šúè”) MÃ&`‹.ô>#p�ZÊë6ÊëóÜe„P“ܧ;Þá—XÌâz=¿Ï÷s»›æÍ -° ‚C-¥OÈðf"þ™ý®�f`„9¯á}t ãXÃä )�öÿg“®ï:»i©“µV A&?§“2ÔB.u²ƒ-w²ð‡Ê»¡ß}vá‘¢çÍ”Yâç‡ÊX–ÐTç=c¬,”>‹ë™ìP_ëg…^€J[–`@-@jF®¹šJ øÕmÚN³‰fØ4"y€�´šDmDö˜<½Ë‚^¥§%ÀÊ3½ê¡C^u°†ÁŸ$dçN’³=¦Ýá¶8V ½îj6ÁR`4ÕÓ~z7Ýñk^<äãÇÓ.GÍD#ðOq9})HÞ ¿�ËlÙå^Àм -çüëç]žW£ÜçÌ«0‹Y\ÏJßê¬|œ1I4ÕG[�° -µ”?±L‚6õ¥“”M˜Ô -Îs’�8i€5 Þ×Y�GzòϱpþI«„Ô?¶Û±öê¦('>{ -ñ°?º³K”>{ûÕÕI—©„Þ£\ãY.S@–Tɳ[3NÚƒVú‡¶‡­WéûE€@sK�dDÒ¨+�þ(Ûs:ÝŠû:˳2­Üg±Óë/wrѼŒêþ°?ò(^`¿FÎu¯òÕÊ)=ß0_>ºíò�»l¶QV4Þ5O¥ï{ðg>endstream -endobj -3987 0 obj << -/Type /Page -/Contents 3988 0 R -/Resources 3986 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3984 0 R -/Annots [ 3990 0 R 3991 0 R 3992 0 R 3993 0 R 3994 0 R 3995 0 R ] ->> endobj -3990 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 726.8189 138.5977 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3991 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5678 726.8189 214.2533 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00160_g3191066cf8f76bd00b6843b77c37068f) >> ->> endobj -3992 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 688.3382 178.5273 698.8685] -/Subtype /Link -/A << /S /GoTo /D (a00160_gb50f78bbf36d912d69f6c1685d0b40e3) >> ->> endobj -3993 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 649.1103 138.5977 660.0142] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -3994 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5678 649.1103 205.5661 660.0142] -/Subtype /Link -/A << /S /GoTo /D (a00160_g66d19181ad5fe8b8f7c84d1f1d46a2ec) >> ->> endobj -3995 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 610.256 187.9223 621.1599] -/Subtype /Link -/A << /S /GoTo /D (a00160_ge4dcbbe6c641d2e3b8537b479df5fc99) >> ->> endobj -3989 0 obj << -/D [3987 0 R /XYZ 90 757.9346 null] ->> endobj -3986 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -3998 0 obj << -/Length 1782 -/Filter /FlateDecode ->> -stream -xÚ­Zk�ÓFýž_aÁ—Dj†y?P…Új ‚ -µ…ýÇ›uIœ4ºüûÞ±=Îø5ãU+$Ö±�ï9sÏ�ëñ$$Áð�$'J(d—Iº›ád§_ÍH}y ×—>à—ÛÙ³—Ô$Ier{WF� Jhr»þ0×H,–Tàùêp8=;í·ò?”Vg_æÛ¬:z—ÝeÇÑó¬HËSމ`‹O·of¿Þ6j‰‚Ibü=ûð 'k�úf†3Z$ÿÀŒˆ14ÙÍ8eîÃvö~ög§ºPÞ04RAØðP Gp†º±Rºò†J0~ìXa€Ud‚ŒedH³ Lu‘:öMv^A ué&;¥ÇüpÎ÷E‡yfØ0V®©Â¼{ûGu[¶ bþ°Úœ¢Üî²â¼²¡P7éZ L´J$ÓÌSæ@KÕ¯mÆ b Œ0¢”öóD\Î÷ûãó.7Á)FI˜¼A °û)!X!E˜¸F+é׫]�ÐKñuA CÛS•PB¼»%Eœ (œò®{R•BÚ(Ù‘Z]þš¸£ß<ÙîŽÙÒ—Ý‹l¬@öOkP jQºßuõPÅ`¢hN]ƒêkh ¾Íjx1PwK¢]H -SjÂ"o²�Ó"/‹µªºú¯=¿ÍzÙ1Iu" F³Z½½tÜÔ˜w~ 8üÒ¿a zq­ºz¦v5hŽ$Œ¤£¡[|cîE³Ì¨Î ï÷Ò¸ˆD!I9/‘Oó"Ý^Ö0g%t‚'¥äû'öv;Õ+$C.Oçc^lN½;cNûôë4è%�ªèÏ$Á�2º5“:)€yÊ¡r*@¥ÝDâ03(vÀCíºƒËô&Æô(êdvxÆp)à!fØècÐ µ �BókKø‘RÑoo¶ÑCO 26¨/<ž –²Íût]�´GÎ%RT‘ùøsø˜Œ^\+ãõûß?Û~Ó†^N€CŘ¡Qc: Àx5d² H(eÆMö!“,nrˆÑ39ÌÛ˜ìóN0¹E>Åä°Œ^\grz2™ ŠñZ‹µé ,^YÌ ô#ÉÇ-ö!‹,nqˆÑ³8ÌÛXìóN°¸E>Åâ°Œ^\gñ!;æû^‰aVþ<’‡Š±�fvü@³!£©DR‰qŸ¯×C6ר¸Ë:Ïä iã±G:ÁbŸyŠÃA ݨÎ_ÚŸÁv�mxxäa…‰Nn³âF‡|%°R lü}Ô„œu°¸µ!FÏÛ0oc®Ï;ÁÝù{Ã2zq�ÁlÜààø¯‡‰‹}bðxè…žcŒ”¢dÜcòØÁâ‡=�ü�Ç>ï�[äS<ËèÅuóq�ƒã¿z&n<ö‰Ác>à1Óõ:}Ìcð¸�E=2^=Žð:�[¼q�Ûä<ŽÈèÅu‹Q�Ãão<Ž;�[Äà±|ÑÒ5ºõžõòR¤ö¥è=‹1 \zü¹íBeá`ñ²1zeæmÊÂçý¶ x¾ÏûË"Ȇ!Dt¸Ç«Âác*zqÝNÆçÕá�®¶ý—-­æDF²àP1~ƒ‘`”u²�v™€c2ä:¢Æ¾¹î`q×CŒžëaÞÆuŸ7îz‹{Šëa½¸�ëé¾°}is9ö;“‘HÛÝîp&*¦ÁÄ´¡Àùô~u¬wi¸¿yH¡I0·K"ÙÀ¾!ŒKÃ]f{¿?�‹Õ.û¡Ú$ôÓÜ ¯ú†S2!¸Ûp:eÇov<;U¨Ý$&‡еR5P<xé£ËŒ œh ·ï-�1jàªÑ× å–ü!KskYú½þš¤Þ½îÕ[©ÙÑ]­÷ý]nìИ|j(‚’¥aùµzb "ãïÉT Ô‘ÙÀ¢3Ò˜‘^7#[¼—â”oŠò;Êç®"»I®iGÄøÔ¬á15ݨÍÄRý¸å4!òó¹'A¤$‹ÌÏ#VÄ:¨ÛÄ0ômV„:/•QX†Lë¼>:ÐyXÙy3×K]ËÍ–»U¾廬!*Œùº)Ljá誶�Å»©0ÔMüM7õy£ë›6÷„õMDE/nÓFó"?µr!ŒŠ¤À¡bäð¾=³›úø’ -�p5¸i‚[ûBþ§ß+”e£á¨ÿźDF1í~ŽP‹°š_eEv\�Ý/Üw®oÝÁ»v¸Ô­ÿâç”=§¸úD1–ÕÑÝ‚Šù¾^…\^×K‚jà—zõr³ø¾ÉŠnzì�)òó/$ÎfÑendstream -endobj -3997 0 obj << -/Type /Page -/Contents 3998 0 R -/Resources 3996 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3984 0 R -/Annots [ 4001 0 R 4002 0 R 4004 0 R 4005 0 R 4006 0 R 4007 0 R 4008 0 R 4009 0 R 4010 0 R 4012 0 R 4013 0 R 4014 0 R 4015 0 R 4016 0 R ] ->> endobj -4001 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 274.5352 657.906] -/Subtype/Link/A<> ->> endobj -4002 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 185.6501 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00175) >> ->> endobj -4004 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 463.3525 176.5052 473.2801] -/Subtype /Link -/A << /S /GoTo /D (a00161_g3212e70c55244608ac16316888c354f0) >> ->> endobj -4005 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 450.401 176.4952 460.3287] -/Subtype /Link -/A << /S /GoTo /D (a00161_g6cda47c85ce1b58b501b44ac9cccc50e) >> ->> endobj -4006 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 436.4733 194.2087 447.3773] -/Subtype /Link -/A << /S /GoTo /D (a00161_gf7dd2757d1e766f65b01ba7c91c660a0) >> ->> endobj -4007 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 424.4982 173.7357 434.4258] -/Subtype /Link -/A << /S /GoTo /D (a00161_g34b924954ba5707d536df28d71a80d39) >> ->> endobj -4008 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 411.5467 173.7357 421.4744] -/Subtype /Link -/A << /S /GoTo /D (a00161_g9e97c58fe35f750ad192774be9408ac8) >> ->> endobj -4009 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 398.5953 173.7357 408.523] -/Subtype /Link -/A << /S /GoTo /D (a00161_g28cf9765e4b57451af559ab988ad7160) >> ->> endobj -4010 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 385.6439 173.7357 395.5715] -/Subtype /Link -/A << /S /GoTo /D (a00161_g17ccd786400fd08b941e11046df1668f) >> ->> endobj -4012 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 327.8154 189.0379 338.7194] -/Subtype /Link -/A << /S /GoTo /D (a00161_gbc331f73107958428bf1c392ba19b6f4) >> ->> endobj -4013 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 314.864 197.8948 325.7679] -/Subtype /Link -/A << /S /GoTo /D (a00161_g37e3103b9591790d484a450525739661) >> ->> endobj -4014 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4857 276.0097 216.0979 286.9136] -/Subtype /Link -/A << /S /GoTo /D (a00161_gf0349a8481565e80f55a751e2b408d6d) >> ->> endobj -4015 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [446.0722 276.0097 470.7595 286.9136] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4016 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 237.1554 173.556 248.0593] -/Subtype /Link -/A << /S /GoTo /D (a00161_g64807ba7c221ddf735572d05021539f2) >> ->> endobj -3999 0 obj << -/D [3997 0 R /XYZ 90 757.9346 null] ->> endobj -1068 0 obj << -/D [3997 0 R /XYZ 90 739.9346 null] ->> endobj -286 0 obj << -/D [3997 0 R /XYZ 90 739.9346 null] ->> endobj -4000 0 obj << -/D [3997 0 R /XYZ 90 716.7484 null] ->> endobj -4003 0 obj << -/D [3997 0 R /XYZ 90 481.3261 null] ->> endobj -4011 0 obj << -/D [3997 0 R /XYZ 90 346.7654 null] ->> endobj -3996 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4020 0 obj << -/Length 2158 -/Filter /FlateDecode ->> -stream -xÚ­Yë�ÛÆÿ®¿‚H¾HEµÞwI:EQ7çq’öj«Ÿâà@S¼k‰TDÒŽQäÏÌ>¨åC¤‹œ–ËÙùÍÌÎk—, ðÇ‚„‘ŒH"Bd§ ž`úÛ³¯·ð~ëü}·zö O‚„$Š«`÷¨9(F$g<ØíZ3n¶<á"Z·ßÝÃPÒ5#Ô ¾)޹ÝUY{ÊË&mŠªÜü¼{µz¹ë`­TR(† ¿¬~ú™{�îÕŠ‘Ä2ø”°$áÁirᎫ7«u|Ì ½`J9ÉÄ´v,$0Ã�z´�Œv1Q›-£”®Óó¹~VŸš³þGC_ç�ùeÃâu^f9*h83’H©9ƒe‘1�;΄YÞwy“£½5U^g—âì |„gdƒâ&†Í›wÖè‡<݃zü–R~ÌÉÐα$”ÅQ BNb8e%G´õ©Æ~'„R¼dH"¥B-Í‹ €·Í¡º<b3ÊI$8›ï¨&Ð}+0‘ˆ yå¦á÷éÉÚ°-ßo]çÇÚØ�1oµâ$|E¯úËHÔ("q©�¨æõûÀ�¾÷Äv+&ÄV¾Ø#Î(@ -bÿmƒ´$«NCyx$ 6âdÞtÕX†žòcn(Ã_'\mËbÇ\BÜlò]ŽîUÚAµµ‹Òw»‘9eL„âq hG±_]ž,ÍkßýÖ_0á#¾(��Ρ àÕœ±¡ CïsTKÈ#nˆL¬ ý ß&Ž#P* ~Y”Ù±ÝCæPý_´Å¹:7äðÅ�´!‰¨¹K›ÔûMsi³¦59§žH©2 Iˆ›v+ÑûS!¦ JâðÊñßr.Ç¡�y âi±£ZÂ…lœP¥ú¸µÖv„,pP�o»–£_’aÄ×¹ÖC %lìâ1' ,XÀQM ÷ö7�QHpRÙ´Êåú|.²ôsõ9Ï - ¸Ì?ê%V…:ˆ¾ƒP쨖°¡Õ¥úŒvmS¯µ º¬6†äã'½™žQaðélÍ‹.晫¶èíw0Ú=DxÔˆð‹Œ÷ùãs‰‡üúÆŒÐPMv~À÷ò¡1ói¹¿´{Ÿ`àQ&ûík[å]Ö�ÖµãûZ›)>ZüÜõ º îû]ĤkAÇ&e„ ê©ä|ѵ,ýÖ_0åZC¾Öµt=»–„úVOŠ‘kYª%l‰½`{�;8‡²$½Ðî6â±:+Ls;ûë|ôkŠùÚõx³CMÈí.Ì -gêÂN›¤ƒcU½¿yp‘„s—d¾â·>µë…áðQf‹\G€j}¨Š½iˆMsÞ£;b]xK%ÅWð˾r~™�P…ÒôRàÿEi[©^žtÈ«së:‘Äï+<\›ðpâ¿z´*d=Ð6~°k4õ”\-SŽ&«Ú²™¢ÉéEOsAFC� \'4IæOú ®0Myó{èÏÍå+ë"pŽ„®ê�³5gNËUÄà‘Ђù\›ÒÀ& g‹[N¤¡qË -©‘Є±›-«O0Ó²vd‹-ë,âµe]Àu-k÷K›ÇÝb¨H‰~»kuôKbŒø{‡áÁ’qBC(j³Vè¨à9XA ->°¾nš½øëïBD˜â䢢$™M+ŽxëSk)$  õ�'„FI|eÚË™¦ÛÑ.Å~ÉÝk÷gèR[¾º{®úPµÇ½K  _¯Ž]6"‚“Ù - +Ê•ùu}j—±?@�Z“›æ�ÓHÄç“.³Æ�½ -1ùÞ A3û¶@†ŒF9Ê…òÈæÈÇuÉe>á‘ ÏD�!_aÈuéÄ—�8 ÃYýa/ÁpA„C3*Ù¢ˆŽ®'ãrbÅ6BI–,ì•¢$Œ!^ÀbàCý[¦™h�‹¶Œ–ª‹×u9Ý1¤ˆ®yqqåúJ<ØèàûŒÎRàE¢ -<5æúJK=¯õ�çìqûÿ¶'À°¥tD ¸‘ BPÑv'mÌ5·Ó …ˆXÊ3ݾ{ÔÓWLAášV{i8yQ…u‹&üvÕ÷ f’VG¶˜´f¯Ik×%­îrÕïƒFÕ_cÄ×}xxùúõÃ?¿W}°W$Ù¼:ªxŽÍ´’QžÞr2&Q1�?ÏÉ|ê™ìÒ‘!ôËËeÊue?…”íé�û,rÍuñTêÛ3w,²—ªeUnó>ˆÚýõžeR'N±>'ÿ—Íh 9Zð%_wd˾î1œóõyÜÎ×}ÜY_‡•á|Ö×5ý’#¾�¯¿yù�»‘§SATõnÖÕø˜›9°KÚT_ ù:ËìàñR�ì°nßý'ÏûtªŸð$ "±íE^îÿw&n¾¹ó—[ÆšùÄçUF Á™üæKAE¦¤úC_^µëư„‰Þ÷BÇ}›«XˆY�(h¼oó2Ç» [§]±ÿÑ ^aÁjíãö—>çâ9·Ÿ˜9¥Ê¶ëx±á¢vü-ÚÝ™ÝU¿~zÊG…?OXéwl¸/Xendstream -endobj -4019 0 obj << -/Type /Page -/Contents 4020 0 R -/Resources 4018 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3984 0 R -/Annots [ 4023 0 R 4024 0 R 4026 0 R 4028 0 R 4029 0 R 4030 0 R 4031 0 R 4032 0 R 4033 0 R 4035 0 R 4036 0 R ] ->> endobj -4023 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 641.4254 274.5352 662.6268] -/Subtype/Link/A<> ->> endobj -4024 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 614.7347 186.2081 625.6386] -/Subtype /Link -/A << /S /GoTo /D (a00176) >> ->> endobj -4026 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 541.2703 183.1495 551.0484] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -4028 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.3051 441.6787 359.3784 452.5826] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4029 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [321.4596 412.0991 356.3884 423.0031] -/Subtype /Link -/A << /S /GoTo /D (a00140) >> ->> endobj -4030 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 261.938 213.038 272.842] -/Subtype /Link -/A << /S /GoTo /D (a00153_g41aa744caa46913b3b3aedb2a4e78546) >> ->> endobj -4031 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 224.1492 190.8907 235.0531] -/Subtype /Link -/A << /S /GoTo /D (a00085) >> ->> endobj -4032 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [191.3888 224.1492 268.6482 235.0531] -/Subtype /Link -/A << /S /GoTo /D (a00153_g69646a81a922033c5281445a71f8ffed) >> ->> endobj -4033 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [336.7197 210.0611 372.0849 219.9664] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4035 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 143.9152 217.4713 153.8429] -/Subtype /Link -/A << /S /GoTo /D (a00161_g029256bc17a12e1e86781887e11c0c7d) >> ->> endobj -4036 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.6302 105.1501 204.6385 116.0541] -/Subtype /Link -/A << /S /GoTo /D (a00161_gcff75c8c930abd6ff168e85373a4eb92) >> ->> endobj -4021 0 obj << -/D [4019 0 R /XYZ 90 757.9346 null] ->> endobj -1069 0 obj << -/D [4019 0 R /XYZ 90 739.9346 null] ->> endobj -290 0 obj << -/D [4019 0 R /XYZ 90 739.9346 null] ->> endobj -4022 0 obj << -/D [4019 0 R /XYZ 90 716.7484 null] ->> endobj -4025 0 obj << -/D [4019 0 R /XYZ 90 559.6875 null] ->> endobj -4027 0 obj << -/D [4019 0 R /XYZ 90 501.564 null] ->> endobj -4034 0 obj << -/D [4019 0 R /XYZ 90 161.3562 null] ->> endobj -4018 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4040 0 obj << -/Length 690 -/Filter /FlateDecode ->> -stream -xÚ¥VËnÛ0¼ë+x´f¸¤HŠ9ö‘  -´©oiP(¶l µåT²›æï»IU¶d1@aÀâc¸3»Ë% „áˆaDKM�ˆYì"FÖ8|�›žáü¬ x7�®n¸!†Å™¯ -¨äÀÉ|ù0I¨šÎ¸d“ôù¹ºªv‡çæ�nìèM¾Ílë>[eå’IV,š!ÉÔ¤œ>Îï¢�óVƒ“(…‚ZÁ¯èá‘‘%J½‹&‘ä;Œ‚1œì¢˜ ßÙFߢ¯­;Ñ,òT‚v€)¹÷•£ëÚºzs,‡|_TC’™¦‚éËAý7o‰D'¦À�E·Vj¶ïœ÷b q)FéZP€bj˜R'¤¿§œMöù²G, O‰ë™rí ÷] �pnµ–PïžË}‘õ4hÜks1꼘 Àµ9�8“ìXTùºÈ–vÏ.6ii[YYîK@?%š‚âDN…]Q™±ØYÜh“Œ$¨MÅ�6ÜrL›¤5Yk{Ÿn·Oé¢NÏO«håv£í6éÁ¶òÊiÇÞ�—Mæp©ûf³]šoÝZ,K‰3Õ.¯ªÖ¢·Ó¤çéEÏ1–1‹aÜuç9p¬.ˆ/Ö‰R �%J VJ×àH©x}­œð‹å”û ÕPѳÛÖK^ä‡~½p*¥Ñ�xTˆ\KŠõqzòaªL©’’JârÊ;€±”{X8åcŒ�”�ó¶)ïò†S~Âý–”�«èÙmSŽ÷m]â=%IB±U -â7 ob.΢κÆó5Öƒ� †öAIõ_·{³s\‚woo…·µHüåíDÔšo³"+Óƒ?ý)÷Ù7îê3îè:ÀÝ—]sqÍ™íqÆÜ[g5år²wWÃñÓ‡¦øôj¿ö^×xòž…§~z Äç/m¬‘endstream -endobj -4039 0 obj << -/Type /Page -/Contents 4040 0 R -/Resources 4038 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3984 0 R -/Annots [ 4043 0 R 4044 0 R 4045 0 R ] ->> endobj -4043 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 704.1539 179.6335 715.0578] -/Subtype /Link -/A << /S /GoTo /D (a00161_gb1fc692a2700b7a51517724364683f67) >> ->> endobj -4044 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 665.2996 173.556 676.2035] -/Subtype /Link -/A << /S /GoTo /D (a00161_g64807ba7c221ddf735572d05021539f2) >> ->> endobj -4045 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 652.3482 189.0379 663.2521] -/Subtype /Link -/A << /S /GoTo /D (a00161_gbc331f73107958428bf1c392ba19b6f4) >> ->> endobj -4041 0 obj << -/D [4039 0 R /XYZ 90 757.9346 null] ->> endobj -4042 0 obj << -/D [4039 0 R /XYZ 90 723.1038 null] ->> endobj -4038 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4048 0 obj << -/Length 1254 -/Filter /FlateDecode ->> -stream -xÚ­X]oÛ6}÷¯ÒûÁ /¿ Å6¤éšµX–ú­- -UVb!¶ìYö¶î×ïRe}Y2°Á¦­Ã{/Ï%)B@ñ�¥�–šX.Tm&4xÆ¿ßN |<Ççó:àçÅäúŽÙÀ«˜ -OyD2`Ábùi -RÍæÌ2®§ÇwØ”t -„�»d­ÛmtÜÄé!<$Ûtöeq?y³¨hKU’+p¤L>}¡ÁÕÝO(áÖÈà/üA XË‚ÍD0î¬''¿WqŠy‡¾ÁIàý£Aðæ‡Çp´º�!z6Jé4Üí²ëC¼NãÃò:[Åë5‰Úƒ|ŒŸâý Ì4N£Ø ²ˆÄJ™GÇìºàÌTÑ ”ñoãCˆ�–eºâ,Ú';Ÿ,ŒÃksàÂ8ɶó1Ù켄BY;ÁF -FŠB-å½éñ yÕ5€±„Rޱ$%TH™Køi†ÜÇÃj»¿iseDsÃ䪇½>t šhàò-§_†›2qÇôet¯³"qµÞŠÁ%š$ïõCGªÖÄX­ZR‹Ç/�oýZ“í{ôÈVuÙ�ÈN@ˆ²Ì’(#YÜÖ„%Š5œ¶ -Õåo ¼Íñ¿îñÖ¤ɰ$Ñy¦”¥InÈ<ÑIùíþ_wÔƒ4„c”@%’òR½{´.1�õé÷øy½CÏôwâ:u¾Û"ŒÀ±JÛÑvžG�Qw¢9jR¦°>Ùsë#‚ÆT -‘#_%i´>.±N–ûU¡yuåú»‚. ¼ í:Xr¢­i8¸ÅŽõ!pÖ -@vØ'é3YõDèHF=ðußr…Ui1Ý×.® ¬n†8ëYÇ%"(gw—: ¯¼V¨§8Žð3c²»¬¸…ky�±B�ñâ`©RMÞWËr¤r¡ˆfZäçííñc2:qóõý—7ïß}xœ :ýíÃâ³T0F {8jDíEI!›®›{×Mœ#TÛMÍ©%Œ[Q"®úý¦�{©júíî˜Fnáéó›pgIÙY¿Õ~«`£~d<ùm„×û­ÁûçŒÑé6Yv¸1@¶¸ÏÛÍãÇTtâV«é×ûîþÈpï3’�cׂà¦�{*©Ï¶¡;xf³šÀRQT5Öôžé(Àó::W"i`P‰¹<”Q\VOA�’wn» ×É?åÑê°<ø«ÿB÷Á7îg §Çò°ò›Þ0~ÃÊ{F©*ZO3†9Ý?º@ß¾û럿¿?Ç�‹w#ã¥Õ²ô/…9 8endstream -endobj -4047 0 obj << -/Type /Page -/Contents 4048 0 R -/Resources 4046 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 3984 0 R -/Annots [ 4051 0 R 4052 0 R 4054 0 R 4056 0 R 4057 0 R 4058 0 R ] ->> endobj -4051 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4052 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 185.0921 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00177) >> ->> endobj -4054 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 516.2256 223.1601 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00162_gaa60ca995565b799bb958c806e933665) >> ->> endobj -4056 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 458.7707 172.998 469.3011] -/Subtype /Link -/A << /S /GoTo /D (a00162_g69b075ef7e4d7bcf5a903d3d75baac02) >> ->> endobj -4057 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 419.9164 176.8634 430.4468] -/Subtype /Link -/A << /S /GoTo /D (a00162_gd1f18f739da7703628c3663209463a0d) >> ->> endobj -4058 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 380.6885 180.1912 391.5925] -/Subtype /Link -/A << /S /GoTo /D (a00162_g86beee1f69d05b16022dfb430470e9ce) >> ->> endobj -4049 0 obj << -/D [4047 0 R /XYZ 90 757.9346 null] ->> endobj -1070 0 obj << -/D [4047 0 R /XYZ 90 739.9346 null] ->> endobj -294 0 obj << -/D [4047 0 R /XYZ 90 739.9346 null] ->> endobj -4050 0 obj << -/D [4047 0 R /XYZ 90 716.7484 null] ->> endobj -4053 0 obj << -/D [4047 0 R /XYZ 90 534.1992 null] ->> endobj -4055 0 obj << -/D [4047 0 R /XYZ 90 477.3471 null] ->> endobj -4046 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4062 0 obj << -/Length 1385 -/Filter /FlateDecode ->> -stream -xÚ­Y[oÛ6~÷¯Ð£ Ì ï—`¶!KÑ zÉ[[ ®­ÄBlÙµåeݯߡ$ÊÔŤ}(e}:çãÑ÷‘G I0ü#‰Á‰ -Æe²ÜNpò?¿™�úöîÏ}Àï÷“«[jƒŒ¤2¹(#H‚%4¹_}šj¤gs*ðt±ß¯Št“§Åêê¸N7´®îÜf›´}HÒÃŒèiš/íO\33%B;ÜßMþ¸oxÔ4“IJø6ùô'+ {7Áˆ-’g¸ÀˆC“í„Sæ.6“�“÷MœêFùÀÐlaÃÓ%Á/ÔÍ—Âô•7]‚ñKæ “¬¢d„(£C¹mpª›èˆÔñoÒb�VU¤›ô¸åø3Æt“¢nåµ@˜h•H¦6˜ ÖÍ�æ>ª/mÆ b Œ0¢äöÛ ’ŸŠõîpÝÍM0EŠQNÞ ²û5!X!E˜8G+Ó¯Ûº¢§üiFð4Ý«Šâ=-)âL€zʧ~îQU -i£d‡juû)q£?=Úî‰ÚÒ§Ý‹l ,€ö¯ÇlyDÇ´Ë…rƒ$Õ2\¶ÕÏßšx?šÍÿË€èæD¸�¼ -z°È›Ô*+ÏJ¥–…Îr_q½J -�DI$ÁH`V³··�5æƒÿú~î?0ðú{q-;çÓ. Í‘¬K¢«<‡Š¥îE³©Ñ�ÿçÆ…d�¥*ÿÞžò¥­ßq`]‚Á„\\¾}À�+$[ós›ð3¥¢ïF»0�‚T,/,©KÙÎûÏŒâé.[õrC5 !¢“û²(>Æ¢·Åßh¶os -KÑ‘8T,»â–èní±À®0&ý÷ �½T‚…x^Gžûè’‰À‰&’—L`ÓÁÊèsPËä­uíb“ýWoÅÚßCÐEbà~;y˜XÍ‹PÐ>—Õ :QFê˜z,®^/`H½á¼�zý¼qõ¶r�Qo˜E/îY½Çbq�¯@ZÂÛ Á¡b鬨BéNñGÊ—ƒ´€Õo”|}t@¾ ¬ìzÊ (·~],-ͧyš¯.j™khÁ ÿ)ó‹RæPWéŒH¹†‰¸”dXÊ>, åVÞ¨”Û¹GH9¢×_ˆ÷§)hð¹‰Á¡bé5AR‹Nz+ååzq¨ÛAîwEö]Ã6�k f LI×2.wÛí"[BbdŒ–#-á¡C–p0KâÝaÆÅt·L�Çú#­g‹šçeGØæ�õ:–` -a­YÌŒŽ°„CF,áÁB–ðóÆ-ÑÊ=Æa½¸gK|; õ&QÂd¤Ë®$4œvjs„áÞ`V€p„s6Ò -:d³ÙßÛþH[áM'Z¼Î^ÀŒF”ñˆî+3qÝ7Ȱî}X@÷­¼QÝ·s�Ð}„E/îY÷»S1´À÷è•FªàP±üZ")¥éTÿ5”ïö‚cq õÌ…˜Ì !üȘ4ä(¦Ûm�±7Õ j[Éò¢½¡ðÓcí¯Ýå&ì9ËW»ç™âÓ‹¾cð5ÅXûSëå¾1Uí^!ã9XÜx^À�ñÂyãùyãÆkåc¼0‹^ܳñö‡Ýv?`<° ýp*–_ÃXónõ_ÓxÕ4‚6áÜô©‘FñÐ!«8ذYöUWf ü*†a qÕþ¸»h*Á]Ô 6 ÊHd5»¹—¶Óða­ca‰Œ‚º>Q‡­(—õy“æéaQ¸ƒnwjø—Ü͈˜žê Bëÿñ5e×WWcY�f*[qŸÞ¾«Ñ¨~ý^Ÿýîþýþ˜æÝŠÚ¿8j^}þá}sÄendstream -endobj -4061 0 obj << -/Type /Page -/Contents 4062 0 R -/Resources 4060 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4074 0 R -/Annots [ 4065 0 R 4066 0 R 4068 0 R 4069 0 R 4070 0 R 4071 0 R 4072 0 R 4073 0 R ] ->> endobj -4065 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4066 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 185.6501 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00178) >> ->> endobj -4068 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 550.8716 172.998 561.402] -/Subtype /Link -/A << /S /GoTo /D (a00162_g69b075ef7e4d7bcf5a903d3d75baac02) >> ->> endobj -4069 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 512.0173 176.8634 522.5477] -/Subtype /Link -/A << /S /GoTo /D (a00162_gd1f18f739da7703628c3663209463a0d) >> ->> endobj -4070 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 472.7894 180.1912 483.6934] -/Subtype /Link -/A << /S /GoTo /D (a00162_g86beee1f69d05b16022dfb430470e9ce) >> ->> endobj -4071 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 433.9352 175.2098 444.8391] -/Subtype /Link -/A << /S /GoTo /D (a00162_g984c4a8b65a3cb35460b073a40568c25) >> ->> endobj -4072 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 395.0809 185.1725 405.9848] -/Subtype /Link -/A << /S /GoTo /D (a00162_gf11c966b0e4f4ecaa73deb14bfb6830f) >> ->> endobj -4073 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 356.2266 188.49 367.1305] -/Subtype /Link -/A << /S /GoTo /D (a00162_g123c95a7bb55143cabba92446ce8f513) >> ->> endobj -4063 0 obj << -/D [4061 0 R /XYZ 90 757.9346 null] ->> endobj -1071 0 obj << -/D [4061 0 R /XYZ 90 739.9346 null] ->> endobj -298 0 obj << -/D [4061 0 R /XYZ 90 739.9346 null] ->> endobj -4064 0 obj << -/D [4061 0 R /XYZ 90 716.7484 null] ->> endobj -4067 0 obj << -/D [4061 0 R /XYZ 90 569.448 null] ->> endobj -4060 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4078 0 obj << -/Length 2227 -/Filter /FlateDecode ->> -stream -xÚ­[]oÛÆ}ׯÚ ¨·ûý\7mœ"i·‰€ûÐ�*3±PYVõÑ´ÿ¾³$—^r—³®áQæáœ³sf–K/Íæ~ØÜѹQ†8!õ|s?£óOðëïg¬=}ç¯bÀ·«Ù×/¹›;â4×óÕÇ:‚fDqÆç«Û_LÙåw\˜ÅåÕOp¨è‚Ú¼ÜîªæèÅÃær_íÏëóöa¿ümõzv½êh[UJhæIÿœýò�ß‚º×3J„³jþ¾Pœãóû™ä"|ÙÍÞÏ~îâ4'ê rƒSLäGÇ$�ßð0<£5Íè,qË+F)]¬‡Ó×çj·¯Î·á“l†Ã|W}¬ŽKfÕ~Sùa6ñqJÕñ!¿><·]|ÂZ†Õy �nÛ„U§Íq{é‚8"rÁ‡ñ¢]æý]µÛ5×�ªã_K¦ C©¦Ú*B™5s-!ƒÒä« €®bTZ -ÖJÄRœ0Êm-åùD\ÎwÇgCnÀ#8ÃÉ;T†=N£†&Ôc´šþv}ß&ð²ÿcÉè¢Ú�š2]­9‘BA¹ÔWý'‘j ±bö¥6§ÿ˜‡£"ÙኌlËN"{k�ýßÓvs"§j¨…KG4·O[‡Jù{O£yþo25vÅTÉ¡9¡<òEõ+¥|¿­ ³Nô¶ýô¿ß%êa~ ¢Ì5ãDiÚª÷§ŽŸZÌ»Øþ€¿Š/ÈØŸÄõês(Ãq˜¤ÈÖ^@•È“hžœ´IÔ½$Ò’Ȧ”5ôËí~³»Ü¬¡¡ó¿¸läî ¹ïì(rÀ0¾!8õ¾ºÿ}òäç�’‚´‰” ÆÙ^ †-*¡pÀé|Üî?‘»L$ MÁi~“›9!“7�I! LO<®Çꔹ©HíëV�ßêb@n†Ñ0IXùÇþʹJg6?§Ãt‚2v¨/Ü�…³=Þ/oÛ‘&äRà ��wXÀ—d$q½ŒWïo>ìwé|©ˆ¢ÖP%f˜#�sƒпé:g²’D ÅÆMŽ˜ÉV6cŒLÆy;“cÞ &÷ȧ˜ŒËHâ“7ÇœÉÒ¹Âø[P‰×[lÝ`ø`ñmÎbɈ¶°Òµ8`XÙbŒ1²çí,Žy'XÜ#Ÿb1.#‰[/WK'`µÆ[¬®?¼½y÷ãó7ÉÒƒ h<ª „sM·¢/„æ çÖ¯Ÿá3<ÀʆcŒ‘á8ogxÌ;ÁðùÃqI܌ᯞ/%]|—®“ ‘\»BBª¤ÄÁ1Ì}%,ç8SÄXjÇ�˜ãVvcŒÇy;ÇcÞ Ž÷ȧ8ŽËHâfÿß«7iƒS¸#k]ÈF‡*ÈàÔª|ñÄ2xÎnX[îä¸Ý³;ÀÊvcŒ‘Ý8ogwÌ;Áîù»qIÜœÝþá÷æí*±œQ"¥Å@!œ°ƒ|ˆŒáÂ:bÍx{G绪è6F÷h6N¼ŽIËV÷˜'8�kFÍøüâ&�ô¡²x¨ fz%u?õ2g°Ñ�UäY+`XÙcŒ12çí\Žy'ØÜ#Ÿâ3.#‰›u:ÓÍ0å -¡ž�U�áÛÞòa6TÎn-ˆ3ÈSW Àì°²Ýcd7ÎÛÙóN°»G>Ån\F7c÷wonÞ_§³7'ÜÿíMG‡*èà�ØëëÐ9¿#”#�`1ó;ÀÊ~cŒ‘ß8oçwÌ;Áïù¿qI\/cuýæíõjl%Î!eÔÉB":TA�Ÿ”U}\e[[À*Î _1³:ÀÊVcŒ‘Õ8oguÌ;Áêù«qIÜÈêìtsŽ YèPzÎ<½dŸ«Ü3—àŠ0Ž9$/c3w°ã-�GL¨¢ÇÝ£Å8ip8&-Ücžà/®aµçn®��ßú–èø;Îí›]º~ι’ù-0Þ`{;`//û�ß�Íí€qɉР-©‡€D€•+cŒJçíj"æýkÉéâa›ì0ȆƒùrÀ=^_R‘Ä­w1ý^é‡?/Ûsº?"}ŸêBªÄ�`†J>È=Uts·>¶{¨²w7€BaÚGd6õaD® -˜t]à_«`X¹ÿo¿´3~6à«]EѹR-ë¡@ÙRãìcPÏþ³OaýæÀù®}}¦Ù‡•k©¡%PI­"ÿ—)ÅÆow~òUÞÜBáX¹ð£€Xáã¼]áǼåÂïqO)|\E÷±ðLJûCZúŒuP|xªÄoáØÊaöŸ¢ôÃË -Í0°`ž˜´QÓ F# ÐÁ¼†ŸŽÛ}Ûëæãp\Jµ¨Ü4ÆC®AšÃÏÛýíÃ祑‹Ñ†ñ›¬šZý$ ô$ZÁ=o˜Vl˜8 Ò0ÞÐ0=ÞbÃô¹'4LAE÷±a.çÃ%Ó0p7Þ#4 Uâ·šh­Ý ûOÙ0§ó‘}ÕTÞHLá ´;üĘmAéü+~|b Fh¬,ß‚ÍKJOÓ~ðn”OÓ~ðˆgisóÃÚ/ÀÊíÄÚçíÚ/æ-·_�{Jûá*’¸Ñ»€¶ûÌRÍR"(Õ…,T‰ßrbãƒìCû…Läª\eàºU#wËÚõ€¹`e×1ÆÈuœ·s=æ-»Þãžâ:®"‰»¾>6ëÝ.·7f,—…DTI‚³„Á”�7lôM^ -ñ™Vúÿz¾._½ñ|u©‰3ÂÖ³5÷¯ÿÂ̤xåßWûê¸>‡wÐþ?†ƒ×þÍòKû…ñö“>ãâo_ùçÐ/ÍÑÇ%‡µÌ±ù’þoÀïÿ„ÿ øûŸOUò?þeýL–þÙ-Jõendstream -endobj -4077 0 obj << -/Type /Page -/Contents 4078 0 R -/Resources 4076 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4074 0 R -/Annots [ 4081 0 R 4082 0 R 4084 0 R 4085 0 R 4086 0 R 4087 0 R 4088 0 R 4089 0 R 4090 0 R 4091 0 R 4092 0 R 4093 0 R 4094 0 R 4095 0 R 4096 0 R 4097 0 R 4099 0 R 4100 0 R 4101 0 R 4102 0 R 4103 0 R ] ->> endobj -4081 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.7618 250.6249 659.9632] -/Subtype/Link/A<> ->> endobj -4082 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 611.4648 193.391 620.3114] -/Subtype /Link -/A << /S /GoTo /D (a00179) >> ->> endobj -4084 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 465.4097 176.5052 475.3374] -/Subtype /Link -/A << /S /GoTo /D (a00162_g3212e70c55244608ac16316888c354f0) >> ->> endobj -4085 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 452.4583 176.4952 462.386] -/Subtype /Link -/A << /S /GoTo /D (a00162_g6cda47c85ce1b58b501b44ac9cccc50e) >> ->> endobj -4086 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 439.5069 224.8339 449.4346] -/Subtype /Link -/A << /S /GoTo /D (a00162_ge429c985be88ed048f382511c9ff00de) >> ->> endobj -4087 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 426.5554 198.4231 436.4831] -/Subtype /Link -/A << /S /GoTo /D (a00162_g19709735f29dafeabb91e0882231f9f1) >> ->> endobj -4088 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 413.604 206.5625 423.5317] -/Subtype /Link -/A << /S /GoTo /D (a00162_g7e904ab59f7ee134cf3218a8219e7e29) >> ->> endobj -4089 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 400.6526 211.4442 410.5803] -/Subtype /Link -/A << /S /GoTo /D (a00162_g5025948dd998f65a13a375a37aa5edf5) >> ->> endobj -4090 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 387.7011 196.052 397.6288] -/Subtype /Link -/A << /S /GoTo /D (a00162_gbfc1d8d15852318927cda30e1bc0470a) >> ->> endobj -4091 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 374.7497 209.3322 384.6774] -/Subtype /Link -/A << /S /GoTo /D (a00162_gaaaaf66ea67900c36d01136d5bad1168) >> ->> endobj -4092 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 361.7983 213.2175 371.726] -/Subtype /Link -/A << /S /GoTo /D (a00162_g57aca709a33690cd4fb73fe199fa1bdd) >> ->> endobj -4093 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 348.8469 207.0906 358.7745] -/Subtype /Link -/A << /S /GoTo /D (a00162_g8b600918f84783490fd791ce773175ab) >> ->> endobj -4094 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 335.8954 215.23 345.8231] -/Subtype /Link -/A << /S /GoTo /D (a00162_g6b2d00412304e2d95e7b853cce5858b0) >> ->> endobj -4095 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 322.944 220.1117 332.8717] -/Subtype /Link -/A << /S /GoTo /D (a00162_g3318dec654781e9d6d8ec873636660c6) >> ->> endobj -4096 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 309.9926 204.7195 319.9202] -/Subtype /Link -/A << /S /GoTo /D (a00162_gf784a76fe619452eddf87e6376a4bf9d) >> ->> endobj -4097 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 297.0411 217.9996 306.9688] -/Subtype /Link -/A << /S /GoTo /D (a00162_g3a4852e2372e34e1c0142d1147fbe027) >> ->> endobj -4099 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 239.2127 175.2098 250.1166] -/Subtype /Link -/A << /S /GoTo /D (a00162_g984c4a8b65a3cb35460b073a40568c25) >> ->> endobj -4100 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 200.3584 188.49 211.2623] -/Subtype /Link -/A << /S /GoTo /D (a00162_g123c95a7bb55143cabba92446ce8f513) >> ->> endobj -4101 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 161.5041 185.1725 172.408] -/Subtype /Link -/A << /S /GoTo /D (a00162_gf11c966b0e4f4ecaa73deb14bfb6830f) >> ->> endobj -4102 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 123.0234 181.2968 133.5537] -/Subtype /Link -/A << /S /GoTo /D (a00162_g82ff99d50221f7c17df57dc6092ffc97) >> ->> endobj -4103 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 109.6984 196.7787 120.6023] -/Subtype /Link -/A << /S /GoTo /D (a00162_g52c3c5ab1b1aa0659b5e465f7fbcc409) >> ->> endobj -4079 0 obj << -/D [4077 0 R /XYZ 90 757.9346 null] ->> endobj -1072 0 obj << -/D [4077 0 R /XYZ 90 739.9346 null] ->> endobj -302 0 obj << -/D [4077 0 R /XYZ 90 739.9346 null] ->> endobj -4080 0 obj << -/D [4077 0 R /XYZ 90 716.7484 null] ->> endobj -4083 0 obj << -/D [4077 0 R /XYZ 90 483.3834 null] ->> endobj -4098 0 obj << -/D [4077 0 R /XYZ 90 258.1626 null] ->> endobj -4076 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4107 0 obj << -/Length 1235 -/Filter /FlateDecode ->> -stream -xÚ¥X[sÚF}çWh’x`³÷‹§Ó©ìŒ]Bݘ<%†‚l3Á@A¤õ¿ï·ÒJ¬´båi‡t9û�³ßùö&’`ø‘ÄàD … ã2Y<÷pò�?ôˆ{=„÷Cðë´÷îššÄ #©L¦yI� „&Óå—¾F†Tàþ|·;¼ËÒõ&Í–å?z*Þ]¯Öiqõ)}H÷¢ûéfa1ÆqŸ3ø6½í]M+)N©`’X!õ¾|ÃÉßö0bF‹äo¸ÁˆC“秬¼Y÷î{TqŠyƒ¶ ÂÚ{L8‚'´ì2… (¿ÇãÿÖeègA@�"'€¤ÛøTŸq£4›C¤ej”ûÕ.[m7.ó¼±q¬lSĹJ×ë¢Ý!ÝÿÑBôQ3ÙZ L´J$b®Úk£ }TX Ú ŒÄúAu.år"ŽÙÓvÑä RŒ’8y…ja÷S@°BŠ0qŠ–Ó/çÏ.�ÇÍ÷Áýt}(Hˆ×ZRÄ™€‚É[ýHU -i1ëR‹×ß“òê7OvÙ¢E¶ôe‘­€9Èþå°ZÐ!mj¡Ü IµŒ§­B…üµŽ‡Ñ,ÿÏ-56„±êBRžP9J¿bL7«¼0óD¯Ü¿}¾Ô¡ƒ(‰$ ‰�zûjÿè0Ÿ|ûKüÐoÐbת;�̦ CaRÕ�Ѭ½ÕED³äÈ%QÖ’ˆË�DA69Ï¡oW›Åú¸„iCÂÈs\í¶» =½93g0Ž`<c}4ÏæEÂï³ýq‘‹ çÐ2­ -¦Öœœ]|@Û“0H4?űü_)áȶ“ §(c…êâ…Ù`)뼇¼·33°r0Ý`>_^%¾KC×+¯Ù!›ga¥Ã|¨ ãI(Q-j¶[ÿ0¬4þÀk5šk‚(#æ¬Ñ> btë4:Êx2ºƒ·4ºÆûvéz�s‰U¤A~Þëß%#ˆkeL¯Æ“«éhöþ÷Éõl|3¹_M‚©YÁj«$šŽ -Õ¡ƒ*jgQ×Áq›áR#ª1?o¸ˆ^º �1z†Çy+Ã}ÞW^#�áqAÜÀðÉç�ÖóûÐq˜¸Ÿ¹vǪCìf¦®ƒÈ6Ã…@ŒFøé}Ìn‡êv;Bç™%­¼öH_aµÏü§£šQ­†Ï7w³Ë»»÷—ãqà.,ç˜íŠsSè¿`´žôr�ãÄb[ö–å~H¨kX[ö§Åû/»t™>´­pìA°™Óg ÄD*¤‚u–H”ñT#¼e‘Ôx³¢Ÿa�(D•h0Gj¤€wIhFí^è ìä¸Kœ/ VpI1¬ T˜.•®&ö�³l±³å”+�eá|Åç͸]ªEEsSÂ$‡¹Ê[ÞëãfaO­%ɉ]ÎÔù’ô±’,aÝ%côJ2Î[•¤Ïûc@q»Z†ûO@"Ü‘ý§Ãw©âž™>ê…)�Ò”w$¢DuI€R Š‘†Xà2pMÚ¾æ�³ÇT ñ‰ò}èÉ‹GC¨_§»,÷‡œN·ÒMº‡áá>­”×�åÅ­ý`rt7„º|AÙuŸ¼`üÉâêa@E»/nŽ7w�ðÏ÷ùaûÏËcºi¦Ç~…jÉÏ¿¿ Auendstream -endobj -4106 0 obj << -/Type /Page -/Contents 4107 0 R -/Resources 4105 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4074 0 R -/Annots [ 4110 0 R 4111 0 R 4113 0 R 4115 0 R 4116 0 R 4117 0 R 4119 0 R 4120 0 R 4122 0 R ] ->> endobj -4110 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.7618 250.6249 659.9632] -/Subtype/Link/A<> ->> endobj -4111 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 611.4648 193.9489 620.3114] -/Subtype /Link -/A << /S /GoTo /D (a00180) >> ->> endobj -4113 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 535.9072 190.8904 545.8349] -/Subtype /Link -/A << /S /GoTo /D (a00086) >> ->> endobj -4115 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 479.055 271.1301 488.9827] -/Subtype /Link -/A << /S /GoTo /D (a00162_g26440a35353cb457747a4cea372c62e9) >> ->> endobj -4116 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 466.1036 280.5446 476.0313] -/Subtype /Link -/A << /S /GoTo /D (a00162_g30fe27cba3c14ae7f9a7f118144af43a) >> ->> endobj -4117 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 452.1759 213.038 463.0799] -/Subtype /Link -/A << /S /GoTo /D (a00162_ge28f6cb60e86088d8886d0f804b4f37c) >> ->> endobj -4119 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 395.3237 198.6315 406.2277] -/Subtype /Link -/A << /S /GoTo /D (a00086) >> ->> endobj -4120 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.1296 395.3237 276.389 406.2277] -/Subtype /Link -/A << /S /GoTo /D (a00162_g4647b76d0ef50a5305505041f5775a37) >> ->> endobj -4122 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 338.4716 196.7787 349.3755] -/Subtype /Link -/A << /S /GoTo /D (a00162_g52c3c5ab1b1aa0659b5e465f7fbcc409) >> ->> endobj -4108 0 obj << -/D [4106 0 R /XYZ 90 757.9346 null] ->> endobj -1073 0 obj << -/D [4106 0 R /XYZ 90 739.9346 null] ->> endobj -306 0 obj << -/D [4106 0 R /XYZ 90 739.9346 null] ->> endobj -4109 0 obj << -/D [4106 0 R /XYZ 90 716.7484 null] ->> endobj -4112 0 obj << -/D [4106 0 R /XYZ 90 553.8809 null] ->> endobj -4114 0 obj << -/D [4106 0 R /XYZ 90 497.0287 null] ->> endobj -4118 0 obj << -/D [4106 0 R /XYZ 90 411.9902 null] ->> endobj -4121 0 obj << -/D [4106 0 R /XYZ 90 357.4215 null] ->> endobj -4105 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4126 0 obj << -/Length 2234 -/Filter /FlateDecode ->> -stream -xÚµZÛ’Û6}Ÿ¯P%/Òà ¸_\[©u2r2ŽíÙ�Qv’”K–h�*ºLtIìýúmˆdƒU±k†’ûôéA�lDá��eˆR�›+:ú_ÿpŪŸ¯á÷ëðÝìê›Ü�qšëÑìý9‚fDqÆG³å/c¦éäš;.Ìøtû/8TtÌ-^¬ÖEyt³[œ6Åö8?®vÛÉo³—WÓYM[©RB3OúÇÕ/¿ÑÑÔ½¼¢D8«FÁJ˜s|´¹’\„뫇«×qÊÎ't N1Ñ=:& |ÃÃð8ŒÖ”£³„±É5£”ŽçOO‡oþ*Þ-Ö+Çåˆ,Úc½/Þû ³ãb»(üXKFœRgH²çàöBBÍMqœC¤e•¶â°Ø¯žBÒ �ˆ¼ðq¼tWƹÝ<­‹K’ÏvïËÿÇÇJÜ�³YåR%¿m†U„2kFZ€.-;30×(-ë¥")p‹9vù|Ô§ããnÿ¬ÍÌ('Fp†R× ”;N £†&Të̽œoª¼ž¶¿OëC™WÆ¢“5'R(¨¥óYÿHtC¬3º©³üõ÷Q8ú)ÒNH5ëXs;®gŸƒæ.A.H%‹Ý¦-†�cš´”hŒ;‰å|ÛQx×̆€ú–‰zSüJ)ß®.å·ªþûï×E’He‰ÐÜŽ4£ª¤š“üOûæ>ö>à¯ã:ÌOâzuqǶ“H%4ä¢)¤�Å€ÊЧÑ<=©ò¨yd!$3DsYæñëÕv±>-¡c5Ì_�VOäñ+ºïø(z€ëÕ»Ûô’�Að}qØ­ÿÌÉH[I bœm´R+Ч¦’p8îWÛä±#’„æà4¿íšWarp`¼�‰IHÂL£*‹CÇeGjE E.†1 k–Ñ0SXy‰ã å\¥s›ŸðaNAkTŽÊÆQ­›¼_/«‘&äRà k‘÷÷YÀçd$q½ŒÿN¿ûþÕíôÍìíìöõôîçYÒm -ŠÞ -‡ç¢FeDp¥‰2²• ¸–vÙ­àâ¡�í·;`vXÞnŒ1²ç­íŽyØÝ b7.#‰Û´ûa6q.ð0Ÿ�gÓæÇŸ^ݾ™¶• -ʈtšáiªQ}‚ -â¬6M}�u ±‚±þ:ˆXX¾0ƨpÞºbÞuÐ R¸Œ$.Z?NŸßLï’Y–‡Lr‰§¦Fe4qLj¢)‰uYÏ5,²¤ì·>`ÖXÞzŒ1²ç­­�yXß b=.#‰‹Z3‘4|*h�¶DJšIR�ʨã†Â½]Kï*3…‚uBoD¬,_cT8o]1ï€"h�)\F-‚ï_Ý=LÓÛIŒÒOL�Ê(âpçÄe[‘èr®%”#ÿåwÌ÷ -•·¡‹\GIkÓ#ÒžÇÌC,G5´£z ~'áÅ«ç¾Åxûæ.½ºss±Shçç‚aU3]va-,ᶤÏ߀\ò£Œ‹3¼ÁãoÞä&ù—32’¸‰Ïw?%.3M4“ÏD�ÊHà ®÷T©¦„® ¹0 -V¦ÿÖ-`VXÞjŒ1²ç­­ŽyXÝ b5.#‰›XýúÎoÕýgz“8.,�‘*Äq\F7q|zïîîSÇ¡RiÉÞÎ7-CaùË8ž®•ÑÁ9‡E2s-›†ö Ôˆå\ì™�õL€õöL”œ/Ü/”«…ù,ýÂ, –çöz*Û-Q8¤YpÒÐ+1éßo•†²�‚klGmöÉãîpìîA7°4Õ \Ô",ILË›�-‹¸G1fX‹Äh¤EjXo‹Ôyù² ´ TXûyÄ¿À•߯aù‰b=‚óÖM󞶇Շmxîð¸Û»nƒŒ5¶%£¿!>'(‰Ûl‰§-~ÏDå2@~¿ãF¥h%dp? 3Ü ì‡�õC€õöÃ9)ç£íió®Øé¾à’p&?O[À�7&÷,¡†åÛ" -ˆµÎ[·EÌ* á†Û4ǘjq÷÷BÀçT$q›½°Ú®Ò¾tÌÏú.“‡€Ê)pÒ_ZyÚ N!í°^¸`‘N¨@ç;wÿ†ä|½ú_Ñ*ò:=åÇÍnyZ¦Æ¤ë�iÖ»÷N! L+ý·^¦>—¸…S˜àñû½š8#ìù}XÊ2ÿÞt�â÷C±-öóc˜€Ã‹ ¯ÃÁK?žSõ�ñê?}ÆÅ3^½5Î)ÕåÑû Wã]5'¤¯—¿û^.ÿøéC‘¼Vîß÷îÈÒÿD0 çendstream -endobj -4125 0 obj << -/Type /Page -/Contents 4126 0 R -/Resources 4124 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4074 0 R -/Annots [ 4129 0 R 4130 0 R 4132 0 R 4133 0 R 4134 0 R 4135 0 R 4136 0 R 4137 0 R 4138 0 R 4139 0 R 4140 0 R 4141 0 R 4142 0 R 4143 0 R 4145 0 R 4146 0 R 4147 0 R 4148 0 R 4149 0 R ] ->> endobj -4129 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7782 274.5352 657.9796] -/Subtype/Link/A<> ->> endobj -4130 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.5548 205.0073 618.4014] -/Subtype /Link -/A << /S /GoTo /D (a00181) >> ->> endobj -4132 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 463.5277 255.0802 473.4554] -/Subtype /Link -/A << /S /GoTo /D (a00164_g31be289fd8ec3fe09b0088165d13976d) >> ->> endobj -4133 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 450.591 302.4923 460.5187] -/Subtype /Link -/A << /S /GoTo /D (a00164_g8714af98a550f10dc814db92b08d1b0d) >> ->> endobj -4134 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 437.6543 290.1386 447.582] -/Subtype /Link -/A << /S /GoTo /D (a00164_gc4357cec23abca29d2bb885803625a6a) >> ->> endobj -4135 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 424.7176 269.4366 434.6453] -/Subtype /Link -/A << /S /GoTo /D (a00164_g4d457c50e6f2cef57167c3804ce8bf7c) >> ->> endobj -4136 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 411.7809 275.7527 421.7086] -/Subtype /Link -/A << /S /GoTo /D (a00164_g863c94b0ed4a76997e53a3ccd5d0b6c3) >> ->> endobj -4137 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 398.8442 230.8912 408.7719] -/Subtype /Link -/A << /S /GoTo /D (a00164_g40fb1fb2d990ce04ae9bbee275627c03) >> ->> endobj -4138 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 385.9075 217.6111 395.8352] -/Subtype /Link -/A << /S /GoTo /D (a00164_gda99954e0f6905091885934e86c278cc) >> ->> endobj -4139 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 372.9708 239.2498 382.8985] -/Subtype /Link -/A << /S /GoTo /D (a00164_gd895686859ae7d178d31be04eb0a1a97) >> ->> endobj -4140 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 360.0341 236.0418 369.9618] -/Subtype /Link -/A << /S /GoTo /D (a00164_g38af81a4c9884ce89803fc3e52383112) >> ->> endobj -4141 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 347.0974 176.5052 357.0251] -/Subtype /Link -/A << /S /GoTo /D (a00164_g3212e70c55244608ac16316888c354f0) >> ->> endobj -4142 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 334.1607 176.4952 344.0884] -/Subtype /Link -/A << /S /GoTo /D (a00164_g6cda47c85ce1b58b501b44ac9cccc50e) >> ->> endobj -4143 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 320.2477 190.8811 331.1517] -/Subtype /Link -/A << /S /GoTo /D (a00164_g71e1b022f7b7fa3a154f19372b239935) >> ->> endobj -4145 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 263.4235 226.5766 274.3275] -/Subtype /Link -/A << /S /GoTo /D (a00164_g4433d3af16ea083a81576d0f18ba57c9) >> ->> endobj -4146 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 224.9723 221.0375 235.5026] -/Subtype /Link -/A << /S /GoTo /D (a00164_g41e616d3fcc17e0aabfe8ab45ef0d30f) >> ->> endobj -4147 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 186.1475 224.913 196.6778] -/Subtype /Link -/A << /S /GoTo /D (a00164_g0e0ea5f24b77f124ba33bcbc7ede5bfb) >> ->> endobj -4148 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 146.949 236.5493 157.853] -/Subtype /Link -/A << /S /GoTo /D (a00164_g2a939aa4fcffabbce1dc1f784a7e0ad3) >> ->> endobj -4149 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 108.4978 192.9132 119.0281] -/Subtype /Link -/A << /S /GoTo /D (a00164_g3caacabb2fe1c71921e1a471719ccbd2) >> ->> endobj -4127 0 obj << -/D [4125 0 R /XYZ 90 757.9346 null] ->> endobj -1074 0 obj << -/D [4125 0 R /XYZ 90 739.9346 null] ->> endobj -310 0 obj << -/D [4125 0 R /XYZ 90 739.9346 null] ->> endobj -4128 0 obj << -/D [4125 0 R /XYZ 90 716.7484 null] ->> endobj -4131 0 obj << -/D [4125 0 R /XYZ 90 481.4867 null] ->> endobj -4144 0 obj << -/D [4125 0 R /XYZ 90 282.3587 null] ->> endobj -4124 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4153 0 obj << -/Length 834 -/Filter /FlateDecode ->> -stream -xÚ­VMOÛ@½ûWø˜HÍ2;ëýâØh‘ª¶Ô7ŠPHLˆlêhÿ}ÇÞµãb#å�±÷yæíÛ™Ùá!Ð�‡B-5³"Ráâ>€pE¯Ïî—g´>kÞÇÁÑ)ÚÐ2«P…ñméAq&‘c//'†q>�¡„Éüáa{ôœÜ,6ë$Ýí-¶pë§ëM⬋ä6ɧÜL’tQ¼â(`Ÿ^ÅçÁI\Óñl¥P¼ ó;¸¼‚pI¬Ï`Â>Ó0n-†÷A„¢zØ?‚ïµ·P~ðÒ¦#�ÌÎP»m6@=0׌+¤dVòè°Š„†Š¢¡"Å"a¢°†ZþD”] 8ÐW(EØtØgU¡ÆâòˆYPª÷iŠ0ÉÖË^lAhÎe'v±”¯<æ¢É¢Â�±èù-XÔ s½ØdÛ¤GÆZÆGT(!#Á({IƒŽô ¡’�lÞ?wî��V#9âÁ³&ºd"!4ÄDE¥ hiÕš½Ó‚ɇróe�ìî¼±xÌó©ÐT/»Í_÷*{HRg}Šão–¥i²Ø­³”â¯,§‚ÕúMr\iª~¥ÄHŽ×°Ño:Èñ‘¸UŽ·â>¦Ûõ*M–^©»yÞc¡0]‡³½Â�ñéùmgû*Ùu© f(1õ¨@#áQp&ŒÑ�c |¯D8:¥3n|PœºÐÄA8PË+Ilè+‡¹Ë¶»w½= "GõZ9küØ~z~Ëãåêº'£ÁèhXÇ5XP>CóPЏYN[oåTGΘR_!§Øcp“ u!ŠÎQ¼® 5Ñ]¨†¾Öíe>Ðf|›Ê<ÒýQf;c›äOtÏ{/¾òæÛ_θÍòÖgn×Î~Ü®ÓU§ž�ÄθOvwÙòp‡“ÈP‰èm:œ°LФ3Òà> endobj -4155 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 714.241 200.0962 724.7714] -/Subtype /Link -/A << /S /GoTo /D (a00164_g1d34be506a61db90dd7829117efdf8cf) >> ->> endobj -4156 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [172.012 675.0131 229.8943 685.9171] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) >> ->> endobj -4157 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [279.9163 675.0131 304.6036 685.9171] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4158 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 636.1588 208.3951 647.0628] -/Subtype /Link -/A << /S /GoTo /D (a00164_g9e6d2864f390a4ba1ac60dc65e2b9815) >> ->> endobj -4154 0 obj << -/D [4152 0 R /XYZ 90 757.9346 null] ->> endobj -4151 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4161 0 obj << -/Length 2081 -/Filter /FlateDecode ->> -stream -xÚ­Z[�5~ϯÁK"×÷K…¥hYJiƒ@´J3³Ý¨ÙdÉ¥ÐÏñŒíx.±¨öa'3ŸÏw|ÎùìãIH�á�J(d—Åên‚‹wpûÛ q�çð|¾YL<£¦0ÈH*‹ÅMmA$(¡Å¢ümJ$�Í©¡LMOÏ_Á¥ÀS‚psñl½©š«'»Õé®Ú—Çõn;ûcñbòth�W‚IbIÿœüö.JðîÅ#f´(þ‚chq7á”ù›É›ÉOÁNó 049AØðìGp‡úéQ˜­jf§�éŒñtyxðWõvµYÃ<ÎWè¶;××ÕMµŸ=­¶«Êε!!ÈQ“@�-‡„ézDÍ“ê¸K¥ [uXí×÷>h`ˆE¹°vÀu-Mmç»jYq=ðwŒ©÷çfçnoÝ�ï —*7‡nF´@˜hUHl\˜ÁxzÐôv¹²ÕýÞ½´p’öo.–Gw„<¸0¿%¹Ùϸ˜îî:o9B™º»Ò?¸­¶Ý!e8öÜ.ÅÛÊÃö3¦¦ÕªZ¨Jt1J lèÁt:J.H„!Ì„¸¸(Q#aC`,³(XvQŠ &¥ ¯_”Z¼ÙE©Í=bQÊxѳÛ^”V»í¶Z«²ß^Aí‘\0*ã4TH`a:I€5É$¥)ª ¢\°qšŠÑ MØ€¦$�5%™×ܯ5ÿƒ¦,ö¬©[5·cMÙ�¦ìƒFS1Ö‰«†ÕqÔÜI °Nbgˆ§?îÂk +¹ïÉ"i7‡jÿÁ¾l%dzQ˜T€0mwõI„ ==, 9]:T^–gs)U&Iƒ(#Ò¼&câ1’LºÐµÚäq}W•»SkϱݥSQ ´ ”H$8ï„~¬è´4N‹gpJŠ5 DFb%2ê•÷k%Âÿ D‹=+±ÆVÍíX‰vD£Dk㦃t:¬A‘á3¨¬g´¹pºªŸ6jµp›Ç!]Bn/«Ïn‹öÛ•O¡>K-ËùXV±Á„3¼^�-Þ¬ÛÜ#4˜ñ¢g·sÜ»ÛmŠXÃ6Æu:•q‚Ú²0¢›‚‘:$vÿÒtd££J °ÑhróÿMkãæòo±-d× ¹¸Å ô¦JôIn@ûŽŽß6‰Ý6%7ŸF¸°*3jxN¸–nd0%Ü4onÌ›n‹{ŒpÓ^ôìvúÙÍî0¤[Øíñ5‰€Êø@!BÑNÆÊö:†ÉÈý3F§dëa²Õ­^>9Ùj×ËꨗÕbz3#Ó³ráF#ÝnguhguhgkÓî–Ӯš7Ú=C…ÓÜ ÚÕMÓ; Øó)³Éóe=Ú�T3ùIôhWg®s¯í=*«ÆÈ\BŒiR¯Å˜4+Åñ%¦]èZmëp½]÷¿4†H“Ž€eè G«vr´?X!ˆðá/…0˜'²yôŸVSŒ†!$> -›B"£˜®ß*Qh{<ïŠõüÛj[í—a3òÝþâÅŒˆéÉ}°?³©ÿ㇔=¤î÷CcévÞùº]°ÿC#¿Ó=Ùýýñ]Õû�‘ýåÏ@”þ É9¿endstream -endobj -4160 0 obj << -/Type /Page -/Contents 4161 0 R -/Resources 4159 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4074 0 R -/Annots [ 4164 0 R 4165 0 R 4167 0 R 4169 0 R 4170 0 R 4172 0 R 4173 0 R 4175 0 R 4176 0 R 4177 0 R 4178 0 R 4179 0 R 4180 0 R 4181 0 R ] ->> endobj -4164 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.5601 274.5352 659.7615] -/Subtype/Link/A<> ->> endobj -4165 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 611.1369 205.5653 619.9836] -/Subtype /Link -/A << /S /GoTo /D (a00182) >> ->> endobj -4167 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 517.644 202.5067 527.5717] -/Subtype /Link -/A << /S /GoTo /D (a00097) >> ->> endobj -4169 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 460.4808 309.3265 470.4085] -/Subtype /Link -/A << /S /GoTo /D (a00164_g5a5bfd7e9060903893481db90645187b) >> ->> endobj -4170 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 446.4691 213.038 457.373] -/Subtype /Link -/A << /S /GoTo /D (a00164_ge28f6cb60e86088d8886d0f804b4f37c) >> ->> endobj -4172 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 389.3059 210.2479 400.2098] -/Subtype /Link -/A << /S /GoTo /D (a00097) >> ->> endobj -4173 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [210.746 389.3059 288.0054 400.2098] -/Subtype /Link -/A << /S /GoTo /D (a00164_gdc5aec3587b2c55b714a6c2f37b56cba) >> ->> endobj -4175 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 332.5162 226.0986 343.0466] -/Subtype /Link -/A << /S /GoTo /D (a00164_gc4b119801e50cc1824498a1cdf9adc37) >> ->> endobj -4176 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [276.1106 332.5162 300.7979 343.0466] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4177 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 293.4938 220.0116 304.0242] -/Subtype /Link -/A << /S /GoTo /D (a00164_g6b942c1ef22f8cd1a726ef3364c9fbea) >> ->> endobj -4178 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 243.5125 215.05 254.0429] -/Subtype /Link -/A << /S /GoTo /D (a00164_g23705efb9077187881f094fc9be13bde) >> ->> endobj -4179 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 193.5312 209.501 204.0615] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf11d9915ec12a8cdd9fdcbb5e8fcd5c7) >> ->> endobj -4180 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 143.5499 205.0776 154.0802] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf8f12c820cc08da32aa62898bfc02db3) >> ->> endobj -4181 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 93.5686 192.9132 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00164_g3caacabb2fe1c71921e1a471719ccbd2) >> ->> endobj -4162 0 obj << -/D [4160 0 R /XYZ 90 757.9346 null] ->> endobj -1075 0 obj << -/D [4160 0 R /XYZ 90 739.9346 null] ->> endobj -314 0 obj << -/D [4160 0 R /XYZ 90 739.9346 null] ->> endobj -4163 0 obj << -/D [4160 0 R /XYZ 90 716.7106 null] ->> endobj -4166 0 obj << -/D [4160 0 R /XYZ 90 535.7017 null] ->> endobj -4168 0 obj << -/D [4160 0 R /XYZ 90 478.5385 null] ->> endobj -4171 0 obj << -/D [4160 0 R /XYZ 90 406.0564 null] ->> endobj -4174 0 obj << -/D [4160 0 R /XYZ 90 351.1766 null] ->> endobj -4159 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4185 0 obj << -/Length 1318 -/Filter /FlateDecode ->> -stream -xÚµYMoã6½ûWè Ãá·öØ6I h»õm»X8¶bµ¥Ô–w›þúŽ,Š¡$‹T± r%>Í ßð�F4$ÿ Ii¢¥&)*Yì&4YáíÛ ØéKœ¿ô?Î&W7,MR’*¦’ÙÓÉ‚"°d¶üta°é%“ôbþü|¸ú–=.¶›,/_Gd]Ïßl¶Y=ú˜=eû)˜‹,_T·p ŠO?Ïî'×3Ž�VrU0O>}¦É£¾ŸPÂS#“oxA ¤)KvÁxs±�ü1ùÝÙ©'Nœ[´ ’n’K¦ëez ¨& ÒÄ�ÍK’&W¢b p’êÔ$ ª¢ê.ß”›ùv󯥡\Û�£ª¾ÜË#Rò‚ti¼k@ûÀ!ª�I%Èá„SE¨/áÜK8à¬àF$V­åOÆd?8|ŠIžøÏhQ1¿ HJ•jû=æ‡Í*Ï–5S‹õ|ß‹BsB©éFQMíWó±Å’ÅÇâéÙ­âq©û²ÊÊn(ŒbªMâ£EÜ3„£;i ’6$\Ý€ð¨²Î5:©�”× –U¤ØàS5f]Êzk0”¤ÀÔX:>¶žžÝSzA}éÑÈ)'ŠjæÑ¡"Žy5ë'¥òû\ìqé­=Õ¡SP¢ -9N'Űm†‚!«€Öã -Ž�T«bøõ9Ëmu¶ÿ™Í~³ -ò<[”›ÂΔ…Eº¢TÙþ+–kkÅ*o~ø«<ûÖcõªëññ°ÉW�Zw{=³U.+×År°Â)Ü �y“ -‡™#Œj©p­p¾Á@…‹øm*\Ëï×)£ÅfÙóÍ ¸È¶ïáºÖàcQôì¶ëÚb[²^0iJ  qÎ(¶ÈA‡z¬j AýHF˜âb¤~H"( ·é> ”ðÏxÈ£—ò°_—sßïÀ;›XÅU÷�Ú -N0ìs…é7¼-|,ÌžÝöÆØmðõôòœõ;:I¤¡"L–CE¢¨Z?ª¡“£±Å�R"¤ùµâ£Ců��š‡Çr¾É;ÕïáîáÚÞªø©ËßÓp‰ì–Åå¼´�¡¬1óÝ`�”&%"5úH1(\‘"Ú8XT0¾Á€`"~Á´ü~¿`ÚÁ�L$̞ݶ`ê¶/ŸïÎH†*€…ér¨H ?k$‡´“¦‘š‘ -ð�óqšñÑÍ8Ø f> endobj -4187 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [172.012 702.9085 229.8943 713.8125] -/Subtype /Link -/A << /S /GoTo /D (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) >> ->> endobj -4188 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [279.9163 702.9085 304.6036 713.8125] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4189 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 664.4278 200.0962 674.9582] -/Subtype /Link -/A << /S /GoTo /D (a00164_g1d34be506a61db90dd7829117efdf8cf) >> ->> endobj -4190 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 625.1999 208.3951 636.1039] -/Subtype /Link -/A << /S /GoTo /D (a00164_g9e6d2864f390a4ba1ac60dc65e2b9815) >> ->> endobj -4191 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 612.2485 226.5766 623.1524] -/Subtype /Link -/A << /S /GoTo /D (a00164_g4433d3af16ea083a81576d0f18ba57c9) >> ->> endobj -4192 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 573.7678 221.0375 584.2981] -/Subtype /Link -/A << /S /GoTo /D (a00164_g41e616d3fcc17e0aabfe8ab45ef0d30f) >> ->> endobj -4193 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0186 534.9135 224.913 545.4438] -/Subtype /Link -/A << /S /GoTo /D (a00164_g0e0ea5f24b77f124ba33bcbc7ede5bfb) >> ->> endobj -4194 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 495.6856 236.5493 506.5895] -/Subtype /Link -/A << /S /GoTo /D (a00164_g2a939aa4fcffabbce1dc1f784a7e0ad3) >> ->> endobj -4186 0 obj << -/D [4184 0 R /XYZ 90 757.9346 null] ->> endobj -4183 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4198 0 obj << -/Length 923 -/Filter /FlateDecode ->> -stream -xÚµVßoÛ6~×_!t/öƒ™;þ Å6d)–aÀÚØC[ Š,ÛBlÙ“äuýïw”DG–ØxÃ0ˆ)é»ï¾;�‡1ÐÆâD%Ì -©ãlA¼¡×o"ì?/èûbøaÝÜs5×ñrÝ2hdŠ#�—«3Ôr¾à–‹dvúéWZ*˜!ƒnq_ìònuwÈNû¼lÒ¦8”óOˇèÇåÙm¯J �ÎéчO¯HÝCLX£âÏô ­åñ>’\ø‡]ô>z{æé>´¡àŠpt(½á>»§ò©ÝÎ]Ýeq`­9“BQeµVßN¤& 36Ñ#©Ýç§Ø¯~ÈöÙz({Âì¤$û»ºÈjVçc-\Z¦¹Ñ/§íŒšú¿|Êæü¿à•§ätŽ©ò.ÿÀË¢­Ú¾àº_÷~7Q�Ê0A,±F` -D¯Þ}ª6=æÝpû=~14lÿ„שÜqW¨FBÆiô¨+î§lÎ=ëÓ¨/Òˆžʧ”-ô›¢Ìv§uM�áÕ©8²í+gî~!à±>dOh�³MÆ¿€¶yûG":øº¾F>=wJ°Äš‹s7Ê�jIµÖêfUØ6@$‘)°Ç½&Ý€ÿŸ¸ª(7autÈ9$#u÷ɳTÁ µY!µÛ®ÏߟÊÌ�­:pŸJŒøú-?„:¦¦¦gä3�sø‘s5íÔî£öø¢Ç3êš_ºŠ-h}é·­¡ß©äÖ}ÄÆ0.ÁŽD|½sxü59Þ 9“¾Á3‰•/ç⌺âœsj[ Õä倂l›V}%É ªá+‰z¬´jʯA_·eº§­04�!C™#¢C­ôšÕÚ"4d‚‚gM³—0N©àdèÆ2/Å)~“—y•6~.òË/~ñàf�Sÿ€¼ÿ…[.ny?”rÝ­Ös®f‡~0šN¯�_üìú×—M>):7N²ô7<‰”!endstream -endobj -4197 0 obj << -/Type /Page -/Contents 4198 0 R -/Resources 4196 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4195 0 R -/Annots [ 4201 0 R 4202 0 R 4204 0 R ] ->> endobj -4201 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4202 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 202.2478 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00183) >> ->> endobj -4204 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [187.2447 427.1275 226.8757 438.0314] -/Subtype /Link -/A << /S /GoTo /D (a00165_ge6f849e94cf6e214be8ffa9a548ecfcd) >> ->> endobj -4199 0 obj << -/D [4197 0 R /XYZ 90 757.9346 null] ->> endobj -1076 0 obj << -/D [4197 0 R /XYZ 90 739.9346 null] ->> endobj -318 0 obj << -/D [4197 0 R /XYZ 90 739.9346 null] ->> endobj -4200 0 obj << -/D [4197 0 R /XYZ 90 716.7484 null] ->> endobj -4203 0 obj << -/D [4197 0 R /XYZ 90 446.0774 null] ->> endobj -4196 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4208 0 obj << -/Length 1107 -/Filter /FlateDecode ->> -stream -xÚ¥W]oÛ6}÷¯Ú˜™Ëo2†uõ’5k�®5°‡¶Y‰�8vfÉëúï{)‘²,ÊÖ€¢@*J‡÷œûi’&€ÿhb!ÑRË…J²§$øúzDýç)~Ÿ¶¿ÍGWÌ&–XÅT2¿¯,(J$£,™/>� ¡b2eÆéósqñ5¿+òÝ„Âø_÷'ß],Ëòy1ÍVdYã®Vë¼~ú�ß;¬ç›Ì½«Ù˜*9ù2¿ý>odyÕ’+êDý3úô’ª¿áÖÈä+.€PkYò4Œ‡ÅzôqôWc§þPmès^RÞï=ß°à>Ãhè¶÷àÇÝGŸk2J¬”&Ãq1s #ÔÓÍò2EK‹ÚÔ,/²Ýê¹\m7ÞoåÌÙq.ØÚÎ߃Òîê�(¥J”êו�úyµ)óݽs$ͼæež.ô3[礛-# P£Å  ¼7Ö4m£âj3–p´%�€�²Òÿj‚äûr¹Ý]v¹)0¢9£çÉT{;n4є˃µŠ~‘>ù¨ï7�Uš×EuJ[»#‚K¬¸j×Ï‘T­‰±Zu¤ÖŸ“ðôgKvØÑ#[µeG–�€eÿZ¬²‚yW –(fÔù°5¨˜ÿÈñØšãÿ¥§0§T“ ûëÁ!g¹«¬Íªªf_ˆíŠ‹") áh%QˆîÕ»O»�ùÐNÀOÛzÒÙuêÚ Ý #PbÀÊŽ�nj€>¶æè‰£: -# &©Æx -QA_®6Ùz¿ÀÎU80^<Ûì‘,_8n$ÔPÞ­|ôО¡Äq ?gi™ÖÉùXîöY¹¯'ZÑ3Ã%5D'yÚ€¾nTØPFì8þÏŒÉx -¸©‰­w–±A ñâÔµ Ô1oQy1s‹?SÜt˜O—bÀiˆì6¥x‹¥x›¥ëu¤Å*ÜcÅ@ªGÁQÞ1A¨dí.íÍ´p' ìd¦Û€3™n`ƒ™>ËxÈôoÈôïË…÷4"Šh¦i‡üt²~HFd×Éøc>?»}}ýæöõ«·o£ÑÃ]¦"-ÝÑP -bkU@Â&}Êò'…r70ö«ûý&sA4Î’&ÏOS ŽÆbO²jð´�®$JH JT¢ -žŒ@[s0Ú©„‘:VV¯y¶NwîÄ“º—ä¤V.‰ZüO­-ô‰ÞÁi.”�ä•—Ô×;\¢­<Ý;mÀ™Þi`ƒ½s–ñÐ;¼¡wŽx› Õ$¡+ÂÂØŽˆÓ=ðCr"»Gr¢öa’mÅùX4¨rÆðà �vr€í“-±ö꣢8Ú€¥‚Ç\ð@à=‡%Œ¯¡á8éú°¯ÕÜý„â=A÷ÞïÍáýJýÐ-ª*Bƒ[(gízWx+Â_(Iò"œÖë|“ïÒ2ÜUB'¾ 7®÷~A™ÿ.¿dP¯€òÝ> endobj -4211 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4212 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 202.8057 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00184) >> ->> endobj -4214 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 515.2493 197.5356 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00079) >> ->> endobj -4216 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 458.7707 232.9533 469.3011] -/Subtype /Link -/A << /S /GoTo /D (a00165_g1dbc635a2924806f42d7e3273a6a69b5) >> ->> endobj -4218 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [187.2447 375.6421 226.8757 386.546] -/Subtype /Link -/A << /S /GoTo /D (a00165_ge6f849e94cf6e214be8ffa9a548ecfcd) >> ->> endobj -4209 0 obj << -/D [4207 0 R /XYZ 90 757.9346 null] ->> endobj -1077 0 obj << -/D [4207 0 R /XYZ 90 739.9346 null] ->> endobj -322 0 obj << -/D [4207 0 R /XYZ 90 739.9346 null] ->> endobj -4210 0 obj << -/D [4207 0 R /XYZ 90 716.7484 null] ->> endobj -4213 0 obj << -/D [4207 0 R /XYZ 90 534.1992 null] ->> endobj -4215 0 obj << -/D [4207 0 R /XYZ 90 477.3471 null] ->> endobj -4217 0 obj << -/D [4207 0 R /XYZ 90 394.592 null] ->> endobj -4206 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4222 0 obj << -/Length 1627 -/Filter /FlateDecode ->> -stream -xÚ¥™Y�Û6…ßý+„äÅ~0ÃEÜ‚"hŠ,˜mÒÄA’ ÐØš!�ë%3é¯ï¥$Ê”H“*ŠÙ>ºçè~µ�dþ‘LãLr‰4ËE¶¼�àì¾~=!íÏsø}î -~[Lž¼¢:ÓH *²ÅU]AÄ)¡ÙbõyJ„˜Í©¦LN�ï`“ã)A¸ÙxU­ËfëÅÝòx[nÅ¡ºÛ̾.ÞL^.:Û6g‚Ó¿'Ÿ¿âléÞL0bZñì>`D´¦Ùí$§Ì~XO>Lþêê4?Ô;„Ž>:’#ø†Úãp´²9:…ŸÍ ÆxZl·û'÷åå¾ÜÍžþ0ÿ•»'7‡Ãv…–Ãã}_^�š–›eiŽ·1"Hs^A£�U'#DZ«å¡€J«¶uå~¹«¶¶qPˆ9Íĺlö„¨“CÌçS4l»â%3‘C7sV4wUþ°PaÌ §ˆ`ªê0Ïgâx¸¹Û=zƒIFIܼSÜÝ&,‘$ŒŸªÕö«â¶máq󽿵Þ7-$ÄÙ[P”3C§Þë/ª”Hi¨Ù�Úüü=³[¿;±í�ØÂ�íU6 -ˆýë¾ZîѾf¡¹F‚*o[§òý{îW3þÏ£lN¸-IáD…ñ`”/Ê/ÓMUͺÑUû×|¿öÒ®ƒ*™ q�Ûôæ§Ýu«yïâ·ú¹»C¿Wפ³gæ0ŒhÉõ0ÄpäYUÊÚ«f¬QÛBö\ÛŠDB+ó¼V>®6Ëõq³†€ÿѱڢ›Gfosb7B67”æg¥ó«ýQ/¯«ñ9æûîÚ\' ü3�3$µê�yƒ®Áy�Ãhk�º TÊáL¢Ø -Ÿ…f\˜M4  sËÌiÔÄå>pUÊóÚ�ž½Vº‚д$`fQù©Ž1üB)÷§Cs-€9(êØ©R¾pAÓXˆ¾ïãU{¤žy.�¤’ ÌÏŸ–VŸŠáÕ51>,fšÁ¥�2]¼üöiF(ž>¿X\üùÚ›í(N˜Ä»Ò©q íHH¬úqp;“pÑåYìŽ †ÝÊÒØcŽö¸o‡Ýõ�½g>{<†W7€ýíÇÅ»� 8iÉDûÑ©A(… ;‡I „„€Ã-æš�îbÀ­, <æè�ûvÀ]ßÀ{æc€ÇcxuMŒ‹o¿mÖþÍG+�h€U¥œáJk=h~ÀE2\ àFQŸ‡ìb�­, 9æè@Žûv�]ß�{æc Çcxu-äý¶Xú1à�@©\'z`U)sM“œ÷Íñ ÍÞðüS‚Ÿåì -"œ;Y’sÔñÄ9ák9÷|Óœûæ#8'bxu-çËbsíc–ˆPž'Z`U)o‚ˆ�7`ÍÙ î¼)ŽP>ýƒÜªÒŒ#vâ¨iGØ1ØuÃ7šaXÕÒÝ–»e¹9x)4\:¥Tñã·¢„·Öðˆ¤xÏèò]Itôü[*WãkeiÀ1G‡pÜ·CìúŽ`Ü39ëë`®îV>e†(¡y¢ V•r7Oº˜ ÜtÍá¡ G±\A ´•¥AÇÐqß´ë;tÏ| èx ¯nwU^û›Ðt-Tª­(e­1"’ɾ5P¾ -Q†œŒGž¨\AŒ²•¥)ÇÊqߎ²ë;‚rÏ| åx ¯®¥¼¼[û¯Óë»* wUñXUÊÜÜ{)>è~`Å™—,­¼÷’åÕq³4o C/Y(ɵ:?Õ»‚ÈØèdɱu<��„¯=ß3Чw•?ÃB74!|à}~hX}*…W·{õù­Øn—ÅzõËÞx¬*@$˜¢ƒöcŽm+`;tÿF¥@<—äü¼.½Ë’Y~µÑœ.ý LR…4endstream -endobj -4221 0 obj << -/Type /Page -/Contents 4222 0 R -/Resources 4220 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4195 0 R -/Annots [ 4225 0 R 4226 0 R 4228 0 R 4229 0 R 4230 0 R 4231 0 R 4232 0 R 4233 0 R 4234 0 R 4235 0 R 4236 0 R 4238 0 R 4239 0 R ] ->> endobj -4225 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.7618 250.6249 659.9632] -/Subtype/Link/A<> ->> endobj -4226 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 186.7561 620.3114] -/Subtype /Link -/A << /S /GoTo /D (a00185) >> ->> endobj -4228 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 447.7854 224.1764 457.713] -/Subtype /Link -/A << /S /GoTo /D (a00165_g7d7920c1e51cc4eef80206ebd6fee3f4) >> ->> endobj -4229 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 434.8339 220.9585 444.7616] -/Subtype /Link -/A << /S /GoTo /D (a00165_g8a645f8831837320c4e0c704e871abcf) >> ->> endobj -4230 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 421.8825 176.5052 431.8102] -/Subtype /Link -/A << /S /GoTo /D (a00165_g3212e70c55244608ac16316888c354f0) >> ->> endobj -4231 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 407.9548 190.8811 418.8588] -/Subtype /Link -/A << /S /GoTo /D (a00165_g71e1b022f7b7fa3a154f19372b239935) >> ->> endobj -4232 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 395.0034 188.1217 405.9073] -/Subtype /Link -/A << /S /GoTo /D (a00165_ge3f8f7deae69854853b0c8ebb82c380d) >> ->> endobj -4233 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 382.052 198.0741 392.9559] -/Subtype /Link -/A << /S /GoTo /D (a00165_g79f9a50c2cccb967d38a2eeb45d2fd75) >> ->> endobj -4234 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 369.1005 194.2087 380.0045] -/Subtype /Link -/A << /S /GoTo /D (a00165_gf7dd2757d1e766f65b01ba7c91c660a0) >> ->> endobj -4235 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 357.1253 188.6793 367.053] -/Subtype /Link -/A << /S /GoTo /D (a00165_g820fb27c50e7bb4ac6d9eae1b06630a5) >> ->> endobj -4236 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 344.1739 190.8912 354.1016] -/Subtype /Link -/A << /S /GoTo /D (a00165_g14e276fa8e765f774f4162619f1c8fc1) >> ->> endobj -4238 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 286.3455 190.1438 297.2494] -/Subtype /Link -/A << /S /GoTo /D (a00165_g648ddfb2dde2cc55034e4e0ea41cb6d1) >> ->> endobj -4239 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 273.3941 174.6619 284.298] -/Subtype /Link -/A << /S /GoTo /D (a00165_gc364305cee969a0be43c071722b136e6) >> ->> endobj -4223 0 obj << -/D [4221 0 R /XYZ 90 757.9346 null] ->> endobj -1078 0 obj << -/D [4221 0 R /XYZ 90 739.9346 null] ->> endobj -326 0 obj << -/D [4221 0 R /XYZ 90 739.9346 null] ->> endobj -4224 0 obj << -/D [4221 0 R /XYZ 90 716.7484 null] ->> endobj -4227 0 obj << -/D [4221 0 R /XYZ 90 465.759 null] ->> endobj -4237 0 obj << -/D [4221 0 R /XYZ 90 305.2954 null] ->> endobj -4220 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4243 0 obj << -/Length 1440 -/Filter /FlateDecode ->> -stream -xÚ­XÛŽÛ6}÷Wé‹ Ô ‡w.Š  6 ²ÅmºoIPxmy-¬/[ÙÎ&ýú%Q–DYtÐÀÖåèœápx4"$�Xšh©‰åB%ó͈&xùݪÛS¼?m^ß�^¾e6±Ä*¦’»eÁ €H,¹[|j2e’Ž×ÙýËMº¹Ÿ:&óòÚÛl�–GÒešOÀŒÓíÜ]ÒÆÀ”ž|¾»½¹«C¨"”\� àŸÑÇÏ4Y`¤7#J¸52yÆJÀZ–lF‚q²ý5ú³æ)oô Tï)‚W˜*ÑëæH�Òï*ޝ$b¥,ˆ1ÉŽ—™1�Šú:=Ì�iQR]§ûyž=²Ý¶"â�¹p<.\[òܦ›]þ­|ð~½›?–‡³5Ï -Šâ<ßÙ6Ý“nê�$ŒN7„ZÊ{çAÓ&*,c ¥¹$%THYøÛå�‡Õ.¿êjeDsÃâ5ªG½™ šhàòÄVÈ/f›*­Çíãè8]ïË´4žVŒ.±|Ч~ BÕš«U'Ôòöcâ�~o„íŸè [5Ø]3 û×}6ß“}Ú�… K3j8m5*Ôo GȳNlR­¦£k�Ê·§ß B è¦á¼uòK¬)‰¢.³Î&zÀ:kXñ1Q~U]lœË|"äx·iá;˜Ý2¤¹Ð]±ã5¼;îóæZÁ##X£Öj)Q®AíËÿIÝ£bòÛ°»bw¬öž?Ä]…Óæ&æ®w×á�»ëÖîÚÔ�¯°@zšM)ð¨­;ØløXomË< ¿ðpU[`,2|�ЉæÚ+ÛIûyÏÄ0.´º4 5>GÈm7aB‹á4Ô¨P¾Ón¢9Ze' xæÏ¥… ¼�¹ÛaÑÐy‘>òA+f¿I­¹ÐŠè!+ö°rÛaö#ÌxÿTðäøK¶;î×ßgÎÖV”m+çÝÙã#Ùycþ,8v[ÊöOJ­_£"ú!Û°?£yiKíEþÌ…3óþ�Š•Jªÿµ?\¸<68kna*×¶¿ý Ü:wãz—nÓk¬šh¿Ãuën\u«`Õ?½büŠÑòŒQZí•/' ë//OŽïÿ¨Ð¤ÞWõu½ûúí!Ýv3ê6¯}h�üüAµ0^endstream -endobj -4242 0 obj << -/Type /Page -/Contents 4243 0 R -/Resources 4241 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4195 0 R -/Annots [ 4246 0 R 4247 0 R 4249 0 R 4250 0 R 4251 0 R 4252 0 R 4253 0 R 4254 0 R 4255 0 R 4256 0 R 4257 0 R ] ->> endobj -4246 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4247 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 190.781 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00187) >> ->> endobj -4249 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 515.6229 179.0853 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00159_gd58a6c7e62ae59bf7a016ded12ca2910) >> ->> endobj -4250 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.5282 515.6229 265.4205 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4251 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [304.8984 500.6286 338.7573 510.5338] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4252 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 476.7686 192.6345 487.2989] -/Subtype /Link -/A << /S /GoTo /D (a00159_gfe5e93119035e14cc485760a176249ba) >> ->> endobj -4253 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [221.0774 476.7686 278.9697 487.2989] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4254 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.8358 461.7743 391.6946 471.6795] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4255 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 437.5407 180.9085 448.4446] -/Subtype /Link -/A << /S /GoTo /D (a00159_gceb952d27de8125d5146ac0bee325b8f) >> ->> endobj -4256 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.3513 437.5407 267.2437 448.4446] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4257 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [397.2067 422.92 431.0655 432.8252] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4244 0 obj << -/D [4242 0 R /XYZ 90 757.9346 null] ->> endobj -1079 0 obj << -/D [4242 0 R /XYZ 90 739.9346 null] ->> endobj -330 0 obj << -/D [4242 0 R /XYZ 90 739.9346 null] ->> endobj -4245 0 obj << -/D [4242 0 R /XYZ 90 719.4886 null] ->> endobj -4248 0 obj << -/D [4242 0 R /XYZ 90 534.1992 null] ->> endobj -4241 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4261 0 obj << -/Length 1733 -/Filter /FlateDecode ->> -stream -xÚ­YÛŽÔ8}﯈ÄK·´m|¿ Õj�ˆ½À¼B=ݦ5}aûË~ý–“8íÄŽ�Õ¢y˜¤sR§\U>.ǤÀðG -ƒ %2ŒËb¹�àâ3üübBšÇsx>÷O®'ŸSSd$•ÅõmeA$(¡Åõêý”H=›SC™šž_þ—O ÂõÅóõ¦¬¯®öËó¶Ü�§õ~7ûxýjò캥m¼LKú×äýG\¬À»WŒ˜Ñ¢ø7ch±�pÊÜÍfònògk§~P½œ ,>:ÂüBÝð(ŒVÕ£Óˆ¨Ùœ`Œ§›õÍÃm¹½™qžB¦×4ÐT*´ 2…”ö °U… |$?Õ3üHá–4×äÁƒ#�¥_3¤¹Ãù÷©p°|¤½Hó¶5àóŽ(‚ù˜*H»Ø�ÕAXZž E‹ÊøZKVBP¤1d¤N†B¯> U'–¯“£W'iÞ¶N|ÞuÒ!S'i7»®Nb- QTf†ïP9ÞÀš«�Ýb[ºœ7�€»ß�·±"°�/�í ´Ü°ÐÐŽc‘üÔà¹�®ü¸ÐàŸä•°YÁÊè‹Ñz¹Zn‡ìõšmOÓ²l{»�ÅÓ{4è'‡ÔFGúé¡ã+*‡žKcYyøü¼[ÚV4¶ 2 ».žè›|@b¦´°ìLI2^fJ†×Í”ïWãýzvN€&Dô¸�SƒÏyØm;§5tÿál�Ý„6™4 µ†žZÕ ¼UÇhóH±F‚r>6->ãGh7Ó›£®Ð¹rFs[ø–WWÏ`J]Ó¼­ºú¼Ë;(�H³)lȺ¼Éf³Âç<ì¶rq{(ÃÍ¡‚W ¥™á;TŽ\SÄ1ì2ºaÖLb¿ç*96->ãGh7ÛnJD¹âé0´¨�¾×nj¤˜&ý0ŒÐÌf»šX�™=ÓQ¤·§Œ~9RRLíXÝ=ø–b��âVï}?BŒø/ÍΚˆé×õþ|Üü7q6Q[¶ÝP «³Ãg¢ÚÍé3gÐmIOJËߢ2ü¡µ¤>S ÒA�¥Ï”X1§1ÿ0"‘Bþ¯éJä¡÷`¤ûýBÚ®E×^´gÏŠÀUÄxQîÊZ“mw°öÆ]¼²%rnnmþãG”=¢ÍÉ;ÅX6U8£P„‡ú&<¢¿ùîèÿþþ¹ Žæí™¹s͋ҿÌ3î»endstream -endobj -4260 0 obj << -/Type /Page -/Contents 4261 0 R -/Resources 4259 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4195 0 R -/Annots [ 4264 0 R 4265 0 R 4267 0 R 4269 0 R 4270 0 R 4271 0 R 4273 0 R 4274 0 R 4275 0 R 4276 0 R 4277 0 R 4278 0 R 4279 0 R 4280 0 R 4281 0 R ] ->> endobj -4264 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4265 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 191.339 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00188) >> ->> endobj -4267 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 551.4743 196.4299 561.402] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4269 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 494.0195 227.9818 504.5498] -/Subtype /Link -/A << /S /GoTo /D (a00159_ga680bc3f3a1a8a6aec20fe729d138cb8) >> ->> endobj -4270 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 481.068 223.0005 491.5984] -/Subtype /Link -/A << /S /GoTo /D (a00159_g720ac440c7b24bdd07c53ba146e36fb2) >> ->> endobj -4271 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 468.1166 178.1689 478.6469] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4273 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 385.3616 179.0853 395.8919] -/Subtype /Link -/A << /S /GoTo /D (a00159_gd58a6c7e62ae59bf7a016ded12ca2910) >> ->> endobj -4274 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.5282 385.3616 265.4205 395.8919] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4275 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [304.8984 370.3672 338.7573 380.2725] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4276 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 346.5073 192.6345 357.0376] -/Subtype /Link -/A << /S /GoTo /D (a00159_gfe5e93119035e14cc485760a176249ba) >> ->> endobj -4277 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [221.0774 346.5073 278.9697 357.0376] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4278 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.8358 331.5129 391.6946 341.4182] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4279 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 307.2794 180.9085 318.1833] -/Subtype /Link -/A << /S /GoTo /D (a00159_gceb952d27de8125d5146ac0bee325b8f) >> ->> endobj -4280 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.3513 307.2794 267.2437 318.1833] -/Subtype /Link -/A << /S /GoTo /D (a00081) >> ->> endobj -4281 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [397.2067 292.6586 431.0655 302.5639] -/Subtype /Link -/A << /S /GoTo /D (a00159_gf31774d02a69fd3f1c2b282454438cba) >> ->> endobj -4262 0 obj << -/D [4260 0 R /XYZ 90 757.9346 null] ->> endobj -1080 0 obj << -/D [4260 0 R /XYZ 90 739.9346 null] ->> endobj -334 0 obj << -/D [4260 0 R /XYZ 90 739.9346 null] ->> endobj -4263 0 obj << -/D [4260 0 R /XYZ 90 719.4886 null] ->> endobj -4266 0 obj << -/D [4260 0 R /XYZ 90 569.448 null] ->> endobj -4268 0 obj << -/D [4260 0 R /XYZ 90 512.5958 null] ->> endobj -4272 0 obj << -/D [4260 0 R /XYZ 90 403.9379 null] ->> endobj -4259 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4285 0 obj << -/Length 1524 -/Filter /FlateDecode ->> -stream -xÚ¥XmoÛ6þî_!t@a3Ñ¢²lËK‘.-¶ÖÝ—¶TI¶…Ê’'ÉÍŠaÿ}¤HÊ´(KÁ†EŸ»ã=w<yPü!/„^@Ÿyñn½�˜~1Czy)Ö—¶À/«ÙÅ-½„ 3oµn#ì­’÷s_,1…óC¶¿Èãe”$U}JólÕÂm–§jô&]§ÕñyZÄrʧ Í W/g7«Îm&% I+þœ½ÿ½D˜ûr 9õÅ ( ±·›ù˜˜—|övö{‡£Ú CÞRD†ÝE>3Øø‹…û�í.‚ð?ø+œTè„”¶èâ¸%8æGt€4þuÚD)QP×iWÙ¾ÉÊB+*GÚ*œ»Ý>OwiÑD­| P®Õ3/ã(Wø,š¬8´BµšúÕF£ÙØlµ7Ïî[7ÕK¤Ÿ_˜Î£ü�ÖÏÔÄ:�šC•ž*ÝÄ1è™S‰v:v‡âóÁ¹<¼6vY»>¡‚¨í®ïSƒð0`=SÕògÏŒ~µÌ6;Ìf¶Ù²4 fÿTgq ê´o öCÀ0gãÇÖI¹úOwѤþè½DÔ@bQ¤äj› ŸÏ³ßE"´Ô“kšïrªÇ÷vg­–4ïå”àóH­Ôû4Î?’ÛÖÐ&ˆœxqu¥fô#.w{‘Á•Öå2›…w2]»" y–›Äâ¾J,ñ´ ,–>ÂÚ_¹vÌ1¹!ÏK)ûØÔ٦Ȋ�zÝ—YѤ•^|Ìš­©´–ò¢€¥µ^oÖ^�ˤUBn_I‡Ý”âÔ+Ôzµ�ª&‹yT©,¸ÒõGú -º �ˆ«ï·nˆÎK!�B8ß•Ò?9ÊŠuYíÚ }+ ž×©^j­”ƒöäå )ãCG'íqHÁõ(ã‚\œMæR·cioqsÉE–m›fyq!«ß¦8€²Ú\”Ež©0³–Óª¤.£zùGk°mvyßlqB"?Äujv/í:©SÉé .B$. ë4ŠŠÏºš·Ï$“Œú’%‡ƒ®aëR‡ñ„ØPÀ¾Š,N�¦ŽË}jÅ] OÓµÇU®ÓVOv¼¿²â¨?w*¢Q!qFjJµƒÖž<¤°ÿ�Î?õøA=^¿»¿¢# DŒœ§€%0F#6M�1�Æõv°õ>�'ÊŸB�q3\M�77oß½ºqjô÷9?ƒNjB¹‹vJ‚�`‹9d>?lK`,ØFl:Øc­`�ëí‚më}B°O”?%Øãf8¸:ØooÒD}4qFjJ³ƒ6�¾ÿ6W%…zøðÐ^VêU4r¢MúÎ~¹]*‚}D]9ž??Ùñ�0ãÇ­èqå6xŽr²½GÄ?O9K`ŒrFlšrc-Ê�ëí(gë}åN”?…rãf8¸šr7¯¯‡n˜>qFjJ³ƒæ§ ´Ý¬�?ÿºO“t=Ô‚ŽbŸå‡-0Â�Nl’£�ü˜Ðkøq¢·Q~v?ŽÀy™%ú«ß·vS H@ÌW¿ q?ü}Pö¬=O(#?e·ƒ«Zڇƥ“øê)›ˆ�’åCÒdðë -£ìýœ×’�‹-ˆ`ûw Â@pNÿZ'L-QëÔ‹´H«¨éÿ¢õÊ ^Ê/΃~AX?á%&—ª7 !Ó_@ò“È|î~ÓÒ@ ~úªì)ÿúºI‹þYÊß�iÖùü R,߈endstream -endobj -4284 0 obj << -/Type /Page -/Contents 4285 0 R -/Resources 4283 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4298 0 R -/Annots [ 4288 0 R 4289 0 R 4290 0 R 4292 0 R 4293 0 R 4294 0 R 4295 0 R 4297 0 R ] ->> endobj -4288 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4289 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [294.3312 566.4382 625.0908 576.7194] -/Subtype/Link/A<> ->> endobj -4290 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 532.6241 218.2873 541.4707] -/Subtype /Link -/A << /S /GoTo /D (a00190) >> ->> endobj -4292 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 474.0882 185.352 484.6185] -/Subtype /Link -/A << /S /GoTo /D (a00155_g2c1bb4fa6d7a6ff951a41c73fc721109) >> ->> endobj -4293 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 461.1368 205.845 471.6671] -/Subtype /Link -/A << /S /GoTo /D (a00155_g1ec8b8f4710dce1fa7fb87d3a31541ae) >> ->> endobj -4294 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 448.1853 183.1503 458.7157] -/Subtype /Link -/A << /S /GoTo /D (a00155_gd8eec328a4868d767f0c00c8d1c6cfc1) >> ->> endobj -4295 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 435.2339 185.91 445.7642] -/Subtype /Link -/A << /S /GoTo /D (a00155_gca51ceb2f5d855dfde55bcedf8d3b92d) >> ->> endobj -4297 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.7556 378.0081 190.6918 388.9121] -/Subtype /Link -/A << /S /GoTo /D (a00155_g2bdc4b7b4038454a79f1b2a94a6d2a98) >> ->> endobj -4286 0 obj << -/D [4284 0 R /XYZ 90 757.9346 null] ->> endobj -1081 0 obj << -/D [4284 0 R /XYZ 90 739.9346 null] ->> endobj -338 0 obj << -/D [4284 0 R /XYZ 90 739.9346 null] ->> endobj -4287 0 obj << -/D [4284 0 R /XYZ 90 716.7484 null] ->> endobj -4291 0 obj << -/D [4284 0 R /XYZ 90 492.6645 null] ->> endobj -4296 0 obj << -/D [4284 0 R /XYZ 90 394.6746 null] ->> endobj -4283 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4302 0 obj << -/Length 1578 -/Filter /FlateDecode ->> -stream -xÚ¥X[oÛ6~÷¯0°‡ÙfxÕ%݆mIÖ¦[‹­ñ°‡¶0Y¶µØV¦ËÜ`Øß¡HÊ´(K†"•D~ßá9i’1†dâ±/|2î�ãÝ�×ÐüzDt÷ úg¶Á�óÑÕO4‡(ô¨7ž¯j� A Ï—'ÄÇÓ )ó'Õý¯ð*ð„ ¬^~J·‰z»Íâj—ì˨L³ýôóüíènÞÐj¯óˆ$ýkôñ3/Á»·#ŒXˆñ>0"aHÇ»§Ì|lG£ßÕQèšœ ¬{v„#h¡fzfë«Ù@3�Œñ¤JŸ¯¶ñ¬8¤e¼A›ö?$«$Ÿ’`’ìãDNP! -Q#Cd%0 ŽÈˆhìÛ¤Œi©c•qž>›H³ q¤¿¡Â¹ß=o“cdk€l¥žÛ,޶ê5Îöeº¯j£B5=F…a4Õä>a�á�è6@–ø¨�µ@ Lì±á³Î˜£™måª*Æ °F˜ QOí‡)ÐWå&˯ÛÜSä3JúÉ«v;¤ûÈ'LÑjúe´Ó ©öOS‚'ɶP !ÄíQÄ™åÕ£¾q\õ}„¾×rUu?�ÍÛÏ–ÛfD‡Ûží¶ƒ,ˆÀíï‹4.P‘´}¡ËL™æIÅIµ%S"&_äI\¹ÞDêsUíc³>åŠlÖ9L«È L›$¯AÙ$ÝéR¿k?yƒñõT€gªó1[¾L=1AÓÃ"dœA›£×1@š®ÒŒ[IÙFqiš#ý懃£q£<9�Qúz4%¯<ÿ¬vÏêm™æI\n_ÔWº7ÊYs²eš§UJf5϶¦ÚäU\V¹1*ªX—ÚH·¤«Óú”åêyØ@í,]IY f&>è�sK~à9á•m�Yžguk#²I¢)Å“¿S9?i±Ê³�z{HwfØ|€¯é�É«l�³<5퓳„>„KõÝ\wì�¶-L,r·�ݲa£É0lÊòùúêêp8 x“FùZç Dm¿DY¾FÕÓ•.zÜ^û˜!ØóC]õ>a†õº·© ¬rXìʦX—u\®ŽÁ@›r·mÏ–sŽ8‡Zq:çV‘j¬:fËZ³e!bA¨ä{ ÁtŸwËT?eûÖ)™DˆAé:¢ÔÞÈ®|­m>Ø{ޱŸÙ:öWzg0Úµ63&à\rêH»v«zMÒ£®ƒ ¬~ƒÉ8‚ÍœÚ�Lеò€ÊÓ\xöŒitíÇl©?âÔƒúëžä‘ -6ß^ÆÆjˆ‚!ö¼SÞ¯–z¦9÷�O}Ò"?/ c?䆃+ÝX,~¹Y<ü1¿¿y³x³X8ò€ÜøÔó"ÁµÕ r -ÂÏgÈ a£b(CÆl8C`_†úy› Ù¼dè„ü’ õ»áàJ7 ?÷ïïçŽ×…"`¬†¨4U.¬�O=¾Uüªk‰ -y¬'ÿÇþ¾ôk«áì÷ÐYÉï%mro‘^�z›ù’Ì÷úÐFÕyÿp÷ðû»;·dsð è�}cÔÏì`u¥½9ÕY�ÿèSœµºÎœ3äôü­€mÐ'c6¬ˆ>FKý¼�&lÞ DqB~‰*úÝppµ.î:ÊEDp2c5Äì  –ØHîßß-¯ÚÂ0�ú`~Jz^–AŸ>ŒÙ°>ú-}ôó6ú°y/ÐÇ ù%úèwÃÁÕú¸{Ûµ]„„0VCÌZ‡>þí<ö…†Á>õͧ>Ÿ¼<'ËdÕuðc>C�þÜgõ÷ˆÄX j¤�î(‘~R£›´T3TÑ©àÇûzo®ÊŠM–—n¡`zäÔ¡³²iÌû]sPÕ/„…KOÂaôǃi£«¯ÅºÏ~ø‰'üÿu[§:€!Àiß÷y(ôAP05Fa ¼rõ <}Uµ^Ã�Î<*Û—’ïÌË[y+SéBõ_SvMõ…3ÅØSo+ùÓÝÜ ¸7Ó�/æ^úËË:qn¤åU±qÍŠÒt>endstream -endobj -4301 0 obj << -/Type /Page -/Contents 4302 0 R -/Resources 4300 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4298 0 R -/Annots [ 4305 0 R 4306 0 R 4307 0 R 4309 0 R 4310 0 R 4311 0 R 4312 0 R 4313 0 R 4315 0 R ] ->> endobj -4305 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4306 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [89.0037 554.483 445.4449 564.3808] -/Subtype/Link/A<> ->> endobj -4307 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 538.2933 203.3535 547.1399] -/Subtype /Link -/A << /S /GoTo /D (a00191) >> ->> endobj -4309 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 480.3601 235.723 490.2877] -/Subtype /Link -/A << /S /GoTo /D (a00155_g44311ecc30759ca38b4069182247bdae) >> ->> endobj -4310 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 466.806 185.352 477.3363] -/Subtype /Link -/A << /S /GoTo /D (a00155_g2c1bb4fa6d7a6ff951a41c73fc721109) >> ->> endobj -4311 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 453.8545 205.845 464.3849] -/Subtype /Link -/A << /S /GoTo /D (a00155_g1ec8b8f4710dce1fa7fb87d3a31541ae) >> ->> endobj -4312 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 440.9031 183.1503 451.4334] -/Subtype /Link -/A << /S /GoTo /D (a00155_gd8eec328a4868d767f0c00c8d1c6cfc1) >> ->> endobj -4313 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 427.9517 185.91 438.482] -/Subtype /Link -/A << /S /GoTo /D (a00155_gca51ceb2f5d855dfde55bcedf8d3b92d) >> ->> endobj -4315 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.1599 370.7259 224.0961 381.6298] -/Subtype /Link -/A << /S /GoTo /D (a00155_g3983e0c026396d5c4506779d770007ba) >> ->> endobj -4303 0 obj << -/D [4301 0 R /XYZ 90 757.9346 null] ->> endobj -1082 0 obj << -/D [4301 0 R /XYZ 90 739.9346 null] ->> endobj -342 0 obj << -/D [4301 0 R /XYZ 90 739.9346 null] ->> endobj -4304 0 obj << -/D [4301 0 R /XYZ 90 716.7484 null] ->> endobj -4308 0 obj << -/D [4301 0 R /XYZ 90 498.3337 null] ->> endobj -4314 0 obj << -/D [4301 0 R /XYZ 90 387.3924 null] ->> endobj -4300 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4319 0 obj << -/Length 637 -/Filter /FlateDecode ->> -stream -xÚ¥UKoÓ@¾ûW¬ÊÅ>x»3ë}E*­( AÉ­ô§±ê8%NÔöß³kï&nl -Ê!ûøæ›o;ÂìˆaD E Ï$ÉW#·öø"�Úû´x?�NÏÑC�DI¦‹–AH¦óëXSdIЂŻòþ´Êé²Û�—UÑ­®ŠE±I@ÇE�»#Ã�ˆAAr3½Œ>L÷ν6Á%8׿¢ëFæVãeÄ(7Z�»aŒA²Š2äaSEߣo{žî¢5 Q�2jO0‰6fÕ�û× md%P#DKiëQ()xÒ³b;³LóŽê¬hòMy¿-×µ'â½ü;'Ôt<Ÿ×ù¬êìòu½-ëÝÌ6ô8»ZPZ™Y¿™/¥}Ô°´¡ŒqË%�CÝ*y—¸Ø.כɱo‹¡Š#¼ì|�ñÞÏ0Epq`kÝÏg+Ÿ¿]}—‹‹ªéòг–H3.l‡´V¯R•¢ÚXÎçR»ë;VŸz²ƒÅˆlÙ—=`vfVöÛ¦ÌÚÇZ03T¢–/§m�úø�Íù3Òb)ˆ@‰ö=Ú~pȳâcX—m_¶‰.ý¿;¯êAhÊ- ‘€THæÕ»«Í­Ç\õËðiß`¤ü^§®}“ƒZrÊP©#ÇmPó;`s~©Ï_¿Ò©Œ l³¬E¾*ë¼ÚÍí¼�öÉŸTyÚ<”Û|I—'c“þXqf]�ò¿†d;éµ5ŽýG.íÐã:Ì@84ÊEQ›Ù6 ©Ð_Ââ2ïüÐÿ³ òIø@ c²[-ñzã¿¿z4õÀŸOþ%¯Ÿn‹ú8=n‚�äç7ño‚¢endstream -endobj -4318 0 obj << -/Type /Page -/Contents 4319 0 R -/Resources 4317 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4298 0 R -/Annots [ 4322 0 R 4323 0 R ] ->> endobj -4322 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.7618 250.6249 659.9632] -/Subtype/Link/A<> ->> endobj -4323 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 611.4648 174.0239 620.3114] -/Subtype /Link -/A << /S /GoTo /D (a00192) >> ->> endobj -4320 0 obj << -/D [4318 0 R /XYZ 90 757.9346 null] ->> endobj -1083 0 obj << -/D [4318 0 R /XYZ 90 739.9346 null] ->> endobj -346 0 obj << -/D [4318 0 R /XYZ 90 739.9346 null] ->> endobj -4321 0 obj << -/D [4318 0 R /XYZ 90 716.7484 null] ->> endobj -4317 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4327 0 obj << -/Length 2258 -/Filter /FlateDecode ->> -stream -xÚ­Z]sÛ¸}ׯÐì¾H3ß™N§IìdœÝ&[[}ÚÝÉ(mkV–\‰jšþú^�$Àv=~0%žsq�sñ!’)†?25xª„B†q9]?Mðô¾~?!ÍíÜ_„€7ËÉ神d$•Óå}Å ”ÐéróËŒ(:_PC™š�o~†K�gáúâÝvWÔWW‡õù©Ø—«r{ØÏ[~˜\/½l•`’XÑN~ù O7݇ FÌh1ý -0"ÆÐéÓ„Sæ>ì&w“¿{žúFõ@_ãaý­#Á7Ô5�BkUÝ:�(™/ÆxvÞ>ÿð|:¬G�ÝÆÝ÷ÅqNô¬Ø¯ Û¸š• #DÅ -Yµ¤L*ÏŠïUQ®€iÓä©8­�Ûg—% bAò-Ä*”¬x~>ʃ iNð¬(k†ÝöËquüVx,V­ºþcº+P7ùZ L´šJ¦æo_êh¢âÁ¡ ˜—Àp�yåë9ˆŸËÇÃñUW›`Š£$-îQ=êavVH&.l•üfõÔäö¼¯3µ;Õ¹%$xZRÄ™€T=õç(T¥�6�øv¨õíß§îêÇ l÷DOØ2 ;b¶¬ 쿞¶ë:ÝX(7HR-Óió¨X¿Õð˜Íêÿ¥gø-ˆp”T!IèUa‡Ö~[ Ú*ÓÛ}8ä¢T -�ÐL%Á�ó:x{ãøÐ nÃÞwèÅÞÓ÷N—skWÞŽR¥DK¾;ä&-Úa²¢¨É[ØÃ ãØ¤�òÚßo÷ëÝy5DBøêËá¹D�ßYëôËú°×ShG”Q÷̪\Õ=qWÏëò\W©SOª’0bpZ}Þ“�Í/F£b†–ñdû=(­q ºúX(lF6ÝÃsòÖa‹sX'&Ó�v Œj—«iô [™ÔHÂÆ¹5D'ÜêaVý®\›½}é–VíÜ,ë5ÃjÓÞ–5~¿?ï×v%1lp[Fùÿ`ðá5*ãIIiÎá–·x@˜òxZ×›<Ôáò–ø›§Ãˆx/F¿»þxO¬¶˜¤“àQõ˜mØê ®äØö{|.‚ˆ71¡KÄ Îô¿Gå„#¶`BßÀö9¸Üûd%÷JcøÈJ S•ÀÁªJPì7—p†m {JűxÛÂfH5wʶ–·m@˜²mZ×Û6ÔaÛ–øۦÈxÛ¶ý|·¼�Ç/CXÃÆ1™�ÊD³ ZF:‡ìŒÍ�Çg#èò[×rØ8¤›îP9áˆ-°î©<¦¼JíÑ -VbœWCt«Ööj3Ûîϻݢ,ŽOÛýªtÇýævÿ0'b6èf -›n͵|7S)‘V:·Ìö°¬›C„›3ºÎÍ-ݼ›Ûâ#Üœ #⽸ùýõÇëÛ×sBÈliÏP?ÝöÏËŠAgÙ±�Ê‹GeŠÙÍ­ìPllJ<>A—wÐÜ c¨Ƥ›îQá˜-0÷C±/Ž«òî±WÕÑöCÒô‚ C„iú�2½ƒÙøÞÛÀ¬›Áá—‰º¾úº-{—ßÍ—®\œ|áØo½í6Å©^¦(P…Œ–¹“}Ë…€0UÒº¾(„º#ŠBK|LQH‡ñ^ŠÂÛŸ>Ý]ÇKd�˜44��ÊÈÇlÃKs�¤–zl<>A—7±/PÃ3Mw¨œpÄ–Û‹Û]¦läivˆNÜÁ¬úÛÝáôÇÍ(¦K®_ĹÕ�&|™¡×¹–unH˜pnF×9·¥›wn[|„s3aD¼çÞ^¿¾zc{êïzŒí[É\xT&ˆ˜mx}Î�`£³ààYýkbqéR0ÎÓív¨œnÄ–3/QغŽ3oˆN˜×ìú­?»ÌÊç}¹Ýu×Üq=¬'îÝË3Û“›´w»AoÉQÔ¼Œ·ŒLUÎÛ–÷v@˜òvZ×{;Ôáí–øo§ÃˆxÛÞ®×èѧaSY2•‰!f´6L`Lp66 Ÿ� Ë›p7F¨LËPN¶Ë,Í×I‹3�(3f¤ÅtÊâ6hñçÆß‡ÖÄ}z.Ö[;jÝ^|mî�«zý¾.íBv{Ãf‡î§š¼Œ× AŒ`�óºƒå½¦¼žÖõ^uGx½%>Æëé0"ދׯìÐmË ›½þé:þMŒjÄ)é¤xT&š˜mxB'H1=6žÓï²&,ݧ±Ê´Û¡rº[nB71>r:¿`No@­wcvÅþÁí«Ý»0~"¿Ô€òqÕü8öuuò wûÛ˜uû¿¶‡ói÷-|ÛfµA}o)“úWŠžDbÈ‘õqÁÿýsU 4> endobj -4330 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.6594 250.6249 657.8608] -/Subtype/Link/A<> ->> endobj -4331 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.2769 190.0737 618.1808] -/Subtype /Link -/A << /S /GoTo /D (a00194) >> ->> endobj -4333 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 515.1065 181.8351 526.0104] -/Subtype /Link -/A << /S /GoTo /D (a00083) >> ->> endobj -4334 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 502.1362 163.7728 513.0401] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4336 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 419.2928 204.7292 430.1968] -/Subtype /Link -/A << /S /GoTo /D (a00158_g26ae707402e494f3895a9f012a93ea29) >> ->> endobj -4337 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [206.0542 419.2928 231.2894 430.1968] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4338 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 380.401 215.2497 391.3049] -/Subtype /Link -/A << /S /GoTo /D (a00158_g84901a5aa60040e96d272a69977edd22) >> ->> endobj -4339 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [216.5747 380.401 241.8099 391.3049] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4340 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 341.5091 210.8263 352.413] -/Subtype /Link -/A << /S /GoTo /D (a00158_g70d236d1cf34b4e21836edda60247b70) >> ->> endobj -4341 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [212.1513 341.5091 237.3865 352.413] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4342 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 302.6172 234.079 313.5211] -/Subtype /Link -/A << /S /GoTo /D (a00158_gb0ad55aa96dd1d200cd0fc5a99f6a4f7) >> ->> endobj -4343 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [235.404 302.6172 260.6392 313.5211] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4344 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 263.7253 274.846 274.6292] -/Subtype /Link -/A << /S /GoTo /D (a00158_g10d9a9201cba1a6db623284c475c6cea) >> ->> endobj -4345 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [276.171 263.7253 301.4062 274.6292] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4346 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 224.8334 216.3655 235.7373] -/Subtype /Link -/A << /S /GoTo /D (a00158_g5d56800f82bfc7bbf53bb4a659589812) >> ->> endobj -4347 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [217.6905 224.8334 242.9257 235.7373] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4348 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 185.9415 231.2097 196.8454] -/Subtype /Link -/A << /S /GoTo /D (a00158_gd895ab98c54d9966ff554aa873151751) >> ->> endobj -4349 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [232.5347 185.9415 257.7699 196.8454] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4350 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 147.0496 225.0331 157.9535] -/Subtype /Link -/A << /S /GoTo /D (a00158_gb5d9c0becf7cb32d0aaef466839dd92e) >> ->> endobj -4351 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [226.3581 147.0496 251.5933 157.9535] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4352 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 108.1577 229.4168 119.0617] -/Subtype /Link -/A << /S /GoTo /D (a00158_g4ab2de595d36e9e55dd61f6ecd139162) >> ->> endobj -4353 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [230.7417 108.1577 255.9769 119.0617] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4328 0 obj << -/D [4326 0 R /XYZ 90 757.9346 null] ->> endobj -1084 0 obj << -/D [4326 0 R /XYZ 90 739.9346 null] ->> endobj -350 0 obj << -/D [4326 0 R /XYZ 90 739.9346 null] ->> endobj -4329 0 obj << -/D [4326 0 R /XYZ 90 716.74 null] ->> endobj -4332 0 obj << -/D [4326 0 R /XYZ 90 534.0752 null] ->> endobj -4335 0 obj << -/D [4326 0 R /XYZ 90 438.2616 null] ->> endobj -4325 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4357 0 obj << -/Length 1660 -/Filter /FlateDecode ->> -stream -xÚµZk�7ýž_1U¥6‘ã÷ƒo”Ý¥K)PHE¥‚Viv–�XšÍø÷½ÎØÎdœñµ[!‘ÇœÜs|ÇçØÎ†Uþ±ÊÑÊ(Cœ�ºZ|Ñê=¼ýdÄÂå)\Ÿ¶?ÎFθ«qšëjvµ« QœñjvùÇØÎ&S®èønùéÁ§Ûõâ¹nÞ8[ÞÔͳWõU½™0;®W ÿ–ц�™“w³§£ÓYâò”Ð̳ÿ5úã­.AæÓ%ÂYU}†”0çxõq$¹ˆ/nF¯G¿¦:Í…ÝŽ�RRE¬°iÆÕe`fÓ9qŠÉþ¶�rÚj›hµ�QM¤°²J0ß¼·œ«n…Oq%ªvÁ\UDa¼LGµ>äýö²~K)_Õ¹ÔÄpÃ:äþÒæ}À¼jˈxLFV×ËxùúÅãŸ/N?Ÿuu‚(Êu¹ …°çÕvÍ§Šæ¼ŽXN�?áQݺ^ÁÎ-™!ÕÜ"C�(Œ8«†Îòy×LtC9¡F#¦ài½cW´²À®åî¶sW�Ýõì§_–Û&¶×! >m&R�×Û5tdÂéøÃ„Ñq½ý~"éø¶Ù^o&ÂŒëù%éƒvŒ0f̽[ @-c'jìvÁ‚±Þhì^ÜØ‡äŒ�ÈÈêî�ýøÙ‹×§Çí-aV -%Ë­H(DC^­×Þ V(XÏv!áQݺýöÖŽ(§42ôˆÂˆ³j˜½C8çb˜½Û肽̳?¾Yß[Ï‹î˜Õeó¤ö—þÿhPœp-äýDƒpDÀFI†€Âƒa_®” EÒ -Ò©Ðf -E ݪ­µþùI¾äJÂuÅÑ'P™9«Õ¿Î¢iëÞ`Ë|€cô�ª…Ež«+:‚Ön-4¸$BÛ� °—  <õI½¸™7>ìX¹ŽV__ ɇmq&ˆ¤ŽÝ�Å)%R5[‰’ÇØ€m}B".oÁJ6oóðùù£—edu÷V~úæÄßÀGÆØx6qžf6`ÄÀA¬Ø“B´dµz½/¡J©¡ÍHxT@·n¿ý›�åÈÀ# -#Ϊa  ¬"Š 3,ÚèB$Ønp]+ïì» †‡©ÉÔøsóâr¾ p=6Ÿo6˿똫!)ÑÊH¢”´÷J3ˆöfÛPˆ�Cc ]°oŒ�^<ÉÄ"#«»��7÷êÑùìâ·ç³ógÇNÒSìGB!Bòj¥“€¥L mE£ -ºuûCÀPB¥DF@m·–gý¡ñÍb½º\n—ëU1@·VNL„º”æÕ¼™8>žÇíýÝj»¼9°w’#$Âvs·ËŒ~›CìJÕýØœsbd³u(Ù<Âp›· -–l^æM6oómn½¸‹.·;“—Et«óøì§W§�ò-¾’„IËÊÝH(DH^­×äÊ©•Ú‰„Gtëö›ÜR˜�™ …gբϵíøÞ’ã—³ìÞø>}çÿ;Ö0)øÃ¨¡ KxDw^··a°!¦u¹a …gÕÚ[£g{°�ÜSxÌ7™0£|…ὉxLbVw×›mÆoQ”"3)¡0Ö¬ZlL˜M~zÀŒšzÕÎvD9ØÛMƒ.©æ�¹ŸnûŽrW%È•_7›äš -0­5ÍçÎîV ÿÉÛ#ÿ‘ -¦Šd¦7¢Û€BD'Ñ%FPoa1§X„Æ€ÆÔEÜ�º;¦/²Û iXÉ™,ÊãD:jpyvŽ3T^ÄÈÛÙôÂoÖoêU&ÓB­±åû–P˜çˆ2Ù݃©x û€EÖ$Î Q\ð{ÀG<¢#¯[8ÊA$Ã&§Ü€„ʉ"æ#áJ«n¨8z„Yã k[ÀcCÏêÖ6»mª�¡GFœUë;Åú”€™êý)Ñ”R"Âð”(1î7roò›wq=ßäö‡Ã«ä¶ÃÛoñˆÇdu÷‡�$‡ÃùîXžÙ)†u!€0 f�&”L®ý~OmEÂ#:òºý3]:"`�,?‚rڎű¦wgø�Å»Ët\<æ¶Ç †Á8އD¡ÓJÿ§_Sì ;OÁoÿ(Dç¿p ? - "¼Ð'õªÞÌ·Ýïq~‰OžúÝ]xÁxx¤¹xÈió -6mºyvå'åzŽ�ç/šàŸ_›Ç“õ—¯ïóõI1q¬?ÿ*òa!endstream -endobj -4356 0 obj << -/Type /Page -/Contents 4357 0 R -/Resources 4355 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4298 0 R -/Annots [ 4359 0 R 4360 0 R 4361 0 R 4362 0 R 4363 0 R 4364 0 R 4365 0 R 4366 0 R 4367 0 R 4368 0 R 4369 0 R 4370 0 R 4371 0 R 4372 0 R 4374 0 R 4375 0 R 4376 0 R 4377 0 R 4378 0 R 4379 0 R ] ->> endobj -4359 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 713.8674 207.4989 724.7714] -/Subtype /Link -/A << /S /GoTo /D (a00158_gfa11b2a1faf395ae2a6626e01c482d5d) >> ->> endobj -4360 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [208.8238 713.8674 234.059 724.7714] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4361 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 675.0131 244.0317 685.9171] -/Subtype /Link -/A << /S /GoTo /D (a00158_gc7cc1dba1819f7fcdaa9ff9eed5a08f4) >> ->> endobj -4362 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [245.3566 675.0131 270.5918 685.9171] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4363 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 636.1588 205.2872 647.0628] -/Subtype /Link -/A << /S /GoTo /D (a00158_g4a264bb64ae706d53f572b1d9e4037a2) >> ->> endobj -4364 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [206.6122 636.1588 231.8474 647.0628] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4365 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 597.3045 232.7343 608.2085] -/Subtype /Link -/A << /S /GoTo /D (a00158_g55ce98ea4d6f22e9d5068b904d4d2447) >> ->> endobj -4366 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [234.0593 597.3045 259.2945 608.2085] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4367 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 558.4502 244.4801 569.3542] -/Subtype /Link -/A << /S /GoTo /D (a00158_g2ebfe5c8a7f3173714efdf2df74fc392) >> ->> endobj -4368 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [245.805 558.4502 271.0402 569.3542] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4369 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.8747 519.5959 255.1444 530.4999] -/Subtype /Link -/A << /S /GoTo /D (a00158_ga87ff36af81990e6ffe20d76d5e4606f) >> ->> endobj -4370 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [256.4694 519.5959 281.7046 530.4999] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4371 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [432.9613 519.5959 458.1965 530.4999] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4372 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [474.7532 519.5959 484.4966 530.4999] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4374 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 450.7886 138.5977 461.6925] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4375 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 450.7886 198.084 461.6925] -/Subtype /Link -/A << /S /GoTo /D (a00158_g3178402dd725776415bf9745e7bf92ba) >> ->> endobj -4376 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [226.5269 450.7886 251.7621 461.6925] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4377 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [257.2416 450.7886 282.4768 461.6925] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4378 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.5466 437.8372 196.7092 448.7411] -/Subtype /Link -/A << /S /GoTo /D (a00158_g3b19f65e48079d8105be2a99b5b4b2ae) >> ->> endobj -4379 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [225.1521 437.8372 250.3873 448.7411] -/Subtype /Link -/A << /S /GoTo /D (a00082) >> ->> endobj -4358 0 obj << -/D [4356 0 R /XYZ 90 757.9346 null] ->> endobj -4373 0 obj << -/D [4356 0 R /XYZ 90 469.7385 null] ->> endobj -4355 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4382 0 obj << -/Length 1695 -/Filter /FlateDecode ->> -stream -xÚ­Y]�ÓF}ϯ°à%‘ša¾?PUº „Ò…T<BnâÝ�È&ÛÄ¥¿¾×ãŒ=öŒKÑ>$ÙŸsçνg®c’`ø#‰Á‰ -Æe²º›àäþý|Bê¯çðýÜ<]N=£&1ÈH*“åuÉ ”Ðd¹~?%ŠÏæÔP¦¦§Åkx+ð” \½y¶ÙfÕ»‹ýêt—íò4ßìw³�Ë—“Ëe#[G%˜$…è_“÷q²†è^N0bF‹ä |ÀˆC“» §Ì~ØNÞN~oxª/Ê ú'ë_áþCíò(¬VU«ÓˆÒÙœ`Œ§§Íý£ûÝvWö&»Î3¢§Ùn•+«( 2B””�RFáüL‰HMz‘å)0­ë$eÇÕasoSDÌÉ<ðP�„¤äy}Øçûüö�¥ëcuùæî~›5IFÝ,k�0Ñ*‘�Ä‚ôæÈ‚æ.ʯmÆ ¸8ƒˆ0+#z2ƒ Nùíþð¸«M0EŠQoP=ên&VH&Îl¥ü:½«óxÚ}ž<ͶÇ*�„8WKŠ8P)åU?z¡*…´Q²jõõçľûÕ Û^ѶtÃö˜‹RûçãfuDǬ åIªe8m Ê×o-Üg+ôê)µ9–²€òzƒ/²Óݦ,Ъäê×âÿ[/|"4b@“Sps]…_|u¸©1oÜý·ø¹{AÏþ{¼Etesz› õ©…ìDЭ;‹Šézl….ªènõ\[F¢ ‘œ—ȇ›Ýj{ZƒqHèýÛº}0à#*UµCižVi~›N«üTÙͱÇFˆLÍÝô5–„ÞÐüÌSè Tø WQ袠bƒŠé‚,e[÷X®ÖSfN -¦;ÊÃEeñ±<Þª¨<}®Õ\EVnQ=ª­½†MáJÀ™PµØ¢è®t»ùgè ä\#ÉŒÜaØáÝá ây‡#ºv‡[ºו£øÎÁ%Rê¿->¼É Ãã-�Òå§ÅÕbéM ži"°¨˜´ÇVf ìëJ8T•½x‹�FÐå¨pó„Y·EÅT=¶zÝį8…Œaœad LŽlOáU๋.ÕN4¨K^ªÃ0‡•ÑgÒV—Õ3\m¯÷‡Ój¬šÁ@ £ ’b„Yû@ é ûM€)ƒ”Tª>hWÛô�žÏÙtW�ˆk÷öÝæD4ƒîàîÐÀ¢îT<»CD׺CK7îmñî Ãã­ÝaùâÍå“ o:à ÆUFÂ9hPqŸÍúÃ.½Ë>¥å¡s 5cpPlߨštÑ�Æi`çœ1uŠsýÍ]Ä(GBޏR ÷ˆÃµ�uQm±“¯�ÅkÛ! ÕvX·©mWwDm·ÄÇÔv8 �·®í§—ÏWþŨ0�¤À¢bÚÛàÑgÂZ™Ñ«·øh]Þþ£�bŽ4Ó:¼îQõÙbG5QeF}.:ÐÁ Ìéà¢/«vÍoë7Ç<=äc;ÚÞþ7ë.Ï/ÕËõi·rnío›ÝMÿ_ü‚jŒÅú»ø•I©hÄ/XÔ/\€_Dt­_´tã~Ñá‘0<ÞÚ/.¯.úe ¥I€EÅ”=¶áAvš ->zí� Ë;<(k%coQ1U�-êp“‰)igpÈ+jTØ*2;Žþ�£Ÿ2‰°½ƒî ‰¨˜$ŠÈŸn÷«êÀ:Î/é&ï—‰4ˆ¢-Â,¢�E-"¨x¶ˆˆ®µˆ–nÜ"Úâ#,"†Ç[[Ä»¡xúd±üôÇÕrñÊ;d)Cƒ‰“Ñ "QølCvA©¬îDGæ¡ÁG#èò ŒC Y·EÅT=¶Bõ‡ªÞWûݺ¼G Ù¤xœ Çu ‹H³}8ƒRøÜ¹‹-Û±|w‚‰`Û‰¹žê§ùá”7ƒFB8FKõ]f7$F°Øï£ ,Þða¨áúMûº#¾%>¦áÃax¼^ÿ{±xué7ž€ -¥"œŒ‰Âgnx�¼-´{‰Žª·9‡Z]"˜UudÅÓôØ:­ìrxe`#»ÜA‡ºÜÂÆuù—Ûæqé·v¹�åãæþ¢>0æ})Ç�UR›Ø7?f.�¢¸!ŒºóˆDF1]ä nQ)ž(«âÁ¯ªÌðy¶ËinG›�ßì›—ÅúOõBëWü˜²Ç´~žË’õÝՌ u¨MÔ{ðþçWûØýï¯7™÷Kañ$܆ædé_º¶Þnendstream -endobj -4381 0 obj << -/Type /Page -/Contents 4382 0 R -/Resources 4380 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4298 0 R -/Annots [ 4385 0 R 4386 0 R 4388 0 R 4390 0 R 4391 0 R 4393 0 R 4394 0 R 4395 0 R 4396 0 R 4397 0 R 4399 0 R 4400 0 R 4401 0 R 4402 0 R ] ->> endobj -4385 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 630.2193 250.6249 651.4207] -/Subtype/Link/A<> ->> endobj -4386 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 596.8117 174.5819 607.7156] -/Subtype /Link -/A << /S /GoTo /D (a00195) >> ->> endobj -4388 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 512.3371 148.2809 522.1152] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4390 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 445.4868 184.2462 456.3907] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge6bae7dc0225468c8a5ac269df549892) >> ->> endobj -4391 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [185.5712 445.4868 195.3146 456.3907] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4393 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 350.0315 204.7293 360.9354] -/Subtype /Link -/A << /S /GoTo /D (a00142_g3d4c8bd4aada659eb34f5d2ffd3e7901) >> ->> endobj -4394 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 305.7728 194.7667 316.6767] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) >> ->> endobj -4395 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [196.0917 305.7728 205.835 316.6767] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4396 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 261.5141 184.8042 272.418] -/Subtype /Link -/A << /S /GoTo /D (a00142_g7b04a0035bef29d905496c23bae066d2) >> ->> endobj -4397 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [186.1292 261.5141 195.8725 272.418] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4399 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 166.0587 223.997 176.9627] -/Subtype /Link -/A << /S /GoTo /D (a00142_g99e43010ec61327164466aa2d902de45) >> ->> endobj -4400 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [225.322 166.0587 235.0654 176.9627] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4401 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 121.8 226.2087 132.704] -/Subtype /Link -/A << /S /GoTo /D (a00142_gad14bbbf092b90aa0a5a4f9169504a8d) >> ->> endobj -4402 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [227.5337 121.8 237.2771 132.704] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4383 0 obj << -/D [4381 0 R /XYZ 90 757.9346 null] ->> endobj -1085 0 obj << -/D [4381 0 R /XYZ 90 739.9346 null] ->> endobj -354 0 obj << -/D [4381 0 R /XYZ 90 739.9346 null] ->> endobj -4384 0 obj << -/D [4381 0 R /XYZ 90 715.5325 null] ->> endobj -4387 0 obj << -/D [4381 0 R /XYZ 90 533.9892 null] ->> endobj -4389 0 obj << -/D [4381 0 R /XYZ 90 467.1389 null] ->> endobj -4392 0 obj << -/D [4381 0 R /XYZ 90 371.6836 null] ->> endobj -4398 0 obj << -/D [4381 0 R /XYZ 90 187.7108 null] ->> endobj -4380 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4406 0 obj << -/Length 1720 -/Filter /FlateDecode ->> -stream -xÚ­Z[o9}çW í H×÷±û–š¦j£nBÕ­Ú*ba’ %�¥DmÿýÚÌØxÆ3þÜ‹ò�'ßù.>Ǟț2ÔxXˆiÆåpq?ÀÃ[óöÙ€ÔŸ˜ÏOBÀ³ÙàÉ ª‡iIåpvsˆ ”Ðálùq¤¥ã*ðèqõðäa�îªW/Vë²úë²¼)wc¢FåfaßÒ”ª)ÄøóìÕ`:óäun‚Ib©ÿ|üŒ‡K“ã«FL+1üj^`D´¦Ãû§Ì½X®ù8Õ‡è*QÖ]#!H A]‘ÔÔ\T5¾\•»ù¡„ÅÝj1_Wu=ÞÙî·û»ª¼ùòKWM¸@ ýí>~^e‚n,gŠû(6�O”FÍ#Øü,IçA)áHc)¤,ËOÓM1s‰ -Z�&³ýdw[C.ÃÈ¡Õæðvvý~L(�žÏ®g//§§“v6”1»6Ó}ð tQ¬Có±À1©DŠ)•Ù‡è[Q-ýÃ>"ç ¥eºb(Û±,åŸÕr7«Ü¬pS>‰×^�ˆ¤C©)b’… t,Á -{€y¤ÍãÙz»›áÿ[å3ß,«?¾ÎWûÚ�6ûU-Îyõk1&bt·Z/½d¹p’e…•l�ÛÞ?¬Ë}ùõ§☓tuuq„+!¼WóR*Ä…Dïa êÀ Ù¼N÷ ^XøMò åiDqkí_½k::k�$K”™Ùè�8DEë=1(�û�âÌ ·[²DÈl¡¨Û¡ Ö((YF�ÒšgJ6@§$ë`nçü½RŒ4Ç"3Áݽ«s³4Œ�T�y>_¯�»zï�„Ž��Kn:­X¯5„€„5xh IÆ£5¼Î¼°54É3¬H#Šë®*ž¿œNÞ½žÆ;›@Lhžî‚Gôq4g7)­p®áXöU¹^zÙÜTz¹ÿ 1sÏëQHˆÈÃ@%�"x�ˆ¼°ˆšä"ÒˆâÖ"úp>}=‰7†(¡h�CAÜQ´þKr‰ÃùÕ;<˜A;nß%9GTa�®Û£Ö8´Á2)S:óF\ˆN˜†‡U’,øA’^�Ö*î[{îâqW9Çfÿã–„0JÃü·š™¹òææŒhºFÁ’>†K):Iê�fè9dΑs2‡vÔPÌ×ï.f篣¥M•Yæ²0ÕJÓG±úo¯»ôhfõз£öˆ™ÙÍ“tÅQ¶b…7×¶›äí4Fí£±Ì3iNIºFå+º÷†ZÇ�wSÏj¿ÚÖ7è¶ ãc‚Gý7Ó1öZH’Yb€î>DPEÍ€UÕåI­¬®'tÔ^Ÿ›ÙôÚGHø‡‡�’d<:Àë,¤Á {H“<ÃD€4¢¸íGuçgñ)ÌÅ¢ éNx�µ·M™PÍpרm²ý£©Q;<êc0ê4¯uÈ›1êyΨÓiDqƒÛ+ÓI×£ªuôÀ¡rŠ *4nõžt ™1¤(!ýC©!;<äc0ä4¯rÈ›1äyÎ�ÓiDqÝ�/&]3¶·ZàP·Y ¢PE“›v͘b¤¤îÊR3v0xÆ)Æ`Æi^?ã�7cÆ òœ§Óˆâ†G¿xÊöy×´H7Á£vk׿â¾Õ|ÖõÝbÎKÝϰ H¤�¿ôU¡ÃJQæ_£áAB"]0å¾ T'a“<+7ån¾/ëc�;ݼq¼²7Së¤þbÁO){JqõŠb,ëCÖ˜šÃÔ®>A�¿­Ñ¨þó½ú=Ù~û~[nÚí±ßcêèÏÿ÷1ý¾endstream -endobj -4405 0 obj << -/Type /Page -/Contents 4406 0 R -/Resources 4404 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4430 0 R -/Annots [ 4409 0 R 4410 0 R 4411 0 R 4412 0 R 4414 0 R 4415 0 R 4416 0 R 4417 0 R 4419 0 R 4421 0 R 4422 0 R 4423 0 R 4424 0 R 4426 0 R 4427 0 R 4428 0 R 4429 0 R ] ->> endobj -4409 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 704.1539 234.5175 715.0578] -/Subtype /Link -/A << /S /GoTo /D (a00142_g2f8f70c30b9ee08a103fbd69a4365c4c) >> ->> endobj -4410 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [235.8425 704.1539 245.5859 715.0578] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4411 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 665.2996 197.387 676.2035] -/Subtype /Link -/A << /S /GoTo /D (a00142_g9e97a0b4d5cc7764d8e19758f5da53ae) >> ->> endobj -4412 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.712 665.2996 208.4553 676.2035] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4414 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 582.5446 207.0905 593.4485] -/Subtype /Link -/A << /S /GoTo /D (a00142_gcd3ac045f0a4ae63412e3b3d8780e8ab) >> ->> endobj -4415 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [208.4154 582.5446 218.1588 593.4485] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4416 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 543.6903 187.0159 554.5942] -/Subtype /Link -/A << /S /GoTo /D (a00142_g905451249dca72ce0385bf2a9ff178ee) >> ->> endobj -4417 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.3408 543.6903 198.0842 554.5942] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4419 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 461.3088 216.3557 471.8392] -/Subtype /Link -/A << /S /GoTo /D (a00142_gfa82b860a64b67d25ab3abc21811896f) >> ->> endobj -4421 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 378.1802 194.2089 389.0841] -/Subtype /Link -/A << /S /GoTo /D (a00142_g155cba6121323726d02c00284428fed6) >> ->> endobj -4422 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [195.5338 378.1802 205.2772 389.0841] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4423 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 339.3259 229.068 350.2298] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge3c821e3a388615528efda9d23c7d115) >> ->> endobj -4424 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [230.393 339.3259 240.1363 350.2298] -/Subtype /Link -/A << /S /GoTo /D (a00084) >> ->> endobj -4426 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 257.5471 206.8414 267.4748] -/Subtype /Link -/A << /S /GoTo /D (a00142_g7b5319b5b65761a845fcd1500fde4cdc) >> ->> endobj -4427 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 244.5957 200.296 254.5234] -/Subtype /Link -/A << /S /GoTo /D (a00142_gcfae9053e5c107a1aed6b228c917d2ea) >> ->> endobj -4428 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 231.6442 198.0843 241.5719] -/Subtype /Link -/A << /S /GoTo /D (a00142_g9ff1e8936a8a26bff54c05f8a989b93b) >> ->> endobj -4429 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 218.6928 207.489 228.6205] -/Subtype /Link -/A << /S /GoTo /D (a00142_ge469332907e0617d72d5e2dd4297119d) >> ->> endobj -4407 0 obj << -/D [4405 0 R /XYZ 90 757.9346 null] ->> endobj -4408 0 obj << -/D [4405 0 R /XYZ 90 720.8203 null] ->> endobj -4413 0 obj << -/D [4405 0 R /XYZ 90 599.211 null] ->> endobj -4418 0 obj << -/D [4405 0 R /XYZ 90 477.6017 null] ->> endobj -4420 0 obj << -/D [4405 0 R /XYZ 90 394.8466 null] ->> endobj -4425 0 obj << -/D [4405 0 R /XYZ 90 275.5208 null] ->> endobj -4404 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4433 0 obj << -/Length 1429 -/Filter /FlateDecode ->> -stream -xÚ­X[oÛ6}÷¯º˜Y~¼3†]²Ë0`kóÖ…++‰_2Yîåßï£$ʲ(SZä!’uô}‡‡à·»ÙËfK¬b*¹»¯+( ’KîVoSÐj¾`–q�þü%M�Ðæà¦XçÍÑõ.;lòmµ¬ŠÝvþþîvöÇ]×¶e%¹×ô¿ÙÛ÷4Y!»Û%Ü™|ÆJÀZ–lf‚q²ž½™ýÛÕi.Ô7Œ N‚¿0?<†£ÕÍè a|¾Jiz(ž_VÅ&/çxš’l8Â×ù½»fÒ|›ån„Mi Vʺ4Jë*3s,M -~�WK¬´jÅÊ÷YY<{©°ïÍ€«ãÛ¦Îݜ˴æUß».>–ËòksRlž×y';ên$¡`t¢¸!ÔR>ªš-ú¨p]K(åXKRB…”5·_çHâP=îÊ«ao ŒhÎ Þ¼C�tïkT \«ÕíWËM«èaû„ó–æë}£(@ïnňà×N}×OU­‰±Z ¨6—ŸôW�¶¿c„¶êÓ*;K¤ý˾ÈödŸ¹0a‰bFÅeëPaÿ“�‡Õ\ÿŸGݤ/ÉЩ¸ò:G)ÛõJmV\ûßý¾؃4„c•D%’ò–½»T>´˜×ýé÷øEÿ†‘éê:v�[¥tfÁU­¥Õ"ÃÕçQSíƒj®=ieìOøÂúŠ QN!jäÅ6[V$ -³àE¶ÞeOäñ…»ß¹½�ò1h=Ä:’7\´n“7‡mææi?’¾ ”‰³Ï„>`Ì} - dıŽkøŽ1ºÞ% Z-Ú±CMõÅà¶T©Ó¾ŸæŒ¦»bôF5,€ô>¿ø<~ŠEP·[|öy¦ N‘3!�GM5ׂÃÍßQI÷UyÈ‚î U0\ŠÐá'x„u�RÀçž�ÚÆèPacýÆL+Œ -@ùHŠáDð9_ýØDUm·Žê‡Ê‡X•—¸Œdº\£”®bM÷ huähN0²˜ð¢�®Ç!ib�šõDâÞ€jkŽEÇ7yKiÙük7 )9G -÷DX+ã¤ZNÀ0.à¼ï…¶D -¾ï`“¾ïŒø~¢¯÷ýIßIߟö¾À÷,‚ºGß—ù¨ó­ÛÌè >›@!ìB:ü�°îyçsÀm»1q:TØøÔùœeìpõEœ/¼óc¦JE\fê>:bêæÚ¿®GãçǼoìúðsQ=®î—›¼MËõyûKTEàà»Ø_P¢,7Sö÷°iû÷ -ÆìïÛÙ¿ßwÚþ'½/±œEP÷ÄþÕ²¬Æv�p÷—Á£¦Üôåù# “.¢ÃOðëF@f¤‰ Ð¡ÂÆƒÀ¤ÔJ¸àÑ ÜQhaÍ…ÐCÇÀÃÚ¨—ÇÙ¸/çB¦»Í‘ÊrÎuŠ/ôÍÏ»b[�¾x¹*s�‘ýºG[j¿O@P †7›�X@xØt@ô -Æ"Þ· ˆ~_'Õ°-¾ËZÐjÐö|6xü� î1êÙùò\”yU³Û¹#*B š¢`�ïé§ÚGÒAj¹¸TŠ?Á#¬II€áC2:þ6¤¾6£C¾18êjðû²tè£#éÐÁ\ûßóÌ=ËžZcß�¼Ô‡�Ë}s�;¸[Ru8¬ÎZŸk|WâJ]d}N1'Œ›ŠÊ�’ê›>ÖÖùaðà¬ÿIQ«]”ß'œá�î»,¾ ƒ@79u^åÛ¼\VþS©ÿîô·?¸uö:´'ÀÚÿôŠñ+Ö~•f”ª6gÝ;Þ®•3ü|ýñ«ÿxýåëC|¶vß“=µžJÿmÛ$endstream -endobj -4432 0 obj << -/Type /Page -/Contents 4433 0 R -/Resources 4431 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4430 0 R -/Annots [ 4436 0 R 4437 0 R 4439 0 R 4440 0 R 4441 0 R 4442 0 R 4443 0 R 4444 0 R 4445 0 R 4446 0 R ] ->> endobj -4436 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4437 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 186.7559 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00196) >> ->> endobj -4439 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 515.6229 172.9881 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) >> ->> endobj -4440 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.4309 515.6229 224.4542 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4441 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 476.7686 180.7289 487.2989] -/Subtype /Link -/A << /S /GoTo /D (a00156_gedaf3e48c2b04229b85455fb948468d6) >> ->> endobj -4442 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.1718 476.7686 232.195 487.2989] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4443 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 437.9143 186.816 448.4446] -/Subtype /Link -/A << /S /GoTo /D (a00156_gcb807bd57e5489b386b876af5c1f163a) >> ->> endobj -4444 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.2588 437.9143 238.2821 448.4446] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4445 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.9214 398.6864 184.6543 409.5903] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6d71dececfce707c668e6257aad5906e) >> ->> endobj -4446 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [213.0971 398.6864 236.1204 409.5903] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4434 0 obj << -/D [4432 0 R /XYZ 90 757.9346 null] ->> endobj -1086 0 obj << -/D [4432 0 R /XYZ 90 739.9346 null] ->> endobj -358 0 obj << -/D [4432 0 R /XYZ 90 739.9346 null] ->> endobj -4435 0 obj << -/D [4432 0 R /XYZ 90 716.7484 null] ->> endobj -4438 0 obj << -/D [4432 0 R /XYZ 90 534.1992 null] ->> endobj -4431 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4450 0 obj << -/Length 1521 -/Filter /FlateDecode ->> -stream -xÚ¥YÙŽÛ6}÷Wé‹ Ô ÷%(Š.ÓMQ Mæ- ÅÖÄÆxì©,gùû^J¢L‰©6˜‡Ñrtïáå=‡¢L2 $38SB!øÌ6 œ}„Ë/¤½½†ûkðËíâésj2ƒŒ¤2»½«#H‚%4»Ý¾YjDùjM^^ö�O«ýCQ®ÆK´k®>ߊæèUqgïéeqÜØKJk±$J­Þݾ\üvÛ‘h9 -&‰¥ðÏâÍ;œm�ëËFÌh‘}†Œˆ14{XpÊÜÉañzñw§¹Q?06TAØøX Gp…ºÁR»òÇ -£û¯ƒ…6¡ 2BÔ¡¡Ð62Õ×Ј´ÁoŠ*‡HÛ&ÔMqÞ”ûÇj:¶�˜76Ž%lš8·+&–5¯úÙÃþC™—_›“]‘oÝ�·ÓC�†µ×a¢U&™FØ`6Z9Zû¨°S´A3ˆ%0Â\ˆšßÏ+Û)ÕîT>æ&˜"Å(‰'ïP#Ùýº¬�"L\£Õé·ùC[ÕËñænYÎMU ñž–q& ê§~¨*…´Qr@µ¹}Ÿ¹£?<Úî‰ÚÒ§D¶r ýÓy¿9£s1äB¹A’j/[‡ -ó÷F³ùi¼5.$µB?XäMa;븯»µ.ôþèw\PI¡ƒ(™$ ÌZööVù±Å¼ò§ßá×þ#ÓĵìÅ -a;$¢%bľGdØ}•JD³éQ[FÂׯE$ -ÊÉy�ünÜ.[0 ~ðds8mîÑîÉ„‘0°ÝzÔM^åMÁ_WåeS]:�¸,8,ÂTêÉ•ÀŒ)L‚H4¿Æ±ùßR*Be[§9E3v¨T^0hƒ¥ìç=×£ 23 ÓƒÌÓíåð)AÜk{ )HèÉe|ð‚!7� šÀÃŒJ! Ôa„5½r8ÓÀQòš#¬/Xàè`�×ÍÑ®]„,Q8[Mx­K(33¹xèn%½v)´WÖZÙøÄóËqc=b¬/9ƒ*¢&ûÒDú²ƒ%û2šñÚ—‰¼®/{y?­(^žöÛ°3MˆäŽtf‹O±âv�ùþ\„Q0G†èD *•\qÄ5$‹—'…ÅœSp®™Eèð aÜIyR -ÊÊÄ Ð¡ÂÄ„û‰)ô8×rXÌFVP˜(MÜ;Fõ}#ÌÚêß[ªï+·€VE m$–ùJI¦ô -=�¼UÏÓ«�ŽxG³_-¥|¶‰À,À:¬&Òr"ü‚ˆi݃Â8ôXJ÷–Ö½0¦ûxÞN÷~Þ´î{¹çè>Î"ˆ{Õ}YŒ*ߨi•(‚C¥ÒkŠ@$lPüiåÛåBj2· >Á#Œ;­|F`Û¨u¼*LÜW>cú|Ø}ås§ü˜¨™1ˆ+&æ‰ÚGGDÝÁlúWus4zÞ¾°ëÃÏûj7¸{Î -ßšòäü™ÖH�þdžÿ-/B2’�KÊß‘"¯“/oRþýÜ3äŸ`ÄíÉ¿ÊËÐ`¯‰Q‰28TŠÌ4#˜ Ê1‰¨dn!:|‚G7b -Q-t¼*L<0pJ%Ű3–þ¨ÀöACg€‡Ž€ƒµP·Ç¤Ü•+.–§‡bs)ËSËâØ>ûxÚ«þ¦ßFY1ý~Àì÷Ùÿh‘0>m°ÃRX›”A8XÚ ¼€1ƒˆçí ÂÏkK5L ïJÆ~ -è§�ö‡Oâ^½¡ž�/�û²­JÊfÕ-B JQЮՠöwàÆç–¢Ã'x„q#î `CËI|ü*L> endobj -4453 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4454 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 187.3139 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00197) >> ->> endobj -4456 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 534.931 161.5608 543.7776] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4458 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 450.4922 172.9881 461.0226] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) >> ->> endobj -4459 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.4309 450.4922 224.4542 461.0226] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4460 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 411.6379 180.7289 422.1683] -/Subtype /Link -/A << /S /GoTo /D (a00156_gedaf3e48c2b04229b85455fb948468d6) >> ->> endobj -4461 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [209.1718 411.6379 232.195 422.1683] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4462 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 372.7836 186.816 383.314] -/Subtype /Link -/A << /S /GoTo /D (a00156_gcb807bd57e5489b386b876af5c1f163a) >> ->> endobj -4463 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.2588 372.7836 238.2821 383.314] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4464 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.9214 333.5557 184.6543 344.4597] -/Subtype /Link -/A << /S /GoTo /D (a00156_g6d71dececfce707c668e6257aad5906e) >> ->> endobj -4465 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [213.0971 333.5557 236.1204 344.4597] -/Subtype /Link -/A << /S /GoTo /D (a00087) >> ->> endobj -4451 0 obj << -/D [4449 0 R /XYZ 90 757.9346 null] ->> endobj -1087 0 obj << -/D [4449 0 R /XYZ 90 739.9346 null] ->> endobj -362 0 obj << -/D [4449 0 R /XYZ 90 739.9346 null] ->> endobj -4452 0 obj << -/D [4449 0 R /XYZ 90 716.7484 null] ->> endobj -4455 0 obj << -/D [4449 0 R /XYZ 90 551.8236 null] ->> endobj -4457 0 obj << -/D [4449 0 R /XYZ 90 469.0686 null] ->> endobj -4448 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4469 0 obj << -/Length 1547 -/Filter /FlateDecode ->> -stream -xÚ¥Y[oÛ6}÷¯Ú˜YÞ/ÁP¬CÒ":t©´EàØJ"ı2Ûj׿�–¨P¢D‚À²uô�ÃïFR$†?’œ)¡�a\f«§ ÎîáçÒÜžÃý¹ø}1yóžšÌ #©ÌwG ’ A Íë/S¢ôlN ejZ]~‚K�§áúâ}±Éë«órU=åÛÃòP”ÛÙ·ÅÕäbÑÒ6ª“Ä’þ3ùò gkPw5Áˆ-²ð#b Íž&œ2÷e3ù<ù«µSß8>048AØðèGð uã0ZU�N#*fs‚1žVÅóøŸoóâþá¶ÜÍà×)Zõz�ßåpOOóí*·­2BÀÖ€êDŽóü°KëÆgù~µ+ž�ÇÀóaíXݦ¶s¾<,o—ûFEyWnŠíã|S®–›ú»¿ÿ¥þ^íÙíÏúóòÓwY_­Êucm¹m@‡²çc�/ë�»êPíлëO}ƒp‹Šé�]qÈQ?´@˜h•I¦6˜ †Ò�æ>*LVmÆ l Œ0âè©w3«üðPîÎúÜS¤%qò5ÀîGˆ`…aâÅÚ‘~½|jâ[m!‹¦ùf_Ç—ïiIgúøÔ¯�T¥�6Jö¤Ö·3wõ‡'Û=1 [ú²ËVÀdÿ¶/V{´ÏûZ(7HR-ãnkQ!gà¡5Ëÿv æD8“Úäñò¯Ómq¬›££‹æÓþ¾ Ô¡+™$ ÌõöÖî¾Á\ûáwø¹ÿÀ@ø»V]§…a;Hß›DBs²§§ïM‡J¨­Y¨ñ¦ìx“:“D�[9?B_ÛÕ¦²•+¡C½òõ£‡WÖŽmEõ¬ûD˜Ô‚!et'©{* d8²ì»b{�,qHRŠðíP§…B5m‚qí‚úù‘ï¦!A4â˜òÑÉÑ U¼„¢ÕüÅŽ%üJa :�� ¼£Œ-*Å 3˜ÁRvy_¯›‘ä\"Eé‘�g¼Ã§dv­Œ�ïþ¾Y\~¼Tƒ¨12á‡JpSL µ0ërª‡¢Œ₌ùå~,Æ *â�á(i`�ô„øú̧„7ª¡oÕj¸øsq}yñ9P ¡h–»%x ,ö3^=Rð ´Sðï«íÊNCϹFÂh=š > ’ -,™ QÆ—tHðº|èð~ŸQXú뀼a=îñ„pø”ŠÀn3Ãݸ⦀y8˜àÀiŒ0wE‹Jˆ X#�™î… ìÜ×d(ôL ÉÕx¯÷±Ð;X:ô1F/ôqÞ6ô>o:ôîSBWØ BÿœïŠr]„ëØðH…EÜ-*!„R�ˆ„Íh7 '„ŸR$�0ãá÷±ð;X:ü1F/üqÞ6ü>o:üîSÂWØ Â¿\¯ÃÂW05›„'ZTBµë¹Â.§¢D�삟¢ì:Ï0öÝMØ÷$LJöG|ø•â—–ÜRwùkîÇÓf‡KèjH�Ý+¬ªl՜攟ÚÊ‹] Ç(%âžiQ¡Â}°dö N/70ØCBkâ6$VÛX»€lSœ‹ñvábíÂÁÒí"Æèµ‹8oÛ.|Þt»èpŸÒ.â*»AZTÏëå!|³@ ”š‰¸3ZTB…|ÀŠ“^†šÌ>Ìuª#Z|RAßn²i(» ‰thQ)~eKØtùkî‘Äg–ý†�ï–|@$ñ[X2ñcŒm¹&Ó¥}J�ÃuÔ%û•Ý’(Ⱥ¸sZT(¢Ó¯ˆ±3 í‰pýª;�bØ1qÙãOK‡O¸!´¸aS–�Õs HCtåqG´¨” ­áš‘¾#êÓPD5>ÝŸRØMÕ'ã¬>Šˆz E%ø‡E¬6¦Ë­OEájð8ƒe"…ü_‡*ÇרîŨÿ–]"£`×uœôáA{~â¤XÍòm¾ƒŽÞœ¸W±ÝÅÕŒˆiÕ|!´ùÄg”�Ñæô²²9Џ³Çå®9tŽ™ÜáÃyùïÏû<8^²ç>^ú‡Þendstream -endobj -4468 0 obj << -/Type /Page -/Contents 4469 0 R -/Resources 4467 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4430 0 R -/Annots [ 4472 0 R 4473 0 R 4476 0 R 4478 0 R 4481 0 R 4483 0 R 4485 0 R 4486 0 R 4487 0 R 4489 0 R 4490 0 R 4492 0 R 4493 0 R 4494 0 R ] ->> endobj -4472 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4473 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 217.1919 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00198) >> ->> endobj -4476 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 516.2256 200.2959 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00131_5320d4457a472d8888ec1905bc0e0a1c) >> ->> endobj -4478 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 504.3552 188.6795 513.2018] -/Subtype /Link -/A << /S /GoTo /D (a00131_5f2e1fcf0055d20ce17664b1027bb9eb) >> ->> endobj -4481 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 445.4457 207.3094 456.3496] -/Subtype /Link -/A << /S /GoTo /D (a00131_1273664aba3e6a2a46e87dcb1a5f19ad) >> ->> endobj -4483 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 432.4943 226.6668 443.3982] -/Subtype /Link -/A << /S /GoTo /D (a00131_890e822616a6839dfbf51dcb591b8e99) >> ->> endobj -4485 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 419.5428 208.4056 430.4468] -/Subtype /Link -/A << /S /GoTo /D (a00131_88460bea09a462d0e22511cb567eee14) >> ->> endobj -4486 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [212.2212 419.5428 265.1324 430.4468] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4487 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.295 419.5428 398.1028 430.4468] -/Subtype /Link -/A << /S /GoTo /D (a00092) >> ->> endobj -4489 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 406.5914 220.5797 417.4953] -/Subtype /Link -/A << /S /GoTo /D (a00131_1d5ce7047650f3ecee0814dbc8714099) >> ->> endobj -4490 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [224.3954 406.5914 277.3066 417.4953] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4492 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 393.64 191.7182 404.5439] -/Subtype /Link -/A << /S /GoTo /D (a00092) >> ->> endobj -4493 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.6883 393.64 287.4687 404.5439] -/Subtype /Link -/A << /S /GoTo /D (a00131_692d80636342d564422ccd9296ad568d) >> ->> endobj -4494 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [291.2843 393.64 344.1955 404.5439] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4470 0 obj << -/D [4468 0 R /XYZ 90 757.9346 null] ->> endobj -1088 0 obj << -/D [4468 0 R /XYZ 90 739.9346 null] ->> endobj -366 0 obj << -/D [4468 0 R /XYZ 90 739.9346 null] ->> endobj -4471 0 obj << -/D [4468 0 R /XYZ 90 716.7484 null] ->> endobj -4474 0 obj << -/D [4468 0 R /XYZ 90 534.1992 null] ->> endobj -4475 0 obj << -/D [4468 0 R /XYZ 90 534.1992 null] ->> endobj -4477 0 obj << -/D [4468 0 R /XYZ 90 520.2106 null] ->> endobj -4479 0 obj << -/D [4468 0 R /XYZ 90 464.3956 null] ->> endobj -4480 0 obj << -/D [4468 0 R /XYZ 90 464.3956 null] ->> endobj -4482 0 obj << -/D [4468 0 R /XYZ 90 449.4308 null] ->> endobj -4484 0 obj << -/D [4468 0 R /XYZ 90 436.4793 null] ->> endobj -4488 0 obj << -/D [4468 0 R /XYZ 90 423.5279 null] ->> endobj -4491 0 obj << -/D [4468 0 R /XYZ 90 410.5765 null] ->> endobj -4467 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4498 0 obj << -/Length 1405 -/Filter /FlateDecode ->> -stream -xÚ¥X[oÛ6}÷¯º˜Y^Ä[0 ë�µk†]š·¶[N„8ræK»þû}”H†eÒØÖåè;‡ß�R`ø#…Æ…äiVŠbù4ÁÅ=<~7!öõÞÏCÀ¯7“×o©.4Ò‚ŠâfÝZqJhq³ú4UˆŠÙœr<=ÖϯáÞTõýÃÝv7#OÑC÷òm½©º«ëj]Á;5­š¥yT -�§DêÙ—›«Éo7^‹•Ê™ FÉß“O_p±ÉWŒ˜V¼ø7­iñ4))s7›ÉÇÉ_ÞN÷¢ý`lÄœ°ñ!“ÁêÆLÁ22Œî?ŽÚ1¤9oÀ톀ªD,ÇeuX€¥Ugê²Ú/wõó¡Þ6Ö ¢cìݺ³ó{µXqûágŒ©Ó³ÞÚ‡«Åaq·ØÛÇÛu÷»©›Çùf»\lº{7ºý�6Ò{§æî{÷ûþÃW›ËíÊZ[4tØZpuêóõñpÜÙ·o®?¼XBìPa¢d!˜BXc6Sš‡¨8••F3°Å1Â%ç­ËÞÌŒÂÃÃvw1ä&˜"É(I“{Ô{*‚%’„ñk-ýjñd}l!�¦Õfßš�àkAQÉ8dvûÕO‘T)‘ÒR ¤v¯ wõG Û}1"[„²#ËFÀdÿ²¯—{´¯†Zh©‘ J¤ÝæQ1oà±5ÃÿóH-Ì w&)ôȃ¼¬L!4u[@­£ë¦W COr…X)ÁˆcfÕ›W»{‹¹Ãïðóðƒ‘ðGv�º^/áÜ´’¡7‰@šâ@ÏЛ•Q[3*�õ¦èy“:“D‚[˲…þP7ËÍÑ”¼€Võ -ô£‡W':+Te×™.¡ñtnÿxØ—Pþm{Ü�ÌÀ‰0ê䄯êL@©¨òÅŽáÿL)�ëÛ´`(ª$£GåxaÑXˆ>ï¾mÄÌ4LtL ˜O'™Ãç4Dvm’ݺ$»]¬V»8Ǹ™CHÚ5"¢zCL�bZ´üo�ÍÒ”ßX°K©‘‰ÕIHÛòÁN2¾;Ãë‚Ýãý:£0©Ö«8Ü€&„¸á¶øœŠÈnî:_np#Œ¤]áQ+¤0ä\?˜cç¸&c¡QÊèéЀTè,úcú4¯}È›}�ûœÐ§UDvÇ*=޼D%ÖOxTF5¸Âw†(‘g»Àãsô‘]ç‚úÙt¹Û8ñÌHf‘¾Cåøá­0]°ÇßqÏJ<µ‹çñŒˆjØS�é�ψŠíž50-O{Æ£b¤ Eh˜†Ìîi�˜�,Û �q [£íT»ànIäévRíÂÁòí"Å´‹4¯o!o¾]ô¸Ïii‘Ý(-ŽÏ°9ŒóB©O;ã22(¥Ë’ ‚0Ö4(,64Ît„Çg íf›†4ó ΤƒGåø¥™-±îówܧ¿ÄˆÑÛ¨6ñ@*ñ,Ÿø F_®™ÄtiŸSçË#T—íWDc$!ëÒÎñ¨XD¯_mf:áúUÅH¨R xO§¥ÃgÜÛ�ܰÙn�Ï‘ Ñ•´L;£r2”‚k³2ì;b¤>5ETáóáð9‘Ý\}²’uÇ€IxT†Ÿ•¡uŸ?]ŸTÂÎ^éÓõRõé`ùúL1Sš×W^È›Ÿ˜zÜçLLi‘Ý(ñŸ«]½]Õ˱)BHÌÓîð¨ŒJ"Â,œzaÈoc$A¤”£{( ö‰àâ�g·)¤°Ù‹ÑpÃ-�–°ë²ÇÕV„Ñü®jªLåöÌÕ{ýé.®f„O�ö†Pû‹/(» ¸»ƒvd�w×3ʧîôøøÞÕ„ûº—Û¾ßWÍÐ=æ°}Ä?ÿF$YÍendstream -endobj -4497 0 obj << -/Type /Page -/Contents 4498 0 R -/Resources 4496 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4430 0 R -/Annots [ 4501 0 R 4502 0 R 4504 0 R 4507 0 R 4509 0 R 4510 0 R 4511 0 R 4513 0 R 4514 0 R 4516 0 R 4517 0 R 4518 0 R 4520 0 R ] ->> endobj -4501 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4502 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 217.7498 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00199) >> ->> endobj -4504 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 532.8737 216.3454 543.7776] -/Subtype /Link -/A << /S /GoTo /D (a00092) >> ->> endobj -4507 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 476.0215 207.3094 486.9254] -/Subtype /Link -/A << /S /GoTo /D (a00132_1273664aba3e6a2a46e87dcb1a5f19ad) >> ->> endobj -4509 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 463.0701 208.4056 473.974] -/Subtype /Link -/A << /S /GoTo /D (a00132_88460bea09a462d0e22511cb567eee14) >> ->> endobj -4510 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [212.2212 463.0701 265.1324 473.974] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4511 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [320.295 463.0701 398.1028 473.974] -/Subtype /Link -/A << /S /GoTo /D (a00092) >> ->> endobj -4513 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 450.1186 220.5797 461.0226] -/Subtype /Link -/A << /S /GoTo /D (a00132_1d5ce7047650f3ecee0814dbc8714099) >> ->> endobj -4514 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [224.3954 450.1186 277.3066 461.0226] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4516 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 437.1672 191.7182 448.0711] -/Subtype /Link -/A << /S /GoTo /D (a00092) >> ->> endobj -4517 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.6883 437.1672 287.4687 448.0711] -/Subtype /Link -/A << /S /GoTo /D (a00132_692d80636342d564422ccd9296ad568d) >> ->> endobj -4518 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [291.2843 437.1672 344.1955 448.0711] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4520 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 424.2158 226.6668 435.1197] -/Subtype /Link -/A << /S /GoTo /D (a00132_890e822616a6839dfbf51dcb591b8e99) >> ->> endobj -4499 0 obj << -/D [4497 0 R /XYZ 90 757.9346 null] ->> endobj -1111 0 obj << -/D [4497 0 R /XYZ 90 739.9346 null] ->> endobj -370 0 obj << -/D [4497 0 R /XYZ 90 739.9346 null] ->> endobj -4500 0 obj << -/D [4497 0 R /XYZ 90 716.7484 null] ->> endobj -4503 0 obj << -/D [4497 0 R /XYZ 90 551.8236 null] ->> endobj -4505 0 obj << -/D [4497 0 R /XYZ 90 494.9714 null] ->> endobj -4506 0 obj << -/D [4497 0 R /XYZ 90 494.9714 null] ->> endobj -4508 0 obj << -/D [4497 0 R /XYZ 90 480.0066 null] ->> endobj -4512 0 obj << -/D [4497 0 R /XYZ 90 467.0551 null] ->> endobj -4515 0 obj << -/D [4497 0 R /XYZ 90 454.1037 null] ->> endobj -4519 0 obj << -/D [4497 0 R /XYZ 90 441.1523 null] ->> endobj -4496 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4524 0 obj << -/Length 902 -/Filter /FlateDecode ->> -stream -xÚ¥VKoÛ8¾ëWè(ÄÎ�"E‹Å¶MÓÝúð­) -ÕV¡¶äµ¤móï;”HG‘ç°’âð›�óâ`ô‡¡�0“3"Uáz@¸¥ÏotÛ í'c�W«àÅ7¡aFq®n{…Lräájó%B q YÔýó�¦"d0L®Ê]1Ì.ëu·/ª6oËºŠ¿®®ƒ7«“ZÇJ -…Vé¿Á—¯nˆÝuL-ß´†Æðp¤\øÅ.ø|<á ý�¥ËI˷ÔÑî¯Çé¶Ùp;Íx'QW^Ð/i»²ewÓ ~*n‹cŒ:*ªua/8 #3RöÈdY Ìõ2C‡}Y´9!mœ­Šf},ÞR$F°8–¯pÞ×›Îs¸­�Ã¤çØ–ÕvXÖ]û½î*¿zíÜÔ1ÊhkÝÒ _ÊjÛŸ1Ò1·pcsˆþ³ÿêÒAµwNó¦Øå÷žÿË8…èõ;/r¬»íÝ¡k½d¯ô˜oúP`ÓXÐ’ê,TB30 =é…’±Ô õê7ùÞ¹¹«~X3»fp3âè´â,’â¹?õÇŒj–1m25¡:lÿýì݈¶?±@[�iÏ�-r×þ¯¦\7¬)¦\xj˜âZ�7ÛIj®ÿÑÅçhVÿŸ ™� ô�”K’âÁJ^7¼*ûôyÕöûnÆ¥f‚PB…À$ÇÞn·NæÓØý^>Xpÿ ײW�)CáššlBd}^ê9õ34«ž-U&Šh�)RFy5T–«®Z[#6 åZJÁ”D|ò ,¥†¢èÖéŽUxùœ§¤­™”g5ž¤žÓK•Þ€R�õžjÚT7Yà ʉî§#ÃË?Çb†ë"ã[ߨ\Ûr9Í2Æ…Ôç-q’z†·EŒ« ‡�à­Asœ{ƒÞ,z(%¥f'# - N„“±tÏDB¨‰‰J{kЫ™Ñ –ÉßyµñÏÙc[Ÿ³C¾¶ ‡ÒÙ6ìIŽT²T‹óÅT*¦²%›™ •Tÿ«5é“BÓ|üX)j5„¶vœÚ.$C©þZ3¼-ªâ˜·þeõí½Ÿ\ÛÇ´s än„ ..¸ëÁ("”kb.#ß"Ì›µï÷¾Uûu¿-fMšíž<µ‘•~`¾J�endstream -endobj -4523 0 obj << -/Type /Page -/Contents 4524 0 R -/Resources 4522 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4430 0 R -/Annots [ 4527 0 R 4528 0 R 4530 0 R ] ->> endobj -4527 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 250.6249 657.906] -/Subtype/Link/A<> ->> endobj -4528 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 200.0459 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00201) >> ->> endobj -4530 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 550.498 201.2321 561.402] -/Subtype /Link -/A << /S /GoTo /D (a00154_gb4b17aaf20d630f30919b19937b966a3) >> ->> endobj -4525 0 obj << -/D [4523 0 R /XYZ 90 757.9346 null] ->> endobj -1112 0 obj << -/D [4523 0 R /XYZ 90 739.9346 null] ->> endobj -374 0 obj << -/D [4523 0 R /XYZ 90 739.9346 null] ->> endobj -4526 0 obj << -/D [4523 0 R /XYZ 90 716.7484 null] ->> endobj -4529 0 obj << -/D [4523 0 R /XYZ 90 569.448 null] ->> endobj -4522 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4534 0 obj << -/Length 2879 -/Filter /FlateDecode ->> -stream -xÚ¥œmo7ÇßûS-p�^˜áÃò)(ŠKlÙqâØ>[9 HÁ••Øhb§~À¥ßþf¥%=\î‰;idï_óŸ�9K®6ÿ‰‰ç«-óª1“Õ·>ù¿>ÜÝá]8¾‹¯;/¤Ÿxæ�4“ÅçM#˜–BNW§ŽI7Û•šOŸn¾¿€?lµýñàæëzûê|ýy}?nº¾]µ¿rNù©pböiñvg¾ˆî]rZÑzÿµóñŸ\A’ow8SÞéÉà΄÷ròm§‘*üðuçbç_1ÎöÀæ C稅>IÑ0ø� g)á¤->IÁyõY©mc -æµÞÄ„Ò*Î —MŒÉDuýx ‘®¶¡ö׫û›ï�7w·] …@©—jgqÝ%ðtt¶}±Ø;{^?<^®þܾ\Ý]­Y¿æ" g'F¦µ°ƒ ¢]¬Ê‡†óŒs±Ç47~“Þ«Y›ÚãõÝý˾·à’Y%mUî¸,‚[f…ÒÏÑ6öW—ߺ¢>Ýþ9|ºþú°-ªèÝF²Fi7›wý’¥j-sÞš^ªÛÃN«w(íðŽ�´ N;‹Ü&p iÿó -2†lÙêî[?iÌçéÒEUžCròy´6‡_ÆÞ®p!$L§šíÜ_ÿι¼½ÙŒØMµoº¿Ûß]gåÔŽ)#ÝÄpЬڦߺÿÒiÎñú]ü†�1�Åm³ÛN׌¨ƒÑê{ôÇ^'*Ùöcµ®¬+†½ëºxÂ2#»âý|s»úút³Ø@'ø©Íöú§öÍíLß -Õˆðîûc¦ º¼¼_]—ÔùÄЊYï’‰Ñ;)˜v 4‡­àáñþæö »ˆÔÀ@—<j‘0Ù=´Ðj\´Sxx­® Œ]-uìj†Žõ ÓÞ51Jëö»”:oUð& ý�²‹¢‚)\g<7&1ýùª;Ç̹�1%­H�ÇgJ�rèGÝ”yþºm�—gçG'‹ƒ¬éHÎd#È mß�´);×þ ­ - £Â6j2P”ƒ¬Œ™rDœißûV�NÌkPÓidq7ˆ½³åÁÑI–„3°´ðM¡AU²†~§%ïYó|�rå’Ä (ÊAV¦L9"Ê´o¤Œ}+('æ5”é4²¸�òÅo”á�¼ñ… -UÉÚKXmë^€²¢ kà.㔑€¢deÊ”#¢LûFÊØ·‚rb^C™N#‹(Ÿ_,rʰÇÐB*T%kÏáBkÃÄ(7C”EÛ ´§Œå +S¦eÚ7Rƾ”óÊtYÜ@ùìâÍ8e²Ï”iëH[e7D™ ¦­&_H@Q²2eÊQ¦}#eì[A91¯¡L§‘Å ”_Í>Ý{—%lŒ�¥*UÉÞ+&¸JÝùÁ@+g™�ÚŽ‚Æt”A“ŽÏ  ¾tâ[�šW€.¤‘Å  ?œæ�ã‚»B‚ªd �5½Êór�²•ÌØñõ:N1îTeÄ„"LšFÀÈ´‚/v®ÁKæÐ�àî-އzµõ^ÐçD_Òy›øòêóY Ý_9Ž (¶AV†K9"º´oÄ‹}+ø&æ5€é4²¸ñéÙb9?ÙÏ6Ê�7œž¡«U{ WbÛ42µœÀ�bÖ=Ž (ÌAVÆL9"Ì´oÄŒ}+0'æ5˜é4²¸óÉééÙÐ ç�¡ËU)SÎËÔh§¬$즥ßCaÅ9ÈÊœ)GÄ™ö�œ±oçļ†3�Fs~q‘Ogà!tCW!ª -öít–Üôì‡¶Ê -êå¬ßDa…9Èʘ)G„™ö�˜±oæÄ¼3�F·‡yy<ÏnŒHå7 ]ˆ *$ δnlšÀÐnYqØQK;¾� -t�•ASŽ4íAcß -Љy h:�,n›ÆÑÞû³å|ïÍéò|~v<œO¢m¥Ðt9¢ª�‡l`A&d/�¡ë´tšyK¬´±€àeEÞ¤ã3ï‚oà�ø–y§æ¼ idqÞdû\§éQÁZr KmÝ«ÀЭÈ�iiý8b$ Y1åˆÓ¾1ö­@œ˜× ¦ÓÈâĦ8§ÛÅ—Ž®GT‘�ì¡ušˆ�~¹¶Œ[7¾É -y�•‘SŽ9í‘cß -ä‰y r:�,nŠ<ŸÖŽ c -Eˆª‚»œm|ê.äàÔn`¿-Ýø. (ÎAVæL9"δoäŒ}+8'æ5œé4²¸ÏœOæG‡o^Ÿž//N��öŽ3¯¦¯fBˆéâè4[«)Þ0£º:ATÈJñööXÓ+ŽPzˆûÜ–uã»/, øY™?åˆøÓ¾‘?ö­àŸ˜×ð§ÓÈâðµßÞÿ÷ü|f8°¿˜¿ŸŸdo)ØWÃùº�ØÇÃe.Î÷æË㣓wÐ8öÏçù[qïmC—&ª -9µ÷çhIJƒèlü¥ßça…>ÈÊè)G„žö�è±oúļ=�F7C¿]!œÎEüÜA—'ª -y©Fn’Mòº�',gÊúñ Püƒ¬ÌŸrDüißÈûVðOÌkøÓidqÛ4¶�(fÏ&Â"ŸqÞØB‚ªdmk<®'zB‘?<Þ?­ón=³Úšê2})—,n÷Lóòqõþ}uŸ]4µ†ÝŒÕt1¢*O@4ø²©aAÔÀ–¨W ®®‰0rœO ·WÄä�®7°¥†�te�¢¾P§‹V}a•Ú3j ¨FdåFA9¢FAûÆF�}+Eb^Ó(è4²¸möGûDû‘˜ô®P„ *¹;X�Ã5­W|ºS´÷wœ´µ•ˆúB.yÜ0ž®Æ…uLi©ébDUž@Ú(g®Q¢_ŒñFÑ�+po˜óÒU×)èKuÊâ–è`É é*EUÁ>�VÝ(ìèÝøs6è8Õ&:U¹Kv¨I�¦±G ÓŠ��k:™C?ê¦?@µ/ð7ƒ±+Y¨B2èÇ -=âa´‡�¬ã·bÑqtPASvÏ iÓ›–A'ΠéúQèãÓÃÁ�ÒjÈs¢‚o?VÀûm/lÛD3ü„°gÂhó}±ÄfŒ@/†\$þ -ü…Ýb÷½]m²‡ëÛõýåcø^‡ð�ã߇ogBOŸº„ìþæ/¥z)ùö'ɹپú<“zzwßû²Á:áwßsp÷ãï/ëÛ~yÚo½¨Ïé@�endstream -endobj -4533 0 obj << -/Type /Page -/Contents 4534 0 R -/Resources 4532 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4575 0 R -/Annots [ 4537 0 R 4538 0 R 4541 0 R 4542 0 R 4543 0 R 4544 0 R 4545 0 R 4546 0 R 4547 0 R 4548 0 R 4549 0 R 4550 0 R 4551 0 R 4552 0 R 4553 0 R 4554 0 R 4555 0 R 4556 0 R 4557 0 R 4558 0 R 4559 0 R 4560 0 R 4561 0 R 4562 0 R 4563 0 R 4564 0 R 4565 0 R 4566 0 R 4567 0 R 4568 0 R 4569 0 R 4570 0 R 4571 0 R 4572 0 R 4573 0 R 4574 0 R ] ->> endobj -4537 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 635.166 274.5352 656.3674] -/Subtype/Link/A<> ->> endobj -4538 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 603.5642 179.0052 614.4681] -/Subtype /Link -/A << /S /GoTo /D (a00202) >> ->> endobj -4541 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 471.0445 221.2372 481.5748] -/Subtype /Link -/A << /S /GoTo /D (a00135_534d9e416324fb8ecca6b9cb4b1f6a6a) >> ->> endobj -4542 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 457.1975 187.0257 467.1251] -/Subtype /Link -/A << /S /GoTo /D (a00150_g88e60aa2cf23e1c65d630701db08c743) >> ->> endobj -4543 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 442.7477 190.9012 452.6754] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6020613f5062417d9811cfa837215c83) >> ->> endobj -4544 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 428.298 189.2474 438.2257] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5ca559def464ef20d8b1f7d32f2f160d) >> ->> endobj -4545 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 413.8483 189.2474 423.776] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1320fd0006a2f70138bc2d0018dda829) >> ->> endobj -4546 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 399.3986 191.6086 409.3262] -/Subtype /Link -/A << /S /GoTo /D (a00150_g44b3b1ab31a403ba28ec135adfcbefef) >> ->> endobj -4547 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 384.9489 192.007 394.8765] -/Subtype /Link -/A << /S /GoTo /D (a00150_gc84f499cba8a02fc0e306c10b2acabf0) >> ->> endobj -4548 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 370.4991 189.7953 380.4268] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1425d4a0c2760adb653a04c0fb137a8d) >> ->> endobj -4549 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 356.0494 215.2498 365.9771] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1215163245304bad20d6c5608ad75ab7) >> ->> endobj -4550 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 341.5997 221.8948 351.5274] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9f1822e1d231235edacad691f3cb7bbb) >> ->> endobj -4551 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 327.15 214.7117 337.0776] -/Subtype /Link -/A << /S /GoTo /D (a00150_g691688604655ea8943d15f14c60027d8) >> ->> endobj -4552 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 312.7003 239.0603 322.6279] -/Subtype /Link -/A << /S /GoTo /D (a00150_g12f3bf821224b8e7b48a57ed3cea15cf) >> ->> endobj -4553 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 298.2505 239.7177 308.1782] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5c5b1834e497f53ad0ef947bbe9777fa) >> ->> endobj -4554 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 283.8008 204.1812 293.7285] -/Subtype /Link -/A << /S /GoTo /D (a00150_gd58231410d58e34b455328b888a9e73c) >> ->> endobj -4555 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 269.3511 244.6991 279.2788] -/Subtype /Link -/A << /S /GoTo /D (a00150_g207d17b633cd095120a74bc1f2257b17) >> ->> endobj -4556 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 254.9014 209.1625 264.829] -/Subtype /Link -/A << /S /GoTo /D (a00150_g4cc3e223b63f27b546d62e9a258dba5a) >> ->> endobj -4557 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 240.4517 305.6302 250.3793] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1cea57e3ea526f210b1068e6dcf7b4f4) >> ->> endobj -4558 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 226.0019 321.0623 235.9296] -/Subtype /Link -/A << /S /GoTo /D (a00150_g62c03e0a308cc23929a80fe8d8f9dc1e) >> ->> endobj -4559 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 210.9495 218.1788 221.4799] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1d3211dbbdfb22d6a47b60dddcf945e8) >> ->> endobj -4560 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 197.1025 341.9936 207.0302] -/Subtype /Link -/A << /S /GoTo /D (a00150_g42288d5c3cf4b10becefec657f441e54) >> ->> endobj -4561 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 182.6528 341.0573 192.5804] -/Subtype /Link -/A << /S /GoTo /D (a00150_g8387881de3a8bfd3c0d57b9d04ac9b7e) >> ->> endobj -4562 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 167.2268 167.0009 178.1307] -/Subtype /Link -/A << /S /GoTo /D (a00150_g24f52ac52d6e714cb04a5aa01be3bdd0) >> ->> endobj -4563 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [198.7613 167.2268 256.6538 178.1307] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -4564 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [273.2016 167.2268 305.9885 178.1307] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4565 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 152.7771 172.5401 163.681] -/Subtype /Link -/A << /S /GoTo /D (a00150_g96544dedc1cdc71ad2ad54bf1d5e5433) >> ->> endobj -4566 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.3005 152.7771 262.193 163.681] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -4567 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 138.3273 191.3593 149.2313] -/Subtype /Link -/A << /S /GoTo /D (a00150_g4309376690872fa4beb4f025f5cc199b) >> ->> endobj -4568 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [223.1197 138.3273 288.763 149.2313] -/Subtype /Link -/A << /S /GoTo /D (a00091) >> ->> endobj -4569 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [305.3108 138.3273 338.0977 149.2313] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4570 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 123.8776 186.9261 134.7816] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb9435261753469accec0c9bf8a5a2686) >> ->> endobj -4571 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [218.6865 123.8776 279.3487 134.7816] -/Subtype /Link -/A << /S /GoTo /D (a00096) >> ->> endobj -4572 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [295.8965 123.8776 328.6835 134.7816] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4573 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 109.8015 191.6285 120.3318] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9c0814ed491fa452ec97910c0728d410) >> ->> endobj -4574 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 95.3518 189.2275 105.8821] -/Subtype /Link -/A << /S /GoTo /D (a00150_g013c3a06a8b58589a77f4a3442f89c2a) >> ->> endobj -4535 0 obj << -/D [4533 0 R /XYZ 90 757.9346 null] ->> endobj -1113 0 obj << -/D [4533 0 R /XYZ 90 739.9346 null] ->> endobj -378 0 obj << -/D [4533 0 R /XYZ 90 739.9346 null] ->> endobj -4536 0 obj << -/D [4533 0 R /XYZ 90 716.0742 null] ->> endobj -4539 0 obj << -/D [4533 0 R /XYZ 90 491.1191 null] ->> endobj -4540 0 obj << -/D [4533 0 R /XYZ 90 491.1191 null] ->> endobj -4532 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4579 0 obj << -/Length 2957 -/Filter /FlateDecode ->> -stream -xÚµ\[o[¹~÷¯Ð£ŒF,ï—ú²—, @Ú8}h6IŽ…Ø’V–’¦‹ýïžsHóÜfŽay°}šù8ä7äÌ¡,fþ‰Yà3g JÛÙêî‚Ï>Ãÿz!š·ðþ¢üxuñ×—2Ì VÚÙÕueÁ -f¤�³«õû¹ðòr!ƒTn~~õ^>Œ×/^no7õ«Ÿ÷«óÝfwZž¶ûÝ凫׿\e· +£¬ˆN¿xÿ�ÏÖÀîõg*x3û¿p&B�³» -UúåöâíÅ?²�ú�êCƒ3B �NŒ‘ixFëêѽ<ïV‘ñýeîÀ—”ã�,µ+URpË´òúÁNtø›”¦ëKpø”4 -÷˜Q”_¡YàÖ¶ý~½”|¾ß®{¾ …0ßñ­ãçóÏ’EÂS,zv#‹óöðñ~sÚˆ¸S®„„¢Ü{Á¬7÷¿qÃ{~½aœ+19 O2èÚ­ ìÇS—‚„ ÎãCÏ(± ï;Cß®að¢¿òVÎl� NÕ’ÕÀ¬Á‹]ù7|æÁ¿ÕÕÀA^Üÿ`´xÊÛÝö´]Þnÿ[gŠêÿ®²Q~0�ƵsÚÀÚ¨é ɼµã²µÖ3ÇA˜¸l3Œ”mi‘-á7ɶ嗔mÛ÷Ù,zv“l—ëµ’}ÑZH¥Ê!H(Ê9ˆ[[­:¡­dÎ ?yø O1èÙ­†ï‡4Ë™ÔägT߯Хf¹d°«…îȹŠ~;$a†<|šW˜ýAÉ=r -$àT˜žŒ'ÂÓ·;žÓŒaÆzGÄ'¡(ÇÆ3nBgeì¢YÍ(æup³Z�ƲZ‚E?-�ÇïuÛŸOõ‹eýCÉŧmú¯õz‹ç7 � Ü?O~SœqYž€†ó[‚Ñù­0ØõX-F8•QLÙ�b—³`Énp… û!¥'A~ÜÑô4˜R�ô®MÒãêæËýù®Ÿ§`¹†€R\$å;&=,¼öÄ eÇ !2pÂm»}“ ºvÇå‹Uq‰<�únÛÉQˆ�ì |<9ª&9~Š»çùºŸ£Ü”US”ñD€úvÇd!ó)!ˆ%åÒ"‡p¶ßnvhz~Ú‰ÙñŒ%ÇUçÆÛÕùvyj -ÄÓMóâÕî´9î6Mj\] -3¿Ù¬âLU -ª“é¥àó¯›c+£6³y)üüÞBÌÇ*× Ì�ȧb4ŸžÒ<ù4ÃÈ|Z|r>%Ø%\‹žO1z�Χ½„kÓƒ|º=ŒdÔ`™Ñ�-1–‹Œ¢üX¸š›ÎäANMoL@εڷ˵q•hDB†j¨)¦n6ËuRɈ’®;=,kDTXaifÛÔdq²â̸ÒLLQR©g9º#™5NPRK0Zj…Á§K g—¥V²#¤†Ð{¼ÔpzYj-z0˧ՈÖbõu›Di.2Š ¹‚êЇöìMÕ„ ä¡'j­@cZK0LkW?½y²À†DUom»õÃ;ËÃa½<-Ç¥&-/‚y© §MQRK0Zj…A¤ BøÍ"*ý’]�¶ï ]‚EÏnÞ–vÛ¾š!¡�„¢|ÃQv¤Žï©2�=�A 'êJ4"“ {z#OC­#Œqϲ„µ3±"2ÄÎ0r —Ÿ¼[ì®Å®ª$÷»Þa¸we¸È¨¾ïVA%ŒfÚyщLSPµ—v|rÂEÇïøèž}Ïn9úÍj žäÌj'ðdá^‚´`vÝôKi)`ÅGG�ñ$ƒ®Ý‡ƒïr½>ŒP,ÇÞ�„"–€´´¥ÍðÀŽÇšà¥æó^]­¸‡ª‹Û©ÑÊx"Z}»£G+0¥dåX)¦|Çïñ°?žÐ$l9dª›—“p�Æ’p‚Ug•F%õÉcß*“�—ÊÍ7wût�¹Ùß7Àóýv÷ùáP#r¬×:@Žáyµ²pÞ5ŽJÔ F'êÂàÓ5Î.'ê’]Têy=’¬$7!Êr‘Q}ÿídí Ys¥:ÑJÖ^0ïzÑAŠ4x*=»ev›Kiæßú� ¬ *EP�Ê3eTw‰ %l-˜uPÈO BÆS zvɄƜ�G ¡ˆe ƒaÜs9¼ °&(š°!¿éJîÓ¢•ñD´úvǶ±p¸x”ˆrk|¬«]Û-�¯¥`NO|LT€±lÝ ¢ÿ·© -<Z‰”#¢rª_ÞýœªÌ:µ£‡h8æ8ïųäfäTAu73ŒÌÍ¥A¤$ü¦¬ÛòKÖ�mßê@‚EÏnÎ|»ÛíýiÓÏý^3á ÜxŠòïa[:Ñ| ŸòZOŽ@“ ºv‘G>2d †žQ„cY=I%µSJV^1nÕÄŽl‰F´œa•˜OûFÅõÈ'ªt -Ë} ûÃfµ…-7M‹'’Õ´r’ ®Ÿ§�ªL`°eRmÔ £5]Ä4�ûÍš.ýÒšnùž¢iœEÏnÒôˆ¢áüõ¢%b�P”wg™ãZvb?¨h^?Ò›:þ„§ôì"÷Ò$sÂ|èE8–ÜÄGr�¡“ŠÖ -Ú0±ï[¢1E'X­èåñô‘t<Á¨ŸGÒ’3c4Õ®Í0ZÒ…ALÒ¸ß,éÒ/-é–ï)’ÆYôì&IŽûÕæþ~èú˜áÒAH(Ê=ìæ!(Õ þ ¦¡ŒPÃO @“ ºvǯ­Ùx?@â#Ï(¯䞙ØÓ«åç!QÃBVñ«÷ãOÛK¶ÐŒ^èˆÇG÷ -vY%;ü FïÑ� z ×¢ws¸þ´ÖC¹‹ÎWFQŽm<ïŠN\bÓ>ˆŽ_¤áÜàI]»ã3âýiE =¡(Ç!žwµi;þ{&Ë[lã‹�/§n|%Ùø2¬i"ƦÀ×MÚþ„}¸²øûy¹;mOÍåÆëã¥6óý]·£øé{ê2î«¶c¾E�¶ÎÝæômü2ŽFoñȪóôL;hlysNî  lµïŒÄwІ¤Œ–_rmûž°ƒ,zv¾­±øªgÞ[MD ¡(ßN±ø,¦xÈ +ÈKÍ:+ãÑiŒiËb}Ê'÷Ãâ#öéf:øá7å¤�ü¥Íħª%Ób‚Õ=¢t ÒkD²ë?WçcÝÜO´'ôФV�§ìÄæV‰þò”䑾­wú]9_·ËO·›¡oPÅþ…ÖŒj² šÌ0R“˜ÇGoö»„k±Ã:Âñ -€§XV{¾¥YÚxä3�d™p=–1‹W�áîÎrJs�ÏžP м>õm§¾n“aôŸ>Ç8»<Ç%»isŒ°|üã,ówY®�ƒ3 SÆ•p(G˜×Eî¬Âr欦¾™aô Ÿ>Ã8»<Ã%»i3Œ°|ü ã,ó wYÂënyÿ¥?űǢ5Jr÷¢ -EO±vÌOÍpƒ¢'øÁÜÓ祖§· ã¶9Ý|ÒFU(8(ŠSË2y€ ‚b‚ PV¯cÆBÑ…0\dî;æz8÷´Ãó·úpñÇüEþ÷çŸCÛ»21CøñUS°e“`ôºA<>~áàìòÊ)Ù õT„‚Or�²›ºfÀ„¨:>»„k³+®—]RäpŒC'-£(÷1ÓqÿþÝ«7Œ÷^ß½|ûêß¿üE~;– -Xx°ûˆiÇÒ�œ¨3,’¹J§æ|aqèbîc¾SW¡Z>K5,Ÿ(a4 RÆ�:õ˜{᩹bÖà:tŠ®5-™òÊ´¨! ¬�“ìØÌßL®¯M÷û8"Þ˜0xt ,†xÃlð$Ä�Ã>éOWT“îá#¢xÞÕUõÍh_]^ˆ«WÃ’q~ºº.üu³Û—§ô¼!•„O/^Ç+çæ!›Ÿü©~�Íßèˆçš.Nì:í�Yä?æñé{úSÿùþ¹ÿ ,þu�D­ˆÒÿ‡w‡endstream -endobj -4578 0 obj << -/Type /Page -/Contents 4579 0 R -/Resources 4577 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4575 0 R -/Annots [ 4582 0 R 4583 0 R 4584 0 R 4585 0 R 4586 0 R 4587 0 R 4588 0 R 4589 0 R 4590 0 R 4591 0 R 4592 0 R 4593 0 R 4594 0 R 4595 0 R 4596 0 R 4597 0 R 4598 0 R 4599 0 R 4600 0 R 4601 0 R 4602 0 R 4603 0 R 4604 0 R 4605 0 R 4606 0 R 4607 0 R 4608 0 R 4609 0 R 4610 0 R 4611 0 R 4612 0 R 4613 0 R 4615 0 R 4616 0 R 4617 0 R 4618 0 R 4619 0 R 4620 0 R 4621 0 R 4622 0 R 4623 0 R 4624 0 R 4625 0 R ] ->> endobj -4582 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 704.2391 180.1912 715.1431] -/Subtype /Link -/A << /S /GoTo /D (a00150_g22f140b02c354dfebcc7ad481c3bcd68) >> ->> endobj -4583 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [184.0068 704.2391 208.6941 715.1431] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4584 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 665.5553 177.9699 676.4593] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6832e4d2d046536b6472f7ac92340f68) >> ->> endobj -4585 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7856 665.5553 201.4916 676.4593] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4586 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [231.8776 665.5553 256.5649 676.4593] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4587 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 626.8716 138.5977 637.7755] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4588 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 626.8716 189.7953 637.7755] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb6683dd83fe1c8de9a24086d4b69e907) >> ->> endobj -4589 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.6109 626.8716 218.2983 637.7755] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4590 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [241.84 626.8716 266.5273 637.7755] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4591 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 588.1878 138.5977 599.0917] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4592 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 588.1878 197.5461 599.0917] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2addf34c7d457c1a7899a7e2171ef1e9) >> ->> endobj -4593 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 549.504 138.5977 560.4079] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4594 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 549.504 201.9695 560.4079] -/Subtype /Link -/A << /S /GoTo /D (a00150_g85b65e38aa74eba18979156f97a94a87) >> ->> endobj -4595 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 510.8202 166.9111 521.7241] -/Subtype /Link -/A << /S /GoTo /D (a00150_gc48ed5f0d27721ef62a3ed02a5ad8d2e) >> ->> endobj -4596 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 472.1364 152.9837 483.0403] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4597 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 472.1364 211.6433 483.0403] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9c24fba2cd8f7f62accb0a0d5bbe4dad) >> ->> endobj -4598 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.459 472.1364 268.3701 483.0403] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4599 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [307.2043 472.1364 331.8917 483.0403] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4600 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 433.4526 172.9089 444.3565] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4601 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 433.4526 236.859 444.3565] -/Subtype /Link -/A << /S /GoTo /D (a00150_g79c4110211247df3fb30b8cf1c4c02af) >> ->> endobj -4602 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [240.6746 433.4526 293.5858 444.3565] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4603 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [332.42 433.4526 357.1073 444.3565] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4604 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 394.7688 185.1725 405.6728] -/Subtype /Link -/A << /S /GoTo /D (a00150_gaa585784b0914cac1d37f07f85457008) >> ->> endobj -4605 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.9881 394.7688 213.6754 405.6728] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4606 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 356.085 175.2098 366.989] -/Subtype /Link -/A << /S /GoTo /D (a00150_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -4607 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.0255 356.085 203.7128 366.989] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4608 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 317.4012 183.4989 328.3052] -/Subtype /Link -/A << /S /GoTo /D (a00150_g266263ac78a1361a2b1d15741d3b0675) >> ->> endobj -4609 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [187.3145 317.4012 207.0205 328.3052] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4610 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 304.9087 138.5977 315.439] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4611 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 304.9087 162.6772 315.439] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -4612 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [166.4928 304.9087 191.1801 315.439] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4613 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 265.8513 171.8826 276.7552] -/Subtype /Link -/A << /S /GoTo /D (a00150_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -4615 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 183.3435 166.8215 194.2474] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4616 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 183.3435 221.3367 194.2474] -/Subtype /Link -/A << /S /GoTo /D (a00150_g7d3673f52f5846b6961d23b150decd54) >> ->> endobj -4617 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 170.4773 166.8215 181.3812] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4618 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 170.4773 213.028 181.3812] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20df5c82f2a15a508c19e505b5d9de2b) >> ->> endobj -4619 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 157.6111 166.8215 168.515] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4620 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 157.6111 220.2307 168.515] -/Subtype /Link -/A << /S /GoTo /D (a00150_g3237be0d9ec457de0177689ee23c0d5c) >> ->> endobj -4621 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 144.7449 168.4754 155.6489] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -4622 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 144.7449 218.5572 155.6489] -/Subtype /Link -/A << /S /GoTo /D (a00150_g499bb98a0b4ae9a98553ede81317606d) >> ->> endobj -4623 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 131.8787 133.6164 142.7827] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4624 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 131.8787 166.9014 142.7827] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4625 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 93.195 192.0768 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00150_g561b8eda32e059d4e7397f776268cc63) >> ->> endobj -4580 0 obj << -/D [4578 0 R /XYZ 90 757.9346 null] ->> endobj -4581 0 obj << -/D [4578 0 R /XYZ 90 723.1038 null] ->> endobj -4614 0 obj << -/D [4578 0 R /XYZ 90 202.2081 null] ->> endobj -4577 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4628 0 obj << -/Length 1404 -/Filter /FlateDecode ->> -stream -xÚ­YÛrÛ6}×WðQz ŒÅylgìi×Vž\�G–hGS[rtië¿ÏBXP©êx<âå{°{v ¡ ø…¥…–šX.T1~íÑâ/é�¿]âý2ü2ì��3[XbSÅði3‚"°b8¹ëÂÌ d’ö×Ó·3ü'ãíéùô¥ÚÝTOÕb¦_ÍÆî’1ÜöÁðÁýð²÷yX[÷ä$WàlÿèÝÝÓb‚$/{”pkdñ7žPÖ²âµ''/½ÛÞïõ8Û›öÍQPI 7EÉôvV¨ª (†^aèÍj§HZ|\ çÀ›T[S”óÌõÀÐþ|:[áä7~XÍýïwï˜ÑÛÛËt±kNŒ”�dXÊÇUáTÈ\\,×hÀÓãšfWÇ5f·6ûÂʈb’ì +—®È˜,»€k²Ã°º.9z^¶# D .’$KãAÙ†b†pÉs�õ¨|\ÿîô°&©ÕQ�¨9·�ç³v6H@ãZ¤è•5¨e¸±”L(¡ 4}²oEƒ‹w+)4�vÏ;À3óÞ59o‹�‡;q%æm�eŒïxÜØò€A-äZ^€¶N¯‹׸ñ½nøñÚßÁéUc·€ïîdsS6ûú^xKc1Ñ�Î$F ËfF<àÉ©‘ap vÙäH1<´ê…äÈ1 ¸½ Û5ÏJt·`IŠe�Ê·¸e¸i¿ûvqýðñëÕÕíýží²ÔŠH¡y·^"@J/–×KÂâñzI³«õ³K¯|RôŽ^ùdè\“ž[åO—«jö6_¬–ûJ éÈÕ¨ \C±ž5(l$óëÅíðóÕõ×›�Ârµ_<Ši;Ö`ñD€”x,/ž„ÅãÅ“fW‹'f碳žt\ÁX`:í—Õ¶ßìÇK å|Ç;û2.ŠŒny§ÛŸó@kÜœ7Äp ¬8n/*…!J‚Í4æÖØ‹¶úï·O‡÷_éjƒý6’’ ¢Eö½W ËgD4àé‘fWgDÌî°ŒH°<´ªnóAdY\'Ëe[¶’0#L’fY£2ÊEk¹C`SSQu‰V ˜–B·v"@J;–×NÂâñÚI³«µ³KnVSìŽÞ¬fØ\“jf4sÖ–µ"T*›Y�ÊׯµÞ×܉û®z$¬"F(vX݌щºYÜqQ>¾¯Â'¬œ û£wÿNnYM¶GOóÅÎ.‡³òqê ì²ú±ö_kðl¶~} ›£ñèe¼~Ù|³XvÖ\a$v’ßÞ —ævïꙢ§AI}Ò÷ Mú|8�?j)b57á£patüRͪÅh\¾Îü.�K×þ˜ÿ¥ÿÀèöŒQª¼£Löƒ³×¾qñÀG™OóÞŸÛoÌ$fq ùç'„ëÝÀendstream -endobj -4627 0 obj << -/Type /Page -/Contents 4628 0 R -/Resources 4626 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4575 0 R -/Annots [ 4630 0 R 4631 0 R 4632 0 R 4633 0 R 4634 0 R 4635 0 R 4636 0 R 4637 0 R 4638 0 R 4639 0 R 4640 0 R 4641 0 R 4642 0 R 4643 0 R 4644 0 R 4645 0 R 4646 0 R 4647 0 R 4648 0 R ] ->> endobj -4630 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 702.9085 195.9522 713.8125] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga05a3dde2048480fa3ab2a5961898d18) >> ->> endobj -4631 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 689.9571 138.5977 700.861] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4632 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 689.9571 170.976 700.861] -/Subtype /Link -/A << /S /GoTo /D (a00150_g12a33f0c09711167bdf3dd7d7cf8c5a1) >> ->> endobj -4633 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 651.1028 138.5977 662.0067] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4634 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 651.1028 174.8513 662.0067] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5b5615dc240daed20949c0fded2b4679) >> ->> endobj -4635 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 638.1514 133.6164 649.0553] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4636 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 638.1514 172.6397 649.0553] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb4ef6b00924990e7a293f66715b6d1d1) >> ->> endobj -4637 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 625.1999 152.9837 636.1039] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4638 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 625.1999 200.0271 636.1039] -/Subtype /Link -/A << /S /GoTo /D (a00150_g788ffac72342f6172343d7f8099cbe1a) >> ->> endobj -4639 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 586.3456 152.9837 597.2496] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4640 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.4818 586.3456 196.4305 597.2496] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf703683056d2bfa5c81fa157dcb20fe2) >> ->> endobj -4641 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 573.3942 138.5977 584.2981] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4642 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 573.3942 200.3154 584.2981] -/Subtype /Link -/A << /S /GoTo /D (a00150_g236d5c7872f59c8fe7b701c7252b976e) >> ->> endobj -4643 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 560.4428 172.9089 571.3467] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4644 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 560.4428 239.8777 571.3467] -/Subtype /Link -/A << /S /GoTo /D (a00150_g210f227119fc972e6222c9cb452e15a9) >> ->> endobj -4645 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 521.5885 172.9089 532.4924] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4646 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.4071 521.5885 236.281 532.4924] -/Subtype /Link -/A << /S /GoTo /D (a00150_geb533744817cf6695d75293369c2248b) >> ->> endobj -4647 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 508.637 133.6164 519.541] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4648 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 508.637 177.0532 519.541] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2a0cf5d86c58fab216414ce59bf1fea1) >> ->> endobj -4629 0 obj << -/D [4627 0 R /XYZ 90 757.9346 null] ->> endobj -4626 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4651 0 obj << -/Length 1995 -/Filter /FlateDecode ->> -stream -xÚµšm�Û6€¿ûWí‡ÚÀ™á»È (Ú˶½äp@.ë~j‹@±µk#~Ù“dôúïo(‘\Ê”IånÁƲ4šÎ<e‘9†d®ñ¼ÒŒËùæ8ÃóG8ýóŒØË+¸¾ -þºž½ú‰ê¹FZR9_?t$A‚:_o]Å—+ª)+—·ïáPàA¸?øi¨ú£»óær¬NmÙîϧåïëw³×Þ¬õJ0IŒÑÍ~ýÏ·àÝ»FL+1ÿ¾`D´¦óãŒSæ¾f÷³z=ý…Á ÂÆGG8‚3Ô �Âh‹~t -Q½\Œñâ²zhw=´ÕCU/‰ZT§Me†Öë$H Ñ鄘•êY%"Vé]Õ– hkƒT5›zÿäBzXy£†#ŽY§æoU¹³Ý}¿aL�7g{²ÝÙ3>-ë7ï_¹ã¦-7ŸÑu"”@˜¨b.™FJâqFœÐ*”ŠAQaÌ@— H¡:¯X‡Úݹ~}m›`Š -FIÚ¸—±‹à„‰gm�ùmy´¡¾œ>/ ^T‡¦5!ÁÝ’"ÎÀÔÝõmäjQ ¥ yåjùóÜý=pÛÝ1â¶ ÝŽ4Jpûû-x Þ¢Íùxí-L¥Ó¡óR±ƒÁÇÚŒß�¹"Ê©¤n)y'º6ä1e ‚9pä1%{òúÓ;˰9v ›ãÍ -ÅþÔôß¶•¹vÚ›iaOu�›ƒ²ÿ8]ŽŸœ¢óCÿù¦7w,7õÙÞÖîÊÖÞW;3ùÌѧ?Ÿ�†¡šéÖÏaÒ ê©>?Öå±éñ)íçÕá0<³?µU}*Ws¯ië˦½ÔUó—x2ü,hõžlqx¸œ6]eè¾m«Í¡¬»jÚ ïo�$å}9ÏÕâši¡“TÍ…¢H^ô ™Kõ£•ùND'¿ -o™ˆ‘^ã]_H£i¥��R_¹p]œTÎp¤ÍFãpÒ­”Óðëýis¸l� …ú+ðøüÔ¢ÝW7*<ƒÒ,d_âïʶìc}o³Ù-ÍȺ' N ÕñÖj -Œ•9 •Jñg=Æþo”Џ¼Â]jZÒ¢—ÊÙ…%Sc)‡v{v#ËPFcêÊòm²œ|·H¯%ë#Ô�S —D’p™¿Ô�EPx#,Ù �Ž«@R¾âc”z?ž+ðÓÔCðÖ{\h5÷bÆÏÕS½„¦©j|WÔcÊW7ïãÅ»?0ƒ«ºJ€â÷q ZÁXÚ{ë9�ÂTrÒv}rB»¹ä ,OINÚ‡HoЯܚ8 -A~d.V*›AÁ4›'–ÏM 0•›´]Ÿ›Ðn.7ËSr“ö!ÒërSµ»�åv,5e& -†Æ9ûÂ^’1‰0 zŽñ¥Ü‹}A/ÉÕêÓÞ®¨?šuùäÖ×n��‚ææ -Ë( CM„—õ�yŸ7ì@#…µ@RV„OKF·èÔôCêÆ¢a°X{±,ÖI‹ÏXgì:¬v¿¶OÓâç?\¢‚Âä¿M¶“Ϲéõ* }†n;¶&h¤ ø¤#á¥2.ÄÚº `��mø$·x£‚‚ód"q¡tbÚx1ãŽo/]‡ëºÛ`> gR»s½© ß͹B9A…¤/²£T!©InæÅò„ -S„§ízÂC»ŸBxÚ�H¯#ü1A8ÁfŒ* /•q!Ö6™pȼ¤ŠO$<�NîÄŒ?ÿÿÇI©ÅKN,Àö‡Ãá^,Kx¨0AxÆ®#|`7OøÐøÂ3nDzƒ¾­Ç+8A‚’Žƒ—Ê8k›Ê·yâ!×Óø¥|{±ñ -¾­ÊËÁž­—\,Η¶ª¿Yr¼hnN�›˜É�(ä‹P.08 ¹•Ê3þ¬.…xÒ¨'<0:ðÐò¾“>\k è†öôX6Ÿc¼•ùyY%Cà…Òæ#]“ÙfqN&6õ¡tŠm'6ζ�ÇmXÍ+ -о ­Ð°sBdW'–ç5P˜6m×Ú�€ìÀøfÓnDzƒ®ãVM†õ’D®DÔZ©Œ±¶©Üj‰Wd¶�p‚Z'5Þp¼PA6ïÁ^›£�Ã"Eñ?½ÁÔq¯ÌCJÆÂ­«Dº€ -Cfn4/+9Wú!ŸªºlÝóm·÷þ‡;x·$bq±_µŸø5e¯©}U‹b,í‹K -ª¯~ûñït™÷$ú7ºþýçcýÆe^²‰Òsµc'endstream -endobj -4650 0 obj << -/Type /Page -/Contents 4651 0 R -/Resources 4649 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4575 0 R -/Annots [ 4654 0 R 4655 0 R 4657 0 R 4658 0 R 4659 0 R 4660 0 R 4661 0 R 4662 0 R 4663 0 R 4665 0 R 4666 0 R 4667 0 R 4668 0 R 4669 0 R ] ->> endobj -4654 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.4748 274.5352 659.6763] -/Subtype/Link/A<> ->> endobj -4655 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 579.3616 179.5632 590.2656] -/Subtype /Link -/A << /S /GoTo /D (a00203) >> ->> endobj -4657 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 504.4427 177.6109 515.3466] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4658 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 465.3492 197.5362 476.2531] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4659 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 426.2558 175.9567 437.1597] -/Subtype /Link -/A << /S /GoTo /D (a00093) >> ->> endobj -4660 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 387.1623 196.4301 398.0663] -/Subtype /Link -/A << /S /GoTo /D (a00094) >> ->> endobj -4661 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 374.0913 204.1809 384.9952] -/Subtype /Link -/A << /S /GoTo /D (a00091) >> ->> endobj -4662 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 361.0203 199.1998 371.9242] -/Subtype /Link -/A << /S /GoTo /D (a00096) >> ->> endobj -4663 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 347.9493 193.1026 358.8532] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -4665 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 264.6323 210.8161 275.5362] -/Subtype /Link -/A << /S /GoTo /D (a00144_g12b467f314489259dd718228d0827a51) >> ->> endobj -4666 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 225.5388 211.922 236.4428] -/Subtype /Link -/A << /S /GoTo /D (a00144_g20bc87e5c063c3f4b01547be6e5a0148) >> ->> endobj -4667 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 186.4454 202.5074 197.3493] -/Subtype /Link -/A << /S /GoTo /D (a00144_g41d37ea1e3bd24f7b51e9409aceaaa80) >> ->> endobj -4668 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 147.3519 209.7101 158.2559] -/Subtype /Link -/A << /S /GoTo /D (a00144_geb79c914cf137e6d27fd7583e5a66679) >> ->> endobj -4669 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 108.2585 203.6134 119.1624] -/Subtype /Link -/A << /S /GoTo /D (a00144_gd8e8bc9bc0e2ea4a24a8a024fd3a7f7c) >> ->> endobj -4652 0 obj << -/D [4650 0 R /XYZ 90 757.9346 null] ->> endobj -1114 0 obj << -/D [4650 0 R /XYZ 90 739.9346 null] ->> endobj -382 0 obj << -/D [4650 0 R /XYZ 90 739.9346 null] ->> endobj -4653 0 obj << -/D [4650 0 R /XYZ 90 716.6946 null] ->> endobj -4656 0 obj << -/D [4650 0 R /XYZ 90 523.5122 null] ->> endobj -4664 0 obj << -/D [4650 0 R /XYZ 90 283.7018 null] ->> endobj -4649 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4673 0 obj << -/Length 2412 -/Filter /FlateDecode ->> -stream -xÚ½[]�Û6}Ÿ_áb_l`‡á7©‹b·iŠ»Øl:}Jƒ@ck&B=’k˓Ϳ_ÒiJ´.™Ö]�Çöñ=—Wç\’¢MØü#‹/”P¨`\.ÖO7xñh^þñ† oßš÷oCÀ?în^¼¢Å¢@…¤rq÷pŠ ”ÐÅÝæýR#Z¬n©ÀËc½{aþ£OýÓWõ¶êÿzW=TûÑ˪YÛ—´¢jI´X}¸{sóÃ�g’LËýÛÍûx±1I¾¹ÁˆZ,>›'‘¢ ‹§N™{²½ùéæ?>NÿÆé—ÆÈ±@šéÅ-Uý¨P& -IÍ#EZ21_4 Ä=c_4�`‰8Ó|áa¶t¿PÕ€`ó)*Ø" gåP)^ÂQ�¥óþeSý‚1mªˆœKd® ™�Û·ö�æ]˜†Ã§ÒˆâÚ4ŒV>>V]SuOåá×i.Ô Q“BÃ…ð¨Dq´ÓÀ—›ÍÞ<’øBôW^aЍ Vɾ ѧ,^h“…ä§:Ðae³p0›Å�U×û¤û4f( šËIĸn¬Æß­\©´ÑfB·(©Ús0@³ £SlÀ˜ÖkH›¡V0�IL§ÔºÙ»(m²¥L‚ãv˜vÉÉ’¦” ÅŠîûþÙt[×{ŸËm]Þ»ƒ`;æúaòÖÙFu39³×§ÜíΤ÷ö˜áø`Ï’R‹³ÙEÚL}×hÔLT–jÔ–tU°U‚×ùjÄ›6Ö˜<ÃY‰4¢¸~­s:õœ±5ecÄØ,†G%²ˆ£å¸ŒI³w(Tæ D.ó°|—™)í¶}¸½7³ÚÔhvýÂäñt¾ÖtgÄÙ;g;~*ÝYÝ~_?»ÕP;õÖy5ï !aú:ÛÆMTI ¨´�Îá ÿ€¤Þ>i†{Bæó€9L£ú›ðÛöP]$i¦rÏ`H¸ê´TYtYm·éª~«Ý¯.Z¿u·NL¥b ]žÌ+›cD0#WYYPªe…LIÛÁÒÚBâ†y½ºCÞ y�Èsô §Å ¾3ËÃhã+L½8ITÁ¡RôQ´Ü;�öûL³Ü6 !µ;˜Í╽ÝX»·Y�»Ð‡üÖ=YqßWUãïeº;‰Ïu{<¸ ±+úéÉçÚì&ÃgŠ"Y0=ÿ¬<>Q‚8n¨ƒ¹ÆÃ�Ø…à—¯Fð…ê•È!Žfs˜o˜ NùuNñˆÖHH’:²ö°d“M"ÁëšÄˆ7Ý$ÆäM"‘F׉c_ºòÒ:®@ÌlsUp¨}-g2$Š!•»Œ À@{p¨þ̺yv/øë¸}¸»b¾9̵„sÓÈhi*Ùxì@oàðð£¨Y��$µ½fñe87‚ˆb�mÁü7Kmy�µáÒš¦Ö–n A@¨-À¼¾-„¼maDžÓà4¢¸Á!f0 Fßcfq‡)\ �J$GËjL LenwÐP{p0›ÁëÃ×.æ�0¿›åfu®®4‚(æÉ)ÐÁÒZBZ‡y½ÖCÞ ­�Ès´§ÅuZ79P±ü|º!{á[óìÔ¸ÀJ8T*…(ZŽÒ ‰×y:?c• PãÍiÖú •Ïe½µ:ß]ú]A„«‹�›)äúÉßIà÷'Áï%*”Yô¿[’ètÕTû²›Þÿ—ûã�ñqxBèðˆ¿¥ì[Šûgc9|KÁ*Ä}Sáøzð·ÙX�¿‰ð²ýï—ÇøDv©>ÿK¦~cendstream -endobj -4672 0 obj << -/Type /Page -/Contents 4673 0 R -/Resources 4671 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4575 0 R -/Annots [ 4675 0 R 4676 0 R 4677 0 R 4678 0 R 4679 0 R 4680 0 R 4681 0 R 4682 0 R 4683 0 R 4684 0 R 4685 0 R 4686 0 R 4687 0 R 4688 0 R 4689 0 R 4690 0 R 4691 0 R 4692 0 R 4693 0 R 4694 0 R 4695 0 R ] ->> endobj -4675 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 713.9553 210.8161 724.8593] -/Subtype /Link -/A << /S /GoTo /D (a00144_g5323320b7316647042016f17c4e881be) >> ->> endobj -4676 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 675.2769 185.9198 686.1808] -/Subtype /Link -/A << /S /GoTo /D (a00146_ga4360412ee9350fba725f98a137169fe) >> ->> endobj -4677 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 636.5984 198.084 647.5023] -/Subtype /Link -/A << /S /GoTo /D (a00146_g1024f8a5fa65e82bf848b2e6590d9628) >> ->> endobj -4678 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 597.9199 213.1775 608.8238] -/Subtype /Link -/A << /S /GoTo /D (a00146_gfd5ebb56a1bd1da9878aa886a2075e80) >> ->> endobj -4679 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [242.9955 597.9199 285.9441 608.8238] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf703683056d2bfa5c81fa157dcb20fe2) >> ->> endobj -4680 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 585.0564 222.4327 595.9603] -/Subtype /Link -/A << /S /GoTo /D (a00146_gbaf0bb2b6a4424b4eb69e45e457c2583) >> ->> endobj -4681 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 546.3779 205.2871 557.2818] -/Subtype /Link -/A << /S /GoTo /D (a00146_gf20aaf4292cb0d2a1b10bc0a568b51fa) >> ->> endobj -4682 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 507.6994 218.0093 518.6033] -/Subtype /Link -/A << /S /GoTo /D (a00146_g2c64c8c36bc84f9336f6a2184ea51883) >> ->> endobj -4683 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 469.0209 242.358 479.9248] -/Subtype /Link -/A << /S /GoTo /D (a00146_gf5c2ad5acf3cc23b8262e9ba6a15136b) >> ->> endobj -4684 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 430.3424 211.932 441.2463] -/Subtype /Link -/A << /S /GoTo /D (a00147_gef14e83c046e19ab9fe9d1bbcca276c2) >> ->> endobj -4685 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 417.4789 194.2086 428.3828] -/Subtype /Link -/A << /S /GoTo /D (a00147_g1a1bc437c09ddef238abab41d77c3177) >> ->> endobj -4686 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 378.8004 207.3095 389.7043] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8411c95a4d89367ad2d9d6bde1a3d537) >> ->> endobj -4687 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 340.1219 185.9097 351.0258] -/Subtype /Link -/A << /S /GoTo /D (a00147_g61db1dcb7c760e4dd5d60bf4e5576dca) >> ->> endobj -4688 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 301.4434 185.9099 312.3474] -/Subtype /Link -/A << /S /GoTo /D (a00147_g88d2ccf7cd821f89d9a8df7e3948b56c) >> ->> endobj -4689 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 262.765 182.0444 273.6689] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -4690 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 224.0865 196.4303 234.9904] -/Subtype /Link -/A << /S /GoTo /D (a00147_g64a238a5c02640a7a4aef004163aeb47) >> ->> endobj -4691 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [371.6975 209.5536 410.5505 219.4589] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -4692 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 185.408 190.333 196.3119] -/Subtype /Link -/A << /S /GoTo /D (a00147_g81ac47cee1c18f6aa479044069db7ca3) >> ->> endobj -4693 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [377.83 170.8751 416.683 180.7804] -/Subtype /Link -/A << /S /GoTo /D (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) >> ->> endobj -4694 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 146.7295 224.0965 157.6334] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga9de254b8aa308eb4aab17efdde622d2) >> ->> endobj -4695 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 108.051 198.383 118.9549] -/Subtype /Link -/A << /S /GoTo /D (a00147_g26a14b8dae3f861830af9e7cf1e03725) >> ->> endobj -4674 0 obj << -/D [4672 0 R /XYZ 90 757.9346 null] ->> endobj -4671 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4698 0 obj << -/Length 2146 -/Filter /FlateDecode ->> -stream -xÚ­›]oÛÆ†ïý+ôFê=ûýÑ›mN{ @NãsÕ…"ÑŠIt%*ŽûëÏ®È]/µÒ̶Ç+ëåÌpô¼ä.I± õÿØÄщQ†8!õd¾¹¡“¥ÿó�7lxûο— ¾»¿ù×ÜMqšëÉýÃ1‚fDqÆ'÷‹_¦ÌêÛ;î¸0ÓÃë·~¨è”Ú~X­›~ôª�6Ͷ›u«v{ûÛý››ß§´CUJh’þyóËot²ðÕ½¹¡D8«&Oþ%Ì9>ÙÜH.â‹õÍ»›ÿ¦8ýÇ Î휤ŠXa'wÜô»“‰ -13„iîsâ8—»å…TQóÒ-‘u‹QM¤°r’d¡g¿r®N{À¨ßŠ+1É–UE–—Iâ¨Öã¼_-š_)åÛ¦H.51ܰ“äá­ÝrÐüœ—õXEÜPÆaõøûlþñ–Ñi³(J±# Ò‡¨Â -(¢ûïGþ‡•ŸAÿ¡Ê ÚÁ€ â»\}¬@щõhy¬€;B�³/ACÿ™í{_<în½sš[¦¦ŸVía¿~îÿ¾÷^éG‹Y7ëGï›fÛ�fó[N§·íÓºY,ûF~{io´c„û7hçiׯ®´EhO2”ö< @;’7Ò>Ê‹Ó>N^A;RF7Ò>o·ÛfÞ•´s*‰åÖÂ}H*¤€2Z íZ "¤¨ƒ=¬GÕõîÃp.ºNÇ×öÝ)á©c—±VœxÖØu¸ŽHÍÆu”á\g!®á¼‰ëAYm—Þ¾K§”Ãë·—ÉV–H&ÕUæÜR*"�ÙQ†“�„Ȇó&²ó¼d�’×� —QÄ�d¯¶«n5[oöûò≠~ÚŒ4"©� -ÊhU| J”qª’ïL ñe¡‚›îð¡#ý‹Íìóê°‰ o%�.7éÚá~õ×°MØ�ŸÞ½;îJ?‡y8µÍa×üãÆ/>"÷ž9¢9Õ×ñ‡w€vNbþˆ2ÜY@ÈpÞä�Ì"ó³tÒ8½ŸÖ_ba)±\›«FhãÑTØò6ÉPÃäà y£aFyqÃŒ“W)£ˆ sX„¦=NrÃEM~~ꉗnHR!•”Ñ¢0 ‡”'À1Sé¡L y(ÊB?û@§Ÿâ¬h¸Õô¿Woë™–œPÁ¯sƒIø2cc:Êp¦³€ÓpÞÄtž·‚éQò¦á2Џ9ÓïWÛ3÷—xøÔ‘6$’¿Œ–“üuœcï:jßKæ°û‘ êL Ae¡ ïB#šÇËáA·nçqZöâ2ñ~ªÈ…uW!ž‡‹Ì`$J| ɉåʼn'¯ )£ˆ›ïOÎg‰×ܯNÁ6$’¿Œ‰_7à¡›¿ˆ ¢ò‚\ Pžd¡ˆwÍ%Ê�O øƒú²¿¼³Oø}áËîC_qrõ$R^ç2Wá#�º"ÊpWd!WÀy“+ò¼®%¯q\F7-–g‹Åî Y‡4!ª°ìE´è‰cn?ÉÎá%ÍÆ,ól,@# ¿è ®ÖH™2R”…Ê¿o·ûnw˜ Ç@|˜í¸SÁ ûáBÓƒßG5m[=´‡]¼ Ô5ûËæàŠhu�§ü{þówØS8I†›# ™Λ̑ç­0Ç(y�9à2Џ/æÐgÝá$±&|D`¢ -K_DûRwdc™�U6ÖÙØ@nòs$bYå¢<^Š*ÐJŸt•™šÕòð-Ówïã]‰§ö¸Ñâ²»˜ÕÄ*s{1ãlBaOG$j¯< `/$o´×(/n¯qò -{!eqÇçžßçíc˜|<—‹j?E—~òv#©�2ÊhÑf‹fß vØïæ ”G˜óÊg„r5d‡(ëýðø\yVIK‘mö Äõe HK¨×y>ˆ åÛ‹Ý„‹*Ü/á þÁ¤ ÿ,iýyæøÁN£ž¢¿y,©G˜[�Dpú"V~f�>@ê9%œÛÊg†r5D}”õÔogÃ�äží§ö"ÏÀ”)�ÁµW!Úi"¤Åž¤ˆ*”è,@4œ4�'ʼne® ®á4ê Ñ›Ùþã9ª…ðÇ®Á6$\Bë"Õ_Ç‹úû�çß"aÞæìE.êS2­Ì}ÁäH’ Wò»ˆn¢‰3†½Þ¾©<•Òß©Ø6»Yz4..¶Šƒ7a�~^0>ü¦ßpñ ¾IÃ)¦P·ÜO˜véæõÉWnâmíWíççeS|ÕF1q®Kÿ`¶0ðendstream -endobj -4697 0 obj << -/Type /Page -/Contents 4698 0 R -/Resources 4696 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4575 0 R -/Annots [ 4700 0 R 4701 0 R 4702 0 R 4703 0 R 4704 0 R 4705 0 R 4706 0 R 4707 0 R 4708 0 R 4709 0 R 4710 0 R 4711 0 R 4712 0 R 4713 0 R 4714 0 R 4715 0 R 4716 0 R ] ->> endobj -4700 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 713.8976 188.5699 724.8016] -/Subtype /Link -/A << /S /GoTo /D (a00147_gde6634974418e3240c212b9b16864368) >> ->> endobj -4701 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 675.1037 205.825 686.0076] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdb971fb1525d0c5002f52125b05f3218) >> ->> endobj -4702 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 636.3098 190.8911 647.2137] -/Subtype /Link -/A << /S /GoTo /D (a00147_gef6c4140c632b6a406779342cf3b6eb6) >> ->> endobj -4703 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 597.5159 195.3145 608.4198] -/Subtype /Link -/A << /S /GoTo /D (a00147_gfbd5fc486dfdf6bf6fc9db52b1f418c4) >> ->> endobj -4704 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 558.7219 200.8635 569.6259] -/Subtype /Link -/A << /S /GoTo /D (a00147_g7b2ac4b18bd2ac3912fe67b3b17158c3) >> ->> endobj -4705 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 519.928 191.2995 530.832] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga8933ad15a2e2947dae4a5cff50e6007) >> ->> endobj -4706 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 481.1341 180.9385 492.0381] -/Subtype /Link -/A << /S /GoTo /D (a00147_g58bb90796c1cdad3aac2ecf44d87b20e) >> ->> endobj -4707 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 442.3402 204.1906 453.2441] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga87feebc7cffd4d8300e776cf64e4fec) >> ->> endobj -4708 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 403.5463 180.9384 414.4502] -/Subtype /Link -/A << /S /GoTo /D (a00147_gb5fecbc62edd128012cea0f47b57ab9f) >> ->> endobj -4709 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 364.7524 214.9411 375.6563] -/Subtype /Link -/A << /S /GoTo /D (a00147_gf2dbaceb10c67783a115075b5b6d66df) >> ->> endobj -4710 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 325.9585 203.0756 336.8624] -/Subtype /Link -/A << /S /GoTo /D (a00147_ga20812098a4663c8a9fc4ce8e95391b6) >> ->> endobj -4711 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 287.1645 203.6235 298.0685] -/Subtype /Link -/A << /S /GoTo /D (a00147_ge5ab69d40013e6cf86ef1763c95d920e) >> ->> endobj -4712 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 248.3706 190.8912 259.2745] -/Subtype /Link -/A << /S /GoTo /D (a00148_g87f0b54ade0d159fba495089128a4932) >> ->> endobj -4713 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 209.5767 195.8725 220.4806] -/Subtype /Link -/A << /S /GoTo /D (a00148_g53fbda0e8c31d4882294c8dc3cb5f487) >> ->> endobj -4714 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 170.7828 215.1402 181.6867] -/Subtype /Link -/A << /S /GoTo /D (a00148_g769512993b7b27271909d6daa4748b60) >> ->> endobj -4715 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 131.9889 213.028 142.8928] -/Subtype /Link -/A << /S /GoTo /D (a00148_g210e629f7252e4bc8458cbdf260b3318) >> ->> endobj -4716 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 93.195 234.0589 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00148_g6b16e0bac41821c1fbe0c267071642f0) >> ->> endobj -4699 0 obj << -/D [4697 0 R /XYZ 90 757.9346 null] ->> endobj -4696 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4719 0 obj << -/Length 3007 -/Filter /FlateDecode ->> -stream -xÚ­œÛr7†ïõ¬Ú²j�à|È�-ÉŽë‘Þìn’RÉe©b“ŽHÅñ>ýäl3 ”K•ŠEi~õßì¯1€3b#êÿc#GGFâ„Ô£›OtôÁÿøÍë¿ðÇ_@Á«ÙÁw¯¹9â4×£ÙÝ&‚fDqÆG³Û_Ç–p7yÁ?=|þÎÿOî·ß¾~ø8ß¾ºœßÍ'ÌŽç‹›ð#k¸3k&¿Ï~<8ž%÷.9%4 Þüú;Ýú$< D8«F_ü7”0çøèÓ�ä"~óñ`zðsг=°ù…¾÷(©"VØÑ n¶ï -ˆ -1£†0Í}U¸¯�á©(ŠŽ¬ÿu-CQ˜?H�³£¨ -•9\~ú|ý8fÜÕaýe¹}qr±ýz}{»=¾ZÍWÛ}yXwõ[Ìן®W¬È~™bJ†yS&ž—>ã>/e‡¡SM¨0b]èÌ•ÂÊQ’…7øçªLÎÿWböTµSÕ|™$Žj�ûþãvþ¥|1/Ì¥&¾·Øžy8ôø¡Ó\Â4¢¾–F7¤á{ýêás`x@í'Ùò¹ÉìU"©*)”Ñ6¨¢·óÕúŸÛ–Y=Þt¯BBþ êí¡þŸ¶Þ‡j¤ù“,¤vJ²Éeù´îúÿ~žZûËò±;ìÇHw|y× ‹Åà0 ÚúS£üYƒÖ^(¤¬ †$« ß82ßú`ÈÍC%�"n>Êžs’X¡Uˆªš}-„`Žö¼âþ«æ�=ÔXÏGYÈââáfÂéø�½v|üõÏ�ÏØè7ëùsô¼d„ÓüÄòí=Ïý•\0Uëù(«÷<ˆõ<î›zú6ô|fÞÒóxEܼçùpÏ£UØõoÇ+-ˆ¤ùÉãÛ;^Q"¹2µŽ�²zǃ€XÇ㾩ã¡oCÇgæ-�§QÄÍ;^wœiÂ|“äù°>î>s­¶²7Ü�ãeuî˜#àŽû&îз�{fÞÂO£ˆ¹ŸÿÒÀ\m`ñ†¶p7ªJ.œYbvy*¼¹ðMäøðÜ -0äQVGŽ9ä¸oB}�gæ-Èñ4Џùåñ¿OOfdªˆóLð"$UÅ�Së‹KÜeeN‰aÈåywcÜ©êˆ;@5M€�i_èÜ‚Ía?j„{qþöm¹Hó—U-5þ棨bìa -róágW?W3’‰a°@€‘�²:Z̰Å}\èÛ@73oÁ‹§QÄ�€ßžO�KÂŽêt¥QU1ç”ùù¹9Ó=”…_±­†?E‡„r’U)£Ž;ÊßH9ó­SÎÍ(WÒ(â¦éØ«óˉ¦ãžÓ4õïP(¼IUI€SA$óÓ®,Ñw5–cÝðÕ -0ÒQV'�9Ò¸o" }Hgæ-¤ñ4Џi<ŸŸ�ÎŽ� -ÒÜj™Æë�T•¸ DÎótßYøE›e’ “Œt”ÕIcŽ€4î›HCßÒ™y i<�"n$=;9=>:Wiæˆ1~Š„–!©*þœóð©Ô^ùï»F µ¹H“Œt”ÕIcŽ€4î›HCßÒ™y i<�"n$]]Q…É–sá,ŽÖ#ªj‰ø9™´á,é[E ɉݻ×+ð(«ÇpÜ7‡¾ À3óàxE\8´/KÈ–Åt¥QU1“2néËÌ{¯ÔÜký -{2`�£¬s�qßú6@ÎÌ[ ãiqáÒÊ/ž·°¼;ž–çqFãðr$U%.¥Çl÷Ê!úx3McÃ[¢P€ñ޲:oÌðÆ}oèÛÀ;3oá�§QÄ�¼ß]\M�ÏŽ6S´¶òk$æSX-’ª’WÒ7wy½“3?c÷—„á}P(À`GY6æ`ã¾ 6ôm€�™·ÀÆÓ(âBؽgqÎÑÊ2¼IUI€sM˜´6O@õ€æÎ/á”Þƒt’UA£Ž;Ðß:ó­ƒÎÍ@WÒ(âfû'åbË—KQ®ñ"$UÅ=ì~ú‰›ÈÝiecˆC&àà8ƸSÕ#v€0jšÓ¾Ð¹/šÃ~ÔwúŸ³«ËÃõ¬¥)’j´I„›‡–Ldæ}“m®¡Ô_—¡£eu¼˜#à‹û&Àз�pfÞ‚O£ˆ !ûërÏ:ÚeÃË�TÿÐ T3“û÷Í·¹â„ ->|I†Œs”Õ9cŽ€3î›8CßΙy g<�"n䦨añüêíÉô‡žS¶a—šáÕHªJ\hâÏÖ6O£oºÍ…#Téá�P(ÀpGY7æpã¾ 7ômÀ�™·àÆÓ(âFܯOή~™0NÇ/OfW¬o¦”Õx5’ª’F˜‡QéDžFß„{£´lx7 -0ÜQVÇ�9ܸo }pgæ-¸ñ4Џý¸ù0n¬7šÆ7L£wÚÍaT l î(«ãÆnÜ7ᆾ ¸3óÜxE\8í>9{S^³ÃUÊáUHªŠ}8*Ù~ú>· �1î†7B¡Ãeu̘#ÀŒû&ÌзsfÞ‚O£ˆ 7BwúÔŒX'-^Œ¤ªdÁ¹$Âú%t–EßãÔ̔ޅ„v’Ui£Ž;ÚßH;ó­ÓÎÍhWÒ(âFÚo_NgñÎÁrd[Â�Ux)’ª’C˜�›ðLm–CßgZÌHÂŒ¾^CÆ:Êê¬1GÀ÷M¬¡oë̼…5žF7�ìéÕéËéO}÷ƒ2i4^…¤ªØoî!Väö¬ïBÍtxê“o�@Æ9Êêœ1GÀ÷Mœ¡oç̼…3žF7­®·O?\\ô¬¸üeØ(mðJ$U%…Ð\‘§Ð{—“þ,Áõð^(`¬£¬Îs¬qßÄú6°ÎÌ[XãiqÓ]FÅGÕWÓ“ÿ—kmãOÓ†Wê"ÂPá™ ÿƵm|Ü–ù%:W¶öüa’…ìgñù«÷ᡬ§»Ð³wñ!“ÕÃÿº£×]?|¼~ÿ1=¬Õ)žVQ{{½¾Þ¾zXìíÚûŽú™†`#˜*B&é+ï­Œ·‹ok/Á ÑTÚ½Dö*›T{Á±Ò¿Îì÷*Š>ˆÃÂÍ&Ωgy' +ÁEmß$ÉêƒÄ1î›1ômÄ™yË ÆÓ(â¦�¥/Ã>ÿlOÝW'‡§}w“…O�ÑšDQ%.ü [;“çÒ·î4rx§lwá݉ª´¯kÔ1’ŽuÎж�2šÀ^Ìa³ÃÀ<Üh�•!JÐ$|‰ ³<«Bß5ٰ팮ÇÈs÷#~{Ïé7ÿõªMƒXÿ+Lpø'¸´?‰„Ž»ƒI„$ßÌóÇëõ<>{Þ�ÎOã‹'L�Ÿºoï¾Òï¹øžÓíw~!©»+Å„«qºZħw¡ñ‰Åí×£åß_?ÌûåQLôÕçÿ Oìendstream -endobj -4718 0 obj << -/Type /Page -/Contents 4719 0 R -/Resources 4717 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4756 0 R -/Annots [ 4721 0 R 4722 0 R 4723 0 R 4724 0 R 4725 0 R 4726 0 R 4727 0 R 4728 0 R 4729 0 R 4730 0 R 4731 0 R 4732 0 R 4733 0 R 4734 0 R 4735 0 R 4736 0 R 4737 0 R 4738 0 R 4739 0 R 4740 0 R 4741 0 R 4742 0 R 4743 0 R 4744 0 R 4745 0 R 4746 0 R 4747 0 R 4748 0 R 4749 0 R 4750 0 R 4751 0 R 4752 0 R 4753 0 R 4754 0 R 4755 0 R ] ->> endobj -4721 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 702.8842 216.9034 713.7882] -/Subtype /Link -/A << /S /GoTo /D (a00148_g969d7fff37a979737da045e0d538a9bd) >> ->> endobj -4722 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 663.9813 195.8725 674.8853] -/Subtype /Link -/A << /S /GoTo /D (a00148_g22fa0681cd463191d7a01fe85d86996f) >> ->> endobj -4723 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 625.0784 195.8725 635.9824] -/Subtype /Link -/A << /S /GoTo /D (a00148_gffcd2fbe181e2aaefbf970551c302af5) >> ->> endobj -4724 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 586.1755 195.8725 597.0795] -/Subtype /Link -/A << /S /GoTo /D (a00148_ge23534479ead15af8ff08ace26a47fb5) >> ->> endobj -4725 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 547.2726 195.8725 558.1766] -/Subtype /Link -/A << /S /GoTo /D (a00148_g165b603ec150e26efec7be199c9c2901) >> ->> endobj -4726 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 508.7434 180.7494 519.2737] -/Subtype /Link -/A << /S /GoTo /D (a00148_g69a7a4951ff21b302267532c21ee78fc) >> ->> endobj -4727 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 471.5241 169.3122 480.3708] -/Subtype /Link -/A << /S /GoTo /D (a00148_g118e9d76568ab81ad97f138d4ea1ddd2) >> ->> endobj -4728 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 457.4674 214.6224 467.3951] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6bfa488f87f68a6f7f4a3efb9e45eaf8) >> ->> endobj -4729 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 444.4916 216.6746 454.4193] -/Subtype /Link -/A << /S /GoTo /D (a00150_g39ce739bd352d7e348e37395ce903e43) >> ->> endobj -4730 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 431.5159 206.9409 441.4436] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf848ce44c810492e7a35c2d23a429f45) >> ->> endobj -4731 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 418.5402 193.6609 428.4679] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf0ed78fd2be24d849cdd5af75e3b2674) >> ->> endobj -4732 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 405.5645 200.3059 415.4921] -/Subtype /Link -/A << /S /GoTo /D (a00150_g57e6dc1d58a36d0ed53a3dd29ccc5798) >> ->> endobj -4733 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 392.5887 201.9198 402.5164] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga4c4310e54f18541b09e1e251fe7b22d) >> ->> endobj -4734 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 379.613 229.0778 389.5407] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf84316f469ce0726985c0702db49a989) >> ->> endobj -4735 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 366.6373 220.769 376.5649] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2d3ba4b14d6d2f6576f9b547800b7945) >> ->> endobj -4736 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 353.6615 193.9898 363.5892] -/Subtype /Link -/A << /S /GoTo /D (a00150_gabc40c09f49d15acb1b1a7f02bb3a807) >> ->> endobj -4737 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 340.6858 199.7479 350.6135] -/Subtype /Link -/A << /S /GoTo /D (a00150_g041aea91aa6ef84dcc6cac3c51db9b2f) >> ->> endobj -4738 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 327.1074 243.3742 337.6377] -/Subtype /Link -/A << /S /GoTo /D (a00150_gd605357e29affb0d3104294c90f09905) >> ->> endobj -4739 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 314.7343 252.8785 324.662] -/Subtype /Link -/A << /S /GoTo /D (a00150_g5c97ae587595b5444be80f5ecc1d3382) >> ->> endobj -4740 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 301.7586 224.6544 311.6863] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf0ccbc3bb2a3ba1ebc255c7b3fcedd24) >> ->> endobj -4741 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 288.7829 207.4989 298.7106] -/Subtype /Link -/A << /S /GoTo /D (a00150_g28eda870cff3d8e3cf2949e6f57a502b) >> ->> endobj -4742 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 275.8072 221.3369 285.7348] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga5e3c856b86725125d19fccc34cd9eb5) >> ->> endobj -4743 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 262.8314 218.5673 272.7591] -/Subtype /Link -/A << /S /GoTo /D (a00150_g8af482dec973db57d8b3bd3f69461488) >> ->> endobj -4744 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 249.8557 234.7964 259.7834] -/Subtype /Link -/A << /S /GoTo /D (a00150_gae59b70658f28ee6e998eaaab05e423f) >> ->> endobj -4745 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 236.8799 224.5549 246.8076] -/Subtype /Link -/A << /S /GoTo /D (a00150_ga533c394b1fa0030205534befa31c525) >> ->> endobj -4746 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 223.9042 224.5549 233.8319] -/Subtype /Link -/A << /S /GoTo /D (a00150_g160128ab5d2ea3cc497b91ee4eb4ef99) >> ->> endobj -4747 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 210.9285 211.9222 220.8562] -/Subtype /Link -/A << /S /GoTo /D (a00150_g64d9affc680a445d708234e70450477b) >> ->> endobj -4748 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 197.9528 222.8911 207.8804] -/Subtype /Link -/A << /S /GoTo /D (a00150_gfff0ed43201bf1e2020de1a0d6cac070) >> ->> endobj -4749 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 184.977 219.2748 194.9047] -/Subtype /Link -/A << /S /GoTo /D (a00150_gd135fb0cfdfb2c212f0f51865a3640e4) >> ->> endobj -4750 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 172.0013 214.1439 181.929] -/Subtype /Link -/A << /S /GoTo /D (a00150_g13dfcb4a5f920e108253ade527a66cc2) >> ->> endobj -4751 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 159.0256 211.7529 168.9532] -/Subtype /Link -/A << /S /GoTo /D (a00150_gde29ec025e6754afd8cc24c954a8dec8) >> ->> endobj -4752 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 146.0498 238.2734 155.9775] -/Subtype /Link -/A << /S /GoTo /D (a00150_ge0825474feee11b4e038bfe71757875f) >> ->> endobj -4753 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [289.3868 130.4285 318.6011 140.3338] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4754 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 107.1469 229.7753 117.0746] -/Subtype /Link -/A << /S /GoTo /D (a00150_g359951eecd80541c2101f628a9da9146) >> ->> endobj -4755 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 94.1712 223.6882 104.0989] -/Subtype /Link -/A << /S /GoTo /D (a00150_g517c770991459cc62dc009c0d3875c6a) >> ->> endobj -4720 0 obj << -/D [4718 0 R /XYZ 90 757.9346 null] ->> endobj -4717 0 obj << -/Font << /F29 499 0 R /F50 1172 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4759 0 obj << -/Length 3015 -/Filter /FlateDecode ->> -stream -xÚµ\Ûr7}×W°j_¤Z‹û%�klj]›�ÖQž—‹)‹‰T(ÊŽ÷ë·13€€¹t�cm¹J$Í3}}C7f$±àðO,_8ãXPÚ..oOøâ#ü÷'¢ûz ß/KÀ?/NþñR†E`ÁJ»¸¸j$XÁŒrq±~{*¼?[Ê •;}xuo ?Œ·o^no6í»ûˇÛÍî¸:n÷»³w¯O¾¿È´�VFYIÿ8yûŽ/Ö ÝëÎTðfñ>p&B�‹Û-UúpsòËɲœö‹æ‚±Åů—ÒµK™\½„µ:ù¸xU,^pË´òz‘PÑ¿Iiú+¾—F- -qº "H…f�[[‘þm½ù�s¹Û ˜µeN:Q3Ço;È›R‡'tèK�:üúêüýù›3ÍOŽ?.΄?ýùý¯/Îû:I©™ÒÆ£ÖÈ \)-óÊšJáÆBJ8Æ¥ÖÓ®.˜¯Œv6ÆXxçÍî.ygø»"Ÿãp\��Üi—¿zþÓ¹8])æ,'¬’Q„:RY&MOãÇÜÎ5ãÎúi·Ìí F»c,ÜŽóf·—¼3Ü^‘Ïq;®Æ@nrû«óßÿëûÜÌ=ÆjÜ -EÐKÁ™Õ}zÉGülƒ`6žI?—ÄÏFúe|ô3Á›ü\ñÒ~®Égø™Pc 7ùê÷¸£E`P£n†Œ"ø¥ÌADÔücùl„ŽÓ;v Àüœ`´Ÿ1ÆÂÏ8oösÉ;ÃÏù?ãj ä&?_<Ÿò3tbNÜ EðKÉ·ÂÕüã m “J‹iGÌÑ F;c,�ófG—¼3]‘Ïq4®Æ@îcážLié�>A ‘Q„Rq ){à†We¥þÞ¾û -àÄXPɤ·f:( - FÆXΛƒ¢ä�ùœ ÀÕÈ} ŠÉü‡[KçqCd¡A ž è‚"ëð•A¡Sʇé (XP$c8oŠ’wFPTäs‚Wc ·Øàç�hP`†(‚Õà1(úÔaÙ=Á‚12^·ª»p©4ì&Ê5^œ9}úån³Þ\Ý�D‹ñ’é€ì+%‰– #£e|Œ‚7EKÅ{l×9ŒǤ3=f$TZ8¥B_jÔàAØ÷Ç¿�W�.=~Ã-¼%”s´\“Ú%\­ÞöîýöN¯ÖëÃPÍxªºdjÃS3ˆž‡™´â+ß ãÂ1aåÂXè™L5�DG‹]à†Ùðľ…*.]˜Ž¢¹;Td~³¹;œ)wº¹¿ÏmMAÝ_µ¯«îs:¦‹6ê.`“:ËL0WºÓYH´›îÔ�Vqº£öê £­ˆ%Λ­ä¥­bž‘h¸ -}©3 Yú×'®]N´J½&Ñ,•h˜‡ŠDCȉVò¿õïÆŠ=@mÓ­A Àb0ÁèÄ‹Äys –¼T VÌ3bW¡/•®¦\1á`ÖÇLÐÄ¢#cQrÃ`n°”–7¢æ„–±‚y-qGeÔÕƒ@ éØXð"õˇÝe,µc�‡v -âvzv)¾GB1¡ÈHÄè'MqX’~:“°‰l×bh‚¦&žŽÃ'TèKÍÞmGÊ¡0„ ºö"ˆ­gš›š8N*iýcÓHÚ'µñ-ǬͽD#»{†5&HÛv´Ãvu³ýo±Å_uQ8¹�kÈî`ì“lãZƹ§î›d¸…@,rqÞº%/»÷œàŵÈMá{¿9nïFq�‰#5BBQô^0c·6>ñ€×G€³ �ð¤}¹“½Œ„Ø´ÆEtéEÇ[ÂûÞÒ‰¬mN'½š™µËÚ{‚¬…؇ø×O’¶ -¶-auß+ÃÈ´-"iK𦴭xÉ´­¹g¤-¡Å@nJÛ›íýq³f­fR(KØ ¡(vg™ãÐ|Ô¶ÍZˆ-)Üìõ'<¥Á@.’µ’9ØRñ¥gAû9ÈðÞÒïö‡#–· -ÊœŒêÎÊÛ�äm†E ~9®Ç6KÛØî>¶�ûîõº{´åþns¹�Gx›uûQûÉ”VŽ3i¥š”6Ž)a¨[œF§t!Kiœ7§tÉK§tÅ='¥q-rSJ?ì&’Úk˜g¢�P+$Åï-L*6ô¬?šÔp•×z¶žÔ /w:©!Ò¬ ÄÒ3Š –Â@üÆ”*‰É¤Ö’)G5å¤nÑ’Jêk“z÷Éi%˜V=MN C¬wTN'�Ó…À>#¤ˆŠ>)JMi—3¿Ô.æÜå~7Ì7cµwÕp™QCn¡Kn£™v^ô,½èphŒã<=ÞéÕ'<µú�Ürõ›Ë‘¬ëžvA �Q=tL(çú) ˆâyÆLd<©A_.y8c¡@8 $Òæ­6ã!ÐS¶ } shŒÏ´=ë머‡…Û¹ÖÊxÂZC¹“åYÅÐ`ˆLÉ(ŠX)¦|�—¬Î\1#½�Y� 4V�,jð¼K’ª"¯Ú—ö>ÅíþØÕçëý}|¸ÏUüâùù™Pæt²NË ™�YòIê´„‘ÜB¿HÔé #ët)é½ÞT�+^²÷ª¹gô^„¹�§ »‘#ˆ[È[ Eq;ˆn¨‚µá¡ -BNASÚ£WC´e±eâdéPf½:®ž¥?� ›–KÒjf½œ—Jɤ„jÚœhãF�¨[wp×ëp.mR%�»= -;Ž€øcNª§¹(5gΑ§ßFçO!ð›ûB»œe¥vÍl±žèuôB:TËeF ùë^ÇA¯Ã•êYg¬×�¡Ö»�u�Ù¢ÃSÈ--°ÛœIsúyøH¸�ý™2BF*Hå™2ª"cýŽ0·ð0×Oi0�Kö;q‚=š°@Ba ƒaÜs9XÑBûht“îó¬•ñ„µ†r§ûc™·RQ´Æ3Ë…«iT¿•†y5÷i��UékËtjaîª^’GÄäi†{q>¿Ä2úpõl8—Éø»Üj®�2ž0ÐPî´�¬aF AX(¡(bëÛÛè1q$`Þ—Îõù—ÿ¨J“w.J–ÏDÃã”oNX$\¨Á²I•h´6»Íl¶®ÏŸJo^Çõ> endobj -4761 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 727.7951 225.3421 737.7228] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf72d7b9a737707dcfb2c41fec2b6792e) >> ->> endobj -4762 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 714.8475 234.7566 724.7752] -/Subtype /Link -/A << /S /GoTo /D (a00150_gad0321f4c570f9983c6de81ece3ddc20) >> ->> endobj -4763 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 701.9 209.1527 711.8276] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6bc12c6c7b56f73ce5d57abfdcdc6eb5) >> ->> endobj -4764 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 688.9524 220.2212 698.8801] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb948296aea6b6b3aa1f156799c4d479c) >> ->> endobj -4765 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 676.0048 218.5673 685.9325] -/Subtype /Link -/A << /S /GoTo /D (a00150_g17d111686f98e4c09db73a770ac3f1a4) >> ->> endobj -4766 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 662.4546 229.0778 672.9849] -/Subtype /Link -/A << /S /GoTo /D (a00150_g6f2b90c597ec23f39ec716ccec11233c) >> ->> endobj -4767 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 649.507 227.424 660.0373] -/Subtype /Link -/A << /S /GoTo /D (a00150_g15f2617f7dc1713f9d10282125c6027b) >> ->> endobj -4768 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 637.1621 227.424 647.0897] -/Subtype /Link -/A << /S /GoTo /D (a00150_gee37386b2ab828787c05227eb109def7) >> ->> endobj -4770 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 579.341 170.966 590.2449] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4771 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4642 579.341 229.3566 590.2449] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20ceef9d0868d391c2f33041b02cb1f1) >> ->> endobj -4772 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 540.4944 170.966 551.3983] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4773 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4642 540.4944 229.3566 551.3983] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9ebb4dac683163840eab9c6c41ad61f7) >> ->> endobj -4774 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.2787 527.5468 204.1712 538.4507] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20ceef9d0868d391c2f33041b02cb1f1) >> ->> endobj -4775 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.6693 527.5468 257.5805 538.4507] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4777 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 470.7019 166.9111 481.6059] -/Subtype /Link -/A << /S /GoTo /D (a00145_gc48ed5f0d27721ef62a3ed02a5ad8d2e) >> ->> endobj -4778 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 431.8554 180.1912 442.7593] -/Subtype /Link -/A << /S /GoTo /D (a00145_g22f140b02c354dfebcc7ad481c3bcd68) >> ->> endobj -4779 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [184.0068 431.8554 208.6941 442.7593] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4780 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 393.0088 175.2098 403.9127] -/Subtype /Link -/A << /S /GoTo /D (a00147_gdd1ab3704ecd4900eec61a6897d32dc8) >> ->> endobj -4781 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.0255 393.0088 203.7128 403.9127] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4782 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 354.1622 185.1725 365.0661] -/Subtype /Link -/A << /S /GoTo /D (a00147_gaa585784b0914cac1d37f07f85457008) >> ->> endobj -4783 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.9881 354.1622 213.6754 365.0661] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4784 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 315.3156 152.9837 326.2195] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4785 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 315.3156 211.6433 326.2195] -/Subtype /Link -/A << /S /GoTo /D (a00147_g8096b0c4b543dc408f4dd031ddae7240) >> ->> endobj -4786 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [215.459 315.3156 268.3701 326.2195] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4787 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [307.2043 315.3156 331.8917 326.2195] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4788 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 276.469 171.8826 287.3729] -/Subtype /Link -/A << /S /GoTo /D (a00147_g04b053a623aac7cd4195157d470661b3) >> ->> endobj -4789 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 237.6224 172.9089 248.5263] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4790 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 237.6224 236.859 248.5263] -/Subtype /Link -/A << /S /GoTo /D (a00147_g79c4110211247df3fb30b8cf1c4c02af) >> ->> endobj -4791 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [240.6746 237.6224 293.5858 248.5263] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4792 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [332.42 237.6224 357.1073 248.5263] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4793 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 199.1494 138.5977 209.6798] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4794 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 199.1494 162.6772 209.6798] -/Subtype /Link -/A << /S /GoTo /D (a00148_ga22b04cac8cf283ca12f028578bebc06) >> ->> endobj -4795 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [166.4928 199.1494 191.1801 209.6798] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4796 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 159.9292 183.4989 170.8332] -/Subtype /Link -/A << /S /GoTo /D (a00150_g266263ac78a1361a2b1d15741d3b0675) >> ->> endobj -4797 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [187.3145 159.9292 207.0205 170.8332] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4798 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 146.9817 138.5977 157.8856] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4799 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 146.9817 189.7953 157.8856] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb6683dd83fe1c8de9a24086d4b69e907) >> ->> endobj -4800 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.6109 146.9817 218.2983 157.8856] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4801 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [241.84 146.9817 266.5273 157.8856] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4802 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 108.1351 138.5977 119.039] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4803 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 108.1351 197.5461 119.039] -/Subtype /Link -/A << /S /GoTo /D (a00150_g2addf34c7d457c1a7899a7e2171ef1e9) >> ->> endobj -4760 0 obj << -/D [4758 0 R /XYZ 90 757.9346 null] ->> endobj -4769 0 obj << -/D [4758 0 R /XYZ 90 596.0036 null] ->> endobj -4776 0 obj << -/D [4758 0 R /XYZ 90 489.648 null] ->> endobj -4757 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4806 0 obj << -/Length 1902 -/Filter /FlateDecode ->> -stream -xÚÍZÛrÛ6}×WèQša`qÏc.Î$3mÓÄéC]�‡–d[[vti›¿ïB"`�ªÒCÇ£1)»{v�Ø�âZ:ÔRË…Ntx‡o¿°êq�Ï‹ðúbpvvh‰U †·Û# /¦—#CÀŽ �t´™?Ÿá‹ÜïnÏç³ÝÕçÙíl9ff4[LÜ[Fƒ1cÇWï.Âì9Éss\^ÑáI~P­‘ÿñ†f- ¸¿y|üÆÙ=Ø~`ß•Äp3,@ïV�Z`¦ S€ÿ�XÉD·ÑH�FFã‘ÑUDp#†æL÷'€lÚ€QüH>ŒlÎ(ˆ5 ׸{æÞYÞU�>ÇÜ©RYvWc·aêzÝ¢Ç5Q”‰$= ÂR�§'(¡X–žÇÕéÍŸ¯×“çÉý·Õæ±I(%VsHÒ,*C('BqÛð•ô¯1ÐÑÓ|Š×¬íÉ]èh -„j• ³ -\Äè-I‡™(±5X|jÍË ŽÉ›òa²y(וÜÖ÷ÕÅÅ›O»‹É˜ÉÑýlâØn͵}÷é¶�.wˆ1££Ùz÷Þ|Ä}}ãžnªO•‹éË“òùyZ®KÒeeaLë“HMiƒ@Å3R °¬Ôâ�–Z†�ÇÕØ¥¥–¢w°Ô2ô<®N=¼™vJ�-ÒF,<(3=J‹çºá»žBC<ÞOh1:!´K íëÛÿ�Ð$P\ô´A„ö•ž1TŸ„ªÔ+f\žÙ•úßÇFår^Þ<ÌV{Š·´’†}A—rc@B¹–Unjƃ•›açq5v³O¸@P–d×W¸\bâ¤&ËÎãêì¢Xj’T—ƒ~N:- rÓ+ƒý–lLùõçë×.È¿žùðÇ»Ÿàª+n¥¡Xb5ô‹Û�Ðn€92^|›ŸºUè­…Íê¶gelÔ©5©,‘Ôð“5)Á—ÍIÃÃòÒˆÜcÉ -•›7}<¯OÆnî³s\TœÁ ¥Ââ,»ÌMy‹ Â — ‚‰ÒUásT[ãzT9³E{j¨L[Êpbn$ -g Ñ3¯JÁˆÂ0Ìŧ‡9¦ŸÆÆu±Æ°ÛU‹§FÕÀu<Ì'åzþT•ŠíªjÅ#YaŠmN‰’â4¡�@ìWs[£Ë‡v4àñY?Í. f—î×Rôî×2ô<®Nƒþa¶h§|ü ¶:I°P@ŒëÔ xÜŽhir»–«%d¤z·¾ÿ­Rµz¦CB]`ÐÖžfo"°q5Âäö&–�õxÀ£c=ÃÎãjìœm'O‹v4Il�I†E@µç®Õ &AkXf_ýP®A¥¬1o÷ê=>·úÖ¸ÉÕ[ iŽýVrõYFs˜–î8,¹�I€õ+“Ír9æz4[¬›‡¸¼ÙÄU•n‰à>ÁŠ•ÁÑèVäR¡òyîx}$©yDÔòêè¦×·xidèí¡·jÇ/öé\@Š_@™™­FW`ÓϼíýßüúË/_®öìhBtŸAÇ€T”xX>L3'iv!PbvÉ�bŠÝÁ;Å ;�«³s}òd¡EQ+B]sœtY@å&Çl)…n˜æRtî fjMÏÃÓ�J�æ&ÅÍ SbŽdrTþ¨ÚŠÕ¬:z¹}Z6ò)‡âf^¥ÒÕìû¦újï›ÇŸ†'Õ�&×Uwv¥Œ0~¢„C˜É6 –N<àÑÂɰó¸»êôqšÕ˜fè$Ë" Úó×›�)”rްξ&Ä`e×-ët[Àãsh�›³pì?  pìq¦æƒ:®9‘íD¬ÖÕ·Ž—CÒ|ÃÁqæD –pžk8<*/ˆ—áŽ×C’Z�CD­Ÿº)ö­&;)ˆE뢸jÇ«DÏ -“âXPzvÀ·Ö²>û¶ñÀXën>8W„�ÝRãaù�IÌxx̤م ‰Ù9—¬ÖåºÝJŠ–ã�¤¸�Õ£QbÀ}±ž¡èq{)¶S­ \Ë´×´&€FÜe7n{¦7`Α¹n!ÀöŸ"ã>êÌ_;þóÕz>é.öœQlÓOTì;o Ùb`Ù@�<:P3ì<®Æ.Ù%§ØÜ%gØy\�ƨkʻվܫp³”$Y˜ -Ty¶;aö#R+“ó¬‡å= x¼gÓì‚gcvÎvóçr:]îñ°’˜2,ûf!÷U“6ËÒãZ,ïŸPÇȳUºs¥ "É#¬BåÕëBd®1 °¼�£�÷qš]ðqÌ®Ÿ�,÷qšeðq“åb¶~,WßZ.f–"I²p¥a‹Ê»X¢tÖÃ*ïà—áŽ÷o’ZpoD­Ÿw»)îÜ$ÅàÛÅér¯xÝžŸ3�"ˆî¬@¸asY\í…Qd�ëÕGýFq?Â8�~¡Ü/ÒŒÿ¡%#Ì�–¸¥½Ÿ-fËríO$üw€?û‹�îäbSÝ0¨þÓWÀ_ÝÝ¥ª:σù3�ÐÊ0Roª�·Oÿü¸k‘$Ô"ûü „¦õÓendstream -endobj -4805 0 obj << -/Type /Page -/Contents 4806 0 R -/Resources 4804 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4756 0 R -/Annots [ 4808 0 R 4809 0 R 4810 0 R 4811 0 R 4813 0 R 4814 0 R 4815 0 R 4816 0 R 4817 0 R 4818 0 R 4819 0 R 4820 0 R 4821 0 R 4822 0 R 4823 0 R 4824 0 R 4825 0 R 4826 0 R 4827 0 R 4828 0 R 4829 0 R 4830 0 R 4831 0 R 4832 0 R 4833 0 R 4834 0 R 4835 0 R 4836 0 R 4837 0 R ] ->> endobj -4808 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 713.8674 138.5977 724.7714] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4809 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 713.8674 201.9695 724.7714] -/Subtype /Link -/A << /S /GoTo /D (a00150_g85b65e38aa74eba18979156f97a94a87) >> ->> endobj -4810 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 675.0131 138.5977 685.9171] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4811 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 675.0131 204.7393 685.9171] -/Subtype /Link -/A << /S /GoTo /D (a00150_g7023a34ba9e9d03b5fbedbcb32924453) >> ->> endobj -4813 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 592.2581 133.6164 603.162] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4814 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 592.2581 166.9014 603.162] -/Subtype /Link -/A << /S /GoTo /D (a00146_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4815 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.3873 553.4038 192.0768 564.3077] -/Subtype /Link -/A << /S /GoTo /D (a00150_g561b8eda32e059d4e7397f776268cc63) >> ->> endobj -4816 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 514.5495 138.5977 525.4534] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4817 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 514.5495 170.976 525.4534] -/Subtype /Link -/A << /S /GoTo /D (a00149_g12a33f0c09711167bdf3dd7d7cf8c5a1) >> ->> endobj -4818 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 475.6952 152.9837 486.5991] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4819 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9538 475.6952 200.0271 486.5991] -/Subtype /Link -/A << /S /GoTo /D (a00150_g788ffac72342f6172343d7f8099cbe1a) >> ->> endobj -4820 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 436.8409 152.9837 447.7448] -/Subtype /Link -/A << /S /GoTo /D (a00088) >> ->> endobj -4821 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.4818 436.8409 196.4305 447.7448] -/Subtype /Link -/A << /S /GoTo /D (a00150_gf703683056d2bfa5c81fa157dcb20fe2) >> ->> endobj -4822 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 423.8895 133.6164 434.7934] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4823 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 423.8895 177.0532 434.7934] -/Subtype /Link -/A << /S /GoTo /D (a00151_g2a0cf5d86c58fab216414ce59bf1fea1) >> ->> endobj -4824 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 385.0352 172.9089 395.9391] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4825 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.8791 385.0352 239.8777 395.9391] -/Subtype /Link -/A << /S /GoTo /D (a00150_g210f227119fc972e6222c9cb452e15a9) >> ->> endobj -4826 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 346.1809 172.9089 357.0848] -/Subtype /Link -/A << /S /GoTo /D (a00095) >> ->> endobj -4827 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.4071 346.1809 236.281 357.0848] -/Subtype /Link -/A << /S /GoTo /D (a00150_geb533744817cf6695d75293369c2248b) >> ->> endobj -4828 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 333.2295 151.3294 344.1334] -/Subtype /Link -/A << /S /GoTo /D (a00093) >> ->> endobj -4829 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [151.8276 333.2295 185.3713 344.1334] -/Subtype /Link -/A << /S /GoTo /D (a00150_g9ee50a40597e67fce96541ab56c3b712) >> ->> endobj -4830 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 294.3752 133.6164 305.2791] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4831 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.1145 294.3752 172.6397 305.2791] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb4ef6b00924990e7a293f66715b6d1d1) >> ->> endobj -4832 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 281.4237 166.8215 292.3277] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4833 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 281.4237 221.3367 292.3277] -/Subtype /Link -/A << /S /GoTo /D (a00150_g7d3673f52f5846b6961d23b150decd54) >> ->> endobj -4834 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 268.4723 166.8215 279.3762] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4835 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 268.4723 220.2307 279.3762] -/Subtype /Link -/A << /S /GoTo /D (a00150_g3237be0d9ec457de0177689ee23c0d5c) >> ->> endobj -4836 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 255.5209 166.8215 266.4248] -/Subtype /Link -/A << /S /GoTo /D (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) >> ->> endobj -4837 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.3196 255.5209 213.028 266.4248] -/Subtype /Link -/A << /S /GoTo /D (a00150_g20df5c82f2a15a508c19e505b5d9de2b) >> ->> endobj -4807 0 obj << -/D [4805 0 R /XYZ 90 757.9346 null] ->> endobj -4812 0 obj << -/D [4805 0 R /XYZ 90 611.208 null] ->> endobj -4804 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4840 0 obj << -/Length 1472 -/Filter /FlateDecode ->> -stream -xÚ­X]oÛ6}÷¯º˜Y^~‰ †a[»Í0 ëòÖ…")±QÇö©[þý.%Q‘DIt‘",[‡÷^ò~@Dñ"C£XÆÄp¡¢ô~A£;üùÍš×k|¿î~»^¼¼d&2Ä(¦¢ëÛ*‚"°è:û°CWkf�—åÛwø(é­.·»¼~z}HËû|_$Åö°_}º¾Zü~ݦmXI®À&ýgñá�2dwµ „-£ñ %` ‹î‚q÷e·ø{ñW§~Q5ëœ>Þ;a®{ {×½Ó„cW€Rº,·Ç—øÿ99­@/Ó Ù ûø>¿Í«—ù>Ímëà@Œ”Up,®�ÍôSpMø×y‘`¤¬)Wþ�ž¶GW, Ä;c`ãXʦŽó:OwÉ©ªìCÝüp[&§t³-ò´(O LJcžn?RÊÒúûm¹O«†d8(Z -:ŽׄÊGKê@ë.ÊŸ4ÚJ9Æ’”P!eEû׿/‹Íát1Ì ”‘˜3˜OÞ¢F²wË4&1pù­JŸ%÷M±Ëý—Ðe¾{¨‹ Ði­\âĪZýäQ�c¢M¬Të×_"÷ôG‡¶k1B[ui{‘-�iÿ’!cdKÒÃý�‹9 -I›ùÒµ(ŸC¯ó~4Ëáç‘9¹íB2”2ΉzjÚ¹¶ßV¹*ö¶ù´¿ïr¯šE¡˜ŽP")oØÛW§»ó¾;~Ým02¼¸–]-çJÊÃ*RJ”áCÃ*:T »Íf'MU¯ŠàBBL¢‚þ°Ý§»2C +´ŠÈ›l^L8 Y;Ã¥S÷ˆã¢ÛÊ”ž\º€1Q)Ô…OqlÂ�ŒI_ÌÖóPA³[T(/šµ¡Jõó~]1t½mæåÆj9È==Ÿ>Ä‹ÛΧ,ãÌ7 …K -W�8T(ylˆP‚JO%õòjtH úìî;|ˆ�·ê¾þ\Œ I˜Ðà·(?/ˆž�ÁÕÝ {Nùˆ#áil]ûöáÈÙ�9ÎˆŽ¹9·<->P?nUP#õ‘’H…n9_‡ -%F›£Ò fÆá -gøÂŒ à¶÷r„jÖK=¢Ï¼î¢+’F(QÍ ÜàÐØè§ –Á«ätzl¶&eÑìMêÎÖ7[÷S–U+™dŠî ;Ë´! -8W$N€)�1“kaAëf¬&£ÝDèÜ-ÄÎázìFgp\H(ˆYz¸Ç14Ó¸3vÇ çp}zh�éæËCyïû”&±1³×Êm€0Ü7 nÌ�ÀÊàRÙO;Ý{‡2Æ�–?NVNÙ|ÇÈOÛ7G0Xæu|ÚݦöÆ®žå­ï�}Œ+~n�Z| @~Üé)t>¨�C…+ôG,g?ñ.ßÏÙ£ÀÅŽ±þ™rÚ»è{laµ=îÒr—Í­Ø4o÷E~Úç�;¦+�ËMžÚÁªDTû©=¹|Åsg×T›µgÑêH -°œôT£^”QßÇSí>w!Ou°°§v>ßSçÙµžÚeðÔzßî©óôZOíÑCOÝ'\Õ("…µÕ–ëÊopê -*ƒ‡¾ê6ß³"œðX°3EÔAωÈÁfEÔ\Jmò$s2™�Òí é1©Õå@á‡qgY;­ääŒÔp_(@òï#5°§€z/4'5 K­ðùR›g×J­Ë. µzß.µyz­Ôzôp”‹tBköƒg76KsÝ¢åõÛþè�«5*ˆD¹ž©µzNk6§µëWïž-°1QÕkÛ>{z“�YR$“Rã†ã‰ ÎRgV–|TjG”TϺ—®ôª± pÖ½ ­ŽûÚ–™3lh¯ q1«ªÊoò}~Â"7Ýv7hº‡+[ä²ù¬ù¤Œ_°æ'œj.zWL.�qù7õ7�îžþ¿Ç»Ü»¡·WçŽZ§Jÿ 6> endobj -4843 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 274.5352 657.906] -/Subtype/Link/A<> ->> endobj -4844 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 201.6901 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00204) >> ->> endobj -4846 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 532.8737 177.9699 543.7776] -/Subtype /Link -/A << /S /GoTo /D (a00151_g6832e4d2d046536b6472f7ac92340f68) >> ->> endobj -4847 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.7856 532.8737 201.4916 543.7776] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4848 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [231.8776 532.8737 256.5649 543.7776] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4849 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 494.0194 138.5977 504.9233] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4850 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 494.0194 189.7953 504.9233] -/Subtype /Link -/A << /S /GoTo /D (a00151_gb6683dd83fe1c8de9a24086d4b69e907) >> ->> endobj -4851 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.6109 494.0194 218.2983 504.9233] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4852 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [241.84 494.0194 266.5273 504.9233] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4853 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 455.1651 138.5977 466.069] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4854 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 455.1651 197.5461 466.069] -/Subtype /Link -/A << /S /GoTo /D (a00151_g2addf34c7d457c1a7899a7e2171ef1e9) >> ->> endobj -4855 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 416.3108 138.5977 427.2147] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4856 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.0958 416.3108 201.9695 427.2147] -/Subtype /Link -/A << /S /GoTo /D (a00151_g85b65e38aa74eba18979156f97a94a87) >> ->> endobj -4841 0 obj << -/D [4839 0 R /XYZ 90 757.9346 null] ->> endobj -1115 0 obj << -/D [4839 0 R /XYZ 90 739.9346 null] ->> endobj -386 0 obj << -/D [4839 0 R /XYZ 90 739.9346 null] ->> endobj -4842 0 obj << -/D [4839 0 R /XYZ 90 716.7484 null] ->> endobj -4845 0 obj << -/D [4839 0 R /XYZ 90 551.8236 null] ->> endobj -4838 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4860 0 obj << -/Length 1799 -/Filter /FlateDecode ->> -stream -xÚ­YkoÛ6ýî_a´À`Ë÷£еhÚµÛ€4Í0m¸¶’µ­Ô�uݯߥDÊ”)“ZFléèžÃ{Ï¥H‰Œ1ü‘±Ác%2ŒËñ|5Âã[8ürDÜé38ž]�½ fl�‘Tޝnê’ A _-ÞO4bdzFžìËûGð¹žm¦OîѼ9ü¢\Í·Ë⦀szR¬çö�ÔÜLˆ!Ó�W¯GçW­ -'R0I¬†/£÷ñxb_�0bF‹ñWø�1†ŽW#N™ÿ±½½iã4'ê úÆ*ë,áŽP?Z -ƒWá` Æÿ{´0Ä&6AFˆ:6¤Ú†¦úùèÏ‹Ý "-šPÏ‹í|SÞïÊjí± "6ŽUlš8¯V÷ËbU¬w³_¨nšÿ»;'îéå…û²XlŠíÖKÞVËý᲋Mµ«æÕWH „‰VcÉ4³ÞüzÐYˆŠ ¥ ˜A,�æBÔƒx:µ†ÚÝU›ÇÇÜS¤%iòÕÃ&�`…aâ­¦_ÌV.õûõg[àb¹mROHpµ¤ˆ3.«¯ú9’ªÒFÉ#©ÍéÏcÿí·@¶¿¢G¶ eG‘­€ÈþeŠA-šW«c=T1è*mÒ©kQ±†ÎàãhVÓ‡žíCRèkð„E>/>`L×åÁo¥ûo�/‹(›ZDR=–#�™SoOmnæ2´€ÇŸ…ôX ŠkÕ5½mûúX†à*ŽdûÏ£räQ4KŽ\e'‰Ø‡$ -IÊy }X®çËýúZ¼ñÀ˾{`Cع¡³.8¶²`Hݱò‘h¥kÛݦ\ߢ»žH¬I±>é›ú`,r®`r`Á$ACGÛž;‚ qLùÉÛVèës ­ªù!Ž%ü@©ˆç;)CS'[TŽn&KÙå}¸p#�ȹDŠ*rD~Ú㟓ŭ§¹Ë‹ëËó7v~ûóüíU4]�4Q2�‰•‘@á,Úu%ôÝü� rºÒ‡ó©B;T¾Î º ÌIÒ¶Êé€"‡ÌCjœÔpõPá‹ß¡Äxò.*0&Hr¬“)hAizŠ¡‘zÚS]X§ nŒ8YÞ�¨o Ë8Éx¨p†×—¸Ã›¯q—|@‘32¢¸¾Ì¿þuõîâüúüêרÌLÂ7LYo�=*£€2ƒ8Lç}mÌ•A‚ëÓ}R…ö°|¡SŒA¡Ó¼m¡CÞ…î�)tZF×ÊxVÏÕ/"RÂ"š«L<*G-a‚6a>ëÌc�íîüûù®Y¨ÁJãún±q‹®Œ9,¿!‰Ø]‹YϺ­ k1‚üY—D5‘C³Ûâ3CŒãú5ß§)…�ÇM$DÃîDÉt‚=(G~Ër¿ÇmúúÊ&ŒT§û(¤úÈÃò}”b ú(ÍÛöQÈ; �:äCú(-#Š[o’/Nu’âHK’Ë�GåÈa›Æ`ÉÛM}O#»»òT+)X73ÿ»•¤@Œ“Á nñ™1Æqs­d$¬`£ŸLq‹ÊÑGÑŽº)Ú{Pì#‡{�ûõÜîDûö,¯8O,Y@ª=,ß�)Æ Ó¼m†¼ÛªTå"â†l ¸.÷éôøœŠ(n°½¾.aÿ)Ñ Iæ«7 •ã×PnlŽ’ýçÑ7íÚÇBDÒ1ôÒwôÔ£Ÿ…èZˆÀc B$¯…PӾч õLd€Ì–å¿Å©Gt«j±_S"&è¤LÈ…æD¦e:•„B/�Ói¦0ÒÓŒ™[XÖÌaÀ„™3¼ÞÌÞ¬™»ÜÌœQŠͼ+WÅ&~^Dà`h& •`l¥�9JÿP; �Œ}´=ÌÎ:eg³J.¦îf›²Z”ó#ßo¦\Lªy±Ý–ëÛæØ�›uO;›Û;›b?ÆÙŒ" YÎ9ÛÃòΦœ�æm�òæ�Ýáâì´Š(nèlø”ëØÙ`AI‰œíP9àlj(=JÿPgƒ°!f ³tÊÙæöØ Wÿ{^­ÚÇkfs;ˆæUÂn{ÚîõÚäǸ�BB‰&2ãö–u{0áö ¯w{‡7ëö.÷·gTDqC·WûÞ5 –Xe’àQ9z-�°ï»Éèuª4¢LÉa^Ñ ¯·°zßL™š÷ÅÚ½�<‡eÉf]¸ÝÊ]1[Îð»Ê= -ð¯÷»OÕÞ_÷ª×ÿþ -ÚnÉSº×”_Ýïuá߀z–m«ÈÖ¨CÜöZ£ý˾ØîNö• -ÁˆÕ°F«·¤wÏ�¡ªD -ù]/ªëvÕp a4|I*‘QLû÷Ðîêó²X›ÙÎgÇ¿?ûÃymW‹{÷ƒP÷?¦ì1ÅÍ/бts×”ÂtæÊ¹÷#È?}soB«¾ÝÑMÀºØK òómñûžendstream -endobj -4859 0 obj << -/Type /Page -/Contents 4860 0 R -/Resources 4858 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4756 0 R -/Annots [ 4863 0 R 4864 0 R 4866 0 R 4867 0 R 4868 0 R 4869 0 R 4870 0 R 4871 0 R 4872 0 R 4874 0 R 4875 0 R 4876 0 R 4877 0 R ] ->> endobj -4863 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 636.7045 274.5352 657.906] -/Subtype/Link/A<> ->> endobj -4864 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 607.3502 196.7088 618.2541] -/Subtype /Link -/A << /S /GoTo /D (a00205) >> ->> endobj -4866 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 515.6229 216.8139 526.1532] -/Subtype /Link -/A << /S /GoTo /D (a00152_g7a7c46ffaba30477b8c9e3e61bd2e106) >> ->> endobj -4867 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 503.2741 202.6371 513.2018] -/Subtype /Link -/A << /S /GoTo /D (a00152_g06ba7b414e718081998f2814090debf1) >> ->> endobj -4868 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 490.3227 237.9346 500.2504] -/Subtype /Link -/A << /S /GoTo /D (a00152_gbb56b549f7ab4d86e1cc39b8afc70d1e) >> ->> endobj -4869 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 476.395 167.0009 487.2989] -/Subtype /Link -/A << /S /GoTo /D (a00152_g24f52ac52d6e714cb04a5aa01be3bdd0) >> ->> endobj -4870 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [248.2853 476.395 281.0723 487.2989] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4871 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 463.4436 175.8576 474.3475] -/Subtype /Link -/A << /S /GoTo /D (a00152_g9f2196e2705036869611962425e404bf) >> ->> endobj -4872 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [264.3448 463.4436 297.1318 474.3475] -/Subtype /Link -/A << /S /GoTo /D (a00150_gb81e78f890dbbee50c533a9734b74fd9) >> ->> endobj -4874 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 406.5914 184.6146 417.4953] -/Subtype /Link -/A << /S /GoTo /D (a00152_g2d9d28afa353f662b9bb5234fc419f72) >> ->> endobj -4875 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 367.7371 192.3555 378.641] -/Subtype /Link -/A << /S /GoTo /D (a00152_g058a8e6025f67b021862281f1911fcef) >> ->> endobj -4876 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 328.8828 191.7978 339.7867] -/Subtype /Link -/A << /S /GoTo /D (a00152_g902c4a360134096224bc2655f623aa5f) >> ->> endobj -4877 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 290.0285 184.0569 300.9324] -/Subtype /Link -/A << /S /GoTo /D (a00152_g54b27e45df15e10a0eb1a3e3a91417d2) >> ->> endobj -4861 0 obj << -/D [4859 0 R /XYZ 90 757.9346 null] ->> endobj -1116 0 obj << -/D [4859 0 R /XYZ 90 739.9346 null] ->> endobj -390 0 obj << -/D [4859 0 R /XYZ 90 739.9346 null] ->> endobj -4862 0 obj << -/D [4859 0 R /XYZ 90 716.7484 null] ->> endobj -4865 0 obj << -/D [4859 0 R /XYZ 90 534.1992 null] ->> endobj -4873 0 obj << -/D [4859 0 R /XYZ 90 425.5413 null] ->> endobj -4858 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F14 636 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4881 0 obj << -/Length 1913 -/Filter /FlateDecode ->> -stream -xÚ­ZÙnÛF}×WÍ‹ô ÉìKPMk'uŠn¢(’À`$Ú"¢ÅÑÒ$ýúÞ9Ô�CÎh`ZxxÏá½çÎBŠŒ1ü‘±Ác%2ŒËñb3ÂãøúåˆT‡gp|æ~™�ž¾ fl�‘TŽç÷ç’ A Ï—ï&ÄÐéŒÊÔäts ož„Ë7/Šu^¾»Ú-N›|{ÌŽÅn;ý05ºž×´•*Á$±¤ŸGï>àñÔ½aÄŒã/ð#b oFœ2÷a=z;ú£ŽS8ŸÐuq‚°î«#Á7Ô]…«UåÕiÄàòÆxr*ŸÂÿ]¶Ÿï€z7ȇÔ;.#ˆë­fïŠÇb.haÉÁ…J¤Á¡RüA´sú±ÀðOºÊ�aoé/·ˆ•ÛÁÒåŽ1zåŽóÖåöy”»A>¤ÜqA\WîC~„5f¶ טÃ$«¥ˆ'¢F%„Ñ\ÁsKÞUu·îcZ#¡ ¶HôÑ‘l ³2Þ>æ‹ÂVä[ëGsEûúù”áɯխ›2¦`/tè]Þ¬[0j&¨Íaƒ Ú‡ÝCǬî`VÉm¹ByÌÝc�Î;tå(¾sO€ÊWÈÝÇÝÉ�wÓÙ­gF‡¼šŠûòõKõy›»SŽåP+²5j×ÍVjÿ|ÊÇþF³M$¤þ>�†9‚ejrq°t£yc�ç­ÍçM7Zƒ{H£ÅUqýF;›<¼GmbÂÐD*%&Í�i¥`«m•dàBÜGGZ­†�[mª¡%öÅnY,Ú³F×LS-Þ{�M”F S1P±‡îÞ:Îí¸P.áþš:ÉöEöqÝy{œP‚¸Àý›mi•–l•#8Oûô4ae×()u×Pç¶t턉Tˆ+C¢*)âfŒ¤Ji•€{R*®Keçv†9!aÛ-¡j&°uLçü‡A‘Bþ¯Sœ}¢áÂlìJŒi{‰vCìï&¹<~™oó}vt†{æûÚ½ye·§ê¡Õ+~FÙ3Zýj„b,«.›Rh¼j† ^òñ›ûqÉ×oy°¶»“æeé?L›‚]endstream -endobj -4880 0 obj << -/Type /Page -/Contents 4881 0 R -/Resources 4879 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4756 0 R -/Annots [ 4884 0 R 4885 0 R 4887 0 R 4889 0 R 4890 0 R 4891 0 R 4892 0 R 4893 0 R 4895 0 R 4896 0 R 4897 0 R 4898 0 R 4900 0 R 4901 0 R ] ->> endobj -4884 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 638.7618 274.5352 659.9632] -/Subtype/Link/A<> ->> endobj -4885 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 609.4075 197.2667 620.3114] -/Subtype /Link -/A << /S /GoTo /D (a00206) >> ->> endobj -4887 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [138.5376 534.931 188.6792 545.8349] -/Subtype /Link -/A << /S /GoTo /D (a00090) >> ->> endobj -4889 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 453.1522 237.3867 463.0799] -/Subtype /Link -/A << /S /GoTo /D (a00152_g3e1562e8a6de32268e5df92a52152f91) >> ->> endobj -4890 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 440.2007 226.8662 450.1284] -/Subtype /Link -/A << /S /GoTo /D (a00152_g03d140db75de3d3cdfbbab1c4fed8d8d) >> ->> endobj -4891 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 427.2493 231.8475 437.177] -/Subtype /Link -/A << /S /GoTo /D (a00152_gbb558f3a9b1ec015e83c314aba694e35) >> ->> endobj -4892 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 413.3216 198.642 424.2256] -/Subtype /Link -/A << /S /GoTo /D (a00152_g737337d6a51e31b236c8233d024138a8) >> ->> endobj -4893 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 400.3702 206.3828 411.2741] -/Subtype /Link -/A << /S /GoTo /D (a00144_g30e827f33eacff55ecb4d8fb5a11d5d1) >> ->> endobj -4895 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 317.6152 184.6146 328.5191] -/Subtype /Link -/A << /S /GoTo /D (a00152_g2d9d28afa353f662b9bb5234fc419f72) >> ->> endobj -4896 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 278.7609 191.7978 289.6648] -/Subtype /Link -/A << /S /GoTo /D (a00152_g902c4a360134096224bc2655f623aa5f) >> ->> endobj -4897 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 239.9066 184.0569 250.8105] -/Subtype /Link -/A << /S /GoTo /D (a00152_g54b27e45df15e10a0eb1a3e3a91417d2) >> ->> endobj -4898 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 201.0523 192.3555 211.9562] -/Subtype /Link -/A << /S /GoTo /D (a00152_g058a8e6025f67b021862281f1911fcef) >> ->> endobj -4900 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [113.9104 118.2972 168.4754 129.2012] -/Subtype /Link -/A << /S /GoTo /D (a00089) >> ->> endobj -4901 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.9735 118.2972 218.5572 129.2012] -/Subtype /Link -/A << /S /GoTo /D (a00152_g499bb98a0b4ae9a98553ede81317606d) >> ->> endobj -4882 0 obj << -/D [4880 0 R /XYZ 90 757.9346 null] ->> endobj -1117 0 obj << -/D [4880 0 R /XYZ 90 739.9346 null] ->> endobj -394 0 obj << -/D [4880 0 R /XYZ 90 739.9346 null] ->> endobj -4883 0 obj << -/D [4880 0 R /XYZ 90 716.7484 null] ->> endobj -4886 0 obj << -/D [4880 0 R /XYZ 90 553.8809 null] ->> endobj -4888 0 obj << -/D [4880 0 R /XYZ 90 471.1259 null] ->> endobj -4894 0 obj << -/D [4880 0 R /XYZ 90 336.5651 null] ->> endobj -4899 0 obj << -/D [4880 0 R /XYZ 90 137.2472 null] ->> endobj -4879 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4905 0 obj << -/Length 2075 -/Filter /FlateDecode ->> -stream -xÚ­Ym�Û6þî_a´*5ËwJAqè6»I“kz¹� ´h‹BkÓ»jlÉ•älößßP$e½YrzA°1E g†Ãç)2Çð�Ì#ük�Kz•€hƱ¬DW ŽQ@^˜¶í£Á±0ð6=M£|Ôñû$½·OTqždG§eÝE¶é¬‘mtÖšNÈ®… ÁÑ>Ùqçlïc»üv|ì L瓳°uÞu§�0ä«) SNÒ2`1d©ÉLVÃMÇSvÌmÏ!ÏþÒëò«…Aa_n’z²<Ñ…•IÒ¢ÔñÆér*ô&)«ð ëNÕ½ "øï;gò Ÿ“¾°>ü¦].Hð—ö0¤�’Ǥ|ðŠ�¨ bkŽ6Ál’¢Ì“»5 †Ø£ZH!I9¯„®µ1š&§”¸ßSðZT�ÿ$ çBDˆâˆ[èšWù½“¹mòßË/›øßÓk¼«sv׋ˆ E¤ãE7÷x©)Û=mÆ6r’-a¯²Ä/“t½;n`9$ì fU—À�­Y×3ûI„B¢D5ø] ,YÛ˜¯Çö„Éeõ  C¡(�' -Š0XÇ®÷Î q<‡–e'4 -]Z›ÜL/ ­ú�7›\EKÔ?UsŠw»§…Á×ÐòÀ!Ñù’Þdk{~~õöÏåW_¼úåæzÁqpu}}kT)››Bi¬ÚÃfóK ‘(JL(¬D?a3¡Ÿ-4bûSô:1cÖVCšm´³jWÙ�«ÂÖa€Ir0œêrï‡æ§&¾D½5i+>îJÛ‘gÇR/¨+lߣÞílË÷Ø€Æ ´òT»ÁÎ>L\àÈMº�#&öŒ�™”'ÇšŠ›ëkdr=”câÃa—¬“øÎWSv]«<²=/UçsÓ¾sâùуÜ䯿?íŠïÌ`Úº2Á©Æ9+¥Åþ9;ë‡8½÷eZ•ú�à1)mËå|h¹œ�Ê\q¤°8_†7†* EJÈOzÌD~§Tô++E¡œµXKMÙ… -9ÂR¶í~¹±‰¿Ÿà¹DŠ*Ò1~>Á{ù)7zz�†ôm~wK% -Þ›ºp<€ È‚¢ ç’5¥"§�#Ã’AõFEÄj�ž‡à±ä•Çp–À - -áZÌn˜À›}’êâ˜=&ãÓžúÑÃÐ0<[˜ò p*}ÙŸf}zß™”ˆaÌÇ'êæI`“€²ï1[Ò0B‚“)ÔÕbUqë‹©nº´‡—fÞ¼ºu�}¶9îÆöòl8ݹ¸óЙ{ªhÌÓ›«ÃÁóÿ#íR"ÒK#Ö�®ï«N … $·—->S§€N]B �R~–hM�¢Õb“Dµx"Ú„]O´–Ýi¢µ�_@´ 7zz=ÑV«{N„aɉx©)Ó!Àƒ@~n™–üøH$¦â2ì5„GÈê¥Üñ±½A˜8J \&{Ý.ŸwÉX+AÚ…¸|ˆ×æ¼gomJG±6Gæ§ÆÕ&ÁYÆ‘�#@ ù,[‘°ß’&!™P‹M2¡©p„ v=Zv§™Ð6~&ÜèéõL¸½¹z÷îæÍ÷?Âbâà×Þ®Ã(T1|*ÕUýÔ]‡ 9…c'UáØÜ×sŸ7SØ;²¼ìܬ£Õ�M«Ý!. -½¿ƒC­)Ljbõ™@ -G%Ø$H½Ø4H -Ç@:n·iÓî m¿¤ãnôô¶@ú盫_®ÌYòåM¿6R�HðD8j© ?(‡*GtÜàø,@àj²èBÌ7¤Ç@ïÅZÙ{LöG÷Ù䔵ã´�ømn.[bøû}�–›õÖcì¯Gü•p]´u¨a3zu½·5_Ò¶þçN¦UWßV‘Wèö¨À¸€Òæ 7g¹ÁA—‡1 2 휉½ †µ#Ò^üão”=CBmÖtPk+ ´û ™ˆ+›Š^êTCç«QŸ‹ÞøÆk³þ -ŒP÷‹ŸQöŒbû’nÅÌw–æ'A+�p{G½Î>>Ýë´NóÕ»ÖˆÏÿø@èëendstream -endobj -4904 0 obj << -/Type /Page -/Contents 4905 0 R -/Resources 4903 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4918 0 R -/Annots [ 4908 0 R 4909 0 R 4911 0 R 4912 0 R 4913 0 R 4915 0 R 4916 0 R 4917 0 R ] ->> endobj -4908 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 630.6989 274.5352 651.9003] -/Subtype/Link/A<> ->> endobj -4909 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 556.0563 192.2954 566.9602] -/Subtype /Link -/A << /S /GoTo /D (a00207) >> ->> endobj -4911 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 392.5288 225.9098 402.4565] -/Subtype /Link -/A << /S /GoTo /D (a00153_g51195ea7cd5aa387a87f9d3b23905b62) >> ->> endobj -4912 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 348.6697 246.7912 358.5974] -/Subtype /Link -/A << /S /GoTo /D (a00153_g9069474ea570fd78c481aa164317dbaf) >> ->> endobj -4913 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 304.8107 245.6755 314.7384] -/Subtype /Link -/A << /S /GoTo /D (a00153_ge0f8cbeca9731af2171ffd37e79de893) >> ->> endobj -4915 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 210.2945 187.0159 220.2222] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb61381673de27f31848c5396bf0b338e) >> ->> endobj -4916 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 166.4355 233.6306 176.3632] -/Subtype /Link -/A << /S /GoTo /D (a00153_gf963fdea2b75d27ef31e92d1d01359ee) >> ->> endobj -4917 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 122.5765 248.0566 132.5041] -/Subtype /Link -/A << /S /GoTo /D (a00153_gc3882366feda1cb759ccbfe98327a7db) >> ->> endobj -4906 0 obj << -/D [4904 0 R /XYZ 90 757.9346 null] ->> endobj -1118 0 obj << -/D [4904 0 R /XYZ 90 739.9346 null] ->> endobj -398 0 obj << -/D [4904 0 R /XYZ 90 739.9346 null] ->> endobj -4907 0 obj << -/D [4904 0 R /XYZ 90 715.6224 null] ->> endobj -4910 0 obj << -/D [4904 0 R /XYZ 90 491.4899 null] ->> endobj -4914 0 obj << -/D [4904 0 R /XYZ 90 228.4871 null] ->> endobj -4903 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4922 0 obj << -/Length 2097 -/Filter /FlateDecode ->> -stream -xÚ­šÝsÛ¸ÀßýWh¦•Œâ›À½ål%qÛi¬ô®½»ñÈmsªŸH^.ýë» E€j<ž±@r¹»XþX€$# d¤ñ( ÒŒËÑb}†GOpúÝi.ŸÃõs_àÇÙÙßÞR=ÒHK*G³ÇJƒ$HPBG³å/c¢ùäœjÊ’qyõ š� Âuãm¶JëÖåvQ®ÓM1/²ífòÛìÃÙtæÌ6^ &‰1úûÙ/¿áѼûp†ÓJŒ¾ÂFDk:ZŸqÊìÁêìîìNO}¡ºáXçaÇ{GÒBPÛ= -½MêÞ}¹lº´Øn~Ř>•»ºÕÉí‹içǺƒ9"TÒþ {µÌ 2Áq¦ø^�qæWJÅ¡-‚á.*XØ¢“ŠÙ%i,eÛî_–©éû&íç%4!ÆÍ¥ÝS#óÙwÃÊÇÜèè­žÅÕ§{ó<�P ’ŠE" °A@DXÒ¢ÿH¸@�K%‘Vj‹À#nJ^¹  àD«‘3nÎ&šŽ·‚ÇOÕ¿Uš×´|M‹çtW·Wyùò²ÝÍÁó¶\-ëöCjÁ[¿@5g3K^£g³-P‰Ú{™H„©NÂ]mzJ"\�^^¥ÄH)?mŽòêÄ¢¼ú -¼FìZ^[vã¼¶�à5âFG¯ÇëýÅûéÅßï¾\ߺDB‰(gš©SÑå %<‰‘ÛHÁÍ ]Lˆ?§‹ Åãÿäå:ïÇ·Ì-ºƒ�e%J‘×A¡1b©8°{u!^ƒF®žÑ´ú–‡ÀôáPk ÕÛ››.¦BEŽÑˆJq2¥Æe,x S+Vqúܰµžÿ™­Ëu}0_oËM3Žnݤ½(w» Ô&©½æÏè›tQMà½< -¥‘àR ëŒ/}¼´C(Y3Q\üµ… ‰žGø¾@€|'E?hqÏ~Ä®…¿e7NÛøü#ntôÚx3áx|1»úçôþöÓô¦“Œ#•(‚Ñ  J§'æ�€ç˜FòÀ‰Ÿ/Ó"Ý­³Íá0Ý*)í°»}I7Ùæ©Ã~#¶›p1Þ6¹ä -ù!Ioòp  )ÂNÌ{‘=ˆ1Ì�Xi_aéˆ]‹tËné¶ñHGÜèèµHÏ1©ká` 4GLèS f.¡×*Vv8±þñ|S®lµlÇó.¯Šù&Ý–ùêÛžëºå�§Ñ‘�CíEa¥ø*•°‡°öŠ­:­XœNOaˆÎ°]G§ow�-ãCè »ÑÑkéüxu7›Þ|ºý<‘ðôºœB1È ˆ�¼®ãôœ�¦Vìû1]eyá ÀŽU3R(5�Z+ú*”2Hi%‰PêÄ¢”ú -”FìZJ[vã”¶� 4âFG¯«‹?¿»4•Á› !Ä,’4Q…N` -óW$$)Iʼn°²Ä”ÑÙ‰�^8˪V®–®`^΋¹[¹eæ©,¼2õ»*&!è"V^Å[$�¦ÞV,Ž·§0„wØ®ÃÛ·;ï–ñ!x‡Ýèèµx׃ñmwgMßc‘°R1`uÄ´ÔmX/Pnó„©�9âI‡rÄŠµôl“Ù|UÔ«Åbg¶8æ›|�幃½ÈÖ0¦–rXoîˉ&©^ÊUžöíŒ2$ׯÃ>VˆI[ñ9±8ûžÂûa»Ž}ßîö[Ƈ°v££×²ýæçÿŸ»:FŒÂÄ „“Šx@ E -øo{ úРš@mJé0ô}éúNl�>O¼Z†Ë}-ªZ~ ÐyÝœ×Ryjfçu=AÀy7@û¡Ñ{�E2^gE�-•”™zŒDcĺ³¯ÜTÏ`K—½‰EF4aìU‹J *öšÆ‰EËWH¬ˆ]›X-»ñÄj�X7:z½Äºû×M_n1x@‚ñp,œTÄ ³JHøÁ#½pð -j<°òò¥C©eÅö©•0/µàÀ¥VÂëÔ‚s6µ 9¯ fu£�cpO•�EËúð¡±Ñ™¬šƒK­Û›hehªE~/Ó¼hL×)ñƒ`@(`—é™-ï–iº¶ó^±­Ÿç¤¶´ëñr“—‹Ešç�åª?[©„ Ò×Y‡›ñXÓ$¶wbñlõ†²5l×e«ow@¶¶ŒÉÖ°½6[¡ü¿¿¾»;6j.T8 -N*bžÑ—‡ÑÇ~4KŽ/oï®þ=­á9ovëÍ6ÁÇ÷÷§7�óà6ü—@ éŒh†�ɰŒ÷¥ïÄZu¤[FµvÚ¹\mü75 Û›DA¹ÀÈë¬ú‰4¯ÇelÕïÄ¢9á+ äDĮ͉–ÝxN´�ȉˆ½nY4½˜š7?]Ý\ÞN˜ÿÔ}{«JF"€vàçÄ5¿¹Mp%bZ±‡`­©Â^š/ÿHwEæ^ÊÖÃÿ"Íàô_ §ö[…l³Ü~�ÀÑO)Ó¦ù:”RX˜q.b”Z±8¥žÂ¥a»ŽRßîJ[ƇPv££×�ÜW×€è„P<~s5«o¿Ì:¤&°àÖ‰ -ÅIE¼�ª̵¼zA�_†¥H¾'"ߊãïÕz—uk7X燯ºÛUy1ÿv°zw#yWY…ÕIáa[KÄø°B† -D1>ºŸ‚!ÔD -ù]ÂU9ë FóßFK¤«Ý�Ç£p#_à©ÞÌÆïÒMº›»M ´kÛø`ú_6„6¿øÊ~ ÍÐ-Ùì.N¨p}t? |øf? üóÛSÚù$Ð|«g]ó¢ô?ÅÞ'endstream -endobj -4921 0 obj << -/Type /Page -/Contents 4922 0 R -/Resources 4920 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4918 0 R -/Annots [ 4925 0 R 4926 0 R 4927 0 R 4929 0 R 4930 0 R 4931 0 R 4932 0 R 4933 0 R 4934 0 R 4935 0 R 4936 0 R 4937 0 R 4938 0 R ] ->> endobj -4925 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 701.9494 188.6795 711.877] -/Subtype /Link -/A << /S /GoTo /D (a00153_gdcf372ff9748996f7c05e9822a615384) >> ->> endobj -4926 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 658.7078 254.552 668.6355] -/Subtype /Link -/A << /S /GoTo /D (a00153_g92f3344ec8ca46893163399c89fafed5) >> ->> endobj -4927 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 615.4662 227.424 625.3938] -/Subtype /Link -/A << /S /GoTo /D (a00153_g196379ceb1219a99f4495e41ccc9bbfb) >> ->> endobj -4929 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 522.401 235.8724 532.3287] -/Subtype /Link -/A << /S /GoTo /D (a00153_gac0de06236b02659460445de30776e00) >> ->> endobj -4930 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 479.1594 202.5175 489.0871] -/Subtype /Link -/A << /S /GoTo /D (a00153_gf5fe83be78b78b9e7d9e7f1e34ab1cc5) >> ->> endobj -4931 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 435.9178 233.4713 445.8455] -/Subtype /Link -/A << /S /GoTo /D (a00153_g8f4ebd8ef6c0ea665ed351d87fec09fd) >> ->> endobj -4932 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 392.6762 215.0208 402.6039] -/Subtype /Link -/A << /S /GoTo /D (a00153_g51c1cd531ff0afb81620151f2248cd21) >> ->> endobj -4933 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 349.4346 187.9025 359.3623] -/Subtype /Link -/A << /S /GoTo /D (a00153_g15de27b044603284f68db05a378235a7) >> ->> endobj -4934 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 306.193 211.3245 316.1207] -/Subtype /Link -/A << /S /GoTo /D (a00153_g67cf1e0d2324c93f332c1f020c0fe8b3) >> ->> endobj -4935 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 262.9514 231.2496 272.8791] -/Subtype /Link -/A << /S /GoTo /D (a00153_g24aa5bc36939cc9a0833e1df01478a7e) >> ->> endobj -4936 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 208.1483 211.942 218.6786] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4910467b83a639f06739c82cd362037e) >> ->> endobj -4937 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 165.5093 259.1549 175.437] -/Subtype /Link -/A << /S /GoTo /D (a00153_g5b9dba2123705bce1ce95c3deca0bdad) >> ->> endobj -4938 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 122.2677 272.6941 132.1954] -/Subtype /Link -/A << /S /GoTo /D (a00153_g2bc3b489923793759526a3181eb667fa) >> ->> endobj -4923 0 obj << -/D [4921 0 R /XYZ 90 757.9346 null] ->> endobj -4924 0 obj << -/D [4921 0 R /XYZ 90 719.8332 null] ->> endobj -4928 0 obj << -/D [4921 0 R /XYZ 90 540.2849 null] ->> endobj -4920 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4941 0 obj << -/Length 1952 -/Filter /FlateDecode ->> -stream -xÚ­Zkoã6ýî_a _l ÃáSû-™dR浉ØÝ¶[±…:–kÉíÌþú½-™Ô´A�„¦Žî=$Ͻ¼¢LÆ~ÈXâq*R$OÆË§¯¡ûfDÌåWpýUp9½~KåX"™Ðd<l,$ Jèx¾úe’!Ʀ¯¨À“c± ¿å¾FÝó¶Øæºu›?æ‡)É&ùn©ºRƲ ‘búÛüÝèzî~‚%D¹ÿcôËox¼žïF1™‰ñ_ð#"%?�8eöÃvt7ú—³£/47ô SÖ?NB�‚Ú�RwªÇyqûYeYî~Ř®�‡E]”;Ý ƒ†vÕ7œ"†Óó³ý|]“`­É&8AœeÜYQL~¥´3oÃMT° ;Š8%Iœ$žÓV¹õ.ïxæ JiJ|ÏêÊam ·mápjUqø2û|Ë0ŸJ6¹¸¼¿›ý÷ú” eÁ½‘y 0ÀŒ3ÅIÎÛ žIKIèøU")b`Ùòxœß„7|A)8•ÙØ¢ßùƨ¿*þgZå£þ_ÛKNVõâ‚…ˆ ê®­f�dqÌI˜®aK(™ð³²K’ qAcºs°¨ðÚÊ‹øµÒóüƵç; ¾�ŽÝ–üî?\üûbÊñä¦G}¦�‡ç‚"(ƒìDyês Ÿ•‡`Hà,¨æ:$g óôü´øZŸt{1%x²VN$~¢ì¦™ïêC‘WÆJ¾¨Ž‡)K'ùJ÷&›\o*ßZ•CÞ]U烃S$806úº?õ'6¶f)`à7ù.?,¶+ÿ‹L D¦ç·Û6 ‰�Ä ÇçHŒøµ‘èù�G¢ï|@$FhtìÚH¼T’ûò¶w€µêil&0ŒLïL“ŽH1J‹Žƒ ÝŽ3.ûÅrJñä÷&¤jÝ÷ zŽ�ª€jê(BÎoBH”Jž½È6!`þ3•­"âÔ06@œg gÛïqz·ˆ3L£c׊óN×(ÍBÍgwóÙ›»ŽH)¥¤YdFC’ˆì{EÊʤä1‘Z˜â}•×ùá©ØÙô\ØÌ[Cž«êbiú«ã~_Œ0«MyÜšìý�Ûù´‡ÂßåôóJ¥�‹—Q*•™$1¥ZX\©-ƒ!¥†ý:¥¶ýPªç|ˆRÃ4:v­Rߺ¹™}¼é¨tG¨Rgx¸pêXHsÉæ‚DÄé`!qnKW~¬‹ÝÚÏ­ËüP/lMÑÔÖBR½€ryFΠñÊå‰D„ñ,¢\‹*·m0 Üˆ_«\Ïo\¹¾óÊ�ÐèØuÀ­*Â?M™˜\\½¹€”ÛɰðÈyl> ‘Œ~çà ‰³˜†-L‘¾ J‰ÐèØuÕð³2z^‰Àö,#AÕ®9é» -ªÎQYËÉæ‰ùá[mõÕœ»â¤s6ÖN†\ªÐs ±‰ÅŽLÈ?�ª"TßH¤r`’o£û“<‘ðP"©}ªÕòé;7&)×K}.PÚ€@ 8X4P‚Ÿ%â׊ç7(¾ó�¡Ñ±ëÊùÙ|þþúþúãÕì¢[ÔsŽ’Dòð\8T„åJø„ã„ö­wBPšŠó/ŠÛ€Ðz[X|½C[ëöëÖ»íwÀz{·¬w˜FÇ®KŒ³›s‹M3HO$ O„CEPx  e>BïûRA„÷¿—À`Jøä}ý¡L·FÛ¹(A2e™ývƒ!ñü†«¶µ‚ͤlã�ʧGûzŽÚ×t?QöÅúÅ8Ñ­Ç)*§ûÙ— ló¾þU~ý¶Îw§Ó£¾›Ñ3?ÿ}¥Ž¹endstream -endobj -4940 0 obj << -/Type /Page -/Contents 4941 0 R -/Resources 4939 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4918 0 R -/Annots [ 4944 0 R 4945 0 R 4947 0 R 4948 0 R 4949 0 R 4950 0 R 4951 0 R 4952 0 R 4954 0 R 4956 0 R 4957 0 R ] ->> endobj -4944 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 705.1301 233.1426 715.0578] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb1455b27c06532a399cf06d2c1d6d08d) >> ->> endobj -4945 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 666.2758 236.4303 676.2035] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3090117ef3ff5775b77cb1960e442d07) >> ->> endobj -4947 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 583.5208 209.0629 593.4485] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3589822ecb9d9c4145209756396b8a6b) >> ->> endobj -4948 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 544.6665 222.0741 554.5942] -/Subtype /Link -/A << /S /GoTo /D (a00153_g5726142fec34f35fb9ea19e5a45975c6) >> ->> endobj -4949 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 505.8122 214.124 515.7399] -/Subtype /Link -/A << /S /GoTo /D (a00153_g21664b7441cfa37d280228d23316d609) >> ->> endobj -4950 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 466.9579 228.3406 476.8856] -/Subtype /Link -/A << /S /GoTo /D (a00153_g156dd2891a57035e4afdc4c2bc0b0ebf) >> ->> endobj -4951 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 428.1036 212.4703 438.0313] -/Subtype /Link -/A << /S /GoTo /D (a00153_ge6f4a2453dbd8bc60e6a82774552366a) >> ->> endobj -4952 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [133.9153 388.2731 166.3534 399.177] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb58e1ceb7cb73ca2bcd73146b6c1b4e7) >> ->> endobj -4954 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 255.3053 233.5112 265.233] -/Subtype /Link -/A << /S /GoTo /D (a00153_g285a80366aed9428f64282b8d13c918b) >> ->> endobj -4956 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 172.5503 245.6657 182.478] -/Subtype /Link -/A << /S /GoTo /D (a00153_gb6e04358481bd2057524fb874cfa472b) >> ->> endobj -4957 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 159.5989 229.0679 169.5265] -/Subtype /Link -/A << /S /GoTo /D (a00153_g6836f92f3692f3a4429eb599db40cbae) >> ->> endobj -4942 0 obj << -/D [4940 0 R /XYZ 90 757.9346 null] ->> endobj -4943 0 obj << -/D [4940 0 R /XYZ 90 720.8203 null] ->> endobj -4946 0 obj << -/D [4940 0 R /XYZ 90 599.211 null] ->> endobj -4953 0 obj << -/D [4940 0 R /XYZ 90 322.1845 null] ->> endobj -4955 0 obj << -/D [4940 0 R /XYZ 90 190.524 null] ->> endobj -4939 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F50 1172 0 R /F14 636 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4960 0 obj << -/Length 2082 -/Filter /FlateDecode ->> -stream -xÚ­š[oã¶Çßý)ŒöÅ~0Ë‹x[E·¹�lw“œÄzN[Š-Ç:Ë®%·Ù~ú3”DE7“ö6ËÖhæÏá�Rbø#C�‡’K¤Y †³ÕŸàç‹)OOàü¤nðÓtðÝ9ÕC�´ b8]äAœ:œÎ-ƪ)“£Ýå r<"çñsT�®g»U”da¯“ñïÓƒ³i¶TÅ™ &èƒ_ÇÃ9¨û0ÀˆiŇÁŒˆÖt¸”Ù/σ»Á¿+?ʼnü‚¾ÆqÂú[G¿PÛ< -­•EëœOÆx´Kâ—ïvñf2['‹1á#´l7ò6ZDÛ1Q£(™E¦‘…w‚4ç¹wÈ®qNÕ«wDJÿ§Q‚§y™¯(�mã�Í8bµN0~Œf]øyŸEFÖK¸ÚXAU�€æß0¦O»mÑù�æ—çµ{Cq„‰’C0„¡Ÿ{si�&u«.-J#Œøâ`�%+äŽ�´l¹Þ¾kÇ&˜"ÉÀ›3xeÕ½ž&‚%’„ñWoyøy¸*“¼K>� äí9-’LHíjAQÀ8•_õ}Gª”Hi)ZR‹ÓŸ‡öèçšl{E�lQ—Ýñl„ ûÇ4ž¥(�ÚZh ‘ J¸ÓVYuã7ÞõfâÿÐÃá„pë’R8à…éidÐJâWÔâr�Tr àRŽQ@e¡ÞœÙ>•&·õî·æ“š}Oï·½ivÃàm‹ÐqÕÒЯ´ñny2qQ™=ÑÈ.Ý É ‚ÜòÛ8™=ïæQ‘œ!©UƒÈ–Kà=€QYÄI–}ÙDiÑÖ¶/�¤äª4ý¡W%ˆQºOßDÀ¬õÍ_ÑcmÿŒ¶hùÍž)�1DuP q“Ï�ëÿE³l’n¢Ylˆ˜9&©u>¦®I°ðœÏu,`£e˜¡ùFÉnõÓrþÓzQ|vBå'ËPùUÙ2ÌJÛ°<ÿ•vfšýÓü‹¶Ûx>�’â’źŒ…³eq´ÙæMEã ×x4]Fié#Ü–Å´É -qb¥C{M «LB Kg�¼Õ˜®²ü8LÊ‚>?;²œ„«(-—á˜â²yÅ/Ù²<Øló�ýR|»¿¼y8¹¾:+¾Åçôäu©’åf$¢nO1‚€¹õ–ró!¤÷S B¬8óQhÍüÖº(tÇ­(¬Ç=€ÂFðC(tËèøíPøñònzvus};Ћ=$RÝÊ=i1ëIëö#I„ -aLúH´f‘ø§Y”ÄÉS ÌÍz›9�dÙh$É~&aå@ —>&­™ŸÉšC“õ¸0Ù~“n¿ &2õþüüìöáîò¿gaY¯$Vž”À~ŒÔ±­YÀ™¡kÍÌrîsº[¥ÿŶñTè·¨·”q¤ :øH´f~k]$ºãV$Öã@b#ø!$ºetü6H¼›Ž5½ÏGSØï^žty俏ö¥%à(G×^ -PÁ|P%1÷Ü]™P -qŽõ‘ØåweWv•YþL³ÜZÄež‡€dr^DÂîHÉ·¹oFˆPå[ÜUf~¼j]x¹ãVxÕãvð"¢§wEZaÕ²Ÿ/kï“Ôñ›óÕ'�bXeIÎݹø¸yÒz$`�B€ºï~Ie–¿p Ž% ö;üE”PŽ(×Ô˜5óVsèÌ·¬· X’ÆO‰}» ]šr§£!ËvYMM{Y«ì=êº~˱¦2¥=Äq‚˜ÜÉ�Í.‘ähä ‡–‡œ53ZïZ´"εv##4‡Ë^ì ,ŤwbÃ�J"Š{._ýfL¯‚KHí±  �´dÊ´œQ¸Ð¼# |– ¿ˆ’hf»rød>˜ ìÊ/„–Ÿøeïhù -Ÿ°‹1åÕ¢£û®Ðãû¦ÐË—§¨óŽ�yyÇJ«eéÿ5/óSendstream -endobj -4959 0 obj << -/Type /Page -/Contents 4960 0 R -/Resources 4958 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4918 0 R -/Annots [ 4963 0 R 4964 0 R 4966 0 R 4967 0 R 4968 0 R 4969 0 R 4970 0 R 4971 0 R 4972 0 R 4973 0 R 4974 0 R 4975 0 R 4976 0 R ] ->> endobj -4963 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[0 1 1] -/Rect [176.9013 641.6664 250.6249 662.8678] -/Subtype/Link/A<> ->> endobj -4964 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.3666 617.2739 200.5842 628.1778] -/Subtype /Link -/A << /S /GoTo /D (a00208) >> ->> endobj -4966 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 491.778 298.8158 501.7057] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3f6f1f6f98431f2d33ed30a30d2ccc35) >> ->> endobj -4967 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 454.9084 293.2467 464.8361] -/Subtype /Link -/A << /S /GoTo /D (a00153_g974c9b4bbe6b07cc1d64ac4fad278030) >> ->> endobj -4968 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 418.0389 263.8671 427.9666] -/Subtype /Link -/A << /S /GoTo /D (a00153_gcacc406c3bf7d0e00412e4c946252739) >> ->> endobj -4969 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 381.1693 265.0627 391.097] -/Subtype /Link -/A << /S /GoTo /D (a00153_gca1240bba5dd57f8c7c27123c84a1f6d) >> ->> endobj -4970 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 344.2997 245.6755 354.2274] -/Subtype /Link -/A << /S /GoTo /D (a00153_g3001114ddadc1f2ada5cc9a780e866fc) >> ->> endobj -4971 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 307.4302 220.231 317.3579] -/Subtype /Link -/A << /S /GoTo /D (a00153_g763f12007aad8cc0e483bf50f8a8d9b4) >> ->> endobj -4972 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 270.5606 286.1035 280.4883] -/Subtype /Link -/A << /S /GoTo /D (a00153_g9dd44616d41cef74d3beb51d8be5ecec) >> ->> endobj -4973 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.7309 233.6911 253.6255 243.6187] -/Subtype /Link -/A << /S /GoTo /D (a00153_g529648ad3b0b327a43689b0f1779ff55) >> ->> endobj -4974 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [177.0032 195.8452 196.7092 206.7492] -/Subtype /Link -/A << /S /GoTo /D (a00153_g4caecabca98b43919dd11be1c0d4cd8e) >> ->> endobj -4975 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.9845 158.9757 206.6718 169.8796] -/Subtype /Link -/A << /S /GoTo /D (a00153_g77570ac4fcab86864fa1916e55676da2) >> ->> endobj -4976 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [207.1599 122.1061 252.3298 133.01] -/Subtype /Link -/A << /S /GoTo /D (a00153_g727459e5c4f777543c81ffffa3df3f0c) >> ->> endobj -4961 0 obj << -/D [4959 0 R /XYZ 90 757.9346 null] ->> endobj -1119 0 obj << -/D [4959 0 R /XYZ 90 739.9346 null] ->> endobj -402 0 obj << -/D [4959 0 R /XYZ 90 739.9346 null] ->> endobj -4962 0 obj << -/D [4959 0 R /XYZ 90 716.7484 null] ->> endobj -4965 0 obj << -/D [4959 0 R /XYZ 90 542.7325 null] ->> endobj -4958 0 obj << -/Font << /F29 499 0 R /F23 482 0 R /F11 705 0 R /F26 485 0 R /F50 1172 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4980 0 obj << -/Length 1572 -/Filter /FlateDecode ->> -stream -xÚ½X}o›8ÿ¿Ÿ"Ú&m;%”÷@ït:BœÆ§r@ÚUw§�Y¬ˆ€´Û·?ƒm’PHGÿ8­ZüöØ¿ßój# xüOèü`¬Œ9]’ÕA_ðƒ¯xøúB Ó²(áß–‰‘"HƒÑ±èÄ»¸œ‰ú@ä9U•�·.7We�S4ià…07þ®ˆ²�#Qá?èÿõþ$27ÖÆB)Àã}NÖD¹ØÃ%Y,p¢�õŠ�_°VÄÀo·éJ¾’n�&!*÷Í»�{®ÑÅQqÕ½±Ö{c�#ûžZ4?u÷ciÈ ìó‚9fá3c×zñÒÇZ†Å^'rýäDF>†ž¤ -¢!;QÐ[Ä`1øG&9õÁ.bU[ÅQFCMÒ8QQÕÄO ã\*â´þ3ÊÏ)›)°Ï•�]2Ü3{üŒ¾5NÕq!9A/¼€žéVø©.ÊõYâxIk@ìO!<)” Ü%K5)>�6cçwäoó¶4pHR5£c‹rg@K½½F¢^cEè¯>7ñãFqª§Å+IÛd¡ŽX±Á6$|Ò,?ãFrÄ>õ.Ì?Rò%!>6:­ØqÊÈ�``ClªG¶É¯kúhž®‹§2‰vFéÏ„U&rÄ. -Ê¢Âð¡º~ee9IŽªKž¿à$ê XFõÔQƽ]Ë›C—Þaì™wg8€z]:ö-œ‚)éMîɯ7gË,׃ÞÊ£]â MÛò8Yy¶C7úòÅpÙÖïß–w;–Ö›ŒaQ|àÓÒ.=Ïvè¹7ËdL0Sǰ<Ü!cb.VSh]Ó>ÆNƒÎ¦�¼�“÷ìáAÝôÞ:PR*3ò{sŽ'Œ \@ᄀüô¬šýŒÑ7¨A ǃæjaÐáåÊYÚîbÿ*W{ѺæÂ€7`Š3˜ VjfZ¥–ºÕ¯;7‹óþŸ« IWàÄú;“z‰ÿöÝI¸’Õ+iLŸ"¡Oo®àûŽ4Þ�!øR5(¿&Š'P/�à�ÝH^æOe‚â-J‚íž=üË‹¥Üæ÷6 ¥C"Ã�½µmpܶϛ=Úq›7mëµÖõÄíz«DQ=û[%d¾UbWt,Ú©#¼ £5J"–ž |†¬ÊÿH‘ñß&,u -»À"i¶n=Yî¶g3à|Æ×oËtUÝÕÄæ7áò¹À òøç¾�ÿÓš­endstream -endobj -4979 0 obj << -/Type /Page -/Contents 4980 0 R -/Resources 4978 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4918 0 R ->> endobj -4981 0 obj << -/D [4979 0 R /XYZ 90 757.9346 null] ->> endobj -406 0 obj << -/D [4979 0 R /XYZ 90 739.9346 null] ->> endobj -1237 0 obj << -/D [4979 0 R /XYZ 90 549.2183 null] ->> endobj -410 0 obj << -/D [4979 0 R /XYZ 90 549.2183 null] ->> endobj -4978 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4984 0 obj << -/Length 1278 -/Filter /FlateDecode ->> -stream -xÚ½X[o*7~çW¬Ôè {|YßNÔ›„6G:¢ÑŠÂBPÃ¥\ÚDÕùïµ×^ -a5jòÀØžùæâ{ÖØCú{ -y‚ _Ñ€{ƒiyc=}UÀn¹¬×Ë» Qáó%Qžò'Ü‹F)Ç>#˜xѰWÄJ–ÊD �Š›z[“ ±�,>÷§‹§ÄjóÁfšÌÖýõd>+=D7…0Újv†1ʱÑûG¡÷€¼¡6ð¦€|ª$óþÒäc¥ˆ7-„fƒ§B·p·Å± ©äÃr�{zF œ9H´¿Âú°R™#Tüi˜Œ&³ÄºQ% -ãj«yY¿Š;a5¬ kv‰Ï´²²ò0‹Á¡IaV& ƒŒ^nkK‹AlV�ÒÕ9„"¡IÃÅÓÕØŽþ¤˜Þ4,õâFÆNh¾8³Äãúe‘dôS2ËÈù´Šá¨çɰ<€Ì$cÆ<ã^%ƒ•Ó1zê�a%ô@É`Ò—yz‚þ—£üì€u”Ÿð��ò‹CûS~ÌaéRq2šél´ƒûz;Mĸv]mÇ�úÕu‰ªC_fýiÒã°mü0F“§¤‡‰„ù±3-™ '#ˆ�Ée‚U�bcRË÷\  I¨V/Z­¨_tZ•ZµÒ�ì$zÖ¶ *U.Ü4Þ�ðî>4 �ñ C²2_¶ÝøžŽQ‘@’*Oò:úÞã0º;ÍÐyé(¡6w0Ñ �çç!Üv¯b R*S3E(( ¹%hd5î†�oa'n·:[›„ä"Tõ°í!@¤`Ð$Ï�­Õ»Õ–6Ì!‚‘ÎË�Ö奤y›,òÒc›YiÕ@·ŠÈË�Z¨ÃÐ �(T(2/1*Õ¯:—�—P„d^64+™”’äúØ+ÝÌPh«%ä¸ÌÛÿ¸ÕŽê­fܽ¿ÐißVº_6´g’�€é´î#³yAÞH~¡Ö캤Ö-P�qÊŽð.®·+µZÇyà“KÊ0i¬ã¨~›œ�QQ'`Lá›óÇ%5ƒ£Ð©²•^¯¹¸0(K~C`uS$Ö(g96µÌA`ÐÁà°yèËÌ]m¯ÛKÿâz/ôÜže÷Ð0Ù’˜lIBÁ[O±7ª�öÇ“A<˜ÏŸ$ú•rz0EŽ’ÔJÁŠ]¦N×°òu# ;i¬;í@¦?§+�/$ÁÞÎ|ùãþR ”IŸ3Fޤܚ[¦Rø4bß% ÿNhDöÅPRÞ.Iq%,–«=ݽ™;6Ýò¯ˆ¡-FÈן&ìMVëÆh±^ž½ÞSj‹¶Œó b|ß'•ßÞc×ï?E‚wXòéÓ^þ@‡Á¹ 4õ¡õíëÅ£UB>F‰ òQ=ÙGÇ2Yo–³m'«‘ÎÁ »ƒâ¸Èv«ŠP_iþ<Ûÿ‡¢¢ï**Eô) ä+—ø±ªâ¾þ‡«*[Ú©*ŒÄ¿eµJ–&Ëx2|UWúK] -þŽ ß)!¬yŒ²}ä±R_CÛ»ðXÞá*Þ਒ì³}šL‹é½³håÛ]˜d×W`‚y½å`|cBž¾=8ãÿé™'}¨’ZS²ûNÅ}%¨4Ï8”hÁ€“­)ÆÃ«d–,ûëdh_¤æ3û{›7%ÌŠ7ÀÄý¢/„~!îIK7¹ÜR£aÅùÒß¾~{Éž½ž_ÆÉÁƒ—y‰¢ô™H°§endstream -endobj -4983 0 obj << -/Type /Page -/Contents 4984 0 R -/Resources 4982 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4918 0 R ->> endobj -4985 0 obj << -/D [4983 0 R /XYZ 90 757.9346 null] ->> endobj -4982 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4988 0 obj << -/Length 1353 -/Filter /FlateDecode ->> -stream -xÚÝÛnÛ6ôÝ_! À�¬3Ë;Å�Änâ®�ÝX0d…àʲ#,¶\Kéš û÷‘"eË2­¸«û’äA¼œ;Ï�4ò úGž„ž`HB¹ÍZЛªåó²Ûmµß®œ­¯±ô$�s/˜8 #ìã›# Ðq3x4¾�ˆŽ?o< -}W45’R¯¶ºÁŠ‘•ƒŽ4›O­›Ð+yÞ´ ÒgÞ_j�BÅÞ¬E1)'w­aëýŠŽÙ(\ê0D\úpO­ˆJ}°ROuÂÇmäCx´Œóûåü¸ÍÕ8]ä‹|iÆÏ͇¾*4Uö’€rÊ,61»ÿ:7©Ù|Qlb$‚Ôk#%?õ ��õ€ð±WYnî¯`@˜8cdoTen¤m‰ÂÒ¯©ÄŒJY>ʓȌïý0/pê�ƒK{µ¥ü„Ka‰qC`4‡ËøS˜,ÔhùdpERÙ�°�äæÔ>2L’€1TWA®ÿ8�Ì7g¥ì%1ý -®Ï­›ül>�‹³AؽþexÕ}ö'�ÎÕ+kZ¨P79ËÃp¦ML0´Î>‹gÑâA›ÚùÉ+0g`§TÛÒé÷}KÔ`Ü5˜<¹¨Áô€QƒÙfÔ(«'é<«…Méù�›m+j0„�º -¼!j°ø>Qó¶7 Ýù@ÑJ™ÈÃ+7¼>½ìồá¯M¬ üví_ÝÆLDÐá¹v.‡á°{õÛ#œw×bg!MÕ—<½êKY}I¥úÆóñFþðÀ’áÿUu} ¤&ySÑ%ß¡èv/;�ž&¿ÎÓ(lð4Šžœ§Q¼íiŸÓdìTßFa´ŒGyβ©ö¥euÝÔ-A]ø6bët™ŽÆÑ(³N÷1É�I“g–Ü!X¹¨€¼–ÑXY« Ô*Ëì#Û}²°—�0JW'%•Ö[ƒÜ¦*üÌ�ÈÅÚë¿B|ª’¢&>q9ÇN\Žb€›}…®¹dqnª\ ‹ô䙋tö(élÒÜEzú(é餅Óì·Uy`kA%†ÝTý-�X‘½YáhÞ ¶ØlïÍ\ÈgÉd>Ž'frÝ„gýË×a‘ßöÎ/.‡ÎCœ�fqãj€F;sä"S S2qBç*u»½¹YIf£i©|�þ™ÄÛÂU6›%d � -çO®QábÿF…ûV�^8N²(ýÏMaÕZÔ‘dCK!Jÿ]uÎ ÷lg”¶Ge¿Þ̈҇w7O�¬ß]÷jž6Š®V»�.“ýZqm8]*F‹Åx”�¬F1€¤.´*a§ËZ´ÙAÎv:¹ ÎÕ²"(»nèªo8Šf¨û¶27ÚØ»¡eRÔ‰ªÓžõÕu7cÞÀ¢öcîT;èˆ:ö2Öˆï»ØP¦ó�z¨ÔÀ¿éí½ø±ÀW(êž^ý­€)ˆ_¾­[!´˜çñ<^ª› Ò¹ù¾+oŽ;º·ý_|áKL^ê‡J=S-7£É1fGéÒLî{ ,àÇóí¤_¦ª³®™Gÿ0à°Ï„×cendstream -endobj -4987 0 obj << -/Type /Page -/Contents 4988 0 R -/Resources 4986 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4990 0 R ->> endobj -4989 0 obj << -/D [4987 0 R /XYZ 90 757.9346 null] ->> endobj -4986 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4993 0 obj << -/Length 1285 -/Filter /FlateDecode ->> -stream -xÚÝX[oÛ6~÷¯ÐS`o•Ê»ÄtÐ.n–¬¹4vY ¨6“µlU’›dCÿûH‘²e™–½yÀÙâõœïð~<$t€üC‡ǧ¾Ç1aÎ(éç^6w éve¿[ðvØyùq‡{œ!æ ïJ zAä Ç7]@ÏE>ðAw~r)‹t¡t¡ÿ%éDèÊÑl4OÄ´ˆŠx6íÝO;ýáB³F1ƒJï—ÎÍ-pÆàix˜Ôy”àAΑ“tÂUeÒt>,äèŽr‚Í> -±Í@æÈÀÊ@$íõµ}Ðç=@š§a.¦ãߪ¥é8*¢=—É^Ù¡ ®þ”£‚°P†:�C(p\(±‘ ”ü]ÙEck4+™añœ -%ø qœ¥ŠwòrkvìÑÏ?]^õ?\÷Ã�z9lÑ�‹ì«ÈÂ2’€&† RP‹•aœÊR¶U ncˆ©u>±¶ÒŸßö¡7ÎZè�û�ÞàÉo›éÍo˜¬ÓÛb¡›æsÝŸFY.B᫞ò( üÝC -H‹Ì8<ž¢˜ˆé‚*]å4ÖÀ\æ›(¸'e®ÄºÆ¨Ëß/¶°*¨®¿œ¡xaE*xeEŽ­­ÄÈ{|ˆ'%½Ô1ý°Ø.墵,‹Üw(G?ÆÅèAÉ)‡ùÐó1„»Ä‘ÖÛÔãúÌ“yl¨cFÝ(ÊŒËËáÉÅy8¸~{Þ†go¿ZÑÊ�F¤Ÿ»‰HFésy˜xSQ$QþùÅFÏ ÓE6q�‘ûIžŸíCx+ò«‹ëaÿÊ - 豸‹æ“"ÌfóBdû`‡p+vˆZ±�ÂAÿê×Mø± ÿ4W‡Å^ÀÉvà´øÙà8~¼ìÛa3#¾¾ÍÔ¸@žœ¢]“ `3®v^ò¸ð}ÜPîo·-hß -¥C“#»qÜâ� Äã}œ‚ÀVà¶ß3è‡Ã“3»[² Ÿ)*,âDì…oÇNZ±÷ÏíË�¨‘œ‰bžM—ômWR‘Ü7k¯om­¢aÅò•ÓæÞ®.ˆ]yuQ´*ÇU®º“!nNzFÿ·;Âxç¤GÞRêI�¹:´\è¦-Ç0Þûεߕ‹îåB ‹¬aŽ«+W|W^µÔ…È€}]ÛŽWýË÷uýàÀ*G�ÆÌ°H’YO î[–òøw1+•=iß,•J%hÓD€MÓè¡vúå^�µ†*c]Õµ%#¹ÖéQ_ÌŒp©ý9®Õ7ó!©Žýúf_KÒ­·Råeåbm¨ÖÍ®·1!Ʊ'º„Öè¦ù,=H|ës!p¸e{½Ø•oŽ�œe מ™Ç}¨9ŒäDÂЊÂ|,¦"‹ -1Ö�‹³©þžU…Ӥݹ©¨4¬ü‚C„‘y�”Ç -Ó¥»¢ÝY¦+ëϘŸž«̧ç{±öv©-«ô'¾ *Óendstream -endobj -4992 0 obj << -/Type /Page -/Contents 4993 0 R -/Resources 4991 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4990 0 R ->> endobj -4994 0 obj << -/D [4992 0 R /XYZ 90 757.9346 null] ->> endobj -4991 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4997 0 obj << -/Length 1339 -/Filter /FlateDecode ->> -stream -xÚÅXmSÛFþî_¡¦SÚørï/¤| `ˆ“”PpÛ„Ñ(èÀŒìHr“ä¿÷¤;¹~9ÉxÂLó2òÝí=»ûìÞju(€æ/ - @ʃ«» nÌôq¹å®YïÎ ¼t^a( 8æÁàºBà0Œp0ˆ/¶@;]Ìàv<¼š\�«�ËÁ›€B ã³Á•³�Þ`¦ÈÙÁG¥šO�‹KÄÆž7ˆ’,¸7�R8¸ëPLêÁ¨sÞùs†cª >w">x`fDµ?ظ'¬;˜ò�.‡pûEå&@!Hƒ.2J¨¬D~µ.!q07Ý}º?•Â$àŒ‘&Ýh^¹µ¶K+i (§Ì¹$¬Ky‰ \’�Vât^Ÿõö?@‡Q�tXƵ~'±y¢ò¿CYŒ¯¾EwºHZ ¯zÇý“q+“¢„{éÝâÕ°²¨0k«)À8]à¨ÈÂè&JÒ]K¢C± ½ŠƒI—,"΢”kËž}œö½ð¼wrØ?9ö»IgÛMpnó…íïÞ¼5ÛÞŸúw3ï,w˜ñ¸-&&-,5ë4ã$¿ÖY˜æ˜H·¥Hîtæºpq¬ÆÏ]šYGšA”1¹ðÏ~þu2è¿›%„C™&“0Õ÷qTDµIváÛ7û´&è/“$Óñ¼u’z•sè�EΤäºDjÔ½µeŸ“(Ëux—ß,.ï¹°¾>8}tÔ;ûoÉn’™âÖÔ©`³ÞA¯ÿwÏŸœ8”�™Žný"Ôù÷Ý»êM"Î8YHÏßWÓ³‚@¦¼õrõ£8ÎtîHÿ%õ¿ˆÐôÙs/.®¤í!N&%²îÚAéÌÜ1·“xUÂMV ÉZhº,ÑȦ¢-Œ¤º¸‹òÛ�˜`ML8°6*D|༉‹6pº"Ò̆haãðäÜÕ{�™fr#Vd+qš¯K�¸jb¥ œ®ˆ4±bŽy +±¾Ž¦#7ÈÆÓb#fD�ÌXàÐb¶ä‘ô©Â�<­WE›$›Y#«¬½ÓQ]Ší{ÜU™$uœ�â:Å®Æiœ·G�7i1æÖºQ –=Á¼œ}˶¼£VÚÉò£œOGî…㪀Wº\ôÞßßÈ\]6—)Í>G¸w¶>‰ÕÕKhظNn¦³Æ§™ué�U�ü²FÊ(q�_1ž,÷\Ö! ˜°M>¶#š�›E+‘ï�Ez¤íÝÙ’�+á¶ã�/L`>ê݉6r”.O‹¡®˜Þ«ÎU×rß»µº/†É,½óˆ;ê}Öi1�F£‡Ù>Ï ˆ -ïE4&#Îø]®U·�ÒlAÏ_švLY_ž9#JRŽuª3ÓºÄöFpœÚçõ�7;ˆmOÝÀ�nŸp“] íÈôXÜþºÞÁl{œÙÁ´l<*ià?>ØçáøËÃ�N—é)oþ<üü â¸=Áendstream -endobj -4996 0 obj << -/Type /Page -/Contents 4997 0 R -/Resources 4995 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4990 0 R ->> endobj -4998 0 obj << -/D [4996 0 R /XYZ 90 757.9346 null] ->> endobj -4995 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5001 0 obj << -/Length 970 -/Filter /FlateDecode ->> -stream -xÚÝW]oÛ6}ׯÐ^{ˆX~Kê°‡.ÑZžãÅZ�! Õbj²¬XV“bØ)JެÐr‚ {hŒÄ$o¼—¼È†òƒlÚ.s�O(·—k ÚŸåò{ 5fGÚ�î?üZo~Á¾íŸcn‡w5G€a„í0¹aˆÇv¡ GÕd.‡ Ž€z<Æë"zr±YVk‘ïâ]ºÉǷ᥄ûÈ 1F8Rqï­›[h'’à¥ñ=f?È È÷±½¶(&í$³Öo{m¨Lûcˆ˜6Èm¹âBÔnËýºzÅÕ&P—2ÛA�zµí‡ÚâÆ)²;ëåjSeÉØá޶"^ÞWéVè©x,丱e".E©Ç+± Æs(�x\fP.Cjô -\Ðx£áˆ0ã}86v�'ã>¬ÒLü DòÒ\þªaσ�¥uFL‚é…rú¾ÅN9þhtq› ­žqÕo|d˜`ö‚ jÒÆ¸Ù‘> -L€� =vxݳsþ»�7æÎyUâ| ö½Þ–°ÞÒ—Mš·L´=Y-‹e”æ©::¸Üäå®çˆ0„ïEœÖñ2Š“d{¦AÒ¼ASë™Èëâ©YKÆ!æ÷XÑ�ÒÂm1Vi¥… -5ðjlN;7®¶W‚–°Æùé‰íqHïÀYîJÎñ¡³\4ûú¦U÷ˆ¥Ô=qÀe¾ ƒh2›„“wS#(AÏÎE岓ÌØYç÷è%!xODVB~ÀC�WIå⡾møáÕl¡/>œÏÏ£Epý1¸ŽæWסŠt<i¢¥wʹó»&èì÷éô„àÚNKðSš'OxfŠçÓI0 _@‘ IáO"¤tZ…ˆ; BÄûæTˆøÃ*DaW…â¢XÆY¦ŽQ9ìÅ¢ï4T´-áUœ'™ˆ²<šJRBé7—ÊN¤„wS²÷•(w'Sâ¥¤Ì -ñV°µLÝà[sNŒ2É`O/ºbiRËÊ¡Œ{åxÒM=jtžÕŸ£ÕÃp£»ÕF’::îJW�®ýsîY‚Û²ëzÅ=¿¾:‹(ø¨Tmv5 ÎõS@.òÜ×fò)IûEÄè�.26p¥Å•BÿÃ�Â/?Ž~+‚¢®±E‚ò½�8ãÿªK©û,Oº ‚»m—m‡|�É.D>k%Ž÷TÕ÷"[y3ÝPÉ.ªþþµ\ŽUÍáæ¾Åä-n:2ùœázt7Æl´ÙêÉóÖíÓ×¶k{üúY<ë×T#e8¥�¯Xöendstream -endobj -5000 0 obj << -/Type /Page -/Contents 5001 0 R -/Resources 4999 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4990 0 R ->> endobj -5002 0 obj << -/D [5000 0 R /XYZ 90 757.9346 null] ->> endobj -4999 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5005 0 obj << -/Length 2011 -/Filter /FlateDecode ->> -stream -xÚ½Yms£¶þî_ái;ÓÍ�˜ ñžýR‚IÌŽc»€7Ílw\r¬ .ङ;ýï aÀ ۙÎfÖz9GzžsŽt$†<þ†?T$…ÓQúÛ?|ÄÍ7@ºG¸T¸r×Pjœ&Cy讋dÀIÀ¡|ù qðl%þCðäï|îéì«ûi(ò*ÇK23�¼�·L·šˆà�äÓü9øò•ϧÏ š* _p…瀦Ááv B�V6gðk5NÙQ(°èH@`ó"‡[ %1?¥Æð|ƒPº*q ã¨DçEAYاÄZ!éIã}⣖ÔCyÉkY^ÇÉ6%æ 3bû89´Äû¬›´Üÿ6Âuè{9z2¯—„;”lÃ,Cç.‰ŸÃ€Ö²'/£%DÁo6ñK=–U?Ž‚07í¬ô\¡Û¢ì²{`µ÷À€+Çmz4m†{Ý�~P(û4£�™yÔÙ•]¼‡ø¹Ò¡k¯¹öòRG¬C�â,ôÑ9�6$ 7!…Eá×\ÒŒÁ.bSø/Ü¢„,5Aå „·­:bÀ—�5@Ux—±á)cS¶Ʊ±qH{ê�÷Ø[åd ŠMôà ôÔIÿ±Á›¶Èå -¢Àñ‚ÚrìO!ˆýýE™×Ø·.èVã Iqëáý=ô6)k8lR£ºG¹ …ÞQ#�¨™¡ð¯š7ò¶­äTuµ’W³t[K=¤Éû°ä'é‰0ûû`ë‘è~@U ñ—¿( -𴨙° ¶1%S® -6À®z¦ƒ¬±\;FÓx�½ä›h·c¤þLhf*§Ø!?O*_Xå¯$O'Q-»¤éA"¿�eTuÕÒ8Pz‡–;±r†™_»wºm’È!­ {þÙ›ã²vu_þº*6s\Ë]º¤ªÏˆ 1Ÿ¹¶uµtç6è�?t‡ýóÏñîÀR{“ÑgŸùÛÂ62ßÜ&óÞ.¦e‚™Úú̵Lçœ21¦Ë±5»!uŒ�,º9)L­[Ë¥úîüü`ŠnZo( •ëò÷Ö´� îЯ¬©åÞ·Œm¹³Šý5¥¯‡ê¶kË©NšK{1wNp€ý³\EcË1¦ºukŽñ`afjUâ©ÏæŒØ×™èÓééø¢\ŽÃëʤNÒ¯¦§Ø€Þl¤á5¶lÓp«ÀiU ¼^°k¦ô6±0 «ª™¿™ØÁº}~ÄÈ1]bE,{>ì ¬ßê74€òKÏ÷F:Þ -Œ¥mÞV£Ñè,¯^º™ÏÇÎ ý µ’cÚŸ-Ãt>œs§µ0–ŽIÐŽuWoÙÀKƒ*ÓÖ«¥c–‹5sMÛ^.\k>+.‡Ý4ÄÞ4&ó;ïÔã:;n-Ýù¬jx%Ìíû&É<Æ‹uOøÝML,Fw¹Ym‰èUX:x½î 6Ro6mÔ xQºŒh#1fÞL­sf´VôþlU^>o¼ŽUß±D7§þÉÝYºòM€;1ºú=Ø?¿¹Õ‰lnè3=b{IÖq’Ý[ bçˆ -ó«"�O@–äõ¥¯ø4©b•|+¬}É“9MTú�€È©Ý %^ñ±"ÿ<™¿iæ¿·´ðé Hö¤ÈGLÀ_Báßì‹Z~$)Kë3(¯my¥8rÒ|x-Çñ_¯�(j›'ÿ ɰÏ?,¯?€endstream -endobj -5004 0 obj << -/Type /Page -/Contents 5005 0 R -/Resources 5003 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4990 0 R ->> endobj -5006 0 obj << -/D [5004 0 R /XYZ 90 757.9346 null] ->> endobj -2465 0 obj << -/D [5004 0 R /XYZ 90 739.9346 null] ->> endobj -414 0 obj << -/D [5004 0 R /XYZ 90 739.9346 null] ->> endobj -5003 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5009 0 obj << -/Length 369 -/Filter /FlateDecode ->> -stream -xÚ¥RKk1¾çWzÙ-lœ™$“�Ǫ}…–îMd±ºŠà£-JÛßìfÁ½•2¯/óÍäC á ô �uÊkÃr¾ W!ü °Mg!Ÿ]Ü¢wO^zå™XËæFe I‹IB`ÒŒ8HŽO/Á´� ‚hŒ~fÛ�M�á~~ÜV»Ãì°ÞïÒi1£âܹ%f5cÝ÷SL¦ �àX€Ò>·ò;8 Ð{’[aHŸœ�x¯çwb¢tÍgQw È2Dài@ -óº8sM5 3¯ ƒ®+˜§$7Õn±^F»×ÔYR ”Ë 3“7Õ·MÆ+ËåE¼,‡�ƒ—AùX–ë”Î�ïÀårº„öº–Š -�ëülÝ‘-ÿkß�bòAM—‚á°@�×ûÔ€†éL¥¦úPíª¯Ù¡ZDi=4÷óɧh“cë µ7ôI÷©Õp´–)Ùdÿ�k¾ÿžô÷󻪮”WK¢cKó±nendstream -endobj -5008 0 obj << -/Type /Page -/Contents 5009 0 R -/Resources 5007 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 4990 0 R ->> endobj -5010 0 obj << -/D [5008 0 R /XYZ 90 757.9346 null] ->> endobj -5007 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5013 0 obj << -/Length 1250 -/Filter /FlateDecode ->> -stream -xÚÕX[oÛ6~÷¯: °×ˆå]R»X“´K¶µÙâ< Y`È •%M–rÁÐÿ>R¤É¥ì&Ð6�A‘<—ï�ç;¢ˆ(ÿ‘@ÇcåÎl9€Î¥~7@fÚ•ón[àÍxðü-œsg<¯-pFØGçÃ�‘‹Š›p™'Â]†qšdYî^Çå ‹‚Ã̤÷ bÈFããÁáxíÕ€b„#åóŸÁùt" îx |æ\Ë(°³PLšN28ü±¶£'j[l {pˆ9‚›è° Ök‡ ÜÝFH>ùžãA  Ç;‹ý°FØmKkpÜ‘p=ˆl�€‡F.—È~ˆÓYREB÷žTqOiÜ å”Õâ¸O|=*Ī’Šò:+>º‘¸Šg®I­š‹²Ì#»³*”ñRvnóŒ‘HÌãÔØxsöV?ü T¿UYT³R�©èE¹˜,¢¢6‡¸ˆ‡™ã"™GÔ¯­þXOQàùØi K[è©20­æçðBukAy &!µ¡ù¸�ñ\»6IØãµ]»ÿß_í�0pÆÈ—„­ÑºÄÇ€qÆ;!¨#ŠÓÒ.2 «(¤6â*‹£õªmˆšdý×6§(é/ÚÝK›5bj‹â<Œ¢bÒÈ×=«3Jí$©“P?梈³(žMê±==(é£ûV‹¶ËeC?™%AÞCÜ߃{½‹‹Ûi%—v‘­Ê®­^MfäÆ\]wGæÙ›ý¾^ĉPꨦU/ƒ°,<š‘jÉWºÙؘB„Ñ6D[ñ\‰u,¾Ö ÜŽ†È9Š×d½v_—·¹)߯ ¬E™¥+5vt29ÿ2þëäprt¢Lï0/K £&XÅ�8×å§7"ÒRˆÓ¼Úº#„i]å邸´—B�Jz47õeab §Ù•yœW鬌³´©§WÙ,¼ëbU%¥ˆšYÝFa6C]€]ÎA@»¼$²Æyj½W‹¬JŒ�©ñ»MQͪæ!Ý€i2docø2ɦa¢Ÿ¯Â"§‰°-7î;©¯ÿMÑÍÌš4“Jt³ -ÔÆ1bò(Hð=^]©Ã]XžÙLJ籤!ç­DËvdN`ä7'·`+ã(4H?Ù&2}Ò@E²2ËvvýüçЋnÒKþ¶ó‹’ï�1”~UÆPöM2†òÇ2†zd€¿�Áš–¯ hDæÖÃ}Œ7y\ˆÈrPÛM† &mJ&£õÄ×/#F}žésFç… _°ºùI7ŠÈòd÷þ´™}ölFÚ"rƒ«öÖ ‹}oDfü«™yß$‘™ÿX"³à~¯>F|޶Ÿã-ÄçÄ6¸¾¥˜ß‘æìàÄ&ÊFAim 7/Â@Ô³^ÎAI$¤>¹sGVßðùRÉÄiÝ�I²xÄo®™ ù;‘Š"¬§nù%Tû{óp> endobj -5014 0 obj << -/D [5012 0 R /XYZ 90 757.9346 null] ->> endobj -1366 0 obj << -/D [5012 0 R /XYZ 90 739.9346 null] ->> endobj -418 0 obj << -/D [5012 0 R /XYZ 90 739.9346 null] ->> endobj -5011 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5018 0 obj << -/Length 790 -/Filter /FlateDecode ->> -stream -xÚ­VmkÛ0þî_aŒd̪t¶^ÜÁ`[»Ò ÛÒO] N¬´fŽ�9vÚ2ößw²ä.I�.°Å�tº÷G:1ŸâÇü˜ú’K‡‘ðg �ú7¸|æ1Ç�lnx?öŽ>BìÇ$ üñ¼Õ áÀÀ§W b€¤’šó’œ¡–8½OË\ÛÉI9kº¨“:+‹áõøÂ;?ZvŽñP0c÷‡wuMý¼ð( cÅý;œPÂâü…AØMrï«÷ùQ�e´}ñqö(|\‘”uÆ+m|ÃãÅè²å¤I—“¥®²2Ífß(§þ±7&TÄ$·RÒIµL4ªHùC×p4[^µœ˜p�¿±~>%ë[m‰dZ®9oŠY›½v–ër–ü™WzÕäµN;®Ó¤N:�IÝ „ qo{¬†�ܵº-›Üé˜:»+,›¥Ê¦#Š7 ]ß•Õ÷×;Ë7y9MrK¯“*K¦ˆ‡ž„ÅμIs®»W�}gµ.]N:…yãì¼µ%­r`ÑBOÆ#"ÕVÂm‰`¦è¶Ü’ÔÕ1››zo9×Y4°äÏžÀ¤á XR-'˜A£jr$¸ý.Ÿ“T¯³™ž` ÒgåBçé¯>f4 "ØÇäÖûh!sàs°"(ì…-ÛÌâåùhry2j¹¡"À…Ø—|Ö“}F9ÊŶg¢Ï]éb±’‘$ -¨<èh}Hò|žï¾ŒÜJ¶ÐUß)Ók]=X’Ñ޳²HWÔ:Ü-( ,‚¬)˜ÅZëÐDß/³J·•iÐÓ® üu±CƒÕ‚7ƒ®ŸêèÑ¢÷Ýæî½ÈSìp)„sH÷1³LícFŽY麩\1h¯À½ZÄ& ±T TxP©‚ÿ÷³‡‚+"8¾’vÛ#CÈÈÞ¶MëLpñO�³íý -E^›­[… •éŒ! `$àÑãê™.t•´]Ç4ysjÌø©#.†Œ7aàFz á1¸WbGXj>>(+;yúœ˜>t/‰û‡ýä aš{O–~éü@endstream -endobj -5017 0 obj << -/Type /Page -/Contents 5018 0 R -/Resources 5016 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5015 0 R ->> endobj -5019 0 obj << -/D [5017 0 R /XYZ 90 757.9346 null] ->> endobj -5016 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5022 0 obj << -/Length 1194 -/Filter /FlateDecode ->> -stream -xÚÕX[oÛ6~÷¯:`°×ˆ%)’ÛmKº"Y×fHúÔ†bѱ0Ere)I1ô¿—]É¡�K‹uµx;WžóR$ÖHĵµOÚâgž#0ö‘I(´q?äå¬h3eG�Ú|‰�Œ=Zx¨}Œwätù4­·°D^–R5WUýO˜©Ë|¦üœÌ˹hšeægà^†&¿PµŸAxæbËö¤[r� ‰Î -–t?u+ Å %Ao>üz¿NCÄ$8�¶)ïë¶Ö†QB\ J¬CyÙx¼•vÑ$åߘãË*ÏtK<”[Ò}k:�HJ¬¶g>2 -d&aòešeõÔÑw#/SL«¦ng@ÞÅÔv—ªÎ«,ŸM»9¯æ›ä ¶c›®Tcüÿq(mϪØùzÿ�éÉóýׯ\vt 5{åUéË,ƒJHþ©Mþi^æ�ò­Â’þ¶ÝF,}°Å76ÞȰ=p’HºGD²‡÷¶zEIOŒÞ±Eµj†²¶rRߤ‹lé[=£¾0RÆ«E^(ÃNºüÝšªTLƒ…*-å/¶ÙL­Òl§E1ÈÊç†l ñWÛà[¬Ñ¡etÚe»{$P[¸³%ú0ôÔ©«§Ã9ge1=«.¡;oËY“W¥«—Õ,ý<®Õª-•¹UÛfi“:‰©-,¡>£DëT[54zõYW€�3P¼R®\ès:å†�’½�éó¢:K Û¿Lë<=+”ïð! ~›|åô»rRÁ¦8�E«†aD�pŠ9ú¼¿Ëq%™Œ!dh…@>8q"�În¦¬ÞÒ�)1ÐüÑ·È!Ÿ?ZŪXÁ6X;m©T×˼V™§\¥·˜-@½¥sË[w·Zû¼²Eg€^ü ŒµÍ϶ysx<Õ…ûÕ‰[}üøØZgW§m«Y8lÌ×8ðã’þ׸I&‡W+ ˘~3X2ê¿, ×·ùˆÞã¦D‰¹£s:4‹B Kfn»âþ°d 4û`ÉøÌ2ßMƒÅî&<ÿ ‚7Ç>Òäa�ÒÒî+&{°j³;B‹ãï Zœ|Shqú¿„�¾Zœ= Zœï€; ÅŠ´$HCЦÉ�n^}èE ¢\ˆû܈¾rèkÇð“Ž'ëƒÚc¶„+±oQ¸/�Z5m]®Qî¡„Xx¥ÐÁG²D„&Ñ÷ñ‘¼ùlDa±÷5 ë`ó1ý%/JÝ“X¢YˆÆPïÅH×�8JÜ‹ aŒ|¡JU§]ñ1Ïb¦:˜öO×9š>na`>¨»?¥ÑSó•gF:Ÿ…íÍ'”�«ÚÚÃc F@xöÁ¶Õõ‡s�Æ�í1Ï]žýù<³æuendstream -endobj -5021 0 obj << -/Type /Page -/Contents 5022 0 R -/Resources 5020 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5015 0 R ->> endobj -5023 0 obj << -/D [5021 0 R /XYZ 90 757.9346 null] ->> endobj -1367 0 obj << -/D [5021 0 R /XYZ 90 739.9346 null] ->> endobj -422 0 obj << -/D [5021 0 R /XYZ 90 739.9346 null] ->> endobj -5020 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5026 0 obj << -/Length 1686 -/Filter /FlateDecode ->> -stream -xÚÝY[oÛ6~÷¯02`KŠš%)’’º®h×t]ŠnËP{h‹@•èX‹,yºÄÍŠý÷‘")™²dGIž–<ˆ2/ç;Ï�"šBñ�¦>œºÔ¾CØ4\MàôRüüf‚t÷Lô϶ü8Ÿ<ù ûSø ³é|Q¯À áé<úpŒ¡w2Ã.táquv.š#Uãõ—`µN¸z9ÍÂjÅÓ2(ã,=ù4;y=o$k`ÔaHÊý{òáœFàÛ ŽïÑéF¼@€|OW‚ó’LÞO~oÖQõ„>ý(rúDˆ_°Ñ …]¥ èÉ A�—Xœò0 ò­x`y³][�´o{Ëe`ÜLXd‹�ÝNSšã@ÿ–;ã…´8à´·�`žFI”ÖºÇ�MéŽÓÆÚ84naÑvÑòt0 ׂ°‹u½[A+¤¶ßk|® ‘ ð–åÅîÒ³‡û«%8T쥃Â{w<¡q][#z?bw(˜š—q�Äÿlù”ñ˜NZUESJɬ—É�IIÒM�Û ­;ö"ÏVï(nŠ’¯†•‘ÞÓäã•ɱi‹’ç:[Äë ¹‚�âb�Þh $U<ÚçÊþCº2�J‹ë,ŽzÂ7A»>k(�Sjz¦a5ík_ŸÈkL¹Q±ŸÜW ЍaŠvS(%±ØecžYÞ�ÕÚæÌžÏ_éÊ}ÝTÿòk‰bS"\g µ>Äó:Ü­©4Pòöóü·_߈) l£Y‡)íóÿöõ±ÿ[„#î="ïhg}å¨].ƒkëìuBËgç/ÏÏ_½|÷NGÀ ̳Æ0]˜øw;Hhgž6 šº¿­[ìÛÖ­Esjý®Ø=< ‚¥ã‹°N~˜ïÆ| ‘ -yšú%Oùµ‰¸AÚ9i‹.SgdaXå{b/½[ÆÁ%h¡Xß -R¾Ù©-E¸LŸ…£/yô¸3% -J½J�çñ5/LÊ‘ú ë0þ¬Ö -j¾t„Wi¶ _6°ÚAòÈYءԜÞr^æAZ¬â²l&ò2JMê> endobj -5027 0 obj << -/D [5025 0 R /XYZ 90 757.9346 null] ->> endobj -1566 0 obj << -/D [5025 0 R /XYZ 90 739.9346 null] ->> endobj -426 0 obj << -/D [5025 0 R /XYZ 90 739.9346 null] ->> endobj -5024 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5030 0 obj << -/Length 1036 -/Filter /FlateDecode ->> -stream -xÚ½WmoÛ6þî_!ôCcÑ; CÛ¸YÒ-ikûІ"˵0YrõR×ößÇ7)’*ÅvW,�!éŽ|î9òîxDÿÈâÐr© 8q˜lFÐú$Ä—#dÔ¶ÐÛÍ/æ£óW˜[p†™5_)†Å[óåû1tbc -Çë0ŽS{7Apœfñ“�ókË�€” t9C.¥£é¼6iQÂ�4øyôþ#´–‚ÙõÂ=jíĈslmF&ÕG<š�ÞÖ8Z¡&ô9FéóŒYBâBTy†…£®vŒ1åöãØ±l$ÀO©~Rá9s°Õ�ëpb3ÇÛ,-Ò< þ -ˆýLËL¿øÛm~¥I~¦Eyáaõš•AQf!P–lâLûæPÍÏ=ÀÏ®‡Q“ß¹A#ÀqJ Í›ØÈ“LW …e´]i’„A.¥@ü�üi~+ ØFà›@¡|3»}ùzqus5—çö³íã–ý,J¶eqW®VaV £¿ÂTm«+‹?÷Ør¡aûOŸõ ±™q~`ÕìZ%—qWÏ&'Ç«(ñãxoœÜ™�ÍJá²*“@†E5Î7r_„DÔ_k?YÆa>®óýᤛM™˜ðZöGÅ×ÏsÓ1£H£¤MxiÇÍF¼7£}˜>=™~ºêØ Ê, “¢òIE³rhØ*û‘9åº&æôf-î)¨h nO3î�m®uÚ*âa�ÅÓþqÊ¡b‘(Å'-’çâ¸nË%ç’]«‰é¡³T˜´¸Ì×QÀù÷æb•}�xëI›ç�¢ÒtŸÌýÁM™W9ïü½á—…â$1#ü¤:� -S™îÊ¢;9 ¿ˆ<æMNæ~•ÙUõjR²+Æñ·:U$6"‡�+~f–z-—aÒ>[ë}PÐü�“ùoü Ksð&=9!MN`8‚4vï~Ô;ÖS<·�Ý -£º3@vg‹�ìÌ÷¥#Ùï™Äª`ÒX¨©KÚ\¼áæÀã¦êæàÅôòê¦î† -!‡}BÔBšMo.³ù»n«ñèWépuvÕ‰[¥ü¾nÄþò'y4È·L¾›>¿˜ßv ž)Œ³A b0Ħ$ÁvoúiýèæH~¨+âÎ KcÞ±èQX V½(¬…òò·ÛÙôð¶»}B¯…$èÆáÃç(‚­S§NÂþ4øÎÑjF÷ö„rÜÞë¥ 1ÊþÓÅJÝ =1ܼ2Q9ˆW]œ Iò2LÂLT˜¥¾ÊÃI>¯^®'ˆŽKó�°y§˜<ÅPa™~[M0÷IýQ^½1£�x·×Ï‹ôëþ“8:Ë#o}=ëó/ ñ¦Áendstream -endobj -5029 0 obj << -/Type /Page -/Contents 5030 0 R -/Resources 5028 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5015 0 R ->> endobj -5031 0 obj << -/D [5029 0 R /XYZ 90 757.9346 null] ->> endobj -5028 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5034 0 obj << -/Length 1357 -/Filter /FlateDecode ->> -stream -xÚ½X[oÛ6~÷¯Ò»¨ÞEuÃÐôšÙš­ö�†"ѱP[ReiiPô¿�IG’©8N‹Áæíœó�Ã�ôá¸z{®š Ž€ºñêk¸ÎWRw^fQµ–i–I–N>ÍÞ�^Ͷ– 0F8ªí~]|‚^¬¾A@Á¼kÕ�öÖ#Љí¬FFnõè‰FÀåCÄí ¢@�`ë!VûÚÁðÉAÇK¹ZeÓë ‚ã¬XÅ`ÙwB0‘ð=R ´!ì@±‹§íÕ÷@"‹Æ.¨á É”+,ǵí-ê)R.S¿Yðøq35ÝÎ y ôf K53`œ"¯5þÆq™]Y•kÛažo´ L@€  -i(§¬‘ bÀ†ömXÝ£�_àŽ¶cã~]e¬™‚�1>OqGw #¨¤’T H]ƒlïعIëå2Ùôù}�Ø;ðÒŒ¨õ«*–&\Þ'9XÚ¤`VFašfeGªµx˜(X¥Bëê9#JÙúï·çó“óó'gg.æÈÓm‘!,.]†ë�dÛ<¤]fpˆÅ½ö±�—ù€ˆºòqØu±úP"DtÁù.Ä⮨'iRî ¹+1ø3á®–„â›ï“¾˜ºçg‹ýêlÅ~è«ÀÖÿ6üÿ#é?}!€¨ï|’ƒjggü‡^Åšw=¡DÁíW/UÓûЧ³…G°¬]°Pj¨od* �7ë¼ú‚ªÿ·�wÄÆ•é¨O]ýŸbò›@ !׭ųq�ëÎîSa}³éW¯7Wrç}°~¸sDé?TÌ¢endstream -endobj -5033 0 obj << -/Type /Page -/Contents 5034 0 R -/Resources 5032 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5015 0 R ->> endobj -5035 0 obj << -/D [5033 0 R /XYZ 90 757.9346 null] ->> endobj -3302 0 obj << -/D [5033 0 R /XYZ 90 739.9346 null] ->> endobj -430 0 obj << -/D [5033 0 R /XYZ 90 739.9346 null] ->> endobj -5032 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5038 0 obj << -/Length 1998 -/Filter /FlateDecode ->> -stream -xÚÍZko£Fþî_aµ•šT1a†›I_U%6›°rŒ xÓU[µpŒÖ€Ëe³Qÿ|˜ƒ�²x·Ò«½ÀÜÏyæ9—ƒÆ,ùƒÆ2;–‰‘9^;Áˆ?’ꛢÍÒ>©w¸¶F—o°<–YÄâØÚ3ˆˆ0ÂcËýíLf¤ó سøMϼ$Ú}<—Ø3Æ9ÿÃz;æÙ)à -"™<ï‹ÊkGªU­H8åëý=úívìÁÞŽX†“§Âø‰XÉ2#sPØ�ÌÑ/կئ&í›&ûßÂ.}UòO�‘_~•üÝÐrÃs«Y´ŽýÇmzðÔNᾊ"fYVcÀ¾ºEÍ«ÀÙ«ÖF©ïx°.¸Ç—G€Ú®4yص� ggûAåyŽa¹©Øyx -ƒûÐÛÆñmÂJ7s¼/\þÿ¼‰EÞ¿sxv¸ -nädyÀ´¾ëÜMDŒá|™’“› 9AÓ9ÈÕw´‡5üðˆÀQÖTW‡`€HPËnûέtùå]€ºQ ¾& :QÚ“òxø”ä…À挫#Ò†¬×&WmÒ§ÊÿA8(›öž“;rÖ�âܹá¢>Åy(k‘!I^Ù]þ” Ì�Ö­Fs7›(™ªñN›©æ�TNÝlqmªTÚ¹b)-Œ‰„ý0¸bÎÚÔ–½nE~•¡--Õ0Ö+KÓ—‡cÜ­~O( ;®aç-ëÔ—-ŸGÈ®ï›Jæ/L»çbN~¨º¿UÉjà—/-C©ØmZ†6³^ˆÑÔÒ ëÛzd~~Zª7 íF]ÎÔæÚz®Á½fªÐC3óåjUøÞ+îºÅêÊÍ�mj·h}lI!~^Ü—®¨ÌßiY^H\´©Õ�ýÁ0g·` ¹è9º â)Yƒ }�;$Hpí8íH*«Ÿœ¬ÙêÞ“Ôv>ô)5=I©áá;ͽªß^1ÎýQ1Bu…#^’¿®tÐ/^‘3'½ƒ õý�ê»n½Dö½Dô5oÍD|ì÷X®”ý[?tvœÒ¿¡ l¿96„?:$ó÷ý…c ñÒÑ�!X²]HÄ/ú.¡ø¢bJ† ׿;Yâ¦ðK?¢ˆ]^èÅvq‡“U‘Ÿóòç¼¼=GÂYF Ó'{…¹+Ì–¥œ0åÛæ Å�(/†PôfhÇüw†ü9�>=?’£B žü£‰#øü ½ˆJendstream -endobj -5037 0 obj << -/Type /Page -/Contents 5038 0 R -/Resources 5036 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5040 0 R ->> endobj -5039 0 obj << -/D [5037 0 R /XYZ 90 757.9346 null] ->> endobj -1567 0 obj << -/D [5037 0 R /XYZ 90 739.9346 null] ->> endobj -434 0 obj << -/D [5037 0 R /XYZ 90 739.9346 null] ->> endobj -5036 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5043 0 obj << -/Length 1362 -/Filter /FlateDecode ->> -stream -xÚµXëoÛ6ÿî¿BÀ¾ÄÃÌò!Rd7 ð7K—ș݀´0T‹Ž…Z²#Ék‚aÿû(‘J¬úì&Ý -0÷;Þï%›ñö Å|áÍÓönÌòY‡¸ížÙïíü2é¼xM•§�Tx“EÍAÄ)¡Þ$¾>1ÿÝ p€O¶çWfÈñ AØwQºYi;9]Ï·©ÎʨLÖY÷ýäMg0y8Ù Æ™ Õ¹·�ë÷Ø‹�€o:1%¹÷ÉL0"JQ/íø”5“UgÜùý��ݨ�~œ0HAᙕ“FAjô ¬~Bt{ã“ï’l¾ÚÆÚÎ~*Ê<ÉnÐòçJû§�/|n!´(>‹,Ö ; §­r´†0Éôm=z‡9þk�Ä5’`Ž(æÜ룶/kß×[> -$%ÞκA\ïõ6:Ê@´°;Xgqâd|QÓsЦ8E!.üÖ)ZQ†Áþ!Ñv1öãHrÅÚBÀDÝ•Ž(D¨díƒìIÄGæª[g½#ÌO²RçY´²\&Kgä4ºKÒmj'Ù6ý s;^;käÚ\¼.ìäÓRgv�;Øñbí0‘c¥Õ²0,æôiwå,Â|£V¤­=ä²ÿçl4˜ŒÎc» !»ùÐ"ÿ&Æ< � ©.ŠèÆ­.uëÜ„Џ:ì!�A(6>âm\�š¨ÜÎK;޳b¶ŒÝUü it{DšÍ-3Jâ!JÙPʆp±Šn -òÃ΄‚H(’�]f¯/úgÄ\×øjŽÝž_±ÇwL$>Êdxõjx:˜�'ýÉtìÅwäDžÂé<|;UBZ³Â�#IúD¡ÂÓþèÔnV Tì(«þtòëpÔŸœ¿5"1lù@n,ý£|&£iøÊ,:I(Ä�¿.£‡ô-JJR�ÓÙ¨ÿ‡ï98 -ŒF³Ëþø·gÁ ˆ‰ü"“p>z|#êËLú—;LÀDáýø2)õv«‹ª( xQÄDYñIç0‚ˆm¹ÌsÀ@€¾+óèÂùÕ?à&‡Å·M¨Ö@rµ p›»‚C F>!äYùÕ—Hˆ �`U'Ø]A «šÌi™SÃZQÿPѲ¨l®çë¥Ï蚨Ș•¶ä%ˆ¿ò~£!/&¼ù** -˜º²\]Ó÷09r+�Á´~C›lfÉ&Šãü¡8×3Å�„(Á\|ººÌ4Úvh‚¡üZÕÞÁlNǃ¦Ô�Xuþ0_IUq€ - !ø ÒT„óðÌ®PKbOëJP››�PzjjÀpäZIJ½¦ÉDl »ñ÷ˆË¾jÂ÷H]S“‹}1ôm¶†‰ƒ=b�£Élóe”?:Ï5;D}�_S|̯)è+”_šÓó«Ù«aøºj9‡ogƒÐ~(@x¨û V¯�×N›&L¯ -ýµ_�Ǥ5¾‚¡‚çÔ4" -ˆ >•?QÑçOü‚“¾|Ríûÿõˆc,?“55�àªz ádþ…ÄYMŠë¶ìpT00O2²ØS—QèY‰˜r€Ï]ؘž.þÓ‹Sýf& Ä¿ûdfJrÀdõ¢Ä¨V]^#J%ì™ÎtnÒalÇÖ™ý¿loº„Ÿlݤ~c«þñKÊ^R÷ºfR¯°£E—òº¡©&ûÏp»û½÷öV=ŠVúÂbéôendstream -endobj -5042 0 obj << -/Type /Page -/Contents 5043 0 R -/Resources 5041 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5040 0 R ->> endobj -5044 0 obj << -/D [5042 0 R /XYZ 90 757.9346 null] ->> endobj -5041 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5047 0 obj << -/Length 1592 -/Filter /FlateDecode ->> -stream -xÚÝY[oÛ6~÷¯Ð -t°ëX%)^›u@‡zEº6ÝoІk+‰ÐXJe9m°ö¿�eI¡oX÷Rû�’Ïýð𣄤ÿ8P(L„*¢<˜-:(¸Ð�Ÿu0�š>¨OøeÜyø+Q� -'<Ÿ—8Á$ÏßtU(zÂP7ïaÙ�—ÙÕMO n8ë½?(’!b\ 7s ŽÌÓÎp\iƒXıÑ÷±óæ -æÚ°çFJ²à“¾A!VŠ‹%‘»¹êœuþ¨äXBÉàó‹áÈçô�°sŒh?…õ GQoÀê.‹i‘ÌÜu¾šöz•\OVóëÉ,KÓÒWLeH(%ÁkC¨,Å<°a…$8¨=ÏËHYæRÜc;œþùâÅqÉ3À, -áÚpRN˜EK*j=eÞ§Ü -}XI*Œè&óêÖ ¾Ý¯T1rÆ¢½Bc­DŠ„˜(ÙrIìtéd#Ô©nxõV/I‹8O§W CgŒqÞR!w„K…ŒÓ†É¯§W¬]Åež­..íÍÔ³lq=ue§³lÏíÍÓÓ3{‘N1ð¤@Ëãb•§Njì¸�š�Û1)Bp% -©Ð.4]Q;\T$½N¹–�¢ƒ#`b[·x¼ÑâÊãó6ã)>´l¡rˆ.6EhKùîÖõt¨UºL.RW_³ËinWÖ)cXúJ`MkÔµ"®§ù2ž˜\½E m¯—º�îÏ�«8¿Õ²0h§:÷œà–kÌjøÇ×Ö¨nkXú�µ•uìeÞ§„ͳm*Uo!#Úuk3Iï'‘¤r¯L–n÷ûÐÛ¹Î'窩„!Ÿj(«úÓerU&løÙ¨ŒåfÓ™.|JªÊg$äˆølv‹°F¸Îu¿<7:ïÝŸÝ;*§U¦ï봱︡á€ÊÇ -‡D’Vå³|ê÷KÞ|3 -“A0‘ýê's [St�¢Hr�ñ®™øÞ[à�‚qИcÖ.UûÕf¾ª ›"*z@†¬Œ× - -êTàPD¸µ8™[2wdÕ³×c¶Œ´œC -ËGk¦e5íS`_}Cª9Ú·öf�#Kýê%âïnáäT<:NŒtk÷ª -;\%Ë¢ +ÌåX “/c˜�¬¡Gî`Vu‘Þ:âD^Noâ-¸„ÓƒÝI3}ÃÅû8®fâö0�þŽš6/³#çM:³UјemoƒRœ}K(Å¿¿cw¡ÔM–̽M@:¼Ï>Lâ´Ðé[šŽf*`ÓfR[¶h�ª†u¡ ;Îïž6çérr9´UA¦=ÜÖLî͍Ö}ŽF¯FÞ|K -bàå×y¶Jç혚ë£õ»°5­© /Ú÷CvM¢�aµßE*´§wÑIáÀÚÚ�Ë)<«àR¾J+Äã`€»OÜEvWYÚ„iü¹°Ök‡‰b­æ©tÅKZ¾¡*zZŸ'9ƒ¸×' én9n-OU5㣺ì~¥Ûg•Úå7Š{ä´W…Q*áam6Ÿjò±ËÊaUÕà º0³6b¥ê%únxj–ˆy«¯ížO‹é±ï[1Þo'HW¹Úü?}Æ(?ÀHÍ‚#Rÿþ¢ô"’î3al~§q®S<·aÌ0ãKwñ¼‡Yw7˜Àˆ‘èAöN‡”Û«óaÝ,·7«“ßavßßÚñiöùö"NÛá1ßX<ñù`ÎGEendstream -endobj -5046 0 obj << -/Type /Page -/Contents 5047 0 R -/Resources 5045 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5040 0 R ->> endobj -5048 0 obj << -/D [5046 0 R /XYZ 90 757.9346 null] ->> endobj -5045 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5051 0 obj << -/Length 1707 -/Filter /FlateDecode ->> -stream -xÚÝmsÓ6ø{~EÆ¥µÐ‹%ÛlìŽÑЕA�6Û—Ò˹‰ÛøHœ`;-Çß#ë±k;r›–}\j[Òóþ*‰õ)ügý€ö=é‘@¸ª?ž÷hÿ†÷{ §˜wê ~öž½æA? �âª?¹©}ÍÞ¡T‚ YÆu[}´+¬Œ¹È˜V|{�ÔiH~ð V²‰PùíÒåJdÆDa•¤ÖÈXrí2…L[lzì–OtNí¶ö¯¸¹mUS×#>ì�Z•[®ú�7Õ¾M¡½ëÝZÛõŽ?ÀÎuÐÙŸ¸Þ:ÁAš.Ò;r+A>�Þ½<þ³› ¿Nðp5¯6EõÍ÷ã ÒÅøh�®òi𶣝y¦kìÛ8){Ϧ¡êgZ -+¬¤]°Èj7$ë„,Äéä]€(ò­'-ÒDcU9ïQšl¥[ºV"›ÆÓzƒ1œâþ¾ ¦{Œ¼œC'ŒÂI•Ц‹Õ û’3\¸XU;‚¼ œ›Ó„ -_qÔ`"Q*üV—ºg-ôÙƒicÚóá�l¥FYÖר~àUKvc–åó&7méñì$>µC—µ0.¢yøÕ< a¼û÷hp8<:7öþ-4Š¢‚êgIºF¡~_ 3Ç×ÃÁRÂÁá~{³ßFimUÇ݃Qie-»Wñ¦WÅÙº/àP²Àîõ€0Áë׊žðõ)»à¨û‰’Íê~”D)xÇÄ\,ó|W¾¼Ùar{…úø¯xÒç\<çxãÕA™·ó.·µêõÇúÕÄÙuy+ñõú"Z»�Ð-ý @Àendstream -endobj -5050 0 obj << -/Type /Page -/Contents 5051 0 R -/Resources 5049 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5040 0 R ->> endobj -5052 0 obj << -/D [5050 0 R /XYZ 90 757.9346 null] ->> endobj -5049 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5055 0 obj << -/Length 1755 -/Filter /FlateDecode ->> -stream -xÚÝY[sÓ8~ϯÈ2ÓB-t±d‰…ΰÀ²0,ìÒ0Ë 0c;�‡Ä¶CÛÙå¿ï‘%;±+‡¤Û§íelërt.ß¹H"c ¿d¬ð8àRÌãh1Âã3h~>"¶Ûƒ~osÀ/“Ñý_©+¤ãÉ´¦ â”Ðñ$þp PpèQŽŠC"’2Ÿ; ðŠ?M^Ž},æˆë±”pÝ:z6iW´ q&ˆ^ïëèÃ'<Ž�±—#Œ˜’||¥èx1ò)k>棓џ-ÓQOpÉÅ s &ÆÐ`ÒFAÎÀÈEÈÅ0Æéô#æ8 É"\.«Â;NŠâÐÐõÓ#óÄ0‚˜×¿k¹A� -ùÂç––<ô| -½›TÊ*¬3É’9™<ž<;}ööí›·?;É(K¦¨õ|:ÍWYÜgN¿z¯ß½z¥9s pK¬Z™{ ±:øîì¥ÎVfçÜ7`3)Æëø²s·îQˆ ŸŽ7Úÿ²êȳù¥y‹Â¶…ŸóUe^«™mûºJÊ*Í3­‚rm‚0‹{ìèH:I&U68h¹,ÓŲá=NK`?NbT¯@™�%¾C> -$%›š0ºó(Sˆ`Æ{\q«á¬Q@Ù�Ѭ‚­“Y¬ñ°Z´Ã†Á ’VUÛ ÚAÃäg«¼62N¾¤Ëž4ÎÍ[š àÂÚûýû÷˧V²r–¯æÖ¦EΣ}N¶ÁAY8D³$ú’ØéáY˜6؇;ë¤UÞ®l8[5`ªfáñ—.�JlZ„U438“á `C0s La$¹b=Ò¤EÄ"�ÀÒÄ2,ÊäT÷hTèÿhG""@, |—õ5~Véò"WV¡¡}Ï<];´mò Ö<PD¸ßó -éŒF²‰Fç³tž˜X¹‰ðãݸôm°4*kÑá†nÇ•Ûh3M‹ÒÚóóe5„Ã]Ì2_QÒ|Eya1'UR,Ò,±b¤Sû¬ŒŠhHÕ‚׃`”�e5å‹%,U&ñÕ…ò¢34Ë‹E8o¢tb#gÈ÷U°WdãQFz&…U³É¹õÐV”ˆw°zÇšö"ºb]O¤ü¾z ás¿µñðºWmü¤§A͇õF‚¨âtÕ(S$–}”–»ŽŒ÷Qg–jGY˜.€YË"ͪZÿ·úr…Ùy™ ó³[ëàO ’ûdÙÇþ0GJ¨ ;l«¦&ùn“ì¼L¶x¥"×¶Øë¼rƒm:‚1‚²’ïe»€ÅD_,ê²Ý±b9Çx7ÇÒö°ôצñˆÊ~"S¬Õ³K­¾³•Û9a¯Ü¨«¯ªXEV£qVžÚ(v�„`eØë•Ø1o‡÷ãšK[T—K‹µÛ65Gó°,{mU5ïµÌ“쬚5�Æ9Ž ÷m.î0qFú›ehË;Öëkù�z5WÝYs²Ñ[cÝéÕüþT:—ñ¤]óáC›^Å:&þãZQÓ#Ÿ¡ußi мWyË0è‡Ó¾q•CÈá×ÎÀOtµfsp“Ï^üa#ZkïïC ­÷_d�h³¤Ú„­*ß@Ênª]ÿæ]Ќͻ½! ±_Þ$äã½¼É0íäÍOÖO­£þ6yóúD÷“µíïÜq*›YŽ×à»6)“Àf€�ßÀi8Þ3Ìo$«9m;FÍ_Ç…G'¿ÇÄuÕ)Ò¥&Ù¸¡©/m�)�œ»Òi‹™éÔMIn£DvçHíJgƒ£u¸±M.#øÚ¹}½ß;O¶ïö¢udØÜl5õ±(i«u°$ (`¤'h+ ¬œ‡YuÓîO6ë‹æ¨Q'YwñåªaÃÔÈ052@Íw¶6ž¼ãIÖUV†Î-é¡s-F‚}êLئl©ßºõ¸Í®¸óéL�nÆÔ–ÂŒÑ&z^³‹uR¡ÛŽí´9ØËœ­&ŠL1ûJ‹QÊ�"ÃuÀ&¨½›û1a6•‚s¶W ¢ ²@}ÔIüP¤»vïƒì}:E,¤�´.`§lÖ€½.ïm - ~ ®-G ‹°97x÷ÔÆ¨é*‹Ì™—YÒfÀî’r_ 5!ôªh/ Rõ¿3;³~û-OcÒYÌ@Ô‚€A2Ñž­g ߌÑ-±…1ë�¦tÓÇa«xyåYæ˼¨ -&ÎSÿj… âΫ ø"‚‹ÿtëRßI˜Bݼ.‚MpÀds«b™Ðâ>O²¤+½ÙÖwFyfž¿7// ?XÙ�Öê'~@ÙüôÄ?aÞ¦‡”×Túc¥“u=Ù�Ÿ/Íói~qyugO=úJÈ¡Ÿ“p™²endstream -endobj -5054 0 obj << -/Type /Page -/Contents 5055 0 R -/Resources 5053 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5040 0 R ->> endobj -5056 0 obj << -/D [5054 0 R /XYZ 90 757.9346 null] ->> endobj -5053 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5059 0 obj << -/Length 1399 -/Filter /FlateDecode ->> -stream -xÚÝX[oÛ6~÷¯ -l‹—J%)^Ûµ@‡zE‚,kg{hƒ@±åDˆ-9º4 †ý÷Q"%™2-ÇnŸ’À ÅËáùÎ�ç:@þCG‡æ Sg²çZ¿@=íÊywuÁïãÁ‹?�p„'(¢ÎxVQ Ð#"g<ý|€ ºˆŠ£²KÀô€êŒ¾‹å_g*<Ïœ8÷òxPä,ùõÇ|p6øØÐQÕ>}@êÈ` I¼Láó}ð?ë,[c'ï§A<–#®9êl³ó"úxÁRÍ�oœÕ\Ø'‘š|QM"ß`Ç…Ru˜WK~­f°Ç8rV†Ý÷WàîQBüMgÃÕ÷®/�‘àHþVHŠ®ÛÌqPÁôv¼EÂ#ì|,Â"ÌÔ©�jâ`ª^–¨6¿ rcÉ�ÜS¹`õ5KÒz]Ø%qÍçªwU•¬zI‘{Z¾‡™‚) ²Í!Ð�…ðúx¤Á¢Ëý¸t“dy;ÜÊ#Ңˤ�tÒi/<¶«ÝjÓAÒÚÂjüé9ƒP�¾&ÑÔæÿ¨ù4Ì’ù×ËRäe$šÜiµâ!@ècÄP*·ŠzCÈèÍíØ Ò�,+o§‰ZYðËÚP¬±‘ø½›æYx÷¼ín �5�4¼Ž²<Ô¾˜åi1É[ƒ^K%,�‘J5�Îþ:ùûrt:þt4:ÓK£-·©/.-㤟ËÁìstaå�ã†ÕÜ7¥šu„x­ ��ߎG—ç§çg£w[¢P_»WiÜÚF}—-õ ¶¤"b·ÜÖP£íÔ›VmÛøÃš¿5�o;ÉŽ…¬�3õl÷Ú›õPÖ—iPnz�XdªÎ´«-Âa�I¬{ƒ ƒ{›C}P™o­ÃˆŠÉÍ•µ% öäkÏeÅy%¡gçY_+ËDõAuš–WlüL³¨Mw -Gúº€‚Êû‹kb´‰°édù`xcÙyÞšãÆ –Õ–cõãU7>ýc§À×(´±ê#öݵn^ÄAOªÌá“Ë8ú®T™û;g‰'Ir«o襑 ›Éaw’á MíÉLµ·qr››³¾\‘ã½RaNöJ…ã$oòß:Á�ñ¤Íø“x®Í¥P² ÀePÓ8˜oCìÝSùFœu¨Ñ)Ð4©«‰®)D¦M!Ò-oêȵ^Ût´=«©Æa¶3’û }RIJ’0 Sݸ½‹&AlV&ENÍš¥•ƒ¿ ßL#ÆŽËô½ØËèØËèÓ0/R-«·ªY&•›ÒÒ°{õP{I.¥šg)ÃÄ×Ìæ­Õ£=ÐÜC0�J&j³¯Å}z~rbê;n¬­q�ÊìÒzp ý¸Ï4„ÿ#kg�ŸÜí(ˆövHe1Y`G€Ùܨ™2܈¡¥ŒóŲS^×Eò#+É•úZ&‘¬<ÊdšõäÏ‚ïQ_ Ñföj#ŸìS 7¯ +'blÏÒЃ˜YŸË�tH ý®ëêÍ�Ë-ÐG«OîÔÌçå‹´�äÆ2k¯Y)™}Æa*Ù©z\/CWÙþYwއ�ú"Ý‚—ȉôë¼,Ϩê͆ˆTa§üXÆ¿z¨_ð¿=\‡ko÷壺EJÿùÚË{endstream -endobj -5058 0 obj << -/Type /Page -/Contents 5059 0 R -/Resources 5057 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5040 0 R ->> endobj -5060 0 obj << -/D [5058 0 R /XYZ 90 757.9346 null] ->> endobj -5057 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5063 0 obj << -/Length 1263 -/Filter /FlateDecode ->> -stream -xÚÝXKsÛ6¾ëW°—ŒÔ„Þ$“&Ó´VS{\¹�Ôöàx4´ÙœH¤Â‡]·“ÿ^€iŠ…)Ëvs�tÀ{±°û-¸È�ò�œ:ó@@(wf«t.d÷û2îw›~˜ô^þ„'ÇÜ™,J †v&óÓ~¼�‹ì§ä÷E–,¯ìƒÙàlräPèȸ®æbä©ÞÞpRïhb„#µßçÞétæR±£$ð™s-  ÀΪG1©ËÞ¸÷[-G” l¸"6`Ü‘=D0,qz…hà"ÂþË !€z”9.’»P¿œóm9Æ)rý†ËO—˵ùeš—UCèÊ2ÊrÓ•è2f(Z´æÆáªÊL×SRtýÐ,‹òz®RÍ¥@âsy±€r©½F†.)e'ù =ÿÚ쑊¼H�üÑïÇÇ ƒ¤Ê1²€§Àóñx}\.¢>À”âÖÖÄê"I?B#½Õ]À×F{]|§‹ÃñÉñÓáhòáp86Sž?�äz¤ÿ”[ÂÖVT¢„æ×yº±Ó3Õ™�Fg¯­K™Y-”’F€û6ËÃÜÔ#hÿuÍÈhendstream -endobj -5062 0 obj << -/Type /Page -/Contents 5063 0 R -/Resources 5061 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5065 0 R ->> endobj -5064 0 obj << -/D [5062 0 R /XYZ 90 757.9346 null] ->> endobj -5061 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5068 0 obj << -/Length 2089 -/Filter /FlateDecode ->> -stream -xÚÍZmo£Fþî_aõ*5©bÂòfH«ªÄæbNŽq'=µ•K ŽÑÙàò’\Ô?ß…ÝÁ|øîCu§x_ØÝgfž�Ù@]ÿC]…íöÅ>£ð‚Ô]l:l÷7ßuíîáþÞþ·vçú=§tF‘8©k/ó$Ĉ⺶ûLJäË×gûìEªOqQd/Ã’‚öÙÙlש ÃEºñ‚ÄIü0¸üËþÐÑìbe -Lä%”­ûOç�¿Ø®‹~è° ¯Èb÷WX) -×ÝtŽ‡Êºcu~+æ!ù€cò‰ˆ?. ÜÂ�„¸OT, bYö"ºDò…‡ë—K,-³ªÊ ‹ ‹ä~·Ïr Û—J>@÷öŸ&h¤.Æ×g€�24è²'a(×ÙÚè rþÀ�?æ]½¢OfXIé[Õ�Ê{F”ÔÝkÿñ‚ãºIø…é–¬ä«p<£ ëTaIó1|ëU~ý·~6áÄlÓ—¹Òl×T -ƒ8¹<™ø5Ú“ÎÒÞÒÇü¯•®ßzÎáÄÚ7ƒ‘Ú"t=RZyŽ ­ÙâLýêòy|H“UHP]gCJÃ4øä­cRùÙÁí¿º¤‰Y„›_êA(ßÒÀˆÍûØrcyÓÀ°ƒ•v3îYq'F*inß"ÿy•�eÿdEv�ÿPËr=ü‡¿ªQ!Lf$…Ê’ð­Á¨ë5åK†(.¸ãE/žÛ´”p–¶ÄÖMÏõã$òŸÒ<.äøœÀ%…4¦¬öiO¦Ñ«<õäNôF)F›˜ªöÕOV¤|ÍZÂ4i[j-À&tý¥¿ÈÃ]؉(Ä­mü$ñ(Ðm¾ø.Ô’•“@Éôëuøêϰ«×Ïæ�÷[#.àm¼ä¦af¹ṏ!—�JY.m¸ó[›4N€�‰ö.4ã<…/ÅØ_õЕÐÁíuaâ/¼+X×§¨×>àü{V)ó°ÎŒX‹µão¼ˆn8�gX^–J�9¶µ¶¹&mƒ«›ãPÛ˜•n -9Sáú*¼¬‹ìùzpíEpKgZw î&Ä ÒâÆI¼Èw B–=ÁÎQí[´‰5í#OYcÃR�³ñÊ -ß‘`/ÖoÊ"l7J-¯ðÒ`��üz�Fà»a,ó&L¼ í-@È � Ÿ|ü³ÄëUɇËäµðH×Ö[dŽÀúw½ÞÅöP_£,{‘!ŽOXW:'sí#‚=Òé±Ò2ÞÛ�ª©‘´NMãAjCR»ýH4¢�©3{d˜¤ü÷ߪƒø�öO†P Cµß§¦fY \h|�~?ë€Ëbª[×,êhôÉ`<ê“;Z¿�Ù¤01ha¬ßë6Œ·�«Š°0}=t¥5ôJ²†ñžüÞkæ`„;Ô[}¬Û+Ú|¯Û“L‰¤â«ÔdªiëƒÙX¥ÍÓ™95,­6ß><êÖ`¬ê÷Ú;Äåj­Rƒ?hª_k¤ŽÇ ºÕÀêíX«J‡T/j-ÂP7µ�]p£R`Òcí�iƒ5ÕzQÓ~×0Tó#­Ä�1±´ßfx ~¶lû›ÅP½Wï€#Ù½â\2ãý<˜™Ú}a œ5»µlÝžÙMDisî ch•µdiæƒ>ЬŸ(NêpfiíPµÕŠŽ±˜ý0¸`ÎÌÒ'�n…Zc×'¶f𳩭“Ý5nd°`”j¦}„m XÛߟ&ÚÝX¿Ó&­¼¶‘Ið¨[ÚN骩[Ùò%± -ý>ª ÜY…Õ…›ÁfªöèMliI!~^íÜ…KWT‡zA–€ØE[ú¾³ßmÌÁvCæ®î¼|Ω�oµìâX•g¹ÈQ¸N”Ô*óá�Iwy,vÝו¿X•7}¦“âN»‚«ŽCÓaœì®š…çÓ ))ŠçìQúgVs—)�뮟½ÓÊný êÓ[ÅÃmð�tíU³|øšW̲ùõ¢·�>ðR€^ñõäÛØçª’E­Z/KûëÜ«Wò '¹¢œÃ©ý½'{ ‚øù�ÖèÝkb™ȉ$‡ù–7 -a×aø L”ná6µ[°Vx©}¨ó·ŽëF§‘S+ ½§·CQé EdùÚ"ùVÈ ¡=[Ä‹ãÃÓ@½,í¯F@Á -U'3ðÜ~õRæû"L×nM~ëï¤o�%¡&˜å0ò·I+‡¤¦'0<ÏË_´äžvR$ÍI2Wì3¼,|Ù„.»Šwb8™“ËðÅcïöƒ„þÑoXlL$‰ÒW½öÏ?\�ñÄsû¯õ%FécõØË.Ïá�ÙF€’_K½À‹œÜ�g_(d.?û½‡Â‡K$^¤´‚8úËÞpü G?qÈ΂¤´¼äÄœwYåð[ˆ,H�Ï >¿={@d_&ÑÒ'­)'endstream -endobj -5067 0 obj << -/Type /Page -/Contents 5068 0 R -/Resources 5066 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5065 0 R ->> endobj -5069 0 obj << -/D [5067 0 R /XYZ 90 757.9346 null] ->> endobj -2466 0 obj << -/D [5067 0 R /XYZ 90 739.9346 null] ->> endobj -438 0 obj << -/D [5067 0 R /XYZ 90 739.9346 null] ->> endobj -5066 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5072 0 obj << -/Length 572 -/Filter /FlateDecode ->> -stream -xÚ­TKoÓ@¾ûW¬ÄÅFÊvfß[.Ñ"�F\Je…ØI#›:qJüwÖ^'Ø©#R�|Ø��Ç÷ͬ÷CîCb�h©©åB‘É22sÇW6î�óÚ¯FÁÙ%³ÄR«˜"£i]A!• %7¡¥&0 a¡ ÓU¾ØDBzÝŽ†D€¡ •+^Å2´Õip1Ú#6„$WXáÝ7·@GlåÖHòà  h-#Ë@0¾3Áuði_Ç;ꄾ¾$ò¾Æq'p×s}jß—RÑ@„guh)2ãj Ã¦Žx^{,•J i�_–Ùd=ϳ­$£ -˜éITÖIõ`£(híÐ,JHÏG{>›|žø]Q;žäÙô+H(QÅkO– Ê9? 2ÉV«´Ø¤…«�/<>º9 JÛ%`<ìÁ)p£N‚iÈÎÒõ ªVZ¨BSÃ@wAí‘®çÙ|ý¸t’5üÆ‹<ÿ^þ¨ &wãÂ_9P#-?©J6^¦íÉ:B1ìòÄ#MÞ—i±í@?éj±ûnU³¾ÁqOãYš%óiûÿ™¿ƒ8þ|qýáÝ—øM×!ŠQTÊ>å%ôs}œå_ß«ÇB7Awm°—¿:ž“ù -RºWXÁÍ•Tÿ¤qµ:—‚œµÅY9Ñr¿D£a ‰ŠäUš¥Åx�&^¡ó̯ïw›a„2,Y³Â9ãç ¼Å”ßM#&üðFùöcM›Ào[¿¾Îngiv8žJ€{æóÛ¡‡šendstream -endobj -5071 0 obj << -/Type /Page -/Contents 5072 0 R -/Resources 5070 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5065 0 R ->> endobj -5073 0 obj << -/D [5071 0 R /XYZ 90 757.9346 null] ->> endobj -5070 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5076 0 obj << -/Length 2024 -/Filter /FlateDecode ->> -stream -xÚÍZ[o›H}÷¯°v+mRÅ„n&­ª%6I¨ãNµÕ.�qŒjÀ 8iµ~˜C€·«DbîsÎweƒ!‹ÿÀPf‡’ 12Ç‹CǰÃÜ|9¤{„ûGûέÁ锇2#‹PZ«l0ph¹ŸŽ d�GPb%öh§-pQ`�Ãæõ›ío7(¯LCgç£ ±/ Ž¿XïªUìL€ œÒ}ÿ|úÂ] ðý€e8y, Ÿp…e€,á?à!G+›�9øP¬“wdšø €k&x·@ÊbÂRN—ŽG€eÙ£ØO¶ŒSG>Œ¥¡ÄB†•ÄŠ\ŸíO�öGçÄ!F%±€B R àx$b§éÞÔÀ<ùq6àõë¬kTô�V”¥\Cí³²™D ÷Ú?Ž·]7 ¢p·Í÷¶·Û8ßrŒ X,G™áE^Èfp½÷øóßöÕøVãi +«�ú2ฺ˜�u±•6ñgä)$O­ö¤™šR^2¯­E^RG¾ímH? -\µKhüKå-¿°Z£›Ï¢"ÿ ÖÒ^ÒòuAÚŠì ^aÚYm…I脤ï3+°©¨ð“8ƒçO,X/@n^¹ÿž?�‹ ¶�¼ìQ»3¢ ù -sz“H(‰8±׎ÈÎO6Ù:\•*ô‚6 ñèA{ZÇa1„·h‡ {CÖ‚EJ"çµGdïéÑX�É,-–ÁšÊ1âÕ°uºU5ØAd®7ä -*ÒuøDÖ`æÕ-1™hþÄy餦Êž§{Ð%Sµu0á{3 wÉsMßÓÆ5•_’–{„ª,èØ{DbZ Šä2ð„àµFÎ<,ÔVB'�*±³i§×µ`¼4ƽå—Ï•·éò¹÷¢eÔí2ûÖ!{ {—¬CÞ×öóÒt|EÔfßÚ¸ýO7obœÐ×�üJmCØ mȽ¨íveÃþÎ2 ·ß#ïa�”Qß)C>dYþ¤E|^…Þ8” qÔ ÑM„b=v: ”Ô �\/N"’"@Ñm£jŒÃ]ä Ú¨{/°#YVaäÇD´O^²&q7*[Ò0ÖN»¿[û¡ë­<'s4�#q‹"ßKšbpXôŠ„“¬í¤L“ýf>)Õ qæM×íHü°Ì(àù(9k_™ëIÌU¥Æµ÷‰=:¡K±ìâ„Zgb{AM2ö}øXÌ¡®Õý¥€B_÷:pÞòtB÷¥‰uãQ\ÿžVj¯D-jIJp6¶ç£ˆ8Ï1,7«�û¿ Á.iS Ö�ã¹´±Uº;ª�CÎý?^•Eñ:Ú¨¾?·r@Á�Òpâ IÑ·ñ›«gÓìX�e *ík´ËjúgŽXÍy%¼bßÀökïªE—ĉ—ì:2lš[óu�¦¬ÃœOu3N쯟žWîQ‘4Üê«0~ÆÛ¢j.À*ðCJ&÷�¤8‰Eøe•,²Âãê6‡«ä) £íŠ‘ú3¡Ù)ßb‹œ4¯P|^‘â4£{ &Ž_0’ñ!¹œëŸX¬+Í$çbýºU •Xi]ú�6U§yíüŽœâ®è°¹iiÖÒ"UeNNô¹ehçKK7ÈBÿ­˜té?þ(‡·ß?—)s‚Oý¸0T“ì§dßëÅL£L0SC™[šjžP&“ÙrªÍ/Ic'N§“ÂL»Ö,:ßÒOJQ´sèÄoAI¨\�{ Õ˜\áå\›iÖ]Møš5/Ø_Pú -Q¨bXÚd9SHóbi,t³‹Cÿ,WXÑT3'3E»V§8‚˜‰™J•hêF�ùšWÊlÖm_”Ësó:W©’”óY›þ×¥©yM5C�X…áÔªì/X53Ò`.Ô‰VÔÔ�*V°bÜ�fÅ3Ìgƒ­M¿O³Ét‘Õ�Ëñu´˜Õmú‰Æ˜ôØ%ÅÖ.Åì&ä=`ˬ˜æé�e˜m€ E  �U`uDöØñ�ÇìT�]°³CýÔ=vbg'0;l)5Å„Í:=©ÆÀ`š÷U&´KsxºO5šH!ØA“×î¹V„JuCb. 17åô*ŒÂ_ÞŒ~:Ku܈ʻ"‹S×ý˜OÝ܃jˆ¿±1·8Úá�¯_ü=]\¾t��Vd¹Ê“?$Æ?�m$ZuÀœ·áuíq›’½Ðšz:©P‹d¾¬šdºX®ËwëÉ$+ïöŽˆ1Úty•˜ªùÝ� w",-Æî$œn#yñÛõxtHZ 4v•i¾ÈœëUg�iF\†Í›düƒ bÜ4Ýe�^žGãð ²6N´ÝüA1ÂbRæÎÛ*ì»l–ï\‚= —²ë�<ԡΩқõ€ñ%E»x{âÊؘSð(E¥ÐeH›7ô¶[þÕñq?€²ã8”c$àýúÁQ,*î¡P‰J�-”ÍM¡Ìãé,šù¼]-Úþ¡­öÜÒ‡ºµ"]ÀýøÌÆ·O44@«à$T†Jù‰©Á‘T�Q!è×—ÇQÔ}T�J²TŠdYFeþŸÕÂèáDhÃíÅÆàÿF†V*ã'¡ P©81 ˜<’La4ýúú80s 8ºñýs3I¾ê¯"ðî9yp­iûjL©ú6íß:�@¡wÔ·ïKRÈoº�¨.P´5±Q·ïO,m×› ‡Æ çøE¶ÈЏÌÒú%_ÔÏß7�«ˆ³uÓ±»yý¤Oê¶׳¯Ž²nMLœåEÝY_¾j´I£øîsý<Ï?}~Ÿ-öÓãnK�üü PŸqçendstream -endobj -5079 0 obj << -/Type /Page -/Contents 5080 0 R -/Resources 5078 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5065 0 R ->> endobj -5081 0 obj << -/D [5079 0 R /XYZ 90 757.9346 null] ->> endobj -5078 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5084 0 obj << -/Length 982 -/Filter /FlateDecode ->> -stream -xÚÍX[s›F~çWЗŒÔ)›½°·dòÐÆjÆNS9™q<Œ�«V…KšLÓÿž]@6 E`Ç£±ý{;çû–ïìdCõ�l mN9�Äev°± }£ºßX¨vÔ¸SŸð›g=ÿK[É0³½ea�!@1¶·¸aŒÇæ�ÃQ~z®^)!˗ɳ]‡eã$òMe~¶Š£ñ•wfM¼[Ï0JÒ~?Y—WÐ^(€gD -jÿ« )±½±\Lv�µ5³ÞßÚ)Š&~Af«ÑŽ V|yÉ2v„pt>›¾~;ŸMþ<™Ï¼‹��Âg)ئqðÏ/c‡© )Õ�^jrÊŸ#�Ë\Z™q‡šÑ]Á_~RXA‚ -!·¤X¹¢0ös1ä.0²kýÚyºÉ¶ó ‰ÖwH$À‹"jÄÉ8/&¿žxSÊÓÙt^wÒ6Ã�½¢2¾Zj“)XEÛ<»Î—Ë0¹„W¥åŸ^ÝyÀÚAÙüÏhPŽߢ}ýÇt6©ƒíÄçÂja±_‹8 -õ2Ö=5M>œzÃüàŠñÿÆQ¥-$:G]c/­ÖÜSHœ)Ñ3v?!-ü̯ I À‘à-D̈“7p>TH®0öÊÊøP!‘!QØ�ýp!i«Å†�x÷|Üp4XHô T¨Q*ô˜RÉâ^¡P6O -êæÚ´øiµ�R31£Hi[¤AÐ&ì%ƒÇ¼3‚Þƒ¡G¹ -~jW!;\Ì\ì˜ÁµLâM¯ -Ù=«i°MíÉ3“GÄ™æ×‡AÖ •Ãá_aÏf‹ GOíCplÄIöpùnÒ›úû:Œº©ƒŽÓ#oÈ6LVñbØÖÓ þ8i÷Lxú2g.˜ðhJxD÷|ô°„GàCg² Æ^÷ˆòø”¯úO±lc·fï¼óùäâb>}ÛÍ¿yš·Bª{/ šwM”ƒÏ‹AL€DÐíb]'í<Þ_á€P¥dÐŽ—h"1@X¶®n!KJŸãÕÂDYÂêÀÑûïo·�¿ÖQõü"DLkŽÄ�HÌWê XÇi¨­ ]OàÉ]=AåHq©ã?\”ÓwY¡ñ»Ê]ý ³<‰Ìsè¡�‘l¸'ÙòÒÿ·oåSOÈV›pçÙPnüaÜ„éHA�—r/ÚÅ$Ô/Pc‘ Ú¨ì�ýP�©¨” µ\/”©ƒ„¡ëH«….÷P4ô7a&~±+º$GåóÝîålŒè(¯WOø“¸ª©aYù¶c:Š“²±_|»þº«»}ùzîUÜt)̰KßÞðOendstream -endobj -5083 0 obj << -/Type /Page -/Contents 5084 0 R -/Resources 5082 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5065 0 R ->> endobj -5085 0 obj << -/D [5083 0 R /XYZ 90 757.9346 null] ->> endobj -5082 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5088 0 obj << -/Length 1329 -/Filter /FlateDecode ->> -stream -xÚÝYmoÛ6þî_¡OC<Ä,ß%¦0°-ÛºdmšÁÞ§¶Yv´Ù’+Kí²¡ÿ}¤HÊ’J+~)ú¡1I¤Ž÷<ÇãÝ‘B”?ä èùÌ‚PîE«ô²ùÅ™î‘ì5_øi:xö+ž‚cîMçÕ†ö¦³7g²g8 žmVÅDÃwÓk�Â@Æå�ê Œ‰jü2­õŒp¤´¼¼y½™„s=€€ˆ€yåHì­û°LÔãèŽJÀņ!â¢Ã=ÙâCdé`ÉÁ×l0„à - <ûT1‘æ€rÊL/2½Šì]ñ�Çáì-dPþ£çN<ñ�£Ýù¬êÄ©7B’ ªW¾×æ~€½FóèËýU - gŒìÒ�šÊ5Ú ,‚%ú$%=î¨î“®Â…oÄÙ¦€qÚ‚3YÇQ2O¢G­8Lõuòjz«ï6qþ!ÎmïLßëÞƒ4?}�þòò¢Mcs<ÿTó<[ÍD&�Ù)³œœ@Ëû¿â¨èhµƒKœŠkµYt0…QQ†ËÏ ¼’Ö ½%0�_Î2N;ˆdËÂV¤;Œ´?Dô%³51�³L7É"µUw�‰;©ƒ�FîVÙJÛBæL&öÛTÙyG%’€ï%E§H«ux®m‚8À�lBÔ¦®5ü!ÔÌ’è"ä*öAú�‘.¿+šŽµ-Q÷ñq×;XO�B¸ÝÍyi­*7d–êÊ 2 7¥l¿Y�RÏ (€|ÞÑç;QØJ©ÒÚ,�,i=gÕóÛôõÍDõ`¦ì°³ü!¶”J敃nõE7¾|YYr·­¨,¡¬2GQæF:ÕQÔw„B±5:0Üì*3`Ü(©ÅlöÛdî [=QK ŠÜ¬Øf¦ñ6U¹…j­Ð?n¥·¨_‹Ö1{\û¶[$hŠÔquÜ\nAájeö¬ëvòúò÷»«›«©ò�ï6`½É¢¿mm ’t]÷å|¾­·“ã¬r¦Vo¯š…ÚmµîÐô«�ž*žÑoî,�=±sdÍ�c’&U�P/×A±+зacÁëҽؙ虿¹IáhÏ�•ܳÊ[¬~øÔê9 “¹-PÙ²}(ÝC|õ�Ÿ ¬ gü¤óýê{D EÁÍϲvðI`Ïï òEœÆyX¹®ú&¡RÕõ•½¹"&‹;ý€°¹Â L.Ô!�zÂr}7bv–åú¡:Ò«ÞæÅûG}ý9ûçq§]ó¨�ûüeÜ  endstream -endobj -5087 0 obj << -/Type /Page -/Contents 5088 0 R -/Resources 5086 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5090 0 R ->> endobj -5089 0 obj << -/D [5087 0 R /XYZ 90 757.9346 null] ->> endobj -5086 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5093 0 obj << -/Length 1936 -/Filter /FlateDecode ->> -stream -xÚÍYms›Fþ®_¡I;S»caŽWáv:űHe¡Š›i;.d1 "°“éŸïÁÝ"�¥:ñDwÜË>»û°Ëí¡!‹ÿ¡¡ÂeQf^�†n8`‡�øñÍÑáO¸¶—o9e¨0ŠÄIC{]ì !Fä7´½ßÎ8N8q2+³g™¾ÄM‘=C KÚ''Üm}Ò™ÆnúQê¤A�ÿa¿hv)™y årÿüö;ô0Àw–ᕱ8|Æ–AŠÂ Ã�ÀñÐÙ¬Áûr2P,hÒOD|³‚H`ð4ä°Â2QPaÖ±,{¶Ó³©C‹ ‹ÆòPf9†•¥Ša_€É£ãÙ„4İd˜�ƒ@¹P¼ÃHaI‰åÏGuY þÂÊ ãbÂ÷ßC£rl̰’"c|ûªbDaDI@ãç¿#^pitdg‰ë×f=‘“|¦l�“pOMû¤ÒªæOâ,íP[é­@{Á:p‹dG; …¸ó“0HSŸÝ%ñSàA/Ý8)´|@¿ÝÆÏAôHºnyA¾ï¾1×?N”ðB?½êعh@ Ù¸êTʺxýÒ‡nì–lŸ;Sü]ZÆyˆŸÊ5ðjµC-ž@Ü8ˆâ4pý �PÔÛpþ#¯TyØæFl w롟ÐNà–KUÈ|oks]Ö Ö_Ž—ÖÆ¬ô2pÈ©þŸ¯Ú"Ÿß -^åKÀ]B¸‰±@Ú �ÔO’c5U©Ñ±G»XÓ?#ð”56ˆŠœÐ¯ü@‚£4:”EØo”Z~¥Á!1ùõ#/N vÃXç0N;¾E8¹¿y!±á�žà À¬±¼:¹öñ:}.ã¤2´óÝ<�Øãn·û¸?Ôç$OÑQfØï_ñ®rJæûg{¦[—e¼µïTS#=xº4�úT›’ÞõGÊ �¦®ì™a’öŸª,þî;:¾˜Bƒ.Õ~]ššeµs�ïŸ|�~»œë€ëbª [×,hôÅd¾šê‹Ú¿^Ù¤±0hc®ßê6¬·�‹š²°};t®7ôJ"ÃxK~o5s2Ãêµ>×í�5k¾ÕíEnDÒõUê2Õ´õÉj®ÒÇË•¹4,­vÿTòdª[“¹ªßjS\W˜¬JþA[PûZ3u>ï`е~P¯çZ];Ì v„Þ*LuS›Ø%7jÝ &=¶þœ>°–ÚD/{Ú¯¦‚j~¤}€81–ö~…â¹`û*¦ê­zÉ�§’¿Ï“•©Ý–>ÂY«kËÖí•ÝE”þ9çÆ0¦VÕJ–f~Ð'šõÅiX5î¯,�¢�ª¶Z³1V³—ÌYYú¢;¬È½±ë [3ÍÕÒÖ�Åá73î0¥Áã*;­½�Æ¢ó0Ù ócUÉœãÅ«}Ñ�¹ÿ¡ên¦ai%/mS-ÙmÙ¦>±_À¨Ô6L»�mXûŸŸÚÍ\¿Ñ­*ÛÈ5¸Ó-í`tÕÔ­\|E­Ò¾w*wUcuf°›ê#z[„j04^Â…K%ªÓzI–qˆ¶ôã`x1'3xò ÐqtÐ)_ Bÿ¬e—ŸUE�‰|j-•Eõ¸Ðz²¼„ö>uÜ¿º”âORªBøV÷®5OfsñDzˆÊÚ�t‰ÿÔrЕ ]áÀB¾˜ËrŽö‰ÖN¿íÐJ|®EñŸ»·~ÝøÙH_N,n%ÚuçN)¸bÉ]ö<)WHÂI7!8ÑAÄ?z¹Å•£ñ"-Ö5~†b×Íß»(«)튋'ÝÑןiºªE äÆ+dï†$Qúª[ÜâzŒ— ž;¾¥•EæÇù)Ïá…ùµ@)Î~ä'NAÎüÂ9çqþ{ �wçH<Ëhqô—½âø+ŽÞXçiœ´ÖçœX©òÎË«íœùäVûÓçGÿÅ}v~ÑÜ`¥xÓ�Îendstream -endobj -5092 0 obj << -/Type /Page -/Contents 5093 0 R -/Resources 5091 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5090 0 R ->> endobj -5094 0 obj << -/D [5092 0 R /XYZ 90 757.9346 null] ->> endobj -2467 0 obj << -/D [5092 0 R /XYZ 90 739.9346 null] ->> endobj -446 0 obj << -/D [5092 0 R /XYZ 90 739.9346 null] ->> endobj -5091 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5097 0 obj << -/Length 919 -/Filter /FlateDecode ->> -stream -xÚ¥WKoÓ@¾ûWXâÒ f»oïÂ…7´Ôp‚ÊJ'5Jìàl€ -õ¿3ÞݤvØ´®ªì��ùæ=ž�Ã�ÄljH�f\ÆÙ2ÂñÈï#⯇p?l3¼G'﨎5Ò’Êx<³’ A �ÇÓoG<R��ÖK³BWƒ‹ñY̱BXHÀlX( 5z;Þ)òv&I£ægôíÇS°ç,ˆi%âßpÀˆhMãeÄ)ÛÑyôe‡ã.¬@ÈAXÈ%Ádë÷玔ÖnQÂÀ¹²WO�k(Q”Ä-ú‰¥)Cš`1D\ráÐ’ÁPb|ô«*¦î­ R:­Êü;xS®‹y™û«ìjR»·¼®«Ès �»˜*DÔAEEY˜FQC>„—à‘8”“{¢¡‘�¼�w›23EU®‘eILÕC©$ÂIºöРYUΊù¦¶Ñ´ñ³æ2†”î§sQe“ÅUµ6åd™;è ‘©qH#(1Þ ª±h�׿òVꆔƒ- -Z¡ã óŠäßú¶ÎËi×-Á¦²_Qšê¸…jy@š)ÙKzVWËcïHÂèØÏC"pÝGûEjsù#Ï̾…R"Íu/„åz¾µšW½k Øèriõ€Ì"/¶�t\O¦ù¬(sw8ÿ4¥ço?¿iqÒÌ¿¸0¹”u\U�wøN)„Ù ø~¶¦dK7µó {ÅVy@eht$áÑ1Y­ 3÷MšŠììÚd¦]Ófb|hÿ†ä Ë‰j²¦¶I³AÅÌóÞx‚ÅIÏöðý¹›Omhþè&_w�‹Ç€û -¸ _>êç.ìd›Ÿý® -f(TmJÿµoóÉÿ˜ˆ…§+SÙC= ý—ä&(ÁBÄP÷jáÇE1+ab¸Ã×ÓQúr4zýòãÇ�Hh´E† ïu_ůOÀïbbP>Ž×«|gÙ]�¸)V©É¬NKMM04:@„ïc�J:6¶6 XŘâêÐ&AÛµ˜¦vü~HÓ>›D`‘ ”#ƘÚ3ŽMfm3w»\[—SF“ËŽº7�›Þ«ÎþBLáIp/Ç"…|Ô®l—{"„Ñön_Ý‚äwaoDcäû¼Ìk(ˆ©Ûï«Ò=?m_ÎDÀã„ú'~FÙ3êÿPŒ¥{› ¨8ªjwØœŽ<7òŒ—×îù¦ús=ÏËýð4‹| >ÿ¶ÁÙendstream -endobj -5096 0 obj << -/Type /Page -/Contents 5097 0 R -/Resources 5095 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5090 0 R ->> endobj -5098 0 obj << -/D [5096 0 R /XYZ 90 757.9346 null] ->> endobj -5095 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5101 0 obj << -/Length 1899 -/Filter /FlateDecode ->> -stream -xÚÍYmoÛ6þî_a¬– ±BRïÙ0L±™D…-¹’ܬèŠL±äD˜-e²œ´(ößG‰¤lÙ’2yû04¨ùvÇçî)öùû:諲*袤ôç«è?�æëdÝÒ?Øpéõί�Þ×]AJß[(È¢¾|:AH9 ¨àdcNIQ'P´€¿ø«§eH+£d¾Y…qægQŸ~öÞõ°WÎ̀ɢóyÿì}ú úø®Q×äþ ©ê:ê¯zyeÙs{ïK=´£¨³O†b½�PH â"b°J ÔOp’…Ë8Ìa¾�^“5µ¯$U©øö<ØMq(}‚L�Ãàr„B0œçs—p�Ø*iÅ€~(ºeŸ&EWi”š¥Š]� öwÚƒ¢äA–<¤Éæ‰ÎÍì§Ó QÐ! îÔI‘äBHì<Í/ßšµI¯h“UCmçÌ$fH«*“‹.PiSþ�KÕ£\ºˆÈrh´X{ÍbUÐPw•º�árIíX‡és˜Rí - ¢èíúq$Ød�IÚŒª–ûüŸ€6E1�6ñárM+?ù¤ý—u4_ ëðgfˆ"èRÕ²_™±‰¿TÕ†j˜Å -5gÚRm‡PzEêÐÑÃäék=¨”oÍüÔ[x»î‚Z‘›%íü˜VHŠuÏlP€’ZûüH†ƒŠ¬ü«¸â Q#"PD»/lŠ «¢–¿l‰ˆæOJqæ ã0õ‹»Ïü±0¿É'¼ðîÊ'V�ˆý‚ $^ öÚ˜'ZZZœ"¹¸HÈ+‡Ï’÷_ù‹ä—¯áÁ[dþHX㥿Çñendstream -endobj -5100 0 obj << -/Type /Page -/Contents 5101 0 R -/Resources 5099 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5090 0 R ->> endobj -5102 0 obj << -/D [5100 0 R /XYZ 90 757.9346 null] ->> endobj -1540 0 obj << -/D [5100 0 R /XYZ 90 739.9346 null] ->> endobj -450 0 obj << -/D [5100 0 R /XYZ 90 739.9346 null] ->> endobj -5099 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5105 0 obj << -/Length 1195 -/Filter /FlateDecode ->> -stream -xÚÝX[oÛ6~÷¯Ð0`ˆÛˆå!Å[»>t‰[$p� q±‡,0[N…9²kËÝ‚¡ÿ}G"åH -­h˺Ú/çú� E(þ!04PBÃ#Lo{4¸Áéw=pË!®‡Õ ?�{/Þ2b$“Áx^p�@Œg†ôC&èA/Ò8›‘iÿr|DT*$²Íw1¦òÙÞ`¼“åT\B.éSïâ’3Té´G 7Zà€0†·½ˆñr°è�÷~Ùñ± �Ï"Üg’ pFQ(Mbh¡²IÙ%¥ßÏây’Ævp>~3LŽÏú!§8Œ -ÑY†D2–NµÐ�Æý4N¥ÞKy4<; )Ãé#5žIE-‹Mv•%Óò}½�föÝ!5É×�´Í+ðM2�²ãÁp4ONÞ93™ðªø~Ú_O†Cg(^ÁQ ±u°%f>b±Ÿ8G•E)÷‘Ê6ÒŠ\_P(/Š5Àla0`#]ìxfÓ…(Í ¨Ì‡ÿݯ�À…&RÖI¸U7äZ)U7I?Œ®éÇ«uA¢€(àî–°0H£,/c鯋åt²@÷þFý¼Lføô�v¡ý—o \ð­ãl»NíÆÛøözR°Ï9ÿ�‹À©œ»/âµ î/¾5þÍA©£‡PæÎ÷Yïh×±Ú!”¬Å¢“RŽÚ"„åÍ¢&P¶ ­ÒºóuWÁ=´„¥ /κgó•á¼WxW˜ m…Ö€‹‚�ñb1ù´M²°†-LÔE l2÷¨AdQ]ÛªáÔ ©4¦×º¡OíÇÓˆoOÙ9m�ë?›8�=HY „™Že¤ž±Zª¯‹Ò-ØšÛŠÊÛt“ܤñÌŽ’Ô�NÀX]¼³eÉŸ/óÈ£I-hè+ÇÑ>~¬¶îãÉÑÙèídôáýðd48w;Ÿ?O -#÷”¹#`2ÏnHî˜ÍEré$;Ñ£Ãácœ0Þ#VÄ{ƒÇ}ýò»"r„×ëøêwÿá´üâ]•ÎkþÕ²¸Z “ºa^ï=f©vÚ4›G[‰jÚ´º?ã šòŒƒNûÿ´jðFݰ‰µ&:¯VñÕzy»Ê ºì²T©Ur„‚­dC`Ô9ÞN¼`DR¦:!~¹q5}Qðbw í;Hî�-¨Çø=›ïºç/”Q�¾J§«»’ÑáîƒëГ2y¾ £ýšÇÕCÄ åÚ‡YÕ•…Uœm¦I2]¦Ÿ'Ùò*o(Õ® -ï`Á ÿGÁJ±‰(ZoóøATú¦ÒwZ³�A[¶³–s90þ0Û¿Îß=ÛYÔžíLT³}¹ÍV[o¶‹®Ù‡�/9›¯º+=«” ‰9«˜hhÜrž¦=,âÔ8Ú_iô¿«4¦ÁÝw¿œ>±þpxzýáåI=SÓÑÀ©ât‚¸îth^¾�Hy¯i€‡d)ä“î劻D�$¨hõ*Q£¸.ïÝœ¹Aïâ4^ã¹f¯—©}¾/_Nû 0&ì ï†Å“¾düe^nòФ}›÷™8X®í`{ò³ÛMÜÆë;û<^þywƒîk¸'¿4ôøçoQ÷ð9endstream -endobj -5104 0 obj << -/Type /Page -/Contents 5105 0 R -/Resources 5103 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5090 0 R ->> endobj -5106 0 obj << -/D [5104 0 R /XYZ 90 757.9346 null] ->> endobj -5103 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5109 0 obj << -/Length 1205 -/Filter /FlateDecode ->> -stream -xÚÝÉrÛ6ô®¯`/«2i,Ä–69´QR{¹+'×£¡)Úæ„¢‘Jâéôß  EÊ ¤4�bàá­|ô€ü‡ž#,8¤^¼ïA¿@ö%Üo_øe68ƒ„'Aõf÷ -‚ òf‹›S„øÐG 0pº½ø]. 8…Ћñ—h¹Î½y½Š·Ë$/£2]åÃÛÙå`öù1ͪŒPùv)S„!öÊdÍÉžÖùs‘DY¶Šçu‚)µ*nÀm¯Ñ:»Þ¯6 -%íäk‰£µê¯NÓ÷ïTÚ¼67G£ô�´a]Ï�ti§²íU›æÒ­]|â*´®á5«ä.öÓ÷“‰�qÝø~óÑì¹+�Sá`¾»fðøfÈÜ•%s•Ñ¡fØáu,´ÄpümªËœ€±ãô»ÛÞ¯ËÍ™6 ¡ä(<å�Q;‰/ûï€?³±Ù¤Éx׿*jrgu9F­§Ì× -tÜ\¹h½VV¶Sä;ÜýŽ×ÞÓ±:gš¼²—Ùv¸&Ê;PWžÑ “S.†„­xo蚨þ¡ÖzÕ¤­æê�ôÅaÝùëïiÍV;¾VãpÔ¢á~AH½¹›ãî#¢MìÕ¿~oñ°ÕÄï g£g—Í™˜9íHÞöªQÇ¿;þ ¼tYuGtHfô� —y6Ö¡Ûpèî\ÏAÎ µvôŒ^F.vˆ;%�@ ±`u7ÉŠÄ¡®¨ß^w›$ú`§è|g ì*T"lõÃ*#+{¶ÒÆY;GõZQG¹ô+Êüêúöz'ØñõN˜4ÎVÅáŽUˆ–3ì�œ` �ÖQðD »&úMÓ¨jžÆ% -Ĩ=N£�`˜«iF1¤¨EÉü6É“MTªžY ÎV¹þ}W/.‡�È¾Ú Û�ù/~�ÌäM:8Õ«û!"§«�Þ<ÑÝ=ÕÓ¹/Oɳ¹œ˜Y¬ôÀ Ùsendstream -endobj -5108 0 obj << -/Type /Page -/Contents 5109 0 R -/Resources 5107 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5090 0 R ->> endobj -5110 0 obj << -/D [5108 0 R /XYZ 90 757.9346 null] ->> endobj -5107 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5113 0 obj << -/Length 1224 -/Filter /FlateDecode ->> -stream -xÚÍX[oÛ6}÷¯Ð^ -{™XÞ%¦í€¬u ޳-.ö�†++‰Ur-9Y×ö¿�I[ôhÙÁlöÅËwåùŽ(¢Ê? - "A(’�=ÜÉáw=d¦C9¶ü4í=‹E €à˜ÓÛFG€a„ƒéâº/Bƒ3دӼHëH7Óó€Â@Æ¥Zµ -c¡F{Ã鯖q…Ž”¥O½ë,¤Kç=ˆˆYð(; !pð±G1±�¼wÕûe£GO4¾ˆ"¾�x G"ˆlHXFéˆ0„ƒÅö«z^gÉ äòy]TÙ]‘.t/+jóð¢‰V¦MÊ)3�w½·åêwÈ`¦U¼Ò |a4êæ¥n¦Ãñd8}3{}9y;›¼¿�&Ã+³òä$“j�î|ñZ$ƒ�@¥ôV¬@žiu�Ýh™ïŒéÉûñø�&:©ÌL‘Îó¼LfJ“«Siðgƒ/¾yg¹ÉŠ6ÒNù'c=ù¼™Äi"‰7K¾×XQŒƒÖpøïý„Å€3FöÙFmãÚÛ� ñNHB‡Ô†ÞC™-|á#¨çïÒz–ÜÏL­ã™AfÒì¨O¬kŸ‘ŨFŒñà•Êèêr–¬@YЭÒz½*¼�@´kÓóŽZ TàÃúöº© ¢VÎ4ËzuãTâ·9ÔÕŠ¼Èõóׯ^ÅŒ„[÷¤WA•ý™–[“Û†ºA‡²*vJ¹mäGC!t`hŠøÈ Bo12Z4�âØ}B�¤Tkb™ÖU’eIY<ÌêÒô6ñüàáëöMùÇç;YÏ;éQW9žüü)En¡endstream -endobj -5112 0 obj << -/Type /Page -/Contents 5113 0 R -/Resources 5111 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5115 0 R ->> endobj -5114 0 obj << -/D [5112 0 R /XYZ 90 757.9346 null] ->> endobj -5111 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5118 0 obj << -/Length 1020 -/Filter /FlateDecode ->> -stream -xÚÕXKsÓH¾ëWè´e/«ašW€C †J*±w‰¨²)•"�²llHmñßiFŽ�Œ¬€ÙöAóêîiùPÿ‘/¡Ï)’„ÌO§ôoôð;Ùé@Ï› ^GÞó·XúH†™Mj Šö£ñeØ0‡öVÇë&…= i ¾&Óy®Lçh–®¦ª(“2›ý«èÄDkË% Uv?y—WÐk€'D -êÑ�”ØŸz!&M'÷νÖzÌD-àò�"âr�ùz„CÔ8ˆµ¿ÜúÇx?` ÂÞ,5víLÕyeçÑa4ˆ/ŽOO_Ti#�! ©•Vöz¡’�î%²ÐP/I“¥Õ N‡ƒ(¾ £—‡Ýˆ´¬ÓG�ˆ8nCt4rã!�xŽFnSa7ÚŽ¦�ö×� j•>¯g) báHWc(ê5Ö3P"cü½šçwÆÈ—¬¼5­Ä<ªHÕb‚È9q( xK¡� JÄŒ<Ê,Ð¥*Ƴyù/¤p#¥þ2vS=ŒÜÔðFþ§B+º¹—®Q Û"ÒVý&‘x¿ˆH²ODdØI[¸oÙ%û_˜¿øõÌóVæ/žÄ¼Ø‹yÙż&½•ywÖˆ~î Ä{qOà>YO`ØÍ}[Öµnö›ÌÏ&•?©õjëÍ}|ø¦òÊŒýçTÃíÛ­Ý7­Ä�Z¬_}õj•7àÝ–šï¯UÆém²¨a·’ŽàŽ+A¨“T„-©nÄ9:Gux�hÕÄœ£ÜPáfÒd-&@">)σ_÷«-*£ÿH‘‰ÒÒŸ¤ñéó,»|ÆÐÌ—*/T9Ž“ù¦½ÙÂt_q\ß5·_ïnÔ£{�êÂÁÁÒwÖ 3endstream -endobj -5117 0 obj << -/Type /Page -/Contents 5118 0 R -/Resources 5116 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5115 0 R ->> endobj -5119 0 obj << -/D [5117 0 R /XYZ 90 757.9346 null] ->> endobj -5116 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5122 0 obj << -/Length 633 -/Filter /FlateDecode ->> -stream -xÚ­UßoÚ0~Ï_áG2)®Ï¿wª´ncÕP»n#o]UQb*4H:j«¶ÿûœØa x€´Áƒã»ûî¾ûìäó¤ŠEŒã�çAwÆ|€sGƵާÁÑ'ª�ÂJR‰ÒI�A(J³«žÂaDé•z–ë2Ããð: NL„4i«(Ê ²ýt]ËQLBUéWpuMPf( ‚™Jz0‚A)Šæ§¬ÙÌ‚aðm�Ç:j€¯#Ì×’DÆhZ¢¦ÃØvÄ#HéM'?ˆ K¼,G¥#iL''v¦§iÿæÃùå°obÀŸëÎ�„ -sÉ…Ë&ˆãíæi§ùrùýâôü­-z5½¿ÏŠ¥®(U%ýá± _èrµÈý1‰kïÕëU>+'IÖd²†�mçåÅ 6^&]£ÛbQˆ£-\9�ë¬X• p�êœ9!º4½‚p¾K.¼V¹%ÈhüóO¡}ôšsê€üìv÷—Ø>®\?d£rt ¿ÊYóÛ€y -º‹¡`^+ßb¸Ð�óiyÈÅ¢u16îÄÉöEl+¿·Pã"ÏõøÀ ,’ò¾˜ÍU_5Ÿ �g{å—d—üÒò;©uÕNʰÂQæsÊ“:ä�ý˜ã8¡¨eŽþ߯.`¤ÂRö·ÚÐ.nÙFLQ T%-±½-Ù¼À±y‹;]½{íxæ²9Ö�½–˜I -RÈšxõ”N miiFKš‰æHT$Ït®fôdvP¹]/š‡A¢·r n%Ç”Sbw”iŸ&!½ba7«Ï_]4v�·OvýX<>Ýé|Sžj{ôù ¡ Œendstream -endobj -5121 0 obj << -/Type /Page -/Contents 5122 0 R -/Resources 5120 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5115 0 R ->> endobj -5123 0 obj << -/D [5121 0 R /XYZ 90 757.9346 null] ->> endobj -5120 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5126 0 obj << -/Length 1857 -/Filter /FlateDecode ->> -stream -xÚµYmo›:ýž_m“ÖN-Åæ½»ºMhÔB¤]µM ¤AK H»êþùk°MBdd»ZµøÝç9Ïñccƒ.‹þ�®Âv%AbŽ»“E‡í>¢â« Õ§¨þt³Á…Ó9»„JWaŠ]gš� F€vïËäàñ)”X‰=Zé#”Ø#À°8¡ýt˹�3ýh²Zøaê¦As>v4§˜™8dóþÓùò�ízàÇËpŠ,tŸQ†e€¢Àî¢ÃCŽfæ»ó©WäªìWm àT©…,a ˲G©?ýÔcfÛèe�a�,u%2¬$–¸ÝÁ@Ÿn¶Æ8Ä.B&±€Â  2àøTDβ¹ ¸§ÙÊËyƒwïòªÓ¢NfXQ‘°—ê{å5 -#ˆ<èn”ïz^=ÆÑj‰çv—ËÏ9F,âRax‘ò\ë9>ü[?¿g4ž‘dX팘Ÿ9L.&äUl©Lü>¥ƒøôüé›DM8ãäœNüøÉ�ë©‘ÿ(ÑÊžÑ*í,îE¹þ ÎÌÇæåabM@…Í2#*�/¡`Ï„k¿o„{zÕª3µ…�«�àK:ªš©  ÐšÇLHÓÕz®Ä}VKŒ YisT{æÏç»®EFá•òèÒA�ÝU:‹š,·­zîcî¯Âþ<Á™¿\Tþ! & “ø×¢üIq@¶BìG½6 lMt/Z¾ÄÁãŒ,ª¯¬ÀNÐdYî'w˜cê=¹Ö8Tª¥ qKìçÊòš¦â"ªý"²|/HÒ8xX凼»…$¯©R“D«xâoµzB7~Áéi/Bís�Îp -ɽ(‰ViƒÙbk‘LƒI~–"»1�¸ôãE�¦>ºŒ£§À£¹tæ¦4åSôóyô„�8;‰B/ÈÆM·¼…Ÿž7Œ,·0xà²S‰ê¢é®'‘G±¬’”ª3u©¿ f܇è©èC—V=ô}…n¿a”ÿ„ÎÔó€â¢ø7¼RÖa�“¹,ü˜,8žcXNËg¶öû8lb›2¸½8vÙFªôVÔ![„×2Ì�ö OÊ1ñ!¼ž_ØðÚqeN‹y½Ò‡wFÃM„’äÂMý8péÆXD‚z¼\{¼ë€·F¸¡Œ&õñ­ÕÇõ§ÉÐ]øeÇ­Å„�„‰—ÂÿD¢~í©c#üë‡^Ó=€€¸[Di“6…öÔáE@7Hùꉂ™¢ù¶EšDÓô¹ˆ£t[ÁUK’ml@ÏZ•¼‹x9ζ”pc‡I’=Þ•Ù̹öñßè6Æe›—έji8GKG–y£÷µ>Î]Ü H3uì L §¿WmÚùí[Roôi‚tÕ>�,Ͷ´ ´6‚"ЯGC�bE¶XªáèšM–nô†ã¾n\‘üÅØÁ Ã$‰¡~­;´¿cžlK‡¯…ηßÖ(ñæ%þ½Ö¬ÞU¨úPwî¶Ø¼Ô##g¨ù*q™j9zo�QGÔ¶lû�‚¾z­^Q�dŸ&‡Š­çÞØÒ® ŸPÁÙã ÛÑ�±Ó$”ö{Εiöí2K¶fÝè=Í~Opšö–öǶFÐöUGÝâ€ÔO;ÊÛºÑVøö:ºáh–59ºi¬¿æ-’4õ¸ŠÀö·V§ilÅ<$vÓº+™i<_Ú' ˜ÛÛÜ44�‡F¡KÇR uÛŽ¥÷œ%BÓr*ÔÖ€µýW�¡] õ+Íèiå¹ÍÌ‚[ÝÖÖ¤«–ngÓ—Ì*ø½U)¹ã-Ua¹i»FoRKû�”îŸ'ë°Gà’Õþ�^ˆe -Ѷ¾ì× ³7 «!  W¼rÈ©A8ä>’«òÛ4|Ô¦e7Nk•Åí¥Ó�Ñt’º“õ6 ]^ -í÷ƒ7ºw^º\ff'O¸0°¸ϲ? çYåœçÎr�éCÚOrOý¦Á0î Ãø?yñ&æë`z>q×ý½£ Íéßîï+.ærûÿõBÿ;IU…2�>œÌWô^áÕ*XFË”™½ªê¢T=G°¸çSx%Þ»ËåÄ�ϳ–Ufå}Õ ªV�C­D!õò~ˆöœ!Zæ}¹ -Ž*ûæ5|Õ¨Hdõ}SÓªÂ>€Æø:›Ç®z1 à¥Ê—L­ -âo=&æÏ¡2ê8¸ùX(2ŠÄÉÙ#QÇìq„BÉÏ ~èÇn~ÿ–½{fßèÙï5M|<ÂÑŠd²ÇÅü—=‡Ü9$§Ù"Å©é1ò�Ð,³ûÂúðBW¾<ú;ϪÙ{gKÿoÍ,ýendstream -endobj -5125 0 obj << -/Type /Page -/Contents 5126 0 R -/Resources 5124 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5115 0 R ->> endobj -5127 0 obj << -/D [5125 0 R /XYZ 90 757.9346 null] ->> endobj -2469 0 obj << -/D [5125 0 R /XYZ 90 739.9346 null] ->> endobj -454 0 obj << -/D [5125 0 R /XYZ 90 739.9346 null] ->> endobj -5124 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5130 0 obj << -/Length 616 -/Filter /FlateDecode ->> -stream -xÚ¥TßoÚ0~Ï_a©/dR\Ÿÿê^Öµ´+¢Œ©éB…Ð"A`�hCSÿ÷9±A µ4¤)ñÝ}÷ù»óéóÒI.±f±@ÓU@Ыqßà‘‰GMÀ×$¸¼£i¬(™× 0§@Q2u4F”“N‘-ó¬˜á·pœôPL&\Ú -E«¼A79Þå¤p& ºég043’zÁL+Ž~ƒ`К¢USv0–ÁSðãÈcu‚¯"ÌW’@Æ# J¢¦Bi+"Œ!�‹Y6_ä™5’nÐMnӛtðüØtŸlD]°éœÆ±ˆ¹%‘Ž$Ëg‹¹ |Nm³vŶœöìÚšîŠIáÄüñ¤JF Lpú6ÙÚ�XQ"Q¦;±ªQŸlKE5üKSènä-rü¹Î‰8Å‚PÕ¾š—ÖÚ^Êy›§"éwŽæD4õåoŠ­Ì¸T©ëM^®vY^xÑñtÝA/–[À»7è{^éž·Øo23&g½Z¹Ø¤Åt“N6›Ú›úuûæBº¹¸XÌóãuÏÃôz8¼¹î÷=)Šx¦¸™1ÒÐiDM'Ë¥�þ1ÉŠúœ¬•UŸ/kÜqŽ>Œ¥Æ\Ä­±LÓÃ(}KÓ#Ö±>k¦íu0†•nÏ­Š›Š ÚaеI-+ÄØ¬ Ú¤ýòÞŠœ­ät÷†Xz·01�ÁÅ­Åz•+“Œ67¹éŸdê°öœˆJä}–g[3–3»Í×¹ý?½x§tÆaç¹¢ìŠkQB„=ÍCÊ;ë­5ʇ¡Cc|ÙÛÿíú÷þ5ËOÛSílOþ`f™úendstream -endobj -5129 0 obj << -/Type /Page -/Contents 5130 0 R -/Resources 5128 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5115 0 R ->> endobj -5131 0 obj << -/D [5129 0 R /XYZ 90 757.9346 null] ->> endobj -5128 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5134 0 obj << -/Length 1803 -/Filter /FlateDecode ->> -stream -xÚ­Y[sœ6~ß_±ã>Ôî¢ ×´ÓIÒ8™fÆ3éÄ}Jò ±Ë˜…-o¶ýó #`°YÛ~X.ú¾s޾s$á%’ÿx飥k»¦O-glh¹–�?.°zmÈ÷F·Á»»Å«Ä_ú¦ïgyÕ_p°iL–wá×KB­+ƒ¸ÈE—域å¥�.±‰š‹›l»Kxsó> Ê-O VÄYzõýîÓâæN�¬€ÙÔÁÕ¸ÿ,¾~GËPü´@&õ={¹—7ÈľO–Û…E(Ü$‹/‹¿ôwšu‡!~6¦Ã±eÊ'IØmú&¦WFHŒwF�…ÜÅ!áfpL³M„=wé"b"×陸 -46º­8ÎRt4Р‚ƒ¯ GByU�­QXR¶¼ºÁ/õß´ /;Ïï6±húÂo±áÍEEq³¤¹«6W5MhÒüJ›ÍÐ>6‰G¼�±-ÓõHoì­ApeV[âõM˱ì&€êw¨÷Œ>J²ÉÐï<9¾[¿³f›æ¦VÈ£už•»Öödaœ®»FiøPÓLjö Û�Œ>Ùyon²}sÁšŸ÷Ù�Ú§ÍÍ6 K B5yØÜÀ�åEs¹�‹Mï›=C�šÀ�ͦ‡õžöY®@±â(VW|§©öÄ¥~ÅÀ³ÈOÅ)ïñhÌq=NÁ›M�¥ -q)ø¤Êj, ‹¬`ãŒcõ�%j>fòCyKNO^išQüþlü+žd`T°œf Ø–w-g67w‡]Hœ‡ëÆý A·KXÀ[¦£0R*cbâÑ'1У››ãPÐÎr¼í´ýMÑ3ŸX}ˆøˆ†~Õ™ê˜Ì&öæ¿ ô‘Ï�‹qmõ£¯YbŒíž�4ÅיͷrRí»qÖîc¬]Ó#Èí~õ­Ò�<æƒòxW—#=1ÙoZÙ�Àmƒ)*(Çô-¿Ì;‹-+‹M–OðõÏಭҚ2½ç‰âñ“Ï߈8¦à¿�!èœà&x>ΛžN´[{@ ‡ÎJà%6œÆº©nÃD_Ñ6ì��s&óÑwc‹~•dÁ½ÒDixˆ�UAÙÓL=:y�Š$ŒQðt>ø‹ÛÚVâ¢×à)A+xPM50‘‰†R¯ÈzIe"ö€2çQeÁÿEà­DWA¶­"IÅL’e÷Ðâž·z ê_Wú€Ê¢|Vý‹L cÜ'á1óžÆlxú³íq[&ElÌ·„ªŽ»�e,—‰š‹»œGÏÙ*9@õ6.rt~Ê�J˜J¢R€4àâZKIŠ“ˆFÎaÙ#†­s¶Ûˆ‰œOñK5\û¨ÅÏOq$%,Å.äÚÓÜ\ µÊÙÔ~FüÐù)û–�AE™Ÿhxš¥Æ:ÉV`ê–Ç2& ”eÐC—¼[ù¹ðx ÒV£ÕB0á$w6~U�C]«³þ=ç»ãÕ²ˆÿå#‹qØ®2Å¡¨BŠÚ§SAå½hPù=+©l¢<%lýë@¼Xhè!~FYóëÜ·ÉH|@õ•i�vÄq€ézˆE¬Íž•…ˆC>µPõ‰EgÃï -_]gôÇëÖ%©^OI…Üñ4<–*Ùk{ŒÕ¬ýZ‚3q˜ aÍ_D)÷)T${¹úäcBeyß5GOvVâqíÁ‰é`ÙgÅÛ|Ñú\*+†ñƒŒ“\Ùö²ƒ©^• §ynR‹¢Ý‹H!ÍA°…Ll¸�Ätç«ÕŠ{›zRL™ôEÆòŸ¦ §5^î¯�Ú’¬m�>@ˆz®I-×íoÚ¡ç,qm|Ö¢O­Di5ðß‚ì …½óá 7åv›œ¬ª„ÔÒQæbÉßwVˆîfݼ:NÚu7^Èy4‰ž)çE™KP4 F«-thD()§6rlë\LPÑÈøÁžüý0–¡ºx”¸D\)¬Øñ ŽbvàŠ ¸ö³áb7`éÔ¦e·ËÑ¥(8 ûb×úiÊÖÎ9ân?¦‘jA<$î rVº†mÔ'müð¡ÄfàÏ1‘ëíý{³a²¨TzHY°íêøäehÇfÚ ÿK;h6…¶@)øv—°‚Ÿ.Y²g¡×€sGUèÝ8)φ×JUOA¨óPgI’íu׎�es.«¶Žÿ�i�}%™b$î~¹`Âí=ËíÖlÄzc—gEVvP À] ¬ZBÑ¿�í˜ë ~öl¤A[vë•åë²³y1ˆ¦- ÛÅhš�v³€fc[îà!;’�ÛyÖ9w}RïÉ.˜’î9¶$ïR¯:8¦Dv¬NJeŠ�<å9«÷J«#ùŠnõ{ Ÿ®°}YªLÔ/zMèk¢Îô BNs]û²ªGª›ÓÃÿÕÎýõÎe×HÕQü€•þ¸²�endstream -endobj -5133 0 obj << -/Type /Page -/Contents 5134 0 R -/Resources 5132 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5115 0 R ->> endobj -5135 0 obj << -/D [5133 0 R /XYZ 90 757.9346 null] ->> endobj -5136 0 obj << -/D [5133 0 R /XYZ 90 739.9346 null] ->> endobj -458 0 obj << -/D [5133 0 R /XYZ 90 739.9346 null] ->> endobj -5132 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5139 0 obj << -/Length 1533 -/Filter /FlateDecode ->> -stream -xÚÍXK�Û6¾ûWè¸ÎF _¢È¤ú´E‹¸§$d™ö -+K®qAþ{)‘Ô[öªÉ¡»É‘üf83ßp�Õ?rt|Ï‚Pæ„Çtjøå -±«än÷ƒ6«g¿`á fÎf_¯Àð0ÂÎf÷æFDÖ.öàM�Ü0ÝI7/b µK0Áèoýnójõó¦ÙÇÀðCÕ.ÿ¬Þ¼ƒÎNÁyµ‚€î9gõ$vŽ+Љý¯^¯þjÖÑ‚z”6"Sê0G�øYu°ÒÎ×Ú0VAu�Ò -s5©Å)¯EOj c@PátÆ·²8K™¬]áMq'õKÍ[�ì²}”å…~=™L” �ò·ÐCOÍi§g¹«wt9Ð÷(£žÆé/Çù`ðèG%‡Ø -Ë,6Òm„÷Ò K�VQ‘›�³‰£D‚ ðøxø£.¼gz5L€@�öWzÓi¤M{b-”ッ}ï½üOê¹/“°ˆÒDÙV³+O­€ô -Ÿ¦dxí"®„ æ€ L'Tr� _Ï&Wf à1Š»†ø- ƒØ(dQ°�¥±~~—–±q¦ >f|kŽq'ÃXù“ý¢¸]^™=Ø}+«±°ÇX_sº»µ7¸°ªweÕY× P_­Ò[�™Ó‰£ZôB� Ú¢ -U0gð÷vú;—�©­­ì!´q�Û(ÍL0¤éICD*×pÈûÁàûFí¡eRÈ,׿ÁÐLåÖ%Ñ�  ¡þú|ÊmÅ—¸-‡‹�~s'39öSë›Ijd§ ”VÔIœ÷òáœf»ürΜõ*Žî¤^ ÷¸¢B ÝÌÔQZy”™IŸéIfA‘fùÓFíyÌx1æ.„žùLR/ÇHmSy%Ov"•“ÿä:˳Æ�#úÉ»<¨ˆª ¸*‘wˆ2ÚvéÓ�Âa�KûQ“ yTgŸ_ÐÝ[~6—ÑÀÇùWïÛ'×VÞ” v�Ǿf -å¾ÉƼ‘Æð­~ÀÆÒúñ�~ ;|{µ†�¢OÎU›<Ô¨3v¦FÔu&qeÖ8…ß!ÆÒ¦ó}JÝÆixoÄ•¶ãÒ'o -ö*[ÏxÚØ+—«5¡Š0ô{vp±&ç»(žu]³§üÐVžiy¸»ìrQ>[V.w=ZŒÞ–UUÖäW àÜÛ4Ö`­>4Jydí^ÞÈd°Dö1ÝEû( ª‚#¿€/ÆXP¥—�)³ÌæÒS–6á9¹!¹²ažÑI €„÷c]P?Úmpšè /ŸðÖ.ŵõŠ23ŽV¡Ë:õ‘Ê Le‹Çæ�´{m©¨sL‡Ý½>q)M¹ƒ| �G—„àúÞÉûJ1c‘ÏædbåŸÖ.§ÿM±�õÂv5S‘ô#ç+¶c‰¥`Sû©ãà ÷Ášä:qÇjj„n)ÿ˜¡¸¨n$T(u£àÆ;ÂÛÛSÞ#C�…BCÓRã•ÓB¬…¦4­o|�»$º_ïO›ÒSêy‹n¨D(?Æ‚t"c�¦k&+êМú}eÚØc_«Ô…-‘%iââtÄmN°×±ÜG¶(5|�HëË?¥–JÂôXsL[ÏWz‹¡·½‘nÍÔ ²õö)“'™ì,ÄsT éM1@�.®Õ¶)s£ø¹Þí‚.l±.¡"¦¢a°d_æ�ëïäþ•=æ’aSîõVã-Ñ[o˜i“ (,�.í� çIF]G'Gñ… €-#[ü¢“Šz�Sô# .AyQîMi¥‚cXD½E„îäþ øøÔ)xg:B[yˆ’¤YZ•ló~‹íbÚ¿’Çòy=ƒ#€…‡—qªkˆ�?iC~Õ†O 㢿»ÛwŸ{’G6«@ÔŸl™Cuvˆyì‹úØuß�«)ˆànÛ�ánûÔDò¥Lªë}•«Ö{U6TÏßíË«5ònJó£ -Åú ŸcòCýK1?Óoû5önªê¶îâÿú§ù˜«Æqõ´10OÕdŸ°Ï¿AãÕendstream -endobj -5138 0 obj << -/Type /Page -/Contents 5139 0 R -/Resources 5137 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5141 0 R ->> endobj -5140 0 obj << -/D [5138 0 R /XYZ 90 757.9346 null] ->> endobj -5137 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5144 0 obj << -/Length 2011 -/Filter /FlateDecode ->> -stream -xÚÍZío›Fþî¿ÂÒ*µ©bÂñN6M#6I¨ãnµSFàßjƒÇKÒlÿü¸Ã†N?L«æ{¿çù½ÞCÿ†*;”E™QyAz›;¼ÇÍ@ºG¸´?àÌœœsêPeT‰“†Î2_AŒÈnèø_Þq¼t4âdVfߥÆEö`Ø¢ w7Û5,*“ÐK70HÜ…ÁÑï·�î”;`"/�lß¿_~g‡>øaÀ2¼ªˆÃG\a ªÜp38žVÖ{ð±\§èÈ'4ñßL ná(C– ‚*„£`YLmG^,�€øŽYÕ)("ÃEÊ,ǰ²Tð3 tðhtFbx2 (: ŽFr’í]bLXPòïßç]£²OaXI• UµÏÊ{TF”0Ükÿ -xÁõý$¼�Ât[ì�…n“bŽgTÀb‘ªŒ b>‡ï½Ëoÿ´¯&¼°šÀÈ -WYí„ë�Sª‹‰y[i“^#Qù ‰î»Î£ðOè%£x =´D^Ñš™ºO£ÂQò&,q\ŽÛå¤üP©«/¬Ö( À³¨àÿ†À(B¾ÂYa$•*œè ˆÐõVEi[h”)jÎ -Æ‚‘Â7¸%0QPá¼m4sŠxÓ�ë­)°À'…õºUÐ™ÉÆTU� -Räp‰¾å…1¿›³s¦.ÿÜV§.lµ¶šÐàÕ@¬¸uëN»0±oÈRoqŽÃíS„îWD³_Y‘õðÿH¸æXV:.Šö#ôQLŒÅâ%i«†>7[ÜHlËö <Ø%O¹7^�ê:M4ac� ßµ•r�@ÕÞ­LLI„îÒ�––šR§¢‡iäÕíùnôT”±§nb¢‚G”ùS÷ÍZÂ4i§Íõm›ÐÏœ8÷¡ãZØÂhƒ’ú¥ã? ŸÖva¬ô¯e¸^‡�(¸/ýÓGûù  qÿhVÂÛÀä´cåþÁ�pXUj\µú}z¡O±¤qB­3q©¾KɸwáC9‡º`;ô—Í…{A˜ Ó}A½F×^z¢Z©Úa›±,¼µ‹60"'ð Ë+R²Ð[Ú\—´©ëÎñ\ÚØ*ýÔƒ¯¸øÿxUÙøvHý)ø•›wBÃMˆ7$Å�‹ãVÕ]d‰ÇÕm4—ÉcFÛ£ögB³S±Eåp¸�P™Ã¢,£{ &Ž»�„gÉå|ÿÄâ\69˘çεféÄrHëÜ2?}RÔÎnÈÙù’›ÙŽá,RÕfd >e:–q¶pL‹,ôÇšM—~ûv7¼Õ°øþ¹L›|úç¹¥Ûd?Ó"û^ͧe‚™ZÚÌ1tû˜2OcvAê;q:“¦Æ•áÐùŽy¼E;¾7‡”„Êyñ{¥[ãKÜ¡�Sù© ÿÜpf%ûsJ_# -Õ,Ç/¦iž/¬¹iwqèŸåJ+šöxªWúG0Àåb¦R%šú¤Ïˆ|íKm:í¶/Êå¹y�éTIÚÙ´‹�Ø›ÍN‚Ô¼&†¥��ÒpjÕ1ö¬š)½UÌõ±QÖôÏ:V°fÝ?cdëx"Û¿ÿõg¢]iÔ€²ËÏ¡–ŽCÁxaéW¥Â¨5Ú‹³Š–.Lsbwp蟩”lÝúdŒuûg‚Ó´kޱ°u‚v¢9ZMƘv :™¶ž-lcç.ÆÌÑ-k1w s–_Ûi(½i\š×ØÞ©Æ5 vRs]sV35ì ¦uS%™Ùxî÷„ßõ¥Ž‡Ñ(7Ûs­4KûËØé`ÓÿX‡AŠ�Òi°6bcúÅÔ¸ÐgãšG›ƒkÃÖw7sÍ2ìržQ̵vÓÎFè'45«.cVS½§ž3�wÁŒÀ%CµÉ'£Ôò³•qàµ�ýŽG´sêŸÜíÅø’zC:î�‡Ð?¿9å‰l÷ÌE[¶n”´œdË×Hg‰rã§z/ -$QzÕ×òü{¿‚§žÛÿŽ�Yæ•ì4Ïá‰Ù—> -%ˆãY&âìÃ~Ö²ß+Zø�} OI%ËEù/{Êñ§ùË€,S¥å'æ¯/YåùŸÜ=Ñ¿øþtŸýÝ@öA¿AJÿ&¡ôXendstream -endobj -5143 0 obj << -/Type /Page -/Contents 5144 0 R -/Resources 5142 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5141 0 R ->> endobj -5145 0 obj << -/D [5143 0 R /XYZ 90 757.9346 null] ->> endobj -2468 0 obj << -/D [5143 0 R /XYZ 90 739.9346 null] ->> endobj -462 0 obj << -/D [5143 0 R /XYZ 90 739.9346 null] ->> endobj -5142 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5148 0 obj << -/Length 1024 -/Filter /FlateDecode ->> -stream -xÚµX[oâ8~çWDÚ—2RR;ñeæi¦¥ˆŠ[Riw.BDS–ÍtýÚqÑÊ„Mñûøv¾ó}Ç$,$` d1�9‚¸Ôš­[ÈZJs·ù°-Çíý _üÖõ–pÅÔòÙ¶üù·+á€Û¶±‡®ÒpcÏâhÑïÊYµø÷–‹¸ƒ<*÷VS1aÊÚêøå�¹?¡ Žû§õí²æÒ¯ûrˆàžõKv�B`kÝr1):/­qëÏr=�-0Áò€˜pQKZ‚–0™†Ei$<Ìåb�›»<ú ¡9Œc°öì×™ÝÆÄ€\KÇ¥®§wcm›"tµ{Ýó`¡;iíød—wdëS¶z»’›ŒB/º>ì£vÒ.Ç$T°lŒ¡#ЄãQ÷ 4 úÀç0ww>ÝM˜2w¨Ào!38rŠÙ7\Û7&†èÊFÅÈ*Ð  v‰!ó_? æÅÄmœ.WqZÐÒ9I#ŒnmŒß�¸«p„Q¸ §/á¿Á¶Â+ïœÒeô€t�–ÚUM“x3ùIⵃ7–R “]8Kþ¯v9jÂ+‡ËjWùm�ì"ÞêÆÏ Ø„ÑRw’w Ã¨ný¤«Î Þ(/ø…ó‚Ÿ5/¸1/¢$\F3É*Þ)n&Š’Äœ(Ü”(ü¤Dáõåaú;\§k}j”®Ÿƒ\YqÏ¿é†ü›�‚Ù.Œ£¤B¢Q ¸¬ >§ ÑùCç¬î<õF“›áànòðù/ÕtnüÞp0Ö£.2�-\“Ñ;E‚ž_/òN ¢ò–)±‘J¯”k$~a)ˆsJ:¦…~oìw£á£_¥@`´â}5”ÔPŽíÅ9¼îð-Ÿ¿÷¥‹E!…DÆ4gšÇeÒ½·nºGÎ9àžWÛ½ƒ\›ý¢GÈÈ6qmP VÅõ—§»»ÎãdÜûÚiÛ)¢±™in´Š“˜T;”7£§œé×]&Þ΃mÑ�ˆ|a¢�œ“hõu[Aôß~g2|¼í+Mœbl´’“˜Æní >Ýæ·x’n6åi=ʱ׈rL/M9;+弊ò,ŽŒK“ñ*ÇÂd%è$º 4§{¶ -f?“t�4!œ¹¥ßñÀ—kŠHúÔ£'Õ÷²Â$—K¤cûuIêFxQ¿Ë�PNvƒ(ØNwêSLÕ&xõ|(÷ªJ™æù—¤Ÿè#&å5’õ0’¯ YkÑÆ^·¬Ì©^вÙN>ñùU?oãß¯Ë zU|4Äç?³Xendstream -endobj -5147 0 obj << -/Type /Page -/Contents 5148 0 R -/Resources 5146 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5141 0 R ->> endobj -5149 0 obj << -/D [5147 0 R /XYZ 90 757.9346 null] ->> endobj -5146 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5152 0 obj << -/Length 839 -/Filter /FlateDecode ->> -stream -xÚ½VYoÓ@~÷¯°èK‚”íÎ^öòô -Š’>•*JíMcä8$þ;c{m×ik(Rö˜Ý™oŽàRü�«©ëI�h.”LêÞáö¬¸‡òÞæ�×çð”iW­˜rã\ƒ"0w^w÷»=æQ�vVç—8•´„““o£é"6Åâx¬¦f–ŽÒh>ëÞ .œ“AeÙ“\Af÷‹s}CÝ^8”píKw� J@kæNÁx¹ˆ�¾ó±ÒSò MþIàM*w< -¥ƒ ýõ -ÿ€ó «Ë8Ñ@…ÛÔ.ü\ö<—h"•wcÿp1‰BÍ¢4ÅÑ“ä'{œá ‰q&BáX�ÄóÙ¦þÃBó‰ÒLÔ´ÉnOQÚ9Í8š™bqu~9<úðþtxuŒ“³“£·ý«wýn|B®�ÖÔ¨Æ]¯Ðw¸ñs‹­”ù„*íÙë~ëPæ5•™\fu³L£`Y¬±„Š1±ãxüPŒõ#–› ú�s/`Ÿ¹ì¡Ü÷¯çýÁù&ž«]‰¼qW<šøñ83‰²¶c4 âUhéÄN&f›ËqÛÝq™ÞêÜh±ˆ£ ï!Ÿ¨¤Küƒmý«eeè¡Èã;a"+œ•5±HæŸM�’ÂIБ��†”¥ÛOÝŽzZäî%ú`+NÏ–ÓtA&Ïò³>¦%kP”Õõ68o?à&&Žç½õ<‰Ããoƒ-@ -Ÿ0!X ¤¿�©‰g&­þI†ñ» u Ÿ¶¯nÛÜÚÜ.MòÕ$¥ÁÚ“’t?n…“`T•¡õ<Þ®2ðÑJðkè`?賜Ç_«˜SâKݦÏ„s^GÇöƒsÄr’ªj©$ŒJÕ!ÇV\ÇרD¥m¢fFãM��pÕîh¨[f‡Ãª£Ÿ ‡ù!ˆÇ¡ÝKÞ¨ÔÊFØê‰}|ñȪ¶À¾ü¹%i�°Ií©IïÿC©³T Ø6Ù3Ål�’ê¯lNÁ}¼œm2p…ŒŸTÎðbæB %ƒúÆÌL2JMXpíŒeã»rrÑÙYÙ0;ÒŒ¿`–¬3JU1w™Ì‰U¶¸Ïêo¿—„þÛ÷;s�Êg»!J¿Qˆãâendstream -endobj -5151 0 obj << -/Type /Page -/Contents 5152 0 R -/Resources 5150 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5141 0 R ->> endobj -5153 0 obj << -/D [5151 0 R /XYZ 90 757.9346 null] ->> endobj -5150 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5156 0 obj << -/Length 1973 -/Filter /FlateDecode ->> -stream -xÚµY}s“Hþ?Ÿ"ã9£uZÊò–Ðsœ£ 6ë¤!±:ê(Ò0ˆ¼´z÷åo�Ý%P GôÆ:Ù÷}~ÏïmwCýC™ŽÄ#ó‚4´wvx‹š¯wŸ¡þ³Ã—æàü5'eF–8ihnò$Àˆà†¦óñ¹ÌñäŒÙç÷îÚö=7Hûä³ùf(°c†%´p6Žãå¬u št7 Fä%�íõ}ðñ3;t¨7–áå±8¼G–²Ì w�ãIŃ·t�¢#ŸÐ$“øf¡€À ŽHÅ!!G‡B–} Õ!þ±È°`<ŽXŽaGR…Ñ(Èà³ÃÑiˆ°�X@€�pr&!ç9£ð@Ò -ã|À‹y×íC¤Kò¨à¼}VÞ#3¢$€áAû'À –ã$ám¦ûbok¿�‹=8ž‘‹Ø”AÄ|ß{�¿þi_Mxd5��¹ÊjçX|¤2n\]LÌ»ØJ›ô+|ŽŽâÓq7lR{*ª7îº(àÆVfÆ¿•gù‘ÕÅl1‹Pý0˜[/.äsX»½ï•xÞãv«ø™™æ²BD^N¶.‘e¬5Y# ‹_'¼üÐr(½EaoݺÄlÇŒ$sB…zËbx��ç»Î& -wµ�c7ºs£˜)jã�Ü啕U¡ƒt·v£¢n°ø–ï¯-û[t®7ôM؉q•º5¦ÒË4³C¬»XÂõOÂ?± �”O•’&žïýM„¢ƒíÐq/:ðó½ñS§ùâX‰µEšðÝè+²è?8­9Ö; ×F”#ÚÁ¿&ñv®¦I+kFu¤~—ÝLLñ˜­�±ðþÚjRCd£JhlÚéE-ÖƆqo³Ø˜¹R‡ÔrïE!1e+³÷ªkQ­›â9ö(¹¬4نسÇÂ1bšß\»ËK µÿåMŒî^u ¿Sý× ~ŽTýíÚçú{Ñ$ÜÿŒ¼Û-%™Ø™UŽe¹Óúº´%öÆ¡ø>ŽÐ˜˜Dë<Š;][IG5ê Pw/N"o�–MSQ“Ž{â0�l·6jíV„Cú&Œv1 D^²Å.•-( uˆÝßÏQîð6ž�;$ÞØŠ0Ľí¼„æ�}Þy©•‰†zî&ôýðÞ nI¦ ¯Hlíˆû -oç&‰Œï>T•WãÔ¡³\б¤1=K$Ñ7e¥š;:‡¸V;ôÇ -94taâÙî)Ù—œÈ|�à¢G˜R+U;lS#âÂö-”L#ìpϰüXªBîìáºØ& Ö�ã!ÛÈ*�Ôv og˜ïϰ]�‰ÿ áíü -ý—Š«rJ÷uB;­ec› ÄÅ�•¸‘g‘ìH#A;^±?Þ2à•,£Ëú¤ÞÖÇcë3ÉV�µs[N$‡ç…�õ“ê¿zNGÑÞ©žàÝÀ #’Ȉ»]˜tÙæ¨?u…�é ]Ý0å%¨4Ò8Ü$÷4Ž’´Rtí];K¬‡p·ó>>BËQ–R‚ƒ Ç�hW>&™ G܇gÐ(pÚkóFÑU|MÄ­K]{§ê´¨]~À4ÃÔ•9Óô¢üõ«b�ÉÏžáþÅ”ðTõýRW £Ý„þa‚^/ç�`E²èÊ„ª�\Læ«)\\áúåÊ, - æðšd¾©�Ö„%Ë·CïŸJ”ÅÚëâ÷ZÕ'3Ô¡\Â94?ÔØ| ÍEFbQ!â+XeŠnÂÉj®àæåJ_j†Ú»ÿý—ÚÉ“¹¯Õ) -.€Ëi&¬b…¿S˜_c¦Ìçt©=(—sµ.² vúŸ÷§PW'&µ�Zu‚Œ±?Ç ÆR�@ZSß«Èý®ˆma¨oWh"Û¶ÿ¥`ª\+WÄF²«É±ÆŒüy²ÒÕkªbpÆêÒ0¡¹2» ¥ιҴ©QeÉPõwp¢bœšQ³ý•¡b´SÅTj#�õ“ÉÔrV\t‡•þ¸0U]_-M¨-Ê›àL»A&M4® °Óšwj‹ZÌCÆ®éªBf6ž»vÇ[�Ðÿns3SÑn$.¨]šºB­Û0u81À¨jjºÙ`mXûßjêÕ^©‹‰ZÝ[Ë$¸�†Z’®èÐȶ¯ˆEù½Q¹«šUÓ0ƒÔTï�Ö"öϤ$ž–aÃÅ;*Ów�Ë€(Dð0Ø—Ž9™oÈ‚@Ç€Ž95ˆÜ/¼¢çïe•ñ½%-‡ÊâW.s²<'å8±ìo]BñG Õ?!<…ÎEí=”±OïŠ&Àpô!H:G€< � Aºàñ[¥E߆ÔøûÊÓÑÄ£D“~çÛ›8jx{Çö?¼ÀöSrá’z{fû¤i¼Ü6Þ÷ÖÍS$¶qJI}ó,Ð8+rãпk™Òô¸(ñMë¼Ìn^Á-³}Õ4Ehjñ:Ž»ñ¼Ì�z9AÅ…ùÅD#“Ë6}p F�¿Yd¤@¥_ú�A£)€ç¿5KŒ<âÇä /‘gl7p#+Ë>¢g·äì÷šÞœñyŠ+€Ã¿ìÇ_plQË|¤(mN81¿f•ÜýóÑ ˜}ÖÉ~§á�Ÿ·è‚T£'ûPÞÀÏ¿_Êendstream -endobj -5155 0 obj << -/Type /Page -/Contents 5156 0 R -/Resources 5154 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5141 0 R ->> endobj -5157 0 obj << -/D [5155 0 R /XYZ 90 757.9346 null] ->> endobj -1539 0 obj << -/D [5155 0 R /XYZ 90 739.9346 null] ->> endobj -466 0 obj << -/D [5155 0 R /XYZ 90 739.9346 null] ->> endobj -5154 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5160 0 obj << -/Length 1022 -/Filter /FlateDecode ->> -stream -xÚÝXKoÛ8¾ûW؋݅T>$>ZìÁmÔ4iwcíî¡- W¦c¶ìJr›t±ÿ})‘re$»H/MD$‡óqf>’v�þÅŽD¸'©ÏœxÕCε>ía+vµÜÝŸð"ê=}E¤#=És¢y…À°Lœhö¾O|4p Gõ·gït3@}ì!Óo¦«ÍR™ÎÉ:Þ®TZL‹d�>Fç½0Ú­l (Ã废{ï?"g¦ <ï!�J8_uyXJâ¬z>¡ugÙ÷þÜáA¥ù` -9È=®$Ú_nüc¬4Uk»Òó™˜A>pBýßfjž¤Êtþ _¼¼8 /£É8Faõ÷¯ñÅÙehäG½‡'áÕXGÑ×R ÁÈ#`N†ÑpàúD‹€ÁÑ//Fcí-e�¬ã@~Eï^] O'—£2@X´DˆÓ.åÑm j‰ -÷»TߎþOô­ñº´Ã««Ñ•ÕmΡAh œ�G“tiÙB7h -)ÊÅ8û®8jQÌ7ÓXÙm†nD‡€- ø K\^ø¸ngÛ¸0í¯êS¼Lô}0)gX+òç’ ZzžV2,=L„>ÛXŸ}_T3žTßã‚`goÜýù?ÕJT2Ob,Ž2˜­i -<†|z×5f\‹ÓÌ �ŒÀîN$<Ä$7ú¼áU²RÅíF}@ú²Nfú òh·â¿�LÚCš©b›¥–.¯F†x“vŸýÉð£¥O’‡Ñ'i“¾y²Tétuˆ>é·Ó'�¾¤ŽuPÇ/uâ�ÔÉ&u‹u^AF¨�;Œ0H^‰ýœOÚÙÈîÓG¨Žò=ú¨Îò£ ßì Ø¦yr�ª™�Ôb�`(‚&]=ó U¬‹*RUâÂT‰.ªä}ªè#¡ -Û _Fòã&7Išä“n0Gýpðˆ`÷´V6ì�_r0‰×iªâòw�ÑEG�QäÞ^øÇ¡ÇxŒÀ\¼[áZ™ú¼Uy±TóâÎRyòM­ç¥+‹¢ØLôÌÊ�Jæš�íýÞèAKû i bÔ -ÁP&ÎÒå�ù0Pù¿ãÇ€‚Ÿe«�ŠL§5; m®²ÉôÚä;j9Ë¿£Â8üŽÉgöõêWÇnBí7¼‹°_6Evg» XUB£íKj:SÙR¿¹Ž¥¸ãj¢ä׿šš ìaŸƒ•)äè<“ìAÅ¡ª¼%´ŠÞ~uK›Í©(‹?”hEŸ‘�)¥©§*U™¾ f¦ŽµNÍ÷mÝ8à@§¶öEì=#ô±…0ýg¦5� ¿ÎLç~ÅìÓm],»¹Õg¡¤²~DéõÝžoendstream -endobj -5159 0 obj << -/Type /Page -/Contents 5160 0 R -/Resources 5158 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5141 0 R ->> endobj -5161 0 obj << -/D [5159 0 R /XYZ 90 757.9346 null] ->> endobj -5158 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5164 0 obj << -/Length 1373 -/Filter /FlateDecode ->> -stream -xÚÝXmoÛ6þî_¡OC²Æ,_Ä·°vi‘ k7ÄÃ>t…áÈr"Ô•\IN—ûï;Ф$+´c§†-ù ™GÞ=Ïñîx"‰0ü“HãHr‰4‹E”|áè†_�ˆ�A>îOx1=}Eu¤‘TD“E£AÄ)¡ÑdþîH#Â�Ç”ã£ÏéU²ÌÒ¼FÉñûÉyc…0 ØÌ£11££ÓIkÍ�áLcëÓèÝ{ÍÔù#¦�>ÃŒˆÖ4ú8Š)ó?–£ËÑ/­+h„8qÂB¤D#OŠGi9ÆŽÇã£Û"›7\À-Å"æN[yKyš,‹*ýsl–À“—q»ìKP(ŽÇD�´BU=«S;õ;ûøíôÅË‹³Ó7“éåä‡ÉéôåÅÛËÓçA5Ò®ø+(TVø´R†4Áq4&à¼X5S¾µ[‡¤¢QoxüÏÿ5†˜€�¨mH„E=Žl¶l@M[jë¼Ê®ótn%7³2äˆ7ð:­Íöµ †xPRì…즨êgŸˆim_WEéG§v‘-Ó6–Æ"”ƒlÀ„숩˜ú˜ªËuâ`­³Õ4)òÜáሚ,Ý#Ì"sãŽÆ†9æÌÙj6Ÿ—à ³@c¤¸f{±¶ �!Í‘ˆÉ�sÜÒšÕYÒÑjm6#�š¡[xpÔ' �3ÆP,Av2l`êC~••Uíw:M>Ø×laŸõ�Kf&NT9ˆ¹}žýÜAN« -ÙüÄàµX’4VH)̤cfý³QY¾Ùî%åW-Lf€—Ù•s1„­ì~3'œ|]äîÁļ1ѾEê ânè‹£ËbÄ(áàP -ÓuL6£¨"Çto|°GÅòvº,Šë•÷ƒøôà a:,Q‡Ül(Y´�›70;Ðo~½¸rj�L�!`ŽÊ´^—.ªpp_9sƒG÷¹–3‡ûÌiÊJßݾ֤IÝ‘ssSyeFM�4ô:õËàèf|ölà6*»Mà]ŽÁ_´õ’®1aC¬+Úy²º3ä*dÎç¸Þk•ý™‹nÆN7Š8¤¸—½׾bÜÛ£Bø¨Èò¬öQ�¹Qº]•/Uý Ù2Uíèt„> Ó!ÿ­VGºæeãô W^B òr:CÆ� út¡¥SîÒ%)VwS”,¿ÞQÙáÈ`€}RóÔ„—µÝVÜ b�.ÒÕRn3,)|x�çû†«29Ùª­y[¦y×h ;ÅÄ ¹‘lG‘�Ô²tíNµœ¡`@Kˆ}£Å¾=i5„W‹é åÿ¶ñ—ê~6lûn“®*Ti>ŸÏêÙCl -ïØsE|·ÛµüÛ6Gùƒ  `N‘Àt?þðmR¦ŸÖ ®¿€�Y¦b=°Á¾ÆF²ªË�Úã /¾qW¨ƒºLÎ)ßoi߆º„;‹ ”�£²Sz¯—ë -‚ ˆk¼�iZ“ÙjeÂÀwmˆK:è&U°ùPjØAá4ò¶á©Wæ;óÞë�ƒÆîàÛZ+”>ÜþF3l-Ú§sжseP´¹{ÇÓ“'ÈÎ.ßN«Õ,IŸû|Fòy`Š<Ò±‡ýJðnÕ48ʉ))óe•‘‚+˜}š?W°Ñk%‡à� þù^>Øgjù¯ïƒ -ŽêGâZWi9�]›û§E–.çÕI莔 ø‚Þ×âH#è¾ÅW]Ÿ6—¾ -–Fûw¾p@K¦üõ¨aø¾Nó´œÕ¦‹2÷¾EnŸ?ù—óc¡Ӳ?uOüŒ²gÛ_ð¥*ìÛâ˜ò£¢´?Öæ¤™�ÜÄ«;ûü±øãü4t�¹Û øçoÔe›˜endstream -endobj -5163 0 obj << -/Type /Page -/Contents 5164 0 R -/Resources 5162 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5166 0 R ->> endobj -5165 0 obj << -/D [5163 0 R /XYZ 90 757.9346 null] ->> endobj -5162 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5169 0 obj << -/Length 1411 -/Filter /FlateDecode ->> -stream -xÚÝXÝWÛ6Ï_á'– lôm›­Û¡#P(ÝÈY'Ç$Jð©c§¶Ó”®ýß'Y²ÅI:ö28`Ù÷ëw¯îÕ•- ~¡åË¥®ãc¬Á¤¬±ø|Ö‚šl º½Ìðº×:CÌê� - :Adõ†wmDPÇF.pA{vþN )hC¨A÷s0™F\½œ$ƒÙ„Çy�‡Iܹï]´º½Ê²F1ƒÒîÇÖÝ=°†àE 8Ø÷¨5/À�¾�¬I‹ \¾D­ÛÖï•E(LþQˆM2K|q,DÂ_Wû„/�ÚYžF<þ Pð˜çÓþ,ãi? �ú£�GÃLP üûI:'ìÙ¾C¡Z 4~ÁÃ@èŠ;6ƒWê‘9cž§üãŒgyÄG¹úú‹zÌÂi’I{@ÚûÕ¨wl‚ž3™‰f^5kv…jÐRuÆã¡Ô½'ÿ-„ï–5Móô^Ú>PðUׄ‰‰h{‚雑ê* f¢§ˆ‡aLJ€X6Ù@¼‚åÇ‚B×CÖÒgûå -CØgôÖa€Ë j›`‘½Ã+®ù:+dñ ÔøSMa€@уÁ^ÌŒd”ñ62CÅü·‘ˆô\Ì ëçÕÜç bãW¢5„#‰¤1©‹ìlBCÿ«R�l‡R�î.¥= Ú Ò~µ!ª¾A\T“’Úß �@S-!ØPKýok á絤Ü¢¦Ašñ¾™eQs™"õªXWaˆ6ä4*W»Ác� 9  í܈LPo‹Ž†=â¯hw�6=msþF…#UA••¨{{e}Év÷ȃ!O¥ïUþý¬éážèú®s– ±)‹ ¯ËÞÌÞ—u_$¥hÒTÄb«PItUŒ‘ç0m-å²L§Ã t¸s×guW0ЮìïëdaÒƒò)ú“‹Vi{Ì®»’Ïj³¶½n!Àå.#4NSS¨õs~{Ó�£ s‰�=—{ e¼�§ñ`25aÑ[„bƒÁ�Q¡¨(I-ó4ÿ ­KéWº²Äôõ«Q?+¨ ½ Th†ê®ƒ -·†º)袜©´0¨êRKïçÚ¿_»÷¾V¥„FQ0®)|Óë½;½<>ë_ß\w�Ðt¢-‚'Ñ-L$ÄÁêòQvœEcXˆ$.:˜ Ch¨?±ˆ0R«¿bÇ/EoÞªÖƒâ -½;t…Z*»U Ò˜6Å÷æ­9ºXG÷›âçQÆÕhc¸1€æp ÂVán*Bª,oB€Ö!@/2áô»'\Ä@)¾J>ñ¡nø<�±8ÛEOêC¢‹ ½5:MfñÐQãËdPœj�´ÃE¹é­�(:½z—= [,6ž Ý<Œ"%1HÄ9Ô-9œ«AÌõ Ò¶œÝ» ÎN±$;Xì§W�¸[fçÕÍŸÝs‚zëÔ> endobj -5170 0 obj << -/D [5168 0 R /XYZ 90 757.9346 null] ->> endobj -5167 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5173 0 obj << -/Length 1556 -/Filter /FlateDecode ->> -stream -xÚÍYÛrÛ6}×W°y¨íÚ„q#H$ugrqÒdÒ4�¨“‡Ä£a(:âT–Šªã6ý÷.ˆ¥DB°.®jψ$n»{v÷`A²€Â? 4 â(&ZHdW=|†æ=†Ý!ô‡íOú½Óç\šhÅUп¬WPŒDœñ ?üp¨ ‹ŽBÑÃëüS6.òIE²£‹þ«@Ò„ÐHÁÂf—´öÎûKi¨L$3²¾ô>\Ð`J½êQ"t×ð@ ÓšW=ÉEó0î½ëý¶\ÇvÔ|6ELøŒR´Ä”5Fq°1¶6q…ŠÒÃjCM¤’v&¶ó´îä‚hFe2Ð@&õ�¬ý$NxÐjïÿ¯$´Xr›¬­„Õ:”K”pLÓÖ´y•VEfï³QZú`ˆ)ö§ó<»š}¤]Má:â;)4¯Jv‚KM'óÊ‘ºçRü¤5¿¾çÐ�Y³YÌ!^! º¦0;ôo¯�ü(d‰{÷È;Ix[%.u=*ƹA ”³Ëüd/´Vuƒ2�k‚±vÐY=b[$Rï ·U9T€…RÚ‘ P‚ )…8ñ,­I¤dgéçÓ2Ëôéu^†&4Vx¥Y•—sROf"!*�äÛ!m0bD9UÒU7Fu‹Ë:­¸ïͯr+ �Ì’¯ývÖLåÔïY�½Ü�ÐŽ:Ö;œ(Ê“�#Ø*ð*’¹„ÖÛ‰#˜¡e^-J *æµ á-Ø{|¼ -wŒl�áþ1M¤†!¹ˆÂtð+coÛ"¿O’d]'z�®ÅNÎøÿóµ¦ë|½`jPù€ÐF³´œçƒQž!M”ÚkdéNçÒH tÖ’··D}ÛÄlV•�6Ķ–^LæÅçI>tù¸ðFˆŽ¼­j+#Ÿ ¡Ìɨªfºq1ÉAqÛñ#öåÓ:óÝ‘Õ-T¤*sç~ðˆ½hó?‡Ú%8w -¨ÎFÍ�†5ßy"[³A:› Ó*E�A­Dbíl¨:Y„wçÚÀiQl›A»é ·qôvz¨‘�_¾ûu0oö¥  ŸnI†õ]ô=n™£ôO¼K1&¡´.Jlû¹ß‹ãj]1}AcLƒ‰?b±<šOo/µ™n*úcàºnà\!Ä^Æ L‹\i¡ºÅ#ÔƒVnÃ(#’Kü—fî€TÌíÊ×)ÞT£¦¬I›úÔ�º1  99i‡ô”_ͪ{ûà#²4?“ÆÇ!1#±`Ž1°•Ƽå�´‰‚á´‘|]T#GYdxG•Y9Íò†6=³ J[¤c/¦ -Õ0©ˆQ@)�ÓW´OG#Âi9kÇè¯91$Ÿ7ìV_ÞŸ?yúúåù›þà]ÿqÿ|ðìqÿ±?¹\¥]2ÜÊãÎW5F½­MZïÂV|ˆ¥ØEÇ$o#¿3k<åÙvíË)ŠžÏò¬¸l6L?c\ùxØå@ª¥ñ>9Í#A¤Ô±cH7§[GÄ[øÈ4àøWÇ ª›´ûð1…€à��vmæŠèW- ‡l9óJãŽôñ|ºhRí©Õ*4ZµÐî¨Þ#uÀp’H—­™B]³eÌ�5Ua™�Ê ¨<:Xm©.MF¢ —‹7“7¿¿~½ ÆÄÂå®Ô»V‚¾<ñÒ"Ó¨¡7�9m¥*'ÙìÆÂpU\å6¼¼»£m=ö®†2ºwì�¬†�MIè…Ÿó%;Ùd¼Ü�÷I©ñ4ƒ’y:ñ¦7E{,×MjfÝG*qykxî>ä£Rû(êUy[»‘^Ç ¾Ï•Ûhš|Žï€D‚F¬�8Æ©±_]�€ÑëÊÂM ÝÈ–}(ÆYÇÇÅu$Pœt_eh  Hïvznùû¬s˜úöÍæ´Žp§t¤²{tpz°‹(~¢:—ÍòÄ}È{xàøÍ}£Î“±÷í>…튩Hý§—íõ'‚¦ÀFÜþBÃq_¦£Ɔù$/¡¤Ú¯Ó‰½þÒܼ:bœæíƒ©€ê+}ÈÅCÃáæ xPÙ»Ë#šúÆ<,^¾ÅÑ~º±×gÓ¯7Ÿá(ïÀc¾xðùûRendstream -endobj -5172 0 obj << -/Type /Page -/Contents 5173 0 R -/Resources 5171 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5166 0 R ->> endobj -5174 0 obj << -/D [5172 0 R /XYZ 90 757.9346 null] ->> endobj -5171 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5177 0 obj << -/Length 1192 -/Filter /FlateDecode ->> -stream -xÚÍX[Sã6~ϯp_¶IY{u¿lg;Ã.Y†½´¤ÝÊ0&ài°SÛ)ÐNÿ{�,9„Dq´…K:·ï\td G~q¤Q$¹L4e"ßöPt ˇ=ìÉ1Ðãe†·£Þ«÷DG:Ñ‚ˆhtÕh8á“h49ëÆ1‘H¢þüè 9êã¹Áð>½�M�›ãù­Éë´ÎŠ|p>:î G ˧[»¿÷ÎÎQ4€Ç=”P­xt”`­ItÛc„¶“iï´÷ãB�#4!ÿ8¦!E+áÖAþJç¥àŸFõ«ä¦¨ê³ì| ˜¾qô½u´Ç:a‚q/ĽÐeiÒßÂ,bK,©ÒS׬ZfLi¢´Šb ®2Õˆ|×PX"‰––dzºtöcLU"ÔŠåíìí=r®bÑ`[lBÊ ×œm¤bO­ê2Ï~EUÉU65/�CÖªVÙŸ¦¸z䀶APŒxůª B"¡b¤–Ný„¶®g7&�˜ršå�8 ±{„3�%˜â pCðñ²%öI¸\ =£ƒ˜‘��cÁU\^“3ÇI" U‡N¸`O~5ß–Æù7)r?š¥e•å×mZ -÷¼óÔÒT¦vÃú¦•(²¼6>|i>ñ’uZ.q6¡X$ꉲáBýÜÜ{›�ÄC\…–Ï 8Æà*Ç«W>N3ß¹©ìŠš„5\fZy÷ÿ -±sä­ííì-p¼°¢BÉã�ƒSO-M=/sE“‡ 1GkâŽèbIh¢1b»ôšø¿ÿq[X À€õ.|0 -§€tÅ3±(Ì:»ñE6 FÁÕ$”äÝ$­SÛ–,«mHAvÕU -ÚçfŽÅEÝ��‚«Øk±'¥:Ïf¬[ˆû¥ ÁÕ¶h2ßwmd|Q¿ñ¾ß¾;9~]œŽöGÃæÿϧ'GŸ†M,6{-˜¯æU̶¿˜ kj^Ùí`M;ü°ó®Â"¸*ŸïÙ‡áþÁð§SG|ñb‘'7øÁ÷†m^«N¯]¨¶º¬»\–Á‘ø‰ËkÀŸúµSDöGû ±�IhIT,:êÕ4½vìßx…F£/ïOö/>~þex°%t’úÐÝ™Ëñ4ƒwŦ´oà@™šÒ—7ߤåóObkÚî•t6³:_.’û˜‚Kè3PO+¨Xg*xG'•âÿÙIÕsÎÒp+•²»}JÕ¾5´©„È�Óét[#•º£BzRâ6¡ã"Ï͸6“¶ým)2Õž±URg·f—ƒ_‘…ÈòžÙÖúÚ¯L>i–�m@±µ±æoX�{A÷6æ]…­dpU=¿­¾;ù|ºí¬PzÝÑiQmñR#/ÕììË¢¬»Ùñö èΗ,Mƒ«l­*0;פækÞ¯(cíL –k¨lÁOŠy½+,µkUCW×áßl¡�œ`&ƒ—>[°àâ_Ý 47 -D0%ËÐ%Uö»Ÿd‚, X°‡&7%øÄ]a¹{~lÇÌûs?ÁÄ?ÑkB__Â�®„÷‹ÒMÖ/K.Ú{’û‡k³vCb¯.Qú…¾Fpendstream -endobj -5176 0 obj << -/Type /Page -/Contents 5177 0 R -/Resources 5175 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5166 0 R ->> endobj -5178 0 obj << -/D [5176 0 R /XYZ 90 757.9346 null] ->> endobj -5175 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5181 0 obj << -/Length 866 -/Filter /FlateDecode ->> -stream -xÚ½V[OA~ß_±}ísß›&­­Æ[ãÚ>XC$®»¸,USýï�Ù–0m -!s9·ï܆ƒ|¨¾ÈÐY¡ÜïÜzÐï«ë=Yr èÁ,Ãvì5v±ðs?î•8 #ìÇÝ‹šˆÕÌ`í^^u’�L Щ_Æ>…€Œ+ÅšS¦o½f<µfÁ0‘¶uç]\B¿«@x1ÿ^ @B`ÿÖ£˜L‰wæ}›ê1„RÀåCÄå÷ÕMÑÄ)¬| �O¢Ò (§ÌÞâz€"kƒÞOÈàx0lµ;7²«ê‡ô¯pÅðÛ)Nê�Š:ÅàVæ†õ£Yà§µ"svܬ̂{vRùôTÞwÛE{]ðáÛÁGV¤bÉÍ,–ÁGp~.nÅD§ÁñôäVT¢É¯—Êá¹·$M-ÓîJÏ�z^ª”ÉHšÝ‹³Ã,IÖ5άñÍM›*·UnÙŒ‘ù¬Ú´þhn9ÜoÇ­xÿ¨yr¯2­j„b8ó´´Ön6.–G ²re ¯²|»°ì¹,ÆyêäÁкç,'¬¼`TQ%•c€8~€Ô#B£’g£¤`‚ÔŸ!¸sÊ0à‡„F³ŒÑQ¢ aT�†—õ&Î[ºÐ�$­]¯˜Ujáº(†½¤Ý72ïl9|�ãÓÝÃÏ{­£“ïÍ�U:¹MRc&>‘#>0Nçâs¦"l4Ÿš�ޏÙ™YGƒ~ÚN̾y² Je/1]?A ÞˆjkYc¸n§ÝDæ:LÜ{ûþ½Z«8šÖa¥¹ÝQ›”¶ÉD.GYò«•dÙÍxhS“�Š—ÐO:UcY‘mÍ[¥wc™?Îëtz@�…ä,H‚ÂÔ—Å‹Z ª®žzƒD¾n�,k]B—õaÆ„›È ±1×Ú¯TÊl¡ÿþS"‚+ (zKµª<qRq-t:­txö P£ÑœÏŸžç(o@¨-QQ�"þ?”ꨉ¢¡sì…êBœñ¿šBËÙ9R"ˆàÙÑYå8$ÑdÊ´ 4È=™Ê¼]È®Ÿ³Ô¬G“ÍA±ÚØô0R®p “-ý÷¦Oªó¸Ùõê˜Õ²ÜÆû§–XÆ«G³îd�}™VãGdG|þãÝÚendstream -endobj -5180 0 obj << -/Type /Page -/Contents 5181 0 R -/Resources 5179 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5166 0 R ->> endobj -5182 0 obj << -/D [5180 0 R /XYZ 90 757.9346 null] ->> endobj -5179 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5185 0 obj << -/Length 1880 -/Filter /FlateDecode ->> -stream -xÚµYmo›:þž_m“ÖN-µÍ{wu5šÐ†) �vÕ6e4�- !íªýùk°M:2]­ZüzÎsÎy|llØøl« -‹2§ò‚Ôž,Z ý€›¯Z�vŸâþÓÝNëì©m•S%$µ�i*A‚œˆ j;Þ—#$HǧH28ÚC\Áä)è¿ÜÅjî“J7œlþ2vã \s>¶t'ÓL�‰¼½?[_¾�¶‡~lŽW±ý„+€ƒªŠÚ‹–€xV™·ìÖ§LéH'”Ù'B¾Ü@(p¸1 6X&ªÄBÀÑ“?™ØnVįˆ€ŠÜ–â€,å¼»‡‚ >ÝM�HmŒM�a$ðøTÂ(ÎÝàSˆ­”tÀ»wi×iÖ§p@Re§êYi�ʉ’Û;í_!/¸ž‡Q¸YÝ™ˆ"Äs*Ø¥*'H‚˜Nã+úð»Zšð‚4�“”“vF}€ã†”¼01í¹6éoœ*äÔi€—D¥ÅJc™=ßõüˆØ‘Ê&¥�6Å3ÚÒsœ!)QWƒPcË&ž1­šç.H©»YþðçkRùÇÅí<ÒÄMÂÅ¿Õ (X$˃_ûRa°$øå¢_©h˦�àCþ…YûNê„«ç(x˜ÅDíW ‚ þ�.l:©ð‹•ÂI*òF�qhó9‘ž‚¡¡‰üµ=ú^�*ñ GI�Z¾¬ã(¸ß¤›EŠÏ]z¤°YSB´gn¢‰_u,Ýè9[ ‹5uíSÏH‰Q5i 7q�Ùrc¡LƒIº×QÅnD!®ühıO�®¢ð1ðX-ž¹qaÝNÃù<| -–tñ†K/Hä®k+�gð~|^#Ym,rDp>¨”uát?†“ÐcX6똱3vY¼3ϸ÷ác6‡-­Jèè¥|ÂòÆNÇ2Œƒ‰Âôõ<`¸þ�¨äyXFì‹ÉÜ ~DœÀs€W¤gñ§õ³lÏ’_é…Û˜ì»E×qSjî:²Ø‰YÁ#3ÅúŠ$]‡Óø)Ë£l[!]+’l l€qWû]> ÊQ²¥,wv˜õú…è*‡læ¨yþwz†MpÙæ¥s«Y:©±Ö¡eÞ]½Kjw”A=:L9=Ó"åïß5›M~û–öº¬@§êŸ‡–nÛÕ\àAc#ãzØ7Vl‹¥ C·iÂ2�þ¨k ®hýbä�ÂÀ¤…¾qm8l¾cžŒeâ«¡7ß¶(‰ó’ü^ëV§‡;´ £o8wo^Î q"©0ó52ÍrŒÎ¨¯ÑæáÈš¶^5?¤2žt »Ó׌k½‹“ D©›™WiÀoôõ¯ÝÓúý]è,ÚE_/Z‡TmBóó~×°ôŽ“q£Pí`Òcï÷iƒ=Ô;FVÓ?ë˜ -šuGë bÇØú§žˆÇÖ€mþQÐÕ®µ+Æ‘äÓäP2ãõÜYúuF8{ta;†3rêˆÒ|Ϲ2Í®�÷’­[7FG·ßSœ¦]àþÈÖ)Ú®æhc0ûÙäŒ9#ÛÔ§•æ:ÆÀÑ-k4t s°ýì™·˜Ò,âÛ-¬NsPÈy˜ì¦u—72áxº´Oj07ÿ¶¹íéXˇƒŒ—Ž¥eì¶Ëè8{0ruLË)a[ Öæ_5ýªo\郎ž×m&ܶ¾uºfv¢>gVæß[�9wT`u–fp˜Š=F[šï¤lÿ<Ù¦= -—jÔº7FF–=€8EÛÆn²ß.ÌN�­†$ Ô\à�SƒÐ|×r²cÕöN‹µ¬Ü(®8T¦—ЩÕ�á+¯cwò£Î(t�QÍ7„7†w^¸Iåf'�¤ r(»’ÎðdCð\�ÎñJ%ÇæìnHÿE¯eßÔ˜&dšø'Wo°òî­€�^²¾¦Kϧ�oõ‹>ì œqo<.¹�¨Á¯ñœ`éÿñ4¥¬Q-iõœÌ7ìÎáUšÓä+iù°æf¯ÊfÃÒÙ›`®âŠ)¨¬‘/1sk$N¬—ãkíóxdõûl½CÊ$ e�"[þ”)�oŒWFLUþ.›œ<}(ɲRÆìZ*ùò}_6VÞ›J/«ì��Åñj:wJ‡—EOL”˜�UÅe$HÇNf.ý`œ…ëø‹¾•G{Ó$ô¥2*åRø}€~ù?7þ:^Å¥^”„ºIsZnŸXö 9(È¥} �> endobj -5186 0 obj << -/D [5184 0 R /XYZ 90 757.9346 null] ->> endobj -2486 0 obj << -/D [5184 0 R /XYZ 90 739.9346 null] ->> endobj -470 0 obj << -/D [5184 0 R /XYZ 90 739.9346 null] ->> endobj -5183 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5189 0 obj << -/Length 1221 -/Filter /FlateDecode ->> -stream -xÚÕYKoã6¾ûWèÅYÄ "%îžÒm»M°\Ô=eC–èX¨^•¥lS ÿ½¤DÙ–BÙ‘� r�øš™of¾ÑÄD”ÈâÐr¨8±™åÇ#hÝÉé/#¤—'r}²»áÇÙèâÌ-8ÃÌš-+ жfÁ͘ÄÎ&˜Âñw±ð£P$X�Ýή-ºR&«}ØvÔìèçÙF›6††”®¿G7·Ð -¤Q×#w©õ] @œc+Ù˜4ƒhôÇè÷�œz¡:`ÂD1�b–œq j@a‰Ñ©11‰¹Žý•—ŸM˜|[E¶^ ò(LÄ †ðöS…R:Œ›Ù´>éè“%bóÂt4+rãA×4ÉÙ‡±(2qC°ÑÖûþ3."Ó$®O(©�XÖƒu‘—¾¶×ùºð -QO–a6/ülîeY5;/Œ -I½û)Xb¯^Mç—Óéç˯_» -¤4ß‹"“$Û4IkÕ’©ˆ]k$sÁv«>TK“ÍšLIÆ�ú4ë?V­p@™�¬�ùÏÒ¸…çÿU«]–‰_„i¢ý·ò´ÃÂuýTPD ÷æiÜìØzw4 +¡eþ:›MkØŒc» ß ð -Og¥§­\ˆF[.|Þ‹ìQéPiö4lèlÕx±íå¸\�ÝÚÛq‰Xº±qõâ¡ãè8 ÊHt£T®Åz»±± Ûn,¨_g�ImPÇ%Œ†Õo9ny;óª·'¦ÌSð%iñh¥³ bkz]uµr/m›ÏëašD:a–iÞñ¸ç¥mý°‡.9†®=Þ7DléHÑxÜÌSJÅ^ÒPC~EÖç�;2!¹=œw«Ï6òRZ?p:ÂB„É�1^tR%MüGeQ}"†äf¿í쨠9G-ór/îÚ}Y?²4”¬I¿´“†ÛíÛòu$`÷TÓ£FÛ†ëræ®Xéh-_ÎôC8.n™~¡¥ÀlKãºOºOàۅ(›W2#‘ƒVÍW¥š9€8˜>I·¢“z§”¾’"Ñ'�\ˆÊ¦´e™©Iãø”N‡“7ßéìýsû„�€Ÿ&‰Ø±Þ�}zKƒàÿ¤ýº-ù½È÷$)§ÇÎÞoÄ�çé�ú¸ÏÊ{ÞÏûM(Ö« [ª¶Ùˆ 4΢]’n´HºYÛIqÿ¹Wei¸ìä!Àv$ê6z2Øü~’¢`‡ÊªŸÑÀÒ²û¬´XÙ:Ü«0ÔŒ™ 6¾Ÿ¢f Î GM5A·Ÿ£U¤eŒS”›f<‰¢½kŠ"üzÝ~m½Eš÷§º’²Áð"Óúf›…WÐ{® èÅkzÖš€öÔ�PK2–|ZIÀoµ$zkcœð›( -~”®7ÿþ™í$G±Û˜¾4K1{N–bgOw]Eø I±kœ5R—ÛprZN†óá* ‹Ð‹ÂÅS~±¦{0�íïä ¥®Ø(;銬ºØså o÷^�î·¹ÓF(H_D"r¯Êku·§( ž¿5/×gˆŽK=�}Eý„1ù¨ -ªaõÍàò Ó±úqU Ê«©Þ ôFEõü)ýçá®þ1x×=êþÎàŸÿ>¸*endstream -endobj -5188 0 obj << -/Type /Page -/Contents 5189 0 R -/Resources 5187 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5191 0 R ->> endobj -5190 0 obj << -/D [5188 0 R /XYZ 90 757.9346 null] ->> endobj -5187 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5194 0 obj << -/Length 1641 -/Filter /FlateDecode ->> -stream -xÚµZ[�›8~ϯàq¦šPÛ€ÁݧÝîlw*Uíj#õ¡­*'x«\²@&Í¿_lœ@Rå!ÆÆö¹~>ç`hñƒ–ïù6q\l­â°Ö¢ûÝ ªá¹Ÿ¿ðÇböú/D,bŒ°µx.WÀÐöDÖ"ür‡Üà~Ž|àƒ»ÝÓ'ÑôÀ´AÕxüIãm·?ÓÕ.fIA ž&÷ßïg�‹zgE˜ç`(÷ýoöå°BAàû°xÖ^<‚¬xæ"G?D³gÿÔëTå„>þ<èô1ˆ-Ñã¨D‚_¿â:ޤÕBŽM p­9«»A9öªqm?@ÖQ÷ë²{Ž$fÛÅ®§Vsï瀻—”‡UkÏ–«ˆ ¹|ç /¾È1ñ+×�¼Þ^\-öz˜ÖWŠ*=Ø_M÷ÏðHl»ð˜É�[–T{Rõÿ÷bñ©j­Ò$a«RÍås‘ª7kŽ«Fβ–éU”äè9_'4Ò@Qžð:Ü«C@­ªŒmÜÖœÑc­›XôÊšä|s§EÿLòÞ-ÍhÜuÂß•£¦<)´;¹V^dµäÊ#Z$™ú™qiZ×îc�ž� -¨ v1ËøJ[Á“~†Bµyۃô¨O�P$ -±ž%@�6Þ+ášÙk[$Ȇ8°qP¢¸I›MÓ¦s­6¥mW­:Hlº„Œ–]Åî7|µéE«‡¶Ð].;‚B£Üirð®•C“ñ™¬º�#ó<9ÍxøÖ¬0òŒ§ñìOâ9cÅ‹6_0‚ö¹¡)ø~Nwbyrr,ˆñáW˜špåÒ‹·Ñ›1q±Ba”ð4¨õÁÕ -‚ -ê2¸§5bñ‚ŸãLJ·,)úH�‰a�i'{dñ¶8´Á8I‡ÕXãq•<k5G5o£½[ºg€; é:6p‚Ë0³ñØÇLr}êˆs×·üζ~¯?×ù#¹�?Ê£À×ÝÀÉ´:�Ó+¾ýL�~­iÕÎNÌ_˜I²¾ÔŠL@Ó?ÝÔTu*'!]“æ×ŒkìùÂ�f|Íëj@ýmG ÄÀËx€¬q!¦¡žÈ‚¥*iTh×ÿN÷öÔ-ҥζ ,¸Óë^-Ðff´þiß;þ¥çÐüø·DdÜ‘5á—"2!}W!  ]¿÷Šâé6¾ê–DyÏ#S ƒŽ¯yˆtÀwy ÂAb¢‹QMŠ$öKXFËÓT^è�> ÿ?èÆû{è‰4D]Aê¼AΤn„ pÕz¾GžLHˇӫ#äª[#?kvr_D^äè‘Òÿí¨‰endstream -endobj -5193 0 obj << -/Type /Page -/Contents 5194 0 R -/Resources 5192 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5191 0 R ->> endobj -5195 0 obj << -/D [5193 0 R /XYZ 90 757.9346 null] ->> endobj -5192 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5198 0 obj << -/Length 885 -/Filter /FlateDecode ->> -stream -xÚ½W[OÛ0~ϯˆ´—­Æ·8 {ÙØ:Ú…i‘ö¨J·‰DHSûï³c'4! ½À„�ïÇßw|ΗdCù‡lÚ®ãŸPfOæ´grúÄBfy ׫Žëð3ömø 3;˜FØ¢‹žë°{÷|<¹N¸ÈAÜ¿ -Îl -=& «}˜újÖÕmŒCRwÝZWÐŽ$¨3 â{Ž}/ ßÇöÜ¢˜”ƒkë—õ³²£ŠmœDÚH1[蕤°äèjNÂþ€AØ;,ˆ`|©=@òê[Š¥Aµ&¹2ß5ÇÑúsÅŠF‘½2ÿcœ‡‰Ð·æ1×�8]ä"œ›Q:m,O–Y&Ý­_‚à\÷¢0uo‘g<œ�”@]êÈ7”ÉV#ÅÏ ]C�lM0Ø�”Œ"žgw<«ï -E“lÆo—|a|0tg\z(ÅŒG] [3?tC~[b�¨ä�ŒOÓÌi^G[\Tî 折¯Ggk:i–Ì^kó'àű÷%Žy•¤“<®èë¼Íx~ (ÿÐkAœ˜“Ó¥˜äI*ºÀ³­Á—Ö— n¼-ýkb¦È¨D̺²¦ ÆÎqwËok6—ˆÐŒçË̼õÝܤ‰ÈËTÈÓ½ùøÏ£Àõð*®CCÓÌÇ´n Á*Õ2}šH<¶În�ðcè”ÀUüÜ¥I¤bè�¾–ºÀ“�иVK,lÌâ½t‘—Ñí›43ï!–óqSÄ^R¿Ý)6‘³»~w“ÛU¡õd›²v�ß^/þ—BkŸrdìé�úÚ-<ÂäHfq1’Å›)H§}ìôÔÏA5Xžž›ÝÀlT_Õ~Jÿ≮hºG•�-þù6¶´rendstream -endobj -5197 0 obj << -/Type /Page -/Contents 5198 0 R -/Resources 5196 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5191 0 R ->> endobj -5199 0 obj << -/D [5197 0 R /XYZ 90 757.9346 null] ->> endobj -5196 0 obj << -/Font << /F29 499 0 R /F26 485 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5202 0 obj << -/Length 3602 -/Filter /FlateDecode ->> -stream -xÚ�\Ûn7}÷WèQLš÷Ë£/ZG»ŽbØ -²ÀîB�GcKXÝ0'›¿ßb“Íf“Õ͉ N¢SuXgŠE§~Äà/~äÙ‘Õ–z©ÌÑæþ;úÿùý ž~¬„„?‘�ðÂú3pJ¬ôÙ뛋¯þ&ü‘PÔ:Ë�.¾^c%eJŠ£‹ëŸ=\oÿwòŸ‹¿¿8½ÈŽH 곋<% òÈ#`6ÂŒ4BÀB„h^?=ÝÝn®ö·�Ï/k:®4uÞÛÉd ?Ú}K˜O}ƓҠ]Dë7,Eš†_΀霿 -:£:¬!tΨg:ò]===¿ºÙÞÝ=’?N8;~ÜÝ]×ÿN7�(‚;ªŒq“³uQ2ž”íòZ¿a‘\ÙfRRÅY½€J•ŒêЂ*Ú;ê¬û ªÜ ªxÊ„r“³ž* OJL•ÚoTÅaªxãlµD•Õ¡ ª8C�æ…*»íóãÝïé�£�‘ìà°‡­Ò“ugÇ$8)ñȆ©½F|Ãî5ÎùоÞ0#ªÃD° -ЉZáAQÉ ¾eóž - OJL†Ú歞 -eê4:$T‡6è`µÞúI‡çûýÓð7, Œ¢JA}Ëf�øG<) �ø¿1~Ù~žJ/ëÔñ�¨mˆ_3j-CãG>£)cÖNf½øž”Xüµß¿Ââ÷š›jHüªCâ—6 ,âßoï¶ûëWÏ¡6¢…€S#ÁA6íí�„'¥¶j¿Qƒöð„½­­©Ðì�„êÐ „¡–›E °: (÷ÌL¦= ž”˜µß¨�m5°”ËP8g h4H¨mЀ+(�Ñ ý‰fB¸øq5÷THxR`*Ô~£ -ÍÑÈ=T7«ëÔ*Œ¨mP� jŒ\IǨr^eÛŽ#œxD‚ÚkT =½¦JÊŠ½ �Ö9!~åìA3ÅÿÇöËæîvû°Ÿþ »92I¡„ólß¹"�pRà‘RíuÐÀ0ìÞ -÷Áн¾� uΠ�…KDy `Ü X!x¶ïk0ÀI�Ç5˜y�LcLÅŽh0€Ö9ƒЧ3 ž·»ßO¸>Þî^Ýì÷O×dóíÍA•†ÖoôÑÓ!ÁI�Çt¨¼FT«ƒ¥ŠñнÑ!�Ö9ƒZQ­u_<Üà²�~> pRàñ|˜y�:hL¯ýœ‘!`Öƒ -JP-`ï¬É€�p{…7;èÕÆ„'¥Vk¿QÓ~D_/ ÖaDuhƒ’Q2gxaØmnn÷ÛÍþûn{B„fÇÏOÛÍí¿›øïßÏ>Æøúýaƒ¿D„¾M{ï&×�<ñ¤4@¥ñ–lÛ £g„®øk‰FT‡5HÄ,…³;VëÍÝãæ¿�*ê…IÚ^;ýôòöávߦ¤¤Õp{“pv g{GJÆ“ÒI�ÆoXˆWX£c¹}°Ž¨+KÑK'©0¬çr{¿EÂ÷š× ï? I ÇBŸû\ -P -,æÜMà Õá„|�p­‡dŒŸøÛ!†-qû°ß‡—« &€�4�&›÷$HxR`"Ô~—dÐÔ;%+þF†„ê°@}ÁL�øë{£•E¸Bå“ -nöÐØödñ¤4@diü.È¢§ @ÎùkYFT‡5È"5åzV†øaY\…þ ²k²Œ°ž,3þeYVYƒ,œSæ]Ú4�áLùö}7¼fÇíóø4œ'éxyÜåyÀá$�“ÓÞf“Ò{À¬ý'LÓ¢8Ã}Å_Ÿ0#ªÃ -â@�¥ž‹Ø]ßlž6—Ïû«=RDà8g\©É¢÷ÊŸð¤4À^ùk¿ÃýCH¬Šyídµ€æ™?¡:´!t«©s:¾;ÿ?õôd9\Æ< …)›ö4ˆpRâ1 *¯ƒLcçh¸PÍÙ‘c4€:œ!~ ý«Ooå?…·û—Q‚ü‚�~Õ#”P“mÿ«žOJü«ž¹ßAÞ&�apîBÓ=_@£ABuhƒ -X›Þʇ/0.søK;úa%Ÿl{ï– OJìݲöwB[!œ�ÜVüÍsUuHƒúW•žÉº8áîøØ K§Æ÷Û§ NÅŽ7qôYÊN¨•†~гö€'¥þ¬=÷Vƒ¼hZdtóª›PÖ ƒŽÎ§ç‚›}8(V´iõ– %î¶P•ûO¼#ž”ˆ�ß°Ó¾nJÀA…­øk=FT�u¼}‡G5-Ó£êÁ9‘­͉Ò`%'f«i_µò§=ç_̉uVÈ ntn~Ì hÙsâ§‹‹�ï.ß¾?»|ûúÃäij•4z8ß”“ݧ�'{Ú¨¼ÆRÂÛûŒ¦Ì±Š½yÛH uÎ)5”¢J›I›¥¶TRc˜Íø^W’à¤ÀcMIåu!òð ¦*öæ I uÎ�RP%<ò‰/&Æ rýÖT:o`3ª˜èÞ¾œxìò]y]RE3¸ŠH=goîX ´ÎTaŽJ«‹LØ|»½Ü\ÝÝ!ÙÀ¡ý3.Ûô²!ÁI�Dz¡òãÖØ™î%«Ø›lH uNˆÛ*Ó�:m€šS2Nõ-øÞ$²å”6&3f>+ƒg˜M\øóÀy�ŒïLδ~’L‚ŽŽC(«;Õ£e¡&q9Ÿˆ‰²ã8©¡Ov�æŒðΈLã5FßÜO¤ ¥Y¬Ï匠细fÇrëüÝí—W÷Ûû/á~E7ïþÌRÆ“ÒY_ãwQØ`ÖÖ hdI¨íxl*hzä8*d¹„;Ê#R;¡10á­>tâñ¤4@Òø]Šßkª�©PÇ?¢z´9~à—Pºsø_w[äà ²j+3¼ü'YDíu1tN-ã{yu8sàp×|*x«"¡3Ôפ Þ <ÁI�ǯ¼ÆÀU›t>4›{øêpŽ…@ …¨Ê÷¬‘ -š#aäÁ%²À¯TÈÕ+�3öÅú¸Î™U�6N¤é˜A–/á;äÄ4–ÊøMo4è•Á'«‚•×x…l/P653jÎÞ$Du8sèÐË æù¼ühF@ƒÄ�à‡§Da°–#¬›³,gÅ:í¨�„Þ‹kÍçeⵑNQÞà˜´) V´É°¥22F=_À¢6Ú¬M³g"~ÞÞ?îþŒwÎ/Ó÷Ó÷WWß¶÷Û‡}o„CÁí– '·ë*e<) Úå¶~£JÍðW˜æ’ðYW ¨¯£#ªC;©¤õã$ÇÇÝãþñ9¨ÃÙñvŸ¾x„–ewµûó%vîI)øä£w=OxR`÷óÚïpA×í�‡ssAO¨kVDBï¬�Ùßì¶W×Ïø¥S@7œM¸t<) .�3¿a)íW­ƒ|Î�lœÕcÍE]x© ¬OÏØwñp#†ÛŒ.°�ÈG<) �54~ãIÓ¶©ÊýÔ× ¨CQ=ÚñÖ%¡Xºq`äãç_ÞþãòÍéû³s$÷‡\“E/÷ž”Xî×~‡Ü7mî‡ßÿ1¾âor?¡z¬9~èfÝ8Àãûá—ϧ/±æ˜É ß)†MJ8R -+ŸCä¶e Úœ»‰<¡:œ9rèá¡3óMä—§ÿ<»hÃßq��ɬ#Àˆ'¥"AãwA„ð­˜v®â¯EQÖI„¡ãI¤Q„wá¡êõ çüøâÄËã×NÛÝ ¸¤,”Žì #Lj'¥"GãwA1üꩯøÛ_q�¨ë$G˜üº”ãôüÒ{»ð‹8vÂ÷zï„'¥Ö{×~ñèSÍ�Ó€&T�5G_Ž<¤è±½ŽknäÁ³ß‚hýá;ìÀ…YŸ¼A=Î|9êƒz~úiÜ aáÓåg,”vTsfÃÈøÎDDëwAh³•…ÛÃêFFuX'EÊiŒ¨ÈÙ9–�µÃ¯åeƒþnˆ¿ÆWà»aî?ä9´ªâGvÃ€ê±æðËáŽþùéoMuDJ£�e;wèÔIÆwæ?Z¿ƒ¾-�€3\­O�dT‡u’£œ=‰r|:}ýîMh~ý¢Bøí¬P¢F»ž - OJL…Úï’ -€ ssþF…„ê°ff.“ -±<¼ÄîlÆ[sèÀMÆwF_Z¿ " ¿ÄÄúÀMFuX'Ê—(Z¥WTMœµÉøÎÔKëw!|&%ÂÁÚ¬MFõXsøåÄÍþåç‹OÈ6°á—TõdÔÛ OJlÔ~ã#Bû�–„ÓÏÙzͽ1¡:´“Å0O”à·. 2ž]\þz~qö¹@;Ê•2Neøú¤OãuIî•n}º(ƒÖ9sÛ\Îõ­ãâcÜBg­5à3îôãœxì-®òŠw•Ò„²—‚y3ÿ�@ʬK1Ù3Ä|ùårãûW$vA­±‡Žeøú¸Oã5>)xìéÜr¾>b”AÎ|1ÞSt•?šåPÎ9±:™Sù\è-Æ»šÆðì˜BSÁ˜:èÿ<ôd]Çendstream -endobj -5201 0 obj << -/Type /Page -/Contents 5202 0 R -/Resources 5200 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5191 0 R -/Annots [ 5204 0 R 5205 0 R 5206 0 R 5207 0 R 5208 0 R 5209 0 R 5210 0 R 5211 0 R 5212 0 R 5213 0 R 5214 0 R 5215 0 R 5216 0 R 5217 0 R 5218 0 R 5219 0 R 5220 0 R 5221 0 R 5222 0 R 5223 0 R 5224 0 R 5225 0 R 5226 0 R 5227 0 R 5228 0 R 5229 0 R 5230 0 R 5231 0 R 5232 0 R 5233 0 R 5234 0 R 5235 0 R 5236 0 R 5237 0 R 5238 0 R 5239 0 R 5240 0 R 5241 0 R 5242 0 R 5243 0 R 5244 0 R 5245 0 R 5246 0 R 5247 0 R 5248 0 R 5249 0 R 5250 0 R 5251 0 R 5252 0 R 5253 0 R 5254 0 R 5255 0 R 5256 0 R 5257 0 R 5258 0 R 5259 0 R 5260 0 R 5261 0 R 5262 0 R 5263 0 R 5264 0 R 5265 0 R 5266 0 R 5267 0 R 5268 0 R 5269 0 R 5270 0 R 5271 0 R 5272 0 R ] ->> endobj -5204 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.9034 619.7797 156.8586 630.6836] -/Subtype /Link -/A << /S /GoTo /D (page.36) >> ->> endobj -5205 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [217.4706 607.7527 234.407 618.6566] -/Subtype /Link -/A << /S /GoTo /D (page.147) >> ->> endobj -5206 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [218.0285 595.7257 234.965 606.6296] -/Subtype /Link -/A << /S /GoTo /D (page.148) >> ->> endobj -5207 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [172.7487 583.6987 189.6852 594.6027] -/Subtype /Link -/A << /S /GoTo /D (page.149) >> ->> endobj -5208 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.3067 571.6718 190.2432 582.5757] -/Subtype /Link -/A << /S /GoTo /D (page.151) >> ->> endobj -5209 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.4535 559.6448 180.3899 570.5487] -/Subtype /Link -/A << /S /GoTo /D (page.153) >> ->> endobj -5210 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.0114 547.6178 180.9479 558.5217] -/Subtype /Link -/A << /S /GoTo /D (page.154) >> ->> endobj -5211 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [170.6363 535.5908 187.5728 546.4947] -/Subtype /Link -/A << /S /GoTo /D (page.156) >> ->> endobj -5212 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.1943 523.5638 188.1308 534.4678] -/Subtype /Link -/A << /S /GoTo /D (page.157) >> ->> endobj -5213 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [178.9352 511.5368 195.8717 522.4408] -/Subtype /Link -/A << /S /GoTo /D (page.158) >> ->> endobj -5214 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.4931 499.5099 196.4296 510.4138] -/Subtype /Link -/A << /S /GoTo /D (page.159) >> ->> endobj -5215 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.1679 487.4829 219.1044 498.3868] -/Subtype /Link -/A << /S /GoTo /D (page.160) >> ->> endobj -5216 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.7258 475.4559 219.6623 486.3598] -/Subtype /Link -/A << /S /GoTo /D (page.162) >> ->> endobj -5217 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.4608 463.4289 218.3973 474.3329] -/Subtype /Link -/A << /S /GoTo /D (page.164) >> ->> endobj -5218 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.0188 451.402 218.9553 462.3059] -/Subtype /Link -/A << /S /GoTo /D (page.165) >> ->> endobj -5219 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [185.9692 439.375 202.9056 450.2789] -/Subtype /Link -/A << /S /GoTo /D (page.166) >> ->> endobj -5220 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [232.6036 427.348 244.5587 438.2519] -/Subtype /Link -/A << /S /GoTo /D (page.74) >> ->> endobj -5221 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.7603 392.8518 165.7155 403.0385] -/Subtype /Link -/A << /S /GoTo /D (page.94) >> ->> endobj -5222 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.1837 380.8248 170.1389 391.0115] -/Subtype /Link -/A << /S /GoTo /D (page.94) >> ->> endobj -5223 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [155.0254 368.7978 166.9805 378.9845] -/Subtype /Link -/A << /S /GoTo /D (page.94) >> ->> endobj -5224 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [135.4892 344.7439 147.4444 354.9305] -/Subtype /Link -/A << /S /GoTo /D (page.94) >> ->> endobj -5225 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [135.4892 320.6899 147.4444 330.8766] -/Subtype /Link -/A << /S /GoTo /D (page.94) >> ->> endobj -5226 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [211.603 307.9457 223.5582 318.8496] -/Subtype /Link -/A << /S /GoTo /D (page.79) >> ->> endobj -5227 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [141.0181 284.7592 157.9546 295.6631] -/Subtype /Link -/A << /S /GoTo /D (page.123) >> ->> endobj -5228 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [148.3408 273.4495 165.2773 283.6361] -/Subtype /Link -/A << /S /GoTo /D (page.105) >> ->> endobj -5229 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.2461 250.263 161.1826 260.4496] -/Subtype /Link -/A << /S /GoTo /D (page.113) >> ->> endobj -5230 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [165.2768 238.236 182.2133 248.4227] -/Subtype /Link -/A << /S /GoTo /D (page.124) >> ->> endobj -5231 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 213.4648 175.27 224.3687] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5232 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 189.4108 138.5976 200.3147] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5233 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 177.3838 175.27 188.2878] -/Subtype /Link -/A << /S /GoTo /D (page.60) >> ->> endobj -5234 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.1403 154.0471 216.0768 164.2338] -/Subtype /Link -/A << /S /GoTo /D (page.121) >> ->> endobj -5235 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.6645 141.3029 169.601 152.2068] -/Subtype /Link -/A << /S /GoTo /D (page.121) >> ->> endobj -5236 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.3933 117.2489 151.3298 128.1528] -/Subtype /Link -/A << /S /GoTo /D (page.121) >> ->> endobj -5237 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [150.9906 105.2219 167.9271 116.1259] -/Subtype /Link -/A << /S /GoTo /D (page.125) >> ->> endobj -5238 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [350.8746 619.7797 367.8111 630.6836] -/Subtype /Link -/A << /S /GoTo /D (page.121) >> ->> endobj -5239 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.1917 607.7527 371.1282 618.6566] -/Subtype /Link -/A << /S /GoTo /D (page.126) >> ->> endobj -5240 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.1781 585.2835 372.1146 595.4701] -/Subtype /Link -/A << /S /GoTo /D (page.167) >> ->> endobj -5241 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.7361 573.2565 372.6726 583.4432] -/Subtype /Link -/A << /S /GoTo /D (page.168) >> ->> endobj -5242 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [389.3297 561.2295 401.2849 571.4162] -/Subtype /Link -/A << /S /GoTo /D (page.90) >> ->> endobj -5243 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.298 526.0161 372.2345 536.2027] -/Subtype /Link -/A << /S /GoTo /D (page.103) >> ->> endobj -5244 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [360.8372 501.9621 377.7737 512.1488] -/Subtype /Link -/A << /S /GoTo /D (page.103) >> ->> endobj -5245 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.6463 489.9351 396.5828 500.1218] -/Subtype /Link -/A << /S /GoTo /D (page.103) >> ->> endobj -5246 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.761 477.9081 392.6975 488.0948] -/Subtype /Link -/A << /S /GoTo /D (page.103) >> ->> endobj -5247 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [373.5691 465.8812 390.5056 476.0678] -/Subtype /Link -/A << /S /GoTo /D (page.104) >> ->> endobj -5248 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.298 441.8272 372.2345 452.0139] -/Subtype /Link -/A << /S /GoTo /D (page.103) >> ->> endobj -5249 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [366.3662 429.8002 383.3027 439.9869] -/Subtype /Link -/A << /S /GoTo /D (page.127) >> ->> endobj -5250 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.298 405.7463 372.2345 415.9329] -/Subtype /Link -/A << /S /GoTo /D (page.103) >> ->> endobj -5251 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.298 381.6923 372.2345 391.8789] -/Subtype /Link -/A << /S /GoTo /D (page.104) >> ->> endobj -5252 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [462.3752 368.948 479.3117 379.852] -/Subtype /Link -/A << /S /GoTo /D (page.102) >> ->> endobj -5253 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [390.3358 345.7615 402.291 356.6655] -/Subtype /Link -/A << /S /GoTo /D (page.95) >> ->> endobj -5254 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [360.8269 334.4518 372.7821 344.6385] -/Subtype /Link -/A << /S /GoTo /D (page.27) >> ->> endobj -5255 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [333.709 321.7076 350.6455 332.6115] -/Subtype /Link -/A << /S /GoTo /D (page.128) >> ->> endobj -5256 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [397.918 310.3979 409.8731 320.5845] -/Subtype /Link -/A << /S /GoTo /D (page.96) >> ->> endobj -5257 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [399.0338 298.3709 410.9889 308.5576] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5258 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [426.6999 286.3439 438.6551 296.5306] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5259 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [412.085 274.3169 424.0402 284.5036] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5260 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [387.9554 262.29 399.9106 272.4766] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5261 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [390.1671 250.263 402.1223 260.4496] -/Subtype /Link -/A << /S /GoTo /D (page.98) >> ->> endobj -5262 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [457.5143 238.236 469.4695 248.4227] -/Subtype /Link -/A << /S /GoTo /D (page.98) >> ->> endobj -5263 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [387.3975 226.209 399.3526 236.3957] -/Subtype /Link -/A << /S /GoTo /D (page.98) >> ->> endobj -5264 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [415.4025 214.182 427.3577 224.3687] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5265 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [413.878 202.1551 425.8332 212.3417] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5266 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [407.7013 190.1281 419.6565 200.3147] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5267 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [393.4946 178.1011 405.4498 188.2878] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5268 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [416.7473 166.0741 433.6837 176.2608] -/Subtype /Link -/A << /S /GoTo /D (page.100) >> ->> endobj -5269 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [427.1483 154.0471 444.0848 164.2338] -/Subtype /Link -/A << /S /GoTo /D (page.100) >> ->> endobj -5270 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.6343 129.2759 365.5895 140.1798] -/Subtype /Link -/A << /S /GoTo /D (page.96) >> ->> endobj -5271 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [351.7713 117.2489 368.7078 128.1528] -/Subtype /Link -/A << /S /GoTo /D (page.129) >> ->> endobj -5272 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.6343 93.195 365.5895 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5203 0 obj << -/D [5201 0 R /XYZ 90 757.9346 null] ->> endobj -5200 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5275 0 obj << -/Length 3125 -/Filter /FlateDecode ->> -stream -xÚ¥œÙr9†ïýuiG�íKß®3´aì"艞C´±Ý^z†·Ÿ£Ì”J»’rpaìú�~�¯´UÚd…áY¼RB!ø\}üv€W_àÇ/Èüò¯¡àÙæào?S³2ÈH*W›Ïc ’ A ]m>ývxrz¼þõè÷Í«Ça!¡!ûs*ˆýéÁzã[ŸÍ“ĶýçÁo¿ãÕ'èÄ«Œ˜Ñbõ_ø#b ]};à”¹o.ÎþáÛ™^J9ÂJI°$ -ߪ)‡·çožÿýâùë7çë‹õ¯'›1¯SM‚Œ“òæîúãOÒÄÓˆpÃVŠ"õÔ/ûÒí—YsôÐë‡0 ïfÞ®íƒQ™?!&ñO¸xUÇÕÂÁaId@çøˆãçGÐÀáæÈ°Ã§¯×§{s’†#‚¥XÌ) hpò²§Ø¿Ê©í -œ¤¦ˆØñ¶ã´>=Þ‹²ã}š˰-,NÖÃù×±4]-¡娄X*ÓŠ,âÂ%¢Z,ŸVa@‹‹“�\t�Kä_çÒtµ\GŒápZ½XŸ®ÏÜ´"úðÍÙÅù£†¥ˆ)Á—£ -Z¨œ¬‡*ò¯£jºZT#Nq8³NN±2 £—bùÔ -\¼¬Ã%ö¯ri»¡%Ø„Sëtý>[œ÷žjBq$_>Õ€''9™:§È¿Î©éj9IŠ„1áT;[?=~vDðở÷F#Éùòé´ð8YOä_ÇÓtµxÀXjÃ<Ó´?*‘bü&YТãd=:‘�NÓÕÒ!)¥ÃIö¨EY`Š4e?0©‚€'ëq‰üë\š®À…Œ´Ô2árq¾9Û› W–Ϩ0 ÁÆËlÆYCØ0št …ãT[ GJHZ‡Sêý¡°.Ÿl.Þ�nN^ïÏH„1[>¯Â€#'ë2Š:PgÔ´µŒ8H¹š&ÖÍ}ž1Œ@Å(Ù ;;ý2ÎÚ3fyÆD! õmÒ�4c§êÚÎo6gÑi¢¾Ý\<[¿89ͳ‡ºÚpØÛ½¼“½Óa@¡Y»¶,«Ï‰¡"ñO“wªž«O†ŸÎägG0ÀQ–*¦v� N?„…eíV0hÐ1ÉÿƒSõ\=X&‘Æa8þr}üîõ:ÏÚƒã¨ÙEtòwú! (ô$kwÌŸeþt˜ˆÄ?Íß©z®>a³sÆåÿöÈP(Ì >|_Zú¡žQ˜îÂzKÿ¬€ÒÒŸ¶[�`ë)KyìŸ-ý³ªçê!p…8–~éß¼´UÆ“êÆãõ½)à¶ 0 4Òv+Ùk‚´‚³XìŸM�YÕsõÙ3�8Ô.ûÝq°Â�b‚ÆjÙæàõC�÷(o·Ì�™TJ8ãÆþ ¯ê¸î8P†8ü4ç0‹óá`l28ì §€B‡²vG ¼ô6ØAÿƒSõ\=à&8!9†÷/OJ #,9Ì@aæ{fý”0¤íÖ0€Np™øgfUÏÕa Æ ¡…ßþy²~}ü¤º9{yÿ,i€/ë‰ý«DÚ®@öp„§• -kO8R#¬Ìò ´à8YNä_‡Ótµp„D¦YZwíI…ÛÊ_/ŸDa@‹Š“UäžJä_§ÒtµT@ -»”(Vcû­¸pxƒmTÿÀl -Zhœ¬‡&ò¯£iºZ4X#†�k´ý† œ,Xÿ³COd'oð˜E¡sÌÂέŒ�o‚W3b Žó¢Ý%G® ‹ŸÊ뺄EöÞ ‚Ž1{™#WŒ{͡@_èiÚj™ã ÃP¿Eæ)'êXz8XÀ~EI¥ÚÛ Ž„’ÅPEÓ x¼¬\øÔcÿ* Ž«#$õx-A+…à~„$¬L÷5 ´9Y�Pä_'Ôvõ„œ5eQ™TàÂM ‡ó•Tl9˜  ÆÉz`"ÿ:˜¶«Ã�w*õã~Ƥ™Ëé-:NV.-wt"ÿ:�¶«£cŸžÑ’MGåÛíÝõå_õA3½~ññúêsÎGiK·Ñ¼{þñú! (ô4kwúäUf°w4ö9 ¸) §êÙR9ÝWÚÇf4c*ðùúáêSN@ÃR&¡rõ!N?„…®díV hd0O;�˜U=[O@R(@µ |ÙÞßmoÿ:"âp{›“0 -a�Í.´CÂé‡0 Ð¥¬Ý - nG-…CIÜ�„„Wõl= �‘Æ,"qy}ýÇÃMa0ÀÑ[Ó ³~Jƒ!m·†À^22•v EàT=[�€i¤´ŽÖƒ?¶·ß‹Ó�Þ]H:Œú! (O‡¸Ý‰€*MÆeÚ�ÂtU=[¿bÚG¡ËVÄÞ²™)ûùàøìT÷ºÖˇ@_ègÚjm±PI�iìžÂq¢Ž§gcáóSgábYÝi{lìóSP;�Åp€/ëá‰;PåÓ±u€ì#QŠÌ÷0¥µtPR"iñc1¨  Êɺ ¢ÔAµm=(Á!€³|©ÝŸ‡Âê�å„‚€!'ëŠ:P'Ô¶õ„ˆùù×p%Þ!âD#ÉŒXN(hr²ÚJí E¨jÛ:Böé)çOîþ³½¼¼øzõõ¾Îç~{yµ½/œì„F =î=Rt?Vòú! (JÛ’‚=�•t 4«z¶�"Àq¾ëp€nEH{»¤— -Z„œ¬K(ê@�PÛÖâ -I<ÿºËDèúáþ‘ˆ˜@Â`³QÐBäd]DQêˆÚ¶eH¸ƒÆ„èæöúÛÍ£ÙÏÅ%YNh§ošUZçº×ñ4=�ñCn>›Ntîî?ÜÞWw±.û™±`d9œ0 AÇËzxâTùtl= £ŒÌ–Ü}»¯ïïöE{ÒþÆôËÃíöIñ@Á³Ÿ! Lºg!§€RÙ™¶;íc&¯¹ – :í@Vsͪž­«¹ì'Þ\K¶£ðéúª�>�$„úÞ Ì¬Â€Ò LÚn%}g` KAÒ�¬àšU=[Ÿ>3ˆ+¤·-]¿(Ž0V�¾—þ¬€Rúi»µô¡470”“¤é;UÏÖOªr:ç�ÿ²y{àðázøöáëåôË£x SKÃÔòMôæÃ¬€Ò|HÛ�ˆèüÀÓd×0³ªgë‰kÌüH^º*Ôw«,,«P·I;·1,\TöϾ³~JËjÚnmÔH8$c�v 5NÕ³uŒìœÌ¿Žî׌æÚZgC”AÌtŸ1ݱ l¼¬Ç&î@•MÇÖ³‘ -1=?Øë”}Ù@‘äTËÙ-6NÖeu Î¦mëÙpûl"Ñ›û÷…Íês¬éNßK’¡¾”}Òêô;GùQV„!$vÏrŸD=OŸ:ŰÍÏ¿è´9Røp<й%¶~Ûm/�í�†o ÃÂé‡0 Ð±¬Ýéd†ó�O!ÍYÚ�ìd6«z¶ž‡=§Ì»ý|*m,®¾¼.ðѰÏi²ìQ¯n?W�´Y+yì]1¥­gjf ¼Ïˆâòм‰½JxÌaÿTŒ†Âhø—b$2Ê^äOGÄ>"=ÿÒÕ‹íÕöfß§i ^_M_qÿyeGäÃü œØ§¯ø'Ê~¢xú’Óÿ>Qqx};}óp2#š…ÿþ>}=¾þß÷/Û«”¤ý‹®kŸÿ‚øLendstream -endobj -5274 0 obj << -/Type /Page -/Contents 5275 0 R -/Resources 5273 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5191 0 R -/Annots [ 5277 0 R 5278 0 R 5279 0 R 5280 0 R 5281 0 R 5282 0 R 5283 0 R 5284 0 R 5285 0 R 5286 0 R 5287 0 R 5288 0 R 5289 0 R 5290 0 R 5291 0 R 5292 0 R 5293 0 R 5294 0 R 5295 0 R 5296 0 R 5297 0 R 5298 0 R 5299 0 R 5300 0 R 5301 0 R 5302 0 R 5303 0 R 5304 0 R 5305 0 R 5306 0 R 5307 0 R 5308 0 R 5309 0 R 5310 0 R 5311 0 R 5312 0 R 5313 0 R 5314 0 R 5315 0 R 5316 0 R 5317 0 R 5318 0 R 5319 0 R 5320 0 R 5321 0 R 5322 0 R 5323 0 R 5324 0 R 5325 0 R 5326 0 R 5327 0 R 5328 0 R 5329 0 R 5330 0 R 5331 0 R 5332 0 R 5333 0 R 5334 0 R 5335 0 R 5336 0 R 5337 0 R 5338 0 R 5339 0 R 5340 0 R ] ->> endobj -5277 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 714.8637 149.1082 725.7676] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5278 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 690.9534 149.1082 701.8573] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5279 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 667.043 149.1082 677.947] -/Subtype /Link -/A << /S /GoTo /D (page.97) >> ->> endobj -5280 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 643.1327 149.1082 654.0366] -/Subtype /Link -/A << /S /GoTo /D (page.98) >> ->> endobj -5281 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 619.2223 149.1082 630.1263] -/Subtype /Link -/A << /S /GoTo /D (page.98) >> ->> endobj -5282 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 595.312 149.1082 606.2159] -/Subtype /Link -/A << /S /GoTo /D (page.98) >> ->> endobj -5283 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 571.4017 149.1082 582.3056] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5284 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 547.4913 149.1082 558.3953] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5285 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 523.581 149.1082 534.4849] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5286 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 499.6707 149.1082 510.5746] -/Subtype /Link -/A << /S /GoTo /D (page.99) >> ->> endobj -5287 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 475.7603 154.0895 486.6643] -/Subtype /Link -/A << /S /GoTo /D (page.100) >> ->> endobj -5288 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [137.153 451.85 154.0895 462.7539] -/Subtype /Link -/A << /S /GoTo /D (page.100) >> ->> endobj -5289 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [101.7359 439.8948 118.6724 450.7988] -/Subtype /Link -/A << /S /GoTo /D (page.130) >> ->> endobj -5290 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.9536 428.6569 172.9088 438.8436] -/Subtype /Link -/A << /S /GoTo /D (page.31) >> ->> endobj -5291 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [150.9911 416.7018 162.9463 426.8884] -/Subtype /Link -/A << /S /GoTo /D (page.31) >> ->> endobj -5292 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.2028 404.7466 165.158 414.9333] -/Subtype /Link -/A << /S /GoTo /D (page.32) >> ->> endobj -5293 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [150.4332 392.7914 162.3883 402.9781] -/Subtype /Link -/A << /S /GoTo /D (page.32) >> ->> endobj -5294 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [173.2774 380.8363 185.2326 391.0229] -/Subtype /Link -/A << /S /GoTo /D (page.32) >> ->> endobj -5295 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [182.5426 368.8811 194.4978 379.0678] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5296 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.5739 356.9259 175.5291 367.1126] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5297 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [170.9163 344.9708 182.8715 355.1574] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5298 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [200.7045 333.0156 212.6596 343.2022] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5299 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [190.184 321.0604 202.1392 331.2471] -/Subtype /Link -/A << /S /GoTo /D (page.34) >> ->> endobj -5300 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [192.3957 309.1053 204.3508 319.2919] -/Subtype /Link -/A << /S /GoTo /D (page.34) >> ->> endobj -5301 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [160.3958 297.1501 172.351 307.3367] -/Subtype /Link -/A << /S /GoTo /D (page.34) >> ->> endobj -5302 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [195.2549 285.1949 207.2101 295.3816] -/Subtype /Link -/A << /S /GoTo /D (page.35) >> ->> endobj -5303 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 260.5673 133.6163 271.4712] -/Subtype /Link -/A << /S /GoTo /D (page.31) >> ->> endobj -5304 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 236.657 133.6163 247.5609] -/Subtype /Link -/A << /S /GoTo /D (page.31) >> ->> endobj -5305 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 212.7466 133.6163 223.6506] -/Subtype /Link -/A << /S /GoTo /D (page.32) >> ->> endobj -5306 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 188.8363 133.6163 199.7402] -/Subtype /Link -/A << /S /GoTo /D (page.32) >> ->> endobj -5307 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 164.926 133.6163 175.8299] -/Subtype /Link -/A << /S /GoTo /D (page.32) >> ->> endobj -5308 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 141.0156 133.6163 151.9196] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5309 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 117.1053 133.6163 128.0092] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5310 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [121.6612 93.195 133.6163 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5311 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [338.1425 714.8039 350.0976 725.7079] -/Subtype /Link -/A << /S /GoTo /D (page.33) >> ->> endobj -5312 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [338.1425 690.774 350.0976 701.678] -/Subtype /Link -/A << /S /GoTo /D (page.34) >> ->> endobj -5313 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [338.1425 666.7441 350.0976 677.6481] -/Subtype /Link -/A << /S /GoTo /D (page.34) >> ->> endobj -5314 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [338.1425 642.7143 350.0976 653.6182] -/Subtype /Link -/A << /S /GoTo /D (page.34) >> ->> endobj -5315 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [338.1425 618.6844 350.0976 629.5883] -/Subtype /Link -/A << /S /GoTo /D (page.35) >> ->> endobj -5316 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [377.4249 584.4129 394.3613 594.5995] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5317 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [382.9641 572.3979 399.9006 582.5846] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5318 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [396.0846 559.6657 413.0211 570.5696] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5319 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [387.3974 547.6507 404.3339 558.5547] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5320 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [382.4062 535.6358 399.3427 546.5397] -/Subtype /Link -/A << /S /GoTo /D (page.107) >> ->> endobj -5321 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.74 512.3232 371.6765 522.5098] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5322 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.74 488.2933 371.6765 498.48] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5323 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.74 464.2634 371.6765 474.4501] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5324 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.74 440.2335 371.6765 450.4202] -/Subtype /Link -/A << /S /GoTo /D (page.106) >> ->> endobj -5325 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [354.74 416.2036 371.6765 426.3903] -/Subtype /Link -/A << /S /GoTo /D (page.107) >> ->> endobj -5326 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.5095 381.2149 374.446 391.4015] -/Subtype /Link -/A << /S /GoTo /D (page.111) >> ->> endobj -5327 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.5095 357.185 374.446 367.3716] -/Subtype /Link -/A << /S /GoTo /D (page.111) >> ->> endobj -5328 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.5095 333.1551 374.446 343.3417] -/Subtype /Link -/A << /S /GoTo /D (page.111) >> ->> endobj -5329 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.5095 309.1252 374.446 319.3118] -/Subtype /Link -/A << /S /GoTo /D (page.112) >> ->> endobj -5330 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [357.5095 285.0953 374.446 295.2819] -/Subtype /Link -/A << /S /GoTo /D (page.112) >> ->> endobj -5331 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [392.3786 260.3481 409.3151 271.2521] -/Subtype /Link -/A << /S /GoTo /D (page.109) >> ->> endobj -5332 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [374.1173 248.3332 391.0538 259.2371] -/Subtype /Link -/A << /S /GoTo /D (page.109) >> ->> endobj -5333 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [373.0113 236.3182 389.9478 247.2222] -/Subtype /Link -/A << /S /GoTo /D (page.109) >> ->> endobj -5334 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [394.5899 225.0206 411.5264 235.2072] -/Subtype /Link -/A << /S /GoTo /D (page.108) >> ->> endobj -5335 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [349.7687 200.2734 366.7051 211.1773] -/Subtype /Link -/A << /S /GoTo /D (page.109) >> ->> endobj -5336 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [349.7687 176.2435 366.7051 187.1475] -/Subtype /Link -/A << /S /GoTo /D (page.109) >> ->> endobj -5337 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [349.7687 152.2136 366.7051 163.1176] -/Subtype /Link -/A << /S /GoTo /D (page.109) >> ->> endobj -5338 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.0858 140.1987 370.0223 151.1026] -/Subtype /Link -/A << /S /GoTo /D (page.131) >> ->> endobj -5339 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [361.903 117.9421 378.8395 128.1288] -/Subtype /Link -/A << /S /GoTo /D (page.110) >> ->> endobj -5340 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [367.4819 93.9122 384.4183 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.111) >> ->> endobj -5276 0 obj << -/D [5274 0 R /XYZ 90 757.9346 null] ->> endobj -5273 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5343 0 obj << -/Length 4208 -/Filter /FlateDecode ->> -stream -xÚ¥\mo·þ®_¡�à¥ùþÒoNìÐÖuÔ"mZ²t±‘uêé®iúë;Ü%¹|Û�«ŒÀˆÎzfγäp†Ç5;§ð;wôÜ(Cœ�úüöË=ÿ ýÝ ¿à÷Cøæêìõï¹;wÄi®Ï¯~=hFgüüêî§ ®øå?¯¾?ŽG©?þ¯ßÿñí»ý/ÎÞ]%÷�] ͼó�ýôOz~£øþŒá¬:ÿ>Pœãç_Î$ñÃÃÙgN~¦_Œ½ ½(D£ð3WâÜpøÁL¡<ßo®·�OÇëzèL9¬sÉ`$ö¿Ù��Ù|Èð�aÔ^ý0c »‘„ Q±Wa'™Bg �56‹}wâ‡Ü 3”Æïbü S¼@#@@a´Iª ¥Bg -<íw_žz -"­µ³ ¦@À¹AO�Úï¤o`9‘‚›jµ…ÑF´“„2'3ž7ûÞüWÄjÎg lü�ôV@íwIC‰¥º@3 -¡…L¤A+*Դ曇ÇÍáÎØ´ÁKE„dz¶A‚�ø!7èßøƒmðšn•ªPQ­t¢Š�|W÷›Ë�+zq|ÿaúáêÛ¯ãÏ Èí/¯zÓ‘)¡’#D�2|G�Ú«žnÕpc~*ääµ´NéµP–P­§äsØ~ÙìÛp¬&Øð 7À‡ß ·ö:=}Ѱ ØZ•®ØëxãL+_¹…T‘¢¾Þ\2uñŸ§í~s÷ª·ü´4³¢@€9¾3šÚ«Œë$?€Q§+ö&ùFš$�"|1K°ß~靿gm48a5°q5d «¡ð»� ü<7~5ü½Õ`ÆÕ°ÎšÂ÷­Ss.¼Ý=>.t«Ð'ø)ݪïšsƒ¥n5÷;>{ÞíVUÅÞëUʘ‡=zD[¾¹=¬¤ÁhqrÌ ÖÒ`>’…?¦Á‚9 ®³¦ø¹$T�âß>nÝï(”¤ Ž/ù?äý5_úƒ·Ýï tF%gÑ�(Œ5Ï8¡:4¢cðOK˲ˆÐRÎ&Ø)eÀ¹Aö» €ìi%}sL9�0Î>…Ü`\ª ¯6�5/%1êÄÆ}À¹AïÑ×~Ö¼œ‚r¦äo}@a¬1vn!=85‡¾}>ô¢¿œZ�ðX ð!Ã÷ò]åuá¡Ç/1 ò&ßÅoD×)SàFÆèœðž7��Cyè.¬er†c�ü�ô"¯ýŽ¡»Þ×RVJVñw¾–Qk -ދŵ΂?lŸ¶wË_Ê'‹S¿•Ï V¾–/FÒ‹p -lJþιüˆÂXSüŠ&ù<íý·’¯úýôØ Ž-ù€rƒÞ’¯ý.-yÀq*+þfÉÆš‚‡þ›);×·‡Ûåtµ¨5f¶ÁÒ}À¹A/Ý×~¿œò -üM¾(Œ5)À-ä -9¹Ç»§ëÇÍ%W¿v -K¬n¶Â -ž€rƒ^ÁSûgmŸà|7Tò7O@a¬I¦§˜i°8 ,QʨÙ›?ä½YPû]Pºâ”WüÍ,(Œ5)@ýî£æÎÿø¸´û¥ (šœz;'7X¹�S ¥7½£’ñvÒ:«£ã÷ûã)ôxáÍÝÝ~óü<}ø¸yÞ=ÛÝãôùÃ~wØÝîÚSî«M7ûD|Èñ�3€Úë¨L{ &™©Øë#€ˆBH½2–î�° enžž¶·7³?oý§Î!¡S�‚¤š=!s%â‡Ü 3W¿~„R÷e3¼â¯‰(„Õ+y -– /�öð”òÏÇýIªøIèž¼aGE?ä½£¢Ú¯¥0íQ‘ Î'Å’¿9* -(„Õ«».�g¦™(þäìßþ;ÎÍþù¤Ùâ4Ç’?l²ø�á{s¥òêG©ÔÂC1%y3Sh�ÒK� ·Ò–šÜ�Ûê¿··á -ÔÝ~;þŤ>o8Q�"gçØ¼ ø!7èÍ›Ú︚X;o8‘Æ™Š¿™7…°z‘'Â_â-Dò‡ Û›‡íO\L &'ã³3L”€rƒž(µßQÚŠ8MÉ߈P«…S"`3,E¹ú6üp¸ß‡éó§Ý¶é0wî{—ç| ä˜e³glS -ø!7èíJµßñ«+×nKP�Yj*þf[ -(„Õ+D-‚§#Š×·Ã l×7Ÿ6ÏäþU¯q’Ì?Ëh‰•,?ä½’¥ö;^©ë•î’¥ê4E[@!´ �ÓDH› ðüëöp{ß ^IX�FFü°bD3¼V‘ûÃî”j^˜öu´_ºø�ý¶‘FÀjTëcZ?ËÊ;ö“8U„dDsØN»`Ÿàë—ݯ“0M&°{(#ØêûB8SÜÌnëyV<=ïnéÅ® ÑÆºÙ >â‡Ü 3’Æï~ÓË ÃA&^ Ž?¢0Ú$€¿„®™ž8tŸ<‡†v»Ç}À¹AïÙ×~§èeO~&jþæáO Œ4ÆîïŸ3ªÓ!Îëñ²Ë¥Rä¶3 ÑhÆf+lü�ô&@íw’ ©Ë$á/I—¨5ˆ(Œ6‰0^èf¢#Â}WÇ`­&+\„?ä}J¿“¦'‚Õ¢@G„…Ñ&Œ‰I§óœ×ðgxÜl?ßÚ-NëÏÝaî&cD‹ˆrƒÎ ¿“Í©¶pŽø^£ä¯¥ Œ4)¡¬¿@æ–•èÌ -«ü<ÛbBLð!Ç÷t¨¼N24u‚¤Ð:W±W2DÆ™d�Ú¿§a ž¡‡ïfG 9\ù%­"~È :£iüŽXÚ>hFœªPO…ˆÂh“R“ :¡·À›fáêûˆÇ6‡€rƒÞæPû�Âo+ÿ²£’õš¤Pm -ŸC×a”,Âïí�°ëh+g<~À¹A/üÚï~»7ú[ÀŒ×hÂ(Œ6…ϨÿZ@äá_ßì»õ²O¸Ü©Ì[?ä½Pû5p´—Œ¹p¼@³ -£�ø êR+ViÐ]&“³ ¦Àr|O€Êë» ¥Œ«è›ê0 0Ö¿…rš:×Äß�*97ÛàŒø!7è+Pú�$à= ¬¿§R #ÁˆÂh“Fú´Qì»~‘¬Üôzu2ÁŠ£€rƒ^qTû�­Ò‹«ª4 -F›Ð~ßpów½7P -tn«ùbìÍÓ“?}j%2Ú_Ü×ãE-%š+#~È :cmüŽOmùèß'1œWüMš(Œ5)$,ÑÖ‰R¡Þ *ÿ—F\#Я 3�2ƒ5�"lÔÈ.kTð/k´Îš4bPÖúF7itûË%£_­åÄraOW)3XS)Â0• -þe•ÖY£JÒQè\¬ž/Óúï¾½zÿ×w×úðî�«Zõîàû«`Òø“Gô¾U¹A/)Õ~ǃÌ6'iíß´SœÆštò·´ó+ã•óUu:…›¿êAÙø¦¥]h?ä½Â­öÛ¿ˆè›ÞñØ’¿9Ô(Œ–¡¤Z�/;PiÒBó%Û«^É̵ÊÐØnðCnÐÛ­k¿ã×®mÍjÇ-¯ø›­* 0Ö4-#Ôq[ßÅéÄ&Œ>}bdk#Âú7³ç‰Qð/OŒuÖ$…†Â†wªV/ê¿P.ÿÂç'œ G¹rƒ¹¬‹? Qò/Ê…°F¹üe@Íw| îõ¶�ëÖþ©Ÿ„%$K?¡C¿¥Mø!7XHÂ…ßqB™n¦ÒUü½$ìQkR -SßÎ'ÔÇ×xóã¸g}×�E줽ʷ¾c.;u¯Ê VöªCöª’q¯BX“L¿�Âd1‘vÇÃWL#.ˆžÓ§Qf°6�" ›Fÿò4ZgMú@èJ²r¡M§Ð/Vˆ;G”U§/´Ü`E¡²‹ -•ü‹ -!¬Q!n Ñ‚ mJ×ß,æëÓV7Šh£N_i¹ÁÊJK0d¥•ü‹+ aM:iAŒ¿Éuúæ£OEòÿz›·ß¾ùáêåõ3WŒ­øéJekJE¦TÁ¿¬Ô:kRJøc�ì-­ðŠÚ w~ØN!éNÞùsƒ•�?Á�B©ä_ÜùÖXAûþ¬sé^g¸�´Ð‡*p@Õl„õ¡?ä½>´ö;ö¡²÷Ý‹ã‚UüMPkšT'å܇~ã{õ¿ü­W×sþõ4wz𬬡CÖPÉ¿¸†Ö¨‘¿øHExá{ÔèoWÐ¥|ûîãWH¤­ë†�.Qf°&Q„�Ée‰ -þe‰ÖY“D@Ï ×T/ƒ¾0Ëø»qÌ¿è}j–É V²L‚!}zÉ¿˜eÖ˜eü-΄:­OOèSûôÜ`¥O/FaÔbŸ^ò/öékšœ®ì\ß>ìž7_w8Þÿ¢èÅàù 07X9L0ä °ä_<DX£BåeµIŸ»Þ?ÖÊ[x�“‚_¦§¢éÅÿŽëøÏÍZ¹0²;×Ä8ê'4JÍÓPü˜¿Û> endobj -5345 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.1937 726.8189 175.1302 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.111) >> ->> endobj -5346 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.175 714.8347 180.1115 725.7386] -/Subtype /Link -/A << /S /GoTo /D (page.111) >> ->> endobj -5347 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [166.4925 702.8505 183.429 713.7544] -/Subtype /Link -/A << /S /GoTo /D (page.112) >> ->> endobj -5348 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.8659 691.5836 171.8024 701.7702] -/Subtype /Link -/A << /S /GoTo /D (page.112) >> ->> endobj -5349 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.3453 679.5994 161.2818 689.7861] -/Subtype /Link -/A << /S /GoTo /D (page.132) >> ->> endobj -5350 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.1573 667.6152 193.1124 677.8019] -/Subtype /Link -/A << /S /GoTo /D (page.62) >> ->> endobj -5351 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [115.0158 655.631 131.9522 665.8177] -/Subtype /Link -/A << /S /GoTo /D (page.133) >> ->> endobj -5352 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [169.6507 642.9296 181.6059 653.8335] -/Subtype /Link -/A << /S /GoTo /D (page.92) >> ->> endobj -5353 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.7314 631.6627 170.6866 641.8493] -/Subtype /Link -/A << /S /GoTo /D (page.92) >> ->> endobj -5354 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.8185 619.6785 176.7736 629.8651] -/Subtype /Link -/A << /S /GoTo /D (page.92) >> ->> endobj -5355 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [150.9906 607.6943 162.9457 617.8809] -/Subtype /Link -/A << /S /GoTo /D (page.93) >> ->> endobj -5356 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [147.0354 594.9928 158.9906 605.8968] -/Subtype /Link -/A << /S /GoTo /D (page.91) >> ->> endobj -5357 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.941 571.7417 146.8962 581.9284] -/Subtype /Link -/A << /S /GoTo /D (page.92) >> ->> endobj -5358 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.941 547.7734 146.8962 557.96] -/Subtype /Link -/A << /S /GoTo /D (page.92) >> ->> endobj -5359 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.941 523.805 146.8962 533.9916] -/Subtype /Link -/A << /S /GoTo /D (page.92) >> ->> endobj -5360 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [134.941 499.8366 146.8962 510.0233] -/Subtype /Link -/A << /S /GoTo /D (page.93) >> ->> endobj -5361 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 464.7047 151.3298 475.6086] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5362 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 440.7363 151.3298 451.6403] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5363 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [135.4992 417.4852 147.4543 427.6719] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5364 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [155.9724 404.7838 167.9276 415.6877] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5365 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6073 392.7996 174.5625 403.7035] -/Subtype /Link -/A << /S /GoTo /D (page.71) >> ->> endobj -5366 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [204.4604 381.5327 216.4156 391.7193] -/Subtype /Link -/A << /S /GoTo /D (page.66) >> ->> endobj -5367 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.7047 368.8312 156.6599 379.7352] -/Subtype /Link -/A << /S /GoTo /D (page.71) >> ->> endobj -5368 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6173 356.847 174.5725 367.751] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5369 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [150.9911 344.8628 162.9463 355.7668] -/Subtype /Link -/A << /S /GoTo /D (page.72) >> ->> endobj -5370 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [162.6073 332.8787 174.5625 343.7826] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5371 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.9136 320.8945 156.8688 331.7984] -/Subtype /Link -/A << /S /GoTo /D (page.68) >> ->> endobj -5372 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [170.3681 308.9103 182.3233 319.8142] -/Subtype /Link -/A << /S /GoTo /D (page.68) >> ->> endobj -5373 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [143.798 296.9261 155.7531 307.83] -/Subtype /Link -/A << /S /GoTo /D (page.72) >> ->> endobj -5374 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.2123 284.9419 165.1675 295.8459] -/Subtype /Link -/A << /S /GoTo /D (page.68) >> ->> endobj -5375 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [149.8852 272.9577 161.8403 283.8617] -/Subtype /Link -/A << /S /GoTo /D (page.69) >> ->> endobj -5376 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.1937 260.9735 170.1488 271.8775] -/Subtype /Link -/A << /S /GoTo /D (page.69) >> ->> endobj -5377 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [145.4615 248.9894 157.4167 259.8933] -/Subtype /Link -/A << /S /GoTo /D (page.72) >> ->> endobj -5378 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [174.7915 237.0052 186.7466 247.9091] -/Subtype /Link -/A << /S /GoTo /D (page.69) >> ->> endobj -5379 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [167.8977 225.021 179.8528 235.9249] -/Subtype /Link -/A << /S /GoTo /D (page.70) >> ->> endobj -5380 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [177.5613 213.0368 189.5164 223.9407] -/Subtype /Link -/A << /S /GoTo /D (page.70) >> ->> endobj -5381 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.175 201.0526 175.1302 211.9566] -/Subtype /Link -/A << /S /GoTo /D (page.70) >> ->> endobj -5382 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [224.8828 189.7857 236.8379 199.9724] -/Subtype /Link -/A << /S /GoTo /D (page.76) >> ->> endobj -5383 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.1583 177.0843 206.1134 187.9882] -/Subtype /Link -/A << /S /GoTo /D (page.46) >> ->> endobj -5384 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [203.0152 165.1001 214.9704 176.004] -/Subtype /Link -/A << /S /GoTo /D (page.37) >> ->> endobj -5385 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [193.0528 153.8332 205.008 164.0198] -/Subtype /Link -/A << /S /GoTo /D (page.55) >> ->> endobj -5386 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [201.5208 141.849 213.476 152.0356] -/Subtype /Link -/A << /S /GoTo /D (page.41) >> ->> endobj -5387 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [200.255 129.8648 212.2101 140.0514] -/Subtype /Link -/A << /S /GoTo /D (page.40) >> ->> endobj -5388 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [227.9218 117.1633 239.877 128.0673] -/Subtype /Link -/A << /S /GoTo /D (page.89) >> ->> endobj -5389 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.415 105.1791 185.3515 116.0831] -/Subtype /Link -/A << /S /GoTo /D (page.169) >> ->> endobj -5390 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.4811 93.195 170.4176 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.170) >> ->> endobj -5391 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [340.6329 726.8189 357.5693 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.171) >> ->> endobj -5392 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [356.6827 714.8637 373.6192 725.7676] -/Subtype /Link -/A << /S /GoTo /D (page.172) >> ->> endobj -5393 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [341.1908 702.9085 358.1273 713.8125] -/Subtype /Link -/A << /S /GoTo /D (page.174) >> ->> endobj -5394 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.3649 690.9534 370.3014 701.8573] -/Subtype /Link -/A << /S /GoTo /D (page.176) >> ->> endobj -5395 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.9228 678.9982 370.8593 689.9021] -/Subtype /Link -/A << /S /GoTo /D (page.177) >> ->> endobj -5396 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [383.8008 667.043 400.7373 677.947] -/Subtype /Link -/A << /S /GoTo /D (page.178) >> ->> endobj -5397 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [384.3588 655.0879 401.2953 665.9918] -/Subtype /Link -/A << /S /GoTo /D (page.179) >> ->> endobj -5398 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [366.6549 643.1327 383.5913 654.0366] -/Subtype /Link -/A << /S /GoTo /D (page.180) >> ->> endobj -5399 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [345.6142 631.1775 362.5507 642.0815] -/Subtype /Link -/A << /S /GoTo /D (page.181) >> ->> endobj -5400 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [346.1721 619.2223 363.1086 630.1263] -/Subtype /Link -/A << /S /GoTo /D (page.184) >> ->> endobj -5401 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [368.299 607.2672 385.2355 618.1711] -/Subtype /Link -/A << /S /GoTo /D (page.190) >> ->> endobj -5402 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [363.3177 595.312 380.2542 606.2159] -/Subtype /Link -/A << /S /GoTo /D (page.191) >> ->> endobj -5403 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [363.8757 583.3568 380.8121 594.2608] -/Subtype /Link -/A << /S /GoTo /D (page.192) >> ->> endobj -5404 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [358.9043 571.4017 375.8408 582.3056] -/Subtype /Link -/A << /S /GoTo /D (page.193) >> ->> endobj -5405 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 547.4913 387.1685 558.3953] -/Subtype /Link -/A << /S /GoTo /D (page.47) >> ->> endobj -5406 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 523.581 387.1685 534.4849] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5407 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 499.6707 387.1685 510.5746] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5408 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 475.7603 367.8111 486.6643] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5409 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 451.85 355.079 462.7539] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5410 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [360.2693 439.8948 372.2245 450.7988] -/Subtype /Link -/A << /S /GoTo /D (page.74) >> ->> endobj -5411 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 415.9845 355.079 426.8884] -/Subtype /Link -/A << /S /GoTo /D (page.71) >> ->> endobj -5412 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 392.0742 355.079 402.9781] -/Subtype /Link -/A << /S /GoTo /D (page.66) >> ->> endobj -5413 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.846 368.1638 367.8012 379.0678] -/Subtype /Link -/A << /S /GoTo /D (page.77) >> ->> endobj -5414 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 344.2535 367.8111 355.1574] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5415 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.846 320.3431 367.8012 331.2471] -/Subtype /Link -/A << /S /GoTo /D (page.77) >> ->> endobj -5416 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.846 296.4328 367.8012 307.3367] -/Subtype /Link -/A << /S /GoTo /D (page.78) >> ->> endobj -5417 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 272.5225 367.8111 283.4264] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5418 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 248.6121 367.8111 259.5161] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5419 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 224.7018 355.079 235.6057] -/Subtype /Link -/A << /S /GoTo /D (page.71) >> ->> endobj -5420 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [374.9642 212.7466 386.9194 223.6506] -/Subtype /Link -/A << /S /GoTo /D (page.44) >> ->> endobj -5421 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 188.8363 367.8111 199.7402] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5422 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 164.926 367.8111 175.8299] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5423 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 141.0156 355.079 151.9196] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5424 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [360.2693 129.0605 372.2245 139.9644] -/Subtype /Link -/A << /S /GoTo /D (page.75) >> ->> endobj -5425 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 105.1501 387.1685 116.0541] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5344 0 obj << -/D [5342 0 R /XYZ 90 757.9346 null] ->> endobj -5341 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5428 0 obj << -/Length 2842 -/Filter /FlateDecode ->> -stream -xÚ­œ]S9†ïù¾„ª±Vß-Í]&� ©²�ÝÉÔÔÅ`\l¯13“¿R»¥–Z­#Ÿr�Áçè•tôÑ~ ™`ó�L4ž4¢Ašq9¹{<“{óã·G¤{{jÞŸ†?]ýë Õ�´¤rrý¥mA$(¡“ëÙoÇç§gŸO~¿~7áX!,¤iÈþœ -fztví[ïÄ“Ķý¿£ß~Ç“™éÄ»#Œ˜Vbò·ù#¢5�<qÊÜ7_�®ŽþíÛÙ½Ñ&Œ�A66 ‚`óÚôpÒPó¢Ù�äy±¾]¯¿ âGz1lÕö‚«D\j$5Ö±ø`Ð>–´¿b~MD*7æ›»Õr™Ž˜Q„%%}xaÈ.~&ŒŒ9i×vƒ0žt€7c9ìÀpØ.ª$ëáX}"ÝèÓ�ÓI¦š>²0p? Fz�´k{Ðм‰Ã„ô‡ãvQUóû–š#‚¥ˆ~ßó»m[³¤Ã2%i!h‹T[bµX‹³=�MK¬ŸÅRPuÓA6v…1ó§vð µ+@˜,QGÍ®±~v€Uí¬ -QnB³b>›ßÁ‡KD•Põ|‚ˆ� +¬‘±~ž¨jù0Žû*ýÏùÇ›×—W`ͬÖÛ” 7UcûE©y!x‰‹‹Ÿ† #\’vm'TºŠ -ǘ蹸¨‚ªåB0â3?of·ÛÛ¯ó%H¦8k„VˆKQ_Ua0k|X;ktvÖÄúÙY«:BI$°î«j¾}¸¹�Í6?ŒmoB0Õ§”&F? Æ&ưÝÝþ*Ó±SÄu3ì@2ö.ª kÇÞp£ÌU4ö‡Ñ¡3Dæ}Fiè]ü4Lú°ÝÝÐӽĬ}¸áÃ$EÑEdíÐ %¡u¿X¼9ÿ|vzÂññ«ÓÓOû/ÂÔ¥ä¼~Ñ€EÇ�X?»hÀª–SH*Íb>g×?¿•¨aœÔã  <.¬„'ÒÏãU-ÂQÓ¨~Õ¸Ÿog»l€lÌŽý儊ãñ¥ÕLÉFËf"0Eвb‘¹øi˜0)i×öf¤Æ'̯<ÖBrQU‰kŒ”T2„ô°zÚoÒæR�)L0ù°¦X?‹ Vµ˜¤4£W,Ä´œooŸþ<%!Ìu‹‘zJADÉ…µ”TžR¤Ÿ§ªZJf«À¼é+nq÷¸6_F·+³Hfn¬>©tHéâ§aÂØ!eØîn»=C¢‘ýdð» ‚¨;#kÚïÓ‹åbßË 7)fƒ­¿#‡ ÀeЇµ—A•½ ÆúÙË`AÕ]9nQ”»q[0£»�¡'ûèòîÓÆOÄñÝ'n·=³â±ÝGiBú#»OUP5ó�i�(íŸ�™ù°~Þ‚·ÀÙÜ.eÏôfúÑ S ™fkÎômü4L?ÓÇí¶|ÈØ™žs¢ú#gú6ª jù41ßóYËšMÇÿ2ˆ¤¹[B&ÌŒ‰IÒ—Ó.~&Œ-§ÃvÛ‡ éÑßœgicöÚX?YQº¨‚ªEd.K :!&7ç£zBADÈ…•EúyB ª%D™¹GI: DÀ2«Dd²'¤Q�!ra%D‘~¨jQ­‘PBÑÌ"ªì¾‚ëë,Lù°Q“EëgÁªQ#�lÄ°ÎØ!I†Šë -L€¹°¢H?�TµˆA�ÃBã(4Ê4R×Z˜!ra-"•Géç�ª‘9e)Á‡…vcŽÀ‡˜HD˜“‡þŽZ  J.¬D)ÒÏSU-%Ì�æ\&”Vë‚�¿Ñ&Kéúš T>¬€*ÖÏ¢‚U *¢0ÂŒkî¦æÒYƒIÚqº¾î“ k1é<¦H?� Tµ˜„DÄTç¦ÃÔá™nÔ×^˜‘ra%R‘~ž¨jI1Š(a" u÷ðçÓó#¸Šç¯©„bD…âÕ×Ô0¸¦ú°Â55ÖÏ^S ªîšJ°B ³þÓ•ÍÝÃÈ5•£Fñ ºtMíâ§aÂØ5uØnû1¶H¯�&Ž›[S¬Ÿ\S»¨‚ª™Z"|¸Ð}äJ2lN˜..PKTw�Ó>2dTîn4ƒH™ٹLÍn[ç ñá°M#iuÜ+À >¬h:C|PAÒ�xà™mímÿ„ˆãùæ/ûúvó”‚0÷h%ÍáµÒ0âã Î�´Ý¶Ø’{?ÓÌ>@f°_ÄG•T±¡¡Hê¹ùºxÚ>îÌOïŨ�%a0M"�Gºù)ëg'JAÕ͔Ȳ|Ìˉ(Ö²Ö;âã .Ž´ÝqóSfãm(…½#>ª¤ê¦FdÙ°Ÿj½?¿º>»øxùéDâãëï7 0s@PÂöÓ™3 -œ\ü4LéqÒîø[Lš8b–ÄXÈÉE•T=§ÐºÑrzÿóÍû³‹ðqæŒj>AÄ'4}(‘çéçùÀªžOháh—˜Õ=xÐ�Ù8ƒF5› b?”ʳ‰ôól`UÇ&2p´sçòíÛó‹·ûÏ�J¿EÏ6>¤íæh·èùT=ŸÐê`ù|xõy·ü|~"gg¨F$@ˆB›„(ÒÏ#‚U=¢ÐìÐ!ºúõ TWhÞÔPM)H€(…f ˆR¤Ÿ§«zJ¡çÁ.B�OO{yºü¦ì] µ›}˜lö‘["õtùm<ÖÏnöUÏ'´;X>Ëùâþá�ÕfÜÞen‡æ²ÛèZû…�/!Òvw'¸yŸR¢aÿ…�*É: ‰ cÙ~ø·u¾lºT0úé[!Òv Ó4`ôÓ¥ ê9 mëùf±š-î@HÐçªæ„`d°¨õ`øø‚"m·5rˆ6qÔ¼ z0|TIÕƒ:1¨Ö�|ZÎíPM+H€h…. -Îò´"ý<-XÕÓ -}v/ûhÎBÖD÷úòâÍþ~¥•¡ßÊ`SAÚna+­ ýVVPu�CÃzõõë^®v¿ˆTzúÅ v¤í'ÐËÐ/NUhèh°€To•–†¾Þ`sAÚn¡Þ@KC_oUO*46ØzûtöêêêìÃOïOÆÇ¿î_r•Ɔ¾ä`‹AÚn¡ä@cC_rUÏ)´7ì8½>;ÿïÙÍ/ç§—'Lÿ²ÿA»Òà ­i»-*™GT°ªC•Ø6ó§íífû²ÓS¥Ã¡_ `¯AÚnûd g(ÐáÐ/PUÏhèsØÌíÓç/ÅTçr0�~ƒ´Ý&Èå`‚U=¦ÐëÐV]{§=!êørÿr«´9ôåÒv åÚúr+¨zFC³ÃÓ|9Ûóé}¥µ¡z› ÒvÛ§÷:ûô´6ôOï ªîéýÐàP.—P] ãÇ@ Z7É3¥íÓx9PO8uQ%QÏ)tItœæÛ‡�r–ˆZPA<*4Z@ "õ<(XÔƒ -M¨—ÿ�Š“³DÔ’ -âR¡Ñ"©çIÁ¢žTh›èH-Ö‹}—åJ‡C¿,Ã^ƒ´Ý² :úe¹ ê–åØç0ú'LØ[‰Ö‘×ب»hØð0hsü�˜lkè˜ËÂëѦ‹™RsÇã‡l¤‰òEÿHû¿•˜UŒ‘�ªžH¤­ÏÈýwˆðî‰ÉÛùr¾¹µãnú†�WËÝ×îÅ;{Ê|î¾!´ûФìGŠwß™ÉÝ«¶fW›Ý7Ïç»hÔþñm÷õtõÏ·ûÔ¬b?^v] øü™ºô±endstream -endobj -5427 0 obj << -/Type /Page -/Contents 5428 0 R -/Resources 5426 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5491 0 R -/Annots [ 5430 0 R 5431 0 R 5432 0 R 5433 0 R 5434 0 R 5435 0 R 5436 0 R 5437 0 R 5438 0 R 5439 0 R 5440 0 R 5441 0 R 5442 0 R 5443 0 R 5444 0 R 5445 0 R 5446 0 R 5447 0 R 5448 0 R 5449 0 R 5450 0 R 5451 0 R 5452 0 R 5453 0 R 5454 0 R 5455 0 R 5456 0 R 5457 0 R 5458 0 R 5459 0 R 5460 0 R 5461 0 R 5462 0 R 5463 0 R 5464 0 R 5465 0 R 5466 0 R 5467 0 R 5468 0 R 5469 0 R 5470 0 R 5471 0 R 5472 0 R 5473 0 R 5474 0 R 5475 0 R 5476 0 R 5477 0 R 5478 0 R 5479 0 R 5480 0 R 5481 0 R 5482 0 R 5483 0 R 5484 0 R 5485 0 R 5486 0 R 5487 0 R 5488 0 R 5489 0 R 5490 0 R ] ->> endobj -5430 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 726.8189 170.6871 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5431 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.0658 714.8637 148.0023 725.7676] -/Subtype /Link -/A << /S /GoTo /D (page.134) >> ->> endobj -5432 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 702.9085 138.5976 713.8125] -/Subtype /Link -/A << /S /GoTo /D (page.72) >> ->> endobj -5433 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 678.9982 138.5976 689.9021] -/Subtype /Link -/A << /S /GoTo /D (page.67) >> ->> endobj -5434 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 667.043 170.6871 677.947] -/Subtype /Link -/A << /S /GoTo /D (page.52) >> ->> endobj -5435 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 643.1327 170.6871 654.0366] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5436 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 619.2223 151.3298 630.1263] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5437 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 595.312 170.6871 606.2159] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5438 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [146.5575 583.3568 163.494 594.2608] -/Subtype /Link -/A << /S /GoTo /D (page.136) >> ->> endobj -5439 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [142.1342 571.4017 159.0707 582.3056] -/Subtype /Link -/A << /S /GoTo /D (page.137) >> ->> endobj -5440 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 547.4913 151.3298 558.3953] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5441 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 523.581 151.3298 534.4849] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5442 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [161.8004 499.6707 173.7556 510.5746] -/Subtype /Link -/A << /S /GoTo /D (page.37) >> ->> endobj -5443 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [161.8004 475.7603 173.7556 486.6643] -/Subtype /Link -/A << /S /GoTo /D (page.37) >> ->> endobj -5444 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [161.8004 451.85 173.7556 462.7539] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5445 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.6358 439.8948 174.5723 450.7988] -/Subtype /Link -/A << /S /GoTo /D (page.138) >> ->> endobj -5446 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 415.9845 138.5976 426.8884] -/Subtype /Link -/A << /S /GoTo /D (page.68) >> ->> endobj -5447 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.9323 404.0293 151.8875 414.9333] -/Subtype /Link -/A << /S /GoTo /D (page.40) >> ->> endobj -5448 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.4829 380.119 170.4381 391.0229] -/Subtype /Link -/A << /S /GoTo /D (page.41) >> ->> endobj -5449 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 356.2087 175.27 367.1126] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5450 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 332.2983 175.27 343.2022] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5451 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 308.388 175.27 319.2919] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5452 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 284.4776 175.27 295.3816] -/Subtype /Link -/A << /S /GoTo /D (page.57) >> ->> endobj -5453 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 260.5673 175.27 271.4712] -/Subtype /Link -/A << /S /GoTo /D (page.57) >> ->> endobj -5454 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 236.657 175.27 247.5609] -/Subtype /Link -/A << /S /GoTo /D (page.58) >> ->> endobj -5455 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 212.7466 175.27 223.6506] -/Subtype /Link -/A << /S /GoTo /D (page.58) >> ->> endobj -5456 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 188.8363 175.27 199.7402] -/Subtype /Link -/A << /S /GoTo /D (page.58) >> ->> endobj -5457 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 164.926 175.27 175.8299] -/Subtype /Link -/A << /S /GoTo /D (page.59) >> ->> endobj -5458 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [163.3149 141.0156 175.27 151.9196] -/Subtype /Link -/A << /S /GoTo /D (page.59) >> ->> endobj -5459 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 117.1053 138.5976 128.0092] -/Subtype /Link -/A << /S /GoTo /D (page.68) >> ->> endobj -5460 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [143.788 105.1501 155.7432 116.0541] -/Subtype /Link -/A << /S /GoTo /D (page.75) >> ->> endobj -5461 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 726.8189 355.079 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.72) >> ->> endobj -5462 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [382.8644 714.8637 394.8196 725.7676] -/Subtype /Link -/A << /S /GoTo /D (page.61) >> ->> endobj -5463 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 690.9534 355.079 701.8573] -/Subtype /Link -/A << /S /GoTo /D (page.68) >> ->> endobj -5464 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 678.9982 387.1685 689.9021] -/Subtype /Link -/A << /S /GoTo /D (page.52) >> ->> endobj -5465 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 655.0879 367.8111 665.9918] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5466 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 631.1775 367.8111 642.0815] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5467 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 607.2672 367.8111 618.1711] -/Subtype /Link -/A << /S /GoTo /D (page.88) >> ->> endobj -5468 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 583.3568 367.8111 594.2608] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5469 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 559.4465 367.8111 570.3504] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5470 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 535.5362 367.8111 546.4401] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5471 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 511.6258 387.1685 522.5298] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5472 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.2816 499.6707 403.2181 510.5746] -/Subtype /Link -/A << /S /GoTo /D (page.139) >> ->> endobj -5473 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 475.7603 387.1685 486.6643] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5474 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [374.9642 451.85 386.9194 462.7539] -/Subtype /Link -/A << /S /GoTo /D (page.42) >> ->> endobj -5475 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [374.9642 427.9397 386.9194 438.8436] -/Subtype /Link -/A << /S /GoTo /D (page.43) >> ->> endobj -5476 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 404.0293 367.8111 414.9333] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5477 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 380.119 387.1685 391.0229] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5478 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [374.9642 356.2087 386.9194 367.1126] -/Subtype /Link -/A << /S /GoTo /D (page.43) >> ->> endobj -5479 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 332.2983 367.8111 343.2022] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5480 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 308.388 367.8111 319.2919] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5481 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 284.4776 387.1685 295.3816] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5482 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 260.5673 387.1685 271.4712] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5483 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 236.657 367.8111 247.5609] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5484 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 212.7466 355.079 223.6506] -/Subtype /Link -/A << /S /GoTo /D (page.69) >> ->> endobj -5485 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 200.7915 387.1685 211.6954] -/Subtype /Link -/A << /S /GoTo /D (page.53) >> ->> endobj -5486 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.2817 176.8811 390.2369 187.7851] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5487 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.2817 152.9708 390.2369 163.8747] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5488 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.2817 129.0605 390.2369 139.9644] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5489 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [343.1238 105.1501 355.079 116.0541] -/Subtype /Link -/A << /S /GoTo /D (page.69) >> ->> endobj -5490 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [356.4136 93.195 368.3688 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.40) >> ->> endobj -5429 0 obj << -/D [5427 0 R /XYZ 90 757.9346 null] ->> endobj -5426 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5494 0 obj << -/Length 3664 -/Filter /FlateDecode ->> -stream -xÚ­\ÙnÜF}×Wô£ˆ5µ/yËØžÄ™qâ‰eÌA (RÇb©5­V–¿Ï-6Y¬ý2Ö ˆe¹Ï­S÷ðÖF6ÛPø�mÝeˆRo®ïNèæüóW'lúx€Ï‡ð÷‹“¿ýƒ»�#Ns½¹øylA3¢8㛋›N¹’g?^|³ŽG©†vü?¿þöå«ÿúN^]„æ'v%4ó�ÿïä‡éæzñÍ %ÂYµù ~¡„9Ç7w'’‹ù—O'ïNþÚ9~0Ô’PLÔ²Y~5Ç$žn.·‡ûíáîêñ—1Ÿr 1FœRw½»ÿùŒ«ÓŸŸî¯Ïó™æÄ8m6†YB™¶Çþù�ö&Ì÷QO~ˆÊî–íúÞWðÀ)'2þLŸ€BX½HTª™^Tzøt{¸Ü=ž]�F`)�”ÄRá6ÚI¨V˜@3~ˆ*íúnØR %‰ÑZgü¹@3 -a�´å„ù‚ ®ú”špC´°f£�¯öãØèi2ã‡8 ¢IÑ®ï�á¿e2ãÏ5™Q«×DYÂ%u#ßû×o/ß]œ9qúåcìôâõ»‹×/ÞÕ$b³D»‡ZåÀˆ7Ш–šp«Ð¡5ã‡8 V9y»cåè²r'„Êø‹Ê™P«WIH€R�TÎc™· DRã<’÷Œâ€JÞE»¾ F)¼"B1›u O|F!´>qÎAq%ÓÄ/Ï( ¹p*Ö—DÐ+‰6–„i—DÂß.‰.+(£œ%R/Iƒ2»‡îdrõðP_ˆ”#†[¾QVE�ä™ñCP‘¦h×wD•E£Ñ$LùsifÂê¥1’(%m�æpýp ÙûÚÙ^ögÜní(XZ•szuíÄ�Ú 0¤vRþfíôY½@ÕRÊ0é^¼x{ùæÝ3&Z%,ÑÖ­Uq@O™†L´)[™.«W†kb„dqé\üåñéî3×iÅ`{`¬[½NÇ�u:À|´k®Ó)s�FXé”·¢œX.ÂȺÚ_¬îÛŒ•ß·�ø!¨ïÛÒvÇ=ŠªîÛ¤vmßæQ+…„ãŠÕVÇE~¼ÙŸ× -ÒZØâ…l.�ðCP›Kóv�+p¹AÓ -’�ÊL;PL¦ -¡õÉKÑ\ñúÍ«Ëÿœ1NO¿|}1þúÝû‹ÏŸT¥Ö¶ë§Ž8 3u2u¤üÍ©£Ïê…RŠP*¢©ãön{³CŽ>è¢,¥ Tšõ‹rÐY” Y”Sþæ¢ÜgõòF¨ãv©£‹=£h -f¯õ+qÐ+š†MÂß.š.«W…Â,_ö·O7ÿŸ­ŠpŠpnøj�‎@6 -d›¥üM�ú¬ �°‚Àç,è§Ûû›ç�*aP½«GUÐU†Œª”¿9ªú¬^ š™0ªÞ¿|{ùâëW/þùîý›gìç„4pâÓëÇWÐ+Ÿ†ìtSþvùtY½>B ››¤|®w÷÷•Òy¬‘KV~ˆj¥‘·{\¹EY°ÀXâÓµ1¡ZŸ;DÂïIî÷[Cò·ne´w³�J²õw�â€În6ÀÆmîfSþæna�w³Ü9¢¬r«g�°vÖˆ:³FÒ%š³FÊßœ5ú¬PÜzÝ©I*ãa»¿ÝÝÜ^wKãf,Ÿ_›2ÁÒ1Šh£ô -™FüÔeJÛõ�‘U™¤d6ã¯È4¢V/“p}¨¬Ê4Î"ÝEh�V0=­øz­¢€žV3lÔJ¶µJøÛZuY½VÂËhºNï·w»3ø?¶Ï[±a—@¬’aìE½±7ÃÆ±ÇÚc/áo�½.«ŠÁÑ˹tì=nŸ»¡áT'¥^/OГg†aò$ümyº¬ s~¹tɘ{Ö f)¡BòÕKVÐY² Y²Rþæ’ÕgõÂhK¨qÉóSÐöúp»»^ñ0¥ ƒ¼ºxâ€NñR<)³xú¬^#) 蔌­æ�AüÝó‚¥~„1¾–yÖêq¯W™~-QNeìEâGÂéóœp&Ô’÷ý§ÛÇÃöþ3·yŒS••ëÇLÐ33 3 {ÌôYçm£–*þÂp˜V‡( 7âŽ(Ù {8tY¡,œ&B.7\ÞÿÕË3Içg«ÇǬY…�óÑÝ8‡Yö@p}<œeî‰ÚÁSÀжŠó€íKàC„¯ô oµ~êp¦² ÒHÈó„gBI!i£6q_ŒcrÆì釛«ÃÕ§íçMØÂh©ӋÕ‘iÆq@¥ÓE»õ [X˜€�×3áÏ•šQë,UâÃXÒïJtyõÓn_©#ÊH¹x-…füTúZ´;î«ËR2€&£Ïš@ç<~OFÈ}{S© • {„•î�€G|e»cö¶¬ÀIfúî�€ÂXCþ±GdÌÿú—3FO« -ÀJ(¤Zb0&üÔÈÛm)WÔ–ñ -L(Œ5(ûM¼ןv�ÛVõ‹µ¾—€G(e»�ìÇÂÖ®ï{ (Œ5dŸ»_Æìkß?÷Wz­ý%àJÙnëâŽÁBßu¿ÆÒÏ=0Ó¶¿Ìߟ!,œ=C’ÿŒâ€JOŠvÇå¡xöèm�T•ñçùÏ(Œ5ä;k¢ük`,)N¯uù<â·)ÛmT€œßpt]>…±Î -^ŸiQ†X#Ø��€ ?ĵ�·;æïJý'”Éø‹0¡0Ö�l òùO7•ô©·w¸µN¦€G4¯¾ÉØëWß ¤!óØþå3ßoWµ}¿Ä9£Öѱ„•íÖìúÇÔNSÖ7¢ÆòÏíhû­¿•þûÝí¡ºûq°!ßýŒø!¨ï~Òv[Žk“ñWv?# -c ÄF·ã»÷•…_"4_í· xÄùV¶[DçHÁâ· (Œ5$ŸùíF“o%yE µn­á.àë[ÙnãÊ�Ò˜êî -c�“/mw“¡ê¼ºñæv­én†#æ·¢ÕFöN€˜¾ã. 0Ò�}컋�/çµ»2F¬B°ô'üÔòÏÛm 8ê…Jø &ƈý{™}¡¢�òG ±ÖMðˆ¯¯l·1þàà`ÛwÆ4È=…åSÕR -ØSk -‹lF¤˜ñCPéTÑný&¡¤yH-åϤ(Œ5Hûãç¦çµC·v­sr†#Æ¢ÕÆ-R0ågƒžo2 0Ò�}ìž,žþ�—×À£ÙÖ—`†1¾ìMÑj£À¸0{^3 -!]$ˆ­™ñC®óæ1l¥Kt9�õýše»õ9þ‡fÞƒÝs‰Æ(¼¢É…óZ7œ‘K6áCŒ¯MY«­Y`"îu}˜Péü¨ ±ŸN/ tr^^ÝÜ^=/Hµ¸KñÓ‚¿GÃëg…¸Íñ!§¬�$ƒeÊ]9)Œ(Œs.ŽÄx:Þ$Mõ{„NºµØ€G¼¨e»õ—3Æ» -T]l@a¬!ýØëÓ¿}h -`ˆ•°Œ…|yñCP_Òv[ŽÂ—òWˆ…±bcmòâÒyí.׎­5ùîu `O¢l…ͧ~ˆjóiÞn]H €÷ü&üÅ|:¡0Ö Aì ž4˜¾ôä¼zÄR½ÖÎðˆ±¸lw”À–N -Þ·3Æ$ÈMÍ���àM/Ì-1øM˜?Äõ›0i»uüíæ¿Â&å¯Ü„QkP vGO -ÀPhŒƒñÁ®XkÕxÄ4]¶Û*Àù§i]«v@a¬A‚ܰýØ� æ‚�£V„( 7âÞ4‚ÈøëA ¬AƒØž~REA„‘z­%=àsxÙný{�$|,„/—ž%= 0ÖyõÌ�é°zz3å¯}§Ú×þˆþÝ·ïª�ëdáï>®“¸Q¼hu<�ëÚ³"aàÂvÝé…‘Îe’xÔ?v÷•ÇÔŠg´Y°˜ÓsÂq@Íê™·;~1By³ZFSÆ_˜='Æ2��îÇó§®OÓ&x¥å>l­ûÞ÷¢ÕÆeŸ7Í]Ãý²µFHCò¹í_õÜG•YkºxÄ_¶ÛJt^ɾí> 0Ö�~î¾?¦ÏÚ×~X{í#|çÚÇÝè]û„½}íû¤!ùØÒ¿$ÏÛɯ{·`I¾kò/Z“oŸ)»oDÉ÷ICòÙ›Sò¢�üº7 –ä»ÿ¢U,ùÞ{Qò}Ò9ùèí‚%uÙL=~§O¼û^AÚ☴m&]¾ËØü¹ù˜2W„ÓúÁ‰3ÓÇãg åø]™°† -Ëê6Ö,ÿXÝË -�Ró�aðsz´ðÕö~»¿:loΠ‡ôvãÏ7ó_¾ñOŸ¦_Ÿ~Ò/¸ø‚Óão�–>þm<ëïöÇ_ž^¿�ÐdþôÇñçËÝï|8¾Ÿë©ÆWŽ]‹TúR«ô]endstream -endobj -5493 0 obj << -/Type /Page -/Contents 5494 0 R -/Resources 5492 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5491 0 R -/Annots [ 5496 0 R 5497 0 R 5498 0 R 5499 0 R 5500 0 R 5501 0 R 5502 0 R 5503 0 R 5504 0 R 5505 0 R 5506 0 R 5507 0 R 5508 0 R 5509 0 R 5510 0 R 5511 0 R 5512 0 R 5513 0 R 5514 0 R 5515 0 R 5516 0 R 5517 0 R 5518 0 R 5519 0 R 5520 0 R 5521 0 R 5522 0 R 5523 0 R 5524 0 R 5525 0 R 5526 0 R 5527 0 R 5528 0 R 5529 0 R 5530 0 R 5531 0 R 5532 0 R 5533 0 R 5534 0 R 5535 0 R 5536 0 R 5537 0 R 5538 0 R 5539 0 R 5540 0 R 5541 0 R 5542 0 R 5543 0 R 5544 0 R 5545 0 R 5546 0 R 5547 0 R 5548 0 R 5549 0 R 5550 0 R 5551 0 R 5552 0 R 5553 0 R 5554 0 R 5555 0 R 5556 0 R 5557 0 R 5558 0 R 5559 0 R 5560 0 R 5561 0 R 5562 0 R 5563 0 R 5564 0 R 5565 0 R 5566 0 R 5567 0 R 5568 0 R 5569 0 R 5570 0 R 5571 0 R 5572 0 R 5573 0 R ] ->> endobj -5496 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [161.8004 714.8637 173.7556 725.7676] -/Subtype /Link -/A << /S /GoTo /D (page.39) >> ->> endobj -5497 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [143.8077 690.9534 155.7628 701.8573] -/Subtype /Link -/A << /S /GoTo /D (page.89) >> ->> endobj -5498 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 667.043 138.5976 677.947] -/Subtype /Link -/A << /S /GoTo /D (page.72) >> ->> endobj -5499 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 643.1327 151.3298 654.0366] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5500 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [129.4116 631.1775 146.3481 642.0815] -/Subtype /Link -/A << /S /GoTo /D (page.140) >> ->> endobj -5501 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 607.2672 151.3298 618.1711] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5502 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 583.3568 170.6871 594.2608] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5503 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 559.4465 151.3298 570.3504] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5504 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 535.5362 151.3298 546.4401] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5505 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 511.6258 138.5976 522.5298] -/Subtype /Link -/A << /S /GoTo /D (page.69) >> ->> endobj -5506 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [143.788 499.6707 155.7432 510.5746] -/Subtype /Link -/A << /S /GoTo /D (page.75) >> ->> endobj -5507 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [149.885 487.7155 166.8215 498.6194] -/Subtype /Link -/A << /S /GoTo /D (page.142) >> ->> endobj -5508 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 463.8052 151.3298 474.7091] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5509 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 439.8948 170.6871 450.7988] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5510 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 415.9845 151.3298 426.8884] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5511 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 392.0742 151.3298 402.9781] -/Subtype /Link -/A << /S /GoTo /D (page.88) >> ->> endobj -5512 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 368.1638 170.6871 379.0678] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5513 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [139.3746 344.2535 151.3298 355.1574] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5514 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [150.9911 332.2983 167.9276 343.2022] -/Subtype /Link -/A << /S /GoTo /D (page.143) >> ->> endobj -5515 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 308.388 138.5976 319.2919] -/Subtype /Link -/A << /S /GoTo /D (page.70) >> ->> endobj -5516 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 296.4328 170.6871 307.3367] -/Subtype /Link -/A << /S /GoTo /D (page.53) >> ->> endobj -5517 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.4829 272.5225 170.4381 283.4264] -/Subtype /Link -/A << /S /GoTo /D (page.43) >> ->> endobj -5518 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.4829 248.6121 170.4381 259.5161] -/Subtype /Link -/A << /S /GoTo /D (page.44) >> ->> endobj -5519 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 224.7018 170.6871 235.6057] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5520 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 200.7915 170.6871 211.6954] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5521 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 176.8811 138.5976 187.7851] -/Subtype /Link -/A << /S /GoTo /D (page.70) >> ->> endobj -5522 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 152.9708 170.6871 163.8747] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5523 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.6548 141.0156 169.5913 151.9196] -/Subtype /Link -/A << /S /GoTo /D (page.144) >> ->> endobj -5524 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [126.6425 117.1053 138.5976 128.0092] -/Subtype /Link -/A << /S /GoTo /D (page.70) >> ->> endobj -5525 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.732 105.1501 170.6871 116.0541] -/Subtype /Link -/A << /S /GoTo /D (page.54) >> ->> endobj -5526 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.8559 726.8189 367.8111 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5527 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [375.2133 702.9085 387.1685 713.8125] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5528 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [368.5781 678.9982 380.5333 689.9021] -/Subtype /Link -/A << /S /GoTo /D (page.47) >> ->> endobj -5529 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [377.9828 667.043 389.938 677.947] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5530 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [371.2382 655.0879 383.1934 665.9918] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5531 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [368.578 643.1327 380.5332 654.0366] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5532 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [373.5593 631.1775 385.5145 642.0815] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5533 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.0886 619.2223 391.0438 630.1263] -/Subtype /Link -/A << /S /GoTo /D (page.52) >> ->> endobj -5534 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [388.4933 607.2672 400.4485 618.1711] -/Subtype /Link -/A << /S /GoTo /D (page.48) >> ->> endobj -5535 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [376.8768 595.312 388.832 606.2159] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5536 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.6937 583.3568 381.6488 594.2608] -/Subtype /Link -/A << /S /GoTo /D (page.52) >> ->> endobj -5537 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [363.6067 571.4017 375.5618 582.3056] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5538 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [381.0513 559.4465 393.0064 570.3504] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5539 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [363.6068 547.4913 375.5619 558.3953] -/Subtype /Link -/A << /S /GoTo /D (page.49) >> ->> endobj -5540 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [373.0012 535.5362 384.9564 546.4401] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5541 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [373.9678 523.581 385.923 534.4849] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5542 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [366.3665 511.6258 378.3216 522.5298] -/Subtype /Link -/A << /S /GoTo /D (page.53) >> ->> endobj -5543 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [364.7126 499.6707 376.6678 510.5746] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5544 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [383.5318 487.7155 395.4869 498.6194] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5545 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [385.7439 475.7603 397.699 486.6643] -/Subtype /Link -/A << /S /GoTo /D (page.50) >> ->> endobj -5546 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [384.379 463.8052 396.3342 474.7091] -/Subtype /Link -/A << /S /GoTo /D (page.53) >> ->> endobj -5547 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [397.6094 451.85 409.5646 462.7539] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5548 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.2917 439.8948 398.2469 450.7988] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5549 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [406.7647 427.9397 418.7199 438.8436] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5550 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.6563 415.9845 391.6115 426.8884] -/Subtype /Link -/A << /S /GoTo /D (page.54) >> ->> endobj -5551 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [389.9777 404.0293 401.9329 414.9333] -/Subtype /Link -/A << /S /GoTo /D (page.51) >> ->> endobj -5552 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [372.4537 380.119 384.4089 391.0229] -/Subtype /Link -/A << /S /GoTo /D (page.74) >> ->> endobj -5553 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [379.0986 368.1638 391.0538 379.0678] -/Subtype /Link -/A << /S /GoTo /D (page.75) >> ->> endobj -5554 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.8494 356.2087 398.8046 367.1126] -/Subtype /Link -/A << /S /GoTo /D (page.75) >> ->> endobj -5555 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [391.2728 344.2535 403.228 355.1574] -/Subtype /Link -/A << /S /GoTo /D (page.75) >> ->> endobj -5556 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.2816 320.3431 398.2368 331.2471] -/Subtype /Link -/A << /S /GoTo /D (page.77) >> ->> endobj -5557 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.5408 308.388 390.4959 319.2919] -/Subtype /Link -/A << /S /GoTo /D (page.77) >> ->> endobj -5558 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.8393 296.4328 398.7945 307.3367] -/Subtype /Link -/A << /S /GoTo /D (page.78) >> ->> endobj -5559 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.2816 272.5225 398.2368 283.4264] -/Subtype /Link -/A << /S /GoTo /D (page.37) >> ->> endobj -5560 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [394.5903 260.5673 406.5455 271.4712] -/Subtype /Link -/A << /S /GoTo /D (page.37) >> ->> endobj -5561 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [393.4843 248.6121 405.4395 259.5161] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5562 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [385.1757 236.657 397.1308 247.5609] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5563 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [389.051 224.7018 401.0062 235.6057] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5564 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [393.4843 212.7466 405.4395 223.6506] -/Subtype /Link -/A << /S /GoTo /D (page.38) >> ->> endobj -5565 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [392.3784 200.7915 404.3335 211.6954] -/Subtype /Link -/A << /S /GoTo /D (page.39) >> ->> endobj -5566 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [363.4177 177.5984 375.3729 187.7851] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5567 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [351.9805 165.6432 363.9356 175.8299] -/Subtype /Link -/A << /S /GoTo /D (page.60) >> ->> endobj -5568 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.5408 152.9708 390.4959 163.8747] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5569 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [373.5594 141.0156 385.5146 151.9196] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5570 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.5408 129.0605 390.4959 139.9644] -/Subtype /Link -/A << /S /GoTo /D (page.56) >> ->> endobj -5571 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.5408 117.1053 390.4959 128.0092] -/Subtype /Link -/A << /S /GoTo /D (page.57) >> ->> endobj -5572 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.5408 105.1501 390.4959 116.0541] -/Subtype /Link -/A << /S /GoTo /D (page.57) >> ->> endobj -5573 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [378.5408 93.195 390.4959 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.58) >> ->> endobj -5495 0 obj << -/D [5493 0 R /XYZ 90 757.9346 null] ->> endobj -5492 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -5576 0 obj << -/Length 3800 -/Filter /FlateDecode ->> -stream -xÚ¥\kS7ýί¸¡ÊRô~äì�µ±®cg³) -õC-–GÿûmÍÕH©çŠ-*UñN÷‘δº[Ò_0ø�/<[Xm©—Ê,οm±ÅWøöë-Là礼\nýðJø…§Þ³X~<Nµàb±¼ømûðhÿàÓÎïËŸŠ9Ê´GáûBëðÝ­ƒeòɵ4<øþïÖo¿³Å âç-F¥wzñ|Á(÷^,¾m)!Ç/®¶N¶þ™ü¬0`sÐ\b“�Å$8ƒÏBË…ðÁ®gòxy{zy{vqqwzþíöE=zîf=Ú Üá'w_#ä¸E‚“�Œ¤öF¢]CîA +ý”¼šxu(Óä¹¥Ž3ÛÌþæv‡³íJ!U¶ìiñ¤4ÀD¨ýΩ ¨p=SþF†ˆê±&˜¦FyUëðíìþ?ˆŠ2gL¶êiñ¤4À4¨ýøVÀ)XSþFƒˆê±Ž/©rŽc`«A0N…<n–!áIiШõ‹Ëk† -¦lÅ_É�PVÈLÆqˆAãF.V;Boÿùåñú|Èn< -E¸ Ü@Š…ú¼#Øöã—6P”¦–ÁDŒ­{qá¤Ä#¬ö†¡TC®á©i+ö:JFT�4E dUÆT‘/¯oÚ©kI9+à�©G8)ñÈ(j¯ÃÔyCn$e€©Øë©�¨išºRÔ)(…ãÔoWw—7—çíì�¦ÂØÂ¤3ýOJd(�ßAÑð[À ï+þZ€ÕcMHAa‘˜F¨××HžôÔpí³]/OF<) °DT�5ÍžqÈÉ6×ÈW‡ŸöC>ØÝß?FÔ_˜õòÀNJ<–*¯3�?•Ñ {“RQÞL:J �§Jk7•à`ùª€€.Òihº’Yg ŒxR k ñ;#‚œ€VrÊ_‹0¢:¬Yk©ð*Ç7‡'˃£÷ïŽw Û^žà¹@ƒA²|B.xRÌä‚‰ß ¹ <Ü)?– ªÃšu0šr)sq|óæ§Ó7H¯8¬4Ø‘d‹^9ˆxR`å ö;Ì_ãÇ€FTüM9ˆ¨kš¿Ô[žÏ¡®n¾¢gŠŒîoœ<) ð�óÔï0w‡mœ%‡†oÊ�lœT�5Í]±p«eò³÷úõáÑkäø�SɬȽó·ˆ'¥vWû�yöžC{ì)sQ=Ö4áÂ�–Ló‡=ÂzùBÂßQͬÍF½ð�xR`á_û� ·>«�ò7áQ=Ö$7á6«Tàä×£Y`ªÀs2ëUÃ'«†•W\ÎU½ÖSò¦FP‡2ÍŸ©pY—»Á÷ÿ¡BSôê¶Qóú¶dÖ«…OJ¬Ö~g$€“¡Lø›ZQÖ$‚ðá HçŽðø`÷ääàíË7°=`Û¿¢µÐqØÆ$Ë~-ð¤4ÀkáÔïŒP嬅�Ï”©…ªÃšup,\àñB‡½ƒpxòñðhØ.~l¥†Jéx6îH1âIi€HÑø¤0 ¿\h§§üµ#ªÃš¥06\ååİN ;Üm¿{�•'æ` ’¬zçªOJì\µö‹kî3™‚ÖÊßœ«FT�5i.µÇ{Á ÁÉúôd‡s¾½„vñpï½­ÚÖýÛÊOJü¶rêwF 8ø_Å�ÜV¨kÒBÉémåýÃÙÃ=v´ª<3• z¡°†“�EBåuæ\ÕLS±7�Q=Ò4yÉ'W•ç·§g··A‚&Áúí)�ìzU2ÂI�Ǫdå— ¤PÞ‹›�7U2‚:”IîóÅ`X Ë=hNNÐMZd‹þ&aÀ“Òß$LýÎD?¬欯ø‘M€걦ù3.*s�\¾…ª°ÃÛÞ=\_¾ûÐ# -驳¶pÐ)#ž”HqhüÎ8’Á„¿Ž†ÕaMr„wœչN.—o^`— �axF÷2AÄ“ÒKµß¹¢ Âí—­ø›\Q=Ö4w'ÂU¬›ÜÛoL°ƒî6ö²AÄ“ÒKµ_|ë(à¬ð)“"ªÇšd°,\Íæã“ûïO÷~:ØûÇɇ·Èá‰àr—Èv½.)âIi€uIµß™¬iÎxXñSþ¦KЍkVA‡Ýχ'Ž_¯Ï×=ÂÐ. /¿ -¦²uÿÝ×'%õuâu¦D­0¿);òæë€ê�z@+³~ý+.ˆûÛ«ÞË äôæñ}å/¼Ç,<*©Âm¯yÊëÑOJƒ™÷£'~�¡él#&kÈO mÕÞw³èˆ'¥2äÆïL³ û7èŸM=€º-Q=Ú¤”fÔ(¥ÐfŠ?Y(éž^>]¨Â`“P#l¦âf¡&˜j3m -Ö˜•j¶}^PAî´Öù§kUlÒj„uµš `^«Í´I+^w“n¾e}–ZÊ3êúGoY­Ò`ƒZ ÖSk:€Yµ:´£ZÊ:ê¹T³]íóÄ2ðîé˰4Ø$ÖëŠ5À¼X›i“XáÒ�IÞ6¾ÏSIIÊ”}ú, 6©4Âfz¬Òdó*m¦M*Ép:#ÜLoü<©Â¥¤´ÿÇê+ 6I5ºRM0/ÕfÚ$³”;¡fÚçgI%}øÝóþYf’ª4Ø U‚ÍtUI„éf¥êÐŽRI;+°ûy2YN%7O_|¥Á&™FXW¦ÉæeÚL›dÒžÊpi;•i¸‚ED�TI/²UO„ˆ'¥&BíwA!}¥£ð`ë4"DT�6‰ ìzK‚ïDž/¶Њ<=^ -ƒMñ2ºñ2@}MëÇxFQÉð;m¶þ‰yÖˆþŒ•^¾HîPImè¾ÖÅ -¶¤*¦Õ׫ëÕÝÙÃx§uï´ÞŽ~—�ñ .â¿ìG!lý•`̬?} ×]7wÕµžõ‡Ïß×ÿîßüýýëêºS$ë¡úüH7endstream -endobj -5575 0 obj << -/Type /Page -/Contents 5576 0 R -/Resources 5574 0 R -/MediaBox [0 0 595.2756 841.8898] -/Parent 5491 0 R -/Annots [ 5578 0 R 5579 0 R 5580 0 R 5581 0 R 5582 0 R 5583 0 R 5584 0 R 5585 0 R 5586 0 R 5587 0 R 5588 0 R 5589 0 R 5590 0 R 5591 0 R 5592 0 R 5593 0 R 5594 0 R 5595 0 R 5596 0 R 5597 0 R 5598 0 R 5599 0 R 5600 0 R 5601 0 R 5602 0 R 5603 0 R 5604 0 R 5605 0 R 5606 0 R 5607 0 R 5608 0 R 5609 0 R 5610 0 R 5611 0 R 5612 0 R 5613 0 R 5614 0 R 5615 0 R 5616 0 R 5617 0 R 5618 0 R 5619 0 R 5620 0 R 5621 0 R 5622 0 R 5623 0 R 5624 0 R 5625 0 R 5626 0 R 5627 0 R 5628 0 R 5629 0 R 5630 0 R 5631 0 R 5632 0 R 5633 0 R 5634 0 R 5635 0 R 5636 0 R 5637 0 R 5638 0 R 5639 0 R 5640 0 R 5641 0 R 5642 0 R 5643 0 R 5644 0 R 5645 0 R 5646 0 R 5647 0 R ] ->> endobj -5578 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.215 726.8189 191.1701 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.58) >> ->> endobj -5579 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.3271 714.6576 193.2823 725.5615] -/Subtype /Link -/A << /S /GoTo /D (page.58) >> ->> endobj -5580 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [183.0903 702.4963 195.0455 713.4002] -/Subtype /Link -/A << /S /GoTo /D (page.59) >> ->> endobj -5581 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [200.2458 690.335 212.201 701.2389] -/Subtype /Link -/A << /S /GoTo /D (page.59) >> ->> endobj -5582 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.7047 666.0124 156.6599 676.9163] -/Subtype /Link -/A << /S /GoTo /D (page.44) >> ->> endobj -5583 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [152.1068 653.8511 164.0619 664.755] -/Subtype /Link -/A << /S /GoTo /D (page.41) >> ->> endobj -5584 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [164.271 641.6898 176.2262 652.5938] -/Subtype /Link -/A << /S /GoTo /D (page.42) >> ->> endobj -5585 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.6196 629.5285 200.5748 640.4325] -/Subtype /Link -/A << /S /GoTo /D (page.43) >> ->> endobj -5586 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [171.4741 617.3672 183.4293 628.2712] -/Subtype /Link -/A << /S /GoTo /D (page.43) >> ->> endobj -5587 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [184.1963 605.2059 196.1514 616.1099] -/Subtype /Link -/A << /S /GoTo /D (page.43) >> ->> endobj -5588 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [208.5449 593.0447 220.5001 603.9486] -/Subtype /Link -/A << /S /GoTo /D (page.44) >> ->> endobj -5589 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [143.798 568.7221 155.7531 579.626] -/Subtype /Link -/A << /S /GoTo /D (page.61) >> ->> endobj -5590 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.9136 544.3995 156.8688 555.3034] -/Subtype /Link -/A << /S /GoTo /D (page.40) >> ->> endobj -5591 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [158.1937 532.2382 170.1488 543.1421] -/Subtype /Link -/A << /S /GoTo /D (page.40) >> ->> endobj -5592 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [136.6051 508.6329 148.5603 518.8195] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5593 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [131.6238 496.4716 143.579 506.6582] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5594 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.0594 484.3103 214.0145 494.497] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5595 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [202.6172 472.149 214.5724 482.3357] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5596 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.3295 459.9877 211.2847 470.1744] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5597 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [194.5275 447.8264 206.4827 458.0131] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5598 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [175.2499 435.6651 187.205 445.8518] -/Subtype /Link -/A << /S /GoTo /D (page.83) >> ->> endobj -5599 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.6981 423.5038 211.6533 433.6905] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5600 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [168.7045 411.3426 180.6597 421.5292] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5601 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [192.0967 399.1812 204.0519 409.3679] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5602 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [211.8625 387.02 223.8176 397.2066] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5603 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.6582 374.8587 211.6134 385.0453] -/Subtype /Link -/A << /S /GoTo /D (page.84) >> ->> endobj -5604 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [178.6573 362.6974 190.6124 372.884] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5605 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [144.3559 349.8188 156.3111 360.7227] -/Subtype /Link -/A << /S /GoTo /D (page.88) >> ->> endobj -5606 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [180.311 338.3748 192.2662 348.5614] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5607 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [177.5114 326.2135 189.4666 336.4002] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5608 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [197.4366 314.0522 209.3917 324.2389] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5609 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [212.9782 301.8909 224.9333 312.0776] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5610 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [199.8175 289.7296 211.7727 299.9163] -/Subtype /Link -/A << /S /GoTo /D (page.85) >> ->> endobj -5611 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [225.3418 277.5683 237.297 287.755] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5612 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [154.0895 265.407 166.0446 275.5937] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5613 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [188.261 253.2457 200.2162 263.4324] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5614 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [157.0877 240.3672 169.0429 251.2711] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5615 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [189.1772 228.2059 201.1324 239.1098] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5616 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [178.129 216.7619 190.0842 226.9485] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5617 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [238.881 204.6006 250.8362 214.7872] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5618 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [153.2028 192.4393 165.158 202.6259] -/Subtype /Link -/A << /S /GoTo /D (page.86) >> ->> endobj -5619 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [191.947 179.5607 203.9021 190.4647] -/Subtype /Link -/A << /S /GoTo /D (page.88) >> ->> endobj -5620 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [220.739 168.1167 232.6941 178.3034] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5621 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [181.2077 155.9554 193.1629 166.1421] -/Subtype /Link -/A << /S /GoTo /D (page.87) >> ->> endobj -5622 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [179.2346 130.9155 191.1898 141.8195] -/Subtype /Link -/A << /S /GoTo /D (page.89) >> ->> endobj -5623 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [155.6932 118.7543 172.6297 129.6582] -/Subtype /Link -/A << /S /GoTo /D (page.196) >> ->> endobj -5624 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [236.3796 93.9122 248.3347 104.0989] -/Subtype /Link -/A << /S /GoTo /D (page.61) >> ->> endobj -5625 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [353.106 727.5361 370.0425 737.7228] -/Subtype /Link -/A << /S /GoTo /D (page.114) >> ->> endobj -5626 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [355.1585 715.581 372.095 725.7676] -/Subtype /Link -/A << /S /GoTo /D (page.120) >> ->> endobj -5627 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [403.9849 691.6706 420.9214 701.8573] -/Subtype /Link -/A << /S /GoTo /D (page.115) >> ->> endobj -5628 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [399.5614 679.7155 416.4979 689.9021] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5629 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [414.4954 667.7603 431.4319 677.947] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5630 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [420.5824 655.8051 437.5189 665.9918] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5631 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [408.4181 643.85 425.3546 654.0366] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5632 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [386.2814 631.1775 403.2179 642.0815] -/Subtype /Link -/A << /S /GoTo /D (page.117) >> ->> endobj -5633 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [412.2935 619.9396 429.23 630.1263] -/Subtype /Link -/A << /S /GoTo /D (page.117) >> ->> endobj -5634 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [413.9572 607.2672 430.8937 618.1711] -/Subtype /Link -/A << /S /GoTo /D (page.118) >> ->> endobj -5635 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [390.1568 595.312 407.0933 606.2159] -/Subtype /Link -/A << /S /GoTo /D (page.118) >> ->> endobj -5636 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [409.5338 584.0741 426.4703 594.2608] -/Subtype /Link -/A << /S /GoTo /D (page.118) >> ->> endobj -5637 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 560.1638 386.0624 570.3504] -/Subtype /Link -/A << /S /GoTo /D (page.115) >> ->> endobj -5638 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 536.2535 386.0624 546.4401] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5639 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 512.3431 386.0624 522.5298] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5640 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 488.4328 386.0624 498.6194] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5641 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 464.5224 386.0624 474.7091] -/Subtype /Link -/A << /S /GoTo /D (page.116) >> ->> endobj -5642 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 440.6121 386.0624 450.7988] -/Subtype /Link -/A << /S /GoTo /D (page.117) >> ->> endobj -5643 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 416.7018 386.0624 426.8884] -/Subtype /Link -/A << /S /GoTo /D (page.117) >> ->> endobj -5644 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 392.7914 386.0624 402.9781] -/Subtype /Link -/A << /S /GoTo /D (page.118) >> ->> endobj -5645 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 368.8811 386.0624 379.0678] -/Subtype /Link -/A << /S /GoTo /D (page.118) >> ->> endobj -5646 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [372.443 356.9259 389.3795 367.1126] -/Subtype /Link -/A << /S /GoTo /D (page.145) >> ->> endobj -5647 0 obj << -/Type /Annot -/Border[0 0 0]/H/I/C[1 0 0] -/Rect [369.1259 333.0156 386.0624 343.2022] -/Subtype /Link -/A << /S /GoTo /D (page.118) >> ->> endobj -5577 0 obj << -/D [5575 0 R /XYZ 90 757.9346 null] ->> endobj -5574 0 obj << -/Font << /F29 499 0 R /F23 482 0 R >> -/ProcSet [ /PDF /Text ] ->> endobj -4977 0 obj -[474 0 R /Fit] -endobj -4919 0 obj -[474 0 R /Fit] -endobj -4902 0 obj -[474 0 R /Fit] -endobj -4878 0 obj -[474 0 R /Fit] -endobj -4857 0 obj -[474 0 R /Fit] -endobj -4670 0 obj -[474 0 R /Fit] -endobj -4576 0 obj -[474 0 R /Fit] -endobj -4531 0 obj -[474 0 R /Fit] -endobj -4521 0 obj -[474 0 R /Fit] -endobj -4495 0 obj -[474 0 R /Fit] -endobj -4466 0 obj -[474 0 R /Fit] -endobj -4447 0 obj -[474 0 R /Fit] -endobj -4403 0 obj -[474 0 R /Fit] -endobj -4354 0 obj -[474 0 R /Fit] -endobj -4324 0 obj -[474 0 R /Fit] -endobj -4316 0 obj -[474 0 R /Fit] -endobj -4299 0 obj -[474 0 R /Fit] -endobj -4282 0 obj -[474 0 R /Fit] -endobj -4258 0 obj -[474 0 R /Fit] -endobj -4240 0 obj -[474 0 R /Fit] -endobj -4219 0 obj -[474 0 R /Fit] -endobj -4205 0 obj -[474 0 R /Fit] -endobj -4182 0 obj -[474 0 R /Fit] -endobj -4150 0 obj -[474 0 R /Fit] -endobj -4123 0 obj -[474 0 R /Fit] -endobj -4104 0 obj -[474 0 R /Fit] -endobj -4075 0 obj -[474 0 R /Fit] -endobj -4059 0 obj -[474 0 R /Fit] -endobj -4037 0 obj -[474 0 R /Fit] -endobj -4017 0 obj -[474 0 R /Fit] -endobj -3985 0 obj -[474 0 R /Fit] -endobj -3956 0 obj -[474 0 R /Fit] -endobj -3905 0 obj -[474 0 R /Fit] -endobj -3890 0 obj -[474 0 R /Fit] -endobj -3700 0 obj -[474 0 R /Fit] -endobj -3699 0 obj -[474 0 R /Fit] -endobj -3698 0 obj -[474 0 R /Fit] -endobj -3697 0 obj -[474 0 R /Fit] -endobj -3696 0 obj -[474 0 R /Fit] -endobj -3666 0 obj -[474 0 R /Fit] -endobj -3665 0 obj -[474 0 R /Fit] -endobj -3664 0 obj -[474 0 R /Fit] -endobj -3663 0 obj -[474 0 R /Fit] -endobj -3662 0 obj -[474 0 R /Fit] -endobj -3661 0 obj -[474 0 R /Fit] -endobj -3660 0 obj -[474 0 R /Fit] -endobj -3659 0 obj -[474 0 R /Fit] -endobj -3658 0 obj -[474 0 R /Fit] -endobj -3657 0 obj -[474 0 R /Fit] -endobj -5648 0 obj << -/Type /Encoding -/Differences [ 0 /.notdef 1/dotaccent/fi/fl/fraction/hungarumlaut/Lslash/lslash/ogonek/ring 10/.notdef 11/breve/minus 13/.notdef 14/Zcaron/zcaron/caron/dotlessi/dotlessj/ff/ffi/ffl/notequal/infinity/lessequal/greaterequal/partialdiff/summation/product/pi/grave/quotesingle/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde 127/.notdef 128/Euro/integral/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE/Omega/radical/approxequal 144/.notdef 147/quotedblleft/quotedblright/bullet/endash/emdash/tilde/trademark/scaron/guilsinglright/oe/Delta/lozenge/Ydieresis 160/.notdef 161/exclamdown/cent/sterling/currency/yen/brokenbar/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis] ->> endobj -1228 0 obj << -/Length1 1642 -/Length2 9543 -/Length3 532 -/Length 10417 -/Filter /FlateDecode ->> -stream -xÚíteTœí²%Ü�»»»KÐà�¦»�ÒÐÝ4¸{‚»‡@pw ‚»OpK�0äûæÜs×™¹î=¿fM¯õözŸÚU»ªž]o±0èò(€a¶U˜ ’G€—_  u¶uGÀœuaÚ<:0T t<`"¸,,Jp …¹(‘I€  P†€‚‚ \€ÌÕ µw@Ø� L8¸¸¸ÿiùã°õúò‰€Ú»X^< N0Wgˆ ò�â¿h��€Ô Pz¦g¦¡«`WÓ5¨A\ ð‡&ôÜm�  €6qA@8v08ÀéïsCÿ´†à}àR@€„+}ƒx‚ ® n€+î E ÞPÀtA>Ü€º€œÜÁ -x°ÛÁþ*È{ðp~ÀÈô`$‡º"Yõ”Uÿ®éDþÉ�€>À˜Ýƒ'rÿÓÒ_ØÍŠB]$Äù'—-†"\�€^¹È\áпÊpG@]ìÿY7±ÂÁNâ�æ�ûÏíü³OÀêèêêäõW4ì/¯ÿ¨ŠD@œìxqr‚�¹í¡.¸|æEÃÅàÿÛvwýæ�ÿuAìf†ã¡ æâäCìpùtaȇ”öÿžÊ¼ÿ>‘ÿ ÿ[þ·Èû?÷_5úOñÿô{þWjUw''] óÃü½g‹èxØ5mÀŸeãî ø³o  ÿ#è uòú¯bÿÕÛòwÑŠ0'ð¿bó+¸Ø?¨Ã# Â+ô·ŠP…zBÀzP$È`tz¸¸¿ìÆ.`Ü êyø¯»}âçÿÌÈ -rtù£„ÈßÄü¯ ±ò\îñ>Çô~¹ú½¥qú»V?Htøº‚ÃW�“&<À@àu<$-p2‘Ñ›9,œ ×!ñ^T×}žE-ÅIëµÓºü´Ÿ¹ÀÄÏÜŸ´’˜ìZß>?—mÙL™ay3NQï•ÙŒU�†È1}—&Ʀ—9Þ:è nÞ«ÿPGÑXKb—fÄê~M½í{K$øÉ: ›Œ0Â!øjìÛ£*”2â,Á6^ qLû¼ÔBž¥cÉõ>Þ©;7!u‰ûâh­zèo»SÏõœ7ML˜OëŸhÐÈNAQ"©wõû®})ÆÌÌ×1°Ù Ãáá�ÌŽ”¹å1W èOç›Ã„ßèA)µhA{‹àöY+(R” GB9sRÄÆ'ýÔ&»‹Œ¥U7H?^O°27ù6ÓòÂ%*Gü©­¬øÐ³¹Ÿ²¿JˆÚ&JD Ú›Eõaºê�Ç¥Sß -Sú™ë§)[£*³Ö(AB¾i½Ä‰½'ü#ÇrRmB[À“ó@6ϱ®O¼þ÷Cg—ò0²Ö°Ü„pWbÑH×G�?NÊ _¡±C@qRÒ_P몵o5M¥$`CžhrAñŸÊ¼6 “ïÂËï”|Jã<Üû[¯8J Ø”{…NÑ'2éqGÎt¼i‚?^oã½­4v4^¬N�u5Óm蛼ãZ¹Aøc‘Ös¾›6Ý!À"Bäí,r0A¼–Œg_@Œ?˜<Ù}2ÐÈßTm“»”lÔä„ϰØz&iî›ð¤†2ŸE‹Ü­¤>ÝzC°)º ÞEô±éÉQ׎®VQ+¶‘L˜ÿ±®)Üƶ-ë"[|B°G™&~©v„f_çù}ÆmVõE¬‡ˆk—F‹Ì¤f?®®"ëÕáôÒ7ÔQV ÂGÑ8=V?B&,'¸{ÚÒt¦‘#©˜{*øei£†Æa+= ¶²�ì"»P>ÓEèäbŒP2¤ -ÐÕæQÄ1j…[b’ùN미ÆbódäNì”êÅ϶lÐk3¡-Ù ØPÞIšD l])H‘Üf`é�„éÀ]Ÿ4V{ÅJÏŒ%59°¹¬ñ“u^°½ü�©é A»žæ1wóúÌ’ö´æ¬\ìà5 SÃ÷ÀW�‡:.+CÆÄ ÜzŽ‚@®¯£VI¾‘*(Õ�m(ÏÛý¢¬ICÌÌ �â¢&-ÃŽ�Úœ±Ô†œtÚÁÇ·|´sÊÞcùzŸ-XZ³²WøÌ|cµðÓbM+?©-QMãYë1/Ö(ì‚sòÚ£Ô>HiN:WöaÆîƒx÷ò -ªÞŒïqv†.=«ÆW—ûMJ~™xaÈ:Ü·0æ ®éΖ.ùerH5Ô»‚yåLl´ [–rxzO.³:ׂ¿ÊŠœEl²XiˆÏb¡’��ü×O>8¾eaùš™ðÌφ�íNý„oÎÍn2ñ>R;Ê*±´­bõŠ 8àÿfj÷G,öã¶–T̳ÇvørÎô ;Ahò;¯'Sª‘²2äAÁ"TOü ³/î¨ʼn(»,Õ>Q­æ;’6d+ -J UŸÇt:–I#ØÆù…-ÐÕ„ðÌÎÁ¾|;");üâ!×^Žx‹Þ Zø -: -v -zÖ'®uDÞ]Á1Ø -­q'lw¥Nß]Ðùh4T)&Žoе9/ÌåÒÉ=µRT½é{ׇ]óK¶äg1:‰¾u17´‡ç t§²nѯî!4ðé�&vÑõ-Ù×3†P¢j éO{åËp¨ÏX6©ÝŒŽ•×çÝ…‚€É„ËÃÔX;¨›GåÂx­šw“E`èð4ÍWL¶ø¬ œÑÃÌÖ $¾ÖŠï6ë%S¶ŠþmF ·õ‡ Ú„òÜzR0Þ÷# ]o&…¡yKUübÚ“ -[¦�®dã…ç ®ú˜× êLßÀàʰå¾W²Mï³äã²v#ù_[i5 >�ëé¿4 ÉÆ\“ý*NÛW™�=á·°eþf¥â(ÕäÕÆlè ž~¸w¨%åÇŸŒ›vœ±YëO|¶ö‚M—û$´Lce÷<ÞÞÇÚ1D:<{y öûl)&DÙAÀ¬0µ@.lFΧßûÙ;šö­áXî%ì‡!³0â·>{§“�ô?oehqcöÔhBÅá—“Ã÷öMKy…ëkg�¥�¡¦Úõ5 šk© Fùã{òÄ‚) Òg³eí�¿�'Y<¸{y$Ä‹8;�WûŽ&·f¹¯ wLù|ÃDì¢ÔŸùzCdãÔ8lç;+è�°JoI/¤°.kÐö±ìM¼4Iß;ª–eȨÂçqÈ©å`Õ¦M/¥Ÿ/ÒØç/«X'Õ-ÝŒ™&󎯲Âpö­µ&ö•¨ ¹$Gæ¸f( -·Rmë· úô4WެØy -óÕ]~Ö;¿ª¥/ö(32uô Ñq�¿o}ïBă_#«QŸ5lîáýÙ¾öUFµÂKQš¥ÙÓ†ÆSe~ÝnÚÇëx�aJé/ÈSØÀxš­ªe¨*N3¶,®xßQx±_ðç}Ôys=téþ”l’>À‡Ý¦g#ze©’ÿF°µñŽõEª5úQUöë�q¬Žr&g­Æ±/i=ª3h²¶zÈ7¸4ÏÝw˜xì” X±ÅÎàî°GUÜ“¿¢É”¨�U™¬Ÿ  óSµUè'âw­ÚTž¥¸»‰ºP>ûKNI÷ó¯hC%> hC±‡5£n {6xŽ K+µ[¤2É^•×´Í—Òú“�(Ç6|>¶®»ña\cÑMñ<¢L¹ç‡âyx=í&S9•>ŽÍž³±øjTœûŒ_XqÃÌÀÏÙBÏUúâ ë�aÚÛ×øØK$òvÕwXn"Ô¹+ ãÀŸåE*Ƴ�ƒ„ã÷ó‡´Žøt\�Ù\ò¨¥…ì³á!eÜZŸÜ‹÷® CܨUc’XÇ~9mZ - 2Á£}ŠK¢8z’ kšl¤„²73_¦lY�9ùŠO[=ö9Œ×->?%ÈÈ¿ã>ª®&[îj÷×ó.#5“<–‡·gteùÚº�‘øë¿\eU‰Ljšì/¿ªžT(zV¬Iû/3Ï^$|Ÿ~º8§Ó&\�oâeFïÄ�Àsœ8;q¸‚¦ä¢‹ÑPÈS ýX¶ËMúéi¹ׄíeSßÀŠpalÚšcBÉ{Ô,se艨Ÿž�o±•…æZØzÆ8<Ã0ï\xg° -(ÌŽê˜iÀö˜æ$ŒÌÆ™ê63àìñ!Cʹ‡uæH9Ë�pTÏv�Ó ¿* :Å$/“6RÖq µRZ3ƒÈ¶Ç­â ô�yÁ¼aÉ�"/�µN’¼,í.ô*/�¤Žñ"ÿW4šo2ª²ñ¥õÖe -¿'™0ó‡¡Q{ª¤®ÏÇÎóVæÑÍ•n/ì^£›lW�^™›Ë–†(¶ÂÏ­ž ¸^ó4;ó‡Ï²(Ø�Õ­èo¬:œÞù2•òåw±|¡Hq]x%`ßÁâÝ/{5²ý%¸ª_"qÉuÓ§nÌH:û£n€&f!cèµMìïS]Ì!æeK‹ß6 ¾1—“…yËdi#¢Oº†ÒšìÝ¢pË5פì tráMs°¯§)ß”ãŽûì <ýC0ŒE¶5_Ž�r”ÚRŒŒÊWQóÏP(5¯¼\L°ÜåuEU3þ^S“÷NU£ÐY,µQÐZU|Ý,=ñ³_?6ÛÁÇ�z‹ WFXR®­àøJ[þM^{êúµ~|zÏ»_¿®½­·s–2Œ†eÍå0_gÒˆnÏ™ƺ`jÝèBq>Œ` 7ÙíâÜÅ'8K�GÑñLxÂeÌô�[Hÿå9º ²6¹¯›à$L8/Q�&׳rѪøb$sãJÕu/½AÕ:`P&bTíƒÄkÁÍ9i‘K¼±³Ü~C¾úVwÛ¡ îäÜûæ•ôœÍÊ=”Ý"c{.)­Ú2¥‘GˆS=wÉ$ž½WÙ¶#fèÕOOfZ^Š(¡rGÝkò¥qd$ÂiÁúYÎTµïÝ„h&YÊ!‚†@•OhC‘}×Fßætz^O ák|ìé·Ñv!wÞ¥}ˆg•O¸—ùuTi¦ã[ô˜¯k&&æl'@à­s8‹Ã›‰t+˜îN¾’ó$ÿ¹×3 7�ï¢Ðæ�Óå/?a—¦ Z³½�™ȯý˜}DUoþ·ŒPr«ô铯‘}?¡¥rêÉÒÒ¨l ½ ËÍ)$²AE°mØc¼ O£È²�MÁ2l 6)믞Œ”±¬"úG,Ï^°oÄ4°{Ã�“"Cõ`ŒG²•ý°[Ÿ ¹øÚ¬-¥v -m‹Ïz`åþcæF¾›W?Øæt8Fd³°Q»º¼@¡�#ôEruÈ he_HÙÕý£³†¥(aa¨ �s G‚_=am#;ì¡�½ß¥êø´´Ãþ’${<\( `ÎÏÝ¿€™Ó•ç~ˆ|OÐWÉ>u<§â ‡~™–`izå‚xLÆç¦nØÏT¯BßÅG¢¼4ßÀdiÌš@µ‰ž¿:ì×z_{«"tŠe}]Ò“ïVÂÎ�-Æ� ©È �äáíõ¢·É zÉ28pÔµìFü*ãðÍΣEþGÏ/S�ÄÙÊ£ú¼*Ñ‚pñ¹ýŸ%.Ÿô‘²c- ^ÚsI=£]ÎUº=IÔañ3àºÍ ›©}Ž,®âuH._�›Ÿá˜Ôq­þ_CrrÿÜ×´¿Ê&àÓa™Í™föÕ¾ŸXÌ¡Áž{•”Tjè>t%Hw†b -@ç­L&¾úŽ 1b”ŠJgK.£”œÔK­pÆU¨jRHM–œžTönúŽÏJÚó“+}¡KM2˜Y€Ð¨D�Ž­Èò-õýòkŽ_¸à°"“.S… Ô>ÙzŠò®TRñ·Õ�SÙÊ.ØöDí&ÒGOgB ŒG–™Ã9`�­›ˆÑ㛫Ǧ'[|$”d@ðnyê‚(ÑγÔÂ�ÇøWž¼m��½;nõê%Ê~LKM_nÉ_¤ pîïq"¬»bíÿ~ãg2PÁP�wƒéà'�Ò‚é^9VzMÎr. w´\3Ħ¢ÿÜ…—|JÞ¹ò‰¬¦8)lca™mcÕ1ÑdÕ{“âØù Ÿ�xmîKI6WbíËJ±bÜ Ù~´ãpºã¨-žÌ+Í;mÑ -iKšo¬ŸJb½1|ùÁÉè@°}vP‡–¿žë¸Ý,÷}üó3É<) Ÿ<Å+pÞ0Y„óbB@——(pH種èîjk· øõ�TÎ,bÒ#¡@L]QÈS.3oïÒMâÂå5ëÞ+z±FÌ™}ùI¥v«`øM˜7Éó`†7öß¾W” -Û²A5Z>:Áo¡àE±Í­/o}½ëFLOºî&~™œzïšó9)‡‚´©60†ò¸›®ƒH$œ#æH†¥I3(‡gOPŸÊ(Äå¸5C¾.Ë–éødøO}Ÿîx^ÿNEòûÄ -W¯¨“šõ±¥rÞ¼å^_þDo°Öž}— ,q8$<®´Šjf•‹Xm`ð‡®±�êÝgr‰ŸÄ ];á?.öÔZ¡ðwl'–o£iqMůƒ<ÔQ…ߺݿ'YEIÜv­#’4«×| Õ�¼]°'ò^S™ú­�•0b;;ßqp¦P3ؘᖠó/Ó®å&† Ô=¯{å툜4ñð7°!\H^.³âÉ»^ûN¨Åþ#ÞÞ˜„²¾°BF3õ•-‰ØÌ9úg©kº.± ð´>ì^J�í=å˜ZÁ;¢¹¨–!Û,N–\H-¬ ³±Ž$¨©�_ÃiÉVÆÔæÍóÔÓ¡•�ÕO`Oíì&Aõ“ý³~ºýSôñß!ߥRª‡PkŽƒ``ì¦�)<ïKÖƒz\³S>ɨYÖÑ»ÇàÅ©Q?uýÀ!c”Ü”>p8‘ñZ�{ó ‹/Ú›á|ÜÄœ}ÅAËÃÕÆþ§tâ÷ŠËÛkI;�¼a¯~.v1ßgnÚhE`züvzÕ»<Ïž»ŠX`!üà¼Êî¦lxöAƒRlØÝh¬÷šF~ëî&ºÅ¾Ç6 -ÿÎúë�B·‘0šìÏ�å»gñüˆ;þëÏbrâè™ ä•­?ùzè&\j¥º±®XIb4ˆ³{…õÑ\E×~î{¢cV~«(Y[3­/¢%C{\á"~B �@”¶Âß)ªY∰˜p,TëY°þÌ©„—ÂûvDq>huïÚ‚ïè\ÞS˜…�ìH›M‡ÓyQÝoÛ¾Ù�Î/ÜP�Ñ(Àïþæj[ÇØìsyä'Áo@í³yò4]nì’ö¨�°²”(†] FuÒ<„¹¢вc‰^"j\ R–XÇ"7Æ$½0ʰÑî‹,ÝT‘ ÓdÚu2*_"Íž_K-–ÙêT®¯ ó`µyäžj`Œ[n~£X襾z~XK`8p�`Ý©ÆUÔÏ`'«ÂÊ,á+2¸~y5ÜÔ«…ÖÉ-ŽŠù¢ðF¾NtM5Þd�òñâŒÄŒqÐSl³K¥léõåcVnƒ «�…öÚUò^.#¼©­ucrœÂú4 änºÜ<…N¡¼<5ºÄË*ÅVƒ”BâóíÙ¡wì îØ>1j$µ±@eÕñM–IŠ„§¨¯qe™Š8ûév#(µ~Û)tOë üð?KV景£•ò{œÏ cL¾t vœ�-øæ†D›î–xµ.d±¼äÙwlë�74H]Ü‚OmÅ™‡ö -á Û—•¿ÍXKµ è·uvü�»”d›Ëåx -ÿˆgëŒkù¡™ES÷*‚4+dððüu©³ây»†ÕúÛ�ã·;ef�]‘ª�>WhYšñ3pyšûƒáM¿ÓˆgÞßœe[Xž½ -¬Fô#Íd[Bì… /mñÇè0ñô[ôÂM/xº‘óéW$¶)Í�ž~±þl`Tse&½—œ9´÷gC�ܾ¼>”ƒ¦� µM0¹YÆ×¸“‚²™·Ã;N�8èMIJså( (tfL†EhK ­íDÕÝLÏ©ºèê©S OƒG%ÃD: ÈN§Óöoµ•ÁS*COý^ôâ,¼™pVŒä/Uל¬Ë¨ß®îÕ¬Q¸ܬïsÄøÜ‹ ¼Õ¸3Šs6´I¿jwÌEåÑvíªË#ìYú±á9¹”Ô´ð˜°<¬»\1§]§„¥²”¹#}sHP=p�©ÓÎÏV÷Ñ'ÀGÉ hZ!ûŠÐWk eý¦$à½@ŽgpŽ4IžÕYìZï·WÔâAë;½›b8LbÞüW„›‹Ãýô†1Uñ'´×ËæÙ/j™GšÃ¹w,x%784/TÖ>@šSš–@nÆsª§([üÓ}X�nnɮխ ìŒng�™ËE>¿Ñ #¢*’Mœl×F(¾4·mÒåNG€�]ÁR¯v¦U&'HË lœQ…г¦¢ÝI=žämÝ[«ætßœˆ¶LÏ=ìÞ[ þZtP!éÁ#gýIš�Äà)ËÖ9Â#7¥#°ºÇ&_ð¶ÀLC¯‹ãÒ2¡�OIÚ´ÖÌ#>ÇTî™®9õùò,åO_³ö´Å 9‹CÙ_Y-š]÷üHä5f'ϲÎ^iá›Å,ž?@ͼÖjéc­Q¥ݥقÓÎ’–yÜ�"‹šÞð0>™-âø:O�YÒ®F$Hã ­\A‘{¤ôãéÚó/ÈVJg\¶–(âK¹äƒ…jG÷™´÷«I„|'ó‚�/S>_Ï»›™�\ÉjC†ÎáÈlø¬ÔÉS6 ,óÞ¦g”¸R²é#£m2ü<-NWŒoMr^åuº½ŒêmïPIæÉUŒQ"~G»ò}˜‘÷e‘qƒ’qä÷Ûí`SÐ×ÖYYE“íUóx…yŸ GáY¦ø—¼\k¿†È‰ã®øÞ¬o×EinYÙ,©Ÿ!ñyóeXÑ×r/koM0GaتIEƒ2X»”¿ -AMî,p}jo- -?JÕ5¸N—gÑéiÞ­c%ÈzcA=¡=rO»+n‡Ú‹«m÷©ÔÈkŒlX•ßešº’ F=Áù`¯–¦¹E}Ž™{Ò[Þ“¬©×<¿—ã‰;$ãO´ê®E±]GMkþ¦]Ý~…‰ý1P¹u¿îN§u�)±¥Ú­}ˆòui³Ýº˜[ቶû¡æ°Ö+ًƯ(Æo›î³×EÍ^�³ ->-$0âU(§É¨.ÅKÑQŸôaÔ¬_G†Hù³¨%˜0JÔ¸jËÍ+âEµ…›‹*IÆð|4îË¢^X2J¶tc÷ÕÉÅ8Ã_­‡‡ò¬ï3‰9sü?\{<)ædú|cLѵ$©²$’´ñHÚˆ¿M…M £“˜m¡ %ïÝ =osè»þ¤¼g/âbüé¨n~RM³š3Ø—�¸úñtƒ¢ëX,K�’YÎ6œÓu×é—‹÷•çÅõ¼HSÆbVꑤòBŒ!µ6ræÇdùöå¦ÜX–64cå Õe ó'iüýôd-†ó× éþj…̬Øé¶-žuï§Öüœ2™ûÞ“€›­ñ3®Ó°MÛ4Çß³+XiI6´Â:ÒC ¬’Ïïàž9­Âc/`@L­†ÉJý¸ØLï#66›¾ÙÁßtg@vœõ|C·gßWkžGò~.=jèá ªÇ5/À¸5#´4a#b‡Ž¹u¾3Ã9†™„àcá‚{Jn-v,~Y’y^/^[…atðCŸùÓcŸ;fD¼{Úd(ùšm�öÀ±{Ù¼ó€›ãÖ”zb¬“1õŽ˜3‚¾SAöÖé£ç2>ŽVÁg«3ê‘(¥ ꥼþ‰à ³â÷xñ,º“eô®¾¶kߘj÷`Æf¤�Q>Pa7œ×ÑÿæÜâ5á³Sü¶e™Ãl)6âöÒڌȦwòb\¼‰h¥ÃNÇi‘  ØÊWËv²«êÁΈFÔJˆÑH†Õ²Ñ O»Âq¡¦óÀJž5¦šl.4® nOLÕ!×äÔ'½XŒqlã?Lj‘/Ab×�˜f"I©B²§¬¾[.ŠO}hšQ':·,ŒeÅæ¢qÛÜ¥ˆ¦}~3�dÔ Æ³9î÷–» "{,ìiør•þvõÒ¡ƒB0=nèÜ%Î*&•y¡ ¨Xv´Â6¼˜9|q…’’ô4D¥ÇE„÷8¡Äïp¨ÕƪD¹§¶xJ(8p0úì=»½üøVú ì'Öævoöž« éÖk8c\9¥©.Ì ëµüºí£s³âéy†«ˆw}€ÓR¶ŠqY2¹úM¦dm8�·Iä›2‰uæèÀìVË Ò)!Á~T�΀í+ïJHìIlÎÉF¾ià>~[ðÙWæ¾�©«ÙD‘Thɶû¦z¯‹/bC¦#ð|Ôæ—ê6¥¦Å—O+»³¹~º*ãêh:AŽÜöƒ©,¿~|~}ÅÎ;+Ãøu.pÿd‰"²`‡IßVòm{6媂zî¥Ò�ÁN,Ê÷à �®á#‚�{7�¡šåñWt5‰¯Ä;Þ܉lö2ËnmxÂ!òÖMF¦NŸÂÏ£å³EÈ… Í$ná9…fŠàyca#1Ç›‰uî› úVt�]¦ -”ÕólÜ�ó‚©ýÂ9Ù¬+fÉÐu#úQc†¤O•Ó·vdÌvÁÉ.’ÔÛ< CK‹R3�ðã•Ó�Ñ ¥Ö;wÐ"ÆËÞ�ÏVV|™ Î#�[¹?÷û‚×ðö|Ö«¬,d:ÁyÏRÄ‹–² šqÅJîÎÜÆöÅ]oÅ–êÈ®¼¹PëÞ)=yáWÝÚ'_Ûl·EaÓdžر©Jø¥ŽŸœ'VÝÒI‹Æíx+Èa{ç)ܲ°ãt—7±~<À•I6½˜_˜s½ïMöØiè]» :2 ÂL*ƒQ8L;ÝÈõEKÃïÆ/�q´ ž©l³¾w@¦H" ,çxÝéoÅ\�;_Ù(ìñ@�:Ú ·©žÇ0ݵlÍßúÞïäÇOÞC}C¤–…Á›ììÉ¡û.•VU¿Îù�ÄhöÓu[ïÐÐ&�ɾ -Ÿ”¼ðkFx�®’‡2¾&?ë6}™ë¶ÜWöC‹Yl.ÞÞ×íNUÍây‰ûe³‘€ì}:ÃY`5üÙ;-ýgWc ƒ/µ.Ñ[ÚOxÕ÷·Àø‰ß}£1ú6«íeyUGŽ]س©L¯±êßãôk]wkP^‰(ز•Pùr8.xôü³¿húg‰¯£Â 8ÀÊ4˜S~ -ù¡(4üê  R…1E©At;|ÝSò;…Lðy±[²þ¢íµ•û´¢0ÍÆ¥ûz?6ÞÿU‘�,¶Ç–·ÌÍ,^ê7¼ž2R8?5«Wìˆìm¼°Ð(½Fú†Qе4Ô»Jsæ1 3júÓù”àSZ�ÚLú²©½ùäûdJ]<”øU­7¢›f\ÏûÈ¡Bt÷ùÉ!G6Ý~Lýì#¡Ù5F�%Aýºrâ+ÂÖKšCÊ©;ø™$~�¢°ª¬V;ÙFÙ|¾4RÖ„mˆöFŒž®Žµ:ûˆا–v:dä@t÷ﯪ7¬ŽÕ˜ &zðÀ˜ì{øj>¦ï`²P^«Ù²¢ÜŒ¥¾éþÇC½LÙ˜Ýð•C;bêÇUjï-â<€{Yº¶¹óï$µ,>ôyÃׄIYêÇtÖ=„ÒTBž¿-U�e ª”Êmy¢�â4 hùìD1¼e-}üã³~ÜÊð¨�¦ÁêìG-zÒš «6ìÔáÜ,Ì^`²½�âò5ƒÖ·—qAï;ŽÍÔ›Z�Ði玡K�Õ…»äº&j΀Íàj÷Á m®ß”¢8W¯™TD{ÅŒS“–µEBæU¨˜ w¯«tÖ­ µ¾ 47Å�‘MÃw ëèæcES›+Ôñ ‹*µ4„´˜¸dÐU'Î?•âç à8–] Ð-ŒAš¥nÙùF‡xú ,¿ª[®Gíì¥O)£ßUqéáZ/p«™'˜‹°VC~ÌÅçºgË5š»Šäóÿ¸ÿŸàÿ �Gœ�pGÜÿ{ñ«endstream -endobj -1229 0 obj << -/Type /Font -/Subtype /Type1 -/Encoding 5648 0 R -/FirstChar 2 -/LastChar 122 -/Widths 5649 0 R -/BaseFont /NUDUEK+NimbusRomNo9L-MediItal -/FontDescriptor 1227 0 R ->> endobj -1227 0 obj << -/Ascent 688 -/CapHeight 688 -/Descent -209 -/FontName /NUDUEK+NimbusRomNo9L-MediItal -/ItalicAngle -15.3 -/StemV 120 -/XHeight 462 -/FontBBox [-200 -324 996 964] -/Flags 4 -/CharSet (/fi/zero/one/two/three/six/underscore/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/r/s/t/u/v/z) -/FontFile 1228 0 R ->> endobj -5649 0 obj -[556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 500 500 500 0 0 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 0 500 500 444 500 444 333 500 556 278 278 500 278 778 556 500 500 0 389 389 278 556 444 0 0 0 389 ] -endobj -1171 0 obj << -/Length1 1647 -/Length2 16082 -/Length3 532 -/Length 16971 -/Filter /FlateDecode ->> -stream -xÚ¬¶cx%\³-ÛvVlÛÛ¶mÛvǶm§c³cÛN:öí÷ûÎÞû<ûÞóçÜýc­gÍU£ªæ¨YÏ"#RP¦4±72³·s¡c¢gäÈYÚ¹:+ÙÛÊÙsÉÐ)™š»JºÚþbl0ddÂN¦†.–öv"†.¦ÜuS€ˆ©1€™ÀÄÅÅC¶wðt²4·pPª*©SÑÐÐþ—們ç #�-Ííä¸™ÚØ;ØšÚ¹ü¥ø¿T65¸X˜Ì,mLÂò -š’râJq9U€¸©�©Óß&\�l,�2–ƦvΦT3{'€Í¿c{;ËZs¦ÿË%è 08;˜[þ 3õ06uø¢8˜:ÙZ:;ÿý °t˜;Ú¹ü½{€¥�±�«É?üµ›Ùÿ« 'û¿¶±¿d -öÎ.ÎÆN–.€¿YDÄþ]§‹…¡Ë?¹�-ÿÂ{³¿ž&öÆ®ÿ´ô/ì/Í_ÔÅÐÒÎàbêáòO.#S€‰¥³ƒ�¡çßÜÉœ,ÿU†«³¥�ùU@ p257t2±1uvþKó—ûŸÛù¯>ÿ[÷†6žÿжÿ—×Ö`éâljcFÃÄü7§±ËßÜæ–v0 ÿÌ‹¤�™=€‰ñßvW‡ÿÀÜL�þuA”ÿÌ Õß" Mìíl<&¦f0 rö.S(ÿïT¦ÿŸù@âÿ�ÿGäýÿ'î×è{Äÿßó§sµ±‘3´ý;ÿÞ3€¿‹ÆÐðw×dÿ,C'À? ÇÒøÿjhkiãù -þïÞê¦ÿ®úqþwøß)íÌÿ*DÇÄFÏöo³¥³˜¥‡©‰‚¥‹±ÀÌÐæïåýË®jgbêdcigúWäÝïß FÆÿ†©XX[Ûý£Û¿!S;“ÿÞÃ_ÝþÕƒ¸Œ¤ ¢8ÍÿaÛþËYáïT¸¨x:˜þW&uY{“ÿ<üC%$dïð¦cbçÐ1s0þ}ŒŸ#3«ïÿGÚ1ý×YÖÐÅÉÒ ÍHÏÈÈøûýŸÿ:éþ7Q;c{“æHÙÅÐÎäïèý§áØØÕÉé¯âÿÚ;ÿ�ó¿�©©‡©1ÌÚ²½1OˆUzV†K=fÞÈ”ˆö@èH¨CY“Jqa@­}¯zÄ.W•ÁG](}ó ÷W‡çÒ¹Ãç¡õÑX† Eoªéuž/ U!òyÍQƒ^|Æ…zŒ÷̘͢;£ÚÑÞ”¢’^éþL‹ÔÍ3U‰[aé“‚ŸqZcA(Îû -†vì+Ê40?!,«§y¸�E­Œ äMÔÜ�C‚¨Œ—TN®Åû2Ó�¿ÇEZcþ£sÍÚJ_o²œ)•³ìKÙ�Š„v‡Î B.s¤°3ï/6š~mˆ1íw©Ô ¡„Qj„Ú�w`D\Òß(úíý¶jø/]^e[_)’ump‘BBhyÛ‚™h”‰ˆ ®òó¬3MÙÔ`}ÖU^‡ñÛÃàší¬n!\x®Ðát*JC>°úÄtgù×uר+©ßZ·µW¸C¡µ{Q—º89XŽ[Åú7µAÑLXéÞ²¹¬:£‚yÇzÊÍà«Äòw»¿(±ç ž ÓQ4Oó�~®@­ˆqjT*ºfå«\cB�ñ.Ïœ ¾Çõ:�0LJö¾y$·‰ÿ¤´&Ìã?1rÍßífšÚ8•»•LüìMÑcK>/2u´†e£7 MþUâ…vóÚAd(‘ãÓ8ð“A¢æ;!ÊR:–FóZÀg믬Nõµ‡ ä¯�y8A,ÉîÈ1¡ÑJ=ùl¡‹H?Ù«X?T£Ýç�d2MzzÑö~ ÖSñ\ ÷\-Ò® zÒ}½ü‰â2èâ¬å\?sö‚_NáTÚBRæ|õ½ÓßX$÷刄~ñ>e�ˆdR7]ù÷"+ç=ŽXÏ8£Bê?$7Ë´°ùF -S½G�÷ò÷™ó¿Õ›Wpݘ›¨“Ì —/®ÈÆ÷={C-’КC¢¸‘ÍÚ�9¶ -²‘ôhÂ<†áN,³ú,Ë{⃜(nš<-Øì“"Œœ£[ªÖëÔ‰÷if9i^GÍ#e@p%�M›È({™¡×áŸQoÄß{dyŠ*Vq¸ËI¥(h1&n¬M¦GaC{+÷z†.¿šbTT²|ió”º9˜œËé‹åJ<ÖP†BZ}¡ì¡ù „ê$ôÑ4fŸRDô9\<îG“¹\틇”›~{ QÒËî˜/¡5It*âÇÏ[*…]´›ÔW�qÚ�( s¥œ9-œuM8! kœì%¥aÜ*Žß¦@¯p}ë»ÿ ˜‡ ¬2÷£ÅTØ¥›�‚~YGx½Áœ—»^ÝÏø®Jh$ø±è§M=¶…À›8³Ë@¸Xé@1¤DÏV·]OhÅM�#i‰+üN(™p ÐôrȼœÉXqFúh¸=YY®³ŠãHç—ÐÞö!”‘L®bC&OÕo€×}h¨*þÒ竬MTõn÷ :·Î¬»Ÿ½—;¤Å*TA Ec) -ªƒmù|hŒsÃŽMýH÷Éß°F’+P#;=E@%óôëÙ«š‘;©ý)h:§ñÝÅJÎH{¸P7�a|zBÛ³˜å™Œd{Ú)gíh‰±q£ôëK…³‚^á \éZ îZâÃ-¦V(¦h´¯­ß¤ºYËeµlaŽo€ùÛÛþ³ ßÚiÔÓ¼üÍÅRÏ¥øB+†8Ã!·N¦¶mL;c%Ö9çá�h¦³m„øÕ¥h+ f›©fÁa‰Sšu9fPª”T±ìJÚV»h“ºL0��zh»—Ä5„ÐÓ*úæ|öÄñ¾ˆÁÅÉ'›Z·Ó{‘¡hôc\,Ø5«ýOâZ:¼•—¿BF�@Á¬Çንâ}5é€�›¥Âÿ]랈´*7ö†w@ͺ˜3‚E‘Wm憇ÎdKžÚ�uíZ¬ãÃ2—TWÕK�Ø7Ñ ;ÎãÔµ´Ûf$?¼ð;n3ŒzAÚ‚@ž+¤Q×»¤ÃÉ6)ÝU³p”“$Ò”µÆ{‚„;�|“U^iû\Í�/�òàJ#ÙKXv-uŒ“¥`¨4Ôoê(Ý£ÀÞ®iEÅý+–¾¼“@´ܯ8«›z°Bòþ¤0fåL8…—¨õyV -m•Hô×;VÓ—9‡Ð·)/³|fÖhÑ€Ûw,NÝc,ÒãÙvðga!Â3b@6²3Yé=%ðH–½£Q¶ÆÕ2)çÌ07,]�Qç�šî�3¯¤&L_Z ‰ÐÑ,ÁÜŽã?)¢�RмÇ~˜Äí’ÍX-{©¥##Uî6¾ {]K^È�·•iųk ;CŒçz×hm\Oð¢s 6kôx%Àqš=b~,ܧ'bÓߪïrHb£îõ�O‚Áä¤o,Èrˆä¼ a&$»æ3´‘2ºoþúv5;%×ÚðF#xÛÁÛ$…¸<Ìö bƒVHL~Ï ³áÒîÑûgÕÁ Ùá\o4I)óm)Ï<[x{×0ºÅߤ\×tžÀ!B'{ݘ£ ™%ñÎÂs7&ŠqÇ`co•b+`fŽG;Yf2ïFøXAö—âQ±?¶gn!ýŒZi€æÆPj$éÎ8ÿøa©fi‰µ® Ôc¾oƒ'Z@{’VInâ!ïGŒÒ‰îû¹Þ8îöÛvM\NsМÜP/ôžßÉ/÷P¹õœKa;*F”óY­)€{Ç–Ð^lÐt}¶Î}µòO“™.yn÷9~¦/ˆDw&ÒLñ{¿UæÚe æå6´^†[Eç*zdâï_îYBW™?×kö·3/)íwqðD_‹m}^Z Ÿ’‹†é€ª- ¨«PÜ‘<£lüѰ%G­Âqq«.ôžÀ™"¾F†ç�kì ?tÙbýs�ÏÀè"�> † ¸\r»Ì�]ËŦ–±-´XQ»�É?˜ôIO†,¸{…þ³¿HIçyã[ x¨?pÞrn7l{cÙ»§j6K!'Àw˜Íшà¼>¼£Hx±“aðwÂZ‡.Áúm"¾�ß5t´‡»Ë¢Jº.þÕ^›Þ´¿Ê½}SïS¿­Yt¾+Ýç„ tjDùÈ×)YÃÆ ?ÃÈœ ÒSvA;0¸ÿá¡ñÚ½™U‚Ü¥3NÌå(×pe N{IªY-¡ÁA%RšE¶¬ˆãÑš·Ûµ/9¹ú8~±rZ}Úú—J¶w­‹®ªÖu¢¶óJŠÿAM¥À*ïÝn* -ˆõãÔ=ò0Š0Õ=F>(Ô}ž6Ü]�Ò!´b‚× Dou,¢aÅ¡¤$¦^WV&3ÑJ;×F öüOº’„g¡à„ÖÅ_k³æ®%~”À5ø%j+Ö'¸3«Ý÷'¾¾Çѧyr8º¸ œ)ޛܡ\0£<‰T0�o“ru -N£)¡}Ày¤¯´.õÓT@ÖïGë½I#¸h•ña×Mõù˜ ߪìŠì% H lþ¤?£À¬¿Ïðw[Uöø ë—V^5Ê ¨•f`ÀvŒv È‰Éñ+4Dó­hò±»Ô¶~Ù;þ‘pŒ(ë|«qË8rÞ·–œŸ¯QIÂÄ+*Îæ SîÓ ;+�œa7(Óòƒ¼Eùh - xwþE›áƵÊFŒ&^,Ù²šƒxhbÆý\ «Nù³3Ú1@*–�¬%@à�á5†ýĦ‚“ÆÂ.¥ébJêvŠZcÅÝNƒ‹ßOÞÍf5Œ¼6cþþ9©@Ú»äPª× 1&•`çüB·±ñUxé…$’/Ьpwû¸ëâJ;ñÖŠˆõiz1njô>´¨hF›lEKˆUa®góú…¼FØ2\a7b#ÛD� cÕ8QUGolß FU‰ Ò2…b0�_ǪN5vH=òÖPóCé_w{äG‚¸×�F!3úk²êUþò¥©…ŠI:!êFU@ù>õçP“ZÞcã{ÀdÏ[^0[ÅRÚò{{ËZcˆÀÍ&F�ßõÀózÆ’ÕíÆÍ‘vJ‡Í‚;ƨ×e%0«TÛLßm`¸7“ûÕõà¯éL¼´5ÄøöÔ%t ¹Âþ§4ÇæC_ÈópõA&«‡9ˆ…ƧŒM‘ŒvóÆ�äÌ7êZÆÅãÊF—zó—ÆK™×„a+pžòÏ’­´ ú8ü=l’W¦GLi£_Xtáº*{†…ýø§†ÞNsSovŸ$Q,J“ µó™ÂÂ�WQn¢@-FÆÿÑb÷ô›�µE)ÍTŸ.m=ײ �ö~'°ùª/þ¶ª¡ù�ËŽÄéÄÕXæ­ç °•í "°ÛÂŒ† -�„BJ–òóa2{eÂô7¯d�RÆ|µ6Žû-HÛ-ÌÃ<�ÕbŠp—¡{Û6ï¼ÐR3”YÃ÷©’^?¦3Ï/ ZA’ó†|¼õP¶€ã»V¾ÂÜÖÅ”XÁ½òãü^üvõ;Û]³VÓ+EH²œ¨¼§N¶YüãØ• Á¨á_Å • ~e÷1Z¨™5…ÌǤÉIoXr¼– Ñ—ô:�„4GÔ2°¨ô\t©;ëj3™ Ua–¥ D 6,ÓÉ9#‡#H^þ‘e›òû,øâÍÛáGa½”éÓ™ {*”a>ÅS|1Ióâ2ªÊ>n©ÒÓeÃWxJ›òiÑ'ê'O×òn�ýL�¦dsη^;û•÷ÔÕ`ë*ÈFæÔF†Þ:¾–+<|H¾ryÚ—dûÓU~ü4ó9vb “‹y2E©^‰ÇÔ�§”o[î½—›jtuj–®ùš~—FÕÆRœàº�‘¸â�«ÀÀË`ºÜìþ„ÀBð6Úç5�ZÒž.7ºÁÞWî/´|69ìð¾‰Åu³y±[se[*zw¬RýšKDš}†¼4¡ð;ïŒfXÝê�‰¢£%QEô¤w-f*!�]È›¶7ÎÛQJ6ae9,«—�ElA;ògÌRR·Ê&|wPݰ?-vþqžšZCLMÂ?‚•QCŒD}w³ 1"ý v ÕNR²ntM; ]X¤¯¬s>ÔÚ©T6½b›x¸Ÿ?S„´f�¶° §J?JÑäêº{ú§Q¬g£[ŸÏpY]eaÂnO†©Ýëu@aR;E[*ÿàÈcgt eϨ�Ç™gkNMØPT±Yß¿ w8,T%d½Ã’CÆœ¾ÃWª ŸïŽGIBÒå<‘ÊrM+¨ö(‘2ù ŒjŽ´Uüù ¸Ý hð%Ê4@®‹xÒ3퇀…­‘_w Û# .?¯„–~Ä&êì,N¢(­ÿ¼c‡ìPÉ>W–ªÚçðµr<™Á¨9èZJ–�õùÏG!ëçKÍ…*MÜè f QêCB¯PëT:Öœ¬Äah™ g¯­ÉÙ€f%Fnbòyqª;Ì@Éö¶™(éÌÔ8Ó@Û?A�Úozöâ½Þ� ½çaf�M„Dˆ2IJ¯$ÖïLæpÄ!¡?ັWv‚ ³~iŸ$›v‡Y$—_ý‘ƒ+öȾ¢Ÿ¾ -ôý¿†ˆ}Š4gr4eŒÕŽ¿sËDQ]ø”VÉv -Ó&E°I��îDlij©„�ÛVUåü\â�*³‰r–ú�¼o€¼ÏœªK•‹mÝÖÄãÝ' NiÒ‹…}}ŠheRcuü煞\Ð ( P†’³Vû �¢zßÍqZKÆÀÅ“�šÅÉ¥ äM?%-–§ñk£¥¹[ îçLJI»‘ƒn{`éðɺ~‹3ƒî¨-öwqÔ-ð8;ÔÕkÌQ'N#Û6l!ó!¥`c¯%ÿ1Gö�²§bæÎ&˜užO #3¯ßa Ó,oËï2Þ)kÁ™ Ôo¸Ä O©ï©¥Åôß»Zšd…ò¸mbT­•X¡ë¯; ò -_ØÚÀ‹¹sèª3«’B$x`Ú÷î˜óûª+_ß‹b^…ßuÎâªG/ºDJZ«é¥ÐT¤›H vt|hi§¸Àr›ä�V¤ë]‹Žzk­ÃÆÀþ/Îç~0܈æOqùEÅ‹ëmkÉ…YO–Í2@Ba¼ª¥*ŒÇ^·.鉔¨rnC^Ú²†r�þ^;�Æ÷*†Lk#cÜ¡Á�ÜÇ8=?OHÌÓsEÚn¥È­’–ãZ¦¢ÐJÞäs¸ƒ¡‚íkdŒ)Iº­¿OfV›@¼ÊTÀHlŽD²DkÍçç/†}ÇÝ;•Z£� ‹¢šíW0"[Š´¥Tø6O16cVºGÛãÙÛ5~?Ké��">rãb/PX®·UàˆÕhn¨gè?S«(‹*�‡yu^ ïUH ›šmIˆŽ —J =^<Î9ááð#B1y>¸\Qj;³sÿ£ïºÎß·6’uM$¿7e†M©0GYƒo>¾§˜ š÷ÀN@f>&Àbp´{çæÔØSFëŠ$Þ2Õä�¬í§×PwYHAYC¨�w–Å�ñ~gÍûü *‹VŒw„²bóA+^6B%Ý.µGØœðq™{Ä&Mçe‹N?+{+Ç#rßHÇýš67M¯ÄS †ÄŸ‘—'ÚÕZ)Î)‡þ}ÏT9(ev#`z�ÐsP=‹�ÉZ(j}'¿HiZ/Ï~ò7ëp½»s�¸]Ä¡æ>î�T4Î0SQÏãÓ! 6±ÎÁFé�PÄ8,ë˜'¨Šdƒ&~':Öïë�æíC¢míFïxí ž!ômäÑ…øñsß�gKh¼úxþFt40#õwô -áÑ&Â~� ¶…ÆB>D„#³±'V•y•Îk ,¨º*�¡ì›ïÈŽ(¾×%A„×m7ŒâAuÌiXœâI.âzL5‰f�áUUã³€z·¿ Ðñ„Ïó¹·W´Ê®5°‰Ñà¬Þlj•‘móãÞM¶E¨Ýš÷½ƒ\0˜Û‰ÈK\½ò>§cµ‰©ëù¡5• ¶¬‰TQLo“uc5ÏÓ…õuü¡ì-¹|–}­;v€-ÓÀ6?1ôæþHÍ qêu¼ËO†ÆŒ3˜füjºš»Œ«~p�rSðÝMôH0;~’Ú)×¢èaªØ¦›!Ì>©H±>H…E¬}.ü¸ª| ûÝg ®”�& zúKCÍ4Oì[´o(³¢úÕË#€Œ–WB¿gÒk-(ü¬ Ïô”9·»Iä¼x$·2Ó¤–¸ÿç*xâÄJsáÿ®ˆ¢¥¾[¯?báÚU(“ñЩܼGI8³ñð{EŒVÅœ^k±f¡É³oPe™P®€M3ì -¦,,ƒêæË�Ý �Tí˜Ê<þ;‰£Ìþ]FJå$Nf�x}·“½[m~õxåâ®–%oÌìH^¹î“›â÷Úð&ÁŒqÜ}ûîKå&H íèø•x—7£fK½{Úqóc/O%äa|8v!F,é"'øt¼–2˜¢µAAïùÈ<&NÃô�Æ&{;v!×™'@7 -ú.iÙvèÞ{±üX�[»o˜sŒTÊ¡w9ή*«-ãÝžõ˜ l‡+ªÓ]†öâ·Ãzön™pŽÒ/›�7¢Êæ|Æ ¤á˜8¶ à7˜µu›ºaãæ_ b@hvŠ/¬ŸœÃVÙdGÏ+]ÓÍÑZÈ0¹¯îk'½J¿¥År+Õ†È\/‡xx1³�6]µ€o~ä -UyOjæë‰HeÕŒwsÓÖç¬iýb-Å eÊþzq_Ž–¡Y•úÛ C+f]9)ß¶âVŒabqtfEgéÌ|@Âg–”>-î(RòÂýZ°×e{ È=qÛ qÑbZ®B៪,m±îXX,Ntå÷$“/«á‚Ï �6iìE1§�%óÂÌs‘ü¯0ã®s‡LØw&9ÜiLÍVCNÍzx¾^óØ´< Ï$¶’$dáԞ–ÅËæ‹ZE �"zôUé -Fù¶Æ_Ü•� ÷�£½WE{º%íkζ*´EÓIùqă§ä;ŒÞso»  ÛJB(8Þ +&©Cqˆ”K%RŒ«;��ÒÅ«Lª({‰ �?•Á}¥îÖœ}<¼Öu-:‘ÇvºA[ö9§ÌEw‘M(ù~HXÍ)IÒ&Û 3"ÉüÐð–½C¨ï[×'xÀ ôؼÜç¼³M"@rñ �z–í_ÝêÊ?Ád·Ý¿2êx e -;¶„9}óU‘F‡Ë)ŠYu"ý¦t#ƒA¼áoMaá{v`Z®ŸÚŒbîþêÝÀX¹7ÜDö?ËoP*¹ßtg‰_âW�¾Ÿ©ËEݬ› DûúyHXWôЏ%½7…�·í�¨Áí&é‰tvqé_9©>õÆ 1 .¬¨ @ȳªè¶–š”a?ayF>€v–_yRÜÌËÏM#¿vs¹ëÆCI/$@¯†õžŒ*Îxû}ã‹`X†•]d}ÉBzž~ž)Ç'ƒlýG¸›¤FjгTQõØ0 øÔS4J'b=P<@Za:Å÷h 63£Ùóö“õKbÿÛÑ|ì’PÇëu|÷ÅÚ”‘Z«8š8æ)n”Ûâ"9“CW¾ḵçFXî,|{ëÖI¦s°/äžcþVøC5ø}û›•Òø¡ÙºÓó -Ú…wž6¥øèÙ˜BŒ2•uï„âë²L:f‹¯[ˆH—w¸ïI,i»ÑÙŽCw~ÅÙÎe -µ…¸ãKE¶XÊhÀwg鬯ޒOpê$ÒJ'xïΙöO²«ð=½K5¼Ó|ßS�4T8«9|¾°‚%XŽÕ÷1�"«]ßÜxÒJ™¹�÷Î>+İîÂ[œõjN[†² ðó)jÒ:š†ðô›Ë°kg!ÆÌÁðÕçD[Cæ`œ„óS¶~ê|>϶hlé%ŠºØò3[V—Š¥‰Æ!ÐE’¦T.�=[숡‡Pÿ†öÛDƒ£9íSßÜ�BOapßΠ½�YÆh0ŸEngψÚQÌ«›±^qæV§2½gùr¨q*YÕ@Ãmû|{°ë…¸4}òÁú&¾Z7®ÖÆQ }SP ØÍW@Eï~zÉydjn篶Ší,Vg‡=kÔ6Í)£;Ä«]µ™}Óà°Ô—Jå'nF½£­dT-ÔbY± ¬˜“ ‰|A½ìµ± ²ãäˆn(/„îTuhgbȃ�èb`r2?ðFxIù †F¼<´|ê´¸…46˜Eo[g8qÉ›9eNå ¢^ÙÚ±'Õ¬ Ð´‚÷IB1W|€·q�,λçm�é3©&…¼I•žRÍ÷Ó;Û$±™Ÿ‹ý„¦ða¯¾ú+vk�U=uz^ñÌ\°�ÃÏ$…+¬C=ÛT?Ü­5|¿Êê‹JSs|Æi¿¼m¡}¬êßóîcúØB“M—ºñL[DžŽ¢#1É&¦Èð.@¶¯DK.äïí¶{ñ6ÍÞûxA#oJ‡ŸéU+êjÆ`Aj悘k%œ�}ƒ*3}¸áãÅ!ë«`"øÎ&Òn°×íϰN`¥ËÌõa§P%m·²ç0 ³L§¨—üH�Úz–¹$•A�,DC±YqB±­òî Ø3�~ìÈ�Î/Õ†©¢}›º¸bФRá&³8ÔøÀ{ßâ®´Î/;>�J±³1¼©+‡Ãî(<LbGÞü>üê�f¼—ME!7¦À”óY,[¾}¡ê8Ò𥕨Œ„ ö…½Íõ¶àF² Ì Wž©2"¹·u À ~ÄŠƒ®Økï#yÞ K_MóDyŸ¯–™MuƒàèEB×Þƒ;BZ¤ˆ>GžúÅ‚üT1h8­ˆÕ²ÕtÝ;kóI¢ÊJŸÒè7Q[0€!Â9|I»UTm‡²,Òñžžê‚ŒcÀ´hHêz£$ŠLp†[Û³…þnš¢Ÿp ¹j=ÕÜ „©´ëɧoºº$ŸFÌ�£­LóúŠç×ãt^XqÎ,J… [˜¸:þŸ¥�pVs’ßó¶šžýÔ‡Ö'_gnÝ\$¥á $¢˜µ�Y�tz§×Áí´Xn»Ü]‚׬œ°˜˜¸w‚ƒ@#2,s@N|‚E'OTè¯îc%MMý3Žw8 …í|á„ -ÒòS- µÀJ -ÕªÂ*­ï¤“*—#ÒÅÝið×^Jø³'&ŸÛ}Gåž¹¦R±ñ3¡÷›„–‚�-8™@}†áN!ÈÌ0.�â"©¾bï…by¿BŒhñ9y¾ª‘À±; f�Å&0=•½)>!Õž›yûõ�W,!VsýFbá} pK>ãÙ&‘{;^2k­ï^ÇHe÷�$¸î·Q %‘ iµCø{÷ÙÁ˜°ÍéKœñ… ?òk©<þÈ îŸö>”^Ð2ëÔ-�4ïó­7Èd[Ÿ•‰äI¢mi¥cóÄH�´ˆ‚ �õD~Ý/OÔµ¬—Ø Ñ²¾ã -}Lkèr<òbd”à½QE[3¿Ö¿Õ`øXY>ä¶+W™OQ3n»ê«�3—½aÄpX„ÃLÎ^ž§– 7½º91c ->ùl–ß(ïwôë4!ñ„zQÂg¡êØÍMòç®ðòMLJg µÒJVâ}bD"óT¼mJ½…æQ_%Ü�˜—„Ê=5ó”,¢»ù<4ej²ÒCåC'üm-2z÷$ˆ`Þ  ñ\FB;�6=èkÛýJè=®¸®©œ�ò"±n>É©·¦jW\Þ¢îú•]¡J@ç/àdˆn%pH^1 pHûÞÊ€ï‚s^ÚÃí%h;œ§ýAß%˜ÿG8 ÜWÀ’ù”ÛÇó­�“ï¶¼¥°¾ÉÅ>;ž´”r¯¾³ -Ç”d—W,g,t¸©¿´Š޲앵46�ì²d&¥`Â`fVB¼°©¨)wIð3™ò­4;ÒÊ>¬h E^uvxYsh“2 }­®ÿG2Y‘íT‡š½¨ô¯äú×’j~’KÇhšnÙÒ“onh+nѯÝ|Ù½¤ä,¥µddܪ®«vaòÀ^aç­+ËöÔ|¸áÕ’æ�gXIŠ–EÔB¤€Úè1©½„Áتò¼Si{ö&AE„*%mýöSäY!œ““™ C·…?`õÞȘÞ®G3]o‹~ïã$;¿è5õ¶!9#¬'³Æ;!Ëurk›2kˈ®:hæ7 ¦ðtE® 0§¥ÿôÆÐôÙÝÞx‡¾�:ú "áŸJ’#”+]ˆ6[)‚&´w:…Š�ºÔ׺0ã´)CŽÈÛ‰ºßÄKN[ú£ç€Ça�ëMÛ²Ÿ?ÓÁ_ŒCö©Xä‘x^\Å¥�•ŠÜ>ˆæãÑœ¾=ÞÛ[T†O;Ãö½O˜ùÕ¿ñý¬ìíÐ�çë²Òˆ|J‹Ô `ç¶`öC’Ä"Ù#6/8vK�=Æ(,òåìïÆžFòL“WxIA(“ní—€ fÏÌŒJy·3N'xuDÃw½Åo©7«,eßç+ƒˆ¿¤¯9Ùœ—ò_DǬ‘Ne‰êj0ÎR†:”g2„i/¹Ã&ökDÕ^KòL e¶ùÈK’<SšŸüm’Ü»@cà€–“‡é ¨ÆaÀ›¡èúm3­‘1·ºqýá\o²¾ó/'>·F1ÊŸ5¯ï)@kç·Ž¸ü9w2?Ø.~{¼o›LÊ앎+sìíåØÃá$쀔ë.ÇŸ)”ïâ®!\¼ ß[Ñð~ �—Юn<ûõÒ¯ý$A£†2Ž“=±¢ óOY¡Ž"brÿþ=�•X¯FÿÉý+}6“÷ÞZÊiÐXÔÝÒ}OÐy|æz…¤ƒ/±ú$'‘\yñM¤gÖ7mÜd�ØâŸÞç‰GQ¼Un財KÄ›Y†^÷C!Þ¹«ý¼¨ÿãÎ1mC2€{�¨ð*…G¢7´ƒ�ÆÂØñƒ™šÜ¼j .Ã?bz/{°T™‘o½\II|�0¡¯²á‰¶âØTlW­Ám9Í%æ Pw-¥7~Œ©N.›×l%~§EØÍéFóðý0Z鳟öò€�©²º¨ùÓW®NÊHÚ�”|ÏÁ1Oüs_i‚¦{»ê¢‰ü`4¤¦LM—3+Ö1^ù"ÀCuXR¤Š÷Ž`“ýzïYU±Òy‹¼U2߀�NÁp$ú©•4zây…ØÝ­—dĬ‰£\g«‡¤y_µ¶3M>9™?5÷*Ÿ{°¿|Õ„È,X÷(‡Ñ¢û3þ@•Hlá¤,vÔôKz« -óÄ÷A"¼�­pƱ¥&œ-ÈéµQÔ¸{ž‚§{ë\àÊ&8YêÍ‚�MÄt©+×GÌ Ò�£XäÁ^(vÝÚïÇx2!“¥¦¹Wzò+vúð"Dñ”nü_䕲p÷8†�o‘ÎíÒ°Çkz¦º‚Úž³?Íî�Ôþt]Ù;y¹\ŒD£§Xî¤\•® ÝÖÅppçZdCti×»‰¸«à€a4ŒÐ(¸$•H-œþŒ³œ{E´ÁÏN¶1ad/½$1}‰xôÿÒ� Ú¼õì¨L OBd`ñ]L5[�ÄId‘m�…a§tnÄt#à‘QíÇZŠÃKfÕVÏ)=naƒT÷_ gÑ!¬ÓpÇPr¶#²'¿ÈŠ\·æ“dx5î/BÅäw4¿½gÇàÎ#IûJ6'Š“=ÍOÓ‚¸Ð¿ =c{Ž õ0a°p£9z¹à}´�SÈ6<˜ Hé²0ñdX†_¹eã9Ñ@Ëï:'ßò‘x27µN¦Ý¢OÞñ�çP_ú–<6%EXIi£ËªÍ›P¡|)Ux,M¤?¦˜<3éPq‚jdç ÎOйÐÇu‘Çi ™ USõίUV¼p±«”Kà):¨Þr}):QW ¶Týr¡¬ƒÌ«R&³)0$óLó™Ö�ô½Êãì!0—Õ¦^â�ym v—è Á˜q¸Ä]øšxi2äJ°Y°è|0MÈmD3J¤p<Æ£YIÇpÉÞþZ b'T}1œw²©)/áIÁãMó �Ž—\è;ôŸŸ(-˜.!×Z -.zo•µ”ÐÒfŠˆÒ­a Ûï³°ÌóRížzK“ ™‹a�'! v‰ ä@Q²VŒœewŒ‚Öñ" ×¿&ë莂uœ"ÿȪ6ܦ_D¡$8„ØÀ#O©ÝÄew^%PÿO`QI6¾ócfS î…Š‚š¿–ççç­ö×ö©ó~v˜×õשL¥NÊ®@M=£š�A4š¶ñ·2¶ÀNF!-œ¢j«»y$<Çî…t››²M-à4¹ÂÓ­®fíy?±{ñ©”§|]¨²tÝ åtm - sBW„ÁܘEÌ$(mâ€ÌšM‚m©ÿd/ωlöü†û[Ú>žJÑ—é¹»Ûö\ ¯2mƒž‘ -`{r슟�ÍyÙ{yù„Qä7’NïÎé_ú&IÍ�úªWuÕ£©ï&£—-N×7Ú¸Å� æ°—w8KCg Ás膮ðf‹U„qw"Yø™ºBÔj <¿íä-×/D2J�?s#$Åá°xîÁ7R˜ÛÀba§ùÊxä' ±„õ3TŇÁdz¿>tüXÀôalY(™<¡tì,ÛüÒÐñ)|Œ¢€Ä‹šçgÎD -{ƒ.½c¬H÷½Àü “šâî·ç>jÝ\b´­$Q²W Iò ôlWàÛJÐÉÒíaûPß ¿C¨¨[úŠ¢†áfk샿«?õõeµì%;òúHÐÓVèã›kt¸"4!å™sÖÉß/—·Ô�Þj/sCR«­'2¥°èþ ôDÃvQ�dÅsêÝJêNxÍ6¸†?âM_¤ hžŒ88I湯a’ÚÉVOlsªP¹‘¶�¾Û…Ü ¢Þš$‚fIÒr\©5ËžFP†6ž�˜qRÓ sáùImÊGÇ×)|4µ>1Ñ�ï -É­?’pp¼¹s=˜�ÝÙ÷‹hò™à·Üã‡{(œkÆÂ.Öƒ£`dÕÇóíÊÚSØÅýV&0ç‹U›Q)½¼n—ëžÍ÷…("õœ4öËzS�lþñ‰ÈÞÔÈZزÀoôêAOô©¤ÌÄg{y¦ñ®ÜÏo %¦�Ò®«ÆaG™D2ï”ð1d2´øâBFz(üPã ô›œÄ '>ÝD¾>�ØóûöÛj>ty˜LÖ¬¨ýá#ù ª˚¯¬}¨ÌtHÂNIç“vQ›ÚªwnóŒg4D“펣tB„È ;îÄ¢´áÀõ‚ [�û“é÷9‚o¯…ÇYþR¥¤Ã©�Ã~Âà«_Ú°SdYO -k);dç¾_„A[},/$3'E+‚ºÓº�bÈtÇA32ÍIbº‹ú)¨@6¢Üé Û«{Ùk?PUNâësÏA¼2Ìp™’ 0rŸb²ü¼K;Õìë¯Í%·¼SÉUOÒâ~-lNÆðÝ”¢¸Y…Œ"’m¦] ë‚ÇŸvÖ"�]ê4UÓ¤cn0x†Ú»µµ¦3u¸ËßNµ-“’­¢*ûyžÎ�©šC£C\‹»Zéi+‹Èް-núø½Æ�ª»ysÈÐû¹oXøôêŠ}iŤ )§‰üêDªSu’¤Ob •…JNBÚˆýL[Ø™xA³_¶å�G›‘„b ë) :8¨sH>‡V˜'4I™>.ó}UáQ„BC–¢®;¹ösqpùSÕ#aÔb;GB �™Áý:mH]}ô7Ý—cÉ#5­x=TÈvÌ.Ë“·ÄC…K^b°£Lzǧ:u x¸ÝßW‚EïÒCÏ” Ç÷í(uäÕ�¤tææc耄Ü,–|\²74ù=w"”Z¼v¢ÙÚ"¤åã>jy n}/%oøFŽ;�”Õ¨Hf�~1 -!ÛU3ù®�L냾X–ƒßÆÔÜÔ`ö{!t([›æ‹ü`CÑn‹®é(yFÍ<¹;ØWé¢:V/ú0RÌ“.½sô»›%"=ÝÚ - ?p�ʼnê➇Þóuö‰m’G~7ûcƒS¡0©Np_”µ¢ƒ,M˜­Që3&Õ‰¹†DCéË$švÒó> êQ'¦XÔ\èß©K­t^«^”T®h¿©�΄\óZöU£z,¨;ß+)L=çàðCóÅÿëªÛÅÆnqÓè™XjøZþwèVäƒñˆ¢hd(_£u%L<Å%¹OƒÕMZŠhf¸¢Ä4X¾>~ì1’}x®ÌK{ íCÝFX‚Ë9ȹò×¥DMaÜM”¤Th¨ïÿ^‚‘C»Î4{Zÿo-„PÇÙÚ··Nî‘Óý*½r´»|(ìoýür´cêÓ•h m:Ê - ŽªÞ– >¢QU«PjPÇd¹Ô3•*ç?sXkÒÈÔçZE3³ä˜Ø!t–å߀œSXõ�ÕÇcŠ”ŽŸêˆfP2Ái•q³)á÷ùxùpƒ–p_GçÊÂzÙ—#\)�ñÖY;Þ¬æråØF»Ï]�¿¤jãkÉp~·ÏãûÑm+æŸý2ö¶LÑH'BÙ„”XQs„¶ »æÞÙ÷ö™º¹/³áCš |V�*lágÚŒ�Ó¼¥ã¦V�Ÿ’¥kw¹2 Š�Gü:ýS9þº†Ã_M…Þ°WßJËQÖòéD]Ü�RÛ¼–ÃÉ/~þN ­ÆÂy‡/—ªZÔ¹ØfžLó{~žÔKæ)DÆh8#Å5�ä‚0‡j^*#ÂoJu�Ђâˆn¬Ÿ"";ݺÔá"V ¬/t"$ÐV=š´ÏCü| Ÿ�ÕöJNGþ½P@FÖÚ_¡§X#ˆýY”çÑ[°é÷Çäщ_<§ì«% >1QÔ¤¢©²×•Q~KöŒõŠóô­-©�¨®— £-¹Gý`ׯàè°ËhâëKÛµ\p·ˆša4LO6ź–TåÊŸ뀭 6ŽØf´“«sµYÏßx%N;ÈGø¹Ó)¥Ýÿ¦ù¬¯ÑmK×â�2¼¨{^Ýu}Ť{e -X_–ž•`è‰�?¸Ë¼'¼äÈÍ¡i Rï¤_’ñ3êstŒg« +|*ÄOœ\ö*NÍ/ecôS±p\Q0?‘™iB˜çb&É’‰mâ>x÷ÉcÏ.ž÷30¸Rfù�NÔY‰¼%8‚X÷^ VÒ/3pÒßhžÚ®·ÿŸÉì ý{3#â)«å ÛsBû_º›í{$òþN{ñ2ŸTvɧ֊:6Âæ‰;}Ò½“ã(§éþ7øû„’Ì7^>›æõ:÷àçÒ’K~B¥úm¶ß¾Ù|ùcþã�5‹ÅO­Üû#õ©ÁíäI,tù*ZïHê¼tØ8/È´–ÿÄʦMKž¬“œû$ÍÍäÒG®–Κîl<î˜r]”oîSG¯ƒ“þ4~zÛ§%6áfœË"�¶×Ç> endobj -1170 0 obj << -/Ascent 668 -/CapHeight 668 -/Descent -193 -/FontName /GLIAQG+NimbusRomNo9L-ReguItal -/ItalicAngle -15.5 -/StemV 78 -/XHeight 441 -/FontBBox [-169 -270 1010 924] -/Flags 4 -/CharSet (/fi/fl/quotedbl/quoteright/parenleft/parenright/comma/hyphen/period/slash/zero/one/two/three/four/six/eight/question/A/B/C/D/E/F/G/H/I/K/L/M/N/O/P/Q/R/S/T/U/W/Y/underscore/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z) -/FontFile 1171 0 R ->> endobj -5650 0 obj -[500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 420 0 0 0 0 333 333 333 0 0 250 333 250 278 500 500 500 500 500 0 500 0 500 0 0 0 0 0 0 500 0 611 611 667 722 611 611 722 722 333 0 667 556 833 667 722 611 722 611 500 556 722 0 833 0 556 0 0 0 0 0 500 0 500 500 444 500 444 278 500 500 278 278 444 278 722 500 500 500 500 389 389 278 500 444 667 444 444 389 ] -endobj -704 0 obj << -/Length1 771 -/Length2 1151 -/Length3 532 -/Length 1712 -/Filter /FlateDecode ->> -stream -xÚíRkTSW‘ª¡¬òRIÕzX%2yj   b,Þ/‰¹7ä–ä^z¹�¤D|PIU–EltÉST” -«Š@} Ô«0|‘V†°©Z_sÁººJÎüš5çü9ûÛßÙû;ßÙ4�HCaáP %&G‚¥R ‡ È3›M¡Ñ‚qXN "'`!à>`µV ¸+›/ä­òøÆ2ô8’¦"€W0}’Ä" Œ# -9 -¤rBkÈ -¹È0z&©Õ`ýä�L°΄ñ,bR8! -l„Ó”šÔ$A•à¿…!mÆ»TŒg’¢€×”L: EBªÖVRXk1²LjùoÈš^?—ëxÓOQðG¿9osþ9îT:ñ Ròú©§E9fƒŒµ­×ÙìèF¯Ü/›õP1œ”2ãry{Ûšƒ;îY[3š¼þìùìnÖyûú5÷9ü*êHÑÌÚ[7_=ÉKßÔÙoqøò*¥$—ŸY³ŽùçÝâ«°jÌRsy~Òþg®¯-Ô¶;=é·Mc¹Ôî†Éÿå6]§è¤p¤/¶Ä• VË„³ú\�©0›ý=Lq-ÍÒ_gvÓƒ¦÷{$¹¥á±’èÑÇ*]µ Ôþa5T[¸¡-¡U€^,´6¬+pIoèâú—p2šöÒÖ§Ž¿¢ý¶dç̧É/^ô=c¤¶>T{^ú ýTmn9â³(Ï~hË‚ô]ÌQË ¾¿Ú��¨KÕwùÖ�4ÿ8oÙ>(*‡±n_úñÚˆÚíýcÁœ½Ç �8v9瞊šP–ãÅ Þ+bÓ³åôvÚ†+u� §âÈU©L<>ðlkŠ£Öã†,îÙO6ðü’Ò^÷Y¨Æ°{ÓÃÇ·V.Ú±�"tèP3ÄŸ—æ½Ù:Ú¦up7w$ZÐ{ÇLw~ìGƒ[ÎrÖzúÇ}³4 •Zác«Ö1¸ÎÊ([ï]d;0AƒZª4un4ÈÍz9Hžæeq7K]¿—Äš±*!*[*9­^n3ãÎ̱'¥îÖgøæƒ×Âù�» ÀÛ•‘ £•þw»'´ù®WFŠ:9³Bª”¾I”íM�¯ÌÖëºæe7w—-pªÐ3¼¶žùÄð%÷«ÓƦÍ6óðµ’Hè;[UÇöë®WÃc5œ-±÷ùѸλ÷s‹VS©Ÿ¡Æ¥õcºýõáeÖþ£;/eGXh¾ëã^&.}mS?Ôa[žt˜+tiR45÷\¬*qü8FŒ—E(Úo§lY=,­o<±Ûaç�*§¤{naˬ…;7ÿìöxY–¬òë„€óü‚¬˜s¡¼þÀ9ß{..VPJîÉ¡bqÍÁ´{âÞðœç�?|½g2ºäIìYSQá «ªïŒoE‰døJ—èVÛZ]·º¹¦¬p�tn­Ë†÷œw\^sòßÝQÒÁû¬}œºŒxù:ñÔr·oõ©Åœ�㣰Ö5Ùz¤ q\Û×äÒÈÌÏ•uߨ5¢Jiì¼^žÿ -k¤N´WïŸÃ‰Îg´Ï ìfÝÿèjüçߥÖðÇ.ˆ[“¯õ~9ºn'ÿ¥%™EO.fȉU=¼y–�O³#TSëØÿá¢ü¿ÀÿD…–㦑ã锼«Œ›endstream -endobj -705 0 obj << -/Type /Font -/Subtype /Type1 -/Encoding 5651 0 R -/FirstChar 60 -/LastChar 62 -/Widths 5652 0 R -/BaseFont /PAZEBY+CMMI10 -/FontDescriptor 703 0 R ->> endobj -703 0 obj << -/Ascent 694 -/CapHeight 683 -/Descent -194 -/FontName /PAZEBY+CMMI10 -/ItalicAngle -14.04 -/StemV 72 -/XHeight 431 -/FontBBox [-32 -250 1048 750] -/Flags 4 -/CharSet (/less/greater) -/FontFile 704 0 R ->> endobj -5652 0 obj -[778 0 778 ] -endobj -5651 0 obj << -/Type /Encoding -/Differences [ 0 /.notdef 60/less 61/.notdef 62/greater 63/.notdef] ->> endobj -635 0 obj << -/Length1 821 -/Length2 1061 -/Length3 532 -/Length 1656 -/Filter /FlateDecode ->> -stream -xÚíRkXTÕÖ<ÀqV˜ŒP# pò‚sÙÀ81&6 ¢ˆ ·ëÆ-ÏK­Më-½iêYO;|˜uÉ Âü[gž¿Ñµ«^#8~À _~p«,¤`䄎#>ã"Lm)È3\v8öÜÒ›³Šêw»Û»Ï¿5…u* Ò}¿¾øÃ@`KAåü;vüE¹½óŒæ VR;GÓCrkmÿƒšÛ×»w¯0„BR6³ƒwä æknÔö„/ojTÞ-`+ƒ4YC[¿m�uÉ¥¯�ýîa›Síúû_©Èc[3-åéþï²sŠ¢¯»®ó£Sg=l6Žw7¢gbç/ú,ϸ9,Çr`¶> Ð¡ïïÎožæ{¿ùñ„2Ã;|¤ú‹îå:›¾ljh}­þÜaÜøîÓŸJ#"ºÎŒ¨¸¾#ËZhHnv#†sÛFÞ}ïÁý‚£BŸµã�ZD&vôàþŽñÊ–êº5ÞíG"l‡Ùbä_ÐkN­G+ýusÕñ–âÔKpÃEb§=²ð’äxùZïMÍ~ÛöÛ|'Ñã¹ Ûsu¢‚�`ÎË9UÙ{wF·]²æ"¡°%b°ºàð@¶çþ Kò†í˪ªbeŸ›Úy»‘¸‹Ž}>µæ–™m2~üæÊh!ßw¤¡kÉߺÓê¯L�®W}•ÞòÔ~Å©ÂW¶Û°“ô¤•cÖ1OÛ ·z+ÀUY[ÒI-Ë1°"úÎg�Jè6…C‹ùÙºÀë5»ò•Ã=÷Òi¿Ã%÷KƹF:üÑnNîåmÏ\ù¯µ&kË™ïÛÕsOì/r^{ÒûDý’anjèÍŠ¥{ì$¡qŸ|ä�+é��Üû]tDOÈ$ªÌê]ö­¯^ͯ—8¢-G“ ëß(]mõòèù¨(Ù¬ŒÇ¹3§­Íîý1Þê´‰9ù.6�¥"P¬ïÓ_¯ó4‡® ]\ïPíÜú͘ùvZžÅi´´÷Ê�=Ö‘ÉG#LÈ ÇÆTï!'[¢hqÌsöIkKãþ”ô±ÆE±ú:o³­2‡¬Öïy$­H2ÂC?Ž þÏ…ü%ð§�« FѤ£â‘ŸÇÏ‚&endstream -endobj -636 0 obj << -/Type /Font -/Subtype /Type1 -/Encoding 5653 0 R -/FirstChar 3 -/LastChar 110 -/Widths 5654 0 R -/BaseFont /DKDCMS+CMSY10 -/FontDescriptor 634 0 R ->> endobj -634 0 obj << -/Ascent 750 -/CapHeight 683 -/Descent -194 -/FontName /DKDCMS+CMSY10 -/ItalicAngle -14.035 -/StemV 85 -/XHeight 431 -/FontBBox [-29 -960 1116 775] -/Flags 4 -/CharSet (/asteriskmath/similar/arrowright/backslash) -/FontFile 635 0 R ->> endobj -5654 0 obj -[500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 778 0 0 0 0 0 0 0 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 ] -endobj -5653 0 obj << -/Type /Encoding -/Differences [ 0 /.notdef 3/asteriskmath 4/.notdef 24/similar 25/.notdef 33/arrowright 34/.notdef 110/backslash 111/.notdef] ->> endobj -498 0 obj << -/Length1 1626 -/Length2 16798 -/Length3 532 -/Length 17712 -/Filter /FlateDecode ->> -stream -xÚ¬¶ctå}³&Ûvvl;Û¶mÛ¶m›Û¶m³ÃŽÑÉôýÿŒˆ}®jƒÏºPúæYî¯Ï•K‡?ÇRÔ'ãý6}i¦7…x¾$TEÈ;ä]4'A zåð™¿Ôc¼o—eöÀ´ØÕN¦•ôÊ>!ðg»Xœ n_¨HÜŠÐHŸüŒÓãÑ»‘š�Pê‹/‘'Ÿ¿šC7]‘Gm¢è†¤ƒ¼��w¿pÆwß~SÜ]‹_.<г+*  ø¢/>Õz~‘4¼„áº6 0$á¾�ãžê’ç’WÉÂ9yÄ¿ ø�›ˆÐ7Éj+Ú±ð¡ª÷õWc”ÆMnKÂvH» Õ)Ê››À¹S&ÏóšÕÜ©�Ñ) -`=üí4¹ûGŒóìÄܦ͔|¶ãE¨À¡3ÕýÊ#äɳü -ªþJ²>“ÙûÚß©éµO ÃÌýp°ðqƒ“!ìÚÒ‡HÚ‘ï6cámn¤áiƒ�œNM}ãÀÈšƒô[Ž’µ‘Ìì0E$ÓÆÑ×d~` ̵å -÷Nž/,È‘CÄSz­v -T¢½ W cÝý$Ä·«–ƒT�1óSý@úoæó%œ|TÊQï¨Ëø²Îy¾’¾—ëφ!^ºAk¾‰DYsfvjJIœâ”'q8 *1|¬Í¨e¥ -ÙDqþs–2½µÀ†Ø³¡Šúz›G3? -(„Ï -#¢î¦ì;©Ç³ƒ}_ísŽsŠÓ–ÀìöA‰Wã‹"@¾­`Q.ên—y½Ÿˆ±{”–{°ëhÑFQ˜@i�¹Ö ÒÎQLbȈ={¯ÐsFc¢0 Ÿìqa¸L·N\A®åqY¤#îW�r¨†ŠœOjö6\¦¦Çî†OxE%? R#)sG@AR­_^hmqË"NrxTJv êúß9IX†AFTýÚF÷›ÄÃÄ8™™,›)š#|™3ŸÉ­íÛ~ãtÖñÅ¢ -/Ç ]¡AÂâçc÷‡Qbé&M\ÎpélKl5ðºeäŸ�ª€¢¤"PrwâÅA÷1Œoì÷ƒþᆫZtæU2]Tm Ó‰Ó!Z˜ç®Ò‹f!oÙ0±ÌDϺzã}?®A¤Êí¾íUë7îkÓFׯ\Ê_ŒÍvЧ5+[ßÅ<ÿ˜~Ó»—’’ -º2Mÿ<Š«¢bŸêÜ‹<¬A©6Æ3˜3GlREP ®ë½ -éHZÖ"èeMIž€¤l Š­kËøñÀ¥ð n³½ü x›ÆR4h«Ÿhî€Èç·“KtÇŒovPYýï ‡àƒÞQÔî)7n²\\|c�«v"w±h)ËCK B�y0¿¦ÀF §ÆA„õÔC©ë°ø¬®³âmÛ¬'¿¢àè®UÂá:!ƒ;àSÎ=T±®ó8†ìãžMzaâ~¥Pd§²¹Ö`8.9#!nxâ‚ß²S’køì”ôÂöËv7ÚˆzV‰™D»Ô§U¡‰Ïx¾{…€k]ŒÜÀŠ˜ü8[r¢â+ÏÞà)ŽbË;�¸€ëÔǶ’Ï92~ O®%†÷ñÔúÅü$Èny¢@>¯Z!¯$ÑqûdDz £Y8§R™6áKÖUê &’U~¬ÂÌ]9 -‹Üå{ýõ‘œ?©máa`†³ÏíPŠÙ ß³æÂn.×ß2GÐÇYÓàHûq«ê@Æä“{VÅÔ =s„\¬ûa­Otq=žAxªèeuc¦#fudâDЬf²Œæ"ŒõEØE¸¯7?C¿‘š�Ï$.¢¿¢éíg ÖH—‡HóAxÀÓšEó‰0¥‰ˆì{ìšÜÍ]ÈœÑ$óðJþ“R+õbçÓÙyQV*ˆeTç‚nÐ,¥Ýÿj…šç·ªÍ,>?%Ù3çcó -%. ûÂu/›^ñ‡JÜK§'™�IÚSby[ÉY¦;ó'cD×ÿ¤–ÐT«>;>7±:VÔ¬ÌgrV¡µZŽW “:Þ4dOIe(N‡[rh^7šÁr‰ UcK¯&Ž”°ߟ)Ñî®béwHó³™RÑ–Q�‰Bê±eÁÒÒÖû¥nˆx'ô�· :f¡r׸DìÞ%6 -¸¾øyüÜ»é(o‘)x%ôײÇIŠ=¸™É×™mƵŒ …›G*Iní„YP²Ëñ¤ê´£ÝÕðFšþZn°Ä,a´1§ø®xœ‰‚¾(¨T¹›{w²*�“2C¥ €RÍÀލ1äè|–^AZ.1dÏvUóÜPÊ[¶4irïσhn–3È_ù5Bª� &7ßKâ\^0É fŸÒ´ã²a‰$0/CRù0­iŸMéñøá›¸¡¸?Ë6voj+¨}ÐFd|@»b¨¤--û7X Âø Âáày 'ÕŠ¨“n)¾˜C¹O#‡NôÚÀŽrDo½:ã„VÅà9Ñ–#ó  ÎþÁÈ! ]àÒ¬*®<ÄØy0¹O–·\3…БŒ^lš–z™»QÔôTÔßÎv#r$zûñ<ÞIwŒ™‹­ ÞH¢�ôÕwŸ"WðE‡@¿wÔ;Ï�½n2L™·ú¯;v�s\ò~õÕŠÛ)ÔF)€*èmþ¬0n‚<&rû]ò^øÿ›!�h—B>´½†UÉ¿ó �R.-â%D/DäÍzÍJ(üóu]¶Z}É<¾Üq¨bÚ]à× -Cjoú§Åû{¿ÓQ°cñ¢Gp©˜a›m÷u¤Ïч…%u8åù�z°‡Å fâ_%)iÍ+�Iø{¬Š[Xïè _B{غsɱ€ˆéo›e%ýÍH÷¼ãæµ–£çù {Mr‚§ËL$Ôål ê\­ÌbK ¼·<<{–õÄlQKËÕø-ë뜳u›¾A€�è³”Øoúñ¸o¨È2©!x¢ÃU“Ñÿ~„“>ÇŒF?ôÎU»Vˆ\Ü{–1ºfÀfõß«Ëeaœ´ÔÐÁǶªp¢Ä׋�9AfŸ»LùÎý9;ˆîõ¿k& î”k/�‘Öî¾#ó[Úí×y„³í¨u‘œ'_ÛÇ֤ݬÑ?œ&9¿ò¡A®gõ�P´/F2ê8ÐOò*To~ÔTÀdé•#hÏ™×®`âÍè4NÛGcù阔ôæYp~íÙ*òè� z³ô‚ˆO›ý¹æ¹.%oY…¦ˆ·BˆJi!]�$Ý:ß4»Ï…0J~rÑø+1%]Qå×RÀÇ7Š™Ø -s†`�î„°R­}ð﹂1³­G}"-æä¼\7(–ö®ù[¢ôï@•?‰’YÜŒO£ Í}Ò)±úbúßVøQºnîùŠD¤O¢!ò .°Ó m` Årôâ;¢Ã:›3ž5x.±f 4frÕ:cü›è¸°³ºÛ¬ZB{È´ö±µcÒÄž,<Ù¸—Ÿ™û´º$�%Ÿ¥Óž1�ØRôh$Y÷ÊØigÕ)ÕS²7TêÄýf97“7ÑŠ1û=Úa�ùØ×Ôú=Í…cÛhÑ}Ù¼ësoÔ=DûÐ(Úg°©‹ýMÎ[o8:§£¢å]â€à@?B=B>ÁiÛü£Îôí‡(££w¸4¥dÀÝq >²dná+f“`ñG]�fÌiðði—]ÞYï«�ÃóYñ}TÛù*ž)þs\Ò%T¥ íìS,y-Ìl9ÀÀ ¤‹¸µ‰NYv.dJ -9îëVËœ¡)Æ(÷ÌÈÇ+‚ÕêHfÌczˆ …KJ“-j1­jœ�ÌuG"Åïj É”¸6�p�œ2óÌhi^yDû¨•@Ä]ÙbräÐÌx5Z—Ý §˜ÝÞÑ+³œ>©èçel[´†“ó,™gžNfç'¼Ãª°’ª&*0_�d•˜;ºé•Ìxù±Ëߢ7t² _ïë8]E9TþGôÜ>Cÿ§;Ž”¥Ï› ¹ëÒ�t)N‰ðtæOÞç¶ Z»'޲ßjcþۢʆükЧÿ$b®ÎD˜ÁDÍ`Íœ';Wö¢ºyêFâ¬^ÕXYS‡¯ßC‡Û -ã¬êû�í! “®2¸–¥cöL€"³Õȱ\ÔugÌJ PðÙ’PŸWœ.ûsêÝ£V÷t„Sߊ­ž’¤x‰µ ¸ÁI¼ÿÊõpUo郜9¿µµ@ùQÍ .7”Z3{ ÊÝZk�„]Ž[�‘Øá�òå]mQN%¶ZñõzÜ�¶¼ÊL|`¿¡MÖ¬»Ž½Fº å9ôYÔU¦D -[)•›ý…ÊþZëôEš¦¹}Š}3 ™¿s¬ß ëä'¯¶8^­XäpYß-äê±?¦þ­†“ÌÅÖ@ïfc9¹‹hÂÔò'¦öaØý�aðt¢@'ÛwC ìÆmÙs#PÂñ*%œR°«\Ë"uŒ¹#»Ì(˜ˆ•{ºVYPá‘O¸«œ`pSªõÖ.��à(êDVmžôcéúb€<¨�/Á¼ñÛÿ0V¹[«<¾¬mAue¸ -áMÖb÷æSo-º_Š©ÁYƱlj_ÇæÏ±d“Šèíq~h­&}è;‘û-;u•M…U óÑÆè9Ì)üˆvÎë/·ä|Ø’×нüøx«R‹�ï?öôØçFB3=¤�è³²„>@w0©€Ed÷‰Ì§ãuŒ×±Ùþšh§MŽ/‚ÇRs8E�a¿¤ÝæÞ\' £Þaâ Ìa…Ë ã+�XTÐ×-‡ŠÌtåti/ÜkÂÇ,–d¬i¡räÊš£ƒY|š0N8ƒW*k·¯Š|=4>²Ý©ñn Ǧi¾__…N$¯Œ‰»÷ÓšÆn†òÄŽ€okeû,ÒÜ«BŸq-%%6�]uƒe -‡·л„>FUy®ª¥áÖÅïBs¼N´Nj¬ÃZ†ÚHÍž¼|Œ-€«÷XòßWZî±Ûòa/æAdýÇ_;â^¯%ƽýñ„æ¨`"èl­MŽQè -¦ÁIßµæLNFë�ñæí6$£+ß«^(R'?OC5®sŽ�6Fø~QùQ†ôõŽù ìNKçAOæ¾wS°x[¤<[ŽøÉå�áhùTI¹m18Ù³ÁbôR1ø†¼ÖóÚXÁçv‹’dôƒF|æáô­™ÂdÛ…&D õ›‹Ra^Úiܱ#=@¤Êœ™WgW¼{OõíÓ}¼9�u¿x¹Š;þÜ¢o¢ƒÏ,¹«zÚ¬|Íɱ�ÕO3…ÐEšÖbìʶÏ+¸Z -¹ƒ}Ùr—ÑÊk!—; ¶þlØ×C•iÁט‹²Ó– -Òþ yé¸ïAu¥}N²ËE•��¸u�f6¼¨1í¥´äƒ׿¶±áO(5€Ž`ô¢¯éÿŠÂ·‘–þš�ÐN\u^ Ò^L­…ô™€?ÿcµjÏÓß`ô9à0§Ãy^y}©,4©Ôª_å¢Jjšj£§]‚ùÍZ­Ÿ‹=„¡¸Ê®¤Ê|ÃAÉŽwAd ¹ -ìâòH¼FÅÂoùIÆÁZüó4pÔ›’ú™V®°ÜŽV! OæíÕKÒ²“áGøH»O<)„ö*–¹´–ðC’ØK÷w¾c/RðDã¿®àÞê˜6'8Ó� TÀäÖ¿ž"OªrFöáÞžQŸ¢Ù>§¥^biaßéîögŸN79Õ;üÜk5„O'à¾Xo„Ü÷ª×9ß~‹¸c\jè«ð†¤o.�ɇ'”‚néù½>Ñ4ú’ o B³Tà ì²g É“*? à·"<ÑÏÀ}Û!úh!×úŽƒõÛ�q–5¸v8ªR %äfÏENë>`=°‘\$juë è‹ -%·QÐmˆ‹Ï%Q•]b~Í•eÞWdA³ -Óéžq’�9G�@ÜLú¹©KqXw:½ÞÈIð>ŠÌ�×00<â²Ϫåt£láâBa™ ¾$xNÅJà%t²Þ!^ã�3íäé œ Ó _¾,nV=p(¦ÁãÑ%ÐTõFª»XäÇYO,”̸F‰Ý}LE|¯ÞÜOzïë„ôñÕþYÖS!P7J�"–…�”ÌýýÈç«t,t ÌOA½¦B `™+c%¢¯¥¯ÐØ{ã]¶íóéÖtYDF -šÉþ¬BÅ9üfîlSxÚiDJ-Š=84 Ÿš¯íŠC²"&Zß4+ó:§P7µÃ#ÛÞ™$ χf‘”L^þ8jÿÎk¡K^Í`…‚x6ð£¤PæÈ -Ôq÷¬©ä—À<¥:Rݸð–5LŸØ ‹¯ [n³w}#/8�^®ë í%ȨØÚÓ—ìQÑÏ·½½r©Âq§®ÝSÅ([HŸ ÒZ§ÙeÛ#Éï|çU §ìs»ˆ� ^™bˆ§¢¾ CbÔ½>ô]¨&18J«5"û‡n -Äcwš` ËŰcLOcâïn¥<¯Û ÊÙªÂñnÖÌKØü-Ò¡Kléª åDVa8§g€I‘y*»;5!Ë;ÄjÙ™k_G9F;æCò‡@n· ™ë‚–�¨ÿèÖ¤\�„¡S(Ôç5l¬U,9žGmÖY~¨Cçëïÿ$;ã4ûDÔú´šþ,Ã<©uÿÁöe•§æ×‘Žî•úâ ÆÊ=u]ÃþüCû<د–±µV9³šÌÌìQÂŒô ¯��Ëuäò#Í|Ó—A$ïòb� -èÆ64v½b±Cþrä4¡oð³¬.‰pÍ©Qôa5Ú%Bÿ8Éܱ«|9‚¾ž¯&~ ÿ]n‚O‰W§Íc²ŒCíc9ÓánzÅ„q#jÂ@ðnøZÂr‡fL¤’‡?ä'¹záìœÄ‘Q*€„XÈåwÍרHös÷�ÄŒG••ý‚Îí(<ÎâºÌIÐ5+dºçï•M™«Œ€c ¾ãu´æýì£Ò廸MTóuPX6ɶÆ$¤A™åÀÛäÙo®Œ¡€ôú$/ç§0‰å��c¥LÐþèíìÓù*ê_Lû´æ¡sj:“ËìFõ¨ÚaòÊꢥŠRIY’ØLýçT@µ -Þ†];¡Ñ{¤Ç-&ðÑ åꛫ*?ïF§€'�GyÚB¹€ÅÓ%û³Ö´(V–VJ› -˜+|�/›¤”ÚÒ-Ø CPI”Fæ_iË&T8ž®×©ú4¨0'e þ–}!À=¦Ë†6÷[p™r‡Nwt‹ÔOÃŒ‘g ÃÃÇ�îë¾îs '$dÝ„7�#>4È D¤${´jG«U£z”PÈ 4¯ü´ÿa[6Ó7/„×¶í ŠÑ•�lQ�ì/ªF®‘E >^…ßht.ƒS<’žyöc©Éf)�Êkóåúª®�^Zû„™Ï”ÞŸ�®3À�Л; ŒÝ€šÕÃ|ÛH%±„:úiƒG2à2Å@ï™’™¸äKôÙÔË�MÕ$>:ºd§ðOëu}ÿç’m1#Ö ‰û*¼|ð+#j-˜æsÜ »14›Õܤ£i#|*|«™é/¡ø‘ àP¦]~ÁPfD½÷MD¢Ê -¯H\ìÚ½‘KU¥¯=¸XpÎéÇ¡«·&xE[ Ë›‡DpžÇ¾ Ìc‰Mƒ mïë1U§son“Rƒþ&Wxþü¸©”Ï×Ö^Õ� ?7ýŽíe{Ⱥ7YlW‚ÀÊl± !Öh¸iÈáß'^ÞM¡ñTÜÃÓÛæÇ ?â•g•¡½mãŽz핳]}P7ÉÁ1{Éuíøl¯2¤AÇŸ½ãɃe&+¸´ˆ·¯,y„… ‰ÿbLë“¡YÚŽ -wM/C×®·ÔiW_[ˆóˆ¥{seO| â²€6ktáÚm:ë–YäЂާUu«ØÅ� Ù_‰ÆÒRÿ™®ï -L̃T7ÔÔ)*ŒCÜpAÕç\–å¼N¯‘ » Tºö·æ6,Œ.8·r—›46'F#˜ä5]7vûâ¢zÇþúšçpƒÇ%o{møéK(¿ÖÏÜ?mÒ¶Œå ”Zåžë‘ôŽ�äZS=¦b3;ï(þ¨ù;sÛ£–&Èn)a—B’ mÂɃ±|‚%‘3É)*;Y¬qI ÁñÄÍÐb[Ø[)Ímçˆ$òÁoî;ü�qNL9ÛA»ßP·WªC÷áO9ÉáˆäG6„á¾…¿'QV©o®Ê^|Wµ�CßÃó[?N‰+é——å§×$d %»Ö ÷lÛ¦�wö̆ñY‚رr²+¾NÜ@0C9Ë¥u¿v5˜kŒß…óÔ Áð�˜43æ;±Yãmuh ¶+šä2ý¯†©œ×E1Gqš3�*,™>#‚èñÛO« ð:ušô=?•`OE"\²Y¡Ÿ¥ï­–R&,²I=~Ißwm÷†T�¨ía±éƒ²�'£J²é’�pÅEf%Фº'ŸÉ�ôid œÏ°§'à�µ¥Ñi“ÏUÚ�u/øÖöÐe»íO ß�n\„Ô$€Ùr>.=ý?,¬f"NõÞè»~tV•'q»C¤N'”à|ý‚i{Y2áš­…ðÝÏù}ÄèÃOµ‚wÛå·âöí·øÏÇúûÐ, ñ¸hüÄwñWHJtJÚoÔ�NÀH»0äÚ†ý6ÁSÔOÞôg}’Òweˆ™ÚÃÙÄõü9r-¹ÕÒ„6š¶±ÁÞÁ;dô’~‹%Å-MùbÒ -p¶4ïz6p•¡æê•œëIƒ= ÞP¹ç¡²”¾á‘‡I·Í8YÇ„@ƒ†“xR«Šƒ±ƒÓVj äÌSmü8}MTÛøëìÛÈ¡4n, ú(MD%}Hs�MDÏ»ua?°‚öm޳±þIÙ–¡Lþó�áJP -È >Þâ*Ú—€Í­Å¯Ï&hëC*~´Bs`D¨;,§YÞ?n Ÿ->ú™ØwV?ånYÙ„«Rª©~g¥ÂÜQšÆ™ÃÈ<ÓŠªË©Ø “í7@ Àü(]]ëÄM¿Ô,6±úÝΖÐx_ÃÍ�—+¦Ø ºZ`· ¶I­®W¢‡±IO¸…eüó;£½è?+÷Gä¿Û³Ë‰çz�óõÑ„N—bq¡Å‡K;§Ï§Áï¯EaïJ8õ“ãQ1;‡wúÝKÈu þ5«Åš×áý6›Ÿ÷6ÊܧC•�©bZšçïv^ɆÙ%ºŸ^FÝ-&ÒèÕ¥æ<Œ-wê–0)Í-ÎS7½×Çå¾Ý†7%Í ‹‹¼™ïG 6÷T¥�p4-!G�Šå1þêEõІybÞq£jð½P)�a{„ª´u„ÜNʘ¾‘HÈØD’_ÝÜ@ù þ=æ[?+0ÂÁ˜ƒ¶¨BÑŠr&µþ  ¯‹«Â÷ßÙ.¼ò—"s7jQÛíãjÁØSÕš•yJ¬þFa´Â<ŠŠ.P�“pDMx§ô˜˜á Í:`$”î1ú•uÎÐBà]§G߉Há­„3b½� ‹VïGçpRZ.$öcì…Rþû«C¹Ì,1…°)�/ƒªâCÓÝS§ »X~ÿ|€×6%V'q}©e‹#îÌýÓÏ)­ºÜIrU�®‘7&?  Xò8„Ò XŸŠh�í@E˹[õtí&=QmPÇcŒY¡"¸ð\XOóÔŽú$+£*¾äŠC ¯a—hgVÉå¯y?³Ÿ5<Ó¡[Ë›1 Å9Ú®]ÌͦÄ*Ì“q€FYCõsêHeÇv4ü¼‘æ½Ú§Üõ 4Ië‹Åº ƒ�åè«Ã®þ£ªµ?UMÑÙ*‚û°ö±Ý(’ΗrKBÛô7ŒÑo:as¾¿¡@n“­Æ¨µMtH¡>ö^oT/lOQ÷Áî -B†mSp|U˜ Ô–ìÄû1�ò<h*sŽþT\âÇ�i ¹Ìôúó-ÖªKñ‘�ÐÛ!t/îÈ�¨ÆŠŽðX8ÎÎ�önPwðÞ�!tÔA Ð!6{"ýÔ…[o´·f{˜jª è÷°d9´ðuü¹C>ÝŠÏÚz3í¾ðàx%4E3›~ÜæóøÃw€ˆL­,b5£Ù¾�ìJj>�á(v<5½œÀmeJ!¥ß¿ô´ npÜ‚;5$›,ÊôhFìµ-·%Eš¢ý3‡°·Xlr„å 'Ÿbâ~46•å ï›_ÀÒ)v™†Ì7öôº42ó.Øøç+äÏ™Ä�÷ÍL×aêl)M ÀܳSÈ< -’Æ>OÊ8R#êi‚ÉbcÝÂJ]–¹Åïiòñ9×üZÊ"�ñÎ Ya‰Ëª†¯kHÛ�œÕ˜‰Mý|?"®5{ë˜jÒœ4ƒiaoùü¨êÊ,ÕçЫcÄ¿GÙ)÷h8)e� qE0*ø=ˆÂ‘(|ºÿs‹{º*<ôzc`ó2Æ(9,ã-ro Åét%ý1¿|Q…&À\€i¾¡S+w9óÀÿŒc"àw@¬ž�SQxÚÐÞï¸Rˆ83N~‰WÆ—ÒÏäG&bsñZ¡rÃ8â$g•Ô§C“ÙúÉ!›Óx¼mKP¬’sv_¯5á.…âV±¿âóOŒkøF"¼¡!*g¨ ¢g,ùû”ϹôËÖW-¤ÌáÂõOÈ£í§6!.Ô=0Ö Í\ðñ›="8­ž~ñ׆¯q…Ý}†l¬7OéCs/ßߘe ݪQMÌ“?záW cÃ!íÈ„ë'Lcžu`fÝæ¾ -†¡V¤ @ì�bJXˆÎ-M_ qô#õ�S§~!"É2ϦÔ:kcX½Z2—¹.«nÝâÉèW¢•Ô¸©£,;fØÇg#iŠP²w’?q¶ê7�=uFC±Ì -p°Rµ«r·/6¹_Ô¢ù’J]ŸR¢m¥HKÔg ƒ;�R©†Ì•t4.dêÁi£�qžV‹â±ëlyþ°ÀÊ�M‰�úW3�½Ýå–˜Ùr‘yK -ã�„pÉ€Ù�]~�ek錶Ó¬|5ƒMÚþ$ûÔ ŠGzÃFQ€ÅgšK˩ī, (@¾›[:Žvˆ5™x‰0ïóMÈóŸÞEûÅß ûwvqåXˆ…«yFäyþ0ã†Àž·jð¯xlzÊc=T)�Ü-^{òØ+3\w�LŸRŸú“Ü–ížâÖFú >£(0³sp”zŒèZªŽË'2l@W¡c[Q…=o¢nÀ•¯{p‰ 9ƒ)iê)úŽWD6=ŒæèZ&Æé2E�ÒBvG»%ìRÎgµÊ³àÉÅ0œ$ål—ŧIƒ•ü˜ÇŸ!*XM¾ F£^ MÈ�›`™ÚrTõn©ü­÷]_(oÉ…«v}¦µÊ«pB¥+*¤“pKàñÙeÁ(6Wb¨x2!Q7%ðŽIÍû›2êg™AóRõµóSw¦‰ê—«>°H)DªÂf *S䘽FþÉZRµWÚkìíYàòE>XÛCSUh]A\l%ô†½HÓ~ù†¬%×ÍLÞŸÌ�!««<ãäÅ;ìÀ¿Ôz÷ :Ä»ôq^Õ¡oEÏ?i¬`ÓKÔß)?µšçæ°˜UeMÈœ¤‰U_ÀpÍÇjjíÞ7�4¡.h6ÆÃ\T²5÷›Œ+¦è†iò„ñÓÃÑ&wœ¢a?ÒUIªVòÝñip‹“&ñZð)£tÓ[(”x ­Ä—ƒ/üqû2€_©JM|U›‰�¬æèƒ×H¡“£8ÎxÝDC=ß“üô:ªAê¦}��_IÀ"Z£ŠKµ�@ä]ß®* ;ÙZ Vu b½%켇!SaºµP—=gIIë.›GÚ0FŸìÃéîyò>¯M.´¼ö&yrìu儯^âpÊê4Ë(ÓÞ×âȈݹ ^Aº±×=]p#R\?3Ÿ„³1�½*Õ3'p§½ä#ÂöUŠ(Ä ù íïý~ †ïzç½Øäâ�ÒóçœöœÎç{{á”3«u›ŒæW—ø¾F�ÆÖ#5½™SBå’ù¤ «’¤)Õ˜üñɧי„Å‘BÉþ[Ýgt„Îu´Ô­£i"ÁκNÏeó›ð³´‰Ê¡_×| 97ÈÐwü¾1n2M΂³¡ $n3È@"Ãë‘S†õîÎãݤÂ77Óðh¯h6k±ª…"~‘;7ĺóÀΞÿÈ�4ÊÕ®·Sˆv†�¿|Ó¨ÕÄ»º4¼.V‰ ×ˆRžªXôØRZÜ®VA(­5§â–;=&ˆ£'’wj[†n†¢>Bû“ž h48"�‘nÒ¢¼ŸSšÇ– SåRâ^ç´iÿ•>�-ÕXZNŸGÅ=ëþðCãˆ!Câ­„î±áZ££€šÐÚÆÁ} ñ]2ÔóŽß+û ËÕâ¢Pâ!Ã¥pÓýTj™‡×Æ“Vsʾ5¦âì5¯@7„׉¨ùS°$oôö£ý€7ÑGƒÐÝmnűw”‡’”’b^‰Ò™ZæÎ£ß}ßVÚ‰P—mãíäSNú¥çM¾˜T=¿¯)ß;ℱÿžëçñ¤¤Å@”ŸQì ê}{BxÇÑÆÏ0í‘ ¯lR’¬fœ±‹N”BH(û ; µ’¸õq¯pS#‡ûo»ªF_è�â‡O¼¨;<Þã�ë®´÷Ù¹Ã'Š&ëdˆ`C¦)ŽhCTDyQÔ\jËmêFQûøh È2¡*H³i‰©C‹}óe›J}OT±‰»‹a@]ª€8 ŒOBh%“®]ÞRL4 µ." ^èßkuŸg-q“,IC©¾I»�®Þ—¢ïL§”Äë×Oü´ fðA}F�?”×Q°!cÀ`_¾Hx�¦p0¦2Þ®!Gbª†&½Ãü*Ct½MHÎàf]y+‰ rÿí„ñåGf�=¡ˆÕMĤªÀb6ŵ=ÕXÿ´Áˆ²­^h0óÑ09cËN`Z B£€÷õMwÁ^@Ä0•NŒP7_»ìá¼F˺öMgkd0s•+›*md±äxk•Ïý«;�Ù-€‡yMN57Ÿýد†”�yˆö*�Ìd†ƒ�H÷Ûtúh÷—}f"´ì³|PJ±�S¼#G[â;«>ÿZ“‰4]ï3A|…*KBz#˜ Uõvi4:8i,pLI¬Yu-9uPÔ>K\2MÒߪì/¡.3—,\»™‹‘ÿ ]Ûߤ´šÂÓ ”‹Ö(*Fd8N†tÎPê36äó‹F”õl`�Å$ýbd¶k‡ÓÜ„¿aèN_ÓÑx ¬xo8ˆ‘ø3éÛ´Î=ûôÉò@Gýj«9žkÞæÃ^s>áÕX8'‚Ì/½PÒ2X^$0¡ˆ7Vÿ!øšFÊ<è{9ÌÍÔu‚:CíÅŸIÚâ*AˆáÊî�þÍŠa�nÎFZÀÜ�ºEâmÊ‘•Ò°'ý¸¾Šê-zߥ“ö•bæN¶Ö]bD¸û]ƵÊ¿ïþª´Ô5¾@=ê ˯©W}aá)V%+ݦkð5ÁKS²«,êÔYó ü€�ðD¨§‘ãÞŸq-�´b&©¥‡pUf~¾*ê Ë®p À®‘6ï§u²¨:¼I¨Ù°»)¸e(+2t?¯«±C -»Š *«÷ÌlFHÿ)Ý@~˜ZɈZŸ°áæ$°~Ä™&g7S&äP³M–el“ÛðëT�ô¦B‹YF«,c¡èë­.*iyÍ¡� K{Ú@¡*yJ? ¶\5Þ@¢`<�î3µ0ӤΠ�­á5•Ì´¢´íf[Á°bí©8$šœm&û×(ÐcûqT²ŠÄoµ”a£¯|·ýYæeŸ :¾QÉÝÛÑ4ˆ‹K䵚³Í¯*b›aµ¶½’ÛÝ&©º>÷A•ηtÝÐRLnŒ\0¼tT´Æj½›?P•¹!4²ê ¼l¦ÔÚˆx5å›·� vŸÜ£CD¨ݵg�Ot>Eú¯„£å¤ÔøAá…¡-€*Ý5¼r%" -2“"b'úm0%î;�f©�Eþ³¸ƒj'dª,É‹g! oßrÐøØ˜ºi n²1»+~‹ #¥æ¬‡# BÜŽ'�ºâýa‘é“MÎòTçé‰Ìñ䇀äeöé‹ eé;t|öÁ+÷Þ Iõõ^J×k}ïo¤Ñ¬xÞ‚‡Öž�Ô(þ󢨦žÅ–Ø3R3©ßõžùâçϪE‡ª¹–�ÎÎÉ,å¥î¿@×?Uä™ç@ÇÅqÞÛSñ°t²‰Ös÷ÊýùH0½6$ Y§E! c5. oM�Ö3"³ä7%07Öþ€ûŠ9ÔB‰C©k¢WÜa{‹ÆŸR·(Ôgþt*³=?w -¦|&ó Tò7‚M%[ܧø‡p‹­Ûk{Îåͧ~¿•Õ4µÀL�”ñKSSç9iر/Y‹[¸T_È œÝ•&³vzò`»l žã3ê�®9&FGŽZ†[h’–Jð+Ô%áa'ˆsö n!¾)kžõ~Ä4®jòÔÑRœ>¶‡ä)¨‚IêaGUõƒéÓwŽk_ài– ñz¯á*”¾ -P€´@'±B1@0LQ�ÌÍ-?n°ÐÕšåeÒÓ:xXŽüØ@¦ñ¦åÀõÅßXä¯fJàïë’ö¬µ‹aþŽìR5ñì�k_’¨ï® ã© êrd[½÷É_î9•x%ì xAr|C (Dº°gÙi±5Âã¢CñyØÑÝu°# ä™uÿ° -ÒÕ LpÕt�783ɉZfö�E��žqé._r%X_VK^úiû¦B«™’¼ÍAV1ÉNY:pYf.Š‹¾ßºy�-ñPîZ–SùtÏ ‹4û‰Q¼è±'ot£C"¥Õµ¢ÝÈlݲ¸Š5þë© 9vVä”R9fñ®4Lù"¯ß¶>‹»šÃÊ�ÿcÕŸdpÖoÈ8É£Ô_Âyk‚'ƒœ€¶¡ý¦ ¶Ÿvîç¼½=⨧ÿ݇yÿD5ÿ -­Ú>—?($Þëñ•}BûÎEÞ°^ºÚ|ÆÄêŸ�þúÒi÷´‡ñ¢›LL›g¹ìަ¹û"ƒ;ÚÚ‚–Øw®]ÙéÌgÇæí)Õü!ÝÒ ˜M:ìé–ä”y¬}Üžs§Ï8vÝ â¢èÒ—γ·Üœ9×ãPÊò€²×�ZÿêW5¿™½jËj•ºùׄޗMú[ óõ«ãî™ûÖÉÚï3©.dbqã•ΔãøÁ×¶÷ÝÁþšøÞP˧3yº-7„$ ùågkÄ™¸Å=Q²Ö/ºÛóÆ}cïÆe'Âäz.5LßöqÁ–åYLÿtëSÿ̪2¹çR¤uþõ‘¨ôov}‰_[% >ï|»xÃõÓ™UKv¤Çp%^L—Î|;]Gû±î/­ä½ýlÕe -Îe[×Ê48úß8òßúîF+ac–'Ñ'#çJv›*V®_ ’~vI©³Êé[{sÃ]òêX_=›ðˤú‘œñ„-|iÛ7m\â¢pX1µ$!øž¨sÛ‡üɪÍocŽ%_~?§§JwÓ·LƒÎ©rnŽW›ñ¨H¯í~’-ÑÊ_˜/þ:…_æøu»¥Å‹Ïl(¿|gÎÅ�‹¾ß™–ëÝý~ášUµíÉ,s®¹»gÃ�Ÿ®fÞ»¹7M¾ê¡gìqéG«ø-S³Ðï'ßlÝÄaËw€?�#t}áñð«÷ -Ÿd´é[,û±žJ±÷ž=Zg;¼fçÏUìö`áu8ýó�¤¥ÆÎxΠlO/i­N¢gË‚þo�ÿôñ]Ï–‘ ú&ëï®M?¡×³9i=‹ªÎ¡~5þ¸_w×�s¯Ë¬nædh¯û¾øÚ®w> 6½n=o•}êâÓ[?¤nÙû^×Éòý­^/%ýÇçËVU0E¼^h%œ/Ä Ö ðu‰qâéGbíÓ9ÜlïrÌ_°·87nnGùêÇV÷t½s/]49_Ëk_¼SÁ· k‹¹ª™7=4íº¤×Ë-ú²ƒÓѾGa©·Ë‰s Þû&Íõ¤Å`káÅ{ò[�nÊ_º¤ò¸àÕ¥{öÔÕܹj#›a~iÍç}^·¥ GŸ¨w}¥b_dz~ûrá­JÌm>-~XécÿæûîEN�òä6È7Ùe/<÷âADVàj9Ù2¦øüE_ý ]æ·žzÅwí¹µ73Ï…;[¶9¬<ù©òé±õ}Kf/hÚvñ;¯™w¶t[…Ù’¨§Ú–ͼ(#¼cK‡|vT¤ÿéǯ~”ûýÁöTZ3~¾Hø-™ðjÃ;³/E†ñ mõ™*Sëäà>}ËÑŸ|Ç“"_ô¾†'mºä²Ók£öb“³ïK_÷5uøc@!à5`X�œ“šXT’Ÿ›X”ÍÛ•Šendstream -endobj -499 0 obj << -/Type /Font -/Subtype /Type1 -/Encoding 5648 0 R -/FirstChar 2 -/LastChar 151 -/Widths 5655 0 R -/BaseFont /SPHROT+NimbusRomNo9L-Medi -/FontDescriptor 497 0 R ->> endobj -497 0 obj << -/Ascent 690 -/CapHeight 690 -/Descent -209 -/FontName /SPHROT+NimbusRomNo9L-Medi -/ItalicAngle 0 -/StemV 140 -/XHeight 461 -/FontBBox [-168 -341 1000 960] -/Flags 4 -/CharSet (/fi/exclam/numbersign/parenleft/parenright/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/question/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/R/S/T/U/V/W/X/Y/Z/bracketleft/bracketright/underscore/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/emdash) -/FontFile 498 0 R ->> endobj -5655 0 obj -[556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 333 0 500 0 0 0 0 333 333 0 570 250 333 250 278 500 500 500 500 500 500 500 500 500 500 333 0 0 0 0 500 0 722 667 722 722 667 611 778 778 389 500 778 667 944 722 778 611 0 722 556 667 722 722 1000 722 722 667 333 0 333 0 500 0 500 556 444 556 444 333 500 556 278 333 556 278 833 556 500 556 556 444 389 333 556 500 722 500 500 444 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1000 ] -endobj -484 0 obj << -/Length1 1612 -/Length2 19242 -/Length3 532 -/Length 20154 -/Filter /FlateDecode ->> -stream -xÚ¬·cxeíÖ&WX©ØÉŠmÛ¶mkŶ]a%۪ضmÛ¶O½{w÷××>}þôù~ÌëšÏÀ=p�g¬5I ”iMìŒLÅì€Î´Œt \9K[#'Y;  ­’©¹ à¯�–”TØÑÔÐÙÒ(bèlÊP75ˆ˜˜˜Œœœœ°¤a;{GKs g…ª’:%55ÍIþ1yüOÍ_O'Ks €ìï‹«©��½­)Ðù/Äÿµ£²©)ÀÙÂ`fic -–WД”PˆË©ÄM�¦Ž†6#Kc€Œ¥±)ÐÉ”`fç°ù÷`l4±ü§4'º¿X‚NC€“½©±å_7SwcSûT4{SG[K'§¿ïK'€¹£!Ðùoœí–@c“ø+7³ûWBöŽv-lÿêþ‚)Ø99;;ZÚ;þFUûwžÎ†ÎÿÄv²ü«Ø™ýµ4±3vù§¤éþÂüÕ:Z�ΦîÎÿÄ22˜X:ÙÛzü�ýÌÞÑò_i¸8YÍÿ+€£©¹¡£‰�©“Ó_˜¿Øÿtç¿êüoÕÚÛÛxüËÛî_Vÿ+Kg'S3:XF¦¿1��ÿÆ6·ÂÒÿ3(’@3;#ÿå&.öÿSçjêø¯Qü33”“04±ÚxLLÍ`éåìœÿ†Püß±L÷ßGòÅÿ-ÿ·Ðûÿ�Üÿäè»ÄÿïóB‹¹ØØÈÚþ€/Àß c�ü³cl ÿ_憶–6ÿ‡ÿ4T7ýw’ÿ8’Ά›!4ÿKÿ…–Nb–î¦& -–ÎÆ3C›¿�ú—\hbêhc 4ýË迚  ed`ø�Š…¥±5ðŸÖ³þ[e -4ùÏäÿ’ô¯ÔéU$DD…©ÿs§þËJá/÷Î*öû¥ÈÚ™ü¯Ã?BBvî/Ú¿7�–‰™Àö7 #£Ïÿ!Ú¿`ÿë,kèìhéÐþ[2ã¿ -ÿÏ�tÿFhlgòϬ(;MþŽ×ÿü£6vqtüËê¿nüß‚ÿçù_ƒnjênj »²hgÌlõ;=ÕùFöจvo7#ø`ˆ}q�JAž•]—ßïðmÎrƒ÷êºúI®Ï�…Sû�})ªƒántò®dÓË\\bÊž<¤ ²6vêƒ@z½b„Ô3õh¯«y™--6µƒ�qE%½¢w(¼É6fGè«'Jb×<T’Gûï¾Æ)µ±hí?êA�ÿ䟞‘%?=’÷� tÝ@öìãPgÅÂ�r»B �Eù;dáðk©–{EPB¥6ÀãÜ´^}¨wzéå�’`“DÚʼ*˜ç®[eÞ“ S[ùye%š÷+4Яg'£x'9g²¿Ö\HE�0xp'‚zo§­I‚¦Ò¿Õâ>€]Sô:…{ý±­¢zíùž=74¥Ø^\ëÖµOÊ@;áRñ]¸ÙÞ‰ÔSgIHÚÂô½$3û«ÿq^݈·­{ƺúLÆ$[×ñO:¦ÝicØ ÚI[¾aý�Hß„Ì`Põ–ܘqᙢG›ïe”k/I|©;ô#c”†6\åï{úúbÕö&™9•§¤áÎÂÄ œ…àLQ_ÎDøp’8âïèFs£aÚ_§}Giî›@äßå'ž'¡.ýèD°Ósù¦þ—ôTe¹$6‚¶ômdew�OÌÕ?¹J“ cª Þ†FW¾Of„óðÆ¢Gë…¶½"ÂêÔYi÷Gsžçˆü ­ß´G­_¿ƒ{~1‡�áiOúó�©ƒs PŒŒv±$Ä‚»œ­6Ê÷#Žšî@^g:t< -®;Ë¿=ÂOMlñ�äxV�Hôý‹»ü4û!¡bȪÖüã•à©Åä4.„ -íÓçuÈæ Öztð¸º/!J&ªcd>9ñÎŒ>Õó5 ÑTõò©LÂj×öwÃíùÙªíPÀg‰}ö¨ðÕ[[ì _gÝ­ŒïsÖû*ªU/dÑwÔÕ$˜Û„˜šü*Ÿ˜êþ^¯p‰ ãËx�›DE—tLB4ø1%¡@%c�Ȭ�Qdº±¯uPTƒx>Ч‡·‘¥—ÇDiÞŸïØñcȱÖíz zz^N&^_öfÔÕm¨:¯¦[¼Ííün5QCòÍE8¯Í R—u¶??‘_íô.¿WA3`ø ‰’"ö=2¾s�„Šj®•Ò®ÒŸ%“QR²°vIE¼ | ÙÓÜ‘þÆÍωbòóÝSO*="Û&QMWñ\5lÊoaõs2o-Ê�ór{úÞ�ÝݬiBªï$¶}16·às11Ç®f˜ö�6–‰‘_~Z4¨„ik¡Êùã—³5K5Ú#Cü@–öËQ:šÍR®ÐÚÉ€�}ºƒRñ׶󻔨[Íè0jX,<†Ÿ*õzzão–L§ª�v¹8KJ.(!Tl‘ÁÏŸ<<`¦:êé·8Ê3ì©6ä¢ßB†häÎÄ_õœ²`6¨›µd&a )ðU�#4;�£Ú�A;³cèpÖÃøó–¶fèéë&‘eÇ¥’Úß(‘Æd°¸m‚8ìpÎugðàÎ B:ÃFpJø’µ%0ÏO\�¤wÖ´ ¨Ã*Ö¾Ø2Ð=ÇóX7©<�JGçZÍÕcÉŽåsž1–ŠðTCáʆ÷ÒœÇdÆ„,•é/J¿±[u<µâ�'rn'�c©+½ƒö;S­0˜¬¸Ä¹Æ$µª˜DÀçÚs11²~�š -ã ËŠow£Ë�Ã+‘j zŽ‡Ë½®?“ýv½†ý‰O€uúõ -"ÊžãB®ð<ìZöìNÖúä0ÇöÕ› 9RT /À�œ$â.`Lw�Æ#ÊÀIÀº*ÚcBàÁØ)¥ºô¤Û¡üÆø¢vc6·"Åm ] ãá*Ó«5¦~ËÌû~·âùû½T²fÕ¡œ<\1h¹µz¤Ý™Qøö„jI _uöÛ&ñ‰†ÁD|¤*êOöm}cñãqʬ Š%Æ´ö­‚<�…G™^4‚øœÎ¬ À|me-k}Á;ûËp\æøAódœ<ëZê�óTæ•j¼ÍäÄ%{$ÁIê¿LäT+õ' TXŠš­FÙ‹fúï­åWÌæ�íóLb ²?=¯½Ð…�Sc¡ršv*�¥Î–‘þ`ì²äð¶ #[ kÛjŸ8¼Tð#1²jàY½;Ü"Ä–Ôi½ÞOæ³ëŃÔuêáâÐ:å7œŒ4¼wø8úÞb-µ§{ÿ¤ZÍïÜÇšƒÈ›ï.çì Q’[0Ý”²k°0~·ŸØ‚†ÌÓw„dp!)/j¦(â`U<ûZvûÐä àR¿d`½èæl¡˜8¾¼©KVµ]÷>'´��€¦Å;Ý@ÑðÕ—²cQòEm“53OØgxCöä‘ÂW’†ŽÚ¿ù$ø²åíÝɹÈÄ,Ÿ’:LBŠƒÌ…NÜ !²·7Ã¥%ìÛœ]¢<šàš· ¤d§‡n+¡‹!Ï­uš¿:ÔOîI¤YÝÆ¤¦x+Ánt)C7K"µ°T›¢á6'yTG‚Š74˜æ³Ž1HrÓÚ|rܲ±‹Š}t…¥`¸}É‘y+ è5ÖÉMy“À5Ú@êÑ[U»PŽªÙFQ€Á°%¿gžQ‘¬¤÷ûk3Ôwåß`,PX{Åñ¹!_�é Éxøöjhã#;b¶nÂzvh:Ï~_¦ä }`Ò‰=½Éeµò”\g9ߨ.:µ(d=ß…)¥¼ÎqB¤´zµ¸3fnuxª<�\¶QÐ’Iò ~ii¿&íÿJ,uP°§q؈éêsHÚJ„@ýŒî�–"…À­kT/”IòG¥% =Ó]9ï9Ó+J]Xé­�p®ÒÛ+q>1÷¯2cw7ÍL á!YÅÜÐɑȿºUþÓmóhµ6}ü~Ë·áÒ7·)ãž¡5 µÿ¼×Óá–tØH¿Bêè¢Aj+—z(†¹£*yå»°#~“ÕãÅP¬è¼œqPŒÌB Ï Â)T‹®|bxY³«ûÉ�§ve…"! ÜÃÅ�~•öç@‘õÂÖ ª¿‘åñ‚…³·ô*ÃætTªot‚Ú×5�Bc�V¶þ•º—õC»A„ Ì¡W{`!y•JÈÚ�Õ°YéE‘ŒÚ¡2Ÿ5aRŸ4�Ý`RÊ52vÏñªÕù„K¿ ®Îž’öã3jA -’�¤�òÞîSurx±­š@}Æ0DS'0÷Jho·]µKAÕA@·e›I*�ßTP[·ê§í ~¥O\ ºo‚Ô€DHž$jë _©–ô –Âk+©8~WÜÙý“r¸)fýhéΠ&Ôè}�f¯ú"BÓ;ÕËðk‹†üts§PÖ:à|Ø©t#9÷üHÝ´Ù}†N¶t'̪_ö•vè@@ÁT¬lè»W`•_iÔ�©äý‚Àׇryµï -„L¡µ\œH^-Ÿ·=]òý¡¼5f’yÄü¸¹>ïâñAÉuåÂÓ¾PŸÎPàm-ˆKò9¶ëì,MáD¿´Ò€Dò‚µ8p¶4ÈÍäæþÓsR™VDÎ+›È®�ï}ô¸0ÄæW+ON -ZJÜÝœÔ�ph•öOcB�s¦a¨2U$âåeÒ²‰nÅÇVýÌ;=2|ÆQ áRb=Wy5�Äé8�‹ï_FîBè½EK᱈ßußS’i%Mâ°ÅÇ阄w6N&ý„µ|Þ°XÒ0&Eš}[Ï1Y¥Bþ‹={¹…�ãæYLîÙ.îˆÁÐ4ƒÊ9?fd[ƒWAã °fà‘,� üTqˆÅ ázër±©±CkÛytnatM�}ϱF� ¡`<ƒ@Ë£�Ïô*à� {'�«ê…�/+éæÇ„3”Ñ\êõ(c_�@÷[' -¦gkÓʵš· -/†`ÏËJ 7yØŒä8ZŽas¤± -¿ÄJûÕ+öó5üF3Z!^ Nà½th ªŸ4²DOc}= ~�< ,Ç’q/lñŸ&¬;óH -¶Mæv?¢fŒº¡ôл�1€5§ŒŒO÷vدí˼Ì:~q�\²Œ c¼J:,úÄåÝÍÔ4K\¿] -²à*94´ˆ¶ÀÄ2üúmÕ´F÷ u<‡�À:È]53ôúÏŠígRÅÏ[ðÑèk¹¤�9óæëcÁè]g˜îÒë?ŒäÑV±Ã߯ª;§w†Ø`ŒÄý¡Ö4‡¢6&H_j´Â%/±Ê@^ùò{G€`¥rãÂE°}áûY J -öþº70“hPÝýˆZŸ,>J_Ƶ6Þ˜Z–?1�EÊ~ü2‚HJÊT2rÅÐòE˜#ñn/ØÛR6Á³å¤j7Ö"Ú¶YθóúÚŠô`õ]Ì2wv£·LOx*Æ”ùXº³kΉž8h­sB1ëkp„�å»=ëcFŠŠ†étn½Š¹i“Â'ŽÆVt?×85"°‹4ž~¿CYóx©0ÍÇnÚÿö»€9Ëʽ•|"˼o~ ËFŒz:DµsÏû!Â1Hm*€_U£B�â°ÂÄŠÕ‡´�™Á%Ö¡ã‡0›öª.^êp�æôó›åþw»ú+1‹<ŠÄ`¶ @æª&©¦ƒâ³1SJ(y*58Fá‹:½w 4Y™_ ÚÃ’ÿ)ùMó(\þ†-ß×T%ÐjÙ5³±g‹¨âXÌ9`ùø`À4K -2iVÝ"ËÁ ð—8‡QðÛGÈ?I }áÜÖMaÿSƒãóºï$i i}°í‡;«¢r_7.¼Â& -Ïk®sù°ªÌ[«×í¹1t̪Ù£»a8‚—·vÚ­.—52‡~�²>’²TP:T”ŸkzŽ»‡~ ØaŠG¡:A7X˜ +Eq#;¶ÿUO. -æ£\s0V‚ÑÙàÖ±Þ¢vœ–7SN‚•v¼m› k[žØñtù“þ“T‡�¨äϱÂ4uñU+ÊYeÆv%"úÅt¥d{ µÐo¤åQ­ÝtåDüÚúyIïJáÓYÌóAç{Báv %í%¶&ŸÞ¨wßNfgqñ—«fRn�c‚ -&P[³)2Z˜«áõNUy7o°(‘™ôM¿´ù7ò¸i:}É{Ö¥N,kŽv,F Ñ›Gòó}€vk$ܽ Œ¿_š+Têî n+j¼ÿþ|¡˜�E¢€ÒXG�Ê -ZÇã¨ñ‘u‡plslü|!aÍQa‰ÜP ÛhÉ\ ¿Ùwû6!½ïçP�¿8Ξ>�œâ$!ðÜ^6ˆ…kû'"‰?õRÐù൮õ®D(‹œG[Q`ûè0~ƒ-ËC ˜¦ÜÂ’ªýYí�“[Èü÷ûN}R>ÁwÉ­ˆ[ÍÖßxd€tå³:aXK³ˆ_ÉHn5š‰¬ nX�Ð�¤µÖ -!ÝÒLz~�m¢—�Ü#Hru~X‰®¬KØŽœ9àqல?Ƹ5qî‘Êbu¼¦nùë8V5fxJ*êm©µÍõBKuÞ”Só°o%rIt.Ù-¢�®¥ŠaÜ‚è)¹§fI‡ã•›w ¨S›ö™‡Ž3k¿Vˆ·Ý¤'½‡\!_Z•ÈÞ<((kšOs• ¿ÜoârÔø±+D”.q(ù,UÐÍ�t—Cgþ~y6¢l¤7§Þv¸ÜÞ0&^KLpËQU NýuV›oÇÉÇÎ)“5.5�°B‰è�º9 éÚîþ!�œ�û<ŸÈ¢äÒ {º»ÄA óÞM¬»U·¬b ’s¸°Œ/¤ÂÁÒªÉåÃõBwE7eôï†miD:\“Ž6GápýIèϸ�Ò -·YìDï+ªZ�Ü‚Ã$8$Ÿµ=’5TùXâe� öíóáUDd‡|“ÏÍ›¸d…ã%,ófµÍs�‘ÄSC>>�JK>> í.Å*VÚ) IšFrÑkrSÉÂæ�àÞeÒUÒÊ- Ðõf@ãYDÆQ¶‚Kz–:p�6ª ♘îaöîKG:H²t¦s,Z³ôÞ•ŸÔ¬¸¥¨‡@eæ£'Ô³Iðnp·^ªTÅcÿ$€YAœ{(Â+k áš ÅÒ#Ù‡EJz¤ÐÈÝŽâÙ—�s:>�^2ɇèjžàî±¹HÉ–*eüÝ¿(#E¾v¼Îv± Âëùg»y×ržž¥À‰DâÎÄyjôûm�“§Ó¾;_}I•Z3ß’Š[i±N\ƒÇ®U>ÿœWÀÓ"Â!%ccg&:›§~9êlÀÜñtæéƒäx�ä–˜ª?u™Â�ÛЭPr�å«2¢¨ ñ½£h8¢Y�-FtȘ2_ A‘§ÈXÇíõæq“ÊõÚë-þh•qˆ�°NåçÏù;6æVðê\÷W�#Ëâ³ï8é›ß‹eG~ý.2Kî²UpXMÕbhF•š8E²yqT-͘”ëÆΩSí'fÕ‡‘.âo׊n?�³¶ÙíXüÀxJºˆ‘‘ñÛñš±cñ£`Œ­ÞVWg� Ü«ô79Ï�¶Ò¸Eƒ¥¥d· ÈÓÔ~íÍᔉ�l ?Ø^dÇ­/À¨’µÉÎ�Ö{CßËbV¯5[’z0†#™Ÿ` ì�{¶e}Æí—f@€ôÀÛ~�«‘ÎãQëm÷]sp¡c Z½Ø³]p|ŤÃÜDTba#€³eðOhq=Gª3G8,µ7ܽ=;i-‹þ"YáJ8íéíÒÿÄ}t¹±u¬Ó9½“�­ÀˆÄ[&…�¸$È{Do Ž,Ã>ƒô�h� _Ë—Ž$ÀãÈ‚¦é;>ÃöÕ�O$ ”!TÿÂ�4ìcÈŽÇ+±Êô±ƒ98Ðð'œâÀ� dðÖ³‰YøáÛý# Ú^¥+ù ‘+ !¬�MÌþ’ÞS! w?RÃ9†ÒTvaͯì)ÏYóÍçþu*·î×Þ‰³RGõ Tu†Ò@\˜ÄÍϰ.ºöpbÏY1…h”}ldVD\Ñ­FGÎï´JÍ#&[<ëñxùr´¢SžÎ$GùÞX Ùþ®{ìµ–ù×ndYf4<(^Ù°´þ­s]Üî¦Òcç¸\àŸ@*//¡Å»½ˆlÃ�£H¶|ëvœ»À=°�” Q‹A7�\…_t|õ0 AKZ�y+?`6ÅV9Í“Ö(~RÑÆÏÝÒ1냹Üñ¥Ý¢Él´�¤£fØzVúm®C^§�6Âé ùFŽüâbu¯å1 ÎM¾Sfη+§Éýµ—òÈÌrr,‹Ñ¶Žáñùˆ·&¦HKó°ˆ%XåM€³cûxØ9Ÿkª·^m òfzþ‡ëW1¬¯­ª¨Ÿ(v€ÛöÉÈ]ÕðŒs0Wê…ehhVò˜XPÉ>Ñ}„šZÅ ï„9–qùÕç;I‘hËO]2J¿Zá��U¶§^ÎB€«"ÕoÂb޽ðE´/yYÐ%ÁgÂ0aÿ ˆð¯—wŽHRžhódž½~é²o -æ{æ fÈ©Hg�Ö—B7Ôç©þ~8ì(PþNS,}ö‹—Éz -˜ê™gw jÑ {Òí–äBŽË&1«‘Aò)Ù‚WR)Å#¡øy?\»@Fšïdþž� æe§§ÊâÊàí,•ù·Ð¡’x¢QM&ó&4b2iC�y5’›&e ÍkVZÄTð­dî·XÕ`!=ªåŠÀÊÞß¡¾�¹ç6 ë{Yú=⿲òT”»®’{)Ídˆ(¬ÜÉϺІÞ×Õ×â¥ÿˆÁá5F¢È$IWRm³ßì�-û+ ú4Èk>nE&з®Þ�/L ¯û* ë§ÌÞ­ub«�#�ÐÛ -çð�áxxí3Ý—*˜ìâf÷«eð–wíRÌׄ½”Š5‰}•úóŠÑIfkž2;ƒ›‚2Ϲï¤ãë¶ÚÛþ4E6xhJõ-8;|“w?H3YÒ–ÎM1?ž )’À6óã¼`I 0ÅŽ÷Tž1UV·?W¯"”ºubuDãÍÁrnå}.‹w²ÈC¹È»á¡âêyŸ9µòý¢­I¡NíGÃçkmyÝIæÕ“m÷»:,{›*zM_Âiy´þª»_œJB—tdM`�9YÆ)©:59¾¹NIrKC6ƒë­I¶rÏλóq!\S¶��É·ö‰3þ]R€Ì0Qê[Xô !<œvyó¨ÚøÐJ£¥¤k8§eÁç-!65˜Žqñä­qšc Q.Ͷâ9 3Õ€Zà�x:ÿ¡Ç}-ÍÇÑ¡»w¹#ûvÈŠÓvjÊaq‚2MÔ=ú©ÉÜ,+¦øŽ#±1€Œ JeC°Õ½+”£ ª•V«lÛº…ø7§z1Áè<µ‘“"GÅ<öFÅ«ê;ûx<Æ“ -ÏàÐt5è^8ë‚yŽ…·8ÿ9´Øe0Ø¢‡Ð%4BE:æYÌ\pɳ.…oþî@" žu%Û®Ñ6cÅ\j^Kq ô¢>*}-Œ 0ÛªóŒ#‹öLØVøɰ %p&˜<¼;ËŽóBí¸Ë8• 8®�f¹ìâá¦S}¯ ošñÓWܦBŸe*²½ƒô޲ê‚K©kçÜl«?W¹f<³Ø&Ðqi2¤7ÁÃ+PÊ|SuAtŒM`�Êã¼Q<ïƒ6)õ²´u‘‘ëyM+/Ó –„s^ÝÀ âaS7Z' ©"“¡E4sZï2Oà:店*ZQ:Å õ°]Á˜÷û”› !쥷Kak¯œQcÀþ´@%Î|‡ÜPKz${ùbÒ˜¹/®îB�ŸÊ©@aú4zgìUù×!Ý��O!®!ë·<-ŽqimAŒñ÷ †¼¯‚àj¡x‹šótsrÕ“ˆºÄ°÷•šåçVF.—h –ñöXRµJŒ>~üb«!½ÃÆ€ªšoȹr^?K -;�ˆP颔‹ž±# "yûèûEÕ×O¤îæBÙëëèyt�Hô[4†¹eé(28BGuš�ANSìèKuUAt=z ú�Ã'óX~Q  -ußq²üÐȵ¥=M·‘Rº^Ð ïœ -6§€i“8jJô³I}YÞbNT-êO[HUÿjiŸ�¶ôê$7Q¹ËÈv/æËB�tœJÈîÓÑÐU¢ÚÝïÚ9…nï’°ZF<ã¹,�4XsEX‚z“Ûè¡„�ÔjWÜœ"ÝkiW>|‰\à‚Á‰Òrü»x²d¤‡brÙ/ã¤G‰g^a s¯ß¾ÒO¶f1Ðüšƒ�.H‹ßk¼2äXï´ -/ØóÀýÐê— -õoÓÌ�oB¯átvLÌ}k’ñ/÷´µÜãç)-ÍK§“Û]ÿL;ž¶6�ºÄ”dwôj®¼Bäƒ%å·Yú.®ûõÌ¿Âk•éÞxgú¤O&)S�O»÷ûÇ.íN4F6sÐú?Ÿ&D¾—¾à~K6ö÷Ûö#¿2,ܼ*p÷vg�?€ÍÝ€�­›þa9î%.X÷è�Bà£S=X—̓g92+,C.fÝD�ƒÏc®�*ÆŸµ!ܶ*Ø*m…X¦ˆ1n÷JšÆ_ÇáUˆˆQ4øM—�¤eêµ°]ûhæxô‚ñ:y¬ºj €�Ô¢ì"„·"`� Ëw´ænƒ¾³ÖS£ð9¢ð‘ Õ 5Ú–·$ýÄ€³"‰Ø!¬Á7*ÂÁÛhu›@±Ã-ˆºqíÉ€ 1KP×,H5�ÈéZœdM` ¼;´“:9@0XƒÉ|1è§#BõVó#gš{u@äqc)4˜�qî?ºÌžD<Ø9¯rAX®„Ÿ‚�÷™#ˆF.SOyNKß�¦ƒ,,_¢ò](´°Û¾H¹c1²î“)ŒöL 2Ï+eK™«A#À7õ¤Úß�ÝÁÑ}Õâ ÍY‹ûñ=Øî;s%8½¦j¢WßÀ1é–�Ê2·‡áHÆ”õÁ/ÑÛÆeMGÓz¯ÐzÊ0I]²ûÏ«‡ºWPÒù—ñšªd!î¥Ì5Á%v ð±û5�NÌîŒè?>!Né¡Ê•ìÍÝ�âèø:ÎÖ¯þd¢â?åöšè¡k—�¸I”ÓÙ÷¿^gxô� ê†Ì tü;Ä3ñI¶Ì¾‹ óH Û�Ÿ£´ŒË•• x I„<óºŠ7CKv{]¨Ñ£°L”~c|γ„¯»1Â6]’]oA Um.½Ò¢¬tR¨uIü— #”}~` -¢ÛºÌ/ﳎrÐFÓVðåçË'®oE»^!s"èª/Çrw#ˆ)òƒkôsõ£¬µZó¡Ä³8·p?0¢XémÅ'$k�þÞ6FïÖŸ[<ŽÝÎèþÉä;MÞŒ_#f¼÷�¯pf!Ý5C_IhnŒ”‡­Df˜}Éš:ߢêzùå^@Ö¸Ÿž×XwK¯0°!bL[¥´:퀟oD3¡;»°ë|LŠê s‚Íø‚ß`SS¨*ÓÃSZ~Ž™Ïd;¼v·ñ“{î-Ì:–ù�€Ý:…§êuç´LOx�=3a»-›&ÿáfäÈS¼ðÌmì‡õÕ¤ˆ·Kœ“gÈ$qQn÷0†¢v¼`^}d—<æøì�¾—•ZmU)™6Éy«ØÍHG@ <ªóÁˆš?tQ ·r&¬@ý äš£®AFfézá%JÙ`ÚÚðõ*Å…yÊü,5½tNºÛXñqx\8<6L�×ÐBÀD&$î:¡†Ä½5êÛµµßÈ~ÚÁ)>Ûw0äSQ( ¯xy²'æ©9¸¹`—©½¥žXGÉmúá Ô®/Ds`A|L`Ô(çêÜì:Oz’Q¤�é4–A4PˆÏÓô¥R«ëô–ÞEDi&Ó^�•µ ³ìÙ4Æý¯ö"û}|yµ~ÌÇZU¹ôF,v_tdZ> D%òåí ²åâOÌCP’,oÊpƒ¦Ë)Iò|Ë[3f·ÞèýØmSÜa`h§D”˜¯zŸ ¨JΣ&Í,àÝ`Í:Q×O;hã%¨ØãTbD±ô&„ µ<;\/Å6â}"æ/»#9*Ú4YV˜£Sêš| =¼&ûá·,å�i -^ËÜ€íÔÂq-‚qu2W‹bp+µ‘^NÈ«ºØ¨dWÏÝ¡÷ âŸÒDþ· HãîÅRÝý1už¨ÑóŸi?�oà©‚÷Z‹‰øyL6¤Ìðï@¥}T«¥( Éy½ V]ÚÃôµón¤e[ŠžyNSÊø%éñ$âK fpòcs°¬—¦1?< éûrÃ8†©¯GŠòÈù!eÔ™{Á"r°äa xÌ/�.§?HÂòe]º8L‘‹zâõåR!êZ¼›š.Ú l|FV¸€¯ÍµM¥Dð1á?×j›¯XTui7^Š�µ8R4›¿�ÐÏÉÀÌY‰ÜŠ.9�Êž3²�”;á£õµÈ¸ê|ƒ©+`<«îEV{›ø*r‹Ø óT}æ²Åº¼5$�YtÆ2�^et,®=ìë}fMüj©�?¥¥^(Ð2ë=O�cJÈ¥V©ÜfäŽ1LÞX¶�óg -öñ"¥ß@»j=1O–Æ+Éçèª{¬þCÑÆ“º‰Â·žm߇íªÐi]Òä�á°æ}»‰b´ -×n!ø­¤Éàë>Šç$)Ðyñ›œÜöé­»-´pìè䳞ønXÌbÔšUcÁ[9K5ïO3S-ÆaÅSÛçå~ñ ¤{ýÎîÐ95qÈ£I?ÓR��@­.KƒÒGгŒ�ë¾›Ò†’òú†Ç2Õ&¸|q$šöe31Ÿ£Tó룄.ZôoÇê¦/bBñ¨¶�ÖÃ&J©È]€¼‰LcÛ²%½†È«0³/"%­Û`½¿¼ñw½pM-:ò/„æê}~árŒ=_÷¢“ÜÔæNþL~“ÔwÎm�qþ !HëAßð§]22éØK–?ñÏ\«_Ô|b|óúÉó©§Cb~ÒDiÆ=·(ëŠõ�;'�ß 9‡µ}Æß�J1_í¨½Y\¥,ÿA¡1~;å­]ÉkcBÑJt$®ÈÝ$­«êpU@ž5£UØïõ÷æã—Æ`�ÃZÕLû# V åý;§Îd[ý0ÒÆ²6÷Þ$ØCZ_Ÿ¸ Ûô«j]k˜¹ÿÌNñ ¶þô@pi,z[Ð"-v[|"FÐìô듺‰Àå�™”‚X<8#ÊÐ^Íû+&"·Øûp -œïX4:T_HÑN®çg?=,erO•xJf�»é®ñ§`anÌ¡Ëô8‘ŸYw£E•‚˜m®@¢lBB±£Sgö«ÚLÎÝ�2 Ž¿IÍ÷ÀÌG -A©R‚pñã!Xkc“�jÅøêN]ÞxqˆðÉL*߈ˆ�^¾cz¡‰dxågmMíѧâ׺nVX&î$Û¶w™þ”‘ 8b®Õ½Lûäì‹^韮¿ÛËNŒ¶jG¼¬¨GJ¡~fý¹"ÝäþÓgf�àÝ(´XƒÿX’Ò”Ûñ¬]nDYÄÎJ{6gÙì˜ i|ºƒÚ�~ÒnÂZš�`êÂÜéÎôºÅÙI:süöc7¨ #C]* Ö~ç…%çÃP,…Ƥ£ÅýTLV£i2\b™{8�½ªÞñHNLj�É5+¤Eo{ðÈú RóQ°/O«FeµÛL~ÄV:�~"¶Q¤$˶#œtR͈—¬Ëä#²ø$i�XøþYïWádCÙ˜å? iFŒø Š3O -j®2pŸ”%Ð5§A”hðÚt)—|,ÿËÁËì�ox¡vc×]ÒïÀ—Â)»<»óY‰­¯ÆbÍÂ!f1¤Bˆ)L‡æ:qÕï[RKubù\ÉÕ*ËÔÁæJÐP?·Í˜J�6ïW�ÖZ„ñ¼[ᵎu™±ÁÀ­}‹”ªþWm‚dÌÂ;ºÀ{­#ëåsLÁfIU‡‡ú5*Þææ]Gñ 6œgd[¯$"*ˆ“É7iÔ �92wÕ‘|5*…[¨þ)Í×k¶bŒœC6ºèò˜Ô§cˆ³’ÎÕF{ú*´©:|:påVqr°‡"�3Ð/;]3äg¥"}]Ÿ^Á¸ðUB« äCÛßX2zò£%ï+ç('SÀfÙã®q]‹`DŒ´ù=r{.ŽpË%*™� ° Gé›éóÈÐZ|‹k¿[©'èJ ß-tÙ%%»T6×Ä?[Ý{e¥ð,3`Àˆ ®bÛãÜ?¢+œÚWÂH%8 løžmpµûÈÊ`ÄÉYÄF™ÓŠä¦z¾'ÊŸDMª¬é~z—h—xBóña=÷ˆí¬—Ã,žþ‘0Ñ9‡§pŸ-Œ¿Áö;R“&cþ”ƶ,PÙ£N¥¼÷'À�û“pŽLÅÔgi´œúÛ¤˜ÆGJ}ý.)¯Ýâ|!ß+ׄ„žã�Ìž÷çÅ‚l¬=àòठ·Û….Õ§þ-–¨x‘N·ßŒ›#‚]ÇüÌ%儤ü([‡Ìðé¢ä3ûRyY+,èÓÁ½Ú w¦ãBž4–¶‚ˆ�„‡Z÷(÷†sÈ{‰Ä¼©¶EŒÀ°œv5^’ñ äf‹Iª7CešÑz·ñFkò° ¥w›'�_~Ùdîα®qÁÊ‹dwF20È�—¥¯)št+ž††é·ª9 c'’¤Û dù³ácz¥Ñ¾Jì±�Ñš�² õå¢�]™³RF<ŸR™‚ŽJÀ¯Làòêò´–a¸q±]+ƒ¾èºÏCÝÓ�`íѺLàò „p®U*ÞÎ�àž'Ìü­­9�P�¥mûïUÚÍpõ,Š4ª‰�›ú¡¹µ ,ï -r?´$0ò}ðR±bò²ozíC©Å„S¿¾«|zÄË­€m~.a  ¯b0Íz¾æ·x³ùGŒ"ÖxzïúÊšËe…À©#:¬¡>­ p1è8f'QZñ¢ÖÄ.ØK+d螉8‹]®ìë~ ¼¡;>ÿf퉥3«t2%=à�W±‰» -‰zÏ&06l2£40aê}Ü€ó@ƒ¡@ ’ƒîÂv‡šÔ20úŒšámÒÑ·“/.‰«6%«Ö¨7!.}܆l÷pu °æ!ý¦·;¹gè4‰¾Už–P™¦z UîÏ«úl×¥Nçâ¶‚Àë$üÕ{ðï�ÚÔõyö@=Üa -›¿l ¢gQƒvƒ£*\fñz”+F`˜ÚWÁð»yŒŸí@ŽéÀC-æc =Ø]ç°Ø{dÙªTã!üÑêY™¨,�Æ”6DºL|œ¢Òͺ‹´�B÷@m‚k°yi.¤×CÕaA…p˜•ÝÄò§E' -ëðÕmò±ê ’¸– ìêõ µ5œB#fðºSßÊnÓäxÞn¥(˜ ’ÈKë/T]vÜêK7”LäÔ+ dDw4’çFsÛu’G Ï0'r"8·bßW·½•ÉÁºMÔÍîi2­‰kiÃc¨qè�˜Õ`._î§àRG¶GÍ9hNµÁ¾¼?ëBò’°ÖNµ $8M9bMJŽ—½ùawÙ!÷ÑAû¨k Ì:øMÔÅ 5×o¢�ZjþPà5&…¡ÅõÔRdíÄhÁ×fÊÍ º5w€Ë�yé° Ü¡•èÔi’‰S8x-ƒk~d@ØCPÇ’ˆ•¸‹O¹ºp”óHÅf§zš0n\AUðÃ6Ðæ—ëU&”ƒ%¶¾÷¸nm=ϲ¸(ï ˆ[fs£0<æ2,æw¢§çÃíNÁX:ÁÄœ¦á' )§½ݱ„)–fýtæiPšè U2Žöá‹pv¢»eô–ߥí�¥lü¶$ÑMAÊÞÎ\¬þ0…�Hzª=¢KïþêjîÜ©ý%1”yÐVl¬…ÍN[I[ö¶rŸ±}ç§weÞ`ô`}ß!£ ÖàÃ:Ö'߉œcµ}¿áMèY“Œ¼ëïŸr8ÄÉcññ TfžÐÀ°+`ÇÔs:�²fƒì ‡Ò=e-a~¡¾©/‹‡ŸLÿ;/þ’ù¦Ë×>�Šçæ½\b¦ ‹Iã�DϦ{�™þØ’£è2ζÃÊÓ‹&›^("þ²î&py§%'}ΈÉÅxž‹â»íšÓ„&vÈsë!±iþ•/c·)õ“‹©�ÿÈ£�‹ÿ ‚Jvu‰/G"Ž -™tÿ>=ô¤¥!aÎÜB+Âml±•òfUM?(Óv™þ5=F%"Ⱦ%±�‚àȳþúP!ݹ ~ ¶ NqzÌ'KJ� îKaå.ÎkOµ–]#°‹µ ÉNÞw³³�D»®H(ãM7%®xa#VCŒ¼¢¦¢î°�eglS·’Ja–xÆU<Ò¹²¨æí€ÝƒÚ˜d:ÿn_˜ $s/`©Ó^Kµßgù@Þ\šSY$Þo�Ç� -lîšKï—ôŒ­8¼€õ·Ÿ)ÞÎ2D½Ãà�Ô1õžuêýÆTÍ>�ׯŠqùrÚª8qû=ýY¨5îqx o’-Cƒ™^…Ú ¤6=('œ£‚‰ -"†Tƒ!8Ä—Py2 84`nñØö[n¬’RfÙO·E+7 MrÉšGƒ˜ݪEõÝV’OCF€/®“rñVyŠ AEhÞKóI¸÷/…åMè<�'l\žšzŸ¯ngÈ"誤&Ÿ¶oá25)5“ð6—¹¸çä ¯PµÙUŒÜ¸;Ú¶v¤AZŒ}°^–óæ.UhéDg0áäêÔe§2þOú†Å–7°Qµ‘õ‹+§Ââr®q=Ût< ìßYZI!r#ñÅŽ�*yT„uU]ì=™û,žo³&¦L£ê»�ŸþßLa{º<Â)ø<{`�6zÞwóá�’Z_HKèÇü§“x~À'öbÞ›M� Æ N3fÕ[Ʋml¹o&ÂW%Œ² NcäªâhVÚ/ Ìõ總ƒ–�ëí·F¿š—™¹…KhŃåQè@› ƒƒ‚.çSXЮrÛÝò Þß o΃"–•Sùa‚�ܽU”+kõÆî¯ó2 ßô=Î>6ßdóŽìÂP뉻™{�ÊœJKX…�),?mÄâAò:Q#zâûRÄ@TJq ³t&s¶o(ºãôØÃ‚ÿД3Èy¬XV C_›¨Ntùg|";jæ:n~Á I^°íC^2(Ê·œRpXÄ?ÙÇK†FЖ �lmògaã?‚@'U¸'M­Cí Í´ÓUŽáId‹ÚUånXï :`¤K¦gçRm‹ôÇɰkUPÜæ)¶.*kxDyZCúd‘rLdŽÆa@`3Â6ü­©púŠVƒ—<\ÜC�ùÙV‹JA mSýŽxzñ­©A‘Éÿ´™¸Ô¨†lõ�r©YϼäW�½U®·Ï.9A�›Ó°¥úš.t¨nf̪ªO‘ЭÅÖŒêfY<*IæcìÆˆŠ`;åÕË„pÖÿ3³›:1êhî§„" R‘íµ¦|g<0:�A%à±ÝÓ¶O+7)È$´¬(½$-Mœ±R9[Bhï£?-Þ®èjuäÌȧYQ¸AFØ}É¡mr9p�r‹7ÖŽ…ÕF,<ýå+Q‚y¢€Îà­ÖUy%ûk&Z·þ-*†8öV-%¶xËOïÅyx‡¡N¯ƒdˆU# dé5[pûWîv‰‹Ìy€˜Ç|³‘ņ4p;éîg$(ÁÚd¢èÊô”KGüÞ¬±/óÇkBãGáÒ«€ó‹¼´YºuH—Hþg4{�GŸ[Ð× ÷ò¬þ P~SxõLͳÓTª8‹ …Óý.|å} �ï9q¸h`wã÷-oìÃì~¨%‡�\þÿi×>ûÙ`ŒÛ{ÜAíT¨±Å,jUK�*±ªVc�¥Dmµ·JmMŨ½ÅM©Ø[Ûˆ½W‰½ê¼z>ÁóîüÎõþŸàÂɤ9câOËOÞ«™¬3º8g -üUüs -·ûK{Û0G’Û�^Ï{¢`y.õ3²MOÙ³wêJû4WtÊÙmC%%ÝOõ˜¸¦ÇF¹HF,ðïœÅ$2oMð†ÿÝÖðaõ UËø°âÓésÉõøYCqßasZ§CQ%XQvë �ò%þ‘òUo´ذ²ôñ¨?Õ+Þ³®ddªÉ9¸$�Îjœˆ¡Î>†Ü¬4xqƒ¥+‡å)&Ï¡ÓBªõÅÄ�P þš®ËŸ•oêˆZ¸9Z_¶HÎQÆ:ñv‡íôÎm"*O¼m¬EBüá—zDÇv€-›ßHS”ß¾%Ol9ß8²î]a€áÞ�–é)zë¸3ÙdyÁ¹–é–Oß!* röqæ`›®˜Õ‡El •£çU¢Æ–v¡›œ§#ÞxïŠ3óÀJ�N¨�\¼_]¸T']Y©OÃä…¿]� (J÷÷¶þÈÚ²þ€³¹â4Ð|ýn¢«øfÚ,”˜)w†£î½Ú§“:EÈSšÙøË“ݶi{=zó¢?/õ -P›ÖûƒÐõ{ÌAîŒ~n@åìÀNºƒÒ ^äI¯Ó“*› -KFp¨‘í(œ£ž¯éÿkú)žx¶3æ ×8¦ˆ íOã4�VÙ¦Êg©–|á¶w„ÚSê#«<šßiF¤Fk-\)'×PHߊÅ\OÂg+�J´ ˜¶ßâtâ‰j1Iß„`¢n¨ûþLäï�…ˆîÞrQ)ö^æ�”^�—ê´ï!†&ïüjOÉyÍže˜Æ-§�!Zâ/¿x¹µ‡ÊY!Çeçsl’{³u¦ÙãÌ+µ__†[R}AÌ� e0­.&¤I¢‘æŸ'�³ù:8gXgóÍœ;Ü+Aü{³*fÌ"òpb3))·Ì I\Ñô2S`.tÐO«§<ˆf@7'„†‹ø‰Ão ×瞈¦ç£¿ÐÇ‹­W‰¢â`¾Ãí{ ß»S%Š&'Ëv4Ñüχ°7ÚŽ'A޾œLVõøÀ1د¿*£É�Xt2zõï#´Û]9òí©õYÛe±cÕôkŽ¡Ñãxä–æ“ö\õ€JlçÏ£Œž¾pƒ(’º1U´žæ‚õ®‘JJÝY¶Ö=«¼Q·±RÞ�L’¸³ÝÇ(–ê!RÝÒôú˜ƒÈ7›˜ –l.nÛϨ'ð( +âB�Ùp$³˜BÆBr£JÌ”ËR²qdpKMSàë@#˦ڢ6)¸C˜ÔbB�ÎÏÙ ¨ÞØFv‘@‹®-‚ÄÍ#`ü ÙTºª�ö¶Dµ&?ðæcn~–pNüEèÇ=é•r~ÒŸ¹ì;o£àÀóÂraªŒ¯Ó¼jÉ{‹Z³è?†K鮉”"u_ÚlÔFEü&„çi\?Ã>ý¾ïœeè·Š[§ ¢;VQL² «v'µ®èÔŠéw0[ŒÕ�u±{?Ý^)^Î9&@çå]Ó›¯ÂS>ì'¢\K¤ò�²{¥Xz5ëË’äé"1oS!i;’ Û×M–xWtÏ‹­Þ, rcÆ’ijHcÇôBKˆœDԊ鳉a"Ciä‚¡àÛQÎljQ@?¿�)ãI‘Œù“ÕnâåKNÈmÿ­ì2mÔ8>x¡u³‡5Ë}f’buyÏ™"=¬„�$[Nz…‰ÏVW\O#eP!P®Òc¤~HCtæ c7¯5ÒýŸyD`€’%¨UK…�´Ü¿—cj|âŽy�ÑŠµî IC÷q-ö‰5zhvz´ª­ëÒ?*|‡ùSEv¹Ïðëo!'…Eæûð”÷ç®ç®¾!/œ¹ƒy8FL~‘‡V¼‡º$9lˆ°Ío–,ÁPL:£ž^ücøü屎O=ßcÔ=†‡Ó]â„oûÔÁwQx -î+KÁ¢æÔÍÃñˆ‹ÄIÞjé“n]Óa d� f`åÌhhñ��Í*õó¬Ô|pÿkÊv±’ѹ¢-¡š[µÇq,Þ7`À¶?ÉRí -“9œúÙœù½5>º—D ]în�5w#÷ €'?†§°DÔ¥rž2UÛû4­Ù0øúŸ¼‡^4¥di«Ü«RI9­âë¬ ‰¡{þê’+¨�d§Ü­âýÕ¤ŽŒ›a£Ox Ó°œ¼éߣÛl[£[éù‰ä ŦL/°Ü ôÙ›Ä*¥OqåÔY©»|¤DgLÿA-Æj•sRF‚ëP¤I™‹t0<®`_‹%«Èõ…w'Ȱ¾ä Çu2_–ªÔ>nÏ¡Óë’õö¶iš«”W8mh³Æ=˜œ -VxÙ3_w4?î<&ãl‚í+teÈ vrü>ì¤v[e?‘DÚÿ•j]<ÝÝ¡ÿ޳Ð6“áè ) ‹Ä¥ƒE‚ÎD`­G‘¹*2ÏûDŒÉuª!‘ŠbðfO žÇmß@I¶A2ÑgãÈÁ˜É¥_€g›ôpÎik„•P‡-ÍYÌС~ösJå�pÈ;%…ïý•)e2 w_�”Ò¾— -%©ÖŒ‚³6W‚ÂÚÉ•gç Q'Úaƒ[W>Bc5 À‡ÓëEFà" òc [.6{ç¢ý¶·¿æÔKdÁœmßl’cßsÈõŠBûb³9(˜ÒƒöÍI·£‘ç^@C„€AS²^¦eBààÆ@q:ØÊïŒ)š?į@¬"íù¨&5’±UH·M j´ŸÖZ5)¥ád8�VÈã}ÌHëݪ`àÆêdÞ•’C¸/†/Ãwîs~ûïÍÞ/Ž˜ãVf[HT‚ �í‘ӿřº„=×�;š¼Ž|�ÁØš+þEÝÄ�˜ü“)o*,¯î|�ðG“"︥ÓJ»‘yjßšÝ^ÄÈ¿rú Ñîõv@�£ØÏN2C²ñ£·»ŒûHG T‰‡Úí=½%Ô˜RG4¶œp¨}OÚDzX«‘IÀ¸iGqI·K6Î0:ÄäÑû¡dm¿4ýó DËfaé®·³nŽ=^ŸyãòH3D¤àUd”¶àZ™4Äë�YÓ§§«xË0:Oa}Ö�Xé¨Þ§}…CQÂý*ÿª²µWa©_®Mõ0;¸¤({nŽ"X|`KÇœxÛ_ͯ‚®O4TK±)×vÔ\k"VwCI.}»Vž¯ç)¦…L�T¿Xg¨-,¹¯3DŸ÷&q”~ƒ½ÛQ™Ð·RJˆŸâ[ù%]Ú¢ðׯåù÷~ÄÖCW¡¨¬³ŒÌ_lwò"„»­ÜÈ÷"õìáPVÁS;‰­é·Åÿ<¿cæÚê”o®/' -"¦~ëqp~€R)…k&˜hFG#ñ_r¶Œå�ì!ø3ï˜`p}á;ÎÛÐd¾Vj½ Ë©©3gþ7Ÿ¶™ š+Z³äÇʼVùíS¼—&s¬"=4Ñ“ÊOhœüß�Ï?šŒ¿³8kCþC9àºõ²öJ®+h×;Ï]É-œô¯»²¸)~±‹‹¶æ>…›QTä))Ä&QV…ü3QOå`Ê­ËGašá2/Ç‹‰ •î$„�?ŒÒ\\ (ÃÊOe5Œ¢•ylÖuÞØjÍtô;è×t¶ŒÞ6�ÂQ½¢ûÝBõ¾ï›c1Q„h퉄¹aµÔ!p9µß8•eãþqÛÝ—a ýÔø¤k᜻ÓÒŒ"R;Ý eâ¿l“G\f¼Ñ\w_Ô‰F;(ݶø°¸0µÓI:ðЊTÜ€èÚ!Rÿ hþ”/_\Ðñ(ÄùRX páÿ@¥ä -|«ö•>i§2$”`Læ=ð9í٢ΆqÓwªÆ ˜Ã§ŠË)<]�úêfj qÐ\EëÚˆŒï«Tcã¹¢NVŽ)ƒr+õ�®Hq–®­ìÕMpö÷?=ÝÇÉG«ë ¡S‚æü•rlWªÄ÷™QþºGŸ;º�¿Œ*¼—æ=öw›~hdP«¥ ‹Óø—¿Wc{ÔìWóô’ k½=2D³v%¸Îô𖍥E^Cb:;s:ßrO�™êj®ê{µ÷�îÑ-þ'õðYÉ!ï`+¯p§Èë÷TÖ,Ì'ØÞ¶ˆâ„¿úï -n�¾!f\¬ï¦X°’dþ¡—éÜî -" £ÇO§óÚõñ®¨/ÐQh³l ×™ªÞ°ÓÇÓçíŠI -&|<û•œ¥N ­Q.¾SÚ¬ƒ'~Üá.N]b›oȪ$g�,x¾ÈO?}¢¬³Æœ>{}¬(ÛßÝœ(\ýy w²Îôè’Sû¿ «ÿ`(ëXfS¥$¨Af…�IñˆÖ@k•ÛÌG[¼FQ$Toà ¥ßv¼éåžW(}P¨i ¿ö‹×tGÁ -›{<\)… ó¬S' |³k¢uªˆ4“ü?{¯›æuÆí_¦¸Þf¯IÚ÷zOæù•ìù$PÚAIýÌ4…Þ�4ú(Z!%ð°-Ã6h­#ç’.ÂÞV]`®m�†` Gm.1qDŽ4Ò½;Ãs¤Ã ç�5~‹æ™ýjîm«G�Aó.š”]pm4�NaâM‡“ç¿«ºÈ(èFƒÿŸÑüø¯Üí}ü<Ýí}à4ÿ>[ Ìendstream -endobj -485 0 obj << -/Type /Font -/Subtype /Type1 -/Encoding 5648 0 R -/FirstChar 33 -/LastChar 125 -/Widths 5656 0 R -/BaseFont /THDDQC+NimbusMonL-Regu -/FontDescriptor 483 0 R ->> endobj -483 0 obj << -/Ascent 625 -/CapHeight 557 -/Descent -147 -/FontName /THDDQC+NimbusMonL-Regu -/ItalicAngle 0 -/StemV 41 -/XHeight 426 -/FontBBox [-12 -237 650 811] -/Flags 4 -/CharSet (/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright) -/FontFile 484 0 R ->> endobj -5656 0 obj -[600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 0 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 0 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 ] -endobj -481 0 obj << -/Length1 1630 -/Length2 19123 -/Length3 532 -/Length 20039 -/Filter /FlateDecode ->> -stream -xÚ¬´UT]í¶%ŠîÁY¸»{pww]¸³pwww‡àÁÝÝ!‚»»sóï]§Nµs«^ªÎÃlmëCúø9±¢ -½�©½1PÜÞDÏÌÀÄ�·´5vqV¶·•·ç–¥Wš»þêÙáÈÉEœ€F K{;Q#� 4ˆM,,fnnn8r€ˆ½ƒ‡“¥¹@¥¦¬AMKK÷Ÿš\Æÿaùélin øûã -´±w°Ú�þBü_ª��`fiˆ((jIÉK¨$äÕ@; “‘ @ÑÅØÆÒ ki´sRÌì�6ÿ&öv¦–ÿ´æÌðKÈ`pvšXþ º›þ1Ñ€N¶–ÎÎÿ–Îs'#;Ð߀ì–v&6.¦ÿðWofÿ¯‚œìÿzØþµýS´w9›8Y:€³*ŠŠÿ»N�…èŸÜΖÍ{³¿ž¦ö&.ÿ´ô/Û_˜¿V�‘¥�3tý“Ë0µtv°1òø›û/˜ƒ“å¿Êpq¶´3ÿÏ -èN@s#'S ³ó_˜¿ØÿLç?ûü/Ý98Øxü+Úþ_^ÿ³K�3ÐÆŒŽ™åoNÐßÜæ–vpŒÿ슔�™=€™éßzS‡ÿ°¹�þ5 ªv†úoF¦öv6S £¼=èoJÕÿË ÿ}$ÿ7PüßBð ½ÿoäþWŽþ—Güÿúžÿ+´¸‹��¼‘íßø÷�ü=2Fv€¿w øçÐØ9ýÿbŒl-m<þOQÿÕ[øïrÿ`R £¿c²3ÿK Ó¿•–Îâ–î@SEK�‰ÀÌÈæïÌþ¥W³3:ÙXÚÿrû¯±è™™˜þ‹MÕÂÒÄÚîØÿmÚ™þ×þÒõ¯úåä”d%Äiÿ7ö_ŽŠ¤êáð·¶ÿÑ�œ½éÿþ�¶wxÑ3spèY¸˜ÿ¾¿¿q³°ùüoRþ ˆù?e9#�“¥;@çoßLÌÿêþ|ÿ)éý1;{ÓVGddgúwÛþ§â³‰‹“Ó_’ÿuþvýò¿ötšÀ­-Û›ð[¥ge€ê¾å OŠêô÷2C‡8”5ªúר÷ø¥‡oqW¾Õ†04Mó|´y,�8¼ïIÓì�öbÙPö¤/ -ð}H©û -Q7(:8i÷õË3N5¢½.eÿ@is0©ïoO*)ë—¾ALw°:Á^>Rû“ºúc�=8 ùš¤5Äav¢4�¡Õ�œR$=>PŽ� õ\éÛãÍ�ûJÎë -…Hå'¨­Vé‹Ió}?^(QêfoÀHëi_F…Ìb×X*îŽ[×úPt¤ôŽ2^œù§o_œqþÌHqÝG™Iñ#H²Ä¨:†�’øò©Äa‚U¤“hžÕ›¦Ò¿W7ž²n»ÿsˆÌ….È�Ð7Ïù�4èJ{•˶¼;â†ñ¤K†˜ŠlßÜÉ’‹ÆÔ�¶¿œ}ÏŠZà‰ -òÜ1A±ÄZ=6 oБ®­ãõ¨lÓû¥%Tœ¬‰J@ƒÁÚ+bìû,ŽÈ¢ðA’d `û#**¡&¥Qö{$ÛYl• °¥F@€œ,Ô÷x>Þâ‰PÄéNþ¢i¹ûBîY½{¡Õ/8Õ‹¤áÕeŒëNÞÉÕP•ýz½ÄÜrÇË!I8W¸Äì5*Ø»½ø|¶ÕÁ÷’Ø7¹ì9…þœrõ¨îëã¥m^ÂaÔËa—E,Jãzæˆ÷æ‘D…Üè™;¡?Å™§¡¥‘Ra� -ù -Çq.x×Ħ¥F^âʼnŒ¹ÆÅºi™ªZ‡™Þ ’ìa[Öíá²}Ü[4úóJÁ§gŽÁc•·¹Ç5~X4k!¿d ^x3T½°ÁWsµìb&:0Â#DZçìÞwÒ¢ç^­ɲ~CÔŸ[-óÙýy#”‰ï%‡K«±Ïq9í©©*²ÜÙª¡ú•¡È…[Ë#ƒ2jU˜ %}�œDâçëúÁ«°«“ØÁ�ûkmëôªð[H{-0í¾&hmEÄLãPŽâˆ[cD,"H„RÛÜŸ[â!Þaߊ绬ñ’Wp•¿l7²f°ˆ6ÚúX»�t‡3ík ©ø½ÆfɱS;,WÑÈØ©K…ôÄüê®ÏžxÔCu…9Oˆ¾pÃZëÐËÅ�>r ›L}Tù”¢ÑL½ã¡ˆžý*(ÿ™G,6e༈þ¯ï7Ip�ÞXOÉå ªß [âÙ8+Ì�×DÊXìɤåÚ+ãYÑZ¦Ú1Á¯øß<Ïó¾ÈYL$lÎ*“�ý.Ë ^×è?ý+L“¢X¸M×;o˾s……\�¼åE^˜ôr7y/O²S/´$ä7¸oÍ §�ø3n’" «ÙW1H‰è]sj¶d6…¥ýf½¯ª5�›Ä n(Érü.Á8`Ï53»ksÌL§g”à÷k{–êKÉøe*ï«ÃdÉ9r½ÂǨYA ;Þ]Ää-§»8<þ§x¼%ýïƒÈÄñ—2‹ì©‹9øCë!µafôêj®GÏɃâÄ�…¡)^ý/è%ßgG4ôÔÁ €Íò=p<’wˆôA‰dm$Ïòë›j˜£ƒêÌ=Ù£?“…Z@gÐiŒoG‘ÛúŒáBIÛKïý‘‘~ö¥g`îXڸߑžZíÓvk༿]ÃBN…ŒJ›±µ°ò¤V&f¥²=S0áƒ�1G¢¹ž*7T yi¶‘Lq¿®kÿ|7ì‰G¾÷²‘P£ý•iãÂ0ø9ÔÒ8+RÏ”—‹rêŠÄT…Ç&IJ+8;ôšnÚ#½Í‘"ñи¾ÈYCV–ûî–÷RÞ—J¾�cé™&…AelétºhÙIS£Š,~Ù&UÚeíªE\Nï[hR\5mi”T$`r¤é»h:âšù²ZE~HúÌ—R>vCjJæþ--jí C% Ø«$¶FcŸ3Ûç…á$Ë÷Èþ3º"ªŽÛ{÷qfn§�h ’¶^q^ç×wÃRòº¨LL5“.ƧHb¯KD -%Ÿ0M­ ïY;q�Í€Cd¿Ï€�JDF‰êÝÞ¸Ó;\~˜É2FæW„cœ hHqÍ­-Œk<&î•JzÖÈ<à¢\S×o Ñ<´gåÎbãÀ…íè`]jÃx棄.Ê~§™_ý¾1�)�)ÓHþ8Û?'Š/õN)õvt~¢©ÿ¾í½â Õšbïí¡áÊä8°&›–`çMm¦i£ÛV\qÀZ^qd'ÛN[¹êvÄ/³VŠ�‚tùB¹)bN1fm”l^~M…ðCúÇLJauŠç‹ŒŸ‡ìMeÆ�#J^:$Eµ]bjÑŸ-ð_Ù#Làq¯Í&)[*w¡û§d7÷4­êTN[¼r8퀖¶›B‘^ãøØ«¦£ÈÈ·Tî™™÷�] q®6à©8}?Á�s0ª¥kðØ;2Sy[%(JW³}T¶‡`Ø(ŽÔŸ'Š+š5ƒMRb\³û„ãÎÖUÙk›0t¿ÈÂ�?È£%®YÄâ¿»ÑV¢X×ÒA|?Ž–µ3,ûÄP‚£5�¸‘=!oÁóÐ*nЇë -n®2/Îèq©Ž¡[íØƒ ²×K$hÆ>`_�ÝÈc¦ “æ f}½ªpÜà- ዯ¶™Óœ}³÷åÂFk@â벡>¹ö�ç¶‘ Uè€6× áœRxaÃô)Ò¬;-¦_u%ŲaõTŒÐ"ØàUuZ»ÂS™ÆÒˆƒ5‰‚Õ}œñgQAV Êüš×høÏ¡‰o¸!__—e¢%5\nøÙ…ŽÝñü -0æÛ„wãñMáÝ 8%Êñ<˵|�žúúcÕ•|ôß_¢û T;6§V‰��}‹Àó\&Rp¬­n¶pD*£fY�Ze±, xè÷Nõ¢œæýÞ¿xÜ$‡.>P|·N=2ÿ²{G.ƒýÈw¦ãîãÛ�Ce¥±fó“O˜÷È+™ÆU¯ÒjºùuÚÓä%p�Ün­){„üÂ~—�´"ÞÈÿ¶‡À(ºØùT)[/nä’m®Iö,;§4…Cµì´Â³�žÊHl•¶Ý!N”æ/P ПMä…F*½(áÔË]ë=ضûsæMš‰è½9—ywg<Ï595ZÒ4ñ.)Ùø@‹”—׸¾Z€„ ¶42Ü$B=wV—Æz�ŸÛAoÈ?V)¸­;¥ -å*¨zwÄäE[®m[ޤ5º÷�¢0ìA$ [^9'oYÇ4š•Á4&cN®ÙIå’<ñàj2ðäîl”££œÑî%Aw ú-Jѹ�•ªazY5r…ô�”ÝrdŒéÒ+EòJgÚ—ªîÛ™u„3˜›0ºï�ótW¹9 x¼mm–c?ååd{áà -<‰Ù`FèÊ�íå­óܵ•ËVgkã˜ØK-oàìZ﵌ØT¤™u8©".»É¹éœ4ݰPߘã†Á1ÏÊ´=Z–Ñfˆ^ò!jИ; Þ}LÈöêM9Ï–}ò8ÛSäø©:‡ÝÅïµ±xêulSÕªi„�žS ‚)å(CP¥_É>­ZŸìz7¼gÎkéÎÓŸÌÐ&•ÚHÄåõ�e;wÔÒŽÊ7¥Š�mñ y)aPøŒ6âBï‡áºuøß%'æU¿p -iý1gƒ&øUn™D±ë‚=ÔR·€[ÓËáb%m›u‹åÎYäsÓay³ÀtƒÇsy§w�Qm’óºÍh§Hb½ÁGEYWªmH…oKº„zÓwYº×Â+PSÅ©Ž¨çŸø5ðl«@@êýHšðŠO·j€ Ú€y°p �-*3Szœ¬@|�íyœö«£¾ò£ûq¼õùqÛßX<¯‰¸쎛f:ņ‘Žkû¬9âË3ß'o%’å$”ÉTBi°„)SÙø‹ Ó^¿L?Í.·I&)„Ä_(ÂEÀU4#(¸b<‘7(\×âMÁ`®t�ðFh1ÀX;Fò4‡Ý�&„CnêKw¾™¸CbùR��]+'v©Í…A¸�I[Çé±`}‰—Ä|H ÷;Í�9”e�Ñè � -VD†â‘:‡W,À½¥C ²ìˆ|J(û-oÝB¨®å�´pm»2Î#¡P„­w°¦$B=`aC‹ÌÙ:þ‡*ÿz);¹"Ú>•ê;Ðv`IÖ�ÊÍ¡·Ý+lm‘‚·ˆ >Îݺž³ö�íöF,™ÚFÞ -£W3†ÑÛò«¨%‰†œ^lu¼5ÛËSê‚ùÆgAÔ�JQý´Ð7ÐÂdM,7slm®Ÿç“0;º†Ë�Ž´ÖL\ø¦~`s·|OZÈ÷kv„ãe‘. -�¢‹x+DA =šö éØ*a/Í~¯»ç耤o9Í>ð–Ãi¦.SÏ6ëÃ@ŽŠaS⫯|†�ñS0¹/h݃ÑÚ‹(|™Ÿ65qŽŸS‘­á–¨»vh©Ä]¬�1 “;Hêû <šSØÊ|�-Ìö‚ßuýYÞ¶šZYî)V(¦›>@yï'Jž1¬žcÝÌš’Hâ]ÏÄ\?iJ¨Ðo¶àš8ƒ¹ALêæÓžBt&»2úKÝï Êà ðgÍ•éƒB•êOÙ16D:§y/çÑ@ã¨*œÝ�m½óÅdV–ç°¾ýpE`iÓðTsÐMöO:Æ`Í@âðXÌNRR ÷¬ÑzòGÑøÈ_\ÆT^¸69¢¦‹Œ³ÌÃ"™Á+Ϩá§jÜcàuüE¹ûœ�Ò+|úQÅØ¨†ñVqR Úˆþ„•<ªm�ß/ÐÒI ü�îWäL¦£Þ|QœÍNãQÑ�CÓUGñJ÷)édYÎq§³™~uñ)J�çPÂ4Ê£o]NsÈÍB³\eޏQcpKª}ª oÏ–¦x“ˆ'^8æ¤û&‡8–f;`˜s0¦%3#l;̪½oÖËÈ÷ê»ý‰Ê‹ ÕÔõ0ìÿ”öî)ÊÍ$»ßx5m[be‰=A|Œk.ïfš�¯¦JX샄»N2¡½Z�SX?o+ÚM¬…å§æ{¦‚ðïøë$?/ ¨Ê…Ù2Bi9×%wU؃³�Σò�s’ôãT¸çj}Oé$,EÂ"¶JfæF½¶­s8šaÀnË:œ½Dlc0äMïÌEc * F“ýË!‹hŒ'Úgmæõ±5—8ë E™]úá=¾VP¡ñ¸R¼b%EÔ–ŒeAÐÊÛb€*°#Ò+výðPƒo辶®ØB4mº4Š¥VÚ©Ú¢ 6µæ†¢ �%§Ÿó©­_�ãçðªQ\×\?|óqž˜ÍÂfä€Ü«ºD§èÆâÒwŒÊÔZÁßçøxf˜† ’ËUV–¾¿\ ÍD$s�lrð�pÕRí���ELJdÏïtlâY ±¿ÝMm05�ò åri'è>œÍAÿ˜£(Ef -{Y€L[•Sò͘§òîЪ$pŽÎ�¨€­ŒJHƒ¿P³KšüH¬,̲'ê+ÃЋ„ö©L²ÙÅ}ÖYŸY˜)¤ \ÛèÀéu–«Û9Ô;o7íá.’·X£�¨¿É�}û.«çįo‹H%²(Ͳån¤s"aN!áïEfT©îæÓì2‹û¡‡Æâ¶ÇppÖA²óVÒ£%¨!؇Ê{lCÈÕjBwM�[¼hoƒ;¡Tû8Žž��?9¼†„^ëùÇÔ®|ž:ë“v£tyƒK»¡g/åGY#œŽ;ÂÝæÙ/|¶Äkrp­2¡Ð*®ÁXá=Î:rê£Pú‰°÷GøÓ%�N}º‰p—=•_}’oQ -zQ¥‹Ú_–Hd~Ó“›"âC7-XpT‰îÕ&€l§·�6‡Nrá ãY¾4z¢~w�¯…?é÷—g°’¾£Ü‹Ò@²©ØªxT¨h¨àÐzƈL�Aú�¦…“ObìœÖÏ8³Š†•kNÝA!_Øß1qÞfMÚn,‹(É7‹Ý)»w= Û™¹>&XѨ4ÓvæÙWÓVç²á:ã�H?EN‹5š}©êäm« 42i¯�€Tèóú²€¹‚2‚ø£¸æ\¦`OIS|r¯uʽ^’ïJ�wÁbf{À;ææ¾È—ù0/]Sp¤¬è,éë•”ø‰ ºâæóB£P�[Œ[&—…÷Xn¼Åùæ@/yý þƒ�P…Ž•r?ö¯}S jaBºÜM[ñI–ÍtËâ?J‡�ËÞè<áB~ºh¢º}îë3¡>|ájn®eå3.ˆ)jÀþŽÔÕŽ .+:ÌÛcÆÔh®É)q¾Psüf¯¯�|ü”,ΰ(æÊÔu—˜ñk‚‚Þ“Äý‹ W/ HùGþ}16H=êÛÂ6Ç0ëqxú”UˆæÏÁ‰àgËm³ƒ¾—V—Iª¶ fͳâÄ�b™½Š:í»1ÇM@SE_I¿ù_ø7Ú¾6;çãuîD¦Ì,õÏW.³ÿòûøÖåp?ˆìífQêJ`Ðî‡Å^1CÎEtžR,p56�ø¥ NY+™Ï«ø{M½»@ŠTËabýk Ïçeò;í$´áÓ/‰™´ÅŽ|hgî0Ÿã¦…sýU䣲–QÄ�ß…ù,h-á�^µÞ%¶¨- -SßôªN÷áx¡P1„î°Ýz PMåüxrÞçÈç˜Ûxa<¶f$þEMJÑ>ËîŽCèæ×sN7À�£FS (Ü¥ÓÛ!йs8d‡�àìb3USK.O@ ÈÄ’t¦\ç«’€à1ç_¥�Ôx§òêâëÂŽãBRaÆ»h�(U([ÁÛ÷¨ Ò!÷ܺ�¿ #­kwQa$¿š�Ÿ±{ò·ƒ´Màwü#Ž!rö™͘Áà{�Ê<öpÌÚ[Ýi¸ö½ÚáΈbfm«ªÈX¶}2®rveñÒ¶Q ŽÙ“?F—-¾Ý»ªVcWÁØóû" Íx3¼£ÙÆÖçîžO%ÂOvÜ ¶ÎÎFG„•âžÂ‰û™¤m' å -¡�’Œ�ì£Ié2o 8^Uâ`½íŠLæù»ú<͹yô‰YTÙ(©0¥ÔþO¼»ErR÷Sϧéž­×_àX&rOnLá´j h$åôjU ©þ�»u…�R×~îrºÐܶpˆˆ>u ï;UÊð’ZÄëLjÕz0ߊôä¼7VšìÞØt,4¢‚œnÀ{ëm?éÞâiZ»[D¯”‰÷3›Tz¼MÝÆ¦N’JtCüÞE¡Bº¢#X…†3$ê�½Šö†,ØÄÞÓ»Æ�­š×·ð¤euÙîÒ\%¼ûB8ª&ç/�L6»{ yMpW Êt¥*¤†$~–Ì(¯µ½cÇ?^nj=/7F9y<Ï¥Àk¤ˆÐ¿+žE ùUp2wýÂc*YµŒûcZë!ûâN|sC6M„ËÝ,Ÿ�¤`5ŽN ­¾ùK:”7SÝUgD2SR]¾‚ØŸÃ+Ç$ˆÝŒp ³: l´kr±Îô§Q™è«š:b5›ä]ÇÛ²ÖÁ›ÛLiùä¤u;A—^Ð…Õ-ÞeóУÀÍBŸ[޳  -уÑè¢ñý“ö3ãzr iAi/ ‘\.%a‰öÑ -¨q›Ð®Cÿ{ÿ´âëâQ&øãà'…`•‹˜q̧è2÷ˆ¥bËÌ"—C�|jùÎ{¬]ˆZƒ•ùˆX"§‘‹Fùˆ�$ÌWóqÖg;vuµÉdøÓð‡.¼LY9b¶É‹ÓTçy¹�ßĪ$nÃW˜$åç#¯ã�ÈÞæ…ý\z{ªî/OçN0æY‰f¿‹ÇX¾!Q½þôæ=ÊXŸsIǹ‘°ð ŒŠº�'?ý‰brcìR_yDød®ÓÈš KƒÄºî‰Q*ô•B%źN¸ÂI„Ró1X«¾¹ºÁ‹®á@°…ù.š ïKž'Î6òÇ&ÂxÆ+‹Ù>!râ ¯é^(; -JÚãúW8T~a¬-æö7ÉN±Ø š(ì%i›U®}B®C=;žžo¦Ç“Vb[?¨táÝÚ$õçm$ùãñ‡Þ‚" -âçŽTÒ»%è{j±E‘3‡ŸÆ�'Jò“)&›¥À¶<7.Š)Q’^ßé«Zí×´‹Rô–Y˜šúiòE=Gs½¥»~„×4ÆBPÎàn›9kNÓ&‰BáéþáŸp©٢ȫ`÷=JØ#‚ß|¤îžÃ/~0ü”e}ÁO*ƒ�h7Áxd_¦µð3D÷Ïyh‹yË¡G(…¸Ù¢rUoÃpVʈ`À‘ê.>IUù›ò8± -æç&:éò0̘ …_”§j¦±á¤ $ì¡OÌù×ê=VÁ¯ÄÈqò4wÕ8GýªìAâk Ü[&ü55@D{¶J^³-i&î+z–:N^+U>×=­U~ç*HnVV‚^ÚG¤ìŒ`ÕF‘KôÎoÊBJ Ñè”ç—£‡¡ðÊRŽ{Ë@ŸÆÎù­æa>óÊüÔK+Ìi›§ëÄØêwýÍÕW,ÂyrSt+¨TÑ,ñ) âç ˆ›¨–ÜIª}p¯»ùÉCKòKÚR-´L’êÚ–#ÿ÷@ ö›*ÝÛ¡]¹�ä1!ez9_wŒÅøØžÂq»Ä{õ˜ìB=¿%ª~)Jí<êjlÇùîL=í§`qòýë˾”~›À(xY&dÃÌcÑ ¹Ý&®aa�ï)³ix¤cƒ‘§ÞV‡ŒV¿¶€uëλfq\z$Xåe4+Ïõ�Õ1£÷ED[˦3VËHô,–Qóaÿ=�xÛ·ô㈀4 -\ç…YÖ¤‰:8 Þy+ {ÍáŒ>®÷çi=·i•üë®Z?wJ©œ@ŽÙWO)w:Ê8QýÔ”kø}Ÿ½’ñv£¢zbà ±ÌÕñmÇÊ€é7Ôã�ïša"Ç<Ë#Ó8‰_ôpÑM6YwHÉËšV4_Ç Á¢“wßÝ ,™Hn!M Ä0B2TøgÙúÐoÃfa§:¬J¹Q/ו.�˜2X¿`2ü±Ä,Û��®ç3æÕSuµM#Ë65hqÞ§¶þóe>qýd‚d¿Ó"Ïs¹e_óúxh]6=¼ $4,ÃB :ãƒÀó´ºD¥2Z¨ ú@ã·ÿø’H _ßJ3úÄcYR0AAõ4Ê™A̲mõTk QßÌ-T=s—ßÓ›fXíeT½´‹Úk; pb|a[B?ØþI�ñ‚W ì -™ùuÚpª]ÜÄ%âé(¾ögzÌ7j[Eb ‡’•Í�xÆû\ÞÐ/r÷�ïO\êúp±/ŽR-÷i>dŽÍiã ¤ò€+` ;(CžÝò\™ñî$K9›3œ'Ck‡Óï¬u>’]ð2 iÂûÛ»µ!ÎÒ¡§F{v†±d§ãO¹SÛ2¦Ä›”åf¦Ï?á‘q~‘9":_²`âåi]9t”ËlZs‰ÚxpÍ�‹ hËÚ=¢_J(½vËqÏÆK« %|u Ë&£Õ8ŠMá‘]zU!Ÿãä"Éb©ÒIæÑuöN•˜ìSBäÖÚrjÓ¥=»©pÈɵü­ ‰Ü�ÿ$:ÓY¢2Lx��˜b}îtÙ¦]†õõ�é‘Ò†zõ+ hÆ]ÃL–&+šÙŒpgÏ }FÜ·¢æ¦Ïÿ,êò5 °ò@LÛ³s8¬Y]zhttÏQ[†‹ë.í„F?‘�òƒ©<Á«šuÔ“³îW÷ AuR&~ä ®ÿñãɺhjžk hmÏcÖyNXM• TkºKïˆ^î:µÅ«Ñ#"å?Y /\sÿànê�$µL×ø$©Û4çš_&ckù }–ÒGVHßàakUë�öxÄ&²j`U„~MîBŽEÒ¼qdN‡ñ9EŠt2ezI…(ƒà>ÁY!ÙÁ�£^ÙÎwÎ5à®ÍØ:l9)ã'–ÇõöׄȺ®ñø(\¤CªcX VÒ¹£sÂ%˜ÿô½êÙhü‡ï–ÝÈt�¤K¡åyÂqÇ—Òß·ßîCrâ3#Nð…ãm1wŸx#Ž�&œðFeq³)©CFQÂwžÂk¤}*�$GP¿:jCäS CŠ·@È)3„èäd°™Øîµ0šSsåw¿\9­æíòZûƒ´ä°\•~üÁ€Ûö966)ý>Ž%lFÚx„µ©7êEÐ,¢ãûË$ ^‡wWÇi#M†¶Ú>îjÁøÌ׿¨ÃŸ‰Œ–ÍÂ" žW�ϼ,þèÇwy1–DˆþüOLƒ‰¼¦÷ÏQ W•q•PK•ìßz×ÁA.ÐÓE®A}Úˆ||�¿?¯Jwù+�ÜC!ú×TG‰Jº÷¶abÌÙ-9͘ÜzFD°Ÿ® ti:Zßq¹f|B‡7É]1u½C# íD0õ›°ã¡âO“lµ]Ê«¨eÂv´‹IPø¯‡Ò¸1sk­íûŒ>„ϹýXÀ`s&޲Szbè~´>œŒòOöm�ïÑ7h‚ `*¨ÿòS:iëÈX6 ̪Êeã3åÞôÔ³lu�Rô…¹Ë£e„ÉE¾i‚ª3\+Þœ¼3í60GÒì¬u…øEÔ\Šó\·„Z¯~DøpCQê �´¬–ÇÕP$£�¹Ã羚áÎìú—d…üôC|CmKâyé Æ©ë0¬u\�m²Íž³ØºÔ]}Æo«vÓø b2t¯Ä„ƒpÒEýw;²G2÷ý`D£Èc¸uí‰RÇ??¿VËò�ßÓz�͈/@Lø„©‡G™»¢H ëîø5†µ0˜{¶É“Ü:Í“Âßµ›R=�6ƒùÓÚÒF:êóO³BWOu( …ÕKn‰!º¹!j·>˜±(òg¿ïŒï»ä¯í72ü®Â—sCøH(x�Z1ìcywƒPð„“nÂL5—±Þ¦U/?¸0èa�ðÏð¡�~½lASåô×óªòÿ3p=ªÏª÷V9Yˆn5>¤¢QÎA¬A -áÂC¾˜ûLŸ&zQïZ$hÉC �þÐFŠH-ÎN’Z¢Ï|óˆÌÀK7ú85á'\)ù°ì¢¬qÅÿ:½›´Ï¦Ÿd*‘³‹Lì›$Ë1üؘ -]Æ‘–š­83 GÜÈ ‰IOòô¼¿Ù^}¶‘Ï»\ºŽFïöœŒ5x¢ZqoÁ¯J:(„M?Õ·FÝ%eñ±¢î -n$[}+Y{"ù4TëAœño£ý#îÒþ‡•P½€YRy¶§% ɦ‡! f"/ýДû`èÎé�§Öõš²Eð—“¢8~Ù§Ò(dþϼð+Æ–8ÿ½Kyìß#·X1³z�±m¬Qá†0Ù½šhÝ¥Ô>§`¥OÓí9YÞüªhê�ûž ¯mrµ w¬žpL Ï®@’tƒš•–‚Élu³=ð×~YÕòBB1áÈ´¶‰Ñ‚“-‡Œz“0q‰±`°Æ¼¶YxwÿÃ_õ&Ù……¶Úª5>^?b4wΠ’Ôe¸î‹ô—[¥'ŸÈ?l�ÆU·Îyž§gš&l4IÊÁêà½g_&Ú*îp[)8»†Q­ ¸[1áuÁ2m/û—/Uj$«}-usÓ¸¥6xŸ¯ŒzçGPYhâÂz¸ŸíI«Ô°vb;@·½å8ÁDsoˆ>öή­Ãé’½dɱj<´ÓŽ“'mMÈ0®COþZ°MýÙF’�”‚…MWÖU´cž?6! ’ñª¹[)ã´jh]Ÿ™˜ §<ƒú憦ÑÌG¤Mª>!ÖøôÀ½KIºö;-3,fw?ŽL±Ÿ“µ8�DK(a•$-Kó&%µ¿Už‡˜…áÙvƒÉ&íÏà°�RÓ=ù”ø{$â'1_p‹˜òyXçÇô&Ÿ{»Ž+…%Fî2Òx'›Ëç^,¥0¶ŠÓü¦Ë|.ÅO«Ï•äî@9BÒB1ì^?A10|E-ÅåþÀ¿Gñ œ©Ì‘v·ÕnÁŒbLÀ)ü¦xŒïI8Prƒ Ÿ—¾iÓ |¿u}º–ÂwËÖo`àŠ„»‚"�#õìy¯f€=¢@ж»¶Ö²U¥±üû·j�‰߀ŸŽ—·Aëšoø¹P|ÒùÒ¹AË…‹H(iy+Æ9Åó¯7Hb§%«Íã.Þ0š>wêVbBMÍh‚¯°U3Òè²emJ„]è%K˜Þs�WïÅ fÌ­üŸ¢KPòåÐ}„ÆÈL‡Uæ£{Ó�* í–ÍG†Ârí7„³ù=áõi‘ø7þZøä1¹TÊ—7¦�œO¼âg—žëó‹ßO¹çT@Á Ï|½ -þ4.l¹MW†!�jÈÆ^Û"²É›¨C—: Ÿ«‚ï`�ƒÑ�ü»³ô–ü¶;ÔùSXq}^DÌKt¸÷Â,[ãú‚PÝ Ca ï´�E;õu}§ó# u²¾@Žþ)œÅ‚c)¶Zz,ãgC8ò‹6®i6Q¨ÍNgÅ«ý哽IîóÚì’FíO�¯x#.Ñ÷_Ó°(¬ý¦q®ýjzæL"¾àÖ%åÁ�ªÀ´3�à—ÌiH=³ÌùwÚpHßÄÞ»‘Šû›…a&læ<}Ñ¿å†ÂúU›PÓŠ€{”œ=ašøOû%©  SêóÒi5�&H5Jê$9!ø®Ë rû˜‡*­gÊ4±öCŒ#>ÆøUê .>ƒÙŠ¿ô’#T“Gß.dõÝÿ:¶Ãõ̾÷^kkô–��mFoÏ’†Icû¤jùýu�-?/ù�†·Â�?ŽäY3ôçµØ$¿ô÷‡'ÇÓCÅ8F$¿ä)}‚kœ¼A"ÔŽú>påÆh •°ïP1<]¦à¿Î™2Ü£¡ü¸d8À,O3¸H‚QÍ‹eÙÜ¿ƒ*&Ñ\Gõ°‹ ’÷›”Uæ�£íaô¡„øÍN ¥€Br›’Ð{Åêø`#<ŸÏÇA'E9°�FCK‘1ÐÆ�•÷ó⺔5d‘ûèó¸PQ¹Iz ÃdÄI—q1írÈŒhìÚÊq(çQI¿:r�`6®*\�JãÞà�vï[Ľ{÷é Â=žˆÅ‹Å£ójCÞ!:9j–Œ”k¸‘jì€þÚ¹«*äÚ³8ÃÆ` q/qÅKáOÍšüêuÒ²Çj;=„ñjÎxïFä­¤'’QC™EK£”D6ºî¯ÔNv½]¾ó¢hÃÞ3áø˜r¢±9Í» -Á, mm o_Ä¥&ö¡ƒŠóñŲ£j ´ÄµV¸â´øeŸä×ý²VÇ©Zµ€‘·ƒ“Ž�}q„�U_ús#ë¦g›Ð«‡f� a“î,®ÚÓ±¯Ñ -ó´j8Hf )»»¶Šº‚aÿ<Èü7¿…שÀ%›+ÜÉ�˜ÜZ?,Ÿêë!û|opÒLhó¡Ú¨!9â9¿ÞXY�ödz/5 ›·ÒK|ÔëUá3bÙ²<ö¯Ö(åŠïó ž[&œ¨YtbÖø�þÎY•Ä @]óÜ¥ÍtÓ-0 ¸‰ûN;v?1`e©©ôÔžNVð�=Sv¡m¹Ù‘ò¼%Æè5g)Wú�¼<(A­~ã÷¼ê’ÝÈ¥Ãéb[îöaÑü±Õ¥xòÕ§ ØÀ÷,*.}GšgÚ.´GùÇÞ"¯?÷LÁš#w Ó¤f®QºëÊ �ÙHþ“ü7§­ÇX2�Áì:@ß˸µâf7ÊDýLDÎUxÂvö L6ó²îºßC—�*£š„¤0X¹úçÑÈ=…›�Xã‡bºUªÖË”wK&ŸØãPyá#Zª›|ï¥cœÌhK´Wsÿ\[4û„ª<�¿ ³t¬ ÅéÇUé(ªÓ9«×®(ô§�ôìð*¾Ø³aÞÊê¤Êô€7Éd‰Û›×*—M�§ -ð.ÛAÝ�¯5µÇ 6Òc±¹P»8 ®JXKŽDƒmÊ0õ‘�˜a¦]Æ{ü*ñ&&ㄜÁ¨!ˆÊ‡%:s=êXú\¨®+å•V1›\þ•»mwœ˜<ÎÑ£®ì½É=†åróé…žiÈ[U¬ÑxAïš[ºkëØ‰º¡ã¶gžOƒ…úäN»3\•QZ÷Nï¢"‚¯ìÏìuþ•�,ÅS¦e¬ÎyÝè­�­S'…`*ð÷ɕ͊®¹éÁï>ˆ]|'Í؈vr­($Œ]ë`4ª®öæ•Ù“HVUHTR�Ó2GMj¢ú:çŽ$°‚¬“ä~i.3 ë⤭_¢ËŠUø»Xü¾Øí¼Òƨ~ê/ia¸Ž¤ŠáaöWÿŸ§Ò$”°,VâžTn�2Ÿ-¡6�õ_6ƒ¡èúüÌr.”¸„a�ئgáP7[c/îÛqCN&[õ‹XäÞs ?©ßg­)÷éègÊÔÍM¢-ôµ%Óë#öÌ.­ÞÓ¼ãT ‡|_„NµØ8‡cku¨gÂU2Èü} aKÛ�`'L–ï&ä$±Š©.åýyNŠÜ—³‘w_J‡einµ–y¹µo©ºµgºt£kžpGníg!¤i´‡0†'BAº†¿CóPU¤z?¡œø‚{ós63J‹d^]7-N -†^Ø_'®£'t§×®Ç->ü„o0Â]Gv&«ÖH,æ\|i±×çýúL݇ßpÊ›·|bãhá’¨=C0;…'…B@¿ùÐh'Ò|¿ƒê�scµ—ÕêD„’ɨWÅK)”‡bs…y†ôÊg±ßDå# ƒay9ÍE«Œ ÃíýºAkO[Ý" (<À—ìªk~ÀGó§ÁËöñŽªØá„éMßúÉk6Á‚Ѷ´Qn¸€�µ¼)ÁU(hó}�+CÊ{%¡ -gÜÞö‚J^úyò¬ÿKØ“zvÎãßÉ2R¥’ጛµ)¼ôÿ¯gâNUJè$YÇÚnõ†ÉQ'Ú[wZc∌(\@®Õ´s¤Fòão0¼v–Á@Žœôò‡VzNý»%.*ÌÜ7¦X–†xFÖB§g‡F·°¡÷j2@­Crõ2¨+²Eör£vLj�Th±òcÞî}� ºš{[`:9ªm¬‡Þx{$²Ô‡A¾ !´ᢾ• ²±X§ìÉ·ö-ÿ¤j˜åá0çòoþ?¸�±jè�ਠd“í Ö¹et�a2°-�i2Z’7R°Uc*¦Cªè\Çí=Do��OÖ>…�À �<ÜX‡“ï×[gŽc{ZÔmfÞò¿wás²Òe™UÃ,m¬z¡v‘ñf¨– §SÞé X½wˆ.7�æTž^B.U��qÀ·¦M«¾¯F/Õ˜ßP�•XÜ鼿ÛãIÎ |Ø$ÊOÈÙ¡)>7 º89Å:A9I3‹ KÙz‡ ò)SIûB°^øõçÇñðÔ÷o÷^çþ.ˆÝ¿$?‹ä±–;Ö´ÁXPŽèpxÊÇ7‹•�j¤fÃù½²·ÛIÇ虲´'ä¼K"ó€.ù½ÉŸQâßĶ0A.?§ìl�ÓÿÏR®Š ÐÅ%N«ºûô3˜Ë§·Fò9ÞbË©¤²‘<Àc¥¾�ä€Ã±æ”òšßVyžþpéØ"MØ+¥ƒN ˆoÇ–_ÂÕ¡”<ØÅx ÿsù¦v7ѽ{ây…ȼkOQùÇ!U�/³WSÁio(Oï«WœHšJ†g'x-çË·Ð4²ÓÏ0…¼g³Å+m‘‘o¡c³_œÛ—1ýMt è§©yxq¤S³g`(ãÄZ‹G”0°1¡pÞݧ"¨ 7Çiém´Ós¾<£ýDá+1rlfI¯�(•‡¿yU>„É7ZÑ£°P­ÅÕ_.—¥ª“¬^ŒÂË‚– ¸JÜè>]Úw9S0E›inhN÷ ¯k0~xp„&^Àg]°zxÐRh-_ø†½Y÷tN£íYU[ºÎàc¹'#´¶ï¸� œä;*Â(2uÛxZ€ËFnX’¦(î�ÇÞŽ½Ò0Ôòf'éØT÷ØÃiã² "o¼•l1j�”ÅQXÆÛ©?ãj�Y{ã•JH÷ 9Îroø‘z‚ê…/~÷¼:ÈhGW†E�I=¸¢.ƒ0[¬GQ•SÇUÿ°ŒU0Kë§Ã÷ýµÀ…ØÕ±šýÚ“£~k/,ÄI„A�¨~Ñ?�,4@�*`7ðí ºù®3€d5»X�ˆ3ÁõC WÒÎóñ| gŠ`ìz÷óš¡fÊc+TتV¹;ùU[ÿwpýþˆ8Iîp¬üý³Y(WÊൃ 2jn¶é±aí‹�‹’‡ÕŽÃ&¥ÒB(réö›7Dk�óbÙg7¡1�ý"øžýìÑ•Fgmý2ÚS`^Ý ÀœŸ`î3²vÒÍ(ÕUuãQzįkëÿ‹xÛ¯²uqáFn5š�ª�¸–Iù ó˜'ªî8â2J'>5hš†f½�óõ.û×=CD¿ù…|DLÉVˆVËì¸YˆÏ7uî\j¸¬nFŠB­ŸQ^‚5bIØÝb–¼ç|ek3²Šá­çPYM -9Þ‰W‰ßƒÈóO{6D¥¸ ¯×ù0Ï‘øƒ�ºHÞuâ´´Ÿa,kZdÑ0¸”h,ïÎX^p`¾ÿÚÈÞ(mBç|>³Öp)„Î�Âkõ2™B ˆ/ ’‚Úe©…>QX‡LBæh -óø³WE÷bÊbøµËkhcÂ�ž¯™ˆS4>zŠOÎu[yåk88ɺtå\Èlçè� 5¿n¿œ%ä *†W�øJô5œêÏ…94=È»Á_V÷ŠËl»jú�Q¸kžÌi¹Ž§D{µldüO<!‹ÄotôÔÇþßÍ\:hY(Â!Þˆþ.ë¬]ÂÎhÀWƦ>÷9�ûHV}9‘ècVú=šò&·˜Õv`ÞNÄ“E½Ë€€)ÉDQ\ëZÔ‰85 -ØÁØþ ÊÅz8öÁ|ñ1•eªúíLÒÊÛ‹w˜±S¹# L?9!Ò–Ž›õ-¡oá~OZç £ 0Ž&ýE· ,\˜…ß%DrEÝà¸Þ”QÛ„` mø¤T«v‘m§ô.cF›oÝ‚z?žÖÐ*tèƒÖ‚ !¢çy­ ÛkÈüÊ‚~º=Ü<ñ+dÚ}©ãtV´Å"ŸÝóz¸:¯,—éâ-ç+O® .@î´”ÚV/Ñåõ¤pã‹å °Ò�L�H‰�ŸD—&ZܤÊ÷eý’Še‰!£3šô -„*éQÁ�ã~²ÿ¤X hé¿öì¼HÍÆ `‚q�Q#±®(¾…­µz’VÒÚ!‡Ã -«h…Šm -¶ÊÀÎÒ|gRºé�ÖÉŒ�q à DR#ò “õœ<Ñ„|?¦ï‹¡©,9г©hXDœ‘M -*ûþ|çÿ>`\„ -¶“›S‹"»íÈÚ¤Eª®üS’O`6MªV,Õ‰µ— Ó¯ÀÆïí¥3tð-R¡à~~)MñÏWr-%ì²8Æå0\Dem?‘„à ÌPÊÞ�±4mïç9hîî@´[€i22ásǸABóÑñ�_tx\hÀ»Uà ›Mþn-ë²d¸ù~ P\]ElS #éMÄÞ6Ç -›+O�ýÚw­£Ŭõ%@<¹‡Uf †ü;fó„Ñ·]VO ­¤.™wè@ \°ôlÔ¯ÙÄb;¯ŸúSUªßOX¼Ã¼¼öHÎjo@?X÷A{'ljÊZÙµO ©qûw?-u­Nó™�q×·¦ÂÀž•¼õÉÇžFLöå;b»âô)ý{P­¹ó.„‡D«©de:µ·ø�Aš6ÊyÞµßHÍÎ)‘6Kœ~lÉa —´¥s‰Ý0|ô�þR˜AÇu`Y©u‚ì70¼sk»IUqbµa~ü®<«¶`PÇ�U²X,:³Ë °‘àá¼.²†3=)g7äÕ.Ô™éµö œÐwl'øóõiÙ6íV÷—2¢½cófvè•5�A$î׫Ëj“ÄGȸŠ�çoën³fJ Ì_A+¾‰ Ÿ÷ˆÅœX…pëãaS jM$íä|p_wȉïlÛ]8 eÑ¡ KF…º7œyx  -ö¸µGö ¹»vëdi°YSTE÷V xd– ¸àÒÉ¡–�<…ùõVêÓ9Ç'¿@\lêß±t">¡‹Y42O2OT$‰ØáWÐl/˨¯Âw³¸Ì’“  &¾›¶é%z6w²ÓBÞpæ£{U8·¸œ `²1ÚzkÒBѾO°xê-Jc`øEqqÙ%iŸÆ=|cpaÖ±9Ë83ŒçÔ¢ªJÆI�gûùýE— Ì¥áYÊ­RšØ8Ÿˆá~Úœ #%¶ò b‘ g19æÕ1 �›šÏ÷;3"å)Ã7Òð¤DÊ>öí8 øŽÏ7 bŽjPK@æ—h@áVBá52—Ü<ß6òGh‘DÅEÂ�j®®xz•âï~DË¿Á êoɱ”cè’ìì)í4!%¼HeÖñ.b;�m£åý4Ê“çî*�…AAœgÍוúÞhß|(ÉÓÉœ-»Û/�ñ#sÎôJx[ùŶõÉ;øêzé#Ýò{i±Ýž~Ûâg÷Ƙ×ï6Ç7k¤×Ü‘˜II4°t /à3À%B6_è.\íüÁoWE’ýñÊGÿ–yˆ6 -º··#­Å”Œ7m*Ýn�…ê¤@¼êç×›ýåùÓ<ñÍò¡Ž[¤ ™'«ü×,:ü[é8äiøÊÿ×Î\¶5Á -Eê•îî”F*Â` �t§Ò©tKHé£'1º&ÝÒ£Q¤Qrt�v”Àý÷Û}îùÇ‘§‹6ÊG,H -JõSkph�ƒ„›•®”‹îÒÄüì™l~]@ wML-r Å%aNq3ñ¤>.ÎÂ[Ca’ª¨8<Ã8Ýî3˜\\;Ô—3Zéï1xûz~v>ÍN(è“—"Ys\ÛŒïa¾o+Œ.Œgâ›xÔ¤äšð&ÿ¡÷óÙÆa¯Ê^ì‡SúYæà]M¡9¼›¢œzoZm¦(M&]¼"=ï¤0‘§dŠùü«µ€ÅÃ%üÕ<­Ã�HÈ)ÒBϾoþ¹W‰;By¾_à ëpTÀÖ)ÓÝdտśÞ=a¡vk6 S+Ùç,¨…±•ZG&“5O…+0e¬‡�q „[Gr÷ÎU(4nÿ¹½}娧±JWä![^&B VO#ÐÓ»ôo�[ÞïÀIÿ’9z'óÅ]¡ SS`ØÝo÷Ö}ÔÝáAVi%sÙó!BåfR‰°öê¬Í+£:¯Q .ý×ñõòè1ø@$Ì¡Ñ?K�™7J!¤Á*źôGlAøç³>K'õ ŸvRã FÌmo`Ø}Š…™�zÖåÙ ª^êUÑHáufþÙ îgØlÙW¥!YyLj“« óç�¬¿XEÚ„óínÒbêÀ -ur–ëð¾¨�Ê!niˆS(Œwlx¨¯q8—:ù¬¾Bô -³ëÀu2K�¯ÚAÜ¢VíªšåEg¹kŒP:1 Ò ¸glZ:]ê‘’ô%tx‰,\‰_¶ƒÙ«Š[þáÉΦÓÓ ^xœw&Ù¾nÀo½ËÎî…Ôù° Œ/ùùΆꞌñ¦G¼zʼnHPë@¥þö'—“6¾«:‹\î¤U¦€Õ¢¸8}¦hd(!ê›Ía†Uê¡I£Œ¢-õÙ$ÞíU;æRÕ—NN?îÚ2ñQ@e°Á¸ÝyA)BJ5|¿ýßí5€õtØ•qÑ3pŽVÇ¿U[ÂöGLRû¨C£ CòHר~íâ¶ah5=8iÿüüÁuD—Ô�® -¤íxÚþë½ÂkY•…äkÈT`ªµ–È�¨Púô1£/Èõ*¯"åHñaõ˜Q÷úÖLÅ:'&ž´‡nOîˆ"? ì­ÌE©$C…cª§rõÈ|Cñ²ñ3û¡lðˆÈhÅÛƒB£å¥æ€†Ç;�Še•„.r=n&žã’Õ¾kdYåãâãaJó)!Ò�PÑlS‡_À‚gp~ù&õ�òŽ�ÏÏñIÜøß½7ß´´@a¬àz6îÄûÓÊ­;Ý�»sw8KBúâRUßñµ¨¾«Äú6†ð¯÷ÛÔ¡«jG ìH?1¡îÉ®§Ù^ÞébS€˜1x$³Yù˸³©??ëˆcF…hk£ã~«�•R‹p¶z‹î¸_L÷Y×õLɦ³<­—¥-'"!xbdßïñ›’ÝpKýÏZµó1’­®"ʺU§Š¶†6-çȉøy :±7å\l@w¸¼Œ¾¨& yëM9æàÁKÿê²0n¿À7ŽP$çE >n¾PŽöqÕÝüƒqat�LÅUi'F7ÏjQHÂ:~¸‡k$ˆ¿E`÷^„xlÔv{·uÐây z½bÈijY0XoëRý`+䪬]‚ÎóVï˜~C„ǘ¸½–@¨ lcoŸx<™yy 8‚ÆÂ‰å‘mK�xVš€ë´~E;±œF›½tžO„ØFËáºú9‡+ÞÈ@wÖ¥cŽÏH�W”‹õŸC‹¹[Ù.é ¢'Ö_°:íÞü¨iÿh-$Íî§yâ/¼o WëA¢F¿½'ô‰½†â?[µU]qK*e®ˆ±5ØÎ·ùyEáúŠ"öW(É54uY#ydªÄŒ¥ˆ¤ÛvàV]*zÖ,ו“u;F=ð»_ •äv@Yߥ8'¦5û¦�&8⃲­/Î<>!ãÙÏSlÅä]Ù`Ý,\5È›Ø�úZÂ=öZ{³|±©{êkû]m�ŸaçmìZKÈú=V§kp)¶Î.Y¯*ñ;áì"~OÈ}�cÄ>•Ì'jý|Mç÷ï¿sÁ7]Œ#j@^f9&‹ÙF_Ó�S«F“ö\¾�.óOò­‹Oß?—ž‘qº͙۶3ž”ÅξҞu.-0:ߌÞj³c œäÉzmÜ„š�HJ|ŒØp|ØäÄÍT-:ˆ¤]ìŠ×kÍÄõ¸Ô7×'¤Ñä«8ÕfèéÆñÓ»ù?dþï1ážÞ¿ ¾—Jh&;LfϽ— 쬿!�%>P¢\ø:Ó&šâ�Ó;[‡§K8ç�¼†·¤ÅõÔ&ü‘íuõ1êr_(ýFSh¸ÒsµaåLÁŸ µ¨©íÒÒç°¿­Oôø¡šÜYAÌÒö¦Ìr¶qñd/¿1þÎ@ÖÙªŸþƒ©ÆHs‘˜´} ËM ¾í�úv!r꜄§ñ$¸�hBøƒ_]ª#êXzĵJˆììÑ‹Ùy 6WJà ÐúÿÞ©G€Š5'®øJ5^Ð5[ -|>]%¹Û_–Š«rp˜vÕêQ&  [ðh©?èP()¡½æðJýq¤’Ž«}ÅyR´TF/ep ñÃ+žOG -#Á�QHV:j böyiè‡E\’ä4aßèŒÙ¦ƒ&¶Ü Ô-âÄJ\xN¥º¯zzïH””k³{�“` ]²lÜE»sýR:º6¶Ñ˜Ô¹ˆ%d¹K*uT…Zñ1l+’(oÂ1vPØŽé~+ÞÒ9÷`5/³­z—kƒ�¶-a±ã\½}8­©òÄuÃ` ú:i5€n €ÑÑÓHo4g:§\ˆÙHv·�Ñ.°d�x,ò$<Ÿ*Zئ<¤†“$ç»åb|-÷c®ÞÙ‚_;yäE‚˜ï`u{Ø3O«Ê9ÀÝT+ -b¹pû¨þ¾y 7úviC�Þõ›æÅPX—Mež]¸É\Nÿ5f“¹_MÊÈÔеé¤|ŒÏçÂHÑ|¹ŸÂêíUí[cÿm‰¸> AK6ÙU¦8ß6W[‰/Š–²‡ï°™ªCŠÍ#ù@7‡p_û9%öÿ޽9�9ås)©j�éMµYo™Ûßµ´üZäèlãúD24Xìó\]Ã2¬‡½ -çÏ””Î6,#TJßoþqL'?ÄvCßç ÏÙz9ÿÄÏy.I¤Zuìé‡(qüä¢6'ÖwU‹£ þnîWb$cT莓Ô6XEйß0|Á§a ‰wÙËöMHvw¦½µnÅâRÎÐ >¨ˆ„¯÷ñ¦v,§¼WÀÕ˜L³²ØQ—�æ¶MUq_¯>�é…,ÝT2ØRö>�«Aª]�’£Iaizp¡3�{:r3ƒŒÆ;›H‰g }F:3ø*Ö§UºÂ‰ÍºžÉ¥''éþNfÿ‰`LÑzO†r¦"l{s‹í(ª)ˆcó˜¼Õ7`‡IHÄìP†P@%Üj� �@ Ø»µŒrb>Ú€¦9Ñ3{²aÇ&µ‘þzr¸Ìþ âßÉvµÊ‘N/È<êdYúÐ.z?GòBá5o¢ûýS«Üð¤Â¤‰I÷ê€I¿ Ñ­Á +ñ~íŽVå5`O¾ÖŒ·ÚRð'�LoS¥‚† Ίǫ¹ŸÐìc{ð—Æ”¬Sä�g´/d£Ôë2Ý4}‚¨µ£#Š=?md!ê¯$@…´ü̬¦7ëöqßbGܬ§9­sÖ…—gé�f.iÆ%nÀªž ó4ªÅ»0€YIhþÎwBaW£&¤þÊÙqÜÜ,Ö¬Ô ¥œ¨Ö¬®:KEöQ1”a�Y® y•¸Õðì×›W+QbÆeR!>Ñ:X ¼\u5QZ;Çߪõ£›ºÏÀ.•3ëz2¤`ý¤¯e`ÄÅþÆ3ÀÔMUÙî¬n‘¸Ñ˱5ö³,Ñy/Yc >�"¸WC?‚&™Ç]Ÿûêfùã­S¼\�1à×ÉÈ–IÅTÅõ3Ë©3ÐçÑ÷‡/GnÍGø¦ûXtl7)qð7~�ÓÚ`#ÙøÝŽ`èOu¦,Šìn£ùƒBüdZáN±]�S-ù½—•·v”ÝŠf/2Z¼ñÄÞoåÐÈÒŒ)B2)Ë_k>‹Fê -’‹'2̈ËqŽ=â�]6d•i¹è·þj1¥Uz¤Ò�&ò8¦VJúÄ>:Bò�+�¯»ã1Jöt­í«]÷ -¾tŽß+T¥…z²Å»…{â8>´Q¾p €si—\ýMÉ‚·O#Xìúnß28àqV4Út¨Ä"PÌ"N„HÌCª� â”Ò µ��ÙzB=*=6Ÿ›àtt)ˆÉ,Ð>vÒN_àÿ�t©kA«»‰Oû»†¼º#Óæ6–=ð½äãï†ÕBÈ^S-àÀ›ôQÞçÿrK’Èq�%^ ð*ÒlÇ‚‚k×’%Jò'Zë±èóêO‰ÿ%ÒÿþOöŽo|üÞy¾ñq'ý-ùâÇendstream -endobj -482 0 obj << -/Type /Font -/Subtype /Type1 -/Encoding 5648 0 R -/FirstChar 2 -/LastChar 149 -/Widths 5657 0 R -/BaseFont /MMQLGF+NimbusRomNo9L-Regu -/FontDescriptor 480 0 R ->> endobj -480 0 obj << -/Ascent 678 -/CapHeight 651 -/Descent -216 -/FontName /MMQLGF+NimbusRomNo9L-Regu -/ItalicAngle 0 -/StemV 85 -/XHeight 450 -/FontBBox [-168 -281 1000 924] -/Flags 4 -/CharSet (/fi/fl/exclam/quotedbl/numbersign/dollar/ampersand/quoteright/parenleft/parenright/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/equal/question/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/bracketright/underscore/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/braceright/bullet) -/FontFile 481 0 R ->> endobj -5657 0 obj -[556 556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 333 408 500 500 0 778 333 333 333 0 564 250 333 250 278 500 500 500 500 500 500 500 500 500 500 278 278 0 564 0 444 0 722 667 667 722 611 556 722 722 333 389 722 611 889 722 722 556 722 667 556 611 722 722 944 722 722 611 333 0 333 0 500 0 444 500 444 500 444 333 500 500 278 278 500 278 778 500 500 500 500 333 389 278 500 500 722 500 500 444 480 0 480 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 350 ] -endobj -486 0 obj << -/Type /Pages -/Count 6 -/Parent 5658 0 R -/Kids [474 0 R 491 0 R 495 0 R 527 0 R 566 0 R 606 0 R] ->> endobj -648 0 obj << -/Type /Pages -/Count 6 -/Parent 5658 0 R -/Kids [630 0 R 659 0 R 664 0 R 683 0 R 691 0 R 718 0 R] ->> endobj -770 0 obj << -/Type /Pages -/Count 6 -/Parent 5658 0 R -/Kids [752 0 R 776 0 R 788 0 R 795 0 R 807 0 R 815 0 R] ->> endobj -829 0 obj << -/Type /Pages -/Count 6 -/Parent 5658 0 R -/Kids [823 0 R 831 0 R 844 0 R 857 0 R 868 0 R 874 0 R] ->> endobj -905 0 obj << -/Type /Pages -/Count 6 -/Parent 5658 0 R -/Kids [878 0 R 907 0 R 911 0 R 936 0 R 940 0 R 1006 0 R] ->> endobj -1063 0 obj << -/Type /Pages -/Count 6 -/Parent 5658 0 R -/Kids [1010 0 R 1090 0 R 1121 0 R 1126 0 R 1150 0 R 1167 0 R] ->> endobj -1231 0 obj << -/Type /Pages -/Count 6 -/Parent 5659 0 R -/Kids [1199 0 R 1239 0 R 1257 0 R 1269 0 R 1285 0 R 1292 0 R] ->> endobj -1340 0 obj << -/Type /Pages -/Count 6 -/Parent 5659 0 R -/Kids [1323 0 R 1347 0 R 1357 0 R 1369 0 R 1387 0 R 1413 0 R] ->> endobj -1437 0 obj << -/Type /Pages -/Count 6 -/Parent 5659 0 R -/Kids [1422 0 R 1439 0 R 1455 0 R 1459 0 R 1487 0 R 1522 0 R] ->> endobj -1565 0 obj << -/Type /Pages -/Count 6 -/Parent 5659 0 R -/Kids [1542 0 R 1569 0 R 1587 0 R 1600 0 R 1620 0 R 1640 0 R] ->> endobj -1674 0 obj << -/Type /Pages -/Count 6 -/Parent 5659 0 R -/Kids [1651 0 R 1685 0 R 1703 0 R 1712 0 R 1721 0 R 1728 0 R] ->> endobj -1754 0 obj << -/Type /Pages -/Count 6 -/Parent 5659 0 R -/Kids [1740 0 R 1757 0 R 1779 0 R 1849 0 R 1946 0 R 2002 0 R] ->> endobj -2072 0 obj << -/Type /Pages -/Count 6 -/Parent 5660 0 R -/Kids [2057 0 R 2074 0 R 2089 0 R 2102 0 R 2117 0 R 2139 0 R] ->> endobj -2163 0 obj << -/Type /Pages -/Count 6 -/Parent 5660 0 R -/Kids [2160 0 R 2165 0 R 2196 0 R 2208 0 R 2245 0 R 2259 0 R] ->> endobj -2292 0 obj << -/Type /Pages -/Count 6 -/Parent 5660 0 R -/Kids [2266 0 R 2294 0 R 2321 0 R 2353 0 R 2376 0 R 2398 0 R] ->> endobj -2425 0 obj << -/Type /Pages -/Count 6 -/Parent 5660 0 R -/Kids [2416 0 R 2427 0 R 2437 0 R 2471 0 R 2488 0 R 2500 0 R] ->> endobj -2549 0 obj << -/Type /Pages -/Count 6 -/Parent 5660 0 R -/Kids [2529 0 R 2556 0 R 2576 0 R 2587 0 R 2606 0 R 2631 0 R] ->> endobj -2701 0 obj << -/Type /Pages -/Count 6 -/Parent 5660 0 R -/Kids [2684 0 R 2703 0 R 2719 0 R 2736 0 R 2750 0 R 2754 0 R] ->> endobj -2809 0 obj << -/Type /Pages -/Count 6 -/Parent 5661 0 R -/Kids [2790 0 R 2811 0 R 2821 0 R 2860 0 R 2879 0 R 2891 0 R] ->> endobj -2942 0 obj << -/Type /Pages -/Count 6 -/Parent 5661 0 R -/Kids [2932 0 R 2944 0 R 2997 0 R 3023 0 R 3033 0 R 3052 0 R] ->> endobj -3130 0 obj << -/Type /Pages -/Count 6 -/Parent 5661 0 R -/Kids [3106 0 R 3137 0 R 3153 0 R 3170 0 R 3185 0 R 3192 0 R] ->> endobj -3238 0 obj << -/Type /Pages -/Count 6 -/Parent 5661 0 R -/Kids [3231 0 R 3240 0 R 3244 0 R 3288 0 R 3304 0 R 3314 0 R] ->> endobj -3357 0 obj << -/Type /Pages -/Count 6 -/Parent 5661 0 R -/Kids [3344 0 R 3359 0 R 3391 0 R 3402 0 R 3412 0 R 3444 0 R] ->> endobj -3474 0 obj << -/Type /Pages -/Count 6 -/Parent 5661 0 R -/Kids [3460 0 R 3476 0 R 3516 0 R 3532 0 R 3541 0 R 3556 0 R] ->> endobj -3615 0 obj << -/Type /Pages -/Count 6 -/Parent 5662 0 R -/Kids [3607 0 R 3617 0 R 3668 0 R 3702 0 R 3768 0 R 3791 0 R] ->> endobj -3875 0 obj << -/Type /Pages -/Count 6 -/Parent 5662 0 R -/Kids [3839 0 R 3877 0 R 3881 0 R 3892 0 R 3907 0 R 3958 0 R] ->> endobj -3984 0 obj << -/Type /Pages -/Count 6 -/Parent 5662 0 R -/Kids [3965 0 R 3987 0 R 3997 0 R 4019 0 R 4039 0 R 4047 0 R] ->> endobj -4074 0 obj << -/Type /Pages -/Count 6 -/Parent 5662 0 R -/Kids [4061 0 R 4077 0 R 4106 0 R 4125 0 R 4152 0 R 4160 0 R] ->> endobj -4195 0 obj << -/Type /Pages -/Count 6 -/Parent 5662 0 R -/Kids [4184 0 R 4197 0 R 4207 0 R 4221 0 R 4242 0 R 4260 0 R] ->> endobj -4298 0 obj << -/Type /Pages -/Count 6 -/Parent 5662 0 R -/Kids [4284 0 R 4301 0 R 4318 0 R 4326 0 R 4356 0 R 4381 0 R] ->> endobj -4430 0 obj << -/Type /Pages -/Count 6 -/Parent 5663 0 R -/Kids [4405 0 R 4432 0 R 4449 0 R 4468 0 R 4497 0 R 4523 0 R] ->> endobj -4575 0 obj << -/Type /Pages -/Count 6 -/Parent 5663 0 R -/Kids [4533 0 R 4578 0 R 4627 0 R 4650 0 R 4672 0 R 4697 0 R] ->> endobj -4756 0 obj << -/Type /Pages -/Count 6 -/Parent 5663 0 R -/Kids [4718 0 R 4758 0 R 4805 0 R 4839 0 R 4859 0 R 4880 0 R] ->> endobj -4918 0 obj << -/Type /Pages -/Count 6 -/Parent 5663 0 R -/Kids [4904 0 R 4921 0 R 4940 0 R 4959 0 R 4979 0 R 4983 0 R] ->> endobj -4990 0 obj << -/Type /Pages -/Count 6 -/Parent 5663 0 R -/Kids [4987 0 R 4992 0 R 4996 0 R 5000 0 R 5004 0 R 5008 0 R] ->> endobj -5015 0 obj << -/Type /Pages -/Count 6 -/Parent 5663 0 R -/Kids [5012 0 R 5017 0 R 5021 0 R 5025 0 R 5029 0 R 5033 0 R] ->> endobj -5040 0 obj << -/Type /Pages -/Count 6 -/Parent 5664 0 R -/Kids [5037 0 R 5042 0 R 5046 0 R 5050 0 R 5054 0 R 5058 0 R] ->> endobj -5065 0 obj << -/Type /Pages -/Count 6 -/Parent 5664 0 R -/Kids [5062 0 R 5067 0 R 5071 0 R 5075 0 R 5079 0 R 5083 0 R] ->> endobj -5090 0 obj << -/Type /Pages -/Count 6 -/Parent 5664 0 R -/Kids [5087 0 R 5092 0 R 5096 0 R 5100 0 R 5104 0 R 5108 0 R] ->> endobj -5115 0 obj << -/Type /Pages -/Count 6 -/Parent 5664 0 R -/Kids [5112 0 R 5117 0 R 5121 0 R 5125 0 R 5129 0 R 5133 0 R] ->> endobj -5141 0 obj << -/Type /Pages -/Count 6 -/Parent 5664 0 R -/Kids [5138 0 R 5143 0 R 5147 0 R 5151 0 R 5155 0 R 5159 0 R] ->> endobj -5166 0 obj << -/Type /Pages -/Count 6 -/Parent 5664 0 R -/Kids [5163 0 R 5168 0 R 5172 0 R 5176 0 R 5180 0 R 5184 0 R] ->> endobj -5191 0 obj << -/Type /Pages -/Count 6 -/Parent 5665 0 R -/Kids [5188 0 R 5193 0 R 5197 0 R 5201 0 R 5274 0 R 5342 0 R] ->> endobj -5491 0 obj << -/Type /Pages -/Count 3 -/Parent 5665 0 R -/Kids [5427 0 R 5493 0 R 5575 0 R] ->> endobj -5658 0 obj << -/Type /Pages -/Count 36 -/Parent 5666 0 R -/Kids [486 0 R 648 0 R 770 0 R 829 0 R 905 0 R 1063 0 R] ->> endobj -5659 0 obj << -/Type /Pages -/Count 36 -/Parent 5666 0 R -/Kids [1231 0 R 1340 0 R 1437 0 R 1565 0 R 1674 0 R 1754 0 R] ->> endobj -5660 0 obj << -/Type /Pages -/Count 36 -/Parent 5666 0 R -/Kids [2072 0 R 2163 0 R 2292 0 R 2425 0 R 2549 0 R 2701 0 R] ->> endobj -5661 0 obj << -/Type /Pages -/Count 36 -/Parent 5666 0 R -/Kids [2809 0 R 2942 0 R 3130 0 R 3238 0 R 3357 0 R 3474 0 R] ->> endobj -5662 0 obj << -/Type /Pages -/Count 36 -/Parent 5666 0 R -/Kids [3615 0 R 3875 0 R 3984 0 R 4074 0 R 4195 0 R 4298 0 R] ->> endobj -5663 0 obj << -/Type /Pages -/Count 36 -/Parent 5666 0 R -/Kids [4430 0 R 4575 0 R 4756 0 R 4918 0 R 4990 0 R 5015 0 R] ->> endobj -5664 0 obj << -/Type /Pages -/Count 36 -/Parent 5667 0 R -/Kids [5040 0 R 5065 0 R 5090 0 R 5115 0 R 5141 0 R 5166 0 R] ->> endobj -5665 0 obj << -/Type /Pages -/Count 9 -/Parent 5667 0 R -/Kids [5191 0 R 5491 0 R] ->> endobj -5666 0 obj << -/Type /Pages -/Count 216 -/Parent 5668 0 R -/Kids [5658 0 R 5659 0 R 5660 0 R 5661 0 R 5662 0 R 5663 0 R] ->> endobj -5667 0 obj << -/Type /Pages -/Count 45 -/Parent 5668 0 R -/Kids [5664 0 R 5665 0 R] ->> endobj -5668 0 obj << -/Type /Pages -/Count 261 -/Kids [5666 0 R 5667 0 R] ->> endobj -5669 0 obj << -/Type /Outlines -/First 7 0 R -/Last 407 0 R -/Count 9 ->> endobj -471 0 obj << -/Title 472 0 R -/A 469 0 R -/Parent 407 0 R -/Prev 467 0 R ->> endobj -467 0 obj << -/Title 468 0 R -/A 465 0 R -/Parent 407 0 R -/Prev 463 0 R -/Next 471 0 R ->> endobj -463 0 obj << -/Title 464 0 R -/A 461 0 R -/Parent 407 0 R -/Prev 459 0 R -/Next 467 0 R ->> endobj -459 0 obj << -/Title 460 0 R -/A 457 0 R -/Parent 407 0 R -/Prev 455 0 R -/Next 463 0 R ->> endobj -455 0 obj << -/Title 456 0 R -/A 453 0 R -/Parent 407 0 R -/Prev 451 0 R -/Next 459 0 R ->> endobj -451 0 obj << -/Title 452 0 R -/A 449 0 R -/Parent 407 0 R -/Prev 447 0 R -/Next 455 0 R ->> endobj -447 0 obj << -/Title 448 0 R -/A 445 0 R -/Parent 407 0 R -/Prev 443 0 R -/Next 451 0 R ->> endobj -443 0 obj << -/Title 444 0 R -/A 441 0 R -/Parent 407 0 R -/Prev 439 0 R -/Next 447 0 R ->> endobj -439 0 obj << -/Title 440 0 R -/A 437 0 R -/Parent 407 0 R -/Prev 435 0 R -/Next 443 0 R ->> endobj -435 0 obj << -/Title 436 0 R -/A 433 0 R -/Parent 407 0 R -/Prev 431 0 R -/Next 439 0 R ->> endobj -431 0 obj << -/Title 432 0 R -/A 429 0 R -/Parent 407 0 R -/Prev 427 0 R -/Next 435 0 R ->> endobj -427 0 obj << -/Title 428 0 R -/A 425 0 R -/Parent 407 0 R -/Prev 423 0 R -/Next 431 0 R ->> endobj -423 0 obj << -/Title 424 0 R -/A 421 0 R -/Parent 407 0 R -/Prev 419 0 R -/Next 427 0 R ->> endobj -419 0 obj << -/Title 420 0 R -/A 417 0 R -/Parent 407 0 R -/Prev 415 0 R -/Next 423 0 R ->> endobj -415 0 obj << -/Title 416 0 R -/A 413 0 R -/Parent 407 0 R -/Prev 411 0 R -/Next 419 0 R ->> endobj -411 0 obj << -/Title 412 0 R -/A 409 0 R -/Parent 407 0 R -/Next 415 0 R ->> endobj -407 0 obj << -/Title 408 0 R -/A 405 0 R -/Parent 5669 0 R -/Prev 267 0 R -/First 411 0 R -/Last 471 0 R -/Count -16 ->> endobj -403 0 obj << -/Title 404 0 R -/A 401 0 R -/Parent 267 0 R -/Prev 399 0 R ->> endobj -399 0 obj << -/Title 400 0 R -/A 397 0 R -/Parent 267 0 R -/Prev 395 0 R -/Next 403 0 R ->> endobj -395 0 obj << -/Title 396 0 R -/A 393 0 R -/Parent 267 0 R -/Prev 391 0 R -/Next 399 0 R ->> endobj -391 0 obj << -/Title 392 0 R -/A 389 0 R -/Parent 267 0 R -/Prev 387 0 R -/Next 395 0 R ->> endobj -387 0 obj << -/Title 388 0 R -/A 385 0 R -/Parent 267 0 R -/Prev 383 0 R -/Next 391 0 R ->> endobj -383 0 obj << -/Title 384 0 R -/A 381 0 R -/Parent 267 0 R -/Prev 379 0 R -/Next 387 0 R ->> endobj -379 0 obj << -/Title 380 0 R -/A 377 0 R -/Parent 267 0 R -/Prev 375 0 R -/Next 383 0 R ->> endobj -375 0 obj << -/Title 376 0 R -/A 373 0 R -/Parent 267 0 R -/Prev 371 0 R -/Next 379 0 R ->> endobj -371 0 obj << -/Title 372 0 R -/A 369 0 R -/Parent 267 0 R -/Prev 367 0 R -/Next 375 0 R ->> endobj -367 0 obj << -/Title 368 0 R -/A 365 0 R -/Parent 267 0 R -/Prev 363 0 R -/Next 371 0 R ->> endobj -363 0 obj << -/Title 364 0 R -/A 361 0 R -/Parent 267 0 R -/Prev 359 0 R -/Next 367 0 R ->> endobj -359 0 obj << -/Title 360 0 R -/A 357 0 R -/Parent 267 0 R -/Prev 355 0 R -/Next 363 0 R ->> endobj -355 0 obj << -/Title 356 0 R -/A 353 0 R -/Parent 267 0 R -/Prev 351 0 R -/Next 359 0 R ->> endobj -351 0 obj << -/Title 352 0 R -/A 349 0 R -/Parent 267 0 R -/Prev 347 0 R -/Next 355 0 R ->> endobj -347 0 obj << -/Title 348 0 R -/A 345 0 R -/Parent 267 0 R -/Prev 343 0 R -/Next 351 0 R ->> endobj -343 0 obj << -/Title 344 0 R -/A 341 0 R -/Parent 267 0 R -/Prev 339 0 R -/Next 347 0 R ->> endobj -339 0 obj << -/Title 340 0 R -/A 337 0 R -/Parent 267 0 R -/Prev 335 0 R -/Next 343 0 R ->> endobj -335 0 obj << -/Title 336 0 R -/A 333 0 R -/Parent 267 0 R -/Prev 331 0 R -/Next 339 0 R ->> endobj -331 0 obj << -/Title 332 0 R -/A 329 0 R -/Parent 267 0 R -/Prev 327 0 R -/Next 335 0 R ->> endobj -327 0 obj << -/Title 328 0 R -/A 325 0 R -/Parent 267 0 R -/Prev 323 0 R -/Next 331 0 R ->> endobj -323 0 obj << -/Title 324 0 R -/A 321 0 R -/Parent 267 0 R -/Prev 319 0 R -/Next 327 0 R ->> endobj -319 0 obj << -/Title 320 0 R -/A 317 0 R -/Parent 267 0 R -/Prev 315 0 R -/Next 323 0 R ->> endobj -315 0 obj << -/Title 316 0 R -/A 313 0 R -/Parent 267 0 R -/Prev 311 0 R -/Next 319 0 R ->> endobj -311 0 obj << -/Title 312 0 R -/A 309 0 R -/Parent 267 0 R -/Prev 307 0 R -/Next 315 0 R ->> endobj -307 0 obj << -/Title 308 0 R -/A 305 0 R -/Parent 267 0 R -/Prev 303 0 R -/Next 311 0 R ->> endobj -303 0 obj << -/Title 304 0 R -/A 301 0 R -/Parent 267 0 R -/Prev 299 0 R -/Next 307 0 R ->> endobj -299 0 obj << -/Title 300 0 R -/A 297 0 R -/Parent 267 0 R -/Prev 295 0 R -/Next 303 0 R ->> endobj -295 0 obj << -/Title 296 0 R -/A 293 0 R -/Parent 267 0 R -/Prev 291 0 R -/Next 299 0 R ->> endobj -291 0 obj << -/Title 292 0 R -/A 289 0 R -/Parent 267 0 R -/Prev 287 0 R -/Next 295 0 R ->> endobj -287 0 obj << -/Title 288 0 R -/A 285 0 R -/Parent 267 0 R -/Prev 283 0 R -/Next 291 0 R ->> endobj -283 0 obj << -/Title 284 0 R -/A 281 0 R -/Parent 267 0 R -/Prev 279 0 R -/Next 287 0 R ->> endobj -279 0 obj << -/Title 280 0 R -/A 277 0 R -/Parent 267 0 R -/Prev 275 0 R -/Next 283 0 R ->> endobj -275 0 obj << -/Title 276 0 R -/A 273 0 R -/Parent 267 0 R -/Prev 271 0 R -/Next 279 0 R ->> endobj -271 0 obj << -/Title 272 0 R -/A 269 0 R -/Parent 267 0 R -/Next 275 0 R ->> endobj -267 0 obj << -/Title 268 0 R -/A 265 0 R -/Parent 5669 0 R -/Prev 179 0 R -/Next 407 0 R -/First 271 0 R -/Last 403 0 R -/Count -34 ->> endobj -263 0 obj << -/Title 264 0 R -/A 261 0 R -/Parent 179 0 R -/Prev 259 0 R ->> endobj -259 0 obj << -/Title 260 0 R -/A 257 0 R -/Parent 179 0 R -/Prev 255 0 R -/Next 263 0 R ->> endobj -255 0 obj << -/Title 256 0 R -/A 253 0 R -/Parent 179 0 R -/Prev 251 0 R -/Next 259 0 R ->> endobj -251 0 obj << -/Title 252 0 R -/A 249 0 R -/Parent 179 0 R -/Prev 247 0 R -/Next 255 0 R ->> endobj -247 0 obj << -/Title 248 0 R -/A 245 0 R -/Parent 179 0 R -/Prev 243 0 R -/Next 251 0 R ->> endobj -243 0 obj << -/Title 244 0 R -/A 241 0 R -/Parent 179 0 R -/Prev 239 0 R -/Next 247 0 R ->> endobj -239 0 obj << -/Title 240 0 R -/A 237 0 R -/Parent 179 0 R -/Prev 235 0 R -/Next 243 0 R ->> endobj -235 0 obj << -/Title 236 0 R -/A 233 0 R -/Parent 179 0 R -/Prev 231 0 R -/Next 239 0 R ->> endobj -231 0 obj << -/Title 232 0 R -/A 229 0 R -/Parent 179 0 R -/Prev 227 0 R -/Next 235 0 R ->> endobj -227 0 obj << -/Title 228 0 R -/A 225 0 R -/Parent 179 0 R -/Prev 223 0 R -/Next 231 0 R ->> endobj -223 0 obj << -/Title 224 0 R -/A 221 0 R -/Parent 179 0 R -/Prev 219 0 R -/Next 227 0 R ->> endobj -219 0 obj << -/Title 220 0 R -/A 217 0 R -/Parent 179 0 R -/Prev 215 0 R -/Next 223 0 R ->> endobj -215 0 obj << -/Title 216 0 R -/A 213 0 R -/Parent 179 0 R -/Prev 211 0 R -/Next 219 0 R ->> endobj -211 0 obj << -/Title 212 0 R -/A 209 0 R -/Parent 179 0 R -/Prev 207 0 R -/Next 215 0 R ->> endobj -207 0 obj << -/Title 208 0 R -/A 205 0 R -/Parent 179 0 R -/Prev 203 0 R -/Next 211 0 R ->> endobj -203 0 obj << -/Title 204 0 R -/A 201 0 R -/Parent 179 0 R -/Prev 199 0 R -/Next 207 0 R ->> endobj -199 0 obj << -/Title 200 0 R -/A 197 0 R -/Parent 179 0 R -/Prev 195 0 R -/Next 203 0 R ->> endobj -195 0 obj << -/Title 196 0 R -/A 193 0 R -/Parent 179 0 R -/Prev 191 0 R -/Next 199 0 R ->> endobj -191 0 obj << -/Title 192 0 R -/A 189 0 R -/Parent 179 0 R -/Prev 187 0 R -/Next 195 0 R ->> endobj -187 0 obj << -/Title 188 0 R -/A 185 0 R -/Parent 179 0 R -/Prev 183 0 R -/Next 191 0 R ->> endobj -183 0 obj << -/Title 184 0 R -/A 181 0 R -/Parent 179 0 R -/Next 187 0 R ->> endobj -179 0 obj << -/Title 180 0 R -/A 177 0 R -/Parent 5669 0 R -/Prev 79 0 R -/Next 267 0 R -/First 183 0 R -/Last 263 0 R -/Count -21 ->> endobj -175 0 obj << -/Title 176 0 R -/A 173 0 R -/Parent 79 0 R -/Prev 171 0 R ->> endobj -171 0 obj << -/Title 172 0 R -/A 169 0 R -/Parent 79 0 R -/Prev 167 0 R -/Next 175 0 R ->> endobj -167 0 obj << -/Title 168 0 R -/A 165 0 R -/Parent 79 0 R -/Prev 163 0 R -/Next 171 0 R ->> endobj -163 0 obj << -/Title 164 0 R -/A 161 0 R -/Parent 79 0 R -/Prev 159 0 R -/Next 167 0 R ->> endobj -159 0 obj << -/Title 160 0 R -/A 157 0 R -/Parent 79 0 R -/Prev 155 0 R -/Next 163 0 R ->> endobj -155 0 obj << -/Title 156 0 R -/A 153 0 R -/Parent 79 0 R -/Prev 151 0 R -/Next 159 0 R ->> endobj -151 0 obj << -/Title 152 0 R -/A 149 0 R -/Parent 79 0 R -/Prev 147 0 R -/Next 155 0 R ->> endobj -147 0 obj << -/Title 148 0 R -/A 145 0 R -/Parent 79 0 R -/Prev 143 0 R -/Next 151 0 R ->> endobj -143 0 obj << -/Title 144 0 R -/A 141 0 R -/Parent 79 0 R -/Prev 139 0 R -/Next 147 0 R ->> endobj -139 0 obj << -/Title 140 0 R -/A 137 0 R -/Parent 79 0 R -/Prev 135 0 R -/Next 143 0 R ->> endobj -135 0 obj << -/Title 136 0 R -/A 133 0 R -/Parent 79 0 R -/Prev 131 0 R -/Next 139 0 R ->> endobj -131 0 obj << -/Title 132 0 R -/A 129 0 R -/Parent 79 0 R -/Prev 127 0 R -/Next 135 0 R ->> endobj -127 0 obj << -/Title 128 0 R -/A 125 0 R -/Parent 79 0 R -/Prev 123 0 R -/Next 131 0 R ->> endobj -123 0 obj << -/Title 124 0 R -/A 121 0 R -/Parent 79 0 R -/Prev 119 0 R -/Next 127 0 R ->> endobj -119 0 obj << -/Title 120 0 R -/A 117 0 R -/Parent 79 0 R -/Prev 115 0 R -/Next 123 0 R ->> endobj -115 0 obj << -/Title 116 0 R -/A 113 0 R -/Parent 79 0 R -/Prev 111 0 R -/Next 119 0 R ->> endobj -111 0 obj << -/Title 112 0 R -/A 109 0 R -/Parent 79 0 R -/Prev 107 0 R -/Next 115 0 R ->> endobj -107 0 obj << -/Title 108 0 R -/A 105 0 R -/Parent 79 0 R -/Prev 103 0 R -/Next 111 0 R ->> endobj -103 0 obj << -/Title 104 0 R -/A 101 0 R -/Parent 79 0 R -/Prev 99 0 R -/Next 107 0 R ->> endobj -99 0 obj << -/Title 100 0 R -/A 97 0 R -/Parent 79 0 R -/Prev 95 0 R -/Next 103 0 R ->> endobj -95 0 obj << -/Title 96 0 R -/A 93 0 R -/Parent 79 0 R -/Prev 91 0 R -/Next 99 0 R ->> endobj -91 0 obj << -/Title 92 0 R -/A 89 0 R -/Parent 79 0 R -/Prev 87 0 R -/Next 95 0 R ->> endobj -87 0 obj << -/Title 88 0 R -/A 85 0 R -/Parent 79 0 R -/Prev 83 0 R -/Next 91 0 R ->> endobj -83 0 obj << -/Title 84 0 R -/A 81 0 R -/Parent 79 0 R -/Next 87 0 R ->> endobj -79 0 obj << -/Title 80 0 R -/A 77 0 R -/Parent 5669 0 R -/Prev 71 0 R -/Next 179 0 R -/First 83 0 R -/Last 175 0 R -/Count -24 ->> endobj -75 0 obj << -/Title 76 0 R -/A 73 0 R -/Parent 71 0 R ->> endobj -71 0 obj << -/Title 72 0 R -/A 69 0 R -/Parent 5669 0 R -/Prev 63 0 R -/Next 79 0 R -/First 75 0 R -/Last 75 0 R -/Count -1 ->> endobj -67 0 obj << -/Title 68 0 R -/A 65 0 R -/Parent 63 0 R ->> endobj -63 0 obj << -/Title 64 0 R -/A 61 0 R -/Parent 5669 0 R -/Prev 55 0 R -/Next 71 0 R -/First 67 0 R -/Last 67 0 R -/Count -1 ->> endobj -59 0 obj << -/Title 60 0 R -/A 57 0 R -/Parent 55 0 R ->> endobj -55 0 obj << -/Title 56 0 R -/A 53 0 R -/Parent 5669 0 R -/Prev 47 0 R -/Next 63 0 R -/First 59 0 R -/Last 59 0 R -/Count -1 ->> endobj -51 0 obj << -/Title 52 0 R -/A 49 0 R -/Parent 47 0 R ->> endobj -47 0 obj << -/Title 48 0 R -/A 45 0 R -/Parent 5669 0 R -/Prev 7 0 R -/Next 55 0 R -/First 51 0 R -/Last 51 0 R -/Count -1 ->> endobj -43 0 obj << -/Title 44 0 R -/A 41 0 R -/Parent 7 0 R -/Prev 39 0 R ->> endobj -39 0 obj << -/Title 40 0 R -/A 37 0 R -/Parent 7 0 R -/Prev 35 0 R -/Next 43 0 R ->> endobj -35 0 obj << -/Title 36 0 R -/A 33 0 R -/Parent 7 0 R -/Prev 31 0 R -/Next 39 0 R ->> endobj -31 0 obj << -/Title 32 0 R -/A 29 0 R -/Parent 7 0 R -/Prev 27 0 R -/Next 35 0 R ->> endobj -27 0 obj << -/Title 28 0 R -/A 25 0 R -/Parent 7 0 R -/Prev 23 0 R -/Next 31 0 R ->> endobj -23 0 obj << -/Title 24 0 R -/A 21 0 R -/Parent 7 0 R -/Prev 19 0 R -/Next 27 0 R ->> endobj -19 0 obj << -/Title 20 0 R -/A 17 0 R -/Parent 7 0 R -/Prev 15 0 R -/Next 23 0 R ->> endobj -15 0 obj << -/Title 16 0 R -/A 13 0 R -/Parent 7 0 R -/Prev 11 0 R -/Next 19 0 R ->> endobj -11 0 obj << -/Title 12 0 R -/A 9 0 R -/Parent 7 0 R -/Next 15 0 R ->> endobj -7 0 obj << -/Title 8 0 R -/A 5 0 R -/Parent 5669 0 R -/Next 47 0 R -/First 11 0 R -/Last 43 0 R -/Count -9 ->> endobj -5670 0 obj << -/Names [(Doc-Start) 479 0 R (Item.1) 1160 0 R (Item.2) 1161 0 R (Item.3) 1162 0 R (a00036) 1566 0 R (a00037) 3302 0 R (a00038) 1267 0 R (a00039) 2467 0 R (a00040) 1539 0 R (a00041) 2486 0 R (a00042) 1366 0 R (a00043) 1367 0 R (a00044) 1540 0 R (a00045) 2469 0 R (a00046) 1567 0 R (a00047) 2466 0 R (a00048) 1237 0 R (a00049) 2465 0 R (a00050) 2468 0 R (a00051) 5136 0 R (a00077) 985 0 R (a00077_1d2f2751b0865045486c9aa59d0d0971) 3275 0 R (a00077_20541305548441e5dcb2e1e7e6f300eb) 3278 0 R (a00077_2391bb18db5f620e0e9fb848ae5ba5e9) 3265 0 R (a00077_27df2817055bc099821d96eb60a40b34) 3281 0 R (a00077_31471b5e27bda51832d0fa49bd6d9b54) 3251 0 R (a00077_5361ef75bfbdb469b5cc31f0060a2670) 3267 0 R (a00077_564bab93ef6a268a5de2fab885c1d32a) 3269 0 R (a00077_5e16ca335dfd7394527f602da879fca2) 3284 0 R (a00077_7a520a57d7d0541524f34a7685635597) 3272 0 R (a00077_cfd36e02c7498d766ff802575e981612) 3256 0 R (a00077_e0b137a3875ad12a99e5e3e0e177fd12) 3254 0 R (a00077_e707c39412e09d3a47f0b3c5dad33725) 3262 0 R (a00077_e80af46ceef63eab3c786525370ae720) 3259 0 R (a00078) 986 0 R (a00078_4b1b1436b50ed7638aece35f41421196) 3298 0 R (a00078_4da86e9feb5e5835eb15163c2cb61116) 3300 0 R (a00078_a9825b5977b2d4dec66e6bd09e6ae6ea) 3295 0 R (a00079) 987 0 R (a00079_1513a9e88921750d2a611b518f6fc207) 3311 0 R (a00079_9a84c69ec5a4705ccb1ca99fcd120add) 3309 0 R (a00080) 988 0 R (a00080_16a3a3056f44b7245ce085b937a269dd) 3339 0 R (a00080_447eb700ea7a185e0f155934995d49e5) 3329 0 R (a00080_468c04fff28e784f93ebc3f0849211dd) 3335 0 R (a00080_4c6f843219271d25766ee5969e435d1a) 3327 0 R (a00080_5e274a8f8b5fb2b3999c54fe27c76e46) 3333 0 R (a00080_6df929b448ea98bc44d41f5e96237bda) 3341 0 R (a00080_78f82878f3fd0e7401c7d7d3b3fefbef) 3337 0 R (a00080_94fcc9f5c47f419040d849ce58beae35) 3331 0 R (a00080_9dd8edeece221c853a4c4516bf1b01c2) 3321 0 R (a00080_c39694ece9526b84012f90f2bb00af9f) 3319 0 R (a00080_e261f08e1556287d241764fb2e99fc26) 3324 0 R (a00081) 989 0 R (a00081_164124d48fe85bc98d9a300382a5245d) 3351 0 R (a00081_5595902fd42d874e35a70206fad8f6d0) 3353 0 R (a00081_b42c7af6114fde5d21206a2e18a7d3ee) 3349 0 R (a00081_b5801722740492e69bcc73687476009f) 3355 0 R (a00082) 990 0 R (a00082_17aacf7c5e2046c1f3ab50faa1b2f7eb) 3365 0 R (a00082_19b82696bd84a803250cbf9812f2f125) 3377 0 R (a00082_31f25efccba9fd043047133d0d0ba5ab) 3369 0 R (a00082_a408ca8630154ebd039f37a828399f7b) 3380 0 R (a00082_a6bfaf327ce839ba70accd71014398d0) 3386 0 R (a00082_b973f2e16c2883a8a0164d716cce5a31) 3372 0 R (a00082_c3d1bfbb1abde31973c015de97ce2f84) 3375 0 R (a00082_d6bd03239291629676e4c0286ebb650f) 3383 0 R (a00082_fda184638130452f3570966acc5b97f9) 3388 0 R (a00083) 991 0 R (a00083_20fae11b540a561c622a0d74cb4b9f97) 3399 0 R (a00083_5e8637b1514d03eb3eb12dc9a502e27e) 3396 0 R (a00084) 992 0 R (a00084_c3fa0fa86689e3e7c039a16c16861dbe) 3408 0 R (a00085) 993 0 R (a00085_04833004cec509a41c502429df308e35) 3429 0 R (a00085_0560495c60c68d62617ff1f3d0c424a4) 3437 0 R (a00085_0bb4f34164e7207c2db26b77f23ccfff) 3420 0 R (a00085_3592a1f5ae100db2ed9c0810b41c7bc7) 3423 0 R (a00085_503c2994a4e52300516e2b820f0fc65b) 3427 0 R (a00085_5ed2615cec9e633d90ac5968771976eb) 3440 0 R (a00085_668cab7d54ff0a2fc2a2179ca06b0798) 3425 0 R (a00085_68204df6bde3e3c27271ebde10579a57) 3434 0 R (a00085_a312da7b5f6441140721ec7e55f345a8) 3431 0 R (a00086) 994 0 R (a00086_cca775e46d4405b7775b328f7694f7e7) 3451 0 R (a00087) 995 0 R (a00087_e8eb428c05bc1dee022246a3063d277c) 3470 0 R (a00087_fe557d333c06cf65f52023f45f5b0a3a) 3472 0 R (a00088) 714 0 R (a00088_0cd09beee671e7e9efb0b4aced10249e) 3485 0 R (a00088_0ef3ae2764714bf90620075c374c262e) 3497 0 R (a00088_1df6aa054ef2fa634ac4c6f418228285) 3488 0 R (a00088_2d9732cf5752d30bd11cb25dc7d0c8d3) 3522 0 R (a00088_3347ef1b6e8581402445d1a0280c7a14) 3500 0 R (a00088_4289c59840b128f2f6526e9da2711d47) 3525 0 R (a00088_70297b3e6d4eaae7bd828cb50bd1efe3) 3491 0 R (a00088_79510aa86d3fa0a0fc6cfc49b1da7279) 3482 0 R (a00088_8f6b08a5ba2a8d75ca7279e2056aa8c6) 3494 0 R (a00088_97f9e1fda815bfb8b1f4577c355ade20) 3528 0 R (a00088_a5f58074435cdc180f17de69651beebd) 3519 0 R (a00088_db7a3fadb68df5fdd37e8b91a2c751ea) 3503 0 R (a00088_e3aa9cc25e45b663e6aabc54c013019e) 3512 0 R (a00088_eb9fcbd3c9b0a795dcd63f33c323d65c) 3509 0 R (a00088_ef661afb3aa82f0437d2ed8d3c20be76) 3506 0 R (a00089) 996 0 R (a00089_aacd5fa1806e0f0dd0bc96dd36507ad8) 3537 0 R (a00090) 997 0 R (a00090_1abbbe7bc5d7d033c727691528b85b8d) 3549 0 R (a00090_b684c17bf48c8e3b3fcf97b06b4c6ee1) 3546 0 R (a00090_c9273cc1fcdaeeddc523ca9f34977e06) 3552 0 R (a00091) 998 0 R (a00091_0ec6a6cbcbfd191d393738c16d54e5e1) 3585 0 R (a00091_266ea23d75c83f15b915ce54100e51c5) 3594 0 R (a00091_308463cc7b3d45d2dbcdcedd4cde9bb9) 3570 0 R (a00091_4619e69ec86a47f6abe945b39ec7f63a) 3573 0 R (a00091_55be3d5413ce49c5c4f5576def12d7ec) 3576 0 R (a00091_55e7764a9f6ed05aaa98076b9f6770a5) 3579 0 R (a00091_7d472d8b3c41618d39c93c4ca92fb3f4) 3561 0 R (a00091_805f8fd5533a6d4b6793e0645005da4c) 3597 0 R (a00091_967def494c68cfc8a08d5a6c4dbbc25d) 3603 0 R (a00091_a3f2d9cb20290019b2743e8df31a2f8b) 3564 0 R (a00091_a6d51f3fa5da9b7f9cd37ae69600c04a) 3600 0 R (a00091_b15853725b233d526b291db0347d4ecd) 3567 0 R (a00091_babb9c2be394477af97f79507bcb4c86) 3582 0 R (a00091_e27f4949613fe3c1de5a839af01d99dd) 3588 0 R (a00091_fa0fe6ca88f692d22af70ff007411252) 3591 0 R (a00092) 999 0 R (a00092_4dc3294d67d705f7248ef57e4259424f) 3612 0 R (a00093) 1000 0 R (a00093_0c816f34c0187f2154c91a18d3ad87c8) 3661 0 R (a00093_1deb2899508216804823498a69378118) 3622 0 R (a00093_3983b45977630418d3038231aa8b68ed) 3642 0 R (a00093_3ad48284f7a91f78bb24096aad89056e) 3698 0 R (a00093_494ea6767a8a8fab7abe96b799d6c3b3) 3699 0 R (a00093_4f39f0fe6a820d260fe6cddf9ccaa832) 3686 0 R (a00093_5d8996950cdf3d8130cc3ad340eb9dff) 3657 0 R (a00093_6157452bdc9921f44b2e22e4b5969258) 3662 0 R (a00093_7675e6b9adbddbd545d3aac8ca092fbb) 3664 0 R (a00093_7a58d95f7f7827789ff52500e3d16c34) 3696 0 R (a00093_7f7bb2145afba5df00c6e10ddefa8ae1) 3658 0 R (a00093_8082509468b2ac80ed7746aa1a5bc4f7) 3663 0 R (a00093_8da121d6e50992ec55778f9b2141552d) 3666 0 R (a00093_b4622e2599ff3a592db09219b2641682) 3665 0 R (a00093_b6e9a75167bdddd561373bc5b6ef501c) 3697 0 R (a00093_b93e351c3abba0c700b26b7b07e9527d) 3660 0 R (a00093_dc69abadd5aa07c7d74f9292db2cd93c) 3659 0 R (a00093_e292b8977f6b81265bf14e1676face3e) 3652 0 R (a00093_e9205a565ea3c911a785fc4e87c91a58) 3700 0 R (a00094) 1001 0 R (a00094_025ffa46b799fa6952719c499a3ae17c) 3740 0 R (a00094_0f27e16ddcf7199d514968204966f559) 3722 0 R (a00094_2541fae506eb111ff1be2372e0919839) 3743 0 R (a00094_619d9755a5d4aaabdb2e5e6ea4c1e0bf) 3752 0 R (a00094_6af8a59d0ab8967aacea749d6e59ac90) 3749 0 R (a00094_71721395f1c7c42b8bcc111b339bea7c) 3746 0 R (a00094_7a59f0dad059786238d8ab604630e7f3) 3716 0 R (a00094_7f0ab3fe3bcf1e3ed9f5950cb4474ec1) 3755 0 R (a00094_85d7f35662f7be20cd84e789a290dd4b) 3719 0 R (a00094_8cf0ca17b115ff2e3071b3fabcc43b53) 3710 0 R (a00094_8d4e08d051b35b1c710c3be5b8bbfa05) 3734 0 R (a00094_a81fff4836049cb3c018304d77337554) 3737 0 R (a00094_af7a8a5310ad945de38f5b3ac755ae7d) 3728 0 R (a00094_c8f124419a231f38bb6cdf5041757a27) 3731 0 R (a00094_dc7001682017599549f57771f4cd1b9a) 3761 0 R (a00094_dde3cf9a57445814d01b3c67da08afdb) 3764 0 R (a00094_e1e60d56ea87dfa09230e25ca5ecf2fc) 3707 0 R (a00094_e45b31a0a277dd5325ad2a332358b21b) 3725 0 R (a00094_e57281f5bef284bc9545834ef8ed4a96) 3713 0 R (a00094_f4a1d8cfbe270393a2de02b0c743e474) 3758 0 R (a00095) 1002 0 R (a00095_280a0c2a93544e597f92bbacf36ee1dc) 3781 0 R (a00095_4da1d7815516cd2b5bda3a66fdf05198) 3784 0 R (a00095_8a661a2d544100b82d0d14a1985083d5) 3775 0 R (a00095_981392e295db4d024eea95805c51c371) 3778 0 R (a00095_c8afa29e0aa5e789d6929b366d98ba56) 3787 0 R (a00096) 1003 0 R (a00096_47140aa52cb9e6a2de38fdfc5da08df1) 3802 0 R (a00096_51bbbe3099c10ef26119ddc2aa51e35e) 3814 0 R (a00096_569382bc53aa64c227e57efe88fe13ac) 3805 0 R (a00096_6f8c65cfc8242197bcc3cb5b4735b16f) 3811 0 R (a00096_8587178a29882482be20c2822b402b96) 3808 0 R (a00096_858f970feb7462871c814953697a8ad7) 3835 0 R (a00096_a80e8d0fc768525fa3bfb3d4e4cf260d) 3820 0 R (a00096_b20096ae4953caaa42f6bb2373c4494c) 3826 0 R (a00096_be2c98748e180c1747823cd2fb8ecf0e) 3823 0 R (a00096_c92d2f194f096e84791f95d7e8f0ba92) 3832 0 R (a00096_e82f68cb91d8688a619d55d2a8572979) 3829 0 R (a00096_ed119a030ebd3bf7c30a12071c27d441) 3799 0 R (a00096_f1684ad96b8acf54154688df3883b801) 3796 0 R (a00096_f20186ef441ef5b600e8544a0f2d8d81) 3817 0 R (a00097) 1004 0 R (a00097_134ec55c3d5abaebfed4ff8edfedf1ea) 3862 0 R (a00097_2fca02673894f222b01ad2d3a4d7dd79) 3870 0 R (a00097_5960d82e7aca2986b8509a0d87d6cbc8) 3846 0 R (a00097_5a3116623c6a7da7c82db6c301ae0da3) 3865 0 R (a00097_606d2729bf411ade69044828403a72af) 3868 0 R (a00097_6925d46b2819adb474a5f0036f02dd7d) 3852 0 R (a00097_7092781c50dcad50f473888585c85b83) 3855 0 R (a00097_8ae6395641b7752dce47881e20cee970) 3849 0 R (a00097_a6487b9c1c773b32656065d0e19bf142) 3858 0 R (a00097_e87913860c6b05c6e6b060639b950098) 3860 0 R (a00097_fb60f42593d305ea36d9b4303722696e) 3873 0 R (a00100) 1064 0 R (a00101) 1065 0 R (a00102) 1066 0 R (a00102_2e52037249bb98d7bbecf42e275beb07) 3926 0 R (a00102_4350350ce0d4595876743d4c0a720bcc) 3918 0 R (a00102_55735650f879293d9b7b5fda6753d147) 3942 0 R (a00102_6a327c0ffd40f69fbcd5f01f12e5745c) 3922 0 R (a00102_6aaa9da3d0f8d4c0799516d46d939942) 3934 0 R (a00102_72d99b1623afa14bd58c667b748c2ddc) 3928 0 R (a00102_7bf0c086c7c41c12cc63324327932d91) 3946 0 R (a00102_876c82c946543cd70c141e41417138e0) 3944 0 R (a00102_8ee5e2c8e517d6e4f2198057f81e93c6) 3936 0 R (a00102_96eb4534b574ece96ed36806039f73d3) 3916 0 R (a00102_9f6c329c04baba17fe0f5b2a6597d713) 3932 0 R (a00102_bf4401501f1389872141a78b63f325a3) 3940 0 R (a00102_c72f8777ccc45ae274449ea7a9f3de04) 3930 0 R (a00102_dd685a0f8b5e76a2687cc0f306813bfb) 3924 0 R (a00102_e7250008b68d1909d54040515eef8ebb) 3920 0 R (a00102_ee60b8757bacab269b0ccd7c240bf01d) 3938 0 R (a00103) 1067 0 R (a00104) 1068 0 R (a00105) 1069 0 R (a00106) 1070 0 R (a00107) 1071 0 R (a00108) 1072 0 R (a00109) 1073 0 R (a00110) 1074 0 R (a00111) 1075 0 R (a00112) 1076 0 R (a00113) 1077 0 R (a00114) 1078 0 R (a00120) 1079 0 R (a00121) 1080 0 R (a00123) 1081 0 R (a00124) 1082 0 R (a00125) 1083 0 R (a00127) 1084 0 R (a00128) 1085 0 R (a00129) 1086 0 R (a00130) 1087 0 R (a00131) 1088 0 R (a00131_1273664aba3e6a2a46e87dcb1a5f19ad) 4480 0 R (a00131_1d5ce7047650f3ecee0814dbc8714099) 4488 0 R (a00131_5320d4457a472d8888ec1905bc0e0a1c) 4475 0 R (a00131_5f2e1fcf0055d20ce17664b1027bb9eb) 4477 0 R (a00131_692d80636342d564422ccd9296ad568d) 4491 0 R (a00131_88460bea09a462d0e22511cb567eee14) 4484 0 R (a00131_890e822616a6839dfbf51dcb591b8e99) 4482 0 R (a00132) 1111 0 R (a00132_1273664aba3e6a2a46e87dcb1a5f19ad) 4506 0 R (a00132_1d5ce7047650f3ecee0814dbc8714099) 4512 0 R (a00132_692d80636342d564422ccd9296ad568d) 4515 0 R (a00132_88460bea09a462d0e22511cb567eee14) 4508 0 R (a00132_890e822616a6839dfbf51dcb591b8e99) 4519 0 R (a00134) 1112 0 R (a00135) 1113 0 R (a00135_534d9e416324fb8ecca6b9cb4b1f6a6a) 4540 0 R (a00136) 1114 0 R (a00137) 1115 0 R (a00138) 1116 0 R (a00139) 1117 0 R (a00140) 1118 0 R (a00141) 1119 0 R (a00142) 657 0 R (a00142_authors) 1137 0 R (a00142_g155cba6121323726d02c00284428fed6) 1235 0 R (a00142_g2f8f70c30b9ee08a103fbd69a4365c4c) 1148 0 R (a00142_g2ffbb9e554e08a343ae2f9de4bedfdfc) 1144 0 R (a00142_g3d4c8bd4aada659eb34f5d2ffd3e7901) 1196 0 R (a00142_g7b04a0035bef29d905496c23bae066d2) 1146 0 R (a00142_g7b5319b5b65761a845fcd1500fde4cdc) 1215 0 R (a00142_g905451249dca72ce0385bf2a9ff178ee) 1233 0 R (a00142_g99e43010ec61327164466aa2d902de45) 1145 0 R (a00142_g9e97a0b4d5cc7764d8e19758f5da53ae) 1197 0 R (a00142_g9ff1e8936a8a26bff54c05f8a989b93b) 1219 0 R (a00142_gad14bbbf092b90aa0a5a4f9169504a8d) 1147 0 R (a00142_gcd3ac045f0a4ae63412e3b3d8780e8ab) 1232 0 R (a00142_gcfae9053e5c107a1aed6b228c917d2ea) 1217 0 R (a00142_ge3c821e3a388615528efda9d23c7d115) 1236 0 R (a00142_ge469332907e0617d72d5e2dd4297119d) 1221 0 R (a00142_ge6bae7dc0225468c8a5ac269df549892) 1143 0 R (a00142_gfa82b860a64b67d25ab3abc21811896f) 1234 0 R (a00142_pt-autovars) 1153 0 R (a00142_pt-desc) 1141 0 R (a00142_pt-impl) 1157 0 R (a00142_pt-scheduling) 1155 0 R (a00143) 649 0 R (a00143_g41bf109b6a45328d5744c0a76563fb6c) 1312 0 R (a00143_g54a466311575a727830a92a6c3621cb2) 1305 0 R (a00143_g5eced097547fd3fac4ba2a255493d921) 1307 0 R (a00143_gd85fc90c30d1fc37c63c4844be5fe09d) 1309 0 R (a00144) 651 0 R (a00144_g12b467f314489259dd718228d0827a51) 1341 0 R (a00144_g20bc87e5c063c3f4b01547be6e5a0148) 1338 0 R (a00144_g30e827f33eacff55ecb4d8fb5a11d5d1) 1345 0 R (a00144_g41d37ea1e3bd24f7b51e9409aceaaa80) 1342 0 R (a00144_g5323320b7316647042016f17c4e881be) 1344 0 R (a00144_gd8e8bc9bc0e2ea4a24a8a024fd3a7f7c) 1336 0 R (a00144_geb79c914cf137e6d27fd7583e5a66679) 1343 0 R (a00145) 652 0 R (a00145_g22f140b02c354dfebcc7ad481c3bcd68) 1382 0 R (a00145_gc48ed5f0d27721ef62a3ed02a5ad8d2e) 1378 0 R (a00146) 653 0 R (a00146_g1024f8a5fa65e82bf848b2e6590d9628) 678 0 R (a00146_g2c64c8c36bc84f9336f6a2184ea51883) 1409 0 R (a00146_ga4360412ee9350fba725f98a137169fe) 677 0 R (a00146_gb81e78f890dbbee50c533a9734b74fd9) 1411 0 R (a00146_gbaf0bb2b6a4424b4eb69e45e457c2583) 1407 0 R (a00146_gf20aaf4292cb0d2a1b10bc0a568b51fa) 1408 0 R (a00146_gf5c2ad5acf3cc23b8262e9ba6a15136b) 1410 0 R (a00146_gfd5ebb56a1bd1da9878aa886a2075e80) 1394 0 R (a00147) 655 0 R (a00147_g04b053a623aac7cd4195157d470661b3) 743 0 R (a00147_g0a8bb9d6d0f1f56852ccfccbbad6c5d8) 804 0 R (a00147_g1a1bc437c09ddef238abab41d77c3177) 716 0 R (a00147_g26a14b8dae3f861830af9e7cf1e03725) 715 0 R (a00147_g58bb90796c1cdad3aac2ecf44d87b20e) 750 0 R (a00147_g61db1dcb7c760e4dd5d60bf4e5576dca) 745 0 R (a00147_g64a238a5c02640a7a4aef004163aeb47) 1471 0 R (a00147_g79c4110211247df3fb30b8cf1c4c02af) 1520 0 R (a00147_g7b2ac4b18bd2ac3912fe67b3b17158c3) 749 0 R (a00147_g8096b0c4b543dc408f4dd031ddae7240) 773 0 R (a00147_g81ac47cee1c18f6aa479044069db7ca3) 805 0 R (a00147_g8411c95a4d89367ad2d9d6bde1a3d537) 1483 0 R (a00147_g88d2ccf7cd821f89d9a8df7e3948b56c) 746 0 R (a00147_ga20812098a4663c8a9fc4ce8e95391b6) 1516 0 R (a00147_ga87feebc7cffd4d8300e776cf64e4fec) 1492 0 R (a00147_ga8933ad15a2e2947dae4a5cff50e6007) 744 0 R (a00147_ga9de254b8aa308eb4aab17efdde622d2) 1484 0 R (a00147_gaa585784b0914cac1d37f07f85457008) 1518 0 R (a00147_gb5fecbc62edd128012cea0f47b57ab9f) 742 0 R (a00147_gdb971fb1525d0c5002f52125b05f3218) 772 0 R (a00147_gdd1ab3704ecd4900eec61a6897d32dc8) 771 0 R (a00147_gde6634974418e3240c212b9b16864368) 1485 0 R (a00147_ge5ab69d40013e6cf86ef1763c95d920e) 1517 0 R (a00147_gef14e83c046e19ab9fe9d1bbcca276c2) 1464 0 R (a00147_gef6c4140c632b6a406779342cf3b6eb6) 747 0 R (a00147_gf2dbaceb10c67783a115075b5b6d66df) 1515 0 R (a00147_gfbd5fc486dfdf6bf6fc9db52b1f418c4) 748 0 R (a00148) 1654 0 R (a00148_g118e9d76568ab81ad97f138d4ea1ddd2) 1668 0 R (a00148_g165b603ec150e26efec7be199c9c2901) 1683 0 R (a00148_g210e629f7252e4bc8458cbdf260b3318) 1677 0 R (a00148_g22fa0681cd463191d7a01fe85d86996f) 1680 0 R (a00148_g53fbda0e8c31d4882294c8dc3cb5f487) 1675 0 R (a00148_g69a7a4951ff21b302267532c21ee78fc) 1617 0 R (a00148_g6b16e0bac41821c1fbe0c267071642f0) 1678 0 R (a00148_g769512993b7b27271909d6daa4748b60) 1676 0 R (a00148_g87f0b54ade0d159fba495089128a4932) 774 0 R (a00148_g969d7fff37a979737da045e0d538a9bd) 1679 0 R (a00148_ga22b04cac8cf283ca12f028578bebc06) 1618 0 R (a00148_ge23534479ead15af8ff08ace26a47fb5) 1682 0 R (a00148_gffcd2fbe181e2aaefbf970551c302af5) 1681 0 R (a00149) 654 0 R (a00149_g12a33f0c09711167bdf3dd7d7cf8c5a1) 1748 0 R (a00150) 1760 0 R (a00150_g013c3a06a8b58589a77f4a3442f89c2a) 1923 0 R (a00150_g041aea91aa6ef84dcc6cac3c51db9b2f) 1809 0 R (a00150_g04b053a623aac7cd4195157d470661b3) 1997 0 R (a00150_g1215163245304bad20d6c5608ad75ab7) 1880 0 R (a00150_g12a33f0c09711167bdf3dd7d7cf8c5a1) 1755 0 R (a00150_g12f3bf821224b8e7b48a57ed3cea15cf) 1886 0 R (a00150_g1320fd0006a2f70138bc2d0018dda829) 1872 0 R (a00150_g13dfcb4a5f920e108253ade527a66cc2) 1835 0 R (a00150_g1425d4a0c2760adb653a04c0fb137a8d) 1878 0 R (a00150_g15f2617f7dc1713f9d10282125c6027b) 1862 0 R (a00150_g160128ab5d2ea3cc497b91ee4eb4ef99) 1827 0 R (a00150_g17d111686f98e4c09db73a770ac3f1a4) 1858 0 R (a00150_g1cea57e3ea526f210b1068e6dcf7b4f4) 1896 0 R (a00150_g1d3211dbbdfb22d6a47b60dddcf945e8) 1900 0 R (a00150_g1ef35301f43a5bbb9f89f07b5a36b9a0) 1519 0 R (a00150_g207d17b633cd095120a74bc1f2257b17) 1892 0 R (a00150_g20ceef9d0868d391c2f33041b02cb1f1) 1926 0 R (a00150_g20df5c82f2a15a508c19e505b5d9de2b) 2014 0 R (a00150_g210f227119fc972e6222c9cb452e15a9) 1981 0 R (a00150_g22f140b02c354dfebcc7ad481c3bcd68) 1990 0 R (a00150_g236d5c7872f59c8fe7b701c7252b976e) 2042 0 R (a00150_g24f52ac52d6e714cb04a5aa01be3bdd0) 1906 0 R (a00150_g266263ac78a1361a2b1d15741d3b0675) 1935 0 R (a00150_g28eda870cff3d8e3cf2949e6f57a502b) 1817 0 R (a00150_g2a0cf5d86c58fab216414ce59bf1fea1) 2049 0 R (a00150_g2addf34c7d457c1a7899a7e2171ef1e9) 679 0 R (a00150_g2d3ba4b14d6d2f6576f9b547800b7945) 1805 0 R (a00150_g3237be0d9ec457de0177689ee23c0d5c) 2011 0 R (a00150_g359951eecd80541c2101f628a9da9146) 1841 0 R (a00150_g39ce739bd352d7e348e37395ce903e43) 1793 0 R (a00150_g42288d5c3cf4b10becefec657f441e54) 1902 0 R (a00150_g4309376690872fa4beb4f025f5cc199b) 1913 0 R (a00150_g44b3b1ab31a403ba28ec135adfcbefef) 1874 0 R (a00150_g499bb98a0b4ae9a98553ede81317606d) 2023 0 R (a00150_g4cc3e223b63f27b546d62e9a258dba5a) 1894 0 R (a00150_g517c770991459cc62dc009c0d3875c6a) 1843 0 R (a00150_g561b8eda32e059d4e7397f776268cc63) 1998 0 R (a00150_g57e6dc1d58a36d0ed53a3dd29ccc5798) 1799 0 R (a00150_g5b5615dc240daed20949c0fded2b4679) 2033 0 R (a00150_g5c5b1834e497f53ad0ef947bbe9777fa) 1888 0 R (a00150_g5c97ae587595b5444be80f5ecc1d3382) 1813 0 R (a00150_g5ca559def464ef20d8b1f7d32f2f160d) 1870 0 R (a00150_g6020613f5062417d9811cfa837215c83) 1868 0 R (a00150_g62c03e0a308cc23929a80fe8d8f9dc1e) 1898 0 R (a00150_g64d9affc680a445d708234e70450477b) 1829 0 R (a00150_g6832e4d2d046536b6472f7ac92340f68) 681 0 R (a00150_g691688604655ea8943d15f14c60027d8) 1884 0 R (a00150_g6bc12c6c7b56f73ce5d57abfdcdc6eb5) 1854 0 R (a00150_g6bfa488f87f68a6f7f4a3efb9e45eaf8) 1791 0 R (a00150_g6f2b90c597ec23f39ec716ccec11233c) 1860 0 R (a00150_g7023a34ba9e9d03b5fbedbcb32924453) 1989 0 R (a00150_g788ffac72342f6172343d7f8099cbe1a) 1999 0 R (a00150_g79c4110211247df3fb30b8cf1c4c02af) 1993 0 R (a00150_g7d3673f52f5846b6961d23b150decd54) 2008 0 R (a00150_g8387881de3a8bfd3c0d57b9d04ac9b7e) 1904 0 R (a00150_g85b65e38aa74eba18979156f97a94a87) 680 0 R (a00150_g88e60aa2cf23e1c65d630701db08c743) 1866 0 R (a00150_g8af482dec973db57d8b3bd3f69461488) 1821 0 R (a00150_g96544dedc1cdc71ad2ad54bf1d5e5433) 1910 0 R (a00150_g9c0814ed491fa452ec97910c0728d410) 1921 0 R (a00150_g9c24fba2cd8f7f62accb0a0d5bbe4dad) 1992 0 R (a00150_g9ebb4dac683163840eab9c6c41ad61f7) 1929 0 R (a00150_g9ee50a40597e67fce96541ab56c3b712) 2000 0 R (a00150_g9f1822e1d231235edacad691f3cb7bbb) 1882 0 R (a00150_ga05a3dde2048480fa3ab2a5961898d18) 2029 0 R (a00150_ga22b04cac8cf283ca12f028578bebc06) 1996 0 R (a00150_ga4c4310e54f18541b09e1e251fe7b22d) 1801 0 R (a00150_ga533c394b1fa0030205534befa31c525) 1825 0 R (a00150_ga5e3c856b86725125d19fccc34cd9eb5) 1819 0 R (a00150_gaa585784b0914cac1d37f07f85457008) 1994 0 R (a00150_gabc40c09f49d15acb1b1a7f02bb3a807) 1807 0 R (a00150_gad0321f4c570f9983c6de81ece3ddc20) 1852 0 R (a00150_gae59b70658f28ee6e998eaaab05e423f) 1823 0 R (a00150_gb4ef6b00924990e7a293f66715b6d1d1) 2005 0 R (a00150_gb6683dd83fe1c8de9a24086d4b69e907) 1944 0 R (a00150_gb81e78f890dbbee50c533a9734b74fd9) 1453 0 R (a00150_gb9435261753469accec0c9bf8a5a2686) 1917 0 R (a00150_gb948296aea6b6b3aa1f156799c4d479c) 1856 0 R (a00150_gc48ed5f0d27721ef62a3ed02a5ad8d2e) 1991 0 R (a00150_gc84f499cba8a02fc0e306c10b2acabf0) 1876 0 R (a00150_gd135fb0cfdfb2c212f0f51865a3640e4) 1833 0 R (a00150_gd58231410d58e34b455328b888a9e73c) 1890 0 R (a00150_gd605357e29affb0d3104294c90f09905) 1811 0 R (a00150_gdd1ab3704ecd4900eec61a6897d32dc8) 1995 0 R (a00150_gde29ec025e6754afd8cc24c954a8dec8) 1837 0 R (a00150_ge0825474feee11b4e038bfe71757875f) 1847 0 R (a00150_geb533744817cf6695d75293369c2248b) 1984 0 R (a00150_gee37386b2ab828787c05227eb109def7) 1864 0 R (a00150_gf0ccbc3bb2a3ba1ebc255c7b3fcedd24) 1815 0 R (a00150_gf0ed78fd2be24d849cdd5af75e3b2674) 1797 0 R (a00150_gf703683056d2bfa5c81fa157dcb20fe2) 1406 0 R (a00150_gf72d7b9a737707dcfb2c41fec2b6792e) 1845 0 R (a00150_gf84316f469ce0726985c0702db49a989) 1803 0 R (a00150_gf848ce44c810492e7a35c2d23a429f45) 1795 0 R (a00150_gfff0ed43201bf1e2020de1a0d6cac070) 1831 0 R (a00151) 1777 0 R (a00151_g2a0cf5d86c58fab216414ce59bf1fea1) 2184 0 R (a00151_g2addf34c7d457c1a7899a7e2171ef1e9) 2193 0 R (a00151_g6832e4d2d046536b6472f7ac92340f68) 2188 0 R (a00151_g85b65e38aa74eba18979156f97a94a87) 2194 0 R (a00151_gb6683dd83fe1c8de9a24086d4b69e907) 2192 0 R (a00152) 1775 0 R (a00152_g03d140db75de3d3cdfbbab1c4fed8d8d) 2220 0 R (a00152_g058a8e6025f67b021862281f1911fcef) 2257 0 R (a00152_g06ba7b414e718081998f2814090debf1) 2228 0 R (a00152_g24f52ac52d6e714cb04a5aa01be3bdd0) 2232 0 R (a00152_g2d9d28afa353f662b9bb5234fc419f72) 2239 0 R (a00152_g3e1562e8a6de32268e5df92a52152f91) 2218 0 R (a00152_g499bb98a0b4ae9a98553ede81317606d) 2250 0 R (a00152_g54b27e45df15e10a0eb1a3e3a91417d2) 1420 0 R (a00152_g737337d6a51e31b236c8233d024138a8) 2224 0 R (a00152_g7a7c46ffaba30477b8c9e3e61bd2e106) 2226 0 R (a00152_g902c4a360134096224bc2655f623aa5f) 2243 0 R (a00152_g9f2196e2705036869611962425e404bf) 2235 0 R (a00152_gbb558f3a9b1ec015e83c314aba694e35) 2222 0 R (a00152_gbb56b549f7ab4d86e1cc39b8afc70d1e) 2230 0 R (a00153) 650 0 R (a00153_g156dd2891a57035e4afdc4c2bc0b0ebf) 2371 0 R (a00153_g15de27b044603284f68db05a378235a7) 2344 0 R (a00153_g196379ceb1219a99f4495e41ccc9bbfb) 2324 0 R (a00153_g21664b7441cfa37d280228d23316d609) 2370 0 R (a00153_g24aa5bc36939cc9a0833e1df01478a7e) 2346 0 R (a00153_g285a80366aed9428f64282b8d13c918b) 2374 0 R (a00153_g2bc3b489923793759526a3181eb667fa) 2349 0 R (a00153_g3001114ddadc1f2ada5cc9a780e866fc) 2284 0 R (a00153_g3090117ef3ff5775b77cb1960e442d07) 2351 0 R (a00153_g3589822ecb9d9c4145209756396b8a6b) 2368 0 R (a00153_g3f6f1f6f98431f2d33ed30a30d2ccc35) 2276 0 R (a00153_g41aa744caa46913b3b3aedb2a4e78546) 713 0 R (a00153_g4910467b83a639f06739c82cd362037e) 2347 0 R (a00153_g4caecabca98b43919dd11be1c0d4cd8e) 1321 0 R (a00153_g51195ea7cd5aa387a87f9d3b23905b62) 2314 0 R (a00153_g51c1cd531ff0afb81620151f2248cd21) 2343 0 R (a00153_g529648ad3b0b327a43689b0f1779ff55) 2290 0 R (a00153_g5726142fec34f35fb9ea19e5a45975c6) 2369 0 R (a00153_g5b9dba2123705bce1ce95c3deca0bdad) 2348 0 R (a00153_g67cf1e0d2324c93f332c1f020c0fe8b3) 2345 0 R (a00153_g6836f92f3692f3a4429eb599db40cbae) 2388 0 R (a00153_g69646a81a922033c5281445a71f8ffed) 2395 0 R (a00153_g727459e5c4f777543c81ffffa3df3f0c) 2313 0 R (a00153_g763f12007aad8cc0e483bf50f8a8d9b4) 2286 0 R (a00153_g77570ac4fcab86864fa1916e55676da2) 1385 0 R (a00153_g8f4ebd8ef6c0ea665ed351d87fec09fd) 2342 0 R (a00153_g9069474ea570fd78c481aa164317dbaf) 2315 0 R (a00153_g92f3344ec8ca46893163399c89fafed5) 2319 0 R (a00153_g974c9b4bbe6b07cc1d64ac4fad278030) 2278 0 R (a00153_g9dd44616d41cef74d3beb51d8be5ecec) 2288 0 R (a00153_ga92afb113e122f860392bfbd385f842e) 2396 0 R (a00153_gac0de06236b02659460445de30776e00) 2340 0 R (a00153_gb1455b27c06532a399cf06d2c1d6d08d) 2350 0 R (a00153_gb58e1ceb7cb73ca2bcd73146b6c1b4e7) 2373 0 R (a00153_gb61381673de27f31848c5396bf0b338e) 2317 0 R (a00153_gb6e04358481bd2057524fb874cfa472b) 2386 0 R (a00153_gc3882366feda1cb759ccbfe98327a7db) 2307 0 R (a00153_gca1240bba5dd57f8c7c27123c84a1f6d) 2282 0 R (a00153_gcacc406c3bf7d0e00412e4c946252739) 2280 0 R (a00153_gdcf372ff9748996f7c05e9822a615384) 2310 0 R (a00153_ge0f8cbeca9731af2171ffd37e79de893) 2316 0 R (a00153_ge6f4a2453dbd8bc60e6a82774552366a) 2372 0 R (a00153_gf5fe83be78b78b9e7d9e7f1e34ab1cc5) 2341 0 R (a00153_gf963fdea2b75d27ef31e92d1d01359ee) 2318 0 R (a00154) 1776 0 R (a00154_gb4b17aaf20d630f30919b19937b966a3) 2497 0 R (a00155) 1165 0 R (a00155_g1ec8b8f4710dce1fa7fb87d3a31541ae) 2513 0 R (a00155_g2bdc4b7b4038454a79f1b2a94a6d2a98) 2526 0 R (a00155_g2c1bb4fa6d7a6ff951a41c73fc721109) 2511 0 R (a00155_g3983e0c026396d5c4506779d770007ba) 2524 0 R (a00155_g44311ecc30759ca38b4069182247bdae) 2509 0 R (a00155_gca51ceb2f5d855dfde55bcedf8d3b92d) 2517 0 R (a00155_gd8eec328a4868d767f0c00c8d1c6cfc1) 2515 0 R (a00156) 2532 0 R (a00156_g6614d96fdfcd95c95ec6e6f63071ff51) 2551 0 R (a00156_g6d71dececfce707c668e6257aad5906e) 2554 0 R (a00156_gcb807bd57e5489b386b876af5c1f163a) 2553 0 R (a00156_gedaf3e48c2b04229b85455fb948468d6) 2552 0 R (a00157) 2550 0 R (a00157_g78ab77b57cf2e00089f0a3a22508524c) 2601 0 R (a00157_ge3ced0551b26c9b99cb45a86f34d100a) 2595 0 R (a00157_ge5b7160f2e653725ba5e2024c3cb7bff) 2603 0 R (a00158) 656 0 R (a00158_g10d9a9201cba1a6db623284c475c6cea) 2674 0 R (a00158_g26ae707402e494f3895a9f012a93ea29) 2628 0 R (a00158_g2ebfe5c8a7f3173714efdf2df74fc392) 2682 0 R (a00158_g3178402dd725776415bf9745e7bf92ba) 2662 0 R (a00158_g3b19f65e48079d8105be2a99b5b4b2ae) 2667 0 R (a00158_g4a264bb64ae706d53f572b1d9e4037a2) 2680 0 R (a00158_g4ab2de595d36e9e55dd61f6ecd139162) 2678 0 R (a00158_g55ce98ea4d6f22e9d5068b904d4d2447) 2681 0 R (a00158_g5d56800f82bfc7bbf53bb4a659589812) 2675 0 R (a00158_g70d236d1cf34b4e21836edda60247b70) 2629 0 R (a00158_g84901a5aa60040e96d272a69977edd22) 2626 0 R (a00158_ga87ff36af81990e6ffe20d76d5e4606f) 2656 0 R (a00158_gb0ad55aa96dd1d200cd0fc5a99f6a4f7) 2673 0 R (a00158_gb5d9c0becf7cb32d0aaef466839dd92e) 2677 0 R (a00158_gc7cc1dba1819f7fcdaa9ff9eed5a08f4) 2679 0 R (a00158_gd895ab98c54d9966ff554aa873151751) 2676 0 R (a00158_gfa11b2a1faf395ae2a6626e01c482d5d) 2627 0 R (a00159) 2757 0 R (a00159_g720ac440c7b24bdd07c53ba146e36fb2) 2772 0 R (a00159_ga680bc3f3a1a8a6aec20fe729d138cb8) 2770 0 R (a00159_gceb952d27de8125d5146ac0bee325b8f) 2787 0 R (a00159_gd58a6c7e62ae59bf7a016ded12ca2910) 2788 0 R (a00159_gf31774d02a69fd3f1c2b282454438cba) 2785 0 R (a00159_gfe5e93119035e14cc485760a176249ba) 2786 0 R (a00160) 1315 0 R (a00160_g070d2ce7b6bb7e5c05602aa8c308d0c4) 2834 0 R (a00160_g221d37ccde7e3fd0dd2c2eb0a6b15493) 2838 0 R (a00160_g3191066cf8f76bd00b6843b77c37068f) 2858 0 R (a00160_g3d768e989e308144190ae1a5ddfa9726) 2832 0 R (a00160_g66d19181ad5fe8b8f7c84d1f1d46a2ec) 2854 0 R (a00160_g6d9751d534453425c7a5a215d1d4414c) 2856 0 R (a00160_g7c5359305008e9183b18d6ab75f568bf) 2841 0 R (a00160_gb50f78bbf36d912d69f6c1685d0b40e3) 2849 0 R (a00160_gdf916e0c752f5cda70d0bddb2be422ba) 2857 0 R (a00160_ge4dcbbe6c641d2e3b8537b479df5fc99) 2855 0 R (a00160_gecf13b8dc783db2202ca5c34fe117fc3) 2836 0 R (a00161) 1316 0 R (a00161_g029256bc17a12e1e86781887e11c0c7d) 2901 0 R (a00161_g17ccd786400fd08b941e11046df1668f) 2917 0 R (a00161_g28cf9765e4b57451af559ab988ad7160) 2915 0 R (a00161_g3212e70c55244608ac16316888c354f0) 2905 0 R (a00161_g34b924954ba5707d536df28d71a80d39) 2911 0 R (a00161_g37e3103b9591790d484a450525739661) 2929 0 R (a00161_g64807ba7c221ddf735572d05021539f2) 2921 0 R (a00161_g6cda47c85ce1b58b501b44ac9cccc50e) 2907 0 R (a00161_g9e97c58fe35f750ad192774be9408ac8) 2913 0 R (a00161_gb1fc692a2700b7a51517724364683f67) 2928 0 R (a00161_gbc331f73107958428bf1c392ba19b6f4) 2923 0 R (a00161_gcff75c8c930abd6ff168e85373a4eb92) 2903 0 R (a00161_gf0349a8481565e80f55a751e2b408d6d) 2930 0 R (a00161_gf7dd2757d1e766f65b01ba7c91c660a0) 2909 0 R (a00162) 1317 0 R (a00162_g123c95a7bb55143cabba92446ce8f513) 3020 0 R (a00162_g19709735f29dafeabb91e0882231f9f1) 2968 0 R (a00162_g26440a35353cb457747a4cea372c62e9) 2956 0 R (a00162_g30fe27cba3c14ae7f9a7f118144af43a) 2958 0 R (a00162_g3212e70c55244608ac16316888c354f0) 2962 0 R (a00162_g3318dec654781e9d6d8ec873636660c6) 2984 0 R (a00162_g3a4852e2372e34e1c0142d1147fbe027) 2988 0 R (a00162_g4647b76d0ef50a5305505041f5775a37) 2993 0 R (a00162_g5025948dd998f65a13a375a37aa5edf5) 2972 0 R (a00162_g52c3c5ab1b1aa0659b5e465f7fbcc409) 3001 0 R (a00162_g57aca709a33690cd4fb73fe199fa1bdd) 2978 0 R (a00162_g69b075ef7e4d7bcf5a903d3d75baac02) 3013 0 R (a00162_g6b2d00412304e2d95e7b853cce5858b0) 2982 0 R (a00162_g6cda47c85ce1b58b501b44ac9cccc50e) 2964 0 R (a00162_g7e904ab59f7ee134cf3218a8219e7e29) 2970 0 R (a00162_g82ff99d50221f7c17df57dc6092ffc97) 3007 0 R (a00162_g86beee1f69d05b16022dfb430470e9ce) 3016 0 R (a00162_g8b600918f84783490fd791ce773175ab) 2980 0 R (a00162_g984c4a8b65a3cb35460b073a40568c25) 3003 0 R (a00162_gaa60ca995565b799bb958c806e933665) 2990 0 R (a00162_gaaaaf66ea67900c36d01136d5bad1168) 2976 0 R (a00162_gbfc1d8d15852318927cda30e1bc0470a) 2974 0 R (a00162_gd1f18f739da7703628c3663209463a0d) 3021 0 R (a00162_ge28f6cb60e86088d8886d0f804b4f37c) 2960 0 R (a00162_ge429c985be88ed048f382511c9ff00de) 2966 0 R (a00162_gf11c966b0e4f4ecaa73deb14bfb6830f) 3019 0 R (a00162_gf784a76fe619452eddf87e6376a4bf9d) 2986 0 R (a00163) 1318 0 R (a00163_g03070adbf8faab0f34f87c1270964306) 3047 0 R (a00163_gb97849f0d3ea858eee790b69591e6427) 3049 0 R (a00163_ge28f6cb60e86088d8886d0f804b4f37c) 3044 0 R (a00164) 1319 0 R (a00164_g0e0ea5f24b77f124ba33bcbc7ede5bfb) 3134 0 R (a00164_g1d34be506a61db90dd7829117efdf8cf) 3120 0 R (a00164_g23705efb9077187881f094fc9be13bde) 3102 0 R (a00164_g2a939aa4fcffabbce1dc1f784a7e0ad3) 3135 0 R (a00164_g31be289fd8ec3fe09b0088165d13976d) 3072 0 R (a00164_g3212e70c55244608ac16316888c354f0) 3090 0 R (a00164_g38af81a4c9884ce89803fc3e52383112) 3088 0 R (a00164_g3caacabb2fe1c71921e1a471719ccbd2) 3116 0 R (a00164_g40fb1fb2d990ce04ae9bbee275627c03) 3082 0 R (a00164_g41e616d3fcc17e0aabfe8ab45ef0d30f) 3133 0 R (a00164_g4433d3af16ea083a81576d0f18ba57c9) 3132 0 R (a00164_g4d457c50e6f2cef57167c3804ce8bf7c) 3078 0 R (a00164_g5a5bfd7e9060903893481db90645187b) 3068 0 R (a00164_g6b942c1ef22f8cd1a726ef3364c9fbea) 3101 0 R (a00164_g6cda47c85ce1b58b501b44ac9cccc50e) 3092 0 R (a00164_g71e1b022f7b7fa3a154f19372b239935) 3094 0 R (a00164_g863c94b0ed4a76997e53a3ccd5d0b6c3) 3080 0 R (a00164_g8714af98a550f10dc814db92b08d1b0d) 3074 0 R (a00164_g9e6d2864f390a4ba1ac60dc65e2b9815) 3122 0 R (a00164_gc4357cec23abca29d2bb885803625a6a) 3076 0 R (a00164_gc4b119801e50cc1824498a1cdf9adc37) 3100 0 R (a00164_gd895686859ae7d178d31be04eb0a1a97) 3086 0 R (a00164_gda99954e0f6905091885934e86c278cc) 3084 0 R (a00164_gdc5aec3587b2c55b714a6c2f37b56cba) 3097 0 R (a00164_ge28f6cb60e86088d8886d0f804b4f37c) 3070 0 R (a00164_gf11d9915ec12a8cdd9fdcbb5e8fcd5c7) 3103 0 R (a00164_gf8f12c820cc08da32aa62898bfc02db3) 3104 0 R (a00164_gf9385ef9ecc74c7d53ff2f15e62bfde3) 3131 0 R (a00165) 1320 0 R (a00165_g14e276fa8e765f774f4162619f1c8fc1) 3220 0 R (a00165_g1dbc635a2924806f42d7e3273a6a69b5) 3228 0 R (a00165_g3212e70c55244608ac16316888c354f0) 3208 0 R (a00165_g648ddfb2dde2cc55034e4e0ea41cb6d1) 3225 0 R (a00165_g71e1b022f7b7fa3a154f19372b239935) 3210 0 R (a00165_g79f9a50c2cccb967d38a2eeb45d2fd75) 3214 0 R (a00165_g7d7920c1e51cc4eef80206ebd6fee3f4) 3204 0 R (a00165_g820fb27c50e7bb4ac6d9eae1b06630a5) 3218 0 R (a00165_g8a645f8831837320c4e0c704e871abcf) 3206 0 R (a00165_gc364305cee969a0be43c071722b136e6) 3229 0 R (a00165_ge3f8f7deae69854853b0c8ebb82c380d) 3212 0 R (a00165_ge6f849e94cf6e214be8ffa9a548ecfcd) 3223 0 R (a00165_gf7dd2757d1e766f65b01ba7c91c660a0) 3216 0 R (a00171) 3890 0 R (a00172) 3905 0 R (a00173) 3956 0 R (a00174) 3985 0 R (a00175) 4017 0 R (a00176) 4037 0 R (a00177) 4059 0 R (a00178) 4075 0 R (a00179) 4104 0 R (a00180) 4123 0 R (a00181) 4150 0 R (a00182) 4182 0 R (a00183) 4205 0 R (a00184) 4219 0 R (a00185) 4240 0 R (a00187) 4258 0 R (a00188) 4282 0 R (a00190) 4299 0 R (a00191) 4316 0 R (a00192) 4324 0 R (a00194) 4354 0 R (a00195) 4403 0 R (a00196) 4447 0 R (a00197) 4466 0 R (a00198) 4495 0 R (a00199) 4521 0 R (a00201) 4531 0 R (a00202) 4576 0 R (a00203) 4670 0 R (a00204) 4857 0 R (a00205) 4878 0 R (a00206) 4902 0 R (a00207) 4919 0 R (a00208) 4977 0 R (chapter*.1) 500 0 R (chapter.1) 6 0 R (chapter.2) 46 0 R (chapter.3) 54 0 R (chapter.4) 62 0 R (chapter.5) 70 0 R (chapter.6) 78 0 R (chapter.7) 178 0 R (chapter.8) 266 0 R (chapter.9) 406 0 R (index) 632 0 R (main_api) 685 0 R (main_appevents) 694 0 R (main_arch) 668 0 R (main_checksums) 669 0 R (main_closing) 729 0 R (main_congestioncontrol) 862 0 R (main_connect) 759 0 R (main_connstate) 697 0 R (main_delack) 871 0 R (main_errors) 734 0 R (main_example1) 768 0 R (main_example2) 784 0 R (main_example3) 791 0 R (main_example4) 793 0 R (main_example5) 802 0 R (main_example6) 812 0 R (main_examples) 767 0 R (main_flowcontrol) 860 0 R (main_icmp) 840 0 R (main_ip) 834 0 R (main_ipbroadcast) 838 0 R (main_ipreass) 836 0 R (main_listeb) 848 0 R (main_listen) 741 0 R (main_longarith) 673 0 R (main_mainloop) 662 0 R (main_memory) 676 0 R (main_performance) 866 0 R (main_polling) 738 0 R (main_protoimpl) 828 0 R (main_rawapi) 688 0 R (main_recvdata) 706 0 R (main_rexmit) 854 0 R (main_rexmitdata) 725 0 R (main_rttest) 852 0 R (main_senddata) 711 0 R (main_slidingwindow) 850 0 R (main_tcp) 842 0 R (main_tcpip) 661 0 R (main_uIPIntroduction) 647 0 R (main_urgdata) 864 0 R (page.1) 478 0 R (page.10) 797 0 R (page.100) 2738 0 R (page.101) 2752 0 R (page.102) 2756 0 R (page.103) 2792 0 R (page.104) 2813 0 R (page.105) 2823 0 R (page.106) 2862 0 R (page.107) 2881 0 R (page.108) 2893 0 R (page.109) 2934 0 R (page.11) 809 0 R (page.110) 2946 0 R (page.111) 2999 0 R (page.112) 3025 0 R (page.113) 3035 0 R (page.114) 3054 0 R (page.115) 3108 0 R (page.116) 3139 0 R (page.117) 3155 0 R (page.118) 3172 0 R (page.119) 3187 0 R (page.12) 817 0 R (page.120) 3194 0 R (page.121) 3233 0 R (page.122) 3242 0 R (page.123) 3246 0 R (page.124) 3290 0 R (page.125) 3306 0 R (page.126) 3316 0 R (page.127) 3346 0 R (page.128) 3361 0 R (page.129) 3393 0 R (page.13) 825 0 R (page.130) 3404 0 R (page.131) 3414 0 R (page.132) 3446 0 R (page.133) 3462 0 R (page.134) 3478 0 R (page.135) 3518 0 R (page.136) 3534 0 R (page.137) 3543 0 R (page.138) 3558 0 R (page.139) 3609 0 R (page.14) 833 0 R (page.140) 3619 0 R (page.141) 3670 0 R (page.142) 3704 0 R (page.143) 3770 0 R (page.144) 3793 0 R (page.145) 3841 0 R (page.146) 3879 0 R (page.147) 3883 0 R (page.148) 3894 0 R (page.149) 3909 0 R (page.15) 846 0 R (page.150) 3960 0 R (page.151) 3967 0 R (page.152) 3989 0 R (page.153) 3999 0 R (page.154) 4021 0 R (page.155) 4041 0 R (page.156) 4049 0 R (page.157) 4063 0 R (page.158) 4079 0 R (page.159) 4108 0 R (page.16) 859 0 R (page.160) 4127 0 R (page.161) 4154 0 R (page.162) 4162 0 R (page.163) 4186 0 R (page.164) 4199 0 R (page.165) 4209 0 R (page.166) 4223 0 R (page.167) 4244 0 R (page.168) 4262 0 R (page.169) 4286 0 R (page.17) 870 0 R (page.170) 4303 0 R (page.171) 4320 0 R (page.172) 4328 0 R (page.173) 4358 0 R (page.174) 4383 0 R (page.175) 4407 0 R (page.176) 4434 0 R (page.177) 4451 0 R (page.178) 4470 0 R (page.179) 4499 0 R (page.18) 876 0 R (page.180) 4525 0 R (page.181) 4535 0 R (page.182) 4580 0 R (page.183) 4629 0 R (page.184) 4652 0 R (page.185) 4674 0 R (page.186) 4699 0 R (page.187) 4720 0 R (page.188) 4760 0 R (page.189) 4807 0 R (page.19) 880 0 R (page.190) 4841 0 R (page.191) 4861 0 R (page.192) 4882 0 R (page.193) 4906 0 R (page.194) 4923 0 R (page.195) 4942 0 R (page.196) 4961 0 R (page.197) 4981 0 R (page.198) 4985 0 R (page.199) 4989 0 R (page.2) 493 0 R (page.20) 909 0 R (page.200) 4994 0 R (page.201) 4998 0 R (page.202) 5002 0 R (page.203) 5006 0 R (page.204) 5010 0 R (page.205) 5014 0 R (page.206) 5019 0 R (page.207) 5023 0 R (page.208) 5027 0 R (page.209) 5031 0 R (page.21) 913 0 R (page.210) 5035 0 R (page.211) 5039 0 R (page.212) 5044 0 R (page.213) 5048 0 R (page.214) 5052 0 R (page.215) 5056 0 R (page.216) 5060 0 R (page.217) 5064 0 R (page.218) 5069 0 R (page.219) 5073 0 R (page.22) 938 0 R (page.220) 5077 0 R (page.221) 5081 0 R (page.222) 5085 0 R (page.223) 5089 0 R (page.224) 5094 0 R (page.225) 5098 0 R (page.226) 5102 0 R (page.227) 5106 0 R (page.228) 5110 0 R (page.229) 5114 0 R (page.23) 942 0 R (page.230) 5119 0 R (page.231) 5123 0 R (page.232) 5127 0 R (page.233) 5131 0 R (page.234) 5135 0 R (page.235) 5140 0 R (page.236) 5145 0 R (page.237) 5149 0 R (page.238) 5153 0 R (page.239) 5157 0 R (page.24) 1008 0 R (page.240) 5161 0 R (page.241) 5165 0 R (page.242) 5170 0 R (page.243) 5174 0 R (page.244) 5178 0 R (page.245) 5182 0 R (page.246) 5186 0 R (page.247) 5190 0 R (page.248) 5195 0 R (page.249) 5199 0 R (page.25) 1012 0 R (page.250) 5203 0 R (page.251) 5276 0 R (page.252) 5344 0 R (page.253) 5429 0 R (page.254) 5495 0 R (page.255) 5577 0 R (page.26) 1092 0 R (page.27) 1123 0 R (page.28) 1128 0 R (page.29) 1152 0 R (page.3) 568 0 R (page.30) 1169 0 R (page.31) 1201 0 R (page.32) 1241 0 R (page.33) 1259 0 R (page.34) 1271 0 R (page.35) 1287 0 R (page.36) 1294 0 R (page.37) 1325 0 R (page.38) 1349 0 R (page.39) 1359 0 R (page.4) 608 0 R (page.40) 1371 0 R (page.41) 1389 0 R (page.42) 1415 0 R (page.43) 1424 0 R (page.44) 1441 0 R (page.45) 1457 0 R (page.46) 1461 0 R (page.47) 1489 0 R (page.48) 1524 0 R (page.49) 1544 0 R (page.5) 693 0 R (page.50) 1571 0 R (page.51) 1589 0 R (page.52) 1602 0 R (page.53) 1622 0 R (page.54) 1642 0 R (page.55) 1653 0 R (page.56) 1687 0 R (page.57) 1705 0 R (page.58) 1714 0 R (page.59) 1723 0 R (page.6) 720 0 R (page.60) 1730 0 R (page.61) 1742 0 R (page.62) 1759 0 R (page.63) 1781 0 R (page.64) 1851 0 R (page.65) 1948 0 R (page.66) 2004 0 R (page.67) 2059 0 R (page.68) 2076 0 R (page.69) 2091 0 R (page.7) 754 0 R (page.70) 2104 0 R (page.71) 2119 0 R (page.72) 2141 0 R (page.73) 2162 0 R (page.74) 2167 0 R (page.75) 2198 0 R (page.76) 2210 0 R (page.77) 2247 0 R (page.78) 2261 0 R (page.79) 2268 0 R (page.8) 778 0 R (page.80) 2296 0 R (page.81) 2323 0 R (page.82) 2355 0 R (page.83) 2378 0 R (page.84) 2400 0 R (page.85) 2418 0 R (page.86) 2429 0 R (page.87) 2439 0 R (page.88) 2473 0 R (page.89) 2490 0 R (page.9) 790 0 R (page.90) 2502 0 R (page.91) 2531 0 R (page.92) 2558 0 R (page.93) 2578 0 R (page.94) 2589 0 R (page.95) 2608 0 R (page.96) 2633 0 R (page.97) 2686 0 R (page.98) 2705 0 R (page.99) 2721 0 R (section*.10) 1207 0 R (section*.100) 3407 0 R (section*.101) 3419 0 R (section*.102) 3450 0 R (section*.103) 3469 0 R (section*.104) 3481 0 R (section*.105) 3536 0 R (section*.106) 3545 0 R (section*.107) 3560 0 R (section*.108) 3611 0 R (section*.109) 3621 0 R (section*.11) 1209 0 R (section*.110) 3706 0 R (section*.111) 3774 0 R (section*.112) 3795 0 R (section*.113) 3845 0 R (section*.114) 3887 0 R (section*.115) 3898 0 R (section*.116) 3900 0 R (section*.117) 3902 0 R (section*.118) 3913 0 R (section*.119) 3949 0 R (section*.12) 1214 0 R (section*.120) 3971 0 R (section*.121) 3976 0 R (section*.122) 3978 0 R (section*.123) 4003 0 R (section*.124) 4011 0 R (section*.125) 4025 0 R (section*.126) 4027 0 R (section*.127) 4034 0 R (section*.128) 4042 0 R (section*.129) 4053 0 R (section*.13) 1296 0 R (section*.130) 4055 0 R (section*.131) 4067 0 R (section*.132) 4083 0 R (section*.133) 4098 0 R (section*.134) 4112 0 R (section*.135) 4114 0 R (section*.136) 4118 0 R (section*.137) 4121 0 R (section*.138) 4131 0 R (section*.139) 4144 0 R (section*.14) 1304 0 R (section*.140) 4166 0 R (section*.141) 4168 0 R (section*.142) 4171 0 R (section*.143) 4174 0 R (section*.144) 4203 0 R (section*.145) 4213 0 R (section*.146) 4215 0 R (section*.147) 4217 0 R (section*.148) 4227 0 R (section*.149) 4237 0 R (section*.15) 1327 0 R (section*.150) 4248 0 R (section*.151) 4266 0 R (section*.152) 4268 0 R (section*.153) 4272 0 R (section*.154) 4291 0 R (section*.155) 4296 0 R (section*.156) 4308 0 R (section*.157) 4314 0 R (section*.158) 4332 0 R (section*.159) 4335 0 R (section*.16) 1373 0 R (section*.160) 4373 0 R (section*.161) 4387 0 R (section*.162) 4389 0 R (section*.163) 4392 0 R (section*.164) 4398 0 R (section*.165) 4408 0 R (section*.166) 4413 0 R (section*.167) 4418 0 R (section*.168) 4420 0 R (section*.169) 4425 0 R (section*.17) 1391 0 R (section*.170) 4438 0 R (section*.171) 4455 0 R (section*.172) 4457 0 R (section*.173) 4474 0 R (section*.174) 4479 0 R (section*.175) 4503 0 R (section*.176) 4505 0 R (section*.177) 4529 0 R (section*.178) 4539 0 R (section*.179) 4581 0 R (section*.18) 1401 0 R (section*.180) 4614 0 R (section*.181) 4656 0 R (section*.182) 4664 0 R (section*.183) 4769 0 R (section*.184) 4776 0 R (section*.185) 4812 0 R (section*.186) 4845 0 R (section*.187) 4865 0 R (section*.188) 4873 0 R (section*.189) 4886 0 R (section*.19) 1463 0 R (section*.190) 4888 0 R (section*.191) 4894 0 R (section*.192) 4899 0 R (section*.193) 4910 0 R (section*.194) 4914 0 R (section*.195) 4924 0 R (section*.196) 4928 0 R (section*.197) 4943 0 R (section*.198) 4946 0 R (section*.199) 4953 0 R (section*.2) 1163 0 R (section*.20) 1498 0 R (section*.200) 4955 0 R (section*.201) 4965 0 R (section*.21) 1656 0 R (section*.22) 1670 0 R (section*.23) 1744 0 R (section*.24) 1762 0 R (section*.25) 1765 0 R (section*.26) 1782 0 R (section*.27) 1790 0 R (section*.28) 1925 0 R (section*.29) 1934 0 R (section*.3) 1173 0 R (section*.30) 1975 0 R (section*.31) 2169 0 R (section*.32) 2171 0 R (section*.33) 2183 0 R (section*.34) 2212 0 R (section*.35) 2215 0 R (section*.36) 2217 0 R (section*.37) 2238 0 R (section*.38) 2249 0 R (section*.39) 2272 0 R (section*.4) 1175 0 R (section*.40) 2275 0 R (section*.41) 2300 0 R (section*.42) 2304 0 R (section*.43) 2309 0 R (section*.44) 2326 0 R (section*.45) 2337 0 R (section*.46) 2356 0 R (section*.47) 2363 0 R (section*.48) 2365 0 R (section*.49) 2385 0 R (section*.5) 1177 0 R (section*.50) 2492 0 R (section*.51) 2494 0 R (section*.52) 2504 0 R (section*.53) 2508 0 R (section*.54) 2523 0 R (section*.55) 2535 0 R (section*.56) 2538 0 R (section*.57) 2540 0 R (section*.58) 2594 0 R (section*.59) 2597 0 R (section*.6) 1180 0 R (section*.60) 2614 0 R (section*.61) 2616 0 R (section*.62) 2619 0 R (section*.63) 2661 0 R (section*.64) 2764 0 R (section*.65) 2767 0 R (section*.66) 2769 0 R (section*.67) 2775 0 R (section*.68) 2828 0 R (section*.69) 2831 0 R (section*.7) 1186 0 R (section*.70) 2840 0 R (section*.71) 2895 0 R (section*.72) 2898 0 R (section*.73) 2900 0 R (section*.74) 2919 0 R (section*.75) 2948 0 R (section*.76) 2953 0 R (section*.77) 2955 0 R (section*.78) 2992 0 R (section*.79) 3000 0 R (section*.8) 1191 0 R (section*.80) 3038 0 R (section*.81) 3041 0 R (section*.82) 3043 0 R (section*.83) 3046 0 R (section*.84) 3062 0 R (section*.85) 3065 0 R (section*.86) 3067 0 R (section*.87) 3096 0 R (section*.88) 3109 0 R (section*.89) 3196 0 R (section*.9) 1202 0 R (section*.90) 3200 0 R (section*.91) 3202 0 R (section*.92) 3222 0 R (section*.93) 3250 0 R (section*.94) 3294 0 R (section*.95) 3308 0 R (section*.96) 3318 0 R (section*.97) 3348 0 R (section*.98) 3364 0 R (section*.99) 3395 0 R (section.1.1) 10 0 R (section.1.2) 14 0 R (section.1.3) 18 0 R (section.1.4) 22 0 R (section.1.5) 26 0 R (section.1.6) 30 0 R (section.1.7) 34 0 R (section.1.8) 38 0 R (section.1.9) 42 0 R (section.2.1) 50 0 R (section.3.1) 58 0 R (section.4.1) 66 0 R (section.5.1) 74 0 R (section.6.1) 82 0 R (section.6.10) 118 0 R (section.6.11) 122 0 R (section.6.12) 126 0 R (section.6.13) 130 0 R (section.6.14) 134 0 R (section.6.15) 138 0 R (section.6.16) 142 0 R (section.6.17) 146 0 R (section.6.18) 150 0 R (section.6.19) 154 0 R (section.6.2) 86 0 R (section.6.20) 158 0 R (section.6.21) 162 0 R (section.6.22) 166 0 R (section.6.23) 170 0 R (section.6.24) 174 0 R (section.6.3) 90 0 R (section.6.4) 94 0 R (section.6.5) 98 0 R (section.6.6) 102 0 R (section.6.7) 106 0 R (section.6.8) 110 0 R (section.6.9) 114 0 R (section.7.1) 182 0 R (section.7.10) 218 0 R (section.7.11) 222 0 R (section.7.12) 226 0 R (section.7.13) 230 0 R (section.7.14) 234 0 R (section.7.15) 238 0 R (section.7.16) 242 0 R (section.7.17) 246 0 R (section.7.18) 250 0 R (section.7.19) 254 0 R (section.7.2) 186 0 R (section.7.20) 258 0 R (section.7.21) 262 0 R (section.7.3) 190 0 R (section.7.4) 194 0 R (section.7.5) 198 0 R (section.7.6) 202 0 R (section.7.7) 206 0 R (section.7.8) 210 0 R (section.7.9) 214 0 R (section.8.1) 270 0 R (section.8.10) 306 0 R (section.8.11) 310 0 R (section.8.12) 314 0 R (section.8.13) 318 0 R (section.8.14) 322 0 R (section.8.15) 326 0 R (section.8.16) 330 0 R (section.8.17) 334 0 R (section.8.18) 338 0 R (section.8.19) 342 0 R (section.8.2) 274 0 R (section.8.20) 346 0 R (section.8.21) 350 0 R (section.8.22) 354 0 R (section.8.23) 358 0 R (section.8.24) 362 0 R (section.8.25) 366 0 R (section.8.26) 370 0 R (section.8.27) 374 0 R (section.8.28) 378 0 R (section.8.29) 382 0 R (section.8.3) 278 0 R (section.8.30) 386 0 R (section.8.31) 390 0 R (section.8.32) 394 0 R (section.8.33) 398 0 R (section.8.34) 402 0 R (section.8.4) 282 0 R (section.8.5) 286 0 R (section.8.6) 290 0 R (section.8.7) 294 0 R (section.8.8) 298 0 R (section.8.9) 302 0 R (section.9.1) 410 0 R (section.9.10) 446 0 R (section.9.11) 450 0 R (section.9.12) 454 0 R (section.9.13) 458 0 R (section.9.14) 462 0 R (section.9.15) 466 0 R (section.9.16) 470 0 R (section.9.2) 414 0 R (section.9.3) 418 0 R (section.9.4) 422 0 R (section.9.5) 426 0 R (section.9.6) 430 0 R (section.9.7) 434 0 R (section.9.8) 438 0 R (section.9.9) 442 0 R (subsection.1.4.1) 670 0 R (subsection.1.4.2) 674 0 R (subsection.1.6.1) 689 0 R (subsection.1.7.1) 769 0 R (subsection.1.7.2) 785 0 R (subsection.1.7.3) 792 0 R (subsection.1.7.4) 798 0 R (subsection.1.7.5) 803 0 R (subsection.1.7.6) 813 0 R (subsection.1.8.1) 835 0 R (subsection.1.8.2) 841 0 R (subsection.1.8.3) 847 0 R (subsection.1.9.1) 872 0 R (subsection.6.1.1) 1124 0 R (subsection.6.1.2) 1138 0 R (subsection.6.1.3) 1142 0 R (subsection.6.1.4) 1154 0 R (subsection.6.1.5) 1156 0 R (subsection.6.1.6) 1158 0 R (subsection.6.1.7) 1223 0 R (subsection.6.10.1) 2168 0 R (subsection.6.10.2) 2187 0 R (subsection.6.11.1) 2211 0 R (subsection.6.11.2) 2253 0 R (subsection.6.12.1) 2269 0 R (subsection.6.12.2) 2390 0 R (subsection.6.12.3) 2443 0 R (subsection.6.12.4) 2484 0 R (subsection.6.13.1) 2491 0 R (subsection.6.13.2) 2496 0 R (subsection.6.14.1) 2503 0 R (subsection.6.15.1) 2533 0 R (subsection.6.15.2) 2559 0 R (subsection.6.16.1) 2590 0 R (subsection.6.16.2) 2600 0 R (subsection.6.17.1) 2609 0 R (subsection.6.17.2) 2670 0 R (subsection.6.18.1) 2758 0 R (subsection.6.18.2) 2793 0 R (subsection.6.18.3) 2799 0 R (subsection.6.19.1) 2824 0 R (subsection.6.19.2) 2863 0 R (subsection.6.2.1) 1295 0 R (subsection.6.20.1) 2894 0 R (subsection.6.20.2) 2935 0 R (subsection.6.21.1) 2947 0 R (subsection.6.21.2) 3012 0 R (subsection.6.22.1) 3036 0 R (subsection.6.23.1) 3055 0 R (subsection.6.23.2) 3128 0 R (subsection.6.24.1) 3195 0 R (subsection.6.24.2) 3234 0 R (subsection.6.24.3) 3236 0 R (subsection.6.3.1) 1326 0 R (subsection.6.3.2) 1335 0 R (subsection.6.4.1) 1372 0 R (subsection.6.4.2) 1377 0 R (subsection.6.5.1) 1390 0 R (subsection.6.5.2) 1404 0 R (subsection.6.5.3) 1449 0 R (subsection.6.6.1) 1462 0 R (subsection.6.6.2) 1512 0 R (subsection.6.6.3) 1604 0 R (subsection.6.7.1) 1655 0 R (subsection.6.7.2) 1688 0 R (subsection.6.7.3) 1731 0 R (subsection.6.8.1) 1743 0 R (subsection.6.8.2) 1747 0 R (subsection.6.9.1) 1761 0 R (subsection.6.9.2) 2052 0 R (subsection.6.9.3) 2060 0 R (subsection.6.9.4) 2124 0 R (subsection.7.1.1) 3247 0 R (subsection.7.10.1) 3447 0 R (subsection.7.11.1) 3463 0 R (subsection.7.12.1) 3479 0 R (subsection.7.13.1) 3535 0 R (subsection.7.14.1) 3544 0 R (subsection.7.15.1) 3559 0 R (subsection.7.16.1) 3610 0 R (subsection.7.17.1) 3620 0 R (subsection.7.18.1) 3705 0 R (subsection.7.19.1) 3771 0 R (subsection.7.2.1) 3291 0 R (subsection.7.20.1) 3794 0 R (subsection.7.21.1) 3842 0 R (subsection.7.3.1) 3307 0 R (subsection.7.4.1) 3317 0 R (subsection.7.5.1) 3347 0 R (subsection.7.6.1) 3362 0 R (subsection.7.7.1) 3394 0 R (subsection.7.8.1) 3405 0 R (subsection.7.9.1) 3415 0 R (subsection.8.1.1) 3884 0 R (subsection.8.10.1) 4109 0 R (subsection.8.11.1) 4128 0 R (subsection.8.12.1) 4163 0 R (subsection.8.13.1) 4200 0 R (subsection.8.14.1) 4210 0 R (subsection.8.15.1) 4224 0 R (subsection.8.16.1) 4245 0 R (subsection.8.17.1) 4263 0 R (subsection.8.18.1) 4287 0 R (subsection.8.19.1) 4304 0 R (subsection.8.2.1) 3895 0 R (subsection.8.20.1) 4321 0 R (subsection.8.21.1) 4329 0 R (subsection.8.22.1) 4384 0 R (subsection.8.23.1) 4435 0 R (subsection.8.24.1) 4452 0 R (subsection.8.25.1) 4471 0 R (subsection.8.26.1) 4500 0 R (subsection.8.27.1) 4526 0 R (subsection.8.28.1) 4536 0 R (subsection.8.29.1) 4653 0 R (subsection.8.3.1) 3910 0 R (subsection.8.30.1) 4842 0 R (subsection.8.31.1) 4862 0 R (subsection.8.32.1) 4883 0 R (subsection.8.33.1) 4907 0 R (subsection.8.34.1) 4962 0 R (subsection.8.4.1) 3968 0 R (subsection.8.5.1) 4000 0 R (subsection.8.6.1) 4022 0 R (subsection.8.7.1) 4050 0 R (subsection.8.8.1) 4064 0 R (subsection.8.9.1) 4080 0 R (subsubsection.1.6.1.1) 695 0 R (subsubsection.1.6.1.10) 760 0 R (subsubsection.1.6.1.2) 698 0 R (subsubsection.1.6.1.3) 707 0 R (subsubsection.1.6.1.4) 712 0 R (subsubsection.1.6.1.5) 726 0 R (subsubsection.1.6.1.6) 730 0 R (subsubsection.1.6.1.7) 735 0 R (subsubsection.1.6.1.8) 739 0 R (subsubsection.1.6.1.9) 755 0 R (subsubsection.1.8.1.1) 837 0 R (subsubsection.1.8.1.2) 839 0 R (subsubsection.1.8.3.1) 849 0 R (subsubsection.1.8.3.2) 851 0 R (subsubsection.1.8.3.3) 853 0 R (subsubsection.1.8.3.4) 855 0 R (subsubsection.1.8.3.5) 861 0 R (subsubsection.1.8.3.6) 863 0 R (subsubsection.1.8.3.7) 865 0 R (subsubsection.6.1.7.1) 1224 0 R (subsubsection.6.1.7.10) 1276 0 R (subsubsection.6.1.7.11) 1279 0 R (subsubsection.6.1.7.12) 1282 0 R (subsubsection.6.1.7.13) 1289 0 R (subsubsection.6.1.7.2) 1242 0 R (subsubsection.6.1.7.3) 1246 0 R (subsubsection.6.1.7.4) 1248 0 R (subsubsection.6.1.7.5) 1252 0 R (subsubsection.6.1.7.6) 1261 0 R (subsubsection.6.1.7.7) 1262 0 R (subsubsection.6.1.7.8) 1264 0 R (subsubsection.6.1.7.9) 1272 0 R (subsubsection.6.10.2.1) 2189 0 R (subsubsection.6.10.2.2) 2199 0 R (subsubsection.6.10.2.3) 2203 0 R (subsubsection.6.10.2.4) 2205 0 R (subsubsection.6.11.2.1) 2254 0 R (subsubsection.6.11.2.2) 2256 0 R (subsubsection.6.11.2.3) 2263 0 R (subsubsection.6.12.2.1) 2391 0 R (subsubsection.6.12.2.10) 2414 0 R (subsubsection.6.12.2.11) 2419 0 R (subsubsection.6.12.2.12) 2420 0 R (subsubsection.6.12.2.13) 2422 0 R (subsubsection.6.12.2.14) 2423 0 R (subsubsection.6.12.2.15) 2424 0 R (subsubsection.6.12.2.16) 2430 0 R (subsubsection.6.12.2.17) 2431 0 R (subsubsection.6.12.2.18) 2432 0 R (subsubsection.6.12.2.19) 2433 0 R (subsubsection.6.12.2.2) 2392 0 R (subsubsection.6.12.2.20) 2434 0 R (subsubsection.6.12.2.21) 2435 0 R (subsubsection.6.12.2.22) 2440 0 R (subsubsection.6.12.2.23) 2441 0 R (subsubsection.6.12.2.24) 2442 0 R (subsubsection.6.12.2.3) 2393 0 R (subsubsection.6.12.2.4) 2394 0 R (subsubsection.6.12.2.5) 2401 0 R (subsubsection.6.12.2.6) 2402 0 R (subsubsection.6.12.2.7) 2403 0 R (subsubsection.6.12.2.8) 2406 0 R (subsubsection.6.12.2.9) 2412 0 R (subsubsection.6.12.3.1) 2444 0 R (subsubsection.6.12.3.2) 2454 0 R (subsubsection.6.12.3.3) 2463 0 R (subsubsection.6.12.3.4) 2474 0 R (subsubsection.6.12.3.5) 2480 0 R (subsubsection.6.12.4.1) 2485 0 R (subsubsection.6.13.2.1) 2498 0 R (subsubsection.6.15.2.1) 2560 0 R (subsubsection.6.15.2.2) 2565 0 R (subsubsection.6.15.2.3) 2571 0 R (subsubsection.6.15.2.4) 2580 0 R (subsubsection.6.16.2.1) 2602 0 R (subsubsection.6.16.2.2) 2604 0 R (subsubsection.6.17.2.1) 2671 0 R (subsubsection.6.17.2.10) 2727 0 R (subsubsection.6.17.2.11) 2730 0 R (subsubsection.6.17.2.12) 2739 0 R (subsubsection.6.17.2.13) 2742 0 R (subsubsection.6.17.2.14) 2746 0 R (subsubsection.6.17.2.2) 2689 0 R (subsubsection.6.17.2.3) 2693 0 R (subsubsection.6.17.2.4) 2695 0 R (subsubsection.6.17.2.5) 2698 0 R (subsubsection.6.17.2.6) 2708 0 R (subsubsection.6.17.2.7) 2713 0 R (subsubsection.6.17.2.8) 2716 0 R (subsubsection.6.17.2.9) 2724 0 R (subsubsection.6.18.2.1) 2794 0 R (subsubsection.6.18.3.1) 2800 0 R (subsubsection.6.18.3.2) 2805 0 R (subsubsection.6.18.3.3) 2815 0 R (subsubsection.6.19.2.1) 2864 0 R (subsubsection.6.19.2.2) 2868 0 R (subsubsection.6.19.2.3) 2872 0 R (subsubsection.6.19.2.4) 2876 0 R (subsubsection.6.19.2.5) 2886 0 R (subsubsection.6.20.2.1) 2936 0 R (subsubsection.6.20.2.2) 2937 0 R (subsubsection.6.20.2.3) 2940 0 R (subsubsection.6.21.2.1) 3014 0 R (subsubsection.6.21.2.2) 3017 0 R (subsubsection.6.21.2.3) 3026 0 R (subsubsection.6.21.2.4) 3028 0 R (subsubsection.6.21.2.5) 3030 0 R (subsubsection.6.23.2.1) 3129 0 R (subsubsection.6.23.2.10) 3188 0 R (subsubsection.6.23.2.2) 3142 0 R (subsubsection.6.23.2.3) 3145 0 R (subsubsection.6.23.2.4) 3148 0 R (subsubsection.6.23.2.5) 3156 0 R (subsubsection.6.23.2.6) 3160 0 R (subsubsection.6.23.2.7) 3173 0 R (subsubsection.6.23.2.8) 3177 0 R (subsubsection.6.23.2.9) 3180 0 R (subsubsection.6.24.2.1) 3235 0 R (subsubsection.6.24.3.1) 3237 0 R (subsubsection.6.3.2.1) 1337 0 R (subsubsection.6.3.2.2) 1339 0 R (subsubsection.6.3.2.3) 1350 0 R (subsubsection.6.3.2.4) 1351 0 R (subsubsection.6.3.2.5) 1353 0 R (subsubsection.6.3.2.6) 1355 0 R (subsubsection.6.3.2.7) 1364 0 R (subsubsection.6.4.2.1) 1379 0 R (subsubsection.6.4.2.2) 1383 0 R (subsubsection.6.5.2.1) 1405 0 R (subsubsection.6.5.2.2) 1418 0 R (subsubsection.6.5.2.3) 1427 0 R (subsubsection.6.5.2.4) 1431 0 R (subsubsection.6.5.2.5) 1434 0 R (subsubsection.6.5.2.6) 1445 0 R (subsubsection.6.5.3.1) 1450 0 R (subsubsection.6.6.2.1) 1513 0 R (subsubsection.6.6.2.10) 1564 0 R (subsubsection.6.6.2.11) 1575 0 R (subsubsection.6.6.2.12) 1577 0 R (subsubsection.6.6.2.13) 1581 0 R (subsubsection.6.6.2.14) 1582 0 R (subsubsection.6.6.2.15) 1590 0 R (subsubsection.6.6.2.16) 1593 0 R (subsubsection.6.6.2.17) 1596 0 R (subsubsection.6.6.2.18) 1598 0 R (subsubsection.6.6.2.19) 1603 0 R (subsubsection.6.6.2.2) 1526 0 R (subsubsection.6.6.2.3) 1530 0 R (subsubsection.6.6.2.4) 1533 0 R (subsubsection.6.6.2.5) 1535 0 R (subsubsection.6.6.2.6) 1545 0 R (subsubsection.6.6.2.7) 1551 0 R (subsubsection.6.6.2.8) 1555 0 R (subsubsection.6.6.2.9) 1559 0 R (subsubsection.6.6.3.1) 1605 0 R (subsubsection.6.6.3.2) 1615 0 R (subsubsection.6.6.3.3) 1627 0 R (subsubsection.6.6.3.4) 1633 0 R (subsubsection.6.6.3.5) 1646 0 R (subsubsection.6.7.2.1) 1689 0 R (subsubsection.6.7.2.10) 1725 0 R (subsubsection.6.7.2.11) 1726 0 R (subsubsection.6.7.2.2) 1696 0 R (subsubsection.6.7.2.3) 1697 0 R (subsubsection.6.7.2.4) 1706 0 R (subsubsection.6.7.2.5) 1708 0 R (subsubsection.6.7.2.6) 1710 0 R (subsubsection.6.7.2.7) 1716 0 R (subsubsection.6.7.2.8) 1718 0 R (subsubsection.6.7.2.9) 1719 0 R (subsubsection.6.7.3.1) 1732 0 R (subsubsection.6.8.2.1) 1749 0 R (subsubsection.6.9.2.1) 2053 0 R (subsubsection.6.9.3.1) 2061 0 R (subsubsection.6.9.3.10) 2105 0 R (subsubsection.6.9.3.11) 2107 0 R (subsubsection.6.9.3.12) 2114 0 R (subsubsection.6.9.3.13) 2120 0 R (subsubsection.6.9.3.2) 2065 0 R (subsubsection.6.9.3.3) 2068 0 R (subsubsection.6.9.3.4) 2077 0 R (subsubsection.6.9.3.5) 2085 0 R (subsubsection.6.9.3.6) 2086 0 R (subsubsection.6.9.3.7) 2092 0 R (subsubsection.6.9.3.8) 2096 0 R (subsubsection.6.9.3.9) 2099 0 R (subsubsection.6.9.4.1) 2125 0 R (subsubsection.6.9.4.2) 2128 0 R (subsubsection.6.9.4.3) 2135 0 R (subsubsection.6.9.4.4) 2142 0 R (subsubsection.6.9.4.5) 2146 0 R (subsubsection.6.9.4.6) 2153 0 R (subsubsection.6.9.4.7) 2156 0 R] -/Limits [(Doc-Start) (subsubsection.6.9.4.7)] ->> endobj -5671 0 obj << -/Kids [5670 0 R] ->> endobj -5672 0 obj << -/Dests 5671 0 R ->> endobj -5673 0 obj << -/Type /Catalog -/Pages 5668 0 R -/Outlines 5669 0 R -/Names 5672 0 R -/PageMode /UseOutlines -/OpenAction 473 0 R ->> endobj -5674 0 obj << -/Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(pdfeTeX-1.21a)/Keywords() -/CreationDate (D:20060612102335+02'00') -/PTEX.Fullbanner (This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) kpathsea version 3.5.4) ->> endobj -xref -0 5675 -0000000001 65535 f -0000000002 00000 f -0000000003 00000 f -0000000004 00000 f -0000000000 00000 f -0000000009 00000 n -0000050642 00000 n -0001261026 00000 n -0000000054 00000 n -0000000093 00000 n -0000050814 00000 n -0001260954 00000 n -0000000140 00000 n -0000000171 00000 n -0000054400 00000 n -0001260868 00000 n -0000000219 00000 n -0000000258 00000 n -0000054521 00000 n -0001260782 00000 n -0000000306 00000 n -0000000342 00000 n -0000058977 00000 n -0001260696 00000 n -0000000390 00000 n -0000000440 00000 n -0000059339 00000 n -0001260610 00000 n -0000000488 00000 n -0000000524 00000 n -0000063433 00000 n -0001260524 00000 n -0000000572 00000 n -0000000628 00000 n -0000080583 00000 n -0001260438 00000 n -0000000676 00000 n -0000000703 00000 n -0000102655 00000 n -0001260352 00000 n -0000000751 00000 n -0000000794 00000 n -0000110315 00000 n -0001260279 00000 n -0000000842 00000 n -0000000872 00000 n -0000119269 00000 n -0001260154 00000 n -0000000918 00000 n -0000000957 00000 n -0000119326 00000 n -0001260093 00000 n -0000001005 00000 n -0000001039 00000 n -0000125101 00000 n -0001259967 00000 n -0000001085 00000 n -0000001130 00000 n -0000125158 00000 n -0001259906 00000 n -0000001178 00000 n -0000001220 00000 n -0000134932 00000 n -0001259780 00000 n -0000001266 00000 n -0000001313 00000 n -0000134989 00000 n -0001259719 00000 n -0000001361 00000 n -0000001403 00000 n -0000147442 00000 n -0001259593 00000 n -0000001449 00000 n -0000001486 00000 n -0000147500 00000 n -0001259532 00000 n -0000001534 00000 n -0000001570 00000 n -0000154678 00000 n -0001259403 00000 n -0000001616 00000 n -0000001663 00000 n -0000154795 00000 n -0001259329 00000 n -0000001711 00000 n -0000001742 00000 n -0000193044 00000 n -0001259242 00000 n -0000001790 00000 n -0000001821 00000 n -0000196930 00000 n -0001259155 00000 n -0000001869 00000 n -0000001915 00000 n -0000205317 00000 n -0001259068 00000 n -0000001963 00000 n -0000002010 00000 n -0000210149 00000 n -0001258979 00000 n -0000002058 00000 n -0000002105 00000 n -0000228508 00000 n -0001258888 00000 n -0000002154 00000 n -0000002199 00000 n -0000271738 00000 n -0001258796 00000 n -0000002248 00000 n -0000002292 00000 n -0000288517 00000 n -0001258704 00000 n -0000002341 00000 n -0000002397 00000 n -0000293232 00000 n -0001258612 00000 n -0000002446 00000 n -0000002486 00000 n -0000377976 00000 n -0001258520 00000 n -0000002536 00000 n -0000002591 00000 n -0000387992 00000 n -0001258428 00000 n -0000002641 00000 n -0000002692 00000 n -0000399293 00000 n -0001258336 00000 n -0000002742 00000 n -0000002791 00000 n -0000440708 00000 n -0001258244 00000 n -0000002841 00000 n -0000002892 00000 n -0000446093 00000 n -0001258152 00000 n -0000002942 00000 n -0000002981 00000 n -0000451263 00000 n -0001258060 00000 n -0000003031 00000 n -0000003064 00000 n -0000462282 00000 n -0001257968 00000 n -0000003114 00000 n -0000003149 00000 n -0000468114 00000 n -0001257876 00000 n -0000003199 00000 n -0000003239 00000 n -0000502385 00000 n -0001257784 00000 n -0000003289 00000 n -0000003342 00000 n -0000517178 00000 n -0001257692 00000 n -0000003392 00000 n -0000003424 00000 n -0000531752 00000 n -0001257600 00000 n -0000003474 00000 n -0000003512 00000 n -0000543323 00000 n -0001257508 00000 n -0000003562 00000 n -0000003595 00000 n -0000554956 00000 n -0001257416 00000 n -0000003645 00000 n -0000003677 00000 n -0000563002 00000 n -0001257324 00000 n -0000003727 00000 n -0000003757 00000 n -0000590334 00000 n -0001257246 00000 n -0000003807 00000 n -0000003837 00000 n -0000600208 00000 n -0001257113 00000 n -0000003884 00000 n -0000003940 00000 n -0000600326 00000 n -0001257034 00000 n -0000003989 00000 n -0000004040 00000 n -0000603631 00000 n -0001256941 00000 n -0000004089 00000 n -0000004149 00000 n -0000605400 00000 n -0001256848 00000 n -0000004198 00000 n -0000004255 00000 n -0000609814 00000 n -0001256755 00000 n -0000004304 00000 n -0000004355 00000 n -0000612585 00000 n -0001256662 00000 n -0000004404 00000 n -0000004455 00000 n -0000618018 00000 n -0001256569 00000 n -0000004504 00000 n -0000004546 00000 n -0000620396 00000 n -0001256476 00000 n -0000004595 00000 n -0000004644 00000 n -0000622307 00000 n -0001256383 00000 n -0000004693 00000 n -0000004732 00000 n -0000627362 00000 n -0001256290 00000 n -0000004781 00000 n -0000004831 00000 n -0000631195 00000 n -0001256197 00000 n -0000004881 00000 n -0000004934 00000 n -0000634149 00000 n -0001256104 00000 n -0000004984 00000 n -0000005026 00000 n -0000641477 00000 n -0001256011 00000 n -0000005076 00000 n -0000005124 00000 n -0000646798 00000 n -0001255918 00000 n -0000005174 00000 n -0000005229 00000 n -0000649327 00000 n -0001255825 00000 n -0000005279 00000 n -0000005333 00000 n -0000657364 00000 n -0001255732 00000 n -0000005383 00000 n -0000005440 00000 n -0000659751 00000 n -0001255639 00000 n -0000005490 00000 n -0000005550 00000 n -0000668586 00000 n -0001255546 00000 n -0000005600 00000 n -0000005649 00000 n -0000685418 00000 n -0001255453 00000 n -0000005699 00000 n -0000005755 00000 n -0000690785 00000 n -0001255360 00000 n -0000005805 00000 n -0000005860 00000 n -0000698518 00000 n -0001255267 00000 n -0000005910 00000 n -0000005966 00000 n -0000705116 00000 n -0001255188 00000 n -0000006016 00000 n -0000006071 00000 n -0000708522 00000 n -0001255054 00000 n -0000006118 00000 n -0000006164 00000 n -0000708641 00000 n -0001254975 00000 n -0000006213 00000 n -0000006278 00000 n -0000711484 00000 n -0001254882 00000 n -0000006327 00000 n -0000006392 00000 n -0000720157 00000 n -0001254789 00000 n -0000006441 00000 n -0000006496 00000 n -0000727972 00000 n -0001254696 00000 n -0000006545 00000 n -0000006600 00000 n -0000735780 00000 n -0001254603 00000 n -0000006649 00000 n -0000006700 00000 n -0000740603 00000 n -0001254510 00000 n -0000006749 00000 n -0000006800 00000 n -0000745469 00000 n -0001254417 00000 n -0000006849 00000 n -0000006904 00000 n -0000749092 00000 n -0001254324 00000 n -0000006953 00000 n -0000007008 00000 n -0000756051 00000 n -0001254231 00000 n -0000007057 00000 n -0000007114 00000 n -0000759655 00000 n -0001254138 00000 n -0000007164 00000 n -0000007221 00000 n -0000766391 00000 n -0001254045 00000 n -0000007271 00000 n -0000007332 00000 n -0000773837 00000 n -0001253952 00000 n -0000007382 00000 n -0000007443 00000 n -0000779421 00000 n -0001253859 00000 n -0000007493 00000 n -0000007554 00000 n -0000782070 00000 n -0001253766 00000 n -0000007604 00000 n -0000007665 00000 n -0000786980 00000 n -0001253673 00000 n -0000007715 00000 n -0000007772 00000 n -0000791134 00000 n -0001253580 00000 n -0000007822 00000 n -0000007867 00000 n -0000796289 00000 n -0001253487 00000 n -0000007917 00000 n -0000007962 00000 n -0000800130 00000 n -0001253394 00000 n -0000008012 00000 n -0000008066 00000 n -0000804148 00000 n -0001253301 00000 n -0000008116 00000 n -0000008166 00000 n -0000805832 00000 n -0001253208 00000 n -0000008216 00000 n -0000008259 00000 n -0000812562 00000 n -0001253115 00000 n -0000008309 00000 n -0000008355 00000 n -0000823125 00000 n -0001253022 00000 n -0000008405 00000 n -0000008448 00000 n -0000832696 00000 n -0001252929 00000 n -0000008498 00000 n -0000008544 00000 n -0000836815 00000 n -0001252836 00000 n -0000008594 00000 n -0000008640 00000 n -0000841704 00000 n -0001252743 00000 n -0000008690 00000 n -0000008743 00000 n -0000846631 00000 n -0001252650 00000 n -0000008793 00000 n -0000008846 00000 n -0000849074 00000 n -0001252557 00000 n -0000008896 00000 n -0000008946 00000 n -0000859493 00000 n -0001252464 00000 n -0000008996 00000 n -0000009040 00000 n -0000881877 00000 n -0001252371 00000 n -0000009090 00000 n -0000009134 00000 n -0000929043 00000 n -0001252278 00000 n -0000009184 00000 n -0000009236 00000 n -0000934010 00000 n -0001252185 00000 n -0000009286 00000 n -0000009337 00000 n -0000939281 00000 n -0001252092 00000 n -0000009387 00000 n -0000009438 00000 n -0000943710 00000 n -0001251999 00000 n -0000009488 00000 n -0000009535 00000 n -0000958897 00000 n -0001251920 00000 n -0000009585 00000 n -0000009635 00000 n -0000961041 00000 n -0001251800 00000 n -0000009682 00000 n -0000009731 00000 n -0000961160 00000 n -0001251721 00000 n -0000009780 00000 n -0000009807 00000 n -0000971633 00000 n -0001251628 00000 n -0000009856 00000 n -0000009883 00000 n -0000974077 00000 n -0001251535 00000 n -0000009932 00000 n -0000009979 00000 n -0000976886 00000 n -0001251442 00000 n -0000010028 00000 n -0000010078 00000 n -0000979044 00000 n -0001251349 00000 n -0000010127 00000 n -0000010160 00000 n -0000982262 00000 n -0001251256 00000 n -0000010209 00000 n -0000010242 00000 n -0000984732 00000 n -0001251163 00000 n -0000010291 00000 n -0000010319 00000 n -0000998489 00000 n -0001251070 00000 n -0000010368 00000 n -0000010396 00000 n -0001001910 00000 n -0001250977 00000 n -0000010445 00000 n -0000010471 00000 n -0001008669 00000 n -0001250884 00000 n -0000010521 00000 n -0000010547 00000 n -0001012312 00000 n -0001250791 00000 n -0000010597 00000 n -0000010626 00000 n -0001021683 00000 n -0001250698 00000 n -0000010676 00000 n -0000010705 00000 n -0001024927 00000 n -0001250605 00000 n -0000010755 00000 n -0000010791 00000 n -0001029296 00000 n -0001250512 00000 n -0000010841 00000 n -0000010871 00000 n -0001034310 00000 n -0001250419 00000 n -0000010921 00000 n -0000010952 00000 n -0001046200 00000 n -0001250340 00000 n -0000011002 00000 n -0000011033 00000 n -0000011547 00000 n -0000011669 00000 n -0000016126 00000 n -0000011085 00000 n -0000016010 00000 n -0000016068 00000 n -0001242506 00000 n -0001222170 00000 n -0001242331 00000 n -0001221173 00000 n -0001200724 00000 n -0001221000 00000 n -0001243568 00000 n -0000015772 00000 n -0000015908 00000 n -0000015988 00000 n -0000016558 00000 n -0000016378 00000 n -0000016239 00000 n -0000016500 00000 n -0000022817 00000 n -0000018502 00000 n -0000016599 00000 n -0001199754 00000 n -0001181745 00000 n -0001199579 00000 n -0000022759 00000 n -0000018836 00000 n -0000018990 00000 n -0000019148 00000 n -0000019305 00000 n -0000019463 00000 n -0000019621 00000 n -0000019779 00000 n -0000019937 00000 n -0000020095 00000 n -0000020253 00000 n -0000020411 00000 n -0000020565 00000 n -0000020723 00000 n -0000020877 00000 n -0000021035 00000 n -0000021189 00000 n -0000021347 00000 n -0000021502 00000 n -0000021660 00000 n -0000021815 00000 n -0000021973 00000 n -0000022130 00000 n -0000022287 00000 n -0000022445 00000 n -0000022603 00000 n -0000031940 00000 n -0000025826 00000 n -0000022902 00000 n -0000026248 00000 n -0000026406 00000 n -0000026564 00000 n -0000026722 00000 n -0000026879 00000 n -0000027036 00000 n -0000027195 00000 n -0000027354 00000 n -0000027512 00000 n -0000027671 00000 n -0000027830 00000 n -0000027989 00000 n -0000028148 00000 n -0000028305 00000 n -0000028464 00000 n -0000028622 00000 n -0000028780 00000 n -0000028939 00000 n -0000029098 00000 n -0000029253 00000 n -0000029409 00000 n -0000029566 00000 n -0000029724 00000 n -0000029882 00000 n -0000030039 00000 n -0000030197 00000 n -0000030355 00000 n -0000030512 00000 n -0000030670 00000 n -0000030829 00000 n -0000030988 00000 n -0000031147 00000 n -0000031306 00000 n -0000031465 00000 n -0000031624 00000 n -0000031783 00000 n -0000040835 00000 n -0000034654 00000 n -0000032025 00000 n -0000040777 00000 n -0000035076 00000 n -0000035235 00000 n -0000035394 00000 n -0000035552 00000 n -0000035710 00000 n -0000035865 00000 n -0000036023 00000 n -0000036181 00000 n -0000036338 00000 n -0000036496 00000 n -0000036654 00000 n -0000036812 00000 n -0000036970 00000 n -0000037128 00000 n -0000037286 00000 n -0000037445 00000 n -0000037604 00000 n -0000037763 00000 n -0000037922 00000 n -0000038080 00000 n -0000038237 00000 n -0000038395 00000 n -0000038553 00000 n -0000038712 00000 n -0000038871 00000 n -0000039030 00000 n -0000039189 00000 n -0000039348 00000 n -0000039507 00000 n -0000039666 00000 n -0000039825 00000 n -0000039984 00000 n -0000040143 00000 n -0000040302 00000 n -0000040461 00000 n -0000040620 00000 n -0000046161 00000 n -0000042649 00000 n -0000040920 00000 n -0000046103 00000 n -0000042943 00000 n -0000043102 00000 n -0000043261 00000 n -0000043420 00000 n -0000043575 00000 n -0000043732 00000 n -0000043889 00000 n -0000044045 00000 n -0000044203 00000 n -0000044360 00000 n -0000044518 00000 n -0000044676 00000 n -0000044834 00000 n -0000044992 00000 n -0000045151 00000 n -0000045309 00000 n -0000045468 00000 n -0000045627 00000 n -0000045785 00000 n -0000045944 00000 n -0000050870 00000 n -0000048686 00000 n -0000046246 00000 n -0000050698 00000 n -0000048908 00000 n -0001181090 00000 n -0001179151 00000 n -0001180927 00000 n -0000049085 00000 n -0000049266 00000 n -0000049419 00000 n -0000049572 00000 n -0000049725 00000 n -0000049877 00000 n -0000050030 00000 n -0000050183 00000 n -0000050336 00000 n -0000050489 00000 n -0000050756 00000 n -0001243686 00000 n -0000192985 00000 n -0000399234 00000 n -0000196871 00000 n -0000205258 00000 n -0000210090 00000 n -0000288458 00000 n -0000228449 00000 n -0000468055 00000 n -0000154736 00000 n -0000054578 00000 n -0000054214 00000 n -0000050981 00000 n -0000054336 00000 n -0000054457 00000 n -0000059396 00000 n -0000057806 00000 n -0000054663 00000 n -0000057980 00000 n -0000058165 00000 n -0000058913 00000 n -0000059034 00000 n -0000059098 00000 n -0000058352 00000 n -0000058539 00000 n -0000059155 00000 n -0000059219 00000 n -0000058726 00000 n -0000059276 00000 n -0000210507 00000 n -0000213343 00000 n -0000352804 00000 n -0000357012 00000 n -0000348138 00000 n -0000063606 00000 n -0000062916 00000 n -0000059481 00000 n -0000063370 00000 n -0000063066 00000 n -0000063218 00000 n -0000063490 00000 n -0000063548 00000 n -0000069322 00000 n -0000067224 00000 n -0000063691 00000 n -0000068779 00000 n -0000068837 00000 n -0000068901 00000 n -0000067422 00000 n -0000068957 00000 n -0000069021 00000 n -0000067609 00000 n -0000067762 00000 n -0000067915 00000 n -0000068068 00000 n -0001178798 00000 n -0001176803 00000 n -0001178635 00000 n -0000069078 00000 n -0000069142 00000 n -0000068220 00000 n -0000068407 00000 n -0000068594 00000 n -0000069200 00000 n -0000069264 00000 n -0000418407 00000 n -0000641418 00000 n -0000244942 00000 n -0000244692 00000 n -0000075888 00000 n -0000072812 00000 n -0000069420 00000 n -0000075284 00000 n -0000073042 00000 n -0000073229 00000 n -0000073416 00000 n -0000073603 00000 n -0000075342 00000 n -0000075406 00000 n -0000073789 00000 n -0000073976 00000 n -0000075463 00000 n -0000075527 00000 n -0000074163 00000 n -0000074350 00000 n -0000074537 00000 n -0000075585 00000 n -0000075649 00000 n -0000074724 00000 n -0000074910 00000 n -0000075706 00000 n -0000075768 00000 n -0000075097 00000 n -0000075826 00000 n -0000244817 00000 n -0000263016 00000 n -0000249100 00000 n -0000239531 00000 n -0000235785 00000 n -0000239656 00000 n -0000239280 00000 n -0000249349 00000 n -0000245067 00000 n -0000080761 00000 n -0000078469 00000 n -0000075973 00000 n -0000080287 00000 n -0000080345 00000 n -0000078675 00000 n -0000078862 00000 n -0000079049 00000 n -0000080403 00000 n -0000080467 00000 n -0000079202 00000 n -0000079389 00000 n -0000079576 00000 n -0000079727 00000 n -0000079914 00000 n -0000080100 00000 n -0000080525 00000 n -0000080640 00000 n -0000080704 00000 n -0001243804 00000 n -0000257346 00000 n -0000239781 00000 n -0000257227 00000 n -0000276318 00000 n -0000085379 00000 n -0000083929 00000 n -0000080859 00000 n -0000085199 00000 n -0000084111 00000 n -0000084298 00000 n -0000084485 00000 n -0000084672 00000 n -0000084859 00000 n -0000085257 00000 n -0000085321 00000 n -0000085046 00000 n -0000087042 00000 n -0000086689 00000 n -0000085477 00000 n -0000086811 00000 n -0000086869 00000 n -0000086927 00000 n -0000086985 00000 n -0000090294 00000 n -0000089340 00000 n -0000087140 00000 n -0000090056 00000 n -0000090114 00000 n -0000089498 00000 n -0000089683 00000 n -0000089869 00000 n -0000090172 00000 n -0000090236 00000 n -0000249225 00000 n -0000248975 00000 n -0000093049 00000 n -0000092347 00000 n -0000090392 00000 n -0000092871 00000 n -0000092497 00000 n -0000092684 00000 n -0000092929 00000 n -0000092992 00000 n -0000096038 00000 n -0000095069 00000 n -0000093160 00000 n -0000095980 00000 n -0000095235 00000 n -0000095422 00000 n -0000095607 00000 n -0000095794 00000 n -0000099558 00000 n -0000098914 00000 n -0000096136 00000 n -0000099438 00000 n -0000099064 00000 n -0000099251 00000 n -0000099496 00000 n -0001243922 00000 n -0000103257 00000 n -0000102475 00000 n -0000099669 00000 n -0000102597 00000 n -0000102712 00000 n -0000102776 00000 n -0000102833 00000 n -0000102897 00000 n -0000102955 00000 n -0000103017 00000 n -0000103074 00000 n -0000103138 00000 n -0000103195 00000 n -0000106861 00000 n -0000106140 00000 n -0000103342 00000 n -0000106262 00000 n -0000106320 00000 n -0000106378 00000 n -0000106437 00000 n -0000106495 00000 n -0000106559 00000 n -0000106617 00000 n -0000106681 00000 n -0000106739 00000 n -0000106803 00000 n -0000110372 00000 n -0000109706 00000 n -0000106946 00000 n -0000109828 00000 n -0000109886 00000 n -0000109950 00000 n -0000110008 00000 n -0000110072 00000 n -0000110129 00000 n -0000110193 00000 n -0000110251 00000 n -0000112698 00000 n -0000112396 00000 n -0000110457 00000 n -0000112518 00000 n -0000112576 00000 n -0000112640 00000 n -0000113323 00000 n -0000113143 00000 n -0000112783 00000 n -0000113265 00000 n -0000119383 00000 n -0000115083 00000 n -0000113395 00000 n -0000119211 00000 n -0000115409 00000 n -0000115567 00000 n -0000115726 00000 n -0000115884 00000 n -0000116043 00000 n -0000116202 00000 n -0000116361 00000 n -0000116520 00000 n -0000116678 00000 n -0000116837 00000 n -0000116995 00000 n -0000117153 00000 n -0000117311 00000 n -0000117469 00000 n -0000117626 00000 n -0000117784 00000 n -0000117941 00000 n -0000118100 00000 n -0000118259 00000 n -0000118418 00000 n -0000118577 00000 n -0000118736 00000 n -0000118895 00000 n -0000119052 00000 n -0001244040 00000 n -0000120004 00000 n -0000119824 00000 n -0000119468 00000 n -0000119946 00000 n -0000125215 00000 n -0000121416 00000 n -0000120076 00000 n -0000125043 00000 n -0000121718 00000 n -0000121876 00000 n -0000122034 00000 n -0000122192 00000 n -0000122350 00000 n -0000122508 00000 n -0000122665 00000 n -0000122823 00000 n -0000122980 00000 n -0000123138 00000 n -0000123297 00000 n -0000123456 00000 n -0000123614 00000 n -0000123773 00000 n -0000123931 00000 n -0000124090 00000 n -0000124249 00000 n -0000124408 00000 n -0000124566 00000 n -0000124725 00000 n -0000124884 00000 n -0000125847 00000 n -0000125667 00000 n -0000125300 00000 n -0000125789 00000 n -0000135046 00000 n -0000127872 00000 n -0000125919 00000 n -0000134874 00000 n -0000128342 00000 n -0000128495 00000 n -0000128653 00000 n -0000128805 00000 n -0000128963 00000 n -0000129115 00000 n -0000129273 00000 n -0000129426 00000 n -0000129584 00000 n -0000129737 00000 n -0000129895 00000 n -0000130047 00000 n -0000130204 00000 n -0000130357 00000 n -0000130515 00000 n -0000130668 00000 n -0000130825 00000 n -0000130978 00000 n -0000131136 00000 n -0000131289 00000 n -0000131448 00000 n -0000131601 00000 n -0000131760 00000 n -0000131912 00000 n -0000132070 00000 n -0000132223 00000 n -0000132382 00000 n -0000132535 00000 n -0000132693 00000 n -0000132846 00000 n -0000133005 00000 n -0000133158 00000 n -0000133317 00000 n -0000133469 00000 n -0000133627 00000 n -0000133780 00000 n -0000133939 00000 n -0000134092 00000 n -0000134250 00000 n -0000134403 00000 n -0000134562 00000 n -0000134715 00000 n -0000600267 00000 n -0000603572 00000 n -0000605341 00000 n -0000609755 00000 n -0000612526 00000 n -0000617959 00000 n -0000620337 00000 n -0000622248 00000 n -0000627303 00000 n -0000631136 00000 n -0000634090 00000 n -0000646739 00000 n -0000649268 00000 n -0000657305 00000 n -0000659692 00000 n -0000668526 00000 n -0000685358 00000 n -0000690725 00000 n -0000698458 00000 n -0000705056 00000 n -0000135684 00000 n -0000135499 00000 n -0000135131 00000 n -0000135624 00000 n -0000147558 00000 n -0000138967 00000 n -0000135757 00000 n -0000147382 00000 n -0000139555 00000 n -0000139708 00000 n -0000139867 00000 n -0000140021 00000 n -0000140180 00000 n -0000140334 00000 n -0000140493 00000 n -0000140647 00000 n -0000140805 00000 n -0000140959 00000 n -0000141118 00000 n -0000141272 00000 n -0000141431 00000 n -0000141585 00000 n -0000141744 00000 n -0000141897 00000 n -0000142055 00000 n -0000142208 00000 n -0000142367 00000 n -0000142521 00000 n -0000142681 00000 n -0000142835 00000 n -0000142994 00000 n -0000143148 00000 n -0000143308 00000 n -0000143462 00000 n -0000143622 00000 n -0000143776 00000 n -0000143936 00000 n -0000144090 00000 n -0000144250 00000 n -0000144404 00000 n -0000144564 00000 n -0000144718 00000 n -0000144877 00000 n -0000145031 00000 n -0000145191 00000 n -0000145344 00000 n -0000145503 00000 n -0000145655 00000 n -0000145815 00000 n -0000145969 00000 n -0000146128 00000 n -0000146282 00000 n -0000146442 00000 n -0000146595 00000 n -0000146755 00000 n -0000146909 00000 n -0000147069 00000 n -0000147223 00000 n -0001244159 00000 n -0000708581 00000 n -0000711424 00000 n -0000720097 00000 n -0000727912 00000 n -0000735720 00000 n -0000740543 00000 n -0000745409 00000 n -0000749032 00000 n -0000755991 00000 n -0000759595 00000 n -0000766331 00000 n -0000773777 00000 n -0000779361 00000 n -0000782010 00000 n -0000786920 00000 n -0000791074 00000 n -0000796229 00000 n -0000800070 00000 n -0000804088 00000 n -0000805772 00000 n -0000812502 00000 n -0000823065 00000 n -0000832636 00000 n -0000836755 00000 n -0000841644 00000 n -0000152463 00000 n -0000149284 00000 n -0000147644 00000 n -0000152403 00000 n -0000149584 00000 n -0000149738 00000 n -0000149898 00000 n -0000150051 00000 n -0000150211 00000 n -0000150363 00000 n -0000150522 00000 n -0000150676 00000 n -0000150836 00000 n -0000150990 00000 n -0000151150 00000 n -0000151304 00000 n -0000151464 00000 n -0000151618 00000 n -0000151776 00000 n -0000151930 00000 n -0000152090 00000 n -0000152243 00000 n -0000846571 00000 n -0000849014 00000 n -0000859433 00000 n -0000881817 00000 n -0000928983 00000 n -0000933950 00000 n -0000939221 00000 n -0000943650 00000 n -0000958837 00000 n -0000154913 00000 n -0000154492 00000 n -0000152549 00000 n -0000154618 00000 n -0000154853 00000 n -0000160237 00000 n -0000157887 00000 n -0000154999 00000 n -0000159925 00000 n -0000158115 00000 n -0000158303 00000 n -0000158491 00000 n -0000158679 00000 n -0000158867 00000 n -0000159054 00000 n -0000159241 00000 n -0000159428 00000 n -0000159985 00000 n -0000160051 00000 n -0000159581 00000 n -0000159753 00000 n -0000160111 00000 n -0000160177 00000 n -0000179694 00000 n -0000175554 00000 n -0000186461 00000 n -0000175674 00000 n -0000186586 00000 n -0000182836 00000 n -0000164053 00000 n -0000162923 00000 n -0000160349 00000 n -0000163384 00000 n -0000163444 00000 n -0000163510 00000 n -0000163570 00000 n -0000163629 00000 n -0000163689 00000 n -0000163755 00000 n -0000163079 00000 n -0000163815 00000 n -0000163873 00000 n -0000163933 00000 n -0000163993 00000 n -0000163233 00000 n -0000446033 00000 n -0000169637 00000 n -0000166048 00000 n -0000164139 00000 n -0000169220 00000 n -0001175964 00000 n -0001158689 00000 n -0001175783 00000 n -0000169280 00000 n -0000166339 00000 n -0000169340 00000 n -0000166493 00000 n -0000169399 00000 n -0000166647 00000 n -0000166835 00000 n -0000169457 00000 n -0000166989 00000 n -0000167177 00000 n -0000167365 00000 n -0000167518 00000 n -0000167706 00000 n -0000169517 00000 n -0000167860 00000 n -0000168047 00000 n -0000168200 00000 n -0000168386 00000 n -0000169577 00000 n -0000168538 00000 n -0000168726 00000 n -0000168880 00000 n -0000169067 00000 n -0000182711 00000 n -0000182585 00000 n -0000175738 00000 n -0000171876 00000 n -0000169737 00000 n -0000174956 00000 n -0000175016 00000 n -0000172158 00000 n -0000172346 00000 n -0000172500 00000 n -0000172688 00000 n -0000175076 00000 n -0000172842 00000 n -0000175136 00000 n -0000173030 00000 n -0000173218 00000 n -0000173372 00000 n -0000173559 00000 n -0000175195 00000 n -0000175255 00000 n -0000173712 00000 n -0000175315 00000 n -0000173900 00000 n -0000175375 00000 n -0000174087 00000 n -0000175434 00000 n -0000174275 00000 n -0000175494 00000 n -0000175614 00000 n -0000174462 00000 n -0000174614 00000 n -0001158068 00000 n -0001147348 00000 n -0001157887 00000 n -0000174802 00000 n -0001244284 00000 n -0000179820 00000 n -0000179568 00000 n -0000182460 00000 n -0000186712 00000 n -0000188422 00000 n -0000961100 00000 n -0000179945 00000 n -0000177550 00000 n -0000175852 00000 n -0000179448 00000 n -0000179508 00000 n -0000177778 00000 n -0000177931 00000 n -0000178118 00000 n -0000179634 00000 n -0000178272 00000 n -0000179760 00000 n -0000178426 00000 n -0000178580 00000 n -0000178768 00000 n -0000179885 00000 n -0000178922 00000 n -0000179075 00000 n -0000179263 00000 n -0000182900 00000 n -0000181610 00000 n -0000180045 00000 n -0000182400 00000 n -0000181784 00000 n -0000182526 00000 n -0000182651 00000 n -0000181938 00000 n -0000182777 00000 n -0000182092 00000 n -0000182246 00000 n -0001001850 00000 n -0000186838 00000 n -0000184801 00000 n -0000183000 00000 n -0000186341 00000 n -0000186401 00000 n -0000185011 00000 n -0000185165 00000 n -0000185353 00000 n -0000186527 00000 n -0000185541 00000 n -0000185695 00000 n -0000186652 00000 n -0000185849 00000 n -0000186001 00000 n -0000186778 00000 n -0000186188 00000 n -0000188548 00000 n -0000187898 00000 n -0000186938 00000 n -0000188362 00000 n -0000188054 00000 n -0000188488 00000 n -0000188208 00000 n -0000193522 00000 n -0000190467 00000 n -0000188648 00000 n -0000192925 00000 n -0000193102 00000 n -0000193162 00000 n -0000190722 00000 n -0000190876 00000 n -0000191030 00000 n -0000191183 00000 n -0000191337 00000 n -0000191491 00000 n -0000191644 00000 n -0000193222 00000 n -0000193282 00000 n -0000191797 00000 n -0000193342 00000 n -0000191985 00000 n -0000193402 00000 n -0000192173 00000 n -0000192361 00000 n -0000193462 00000 n -0000192549 00000 n -0000192737 00000 n -0000517118 00000 n -0000531692 00000 n -0000543263 00000 n -0000554896 00000 n -0000562942 00000 n -0000590274 00000 n -0000434357 00000 n -0000197412 00000 n -0000195297 00000 n -0000193622 00000 n -0000196811 00000 n -0000196988 00000 n -0000197048 00000 n -0000195498 00000 n -0000195684 00000 n -0000195871 00000 n -0000196059 00000 n -0000196247 00000 n -0000196435 00000 n -0000196623 00000 n -0000197108 00000 n -0000197168 00000 n -0000197227 00000 n -0000197286 00000 n -0000197352 00000 n -0001244409 00000 n -0000200040 00000 n -0000199788 00000 n -0000202437 00000 n -0000199664 00000 n -0000199914 00000 n -0000200166 00000 n -0000199106 00000 n -0000197526 00000 n -0000199604 00000 n -0000199730 00000 n -0000199854 00000 n -0000199262 00000 n -0000199980 00000 n -0000199450 00000 n -0000200106 00000 n -0000202562 00000 n -0000201358 00000 n -0000200279 00000 n -0000202377 00000 n -0000201541 00000 n -0000201729 00000 n -0000201883 00000 n -0000202035 00000 n -0000202502 00000 n -0000202189 00000 n -0000974017 00000 n -0000976826 00000 n -0000205795 00000 n -0000203949 00000 n -0000202675 00000 n -0000205198 00000 n -0000205375 00000 n -0000205435 00000 n -0000204141 00000 n -0000204329 00000 n -0000204516 00000 n -0000205495 00000 n -0000205554 00000 n -0000205612 00000 n -0000204703 00000 n -0000204856 00000 n -0000205670 00000 n -0000205736 00000 n -0000205010 00000 n -0000434237 00000 n -0000210626 00000 n -0000207924 00000 n -0000205909 00000 n -0000210030 00000 n -0000210207 00000 n -0000210267 00000 n -0000208152 00000 n -0000208340 00000 n -0000210327 00000 n -0000208527 00000 n -0000208715 00000 n -0000208903 00000 n -0000209091 00000 n -0000209279 00000 n -0000209467 00000 n -0000210387 00000 n -0000209654 00000 n -0000209842 00000 n -0000210447 00000 n -0000210566 00000 n -0000332435 00000 n -0000217247 00000 n -0000217372 00000 n -0000217498 00000 n -0000221567 00000 n -0000221753 00000 n -0000213467 00000 n -0000212625 00000 n -0000210726 00000 n -0000213283 00000 n -0000212790 00000 n -0000212943 00000 n -0000213407 00000 n -0000213097 00000 n -0000392779 00000 n -0000217624 00000 n -0000215451 00000 n -0000213566 00000 n -0000217187 00000 n -0000215670 00000 n -0000215823 00000 n -0000217313 00000 n -0000215977 00000 n -0000216165 00000 n -0000216319 00000 n -0000217438 00000 n -0000216472 00000 n -0000216659 00000 n -0000217564 00000 n -0000216811 00000 n -0000216999 00000 n -0001244534 00000 n -0000221873 00000 n -0000219935 00000 n -0000217737 00000 n -0000221507 00000 n -0000220145 00000 n -0000220333 00000 n -0000220485 00000 n -0000221633 00000 n -0000220638 00000 n -0000220826 00000 n -0000220980 00000 n -0000221693 00000 n -0000221813 00000 n -0000221133 00000 n -0000221320 00000 n -0000366579 00000 n -0000222615 00000 n -0000222429 00000 n -0000221986 00000 n -0000222555 00000 n -0000228807 00000 n -0000224914 00000 n -0000222701 00000 n -0000228389 00000 n -0000228567 00000 n -0000228627 00000 n -0000228687 00000 n -0000225205 00000 n -0000225392 00000 n -0000225580 00000 n -0000225768 00000 n -0000225956 00000 n -0000226144 00000 n -0000228747 00000 n -0000226331 00000 n -0000226518 00000 n -0000226706 00000 n -0000226893 00000 n -0000227078 00000 n -0000227266 00000 n -0000227453 00000 n -0000227641 00000 n -0000227828 00000 n -0000228016 00000 n -0000228203 00000 n -0000252502 00000 n -0000252376 00000 n -0000239405 00000 n -0000235904 00000 n -0000231345 00000 n -0000228920 00000 n -0000235545 00000 n -0000231672 00000 n -0000231860 00000 n -0000235605 00000 n -0000232048 00000 n -0000232236 00000 n -0000232424 00000 n -0000232612 00000 n -0000232800 00000 n -0000235665 00000 n -0000232987 00000 n -0000233175 00000 n -0000233363 00000 n -0000233551 00000 n -0000233739 00000 n -0000233893 00000 n -0000234081 00000 n -0000234268 00000 n -0000234456 00000 n -0000234644 00000 n -0000234798 00000 n -0000234985 00000 n -0000235173 00000 n -0000235725 00000 n -0000235844 00000 n -0000235359 00000 n -0000252124 00000 n -0000249474 00000 n -0000252250 00000 n -0000266327 00000 n -0000322029 00000 n -0000263140 00000 n -0000239844 00000 n -0000237455 00000 n -0000236017 00000 n -0000239220 00000 n -0000237683 00000 n -0000239345 00000 n -0000237836 00000 n -0000237990 00000 n -0000238143 00000 n -0000239471 00000 n -0000238297 00000 n -0000238451 00000 n -0000239596 00000 n -0000238605 00000 n -0000239721 00000 n -0000238759 00000 n -0000238913 00000 n -0000239066 00000 n -0001034250 00000 n -0001012252 00000 n -0000245192 00000 n -0000241893 00000 n -0000239930 00000 n -0000244572 00000 n -0000244632 00000 n -0000242166 00000 n -0000242354 00000 n -0000242542 00000 n -0000242696 00000 n -0000242850 00000 n -0000244757 00000 n -0000243004 00000 n -0000243158 00000 n -0000243312 00000 n -0000244882 00000 n -0000243466 00000 n -0000243654 00000 n -0000243808 00000 n -0000245007 00000 n -0000243962 00000 n -0000244115 00000 n -0000244268 00000 n -0000244421 00000 n -0000245132 00000 n -0001244659 00000 n -0000978984 00000 n -0000984672 00000 n -0000249538 00000 n -0000247081 00000 n -0000245278 00000 n -0000248915 00000 n -0000247309 00000 n -0000247463 00000 n -0000247617 00000 n -0000249040 00000 n -0000247770 00000 n -0000249165 00000 n -0000247958 00000 n -0000248146 00000 n -0000248300 00000 n -0000249290 00000 n -0000249414 00000 n -0000248454 00000 n -0000248608 00000 n -0000248761 00000 n -0000252566 00000 n -0000251053 00000 n -0000249624 00000 n -0000252004 00000 n -0000252064 00000 n -0000251236 00000 n -0000251389 00000 n -0000252190 00000 n -0000251543 00000 n -0000251696 00000 n -0000252316 00000 n -0000251850 00000 n -0000252442 00000 n -0000257471 00000 n -0000255076 00000 n -0000252666 00000 n -0000257047 00000 n -0000257107 00000 n -0000257167 00000 n -0000257286 00000 n -0000255304 00000 n -0000255458 00000 n -0000255646 00000 n -0000255834 00000 n -0000256022 00000 n -0000256176 00000 n -0000256364 00000 n -0000256552 00000 n -0000256706 00000 n -0000257411 00000 n -0000256859 00000 n -0000276072 00000 n -0000285635 00000 n -0000263264 00000 n -0000260267 00000 n -0000257597 00000 n -0000262956 00000 n -0000260531 00000 n -0000260719 00000 n -0000260906 00000 n -0000261060 00000 n -0000263081 00000 n -0000261214 00000 n -0000261401 00000 n -0000261589 00000 n -0000261743 00000 n -0000261897 00000 n -0000263204 00000 n -0000262051 00000 n -0000262205 00000 n -0000262393 00000 n -0000262581 00000 n -0000262769 00000 n -0000266453 00000 n -0000265051 00000 n -0000263390 00000 n -0000266267 00000 n -0000265243 00000 n -0000265397 00000 n -0000265550 00000 n -0000266393 00000 n -0000265703 00000 n -0000265891 00000 n -0000266079 00000 n -0000272037 00000 n -0000268528 00000 n -0000266566 00000 n -0000271618 00000 n -0000271678 00000 n -0000271797 00000 n -0000271857 00000 n -0000268801 00000 n -0000268989 00000 n -0000269177 00000 n -0000269365 00000 n -0000269552 00000 n -0000269740 00000 n -0000269928 00000 n -0000270116 00000 n -0000270303 00000 n -0000270490 00000 n -0000270678 00000 n -0000271917 00000 n -0000270866 00000 n -0000271977 00000 n -0000271054 00000 n -0000271242 00000 n -0000271430 00000 n -0001244784 00000 n -0000276192 00000 n -0000280515 00000 n -0000280390 00000 n -0000282714 00000 n -0000282589 00000 n -0000276443 00000 n -0000278150 00000 n -0000278275 00000 n -0000280264 00000 n -0000276507 00000 n -0000274118 00000 n -0000272137 00000 n -0000275952 00000 n -0000276012 00000 n -0000276132 00000 n -0000274346 00000 n -0000274534 00000 n -0000274688 00000 n -0000274842 00000 n -0000274996 00000 n -0000275150 00000 n -0000276258 00000 n -0000276383 00000 n -0000275304 00000 n -0000275492 00000 n -0000275646 00000 n -0000275798 00000 n -0000278400 00000 n -0000277567 00000 n -0000276620 00000 n -0000278030 00000 n -0000278090 00000 n -0000277723 00000 n -0000278216 00000 n -0000277876 00000 n -0000278340 00000 n -0000280641 00000 n -0000279740 00000 n -0000278499 00000 n -0000280204 00000 n -0000279896 00000 n -0000280330 00000 n -0000280050 00000 n -0000280455 00000 n -0000280581 00000 n -0000282839 00000 n -0000282228 00000 n -0000280754 00000 n -0000282529 00000 n -0000282375 00000 n -0000282655 00000 n -0000282779 00000 n -0000285755 00000 n -0000284299 00000 n -0000282952 00000 n -0000285515 00000 n -0000285575 00000 n -0000285695 00000 n -0000284491 00000 n -0000284679 00000 n -0000284867 00000 n -0000285054 00000 n -0000285207 00000 n -0000285361 00000 n -0000288876 00000 n -0000287148 00000 n -0000285855 00000 n -0000288398 00000 n -0000288576 00000 n -0000288636 00000 n -0000287340 00000 n -0000287528 00000 n -0000288696 00000 n -0000288756 00000 n -0000288816 00000 n -0000287715 00000 n -0000287903 00000 n -0000288091 00000 n -0000288244 00000 n -0001244909 00000 n -0000371117 00000 n -0000293471 00000 n -0000291184 00000 n -0000288976 00000 n -0000293112 00000 n -0000293172 00000 n -0000293291 00000 n -0000293351 00000 n -0000291421 00000 n -0000291574 00000 n -0000293411 00000 n -0000291727 00000 n -0000291881 00000 n -0000292035 00000 n -0000292189 00000 n -0000292343 00000 n -0000292497 00000 n -0000292651 00000 n -0000292804 00000 n -0000292958 00000 n -0000387932 00000 n -0000440648 00000 n -0000377916 00000 n -0000305355 00000 n -0000296574 00000 n -0000293571 00000 n -0000303557 00000 n -0000303617 00000 n -0000297036 00000 n -0000297190 00000 n -0000297344 00000 n -0000297498 00000 n -0000297650 00000 n -0000297804 00000 n -0000297958 00000 n -0000303677 00000 n -0000303737 00000 n -0000298112 00000 n -0000303797 00000 n -0000298300 00000 n -0000303857 00000 n -0000298488 00000 n -0000303917 00000 n -0000298676 00000 n -0000303977 00000 n -0000298863 00000 n -0000304037 00000 n -0000299051 00000 n -0000304097 00000 n -0000299238 00000 n -0000304157 00000 n -0000299426 00000 n -0000304217 00000 n -0000299613 00000 n -0000304277 00000 n -0000299801 00000 n -0000304337 00000 n -0000299989 00000 n -0000304397 00000 n -0000300177 00000 n -0000304457 00000 n -0000300365 00000 n -0000304517 00000 n -0000300552 00000 n -0000304577 00000 n -0000300740 00000 n -0000304637 00000 n -0000300928 00000 n -0000304697 00000 n -0000301116 00000 n -0000304757 00000 n -0000301304 00000 n -0000304816 00000 n -0000301491 00000 n -0000304876 00000 n -0000301679 00000 n -0000304936 00000 n -0000301866 00000 n -0000304996 00000 n -0000302054 00000 n -0000305056 00000 n -0000302242 00000 n -0000305116 00000 n -0000302430 00000 n -0000302618 00000 n -0000302806 00000 n -0000305176 00000 n -0000302994 00000 n -0000305236 00000 n -0000303182 00000 n -0000305295 00000 n -0000303370 00000 n -0000343805 00000 n -0000322209 00000 n -0000309191 00000 n -0000305455 00000 n -0000319812 00000 n -0000319872 00000 n -0000309815 00000 n -0000319932 00000 n -0000310003 00000 n -0000319992 00000 n -0000310191 00000 n -0000320052 00000 n -0000310379 00000 n -0000320112 00000 n -0000310567 00000 n -0000320172 00000 n -0000310754 00000 n -0000320232 00000 n -0000310941 00000 n -0000320292 00000 n -0000311128 00000 n -0000320352 00000 n -0000311315 00000 n -0000320411 00000 n -0000311503 00000 n -0000320471 00000 n -0000311691 00000 n -0000320531 00000 n -0000311879 00000 n -0000320591 00000 n -0000312067 00000 n -0000320651 00000 n -0000312254 00000 n -0000320711 00000 n -0000312442 00000 n -0000320771 00000 n -0000312630 00000 n -0000320831 00000 n -0000312817 00000 n -0000320891 00000 n -0000313005 00000 n -0000320950 00000 n -0000313193 00000 n -0000321010 00000 n -0000313380 00000 n -0000321069 00000 n -0000313568 00000 n -0000321129 00000 n -0000313756 00000 n -0000321189 00000 n -0000313944 00000 n -0000321249 00000 n -0000314132 00000 n -0000321309 00000 n -0000314320 00000 n -0000321369 00000 n -0000314507 00000 n -0000321429 00000 n -0000314695 00000 n -0000321489 00000 n -0000314883 00000 n -0000315071 00000 n -0000315225 00000 n -0000321549 00000 n -0000315413 00000 n -0000315601 00000 n -0000321609 00000 n -0000315754 00000 n -0000315942 00000 n -0000316095 00000 n -0000321669 00000 n -0000316283 00000 n -0000316471 00000 n -0000316625 00000 n -0000321729 00000 n -0000316813 00000 n -0000321789 00000 n -0000317001 00000 n -0000321849 00000 n -0000321909 00000 n -0000317188 00000 n -0000317375 00000 n -0000321969 00000 n -0000317563 00000 n -0000317750 00000 n -0000317938 00000 n -0000318126 00000 n -0000322089 00000 n -0000322149 00000 n -0000318314 00000 n -0000318502 00000 n -0000318690 00000 n -0000318878 00000 n -0000319066 00000 n -0000319254 00000 n -0000319440 00000 n -0000319626 00000 n -0000348261 00000 n -0000332615 00000 n -0000325139 00000 n -0000322335 00000 n -0000332316 00000 n -0000325610 00000 n -0000325798 00000 n -0000325986 00000 n -0000326174 00000 n -0000326362 00000 n -0000326550 00000 n -0000326738 00000 n -0000326926 00000 n -0000327114 00000 n -0000327302 00000 n -0000327488 00000 n -0000327642 00000 n -0000327830 00000 n -0000328017 00000 n -0000328205 00000 n -0000328359 00000 n -0000328546 00000 n -0000328734 00000 n -0000328920 00000 n -0000329108 00000 n -0000329296 00000 n -0000329484 00000 n -0000329672 00000 n -0000329860 00000 n -0000330048 00000 n -0000330236 00000 n -0000332376 00000 n -0000330424 00000 n -0000330611 00000 n -0000330765 00000 n -0000330953 00000 n -0000331107 00000 n -0000332495 00000 n -0000331295 00000 n -0000331449 00000 n -0000332555 00000 n -0000331637 00000 n -0000331791 00000 n -0000331978 00000 n -0000332130 00000 n -0000361148 00000 n -0000356886 00000 n -0000352679 00000 n -0000348386 00000 n -0000361023 00000 n -0000361274 00000 n -0000352929 00000 n -0000348018 00000 n -0000356760 00000 n -0000366399 00000 n -0000370931 00000 n -0000371243 00000 n -0000343925 00000 n -0000335313 00000 n -0000332728 00000 n -0000343145 00000 n -0000343205 00000 n -0000335811 00000 n -0000335997 00000 n -0000343265 00000 n -0000336183 00000 n -0000336370 00000 n -0000343325 00000 n -0000336557 00000 n -0000336745 00000 n -0000343385 00000 n -0000336933 00000 n -0000337121 00000 n -0000337308 00000 n -0000337496 00000 n -0000337684 00000 n -0000337872 00000 n -0000338059 00000 n -0000338247 00000 n -0000343445 00000 n -0000338435 00000 n -0000338589 00000 n -0000338777 00000 n -0000338965 00000 n -0000339153 00000 n -0000343505 00000 n -0000339341 00000 n -0000339528 00000 n -0000339716 00000 n -0000343565 00000 n -0000339903 00000 n -0000340091 00000 n -0000340279 00000 n -0000340467 00000 n -0000340655 00000 n -0000340807 00000 n -0000340993 00000 n -0000341147 00000 n -0000343625 00000 n -0000341335 00000 n -0000341523 00000 n -0000341711 00000 n -0000341865 00000 n -0000342053 00000 n -0000342207 00000 n -0000343685 00000 n -0000342394 00000 n -0000342582 00000 n -0000343745 00000 n -0000343865 00000 n -0000342770 00000 n -0000342957 00000 n -0000348450 00000 n -0000346188 00000 n -0000344051 00000 n -0000347898 00000 n -0000347958 00000 n -0000348078 00000 n -0000346398 00000 n -0000346586 00000 n -0000346774 00000 n -0000348201 00000 n -0000346961 00000 n -0000347149 00000 n -0000348326 00000 n -0000347337 00000 n -0000347524 00000 n -0000347711 00000 n -0001245034 00000 n -0000352993 00000 n -0000350915 00000 n -0000348563 00000 n -0000352559 00000 n -0000352619 00000 n -0000351125 00000 n -0000351279 00000 n -0000351467 00000 n -0000351655 00000 n -0000351843 00000 n -0000351997 00000 n -0000352185 00000 n -0000352744 00000 n -0000352869 00000 n -0000352372 00000 n -0000357075 00000 n -0000355321 00000 n -0000353119 00000 n -0000356640 00000 n -0000356700 00000 n -0000355513 00000 n -0000355701 00000 n -0000355889 00000 n -0000356826 00000 n -0000356077 00000 n -0000356265 00000 n -0000356952 00000 n -0000356452 00000 n -0000361338 00000 n -0000359260 00000 n -0000357201 00000 n -0000360903 00000 n -0000360963 00000 n -0000359470 00000 n -0000361089 00000 n -0000359657 00000 n -0000359811 00000 n -0000359999 00000 n -0000360187 00000 n -0000360375 00000 n -0000360562 00000 n -0000361214 00000 n -0000360716 00000 n -0000366705 00000 n -0000363663 00000 n -0000361464 00000 n -0000366219 00000 n -0000366279 00000 n -0000363918 00000 n -0000364106 00000 n -0000364294 00000 n -0000366339 00000 n -0000366459 00000 n -0000364482 00000 n -0000364669 00000 n -0000366519 00000 n -0000364856 00000 n -0000365043 00000 n -0000365229 00000 n -0000365383 00000 n -0000365537 00000 n -0000365691 00000 n -0000366645 00000 n -0000365843 00000 n -0000366031 00000 n -0000371369 00000 n -0000368514 00000 n -0000366831 00000 n -0000370871 00000 n -0000370997 00000 n -0000368769 00000 n -0000368922 00000 n -0000369075 00000 n -0000371057 00000 n -0000369229 00000 n -0000369383 00000 n -0000369537 00000 n -0000369691 00000 n -0000369845 00000 n -0000369999 00000 n -0000371183 00000 n -0000370153 00000 n -0000370341 00000 n -0000371309 00000 n -0000370529 00000 n -0000370683 00000 n -0000372116 00000 n -0000371930 00000 n -0000371481 00000 n -0000372056 00000 n -0001245159 00000 n -0000378512 00000 n -0000374607 00000 n -0000372202 00000 n -0000377856 00000 n -0000378035 00000 n -0000378095 00000 n -0000374889 00000 n -0000378155 00000 n -0000375042 00000 n -0000375230 00000 n -0000375418 00000 n -0000375606 00000 n -0000375793 00000 n -0000375980 00000 n -0000376167 00000 n -0000376352 00000 n -0000376540 00000 n -0000376728 00000 n -0000376916 00000 n -0000378215 00000 n -0000378275 00000 n -0000377104 00000 n -0000377292 00000 n -0000378335 00000 n -0000378394 00000 n -0000378453 00000 n -0000377480 00000 n -0000377668 00000 n -0000381661 00000 n -0000381787 00000 n -0000381907 00000 n -0000382027 00000 n -0000380483 00000 n -0000378639 00000 n -0000381601 00000 n -0000381727 00000 n -0000380666 00000 n -0000380853 00000 n -0000381041 00000 n -0000381847 00000 n -0000381228 00000 n -0000381967 00000 n -0000381415 00000 n -0000388949 00000 n -0000384494 00000 n -0000382140 00000 n -0000387872 00000 n -0000388051 00000 n -0000388111 00000 n -0000384785 00000 n -0000384938 00000 n -0000388171 00000 n -0000385091 00000 n -0000388231 00000 n -0000388290 00000 n -0000385245 00000 n -0000388349 00000 n -0000385433 00000 n -0000388409 00000 n -0000385621 00000 n -0000388469 00000 n -0000385809 00000 n -0000388529 00000 n -0000385994 00000 n -0000388589 00000 n -0000386182 00000 n -0000388649 00000 n -0000386370 00000 n -0000388709 00000 n -0000386558 00000 n -0000386746 00000 n -0000388769 00000 n -0000386934 00000 n -0000387122 00000 n -0000388829 00000 n -0000388889 00000 n -0000387310 00000 n -0000387498 00000 n -0000387686 00000 n -0000392659 00000 n -0000392904 00000 n -0000391564 00000 n -0000389062 00000 n -0000392421 00000 n -0000391738 00000 n -0000392481 00000 n -0000392540 00000 n -0000391926 00000 n -0000392080 00000 n -0000392599 00000 n -0000392719 00000 n -0000392268 00000 n -0000392844 00000 n -0000394464 00000 n -0000394590 00000 n -0000393943 00000 n -0000393004 00000 n -0000394404 00000 n -0000394099 00000 n -0000394530 00000 n -0000394252 00000 n -0000400012 00000 n -0000396814 00000 n -0000394676 00000 n -0000399174 00000 n -0000399352 00000 n -0000397060 00000 n -0000397214 00000 n -0000399412 00000 n -0000397368 00000 n -0000397519 00000 n -0000399472 00000 n -0000399532 00000 n -0000397672 00000 n -0000399592 00000 n -0000397860 00000 n -0000399652 00000 n -0000398048 00000 n -0000399712 00000 n -0000398236 00000 n -0000399772 00000 n -0000398424 00000 n -0000399832 00000 n -0000398612 00000 n -0000399892 00000 n -0000398799 00000 n -0000399952 00000 n -0000398987 00000 n -0001245284 00000 n -0000404937 00000 n -0000402275 00000 n -0000400112 00000 n -0000404577 00000 n -0000402512 00000 n -0000402700 00000 n -0000402888 00000 n -0000404637 00000 n -0000403075 00000 n -0000403263 00000 n -0000403451 00000 n -0000404697 00000 n -0000403639 00000 n -0000403827 00000 n -0000404757 00000 n -0000404015 00000 n -0000404817 00000 n -0000404877 00000 n -0000404203 00000 n -0000404391 00000 n -0000434483 00000 n -0000423147 00000 n -0000426061 00000 n -0000423273 00000 n -0000428677 00000 n -0000426187 00000 n -0000433926 00000 n -0000410241 00000 n -0000407307 00000 n -0000405037 00000 n -0000410001 00000 n -0000410061 00000 n -0000407562 00000 n -0000410121 00000 n -0000407749 00000 n -0000407937 00000 n -0000408125 00000 n -0000408313 00000 n -0000408501 00000 n -0000408689 00000 n -0000408877 00000 n -0000409065 00000 n -0000409251 00000 n -0000409438 00000 n -0000410181 00000 n -0000409625 00000 n -0000409813 00000 n -0000418706 00000 n -0000423021 00000 n -0000423399 00000 n -0000434052 00000 n -0000428173 00000 n -0000425809 00000 n -0000425935 00000 n -0000428425 00000 n -0000428047 00000 n -0000428551 00000 n -0000418951 00000 n -0000418826 00000 n -0000414757 00000 n -0000412676 00000 n -0000410341 00000 n -0000414517 00000 n -0000414577 00000 n -0000412895 00000 n -0000413083 00000 n -0000413271 00000 n -0000413458 00000 n -0000413646 00000 n -0000413833 00000 n -0000414637 00000 n -0000414021 00000 n -0000414697 00000 n -0000414209 00000 n -0000414363 00000 n -0000419203 00000 n -0000428299 00000 n -0000425684 00000 n -0000419077 00000 n -0000425558 00000 n -0000437772 00000 n -0000422895 00000 n -0000419267 00000 n -0000416738 00000 n -0000414883 00000 n -0000418347 00000 n -0000416948 00000 n -0000417135 00000 n -0000417289 00000 n -0000417477 00000 n -0000417631 00000 n -0000417817 00000 n -0000418466 00000 n -0000418526 00000 n -0000417971 00000 n -0000418586 00000 n -0000418159 00000 n -0000418646 00000 n -0000418766 00000 n -0000418891 00000 n -0000419017 00000 n -0000419143 00000 n -0000434608 00000 n -0000437586 00000 n -0000423525 00000 n -0000421173 00000 n -0000419367 00000 n -0000422775 00000 n -0000422835 00000 n -0000422961 00000 n -0000423087 00000 n -0000421383 00000 n -0000421536 00000 n -0000423213 00000 n -0000421690 00000 n -0000421841 00000 n -0000422027 00000 n -0000422214 00000 n -0000422402 00000 n -0000423339 00000 n -0000422587 00000 n -0000423465 00000 n -0000426251 00000 n -0000425163 00000 n -0000423611 00000 n -0000425498 00000 n -0000425624 00000 n -0000425750 00000 n -0000425310 00000 n -0000425875 00000 n -0000426001 00000 n -0000426127 00000 n -0001245409 00000 n -0000428741 00000 n -0000427801 00000 n -0000426337 00000 n -0000427927 00000 n -0000427987 00000 n -0000428113 00000 n -0000428239 00000 n -0000428365 00000 n -0000428491 00000 n -0000428617 00000 n -0000434672 00000 n -0000430633 00000 n -0000428827 00000 n -0000433806 00000 n -0000433866 00000 n -0000433992 00000 n -0000434117 00000 n -0000434177 00000 n -0000434297 00000 n -0000430933 00000 n -0000431121 00000 n -0000431275 00000 n -0000431429 00000 n -0000431583 00000 n -0000431737 00000 n -0000431891 00000 n -0000432045 00000 n -0000432199 00000 n -0000434423 00000 n -0000432353 00000 n -0000432540 00000 n -0000432694 00000 n -0000432848 00000 n -0000433002 00000 n -0000433156 00000 n -0000433310 00000 n -0000433464 00000 n -0000434548 00000 n -0000433618 00000 n -0000971573 00000 n -0000998429 00000 n -0001008609 00000 n -0001029236 00000 n -0001021623 00000 n -0000437892 00000 n -0000435994 00000 n -0000434758 00000 n -0000437466 00000 n -0000437526 00000 n -0000436204 00000 n -0000436357 00000 n -0000436511 00000 n -0000436665 00000 n -0000436819 00000 n -0000437652 00000 n -0000436973 00000 n -0000437158 00000 n -0000437312 00000 n -0000437712 00000 n -0000437832 00000 n -0001046140 00000 n -0000441127 00000 n -0000440091 00000 n -0000438005 00000 n -0000440588 00000 n -0000440767 00000 n -0000440827 00000 n -0000440247 00000 n -0000440887 00000 n -0000440400 00000 n -0000440947 00000 n -0000441007 00000 n -0000441067 00000 n -0000446810 00000 n -0000443198 00000 n -0000441227 00000 n -0000445973 00000 n -0000446152 00000 n -0000446212 00000 n -0000443462 00000 n -0000443615 00000 n -0000443766 00000 n -0000446272 00000 n -0000446331 00000 n -0000443917 00000 n -0000446390 00000 n -0000444103 00000 n -0000446450 00000 n -0000444290 00000 n -0000446510 00000 n -0000444477 00000 n -0000446570 00000 n -0000444665 00000 n -0000444851 00000 n -0000445038 00000 n -0000445224 00000 n -0000445412 00000 n -0000446630 00000 n -0000446690 00000 n -0000445598 00000 n -0000446750 00000 n -0000445786 00000 n -0000451561 00000 n -0000448918 00000 n -0000446923 00000 n -0000451143 00000 n -0000451203 00000 n -0000451322 00000 n -0000449164 00000 n -0000451381 00000 n -0000449317 00000 n -0000449470 00000 n -0000451441 00000 n -0000449623 00000 n -0000451501 00000 n -0000449777 00000 n -0000449965 00000 n -0000450119 00000 n -0000450307 00000 n -0000450460 00000 n -0000450647 00000 n -0000450801 00000 n -0000450989 00000 n -0001245534 00000 n -0000462222 00000 n -0000459096 00000 n -0000456241 00000 n -0000456365 00000 n -0000456121 00000 n -0000456491 00000 n -0000453780 00000 n -0000451687 00000 n -0000456001 00000 n -0000456061 00000 n -0000456181 00000 n -0000454026 00000 n -0000454180 00000 n -0000454334 00000 n -0000454486 00000 n -0000456306 00000 n -0000454640 00000 n -0000454791 00000 n -0000454979 00000 n -0000455167 00000 n -0000455320 00000 n -0000456431 00000 n -0000455474 00000 n -0000455627 00000 n -0000455814 00000 n -0000459222 00000 n -0000457854 00000 n -0000456604 00000 n -0000459036 00000 n -0000458046 00000 n -0000459162 00000 n -0000458234 00000 n -0000458388 00000 n -0000458576 00000 n -0000458730 00000 n -0000458882 00000 n -0000462886 00000 n -0000460946 00000 n -0000459335 00000 n -0000462162 00000 n -0000462341 00000 n -0000461138 00000 n -0000461292 00000 n -0000461446 00000 n -0000462401 00000 n -0000462461 00000 n -0000461600 00000 n -0000462521 00000 n -0000461788 00000 n -0000461974 00000 n -0000462580 00000 n -0000462640 00000 n -0000462700 00000 n -0000462760 00000 n -0000462826 00000 n -0000468412 00000 n -0000465547 00000 n -0000462986 00000 n -0000467995 00000 n -0000468173 00000 n -0000465802 00000 n -0000465955 00000 n -0000466142 00000 n -0000466328 00000 n -0000468233 00000 n -0000466516 00000 n -0000468292 00000 n -0000466669 00000 n -0000466823 00000 n -0000468352 00000 n -0000466977 00000 n -0000467163 00000 n -0000467315 00000 n -0000467503 00000 n -0000467657 00000 n -0000467843 00000 n -0000477719 00000 n -0000486199 00000 n -0000486450 00000 n -0000490963 00000 n -0000477839 00000 n -0000471354 00000 n -0000468512 00000 n -0000477359 00000 n -0000471789 00000 n -0000471976 00000 n -0000472129 00000 n -0000472316 00000 n -0000472469 00000 n -0000472657 00000 n -0000472811 00000 n -0000472999 00000 n -0000473153 00000 n -0000473340 00000 n -0000473493 00000 n -0000473681 00000 n -0000473835 00000 n -0000474023 00000 n -0000474176 00000 n -0000474363 00000 n -0000474516 00000 n -0000474704 00000 n -0000474858 00000 n -0000475046 00000 n -0000475200 00000 n -0000475384 00000 n -0000477419 00000 n -0000475533 00000 n -0000475721 00000 n -0000475875 00000 n -0000476029 00000 n -0000477479 00000 n -0000477539 00000 n -0000476183 00000 n -0000476371 00000 n -0000476558 00000 n -0000476712 00000 n -0000477599 00000 n -0000476866 00000 n -0000477053 00000 n -0000477659 00000 n -0000477779 00000 n -0000477206 00000 n -0000494550 00000 n -0000486324 00000 n -0000481628 00000 n -0000490711 00000 n -0000490837 00000 n -0000481880 00000 n -0000481754 00000 n -0000482006 00000 n -0000490585 00000 n -0000494676 00000 n -0000482132 00000 n -0000479734 00000 n -0000477952 00000 n -0000481568 00000 n -0000479962 00000 n -0000480116 00000 n -0000481694 00000 n -0000480270 00000 n -0000480424 00000 n -0000480578 00000 n -0000481820 00000 n -0000480732 00000 n -0000481946 00000 n -0000480886 00000 n -0000481040 00000 n -0000482072 00000 n -0000481228 00000 n -0000481382 00000 n -0001245659 00000 n -0000486575 00000 n -0000484436 00000 n -0000482245 00000 n -0000486139 00000 n -0000484655 00000 n -0000484809 00000 n -0000486265 00000 n -0000484963 00000 n -0000485117 00000 n -0000485304 00000 n -0000485491 00000 n -0000486390 00000 n -0000485644 00000 n -0000485798 00000 n -0000486515 00000 n -0000485985 00000 n -0000491027 00000 n -0000488658 00000 n -0000486688 00000 n -0000490525 00000 n -0000488886 00000 n -0000489040 00000 n -0000490651 00000 n -0000489194 00000 n -0000489348 00000 n -0000490777 00000 n -0000489536 00000 n -0000489690 00000 n -0000490903 00000 n -0000489877 00000 n -0000490030 00000 n -0000490217 00000 n -0000490371 00000 n -0000494802 00000 n -0000493119 00000 n -0000491140 00000 n -0000494430 00000 n -0000494490 00000 n -0000493320 00000 n -0000493474 00000 n -0000494616 00000 n -0000493627 00000 n -0000493780 00000 n -0000493934 00000 n -0000494742 00000 n -0000494088 00000 n -0000494242 00000 n -0000495759 00000 n -0000495573 00000 n -0000494928 00000 n -0000495699 00000 n -0000502863 00000 n -0000498394 00000 n -0000495872 00000 n -0000502265 00000 n -0000502325 00000 n -0000502444 00000 n -0000498712 00000 n -0000498900 00000 n -0000499088 00000 n -0000499276 00000 n -0000499464 00000 n -0000502504 00000 n -0000499652 00000 n -0000499805 00000 n -0000502564 00000 n -0000499958 00000 n -0000502624 00000 n -0000502684 00000 n -0000500112 00000 n -0000502744 00000 n -0000500299 00000 n -0000500487 00000 n -0000502803 00000 n -0000500675 00000 n -0000500863 00000 n -0000501017 00000 n -0000501205 00000 n -0000501393 00000 n -0000501547 00000 n -0000501735 00000 n -0000501923 00000 n -0000502077 00000 n -0000507376 00000 n -0000507556 00000 n -0000507676 00000 n -0000510243 00000 n -0000507802 00000 n -0000505092 00000 n -0000502976 00000 n -0000507256 00000 n -0000507316 00000 n -0000507436 00000 n -0000505329 00000 n -0000505517 00000 n -0000505705 00000 n -0000505893 00000 n -0000507496 00000 n -0000507616 00000 n -0000506046 00000 n -0000506200 00000 n -0000506386 00000 n -0000506574 00000 n -0000507742 00000 n -0000506728 00000 n -0000506882 00000 n -0000507070 00000 n -0001245784 00000 n -0000510368 00000 n -0000509166 00000 n -0000507928 00000 n -0000510183 00000 n -0000509349 00000 n -0000510308 00000 n -0000509503 00000 n -0000509657 00000 n -0000509843 00000 n -0000510031 00000 n -0000517832 00000 n -0000513059 00000 n -0000510481 00000 n -0000517058 00000 n -0000517237 00000 n -0000513377 00000 n -0000513565 00000 n -0000513753 00000 n -0000517297 00000 n -0000513941 00000 n -0000514094 00000 n -0000517356 00000 n -0000517415 00000 n -0000514247 00000 n -0000517474 00000 n -0000514435 00000 n -0000517534 00000 n -0000514622 00000 n -0000517594 00000 n -0000514810 00000 n -0000517654 00000 n -0000517713 00000 n -0000514998 00000 n -0000515186 00000 n -0000515372 00000 n -0000515557 00000 n -0000515744 00000 n -0000515931 00000 n -0000516119 00000 n -0000517772 00000 n -0000516307 00000 n -0000516494 00000 n -0000516682 00000 n -0000516870 00000 n -0000522262 00000 n -0000525329 00000 n -0000522016 00000 n -0000521896 00000 n -0000522142 00000 n -0000522387 00000 n -0000519877 00000 n -0000517945 00000 n -0000521776 00000 n -0000521836 00000 n -0000521956 00000 n -0000520105 00000 n -0000520291 00000 n -0000520445 00000 n -0000522082 00000 n -0000520599 00000 n -0000520786 00000 n -0000520940 00000 n -0000522202 00000 n -0000521094 00000 n -0000521281 00000 n -0000521435 00000 n -0000522328 00000 n -0000521589 00000 n -0000525455 00000 n -0000523959 00000 n -0000522500 00000 n -0000525269 00000 n -0000524160 00000 n -0000524347 00000 n -0000524501 00000 n -0000524655 00000 n -0000525395 00000 n -0000524808 00000 n -0000524962 00000 n -0000525116 00000 n -0000532767 00000 n -0000528057 00000 n -0000525568 00000 n -0000531632 00000 n -0000531811 00000 n -0000531871 00000 n -0000528357 00000 n -0000528510 00000 n -0000531931 00000 n -0000528663 00000 n -0000531989 00000 n -0000532049 00000 n -0000528817 00000 n -0000532109 00000 n -0000529005 00000 n -0000532169 00000 n -0000529192 00000 n -0000532229 00000 n -0000529379 00000 n -0000532289 00000 n -0000529567 00000 n -0000532349 00000 n -0000529755 00000 n -0000532409 00000 n -0000529943 00000 n -0000532469 00000 n -0000530131 00000 n -0000532529 00000 n -0000530319 00000 n -0000532588 00000 n -0000530505 00000 n -0000532648 00000 n -0000530693 00000 n -0000532707 00000 n -0000530880 00000 n -0000531068 00000 n -0000531256 00000 n -0000531444 00000 n -0000535644 00000 n -0000535524 00000 n -0000535770 00000 n -0000535896 00000 n -0000534744 00000 n -0000532880 00000 n -0000535404 00000 n -0000535464 00000 n -0000535584 00000 n -0000535710 00000 n -0000534909 00000 n -0000535063 00000 n -0000535836 00000 n -0000535217 00000 n -0001245909 00000 n -0000544822 00000 n -0000538364 00000 n -0000536009 00000 n -0000543203 00000 n -0000543382 00000 n -0000543442 00000 n -0000538727 00000 n -0000538880 00000 n -0000539032 00000 n -0000539184 00000 n -0000543502 00000 n -0000539337 00000 n -0000543562 00000 n -0000543622 00000 n -0000539491 00000 n -0000543682 00000 n -0000539679 00000 n -0000543742 00000 n -0000539866 00000 n -0000543802 00000 n -0000540053 00000 n -0000543862 00000 n -0000540239 00000 n -0000543922 00000 n -0000540427 00000 n -0000543982 00000 n -0000540614 00000 n -0000544042 00000 n -0000540802 00000 n -0000544102 00000 n -0000540990 00000 n -0000544162 00000 n -0000541178 00000 n -0000544222 00000 n -0000541364 00000 n -0000544282 00000 n -0000541552 00000 n -0000544342 00000 n -0000541740 00000 n -0000544402 00000 n -0000541928 00000 n -0000544462 00000 n -0000542113 00000 n -0000544522 00000 n -0000542301 00000 n -0000544582 00000 n -0000542488 00000 n -0000544642 00000 n -0000542676 00000 n -0000544702 00000 n -0000544762 00000 n -0000542864 00000 n -0000543017 00000 n -0000549572 00000 n -0000546868 00000 n -0000544935 00000 n -0000548902 00000 n -0000548962 00000 n -0000549022 00000 n -0000547096 00000 n -0000549082 00000 n -0000547284 00000 n -0000547470 00000 n -0000547656 00000 n -0000549142 00000 n -0000547844 00000 n -0000548032 00000 n -0000548219 00000 n -0000548406 00000 n -0000549202 00000 n -0000549262 00000 n -0000549322 00000 n -0000548594 00000 n -0000549382 00000 n -0000549448 00000 n -0000548748 00000 n -0000549508 00000 n -0000551883 00000 n -0000552009 00000 n -0000552133 00000 n -0000551136 00000 n -0000549699 00000 n -0000551763 00000 n -0000551823 00000 n -0000551301 00000 n -0000551949 00000 n -0000551455 00000 n -0000552074 00000 n -0000551609 00000 n -0000555493 00000 n -0000553460 00000 n -0000552246 00000 n -0000554836 00000 n -0000555015 00000 n -0000553661 00000 n -0000555075 00000 n -0000553815 00000 n -0000553968 00000 n -0000555135 00000 n -0000554120 00000 n -0000555193 00000 n -0000555253 00000 n -0000554273 00000 n -0000555313 00000 n -0000555373 00000 n -0000554460 00000 n -0000555433 00000 n -0000554648 00000 n -0000564257 00000 n -0000557971 00000 n -0000555593 00000 n -0000562882 00000 n -0000563061 00000 n -0000558334 00000 n -0000558520 00000 n -0000558706 00000 n -0000558894 00000 n -0000559081 00000 n -0000559269 00000 n -0000563121 00000 n -0000559455 00000 n -0000559608 00000 n -0000563181 00000 n -0000559761 00000 n -0000563241 00000 n -0000563301 00000 n -0000559915 00000 n -0000563361 00000 n -0000560103 00000 n -0000563421 00000 n -0000560287 00000 n -0000563481 00000 n -0000560475 00000 n -0000563541 00000 n -0000560663 00000 n -0000563600 00000 n -0000560851 00000 n -0000563660 00000 n -0000561039 00000 n -0000563720 00000 n -0000561227 00000 n -0000563780 00000 n -0000561415 00000 n -0000563840 00000 n -0000561603 00000 n -0000563900 00000 n -0000561791 00000 n -0000563959 00000 n -0000561979 00000 n -0000564019 00000 n -0000562167 00000 n -0000564079 00000 n -0000562355 00000 n -0000564139 00000 n -0000564198 00000 n -0000562543 00000 n -0000562696 00000 n -0000574040 00000 n -0000573915 00000 n -0000583119 00000 n -0000570197 00000 n -0000573789 00000 n -0000570317 00000 n -0000566753 00000 n -0000564357 00000 n -0000569838 00000 n -0000569898 00000 n -0000567026 00000 n -0000567214 00000 n -0000567402 00000 n -0000567589 00000 n -0000567775 00000 n -0000567962 00000 n -0000569958 00000 n -0000568150 00000 n -0000568338 00000 n -0000568525 00000 n -0000570018 00000 n -0000568713 00000 n -0000570078 00000 n -0000568900 00000 n -0000569088 00000 n -0000569276 00000 n -0000569464 00000 n -0000569650 00000 n -0000570137 00000 n -0000570257 00000 n -0001246034 00000 n -0000579305 00000 n -0000582868 00000 n -0000574166 00000 n -0000579431 00000 n -0000582994 00000 n -0000574230 00000 n -0000572098 00000 n -0000570430 00000 n -0000573729 00000 n -0000572317 00000 n -0000572470 00000 n -0000573855 00000 n -0000572624 00000 n -0000572776 00000 n -0000573980 00000 n -0000572929 00000 n -0000573082 00000 n -0000574106 00000 n -0000573236 00000 n -0000573424 00000 n -0000573576 00000 n -0000579495 00000 n -0000577021 00000 n -0000574343 00000 n -0000579185 00000 n -0000579245 00000 n -0000577258 00000 n -0000577446 00000 n -0000577599 00000 n -0000579371 00000 n -0000577753 00000 n -0000577941 00000 n -0000578129 00000 n -0000578316 00000 n -0000578504 00000 n -0000578691 00000 n -0000578878 00000 n -0000579031 00000 n -0000583183 00000 n -0000581241 00000 n -0000579608 00000 n -0000582748 00000 n -0000582808 00000 n -0000581451 00000 n -0000581639 00000 n -0000581792 00000 n -0000582934 00000 n -0000581946 00000 n -0000582099 00000 n -0000583059 00000 n -0000582253 00000 n -0000582441 00000 n -0000582594 00000 n -0000584621 00000 n -0000584038 00000 n -0000583282 00000 n -0000584501 00000 n -0000584561 00000 n -0000584194 00000 n -0000584347 00000 n -0000591352 00000 n -0000586870 00000 n -0000584707 00000 n -0000590214 00000 n -0000590393 00000 n -0000590453 00000 n -0000587161 00000 n -0000587313 00000 n -0000587466 00000 n -0000590513 00000 n -0000587619 00000 n -0000590572 00000 n -0000587773 00000 n -0000590632 00000 n -0000587960 00000 n -0000590692 00000 n -0000588148 00000 n -0000590752 00000 n -0000588336 00000 n -0000590812 00000 n -0000588524 00000 n -0000590872 00000 n -0000588712 00000 n -0000590932 00000 n -0000588900 00000 n -0000590992 00000 n -0000589087 00000 n -0000591052 00000 n -0000589275 00000 n -0000591112 00000 n -0000589463 00000 n -0000591172 00000 n -0000591232 00000 n -0000589651 00000 n -0000591292 00000 n -0000589839 00000 n -0000590027 00000 n -0000592778 00000 n -0000592958 00000 n -0000593078 00000 n -0000592532 00000 n -0000591465 00000 n -0000592658 00000 n -0000592718 00000 n -0000592838 00000 n -0000592898 00000 n -0000593018 00000 n -0001246159 00000 n -0000593729 00000 n -0000593543 00000 n -0000593178 00000 n -0000593669 00000 n -0000601284 00000 n -0000595273 00000 n -0000593802 00000 n -0000600148 00000 n -0000600385 00000 n -0000595636 00000 n -0000595790 00000 n -0000600445 00000 n -0000600505 00000 n -0000595943 00000 n -0000596097 00000 n -0000600565 00000 n -0000596284 00000 n -0000600625 00000 n -0000596471 00000 n -0000596625 00000 n -0000600685 00000 n -0000596812 00000 n -0000596966 00000 n -0000600745 00000 n -0000597152 00000 n -0000597340 00000 n -0000600805 00000 n -0000597527 00000 n -0000600865 00000 n -0000597714 00000 n -0000600925 00000 n -0000597900 00000 n -0000598088 00000 n -0000600984 00000 n -0000598275 00000 n -0000598463 00000 n -0000601044 00000 n -0000598650 00000 n -0000598838 00000 n -0000601104 00000 n -0000599025 00000 n -0000599213 00000 n -0000601164 00000 n -0000599400 00000 n -0000599588 00000 n -0000601224 00000 n -0000599775 00000 n -0000599962 00000 n -0000603990 00000 n -0000602297 00000 n -0000601383 00000 n -0000603512 00000 n -0000603690 00000 n -0000602489 00000 n -0000602643 00000 n -0000603750 00000 n -0000603810 00000 n -0000602797 00000 n -0000602951 00000 n -0000603870 00000 n -0000603138 00000 n -0000603930 00000 n -0000603325 00000 n -0000982202 00000 n -0000605699 00000 n -0000604751 00000 n -0000604076 00000 n -0000605281 00000 n -0000605459 00000 n -0000605519 00000 n -0000605579 00000 n -0000604907 00000 n -0000605639 00000 n -0000605094 00000 n -0000610651 00000 n -0000607083 00000 n -0000605798 00000 n -0000609695 00000 n -0000609873 00000 n -0000609933 00000 n -0000609993 00000 n -0000607338 00000 n -0000610053 00000 n -0000607524 00000 n -0000607678 00000 n -0000610113 00000 n -0000607865 00000 n -0000608019 00000 n -0000610172 00000 n -0000608206 00000 n -0000610232 00000 n -0000608391 00000 n -0000610292 00000 n -0000608576 00000 n -0000610352 00000 n -0000608763 00000 n -0000610412 00000 n -0000608950 00000 n -0000610472 00000 n -0000609137 00000 n -0000610532 00000 n -0000609323 00000 n -0000610591 00000 n -0000609510 00000 n -0000613003 00000 n -0000611545 00000 n -0000610750 00000 n -0000612466 00000 n -0000612644 00000 n -0000612704 00000 n -0000612764 00000 n -0000611719 00000 n -0000612824 00000 n -0000611906 00000 n -0000612884 00000 n -0000612093 00000 n -0000612943 00000 n -0000612280 00000 n -0001246284 00000 n -0000618735 00000 n -0000614566 00000 n -0000613102 00000 n -0000617899 00000 n -0000618077 00000 n -0000614857 00000 n -0000618137 00000 n -0000618196 00000 n -0000615010 00000 n -0000615163 00000 n -0000615316 00000 n -0000618255 00000 n -0000615502 00000 n -0000615690 00000 n -0000618315 00000 n -0000615876 00000 n -0000616064 00000 n -0000618375 00000 n -0000616251 00000 n -0000618435 00000 n -0000616438 00000 n -0000616626 00000 n -0000618495 00000 n -0000616813 00000 n -0000617001 00000 n -0000618555 00000 n -0000617188 00000 n -0000617342 00000 n -0000618615 00000 n -0000617528 00000 n -0000618675 00000 n -0000617713 00000 n -0000620695 00000 n -0000619550 00000 n -0000618860 00000 n -0000620277 00000 n -0000620455 00000 n -0000620515 00000 n -0000620575 00000 n -0000619715 00000 n -0000619903 00000 n -0000620635 00000 n -0000620090 00000 n -0000622546 00000 n -0000621494 00000 n -0000620794 00000 n -0000622188 00000 n -0000622366 00000 n -0000621659 00000 n -0000622426 00000 n -0000622486 00000 n -0000621813 00000 n -0000622001 00000 n -0000628080 00000 n -0000623872 00000 n -0000622632 00000 n -0000627243 00000 n -0000627421 00000 n -0000624163 00000 n -0000624317 00000 n -0000624471 00000 n -0000627481 00000 n -0000627541 00000 n -0000624625 00000 n -0000624813 00000 n -0000627601 00000 n -0000625000 00000 n -0000627661 00000 n -0000625187 00000 n -0000627721 00000 n -0000625374 00000 n -0000627781 00000 n -0000625561 00000 n -0000627840 00000 n -0000625748 00000 n -0000625935 00000 n -0000627900 00000 n -0000626119 00000 n -0000626307 00000 n -0000627960 00000 n -0000626494 00000 n -0000626682 00000 n -0000628020 00000 n -0000626869 00000 n -0000627057 00000 n -0000631434 00000 n -0000629238 00000 n -0000628179 00000 n -0000631076 00000 n -0000631254 00000 n -0000629457 00000 n -0000629611 00000 n -0000631314 00000 n -0000631374 00000 n -0000629765 00000 n -0000629952 00000 n -0000630138 00000 n -0000630326 00000 n -0000630514 00000 n -0000630700 00000 n -0000630888 00000 n -0000634446 00000 n -0000632654 00000 n -0000631533 00000 n -0000634030 00000 n -0000634208 00000 n -0000632855 00000 n -0000633042 00000 n -0000633196 00000 n -0000633350 00000 n -0000633504 00000 n -0000634268 00000 n -0000634327 00000 n -0000633658 00000 n -0000634386 00000 n -0000633843 00000 n -0001246409 00000 n -0000642316 00000 n -0000636745 00000 n -0000634558 00000 n -0000641358 00000 n -0000641536 00000 n -0000637090 00000 n -0000641596 00000 n -0000641656 00000 n -0000637244 00000 n -0000637432 00000 n -0000641716 00000 n -0000637618 00000 n -0000637803 00000 n -0000641776 00000 n -0000637987 00000 n -0000638175 00000 n -0000641836 00000 n -0000638362 00000 n -0000638550 00000 n -0000641896 00000 n -0000638737 00000 n -0000638923 00000 n -0000641956 00000 n -0000639108 00000 n -0000639296 00000 n -0000642016 00000 n -0000639483 00000 n -0000639671 00000 n -0000642076 00000 n -0000639858 00000 n -0000640046 00000 n -0000642136 00000 n -0000640233 00000 n -0000640421 00000 n -0000642196 00000 n -0000640608 00000 n -0000640796 00000 n -0000642256 00000 n -0000640983 00000 n -0000641171 00000 n -0000645321 00000 n -0000643347 00000 n -0000642442 00000 n -0000645021 00000 n -0000645081 00000 n -0000643557 00000 n -0000643745 00000 n -0000645141 00000 n -0000643932 00000 n -0000644120 00000 n -0000645201 00000 n -0000644307 00000 n -0000644495 00000 n -0000645261 00000 n -0000644682 00000 n -0000644835 00000 n -0000647037 00000 n -0000646148 00000 n -0000645421 00000 n -0000646679 00000 n -0000646857 00000 n -0000646917 00000 n -0000646977 00000 n -0000646304 00000 n -0000646492 00000 n -0000649685 00000 n -0000647959 00000 n -0000647149 00000 n -0000649208 00000 n -0000649386 00000 n -0000649446 00000 n -0000649506 00000 n -0000648151 00000 n -0000648305 00000 n -0000649566 00000 n -0000648492 00000 n -0000648646 00000 n -0000649626 00000 n -0000648833 00000 n -0000649021 00000 n -0000658442 00000 n -0000651222 00000 n -0000649797 00000 n -0000657245 00000 n -0000657423 00000 n -0000657483 00000 n -0000657543 00000 n -0000651630 00000 n -0000651818 00000 n -0000657603 00000 n -0000652005 00000 n -0000652193 00000 n -0000657663 00000 n -0000652380 00000 n -0000652568 00000 n -0000657723 00000 n -0000652755 00000 n -0000652942 00000 n -0000657783 00000 n -0000653128 00000 n -0000653316 00000 n -0000657843 00000 n -0000653503 00000 n -0000653691 00000 n -0000657903 00000 n -0000653878 00000 n -0000654066 00000 n -0000657963 00000 n -0000654252 00000 n -0000654440 00000 n -0000658023 00000 n -0000654627 00000 n -0000654815 00000 n -0000658083 00000 n -0000655002 00000 n -0000655190 00000 n -0000658142 00000 n -0000655377 00000 n -0000655563 00000 n -0000658202 00000 n -0000655748 00000 n -0000655936 00000 n -0000658262 00000 n -0000656123 00000 n -0000656311 00000 n -0000658322 00000 n -0000656498 00000 n -0000656685 00000 n -0000658382 00000 n -0000656871 00000 n -0000657059 00000 n -0000659990 00000 n -0000659135 00000 n -0000658528 00000 n -0000659632 00000 n -0000659810 00000 n -0000659870 00000 n -0000659930 00000 n -0000659291 00000 n -0000659445 00000 n -0001246534 00000 n -0000668945 00000 n -0000662093 00000 n -0000660076 00000 n -0000668466 00000 n -0000668645 00000 n -0000668705 00000 n -0000668765 00000 n -0000662519 00000 n -0000662706 00000 n -0000662891 00000 n -0000663077 00000 n -0000663262 00000 n -0000663448 00000 n -0000663633 00000 n -0000663820 00000 n -0000664006 00000 n -0000664191 00000 n -0000664375 00000 n -0000664561 00000 n -0000664745 00000 n -0000664932 00000 n -0000665118 00000 n -0000665304 00000 n -0000665489 00000 n -0000665675 00000 n -0000665860 00000 n -0000668825 00000 n -0000666046 00000 n -0000666233 00000 n -0000666418 00000 n -0000666605 00000 n -0000666791 00000 n -0000666978 00000 n -0000667164 00000 n -0000667351 00000 n -0000667537 00000 n -0000668885 00000 n -0000667723 00000 n -0000667910 00000 n -0000668095 00000 n -0000668281 00000 n -0001145426 00000 n -0001145393 00000 n -0001145360 00000 n -0001145327 00000 n -0001145294 00000 n -0001145261 00000 n -0001145228 00000 n -0001145195 00000 n -0001145162 00000 n -0001145129 00000 n -0000675485 00000 n -0000670548 00000 n -0000669071 00000 n -0000675365 00000 n -0000670902 00000 n -0000671089 00000 n -0000671275 00000 n -0000671462 00000 n -0000671648 00000 n -0000671834 00000 n -0000672019 00000 n -0000672206 00000 n -0000672392 00000 n -0000672579 00000 n -0000672765 00000 n -0000672950 00000 n -0000673133 00000 n -0000673320 00000 n -0000673506 00000 n -0000675425 00000 n -0000673692 00000 n -0000673878 00000 n -0000674062 00000 n -0000674249 00000 n -0000674435 00000 n -0000674621 00000 n -0000674806 00000 n -0000674993 00000 n -0000675179 00000 n -0001145096 00000 n -0001145063 00000 n -0001145030 00000 n -0001144997 00000 n -0001144964 00000 n -0000686796 00000 n -0000677312 00000 n -0000675585 00000 n -0000685298 00000 n -0000685477 00000 n -0000685537 00000 n -0000685597 00000 n -0000677810 00000 n -0000677998 00000 n -0000685657 00000 n -0000678185 00000 n -0000678373 00000 n -0000685717 00000 n -0000678560 00000 n -0000678748 00000 n -0000685777 00000 n -0000678935 00000 n -0000679122 00000 n -0000685837 00000 n -0000679308 00000 n -0000679496 00000 n -0000685897 00000 n -0000679683 00000 n -0000679871 00000 n -0000685957 00000 n -0000680058 00000 n -0000680246 00000 n -0000686017 00000 n -0000680432 00000 n -0000680620 00000 n -0000686077 00000 n -0000680807 00000 n -0000680995 00000 n -0000686137 00000 n -0000681182 00000 n -0000681370 00000 n -0000686196 00000 n -0000681557 00000 n -0000681743 00000 n -0000686256 00000 n -0000681928 00000 n -0000682116 00000 n -0000686316 00000 n -0000682303 00000 n -0000682491 00000 n -0000686376 00000 n -0000682678 00000 n -0000682866 00000 n -0000686436 00000 n -0000683053 00000 n -0000683241 00000 n -0000686496 00000 n -0000683428 00000 n -0000683616 00000 n -0000686556 00000 n -0000683803 00000 n -0000683991 00000 n -0000686616 00000 n -0000684178 00000 n -0000684364 00000 n -0000686676 00000 n -0000684548 00000 n -0000684736 00000 n -0000686736 00000 n -0000684923 00000 n -0000685111 00000 n -0000691264 00000 n -0000688237 00000 n -0000686882 00000 n -0000690665 00000 n -0000690844 00000 n -0000688483 00000 n -0000688637 00000 n -0000690904 00000 n -0000690964 00000 n -0000688791 00000 n -0000688979 00000 n -0000691024 00000 n -0000689165 00000 n -0000689353 00000 n -0000691084 00000 n -0000689540 00000 n -0000689728 00000 n -0000691144 00000 n -0000689915 00000 n -0000690103 00000 n -0000691204 00000 n -0000690290 00000 n -0000690478 00000 n -0000699536 00000 n -0000692765 00000 n -0000691390 00000 n -0000698398 00000 n -0000698577 00000 n -0000698637 00000 n -0000698697 00000 n -0000693155 00000 n -0000693343 00000 n -0000698757 00000 n -0000693530 00000 n -0000693718 00000 n -0000698817 00000 n -0000693905 00000 n -0000694093 00000 n -0000698877 00000 n -0000694280 00000 n -0000694467 00000 n -0000698937 00000 n -0000694653 00000 n -0000694841 00000 n -0000698997 00000 n -0000695028 00000 n -0000695216 00000 n -0000699057 00000 n -0000695403 00000 n -0000695591 00000 n -0000699117 00000 n -0000695777 00000 n -0000695965 00000 n -0000699177 00000 n -0000696152 00000 n -0000696340 00000 n -0000699237 00000 n -0000696527 00000 n -0000696715 00000 n -0000699296 00000 n -0000696902 00000 n -0000697088 00000 n -0000699356 00000 n -0000697273 00000 n -0000697461 00000 n -0000699416 00000 n -0000697648 00000 n -0000697836 00000 n -0000699476 00000 n -0000698023 00000 n -0000698211 00000 n -0000705952 00000 n -0000701003 00000 n -0000699622 00000 n -0000704996 00000 n -0000705175 00000 n -0000701321 00000 n -0000701474 00000 n -0000705235 00000 n -0000705295 00000 n -0000701628 00000 n -0000701816 00000 n -0000705355 00000 n -0000702003 00000 n -0000702190 00000 n -0000705415 00000 n -0000702376 00000 n -0000702564 00000 n -0000705475 00000 n -0000702751 00000 n -0000702939 00000 n -0000705535 00000 n -0000703125 00000 n -0000705594 00000 n -0000703312 00000 n -0000705654 00000 n -0000703497 00000 n -0000703685 00000 n -0000705712 00000 n -0000703872 00000 n -0000704060 00000 n -0000705772 00000 n -0000704247 00000 n -0000705832 00000 n -0000704434 00000 n -0000704622 00000 n -0000705892 00000 n -0000704809 00000 n -0001246659 00000 n -0000706598 00000 n -0000706412 00000 n -0000706038 00000 n -0000706538 00000 n -0000708819 00000 n -0000707588 00000 n -0000706671 00000 n -0000708462 00000 n -0000708700 00000 n -0000707762 00000 n -0000707933 00000 n -0000708760 00000 n -0000708087 00000 n -0000708274 00000 n -0001144931 00000 n -0000711783 00000 n -0000710131 00000 n -0000708931 00000 n -0000711364 00000 n -0000711543 00000 n -0000710323 00000 n -0000710494 00000 n -0000711603 00000 n -0000710648 00000 n -0000711663 00000 n -0000710802 00000 n -0000711723 00000 n -0000710989 00000 n -0000711176 00000 n -0001144898 00000 n -0000721355 00000 n -0000714657 00000 n -0000711895 00000 n -0000720037 00000 n -0000720216 00000 n -0000715038 00000 n -0000715214 00000 n -0000720276 00000 n -0000715367 00000 n -0000715554 00000 n -0000720336 00000 n -0000715742 00000 n -0000720396 00000 n -0000715929 00000 n -0000720456 00000 n -0000716115 00000 n -0000720516 00000 n -0000716299 00000 n -0000720576 00000 n -0000716486 00000 n -0000720636 00000 n -0000716672 00000 n -0000720696 00000 n -0000716859 00000 n -0000720756 00000 n -0000717046 00000 n -0000720816 00000 n -0000717233 00000 n -0000720876 00000 n -0000717420 00000 n -0000720936 00000 n -0000717606 00000 n -0000720996 00000 n -0000717791 00000 n -0000721055 00000 n -0000717978 00000 n -0000721115 00000 n -0000718165 00000 n -0000721175 00000 n -0000718351 00000 n -0000721235 00000 n -0000718538 00000 n -0000718725 00000 n -0000721295 00000 n -0000718913 00000 n -0000719101 00000 n -0000719289 00000 n -0000719477 00000 n -0000719665 00000 n -0000719851 00000 n -0001144865 00000 n -0000723099 00000 n -0000722312 00000 n -0000721494 00000 n -0000723039 00000 n -0000722477 00000 n -0000722664 00000 n -0000722851 00000 n -0000728271 00000 n -0000725502 00000 n -0000723212 00000 n -0000727852 00000 n -0000728031 00000 n -0000725748 00000 n -0000725924 00000 n -0000728091 00000 n -0000726077 00000 n -0000726231 00000 n -0000726385 00000 n -0000726573 00000 n -0000728151 00000 n -0000726727 00000 n -0000728211 00000 n -0000726915 00000 n -0000727103 00000 n -0000727291 00000 n -0000727478 00000 n -0000727665 00000 n -0001246784 00000 n -0001144832 00000 n -0000730839 00000 n -0000729460 00000 n -0000728410 00000 n -0000730779 00000 n -0000729652 00000 n -0000729840 00000 n -0000730028 00000 n -0000730216 00000 n -0000730404 00000 n -0000730592 00000 n -0000736019 00000 n -0000732815 00000 n -0000730952 00000 n -0000735660 00000 n -0000735839 00000 n -0000733079 00000 n -0000733254 00000 n -0000735899 00000 n -0000733408 00000 n -0000733596 00000 n -0000733783 00000 n -0000733971 00000 n -0000734159 00000 n -0000734347 00000 n -0000734534 00000 n -0000735959 00000 n -0000734722 00000 n -0000734910 00000 n -0000735097 00000 n -0000735285 00000 n -0000735473 00000 n -0001144799 00000 n -0000740901 00000 n -0000738397 00000 n -0000736158 00000 n -0000740483 00000 n -0000740662 00000 n -0000738634 00000 n -0000738810 00000 n -0000740722 00000 n -0000738964 00000 n -0000740782 00000 n -0000739118 00000 n -0000739272 00000 n -0000739426 00000 n -0000739611 00000 n -0000739765 00000 n -0000739953 00000 n -0000740841 00000 n -0000740107 00000 n -0000740295 00000 n -0001144766 00000 n -0000742646 00000 n -0000741798 00000 n -0000741027 00000 n -0000742526 00000 n -0000742586 00000 n -0000741963 00000 n -0000742151 00000 n -0000742338 00000 n -0000745708 00000 n -0000744081 00000 n -0000742746 00000 n -0000745349 00000 n -0000745528 00000 n -0000744273 00000 n -0000744444 00000 n -0000745588 00000 n -0000744598 00000 n -0000745648 00000 n -0000744786 00000 n -0000744973 00000 n -0000745161 00000 n -0001144733 00000 n -0000749270 00000 n -0000747313 00000 n -0000745847 00000 n -0000748972 00000 n -0000749151 00000 n -0000747523 00000 n -0000747694 00000 n -0000749211 00000 n -0000747848 00000 n -0000748034 00000 n -0000748222 00000 n -0000748410 00000 n -0000748598 00000 n -0000748786 00000 n -0001246909 00000 n -0001144700 00000 n -0000756290 00000 n -0000751717 00000 n -0000749409 00000 n -0000755931 00000 n -0000756110 00000 n -0000752044 00000 n -0000752216 00000 n -0000756170 00000 n -0000752369 00000 n -0000752557 00000 n -0000752744 00000 n -0000752932 00000 n -0000753120 00000 n -0000753307 00000 n -0000753495 00000 n -0000753682 00000 n -0000753870 00000 n -0000754057 00000 n -0000754245 00000 n -0000754431 00000 n -0000754618 00000 n -0000754806 00000 n -0000756230 00000 n -0000754994 00000 n -0000755182 00000 n -0000755368 00000 n -0000755555 00000 n -0000755743 00000 n -0001144667 00000 n -0000760014 00000 n -0000757745 00000 n -0000756429 00000 n -0000759535 00000 n -0000759714 00000 n -0000757964 00000 n -0000758136 00000 n -0000759774 00000 n -0000758290 00000 n -0000759834 00000 n -0000758444 00000 n -0000758631 00000 n -0000758819 00000 n -0000759894 00000 n -0000759006 00000 n -0000759160 00000 n -0000759954 00000 n -0000759347 00000 n -0001144634 00000 n -0000766630 00000 n -0000762441 00000 n -0000760126 00000 n -0000766271 00000 n -0000766450 00000 n -0000762750 00000 n -0000762926 00000 n -0000766510 00000 n -0000763080 00000 n -0000763268 00000 n -0000763455 00000 n -0000763642 00000 n -0000763830 00000 n -0000764018 00000 n -0000764206 00000 n -0000764394 00000 n -0000764582 00000 n -0000764770 00000 n -0000764958 00000 n -0000765146 00000 n -0000766570 00000 n -0000765334 00000 n -0000765522 00000 n -0000765710 00000 n -0000765897 00000 n -0000766083 00000 n -0001144601 00000 n -0000768668 00000 n -0000767684 00000 n -0000766769 00000 n -0000768608 00000 n -0000767858 00000 n -0000768045 00000 n -0000768232 00000 n -0000768420 00000 n -0000774196 00000 n -0000770943 00000 n -0000768781 00000 n -0000773717 00000 n -0000773896 00000 n -0000771207 00000 n -0000771383 00000 n -0000773956 00000 n -0000771537 00000 n -0000774016 00000 n -0000771690 00000 n -0000771878 00000 n -0000774076 00000 n -0000772064 00000 n -0000772218 00000 n -0000774136 00000 n -0000772405 00000 n -0000772593 00000 n -0000772781 00000 n -0000772969 00000 n -0000773155 00000 n -0000773342 00000 n -0000773530 00000 n -0001144568 00000 n -0000777506 00000 n -0000775734 00000 n -0000774335 00000 n -0000777446 00000 n -0000775944 00000 n -0000776131 00000 n -0000776319 00000 n -0000776507 00000 n -0000776695 00000 n -0000776883 00000 n -0000777071 00000 n -0000777258 00000 n -0001247034 00000 n -0000779600 00000 n -0000778623 00000 n -0000777619 00000 n -0000779301 00000 n -0000779480 00000 n -0000778788 00000 n -0000778959 00000 n -0000779540 00000 n -0000779113 00000 n -0001144535 00000 n -0000782368 00000 n -0000780913 00000 n -0000779725 00000 n -0000781950 00000 n -0000782129 00000 n -0000781096 00000 n -0000781267 00000 n -0000782189 00000 n -0000781421 00000 n -0000782249 00000 n -0000781575 00000 n -0000782309 00000 n -0000781763 00000 n -0001144502 00000 n -0000787218 00000 n -0000784215 00000 n -0000782507 00000 n -0000786860 00000 n -0000787039 00000 n -0000784470 00000 n -0000784642 00000 n -0000787099 00000 n -0000784796 00000 n -0000784983 00000 n -0000785171 00000 n -0000785359 00000 n -0000785547 00000 n -0000785735 00000 n -0000785922 00000 n -0000786110 00000 n -0000786297 00000 n -0000787158 00000 n -0000786485 00000 n -0000786673 00000 n -0001144469 00000 n -0000791313 00000 n -0000788865 00000 n -0000787344 00000 n -0000791014 00000 n -0000791193 00000 n -0000789102 00000 n -0000789273 00000 n -0000791253 00000 n -0000789426 00000 n -0000789614 00000 n -0000789768 00000 n -0000789956 00000 n -0000790144 00000 n -0000790298 00000 n -0000790486 00000 n -0000790674 00000 n -0000790828 00000 n -0001144436 00000 n -0000796587 00000 n -0000793266 00000 n -0000791452 00000 n -0000796169 00000 n -0000796348 00000 n -0000793539 00000 n -0000793710 00000 n -0000796408 00000 n -0000793863 00000 n -0000796467 00000 n -0000794016 00000 n -0000794204 00000 n -0000794391 00000 n -0000796527 00000 n -0000794579 00000 n -0000794767 00000 n -0000794921 00000 n -0000795109 00000 n -0000795297 00000 n -0000795451 00000 n -0000795639 00000 n -0000795827 00000 n -0000795981 00000 n -0001144403 00000 n -0000800369 00000 n -0000798331 00000 n -0000796726 00000 n -0000800010 00000 n -0000800189 00000 n -0000798541 00000 n -0000798712 00000 n -0000798920 00000 n -0000800249 00000 n -0000799074 00000 n -0000799261 00000 n -0000799448 00000 n -0000799636 00000 n -0000800309 00000 n -0000799822 00000 n -0001247159 00000 n -0001144370 00000 n -0000804387 00000 n -0000802153 00000 n -0000800494 00000 n -0000804028 00000 n -0000804207 00000 n -0000802372 00000 n -0000802543 00000 n -0000802753 00000 n -0000804267 00000 n -0000802907 00000 n -0000803094 00000 n -0000803280 00000 n -0000803467 00000 n -0000803655 00000 n -0000804327 00000 n -0000803840 00000 n -0001144337 00000 n -0000805951 00000 n -0000805230 00000 n -0000804512 00000 n -0000805712 00000 n -0000805891 00000 n -0000805386 00000 n -0000805558 00000 n -0001144304 00000 n -0000812799 00000 n -0000808402 00000 n -0000806063 00000 n -0000812442 00000 n -0000812621 00000 n -0000808738 00000 n -0000808910 00000 n -0000812679 00000 n -0000809064 00000 n -0000809218 00000 n -0000812739 00000 n -0000809372 00000 n -0000809560 00000 n -0000809714 00000 n -0000809901 00000 n -0000810054 00000 n -0000810241 00000 n -0000810394 00000 n -0000810581 00000 n -0000810734 00000 n -0000810921 00000 n -0000811074 00000 n -0000811262 00000 n -0000811416 00000 n -0000811604 00000 n -0000811758 00000 n -0000811946 00000 n -0000812100 00000 n -0000812288 00000 n -0001144271 00000 n -0000818487 00000 n -0000814666 00000 n -0000812925 00000 n -0000818367 00000 n -0000814984 00000 n -0000815172 00000 n -0000815325 00000 n -0000815513 00000 n -0000815667 00000 n -0000815855 00000 n -0000816009 00000 n -0000816197 00000 n -0000816351 00000 n -0000816539 00000 n -0000816692 00000 n -0000816880 00000 n -0000817034 00000 n -0000817188 00000 n -0000818427 00000 n -0000817342 00000 n -0000817530 00000 n -0000817717 00000 n -0000817871 00000 n -0000818025 00000 n -0000818213 00000 n -0000823484 00000 n -0000820376 00000 n -0000818600 00000 n -0000823005 00000 n -0000823184 00000 n -0000820640 00000 n -0000820812 00000 n -0000823244 00000 n -0000820966 00000 n -0000823304 00000 n -0000821120 00000 n -0000821308 00000 n -0000823364 00000 n -0000821462 00000 n -0000821650 00000 n -0000821838 00000 n -0000821991 00000 n -0000822178 00000 n -0000823424 00000 n -0000822331 00000 n -0000822518 00000 n -0000822671 00000 n -0000822855 00000 n -0001144238 00000 n -0000829047 00000 n -0000825411 00000 n -0000823610 00000 n -0000828688 00000 n -0000828748 00000 n -0000825702 00000 n -0000825890 00000 n -0000826044 00000 n -0000826231 00000 n -0000828808 00000 n -0000826384 00000 n -0000826572 00000 n -0000826726 00000 n -0000826914 00000 n -0000828867 00000 n -0000827068 00000 n -0000828927 00000 n -0000827256 00000 n -0000827444 00000 n -0000827598 00000 n -0000827785 00000 n -0000828987 00000 n -0000827938 00000 n -0000828126 00000 n -0000828313 00000 n -0000828501 00000 n -0001247284 00000 n -0000832875 00000 n -0000830657 00000 n -0000829147 00000 n -0000832576 00000 n -0000832755 00000 n -0000830885 00000 n -0000831056 00000 n -0000832815 00000 n -0000831210 00000 n -0000831398 00000 n -0000831552 00000 n -0000831740 00000 n -0000831893 00000 n -0000832080 00000 n -0000832234 00000 n -0000832422 00000 n -0001144205 00000 n -0000837054 00000 n -0000834616 00000 n -0000833014 00000 n -0000836695 00000 n -0000836874 00000 n -0000834853 00000 n -0000835024 00000 n -0000836934 00000 n -0000835178 00000 n -0000836994 00000 n -0000835331 00000 n -0000835519 00000 n -0000835673 00000 n -0000835861 00000 n -0000836014 00000 n -0000836200 00000 n -0000836353 00000 n -0000836541 00000 n -0001144172 00000 n -0000842363 00000 n -0000838821 00000 n -0000837193 00000 n -0000841584 00000 n -0000841763 00000 n -0000839085 00000 n -0000839256 00000 n -0000841823 00000 n -0000841883 00000 n -0000839410 00000 n -0000841943 00000 n -0000839597 00000 n -0000842003 00000 n -0000842063 00000 n -0000839784 00000 n -0000842123 00000 n -0000839971 00000 n -0000842183 00000 n -0000840158 00000 n -0000840345 00000 n -0000840533 00000 n -0000842243 00000 n -0000840686 00000 n -0000840873 00000 n -0000842303 00000 n -0000841061 00000 n -0000841213 00000 n -0000841398 00000 n -0001144139 00000 n -0000847170 00000 n -0000843974 00000 n -0000842488 00000 n -0000846511 00000 n -0000846690 00000 n -0000844229 00000 n -0000844400 00000 n -0000846750 00000 n -0000844554 00000 n -0000846810 00000 n -0000846870 00000 n -0000844708 00000 n -0000846930 00000 n -0000844895 00000 n -0000845081 00000 n -0000845268 00000 n -0000846990 00000 n -0000845420 00000 n -0000845607 00000 n -0000847050 00000 n -0000845795 00000 n -0000845949 00000 n -0000846136 00000 n -0000847110 00000 n -0000846324 00000 n -0001144106 00000 n -0000849252 00000 n -0000848278 00000 n -0000847295 00000 n -0000848954 00000 n -0000849133 00000 n -0000848443 00000 n -0000848614 00000 n -0000849193 00000 n -0000848768 00000 n -0001144073 00000 n -0000859732 00000 n -0000852338 00000 n -0000849378 00000 n -0000859373 00000 n -0000859552 00000 n -0000852800 00000 n -0000852975 00000 n -0000859612 00000 n -0000859672 00000 n -0000853129 00000 n -0000853316 00000 n -0000853504 00000 n -0000853692 00000 n -0000853879 00000 n -0000854066 00000 n -0000854254 00000 n -0000854441 00000 n -0000854629 00000 n -0000854817 00000 n -0000855005 00000 n -0000855191 00000 n -0000855379 00000 n -0000855567 00000 n -0000855755 00000 n -0000855943 00000 n -0000856130 00000 n -0000856318 00000 n -0000856506 00000 n -0000856694 00000 n -0000856882 00000 n -0000857070 00000 n -0000857258 00000 n -0000857412 00000 n -0000857600 00000 n -0000857787 00000 n -0000857939 00000 n -0000858127 00000 n -0000858280 00000 n -0000858468 00000 n -0000858656 00000 n -0000858810 00000 n -0000858998 00000 n -0000859186 00000 n -0001247409 00000 n -0001144040 00000 n -0000871562 00000 n -0000862895 00000 n -0000859857 00000 n -0000871382 00000 n -0000871442 00000 n -0000863420 00000 n -0000863608 00000 n -0000863796 00000 n -0000863984 00000 n -0000864172 00000 n -0000864360 00000 n -0000864548 00000 n -0000864736 00000 n -0000864924 00000 n -0000865110 00000 n -0000865298 00000 n -0000865486 00000 n -0000865673 00000 n -0000865860 00000 n -0000866048 00000 n -0000866202 00000 n -0000866390 00000 n -0000866577 00000 n -0000866765 00000 n -0000866919 00000 n -0000867106 00000 n -0000867294 00000 n -0000867480 00000 n -0000867668 00000 n -0000867856 00000 n -0000868042 00000 n -0000868228 00000 n -0000868416 00000 n -0000868604 00000 n -0000868791 00000 n -0000868978 00000 n -0000869165 00000 n -0000871502 00000 n -0000869353 00000 n -0000869541 00000 n -0000869729 00000 n -0000869917 00000 n -0000870104 00000 n -0000870291 00000 n -0000870478 00000 n -0000870632 00000 n -0000870820 00000 n -0000871008 00000 n -0000871196 00000 n -0000876957 00000 n -0000873160 00000 n -0000871675 00000 n -0000876897 00000 n -0000873469 00000 n -0000873657 00000 n -0000873844 00000 n -0000874030 00000 n -0000874218 00000 n -0000874406 00000 n -0000874594 00000 n -0000874782 00000 n -0000874936 00000 n -0000875124 00000 n -0000875278 00000 n -0000875466 00000 n -0000875654 00000 n -0000875842 00000 n -0000875996 00000 n -0000876184 00000 n -0000876338 00000 n -0000876525 00000 n -0000876711 00000 n -0000882116 00000 n -0000879146 00000 n -0000877070 00000 n -0000881757 00000 n -0000881936 00000 n -0000879410 00000 n -0000879586 00000 n -0000881996 00000 n -0000879740 00000 n -0000879894 00000 n -0000880048 00000 n -0000880202 00000 n -0000880356 00000 n -0000880510 00000 n -0000880664 00000 n -0000882056 00000 n -0000880818 00000 n -0000881006 00000 n -0000881193 00000 n -0000881381 00000 n -0000881569 00000 n -0001144007 00000 n -0000889059 00000 n -0000884735 00000 n -0000882242 00000 n -0000888999 00000 n -0000885062 00000 n -0000885250 00000 n -0000885438 00000 n -0000885625 00000 n -0000885813 00000 n -0000886001 00000 n -0000886189 00000 n -0000886377 00000 n -0000886565 00000 n -0000886752 00000 n -0000886939 00000 n -0000887127 00000 n -0000887315 00000 n -0000887503 00000 n -0000887691 00000 n -0000887878 00000 n -0000888066 00000 n -0000888254 00000 n -0000888440 00000 n -0000888625 00000 n -0000888813 00000 n -0000894940 00000 n -0000891399 00000 n -0000889172 00000 n -0000894880 00000 n -0000891690 00000 n -0000891878 00000 n -0000892065 00000 n -0000892253 00000 n -0000892441 00000 n -0000892629 00000 n -0000892815 00000 n -0000893003 00000 n -0000893191 00000 n -0000893379 00000 n -0000893567 00000 n -0000893755 00000 n -0000893943 00000 n -0000894131 00000 n -0000894319 00000 n -0000894507 00000 n -0000894694 00000 n -0000905215 00000 n -0000898128 00000 n -0000895040 00000 n -0000905155 00000 n -0000898581 00000 n -0000898769 00000 n -0000898957 00000 n -0000899145 00000 n -0000899333 00000 n -0000899521 00000 n -0000899709 00000 n -0000899897 00000 n -0000900085 00000 n -0000900273 00000 n -0000900461 00000 n -0000900649 00000 n -0000900837 00000 n -0000901025 00000 n -0000901212 00000 n -0000901399 00000 n -0000901587 00000 n -0000901775 00000 n -0000901963 00000 n -0000902150 00000 n -0000902338 00000 n -0000902526 00000 n -0000902714 00000 n -0000902902 00000 n -0000903090 00000 n -0000903278 00000 n -0000903466 00000 n -0000903654 00000 n -0000903842 00000 n -0000904029 00000 n -0000904216 00000 n -0000904404 00000 n -0000904592 00000 n -0000904780 00000 n -0000904968 00000 n -0001247534 00000 n -0000916718 00000 n -0000908411 00000 n -0000905315 00000 n -0000916539 00000 n -0000908918 00000 n -0000909106 00000 n -0000909294 00000 n -0000909479 00000 n -0000909667 00000 n -0000909855 00000 n -0000910043 00000 n -0000910229 00000 n -0000916599 00000 n -0000910416 00000 n -0000910602 00000 n -0000910789 00000 n -0000910976 00000 n -0000911164 00000 n -0000911352 00000 n -0000916659 00000 n -0000911540 00000 n -0000911728 00000 n -0000911916 00000 n -0000912104 00000 n -0000912292 00000 n -0000912480 00000 n -0000912668 00000 n -0000912856 00000 n -0000913010 00000 n -0000913198 00000 n -0000913385 00000 n -0000913573 00000 n -0000913760 00000 n -0000913914 00000 n -0000914101 00000 n -0000914289 00000 n -0000914475 00000 n -0000914663 00000 n -0000914851 00000 n -0000915039 00000 n -0000915227 00000 n -0000915415 00000 n -0000915603 00000 n -0000915791 00000 n -0000915979 00000 n -0000916165 00000 n -0000916352 00000 n -0000924609 00000 n -0000918814 00000 n -0000916831 00000 n -0000924490 00000 n -0000919213 00000 n -0000919401 00000 n -0000919589 00000 n -0000919777 00000 n -0000924550 00000 n -0000919965 00000 n -0000920152 00000 n -0000920339 00000 n -0000920527 00000 n -0000920715 00000 n -0000920902 00000 n -0000921056 00000 n -0000921244 00000 n -0000921398 00000 n -0000921586 00000 n -0000921774 00000 n -0000921962 00000 n -0000922116 00000 n -0000922304 00000 n -0000922458 00000 n -0000922645 00000 n -0000922799 00000 n -0000922987 00000 n -0000923175 00000 n -0000923363 00000 n -0000923551 00000 n -0000923739 00000 n -0000923927 00000 n -0000924115 00000 n -0000924303 00000 n -0000929222 00000 n -0000926275 00000 n -0000924722 00000 n -0000928923 00000 n -0000929102 00000 n -0000926530 00000 n -0000926705 00000 n -0000929162 00000 n -0000926859 00000 n -0000927047 00000 n -0000927235 00000 n -0000927423 00000 n -0000927611 00000 n -0000927799 00000 n -0000927987 00000 n -0000928173 00000 n -0000928360 00000 n -0000928547 00000 n -0000928735 00000 n -0001143974 00000 n -0000934249 00000 n -0000931241 00000 n -0000929361 00000 n -0000933890 00000 n -0000934069 00000 n -0000931496 00000 n -0000931671 00000 n -0000934129 00000 n -0000931825 00000 n -0000932013 00000 n -0000932201 00000 n -0000932389 00000 n -0000932576 00000 n -0000932763 00000 n -0000932951 00000 n -0000934189 00000 n -0000933139 00000 n -0000933327 00000 n -0000933514 00000 n -0000933702 00000 n -0001143941 00000 n -0000939640 00000 n -0000936382 00000 n -0000934388 00000 n -0000939161 00000 n -0000939340 00000 n -0000936646 00000 n -0000936822 00000 n -0000939400 00000 n -0000936976 00000 n -0000939460 00000 n -0000937129 00000 n -0000937317 00000 n -0000937505 00000 n -0000937692 00000 n -0000937879 00000 n -0000939520 00000 n -0000938067 00000 n -0000938255 00000 n -0000938443 00000 n -0000938631 00000 n -0000939580 00000 n -0000938819 00000 n -0000938973 00000 n -0001143908 00000 n -0000943949 00000 n -0000941922 00000 n -0000939766 00000 n -0000943590 00000 n -0000943769 00000 n -0000942132 00000 n -0000942308 00000 n -0000943829 00000 n -0000942462 00000 n -0000942650 00000 n -0000942838 00000 n -0000943889 00000 n -0000943026 00000 n -0000943214 00000 n -0000943402 00000 n -0001247659 00000 n -0001143875 00000 n -0000949125 00000 n -0000946253 00000 n -0000944075 00000 n -0000948945 00000 n -0000949005 00000 n -0000946508 00000 n -0000946695 00000 n -0000946882 00000 n -0000949065 00000 n -0000947069 00000 n -0000947256 00000 n -0000947444 00000 n -0000947632 00000 n -0000947820 00000 n -0000948008 00000 n -0000948195 00000 n -0000948383 00000 n -0000948570 00000 n -0000948757 00000 n -0000953857 00000 n -0000951258 00000 n -0000949225 00000 n -0000953559 00000 n -0000953619 00000 n -0000951495 00000 n -0000951683 00000 n -0000953679 00000 n -0000951871 00000 n -0000952059 00000 n -0000952247 00000 n -0000952434 00000 n -0000952622 00000 n -0000952810 00000 n -0000953738 00000 n -0000952997 00000 n -0000953798 00000 n -0000953184 00000 n -0000953371 00000 n -0000959076 00000 n -0000956133 00000 n -0000953970 00000 n -0000958777 00000 n -0000958956 00000 n -0000956388 00000 n -0000956560 00000 n -0000959016 00000 n -0000956714 00000 n -0000956901 00000 n -0000957089 00000 n -0000957277 00000 n -0000957464 00000 n -0000957652 00000 n -0000957839 00000 n -0000958027 00000 n -0000958215 00000 n -0000958403 00000 n -0000958591 00000 n -0001143842 00000 n -0000961219 00000 n -0000960855 00000 n -0000959202 00000 n -0000960981 00000 n -0000962850 00000 n -0000962664 00000 n -0000961305 00000 n -0000962790 00000 n -0000964556 00000 n -0000964370 00000 n -0000962936 00000 n -0000964496 00000 n -0001247784 00000 n -0000966194 00000 n -0000966008 00000 n -0000964642 00000 n -0000966134 00000 n -0000967886 00000 n -0000967700 00000 n -0000966280 00000 n -0000967826 00000 n -0000969209 00000 n -0000969023 00000 n -0000967972 00000 n -0000969149 00000 n -0000971692 00000 n -0000971387 00000 n -0000969295 00000 n -0000971513 00000 n -0000972414 00000 n -0000972228 00000 n -0000971778 00000 n -0000972354 00000 n -0000974136 00000 n -0000973831 00000 n -0000972500 00000 n -0000973957 00000 n -0001247909 00000 n -0000975279 00000 n -0000975093 00000 n -0000974222 00000 n -0000975219 00000 n -0000976945 00000 n -0000976640 00000 n -0000975365 00000 n -0000976766 00000 n -0000979103 00000 n -0000978798 00000 n -0000977031 00000 n -0000978924 00000 n -0000980492 00000 n -0000980306 00000 n -0000979189 00000 n -0000980432 00000 n -0000982321 00000 n -0000982016 00000 n -0000980578 00000 n -0000982142 00000 n -0000984791 00000 n -0000984486 00000 n -0000982407 00000 n -0000984612 00000 n -0001248034 00000 n -0000986506 00000 n -0000986320 00000 n -0000984877 00000 n -0000986446 00000 n -0000988451 00000 n -0000988265 00000 n -0000986592 00000 n -0000988391 00000 n -0000990511 00000 n -0000990325 00000 n -0000988537 00000 n -0000990451 00000 n -0000992619 00000 n -0000992433 00000 n -0000990597 00000 n -0000992559 00000 n -0000994371 00000 n -0000994185 00000 n -0000992705 00000 n -0000994311 00000 n -0000995987 00000 n -0000995801 00000 n -0000994457 00000 n -0000995927 00000 n -0001248159 00000 n -0000998548 00000 n -0000998243 00000 n -0000996073 00000 n -0000998369 00000 n -0000999473 00000 n -0000999287 00000 n -0000998634 00000 n -0000999413 00000 n -0001001969 00000 n -0001001664 00000 n -0000999559 00000 n -0001001790 00000 n -0001003303 00000 n -0001003117 00000 n -0001002055 00000 n -0001003243 00000 n -0001004638 00000 n -0001004452 00000 n -0001003389 00000 n -0001004578 00000 n -0001006320 00000 n -0001006134 00000 n -0001004724 00000 n -0001006260 00000 n -0001248284 00000 n -0001008728 00000 n -0001008423 00000 n -0001006406 00000 n -0001008549 00000 n -0001010000 00000 n -0001009814 00000 n -0001008814 00000 n -0001009940 00000 n -0001012371 00000 n -0001012066 00000 n -0001010086 00000 n -0001012192 00000 n -0001013919 00000 n -0001013733 00000 n -0001012457 00000 n -0001013859 00000 n -0001015477 00000 n -0001015291 00000 n -0001014005 00000 n -0001015417 00000 n -0001017054 00000 n -0001016868 00000 n -0001015563 00000 n -0001016994 00000 n -0001248409 00000 n -0001018427 00000 n -0001018241 00000 n -0001017140 00000 n -0001018367 00000 n -0001019413 00000 n -0001019227 00000 n -0001018513 00000 n -0001019353 00000 n -0001021742 00000 n -0001021437 00000 n -0001019499 00000 n -0001021563 00000 n -0001022711 00000 n -0001022525 00000 n -0001021828 00000 n -0001022651 00000 n -0001024986 00000 n -0001024681 00000 n -0001022797 00000 n -0001024807 00000 n -0001024867 00000 n -0001026872 00000 n -0001026686 00000 n -0001025072 00000 n -0001026812 00000 n -0001248534 00000 n -0001029355 00000 n -0001029050 00000 n -0001026958 00000 n -0001029176 00000 n -0001030732 00000 n -0001030546 00000 n -0001029441 00000 n -0001030672 00000 n -0001031924 00000 n -0001031738 00000 n -0001030818 00000 n -0001031864 00000 n -0001034369 00000 n -0001034064 00000 n -0001032010 00000 n -0001034190 00000 n -0001035744 00000 n -0001035558 00000 n -0001034455 00000 n -0001035684 00000 n -0001037470 00000 n -0001037284 00000 n -0001035830 00000 n -0001037410 00000 n -0001248659 00000 n -0001039234 00000 n -0001039048 00000 n -0001037556 00000 n -0001039174 00000 n -0001041143 00000 n -0001040957 00000 n -0001039320 00000 n -0001041083 00000 n -0001042688 00000 n -0001042502 00000 n -0001041229 00000 n -0001042628 00000 n -0001043907 00000 n -0001043721 00000 n -0001042774 00000 n -0001043847 00000 n -0001046259 00000 n -0001045954 00000 n -0001043993 00000 n -0001046080 00000 n -0001047833 00000 n -0001047647 00000 n -0001046345 00000 n -0001047773 00000 n -0001248784 00000 n -0001049827 00000 n -0001049641 00000 n -0001047919 00000 n -0001049767 00000 n -0001051065 00000 n -0001050879 00000 n -0001049913 00000 n -0001051005 00000 n -0001066356 00000 n -0001054834 00000 n -0001051151 00000 n -0001066296 00000 n -0001055593 00000 n -0001055748 00000 n -0001055903 00000 n -0001056058 00000 n -0001056214 00000 n -0001056370 00000 n -0001056526 00000 n -0001056682 00000 n -0001056838 00000 n -0001056994 00000 n -0001057150 00000 n -0001057306 00000 n -0001057462 00000 n -0001057618 00000 n -0001057774 00000 n -0001057929 00000 n -0001058084 00000 n -0001058238 00000 n -0001058393 00000 n -0001058548 00000 n -0001058703 00000 n -0001058858 00000 n -0001059013 00000 n -0001059167 00000 n -0001059323 00000 n -0001059479 00000 n -0001059634 00000 n -0001059789 00000 n -0001059942 00000 n -0001060097 00000 n -0001060250 00000 n -0001060406 00000 n -0001060561 00000 n -0001060717 00000 n -0001060873 00000 n -0001061029 00000 n -0001061185 00000 n -0001061341 00000 n -0001061497 00000 n -0001061652 00000 n -0001061807 00000 n -0001061963 00000 n -0001062119 00000 n -0001062274 00000 n -0001062430 00000 n -0001062585 00000 n -0001062741 00000 n -0001062896 00000 n -0001063051 00000 n -0001063205 00000 n -0001063359 00000 n -0001063514 00000 n -0001063669 00000 n -0001063823 00000 n -0001063978 00000 n -0001064133 00000 n -0001064287 00000 n -0001064440 00000 n -0001064594 00000 n -0001064748 00000 n -0001064902 00000 n -0001065056 00000 n -0001065210 00000 n -0001065365 00000 n -0001065520 00000 n -0001065676 00000 n -0001065832 00000 n -0001065987 00000 n -0001066143 00000 n -0001080323 00000 n -0001069648 00000 n -0001066442 00000 n -0001080263 00000 n -0001070362 00000 n -0001070516 00000 n -0001070670 00000 n -0001070822 00000 n -0001070976 00000 n -0001071130 00000 n -0001071283 00000 n -0001071437 00000 n -0001071591 00000 n -0001071744 00000 n -0001071898 00000 n -0001072053 00000 n -0001072206 00000 n -0001072362 00000 n -0001072517 00000 n -0001072672 00000 n -0001072826 00000 n -0001072981 00000 n -0001073136 00000 n -0001073291 00000 n -0001073446 00000 n -0001073601 00000 n -0001073756 00000 n -0001073910 00000 n -0001074065 00000 n -0001074219 00000 n -0001074374 00000 n -0001074529 00000 n -0001074683 00000 n -0001074838 00000 n -0001074993 00000 n -0001075147 00000 n -0001075302 00000 n -0001075457 00000 n -0001075610 00000 n -0001075765 00000 n -0001075918 00000 n -0001076073 00000 n -0001076228 00000 n -0001076383 00000 n -0001076539 00000 n -0001076695 00000 n -0001076851 00000 n -0001077007 00000 n -0001077163 00000 n -0001077317 00000 n -0001077469 00000 n -0001077623 00000 n -0001077777 00000 n -0001077931 00000 n -0001078086 00000 n -0001078240 00000 n -0001078395 00000 n -0001078550 00000 n -0001078705 00000 n -0001078861 00000 n -0001079017 00000 n -0001079173 00000 n -0001079329 00000 n -0001079485 00000 n -0001079641 00000 n -0001079797 00000 n -0001079953 00000 n -0001080108 00000 n -0001098160 00000 n -0001084698 00000 n -0001080409 00000 n -0001098100 00000 n -0001085565 00000 n -0001085721 00000 n -0001085876 00000 n -0001086031 00000 n -0001086187 00000 n -0001086343 00000 n -0001086498 00000 n -0001086653 00000 n -0001086808 00000 n -0001086963 00000 n -0001087118 00000 n -0001087273 00000 n -0001087428 00000 n -0001087582 00000 n -0001087734 00000 n -0001087887 00000 n -0001088041 00000 n -0001088196 00000 n -0001088351 00000 n -0001088506 00000 n -0001088661 00000 n -0001088816 00000 n -0001088971 00000 n -0001089126 00000 n -0001089279 00000 n -0001089434 00000 n -0001089589 00000 n -0001089744 00000 n -0001089899 00000 n -0001090051 00000 n -0001090206 00000 n -0001090361 00000 n -0001090516 00000 n -0001090671 00000 n -0001090826 00000 n -0001090980 00000 n -0001091135 00000 n -0001091289 00000 n -0001091444 00000 n -0001091599 00000 n -0001091753 00000 n -0001091907 00000 n -0001092060 00000 n -0001092214 00000 n -0001092368 00000 n -0001092523 00000 n -0001092677 00000 n -0001092833 00000 n -0001092989 00000 n -0001093145 00000 n -0001093301 00000 n -0001093457 00000 n -0001093611 00000 n -0001093767 00000 n -0001093923 00000 n -0001094079 00000 n -0001094235 00000 n -0001094390 00000 n -0001094545 00000 n -0001094701 00000 n -0001094857 00000 n -0001095012 00000 n -0001095166 00000 n -0001095321 00000 n -0001095476 00000 n -0001095628 00000 n -0001095783 00000 n -0001095937 00000 n -0001096091 00000 n -0001096245 00000 n -0001096400 00000 n -0001096554 00000 n -0001096708 00000 n -0001096863 00000 n -0001097018 00000 n -0001097172 00000 n -0001097327 00000 n -0001097482 00000 n -0001097636 00000 n -0001097790 00000 n -0001097945 00000 n -0001111329 00000 n -0001101169 00000 n -0001098246 00000 n -0001111269 00000 n -0001101856 00000 n -0001102010 00000 n -0001102166 00000 n -0001102321 00000 n -0001102476 00000 n -0001102628 00000 n -0001102782 00000 n -0001102937 00000 n -0001103090 00000 n -0001103245 00000 n -0001103401 00000 n -0001103556 00000 n -0001103710 00000 n -0001103865 00000 n -0001104020 00000 n -0001104173 00000 n -0001104329 00000 n -0001104484 00000 n -0001104639 00000 n -0001104793 00000 n -0001104946 00000 n -0001105099 00000 n -0001105251 00000 n -0001105404 00000 n -0001105557 00000 n -0001105709 00000 n -0001105862 00000 n -0001106015 00000 n -0001106167 00000 n -0001106320 00000 n -0001106475 00000 n -0001106629 00000 n -0001106783 00000 n -0001106938 00000 n -0001107092 00000 n -0001107247 00000 n -0001107402 00000 n -0001107557 00000 n -0001107712 00000 n -0001107867 00000 n -0001108022 00000 n -0001108177 00000 n -0001108332 00000 n -0001108488 00000 n -0001108643 00000 n -0001108796 00000 n -0001108951 00000 n -0001109106 00000 n -0001109260 00000 n -0001109415 00000 n -0001109570 00000 n -0001109724 00000 n -0001109879 00000 n -0001110034 00000 n -0001110188 00000 n -0001110342 00000 n -0001110497 00000 n -0001110652 00000 n -0001110807 00000 n -0001110962 00000 n -0001111116 00000 n -0001248909 00000 n -0001128122 00000 n -0001115160 00000 n -0001111415 00000 n -0001128062 00000 n -0001116000 00000 n -0001116155 00000 n -0001116310 00000 n -0001116463 00000 n -0001116618 00000 n -0001116774 00000 n -0001116929 00000 n -0001117083 00000 n -0001117238 00000 n -0001117393 00000 n -0001117548 00000 n -0001117702 00000 n -0001117857 00000 n -0001118012 00000 n -0001118166 00000 n -0001118321 00000 n -0001118476 00000 n -0001118630 00000 n -0001118785 00000 n -0001118941 00000 n -0001119095 00000 n -0001119249 00000 n -0001119404 00000 n -0001119559 00000 n -0001119713 00000 n -0001119867 00000 n -0001120022 00000 n -0001120176 00000 n -0001120332 00000 n -0001120487 00000 n -0001120641 00000 n -0001120796 00000 n -0001120951 00000 n -0001121106 00000 n -0001121258 00000 n -0001121413 00000 n -0001121567 00000 n -0001121722 00000 n -0001121877 00000 n -0001122032 00000 n -0001122185 00000 n -0001122340 00000 n -0001122495 00000 n -0001122650 00000 n -0001122805 00000 n -0001122960 00000 n -0001123113 00000 n -0001123268 00000 n -0001123423 00000 n -0001123578 00000 n -0001123732 00000 n -0001123886 00000 n -0001124039 00000 n -0001124194 00000 n -0001124349 00000 n -0001124504 00000 n -0001124659 00000 n -0001124813 00000 n -0001124968 00000 n -0001125123 00000 n -0001125277 00000 n -0001125432 00000 n -0001125586 00000 n -0001125741 00000 n -0001125896 00000 n -0001126051 00000 n -0001126206 00000 n -0001126360 00000 n -0001126514 00000 n -0001126669 00000 n -0001126824 00000 n -0001126979 00000 n -0001127134 00000 n -0001127289 00000 n -0001127444 00000 n -0001127599 00000 n -0001127754 00000 n -0001127909 00000 n -0001143756 00000 n -0001132089 00000 n -0001128208 00000 n -0001143696 00000 n -0001132857 00000 n -0001133011 00000 n -0001133166 00000 n -0001133321 00000 n -0001133474 00000 n -0001133629 00000 n -0001133783 00000 n -0001133937 00000 n -0001134092 00000 n -0001134247 00000 n -0001134402 00000 n -0001134557 00000 n -0001134710 00000 n -0001134865 00000 n -0001135020 00000 n -0001135175 00000 n -0001135329 00000 n -0001135483 00000 n -0001135637 00000 n -0001135792 00000 n -0001135947 00000 n -0001136101 00000 n -0001136256 00000 n -0001136411 00000 n -0001136566 00000 n -0001136719 00000 n -0001136874 00000 n -0001137028 00000 n -0001137183 00000 n -0001137337 00000 n -0001137492 00000 n -0001137647 00000 n -0001137802 00000 n -0001137957 00000 n -0001138110 00000 n -0001138264 00000 n -0001138418 00000 n -0001138573 00000 n -0001138728 00000 n -0001138882 00000 n -0001139036 00000 n -0001139190 00000 n -0001139344 00000 n -0001139498 00000 n -0001139653 00000 n -0001139808 00000 n -0001139964 00000 n -0001140118 00000 n -0001140273 00000 n -0001140427 00000 n -0001140583 00000 n -0001140739 00000 n -0001140894 00000 n -0001141050 00000 n -0001141204 00000 n -0001141360 00000 n -0001141514 00000 n -0001141670 00000 n -0001141825 00000 n -0001141981 00000 n -0001142137 00000 n -0001142293 00000 n -0001142449 00000 n -0001142605 00000 n -0001142761 00000 n -0001142917 00000 n -0001143073 00000 n -0001143229 00000 n -0001143385 00000 n -0001143540 00000 n -0001145459 00000 n -0001158368 00000 n -0001176406 00000 n -0001179043 00000 n -0001179012 00000 n -0001181580 00000 n -0001181334 00000 n -0001200247 00000 n -0001221781 00000 n -0001243077 00000 n -0001249007 00000 n -0001249128 00000 n -0001249254 00000 n -0001249380 00000 n -0001249506 00000 n -0001249632 00000 n -0001249758 00000 n -0001249884 00000 n -0001249973 00000 n -0001250100 00000 n -0001250190 00000 n -0001250264 00000 n -0001261136 00000 n -0001316039 00000 n -0001316080 00000 n -0001316120 00000 n -0001316254 00000 n -trailer -<< -/Size 5675 -/Root 5673 0 R -/Info 5674 0 R -/ID [ ] ->> -startxref -1316518 -%%EOF diff --git a/components/net/uip/lib/memb.c b/components/net/uip/lib/memb.c deleted file mode 100644 index 777b52f7bc..0000000000 --- a/components/net/uip/lib/memb.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2004, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels - * - * $Id: memb.c,v 1.1 2006/06/12 08:21:43 adam Exp $ - */ - -/** - * \addtogroup memb - * @{ - */ - - /** - * \file - * Memory block allocation routines. - * \author Adam Dunkels - */ -#include - -#include "memb.h" - -/*---------------------------------------------------------------------------*/ -void -memb_init(struct memb_blocks *m) -{ - memset(m->count, 0, m->num); - memset(m->mem, 0, m->size * m->num); -} -/*---------------------------------------------------------------------------*/ -void * -memb_alloc(struct memb_blocks *m) -{ - int i; - - for(i = 0; i < m->num; ++i) { - if(m->count[i] == 0) { - /* If this block was unused, we increase the reference count to - indicate that it now is used and return a pointer to the - memory block. */ - ++(m->count[i]); - return (void *)((char *)m->mem + (i * m->size)); - } - } - - /* No free block was found, so we return NULL to indicate failure to - allocate block. */ - return NULL; -} -/*---------------------------------------------------------------------------*/ -char -memb_free(struct memb_blocks *m, void *ptr) -{ - int i; - char *ptr2; - - /* Walk through the list of blocks and try to find the block to - which the pointer "ptr" points to. */ - ptr2 = (char *)m->mem; - for(i = 0; i < m->num; ++i) { - - if(ptr2 == (char *)ptr) { - /* We've found to block to which "ptr" points so we decrease the - reference count and return the new value of it. */ - if(m->count[i] > 0) { - /* Make sure that we don't deallocate free memory. */ - --(m->count[i]); - } - return m->count[i]; - } - ptr2 += m->size; - } - return -1; -} -/*---------------------------------------------------------------------------*/ - -/** @} */ diff --git a/components/net/uip/lib/memb.h b/components/net/uip/lib/memb.h deleted file mode 100644 index b725ebe108..0000000000 --- a/components/net/uip/lib/memb.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2004, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * Author: Adam Dunkels - * - * $Id: memb.h,v 1.1 2006/06/12 08:21:43 adam Exp $ - */ - -/** - * \defgroup memb Memory block management functions - * - * The memory block allocation routines provide a simple yet powerful - * set of functions for managing a set of memory blocks of fixed - * size. A set of memory blocks is statically declared with the - * MEMB() macro. Memory blocks are allocated from the declared - * memory by the memb_alloc() function, and are deallocated with the - * memb_free() function. - * - * \note Because of namespace clashes only one MEMB() can be - * declared per C module, and the name scope of a MEMB() memory - * block is local to each C module. - * - * The following example shows how to declare and use a memory block - * called "cmem" which has 8 chunks of memory with each memory chunk - * being 20 bytes large. - * - * @{ - */ - - -/** - * \file - * Memory block allocation routines. - * \author - * Adam Dunkels - * - */ - -#ifndef __MEMB_H__ -#define __MEMB_H__ - -/* - * Here we define a C preprocessing macro for concatenating to - * strings. We need use two macros in order to allow concatenation of - * two #defined macros. - */ -#define MEMB_CONCAT2(s1, s2) s1##s2 -#define MEMB_CONCAT(s1, s2) MEMB_CONCAT2(s1, s2) - -/** - * Declare a memory block. - * - * This macro is used to staticall declare a block of memory that can - * be used by the block allocation functions. The macro statically - * declares a C array with a size that matches the specified number of - * blocks and their individual sizes. - * - * Example: - \code -MEMB(connections, sizeof(struct connection), 16); - \endcode - * - * \param name The name of the memory block (later used with - * memb_init(), memb_alloc() and memb_free()). - * - * \param size The size of each memory chunk, in bytes. - * - * \param num The total number of memory chunks in the block. - * - */ -#define MEMB(name, structure, num) \ - static char MEMB_CONCAT(name,_memb_count)[num]; \ - static structure MEMB_CONCAT(name,_memb_mem)[num]; \ - static struct memb_blocks name = {sizeof(structure), num, \ - MEMB_CONCAT(name,_memb_count), \ - (void *)MEMB_CONCAT(name,_memb_mem)} - -struct memb_blocks { - unsigned short size; - unsigned short num; - char *count; - void *mem; -}; - -/** - * Initialize a memory block that was declared with MEMB(). - * - * \param m A memory block previosly declared with MEMB(). - */ -void memb_init(struct memb_blocks *m); - -/** - * Allocate a memory block from a block of memory declared with MEMB(). - * - * \param m A memory block previosly declared with MEMB(). - */ -void *memb_alloc(struct memb_blocks *m); - -/** - * Deallocate a memory block from a memory block previously declared - * with MEMB(). - * - * \param m m A memory block previosly declared with MEMB(). - * - * \param ptr A pointer to the memory block that is to be deallocated. - * - * \return The new reference count for the memory block (should be 0 - * if successfully deallocated) or -1 if the pointer "ptr" did not - * point to a legal memory block. - */ -char memb_free(struct memb_blocks *m, void *ptr); - -/** @} */ - -#endif /* __MEMB_H__ */ diff --git a/components/net/uip/rt-thread/clock-arch.c b/components/net/uip/rt-thread/clock-arch.c deleted file mode 100644 index fa2cade08b..0000000000 --- a/components/net/uip/rt-thread/clock-arch.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $ - */ - -/** - * \file - * Implementation of architecture-specific clock functionality - * \author - * Adam Dunkels - */ - -#include "clock-arch.h" -#include "stm32f10x.h" - -/*---------------------------------------------------------------------------*/ -clock_time_t -clock_time(void) -{ - return (rt_tick_get()); -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/rt-thread/clock-arch.h b/components/net/uip/rt-thread/clock-arch.h deleted file mode 100644 index 3c8978f3bb..0000000000 --- a/components/net/uip/rt-thread/clock-arch.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $ - */ - -#ifndef __CLOCK_ARCH_H__ -#define __CLOCK_ARCH_H__ - -typedef int clock_time_t; -#define CLOCK_CONF_SECOND 100 - -#endif /* __CLOCK_ARCH_H__ */ diff --git a/components/net/uip/rt-thread/readme.txt b/components/net/uip/rt-thread/readme.txt deleted file mode 100644 index 4be911e853..0000000000 --- a/components/net/uip/rt-thread/readme.txt +++ /dev/null @@ -1,12 +0,0 @@ -/************************************ -*** -*** -**** -******/ - - - -2010-11-21 -ÒÔÌ«ÍøÖеÄÊý¾ÝÀ´²»¼°´¦Àí¾Í»áÔì³É¶ÏÍøÎÊÌ⣿ -2010-11-21 -·¢ÏÖÒ»¸öÎÊÌ⣺HELLO WORLDÖв»¶ÏÁ¬½Ó£¬¶Ï¿ª¶à´ÎÖ®ºóÖ®ºóÔÙÒ²²»ÄÜÁ¬½Ó£¡£¡ \ No newline at end of file diff --git a/components/net/uip/rt-thread/uIPmain.c b/components/net/uip/rt-thread/uIPmain.c deleted file mode 100644 index 9d86f036fb..0000000000 --- a/components/net/uip/rt-thread/uIPmain.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Adam Dunkels. - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: main.c,v 1.16 2006/06/11 21:55:03 adam Exp $ - * - */ -#include "uip.h" -#include "uip_arp.h" -#include "stm32_eth.h" -#include "rtconfig.h" -#include "rtdef.h" -#include "uip_timer.h" -#include "rtthread.h" - - - - - -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) -// Define Prototypes -void TransmitPacket(void) -{ - int i; - u8_t data[1500]; - // Copy the header portion part - for(i=0; i < (UIP_LLH_LEN + 40); ++i) - { - data[i] = uip_buf[i]; - } - // Copy the data portion part - for(; i < uip_len; ++i) - { - data[i] = uip_appdata[i - UIP_LLH_LEN - 40 ]; - } - ETH_HandleTxPkt(data,uip_len); -} -void uip_tcpip_thread(void *parameter) -{ - int i; - static u8_t cnt; - while(1) - { - rt_thread_delay(CLOCK_SECOND*5); - for (i = 0; i < UIP_CONNS; i++) - { - uip_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if (uip_len > 0) - { - uip_arp_out(); - TransmitPacket(); - } - } -#if UIP_UDP - for (i = 0; i < UIP_UDP_CONNS; i++) - { - uip_udp_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if (uip_len > 0) - { - uip_arp_out(); - TransmitPacket(); - } - } -#endif /* UIP_UDP */ - /* Call the ARP timer function every 10 seconds. */ - if (++cnt > 2) uip_arp_timer(); - } -} - -rt_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio) -{ - rt_thread_t t; - t = rt_thread_create(name, thread, arg, stacksize, prio, 20); - RT_ASSERT(t != RT_NULL); - rt_thread_startup(t); - return t; -} - - -void uip_sys_init(void) -{ - - uip_init(); //uip init - sys_thread_new("uip",uip_tcpip_thread, RT_NULL, RT_LWIP_TCPTHREAD_STACKSIZE, RT_LWIP_TCPTHREAD_PRIORITY); - hello_world_init(); // -} - -/*---------------------------------------------------------------------------*/ -void uip_log(char *m) -{ - rt_kprintf("uIP log message: %s\n", m); -} diff --git a/components/net/uip/rt-thread/uip-conf.h b/components/net/uip/rt-thread/uip-conf.h deleted file mode 100644 index bb14c5389a..0000000000 --- a/components/net/uip/rt-thread/uip-conf.h +++ /dev/null @@ -1,167 +0,0 @@ -/** - * \addtogroup uipopt - * @{ - */ - -/** - * \name Project-specific configuration options - * @{ - * - * uIP has a number of configuration options that can be overridden - * for each project. These are kept in a project-specific uip-conf.h - * file and all configuration names have the prefix UIP_CONF. - */ - -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $ - */ - -/** - * \file - * An example uIP configuration file - * \author - * Adam Dunkels - */ - -#ifndef __UIP_CONF_H__ -#define __UIP_CONF_H__ - -#include - -/** - * 8 bit datatype - * - * This typedef defines the 8-bit type used throughout uIP. - * - * \hideinitializer - */ -typedef uint8_t u8_t; - -/** - * 16 bit datatype - * - * This typedef defines the 16-bit type used throughout uIP. - * - * \hideinitializer - */ -typedef uint16_t u16_t; - -/** - * Statistics datatype - * - * This typedef defines the dataype used for keeping statistics in - * uIP. - * - * \hideinitializer - */ -typedef unsigned short uip_stats_t; - -/** - * Maximum number of TCP connections. - * - * \hideinitializer - */ -#define UIP_CONF_MAX_CONNECTIONS 20 - -/** - * Maximum number of listening TCP ports. - * - * \hideinitializer - */ -#define UIP_CONF_MAX_LISTENPORTS 40 - -/** - * uIP buffer size. - * - * \hideinitializer - */ -#define UIP_CONF_BUFFER_SIZE 420 - -/** - * CPU byte order. - * - * \hideinitializer - */ -#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN - -/** - * Logging on or off - * - * \hideinitializer - */ -#define UIP_CONF_LOGGING 1 - -/** - * UDP support on or off - * - * \hideinitializer - */ -#define UIP_CONF_UDP 0 - -/** - * UDP checksums on or off - * - * \hideinitializer - */ -#define UIP_CONF_UDP_CHECKSUMS 1 - -/** - * uIP statistics on or off - * - * \hideinitializer - */ -#define UIP_CONF_STATISTICS 1 - -/* Here we include the header file for the application(s) we use in - our project. */ -/* #include "smtp.h" */ -#include "hello-world.h" -//#include "telnetd.h" -/* #include "webserver.h" */ -/* #include "dhcpc.h" */ -/* #include "resolv.h" */ -/* #include "webclient.h" */ - -#define UIP_ARCH_ADD32 0 - -#define UIP_ETHADDR0 0x00 -#define UIP_ETHADDR1 0x33 -#define UIP_ETHADDR2 0x44 -#define UIP_ETHADDR3 0x55 -#define UIP_ETHADDR4 0x66 -#define UIP_ETHADDR5 0x77 -#include - -#endif /* __UIP_CONF_H__ */ - -/** @} */ -/** @} */ diff --git a/components/net/uip/rt-thread/uip_addr.h b/components/net/uip/rt-thread/uip_addr.h deleted file mode 100644 index 60101f7c93..0000000000 --- a/components/net/uip/rt-thread/uip_addr.h +++ /dev/null @@ -1,8 +0,0 @@ - -#include "rtdef.h" - - - -struct ip_addr { - rt_uint16_t uip_ip4addr_t[2]; -} ; \ No newline at end of file diff --git a/components/net/uip/rt-thread/uip_arch.c b/components/net/uip/rt-thread/uip_arch.c deleted file mode 100644 index 69a13aa1d3..0000000000 --- a/components/net/uip/rt-thread/uip_arch.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: uip_arch.c,v 1.2.2.1 2003/10/04 22:54:17 adam Exp $ - * - */ - - -#include "uip.h" -#include "uip_arch.h" - -#define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) -#define IP_PROTO_TCP 6 - -/*-----------------------------------------------------------------------------------*/ -void uip_add32(u8_t *op32, u16_t op16) -{ - - uip_acc32[3] = op32[3] + (op16 & 0xff); - uip_acc32[2] = op32[2] + (op16 >> 8); - uip_acc32[1] = op32[1]; - uip_acc32[0] = op32[0]; - - if(uip_acc32[2] < (op16 >> 8)) { - ++uip_acc32[1]; - if(uip_acc32[1] == 0) { - ++uip_acc32[0]; - } - } - - - if(uip_acc32[3] < (op16 & 0xff)) { - ++uip_acc32[2]; - if(uip_acc32[2] == 0) { - ++uip_acc32[1]; - if(uip_acc32[1] == 0) { - ++uip_acc32[0]; - } - } - } -} -/*-----------------------------------------------------------------------------------*/ -u16_t uip_chksum(u16_t *sdata, u16_t len) -{ - u16_t acc; - - for (acc = 0; len > 1; len -= 2) { - u16_t u = ((unsigned char *)sdata)[0] + (((unsigned char *)sdata)[1] << 8); - if ((acc += u) < u) { - /* Overflow, so we add the carry to acc (i.e., increase by - one). */ - ++acc; - } - ++sdata; - } - - /* add up any odd byte */ - if(len == 1) { - acc += htons(((u16_t)(*(u8_t *)sdata)) << 8); - if(acc < htons(((u16_t)(*(u8_t *)sdata)) << 8)) { - ++acc; - } - } - - return acc; -} -/*-----------------------------------------------------------------------------------*/ -u16_t uip_ipchksum(void) -{ - return uip_chksum((u16_t *)&uip_buf[UIP_LLH_LEN], 20); -} -/*-----------------------------------------------------------------------------------*/ -u16_t uip_tcpchksum(void) -{ - u16_t hsum, sum; - - - /* Compute the checksum of the TCP header. */ - hsum = uip_chksum((u16_t *)&uip_buf[20 + UIP_LLH_LEN], 20); - - /* Compute the checksum of the data in the TCP packet and add it to - the TCP header checksum. */ - sum = uip_chksum((u16_t *)uip_appdata, - (u16_t)(((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 40))); - - if((sum += hsum) < hsum) { - ++sum; - } - - if((sum += BUF->srcipaddr[0]) < BUF->srcipaddr[0]) { - ++sum; - } - if((sum += BUF->srcipaddr[1]) < BUF->srcipaddr[1]) { - ++sum; - } - if((sum += BUF->destipaddr[0]) < BUF->destipaddr[0]) { - ++sum; - } - if((sum += BUF->destipaddr[1]) < BUF->destipaddr[1]) { - ++sum; - } - - if((sum += (u16_t)htons((u16_t)IP_PROTO_TCP)) < (u16_t)htons((u16_t)IP_PROTO_TCP)) { - ++sum; - } - - hsum = (u16_t)htons((((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - 20); - - if((sum += hsum) < hsum) { - ++sum; - } - - return sum; -} - - diff --git a/components/net/uip/rt-thread/uip_eth.h b/components/net/uip/rt-thread/uip_eth.h deleted file mode 100644 index 1ca7800eb8..0000000000 --- a/components/net/uip/rt-thread/uip_eth.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __NETIF_ETHERNETIF_H__ -#define __NETIF_ETHERNETIF_H__ - -//#include "lwip/netif.h" -#include - -#define NIOCTL_GADDR 0x01 -#define ETHERNET_MTU 1500 -struct pbuf -{ - rt_uint16_t len; -}; - -struct eth_device -{ - /* inherit from rt_device */ - struct rt_device parent; - - //struct eth_addr *ethaddr; - //struct netif *netif; - struct rt_semaphore tx_ack; - struct rt_semaphore tx_msg; - - /* eth device interface */ - struct pbuf* (*eth_rx)(rt_device_t dev); - rt_err_t (*eth_tx)(rt_device_t dev, struct pbuf* p); -}; - -rt_err_t eth_device_ready(struct eth_device* dev); - -rt_err_t eth_device_init(struct eth_device* dev, const char* name); - -rt_err_t eth_system_device_init(void); - -#endif /* __NETIF_ETHERNETIF_H__ */ diff --git a/components/net/uip/rt-thread/uip_etharp.c b/components/net/uip/rt-thread/uip_etharp.c deleted file mode 100644 index 61e30fc6d0..0000000000 --- a/components/net/uip/rt-thread/uip_etharp.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "uip_pbuf.h" -#include "uip-conf.h" -#include "rtdef.h" -#include "uip.h" -#include "uip_arp.h" -#include "uip_netif.h" - -extern u16_t uip_len, uip_slen; -void -etharp_ip_input(struct netif *netif, struct pbuf *p) -{ - u8_t *ptr; - int i; - ptr = p->payload; - uip_len = p->len; - for (i=0;ilen;i++) uip_buf[i] = ptr[i]; - uip_arp_ipin(); - uip_input(); - return; -} -void -etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p) -{ - u8_t *ptr,*pdata; - //struct pbuf *q; - int i; - ptr = p->payload; - uip_len = p->len; - for (i=0;ilen;i++) uip_buf[i] = ptr[i]; - uip_arp_arpin(); //update arp table uip_arp_arpin - if (uip_len) - { - if (( pdata =(u8_t*)rt_malloc(1500*sizeof(u8_t))) ==RT_NULL) - { - pbuf_free(p); - return; - } - for (i=0; i < (UIP_LLH_LEN + 40); ++i) - { - pdata[i] = uip_buf[i]; - } - for (; i < uip_len; ++i) - { - pdata[i] = uip_appdata[i - UIP_LLH_LEN - 40 ]; - } - //q = p; - p ->payload = pdata; - p->len = uip_len; - netif->linkoutput(netif,p); - rt_free(pdata); - pbuf_free(p); - // pbuf_free(q); - return ; - - // return 0; //ERR_OK - } - pbuf_free(p); -} \ No newline at end of file diff --git a/components/net/uip/rt-thread/uip_etharp.h b/components/net/uip/rt-thread/uip_etharp.h deleted file mode 100644 index 758dc4b62f..0000000000 --- a/components/net/uip/rt-thread/uip_etharp.h +++ /dev/null @@ -1,15 +0,0 @@ -#include "uip_pbuf.h" -#include "uip-conf.h" -#include "rtdef.h" - - -struct eth_hdr { - u8_t ip_addrdest[6]; - u8_t ip_addrsrc[6]; - u16_t type; -} ; -#define ETHTYPE_ARP UIP_ETHTYPE_ARP -#define ETHTYPE_IP UIP_ETHTYPE_IP -#define ETHTYPE_VLAN 0x8100 -#define ETHTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */ -#define ETHTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ diff --git a/components/net/uip/rt-thread/uip_ethernetif.c b/components/net/uip/rt-thread/uip_ethernetif.c deleted file mode 100644 index 4fef184f4a..0000000000 --- a/components/net/uip/rt-thread/uip_ethernetif.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * File : ethernetif.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2010, RT-Thread Development Team - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE - * - * Change Logs: - * Date Author Notes - * 2010-07-07 Bernard fix ethernetif_linkoutput send mail issue. - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -#include -#include "uip.h" -#include "uip_arp.h" -#include "uip_netif.h" -#include "uip_ethernetif.h" -#include "uip_ipaddr.h" - -#ifndef NULL -#define NULL (void *)0 -#endif /* NULL */ - -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) -extern u16_t uip_len, uip_slen; - -/* eth rx/tx thread */ -static struct rt_mailbox eth_rx_thread_mb; -static struct rt_thread eth_rx_thread; -#ifndef RT_LWIP_ETHTHREAD_PRIORITY -#define RT_ETHERNETIF_THREAD_PREORITY 0x90 -static char eth_rx_thread_mb_pool[48 * sizeof(rt_ubase_t)]; -static char eth_rx_thread_stack[1024]; -#else -#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY -static char eth_rx_thread_mb_pool[RT_LWIP_ETHTHREAD_MBOX_SIZE * sizeof(rt_ubase_t)]; -static char eth_rx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE]; -#endif - -struct eth_tx_msg -{ - struct netif *netif; - struct pbuf *buf; -}; -static struct rt_mailbox eth_tx_thread_mb; -static struct rt_thread eth_tx_thread; -#ifndef RT_LWIP_ETHTHREAD_PRIORITY -static char eth_tx_thread_mb_pool[32 * sizeof(rt_ubase_t)]; -static char eth_tx_thread_stack[512]; -#else -static char eth_tx_thread_mb_pool[RT_LWIP_ETHTHREAD_MBOX_SIZE * sizeof(rt_ubase_t)]; -static char eth_tx_thread_stack[RT_LWIP_ETHTHREAD_STACKSIZE]; -#endif - -/* the interface provided to uIP */ -err_t eth_init(struct netif *netif) -{ - return 0; -} -extern err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p); - -err_t eth_input(struct pbuf *p,struct netif *inp) -{ - - struct eth_hdr *ethhdr; - - if(p != RT_NULL) - { -#ifdef LINK_STATS - //LINK_STATS_INC(link.recv); -#endif LINK_STATS - - ethhdr = p->payload; - - switch(uip_htons(ethhdr->type)) - { - case ETHTYPE_IP: //ETHTYPE_IP - etharp_ip_input(inp, p); - pbuf_header(p, -((rt_int16_t)sizeof(struct eth_hdr))); - if (tcpip_input(p, inp) != ERR_OK) - { - // discard packet - pbuf_free(p); - } - break; - - case ETHTYPE_ARP: - etharp_arp_input(inp, (struct eth_addr *)inp->hwaddr, p); - break; - - default: - pbuf_free(p); - p = RT_NULL; - break; - } - } - return ERR_OK; -} - -err_t ethernetif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) -{ - return etharp_output(netif, p, ipaddr); -} - -err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p) -{ - struct eth_tx_msg msg; - struct eth_device* enetif; - - enetif = (struct eth_device*)netif->state; - - /* send a message to eth tx thread */ - msg.netif = netif; - msg.buf = p; - if (rt_mb_send(ð_tx_thread_mb, (rt_uint32_t) &msg) == RT_EOK) - { - /* waiting for ack */ - rt_sem_take(&(enetif->tx_ack), RT_WAITING_FOREVER); - } - - return ERR_OK; -} -/* ethernetif APIs */ -rt_err_t eth_device_init(struct eth_device* dev, const char* name) -{ - struct netif* netif; - uip_ipaddr_t ipaddr; - netif = (struct netif*) rt_malloc (sizeof(struct netif)); - if (netif == RT_NULL) - { - rt_kprintf("malloc netif failed\n"); - return -RT_ERROR; - } - rt_memset(netif, 0, sizeof(struct netif)); - - /* set netif */ - dev->netif = netif; - /* register to rt-thread device manager */ - rt_device_register(&(dev->parent), name, RT_DEVICE_FLAG_RDWR); - dev->parent.type = RT_Device_Class_NetIf; - rt_sem_init(&(dev->tx_ack), name, 0, RT_IPC_FLAG_FIFO); - - /* set name */ - netif->name[0] = name[0]; - netif->name[1] = name[1]; - - /* set hw address to 6 */ - netif->hwaddr_len = 6; - /* maximum transfer unit */ - netif->mtu = ETHERNET_MTU; - /* broadcast capability */ - netif->flags = NETIF_FLAG_BROADCAST; - -#if LWIP_IGMP - /* igmp support */ - netif->flags |= NETIF_FLAG_IGMP; -#endif - - /* get hardware address */ - rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr); - - /* set output */ - netif->output = ethernetif_output; - netif->linkoutput = ethernetif_linkoutput; - - /* add netif to lwip */ - - if (netif_add(netif, IP_ADDR_ANY, IP_ADDR_BROADCAST, IP_ADDR_ANY, dev, - eth_init, eth_input) == RT_NULL) - { - /* failed, unregister device and free netif */ - rt_device_unregister(&(dev->parent)); - rt_free(netif); - return -RT_ERROR; - } - - netif_set_default(netif); - return RT_EOK; -} - -/* ethernet buffer */ -void eth_tx_thread_entry(void* parameter) -{ - struct eth_tx_msg* msg; - - while (1) - { - if (rt_mb_recv(ð_tx_thread_mb, (rt_uint32_t*)&msg, RT_WAITING_FOREVER) == RT_EOK) - { - struct eth_device* enetif; - - RT_ASSERT(msg->netif != RT_NULL); - RT_ASSERT(msg->buf != RT_NULL); - - enetif = (struct eth_device*)msg->netif->state; - if (enetif != RT_NULL) - { - /* call driver's interface */ - if (enetif->eth_tx(&(enetif->parent), msg->buf) != RT_EOK) - { - rt_kprintf("transmit eth packet failed\n"); - } - } - - /* send ack */ - rt_sem_release(&(enetif->tx_ack)); - } - } -} - -/* ethernet buffer */ -void eth_rx_thread_entry(void* parameter) -{ - struct eth_device* device; - - while (1) - { - if (rt_mb_recv(ð_rx_thread_mb, (rt_uint32_t*)&device, RT_WAITING_FOREVER) == RT_EOK) - { - struct pbuf *p; - - /* receive all of buffer */ - while (1) - { - p = device->eth_rx(&(device->parent)); - if (p != RT_NULL) - { - /* notify to upper layer */ - eth_input(p, device->netif); - } - else break; - } - } - } -} - -rt_err_t eth_device_ready(struct eth_device* dev) -{ - /* post message to ethernet thread */ - return rt_mb_send(ð_rx_thread_mb, (rt_uint32_t)dev); -} - -rt_err_t eth_system_device_init() -{ - rt_err_t result = RT_EOK; - - /* init rx thread */ - /* init mailbox and create ethernet thread */ - result = rt_mb_init(ð_rx_thread_mb, "erxmb", - ð_rx_thread_mb_pool[0], sizeof(eth_rx_thread_mb_pool)/sizeof(rt_ubase_t), - RT_IPC_FLAG_FIFO); - RT_ASSERT(result == RT_EOK); - - result = rt_thread_init(ð_rx_thread, "erx", eth_rx_thread_entry, RT_NULL, - ð_rx_thread_stack[0], sizeof(eth_rx_thread_stack), - RT_ETHERNETIF_THREAD_PREORITY, 16); - RT_ASSERT(result == RT_EOK); - - result = rt_thread_startup(ð_rx_thread); - RT_ASSERT(result == RT_EOK); - - /* init tx thread */ - /* init mailbox and create ethernet thread */ - - result = rt_mb_init(ð_tx_thread_mb, "etxmb", - ð_tx_thread_mb_pool[0], sizeof(eth_tx_thread_mb_pool)/sizeof(rt_ubase_t), - RT_IPC_FLAG_FIFO); - RT_ASSERT(result == RT_EOK); - - result = rt_thread_init(ð_tx_thread, "etx", eth_tx_thread_entry, RT_NULL, - ð_tx_thread_stack[0], sizeof(eth_tx_thread_stack), - RT_ETHERNETIF_THREAD_PREORITY, 16); - RT_ASSERT(result == RT_EOK); - - result = rt_thread_startup(ð_tx_thread); - RT_ASSERT(result == RT_EOK); - - return result; -} diff --git a/components/net/uip/rt-thread/uip_ethernetif.h b/components/net/uip/rt-thread/uip_ethernetif.h deleted file mode 100644 index 31a22e4eb9..0000000000 --- a/components/net/uip/rt-thread/uip_ethernetif.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __NETIF_ETHERNETIF_H__ -#define __NETIF_ETHERNETIF_H__ - -//#include "lwip/netif.h" -#include "uip_netif.h" -#include - -#define NIOCTL_GADDR 0x01 -#define ETHERNET_MTU 1500 - -struct eth_device -{ - /* inherit from rt_device */ - struct rt_device parent; - - struct eth_addr *ethaddr; - struct netif *netif; - struct rt_semaphore tx_ack; - - /* eth device interface */ - struct pbuf* (*eth_rx)(rt_device_t dev); - rt_err_t (*eth_tx)(rt_device_t dev, struct pbuf* p); -}; - -rt_err_t eth_device_ready(struct eth_device* dev); - -rt_err_t eth_device_init(struct eth_device* dev, const char* name); - -rt_err_t eth_system_device_init(void); - -#endif /* __NETIF_ETHERNETIF_H__ */ diff --git a/components/net/uip/rt-thread/uip_ipaddr.h b/components/net/uip/rt-thread/uip_ipaddr.h deleted file mode 100644 index 98e2adf5da..0000000000 --- a/components/net/uip/rt-thread/uip_ipaddr.h +++ /dev/null @@ -1,20 +0,0 @@ - -#include "rtdef.h" - - - - - - -/* ethernetif APIs */ -#define IP_ADDR_ANY_VALUE 0x00000000UL -#define IP_ADDR_BROADCAST_VALUE 0xffffffffUL - -//extern const struct ip_addr ip_addr_any; -//extern const struct ip_addr ip_addr_broadcast; - -/** IP_ADDR_ can be used as a fixed IP address - * for the wildcard and the broadcast address - */ -#define IP_ADDR_ANY ((struct ip_addr *)0) -#define IP_ADDR_BROADCAST ((struct ip_addr *)0) \ No newline at end of file diff --git a/components/net/uip/rt-thread/uip_netif.c b/components/net/uip/rt-thread/uip_netif.c deleted file mode 100644 index ce1d20dcf1..0000000000 --- a/components/net/uip/rt-thread/uip_netif.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "rtdef.h" -#include "uip-conf.h" -#include "uip.h" -#include "uip_netif.h" -#include "uip_arp.h" -#include "rtconfig.h" -#include "uip_pbuf.h" - -void netif_set_default(struct netif *netif) -{ - -} -void netif_set_addr(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, - struct ip_addr *gw) -{ - uip_ipaddr_t hipaddr; - uip_ipaddr(hipaddr, RT_LWIP_IPADDR0,RT_LWIP_IPADDR1,RT_LWIP_IPADDR2,RT_LWIP_IPADDR3); - uip_sethostaddr(hipaddr); - uip_ipaddr(hipaddr, RT_LWIP_GWADDR0,RT_LWIP_GWADDR1,RT_LWIP_GWADDR2,RT_LWIP_GWADDR3); - uip_setdraddr(hipaddr); - uip_ipaddr(hipaddr, RT_LWIP_MSKADDR0,RT_LWIP_MSKADDR1,RT_LWIP_MSKADDR2,RT_LWIP_MSKADDR3); - uip_setnetmask(hipaddr); - return ; -} - -struct netif * -netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, - struct ip_addr *gw, - void *state, - err_t (* init)(struct netif *netif), - err_t (* input)(struct pbuf *p, struct netif *netif)) -{ - //if (netif_add(netif, IP_ADDR_ANY, IP_ADDR_BROADCAST, IP_ADDR_ANY, dev, - //eth_init, eth_input) == RT_NULL) - // netif->uip_hostaddr = ipaddr; - //netif->uip_draddr = netmask; - // netif->uip_netmask = gw; - // netif_set_addr(netif,ipaddr,netmask,gw); - - // call user specified initialization function for netif - if (init(netif) != 0) { - return RT_NULL; - } - netif->input = input; - netif->state = state; - netif_set_addr(netif,ipaddr,netmask,gw); - return netif; - -} -err_t etharp_output(struct netif *netif, struct pbuf *q, struct ip_addr *ipaddr) -{ - return 0; -} diff --git a/components/net/uip/rt-thread/uip_netif.h b/components/net/uip/rt-thread/uip_netif.h deleted file mode 100644 index e5e335330e..0000000000 --- a/components/net/uip/rt-thread/uip_netif.h +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_NETIF_H__ -#define __LWIP_NETIF_H__ - -//#include "lwip/opt.h" - -#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF) - -#include "lwip/err.h" - -#include "uip_ipaddr.h" - -//#include "lwip/inet.h" -//#include "lwip/pbuf.h" -#include "uip_pbuf.h" -#include "uip-conf.h" - -#if LWIP_DHCP -struct dhcp; -#endif -#if LWIP_AUTOIP -struct autoip; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses are expected to be in - * the same byte order as in IP_PCB. */ - -/** must be the maximum of all used hardware address lengths - across all types of interfaces in use */ -#define NETIF_MAX_HWADDR_LEN 6U - -/** TODO: define the use (where, when, whom) of netif flags */ - -/** whether the network interface is 'up'. this is - * a software flag used to control whether this network - * interface is enabled and processes traffic. - */ -#define NETIF_FLAG_UP 0x01U -/** if set, the netif has broadcast capability */ -#define NETIF_FLAG_BROADCAST 0x02U -/** if set, the netif is one end of a point-to-point connection */ -#define NETIF_FLAG_POINTTOPOINT 0x04U -/** if set, the interface is configured using DHCP */ -#define NETIF_FLAG_DHCP 0x08U -/** if set, the interface has an active link - * (set by the network interface driver) */ -#define NETIF_FLAG_LINK_UP 0x10U -/** if set, the netif is an device using ARP */ -#define NETIF_FLAG_ETHARP 0x20U -/** if set, the netif has IGMP capability */ -#define NETIF_FLAG_IGMP 0x40U - -/** Generic data structure used for all lwIP network interfaces. - * The following fields should be filled in by the initialization - * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */ -struct ip_addr { - rt_uint16_t uip_ip4addr_t[2]; -} ; - -struct netif { - /** pointer to next in linked list */ - struct netif *next; - - /** IP address configuration in network byte order */ - struct ip_addr ip_addr; - struct ip_addr netmask; - struct ip_addr gw; - - /** This function is called by the network device driver - * to pass a packet up the TCP/IP stack. */ - err_t (* input)(struct pbuf *p, struct netif *inp); - /** This function is called by the IP module when it wants - * to send a packet on the interface. This function typically - * first resolves the hardware address, then sends the packet. */ - err_t (* output)(struct netif *netif, struct pbuf *p, - struct ip_addr *ipaddr); - /** This function is called by the ARP module when it wants - * to send a packet on the interface. This function outputs - * the pbuf as-is on the link medium. */ - err_t (* linkoutput)(struct netif *netif, struct pbuf *p); -#if LWIP_NETIF_STATUS_CALLBACK - /** This function is called when the netif state is set to up or down - */ - void (* status_callback)(struct netif *netif); -#endif /* LWIP_NETIF_STATUS_CALLBACK */ -#if LWIP_NETIF_LINK_CALLBACK - /** This function is called when the netif link is set to up or down - */ - void (* link_callback)(struct netif *netif); -#endif /* LWIP_NETIF_LINK_CALLBACK */ - /** This field can be set by the device driver and could point - * to state information for the device. */ - void *state; -#if LWIP_DHCP - /** the DHCP client state information for this netif */ - struct dhcp *dhcp; -#endif /* LWIP_DHCP */ -#if LWIP_AUTOIP - /** the AutoIP client state information for this netif */ - struct autoip *autoip; -#endif -#if LWIP_NETIF_HOSTNAME - /* the hostname for this netif, NULL is a valid value */ - char* hostname; -#endif /* LWIP_NETIF_HOSTNAME */ - /** maximum transfer unit (in bytes) */ - u16_t mtu; - /** number of bytes used in hwaddr */ - u8_t hwaddr_len; - /** link level hardware address of this interface */ - u8_t hwaddr[NETIF_MAX_HWADDR_LEN]; - /** flags (see NETIF_FLAG_ above) */ - u8_t flags; - /** descriptive abbreviation */ - char name[2]; - /** number of this interface */ - u8_t num; -#if LWIP_SNMP - /** link type (from "snmp_ifType" enum from snmp.h) */ - u8_t link_type; - /** (estimate) link speed */ - u32_t link_speed; - /** timestamp at last change made (up/down) */ - u32_t ts; - /** counters */ - u32_t ifinoctets; - u32_t ifinucastpkts; - u32_t ifinnucastpkts; - u32_t ifindiscards; - u32_t ifoutoctets; - u32_t ifoutucastpkts; - u32_t ifoutnucastpkts; - u32_t ifoutdiscards; -#endif /* LWIP_SNMP */ -#if LWIP_IGMP - /* This function could be called to add or delete a entry in the multicast filter table of the ethernet MAC.*/ - err_t (*igmp_mac_filter)( struct netif *netif, struct ip_addr *group, u8_t action); -#endif /* LWIP_IGMP */ -#if LWIP_NETIF_HWADDRHINT - u8_t *addr_hint; -#endif /* LWIP_NETIF_HWADDRHINT */ -#if ENABLE_LOOPBACK - /* List of packets to be queued for ourselves. */ - struct pbuf *loop_first; - struct pbuf *loop_last; -#if LWIP_LOOPBACK_MAX_PBUFS - u16_t loop_cnt_current; -#endif /* LWIP_LOOPBACK_MAX_PBUFS */ -#endif /* ENABLE_LOOPBACK */ -}; - -#if LWIP_SNMP -#define NETIF_INIT_SNMP(netif, type, speed) \ - /* use "snmp_ifType" enum from snmp.h for "type", snmp_ifType_ethernet_csmacd by example */ \ - netif->link_type = type; \ - /* your link speed here (units: bits per second) */ \ - netif->link_speed = speed; \ - netif->ts = 0; \ - netif->ifinoctets = 0; \ - netif->ifinucastpkts = 0; \ - netif->ifinnucastpkts = 0; \ - netif->ifindiscards = 0; \ - netif->ifoutoctets = 0; \ - netif->ifoutucastpkts = 0; \ - netif->ifoutnucastpkts = 0; \ - netif->ifoutdiscards = 0 -#else /* LWIP_SNMP */ -#define NETIF_INIT_SNMP(netif, type, speed) -#endif /* LWIP_SNMP */ - - -/** The list of network interfaces. */ -extern struct netif *netif_list; -/** The default network interface. */ -extern struct netif *netif_default; - -#define netif_init() /* Compatibility define, not init needed. */ - -struct netif *netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, - struct ip_addr *gw, - void *state, - err_t (* init)(struct netif *netif), - err_t (* input)(struct pbuf *p, struct netif *netif)); - -void -netif_set_addr(struct netif *netif,struct ip_addr *ipaddr, struct ip_addr *netmask, - struct ip_addr *gw); -void netif_remove(struct netif * netif); - -/* Returns a network interface given its name. The name is of the form - "et0", where the first two letters are the "name" field in the - netif structure, and the digit is in the num field in the same - structure. */ -struct netif *netif_find(char *name); - -void netif_set_default(struct netif *netif); - -void netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr); -void netif_set_netmask(struct netif *netif, struct ip_addr *netmask); -void netif_set_gw(struct netif *netif, struct ip_addr *gw); - -void netif_set_up(struct netif *netif); -void netif_set_down(struct netif *netif); -u8_t netif_is_up(struct netif *netif); - -#if LWIP_NETIF_STATUS_CALLBACK -/* - * Set callback to be called when interface is brought up/down - */ -void netif_set_status_callback(struct netif *netif, void (* status_callback)(struct netif *netif)); -#endif /* LWIP_NETIF_STATUS_CALLBACK */ - -#if LWIP_NETIF_LINK_CALLBACK -void netif_set_link_up(struct netif *netif); -void netif_set_link_down(struct netif *netif); -u8_t netif_is_link_up(struct netif *netif); -/* - * Set callback to be called when link is brought up/down - */ -void netif_set_link_callback(struct netif *netif, void (* link_callback)(struct netif *netif)); -#endif /* LWIP_NETIF_LINK_CALLBACK */ - -#ifdef __cplusplus -} -#endif - -#if ENABLE_LOOPBACK -err_t netif_loop_output(struct netif *netif, struct pbuf *p, struct ip_addr *dest_ip); -void netif_poll(struct netif *netif); -#if !LWIP_NETIF_LOOPBACK_MULTITHREADING -void netif_poll_all(void); -#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ -#endif /* ENABLE_LOOPBACK */ - -#endif /* __LWIP_NETIF_H__ */ diff --git a/components/net/uip/rt-thread/uip_pbuf.c b/components/net/uip/rt-thread/uip_pbuf.c deleted file mode 100644 index ea12e84e62..0000000000 --- a/components/net/uip/rt-thread/uip_pbuf.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "uip_pbuf.h" -#include "rtdef.h" - -typedef rt_uint32_t mem_ptr_t; -#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + RT_ALIGN_SIZE - 1) & ~(mem_ptr_t)(RT_ALIGN_SIZE-1))) -#define LWIP_MEM_ALIGN_SIZE(size) (((size) + RT_ALIGN_SIZE - 1) & ~(RT_ALIGN_SIZE-1)) -#define SIZEOF_STRUCT_PBUF LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) - -u8_t -pbuf_free(struct pbuf *p) -{ - - //struct pbuf *q; - - if (p == RT_NULL) return 0; - rt_free(p); - //rt_free(&p->len); - - return 1; -} - -struct pbuf * -pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) -{ - struct pbuf *p; - u16_t offset = 0; - offset += 16; - - /* If pbuf is to be allocated in RAM, allocate memory for it. */ - p = (struct pbuf*)rt_malloc(LWIP_MEM_ALIGN_SIZE(SIZEOF_STRUCT_PBUF + offset) + LWIP_MEM_ALIGN_SIZE(length)); - if (p == RT_NULL) return RT_NULL; - /* Set up internal structure of the pbuf. */ - p->payload = LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset)); - p->len = length; - return p; -} - -u8_t -pbuf_header(struct pbuf *p, s16_t header_size_increment) // -{ - //extrat link header - uint8_t *ptr; - - ptr = p->payload; - ptr -= header_size_increment; - p->payload = ptr; - p->len += header_size_increment; - - return 0; -} \ No newline at end of file diff --git a/components/net/uip/rt-thread/uip_pbuf.h b/components/net/uip/rt-thread/uip_pbuf.h deleted file mode 100644 index 56c5bf5e99..0000000000 --- a/components/net/uip/rt-thread/uip_pbuf.h +++ /dev/null @@ -1,87 +0,0 @@ - -#ifndef __UIP_PBUF_H__ -#define __UIP_PBUF_H__ - -//#include "lwip/opt.h" -//#include "lwip/err.h" -#include "uip-conf.h" -#include "uip_etharp.h" - -typedef rt_int16_t s16_t; -typedef rt_int8_t err_t; -#ifdef __cplusplus -extern "C" { -#endif - -#define PBUF_TRANSPORT_HLEN 20 -#define PBUF_IP_HLEN 20 - -typedef enum { - PBUF_TRANSPORT, - PBUF_IP, - PBUF_LINK, - PBUF_RAW -} pbuf_layer; - -typedef enum { - PBUF_RAM, /* pbuf data is stored in RAM */ - PBUF_ROM, /* pbuf data is stored in ROM */ - PBUF_REF, /* pbuf comes from the pbuf pool */ - PBUF_POOL /* pbuf payload refers to RAM */ -} pbuf_type; - - -/** indicates this packet's data should be immediately passed to the application */ -#define PBUF_FLAG_PUSH 0x01U -#ifdef RT_USING_LWIP -struct pbuf { - /** next pbuf in singly linked pbuf chain */ - struct pbuf *next; - - /** pointer to the actual data in the buffer */ - void *payload; - - /** - * total length of this buffer and all next buffers in chain - * belonging to the same packet. - * - * For non-queue packet chains this is the invariant: - * p->tot_len == p->len + (p->next? p->next->tot_len: 0) - */ - u16_t tot_len; - - /** length of this buffer */ - u16_t len; - - /** pbuf_type as u8_t instead of enum to save space */ - u8_t /*pbuf_type*/ type; - - /** misc flags */ - u8_t flags; - - /** - * the reference count always equals the number of pointers - * that refer to this pbuf. This can be pointers from an application, - * the stack itself, or pbuf->next pointers from a chain. - */ - u16_t ref; - -}; -#else /* RT_USING_UIP */ -struct pbuf -{ - /** pointer to the actual data in the buffer */ - void *payload; - rt_uint16_t len; -}; -#endif -/* Initializes the pbuf module. This call is empty for now, but may not be in future. */ - - -struct pbuf *pbuf_alloc(pbuf_layer l, u16_t size, pbuf_type type); - -u8_t pbuf_header(struct pbuf *p, s16_t header_size); - -u8_t pbuf_free(struct pbuf *p); - -#endif /* __UIP_PBUF_H__ */ diff --git a/components/net/uip/rt-thread/uip_tcpip.c b/components/net/uip/rt-thread/uip_tcpip.c deleted file mode 100644 index 9e65a3c18a..0000000000 --- a/components/net/uip/rt-thread/uip_tcpip.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "uip_pbuf.h" -#include "uip-conf.h" -#include "rtdef.h" -#include "uip.h" -#include "uip_arp.h" -#include "uip_netif.h" - -err_t -tcpip_input(struct pbuf *p, struct netif *inp) -{ - int i; - u8_t *pdata; - if (uip_len) - { - uip_arp_out(); - if (( pdata =(u8_t*)rt_malloc(1500*sizeof(u8_t))) == RT_NULL) - { - pbuf_free(p); - return 1; - } - for (i=0; i < (UIP_LLH_LEN + 40); ++i) // 14+40 =54 - { - pdata[i] = uip_buf[i]; /* get dest an src ipaddr */ - } - // Copy the data portion part - for(; i < uip_len; ++i) - { - pdata[i] = uip_appdata[i - UIP_LLH_LEN - 40 ]; - } - p ->payload = pdata; - p->len = uip_len; - inp->linkoutput(inp,p); - rt_free(pdata); - return 1; - } - else - { - pbuf_free(p); - return 0; - } -} \ No newline at end of file diff --git a/components/net/uip/uip-1.0-changelog.txt b/components/net/uip/uip-1.0-changelog.txt deleted file mode 100644 index 1e6c61cf80..0000000000 --- a/components/net/uip/uip-1.0-changelog.txt +++ /dev/null @@ -1,98 +0,0 @@ -* A new API: protosockets that are similar to BSD sockets but does not - require any underlying multithreading system. - -* Very rudimentary IPv6 support - -* New application: DHCP client. Web server rewritten with protosockets. - -* Removed uIP zero-copy functionality in order to simplify uIP device - driver coding: outbound packets are now *always* stored in full in - the uip_buf buffer. - -* Checksum computation is now part of uip.c, but it still is possible - to implement them in assembly code by specifying a configuration - option. Checksum code now runs on architectures with 2-byte alignment. - -* Added TCP persistent timer. - -* Made all IP address representations use the new uip_ipaddr_ip - datatype for clarity. - -* Updated window behavior so that sending to a host with a small open - window works better now. - -* UDP API change: uip_udp_new() now takes port numbers in network byte - order like TCP functions. - -* Allow reception of packets when no IP address is configured to make - DHCP work. - -* Moved Ethernet address into main uIP module from ARP module. - -* Made constants explicit #defines and moved them out of the code - (header sizes, TCP options, TCP header length field). - -* If uip_len is less than that reported by the IP header, the packet - is discarded. If uip_len is greater than the length reported by the - IP header, uip_len is adjusted. - -* Moved header size definitions into header file. - -* Added uIP call for polling an application without triggering any - timer events. Removed redundant assignments of uip_len and uip_slen. - -* Removed compiler warning about icmp_input label being defined when - UIP_PINGADDRCONF was not used. - -* Added UIP_APPDATA_SIZE macro that holds the available buffer size - for user data. - -* Added uip_udp_bind() call. - -* Moved checksum code into main uIP module. - -* Switched the TCP, UDP and IP header structures to be structs rather - than typedefs. - -* Prefixed TCP state names with UIP_ to avoid name space - contamination. - -* Changed declarations of uip_appdatap and friends to void * to avoid - explicit typecasts. - -* Bugfixes - - o TCP: Fixed bug with high byte of peer window size. - - o TCP: Fixed bug that in some cases prevented concurrent reception and - transmission of TCP data. - - o TCP: uip_connect() didn't correctly calculate age of TIME_WAIT - connections. - - o TCP: Array index for uip_conns[] array was out of bounds in - comparison. Comparison changed to make index within bounds. - - o TCP: if the remote host crashes and tries to reestablish an old - connection, uIP should respond with an ACK with the correct - sequence and acknowledgment numbers, to which the remote host - should respond with an ACK. uIP did not respond with the correct - ACK. - - o TCP: Fixed check for SYNACK segment: now checks only relevant TCP - control flags and discards flags reserved for future expansion. - - o TCP: Fixed bug where uIP did not inform application that a connection - had been aborted during an active open. - - o TCP: FIN segment was accepted even though application had stopped - incoming data with uip_stop(). - - o TCP: A FINACK segment would not always correctly acknowledge data. - - o UDP: checksums are now calculated after all fields have been - filled in. - - o UDP: network byte order on lastport in uip_udp_new(). - - o IP: memset() bugs in IP fragment reassembly code fixed. diff --git a/components/net/uip/unix/Makefile b/components/net/uip/unix/Makefile deleted file mode 100644 index ed64927b89..0000000000 --- a/components/net/uip/unix/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2001, Adam Dunkels. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# This file is part of the uIP TCP/IP stack. -# -# $Id: Makefile,v 1.13 2006/06/11 21:55:03 adam Exp $ -# - -all: uip - -CC = gcc -AR = ar -APPS = webserver -CFLAGS = -Wall -g -I../uip -I. -fpack-struct -Os --include ../uip/Makefile.include - -uip: $(addprefix $(OBJECTDIR)/, main.o tapdev.o clock-arch.o) apps.a uip.a - -clean: - rm -fr *.o *~ *core uip $(OBJECTDIR) *.a diff --git a/components/net/uip/unix/clock-arch.c b/components/net/uip/unix/clock-arch.c deleted file mode 100644 index d140aaf785..0000000000 --- a/components/net/uip/unix/clock-arch.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $ - */ - -/** - * \file - * Implementation of architecture-specific clock functionality - * \author - * Adam Dunkels - */ - -#include "clock-arch.h" -#include - -/*---------------------------------------------------------------------------*/ -clock_time_t -clock_time(void) -{ - struct timeval tv; - struct timezone tz; - - gettimeofday(&tv, &tz); - - return tv.tv_sec * 1000 + tv.tv_usec / 1000; -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/unix/clock-arch.h b/components/net/uip/unix/clock-arch.h deleted file mode 100644 index e51eee934f..0000000000 --- a/components/net/uip/unix/clock-arch.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $ - */ - -#ifndef __CLOCK_ARCH_H__ -#define __CLOCK_ARCH_H__ - -typedef int clock_time_t; -#define CLOCK_CONF_SECOND 1000 - -#endif /* __CLOCK_ARCH_H__ */ diff --git a/components/net/uip/unix/main.c b/components/net/uip/unix/main.c deleted file mode 100644 index e4130e9dd9..0000000000 --- a/components/net/uip/unix/main.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Adam Dunkels. - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: main.c,v 1.16 2006/06/11 21:55:03 adam Exp $ - * - */ - - -#include "uip.h" -#include "uip_arp.h" -#include "tapdev.h" - -#include "timer.h" - -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) - -#ifndef NULL -#define NULL (void *)0 -#endif /* NULL */ - -/*---------------------------------------------------------------------------*/ -int -main(void) -{ - int i; - uip_ipaddr_t ipaddr; - struct timer periodic_timer, arp_timer; - - timer_set(&periodic_timer, CLOCK_SECOND / 2); - timer_set(&arp_timer, CLOCK_SECOND * 10); - - tapdev_init(); - uip_init(); - - uip_ipaddr(ipaddr, 192,168,0,2); - uip_sethostaddr(ipaddr); - uip_ipaddr(ipaddr, 192,168,0,1); - uip_setdraddr(ipaddr); - uip_ipaddr(ipaddr, 255,255,255,0); - uip_setnetmask(ipaddr); - - httpd_init(); - - /* telnetd_init();*/ - - /* hello_world_init();*/ - - /* { - u8_t mac[6] = {1,2,3,4,5,6}; - dhcpc_init(&mac, 6); - }*/ - - /*uip_ipaddr(ipaddr, 127,0,0,1); - smtp_configure("localhost", ipaddr); - SMTP_SEND("adam@sics.se", NULL, "uip-testing@example.com", - "Testing SMTP from uIP", - "Test message sent by uIP\r\n");*/ - - /* - webclient_init(); - resolv_init(); - uip_ipaddr(ipaddr, 195,54,122,204); - resolv_conf(ipaddr); - resolv_query("www.sics.se");*/ - - - - while(1) { - uip_len = tapdev_read(); - if(uip_len > 0) { - if(BUF->type == htons(UIP_ETHTYPE_IP)) { - uip_arp_ipin(); - uip_input(); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - uip_arp_out(); - tapdev_send(); - } - } else if(BUF->type == htons(UIP_ETHTYPE_ARP)) { - uip_arp_arpin(); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - tapdev_send(); - } - } - - } else if(timer_expired(&periodic_timer)) { - timer_reset(&periodic_timer); - for(i = 0; i < UIP_CONNS; i++) { - uip_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - uip_arp_out(); - tapdev_send(); - } - } - -#if UIP_UDP - for(i = 0; i < UIP_UDP_CONNS; i++) { - uip_udp_periodic(i); - /* If the above function invocation resulted in data that - should be sent out on the network, the global variable - uip_len is set to a value > 0. */ - if(uip_len > 0) { - uip_arp_out(); - tapdev_send(); - } - } -#endif /* UIP_UDP */ - - /* Call the ARP timer function every 10 seconds. */ - if(timer_expired(&arp_timer)) { - timer_reset(&arp_timer); - uip_arp_timer(); - } - } - } - return 0; -} -/*---------------------------------------------------------------------------*/ -void -uip_log(char *m) -{ - printf("uIP log message: %s\n", m); -} -void -resolv_found(char *name, u16_t *ipaddr) -{ - u16_t *ipaddr2; - - if(ipaddr == NULL) { - printf("Host '%s' not found.\n", name); - } else { - printf("Found name '%s' = %d.%d.%d.%d\n", name, - htons(ipaddr[0]) >> 8, - htons(ipaddr[0]) & 0xff, - htons(ipaddr[1]) >> 8, - htons(ipaddr[1]) & 0xff); - /* webclient_get("www.sics.se", 80, "/~adam/uip");*/ - } -} -#ifdef __DHCPC_H__ -void -dhcpc_configured(const struct dhcpc_state *s) -{ - uip_sethostaddr(s->ipaddr); - uip_setnetmask(s->netmask); - uip_setdraddr(s->default_router); - resolv_conf(s->dnsaddr); -} -#endif /* __DHCPC_H__ */ -void -smtp_done(unsigned char code) -{ - printf("SMTP done with code %d\n", code); -} -void -webclient_closed(void) -{ - printf("Webclient: connection closed\n"); -} -void -webclient_aborted(void) -{ - printf("Webclient: connection aborted\n"); -} -void -webclient_timedout(void) -{ - printf("Webclient: connection timed out\n"); -} -void -webclient_connected(void) -{ - printf("Webclient: connected, waiting for data...\n"); -} -void -webclient_datahandler(char *data, u16_t len) -{ - printf("Webclient: got %d bytes of data.\n", len); -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/unix/tapdev.c b/components/net/uip/unix/tapdev.c deleted file mode 100644 index 417b288803..0000000000 --- a/components/net/uip/unix/tapdev.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Author: Adam Dunkels - * - * $Id: tapdev.c,v 1.8 2006/06/07 08:39:58 adam Exp $ - */ - -#define UIP_DRIPADDR0 192 -#define UIP_DRIPADDR1 168 -#define UIP_DRIPADDR2 0 -#define UIP_DRIPADDR3 1 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef linux -#include -#include -#include -#define DEVTAP "/dev/net/tun" -#else /* linux */ -#define DEVTAP "/dev/tap0" -#endif /* linux */ - -#include "uip.h" - -static int drop = 0; -static int fd; - - -/*---------------------------------------------------------------------------*/ -void -tapdev_init(void) -{ - char buf[1024]; - - fd = open(DEVTAP, O_RDWR); - if(fd == -1) { - perror("tapdev: tapdev_init: open"); - exit(1); - } - -#ifdef linux - { - struct ifreq ifr; - memset(&ifr, 0, sizeof(ifr)); - ifr.ifr_flags = IFF_TAP|IFF_NO_PI; - if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) { - perror(buf); - exit(1); - } - } -#endif /* Linux */ - - snprintf(buf, sizeof(buf), "ifconfig tap0 inet %d.%d.%d.%d", - UIP_DRIPADDR0, UIP_DRIPADDR1, UIP_DRIPADDR2, UIP_DRIPADDR3); - system(buf); - -} -/*---------------------------------------------------------------------------*/ -unsigned int -tapdev_read(void) -{ - fd_set fdset; - struct timeval tv, now; - int ret; - - tv.tv_sec = 0; - tv.tv_usec = 1000; - - - FD_ZERO(&fdset); - FD_SET(fd, &fdset); - - ret = select(fd + 1, &fdset, NULL, NULL, &tv); - if(ret == 0) { - return 0; - } - ret = read(fd, uip_buf, UIP_BUFSIZE); - if(ret == -1) { - perror("tap_dev: tapdev_read: read"); - } - - /* printf("--- tap_dev: tapdev_read: read %d bytes\n", ret);*/ - /* { - int i; - for(i = 0; i < 20; i++) { - printf("%x ", uip_buf[i]); - } - printf("\n"); - }*/ - /* check_checksum(uip_buf, ret);*/ - return ret; -} -/*---------------------------------------------------------------------------*/ -void -tapdev_send(void) -{ - int ret; - /* printf("tapdev_send: sending %d bytes\n", size);*/ - /* check_checksum(uip_buf, size);*/ - - /* drop++; - if(drop % 8 == 7) { - printf("Dropped a packet!\n"); - return; - }*/ - ret = write(fd, uip_buf, uip_len); - if(ret == -1) { - perror("tap_dev: tapdev_send: writev"); - exit(1); - } -} -/*---------------------------------------------------------------------------*/ diff --git a/components/net/uip/unix/tapdev.h b/components/net/uip/unix/tapdev.h deleted file mode 100644 index 280bc52b72..0000000000 --- a/components/net/uip/unix/tapdev.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Adam Dunkels. - * 4. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack. - * - * $Id: tapdev.h,v 1.1 2002/01/10 06:22:56 adam Exp $ - * - */ - -#ifndef __TAPDEV_H__ -#define __TAPDEV_H__ - -void tapdev_init(void); -unsigned int tapdev_read(void); -void tapdev_send(void); - -#endif /* __TAPDEV_H__ */ diff --git a/components/net/uip/unix/uip-conf.h b/components/net/uip/unix/uip-conf.h deleted file mode 100644 index 2878c85b0d..0000000000 --- a/components/net/uip/unix/uip-conf.h +++ /dev/null @@ -1,157 +0,0 @@ -/** - * \addtogroup uipopt - * @{ - */ - -/** - * \name Project-specific configuration options - * @{ - * - * uIP has a number of configuration options that can be overridden - * for each project. These are kept in a project-specific uip-conf.h - * file and all configuration names have the prefix UIP_CONF. - */ - -/* - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the uIP TCP/IP stack - * - * $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $ - */ - -/** - * \file - * An example uIP configuration file - * \author - * Adam Dunkels - */ - -#ifndef __UIP_CONF_H__ -#define __UIP_CONF_H__ - -#include - -/** - * 8 bit datatype - * - * This typedef defines the 8-bit type used throughout uIP. - * - * \hideinitializer - */ -typedef uint8_t u8_t; - -/** - * 16 bit datatype - * - * This typedef defines the 16-bit type used throughout uIP. - * - * \hideinitializer - */ -typedef uint16_t u16_t; - -/** - * Statistics datatype - * - * This typedef defines the dataype used for keeping statistics in - * uIP. - * - * \hideinitializer - */ -typedef unsigned short uip_stats_t; - -/** - * Maximum number of TCP connections. - * - * \hideinitializer - */ -#define UIP_CONF_MAX_CONNECTIONS 40 - -/** - * Maximum number of listening TCP ports. - * - * \hideinitializer - */ -#define UIP_CONF_MAX_LISTENPORTS 40 - -/** - * uIP buffer size. - * - * \hideinitializer - */ -#define UIP_CONF_BUFFER_SIZE 420 - -/** - * CPU byte order. - * - * \hideinitializer - */ -#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN - -/** - * Logging on or off - * - * \hideinitializer - */ -#define UIP_CONF_LOGGING 1 - -/** - * UDP support on or off - * - * \hideinitializer - */ -#define UIP_CONF_UDP 0 - -/** - * UDP checksums on or off - * - * \hideinitializer - */ -#define UIP_CONF_UDP_CHECKSUMS 1 - -/** - * uIP statistics on or off - * - * \hideinitializer - */ -#define UIP_CONF_STATISTICS 1 - -/* Here we include the header file for the application(s) we use in - our project. */ -/*#include "smtp.h"*/ -/*#include "hello-world.h"*/ -/*#include "telnetd.h"*/ -#include "webserver.h" -/*#include "dhcpc.h"*/ -/*#include "resolv.h"*/ -/*#include "webclient.h"*/ - -#endif /* __UIP_CONF_H__ */ - -/** @} */ -/** @} */ -- cgit v1.3.1 From ae75916e6244f818d2e8d769f9b1c7505fea4bf4 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Fri, 12 Mar 2021 18:08:37 +0800 Subject: update --- bsp/bluetrum/ab32vg1-ab-prougen/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/README.md b/bsp/bluetrum/ab32vg1-ab-prougen/README.md index 7826256285..1e56724f35 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/README.md +++ b/bsp/bluetrum/ab32vg1-ab-prougen/README.md @@ -68,6 +68,8 @@ ab32vg1-prougen 是 中科è“�讯(Bluetrum) 推出的一款基于 RISC-V 内核 本 BSP 为开å�‘者æ��ä¾› GCC å¼€å�‘环境。下é�¢ä»‹ç»�如何将系统è¿�行起æ�¥ã€‚ +教学视频:https://www.bilibili.com/video/BV1RV411v75P/ + #### 硬件连接 使用数æ�®çº¿è¿žæŽ¥å¼€å�‘æ�¿åˆ° PC,打开电æº�开关。 -- cgit v1.3.1 From 137bcdd5b420060042285390fdeca39b1f72e7f5 Mon Sep 17 00:00:00 2001 From: JiangYangJie Date: Sun, 14 Mar 2021 18:47:54 +0800 Subject: add GET_PIN(PORTx,PIN) Signed-off-by: JiangYangJie --- bsp/bluetrum/libraries/hal_drivers/drv_common.h | 2 ++ bsp/bluetrum/libraries/hal_drivers/drv_gpio.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_common.h b/bsp/bluetrum/libraries/hal_drivers/drv_common.h index 0696bb17f3..3af014f49a 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_common.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_common.h @@ -15,4 +15,6 @@ #include #include +#define GET_PIN(PORTx,PIN) (uint8_t)__AB32_GET_PIN_##PORTx(PIN) + #endif // DRV_COMMON_H__ diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h index 7955a47d11..55cf2efc00 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h @@ -15,6 +15,10 @@ #include "board.h" #define __AB32_PORT(port) GPIO##port +#define __AB32_GET_PIN_A(PIN) PIN +#define __AB32_GET_PIN_B(PIN) 8 + PIN +#define __AB32_GET_PIN_E(PIN) 13 + PIN +#define __AB32_GET_PIN_F(PIN) 21 + PIN int rt_hw_pin_init(void); -- cgit v1.3.1 From 3ec59a8865b9503f5daa4e6c894b0fc502a43068 Mon Sep 17 00:00:00 2001 From: yangjie Date: Mon, 15 Mar 2021 13:44:25 +0800 Subject: [components][dfs/Kconfig] 修改helpæ��è¿° MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig index 3d70820173..39eca3c507 100644 --- a/components/dfs/Kconfig +++ b/components/dfs/Kconfig @@ -115,7 +115,7 @@ if RT_USING_DFS int "Maximum sector size to be handled." default 512 help - if you use some spi nor flash for fatfs, please set this the erase sector size, for example 4096. + If you use some spi nor flash for fatfs, please set this the erase sector size, for example 4096. config RT_DFS_ELM_USE_ERASE bool "Enable sector erase feature" -- cgit v1.3.1 From 6ec6285e1be98a667f82d20054c66edb553823bc Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Mon, 15 Mar 2021 15:41:41 +0800 Subject: [nuvoton] Update BSP. 1. Add NUC980 Chili board supporting. 2. Correct NuMicro.h including. 3. Implement rt_hw_us_delay system call function. 4. Move board.c to drv_common.c for M480 and M2354 series. --- bsp/nuvoton/README.md | 5 +- .../m2354/Device/Nuvoton/M2354/Include/NuMicro.h | 1 + .../Device/Nuvoton/M2354/Include/system_M2354.h | 12 +- .../libraries/m2354/StdDriver/lib/libStdDriver.ewp | 2 + .../m2354/StdDriver/lib/libStdDriver.uvprojx | 2 +- .../libraries/m2354/rtt_port/drv_bpwm_capture.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_can.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_clk.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_common.c | 143 ++++ bsp/nuvoton/libraries/m2354/rtt_port/drv_eadc.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_ebi.h | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_ecap.c | 2 +- .../libraries/m2354/rtt_port/drv_epwm_capture.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.h | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_gpio.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.c | 3 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.h | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_otg.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.h | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c | 11 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.h | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_softi2c.c | 44 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.h | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_spii2s.c | 3 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c | 2 +- .../libraries/m2354/rtt_port/drv_timer_capture.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c | 2 +- bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c | 2 +- .../libraries/m480/rtt_port/drv_bpwm_capture.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_can.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_clk.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_common.c | 132 ++++ bsp/nuvoton/libraries/m480/rtt_port/drv_eadc.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_ebi.h | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_ecap.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c | 2 +- .../libraries/m480/rtt_port/drv_epwm_capture.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.h | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_gpio.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_hsotg.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.c | 3 +- bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.h | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.h | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_softi2c.c | 44 +- bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_spii2s.c | 3 +- bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c | 2 +- .../libraries/m480/rtt_port/drv_timer_capture.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c | 2 +- bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c | 2 +- .../nu_packages/AudioCodec/acodec_nau88l25.c | 6 +- .../libraries/nu_packages/AudioCodec/audio_test.c | 8 +- bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig | 15 - bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_can.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_ebi.h | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c | 4 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c | 2 +- .../libraries/nuc980/rtt_port/drv_etimer_capture.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_gpio.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.h | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.h | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c | 5 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c | 2 +- .../libraries/nuc980/rtt_port/drv_softi2c.c | 4 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.h | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c | 18 + .../libraries/nuc980/rtt_port/drv_systick.c | 7 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c | 33 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.h | 1 + bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c | 2 +- .../libraries/nuc980/rtt_port/drv_usbhost.c | 2 +- bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c | 2 +- bsp/nuvoton/nk-980iot/board/board.h | 2 +- bsp/nuvoton/nk-rtu980/.config | 828 +++++++++++++++++++++ bsp/nuvoton/nk-rtu980/Kconfig | 29 + bsp/nuvoton/nk-rtu980/README.md | 106 +++ bsp/nuvoton/nk-rtu980/SConscript | 14 + bsp/nuvoton/nk-rtu980/SConstruct | 55 ++ bsp/nuvoton/nk-rtu980/applications/SConscript | 11 + bsp/nuvoton/nk-rtu980/applications/main.c | 71 ++ bsp/nuvoton/nk-rtu980/applications/mnt.c | 237 ++++++ bsp/nuvoton/nk-rtu980/board/Kconfig | 48 ++ bsp/nuvoton/nk-rtu980/board/SConscript | 14 + bsp/nuvoton/nk-rtu980/board/board.h | 43 ++ bsp/nuvoton/nk-rtu980/board/board_dev.c | 236 ++++++ bsp/nuvoton/nk-rtu980/board/fal_cfg.h | 46 ++ bsp/nuvoton/nk-rtu980/board/nu_pin_init.c | 85 +++ bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.ld | 114 +++ bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.sct | 11 + bsp/nuvoton/nk-rtu980/rtconfig.py | 88 +++ bsp/nuvoton/nk-rtu980/template.uvproj | 394 ++++++++++ bsp/nuvoton/nk-rtu980/template.uvprojx | 387 ++++++++++ bsp/nuvoton/numaker-iot-m487/board/board.c | 97 --- bsp/nuvoton/numaker-m2354/board/board.c | 108 --- bsp/nuvoton/numaker-pfm-m487/board/board.c | 97 --- 115 files changed, 3267 insertions(+), 499 deletions(-) create mode 100644 bsp/nuvoton/libraries/m2354/rtt_port/drv_common.c create mode 100644 bsp/nuvoton/libraries/m480/rtt_port/drv_common.c create mode 100644 bsp/nuvoton/nk-rtu980/.config create mode 100644 bsp/nuvoton/nk-rtu980/Kconfig create mode 100644 bsp/nuvoton/nk-rtu980/README.md create mode 100644 bsp/nuvoton/nk-rtu980/SConscript create mode 100644 bsp/nuvoton/nk-rtu980/SConstruct create mode 100644 bsp/nuvoton/nk-rtu980/applications/SConscript create mode 100644 bsp/nuvoton/nk-rtu980/applications/main.c create mode 100644 bsp/nuvoton/nk-rtu980/applications/mnt.c create mode 100644 bsp/nuvoton/nk-rtu980/board/Kconfig create mode 100644 bsp/nuvoton/nk-rtu980/board/SConscript create mode 100644 bsp/nuvoton/nk-rtu980/board/board.h create mode 100644 bsp/nuvoton/nk-rtu980/board/board_dev.c create mode 100644 bsp/nuvoton/nk-rtu980/board/fal_cfg.h create mode 100644 bsp/nuvoton/nk-rtu980/board/nu_pin_init.c create mode 100644 bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.ld create mode 100644 bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.sct create mode 100644 bsp/nuvoton/nk-rtu980/rtconfig.py create mode 100644 bsp/nuvoton/nk-rtu980/template.uvproj create mode 100644 bsp/nuvoton/nk-rtu980/template.uvprojx delete mode 100644 bsp/nuvoton/numaker-iot-m487/board/board.c delete mode 100644 bsp/nuvoton/numaker-m2354/board/board.c delete mode 100644 bsp/nuvoton/numaker-pfm-m487/board/board.c diff --git a/bsp/nuvoton/README.md b/bsp/nuvoton/README.md index dfa048ab2f..9d0c433984 100644 --- a/bsp/nuvoton/README.md +++ b/bsp/nuvoton/README.md @@ -1,4 +1,4 @@ -# Nuvoton BSP descriptions +ï»? Nuvoton BSP descriptions Current supported BSP shown in below table: | **BSP folder** | **Board name** | @@ -6,4 +6,5 @@ Current supported BSP shown in below table: | [numaker-iot-m487](numaker-iot-m487) | Nuvoton NuMaker-IoT-M487 | | [numaker-pfm-m487](numaker-pfm-m487) | Nuvoton NuMaker-PFM-M487 | | [nk-980iot](nk-980iot) | Nuvoton NK-980IOT | -| [numaker-m2354](numaker-m2354) | Nuvoton NuMaker-M2354 | \ No newline at end of file +| [numaker-m2354](numaker-m2354) | Nuvoton NuMaker-M2354 | +| [nk-rtu980](nk-rtu980) | Nuvoton NK-RTU980 | \ No newline at end of file diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h index 548ab843cc..cccccd4e7a 100644 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h +++ b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h @@ -9,6 +9,7 @@ #ifndef __NUMICRO_H__ #define __NUMICRO_H__ +#include "nutool_clkcfg.h" #include "M2354.h" #endif /* __NUMICRO_H__ */ diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h index ba5bbc1f4d..edf1e3e6e5 100644 --- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h +++ b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h @@ -49,11 +49,21 @@ extern "C" { /*---------------------------------------------------------------------------- Define SYSCLK *----------------------------------------------------------------------------*/ +#ifndef __HXT #define __HXT (12000000UL) /*!< External Crystal Clock Frequency */ +#endif + #define __LIRC (32000UL) /*!< Internal 32K RC Oscillator Frequency */ #define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */ + +#ifndef __LXT #define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */ +#endif + +#ifndef __HSI #define __HSI (48000000UL) /*!< PLL Output Clock Frequency */ +#endif + #define __HIRC48 (48000000UL) /*!< Internal 48M RC Oscillator Frequency */ #define __LIRC32 (32000UL) /*!< Internal 32K RC Oscillator Frequency */ #define __MIRC (4000000UL) /*!< Internal 4M RC Oscillator Frequency */ @@ -93,7 +103,7 @@ extern uint32_t __PC(void); /*!< Return the current program counter valu */ #define ASSERT_PARAM(expr) { if (!(expr)) { AssertError((uint8_t*)__FILE__, __LINE__); } } -void AssertError(uint8_t* file, uint32_t line); +void AssertError(uint8_t *file, uint32_t line); #else #define ASSERT_PARAM(expr) #endif diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp index 555ab69852..69c44b7d03 100644 --- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp +++ b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp @@ -348,6 +348,7 @@ $PROJ_DIR$\..\..\Device\Nuvoton\M2354\Include $PROJ_DIR$\..\..\CMSIS\Include $PROJ_DIR$\..\inc + $PROJ_DIR$

### uVision Project, (C) Keil Software
+ + + + rtthread + 0x4 + ARM-ADS + + + Nuvoton_ARM9_Series + Nuvoton + + + + + 0 + + + + + + + + + + + + 0 + + + + Atmel\SAM9260\ + Atmel\SAM9260\ + + 0 + 0 + 0 + 0 + 1 + + .\Objects\ + rtthread + 1 + 0 + 0 + 1 + 1 + .\Listings\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + + + SARM.DLL + -cAT91SAM9 + DARMATS9.DLL + -p91SAM9260 + SARM.DLL + + TARMATS9.DLL + -p91SAM9260 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + + + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + ..\libraries\nuc980\Script\NUC980xx61.ini + Segger\JLTAgdi.dll + + + + + 1 + 0 + 0 + 0 + 1 + 4098 + + 0 + Segger\JLTAgdi.dll + "" () + + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x200000 + 0x1000 + + + 1 + 0x100000 + 0x8000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + + --c99 + RT_USING_INTERRUPT_INFO + + + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + 0 + 1 + 0 + 0x20000000 + 0x20800000 + .\linking_scripts\nuc980.sct + + + + + + + + + + + + diff --git a/bsp/nuvoton/nk-rtu980/template.uvprojx b/bsp/nuvoton/nk-rtu980/template.uvprojx new file mode 100644 index 0000000000..aad158ccc3 --- /dev/null +++ b/bsp/nuvoton/nk-rtu980/template.uvprojx @@ -0,0 +1,387 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + rtthread + 0x4 + ARM-ADS + 0 + + + Nuvoton_ARM9_Series + Nuvoton + + + + + 0 + + + + + + + + + + + + 0 + 0 + + + + Atmel\SAM9260\ + Atmel\SAM9260\ + + 0 + 0 + 0 + 0 + 1 + + .\build\keil5\ + rtthread + 1 + 0 + 1 + 1 + 1 + .\build\keil5\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 1 + 0 + fromelf.exe --bin --output "$L@L.bin" "$L@L.axf" + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARM.DLL + -cAT91SAM9260 + DARMATS9.DLL + -p91SAM9260 + SARM.DLL + + TARMATS9.DLL + -p91SAM9260 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 0 + 1 + 4098 + + 0 + Segger\JLTAgdi.dll + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + ARM926EJ-S + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 8 + 0 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x200000 + 0x1000 + + + 1 + 0x100000 + 0x8000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x20000000 + 0x800000 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x100000 + 0x8000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x20800000 + 0x1800000 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x200000 + 0x1000 + + + 0 + 0x300000 + 0x1000 + + + + + + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + --c99 + + + + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + 0 + 1 + 0 + 0x20000000 + 0x20800000 + + .\linking_scripts\nuc980.sct + + + + + + + + + + + + + + + + + +
diff --git a/bsp/nuvoton/numaker-iot-m487/board/board.c b/bsp/nuvoton/numaker-iot-m487/board/board.c deleted file mode 100644 index 01d68aca61..0000000000 --- a/bsp/nuvoton/numaker-iot-m487/board/board.c +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************//** -* -* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved. -* -* SPDX-License-Identifier: Apache-2.0 -* -* Change Logs: -* Date Author Notes -* 2020-1-16 Wayne First version -* -******************************************************************************/ - -#include -#include -#include -#include "drv_uart.h" -#include "board.h" -#include "nutool_pincfg.h" -#include "nutool_modclkcfg.h" - - -/** - * This function will initial M487 board. - */ -void rt_hw_board_init(void) -{ - /* Init System/modules clock */ - nutool_modclkcfg_init(); - - /* Unlock protected registers */ - SYS_UnlockReg(); - - /* Init all pin function setting */ - nutool_pincfg_init(); - - /* Configure SysTick */ - SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND); - - /* Update System Core Clock */ - /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock. */ - SystemCoreClockUpdate(); - -#if defined(BSP_USING_EADC) - /* Vref connect to internal */ - SYS->VREFCTL = (SYS->VREFCTL & ~SYS_VREFCTL_VREFCTL_Msk) | SYS_VREFCTL_VREF_3_0V; -#endif - - /* Lock protected registers */ - SYS_LockReg(); - -#ifdef RT_USING_HEAP - rt_system_heap_init(HEAP_BEGIN, HEAP_END); -#endif /* RT_USING_HEAP */ - -#if defined(BSP_USING_UART) - rt_hw_uart_init(); -#endif - -#ifdef RT_USING_CONSOLE - rt_console_set_device(RT_CONSOLE_DEVICE_NAME); -#endif - - NVIC_SetPriorityGrouping(7); - -#ifdef RT_USING_COMPONENTS_INIT - rt_components_board_init(); -#endif -} - -/** - * This is the timer interrupt service routine. - * - */ -void SysTick_Handler(void) -{ - /* enter interrupt */ - rt_interrupt_enter(); - - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); -} - -void rt_hw_cpu_reset(void) -{ - SYS_UnlockReg(); - - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -int reboot(int argc, char** argv) -{ - rt_hw_cpu_reset(); - return 0; -} -MSH_CMD_EXPORT(reboot, Reboot System); diff --git a/bsp/nuvoton/numaker-m2354/board/board.c b/bsp/nuvoton/numaker-m2354/board/board.c deleted file mode 100644 index 868dd7591f..0000000000 --- a/bsp/nuvoton/numaker-m2354/board/board.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************//** -* -* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved. -* -* SPDX-License-Identifier: Apache-2.0 -* -* Change Logs: -* Date Author Notes -* 2020-1-16 Wayne First version -* -******************************************************************************/ - -#include -#include -#include -#include -#include "drv_uart.h" -#include "board.h" -#include "nutool_pincfg.h" -#include "nutool_modclkcfg.h" - - - -/** - * This function will initial M487 board. - */ -void rt_hw_board_init(void) -{ - /* Init System/modules clock */ - nutool_modclkcfg_init(); - - /* Unlock protected registers */ - SYS_UnlockReg(); - - /* Init all pin function setting */ - nutool_pincfg_init(); - - /* Configure SysTick */ - SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND); - - /* Update System Core Clock */ - /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock. */ - SystemCoreClockUpdate(); - -#if defined(BSP_USING_EADC) - /* Vref connect to internal */ - SYS->VREFCTL = (SYS->VREFCTL & ~SYS_VREFCTL_VREFCTL_Msk) | SYS_VREFCTL_VREF_3_0V; -#endif - - /* Lock protected registers */ - SYS_LockReg(); - -#ifdef RT_USING_HEAP - rt_system_heap_init(HEAP_BEGIN, HEAP_END); -#endif /* RT_USING_HEAP */ - -#if defined(BSP_USING_UART) - rt_hw_uart_init(); -#endif - -#ifdef RT_USING_CONSOLE - rt_console_set_device(RT_CONSOLE_DEVICE_NAME); -#endif - -#ifdef RT_USING_COMPONENTS_INIT - rt_components_board_init(); -#endif -} - -/** - * This is the timer interrupt service routine. - * - */ -void SysTick_Handler(void) -{ - /* enter interrupt */ - rt_interrupt_enter(); - - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); -} - -void rt_hw_cpu_reset(void) -{ - SYS_UnlockReg(); - - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -#ifdef RT_USING_CPU_FFS -int __rt_ffs(int value) -{ - if (!value) return 0; - return __CLZ(__RBIT(value)) + 1; -} -#endif - -#ifdef RT_USING_FINSH -#include -static void reboot(uint8_t argc, char **argv) -{ - rt_hw_cpu_reset(); -} -FINSH_FUNCTION_EXPORT_ALIAS(reboot, __cmd_reboot, Reboot System); -#endif /* RT_USING_FINSH */ - diff --git a/bsp/nuvoton/numaker-pfm-m487/board/board.c b/bsp/nuvoton/numaker-pfm-m487/board/board.c deleted file mode 100644 index 01d68aca61..0000000000 --- a/bsp/nuvoton/numaker-pfm-m487/board/board.c +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************//** -* -* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved. -* -* SPDX-License-Identifier: Apache-2.0 -* -* Change Logs: -* Date Author Notes -* 2020-1-16 Wayne First version -* -******************************************************************************/ - -#include -#include -#include -#include "drv_uart.h" -#include "board.h" -#include "nutool_pincfg.h" -#include "nutool_modclkcfg.h" - - -/** - * This function will initial M487 board. - */ -void rt_hw_board_init(void) -{ - /* Init System/modules clock */ - nutool_modclkcfg_init(); - - /* Unlock protected registers */ - SYS_UnlockReg(); - - /* Init all pin function setting */ - nutool_pincfg_init(); - - /* Configure SysTick */ - SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND); - - /* Update System Core Clock */ - /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock. */ - SystemCoreClockUpdate(); - -#if defined(BSP_USING_EADC) - /* Vref connect to internal */ - SYS->VREFCTL = (SYS->VREFCTL & ~SYS_VREFCTL_VREFCTL_Msk) | SYS_VREFCTL_VREF_3_0V; -#endif - - /* Lock protected registers */ - SYS_LockReg(); - -#ifdef RT_USING_HEAP - rt_system_heap_init(HEAP_BEGIN, HEAP_END); -#endif /* RT_USING_HEAP */ - -#if defined(BSP_USING_UART) - rt_hw_uart_init(); -#endif - -#ifdef RT_USING_CONSOLE - rt_console_set_device(RT_CONSOLE_DEVICE_NAME); -#endif - - NVIC_SetPriorityGrouping(7); - -#ifdef RT_USING_COMPONENTS_INIT - rt_components_board_init(); -#endif -} - -/** - * This is the timer interrupt service routine. - * - */ -void SysTick_Handler(void) -{ - /* enter interrupt */ - rt_interrupt_enter(); - - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); -} - -void rt_hw_cpu_reset(void) -{ - SYS_UnlockReg(); - - SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk; -} - -int reboot(int argc, char** argv) -{ - rt_hw_cpu_reset(); - return 0; -} -MSH_CMD_EXPORT(reboot, Reboot System); -- cgit v1.3.1
-

404 - file not found

-

Go here instead.

-